Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Sep 2013 21:27:46 +0000 (14:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Sep 2013 21:27:46 +0000 (14:27 -0700)
Pull networking fixes from David Miller:
 "A quick set of fixes, some to deal with fallout from yesterday's
  net-next merge.

   1) Fix compilation of bnx2x driver with CONFIG_BNX2X_SRIOV disabled,
      from Dmitry Kravkov.

   2) Fix a bnx2x regression caused by one of Dave Jones's mistaken
      braces changes, from Eilon Greenstein.

   3) Add some protective filtering in the netlink tap code, from Daniel
      Borkmann.

   4) Fix TCP congestion window growth regression after timeouts, from
      Yuchung Cheng.

   5) Correctly adjust TCP's rcv_ssthresh for out of order packets, from
      Eric Dumazet"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  tcp: properly increase rcv_ssthresh for ofo packets
  net: add documentation for BQL helpers
  mlx5: remove unused MLX5_DEBUG param in Kconfig
  bnx2x: Restore a call to config_init
  bnx2x: fix broken compilation with CONFIG_BNX2X_SRIOV is not set
  tcp: fix no cwnd growth after timeout
  net: netlink: filter particular protocols from analyzers

1333 files changed:
CREDITS
Documentation/00-INDEX
Documentation/ABI/testing/sysfs-block-zram
Documentation/ABI/testing/sysfs-fs-f2fs [new file with mode: 0644]
Documentation/DocBook/media/v4l/vidioc-g-parm.xml
Documentation/IRQ-affinity.txt
Documentation/SubmittingPatches
Documentation/acpi/enumeration.txt
Documentation/arm/OMAP/omap_pm
Documentation/arm64/booting.txt
Documentation/arm64/tagged-pointers.txt [new file with mode: 0644]
Documentation/block/cfq-iosched.txt
Documentation/cachetlb.txt
Documentation/cputopology.txt
Documentation/development-process/2.Process
Documentation/devicetree/bindings/arm/bcm/bcm11351.txt
Documentation/devicetree/bindings/arm/bcm/kona-timer.txt [moved from Documentation/devicetree/bindings/arm/bcm/bcm,kona-timer.txt with 80% similarity]
Documentation/devicetree/bindings/arm/bcm/kona-wdt.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/omap/omap.txt
Documentation/devicetree/bindings/arm/ste-u300.txt
Documentation/devicetree/bindings/arm/vexpress-scc.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/vexpress-sysreg.txt
Documentation/devicetree/bindings/bus/imx-weim.txt
Documentation/devicetree/bindings/bus/mvebu-mbus.txt [new file with mode: 0644]
Documentation/devicetree/bindings/c6x/dscr.txt
Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
Documentation/devicetree/bindings/clock/imx5-clock.txt
Documentation/devicetree/bindings/clock/imx6q-clock.txt
Documentation/devicetree/bindings/clock/st,nomadik.txt
Documentation/devicetree/bindings/crypto/fsl-sec6.txt [new file with mode: 0644]
Documentation/devicetree/bindings/dma/atmel-dma.txt
Documentation/devicetree/bindings/dma/fsl-imx-dma.txt
Documentation/devicetree/bindings/dma/ste-dma40.txt
Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
Documentation/devicetree/bindings/gpio/gpio-palmas.txt [new file with mode: 0644]
Documentation/devicetree/bindings/gpio/gpio-tz1090-pdc.txt [new file with mode: 0644]
Documentation/devicetree/bindings/gpio/gpio-tz1090.txt [new file with mode: 0644]
Documentation/devicetree/bindings/gpio/mrvl-gpio.txt
Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
Documentation/devicetree/bindings/hid/hid-over-i2c.txt [new file with mode: 0644]
Documentation/devicetree/bindings/input/input-reset.txt [new file with mode: 0644]
Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt
Documentation/devicetree/bindings/media/s5p-mfc.txt
Documentation/devicetree/bindings/mfd/cros-ec.txt
Documentation/devicetree/bindings/misc/smc.txt
Documentation/devicetree/bindings/mmc/kona-sdhci.txt [moved from Documentation/devicetree/bindings/mmc/bcm,kona-sdhci.txt with 67% similarity]
Documentation/devicetree/bindings/net/can/atmel-can.txt
Documentation/devicetree/bindings/pci/mvebu-pci.txt
Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt [new file with mode: 0644]
Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt
Documentation/devicetree/bindings/pinctrl/nvidia,tegra114-pinmux.txt
Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.txt
Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.txt
Documentation/devicetree/bindings/pinctrl/ste,nomadik.txt
Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt
Documentation/devicetree/bindings/rtc/dw-apb.txt
Documentation/devicetree/bindings/serial/altera_jtaguart.txt
Documentation/devicetree/bindings/serial/altera_uart.txt
Documentation/devicetree/bindings/serial/rs485.txt
Documentation/devicetree/bindings/serio/altera_ps2.txt
Documentation/devicetree/bindings/spi/spi_altera.txt
Documentation/devicetree/bindings/vendor-prefixes.txt
Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt [moved from Documentation/devicetree/bindings/watchdog/sun4i-wdt.txt with 56% similarity]
Documentation/dma-buf-sharing.txt
Documentation/early-userspace/README
Documentation/fb/fbcon.txt
Documentation/fb/viafb.modes
Documentation/fb/viafb.txt
Documentation/filesystems/btrfs.txt
Documentation/filesystems/ext3.txt
Documentation/filesystems/ext4.txt
Documentation/filesystems/f2fs.txt
Documentation/filesystems/nfs/Exporting
Documentation/filesystems/nfs/pnfs.txt
Documentation/filesystems/qnx6.txt
Documentation/filesystems/relay.txt
Documentation/filesystems/sysfs-tagging.txt
Documentation/filesystems/xfs.txt
Documentation/fmc/carrier.txt
Documentation/hid/uhid.txt
Documentation/hwmon/abituguru-datasheet
Documentation/hwmon/submitting-patches
Documentation/hwmon/w83791d
Documentation/hwmon/w83792d
Documentation/hwspinlock.txt
Documentation/i2c/upgrading-clients
Documentation/input/gamepad.txt [new file with mode: 0644]
Documentation/kmemcheck.txt
Documentation/leds/leds-lm3556.txt
Documentation/leds/leds-lp3944.txt
Documentation/memory-hotplug.txt
Documentation/mtd/nand_ecc.txt
Documentation/power/basic-pm-debugging.txt
Documentation/power/swsusp.txt
Documentation/powerpc/00-INDEX
Documentation/printk-formats.txt
Documentation/rapidio/rapidio.txt
Documentation/scsi/hptiop.txt
Documentation/sound/alsa/README.maya44
Documentation/sound/alsa/compress_offload.txt
Documentation/sysfs-rules.txt
Documentation/target/tcm_mod_builder.py
Documentation/trace/ftrace.txt
Documentation/trace/tracepoints.txt
Documentation/virtual/kvm/api.txt
Documentation/x86/boot.txt
Documentation/zh_CN/SubmittingPatches
MAINTAINERS
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/Makefile
arch/arm/boot/compressed/head-shmobile.S
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/armada-370-db.dts
arch/arm/boot/dts/armada-370-mirabox.dts
arch/arm/boot/dts/armada-370-netgear-rn102.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-370-rd.dts
arch/arm/boot/dts/armada-370-xp.dtsi
arch/arm/boot/dts/armada-370.dtsi
arch/arm/boot/dts/armada-xp-axpwifiap.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-xp-db.dts
arch/arm/boot/dts/armada-xp-gp.dts
arch/arm/boot/dts/armada-xp-mv78230.dtsi
arch/arm/boot/dts/armada-xp-mv78260.dtsi
arch/arm/boot/dts/armada-xp-mv78460.dtsi
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
arch/arm/boot/dts/armada-xp.dtsi
arch/arm/boot/dts/at91rm9200.dtsi
arch/arm/boot/dts/at91rm9200_pqfp.dtsi [new file with mode: 0644]
arch/arm/boot/dts/at91sam9260.dtsi
arch/arm/boot/dts/at91sam9n12.dtsi
arch/arm/boot/dts/at91sam9n12ek.dts
arch/arm/boot/dts/at91sam9x5.dtsi
arch/arm/boot/dts/at91sam9x5ek.dtsi
arch/arm/boot/dts/bcm11351-brt.dts
arch/arm/boot/dts/bcm11351.dtsi
arch/arm/boot/dts/bcm28155-ap.dts [new file with mode: 0644]
arch/arm/boot/dts/ccu8540.dts [deleted file]
arch/arm/boot/dts/da850-evm.dts
arch/arm/boot/dts/da850.dtsi
arch/arm/boot/dts/dove-cubox.dts
arch/arm/boot/dts/dove-d2plug.dts [new file with mode: 0644]
arch/arm/boot/dts/dove.dtsi
arch/arm/boot/dts/emev2-kzm9d-reference.dts [new file with mode: 0644]
arch/arm/boot/dts/emev2-kzm9d.dts
arch/arm/boot/dts/emev2.dtsi
arch/arm/boot/dts/exynos4.dtsi
arch/arm/boot/dts/exynos4210-pinctrl.dtsi
arch/arm/boot/dts/exynos4210-trats.dts
arch/arm/boot/dts/exynos4210.dtsi
arch/arm/boot/dts/exynos4412-origen.dts
arch/arm/boot/dts/exynos4412-trats2.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
arch/arm/boot/dts/exynos4x12.dtsi
arch/arm/boot/dts/exynos5.dtsi
arch/arm/boot/dts/exynos5250-arndale.dts
arch/arm/boot/dts/exynos5250-smdk5250.dts
arch/arm/boot/dts/exynos5250.dtsi
arch/arm/boot/dts/exynos5420-pinctrl.dtsi
arch/arm/boot/dts/exynos5420-smdk5420.dts
arch/arm/boot/dts/exynos5420.dtsi
arch/arm/boot/dts/exynos5440.dtsi
arch/arm/boot/dts/imx23-evk.dts
arch/arm/boot/dts/imx23-olinuxino.dts
arch/arm/boot/dts/imx23.dtsi
arch/arm/boot/dts/imx25.dtsi
arch/arm/boot/dts/imx27-apf27dev.dts
arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts [new file with mode: 0644]
arch/arm/boot/dts/imx27-phytec-phycard-s-som.dts [new file with mode: 0644]
arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts
arch/arm/boot/dts/imx27-phytec-phycore-som.dts
arch/arm/boot/dts/imx27.dtsi
arch/arm/boot/dts/imx28-cfa10036.dts
arch/arm/boot/dts/imx28-cfa10037.dts
arch/arm/boot/dts/imx28-cfa10049.dts
arch/arm/boot/dts/imx28-cfa10055.dts
arch/arm/boot/dts/imx28-cfa10056.dts [new file with mode: 0644]
arch/arm/boot/dts/imx28-cfa10057.dts
arch/arm/boot/dts/imx28-cfa10058.dts [new file with mode: 0644]
arch/arm/boot/dts/imx28-m28evk.dts
arch/arm/boot/dts/imx28.dtsi
arch/arm/boot/dts/imx31.dtsi
arch/arm/boot/dts/imx51-apf51.dts
arch/arm/boot/dts/imx51-babbage.dts
arch/arm/boot/dts/imx51.dtsi
arch/arm/boot/dts/imx53-qsb.dts
arch/arm/boot/dts/imx53.dtsi
arch/arm/boot/dts/imx6dl-pinfunc.h
arch/arm/boot/dts/imx6dl-sabreauto.dts
arch/arm/boot/dts/imx6dl-sabresd.dts
arch/arm/boot/dts/imx6dl-wandboard.dts
arch/arm/boot/dts/imx6dl.dtsi
arch/arm/boot/dts/imx6q-arm2.dts
arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
arch/arm/boot/dts/imx6q-pinfunc.h
arch/arm/boot/dts/imx6q-sabreauto.dts
arch/arm/boot/dts/imx6q-sabrelite.dts
arch/arm/boot/dts/imx6q-sabresd.dts
arch/arm/boot/dts/imx6q-wandboard.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6q.dtsi
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
arch/arm/boot/dts/imx6qdl-sabresd.dtsi
arch/arm/boot/dts/imx6qdl-wandboard.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx6qdl.dtsi
arch/arm/boot/dts/imx6sl.dtsi
arch/arm/boot/dts/keystone.dts
arch/arm/boot/dts/kirkwood-6281.dtsi
arch/arm/boot/dts/kirkwood-6282.dtsi
arch/arm/boot/dts/kirkwood-cloudbox.dts
arch/arm/boot/dts/kirkwood-db-88f6281.dts
arch/arm/boot/dts/kirkwood-db-88f6282.dts
arch/arm/boot/dts/kirkwood-db.dtsi
arch/arm/boot/dts/kirkwood-dns320.dts
arch/arm/boot/dts/kirkwood-dns325.dts
arch/arm/boot/dts/kirkwood-dnskw.dtsi
arch/arm/boot/dts/kirkwood-dockstar.dts
arch/arm/boot/dts/kirkwood-dreamplug.dts
arch/arm/boot/dts/kirkwood-goflexnet.dts
arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
arch/arm/boot/dts/kirkwood-ib62x0.dts
arch/arm/boot/dts/kirkwood-iconnect.dts
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
arch/arm/boot/dts/kirkwood-is2.dts
arch/arm/boot/dts/kirkwood-km_kirkwood.dts
arch/arm/boot/dts/kirkwood-lschlv2.dts
arch/arm/boot/dts/kirkwood-lsxhl.dts
arch/arm/boot/dts/kirkwood-lsxl.dtsi
arch/arm/boot/dts/kirkwood-mplcec4.dts
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts [new file with mode: 0644]
arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
arch/arm/boot/dts/kirkwood-ns2-common.dtsi
arch/arm/boot/dts/kirkwood-ns2.dts
arch/arm/boot/dts/kirkwood-ns2lite.dts
arch/arm/boot/dts/kirkwood-ns2max.dts
arch/arm/boot/dts/kirkwood-ns2mini.dts
arch/arm/boot/dts/kirkwood-nsa310-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/kirkwood-nsa310.dts
arch/arm/boot/dts/kirkwood-nsa310a.dts [new file with mode: 0644]
arch/arm/boot/dts/kirkwood-openblocks_a6.dts
arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
arch/arm/boot/dts/kirkwood-sheevaplug.dts
arch/arm/boot/dts/kirkwood-topkick.dts
arch/arm/boot/dts/kirkwood-ts219-6281.dts
arch/arm/boot/dts/kirkwood-ts219-6282.dts
arch/arm/boot/dts/kirkwood-ts219.dtsi
arch/arm/boot/dts/kirkwood.dtsi
arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts
arch/arm/boot/dts/orion5x.dtsi
arch/arm/boot/dts/pxa3xx.dtsi
arch/arm/boot/dts/r8a73a4-ape6evm.dts
arch/arm/boot/dts/r8a73a4.dtsi
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts
arch/arm/boot/dts/r8a7740.dtsi
arch/arm/boot/dts/r8a7778.dtsi
arch/arm/boot/dts/r8a7779-marzen-reference.dts
arch/arm/boot/dts/r8a7779.dtsi
arch/arm/boot/dts/r8a7790.dtsi
arch/arm/boot/dts/sama5d3.dtsi
arch/arm/boot/dts/sh7372.dtsi
arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
arch/arm/boot/dts/sh73a0.dtsi
arch/arm/boot/dts/skeleton64.dtsi
arch/arm/boot/dts/socfpga.dtsi
arch/arm/boot/dts/ste-ccu8540-pinctrl.dtsi [new file with mode: 0644]
arch/arm/boot/dts/ste-ccu8540.dts [new file with mode: 0644]
arch/arm/boot/dts/ste-ccu9540.dts [moved from arch/arm/boot/dts/ccu9540.dts with 98% similarity]
arch/arm/boot/dts/ste-dbx5x0.dtsi [moved from arch/arm/boot/dts/dbx5x0.dtsi with 96% similarity]
arch/arm/boot/dts/ste-href.dtsi [moved from arch/arm/boot/dts/href.dtsi with 99% similarity]
arch/arm/boot/dts/ste-hrefprev60.dts [moved from arch/arm/boot/dts/hrefprev60.dts with 92% similarity]
arch/arm/boot/dts/ste-hrefv60plus.dts [moved from arch/arm/boot/dts/hrefv60plus.dts with 98% similarity]
arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi [new file with mode: 0644]
arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
arch/arm/boot/dts/ste-snowball.dts [moved from arch/arm/boot/dts/snowball.dts with 93% similarity]
arch/arm/boot/dts/ste-stuib.dtsi [moved from arch/arm/boot/dts/stuib.dtsi with 100% similarity]
arch/arm/boot/dts/sun4i-a10-a1000.dts [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10-cubieboard.dts
arch/arm/boot/dts/sun4i-a10-hackberry.dts
arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
arch/arm/boot/dts/sun4i-a10.dtsi
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
arch/arm/boot/dts/sun5i-a10s.dtsi
arch/arm/boot/dts/sun5i-a13-olinuxino.dts
arch/arm/boot/dts/sun5i-a13.dtsi
arch/arm/boot/dts/sun6i-a31-colombus.dts [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20.dtsi [new file with mode: 0644]
arch/arm/boot/dts/tegra114-dalmore.dts
arch/arm/boot/dts/tegra114-pluto.dts [deleted file]
arch/arm/boot/dts/tegra114.dtsi
arch/arm/boot/dts/tegra20-colibri-512.dtsi
arch/arm/boot/dts/tegra20-harmony.dts
arch/arm/boot/dts/tegra20-paz00.dts
arch/arm/boot/dts/tegra20-seaboard.dts
arch/arm/boot/dts/tegra20-tamonten.dtsi
arch/arm/boot/dts/tegra20-tec.dts
arch/arm/boot/dts/tegra20-trimslice.dts
arch/arm/boot/dts/tegra20-ventana.dts
arch/arm/boot/dts/tegra20-whistler.dts
arch/arm/boot/dts/tegra20.dtsi
arch/arm/boot/dts/tegra30-beaver.dts
arch/arm/boot/dts/tegra30-cardhu.dtsi
arch/arm/boot/dts/tegra30.dtsi
arch/arm/boot/dts/u9540.dts [deleted file]
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
arch/arm/boot/dts/vf610-twr.dts
arch/arm/boot/dts/zynq-7000.dtsi
arch/arm/configs/ape6evm_defconfig
arch/arm/configs/bcm_defconfig
arch/arm/configs/dove_defconfig
arch/arm/configs/exynos4_defconfig [deleted file]
arch/arm/configs/imx_v4_v5_defconfig
arch/arm/configs/imx_v6_v7_defconfig
arch/arm/configs/kirkwood_defconfig
arch/arm/configs/lager_defconfig [new file with mode: 0644]
arch/arm/configs/marzen_defconfig
arch/arm/configs/mvebu_defconfig
arch/arm/configs/mxs_defconfig
arch/arm/configs/omap2plus_defconfig
arch/arm/configs/tegra_defconfig
arch/arm/include/asm/elf.h
arch/arm/include/asm/localtimer.h [deleted file]
arch/arm/include/asm/mach/pci.h
arch/arm/include/debug/msm.S [moved from arch/arm/mach-msm/include/mach/debug-macro.S with 61% similarity]
arch/arm/kernel/bios32.c
arch/arm/kernel/smp.c
arch/arm/kernel/smp_twd.c
arch/arm/mach-at91/board-dt-sama5.c
arch/arm/mach-at91/board-snapper9260.c
arch/arm/mach-bcm/Kconfig
arch/arm/mach-bcm/Makefile
arch/arm/mach-bcm/bcm_kona_smc.c
arch/arm/mach-bcm/bcm_kona_smc.h
arch/arm/mach-bcm/board_bcm281xx.c [moved from arch/arm/mach-bcm/board_bcm.c with 68% similarity]
arch/arm/mach-bcm/kona.c [new file with mode: 0644]
arch/arm/mach-bcm/kona.h [new file with mode: 0644]
arch/arm/mach-clps711x/Kconfig
arch/arm/mach-clps711x/Makefile
arch/arm/mach-clps711x/board-autcpu12.c
arch/arm/mach-clps711x/board-edb7211.c
arch/arm/mach-clps711x/board-fortunet.c [deleted file]
arch/arm/mach-clps711x/devices.c
arch/arm/mach-davinci/board-da830-evm.c
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/board-dm355-evm.c
arch/arm/mach-davinci/board-dm355-leopard.c
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-davinci/board-mityomapl138.c
arch/arm/mach-davinci/board-neuros-osd2.c
arch/arm/mach-davinci/board-omapl138-hawk.c
arch/arm/mach-davinci/board-sffsdr.c
arch/arm/mach-davinci/da830.c
arch/arm/mach-davinci/da850.c
arch/arm/mach-davinci/da8xx-dt.c
arch/arm/mach-davinci/davinci.h
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/devices-tnetv107x.c
arch/arm/mach-davinci/dm355.c
arch/arm/mach-davinci/dm365.c
arch/arm/mach-davinci/dm644x.c
arch/arm/mach-davinci/dm646x.c
arch/arm/mach-davinci/include/mach/common.h
arch/arm/mach-davinci/include/mach/da8xx.h
arch/arm/mach-davinci/include/mach/serial.h
arch/arm/mach-davinci/include/mach/tnetv107x.h
arch/arm/mach-davinci/serial.c
arch/arm/mach-davinci/tnetv107x.c
arch/arm/mach-dove/Kconfig
arch/arm/mach-dove/Makefile
arch/arm/mach-dove/board-dt.c
arch/arm/mach-dove/common.c
arch/arm/mach-dove/mpp.c
arch/arm/mach-ep93xx/vision_ep9307.c
arch/arm/mach-exynos/common.h
arch/arm/mach-highbank/Kconfig
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/Makefile
arch/arm/mach-imx/anatop.c
arch/arm/mach-imx/clk-fixup-div.c [new file with mode: 0644]
arch/arm/mach-imx/clk-fixup-mux.c [new file with mode: 0644]
arch/arm/mach-imx/clk-imx51-imx53.c
arch/arm/mach-imx/clk-imx6q.c
arch/arm/mach-imx/clk-imx6sl.c
arch/arm/mach-imx/clk-pllv3.c
arch/arm/mach-imx/clk.c
arch/arm/mach-imx/clk.h
arch/arm/mach-imx/common.h
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
arch/arm/mach-imx/mach-imx6q.c
arch/arm/mach-imx/mach-imx6sl.c
arch/arm/mach-imx/mach-mxt_td60.c
arch/arm/mach-imx/mm-imx5.c
arch/arm/mach-imx/pm-imx5.c
arch/arm/mach-imx/system.c
arch/arm/mach-keystone/Kconfig
arch/arm/mach-keystone/platsmp.c
arch/arm/mach-keystone/smc.S
arch/arm/mach-kirkwood/Kconfig
arch/arm/mach-kirkwood/Makefile
arch/arm/mach-kirkwood/board-db88f628x-bp.c [deleted file]
arch/arm/mach-kirkwood/board-dnskw.c [deleted file]
arch/arm/mach-kirkwood/board-dockstar.c [deleted file]
arch/arm/mach-kirkwood/board-dreamplug.c [deleted file]
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/board-goflexnet.c [deleted file]
arch/arm/mach-kirkwood/board-guruplug.c [deleted file]
arch/arm/mach-kirkwood/board-ib62x0.c [deleted file]
arch/arm/mach-kirkwood/board-iconnect.c [deleted file]
arch/arm/mach-kirkwood/board-iomega_ix2_200.c [deleted file]
arch/arm/mach-kirkwood/board-km_kirkwood.c [deleted file]
arch/arm/mach-kirkwood/board-lsxl.c [deleted file]
arch/arm/mach-kirkwood/board-mplcec4.c [deleted file]
arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c [new file with mode: 0644]
arch/arm/mach-kirkwood/board-ns2.c [deleted file]
arch/arm/mach-kirkwood/board-openblocks_a6.c [deleted file]
arch/arm/mach-kirkwood/board-readynas.c [deleted file]
arch/arm/mach-kirkwood/board-sheevaplug.c [deleted file]
arch/arm/mach-kirkwood/board-ts219.c [deleted file]
arch/arm/mach-kirkwood/board-usi_topkick.c [deleted file]
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/common.h
arch/arm/mach-kirkwood/dockstar-setup.c [deleted file]
arch/arm/mach-kirkwood/guruplug-setup.c [deleted file]
arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c [deleted file]
arch/arm/mach-kirkwood/netspace_v2-setup.c [deleted file]
arch/arm/mach-kirkwood/openrd-setup.c
arch/arm/mach-kirkwood/pcie.c
arch/arm/mach-kirkwood/rd88f6281-setup.c
arch/arm/mach-kirkwood/sheevaplug-setup.c [deleted file]
arch/arm/mach-ks8695/board-acs5k.c
arch/arm/mach-mmp/ttc_dkb.c
arch/arm/mach-msm/Makefile
arch/arm/mach-msm/board-dt-8660.c
arch/arm/mach-msm/board-dt-8960.c
arch/arm/mach-msm/board-halibut.c
arch/arm/mach-msm/board-mahimahi.c
arch/arm/mach-msm/board-msm7x30.c
arch/arm/mach-msm/board-qsd8x50.c
arch/arm/mach-msm/board-sapphire.c
arch/arm/mach-msm/board-trout.c
arch/arm/mach-msm/board-trout.h
arch/arm/mach-msm/common.h
arch/arm/mach-msm/devices-iommu.c [deleted file]
arch/arm/mach-msm/devices-msm7x30.c
arch/arm/mach-msm/devices-qsd8x50.c
arch/arm/mach-msm/include/mach/board.h [deleted file]
arch/arm/mach-msm/include/mach/msm_iomap-8960.h [deleted file]
arch/arm/mach-msm/include/mach/msm_iomap-8x60.h [deleted file]
arch/arm/mach-msm/include/mach/msm_iomap.h
arch/arm/mach-msm/include/mach/uncompress.h [deleted file]
arch/arm/mach-msm/io.c
arch/arm/mach-msm/timer.c
arch/arm/mach-mv78xx0/pcie.c
arch/arm/mach-mvebu/armada-370-xp.c
arch/arm/mach-mvebu/platsmp.c
arch/arm/mach-mxs/mach-mxs.c
arch/arm/mach-mxs/pm.c
arch/arm/mach-nomadik/Kconfig
arch/arm/mach-omap1/include/mach/soc.h
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/am33xx-restart.c
arch/arm/mach-omap2/board-am3517crane.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/cm-regbits-24xx.h
arch/arm/mach-omap2/cm-regbits-33xx.h
arch/arm/mach-omap2/cm-regbits-34xx.h
arch/arm/mach-omap2/cm-regbits-44xx.h
arch/arm/mach-omap2/cm-regbits-54xx.h
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/gpmc.c
arch/arm/mach-omap2/id.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/omap54xx.h
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod_54xx_data.c
arch/arm/mach-omap2/powerdomains54xx_data.c
arch/arm/mach-omap2/prm-regbits-24xx.h
arch/arm/mach-omap2/prm-regbits-33xx.h
arch/arm/mach-omap2/prm-regbits-34xx.h
arch/arm/mach-omap2/prm-regbits-44xx.h
arch/arm/mach-omap2/prm-regbits-54xx.h [deleted file]
arch/arm/mach-omap2/soc.h
arch/arm/mach-omap2/timer.c
arch/arm/mach-orion5x/common.c
arch/arm/mach-orion5x/common.h
arch/arm/mach-orion5x/d2net-setup.c
arch/arm/mach-orion5x/db88f5281-setup.c
arch/arm/mach-orion5x/dns323-setup.c
arch/arm/mach-orion5x/edmini_v2-setup.c
arch/arm/mach-orion5x/kurobox_pro-setup.c
arch/arm/mach-orion5x/ls-chl-setup.c
arch/arm/mach-orion5x/ls_hgl-setup.c
arch/arm/mach-orion5x/lsmini-setup.c
arch/arm/mach-orion5x/mss2-setup.c
arch/arm/mach-orion5x/mv2120-setup.c
arch/arm/mach-orion5x/net2big-setup.c
arch/arm/mach-orion5x/pci.c
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
arch/arm/mach-orion5x/rd88f5182-setup.c
arch/arm/mach-orion5x/terastation_pro2-setup.c
arch/arm/mach-orion5x/ts209-setup.c
arch/arm/mach-orion5x/ts409-setup.c
arch/arm/mach-orion5x/wnr854t-setup.c
arch/arm/mach-orion5x/wrt350n-v2-setup.c
arch/arm/mach-prima2/pm.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/pxa-dt.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/zeus.c
arch/arm/mach-pxa/zylonite_pxa300.c
arch/arm/mach-realview/Kconfig
arch/arm/mach-s3c24xx/Kconfig
arch/arm/mach-s3c24xx/clock-s3c2410.c
arch/arm/mach-s3c24xx/clock-s3c2412.c
arch/arm/mach-s3c24xx/clock-s3c2416.c
arch/arm/mach-s3c24xx/clock-s3c2443.c
arch/arm/mach-s3c24xx/common.c
arch/arm/mach-s3c24xx/include/mach/map.h
arch/arm/mach-s3c24xx/mach-h1940.c
arch/arm/mach-s3c24xx/mach-rx1950.c
arch/arm/mach-s3c64xx/Kconfig
arch/arm/mach-s3c64xx/clock.c
arch/arm/mach-s3c64xx/common.c
arch/arm/mach-s3c64xx/include/mach/irqs.h
arch/arm/mach-s3c64xx/include/mach/map.h
arch/arm/mach-s3c64xx/irq-pm.c
arch/arm/mach-s3c64xx/mach-crag6410.c
arch/arm/mach-s3c64xx/mach-hmt.c
arch/arm/mach-s3c64xx/mach-smartq.c
arch/arm/mach-s3c64xx/mach-smdk6410.c
arch/arm/mach-s5p64x0/Kconfig
arch/arm/mach-s5p64x0/clock-s5p6440.c
arch/arm/mach-s5p64x0/clock-s5p6450.c
arch/arm/mach-s5p64x0/common.c
arch/arm/mach-s5p64x0/include/mach/irqs.h
arch/arm/mach-s5p64x0/include/mach/map.h
arch/arm/mach-s5p64x0/mach-smdk6440.c
arch/arm/mach-s5p64x0/mach-smdk6450.c
arch/arm/mach-s5p64x0/pm.c
arch/arm/mach-s5pc100/Kconfig
arch/arm/mach-s5pc100/clock.c
arch/arm/mach-s5pc100/common.c
arch/arm/mach-s5pc100/include/mach/irqs.h
arch/arm/mach-s5pc100/include/mach/map.h
arch/arm/mach-s5pc100/mach-smdkc100.c
arch/arm/mach-s5pv210/Kconfig
arch/arm/mach-s5pv210/clock.c
arch/arm/mach-s5pv210/common.c
arch/arm/mach-s5pv210/include/mach/irqs.h
arch/arm/mach-s5pv210/include/mach/map.h
arch/arm/mach-s5pv210/mach-smdkv210.c
arch/arm/mach-s5pv210/pm.c
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/Makefile.boot
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ape6evm.c
arch/arm/mach-shmobile/board-armadillo800eva-reference.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-kota2.c
arch/arm/mach-shmobile/board-kzm9d-reference.c [new file with mode: 0644]
arch/arm/mach-shmobile/board-kzm9d.c
arch/arm/mach-shmobile/board-kzm9g-reference.c
arch/arm/mach-shmobile/board-lager.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/board-marzen-reference.c
arch/arm/mach-shmobile/clock-emev2.c
arch/arm/mach-shmobile/clock-r8a73a4.c
arch/arm/mach-shmobile/clock-r8a7740.c
arch/arm/mach-shmobile/clock-r8a7790.c
arch/arm/mach-shmobile/clock-sh73a0.c
arch/arm/mach-shmobile/headsmp-scu.S
arch/arm/mach-shmobile/headsmp.S
arch/arm/mach-shmobile/include/mach/dma.h [deleted file]
arch/arm/mach-shmobile/include/mach/emev2.h
arch/arm/mach-shmobile/include/mach/r8a73a4.h
arch/arm/mach-shmobile/include/mach/r8a7740.h
arch/arm/mach-shmobile/include/mach/r8a7778.h
arch/arm/mach-shmobile/include/mach/r8a7790.h
arch/arm/mach-shmobile/include/mach/sh73a0.h
arch/arm/mach-shmobile/include/mach/zboot.h
arch/arm/mach-shmobile/setup-emev2.c
arch/arm/mach-shmobile/setup-r8a73a4.c
arch/arm/mach-shmobile/setup-r8a7740.c
arch/arm/mach-shmobile/setup-r8a7778.c
arch/arm/mach-shmobile/setup-r8a7779.c
arch/arm/mach-shmobile/setup-r8a7790.c
arch/arm/mach-shmobile/setup-sh7372.c
arch/arm/mach-shmobile/setup-sh73a0.c
arch/arm/mach-shmobile/sleep-sh7372.S
arch/arm/mach-shmobile/smp-emev2.c
arch/arm/mach-spear/Kconfig
arch/arm/mach-sunxi/Kconfig
arch/arm/mach-sunxi/Makefile.boot [deleted file]
arch/arm/mach-sunxi/sunxi.c
arch/arm/mach-tegra/Kconfig
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-harmony-pcie.c [deleted file]
arch/arm/mach-tegra/board.h
arch/arm/mach-tegra/common.h
arch/arm/mach-tegra/cpuidle-tegra114.c
arch/arm/mach-tegra/cpuidle-tegra20.c
arch/arm/mach-tegra/cpuidle.c
arch/arm/mach-tegra/cpuidle.h
arch/arm/mach-tegra/flowctrl.c
arch/arm/mach-tegra/flowctrl.h
arch/arm/mach-tegra/headsmp.S
arch/arm/mach-tegra/hotplug.c
arch/arm/mach-tegra/iomap.h
arch/arm/mach-tegra/irq.c
arch/arm/mach-tegra/pcie.c [deleted file]
arch/arm/mach-tegra/platsmp.c
arch/arm/mach-tegra/pm-tegra20.c [new file with mode: 0644]
arch/arm/mach-tegra/pm-tegra30.c [new file with mode: 0644]
arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/pm.h
arch/arm/mach-tegra/pmc.c
arch/arm/mach-tegra/pmc.h
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.S
arch/arm/mach-tegra/sleep.h
arch/arm/mach-tegra/tegra.c
arch/arm/mach-ux500/Kconfig
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/cpu-db8500.c
arch/arm/mach-ux500/cpu.c
arch/arm/mach-ux500/devices-db8500.c
arch/arm/mach-ux500/headsmp.S
arch/arm/mach-ux500/setup.h
arch/arm/mach-vexpress/Kconfig
arch/arm/mach-vexpress/Makefile
arch/arm/mach-vexpress/dcscb.c
arch/arm/mach-vexpress/spc.c [new file with mode: 0644]
arch/arm/mach-vexpress/spc.h [new file with mode: 0644]
arch/arm/mach-vexpress/tc2_pm.c [new file with mode: 0644]
arch/arm/mach-zynq/Kconfig
arch/arm/mach-zynq/hotplug.c
arch/arm/mach-zynq/slcr.c
arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/dma.c
arch/arm/plat-orion/irq.c
arch/arm/plat-samsung/Kconfig
arch/arm/plat-samsung/Makefile
arch/arm/plat-samsung/dev-backlight.c
arch/arm/plat-samsung/devs.c
arch/arm/plat-samsung/include/plat/clock.h
arch/arm/plat-samsung/include/plat/devs.h
arch/arm/plat-samsung/include/plat/irq-vic-timer.h [deleted file]
arch/arm/plat-samsung/include/plat/irqs.h
arch/arm/plat-samsung/include/plat/pwm-clock.h [deleted file]
arch/arm/plat-samsung/include/plat/pwm-core.h [new file with mode: 0644]
arch/arm/plat-samsung/include/plat/regs-timer.h [deleted file]
arch/arm/plat-samsung/include/plat/samsung-time.h
arch/arm/plat-samsung/include/plat/sdhci.h
arch/arm/plat-samsung/irq-vic-timer.c [deleted file]
arch/arm/plat-samsung/pwm-clock.c [deleted file]
arch/arm/plat-samsung/s5p-irq.c
arch/arm/plat-samsung/samsung-time.c [deleted file]
arch/arm64/Kconfig
arch/arm64/include/asm/elf.h
arch/arm64/include/asm/neon.h [new file with mode: 0644]
arch/arm64/include/asm/pgtable-2level-types.h
arch/arm64/include/asm/pgtable-3level-types.h
arch/arm64/include/asm/pgtable-hwdef.h
arch/arm64/kernel/entry.S
arch/arm64/kernel/fpsimd.c
arch/arm64/kernel/head.S
arch/arm64/kernel/perf_event.c
arch/arm64/kernel/setup.c
arch/arm64/kernel/smp.c
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/mm/mmu.c
arch/arm64/mm/proc.S
arch/ia64/Kconfig
arch/ia64/include/asm/bitops.h
arch/ia64/include/asm/dmi.h
arch/microblaze/Kconfig
arch/microblaze/Makefile
arch/microblaze/boot/Makefile
arch/microblaze/include/asm/selfmod.h [deleted file]
arch/microblaze/kernel/Makefile
arch/microblaze/kernel/cpu/cpuinfo.c
arch/microblaze/kernel/intc.c
arch/microblaze/kernel/irq.c
arch/microblaze/kernel/reset.c
arch/microblaze/kernel/selfmod.c [deleted file]
arch/microblaze/kernel/setup.c
arch/microblaze/kernel/timer.c
arch/microblaze/pci/pci-common.c
arch/microblaze/platform/Kconfig.platform
arch/mips/Kconfig
arch/mips/include/asm/pci.h
arch/parisc/kernel/signal.c
arch/powerpc/Kconfig
arch/powerpc/Makefile
arch/powerpc/boot/.gitignore
arch/powerpc/boot/dts/ac14xx.dts
arch/powerpc/boot/dts/b4420qds.dts
arch/powerpc/boot/dts/b4860qds.dts
arch/powerpc/boot/dts/b4qds.dtsi [moved from arch/powerpc/boot/dts/b4qds.dts with 100% similarity]
arch/powerpc/boot/dts/c293pcie.dts [new file with mode: 0644]
arch/powerpc/boot/dts/fsl/b4si-post.dtsi
arch/powerpc/boot/dts/fsl/c293si-post.dtsi [new file with mode: 0644]
arch/powerpc/boot/dts/fsl/c293si-pre.dtsi [new file with mode: 0644]
arch/powerpc/boot/dts/fsl/qoriq-mpic4.3.dtsi [new file with mode: 0644]
arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi [new file with mode: 0644]
arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
arch/powerpc/boot/dts/include/dt-bindings [new symlink]
arch/powerpc/boot/dts/mpc5121ads.dts
arch/powerpc/boot/dts/p1020rdb-pd.dts [new file with mode: 0644]
arch/powerpc/boot/dts/p1023rdb.dts [new file with mode: 0644]
arch/powerpc/boot/dts/pdm360ng.dts
arch/powerpc/boot/ppc_asm.h
arch/powerpc/boot/util.S
arch/powerpc/configs/85xx/p1023_defconfig [moved from arch/powerpc/configs/85xx/p1023rds_defconfig with 87% similarity]
arch/powerpc/configs/corenet32_smp_defconfig
arch/powerpc/configs/corenet64_smp_defconfig
arch/powerpc/configs/mpc83xx_defconfig
arch/powerpc/configs/mpc85xx_defconfig
arch/powerpc/configs/mpc85xx_smp_defconfig
arch/powerpc/include/asm/asm-compat.h
arch/powerpc/include/asm/btext.h
arch/powerpc/include/asm/cacheflush.h
arch/powerpc/include/asm/cputable.h
arch/powerpc/include/asm/emulated_ops.h
arch/powerpc/include/asm/epapr_hcalls.h
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/include/asm/io.h
arch/powerpc/include/asm/irqflags.h
arch/powerpc/include/asm/lppaca.h
arch/powerpc/include/asm/mpc5121.h
arch/powerpc/include/asm/mpc85xx.h [new file with mode: 0644]
arch/powerpc/include/asm/mpic.h
arch/powerpc/include/asm/opal.h
arch/powerpc/include/asm/paca.h
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/include/asm/pci.h
arch/powerpc/include/asm/perf_event_fsl_emb.h
arch/powerpc/include/asm/plpar_wrappers.h [moved from arch/powerpc/platforms/pseries/plpar_wrappers.h with 90% similarity]
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/include/asm/ppc_asm.h
arch/powerpc/include/asm/prom.h
arch/powerpc/include/asm/reg.h
arch/powerpc/include/asm/reg_booke.h
arch/powerpc/include/asm/reg_fsl_emb.h
arch/powerpc/include/asm/rtas.h
arch/powerpc/include/asm/smp.h
arch/powerpc/include/asm/spinlock.h
arch/powerpc/include/asm/switch_to.h
arch/powerpc/include/asm/timex.h
arch/powerpc/include/asm/topology.h
arch/powerpc/include/asm/udbg.h
arch/powerpc/include/uapi/asm/elf.h
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/align.c
arch/powerpc/kernel/btext.c
arch/powerpc/kernel/cacheinfo.c
arch/powerpc/kernel/cpu_setup_fsl_booke.S
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/epapr_paravirt.c
arch/powerpc/kernel/exceptions-64e.S
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/head_40x.S
arch/powerpc/kernel/head_44x.S
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_8xx.S
arch/powerpc/kernel/head_fsl_booke.S
arch/powerpc/kernel/io-workarounds.c
arch/powerpc/kernel/io.c
arch/powerpc/kernel/legacy_serial.c
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/misc_64.S
arch/powerpc/kernel/paca.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/pci_dn.c
arch/powerpc/kernel/pci_of_scan.c
arch/powerpc/kernel/ppc_ksyms.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/prom_init_check.sh
arch/powerpc/kernel/prom_parse.c
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/powerpc/kernel/smp.c
arch/powerpc/kernel/softemu8xx.c [deleted file]
arch/powerpc/kernel/swsusp_asm64.S
arch/powerpc/kernel/swsusp_booke.S
arch/powerpc/kernel/time.c
arch/powerpc/kernel/tm.S
arch/powerpc/kernel/traps.c
arch/powerpc/kernel/udbg_16550.c
arch/powerpc/kernel/vdso32/gettimeofday.S
arch/powerpc/kernel/vio.c
arch/powerpc/kvm/book3s_64_slb.S
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_rm_mmu.c
arch/powerpc/kvm/book3s_hv_rmhandlers.S
arch/powerpc/kvm/emulate.c
arch/powerpc/lib/locks.c
arch/powerpc/lib/sstep.c
arch/powerpc/math-emu/Makefile
arch/powerpc/math-emu/math.c
arch/powerpc/mm/fault.c
arch/powerpc/mm/gup.c
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/init_32.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/numa.c
arch/powerpc/mm/slb.c
arch/powerpc/mm/subpage-prot.c
arch/powerpc/oprofile/op_model_fsl_emb.c
arch/powerpc/perf/Makefile
arch/powerpc/perf/core-book3s.c
arch/powerpc/perf/core-fsl-emb.c
arch/powerpc/perf/e6500-pmu.c [new file with mode: 0644]
arch/powerpc/platforms/52xx/mpc52xx_pic.c
arch/powerpc/platforms/85xx/Kconfig
arch/powerpc/platforms/85xx/Makefile
arch/powerpc/platforms/85xx/c293pcie.c [new file with mode: 0644]
arch/powerpc/platforms/85xx/corenet_ds.c
arch/powerpc/platforms/85xx/mpc85xx_rdb.c
arch/powerpc/platforms/85xx/p1023_rds.c
arch/powerpc/platforms/85xx/smp.c
arch/powerpc/platforms/Kconfig
arch/powerpc/platforms/Kconfig.cputype
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/powernv/Kconfig
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/eeh-ioda.c
arch/powerpc/platforms/powernv/opal-lpc.c [new file with mode: 0644]
arch/powerpc/platforms/powernv/opal-wrappers.S
arch/powerpc/platforms/powernv/opal.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/powernv.h
arch/powerpc/platforms/powernv/setup.c
arch/powerpc/platforms/powernv/smp.c
arch/powerpc/platforms/pseries/Makefile
arch/powerpc/platforms/pseries/cmm.c
arch/powerpc/platforms/pseries/dlpar.c
arch/powerpc/platforms/pseries/dtl.c
arch/powerpc/platforms/pseries/hotplug-cpu.c
arch/powerpc/platforms/pseries/hvconsole.c
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/platforms/pseries/kexec.c
arch/powerpc/platforms/pseries/lpar.c
arch/powerpc/platforms/pseries/lparcfg.c [moved from arch/powerpc/kernel/lparcfg.c with 98% similarity]
arch/powerpc/platforms/pseries/mobility.c
arch/powerpc/platforms/pseries/processor_idle.c
arch/powerpc/platforms/pseries/pseries.h
arch/powerpc/platforms/pseries/pseries_energy.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/platforms/pseries/smp.c
arch/powerpc/platforms/wsp/wsp.h
arch/powerpc/sysdev/fsl_msi.c
arch/powerpc/sysdev/fsl_msi.h
arch/powerpc/sysdev/fsl_pci.c
arch/powerpc/sysdev/fsl_pci.h
arch/powerpc/sysdev/xics/icp-native.c
arch/powerpc/sysdev/xics/xics-common.c
arch/powerpc/xmon/xmon.c
arch/s390/Kconfig
arch/s390/include/asm/pci.h
arch/sh/boards/mach-ecovec24/setup.c
arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
arch/sh/boards/mach-kfr2r09/setup.c
arch/sh/include/mach-kfr2r09/mach/kfr2r09.h
arch/sparc/Kconfig
arch/tile/Kconfig
arch/tile/Kconfig.debug
arch/tile/Makefile
arch/tile/configs/tilegx_defconfig
arch/tile/configs/tilepro_defconfig
arch/tile/gxio/Kconfig
arch/tile/gxio/Makefile
arch/tile/gxio/iorpc_trio.c
arch/tile/gxio/iorpc_uart.c [new file with mode: 0644]
arch/tile/gxio/uart.c [new file with mode: 0644]
arch/tile/include/arch/trio.h
arch/tile/include/arch/uart.h [new file with mode: 0644]
arch/tile/include/arch/uart_def.h [new file with mode: 0644]
arch/tile/include/asm/Kbuild
arch/tile/include/asm/atomic.h
arch/tile/include/asm/atomic_32.h
arch/tile/include/asm/atomic_64.h
arch/tile/include/asm/barrier.h
arch/tile/include/asm/bitops.h
arch/tile/include/asm/bitops_32.h
arch/tile/include/asm/bitops_64.h
arch/tile/include/asm/cache.h
arch/tile/include/asm/cacheflush.h
arch/tile/include/asm/cmpxchg.h
arch/tile/include/asm/device.h
arch/tile/include/asm/dma-mapping.h
arch/tile/include/asm/elf.h
arch/tile/include/asm/fixmap.h
arch/tile/include/asm/ftrace.h
arch/tile/include/asm/futex.h
arch/tile/include/asm/homecache.h
arch/tile/include/asm/io.h
arch/tile/include/asm/irqflags.h
arch/tile/include/asm/kdebug.h [moved from arch/tile/include/asm/hw_irq.h with 65% similarity]
arch/tile/include/asm/kgdb.h [new file with mode: 0644]
arch/tile/include/asm/kprobes.h [new file with mode: 0644]
arch/tile/include/asm/mmu.h
arch/tile/include/asm/mmu_context.h
arch/tile/include/asm/mmzone.h
arch/tile/include/asm/page.h
arch/tile/include/asm/pci.h
arch/tile/include/asm/pgtable_32.h
arch/tile/include/asm/pgtable_64.h
arch/tile/include/asm/processor.h
arch/tile/include/asm/ptrace.h
arch/tile/include/asm/sections.h
arch/tile/include/asm/setup.h
arch/tile/include/asm/smp.h
arch/tile/include/asm/spinlock_64.h
arch/tile/include/asm/string.h
arch/tile/include/asm/thread_info.h
arch/tile/include/asm/traps.h
arch/tile/include/asm/uaccess.h
arch/tile/include/asm/unaligned.h
arch/tile/include/asm/vdso.h [new file with mode: 0644]
arch/tile/include/gxio/iorpc_trio.h
arch/tile/include/gxio/iorpc_uart.h [new file with mode: 0644]
arch/tile/include/gxio/uart.h [new file with mode: 0644]
arch/tile/include/hv/drv_trio_intf.h
arch/tile/include/hv/drv_uart_intf.h [new file with mode: 0644]
arch/tile/include/hv/hypervisor.h
arch/tile/include/uapi/arch/Kbuild
arch/tile/include/uapi/arch/chip.h
arch/tile/include/uapi/arch/chip_tile64.h [deleted file]
arch/tile/include/uapi/arch/opcode_tilegx.h
arch/tile/include/uapi/arch/opcode_tilepro.h
arch/tile/include/uapi/arch/spr_def_32.h
arch/tile/include/uapi/asm/auxvec.h
arch/tile/include/uapi/asm/cachectl.h
arch/tile/kernel/Makefile
arch/tile/kernel/asm-offsets.c
arch/tile/kernel/compat_signal.c
arch/tile/kernel/early_printk.c
arch/tile/kernel/entry.S
arch/tile/kernel/ftrace.c [new file with mode: 0644]
arch/tile/kernel/hardwall.c
arch/tile/kernel/head_32.S
arch/tile/kernel/head_64.S
arch/tile/kernel/hvglue.S [new file with mode: 0644]
arch/tile/kernel/hvglue.lds [deleted file]
arch/tile/kernel/hvglue_trace.c [new file with mode: 0644]
arch/tile/kernel/intvec_32.S
arch/tile/kernel/intvec_64.S
arch/tile/kernel/irq.c
arch/tile/kernel/kgdb.c [new file with mode: 0644]
arch/tile/kernel/kprobes.c [new file with mode: 0644]
arch/tile/kernel/mcount_64.S [new file with mode: 0644]
arch/tile/kernel/pci-dma.c
arch/tile/kernel/pci.c
arch/tile/kernel/pci_gx.c
arch/tile/kernel/proc.c
arch/tile/kernel/process.c
arch/tile/kernel/ptrace.c
arch/tile/kernel/reboot.c
arch/tile/kernel/regs_32.S
arch/tile/kernel/regs_64.S
arch/tile/kernel/relocate_kernel_32.S
arch/tile/kernel/relocate_kernel_64.S
arch/tile/kernel/setup.c
arch/tile/kernel/signal.c
arch/tile/kernel/single_step.c
arch/tile/kernel/smp.c
arch/tile/kernel/smpboot.c
arch/tile/kernel/stack.c
arch/tile/kernel/sys.c
arch/tile/kernel/sysfs.c
arch/tile/kernel/time.c
arch/tile/kernel/tlb.c
arch/tile/kernel/traps.c
arch/tile/kernel/unaligned.c [new file with mode: 0644]
arch/tile/kernel/vdso.c [new file with mode: 0644]
arch/tile/kernel/vdso/Makefile [new file with mode: 0644]
arch/tile/kernel/vdso/vdso.S [new file with mode: 0644]
arch/tile/kernel/vdso/vdso.lds.S [new file with mode: 0644]
arch/tile/kernel/vdso/vdso32.S [new file with mode: 0644]
arch/tile/kernel/vdso/vgettimeofday.c [new file with mode: 0644]
arch/tile/kernel/vdso/vrt_sigreturn.S [new file with mode: 0644]
arch/tile/kernel/vmlinux.lds.S
arch/tile/lib/Makefile
arch/tile/lib/atomic_32.c
arch/tile/lib/atomic_asm_32.S
arch/tile/lib/cacheflush.c
arch/tile/lib/exports.c
arch/tile/lib/memchr_64.c
arch/tile/lib/memcpy_32.S
arch/tile/lib/memcpy_64.c
arch/tile/lib/memcpy_tile64.c [deleted file]
arch/tile/lib/memcpy_user_64.c
arch/tile/lib/memset_32.c
arch/tile/lib/memset_64.c
arch/tile/lib/strchr_32.c
arch/tile/lib/strchr_64.c
arch/tile/lib/string-endian.h
arch/tile/lib/strlen_32.c
arch/tile/lib/strnlen_32.c [new file with mode: 0644]
arch/tile/lib/strnlen_64.c [new file with mode: 0644]
arch/tile/lib/usercopy_32.S
arch/tile/lib/usercopy_64.S
arch/tile/mm/elf.c
arch/tile/mm/fault.c
arch/tile/mm/highmem.c
arch/tile/mm/homecache.c
arch/tile/mm/hugetlbpage.c
arch/tile/mm/init.c
arch/tile/mm/migrate_32.S
arch/tile/mm/migrate_64.S
arch/tile/mm/mmap.c
arch/tile/mm/pgtable.c
arch/x86/Kconfig
arch/x86/include/asm/pci.h
arch/x86/kernel/x86_init.c
arch/x86/platform/mrst/mrst.c
crypto/api.c
drivers/block/drbd/drbd_bitmap.c
drivers/bus/Kconfig
drivers/bus/imx-weim.c
drivers/bus/mvebu-mbus.c
drivers/clk/tegra/clk-tegra114.c
drivers/clocksource/Kconfig
drivers/clocksource/acpi_pm.c
drivers/clocksource/bcm_kona_timer.c
drivers/clocksource/exynos_mct.c
drivers/clocksource/samsung_pwm_timer.c
drivers/clocksource/time-armada-370-xp.c
drivers/clocksource/timer-marco.c
drivers/crypto/ux500/hash/hash_core.c
drivers/edac/tile_edac.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/gpio-74x164.c
drivers/gpio/gpio-adnp.c
drivers/gpio/gpio-adp5520.c
drivers/gpio/gpio-adp5588.c
drivers/gpio/gpio-arizona.c
drivers/gpio/gpio-da9052.c
drivers/gpio/gpio-da9055.c
drivers/gpio/gpio-em.c
drivers/gpio/gpio-f7188x.c [new file with mode: 0644]
drivers/gpio/gpio-ich.c
drivers/gpio/gpio-janz-ttl.c
drivers/gpio/gpio-kempld.c [new file with mode: 0644]
drivers/gpio/gpio-lynxpoint.c
drivers/gpio/gpio-max7301.c
drivers/gpio/gpio-max730x.c
drivers/gpio/gpio-max732x.c
drivers/gpio/gpio-mc33880.c
drivers/gpio/gpio-mcp23s08.c
drivers/gpio/gpio-msic.c
drivers/gpio/gpio-msm-v2.c
drivers/gpio/gpio-mvebu.c
drivers/gpio/gpio-mxc.c
drivers/gpio/gpio-omap.c
drivers/gpio/gpio-palmas.c
drivers/gpio/gpio-pca953x.c
drivers/gpio/gpio-pcf857x.c
drivers/gpio/gpio-pl061.c
drivers/gpio/gpio-pxa.c
drivers/gpio/gpio-rcar.c
drivers/gpio/gpio-rdc321x.c
drivers/gpio/gpio-samsung.c
drivers/gpio/gpio-spear-spics.c
drivers/gpio/gpio-sta2x11.c
drivers/gpio/gpio-sx150x.c
drivers/gpio/gpio-timberdale.c
drivers/gpio/gpio-tps65912.c
drivers/gpio/gpio-ts5500.c
drivers/gpio/gpio-twl4030.c
drivers/gpio/gpio-twl6040.c
drivers/gpio/gpio-tz1090-pdc.c [new file with mode: 0644]
drivers/gpio/gpio-tz1090.c [new file with mode: 0644]
drivers/gpio/gpio-ucb1400.c
drivers/gpio/gpio-wm831x.c
drivers/gpio/gpio-wm8350.c
drivers/gpio/gpio-wm8994.c
drivers/gpio/gpiolib-of.c
drivers/gpio/gpiolib.c
drivers/gpu/drm/radeon/r300.c
drivers/hid/Kconfig
drivers/hid/Makefile
drivers/hid/hid-a4tech.c
drivers/hid/hid-apple.c
drivers/hid/hid-core.c
drivers/hid/hid-holtekff.c
drivers/hid/hid-ids.h
drivers/hid/hid-input.c
drivers/hid/hid-kye.c
drivers/hid/hid-logitech-dj.c
drivers/hid/hid-magicmouse.c
drivers/hid/hid-multitouch.c
drivers/hid/hid-ntrig.c
drivers/hid/hid-picolcd_cir.c
drivers/hid/hid-picolcd_core.c
drivers/hid/hid-picolcd_debugfs.c
drivers/hid/hid-picolcd_fb.c
drivers/hid/hid-pl.c
drivers/hid/hid-roccat-arvo.c
drivers/hid/hid-roccat-isku.c
drivers/hid/hid-roccat-kone.c
drivers/hid/hid-roccat-koneplus.c
drivers/hid/hid-roccat-konepure.c
drivers/hid/hid-roccat-kovaplus.c
drivers/hid/hid-sensor-hub.c
drivers/hid/hid-sony.c
drivers/hid/hid-speedlink.c
drivers/hid/hid-wiimote-core.c
drivers/hid/hid-xinmo.c [new file with mode: 0644]
drivers/hid/hid-zydacron.c
drivers/hid/hidraw.c
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/uhid.c
drivers/hid/usbhid/hid-core.c
drivers/hid/usbhid/hid-quirks.c
drivers/hid/usbhid/usbhid.h
drivers/hwmon/emc6w201.c
drivers/hwmon/w83792d.c
drivers/infiniband/hw/ehca/ipz_pt_fn.c
drivers/input/joystick/as5011.c
drivers/input/joystick/maplecontrol.c
drivers/input/keyboard/imx_keypad.c
drivers/input/keyboard/max7359_keypad.c
drivers/input/keyboard/nspire-keypad.c
drivers/input/keyboard/omap4-keypad.c
drivers/input/keyboard/qt1070.c
drivers/input/keyboard/spear-keyboard.c
drivers/input/keyboard/tegra-kbc.c
drivers/input/misc/Kconfig
drivers/input/misc/Makefile
drivers/input/misc/ideapad_slidebar.c [new file with mode: 0644]
drivers/input/misc/pwm-beeper.c
drivers/input/misc/twl6040-vibra.c
drivers/input/misc/wistron_btns.c
drivers/input/mouse/bcm5974.c
drivers/input/mouse/lifebook.c
drivers/input/mouse/synaptics.c
drivers/input/serio/altera_ps2.c
drivers/input/serio/arc_ps2.c
drivers/input/serio/i8042.h
drivers/input/serio/olpc_apsp.c
drivers/input/tablet/wacom_sys.c
drivers/input/tablet/wacom_wac.c
drivers/input/touchscreen/cy8ctmg110_ts.c
drivers/input/touchscreen/cyttsp4_core.c
drivers/input/touchscreen/eeti_ts.c
drivers/input/touchscreen/htcpen.c
drivers/input/touchscreen/max11801_ts.c
drivers/iommu/msm_iommu.c
drivers/iommu/msm_iommu.h [moved from arch/arm/mach-msm/include/mach/iommu.h with 100% similarity]
drivers/iommu/msm_iommu_dev.c
drivers/iommu/msm_iommu_hw-8xxx.h [moved from arch/arm/mach-msm/include/mach/iommu_hw-8xxx.h with 100% similarity]
drivers/iommu/tegra-smmu.c
drivers/irqchip/exynos-combiner.c
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-renesas-tpu.c [deleted file]
drivers/macintosh/ams/ams-input.c
drivers/media/platform/fsl-viu.c
drivers/media/usb/gspca/vicam.c
drivers/memory/mvebu-devbus.c
drivers/memory/tegra20-mc.c
drivers/memory/tegra30-mc.c
drivers/mfd/syscon.c
drivers/mmc/host/sdhci-bcm-kona.c
drivers/mtd/nand/mpc5121_nfc.c
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
drivers/net/ethernet/sis/sis900.c
drivers/net/wireless/cw1200/wsm.c
drivers/net/wireless/iwlwifi/mvm/time-event.c
drivers/net/wireless/rtlwifi/rtl8188ee/fw.c
drivers/net/wireless/rtlwifi/rtl8192de/dm.c
drivers/net/wireless/rtlwifi/rtl8723ae/fw.c
drivers/of/of_pci.c
drivers/pci/Kconfig
drivers/pci/host/Kconfig
drivers/pci/host/Makefile
drivers/pci/host/pci-mvebu.c
drivers/pci/host/pci-tegra.c [new file with mode: 0644]
drivers/pci/msi.c
drivers/pci/probe.c
drivers/power/88pm860x_charger.c
drivers/power/pm2301_charger.c
drivers/pwm/pwm-samsung.c
drivers/scsi/bfa/bfad_im.c
drivers/scsi/cxgbi/libcxgbi.h
drivers/scsi/hpsa.c
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/megaraid/megaraid_mm.c
drivers/scsi/megaraid/megaraid_sas_fusion.h
drivers/scsi/qla2xxx/qla_bsg.c
drivers/scsi/qla2xxx/qla_mr.c
drivers/spi/spi-altera.c
drivers/spi/spi-bitbang.c
drivers/tty/hvc/hvc_tile.c
drivers/tty/hvc/hvc_vio.c
drivers/tty/serial/Kconfig
drivers/tty/serial/Makefile
drivers/tty/serial/altera_jtaguart.c
drivers/tty/serial/altera_uart.c
drivers/tty/serial/kgdboc.c
drivers/tty/serial/mpc52xx_uart.c
drivers/tty/serial/tilegx.c [new file with mode: 0644]
drivers/tty/sysrq.c
drivers/usb/host/fsl-mph-dr-of.c
drivers/video/backlight/Kconfig
drivers/video/backlight/Makefile
drivers/video/backlight/bd6107.c [new file with mode: 0644]
drivers/video/backlight/gpio_backlight.c [new file with mode: 0644]
drivers/video/backlight/lv5207lp.c [new file with mode: 0644]
drivers/video/msm/msm_fb.c
fs/btrfs/send.c
fs/ext3/super.c
fs/ext4/super.c
fs/f2fs/checkpoint.c
fs/f2fs/data.c
fs/f2fs/debug.c
fs/f2fs/dir.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/gc.c
fs/f2fs/gc.h
fs/f2fs/inode.c
fs/f2fs/namei.c
fs/f2fs/node.c
fs/f2fs/node.h
fs/f2fs/recovery.c
fs/f2fs/segment.c
fs/f2fs/segment.h
fs/f2fs/super.c
fs/f2fs/xattr.c
fs/f2fs/xattr.h
fs/gfs2/dir.c
fs/isofs/inode.c
fs/jbd/commit.c
fs/jbd/journal.c
fs/reiserfs/bitmap.c
fs/reiserfs/dir.c
fs/reiserfs/fix_node.c
fs/reiserfs/inode.c
fs/reiserfs/ioctl.c
fs/reiserfs/journal.c
fs/reiserfs/lock.c
fs/reiserfs/namei.c
fs/reiserfs/prints.c
fs/reiserfs/reiserfs.h
fs/reiserfs/resize.c
fs/reiserfs/stree.c
fs/reiserfs/super.c
fs/reiserfs/xattr.c
fs/reiserfs/xattr_acl.c
fs/udf/super.c
include/clocksource/samsung_pwm.h
include/dt-bindings/pinctrl/nomadik.h [new file with mode: 0644]
include/linux/coda.h
include/linux/f2fs_fs.h
include/linux/hid-sensor-hub.h
include/linux/hid-sensor-ids.h
include/linux/hid.h
include/linux/hidraw.h
include/linux/i2c/i2c-hid.h
include/linux/i8042.h
include/linux/jbd.h
include/linux/ktime.h
include/linux/mbus.h
include/linux/micrel_phy.h
include/linux/msi.h
include/linux/of_pci.h
include/linux/pci.h
include/linux/platform_data/bd6107.h [new file with mode: 0644]
include/linux/platform_data/gpio-em.h
include/linux/platform_data/gpio_backlight.h [new file with mode: 0644]
include/linux/platform_data/leds-renesas-tpu.h [deleted file]
include/linux/platform_data/lv5207lp.h [new file with mode: 0644]
include/linux/platform_data/pca953x.h [moved from include/linux/i2c/pca953x.h with 100% similarity]
include/linux/tegra-cpuidle.h [new file with mode: 0644]
include/linux/time-armada-370-xp.h
include/uapi/linux/elf-em.h
include/uapi/linux/input.h
include/uapi/linux/serial_core.h
include/uapi/linux/uhid.h
kernel/workqueue.c
mm/memory-failure.c
mm/page_alloc.c
mm/page_isolation.c
net/bluetooth/hidp/core.c
net/sched/sch_choke.c
samples/hidraw/.gitignore [new file with mode: 0644]
samples/kprobes/kprobe_example.c
samples/uhid/uhid-example.c
scripts/recordmcount.pl
sound/pci/ens1370.c
sound/pci/via82xx.c
tools/testing/selftests/Makefile
tools/testing/selftests/powerpc/Makefile [new file with mode: 0644]
tools/testing/selftests/powerpc/harness.c [new file with mode: 0644]
tools/testing/selftests/powerpc/pmu/Makefile [new file with mode: 0644]
tools/testing/selftests/powerpc/pmu/count_instructions.c [new file with mode: 0644]
tools/testing/selftests/powerpc/pmu/event.c [new file with mode: 0644]
tools/testing/selftests/powerpc/pmu/event.h [new file with mode: 0644]
tools/testing/selftests/powerpc/pmu/loop.S [new file with mode: 0644]
tools/testing/selftests/powerpc/subunit.h [new file with mode: 0644]
tools/testing/selftests/powerpc/utils.h [new file with mode: 0644]

diff --git a/CREDITS b/CREDITS
index 646a0a9..9416a9a 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -637,14 +637,13 @@ S: 14509 NE 39th Street #1096
 S: Bellevue, Washington 98007
 S: USA
 
-N: Christopher L. Cheney
-E: ccheney@debian.org
-E: ccheney@cheney.cx
-W: http://www.cheney.cx
+N: Chris Cheney
+E: chris.cheney@gmail.com
+E: ccheney@redhat.com
 P: 1024D/8E384AF2 2D31 1927 87D7 1F24 9FF9  1BC5 D106 5AB3 8E38 4AF2
 D: Vista Imaging usb webcam driver
-S: 314 Prince of Wales
-S: Conroe, TX 77304
+S: 2308 Therrell Way
+S: McKinney, TX 75070
 S: USA
 
 N: Stuart Cheshire
index 0c4cc68..38f8444 100644 (file)
@@ -40,7 +40,7 @@ IPMI.txt
 IRQ-affinity.txt
        - how to select which CPU(s) handle which interrupt events on SMP.
 IRQ-domain.txt
-       - info on inerrupt numbering and setting up IRQ domains.
+       - info on interrupt numbering and setting up IRQ domains.
 IRQ.txt
        - description of what an IRQ is.
 Intel-IOMMU.txt
index ec93fe3..3f0b9ae 100644 (file)
@@ -5,20 +5,21 @@ Description:
                The disksize file is read-write and specifies the disk size
                which represents the limit on the *uncompressed* worth of data
                that can be stored in this disk.
+               Unit: bytes
 
 What:          /sys/block/zram<id>/initstate
 Date:          August 2010
 Contact:       Nitin Gupta <ngupta@vflare.org>
 Description:
-               The disksize file is read-only and shows the initialization
+               The initstate file is read-only and shows the initialization
                state of the device.
 
 What:          /sys/block/zram<id>/reset
 Date:          August 2010
 Contact:       Nitin Gupta <ngupta@vflare.org>
 Description:
-               The disksize file is write-only and allows resetting the
-               device. The reset operation frees all the memory assocaited
+               The reset file is write-only and allows resetting the
+               device. The reset operation frees all the memory associated
                with this device.
 
 What:          /sys/block/zram<id>/num_reads
@@ -48,7 +49,7 @@ Contact:      Nitin Gupta <ngupta@vflare.org>
 Description:
                The notify_free file is read-only and specifies the number of
                swap slot free notifications received by this device. These
-               notifications are send to a swap block device when a swap slot
+               notifications are sent to a swap block device when a swap slot
                is freed. This statistic is applicable only when this disk is
                being used as a swap disk.
 
diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs
new file mode 100644 (file)
index 0000000..31942ef
--- /dev/null
@@ -0,0 +1,26 @@
+What:          /sys/fs/f2fs/<disk>/gc_max_sleep_time
+Date:          July 2013
+Contact:       "Namjae Jeon" <namjae.jeon@samsung.com>
+Description:
+                Controls the maximun sleep time for gc_thread. Time
+                is in milliseconds.
+
+What:          /sys/fs/f2fs/<disk>/gc_min_sleep_time
+Date:          July 2013
+Contact:       "Namjae Jeon" <namjae.jeon@samsung.com>
+Description:
+                Controls the minimum sleep time for gc_thread. Time
+                is in milliseconds.
+
+What:          /sys/fs/f2fs/<disk>/gc_no_gc_sleep_time
+Date:          July 2013
+Contact:       "Namjae Jeon" <namjae.jeon@samsung.com>
+Description:
+                Controls the default sleep time for gc_thread. Time
+                is in milliseconds.
+
+What:          /sys/fs/f2fs/<disk>/gc_idle
+Date:          July 2013
+Contact:       "Namjae Jeon" <namjae.jeon@samsung.com>
+Description:
+                Controls the victim selection policy for garbage collection.
index 9058224..f4e28e7 100644 (file)
@@ -132,7 +132,7 @@ devices.</para>
          <row>
            <entry>&v4l2-fract;</entry>
            <entry><structfield>timeperframe</structfield></entry>
-           <entry><para>This is is the desired period between
+           <entry><para>This is the desired period between
 successive frames captured by the driver, in seconds. The
 field is intended to skip frames on the driver side, saving I/O
 bandwidth.</para><para>Applications store here the desired frame
@@ -193,7 +193,7 @@ applications must set the array to zero.</entry>
          <row>
            <entry>&v4l2-fract;</entry>
            <entry><structfield>timeperframe</structfield></entry>
-           <entry>This is is the desired period between
+           <entry>This is the desired period between
 successive frames output by the driver, in seconds.</entry>
          </row>
          <row>
index 7890fae..01a6751 100644 (file)
@@ -57,8 +57,8 @@ i.e counters for the CPU0-3 did not change.
 
 Here is an example of limiting that same irq (44) to cpus 1024 to 1031:
 
-[root@moon 44]# echo 1024-1031 > smp_affinity
-[root@moon 44]# cat smp_affinity
+[root@moon 44]# echo 1024-1031 > smp_affinity_list
+[root@moon 44]# cat smp_affinity_list
 1024-1031
 
 Note that to do this with a bitmask would require 32 bitmasks of zero
index 6e97e73..26b1e31 100644 (file)
@@ -109,6 +109,16 @@ probably didn't even receive earlier versions of the patch.
 If the patch fixes a logged bug entry, refer to that bug entry by
 number and URL.
 
+If you want to refer to a specific commit, don't just refer to the
+SHA-1 ID of the commit. Please also include the oneline summary of
+the commit, to make it easier for reviewers to know what it is about.
+Example:
+
+       Commit e21d2170f36602ae2708 ("video: remove unnecessary
+       platform_set_drvdata()") removed the unnecessary
+       platform_set_drvdata(), but left the variable "dev" unused,
+       delete it.
+
 
 3) Separate your changes.
 
index d977778..aca4e69 100644 (file)
@@ -207,7 +207,7 @@ passing those. One idea is to return this in _DSM method like:
                        Return (Local0)
                }
 
-Then the at25 SPI driver can get this configation by calling _DSM on its
+Then the at25 SPI driver can get this configuration by calling _DSM on its
 ACPI handle like:
 
        struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
index 9012bb0..4ae915a 100644 (file)
@@ -78,7 +78,7 @@ to NULL.  Drivers should use the following idiom:
 The most common usage of these functions will probably be to specify
 the maximum time from when an interrupt occurs, to when the device
 becomes accessible.  To accomplish this, driver writers should use the
-set_max_mpu_wakeup_lat() function to to constrain the MPU wakeup
+set_max_mpu_wakeup_lat() function to constrain the MPU wakeup
 latency, and the set_max_dev_wakeup_lat() function to constrain the
 device wakeup latency (from clk_enable() to accessibility).  For
 example,
index 9c4d388..98df4a0 100644 (file)
@@ -45,9 +45,9 @@ sees fit.)
 
 Requirement: MANDATORY
 
-The device tree blob (dtb) must be no bigger than 2 megabytes in size
-and placed at a 2-megabyte boundary within the first 512 megabytes from
-the start of the kernel image. This is to allow the kernel to map the
+The device tree blob (dtb) must be placed on an 8-byte boundary within
+the first 512 megabytes from the start of the kernel image and must not
+cross a 2-megabyte boundary. This is to allow the kernel to map the
 blob using a single section mapping in the initial page tables.
 
 
@@ -68,13 +68,23 @@ Image target is available instead.
 
 Requirement: MANDATORY
 
-The decompressed kernel image contains a 32-byte header as follows:
+The decompressed kernel image contains a 64-byte header as follows:
 
-  u32 magic    = 0x14000008;   /* branch to stext, little-endian */
-  u32 res0     = 0;            /* reserved */
+  u32 code0;                   /* Executable code */
+  u32 code1;                   /* Executable code */
   u64 text_offset;             /* Image load offset */
+  u64 res0     = 0;            /* reserved */
   u64 res1     = 0;            /* reserved */
   u64 res2     = 0;            /* reserved */
+  u64 res3     = 0;            /* reserved */
+  u64 res4     = 0;            /* reserved */
+  u32 magic    = 0x644d5241;   /* Magic number, little endian, "ARM\x64" */
+  u32 res5 = 0;                /* reserved */
+
+
+Header notes:
+
+- code0/code1 are responsible for branching to stext.
 
 The image must be placed at the specified offset (currently 0x80000)
 from the start of the system RAM and called there. The start of the
diff --git a/Documentation/arm64/tagged-pointers.txt b/Documentation/arm64/tagged-pointers.txt
new file mode 100644 (file)
index 0000000..264e984
--- /dev/null
@@ -0,0 +1,34 @@
+               Tagged virtual addresses in AArch64 Linux
+               =========================================
+
+Author: Will Deacon <will.deacon@arm.com>
+Date  : 12 June 2013
+
+This document briefly describes the provision of tagged virtual
+addresses in the AArch64 translation system and their potential uses
+in AArch64 Linux.
+
+The kernel configures the translation tables so that translations made
+via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of
+the virtual address ignored by the translation hardware. This frees up
+this byte for application use, with the following caveats:
+
+       (1) The kernel requires that all user addresses passed to EL1
+           are tagged with tag 0x00. This means that any syscall
+           parameters containing user virtual addresses *must* have
+           their top byte cleared before trapping to the kernel.
+
+       (2) Tags are not guaranteed to be preserved when delivering
+           signals. This means that signal handlers in applications
+           making use of tags cannot rely on the tag information for
+           user virtual addresses being maintained for fields inside
+           siginfo_t. One exception to this rule is for signals raised
+           in response to debug exceptions, where the tag information
+           will be preserved.
+
+       (3) Special care should be taken when using tagged pointers,
+           since it is likely that C compilers will not hazard two
+           addresses differing only in the upper bits.
+
+The architecture prevents the use of a tagged PC, so the upper byte will
+be set to a sign-extension of bit 55 on exception return.
index 9887f04..f3bc729 100644 (file)
@@ -69,7 +69,7 @@ one, this value should be decreased relative to fifo_expire_async.
 group_idle
 -----------
 This parameter forces idling at the CFQ group level instead of CFQ
-queue level. This was introduced after after a bottleneck was observed
+queue level. This was introduced after a bottleneck was observed
 in higher end storage due to idle on sequential queue and allow dispatch
 from a single queue. The idea with this parameter is that it can be run with
 slice_idle=0 and group_idle=8, so that idling does not happen on individual
index 9b728dc..d79b008 100644 (file)
@@ -57,7 +57,7 @@ changes occur:
        interface must make sure that any previous page table
        modifications for the address space 'vma->vm_mm' in the range
        'start' to 'end-1' will be visible to the cpu.  That is, after
-       running, here will be no entries in the TLB for 'mm' for
+       running, there will be no entries in the TLB for 'mm' for
        virtual addresses in the range 'start' to 'end-1'.
 
        The "vma" is the backing store being used for the region.
@@ -375,8 +375,8 @@ maps this page at its virtual address.
 
   void flush_icache_page(struct vm_area_struct *vma, struct page *page)
        All the functionality of flush_icache_page can be implemented in
-       flush_dcache_page and update_mmu_cache. In 2.7 the hope is to
-       remove this interface completely.
+       flush_dcache_page and update_mmu_cache. In the future, the hope
+       is to remove this interface completely.
 
 The final category of APIs is for I/O to deliberately aliased address
 ranges inside the kernel.  Such aliases are set up by use of the
index 902d315..0aad6de 100644 (file)
@@ -22,7 +22,7 @@ to /proc/cpuinfo.
 
 4) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
 
-       internel kernel map of cpuX's hardware threads within the same
+       internal kernel map of cpuX's hardware threads within the same
        core as cpuX
 
 5) /sys/devices/system/cpu/cpuX/topology/core_siblings:
index 4823577..2e06179 100644 (file)
@@ -276,7 +276,7 @@ mainline get there via -mm.
 The current -mm patch is available in the "mmotm" (-mm of the moment)
 directory at:
 
-       http://userweb.kernel.org/~akpm/mmotm/
+       http://www.ozlabs.org/~akpm/mmotm/
 
 Use of the MMOTM tree is likely to be a frustrating experience, though;
 there is a definite chance that it will not even compile.
@@ -287,7 +287,7 @@ the mainline is expected to look like after the next merge window closes.
 Linux-next trees are announced on the linux-kernel and linux-next mailing
 lists when they are assembled; they can be downloaded from:
 
-       http://www.kernel.org/pub/linux/kernel/people/sfr/linux-next/
+       http://www.kernel.org/pub/linux/kernel/next/
 
 Some information about linux-next has been gathered at:
 
index fb7b5cd..0ff6560 100644 (file)
@@ -6,4 +6,5 @@ bcm11351, bcm28145, bcm28155 SoCs) shall have the following properties:
 
 Required root node property:
 
-compatible = "bcm,bcm11351";
+compatible = "brcm,bcm11351";
+DEPRECATED: compatible = "bcm,bcm11351";
@@ -4,14 +4,15 @@ This timer is used in the following Broadcom SoCs:
  BCM11130, BCM11140, BCM11351, BCM28145, BCM28155
 
 Required properties:
-- compatible : "bcm,kona-timer"
+- compatible : "brcm,kona-timer"
+- DEPRECATED: compatible : "bcm,kona-timer"
 - reg : Register range for the timer
 - interrupts : interrupt for the timer
 - clock-frequency: frequency that the clock operates
 
 Example:
        timer@35006000 {
-               compatible = "bcm,kona-timer";
+               compatible = "brcm,kona-timer";
                reg = <0x35006000 0x1000>;
                interrupts = <0x0 7 0x4>;
                clock-frequency = <32768>;
diff --git a/Documentation/devicetree/bindings/arm/bcm/kona-wdt.txt b/Documentation/devicetree/bindings/arm/bcm/kona-wdt.txt
new file mode 100644 (file)
index 0000000..2b86a00
--- /dev/null
@@ -0,0 +1,15 @@
+Broadcom Kona Family Watchdog Timer
+-----------------------------------
+
+This watchdog timer is used in the following Broadcom SoCs:
+  BCM11130, BCM11140, BCM11351, BCM28145, BCM28155
+
+Required properties:
+  - compatible = "brcm,bcm11351-wdt", "brcm,kona-wdt";
+  - reg: memory address & range
+
+Example:
+       watchdog@35002f40 {
+               compatible = "brcm,bcm11351-wdt", "brcm,kona-wdt";
+               reg = <0x35002f40 0x6c>;
+       };
index 6d498c7..91b7049 100644 (file)
@@ -59,3 +59,6 @@ Boards:
 
 - AM43x EPOS EVM
   compatible = "ti,am43x-epos-evm", "ti,am4372", "ti,am43"
+
+- DRA7 EVM:  Software Developement Board for DRA7XX
+  compatible = "ti,dra7-evm", "ti,dra7"
index 69b5ab0..d11d800 100644 (file)
@@ -22,7 +22,7 @@ This contains the board-specific information.
 - compatible: must be "stericsson,s365".
 - vana15-supply: the regulator supplying the 1.5V to drive the
   board.
-- syscon: a pointer to the syscon node so we can acccess the
+- syscon: a pointer to the syscon node so we can access the
   syscon registers to set the board as self-powered.
 
 Example:
diff --git a/Documentation/devicetree/bindings/arm/vexpress-scc.txt b/Documentation/devicetree/bindings/arm/vexpress-scc.txt
new file mode 100644 (file)
index 0000000..ae5043e
--- /dev/null
@@ -0,0 +1,33 @@
+ARM Versatile Express Serial Configuration Controller
+-----------------------------------------------------
+
+Test chips for ARM Versatile Express platform implement SCC (Serial
+Configuration Controller) interface, used to set initial conditions
+for the test chip.
+
+In some cases its registers are also mapped in normal address space
+and can be used to obtain runtime information about the chip internals
+(like silicon temperature sensors) and as interface to other subsystems
+like platform configuration control and power management.
+
+Required properties:
+
+- compatible value: "arm,vexpress-scc,<model>", "arm,vexpress-scc";
+                   where <model> is the full tile model name (as used
+                   in the tile's Technical Reference Manual),
+                   eg. for Coretile Express A15x2 A7x3 (V2P-CA15_A7):
+       compatible = "arm,vexpress-scc,v2p-ca15_a7", "arm,vexpress-scc";
+
+Optional properties:
+
+- reg: when the SCC is memory mapped, physical address and size of the
+       registers window
+- interrupts: when the SCC can generate a system-level interrupt
+
+Example:
+
+       scc@7fff0000 {
+               compatible = "arm,vexpress-scc,v2p-ca15_a7", "arm,vexpress-scc";
+               reg = <0 0x7fff0000 0 0x1000>;
+               interrupts = <0 95 4>;
+       };
index 9cf3f25..5580e9c 100644 (file)
@@ -32,8 +32,8 @@ numbers - see motherboard's TRM for more details.
 The node describing a config device must refer to the sysreg node via
 "arm,vexpress,config-bridge" phandle (can be also defined in the node's
 parent) and relies on the board topology properties - see main vexpress
-node documentation for more details. It must must also define the
-following property:
+node documentation for more details. It must also define the following
+property:
 - arm,vexpress-sysreg,func : must contain two cells:
   - first cell defines function number (eg. 1 for clock generator,
     2 for voltage regulators etc.)
index cedc2a9..0fd76c4 100644 (file)
@@ -8,7 +8,7 @@ The actual devices are instantiated from the child nodes of a WEIM node.
 
 Required properties:
 
- - compatible:         Should be set to "fsl,imx6q-weim"
+ - compatible:         Should be set to "fsl,<soc>-weim"
  - reg:                        A resource specifier for the register space
                        (see the example below)
  - clocks:             the clock, see the example below.
@@ -21,11 +21,18 @@ Required properties:
 
 Timing property for child nodes. It is mandatory, not optional.
 
- - fsl,weim-cs-timing: The timing array, contains timing values for the
+ - fsl,weim-cs-timing: The timing array, contains timing values for the
                        child node. We can get the CS index from the child
-                       node's "reg" property. This property contains the values
-                       for the registers EIM_CSnGCR1, EIM_CSnGCR2, EIM_CSnRCR1,
-                       EIM_CSnRCR2, EIM_CSnWCR1, EIM_CSnWCR2 in this order.
+                       node's "reg" property. The number of registers depends
+                       on the selected chip.
+                       For i.MX1, i.MX21 ("fsl,imx1-weim") there are two
+                       registers: CSxU, CSxL.
+                       For i.MX25, i.MX27, i.MX31 and i.MX35 ("fsl,imx27-weim")
+                       there are three registers: CSCRxU, CSCRxL, CSCRxA.
+                       For i.MX50, i.MX53 ("fsl,imx50-weim"),
+                       i.MX51 ("fsl,imx51-weim") and i.MX6Q ("fsl,imx6q-weim")
+                       there are six registers: CSxGCR1, CSxGCR2, CSxRCR1,
+                       CSxRCR2, CSxWCR1, CSxWCR2.
 
 Example for an imx6q-sabreauto board, the NOR flash connected to the WEIM:
 
diff --git a/Documentation/devicetree/bindings/bus/mvebu-mbus.txt b/Documentation/devicetree/bindings/bus/mvebu-mbus.txt
new file mode 100644 (file)
index 0000000..7586fb6
--- /dev/null
@@ -0,0 +1,276 @@
+
+* Marvell MBus
+
+Required properties:
+
+- compatible:   Should be set to one of the following:
+                marvell,armada370-mbus
+                marvell,armadaxp-mbus
+                marvell,armada370-mbus
+                marvell,armadaxp-mbus
+                marvell,kirkwood-mbus
+                marvell,dove-mbus
+                marvell,orion5x-88f5281-mbus
+                marvell,orion5x-88f5182-mbus
+                marvell,orion5x-88f5181-mbus
+                marvell,orion5x-88f6183-mbus
+                marvell,mv78xx0-mbus
+
+- address-cells: Must be '2'. The first cell for the MBus ID encoding,
+                 the second cell for the address offset within the window.
+
+- size-cells:    Must be '1'.
+
+- ranges:        Must be set up to provide a proper translation for each child.
+                See the examples below.
+
+- controller:    Contains a single phandle referring to the MBus controller
+                 node. This allows to specify the node that contains the
+                registers that control the MBus, which is typically contained
+                within the internal register window (see below).
+
+Optional properties:
+
+- pcie-mem-aperture:   This optional property contains the aperture for
+                       the memory region of the PCIe driver.
+                       If it's defined, it must encode the base address and
+                       size for the address decoding windows allocated for
+                       the PCIe memory region.
+
+- pcie-io-aperture:    Just as explained for the above property, this
+                       optional property contains the aperture for the
+                       I/O region of the PCIe driver.
+
+* Marvell MBus controller
+
+Required properties:
+
+- compatible:  Should be set to "marvell,mbus-controller".
+
+- reg:          Device's register space.
+               Two entries are expected (see the examples below):
+               the first one controls the devices decoding window and
+               the second one controls the SDRAM decoding window.
+
+Example:
+
+       soc {
+               compatible = "marvell,armada370-mbus", "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               controller = <&mbusc>;
+               pcie-mem-aperture = <0xe0000000 0x8000000>;
+               pcie-io-aperture  = <0xe8000000 0x100000>;
+
+               internal-regs {
+                       compatible = "simple-bus";
+
+                       mbusc: mbus-controller@20000 {
+                               compatible = "marvell,mbus-controller";
+                               reg = <0x20000 0x100>, <0x20180 0x20>;
+                       };
+
+                       /* more children ...*/
+               };
+       };
+
+** MBus address decoding window specification
+
+The MBus children address space is comprised of two cells: the first one for
+the window ID and the second one for the offset within the window.
+In order to allow to describe valid and non-valid window entries, the
+following encoding is used:
+
+  0xSIAA0000 0x00oooooo
+
+Where:
+
+  S = 0x0 for a MBus valid window
+  S = 0xf for a non-valid window (see below)
+
+If S = 0x0, then:
+
+   I = 4-bit window target ID
+  AA = windpw attribute
+
+If S = 0xf, then:
+
+   I = don't care
+   AA = 1 for internal register
+
+Following the above encoding, for each ranges entry for a MBus valid window
+(S = 0x0), an address decoding window is allocated. On the other side,
+entries for translation that do not correspond to valid windows (S = 0xf)
+are skipped.
+
+       soc {
+               compatible = "marvell,armada370-mbus", "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               controller = <&mbusc>;
+
+               ranges = <0xf0010000 0 0 0xd0000000 0x100000
+                         0x01e00000 0 0 0xfff00000 0x100000>;
+
+               bootrom {
+                       compatible = "marvell,bootrom";
+                       reg = <0x01e00000 0 0x100000>;
+               };
+
+               /* other children */
+               ...
+
+               internal-regs {
+                       compatible = "simple-bus";
+                       ranges = <0 0xf0010000 0 0x100000>;
+
+                       mbusc: mbus-controller@20000 {
+                               compatible = "marvell,mbus-controller";
+                               reg = <0x20000 0x100>, <0x20180 0x20>;
+                       };
+
+                       /* more children ...*/
+               };
+       };
+
+In the shown example, the translation entry in the 'ranges' property is what
+makes the MBus driver create a static decoding window for the corresponding
+given child device. Note that the binding does not require child nodes to be
+present. Of course, child nodes are needed to probe the devices.
+
+Since each window is identified by its target ID and attribute ID there's
+a special macro that can be use to simplify the translation entries:
+
+#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
+
+Using this macro, the above example would be:
+
+       soc {
+               compatible = "marvell,armada370-mbus", "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               controller = <&mbusc>;
+
+               ranges = < MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+                          MBUS_ID(0x01, 0xe0) 0 0 0xfff00000 0x100000>;
+
+               bootrom {
+                       compatible = "marvell,bootrom";
+                       reg = <MBUS_ID(0x01, 0xe0) 0 0x100000>;
+               };
+
+               /* other children */
+               ...
+
+               internal-regs {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
+
+                       mbusc: mbus-controller@20000 {
+                               compatible = "marvell,mbus-controller";
+                               reg = <0x20000 0x100>, <0x20180 0x20>;
+                       };
+
+                       /* other children */
+                       ...
+               };
+       };
+
+
+** About the window base address
+
+Remember the MBus controller allows a great deal of flexibility for choosing
+the decoding window base address. When planning the device tree layout it's
+possible to choose any address as the base address, provided of course there's
+a region large enough available, and with the required alignment.
+
+Yet in other words: there's nothing preventing us from setting a base address
+of 0xf0000000, or 0xd0000000 for the NOR device shown above, if such region is
+unused.
+
+** Window allocation policy
+
+The mbus-node ranges property defines a set of mbus windows that are expected
+to be set by the operating system and that are guaranteed to be free of overlaps
+with one another or with the system memory ranges.
+
+Each entry in the property refers to exactly one window. If the operating system
+choses to use a different set of mbus windows, it must ensure that any address
+translations performed from downstream devices are adapted accordingly.
+
+The operating system may insert additional mbus windows that do not conflict
+with the ones listed in the ranges, e.g. for mapping PCIe devices.
+As a special case, the internal register window must be set up by the boot
+loader at the address listed in the ranges property, since access to that region
+is needed to set up the other windows.
+
+** Example
+
+See the example below, where a more complete device tree is shown:
+
+       soc {
+               compatible = "marvell,armadaxp-mbus", "simple-bus";
+               controller = <&mbusc>;
+
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000   /* internal-regs */
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x8000000>;
+
+               bootrom {
+                       compatible = "marvell,bootrom";
+                       reg = <MBUS_ID(0x01, 0x1d) 0 0x100000>;
+               };
+
+               devbus-bootcs {
+                       status = "okay";
+                       ranges = <0 MBUS_ID(0x01, 0x2f) 0 0x8000000>;
+
+                       /* NOR */
+                       nor {
+                               compatible = "cfi-flash";
+                               reg = <0 0x8000000>;
+                               bank-width = <2>;
+                       };
+               };
+
+               pcie-controller {
+                       compatible = "marvell,armada-xp-pcie";
+                       status = "okay";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000   /* Port 0.0 registers */
+                               0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000   /* Port 2.0 registers */
+                               0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000   /* Port 0.1 registers */
+                               0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000   /* Port 0.2 registers */
+                               0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000   /* Port 0.3 registers */
+                               0x82000800 0 0xe0000000 MBUS_ID(0x04, 0xe8) 0xe0000000 0 0x08000000 /* Port 0.0 MEM */
+                               0x81000800 0 0          MBUS_ID(0x04, 0xe0) 0xe8000000 0 0x00100000 /* Port 0.0 IO */>;
+
+
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+               };
+
+               internal-regs {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
+
+                       mbusc: mbus-controller@20000 {
+                               reg = <0x20000 0x100>, <0x20180 0x20>;
+                       };
+
+                       interrupt-controller@20000 {
+                             reg = <0x20a00 0x2d0>, <0x21070 0x58>;
+                       };
+               };
+       };
index d847758..b0e9714 100644 (file)
@@ -5,7 +5,7 @@ TI C6X SoCs contain a region of miscellaneous registers which provide various
 function for SoC control or status. Details vary considerably among from SoC
 to SoC with no two being alike.
 
-In general, the Device State Configuraion Registers (DSCR) will provide one or
+In general, the Device State Configuration Registers (DSCR) will provide one or
 more configuration registers often protected by a lock register where one or
 more key values must be written to a lock register in order to unlock the
 configuration register for writes. These configuration register may be used to
index a120180..75e2e19 100644 (file)
@@ -2,7 +2,7 @@
 
 The Samsung Audio Subsystem clock controller generates and supplies clocks
 to Audio Subsystem block available in the S5PV210 and Exynos SoCs. The clock
-binding described here is applicable to all SoC's in Exynos family.
+binding described here is applicable to all SoCs in Exynos family.
 
 Required Properties:
 
index f46f562..4c029a8 100644 (file)
@@ -197,6 +197,7 @@ clocks and IDs.
        spdif0_gate             183
        spdif1_gate             184
        spdif_ipg_gate          185
+       ocram                   186
 
 Examples (for mx53):
 
index a0e104f..5a90a72 100644 (file)
@@ -209,6 +209,12 @@ clocks and IDs.
        pll5_post_div           194
        pll5_video_div          195
        eim_slow                196
+       spdif                   197
+       cko2_sel                198
+       cko2_podf               199
+       cko2                    200
+       cko                     201
+       vdoa                    202
 
 Examples:
 
index 7fc0977..40e0cf1 100644 (file)
@@ -17,7 +17,7 @@ Optional properties for the SRC node:
 - disable-mxtal: if present this will disable the MXTALO,
   i.e. the driver output for the main (~19.2 MHz) chrystal,
   if the board has its own circuitry for providing this
-  osciallator
+  oscillator
 
 
 PLL nodes: these nodes represent the two PLLs on the system,
diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec6.txt b/Documentation/devicetree/bindings/crypto/fsl-sec6.txt
new file mode 100644 (file)
index 0000000..c0a20cd
--- /dev/null
@@ -0,0 +1,157 @@
+SEC 6 is as Freescale's Cryptographic Accelerator and Assurance Module (CAAM).
+Currently Freescale powerpc chip C29X is embeded with SEC 6.
+SEC 6 device tree binding include:
+   -SEC 6 Node
+   -Job Ring Node
+   -Full Example
+
+=====================================================================
+SEC 6 Node
+
+Description
+
+    Node defines the base address of the SEC 6 block.
+    This block specifies the address range of all global
+    configuration registers for the SEC 6 block.
+    For example, In C293, we could see three SEC 6 node.
+
+PROPERTIES
+
+   - compatible
+      Usage: required
+      Value type: <string>
+      Definition: Must include "fsl,sec-v6.0".
+
+   - fsl,sec-era
+      Usage: optional
+      Value type: <u32>
+      Definition: A standard property. Define the 'ERA' of the SEC
+          device.
+
+   - #address-cells
+       Usage: required
+       Value type: <u32>
+       Definition: A standard property.  Defines the number of cells
+           for representing physical addresses in child nodes.
+
+   - #size-cells
+       Usage: required
+       Value type: <u32>
+       Definition: A standard property.  Defines the number of cells
+           for representing the size of physical addresses in
+           child nodes.
+
+   - reg
+      Usage: required
+      Value type: <prop-encoded-array>
+      Definition: A standard property.  Specifies the physical
+          address and length of the SEC 6 configuration registers.
+
+   - ranges
+       Usage: required
+       Value type: <prop-encoded-array>
+       Definition: A standard property.  Specifies the physical address
+           range of the SEC 6.0 register space (-SNVS not included).  A
+           triplet that includes the child address, parent address, &
+           length.
+
+   Note: All other standard properties (see the ePAPR) are allowed
+   but are optional.
+
+EXAMPLE
+       crypto@a0000 {
+               compatible = "fsl,sec-v6.0";
+               fsl,sec-era = <6>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               reg = <0xa0000 0x20000>;
+               ranges = <0 0xa0000 0x20000>;
+       };
+
+=====================================================================
+Job Ring (JR) Node
+
+    Child of the crypto node defines data processing interface to SEC 6
+    across the peripheral bus for purposes of processing
+    cryptographic descriptors. The specified address
+    range can be made visible to one (or more) cores.
+    The interrupt defined for this node is controlled within
+    the address range of this node.
+
+  - compatible
+      Usage: required
+      Value type: <string>
+      Definition: Must include "fsl,sec-v6.0-job-ring".
+
+  - reg
+      Usage: required
+      Value type: <prop-encoded-array>
+      Definition: Specifies a two JR parameters:  an offset from
+           the parent physical address and the length the JR registers.
+
+   - interrupts
+      Usage: required
+      Value type: <prop_encoded-array>
+      Definition:  Specifies the interrupts generated by this
+           device.  The value of the interrupts property
+           consists of one interrupt specifier. The format
+           of the specifier is defined by the binding document
+           describing the node's interrupt parent.
+
+EXAMPLE
+       jr@1000 {
+               compatible = "fsl,sec-v6.0-job-ring";
+               reg = <0x1000 0x1000>;
+               interrupts = <49 2 0 0>;
+       };
+
+===================================================================
+Full Example
+
+Since some chips may contain more than one SEC, the dtsi contains
+only the node contents, not the node itself.  A chip using the SEC
+should include the dtsi inside each SEC node.  Example:
+
+In qoriq-sec6.0.dtsi:
+
+       compatible = "fsl,sec-v6.0";
+       fsl,sec-era = <6>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       jr@1000 {
+               compatible = "fsl,sec-v6.0-job-ring",
+                            "fsl,sec-v5.2-job-ring",
+                            "fsl,sec-v5.0-job-ring",
+                            "fsl,sec-v4.4-job-ring",
+                            "fsl,sec-v4.0-job-ring";
+               reg        = <0x1000 0x1000>;
+       };
+
+       jr@2000 {
+               compatible = "fsl,sec-v6.0-job-ring",
+                            "fsl,sec-v5.2-job-ring",
+                            "fsl,sec-v5.0-job-ring",
+                            "fsl,sec-v4.4-job-ring",
+                            "fsl,sec-v4.0-job-ring";
+               reg        = <0x2000 0x1000>;
+       };
+
+In the C293 device tree, we add the include of public property:
+
+       crypto@a0000 {
+               /include/ "qoriq-sec6.0.dtsi"
+       }
+
+       crypto@a0000 {
+               reg = <0xa0000 0x20000>;
+               ranges = <0 0xa0000 0x20000>;
+
+               jr@1000 {
+                       interrupts = <49 2 0 0>;
+               };
+
+               jr@2000 {
+                       interrupts = <50 2 0 0>;
+               };
+       };
index c280a0e..e1f343c 100644 (file)
@@ -18,14 +18,14 @@ dma0: dma@ffffec00 {
 
 DMA clients connected to the Atmel DMA controller must use the format
 described in the dma.txt file, using a three-cell specifier for each channel:
-a phandle plus two interger cells.
+a phandle plus two integer cells.
 The three cells in order are:
 
 1. A phandle pointing to the DMA controller.
 2. The memory interface (16 most significant bits), the peripheral interface
 (16 less significant bits).
 3. Parameters for the at91 DMA configuration register which are device
-dependant:
+dependent:
   - bit 7-0: peripheral identifier for the hardware handshaking interface. The
   identifier can be different for tx and rx.
   - bit 11-8: FIFO configuration. 0 for half FIFO, 1 for ALAP, 1 for ASAP.
index 2717ecb..7bd8847 100644 (file)
@@ -34,7 +34,7 @@ Clients have to specify the DMA requests with phandles in a list.
 Required properties:
 - dmas: List of one or more DMA request specifiers. One DMA request specifier
     consists of a phandle to the DMA controller followed by the integer
-    specifiying the request line.
+    specifying the request line.
 - dma-names: List of string identifiers for the DMA requests. For the correct
     names, have a look at the specific client driver.
 
index bea5b73..a8c21c2 100644 (file)
@@ -37,14 +37,14 @@ Each dmas request consists of 4 cells:
   1. A phandle pointing to the DMA controller
   2. Device Type
   3. The DMA request line number (only when 'use fixed channel' is set)
-  4. A 32bit mask specifying; mode, direction and endianess [NB: This list will grow]
+  4. A 32bit mask specifying; mode, direction and endianness [NB: This list will grow]
         0x00000001: Mode:
                 Logical channel when unset
                 Physical channel when set
         0x00000002: Direction:
                 Memory to Device when unset
                 Device to Memory when set
-        0x00000004: Endianess:
+        0x00000004: Endianness:
                 Little endian when unset
                 Big endian when set
         0x00000008: Use fixed channel:
index 629d0ef..daa3017 100644 (file)
@@ -3,10 +3,17 @@ Microchip MCP2308/MCP23S08/MCP23017/MCP23S17 driver for
 
 Required properties:
 - compatible : Should be
-    - "mcp,mcp23s08" for  8 GPIO SPI version
-    - "mcp,mcp23s17" for 16 GPIO SPI version
-    - "mcp,mcp23008" for  8 GPIO I2C version or
-    - "mcp,mcp23017" for 16 GPIO I2C version of the chip
+    - "mcp,mcp23s08" (DEPRECATED) for  8 GPIO SPI version
+    - "mcp,mcp23s17" (DEPRECATED) for 16 GPIO SPI version
+    - "mcp,mcp23008" (DEPRECATED) for  8 GPIO I2C version or
+    - "mcp,mcp23017" (DEPRECATED) for 16 GPIO I2C version of the chip
+
+    - "microchip,mcp23s08" for  8 GPIO SPI version
+    - "microchip,mcp23s17" for 16 GPIO SPI version
+    - "microchip,mcp23008" for  8 GPIO I2C version or
+    - "microchip,mcp23017" for 16 GPIO I2C version of the chip
+    NOTE: Do not use the old mcp prefix any more. It is deprecated and will be
+    removed.
 - #gpio-cells : Should be two.
   - first cell is the pin number
   - second cell is used to specify flags. Flags are currently unused.
@@ -15,10 +22,11 @@ Required properties:
         SPI uses this to specify the chipselect line which the chip is
         connected to. The driver and the SPI variant of the chip support
         multiple chips on the same chipselect. Have a look at
-        mcp,spi-present-mask below.
+        microchip,spi-present-mask below.
 
 Required device specific properties (only for SPI chips):
-- mcp,spi-present-mask : This is a present flag, that makes only sense for SPI
+- mcp,spi-present-mask (DEPRECATED)
+- microchip,spi-present-mask : This is a present flag, that makes only sense for SPI
         chips - as the name suggests. Multiple SPI chips can share the same
         SPI chipselect. Set a bit in bit0-7 in this mask to 1 if there is a
         chip connected with the corresponding spi address set. For example if
@@ -26,11 +34,13 @@ Required device specific properties (only for SPI chips):
         which is 0x08. mcp23s08 chip variant only supports bits 0-3. It is not
         possible to mix mcp23s08 and mcp23s17 on the same chipselect. Set at
         least one bit to 1 for SPI chips.
+    NOTE: Do not use the old mcp prefix any more. It is deprecated and will be
+    removed.
 - spi-max-frequency = The maximum frequency this chip is able to handle
 
 Example I2C:
 gpiom1: gpio@20 {
-        compatible = "mcp,mcp23017";
+        compatible = "microchip,mcp23017";
         gpio-controller;
         #gpio-cells = <2>;
         reg = <0x20>;
@@ -38,7 +48,7 @@ gpiom1: gpio@20 {
 
 Example SPI:
 gpiom1: gpio@0 {
-        compatible = "mcp,mcp23s17";
+        compatible = "microchip,mcp23s17";
         gpio-controller;
         #gpio-cells = <2>;
         spi-present-mask = <0x01>;
diff --git a/Documentation/devicetree/bindings/gpio/gpio-palmas.txt b/Documentation/devicetree/bindings/gpio/gpio-palmas.txt
new file mode 100644 (file)
index 0000000..08b5b52
--- /dev/null
@@ -0,0 +1,27 @@
+Palmas GPIO controller bindings
+
+Required properties:
+- compatible:
+  - "ti,palams-gpio" for palma series of the GPIO controller
+  - "ti,tps80036-gpio" for Palma series device TPS80036.
+  - "ti,tps65913-gpio" for palma series device TPS65913.
+  - "ti,tps65914-gpio" for palma series device TPS65914.
+- #gpio-cells : Should be two.
+  - first cell is the gpio pin number
+  - second cell is used to specify the gpio polarity:
+      0 = active high
+      1 = active low
+- gpio-controller : Marks the device node as a GPIO controller.
+
+Note: This gpio node will be sub node of palmas node.
+
+Example:
+       palmas: tps65913@58 {
+               :::::::::::
+               palmas_gpio: palmas_gpio {
+                       compatible = "ti,palmas-gpio";
+                       gpio-controller;
+                       #gpio-cells = <2>;
+               };
+               :::::::::::
+       };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-tz1090-pdc.txt b/Documentation/devicetree/bindings/gpio/gpio-tz1090-pdc.txt
new file mode 100644 (file)
index 0000000..1fd98ff
--- /dev/null
@@ -0,0 +1,45 @@
+ImgTec TZ1090 PDC GPIO Controller
+
+Required properties:
+- compatible: Compatible property value should be "img,tz1090-pdc-gpio".
+
+- reg: Physical base address of the controller and length of memory mapped
+  region. This starts at and cover the SOC_GPIO_CONTROL registers.
+
+- gpio-controller: Specifies that the node is a gpio controller.
+
+- #gpio-cells: Should be 2. The syntax of the gpio specifier used by client
+  nodes should have the following values.
+     <[phandle of the gpio controller node]
+      [PDC gpio number]
+      [gpio flags]>
+
+  Values for gpio specifier:
+  - GPIO number: a value in the range 0 to 6.
+  - GPIO flags: bit field of flags, as defined in <dt-bindings/gpio/gpio.h>.
+    Only the following flags are supported:
+      GPIO_ACTIVE_HIGH
+      GPIO_ACTIVE_LOW
+
+Optional properties:
+- gpio-ranges: Mapping to pin controller pins (as described in
+  Documentation/devicetree/bindings/gpio/gpio.txt)
+
+- interrupts: Individual syswake interrupts (other GPIOs cannot interrupt)
+
+
+Example:
+
+       pdc_gpios: gpio-controller@02006500 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               compatible = "img,tz1090-pdc-gpio";
+               reg = <0x02006500 0x100>;
+
+               interrupt-parent = <&pdc>;
+               interrupts =    <8  IRQ_TYPE_NONE>,     /* Syswake 0 */
+                               <9  IRQ_TYPE_NONE>,     /* Syswake 1 */
+                               <10 IRQ_TYPE_NONE>;     /* Syswake 2 */
+               gpio-ranges = <&pdc_pinctrl 0 0 7>;
+       };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-tz1090.txt b/Documentation/devicetree/bindings/gpio/gpio-tz1090.txt
new file mode 100644 (file)
index 0000000..174cdf3
--- /dev/null
@@ -0,0 +1,88 @@
+ImgTec TZ1090 GPIO Controller
+
+Required properties:
+- compatible: Compatible property value should be "img,tz1090-gpio".
+
+- reg: Physical base address of the controller and length of memory mapped
+  region.
+
+- #address-cells: Should be 1 (for bank subnodes)
+
+- #size-cells: Should be 0 (for bank subnodes)
+
+- Each bank of GPIOs should have a subnode to represent it.
+
+  Bank subnode required properties:
+  - reg: Index of bank in the range 0 to 2.
+
+  - gpio-controller: Specifies that the node is a gpio controller.
+
+  - #gpio-cells: Should be 2. The syntax of the gpio specifier used by client
+    nodes should have the following values.
+       <[phandle of the gpio controller node]
+        [gpio number within the gpio bank]
+        [gpio flags]>
+
+    Values for gpio specifier:
+    - GPIO number: a value in the range 0 to 29.
+    - GPIO flags: bit field of flags, as defined in <dt-bindings/gpio/gpio.h>.
+      Only the following flags are supported:
+        GPIO_ACTIVE_HIGH
+        GPIO_ACTIVE_LOW
+
+  Bank subnode optional properties:
+  - gpio-ranges: Mapping to pin controller pins (as described in
+    Documentation/devicetree/bindings/gpio/gpio.txt)
+
+  - interrupts: Interrupt for the entire bank
+
+  - interrupt-controller: Specifies that the node is an interrupt controller
+
+  - #interrupt-cells: Should be 2. The syntax of the interrupt specifier used by
+    client nodes should have the following values.
+       <[phandle of the interurupt controller]
+        [gpio number within the gpio bank]
+        [irq flags]>
+
+    Values for irq specifier:
+    - GPIO number: a value in the range 0 to 29
+    - IRQ flags: value to describe edge and level triggering, as defined in
+      <dt-bindings/interrupt-controller/irq.h>. Only the following flags are
+      supported:
+        IRQ_TYPE_EDGE_RISING
+        IRQ_TYPE_EDGE_FALLING
+        IRQ_TYPE_EDGE_BOTH
+        IRQ_TYPE_LEVEL_HIGH
+        IRQ_TYPE_LEVEL_LOW
+
+
+
+Example:
+
+       gpios: gpio-controller@02005800 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "img,tz1090-gpio";
+               reg = <0x02005800 0x90>;
+
+               /* bank 0 with an interrupt */
+               gpios0: bank@0 {
+                       #gpio-cells = <2>;
+                       #interrupt-cells = <2>;
+                       reg = <0>;
+                       interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
+                       gpio-controller;
+                       gpio-ranges = <&pinctrl 0 0 30>;
+                       interrupt-controller;
+               };
+
+               /* bank 2 without interrupt */
+               gpios2: bank@2 {
+                       #gpio-cells = <2>;
+                       reg = <2>;
+                       gpio-controller;
+                       gpio-ranges = <&pinctrl 0 60 30>;
+               };
+       };
+
+
index 9b3f1d4..6641626 100644 (file)
@@ -10,8 +10,9 @@ Required properties:
   There're three gpio interrupts in arch-pxa, and they're gpio0,
   gpio1 and gpio_mux. There're only one gpio interrupt in arch-mmp,
   gpio_mux.
-- interrupt-name : Should be the name of irq resource. Each interrupt
-  binds its interrupt-name.
+- interrupt-names : Should be the names of irq resources. Each interrupt
+  uses its own interrupt name, so there should be as many interrupt names
+  as referenced interrups.
 - interrupt-controller : Identifies the node as an interrupt controller.
 - #interrupt-cells: Specifies the number of cells needed to encode an
   interrupt source.
@@ -24,7 +25,7 @@ Example:
                compatible = "marvell,mmp-gpio";
                reg = <0xd4019000 0x1000>;
                interrupts = <49>;
-               interrupt-name = "gpio_mux";
+               interrupt-names = "gpio_mux";
                gpio-controller;
                #gpio-cells = <1>;
                interrupt-controller;
index cb3dc7b..8655df9 100644 (file)
@@ -23,6 +23,10 @@ Required Properties:
 Please refer to gpio.txt in this directory for details of gpio-ranges property
 and the common GPIO bindings used by client devices.
 
+The GPIO controller also acts as an interrupt controller. It uses the default
+two cells specifier as described in Documentation/devicetree/bindings/
+interrupt-controller/interrupts.txt.
+
 Example: R8A7779 (R-Car H1) GPIO controller nodes
 
        gpio0: gpio@ffc40000 {
@@ -33,6 +37,8 @@ Example: R8A7779 (R-Car H1) GPIO controller nodes
                #gpio-cells = <2>;
                gpio-controller;
                gpio-ranges = <&pfc 0 0 32>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
        };
        ...
        gpio6: gpio@ffc46000 {
@@ -43,4 +49,6 @@ Example: R8A7779 (R-Car H1) GPIO controller nodes
                #gpio-cells = <2>;
                gpio-controller;
                gpio-ranges = <&pfc 0 192 9>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
        };
diff --git a/Documentation/devicetree/bindings/hid/hid-over-i2c.txt b/Documentation/devicetree/bindings/hid/hid-over-i2c.txt
new file mode 100644 (file)
index 0000000..488edcb
--- /dev/null
@@ -0,0 +1,28 @@
+* HID over I2C Device-Tree bindings
+
+HID over I2C provides support for various Human Interface Devices over the
+I2C bus. These devices can be for example touchpads, keyboards, touch screens
+or sensors.
+
+The specification has been written by Microsoft and is currently available here:
+http://msdn.microsoft.com/en-us/library/windows/hardware/hh852380.aspx
+
+If this binding is used, the kernel module i2c-hid will handle the communication
+with the device and the generic hid core layer will handle the protocol.
+
+Required properties:
+- compatible: must be "hid-over-i2c"
+- reg: i2c slave address
+- hid-descr-addr: HID descriptor address
+- interrupt-parent: the phandle for the interrupt controller
+- interrupts: interrupt line
+
+Example:
+
+       i2c-hid-dev@2c {
+               compatible = "hid-over-i2c";
+               reg = <0x2c>;
+               hid-descr-addr = <0x0020>;
+               interrupt-parent = <&gpx3>;
+               interrupts = <3 2>;
+       };
diff --git a/Documentation/devicetree/bindings/input/input-reset.txt b/Documentation/devicetree/bindings/input/input-reset.txt
new file mode 100644 (file)
index 0000000..2bb2626
--- /dev/null
@@ -0,0 +1,33 @@
+Input: sysrq reset sequence
+
+A simple binding to represent a set of keys as described in
+include/uapi/linux/input.h. This is to communicate a sequence of keys to the
+sysrq driver. Upon holding the keys for a specified amount of time (if
+specified) the system is sync'ed and reset.
+
+Key sequences are global to the system but all the keys in a set must be coming
+from the same input device.
+
+The /chosen node should contain a 'linux,sysrq-reset-seq' child node to define
+a set of keys.
+
+Required property:
+sysrq-reset-seq: array of Linux keycodes, one keycode per cell.
+
+Optional property:
+timeout-ms: duration keys must be pressed together in milliseconds before
+generating a sysrq. If omitted the system is rebooted immediately when a valid
+sequence has been recognized.
+
+Example:
+
+ chosen {
+                linux,sysrq-reset-seq {
+                        keyset = <0x03
+                                  0x04
+                                  0x0a>;
+                        timeout-ms = <3000>;
+                };
+         };
+
+Would represent KEY_2, KEY_3 and KEY_9.
index df70318..49fa14e 100644 (file)
@@ -6,7 +6,7 @@ Required properties:
 - interrupt-parent: the phandle for the interrupt controller
 - interrupts: touch controller interrupt
 - wakeup-gpios: the gpio pin to be used for waking up the controller
-  as well as uased as irq pin
+  and also used as irq pin
 
 Example:
 
index 36bd2d6..f418168 100644 (file)
@@ -16,9 +16,9 @@ Required properties:
          mapped region.
 
   - interrupts : MFC interrupt number to the CPU.
-  - clocks : from common clock binding: handle to mfc clocks.
-  - clock-names : from common clock binding: must contain "sclk_mfc" and "mfc",
-                 corresponding to entries in the clocks property.
+  - clocks : from common clock binding: handle to mfc clock.
+  - clock-names : from common clock binding: must contain "mfc",
+                 corresponding to entry in the clocks property.
 
   - samsung,mfc-r : Base address of the first memory bank used by MFC
                    for DMA contiguous memory allocation and its size.
@@ -38,8 +38,8 @@ mfc: codec@13400000 {
        reg = <0x13400000 0x10000>;
        interrupts = <0 94 0>;
        samsung,power-domain = <&pd_mfc>;
-       clocks = <&clock 170>, <&clock 273>;
-       clock-names = "sclk_mfc", "mfc";
+       clocks = <&clock 273>;
+       clock-names = "mfc";
 };
 
 Board specific DT entry:
index e0e59c5..5f229c5 100644 (file)
@@ -4,7 +4,7 @@ Google's ChromeOS EC is a Cortex-M device which talks to the AP and
 implements various function such as keyboard and battery charging.
 
 The EC can be connect through various means (I2C, SPI, LPC) and the
-compatible string used depends on the inteface. Each connection method has
+compatible string used depends on the interface. Each connection method has
 its own driver which connects to the top level interface-agnostic EC driver.
 Other Linux driver (such as cros-ec-keyb for the matrix keyboard) connect to
 the top-level driver.
index 02b4281..6c9f176 100644 (file)
@@ -4,11 +4,12 @@ This binding defines the location of the bounce buffer
 used for non-secure to secure communications.
 
 Required properties:
-- compatible : "bcm,kona-smc"
+- compatible : "brcm,kona-smc"
+- DEPRECATED: compatible : "bcm,kona-smc"
 - reg : Location and size of bounce buffer
 
 Example:
        smc@0x3404c000 {
-               compatible = "bcm,bcm11351-smc", "bcm,kona-smc";
+               compatible = "brcm,bcm11351-smc", "brcm,kona-smc";
                reg = <0x3404c000 0x400>; //1 KiB in SRAM
        };
@@ -4,12 +4,13 @@ This file documents differences between the core properties in mmc.txt
 and the properties present in the bcm281xx SDHCI
 
 Required properties:
-- compatible : Should be "bcm,kona-sdhci"
+- compatible : Should be "brcm,kona-sdhci"
+- DEPRECATED: compatible : Should be "bcm,kona-sdhci"
 
 Example:
 
 sdio2: sdio@0x3f1a0000 {
-       compatible = "bcm,kona-sdhci";
+       compatible = "brcm,kona-sdhci";
        reg = <0x3f1a0000 0x10000>;
        interrupts = <0x0 74 0x4>;
 };
index 72cf0c5..14e52a0 100644 (file)
@@ -8,7 +8,7 @@ Required properties:
 Example:
 
        can0: can@f000c000 {
-               compatbile = "atmel,at91sam9x5-can";
+               compatible = "atmel,at91sam9x5-can";
                reg = <0xf000c000 0x300>;
                interrupts = <40 4 5>
        };
index f8d4058..9556e2f 100644 (file)
@@ -1,6 +1,7 @@
 * Marvell EBU PCIe interfaces
 
 Mandatory properties:
+
 - compatible: one of the following values:
     marvell,armada-370-pcie
     marvell,armada-xp-pcie
@@ -10,11 +11,49 @@ Mandatory properties:
 - #interrupt-cells, set to <1>
 - bus-range: PCI bus numbers covered
 - device_type, set to "pci"
-- ranges: ranges for the PCI memory and I/O regions, as well as the
-  MMIO registers to control the PCIe interfaces.
+- ranges: ranges describing the MMIO registers to control the PCIe
+  interfaces, and ranges describing the MBus windows needed to access
+  the memory and I/O regions of each PCIe interface.
+
+The ranges describing the MMIO registers have the following layout:
+
+    0x82000000 0 r MBUS_ID(0xf0, 0x01) r 0 s
+
+where:
+
+  * r is a 32-bits value that gives the offset of the MMIO
+  registers of this PCIe interface, from the base of the internal
+  registers.
+
+  * s is a 32-bits value that give the size of this MMIO
+  registers area. This range entry translates the '0x82000000 0 r' PCI
+  address into the 'MBUS_ID(0xf0, 0x01) r' CPU address, which is part
+  of the internal register window (as identified by MBUS_ID(0xf0,
+  0x01)).
+
+The ranges describing the MBus windows have the following layout:
+
+    0x8t000000 s 0     MBUS_ID(w, a) 0 1 0
+
+where:
+
+   * t is the type of the MBus window (as defined by the standard PCI DT
+   bindings), 1 for I/O and 2 for memory.
 
-In addition, the Device Tree node must have sub-nodes describing each
+   * s is the PCI slot that corresponds to this PCIe interface
+
+   * w is the 'target ID' value for the MBus window
+
+   * a the 'attribute' value for the MBus window.
+
+Since the location and size of the different MBus windows is not fixed in
+hardware, and only determined in runtime, those ranges cover the full first
+4 GB of the physical address space, and do not translate into a valid CPU
+address.
+
+In addition, the device tree node must have sub-nodes describing each
 PCIe interface, having the following mandatory properties:
+
 - reg: used only for interrupt mapping, so only the first four bytes
   are used to refer to the correct bus number and device number.
 - assigned-addresses: reference to the MMIO registers used to control
@@ -26,7 +65,8 @@ PCIe interface, having the following mandatory properties:
 - #address-cells, set to <3>
 - #size-cells, set to <2>
 - #interrupt-cells, set to <1>
-- ranges, empty property.
+- ranges, translating the MBus windows ranges of the parent node into
+  standard PCI addresses.
 - interrupt-map-mask and interrupt-map, standard PCI properties to
   define the mapping of the PCIe interface to interrupt numbers.
 
@@ -47,27 +87,50 @@ pcie-controller {
 
        bus-range = <0x00 0xff>;
 
-       ranges = <0x82000000 0 0xd0040000 0xd0040000 0 0x00002000   /* Port 0.0 registers */
-                 0x82000000 0 0xd0042000 0xd0042000 0 0x00002000   /* Port 2.0 registers */
-                 0x82000000 0 0xd0044000 0xd0044000 0 0x00002000   /* Port 0.1 registers */
-                 0x82000000 0 0xd0048000 0xd0048000 0 0x00002000   /* Port 0.2 registers */
-                 0x82000000 0 0xd004c000 0xd004c000 0 0x00002000   /* Port 0.3 registers */
-                 0x82000000 0 0xd0080000 0xd0080000 0 0x00002000   /* Port 1.0 registers */
-                 0x82000000 0 0xd0082000 0xd0082000 0 0x00002000   /* Port 3.0 registers */
-                 0x82000000 0 0xd0084000 0xd0084000 0 0x00002000   /* Port 1.1 registers */
-                 0x82000000 0 0xd0088000 0xd0088000 0 0x00002000   /* Port 1.2 registers */
-                 0x82000000 0 0xd008c000 0xd008c000 0 0x00002000   /* Port 1.3 registers */
-                 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000   /* non-prefetchable memory */
-                 0x81000000 0 0          0xe8000000 0 0x00100000>; /* downstream I/O */
+       ranges =
+              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000   /* Port 0.0 registers */
+               0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000   /* Port 2.0 registers */
+               0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000   /* Port 0.1 registers */
+               0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000   /* Port 0.2 registers */
+               0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000   /* Port 0.3 registers */
+               0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000   /* Port 1.0 registers */
+               0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000   /* Port 3.0 registers */
+               0x82000000 0 0x84000 MBUS_ID(0xf0, 0x01) 0x84000 0 0x00002000   /* Port 1.1 registers */
+               0x82000000 0 0x88000 MBUS_ID(0xf0, 0x01) 0x88000 0 0x00002000   /* Port 1.2 registers */
+               0x82000000 0 0x8c000 MBUS_ID(0xf0, 0x01) 0x8c000 0 0x00002000   /* Port 1.3 registers */
+               0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
+               0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO  */
+               0x82000000 0x2 0     MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
+               0x81000000 0x2 0     MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO  */
+               0x82000000 0x3 0     MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
+               0x81000000 0x3 0     MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO  */
+               0x82000000 0x4 0     MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
+               0x81000000 0x4 0     MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO  */
+
+               0x82000000 0x5 0     MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
+               0x81000000 0x5 0     MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO  */
+               0x82000000 0x6 0     MBUS_ID(0x08, 0xd8) 0 1 0 /* Port 1.1 MEM */
+               0x81000000 0x6 0     MBUS_ID(0x08, 0xd0) 0 1 0 /* Port 1.1 IO  */
+               0x82000000 0x7 0     MBUS_ID(0x08, 0xb8) 0 1 0 /* Port 1.2 MEM */
+               0x81000000 0x7 0     MBUS_ID(0x08, 0xb0) 0 1 0 /* Port 1.2 IO  */
+               0x82000000 0x8 0     MBUS_ID(0x08, 0x78) 0 1 0 /* Port 1.3 MEM */
+               0x81000000 0x8 0     MBUS_ID(0x08, 0x70) 0 1 0 /* Port 1.3 IO  */
+
+               0x82000000 0x9 0     MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */
+               0x81000000 0x9 0     MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO  */
+
+               0x82000000 0xa 0     MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */
+               0x81000000 0xa 0     MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO  */>;
 
        pcie@1,0 {
                device_type = "pci";
-               assigned-addresses = <0x82000800 0 0xd0040000 0 0x2000>;
+               assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
                reg = <0x0800 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 58>;
                marvell,pcie-port = <0>;
@@ -78,12 +141,13 @@ pcie-controller {
 
        pcie@2,0 {
                device_type = "pci";
-               assigned-addresses = <0x82001000 0 0xd0044000 0 0x2000>;
+               assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
                reg = <0x1000 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
+                         0x81000000 0 0 0x81000000 0x2 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 59>;
                marvell,pcie-port = <0>;
@@ -94,12 +158,13 @@ pcie-controller {
 
        pcie@3,0 {
                device_type = "pci";
-               assigned-addresses = <0x82001800 0 0xd0048000 0 0x2000>;
+               assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
                reg = <0x1800 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
+                         0x81000000 0 0 0x81000000 0x3 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 60>;
                marvell,pcie-port = <0>;
@@ -110,12 +175,13 @@ pcie-controller {
 
        pcie@4,0 {
                device_type = "pci";
-               assigned-addresses = <0x82002000 0 0xd004c000 0 0x2000>;
+               assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
                reg = <0x2000 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
+                         0x81000000 0 0 0x81000000 0x4 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 61>;
                marvell,pcie-port = <0>;
@@ -126,12 +192,13 @@ pcie-controller {
 
        pcie@5,0 {
                device_type = "pci";
-               assigned-addresses = <0x82002800 0 0xd0080000 0 0x2000>;
+               assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
                reg = <0x2800 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0
+                         0x81000000 0 0 0x81000000 0x5 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 62>;
                marvell,pcie-port = <1>;
@@ -142,12 +209,13 @@ pcie-controller {
 
        pcie@6,0 {
                device_type = "pci";
-               assigned-addresses = <0x82003000 0 0xd0084000 0 0x2000>;
+               assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
                reg = <0x3000 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0
+                         0x81000000 0 0 0x81000000 0x6 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 63>;
                marvell,pcie-port = <1>;
@@ -158,12 +226,13 @@ pcie-controller {
 
        pcie@7,0 {
                device_type = "pci";
-               assigned-addresses = <0x82003800 0 0xd0088000 0 0x2000>;
+               assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
                reg = <0x3800 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0
+                         0x81000000 0 0 0x81000000 0x7 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 64>;
                marvell,pcie-port = <1>;
@@ -174,12 +243,13 @@ pcie-controller {
 
        pcie@8,0 {
                device_type = "pci";
-               assigned-addresses = <0x82004000 0 0xd008c000 0 0x2000>;
+               assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
                reg = <0x4000 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0
+                         0x81000000 0 0 0x81000000 0x8 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 65>;
                marvell,pcie-port = <1>;
@@ -187,14 +257,16 @@ pcie-controller {
                clocks = <&gateclk 12>;
                status = "disabled";
        };
+
        pcie@9,0 {
                device_type = "pci";
-               assigned-addresses = <0x82004800 0 0xd0042000 0 0x2000>;
+               assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
                reg = <0x4800 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
+                         0x81000000 0 0 0x81000000 0x9 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 99>;
                marvell,pcie-port = <2>;
@@ -205,12 +277,13 @@ pcie-controller {
 
        pcie@10,0 {
                device_type = "pci";
-               assigned-addresses = <0x82005000 0 0xd0082000 0 0x2000>;
+               assigned-addresses = <0x82005000 0 0x82000 0 0x2000>;
                reg = <0x5000 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
-               ranges;
+               ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0
+                         0x81000000 0 0 0x81000000 0xa 0 1 0>;
                interrupt-map-mask = <0 0 0 0>;
                interrupt-map = <0 0 0 0 &mpic 103>;
                marvell,pcie-port = <3>;
diff --git a/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt b/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
new file mode 100644 (file)
index 0000000..6b75107
--- /dev/null
@@ -0,0 +1,163 @@
+NVIDIA Tegra PCIe controller
+
+Required properties:
+- compatible: "nvidia,tegra20-pcie" or "nvidia,tegra30-pcie"
+- device_type: Must be "pci"
+- reg: A list of physical base address and length for each set of controller
+  registers. Must contain an entry for each entry in the reg-names property.
+- reg-names: Must include the following entries:
+  "pads": PADS registers
+  "afi": AFI registers
+  "cs": configuration space region
+- interrupts: A list of interrupt outputs of the controller. Must contain an
+  entry for each entry in the interrupt-names property.
+- interrupt-names: Must include the following entries:
+  "intr": The Tegra interrupt that is asserted for controller interrupts
+  "msi": The Tegra interrupt that is asserted when an MSI is received
+- pex-clk-supply: Supply voltage for internal reference clock
+- vdd-supply: Power supply for controller (1.05V)
+- avdd-supply: Power supply for controller (1.05V) (not required for Tegra20)
+- bus-range: Range of bus numbers associated with this controller
+- #address-cells: Address representation for root ports (must be 3)
+  - cell 0 specifies the bus and device numbers of the root port:
+    [23:16]: bus number
+    [15:11]: device number
+  - cell 1 denotes the upper 32 address bits and should be 0
+  - cell 2 contains the lower 32 address bits and is used to translate to the
+    CPU address space
+- #size-cells: Size representation for root ports (must be 2)
+- ranges: Describes the translation of addresses for root ports and standard
+  PCI regions. The entries must be 6 cells each, where the first three cells
+  correspond to the address as described for the #address-cells property
+  above, the fourth cell is the physical CPU address to translate to and the
+  fifth and six cells are as described for the #size-cells property above.
+  - The first two entries are expected to translate the addresses for the root
+    port registers, which are referenced by the assigned-addresses property of
+    the root port nodes (see below).
+  - The remaining entries setup the mapping for the standard I/O, memory and
+    prefetchable PCI regions. The first cell determines the type of region
+    that is setup:
+    - 0x81000000: I/O memory region
+    - 0x82000000: non-prefetchable memory region
+    - 0xc2000000: prefetchable memory region
+  Please refer to the standard PCI bus binding document for a more detailed
+  explanation.
+- clocks: List of clock inputs of the controller. Must contain an entry for
+  each entry in the clock-names property.
+- clock-names: Must include the following entries:
+  "pex": The Tegra clock of that name
+  "afi": The Tegra clock of that name
+  "pcie_xclk": The Tegra clock of that name
+  "pll_e": The Tegra clock of that name
+  "cml": The Tegra clock of that name (not required for Tegra20)
+
+Root ports are defined as subnodes of the PCIe controller node.
+
+Required properties:
+- device_type: Must be "pci"
+- assigned-addresses: Address and size of the port configuration registers
+- reg: PCI bus address of the root port
+- #address-cells: Must be 3
+- #size-cells: Must be 2
+- ranges: Sub-ranges distributed from the PCIe controller node. An empty
+  property is sufficient.
+- nvidia,num-lanes: Number of lanes to use for this port. Valid combinations
+  are:
+  - Root port 0 uses 4 lanes, root port 1 is unused.
+  - Both root ports use 2 lanes.
+
+Example:
+
+SoC DTSI:
+
+       pcie-controller {
+               compatible = "nvidia,tegra20-pcie";
+               device_type = "pci";
+               reg = <0x80003000 0x00000800   /* PADS registers */
+                      0x80003800 0x00000200   /* AFI registers */
+                      0x90000000 0x10000000>; /* configuration space */
+               reg-names = "pads", "afi", "cs";
+               interrupts = <0 98 0x04   /* controller interrupt */
+                             0 99 0x04>; /* MSI interrupt */
+               interrupt-names = "intr", "msi";
+
+               bus-range = <0x00 0xff>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+
+               ranges = <0x82000000 0 0x80000000 0x80000000 0 0x00001000   /* port 0 registers */
+                         0x82000000 0 0x80001000 0x80001000 0 0x00001000   /* port 1 registers */
+                         0x81000000 0 0          0x82000000 0 0x00010000   /* downstream I/O */
+                         0x82000000 0 0xa0000000 0xa0000000 0 0x10000000   /* non-prefetchable memory */
+                         0xc2000000 0 0xb0000000 0xb0000000 0 0x10000000>; /* prefetchable memory */
+
+               clocks = <&tegra_car 70>, <&tegra_car 72>, <&tegra_car 74>,
+                        <&tegra_car 118>;
+               clock-names = "pex", "afi", "pcie_xclk", "pll_e";
+               status = "disabled";
+
+               pci@1,0 {
+                       device_type = "pci";
+                       assigned-addresses = <0x82000800 0 0x80000000 0 0x1000>;
+                       reg = <0x000800 0 0 0 0>;
+                       status = "disabled";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       ranges;
+
+                       nvidia,num-lanes = <2>;
+               };
+
+               pci@2,0 {
+                       device_type = "pci";
+                       assigned-addresses = <0x82001000 0 0x80001000 0 0x1000>;
+                       reg = <0x001000 0 0 0 0>;
+                       status = "disabled";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       ranges;
+
+                       nvidia,num-lanes = <2>;
+               };
+       };
+
+
+Board DTS:
+
+       pcie-controller {
+               status = "okay";
+
+               vdd-supply = <&pci_vdd_reg>;
+               pex-clk-supply = <&pci_clk_reg>;
+
+               /* root port 00:01.0 */
+               pci@1,0 {
+                       status = "okay";
+
+                       /* bridge 01:00.0 (optional) */
+                       pci@0,0 {
+                               reg = <0x010000 0 0 0 0>;
+
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+
+                               device_type = "pci";
+
+                               /* endpoint 02:00.0 */
+                               pci@0,0 {
+                                       reg = <0x020000 0 0 0 0>;
+                               };
+                       };
+               };
+       };
+
+Note that devices on the PCI bus are dynamically discovered using PCI's bus
+enumeration and therefore don't need corresponding device nodes in DT. However
+if a device on the PCI bus provides a non-probeable bus such as I2C or SPI,
+device nodes need to be added in order to allow the bus' children to be
+instantiated at the proper location in the operating system's device tree (as
+illustrated by the optional nodes in the example above).
index 648d60e..7ccae49 100644 (file)
@@ -37,7 +37,7 @@ Bank: 3 (A, B and C)
   0xffffffff 0x7fff3ccf  /* pioB */
   0xffffffff 0x007fffff  /* pioC */
 
-For each peripheral/bank we will descibe in a u32 if a pin can can be
+For each peripheral/bank we will descibe in a u32 if a pin can be
 configured in it by putting 1 to the pin bit (1 << pin)
 
 Let's take the pioA on peripheral B
index e204d00..fb70856 100644 (file)
@@ -80,6 +80,17 @@ Valid values for pin and group names are:
     dbg, sdio3, spi, uaa, uab, uart2, uart3, sdio1, ddc, gma, gme, gmf, gmg,
     gmh, owr, uda.
 
+Valid values for nvidia,functions are:
+
+  blink, cec, cldvfs, clk12, cpu, dap, dap1, dap2, dev3, displaya,
+  displaya_alt, displayb, dtv, emc_dll, extperiph1, extperiph2,
+  extperiph3, gmi, gmi_alt, hda, hsi, i2c1, i2c2, i2c3, i2c4, i2cpwr,
+  i2s0, i2s1, i2s2, i2s3, i2s4, irda, kbc, nand, nand_alt, owr, pmi,
+  pwm0, pwm1, pwm2, pwm3, pwron, reset_out_n, rsvd1, rsvd2, rsvd3,
+  rsvd4, sdmmc1, sdmmc2, sdmmc3, sdmmc4, soc, spdif, spi1, spi2, spi3,
+  spi4, spi5, spi6, sysclk, trace, uarta, uartb, uartc, uartd, ulpi,
+  usb, vgp1, vgp2, vgp3, vgp4, vgp5, vgp6, vi, vi_alt1, vi_alt3
+
 Example:
 
        pinmux: pinmux {
index 683fde9..61e73cd 100644 (file)
@@ -103,6 +103,17 @@ Valid values for pin and group names are:
     drive_gma, drive_gmb, drive_gmc, drive_gmd, drive_gme, drive_owr,
     drive_uda.
 
+Valid values for nvidia,functions are:
+
+  ahb_clk, apb_clk, audio_sync, crt, dap1, dap2, dap3, dap4, dap5,
+  displaya, displayb, emc_test0_dll, emc_test1_dll, gmi, gmi_int,
+  hdmi, i2cp, i2c1, i2c2, i2c3, ide, irda, kbc, mio, mipi_hs, nand,
+  osc, owr, pcie, plla_out, pllc_out1, pllm_out1, pllp_out2, pllp_out3,
+  pllp_out4, pwm, pwr_intr, pwr_on, rsvd1, rsvd2, rsvd3, rsvd4, rtck,
+  sdio1, sdio2, sdio3, sdio4, sflash, spdif, spi1, spi2, spi2_alt,
+  spi3, spi4, trace, twc, uarta, uartb, uartc, uartd, uarte, ulpi,
+  vi, vi_sensor_clk, xio
+
 Example:
 
        pinctrl@70000000 {
index 6f426ed..0e6354c 100644 (file)
@@ -91,6 +91,18 @@ Valid values for pin and group names are:
     gmh, gpv, lcd1, lcd2, owr, sdio1, sdio2, sdio3, spi, uaa, uab, uart2,
     uart3, uda, vi1.
 
+Valid values for nvidia,functions are:
+
+  blink, cec, clk_12m_out, clk_32k_in, core_pwr_req, cpu_pwr_req, crt,
+  dap, ddr, dev3, displaya, displayb, dtv, extperiph1, extperiph2,
+  extperiph3, gmi, gmi_alt, hda, hdcp, hdmi, hsi, i2c1, i2c2, i2c3,
+  i2c4, i2cpwr, i2s0, i2s1, i2s2, i2s3, i2s4, invalid, kbc, mio, nand,
+  nand_alt, owr, pcie, pwm0, pwm1, pwm2, pwm3, pwr_int_n, rsvd1, rsvd2,
+  rsvd3, rsvd4, rtck, sata, sdmmc1, sdmmc2, sdmmc3, sdmmc4, spdif, spi1,
+  spi2, spi2_alt, spi3, spi4, spi5, spi6, sysclk, test, trace, uarta,
+  uartb, uartc, uartd, uarte, ulpi, vgp1, vgp2, vgp3, vgp4, vgp5, vgp6,
+  vi, vi_alt1, vi_alt2, vi_alt3
+
 Example:
 
        pinctrl@70000000 {
index 9a2f3f4..6b33b9f 100644 (file)
@@ -1,8 +1,8 @@
 ST Ericsson Nomadik pinmux controller
 
 Required properties:
-- compatible: "stericsson,nmk-pinctrl", "stericsson,nmk-pinctrl-db8540",
-              "stericsson,nmk-pinctrl-stn8815"
+- compatible: "stericsson,db8500-pinctrl", "stericsson,db8540-pinctrl",
+              "stericsson,stn8815-pinctrl"
 - reg: Should contain the register physical address and length of the PRCMU.
 
 Please refer to pinctrl-bindings.txt in this directory for details of the
@@ -68,7 +68,7 @@ Optional subnode-properties:
 Example board file extract:
 
        pinctrl@80157000 {
-               compatible = "stericsson,nmk-pinctrl";
+               compatible = "stericsson,db8500-pinctrl";
                reg = <0x80157000 0x2000>;
 
                pinctrl-names = "default";
index 5693877..82dd5b6 100644 (file)
@@ -1,21 +1,20 @@
 * Freescale MSI interrupt controller
 
 Required properties:
-- compatible : compatible list, contains 2 entries,
-  first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572,
-  etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" depending on
-  the parent type.
+- compatible : compatible list, may contain one or two entries
+  The first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572,
+  etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" or
+  "fsl,mpic-msi-v4.3" depending on the parent type and version. If mpic
+  version is 4.3, the number of MSI registers is increased to 16, MSIIR1 is
+  provided to access these 16 registers, and compatible "fsl,mpic-msi-v4.3"
+  should be used. The first entry is optional; the second entry is
+  required.
 
 - reg : It may contain one or two regions. The first region should contain
   the address and the length of the shared message interrupt register set.
-  The second region should contain the address of aliased MSIIR register for
-  platforms that have such an alias.
-
-- msi-available-ranges: use <start count> style section to define which
-  msi interrupt can be used in the 256 msi interrupts. This property is
-  optional, without this, all the 256 MSI interrupts can be used.
-  Each available range must begin and end on a multiple of 32 (i.e.
-  no splitting an individual MSI register or the associated PIC interrupt).
+  The second region should contain the address of aliased MSIIR or MSIIR1
+  register for platforms that have such an alias, if using MSIIR1, the second
+  region must be added because different MSI group has different MSIIR1 offset.
 
 - interrupts : each one of the interrupts here is one entry per 32 MSIs,
   and routed to the host interrupt controller. the interrupts should
@@ -28,6 +27,14 @@ Required properties:
   to MPIC.
 
 Optional properties:
+- msi-available-ranges: use <start count> style section to define which
+  msi interrupt can be used in the 256 msi interrupts. This property is
+  optional, without this, all the MSI interrupts can be used.
+  Each available range must begin and end on a multiple of 32 (i.e.
+  no splitting an individual MSI register or the associated PIC interrupt).
+  MPIC v4.3 does not support this property because the 32 interrupts of an
+  individual register are not continuous when using MSIIR1.
+
 - msi-address-64: 64-bit PCI address of the MSIIR register. The MSIIR register
   is used for MSI messaging.  The address of MSIIR in PCI address space is
   the MSI message address.
@@ -54,6 +61,28 @@ Example:
                interrupt-parent = <&mpic>;
        };
 
+       msi@41600 {
+               compatible = "fsl,mpic-msi-v4.3";
+               reg = <0x41600 0x200 0x44148 4>;
+               interrupts = <
+                       0xe0 0 0 0
+                       0xe1 0 0 0
+                       0xe2 0 0 0
+                       0xe3 0 0 0
+                       0xe4 0 0 0
+                       0xe5 0 0 0
+                       0xe6 0 0 0
+                       0xe7 0 0 0
+                       0x100 0 0 0
+                       0x101 0 0 0
+                       0x102 0 0 0
+                       0x103 0 0 0
+                       0x104 0 0 0
+                       0x105 0 0 0
+                       0x106 0 0 0
+                       0x107 0 0 0>;
+       };
+
 The Freescale hypervisor and msi-address-64
 -------------------------------------------
 Normally, PCI devices have access to all of CCSR via an ATMU mapping.  The
index eb2327b..c703d51 100644 (file)
@@ -1,7 +1,10 @@
 * Designware APB timer
 
 Required properties:
-- compatible: "snps,dw-apb-timer-sp" or "snps,dw-apb-timer-osc"
+- compatible: One of:
+       "snps,dw-apb-timer"
+       "snps,dw-apb-timer-sp" <DEPRECATED>
+       "snps,dw-apb-timer-osc" <DEPRECATED>
 - reg: physical base address of the controller and length of memory mapped
   region.
 - interrupts: IRQ line for the timer.
@@ -20,25 +23,10 @@ systems may use one.
 
 
 Example:
-
-               timer1: timer@ffc09000 {
-                               compatible = "snps,dw-apb-timer-sp";
-                               interrupts = <0 168 4>;
-                               clock-frequency = <200000000>;
-                               reg = <0xffc09000 0x1000>;
-                       };
-
-               timer2: timer@ffd00000 {
-                               compatible = "snps,dw-apb-timer-osc";
-                               interrupts = <0 169 4>;
-                               clock-frequency = <200000000>;
-                               reg = <0xffd00000 0x1000>;
-                       };
-
-               timer3: timer@ffe00000 {
-                               compatible = "snps,dw-apb-timer-osc";
-                               interrupts = <0 170 4>;
-                               reg = <0xffe00000 0x1000>;
-                               clocks = <&timer_clk>, <&timer_pclk>;
-                               clock-names = "timer", "pclk";
-                       };
+       timer@ffe00000 {
+               compatible = "snps,dw-apb-timer";
+               interrupts = <0 170 4>;
+               reg = <0xffe00000 0x1000>;
+               clocks = <&timer_clk>, <&timer_pclk>;
+               clock-names = "timer", "pclk";
+       };
index c152f65..55a9010 100644 (file)
@@ -1,4 +1,5 @@
 Altera JTAG UART
 
 Required properties:
-- compatible : should be "ALTR,juart-1.0"
+- compatible : should be "ALTR,juart-1.0" <DEPRECATED>
+- compatible : should be "altr,juart-1.0"
index 71cae3f..81bf7ff 100644 (file)
@@ -1,7 +1,8 @@
 Altera UART
 
 Required properties:
-- compatible : should be "ALTR,uart-1.0"
+- compatible : should be "ALTR,uart-1.0" <DEPRECATED>
+- compatible : should be "altr,uart-1.0"
 
 Optional properties:
 - clock-frequency : frequency of the clock input to the UART
index 1e753c6..32b1fa1 100644 (file)
@@ -7,7 +7,7 @@ UART node.
 
 Required properties:
 - rs485-rts-delay: prop-encoded-array <a b> where:
-  * a is the delay beteween rts signal and beginning of data sent in milliseconds.
+  * a is the delay between rts signal and beginning of data sent in milliseconds.
       it corresponds to the delay before sending data.
   * b is the delay between end of data sent and rts signal in milliseconds
       it corresponds to the delay after sending data and actual release of the line.
index 4d9eecc..520199e 100644 (file)
@@ -1,4 +1,5 @@
 Altera UP PS/2 controller
 
 Required properties:
-- compatible : should be "ALTR,ps2-1.0".
+- compatible : should be "ALTR,ps2-1.0". <DEPRECATED>
+- compatible : should be "altr,ps2-1.0".
index dda3759..31319dc 100644 (file)
@@ -1,4 +1,5 @@
 Altera SPI
 
 Required properties:
-- compatible : should be "ALTR,spi-1.0".
+- compatible : should be "ALTR,spi-1.0". <DEPRECATED>
+- compatible : should be "altr,spi-1.0".
index ec4d713..2956800 100644 (file)
@@ -7,6 +7,7 @@ ad      Avionic Design GmbH
 adi    Analog Devices, Inc.
 aeroflexgaisler        Aeroflex Gaisler AB
 ak     Asahi Kasei Corp.
+altr   Altera Corp.
 amcc   Applied Micro Circuits Corporation (APM, formally AMCC)
 apm    Applied Micro Circuits Corporation (APM)
 arm    ARM Ltd.
@@ -37,6 +38,7 @@ linux Linux-specific binding
 lsi    LSI Corp. (LSI Logic)
 marvell        Marvell Technology Group Ltd.
 maxim  Maxim Integrated Products
+microchip      Microchip Technology Inc.
 mosaixtech     Mosaix Technologies, Inc.
 national       National Semiconductor
 nintendo       Nintendo
@@ -1,8 +1,9 @@
-Allwinner sun4i Watchdog timer
+Allwinner SoCs Watchdog timer
 
 Required properties:
 
-- compatible : should be "allwinner,sun4i-wdt"
+- compatible : should be "allwinner,<soc-family>-wdt", the currently supported
+  SoC families being sun4i and sun6i
 - reg : Specifies base physical address and size of the registers.
 
 Example:
index 0b23261..e31a2a9 100644 (file)
@@ -321,7 +321,7 @@ Access to a dma_buf from the kernel context involves three steps:
 
    When the importer is done accessing the range specified in begin_cpu_access,
    it needs to announce this to the exporter (to facilitate cache flushing and
-   unpinning of any pinned resources). The result of of any dma_buf kmap calls
+   unpinning of any pinned resources). The result of any dma_buf kmap calls
    after end_cpu_access is undefined.
 
    Interface:
index 661a73f..93e63a9 100644 (file)
@@ -83,8 +83,7 @@ Where's this all leading?
 
 The klibc distribution contains some of the necessary software to make
 early userspace useful.  The klibc distribution is currently
-maintained separately from the kernel, but this may change early in
-the 2.7 era (it missed the boat for 2.5).
+maintained separately from the kernel.
 
 You can obtain somewhat infrequent snapshots of klibc from
 ftp://ftp.kernel.org/pub/linux/libs/klibc/
index 99ea58e..4a9739a 100644 (file)
@@ -150,7 +150,7 @@ C. Boot options
 
 C. Attaching, Detaching and Unloading
 
-Before going on on how to attach, detach and unload the framebuffer console, an
+Before going on how to attach, detach and unload the framebuffer console, an
 illustration of the dependencies may help.
 
 The console layer, as with most subsystems, needs a driver that interfaces with
index 02e5b48..2a547da 100644 (file)
@@ -571,7 +571,7 @@ mode "640x480-60"
 #                   160 chars   800 lines
 #   Blank Time      4.798 us    0.564 ms
 #                   50 chars    28 lines
-#   Polarity        negtive    positive
+#   Polarity        negative    positive
 #
     mode "1280x800-60"
 # D: 83.500 MHz, H: 49.702 kHz, V: 60.00 Hz
index 444e34b..1cb2462 100644 (file)
@@ -32,7 +32,7 @@
     Start viafb with default settings:
         #modprobe viafb
 
-    Start viafb with with user options:
+    Start viafb with user options:
         #modprobe viafb viafb_mode=800x600 viafb_bpp=16 viafb_refresh=60
                   viafb_active_dev=CRT+DVI viafb_dvi_port=DVP1
                   viafb_mode1=1024x768 viafb_bpp=16 viafb_refresh1=60
index b349d57..9dae594 100644 (file)
@@ -87,7 +87,7 @@ Unless otherwise specified, all options default to off.
 
   device=<devicepath>
        Specify a device during mount so that ioctls on the control device
-       can be avoided.  Especialy useful when trying to mount a multi-device
+       can be avoided.  Especially useful when trying to mount a multi-device
        setup as root.  May be specified multiple times for multiple devices.
 
   discard
index 293855e..7ed0d17 100644 (file)
@@ -26,11 +26,12 @@ journal=inum                When a journal already exists, this option is ignored.
                        Otherwise, it specifies the number of the inode which
                        will represent the ext3 file system's journal file.
 
+journal_path=path
 journal_dev=devnum     When the external journal device's major/minor numbers
-                       have changed, this option allows the user to specify
+                       have changed, these options allow the user to specify
                        the new journal location.  The journal device is
-                       identified through its new major/minor numbers encoded
-                       in devnum.
+                       identified through either its new major/minor numbers
+                       encoded in devnum, or via a path to the device.
 
 norecovery             Don't load the journal on mounting. Note that this forces
 noload                 mount of inconsistent filesystem, which can lead to
index b91cfaa..919a329 100644 (file)
@@ -2,7 +2,7 @@
 Ext4 Filesystem
 ===============
 
-Ext4 is an an advanced level of the ext3 filesystem which incorporates
+Ext4 is an advanced level of the ext3 filesystem which incorporates
 scalability and reliability enhancements for supporting large filesystems
 (64 bit) in keeping with increasing disk capacities and state-of-the-art
 feature requirements.
index b91e2f2..3cd27be 100644 (file)
@@ -18,8 +18,8 @@ according to its internal geometry or flash memory management scheme, namely FTL
 F2FS and its tools support various parameters not only for configuring on-disk
 layout, but also for selecting allocation and cleaning algorithms.
 
-The file system formatting tool, "mkfs.f2fs", is available from the following
-git tree:
+The following git tree provides the file system formatting tool (mkfs.f2fs),
+a consistency checking tool (fsck.f2fs), and a debugging tool (dump.f2fs).
 >> git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
 
 For reporting bugs and sending patches, please use the following mailing list:
@@ -133,6 +133,38 @@ f2fs. Each file shows the whole f2fs information.
  - current memory footprint consumed by f2fs.
 
 ================================================================================
+SYSFS ENTRIES
+================================================================================
+
+Information about mounted f2f2 file systems can be found in
+/sys/fs/f2fs.  Each mounted filesystem will have a directory in
+/sys/fs/f2fs based on its device name (i.e., /sys/fs/f2fs/sda).
+The files in each per-device directory are shown in table below.
+
+Files in /sys/fs/f2fs/<devname>
+(see also Documentation/ABI/testing/sysfs-fs-f2fs)
+..............................................................................
+ File                         Content
+
+ gc_max_sleep_time            This tuning parameter controls the maximum sleep
+                              time for the garbage collection thread. Time is
+                              in milliseconds.
+
+ gc_min_sleep_time            This tuning parameter controls the minimum sleep
+                              time for the garbage collection thread. Time is
+                              in milliseconds.
+
+ gc_no_gc_sleep_time          This tuning parameter controls the default sleep
+                              time for the garbage collection thread. Time is
+                              in milliseconds.
+
+ gc_idle                      This parameter controls the selection of victim
+                              policy for garbage collection. Setting gc_idle = 0
+                              (default) will disable this option. Setting
+                              gc_idle = 1 will select the Cost Benefit approach
+                              & setting gc_idle = 2 will select the greedy aproach.
+
+================================================================================
 USAGE
 ================================================================================
 
@@ -149,8 +181,12 @@ USAGE
  # mkfs.f2fs -l label /dev/block_device
  # mount -t f2fs /dev/block_device /mnt/f2fs
 
-Format options
---------------
+mkfs.f2fs
+---------
+The mkfs.f2fs is for the use of formatting a partition as the f2fs filesystem,
+which builds a basic on-disk layout.
+
+The options consist of:
 -l [label]   : Give a volume label, up to 512 unicode name.
 -a [0 or 1]  : Split start location of each area for heap-based allocation.
                1 is set by default, which performs this.
@@ -164,6 +200,37 @@ Format options
 -t [0 or 1]  : Disable discard command or not.
                1 is set by default, which conducts discard.
 
+fsck.f2fs
+---------
+The fsck.f2fs is a tool to check the consistency of an f2fs-formatted
+partition, which examines whether the filesystem metadata and user-made data
+are cross-referenced correctly or not.
+Note that, initial version of the tool does not fix any inconsistency.
+
+The options consist of:
+  -d debug level [default:0]
+
+dump.f2fs
+---------
+The dump.f2fs shows the information of specific inode and dumps SSA and SIT to
+file. Each file is dump_ssa and dump_sit.
+
+The dump.f2fs is used to debug on-disk data structures of the f2fs filesystem.
+It shows on-disk inode information reconized by a given inode number, and is
+able to dump all the SSA and SIT entries into predefined files, ./dump_ssa and
+./dump_sit respectively.
+
+The options consist of:
+  -d debug level [default:0]
+  -i inode no (hex)
+  -s [SIT dump segno from #1~#2 (decimal), for all 0~-1]
+  -a [SSA dump segno from #1~#2 (decimal), for all 0~-1]
+
+Examples:
+# dump.f2fs -i [ino] /dev/sdx
+# dump.f2fs -s 0~-1 /dev/sdx (SIT dump)
+# dump.f2fs -a 0~-1 /dev/sdx (SSA dump)
+
 ================================================================================
 DESIGN
 ================================================================================
index 09994c2..e543b1a 100644 (file)
@@ -93,7 +93,7 @@ For a filesystem to be exportable it must:
    2/ make sure that d_splice_alias is used rather than d_add
       when ->lookup finds an inode for a given parent and name.
 
-      If inode is NULL, d_splice_alias(inode, dentry) is eqivalent to
+      If inode is NULL, d_splice_alias(inode, dentry) is equivalent to
 
                d_add(dentry, inode), NULL
 
index 52ae07f..adc81a3 100644 (file)
@@ -12,7 +12,7 @@ struct pnfs_layout_hdr
 ----------------------
 The on-the-wire command LAYOUTGET corresponds to struct
 pnfs_layout_segment, usually referred to by the variable name lseg.
-Each nfs_inode may hold a pointer to a cache of of these layout
+Each nfs_inode may hold a pointer to a cache of these layout
 segments in nfsi->layout, of type struct pnfs_layout_hdr.
 
 We reference the header for the inode pointing to it, across each
index 99e9018..4086797 100644 (file)
@@ -149,7 +149,7 @@ Bitmap system area
 ------------------
 
 The bitmap itself is divided into three parts.
-First the system area, that is split into two halfs.
+First the system area, that is split into two halves.
 Then userspace.
 
 The requirement for a static, fixed preallocated system area comes from how
index 510b722..33e2f36 100644 (file)
@@ -31,7 +31,7 @@ Semantics
 
 Each relay channel has one buffer per CPU, each buffer has one or more
 sub-buffers.  Messages are written to the first sub-buffer until it is
-too full to contain a new message, in which case it it is written to
+too full to contain a new message, in which case it is written to
 the next (if available).  Messages are never split across sub-buffers.
 At this point, userspace can be notified so it empties the first
 sub-buffer, while the kernel continues writing to the next.
index caaaf12..eb843e4 100644 (file)
@@ -24,7 +24,7 @@ flag between KOBJ_NS_TYPE_NONE and KOBJ_NS_TYPES, and s_ns will
 point to the namespace to which it belongs.
 
 Each sysfs superblock's sysfs_super_info contains an array void
-*ns[KOBJ_NS_TYPES].  When a task in a tagging namespace
+*ns[KOBJ_NS_TYPES].  When a task in a tagging namespace
 kobj_nstype first mounts sysfs, a new superblock is created.  It
 will be differentiated from other sysfs mounts by having its
 s_fs_info->ns[kobj_nstype] set to the new namespace.  Note that
index 12525b1..5be51fd 100644 (file)
@@ -135,7 +135,7 @@ default behaviour.
        If the memory cost of 8 log buffers is too high on small
        systems, then it may be reduced at some cost to performance
        on metadata intensive workloads. The logbsize option below
-       controls the size of each buffer and so is also relevent to
+       controls the size of each buffer and so is also relevant to
        this case.
 
   logbsize=value
index 173f6d6..5e4f1dd 100644 (file)
@@ -213,7 +213,7 @@ The individual methods perform the following tasks:
      methods: for example the SPEC driver may define that its carrier
      I2C memory is seen at offset 1M and the internal SPI flash is seen
      at offset 16M.  This multiplexing of several flash memories in the
-     same address space is is carrier-specific and should only be used
+     same address space is carrier-specific and should only be used
      by a driver that has verified the `carrier_name' field.
 
 
index 3c74121..dc35a2b 100644 (file)
@@ -149,11 +149,13 @@ needs. Only UHID_OUTPUT and UHID_OUTPUT_EV have payloads.
   is of type "struct uhid_data_req".
   This may be received even though you haven't received UHID_OPEN, yet.
 
-  UHID_OUTPUT_EV:
+  UHID_OUTPUT_EV (obsolete):
   Same as UHID_OUTPUT but this contains a "struct input_event" as payload. This
   is called for force-feedback, LED or similar events which are received through
   an input device by the HID subsystem. You should convert this into raw reports
   and send them to your device similar to events of type UHID_OUTPUT.
+  This is no longer sent by newer kernels. Instead, HID core converts it into a
+  raw output report and sends it via UHID_OUTPUT.
 
   UHID_FEATURE:
   This event is sent if the kernel driver wants to perform a feature request as
index 8d2be8a..86c0b12 100644 (file)
@@ -299,7 +299,7 @@ Byte 1:
 min threshold (scale as bank 0x26)
 
 
-Warning for the adventerous
+Warning for the adventurous
 ===========================
 
 A word of caution to those who want to experiment and see if they can figure
index 4628646..3d1bac3 100644 (file)
@@ -1,7 +1,7 @@
        How to Get Your Patch Accepted Into the Hwmon Subsystem
        -------------------------------------------------------
 
-This text is is a collection of suggestions for people writing patches or
+This text is a collection of suggestions for people writing patches or
 drivers for the hwmon subsystem. Following these suggestions will greatly
 increase the chances of your change being accepted.
 
index 90387c3..f4021a2 100644 (file)
@@ -17,7 +17,7 @@ Credits:
     Philip Edelbrock <phil@netroedge.com>,
     and Mark Studebaker <mdsxyz123@yahoo.com>
   w83792d.c:
-    Chunhao Huang <DZShen@Winbond.com.tw>,
+    Shane Huang (Winbond),
     Rudolf Marek <r.marek@assembler.cz>
 
 Additional contributors:
index 8a023ce..53f7b68 100644 (file)
@@ -7,8 +7,7 @@ Supported chips:
     Addresses scanned: I2C 0x2c - 0x2f
     Datasheet: http://www.winbond.com.tw
 
-Author: Chunhao Huang
-Contact: DZShen <DZShen@Winbond.com.tw>
+Author: Shane Huang (Winbond)
 
 
 Module Parameters
index a903ee5..62f7d4e 100644 (file)
@@ -241,7 +241,7 @@ int hwspinlock_example2(void)
      locks).
      Should be called from a process context (this function might sleep).
      Returns the address of hwspinlock on success, or NULL on error (e.g.
-     if the hwspinlock is sill in use).
+     if the hwspinlock is still in use).
 
 5. Important structs
 
index d699162..8e5fbd8 100644 (file)
@@ -196,8 +196,8 @@ static int example_probe(struct i2c_client *i2c_client,
 
 Update the detach method, by changing the name to _remove and
 to delete the i2c_detach_client call. It is possible that you
-can also remove the ret variable as it is not not needed for
-any of the core functions.
+can also remove the ret variable as it is not needed for any
+of the core functions.
 
 - static int example_detach(struct i2c_client *client)
 + static int example_remove(struct i2c_client *client)
diff --git a/Documentation/input/gamepad.txt b/Documentation/input/gamepad.txt
new file mode 100644 (file)
index 0000000..8002c89
--- /dev/null
@@ -0,0 +1,156 @@
+                            Linux Gamepad API
+----------------------------------------------------------------------------
+
+1. Intro
+~~~~~~~~
+Linux provides many different input drivers for gamepad hardware. To avoid
+having user-space deal with different button-mappings for each gamepad, this
+document defines how gamepads are supposed to report their data.
+
+2. Geometry
+~~~~~~~~~~~
+As "gamepad" we define devices which roughly look like this:
+
+            ____________________________              __
+           / [__ZL__]          [__ZR__] \               |
+          / [__ TL __]        [__ TR __] \              | Front Triggers
+       __/________________________________\__         __|
+      /                                  _   \          |
+     /      /\           __             (N)   \         |
+    /       ||      __  |MO|  __     _       _ \        | Main Pad
+   |    <===DP===> |SE|      |ST|   (W) -|- (E) |       |
+    \       ||    ___          ___       _     /        |
+    /\      \/   /   \        /   \     (S)   /\      __|
+   /  \________ | LS  | ____ |  RS | ________/  \       |
+  |         /  \ \___/ /    \ \___/ /  \         |      | Control Sticks
+  |        /    \_____/      \_____/    \        |    __|
+  |       /                              \       |
+   \_____/                                \_____/
+
+       |________|______|    |______|___________|
+         D-Pad    Left       Right   Action Pad
+                 Stick       Stick
+
+                   |_____________|
+                      Menu Pad
+
+Most gamepads have the following features:
+  - Action-Pad
+    4 buttons in diamonds-shape (on the right side). The buttons are
+    differently labeled on most devices so we define them as NORTH,
+    SOUTH, WEST and EAST.
+  - D-Pad (Direction-pad)
+    4 buttons (on the left side) that point up, down, left and right.
+  - Menu-Pad
+    Different constellations, but most-times 2 buttons: SELECT - START
+    Furthermore, many gamepads have a fancy branded button that is used as
+    special system-button. It often looks different to the other buttons and
+    is used to pop up system-menus or system-settings.
+  - Analog-Sticks
+    Analog-sticks provide freely moveable sticks to control directions. Not
+    all devices have both or any, but they are present at most times.
+    Analog-sticks may also provide a digital button if you press them.
+  - Triggers
+    Triggers are located on the upper-side of the pad in vertical direction.
+    Not all devices provide them, but the upper buttons are normally named
+    Left- and Right-Triggers, the lower buttons Z-Left and Z-Right.
+  - Rumble
+    Many devices provide force-feedback features. But are mostly just
+    simple rumble motors.
+
+3. Detection
+~~~~~~~~~~~~
+All gamepads that follow the protocol described here map BTN_GAMEPAD. This is
+an alias for BTN_SOUTH/BTN_A. It can be used to identify a gamepad as such.
+However, not all gamepads provide all features, so you need to test for all
+features that you need, first. How each feature is mapped is described below.
+
+Legacy drivers often don't comply to these rules. As we cannot change them
+for backwards-compatibility reasons, you need to provide fixup mappings in
+user-space yourself. Some of them might also provide module-options that
+change the mappings so you can adivce users to set these.
+
+All new gamepads are supposed to comply with this mapping. Please report any
+bugs, if they don't.
+
+There are a lot of less-featured/less-powerful devices out there, which re-use
+the buttons from this protocol. However, they try to do this in a compatible
+fashion. For example, the "Nintendo Wii Nunchuk" provides two trigger buttons
+and one analog stick. It reports them as if it were a gamepad with only one
+analog stick and two trigger buttons on the right side.
+But that means, that if you only support "real" gamepads, you must test
+devices for _all_ reported events that you need. Otherwise, you will also get
+devices that report a small subset of the events.
+
+No other devices, that do not look/feel like a gamepad, shall report these
+events.
+
+4. Events
+~~~~~~~~~
+Gamepads report the following events:
+
+Action-Pad:
+  Every gamepad device has at least 2 action buttons. This means, that every
+  device reports BTN_SOUTH (which BTN_GAMEPAD is an alias for). Regardless
+  of the labels on the buttons, the codes are sent according to the
+  physical position of the buttons.
+  Please note that 2- and 3-button pads are fairly rare and old. You might
+  want to filter gamepads that do not report all four.
+    2-Button Pad:
+      If only 2 action-buttons are present, they are reported as BTN_SOUTH and
+      BTN_EAST. For vertical layouts, the upper button is BTN_EAST. For
+      horizontal layouts, the button more on the right is BTN_EAST.
+    3-Button Pad:
+      If only 3 action-buttons are present, they are reported as (from left
+      to right): BTN_WEST, BTN_SOUTH, BTN_EAST
+      If the buttons are aligned perfectly vertically, they are reported as
+      (from top down): BTN_WEST, BTN_SOUTH, BTN_EAST
+    4-Button Pad:
+      If all 4 action-buttons are present, they can be aligned in two
+      different formations. If diamond-shaped, they are reported as BTN_NORTH,
+      BTN_WEST, BTN_SOUTH, BTN_EAST according to their physical location.
+      If rectangular-shaped, the upper-left button is BTN_NORTH, lower-left
+      is BTN_WEST, lower-right is BTN_SOUTH and upper-right is BTN_EAST.
+
+D-Pad:
+  Every gamepad provides a D-Pad with four directions: Up, Down, Left, Right
+  Some of these are available as digital buttons, some as analog buttons. Some
+  may even report both. The kernel does not convert between these so
+  applications should support both and choose what is more appropriate if
+  both are reported.
+    Digital buttons are reported as:
+      BTN_DPAD_*
+    Analog buttons are reported as:
+      ABS_HAT0X and ABS_HAT0Y
+
+Analog-Sticks:
+  The left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is
+  reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present.
+  If analog-sticks provide digital buttons, they are mapped accordingly as
+  BTN_THUMBL (first/left) and BTN_THUMBR (second/right).
+
+Triggers:
+  Trigger buttons can be available as digital or analog buttons or both. User-
+  space must correctly deal with any situation and choose the most appropriate
+  mode.
+  Upper trigger buttons are reported as BTN_TR or ABS_HAT1X (right) and BTN_TL
+  or ABS_HAT1Y (left). Lower trigger buttons are reported as BTN_TR2 or
+  ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL).
+  If only one trigger-button combination is present (upper+lower), they are
+  reported as "right" triggers (BTN_TR/ABS_HAT1X).
+
+Menu-Pad:
+  Menu buttons are always digital and are mapped according to their location
+  instead of their labels. That is:
+    1-button Pad: Mapped as BTN_START
+    2-button Pad: Left button mapped as BTN_SELECT, right button mapped as
+                  BTN_START
+  Many pads also have a third button which is branded or has a special symbol
+  and meaning. Such buttons are mapped as BTN_MODE. Examples are the Nintendo
+  "HOME" button, the XBox "X"-button or Sony "P" button.
+
+Rumble:
+  Rumble is adverticed as FF_RUMBLE.
+
+----------------------------------------------------------------------------
+  Written 2013 by David Herrmann <dh.herrmann@gmail.com>
index c28f828..9398a50 100644 (file)
@@ -91,9 +91,9 @@ information from the kmemcheck warnings, which is extremely valuable in
 debugging a problem. This option is not mandatory, however, because it slows
 down the compilation process and produces a much bigger kernel image.
 
-Now the kmemcheck menu should be visible (under "Kernel hacking" / "kmemcheck:
-trap use of uninitialized memory"). Here follows a description of the
-kmemcheck configuration variables:
+Now the kmemcheck menu should be visible (under "Kernel hacking" / "Memory
+Debugging" / "kmemcheck: trap use of uninitialized memory"). Here follows
+a description of the kmemcheck configuration variables:
 
   o CONFIG_KMEMCHECK
 
index d9eb91b..62278e8 100644 (file)
@@ -71,7 +71,7 @@ To register the chip at address 0x63 on specific adapter, set the platform data
 according to include/linux/platform_data/leds-lm3556.h, set the i2c board info
 
 Example:
-       static struct i2c_board_info __initdata board_i2c_ch4[] = {
+       static struct i2c_board_info board_i2c_ch4[] __initdata = {
                {
                         I2C_BOARD_INFO(LM3556_NAME, 0x63),
                         .platform_data = &lm3556_pdata,
index c6eda18..e88ac3b 100644 (file)
@@ -37,7 +37,7 @@ registered using the i2c_board_info mechanism.
 To register the chip at address 0x60 on adapter 0, set the platform data
 according to include/linux/leds-lp3944.h, set the i2c board info:
 
-       static struct i2c_board_info __initdata a910_i2c_board_info[] = {
+       static struct i2c_board_info a910_i2c_board_info[] __initdata = {
                {
                        I2C_BOARD_INFO("lp3944", 0x60),
                        .platform_data = &a910_lp3944_leds,
index 8fd254c..58340d5 100644 (file)
@@ -163,7 +163,7 @@ a recent addition and not present on older kernels.
                     at read:  contains online/offline state of memory.
                     at write: user can specify "online_kernel",
                     "online_movable", "online", "offline" command
-                    which will be performed on al sections in the block.
+                    which will be performed on all sections in the block.
 'phys_device'     : read-only: designed to show the name of physical memory
                     device.  This is not well implemented now.
 'removable'       : read-only: contains an integer value indicating
index 990efd7..e129b24 100644 (file)
@@ -543,7 +543,7 @@ THe code within the for loop was changed to:
     }
 
 As you can see tmppar is used to accumulate the parity within a for
-iteration. In the last 3 statements is is added to par and, if needed,
+iteration. In the last 3 statements is added to par and, if needed,
 to rp12 and rp14.
 
 While making the changes I also found that I could exploit that tmppar
index 262acf5..e9b54de 100644 (file)
@@ -179,7 +179,7 @@ use the PM_TRACE mechanism documented in Documentation/power/s2ram.txt .
 
 To verify that the STR works, it is generally more convenient to use the s2ram
 tool available from http://suspend.sf.net and documented at
-http://en.opensuse.org/SDB:Suspend_to_RAM.
+http://en.opensuse.org/SDB:Suspend_to_RAM (S2RAM_LINK).
 
 Namely, after writing "freezer", "devices", "platform", "processors", or "core"
 into /sys/power/pm_test (available if the kernel is compiled with
@@ -194,10 +194,10 @@ Among other things, the testing with the help of /sys/power/pm_test may allow
 you to identify drivers that fail to suspend or resume their devices.  They
 should be unloaded every time before an STR transition.
 
-Next, you can follow the instructions at http://en.opensuse.org/s2ram to test
-the system, but if it does not work "out of the box", you may need to boot it
-with "init=/bin/bash" and test s2ram in the minimal configuration.  In that
-case, you may be able to search for failing drivers by following the procedure
+Next, you can follow the instructions at S2RAM_LINK to test the system, but if
+it does not work "out of the box", you may need to boot it with
+"init=/bin/bash" and test s2ram in the minimal configuration.  In that case,
+you may be able to search for failing drivers by following the procedure
 analogous to the one described in section 1.  If you find some failing drivers,
 you will have to unload them every time before an STR transition (ie. before
 you run s2ram), and please report the problems with them.
index 0b4b63e..079160e 100644 (file)
@@ -50,6 +50,19 @@ echo N > /sys/power/image_size
 
 before suspend (it is limited to 500 MB by default).
 
+. The resume process checks for the presence of the resume device,
+if found, it then checks the contents for the hibernation image signature.
+If both are found, it resumes the hibernation image.
+
+. The resume process may be triggered in two ways:
+  1) During lateinit:  If resume=/dev/your_swap_partition is specified on
+     the kernel command line, lateinit runs the resume process.  If the
+     resume device has not been probed yet, the resume process fails and
+     bootup continues.
+  2) Manually from an initrd or initramfs:  May be run from
+     the init script by using the /sys/power/resume file.  It is vital
+     that this be done prior to remounting any filesystems (even as
+     read-only) otherwise data may be corrupted.
 
 Article about goals and implementation of Software Suspend for Linux
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -326,7 +339,7 @@ Q: How can distributions ship a swsusp-supporting kernel with modular
 disk drivers (especially SATA)?
 
 A: Well, it can be done, load the drivers, then do echo into
-/sys/power/disk/resume file from initrd. Be sure not to mount
+/sys/power/resume file from initrd. Be sure not to mount
 anything, not even read-only mount, or you are going to lose your
 data.
 
index 05026ce..6db73df 100644 (file)
@@ -5,13 +5,20 @@ please mail me.
 
 00-INDEX
        - this file
+bootwrapper.txt
+       - Information on how the powerpc kernel is wrapped for boot on various
+         different platforms.
 cpu_features.txt
        - info on how we support a variety of CPUs with minimal compile-time
        options.
 eeh-pci-error-recovery.txt
        - info on PCI Bus EEH Error Recovery
+firmware-assisted-dump.txt
+       - Documentation on the firmware assisted dump mechanism "fadump".
 hvcs.txt
        - IBM "Hypervisor Virtual Console Server" Installation Guide
+kvm_440.txt
+       - Various notes on the implementation of KVM for PowerPC 440.
 mpc52xx.txt
        - Linux 2.6.x on MPC52xx family
 pmu-ebb.txt
@@ -19,3 +26,7 @@ pmu-ebb.txt
 qe_firmware.txt
        - describes the layout of firmware binaries for the Freescale QUICC
          Engine and the code that parses and uploads the microcode therein.
+ptrace.txt
+       - Information on the ptrace interfaces for hardware debug registers.
+transactional_memory.txt
+       - Overview of the Power8 transactional memory support.
index 9552a32..445ad74 100644 (file)
@@ -97,7 +97,7 @@ IPv4 addresses:
 
        %pI4    1.2.3.4
        %pi4    001.002.003.004
-       %p[Ii][hnbl]
+       %p[Ii]4[hnbl]
 
        For printing IPv4 dot-separated decimal addresses. The 'I4' and 'i4'
        specifiers result in a printed address with ('i4') or without ('I4')
@@ -194,11 +194,11 @@ struct va_format:
 
 u64 SHOULD be printed with %llu/%llx, (unsigned long long):
 
-       printk("%llu", (unsigned long long)u64_var);
+       printk("%llu", u64_var);
 
 s64 SHOULD be printed with %lld/%llx, (long long):
 
-       printk("%lld", (long long)s64_var);
+       printk("%lld", s64_var);
 
 If <type> is dependent on a config option for its size (e.g., sector_t,
 blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
index 717f5aa..28fbd87 100644 (file)
@@ -300,7 +300,7 @@ initialization.
 -------------------------------------------
 
 RapidIO subsystem code organization allows addition of new enumeration/discovery
-methods as new configuration options without significant impact to to the core
+methods as new configuration options without significant impact to the core
 RapidIO code.
 
 A new enumeration/discovery method has to be attached to one or more mport
index 4a4f47e..12ecfd3 100644 (file)
@@ -151,7 +151,7 @@ To send a request to the controller:
       generated.
 
     - The host read the outbound list copy pointer shadow register and compare
-      with previous saved read ponter N. If they are different, the host will
+      with previous saved read pointer N. If they are different, the host will
       read the (N+1)th outbound list unit.
 
       The host get the index of the request from the (N+1)th outbound list
index 0e41576..67b2ea1 100644 (file)
@@ -120,7 +120,7 @@ Mic Phantom+48V: switch for +48V phantom power for electrostatic microphones on
     Make sure this is not turned on while any other source is connected to input 1/2.
     It might damage the source and/or the maya44 card.
 
-Mic/Line input: if switch is is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo).
+Mic/Line input: if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo).
 
 Bypass: analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver.
 Bypass 1: same for channel 3+4.
index 0bcc551..fd74ff2 100644 (file)
@@ -73,7 +73,7 @@ The main requirements are:
 
 Design
 
-The new API shares a number of concepts with with the PCM API for flow
+The new API shares a number of concepts with the PCM API for flow
 control. Start, pause, resume, drain and stop commands have the same
 semantics no matter what the content is.
 
@@ -130,7 +130,7 @@ the settings should remain the exception.
 The timestamp becomes a multiple field structure. It lists the number
 of bytes transferred, the number of samples processed and the number
 of samples rendered/grabbed. All these values can be used to determine
-the avarage bitrate, figure out if the ring buffer needs to be
+the average bitrate, figure out if the ring buffer needs to be
 refilled or the delay due to decoding/encoding/io on the DSP.
 
 Note that the list of codecs/profiles/modes was derived from the
index c1a1fd6..a5f985e 100644 (file)
@@ -47,7 +47,7 @@ versions of the sysfs interface.
         at device creation and removal
       - the unique key to the device at that point in time
       - the kernel's path to the device directory without the leading
-        /sys, and always starting with with a slash
+        /sys, and always starting with a slash
       - all elements of a devpath must be real directories. Symlinks
         pointing to /sys/devices must always be resolved to their real
         target and the target path must be used to access the device.
index 3fe0d81..54d29c1 100755 (executable)
@@ -300,7 +300,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
        buf += "        int ret;\n\n"
        buf += "        if (strstr(name, \"tpgt_\") != name)\n"
        buf += "                return ERR_PTR(-EINVAL);\n"
-       buf += "        if (strict_strtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)\n"
+       buf += "        if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)\n"
        buf += "                return ERR_PTR(-EINVAL);\n\n"
        buf += "        tpg = kzalloc(sizeof(struct " + fabric_mod_name + "_tpg), GFP_KERNEL);\n"
        buf += "        if (!tpg) {\n"
index b937c6e..ea2d35d 100644 (file)
@@ -735,7 +735,7 @@ Here are the available options:
                 function as well as the function being traced.
 
   print-parent:
-   bash-4000  [01]  1477.606694: simple_strtoul <-strict_strtoul
+   bash-4000  [01]  1477.606694: simple_strtoul <-kstrtoul
 
   noprint-parent:
    bash-4000  [01]  1477.606694: simple_strtoul
@@ -759,7 +759,7 @@ Here are the available options:
             latency-format option is enabled.
 
     bash  4000 1 0 00000000 00010a95 [58127d26] 1720.415ms \
-    (+0.000ms): simple_strtoul (strict_strtoul)
+    (+0.000ms): simple_strtoul (kstrtoul)
 
   raw - This will display raw numbers. This option is best for
        use with user applications that can translate the raw
index da49437..ac4170d 100644 (file)
@@ -40,7 +40,13 @@ Two elements are required for tracepoints :
 
 In order to use tracepoints, you should include linux/tracepoint.h.
 
-In include/trace/subsys.h :
+In include/trace/events/subsys.h :
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM subsys
+
+#if !defined(_TRACE_SUBSYS_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_SUBSYS_H
 
 #include <linux/tracepoint.h>
 
@@ -48,10 +54,16 @@ DECLARE_TRACE(subsys_eventname,
        TP_PROTO(int firstarg, struct task_struct *p),
        TP_ARGS(firstarg, p));
 
+#endif /* _TRACE_SUBSYS_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
+
 In subsys/file.c (where the tracing statement must be added) :
 
-#include <trace/subsys.h>
+#include <trace/events/subsys.h>
 
+#define CREATE_TRACE_POINTS
 DEFINE_TRACE(subsys_eventname);
 
 void somefct(void)
@@ -72,6 +84,9 @@ Where :
 - TP_ARGS(firstarg, p) are the parameters names, same as found in the
   prototype.
 
+- if you use the header in multiple source files, #define CREATE_TRACE_POINTS
+  should appear only in one source file.
+
 Connecting a function (probe) to a tracepoint is done by providing a
 probe (function to call) for the specific tracepoint through
 register_trace_subsys_eventname().  Removing a probe is done through
index ef925ea..858aecf 100644 (file)
@@ -53,7 +53,7 @@ incompatible change are allowed.  However, there is an extension
 facility that allows backward-compatible extensions to the API to be
 queried and used.
 
-The extension mechanism is not based on on the Linux version number.
+The extension mechanism is not based on the Linux version number.
 Instead, kvm defines extension identifiers and a facility to query
 whether a particular extension identifier is available.  If it is, a
 set of ioctls is available for application use.
index fc66d42..f4f268c 100644 (file)
@@ -58,7 +58,7 @@ Protocol 2.11:        (Kernel 3.6) Added a field for offset of EFI handover
                protocol entry point.
 
 Protocol 2.12: (Kernel 3.8) Added the xloadflags field and extension fields
-               to struct boot_params for for loading bzImage and ramdisk
+               to struct boot_params for loading bzImage and ramdisk
                above 4G in 64bit.
 
 **** MEMORY LAYOUT
index 0f4385a..be0bd47 100644 (file)
@@ -146,7 +146,7 @@ Majordomo lists of VGER.KERNEL.ORG at:
         <http://vger.kernel.org/vger-lists.html>
 
 如果改动影响了用户空间和内核之间的接口,请给 MAN-PAGES 的维护者(列在
-MAITAINERS 文件里的)发送一个手册页(man-pages)补丁,或者至少通知一下改
+MAINTAINERS 文件里的)发送一个手册页(man-pages)补丁,或者至少通知一下改
 变,让一些信息有途径进入手册页。
 
 即使在第四步的时候,维护者没有作出回应,也要确认在修改他们的代码的时候
index 9d8ab7c..b6b29c3 100644 (file)
@@ -1320,7 +1320,6 @@ L:        linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     arch/arm/mach-vt8500/
 F:     drivers/clocksource/vt8500_timer.c
-F:     drivers/gpio/gpio-vt8500.c
 F:     drivers/i2c/busses/i2c-wmt.c
 F:     drivers/mmc/host/wmt-sdmmc.c
 F:     drivers/pwm/pwm-vt8500.c
@@ -2494,9 +2493,9 @@ S:        Maintained
 F:     drivers/media/common/cypress_firmware*
 
 CYTTSP TOUCHSCREEN DRIVER
-M:     Javier Martinez Canillas <javier@dowhile0.org>
+M:     Ferruh Yigit <fery@cypress.com>
 L:     linux-input@vger.kernel.org
-S:     Maintained
+S:     Supported
 F:     drivers/input/touchscreen/cyttsp*
 F:     include/linux/input/cyttsp.h
 
@@ -4141,6 +4140,13 @@ W:       http://launchpad.net/ideapad-laptop
 S:     Maintained
 F:     drivers/platform/x86/ideapad-laptop.c
 
+IDEAPAD LAPTOP SLIDEBAR DRIVER
+M:     Andrey Moiseev <o2g.org.ru@gmail.com>
+L:     linux-input@vger.kernel.org
+W:     https://github.com/o2genum/ideapad-slidebar
+S:     Maintained
+F:     drivers/input/misc/ideapad_slidebar.c
+
 IDE/ATAPI DRIVERS
 M:     Borislav Petkov <bp@alien8.de>
 L:     linux-ide@vger.kernel.org
@@ -6315,6 +6321,13 @@ F:       Documentation/PCI/
 F:     drivers/pci/
 F:     include/linux/pci*
 
+PCI DRIVER FOR NVIDIA TEGRA
+M:     Thierry Reding <thierry.reding@gmail.com>
+L:     linux-tegra@vger.kernel.org
+S:     Supported
+F:     Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
+F:     drivers/pci/host/pci-tegra.c
+
 PCMCIA SUBSYSTEM
 P:     Linux PCMCIA Team
 L:     linux-pcmcia@lists.infradead.org
@@ -6961,6 +6974,14 @@ M:       Maxim Levitsky <maximlevitsky@gmail.com>
 S:     Maintained
 F:     drivers/memstick/host/r592.*
 
+ROCCAT DRIVERS
+M:     Stefan Achatz <erazor_de@users.sourceforge.net>
+W:     http://sourceforge.net/projects/roccat/
+S:     Maintained
+F:     drivers/hid/hid-roccat*
+F:     include/linux/hid-roccat*
+F:     Documentation/ABI/*/sysfs-driver-hid-roccat*
+
 ROCKETPORT DRIVER
 P:     Comtrol Corp.
 W:     http://www.comtrol.com
@@ -8365,9 +8386,14 @@ M:       Chris Metcalf <cmetcalf@tilera.com>
 W:     http://www.tilera.com/scm/
 S:     Supported
 F:     arch/tile/
-F:     drivers/tty/hvc/hvc_tile.c
-F:     drivers/net/ethernet/tile/
+F:     drivers/char/tile-srom.c
 F:     drivers/edac/tile_edac.c
+F:     drivers/net/ethernet/tile/
+F:     drivers/rtc/rtc-tile.c
+F:     drivers/tty/hvc/hvc_tile.c
+F:     drivers/tty/serial/tilegx.c
+F:     drivers/usb/host/*-tilegx.c
+F:     include/linux/usb/tilegx.h
 
 TLAN NETWORK DRIVER
 M:     Samuel Chessman <chessman@tux.org>
index 5d1f570..a00f4c1 100644 (file)
@@ -442,7 +442,6 @@ config ARCH_NETX
 config ARCH_IOP13XX
        bool "IOP13xx-based"
        depends on MMU
-       select ARCH_SUPPORTS_MSI
        select CPU_XSC3
        select NEED_MACH_MEMORY_H
        select NEED_RET_TO_USER
@@ -631,6 +630,7 @@ config ARCH_MSM
        bool "Qualcomm MSM"
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
+       select CLKSRC_OF if OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        help
@@ -646,7 +646,7 @@ config ARCH_SHMOBILE
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_CLK
        select HAVE_MACH_CLKDEV
        select HAVE_SMP
@@ -701,7 +701,7 @@ config ARCH_S3C24XX
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
-       select CLKSRC_MMIO
+       select CLKSRC_SAMSUNG_PWM
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
        select HAVE_CLK
@@ -724,7 +724,7 @@ config ARCH_S3C64XX
        select ARCH_REQUIRE_GPIOLIB
        select ARM_VIC
        select CLKDEV_LOOKUP
-       select CLKSRC_MMIO
+       select CLKSRC_SAMSUNG_PWM
        select CPU_V6
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
@@ -740,7 +740,6 @@ config ARCH_S3C64XX
        select SAMSUNG_ATAGS
        select SAMSUNG_CLKSRC
        select SAMSUNG_GPIOLIB_4BIT
-       select SAMSUNG_IRQ_VIC_TIMER
        select SAMSUNG_WDT_RESET
        select USB_ARCH_HAS_OHCI
        help
@@ -749,7 +748,7 @@ config ARCH_S3C64XX
 config ARCH_S5P64X0
        bool "Samsung S5P6440 S5P6450"
        select CLKDEV_LOOKUP
-       select CLKSRC_MMIO
+       select CLKSRC_SAMSUNG_PWM
        select CPU_V6
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
@@ -768,7 +767,7 @@ config ARCH_S5PC100
        bool "Samsung S5PC100"
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
-       select CLKSRC_MMIO
+       select CLKSRC_SAMSUNG_PWM
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
@@ -788,7 +787,7 @@ config ARCH_S5PV210
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
-       select CLKSRC_MMIO
+       select CLKSRC_SAMSUNG_PWM
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
@@ -1594,23 +1593,13 @@ config ARM_PSCI
          0022A ("Power State Coordination Interface System Software on
          ARM processors").
 
-config LOCAL_TIMERS
-       bool "Use local timer interrupts"
-       depends on SMP
-       default y
-       help
-         Enable support for local timers on SMP platforms, rather then the
-         legacy IPI broadcast method.  Local timers allows the system
-         accounting to be spread across the timer interval, preventing a
-         "thundering herd" at every timer tick.
-
 # The GPIO number here must be sorted by descending number. In case of
 # a multiplatform kernel, we just want the highest value required by the
 # selected platforms.
 config ARCH_NR_GPIO
        int
        default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
-       default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5
+       default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX
        default 392 if ARCH_U8500
        default 352 if ARCH_VT8500
        default 288 if ARCH_SUNXI
index 4137529..9762c84 100644 (file)
@@ -895,6 +895,11 @@ config DEBUG_LL_INCLUDE
                                 DEBUG_IMX53_UART ||\
                                 DEBUG_IMX6Q_UART || \
                                 DEBUG_IMX6SL_UART
+       default "debug/msm.S" if DEBUG_MSM_UART1 || \
+                                DEBUG_MSM_UART2 || \
+                                DEBUG_MSM_UART3 || \
+                                DEBUG_MSM8660_UART || \
+                                DEBUG_MSM8960_UART
        default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
        default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
        default "debug/sti.S" if DEBUG_STI_UART
@@ -1056,7 +1061,7 @@ config DEBUG_UART_8250_FLOW_CONTROL
 
 config DEBUG_UNCOMPRESS
        bool
-       depends on ARCH_MULTIPLATFORM
+       depends on ARCH_MULTIPLATFORM || ARCH_MSM
        default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \
                     (!DEBUG_TEGRA_UART || !ZBOOT_ROM)
        help
@@ -1072,7 +1077,7 @@ config DEBUG_UNCOMPRESS
 
 config UNCOMPRESS_INCLUDE
        string
-       default "debug/uncompress.h" if ARCH_MULTIPLATFORM
+       default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM
        default "mach/uncompress.h"
 
 config EARLY_PRINTK
index 6fd2cea..a37a50f 100644 (file)
@@ -190,6 +190,7 @@ machine-$(CONFIG_ARCH_S5PV210)              += s5pv210
 machine-$(CONFIG_ARCH_SA1100)          += sa1100
 machine-$(CONFIG_ARCH_SHARK)           += shark
 machine-$(CONFIG_ARCH_SHMOBILE)        += shmobile
+machine-$(CONFIG_ARCH_SHMOBILE_MULTI)  += shmobile
 machine-$(CONFIG_ARCH_SIRF)            += prima2
 machine-$(CONFIG_ARCH_SOCFPGA)         += socfpga
 machine-$(CONFIG_ARCH_STI)             += sti
index e2d6363..e7f8092 100644 (file)
@@ -55,12 +55,47 @@ __tmp_stack:
 __continue:
 #endif /* CONFIG_ZBOOT_ROM_MMC || CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI */
 
-       /* Set board ID necessary for boot */
-       ldr     r7, 1f                          @ Set machine type register
-       mov     r8, #0                          @ pass null pointer as atag
+       adr     r0, dtb_info
+       ldmia   r0, {r1, r3, r4, r5, r7}
+
+       sub     r0, r0, r1              @ calculate the delta offset
+       add     r5, r5, r0              @ _edata
+
+       ldr     lr, [r5, #0]            @ check if valid DTB is present
+       cmp     lr, r3
+       bne     0f
+
+       add     r9, r7, #31             @ rounded up to a multiple
+       bic     r9, r9, #31             @ ... of 32 bytes
+
+       add     r6, r9, r5              @ copy from _edata
+       add     r9, r9, r4              @ to MEMORY_START
+
+1:     ldmdb   r6!, {r0 - r3, r10 - r12, lr}
+       cmp     r6, r5
+       stmdb   r9!, {r0 - r3, r10 - r12, lr}
+       bhi     1b
+
+       /* Success: Zero board ID, pointer to start of memory for atag/dtb */
+       mov     r7, #0
+       mov     r8, r4
        b       2f
 
-1 :    .long MACH_TYPE
+       .align  2
+dtb_info:
+       .word   dtb_info
+#ifndef __ARMEB__
+       .word   0xedfe0dd0              @ sig is 0xd00dfeed big endian
+#else
+       .word   0xd00dfeed
+#endif
+       .word   MEMORY_START
+       .word   _edata
+       .word   0x4000                  @ maximum DTB size
+0:
+       /* Failure: Zero board ID, NULL atag/dtb */
+       mov     r7, #0
+       mov     r8, #0                  @ pass null pointer as atag
 2 :
 
 #endif /* CONFIG_ZBOOT_ROM */
index 641b3c9..000cf76 100644 (file)
@@ -42,24 +42,27 @@ dtb-$(CONFIG_ARCH_AT91)     += sama5d34ek.dtb
 dtb-$(CONFIG_ARCH_AT91)        += sama5d35ek.dtb
 
 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
-dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb
+dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb \
+       bcm28155-ap.dtb
 dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \
        da850-evm.dtb
 dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \
        dove-cubox.dtb \
+       dove-d2plug.dtb \
        dove-dove-db.dtb
 dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
        exynos4210-smdkv310.dtb \
        exynos4210-trats.dtb \
        exynos4210-universal_c210.dtb \
        exynos4412-odroidx.dtb \
-       exynos4412-smdk4412.dtb \
        exynos4412-origen.dtb \
+       exynos4412-smdk4412.dtb \
+       exynos4412-trats2.dtb \
        exynos5250-arndale.dtb \
-       exynos5440-sd5v1.dtb \
        exynos5250-smdk5250.dtb \
        exynos5250-snow.dtb \
        exynos5420-smdk5420.dtb \
+       exynos5440-sd5v1.dtb \
        exynos5440-ssdk5440.dtb
 dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \
        ecx-2000.dtb
@@ -83,12 +86,14 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
        kirkwood-lschlv2.dtb \
        kirkwood-lsxhl.dtb \
        kirkwood-mplcec4.dtb \
+       kirkwood-mv88f6281gtw-ge.dtb \
        kirkwood-netgear_readynas_duo_v2.dtb \
        kirkwood-ns2.dtb \
        kirkwood-ns2lite.dtb \
        kirkwood-ns2max.dtb \
        kirkwood-ns2mini.dtb \
        kirkwood-nsa310.dtb \
+       kirkwood-nsa310a.dtb \
        kirkwood-sheevaplug.dtb \
        kirkwood-sheevaplug-esata.dtb \
        kirkwood-topkick.dtb \
@@ -100,7 +105,9 @@ dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
        msm8960-cdp.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
        armada-370-mirabox.dtb \
+       armada-370-netgear-rn102.dtb \
        armada-370-rd.dtb \
+       armada-xp-axpwifiap.dtb \
        armada-xp-db.dtb \
        armada-xp-gp.dtb \
        armada-xp-openblocks-ax3-4.dtb
@@ -112,6 +119,8 @@ dtb-$(CONFIG_ARCH_MXC) += \
        imx27-pdk.dtb \
        imx27-phytec-phycore-som.dtb \
        imx27-phytec-phycore-rdk.dtb \
+       imx27-phytec-phycard-s-som.dtb \
+       imx27-phytec-phycard-s-rdk.dtb \
        imx31-bug.dtb \
        imx51-apf51.dtb \
        imx51-apf51dev.dtb \
@@ -131,6 +140,7 @@ dtb-$(CONFIG_ARCH_MXC) += \
        imx6q-sabrelite.dtb \
        imx6q-sabresd.dtb \
        imx6q-sbc6x.dtb \
+       imx6q-wandboard.dtb \
        imx6sl-evk.dtb \
        vf610-twr.dtb
 dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
@@ -143,7 +153,9 @@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
        imx28-cfa10037.dtb \
        imx28-cfa10049.dtb \
        imx28-cfa10055.dtb \
+       imx28-cfa10056.dtb \
        imx28-cfa10057.dtb \
+       imx28-cfa10058.dtb \
        imx28-evk.dtb \
        imx28-m28evk.dtb \
        imx28-sps1.dtb \
@@ -176,13 +188,14 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
        am43x-epos-evm.dtb
 dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb
 dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
-dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
-       hrefprev60.dtb \
-       hrefv60plus.dtb \
-       ccu8540.dtb \
-       ccu9540.dtb
+dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \
+       ste-hrefprev60.dtb \
+       ste-hrefv60plus.dtb \
+       ste-ccu8540.dtb \
+       ste-ccu9540.dtb
 dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
+       emev2-kzm9d-reference.dtb \
        r8a7740-armadillo800eva.dtb \
        r8a7778-bockw.dtb \
        r8a7740-armadillo800eva-reference.dtb \
@@ -192,6 +205,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
        sh73a0-kzm9g-reference.dtb \
        r8a73a4-ape6evm.dtb \
        sh7372-mackerel.dtb
+dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d-reference.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
        socfpga_vt.dtb
 dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
@@ -206,11 +220,14 @@ dtb-$(CONFIG_ARCH_STI)+= stih415-b2000.dtb \
        stih415-b2020.dtb \
        stih416-b2020.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += \
+       sun4i-a10-a1000.dtb \
        sun4i-a10-cubieboard.dtb \
        sun4i-a10-mini-xplus.dtb \
        sun4i-a10-hackberry.dtb \
        sun5i-a10s-olinuxino-micro.dtb \
-       sun5i-a13-olinuxino.dtb
+       sun5i-a13-olinuxino.dtb \
+       sun6i-a31-colombus.dtb \
+       sun7i-a20-olinuxino-micro.dtb
 dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
        tegra20-iris-512.dtb \
        tegra20-medcom-wide.dtb \
@@ -224,8 +241,7 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
        tegra30-beaver.dtb \
        tegra30-cardhu-a02.dtb \
        tegra30-cardhu-a04.dtb \
-       tegra114-dalmore.dtb \
-       tegra114-pluto.dtb
+       tegra114-dalmore.dtb
 dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \
        versatile-pb.dtb
 dtb-$(CONFIG_ARCH_U300) += ste-u300.dtb
index beee169..90ce29d 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 /dts-v1/;
-/include/ "armada-370.dtsi"
+#include "armada-370.dtsi"
 
 / {
        model = "Marvell Armada 370 Evaluation Board";
@@ -30,6 +30,9 @@
        };
 
        soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+
                internal-regs {
                        serial@12000 {
                                clock-frequency = <200000000>;
index 45b1077..2471d9d 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 /dts-v1/;
-/include/ "armada-370.dtsi"
+#include "armada-370.dtsi"
 
 / {
        model = "Globalscale Mirabox";
        };
 
        soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+
+               pcie-controller {
+                       status = "okay";
+
+                       /* Internal mini-PCIe connector */
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+
+                       /* Connected on the PCB to a USB 3.0 XHCI controller */
+                       pcie@2,0 {
+                               /* Port 1, Lane 0 */
+                               status = "okay";
+                       };
+               };
+
                internal-regs {
                        serial@12000 {
                                clock-frequency = <200000000>;
                                        reg = <0x25>;
                                };
                        };
-
-                       pcie-controller {
-                               status = "okay";
-
-                               /* Internal mini-PCIe connector */
-                               pcie@1,0 {
-                                       /* Port 0, Lane 0 */
-                                       status = "okay";
-                               };
-
-                               /* Connected on the PCB to a USB 3.0 XHCI controller */
-                               pcie@2,0 {
-                                       /* Port 1, Lane 0 */
-                                       status = "okay";
-                               };
-                       };
                };
        };
 };
diff --git a/arch/arm/boot/dts/armada-370-netgear-rn102.dts b/arch/arm/boot/dts/armada-370-netgear-rn102.dts
new file mode 100644 (file)
index 0000000..05e4485
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Device Tree file for NETGEAR ReadyNAS 102
+ *
+ * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+/dts-v1/;
+
+#include "armada-370.dtsi"
+
+/ {
+       model = "NETGEAR ReadyNAS 102";
+       compatible = "netgear,readynas-102", "marvell,armada370", "marvell,armada-370-xp";
+
+       chosen {
+               bootargs = "console=ttyS0,115200 earlyprintk";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>; /* 512 MB */
+       };
+
+       soc {
+               internal-regs {
+                       serial@12000 {
+                               clock-frequency = <200000000>;
+                               status = "okay";
+                       };
+
+                       sata@a0000 {
+                               nr-ports = <2>;
+                               status = "okay";
+                       };
+
+                       pinctrl {
+                               power_led_pin: power-led-pin {
+                                       marvell,pins = "mpp57";
+                                       marvell,function = "gpio";
+                               };
+                               sata1_led_pin: sata1-led-pin {
+                                       marvell,pins = "mpp15";
+                                       marvell,function = "gpio";
+                               };
+
+                               sata2_led_pin: sata2-led-pin {
+                                       marvell,pins = "mpp14";
+                                       marvell,function = "gpio";
+                               };
+
+                               backup_led_pin: backup-led-pin {
+                                       marvell,pins = "mpp56";
+                                       marvell,function = "gpio";
+                               };
+                       };
+
+                       mdio {
+                               phy0: ethernet-phy@0 {
+                                       reg = <0>;
+                               };
+                       };
+
+                       ethernet@74000 {
+                               status = "okay";
+                               phy = <&phy0>;
+                               phy-mode = "rgmii-id";
+                       };
+
+                       usb@50000 {
+                               status = "okay";
+                       };
+
+                       i2c@11000 {
+                               compatible = "marvell,mv64xxx-i2c";
+                               clock-frequency = <100000>;
+                               status = "okay";
+
+                               g762: g762@3e {
+                                       compatible = "gmt,g762";
+                                       reg = <0x3e>;
+                                       clocks = <&g762_clk>; /* input clock */
+                                       fan_gear_mode = <0>;
+                                       fan_startv = <1>;
+                                       pwm_polarity = <0>;
+                               };
+                       };
+
+                       pcie-controller {
+                               status = "okay";
+
+                               /* Connected to Marvell SATA controller */
+                               pcie@1,0 {
+                                       /* Port 0, Lane 0 */
+                                       status = "okay";
+                               };
+
+                               /* Connected to FL1009 USB 3.0 controller */
+                               pcie@2,0 {
+                                       /* Port 1, Lane 0 */
+                                       status = "okay";
+                               };
+                       };
+               };
+       };
+
+       clocks {
+              #address-cells = <1>;
+              #size-cells = <0>;
+
+              g762_clk: fixedclk {
+                        compatible = "fixed-clock";
+                        #clock-cells = <0>;
+                        clock-frequency = <8192>;
+              };
+       };
+
+       gpio_leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = < &power_led_pin
+                             &sata1_led_pin
+                             &sata2_led_pin
+                             &backup_led_pin >;
+               pinctrl-names = "default";
+
+               blue_power_led {
+                       label = "rn102:blue:pwr";
+                       gpios = <&gpio1 25 1>;  /* GPIO 57 Active Low */
+                       linux,default-trigger = "heartbeat";
+               };
+
+               green_sata1_led {
+                       label = "rn102:green:sata1";
+                       gpios = <&gpio0 15 1>;  /* GPIO 15 Active Low */
+                       default-state = "on";
+               };
+
+               green_sata2_led {
+                       label = "rn102:green:sata2";
+                       gpios = <&gpio0 14 1>;   /* GPIO 14 Active Low */
+                       default-state = "on";
+               };
+
+               green_backup_led {
+                       label = "rn102:green:backup";
+                       gpios = <&gpio1 24 1>;   /* GPIO 56 Active Low */
+                       default-state = "on";
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               button@1 {
+                       label = "Power Button";
+                       linux,code = <116>;     /* KEY_POWER */
+                       gpios = <&gpio1 30 1>;
+               };
+
+               button@2 {
+                       label = "Reset Button";
+                       linux,code = <0x198>;   /* KEY_RESTART */
+                       gpios = <&gpio0 6 1>;
+               };
+
+               button@3 {
+                       label = "Backup Button";
+                       linux,code = <133>;     /* KEY_COPY */
+                       gpios = <&gpio1 26 1>;
+               };
+       };
+
+};
index a3a2fed..f81810a 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 /dts-v1/;
-/include/ "armada-370.dtsi"
+#include "armada-370.dtsi"
 
 / {
        model = "Marvell Armada 370 Reference Design";
        };
 
        soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+
+               pcie-controller {
+                       status = "okay";
+
+                       /* Internal mini-PCIe connector */
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+
+                       /* Internal mini-PCIe connector */
+                       pcie@2,0 {
+                               /* Port 1, Lane 0 */
+                               status = "okay";
+                       };
+               };
+
                internal-regs {
                        serial@12000 {
                                clock-frequency = <200000000>;
                                        gpios = <&gpio0 6 1>;
                                };
                        };
-
-                       pcie-controller {
-                               status = "okay";
-
-                               /* Internal mini-PCIe connector */
-                               pcie@1,0 {
-                                       /* Port 0, Lane 0 */
-                                       status = "okay";
-                               };
-
-                               /* Internal mini-PCIe connector */
-                               pcie@2,0 {
-                                       /* Port 1, Lane 0 */
-                                       status = "okay";
-                               };
-                       };
                };
        };
  };
index 90b1176..1de2dae 100644 (file)
@@ -18,6 +18,8 @@
 
 /include/ "skeleton64.dtsi"
 
+#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
+
 / {
        model = "Marvell Armada 370 and XP SoC";
        compatible = "marvell,armada-370-xp";
        };
 
        soc {
-               #address-cells = <1>;
+               #address-cells = <2>;
                #size-cells = <1>;
-               compatible = "simple-bus";
+               controller = <&mbusc>;
                interrupt-parent = <&mpic>;
-               ranges = <0          0 0xd0000000 0x0100000 /* internal registers */
-                         0xe0000000 0 0xe0000000 0x8100000 /* PCIe */>;
+               pcie-mem-aperture = <0xe0000000 0x8000000>;
+               pcie-io-aperture  = <0xe8000000 0x100000>;
+
+               devbus-bootcs {
+                       compatible = "marvell,mvebu-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10400 0x8>;
+                       ranges = <0 MBUS_ID(0x01, 0x2f) 0 0xffffffff>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&coreclk 0>;
+                       status = "disabled";
+               };
+
+               devbus-cs0 {
+                       compatible = "marvell,mvebu-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10408 0x8>;
+                       ranges = <0 MBUS_ID(0x01, 0x3e) 0 0xffffffff>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&coreclk 0>;
+                       status = "disabled";
+               };
+
+               devbus-cs1 {
+                       compatible = "marvell,mvebu-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10410 0x8>;
+                       ranges = <0 MBUS_ID(0x01, 0x3d) 0 0xffffffff>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&coreclk 0>;
+                       status = "disabled";
+               };
+
+               devbus-cs2 {
+                       compatible = "marvell,mvebu-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10418 0x8>;
+                       ranges = <0 MBUS_ID(0x01, 0x3b) 0 0xffffffff>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&coreclk 0>;
+                       status = "disabled";
+               };
+
+               devbus-cs3 {
+                       compatible = "marvell,mvebu-devbus";
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10420 0x8>;
+                       ranges = <0 MBUS_ID(0x01, 0x37) 0 0xffffffff>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&coreclk 0>;
+                       status = "disabled";
+               };
 
                internal-regs {
                        compatible = "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
-                       ranges;
+                       ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
+
+                       mbusc: mbus-controller@20000 {
+                               compatible = "marvell,mbus-controller";
+                               reg = <0x20000 0x100>, <0x20180 0x20>;
+                       };
 
                        mpic: interrupt-controller@20000 {
                                compatible = "marvell,mpic";
                        };
 
                        timer@20300 {
-                               compatible = "marvell,armada-370-xp-timer";
                                reg = <0x20300 0x30>, <0x21040 0x30>;
                                interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
-                               clocks = <&coreclk 2>;
                        };
 
                        sata@a0000 {
                                status = "disabled";
                        };
 
-                       devbus-bootcs@10400 {
-                               compatible = "marvell,mvebu-devbus";
-                               reg = <0x10400 0x8>;
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               clocks = <&coreclk 0>;
-                               status = "disabled";
-                       };
-
-                       devbus-cs0@10408 {
-                               compatible = "marvell,mvebu-devbus";
-                               reg = <0x10408 0x8>;
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               clocks = <&coreclk 0>;
-                               status = "disabled";
-                       };
-
-                       devbus-cs1@10410 {
-                               compatible = "marvell,mvebu-devbus";
-                               reg = <0x10410 0x8>;
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               clocks = <&coreclk 0>;
-                               status = "disabled";
-                       };
-
-                       devbus-cs2@10418 {
-                               compatible = "marvell,mvebu-devbus";
-                               reg = <0x10418 0x8>;
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               clocks = <&coreclk 0>;
-                               status = "disabled";
-                       };
-
-                       devbus-cs3@10420 {
-                               compatible = "marvell,mvebu-devbus";
-                               reg = <0x10420 0x8>;
-                               #address-cells = <1>;
-                               #size-cells = <1>;
-                               clocks = <&coreclk 0>;
-                               status = "disabled";
-                       };
                };
        };
  };
index fa3dfc6..e134d7a 100644 (file)
@@ -15,7 +15,7 @@
  * common to all Armada SoCs.
  */
 
-/include/ "armada-370-xp.dtsi"
+#include "armada-370-xp.dtsi"
 /include/ "skeleton.dtsi"
 
 / {
        };
 
        soc {
-               ranges = <0          0xd0000000 0x0100000 /* internal registers */
-                         0xe0000000 0xe0000000 0x8100000 /* PCIe */>;
+               compatible = "marvell,armada370-mbus", "simple-bus";
+
+               bootrom {
+                       compatible = "marvell,bootrom";
+                       reg = <MBUS_ID(0x01, 0xe0) 0 0x100000>;
+               };
+
+               pcie-controller {
+                       compatible = "marvell,armada-370-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
+                               0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000
+                               0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0       1 0 /* Port 0.0 MEM */
+                               0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0       1 0 /* Port 0.0 IO  */
+                               0x82000000 0x2 0     MBUS_ID(0x08, 0xe8) 0       1 0 /* Port 1.0 MEM */
+                               0x81000000 0x2 0     MBUS_ID(0x08, 0xe0) 0       1 0 /* Port 1.0 IO  */>;
+
+                       pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                                ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                          0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 58>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 5>;
+                               status = "disabled";
+                       };
+
+                       pcie@2,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
+                               reg = <0x1000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                                ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
+                                          0x81000000 0 0 0x81000000 0x2 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 62>;
+                               marvell,pcie-port = <1>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 9>;
+                               status = "disabled";
+                       };
+               };
+
                internal-regs {
                        system-controller@18200 {
                                compatible = "marvell,armada-370-xp-system-controller";
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <82>, <83>, <84>, <85>;
                        };
 
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <87>, <88>, <89>, <90>;
                        };
 
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <91>;
                        };
 
+                       timer@20300 {
+                               compatible = "marvell,armada-370-timer";
+                               clocks = <&coreclk 2>;
+                       };
+
                        coreclk: mvebu-sar@18230 {
                                compatible = "marvell,armada-370-core-clock";
                                reg = <0x18230 0x08>;
                                        0x18304 0x4>;
                                status = "okay";
                        };
-
-                       pcie-controller {
-                               compatible = "marvell,armada-370-pcie";
-                               status = "disabled";
-                               device_type = "pci";
-
-                               #address-cells = <3>;
-                               #size-cells = <2>;
-
-                               bus-range = <0x00 0xff>;
-
-                               ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000   /* Port 0.0 registers */
-                                       0x82000000 0 0x80000 0x80000 0 0x00002000   /* Port 1.0 registers */
-                                       0x82000000 0 0xe0000000 0xe0000000 0 0x08000000   /* non-prefetchable memory */
-                                       0x81000000 0 0          0xe8000000 0 0x00100000>; /* downstream I/O */
-
-                               pcie@1,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
-                                       reg = <0x0800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 58>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 5>;
-                                       status = "disabled";
-                               };
-
-                               pcie@2,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
-                                       reg = <0x1000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 62>;
-                                       marvell,pcie-port = <1>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 9>;
-                                       status = "disabled";
-                               };
-                       };
                };
        };
 };
diff --git a/arch/arm/boot/dts/armada-xp-axpwifiap.dts b/arch/arm/boot/dts/armada-xp-axpwifiap.dts
new file mode 100644 (file)
index 0000000..c5fe572
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Device Tree file for Marvell RD-AXPWiFiAP.
+ *
+ * Note: this board is shipped with a new generation boot loader that
+ * remaps internal registers at 0xf1000000. Therefore, if earlyprintk
+ * is used, the CONFIG_DEBUG_MVEBU_UART_ALTERNATE option should be
+ * used.
+ *
+ * Copyright (C) 2013 Marvell
+ *
+ * Thomas Petazzoni <thomas.petazzoni@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.
+ */
+
+/dts-v1/;
+#include "armada-xp-mv78230.dtsi"
+
+/ {
+       model = "Marvell RD-AXPWiFiAP";
+       compatible = "marvell,rd-axpwifiap", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
+
+       chosen {
+               bootargs = "console=ttyS0,115200 earlyprintk";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x00000000 0x00000000 0x40000000>; /* 1GB */
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+
+               pcie-controller {
+                       status = "okay";
+
+                       /* First mini-PCIe port */
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+
+                       /* Second mini-PCIe port */
+                       pcie@2,0 {
+                               /* Port 0, Lane 1 */
+                               status = "okay";
+                       };
+
+                       /* Renesas uPD720202 USB 3.0 controller */
+                       pcie@3,0 {
+                               /* Port 0, Lane 3 */
+                               status = "okay";
+                       };
+               };
+
+               internal-regs {
+                       pinctrl {
+                               pinctrl-0 = <&pmx_phy_int>;
+                               pinctrl-names = "default";
+
+                               pmx_ge0: pmx-ge0 {
+                                       marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
+                                                      "mpp4", "mpp5", "mpp6", "mpp7",
+                                                      "mpp8", "mpp9", "mpp10", "mpp11";
+                                       marvell,function = "ge0";
+                               };
+
+                               pmx_ge1: pmx-ge1 {
+                                       marvell,pins = "mpp12", "mpp13", "mpp14", "mpp15",
+                                                      "mpp16", "mpp17", "mpp18", "mpp19",
+                                                      "mpp20", "mpp21", "mpp22", "mpp23";
+                                       marvell,function = "ge1";
+                               };
+
+                               pmx_keys: pmx-keys {
+                                       marvell,pins = "mpp33";
+                                       marvell,function = "gpio";
+                               };
+
+                               pmx_spi: pmx-spi {
+                                       marvell,pins = "mpp36", "mpp37", "mpp38", "mpp39";
+                                       marvell,function = "spi";
+                               };
+
+                               pmx_phy_int: pmx-phy-int {
+                                       marvell,pins = "mpp32";
+                                       marvell,function = "gpio";
+                               };
+                       };
+
+                       serial@12000 {
+                               clock-frequency = <250000000>;
+                               status = "okay";
+                       };
+
+                       serial@12100 {
+                               clock-frequency = <250000000>;
+                               status = "okay";
+                       };
+
+                       sata@a0000 {
+                               nr-ports = <1>;
+                               status = "okay";
+                       };
+
+                       mdio {
+                               phy0: ethernet-phy@0 {
+                                       reg = <0>;
+                               };
+
+                               phy1: ethernet-phy@1 {
+                                       reg = <1>;
+                               };
+                       };
+
+                       ethernet@70000 {
+                               pinctrl-0 = <&pmx_ge0>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                               phy = <&phy0>;
+                               phy-mode = "rgmii-id";
+                       };
+                       ethernet@74000 {
+                               pinctrl-0 = <&pmx_ge1>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                               phy = <&phy1>;
+                               phy-mode = "rgmii-id";
+                       };
+
+                       spi0: spi@10600 {
+                               status = "okay";
+                               pinctrl-0 = <&pmx_spi>;
+                               pinctrl-names = "default";
+
+                               spi-flash@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+                                       compatible = "n25q128a13";
+                                       reg = <0>; /* Chip select 0 */
+                                       spi-max-frequency = <108000000>;
+                               };
+                       };
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-0 = <&pmx_keys>;
+               pinctrl-names = "default";
+
+               button@1 {
+                       label = "Factory Reset Button";
+                       linux,code = <141>; /* KEY_SETUP */
+                       gpios = <&gpio1 1 1>;
+               };
+       };
+};
index e28e68f..bcf6d79 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 /dts-v1/;
-/include/ "armada-xp-mv78460.dtsi"
+#include "armada-xp-mv78460.dtsi"
 
 / {
        model = "Marvell Armada XP Evaluation Board";
        };
 
        soc {
-               ranges = <0          0 0xd0000000 0x100000      /* Internal registers 1MiB */
-                         0xe0000000 0 0xe0000000 0x8100000     /* PCIe */
-                         0xf0000000 0 0xf0000000 0x1000000>;   /* Device Bus, NOR 16MiB   */
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
+
+               devbus-bootcs {
+                       status = "okay";
+
+                       /* Device Bus parameters are required */
+
+                       /* Read parameters */
+                       devbus,bus-width    = <8>;
+                       devbus,turn-off-ps  = <60000>;
+                       devbus,badr-skew-ps = <0>;
+                       devbus,acc-first-ps = <124000>;
+                       devbus,acc-next-ps  = <248000>;
+                       devbus,rd-setup-ps  = <0>;
+                       devbus,rd-hold-ps   = <0>;
+
+                       /* Write parameters */
+                       devbus,sync-enable = <0>;
+                       devbus,wr-high-ps  = <60000>;
+                       devbus,wr-low-ps   = <60000>;
+                       devbus,ale-wr-ps   = <60000>;
+
+                       /* NOR 16 MiB */
+                       nor@0 {
+                               compatible = "cfi-flash";
+                               reg = <0 0x1000000>;
+                               bank-width = <2>;
+                       };
+               };
+
+               pcie-controller {
+                       status = "okay";
+
+                       /*
+                        * All 6 slots are physically present as
+                        * standard PCIe slots on the board.
+                        */
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+                       pcie@2,0 {
+                               /* Port 0, Lane 1 */
+                               status = "okay";
+                       };
+                       pcie@3,0 {
+                               /* Port 0, Lane 2 */
+                               status = "okay";
+                       };
+                       pcie@4,0 {
+                               /* Port 0, Lane 3 */
+                               status = "okay";
+                       };
+                       pcie@9,0 {
+                               /* Port 2, Lane 0 */
+                               status = "okay";
+                       };
+                       pcie@10,0 {
+                               /* Port 3, Lane 0 */
+                               status = "okay";
+                       };
+               };
 
                internal-regs {
                        serial@12000 {
                                        spi-max-frequency = <20000000>;
                                };
                        };
-
-                       pcie-controller {
-                               status = "okay";
-
-                               /*
-                                * All 6 slots are physically present as
-                                * standard PCIe slots on the board.
-                                */
-                               pcie@1,0 {
-                                       /* Port 0, Lane 0 */
-                                       status = "okay";
-                               };
-                               pcie@2,0 {
-                                       /* Port 0, Lane 1 */
-                                       status = "okay";
-                               };
-                               pcie@3,0 {
-                                       /* Port 0, Lane 2 */
-                                       status = "okay";
-                               };
-                               pcie@4,0 {
-                                       /* Port 0, Lane 3 */
-                                       status = "okay";
-                               };
-                               pcie@9,0 {
-                                       /* Port 2, Lane 0 */
-                                       status = "okay";
-                               };
-                               pcie@10,0 {
-                                       /* Port 3, Lane 0 */
-                                       status = "okay";
-                               };
-                       };
-
-                       devbus-bootcs@10400 {
-                               status = "okay";
-                               ranges = <0 0xf0000000 0x1000000>;
-
-                               /* Device Bus parameters are required */
-
-                               /* Read parameters */
-                               devbus,bus-width    = <8>;
-                               devbus,turn-off-ps  = <60000>;
-                               devbus,badr-skew-ps = <0>;
-                               devbus,acc-first-ps = <124000>;
-                               devbus,acc-next-ps  = <248000>;
-                               devbus,rd-setup-ps  = <0>;
-                               devbus,rd-hold-ps   = <0>;
-
-                               /* Write parameters */
-                               devbus,sync-enable = <0>;
-                               devbus,wr-high-ps  = <60000>;
-                               devbus,wr-low-ps   = <60000>;
-                               devbus,ale-wr-ps   = <60000>;
-
-                               /* NOR 16 MiB */
-                               nor@0 {
-                                       compatible = "cfi-flash";
-                                       reg = <0 0x1000000>;
-                                       bank-width = <2>;
-                               };
-                       };
                };
        };
 };
index c87b2de..2298e4a 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 /dts-v1/;
-/include/ "armada-xp-mv78460.dtsi"
+#include "armada-xp-mv78460.dtsi"
 
 / {
        model = "Marvell Armada XP Development Board DB-MV784MP-GP";
        };
 
        soc {
-               ranges = <0          0 0xd0000000 0x100000  /* Internal registers 1MiB */
-                         0xe0000000 0 0xe0000000 0x8100000 /* PCIe */
-                         0xf0000000 0 0xf0000000 0x1000000 /* Device Bus, NOR 16MiB  */>;
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
+
+               devbus-bootcs {
+                       status = "okay";
+
+                       /* Device Bus parameters are required */
+
+                       /* Read parameters */
+                       devbus,bus-width    = <8>;
+                       devbus,turn-off-ps  = <60000>;
+                       devbus,badr-skew-ps = <0>;
+                       devbus,acc-first-ps = <124000>;
+                       devbus,acc-next-ps  = <248000>;
+                       devbus,rd-setup-ps  = <0>;
+                       devbus,rd-hold-ps   = <0>;
+
+                       /* Write parameters */
+                       devbus,sync-enable = <0>;
+                       devbus,wr-high-ps  = <60000>;
+                       devbus,wr-low-ps   = <60000>;
+                       devbus,ale-wr-ps   = <60000>;
+
+                       /* NOR 16 MiB */
+                       nor@0 {
+                               compatible = "cfi-flash";
+                               reg = <0 0x1000000>;
+                               bank-width = <2>;
+                       };
+               };
+
+               pcie-controller {
+                       status = "okay";
+
+                       /*
+                        * The 3 slots are physically present as
+                        * standard PCIe slots on the board.
+                        */
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+                       pcie@9,0 {
+                               /* Port 2, Lane 0 */
+                               status = "okay";
+                       };
+                       pcie@10,0 {
+                               /* Port 3, Lane 0 */
+                               status = "okay";
+                       };
+               };
 
                internal-regs {
                        serial@12000 {
                                        spi-max-frequency = <108000000>;
                                };
                        };
-
-                       devbus-bootcs@10400 {
-                               status = "okay";
-                               ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf000000, size 0x1000000 */
-
-                               /* Device Bus parameters are required */
-
-                               /* Read parameters */
-                               devbus,bus-width    = <8>;
-                               devbus,turn-off-ps  = <60000>;
-                               devbus,badr-skew-ps = <0>;
-                               devbus,acc-first-ps = <124000>;
-                               devbus,acc-next-ps  = <248000>;
-                               devbus,rd-setup-ps  = <0>;
-                               devbus,rd-hold-ps   = <0>;
-
-                               /* Write parameters */
-                               devbus,sync-enable = <0>;
-                               devbus,wr-high-ps  = <60000>;
-                               devbus,wr-low-ps   = <60000>;
-                               devbus,ale-wr-ps   = <60000>;
-
-                               /* NOR 16 MiB */
-                               nor@0 {
-                                       compatible = "cfi-flash";
-                                       reg = <0 0x1000000>;
-                                       bank-width = <2>;
-                               };
-                       };
-
-                       pcie-controller {
-                               status = "okay";
-
-                               /*
-                                * The 3 slots are physically present as
-                                * standard PCIe slots on the board.
-                                */
-                               pcie@1,0 {
-                                       /* Port 0, Lane 0 */
-                                       status = "okay";
-                               };
-                               pcie@9,0 {
-                                       /* Port 2, Lane 0 */
-                                       status = "okay";
-                               };
-                               pcie@10,0 {
-                                       /* Port 3, Lane 0 */
-                                       status = "okay";
-                               };
-                       };
                };
        };
 };
index f8eaa38..0358a33 100644 (file)
@@ -13,7 +13,7 @@
  * common to all Armada XP SoCs.
  */
 
-/include/ "armada-xp.dtsi"
+#include "armada-xp.dtsi"
 
 / {
        model = "Marvell Armada XP MV78230 SoC";
        };
 
        soc {
+               /*
+                * MV78230 has 2 PCIe units Gen2.0: One unit can be
+                * configured as x4 or quad x1 lanes. One unit is
+                * x4/x1.
+                */
+               pcie-controller {
+                       compatible = "marvell,armada-xp-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000   /* Port 0.0 registers */
+                               0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000   /* Port 2.0 registers */
+                               0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000   /* Port 0.1 registers */
+                               0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000   /* Port 0.2 registers */
+                               0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000   /* Port 0.3 registers */
+                               0x82000000 0x1 0       MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
+                               0x81000000 0x1 0       MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO  */
+                               0x82000000 0x2 0       MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
+                               0x81000000 0x2 0       MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO  */
+                               0x82000000 0x3 0       MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
+                               0x81000000 0x3 0       MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO  */
+                               0x82000000 0x4 0       MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
+                               0x81000000 0x4 0       MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO  */
+                               0x82000000 0x9 0       MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */
+                               0x81000000 0x9 0       MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO  */>;
+
+                       pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 58>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 5>;
+                               status = "disabled";
+                       };
+
+                       pcie@2,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
+                               reg = <0x1000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
+                                         0x81000000 0 0 0x81000000 0x2 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 59>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <1>;
+                               clocks = <&gateclk 6>;
+                               status = "disabled";
+                       };
+
+                       pcie@3,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
+                               reg = <0x1800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
+                                         0x81000000 0 0 0x81000000 0x3 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 60>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <2>;
+                               clocks = <&gateclk 7>;
+                               status = "disabled";
+                       };
+
+                       pcie@4,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
+                               reg = <0x2000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
+                                         0x81000000 0 0 0x81000000 0x4 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 61>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <3>;
+                               clocks = <&gateclk 8>;
+                               status = "disabled";
+                       };
+
+                       pcie@9,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
+                               reg = <0x4800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
+                                         0x81000000 0 0 0x81000000 0x9 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 99>;
+                               marvell,pcie-port = <2>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 26>;
+                               status = "disabled";
+                       };
+               };
+
                internal-regs {
                        pinctrl {
                                compatible = "marvell,mv78230-pinctrl";
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <82>, <83>, <84>, <85>;
                        };
 
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <87>, <88>, <89>;
                        };
-
-                       /*
-                        * MV78230 has 2 PCIe units Gen2.0: One unit can be
-                        * configured as x4 or quad x1 lanes. One unit is
-                        * x4/x1.
-                        */
-                       pcie-controller {
-                               compatible = "marvell,armada-xp-pcie";
-                               status = "disabled";
-                               device_type = "pci";
-
-#address-cells = <3>;
-#size-cells = <2>;
-
-                               bus-range = <0x00 0xff>;
-
-                               ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000   /* Port 0.0 registers */
-                                       0x82000000 0 0x42000 0x42000 0 0x00002000   /* Port 2.0 registers */
-                                       0x82000000 0 0x44000 0x44000 0 0x00002000   /* Port 0.1 registers */
-                                       0x82000000 0 0x48000 0x48000 0 0x00002000   /* Port 0.2 registers */
-                                       0x82000000 0 0x4c000 0x4c000 0 0x00002000   /* Port 0.3 registers */
-                                       0x82000000 0 0xe0000000 0xe0000000 0 0x08000000   /* non-prefetchable memory */
-                                       0x81000000 0 0    0xe8000000 0 0x00100000>; /* downstream I/O */
-
-                               pcie@1,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
-                                       reg = <0x0800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 58>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 5>;
-                                       status = "disabled";
-                               };
-
-                               pcie@2,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
-                                       reg = <0x1000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 59>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <1>;
-                                       clocks = <&gateclk 6>;
-                                       status = "disabled";
-                               };
-
-                               pcie@3,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
-                                       reg = <0x1800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 60>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <2>;
-                                       clocks = <&gateclk 7>;
-                                       status = "disabled";
-                               };
-
-                               pcie@4,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
-                                       reg = <0x2000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 61>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <3>;
-                                       clocks = <&gateclk 8>;
-                                       status = "disabled";
-                               };
-
-                               pcie@9,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
-                                       reg = <0x4800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 99>;
-                                       marvell,pcie-port = <2>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 26>;
-                                       status = "disabled";
-                               };
-                       };
                };
        };
 };
index 2d9335d..0e82c50 100644 (file)
@@ -13,7 +13,7 @@
  * common to all Armada XP SoCs.
  */
 
-/include/ "armada-xp.dtsi"
+#include "armada-xp.dtsi"
 
 / {
        model = "Marvell Armada XP MV78260 SoC";
        };
 
        soc {
+               /*
+                * MV78260 has 3 PCIe units Gen2.0: Two units can be
+                * configured as x4 or quad x1 lanes. One unit is
+                * x4/x1.
+                */
+               pcie-controller {
+                       compatible = "marvell,armada-xp-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000   /* Port 0.0 registers */
+                               0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000   /* Port 2.0 registers */
+                               0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000   /* Port 0.1 registers */
+                               0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000   /* Port 0.2 registers */
+                               0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000   /* Port 0.3 registers */
+                               0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000   /* Port 1.0 registers */
+                               0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000   /* Port 3.0 registers */
+                               0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
+                               0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO  */
+                               0x82000000 0x2 0     MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
+                               0x81000000 0x2 0     MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO  */
+                               0x82000000 0x3 0     MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
+                               0x81000000 0x3 0     MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO  */
+                               0x82000000 0x4 0     MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
+                               0x81000000 0x4 0     MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO  */
+                               0x82000000 0x9 0     MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
+                               0x81000000 0x9 0     MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO  */
+                               0x82000000 0xa 0     MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */
+                               0x81000000 0xa 0     MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO  */>;
+
+                       pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 58>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 5>;
+                               status = "disabled";
+                       };
+
+                       pcie@2,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
+                               reg = <0x1000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                                ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
+                                          0x81000000 0 0 0x81000000 0x2 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 59>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <1>;
+                               clocks = <&gateclk 6>;
+                               status = "disabled";
+                       };
+
+                       pcie@3,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
+                               reg = <0x1800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
+                                         0x81000000 0 0 0x81000000 0x3 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 60>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <2>;
+                               clocks = <&gateclk 7>;
+                               status = "disabled";
+                       };
+
+                       pcie@4,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
+                               reg = <0x2000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
+                                         0x81000000 0 0 0x81000000 0x4 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 61>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <3>;
+                               clocks = <&gateclk 8>;
+                               status = "disabled";
+                       };
+
+                       pcie@9,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
+                               reg = <0x4800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
+                                         0x81000000 0 0 0x81000000 0x9 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 99>;
+                               marvell,pcie-port = <2>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 26>;
+                               status = "disabled";
+                       };
+
+                       pcie@10,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x82000 0 0x2000>;
+                               reg = <0x5000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0
+                                         0x81000000 0 0 0x81000000 0xa 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 103>;
+                               marvell,pcie-port = <3>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 27>;
+                               status = "disabled";
+                       };
+               };
+
                internal-regs {
                        pinctrl {
                                compatible = "marvell,mv78260-pinctrl";
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <82>, <83>, <84>, <85>;
                        };
 
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <87>, <88>, <89>, <90>;
                        };
 
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <91>;
                        };
 
                                clocks = <&gateclk 1>;
                                status = "disabled";
                        };
-
-                       /*
-                        * MV78260 has 3 PCIe units Gen2.0: Two units can be
-                        * configured as x4 or quad x1 lanes. One unit is
-                        * x4/x1.
-                        */
-                       pcie-controller {
-                               compatible = "marvell,armada-xp-pcie";
-                               status = "disabled";
-                               device_type = "pci";
-
-                               #address-cells = <3>;
-                               #size-cells = <2>;
-
-                               bus-range = <0x00 0xff>;
-
-                               ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000   /* Port 0.0 registers */
-                                       0x82000000 0 0x42000 0x42000 0 0x00002000   /* Port 2.0 registers */
-                                       0x82000000 0 0x44000 0x44000 0 0x00002000   /* Port 0.1 registers */
-                                       0x82000000 0 0x48000 0x48000 0 0x00002000   /* Port 0.2 registers */
-                                       0x82000000 0 0x4c000 0x4c000 0 0x00002000   /* Port 0.3 registers */
-                                       0x82000000 0 0x80000 0x80000 0 0x00002000   /* Port 1.0 registers */
-                                       0x82000000 0 0x82000 0x82000 0 0x00002000   /* Port 3.0 registers */
-                                       0x82000000 0 0xe0000000 0xe0000000 0 0x08000000   /* non-prefetchable memory */
-                                       0x81000000 0 0    0xe8000000 0 0x00100000>; /* downstream I/O */
-
-                               pcie@1,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
-                                       reg = <0x0800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 58>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 5>;
-                                       status = "disabled";
-                               };
-
-                               pcie@2,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
-                                       reg = <0x1000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 59>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <1>;
-                                       clocks = <&gateclk 6>;
-                                       status = "disabled";
-                               };
-
-                               pcie@3,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
-                                       reg = <0x1800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 60>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <2>;
-                                       clocks = <&gateclk 7>;
-                                       status = "disabled";
-                               };
-
-                               pcie@4,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
-                                       reg = <0x2000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 61>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <3>;
-                                       clocks = <&gateclk 8>;
-                                       status = "disabled";
-                               };
-
-                               pcie@9,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
-                                       reg = <0x4800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 99>;
-                                       marvell,pcie-port = <2>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 26>;
-                                       status = "disabled";
-                               };
-
-                               pcie@10,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x82000 0 0x2000>;
-                                       reg = <0x5000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 103>;
-                                       marvell,pcie-port = <3>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 27>;
-                                       status = "disabled";
-                               };
-                       };
                };
        };
 };
index c7b1f4d..e82c1b8 100644 (file)
@@ -13,7 +13,7 @@
  * common to all Armada XP SoCs.
  */
 
-/include/ "armada-xp.dtsi"
+#include "armada-xp.dtsi"
 
 / {
        model = "Marvell Armada XP MV78460 SoC";
        };
 
        soc {
+               /*
+                * MV78460 has 4 PCIe units Gen2.0: Two units can be
+                * configured as x4 or quad x1 lanes. Two units are
+                * x4/x1.
+                */
+               pcie-controller {
+                       compatible = "marvell,armada-xp-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000   /* Port 0.0 registers */
+                               0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000   /* Port 2.0 registers */
+                               0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000   /* Port 0.1 registers */
+                               0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000   /* Port 0.2 registers */
+                               0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000   /* Port 0.3 registers */
+                               0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000   /* Port 1.0 registers */
+                               0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000   /* Port 3.0 registers */
+                               0x82000000 0 0x84000 MBUS_ID(0xf0, 0x01) 0x84000 0 0x00002000   /* Port 1.1 registers */
+                               0x82000000 0 0x88000 MBUS_ID(0xf0, 0x01) 0x88000 0 0x00002000   /* Port 1.2 registers */
+                               0x82000000 0 0x8c000 MBUS_ID(0xf0, 0x01) 0x8c000 0 0x00002000   /* Port 1.3 registers */
+                               0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
+                               0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO  */
+                               0x82000000 0x2 0     MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
+                               0x81000000 0x2 0     MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO  */
+                               0x82000000 0x3 0     MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
+                               0x81000000 0x3 0     MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO  */
+                               0x82000000 0x4 0     MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
+                               0x81000000 0x4 0     MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO  */
+
+                               0x82000000 0x5 0     MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
+                               0x81000000 0x5 0     MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO  */
+                               0x82000000 0x6 0     MBUS_ID(0x08, 0xd8) 0 1 0 /* Port 1.1 MEM */
+                               0x81000000 0x6 0     MBUS_ID(0x08, 0xd0) 0 1 0 /* Port 1.1 IO  */
+                               0x82000000 0x7 0     MBUS_ID(0x08, 0xb8) 0 1 0 /* Port 1.2 MEM */
+                               0x81000000 0x7 0     MBUS_ID(0x08, 0xb0) 0 1 0 /* Port 1.2 IO  */
+                               0x82000000 0x8 0     MBUS_ID(0x08, 0x78) 0 1 0 /* Port 1.3 MEM */
+                               0x81000000 0x8 0     MBUS_ID(0x08, 0x70) 0 1 0 /* Port 1.3 IO  */
+
+                               0x82000000 0x9 0     MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */
+                               0x81000000 0x9 0     MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO  */
+
+                               0x82000000 0xa 0     MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */
+                               0x81000000 0xa 0     MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO  */>;
+
+                       pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 58>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 5>;
+                               status = "disabled";
+                       };
+
+                       pcie@2,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
+                               reg = <0x1000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
+                                         0x81000000 0 0 0x81000000 0x2 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 59>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <1>;
+                               clocks = <&gateclk 6>;
+                               status = "disabled";
+                       };
+
+                       pcie@3,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
+                               reg = <0x1800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
+                                         0x81000000 0 0 0x81000000 0x3 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 60>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <2>;
+                               clocks = <&gateclk 7>;
+                               status = "disabled";
+                       };
+
+                       pcie@4,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
+                               reg = <0x2000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
+                                         0x81000000 0 0 0x81000000 0x4 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 61>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <3>;
+                               clocks = <&gateclk 8>;
+                               status = "disabled";
+                       };
+
+                       pcie@5,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
+                               reg = <0x2800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0
+                                         0x81000000 0 0 0x81000000 0x5 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 62>;
+                               marvell,pcie-port = <1>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 9>;
+                               status = "disabled";
+                       };
+
+                       pcie@6,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
+                               reg = <0x3000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0
+                                         0x81000000 0 0 0x81000000 0x6 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 63>;
+                               marvell,pcie-port = <1>;
+                               marvell,pcie-lane = <1>;
+                               clocks = <&gateclk 10>;
+                               status = "disabled";
+                       };
+
+                       pcie@7,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
+                               reg = <0x3800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0
+                                         0x81000000 0 0 0x81000000 0x7 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 64>;
+                               marvell,pcie-port = <1>;
+                               marvell,pcie-lane = <2>;
+                               clocks = <&gateclk 11>;
+                               status = "disabled";
+                       };
+
+                       pcie@8,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
+                               reg = <0x4000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0
+                                         0x81000000 0 0 0x81000000 0x8 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 65>;
+                               marvell,pcie-port = <1>;
+                               marvell,pcie-lane = <3>;
+                               clocks = <&gateclk 12>;
+                               status = "disabled";
+                       };
+
+                       pcie@9,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
+                               reg = <0x4800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
+                                         0x81000000 0 0 0x81000000 0x9 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 99>;
+                               marvell,pcie-port = <2>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 26>;
+                               status = "disabled";
+                       };
+
+                       pcie@10,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82005000 0 0x82000 0 0x2000>;
+                               reg = <0x5000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0
+                                         0x81000000 0 0 0x81000000 0xa 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 103>;
+                               marvell,pcie-port = <3>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 27>;
+                               status = "disabled";
+                       };
+               };
+
                internal-regs {
                        pinctrl {
                                compatible = "marvell,mv78460-pinctrl";
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <82>, <83>, <84>, <85>;
                        };
 
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <87>, <88>, <89>, <90>;
                        };
 
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
-                               #interrupts-cells = <2>;
+                               #interrupt-cells = <2>;
                                interrupts = <91>;
                        };
 
                                clocks = <&gateclk 1>;
                                status = "disabled";
                        };
-
-                       /*
-                        * MV78460 has 4 PCIe units Gen2.0: Two units can be
-                        * configured as x4 or quad x1 lanes. Two units are
-                        * x4/x1.
-                        */
-                       pcie-controller {
-                               compatible = "marvell,armada-xp-pcie";
-                               status = "disabled";
-                               device_type = "pci";
-
-                               #address-cells = <3>;
-                               #size-cells = <2>;
-
-                               bus-range = <0x00 0xff>;
-
-                               ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000   /* Port 0.0 registers */
-                                       0x82000000 0 0x42000 0x42000 0 0x00002000   /* Port 2.0 registers */
-                                       0x82000000 0 0x44000 0x44000 0 0x00002000   /* Port 0.1 registers */
-                                       0x82000000 0 0x48000 0x48000 0 0x00002000   /* Port 0.2 registers */
-                                       0x82000000 0 0x4c000 0x4c000 0 0x00002000   /* Port 0.3 registers */
-                                       0x82000000 0 0x80000 0x80000 0 0x00002000   /* Port 1.0 registers */
-                                       0x82000000 0 0x82000 0x82000 0 0x00002000   /* Port 3.0 registers */
-                                       0x82000000 0 0x84000 0x84000 0 0x00002000   /* Port 1.1 registers */
-                                       0x82000000 0 0x88000 0x88000 0 0x00002000   /* Port 1.2 registers */
-                                       0x82000000 0 0x8c000 0x8c000 0 0x00002000   /* Port 1.3 registers */
-                                       0x82000000 0 0xe0000000 0xe0000000 0 0x08000000   /* non-prefetchable memory */
-                                       0x81000000 0 0    0xe8000000 0 0x00100000>; /* downstream I/O */
-
-                               pcie@1,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
-                                       reg = <0x0800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 58>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 5>;
-                                       status = "disabled";
-                               };
-
-                               pcie@2,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
-                                       reg = <0x1000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 59>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <1>;
-                                       clocks = <&gateclk 6>;
-                                       status = "disabled";
-                               };
-
-                               pcie@3,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
-                                       reg = <0x1800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 60>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <2>;
-                                       clocks = <&gateclk 7>;
-                                       status = "disabled";
-                               };
-
-                               pcie@4,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
-                                       reg = <0x2000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 61>;
-                                       marvell,pcie-port = <0>;
-                                       marvell,pcie-lane = <3>;
-                                       clocks = <&gateclk 8>;
-                                       status = "disabled";
-                               };
-
-                               pcie@5,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
-                                       reg = <0x2800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 62>;
-                                       marvell,pcie-port = <1>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 9>;
-                                       status = "disabled";
-                               };
-
-                               pcie@6,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
-                                       reg = <0x3000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 63>;
-                                       marvell,pcie-port = <1>;
-                                       marvell,pcie-lane = <1>;
-                                       clocks = <&gateclk 10>;
-                                       status = "disabled";
-                               };
-
-                               pcie@7,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
-                                       reg = <0x3800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 64>;
-                                       marvell,pcie-port = <1>;
-                                       marvell,pcie-lane = <2>;
-                                       clocks = <&gateclk 11>;
-                                       status = "disabled";
-                               };
-
-                               pcie@8,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
-                                       reg = <0x4000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 65>;
-                                       marvell,pcie-port = <1>;
-                                       marvell,pcie-lane = <3>;
-                                       clocks = <&gateclk 12>;
-                                       status = "disabled";
-                               };
-                               pcie@9,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
-                                       reg = <0x4800 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 99>;
-                                       marvell,pcie-port = <2>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 26>;
-                                       status = "disabled";
-                               };
-
-                               pcie@10,0 {
-                                       device_type = "pci";
-                                       assigned-addresses = <0x82005000 0 0x82000 0 0x2000>;
-                                       reg = <0x5000 0 0 0 0>;
-                                       #address-cells = <3>;
-                                       #size-cells = <2>;
-                                       #interrupt-cells = <1>;
-                                       ranges;
-                                       interrupt-map-mask = <0 0 0 0>;
-                                       interrupt-map = <0 0 0 0 &mpic 103>;
-                                       marvell,pcie-port = <3>;
-                                       marvell,pcie-lane = <0>;
-                                       clocks = <&gateclk 27>;
-                                       status = "disabled";
-                               };
-                       };
                };
        };
 };
index 8f51045..5695afc 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 /dts-v1/;
-/include/ "armada-xp-mv78260.dtsi"
+#include "armada-xp-mv78260.dtsi"
 
 / {
        model = "PlatHome OpenBlocks AX3-4 board";
        };
 
        soc {
-               ranges = <0          0 0xd0000000 0x100000      /* Internal registers 1MiB */
-                         0xe0000000 0 0xe0000000 0x8100000     /* PCIe */
-                         0xf0000000 0 0xf0000000 0x8000000     /* Device Bus, NOR 128MiB   */>;
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x8000000>;
+
+               devbus-bootcs {
+                       status = "okay";
+
+                       /* Device Bus parameters are required */
+
+                       /* Read parameters */
+                       devbus,bus-width    = <8>;
+                       devbus,turn-off-ps  = <60000>;
+                       devbus,badr-skew-ps = <0>;
+                       devbus,acc-first-ps = <124000>;
+                       devbus,acc-next-ps  = <248000>;
+                       devbus,rd-setup-ps  = <0>;
+                       devbus,rd-hold-ps   = <0>;
+
+                       /* Write parameters */
+                       devbus,sync-enable = <0>;
+                       devbus,wr-high-ps  = <60000>;
+                       devbus,wr-low-ps   = <60000>;
+                       devbus,ale-wr-ps   = <60000>;
+
+                       /* NOR 128 MiB */
+                       nor@0 {
+                               compatible = "cfi-flash";
+                               reg = <0 0x8000000>;
+                               bank-width = <2>;
+                       };
+               };
+
+               pcie-controller {
+                       status = "okay";
+                       /* Internal mini-PCIe connector */
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+               };
 
                internal-regs {
                        serial@12000 {
                        usb@51000 {
                                status = "okay";
                        };
-
-                       /* USB interface in the mini-PCIe connector */
-                       usb@52000 {
-                               status = "okay";
-                       };
-
-                       devbus-bootcs@10400 {
-                               status = "okay";
-                               ranges = <0 0xf0000000 0x8000000>; /* @addr 0xf000000, size 0x8000000 */
-
-                               /* Device Bus parameters are required */
-
-                               /* Read parameters */
-                               devbus,bus-width    = <8>;
-                               devbus,turn-off-ps  = <60000>;
-                               devbus,badr-skew-ps = <0>;
-                               devbus,acc-first-ps = <124000>;
-                               devbus,acc-next-ps  = <248000>;
-                               devbus,rd-setup-ps  = <0>;
-                               devbus,rd-hold-ps   = <0>;
-
-                               /* Write parameters */
-                               devbus,sync-enable = <0>;
-                               devbus,wr-high-ps  = <60000>;
-                               devbus,wr-low-ps   = <60000>;
-                               devbus,ale-wr-ps   = <60000>;
-
-                               /* NOR 128 MiB */
-                               nor@0 {
-                                       compatible = "cfi-flash";
-                                       reg = <0 0x8000000>;
-                                       bank-width = <2>;
-                               };
-                       };
-
-                       pcie-controller {
-                               status = "okay";
-                               /* Internal mini-PCIe connector */
-                               pcie@1,0 {
-                                       /* Port 0, Lane 0 */
-                                       status = "okay";
-                               };
-                       };
                };
        };
 };
index 416eb94..def125c 100644 (file)
@@ -16,7 +16,7 @@
  * common to all Armada SoCs.
  */
 
-/include/ "armada-370-xp.dtsi"
+#include "armada-370-xp.dtsi"
 
 / {
        model = "Marvell Armada XP family SoC";
        };
 
        soc {
+               compatible = "marvell,armadaxp-mbus", "simple-bus";
+
+               bootrom {
+                       compatible = "marvell,bootrom";
+                       reg = <MBUS_ID(0x01, 0x1d) 0 0x100000>;
+               };
+
                internal-regs {
                        L2: l2-cache {
                                compatible = "marvell,aurora-system-cache";
@@ -62,7 +69,7 @@
                        };
 
                        timer@20300 {
-                               marvell,timer-25Mhz;
+                               compatible = "marvell,armada-xp-timer";
                        };
 
                        coreclk: mvebu-sar@18230 {
index 92b9e21..f770655 100644 (file)
                                interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
                                #address-cells = <1>;
                                #size-cells = <0>;
+                               pinctrl-names = "default";
                                status = "disabled";
                        };
 
diff --git a/arch/arm/boot/dts/at91rm9200_pqfp.dtsi b/arch/arm/boot/dts/at91rm9200_pqfp.dtsi
new file mode 100644 (file)
index 0000000..93ca66f
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * at91rm9200_pqfp.dtsi - Device Tree Include file for AT91RM9200 PQFP family SoC
+ *
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include "at91rm9200.dtsi"
+
+/ {
+       compatible = "atmel,at91rm9200-pqfp", "atmel,at91rm9200";
+};
+
+&pioD {
+       status = "disabled";
+};
index c7ccbcb..56ee828 100644 (file)
                                interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>;
                                #address-cells = <1>;
                                #size-cells = <0>;
+                               pinctrl-names = "default";
                                status = "disabled";
                        };
 
index bb7f564..9fb7ffd 100644 (file)
                                        };
                                };
 
+                               i2c0 {
+                                       pinctrl_i2c0: i2c0-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_NONE
+                                                        AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
+                               i2c1 {
+                                       pinctrl_i2c1: i2c1-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 0 AT91_PERIPH_C AT91_PINCTRL_NONE
+                                                        AT91_PIOC 1 AT91_PERIPH_C AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                tcb0 {
                                        pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
                                                atmel,pins = <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_NONE>;
                                dma-names = "tx", "rx";
                                #address-cells = <1>;
                                #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_i2c0>;
                                status = "disabled";
                        };
 
                                dma-names = "tx", "rx";
                                #address-cells = <1>;
                                #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_i2c1>;
                                status = "disabled";
                        };
 
index 3d77dbe..27a9352 100644 (file)
 
                        i2c0: i2c@f8010000 {
                                status = "okay";
+
+                               qt1070: keyboard@1b {
+                                       compatible = "qt1070";
+                                       reg = <0x1b>;
+                                       interrupt-parent = <&pioA>;
+                                       interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
+                                       pinctrl-names = "default";
+                                       pinctrl-0 = <&pinctrl_qt1070_irq>;
+                               };
                        };
 
                        i2c1: i2c@f8014000 {
                                                        <AT91_PIOA 7 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;   /* PA7 gpio CD pin pull up and deglitch */
                                        };
                                };
+
+                               qt1070 {
+                                       pinctrl_qt1070_irq: qt1070_irq {
+                                               atmel,pins =
+                                                       <AT91_PIOA 2 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
+                                       };
+                               };
                        };
 
                        spi0: spi@f0000000 {
 
                enter {
                        label = "Enter";
-                       gpios = <&pioB 4 GPIO_ACTIVE_LOW>;
+                       gpios = <&pioB 3 GPIO_ACTIVE_LOW>;
                        linux,code = <28>;
                        gpio-key,wakeup;
                };
index 57d45f5..cf78ac0 100644 (file)
                                compatible = "atmel,at91sam9g45-ssc";
                                reg = <0xf0010000 0x4000>;
                                interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+                               dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(13)>,
+                                      <&dma0 1 AT91_DMA_CFG_PER_ID(14)>;
+                               dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
                                status = "disabled";
index 49e3c45..3a9f6fa 100644 (file)
 
                        i2c0: i2c@f8010000 {
                                status = "okay";
+
+                               wm8731: wm8731@1a {
+                                       compatible = "wm8731";
+                                       reg = <0x1a>;
+                               };
                        };
 
                        pinctrl@fffff400 {
                        watchdog@fffffe40 {
                                status = "okay";
                        };
+
+                       ssc0: ssc@f0010000 {
+                               status = "okay";
+                       };
                };
 
                usb0: ohci@00600000 {
                        status = "okay";
                };
        };
+
+       sound {
+               compatible = "atmel,sam9x5-wm8731-audio";
+
+               atmel,model = "wm8731 @ AT91SAM9X5EK";
+
+               atmel,audio-routing =
+                       "Headphone Jack", "RHPOUT",
+                       "Headphone Jack", "LHPOUT",
+                       "LLINEIN", "Line In Jack",
+                       "RLINEIN", "Line In Jack";
+
+               atmel,ssc-controller = <&ssc0>;
+               atmel,audio-codec = <&wm8731>;
+       };
 };
index 67ec524..9d36eb4 100644 (file)
@@ -17,7 +17,7 @@
 
 / {
        model = "BCM11351 BRT board";
-       compatible = "bcm,bcm11351-brt", "bcm,bcm11351";
+       compatible = "brcm,bcm11351-brt", "brcm,bcm11351";
 
        memory {
                reg = <0x80000000 0x40000000>; /* 1 GB */
                status = "okay";
        };
 
-       sdio0: sdio@0x3f180000 {
+       sdio1: sdio@3f180000 {
                max-frequency = <48000000>;
                status = "okay";
        };
 
-       sdio1: sdio@0x3f190000 {
+       sdio2: sdio@3f190000 {
                non-removable;
                max-frequency = <48000000>;
                status = "okay";
        };
 
-       sdio3: sdio@0x3f1b0000 {
+       sdio4: sdio@3f1b0000 {
                max-frequency = <48000000>;
                status = "okay";
        };
index c0cdf66..05a5aab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Broadcom Corporation
+ * Copyright (C) 2012-2013 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
@@ -18,7 +18,7 @@
 
 / {
        model = "BCM11351 SoC";
-       compatible = "bcm,bcm11351";
+       compatible = "brcm,bcm11351";
        interrupt-parent = <&gic>;
 
        chosen {
        };
 
        smc@0x3404c000 {
-               compatible = "bcm,bcm11351-smc", "bcm,kona-smc";
+               compatible = "brcm,bcm11351-smc", "brcm,kona-smc";
                reg = <0x3404c000 0x400>; /* 1 KiB in SRAM */
        };
 
        uart@3e000000 {
-               compatible = "bcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
+               compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
                status = "disabled";
                reg = <0x3e000000 0x1000>;
                clock-frequency = <13000000>;
        };
 
        L2: l2-cache {
-               compatible = "bcm,bcm11351-a2-pl310-cache";
+               compatible = "brcm,bcm11351-a2-pl310-cache";
                reg = <0x3ff20000 0x1000>;
                cache-unified;
                cache-level = <2>;
        };
 
+       watchdog@35002f40 {
+               compatible = "brcm,bcm11351-wdt", "brcm,kona-wdt";
+               reg = <0x35002f40 0x6c>;
+       };
+
        timer@35006000 {
-               compatible = "bcm,kona-timer";
+               compatible = "brcm,kona-timer";
                reg = <0x35006000 0x1000>;
                interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
                clock-frequency = <32768>;
        };
 
-       sdio0: sdio@0x3f180000 {
-               compatible = "bcm,kona-sdhci";
+       sdio1: sdio@3f180000 {
+               compatible = "brcm,kona-sdhci";
                reg = <0x3f180000 0x10000>;
                interrupts = <0x0 77 0x4>;
                status = "disabled";
        };
 
-       sdio1: sdio@0x3f190000 {
-               compatible = "bcm,kona-sdhci";
+       sdio2: sdio@3f190000 {
+               compatible = "brcm,kona-sdhci";
                reg = <0x3f190000 0x10000>;
                interrupts = <0x0 76 0x4>;
                status = "disabled";
        };
 
-       sdio2: sdio@0x3f1a0000 {
-               compatible = "bcm,kona-sdhci";
+       sdio3: sdio@3f1a0000 {
+               compatible = "brcm,kona-sdhci";
                reg = <0x3f1a0000 0x10000>;
                interrupts = <0x0 74 0x4>;
                status = "disabled";
        };
 
-       sdio3: sdio@0x3f1b0000 {
-               compatible = "bcm,kona-sdhci";
+       sdio4: sdio@3f1b0000 {
+               compatible = "brcm,kona-sdhci";
                reg = <0x3f1b0000 0x10000>;
                interrupts = <0x0 73 0x4>;
                status = "disabled";
diff --git a/arch/arm/boot/dts/bcm28155-ap.dts b/arch/arm/boot/dts/bcm28155-ap.dts
new file mode 100644 (file)
index 0000000..96ae67a
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+/dts-v1/;
+
+#include "bcm11351.dtsi"
+
+/ {
+       model = "BCM28155 AP board";
+       compatible = "brcm,bcm28155-ap", "brcm,bcm11351";
+
+       memory {
+               reg = <0x80000000 0x40000000>; /* 1 GB */
+       };
+
+       uart@3e000000 {
+               status = "okay";
+       };
+
+       sdio1: sdio@3f180000 {
+               max-frequency = <48000000>;
+               status = "okay";
+       };
+
+       sdio2: sdio@3f190000 {
+               non-removable;
+               max-frequency = <48000000>;
+               status = "okay";
+       };
+
+       sdio4: sdio@3f1b0000 {
+               max-frequency = <48000000>;
+               status = "okay";
+       };
+};
diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
deleted file mode 100644 (file)
index 48ff034..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2013 ST-Ericsson AB
- *
- * 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
- */
-
-/dts-v1/;
-#include "dbx5x0.dtsi"
-
-/ {
-       model = "ST-Ericsson U8540 platform with Device Tree";
-       compatible = "st-ericsson,ccu8540", "st-ericsson,u8540";
-
-       memory@0 {
-               reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>;
-       };
-
-       soc {
-               prcmu@80157000 {
-                       reg = <0x80157000 0x2000>, <0x801b0000 0x8000>, <0x801b8000 0x3000>;
-                       reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm";
-               };
-
-               uart@80120000 {
-                       status = "okay";
-               };
-
-               uart@80121000 {
-                       status = "okay";
-               };
-
-               uart@80007000 {
-                       status = "okay";
-               };
-       };
-};
index 5bce7cc..588ce58 100644 (file)
                                };
                        };
                };
+               mdio: mdio@1e24000 {
+                       status = "okay";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mdio_pins>;
+                       bus_freq = <2200000>;
+               };
+               eth0: ethernet@1e20000 {
+                       status = "okay";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mii_pins>;
+               };
        };
        nand_cs3@62000000 {
                status = "okay";
index d70ba55..8d17346 100644 (file)
                                        0x14 0x00000010 0x000000f0
                                >;
                        };
+                       mdio_pins: pinmux_mdio_pins {
+                               pinctrl-single,bits = <
+                                       /* MDIO_CLK, MDIO_D */
+                                       0x10 0x00000088 0x000000ff
+                               >;
+                       };
+                       mii_pins: pinmux_mii_pins {
+                               pinctrl-single,bits = <
+                                       /*
+                                        * MII_TXEN, MII_TXCLK, MII_COL
+                                        * MII_TXD_3, MII_TXD_2, MII_TXD_1
+                                        * MII_TXD_0
+                                        */
+                                       0x8 0x88888880 0xfffffff0
+                                       /*
+                                        * MII_RXER, MII_CRS, MII_RXCLK
+                                        * MII_RXDV, MII_RXD_3, MII_RXD_2
+                                        * MII_RXD_1, MII_RXD_0
+                                        */
+                                       0xc 0x88888888 0xffffffff
+                               >;
+                       };
+
                };
                serial0: serial@1c42000 {
                        compatible = "ns16550a";
                        reg = <0x42000 0x100>;
-                       clock-frequency = <150000000>;
                        reg-shift = <2>;
                        interrupts = <25>;
                        status = "disabled";
                serial1: serial@1d0c000 {
                        compatible = "ns16550a";
                        reg = <0x10c000 0x100>;
-                       clock-frequency = <150000000>;
                        reg-shift = <2>;
                        interrupts = <53>;
                        status = "disabled";
                serial2: serial@1d0d000 {
                        compatible = "ns16550a";
                        reg = <0x10d000 0x100>;
-                       clock-frequency = <150000000>;
                        reg-shift = <2>;
                        interrupts = <61>;
                        status = "disabled";
                        interrupts = <56>;
                        status = "disabled";
                };
+               mdio: mdio@1e24000 {
+                       compatible = "ti,davinci_mdio";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x224000 0x1000>;
+               };
+               eth0: ethernet@1e20000 {
+                       compatible = "ti,davinci-dm6467-emac";
+                       reg = <0x220000 0x4000>;
+                       ti,davinci-ctrl-reg-offset = <0x3000>;
+                       ti,davinci-ctrl-mod-reg-offset = <0x2000>;
+                       ti,davinci-ctrl-ram-offset = <0>;
+                       ti,davinci-ctrl-ram-size = <0x2000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <33
+                                       34
+                                       35
+                                       36
+                                       >;
+               };
        };
        nand_cs3@62000000 {
                compatible = "ti,davinci-nand";
index 5cae2ab..022646e 100644 (file)
@@ -42,6 +42,8 @@
                        regulator-always-on;
                        regulator-boot-on;
                        gpio = <&gpio0 1 0>;
+                       pinctrl-0 = <&pmx_gpio_1>;
+                       pinctrl-names = "default";
                };
        };
 
                        clock-frequency = <25000000>;
                };
        };
+
+       ir_recv: ir-receiver {
+               compatible = "gpio-ir-receiver";
+               gpios = <&gpio0 19 1>;
+               pinctrl-0 = <&pmx_gpio_19>;
+               pinctrl-names = "default";
+       };
 };
 
 &uart0 { status = "okay"; };
 &sata0 { status = "okay"; };
+&mdio { status = "okay"; };
+&eth { status = "okay"; };
+
+&ethphy {
+       compatible = "marvell,88e1310";
+       reg = <1>;
+};
 
 &i2c0 {
        status = "okay";
        status = "okay";
        /* sdio0 card detect is connected to wrong pin on CuBox */
        cd-gpios = <&gpio0 12 1>;
+       pinctrl-0 = <&pmx_sdio0 &pmx_gpio_12>;
 };
 
 &spi0 {
                reg = <0>;
        };
 };
-
-&pinctrl {
-       pinctrl-0 = <&pmx_gpio_1 &pmx_gpio_12>;
-       pinctrl-names = "default";
-
-       pmx_gpio_1: pmx-gpio-1 {
-               marvell,pins = "mpp1";
-               marvell,function = "gpio";
-       };
-
-       pmx_gpio_12: pmx-gpio-12 {
-               marvell,pins = "mpp12";
-               marvell,function = "gpio";
-       };
-
-       pmx_gpio_18: pmx-gpio-18 {
-               marvell,pins = "mpp18";
-               marvell,function = "gpio";
-       };
-};
diff --git a/arch/arm/boot/dts/dove-d2plug.dts b/arch/arm/boot/dts/dove-d2plug.dts
new file mode 100644 (file)
index 0000000..e2222ce
--- /dev/null
@@ -0,0 +1,69 @@
+/dts-v1/;
+
+/include/ "dove.dtsi"
+
+/ {
+       model = "Globalscale D2Plug";
+       compatible = "globalscale,d2plug", "marvell,dove";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x40000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8 earlyprintk";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&pmx_gpio_0 &pmx_gpio_1 &pmx_gpio_2>;
+               pinctrl-names = "default";
+
+               wlan-ap {
+                       label = "wlan-ap";
+                       gpios = <&gpio0 0 1>;
+               };
+
+               wlan-act {
+                       label = "wlan-act";
+                       gpios = <&gpio0 1 1>;
+               };
+
+               bluetooth-act {
+                       label = "bt-act";
+                       gpios = <&gpio0 2 1>;
+               };
+       };
+};
+
+&uart0 { status = "okay"; };
+&sata0 { status = "okay"; };
+&i2c0 { status = "okay"; };
+&mdio { status = "okay"; };
+&eth { status = "okay"; };
+
+/* Samsung M8G2F eMMC */
+&sdio0 {
+       status = "okay";
+       non-removable;
+       bus-width = <4>;
+};
+
+/* Marvell SD8787 WLAN/BT */
+&sdio1 {
+       status = "okay";
+       non-removable;
+       bus-width = <4>;
+};
+
+&spi0 {
+       status = "okay";
+
+       /* spi0.0: 4M Flash Macronix MX25L3205D */
+       spi-flash@0 {
+               compatible = "st,m25l3205d";
+               spi-max-frequency = <20000000>;
+               reg = <0>;
+       };
+};
index 6cab468..cc27916 100644 (file)
                gpio2 = &gpio2;
        };
 
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       compatible = "marvell,pj4a", "marvell,sheeva-v7";
+                       device_type = "cpu";
+                       next-level-cache = <&l2>;
+                       reg = <0>;
+               };
+       };
+
+       l2: l2-cache {
+               compatible = "marvell,tauros2-cache";
+               marvell,tauros2-cache-features = <0>;
+       };
+
        soc@f1000000 {
                compatible = "simple-bus";
                #address-cells = <1>;
                          0xf2100000 0xf2100000 0x0100000   /* PCIe0 I/O   1M */
                          0xf8000000 0xf8000000 0x8000000>; /* BootROM   128M */
 
-               l2: l2-cache {
-                       compatible = "marvell,tauros2-cache";
-                       marvell,tauros2-cache-features = <0>;
+               timer: timer@20300 {
+                       compatible = "marvell,orion-timer";
+                       reg = <0x20300 0x20>;
+                       interrupt-parent = <&bridge_intc>;
+                       interrupts = <1>, <2>;
+                       clocks = <&core_clk 0>;
                };
 
-               intc: interrupt-controller {
+               intc: main-interrupt-ctrl@20200 {
                        compatible = "marvell,orion-intc";
                        interrupt-controller;
                        #interrupt-cells = <1>;
-                       reg = <0x20204 0x04>, <0x20214 0x04>;
+                       reg = <0x20200 0x10>, <0x20210 0x10>;
+               };
+
+               bridge_intc: bridge-interrupt-ctrl@20110 {
+                       compatible = "marvell,orion-bridge-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       reg = <0x20110 0x8>;
+                       interrupts = <0>;
+                       marvell,#interrupts = <5>;
                };
 
                core_clk: core-clocks@d0214 {
                        #clock-cells = <1>;
                };
 
-               gate_clk: clock-gating-control@d0038 {
+               gate_clk: clock-gating-ctrl@d0038 {
                        compatible = "marvell,dove-gating-clock";
                        reg = <0xd0038 0x4>;
                        clocks = <&core_clk 0>;
                        #clock-cells = <1>;
                };
 
-               thermal: thermal@d001c {
+               thermal: thermal-diode@d001c {
                        compatible = "marvell,dove-thermal";
                        reg = <0xd001c 0x0c>, <0xd005c 0x08>;
                };
@@ -70,6 +99,8 @@
                        reg-shift = <2>;
                        interrupts = <8>;
                        clocks = <&core_clk 0>;
+                       pinctrl-0 = <&pmx_uart1>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
                        status = "disabled";
                };
 
-               gpio0: gpio@d0400 {
+               gpio0: gpio-ctrl@d0400 {
                        compatible = "marvell,orion-gpio";
                        #gpio-cells = <2>;
                        gpio-controller;
                        interrupts = <12>, <13>, <14>, <60>;
                };
 
-               gpio1: gpio@d0420 {
+               gpio1: gpio-ctrl@d0420 {
                        compatible = "marvell,orion-gpio";
                        #gpio-cells = <2>;
                        gpio-controller;
                        interrupts = <61>;
                };
 
-               gpio2: gpio@e8400 {
+               gpio2: gpio-ctrl@e8400 {
                        compatible = "marvell,orion-gpio";
                        #gpio-cells = <2>;
                        gpio-controller;
                        ngpios = <8>;
                };
 
-               pinctrl: pinctrl@d0200 {
+               pinctrl: pin-ctrl@d0200 {
                        compatible = "marvell,dove-pinctrl";
                        reg = <0xd0200 0x10>;
                        clocks = <&gate_clk 22>;
+
+                       pmx_gpio_0: pmx-gpio-0 {
+                               marvell,pins = "mpp0";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_1: pmx-gpio-1 {
+                               marvell,pins = "mpp1";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_2: pmx-gpio-2 {
+                               marvell,pins = "mpp2";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_3: pmx-gpio-3 {
+                               marvell,pins = "mpp3";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_4: pmx-gpio-4 {
+                               marvell,pins = "mpp4";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_5: pmx-gpio-5 {
+                               marvell,pins = "mpp5";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_6: pmx-gpio-6 {
+                               marvell,pins = "mpp6";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_7: pmx-gpio-7 {
+                               marvell,pins = "mpp7";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_8: pmx-gpio-8 {
+                               marvell,pins = "mpp8";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_9: pmx-gpio-9 {
+                               marvell,pins = "mpp9";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_10: pmx-gpio-10 {
+                               marvell,pins = "mpp10";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_11: pmx-gpio-11 {
+                               marvell,pins = "mpp11";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_12: pmx-gpio-12 {
+                               marvell,pins = "mpp12";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_13: pmx-gpio-13 {
+                               marvell,pins = "mpp13";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_14: pmx-gpio-14 {
+                               marvell,pins = "mpp14";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_15: pmx-gpio-15 {
+                               marvell,pins = "mpp15";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_16: pmx-gpio-16 {
+                               marvell,pins = "mpp16";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_17: pmx-gpio-17 {
+                               marvell,pins = "mpp17";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_18: pmx-gpio-18 {
+                               marvell,pins = "mpp18";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_19: pmx-gpio-19 {
+                               marvell,pins = "mpp19";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_20: pmx-gpio-20 {
+                               marvell,pins = "mpp20";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_gpio_21: pmx-gpio-21 {
+                               marvell,pins = "mpp21";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_camera: pmx-camera {
+                               marvell,pins = "mpp_camera";
+                               marvell,function = "camera";
+                       };
+
+                       pmx_camera_gpio: pmx-camera-gpio {
+                               marvell,pins = "mpp_camera";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_sdio0: pmx-sdio0 {
+                               marvell,pins = "mpp_sdio0";
+                               marvell,function = "sdio0";
+                       };
+
+                       pmx_sdio0_gpio: pmx-sdio0-gpio {
+                               marvell,pins = "mpp_sdio0";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_sdio1: pmx-sdio1 {
+                               marvell,pins = "mpp_sdio1";
+                               marvell,function = "sdio1";
+                       };
+
+                       pmx_sdio1_gpio: pmx-sdio1-gpio {
+                               marvell,pins = "mpp_sdio1";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_audio1_gpio: pmx-audio1-gpio {
+                               marvell,pins = "mpp_audio1";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_spi0: pmx-spi0 {
+                               marvell,pins = "mpp_spi0";
+                               marvell,function = "spi0";
+                       };
+
+                       pmx_spi0_gpio: pmx-spi0-gpio {
+                               marvell,pins = "mpp_spi0";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_uart1: pmx-uart1 {
+                               marvell,pins = "mpp_uart1";
+                               marvell,function = "uart1";
+                       };
+
+                       pmx_uart1_gpio: pmx-uart1-gpio {
+                               marvell,pins = "mpp_uart1";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_nand: pmx-nand {
+                               marvell,pins = "mpp_nand";
+                               marvell,function = "nand";
+                       };
+
+                       pmx_nand_gpo: pmx-nand-gpo {
+                               marvell,pins = "mpp_nand";
+                               marvell,function = "gpo";
+                       };
                };
 
-               spi0: spi@10600 {
+               spi0: spi-ctrl@10600 {
                        compatible = "marvell,orion-spi";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        interrupts = <6>;
                        reg = <0x10600 0x28>;
                        clocks = <&core_clk 0>;
+                       pinctrl-0 = <&pmx_spi0>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
-               spi1: spi@14600 {
+               spi1: spi-ctrl@14600 {
                        compatible = "marvell,orion-spi";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                };
 
-               i2c0: i2c@11000 {
+               i2c0: i2c-ctrl@11000 {
                        compatible = "marvell,mv64xxx-i2c";
                        reg = <0x11000 0x20>;
                        #address-cells = <1>;
                        status = "okay";
                };
 
-               sdio0: sdio@92000 {
+               sdio0: sdio-host@92000 {
                        compatible = "marvell,dove-sdhci";
                        reg = <0x92000 0x100>;
                        interrupts = <35>, <37>;
                        clocks = <&gate_clk 8>;
+                       pinctrl-0 = <&pmx_sdio0>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
-               sdio1: sdio@90000 {
+               sdio1: sdio-host@90000 {
                        compatible = "marvell,dove-sdhci";
                        reg = <0x90000 0x100>;
                        interrupts = <36>, <38>;
                        clocks = <&gate_clk 9>;
+                       pinctrl-0 = <&pmx_sdio1>;
+                       pinctrl-names = "default";
                        status = "disabled";
                };
 
-               sata0: sata@a0000 {
+               sata0: sata-host@a0000 {
                        compatible = "marvell,orion-sata";
                        reg = <0xa0000 0x2400>;
                        interrupts = <62>;
                        status = "disabled";
                };
 
-               rtc@d8500 {
+               rtc: real-time-clock@d8500 {
                        compatible = "marvell,orion-rtc";
                        reg = <0xd8500 0x20>;
                };
 
-               crypto: crypto@30000 {
+               crypto: crypto-engine@30000 {
                        compatible = "marvell,orion-crypto";
                        reg = <0x30000 0x10000>,
                              <0xc8000000 0x800>;
                                dmacap,xor;
                        };
                };
+
+               mdio: mdio-bus@72004 {
+                       compatible = "marvell,orion-mdio";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x72004 0x84>;
+                       interrupts = <30>;
+                       clocks = <&gate_clk 2>;
+                       status = "disabled";
+
+                       ethphy: ethernet-phy {
+                               device-type = "ethernet-phy";
+                               /* set phy address in board file */
+                       };
+               };
+
+               eth: ethernet-controller@72000 {
+                       compatible = "marvell,orion-eth";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x72000 0x4000>;
+                       clocks = <&gate_clk 2>;
+                       marvell,tx-checksum-limit = <1600>;
+                       status = "disabled";
+
+                       ethernet-port@0 {
+                               device_type = "network";
+                               compatible = "marvell,orion-eth-port";
+                               reg = <0>;
+                               interrupts = <29>;
+                               /* overwrite MAC address in bootloader */
+                               local-mac-address = [00 00 00 00 00 00];
+                               phy-handle = <&ethphy>;
+                       };
+               };
        };
 };
diff --git a/arch/arm/boot/dts/emev2-kzm9d-reference.dts b/arch/arm/boot/dts/emev2-kzm9d-reference.dts
new file mode 100644 (file)
index 0000000..bed676b
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Device Tree Source for the KZM9D board
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+/dts-v1/;
+
+/include/ "emev2.dtsi"
+
+/ {
+       model = "EMEV2 KZM9D Board";
+       compatible = "renesas,kzm9d-reference", "renesas,emev2";
+
+       memory {
+               device_type = "memory";
+               reg = <0x40000000 0x8000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096";
+       };
+
+       reg_1p8v: regulator@0 {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-1.8V";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       reg_3p3v: regulator@1 {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       lan9220@20000000 {
+               compatible = "smsc,lan9220", "smsc,lan9115";
+               reg = <0x20000000 0x10000>;
+               phy-mode = "mii";
+               interrupt-parent = <&gpio0>;
+               interrupts = <1 1>;     /* active high */
+               reg-io-width = <4>;
+               smsc,irq-active-high;
+               smsc,irq-push-pull;
+               vddvario-supply = <&reg_1p8v>;
+               vdd33a-supply = <&reg_3p3v>;
+       };
+};
index b9b3241..dda13bc 100644 (file)
@@ -21,6 +21,6 @@
        };
 
        chosen {
-               bootargs = "console=tty0 console=ttyS1,115200n81 earlyprintk=serial8250-em.1,115200n81 mem=128M@0x40000000 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096";
+               bootargs = "console=ttyS1,115200n81 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096";
        };
 };
index c8a8c08..99ad2b2 100644 (file)
        compatible = "renesas,emev2";
        interrupt-parent = <&gic>;
 
+       aliases {
+               gpio0 = &gpio0;
+               gpio1 = &gpio1;
+               gpio2 = &gpio2;
+               gpio3 = &gpio3;
+               gpio4 = &gpio4;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0xe1050000 0x38>;
                interrupts = <0 11 0>;
        };
+
+       gpio0: gpio@e0050000 {
+               compatible = "renesas,em-gio";
+               reg = <0xe0050000 0x2c>, <0xe0050040 0x20>;
+               interrupts = <0 67 0>, <0 68 0>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               ngpios = <32>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+       gpio1: gpio@e0050080 {
+               compatible = "renesas,em-gio";
+               reg = <0xe0050080 0x2c>, <0xe00500c0 0x20>;
+               interrupts = <0 69 0>, <0 70 0>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               ngpios = <32>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+       gpio2: gpio@e0050100 {
+               compatible = "renesas,em-gio";
+               reg = <0xe0050100 0x2c>, <0xe0050140 0x20>;
+               interrupts = <0 71 0>, <0 72 0>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               ngpios = <32>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+       gpio3: gpio@e0050180 {
+               compatible = "renesas,em-gio";
+               reg = <0xe0050180 0x2c>, <0xe00501c0 0x20>;
+               interrupts = <0 73 0>, <0 74 0>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               ngpios = <32>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+       gpio4: gpio@e0050200 {
+               compatible = "renesas,em-gio";
+               reg = <0xe0050200 0x2c>, <0xe0050240 0x20>;
+               interrupts = <0 75 0>, <0 76 0>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               ngpios = <31>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
 };
index 3f94fe8..93c2501 100644 (file)
                i2c5 = &i2c_5;
                i2c6 = &i2c_6;
                i2c7 = &i2c_7;
+               csis0 = &csis_0;
+               csis1 = &csis_1;
+               fimc0 = &fimc_0;
+               fimc1 = &fimc_1;
+               fimc2 = &fimc_2;
+               fimc3 = &fimc_3;
        };
 
        chipid@10000000 {
                reg = <0x10010000 0x400>;
        };
 
+       camera {
+               compatible = "samsung,fimc", "simple-bus";
+               status = "disabled";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               clock_cam: clock-controller {
+                        #clock-cells = <1>;
+               };
+
+               fimc_0: fimc@11800000 {
+                       compatible = "samsung,exynos4210-fimc";
+                       reg = <0x11800000 0x1000>;
+                       interrupts = <0 84 0>;
+                       clocks = <&clock 256>, <&clock 128>;
+                       clock-names = "fimc", "sclk_fimc";
+                       samsung,power-domain = <&pd_cam>;
+                       samsung,sysreg = <&sys_reg>;
+                       status = "disabled";
+               };
+
+               fimc_1: fimc@11810000 {
+                       compatible = "samsung,exynos4210-fimc";
+                       reg = <0x11810000 0x1000>;
+                       interrupts = <0 85 0>;
+                       clocks = <&clock 257>, <&clock 129>;
+                       clock-names = "fimc", "sclk_fimc";
+                       samsung,power-domain = <&pd_cam>;
+                       samsung,sysreg = <&sys_reg>;
+                       status = "disabled";
+               };
+
+               fimc_2: fimc@11820000 {
+                       compatible = "samsung,exynos4210-fimc";
+                       reg = <0x11820000 0x1000>;
+                       interrupts = <0 86 0>;
+                       clocks = <&clock 258>, <&clock 130>;
+                       clock-names = "fimc", "sclk_fimc";
+                       samsung,power-domain = <&pd_cam>;
+                       samsung,sysreg = <&sys_reg>;
+                       status = "disabled";
+               };
+
+               fimc_3: fimc@11830000 {
+                       compatible = "samsung,exynos4210-fimc";
+                       reg = <0x11830000 0x1000>;
+                       interrupts = <0 87 0>;
+                       clocks = <&clock 259>, <&clock 131>;
+                       clock-names = "fimc", "sclk_fimc";
+                       samsung,power-domain = <&pd_cam>;
+                       samsung,sysreg = <&sys_reg>;
+                       status = "disabled";
+               };
+
+               csis_0: csis@11880000 {
+                       compatible = "samsung,exynos4210-csis";
+                       reg = <0x11880000 0x4000>;
+                       interrupts = <0 78 0>;
+                       clocks = <&clock 260>, <&clock 134>;
+                       clock-names = "csis", "sclk_csis";
+                       bus-width = <4>;
+                       samsung,power-domain = <&pd_cam>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               csis_1: csis@11890000 {
+                       compatible = "samsung,exynos4210-csis";
+                       reg = <0x11890000 0x4000>;
+                       interrupts = <0 80 0>;
+                       clocks = <&clock 261>, <&clock 135>;
+                       clock-names = "csis", "sclk_csis";
+                       bus-width = <2>;
+                       samsung,power-domain = <&pd_cam>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+       };
+
        watchdog@10060000 {
                compatible = "samsung,s3c2410-wdt";
                reg = <0x10060000 0x100>;
                status = "disabled";
        };
 
+       ehci@12580000 {
+               compatible = "samsung,exynos4210-ehci";
+               reg = <0x12580000 0x100>;
+               interrupts = <0 70 0>;
+               clocks = <&clock 304>;
+               clock-names = "usbhost";
+               status = "disabled";
+       };
+
+       ohci@12590000 {
+               compatible = "samsung,exynos4210-ohci";
+               reg = <0x12590000 0x100>;
+               interrupts = <0 70 0>;
+               clocks = <&clock 304>;
+               clock-names = "usbhost";
+               status = "disabled";
+       };
+
        mfc: codec@13400000 {
                compatible = "samsung,mfc-v5";
                reg = <0x13400000 0x10000>;
                interrupts = <0 94 0>;
                samsung,power-domain = <&pd_mfc>;
-               clocks = <&clock 170>, <&clock 273>;
-               clock-names = "sclk_mfc", "mfc";
+               clocks = <&clock 273>;
+               clock-names = "mfc";
                status = "disabled";
        };
 
                compatible = "samsung,exynos4210-spi";
                reg = <0x13920000 0x100>;
                interrupts = <0 66 0>;
-               tx-dma-channel = <&pdma0 7>; /* preliminary */
-               rx-dma-channel = <&pdma0 6>; /* preliminary */
+               dmas = <&pdma0 7>, <&pdma0 6>;
+               dma-names = "tx", "rx";
                #address-cells = <1>;
                #size-cells = <0>;
                clocks = <&clock 327>, <&clock 159>;
                compatible = "samsung,exynos4210-spi";
                reg = <0x13930000 0x100>;
                interrupts = <0 67 0>;
-               tx-dma-channel = <&pdma1 7>; /* preliminary */
-               rx-dma-channel = <&pdma1 6>; /* preliminary */
+               dmas = <&pdma1 7>, <&pdma1 6>;
+               dma-names = "tx", "rx";
                #address-cells = <1>;
                #size-cells = <0>;
                clocks = <&clock 328>, <&clock 160>;
                compatible = "samsung,exynos4210-spi";
                reg = <0x13940000 0x100>;
                interrupts = <0 68 0>;
-               tx-dma-channel = <&pdma0 9>; /* preliminary */
-               rx-dma-channel = <&pdma0 8>; /* preliminary */
+               dmas = <&pdma0 9>, <&pdma0 8>;
+               dma-names = "tx", "rx";
                #address-cells = <1>;
                #size-cells = <0>;
                clocks = <&clock 329>, <&clock 161>;
index 553bcea..a7c2128 100644 (file)
                        samsung,pin-pud = <0>;
                        samsung,pin-drv = <0>;
                };
+
+               cam_port_a_io: cam-port-a-io {
+                       samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
+                                       "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
+                                       "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
+                       samsung,pin-function = <2>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <0>;
+               };
+
+               cam_port_a_clk_active: cam-port-a-clk-active {
+                       samsung,pins = "gpj1-3";
+                       samsung,pin-function = <2>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <3>;
+               };
+
+               cam_port_a_clk_idle: cam-port-a-clk-idle {
+                       samsung,pins = "gpj1-3";
+                       samsung,pin-function = <0>;
+                       samsung,pin-pud = <1>;
+                       samsung,pin-drv = <0>;
+               };
        };
 
        pinctrl@03860000 {
index 94eebff..1c164f2 100644 (file)
                bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
        };
 
-       vemmc_reg: voltage-regulator@0 {
-               compatible = "regulator-fixed";
-               regulator-name = "VMEM_VDD_2.8V";
-               regulator-min-microvolt = <2800000>;
-               regulator-max-microvolt = <2800000>;
-               gpio = <&gpk0 2 0>;
-               enable-active-high;
+       regulators {
+               compatible = "simple-bus";
+
+               vemmc_reg: regulator-0 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "VMEM_VDD_2.8V";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       gpio = <&gpk0 2 0>;
+                       enable-active-high;
+               };
+
+               tsp_reg: regulator-1 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "TSP_FIXED_VOLTAGES";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       gpio = <&gpl0 3 0>;
+                       enable-active-high;
+               };
+
+               cam_af_28v_reg: regulator-2 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "8M_AF_2.8V_EN";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       gpio = <&gpk1 1 0>;
+                       enable-active-high;
+               };
+
+               cam_io_en_reg: regulator-3 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "CAM_IO_EN";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       gpio = <&gpe2 1 0>;
+                       enable-active-high;
+               };
+
+               cam_io_12v_reg: regulator-4 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "8M_1.2V_EN";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       gpio = <&gpe2 5 0>;
+                       enable-active-high;
+               };
+
+               vt_core_15v_reg: regulator-5 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "VT_CORE_1.5V";
+                       regulator-min-microvolt = <1500000>;
+                       regulator-max-microvolt = <1500000>;
+                       gpio = <&gpe2 2 0>;
+                       enable-active-high;
+               };
        };
 
        sdhci_emmc: sdhci@12510000 {
                };
        };
 
-       tsp_reg: voltage-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "TSP_FIXED_VOLTAGES";
-               regulator-min-microvolt = <2800000>;
-               regulator-max-microvolt = <2800000>;
-               gpio = <&gpl0 3 0>;
-               enable-active-high;
-       };
-
        i2c@13890000 {
                samsung,i2c-sda-delay = <100>;
                samsung,i2c-slave-addr = <0x10>;
                                     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>;
                        clock-frequency = <24000000>;
                };
        };
+
+       camera {
+               pinctrl-names = "default";
+               pinctrl-0 = <>;
+               status = "okay";
+
+               fimc_0: fimc@11800000 {
+                       status = "okay";
+               };
+
+               fimc_1: fimc@11810000 {
+                       status = "okay";
+               };
+
+               fimc_2: fimc@11820000 {
+                       status = "okay";
+               };
+
+               fimc_3: fimc@11830000 {
+                       status = "okay";
+               };
+       };
 };
index b7f358a..057d682 100644 (file)
@@ -72,7 +72,7 @@
                };
        };
 
-       clock: clock-controller@0x10030000 {
+       clock: clock-controller@10030000 {
                compatible = "samsung,exynos4210-clock";
                reg = <0x10030000 0x20000>;
                #clock-cells = <1>;
                clock-names = "sclk_fimg2d", "fimg2d";
                status = "disabled";
        };
+
+       camera {
+               clocks = <&clock 132>, <&clock 133>, <&clock 351>, <&clock 352>;
+               clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1";
+
+               fimc_0: fimc@11800000 {
+                       samsung,pix-limits = <4224 8192 1920 4224>;
+                       samsung,mainscaler-ext;
+                       samsung,cam-if;
+               };
+
+               fimc_1: fimc@11810000 {
+                       samsung,pix-limits = <4224 8192 1920 4224>;
+                       samsung,mainscaler-ext;
+                       samsung,cam-if;
+               };
+
+               fimc_2: fimc@11820000 {
+                       samsung,pix-limits = <4224 8192 1920 4224>;
+                       samsung,mainscaler-ext;
+                       samsung,lcd-wb;
+               };
+
+               fimc_3: fimc@11830000 {
+                       samsung,pix-limits = <1920 8192 1366 1920>;
+                       samsung,rotators = <0>;
+                       samsung,mainscaler-ext;
+                       samsung,lcd-wb;
+               };
+       };
 };
index 7993641..8768b03 100644 (file)
                bootargs ="console=ttySAC2,115200";
        };
 
+       firmware@0203F000 {
+               compatible = "samsung,secure-firmware";
+               reg = <0x0203F000 0x1000>;
+       };
+
        mmc_reg: voltage-regulator {
                compatible = "regulator-fixed";
                regulator-name = "VMEM_VDD_2.8V";
diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
new file mode 100644 (file)
index 0000000..fb7b9ae
--- /dev/null
@@ -0,0 +1,579 @@
+/*
+ * Samsung's Exynos4412 based Trats 2 board device tree source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * Device tree source file for Samsung's Trats 2 board which is based on
+ * Samsung's Exynos4412 SoC.
+ *
+ * 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 "exynos4412.dtsi"
+
+/ {
+       model = "Samsung Trats 2 based on Exynos4412";
+       compatible = "samsung,trats2", "samsung,exynos4412";
+
+       aliases {
+               i2c8 = &i2c_ak8975;
+       };
+
+       memory {
+               reg =  <0x40000000 0x40000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttySAC2,115200N8 root=/dev/mmcblk0p5 rootwait earlyprintk panic=5";
+       };
+
+       firmware@0204F000 {
+               compatible = "samsung,secure-firmware";
+               reg = <0x0204F000 0x1000>;
+       };
+
+       fixed-rate-clocks {
+               xxti {
+                       compatible = "samsung,clock-xxti", "fixed-clock";
+                       clock-frequency = <0>;
+               };
+
+               xusbxti {
+                       compatible = "samsung,clock-xusbxti", "fixed-clock";
+                       clock-frequency = <24000000>;
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               vemmc_reg: regulator-0 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "VMEM_VDD_2.8V";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       gpio = <&gpk0 2 0>;
+                       enable-active-high;
+               };
+
+               cam_io_reg: voltage-regulator-1 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "CAM_SENSOR_A";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       gpio = <&gpm0 2 0>;
+                       enable-active-high;
+               };
+
+               /* More to come */
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               key-down {
+                       interrupt-parent = <&gpj1>;
+                       interrupts = <2 0>;
+                       gpios = <&gpj1 2 1>;
+                       linux,code = <114>;
+                       label = "volume down";
+                       debounce-interval = <10>;
+               };
+
+               key-up {
+                       interrupt-parent = <&gpj1>;
+                       interrupts = <1 0>;
+                       gpios = <&gpj1 1 1>;
+                       linux,code = <115>;
+                       label = "volume up";
+                       debounce-interval = <10>;
+               };
+
+               key-power {
+                       interrupt-parent = <&gpx2>;
+                       interrupts = <7 0>;
+                       gpios = <&gpx2 7 1>;
+                       linux,code = <116>;
+                       label = "power";
+                       debounce-interval = <10>;
+                       gpio-key,wakeup;
+               };
+       };
+
+       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@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>;
+
+                       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;
+                                       regulator-mem-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-mem-on;
+                               };
+
+                               ldo3_reg: ldo3 {
+                                       regulator-compatible = "LDO3";
+                                       regulator-name = "VCC_1.8V_AP";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-always-on;
+                                       regulator-mem-on;
+                               };
+
+                               ldo4_reg: ldo4 {
+                                       regulator-compatible = "LDO4";
+                                       regulator-name = "VCC_2.8V_AP";
+                                       regulator-min-microvolt = <2800000>;
+                                       regulator-max-microvolt = <2800000>;
+                                       regulator-always-on;
+                                       regulator-mem-on;
+                               };
+
+                               ldo5_reg: ldo5 {
+                                       regulator-compatible = "LDO5";
+                                       regulator-name = "VCC_1.8V_IO";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-always-on;
+                                       regulator-mem-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-mem-on;
+                               };
+
+                               ldo7_reg: ldo7 {
+                                       regulator-compatible = "LDO7";
+                                       regulator-name = "VPLL_1.0V_AP";
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1000000>;
+                                       regulator-always-on;
+                                       regulator-mem-on;
+                               };
+
+                               ldo8_reg: ldo8 {
+                                       regulator-compatible = "LDO8";
+                                       regulator-name = "VMIPI_1.0V";
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1000000>;
+                                       regulator-mem-off;
+                               };
+
+                               ldo9_reg: ldo9 {
+                                       regulator-compatible = "LDO9";
+                                       regulator-name = "CAM_ISP_MIPI_1.2V";
+                                       regulator-min-microvolt = <1200000>;
+                                       regulator-max-microvolt = <1200000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo10_reg: ldo10 {
+                                       regulator-compatible = "LDO10";
+                                       regulator-name = "VMIPI_1.8V";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-mem-off;
+                               };
+
+                               ldo11_reg: ldo11 {
+                                       regulator-compatible = "LDO11";
+                                       regulator-name = "VABB1_1.95V";
+                                       regulator-min-microvolt = <1950000>;
+                                       regulator-max-microvolt = <1950000>;
+                                       regulator-always-on;
+                                       regulator-mem-off;
+                               };
+
+                               ldo12_reg: ldo12 {
+                                       regulator-compatible = "LDO12";
+                                       regulator-name = "VUOTG_3.0V";
+                                       regulator-min-microvolt = <3000000>;
+                                       regulator-max-microvolt = <3000000>;
+                                       regulator-mem-off;
+                               };
+
+                               ldo13_reg: ldo13 {
+                                       regulator-compatible = "LDO13";
+                                       regulator-name = "NFC_AVDD_1.8V";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo14_reg: ldo14 {
+                                       regulator-compatible = "LDO14";
+                                       regulator-name = "VABB2_1.95V";
+                                       regulator-min-microvolt = <1950000>;
+                                       regulator-max-microvolt = <1950000>;
+                                       regulator-always-on;
+                                       regulator-mem-off;
+                               };
+
+                               ldo15_reg: ldo15 {
+                                       regulator-compatible = "LDO15";
+                                       regulator-name = "VHSIC_1.0V";
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1000000>;
+                                       regulator-mem-off;
+                               };
+
+                               ldo16_reg: ldo16 {
+                                       regulator-compatible = "LDO16";
+                                       regulator-name = "VHSIC_1.8V";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-mem-off;
+                               };
+
+                               ldo17_reg: ldo17 {
+                                       regulator-compatible = "LDO17";
+                                       regulator-name = "CAM_SENSOR_CORE_1.2V";
+                                       regulator-min-microvolt = <1200000>;
+                                       regulator-max-microvolt = <1200000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo18_reg: ldo18 {
+                                       regulator-compatible = "LDO18";
+                                       regulator-name = "CAM_ISP_SEN_IO_1.8V";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo19_reg: ldo19 {
+                                       regulator-compatible = "LDO19";
+                                       regulator-name = "VT_CAM_1.8V";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo20_reg: ldo20 {
+                                       regulator-compatible = "LDO20";
+                                       regulator-name = "VDDQ_PRE_1.8V";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo21_reg: ldo21 {
+                                       regulator-compatible = "LDO21";
+                                       regulator-name = "VTF_2.8V";
+                                       regulator-min-microvolt = <2800000>;
+                                       regulator-max-microvolt = <2800000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo22_reg: ldo22 {
+                                       regulator-compatible = "LDO22";
+                                       regulator-name = "VMEM_VDD_2.8V";
+                                       regulator-min-microvolt = <2800000>;
+                                       regulator-max-microvolt = <2800000>;
+                                       regulator-always-on;
+                                       regulator-mem-off;
+                               };
+
+                               ldo23_reg: ldo23 {
+                                       regulator-compatible = "LDO23";
+                                       regulator-name = "TSP_AVDD_3.3V";
+                                       regulator-min-microvolt = <3300000>;
+                                       regulator-max-microvolt = <3300000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo24_reg: ldo24 {
+                                       regulator-compatible = "LDO24";
+                                       regulator-name = "TSP_VDD_1.8V";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo25_reg: ldo25 {
+                                       regulator-compatible = "LDO25";
+                                       regulator-name = "LCD_VCC_3.3V";
+                                       regulator-min-microvolt = <2800000>;
+                                       regulator-max-microvolt = <2800000>;
+                                       regulator-mem-idle;
+                               };
+
+                               ldo26_reg: ldo26 {
+                                       regulator-compatible = "LDO26";
+                                       regulator-name = "MOTOR_VCC_3.0V";
+                                       regulator-min-microvolt = <3000000>;
+                                       regulator-max-microvolt = <3000000>;
+                                       regulator-mem-idle;
+                               };
+
+                               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-mem-off;
+                               };
+
+                               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-mem-off;
+                               };
+
+                               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-mem-off;
+                               };
+
+                               buck4_reg: buck4 {
+                                       regulator-compatible = "BUCK4";
+                                       regulator-name = "vdd_g3d";
+                                       regulator-min-microvolt = <850000>;
+                                       regulator-max-microvolt = <1150000>;
+                                       regulator-boot-on;
+                                       regulator-mem-off;
+                               };
+
+                               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>;
+                                       regulator-always-on;
+                                       regulator-mem-off;
+                               };
+
+                               buck9_reg: buck9 {
+                                       regulator-compatible = "BUCK9";
+                                       regulator-name = "CAM_ISP_CORE_1.2V";
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1200000>;
+                                       regulator-mem-off;
+                               };
+                       };
+               };
+       };
+
+       sdhci@12510000 {
+               bus-width = <8>;
+               non-removable;
+               pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus8>;
+               pinctrl-names = "default";
+               vmmc-supply = <&vemmc_reg>;
+               status = "okay";
+       };
+
+       serial@13800000 {
+               status = "okay";
+       };
+
+       serial@13810000 {
+               status = "okay";
+       };
+
+       serial@13820000 {
+               status = "okay";
+       };
+
+       serial@13830000 {
+               status = "okay";
+       };
+
+       i2c_ak8975: i2c-gpio-0 {
+               compatible = "i2c-gpio";
+               gpios = <&gpy2 4 0>, <&gpy2 5 0>;
+               i2c-gpio,delay-us = <2>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "okay";
+
+               ak8975@0c {
+                       compatible = "ak,ak8975";
+                       reg = <0x0c>;
+                       gpios = <&gpj0 7 0>;
+               };
+       };
+
+       spi_1: spi@13930000 {
+               pinctrl-names = "default";
+               pinctrl-0 = <&spi1_bus>;
+               status = "okay";
+
+               s5c73m3_spi: s5c73m3 {
+                       compatible = "samsung,s5c73m3";
+                       spi-max-frequency = <50000000>;
+                       reg = <0>;
+                       controller-data {
+                               cs-gpio = <&gpb 5 0>;
+                               samsung,spi-feedback-delay = <2>;
+                       };
+               };
+       };
+
+       camera {
+               pinctrl-0 = <&cam_port_b_clk_active>;
+               pinctrl-names = "default";
+               status = "okay";
+
+               fimc_0: fimc@11800000 {
+                       status = "okay";
+               };
+
+               fimc_1: fimc@11810000 {
+                       status = "okay";
+               };
+
+               fimc_2: fimc@11820000 {
+                       status = "okay";
+               };
+
+               fimc_3: fimc@11830000 {
+                       status = "okay";
+               };
+
+               csis_1: csis@11890000 {
+                       vddcore-supply = <&ldo8_reg>;
+                       vddio-supply = <&ldo10_reg>;
+                       clock-frequency = <160000000>;
+                       status = "okay";
+
+                       /* 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>;
+                                       clock-frequency = <24000000>;
+                                       /* CAM_B_CLKOUT */
+                                       clocks = <&clock_cam 1>;
+                                       clock-names = "mclk";
+                                       samsung,camclk-out = <1>;
+                                       gpios = <&gpm1 6 0>;
+
+                                       port {
+                                               is_s5k6a3_ep: endpoint {
+                                                       remote-endpoint = <&csis1_ep>;
+                                                       data-lanes = <1>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+       };
+};
index 704290f..99b26df 100644 (file)
                        samsung,pin-drv = <0>;
                };
 
-               cam_port_a: cam-port-a {
+               cam_port_a_io: cam-port-a-io {
                        samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
                                        "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
-                                       "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-3",
-                                       "gpj1-4";
+                                       "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-4";
                        samsung,pin-function = <2>;
-                       samsung,pin-pud = <3>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <0>;
+               };
+
+               cam_port_a_clk_active: cam-port-a-clk-active {
+                       samsung,pins = "gpj1-3";
+                       samsung,pin-function = <2>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <3>;
+               };
+
+               cam_port_a_clk_idle: cam-port-a-clk-idle {
+                       samsung,pins = "gpj1-3";
+                       samsung,pin-function = <0>;
+                       samsung,pin-pud = <1>;
                        samsung,pin-drv = <0>;
                };
        };
                        samsung,pin-drv = <3>;
                };
 
-               cam_port_b: cam-port-b {
+               cam_port_b_io: cam-port-b-io {
                        samsung,pins = "gpm0-0", "gpm0-1", "gpm0-2", "gpm0-3",
                                        "gpm0-4", "gpm0-5", "gpm0-6", "gpm0-7",
-                                       "gpm1-0", "gpm1-1", "gpm2-0", "gpm2-1",
-                                       "gpm2-2";
+                                       "gpm1-0", "gpm1-1", "gpm2-0", "gpm2-1";
                        samsung,pin-function = <3>;
                        samsung,pin-pud = <3>;
                        samsung,pin-drv = <0>;
                };
 
+               cam_port_b_clk_active: cam-port-b-clk-active {
+                       samsung,pins = "gpm2-2";
+                       samsung,pin-function = <3>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <3>;
+               };
+
+               cam_port_b_clk_idle: cam-port-b-clk-idle {
+                       samsung,pins = "gpm2-2";
+                       samsung,pin-function = <0>;
+                       samsung,pin-pud = <1>;
+                       samsung,pin-drv = <0>;
+               };
+
                eint0: ext-int0 {
                        samsung,pins = "gpx0-0";
                        samsung,pin-function = <0xf>;
                        samsung,pin-pud = <0>;
                        samsung,pin-drv = <0>;
                };
+
+               fimc_is_i2c0: fimc-is-i2c0 {
+                       samsung,pins = "gpm4-0", "gpm4-1";
+                       samsung,pin-function = <2>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <0>;
+               };
+
+               fimc_is_i2c1: fimc-is-i2c1 {
+                       samsung,pins = "gpm4-2", "gpm4-3";
+                       samsung,pin-function = <2>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <0>;
+               };
+
+               fimc_is_uart: fimc-is-uart {
+                       samsung,pins = "gpm3-5", "gpm3-7";
+                       samsung,pin-function = <3>;
+                       samsung,pin-pud = <0>;
+                       samsung,pin-drv = <0>;
+               };
        };
 
        pinctrl@03860000 {
index 01da194..ad531fe 100644 (file)
                pinctrl1 = &pinctrl_1;
                pinctrl2 = &pinctrl_2;
                pinctrl3 = &pinctrl_3;
+               fimc-lite0 = &fimc_lite_0;
+               fimc-lite1 = &fimc_lite_1;
        };
 
-       clock: clock-controller@0x10030000 {
+       pd_isp: isp-power-domain@10023CA0 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10023CA0 0x20>;
+       };
+
+       clock: clock-controller@10030000 {
                compatible = "samsung,exynos4412-clock";
                reg = <0x10030000 0x20000>;
                #clock-cells = <1>;
                clock-names = "sclk_fimg2d", "fimg2d";
                status = "disabled";
        };
+
+       camera {
+               clocks = <&clock 132>, <&clock 133>, <&clock 351>, <&clock 352>;
+               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_lite_0: fimc-lite@12390000 {
+                       compatible = "samsung,exynos4212-fimc-lite";
+                       reg = <0x12390000 0x1000>;
+                       interrupts = <0 105 0>;
+                       samsung,power-domain = <&pd_isp>;
+                       clocks = <&clock 353>;
+                       clock-names = "flite";
+                       status = "disabled";
+               };
+
+               fimc_lite_1: fimc-lite@123A0000 {
+                       compatible = "samsung,exynos4212-fimc-lite";
+                       reg = <0x123A0000 0x1000>;
+                       interrupts = <0 106 0>;
+                       samsung,power-domain = <&pd_isp>;
+                       clocks = <&clock 354>;
+                       clock-names = "flite";
+                       status = "disabled";
+               };
+
+               fimc_is: fimc-is@12000000 {
+                       compatible = "samsung,exynos4212-fimc-is", "simple-bus";
+                       reg = <0x12000000 0x260000>;
+                       interrupts = <0 90 0>, <0 95 0>;
+                       samsung,power-domain = <&pd_isp>;
+                       clocks = <&clock 353>, <&clock 354>, <&clock 355>,
+                               <&clock 356>, <&clock 17>, <&clock 357>,
+                               <&clock 358>, <&clock 359>, <&clock 360>,
+                               <&clock 450>,<&clock 451>, <&clock 452>,
+                               <&clock 453>, <&clock 176>, <&clock 13>,
+                               <&clock 454>, <&clock 395>, <&clock 455>;
+                       clock-names = "lite0", "lite1", "ppmuispx",
+                                     "ppmuispmx", "mpll", "isp",
+                                     "drc", "fd", "mcuisp",
+                                     "ispdiv0", "ispdiv1", "mcuispdiv0",
+                                     "mcuispdiv1", "uart", "aclk200",
+                                     "div_aclk200", "aclk400mcuisp",
+                                     "div_aclk400mcuisp";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       status = "disabled";
+
+                       pmu {
+                               reg = <0x10020000 0x3000>;
+                       };
+
+                       i2c1_isp: i2c-isp@12140000 {
+                               compatible = "samsung,exynos4212-i2c-isp";
+                               reg = <0x12140000 0x100>;
+                               clocks = <&clock 370>;
+                               clock-names = "i2c_isp";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+       };
 };
index f65e124..6afa57d 100644 (file)
                interrupts = <0 42 0>;
                status = "disabled";
        };
+
+       fimd@14400000 {
+               compatible = "samsung,exynos5250-fimd";
+               interrupt-parent = <&combiner>;
+               reg = <0x14400000 0x40000>;
+               interrupt-names = "fifo", "vsync", "lcd_sys";
+               interrupts = <18 4>, <18 5>, <18 6>;
+               status = "disabled";
+       };
+
+       dp-controller@145B0000 {
+               compatible = "samsung,exynos5-dp";
+               reg = <0x145B0000 0x1000>;
+               interrupts = <10 3>;
+               interrupt-parent = <&combiner>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
 };
index abc7272..452d0b0 100644 (file)
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "exynos5250.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
        model = "Insignal Arndale evaluation board based on EXYNOS5250";
                s5m8767_pmic@66 {
                        compatible = "samsung,s5m8767-pmic";
                        reg = <0x66>;
+                       interrupt-parent = <&gpx3>;
+                       interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+
+                       vinb1-supply = <&main_dc_reg>;
+                       vinb2-supply = <&main_dc_reg>;
+                       vinb3-supply = <&main_dc_reg>;
+                       vinb4-supply = <&main_dc_reg>;
+                       vinb5-supply = <&main_dc_reg>;
+                       vinb6-supply = <&main_dc_reg>;
+                       vinb7-supply = <&main_dc_reg>;
+                       vinb8-supply = <&main_dc_reg>;
+                       vinb9-supply = <&main_dc_reg>;
+
+                       vinl1-supply = <&buck7_reg>;
+                       vinl2-supply = <&buck7_reg>;
+                       vinl3-supply = <&buck7_reg>;
+                       vinl4-supply = <&main_dc_reg>;
+                       vinl5-supply = <&main_dc_reg>;
+                       vinl6-supply = <&main_dc_reg>;
+                       vinl7-supply = <&main_dc_reg>;
+                       vinl8-supply = <&buck8_reg>;
+                       vinl9-supply = <&buck8_reg>;
 
                        s5m8767,pmic-buck2-dvs-voltage = <1300000>;
                        s5m8767,pmic-buck3-dvs-voltage = <1100000>;
                                        op_mode = <1>;
                                };
 
+                               buck7_reg: BUCK7 {
+                                       regulator-name = "PVDD_BUCK7";
+                                       regulator-always-on;
+                               };
+
+                               buck8_reg: BUCK8 {
+                                       regulator-name = "PVDD_BUCK8";
+                                       regulator-always-on;
+                               };
+
                                buck9_reg: BUCK9 {
                                        regulator-name = "VDD_33_OFF_EXT1";
                                        regulator-min-microvolt = <750000>;
        };
 
        i2c@12C90000 {
-               status = "disabled";
+               wm1811a@1a {
+                       compatible = "wlf,wm1811";
+                       reg = <0x1a>;
+
+                       AVDD2-supply = <&main_dc_reg>;
+                       CPVDD-supply = <&main_dc_reg>;
+                       DBVDD1-supply = <&main_dc_reg>;
+                       DBVDD2-supply = <&main_dc_reg>;
+                       DBVDD3-supply = <&main_dc_reg>;
+                       LDO1VDD-supply = <&main_dc_reg>;
+                       SPKVDD1-supply = <&main_dc_reg>;
+                       SPKVDD2-supply = <&main_dc_reg>;
+
+                       wlf,ldo1ena = <&gpb0 0 0>;
+                       wlf,ldo2ena = <&gpb0 1 0>;
+               };
        };
 
        i2c@12CA0000 {
                vdd-supply = <&ldo8_reg>;
        };
 
-       mmc_reg: voltage-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "VDD_33ON_2.8V";
-               regulator-min-microvolt = <2800000>;
-               regulator-max-microvolt = <2800000>;
-               gpio = <&gpx1 1 1>;
-               enable-active-high;
-       };
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
 
-       reg_hdmi_en: fixedregulator@0 {
-               compatible = "regulator-fixed";
-               regulator-name = "hdmi-en";
+               main_dc_reg: fixedregulator@1 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "MAIN_DC";
+               };
+
+               mmc_reg: voltage-regulator {
+                       compatible = "regulator-fixed";
+                       regulator-name = "VDD_33ON_2.8V";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       gpio = <&gpx1 1 1>;
+                       enable-active-high;
+               };
+
+               reg_hdmi_en: fixedregulator@0 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "hdmi-en";
+               };
        };
 
        fixed-rate-clocks {
                };
        };
 
-       dp-controller {
+       dp-controller@145B0000 {
                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: fimd@14400000 {
+               status = "okay";
                display-timings {
                        native-mode = <&timing0>;
                        timing0: timing@0 {
        rtc {
                status = "okay";
        };
+
+       usb_hub_bus {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               // SMSC USB3503 connected in hardware only mode as a PHY
+               usb_hub: usb_hub {
+                       compatible = "smsc,usb3503a";
+
+                       reset-gpios = <&gpx3 5 1>;
+                       connect-gpios = <&gpd1 7 1>;
+               };
+       };
+
+       usb@12110000 {
+               usb-phy = <&usb2_phy>;
+       };
 };
index 49f18c2..2538b32 100644 (file)
                samsung,vbus-gpio = <&gpx2 6 0>;
        };
 
-       dp-controller {
+       dp-controller@145B0000 {
                samsung,color-space = <0>;
                samsung,dynamic-range = <0>;
                samsung,ycbcr-coeff = <0>;
 
                pinctrl-names = "default";
                pinctrl-0 = <&dp_hpd>;
+               status = "okay";
        };
 
-       display-timings {
-               native-mode = <&timing0>;
-               timing0: timing@0 {
-                       /* 1280x800 */
-                       clock-frequency = <50000>;
-                       hactive = <1280>;
-                       vactive = <800>;
-                       hfront-porch = <4>;
-                       hback-porch = <4>;
-                       hsync-len = <4>;
-                       vback-porch = <4>;
-                       vfront-porch = <4>;
-                       vsync-len = <4>;
+       fimd@14400000 {
+               status = "okay";
+               display-timings {
+                       native-mode = <&timing0>;
+                       timing0: timing@0 {
+                               /* 1280x800 */
+                               clock-frequency = <50000>;
+                               hactive = <1280>;
+                               vactive = <800>;
+                               hfront-porch = <4>;
+                               hback-porch = <4>;
+                               hsync-len = <4>;
+                               vback-porch = <4>;
+                               vfront-porch = <4>;
+                               vsync-len = <4>;
+                       };
                };
        };
 
index 376090f..f7e2d34 100644 (file)
                };
        };
 
-       pd_gsc: gsc-power-domain@0x10044000 {
+       pd_gsc: gsc-power-domain@10044000 {
                compatible = "samsung,exynos4210-pd";
                reg = <0x10044000 0x20>;
        };
 
-       pd_mfc: mfc-power-domain@0x10044040 {
+       pd_mfc: mfc-power-domain@10044040 {
                compatible = "samsung,exynos4210-pd";
                reg = <0x10044040 0x20>;
        };
 
-       clock: clock-controller@0x10010000 {
+       clock: clock-controller@10010000 {
                compatible = "samsung,exynos5250-clock";
                reg = <0x10010000 0x30000>;
                #clock-cells = <1>;
                clock-names = "watchdog";
        };
 
+       g2d@10850000 {
+               compatible = "samsung,exynos5250-g2d";
+               reg = <0x10850000 0x1000>;
+               interrupts = <0 91 0>;
+               clocks = <&clock 345>;
+               clock-names = "fimg2d";
+       };
+
        codec@11000000 {
                compatible = "samsung,mfc-v6";
                reg = <0x11000000 0x10000>;
                interrupts = <0 96 0>;
                samsung,power-domain = <&pd_mfc>;
+               clocks = <&clock 266>;
+               clock-names = "mfc";
        };
 
        rtc {
                };
        };
 
-       gsc_0:  gsc@0x13e00000 {
+       gsc_0:  gsc@13e00000 {
                compatible = "samsung,exynos5-gsc";
                reg = <0x13e00000 0x1000>;
                interrupts = <0 85 0>;
                clock-names = "gscl";
        };
 
-       gsc_1:  gsc@0x13e10000 {
+       gsc_1:  gsc@13e10000 {
                compatible = "samsung,exynos5-gsc";
                reg = <0x13e10000 0x1000>;
                interrupts = <0 86 0>;
                clock-names = "gscl";
        };
 
-       gsc_2:  gsc@0x13e20000 {
+       gsc_2:  gsc@13e20000 {
                compatible = "samsung,exynos5-gsc";
                reg = <0x13e20000 0x1000>;
                interrupts = <0 87 0>;
                clock-names = "gscl";
        };
 
-       gsc_3:  gsc@0x13e30000 {
+       gsc_3:  gsc@13e30000 {
                compatible = "samsung,exynos5-gsc";
                reg = <0x13e30000 0x1000>;
                interrupts = <0 88 0>;
                interrupts = <0 94 0>;
        };
 
-       dp-controller {
-               compatible = "samsung,exynos5-dp";
-               reg = <0x145b0000 0x1000>;
-               interrupts = <10 3>;
-               interrupt-parent = <&combiner>;
+       dp_phy: video-phy@10040720 {
+               compatible = "samsung,exynos5250-dp-video-phy";
+               reg = <0x10040720 4>;
+               #phy-cells = <0>;
+       };
+
+       dp-controller@145B0000 {
                clocks = <&clock 342>;
                clock-names = "dp";
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               dptx-phy {
-                       reg = <0x10040720>;
-                       samsung,enable-mask = <1>;
-               };
+               phys = <&dp_phy>;
+               phy-names = "dp";
        };
 
-       fimd {
-               compatible = "samsung,exynos5250-fimd";
-               interrupt-parent = <&combiner>;
-               reg = <0x14400000 0x40000>;
-               interrupt-names = "fifo", "vsync", "lcd_sys";
-               interrupts = <18 4>, <18 5>, <18 6>;
+       fimd@14400000 {
                clocks = <&clock 133>, <&clock 339>;
                clock-names = "sclk_fimd", "fimd";
        };
index 5848c42..e695aba 100644 (file)
                        interrupt-controller;
                        #interrupt-cells = <2>;
                };
+
+               dp_hpd: dp_hpd {
+                       samsung,pins = "gpx0-7";
+                       samsung,pin-function = <3>;
+                       samsung,pin-pud = <0>;
+                       samaung,pin-drv = <0>;
+               };
        };
 
        pinctrl@13410000 {
index 08607df..bafba25 100644 (file)
                        clock-frequency = <24000000>;
                };
        };
+
+       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>;
+                       };
+               };
+       };
+
 };
index 8c54c4b..5353e32 100644 (file)
  */
 
 #include "exynos5.dtsi"
-/include/ "exynos5420-pinctrl.dtsi"
+#include "exynos5420-pinctrl.dtsi"
+
+#include <dt-bindings/clk/exynos-audss-clk.h>
+
 / {
        compatible = "samsung,exynos5420";
 
                };
        };
 
-       clock: clock-controller@0x10010000 {
+       clock: clock-controller@10010000 {
                compatible = "samsung,exynos5420-clock";
                reg = <0x10010000 0x30000>;
                #clock-cells = <1>;
        };
 
+       clock_audss: audss-clock-controller@3810000 {
+               compatible = "samsung,exynos5420-audss-clock";
+               reg = <0x03810000 0x0C>;
+               #clock-cells = <1>;
+               clocks = <&clock 148>;
+               clock-names = "sclk_audio";
+       };
+
+       codec@11000000 {
+               compatible = "samsung,mfc-v7";
+               reg = <0x11000000 0x10000>;
+               interrupts = <0 96 0>;
+               clocks = <&clock 401>;
+               clock-names = "mfc";
+       };
+
        mct@101C0000 {
                compatible = "samsung,exynos4210-mct";
                reg = <0x101C0000 0x800>;
                };
        };
 
+       gsc_pd: power-domain@10044000 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10044000 0x20>;
+       };
+
+       isp_pd: power-domain@10044020 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10044020 0x20>;
+       };
+
+       mfc_pd: power-domain@10044060 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10044060 0x20>;
+       };
+
+       disp_pd: power-domain@100440C0 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x100440C0 0x20>;
+       };
+
+       mau_pd: power-domain@100440E0 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x100440E0 0x20>;
+       };
+
+       g2d_pd: power-domain@10044100 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10044100 0x20>;
+       };
+
+       msc_pd: power-domain@10044120 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10044120 0x20>;
+       };
+
        pinctrl_0: pinctrl@13400000 {
                compatible = "samsung,exynos5420-pinctrl";
                reg = <0x13400000 0x1000>;
                clocks = <&clock 260>, <&clock 131>;
                clock-names = "uart", "clk_uart_baud0";
        };
+
+       dp_phy: video-phy@10040728 {
+               compatible = "samsung,exynos5250-dp-video-phy";
+               reg = <0x10040728 4>;
+               #phy-cells = <0>;
+       };
+
+       dp-controller@145B0000 {
+               clocks = <&clock 412>;
+               clock-names = "dp";
+               phys = <&dp_phy>;
+               phy-names = "dp";
+       };
+
+       fimd@14400000 {
+               samsung,power-domain = <&disp_pd>;
+               clocks = <&clock 147>, <&clock 421>;
+               clock-names = "sclk_fimd", "fimd";
+       };
 };
index 586134e..5d6cf49 100644 (file)
 
        aliases {
                spi0 = &spi_0;
+               tmuctrl0 = &tmuctrl_0;
+               tmuctrl1 = &tmuctrl_1;
+               tmuctrl2 = &tmuctrl_2;
        };
 
-       clock: clock-controller@0x160000 {
+       clock: clock-controller@160000 {
                compatible = "samsung,exynos5440-clock";
                reg = <0x160000 0x1000>;
                #clock-cells = <1>;
                clock-names = "rtc";
        };
 
+       tmuctrl_0: tmuctrl@160118 {
+               compatible = "samsung,exynos5440-tmu";
+               reg = <0x160118 0x230>, <0x160368 0x10>;
+               interrupts = <0 58 0>;
+               clocks = <&clock 21>;
+               clock-names = "tmu_apbif";
+       };
+
+       tmuctrl_1: tmuctrl@16011C {
+               compatible = "samsung,exynos5440-tmu";
+               reg = <0x16011C 0x230>, <0x160368 0x10>;
+               interrupts = <0 58 0>;
+               clocks = <&clock 21>;
+               clock-names = "tmu_apbif";
+       };
+
+       tmuctrl_2: tmuctrl@160120 {
+               compatible = "samsung,exynos5440-tmu";
+               reg = <0x160120 0x230>, <0x160368 0x10>;
+               interrupts = <0 58 0>;
+               clocks = <&clock 21>;
+               clock-names = "tmu_apbif";
+       };
+
        sata@210000 {
                compatible = "snps,exynos5440-ahci";
                reg = <0x210000 0x10000>;
index da0588a..185c7c0 100644 (file)
                };
 
                apbx@80040000 {
+                       lradc@80050000 {
+                               status = "okay";
+                               fsl,lradc-touchscreen-wires = <4>;
+                       };
+
                        pwm: pwm@80064000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&pwm2_pins_a>;
                                pinctrl-0 = <&duart_pins_a>;
                                status = "okay";
                        };
+
+                       usbphy0: usbphy@8007c000 {
+                               status = "okay";
+                       };
+               };
+       };
+
+       ahb@80080000 {
+               usb0: usb@80080000 {
+                       status = "okay";
                };
        };
 
index d107c4a..fc766ae 100644 (file)
                };
 
                apbx@80040000 {
+                       lradc@80050000 {
+                               status = "okay";
+                       };
+
                        duart: serial@80070000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&duart_pins_a>;
index 587ceef..28b5ce2 100644 (file)
@@ -20,6 +20,8 @@
                gpio2 = &gpio2;
                serial0 = &auart0;
                serial1 = &auart1;
+               spi0 = &ssp0;
+               spi1 = &ssp1;
        };
 
        cpus {
                                #size-cells = <1>;
                                reg = <0x8000c000 0x2000>, <0x8000a000 0x2000>;
                                reg-names = "gpmi-nand", "bch";
-                               interrupts = <13>, <56>;
-                               interrupt-names = "gpmi-dma", "bch";
+                               interrupts = <56>;
+                               interrupt-names = "bch";
                                clocks = <&clks 34>;
                                clock-names = "gpmi_io";
                                dmas = <&dma_apbh 4>;
                                dma-names = "rx-tx";
-                               fsl,gpmi-dma-channel = <4>;
                                status = "disabled";
                        };
 
                        ssp0: ssp@80010000 {
                                reg = <0x80010000 0x2000>;
-                               interrupts = <15 14>;
+                               interrupts = <15>;
                                clocks = <&clks 33>;
                                dmas = <&dma_apbh 1>;
                                dma-names = "rx-tx";
-                               fsl,ssp-dma-channel = <1>;
                                status = "disabled";
                        };
 
 
                        ssp1: ssp@80034000 {
                                reg = <0x80034000 0x2000>;
-                               interrupts = <2 20>;
+                               interrupts = <2>;
                                clocks = <&clks 33>;
                                dmas = <&dma_apbh 2>;
                                dma-names = "rx-tx";
-                               fsl,ssp-dma-channel = <2>;
                                status = "disabled";
                        };
 
                        auart0: serial@8006c000 {
                                compatible = "fsl,imx23-auart";
                                reg = <0x8006c000 0x2000>;
-                               interrupts = <24 25 23>;
+                               interrupts = <24>;
                                clocks = <&clks 32>;
                                dmas = <&dma_apbx 6>, <&dma_apbx 7>;
                                dma-names = "rx", "tx";
                        auart1: serial@8006e000 {
                                compatible = "fsl,imx23-auart";
                                reg = <0x8006e000 0x2000>;
-                               interrupts = <59 60 58>;
+                               interrupts = <59>;
                                clocks = <&clks 32>;
                                dmas = <&dma_apbx 8>, <&dma_apbx 9>;
                                dma-names = "rx", "tx";
index 7011539..737ed5d 100644 (file)
 
 / {
        aliases {
+               gpio0 = &gpio1;
+               gpio1 = &gpio2;
+               gpio2 = &gpio3;
+               gpio3 = &gpio4;
+               i2c0 = &i2c1;
+               i2c1 = &i2c2;
+               i2c2 = &i2c3;
                serial0 = &uart1;
                serial1 = &uart2;
                serial2 = &uart3;
                serial3 = &uart4;
                serial4 = &uart5;
-               gpio0 = &gpio1;
-               gpio1 = &gpio2;
-               gpio2 = &gpio3;
-               gpio3 = &gpio4;
+               spi0 = &spi1;
+               spi1 = &spi2;
+               spi2 = &spi3;
                usb0 = &usbotg;
                usb1 = &usbhost1;
        };
 
+       cpus {
+               #address-cells = <0>;
+               #size-cells = <0>;
+
+               cpu {
+                       compatible = "arm,arm926ej-s";
+                       device_type = "cpu";
+               };
+       };
+
        asic: asic-interrupt-controller@68000000 {
                compatible = "fsl,imx25-asic", "fsl,avic";
                interrupt-controller;
                                status = "disabled";
                        };
 
-                       lcdc@53fbc000 {
+                       lcdc: lcdc@53fbc000 {
+                               compatible = "fsl,imx25-fb", "fsl,imx21-fb";
                                reg = <0x53fbc000 0x4000>;
                                interrupts = <39>;
                                clocks = <&clks 103>, <&clks 66>, <&clks 49>;
                                reg = <0x53fd4000 0x4000>;
                                clocks = <&clks 112>, <&clks 68>;
                                clock-names = "ipg", "ahb";
+                               #dma-cells = <3>;
                                interrupts = <34>;
                        };
 
                                interrupts = <26>;
                        };
 
+                       iim: iim@53ff0000 {
+                               compatible = "fsl,imx25-iim", "fsl,imx27-iim";
+                               reg = <0x53ff0000 0x4000>;
+                               interrupts = <19>;
+                               clocks = <&clks 99>;
+                       };
+
                        usbphy1: usbphy@1 {
                                compatible = "nop-usbphy";
                                status = "disabled";
index 66b8e1c..2a377ca 100644 (file)
 &i2c1 {
        clock-frequency = <400000>;
        status = "okay";
+
+       rtc@68 {
+               compatible = "dallas,ds1374";
+               reg = <0x68>;
+       };
 };
 
 &i2c2 {
diff --git a/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts b/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts
new file mode 100644 (file)
index 0000000..5a31c77
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2012 Markus Pargmann, Pengutronix
+ *
+ * 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 "imx27-phytec-phycard-s-som.dts"
+
+/ {
+       model = "Phytec pca100 rapid development kit";
+       compatible = "phytec,imx27-pca100-rdk", "phytec,imx27-pca100", "fsl,imx27";
+
+       display: display {
+               model = "Primeview-PD050VL1";
+               native-mode = <&timing0>;
+               bits-per-pixel = <16>;  /* non-standard but required */
+               fsl,pcr = <0xf0c88080>; /* non-standard but required */
+               display-timings {
+                       timing0: 640x480 {
+                               hactive = <640>;
+                               vactive = <480>;
+                               hback-porch = <112>;
+                               hfront-porch = <36>;
+                               hsync-len = <32>;
+                               vback-porch = <33>;
+                               vfront-porch = <33>;
+                               vsync-len = <2>;
+                               clock-frequency = <25000000>;
+                       };
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+
+               reg_3v3: 3v3 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "3V3";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+       };
+};
+
+&fb {
+       display = <&display>;
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+
+       rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+       };
+
+       adc@64 {
+               compatible = "maxim,max1037";
+               vcc-supply = <&reg_3v3>;
+               reg = <0x64>;
+       };
+};
+
+&owire {
+       status = "okay";
+};
+
+&sdhci2 {
+       cd-gpios = <&gpio3 29 0>;
+       status = "okay";
+};
+
+&uart1 {
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
+
+&uart2 {
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
+
+&uart3 {
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dts b/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dts
new file mode 100644 (file)
index 0000000..c8d57d1
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2012 Sascha Hauer, Uwe Kleine-König, Steffen Trumtrar
+ * and Markus Pargmann, Pengutronix
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "imx27.dtsi"
+
+/ {
+       model = "Phytec pca100";
+       compatible = "phytec,imx27-pca100", "fsl,imx27";
+
+       memory {
+               reg = <0xa0000000 0x08000000>; /* 128MB */
+       };
+};
+
+&cspi1 {
+       fsl,spi-num-chipselects = <2>;
+       cs-gpios = <&gpio4 28 0>,
+               <&gpio4 27 0>;
+       status = "okay";
+};
+
+&fec {
+       status = "okay";
+};
+
+&i2c2 {
+       status = "okay";
+
+       at24@52 {
+               compatible = "at,24c32";
+               pagesize = <32>;
+               reg = <0x52>;
+       };
+};
index e7ed978..0fc6551 100644 (file)
        fsl,uart-has-rtscts;
        status = "okay";
 };
+
+&weim {
+       can@d4000000 {
+               compatible = "nxp,sja1000";
+               reg = <4 0x00000000 0x00000100>;
+               interrupt-parent = <&gpio5>;
+               interrupts = <19 0x2>;
+               nxp,external-clock-frequency = <16000000>;
+               nxp,tx-output-config = <0x16>;
+               nxp,no-comparator-bypass;
+               fsl,weim-cs-timing = <0x0000dcf6 0x444a0301 0x44443302>;
+       };
+};
index f010565..4ec402c 100644 (file)
        compatible = "phytec,imx27-pcm038", "fsl,imx27";
 
        memory {
-               reg = <0x0 0x0>;
+               reg = <0xa0000000 0x08000000>;
        };
+};
 
-       soc {
-               aipi@10000000 { /* aipi1 */
-                       serial@1000a000 {
-                               status = "okay";
-                       };
-
-                       i2c@1001d000 {
-                               clock-frequency = <400000>;
-                               status = "okay";
-                               at24@52 {
-                                       compatible = "at,24c32";
-                                       pagesize = <32>;
-                                       reg = <0x52>;
-                               };
-                               pcf8563@51 {
-                                       compatible = "nxp,pcf8563";
-                                       reg = <0x51>;
-                               };
-                               lm75@4a {
-                                       compatible = "national,lm75";
-                                       reg = <0x4a>;
-                               };
-                       };
-               };
+&audmux {
+       status = "okay";
 
-               aipi@10020000 { /* aipi2 */
-                       ethernet@1002b000 {
-                               phy-reset-gpios = <&gpio3 30 0>;
-                               status = "okay";
-                       };
-               };
+       /* SSI0 <=> PINS_4 (MC13783 Audio) */
+       ssi0 {
+               fsl,audmux-port = <0>;
+               fsl,port-config = <0xcb205000>;
        };
 
-       nor_flash@c0000000 {
-               compatible = "cfi-flash";
-               bank-width = <2>;
-               reg = <0xc0000000 0x02000000>;
-               linux,mtd-name = "physmap-flash.0";
-               #address-cells = <1>;
-               #size-cells = <1>;
+       pins4 {
+               fsl,audmux-port = <2>;
+               fsl,port-config = <0x00001000>;
        };
 };
 
                fsl,mc13xxx-uses-rtc;
 
                regulators {
-                       sw1a_reg: sw1a {
+                       /* SW1A and SW1B joined operation */
+                       sw1_reg: sw1a {
                                regulator-min-microvolt = <1200000>;
-                               regulator-max-microvolt = <1200000>;
+                               regulator-max-microvolt = <1520000>;
                                regulator-always-on;
                                regulator-boot-on;
                        };
 
-                       sw1b_reg: sw1b {
-                               regulator-min-microvolt = <1200000>;
-                               regulator-max-microvolt = <1200000>;
-                               regulator-always-on;
-                               regulator-boot-on;
-                       };
-
-                       sw2a_reg: sw2a {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-always-on;
-                               regulator-boot-on;
-                       };
-
-                       sw2b_reg: sw2b {
+                       /* SW2A and SW2B joined operation */
+                       sw2_reg: sw2a {
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
        };
 };
 
+&fec {
+       phy-reset-gpios = <&gpio3 30 0>;
+       status = "okay";
+};
+
+&i2c2 {
+       clock-frequency = <400000>;
+       status = "okay";
+
+       at24@52 {
+               compatible = "at,24c32";
+               pagesize = <32>;
+               reg = <0x52>;
+       };
+
+       pcf8563@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+       };
+
+       lm75@4a {
+               compatible = "national,lm75";
+               reg = <0x4a>;
+       };
+};
+
 &nfc {
        nand-bus-width = <8>;
        nand-ecc-mode = "hw";
        status = "okay";
 };
+
+&uart1 {
+       status = "okay";
+};
+
+&weim {
+       status = "okay";
+
+       nor: nor@c0000000 {
+               compatible = "cfi-flash";
+               reg = <0 0x00000000 0x02000000>;
+               bank-width = <2>;
+               linux,mtd-name = "physmap-flash.0";
+               fsl,weim-cs-timing = <0x22c2cf00 0x75000d01 0x00000900>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+
+       sram: sram@c8000000 {
+               compatible = "mtd-ram";
+               reg = <1 0x00000000 0x00800000>;
+               bank-width = <2>;
+               linux,mtd-name = "mtd-ram.0";
+               fsl,weim-cs-timing = <0x0000d843 0x22252521 0x22220a00>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+       };
+};
index 0695264..c037c22 100644 (file)
 
 / {
        aliases {
-               serial0 = &uart1;
-               serial1 = &uart2;
-               serial2 = &uart3;
-               serial3 = &uart4;
-               serial4 = &uart5;
-               serial5 = &uart6;
                gpio0 = &gpio1;
                gpio1 = &gpio2;
                gpio2 = &gpio3;
                gpio3 = &gpio4;
                gpio4 = &gpio5;
                gpio5 = &gpio6;
+               i2c0 = &i2c1;
+               i2c1 = &i2c2;
+               serial0 = &uart1;
+               serial1 = &uart2;
+               serial2 = &uart3;
+               serial3 = &uart4;
+               serial4 = &uart5;
+               serial5 = &uart6;
                spi0 = &cspi1;
                spi1 = &cspi2;
                spi2 = &cspi3;
        };
 
-       avic: avic-interrupt-controller@e0000000 {
-               compatible = "fsl,imx27-avic", "fsl,avic";
+       aitc: aitc-interrupt-controller@e0000000 {
+               compatible = "fsl,imx27-aitc", "fsl,avic";
                interrupt-controller;
                #interrupt-cells = <1>;
                reg = <0x10040000 0x1000>;
                };
        };
 
+       cpus {
+               #size-cells = <0>;
+               #address-cells = <1>;
+
+               cpu: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,arm926ej-s";
+                       operating-points = <
+                               /* kHz uV */
+                               266000 1300000
+                               399000 1450000
+                       >;
+                       clock-latency = <62500>;
+                       clocks = <&clks 18>;
+                       voltage-tolerance = <5>;
+               };
+       };
+
        soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
-               interrupt-parent = <&avic>;
+               interrupt-parent = <&aitc>;
                ranges;
 
                aipi@10000000 { /* AIPI1 */
@@ -75,7 +95,7 @@
                                compatible = "fsl,imx27-wdt", "fsl,imx21-wdt";
                                reg = <0x10002000 0x1000>;
                                interrupts = <27>;
-                               clocks = <&clks 0>;
+                               clocks = <&clks 74>;
                        };
 
                        gpt1: timer@10003000 {
                                clock-names = "ipg", "per";
                        };
 
-                       pwm0: pwm@10006000 {
+                       pwm: pwm@10006000 {
                                compatible = "fsl,imx27-pwm";
                                reg = <0x10006000 0x1000>;
                                interrupts = <23>;
                                clock-names = "ipg", "per";
                        };
 
+                       kpp: kpp@10008000 {
+                               compatible = "fsl,imx27-kpp", "fsl,imx21-kpp";
+                               reg = <0x10008000 0x1000>;
+                               interrupts = <21>;
+                               clocks = <&clks 37>;
+                               status = "disabled";
+                       };
+
+                       owire: owire@10009000 {
+                               compatible = "fsl,imx27-owire", "fsl,imx21-owire";
+                               reg = <0x10009000 0x1000>;
+                               clocks = <&clks 35>;
+                               status = "disabled";
+                       };
+
                        uart1: serial@1000a000 {
                                compatible = "fsl,imx27-uart", "fsl,imx21-uart";
                                reg = <0x1000a000 0x1000>;
                                #interrupt-cells = <2>;
                        };
 
+                       audmux: audmux@10016000 {
+                               compatible = "fsl,imx27-audmux", "fsl,imx21-audmux";
+                               reg = <0x10016000 0x1000>;
+                               clocks = <&clks 0>;
+                               clock-names = "audmux";
+                               status = "disabled";
+                       };
+
                        cspi3: cspi@10017000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                        reg = <0x10020000 0x20000>;
                        ranges;
 
+                       fb: fb@10021000 {
+                               compatible = "fsl,imx27-fb", "fsl,imx21-fb";
+                               interrupts = <61>;
+                               reg = <0x10021000 0x1000>;
+                               clocks = <&clks 36>, <&clks 65>, <&clks 59>;
+                               clock-names = "ipg", "ahb", "per";
+                               status = "disabled";
+                       };
+
                        coda: coda@10023000 {
                                compatible = "fsl,imx27-vpu";
                                reg = <0x10023000 0x0200>;
                                iram = <&iram>;
                        };
 
+                       sahara2: sahara@10025000 {
+                               compatible = "fsl,imx27-sahara";
+                               reg = <0x10025000 0x1000>;
+                               interrupts = <59>;
+                               clocks = <&clks 32>, <&clks 64>;
+                               clock-names = "ipg", "ahb";
+                       };
+
                        clks: ccm@10027000{
                                compatible = "fsl,imx27-ccm";
                                reg = <0x10027000 0x1000>;
                                #clock-cells = <1>;
                        };
 
+                       iim: iim@10028000 {
+                               compatible = "fsl,imx27-iim";
+                               reg = <0x10028000 0x1000>;
+                               interrupts = <62>;
+                               clocks = <&clks 38>;
+                       };
+
                        fec: ethernet@1002b000 {
                                compatible = "fsl,imx27-fec";
                                reg = <0x1002b000 0x4000>;
                                interrupts = <50>;
-                               clocks = <&clks 48>, <&clks 67>, <&clks 0>;
-                               clock-names = "ipg", "ahb", "ptp";
+                               clocks = <&clks 48>, <&clks 67>;
+                               clock-names = "ipg", "ahb";
                                status = "disabled";
                        };
                };
 
-               iram: iram@ffff4c00 {
-                       compatible = "mmio-sram";
-                       reg = <0xffff4c00 0xb400>;
-               };
-
                nfc: nand@d8000000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        clocks = <&clks 54>;
                        status = "disabled";
                };
+
+               weim: weim@d8002000 {
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       compatible = "fsl,imx27-weim";
+                       reg = <0xd8002000 0x1000>;
+                       clocks = <&clks 0>;
+                       ranges = <
+                               0 0 0xc0000000 0x08000000
+                               1 0 0xc8000000 0x08000000
+                               2 0 0xd0000000 0x02000000
+                               3 0 0xd2000000 0x02000000
+                               4 0 0xd4000000 0x02000000
+                               5 0 0xd6000000 0x02000000
+                       >;
+                       status = "disabled";
+               };
+
+               iram: iram@ffff4c00 {
+                       compatible = "mmio-sram";
+                       reg = <0xffff4c00 0xb400>;
+               };
        };
 };
index 94c4476..1ec8c94 100644 (file)
        apb@80000000 {
                apbh@80000000 {
                        pinctrl@80018000 {
-                               pinctrl-names = "default";
-                               pinctrl-0 = <&hog_pins_cfa10036>;
-
-                               hog_pins_cfa10036: hog-10036@0 {
+                               ssd1306_cfa10036: ssd1306-10036@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                                0x2073 /* MX28_PAD_SSP0_D7__GPIO_2_7 */
@@ -83,6 +80,8 @@
 
                                ssd1306: oled@3c {
                                        compatible = "solomon,ssd1306fb-i2c";
+                                       pinctrl-names = "default";
+                                       pinctrl-0 = <&ssd1306_cfa10036>;
                                        reg = <0x3c>;
                                        reset-gpios = <&gpio2 7 0>;
                                        solomon,height = <32>;
index c2ef3a3..182b99f 100644 (file)
        apb@80000000 {
                apbh@80000000 {
                        pinctrl@80018000 {
-                               pinctrl-names = "default", "default";
-                               pinctrl-1 = <&hog_pins_cfa10037>;
-
-                               hog_pins_cfa10037: hog-10037@0 {
+                               usb_pins_cfa10037: usb-10037@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                                0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               mac0_pins_cfa10037: mac0-10037@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
                                                0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */
                                        >;
                                        fsl,drive-strength = <0>;
@@ -56,7 +62,8 @@
                mac0: ethernet@800f0000 {
                        phy-mode = "rmii";
                        pinctrl-names = "default";
-                       pinctrl-0 = <&mac0_pins_a>;
+                       pinctrl-0 = <&mac0_pins_a
+                               &mac0_pins_cfa10037>;
                        phy-reset-gpios = <&gpio2 21 0>;
                        phy-reset-duration = <100>;
                        status = "okay";
@@ -68,6 +75,8 @@
 
                reg_usb1_vbus: usb1_vbus {
                        compatible = "regulator-fixed";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&usb_pins_cfa10037>;
                        regulator-name = "usb1_vbus";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
index 04b2f76..06e4cfa 100644 (file)
        apb@80000000 {
                apbh@80000000 {
                        pinctrl@80018000 {
-                               pinctrl-names = "default", "default";
-                               pinctrl-1 = <&hog_pins_cfa10049
-                                       &hog_pins_cfa10049_pullup>;
-
-                               hog_pins_cfa10049: hog-10049@0 {
+                               usb_pins_cfa10049: usb-10049@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                                0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               i2cmux_pins_cfa10049: i2cmux-10049@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
                                                0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */
                                                0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               mac0_pins_cfa10049: mac0-10049@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
                                                0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */
-                                               0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
                                        >;
                                        fsl,drive-strength = <0>;
                                        fsl,voltage = <1>;
                                        fsl,pull-up = <0>;
                                };
 
-                               hog_pins_cfa10049_pullup: hog-10049-pullup@0 {
+                               pca_pins_cfa10049: pca-10049@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                                0x2133 /* MX28_PAD_SSP2_D3__GPIO_2_19 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <1>;
+                               };
+
+                               rotary_pins_cfa10049: rotary-10049@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
                                                0x3183 /* MX28_PAD_I2C0_SCL__GPIO_3_24 */
                                                0x3193 /* MX28_PAD_I2C0_SDA__GPIO_3_25 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <1>;
+                               };
+
+                               rotary_btn_pins_cfa10049: rotary-btn-10049@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
                                                0x31a3 /* MX28_PAD_SAIF_SDATA0__GPIO_3_26 */
-                                               0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
                                        >;
                                        fsl,drive-strength = <0>;
                                        fsl,voltage = <1>;
@@ -60,6 +90,7 @@
                                                0x2103 /* MX28_PAD_SSP2_SCK__GPIO_2_16 */
                                                0x2113 /* MX28_PAD_SSP2_CMD__GPIO_2_17 */
                                                0x2123 /* MX28_PAD_SSP2_D0__GPIO_2_18 */
+                                               0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
                                        >;
                                        fsl,drive-strength = <1>;
                                        fsl,voltage = <1>;
                                        fsl,pull-up = <0>;
                                };
 
+                               lcdif_pins_cfa10049_pullup: lcdif-10049-pullup@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <1>;
+                               };
+
                                w1_gpio_pins: w1-gpio@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                        lcdif@80030000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&lcdif_18bit_pins_cfa10049
-                                            &lcdif_pins_cfa10049>;
+                                            &lcdif_pins_cfa10049
+                                            &lcdif_pins_cfa10049_pullup>;
                                display = <&display>;
                                status = "okay";
 
                                compatible = "i2c-mux-gpio";
                                #address-cells = <1>;
                                #size-cells = <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&i2cmux_pins_cfa10049>;
                                mux-gpios = <&gpio1 22 0 &gpio1 23 0>;
                                i2c-parent = <&i2c1>;
 
 
                                        pca9555: pca9555@20 {
                                                compatible = "nxp,pca9555";
+                                               pinctrl-names = "default";
+                                               pinctrl-0 = <&pca_pins_cfa10049>;
                                                interrupt-parent = <&gpio2>;
                                                interrupts = <19 0x2>;
                                                gpio-controller;
 
                reg_usb1_vbus: usb1_vbus {
                        compatible = "regulator-fixed";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&usb_pins_cfa10049>;
                        regulator-name = "usb1_vbus";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                mac0: ethernet@800f0000 {
                        phy-mode = "rmii";
                        pinctrl-names = "default";
-                       pinctrl-0 = <&mac0_pins_a>;
+                       pinctrl-0 = <&mac0_pins_a
+                               &mac0_pins_cfa10049>;
                        phy-reset-gpios = <&gpio2 21 0>;
                        phy-reset-duration = <100>;
                        status = "okay";
 
        gpio_keys {
                compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&rotary_btn_pins_cfa10049>;
                #address-cells = <1>;
                #size-cells = <0>;
 
 
        rotary {
                compatible = "rotary-encoder";
+               pinctrl-names = "default";
+               pinctrl-0 = <&rotary_pins_cfa10049>;
                gpios = <&gpio3 24 1>, <&gpio3 25 1>;
                linux,axis = <1>; /* REL_Y */
                rotary-encoder,relative-axis;
index 1581112..171bcbe 100644 (file)
        apb@80000000 {
                apbh@80000000 {
                        pinctrl@80018000 {
-                               pinctrl-names = "default", "default";
-                               pinctrl-1 = <&hog_pins_cfa10055
-                                       &hog_pins_cfa10055_pullup>;
-
-                               hog_pins_cfa10055: hog-10055@0 {
-                                       reg = <0>;
-                                       fsl,pinmux-ids = <
-                                               0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
-                                       >;
-                                       fsl,drive-strength = <0>;
-                                       fsl,voltage = <1>;
-                                       fsl,pull-up = <0>;
-                               };
-
-                               hog_pins_cfa10055_pullup: hog-10055-pullup@0 {
-                                       reg = <0>;
-                                       fsl,pinmux-ids = <
-                                               0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
-                                       >;
-                                       fsl,drive-strength = <0>;
-                                       fsl,voltage = <1>;
-                                       fsl,pull-up = <1>;
-                               };
-
                                spi2_pins_cfa10055: spi2-cfa10055@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                                0x2103 /* MX28_PAD_SSP2_SCK__GPIO_2_16 */
                                                0x2113 /* MX28_PAD_SSP2_CMD__GPIO_2_17 */
                                                0x2123 /* MX28_PAD_SSP2_D0__GPIO_2_18 */
+                                               0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
                                        >;
                                        fsl,drive-strength = <1>;
                                        fsl,voltage = <1>;
                                        fsl,voltage = <1>;
                                        fsl,pull-up = <0>;
                                };
+
+                               lcdif_pins_cfa10055_pullup: lcdif-10055-pullup@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <1>;
+                               };
                        };
 
                        lcdif@80030000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&lcdif_18bit_pins_cfa10055
-                                            &lcdif_pins_cfa10055>;
+                                            &lcdif_pins_cfa10055
+                                            &lcdif_pins_cfa10055_pullup>;
                                display = <&display>;
                                status = "okay";
 
diff --git a/arch/arm/boot/dts/imx28-cfa10056.dts b/arch/arm/boot/dts/imx28-cfa10056.dts
new file mode 100644 (file)
index 0000000..b45dd0e
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2013 Free Electrons
+ *
+ * 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
+ */
+
+/*
+ * The CFA-10055 is an expansion board for the CFA-10036 module and
+ * CFA-10037, thus we need to include the CFA-10037 DTS.
+ */
+/include/ "imx28-cfa10037.dts"
+
+/ {
+       model = "Crystalfontz CFA-10056 Board";
+       compatible = "crystalfontz,cfa10056", "crystalfontz,cfa10037", "crystalfontz,cfa10036", "fsl,imx28";
+
+       apb@80000000 {
+               apbh@80000000 {
+                       pinctrl@80018000 {
+                               spi2_pins_cfa10056: spi2-cfa10056@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x2103 /* MX28_PAD_SSP2_SCK__GPIO_2_16 */
+                                               0x2113 /* MX28_PAD_SSP2_CMD__GPIO_2_17 */
+                                               0x2123 /* MX28_PAD_SSP2_D0__GPIO_2_18 */
+                                               0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
+                                       >;
+                                       fsl,drive-strength = <1>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <1>;
+                               };
+
+                               lcdif_pins_cfa10056: lcdif-10056@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x1181 /* MX28_PAD_LCD_RD_E__LCD_VSYNC */
+                                               0x1191 /* MX28_PAD_LCD_WR_RWN__LCD_HSYNC */
+                                               0x11a1 /* MX28_PAD_LCD_RS__LCD_DOTCLK */
+                                               0x11b1 /* MX28_PAD_LCD_CS__LCD_ENABLE */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               lcdif_pins_cfa10056_pullup: lcdif-10056-pullup@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <1>;
+                               };
+                       };
+
+                       lcdif@80030000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&lcdif_24bit_pins_a
+                                               &lcdif_pins_cfa10056
+                                               &lcdif_pins_cfa10056_pullup >;
+                               display = <&display>;
+                               status = "okay";
+
+                               display: display {
+                                       bits-per-pixel = <32>;
+                                       bus-width = <24>;
+
+                                       display-timings {
+                                               native-mode = <&timing0>;
+                                               timing0: timing0 {
+                                                       clock-frequency = <32000000>;
+                                                       hactive = <480>;
+                                                       vactive = <800>;
+                                                       hback-porch = <2>;
+                                                       hfront-porch = <2>;
+                                                       vback-porch = <2>;
+                                                       vfront-porch = <2>;
+                                                       hsync-len = <5>;
+                                                       vsync-len = <5>;
+                                                       hsync-active = <0>;
+                                                       vsync-active = <0>;
+                                                       de-active = <1>;
+                                                       pixelclk-active = <1>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+       };
+
+       spi2 {
+               compatible = "spi-gpio";
+               pinctrl-names = "default";
+               pinctrl-0 = <&spi2_pins_cfa10056>;
+               status = "okay";
+               gpio-sck = <&gpio2 16 0>;
+               gpio-mosi = <&gpio2 17 0>;
+               gpio-miso = <&gpio2 18 0>;
+               cs-gpios = <&gpio3 5 0>;
+               num-chipselects = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               hx8369: hx8369@0 {
+                       compatible = "himax,hx8369a", "himax,hx8369";
+                       reg = <0>;
+                       spi-max-frequency = <100000>;
+                       spi-cpol;
+                       spi-cpha;
+                       gpios-reset = <&gpio3 30 0>;
+               };
+       };
+};
index 2da713c..0333c05 100644 (file)
        apb@80000000 {
                apbh@80000000 {
                        pinctrl@80018000 {
-                               pinctrl-names = "default", "default";
-                               pinctrl-1 = <&hog_pins_cfa10057
-                                       &hog_pins_cfa10057_pullup>;
-
-                               hog_pins_cfa10057: hog-10057@0 {
+                               usb_pins_cfa10057: usb-10057@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                                0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
-                                               0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
                                        >;
                                        fsl,drive-strength = <0>;
                                        fsl,voltage = <1>;
                                        fsl,pull-up = <0>;
                                };
 
-                               hog_pins_cfa10057_pullup: hog-10057-pullup@0 {
-                                       reg = <0>;
-                                       fsl,pinmux-ids = <
-                                               0x2133 /* MX28_PAD_SSP2_D3__GPIO_2_19 */
-                                               0x3183 /* MX28_PAD_I2C0_SCL__GPIO_3_24 */
-                                               0x3193 /* MX28_PAD_I2C0_SDA__GPIO_3_25 */
-                                               0x31a3 /* MX28_PAD_SAIF_SDATA0__GPIO_3_26 */
-                                               0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
-                                       >;
-                                       fsl,drive-strength = <0>;
-                                       fsl,voltage = <1>;
-                                       fsl,pull-up = <1>;
-                               };
-
                                lcdif_18bit_pins_cfa10057: lcdif-18bit@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
 
                reg_usb1_vbus: usb1_vbus {
                        compatible = "regulator-fixed";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&usb_pins_cfa10057>;
                        regulator-name = "usb1_vbus";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
diff --git a/arch/arm/boot/dts/imx28-cfa10058.dts b/arch/arm/boot/dts/imx28-cfa10058.dts
new file mode 100644 (file)
index 0000000..64c64c5
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2013 Crystalfontz America, Inc.
+ * Copyright 2013 Free Electrons
+ *
+ * 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
+ */
+
+/*
+ * The CFA-10058 is an expansion board for the CFA-10036 module, thus we
+ * need to include the CFA-10036 DTS.
+ */
+/include/ "imx28-cfa10036.dts"
+
+/ {
+       model = "Crystalfontz CFA-10058 Board";
+       compatible = "crystalfontz,cfa10058", "crystalfontz,cfa10036", "fsl,imx28";
+
+       apb@80000000 {
+               apbh@80000000 {
+                       pinctrl@80018000 {
+                               usb_pins_cfa10058: usb-10058@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               lcdif_pins_cfa10058: lcdif-10058@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x1181 /* MX28_PAD_LCD_RD_E__LCD_VSYNC */
+                                               0x1191 /* MX28_PAD_LCD_WR_RWN__LCD_HSYNC */
+                                               0x11a1 /* MX28_PAD_LCD_RS__LCD_DOTCLK */
+                                               0x11b1 /* MX28_PAD_LCD_CS__LCD_ENABLE */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+                       };
+
+                       lcdif@80030000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&lcdif_24bit_pins_a
+                                                &lcdif_pins_cfa10058>;
+                               display = <&display>;
+                               status = "okay";
+
+                               display: display {
+                                       bits-per-pixel = <32>;
+                                       bus-width = <24>;
+
+                                       display-timings {
+                                               native-mode = <&timing0>;
+                                               timing0: timing0 {
+                                                       clock-frequency = <30000000>;
+                                                       hactive = <800>;
+                                                       vactive = <480>;
+                                                       hback-porch = <40>;
+                                                       hfront-porch = <40>;
+                                                       vback-porch = <13>;
+                                                       vfront-porch = <29>;
+                                                       hsync-len = <8>;
+                                                       vsync-len = <8>;
+                                                       hsync-active = <0>;
+                                                       vsync-active = <0>;
+                                                       de-active = <1>;
+                                                       pixelclk-active = <1>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+
+               apbx@80040000 {
+                       lradc@80050000 {
+                               fsl,lradc-touchscreen-wires = <4>;
+                               status = "okay";
+                       };
+
+                       pwm: pwm@80064000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pwm3_pins_b>;
+                               status = "okay";
+                       };
+
+                       usbphy1: usbphy@8007e000 {
+                               status = "okay";
+                       };
+               };
+       };
+
+       ahb@80080000 {
+               usb1: usb@80090000 {
+                       vbus-supply = <&reg_usb1_vbus>;
+                       pinctrl-0 = <&usbphy1_pins_a>;
+                       pinctrl-names = "default";
+                       status = "okay";
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+
+               reg_usb1_vbus: usb1_vbus {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&usb_pins_cfa10058>;
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb1_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio0 7 1>;
+               };
+       };
+
+       ahb@80080000 {
+               mac0: ethernet@800f0000 {
+                       phy-mode = "rmii";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mac0_pins_a>;
+                       phy-reset-gpios = <&gpio2 21 0>;
+                       phy-reset-duration = <100>;
+                       status = "okay";
+               };
+       };
+
+       backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm 3 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <6>;
+       };
+};
index 44d9da5..0d322a2 100644 (file)
                                pinctrl-0 = <&auart2_2pins_b>;
                                status = "okay";
                        };
+
+                       pwm: pwm@80064000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pwm4_pins_a>;
+                               status = "okay";
+                       };
                };
        };
 
                };
        };
 
+       backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm 4 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <6>;
+       };
+
        regulators {
                compatible = "simple-bus";
 
index 9524a05..7363fde 100644 (file)
@@ -15,6 +15,8 @@
        interrupt-parent = <&icoll>;
 
        aliases {
+               ethernet0 = &mac0;
+               ethernet1 = &mac1;
                gpio0 = &gpio0;
                gpio1 = &gpio1;
                gpio2 = &gpio2;
@@ -27,8 +29,8 @@
                serial2 = &auart2;
                serial3 = &auart3;
                serial4 = &auart4;
-               ethernet0 = &mac0;
-               ethernet1 = &mac1;
+               spi0 = &ssp1;
+               spi1 = &ssp2;
        };
 
        cpus {
@@ -62,9 +64,9 @@
                                reg = <0x80000000 0x2000>;
                        };
 
-                       hsadc@80002000 {
+                       hsadc: hsadc@80002000 {
                                reg = <0x80002000 0x2000>;
-                               interrupts = <13 87>;
+                               interrupts = <13>;
                                dmas = <&dma_apbh 12>;
                                dma-names = "rx";
                                status = "disabled";
                                clocks = <&clks 25>;
                        };
 
-                       perfmon@80006000 {
+                       perfmon: perfmon@80006000 {
                                reg = <0x80006000 0x800>;
                                interrupts = <27>;
                                status = "disabled";
                        };
 
-                       gpmi-nand@8000c000 {
+                       gpmi: gpmi-nand@8000c000 {
                                compatible = "fsl,imx28-gpmi-nand";
                                #address-cells = <1>;
                                #size-cells = <1>;
                                reg = <0x8000c000 0x2000>, <0x8000a000 0x2000>;
                                reg-names = "gpmi-nand", "bch";
-                               interrupts = <88>, <41>;
-                               interrupt-names = "gpmi-dma", "bch";
+                               interrupts = <41>;
+                               interrupt-names = "bch";
                                clocks = <&clks 50>;
                                clock-names = "gpmi_io";
                                dmas = <&dma_apbh 4>;
                                dma-names = "rx-tx";
-                               fsl,gpmi-dma-channel = <4>;
                                status = "disabled";
                        };
 
                                #address-cells = <1>;
                                #size-cells = <0>;
                                reg = <0x80010000 0x2000>;
-                               interrupts = <96 82>;
+                               interrupts = <96>;
                                clocks = <&clks 46>;
                                dmas = <&dma_apbh 0>;
                                dma-names = "rx-tx";
-                               fsl,ssp-dma-channel = <0>;
                                status = "disabled";
                        };
 
                                #address-cells = <1>;
                                #size-cells = <0>;
                                reg = <0x80012000 0x2000>;
-                               interrupts = <97 83>;
+                               interrupts = <97>;
                                clocks = <&clks 47>;
                                dmas = <&dma_apbh 1>;
                                dma-names = "rx-tx";
-                               fsl,ssp-dma-channel = <1>;
                                status = "disabled";
                        };
 
                                #address-cells = <1>;
                                #size-cells = <0>;
                                reg = <0x80014000 0x2000>;
-                               interrupts = <98 84>;
+                               interrupts = <98>;
                                clocks = <&clks 48>;
                                dmas = <&dma_apbh 2>;
                                dma-names = "rx-tx";
-                               fsl,ssp-dma-channel = <2>;
                                status = "disabled";
                        };
 
                                #address-cells = <1>;
                                #size-cells = <0>;
                                reg = <0x80016000 0x2000>;
-                               interrupts = <99 85>;
+                               interrupts = <99>;
                                clocks = <&clks 49>;
                                dmas = <&dma_apbh 3>;
                                dma-names = "rx-tx";
-                               fsl,ssp-dma-channel = <3>;
                                status = "disabled";
                        };
 
-                       pinctrl@80018000 {
+                       pinctrl: pinctrl@80018000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                compatible = "fsl,imx28-pinctrl", "simple-bus";
                                        fsl,pull-up = <1>;
                                };
 
+                               saif0_pins_b: saif0@1 {
+                                       reg = <1>;
+                                       fsl,pinmux-ids = <
+                                               0x3150 /* MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK */
+                                               0x3160 /* MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK */
+                                               0x3170 /* MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 */
+                                       >;
+                                       fsl,drive-strength = <2>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <1>;
+                               };
+
                                saif1_pins_a: saif1@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                        fsl,pull-up = <0>;
                                };
 
+                               lcdif_sync_pins_a: lcdif-sync@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x11a1 /* MX28_PAD_LCD_RS__LCD_DOTCLK */
+                                               0x11b1 /* MX28_PAD_LCD_CS__LCD_ENABLE */
+                                               0x1181 /* MX28_PAD_LCD_RD_E__LCD_VSYNC */
+                                               0x1191 /* MX28_PAD_LCD_WR_RWN__LCD_HSYNC */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
                                can0_pins_a: can0@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                        fsl,pull-up = <1>;
                                };
 
+                               spi3_pins_a: spi3@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x3082 /* MX28_PAD_AUART2_RX__SSP3_D4 */
+                                               0x3092 /* MX28_PAD_AUART2_TX__SSP3_D5 */
+                                               0x2180 /* MX28_PAD_SSP3_SCK__SSP3_SCK */
+                                               0x2190 /* MX28_PAD_SSP3_MOSI__SSP3_CMD */
+                                               0x21A0 /* MX28_PAD_SSP3_MISO__SSP3_D0 */
+                                               0x21B0 /* MX28_PAD_SSP3_SS0__SSP3_D3 */
+                                       >;
+                                       fsl,drive-strength = <1>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
                                usbphy0_pins_a: usbphy0@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
                                };
                        };
 
-                       digctl@8001c000 {
+                       digctl: digctl@8001c000 {
                                compatible = "fsl,imx28-digctl", "fsl,imx23-digctl";
                                reg = <0x8001c000 0x2000>;
                                interrupts = <89>;
                                status = "disabled";
                        };
 
-                       etm@80022000 {
+                       etm: etm@80022000 {
                                reg = <0x80022000 0x2000>;
                                status = "disabled";
                        };
                                clocks = <&clks 26>;
                        };
 
-                       dcp@80028000 {
+                       dcp: dcp@80028000 {
                                reg = <0x80028000 0x2000>;
                                interrupts = <52 53 54>;
                                compatible = "fsl-dcp";
                        };
 
-                       pxp@8002a000 {
+                       pxp: pxp@8002a000 {
                                reg = <0x8002a000 0x2000>;
                                interrupts = <39>;
                                status = "disabled";
                        };
 
-                       ocotp@8002c000 {
+                       ocotp: ocotp@8002c000 {
                                compatible = "fsl,ocotp";
                                reg = <0x8002c000 0x2000>;
                                status = "disabled";
                                status = "disabled";
                        };
 
-                       lcdif@80030000 {
+                       lcdif: lcdif@80030000 {
                                compatible = "fsl,imx28-lcdif";
                                reg = <0x80030000 0x2000>;
-                               interrupts = <38 86>;
+                               interrupts = <38>;
                                clocks = <&clks 55>;
                                dmas = <&dma_apbh 13>;
                                dma-names = "rx";
                                status = "disabled";
                        };
 
-                       simdbg@8003c000 {
+                       simdbg: simdbg@8003c000 {
                                reg = <0x8003c000 0x200>;
                                status = "disabled";
                        };
 
-                       simgpmisel@8003c200 {
+                       simgpmisel: simgpmisel@8003c200 {
                                reg = <0x8003c200 0x100>;
                                status = "disabled";
                        };
 
-                       simsspsel@8003c300 {
+                       simsspsel: simsspsel@8003c300 {
                                reg = <0x8003c300 0x100>;
                                status = "disabled";
                        };
 
-                       simmemsel@8003c400 {
+                       simmemsel: simmemsel@8003c400 {
                                reg = <0x8003c400 0x100>;
                                status = "disabled";
                        };
 
-                       gpiomon@8003c500 {
+                       gpiomon: gpiomon@8003c500 {
                                reg = <0x8003c500 0x100>;
                                status = "disabled";
                        };
 
-                       simenet@8003c700 {
+                       simenet: simenet@8003c700 {
                                reg = <0x8003c700 0x100>;
                                status = "disabled";
                        };
 
-                       armjtag@8003c800 {
+                       armjtag: armjtag@8003c800 {
                                reg = <0x8003c800 0x100>;
                                status = "disabled";
                        };
-                };
+               };
 
                apbx@80040000 {
                        compatible = "simple-bus";
                        saif0: saif@80042000 {
                                compatible = "fsl,imx28-saif";
                                reg = <0x80042000 0x2000>;
-                               interrupts = <59 80>;
+                               interrupts = <59>;
                                #clock-cells = <0>;
                                clocks = <&clks 53>;
                                dmas = <&dma_apbx 4>;
                                dma-names = "rx-tx";
-                               fsl,saif-dma-channel = <4>;
                                status = "disabled";
                        };
 
-                       power@80044000 {
+                       power: power@80044000 {
                                reg = <0x80044000 0x2000>;
                                status = "disabled";
                        };
                        saif1: saif@80046000 {
                                compatible = "fsl,imx28-saif";
                                reg = <0x80046000 0x2000>;
-                               interrupts = <58 81>;
+                               interrupts = <58>;
                                clocks = <&clks 54>;
                                dmas = <&dma_apbx 5>;
                                dma-names = "rx-tx";
-                               fsl,saif-dma-channel = <5>;
                                status = "disabled";
                        };
 
-                       lradc@80050000 {
+                       lradc: lradc@80050000 {
                                compatible = "fsl,imx28-lradc";
                                reg = <0x80050000 0x2000>;
                                interrupts = <10 14 15 16 17 18 19
                                status = "disabled";
                        };
 
-                       spdif@80054000 {
+                       spdif: spdif@80054000 {
                                reg = <0x80054000 0x2000>;
-                               interrupts = <45 66>;
+                               interrupts = <45>;
                                dmas = <&dma_apbx 2>;
                                dma-names = "tx";
                                status = "disabled";
                        };
 
-                       rtc@80056000 {
+                       mxs_rtc: rtc@80056000 {
                                compatible = "fsl,imx28-rtc", "fsl,stmp3xxx-rtc";
                                reg = <0x80056000 0x2000>;
                                interrupts = <29>;
                                #size-cells = <0>;
                                compatible = "fsl,imx28-i2c";
                                reg = <0x80058000 0x2000>;
-                               interrupts = <111 68>;
+                               interrupts = <111>;
                                clock-frequency = <100000>;
                                dmas = <&dma_apbx 6>;
                                dma-names = "rx-tx";
-                               fsl,i2c-dma-channel = <6>;
                                status = "disabled";
                        };
 
                                #size-cells = <0>;
                                compatible = "fsl,imx28-i2c";
                                reg = <0x8005a000 0x2000>;
-                               interrupts = <110 69>;
+                               interrupts = <110>;
                                clock-frequency = <100000>;
                                dmas = <&dma_apbx 7>;
                                dma-names = "rx-tx";
-                               fsl,i2c-dma-channel = <7>;
                                status = "disabled";
                        };
 
                                status = "disabled";
                        };
 
-                       timrot@80068000 {
+                       timer: timrot@80068000 {
                                compatible = "fsl,imx28-timrot", "fsl,timrot";
                                reg = <0x80068000 0x2000>;
                                interrupts = <48 49 50 51>;
                        auart0: serial@8006a000 {
                                compatible = "fsl,imx28-auart", "fsl,imx23-auart";
                                reg = <0x8006a000 0x2000>;
-                               interrupts = <112 70 71>;
+                               interrupts = <112>;
                                dmas = <&dma_apbx 8>, <&dma_apbx 9>;
                                dma-names = "rx", "tx";
-                               fsl,auart-dma-channel = <8 9>;
                                clocks = <&clks 45>;
                                status = "disabled";
                        };
                        auart1: serial@8006c000 {
                                compatible = "fsl,imx28-auart", "fsl,imx23-auart";
                                reg = <0x8006c000 0x2000>;
-                               interrupts = <113 72 73>;
+                               interrupts = <113>;
                                dmas = <&dma_apbx 10>, <&dma_apbx 11>;
                                dma-names = "rx", "tx";
                                clocks = <&clks 45>;
                        auart2: serial@8006e000 {
                                compatible = "fsl,imx28-auart", "fsl,imx23-auart";
                                reg = <0x8006e000 0x2000>;
-                               interrupts = <114 74 75>;
+                               interrupts = <114>;
                                dmas = <&dma_apbx 12>, <&dma_apbx 13>;
                                dma-names = "rx", "tx";
                                clocks = <&clks 45>;
                        auart3: serial@80070000 {
                                compatible = "fsl,imx28-auart", "fsl,imx23-auart";
                                reg = <0x80070000 0x2000>;
-                               interrupts = <115 76 77>;
+                               interrupts = <115>;
                                dmas = <&dma_apbx 14>, <&dma_apbx 15>;
                                dma-names = "rx", "tx";
                                clocks = <&clks 45>;
                        auart4: serial@80072000 {
                                compatible = "fsl,imx28-auart", "fsl,imx23-auart";
                                reg = <0x80072000 0x2000>;
-                               interrupts = <116 78 79>;
+                               interrupts = <116>;
                                dmas = <&dma_apbx 0>, <&dma_apbx 1>;
                                dma-names = "rx", "tx";
                                clocks = <&clks 45>;
                        status = "disabled";
                };
 
-               dflpt@800c0000 {
+               dflpt: dflpt@800c0000 {
                        reg = <0x800c0000 0x10000>;
                        status = "disabled";
                };
                        status = "disabled";
                };
 
-               switch@800f8000 {
+               etn_switch: switch@800f8000 {
                        reg = <0x800f8000 0x8000>;
                        status = "disabled";
                };
-
        };
 };
index c544925..c34f825 100644 (file)
                serial4 = &uart5;
        };
 
+       cpus {
+               #address-cells = <0>;
+               #size-cells = <0>;
+
+               cpu {
+                       compatible = "arm,arm1136";
+                       device_type = "cpu";
+               };
+       };
+
        avic: avic-interrupt-controller@60000000 {
                compatible = "fsl,imx31-avic", "fsl,avic";
                interrupt-controller;
                                status = "disabled";
                        };
 
+                       iim: iim@5001c000 {
+                               compatible = "fsl,imx31-iim", "fsl,imx27-iim";
+                               reg = <0x5001c000 0x1000>;
+                               interrupts = <19>;
+                               clocks = <&clks 25>;
+                       };
+
                        clks: ccm@53f80000{
                                compatible = "fsl,imx31-ccm";
                                reg = <0x53f80000 0x4000>;
index 8f7f9ac..b360699 100644 (file)
        };
 
        clocks {
-               ckih1 {
-                       clock-frequency = <0>;
-               };
-
                osc {
                        clock-frequency = <33554432>;
                };
index ad3471c..1d337d9 100644 (file)
        };
 
        clocks {
+               ckih1 {
+                       clock-frequency = <22579200>;
+               };
+
                clk_26M: codec_clock {
                        compatible = "fixed-clock";
                        reg=<0>;
                #size-cells = <0>;
                compatible = "fsl,mc13892";
                spi-max-frequency = <6000000>;
+               spi-cs-high;
                reg = <0>;
                interrupt-parent = <&gpio1>;
                interrupts = <8 0x4>;
index 25764b5..a85abb4 100644 (file)
 
 / {
        aliases {
-               serial0 = &uart1;
-               serial1 = &uart2;
-               serial2 = &uart3;
                gpio0 = &gpio1;
                gpio1 = &gpio2;
                gpio2 = &gpio3;
                gpio3 = &gpio4;
+               i2c0 = &i2c1;
+               i2c1 = &i2c2;
+               serial0 = &uart1;
+               serial1 = &uart2;
+               serial2 = &uart3;
+               spi0 = &ecspi1;
+               spi1 = &ecspi2;
+               spi2 = &cspi;
        };
 
        tzic: tz-interrupt-controller@e0000000 {
@@ -42,7 +47,7 @@
 
                ckih1 {
                        compatible = "fsl,imx-ckih1", "fixed-clock";
-                       clock-frequency = <22579200>;
+                       clock-frequency = <0>;
                };
 
                ckih2 {
                                        reg = <0x70014000 0x4000>;
                                        interrupts = <30>;
                                        clocks = <&clks 49>;
+                                       dmas = <&sdma 24 1 0>,
+                                              <&sdma 25 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        fsl,ssi-dma-events = <25 24 23 22>; /* TX0 RX0 TX1 RX1 */
                                        status = "disabled";
                        iomuxc: iomuxc@73fa8000 {
                                compatible = "fsl,imx51-iomuxc";
                                reg = <0x73fa8000 0x4000>;
-
-                               audmux {
-                                       pinctrl_audmux_1: audmuxgrp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_AUD3_BB_TXD__AUD3_TXD 0x80000000
-                                                       MX51_PAD_AUD3_BB_RXD__AUD3_RXD 0x80000000
-                                                       MX51_PAD_AUD3_BB_CK__AUD3_TXC  0x80000000
-                                                       MX51_PAD_AUD3_BB_FS__AUD3_TXFS 0x80000000
-                                               >;
-                                       };
-                               };
-
-                               fec {
-                                       pinctrl_fec_1: fecgrp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_EIM_EB2__FEC_MDIO         0x80000000
-                                                       MX51_PAD_EIM_EB3__FEC_RDATA1       0x80000000
-                                                       MX51_PAD_EIM_CS2__FEC_RDATA2       0x80000000
-                                                       MX51_PAD_EIM_CS3__FEC_RDATA3       0x80000000
-                                                       MX51_PAD_EIM_CS4__FEC_RX_ER        0x80000000
-                                                       MX51_PAD_EIM_CS5__FEC_CRS          0x80000000
-                                                       MX51_PAD_NANDF_RB2__FEC_COL        0x80000000
-                                                       MX51_PAD_NANDF_RB3__FEC_RX_CLK     0x80000000
-                                                       MX51_PAD_NANDF_D9__FEC_RDATA0      0x80000000
-                                                       MX51_PAD_NANDF_D8__FEC_TDATA0      0x80000000
-                                                       MX51_PAD_NANDF_CS2__FEC_TX_ER      0x80000000
-                                                       MX51_PAD_NANDF_CS3__FEC_MDC        0x80000000
-                                                       MX51_PAD_NANDF_CS4__FEC_TDATA1     0x80000000
-                                                       MX51_PAD_NANDF_CS5__FEC_TDATA2     0x80000000
-                                                       MX51_PAD_NANDF_CS6__FEC_TDATA3     0x80000000
-                                                       MX51_PAD_NANDF_CS7__FEC_TX_EN      0x80000000
-                                                       MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK 0x80000000
-                                               >;
-                                       };
-
-                                       pinctrl_fec_2: fecgrp-2 {
-                                               fsl,pins = <
-                                                       MX51_PAD_DI_GP3__FEC_TX_ER        0x80000000
-                                                       MX51_PAD_DI2_PIN4__FEC_CRS        0x80000000
-                                                       MX51_PAD_DI2_PIN2__FEC_MDC        0x80000000
-                                                       MX51_PAD_DI2_PIN3__FEC_MDIO       0x80000000
-                                                       MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x80000000
-                                                       MX51_PAD_DI_GP4__FEC_RDATA2       0x80000000
-                                                       MX51_PAD_DISP2_DAT0__FEC_RDATA3   0x80000000
-                                                       MX51_PAD_DISP2_DAT1__FEC_RX_ER    0x80000000
-                                                       MX51_PAD_DISP2_DAT6__FEC_TDATA1   0x80000000
-                                                       MX51_PAD_DISP2_DAT7__FEC_TDATA2   0x80000000
-                                                       MX51_PAD_DISP2_DAT8__FEC_TDATA3   0x80000000
-                                                       MX51_PAD_DISP2_DAT9__FEC_TX_EN    0x80000000
-                                                       MX51_PAD_DISP2_DAT10__FEC_COL     0x80000000
-                                                       MX51_PAD_DISP2_DAT11__FEC_RX_CLK  0x80000000
-                                                       MX51_PAD_DISP2_DAT12__FEC_RX_DV   0x80000000
-                                                       MX51_PAD_DISP2_DAT13__FEC_TX_CLK  0x80000000
-                                                       MX51_PAD_DISP2_DAT14__FEC_RDATA0  0x80000000
-                                                       MX51_PAD_DISP2_DAT15__FEC_TDATA0  0x80000000
-                                               >;
-                                       };
-                               };
-
-                               ecspi1 {
-                                       pinctrl_ecspi1_1: ecspi1grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x185
-                                                       MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x185
-                                                       MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x185
-                                               >;
-                                       };
-                               };
-
-                               ecspi2 {
-                                       pinctrl_ecspi2_1: ecspi2grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x185
-                                                       MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x185
-                                                       MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x185
-                                               >;
-                                       };
-                               };
-
-                               esdhc1 {
-                                       pinctrl_esdhc1_1: esdhc1grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_SD1_CMD__SD1_CMD     0x400020d5
-                                                       MX51_PAD_SD1_CLK__SD1_CLK     0x20d5
-                                                       MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
-                                                       MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
-                                                       MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
-                                                       MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
-                                               >;
-                                       };
-                               };
-
-                               esdhc2 {
-                                       pinctrl_esdhc2_1: esdhc2grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_SD2_CMD__SD2_CMD     0x400020d5
-                                                       MX51_PAD_SD2_CLK__SD2_CLK     0x20d5
-                                                       MX51_PAD_SD2_DATA0__SD2_DATA0 0x20d5
-                                                       MX51_PAD_SD2_DATA1__SD2_DATA1 0x20d5
-                                                       MX51_PAD_SD2_DATA2__SD2_DATA2 0x20d5
-                                                       MX51_PAD_SD2_DATA3__SD2_DATA3 0x20d5
-                                               >;
-                                       };
-                               };
-
-                               i2c2 {
-                                       pinctrl_i2c2_1: i2c2grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_KEY_COL4__I2C2_SCL 0x400001ed
-                                                       MX51_PAD_KEY_COL5__I2C2_SDA 0x400001ed
-                                               >;
-                                       };
-
-                                       pinctrl_i2c2_2: i2c2grp-2 {
-                                               fsl,pins = <
-                                                       MX51_PAD_EIM_D27__I2C2_SCL 0x400001ed
-                                                       MX51_PAD_EIM_D24__I2C2_SDA 0x400001ed
-                                               >;
-                                       };
-                               };
-
-                               ipu_disp1 {
-                                       pinctrl_ipu_disp1_1: ipudisp1grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_DISP1_DAT0__DISP1_DAT0   0x5
-                                                       MX51_PAD_DISP1_DAT1__DISP1_DAT1   0x5
-                                                       MX51_PAD_DISP1_DAT2__DISP1_DAT2   0x5
-                                                       MX51_PAD_DISP1_DAT3__DISP1_DAT3   0x5
-                                                       MX51_PAD_DISP1_DAT4__DISP1_DAT4   0x5
-                                                       MX51_PAD_DISP1_DAT5__DISP1_DAT5   0x5
-                                                       MX51_PAD_DISP1_DAT6__DISP1_DAT6   0x5
-                                                       MX51_PAD_DISP1_DAT7__DISP1_DAT7   0x5
-                                                       MX51_PAD_DISP1_DAT8__DISP1_DAT8   0x5
-                                                       MX51_PAD_DISP1_DAT9__DISP1_DAT9   0x5
-                                                       MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x5
-                                                       MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x5
-                                                       MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x5
-                                                       MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x5
-                                                       MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x5
-                                                       MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x5
-                                                       MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x5
-                                                       MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x5
-                                                       MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x5
-                                                       MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x5
-                                                       MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x5
-                                                       MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x5
-                                                       MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x5
-                                                       MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x5
-                                                       MX51_PAD_DI1_PIN2__DI1_PIN2       0x5 /* hsync */
-                                                       MX51_PAD_DI1_PIN3__DI1_PIN3       0x5 /* vsync */
-                                               >;
-                                       };
-                               };
-
-                               ipu_disp2 {
-                                       pinctrl_ipu_disp2_1: ipudisp2grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_DISP2_DAT0__DISP2_DAT0     0x5
-                                                       MX51_PAD_DISP2_DAT1__DISP2_DAT1     0x5
-                                                       MX51_PAD_DISP2_DAT2__DISP2_DAT2     0x5
-                                                       MX51_PAD_DISP2_DAT3__DISP2_DAT3     0x5
-                                                       MX51_PAD_DISP2_DAT4__DISP2_DAT4     0x5
-                                                       MX51_PAD_DISP2_DAT5__DISP2_DAT5     0x5
-                                                       MX51_PAD_DISP2_DAT6__DISP2_DAT6     0x5
-                                                       MX51_PAD_DISP2_DAT7__DISP2_DAT7     0x5
-                                                       MX51_PAD_DISP2_DAT8__DISP2_DAT8     0x5
-                                                       MX51_PAD_DISP2_DAT9__DISP2_DAT9     0x5
-                                                       MX51_PAD_DISP2_DAT10__DISP2_DAT10   0x5
-                                                       MX51_PAD_DISP2_DAT11__DISP2_DAT11   0x5
-                                                       MX51_PAD_DISP2_DAT12__DISP2_DAT12   0x5
-                                                       MX51_PAD_DISP2_DAT13__DISP2_DAT13   0x5
-                                                       MX51_PAD_DISP2_DAT14__DISP2_DAT14   0x5
-                                                       MX51_PAD_DISP2_DAT15__DISP2_DAT15   0x5
-                                                       MX51_PAD_DI2_PIN2__DI2_PIN2         0x5 /* hsync */
-                                                       MX51_PAD_DI2_PIN3__DI2_PIN3         0x5 /* vsync */
-                                                       MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK 0x5
-                                                       MX51_PAD_DI_GP4__DI2_PIN15          0x5
-                                               >;
-                                       };
-                               };
-
-                               pata {
-                                       pinctrl_pata_1: patagrp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_NANDF_WE_B__PATA_DIOW          0x2004
-                                                       MX51_PAD_NANDF_RE_B__PATA_DIOR          0x2004
-                                                       MX51_PAD_NANDF_ALE__PATA_BUFFER_EN      0x2004
-                                                       MX51_PAD_NANDF_CLE__PATA_RESET_B        0x2004
-                                                       MX51_PAD_NANDF_WP_B__PATA_DMACK         0x2004
-                                                       MX51_PAD_NANDF_RB0__PATA_DMARQ          0x2004
-                                                       MX51_PAD_NANDF_RB1__PATA_IORDY          0x2004
-                                                       MX51_PAD_GPIO_NAND__PATA_INTRQ          0x2004
-                                                       MX51_PAD_NANDF_CS2__PATA_CS_0           0x2004
-                                                       MX51_PAD_NANDF_CS3__PATA_CS_1           0x2004
-                                                       MX51_PAD_NANDF_CS4__PATA_DA_0           0x2004
-                                                       MX51_PAD_NANDF_CS5__PATA_DA_1           0x2004
-                                                       MX51_PAD_NANDF_CS6__PATA_DA_2           0x2004
-                                                       MX51_PAD_NANDF_D15__PATA_DATA15         0x2004
-                                                       MX51_PAD_NANDF_D14__PATA_DATA14         0x2004
-                                                       MX51_PAD_NANDF_D13__PATA_DATA13         0x2004
-                                                       MX51_PAD_NANDF_D12__PATA_DATA12         0x2004
-                                                       MX51_PAD_NANDF_D11__PATA_DATA11         0x2004
-                                                       MX51_PAD_NANDF_D10__PATA_DATA10         0x2004
-                                                       MX51_PAD_NANDF_D9__PATA_DATA9           0x2004
-                                                       MX51_PAD_NANDF_D8__PATA_DATA8           0x2004
-                                                       MX51_PAD_NANDF_D7__PATA_DATA7           0x2004
-                                                       MX51_PAD_NANDF_D6__PATA_DATA6           0x2004
-                                                       MX51_PAD_NANDF_D5__PATA_DATA5           0x2004
-                                                       MX51_PAD_NANDF_D4__PATA_DATA4           0x2004
-                                                       MX51_PAD_NANDF_D3__PATA_DATA3           0x2004
-                                                       MX51_PAD_NANDF_D2__PATA_DATA2           0x2004
-                                                       MX51_PAD_NANDF_D1__PATA_DATA1           0x2004
-                                                       MX51_PAD_NANDF_D0__PATA_DATA0           0x2004
-                                               >;
-                                       };
-                               };
-
-                               uart1 {
-                                       pinctrl_uart1_1: uart1grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_UART1_RXD__UART1_RXD 0x1c5
-                                                       MX51_PAD_UART1_TXD__UART1_TXD 0x1c5
-                                                       MX51_PAD_UART1_RTS__UART1_RTS 0x1c5
-                                                       MX51_PAD_UART1_CTS__UART1_CTS 0x1c5
-                                               >;
-                                       };
-                               };
-
-                               uart2 {
-                                       pinctrl_uart2_1: uart2grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_UART2_RXD__UART2_RXD 0x1c5
-                                                       MX51_PAD_UART2_TXD__UART2_TXD 0x1c5
-                                               >;
-                                       };
-                               };
-
-                               uart3 {
-                                       pinctrl_uart3_1: uart3grp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_EIM_D25__UART3_RXD 0x1c5
-                                                       MX51_PAD_EIM_D26__UART3_TXD 0x1c5
-                                                       MX51_PAD_EIM_D27__UART3_RTS 0x1c5
-                                                       MX51_PAD_EIM_D24__UART3_CTS 0x1c5
-                                               >;
-                                       };
-
-                                       pinctrl_uart3_2: uart3grp-2 {
-                                               fsl,pins = <
-                                                       MX51_PAD_UART3_RXD__UART3_RXD 0x1c5
-                                                       MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
-                                               >;
-                                       };
-                               };
-
-                               kpp {
-                                       pinctrl_kpp_1: kppgrp-1 {
-                                               fsl,pins = <
-                                                       MX51_PAD_KEY_ROW0__KEY_ROW0 0xe0
-                                                       MX51_PAD_KEY_ROW1__KEY_ROW1 0xe0
-                                                       MX51_PAD_KEY_ROW2__KEY_ROW2 0xe0
-                                                       MX51_PAD_KEY_ROW3__KEY_ROW3 0xe0
-                                                       MX51_PAD_KEY_COL0__KEY_COL0 0xe8
-                                                       MX51_PAD_KEY_COL1__KEY_COL1 0xe8
-                                                       MX51_PAD_KEY_COL2__KEY_COL2 0xe8
-                                                       MX51_PAD_KEY_COL3__KEY_COL3 0xe8
-                                               >;
-                                       };
-                               };
                        };
 
                        pwm1: pwm@73fb4000 {
                        reg = <0x80000000 0x10000000>;
                        ranges;
 
+                       iim: iim@83f98000 {
+                               compatible = "fsl,imx51-iim", "fsl,imx27-iim";
+                               reg = <0x83f98000 0x4000>;
+                               interrupts = <69>;
+                               clocks = <&clks 107>;
+                       };
+
                        ecspi2: ecspi@83fac000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                interrupts = <6>;
                                clocks = <&clks 56>, <&clks 56>;
                                clock-names = "ipg", "ahb";
+                               #dma-cells = <3>;
                                fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin";
                        };
 
                                reg = <0x83fcc000 0x4000>;
                                interrupts = <29>;
                                clocks = <&clks 48>;
+                               dmas = <&sdma 28 0 0>,
+                                      <&sdma 29 0 0>;
+                               dma-names = "rx", "tx";
                                fsl,fifo-depth = <15>;
                                fsl,ssi-dma-events = <29 28 27 26>; /* TX0 RX0 TX1 RX1 */
                                status = "disabled";
                                status = "disabled";
                        };
 
+                       weim: weim@83fda000 {
+                               #address-cells = <2>;
+                               #size-cells = <1>;
+                               compatible = "fsl,imx51-weim";
+                               reg = <0x83fda000 0x1000>;
+                               clocks = <&clks 57>;
+                               ranges = <
+                                       0 0 0xb0000000 0x08000000
+                                       1 0 0xb8000000 0x08000000
+                                       2 0 0xc0000000 0x08000000
+                                       3 0 0xc8000000 0x04000000
+                                       4 0 0xcc000000 0x02000000
+                                       5 0 0xce000000 0x02000000
+                               >;
+                               status = "disabled";
+                       };
+
                        nfc: nand@83fdb000 {
                                compatible = "fsl,imx51-nand";
                                reg = <0x83fdb000 0x1000 0xcfff0000 0x10000>;
                                reg = <0x83fe8000 0x4000>;
                                interrupts = <96>;
                                clocks = <&clks 50>;
+                               dmas = <&sdma 46 0 0>,
+                                      <&sdma 47 0 0>;
+                               dma-names = "rx", "tx";
                                fsl,fifo-depth = <15>;
                                fsl,ssi-dma-events = <47 46 37 35>; /* TX0 RX0 TX1 RX1 */
                                status = "disabled";
                };
        };
 };
+
+&iomuxc {
+       audmux {
+               pinctrl_audmux_1: audmuxgrp-1 {
+                       fsl,pins = <
+                               MX51_PAD_AUD3_BB_TXD__AUD3_TXD 0x80000000
+                               MX51_PAD_AUD3_BB_RXD__AUD3_RXD 0x80000000
+                               MX51_PAD_AUD3_BB_CK__AUD3_TXC  0x80000000
+                               MX51_PAD_AUD3_BB_FS__AUD3_TXFS 0x80000000
+                       >;
+               };
+       };
+
+       fec {
+               pinctrl_fec_1: fecgrp-1 {
+                       fsl,pins = <
+                               MX51_PAD_EIM_EB2__FEC_MDIO         0x80000000
+                               MX51_PAD_EIM_EB3__FEC_RDATA1       0x80000000
+                               MX51_PAD_EIM_CS2__FEC_RDATA2       0x80000000
+                               MX51_PAD_EIM_CS3__FEC_RDATA3       0x80000000
+                               MX51_PAD_EIM_CS4__FEC_RX_ER        0x80000000
+                               MX51_PAD_EIM_CS5__FEC_CRS          0x80000000
+                               MX51_PAD_NANDF_RB2__FEC_COL        0x80000000
+                               MX51_PAD_NANDF_RB3__FEC_RX_CLK     0x80000000
+                               MX51_PAD_NANDF_D9__FEC_RDATA0      0x80000000
+                               MX51_PAD_NANDF_D8__FEC_TDATA0      0x80000000
+                               MX51_PAD_NANDF_CS2__FEC_TX_ER      0x80000000
+                               MX51_PAD_NANDF_CS3__FEC_MDC        0x80000000
+                               MX51_PAD_NANDF_CS4__FEC_TDATA1     0x80000000
+                               MX51_PAD_NANDF_CS5__FEC_TDATA2     0x80000000
+                               MX51_PAD_NANDF_CS6__FEC_TDATA3     0x80000000
+                               MX51_PAD_NANDF_CS7__FEC_TX_EN      0x80000000
+                               MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK 0x80000000
+                       >;
+               };
+
+               pinctrl_fec_2: fecgrp-2 {
+                       fsl,pins = <
+                               MX51_PAD_DI_GP3__FEC_TX_ER        0x80000000
+                               MX51_PAD_DI2_PIN4__FEC_CRS        0x80000000
+                               MX51_PAD_DI2_PIN2__FEC_MDC        0x80000000
+                               MX51_PAD_DI2_PIN3__FEC_MDIO       0x80000000
+                               MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x80000000
+                               MX51_PAD_DI_GP4__FEC_RDATA2       0x80000000
+                               MX51_PAD_DISP2_DAT0__FEC_RDATA3   0x80000000
+                               MX51_PAD_DISP2_DAT1__FEC_RX_ER    0x80000000
+                               MX51_PAD_DISP2_DAT6__FEC_TDATA1   0x80000000
+                               MX51_PAD_DISP2_DAT7__FEC_TDATA2   0x80000000
+                               MX51_PAD_DISP2_DAT8__FEC_TDATA3   0x80000000
+                               MX51_PAD_DISP2_DAT9__FEC_TX_EN    0x80000000
+                               MX51_PAD_DISP2_DAT10__FEC_COL     0x80000000
+                               MX51_PAD_DISP2_DAT11__FEC_RX_CLK  0x80000000
+                               MX51_PAD_DISP2_DAT12__FEC_RX_DV   0x80000000
+                               MX51_PAD_DISP2_DAT13__FEC_TX_CLK  0x80000000
+                               MX51_PAD_DISP2_DAT14__FEC_RDATA0  0x80000000
+                               MX51_PAD_DISP2_DAT15__FEC_TDATA0  0x80000000
+                       >;
+               };
+       };
+
+       ecspi1 {
+               pinctrl_ecspi1_1: ecspi1grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x185
+                               MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x185
+                               MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x185
+                       >;
+               };
+       };
+
+       ecspi2 {
+               pinctrl_ecspi2_1: ecspi2grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x185
+                               MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x185
+                               MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x185
+                       >;
+               };
+       };
+
+       esdhc1 {
+               pinctrl_esdhc1_1: esdhc1grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_SD1_CMD__SD1_CMD     0x400020d5
+                               MX51_PAD_SD1_CLK__SD1_CLK     0x20d5
+                               MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
+                               MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
+                               MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
+                               MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
+                       >;
+               };
+       };
+
+       esdhc2 {
+               pinctrl_esdhc2_1: esdhc2grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_SD2_CMD__SD2_CMD     0x400020d5
+                               MX51_PAD_SD2_CLK__SD2_CLK     0x20d5
+                               MX51_PAD_SD2_DATA0__SD2_DATA0 0x20d5
+                               MX51_PAD_SD2_DATA1__SD2_DATA1 0x20d5
+                               MX51_PAD_SD2_DATA2__SD2_DATA2 0x20d5
+                               MX51_PAD_SD2_DATA3__SD2_DATA3 0x20d5
+                       >;
+               };
+       };
+
+       i2c2 {
+               pinctrl_i2c2_1: i2c2grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_KEY_COL4__I2C2_SCL 0x400001ed
+                               MX51_PAD_KEY_COL5__I2C2_SDA 0x400001ed
+                       >;
+               };
+
+               pinctrl_i2c2_2: i2c2grp-2 {
+                       fsl,pins = <
+                               MX51_PAD_EIM_D27__I2C2_SCL 0x400001ed
+                               MX51_PAD_EIM_D24__I2C2_SDA 0x400001ed
+                       >;
+               };
+
+               pinctrl_i2c2_3: i2c2grp-3 {
+                       fsl,pins = <
+                               MX51_PAD_GPIO1_2__I2C2_SCL 0x400001ed
+                               MX51_PAD_GPIO1_3__I2C2_SDA 0x400001ed
+                       >;
+               };
+       };
+
+       ipu_disp1 {
+               pinctrl_ipu_disp1_1: ipudisp1grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_DISP1_DAT0__DISP1_DAT0   0x5
+                               MX51_PAD_DISP1_DAT1__DISP1_DAT1   0x5
+                               MX51_PAD_DISP1_DAT2__DISP1_DAT2   0x5
+                               MX51_PAD_DISP1_DAT3__DISP1_DAT3   0x5
+                               MX51_PAD_DISP1_DAT4__DISP1_DAT4   0x5
+                               MX51_PAD_DISP1_DAT5__DISP1_DAT5   0x5
+                               MX51_PAD_DISP1_DAT6__DISP1_DAT6   0x5
+                               MX51_PAD_DISP1_DAT7__DISP1_DAT7   0x5
+                               MX51_PAD_DISP1_DAT8__DISP1_DAT8   0x5
+                               MX51_PAD_DISP1_DAT9__DISP1_DAT9   0x5
+                               MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x5
+                               MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x5
+                               MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x5
+                               MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x5
+                               MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x5
+                               MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x5
+                               MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x5
+                               MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x5
+                               MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x5
+                               MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x5
+                               MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x5
+                               MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x5
+                               MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x5
+                               MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x5
+                               MX51_PAD_DI1_PIN2__DI1_PIN2       0x5 /* hsync */
+                               MX51_PAD_DI1_PIN3__DI1_PIN3       0x5 /* vsync */
+                       >;
+               };
+       };
+
+       ipu_disp2 {
+               pinctrl_ipu_disp2_1: ipudisp2grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_DISP2_DAT0__DISP2_DAT0     0x5
+                               MX51_PAD_DISP2_DAT1__DISP2_DAT1     0x5
+                               MX51_PAD_DISP2_DAT2__DISP2_DAT2     0x5
+                               MX51_PAD_DISP2_DAT3__DISP2_DAT3     0x5
+                               MX51_PAD_DISP2_DAT4__DISP2_DAT4     0x5
+                               MX51_PAD_DISP2_DAT5__DISP2_DAT5     0x5
+                               MX51_PAD_DISP2_DAT6__DISP2_DAT6     0x5
+                               MX51_PAD_DISP2_DAT7__DISP2_DAT7     0x5
+                               MX51_PAD_DISP2_DAT8__DISP2_DAT8     0x5
+                               MX51_PAD_DISP2_DAT9__DISP2_DAT9     0x5
+                               MX51_PAD_DISP2_DAT10__DISP2_DAT10   0x5
+                               MX51_PAD_DISP2_DAT11__DISP2_DAT11   0x5
+                               MX51_PAD_DISP2_DAT12__DISP2_DAT12   0x5
+                               MX51_PAD_DISP2_DAT13__DISP2_DAT13   0x5
+                               MX51_PAD_DISP2_DAT14__DISP2_DAT14   0x5
+                               MX51_PAD_DISP2_DAT15__DISP2_DAT15   0x5
+                               MX51_PAD_DI2_PIN2__DI2_PIN2         0x5 /* hsync */
+                               MX51_PAD_DI2_PIN3__DI2_PIN3         0x5 /* vsync */
+                               MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK 0x5 /* CLK */
+                               MX51_PAD_DI_GP4__DI2_PIN15          0x5 /* DE */
+                       >;
+               };
+       };
+
+       kpp {
+               pinctrl_kpp_1: kppgrp-1 {
+                       fsl,pins = <
+                               MX51_PAD_KEY_ROW0__KEY_ROW0 0xe0
+                               MX51_PAD_KEY_ROW1__KEY_ROW1 0xe0
+                               MX51_PAD_KEY_ROW2__KEY_ROW2 0xe0
+                               MX51_PAD_KEY_ROW3__KEY_ROW3 0xe0
+                               MX51_PAD_KEY_COL0__KEY_COL0 0xe8
+                               MX51_PAD_KEY_COL1__KEY_COL1 0xe8
+                               MX51_PAD_KEY_COL2__KEY_COL2 0xe8
+                               MX51_PAD_KEY_COL3__KEY_COL3 0xe8
+                       >;
+               };
+       };
+
+       pata {
+               pinctrl_pata_1: patagrp-1 {
+                       fsl,pins = <
+                               MX51_PAD_NANDF_WE_B__PATA_DIOW     0x2004
+                               MX51_PAD_NANDF_RE_B__PATA_DIOR     0x2004
+                               MX51_PAD_NANDF_ALE__PATA_BUFFER_EN 0x2004
+                               MX51_PAD_NANDF_CLE__PATA_RESET_B   0x2004
+                               MX51_PAD_NANDF_WP_B__PATA_DMACK    0x2004
+                               MX51_PAD_NANDF_RB0__PATA_DMARQ     0x2004
+                               MX51_PAD_NANDF_RB1__PATA_IORDY     0x2004
+                               MX51_PAD_GPIO_NAND__PATA_INTRQ     0x2004
+                               MX51_PAD_NANDF_CS2__PATA_CS_0      0x2004
+                               MX51_PAD_NANDF_CS3__PATA_CS_1      0x2004
+                               MX51_PAD_NANDF_CS4__PATA_DA_0      0x2004
+                               MX51_PAD_NANDF_CS5__PATA_DA_1      0x2004
+                               MX51_PAD_NANDF_CS6__PATA_DA_2      0x2004
+                               MX51_PAD_NANDF_D15__PATA_DATA15    0x2004
+                               MX51_PAD_NANDF_D14__PATA_DATA14    0x2004
+                               MX51_PAD_NANDF_D13__PATA_DATA13    0x2004
+                               MX51_PAD_NANDF_D12__PATA_DATA12    0x2004
+                               MX51_PAD_NANDF_D11__PATA_DATA11    0x2004
+                               MX51_PAD_NANDF_D10__PATA_DATA10    0x2004
+                               MX51_PAD_NANDF_D9__PATA_DATA9      0x2004
+                               MX51_PAD_NANDF_D8__PATA_DATA8      0x2004
+                               MX51_PAD_NANDF_D7__PATA_DATA7      0x2004
+                               MX51_PAD_NANDF_D6__PATA_DATA6     0x2004
+                               MX51_PAD_NANDF_D5__PATA_DATA5     0x2004
+                               MX51_PAD_NANDF_D4__PATA_DATA4     0x2004
+                               MX51_PAD_NANDF_D3__PATA_DATA3     0x2004
+                               MX51_PAD_NANDF_D2__PATA_DATA2     0x2004
+                               MX51_PAD_NANDF_D1__PATA_DATA1     0x2004
+                               MX51_PAD_NANDF_D0__PATA_DATA0     0x2004
+                       >;
+               };
+       };
+
+       uart1 {
+               pinctrl_uart1_1: uart1grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_UART1_RXD__UART1_RXD 0x1c5
+                               MX51_PAD_UART1_TXD__UART1_TXD 0x1c5
+                               MX51_PAD_UART1_RTS__UART1_RTS 0x1c5
+                               MX51_PAD_UART1_CTS__UART1_CTS 0x1c5
+                       >;
+               };
+       };
+
+       uart2 {
+               pinctrl_uart2_1: uart2grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_UART2_RXD__UART2_RXD 0x1c5
+                               MX51_PAD_UART2_TXD__UART2_TXD 0x1c5
+                       >;
+               };
+       };
+
+       uart3 {
+               pinctrl_uart3_1: uart3grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_EIM_D25__UART3_RXD 0x1c5
+                               MX51_PAD_EIM_D26__UART3_TXD 0x1c5
+                               MX51_PAD_EIM_D27__UART3_RTS 0x1c5
+                               MX51_PAD_EIM_D24__UART3_CTS 0x1c5
+                       >;
+               };
+
+               pinctrl_uart3_2: uart3grp-2 {
+                       fsl,pins = <
+                               MX51_PAD_UART3_RXD__UART3_RXD 0x1c5
+                               MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
+                       >;
+               };
+       };
+
+       usbh1 {
+               pinctrl_usbh1_1: usbh1grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x1e5
+                               MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x1e5
+                               MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x1e5
+                               MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x1e5
+                               MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x1e5
+                               MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x1e5
+                               MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x1e5
+                               MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x1e5
+                               MX51_PAD_USBH1_CLK__USBH1_CLK     0x1e5
+                               MX51_PAD_USBH1_DIR__USBH1_DIR     0x1e5
+                               MX51_PAD_USBH1_NXT__USBH1_NXT     0x1e5
+                               MX51_PAD_USBH1_STP__USBH1_STP     0x1e5
+                       >;
+               };
+       };
+
+       usbh2 {
+               pinctrl_usbh2_1: usbh2grp-1 {
+                       fsl,pins = <
+                               MX51_PAD_EIM_D16__USBH2_DATA0 0x1e5
+                               MX51_PAD_EIM_D17__USBH2_DATA1 0x1e5
+                               MX51_PAD_EIM_D18__USBH2_DATA2 0x1e5
+                               MX51_PAD_EIM_D19__USBH2_DATA3 0x1e5
+                               MX51_PAD_EIM_D20__USBH2_DATA4 0x1e5
+                               MX51_PAD_EIM_D21__USBH2_DATA5 0x1e5
+                               MX51_PAD_EIM_D22__USBH2_DATA6 0x1e5
+                               MX51_PAD_EIM_D23__USBH2_DATA7 0x1e5
+                               MX51_PAD_EIM_A24__USBH2_CLK   0x1e5
+                               MX51_PAD_EIM_A25__USBH2_DIR   0x1e5
+                               MX51_PAD_EIM_A27__USBH2_NXT   0x1e5
+                               MX51_PAD_EIM_A26__USBH2_STP   0x1e5
+                       >;
+               };
+       };
+};
index 512a1f6..e97ddae 100644 (file)
                        regulator-max-microvolt = <3200000>;
                        regulator-always-on;
                };
+
+               reg_usb_vbus: usb_vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio7 8 0>;
+                       enable-active-high;
+               };
        };
 
        sound {
                                MX53_PAD_EIM_DA12__GPIO3_12       0x80000000
                                MX53_PAD_EIM_DA13__GPIO3_13       0x80000000
                                MX53_PAD_PATA_DA_0__GPIO7_6       0x80000000
+                               MX53_PAD_PATA_DA_2__GPIO7_8       0x80000000
                                MX53_PAD_GPIO_16__GPIO7_11        0x80000000
                        >;
                };
        status = "okay";
 };
 
+&vpu {
+       status = "okay";
+};
+
 &usbh1 {
-       status = "okay";
+       vbus-supply = <&reg_usb_vbus>;
+       phy_type = "utmi";
+       status = "okay";
 };
 
 &usbotg {
index 569aa9f..4307e80 100644 (file)
 
 / {
        aliases {
-               serial0 = &uart1;
-               serial1 = &uart2;
-               serial2 = &uart3;
-               serial3 = &uart4;
-               serial4 = &uart5;
                gpio0 = &gpio1;
                gpio1 = &gpio2;
                gpio2 = &gpio3;
                i2c0 = &i2c1;
                i2c1 = &i2c2;
                i2c2 = &i2c3;
+               serial0 = &uart1;
+               serial1 = &uart2;
+               serial2 = &uart3;
+               serial3 = &uart4;
+               serial4 = &uart5;
+               spi0 = &ecspi1;
+               spi1 = &ecspi2;
+               spi2 = &cspi;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a8";
+                       reg = <0x0>;
+               };
        };
 
        tzic: tz-interrupt-controller@0fffc000 {
                                        reg = <0x50014000 0x4000>;
                                        interrupts = <30>;
                                        clocks = <&clks 49>;
+                                       dmas = <&sdma 24 1 0>,
+                                              <&sdma 25 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        fsl,ssi-dma-events = <25 24 23 22>; /* TX0 RX0 TX1 RX1 */
                                        status = "disabled";
                        reg = <0x60000000 0x10000000>;
                        ranges;
 
+                       iim: iim@63f98000 {
+                               compatible = "fsl,imx53-iim", "fsl,imx27-iim";
+                               reg = <0x63f98000 0x4000>;
+                               interrupts = <69>;
+                               clocks = <&clks 107>;
+                       };
+
                        uart5: serial@63f90000 {
                                compatible = "fsl,imx53-uart", "fsl,imx21-uart";
                                reg = <0x63f90000 0x4000>;
                                interrupts = <6>;
                                clocks = <&clks 56>, <&clks 56>;
                                clock-names = "ipg", "ahb";
+                               #dma-cells = <3>;
                                fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
                        };
 
                                reg = <0x63fcc000 0x4000>;
                                interrupts = <29>;
                                clocks = <&clks 48>;
+                               dmas = <&sdma 28 0 0>,
+                                      <&sdma 29 0 0>;
+                               dma-names = "rx", "tx";
                                fsl,fifo-depth = <15>;
                                fsl,ssi-dma-events = <29 28 27 26>; /* TX0 RX0 TX1 RX1 */
                                status = "disabled";
                                reg = <0x63fe8000 0x4000>;
                                interrupts = <96>;
                                clocks = <&clks 50>;
+                               dmas = <&sdma 46 0 0>,
+                                      <&sdma 47 0 0>;
+                               dma-names = "rx", "tx";
                                fsl,fifo-depth = <15>;
                                fsl,ssi-dma-events = <47 46 45 44>; /* TX0 RX0 TX1 RX1 */
                                status = "disabled";
                                crtcs = <&ipu 1>;
                                status = "disabled";
                        };
+
+                       vpu: vpu@63ff4000 {
+                               compatible = "fsl,imx53-vpu";
+                               reg = <0x63ff4000 0x1000>;
+                               interrupts = <9>;
+                               clocks = <&clks 63>, <&clks 63>;
+                               clock-names = "per", "ahb";
+                               iram = <&ocram>;
+                               status = "disabled";
+                       };
+               };
+
+               ocram: sram@f8000000 {
+                       compatible = "mmio-sram";
+                       reg = <0xf8000000 0x20000>;
+                       clocks = <&clks 186>;
                };
        };
 };
index 9aab950..b81a7a4 100644 (file)
  * The pin function ID is a tuple of
  * <mux_reg conf_reg input_reg mux_mode input_val>
  */
-#define MX6DL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10     0x04c 0x360 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT10__AUD3_RXC             0x04c 0x360 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT10__ECSPI2_MISO          0x04c 0x360 0x7f8 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT10__UART1_TX_DATA        0x04c 0x360 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT10__UART1_RX_DATA        0x04c 0x360 0x8fc 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT10__GPIO5_IO28           0x04c 0x360 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT10__ARM_TRACE07          0x04c 0x360 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11     0x050 0x364 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT11__AUD3_RXFS            0x050 0x364 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT11__ECSPI2_SS0           0x050 0x364 0x800 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT11__UART1_RX_DATA        0x050 0x364 0x8fc 0x3 0x1
-#define MX6DL_PAD_CSI0_DAT11__UART1_TX_DATA        0x050 0x364 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT11__GPIO5_IO29           0x050 0x364 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT11__ARM_TRACE08          0x050 0x364 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12     0x054 0x368 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT12__EIM_DATA08           0x054 0x368 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT12__UART4_TX_DATA        0x054 0x368 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT12__UART4_RX_DATA        0x054 0x368 0x914 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT12__GPIO5_IO30           0x054 0x368 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT12__ARM_TRACE09          0x054 0x368 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13     0x058 0x36c 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT13__EIM_DATA09           0x058 0x36c 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT13__UART4_RX_DATA        0x058 0x36c 0x914 0x3 0x1
-#define MX6DL_PAD_CSI0_DAT13__UART4_TX_DATA        0x058 0x36c 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT13__GPIO5_IO31           0x058 0x36c 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT13__ARM_TRACE10          0x058 0x36c 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14     0x05c 0x370 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT14__EIM_DATA10           0x05c 0x370 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT14__UART5_TX_DATA        0x05c 0x370 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT14__UART5_RX_DATA        0x05c 0x370 0x91c 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT14__GPIO6_IO00           0x05c 0x370 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT14__ARM_TRACE11          0x05c 0x370 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15     0x060 0x374 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT15__EIM_DATA11           0x060 0x374 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT15__UART5_RX_DATA        0x060 0x374 0x91c 0x3 0x1
-#define MX6DL_PAD_CSI0_DAT15__UART5_TX_DATA        0x060 0x374 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT15__GPIO6_IO01           0x060 0x374 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT15__ARM_TRACE12          0x060 0x374 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16     0x064 0x378 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT16__EIM_DATA12           0x064 0x378 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT16__UART4_RTS_B          0x064 0x378 0x910 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT16__UART4_CTS_B          0x064 0x378 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT16__GPIO6_IO02           0x064 0x378 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT16__ARM_TRACE13          0x064 0x378 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17     0x068 0x37c 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT17__EIM_DATA13           0x068 0x37c 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT17__UART4_CTS_B          0x068 0x37c 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT17__UART4_RTS_B          0x068 0x37c 0x910 0x3 0x1
-#define MX6DL_PAD_CSI0_DAT17__GPIO6_IO03           0x068 0x37c 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT17__ARM_TRACE14          0x068 0x37c 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18     0x06c 0x380 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT18__EIM_DATA14           0x06c 0x380 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT18__UART5_RTS_B          0x06c 0x380 0x918 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT18__UART5_CTS_B          0x06c 0x380 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT18__GPIO6_IO04           0x06c 0x380 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT18__ARM_TRACE15          0x06c 0x380 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19     0x070 0x384 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT19__EIM_DATA15           0x070 0x384 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT19__UART5_CTS_B          0x070 0x384 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT19__UART5_RTS_B          0x070 0x384 0x918 0x3 0x1
-#define MX6DL_PAD_CSI0_DAT19__GPIO6_IO05           0x070 0x384 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04      0x074 0x388 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT4__EIM_DATA02            0x074 0x388 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT4__ECSPI1_SCLK           0x074 0x388 0x7d8 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT4__KEY_COL5              0x074 0x388 0x8c0 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT4__AUD3_TXC              0x074 0x388 0x000 0x4 0x0
-#define MX6DL_PAD_CSI0_DAT4__GPIO5_IO22            0x074 0x388 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT4__ARM_TRACE01           0x074 0x388 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05      0x078 0x38c 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT5__EIM_DATA03            0x078 0x38c 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT5__ECSPI1_MOSI           0x078 0x38c 0x7e0 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT5__KEY_ROW5              0x078 0x38c 0x8cc 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT5__AUD3_TXD              0x078 0x38c 0x000 0x4 0x0
-#define MX6DL_PAD_CSI0_DAT5__GPIO5_IO23            0x078 0x38c 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT5__ARM_TRACE02           0x078 0x38c 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06      0x07c 0x390 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT6__EIM_DATA04            0x07c 0x390 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT6__ECSPI1_MISO           0x07c 0x390 0x7dc 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT6__KEY_COL6              0x07c 0x390 0x8c4 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT6__AUD3_TXFS             0x07c 0x390 0x000 0x4 0x0
-#define MX6DL_PAD_CSI0_DAT6__GPIO5_IO24            0x07c 0x390 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT6__ARM_TRACE03           0x07c 0x390 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07      0x080 0x394 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT7__EIM_DATA05            0x080 0x394 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT7__ECSPI1_SS0            0x080 0x394 0x7e4 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT7__KEY_ROW6              0x080 0x394 0x8d0 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT7__AUD3_RXD              0x080 0x394 0x000 0x4 0x0
-#define MX6DL_PAD_CSI0_DAT7__GPIO5_IO25            0x080 0x394 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT7__ARM_TRACE04           0x080 0x394 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08      0x084 0x398 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT8__EIM_DATA06            0x084 0x398 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT8__ECSPI2_SCLK           0x084 0x398 0x7f4 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT8__KEY_COL7              0x084 0x398 0x8c8 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT8__I2C1_SDA              0x084 0x398 0x86c 0x4 0x0
-#define MX6DL_PAD_CSI0_DAT8__GPIO5_IO26            0x084 0x398 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT8__ARM_TRACE05           0x084 0x398 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09      0x088 0x39c 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DAT9__EIM_DATA07            0x088 0x39c 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DAT9__ECSPI2_MOSI           0x088 0x39c 0x7fc 0x2 0x0
-#define MX6DL_PAD_CSI0_DAT9__KEY_ROW7              0x088 0x39c 0x8d4 0x3 0x0
-#define MX6DL_PAD_CSI0_DAT9__I2C1_SCL              0x088 0x39c 0x868 0x4 0x0
-#define MX6DL_PAD_CSI0_DAT9__GPIO5_IO27            0x088 0x39c 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DAT9__ARM_TRACE06           0x088 0x39c 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN  0x08c 0x3a0 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_DATA_EN__EIM_DATA00         0x08c 0x3a0 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_DATA_EN__GPIO5_IO20         0x08c 0x3a0 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_DATA_EN__ARM_TRACE_CLK      0x08c 0x3a0 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC       0x090 0x3a4 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_MCLK__CCM_CLKO1             0x090 0x3a4 0x000 0x3 0x0
-#define MX6DL_PAD_CSI0_MCLK__GPIO5_IO19            0x090 0x3a4 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_MCLK__ARM_TRACE_CTL         0x090 0x3a4 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK    0x094 0x3a8 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_PIXCLK__GPIO5_IO18          0x094 0x3a8 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_PIXCLK__ARM_EVENTO          0x094 0x3a8 0x000 0x7 0x0
-#define MX6DL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC      0x098 0x3ac 0x000 0x0 0x0
-#define MX6DL_PAD_CSI0_VSYNC__EIM_DATA01           0x098 0x3ac 0x000 0x1 0x0
-#define MX6DL_PAD_CSI0_VSYNC__GPIO5_IO21           0x098 0x3ac 0x000 0x5 0x0
-#define MX6DL_PAD_CSI0_VSYNC__ARM_TRACE00          0x098 0x3ac 0x000 0x7 0x0
-#define MX6DL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK  0x09c 0x3b0 0x000 0x0 0x0
-#define MX6DL_PAD_DI0_DISP_CLK__LCD_CLK            0x09c 0x3b0 0x000 0x1 0x0
-#define MX6DL_PAD_DI0_DISP_CLK__GPIO4_IO16         0x09c 0x3b0 0x000 0x5 0x0
-#define MX6DL_PAD_DI0_DISP_CLK__LCD_WR_RWN         0x09c 0x3b0 0x000 0x8 0x0
-#define MX6DL_PAD_DI0_PIN15__IPU1_DI0_PIN15        0x0a0 0x3b4 0x000 0x0 0x0
-#define MX6DL_PAD_DI0_PIN15__LCD_ENABLE            0x0a0 0x3b4 0x000 0x1 0x0
-#define MX6DL_PAD_DI0_PIN15__AUD6_TXC              0x0a0 0x3b4 0x000 0x2 0x0
-#define MX6DL_PAD_DI0_PIN15__GPIO4_IO17            0x0a0 0x3b4 0x000 0x5 0x0
-#define MX6DL_PAD_DI0_PIN15__LCD_RD_E              0x0a0 0x3b4 0x000 0x8 0x0
-#define MX6DL_PAD_DI0_PIN2__IPU1_DI0_PIN02         0x0a4 0x3b8 0x000 0x0 0x0
-#define MX6DL_PAD_DI0_PIN2__LCD_HSYNC              0x0a4 0x3b8 0x8d8 0x1 0x0
-#define MX6DL_PAD_DI0_PIN2__AUD6_TXD               0x0a4 0x3b8 0x000 0x2 0x0
-#define MX6DL_PAD_DI0_PIN2__GPIO4_IO18             0x0a4 0x3b8 0x000 0x5 0x0
-#define MX6DL_PAD_DI0_PIN2__LCD_RS                 0x0a4 0x3b8 0x000 0x8 0x0
-#define MX6DL_PAD_DI0_PIN3__IPU1_DI0_PIN03         0x0a8 0x3bc 0x000 0x0 0x0
-#define MX6DL_PAD_DI0_PIN3__LCD_VSYNC              0x0a8 0x3bc 0x000 0x1 0x0
-#define MX6DL_PAD_DI0_PIN3__AUD6_TXFS              0x0a8 0x3bc 0x000 0x2 0x0
-#define MX6DL_PAD_DI0_PIN3__GPIO4_IO19             0x0a8 0x3bc 0x000 0x5 0x0
-#define MX6DL_PAD_DI0_PIN3__LCD_CS                 0x0a8 0x3bc 0x000 0x8 0x0
-#define MX6DL_PAD_DI0_PIN4__IPU1_DI0_PIN04         0x0ac 0x3c0 0x000 0x0 0x0
-#define MX6DL_PAD_DI0_PIN4__LCD_BUSY               0x0ac 0x3c0 0x8d8 0x1 0x1
-#define MX6DL_PAD_DI0_PIN4__AUD6_RXD               0x0ac 0x3c0 0x000 0x2 0x0
-#define MX6DL_PAD_DI0_PIN4__SD1_WP                 0x0ac 0x3c0 0x92c 0x3 0x0
-#define MX6DL_PAD_DI0_PIN4__GPIO4_IO20             0x0ac 0x3c0 0x000 0x5 0x0
-#define MX6DL_PAD_DI0_PIN4__LCD_RESET              0x0ac 0x3c0 0x000 0x8 0x0
-#define MX6DL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00    0x0b0 0x3c4 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT0__LCD_DATA00           0x0b0 0x3c4 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT0__ECSPI3_SCLK          0x0b0 0x3c4 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT0__GPIO4_IO21           0x0b0 0x3c4 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01    0x0b4 0x3c8 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT1__LCD_DATA01           0x0b4 0x3c8 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT1__ECSPI3_MOSI          0x0b4 0x3c8 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT1__GPIO4_IO22           0x0b4 0x3c8 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10   0x0b8 0x3cc 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT10__LCD_DATA10          0x0b8 0x3cc 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT10__GPIO4_IO31          0x0b8 0x3cc 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11   0x0bc 0x3d0 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT11__LCD_DATA11          0x0bc 0x3d0 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT11__GPIO5_IO05          0x0bc 0x3d0 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12   0x0c0 0x3d4 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT12__LCD_DATA12          0x0c0 0x3d4 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT12__GPIO5_IO06          0x0c0 0x3d4 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13   0x0c4 0x3d8 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT13__LCD_DATA13          0x0c4 0x3d8 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT13__AUD5_RXFS           0x0c4 0x3d8 0x7bc 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT13__GPIO5_IO07          0x0c4 0x3d8 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14   0x0c8 0x3dc 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT14__LCD_DATA14          0x0c8 0x3dc 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT14__AUD5_RXC            0x0c8 0x3dc 0x7b8 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT14__GPIO5_IO08          0x0c8 0x3dc 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15   0x0cc 0x3e0 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT15__LCD_DATA15          0x0cc 0x3e0 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT15__ECSPI1_SS1          0x0cc 0x3e0 0x7e8 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT15__ECSPI2_SS1          0x0cc 0x3e0 0x804 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT15__GPIO5_IO09          0x0cc 0x3e0 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16   0x0d0 0x3e4 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT16__LCD_DATA16          0x0d0 0x3e4 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT16__ECSPI2_MOSI         0x0d0 0x3e4 0x7fc 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT16__AUD5_TXC            0x0d0 0x3e4 0x7c0 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT16__SDMA_EXT_EVENT0     0x0d0 0x3e4 0x8e8 0x4 0x0
-#define MX6DL_PAD_DISP0_DAT16__GPIO5_IO10          0x0d0 0x3e4 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17   0x0d4 0x3e8 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT17__LCD_DATA17          0x0d4 0x3e8 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT17__ECSPI2_MISO         0x0d4 0x3e8 0x7f8 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT17__AUD5_TXD            0x0d4 0x3e8 0x7b4 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT17__SDMA_EXT_EVENT1     0x0d4 0x3e8 0x8ec 0x4 0x0
-#define MX6DL_PAD_DISP0_DAT17__GPIO5_IO11          0x0d4 0x3e8 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18   0x0d8 0x3ec 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT18__LCD_DATA18          0x0d8 0x3ec 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT18__ECSPI2_SS0          0x0d8 0x3ec 0x800 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT18__AUD5_TXFS           0x0d8 0x3ec 0x7c4 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT18__AUD4_RXFS           0x0d8 0x3ec 0x7a4 0x4 0x0
-#define MX6DL_PAD_DISP0_DAT18__GPIO5_IO12          0x0d8 0x3ec 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT18__EIM_CS2_B           0x0d8 0x3ec 0x000 0x7 0x0
-#define MX6DL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19   0x0dc 0x3f0 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT19__LCD_DATA19          0x0dc 0x3f0 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT19__ECSPI2_SCLK         0x0dc 0x3f0 0x7f4 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT19__AUD5_RXD            0x0dc 0x3f0 0x7b0 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT19__AUD4_RXC            0x0dc 0x3f0 0x7a0 0x4 0x0
-#define MX6DL_PAD_DISP0_DAT19__GPIO5_IO13          0x0dc 0x3f0 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT19__EIM_CS3_B           0x0dc 0x3f0 0x000 0x7 0x0
-#define MX6DL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02    0x0e0 0x3f4 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT2__LCD_DATA02           0x0e0 0x3f4 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT2__ECSPI3_MISO          0x0e0 0x3f4 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT2__GPIO4_IO23           0x0e0 0x3f4 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20   0x0e4 0x3f8 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT20__LCD_DATA20          0x0e4 0x3f8 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT20__ECSPI1_SCLK         0x0e4 0x3f8 0x7d8 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT20__AUD4_TXC            0x0e4 0x3f8 0x7a8 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT20__GPIO5_IO14          0x0e4 0x3f8 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21   0x0e8 0x3fc 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT21__LCD_DATA21          0x0e8 0x3fc 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT21__ECSPI1_MOSI         0x0e8 0x3fc 0x7e0 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT21__AUD4_TXD            0x0e8 0x3fc 0x79c 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT21__GPIO5_IO15          0x0e8 0x3fc 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22   0x0ec 0x400 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT22__LCD_DATA22          0x0ec 0x400 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT22__ECSPI1_MISO         0x0ec 0x400 0x7dc 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT22__AUD4_TXFS           0x0ec 0x400 0x7ac 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT22__GPIO5_IO16          0x0ec 0x400 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23   0x0f0 0x404 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT23__LCD_DATA23          0x0f0 0x404 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT23__ECSPI1_SS0          0x0f0 0x404 0x7e4 0x2 0x1
-#define MX6DL_PAD_DISP0_DAT23__AUD4_RXD            0x0f0 0x404 0x798 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT23__GPIO5_IO17          0x0f0 0x404 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03    0x0f4 0x408 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT3__LCD_DATA03           0x0f4 0x408 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT3__ECSPI3_SS0           0x0f4 0x408 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT3__GPIO4_IO24           0x0f4 0x408 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04    0x0f8 0x40c 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT4__LCD_DATA04           0x0f8 0x40c 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT4__ECSPI3_SS1           0x0f8 0x40c 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT4__GPIO4_IO25           0x0f8 0x40c 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05    0x0fc 0x410 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT5__LCD_DATA05           0x0fc 0x410 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT5__ECSPI3_SS2           0x0fc 0x410 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT5__AUD6_RXFS            0x0fc 0x410 0x000 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT5__GPIO4_IO26           0x0fc 0x410 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06    0x100 0x414 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT6__LCD_DATA06           0x100 0x414 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT6__ECSPI3_SS3           0x100 0x414 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT6__AUD6_RXC             0x100 0x414 0x000 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT6__GPIO4_IO27           0x100 0x414 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07    0x104 0x418 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT7__LCD_DATA07           0x104 0x418 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT7__ECSPI3_RDY           0x104 0x418 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT7__GPIO4_IO28           0x104 0x418 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08    0x108 0x41c 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT8__LCD_DATA08           0x108 0x41c 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT8__PWM1_OUT             0x108 0x41c 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT8__WDOG1_B              0x108 0x41c 0x000 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT8__GPIO4_IO29           0x108 0x41c 0x000 0x5 0x0
-#define MX6DL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09    0x10c 0x420 0x000 0x0 0x0
-#define MX6DL_PAD_DISP0_DAT9__LCD_DATA09           0x10c 0x420 0x000 0x1 0x0
-#define MX6DL_PAD_DISP0_DAT9__PWM2_OUT             0x10c 0x420 0x000 0x2 0x0
-#define MX6DL_PAD_DISP0_DAT9__WDOG2_B              0x10c 0x420 0x000 0x3 0x0
-#define MX6DL_PAD_DISP0_DAT9__GPIO4_IO30           0x10c 0x420 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A16__EIM_ADDR16              0x110 0x4e0 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A16__IPU1_DI1_DISP_CLK       0x110 0x4e0 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A16__IPU1_CSI1_PIXCLK        0x110 0x4e0 0x8b8 0x2 0x0
-#define MX6DL_PAD_EIM_A16__GPIO2_IO22              0x110 0x4e0 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A16__SRC_BOOT_CFG16          0x110 0x4e0 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A16__EPDC_DATA00             0x110 0x4e0 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A17__EIM_ADDR17              0x114 0x4e4 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A17__IPU1_DISP1_DATA12       0x114 0x4e4 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A17__IPU1_CSI1_DATA12        0x114 0x4e4 0x890 0x2 0x0
-#define MX6DL_PAD_EIM_A17__GPIO2_IO21              0x114 0x4e4 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A17__SRC_BOOT_CFG17          0x114 0x4e4 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A17__EPDC_PWR_STAT           0x114 0x4e4 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A18__EIM_ADDR18              0x118 0x4e8 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A18__IPU1_DISP1_DATA13       0x118 0x4e8 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A18__IPU1_CSI1_DATA13        0x118 0x4e8 0x894 0x2 0x0
-#define MX6DL_PAD_EIM_A18__GPIO2_IO20              0x118 0x4e8 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A18__SRC_BOOT_CFG18          0x118 0x4e8 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A18__EPDC_PWR_CTRL0          0x118 0x4e8 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A19__EIM_ADDR19              0x11c 0x4ec 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A19__IPU1_DISP1_DATA14       0x11c 0x4ec 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A19__IPU1_CSI1_DATA14        0x11c 0x4ec 0x898 0x2 0x0
-#define MX6DL_PAD_EIM_A19__GPIO2_IO19              0x11c 0x4ec 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A19__SRC_BOOT_CFG19          0x11c 0x4ec 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A19__EPDC_PWR_CTRL1          0x11c 0x4ec 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A20__EIM_ADDR20              0x120 0x4f0 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A20__IPU1_DISP1_DATA15       0x120 0x4f0 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A20__IPU1_CSI1_DATA15        0x120 0x4f0 0x89c 0x2 0x0
-#define MX6DL_PAD_EIM_A20__GPIO2_IO18              0x120 0x4f0 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A20__SRC_BOOT_CFG20          0x120 0x4f0 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A20__EPDC_PWR_CTRL2          0x120 0x4f0 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A21__EIM_ADDR21              0x124 0x4f4 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A21__IPU1_DISP1_DATA16       0x124 0x4f4 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A21__IPU1_CSI1_DATA16        0x124 0x4f4 0x8a0 0x2 0x0
-#define MX6DL_PAD_EIM_A21__GPIO2_IO17              0x124 0x4f4 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A21__SRC_BOOT_CFG21          0x124 0x4f4 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A21__EPDC_GDCLK              0x124 0x4f4 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A22__EIM_ADDR22              0x128 0x4f8 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A22__IPU1_DISP1_DATA17       0x128 0x4f8 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A22__IPU1_CSI1_DATA17        0x128 0x4f8 0x8a4 0x2 0x0
-#define MX6DL_PAD_EIM_A22__GPIO2_IO16              0x128 0x4f8 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A22__SRC_BOOT_CFG22          0x128 0x4f8 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A22__EPDC_GDSP               0x128 0x4f8 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A23__EIM_ADDR23              0x12c 0x4fc 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A23__IPU1_DISP1_DATA18       0x12c 0x4fc 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A23__IPU1_CSI1_DATA18        0x12c 0x4fc 0x8a8 0x2 0x0
-#define MX6DL_PAD_EIM_A23__IPU1_SISG3              0x12c 0x4fc 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_A23__GPIO6_IO06              0x12c 0x4fc 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A23__SRC_BOOT_CFG23          0x12c 0x4fc 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A23__EPDC_GDOE               0x12c 0x4fc 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A24__EIM_ADDR24              0x130 0x500 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A24__IPU1_DISP1_DATA19       0x130 0x500 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A24__IPU1_CSI1_DATA19        0x130 0x500 0x8ac 0x2 0x0
-#define MX6DL_PAD_EIM_A24__IPU1_SISG2              0x130 0x500 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_A24__GPIO5_IO04              0x130 0x500 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A24__SRC_BOOT_CFG24          0x130 0x500 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_A24__EPDC_GDRL               0x130 0x500 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A25__EIM_ADDR25              0x134 0x504 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_A25__ECSPI4_SS1              0x134 0x504 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_A25__ECSPI2_RDY              0x134 0x504 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_A25__IPU1_DI1_PIN12          0x134 0x504 0x000 0x3 0x0
-#define MX6DL_PAD_EIM_A25__IPU1_DI0_D1_CS          0x134 0x504 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_A25__GPIO5_IO02              0x134 0x504 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_A25__HDMI_TX_CEC_LINE        0x134 0x504 0x85c 0x6 0x0
-#define MX6DL_PAD_EIM_A25__EPDC_DATA15             0x134 0x504 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_A25__EIM_ACLK_FREERUN        0x134 0x504 0x000 0x9 0x0
-#define MX6DL_PAD_EIM_BCLK__EIM_BCLK               0x138 0x508 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_BCLK__IPU1_DI1_PIN16         0x138 0x508 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_BCLK__GPIO6_IO31             0x138 0x508 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_BCLK__EPDC_SDCE9             0x138 0x508 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_CS0__EIM_CS0_B               0x13c 0x50c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_CS0__IPU1_DI1_PIN05          0x13c 0x50c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_CS0__ECSPI2_SCLK             0x13c 0x50c 0x7f4 0x2 0x2
-#define MX6DL_PAD_EIM_CS0__GPIO2_IO23              0x13c 0x50c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_CS0__EPDC_DATA06             0x13c 0x50c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_CS1__EIM_CS1_B               0x140 0x510 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_CS1__IPU1_DI1_PIN06          0x140 0x510 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_CS1__ECSPI2_MOSI             0x140 0x510 0x7fc 0x2 0x2
-#define MX6DL_PAD_EIM_CS1__GPIO2_IO24              0x140 0x510 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_CS1__EPDC_DATA08             0x140 0x510 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D16__EIM_DATA16              0x144 0x514 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D16__ECSPI1_SCLK             0x144 0x514 0x7d8 0x1 0x2
-#define MX6DL_PAD_EIM_D16__IPU1_DI0_PIN05          0x144 0x514 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D16__IPU1_CSI1_DATA18        0x144 0x514 0x8a8 0x3 0x1
-#define MX6DL_PAD_EIM_D16__HDMI_TX_DDC_SDA         0x144 0x514 0x864 0x4 0x0
-#define MX6DL_PAD_EIM_D16__GPIO3_IO16              0x144 0x514 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D16__I2C2_SDA                0x144 0x514 0x874 0x6 0x0
-#define MX6DL_PAD_EIM_D16__EPDC_DATA10             0x144 0x514 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D17__EIM_DATA17              0x148 0x518 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D17__ECSPI1_MISO             0x148 0x518 0x7dc 0x1 0x2
-#define MX6DL_PAD_EIM_D17__IPU1_DI0_PIN06          0x148 0x518 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D17__IPU1_CSI1_PIXCLK        0x148 0x518 0x8b8 0x3 0x1
-#define MX6DL_PAD_EIM_D17__DCIC1_OUT               0x148 0x518 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D17__GPIO3_IO17              0x148 0x518 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D17__I2C3_SCL                0x148 0x518 0x878 0x6 0x0
-#define MX6DL_PAD_EIM_D17__EPDC_VCOM0              0x148 0x518 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D18__EIM_DATA18              0x14c 0x51c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D18__ECSPI1_MOSI             0x14c 0x51c 0x7e0 0x1 0x2
-#define MX6DL_PAD_EIM_D18__IPU1_DI0_PIN07          0x14c 0x51c 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D18__IPU1_CSI1_DATA17        0x14c 0x51c 0x8a4 0x3 0x1
-#define MX6DL_PAD_EIM_D18__IPU1_DI1_D0_CS          0x14c 0x51c 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D18__GPIO3_IO18              0x14c 0x51c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D18__I2C3_SDA                0x14c 0x51c 0x87c 0x6 0x0
-#define MX6DL_PAD_EIM_D18__EPDC_VCOM1              0x14c 0x51c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D19__EIM_DATA19              0x150 0x520 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D19__ECSPI1_SS1              0x150 0x520 0x7e8 0x1 0x1
-#define MX6DL_PAD_EIM_D19__IPU1_DI0_PIN08          0x150 0x520 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D19__IPU1_CSI1_DATA16        0x150 0x520 0x8a0 0x3 0x1
-#define MX6DL_PAD_EIM_D19__UART1_CTS_B             0x150 0x520 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D19__UART1_RTS_B             0x150 0x520 0x8f8 0x4 0x0
-#define MX6DL_PAD_EIM_D19__GPIO3_IO19              0x150 0x520 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D19__EPIT1_OUT               0x150 0x520 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D19__EPDC_DATA12             0x150 0x520 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D20__EIM_DATA20              0x154 0x524 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D20__ECSPI4_SS0              0x154 0x524 0x808 0x1 0x0
-#define MX6DL_PAD_EIM_D20__IPU1_DI0_PIN16          0x154 0x524 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D20__IPU1_CSI1_DATA15        0x154 0x524 0x89c 0x3 0x1
-#define MX6DL_PAD_EIM_D20__UART1_RTS_B             0x154 0x524 0x8f8 0x4 0x1
-#define MX6DL_PAD_EIM_D20__UART1_CTS_B             0x154 0x524 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D20__GPIO3_IO20              0x154 0x524 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D20__EPIT2_OUT               0x154 0x524 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D21__EIM_DATA21              0x158 0x528 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D21__ECSPI4_SCLK             0x158 0x528 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D21__IPU1_DI0_PIN17          0x158 0x528 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D21__IPU1_CSI1_DATA11        0x158 0x528 0x88c 0x3 0x0
-#define MX6DL_PAD_EIM_D21__USB_OTG_OC              0x158 0x528 0x920 0x4 0x0
-#define MX6DL_PAD_EIM_D21__GPIO3_IO21              0x158 0x528 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D21__I2C1_SCL                0x158 0x528 0x868 0x6 0x1
-#define MX6DL_PAD_EIM_D21__SPDIF_IN                0x158 0x528 0x8f0 0x7 0x0
-#define MX6DL_PAD_EIM_D22__EIM_DATA22              0x15c 0x52c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D22__ECSPI4_MISO             0x15c 0x52c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D22__IPU1_DI0_PIN01          0x15c 0x52c 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D22__IPU1_CSI1_DATA10        0x15c 0x52c 0x888 0x3 0x0
-#define MX6DL_PAD_EIM_D22__USB_OTG_PWR             0x15c 0x52c 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D22__GPIO3_IO22              0x15c 0x52c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D22__SPDIF_OUT               0x15c 0x52c 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D22__EPDC_SDCE6              0x15c 0x52c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D23__EIM_DATA23              0x160 0x530 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D23__IPU1_DI0_D0_CS          0x160 0x530 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D23__UART3_CTS_B             0x160 0x530 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D23__UART3_RTS_B             0x160 0x530 0x908 0x2 0x0
-#define MX6DL_PAD_EIM_D23__UART1_DCD_B             0x160 0x530 0x000 0x3 0x0
-#define MX6DL_PAD_EIM_D23__IPU1_CSI1_DATA_EN       0x160 0x530 0x8b0 0x4 0x0
-#define MX6DL_PAD_EIM_D23__GPIO3_IO23              0x160 0x530 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D23__IPU1_DI1_PIN02          0x160 0x530 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D23__IPU1_DI1_PIN14          0x160 0x530 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_D23__EPDC_DATA11             0x160 0x530 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D24__EIM_DATA24              0x164 0x534 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D24__ECSPI4_SS2              0x164 0x534 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D24__UART3_TX_DATA           0x164 0x534 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D24__UART3_RX_DATA           0x164 0x534 0x90c 0x2 0x0
-#define MX6DL_PAD_EIM_D24__ECSPI1_SS2              0x164 0x534 0x7ec 0x3 0x0
-#define MX6DL_PAD_EIM_D24__ECSPI2_SS2              0x164 0x534 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D24__GPIO3_IO24              0x164 0x534 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D24__AUD5_RXFS               0x164 0x534 0x7bc 0x6 0x1
-#define MX6DL_PAD_EIM_D24__UART1_DTR_B             0x164 0x534 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_D24__EPDC_SDCE7              0x164 0x534 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D25__EIM_DATA25              0x168 0x538 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D25__ECSPI4_SS3              0x168 0x538 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D25__UART3_RX_DATA           0x168 0x538 0x90c 0x2 0x1
-#define MX6DL_PAD_EIM_D25__UART3_TX_DATA           0x168 0x538 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D25__ECSPI1_SS3              0x168 0x538 0x7f0 0x3 0x0
-#define MX6DL_PAD_EIM_D25__ECSPI2_SS3              0x168 0x538 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D25__GPIO3_IO25              0x168 0x538 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D25__AUD5_RXC                0x168 0x538 0x7b8 0x6 0x1
-#define MX6DL_PAD_EIM_D25__UART1_DSR_B             0x168 0x538 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_D25__EPDC_SDCE8              0x168 0x538 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D26__EIM_DATA26              0x16c 0x53c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D26__IPU1_DI1_PIN11          0x16c 0x53c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D26__IPU1_CSI0_DATA01        0x16c 0x53c 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D26__IPU1_CSI1_DATA14        0x16c 0x53c 0x898 0x3 0x1
-#define MX6DL_PAD_EIM_D26__UART2_TX_DATA           0x16c 0x53c 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D26__UART2_RX_DATA           0x16c 0x53c 0x904 0x4 0x0
-#define MX6DL_PAD_EIM_D26__GPIO3_IO26              0x16c 0x53c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D26__IPU1_SISG2              0x16c 0x53c 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D26__IPU1_DISP1_DATA22       0x16c 0x53c 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_D26__EPDC_SDOED              0x16c 0x53c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D27__EIM_DATA27              0x170 0x540 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D27__IPU1_DI1_PIN13          0x170 0x540 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D27__IPU1_CSI0_DATA00        0x170 0x540 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D27__IPU1_CSI1_DATA13        0x170 0x540 0x894 0x3 0x1
-#define MX6DL_PAD_EIM_D27__UART2_RX_DATA           0x170 0x540 0x904 0x4 0x1
-#define MX6DL_PAD_EIM_D27__UART2_TX_DATA           0x170 0x540 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D27__GPIO3_IO27              0x170 0x540 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D27__IPU1_SISG3              0x170 0x540 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D27__IPU1_DISP1_DATA23       0x170 0x540 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_D27__EPDC_SDOE               0x170 0x540 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D28__EIM_DATA28              0x174 0x544 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D28__I2C1_SDA                0x174 0x544 0x86c 0x1 0x1
-#define MX6DL_PAD_EIM_D28__ECSPI4_MOSI             0x174 0x544 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D28__IPU1_CSI1_DATA12        0x174 0x544 0x890 0x3 0x1
-#define MX6DL_PAD_EIM_D28__UART2_CTS_B             0x174 0x544 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D28__UART2_RTS_B             0x174 0x544 0x900 0x4 0x0
-#define MX6DL_PAD_EIM_D28__GPIO3_IO28              0x174 0x544 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D28__IPU1_EXT_TRIG           0x174 0x544 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D28__IPU1_DI0_PIN13          0x174 0x544 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_D28__EPDC_PWR_CTRL3          0x174 0x544 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D29__EIM_DATA29              0x178 0x548 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D29__IPU1_DI1_PIN15          0x178 0x548 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D29__ECSPI4_SS0              0x178 0x548 0x808 0x2 0x1
-#define MX6DL_PAD_EIM_D29__UART2_RTS_B             0x178 0x548 0x900 0x4 0x1
-#define MX6DL_PAD_EIM_D29__UART2_CTS_B             0x178 0x548 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D29__GPIO3_IO29              0x178 0x548 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D29__IPU1_CSI1_VSYNC         0x178 0x548 0x8bc 0x6 0x0
-#define MX6DL_PAD_EIM_D29__IPU1_DI0_PIN14          0x178 0x548 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_D29__EPDC_PWR_WAKE           0x178 0x548 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D30__EIM_DATA30              0x17c 0x54c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D30__IPU1_DISP1_DATA21       0x17c 0x54c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D30__IPU1_DI0_PIN11          0x17c 0x54c 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D30__IPU1_CSI0_DATA03        0x17c 0x54c 0x000 0x3 0x0
-#define MX6DL_PAD_EIM_D30__UART3_CTS_B             0x17c 0x54c 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D30__UART3_RTS_B             0x17c 0x54c 0x908 0x4 0x1
-#define MX6DL_PAD_EIM_D30__GPIO3_IO30              0x17c 0x54c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D30__USB_H1_OC               0x17c 0x54c 0x924 0x6 0x0
-#define MX6DL_PAD_EIM_D30__EPDC_SDOEZ              0x17c 0x54c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D31__EIM_DATA31              0x180 0x550 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_D31__IPU1_DISP1_DATA20       0x180 0x550 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_D31__IPU1_DI0_PIN12          0x180 0x550 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_D31__IPU1_CSI0_DATA02        0x180 0x550 0x000 0x3 0x0
-#define MX6DL_PAD_EIM_D31__UART3_RTS_B             0x180 0x550 0x908 0x4 0x2
-#define MX6DL_PAD_EIM_D31__UART3_CTS_B             0x180 0x550 0x000 0x4 0x0
-#define MX6DL_PAD_EIM_D31__GPIO3_IO31              0x180 0x550 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_D31__USB_H1_PWR              0x180 0x550 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_D31__EPDC_SDCLK_P            0x180 0x550 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_D31__EIM_ACLK_FREERUN        0x180 0x550 0x000 0x9 0x0
-#define MX6DL_PAD_EIM_DA0__EIM_AD00                0x184 0x554 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA0__IPU1_DISP1_DATA09       0x184 0x554 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA0__IPU1_CSI1_DATA09        0x184 0x554 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA0__GPIO3_IO00              0x184 0x554 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA0__SRC_BOOT_CFG00          0x184 0x554 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA0__EPDC_SDCLK_N            0x184 0x554 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA1__EIM_AD01                0x188 0x558 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA1__IPU1_DISP1_DATA08       0x188 0x558 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA1__IPU1_CSI1_DATA08        0x188 0x558 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA1__GPIO3_IO01              0x188 0x558 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA1__SRC_BOOT_CFG01          0x188 0x558 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA1__EPDC_SDLE               0x188 0x558 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA10__EIM_AD10               0x18c 0x55c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA10__IPU1_DI1_PIN15         0x18c 0x55c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA10__IPU1_CSI1_DATA_EN      0x18c 0x55c 0x8b0 0x2 0x1
-#define MX6DL_PAD_EIM_DA10__GPIO3_IO10             0x18c 0x55c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA10__SRC_BOOT_CFG10         0x18c 0x55c 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA10__EPDC_DATA01            0x18c 0x55c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA11__EIM_AD11               0x190 0x560 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA11__IPU1_DI1_PIN02         0x190 0x560 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA11__IPU1_CSI1_HSYNC        0x190 0x560 0x8b4 0x2 0x0
-#define MX6DL_PAD_EIM_DA11__GPIO3_IO11             0x190 0x560 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA11__SRC_BOOT_CFG11         0x190 0x560 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA11__EPDC_DATA03            0x190 0x560 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA12__EIM_AD12               0x194 0x564 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA12__IPU1_DI1_PIN03         0x194 0x564 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA12__IPU1_CSI1_VSYNC        0x194 0x564 0x8bc 0x2 0x1
-#define MX6DL_PAD_EIM_DA12__GPIO3_IO12             0x194 0x564 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA12__SRC_BOOT_CFG12         0x194 0x564 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA12__EPDC_DATA02            0x194 0x564 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA13__EIM_AD13               0x198 0x568 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA13__IPU1_DI1_D0_CS         0x198 0x568 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA13__GPIO3_IO13             0x198 0x568 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA13__SRC_BOOT_CFG13         0x198 0x568 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA13__EPDC_DATA13            0x198 0x568 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA14__EIM_AD14               0x19c 0x56c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA14__IPU1_DI1_D1_CS         0x19c 0x56c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA14__GPIO3_IO14             0x19c 0x56c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA14__SRC_BOOT_CFG14         0x19c 0x56c 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA14__EPDC_DATA14            0x19c 0x56c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA15__EIM_AD15               0x1a0 0x570 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA15__IPU1_DI1_PIN01         0x1a0 0x570 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA15__IPU1_DI1_PIN04         0x1a0 0x570 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA15__GPIO3_IO15             0x1a0 0x570 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA15__SRC_BOOT_CFG15         0x1a0 0x570 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA15__EPDC_DATA09            0x1a0 0x570 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA2__EIM_AD02                0x1a4 0x574 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA2__IPU1_DISP1_DATA07       0x1a4 0x574 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA2__IPU1_CSI1_DATA07        0x1a4 0x574 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA2__GPIO3_IO02              0x1a4 0x574 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA2__SRC_BOOT_CFG02          0x1a4 0x574 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA2__EPDC_BDR0               0x1a4 0x574 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA3__EIM_AD03                0x1a8 0x578 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA3__IPU1_DISP1_DATA06       0x1a8 0x578 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA3__IPU1_CSI1_DATA06        0x1a8 0x578 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA3__GPIO3_IO03              0x1a8 0x578 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA3__SRC_BOOT_CFG03          0x1a8 0x578 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA3__EPDC_BDR1               0x1a8 0x578 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA4__EIM_AD04                0x1ac 0x57c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA4__IPU1_DISP1_DATA05       0x1ac 0x57c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA4__IPU1_CSI1_DATA05        0x1ac 0x57c 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA4__GPIO3_IO04              0x1ac 0x57c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA4__SRC_BOOT_CFG04          0x1ac 0x57c 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA4__EPDC_SDCE0              0x1ac 0x57c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA5__EIM_AD05                0x1b0 0x580 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA5__IPU1_DISP1_DATA04       0x1b0 0x580 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA5__IPU1_CSI1_DATA04        0x1b0 0x580 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA5__GPIO3_IO05              0x1b0 0x580 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA5__SRC_BOOT_CFG05          0x1b0 0x580 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA5__EPDC_SDCE1              0x1b0 0x580 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA6__EIM_AD06                0x1b4 0x584 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA6__IPU1_DISP1_DATA03       0x1b4 0x584 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA6__IPU1_CSI1_DATA03        0x1b4 0x584 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA6__GPIO3_IO06              0x1b4 0x584 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA6__SRC_BOOT_CFG06          0x1b4 0x584 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA6__EPDC_SDCE2              0x1b4 0x584 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA7__EIM_AD07                0x1b8 0x588 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA7__IPU1_DISP1_DATA02       0x1b8 0x588 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA7__IPU1_CSI1_DATA02        0x1b8 0x588 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA7__GPIO3_IO07              0x1b8 0x588 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA7__SRC_BOOT_CFG07          0x1b8 0x588 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA7__EPDC_SDCE3              0x1b8 0x588 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA8__EIM_AD08                0x1bc 0x58c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA8__IPU1_DISP1_DATA01       0x1bc 0x58c 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA8__IPU1_CSI1_DATA01        0x1bc 0x58c 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA8__GPIO3_IO08              0x1bc 0x58c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA8__SRC_BOOT_CFG08          0x1bc 0x58c 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA8__EPDC_SDCE4              0x1bc 0x58c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_DA9__EIM_AD09                0x1c0 0x590 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_DA9__IPU1_DISP1_DATA00       0x1c0 0x590 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_DA9__IPU1_CSI1_DATA00        0x1c0 0x590 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_DA9__GPIO3_IO09              0x1c0 0x590 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_DA9__SRC_BOOT_CFG09          0x1c0 0x590 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_DA9__EPDC_SDCE5              0x1c0 0x590 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_EB0__EIM_EB0_B               0x1c4 0x594 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_EB0__IPU1_DISP1_DATA11       0x1c4 0x594 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_EB0__IPU1_CSI1_DATA11        0x1c4 0x594 0x88c 0x2 0x1
-#define MX6DL_PAD_EIM_EB0__CCM_PMIC_READY          0x1c4 0x594 0x7d4 0x4 0x0
-#define MX6DL_PAD_EIM_EB0__GPIO2_IO28              0x1c4 0x594 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_EB0__SRC_BOOT_CFG27          0x1c4 0x594 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_EB0__EPDC_PWR_COM            0x1c4 0x594 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_EB1__EIM_EB1_B               0x1c8 0x598 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_EB1__IPU1_DISP1_DATA10       0x1c8 0x598 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_EB1__IPU1_CSI1_DATA10        0x1c8 0x598 0x888 0x2 0x1
-#define MX6DL_PAD_EIM_EB1__GPIO2_IO29              0x1c8 0x598 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_EB1__SRC_BOOT_CFG28          0x1c8 0x598 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_EB1__EPDC_SDSHR              0x1c8 0x598 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_EB2__EIM_EB2_B               0x1cc 0x59c 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_EB2__ECSPI1_SS0              0x1cc 0x59c 0x7e4 0x1 0x2
-#define MX6DL_PAD_EIM_EB2__IPU1_CSI1_DATA19        0x1cc 0x59c 0x8ac 0x3 0x1
-#define MX6DL_PAD_EIM_EB2__HDMI_TX_DDC_SCL         0x1cc 0x59c 0x860 0x4 0x0
-#define MX6DL_PAD_EIM_EB2__GPIO2_IO30              0x1cc 0x59c 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_EB2__I2C2_SCL                0x1cc 0x59c 0x870 0x6 0x0
-#define MX6DL_PAD_EIM_EB2__SRC_BOOT_CFG30          0x1cc 0x59c 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_EB2__EPDC_DATA05             0x1cc 0x59c 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_EB3__EIM_EB3_B               0x1d0 0x5a0 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_EB3__ECSPI4_RDY              0x1d0 0x5a0 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_EB3__UART3_RTS_B             0x1d0 0x5a0 0x908 0x2 0x3
-#define MX6DL_PAD_EIM_EB3__UART3_CTS_B             0x1d0 0x5a0 0x000 0x2 0x0
-#define MX6DL_PAD_EIM_EB3__UART1_RI_B              0x1d0 0x5a0 0x000 0x3 0x0
-#define MX6DL_PAD_EIM_EB3__IPU1_CSI1_HSYNC         0x1d0 0x5a0 0x8b4 0x4 0x1
-#define MX6DL_PAD_EIM_EB3__GPIO2_IO31              0x1d0 0x5a0 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_EB3__IPU1_DI1_PIN03          0x1d0 0x5a0 0x000 0x6 0x0
-#define MX6DL_PAD_EIM_EB3__SRC_BOOT_CFG31          0x1d0 0x5a0 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_EB3__EPDC_SDCE0              0x1d0 0x5a0 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_EB3__EIM_ACLK_FREERUN        0x1d0 0x5a0 0x000 0x9 0x0
-#define MX6DL_PAD_EIM_LBA__EIM_LBA_B               0x1d4 0x5a4 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_LBA__IPU1_DI1_PIN17          0x1d4 0x5a4 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_LBA__ECSPI2_SS1              0x1d4 0x5a4 0x804 0x2 0x1
-#define MX6DL_PAD_EIM_LBA__GPIO2_IO27              0x1d4 0x5a4 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_LBA__SRC_BOOT_CFG26          0x1d4 0x5a4 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_LBA__EPDC_DATA04             0x1d4 0x5a4 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_OE__EIM_OE_B                 0x1d8 0x5a8 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_OE__IPU1_DI1_PIN07           0x1d8 0x5a8 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_OE__ECSPI2_MISO              0x1d8 0x5a8 0x7f8 0x2 0x2
-#define MX6DL_PAD_EIM_OE__GPIO2_IO25               0x1d8 0x5a8 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_OE__EPDC_PWR_IRQ             0x1d8 0x5a8 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_RW__EIM_RW                   0x1dc 0x5ac 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_RW__IPU1_DI1_PIN08           0x1dc 0x5ac 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_RW__ECSPI2_SS0               0x1dc 0x5ac 0x800 0x2 0x2
-#define MX6DL_PAD_EIM_RW__GPIO2_IO26               0x1dc 0x5ac 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_RW__SRC_BOOT_CFG29           0x1dc 0x5ac 0x000 0x7 0x0
-#define MX6DL_PAD_EIM_RW__EPDC_DATA07              0x1dc 0x5ac 0x000 0x8 0x0
-#define MX6DL_PAD_EIM_WAIT__EIM_WAIT_B             0x1e0 0x5b0 0x000 0x0 0x0
-#define MX6DL_PAD_EIM_WAIT__EIM_DTACK_B            0x1e0 0x5b0 0x000 0x1 0x0
-#define MX6DL_PAD_EIM_WAIT__GPIO5_IO00             0x1e0 0x5b0 0x000 0x5 0x0
-#define MX6DL_PAD_EIM_WAIT__SRC_BOOT_CFG25         0x1e0 0x5b0 0x000 0x7 0x0
-#define MX6DL_PAD_ENET_CRS_DV__ENET_RX_EN          0x1e4 0x5b4 0x828 0x1 0x0
-#define MX6DL_PAD_ENET_CRS_DV__ESAI_TX_CLK         0x1e4 0x5b4 0x840 0x2 0x0
-#define MX6DL_PAD_ENET_CRS_DV__SPDIF_EXT_CLK       0x1e4 0x5b4 0x8f4 0x3 0x0
-#define MX6DL_PAD_ENET_CRS_DV__GPIO1_IO25          0x1e4 0x5b4 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_MDC__MLB_DATA               0x1e8 0x5b8 0x8e0 0x0 0x0
-#define MX6DL_PAD_ENET_MDC__ENET_MDC               0x1e8 0x5b8 0x000 0x1 0x0
-#define MX6DL_PAD_ENET_MDC__ESAI_TX5_RX0           0x1e8 0x5b8 0x858 0x2 0x0
-#define MX6DL_PAD_ENET_MDC__ENET_1588_EVENT1_IN    0x1e8 0x5b8 0x000 0x4 0x0
-#define MX6DL_PAD_ENET_MDC__GPIO1_IO31             0x1e8 0x5b8 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_MDIO__ENET_MDIO             0x1ec 0x5bc 0x810 0x1 0x0
-#define MX6DL_PAD_ENET_MDIO__ESAI_RX_CLK           0x1ec 0x5bc 0x83c 0x2 0x0
-#define MX6DL_PAD_ENET_MDIO__ENET_1588_EVENT1_OUT  0x1ec 0x5bc 0x000 0x4 0x0
-#define MX6DL_PAD_ENET_MDIO__GPIO1_IO22            0x1ec 0x5bc 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_MDIO__SPDIF_LOCK            0x1ec 0x5bc 0x000 0x6 0x0
-#define MX6DL_PAD_ENET_REF_CLK__ENET_TX_CLK        0x1f0 0x5c0 0x000 0x1 0x0
-#define MX6DL_PAD_ENET_REF_CLK__ESAI_RX_FS         0x1f0 0x5c0 0x82c 0x2 0x0
-#define MX6DL_PAD_ENET_REF_CLK__GPIO1_IO23         0x1f0 0x5c0 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_REF_CLK__SPDIF_SR_CLK       0x1f0 0x5c0 0x000 0x6 0x0
-#define MX6DL_PAD_ENET_RX_ER__USB_OTG_ID           0x1f4 0x5c4 0x790 0x0 0x0
-#define MX6DL_PAD_ENET_RX_ER__ENET_RX_ER           0x1f4 0x5c4 0x000 0x1 0x0
-#define MX6DL_PAD_ENET_RX_ER__ESAI_RX_HF_CLK       0x1f4 0x5c4 0x834 0x2 0x0
-#define MX6DL_PAD_ENET_RX_ER__SPDIF_IN             0x1f4 0x5c4 0x8f0 0x3 0x1
-#define MX6DL_PAD_ENET_RX_ER__ENET_1588_EVENT2_OUT 0x1f4 0x5c4 0x000 0x4 0x0
-#define MX6DL_PAD_ENET_RX_ER__GPIO1_IO24           0x1f4 0x5c4 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_RXD0__ENET_RX_DATA0         0x1f8 0x5c8 0x818 0x1 0x0
-#define MX6DL_PAD_ENET_RXD0__ESAI_TX_HF_CLK        0x1f8 0x5c8 0x838 0x2 0x0
-#define MX6DL_PAD_ENET_RXD0__SPDIF_OUT             0x1f8 0x5c8 0x000 0x3 0x0
-#define MX6DL_PAD_ENET_RXD0__GPIO1_IO27            0x1f8 0x5c8 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_RXD1__MLB_SIG               0x1fc 0x5cc 0x8e4 0x0 0x0
-#define MX6DL_PAD_ENET_RXD1__ENET_RX_DATA1         0x1fc 0x5cc 0x81c 0x1 0x0
-#define MX6DL_PAD_ENET_RXD1__ESAI_TX_FS            0x1fc 0x5cc 0x830 0x2 0x0
-#define MX6DL_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT  0x1fc 0x5cc 0x000 0x4 0x0
-#define MX6DL_PAD_ENET_RXD1__GPIO1_IO26            0x1fc 0x5cc 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_TX_EN__ENET_TX_EN           0x200 0x5d0 0x000 0x1 0x0
-#define MX6DL_PAD_ENET_TX_EN__ESAI_TX3_RX2         0x200 0x5d0 0x850 0x2 0x0
-#define MX6DL_PAD_ENET_TX_EN__GPIO1_IO28           0x200 0x5d0 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_TX_EN__I2C4_SCL             0x200 0x5d0 0x880 0x9 0x0
-#define MX6DL_PAD_ENET_TXD0__ENET_TX_DATA0         0x204 0x5d4 0x000 0x1 0x0
-#define MX6DL_PAD_ENET_TXD0__ESAI_TX4_RX1          0x204 0x5d4 0x854 0x2 0x0
-#define MX6DL_PAD_ENET_TXD0__GPIO1_IO30            0x204 0x5d4 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_TXD1__MLB_CLK               0x208 0x5d8 0x8dc 0x0 0x0
-#define MX6DL_PAD_ENET_TXD1__ENET_TX_DATA1         0x208 0x5d8 0x000 0x1 0x0
-#define MX6DL_PAD_ENET_TXD1__ESAI_TX2_RX3          0x208 0x5d8 0x84c 0x2 0x0
-#define MX6DL_PAD_ENET_TXD1__ENET_1588_EVENT0_IN   0x208 0x5d8 0x000 0x4 0x0
-#define MX6DL_PAD_ENET_TXD1__GPIO1_IO29            0x208 0x5d8 0x000 0x5 0x0
-#define MX6DL_PAD_ENET_TXD1__I2C4_SDA              0x208 0x5d8 0x884 0x9 0x0
-#define MX6DL_PAD_GPIO_0__CCM_CLKO1                0x20c 0x5dc 0x000 0x0 0x0
-#define MX6DL_PAD_GPIO_0__KEY_COL5                 0x20c 0x5dc 0x8c0 0x2 0x1
-#define MX6DL_PAD_GPIO_0__ASRC_EXT_CLK             0x20c 0x5dc 0x794 0x3 0x0
-#define MX6DL_PAD_GPIO_0__EPIT1_OUT                0x20c 0x5dc 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_0__GPIO1_IO00               0x20c 0x5dc 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_0__USB_H1_PWR               0x20c 0x5dc 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_0__SNVS_VIO_5               0x20c 0x5dc 0x000 0x7 0x0
-#define MX6DL_PAD_GPIO_1__ESAI_RX_CLK              0x210 0x5e0 0x83c 0x0 0x1
-#define MX6DL_PAD_GPIO_1__WDOG2_B                  0x210 0x5e0 0x000 0x1 0x0
-#define MX6DL_PAD_GPIO_1__KEY_ROW5                 0x210 0x5e0 0x8cc 0x2 0x1
-#define MX6DL_PAD_GPIO_1__USB_OTG_ID               0x210 0x5e0 0x790 0x3 0x1
-#define MX6DL_PAD_GPIO_1__PWM2_OUT                 0x210 0x5e0 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_1__GPIO1_IO01               0x210 0x5e0 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_1__SD1_CD_B                 0x210 0x5e0 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_16__ESAI_TX3_RX2            0x214 0x5e4 0x850 0x0 0x1
-#define MX6DL_PAD_GPIO_16__ENET_1588_EVENT2_IN     0x214 0x5e4 0x000 0x1 0x0
-#define MX6DL_PAD_GPIO_16__ENET_REF_CLK            0x214 0x5e4 0x80c 0x2 0x0
-#define MX6DL_PAD_GPIO_16__SD1_LCTL                0x214 0x5e4 0x000 0x3 0x0
-#define MX6DL_PAD_GPIO_16__SPDIF_IN                0x214 0x5e4 0x8f0 0x4 0x2
-#define MX6DL_PAD_GPIO_16__GPIO7_IO11              0x214 0x5e4 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_16__I2C3_SDA                0x214 0x5e4 0x87c 0x6 0x1
-#define MX6DL_PAD_GPIO_16__JTAG_DE_B               0x214 0x5e4 0x000 0x7 0x0
-#define MX6DL_PAD_GPIO_17__ESAI_TX0                0x218 0x5e8 0x844 0x0 0x0
-#define MX6DL_PAD_GPIO_17__ENET_1588_EVENT3_IN     0x218 0x5e8 0x000 0x1 0x0
-#define MX6DL_PAD_GPIO_17__CCM_PMIC_READY          0x218 0x5e8 0x7d4 0x2 0x1
-#define MX6DL_PAD_GPIO_17__SDMA_EXT_EVENT0         0x218 0x5e8 0x8e8 0x3 0x1
-#define MX6DL_PAD_GPIO_17__SPDIF_OUT               0x218 0x5e8 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_17__GPIO7_IO12              0x218 0x5e8 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_18__ESAI_TX1                0x21c 0x5ec 0x848 0x0 0x0
-#define MX6DL_PAD_GPIO_18__ENET_RX_CLK             0x21c 0x5ec 0x814 0x1 0x0
-#define MX6DL_PAD_GPIO_18__SD3_VSELECT             0x21c 0x5ec 0x000 0x2 0x0
-#define MX6DL_PAD_GPIO_18__SDMA_EXT_EVENT1         0x21c 0x5ec 0x8ec 0x3 0x1
-#define MX6DL_PAD_GPIO_18__ASRC_EXT_CLK            0x21c 0x5ec 0x794 0x4 0x1
-#define MX6DL_PAD_GPIO_18__GPIO7_IO13              0x21c 0x5ec 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_18__SNVS_VIO_5_CTL          0x21c 0x5ec 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_19__KEY_COL5                0x220 0x5f0 0x8c0 0x0 0x2
-#define MX6DL_PAD_GPIO_19__ENET_1588_EVENT0_OUT    0x220 0x5f0 0x000 0x1 0x0
-#define MX6DL_PAD_GPIO_19__SPDIF_OUT               0x220 0x5f0 0x000 0x2 0x0
-#define MX6DL_PAD_GPIO_19__CCM_CLKO1               0x220 0x5f0 0x000 0x3 0x0
-#define MX6DL_PAD_GPIO_19__ECSPI1_RDY              0x220 0x5f0 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_19__GPIO4_IO05              0x220 0x5f0 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_19__ENET_TX_ER              0x220 0x5f0 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_2__ESAI_TX_FS               0x224 0x5f4 0x830 0x0 0x1
-#define MX6DL_PAD_GPIO_2__KEY_ROW6                 0x224 0x5f4 0x8d0 0x2 0x1
-#define MX6DL_PAD_GPIO_2__GPIO1_IO02               0x224 0x5f4 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_2__SD2_WP                   0x224 0x5f4 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_2__MLB_DATA                 0x224 0x5f4 0x8e0 0x7 0x1
-#define MX6DL_PAD_GPIO_3__ESAI_RX_HF_CLK           0x228 0x5f8 0x834 0x0 0x1
-#define MX6DL_PAD_GPIO_3__I2C3_SCL                 0x228 0x5f8 0x878 0x2 0x1
-#define MX6DL_PAD_GPIO_3__XTALOSC_REF_CLK_24M      0x228 0x5f8 0x000 0x3 0x0
-#define MX6DL_PAD_GPIO_3__CCM_CLKO2                0x228 0x5f8 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_3__GPIO1_IO03               0x228 0x5f8 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_3__USB_H1_OC                0x228 0x5f8 0x924 0x6 0x1
-#define MX6DL_PAD_GPIO_3__MLB_CLK                  0x228 0x5f8 0x8dc 0x7 0x1
-#define MX6DL_PAD_GPIO_4__ESAI_TX_HF_CLK           0x22c 0x5fc 0x838 0x0 0x1
-#define MX6DL_PAD_GPIO_4__KEY_COL7                 0x22c 0x5fc 0x8c8 0x2 0x1
-#define MX6DL_PAD_GPIO_4__GPIO1_IO04               0x22c 0x5fc 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_4__SD2_CD_B                 0x22c 0x5fc 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_5__ESAI_TX2_RX3             0x230 0x600 0x84c 0x0 0x1
-#define MX6DL_PAD_GPIO_5__KEY_ROW7                 0x230 0x600 0x8d4 0x2 0x1
-#define MX6DL_PAD_GPIO_5__CCM_CLKO1                0x230 0x600 0x000 0x3 0x0
-#define MX6DL_PAD_GPIO_5__GPIO1_IO05               0x230 0x600 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_5__I2C3_SCL                 0x230 0x600 0x878 0x6 0x2
-#define MX6DL_PAD_GPIO_5__ARM_EVENTI               0x230 0x600 0x000 0x7 0x0
-#define MX6DL_PAD_GPIO_6__ESAI_TX_CLK              0x234 0x604 0x840 0x0 0x1
-#define MX6DL_PAD_GPIO_6__I2C3_SDA                 0x234 0x604 0x87c 0x2 0x2
-#define MX6DL_PAD_GPIO_6__GPIO1_IO06               0x234 0x604 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_6__SD2_LCTL                 0x234 0x604 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_6__MLB_SIG                  0x234 0x604 0x8e4 0x7 0x1
-#define MX6DL_PAD_GPIO_7__ESAI_TX4_RX1             0x238 0x608 0x854 0x0 0x1
-#define MX6DL_PAD_GPIO_7__EPIT1_OUT                0x238 0x608 0x000 0x2 0x0
-#define MX6DL_PAD_GPIO_7__FLEXCAN1_TX              0x238 0x608 0x000 0x3 0x0
-#define MX6DL_PAD_GPIO_7__UART2_TX_DATA            0x238 0x608 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_7__UART2_RX_DATA            0x238 0x608 0x904 0x4 0x2
-#define MX6DL_PAD_GPIO_7__GPIO1_IO07               0x238 0x608 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_7__SPDIF_LOCK               0x238 0x608 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_7__USB_OTG_HOST_MODE        0x238 0x608 0x000 0x7 0x0
-#define MX6DL_PAD_GPIO_7__I2C4_SCL                 0x238 0x608 0x880 0x8 0x1
-#define MX6DL_PAD_GPIO_8__ESAI_TX5_RX0             0x23c 0x60c 0x858 0x0 0x1
-#define MX6DL_PAD_GPIO_8__XTALOSC_REF_CLK_32K      0x23c 0x60c 0x000 0x1 0x0
-#define MX6DL_PAD_GPIO_8__EPIT2_OUT                0x23c 0x60c 0x000 0x2 0x0
-#define MX6DL_PAD_GPIO_8__FLEXCAN1_RX              0x23c 0x60c 0x7c8 0x3 0x0
-#define MX6DL_PAD_GPIO_8__UART2_RX_DATA            0x23c 0x60c 0x904 0x4 0x3
-#define MX6DL_PAD_GPIO_8__UART2_TX_DATA            0x23c 0x60c 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_8__GPIO1_IO08               0x23c 0x60c 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_8__SPDIF_SR_CLK             0x23c 0x60c 0x000 0x6 0x0
-#define MX6DL_PAD_GPIO_8__USB_OTG_PWR_CTL_WAKE     0x23c 0x60c 0x000 0x7 0x0
-#define MX6DL_PAD_GPIO_8__I2C4_SDA                 0x23c 0x60c 0x884 0x8 0x1
-#define MX6DL_PAD_GPIO_9__ESAI_RX_FS               0x240 0x610 0x82c 0x0 0x1
-#define MX6DL_PAD_GPIO_9__WDOG1_B                  0x240 0x610 0x000 0x1 0x0
-#define MX6DL_PAD_GPIO_9__KEY_COL6                 0x240 0x610 0x8c4 0x2 0x1
-#define MX6DL_PAD_GPIO_9__CCM_REF_EN_B             0x240 0x610 0x000 0x3 0x0
-#define MX6DL_PAD_GPIO_9__PWM1_OUT                 0x240 0x610 0x000 0x4 0x0
-#define MX6DL_PAD_GPIO_9__GPIO1_IO09               0x240 0x610 0x000 0x5 0x0
-#define MX6DL_PAD_GPIO_9__SD1_WP                   0x240 0x610 0x92c 0x6 0x1
-#define MX6DL_PAD_KEY_COL0__ECSPI1_SCLK            0x244 0x62c 0x7d8 0x0 0x3
-#define MX6DL_PAD_KEY_COL0__ENET_RX_DATA3          0x244 0x62c 0x824 0x1 0x0
-#define MX6DL_PAD_KEY_COL0__AUD5_TXC               0x244 0x62c 0x7c0 0x2 0x1
-#define MX6DL_PAD_KEY_COL0__KEY_COL0               0x244 0x62c 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_COL0__UART4_TX_DATA          0x244 0x62c 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_COL0__UART4_RX_DATA          0x244 0x62c 0x914 0x4 0x2
-#define MX6DL_PAD_KEY_COL0__GPIO4_IO06             0x244 0x62c 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_COL0__DCIC1_OUT              0x244 0x62c 0x000 0x6 0x0
-#define MX6DL_PAD_KEY_COL1__ECSPI1_MISO            0x248 0x630 0x7dc 0x0 0x3
-#define MX6DL_PAD_KEY_COL1__ENET_MDIO              0x248 0x630 0x810 0x1 0x1
-#define MX6DL_PAD_KEY_COL1__AUD5_TXFS              0x248 0x630 0x7c4 0x2 0x1
-#define MX6DL_PAD_KEY_COL1__KEY_COL1               0x248 0x630 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_COL1__UART5_TX_DATA          0x248 0x630 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_COL1__UART5_RX_DATA          0x248 0x630 0x91c 0x4 0x2
-#define MX6DL_PAD_KEY_COL1__GPIO4_IO08             0x248 0x630 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_COL1__SD1_VSELECT            0x248 0x630 0x000 0x6 0x0
-#define MX6DL_PAD_KEY_COL2__ECSPI1_SS1             0x24c 0x634 0x7e8 0x0 0x2
-#define MX6DL_PAD_KEY_COL2__ENET_RX_DATA2          0x24c 0x634 0x820 0x1 0x0
-#define MX6DL_PAD_KEY_COL2__FLEXCAN1_TX            0x24c 0x634 0x000 0x2 0x0
-#define MX6DL_PAD_KEY_COL2__KEY_COL2               0x24c 0x634 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_COL2__ENET_MDC               0x24c 0x634 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_COL2__GPIO4_IO10             0x24c 0x634 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_COL2__USB_H1_PWR_CTL_WAKE    0x24c 0x634 0x000 0x6 0x0
-#define MX6DL_PAD_KEY_COL3__ECSPI1_SS3             0x250 0x638 0x7f0 0x0 0x1
-#define MX6DL_PAD_KEY_COL3__ENET_CRS               0x250 0x638 0x000 0x1 0x0
-#define MX6DL_PAD_KEY_COL3__HDMI_TX_DDC_SCL        0x250 0x638 0x860 0x2 0x1
-#define MX6DL_PAD_KEY_COL3__KEY_COL3               0x250 0x638 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_COL3__I2C2_SCL               0x250 0x638 0x870 0x4 0x1
-#define MX6DL_PAD_KEY_COL3__GPIO4_IO12             0x250 0x638 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_COL3__SPDIF_IN               0x250 0x638 0x8f0 0x6 0x3
-#define MX6DL_PAD_KEY_COL4__FLEXCAN2_TX            0x254 0x63c 0x000 0x0 0x0
-#define MX6DL_PAD_KEY_COL4__IPU1_SISG4             0x254 0x63c 0x000 0x1 0x0
-#define MX6DL_PAD_KEY_COL4__USB_OTG_OC             0x254 0x63c 0x920 0x2 0x1
-#define MX6DL_PAD_KEY_COL4__KEY_COL4               0x254 0x63c 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_COL4__UART5_RTS_B            0x254 0x63c 0x918 0x4 0x2
-#define MX6DL_PAD_KEY_COL4__UART5_CTS_B            0x254 0x63c 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_COL4__GPIO4_IO14             0x254 0x63c 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_ROW0__ECSPI1_MOSI            0x258 0x640 0x7e0 0x0 0x3
-#define MX6DL_PAD_KEY_ROW0__ENET_TX_DATA3          0x258 0x640 0x000 0x1 0x0
-#define MX6DL_PAD_KEY_ROW0__AUD5_TXD               0x258 0x640 0x7b4 0x2 0x1
-#define MX6DL_PAD_KEY_ROW0__KEY_ROW0               0x258 0x640 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_ROW0__UART4_RX_DATA          0x258 0x640 0x914 0x4 0x3
-#define MX6DL_PAD_KEY_ROW0__UART4_TX_DATA          0x258 0x640 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_ROW0__GPIO4_IO07             0x258 0x640 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_ROW0__DCIC2_OUT              0x258 0x640 0x000 0x6 0x0
-#define MX6DL_PAD_KEY_ROW1__ECSPI1_SS0             0x25c 0x644 0x7e4 0x0 0x3
-#define MX6DL_PAD_KEY_ROW1__ENET_COL               0x25c 0x644 0x000 0x1 0x0
-#define MX6DL_PAD_KEY_ROW1__AUD5_RXD               0x25c 0x644 0x7b0 0x2 0x1
-#define MX6DL_PAD_KEY_ROW1__KEY_ROW1               0x25c 0x644 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_ROW1__UART5_RX_DATA          0x25c 0x644 0x91c 0x4 0x3
-#define MX6DL_PAD_KEY_ROW1__UART5_TX_DATA          0x25c 0x644 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_ROW1__GPIO4_IO09             0x25c 0x644 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_ROW1__SD2_VSELECT            0x25c 0x644 0x000 0x6 0x0
-#define MX6DL_PAD_KEY_ROW2__ECSPI1_SS2             0x260 0x648 0x7ec 0x0 0x1
-#define MX6DL_PAD_KEY_ROW2__ENET_TX_DATA2          0x260 0x648 0x000 0x1 0x0
-#define MX6DL_PAD_KEY_ROW2__FLEXCAN1_RX            0x260 0x648 0x7c8 0x2 0x1
-#define MX6DL_PAD_KEY_ROW2__KEY_ROW2               0x260 0x648 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_ROW2__SD2_VSELECT            0x260 0x648 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_ROW2__GPIO4_IO11             0x260 0x648 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE       0x260 0x648 0x85c 0x6 0x1
-#define MX6DL_PAD_KEY_ROW3__ASRC_EXT_CLK           0x264 0x64c 0x794 0x1 0x2
-#define MX6DL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA        0x264 0x64c 0x864 0x2 0x1
-#define MX6DL_PAD_KEY_ROW3__KEY_ROW3               0x264 0x64c 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_ROW3__I2C2_SDA               0x264 0x64c 0x874 0x4 0x1
-#define MX6DL_PAD_KEY_ROW3__GPIO4_IO13             0x264 0x64c 0x000 0x5 0x0
-#define MX6DL_PAD_KEY_ROW3__SD1_VSELECT            0x264 0x64c 0x000 0x6 0x0
-#define MX6DL_PAD_KEY_ROW4__FLEXCAN2_RX            0x268 0x650 0x7cc 0x0 0x0
-#define MX6DL_PAD_KEY_ROW4__IPU1_SISG5             0x268 0x650 0x000 0x1 0x0
-#define MX6DL_PAD_KEY_ROW4__USB_OTG_PWR            0x268 0x650 0x000 0x2 0x0
-#define MX6DL_PAD_KEY_ROW4__KEY_ROW4               0x268 0x650 0x000 0x3 0x0
-#define MX6DL_PAD_KEY_ROW4__UART5_CTS_B            0x268 0x650 0x000 0x4 0x0
-#define MX6DL_PAD_KEY_ROW4__UART5_RTS_B            0x268 0x650 0x918 0x4 0x3
-#define MX6DL_PAD_KEY_ROW4__GPIO4_IO15             0x268 0x650 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_ALE__NAND_ALE              0x26c 0x654 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_ALE__SD4_RESET             0x26c 0x654 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_ALE__GPIO6_IO08            0x26c 0x654 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_CLE__NAND_CLE              0x270 0x658 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_CLE__GPIO6_IO07            0x270 0x658 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_CS0__NAND_CE0_B            0x274 0x65c 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_CS0__GPIO6_IO11            0x274 0x65c 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_CS1__NAND_CE1_B            0x278 0x660 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_CS1__SD4_VSELECT           0x278 0x660 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_CS1__SD3_VSELECT           0x278 0x660 0x000 0x2 0x0
-#define MX6DL_PAD_NANDF_CS1__GPIO6_IO14            0x278 0x660 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_CS2__NAND_CE2_B            0x27c 0x664 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_CS2__IPU1_SISG0            0x27c 0x664 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_CS2__ESAI_TX0              0x27c 0x664 0x844 0x2 0x1
-#define MX6DL_PAD_NANDF_CS2__EIM_CRE               0x27c 0x664 0x000 0x3 0x0
-#define MX6DL_PAD_NANDF_CS2__CCM_CLKO2             0x27c 0x664 0x000 0x4 0x0
-#define MX6DL_PAD_NANDF_CS2__GPIO6_IO15            0x27c 0x664 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_CS3__NAND_CE3_B            0x280 0x668 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_CS3__IPU1_SISG1            0x280 0x668 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_CS3__ESAI_TX1              0x280 0x668 0x848 0x2 0x1
-#define MX6DL_PAD_NANDF_CS3__EIM_ADDR26            0x280 0x668 0x000 0x3 0x0
-#define MX6DL_PAD_NANDF_CS3__GPIO6_IO16            0x280 0x668 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_CS3__I2C4_SDA              0x280 0x668 0x884 0x9 0x2
-#define MX6DL_PAD_NANDF_D0__NAND_DATA00            0x284 0x66c 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D0__SD1_DATA4              0x284 0x66c 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D0__GPIO2_IO00             0x284 0x66c 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_D1__NAND_DATA01            0x288 0x670 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D1__SD1_DATA5              0x288 0x670 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D1__GPIO2_IO01             0x288 0x670 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_D2__NAND_DATA02            0x28c 0x674 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D2__SD1_DATA6              0x28c 0x674 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D2__GPIO2_IO02             0x28c 0x674 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_D3__NAND_DATA03            0x290 0x678 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D3__SD1_DATA7              0x290 0x678 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D3__GPIO2_IO03             0x290 0x678 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_D4__NAND_DATA04            0x294 0x67c 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D4__SD2_DATA4              0x294 0x67c 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D4__GPIO2_IO04             0x294 0x67c 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_D5__NAND_DATA05            0x298 0x680 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D5__SD2_DATA5              0x298 0x680 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D5__GPIO2_IO05             0x298 0x680 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_D6__NAND_DATA06            0x29c 0x684 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D6__SD2_DATA6              0x29c 0x684 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D6__GPIO2_IO06             0x29c 0x684 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_D7__NAND_DATA07            0x2a0 0x688 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_D7__SD2_DATA7              0x2a0 0x688 0x000 0x1 0x0
-#define MX6DL_PAD_NANDF_D7__GPIO2_IO07             0x2a0 0x688 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_RB0__NAND_READY_B          0x2a4 0x68c 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_RB0__GPIO6_IO10            0x2a4 0x68c 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_WP_B__NAND_WP_B            0x2a8 0x690 0x000 0x0 0x0
-#define MX6DL_PAD_NANDF_WP_B__GPIO6_IO09           0x2a8 0x690 0x000 0x5 0x0
-#define MX6DL_PAD_NANDF_WP_B__I2C4_SCL             0x2a8 0x690 0x880 0x9 0x2
-#define MX6DL_PAD_RGMII_RD0__HSI_RX_READY          0x2ac 0x694 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_RD0__RGMII_RD0             0x2ac 0x694 0x818 0x1 0x1
-#define MX6DL_PAD_RGMII_RD0__GPIO6_IO25            0x2ac 0x694 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_RD1__HSI_TX_FLAG           0x2b0 0x698 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_RD1__RGMII_RD1             0x2b0 0x698 0x81c 0x1 0x1
-#define MX6DL_PAD_RGMII_RD1__GPIO6_IO27            0x2b0 0x698 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_RD2__HSI_TX_DATA           0x2b4 0x69c 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_RD2__RGMII_RD2             0x2b4 0x69c 0x820 0x1 0x1
-#define MX6DL_PAD_RGMII_RD2__GPIO6_IO28            0x2b4 0x69c 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_RD3__HSI_TX_WAKE           0x2b8 0x6a0 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_RD3__RGMII_RD3             0x2b8 0x6a0 0x824 0x1 0x1
-#define MX6DL_PAD_RGMII_RD3__GPIO6_IO29            0x2b8 0x6a0 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_RX_CTL__USB_H3_DATA        0x2bc 0x6a4 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_RX_CTL__RGMII_RX_CTL       0x2bc 0x6a4 0x828 0x1 0x1
-#define MX6DL_PAD_RGMII_RX_CTL__GPIO6_IO24         0x2bc 0x6a4 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_RXC__USB_H3_STROBE         0x2c0 0x6a8 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_RXC__RGMII_RXC             0x2c0 0x6a8 0x814 0x1 0x1
-#define MX6DL_PAD_RGMII_RXC__GPIO6_IO30            0x2c0 0x6a8 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_TD0__HSI_TX_READY          0x2c4 0x6ac 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_TD0__RGMII_TD0             0x2c4 0x6ac 0x000 0x1 0x0
-#define MX6DL_PAD_RGMII_TD0__GPIO6_IO20            0x2c4 0x6ac 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_TD1__HSI_RX_FLAG           0x2c8 0x6b0 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_TD1__RGMII_TD1             0x2c8 0x6b0 0x000 0x1 0x0
-#define MX6DL_PAD_RGMII_TD1__GPIO6_IO21            0x2c8 0x6b0 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_TD2__HSI_RX_DATA           0x2cc 0x6b4 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_TD2__RGMII_TD2             0x2cc 0x6b4 0x000 0x1 0x0
-#define MX6DL_PAD_RGMII_TD2__GPIO6_IO22            0x2cc 0x6b4 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_TD3__HSI_RX_WAKE           0x2d0 0x6b8 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_TD3__RGMII_TD3             0x2d0 0x6b8 0x000 0x1 0x0
-#define MX6DL_PAD_RGMII_TD3__GPIO6_IO23            0x2d0 0x6b8 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_TX_CTL__USB_H2_STROBE      0x2d4 0x6bc 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_TX_CTL__RGMII_TX_CTL       0x2d4 0x6bc 0x000 0x1 0x0
-#define MX6DL_PAD_RGMII_TX_CTL__GPIO6_IO26         0x2d4 0x6bc 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_TX_CTL__ENET_REF_CLK       0x2d4 0x6bc 0x80c 0x7 0x1
-#define MX6DL_PAD_RGMII_TXC__USB_H2_DATA           0x2d8 0x6c0 0x000 0x0 0x0
-#define MX6DL_PAD_RGMII_TXC__RGMII_TXC             0x2d8 0x6c0 0x000 0x1 0x0
-#define MX6DL_PAD_RGMII_TXC__SPDIF_EXT_CLK         0x2d8 0x6c0 0x8f4 0x2 0x1
-#define MX6DL_PAD_RGMII_TXC__GPIO6_IO19            0x2d8 0x6c0 0x000 0x5 0x0
-#define MX6DL_PAD_RGMII_TXC__XTALOSC_REF_CLK_24M   0x2d8 0x6c0 0x000 0x7 0x0
-#define MX6DL_PAD_SD1_CLK__SD1_CLK                 0x2dc 0x6c4 0x928 0x0 0x1
-#define MX6DL_PAD_SD1_CLK__GPT_CLKIN               0x2dc 0x6c4 0x000 0x3 0x0
-#define MX6DL_PAD_SD1_CLK__GPIO1_IO20              0x2dc 0x6c4 0x000 0x5 0x0
-#define MX6DL_PAD_SD1_CMD__SD1_CMD                 0x2e0 0x6c8 0x000 0x0 0x0
-#define MX6DL_PAD_SD1_CMD__PWM4_OUT                0x2e0 0x6c8 0x000 0x2 0x0
-#define MX6DL_PAD_SD1_CMD__GPT_COMPARE1            0x2e0 0x6c8 0x000 0x3 0x0
-#define MX6DL_PAD_SD1_CMD__GPIO1_IO18              0x2e0 0x6c8 0x000 0x5 0x0
-#define MX6DL_PAD_SD1_DAT0__SD1_DATA0              0x2e4 0x6cc 0x000 0x0 0x0
-#define MX6DL_PAD_SD1_DAT0__GPT_CAPTURE1           0x2e4 0x6cc 0x000 0x3 0x0
-#define MX6DL_PAD_SD1_DAT0__GPIO1_IO16             0x2e4 0x6cc 0x000 0x5 0x0
-#define MX6DL_PAD_SD1_DAT1__SD1_DATA1              0x2e8 0x6d0 0x000 0x0 0x0
-#define MX6DL_PAD_SD1_DAT1__PWM3_OUT               0x2e8 0x6d0 0x000 0x2 0x0
-#define MX6DL_PAD_SD1_DAT1__GPT_CAPTURE2           0x2e8 0x6d0 0x000 0x3 0x0
-#define MX6DL_PAD_SD1_DAT1__GPIO1_IO17             0x2e8 0x6d0 0x000 0x5 0x0
-#define MX6DL_PAD_SD1_DAT2__SD1_DATA2              0x2ec 0x6d4 0x000 0x0 0x0
-#define MX6DL_PAD_SD1_DAT2__GPT_COMPARE2           0x2ec 0x6d4 0x000 0x2 0x0
-#define MX6DL_PAD_SD1_DAT2__PWM2_OUT               0x2ec 0x6d4 0x000 0x3 0x0
-#define MX6DL_PAD_SD1_DAT2__WDOG1_B                0x2ec 0x6d4 0x000 0x4 0x0
-#define MX6DL_PAD_SD1_DAT2__GPIO1_IO19             0x2ec 0x6d4 0x000 0x5 0x0
-#define MX6DL_PAD_SD1_DAT2__WDOG1_RESET_B_DEB      0x2ec 0x6d4 0x000 0x6 0x0
-#define MX6DL_PAD_SD1_DAT3__SD1_DATA3              0x2f0 0x6d8 0x000 0x0 0x0
-#define MX6DL_PAD_SD1_DAT3__GPT_COMPARE3           0x2f0 0x6d8 0x000 0x2 0x0
-#define MX6DL_PAD_SD1_DAT3__PWM1_OUT               0x2f0 0x6d8 0x000 0x3 0x0
-#define MX6DL_PAD_SD1_DAT3__WDOG2_B                0x2f0 0x6d8 0x000 0x4 0x0
-#define MX6DL_PAD_SD1_DAT3__GPIO1_IO21             0x2f0 0x6d8 0x000 0x5 0x0
-#define MX6DL_PAD_SD1_DAT3__WDOG2_RESET_B_DEB      0x2f0 0x6d8 0x000 0x6 0x0
-#define MX6DL_PAD_SD2_CLK__SD2_CLK                 0x2f4 0x6dc 0x930 0x0 0x1
-#define MX6DL_PAD_SD2_CLK__KEY_COL5                0x2f4 0x6dc 0x8c0 0x2 0x3
-#define MX6DL_PAD_SD2_CLK__AUD4_RXFS               0x2f4 0x6dc 0x7a4 0x3 0x1
-#define MX6DL_PAD_SD2_CLK__GPIO1_IO10              0x2f4 0x6dc 0x000 0x5 0x0
-#define MX6DL_PAD_SD2_CMD__SD2_CMD                 0x2f8 0x6e0 0x000 0x0 0x0
-#define MX6DL_PAD_SD2_CMD__KEY_ROW5                0x2f8 0x6e0 0x8cc 0x2 0x2
-#define MX6DL_PAD_SD2_CMD__AUD4_RXC                0x2f8 0x6e0 0x7a0 0x3 0x1
-#define MX6DL_PAD_SD2_CMD__GPIO1_IO11              0x2f8 0x6e0 0x000 0x5 0x0
-#define MX6DL_PAD_SD2_DAT0__SD2_DATA0              0x2fc 0x6e4 0x000 0x0 0x0
-#define MX6DL_PAD_SD2_DAT0__AUD4_RXD               0x2fc 0x6e4 0x798 0x3 0x1
-#define MX6DL_PAD_SD2_DAT0__KEY_ROW7               0x2fc 0x6e4 0x8d4 0x4 0x2
-#define MX6DL_PAD_SD2_DAT0__GPIO1_IO15             0x2fc 0x6e4 0x000 0x5 0x0
-#define MX6DL_PAD_SD2_DAT0__DCIC2_OUT              0x2fc 0x6e4 0x000 0x6 0x0
-#define MX6DL_PAD_SD2_DAT1__SD2_DATA1              0x300 0x6e8 0x000 0x0 0x0
-#define MX6DL_PAD_SD2_DAT1__EIM_CS2_B              0x300 0x6e8 0x000 0x2 0x0
-#define MX6DL_PAD_SD2_DAT1__AUD4_TXFS              0x300 0x6e8 0x7ac 0x3 0x1
-#define MX6DL_PAD_SD2_DAT1__KEY_COL7               0x300 0x6e8 0x8c8 0x4 0x2
-#define MX6DL_PAD_SD2_DAT1__GPIO1_IO14             0x300 0x6e8 0x000 0x5 0x0
-#define MX6DL_PAD_SD2_DAT2__SD2_DATA2              0x304 0x6ec 0x000 0x0 0x0
-#define MX6DL_PAD_SD2_DAT2__EIM_CS3_B              0x304 0x6ec 0x000 0x2 0x0
-#define MX6DL_PAD_SD2_DAT2__AUD4_TXD               0x304 0x6ec 0x79c 0x3 0x1
-#define MX6DL_PAD_SD2_DAT2__KEY_ROW6               0x304 0x6ec 0x8d0 0x4 0x2
-#define MX6DL_PAD_SD2_DAT2__GPIO1_IO13             0x304 0x6ec 0x000 0x5 0x0
-#define MX6DL_PAD_SD2_DAT3__SD2_DATA3              0x308 0x6f0 0x000 0x0 0x0
-#define MX6DL_PAD_SD2_DAT3__KEY_COL6               0x308 0x6f0 0x8c4 0x2 0x2
-#define MX6DL_PAD_SD2_DAT3__AUD4_TXC               0x308 0x6f0 0x7a8 0x3 0x1
-#define MX6DL_PAD_SD2_DAT3__GPIO1_IO12             0x308 0x6f0 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_CLK__SD3_CLK                 0x30c 0x6f4 0x934 0x0 0x1
-#define MX6DL_PAD_SD3_CLK__UART2_RTS_B             0x30c 0x6f4 0x900 0x1 0x2
-#define MX6DL_PAD_SD3_CLK__UART2_CTS_B             0x30c 0x6f4 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_CLK__FLEXCAN1_RX             0x30c 0x6f4 0x7c8 0x2 0x2
-#define MX6DL_PAD_SD3_CLK__GPIO7_IO03              0x30c 0x6f4 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_CMD__SD3_CMD                 0x310 0x6f8 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_CMD__UART2_CTS_B             0x310 0x6f8 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_CMD__UART2_RTS_B             0x310 0x6f8 0x900 0x1 0x3
-#define MX6DL_PAD_SD3_CMD__FLEXCAN1_TX             0x310 0x6f8 0x000 0x2 0x0
-#define MX6DL_PAD_SD3_CMD__GPIO7_IO02              0x310 0x6f8 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT0__SD3_DATA0              0x314 0x6fc 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT0__UART1_CTS_B            0x314 0x6fc 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_DAT0__UART1_RTS_B            0x314 0x6fc 0x8f8 0x1 0x2
-#define MX6DL_PAD_SD3_DAT0__FLEXCAN2_TX            0x314 0x6fc 0x000 0x2 0x0
-#define MX6DL_PAD_SD3_DAT0__GPIO7_IO04             0x314 0x6fc 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT1__SD3_DATA1              0x318 0x700 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT1__UART1_RTS_B            0x318 0x700 0x8f8 0x1 0x3
-#define MX6DL_PAD_SD3_DAT1__UART1_CTS_B            0x318 0x700 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_DAT1__FLEXCAN2_RX            0x318 0x700 0x7cc 0x2 0x1
-#define MX6DL_PAD_SD3_DAT1__GPIO7_IO05             0x318 0x700 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT2__SD3_DATA2              0x31c 0x704 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT2__GPIO7_IO06             0x31c 0x704 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT3__SD3_DATA3              0x320 0x708 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT3__UART3_CTS_B            0x320 0x708 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_DAT3__UART3_RTS_B            0x320 0x708 0x908 0x1 0x4
-#define MX6DL_PAD_SD3_DAT3__GPIO7_IO07             0x320 0x708 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT4__SD3_DATA4              0x324 0x70c 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT4__UART2_RX_DATA          0x324 0x70c 0x904 0x1 0x4
-#define MX6DL_PAD_SD3_DAT4__UART2_TX_DATA          0x324 0x70c 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_DAT4__GPIO7_IO01             0x324 0x70c 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT5__SD3_DATA5              0x328 0x710 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT5__UART2_TX_DATA          0x328 0x710 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_DAT5__UART2_RX_DATA          0x328 0x710 0x904 0x1 0x5
-#define MX6DL_PAD_SD3_DAT5__GPIO7_IO00             0x328 0x710 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT6__SD3_DATA6              0x32c 0x714 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT6__UART1_RX_DATA          0x32c 0x714 0x8fc 0x1 0x2
-#define MX6DL_PAD_SD3_DAT6__UART1_TX_DATA          0x32c 0x714 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_DAT6__GPIO6_IO18             0x32c 0x714 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_DAT7__SD3_DATA7              0x330 0x718 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_DAT7__UART1_TX_DATA          0x330 0x718 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_DAT7__UART1_RX_DATA          0x330 0x718 0x8fc 0x1 0x3
-#define MX6DL_PAD_SD3_DAT7__GPIO6_IO17             0x330 0x718 0x000 0x5 0x0
-#define MX6DL_PAD_SD3_RST__SD3_RESET               0x334 0x71c 0x000 0x0 0x0
-#define MX6DL_PAD_SD3_RST__UART3_RTS_B             0x334 0x71c 0x908 0x1 0x5
-#define MX6DL_PAD_SD3_RST__UART3_CTS_B             0x334 0x71c 0x000 0x1 0x0
-#define MX6DL_PAD_SD3_RST__GPIO7_IO08              0x334 0x71c 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_CLK__SD4_CLK                 0x338 0x720 0x938 0x0 0x1
-#define MX6DL_PAD_SD4_CLK__NAND_WE_B               0x338 0x720 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_CLK__UART3_RX_DATA           0x338 0x720 0x90c 0x2 0x2
-#define MX6DL_PAD_SD4_CLK__UART3_TX_DATA           0x338 0x720 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_CLK__GPIO7_IO10              0x338 0x720 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_CMD__SD4_CMD                 0x33c 0x724 0x000 0x0 0x0
-#define MX6DL_PAD_SD4_CMD__NAND_RE_B               0x33c 0x724 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_CMD__UART3_TX_DATA           0x33c 0x724 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_CMD__UART3_RX_DATA           0x33c 0x724 0x90c 0x2 0x3
-#define MX6DL_PAD_SD4_CMD__GPIO7_IO09              0x33c 0x724 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT0__SD4_DATA0              0x340 0x728 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT0__NAND_DQS               0x340 0x728 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_DAT0__GPIO2_IO08             0x340 0x728 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT1__SD4_DATA1              0x344 0x72c 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT1__PWM3_OUT               0x344 0x72c 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_DAT1__GPIO2_IO09             0x344 0x72c 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT2__SD4_DATA2              0x348 0x730 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT2__PWM4_OUT               0x348 0x730 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_DAT2__GPIO2_IO10             0x348 0x730 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT3__SD4_DATA3              0x34c 0x734 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT3__GPIO2_IO11             0x34c 0x734 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT4__SD4_DATA4              0x350 0x738 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT4__UART2_RX_DATA          0x350 0x738 0x904 0x2 0x6
-#define MX6DL_PAD_SD4_DAT4__UART2_TX_DATA          0x350 0x738 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_DAT4__GPIO2_IO12             0x350 0x738 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT5__SD4_DATA5              0x354 0x73c 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT5__UART2_RTS_B            0x354 0x73c 0x900 0x2 0x4
-#define MX6DL_PAD_SD4_DAT5__UART2_CTS_B            0x354 0x73c 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_DAT5__GPIO2_IO13             0x354 0x73c 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT6__SD4_DATA6              0x358 0x740 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT6__UART2_CTS_B            0x358 0x740 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_DAT6__UART2_RTS_B            0x358 0x740 0x900 0x2 0x5
-#define MX6DL_PAD_SD4_DAT6__GPIO2_IO14             0x358 0x740 0x000 0x5 0x0
-#define MX6DL_PAD_SD4_DAT7__SD4_DATA7              0x35c 0x744 0x000 0x1 0x0
-#define MX6DL_PAD_SD4_DAT7__UART2_TX_DATA          0x35c 0x744 0x000 0x2 0x0
-#define MX6DL_PAD_SD4_DAT7__UART2_RX_DATA          0x35c 0x744 0x904 0x2 0x7
-#define MX6DL_PAD_SD4_DAT7__GPIO2_IO15             0x35c 0x744 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10     0x04c 0x360 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT10__AUD3_RXC             0x04c 0x360 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT10__ECSPI2_MISO          0x04c 0x360 0x7f8 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA        0x04c 0x360 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT10__UART1_RX_DATA        0x04c 0x360 0x8fc 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT10__GPIO5_IO28           0x04c 0x360 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT10__ARM_TRACE07          0x04c 0x360 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11     0x050 0x364 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT11__AUD3_RXFS            0x050 0x364 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT11__ECSPI2_SS0           0x050 0x364 0x800 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA        0x050 0x364 0x8fc 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT11__UART1_TX_DATA        0x050 0x364 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29           0x050 0x364 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT11__ARM_TRACE08          0x050 0x364 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12     0x054 0x368 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT12__EIM_DATA08           0x054 0x368 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA        0x054 0x368 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT12__UART4_RX_DATA        0x054 0x368 0x914 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT12__GPIO5_IO30           0x054 0x368 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT12__ARM_TRACE09          0x054 0x368 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13     0x058 0x36c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT13__EIM_DATA09           0x058 0x36c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA        0x058 0x36c 0x914 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT13__UART4_TX_DATA        0x058 0x36c 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT13__GPIO5_IO31           0x058 0x36c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT13__ARM_TRACE10          0x058 0x36c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14     0x05c 0x370 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT14__EIM_DATA10           0x05c 0x370 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT14__UART5_TX_DATA        0x05c 0x370 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT14__UART5_RX_DATA        0x05c 0x370 0x91c 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00           0x05c 0x370 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT14__ARM_TRACE11          0x05c 0x370 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15     0x060 0x374 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT15__EIM_DATA11           0x060 0x374 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT15__UART5_RX_DATA        0x060 0x374 0x91c 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT15__UART5_TX_DATA        0x060 0x374 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01           0x060 0x374 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT15__ARM_TRACE12          0x060 0x374 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16     0x064 0x378 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT16__EIM_DATA12           0x064 0x378 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B          0x064 0x378 0x910 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B          0x064 0x378 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02           0x064 0x378 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT16__ARM_TRACE13          0x064 0x378 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17     0x068 0x37c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT17__EIM_DATA13           0x068 0x37c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B          0x068 0x37c 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B          0x068 0x37c 0x910 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT17__GPIO6_IO03           0x068 0x37c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT17__ARM_TRACE14          0x068 0x37c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18     0x06c 0x380 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT18__EIM_DATA14           0x06c 0x380 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT18__UART5_RTS_B          0x06c 0x380 0x918 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT18__UART5_CTS_B          0x06c 0x380 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT18__GPIO6_IO04           0x06c 0x380 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT18__ARM_TRACE15          0x06c 0x380 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19     0x070 0x384 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT19__EIM_DATA15           0x070 0x384 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT19__UART5_CTS_B          0x070 0x384 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT19__UART5_RTS_B          0x070 0x384 0x918 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT19__GPIO6_IO05           0x070 0x384 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04      0x074 0x388 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT4__EIM_DATA02            0x074 0x388 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT4__ECSPI1_SCLK           0x074 0x388 0x7d8 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT4__KEY_COL5              0x074 0x388 0x8c0 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT4__AUD3_TXC              0x074 0x388 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT4__GPIO5_IO22            0x074 0x388 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT4__ARM_TRACE01           0x074 0x388 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05      0x078 0x38c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT5__EIM_DATA03            0x078 0x38c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT5__ECSPI1_MOSI           0x078 0x38c 0x7e0 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT5__KEY_ROW5              0x078 0x38c 0x8cc 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT5__AUD3_TXD              0x078 0x38c 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23            0x078 0x38c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT5__ARM_TRACE02           0x078 0x38c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06      0x07c 0x390 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT6__EIM_DATA04            0x07c 0x390 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT6__ECSPI1_MISO           0x07c 0x390 0x7dc 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT6__KEY_COL6              0x07c 0x390 0x8c4 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS             0x07c 0x390 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT6__GPIO5_IO24            0x07c 0x390 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT6__ARM_TRACE03           0x07c 0x390 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07      0x080 0x394 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT7__EIM_DATA05            0x080 0x394 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT7__ECSPI1_SS0            0x080 0x394 0x7e4 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT7__KEY_ROW6              0x080 0x394 0x8d0 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT7__AUD3_RXD              0x080 0x394 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT7__GPIO5_IO25            0x080 0x394 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT7__ARM_TRACE04           0x080 0x394 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08      0x084 0x398 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT8__EIM_DATA06            0x084 0x398 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT8__ECSPI2_SCLK           0x084 0x398 0x7f4 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT8__KEY_COL7              0x084 0x398 0x8c8 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT8__I2C1_SDA              0x084 0x398 0x86c 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26            0x084 0x398 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT8__ARM_TRACE05           0x084 0x398 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09      0x088 0x39c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT9__EIM_DATA07            0x088 0x39c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT9__ECSPI2_MOSI           0x088 0x39c 0x7fc 0x2 0x0
+#define MX6QDL_PAD_CSI0_DAT9__KEY_ROW7              0x088 0x39c 0x8d4 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT9__I2C1_SCL              0x088 0x39c 0x868 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27            0x088 0x39c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT9__ARM_TRACE06           0x088 0x39c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN  0x08c 0x3a0 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__EIM_DATA00         0x08c 0x3a0 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20         0x08c 0x3a0 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__ARM_TRACE_CLK      0x08c 0x3a0 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC       0x090 0x3a4 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_MCLK__CCM_CLKO1             0x090 0x3a4 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_MCLK__GPIO5_IO19            0x090 0x3a4 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_MCLK__ARM_TRACE_CTL         0x090 0x3a4 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK    0x094 0x3a8 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_PIXCLK__GPIO5_IO18          0x094 0x3a8 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_PIXCLK__ARM_EVENTO          0x094 0x3a8 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC      0x098 0x3ac 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__EIM_DATA01           0x098 0x3ac 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__GPIO5_IO21           0x098 0x3ac 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__ARM_TRACE00          0x098 0x3ac 0x000 0x7 0x0
+#define MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK  0x09c 0x3b0 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_DISP_CLK__LCD_CLK            0x09c 0x3b0 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_DISP_CLK__GPIO4_IO16         0x09c 0x3b0 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_DISP_CLK__LCD_WR_RWN         0x09c 0x3b0 0x000 0x8 0x0
+#define MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15        0x0a0 0x3b4 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN15__LCD_ENABLE            0x0a0 0x3b4 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_PIN15__AUD6_TXC              0x0a0 0x3b4 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN15__GPIO4_IO17            0x0a0 0x3b4 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN15__LCD_RD_E              0x0a0 0x3b4 0x000 0x8 0x0
+#define MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02         0x0a4 0x3b8 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN2__LCD_HSYNC              0x0a4 0x3b8 0x8d8 0x1 0x0
+#define MX6QDL_PAD_DI0_PIN2__AUD6_TXD               0x0a4 0x3b8 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN2__GPIO4_IO18             0x0a4 0x3b8 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN2__LCD_RS                 0x0a4 0x3b8 0x000 0x8 0x0
+#define MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03         0x0a8 0x3bc 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN3__LCD_VSYNC              0x0a8 0x3bc 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_PIN3__AUD6_TXFS              0x0a8 0x3bc 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN3__GPIO4_IO19             0x0a8 0x3bc 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN3__LCD_CS                 0x0a8 0x3bc 0x000 0x8 0x0
+#define MX6QDL_PAD_DI0_PIN4__IPU1_DI0_PIN04         0x0ac 0x3c0 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN4__LCD_BUSY               0x0ac 0x3c0 0x8d8 0x1 0x1
+#define MX6QDL_PAD_DI0_PIN4__AUD6_RXD               0x0ac 0x3c0 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN4__SD1_WP                 0x0ac 0x3c0 0x92c 0x3 0x0
+#define MX6QDL_PAD_DI0_PIN4__GPIO4_IO20             0x0ac 0x3c0 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN4__LCD_RESET              0x0ac 0x3c0 0x000 0x8 0x0
+#define MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00    0x0b0 0x3c4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT0__LCD_DATA00           0x0b0 0x3c4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK          0x0b0 0x3c4 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT0__GPIO4_IO21           0x0b0 0x3c4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01    0x0b4 0x3c8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT1__LCD_DATA01           0x0b4 0x3c8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI          0x0b4 0x3c8 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT1__GPIO4_IO22           0x0b4 0x3c8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10   0x0b8 0x3cc 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT10__LCD_DATA10          0x0b8 0x3cc 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT10__GPIO4_IO31          0x0b8 0x3cc 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11   0x0bc 0x3d0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT11__LCD_DATA11          0x0bc 0x3d0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05          0x0bc 0x3d0 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12   0x0c0 0x3d4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT12__LCD_DATA12          0x0c0 0x3d4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT12__GPIO5_IO06          0x0c0 0x3d4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13   0x0c4 0x3d8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT13__LCD_DATA13          0x0c4 0x3d8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT13__AUD5_RXFS           0x0c4 0x3d8 0x7bc 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT13__GPIO5_IO07          0x0c4 0x3d8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14   0x0c8 0x3dc 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT14__LCD_DATA14          0x0c8 0x3dc 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT14__AUD5_RXC            0x0c8 0x3dc 0x7b8 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT14__GPIO5_IO08          0x0c8 0x3dc 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15   0x0cc 0x3e0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT15__LCD_DATA15          0x0cc 0x3e0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT15__ECSPI1_SS1          0x0cc 0x3e0 0x7e8 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT15__ECSPI2_SS1          0x0cc 0x3e0 0x804 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT15__GPIO5_IO09          0x0cc 0x3e0 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16   0x0d0 0x3e4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT16__LCD_DATA16          0x0d0 0x3e4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT16__ECSPI2_MOSI         0x0d0 0x3e4 0x7fc 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT16__AUD5_TXC            0x0d0 0x3e4 0x7c0 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT16__SDMA_EXT_EVENT0     0x0d0 0x3e4 0x8e8 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT16__GPIO5_IO10          0x0d0 0x3e4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17   0x0d4 0x3e8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT17__LCD_DATA17          0x0d4 0x3e8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT17__ECSPI2_MISO         0x0d4 0x3e8 0x7f8 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT17__AUD5_TXD            0x0d4 0x3e8 0x7b4 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT17__SDMA_EXT_EVENT1     0x0d4 0x3e8 0x8ec 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT17__GPIO5_IO11          0x0d4 0x3e8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18   0x0d8 0x3ec 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT18__LCD_DATA18          0x0d8 0x3ec 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT18__ECSPI2_SS0          0x0d8 0x3ec 0x800 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS           0x0d8 0x3ec 0x7c4 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT18__AUD4_RXFS           0x0d8 0x3ec 0x7a4 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12          0x0d8 0x3ec 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT18__EIM_CS2_B           0x0d8 0x3ec 0x000 0x7 0x0
+#define MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19   0x0dc 0x3f0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT19__LCD_DATA19          0x0dc 0x3f0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT19__ECSPI2_SCLK         0x0dc 0x3f0 0x7f4 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT19__AUD5_RXD            0x0dc 0x3f0 0x7b0 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT19__AUD4_RXC            0x0dc 0x3f0 0x7a0 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13          0x0dc 0x3f0 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT19__EIM_CS3_B           0x0dc 0x3f0 0x000 0x7 0x0
+#define MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02    0x0e0 0x3f4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT2__LCD_DATA02           0x0e0 0x3f4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO          0x0e0 0x3f4 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT2__GPIO4_IO23           0x0e0 0x3f4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20   0x0e4 0x3f8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT20__LCD_DATA20          0x0e4 0x3f8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT20__ECSPI1_SCLK         0x0e4 0x3f8 0x7d8 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT20__AUD4_TXC            0x0e4 0x3f8 0x7a8 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14          0x0e4 0x3f8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21   0x0e8 0x3fc 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT21__LCD_DATA21          0x0e8 0x3fc 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT21__ECSPI1_MOSI         0x0e8 0x3fc 0x7e0 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT21__AUD4_TXD            0x0e8 0x3fc 0x79c 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15          0x0e8 0x3fc 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22   0x0ec 0x400 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT22__LCD_DATA22          0x0ec 0x400 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT22__ECSPI1_MISO         0x0ec 0x400 0x7dc 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS           0x0ec 0x400 0x7ac 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16          0x0ec 0x400 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23   0x0f0 0x404 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT23__LCD_DATA23          0x0f0 0x404 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT23__ECSPI1_SS0          0x0f0 0x404 0x7e4 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT23__AUD4_RXD            0x0f0 0x404 0x798 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17          0x0f0 0x404 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03    0x0f4 0x408 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT3__LCD_DATA03           0x0f4 0x408 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT3__ECSPI3_SS0           0x0f4 0x408 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24           0x0f4 0x408 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04    0x0f8 0x40c 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT4__LCD_DATA04           0x0f8 0x40c 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT4__ECSPI3_SS1           0x0f8 0x40c 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT4__GPIO4_IO25           0x0f8 0x40c 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05    0x0fc 0x410 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT5__LCD_DATA05           0x0fc 0x410 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT5__ECSPI3_SS2           0x0fc 0x410 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT5__AUD6_RXFS            0x0fc 0x410 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT5__GPIO4_IO26           0x0fc 0x410 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06    0x100 0x414 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT6__LCD_DATA06           0x100 0x414 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT6__ECSPI3_SS3           0x100 0x414 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT6__AUD6_RXC             0x100 0x414 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT6__GPIO4_IO27           0x100 0x414 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07    0x104 0x418 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT7__LCD_DATA07           0x104 0x418 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT7__ECSPI3_RDY           0x104 0x418 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT7__GPIO4_IO28           0x104 0x418 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08    0x108 0x41c 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT8__LCD_DATA08           0x108 0x41c 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT8__PWM1_OUT             0x108 0x41c 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT8__WDOG1_B              0x108 0x41c 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT8__GPIO4_IO29           0x108 0x41c 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09    0x10c 0x420 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT9__LCD_DATA09           0x10c 0x420 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT9__PWM2_OUT             0x10c 0x420 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT9__WDOG2_B              0x10c 0x420 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT9__GPIO4_IO30           0x10c 0x420 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A16__EIM_ADDR16              0x110 0x4e0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A16__IPU1_DI1_DISP_CLK       0x110 0x4e0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A16__IPU1_CSI1_PIXCLK        0x110 0x4e0 0x8b8 0x2 0x0
+#define MX6QDL_PAD_EIM_A16__GPIO2_IO22              0x110 0x4e0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A16__SRC_BOOT_CFG16          0x110 0x4e0 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A16__EPDC_DATA00             0x110 0x4e0 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A17__EIM_ADDR17              0x114 0x4e4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A17__IPU1_DISP1_DATA12       0x114 0x4e4 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A17__IPU1_CSI1_DATA12        0x114 0x4e4 0x890 0x2 0x0
+#define MX6QDL_PAD_EIM_A17__GPIO2_IO21              0x114 0x4e4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A17__SRC_BOOT_CFG17          0x114 0x4e4 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A17__EPDC_PWR_STAT           0x114 0x4e4 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A18__EIM_ADDR18              0x118 0x4e8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A18__IPU1_DISP1_DATA13       0x118 0x4e8 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A18__IPU1_CSI1_DATA13        0x118 0x4e8 0x894 0x2 0x0
+#define MX6QDL_PAD_EIM_A18__GPIO2_IO20              0x118 0x4e8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A18__SRC_BOOT_CFG18          0x118 0x4e8 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A18__EPDC_PWR_CTRL0          0x118 0x4e8 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A19__EIM_ADDR19              0x11c 0x4ec 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A19__IPU1_DISP1_DATA14       0x11c 0x4ec 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A19__IPU1_CSI1_DATA14        0x11c 0x4ec 0x898 0x2 0x0
+#define MX6QDL_PAD_EIM_A19__GPIO2_IO19              0x11c 0x4ec 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A19__SRC_BOOT_CFG19          0x11c 0x4ec 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A19__EPDC_PWR_CTRL1          0x11c 0x4ec 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A20__EIM_ADDR20              0x120 0x4f0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A20__IPU1_DISP1_DATA15       0x120 0x4f0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A20__IPU1_CSI1_DATA15        0x120 0x4f0 0x89c 0x2 0x0
+#define MX6QDL_PAD_EIM_A20__GPIO2_IO18              0x120 0x4f0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A20__SRC_BOOT_CFG20          0x120 0x4f0 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A20__EPDC_PWR_CTRL2          0x120 0x4f0 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A21__EIM_ADDR21              0x124 0x4f4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A21__IPU1_DISP1_DATA16       0x124 0x4f4 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A21__IPU1_CSI1_DATA16        0x124 0x4f4 0x8a0 0x2 0x0
+#define MX6QDL_PAD_EIM_A21__GPIO2_IO17              0x124 0x4f4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A21__SRC_BOOT_CFG21          0x124 0x4f4 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A21__EPDC_GDCLK              0x124 0x4f4 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A22__EIM_ADDR22              0x128 0x4f8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A22__IPU1_DISP1_DATA17       0x128 0x4f8 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A22__IPU1_CSI1_DATA17        0x128 0x4f8 0x8a4 0x2 0x0
+#define MX6QDL_PAD_EIM_A22__GPIO2_IO16              0x128 0x4f8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A22__SRC_BOOT_CFG22          0x128 0x4f8 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A22__EPDC_GDSP               0x128 0x4f8 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A23__EIM_ADDR23              0x12c 0x4fc 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A23__IPU1_DISP1_DATA18       0x12c 0x4fc 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A23__IPU1_CSI1_DATA18        0x12c 0x4fc 0x8a8 0x2 0x0
+#define MX6QDL_PAD_EIM_A23__IPU1_SISG3              0x12c 0x4fc 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_A23__GPIO6_IO06              0x12c 0x4fc 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A23__SRC_BOOT_CFG23          0x12c 0x4fc 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A23__EPDC_GDOE               0x12c 0x4fc 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A24__EIM_ADDR24              0x130 0x500 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A24__IPU1_DISP1_DATA19       0x130 0x500 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A24__IPU1_CSI1_DATA19        0x130 0x500 0x8ac 0x2 0x0
+#define MX6QDL_PAD_EIM_A24__IPU1_SISG2              0x130 0x500 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_A24__GPIO5_IO04              0x130 0x500 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A24__SRC_BOOT_CFG24          0x130 0x500 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A24__EPDC_GDRL               0x130 0x500 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A25__EIM_ADDR25              0x134 0x504 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A25__ECSPI4_SS1              0x134 0x504 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A25__ECSPI2_RDY              0x134 0x504 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_A25__IPU1_DI1_PIN12          0x134 0x504 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_A25__IPU1_DI0_D1_CS          0x134 0x504 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_A25__GPIO5_IO02              0x134 0x504 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A25__HDMI_TX_CEC_LINE        0x134 0x504 0x85c 0x6 0x0
+#define MX6QDL_PAD_EIM_A25__EPDC_DATA15             0x134 0x504 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_A25__EIM_ACLK_FREERUN        0x134 0x504 0x000 0x9 0x0
+#define MX6QDL_PAD_EIM_BCLK__EIM_BCLK               0x138 0x508 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_BCLK__IPU1_DI1_PIN16         0x138 0x508 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_BCLK__GPIO6_IO31             0x138 0x508 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_BCLK__EPDC_SDCE9             0x138 0x508 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_CS0__EIM_CS0_B               0x13c 0x50c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_CS0__IPU1_DI1_PIN05          0x13c 0x50c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_CS0__ECSPI2_SCLK             0x13c 0x50c 0x7f4 0x2 0x2
+#define MX6QDL_PAD_EIM_CS0__GPIO2_IO23              0x13c 0x50c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_CS0__EPDC_DATA06             0x13c 0x50c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_CS1__EIM_CS1_B               0x140 0x510 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_CS1__IPU1_DI1_PIN06          0x140 0x510 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_CS1__ECSPI2_MOSI             0x140 0x510 0x7fc 0x2 0x2
+#define MX6QDL_PAD_EIM_CS1__GPIO2_IO24              0x140 0x510 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_CS1__EPDC_DATA08             0x140 0x510 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D16__EIM_DATA16              0x144 0x514 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D16__ECSPI1_SCLK             0x144 0x514 0x7d8 0x1 0x2
+#define MX6QDL_PAD_EIM_D16__IPU1_DI0_PIN05          0x144 0x514 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D16__IPU1_CSI1_DATA18        0x144 0x514 0x8a8 0x3 0x1
+#define MX6QDL_PAD_EIM_D16__HDMI_TX_DDC_SDA         0x144 0x514 0x864 0x4 0x0
+#define MX6QDL_PAD_EIM_D16__GPIO3_IO16              0x144 0x514 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D16__I2C2_SDA                0x144 0x514 0x874 0x6 0x0
+#define MX6QDL_PAD_EIM_D16__EPDC_DATA10             0x144 0x514 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D17__EIM_DATA17              0x148 0x518 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D17__ECSPI1_MISO             0x148 0x518 0x7dc 0x1 0x2
+#define MX6QDL_PAD_EIM_D17__IPU1_DI0_PIN06          0x148 0x518 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D17__IPU1_CSI1_PIXCLK        0x148 0x518 0x8b8 0x3 0x1
+#define MX6QDL_PAD_EIM_D17__DCIC1_OUT               0x148 0x518 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D17__GPIO3_IO17              0x148 0x518 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D17__I2C3_SCL                0x148 0x518 0x878 0x6 0x0
+#define MX6QDL_PAD_EIM_D17__EPDC_VCOM0              0x148 0x518 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D18__EIM_DATA18              0x14c 0x51c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D18__ECSPI1_MOSI             0x14c 0x51c 0x7e0 0x1 0x2
+#define MX6QDL_PAD_EIM_D18__IPU1_DI0_PIN07          0x14c 0x51c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D18__IPU1_CSI1_DATA17        0x14c 0x51c 0x8a4 0x3 0x1
+#define MX6QDL_PAD_EIM_D18__IPU1_DI1_D0_CS          0x14c 0x51c 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D18__GPIO3_IO18              0x14c 0x51c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D18__I2C3_SDA                0x14c 0x51c 0x87c 0x6 0x0
+#define MX6QDL_PAD_EIM_D18__EPDC_VCOM1              0x14c 0x51c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D19__EIM_DATA19              0x150 0x520 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D19__ECSPI1_SS1              0x150 0x520 0x7e8 0x1 0x1
+#define MX6QDL_PAD_EIM_D19__IPU1_DI0_PIN08          0x150 0x520 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D19__IPU1_CSI1_DATA16        0x150 0x520 0x8a0 0x3 0x1
+#define MX6QDL_PAD_EIM_D19__UART1_CTS_B             0x150 0x520 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D19__UART1_RTS_B             0x150 0x520 0x8f8 0x4 0x0
+#define MX6QDL_PAD_EIM_D19__GPIO3_IO19              0x150 0x520 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D19__EPIT1_OUT               0x150 0x520 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D19__EPDC_DATA12             0x150 0x520 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D20__EIM_DATA20              0x154 0x524 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D20__ECSPI4_SS0              0x154 0x524 0x808 0x1 0x0
+#define MX6QDL_PAD_EIM_D20__IPU1_DI0_PIN16          0x154 0x524 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D20__IPU1_CSI1_DATA15        0x154 0x524 0x89c 0x3 0x1
+#define MX6QDL_PAD_EIM_D20__UART1_RTS_B             0x154 0x524 0x8f8 0x4 0x1
+#define MX6QDL_PAD_EIM_D20__UART1_CTS_B             0x154 0x524 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D20__GPIO3_IO20              0x154 0x524 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D20__EPIT2_OUT               0x154 0x524 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D21__EIM_DATA21              0x158 0x528 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D21__ECSPI4_SCLK             0x158 0x528 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D21__IPU1_DI0_PIN17          0x158 0x528 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D21__IPU1_CSI1_DATA11        0x158 0x528 0x88c 0x3 0x0
+#define MX6QDL_PAD_EIM_D21__USB_OTG_OC              0x158 0x528 0x920 0x4 0x0
+#define MX6QDL_PAD_EIM_D21__GPIO3_IO21              0x158 0x528 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D21__I2C1_SCL                0x158 0x528 0x868 0x6 0x1
+#define MX6QDL_PAD_EIM_D21__SPDIF_IN                0x158 0x528 0x8f0 0x7 0x0
+#define MX6QDL_PAD_EIM_D22__EIM_DATA22              0x15c 0x52c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D22__ECSPI4_MISO             0x15c 0x52c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D22__IPU1_DI0_PIN01          0x15c 0x52c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D22__IPU1_CSI1_DATA10        0x15c 0x52c 0x888 0x3 0x0
+#define MX6QDL_PAD_EIM_D22__USB_OTG_PWR             0x15c 0x52c 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D22__GPIO3_IO22              0x15c 0x52c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D22__SPDIF_OUT               0x15c 0x52c 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D22__EPDC_SDCE6              0x15c 0x52c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D23__EIM_DATA23              0x160 0x530 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D23__IPU1_DI0_D0_CS          0x160 0x530 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D23__UART3_CTS_B             0x160 0x530 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D23__UART3_RTS_B             0x160 0x530 0x908 0x2 0x0
+#define MX6QDL_PAD_EIM_D23__UART1_DCD_B             0x160 0x530 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_D23__IPU1_CSI1_DATA_EN       0x160 0x530 0x8b0 0x4 0x0
+#define MX6QDL_PAD_EIM_D23__GPIO3_IO23              0x160 0x530 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D23__IPU1_DI1_PIN02          0x160 0x530 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D23__IPU1_DI1_PIN14          0x160 0x530 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D23__EPDC_DATA11             0x160 0x530 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D24__EIM_DATA24              0x164 0x534 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D24__ECSPI4_SS2              0x164 0x534 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D24__UART3_TX_DATA           0x164 0x534 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D24__UART3_RX_DATA           0x164 0x534 0x90c 0x2 0x0
+#define MX6QDL_PAD_EIM_D24__ECSPI1_SS2              0x164 0x534 0x7ec 0x3 0x0
+#define MX6QDL_PAD_EIM_D24__ECSPI2_SS2              0x164 0x534 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D24__GPIO3_IO24              0x164 0x534 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D24__AUD5_RXFS               0x164 0x534 0x7bc 0x6 0x1
+#define MX6QDL_PAD_EIM_D24__UART1_DTR_B             0x164 0x534 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D24__EPDC_SDCE7              0x164 0x534 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D25__EIM_DATA25              0x168 0x538 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D25__ECSPI4_SS3              0x168 0x538 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D25__UART3_RX_DATA           0x168 0x538 0x90c 0x2 0x1
+#define MX6QDL_PAD_EIM_D25__UART3_TX_DATA           0x168 0x538 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D25__ECSPI1_SS3              0x168 0x538 0x7f0 0x3 0x0
+#define MX6QDL_PAD_EIM_D25__ECSPI2_SS3              0x168 0x538 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D25__GPIO3_IO25              0x168 0x538 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D25__AUD5_RXC                0x168 0x538 0x7b8 0x6 0x1
+#define MX6QDL_PAD_EIM_D25__UART1_DSR_B             0x168 0x538 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D25__EPDC_SDCE8              0x168 0x538 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D26__EIM_DATA26              0x16c 0x53c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_DI1_PIN11          0x16c 0x53c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_CSI0_DATA01        0x16c 0x53c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_CSI1_DATA14        0x16c 0x53c 0x898 0x3 0x1
+#define MX6QDL_PAD_EIM_D26__UART2_TX_DATA           0x16c 0x53c 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D26__UART2_RX_DATA           0x16c 0x53c 0x904 0x4 0x0
+#define MX6QDL_PAD_EIM_D26__GPIO3_IO26              0x16c 0x53c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_SISG2              0x16c 0x53c 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_DISP1_DATA22       0x16c 0x53c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D26__EPDC_SDOED              0x16c 0x53c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D27__EIM_DATA27              0x170 0x540 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_DI1_PIN13          0x170 0x540 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_CSI0_DATA00        0x170 0x540 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_CSI1_DATA13        0x170 0x540 0x894 0x3 0x1
+#define MX6QDL_PAD_EIM_D27__UART2_RX_DATA           0x170 0x540 0x904 0x4 0x1
+#define MX6QDL_PAD_EIM_D27__UART2_TX_DATA           0x170 0x540 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D27__GPIO3_IO27              0x170 0x540 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_SISG3              0x170 0x540 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_DISP1_DATA23       0x170 0x540 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D27__EPDC_SDOE               0x170 0x540 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D28__EIM_DATA28              0x174 0x544 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D28__I2C1_SDA                0x174 0x544 0x86c 0x1 0x1
+#define MX6QDL_PAD_EIM_D28__ECSPI4_MOSI             0x174 0x544 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D28__IPU1_CSI1_DATA12        0x174 0x544 0x890 0x3 0x1
+#define MX6QDL_PAD_EIM_D28__UART2_CTS_B             0x174 0x544 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__UART2_RTS_B             0x174 0x544 0x900 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__UART2_DTE_CTS_B         0x174 0x544 0x900 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__UART2_DTE_RTS_B         0x174 0x544 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__GPIO3_IO28              0x174 0x544 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D28__IPU1_EXT_TRIG           0x174 0x544 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D28__IPU1_DI0_PIN13          0x174 0x544 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D28__EPDC_PWR_CTRL3          0x174 0x544 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D29__EIM_DATA29              0x178 0x548 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D29__IPU1_DI1_PIN15          0x178 0x548 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D29__ECSPI4_SS0              0x178 0x548 0x808 0x2 0x1
+#define MX6QDL_PAD_EIM_D29__UART2_RTS_B             0x178 0x548 0x900 0x4 0x1
+#define MX6QDL_PAD_EIM_D29__UART2_CTS_B             0x178 0x548 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D29__UART2_DTE_RTS_B         0x178 0x548 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D29__UART2_DTE_CTS_B         0x178 0x548 0x900 0x4 0x1
+#define MX6QDL_PAD_EIM_D29__GPIO3_IO29              0x178 0x548 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D29__IPU1_CSI1_VSYNC         0x178 0x548 0x8bc 0x6 0x0
+#define MX6QDL_PAD_EIM_D29__IPU1_DI0_PIN14          0x178 0x548 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D29__EPDC_PWR_WAKE           0x178 0x548 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D30__EIM_DATA30              0x17c 0x54c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D30__IPU1_DISP1_DATA21       0x17c 0x54c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D30__IPU1_DI0_PIN11          0x17c 0x54c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D30__IPU1_CSI0_DATA03        0x17c 0x54c 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_D30__UART3_CTS_B             0x17c 0x54c 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D30__UART3_RTS_B             0x17c 0x54c 0x908 0x4 0x1
+#define MX6QDL_PAD_EIM_D30__GPIO3_IO30              0x17c 0x54c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D30__USB_H1_OC               0x17c 0x54c 0x924 0x6 0x0
+#define MX6QDL_PAD_EIM_D30__EPDC_SDOEZ              0x17c 0x54c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D31__EIM_DATA31              0x180 0x550 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D31__IPU1_DISP1_DATA20       0x180 0x550 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D31__IPU1_DI0_PIN12          0x180 0x550 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D31__IPU1_CSI0_DATA02        0x180 0x550 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_D31__UART3_RTS_B             0x180 0x550 0x908 0x4 0x2
+#define MX6QDL_PAD_EIM_D31__UART3_CTS_B             0x180 0x550 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D31__GPIO3_IO31              0x180 0x550 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D31__USB_H1_PWR              0x180 0x550 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D31__EPDC_SDCLK_P            0x180 0x550 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_D31__EIM_ACLK_FREERUN        0x180 0x550 0x000 0x9 0x0
+#define MX6QDL_PAD_EIM_DA0__EIM_AD00                0x184 0x554 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA0__IPU1_DISP1_DATA09       0x184 0x554 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA0__IPU1_CSI1_DATA09        0x184 0x554 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA0__GPIO3_IO00              0x184 0x554 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA0__SRC_BOOT_CFG00          0x184 0x554 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA0__EPDC_SDCLK_N            0x184 0x554 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA1__EIM_AD01                0x188 0x558 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA1__IPU1_DISP1_DATA08       0x188 0x558 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA1__IPU1_CSI1_DATA08        0x188 0x558 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA1__GPIO3_IO01              0x188 0x558 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA1__SRC_BOOT_CFG01          0x188 0x558 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA1__EPDC_SDLE               0x188 0x558 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA10__EIM_AD10               0x18c 0x55c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA10__IPU1_DI1_PIN15         0x18c 0x55c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA10__IPU1_CSI1_DATA_EN      0x18c 0x55c 0x8b0 0x2 0x1
+#define MX6QDL_PAD_EIM_DA10__GPIO3_IO10             0x18c 0x55c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA10__SRC_BOOT_CFG10         0x18c 0x55c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA10__EPDC_DATA01            0x18c 0x55c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA11__EIM_AD11               0x190 0x560 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA11__IPU1_DI1_PIN02         0x190 0x560 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA11__IPU1_CSI1_HSYNC        0x190 0x560 0x8b4 0x2 0x0
+#define MX6QDL_PAD_EIM_DA11__GPIO3_IO11             0x190 0x560 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA11__SRC_BOOT_CFG11         0x190 0x560 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA11__EPDC_DATA03            0x190 0x560 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA12__EIM_AD12               0x194 0x564 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA12__IPU1_DI1_PIN03         0x194 0x564 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA12__IPU1_CSI1_VSYNC        0x194 0x564 0x8bc 0x2 0x1
+#define MX6QDL_PAD_EIM_DA12__GPIO3_IO12             0x194 0x564 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA12__SRC_BOOT_CFG12         0x194 0x564 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA12__EPDC_DATA02            0x194 0x564 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA13__EIM_AD13               0x198 0x568 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA13__IPU1_DI1_D0_CS         0x198 0x568 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA13__GPIO3_IO13             0x198 0x568 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA13__SRC_BOOT_CFG13         0x198 0x568 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA13__EPDC_DATA13            0x198 0x568 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA14__EIM_AD14               0x19c 0x56c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA14__IPU1_DI1_D1_CS         0x19c 0x56c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA14__GPIO3_IO14             0x19c 0x56c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA14__SRC_BOOT_CFG14         0x19c 0x56c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA14__EPDC_DATA14            0x19c 0x56c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA15__EIM_AD15               0x1a0 0x570 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA15__IPU1_DI1_PIN01         0x1a0 0x570 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA15__IPU1_DI1_PIN04         0x1a0 0x570 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA15__GPIO3_IO15             0x1a0 0x570 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA15__SRC_BOOT_CFG15         0x1a0 0x570 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA15__EPDC_DATA09            0x1a0 0x570 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA2__EIM_AD02                0x1a4 0x574 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA2__IPU1_DISP1_DATA07       0x1a4 0x574 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA2__IPU1_CSI1_DATA07        0x1a4 0x574 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA2__GPIO3_IO02              0x1a4 0x574 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA2__SRC_BOOT_CFG02          0x1a4 0x574 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA2__EPDC_BDR0               0x1a4 0x574 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA3__EIM_AD03                0x1a8 0x578 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA3__IPU1_DISP1_DATA06       0x1a8 0x578 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA3__IPU1_CSI1_DATA06        0x1a8 0x578 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA3__GPIO3_IO03              0x1a8 0x578 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA3__SRC_BOOT_CFG03          0x1a8 0x578 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA3__EPDC_BDR1               0x1a8 0x578 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA4__EIM_AD04                0x1ac 0x57c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA4__IPU1_DISP1_DATA05       0x1ac 0x57c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA4__IPU1_CSI1_DATA05        0x1ac 0x57c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA4__GPIO3_IO04              0x1ac 0x57c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA4__SRC_BOOT_CFG04          0x1ac 0x57c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA4__EPDC_SDCE0              0x1ac 0x57c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA5__EIM_AD05                0x1b0 0x580 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA5__IPU1_DISP1_DATA04       0x1b0 0x580 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA5__IPU1_CSI1_DATA04        0x1b0 0x580 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA5__GPIO3_IO05              0x1b0 0x580 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA5__SRC_BOOT_CFG05          0x1b0 0x580 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA5__EPDC_SDCE1              0x1b0 0x580 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA6__EIM_AD06                0x1b4 0x584 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA6__IPU1_DISP1_DATA03       0x1b4 0x584 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA6__IPU1_CSI1_DATA03        0x1b4 0x584 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA6__GPIO3_IO06              0x1b4 0x584 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA6__SRC_BOOT_CFG06          0x1b4 0x584 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA6__EPDC_SDCE2              0x1b4 0x584 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA7__EIM_AD07                0x1b8 0x588 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA7__IPU1_DISP1_DATA02       0x1b8 0x588 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA7__IPU1_CSI1_DATA02        0x1b8 0x588 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA7__GPIO3_IO07              0x1b8 0x588 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA7__SRC_BOOT_CFG07          0x1b8 0x588 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA7__EPDC_SDCE3              0x1b8 0x588 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA8__EIM_AD08                0x1bc 0x58c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA8__IPU1_DISP1_DATA01       0x1bc 0x58c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA8__IPU1_CSI1_DATA01        0x1bc 0x58c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA8__GPIO3_IO08              0x1bc 0x58c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA8__SRC_BOOT_CFG08          0x1bc 0x58c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA8__EPDC_SDCE4              0x1bc 0x58c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_DA9__EIM_AD09                0x1c0 0x590 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA9__IPU1_DISP1_DATA00       0x1c0 0x590 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA9__IPU1_CSI1_DATA00        0x1c0 0x590 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA9__GPIO3_IO09              0x1c0 0x590 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA9__SRC_BOOT_CFG09          0x1c0 0x590 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA9__EPDC_SDCE5              0x1c0 0x590 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_EB0__EIM_EB0_B               0x1c4 0x594 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB0__IPU1_DISP1_DATA11       0x1c4 0x594 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_EB0__IPU1_CSI1_DATA11        0x1c4 0x594 0x88c 0x2 0x1
+#define MX6QDL_PAD_EIM_EB0__CCM_PMIC_READY          0x1c4 0x594 0x7d4 0x4 0x0
+#define MX6QDL_PAD_EIM_EB0__GPIO2_IO28              0x1c4 0x594 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB0__SRC_BOOT_CFG27          0x1c4 0x594 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_EB0__EPDC_PWR_COM            0x1c4 0x594 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_EB1__EIM_EB1_B               0x1c8 0x598 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB1__IPU1_DISP1_DATA10       0x1c8 0x598 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_EB1__IPU1_CSI1_DATA10        0x1c8 0x598 0x888 0x2 0x1
+#define MX6QDL_PAD_EIM_EB1__GPIO2_IO29              0x1c8 0x598 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB1__SRC_BOOT_CFG28          0x1c8 0x598 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_EB1__EPDC_SDSHR              0x1c8 0x598 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_EB2__EIM_EB2_B               0x1cc 0x59c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB2__ECSPI1_SS0              0x1cc 0x59c 0x7e4 0x1 0x2
+#define MX6QDL_PAD_EIM_EB2__IPU1_CSI1_DATA19        0x1cc 0x59c 0x8ac 0x3 0x1
+#define MX6QDL_PAD_EIM_EB2__HDMI_TX_DDC_SCL         0x1cc 0x59c 0x860 0x4 0x0
+#define MX6QDL_PAD_EIM_EB2__GPIO2_IO30              0x1cc 0x59c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB2__I2C2_SCL                0x1cc 0x59c 0x870 0x6 0x0
+#define MX6QDL_PAD_EIM_EB2__SRC_BOOT_CFG30          0x1cc 0x59c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_EB2__EPDC_DATA05             0x1cc 0x59c 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_EB3__EIM_EB3_B               0x1d0 0x5a0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB3__ECSPI4_RDY              0x1d0 0x5a0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_EB3__UART3_RTS_B             0x1d0 0x5a0 0x908 0x2 0x3
+#define MX6QDL_PAD_EIM_EB3__UART3_CTS_B             0x1d0 0x5a0 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_EB3__UART1_RI_B              0x1d0 0x5a0 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_EB3__IPU1_CSI1_HSYNC         0x1d0 0x5a0 0x8b4 0x4 0x1
+#define MX6QDL_PAD_EIM_EB3__GPIO2_IO31              0x1d0 0x5a0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB3__IPU1_DI1_PIN03          0x1d0 0x5a0 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_EB3__SRC_BOOT_CFG31          0x1d0 0x5a0 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_EB3__EPDC_SDCE0              0x1d0 0x5a0 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_EB3__EIM_ACLK_FREERUN        0x1d0 0x5a0 0x000 0x9 0x0
+#define MX6QDL_PAD_EIM_LBA__EIM_LBA_B               0x1d4 0x5a4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_LBA__IPU1_DI1_PIN17          0x1d4 0x5a4 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_LBA__ECSPI2_SS1              0x1d4 0x5a4 0x804 0x2 0x1
+#define MX6QDL_PAD_EIM_LBA__GPIO2_IO27              0x1d4 0x5a4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_LBA__SRC_BOOT_CFG26          0x1d4 0x5a4 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_LBA__EPDC_DATA04             0x1d4 0x5a4 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_OE__EIM_OE_B                 0x1d8 0x5a8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_OE__IPU1_DI1_PIN07           0x1d8 0x5a8 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_OE__ECSPI2_MISO              0x1d8 0x5a8 0x7f8 0x2 0x2
+#define MX6QDL_PAD_EIM_OE__GPIO2_IO25               0x1d8 0x5a8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_OE__EPDC_PWR_IRQ             0x1d8 0x5a8 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_RW__EIM_RW                   0x1dc 0x5ac 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_RW__IPU1_DI1_PIN08           0x1dc 0x5ac 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_RW__ECSPI2_SS0               0x1dc 0x5ac 0x800 0x2 0x2
+#define MX6QDL_PAD_EIM_RW__GPIO2_IO26               0x1dc 0x5ac 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_RW__SRC_BOOT_CFG29           0x1dc 0x5ac 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_RW__EPDC_DATA07              0x1dc 0x5ac 0x000 0x8 0x0
+#define MX6QDL_PAD_EIM_WAIT__EIM_WAIT_B             0x1e0 0x5b0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_WAIT__EIM_DTACK_B            0x1e0 0x5b0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_WAIT__GPIO5_IO00             0x1e0 0x5b0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_WAIT__SRC_BOOT_CFG25         0x1e0 0x5b0 0x000 0x7 0x0
+#define MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN          0x1e4 0x5b4 0x828 0x1 0x0
+#define MX6QDL_PAD_ENET_CRS_DV__ESAI_TX_CLK         0x1e4 0x5b4 0x840 0x2 0x0
+#define MX6QDL_PAD_ENET_CRS_DV__SPDIF_EXT_CLK       0x1e4 0x5b4 0x8f4 0x3 0x0
+#define MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25          0x1e4 0x5b4 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_MDC__MLB_DATA               0x1e8 0x5b8 0x8e0 0x0 0x0
+#define MX6QDL_PAD_ENET_MDC__ENET_MDC               0x1e8 0x5b8 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_MDC__ESAI_TX5_RX0           0x1e8 0x5b8 0x858 0x2 0x0
+#define MX6QDL_PAD_ENET_MDC__ENET_1588_EVENT1_IN    0x1e8 0x5b8 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_MDC__GPIO1_IO31             0x1e8 0x5b8 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_MDIO__ENET_MDIO             0x1ec 0x5bc 0x810 0x1 0x0
+#define MX6QDL_PAD_ENET_MDIO__ESAI_RX_CLK           0x1ec 0x5bc 0x83c 0x2 0x0
+#define MX6QDL_PAD_ENET_MDIO__ENET_1588_EVENT1_OUT  0x1ec 0x5bc 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_MDIO__GPIO1_IO22            0x1ec 0x5bc 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_MDIO__SPDIF_LOCK            0x1ec 0x5bc 0x000 0x6 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK        0x1f0 0x5c0 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__ESAI_RX_FS         0x1f0 0x5c0 0x82c 0x2 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__GPIO1_IO23         0x1f0 0x5c0 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__SPDIF_SR_CLK       0x1f0 0x5c0 0x000 0x6 0x0
+#define MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID           0x1f4 0x5c4 0x790 0x0 0x0
+#define MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER           0x1f4 0x5c4 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_RX_ER__ESAI_RX_HF_CLK       0x1f4 0x5c4 0x834 0x2 0x0
+#define MX6QDL_PAD_ENET_RX_ER__SPDIF_IN             0x1f4 0x5c4 0x8f0 0x3 0x1
+#define MX6QDL_PAD_ENET_RX_ER__ENET_1588_EVENT2_OUT 0x1f4 0x5c4 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_RX_ER__GPIO1_IO24           0x1f4 0x5c4 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0         0x1f8 0x5c8 0x818 0x1 0x0
+#define MX6QDL_PAD_ENET_RXD0__ESAI_TX_HF_CLK        0x1f8 0x5c8 0x838 0x2 0x0
+#define MX6QDL_PAD_ENET_RXD0__SPDIF_OUT             0x1f8 0x5c8 0x000 0x3 0x0
+#define MX6QDL_PAD_ENET_RXD0__GPIO1_IO27            0x1f8 0x5c8 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_RXD1__MLB_SIG               0x1fc 0x5cc 0x8e4 0x0 0x0
+#define MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1         0x1fc 0x5cc 0x81c 0x1 0x0
+#define MX6QDL_PAD_ENET_RXD1__ESAI_TX_FS            0x1fc 0x5cc 0x830 0x2 0x0
+#define MX6QDL_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT  0x1fc 0x5cc 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_RXD1__GPIO1_IO26            0x1fc 0x5cc 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN           0x200 0x5d0 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_TX_EN__ESAI_TX3_RX2         0x200 0x5d0 0x850 0x2 0x0
+#define MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28           0x200 0x5d0 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_TX_EN__I2C4_SCL             0x200 0x5d0 0x880 0x9 0x0
+#define MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0         0x204 0x5d4 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_TXD0__ESAI_TX4_RX1          0x204 0x5d4 0x854 0x2 0x0
+#define MX6QDL_PAD_ENET_TXD0__GPIO1_IO30            0x204 0x5d4 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_TXD1__MLB_CLK               0x208 0x5d8 0x8dc 0x0 0x0
+#define MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1         0x208 0x5d8 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_TXD1__ESAI_TX2_RX3          0x208 0x5d8 0x84c 0x2 0x0
+#define MX6QDL_PAD_ENET_TXD1__ENET_1588_EVENT0_IN   0x208 0x5d8 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_TXD1__GPIO1_IO29            0x208 0x5d8 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_TXD1__I2C4_SDA              0x208 0x5d8 0x884 0x9 0x0
+#define MX6QDL_PAD_GPIO_0__CCM_CLKO1                0x20c 0x5dc 0x000 0x0 0x0
+#define MX6QDL_PAD_GPIO_0__KEY_COL5                 0x20c 0x5dc 0x8c0 0x2 0x1
+#define MX6QDL_PAD_GPIO_0__ASRC_EXT_CLK             0x20c 0x5dc 0x794 0x3 0x0
+#define MX6QDL_PAD_GPIO_0__EPIT1_OUT                0x20c 0x5dc 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_0__GPIO1_IO00               0x20c 0x5dc 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_0__USB_H1_PWR               0x20c 0x5dc 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_0__SNVS_VIO_5               0x20c 0x5dc 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_1__ESAI_RX_CLK              0x210 0x5e0 0x83c 0x0 0x1
+#define MX6QDL_PAD_GPIO_1__WDOG2_B                  0x210 0x5e0 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_1__KEY_ROW5                 0x210 0x5e0 0x8cc 0x2 0x1
+#define MX6QDL_PAD_GPIO_1__USB_OTG_ID               0x210 0x5e0 0x790 0x3 0x1
+#define MX6QDL_PAD_GPIO_1__PWM2_OUT                 0x210 0x5e0 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_1__GPIO1_IO01               0x210 0x5e0 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_1__SD1_CD_B                 0x210 0x5e0 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_16__ESAI_TX3_RX2            0x214 0x5e4 0x850 0x0 0x1
+#define MX6QDL_PAD_GPIO_16__ENET_1588_EVENT2_IN     0x214 0x5e4 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_16__ENET_REF_CLK            0x214 0x5e4 0x80c 0x2 0x0
+#define MX6QDL_PAD_GPIO_16__SD1_LCTL                0x214 0x5e4 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_16__SPDIF_IN                0x214 0x5e4 0x8f0 0x4 0x2
+#define MX6QDL_PAD_GPIO_16__GPIO7_IO11              0x214 0x5e4 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_16__I2C3_SDA                0x214 0x5e4 0x87c 0x6 0x1
+#define MX6QDL_PAD_GPIO_16__JTAG_DE_B               0x214 0x5e4 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_17__ESAI_TX0                0x218 0x5e8 0x844 0x0 0x0
+#define MX6QDL_PAD_GPIO_17__ENET_1588_EVENT3_IN     0x218 0x5e8 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_17__CCM_PMIC_READY          0x218 0x5e8 0x7d4 0x2 0x1
+#define MX6QDL_PAD_GPIO_17__SDMA_EXT_EVENT0         0x218 0x5e8 0x8e8 0x3 0x1
+#define MX6QDL_PAD_GPIO_17__SPDIF_OUT               0x218 0x5e8 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_17__GPIO7_IO12              0x218 0x5e8 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_18__ESAI_TX1                0x21c 0x5ec 0x848 0x0 0x0
+#define MX6QDL_PAD_GPIO_18__ENET_RX_CLK             0x21c 0x5ec 0x814 0x1 0x0
+#define MX6QDL_PAD_GPIO_18__SD3_VSELECT             0x21c 0x5ec 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_18__SDMA_EXT_EVENT1         0x21c 0x5ec 0x8ec 0x3 0x1
+#define MX6QDL_PAD_GPIO_18__ASRC_EXT_CLK            0x21c 0x5ec 0x794 0x4 0x1
+#define MX6QDL_PAD_GPIO_18__GPIO7_IO13              0x21c 0x5ec 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_18__SNVS_VIO_5_CTL          0x21c 0x5ec 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_19__KEY_COL5                0x220 0x5f0 0x8c0 0x0 0x2
+#define MX6QDL_PAD_GPIO_19__ENET_1588_EVENT0_OUT    0x220 0x5f0 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_19__SPDIF_OUT               0x220 0x5f0 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_19__CCM_CLKO1               0x220 0x5f0 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_19__ECSPI1_RDY              0x220 0x5f0 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_19__GPIO4_IO05              0x220 0x5f0 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_19__ENET_TX_ER              0x220 0x5f0 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_2__ESAI_TX_FS               0x224 0x5f4 0x830 0x0 0x1
+#define MX6QDL_PAD_GPIO_2__KEY_ROW6                 0x224 0x5f4 0x8d0 0x2 0x1
+#define MX6QDL_PAD_GPIO_2__GPIO1_IO02               0x224 0x5f4 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_2__SD2_WP                   0x224 0x5f4 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_2__MLB_DATA                 0x224 0x5f4 0x8e0 0x7 0x1
+#define MX6QDL_PAD_GPIO_3__ESAI_RX_HF_CLK           0x228 0x5f8 0x834 0x0 0x1
+#define MX6QDL_PAD_GPIO_3__I2C3_SCL                 0x228 0x5f8 0x878 0x2 0x1
+#define MX6QDL_PAD_GPIO_3__XTALOSC_REF_CLK_24M      0x228 0x5f8 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_3__CCM_CLKO2                0x228 0x5f8 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_3__GPIO1_IO03               0x228 0x5f8 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_3__USB_H1_OC                0x228 0x5f8 0x924 0x6 0x1
+#define MX6QDL_PAD_GPIO_3__MLB_CLK                  0x228 0x5f8 0x8dc 0x7 0x1
+#define MX6QDL_PAD_GPIO_4__ESAI_TX_HF_CLK           0x22c 0x5fc 0x838 0x0 0x1
+#define MX6QDL_PAD_GPIO_4__KEY_COL7                 0x22c 0x5fc 0x8c8 0x2 0x1
+#define MX6QDL_PAD_GPIO_4__GPIO1_IO04               0x22c 0x5fc 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_4__SD2_CD_B                 0x22c 0x5fc 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_5__ESAI_TX2_RX3             0x230 0x600 0x84c 0x0 0x1
+#define MX6QDL_PAD_GPIO_5__KEY_ROW7                 0x230 0x600 0x8d4 0x2 0x1
+#define MX6QDL_PAD_GPIO_5__CCM_CLKO1                0x230 0x600 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_5__GPIO1_IO05               0x230 0x600 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_5__I2C3_SCL                 0x230 0x600 0x878 0x6 0x2
+#define MX6QDL_PAD_GPIO_5__ARM_EVENTI               0x230 0x600 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_6__ESAI_TX_CLK              0x234 0x604 0x840 0x0 0x1
+#define MX6QDL_PAD_GPIO_6__I2C3_SDA                 0x234 0x604 0x87c 0x2 0x2
+#define MX6QDL_PAD_GPIO_6__GPIO1_IO06               0x234 0x604 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_6__SD2_LCTL                 0x234 0x604 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_6__MLB_SIG                  0x234 0x604 0x8e4 0x7 0x1
+#define MX6QDL_PAD_GPIO_7__ESAI_TX4_RX1             0x238 0x608 0x854 0x0 0x1
+#define MX6QDL_PAD_GPIO_7__EPIT1_OUT                0x238 0x608 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_7__FLEXCAN1_TX              0x238 0x608 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_7__UART2_TX_DATA            0x238 0x608 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_7__UART2_RX_DATA            0x238 0x608 0x904 0x4 0x2
+#define MX6QDL_PAD_GPIO_7__GPIO1_IO07               0x238 0x608 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_7__SPDIF_LOCK               0x238 0x608 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_7__USB_OTG_HOST_MODE        0x238 0x608 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_7__I2C4_SCL                 0x238 0x608 0x880 0x8 0x1
+#define MX6QDL_PAD_GPIO_8__ESAI_TX5_RX0             0x23c 0x60c 0x858 0x0 0x1
+#define MX6QDL_PAD_GPIO_8__XTALOSC_REF_CLK_32K      0x23c 0x60c 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_8__EPIT2_OUT                0x23c 0x60c 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_8__FLEXCAN1_RX              0x23c 0x60c 0x7c8 0x3 0x0
+#define MX6QDL_PAD_GPIO_8__UART2_RX_DATA            0x23c 0x60c 0x904 0x4 0x3
+#define MX6QDL_PAD_GPIO_8__UART2_TX_DATA            0x23c 0x60c 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_8__GPIO1_IO08               0x23c 0x60c 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_8__SPDIF_SR_CLK             0x23c 0x60c 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_8__USB_OTG_PWR_CTL_WAKE     0x23c 0x60c 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_8__I2C4_SDA                 0x23c 0x60c 0x884 0x8 0x1
+#define MX6QDL_PAD_GPIO_9__ESAI_RX_FS               0x240 0x610 0x82c 0x0 0x1
+#define MX6QDL_PAD_GPIO_9__WDOG1_B                  0x240 0x610 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_9__KEY_COL6                 0x240 0x610 0x8c4 0x2 0x1
+#define MX6QDL_PAD_GPIO_9__CCM_REF_EN_B             0x240 0x610 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_9__PWM1_OUT                 0x240 0x610 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_9__GPIO1_IO09               0x240 0x610 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_9__SD1_WP                   0x240 0x610 0x92c 0x6 0x1
+#define MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK            0x244 0x62c 0x7d8 0x0 0x3
+#define MX6QDL_PAD_KEY_COL0__ENET_RX_DATA3          0x244 0x62c 0x824 0x1 0x0
+#define MX6QDL_PAD_KEY_COL0__AUD5_TXC               0x244 0x62c 0x7c0 0x2 0x1
+#define MX6QDL_PAD_KEY_COL0__KEY_COL0               0x244 0x62c 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL0__UART4_TX_DATA          0x244 0x62c 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL0__UART4_RX_DATA          0x244 0x62c 0x914 0x4 0x2
+#define MX6QDL_PAD_KEY_COL0__GPIO4_IO06             0x244 0x62c 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL0__DCIC1_OUT              0x244 0x62c 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_COL1__ECSPI1_MISO            0x248 0x630 0x7dc 0x0 0x3
+#define MX6QDL_PAD_KEY_COL1__ENET_MDIO              0x248 0x630 0x810 0x1 0x1
+#define MX6QDL_PAD_KEY_COL1__AUD5_TXFS              0x248 0x630 0x7c4 0x2 0x1
+#define MX6QDL_PAD_KEY_COL1__KEY_COL1               0x248 0x630 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL1__UART5_TX_DATA          0x248 0x630 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL1__UART5_RX_DATA          0x248 0x630 0x91c 0x4 0x2
+#define MX6QDL_PAD_KEY_COL1__GPIO4_IO08             0x248 0x630 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL1__SD1_VSELECT            0x248 0x630 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_COL2__ECSPI1_SS1             0x24c 0x634 0x7e8 0x0 0x2
+#define MX6QDL_PAD_KEY_COL2__ENET_RX_DATA2          0x24c 0x634 0x820 0x1 0x0
+#define MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX            0x24c 0x634 0x000 0x2 0x0
+#define MX6QDL_PAD_KEY_COL2__KEY_COL2               0x24c 0x634 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL2__ENET_MDC               0x24c 0x634 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL2__GPIO4_IO10             0x24c 0x634 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL2__USB_H1_PWR_CTL_WAKE    0x24c 0x634 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_COL3__ECSPI1_SS3             0x250 0x638 0x7f0 0x0 0x1
+#define MX6QDL_PAD_KEY_COL3__ENET_CRS               0x250 0x638 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_COL3__HDMI_TX_DDC_SCL        0x250 0x638 0x860 0x2 0x1
+#define MX6QDL_PAD_KEY_COL3__KEY_COL3               0x250 0x638 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL3__I2C2_SCL               0x250 0x638 0x870 0x4 0x1
+#define MX6QDL_PAD_KEY_COL3__GPIO4_IO12             0x250 0x638 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL3__SPDIF_IN               0x250 0x638 0x8f0 0x6 0x3
+#define MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX            0x254 0x63c 0x000 0x0 0x0
+#define MX6QDL_PAD_KEY_COL4__IPU1_SISG4             0x254 0x63c 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_COL4__USB_OTG_OC             0x254 0x63c 0x920 0x2 0x1
+#define MX6QDL_PAD_KEY_COL4__KEY_COL4               0x254 0x63c 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL4__UART5_RTS_B            0x254 0x63c 0x918 0x4 0x2
+#define MX6QDL_PAD_KEY_COL4__UART5_CTS_B            0x254 0x63c 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL4__GPIO4_IO14             0x254 0x63c 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI            0x258 0x640 0x7e0 0x0 0x3
+#define MX6QDL_PAD_KEY_ROW0__ENET_TX_DATA3          0x258 0x640 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW0__AUD5_TXD               0x258 0x640 0x7b4 0x2 0x1
+#define MX6QDL_PAD_KEY_ROW0__KEY_ROW0               0x258 0x640 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA          0x258 0x640 0x914 0x4 0x3
+#define MX6QDL_PAD_KEY_ROW0__UART4_TX_DATA          0x258 0x640 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW0__GPIO4_IO07             0x258 0x640 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW0__DCIC2_OUT              0x258 0x640 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_ROW1__ECSPI1_SS0             0x25c 0x644 0x7e4 0x0 0x3
+#define MX6QDL_PAD_KEY_ROW1__ENET_COL               0x25c 0x644 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW1__AUD5_RXD               0x25c 0x644 0x7b0 0x2 0x1
+#define MX6QDL_PAD_KEY_ROW1__KEY_ROW1               0x25c 0x644 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA          0x25c 0x644 0x91c 0x4 0x3
+#define MX6QDL_PAD_KEY_ROW1__UART5_TX_DATA          0x25c 0x644 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW1__GPIO4_IO09             0x25c 0x644 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW1__SD2_VSELECT            0x25c 0x644 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_ROW2__ECSPI1_SS2             0x260 0x648 0x7ec 0x0 0x1
+#define MX6QDL_PAD_KEY_ROW2__ENET_TX_DATA2          0x260 0x648 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX            0x260 0x648 0x7c8 0x2 0x1
+#define MX6QDL_PAD_KEY_ROW2__KEY_ROW2               0x260 0x648 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW2__SD2_VSELECT            0x260 0x648 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW2__GPIO4_IO11             0x260 0x648 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE       0x260 0x648 0x85c 0x6 0x1
+#define MX6QDL_PAD_KEY_ROW3__ASRC_EXT_CLK           0x264 0x64c 0x794 0x1 0x2
+#define MX6QDL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA        0x264 0x64c 0x864 0x2 0x1
+#define MX6QDL_PAD_KEY_ROW3__KEY_ROW3               0x264 0x64c 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW3__I2C2_SDA               0x264 0x64c 0x874 0x4 0x1
+#define MX6QDL_PAD_KEY_ROW3__GPIO4_IO13             0x264 0x64c 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW3__SD1_VSELECT            0x264 0x64c 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX            0x268 0x650 0x7cc 0x0 0x0
+#define MX6QDL_PAD_KEY_ROW4__IPU1_SISG5             0x268 0x650 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW4__USB_OTG_PWR            0x268 0x650 0x000 0x2 0x0
+#define MX6QDL_PAD_KEY_ROW4__KEY_ROW4               0x268 0x650 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW4__UART5_CTS_B            0x268 0x650 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW4__UART5_RTS_B            0x268 0x650 0x918 0x4 0x3
+#define MX6QDL_PAD_KEY_ROW4__GPIO4_IO15             0x268 0x650 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_ALE__NAND_ALE              0x26c 0x654 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_ALE__SD4_RESET             0x26c 0x654 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_ALE__GPIO6_IO08            0x26c 0x654 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CLE__NAND_CLE              0x270 0x658 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CLE__GPIO6_IO07            0x270 0x658 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS0__NAND_CE0_B            0x274 0x65c 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS0__GPIO6_IO11            0x274 0x65c 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS1__NAND_CE1_B            0x278 0x660 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS1__SD4_VSELECT           0x278 0x660 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_CS1__SD3_VSELECT           0x278 0x660 0x000 0x2 0x0
+#define MX6QDL_PAD_NANDF_CS1__GPIO6_IO14            0x278 0x660 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS2__NAND_CE2_B            0x27c 0x664 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS2__IPU1_SISG0            0x27c 0x664 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_CS2__ESAI_TX0              0x27c 0x664 0x844 0x2 0x1
+#define MX6QDL_PAD_NANDF_CS2__EIM_CRE               0x27c 0x664 0x000 0x3 0x0
+#define MX6QDL_PAD_NANDF_CS2__CCM_CLKO2             0x27c 0x664 0x000 0x4 0x0
+#define MX6QDL_PAD_NANDF_CS2__GPIO6_IO15            0x27c 0x664 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS3__NAND_CE3_B            0x280 0x668 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS3__IPU1_SISG1            0x280 0x668 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_CS3__ESAI_TX1              0x280 0x668 0x848 0x2 0x1
+#define MX6QDL_PAD_NANDF_CS3__EIM_ADDR26            0x280 0x668 0x000 0x3 0x0
+#define MX6QDL_PAD_NANDF_CS3__GPIO6_IO16            0x280 0x668 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS3__I2C4_SDA              0x280 0x668 0x884 0x9 0x2
+#define MX6QDL_PAD_NANDF_D0__NAND_DATA00            0x284 0x66c 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D0__SD1_DATA4              0x284 0x66c 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D0__GPIO2_IO00             0x284 0x66c 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D1__NAND_DATA01            0x288 0x670 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D1__SD1_DATA5              0x288 0x670 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D1__GPIO2_IO01             0x288 0x670 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D2__NAND_DATA02            0x28c 0x674 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D2__SD1_DATA6              0x28c 0x674 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D2__GPIO2_IO02             0x28c 0x674 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D3__NAND_DATA03            0x290 0x678 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D3__SD1_DATA7              0x290 0x678 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D3__GPIO2_IO03             0x290 0x678 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D4__NAND_DATA04            0x294 0x67c 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D4__SD2_DATA4              0x294 0x67c 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D4__GPIO2_IO04             0x294 0x67c 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D5__NAND_DATA05            0x298 0x680 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D5__SD2_DATA5              0x298 0x680 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D5__GPIO2_IO05             0x298 0x680 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D6__NAND_DATA06            0x29c 0x684 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D6__SD2_DATA6              0x29c 0x684 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D6__GPIO2_IO06             0x29c 0x684 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D7__NAND_DATA07            0x2a0 0x688 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D7__SD2_DATA7              0x2a0 0x688 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D7__GPIO2_IO07             0x2a0 0x688 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_RB0__NAND_READY_B          0x2a4 0x68c 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_RB0__GPIO6_IO10            0x2a4 0x68c 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_WP_B__NAND_WP_B            0x2a8 0x690 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_WP_B__GPIO6_IO09           0x2a8 0x690 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_WP_B__I2C4_SCL             0x2a8 0x690 0x880 0x9 0x2
+#define MX6QDL_PAD_RGMII_RD0__HSI_RX_READY          0x2ac 0x694 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD0__RGMII_RD0             0x2ac 0x694 0x818 0x1 0x1
+#define MX6QDL_PAD_RGMII_RD0__GPIO6_IO25            0x2ac 0x694 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD1__HSI_TX_FLAG           0x2b0 0x698 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD1__RGMII_RD1             0x2b0 0x698 0x81c 0x1 0x1
+#define MX6QDL_PAD_RGMII_RD1__GPIO6_IO27            0x2b0 0x698 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD2__HSI_TX_DATA           0x2b4 0x69c 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD2__RGMII_RD2             0x2b4 0x69c 0x820 0x1 0x1
+#define MX6QDL_PAD_RGMII_RD2__GPIO6_IO28            0x2b4 0x69c 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD3__HSI_TX_WAKE           0x2b8 0x6a0 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD3__RGMII_RD3             0x2b8 0x6a0 0x824 0x1 0x1
+#define MX6QDL_PAD_RGMII_RD3__GPIO6_IO29            0x2b8 0x6a0 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__USB_H3_DATA        0x2bc 0x6a4 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL       0x2bc 0x6a4 0x828 0x1 0x1
+#define MX6QDL_PAD_RGMII_RX_CTL__GPIO6_IO24         0x2bc 0x6a4 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RXC__USB_H3_STROBE         0x2c0 0x6a8 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RXC__RGMII_RXC             0x2c0 0x6a8 0x814 0x1 0x1
+#define MX6QDL_PAD_RGMII_RXC__GPIO6_IO30            0x2c0 0x6a8 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD0__HSI_TX_READY          0x2c4 0x6ac 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD0__RGMII_TD0             0x2c4 0x6ac 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD0__GPIO6_IO20            0x2c4 0x6ac 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD1__HSI_RX_FLAG           0x2c8 0x6b0 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD1__RGMII_TD1             0x2c8 0x6b0 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD1__GPIO6_IO21            0x2c8 0x6b0 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD2__HSI_RX_DATA           0x2cc 0x6b4 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD2__RGMII_TD2             0x2cc 0x6b4 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD2__GPIO6_IO22            0x2cc 0x6b4 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD3__HSI_RX_WAKE           0x2d0 0x6b8 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD3__RGMII_TD3             0x2d0 0x6b8 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD3__GPIO6_IO23            0x2d0 0x6b8 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE      0x2d4 0x6bc 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL       0x2d4 0x6bc 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__GPIO6_IO26         0x2d4 0x6bc 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__ENET_REF_CLK       0x2d4 0x6bc 0x80c 0x7 0x1
+#define MX6QDL_PAD_RGMII_TXC__USB_H2_DATA           0x2d8 0x6c0 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TXC__RGMII_TXC             0x2d8 0x6c0 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TXC__SPDIF_EXT_CLK         0x2d8 0x6c0 0x8f4 0x2 0x1
+#define MX6QDL_PAD_RGMII_TXC__GPIO6_IO19            0x2d8 0x6c0 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TXC__XTALOSC_REF_CLK_24M   0x2d8 0x6c0 0x000 0x7 0x0
+#define MX6QDL_PAD_SD1_CLK__SD1_CLK                 0x2dc 0x6c4 0x928 0x0 0x1
+#define MX6QDL_PAD_SD1_CLK__GPT_CLKIN               0x2dc 0x6c4 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_CLK__GPIO1_IO20              0x2dc 0x6c4 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_CMD__SD1_CMD                 0x2e0 0x6c8 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_CMD__PWM4_OUT                0x2e0 0x6c8 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_CMD__GPT_COMPARE1            0x2e0 0x6c8 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_CMD__GPIO1_IO18              0x2e0 0x6c8 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT0__SD1_DATA0              0x2e4 0x6cc 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT0__GPT_CAPTURE1           0x2e4 0x6cc 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT0__GPIO1_IO16             0x2e4 0x6cc 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT1__SD1_DATA1              0x2e8 0x6d0 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT1__PWM3_OUT               0x2e8 0x6d0 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_DAT1__GPT_CAPTURE2           0x2e8 0x6d0 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT1__GPIO1_IO17             0x2e8 0x6d0 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT2__SD1_DATA2              0x2ec 0x6d4 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT2__GPT_COMPARE2           0x2ec 0x6d4 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_DAT2__PWM2_OUT               0x2ec 0x6d4 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT2__WDOG1_B                0x2ec 0x6d4 0x000 0x4 0x0
+#define MX6QDL_PAD_SD1_DAT2__GPIO1_IO19             0x2ec 0x6d4 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT2__WDOG1_RESET_B_DEB      0x2ec 0x6d4 0x000 0x6 0x0
+#define MX6QDL_PAD_SD1_DAT3__SD1_DATA3              0x2f0 0x6d8 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT3__GPT_COMPARE3           0x2f0 0x6d8 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_DAT3__PWM1_OUT               0x2f0 0x6d8 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT3__WDOG2_B                0x2f0 0x6d8 0x000 0x4 0x0
+#define MX6QDL_PAD_SD1_DAT3__GPIO1_IO21             0x2f0 0x6d8 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT3__WDOG2_RESET_B_DEB      0x2f0 0x6d8 0x000 0x6 0x0
+#define MX6QDL_PAD_SD2_CLK__SD2_CLK                 0x2f4 0x6dc 0x930 0x0 0x1
+#define MX6QDL_PAD_SD2_CLK__KEY_COL5                0x2f4 0x6dc 0x8c0 0x2 0x3
+#define MX6QDL_PAD_SD2_CLK__AUD4_RXFS               0x2f4 0x6dc 0x7a4 0x3 0x1
+#define MX6QDL_PAD_SD2_CLK__GPIO1_IO10              0x2f4 0x6dc 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_CMD__SD2_CMD                 0x2f8 0x6e0 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_CMD__KEY_ROW5                0x2f8 0x6e0 0x8cc 0x2 0x2
+#define MX6QDL_PAD_SD2_CMD__AUD4_RXC                0x2f8 0x6e0 0x7a0 0x3 0x1
+#define MX6QDL_PAD_SD2_CMD__GPIO1_IO11              0x2f8 0x6e0 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT0__SD2_DATA0              0x2fc 0x6e4 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT0__AUD4_RXD               0x2fc 0x6e4 0x798 0x3 0x1
+#define MX6QDL_PAD_SD2_DAT0__KEY_ROW7               0x2fc 0x6e4 0x8d4 0x4 0x2
+#define MX6QDL_PAD_SD2_DAT0__GPIO1_IO15             0x2fc 0x6e4 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT0__DCIC2_OUT              0x2fc 0x6e4 0x000 0x6 0x0
+#define MX6QDL_PAD_SD2_DAT1__SD2_DATA1              0x300 0x6e8 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT1__EIM_CS2_B              0x300 0x6e8 0x000 0x2 0x0
+#define MX6QDL_PAD_SD2_DAT1__AUD4_TXFS              0x300 0x6e8 0x7ac 0x3 0x1
+#define MX6QDL_PAD_SD2_DAT1__KEY_COL7               0x300 0x6e8 0x8c8 0x4 0x2
+#define MX6QDL_PAD_SD2_DAT1__GPIO1_IO14             0x300 0x6e8 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT2__SD2_DATA2              0x304 0x6ec 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT2__EIM_CS3_B              0x304 0x6ec 0x000 0x2 0x0
+#define MX6QDL_PAD_SD2_DAT2__AUD4_TXD               0x304 0x6ec 0x79c 0x3 0x1
+#define MX6QDL_PAD_SD2_DAT2__KEY_ROW6               0x304 0x6ec 0x8d0 0x4 0x2
+#define MX6QDL_PAD_SD2_DAT2__GPIO1_IO13             0x304 0x6ec 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT3__SD2_DATA3              0x308 0x6f0 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT3__KEY_COL6               0x308 0x6f0 0x8c4 0x2 0x2
+#define MX6QDL_PAD_SD2_DAT3__AUD4_TXC               0x308 0x6f0 0x7a8 0x3 0x1
+#define MX6QDL_PAD_SD2_DAT3__GPIO1_IO12             0x308 0x6f0 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_CLK__SD3_CLK                 0x30c 0x6f4 0x934 0x0 0x1
+#define MX6QDL_PAD_SD3_CLK__UART2_RTS_B             0x30c 0x6f4 0x900 0x1 0x2
+#define MX6QDL_PAD_SD3_CLK__UART2_CTS_B             0x30c 0x6f4 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_CLK__FLEXCAN1_RX             0x30c 0x6f4 0x7c8 0x2 0x2
+#define MX6QDL_PAD_SD3_CLK__GPIO7_IO03              0x30c 0x6f4 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_CMD__SD3_CMD                 0x310 0x6f8 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_CMD__UART2_CTS_B             0x310 0x6f8 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_CMD__UART2_RTS_B             0x310 0x6f8 0x900 0x1 0x3
+#define MX6QDL_PAD_SD3_CMD__FLEXCAN1_TX             0x310 0x6f8 0x000 0x2 0x0
+#define MX6QDL_PAD_SD3_CMD__GPIO7_IO02              0x310 0x6f8 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT0__SD3_DATA0              0x314 0x6fc 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT0__UART1_CTS_B            0x314 0x6fc 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT0__UART1_RTS_B            0x314 0x6fc 0x8f8 0x1 0x2
+#define MX6QDL_PAD_SD3_DAT0__FLEXCAN2_TX            0x314 0x6fc 0x000 0x2 0x0
+#define MX6QDL_PAD_SD3_DAT0__GPIO7_IO04             0x314 0x6fc 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT1__SD3_DATA1              0x318 0x700 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT1__UART1_RTS_B            0x318 0x700 0x8f8 0x1 0x3
+#define MX6QDL_PAD_SD3_DAT1__UART1_CTS_B            0x318 0x700 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT1__FLEXCAN2_RX            0x318 0x700 0x7cc 0x2 0x1
+#define MX6QDL_PAD_SD3_DAT1__GPIO7_IO05             0x318 0x700 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT2__SD3_DATA2              0x31c 0x704 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT2__GPIO7_IO06             0x31c 0x704 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT3__SD3_DATA3              0x320 0x708 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT3__UART3_CTS_B            0x320 0x708 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT3__UART3_RTS_B            0x320 0x708 0x908 0x1 0x4
+#define MX6QDL_PAD_SD3_DAT3__GPIO7_IO07             0x320 0x708 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT4__SD3_DATA4              0x324 0x70c 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT4__UART2_RX_DATA          0x324 0x70c 0x904 0x1 0x4
+#define MX6QDL_PAD_SD3_DAT4__UART2_TX_DATA          0x324 0x70c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT4__GPIO7_IO01             0x324 0x70c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT5__SD3_DATA5              0x328 0x710 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT5__UART2_TX_DATA          0x328 0x710 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT5__UART2_RX_DATA          0x328 0x710 0x904 0x1 0x5
+#define MX6QDL_PAD_SD3_DAT5__GPIO7_IO00             0x328 0x710 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT6__SD3_DATA6              0x32c 0x714 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA          0x32c 0x714 0x8fc 0x1 0x2
+#define MX6QDL_PAD_SD3_DAT6__UART1_TX_DATA          0x32c 0x714 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT6__GPIO6_IO18             0x32c 0x714 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT7__SD3_DATA7              0x330 0x718 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA          0x330 0x718 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT7__UART1_RX_DATA          0x330 0x718 0x8fc 0x1 0x3
+#define MX6QDL_PAD_SD3_DAT7__GPIO6_IO17             0x330 0x718 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_RST__SD3_RESET               0x334 0x71c 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_RST__UART3_RTS_B             0x334 0x71c 0x908 0x1 0x5
+#define MX6QDL_PAD_SD3_RST__UART3_CTS_B             0x334 0x71c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_RST__GPIO7_IO08              0x334 0x71c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_CLK__SD4_CLK                 0x338 0x720 0x938 0x0 0x1
+#define MX6QDL_PAD_SD4_CLK__NAND_WE_B               0x338 0x720 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_CLK__UART3_RX_DATA           0x338 0x720 0x90c 0x2 0x2
+#define MX6QDL_PAD_SD4_CLK__UART3_TX_DATA           0x338 0x720 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_CLK__GPIO7_IO10              0x338 0x720 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_CMD__SD4_CMD                 0x33c 0x724 0x000 0x0 0x0
+#define MX6QDL_PAD_SD4_CMD__NAND_RE_B               0x33c 0x724 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_CMD__UART3_TX_DATA           0x33c 0x724 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_CMD__UART3_RX_DATA           0x33c 0x724 0x90c 0x2 0x3
+#define MX6QDL_PAD_SD4_CMD__GPIO7_IO09              0x33c 0x724 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT0__SD4_DATA0              0x340 0x728 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT0__NAND_DQS               0x340 0x728 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT0__GPIO2_IO08             0x340 0x728 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT1__SD4_DATA1              0x344 0x72c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT1__PWM3_OUT               0x344 0x72c 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT1__GPIO2_IO09             0x344 0x72c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT2__SD4_DATA2              0x348 0x730 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT2__PWM4_OUT               0x348 0x730 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT2__GPIO2_IO10             0x348 0x730 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT3__SD4_DATA3              0x34c 0x734 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT3__GPIO2_IO11             0x34c 0x734 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT4__SD4_DATA4              0x350 0x738 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA          0x350 0x738 0x904 0x2 0x6
+#define MX6QDL_PAD_SD4_DAT4__UART2_TX_DATA          0x350 0x738 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT4__GPIO2_IO12             0x350 0x738 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT5__SD4_DATA5              0x354 0x73c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT5__UART2_RTS_B            0x354 0x73c 0x900 0x2 0x4
+#define MX6QDL_PAD_SD4_DAT5__UART2_CTS_B            0x354 0x73c 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT5__GPIO2_IO13             0x354 0x73c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT6__SD4_DATA6              0x358 0x740 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT6__UART2_CTS_B            0x358 0x740 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT6__UART2_RTS_B            0x358 0x740 0x900 0x2 0x5
+#define MX6QDL_PAD_SD4_DAT6__GPIO2_IO14             0x358 0x740 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT7__SD4_DATA7              0x35c 0x744 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA          0x35c 0x744 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT7__UART2_RX_DATA          0x35c 0x744 0x904 0x2 0x7
+#define MX6QDL_PAD_SD4_DAT7__GPIO2_IO15             0x35c 0x744 0x000 0x5 0x0
 
 #endif /* __DTS_IMX6DL_PINFUNC_H */
index 95da711..a6ce7b4 100644 (file)
        model = "Freescale i.MX6 DualLite/Solo SABRE Automotive Board";
        compatible = "fsl,imx6dl-sabreauto", "fsl,imx6dl";
 };
-
-&iomuxc {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_hog>;
-
-       hog {
-               pinctrl_hog: hoggrp {
-                       fsl,pins = <
-                               MX6DL_PAD_NANDF_CS2__GPIO6_IO15 0x80000000
-                               MX6DL_PAD_SD2_DAT2__GPIO1_IO13  0x80000000
-                       >;
-               };
-       };
-
-       ecspi1 {
-               pinctrl_ecspi1_sabreauto: ecspi1-sabreauto {
-                       fsl,pins = <
-                               MX6DL_PAD_EIM_D19__GPIO3_IO19  0x80000000
-                       >;
-               };
-       };
-};
index 8989df2..1e45f2f 100644 (file)
        model = "Freescale i.MX6 DualLite SABRE Smart Device Board";
        compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl";
 };
-
-&iomuxc {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_hog>;
-
-       hog {
-               pinctrl_hog: hoggrp {
-                       fsl,pins = <
-                               MX6DL_PAD_GPIO_4__GPIO1_IO04   0x80000000
-                               MX6DL_PAD_GPIO_5__GPIO1_IO05   0x80000000
-                               MX6DL_PAD_NANDF_D0__GPIO2_IO00 0x80000000
-                               MX6DL_PAD_NANDF_D1__GPIO2_IO01 0x80000000
-                               MX6DL_PAD_NANDF_D2__GPIO2_IO02 0x80000000
-                               MX6DL_PAD_NANDF_D3__GPIO2_IO03 0x80000000
-                               MX6DL_PAD_GPIO_0__CCM_CLKO1    0x130b0
-                       >;
-               };
-       };
-};
index bfc59c3..e672891 100644 (file)
@@ -10,6 +10,7 @@
  */
 /dts-v1/;
 #include "imx6dl.dtsi"
+#include "imx6qdl-wandboard.dtsi"
 
 / {
        model = "Wandboard i.MX6 Dual Lite Board";
                reg = <0x10000000 0x40000000>;
        };
 };
-
-&fec {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_enet_1>;
-       phy-mode = "rgmii";
-       status = "okay";
-};
-
-&uart1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_uart1_1>;
-       status = "okay";
-};
-
-&usbh1 {
-       status = "okay";
-};
-
-&usdhc3 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usdhc3_2>;
-       status = "okay";
-};
index 2b3ecd6..9e8ae11 100644 (file)
@@ -8,8 +8,8 @@
  *
  */
 
-#include "imx6qdl.dtsi"
 #include "imx6dl-pinfunc.h"
+#include "imx6qdl.dtsi"
 
 / {
        cpus {
        };
 
        soc {
+               ocram: sram@00900000 {
+                       compatible = "mmio-sram";
+                       reg = <0x00900000 0x20000>;
+                       clocks = <&clks 142>;
+               };
+
                aips1: aips-bus@02000000 {
                        iomuxc: iomuxc@020e0000 {
                                compatible = "fsl,imx6dl-iomuxc";
-                               reg = <0x020e0000 0x4000>;
-
-                               audmux {
-                                       pinctrl_audmux_2: audmux-2 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_CSI0_DAT7__AUD3_RXD  0x80000000
-                                                       MX6DL_PAD_CSI0_DAT4__AUD3_TXC  0x80000000
-                                                       MX6DL_PAD_CSI0_DAT5__AUD3_TXD  0x80000000
-                                                       MX6DL_PAD_CSI0_DAT6__AUD3_TXFS 0x80000000
-                                               >;
-                                       };
-                               };
-
-                               ecspi1 {
-                                       pinctrl_ecspi1_1: ecspi1grp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
-                                                       MX6DL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
-                                                       MX6DL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
-                                               >;
-                                       };
-                               };
-
-                               enet {
-                                       pinctrl_enet_1: enetgrp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_ENET_MDIO__ENET_MDIO       0x1b0b0
-                                                       MX6DL_PAD_ENET_MDC__ENET_MDC         0x1b0b0
-                                                       MX6DL_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
-                                                       MX6DL_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
-                                                       MX6DL_PAD_RGMII_RXC__RGMII_RXC       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD0__RGMII_RD0       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD1__RGMII_RD1       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD2__RGMII_RD2       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD3__RGMII_RD3       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
-                                                       MX6DL_PAD_GPIO_16__ENET_REF_CLK      0x4001b0a8
-                                               >;
-                                       };
-
-                                       pinctrl_enet_2: enetgrp-2 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_KEY_COL1__ENET_MDIO        0x1b0b0
-                                                       MX6DL_PAD_KEY_COL2__ENET_MDC         0x1b0b0
-                                                       MX6DL_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
-                                                       MX6DL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
-                                                       MX6DL_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
-                                                       MX6DL_PAD_RGMII_RXC__RGMII_RXC       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD0__RGMII_RD0       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD1__RGMII_RD1       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD2__RGMII_RD2       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RD3__RGMII_RD3       0x1b0b0
-                                                       MX6DL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
-                                               >;
-                                       };
-                               };
-
-                               gpmi-nand {
-                                       pinctrl_gpmi_nand_1: gpmi-nand-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_NANDF_CLE__NAND_CLE     0xb0b1
-                                                       MX6DL_PAD_NANDF_ALE__NAND_ALE     0xb0b1
-                                                       MX6DL_PAD_NANDF_WP_B__NAND_WP_B   0xb0b1
-                                                       MX6DL_PAD_NANDF_RB0__NAND_READY_B 0xb000
-                                                       MX6DL_PAD_NANDF_CS0__NAND_CE0_B   0xb0b1
-                                                       MX6DL_PAD_NANDF_CS1__NAND_CE1_B   0xb0b1
-                                                       MX6DL_PAD_SD4_CMD__NAND_RE_B      0xb0b1
-                                                       MX6DL_PAD_SD4_CLK__NAND_WE_B      0xb0b1
-                                                       MX6DL_PAD_NANDF_D0__NAND_DATA00   0xb0b1
-                                                       MX6DL_PAD_NANDF_D1__NAND_DATA01   0xb0b1
-                                                       MX6DL_PAD_NANDF_D2__NAND_DATA02   0xb0b1
-                                                       MX6DL_PAD_NANDF_D3__NAND_DATA03   0xb0b1
-                                                       MX6DL_PAD_NANDF_D4__NAND_DATA04   0xb0b1
-                                                       MX6DL_PAD_NANDF_D5__NAND_DATA05   0xb0b1
-                                                       MX6DL_PAD_NANDF_D6__NAND_DATA06   0xb0b1
-                                                       MX6DL_PAD_NANDF_D7__NAND_DATA07   0xb0b1
-                                                       MX6DL_PAD_SD4_DAT0__NAND_DQS      0x00b1
-                                               >;
-                                       };
-                               };
-
-                               i2c1 {
-                                       pinctrl_i2c1_2: i2c1grp-2 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
-                                                       MX6DL_PAD_CSI0_DAT9__I2C1_SCL 0x4001b8b1
-                                               >;
-                                       };
-                               };
-
-                               uart1 {
-                                       pinctrl_uart1_1: uart1grp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
-                                                       MX6DL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
-                                               >;
-                                       };
-                               };
-
-                               uart4 {
-                                       pinctrl_uart4_1: uart4grp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
-                                                       MX6DL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
-                                               >;
-                                       };
-                               };
-
-                               usbotg {
-                                       pinctrl_usbotg_2: usbotggrp-2 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
-                                               >;
-                                       };
-                               };
-
-                               usdhc2 {
-                                       pinctrl_usdhc2_1: usdhc2grp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_SD2_CMD__SD2_CMD    0x17059
-                                                       MX6DL_PAD_SD2_CLK__SD2_CLK    0x10059
-                                                       MX6DL_PAD_SD2_DAT0__SD2_DATA0 0x17059
-                                                       MX6DL_PAD_SD2_DAT1__SD2_DATA1 0x17059
-                                                       MX6DL_PAD_SD2_DAT2__SD2_DATA2 0x17059
-                                                       MX6DL_PAD_SD2_DAT3__SD2_DATA3 0x17059
-                                                       MX6DL_PAD_NANDF_D4__SD2_DATA4 0x17059
-                                                       MX6DL_PAD_NANDF_D5__SD2_DATA5 0x17059
-                                                       MX6DL_PAD_NANDF_D6__SD2_DATA6 0x17059
-                                                       MX6DL_PAD_NANDF_D7__SD2_DATA7 0x17059
-                                               >;
-                                       };
-                               };
-
-                               usdhc3 {
-                                       pinctrl_usdhc3_1: usdhc3grp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_SD3_CMD__SD3_CMD    0x17059
-                                                       MX6DL_PAD_SD3_CLK__SD3_CLK    0x10059
-                                                       MX6DL_PAD_SD3_DAT0__SD3_DATA0 0x17059
-                                                       MX6DL_PAD_SD3_DAT1__SD3_DATA1 0x17059
-                                                       MX6DL_PAD_SD3_DAT2__SD3_DATA2 0x17059
-                                                       MX6DL_PAD_SD3_DAT3__SD3_DATA3 0x17059
-                                                       MX6DL_PAD_SD3_DAT4__SD3_DATA4 0x17059
-                                                       MX6DL_PAD_SD3_DAT5__SD3_DATA5 0x17059
-                                                       MX6DL_PAD_SD3_DAT6__SD3_DATA6 0x17059
-                                                       MX6DL_PAD_SD3_DAT7__SD3_DATA7 0x17059
-                                               >;
-                                       };
-
-                                       pinctrl_usdhc3_2: usdhc3grp_2 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_SD3_CMD__SD3_CMD    0x17059
-                                                       MX6DL_PAD_SD3_CLK__SD3_CLK    0x10059
-                                                       MX6DL_PAD_SD3_DAT0__SD3_DATA0 0x17059
-                                                       MX6DL_PAD_SD3_DAT1__SD3_DATA1 0x17059
-                                                       MX6DL_PAD_SD3_DAT2__SD3_DATA2 0x17059
-                                                       MX6DL_PAD_SD3_DAT3__SD3_DATA3 0x17059
-                                               >;
-                                       };
-                               };
-
-                               weim {
-                                       pinctrl_weim_cs0_1: weim_cs0grp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_EIM_CS0__EIM_CS0_B   0xb0b1
-                                               >;
-                                       };
-
-                                       pinctrl_weim_nor_1: weim_norgrp-1 {
-                                               fsl,pins = <
-                                                       MX6DL_PAD_EIM_OE__EIM_OE_B     0xb0b1
-                                                       MX6DL_PAD_EIM_RW__EIM_RW       0xb0b1
-                                                       MX6DL_PAD_EIM_WAIT__EIM_WAIT_B 0xb060
-                                                       /* data */
-                                                       MX6DL_PAD_EIM_D16__EIM_DATA16 0x1b0b0
-                                                       MX6DL_PAD_EIM_D17__EIM_DATA17 0x1b0b0
-                                                       MX6DL_PAD_EIM_D18__EIM_DATA18 0x1b0b0
-                                                       MX6DL_PAD_EIM_D19__EIM_DATA19 0x1b0b0
-                                                       MX6DL_PAD_EIM_D20__EIM_DATA20 0x1b0b0
-                                                       MX6DL_PAD_EIM_D21__EIM_DATA21 0x1b0b0
-                                                       MX6DL_PAD_EIM_D22__EIM_DATA22 0x1b0b0
-                                                       MX6DL_PAD_EIM_D23__EIM_DATA23 0x1b0b0
-                                                       MX6DL_PAD_EIM_D24__EIM_DATA24 0x1b0b0
-                                                       MX6DL_PAD_EIM_D25__EIM_DATA25 0x1b0b0
-                                                       MX6DL_PAD_EIM_D26__EIM_DATA26 0x1b0b0
-                                                       MX6DL_PAD_EIM_D27__EIM_DATA27 0x1b0b0
-                                                       MX6DL_PAD_EIM_D28__EIM_DATA28 0x1b0b0
-                                                       MX6DL_PAD_EIM_D29__EIM_DATA29 0x1b0b0
-                                                       MX6DL_PAD_EIM_D30__EIM_DATA30 0x1b0b0
-                                                       MX6DL_PAD_EIM_D31__EIM_DATA31 0x1b0b0
-                                                       /* address */
-                                                       MX6DL_PAD_EIM_A23__EIM_ADDR23 0xb0b1
-                                                       MX6DL_PAD_EIM_A22__EIM_ADDR22 0xb0b1
-                                                       MX6DL_PAD_EIM_A21__EIM_ADDR21 0xb0b1
-                                                       MX6DL_PAD_EIM_A20__EIM_ADDR20 0xb0b1
-                                                       MX6DL_PAD_EIM_A19__EIM_ADDR19 0xb0b1
-                                                       MX6DL_PAD_EIM_A18__EIM_ADDR18 0xb0b1
-                                                       MX6DL_PAD_EIM_A17__EIM_ADDR17 0xb0b1
-                                                       MX6DL_PAD_EIM_A16__EIM_ADDR16 0xb0b1
-                                                       MX6DL_PAD_EIM_DA15__EIM_AD15  0xb0b1
-                                                       MX6DL_PAD_EIM_DA14__EIM_AD14  0xb0b1
-                                                       MX6DL_PAD_EIM_DA13__EIM_AD13  0xb0b1
-                                                       MX6DL_PAD_EIM_DA12__EIM_AD12  0xb0b1
-                                                       MX6DL_PAD_EIM_DA11__EIM_AD11  0xb0b1
-                                                       MX6DL_PAD_EIM_DA10__EIM_AD10  0xb0b1
-                                                       MX6DL_PAD_EIM_DA9__EIM_AD09   0xb0b1
-                                                       MX6DL_PAD_EIM_DA8__EIM_AD08   0xb0b1
-                                                       MX6DL_PAD_EIM_DA7__EIM_AD07   0xb0b1
-                                                       MX6DL_PAD_EIM_DA6__EIM_AD06   0xb0b1
-                                                       MX6DL_PAD_EIM_DA5__EIM_AD05   0xb0b1
-                                                       MX6DL_PAD_EIM_DA4__EIM_AD04   0xb0b1
-                                                       MX6DL_PAD_EIM_DA3__EIM_AD03   0xb0b1
-                                                       MX6DL_PAD_EIM_DA2__EIM_AD02   0xb0b1
-                                                       MX6DL_PAD_EIM_DA1__EIM_AD01   0xb0b1
-                                                       MX6DL_PAD_EIM_DA0__EIM_AD00   0xb0b1
-                                               >;
-                                       };
-
-                               };
-
                        };
 
                        pxp: pxp@020f0000 {
                };
        };
 };
+
+&ldb {
+       clocks = <&clks 33>, <&clks 34>,
+                <&clks 39>, <&clks 40>,
+                <&clks 135>, <&clks 136>;
+       clock-names = "di0_pll", "di1_pll",
+                     "di0_sel", "di1_sel",
+                     "di0", "di1";
+
+       lvds-channel@0 {
+               crtcs = <&ipu1 0>, <&ipu1 1>;
+       };
+
+       lvds-channel@1 {
+               crtcs = <&ipu1 0>, <&ipu1 1>;
+       };
+};
index 4e54fde..edf1bd9 100644 (file)
@@ -57,7 +57,7 @@
        hog {
                pinctrl_hog: hoggrp {
                        fsl,pins = <
-                               MX6Q_PAD_EIM_D25__GPIO3_IO25 0x80000000
+                               MX6QDL_PAD_EIM_D25__GPIO3_IO25 0x80000000
                        >;
                };
        };
@@ -65,8 +65,8 @@
        arm2 {
                pinctrl_usdhc3_arm2: usdhc3grp-arm2 {
                        fsl,pins = <
-                               MX6Q_PAD_NANDF_CS0__GPIO6_IO11 0x80000000
-                               MX6Q_PAD_NANDF_CS1__GPIO6_IO14 0x80000000
+                               MX6QDL_PAD_NANDF_CS0__GPIO6_IO11 0x80000000
+                               MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x80000000
                        >;
                };
        };
        status = "okay";
 };
 
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2_2>;
+       fsl,dte-mode;
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
+
 &uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart4_1>;
index f5e1981..1a3b50d 100644 (file)
        };
 };
 
+&ecspi3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi3_1>;
+       status = "okay";
+       fsl,spi-num-chipselects = <1>;
+       cs-gpios = <&gpio4 24 0>;
+
+       flash@0 {
+               compatible = "m25p80";
+               spi-max-frequency = <20000000>;
+               reg = <0>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1_1>;
+       status = "okay";
+
+       eeprom@50 {
+               compatible = "atmel,24c32";
+               reg = <0x50>;
+       };
+
+       pmic@58 {
+               compatible = "dialog,da9063";
+               reg = <0x58>;
+               interrupt-parent = <&gpio4>;
+               interrupts = <17 0x8>; /* active-low GPIO4_17 */
+
+               regulators {
+                       vddcore_reg: bcore1 {
+                               regulator-min-microvolt = <730000>;
+                               regulator-max-microvolt = <1380000>;
+                               regulator-always-on;
+                       };
+
+                       vddsoc_reg: bcore2 {
+                               regulator-min-microvolt = <730000>;
+                               regulator-max-microvolt = <1380000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_ddr3_reg: bpro {
+                               regulator-min-microvolt = <1500000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_3v3_reg: bperi {
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_buckmem_reg: bmem {
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_eth_reg: bio {
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_eth_io_reg: ldo4 {
+                               regulator-min-microvolt = <2500000>;
+                               regulator-max-microvolt = <2500000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_mx6_snvs_reg: ldo5 {
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_3v3_pmic_io_reg: ldo6 {
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_sd0_reg: ldo9 {
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       vdd_sd1_reg: ldo10 {
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       vdd_mx6_high_reg: ldo11 {
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                       };
+               };
+       };
+};
+
 &iomuxc {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_hog>;
        hog {
                pinctrl_hog: hoggrp {
                        fsl,pins = <
-                               MX6Q_PAD_EIM_D23__GPIO3_IO23    0x80000000
+                               MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000
+                               MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24 0x80000000 /* SPI NOR chipselect */
+                               MX6QDL_PAD_DI0_PIN15__GPIO4_IO17  0x80000000 /* PMIC interrupt */
                        >;
                };
        };
        pfla02 {
                pinctrl_usdhc3_pfla02: usdhc3grp-pfla02 {
                        fsl,pins = <
-                               MX6Q_PAD_ENET_RXD0__GPIO1_IO27  0x80000000
-                               MX6Q_PAD_ENET_TXD1__GPIO1_IO29  0x80000000
+                               MX6QDL_PAD_ENET_RXD0__GPIO1_IO27 0x80000000
+                               MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000
                        >;
                };
        };
index faea6e1..c0e38a4 100644 (file)
  * The pin function ID is a tuple of
  * <mux_reg conf_reg input_reg mux_mode input_val>
  */
-#define MX6Q_PAD_SD2_DAT1__SD2_DATA1              0x04c 0x360 0x000 0x0 0x0
-#define MX6Q_PAD_SD2_DAT1__ECSPI5_SS0             0x04c 0x360 0x834 0x1 0x0
-#define MX6Q_PAD_SD2_DAT1__EIM_CS2_B              0x04c 0x360 0x000 0x2 0x0
-#define MX6Q_PAD_SD2_DAT1__AUD4_TXFS              0x04c 0x360 0x7c8 0x3 0x0
-#define MX6Q_PAD_SD2_DAT1__KEY_COL7               0x04c 0x360 0x8f0 0x4 0x0
-#define MX6Q_PAD_SD2_DAT1__GPIO1_IO14             0x04c 0x360 0x000 0x5 0x0
-#define MX6Q_PAD_SD2_DAT2__SD2_DATA2              0x050 0x364 0x000 0x0 0x0
-#define MX6Q_PAD_SD2_DAT2__ECSPI5_SS1             0x050 0x364 0x838 0x1 0x0
-#define MX6Q_PAD_SD2_DAT2__EIM_CS3_B              0x050 0x364 0x000 0x2 0x0
-#define MX6Q_PAD_SD2_DAT2__AUD4_TXD               0x050 0x364 0x7b8 0x3 0x0
-#define MX6Q_PAD_SD2_DAT2__KEY_ROW6               0x050 0x364 0x8f8 0x4 0x0
-#define MX6Q_PAD_SD2_DAT2__GPIO1_IO13             0x050 0x364 0x000 0x5 0x0
-#define MX6Q_PAD_SD2_DAT0__SD2_DATA0              0x054 0x368 0x000 0x0 0x0
-#define MX6Q_PAD_SD2_DAT0__ECSPI5_MISO            0x054 0x368 0x82c 0x1 0x0
-#define MX6Q_PAD_SD2_DAT0__AUD4_RXD               0x054 0x368 0x7b4 0x3 0x0
-#define MX6Q_PAD_SD2_DAT0__KEY_ROW7               0x054 0x368 0x8fc 0x4 0x0
-#define MX6Q_PAD_SD2_DAT0__GPIO1_IO15             0x054 0x368 0x000 0x5 0x0
-#define MX6Q_PAD_SD2_DAT0__DCIC2_OUT              0x054 0x368 0x000 0x6 0x0
-#define MX6Q_PAD_RGMII_TXC__USB_H2_DATA           0x058 0x36c 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_TXC__RGMII_TXC             0x058 0x36c 0x000 0x1 0x0
-#define MX6Q_PAD_RGMII_TXC__SPDIF_EXT_CLK         0x058 0x36c 0x918 0x2 0x0
-#define MX6Q_PAD_RGMII_TXC__GPIO6_IO19            0x058 0x36c 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_TXC__XTALOSC_REF_CLK_24M   0x058 0x36c 0x000 0x7 0x0
-#define MX6Q_PAD_RGMII_TD0__HSI_TX_READY          0x05c 0x370 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_TD0__RGMII_TD0             0x05c 0x370 0x000 0x1 0x0
-#define MX6Q_PAD_RGMII_TD0__GPIO6_IO20            0x05c 0x370 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_TD1__HSI_RX_FLAG           0x060 0x374 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_TD1__RGMII_TD1             0x060 0x374 0x000 0x1 0x0
-#define MX6Q_PAD_RGMII_TD1__GPIO6_IO21            0x060 0x374 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_TD2__HSI_RX_DATA           0x064 0x378 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_TD2__RGMII_TD2             0x064 0x378 0x000 0x1 0x0
-#define MX6Q_PAD_RGMII_TD2__GPIO6_IO22            0x064 0x378 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_TD3__HSI_RX_WAKE           0x068 0x37c 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_TD3__RGMII_TD3             0x068 0x37c 0x000 0x1 0x0
-#define MX6Q_PAD_RGMII_TD3__GPIO6_IO23            0x068 0x37c 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_RX_CTL__USB_H3_DATA        0x06c 0x380 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL       0x06c 0x380 0x858 0x1 0x0
-#define MX6Q_PAD_RGMII_RX_CTL__GPIO6_IO24         0x06c 0x380 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_RD0__HSI_RX_READY          0x070 0x384 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_RD0__RGMII_RD0             0x070 0x384 0x848 0x1 0x0
-#define MX6Q_PAD_RGMII_RD0__GPIO6_IO25            0x070 0x384 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_TX_CTL__USB_H2_STROBE      0x074 0x388 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL       0x074 0x388 0x000 0x1 0x0
-#define MX6Q_PAD_RGMII_TX_CTL__GPIO6_IO26         0x074 0x388 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_TX_CTL__ENET_REF_CLK       0x074 0x388 0x83c 0x7 0x0
-#define MX6Q_PAD_RGMII_RD1__HSI_TX_FLAG           0x078 0x38c 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_RD1__RGMII_RD1             0x078 0x38c 0x84c 0x1 0x0
-#define MX6Q_PAD_RGMII_RD1__GPIO6_IO27            0x078 0x38c 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_RD2__HSI_TX_DATA           0x07c 0x390 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_RD2__RGMII_RD2             0x07c 0x390 0x850 0x1 0x0
-#define MX6Q_PAD_RGMII_RD2__GPIO6_IO28            0x07c 0x390 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_RD3__HSI_TX_WAKE           0x080 0x394 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_RD3__RGMII_RD3             0x080 0x394 0x854 0x1 0x0
-#define MX6Q_PAD_RGMII_RD3__GPIO6_IO29            0x080 0x394 0x000 0x5 0x0
-#define MX6Q_PAD_RGMII_RXC__USB_H3_STROBE         0x084 0x398 0x000 0x0 0x0
-#define MX6Q_PAD_RGMII_RXC__RGMII_RXC             0x084 0x398 0x844 0x1 0x0
-#define MX6Q_PAD_RGMII_RXC__GPIO6_IO30            0x084 0x398 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A25__EIM_ADDR25              0x088 0x39c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A25__ECSPI4_SS1              0x088 0x39c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A25__ECSPI2_RDY              0x088 0x39c 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_A25__IPU1_DI1_PIN12          0x088 0x39c 0x000 0x3 0x0
-#define MX6Q_PAD_EIM_A25__IPU1_DI0_D1_CS          0x088 0x39c 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_A25__GPIO5_IO02              0x088 0x39c 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A25__HDMI_TX_CEC_LINE        0x088 0x39c 0x88c 0x6 0x0
-#define MX6Q_PAD_EIM_EB2__EIM_EB2_B               0x08c 0x3a0 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_EB2__ECSPI1_SS0              0x08c 0x3a0 0x800 0x1 0x0
-#define MX6Q_PAD_EIM_EB2__IPU2_CSI1_DATA19        0x08c 0x3a0 0x8d4 0x3 0x0
-#define MX6Q_PAD_EIM_EB2__HDMI_TX_DDC_SCL         0x08c 0x3a0 0x890 0x4 0x0
-#define MX6Q_PAD_EIM_EB2__GPIO2_IO30              0x08c 0x3a0 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_EB2__I2C2_SCL                0x08c 0x3a0 0x8a0 0x6 0x0
-#define MX6Q_PAD_EIM_EB2__SRC_BOOT_CFG30          0x08c 0x3a0 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D16__EIM_DATA16              0x090 0x3a4 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D16__ECSPI1_SCLK             0x090 0x3a4 0x7f4 0x1 0x0
-#define MX6Q_PAD_EIM_D16__IPU1_DI0_PIN05          0x090 0x3a4 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D16__IPU2_CSI1_DATA18        0x090 0x3a4 0x8d0 0x3 0x0
-#define MX6Q_PAD_EIM_D16__HDMI_TX_DDC_SDA         0x090 0x3a4 0x894 0x4 0x0
-#define MX6Q_PAD_EIM_D16__GPIO3_IO16              0x090 0x3a4 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D16__I2C2_SDA                0x090 0x3a4 0x8a4 0x6 0x0
-#define MX6Q_PAD_EIM_D17__EIM_DATA17              0x094 0x3a8 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D17__ECSPI1_MISO             0x094 0x3a8 0x7f8 0x1 0x0
-#define MX6Q_PAD_EIM_D17__IPU1_DI0_PIN06          0x094 0x3a8 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D17__IPU2_CSI1_PIXCLK        0x094 0x3a8 0x8e0 0x3 0x0
-#define MX6Q_PAD_EIM_D17__DCIC1_OUT               0x094 0x3a8 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D17__GPIO3_IO17              0x094 0x3a8 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D17__I2C3_SCL                0x094 0x3a8 0x8a8 0x6 0x0
-#define MX6Q_PAD_EIM_D18__EIM_DATA18              0x098 0x3ac 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D18__ECSPI1_MOSI             0x098 0x3ac 0x7fc 0x1 0x0
-#define MX6Q_PAD_EIM_D18__IPU1_DI0_PIN07          0x098 0x3ac 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D18__IPU2_CSI1_DATA17        0x098 0x3ac 0x8cc 0x3 0x0
-#define MX6Q_PAD_EIM_D18__IPU1_DI1_D0_CS          0x098 0x3ac 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D18__GPIO3_IO18              0x098 0x3ac 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D18__I2C3_SDA                0x098 0x3ac 0x8ac 0x6 0x0
-#define MX6Q_PAD_EIM_D19__EIM_DATA19              0x09c 0x3b0 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D19__ECSPI1_SS1              0x09c 0x3b0 0x804 0x1 0x0
-#define MX6Q_PAD_EIM_D19__IPU1_DI0_PIN08          0x09c 0x3b0 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D19__IPU2_CSI1_DATA16        0x09c 0x3b0 0x8c8 0x3 0x0
-#define MX6Q_PAD_EIM_D19__UART1_CTS_B             0x09c 0x3b0 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D19__UART1_RTS_B             0x09c 0x3b0 0x91c 0x4 0x0
-#define MX6Q_PAD_EIM_D19__GPIO3_IO19              0x09c 0x3b0 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D19__EPIT1_OUT               0x09c 0x3b0 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_D20__EIM_DATA20              0x0a0 0x3b4 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D20__ECSPI4_SS0              0x0a0 0x3b4 0x824 0x1 0x0
-#define MX6Q_PAD_EIM_D20__IPU1_DI0_PIN16          0x0a0 0x3b4 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D20__IPU2_CSI1_DATA15        0x0a0 0x3b4 0x8c4 0x3 0x0
-#define MX6Q_PAD_EIM_D20__UART1_RTS_B             0x0a0 0x3b4 0x91c 0x4 0x1
-#define MX6Q_PAD_EIM_D20__UART1_CTS_B             0x0a0 0x3b4 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D20__GPIO3_IO20              0x0a0 0x3b4 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D20__EPIT2_OUT               0x0a0 0x3b4 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_D21__EIM_DATA21              0x0a4 0x3b8 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D21__ECSPI4_SCLK             0x0a4 0x3b8 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D21__IPU1_DI0_PIN17          0x0a4 0x3b8 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D21__IPU2_CSI1_DATA11        0x0a4 0x3b8 0x8b4 0x3 0x0
-#define MX6Q_PAD_EIM_D21__USB_OTG_OC              0x0a4 0x3b8 0x944 0x4 0x0
-#define MX6Q_PAD_EIM_D21__GPIO3_IO21              0x0a4 0x3b8 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D21__I2C1_SCL                0x0a4 0x3b8 0x898 0x6 0x0
-#define MX6Q_PAD_EIM_D21__SPDIF_IN                0x0a4 0x3b8 0x914 0x7 0x0
-#define MX6Q_PAD_EIM_D22__EIM_DATA22              0x0a8 0x3bc 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D22__ECSPI4_MISO             0x0a8 0x3bc 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D22__IPU1_DI0_PIN01          0x0a8 0x3bc 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D22__IPU2_CSI1_DATA10        0x0a8 0x3bc 0x8b0 0x3 0x0
-#define MX6Q_PAD_EIM_D22__USB_OTG_PWR             0x0a8 0x3bc 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D22__GPIO3_IO22              0x0a8 0x3bc 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D22__SPDIF_OUT               0x0a8 0x3bc 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_D23__EIM_DATA23              0x0ac 0x3c0 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D23__IPU1_DI0_D0_CS          0x0ac 0x3c0 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D23__UART3_CTS_B             0x0ac 0x3c0 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D23__UART3_RTS_B             0x0ac 0x3c0 0x92c 0x2 0x0
-#define MX6Q_PAD_EIM_D23__UART1_DCD_B             0x0ac 0x3c0 0x000 0x3 0x0
-#define MX6Q_PAD_EIM_D23__IPU2_CSI1_DATA_EN       0x0ac 0x3c0 0x8d8 0x4 0x0
-#define MX6Q_PAD_EIM_D23__GPIO3_IO23              0x0ac 0x3c0 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D23__IPU1_DI1_PIN02          0x0ac 0x3c0 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_D23__IPU1_DI1_PIN14          0x0ac 0x3c0 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_EB3__EIM_EB3_B               0x0b0 0x3c4 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_EB3__ECSPI4_RDY              0x0b0 0x3c4 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_EB3__UART3_RTS_B             0x0b0 0x3c4 0x92c 0x2 0x1
-#define MX6Q_PAD_EIM_EB3__UART3_CTS_B             0x0b0 0x3c4 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_EB3__UART1_RI_B              0x0b0 0x3c4 0x000 0x3 0x0
-#define MX6Q_PAD_EIM_EB3__IPU2_CSI1_HSYNC         0x0b0 0x3c4 0x8dc 0x4 0x0
-#define MX6Q_PAD_EIM_EB3__GPIO2_IO31              0x0b0 0x3c4 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_EB3__IPU1_DI1_PIN03          0x0b0 0x3c4 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_EB3__SRC_BOOT_CFG31          0x0b0 0x3c4 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D24__EIM_DATA24              0x0b4 0x3c8 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D24__ECSPI4_SS2              0x0b4 0x3c8 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D24__UART3_TX_DATA           0x0b4 0x3c8 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D24__UART3_RX_DATA           0x0b4 0x3c8 0x930 0x2 0x0
-#define MX6Q_PAD_EIM_D24__ECSPI1_SS2              0x0b4 0x3c8 0x808 0x3 0x0
-#define MX6Q_PAD_EIM_D24__ECSPI2_SS2              0x0b4 0x3c8 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D24__GPIO3_IO24              0x0b4 0x3c8 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D24__AUD5_RXFS               0x0b4 0x3c8 0x7d8 0x6 0x0
-#define MX6Q_PAD_EIM_D24__UART1_DTR_B             0x0b4 0x3c8 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D25__EIM_DATA25              0x0b8 0x3cc 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D25__ECSPI4_SS3              0x0b8 0x3cc 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D25__UART3_RX_DATA           0x0b8 0x3cc 0x930 0x2 0x1
-#define MX6Q_PAD_EIM_D25__UART3_TX_DATA           0x0b8 0x3cc 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D25__ECSPI1_SS3              0x0b8 0x3cc 0x80c 0x3 0x0
-#define MX6Q_PAD_EIM_D25__ECSPI2_SS3              0x0b8 0x3cc 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D25__GPIO3_IO25              0x0b8 0x3cc 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D25__AUD5_RXC                0x0b8 0x3cc 0x7d4 0x6 0x0
-#define MX6Q_PAD_EIM_D25__UART1_DSR_B             0x0b8 0x3cc 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D26__EIM_DATA26              0x0bc 0x3d0 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D26__IPU1_DI1_PIN11          0x0bc 0x3d0 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D26__IPU1_CSI0_DATA01        0x0bc 0x3d0 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D26__IPU2_CSI1_DATA14        0x0bc 0x3d0 0x8c0 0x3 0x0
-#define MX6Q_PAD_EIM_D26__UART2_TX_DATA           0x0bc 0x3d0 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D26__UART2_RX_DATA           0x0bc 0x3d0 0x928 0x4 0x0
-#define MX6Q_PAD_EIM_D26__GPIO3_IO26              0x0bc 0x3d0 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D26__IPU1_SISG2              0x0bc 0x3d0 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_D26__IPU1_DISP1_DATA22       0x0bc 0x3d0 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D27__EIM_DATA27              0x0c0 0x3d4 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D27__IPU1_DI1_PIN13          0x0c0 0x3d4 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D27__IPU1_CSI0_DATA00        0x0c0 0x3d4 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D27__IPU2_CSI1_DATA13        0x0c0 0x3d4 0x8bc 0x3 0x0
-#define MX6Q_PAD_EIM_D27__UART2_RX_DATA           0x0c0 0x3d4 0x928 0x4 0x1
-#define MX6Q_PAD_EIM_D27__UART2_TX_DATA           0x0c0 0x3d4 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D27__GPIO3_IO27              0x0c0 0x3d4 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D27__IPU1_SISG3              0x0c0 0x3d4 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_D27__IPU1_DISP1_DATA23       0x0c0 0x3d4 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D28__EIM_DATA28              0x0c4 0x3d8 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D28__I2C1_SDA                0x0c4 0x3d8 0x89c 0x1 0x0
-#define MX6Q_PAD_EIM_D28__ECSPI4_MOSI             0x0c4 0x3d8 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D28__IPU2_CSI1_DATA12        0x0c4 0x3d8 0x8b8 0x3 0x0
-#define MX6Q_PAD_EIM_D28__UART2_CTS_B             0x0c4 0x3d8 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D28__UART2_RTS_B             0x0c4 0x3d8 0x924 0x4 0x0
-#define MX6Q_PAD_EIM_D28__GPIO3_IO28              0x0c4 0x3d8 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D28__IPU1_EXT_TRIG           0x0c4 0x3d8 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_D28__IPU1_DI0_PIN13          0x0c4 0x3d8 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D29__EIM_DATA29              0x0c8 0x3dc 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D29__IPU1_DI1_PIN15          0x0c8 0x3dc 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D29__ECSPI4_SS0              0x0c8 0x3dc 0x824 0x2 0x1
-#define MX6Q_PAD_EIM_D29__UART2_RTS_B             0x0c8 0x3dc 0x924 0x4 0x1
-#define MX6Q_PAD_EIM_D29__UART2_CTS_B             0x0c8 0x3dc 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D29__GPIO3_IO29              0x0c8 0x3dc 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D29__IPU2_CSI1_VSYNC         0x0c8 0x3dc 0x8e4 0x6 0x0
-#define MX6Q_PAD_EIM_D29__IPU1_DI0_PIN14          0x0c8 0x3dc 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_D30__EIM_DATA30              0x0cc 0x3e0 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D30__IPU1_DISP1_DATA21       0x0cc 0x3e0 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D30__IPU1_DI0_PIN11          0x0cc 0x3e0 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D30__IPU1_CSI0_DATA03        0x0cc 0x3e0 0x000 0x3 0x0
-#define MX6Q_PAD_EIM_D30__UART3_CTS_B             0x0cc 0x3e0 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D30__UART3_RTS_B             0x0cc 0x3e0 0x92c 0x4 0x2
-#define MX6Q_PAD_EIM_D30__GPIO3_IO30              0x0cc 0x3e0 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D30__USB_H1_OC               0x0cc 0x3e0 0x948 0x6 0x0
-#define MX6Q_PAD_EIM_D31__EIM_DATA31              0x0d0 0x3e4 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_D31__IPU1_DISP1_DATA20       0x0d0 0x3e4 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_D31__IPU1_DI0_PIN12          0x0d0 0x3e4 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_D31__IPU1_CSI0_DATA02        0x0d0 0x3e4 0x000 0x3 0x0
-#define MX6Q_PAD_EIM_D31__UART3_RTS_B             0x0d0 0x3e4 0x92c 0x4 0x3
-#define MX6Q_PAD_EIM_D31__UART3_CTS_B             0x0d0 0x3e4 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_D31__GPIO3_IO31              0x0d0 0x3e4 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_D31__USB_H1_PWR              0x0d0 0x3e4 0x000 0x6 0x0
-#define MX6Q_PAD_EIM_A24__EIM_ADDR24              0x0d4 0x3e8 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A24__IPU1_DISP1_DATA19       0x0d4 0x3e8 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A24__IPU2_CSI1_DATA19        0x0d4 0x3e8 0x8d4 0x2 0x1
-#define MX6Q_PAD_EIM_A24__IPU2_SISG2              0x0d4 0x3e8 0x000 0x3 0x0
-#define MX6Q_PAD_EIM_A24__IPU1_SISG2              0x0d4 0x3e8 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_A24__GPIO5_IO04              0x0d4 0x3e8 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A24__SRC_BOOT_CFG24          0x0d4 0x3e8 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A23__EIM_ADDR23              0x0d8 0x3ec 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A23__IPU1_DISP1_DATA18       0x0d8 0x3ec 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A23__IPU2_CSI1_DATA18        0x0d8 0x3ec 0x8d0 0x2 0x1
-#define MX6Q_PAD_EIM_A23__IPU2_SISG3              0x0d8 0x3ec 0x000 0x3 0x0
-#define MX6Q_PAD_EIM_A23__IPU1_SISG3              0x0d8 0x3ec 0x000 0x4 0x0
-#define MX6Q_PAD_EIM_A23__GPIO6_IO06              0x0d8 0x3ec 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A23__SRC_BOOT_CFG23          0x0d8 0x3ec 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A22__EIM_ADDR22              0x0dc 0x3f0 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A22__IPU1_DISP1_DATA17       0x0dc 0x3f0 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A22__IPU2_CSI1_DATA17        0x0dc 0x3f0 0x8cc 0x2 0x1
-#define MX6Q_PAD_EIM_A22__GPIO2_IO16              0x0dc 0x3f0 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A22__SRC_BOOT_CFG22          0x0dc 0x3f0 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A21__EIM_ADDR21              0x0e0 0x3f4 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A21__IPU1_DISP1_DATA16       0x0e0 0x3f4 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A21__IPU2_CSI1_DATA16        0x0e0 0x3f4 0x8c8 0x2 0x1
-#define MX6Q_PAD_EIM_A21__GPIO2_IO17              0x0e0 0x3f4 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A21__SRC_BOOT_CFG21          0x0e0 0x3f4 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A20__EIM_ADDR20              0x0e4 0x3f8 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A20__IPU1_DISP1_DATA15       0x0e4 0x3f8 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A20__IPU2_CSI1_DATA15        0x0e4 0x3f8 0x8c4 0x2 0x1
-#define MX6Q_PAD_EIM_A20__GPIO2_IO18              0x0e4 0x3f8 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A20__SRC_BOOT_CFG20          0x0e4 0x3f8 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A19__EIM_ADDR19              0x0e8 0x3fc 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A19__IPU1_DISP1_DATA14       0x0e8 0x3fc 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A19__IPU2_CSI1_DATA14        0x0e8 0x3fc 0x8c0 0x2 0x1
-#define MX6Q_PAD_EIM_A19__GPIO2_IO19              0x0e8 0x3fc 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A19__SRC_BOOT_CFG19          0x0e8 0x3fc 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A18__EIM_ADDR18              0x0ec 0x400 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A18__IPU1_DISP1_DATA13       0x0ec 0x400 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A18__IPU2_CSI1_DATA13        0x0ec 0x400 0x8bc 0x2 0x1
-#define MX6Q_PAD_EIM_A18__GPIO2_IO20              0x0ec 0x400 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A18__SRC_BOOT_CFG18          0x0ec 0x400 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A17__EIM_ADDR17              0x0f0 0x404 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A17__IPU1_DISP1_DATA12       0x0f0 0x404 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A17__IPU2_CSI1_DATA12        0x0f0 0x404 0x8b8 0x2 0x1
-#define MX6Q_PAD_EIM_A17__GPIO2_IO21              0x0f0 0x404 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A17__SRC_BOOT_CFG17          0x0f0 0x404 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_A16__EIM_ADDR16              0x0f4 0x408 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_A16__IPU1_DI1_DISP_CLK       0x0f4 0x408 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_A16__IPU2_CSI1_PIXCLK        0x0f4 0x408 0x8e0 0x2 0x1
-#define MX6Q_PAD_EIM_A16__GPIO2_IO22              0x0f4 0x408 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_A16__SRC_BOOT_CFG16          0x0f4 0x408 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_CS0__EIM_CS0_B               0x0f8 0x40c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_CS0__IPU1_DI1_PIN05          0x0f8 0x40c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_CS0__ECSPI2_SCLK             0x0f8 0x40c 0x810 0x2 0x0
-#define MX6Q_PAD_EIM_CS0__GPIO2_IO23              0x0f8 0x40c 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_CS1__EIM_CS1_B               0x0fc 0x410 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_CS1__IPU1_DI1_PIN06          0x0fc 0x410 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_CS1__ECSPI2_MOSI             0x0fc 0x410 0x818 0x2 0x0
-#define MX6Q_PAD_EIM_CS1__GPIO2_IO24              0x0fc 0x410 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_OE__EIM_OE_B                 0x100 0x414 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_OE__IPU1_DI1_PIN07           0x100 0x414 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_OE__ECSPI2_MISO              0x100 0x414 0x814 0x2 0x0
-#define MX6Q_PAD_EIM_OE__GPIO2_IO25               0x100 0x414 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_RW__EIM_RW                   0x104 0x418 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_RW__IPU1_DI1_PIN08           0x104 0x418 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_RW__ECSPI2_SS0               0x104 0x418 0x81c 0x2 0x0
-#define MX6Q_PAD_EIM_RW__GPIO2_IO26               0x104 0x418 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_RW__SRC_BOOT_CFG29           0x104 0x418 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_LBA__EIM_LBA_B               0x108 0x41c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_LBA__IPU1_DI1_PIN17          0x108 0x41c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_LBA__ECSPI2_SS1              0x108 0x41c 0x820 0x2 0x0
-#define MX6Q_PAD_EIM_LBA__GPIO2_IO27              0x108 0x41c 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_LBA__SRC_BOOT_CFG26          0x108 0x41c 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_EB0__EIM_EB0_B               0x10c 0x420 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_EB0__IPU1_DISP1_DATA11       0x10c 0x420 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_EB0__IPU2_CSI1_DATA11        0x10c 0x420 0x8b4 0x2 0x1
-#define MX6Q_PAD_EIM_EB0__CCM_PMIC_READY          0x10c 0x420 0x7f0 0x4 0x0
-#define MX6Q_PAD_EIM_EB0__GPIO2_IO28              0x10c 0x420 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_EB0__SRC_BOOT_CFG27          0x10c 0x420 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_EB1__EIM_EB1_B               0x110 0x424 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_EB1__IPU1_DISP1_DATA10       0x110 0x424 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_EB1__IPU2_CSI1_DATA10        0x110 0x424 0x8b0 0x2 0x1
-#define MX6Q_PAD_EIM_EB1__GPIO2_IO29              0x110 0x424 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_EB1__SRC_BOOT_CFG28          0x110 0x424 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA0__EIM_AD00                0x114 0x428 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA0__IPU1_DISP1_DATA09       0x114 0x428 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA0__IPU2_CSI1_DATA09        0x114 0x428 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA0__GPIO3_IO00              0x114 0x428 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA0__SRC_BOOT_CFG00          0x114 0x428 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA1__EIM_AD01                0x118 0x42c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA1__IPU1_DISP1_DATA08       0x118 0x42c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA1__IPU2_CSI1_DATA08        0x118 0x42c 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA1__GPIO3_IO01              0x118 0x42c 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA1__SRC_BOOT_CFG01          0x118 0x42c 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA2__EIM_AD02                0x11c 0x430 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA2__IPU1_DISP1_DATA07       0x11c 0x430 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA2__IPU2_CSI1_DATA07        0x11c 0x430 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA2__GPIO3_IO02              0x11c 0x430 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA2__SRC_BOOT_CFG02          0x11c 0x430 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA3__EIM_AD03                0x120 0x434 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA3__IPU1_DISP1_DATA06       0x120 0x434 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA3__IPU2_CSI1_DATA06        0x120 0x434 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA3__GPIO3_IO03              0x120 0x434 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA3__SRC_BOOT_CFG03          0x120 0x434 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA4__EIM_AD04                0x124 0x438 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA4__IPU1_DISP1_DATA05       0x124 0x438 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA4__IPU2_CSI1_DATA05        0x124 0x438 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA4__GPIO3_IO04              0x124 0x438 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA4__SRC_BOOT_CFG04          0x124 0x438 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA5__EIM_AD05                0x128 0x43c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA5__IPU1_DISP1_DATA04       0x128 0x43c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA5__IPU2_CSI1_DATA04        0x128 0x43c 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA5__GPIO3_IO05              0x128 0x43c 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA5__SRC_BOOT_CFG05          0x128 0x43c 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA6__EIM_AD06                0x12c 0x440 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA6__IPU1_DISP1_DATA03       0x12c 0x440 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA6__IPU2_CSI1_DATA03        0x12c 0x440 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA6__GPIO3_IO06              0x12c 0x440 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA6__SRC_BOOT_CFG06          0x12c 0x440 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA7__EIM_AD07                0x130 0x444 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA7__IPU1_DISP1_DATA02       0x130 0x444 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA7__IPU2_CSI1_DATA02        0x130 0x444 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA7__GPIO3_IO07              0x130 0x444 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA7__SRC_BOOT_CFG07          0x130 0x444 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA8__EIM_AD08                0x134 0x448 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA8__IPU1_DISP1_DATA01       0x134 0x448 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA8__IPU2_CSI1_DATA01        0x134 0x448 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA8__GPIO3_IO08              0x134 0x448 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA8__SRC_BOOT_CFG08          0x134 0x448 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA9__EIM_AD09                0x138 0x44c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA9__IPU1_DISP1_DATA00       0x138 0x44c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA9__IPU2_CSI1_DATA00        0x138 0x44c 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA9__GPIO3_IO09              0x138 0x44c 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA9__SRC_BOOT_CFG09          0x138 0x44c 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA10__EIM_AD10               0x13c 0x450 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA10__IPU1_DI1_PIN15         0x13c 0x450 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA10__IPU2_CSI1_DATA_EN      0x13c 0x450 0x8d8 0x2 0x1
-#define MX6Q_PAD_EIM_DA10__GPIO3_IO10             0x13c 0x450 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA10__SRC_BOOT_CFG10         0x13c 0x450 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA11__EIM_AD11               0x140 0x454 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA11__IPU1_DI1_PIN02         0x140 0x454 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA11__IPU2_CSI1_HSYNC        0x140 0x454 0x8dc 0x2 0x1
-#define MX6Q_PAD_EIM_DA11__GPIO3_IO11             0x140 0x454 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA11__SRC_BOOT_CFG11         0x140 0x454 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA12__EIM_AD12               0x144 0x458 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA12__IPU1_DI1_PIN03         0x144 0x458 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA12__IPU2_CSI1_VSYNC        0x144 0x458 0x8e4 0x2 0x1
-#define MX6Q_PAD_EIM_DA12__GPIO3_IO12             0x144 0x458 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA12__SRC_BOOT_CFG12         0x144 0x458 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA13__EIM_AD13               0x148 0x45c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA13__IPU1_DI1_D0_CS         0x148 0x45c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA13__GPIO3_IO13             0x148 0x45c 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA13__SRC_BOOT_CFG13         0x148 0x45c 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA14__EIM_AD14               0x14c 0x460 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA14__IPU1_DI1_D1_CS         0x14c 0x460 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA14__GPIO3_IO14             0x14c 0x460 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA14__SRC_BOOT_CFG14         0x14c 0x460 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_DA15__EIM_AD15               0x150 0x464 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_DA15__IPU1_DI1_PIN01         0x150 0x464 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_DA15__IPU1_DI1_PIN04         0x150 0x464 0x000 0x2 0x0
-#define MX6Q_PAD_EIM_DA15__GPIO3_IO15             0x150 0x464 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_DA15__SRC_BOOT_CFG15         0x150 0x464 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_WAIT__EIM_WAIT_B             0x154 0x468 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_WAIT__EIM_DTACK_B            0x154 0x468 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_WAIT__GPIO5_IO00             0x154 0x468 0x000 0x5 0x0
-#define MX6Q_PAD_EIM_WAIT__SRC_BOOT_CFG25         0x154 0x468 0x000 0x7 0x0
-#define MX6Q_PAD_EIM_BCLK__EIM_BCLK               0x158 0x46c 0x000 0x0 0x0
-#define MX6Q_PAD_EIM_BCLK__IPU1_DI1_PIN16         0x158 0x46c 0x000 0x1 0x0
-#define MX6Q_PAD_EIM_BCLK__GPIO6_IO31             0x158 0x46c 0x000 0x5 0x0
-#define MX6Q_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK  0x15c 0x470 0x000 0x0 0x0
-#define MX6Q_PAD_DI0_DISP_CLK__IPU2_DI0_DISP_CLK  0x15c 0x470 0x000 0x1 0x0
-#define MX6Q_PAD_DI0_DISP_CLK__GPIO4_IO16         0x15c 0x470 0x000 0x5 0x0
-#define MX6Q_PAD_DI0_PIN15__IPU1_DI0_PIN15        0x160 0x474 0x000 0x0 0x0
-#define MX6Q_PAD_DI0_PIN15__IPU2_DI0_PIN15        0x160 0x474 0x000 0x1 0x0
-#define MX6Q_PAD_DI0_PIN15__AUD6_TXC              0x160 0x474 0x000 0x2 0x0
-#define MX6Q_PAD_DI0_PIN15__GPIO4_IO17            0x160 0x474 0x000 0x5 0x0
-#define MX6Q_PAD_DI0_PIN2__IPU1_DI0_PIN02         0x164 0x478 0x000 0x0 0x0
-#define MX6Q_PAD_DI0_PIN2__IPU2_DI0_PIN02         0x164 0x478 0x000 0x1 0x0
-#define MX6Q_PAD_DI0_PIN2__AUD6_TXD               0x164 0x478 0x000 0x2 0x0
-#define MX6Q_PAD_DI0_PIN2__GPIO4_IO18             0x164 0x478 0x000 0x5 0x0
-#define MX6Q_PAD_DI0_PIN3__IPU1_DI0_PIN03         0x168 0x47c 0x000 0x0 0x0
-#define MX6Q_PAD_DI0_PIN3__IPU2_DI0_PIN03         0x168 0x47c 0x000 0x1 0x0
-#define MX6Q_PAD_DI0_PIN3__AUD6_TXFS              0x168 0x47c 0x000 0x2 0x0
-#define MX6Q_PAD_DI0_PIN3__GPIO4_IO19             0x168 0x47c 0x000 0x5 0x0
-#define MX6Q_PAD_DI0_PIN4__IPU1_DI0_PIN04         0x16c 0x480 0x000 0x0 0x0
-#define MX6Q_PAD_DI0_PIN4__IPU2_DI0_PIN04         0x16c 0x480 0x000 0x1 0x0
-#define MX6Q_PAD_DI0_PIN4__AUD6_RXD               0x16c 0x480 0x000 0x2 0x0
-#define MX6Q_PAD_DI0_PIN4__SD1_WP                 0x16c 0x480 0x94c 0x3 0x0
-#define MX6Q_PAD_DI0_PIN4__GPIO4_IO20             0x16c 0x480 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT0__IPU1_DISP0_DATA00    0x170 0x484 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT0__IPU2_DISP0_DATA00    0x170 0x484 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT0__ECSPI3_SCLK          0x170 0x484 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT0__GPIO4_IO21           0x170 0x484 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT1__IPU1_DISP0_DATA01    0x174 0x488 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT1__IPU2_DISP0_DATA01    0x174 0x488 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT1__ECSPI3_MOSI          0x174 0x488 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT1__GPIO4_IO22           0x174 0x488 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT2__IPU1_DISP0_DATA02    0x178 0x48c 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT2__IPU2_DISP0_DATA02    0x178 0x48c 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT2__ECSPI3_MISO          0x178 0x48c 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT2__GPIO4_IO23           0x178 0x48c 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT3__IPU1_DISP0_DATA03    0x17c 0x490 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT3__IPU2_DISP0_DATA03    0x17c 0x490 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT3__ECSPI3_SS0           0x17c 0x490 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT3__GPIO4_IO24           0x17c 0x490 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT4__IPU1_DISP0_DATA04    0x180 0x494 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT4__IPU2_DISP0_DATA04    0x180 0x494 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT4__ECSPI3_SS1           0x180 0x494 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT4__GPIO4_IO25           0x180 0x494 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT5__IPU1_DISP0_DATA05    0x184 0x498 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT5__IPU2_DISP0_DATA05    0x184 0x498 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT5__ECSPI3_SS2           0x184 0x498 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT5__AUD6_RXFS            0x184 0x498 0x000 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT5__GPIO4_IO26           0x184 0x498 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT6__IPU1_DISP0_DATA06    0x188 0x49c 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT6__IPU2_DISP0_DATA06    0x188 0x49c 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT6__ECSPI3_SS3           0x188 0x49c 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT6__AUD6_RXC             0x188 0x49c 0x000 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT6__GPIO4_IO27           0x188 0x49c 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT7__IPU1_DISP0_DATA07    0x18c 0x4a0 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT7__IPU2_DISP0_DATA07    0x18c 0x4a0 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT7__ECSPI3_RDY           0x18c 0x4a0 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT7__GPIO4_IO28           0x18c 0x4a0 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT8__IPU1_DISP0_DATA08    0x190 0x4a4 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT8__IPU2_DISP0_DATA08    0x190 0x4a4 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT8__PWM1_OUT             0x190 0x4a4 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT8__WDOG1_B              0x190 0x4a4 0x000 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT8__GPIO4_IO29           0x190 0x4a4 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT9__IPU1_DISP0_DATA09    0x194 0x4a8 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT9__IPU2_DISP0_DATA09    0x194 0x4a8 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT9__PWM2_OUT             0x194 0x4a8 0x000 0x2 0x0
-#define MX6Q_PAD_DISP0_DAT9__WDOG2_B              0x194 0x4a8 0x000 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT9__GPIO4_IO30           0x194 0x4a8 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT10__IPU1_DISP0_DATA10   0x198 0x4ac 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT10__IPU2_DISP0_DATA10   0x198 0x4ac 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT10__GPIO4_IO31          0x198 0x4ac 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT11__IPU1_DISP0_DATA11   0x19c 0x4b0 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT11__IPU2_DISP0_DATA11   0x19c 0x4b0 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT11__GPIO5_IO05          0x19c 0x4b0 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT12__IPU1_DISP0_DATA12   0x1a0 0x4b4 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT12__IPU2_DISP0_DATA12   0x1a0 0x4b4 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT12__GPIO5_IO06          0x1a0 0x4b4 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT13__IPU1_DISP0_DATA13   0x1a4 0x4b8 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT13__IPU2_DISP0_DATA13   0x1a4 0x4b8 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT13__AUD5_RXFS           0x1a4 0x4b8 0x7d8 0x3 0x1
-#define MX6Q_PAD_DISP0_DAT13__GPIO5_IO07          0x1a4 0x4b8 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT14__IPU1_DISP0_DATA14   0x1a8 0x4bc 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT14__IPU2_DISP0_DATA14   0x1a8 0x4bc 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT14__AUD5_RXC            0x1a8 0x4bc 0x7d4 0x3 0x1
-#define MX6Q_PAD_DISP0_DAT14__GPIO5_IO08          0x1a8 0x4bc 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT15__IPU1_DISP0_DATA15   0x1ac 0x4c0 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT15__IPU2_DISP0_DATA15   0x1ac 0x4c0 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT15__ECSPI1_SS1          0x1ac 0x4c0 0x804 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT15__ECSPI2_SS1          0x1ac 0x4c0 0x820 0x3 0x1
-#define MX6Q_PAD_DISP0_DAT15__GPIO5_IO09          0x1ac 0x4c0 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT16__IPU1_DISP0_DATA16   0x1b0 0x4c4 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT16__IPU2_DISP0_DATA16   0x1b0 0x4c4 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT16__ECSPI2_MOSI         0x1b0 0x4c4 0x818 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT16__AUD5_TXC            0x1b0 0x4c4 0x7dc 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT16__SDMA_EXT_EVENT0     0x1b0 0x4c4 0x90c 0x4 0x0
-#define MX6Q_PAD_DISP0_DAT16__GPIO5_IO10          0x1b0 0x4c4 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT17__IPU1_DISP0_DATA17   0x1b4 0x4c8 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT17__IPU2_DISP0_DATA17   0x1b4 0x4c8 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT17__ECSPI2_MISO         0x1b4 0x4c8 0x814 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT17__AUD5_TXD            0x1b4 0x4c8 0x7d0 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT17__SDMA_EXT_EVENT1     0x1b4 0x4c8 0x910 0x4 0x0
-#define MX6Q_PAD_DISP0_DAT17__GPIO5_IO11          0x1b4 0x4c8 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT18__IPU1_DISP0_DATA18   0x1b8 0x4cc 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT18__IPU2_DISP0_DATA18   0x1b8 0x4cc 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT18__ECSPI2_SS0          0x1b8 0x4cc 0x81c 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT18__AUD5_TXFS           0x1b8 0x4cc 0x7e0 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT18__AUD4_RXFS           0x1b8 0x4cc 0x7c0 0x4 0x0
-#define MX6Q_PAD_DISP0_DAT18__GPIO5_IO12          0x1b8 0x4cc 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT18__EIM_CS2_B           0x1b8 0x4cc 0x000 0x7 0x0
-#define MX6Q_PAD_DISP0_DAT19__IPU1_DISP0_DATA19   0x1bc 0x4d0 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT19__IPU2_DISP0_DATA19   0x1bc 0x4d0 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT19__ECSPI2_SCLK         0x1bc 0x4d0 0x810 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT19__AUD5_RXD            0x1bc 0x4d0 0x7cc 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT19__AUD4_RXC            0x1bc 0x4d0 0x7bc 0x4 0x0
-#define MX6Q_PAD_DISP0_DAT19__GPIO5_IO13          0x1bc 0x4d0 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT19__EIM_CS3_B           0x1bc 0x4d0 0x000 0x7 0x0
-#define MX6Q_PAD_DISP0_DAT20__IPU1_DISP0_DATA20   0x1c0 0x4d4 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT20__IPU2_DISP0_DATA20   0x1c0 0x4d4 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT20__ECSPI1_SCLK         0x1c0 0x4d4 0x7f4 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT20__AUD4_TXC            0x1c0 0x4d4 0x7c4 0x3 0x0
-#define MX6Q_PAD_DISP0_DAT20__GPIO5_IO14          0x1c0 0x4d4 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT21__IPU1_DISP0_DATA21   0x1c4 0x4d8 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT21__IPU2_DISP0_DATA21   0x1c4 0x4d8 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT21__ECSPI1_MOSI         0x1c4 0x4d8 0x7fc 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT21__AUD4_TXD            0x1c4 0x4d8 0x7b8 0x3 0x1
-#define MX6Q_PAD_DISP0_DAT21__GPIO5_IO15          0x1c4 0x4d8 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT22__IPU1_DISP0_DATA22   0x1c8 0x4dc 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT22__IPU2_DISP0_DATA22   0x1c8 0x4dc 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT22__ECSPI1_MISO         0x1c8 0x4dc 0x7f8 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT22__AUD4_TXFS           0x1c8 0x4dc 0x7c8 0x3 0x1
-#define MX6Q_PAD_DISP0_DAT22__GPIO5_IO16          0x1c8 0x4dc 0x000 0x5 0x0
-#define MX6Q_PAD_DISP0_DAT23__IPU1_DISP0_DATA23   0x1cc 0x4e0 0x000 0x0 0x0
-#define MX6Q_PAD_DISP0_DAT23__IPU2_DISP0_DATA23   0x1cc 0x4e0 0x000 0x1 0x0
-#define MX6Q_PAD_DISP0_DAT23__ECSPI1_SS0          0x1cc 0x4e0 0x800 0x2 0x1
-#define MX6Q_PAD_DISP0_DAT23__AUD4_RXD            0x1cc 0x4e0 0x7b4 0x3 0x1
-#define MX6Q_PAD_DISP0_DAT23__GPIO5_IO17          0x1cc 0x4e0 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_MDIO__ENET_MDIO             0x1d0 0x4e4 0x840 0x1 0x0
-#define MX6Q_PAD_ENET_MDIO__ESAI_RX_CLK           0x1d0 0x4e4 0x86c 0x2 0x0
-#define MX6Q_PAD_ENET_MDIO__ENET_1588_EVENT1_OUT  0x1d0 0x4e4 0x000 0x4 0x0
-#define MX6Q_PAD_ENET_MDIO__GPIO1_IO22            0x1d0 0x4e4 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_MDIO__SPDIF_LOCK            0x1d0 0x4e4 0x000 0x6 0x0
-#define MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK        0x1d4 0x4e8 0x000 0x1 0x0
-#define MX6Q_PAD_ENET_REF_CLK__ESAI_RX_FS         0x1d4 0x4e8 0x85c 0x2 0x0
-#define MX6Q_PAD_ENET_REF_CLK__GPIO1_IO23         0x1d4 0x4e8 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_REF_CLK__SPDIF_SR_CLK       0x1d4 0x4e8 0x000 0x6 0x0
-#define MX6Q_PAD_ENET_RX_ER__USB_OTG_ID           0x1d8 0x4ec 0x000 0x0 0x0
-#define MX6Q_PAD_ENET_RX_ER__ENET_RX_ER           0x1d8 0x4ec 0x000 0x1 0x0
-#define MX6Q_PAD_ENET_RX_ER__ESAI_RX_HF_CLK       0x1d8 0x4ec 0x864 0x2 0x0
-#define MX6Q_PAD_ENET_RX_ER__SPDIF_IN             0x1d8 0x4ec 0x914 0x3 0x1
-#define MX6Q_PAD_ENET_RX_ER__ENET_1588_EVENT2_OUT 0x1d8 0x4ec 0x000 0x4 0x0
-#define MX6Q_PAD_ENET_RX_ER__GPIO1_IO24           0x1d8 0x4ec 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_CRS_DV__ENET_RX_EN          0x1dc 0x4f0 0x858 0x1 0x1
-#define MX6Q_PAD_ENET_CRS_DV__ESAI_TX_CLK         0x1dc 0x4f0 0x870 0x2 0x0
-#define MX6Q_PAD_ENET_CRS_DV__SPDIF_EXT_CLK       0x1dc 0x4f0 0x918 0x3 0x1
-#define MX6Q_PAD_ENET_CRS_DV__GPIO1_IO25          0x1dc 0x4f0 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_RXD1__MLB_SIG               0x1e0 0x4f4 0x908 0x0 0x0
-#define MX6Q_PAD_ENET_RXD1__ENET_RX_DATA1         0x1e0 0x4f4 0x84c 0x1 0x1
-#define MX6Q_PAD_ENET_RXD1__ESAI_TX_FS            0x1e0 0x4f4 0x860 0x2 0x0
-#define MX6Q_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT  0x1e0 0x4f4 0x000 0x4 0x0
-#define MX6Q_PAD_ENET_RXD1__GPIO1_IO26            0x1e0 0x4f4 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_RXD0__ENET_RX_DATA0         0x1e4 0x4f8 0x848 0x1 0x1
-#define MX6Q_PAD_ENET_RXD0__ESAI_TX_HF_CLK        0x1e4 0x4f8 0x868 0x2 0x0
-#define MX6Q_PAD_ENET_RXD0__SPDIF_OUT             0x1e4 0x4f8 0x000 0x3 0x0
-#define MX6Q_PAD_ENET_RXD0__GPIO1_IO27            0x1e4 0x4f8 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_TX_EN__ENET_TX_EN           0x1e8 0x4fc 0x000 0x1 0x0
-#define MX6Q_PAD_ENET_TX_EN__ESAI_TX3_RX2         0x1e8 0x4fc 0x880 0x2 0x0
-#define MX6Q_PAD_ENET_TX_EN__GPIO1_IO28           0x1e8 0x4fc 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_TXD1__MLB_CLK               0x1ec 0x500 0x900 0x0 0x0
-#define MX6Q_PAD_ENET_TXD1__ENET_TX_DATA1         0x1ec 0x500 0x000 0x1 0x0
-#define MX6Q_PAD_ENET_TXD1__ESAI_TX2_RX3          0x1ec 0x500 0x87c 0x2 0x0
-#define MX6Q_PAD_ENET_TXD1__ENET_1588_EVENT0_IN   0x1ec 0x500 0x000 0x4 0x0
-#define MX6Q_PAD_ENET_TXD1__GPIO1_IO29            0x1ec 0x500 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_TXD0__ENET_TX_DATA0         0x1f0 0x504 0x000 0x1 0x0
-#define MX6Q_PAD_ENET_TXD0__ESAI_TX4_RX1          0x1f0 0x504 0x884 0x2 0x0
-#define MX6Q_PAD_ENET_TXD0__GPIO1_IO30            0x1f0 0x504 0x000 0x5 0x0
-#define MX6Q_PAD_ENET_MDC__MLB_DATA               0x1f4 0x508 0x904 0x0 0x0
-#define MX6Q_PAD_ENET_MDC__ENET_MDC               0x1f4 0x508 0x000 0x1 0x0
-#define MX6Q_PAD_ENET_MDC__ESAI_TX5_RX0           0x1f4 0x508 0x888 0x2 0x0
-#define MX6Q_PAD_ENET_MDC__ENET_1588_EVENT1_IN    0x1f4 0x508 0x000 0x4 0x0
-#define MX6Q_PAD_ENET_MDC__GPIO1_IO31             0x1f4 0x508 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_COL0__ECSPI1_SCLK            0x1f8 0x5c8 0x7f4 0x0 0x2
-#define MX6Q_PAD_KEY_COL0__ENET_RX_DATA3          0x1f8 0x5c8 0x854 0x1 0x1
-#define MX6Q_PAD_KEY_COL0__AUD5_TXC               0x1f8 0x5c8 0x7dc 0x2 0x1
-#define MX6Q_PAD_KEY_COL0__KEY_COL0               0x1f8 0x5c8 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_COL0__UART4_TX_DATA          0x1f8 0x5c8 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_COL0__UART4_RX_DATA          0x1f8 0x5c8 0x938 0x4 0x0
-#define MX6Q_PAD_KEY_COL0__GPIO4_IO06             0x1f8 0x5c8 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_COL0__DCIC1_OUT              0x1f8 0x5c8 0x000 0x6 0x0
-#define MX6Q_PAD_KEY_ROW0__ECSPI1_MOSI            0x1fc 0x5cc 0x7fc 0x0 0x2
-#define MX6Q_PAD_KEY_ROW0__ENET_TX_DATA3          0x1fc 0x5cc 0x000 0x1 0x0
-#define MX6Q_PAD_KEY_ROW0__AUD5_TXD               0x1fc 0x5cc 0x7d0 0x2 0x1
-#define MX6Q_PAD_KEY_ROW0__KEY_ROW0               0x1fc 0x5cc 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_ROW0__UART4_RX_DATA          0x1fc 0x5cc 0x938 0x4 0x1
-#define MX6Q_PAD_KEY_ROW0__UART4_TX_DATA          0x1fc 0x5cc 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_ROW0__GPIO4_IO07             0x1fc 0x5cc 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_ROW0__DCIC2_OUT              0x1fc 0x5cc 0x000 0x6 0x0
-#define MX6Q_PAD_KEY_COL1__ECSPI1_MISO            0x200 0x5d0 0x7f8 0x0 0x2
-#define MX6Q_PAD_KEY_COL1__ENET_MDIO              0x200 0x5d0 0x840 0x1 0x1
-#define MX6Q_PAD_KEY_COL1__AUD5_TXFS              0x200 0x5d0 0x7e0 0x2 0x1
-#define MX6Q_PAD_KEY_COL1__KEY_COL1               0x200 0x5d0 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_COL1__UART5_TX_DATA          0x200 0x5d0 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_COL1__UART5_RX_DATA          0x200 0x5d0 0x940 0x4 0x0
-#define MX6Q_PAD_KEY_COL1__GPIO4_IO08             0x200 0x5d0 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_COL1__SD1_VSELECT            0x200 0x5d0 0x000 0x6 0x0
-#define MX6Q_PAD_KEY_ROW1__ECSPI1_SS0             0x204 0x5d4 0x800 0x0 0x2
-#define MX6Q_PAD_KEY_ROW1__ENET_COL               0x204 0x5d4 0x000 0x1 0x0
-#define MX6Q_PAD_KEY_ROW1__AUD5_RXD               0x204 0x5d4 0x7cc 0x2 0x1
-#define MX6Q_PAD_KEY_ROW1__KEY_ROW1               0x204 0x5d4 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_ROW1__UART5_RX_DATA          0x204 0x5d4 0x940 0x4 0x1
-#define MX6Q_PAD_KEY_ROW1__UART5_TX_DATA          0x204 0x5d4 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_ROW1__GPIO4_IO09             0x204 0x5d4 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_ROW1__SD2_VSELECT            0x204 0x5d4 0x000 0x6 0x0
-#define MX6Q_PAD_KEY_COL2__ECSPI1_SS1             0x208 0x5d8 0x804 0x0 0x2
-#define MX6Q_PAD_KEY_COL2__ENET_RX_DATA2          0x208 0x5d8 0x850 0x1 0x1
-#define MX6Q_PAD_KEY_COL2__FLEXCAN1_TX            0x208 0x5d8 0x000 0x2 0x0
-#define MX6Q_PAD_KEY_COL2__KEY_COL2               0x208 0x5d8 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_COL2__ENET_MDC               0x208 0x5d8 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_COL2__GPIO4_IO10             0x208 0x5d8 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_COL2__USB_H1_PWR_CTL_WAKE    0x208 0x5d8 0x000 0x6 0x0
-#define MX6Q_PAD_KEY_ROW2__ECSPI1_SS2             0x20c 0x5dc 0x808 0x0 0x1
-#define MX6Q_PAD_KEY_ROW2__ENET_TX_DATA2          0x20c 0x5dc 0x000 0x1 0x0
-#define MX6Q_PAD_KEY_ROW2__FLEXCAN1_RX            0x20c 0x5dc 0x7e4 0x2 0x0
-#define MX6Q_PAD_KEY_ROW2__KEY_ROW2               0x20c 0x5dc 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_ROW2__SD2_VSELECT            0x20c 0x5dc 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_ROW2__GPIO4_IO11             0x20c 0x5dc 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_ROW2__HDMI_TX_CEC_LINE       0x20c 0x5dc 0x88c 0x6 0x1
-#define MX6Q_PAD_KEY_COL3__ECSPI1_SS3             0x210 0x5e0 0x80c 0x0 0x1
-#define MX6Q_PAD_KEY_COL3__ENET_CRS               0x210 0x5e0 0x000 0x1 0x0
-#define MX6Q_PAD_KEY_COL3__HDMI_TX_DDC_SCL        0x210 0x5e0 0x890 0x2 0x1
-#define MX6Q_PAD_KEY_COL3__KEY_COL3               0x210 0x5e0 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_COL3__I2C2_SCL               0x210 0x5e0 0x8a0 0x4 0x1
-#define MX6Q_PAD_KEY_COL3__GPIO4_IO12             0x210 0x5e0 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_COL3__SPDIF_IN               0x210 0x5e0 0x914 0x6 0x2
-#define MX6Q_PAD_KEY_ROW3__ASRC_EXT_CLK           0x214 0x5e4 0x7b0 0x1 0x0
-#define MX6Q_PAD_KEY_ROW3__HDMI_TX_DDC_SDA        0x214 0x5e4 0x894 0x2 0x1
-#define MX6Q_PAD_KEY_ROW3__KEY_ROW3               0x214 0x5e4 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_ROW3__I2C2_SDA               0x214 0x5e4 0x8a4 0x4 0x1
-#define MX6Q_PAD_KEY_ROW3__GPIO4_IO13             0x214 0x5e4 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_ROW3__SD1_VSELECT            0x214 0x5e4 0x000 0x6 0x0
-#define MX6Q_PAD_KEY_COL4__FLEXCAN2_TX            0x218 0x5e8 0x000 0x0 0x0
-#define MX6Q_PAD_KEY_COL4__IPU1_SISG4             0x218 0x5e8 0x000 0x1 0x0
-#define MX6Q_PAD_KEY_COL4__USB_OTG_OC             0x218 0x5e8 0x944 0x2 0x1
-#define MX6Q_PAD_KEY_COL4__KEY_COL4               0x218 0x5e8 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_COL4__UART5_RTS_B            0x218 0x5e8 0x93c 0x4 0x0
-#define MX6Q_PAD_KEY_COL4__UART5_CTS_B            0x218 0x5e8 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_COL4__GPIO4_IO14             0x218 0x5e8 0x000 0x5 0x0
-#define MX6Q_PAD_KEY_ROW4__FLEXCAN2_RX            0x21c 0x5ec 0x7e8 0x0 0x0
-#define MX6Q_PAD_KEY_ROW4__IPU1_SISG5             0x21c 0x5ec 0x000 0x1 0x0
-#define MX6Q_PAD_KEY_ROW4__USB_OTG_PWR            0x21c 0x5ec 0x000 0x2 0x0
-#define MX6Q_PAD_KEY_ROW4__KEY_ROW4               0x21c 0x5ec 0x000 0x3 0x0
-#define MX6Q_PAD_KEY_ROW4__UART5_CTS_B            0x21c 0x5ec 0x000 0x4 0x0
-#define MX6Q_PAD_KEY_ROW4__UART5_RTS_B            0x21c 0x5ec 0x93c 0x4 0x1
-#define MX6Q_PAD_KEY_ROW4__GPIO4_IO15             0x21c 0x5ec 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_0__CCM_CLKO1                0x220 0x5f0 0x000 0x0 0x0
-#define MX6Q_PAD_GPIO_0__KEY_COL5                 0x220 0x5f0 0x8e8 0x2 0x0
-#define MX6Q_PAD_GPIO_0__ASRC_EXT_CLK             0x220 0x5f0 0x7b0 0x3 0x1
-#define MX6Q_PAD_GPIO_0__EPIT1_OUT                0x220 0x5f0 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_0__GPIO1_IO00               0x220 0x5f0 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_0__USB_H1_PWR               0x220 0x5f0 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_0__SNVS_VIO_5               0x220 0x5f0 0x000 0x7 0x0
-#define MX6Q_PAD_GPIO_1__ESAI_RX_CLK              0x224 0x5f4 0x86c 0x0 0x1
-#define MX6Q_PAD_GPIO_1__WDOG2_B                  0x224 0x5f4 0x000 0x1 0x0
-#define MX6Q_PAD_GPIO_1__KEY_ROW5                 0x224 0x5f4 0x8f4 0x2 0x0
-#define MX6Q_PAD_GPIO_1__USB_OTG_ID               0x224 0x5f4 0x000 0x3 0x0
-#define MX6Q_PAD_GPIO_1__PWM2_OUT                 0x224 0x5f4 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_1__GPIO1_IO01               0x224 0x5f4 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_1__SD1_CD_B                 0x224 0x5f4 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_9__ESAI_RX_FS               0x228 0x5f8 0x85c 0x0 0x1
-#define MX6Q_PAD_GPIO_9__WDOG1_B                  0x228 0x5f8 0x000 0x1 0x0
-#define MX6Q_PAD_GPIO_9__KEY_COL6                 0x228 0x5f8 0x8ec 0x2 0x0
-#define MX6Q_PAD_GPIO_9__CCM_REF_EN_B             0x228 0x5f8 0x000 0x3 0x0
-#define MX6Q_PAD_GPIO_9__PWM1_OUT                 0x228 0x5f8 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_9__GPIO1_IO09               0x228 0x5f8 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_9__SD1_WP                   0x228 0x5f8 0x94c 0x6 0x1
-#define MX6Q_PAD_GPIO_3__ESAI_RX_HF_CLK           0x22c 0x5fc 0x864 0x0 0x1
-#define MX6Q_PAD_GPIO_3__I2C3_SCL                 0x22c 0x5fc 0x8a8 0x2 0x1
-#define MX6Q_PAD_GPIO_3__XTALOSC_REF_CLK_24M      0x22c 0x5fc 0x000 0x3 0x0
-#define MX6Q_PAD_GPIO_3__CCM_CLKO2                0x22c 0x5fc 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_3__GPIO1_IO03               0x22c 0x5fc 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_3__USB_H1_OC                0x22c 0x5fc 0x948 0x6 0x1
-#define MX6Q_PAD_GPIO_3__MLB_CLK                  0x22c 0x5fc 0x900 0x7 0x1
-#define MX6Q_PAD_GPIO_6__ESAI_TX_CLK              0x230 0x600 0x870 0x0 0x1
-#define MX6Q_PAD_GPIO_6__I2C3_SDA                 0x230 0x600 0x8ac 0x2 0x1
-#define MX6Q_PAD_GPIO_6__GPIO1_IO06               0x230 0x600 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_6__SD2_LCTL                 0x230 0x600 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_6__MLB_SIG                  0x230 0x600 0x908 0x7 0x1
-#define MX6Q_PAD_GPIO_2__ESAI_TX_FS               0x234 0x604 0x860 0x0 0x1
-#define MX6Q_PAD_GPIO_2__KEY_ROW6                 0x234 0x604 0x8f8 0x2 0x1
-#define MX6Q_PAD_GPIO_2__GPIO1_IO02               0x234 0x604 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_2__SD2_WP                   0x234 0x604 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_2__MLB_DATA                 0x234 0x604 0x904 0x7 0x1
-#define MX6Q_PAD_GPIO_4__ESAI_TX_HF_CLK           0x238 0x608 0x868 0x0 0x1
-#define MX6Q_PAD_GPIO_4__KEY_COL7                 0x238 0x608 0x8f0 0x2 0x1
-#define MX6Q_PAD_GPIO_4__GPIO1_IO04               0x238 0x608 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_4__SD2_CD_B                 0x238 0x608 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_5__ESAI_TX2_RX3             0x23c 0x60c 0x87c 0x0 0x1
-#define MX6Q_PAD_GPIO_5__KEY_ROW7                 0x23c 0x60c 0x8fc 0x2 0x1
-#define MX6Q_PAD_GPIO_5__CCM_CLKO1                0x23c 0x60c 0x000 0x3 0x0
-#define MX6Q_PAD_GPIO_5__GPIO1_IO05               0x23c 0x60c 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_5__I2C3_SCL                 0x23c 0x60c 0x8a8 0x6 0x2
-#define MX6Q_PAD_GPIO_5__ARM_EVENTI               0x23c 0x60c 0x000 0x7 0x0
-#define MX6Q_PAD_GPIO_7__ESAI_TX4_RX1             0x240 0x610 0x884 0x0 0x1
-#define MX6Q_PAD_GPIO_7__ECSPI5_RDY               0x240 0x610 0x000 0x1 0x0
-#define MX6Q_PAD_GPIO_7__EPIT1_OUT                0x240 0x610 0x000 0x2 0x0
-#define MX6Q_PAD_GPIO_7__FLEXCAN1_TX              0x240 0x610 0x000 0x3 0x0
-#define MX6Q_PAD_GPIO_7__UART2_TX_DATA            0x240 0x610 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_7__UART2_RX_DATA            0x240 0x610 0x928 0x4 0x2
-#define MX6Q_PAD_GPIO_7__GPIO1_IO07               0x240 0x610 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_7__SPDIF_LOCK               0x240 0x610 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_7__USB_OTG_HOST_MODE        0x240 0x610 0x000 0x7 0x0
-#define MX6Q_PAD_GPIO_8__ESAI_TX5_RX0             0x244 0x614 0x888 0x0 0x1
-#define MX6Q_PAD_GPIO_8__XTALOSC_REF_CLK_32K      0x244 0x614 0x000 0x1 0x0
-#define MX6Q_PAD_GPIO_8__EPIT2_OUT                0x244 0x614 0x000 0x2 0x0
-#define MX6Q_PAD_GPIO_8__FLEXCAN1_RX              0x244 0x614 0x7e4 0x3 0x1
-#define MX6Q_PAD_GPIO_8__UART2_RX_DATA            0x244 0x614 0x928 0x4 0x3
-#define MX6Q_PAD_GPIO_8__UART2_TX_DATA            0x244 0x614 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_8__GPIO1_IO08               0x244 0x614 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_8__SPDIF_SR_CLK             0x244 0x614 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_8__USB_OTG_PWR_CTL_WAKE     0x244 0x614 0x000 0x7 0x0
-#define MX6Q_PAD_GPIO_16__ESAI_TX3_RX2            0x248 0x618 0x880 0x0 0x1
-#define MX6Q_PAD_GPIO_16__ENET_1588_EVENT2_IN     0x248 0x618 0x000 0x1 0x0
-#define MX6Q_PAD_GPIO_16__ENET_REF_CLK            0x248 0x618 0x83c 0x2 0x1
-#define MX6Q_PAD_GPIO_16__SD1_LCTL                0x248 0x618 0x000 0x3 0x0
-#define MX6Q_PAD_GPIO_16__SPDIF_IN                0x248 0x618 0x914 0x4 0x3
-#define MX6Q_PAD_GPIO_16__GPIO7_IO11              0x248 0x618 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_16__I2C3_SDA                0x248 0x618 0x8ac 0x6 0x2
-#define MX6Q_PAD_GPIO_16__JTAG_DE_B               0x248 0x618 0x000 0x7 0x0
-#define MX6Q_PAD_GPIO_17__ESAI_TX0                0x24c 0x61c 0x874 0x0 0x0
-#define MX6Q_PAD_GPIO_17__ENET_1588_EVENT3_IN     0x24c 0x61c 0x000 0x1 0x0
-#define MX6Q_PAD_GPIO_17__CCM_PMIC_READY          0x24c 0x61c 0x7f0 0x2 0x1
-#define MX6Q_PAD_GPIO_17__SDMA_EXT_EVENT0         0x24c 0x61c 0x90c 0x3 0x1
-#define MX6Q_PAD_GPIO_17__SPDIF_OUT               0x24c 0x61c 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_17__GPIO7_IO12              0x24c 0x61c 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_18__ESAI_TX1                0x250 0x620 0x878 0x0 0x0
-#define MX6Q_PAD_GPIO_18__ENET_RX_CLK             0x250 0x620 0x844 0x1 0x1
-#define MX6Q_PAD_GPIO_18__SD3_VSELECT             0x250 0x620 0x000 0x2 0x0
-#define MX6Q_PAD_GPIO_18__SDMA_EXT_EVENT1         0x250 0x620 0x910 0x3 0x1
-#define MX6Q_PAD_GPIO_18__ASRC_EXT_CLK            0x250 0x620 0x7b0 0x4 0x2
-#define MX6Q_PAD_GPIO_18__GPIO7_IO13              0x250 0x620 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_18__SNVS_VIO_5_CTL          0x250 0x620 0x000 0x6 0x0
-#define MX6Q_PAD_GPIO_19__KEY_COL5                0x254 0x624 0x8e8 0x0 0x1
-#define MX6Q_PAD_GPIO_19__ENET_1588_EVENT0_OUT    0x254 0x624 0x000 0x1 0x0
-#define MX6Q_PAD_GPIO_19__SPDIF_OUT               0x254 0x624 0x000 0x2 0x0
-#define MX6Q_PAD_GPIO_19__CCM_CLKO1               0x254 0x624 0x000 0x3 0x0
-#define MX6Q_PAD_GPIO_19__ECSPI1_RDY              0x254 0x624 0x000 0x4 0x0
-#define MX6Q_PAD_GPIO_19__GPIO4_IO05              0x254 0x624 0x000 0x5 0x0
-#define MX6Q_PAD_GPIO_19__ENET_TX_ER              0x254 0x624 0x000 0x6 0x0
-#define MX6Q_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK    0x258 0x628 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_PIXCLK__GPIO5_IO18          0x258 0x628 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_PIXCLK__ARM_EVENTO          0x258 0x628 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC       0x25c 0x62c 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_MCLK__CCM_CLKO1             0x25c 0x62c 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_MCLK__GPIO5_IO19            0x25c 0x62c 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_MCLK__ARM_TRACE_CTL         0x25c 0x62c 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN  0x260 0x630 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DATA_EN__EIM_DATA00         0x260 0x630 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DATA_EN__GPIO5_IO20         0x260 0x630 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DATA_EN__ARM_TRACE_CLK      0x260 0x630 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC      0x264 0x634 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_VSYNC__EIM_DATA01           0x264 0x634 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_VSYNC__GPIO5_IO21           0x264 0x634 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_VSYNC__ARM_TRACE00          0x264 0x634 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT4__IPU1_CSI0_DATA04      0x268 0x638 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT4__EIM_DATA02            0x268 0x638 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT4__ECSPI1_SCLK           0x268 0x638 0x7f4 0x2 0x3
-#define MX6Q_PAD_CSI0_DAT4__KEY_COL5              0x268 0x638 0x8e8 0x3 0x2
-#define MX6Q_PAD_CSI0_DAT4__AUD3_TXC              0x268 0x638 0x000 0x4 0x0
-#define MX6Q_PAD_CSI0_DAT4__GPIO5_IO22            0x268 0x638 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT4__ARM_TRACE01           0x268 0x638 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT5__IPU1_CSI0_DATA05      0x26c 0x63c 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT5__EIM_DATA03            0x26c 0x63c 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT5__ECSPI1_MOSI           0x26c 0x63c 0x7fc 0x2 0x3
-#define MX6Q_PAD_CSI0_DAT5__KEY_ROW5              0x26c 0x63c 0x8f4 0x3 0x1
-#define MX6Q_PAD_CSI0_DAT5__AUD3_TXD              0x26c 0x63c 0x000 0x4 0x0
-#define MX6Q_PAD_CSI0_DAT5__GPIO5_IO23            0x26c 0x63c 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT5__ARM_TRACE02           0x26c 0x63c 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT6__IPU1_CSI0_DATA06      0x270 0x640 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT6__EIM_DATA04            0x270 0x640 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT6__ECSPI1_MISO           0x270 0x640 0x7f8 0x2 0x3
-#define MX6Q_PAD_CSI0_DAT6__KEY_COL6              0x270 0x640 0x8ec 0x3 0x1
-#define MX6Q_PAD_CSI0_DAT6__AUD3_TXFS             0x270 0x640 0x000 0x4 0x0
-#define MX6Q_PAD_CSI0_DAT6__GPIO5_IO24            0x270 0x640 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT6__ARM_TRACE03           0x270 0x640 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT7__IPU1_CSI0_DATA07      0x274 0x644 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT7__EIM_DATA05            0x274 0x644 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT7__ECSPI1_SS0            0x274 0x644 0x800 0x2 0x3
-#define MX6Q_PAD_CSI0_DAT7__KEY_ROW6              0x274 0x644 0x8f8 0x3 0x2
-#define MX6Q_PAD_CSI0_DAT7__AUD3_RXD              0x274 0x644 0x000 0x4 0x0
-#define MX6Q_PAD_CSI0_DAT7__GPIO5_IO25            0x274 0x644 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT7__ARM_TRACE04           0x274 0x644 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT8__IPU1_CSI0_DATA08      0x278 0x648 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT8__EIM_DATA06            0x278 0x648 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT8__ECSPI2_SCLK           0x278 0x648 0x810 0x2 0x2
-#define MX6Q_PAD_CSI0_DAT8__KEY_COL7              0x278 0x648 0x8f0 0x3 0x2
-#define MX6Q_PAD_CSI0_DAT8__I2C1_SDA              0x278 0x648 0x89c 0x4 0x1
-#define MX6Q_PAD_CSI0_DAT8__GPIO5_IO26            0x278 0x648 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT8__ARM_TRACE05           0x278 0x648 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT9__IPU1_CSI0_DATA09      0x27c 0x64c 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT9__EIM_DATA07            0x27c 0x64c 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT9__ECSPI2_MOSI           0x27c 0x64c 0x818 0x2 0x2
-#define MX6Q_PAD_CSI0_DAT9__KEY_ROW7              0x27c 0x64c 0x8fc 0x3 0x2
-#define MX6Q_PAD_CSI0_DAT9__I2C1_SCL              0x27c 0x64c 0x898 0x4 0x1
-#define MX6Q_PAD_CSI0_DAT9__GPIO5_IO27            0x27c 0x64c 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT9__ARM_TRACE06           0x27c 0x64c 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT10__IPU1_CSI0_DATA10     0x280 0x650 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT10__AUD3_RXC             0x280 0x650 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT10__ECSPI2_MISO          0x280 0x650 0x814 0x2 0x2
-#define MX6Q_PAD_CSI0_DAT10__UART1_TX_DATA        0x280 0x650 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT10__UART1_RX_DATA        0x280 0x650 0x920 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT10__GPIO5_IO28           0x280 0x650 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT10__ARM_TRACE07          0x280 0x650 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT11__IPU1_CSI0_DATA11     0x284 0x654 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT11__AUD3_RXFS            0x284 0x654 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT11__ECSPI2_SS0           0x284 0x654 0x81c 0x2 0x2
-#define MX6Q_PAD_CSI0_DAT11__UART1_RX_DATA        0x284 0x654 0x920 0x3 0x1
-#define MX6Q_PAD_CSI0_DAT11__UART1_TX_DATA        0x284 0x654 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT11__GPIO5_IO29           0x284 0x654 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT11__ARM_TRACE08          0x284 0x654 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT12__IPU1_CSI0_DATA12     0x288 0x658 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT12__EIM_DATA08           0x288 0x658 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT12__UART4_TX_DATA        0x288 0x658 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT12__UART4_RX_DATA        0x288 0x658 0x938 0x3 0x2
-#define MX6Q_PAD_CSI0_DAT12__GPIO5_IO30           0x288 0x658 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT12__ARM_TRACE09          0x288 0x658 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT13__IPU1_CSI0_DATA13     0x28c 0x65c 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT13__EIM_DATA09           0x28c 0x65c 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT13__UART4_RX_DATA        0x28c 0x65c 0x938 0x3 0x3
-#define MX6Q_PAD_CSI0_DAT13__UART4_TX_DATA        0x28c 0x65c 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT13__GPIO5_IO31           0x28c 0x65c 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT13__ARM_TRACE10          0x28c 0x65c 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT14__IPU1_CSI0_DATA14     0x290 0x660 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT14__EIM_DATA10           0x290 0x660 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT14__UART5_TX_DATA        0x290 0x660 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT14__UART5_RX_DATA        0x290 0x660 0x940 0x3 0x2
-#define MX6Q_PAD_CSI0_DAT14__GPIO6_IO00           0x290 0x660 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT14__ARM_TRACE11          0x290 0x660 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT15__IPU1_CSI0_DATA15     0x294 0x664 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT15__EIM_DATA11           0x294 0x664 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT15__UART5_RX_DATA        0x294 0x664 0x940 0x3 0x3
-#define MX6Q_PAD_CSI0_DAT15__UART5_TX_DATA        0x294 0x664 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT15__GPIO6_IO01           0x294 0x664 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT15__ARM_TRACE12          0x294 0x664 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT16__IPU1_CSI0_DATA16     0x298 0x668 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT16__EIM_DATA12           0x298 0x668 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT16__UART4_RTS_B          0x298 0x668 0x934 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT16__UART4_CTS_B          0x298 0x668 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT16__GPIO6_IO02           0x298 0x668 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT16__ARM_TRACE13          0x298 0x668 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT17__IPU1_CSI0_DATA17     0x29c 0x66c 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT17__EIM_DATA13           0x29c 0x66c 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT17__UART4_CTS_B          0x29c 0x66c 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT17__UART4_RTS_B          0x29c 0x66c 0x934 0x3 0x1
-#define MX6Q_PAD_CSI0_DAT17__GPIO6_IO03           0x29c 0x66c 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT17__ARM_TRACE14          0x29c 0x66c 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT18__IPU1_CSI0_DATA18     0x2a0 0x670 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT18__EIM_DATA14           0x2a0 0x670 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT18__UART5_RTS_B          0x2a0 0x670 0x93c 0x3 0x2
-#define MX6Q_PAD_CSI0_DAT18__UART5_CTS_B          0x2a0 0x670 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT18__GPIO6_IO04           0x2a0 0x670 0x000 0x5 0x0
-#define MX6Q_PAD_CSI0_DAT18__ARM_TRACE15          0x2a0 0x670 0x000 0x7 0x0
-#define MX6Q_PAD_CSI0_DAT19__IPU1_CSI0_DATA19     0x2a4 0x674 0x000 0x0 0x0
-#define MX6Q_PAD_CSI0_DAT19__EIM_DATA15           0x2a4 0x674 0x000 0x1 0x0
-#define MX6Q_PAD_CSI0_DAT19__UART5_CTS_B          0x2a4 0x674 0x000 0x3 0x0
-#define MX6Q_PAD_CSI0_DAT19__UART5_RTS_B          0x2a4 0x674 0x93c 0x3 0x3
-#define MX6Q_PAD_CSI0_DAT19__GPIO6_IO05           0x2a4 0x674 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT7__SD3_DATA7              0x2a8 0x690 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT7__UART1_TX_DATA          0x2a8 0x690 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_DAT7__UART1_RX_DATA          0x2a8 0x690 0x920 0x1 0x2
-#define MX6Q_PAD_SD3_DAT7__GPIO6_IO17             0x2a8 0x690 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT6__SD3_DATA6              0x2ac 0x694 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT6__UART1_RX_DATA          0x2ac 0x694 0x920 0x1 0x3
-#define MX6Q_PAD_SD3_DAT6__UART1_TX_DATA          0x2ac 0x694 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_DAT6__GPIO6_IO18             0x2ac 0x694 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT5__SD3_DATA5              0x2b0 0x698 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT5__UART2_TX_DATA          0x2b0 0x698 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_DAT5__UART2_RX_DATA          0x2b0 0x698 0x928 0x1 0x4
-#define MX6Q_PAD_SD3_DAT5__GPIO7_IO00             0x2b0 0x698 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT4__SD3_DATA4              0x2b4 0x69c 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT4__UART2_RX_DATA          0x2b4 0x69c 0x928 0x1 0x5
-#define MX6Q_PAD_SD3_DAT4__UART2_TX_DATA          0x2b4 0x69c 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_DAT4__GPIO7_IO01             0x2b4 0x69c 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_CMD__SD3_CMD                 0x2b8 0x6a0 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_CMD__UART2_CTS_B             0x2b8 0x6a0 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_CMD__UART2_RTS_B             0x2b8 0x6a0 0x924 0x1 0x2
-#define MX6Q_PAD_SD3_CMD__FLEXCAN1_TX             0x2b8 0x6a0 0x000 0x2 0x0
-#define MX6Q_PAD_SD3_CMD__GPIO7_IO02              0x2b8 0x6a0 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_CLK__SD3_CLK                 0x2bc 0x6a4 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_CLK__UART2_RTS_B             0x2bc 0x6a4 0x924 0x1 0x3
-#define MX6Q_PAD_SD3_CLK__UART2_CTS_B             0x2bc 0x6a4 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_CLK__FLEXCAN1_RX             0x2bc 0x6a4 0x7e4 0x2 0x2
-#define MX6Q_PAD_SD3_CLK__GPIO7_IO03              0x2bc 0x6a4 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT0__SD3_DATA0              0x2c0 0x6a8 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT0__UART1_CTS_B            0x2c0 0x6a8 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_DAT0__UART1_RTS_B            0x2c0 0x6a8 0x91c 0x1 0x2
-#define MX6Q_PAD_SD3_DAT0__FLEXCAN2_TX            0x2c0 0x6a8 0x000 0x2 0x0
-#define MX6Q_PAD_SD3_DAT0__GPIO7_IO04             0x2c0 0x6a8 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT1__SD3_DATA1              0x2c4 0x6ac 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT1__UART1_RTS_B            0x2c4 0x6ac 0x91c 0x1 0x3
-#define MX6Q_PAD_SD3_DAT1__UART1_CTS_B            0x2c4 0x6ac 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_DAT1__FLEXCAN2_RX            0x2c4 0x6ac 0x7e8 0x2 0x1
-#define MX6Q_PAD_SD3_DAT1__GPIO7_IO05             0x2c4 0x6ac 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT2__SD3_DATA2              0x2c8 0x6b0 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT2__GPIO7_IO06             0x2c8 0x6b0 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_DAT3__SD3_DATA3              0x2cc 0x6b4 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_DAT3__UART3_CTS_B            0x2cc 0x6b4 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_DAT3__UART3_RTS_B            0x2cc 0x6b4 0x92c 0x1 0x4
-#define MX6Q_PAD_SD3_DAT3__GPIO7_IO07             0x2cc 0x6b4 0x000 0x5 0x0
-#define MX6Q_PAD_SD3_RST__SD3_RESET               0x2d0 0x6b8 0x000 0x0 0x0
-#define MX6Q_PAD_SD3_RST__UART3_RTS_B             0x2d0 0x6b8 0x92c 0x1 0x5
-#define MX6Q_PAD_SD3_RST__UART3_CTS_B             0x2d0 0x6b8 0x000 0x1 0x0
-#define MX6Q_PAD_SD3_RST__GPIO7_IO08              0x2d0 0x6b8 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_CLE__NAND_CLE              0x2d4 0x6bc 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_CLE__IPU2_SISG4            0x2d4 0x6bc 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_CLE__GPIO6_IO07            0x2d4 0x6bc 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_ALE__NAND_ALE              0x2d8 0x6c0 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_ALE__SD4_RESET             0x2d8 0x6c0 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_ALE__GPIO6_IO08            0x2d8 0x6c0 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_WP_B__NAND_WP_B            0x2dc 0x6c4 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_WP_B__IPU2_SISG5           0x2dc 0x6c4 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_WP_B__GPIO6_IO09           0x2dc 0x6c4 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_RB0__NAND_READY_B          0x2e0 0x6c8 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_RB0__IPU2_DI0_PIN01        0x2e0 0x6c8 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_RB0__GPIO6_IO10            0x2e0 0x6c8 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_CS0__NAND_CE0_B            0x2e4 0x6cc 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_CS0__GPIO6_IO11            0x2e4 0x6cc 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_CS1__NAND_CE1_B            0x2e8 0x6d0 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_CS1__SD4_VSELECT           0x2e8 0x6d0 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_CS1__SD3_VSELECT           0x2e8 0x6d0 0x000 0x2 0x0
-#define MX6Q_PAD_NANDF_CS1__GPIO6_IO14            0x2e8 0x6d0 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_CS2__NAND_CE2_B            0x2ec 0x6d4 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_CS2__IPU1_SISG0            0x2ec 0x6d4 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_CS2__ESAI_TX0              0x2ec 0x6d4 0x874 0x2 0x1
-#define MX6Q_PAD_NANDF_CS2__EIM_CRE               0x2ec 0x6d4 0x000 0x3 0x0
-#define MX6Q_PAD_NANDF_CS2__CCM_CLKO2             0x2ec 0x6d4 0x000 0x4 0x0
-#define MX6Q_PAD_NANDF_CS2__GPIO6_IO15            0x2ec 0x6d4 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_CS2__IPU2_SISG0            0x2ec 0x6d4 0x000 0x6 0x0
-#define MX6Q_PAD_NANDF_CS3__NAND_CE3_B            0x2f0 0x6d8 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_CS3__IPU1_SISG1            0x2f0 0x6d8 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_CS3__ESAI_TX1              0x2f0 0x6d8 0x878 0x2 0x1
-#define MX6Q_PAD_NANDF_CS3__EIM_ADDR26            0x2f0 0x6d8 0x000 0x3 0x0
-#define MX6Q_PAD_NANDF_CS3__GPIO6_IO16            0x2f0 0x6d8 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_CS3__IPU2_SISG1            0x2f0 0x6d8 0x000 0x6 0x0
-#define MX6Q_PAD_SD4_CMD__SD4_CMD                 0x2f4 0x6dc 0x000 0x0 0x0
-#define MX6Q_PAD_SD4_CMD__NAND_RE_B               0x2f4 0x6dc 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_CMD__UART3_TX_DATA           0x2f4 0x6dc 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_CMD__UART3_RX_DATA           0x2f4 0x6dc 0x930 0x2 0x2
-#define MX6Q_PAD_SD4_CMD__GPIO7_IO09              0x2f4 0x6dc 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_CLK__SD4_CLK                 0x2f8 0x6e0 0x000 0x0 0x0
-#define MX6Q_PAD_SD4_CLK__NAND_WE_B               0x2f8 0x6e0 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_CLK__UART3_RX_DATA           0x2f8 0x6e0 0x930 0x2 0x3
-#define MX6Q_PAD_SD4_CLK__UART3_TX_DATA           0x2f8 0x6e0 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_CLK__GPIO7_IO10              0x2f8 0x6e0 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D0__NAND_DATA00            0x2fc 0x6e4 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D0__SD1_DATA4              0x2fc 0x6e4 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D0__GPIO2_IO00             0x2fc 0x6e4 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D1__NAND_DATA01            0x300 0x6e8 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D1__SD1_DATA5              0x300 0x6e8 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D1__GPIO2_IO01             0x300 0x6e8 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D2__NAND_DATA02            0x304 0x6ec 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D2__SD1_DATA6              0x304 0x6ec 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D2__GPIO2_IO02             0x304 0x6ec 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D3__NAND_DATA03            0x308 0x6f0 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D3__SD1_DATA7              0x308 0x6f0 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D3__GPIO2_IO03             0x308 0x6f0 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D4__NAND_DATA04            0x30c 0x6f4 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D4__SD2_DATA4              0x30c 0x6f4 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D4__GPIO2_IO04             0x30c 0x6f4 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D5__NAND_DATA05            0x310 0x6f8 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D5__SD2_DATA5              0x310 0x6f8 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D5__GPIO2_IO05             0x310 0x6f8 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D6__NAND_DATA06            0x314 0x6fc 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D6__SD2_DATA6              0x314 0x6fc 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D6__GPIO2_IO06             0x314 0x6fc 0x000 0x5 0x0
-#define MX6Q_PAD_NANDF_D7__NAND_DATA07            0x318 0x700 0x000 0x0 0x0
-#define MX6Q_PAD_NANDF_D7__SD2_DATA7              0x318 0x700 0x000 0x1 0x0
-#define MX6Q_PAD_NANDF_D7__GPIO2_IO07             0x318 0x700 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT0__SD4_DATA0              0x31c 0x704 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT0__NAND_DQS               0x31c 0x704 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_DAT0__GPIO2_IO08             0x31c 0x704 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT1__SD4_DATA1              0x320 0x708 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT1__PWM3_OUT               0x320 0x708 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_DAT1__GPIO2_IO09             0x320 0x708 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT2__SD4_DATA2              0x324 0x70c 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT2__PWM4_OUT               0x324 0x70c 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_DAT2__GPIO2_IO10             0x324 0x70c 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT3__SD4_DATA3              0x328 0x710 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT3__GPIO2_IO11             0x328 0x710 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT4__SD4_DATA4              0x32c 0x714 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT4__UART2_RX_DATA          0x32c 0x714 0x928 0x2 0x6
-#define MX6Q_PAD_SD4_DAT4__UART2_TX_DATA          0x32c 0x714 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_DAT4__GPIO2_IO12             0x32c 0x714 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT5__SD4_DATA5              0x330 0x718 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT5__UART2_RTS_B            0x330 0x718 0x924 0x2 0x4
-#define MX6Q_PAD_SD4_DAT5__UART2_CTS_B            0x330 0x718 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_DAT5__GPIO2_IO13             0x330 0x718 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT6__SD4_DATA6              0x334 0x71c 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT6__UART2_CTS_B            0x334 0x71c 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_DAT6__UART2_RTS_B            0x334 0x71c 0x924 0x2 0x5
-#define MX6Q_PAD_SD4_DAT6__GPIO2_IO14             0x334 0x71c 0x000 0x5 0x0
-#define MX6Q_PAD_SD4_DAT7__SD4_DATA7              0x338 0x720 0x000 0x1 0x0
-#define MX6Q_PAD_SD4_DAT7__UART2_TX_DATA          0x338 0x720 0x000 0x2 0x0
-#define MX6Q_PAD_SD4_DAT7__UART2_RX_DATA          0x338 0x720 0x928 0x2 0x7
-#define MX6Q_PAD_SD4_DAT7__GPIO2_IO15             0x338 0x720 0x000 0x5 0x0
-#define MX6Q_PAD_SD1_DAT1__SD1_DATA1              0x33c 0x724 0x000 0x0 0x0
-#define MX6Q_PAD_SD1_DAT1__ECSPI5_SS0             0x33c 0x724 0x834 0x1 0x1
-#define MX6Q_PAD_SD1_DAT1__PWM3_OUT               0x33c 0x724 0x000 0x2 0x0
-#define MX6Q_PAD_SD1_DAT1__GPT_CAPTURE2           0x33c 0x724 0x000 0x3 0x0
-#define MX6Q_PAD_SD1_DAT1__GPIO1_IO17             0x33c 0x724 0x000 0x5 0x0
-#define MX6Q_PAD_SD1_DAT0__SD1_DATA0              0x340 0x728 0x000 0x0 0x0
-#define MX6Q_PAD_SD1_DAT0__ECSPI5_MISO            0x340 0x728 0x82c 0x1 0x1
-#define MX6Q_PAD_SD1_DAT0__GPT_CAPTURE1           0x340 0x728 0x000 0x3 0x0
-#define MX6Q_PAD_SD1_DAT0__GPIO1_IO16             0x340 0x728 0x000 0x5 0x0
-#define MX6Q_PAD_SD1_DAT3__SD1_DATA3              0x344 0x72c 0x000 0x0 0x0
-#define MX6Q_PAD_SD1_DAT3__ECSPI5_SS2             0x344 0x72c 0x000 0x1 0x0
-#define MX6Q_PAD_SD1_DAT3__GPT_COMPARE3           0x344 0x72c 0x000 0x2 0x0
-#define MX6Q_PAD_SD1_DAT3__PWM1_OUT               0x344 0x72c 0x000 0x3 0x0
-#define MX6Q_PAD_SD1_DAT3__WDOG2_B                0x344 0x72c 0x000 0x4 0x0
-#define MX6Q_PAD_SD1_DAT3__GPIO1_IO21             0x344 0x72c 0x000 0x5 0x0
-#define MX6Q_PAD_SD1_DAT3__WDOG2_RESET_B_DEB      0x344 0x72c 0x000 0x6 0x0
-#define MX6Q_PAD_SD1_CMD__SD1_CMD                 0x348 0x730 0x000 0x0 0x0
-#define MX6Q_PAD_SD1_CMD__ECSPI5_MOSI             0x348 0x730 0x830 0x1 0x0
-#define MX6Q_PAD_SD1_CMD__PWM4_OUT                0x348 0x730 0x000 0x2 0x0
-#define MX6Q_PAD_SD1_CMD__GPT_COMPARE1            0x348 0x730 0x000 0x3 0x0
-#define MX6Q_PAD_SD1_CMD__GPIO1_IO18              0x348 0x730 0x000 0x5 0x0
-#define MX6Q_PAD_SD1_DAT2__SD1_DATA2              0x34c 0x734 0x000 0x0 0x0
-#define MX6Q_PAD_SD1_DAT2__ECSPI5_SS1             0x34c 0x734 0x838 0x1 0x1
-#define MX6Q_PAD_SD1_DAT2__GPT_COMPARE2           0x34c 0x734 0x000 0x2 0x0
-#define MX6Q_PAD_SD1_DAT2__PWM2_OUT               0x34c 0x734 0x000 0x3 0x0
-#define MX6Q_PAD_SD1_DAT2__WDOG1_B                0x34c 0x734 0x000 0x4 0x0
-#define MX6Q_PAD_SD1_DAT2__GPIO1_IO19             0x34c 0x734 0x000 0x5 0x0
-#define MX6Q_PAD_SD1_DAT2__WDOG1_RESET_B_DEB      0x34c 0x734 0x000 0x6 0x0
-#define MX6Q_PAD_SD1_CLK__SD1_CLK                 0x350 0x738 0x000 0x0 0x0
-#define MX6Q_PAD_SD1_CLK__ECSPI5_SCLK             0x350 0x738 0x828 0x1 0x0
-#define MX6Q_PAD_SD1_CLK__GPT_CLKIN               0x350 0x738 0x000 0x3 0x0
-#define MX6Q_PAD_SD1_CLK__GPIO1_IO20              0x350 0x738 0x000 0x5 0x0
-#define MX6Q_PAD_SD2_CLK__SD2_CLK                 0x354 0x73c 0x000 0x0 0x0
-#define MX6Q_PAD_SD2_CLK__ECSPI5_SCLK             0x354 0x73c 0x828 0x1 0x1
-#define MX6Q_PAD_SD2_CLK__KEY_COL5                0x354 0x73c 0x8e8 0x2 0x3
-#define MX6Q_PAD_SD2_CLK__AUD4_RXFS               0x354 0x73c 0x7c0 0x3 0x1
-#define MX6Q_PAD_SD2_CLK__GPIO1_IO10              0x354 0x73c 0x000 0x5 0x0
-#define MX6Q_PAD_SD2_CMD__SD2_CMD                 0x358 0x740 0x000 0x0 0x0
-#define MX6Q_PAD_SD2_CMD__ECSPI5_MOSI             0x358 0x740 0x830 0x1 0x1
-#define MX6Q_PAD_SD2_CMD__KEY_ROW5                0x358 0x740 0x8f4 0x2 0x2
-#define MX6Q_PAD_SD2_CMD__AUD4_RXC                0x358 0x740 0x7bc 0x3 0x1
-#define MX6Q_PAD_SD2_CMD__GPIO1_IO11              0x358 0x740 0x000 0x5 0x0
-#define MX6Q_PAD_SD2_DAT3__SD2_DATA3              0x35c 0x744 0x000 0x0 0x0
-#define MX6Q_PAD_SD2_DAT3__ECSPI5_SS3             0x35c 0x744 0x000 0x1 0x0
-#define MX6Q_PAD_SD2_DAT3__KEY_COL6               0x35c 0x744 0x8ec 0x2 0x2
-#define MX6Q_PAD_SD2_DAT3__AUD4_TXC               0x35c 0x744 0x7c4 0x3 0x1
-#define MX6Q_PAD_SD2_DAT3__GPIO1_IO12             0x35c 0x744 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT1__SD2_DATA1              0x04c 0x360 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT1__ECSPI5_SS0             0x04c 0x360 0x834 0x1 0x0
+#define MX6QDL_PAD_SD2_DAT1__EIM_CS2_B              0x04c 0x360 0x000 0x2 0x0
+#define MX6QDL_PAD_SD2_DAT1__AUD4_TXFS              0x04c 0x360 0x7c8 0x3 0x0
+#define MX6QDL_PAD_SD2_DAT1__KEY_COL7               0x04c 0x360 0x8f0 0x4 0x0
+#define MX6QDL_PAD_SD2_DAT1__GPIO1_IO14             0x04c 0x360 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT2__SD2_DATA2              0x050 0x364 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT2__ECSPI5_SS1             0x050 0x364 0x838 0x1 0x0
+#define MX6QDL_PAD_SD2_DAT2__EIM_CS3_B              0x050 0x364 0x000 0x2 0x0
+#define MX6QDL_PAD_SD2_DAT2__AUD4_TXD               0x050 0x364 0x7b8 0x3 0x0
+#define MX6QDL_PAD_SD2_DAT2__KEY_ROW6               0x050 0x364 0x8f8 0x4 0x0
+#define MX6QDL_PAD_SD2_DAT2__GPIO1_IO13             0x050 0x364 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT0__SD2_DATA0              0x054 0x368 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT0__ECSPI5_MISO            0x054 0x368 0x82c 0x1 0x0
+#define MX6QDL_PAD_SD2_DAT0__AUD4_RXD               0x054 0x368 0x7b4 0x3 0x0
+#define MX6QDL_PAD_SD2_DAT0__KEY_ROW7               0x054 0x368 0x8fc 0x4 0x0
+#define MX6QDL_PAD_SD2_DAT0__GPIO1_IO15             0x054 0x368 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT0__DCIC2_OUT              0x054 0x368 0x000 0x6 0x0
+#define MX6QDL_PAD_RGMII_TXC__USB_H2_DATA           0x058 0x36c 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TXC__RGMII_TXC             0x058 0x36c 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TXC__SPDIF_EXT_CLK         0x058 0x36c 0x918 0x2 0x0
+#define MX6QDL_PAD_RGMII_TXC__GPIO6_IO19            0x058 0x36c 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TXC__XTALOSC_REF_CLK_24M   0x058 0x36c 0x000 0x7 0x0
+#define MX6QDL_PAD_RGMII_TD0__HSI_TX_READY          0x05c 0x370 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD0__RGMII_TD0             0x05c 0x370 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD0__GPIO6_IO20            0x05c 0x370 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD1__HSI_RX_FLAG           0x060 0x374 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD1__RGMII_TD1             0x060 0x374 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD1__GPIO6_IO21            0x060 0x374 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD2__HSI_RX_DATA           0x064 0x378 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD2__RGMII_TD2             0x064 0x378 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD2__GPIO6_IO22            0x064 0x378 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TD3__HSI_RX_WAKE           0x068 0x37c 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TD3__RGMII_TD3             0x068 0x37c 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TD3__GPIO6_IO23            0x068 0x37c 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__USB_H3_DATA        0x06c 0x380 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL       0x06c 0x380 0x858 0x1 0x0
+#define MX6QDL_PAD_RGMII_RX_CTL__GPIO6_IO24         0x06c 0x380 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD0__HSI_RX_READY          0x070 0x384 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD0__RGMII_RD0             0x070 0x384 0x848 0x1 0x0
+#define MX6QDL_PAD_RGMII_RD0__GPIO6_IO25            0x070 0x384 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE      0x074 0x388 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL       0x074 0x388 0x000 0x1 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__GPIO6_IO26         0x074 0x388 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_TX_CTL__ENET_REF_CLK       0x074 0x388 0x83c 0x7 0x0
+#define MX6QDL_PAD_RGMII_RD1__HSI_TX_FLAG           0x078 0x38c 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD1__RGMII_RD1             0x078 0x38c 0x84c 0x1 0x0
+#define MX6QDL_PAD_RGMII_RD1__GPIO6_IO27            0x078 0x38c 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD2__HSI_TX_DATA           0x07c 0x390 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD2__RGMII_RD2             0x07c 0x390 0x850 0x1 0x0
+#define MX6QDL_PAD_RGMII_RD2__GPIO6_IO28            0x07c 0x390 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RD3__HSI_TX_WAKE           0x080 0x394 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RD3__RGMII_RD3             0x080 0x394 0x854 0x1 0x0
+#define MX6QDL_PAD_RGMII_RD3__GPIO6_IO29            0x080 0x394 0x000 0x5 0x0
+#define MX6QDL_PAD_RGMII_RXC__USB_H3_STROBE         0x084 0x398 0x000 0x0 0x0
+#define MX6QDL_PAD_RGMII_RXC__RGMII_RXC             0x084 0x398 0x844 0x1 0x0
+#define MX6QDL_PAD_RGMII_RXC__GPIO6_IO30            0x084 0x398 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A25__EIM_ADDR25              0x088 0x39c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A25__ECSPI4_SS1              0x088 0x39c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A25__ECSPI2_RDY              0x088 0x39c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_A25__IPU1_DI1_PIN12          0x088 0x39c 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_A25__IPU1_DI0_D1_CS          0x088 0x39c 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_A25__GPIO5_IO02              0x088 0x39c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A25__HDMI_TX_CEC_LINE        0x088 0x39c 0x88c 0x6 0x0
+#define MX6QDL_PAD_EIM_EB2__EIM_EB2_B               0x08c 0x3a0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB2__ECSPI1_SS0              0x08c 0x3a0 0x800 0x1 0x0
+#define MX6QDL_PAD_EIM_EB2__IPU2_CSI1_DATA19        0x08c 0x3a0 0x8d4 0x3 0x0
+#define MX6QDL_PAD_EIM_EB2__HDMI_TX_DDC_SCL         0x08c 0x3a0 0x890 0x4 0x0
+#define MX6QDL_PAD_EIM_EB2__GPIO2_IO30              0x08c 0x3a0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB2__I2C2_SCL                0x08c 0x3a0 0x8a0 0x6 0x0
+#define MX6QDL_PAD_EIM_EB2__SRC_BOOT_CFG30          0x08c 0x3a0 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D16__EIM_DATA16              0x090 0x3a4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D16__ECSPI1_SCLK             0x090 0x3a4 0x7f4 0x1 0x0
+#define MX6QDL_PAD_EIM_D16__IPU1_DI0_PIN05          0x090 0x3a4 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D16__IPU2_CSI1_DATA18        0x090 0x3a4 0x8d0 0x3 0x0
+#define MX6QDL_PAD_EIM_D16__HDMI_TX_DDC_SDA         0x090 0x3a4 0x894 0x4 0x0
+#define MX6QDL_PAD_EIM_D16__GPIO3_IO16              0x090 0x3a4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D16__I2C2_SDA                0x090 0x3a4 0x8a4 0x6 0x0
+#define MX6QDL_PAD_EIM_D17__EIM_DATA17              0x094 0x3a8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D17__ECSPI1_MISO             0x094 0x3a8 0x7f8 0x1 0x0
+#define MX6QDL_PAD_EIM_D17__IPU1_DI0_PIN06          0x094 0x3a8 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D17__IPU2_CSI1_PIXCLK        0x094 0x3a8 0x8e0 0x3 0x0
+#define MX6QDL_PAD_EIM_D17__DCIC1_OUT               0x094 0x3a8 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D17__GPIO3_IO17              0x094 0x3a8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D17__I2C3_SCL                0x094 0x3a8 0x8a8 0x6 0x0
+#define MX6QDL_PAD_EIM_D18__EIM_DATA18              0x098 0x3ac 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D18__ECSPI1_MOSI             0x098 0x3ac 0x7fc 0x1 0x0
+#define MX6QDL_PAD_EIM_D18__IPU1_DI0_PIN07          0x098 0x3ac 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D18__IPU2_CSI1_DATA17        0x098 0x3ac 0x8cc 0x3 0x0
+#define MX6QDL_PAD_EIM_D18__IPU1_DI1_D0_CS          0x098 0x3ac 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D18__GPIO3_IO18              0x098 0x3ac 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D18__I2C3_SDA                0x098 0x3ac 0x8ac 0x6 0x0
+#define MX6QDL_PAD_EIM_D19__EIM_DATA19              0x09c 0x3b0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D19__ECSPI1_SS1              0x09c 0x3b0 0x804 0x1 0x0
+#define MX6QDL_PAD_EIM_D19__IPU1_DI0_PIN08          0x09c 0x3b0 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D19__IPU2_CSI1_DATA16        0x09c 0x3b0 0x8c8 0x3 0x0
+#define MX6QDL_PAD_EIM_D19__UART1_CTS_B             0x09c 0x3b0 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D19__UART1_RTS_B             0x09c 0x3b0 0x91c 0x4 0x0
+#define MX6QDL_PAD_EIM_D19__GPIO3_IO19              0x09c 0x3b0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D19__EPIT1_OUT               0x09c 0x3b0 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D20__EIM_DATA20              0x0a0 0x3b4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D20__ECSPI4_SS0              0x0a0 0x3b4 0x824 0x1 0x0
+#define MX6QDL_PAD_EIM_D20__IPU1_DI0_PIN16          0x0a0 0x3b4 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D20__IPU2_CSI1_DATA15        0x0a0 0x3b4 0x8c4 0x3 0x0
+#define MX6QDL_PAD_EIM_D20__UART1_RTS_B             0x0a0 0x3b4 0x91c 0x4 0x1
+#define MX6QDL_PAD_EIM_D20__UART1_CTS_B             0x0a0 0x3b4 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D20__GPIO3_IO20              0x0a0 0x3b4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D20__EPIT2_OUT               0x0a0 0x3b4 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D21__EIM_DATA21              0x0a4 0x3b8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D21__ECSPI4_SCLK             0x0a4 0x3b8 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D21__IPU1_DI0_PIN17          0x0a4 0x3b8 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D21__IPU2_CSI1_DATA11        0x0a4 0x3b8 0x8b4 0x3 0x0
+#define MX6QDL_PAD_EIM_D21__USB_OTG_OC              0x0a4 0x3b8 0x944 0x4 0x0
+#define MX6QDL_PAD_EIM_D21__GPIO3_IO21              0x0a4 0x3b8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D21__I2C1_SCL                0x0a4 0x3b8 0x898 0x6 0x0
+#define MX6QDL_PAD_EIM_D21__SPDIF_IN                0x0a4 0x3b8 0x914 0x7 0x0
+#define MX6QDL_PAD_EIM_D22__EIM_DATA22              0x0a8 0x3bc 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D22__ECSPI4_MISO             0x0a8 0x3bc 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D22__IPU1_DI0_PIN01          0x0a8 0x3bc 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D22__IPU2_CSI1_DATA10        0x0a8 0x3bc 0x8b0 0x3 0x0
+#define MX6QDL_PAD_EIM_D22__USB_OTG_PWR             0x0a8 0x3bc 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D22__GPIO3_IO22              0x0a8 0x3bc 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D22__SPDIF_OUT               0x0a8 0x3bc 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D23__EIM_DATA23              0x0ac 0x3c0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D23__IPU1_DI0_D0_CS          0x0ac 0x3c0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D23__UART3_CTS_B             0x0ac 0x3c0 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D23__UART3_RTS_B             0x0ac 0x3c0 0x92c 0x2 0x0
+#define MX6QDL_PAD_EIM_D23__UART1_DCD_B             0x0ac 0x3c0 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_D23__IPU2_CSI1_DATA_EN       0x0ac 0x3c0 0x8d8 0x4 0x0
+#define MX6QDL_PAD_EIM_D23__GPIO3_IO23              0x0ac 0x3c0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D23__IPU1_DI1_PIN02          0x0ac 0x3c0 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D23__IPU1_DI1_PIN14          0x0ac 0x3c0 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_EB3__EIM_EB3_B               0x0b0 0x3c4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB3__ECSPI4_RDY              0x0b0 0x3c4 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_EB3__UART3_RTS_B             0x0b0 0x3c4 0x92c 0x2 0x1
+#define MX6QDL_PAD_EIM_EB3__UART3_CTS_B             0x0b0 0x3c4 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_EB3__UART1_RI_B              0x0b0 0x3c4 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_EB3__IPU2_CSI1_HSYNC         0x0b0 0x3c4 0x8dc 0x4 0x0
+#define MX6QDL_PAD_EIM_EB3__GPIO2_IO31              0x0b0 0x3c4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB3__IPU1_DI1_PIN03          0x0b0 0x3c4 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_EB3__SRC_BOOT_CFG31          0x0b0 0x3c4 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D24__EIM_DATA24              0x0b4 0x3c8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D24__ECSPI4_SS2              0x0b4 0x3c8 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D24__UART3_TX_DATA           0x0b4 0x3c8 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D24__UART3_RX_DATA           0x0b4 0x3c8 0x930 0x2 0x0
+#define MX6QDL_PAD_EIM_D24__ECSPI1_SS2              0x0b4 0x3c8 0x808 0x3 0x0
+#define MX6QDL_PAD_EIM_D24__ECSPI2_SS2              0x0b4 0x3c8 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D24__GPIO3_IO24              0x0b4 0x3c8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D24__AUD5_RXFS               0x0b4 0x3c8 0x7d8 0x6 0x0
+#define MX6QDL_PAD_EIM_D24__UART1_DTR_B             0x0b4 0x3c8 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D25__EIM_DATA25              0x0b8 0x3cc 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D25__ECSPI4_SS3              0x0b8 0x3cc 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D25__UART3_RX_DATA           0x0b8 0x3cc 0x930 0x2 0x1
+#define MX6QDL_PAD_EIM_D25__UART3_TX_DATA           0x0b8 0x3cc 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D25__ECSPI1_SS3              0x0b8 0x3cc 0x80c 0x3 0x0
+#define MX6QDL_PAD_EIM_D25__ECSPI2_SS3              0x0b8 0x3cc 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D25__GPIO3_IO25              0x0b8 0x3cc 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D25__AUD5_RXC                0x0b8 0x3cc 0x7d4 0x6 0x0
+#define MX6QDL_PAD_EIM_D25__UART1_DSR_B             0x0b8 0x3cc 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D26__EIM_DATA26              0x0bc 0x3d0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_DI1_PIN11          0x0bc 0x3d0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_CSI0_DATA01        0x0bc 0x3d0 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D26__IPU2_CSI1_DATA14        0x0bc 0x3d0 0x8c0 0x3 0x0
+#define MX6QDL_PAD_EIM_D26__UART2_TX_DATA           0x0bc 0x3d0 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D26__UART2_RX_DATA           0x0bc 0x3d0 0x928 0x4 0x0
+#define MX6QDL_PAD_EIM_D26__GPIO3_IO26              0x0bc 0x3d0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_SISG2              0x0bc 0x3d0 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D26__IPU1_DISP1_DATA22       0x0bc 0x3d0 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D27__EIM_DATA27              0x0c0 0x3d4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_DI1_PIN13          0x0c0 0x3d4 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_CSI0_DATA00        0x0c0 0x3d4 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D27__IPU2_CSI1_DATA13        0x0c0 0x3d4 0x8bc 0x3 0x0
+#define MX6QDL_PAD_EIM_D27__UART2_RX_DATA           0x0c0 0x3d4 0x928 0x4 0x1
+#define MX6QDL_PAD_EIM_D27__UART2_TX_DATA           0x0c0 0x3d4 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D27__GPIO3_IO27              0x0c0 0x3d4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_SISG3              0x0c0 0x3d4 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D27__IPU1_DISP1_DATA23       0x0c0 0x3d4 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D28__EIM_DATA28              0x0c4 0x3d8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D28__I2C1_SDA                0x0c4 0x3d8 0x89c 0x1 0x0
+#define MX6QDL_PAD_EIM_D28__ECSPI4_MOSI             0x0c4 0x3d8 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D28__IPU2_CSI1_DATA12        0x0c4 0x3d8 0x8b8 0x3 0x0
+#define MX6QDL_PAD_EIM_D28__UART2_CTS_B             0x0c4 0x3d8 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__UART2_RTS_B             0x0c4 0x3d8 0x924 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__UART2_DTE_CTS_B         0x0c4 0x3d8 0x924 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__UART2_DTE_RTS_B         0x0c4 0x3d8 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D28__GPIO3_IO28              0x0c4 0x3d8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D28__IPU1_EXT_TRIG           0x0c4 0x3d8 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_D28__IPU1_DI0_PIN13          0x0c4 0x3d8 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D29__EIM_DATA29              0x0c8 0x3dc 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D29__IPU1_DI1_PIN15          0x0c8 0x3dc 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D29__ECSPI4_SS0              0x0c8 0x3dc 0x824 0x2 0x1
+#define MX6QDL_PAD_EIM_D29__UART2_RTS_B             0x0c8 0x3dc 0x924 0x4 0x1
+#define MX6QDL_PAD_EIM_D29__UART2_CTS_B             0x0c8 0x3dc 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D29__UART2_DTE_RTS_B         0x0c4 0x3dc 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D29__UART2_DTE_CTS_B         0x0c4 0x3dc 0x924 0x4 0x1
+#define MX6QDL_PAD_EIM_D29__GPIO3_IO29              0x0c8 0x3dc 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D29__IPU2_CSI1_VSYNC         0x0c8 0x3dc 0x8e4 0x6 0x0
+#define MX6QDL_PAD_EIM_D29__IPU1_DI0_PIN14          0x0c8 0x3dc 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_D30__EIM_DATA30              0x0cc 0x3e0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D30__IPU1_DISP1_DATA21       0x0cc 0x3e0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D30__IPU1_DI0_PIN11          0x0cc 0x3e0 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D30__IPU1_CSI0_DATA03        0x0cc 0x3e0 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_D30__UART3_CTS_B             0x0cc 0x3e0 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D30__UART3_RTS_B             0x0cc 0x3e0 0x92c 0x4 0x2
+#define MX6QDL_PAD_EIM_D30__GPIO3_IO30              0x0cc 0x3e0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D30__USB_H1_OC               0x0cc 0x3e0 0x948 0x6 0x0
+#define MX6QDL_PAD_EIM_D31__EIM_DATA31              0x0d0 0x3e4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_D31__IPU1_DISP1_DATA20       0x0d0 0x3e4 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_D31__IPU1_DI0_PIN12          0x0d0 0x3e4 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_D31__IPU1_CSI0_DATA02        0x0d0 0x3e4 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_D31__UART3_RTS_B             0x0d0 0x3e4 0x92c 0x4 0x3
+#define MX6QDL_PAD_EIM_D31__UART3_CTS_B             0x0d0 0x3e4 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_D31__GPIO3_IO31              0x0d0 0x3e4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_D31__USB_H1_PWR              0x0d0 0x3e4 0x000 0x6 0x0
+#define MX6QDL_PAD_EIM_A24__EIM_ADDR24              0x0d4 0x3e8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A24__IPU1_DISP1_DATA19       0x0d4 0x3e8 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A24__IPU2_CSI1_DATA19        0x0d4 0x3e8 0x8d4 0x2 0x1
+#define MX6QDL_PAD_EIM_A24__IPU2_SISG2              0x0d4 0x3e8 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_A24__IPU1_SISG2              0x0d4 0x3e8 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_A24__GPIO5_IO04              0x0d4 0x3e8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A24__SRC_BOOT_CFG24          0x0d4 0x3e8 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A23__EIM_ADDR23              0x0d8 0x3ec 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A23__IPU1_DISP1_DATA18       0x0d8 0x3ec 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A23__IPU2_CSI1_DATA18        0x0d8 0x3ec 0x8d0 0x2 0x1
+#define MX6QDL_PAD_EIM_A23__IPU2_SISG3              0x0d8 0x3ec 0x000 0x3 0x0
+#define MX6QDL_PAD_EIM_A23__IPU1_SISG3              0x0d8 0x3ec 0x000 0x4 0x0
+#define MX6QDL_PAD_EIM_A23__GPIO6_IO06              0x0d8 0x3ec 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A23__SRC_BOOT_CFG23          0x0d8 0x3ec 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A22__EIM_ADDR22              0x0dc 0x3f0 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A22__IPU1_DISP1_DATA17       0x0dc 0x3f0 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A22__IPU2_CSI1_DATA17        0x0dc 0x3f0 0x8cc 0x2 0x1
+#define MX6QDL_PAD_EIM_A22__GPIO2_IO16              0x0dc 0x3f0 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A22__SRC_BOOT_CFG22          0x0dc 0x3f0 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A21__EIM_ADDR21              0x0e0 0x3f4 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A21__IPU1_DISP1_DATA16       0x0e0 0x3f4 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A21__IPU2_CSI1_DATA16        0x0e0 0x3f4 0x8c8 0x2 0x1
+#define MX6QDL_PAD_EIM_A21__GPIO2_IO17              0x0e0 0x3f4 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A21__SRC_BOOT_CFG21          0x0e0 0x3f4 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A20__EIM_ADDR20              0x0e4 0x3f8 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A20__IPU1_DISP1_DATA15       0x0e4 0x3f8 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A20__IPU2_CSI1_DATA15        0x0e4 0x3f8 0x8c4 0x2 0x1
+#define MX6QDL_PAD_EIM_A20__GPIO2_IO18              0x0e4 0x3f8 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A20__SRC_BOOT_CFG20          0x0e4 0x3f8 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A19__EIM_ADDR19              0x0e8 0x3fc 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A19__IPU1_DISP1_DATA14       0x0e8 0x3fc 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A19__IPU2_CSI1_DATA14        0x0e8 0x3fc 0x8c0 0x2 0x1
+#define MX6QDL_PAD_EIM_A19__GPIO2_IO19              0x0e8 0x3fc 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A19__SRC_BOOT_CFG19          0x0e8 0x3fc 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A18__EIM_ADDR18              0x0ec 0x400 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A18__IPU1_DISP1_DATA13       0x0ec 0x400 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A18__IPU2_CSI1_DATA13        0x0ec 0x400 0x8bc 0x2 0x1
+#define MX6QDL_PAD_EIM_A18__GPIO2_IO20              0x0ec 0x400 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A18__SRC_BOOT_CFG18          0x0ec 0x400 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A17__EIM_ADDR17              0x0f0 0x404 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A17__IPU1_DISP1_DATA12       0x0f0 0x404 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12        0x0f0 0x404 0x8b8 0x2 0x1
+#define MX6QDL_PAD_EIM_A17__GPIO2_IO21              0x0f0 0x404 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A17__SRC_BOOT_CFG17          0x0f0 0x404 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_A16__EIM_ADDR16              0x0f4 0x408 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_A16__IPU1_DI1_DISP_CLK       0x0f4 0x408 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK        0x0f4 0x408 0x8e0 0x2 0x1
+#define MX6QDL_PAD_EIM_A16__GPIO2_IO22              0x0f4 0x408 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_A16__SRC_BOOT_CFG16          0x0f4 0x408 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_CS0__EIM_CS0_B               0x0f8 0x40c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_CS0__IPU1_DI1_PIN05          0x0f8 0x40c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_CS0__ECSPI2_SCLK             0x0f8 0x40c 0x810 0x2 0x0
+#define MX6QDL_PAD_EIM_CS0__GPIO2_IO23              0x0f8 0x40c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_CS1__EIM_CS1_B               0x0fc 0x410 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_CS1__IPU1_DI1_PIN06          0x0fc 0x410 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_CS1__ECSPI2_MOSI             0x0fc 0x410 0x818 0x2 0x0
+#define MX6QDL_PAD_EIM_CS1__GPIO2_IO24              0x0fc 0x410 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_OE__EIM_OE_B                 0x100 0x414 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_OE__IPU1_DI1_PIN07           0x100 0x414 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_OE__ECSPI2_MISO              0x100 0x414 0x814 0x2 0x0
+#define MX6QDL_PAD_EIM_OE__GPIO2_IO25               0x100 0x414 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_RW__EIM_RW                   0x104 0x418 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_RW__IPU1_DI1_PIN08           0x104 0x418 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_RW__ECSPI2_SS0               0x104 0x418 0x81c 0x2 0x0
+#define MX6QDL_PAD_EIM_RW__GPIO2_IO26               0x104 0x418 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_RW__SRC_BOOT_CFG29           0x104 0x418 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_LBA__EIM_LBA_B               0x108 0x41c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_LBA__IPU1_DI1_PIN17          0x108 0x41c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_LBA__ECSPI2_SS1              0x108 0x41c 0x820 0x2 0x0
+#define MX6QDL_PAD_EIM_LBA__GPIO2_IO27              0x108 0x41c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_LBA__SRC_BOOT_CFG26          0x108 0x41c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_EB0__EIM_EB0_B               0x10c 0x420 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB0__IPU1_DISP1_DATA11       0x10c 0x420 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_EB0__IPU2_CSI1_DATA11        0x10c 0x420 0x8b4 0x2 0x1
+#define MX6QDL_PAD_EIM_EB0__CCM_PMIC_READY          0x10c 0x420 0x7f0 0x4 0x0
+#define MX6QDL_PAD_EIM_EB0__GPIO2_IO28              0x10c 0x420 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB0__SRC_BOOT_CFG27          0x10c 0x420 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_EB1__EIM_EB1_B               0x110 0x424 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_EB1__IPU1_DISP1_DATA10       0x110 0x424 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_EB1__IPU2_CSI1_DATA10        0x110 0x424 0x8b0 0x2 0x1
+#define MX6QDL_PAD_EIM_EB1__GPIO2_IO29              0x110 0x424 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_EB1__SRC_BOOT_CFG28          0x110 0x424 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA0__EIM_AD00                0x114 0x428 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA0__IPU1_DISP1_DATA09       0x114 0x428 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA0__IPU2_CSI1_DATA09        0x114 0x428 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA0__GPIO3_IO00              0x114 0x428 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA0__SRC_BOOT_CFG00          0x114 0x428 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA1__EIM_AD01                0x118 0x42c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA1__IPU1_DISP1_DATA08       0x118 0x42c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA1__IPU2_CSI1_DATA08        0x118 0x42c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA1__GPIO3_IO01              0x118 0x42c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA1__SRC_BOOT_CFG01          0x118 0x42c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA2__EIM_AD02                0x11c 0x430 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA2__IPU1_DISP1_DATA07       0x11c 0x430 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA2__IPU2_CSI1_DATA07        0x11c 0x430 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA2__GPIO3_IO02              0x11c 0x430 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA2__SRC_BOOT_CFG02          0x11c 0x430 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA3__EIM_AD03                0x120 0x434 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA3__IPU1_DISP1_DATA06       0x120 0x434 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA3__IPU2_CSI1_DATA06        0x120 0x434 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA3__GPIO3_IO03              0x120 0x434 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA3__SRC_BOOT_CFG03          0x120 0x434 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA4__EIM_AD04                0x124 0x438 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA4__IPU1_DISP1_DATA05       0x124 0x438 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA4__IPU2_CSI1_DATA05        0x124 0x438 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA4__GPIO3_IO04              0x124 0x438 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA4__SRC_BOOT_CFG04          0x124 0x438 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA5__EIM_AD05                0x128 0x43c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA5__IPU1_DISP1_DATA04       0x128 0x43c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA5__IPU2_CSI1_DATA04        0x128 0x43c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA5__GPIO3_IO05              0x128 0x43c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA5__SRC_BOOT_CFG05          0x128 0x43c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA6__EIM_AD06                0x12c 0x440 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA6__IPU1_DISP1_DATA03       0x12c 0x440 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA6__IPU2_CSI1_DATA03        0x12c 0x440 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA6__GPIO3_IO06              0x12c 0x440 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA6__SRC_BOOT_CFG06          0x12c 0x440 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA7__EIM_AD07                0x130 0x444 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA7__IPU1_DISP1_DATA02       0x130 0x444 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA7__IPU2_CSI1_DATA02        0x130 0x444 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA7__GPIO3_IO07              0x130 0x444 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA7__SRC_BOOT_CFG07          0x130 0x444 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA8__EIM_AD08                0x134 0x448 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA8__IPU1_DISP1_DATA01       0x134 0x448 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA8__IPU2_CSI1_DATA01        0x134 0x448 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA8__GPIO3_IO08              0x134 0x448 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA8__SRC_BOOT_CFG08          0x134 0x448 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA9__EIM_AD09                0x138 0x44c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA9__IPU1_DISP1_DATA00       0x138 0x44c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA9__IPU2_CSI1_DATA00        0x138 0x44c 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA9__GPIO3_IO09              0x138 0x44c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA9__SRC_BOOT_CFG09          0x138 0x44c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA10__EIM_AD10               0x13c 0x450 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA10__IPU1_DI1_PIN15         0x13c 0x450 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA10__IPU2_CSI1_DATA_EN      0x13c 0x450 0x8d8 0x2 0x1
+#define MX6QDL_PAD_EIM_DA10__GPIO3_IO10             0x13c 0x450 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA10__SRC_BOOT_CFG10         0x13c 0x450 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA11__EIM_AD11               0x140 0x454 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA11__IPU1_DI1_PIN02         0x140 0x454 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA11__IPU2_CSI1_HSYNC        0x140 0x454 0x8dc 0x2 0x1
+#define MX6QDL_PAD_EIM_DA11__GPIO3_IO11             0x140 0x454 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA11__SRC_BOOT_CFG11         0x140 0x454 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA12__EIM_AD12               0x144 0x458 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA12__IPU1_DI1_PIN03         0x144 0x458 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA12__IPU2_CSI1_VSYNC        0x144 0x458 0x8e4 0x2 0x1
+#define MX6QDL_PAD_EIM_DA12__GPIO3_IO12             0x144 0x458 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA12__SRC_BOOT_CFG12         0x144 0x458 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA13__EIM_AD13               0x148 0x45c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA13__IPU1_DI1_D0_CS         0x148 0x45c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA13__GPIO3_IO13             0x148 0x45c 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA13__SRC_BOOT_CFG13         0x148 0x45c 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA14__EIM_AD14               0x14c 0x460 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA14__IPU1_DI1_D1_CS         0x14c 0x460 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA14__GPIO3_IO14             0x14c 0x460 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA14__SRC_BOOT_CFG14         0x14c 0x460 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_DA15__EIM_AD15               0x150 0x464 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_DA15__IPU1_DI1_PIN01         0x150 0x464 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_DA15__IPU1_DI1_PIN04         0x150 0x464 0x000 0x2 0x0
+#define MX6QDL_PAD_EIM_DA15__GPIO3_IO15             0x150 0x464 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_DA15__SRC_BOOT_CFG15         0x150 0x464 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_WAIT__EIM_WAIT_B             0x154 0x468 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_WAIT__EIM_DTACK_B            0x154 0x468 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_WAIT__GPIO5_IO00             0x154 0x468 0x000 0x5 0x0
+#define MX6QDL_PAD_EIM_WAIT__SRC_BOOT_CFG25         0x154 0x468 0x000 0x7 0x0
+#define MX6QDL_PAD_EIM_BCLK__EIM_BCLK               0x158 0x46c 0x000 0x0 0x0
+#define MX6QDL_PAD_EIM_BCLK__IPU1_DI1_PIN16         0x158 0x46c 0x000 0x1 0x0
+#define MX6QDL_PAD_EIM_BCLK__GPIO6_IO31             0x158 0x46c 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK  0x15c 0x470 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_DISP_CLK__IPU2_DI0_DISP_CLK  0x15c 0x470 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_DISP_CLK__GPIO4_IO16         0x15c 0x470 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15        0x160 0x474 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN15__IPU2_DI0_PIN15        0x160 0x474 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_PIN15__AUD6_TXC              0x160 0x474 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN15__GPIO4_IO17            0x160 0x474 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02         0x164 0x478 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN2__IPU2_DI0_PIN02         0x164 0x478 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_PIN2__AUD6_TXD               0x164 0x478 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN2__GPIO4_IO18             0x164 0x478 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03         0x168 0x47c 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN3__IPU2_DI0_PIN03         0x168 0x47c 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_PIN3__AUD6_TXFS              0x168 0x47c 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN3__GPIO4_IO19             0x168 0x47c 0x000 0x5 0x0
+#define MX6QDL_PAD_DI0_PIN4__IPU1_DI0_PIN04         0x16c 0x480 0x000 0x0 0x0
+#define MX6QDL_PAD_DI0_PIN4__IPU2_DI0_PIN04         0x16c 0x480 0x000 0x1 0x0
+#define MX6QDL_PAD_DI0_PIN4__AUD6_RXD               0x16c 0x480 0x000 0x2 0x0
+#define MX6QDL_PAD_DI0_PIN4__SD1_WP                 0x16c 0x480 0x94c 0x3 0x0
+#define MX6QDL_PAD_DI0_PIN4__GPIO4_IO20             0x16c 0x480 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00    0x170 0x484 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT0__IPU2_DISP0_DATA00    0x170 0x484 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK          0x170 0x484 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT0__GPIO4_IO21           0x170 0x484 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01    0x174 0x488 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT1__IPU2_DISP0_DATA01    0x174 0x488 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI          0x174 0x488 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT1__GPIO4_IO22           0x174 0x488 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02    0x178 0x48c 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT2__IPU2_DISP0_DATA02    0x178 0x48c 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO          0x178 0x48c 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT2__GPIO4_IO23           0x178 0x48c 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03    0x17c 0x490 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT3__IPU2_DISP0_DATA03    0x17c 0x490 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT3__ECSPI3_SS0           0x17c 0x490 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24           0x17c 0x490 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04    0x180 0x494 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT4__IPU2_DISP0_DATA04    0x180 0x494 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT4__ECSPI3_SS1           0x180 0x494 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT4__GPIO4_IO25           0x180 0x494 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05    0x184 0x498 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT5__IPU2_DISP0_DATA05    0x184 0x498 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT5__ECSPI3_SS2           0x184 0x498 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT5__AUD6_RXFS            0x184 0x498 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT5__GPIO4_IO26           0x184 0x498 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06    0x188 0x49c 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT6__IPU2_DISP0_DATA06    0x188 0x49c 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT6__ECSPI3_SS3           0x188 0x49c 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT6__AUD6_RXC             0x188 0x49c 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT6__GPIO4_IO27           0x188 0x49c 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07    0x18c 0x4a0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT7__IPU2_DISP0_DATA07    0x18c 0x4a0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT7__ECSPI3_RDY           0x18c 0x4a0 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT7__GPIO4_IO28           0x18c 0x4a0 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08    0x190 0x4a4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT8__IPU2_DISP0_DATA08    0x190 0x4a4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT8__PWM1_OUT             0x190 0x4a4 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT8__WDOG1_B              0x190 0x4a4 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT8__GPIO4_IO29           0x190 0x4a4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09    0x194 0x4a8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT9__IPU2_DISP0_DATA09    0x194 0x4a8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT9__PWM2_OUT             0x194 0x4a8 0x000 0x2 0x0
+#define MX6QDL_PAD_DISP0_DAT9__WDOG2_B              0x194 0x4a8 0x000 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT9__GPIO4_IO30           0x194 0x4a8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10   0x198 0x4ac 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT10__IPU2_DISP0_DATA10   0x198 0x4ac 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT10__GPIO4_IO31          0x198 0x4ac 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11   0x19c 0x4b0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT11__IPU2_DISP0_DATA11   0x19c 0x4b0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05          0x19c 0x4b0 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12   0x1a0 0x4b4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT12__IPU2_DISP0_DATA12   0x1a0 0x4b4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT12__GPIO5_IO06          0x1a0 0x4b4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13   0x1a4 0x4b8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT13__IPU2_DISP0_DATA13   0x1a4 0x4b8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT13__AUD5_RXFS           0x1a4 0x4b8 0x7d8 0x3 0x1
+#define MX6QDL_PAD_DISP0_DAT13__GPIO5_IO07          0x1a4 0x4b8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14   0x1a8 0x4bc 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT14__IPU2_DISP0_DATA14   0x1a8 0x4bc 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT14__AUD5_RXC            0x1a8 0x4bc 0x7d4 0x3 0x1
+#define MX6QDL_PAD_DISP0_DAT14__GPIO5_IO08          0x1a8 0x4bc 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15   0x1ac 0x4c0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT15__IPU2_DISP0_DATA15   0x1ac 0x4c0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT15__ECSPI1_SS1          0x1ac 0x4c0 0x804 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT15__ECSPI2_SS1          0x1ac 0x4c0 0x820 0x3 0x1
+#define MX6QDL_PAD_DISP0_DAT15__GPIO5_IO09          0x1ac 0x4c0 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16   0x1b0 0x4c4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT16__IPU2_DISP0_DATA16   0x1b0 0x4c4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT16__ECSPI2_MOSI         0x1b0 0x4c4 0x818 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT16__AUD5_TXC            0x1b0 0x4c4 0x7dc 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT16__SDMA_EXT_EVENT0     0x1b0 0x4c4 0x90c 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT16__GPIO5_IO10          0x1b0 0x4c4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17   0x1b4 0x4c8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT17__IPU2_DISP0_DATA17   0x1b4 0x4c8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT17__ECSPI2_MISO         0x1b4 0x4c8 0x814 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT17__AUD5_TXD            0x1b4 0x4c8 0x7d0 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT17__SDMA_EXT_EVENT1     0x1b4 0x4c8 0x910 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT17__GPIO5_IO11          0x1b4 0x4c8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18   0x1b8 0x4cc 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT18__IPU2_DISP0_DATA18   0x1b8 0x4cc 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT18__ECSPI2_SS0          0x1b8 0x4cc 0x81c 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS           0x1b8 0x4cc 0x7e0 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT18__AUD4_RXFS           0x1b8 0x4cc 0x7c0 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12          0x1b8 0x4cc 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT18__EIM_CS2_B           0x1b8 0x4cc 0x000 0x7 0x0
+#define MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19   0x1bc 0x4d0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT19__IPU2_DISP0_DATA19   0x1bc 0x4d0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT19__ECSPI2_SCLK         0x1bc 0x4d0 0x810 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT19__AUD5_RXD            0x1bc 0x4d0 0x7cc 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT19__AUD4_RXC            0x1bc 0x4d0 0x7bc 0x4 0x0
+#define MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13          0x1bc 0x4d0 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT19__EIM_CS3_B           0x1bc 0x4d0 0x000 0x7 0x0
+#define MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20   0x1c0 0x4d4 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT20__IPU2_DISP0_DATA20   0x1c0 0x4d4 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT20__ECSPI1_SCLK         0x1c0 0x4d4 0x7f4 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT20__AUD4_TXC            0x1c0 0x4d4 0x7c4 0x3 0x0
+#define MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14          0x1c0 0x4d4 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21   0x1c4 0x4d8 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT21__IPU2_DISP0_DATA21   0x1c4 0x4d8 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT21__ECSPI1_MOSI         0x1c4 0x4d8 0x7fc 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT21__AUD4_TXD            0x1c4 0x4d8 0x7b8 0x3 0x1
+#define MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15          0x1c4 0x4d8 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22   0x1c8 0x4dc 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT22__IPU2_DISP0_DATA22   0x1c8 0x4dc 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT22__ECSPI1_MISO         0x1c8 0x4dc 0x7f8 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS           0x1c8 0x4dc 0x7c8 0x3 0x1
+#define MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16          0x1c8 0x4dc 0x000 0x5 0x0
+#define MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23   0x1cc 0x4e0 0x000 0x0 0x0
+#define MX6QDL_PAD_DISP0_DAT23__IPU2_DISP0_DATA23   0x1cc 0x4e0 0x000 0x1 0x0
+#define MX6QDL_PAD_DISP0_DAT23__ECSPI1_SS0          0x1cc 0x4e0 0x800 0x2 0x1
+#define MX6QDL_PAD_DISP0_DAT23__AUD4_RXD            0x1cc 0x4e0 0x7b4 0x3 0x1
+#define MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17          0x1cc 0x4e0 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_MDIO__ENET_MDIO             0x1d0 0x4e4 0x840 0x1 0x0
+#define MX6QDL_PAD_ENET_MDIO__ESAI_RX_CLK           0x1d0 0x4e4 0x86c 0x2 0x0
+#define MX6QDL_PAD_ENET_MDIO__ENET_1588_EVENT1_OUT  0x1d0 0x4e4 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_MDIO__GPIO1_IO22            0x1d0 0x4e4 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_MDIO__SPDIF_LOCK            0x1d0 0x4e4 0x000 0x6 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK        0x1d4 0x4e8 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__ESAI_RX_FS         0x1d4 0x4e8 0x85c 0x2 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__GPIO1_IO23         0x1d4 0x4e8 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_REF_CLK__SPDIF_SR_CLK       0x1d4 0x4e8 0x000 0x6 0x0
+#define MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID           0x1d8 0x4ec 0x000 0x0 0x0
+#define MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER           0x1d8 0x4ec 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_RX_ER__ESAI_RX_HF_CLK       0x1d8 0x4ec 0x864 0x2 0x0
+#define MX6QDL_PAD_ENET_RX_ER__SPDIF_IN             0x1d8 0x4ec 0x914 0x3 0x1
+#define MX6QDL_PAD_ENET_RX_ER__ENET_1588_EVENT2_OUT 0x1d8 0x4ec 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_RX_ER__GPIO1_IO24           0x1d8 0x4ec 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN          0x1dc 0x4f0 0x858 0x1 0x1
+#define MX6QDL_PAD_ENET_CRS_DV__ESAI_TX_CLK         0x1dc 0x4f0 0x870 0x2 0x0
+#define MX6QDL_PAD_ENET_CRS_DV__SPDIF_EXT_CLK       0x1dc 0x4f0 0x918 0x3 0x1
+#define MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25          0x1dc 0x4f0 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_RXD1__MLB_SIG               0x1e0 0x4f4 0x908 0x0 0x0
+#define MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1         0x1e0 0x4f4 0x84c 0x1 0x1
+#define MX6QDL_PAD_ENET_RXD1__ESAI_TX_FS            0x1e0 0x4f4 0x860 0x2 0x0
+#define MX6QDL_PAD_ENET_RXD1__ENET_1588_EVENT3_OUT  0x1e0 0x4f4 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_RXD1__GPIO1_IO26            0x1e0 0x4f4 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0         0x1e4 0x4f8 0x848 0x1 0x1
+#define MX6QDL_PAD_ENET_RXD0__ESAI_TX_HF_CLK        0x1e4 0x4f8 0x868 0x2 0x0
+#define MX6QDL_PAD_ENET_RXD0__SPDIF_OUT             0x1e4 0x4f8 0x000 0x3 0x0
+#define MX6QDL_PAD_ENET_RXD0__GPIO1_IO27            0x1e4 0x4f8 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN           0x1e8 0x4fc 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_TX_EN__ESAI_TX3_RX2         0x1e8 0x4fc 0x880 0x2 0x0
+#define MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28           0x1e8 0x4fc 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_TXD1__MLB_CLK               0x1ec 0x500 0x900 0x0 0x0
+#define MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1         0x1ec 0x500 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_TXD1__ESAI_TX2_RX3          0x1ec 0x500 0x87c 0x2 0x0
+#define MX6QDL_PAD_ENET_TXD1__ENET_1588_EVENT0_IN   0x1ec 0x500 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_TXD1__GPIO1_IO29            0x1ec 0x500 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0         0x1f0 0x504 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_TXD0__ESAI_TX4_RX1          0x1f0 0x504 0x884 0x2 0x0
+#define MX6QDL_PAD_ENET_TXD0__GPIO1_IO30            0x1f0 0x504 0x000 0x5 0x0
+#define MX6QDL_PAD_ENET_MDC__MLB_DATA               0x1f4 0x508 0x904 0x0 0x0
+#define MX6QDL_PAD_ENET_MDC__ENET_MDC               0x1f4 0x508 0x000 0x1 0x0
+#define MX6QDL_PAD_ENET_MDC__ESAI_TX5_RX0           0x1f4 0x508 0x888 0x2 0x0
+#define MX6QDL_PAD_ENET_MDC__ENET_1588_EVENT1_IN    0x1f4 0x508 0x000 0x4 0x0
+#define MX6QDL_PAD_ENET_MDC__GPIO1_IO31             0x1f4 0x508 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK            0x1f8 0x5c8 0x7f4 0x0 0x2
+#define MX6QDL_PAD_KEY_COL0__ENET_RX_DATA3          0x1f8 0x5c8 0x854 0x1 0x1
+#define MX6QDL_PAD_KEY_COL0__AUD5_TXC               0x1f8 0x5c8 0x7dc 0x2 0x1
+#define MX6QDL_PAD_KEY_COL0__KEY_COL0               0x1f8 0x5c8 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL0__UART4_TX_DATA          0x1f8 0x5c8 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL0__UART4_RX_DATA          0x1f8 0x5c8 0x938 0x4 0x0
+#define MX6QDL_PAD_KEY_COL0__GPIO4_IO06             0x1f8 0x5c8 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL0__DCIC1_OUT              0x1f8 0x5c8 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI            0x1fc 0x5cc 0x7fc 0x0 0x2
+#define MX6QDL_PAD_KEY_ROW0__ENET_TX_DATA3          0x1fc 0x5cc 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW0__AUD5_TXD               0x1fc 0x5cc 0x7d0 0x2 0x1
+#define MX6QDL_PAD_KEY_ROW0__KEY_ROW0               0x1fc 0x5cc 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA          0x1fc 0x5cc 0x938 0x4 0x1
+#define MX6QDL_PAD_KEY_ROW0__UART4_TX_DATA          0x1fc 0x5cc 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW0__GPIO4_IO07             0x1fc 0x5cc 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW0__DCIC2_OUT              0x1fc 0x5cc 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_COL1__ECSPI1_MISO            0x200 0x5d0 0x7f8 0x0 0x2
+#define MX6QDL_PAD_KEY_COL1__ENET_MDIO              0x200 0x5d0 0x840 0x1 0x1
+#define MX6QDL_PAD_KEY_COL1__AUD5_TXFS              0x200 0x5d0 0x7e0 0x2 0x1
+#define MX6QDL_PAD_KEY_COL1__KEY_COL1               0x200 0x5d0 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL1__UART5_TX_DATA          0x200 0x5d0 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL1__UART5_RX_DATA          0x200 0x5d0 0x940 0x4 0x0
+#define MX6QDL_PAD_KEY_COL1__GPIO4_IO08             0x200 0x5d0 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL1__SD1_VSELECT            0x200 0x5d0 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_ROW1__ECSPI1_SS0             0x204 0x5d4 0x800 0x0 0x2
+#define MX6QDL_PAD_KEY_ROW1__ENET_COL               0x204 0x5d4 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW1__AUD5_RXD               0x204 0x5d4 0x7cc 0x2 0x1
+#define MX6QDL_PAD_KEY_ROW1__KEY_ROW1               0x204 0x5d4 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA          0x204 0x5d4 0x940 0x4 0x1
+#define MX6QDL_PAD_KEY_ROW1__UART5_TX_DATA          0x204 0x5d4 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW1__GPIO4_IO09             0x204 0x5d4 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW1__SD2_VSELECT            0x204 0x5d4 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_COL2__ECSPI1_SS1             0x208 0x5d8 0x804 0x0 0x2
+#define MX6QDL_PAD_KEY_COL2__ENET_RX_DATA2          0x208 0x5d8 0x850 0x1 0x1
+#define MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX            0x208 0x5d8 0x000 0x2 0x0
+#define MX6QDL_PAD_KEY_COL2__KEY_COL2               0x208 0x5d8 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL2__ENET_MDC               0x208 0x5d8 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL2__GPIO4_IO10             0x208 0x5d8 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL2__USB_H1_PWR_CTL_WAKE    0x208 0x5d8 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_ROW2__ECSPI1_SS2             0x20c 0x5dc 0x808 0x0 0x1
+#define MX6QDL_PAD_KEY_ROW2__ENET_TX_DATA2          0x20c 0x5dc 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX            0x20c 0x5dc 0x7e4 0x2 0x0
+#define MX6QDL_PAD_KEY_ROW2__KEY_ROW2               0x20c 0x5dc 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW2__SD2_VSELECT            0x20c 0x5dc 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW2__GPIO4_IO11             0x20c 0x5dc 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE       0x20c 0x5dc 0x88c 0x6 0x1
+#define MX6QDL_PAD_KEY_COL3__ECSPI1_SS3             0x210 0x5e0 0x80c 0x0 0x1
+#define MX6QDL_PAD_KEY_COL3__ENET_CRS               0x210 0x5e0 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_COL3__HDMI_TX_DDC_SCL        0x210 0x5e0 0x890 0x2 0x1
+#define MX6QDL_PAD_KEY_COL3__KEY_COL3               0x210 0x5e0 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL3__I2C2_SCL               0x210 0x5e0 0x8a0 0x4 0x1
+#define MX6QDL_PAD_KEY_COL3__GPIO4_IO12             0x210 0x5e0 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_COL3__SPDIF_IN               0x210 0x5e0 0x914 0x6 0x2
+#define MX6QDL_PAD_KEY_ROW3__ASRC_EXT_CLK           0x214 0x5e4 0x7b0 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA        0x214 0x5e4 0x894 0x2 0x1
+#define MX6QDL_PAD_KEY_ROW3__KEY_ROW3               0x214 0x5e4 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW3__I2C2_SDA               0x214 0x5e4 0x8a4 0x4 0x1
+#define MX6QDL_PAD_KEY_ROW3__GPIO4_IO13             0x214 0x5e4 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW3__SD1_VSELECT            0x214 0x5e4 0x000 0x6 0x0
+#define MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX            0x218 0x5e8 0x000 0x0 0x0
+#define MX6QDL_PAD_KEY_COL4__IPU1_SISG4             0x218 0x5e8 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_COL4__USB_OTG_OC             0x218 0x5e8 0x944 0x2 0x1
+#define MX6QDL_PAD_KEY_COL4__KEY_COL4               0x218 0x5e8 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_COL4__UART5_RTS_B            0x218 0x5e8 0x93c 0x4 0x0
+#define MX6QDL_PAD_KEY_COL4__UART5_CTS_B            0x218 0x5e8 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_COL4__GPIO4_IO14             0x218 0x5e8 0x000 0x5 0x0
+#define MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX            0x21c 0x5ec 0x7e8 0x0 0x0
+#define MX6QDL_PAD_KEY_ROW4__IPU1_SISG5             0x21c 0x5ec 0x000 0x1 0x0
+#define MX6QDL_PAD_KEY_ROW4__USB_OTG_PWR            0x21c 0x5ec 0x000 0x2 0x0
+#define MX6QDL_PAD_KEY_ROW4__KEY_ROW4               0x21c 0x5ec 0x000 0x3 0x0
+#define MX6QDL_PAD_KEY_ROW4__UART5_CTS_B            0x21c 0x5ec 0x000 0x4 0x0
+#define MX6QDL_PAD_KEY_ROW4__UART5_RTS_B            0x21c 0x5ec 0x93c 0x4 0x1
+#define MX6QDL_PAD_KEY_ROW4__GPIO4_IO15             0x21c 0x5ec 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_0__CCM_CLKO1                0x220 0x5f0 0x000 0x0 0x0
+#define MX6QDL_PAD_GPIO_0__KEY_COL5                 0x220 0x5f0 0x8e8 0x2 0x0
+#define MX6QDL_PAD_GPIO_0__ASRC_EXT_CLK             0x220 0x5f0 0x7b0 0x3 0x1
+#define MX6QDL_PAD_GPIO_0__EPIT1_OUT                0x220 0x5f0 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_0__GPIO1_IO00               0x220 0x5f0 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_0__USB_H1_PWR               0x220 0x5f0 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_0__SNVS_VIO_5               0x220 0x5f0 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_1__ESAI_RX_CLK              0x224 0x5f4 0x86c 0x0 0x1
+#define MX6QDL_PAD_GPIO_1__WDOG2_B                  0x224 0x5f4 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_1__KEY_ROW5                 0x224 0x5f4 0x8f4 0x2 0x0
+#define MX6QDL_PAD_GPIO_1__USB_OTG_ID               0x224 0x5f4 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_1__PWM2_OUT                 0x224 0x5f4 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_1__GPIO1_IO01               0x224 0x5f4 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_1__SD1_CD_B                 0x224 0x5f4 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_9__ESAI_RX_FS               0x228 0x5f8 0x85c 0x0 0x1
+#define MX6QDL_PAD_GPIO_9__WDOG1_B                  0x228 0x5f8 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_9__KEY_COL6                 0x228 0x5f8 0x8ec 0x2 0x0
+#define MX6QDL_PAD_GPIO_9__CCM_REF_EN_B             0x228 0x5f8 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_9__PWM1_OUT                 0x228 0x5f8 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_9__GPIO1_IO09               0x228 0x5f8 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_9__SD1_WP                   0x228 0x5f8 0x94c 0x6 0x1
+#define MX6QDL_PAD_GPIO_3__ESAI_RX_HF_CLK           0x22c 0x5fc 0x864 0x0 0x1
+#define MX6QDL_PAD_GPIO_3__I2C3_SCL                 0x22c 0x5fc 0x8a8 0x2 0x1
+#define MX6QDL_PAD_GPIO_3__XTALOSC_REF_CLK_24M      0x22c 0x5fc 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_3__CCM_CLKO2                0x22c 0x5fc 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_3__GPIO1_IO03               0x22c 0x5fc 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_3__USB_H1_OC                0x22c 0x5fc 0x948 0x6 0x1
+#define MX6QDL_PAD_GPIO_3__MLB_CLK                  0x22c 0x5fc 0x900 0x7 0x1
+#define MX6QDL_PAD_GPIO_6__ESAI_TX_CLK              0x230 0x600 0x870 0x0 0x1
+#define MX6QDL_PAD_GPIO_6__I2C3_SDA                 0x230 0x600 0x8ac 0x2 0x1
+#define MX6QDL_PAD_GPIO_6__GPIO1_IO06               0x230 0x600 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_6__SD2_LCTL                 0x230 0x600 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_6__MLB_SIG                  0x230 0x600 0x908 0x7 0x1
+#define MX6QDL_PAD_GPIO_2__ESAI_TX_FS               0x234 0x604 0x860 0x0 0x1
+#define MX6QDL_PAD_GPIO_2__KEY_ROW6                 0x234 0x604 0x8f8 0x2 0x1
+#define MX6QDL_PAD_GPIO_2__GPIO1_IO02               0x234 0x604 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_2__SD2_WP                   0x234 0x604 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_2__MLB_DATA                 0x234 0x604 0x904 0x7 0x1
+#define MX6QDL_PAD_GPIO_4__ESAI_TX_HF_CLK           0x238 0x608 0x868 0x0 0x1
+#define MX6QDL_PAD_GPIO_4__KEY_COL7                 0x238 0x608 0x8f0 0x2 0x1
+#define MX6QDL_PAD_GPIO_4__GPIO1_IO04               0x238 0x608 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_4__SD2_CD_B                 0x238 0x608 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_5__ESAI_TX2_RX3             0x23c 0x60c 0x87c 0x0 0x1
+#define MX6QDL_PAD_GPIO_5__KEY_ROW7                 0x23c 0x60c 0x8fc 0x2 0x1
+#define MX6QDL_PAD_GPIO_5__CCM_CLKO1                0x23c 0x60c 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_5__GPIO1_IO05               0x23c 0x60c 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_5__I2C3_SCL                 0x23c 0x60c 0x8a8 0x6 0x2
+#define MX6QDL_PAD_GPIO_5__ARM_EVENTI               0x23c 0x60c 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_7__ESAI_TX4_RX1             0x240 0x610 0x884 0x0 0x1
+#define MX6QDL_PAD_GPIO_7__ECSPI5_RDY               0x240 0x610 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_7__EPIT1_OUT                0x240 0x610 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_7__FLEXCAN1_TX              0x240 0x610 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_7__UART2_TX_DATA            0x240 0x610 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_7__UART2_RX_DATA            0x240 0x610 0x928 0x4 0x2
+#define MX6QDL_PAD_GPIO_7__GPIO1_IO07               0x240 0x610 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_7__SPDIF_LOCK               0x240 0x610 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_7__USB_OTG_HOST_MODE        0x240 0x610 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_8__ESAI_TX5_RX0             0x244 0x614 0x888 0x0 0x1
+#define MX6QDL_PAD_GPIO_8__XTALOSC_REF_CLK_32K      0x244 0x614 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_8__EPIT2_OUT                0x244 0x614 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_8__FLEXCAN1_RX              0x244 0x614 0x7e4 0x3 0x1
+#define MX6QDL_PAD_GPIO_8__UART2_RX_DATA            0x244 0x614 0x928 0x4 0x3
+#define MX6QDL_PAD_GPIO_8__UART2_TX_DATA            0x244 0x614 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_8__GPIO1_IO08               0x244 0x614 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_8__SPDIF_SR_CLK             0x244 0x614 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_8__USB_OTG_PWR_CTL_WAKE     0x244 0x614 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_16__ESAI_TX3_RX2            0x248 0x618 0x880 0x0 0x1
+#define MX6QDL_PAD_GPIO_16__ENET_1588_EVENT2_IN     0x248 0x618 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_16__ENET_REF_CLK            0x248 0x618 0x83c 0x2 0x1
+#define MX6QDL_PAD_GPIO_16__SD1_LCTL                0x248 0x618 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_16__SPDIF_IN                0x248 0x618 0x914 0x4 0x3
+#define MX6QDL_PAD_GPIO_16__GPIO7_IO11              0x248 0x618 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_16__I2C3_SDA                0x248 0x618 0x8ac 0x6 0x2
+#define MX6QDL_PAD_GPIO_16__JTAG_DE_B               0x248 0x618 0x000 0x7 0x0
+#define MX6QDL_PAD_GPIO_17__ESAI_TX0                0x24c 0x61c 0x874 0x0 0x0
+#define MX6QDL_PAD_GPIO_17__ENET_1588_EVENT3_IN     0x24c 0x61c 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_17__CCM_PMIC_READY          0x24c 0x61c 0x7f0 0x2 0x1
+#define MX6QDL_PAD_GPIO_17__SDMA_EXT_EVENT0         0x24c 0x61c 0x90c 0x3 0x1
+#define MX6QDL_PAD_GPIO_17__SPDIF_OUT               0x24c 0x61c 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_17__GPIO7_IO12              0x24c 0x61c 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_18__ESAI_TX1                0x250 0x620 0x878 0x0 0x0
+#define MX6QDL_PAD_GPIO_18__ENET_RX_CLK             0x250 0x620 0x844 0x1 0x1
+#define MX6QDL_PAD_GPIO_18__SD3_VSELECT             0x250 0x620 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_18__SDMA_EXT_EVENT1         0x250 0x620 0x910 0x3 0x1
+#define MX6QDL_PAD_GPIO_18__ASRC_EXT_CLK            0x250 0x620 0x7b0 0x4 0x2
+#define MX6QDL_PAD_GPIO_18__GPIO7_IO13              0x250 0x620 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_18__SNVS_VIO_5_CTL          0x250 0x620 0x000 0x6 0x0
+#define MX6QDL_PAD_GPIO_19__KEY_COL5                0x254 0x624 0x8e8 0x0 0x1
+#define MX6QDL_PAD_GPIO_19__ENET_1588_EVENT0_OUT    0x254 0x624 0x000 0x1 0x0
+#define MX6QDL_PAD_GPIO_19__SPDIF_OUT               0x254 0x624 0x000 0x2 0x0
+#define MX6QDL_PAD_GPIO_19__CCM_CLKO1               0x254 0x624 0x000 0x3 0x0
+#define MX6QDL_PAD_GPIO_19__ECSPI1_RDY              0x254 0x624 0x000 0x4 0x0
+#define MX6QDL_PAD_GPIO_19__GPIO4_IO05              0x254 0x624 0x000 0x5 0x0
+#define MX6QDL_PAD_GPIO_19__ENET_TX_ER              0x254 0x624 0x000 0x6 0x0
+#define MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK    0x258 0x628 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_PIXCLK__GPIO5_IO18          0x258 0x628 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_PIXCLK__ARM_EVENTO          0x258 0x628 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC       0x25c 0x62c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_MCLK__CCM_CLKO1             0x25c 0x62c 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_MCLK__GPIO5_IO19            0x25c 0x62c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_MCLK__ARM_TRACE_CTL         0x25c 0x62c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN  0x260 0x630 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__EIM_DATA00         0x260 0x630 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20         0x260 0x630 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DATA_EN__ARM_TRACE_CLK      0x260 0x630 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC      0x264 0x634 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__EIM_DATA01           0x264 0x634 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__GPIO5_IO21           0x264 0x634 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_VSYNC__ARM_TRACE00          0x264 0x634 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04      0x268 0x638 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT4__EIM_DATA02            0x268 0x638 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT4__ECSPI1_SCLK           0x268 0x638 0x7f4 0x2 0x3
+#define MX6QDL_PAD_CSI0_DAT4__KEY_COL5              0x268 0x638 0x8e8 0x3 0x2
+#define MX6QDL_PAD_CSI0_DAT4__AUD3_TXC              0x268 0x638 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT4__GPIO5_IO22            0x268 0x638 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT4__ARM_TRACE01           0x268 0x638 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05      0x26c 0x63c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT5__EIM_DATA03            0x26c 0x63c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT5__ECSPI1_MOSI           0x26c 0x63c 0x7fc 0x2 0x3
+#define MX6QDL_PAD_CSI0_DAT5__KEY_ROW5              0x26c 0x63c 0x8f4 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT5__AUD3_TXD              0x26c 0x63c 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23            0x26c 0x63c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT5__ARM_TRACE02           0x26c 0x63c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06      0x270 0x640 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT6__EIM_DATA04            0x270 0x640 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT6__ECSPI1_MISO           0x270 0x640 0x7f8 0x2 0x3
+#define MX6QDL_PAD_CSI0_DAT6__KEY_COL6              0x270 0x640 0x8ec 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS             0x270 0x640 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT6__GPIO5_IO24            0x270 0x640 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT6__ARM_TRACE03           0x270 0x640 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07      0x274 0x644 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT7__EIM_DATA05            0x274 0x644 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT7__ECSPI1_SS0            0x274 0x644 0x800 0x2 0x3
+#define MX6QDL_PAD_CSI0_DAT7__KEY_ROW6              0x274 0x644 0x8f8 0x3 0x2
+#define MX6QDL_PAD_CSI0_DAT7__AUD3_RXD              0x274 0x644 0x000 0x4 0x0
+#define MX6QDL_PAD_CSI0_DAT7__GPIO5_IO25            0x274 0x644 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT7__ARM_TRACE04           0x274 0x644 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08      0x278 0x648 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT8__EIM_DATA06            0x278 0x648 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT8__ECSPI2_SCLK           0x278 0x648 0x810 0x2 0x2
+#define MX6QDL_PAD_CSI0_DAT8__KEY_COL7              0x278 0x648 0x8f0 0x3 0x2
+#define MX6QDL_PAD_CSI0_DAT8__I2C1_SDA              0x278 0x648 0x89c 0x4 0x1
+#define MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26            0x278 0x648 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT8__ARM_TRACE05           0x278 0x648 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09      0x27c 0x64c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT9__EIM_DATA07            0x27c 0x64c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT9__ECSPI2_MOSI           0x27c 0x64c 0x818 0x2 0x2
+#define MX6QDL_PAD_CSI0_DAT9__KEY_ROW7              0x27c 0x64c 0x8fc 0x3 0x2
+#define MX6QDL_PAD_CSI0_DAT9__I2C1_SCL              0x27c 0x64c 0x898 0x4 0x1
+#define MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27            0x27c 0x64c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT9__ARM_TRACE06           0x27c 0x64c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10     0x280 0x650 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT10__AUD3_RXC             0x280 0x650 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT10__ECSPI2_MISO          0x280 0x650 0x814 0x2 0x2
+#define MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA        0x280 0x650 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT10__UART1_RX_DATA        0x280 0x650 0x920 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT10__GPIO5_IO28           0x280 0x650 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT10__ARM_TRACE07          0x280 0x650 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11     0x284 0x654 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT11__AUD3_RXFS            0x284 0x654 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT11__ECSPI2_SS0           0x284 0x654 0x81c 0x2 0x2
+#define MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA        0x284 0x654 0x920 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT11__UART1_TX_DATA        0x284 0x654 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT11__GPIO5_IO29           0x284 0x654 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT11__ARM_TRACE08          0x284 0x654 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12     0x288 0x658 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT12__EIM_DATA08           0x288 0x658 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA        0x288 0x658 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT12__UART4_RX_DATA        0x288 0x658 0x938 0x3 0x2
+#define MX6QDL_PAD_CSI0_DAT12__GPIO5_IO30           0x288 0x658 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT12__ARM_TRACE09          0x288 0x658 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13     0x28c 0x65c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT13__EIM_DATA09           0x28c 0x65c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA        0x28c 0x65c 0x938 0x3 0x3
+#define MX6QDL_PAD_CSI0_DAT13__UART4_TX_DATA        0x28c 0x65c 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT13__GPIO5_IO31           0x28c 0x65c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT13__ARM_TRACE10          0x28c 0x65c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14     0x290 0x660 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT14__EIM_DATA10           0x290 0x660 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT14__UART5_TX_DATA        0x290 0x660 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT14__UART5_RX_DATA        0x290 0x660 0x940 0x3 0x2
+#define MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00           0x290 0x660 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT14__ARM_TRACE11          0x290 0x660 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15     0x294 0x664 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT15__EIM_DATA11           0x294 0x664 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT15__UART5_RX_DATA        0x294 0x664 0x940 0x3 0x3
+#define MX6QDL_PAD_CSI0_DAT15__UART5_TX_DATA        0x294 0x664 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01           0x294 0x664 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT15__ARM_TRACE12          0x294 0x664 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16     0x298 0x668 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT16__EIM_DATA12           0x298 0x668 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B          0x298 0x668 0x934 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B          0x298 0x668 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02           0x298 0x668 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT16__ARM_TRACE13          0x298 0x668 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17     0x29c 0x66c 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT17__EIM_DATA13           0x29c 0x66c 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B          0x29c 0x66c 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B          0x29c 0x66c 0x934 0x3 0x1
+#define MX6QDL_PAD_CSI0_DAT17__GPIO6_IO03           0x29c 0x66c 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT17__ARM_TRACE14          0x29c 0x66c 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18     0x2a0 0x670 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT18__EIM_DATA14           0x2a0 0x670 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT18__UART5_RTS_B          0x2a0 0x670 0x93c 0x3 0x2
+#define MX6QDL_PAD_CSI0_DAT18__UART5_CTS_B          0x2a0 0x670 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT18__GPIO6_IO04           0x2a0 0x670 0x000 0x5 0x0
+#define MX6QDL_PAD_CSI0_DAT18__ARM_TRACE15          0x2a0 0x670 0x000 0x7 0x0
+#define MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19     0x2a4 0x674 0x000 0x0 0x0
+#define MX6QDL_PAD_CSI0_DAT19__EIM_DATA15           0x2a4 0x674 0x000 0x1 0x0
+#define MX6QDL_PAD_CSI0_DAT19__UART5_CTS_B          0x2a4 0x674 0x000 0x3 0x0
+#define MX6QDL_PAD_CSI0_DAT19__UART5_RTS_B          0x2a4 0x674 0x93c 0x3 0x3
+#define MX6QDL_PAD_CSI0_DAT19__GPIO6_IO05           0x2a4 0x674 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT7__SD3_DATA7              0x2a8 0x690 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA          0x2a8 0x690 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT7__UART1_RX_DATA          0x2a8 0x690 0x920 0x1 0x2
+#define MX6QDL_PAD_SD3_DAT7__GPIO6_IO17             0x2a8 0x690 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT6__SD3_DATA6              0x2ac 0x694 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA          0x2ac 0x694 0x920 0x1 0x3
+#define MX6QDL_PAD_SD3_DAT6__UART1_TX_DATA          0x2ac 0x694 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT6__GPIO6_IO18             0x2ac 0x694 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT5__SD3_DATA5              0x2b0 0x698 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT5__UART2_TX_DATA          0x2b0 0x698 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT5__UART2_RX_DATA          0x2b0 0x698 0x928 0x1 0x4
+#define MX6QDL_PAD_SD3_DAT5__GPIO7_IO00             0x2b0 0x698 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT4__SD3_DATA4              0x2b4 0x69c 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT4__UART2_RX_DATA          0x2b4 0x69c 0x928 0x1 0x5
+#define MX6QDL_PAD_SD3_DAT4__UART2_TX_DATA          0x2b4 0x69c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT4__GPIO7_IO01             0x2b4 0x69c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_CMD__SD3_CMD                 0x2b8 0x6a0 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_CMD__UART2_CTS_B             0x2b8 0x6a0 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_CMD__UART2_RTS_B             0x2b8 0x6a0 0x924 0x1 0x2
+#define MX6QDL_PAD_SD3_CMD__FLEXCAN1_TX             0x2b8 0x6a0 0x000 0x2 0x0
+#define MX6QDL_PAD_SD3_CMD__GPIO7_IO02              0x2b8 0x6a0 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_CLK__SD3_CLK                 0x2bc 0x6a4 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_CLK__UART2_RTS_B             0x2bc 0x6a4 0x924 0x1 0x3
+#define MX6QDL_PAD_SD3_CLK__UART2_CTS_B             0x2bc 0x6a4 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_CLK__FLEXCAN1_RX             0x2bc 0x6a4 0x7e4 0x2 0x2
+#define MX6QDL_PAD_SD3_CLK__GPIO7_IO03              0x2bc 0x6a4 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT0__SD3_DATA0              0x2c0 0x6a8 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT0__UART1_CTS_B            0x2c0 0x6a8 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT0__UART1_RTS_B            0x2c0 0x6a8 0x91c 0x1 0x2
+#define MX6QDL_PAD_SD3_DAT0__FLEXCAN2_TX            0x2c0 0x6a8 0x000 0x2 0x0
+#define MX6QDL_PAD_SD3_DAT0__GPIO7_IO04             0x2c0 0x6a8 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT1__SD3_DATA1              0x2c4 0x6ac 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT1__UART1_RTS_B            0x2c4 0x6ac 0x91c 0x1 0x3
+#define MX6QDL_PAD_SD3_DAT1__UART1_CTS_B            0x2c4 0x6ac 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT1__FLEXCAN2_RX            0x2c4 0x6ac 0x7e8 0x2 0x1
+#define MX6QDL_PAD_SD3_DAT1__GPIO7_IO05             0x2c4 0x6ac 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT2__SD3_DATA2              0x2c8 0x6b0 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT2__GPIO7_IO06             0x2c8 0x6b0 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_DAT3__SD3_DATA3              0x2cc 0x6b4 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_DAT3__UART3_CTS_B            0x2cc 0x6b4 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_DAT3__UART3_RTS_B            0x2cc 0x6b4 0x92c 0x1 0x4
+#define MX6QDL_PAD_SD3_DAT3__GPIO7_IO07             0x2cc 0x6b4 0x000 0x5 0x0
+#define MX6QDL_PAD_SD3_RST__SD3_RESET               0x2d0 0x6b8 0x000 0x0 0x0
+#define MX6QDL_PAD_SD3_RST__UART3_RTS_B             0x2d0 0x6b8 0x92c 0x1 0x5
+#define MX6QDL_PAD_SD3_RST__UART3_CTS_B             0x2d0 0x6b8 0x000 0x1 0x0
+#define MX6QDL_PAD_SD3_RST__GPIO7_IO08              0x2d0 0x6b8 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CLE__NAND_CLE              0x2d4 0x6bc 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CLE__IPU2_SISG4            0x2d4 0x6bc 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_CLE__GPIO6_IO07            0x2d4 0x6bc 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_ALE__NAND_ALE              0x2d8 0x6c0 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_ALE__SD4_RESET             0x2d8 0x6c0 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_ALE__GPIO6_IO08            0x2d8 0x6c0 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_WP_B__NAND_WP_B            0x2dc 0x6c4 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_WP_B__IPU2_SISG5           0x2dc 0x6c4 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_WP_B__GPIO6_IO09           0x2dc 0x6c4 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_RB0__NAND_READY_B          0x2e0 0x6c8 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_RB0__IPU2_DI0_PIN01        0x2e0 0x6c8 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_RB0__GPIO6_IO10            0x2e0 0x6c8 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS0__NAND_CE0_B            0x2e4 0x6cc 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS0__GPIO6_IO11            0x2e4 0x6cc 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS1__NAND_CE1_B            0x2e8 0x6d0 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS1__SD4_VSELECT           0x2e8 0x6d0 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_CS1__SD3_VSELECT           0x2e8 0x6d0 0x000 0x2 0x0
+#define MX6QDL_PAD_NANDF_CS1__GPIO6_IO14            0x2e8 0x6d0 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS2__NAND_CE2_B            0x2ec 0x6d4 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS2__IPU1_SISG0            0x2ec 0x6d4 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_CS2__ESAI_TX0              0x2ec 0x6d4 0x874 0x2 0x1
+#define MX6QDL_PAD_NANDF_CS2__EIM_CRE               0x2ec 0x6d4 0x000 0x3 0x0
+#define MX6QDL_PAD_NANDF_CS2__CCM_CLKO2             0x2ec 0x6d4 0x000 0x4 0x0
+#define MX6QDL_PAD_NANDF_CS2__GPIO6_IO15            0x2ec 0x6d4 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS2__IPU2_SISG0            0x2ec 0x6d4 0x000 0x6 0x0
+#define MX6QDL_PAD_NANDF_CS3__NAND_CE3_B            0x2f0 0x6d8 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_CS3__IPU1_SISG1            0x2f0 0x6d8 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_CS3__ESAI_TX1              0x2f0 0x6d8 0x878 0x2 0x1
+#define MX6QDL_PAD_NANDF_CS3__EIM_ADDR26            0x2f0 0x6d8 0x000 0x3 0x0
+#define MX6QDL_PAD_NANDF_CS3__GPIO6_IO16            0x2f0 0x6d8 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_CS3__IPU2_SISG1            0x2f0 0x6d8 0x000 0x6 0x0
+#define MX6QDL_PAD_SD4_CMD__SD4_CMD                 0x2f4 0x6dc 0x000 0x0 0x0
+#define MX6QDL_PAD_SD4_CMD__NAND_RE_B               0x2f4 0x6dc 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_CMD__UART3_TX_DATA           0x2f4 0x6dc 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_CMD__UART3_RX_DATA           0x2f4 0x6dc 0x930 0x2 0x2
+#define MX6QDL_PAD_SD4_CMD__GPIO7_IO09              0x2f4 0x6dc 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_CLK__SD4_CLK                 0x2f8 0x6e0 0x000 0x0 0x0
+#define MX6QDL_PAD_SD4_CLK__NAND_WE_B               0x2f8 0x6e0 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_CLK__UART3_RX_DATA           0x2f8 0x6e0 0x930 0x2 0x3
+#define MX6QDL_PAD_SD4_CLK__UART3_TX_DATA           0x2f8 0x6e0 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_CLK__GPIO7_IO10              0x2f8 0x6e0 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D0__NAND_DATA00            0x2fc 0x6e4 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D0__SD1_DATA4              0x2fc 0x6e4 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D0__GPIO2_IO00             0x2fc 0x6e4 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D1__NAND_DATA01            0x300 0x6e8 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D1__SD1_DATA5              0x300 0x6e8 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D1__GPIO2_IO01             0x300 0x6e8 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D2__NAND_DATA02            0x304 0x6ec 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D2__SD1_DATA6              0x304 0x6ec 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D2__GPIO2_IO02             0x304 0x6ec 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D3__NAND_DATA03            0x308 0x6f0 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D3__SD1_DATA7              0x308 0x6f0 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D3__GPIO2_IO03             0x308 0x6f0 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D4__NAND_DATA04            0x30c 0x6f4 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D4__SD2_DATA4              0x30c 0x6f4 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D4__GPIO2_IO04             0x30c 0x6f4 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D5__NAND_DATA05            0x310 0x6f8 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D5__SD2_DATA5              0x310 0x6f8 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D5__GPIO2_IO05             0x310 0x6f8 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D6__NAND_DATA06            0x314 0x6fc 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D6__SD2_DATA6              0x314 0x6fc 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D6__GPIO2_IO06             0x314 0x6fc 0x000 0x5 0x0
+#define MX6QDL_PAD_NANDF_D7__NAND_DATA07            0x318 0x700 0x000 0x0 0x0
+#define MX6QDL_PAD_NANDF_D7__SD2_DATA7              0x318 0x700 0x000 0x1 0x0
+#define MX6QDL_PAD_NANDF_D7__GPIO2_IO07             0x318 0x700 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT0__SD4_DATA0              0x31c 0x704 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT0__NAND_DQS               0x31c 0x704 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT0__GPIO2_IO08             0x31c 0x704 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT1__SD4_DATA1              0x320 0x708 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT1__PWM3_OUT               0x320 0x708 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT1__GPIO2_IO09             0x320 0x708 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT2__SD4_DATA2              0x324 0x70c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT2__PWM4_OUT               0x324 0x70c 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT2__GPIO2_IO10             0x324 0x70c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT3__SD4_DATA3              0x328 0x710 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT3__GPIO2_IO11             0x328 0x710 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT4__SD4_DATA4              0x32c 0x714 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA          0x32c 0x714 0x928 0x2 0x6
+#define MX6QDL_PAD_SD4_DAT4__UART2_TX_DATA          0x32c 0x714 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT4__GPIO2_IO12             0x32c 0x714 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT5__SD4_DATA5              0x330 0x718 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT5__UART2_RTS_B            0x330 0x718 0x924 0x2 0x4
+#define MX6QDL_PAD_SD4_DAT5__UART2_CTS_B            0x330 0x718 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT5__GPIO2_IO13             0x330 0x718 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT6__SD4_DATA6              0x334 0x71c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT6__UART2_CTS_B            0x334 0x71c 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT6__UART2_RTS_B            0x334 0x71c 0x924 0x2 0x5
+#define MX6QDL_PAD_SD4_DAT6__GPIO2_IO14             0x334 0x71c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD4_DAT7__SD4_DATA7              0x338 0x720 0x000 0x1 0x0
+#define MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA          0x338 0x720 0x000 0x2 0x0
+#define MX6QDL_PAD_SD4_DAT7__UART2_RX_DATA          0x338 0x720 0x928 0x2 0x7
+#define MX6QDL_PAD_SD4_DAT7__GPIO2_IO15             0x338 0x720 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT1__SD1_DATA1              0x33c 0x724 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT1__ECSPI5_SS0             0x33c 0x724 0x834 0x1 0x1
+#define MX6QDL_PAD_SD1_DAT1__PWM3_OUT               0x33c 0x724 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_DAT1__GPT_CAPTURE2           0x33c 0x724 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT1__GPIO1_IO17             0x33c 0x724 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT0__SD1_DATA0              0x340 0x728 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT0__ECSPI5_MISO            0x340 0x728 0x82c 0x1 0x1
+#define MX6QDL_PAD_SD1_DAT0__GPT_CAPTURE1           0x340 0x728 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT0__GPIO1_IO16             0x340 0x728 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT3__SD1_DATA3              0x344 0x72c 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT3__ECSPI5_SS2             0x344 0x72c 0x000 0x1 0x0
+#define MX6QDL_PAD_SD1_DAT3__GPT_COMPARE3           0x344 0x72c 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_DAT3__PWM1_OUT               0x344 0x72c 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT3__WDOG2_B                0x344 0x72c 0x000 0x4 0x0
+#define MX6QDL_PAD_SD1_DAT3__GPIO1_IO21             0x344 0x72c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT3__WDOG2_RESET_B_DEB      0x344 0x72c 0x000 0x6 0x0
+#define MX6QDL_PAD_SD1_CMD__SD1_CMD                 0x348 0x730 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_CMD__ECSPI5_MOSI             0x348 0x730 0x830 0x1 0x0
+#define MX6QDL_PAD_SD1_CMD__PWM4_OUT                0x348 0x730 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_CMD__GPT_COMPARE1            0x348 0x730 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_CMD__GPIO1_IO18              0x348 0x730 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT2__SD1_DATA2              0x34c 0x734 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_DAT2__ECSPI5_SS1             0x34c 0x734 0x838 0x1 0x1
+#define MX6QDL_PAD_SD1_DAT2__GPT_COMPARE2           0x34c 0x734 0x000 0x2 0x0
+#define MX6QDL_PAD_SD1_DAT2__PWM2_OUT               0x34c 0x734 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_DAT2__WDOG1_B                0x34c 0x734 0x000 0x4 0x0
+#define MX6QDL_PAD_SD1_DAT2__GPIO1_IO19             0x34c 0x734 0x000 0x5 0x0
+#define MX6QDL_PAD_SD1_DAT2__WDOG1_RESET_B_DEB      0x34c 0x734 0x000 0x6 0x0
+#define MX6QDL_PAD_SD1_CLK__SD1_CLK                 0x350 0x738 0x000 0x0 0x0
+#define MX6QDL_PAD_SD1_CLK__ECSPI5_SCLK             0x350 0x738 0x828 0x1 0x0
+#define MX6QDL_PAD_SD1_CLK__GPT_CLKIN               0x350 0x738 0x000 0x3 0x0
+#define MX6QDL_PAD_SD1_CLK__GPIO1_IO20              0x350 0x738 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_CLK__SD2_CLK                 0x354 0x73c 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_CLK__ECSPI5_SCLK             0x354 0x73c 0x828 0x1 0x1
+#define MX6QDL_PAD_SD2_CLK__KEY_COL5                0x354 0x73c 0x8e8 0x2 0x3
+#define MX6QDL_PAD_SD2_CLK__AUD4_RXFS               0x354 0x73c 0x7c0 0x3 0x1
+#define MX6QDL_PAD_SD2_CLK__GPIO1_IO10              0x354 0x73c 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_CMD__SD2_CMD                 0x358 0x740 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_CMD__ECSPI5_MOSI             0x358 0x740 0x830 0x1 0x1
+#define MX6QDL_PAD_SD2_CMD__KEY_ROW5                0x358 0x740 0x8f4 0x2 0x2
+#define MX6QDL_PAD_SD2_CMD__AUD4_RXC                0x358 0x740 0x7bc 0x3 0x1
+#define MX6QDL_PAD_SD2_CMD__GPIO1_IO11              0x358 0x740 0x000 0x5 0x0
+#define MX6QDL_PAD_SD2_DAT3__SD2_DATA3              0x35c 0x744 0x000 0x0 0x0
+#define MX6QDL_PAD_SD2_DAT3__ECSPI5_SS3             0x35c 0x744 0x000 0x1 0x0
+#define MX6QDL_PAD_SD2_DAT3__KEY_COL6               0x35c 0x744 0x8ec 0x2 0x2
+#define MX6QDL_PAD_SD2_DAT3__AUD4_TXC               0x35c 0x744 0x7c4 0x3 0x1
+#define MX6QDL_PAD_SD2_DAT3__GPIO1_IO12             0x35c 0x744 0x000 0x5 0x0
 
 #endif /* __DTS_IMX6Q_PINFUNC_H */
index 09a7580..334b924 100644 (file)
        compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
 };
 
-&iomuxc {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_hog>;
-
-       hog {
-               pinctrl_hog: hoggrp {
-                       fsl,pins = <
-                               MX6Q_PAD_NANDF_CS2__GPIO6_IO15 0x80000000
-                               MX6Q_PAD_SD2_DAT2__GPIO1_IO13  0x80000000
-                       >;
-               };
-       };
-
-       ecspi1 {
-               pinctrl_ecspi1_sabreauto: ecspi1-sabreauto {
-                       fsl,pins = <
-                               MX6Q_PAD_EIM_D19__GPIO3_IO19  0x80000000
-                       >;
-               };
-       };
+&sata {
+       status = "okay";
 };
index 6a00066..3530280 100644 (file)
        };
 };
 
+&sata {
+       status = "okay";
+};
+
 &ecspi1 {
        fsl,spi-num-chipselects = <1>;
        cs-gpios = <&gpio3 19 0>;
        hog {
                pinctrl_hog: hoggrp {
                        fsl,pins = <
-                               MX6Q_PAD_NANDF_D6__GPIO2_IO06 0x80000000
-                               MX6Q_PAD_NANDF_D7__GPIO2_IO07 0x80000000
-                               MX6Q_PAD_EIM_D19__GPIO3_IO19  0x80000000
-                               MX6Q_PAD_EIM_D22__GPIO3_IO22  0x80000000
-                               MX6Q_PAD_EIM_D23__GPIO3_IO23  0x80000000
-                               MX6Q_PAD_SD3_DAT5__GPIO7_IO00 0x80000000
-                               MX6Q_PAD_SD3_DAT4__GPIO7_IO01 0x1f0b0
-                               MX6Q_PAD_GPIO_0__CCM_CLKO1    0x80000000
+                               MX6QDL_PAD_NANDF_D6__GPIO2_IO06 0x80000000
+                               MX6QDL_PAD_NANDF_D7__GPIO2_IO07 0x80000000
+                               MX6QDL_PAD_EIM_D19__GPIO3_IO19  0x80000000
+                               MX6QDL_PAD_EIM_D22__GPIO3_IO22  0x80000000
+                               MX6QDL_PAD_EIM_D23__GPIO3_IO23  0x80000000
+                               MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x80000000
+                               MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1f0b0
+                               MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x80000000
                        >;
                };
        };
        codec: sgtl5000@0a {
                compatible = "fsl,sgtl5000";
                reg = <0x0a>;
-               clocks = <&clks 169>;
+               clocks = <&clks 201>;
                VDDA-supply = <&reg_2p5v>;
                VDDIO-supply = <&reg_3p3v>;
        };
index 0038228..9cbdfe7 100644 (file)
        compatible = "fsl,imx6q-sabresd", "fsl,imx6q";
 };
 
-&iomuxc {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_hog>;
-
-       hog {
-               pinctrl_hog: hoggrp {
-                       fsl,pins = <
-                               MX6Q_PAD_GPIO_4__GPIO1_IO04   0x80000000
-                               MX6Q_PAD_GPIO_5__GPIO1_IO05   0x80000000
-                               MX6Q_PAD_NANDF_D0__GPIO2_IO00 0x80000000
-                               MX6Q_PAD_NANDF_D1__GPIO2_IO01 0x80000000
-                               MX6Q_PAD_NANDF_D2__GPIO2_IO02 0x80000000
-                               MX6Q_PAD_NANDF_D3__GPIO2_IO03 0x80000000
-                               MX6Q_PAD_GPIO_0__CCM_CLKO1    0x130b0
-                       >;
-               };
-       };
+&sata {
+       status = "okay";
 };
diff --git a/arch/arm/boot/dts/imx6q-wandboard.dts b/arch/arm/boot/dts/imx6q-wandboard.dts
new file mode 100644 (file)
index 0000000..36be17f
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam <fabio.estevam@freescale.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 "imx6q.dtsi"
+#include "imx6qdl-wandboard.dtsi"
+
+/ {
+       model = "Wandboard i.MX6 Quad Board";
+       compatible = "wand,imx6q-wandboard", "fsl,imx6q";
+
+       memory {
+               reg = <0x10000000 0x80000000>;
+       };
+};
+
+&sata {
+       status = "okay";
+};
index ba09dc3..f024ef2 100644 (file)
@@ -8,8 +8,8 @@
  *
  */
 
-#include "imx6qdl.dtsi"
 #include "imx6q-pinfunc.h"
+#include "imx6qdl.dtsi"
 
 / {
        cpus {
        };
 
        soc {
+               ocram: sram@00900000 {
+                       compatible = "mmio-sram";
+                       reg = <0x00900000 0x40000>;
+                       clocks = <&clks 142>;
+               };
+
                aips-bus@02000000 { /* AIPS1 */
                        spba-bus@02000000 {
                                ecspi5: ecspi@02018000 {
 
                        iomuxc: iomuxc@020e0000 {
                                compatible = "fsl,imx6q-iomuxc";
-                               reg = <0x020e0000 0x4000>;
-
-                               /* shared pinctrl settings */
-                               audmux {
-                                       pinctrl_audmux_1: audmux-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_SD2_DAT0__AUD4_RXD  0x80000000
-                                                       MX6Q_PAD_SD2_DAT3__AUD4_TXC  0x80000000
-                                                       MX6Q_PAD_SD2_DAT2__AUD4_TXD  0x80000000
-                                                       MX6Q_PAD_SD2_DAT1__AUD4_TXFS 0x80000000
-                                               >;
-                                       };
-
-                                       pinctrl_audmux_2: audmux-2 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_CSI0_DAT7__AUD3_RXD  0x80000000
-                                                       MX6Q_PAD_CSI0_DAT4__AUD3_TXC  0x80000000
-                                                       MX6Q_PAD_CSI0_DAT5__AUD3_TXD  0x80000000
-                                                       MX6Q_PAD_CSI0_DAT6__AUD3_TXFS 0x80000000
-                                               >;
-                                       };
-                               };
-
-                               ecspi1 {
-                                       pinctrl_ecspi1_1: ecspi1grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_EIM_D17__ECSPI1_MISO 0x100b1
-                                                       MX6Q_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
-                                                       MX6Q_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
-                                               >;
-                                       };
-                               };
-
-                               ecspi3 {
-                                       pinctrl_ecspi3_1: ecspi3grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_DISP0_DAT2__ECSPI3_MISO 0x100b1
-                                                       MX6Q_PAD_DISP0_DAT1__ECSPI3_MOSI 0x100b1
-                                                       MX6Q_PAD_DISP0_DAT0__ECSPI3_SCLK 0x100b1
-                                               >;
-                                       };
-                               };
-
-                               enet {
-                                       pinctrl_enet_1: enetgrp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_ENET_MDIO__ENET_MDIO       0x1b0b0
-                                                       MX6Q_PAD_ENET_MDC__ENET_MDC         0x1b0b0
-                                                       MX6Q_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
-                                                       MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
-                                                       MX6Q_PAD_RGMII_RXC__RGMII_RXC       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD0__RGMII_RD0       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD1__RGMII_RD1       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD2__RGMII_RD2       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD3__RGMII_RD3       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
-                                                       MX6Q_PAD_GPIO_16__ENET_REF_CLK      0x4001b0a8
-                                               >;
-                                       };
-
-                                       pinctrl_enet_2: enetgrp-2 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_KEY_COL1__ENET_MDIO        0x1b0b0
-                                                       MX6Q_PAD_KEY_COL2__ENET_MDC         0x1b0b0
-                                                       MX6Q_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
-                                                       MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
-                                                       MX6Q_PAD_RGMII_RXC__RGMII_RXC       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD0__RGMII_RD0       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD1__RGMII_RD1       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD2__RGMII_RD2       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD3__RGMII_RD3       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
-                                               >;
-                                       };
-
-                                       pinctrl_enet_3: enetgrp-3 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_ENET_MDIO__ENET_MDIO       0x1b0b0
-                                                       MX6Q_PAD_ENET_MDC__ENET_MDC         0x1b0b0
-                                                       MX6Q_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
-                                                       MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
-                                                       MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
-                                                       MX6Q_PAD_RGMII_RXC__RGMII_RXC       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD0__RGMII_RD0       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD1__RGMII_RD1       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD2__RGMII_RD2       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RD3__RGMII_RD3       0x1b0b0
-                                                       MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
-                                                       MX6Q_PAD_ENET_TX_EN__ENET_TX_EN     0x1b0b0
-                                               >;
-                                       };
-                               };
-
-                               gpmi-nand {
-                                       pinctrl_gpmi_nand_1: gpmi-nand-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_NANDF_CLE__NAND_CLE     0xb0b1
-                                                       MX6Q_PAD_NANDF_ALE__NAND_ALE     0xb0b1
-                                                       MX6Q_PAD_NANDF_WP_B__NAND_WP_B   0xb0b1
-                                                       MX6Q_PAD_NANDF_RB0__NAND_READY_B 0xb000
-                                                       MX6Q_PAD_NANDF_CS0__NAND_CE0_B   0xb0b1
-                                                       MX6Q_PAD_NANDF_CS1__NAND_CE1_B   0xb0b1
-                                                       MX6Q_PAD_SD4_CMD__NAND_RE_B      0xb0b1
-                                                       MX6Q_PAD_SD4_CLK__NAND_WE_B      0xb0b1
-                                                       MX6Q_PAD_NANDF_D0__NAND_DATA00   0xb0b1
-                                                       MX6Q_PAD_NANDF_D1__NAND_DATA01   0xb0b1
-                                                       MX6Q_PAD_NANDF_D2__NAND_DATA02   0xb0b1
-                                                       MX6Q_PAD_NANDF_D3__NAND_DATA03   0xb0b1
-                                                       MX6Q_PAD_NANDF_D4__NAND_DATA04   0xb0b1
-                                                       MX6Q_PAD_NANDF_D5__NAND_DATA05   0xb0b1
-                                                       MX6Q_PAD_NANDF_D6__NAND_DATA06   0xb0b1
-                                                       MX6Q_PAD_NANDF_D7__NAND_DATA07   0xb0b1
-                                                       MX6Q_PAD_SD4_DAT0__NAND_DQS      0x00b1
-                                               >;
-                                       };
-                               };
-
-                               i2c1 {
-                                       pinctrl_i2c1_1: i2c1grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
-                                                       MX6Q_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
-                                               >;
-                                       };
 
-                                       pinctrl_i2c1_2: i2c1grp-2 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
-                                                       MX6Q_PAD_CSI0_DAT9__I2C1_SCL 0x4001b8b1
-                                               >;
-                                       };
-                               };
-
-                               i2c2 {
-                                       pinctrl_i2c2_1: i2c2grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
-                                                       MX6Q_PAD_EIM_D16__I2C2_SDA 0x4001b8b1
+                               ipu2 {
+                                       pinctrl_ipu2_1: ipu2grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_DI0_DISP_CLK__IPU2_DI0_DISP_CLK 0x10
+                                                       MX6QDL_PAD_DI0_PIN15__IPU2_DI0_PIN15       0x10
+                                                       MX6QDL_PAD_DI0_PIN2__IPU2_DI0_PIN02        0x10
+                                                       MX6QDL_PAD_DI0_PIN3__IPU2_DI0_PIN03        0x10
+                                                       MX6QDL_PAD_DI0_PIN4__IPU2_DI0_PIN04        0x80000000
+                                                       MX6QDL_PAD_DISP0_DAT0__IPU2_DISP0_DATA00   0x10
+                                                       MX6QDL_PAD_DISP0_DAT1__IPU2_DISP0_DATA01   0x10
+                                                       MX6QDL_PAD_DISP0_DAT2__IPU2_DISP0_DATA02   0x10
+                                                       MX6QDL_PAD_DISP0_DAT3__IPU2_DISP0_DATA03   0x10
+                                                       MX6QDL_PAD_DISP0_DAT4__IPU2_DISP0_DATA04   0x10
+                                                       MX6QDL_PAD_DISP0_DAT5__IPU2_DISP0_DATA05   0x10
+                                                       MX6QDL_PAD_DISP0_DAT6__IPU2_DISP0_DATA06   0x10
+                                                       MX6QDL_PAD_DISP0_DAT7__IPU2_DISP0_DATA07   0x10
+                                                       MX6QDL_PAD_DISP0_DAT8__IPU2_DISP0_DATA08   0x10
+                                                       MX6QDL_PAD_DISP0_DAT9__IPU2_DISP0_DATA09   0x10
+                                                       MX6QDL_PAD_DISP0_DAT10__IPU2_DISP0_DATA10  0x10
+                                                       MX6QDL_PAD_DISP0_DAT11__IPU2_DISP0_DATA11  0x10
+                                                       MX6QDL_PAD_DISP0_DAT12__IPU2_DISP0_DATA12  0x10
+                                                       MX6QDL_PAD_DISP0_DAT13__IPU2_DISP0_DATA13  0x10
+                                                       MX6QDL_PAD_DISP0_DAT14__IPU2_DISP0_DATA14  0x10
+                                                       MX6QDL_PAD_DISP0_DAT15__IPU2_DISP0_DATA15  0x10
+                                                       MX6QDL_PAD_DISP0_DAT16__IPU2_DISP0_DATA16  0x10
+                                                       MX6QDL_PAD_DISP0_DAT17__IPU2_DISP0_DATA17  0x10
+                                                       MX6QDL_PAD_DISP0_DAT18__IPU2_DISP0_DATA18  0x10
+                                                       MX6QDL_PAD_DISP0_DAT19__IPU2_DISP0_DATA19  0x10
+                                                       MX6QDL_PAD_DISP0_DAT20__IPU2_DISP0_DATA20  0x10
+                                                       MX6QDL_PAD_DISP0_DAT21__IPU2_DISP0_DATA21  0x10
+                                                       MX6QDL_PAD_DISP0_DAT22__IPU2_DISP0_DATA22  0x10
+                                                       MX6QDL_PAD_DISP0_DAT23__IPU2_DISP0_DATA23  0x10
                                                >;
                                        };
                                };
-
-                               i2c3 {
-                                       pinctrl_i2c3_1: i2c3grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_EIM_D17__I2C3_SCL 0x4001b8b1
-                                                       MX6Q_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
-                                               >;
-                                       };
-                               };
-
-                               uart1 {
-                                       pinctrl_uart1_1: uart1grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
-                                                       MX6Q_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
-                                               >;
-                                       };
-                               };
-
-                               uart2 {
-                                       pinctrl_uart2_1: uart2grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
-                                                       MX6Q_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
-                                               >;
-                                       };
-                               };
-
-                               uart4 {
-                                       pinctrl_uart4_1: uart4grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
-                                                       MX6Q_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
-                                               >;
-                                       };
-                               };
-
-                               usbotg {
-                                       pinctrl_usbotg_1: usbotggrp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_GPIO_1__USB_OTG_ID 0x17059
-                                               >;
-                                       };
-
-                                       pinctrl_usbotg_2: usbotggrp-2 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
-                                               >;
-                                       };
-                               };
-
-                               usdhc2 {
-                                       pinctrl_usdhc2_1: usdhc2grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_SD2_CMD__SD2_CMD    0x17059
-                                                       MX6Q_PAD_SD2_CLK__SD2_CLK    0x10059
-                                                       MX6Q_PAD_SD2_DAT0__SD2_DATA0 0x17059
-                                                       MX6Q_PAD_SD2_DAT1__SD2_DATA1 0x17059
-                                                       MX6Q_PAD_SD2_DAT2__SD2_DATA2 0x17059
-                                                       MX6Q_PAD_SD2_DAT3__SD2_DATA3 0x17059
-                                                       MX6Q_PAD_NANDF_D4__SD2_DATA4 0x17059
-                                                       MX6Q_PAD_NANDF_D5__SD2_DATA5 0x17059
-                                                       MX6Q_PAD_NANDF_D6__SD2_DATA6 0x17059
-                                                       MX6Q_PAD_NANDF_D7__SD2_DATA7 0x17059
-                                               >;
-                                       };
-
-                                       pinctrl_usdhc2_2: usdhc2grp-2 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_SD2_CMD__SD2_CMD    0x17059
-                                                       MX6Q_PAD_SD2_CLK__SD2_CLK    0x10059
-                                                       MX6Q_PAD_SD2_DAT0__SD2_DATA0 0x17059
-                                                       MX6Q_PAD_SD2_DAT1__SD2_DATA1 0x17059
-                                                       MX6Q_PAD_SD2_DAT2__SD2_DATA2 0x17059
-                                                       MX6Q_PAD_SD2_DAT3__SD2_DATA3 0x17059
-                                               >;
-                                       };
-                               };
-
-                               usdhc3 {
-                                       pinctrl_usdhc3_1: usdhc3grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_SD3_CMD__SD3_CMD    0x17059
-                                                       MX6Q_PAD_SD3_CLK__SD3_CLK    0x10059
-                                                       MX6Q_PAD_SD3_DAT0__SD3_DATA0 0x17059
-                                                       MX6Q_PAD_SD3_DAT1__SD3_DATA1 0x17059
-                                                       MX6Q_PAD_SD3_DAT2__SD3_DATA2 0x17059
-                                                       MX6Q_PAD_SD3_DAT3__SD3_DATA3 0x17059
-                                                       MX6Q_PAD_SD3_DAT4__SD3_DATA4 0x17059
-                                                       MX6Q_PAD_SD3_DAT5__SD3_DATA5 0x17059
-                                                       MX6Q_PAD_SD3_DAT6__SD3_DATA6 0x17059
-                                                       MX6Q_PAD_SD3_DAT7__SD3_DATA7 0x17059
-                                               >;
-                                       };
-
-                                       pinctrl_usdhc3_2: usdhc3grp-2 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_SD3_CMD__SD3_CMD    0x17059
-                                                       MX6Q_PAD_SD3_CLK__SD3_CLK    0x10059
-                                                       MX6Q_PAD_SD3_DAT0__SD3_DATA0 0x17059
-                                                       MX6Q_PAD_SD3_DAT1__SD3_DATA1 0x17059
-                                                       MX6Q_PAD_SD3_DAT2__SD3_DATA2 0x17059
-                                                       MX6Q_PAD_SD3_DAT3__SD3_DATA3 0x17059
-                                               >;
-                                       };
-                               };
-
-                               usdhc4 {
-                                       pinctrl_usdhc4_1: usdhc4grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_SD4_CMD__SD4_CMD    0x17059
-                                                       MX6Q_PAD_SD4_CLK__SD4_CLK    0x10059
-                                                       MX6Q_PAD_SD4_DAT0__SD4_DATA0 0x17059
-                                                       MX6Q_PAD_SD4_DAT1__SD4_DATA1 0x17059
-                                                       MX6Q_PAD_SD4_DAT2__SD4_DATA2 0x17059
-                                                       MX6Q_PAD_SD4_DAT3__SD4_DATA3 0x17059
-                                                       MX6Q_PAD_SD4_DAT4__SD4_DATA4 0x17059
-                                                       MX6Q_PAD_SD4_DAT5__SD4_DATA5 0x17059
-                                                       MX6Q_PAD_SD4_DAT6__SD4_DATA6 0x17059
-                                                       MX6Q_PAD_SD4_DAT7__SD4_DATA7 0x17059
-                                               >;
-                                       };
-
-                                       pinctrl_usdhc4_2: usdhc4grp-2 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_SD4_CMD__SD4_CMD    0x17059
-                                                       MX6Q_PAD_SD4_CLK__SD4_CLK    0x10059
-                                                       MX6Q_PAD_SD4_DAT0__SD4_DATA0 0x17059
-                                                       MX6Q_PAD_SD4_DAT1__SD4_DATA1 0x17059
-                                                       MX6Q_PAD_SD4_DAT2__SD4_DATA2 0x17059
-                                                       MX6Q_PAD_SD4_DAT3__SD4_DATA3 0x17059
-                                               >;
-                                       };
-                               };
-
-                               weim {
-                                       pinctrl_weim_cs0_1: weim_cs0grp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_EIM_CS0__EIM_CS0_B   0xb0b1
-                                               >;
-                                       };
-
-                                       pinctrl_weim_nor_1: weimnorgrp-1 {
-                                               fsl,pins = <
-                                                       MX6Q_PAD_EIM_OE__EIM_OE_B     0xb0b1
-                                                       MX6Q_PAD_EIM_RW__EIM_RW       0xb0b1
-                                                       MX6Q_PAD_EIM_WAIT__EIM_WAIT_B 0xb060
-                                                       /* data */
-                                                       MX6Q_PAD_EIM_D16__EIM_DATA16 0x1b0b0
-                                                       MX6Q_PAD_EIM_D17__EIM_DATA17 0x1b0b0
-                                                       MX6Q_PAD_EIM_D18__EIM_DATA18 0x1b0b0
-                                                       MX6Q_PAD_EIM_D19__EIM_DATA19 0x1b0b0
-                                                       MX6Q_PAD_EIM_D20__EIM_DATA20 0x1b0b0
-                                                       MX6Q_PAD_EIM_D21__EIM_DATA21 0x1b0b0
-                                                       MX6Q_PAD_EIM_D22__EIM_DATA22 0x1b0b0
-                                                       MX6Q_PAD_EIM_D23__EIM_DATA23 0x1b0b0
-                                                       MX6Q_PAD_EIM_D24__EIM_DATA24 0x1b0b0
-                                                       MX6Q_PAD_EIM_D25__EIM_DATA25 0x1b0b0
-                                                       MX6Q_PAD_EIM_D26__EIM_DATA26 0x1b0b0
-                                                       MX6Q_PAD_EIM_D27__EIM_DATA27 0x1b0b0
-                                                       MX6Q_PAD_EIM_D28__EIM_DATA28 0x1b0b0
-                                                       MX6Q_PAD_EIM_D29__EIM_DATA29 0x1b0b0
-                                                       MX6Q_PAD_EIM_D30__EIM_DATA30 0x1b0b0
-                                                       MX6Q_PAD_EIM_D31__EIM_DATA31 0x1b0b0
-                                                       /* address */
-                                                       MX6Q_PAD_EIM_A23__EIM_ADDR23 0xb0b1
-                                                       MX6Q_PAD_EIM_A22__EIM_ADDR22 0xb0b1
-                                                       MX6Q_PAD_EIM_A21__EIM_ADDR21 0xb0b1
-                                                       MX6Q_PAD_EIM_A20__EIM_ADDR20 0xb0b1
-                                                       MX6Q_PAD_EIM_A19__EIM_ADDR19 0xb0b1
-                                                       MX6Q_PAD_EIM_A18__EIM_ADDR18 0xb0b1
-                                                       MX6Q_PAD_EIM_A17__EIM_ADDR17 0xb0b1
-                                                       MX6Q_PAD_EIM_A16__EIM_ADDR16 0xb0b1
-                                                       MX6Q_PAD_EIM_DA15__EIM_AD15  0xb0b1
-                                                       MX6Q_PAD_EIM_DA14__EIM_AD14  0xb0b1
-                                                       MX6Q_PAD_EIM_DA13__EIM_AD13  0xb0b1
-                                                       MX6Q_PAD_EIM_DA12__EIM_AD12  0xb0b1
-                                                       MX6Q_PAD_EIM_DA11__EIM_AD11  0xb0b1
-                                                       MX6Q_PAD_EIM_DA10__EIM_AD10  0xb0b1
-                                                       MX6Q_PAD_EIM_DA9__EIM_AD09   0xb0b1
-                                                       MX6Q_PAD_EIM_DA8__EIM_AD08   0xb0b1
-                                                       MX6Q_PAD_EIM_DA7__EIM_AD07   0xb0b1
-                                                       MX6Q_PAD_EIM_DA6__EIM_AD06   0xb0b1
-                                                       MX6Q_PAD_EIM_DA5__EIM_AD05   0xb0b1
-                                                       MX6Q_PAD_EIM_DA4__EIM_AD04   0xb0b1
-                                                       MX6Q_PAD_EIM_DA3__EIM_AD03   0xb0b1
-                                                       MX6Q_PAD_EIM_DA2__EIM_AD02   0xb0b1
-                                                       MX6Q_PAD_EIM_DA1__EIM_AD01   0xb0b1
-                                                       MX6Q_PAD_EIM_DA0__EIM_AD00   0xb0b1
-                                               >;
-                                       };
-
-                               };
                        };
                };
 
+               sata: sata@02200000 {
+                       compatible = "fsl,imx6q-ahci";
+                       reg = <0x02200000 0x4000>;
+                       interrupts = <0 39 0x04>;
+                       clocks =  <&clks 154>, <&clks 187>, <&clks 105>;
+                       clock-names = "sata", "sata_ref", "ahb";
+                       status = "disabled";
+               };
+
                ipu2: ipu@02800000 {
                        #crtc-cells = <1>;
                        compatible = "fsl,imx6q-ipu";
index e994011..1cbbc51 100644 (file)
        status = "okay";
 };
 
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hog>;
+
+       hog {
+               pinctrl_hog: hoggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_NANDF_CS2__GPIO6_IO15 0x80000000
+                               MX6QDL_PAD_SD2_DAT2__GPIO1_IO13  0x80000000
+                       >;
+               };
+       };
+
+       ecspi1 {
+               pinctrl_ecspi1_sabreauto: ecspi1-sabreauto {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x80000000
+                       >;
+               };
+       };
+};
+
 &uart4 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart4_1>;
index 6e5dfdb..39eafc2 100644 (file)
                        enable-active-high;
                };
 
+               reg_usb_h1_vbus: usb_h1_vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb_h1_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio1 29 0>;
+                       enable-active-high;
+               };
+
                reg_audio: wm8962_supply {
                        compatible = "regulator-fixed";
                        regulator-name = "wm8962-supply";
                volume-up {
                        label = "Volume Up";
                        gpios = <&gpio1 4 0>;
+                       gpio-key,wakeup;
                        linux,code = <115>; /* KEY_VOLUMEUP */
                };
 
                volume-down {
                        label = "Volume Down";
                        gpios = <&gpio1 5 0>;
+                       gpio-key,wakeup;
                        linux,code = <114>; /* KEY_VOLUMEDOWN */
                };
        };
        status = "okay";
 };
 
+&ecspi1 {
+       fsl,spi-num-chipselects = <1>;
+       cs-gpios = <&gpio4 9 0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1_2>;
+       status = "okay";
+
+       flash: m25p80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "st,m25p32";
+               spi-max-frequency = <20000000>;
+               reg = <0>;
+       };
+};
+
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet_1>;
        codec: wm8962@1a {
                compatible = "wlf,wm8962";
                reg = <0x1a>;
-               clocks = <&clks 169>;
+               clocks = <&clks 201>;
                DCVDD-supply = <&reg_audio>;
                DBVDD-supply = <&reg_audio>;
                AVDD-supply = <&reg_audio>;
        };
 };
 
+&i2c3 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3_2>;
+       status = "okay";
+
+       egalax_ts@04 {
+               compatible = "eeti,egalax_ts";
+               reg = <0x04>;
+               interrupt-parent = <&gpio6>;
+               interrupts = <7 2>;
+               wakeup-gpios = <&gpio6 7 0>;
+       };
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hog>;
+
+       hog {
+               pinctrl_hog: hoggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_4__GPIO1_IO04   0x80000000
+                               MX6QDL_PAD_GPIO_5__GPIO1_IO05   0x80000000
+                               MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x80000000
+                               MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000
+                               MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000
+                               MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x80000000
+                               MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x130b0
+                               MX6QDL_PAD_NANDF_CLE__GPIO6_IO07 0x80000000
+                               MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000
+                               MX6QDL_PAD_EIM_D22__GPIO3_IO22  0x80000000
+                       >;
+               };
+       };
+};
+
+&ldb {
+       status = "okay";
+
+       lvds-channel@1 {
+               fsl,data-mapping = "spwg";
+               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>;
+                       };
+               };
+       };
+};
+
 &ssi2 {
        fsl,mode = "i2s-slave";
        status = "okay";
 };
 
 &usbh1 {
+       vbus-supply = <&reg_usb_h1_vbus>;
        status = "okay";
 };
 
diff --git a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
new file mode 100644 (file)
index 0000000..a55113e
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam <fabio.estevam@freescale.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.
+ *
+ */
+
+/ {
+       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;
+               };
+       };
+
+       sound {
+               compatible = "fsl,imx6-wandboard-sgtl5000",
+                            "fsl,imx-audio-sgtl5000";
+               model = "imx6-wandboard-sgtl5000";
+               ssi-controller = <&ssi1>;
+               audio-codec = <&codec>;
+               audio-routing =
+                       "MIC_IN", "Mic Jack",
+                       "Mic Jack", "Mic Bias",
+                       "Headphone Jack", "HP_OUT";
+               mux-int-port = <1>;
+               mux-ext-port = <3>;
+       };
+};
+
+&audmux {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_audmux_2>;
+       status = "okay";
+};
+
+&i2c2 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2_2>;
+       status = "okay";
+
+       codec: sgtl5000@0a {
+               compatible = "fsl,sgtl5000";
+               reg = <0x0a>;
+               clocks = <&clks 201>;
+               VDDA-supply = <&reg_2p5v>;
+               VDDIO-supply = <&reg_3p3v>;
+       };
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hog>;
+
+       hog {
+               pinctrl_hog: hoggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_0__CCM_CLKO1     0x130b0
+                               MX6QDL_PAD_GPIO_2__GPIO1_IO02    0x80000000
+                               MX6QDL_PAD_EIM_DA9__GPIO3_IO09   0x80000000
+                               MX6QDL_PAD_EIM_EB1__GPIO2_IO29   0x80000000 /* WL_REF_ON */
+                               MX6QDL_PAD_EIM_A25__GPIO5_IO02   0x80000000 /* WL_RST_N */
+                               MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x80000000 /* WL_REG_ON */
+                               MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 /* WL_HOST_WAKE */
+                               MX6QDL_PAD_ENET_TXD0__GPIO1_IO30 0x80000000 /* WL_WAKE */
+                       >;
+               };
+       };
+};
+
+&fec {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_enet_1>;
+       phy-mode = "rgmii";
+       status = "okay";
+};
+
+&ssi1 {
+       fsl,mode = "i2s-slave";
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1_1>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3_2>;
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
+
+&usbh1 {
+       status = "okay";
+};
+
+&usdhc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc1_2>;
+       cd-gpios = <&gpio1 2 0>;
+       status = "okay";
+};
+
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2_2>;
+       non-removable;
+       status = "okay";
+};
+
+&usdhc3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc3_2>;
+       cd-gpios = <&gpio3 9 0>;
+       status = "okay";
+};
index f21d259..ccd55c2 100644 (file)
 
 / {
        aliases {
-               serial0 = &uart1;
-               serial1 = &uart2;
-               serial2 = &uart3;
-               serial3 = &uart4;
-               serial4 = &uart5;
                gpio0 = &gpio1;
                gpio1 = &gpio2;
                gpio2 = &gpio3;
                gpio4 = &gpio5;
                gpio5 = &gpio6;
                gpio6 = &gpio7;
+               i2c0 = &i2c1;
+               i2c1 = &i2c2;
+               i2c2 = &i2c3;
+               serial0 = &uart1;
+               serial1 = &uart2;
+               serial2 = &uart3;
+               serial3 = &uart4;
+               serial4 = &uart5;
+               spi0 = &ecspi1;
+               spi1 = &ecspi2;
+               spi2 = &ecspi3;
+               spi3 = &ecspi4;
        };
 
        intc: interrupt-controller@00a01000 {
                        #size-cells = <1>;
                        reg = <0x00112000 0x2000>, <0x00114000 0x2000>;
                        reg-names = "gpmi-nand", "bch";
-                       interrupts = <0 13 0x04>, <0 15 0x04>;
-                       interrupt-names = "gpmi-dma", "bch";
+                       interrupts = <0 15 0x04>;
+                       interrupt-names = "bch";
                        clocks = <&clks 152>, <&clks 153>, <&clks 151>,
                                 <&clks 150>, <&clks 149>;
                        clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch",
                                      "gpmi_bch_apb", "per1_bch";
                        dmas = <&dma_apbh 0>;
                        dma-names = "rx-tx";
-                       fsl,gpmi-dma-channel = <0>;
                        status = "disabled";
                };
 
                                        interrupts = <0 26 0x04>;
                                        clocks = <&clks 160>, <&clks 161>;
                                        clock-names = "ipg", "per";
+                                       dmas = <&sdma 25 4 0>, <&sdma 26 4 0>;
+                                       dma-names = "rx", "tx";
                                        status = "disabled";
                                };
 
                                        reg = <0x02028000 0x4000>;
                                        interrupts = <0 46 0x04>;
                                        clocks = <&clks 178>;
+                                       dmas = <&sdma 37 1 0>,
+                                              <&sdma 38 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        fsl,ssi-dma-events = <38 37>;
                                        status = "disabled";
                                        reg = <0x0202c000 0x4000>;
                                        interrupts = <0 47 0x04>;
                                        clocks = <&clks 179>;
+                                       dmas = <&sdma 41 1 0>,
+                                              <&sdma 42 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        fsl,ssi-dma-events = <42 41>;
                                        status = "disabled";
                                        reg = <0x02030000 0x4000>;
                                        interrupts = <0 48 0x04>;
                                        clocks = <&clks 180>;
+                                       dmas = <&sdma 45 1 0>,
+                                              <&sdma 46 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        fsl,ssi-dma-events = <46 45>;
                                        status = "disabled";
                        };
 
                        can1: flexcan@02090000 {
+                               compatible = "fsl,imx6q-flexcan";
                                reg = <0x02090000 0x4000>;
                                interrupts = <0 110 0x04>;
+                               clocks = <&clks 108>, <&clks 109>;
+                               clock-names = "ipg", "per";
                        };
 
                        can2: flexcan@02094000 {
+                               compatible = "fsl,imx6q-flexcan";
                                reg = <0x02094000 0x4000>;
                                interrupts = <0 111 0x04>;
+                               clocks = <&clks 110>, <&clks 111>;
+                               clock-names = "ipg", "per";
                        };
 
                        gpt: gpt@02098000 {
-                               compatible = "fsl,imx6q-gpt";
+                               compatible = "fsl,imx6q-gpt", "fsl,imx31-gpt";
                                reg = <0x02098000 0x4000>;
                                interrupts = <0 55 0x04>;
                                clocks = <&clks 119>, <&clks 120>;
                                };
                        };
 
+                       tempmon: tempmon {
+                               compatible = "fsl,imx6q-tempmon";
+                               interrupts = <0 49 0x04>;
+                               fsl,tempmon = <&anatop>;
+                               fsl,tempmon-data = <&ocotp>;
+                       };
+
                        usbphy1: usbphy@020c9000 {
                                compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
                                reg = <0x020c9000 0x1000>;
                                reg = <0x020e0000 0x38>;
                        };
 
+                       iomuxc: iomuxc@020e0000 {
+                               compatible = "fsl,imx6dl-iomuxc", "fsl,imx6q-iomuxc";
+                               reg = <0x020e0000 0x4000>;
+
+                               audmux {
+                                       pinctrl_audmux_1: audmux-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_SD2_DAT0__AUD4_RXD  0x80000000
+                                                       MX6QDL_PAD_SD2_DAT3__AUD4_TXC  0x80000000
+                                                       MX6QDL_PAD_SD2_DAT2__AUD4_TXD  0x80000000
+                                                       MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x80000000
+                                               >;
+                                       };
+
+                                       pinctrl_audmux_2: audmux-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_CSI0_DAT7__AUD3_RXD  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT4__AUD3_TXC  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT5__AUD3_TXD  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x80000000
+                                               >;
+                                       };
+
+                                       pinctrl_audmux_3: audmux-3 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_DISP0_DAT16__AUD5_TXC  0x80000000
+                                                       MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS 0x80000000
+                                                       MX6QDL_PAD_DISP0_DAT19__AUD5_RXD  0x80000000
+                                               >;
+                                       };
+                               };
+
+                               ecspi1 {
+                                       pinctrl_ecspi1_1: ecspi1grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
+                                                       MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
+                                                       MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
+                                               >;
+                                       };
+
+                                       pinctrl_ecspi1_2: ecspi1grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_COL1__ECSPI1_MISO 0x100b1
+                                                       MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI 0x100b1
+                                                       MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK 0x100b1
+                                               >;
+                                       };
+                               };
+
+                               ecspi3 {
+                                       pinctrl_ecspi3_1: ecspi3grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO 0x100b1
+                                                       MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI 0x100b1
+                                                       MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK 0x100b1
+                                               >;
+                                       };
+                               };
+
+                               enet {
+                                       pinctrl_enet_1: enetgrp-1 {
+                                               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
+                                                       MX6QDL_PAD_GPIO_16__ENET_REF_CLK      0x4001b0a8
+                                               >;
+                                       };
+
+                                       pinctrl_enet_2: enetgrp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_COL1__ENET_MDIO        0x1b0b0
+                                                       MX6QDL_PAD_KEY_COL2__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_enet_3: enetgrp-3 {
+                                               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
+                                                       MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN     0x1b0b0
+                                               >;
+                                       };
+                               };
+
+                               esai {
+                                       pinctrl_esai_1: esaigrp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_ENET_RXD0__ESAI_TX_HF_CLK 0x1b030
+                                                       MX6QDL_PAD_ENET_CRS_DV__ESAI_TX_CLK  0x1b030
+                                                       MX6QDL_PAD_ENET_RXD1__ESAI_TX_FS     0x1b030
+                                                       MX6QDL_PAD_ENET_TX_EN__ESAI_TX3_RX2  0x1b030
+                                                       MX6QDL_PAD_ENET_TXD1__ESAI_TX2_RX3   0x1b030
+                                                       MX6QDL_PAD_ENET_TXD0__ESAI_TX4_RX1   0x1b030
+                                                       MX6QDL_PAD_ENET_MDC__ESAI_TX5_RX0    0x1b030
+                                                       MX6QDL_PAD_NANDF_CS2__ESAI_TX0       0x1b030
+                                                       MX6QDL_PAD_NANDF_CS3__ESAI_TX1       0x1b030
+                                               >;
+                                       };
+
+                                       pinctrl_esai_2: esaigrp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_ENET_CRS_DV__ESAI_TX_CLK 0x1b030
+                                                       MX6QDL_PAD_ENET_RXD1__ESAI_TX_FS    0x1b030
+                                                       MX6QDL_PAD_ENET_TX_EN__ESAI_TX3_RX2 0x1b030
+                                                       MX6QDL_PAD_GPIO_5__ESAI_TX2_RX3     0x1b030
+                                                       MX6QDL_PAD_ENET_TXD0__ESAI_TX4_RX1  0x1b030
+                                                       MX6QDL_PAD_ENET_MDC__ESAI_TX5_RX0   0x1b030
+                                                       MX6QDL_PAD_GPIO_17__ESAI_TX0        0x1b030
+                                                       MX6QDL_PAD_NANDF_CS3__ESAI_TX1      0x1b030
+                                                       MX6QDL_PAD_ENET_MDIO__ESAI_RX_CLK   0x1b030
+                                                       MX6QDL_PAD_GPIO_9__ESAI_RX_FS       0x1b030
+                                               >;
+                                       };
+                               };
+
+                               flexcan1 {
+                                       pinctrl_flexcan1_1: flexcan1grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x80000000
+                                                       MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX 0x80000000
+                                               >;
+                                       };
+
+                                       pinctrl_flexcan1_2: flexcan1grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_GPIO_7__FLEXCAN1_TX   0x80000000
+                                                       MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x80000000
+                                               >;
+                                       };
+                               };
+
+                               flexcan2 {
+                                       pinctrl_flexcan2_1: flexcan2grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX 0x80000000
+                                                       MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX 0x80000000
+                                               >;
+                                       };
+                               };
+
+                               gpmi-nand {
+                                       pinctrl_gpmi_nand_1: gpmi-nand-1 {
+                                               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
+                                                       MX6QDL_PAD_SD4_DAT0__NAND_DQS      0x00b1
+                                               >;
+                                       };
+                               };
+
+                               hdmi_hdcp {
+                                       pinctrl_hdmi_hdcp_1: hdmihdcpgrp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_COL3__HDMI_TX_DDC_SCL 0x4001b8b1
+                                                       MX6QDL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_hdmi_hdcp_2: hdmihdcpgrp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_EB2__HDMI_TX_DDC_SCL 0x4001b8b1
+                                                       MX6QDL_PAD_EIM_D16__HDMI_TX_DDC_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_hdmi_hdcp_3: hdmihdcpgrp-3 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_EB2__HDMI_TX_DDC_SCL  0x4001b8b1
+                                                       MX6QDL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA 0x4001b8b1
+                                               >;
+                                       };
+                               };
+
+                               hdmi_cec {
+                                       pinctrl_hdmi_cec_1: hdmicecgrp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_A25__HDMI_TX_CEC_LINE 0x1f8b0
+                                               >;
+                                       };
+
+                                       pinctrl_hdmi_cec_2: hdmicecgrp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE 0x1f8b0
+                                               >;
+                                       };
+                               };
+
+                               i2c1 {
+                                       pinctrl_i2c1_1: i2c1grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
+                                                       MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_i2c1_2: i2c1grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
+                                                       MX6QDL_PAD_CSI0_DAT9__I2C1_SCL 0x4001b8b1
+                                               >;
+                                       };
+                               };
+
+                               i2c2 {
+                                       pinctrl_i2c2_1: i2c2grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
+                                                       MX6QDL_PAD_EIM_D16__I2C2_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_i2c2_2: i2c2grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
+                                                       MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_i2c2_3: i2c2grp-3 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_EB2__I2C2_SCL  0x4001b8b1
+                                                       MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
+                                               >;
+                                       };
+                               };
+
+                               i2c3 {
+                                       pinctrl_i2c3_1: i2c3grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_D17__I2C3_SCL 0x4001b8b1
+                                                       MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_i2c3_2: i2c3grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
+                                                       MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_i2c3_3: i2c3grp-3 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_GPIO_5__I2C3_SCL  0x4001b8b1
+                                                       MX6QDL_PAD_GPIO_16__I2C3_SDA 0x4001b8b1
+                                               >;
+                                       };
+
+                                       pinctrl_i2c3_4: i2c3grp-4 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_GPIO_3__I2C3_SCL  0x4001b8b1
+                                                       MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
+                                               >;
+                                       };
+                               };
+
+                               ipu1 {
+                                       pinctrl_ipu1_1: ipu1grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10
+                                                       MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15       0x10
+                                                       MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02        0x10
+                                                       MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03        0x10
+                                                       MX6QDL_PAD_DI0_PIN4__IPU1_DI0_PIN04        0x80000000
+                                                       MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00   0x10
+                                                       MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01   0x10
+                                                       MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02   0x10
+                                                       MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03   0x10
+                                                       MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04   0x10
+                                                       MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05   0x10
+                                                       MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06   0x10
+                                                       MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07   0x10
+                                                       MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08   0x10
+                                                       MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09   0x10
+                                                       MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10  0x10
+                                                       MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11  0x10
+                                                       MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12  0x10
+                                                       MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13  0x10
+                                                       MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14  0x10
+                                                       MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15  0x10
+                                                       MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16  0x10
+                                                       MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17  0x10
+                                                       MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18  0x10
+                                                       MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19  0x10
+                                                       MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20  0x10
+                                                       MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21  0x10
+                                                       MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22  0x10
+                                                       MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23  0x10
+                                               >;
+                                       };
+
+                                       pinctrl_ipu1_2: ipu1grp-2 { /* parallel camera */
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12    0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13    0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14    0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15    0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16    0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17    0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18    0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19    0x80000000
+                                                       MX6QDL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN 0x80000000
+                                                       MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK   0x80000000
+                                                       MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC      0x80000000
+                                                       MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC     0x80000000
+                                               >;
+                                       };
+
+                                       pinctrl_ipu1_3: ipu1grp-3 { /* parallel port 16-bit */
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04   0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05   0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06   0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07   0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08   0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09   0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18  0x80000000
+                                                       MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19  0x80000000
+                                                       MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x80000000
+                                                       MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC    0x80000000
+                                                       MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC   0x80000000
+                                               >;
+                                       };
+                               };
+
+                               mlb {
+                                       pinctrl_mlb_1: mlbgrp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_GPIO_3__MLB_CLK  0x71
+                                                       MX6QDL_PAD_GPIO_6__MLB_SIG  0x71
+                                                       MX6QDL_PAD_GPIO_2__MLB_DATA 0x71
+                                               >;
+                                       };
+
+                                       pinctrl_mlb_2: mlbgrp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_ENET_TXD1__MLB_CLK 0x71
+                                                       MX6QDL_PAD_GPIO_6__MLB_SIG    0x71
+                                                       MX6QDL_PAD_GPIO_2__MLB_DATA   0x71
+                                               >;
+                                       };
+                               };
+
+                               pwm0 {
+                                       pinctrl_pwm0_1: pwm0grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_SD1_DAT3__PWM1_OUT 0x1b0b1
+                                               >;
+                                       };
+                               };
+
+                               pwm3 {
+                                       pinctrl_pwm3_1: pwm3grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
+                                               >;
+                                       };
+                               };
+
+                               spdif {
+                                       pinctrl_spdif_1: spdifgrp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_COL3__SPDIF_IN 0x1b0b0
+                                               >;
+                                       };
+
+                                       pinctrl_spdif_2: spdifgrp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_GPIO_16__SPDIF_IN  0x1b0b0
+                                                       MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0
+                                               >;
+                                       };
+                               };
+
+                               uart1 {
+                                       pinctrl_uart1_1: uart1grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
+                                                       MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
+                                               >;
+                                       };
+                               };
+
+                               uart2 {
+                                       pinctrl_uart2_1: uart2grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
+                                                       MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
+                                               >;
+                                       };
+
+                                       pinctrl_uart2_2: uart2grp-2 { /* DTE mode */
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_D26__UART2_RX_DATA   0x1b0b1
+                                                       MX6QDL_PAD_EIM_D27__UART2_TX_DATA   0x1b0b1
+                                                       MX6QDL_PAD_EIM_D28__UART2_DTE_CTS_B 0x1b0b1
+                                                       MX6QDL_PAD_EIM_D29__UART2_DTE_RTS_B 0x1b0b1
+                                               >;
+                                       };
+                               };
+
+                               uart3 {
+                                       pinctrl_uart3_1: uart3grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_SD4_CLK__UART3_RX_DATA 0x1b0b1
+                                                       MX6QDL_PAD_SD4_CMD__UART3_TX_DATA 0x1b0b1
+                                                       MX6QDL_PAD_EIM_D30__UART3_CTS_B   0x1b0b1
+                                                       MX6QDL_PAD_EIM_EB3__UART3_RTS_B   0x1b0b1
+                                               >;
+                                       };
+
+                                       pinctrl_uart3_2: uart3grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
+                                                       MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
+                                                       MX6QDL_PAD_EIM_D23__UART3_CTS_B   0x1b0b1
+                                                       MX6QDL_PAD_EIM_EB3__UART3_RTS_B   0x1b0b1
+                                               >;
+                                       };
+                               };
+
+                               uart4 {
+                                       pinctrl_uart4_1: uart4grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
+                                                       MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
+                                               >;
+                                       };
+                               };
+
+                               usbotg {
+                                       pinctrl_usbotg_1: usbotggrp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
+                                               >;
+                                       };
+
+                                       pinctrl_usbotg_2: usbotggrp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
+                                               >;
+                                       };
+                               };
+
+                               usbh2 {
+                                       pinctrl_usbh2_1: usbh2grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_RGMII_TXC__USB_H2_DATA      0x40013030
+                                                       MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE 0x40013030
+                                               >;
+                                       };
+
+                                       pinctrl_usbh2_2: usbh2grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE 0x40017030
+                                               >;
+                                       };
+                               };
+
+                               usbh3 {
+                                       pinctrl_usbh3_1: usbh3grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_RGMII_RX_CTL__USB_H3_DATA 0x40013030
+                                                       MX6QDL_PAD_RGMII_RXC__USB_H3_STROBE  0x40013030
+                                               >;
+                                       };
+
+                                       pinctrl_usbh3_2: usbh3grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_RGMII_RXC__USB_H3_STROBE 0x40017030
+                                               >;
+                                       };
+                               };
+
+                               usdhc1 {
+                                       pinctrl_usdhc1_1: usdhc1grp-1 {
+                                               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_NANDF_D0__SD1_DATA4 0x17059
+                                                       MX6QDL_PAD_NANDF_D1__SD1_DATA5 0x17059
+                                                       MX6QDL_PAD_NANDF_D2__SD1_DATA6 0x17059
+                                                       MX6QDL_PAD_NANDF_D3__SD1_DATA7 0x17059
+                                               >;
+                                       };
+
+                                       pinctrl_usdhc1_2: usdhc1grp-2 {
+                                               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
+                                               >;
+                                       };
+                               };
+
+                               usdhc2 {
+                                       pinctrl_usdhc2_1: usdhc2grp-1 {
+                                               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
+                                                       MX6QDL_PAD_NANDF_D4__SD2_DATA4 0x17059
+                                                       MX6QDL_PAD_NANDF_D5__SD2_DATA5 0x17059
+                                                       MX6QDL_PAD_NANDF_D6__SD2_DATA6 0x17059
+                                                       MX6QDL_PAD_NANDF_D7__SD2_DATA7 0x17059
+                                               >;
+                                       };
+
+                                       pinctrl_usdhc2_2: usdhc2grp-2 {
+                                               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
+                                               >;
+                                       };
+                               };
+
+                               usdhc3 {
+                                       pinctrl_usdhc3_1: usdhc3grp-1 {
+                                               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
+                                               >;
+                                       };
+
+                                       pinctrl_usdhc3_2: usdhc3grp-2 {
+                                               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
+                                               >;
+                                       };
+                               };
+
+                               usdhc4 {
+                                       pinctrl_usdhc4_1: usdhc4grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_SD4_CMD__SD4_CMD    0x17059
+                                                       MX6QDL_PAD_SD4_CLK__SD4_CLK    0x10059
+                                                       MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
+                                                       MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
+                                                       MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
+                                                       MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
+                                                       MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
+                                                       MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
+                                                       MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
+                                                       MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
+                                               >;
+                                       };
+
+                                       pinctrl_usdhc4_2: usdhc4grp-2 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_SD4_CMD__SD4_CMD    0x17059
+                                                       MX6QDL_PAD_SD4_CLK__SD4_CLK    0x10059
+                                                       MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
+                                                       MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
+                                                       MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
+                                                       MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
+                                               >;
+                                       };
+                               };
+
+                               weim {
+                                       pinctrl_weim_cs0_1: weim_cs0grp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_CS0__EIM_CS0_B   0xb0b1
+                                               >;
+                                       };
+
+                                       pinctrl_weim_nor_1: weim_norgrp-1 {
+                                               fsl,pins = <
+                                                       MX6QDL_PAD_EIM_OE__EIM_OE_B     0xb0b1
+                                                       MX6QDL_PAD_EIM_RW__EIM_RW       0xb0b1
+                                                       MX6QDL_PAD_EIM_WAIT__EIM_WAIT_B 0xb060
+                                                       /* data */
+                                                       MX6QDL_PAD_EIM_D16__EIM_DATA16 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D17__EIM_DATA17 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D18__EIM_DATA18 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D19__EIM_DATA19 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D20__EIM_DATA20 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D21__EIM_DATA21 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D22__EIM_DATA22 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D23__EIM_DATA23 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D24__EIM_DATA24 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D25__EIM_DATA25 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D26__EIM_DATA26 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D27__EIM_DATA27 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D28__EIM_DATA28 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D29__EIM_DATA29 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D30__EIM_DATA30 0x1b0b0
+                                                       MX6QDL_PAD_EIM_D31__EIM_DATA31 0x1b0b0
+                                                       /* address */
+                                                       MX6QDL_PAD_EIM_A23__EIM_ADDR23 0xb0b1
+                                                       MX6QDL_PAD_EIM_A22__EIM_ADDR22 0xb0b1
+                                                       MX6QDL_PAD_EIM_A21__EIM_ADDR21 0xb0b1
+                                                       MX6QDL_PAD_EIM_A20__EIM_ADDR20 0xb0b1
+                                                       MX6QDL_PAD_EIM_A19__EIM_ADDR19 0xb0b1
+                                                       MX6QDL_PAD_EIM_A18__EIM_ADDR18 0xb0b1
+                                                       MX6QDL_PAD_EIM_A17__EIM_ADDR17 0xb0b1
+                                                       MX6QDL_PAD_EIM_A16__EIM_ADDR16 0xb0b1
+                                                       MX6QDL_PAD_EIM_DA15__EIM_AD15  0xb0b1
+                                                       MX6QDL_PAD_EIM_DA14__EIM_AD14  0xb0b1
+                                                       MX6QDL_PAD_EIM_DA13__EIM_AD13  0xb0b1
+                                                       MX6QDL_PAD_EIM_DA12__EIM_AD12  0xb0b1
+                                                       MX6QDL_PAD_EIM_DA11__EIM_AD11  0xb0b1
+                                                       MX6QDL_PAD_EIM_DA10__EIM_AD10  0xb0b1
+                                                       MX6QDL_PAD_EIM_DA9__EIM_AD09   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA8__EIM_AD08   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA7__EIM_AD07   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA6__EIM_AD06   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA5__EIM_AD05   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA4__EIM_AD04   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA3__EIM_AD03   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA2__EIM_AD02   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA1__EIM_AD01   0xb0b1
+                                                       MX6QDL_PAD_EIM_DA0__EIM_AD00   0xb0b1
+                                               >;
+                                       };
+                               };
+                       };
+
                        ldb: ldb@020e0008 {
                                #address-cells = <1>;
                                #size-cells = <0>;
 
                                lvds-channel@0 {
                                        reg = <0>;
-                                       crtcs = <&ipu1 0>;
                                        status = "disabled";
                                };
 
                                lvds-channel@1 {
                                        reg = <1>;
-                                       crtcs = <&ipu1 1>;
                                        status = "disabled";
                                };
                        };
                                interrupts = <0 2 0x04>;
                                clocks = <&clks 155>, <&clks 155>;
                                clock-names = "ipg", "ahb";
+                               #dma-cells = <3>;
                                fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q.bin";
                        };
                };
                                clocks = <&clks 196>;
                        };
 
-                       ocotp@021bc000 {
-                               compatible = "fsl,imx6q-ocotp";
+                       ocotp: ocotp@021bc000 {
+                               compatible = "fsl,imx6q-ocotp", "syscon";
                                reg = <0x021bc000 0x4000>;
                        };
 
                                interrupts = <0 27 0x04>;
                                clocks = <&clks 160>, <&clks 161>;
                                clock-names = "ipg", "per";
+                               dmas = <&sdma 27 4 0>, <&sdma 28 4 0>;
+                               dma-names = "rx", "tx";
                                status = "disabled";
                        };
 
                                interrupts = <0 28 0x04>;
                                clocks = <&clks 160>, <&clks 161>;
                                clock-names = "ipg", "per";
+                               dmas = <&sdma 29 4 0>, <&sdma 30 4 0>;
+                               dma-names = "rx", "tx";
                                status = "disabled";
                        };
 
                                interrupts = <0 29 0x04>;
                                clocks = <&clks 160>, <&clks 161>;
                                clock-names = "ipg", "per";
+                               dmas = <&sdma 31 4 0>, <&sdma 32 4 0>;
+                               dma-names = "rx", "tx";
                                status = "disabled";
                        };
 
                                interrupts = <0 30 0x04>;
                                clocks = <&clks 160>, <&clks 161>;
                                clock-names = "ipg", "per";
+                               dmas = <&sdma 33 4 0>, <&sdma 34 4 0>;
+                               dma-names = "rx", "tx";
                                status = "disabled";
                        };
                };
index c5e5da0..c46651e 100644 (file)
                                };
 
                                uart5: serial@02018000 {
-                                       compatible = "fsl,imx6sl-uart", "fsl,imx21-uart";
+                                       compatible = "fsl,imx6sl-uart",
+                                                  "fsl,imx6q-uart", "fsl,imx21-uart";
                                        reg = <0x02018000 0x4000>;
                                        interrupts = <0 30 0x04>;
                                        clocks = <&clks IMX6SL_CLK_UART>,
                                                 <&clks IMX6SL_CLK_UART_SERIAL>;
                                        clock-names = "ipg", "per";
+                                       dmas = <&sdma 33 4 0>, <&sdma 34 4 0>;
+                                       dma-names = "rx", "tx";
                                        status = "disabled";
                                };
 
                                uart1: serial@02020000 {
-                                       compatible = "fsl,imx6sl-uart", "fsl,imx21-uart";
+                                       compatible = "fsl,imx6sl-uart",
+                                                  "fsl,imx6q-uart", "fsl,imx21-uart";
                                        reg = <0x02020000 0x4000>;
                                        interrupts = <0 26 0x04>;
                                        clocks = <&clks IMX6SL_CLK_UART>,
                                                 <&clks IMX6SL_CLK_UART_SERIAL>;
                                        clock-names = "ipg", "per";
+                                       dmas = <&sdma 25 4 0>, <&sdma 26 4 0>;
+                                       dma-names = "rx", "tx";
                                        status = "disabled";
                                };
 
                                uart2: serial@02024000 {
-                                       compatible = "fsl,imx6sl-uart", "fsl,imx21-uart";
+                                       compatible = "fsl,imx6sl-uart",
+                                                  "fsl,imx6q-uart", "fsl,imx21-uart";
                                        reg = <0x02024000 0x4000>;
                                        interrupts = <0 27 0x04>;
                                        clocks = <&clks IMX6SL_CLK_UART>,
                                                 <&clks IMX6SL_CLK_UART_SERIAL>;
                                        clock-names = "ipg", "per";
+                                       dmas = <&sdma 27 4 0>, <&sdma 28 4 0>;
+                                       dma-names = "rx", "tx";
                                        status = "disabled";
                                };
 
                                        reg = <0x02028000 0x4000>;
                                        interrupts = <0 46 0x04>;
                                        clocks = <&clks IMX6SL_CLK_SSI1>;
+                                       dmas = <&sdma 37 1 0>,
+                                              <&sdma 38 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        status = "disabled";
                                };
                                        reg = <0x0202c000 0x4000>;
                                        interrupts = <0 47 0x04>;
                                        clocks = <&clks IMX6SL_CLK_SSI2>;
+                                       dmas = <&sdma 41 1 0>,
+                                              <&sdma 42 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        status = "disabled";
                                };
                                        reg = <0x02030000 0x4000>;
                                        interrupts = <0 48 0x04>;
                                        clocks = <&clks IMX6SL_CLK_SSI3>;
+                                       dmas = <&sdma 45 1 0>,
+                                              <&sdma 46 1 0>;
+                                       dma-names = "rx", "tx";
                                        fsl,fifo-depth = <15>;
                                        status = "disabled";
                                };
 
                                uart3: serial@02034000 {
-                                       compatible = "fsl,imx6sl-uart", "fsl,imx21-uart";
+                                       compatible = "fsl,imx6sl-uart",
+                                                  "fsl,imx6q-uart", "fsl,imx21-uart";
                                        reg = <0x02034000 0x4000>;
                                        interrupts = <0 28 0x04>;
                                        clocks = <&clks IMX6SL_CLK_UART>,
                                                 <&clks IMX6SL_CLK_UART_SERIAL>;
                                        clock-names = "ipg", "per";
+                                       dmas = <&sdma 29 4 0>, <&sdma 30 4 0>;
+                                       dma-names = "rx", "tx";
                                        status = "disabled";
                                };
 
                                uart4: serial@02038000 {
-                                       compatible = "fsl,imx6sl-uart", "fsl,imx21-uart";
+                                       compatible = "fsl,imx6sl-uart",
+                                                  "fsl,imx6q-uart", "fsl,imx21-uart";
                                        reg = <0x02038000 0x4000>;
                                        interrupts = <0 29 0x04>;
                                        clocks = <&clks IMX6SL_CLK_UART>,
                                                 <&clks IMX6SL_CLK_UART_SERIAL>;
                                        clock-names = "ipg", "per";
+                                       dmas = <&sdma 31 4 0>, <&sdma 32 4 0>;
+                                       dma-names = "rx", "tx";
                                        status = "disabled";
                                };
                        };
                                clocks = <&clks IMX6SL_CLK_SDMA>,
                                         <&clks IMX6SL_CLK_SDMA>;
                                clock-names = "ipg", "ahb";
+                               #dma-cells = <3>;
                                fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6sl.bin";
                        };
 
index 1334b42..a68e34b 100644 (file)
@@ -7,7 +7,9 @@
  */
 
 /dts-v1/;
-/include/ "skeleton.dtsi"
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+#include "skeleton.dtsi"
 
 / {
        model = "Texas Instruments Keystone 2 SoC";
 
        timer {
                compatible = "arm,armv7-timer";
-               interrupts = <1 13 0xf08>,
-                            <1 14 0xf08>,
-                            <1 11 0xf08>,
-                            <1 10 0x308>;
+               interrupts =
+                       <GIC_PPI 13
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                       <GIC_PPI 14
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                       <GIC_PPI 11
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                       <GIC_PPI 10
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
        pmu {
                compatible = "arm,cortex-a15-pmu";
-               interrupts = <0 20 0xf01>,
-                            <0 21 0xf01>,
-                            <0 22 0xf01>,
-                            <0 23 0xf01>;
+               interrupts = <GIC_SPI 20 IRQ_TYPE_EDGE_RISING>,
+                            <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
+                            <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>,
+                            <GIC_SPI 23 IRQ_TYPE_EDGE_RISING>;
        };
 
        soc {
                        reg-io-width = <4>;
                        reg = <0x02530c00 0x100>;
                        clock-frequency = <133120000>;
-                       interrupts = <0 277 0xf01>;
+                       interrupts = <GIC_SPI 277 IRQ_TYPE_EDGE_RISING>;
                };
 
                uart1:  serial@02531000 {
                        reg-io-width = <4>;
                        reg = <0x02531000 0x100>;
                        clock-frequency = <133120000>;
-                       interrupts = <0 280 0xf01>;
+                       interrupts = <GIC_SPI 280 IRQ_TYPE_EDGE_RISING>;
                };
 
        };
index 1e5bef0..650ef30 100644 (file)
@@ -1,4 +1,39 @@
 / {
+       mbus {
+               pcie-controller {
+                       compatible = "marvell,kirkwood-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
+                               0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0       1 0 /* Port 0.0 MEM */
+                               0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0       1 0 /* Port 0.0 IO  */>;
+
+                       pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &intc 9>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gate_clk 2>;
+                               status = "disabled";
+                       };
+               };
+       };
+
        ocp@f1000000 {
                pinctrl: pinctrl@10000 {
                        compatible = "marvell,88f6281-pinctrl";
                        };
                };
 
-               pcie-controller {
-                       compatible = "marvell,kirkwood-pcie";
-                       status = "disabled";
-                       device_type = "pci";
-
-                       #address-cells = <3>;
-                       #size-cells = <2>;
-
-                       bus-range = <0x00 0xff>;
-
-                       ranges = <0x82000000 0 0x00040000 0x00040000 0 0x00002000   /* Port 0.0 registers */
-                                 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000   /* non-prefetchable memory */
-                                 0x81000000 0 0          0xe8000000 0 0x00100000>; /* downstream I/O */
-
-                       pcie@1,0 {
-                               device_type = "pci";
-                               assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
-                               reg = <0x0800 0 0 0 0>;
-                               #address-cells = <3>;
-                               #size-cells = <2>;
-                               #interrupt-cells = <1>;
-                               ranges;
-                               interrupt-map-mask = <0 0 0 0>;
-                               interrupt-map = <0 0 0 0 &intc 9>;
-                               marvell,pcie-port = <0>;
-                               marvell,pcie-lane = <0>;
-                               clocks = <&gate_clk 2>;
-                               status = "disabled";
-                       };
-               };
-
                rtc@10300 {
                        compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
                        reg = <0x10300 0x20>;
index a63a111..3933a33 100644 (file)
@@ -1,4 +1,59 @@
 / {
+       mbus {
+               pcie-controller {
+                       compatible = "marvell,kirkwood-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
+                               0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000
+                               0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000
+                               0x82000000 0x1 0     MBUS_ID(0x04, 0xe8) 0       1 0 /* Port 0.0 MEM */
+                               0x81000000 0x1 0     MBUS_ID(0x04, 0xe0) 0       1 0 /* Port 0.0 IO  */
+                               0x82000000 0x2 0     MBUS_ID(0x04, 0xd8) 0       1 0 /* Port 1.0 MEM */
+                               0x81000000 0x2 0     MBUS_ID(0x04, 0xd0) 0       1 0 /* Port 1.0 IO  */>;
+
+                       pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &intc 9>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gate_clk 2>;
+                               status = "disabled";
+                       };
+
+                       pcie@2,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82001000 0 0x00044000 0 0x2000>;
+                               reg = <0x1000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
+                                         0x81000000 0 0 0x81000000 0x2 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &intc 10>;
+                               marvell,pcie-port = <1>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gate_clk 18>;
+                               status = "disabled";
+                       };
+               };
+       };
        ocp@f1000000 {
 
                pinctrl: pinctrl@10000 {
                        status = "disabled";
                };
 
-               pcie-controller {
-                       compatible = "marvell,kirkwood-pcie";
-                       status = "disabled";
-                       device_type = "pci";
-
-                       #address-cells = <3>;
-                       #size-cells = <2>;
-
-                       bus-range = <0x00 0xff>;
-
-                       ranges = <0x82000000 0 0x00040000 0x00040000 0 0x00002000   /* Port 0.0 registers */
-                                 0x82000000 0 0x00044000 0x00044000 0 0x00002000   /* Port 1.0 registers */
-                                 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000   /* non-prefetchable memory */
-                                 0x81000000 0 0          0xe8000000 0 0x00100000>; /* downstream I/O */
-
-                       pcie@1,0 {
-                               device_type = "pci";
-                               assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
-                               reg = <0x0800 0 0 0 0>;
-                               #address-cells = <3>;
-                               #size-cells = <2>;
-                               #interrupt-cells = <1>;
-                               ranges;
-                               interrupt-map-mask = <0 0 0 0>;
-                               interrupt-map = <0 0 0 0 &intc 9>;
-                               marvell,pcie-port = <0>;
-                               marvell,pcie-lane = <0>;
-                               clocks = <&gate_clk 2>;
-                               status = "disabled";
-                       };
-
-                       pcie@2,0 {
-                               device_type = "pci";
-                               assigned-addresses = <0x82001000 0 0x00044000 0 0x2000>;
-                               reg = <0x1000 0 0 0 0>;
-                               #address-cells = <3>;
-                               #size-cells = <2>;
-                               #interrupt-cells = <1>;
-                               ranges;
-                               interrupt-map-mask = <0 0 0 0>;
-                               interrupt-map = <0 0 0 0 &intc 10>;
-                               marvell,pcie-port = <1>;
-                               marvell,pcie-lane = <0>;
-                               clocks = <&gate_clk 18>;
-                               status = "disabled";
-                       };
-               };
        };
 };
index 00c48d2..142b9cd 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "LaCie CloudBox";
                gpios = <&gpio0 17 0>;
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 9d777ed..72c4b0a 100644 (file)
 
 /dts-v1/;
 
-/include/ "kirkwood-db.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood-db.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "Marvell DB-88F6281-BP Development Board";
        compatible = "marvell,db-88f6281-bp", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
-       ocp@f1000000 {
+       mbus {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
                pcie-controller {
                        status = "okay";
 
index f4c8528..36c411d 100644 (file)
 
 /dts-v1/;
 
-/include/ "kirkwood-db.dtsi"
-/include/ "kirkwood-6282.dtsi"
+#include "kirkwood-db.dtsi"
+#include "kirkwood-6282.dtsi"
 
 / {
        model = "Marvell DB-88F6282-BP Development Board";
        compatible = "marvell,db-88f6282-bp", "marvell,kirkwood-88f6282", "marvell,kirkwood";
 
-       ocp@f1000000 {
+       mbus {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
                pcie-controller {
                        status = "okay";
 
index c87cfb8..c0e2a58 100644 (file)
@@ -12,7 +12,7 @@
  * and 6282 variants of the Marvell Kirkwood Development Board.
  */
 
-/include/ "kirkwood.dtsi"
+#include "kirkwood.dtsi"
 
 / {
        memory {
                        cd-gpios = <&gpio1 6 0>;
                        status = "okay";
                };
+       };
+};
 
-               pcie-controller {
-                       status = "okay";
+&mdio {
+       status = "okay";
 
-                       pcie@1,0 {
-                               status = "okay";
-                       };
-               };
+       ethphy0: ethernet-phy@8 {
+               device_type = "ethernet-phy";
+               reg = <8>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
        };
 };
index 14d4cee..e112ca6 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-dnskw.dtsi"
+#include "kirkwood-dnskw.dtsi"
 
 / {
        model = "D-Link DNS-320 NAS (Rev A1)";
index 6387257..5119fb8 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-dnskw.dtsi"
+#include "kirkwood-dnskw.dtsi"
 
 / {
        model = "D-Link DNS-325 NAS (Rev A1)";
index 0afe1d0..d544f77 100644 (file)
@@ -1,5 +1,5 @@
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "D-Link DNS NASes (kirkwood-based)";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@8 {
+               device_type = "ethernet-phy";
+               reg = <8>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 7714742..59a2117 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "Seagate FreeAgent Dockstar";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               compatible = "marvell,88e1116";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 36c7ba3..6f62af9 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "Globalscale Technologies Dreamplug";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+
+       ethphy1: ethernet-phy@1 {
+               device_type = "ethernet-phy";
+               reg = <1>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
+
+&eth1 {
+       status = "okay";
+       ethernet1-port@0 {
+               phy-handle = <&ethphy1>;
+       };
+};
index 31caa64..6f7c7d7 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "Seagate GoFlex Net";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 1e642f3..6548b9d 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "Globalscale Technologies Guruplug Server Plus";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               compatible = "marvell,88e1121";
+               reg = <0>;
+       };
+
+       ethphy1: ethernet-phy@1 {
+               device_type = "ethernet-phy";
+               compatible = "marvell,88e1121";
+               reg = <1>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
+
+&eth1 {
+       status = "okay";
+       ethernet1-port@0 {
+               phy-handle = <&ethphy1>;
+       };
+};
index 20c4b08..cb711a3 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)";
 
 
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@8 {
+               device_type = "ethernet-phy";
+               reg = <8>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 441204e..0323f01 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "Iomega Iconnect";
                linux,initrd-end   = <0x4800000>;
        };
 
+       mbus {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
        ocp@f1000000 {
                pinctrl: pinctrl@10000 {
                        pmx_button_reset: pmx-button-reset {
                                reg = <0x980000 0x1f400000>;
                        };
                };
-
-               pcie-controller {
-                       status = "okay";
-
-                       pcie@1,0 {
-                               status = "okay";
-                       };
-               };
        };
 
        gpio-leds {
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@11 {
+               device_type = "ethernet-phy";
+               reg = <11>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 00a7bfe..df84474 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "Iomega StorCenter ix2-200";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy1: ethernet-phy@11 {
+               device_type = "ethernet-phy";
+               reg = <11>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               speed = <1000>;
+               duplex = <1>;
+       };
+};
+
+&eth1 {
+       status = "okay";
+       ethernet1-port@0 {
+               phy-handle = <&ethphy1>;
+       };
+};
index c3f036b..da674bb 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-ns2-common.dtsi"
+#include "kirkwood-ns2-common.dtsi"
 
 / {
        model = "LaCie Internet Space v2";
@@ -30,3 +30,5 @@
                };
        };
 };
+
+&ethphy0 { reg = <8>; };
index 5d9f5ea..6899408 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-98dx4122.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-98dx4122.dtsi"
 
 / {
        model = "Keymile Kirkwood Reference Design";
                i2c-gpio,delay-us = <2>;        /* ~100 kHz */
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 9f55d95..e2fa368 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-lsxl.dtsi"
+#include "kirkwood-lsxl.dtsi"
 
 / {
        model = "Buffalo Linkstation LS-CHLv2";
index 5c84c11..8d89cdf 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-lsxl.dtsi"
+#include "kirkwood-lsxl.dtsi"
 
 / {
        model = "Buffalo Linkstation LS-XHL";
index 31b17f5..4e8f9e4 100644 (file)
@@ -1,5 +1,5 @@
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        chosen {
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+
+       ethphy1: ethernet-phy@8 {
+               device_type = "ethernet-phy";
+               reg = <8>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
+
+&eth1 {
+       status = "okay";
+       ethernet1-port@0 {
+               phy-handle = <&ethphy1>;
+       };
+};
index 6179333..ce2b94b 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        model = "MPL CEC4";
                 bootargs = "console=ttyS0,115200n8 earlyprintk";
         };
 
+       mbus {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
        ocp@f1000000 {
                pinctrl: pinctrl@10000 {
                        pmx_led_health: pmx-led-health {
                        cd-gpios = <&gpio1 15 1>;
                        /* No WP GPIO */
                };
-
-               pcie-controller {
-                       status = "okay";
-
-                       pcie@1,0 {
-                               status = "okay";
-                       };
-               };
        };
 
        gpio-leds {
        };
 };
 
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@1 {
+               device_type = "ethernet-phy";
+               reg = <1>;
+       };
+
+       ethphy1: ethernet-phy@2 {
+               device_type = "ethernet-phy";
+               reg = <2>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
+
+&eth1 {
+       status = "okay";
+       ethernet1-port@0 {
+               phy-handle = <&ethphy1>;
+       };
+};
diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
new file mode 100644 (file)
index 0000000..6317e1d
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * Marvell 88F6281 GTW GE Board
+ *
+ * Lennert Buytenhek <buytenh@marvell.com>
+ * Thomas Petazzoni <thomas.petazzoni@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 contains the definitions that are common between the 6281
+ * and 6282 variants of the Marvell Kirkwood Development Board.
+ */
+
+/dts-v1/;
+
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
+
+/ {
+       model = "Marvell 88F6281 GTW GE Board";
+       compatible = "marvell,mv88f6281gtw-ge", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>; /* 512 MB */
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8 earlyprintk";
+       };
+
+       ocp@f1000000 {
+               pinctrl@10000 {
+                       pmx_usb_led: pmx-usb-led {
+                               marvell,pins = "mpp12";
+                               marvell,function = "gpo";
+                       };
+
+                       pmx_leds: pmx-leds {
+                               marvell,pins = "mpp20", "mpp21";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_keys: pmx-keys {
+                               marvell,pins = "mpp46", "mpp47";
+                               marvell,function = "gpio";
+                       };
+               };
+
+               spi@10600 {
+                       pinctrl-0 = <&pmx_spi>;
+                       pinctrl-names = "default";
+                       status = "okay";
+
+                       flash@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "mx25l12805d";
+                               reg = <0>;
+                               spi-max-frequency = <50000000>;
+                               mode = <0>;
+                       };
+               };
+
+               serial@12000 {
+                       pinctrl-0 = <&pmx_uart0>;
+                       pinctrl-names = "default";
+                       clock-frequency = <200000000>;
+                       status = "ok";
+               };
+
+               ehci@50000 {
+                       status = "okay";
+               };
+
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&pmx_leds &pmx_usb_led>;
+               pinctrl-names = "default";
+
+               green-status {
+                       label = "gtw:green:Status";
+                       gpios = <&gpio0 20 0>;
+               };
+
+               red-status {
+                       label = "gtw:red:Status";
+                       gpios = <&gpio0 21 0>;
+               };
+
+               green-usb {
+                       label = "gtw:green:USB";
+                       gpios = <&gpio0 12 0>;
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-0 = <&pmx_keys>;
+               pinctrl-names = "default";
+
+               button@1 {
+                       label = "SWR Button";
+                       linux,code = <0x198>; /* KEY_RESTART */
+                       gpios = <&gpio1 15 1>;
+               };
+               button@2 {
+                       label = "WPS Button";
+                       linux,code = <0x211>; /* KEY_WPS_BUTTON */
+                       gpios = <&gpio1 14 1>;
+               };
+       };
+};
index ad6ade7..874857e 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6282.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6282.dtsi"
 
 / {
        model = "NETGEAR ReadyNAS Duo v2";
                bootargs = "console=ttyS0,115200n8 earlyprintk";
        };
 
+       mbus {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
        ocp@f1000000 {
                pinctrl: pinctrl@10000 {
                        pmx_button_power: pmx-button-power {
                        };
                };
 
+               clocks {
+                      #address-cells = <1>;
+                      #size-cells = <0>;
+
+                      g762_clk: fixedclk {
+                                compatible = "fixed-clock";
+                                #clock-cells = <0>;
+                                clock-frequency = <8192>;
+                      };
+               };
+
                i2c@11000 {
                        status = "okay";
 
                                compatible = "ricoh,rs5c372a";
                                reg = <0x32>;
                        };
+
+                       g762: g762@3e {
+                               compatible = "gmt,g762";
+                               reg = <0x3e>;
+                               clocks = <&g762_clk>; /* input clock */
+                               fan_gear_mode = <0>;
+                               fan_startv = <1>;
+                               pwm_polarity = <0>;
+                       };
                };
 
                serial@12000 {
                        status = "okay";
                        nr-ports = <2>;
                };
-
-               pcie-controller {
-                       status = "okay";
-
-                       pcie@1,0 {
-                               status = "okay";
-                       };
-               };
        };
 
        gpio-leds {
                 };
         };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 2afac04..2fcb82e 100644 (file)
@@ -1,5 +1,5 @@
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        chosen {
        };
 
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy {
+               device_type = "ethernet-phy";
+                /* overwrite reg property in board file */
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index b50e93d..53368d1 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-ns2-common.dtsi"
+#include "kirkwood-ns2-common.dtsi"
 
 / {
        model = "LaCie Network Space v2";
@@ -30,3 +30,5 @@
                };
        };
 };
+
+&ethphy0 { reg = <8>; };
index af8259f..2796070 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-ns2-common.dtsi"
+#include "kirkwood-ns2-common.dtsi"
 
 / {
        model = "LaCie Network Space Lite v2";
@@ -30,3 +30,5 @@
                };
        };
 };
+
+&ethphy0 { reg = <0>; };
index 85f24d2..defdc77 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-ns2-common.dtsi"
+#include "kirkwood-ns2-common.dtsi"
 
 / {
        model = "LaCie Network Space Max v2";
@@ -49,3 +49,5 @@
                };
        };
 };
+
+&ethphy0 { reg = <8>; };
index 329e530..adbafdd 100644 (file)
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "kirkwood-ns2-common.dtsi"
+#include "kirkwood-ns2-common.dtsi"
 
 / {
        /* This machine is embedded in the first LaCie CloudBox product. */
@@ -50,3 +50,5 @@
                };
        };
 };
+
+&ethphy0 { reg = <0>; };
diff --git a/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi b/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi
new file mode 100644 (file)
index 0000000..06267a9
--- /dev/null
@@ -0,0 +1,107 @@
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
+
+/ {
+       model = "ZyXEL NSA310";
+
+       ocp@f1000000 {
+               pinctrl: pinctrl@10000 {
+
+                       pmx_usb_power_off: pmx-usb-power-off {
+                               marvell,pins = "mpp21";
+                               marvell,function = "gpio";
+                       };
+                       pmx_pwr_off: pmx-pwr-off {
+                               marvell,pins = "mpp48";
+                               marvell,function = "gpio";
+                       };
+
+               };
+
+               serial@12000 {
+                       status = "ok";
+               };
+
+               sata@80000 {
+                       status = "okay";
+                       nr-ports = <2>;
+               };
+
+               nand@3000000 {
+                       status = "okay";
+                       chip-delay = <35>;
+
+                       partition@0 {
+                               label = "uboot";
+                               reg = <0x0000000 0x0100000>;
+                               read-only;
+                       };
+                       partition@100000 {
+                               label = "uboot_env";
+                               reg = <0x0100000 0x0080000>;
+                       };
+                       partition@180000 {
+                               label = "key_store";
+                               reg = <0x0180000 0x0080000>;
+                       };
+                       partition@200000 {
+                               label = "info";
+                               reg = <0x0200000 0x0080000>;
+                       };
+                       partition@280000 {
+                               label = "etc";
+                               reg = <0x0280000 0x0a00000>;
+                       };
+                       partition@c80000 {
+                               label = "kernel_1";
+                               reg = <0x0c80000 0x0a00000>;
+                       };
+                       partition@1680000 {
+                               label = "rootfs1";
+                               reg = <0x1680000 0x2fc0000>;
+                       };
+                       partition@4640000 {
+                               label = "kernel_2";
+                               reg = <0x4640000 0x0a00000>;
+                       };
+                       partition@5040000 {
+                               label = "rootfs2";
+                               reg = <0x5040000 0x2fc0000>;
+                       };
+               };
+
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
+       gpio_poweroff {
+               compatible = "gpio-poweroff";
+               pinctrl-0 = <&pmx_pwr_off>;
+               pinctrl-names = "default";
+               gpios = <&gpio1 16 0>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-0 = <&pmx_usb_power_off>;
+               pinctrl-names = "default";
+
+               usb0_power_off: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "USB Power Off";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio0 21 0>;
+               };
+       };
+};
index 6900359..7aeae0c 100644 (file)
@@ -1,10 +1,8 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood-nsa310-common.dtsi"
 
 / {
-       model = "ZyXEL NSA310";
        compatible = "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood";
 
        memory {
                bootargs = "console=ttyS0,115200";
        };
 
+       mbus {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
        ocp@f1000000 {
                pinctrl: pinctrl@10000 {
                        pinctrl-0 = <&pmx_unknown>;
                                marvell,function = "gpio";
                        };
 
-                       pmx_usb_power_off: pmx-usb-power-off {
-                               marvell,pins = "mpp21";
-                               marvell,function = "gpio";
-                       };
-
                        pmx_led_sys_green: pmx-led-sys-green {
                                marvell,pins = "mpp28";
                                marvell,function = "gpio";
                                marvell,pins = "mpp46";
                                marvell,function = "gpio";
                        };
-
-                       pmx_pwr_off: pmx-pwr-off {
-                               marvell,pins = "mpp48";
-                               marvell,function = "gpio";
-                       };
-               };
-
-               serial@12000 {
-                       status = "ok";
-               };
-
-               sata@80000 {
-                       status = "okay";
-                       nr-ports = <2>;
                };
 
                i2c@11000 {
                                reg = <0x2e>;
                        };
                };
-
-               nand@3000000 {
-                       status = "okay";
-                       chip-delay = <35>;
-
-                       partition@0 {
-                               label = "uboot";
-                               reg = <0x0000000 0x0100000>;
-                               read-only;
-                       };
-                       partition@100000 {
-                               label = "uboot_env";
-                               reg = <0x0100000 0x0080000>;
-                       };
-                       partition@180000 {
-                               label = "key_store";
-                               reg = <0x0180000 0x0080000>;
-                       };
-                       partition@200000 {
-                               label = "info";
-                               reg = <0x0200000 0x0080000>;
-                       };
-                       partition@280000 {
-                               label = "etc";
-                               reg = <0x0280000 0x0a00000>;
-                       };
-                       partition@c80000 {
-                               label = "kernel_1";
-                               reg = <0x0c80000 0x0a00000>;
-                       };
-                       partition@1680000 {
-                               label = "rootfs1";
-                               reg = <0x1680000 0x2fc0000>;
-                       };
-                       partition@4640000 {
-                               label = "kernel_2";
-                               reg = <0x4640000 0x0a00000>;
-                       };
-                       partition@5040000 {
-                               label = "rootfs2";
-                               reg = <0x5040000 0x2fc0000>;
-                       };
-               };
-
-               pcie-controller {
-                       status = "okay";
-
-                       pcie@1,0 {
-                               status = "okay";
-                       };
-               };
        };
 
        gpio_keys {
                        gpios = <&gpio1 8 0>;
                };
        };
-
-       gpio_poweroff {
-               compatible = "gpio-poweroff";
-               pinctrl-0 = <&pmx_pwr_off>;
-               pinctrl-names = "default";
-               gpios = <&gpio1 16 0>;
-       };
-
-       regulators {
-               compatible = "simple-bus";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               pinctrl-0 = <&pmx_usb_power_off>;
-               pinctrl-names = "default";
-
-               usb0_power_off: regulator@1 {
-                       compatible = "regulator-fixed";
-                       reg = <1>;
-                       regulator-name = "USB Power Off";
-                       regulator-min-microvolt = <5000000>;
-                       regulator-max-microvolt = <5000000>;
-                       regulator-always-on;
-                       regulator-boot-on;
-                       gpio = <&gpio0 21 0>;
-               };
-       };
 };
diff --git a/arch/arm/boot/dts/kirkwood-nsa310a.dts b/arch/arm/boot/dts/kirkwood-nsa310a.dts
new file mode 100644 (file)
index 0000000..ab0212b
--- /dev/null
@@ -0,0 +1,165 @@
+/dts-v1/;
+
+#include "kirkwood-nsa310-common.dtsi"
+
+/*
+ * There are at least two different NSA310 designs. This variant does
+ * not have the red USB Led.
+ */
+
+/ {
+       compatible = "zyxel,nsa310a", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x10000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       ocp@f1000000 {
+               pinctrl: pinctrl@10000 {
+                       pinctrl-names = "default";
+
+                       pmx_led_esata_green: pmx-led-esata-green {
+                               marvell,pins = "mpp12";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_esata_red: pmx-led-esata-red {
+                               marvell,pins = "mpp13";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_usb_green: pmx-led-usb-green {
+                               marvell,pins = "mpp15";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_usb_power_off: pmx-usb-power-off {
+                               marvell,pins = "mpp21";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_sys_green: pmx-led-sys-green {
+                               marvell,pins = "mpp28";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_sys_red: pmx-led-sys-red {
+                               marvell,pins = "mpp29";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_btn_reset: pmx-btn-reset {
+                               marvell,pins = "mpp36";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_btn_copy: pmx-btn-copy {
+                               marvell,pins = "mpp37";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_copy_green: pmx-led-copy-green {
+                               marvell,pins = "mpp39";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_copy_red: pmx-led-copy-red {
+                               marvell,pins = "mpp40";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_hdd_green: pmx-led-hdd-green {
+                               marvell,pins = "mpp41";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_led_hdd_red: pmx-led-hdd-red {
+                               marvell,pins = "mpp42";
+                               marvell,function = "gpio";
+                       };
+
+                       pmx_btn_power: pmx-btn-power {
+                               marvell,pins = "mpp46";
+                               marvell,function = "gpio";
+                       };
+
+               };
+
+               i2c@11000 {
+                       status = "okay";
+
+                       lm85: lm85@2e {
+                               compatible = "lm85";
+                               reg = <0x2e>;
+                       };
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               button@1 {
+                       label = "Power Button";
+                       linux,code = <116>;
+                       gpios = <&gpio1 14 0>;
+               };
+               button@2 {
+                       label = "Copy Button";
+                       linux,code = <133>;
+                       gpios = <&gpio1 5 1>;
+               };
+               button@3 {
+                       label = "Reset Button";
+                       linux,code = <0x198>;
+                       gpios = <&gpio1 4 1>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               green-sys {
+                       label = "nsa310:green:sys";
+                       gpios = <&gpio0 28 0>;
+               };
+               red-sys {
+                       label = "nsa310:red:sys";
+                       gpios = <&gpio0 29 0>;
+               };
+               green-hdd {
+                       label = "nsa310:green:hdd";
+                       gpios = <&gpio1 9 0>;
+               };
+               red-hdd {
+                       label = "nsa310:red:hdd";
+                       gpios = <&gpio1 10 0>;
+               };
+               green-esata {
+                       label = "nsa310:green:esata";
+                       gpios = <&gpio0 12 0>;
+               };
+               red-esata {
+                       label = "nsa310:red:esata";
+                       gpios = <&gpio0 13 0>;
+               };
+               green-usb {
+                       label = "nsa310:green:usb";
+                       gpios = <&gpio0 15 0>;
+               };
+               green-copy {
+                       label = "nsa310:green:copy";
+                       gpios = <&gpio1 7 0>;
+               };
+               red-copy {
+                       label = "nsa310:red:copy";
+                       gpios = <&gpio1 8 0>;
+               };
+       };
+};
index 38dc851..85ccf8d 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6282.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6282.dtsi"
 
 / {
        model = "Plat'Home OpenBlocksA6";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index f7143f1..5696b63 100644 (file)
@@ -6,8 +6,8 @@
  * Licensed under GPLv2
  */
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
 
 / {
        memory {
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index f620ce4..eac6a21 100644 (file)
@@ -8,7 +8,7 @@
 
 /dts-v1/;
 
-/include/ "kirkwood-sheevaplug-common.dtsi"
+#include "kirkwood-sheevaplug-common.dtsi"
 
 / {
        model = "Globalscale Technologies eSATA SheevaPlug";
index bf1dff2..bb61918 100644 (file)
@@ -8,7 +8,7 @@
 
 /dts-v1/;
 
-/include/ "kirkwood-sheevaplug-common.dtsi"
+#include "kirkwood-sheevaplug-common.dtsi"
 
 / {
        model = "Globalscale Technologies SheevaPlug";
index f2052d7..30842b4 100644 (file)
@@ -1,7 +1,7 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6282.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6282.dtsi"
 
 / {
        model = "Univeral Scientific Industrial Co. Topkick-1281P2";
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               device_type = "ethernet-phy";
+               reg = <0>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
index 6dd1038..f755bc1 100644 (file)
@@ -1,8 +1,8 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
-/include/ "kirkwood-ts219.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
+#include "kirkwood-ts219.dtsi"
 
 / {
        ocp@f1000000 {
@@ -50,4 +50,6 @@
                        gpios = <&gpio0 16 1>;
                };
        };
-};
\ No newline at end of file
+};
+
+&ethphy0 { reg = <8>; };
index 6fdc5ff..9efcd2d 100644 (file)
@@ -1,10 +1,21 @@
 /dts-v1/;
 
-/include/ "kirkwood.dtsi"
-/include/ "kirkwood-6282.dtsi"
-/include/ "kirkwood-ts219.dtsi"
+#include "kirkwood.dtsi"
+#include "kirkwood-6282.dtsi"
+#include "kirkwood-ts219.dtsi"
 
 / {
+       mbus {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@2,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
        ocp@f1000000 {
                pinctrl: pinctrl@10000 {
 
                                marvell,function = "gpio";
                        };
                };
-               pcie-controller {
-                       status = "okay";
-
-                       pcie@2,0 {
-                               status = "okay";
-                       };
-               };
-
        };
 
        gpio_keys {
@@ -58,4 +61,6 @@
                        gpios = <&gpio1 5 1>;
                };
        };
-};
\ No newline at end of file
+};
+
+&ethphy0 { reg = <0>; };
index 0c9a94c..39158cf 100644 (file)
                bootargs = "console=ttyS0,115200n8";
        };
 
+       mbus {
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
        ocp@f1000000 {
                i2c@11000 {
                        status = "okay";
                        status = "okay";
                        nr-ports = <2>;
                };
-               pcie-controller {
-                       status = "okay";
+       };
+};
 
-                       pcie@1,0 {
-                               status = "okay";
-                       };
-               };
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy {
+               device_type = "ethernet-phy";
+                /* overwrite reg property in board file */
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
        };
 };
index 9809fc1..cf7aeaf 100644 (file)
@@ -1,5 +1,7 @@
 /include/ "skeleton.dtsi"
 
+#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
+
 / {
        compatible = "marvell,kirkwood";
        interrupt-parent = <&intc>;
               gpio0 = &gpio0;
               gpio1 = &gpio1;
        };
-       intc: interrupt-controller {
-               compatible = "marvell,orion-intc", "marvell,intc";
-               interrupt-controller;
-               #interrupt-cells = <1>;
-               reg = <0xf1020204 0x04>,
-                     <0xf1020214 0x04>;
+
+       mbus {
+               compatible = "marvell,kirkwood-mbus", "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               controller = <&mbusc>;
+               pcie-mem-aperture = <0xe0000000 0x10000000>; /* 256 MiB memory space */
+               pcie-io-aperture  = <0xf2000000 0x100000>;   /*   1 MiB    I/O space */
        };
 
        ocp@f1000000 {
                compatible = "simple-bus";
                ranges = <0x00000000 0xf1000000 0x0100000
-                         0xe0000000 0xe0000000 0x8100000 /* PCIE */
                          0xf4000000 0xf4000000 0x0000400
                          0xf5000000 0xf5000000 0x0000400>;
                #address-cells = <1>;
                #size-cells = <1>;
 
+               mbusc: mbus-controller@20000 {
+                       compatible = "marvell,mbus-controller";
+                       reg = <0x20000 0x80>, <0x1500 0x20>;
+               };
+
+               timer: timer@20300 {
+                       compatible = "marvell,orion-timer";
+                       reg = <0x20300 0x20>;
+                       interrupt-parent = <&bridge_intc>;
+                       interrupts = <1>, <2>;
+                       clocks = <&core_clk 0>;
+               };
+
+               intc: main-interrupt-ctrl@20200 {
+                       compatible = "marvell,orion-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       reg = <0x20200 0x10>, <0x20210 0x10>;
+               };
+
+               bridge_intc: bridge-interrupt-ctrl@20110 {
+                       compatible = "marvell,orion-bridge-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       reg = <0x20110 0x8>;
+                       interrupts = <1>;
+                       marvell,#interrupts = <6>;
+               };
+
                core_clk: core-clocks@10030 {
                        compatible = "marvell,kirkwood-core-clock";
                        reg = <0x10030 0x4>;
                        #clock-cells = <1>;
                };
 
-               wdt@20300 {
+               wdt: watchdog-timer@20300 {
                        compatible = "marvell,orion-wdt";
                        reg = <0x20300 0x28>;
+                       interrupt-parent = <&bridge_intc>;
+                       interrupts = <3>;
                        clocks = <&gate_clk 7>;
                        status = "okay";
                };
                        clocks = <&gate_clk 17>;
                        status = "okay";
                };
+
+               mdio: mdio-bus@72004 {
+                       compatible = "marvell,orion-mdio";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x72004 0x84>;
+                       interrupts = <46>;
+                       clocks = <&gate_clk 0>;
+                       status = "disabled";
+
+                       /* add phy nodes in board file */
+               };
+
+               eth0: ethernet-controller@72000 {
+                       compatible = "marvell,kirkwood-eth";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x72000 0x4000>;
+                       clocks = <&gate_clk 0>;
+                       marvell,tx-checksum-limit = <1600>;
+                       status = "disabled";
+
+                       ethernet0-port@0 {
+                               device_type = "network";
+                               compatible = "marvell,kirkwood-eth-port";
+                               reg = <0>;
+                               interrupts = <11>;
+                               /* overwrite MAC address in bootloader */
+                               local-mac-address = [00 00 00 00 00 00];
+                               /* set phy-handle property in board file */
+                       };
+               };
+
+               eth1: ethernet-controller@76000 {
+                       compatible = "marvell,kirkwood-eth";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x76000 0x4000>;
+                       clocks = <&gate_clk 19>;
+                       marvell,tx-checksum-limit = <1600>;
+                       status = "disabled";
+
+                       ethernet1-port@0 {
+                               device_type = "network";
+                               compatible = "marvell,kirkwood-eth-port";
+                               reg = <0>;
+                               interrupts = <15>;
+                               /* overwrite MAC address in bootloader */
+                               local-mac-address = [00 00 00 00 00 00];
+                               /* set phy-handle property in board file */
+                       };
+               };
        };
 };
index 0077fc8..aed83de 100644 (file)
                };
        };
 };
+
+&mdio {
+       status = "okay";
+
+       ethphy: ethernet-phy {
+               device-type = "ethernet-phy";
+               reg = <8>;
+       };
+};
+
+&eth {
+       status = "okay";
+
+       ethernet-port@0 {
+               phy-handle = <&ethphy>;
+       };
+};
index 892c64e..e06c37e 100644 (file)
        aliases {
                gpio0 = &gpio0;
        };
+
        intc: interrupt-controller {
-               compatible = "marvell,orion-intc", "marvell,intc";
+               compatible = "marvell,orion-intc";
                interrupt-controller;
                #interrupt-cells = <1>;
-               reg = <0xf1020204 0x04>;
+               reg = <0xf1020200 0x08>;
        };
 
        ocp@f1000000 {
                        interrupts = <28>;
                        status = "okay";
                };
+
+               mdio: mdio-bus@72004 {
+                       compatible = "marvell,orion-mdio";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x72004 0x84>;
+                       interrupts = <22>;
+                       status = "disabled";
+
+                       /* add phy nodes in board file */
+               };
+
+               eth: ethernet-controller@72000 {
+                       compatible = "marvell,orion-eth";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x72000 0x4000>;
+                       marvell,tx-checksum-limit = <1600>;
+                       status = "disabled";
+
+                       ethernet-port@0 {
+                               device_type = "network";
+                               compatible = "marvell,orion-eth-port";
+                               reg = <0>;
+                               /* overwrite MAC address in bootloader */
+                               local-mac-address = [00 00 00 00 00 00];
+                               /* set phy-handle property in board file */
+                       };
+               };
        };
 };
index f9d92da..83bb0ef 100644 (file)
                        marvell,intc-priority;
                        marvell,intc-nr-irqs = <56>;
                };
+
+               gpio: gpio@40e00000 {
+                       compatible = "intel,pxa3xx-gpio";
+                       reg = <0x40e00000 0x10000>;
+                       interrupt-names = "gpio0", "gpio1", "gpio_mux";
+                       interrupts = <8 9 10>;
+                       gpio-controller;
+                       #gpio-cells = <0x2>;
+                       interrupt-controller;
+                       #interrupt-cells = <0x2>;
+               };
        };
 };
index f603c69..e657a9d 100644 (file)
                };
        };
 };
+
+&i2c5 {
+       vdd_dvfs: max8973@1b {
+               compatible = "maxim,max8973";
+               reg = <0x1b>;
+
+               regulator-min-microvolt = <935000>;
+               regulator-max-microvolt = <1200000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+};
+
+&cpu0 {
+       cpu0-supply = <&vdd_dvfs>;
+       operating-points = <
+               /* kHz  uV */
+               1950000 1115000
+               1462500  995000
+       >;
+       voltage-tolerance = <1>; /* 1% */
+};
index 4ff2019..6c26caa 100644 (file)
                interrupt-parent = <&gic>;
                interrupts = <0 69 4>;
        };
+
+       i2c0: i2c@e6500000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6500000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 174 0x4>;
+       };
+
+       i2c1: i2c@e6510000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6510000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 175 0x4>;
+       };
+
+       i2c2: i2c@e6520000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6520000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 176 0x4>;
+       };
+
+       i2c3: i2c@e6530000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6530000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 177 0x4>;
+       };
+
+       i2c4: i2c@e6540000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6540000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 178 0x4>;
+       };
+
+       i2c5: i2c@e60b0000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe60b0000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 179 0x4>;
+       };
+
+       i2c6: i2c@e6550000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6550000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 184 0x4>;
+       };
+
+       i2c7: i2c@e6560000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6560000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 185 0x4>;
+       };
+
+       i2c8: i2c@e6570000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0 0xe6570000 0 0x428>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 173 0x4>;
+       };
+
+       mmcif0: mmcif@ee200000 {
+               compatible = "renesas,sh-mmcif";
+               reg = <0 0xee200000 0 0x80>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 169 0x4>;
+               reg-io-width = <4>;
+               status = "disabled";
+       };
+
+       mmcif1: mmcif@ee220000 {
+               compatible = "renesas,sh-mmcif";
+               reg = <0 0xee220000 0 0x80>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 170 0x4>;
+               reg-io-width = <4>;
+               status = "disabled";
+       };
+
+       pfc: pfc@e6050000 {
+               compatible = "renesas,pfc-r8a73a4";
+               reg = <0 0xe6050000 0 0x9000>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
+       sdhi0: sdhi@ee100000 {
+               compatible = "renesas,r8a73a4-sdhi";
+               reg = <0 0xee100000 0 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 165 4>;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
+
+       sdhi1: sdhi@ee120000 {
+               compatible = "renesas,r8a73a4-sdhi";
+               reg = <0 0xee120000 0 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 166 4>;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
+
+       sdhi2: sdhi@ee140000 {
+               compatible = "renesas,r8a73a4-sdhi";
+               reg = <0 0xee140000 0 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 167 4>;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
 };
index 09ea22c..366f729 100644 (file)
@@ -10,6 +10,7 @@
 
 /dts-v1/;
 /include/ "r8a7740.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "armadillo 800 eva reference";
                regulator-boot-on;
        };
 
+       leds {
+               compatible = "gpio-leds";
+               led1 {
+                       gpios = <&pfc 102 GPIO_ACTIVE_HIGH>;
+               };
+               led2 {
+                       gpios = <&pfc 111 GPIO_ACTIVE_HIGH>;
+               };
+               led3 {
+                       gpios = <&pfc 110 GPIO_ACTIVE_HIGH>;
+               };
+               led4 {
+                       gpios = <&pfc 177 GPIO_ACTIVE_HIGH>;
+               };
+       };
 };
 
 &i2c0 {
                reg = <0x55>;
                interrupt-parent = <&irqpin1>;
                interrupts = <2 0>; /* IRQ10: hwirq 2 on irqpin1 */
+               pinctrl-0 = <&st1232_pins>;
+               pinctrl-names = "default";
+               gpios = <&pfc 166 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&pfc {
+       pinctrl-0 = <&scifa1_pins>;
+       pinctrl-names = "default";
+
+       scifa1_pins: scifa1 {
+               renesas,groups = "scifa1_data";
+               renesas,function = "scifa1";
+       };
+
+       st1232_pins: st1232 {
+               renesas,groups = "intc_irq10";
+               renesas,function = "intc";
        };
 };
index 24e9306..e18a195 100644 (file)
                              0 72 0x4
                              0 73 0x4>;
        };
+
+       pfc: pfc@e6050000 {
+               compatible = "renesas,pfc-r8a7740";
+               reg = <0xe6050000 0x8000>,
+                     <0xe605800c 0x20>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
 };
index 4743735..45ac404 100644 (file)
                reg = <0xfe438000 0x1000>,
                      <0xfe430000 0x100>;
        };
+
+       gpio0: gpio@ffc40000 {
+               compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
+               reg = <0xffc40000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 103 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 0 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio1: gpio@ffc41000 {
+               compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
+               reg = <0xffc41000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 103 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 32 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio2: gpio@ffc42000 {
+               compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
+               reg = <0xffc42000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 103 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 64 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio3: gpio@ffc43000 {
+               compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
+               reg = <0xffc43000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 103 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 96 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio4: gpio@ffc44000 {
+               compatible = "renesas,gpio-r8a7778", "renesas,gpio-rcar";
+               reg = <0xffc44000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 103 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 128 27>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       pfc: pfc@fffc0000 {
+               compatible = "renesas,pfc-r8a7778";
+               reg = <0xfffc000 0x118>;
+               #gpio-range-cells = <3>;
+       };
 };
index 72be4c8..b64705b 100644 (file)
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 /include/ "r8a7779.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "marzen";
@@ -37,6 +38,9 @@
        lan0@18000000 {
                compatible = "smsc,lan9220", "smsc,lan9115";
                reg = <0x18000000 0x100>;
+               pinctrl-0 = <&lan0_pins>;
+               pinctrl-names = "default";
+
                phy-mode = "mii";
                interrupt-parent = <&gic>;
                interrupts = <0 28 0x4>;
                vddvario-supply = <&fixedregulator3v3>;
                vdd33a-supply = <&fixedregulator3v3>;
        };
+
+       leds {
+               compatible = "gpio-leds";
+               led2 {
+                       gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
+               };
+               led3 {
+                       gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
+               };
+               led4 {
+                       gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&pfc {
+       pinctrl-0 = <&scif2_pins &scif4_pins &sdhi0_pins>;
+       pinctrl-names = "default";
+
+       lan0_pins: lan0 {
+               intc {
+                       renesas,groups = "intc_irq1_b";
+                       renesas,function = "intc";
+               };
+               lbsc {
+                       renesas,groups = "lbsc_ex_cs0";
+                       renesas,function = "lbsc";
+               };
+       };
+
+       scif2_pins: scif2 {
+               renesas,groups = "scif2_data_c";
+               renesas,function = "scif2";
+       };
+
+       scif4_pins: scif4 {
+               renesas,groups = "scif4_data";
+               renesas,function = "scif4";
+       };
+
+       sdhi0_pins: sdhi0 {
+               renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd",
+                                "sdhi0_wp";
+               renesas,function = "sdhi0";
+       };
 };
index 7f146c6..e9fbe3d 100644 (file)
                       <0xf0000100 0x100>;
         };
 
+       gpio0: gpio@ffc40000 {
+               compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+               reg = <0xffc40000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 141 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 0 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio1: gpio@ffc41000 {
+               compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+               reg = <0xffc41000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 142 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 32 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio2: gpio@ffc42000 {
+               compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+               reg = <0xffc42000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 143 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 64 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio3: gpio@ffc43000 {
+               compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+               reg = <0xffc43000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 144 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 96 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio4: gpio@ffc44000 {
+               compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+               reg = <0xffc44000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 145 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 128 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio5: gpio@ffc45000 {
+               compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+               reg = <0xffc45000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 146 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 160 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio6: gpio@ffc46000 {
+               compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+               reg = <0xffc46000 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 147 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 192 9>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
        irqpin0: irqpin@fe780010 {
                compatible = "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupts = <0 81 0x4>;
        };
 
+       pfc: pfc@fffc0000 {
+               compatible = "renesas,pfc-r8a7779";
+               reg = <0xfffc0000 0x23c>;
+               #gpio-range-cells = <3>;
+       };
+
        thermal@ffc48000 {
                compatible = "renesas,rcar-thermal";
                reg = <0xffc48000 0x38>;
index 339d9b1..3b879e7 100644 (file)
                interrupts = <1 9 0xf04>;
        };
 
+       gpio0: gpio@ffc40000 {
+               compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+               reg = <0 0xffc40000 0 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 4 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 0 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio1: gpio@ffc41000 {
+               compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+               reg = <0 0xffc41000 0 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 5 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 32 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio2: gpio@ffc42000 {
+               compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+               reg = <0 0xffc42000 0 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 6 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 64 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio3: gpio@ffc43000 {
+               compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+               reg = <0 0xffc43000 0 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 7 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 96 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio4: gpio@ffc44000 {
+               compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+               reg = <0 0xffc44000 0 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 8 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 128 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
+       gpio5: gpio@ffc45000 {
+               compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+               reg = <0 0xffc45000 0 0x2c>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 9 0x4>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 160 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+       };
+
        timer {
                compatible = "arm,armv7-timer";
                interrupts = <1 13 0xf08>,
                interrupt-parent = <&gic>;
                interrupts = <0 0 4>, <0 1 4>, <0 2 4>, <0 3 4>;
        };
+
+       mmcif0: mmcif@ee200000 {
+               compatible = "renesas,sh-mmcif";
+               reg = <0 0xee200000 0 0x80>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 169 0x4>;
+               reg-io-width = <4>;
+               status = "disabled";
+       };
+
+       mmcif1: mmcif@ee220000 {
+               compatible = "renesas,sh-mmcif";
+               reg = <0 0xee220000 0 0x80>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 170 0x4>;
+               reg-io-width = <4>;
+               status = "disabled";
+       };
+
+       pfc: pfc@e6060000 {
+               compatible = "renesas,pfc-r8a7790";
+               reg = <0 0xe6060000 0 0x250>;
+               #gpio-range-cells = <3>;
+       };
+
+       sdhi0: sdhi@ee100000 {
+               compatible = "renesas,r8a7790-sdhi";
+               reg = <0 0xee100000 0 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 165 4>;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
+
+       sdhi1: sdhi@ee120000 {
+               compatible = "renesas,r8a7790-sdhi";
+               reg = <0 0xee120000 0 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 166 4>;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
+
+       sdhi2: sdhi@ee140000 {
+               compatible = "renesas,r8a7790-sdhi";
+               reg = <0 0xee140000 0 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 167 4>;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
+
+       sdhi3: sdhi@ee160000 {
+               compatible = "renesas,r8a7790-sdhi";
+               reg = <0 0xee160000 0 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 168 4>;
+               cap-sd-highspeed;
+               status = "disabled";
+       };
 };
index a1d5e25..ff63fbb 100644 (file)
                };
        };
 
+       pmu {
+               compatible = "arm,cortex-a5-pmu";
+               interrupts = <46 IRQ_TYPE_LEVEL_HIGH 0>;
+       };
+
        memory {
                reg = <0x20000000 0x8000000>;
        };
index 7bf020e..249f65b 100644 (file)
                        reg = <0x0>;
                };
        };
+
+       pfc: pfc@e6050000 {
+               compatible = "renesas,pfc-sh7372";
+               reg = <0xe6050000 0x8000>,
+                     <0xe605801c 0x1c>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
 };
index b6f759e..b99e890 100644 (file)
@@ -13,6 +13,7 @@
 
 /dts-v1/;
 /include/ "sh73a0.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "KZM-A9-GT";
                regulator-boot-on;
        };
 
+       vmmc_sdhi0: regulator@2 {
+               compatible = "regulator-fixed";
+               regulator-name = "SDHI0 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&pfc 15 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       vmmc_sdhi2: regulator@3 {
+               compatible = "regulator-fixed";
+               regulator-name = "SDHI2 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&pfc 14 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
        lan9220@10000000 {
                compatible = "smsc,lan9220", "smsc,lan9115";
                reg = <0x10000000 0x100>;
                vddvario-supply = <&reg_1p8v>;
                vdd33a-supply = <&reg_3p3v>;
        };
+
+       leds {
+               compatible = "gpio-leds";
+               led1 {
+                       gpios = <&pfc 20 GPIO_ACTIVE_LOW>;
+               };
+               led2 {
+                       gpios = <&pfc 21 GPIO_ACTIVE_LOW>;
+               };
+               led3 {
+                       gpios = <&pfc 22 GPIO_ACTIVE_LOW>;
+               };
+               led4 {
+                       gpios = <&pfc 23 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &i2c0 {
        };
 };
 
+&i2c3 {
+       pinctrl-0 = <&i2c3_pins>;
+       pinctrl-names = "default";
+};
+
 &mmcif {
+       pinctrl-0 = <&mmcif_pins>;
+       pinctrl-names = "default";
+
        bus-width = <8>;
        vmmc-supply = <&reg_1p8v>;
        status = "okay";
 };
 
+&pfc {
+       pinctrl-0 = <&scifa4_pins>;
+       pinctrl-names = "default";
+
+       i2c3_pins: i2c3 {
+               renesas,groups = "i2c3_1";
+               renesas,function = "i2c3";
+       };
+
+       mmcif_pins: mmcif {
+               mux {
+                       renesas,groups = "mmc0_data8_0", "mmc0_ctrl_0";
+                       renesas,function = "mmc0";
+               };
+               cfg {
+                       renesas,groups = "mmc0_data8_0";
+                       renesas,pins = "PORT279";
+                       bias-pull-up;
+               };
+       };
+
+       scifa4_pins: scifa4 {
+               renesas,groups = "scifa4_data", "scifa4_ctrl";
+               renesas,function = "scifa4";
+       };
+
+       sdhi0_pins: sdhi0 {
+               renesas,groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd", "sdhi0_wp";
+               renesas,function = "sdhi0";
+       };
+
+       sdhi2_pins: sdhi2 {
+               renesas,groups = "sdhi2_data4", "sdhi2_ctrl";
+               renesas,function = "sdhi2";
+       };
+};
+
 &sdhi0 {
-       vmmc-supply = <&reg_3p3v>;
+       pinctrl-0 = <&sdhi0_pins>;
+       pinctrl-names = "default";
+
+       vmmc-supply = <&vmmc_sdhi0>;
        bus-width = <4>;
        status = "okay";
 };
 
 &sdhi2 {
-       vmmc-supply = <&reg_3p3v>;
+       pinctrl-0 = <&sdhi2_pins>;
+       pinctrl-names = "default";
+
+       vmmc-supply = <&vmmc_sdhi2>;
        bus-width = <4>;
        broken-cd;
        status = "okay";
index b977502..86e79fe 100644 (file)
                cap-sd-highspeed;
                status = "disabled";
        };
+
+       pfc: pfc@e6050000 {
+               compatible = "renesas,pfc-sh73a0";
+               reg = <0xe6050000 0x8000>,
+                     <0xe605801c 0x1c>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
 };
index 1599415..b5d7f36 100644 (file)
@@ -9,5 +9,5 @@
        #size-cells = <2>;
        chosen { };
        aliases { };
-       memory { device_type = "memory"; reg = <0 0>; };
+       memory { device_type = "memory"; reg = <0 0 0 0>; };
 };
index bee62a2..e273fa9 100644 (file)
                };
 
                timer0: timer0@ffc08000 {
-                       compatible = "snps,dw-apb-timer-sp";
+                       compatible = "snps,dw-apb-timer";
                        interrupts = <0 167 4>;
                        reg = <0xffc08000 0x1000>;
                };
 
                timer1: timer1@ffc09000 {
-                       compatible = "snps,dw-apb-timer-sp";
+                       compatible = "snps,dw-apb-timer";
                        interrupts = <0 168 4>;
                        reg = <0xffc09000 0x1000>;
                };
 
                timer2: timer2@ffd00000 {
-                       compatible = "snps,dw-apb-timer-osc";
+                       compatible = "snps,dw-apb-timer";
                        interrupts = <0 169 4>;
                        reg = <0xffd00000 0x1000>;
                };
 
                timer3: timer3@ffd01000 {
-                       compatible = "snps,dw-apb-timer-osc";
+                       compatible = "snps,dw-apb-timer";
                        interrupts = <0 170 4>;
                        reg = <0xffd01000 0x1000>;
                };
diff --git a/arch/arm/boot/dts/ste-ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ste-ccu8540-pinctrl.dtsi
new file mode 100644 (file)
index 0000000..e079996
--- /dev/null
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2012 ST-Ericsson
+ *
+ * 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 "ste-nomadik-pinctrl.dtsi"
+
+/ {
+       soc {
+               pinctrl {
+                       uart0 {
+                               uart0_default_mux: uart0_mux {
+                                       default_mux {
+                                               ste,function = "u0";
+                                               ste,pins = "u0_a_1";
+                                       };
+                               };
+
+                               uart0_default_mode: uart0_default {
+                                       default_cfg1 {
+                                               ste,pins = "GPIO0", "GPIO2";
+                                               ste,config = <&in_pu>;
+                                       };
+
+                                       default_cfg2 {
+                                               ste,pins = "GPIO1", "GPIO3";
+                                               ste,config = <&out_hi>;
+                                       };
+                               };
+
+                               uart0_sleep_mode: uart0_sleep {
+                                       sleep_cfg1 {
+                                               ste,pins = "GPIO0", "GPIO2";
+                                               ste,config = <&slpm_in_pu>;
+                                       };
+
+                                       sleep_cfg2 {
+                                               ste,pins = "GPIO1", "GPIO3";
+                                               ste,config = <&slpm_out_hi>;
+                                       };
+                               };
+                       };
+
+                       uart2 {
+                               uart2_default_mode: uart2_default {
+                                       default_mux {
+                                               ste,function = "u2";
+                                               ste,pins = "u2txrx_a_1";
+                                       };
+
+                                       default_cfg1 {
+                                               ste,pins = "GPIO120";
+                                               ste,config = <&in_pu>;
+                                       };
+
+                                       default_cfg2 {
+                                               ste,pins = "GPIO121";
+                                               ste,config = <&out_hi>;
+                                       };
+                               };
+
+                               uart2_sleep_mode: uart2_sleep {
+                                       sleep_cfg1 {
+                                               ste,pins = "GPIO120";
+                                               ste,config = <&slpm_in_pu>;
+                                       };
+
+                                       sleep_cfg2 {
+                                               ste,pins = "GPIO121";
+                                               ste,config = <&slpm_out_hi>;
+                                       };
+                               };
+                       };
+
+                       i2c0 {
+                               i2c0_default_mux: i2c_mux {
+                                       default_mux {
+                                               ste,function = "i2c0";
+                                               ste,pins = "i2c0_a_1";
+                                       };
+                               };
+
+                               i2c0_default_mode: i2c_default {
+                                       default_cfg1 {
+                                               ste,pins = "GPIO147", "GPIO148";
+                                               ste,config = <&in_pu>;
+                                       };
+                               };
+
+                               i2c0_sleep_mode: i2c_sleep {
+                                       sleep_cfg1 {
+                                               ste,pins = "GPIO147", "GPIO148";
+                                               ste,config = <&slpm_in_pu>;
+                                       };
+                               };
+                       };
+
+                       i2c1 {
+                               i2c1_default_mux: i2c_mux {
+                                       default_mux {
+                                               ste,function = "i2c1";
+                                               ste,pins = "i2c1_b_2";
+                                       };
+                               };
+
+                               i2c1_default_mode: i2c_default {
+                                       default_cfg1 {
+                                               ste,pins = "GPIO16", "GPIO17";
+                                               ste,config = <&in_pu>;
+                                       };
+                               };
+
+                               i2c1_sleep_mode: i2c_sleep {
+                                       sleep_cfg1 {
+                                               ste,pins = "GPIO16", "GPIO17";
+                                               ste,config = <&slpm_in_pu>;
+                                       };
+                               };
+                       };
+
+                       i2c2 {
+                               i2c2_default_mux: i2c_mux {
+                                       default_mux {
+                                               ste,function = "i2c2";
+                                               ste,pins = "i2c2_b_2";
+                                       };
+                               };
+
+                               i2c2_default_mode: i2c_default {
+                                       default_cfg1 {
+                                               ste,pins = "GPIO10", "GPIO11";
+                                               ste,config = <&in_pu>;
+                                       };
+                               };
+
+                               i2c2_sleep_mode: i2c_sleep {
+                                       sleep_cfg1 {
+                                               ste,pins = "GPIO11", "GPIO11";
+                                               ste,config = <&slpm_in_pu>;
+                                       };
+                               };
+                       };
+
+                       i2c4 {
+                               i2c4_default_mux: i2c_mux {
+                                       default_mux {
+                                               ste,function = "i2c4";
+                                               ste,pins = "i2c4_b_2";
+                                       };
+                               };
+
+                               i2c4_default_mode: i2c_default {
+                                       default_cfg1 {
+                                               ste,pins = "GPIO122", "GPIO123";
+                                               ste,config = <&in_pu>;
+                                       };
+                               };
+
+                               i2c4_sleep_mode: i2c_sleep {
+                                       sleep_cfg1 {
+                                               ste,pins = "GPIO122", "GPIO123";
+                                               ste,config = <&slpm_in_pu>;
+                                       };
+                               };
+                       };
+
+                       i2c5 {
+                               i2c5_default_mux: i2c_mux {
+                                       default_mux {
+                                               ste,function = "i2c5";
+                                               ste,pins = "i2c5_c_2";
+                                       };
+                               };
+
+                               i2c5_default_mode: i2c_default {
+                                       default_cfg1 {
+                                               ste,pins = "GPIO118", "GPIO119";
+                                               ste,config = <&in_pu>;
+                                       };
+                               };
+
+                               i2c5_sleep_mode: i2c_sleep {
+                                       sleep_cfg1 {
+                                               ste,pins = "GPIO118", "GPIO119";
+                                               ste,config = <&slpm_in_pu>;
+                                       };
+                               };
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/ste-ccu8540.dts b/arch/arm/boot/dts/ste-ccu8540.dts
new file mode 100644 (file)
index 0000000..7f3baf5
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2013 ST-Ericsson AB
+ *
+ * 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
+ */
+
+/dts-v1/;
+#include "ste-dbx5x0.dtsi"
+#include "ste-ccu8540-pinctrl.dtsi"
+
+/ {
+       model = "ST-Ericsson U8540 platform with Device Tree";
+       compatible = "st-ericsson,ccu8540", "st-ericsson,u8540";
+
+       memory@0 {
+               reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>;
+       };
+
+       soc {
+               pinctrl {
+                       compatible = "stericsson,db8540-pinctrl";
+               };
+
+               prcmu@80157000 {
+                       reg = <0x80157000 0x2000>, <0x801b0000 0x8000>, <0x801b8000 0x3000>;
+                       reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm";
+               };
+
+               uart@80120000 {
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
+                       pinctrl-1 = <&uart0_sleep_mode>;
+                       status = "okay";
+               };
+
+               uart@80121000 {
+                       status = "okay";
+               };
+
+               uart@80007000 {
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&uart2_default_mode>;
+                       pinctrl-1 = <&uart2_sleep_mode>;
+                       status = "okay";
+               };
+
+               i2c0: i2c@80004000 {
+                       pinctrl-names = "default","sleep";
+                       pinctrl-0 = <&i2c0_default_mux>, <&i2c0_default_mode>;
+                       pinctrl-1 = <&i2c0_sleep_mode>;
+               };
+
+               i2c1: i2c@80122000 {
+                       pinctrl-names = "default","sleep";
+                       pinctrl-0 = <&i2c1_default_mux>, <&i2c1_default_mode>;
+                       pinctrl-1 = <&i2c1_sleep_mode>;
+               };
+
+               i2c2: i2c@80128000 {
+                       pinctrl-names = "default","sleep";
+                       pinctrl-0 = <&i2c2_default_mux>, <&i2c2_default_mode>;
+                       pinctrl-1 = <&i2c2_sleep_mode>;
+               };
+
+               i2c3: i2c@80110000 {
+                       status = "disabled";
+               };
+
+               i2c4: i2c@8012a000 {
+                       pinctrl-names = "default","sleep";
+                       pinctrl-0 = <&i2c4_default_mux>, <&i2c4_default_mode>;
+                       pinctrl-1 = <&i2c4_sleep_mode>;
+               };
+
+               i2c5: i2c@80001000 {
+                       pinctrl-names = "default","sleep";
+                       pinctrl-0 = <&i2c5_default_mux>, <&i2c5_default_mode>;
+                       pinctrl-1 = <&i2c5_sleep_mode>;
+               };
+       };
+};
similarity index 98%
rename from arch/arm/boot/dts/ccu9540.dts
rename to arch/arm/boot/dts/ste-ccu9540.dts
index ed29ec7..2295087 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-#include "dbx5x0.dtsi"
+#include "ste-dbx5x0.dtsi"
 
 / {
        model = "ST-Ericsson CCU9540 platform with Device Tree";
similarity index 96%
rename from arch/arm/boot/dts/dbx5x0.dtsi
rename to arch/arm/boot/dts/ste-dbx5x0.dtsi
index a152945..1c1091e 100644 (file)
                                             <22 IRQ_TYPE_LEVEL_HIGH>;
                                interrupt-names = "IRQ_HOTMON_LOW", "IRQ_HOTMON_HIGH";
                                status = "disabled";
-                        };
+                       };
 
                        db8500-prcmu-regulators {
                                compatible = "stericsson,db8500-prcmu-regulator";
                                        stericsson,earpeice-cmv = <950>; /* Units in mV. */
                                };
 
+                               ext_regulators: ab8500-ext-regulators {
+                                       compatible = "stericsson,ab8500-ext-regulator";
+
+                                       ab8500_ext1_reg: ab8500_ext1 {
+                                               regulator-compatible = "ab8500_ext1";
+                                               regulator-min-microvolt = <1800000>;
+                                               regulator-max-microvolt = <1800000>;
+                                               regulator-boot-on;
+                                               regulator-always-on;
+                                       };
+
+                                       ab8500_ext2_reg: ab8500_ext2 {
+                                               regulator-compatible = "ab8500_ext2";
+                                               regulator-min-microvolt = <1360000>;
+                                               regulator-max-microvolt = <1360000>;
+                                               regulator-boot-on;
+                                               regulator-always-on;
+                                       };
+
+                                       ab8500_ext3_reg: ab8500_ext3 {
+                                               regulator-compatible = "ab8500_ext3";
+                                               regulator-min-microvolt = <3400000>;
+                                               regulator-max-microvolt = <3400000>;
+                                               regulator-boot-on;
+                                       };
+                               };
+
                                ab8500-regulators {
                                        compatible = "stericsson,ab8500-regulator";
+                                       vin-supply = <&ab8500_ext3_reg>;
 
                                        // supplies to the display/camera
                                        ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
similarity index 99%
rename from arch/arm/boot/dts/href.dtsi
rename to arch/arm/boot/dts/ste-href.dtsi
index 9db41b9..370e03f 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/irq.h>
-#include "dbx5x0.dtsi"
+#include "ste-dbx5x0.dtsi"
 
 / {
        memory {
similarity index 92%
rename from arch/arm/boot/dts/hrefprev60.dts
rename to arch/arm/boot/dts/ste-hrefprev60.dts
index c6bb07d..d8d3b99 100644 (file)
@@ -10,9 +10,9 @@
  */
 
 /dts-v1/;
-#include "dbx5x0.dtsi"
-#include "href.dtsi"
-#include "stuib.dtsi"
+#include "ste-dbx5x0.dtsi"
+#include "ste-href.dtsi"
+#include "ste-stuib.dtsi"
 
 / {
        model = "ST-Ericsson HREF (pre-v60) platform with Device Tree";
similarity index 98%
rename from arch/arm/boot/dts/hrefv60plus.dts
rename to arch/arm/boot/dts/ste-hrefv60plus.dts
index 3d580d6..6e52ebb 100644 (file)
@@ -10,9 +10,9 @@
  */
 
 /dts-v1/;
-#include "dbx5x0.dtsi"
-#include "href.dtsi"
-#include "stuib.dtsi"
+#include "ste-dbx5x0.dtsi"
+#include "ste-href.dtsi"
+#include "ste-stuib.dtsi"
 
 / {
        model = "ST-Ericsson HREF (v60+) platform with Device Tree";
diff --git a/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
new file mode 100644 (file)
index 0000000..efddee9
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2012 ST-Ericsson
+ *
+ * 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/pinctrl/nomadik.h>
+
+/ {
+       in_nopull: in_nopull {
+               ste,input = <INPUT_NOPULL>;
+       };
+
+       in_pu: input_pull_up {
+               ste,input = <INPUT_PULLUP>;
+       };
+
+       in_pd: input_pull_down {
+               ste,input = <INPUT_PULLDOWN>;
+       };
+
+       out_hi: output_high {
+               ste,output = <OUTPUT_HIGH>;
+       };
+
+       out_lo: output_low {
+               ste,output = <OUTPUT_LOW>;
+       };
+
+       gpio_out_lo: gpio_output_low {
+               ste,gpio = <GPIOMODE_ENABLED>;
+               ste,output = <OUTPUT_LOW>;
+       };
+
+       slpm_in_pu: slpm_in_pu {
+               ste,sleep = <SLPM_ENABLED>;
+               ste,sleep-input = <SLPM_INPUT_PULLUP>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+       };
+
+       slpm_in_wkup_pdis: slpm_in_wkup_pdis {
+               ste,sleep = <SLPM_ENABLED>;
+               ste,sleep-input = <SLPM_DIR_INPUT>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+       };
+
+       slpm_out_lo: slpm_out_lo {
+               ste,sleep = <SLPM_ENABLED>;
+               ste,sleep-output = <SLPM_OUTPUT_LOW>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+       };
+
+       slpm_out_hi: slpm_out_hi {
+               ste,sleep = <SLPM_ENABLED>;
+               ste,sleep-output = <SLPM_OUTPUT_HIGH>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+       };
+
+       slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
+               ste,sleep = <SLPM_ENABLED>;
+               ste,sleep-output = <SLPM_OUTPUT_HIGH>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+       };
+
+       slpm_out_wkup_pdis: slpm_out_wkup_pdis {
+               ste,sleep = <SLPM_ENABLED>;
+               ste,sleep-output = <SLPM_DIR_OUTPUT>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+       };
+
+       in_wkup_pdis: in_wkup_pdis {
+               ste,sleep-input = <SLPM_DIR_INPUT>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+       };
+
+       out_hi_wkup_pdis: out_hi_wkup_pdis {
+               ste,sleep-output = <SLPM_OUTPUT_HIGH>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+       };
+
+       out_wkup_pdis: out_wkup_pdis {
+               ste,sleep-output = <SLPM_DIR_OUTPUT>;
+               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+       };
+};
index a3acfa7..9169d30 100644 (file)
                        };
                };
                i2c0 {
+                       i2c0_default_mux: i2c0_mux {
+                               i2c0_default_mux {
+                                       ste,function = "i2c0";
+                                       ste,pins = "i2c0_a_1";
+                               };
+                       };
                        i2c0_default_mode: i2c0_default {
                                i2c0_default_cfg {
                                        ste,pins = "GPIO62_D3", "GPIO63_D2";
-                                       ste,input = <1>;
+                                       ste,input = <0>;
                                };
                        };
                };
                i2c1 {
+                       i2c1_default_mux: i2c1_mux {
+                               i2c1_default_mux {
+                                       ste,function = "i2c1";
+                                       ste,pins = "i2c1_a_1";
+                               };
+                       };
                        i2c1_default_mode: i2c1_default {
                                i2c1_default_cfg {
                                        ste,pins = "GPIO53_L4", "GPIO54_L3";
-                                       ste,input = <1>;
+                                       ste,input = <0>;
                                };
                        };
                };
                        i2c2_default_mode: i2c2_default {
                                i2c2_default_cfg {
                                        ste,pins = "GPIO73_C21", "GPIO74_C20";
-                                       ste,input = <1>;
+                                       ste,input = <0>;
                                };
                        };
                };
 
        /* I2C0 connected to the STw4811 power management chip */
        i2c0 {
-               compatible = "i2c-gpio";
-               gpios = <&gpio1 31 0>, /* sda */
-                       <&gpio1 30 0>; /* scl */
+               compatible = "st,nomadik-i2c", "arm,primecell";
+               reg = <0x101f8000 0x1000>;
+               interrupt-parent = <&vica>;
+               interrupts = <20>;
+               clock-frequency = <100000>;
                #address-cells = <1>;
                #size-cells = <0>;
+               clocks = <&i2c0clk>, <&pclki2c0>;
+               clock-names = "mclk", "apb_pclk";
                pinctrl-names = "default";
-               pinctrl-0 = <&i2c0_default_mode>;
+               pinctrl-0 = <&i2c0_default_mux>, <&i2c0_default_mode>;
 
                stw4811@2d {
                           compatible = "st,stw4811";
 
        /* I2C1 connected to various sensors */
        i2c1 {
-               compatible = "i2c-gpio";
-               gpios = <&gpio1 22 0>, /* sda */
-                       <&gpio1 21 0>; /* scl */
+               compatible = "st,nomadik-i2c", "arm,primecell";
+               reg = <0x101f7000 0x1000>;
+               interrupt-parent = <&vica>;
+               interrupts = <21>;
+               clock-frequency = <100000>;
                #address-cells = <1>;
                #size-cells = <0>;
+               clocks = <&i2c1clk>, <&pclki2c1>;
+               clock-names = "mclk", "apb_pclk";
                pinctrl-names = "default";
-               pinctrl-0 = <&i2c1_default_mode>;
+               pinctrl-0 = <&i2c1_default_mux>, <&i2c1_default_mode>;
 
                camera@2d {
                           compatible = "st,camera";
similarity index 93%
rename from arch/arm/boot/dts/snowball.dts
rename to arch/arm/boot/dts/ste-snowball.dts
index 49824be..f1fc128 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-#include "dbx5x0.dtsi"
+#include "ste-dbx5x0.dtsi"
 
 / {
        model = "Calao Systems Snowball platform with device tree";
                        status = "okay";
                };
 
-               i2c@80004000 {
-                       tc3589x@42 {
-                               //compatible = "tc3589x";
-                               reg = <0x42>;
-                               gpios = <&gpio6 25 0x4>;
-                               interrupt-parent = <&gpio6>;
-                       };
-                       tps61052@33 {
-                               //compatible = "tps61052";
-                               reg = <0x33>;
-                       };
-               };
-
-               i2c@80128000 {
-                       lp5521@33 {
-                               // compatible = "lp5521";
-                               reg = <0x33>;
-                       };
-                       lp5521@34 {
-                               // compatible = "lp5521";
-                               reg = <0x34>;
-                       };
-                       bh1780@29 {
-                               // compatible = "rohm,bh1780gli";
-                               reg = <0x33>;
-                       };
-               };
-
                cpufreq-cooling {
                        status = "okay";
                };
                                        compatible = "stericsson,ab8500-gpio";
                                };
 
+                               ext_regulators: ab8500-ext-regulators {
+                                       ab8500_ext1_reg: ab8500_ext1 {
+                                               regulator-name = "ab8500-ext-supply1";
+                                       };
+
+                                       ab8500_ext2_reg_reg: ab8500_ext2 {
+                                               regulator-name = "ab8500-ext-supply2";
+                                       };
+
+                                       ab8500_ext3_reg_reg: ab8500_ext3 {
+                                               regulator-name = "ab8500-ext-supply3";
+                                       };
+                               };
+
                                ab8500-regulators {
                                        ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
                                                regulator-name = "V-DISPLAY";
diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
new file mode 100644 (file)
index 0000000..eb4d73b
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2013 Emilio López
+ *
+ * Emilio López <emilio@elopez.com.ar>
+ *
+ * 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
+ */
+
+/dts-v1/;
+/include/ "sun4i-a10.dtsi"
+
+/ {
+       model = "Mele A1000";
+       compatible = "mele,a1000", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       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>;
+                       };
+               };
+
+               pinctrl@01c20800 {
+                       emac_power_pin_a1000: emac_power_pin@0 {
+                               allwinner,pins = "PH15";
+                               allwinner,function = "gpio_out";
+                               allwinner,drive = <0>;
+                               allwinner,pull = <0>;
+                       };
+
+                       led_pins_a1000: led_pins@0 {
+                               allwinner,pins = "PH10", "PH20";
+                               allwinner,function = "gpio_out";
+                               allwinner,drive = <0>;
+                               allwinner,pull = <0>;
+                       };
+               };
+
+               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";
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_a1000>;
+
+               red {
+                       label = "a1000:red:usr";
+                       gpios = <&pio 7 10 0>;
+               };
+
+               blue {
+                       label = "a1000:blue:usr";
+                       gpios = <&pio 7 20 0>;
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+
+               reg_emac_3v3: emac-3v3 {
+                       compatible = "regulator-fixed";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&emac_power_pin_a1000>;
+                       regulator-name = "emac-3v3";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       enable-active-high;
+                       gpio = <&pio 7 15 0>;
+               };
+       };
+};
index 757c4cd..425a7db 100644 (file)
@@ -26,7 +26,7 @@
                bootargs = "earlyprintk console=ttyS0,115200";
        };
 
-       soc@01c20000 {
+       soc@01c00000 {
                emac: ethernet@01c0b000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&emac_pins_a>;
                pinctrl-0 = <&led_pins_cubieboard>;
 
                blue {
-                       label = "cubieboard::blue";
+                       label = "cubieboard:blue:usr";
                        gpios = <&pio 7 21 0>; /* LED1 */
                };
 
                green {
-                       label = "cubieboard::green";
+                       label = "cubieboard:green:usr";
                        gpios = <&pio 7 20 0>; /* LED2 */
                        linux,default-trigger = "heartbeat";
                };
index 3514b37..b3ae51f 100644 (file)
@@ -22,7 +22,7 @@
                bootargs = "earlyprintk console=ttyS0,115200";
        };
 
-       soc@01c20000 {
+       soc@01c00000 {
                emac: ethernet@01c0b000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&emac_pins_a>;
index 078ed7f..0c1447c 100644 (file)
@@ -22,7 +22,7 @@
                bootargs = "earlyprintk console=ttyS0,115200";
        };
 
-       soc@01c20000 {
+       soc@01c00000 {
                uart0: serial@01c28000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&uart0_pins_a>;
index b2bd6e1..c32770a 100644 (file)
                };
        };
 
-       soc@01c20000 {
+       soc@01c00000 {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
-               reg = <0x01c20000 0x300000>;
                ranges;
 
                emac: ethernet@01c0b000 {
index 64dc0c4..3c9f8b3 100644 (file)
@@ -18,7 +18,7 @@
        model = "Olimex A10s-Olinuxino Micro";
        compatible = "olimex,a10s-olinuxino-micro", "allwinner,sun5i-a10s";
 
-       soc@01c20000 {
+       soc@01c00000 {
                emac: ethernet@01c0b000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&emac_pins_a>;
                        pinctrl-0 = <&uart3_pins_a>;
                        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";
+
+                       at24@50 {
+                               compatible = "at,24c16";
+                               pagesize = <16>;
+                               reg = <0x50>;
+                               read-only;
+                       };
+               };
+
+               i2c2: i2c@01c2b400 {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c2_pins_a>;
+                       status = "okay";
+               };
        };
 
        leds {
index 2307ce8..ee0ff9b 100644 (file)
                };
        };
 
-       soc@01c20000 {
+       soc@01c00000 {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
-               reg = <0x01c20000 0x300000>;
                ranges;
 
                emac: ethernet@01c0b000 {
                                allwinner,drive = <0>;
                                allwinner,pull = <0>;
                        };
+
+                       i2c0_pins_a: i2c0@0 {
+                               allwinner,pins = "PB0", "PB1";
+                               allwinner,function = "i2c0";
+                               allwinner,drive = <0>;
+                               allwinner,pull = <0>;
+                       };
+
+                       i2c1_pins_a: i2c1@0 {
+                               allwinner,pins = "PB15", "PB16";
+                               allwinner,function = "i2c1";
+                               allwinner,drive = <0>;
+                               allwinner,pull = <0>;
+                       };
+
+                       i2c2_pins_a: i2c2@0 {
+                               allwinner,pins = "PB17", "PB18";
+                               allwinner,function = "i2c2";
+                               allwinner,drive = <0>;
+                               allwinner,pull = <0>;
+                       };
                };
 
                timer@01c20c00 {
                        clocks = <&apb1_gates 19>;
                        status = "disabled";
                };
+
+               i2c0: i2c@01c2ac00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "allwinner,sun4i-i2c";
+                       reg = <0x01c2ac00 0x400>;
+                       interrupts = <7>;
+                       clocks = <&apb1_gates 0>;
+                       clock-frequency = <100000>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c@01c2b000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "allwinner,sun4i-i2c";
+                       reg = <0x01c2b000 0x400>;
+                       interrupts = <8>;
+                       clocks = <&apb1_gates 1>;
+                       clock-frequency = <100000>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c@01c2b400 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "allwinner,sun4i-i2c";
+                       reg = <0x01c2b400 0x400>;
+                       interrupts = <9>;
+                       clocks = <&apb1_gates 2>;
+                       clock-frequency = <100000>;
+                       status = "disabled";
+               };
        };
 };
index 80497e3..9e508dc 100644 (file)
@@ -22,7 +22,7 @@
                bootargs = "earlyprintk console=ttyS0,115200";
        };
 
-       soc@01c20000 {
+       soc@01c00000 {
                pinctrl@01c20800 {
                        led_pins_olinuxino: led_pins@0 {
                                allwinner,pins = "PG9";
index 7363211..f6091dc 100644 (file)
                };
        };
 
-       soc@01c20000 {
+       soc@01c00000 {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
-               reg = <0x01c20000 0x300000>;
                ranges;
 
                intc: interrupt-controller@01c20400 {
diff --git a/arch/arm/boot/dts/sun6i-a31-colombus.dts b/arch/arm/boot/dts/sun6i-a31-colombus.dts
new file mode 100644 (file)
index 0000000..99c4b18
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2013 Maxime Ripard
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "sun6i-a31.dtsi"
+
+/ {
+       model = "WITS A31 Colombus Evaluation Board";
+       compatible = "wits,colombus", "allwinner,sun6i-a31";
+
+       chosen {
+               bootargs = "earlyprintk console=ttyS0,115200";
+       };
+
+       soc@01c00000 {
+               uart0: serial@01c28000 {
+                       status = "okay";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
new file mode 100644 (file)
index 0000000..4d076ec
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2013 Maxime Ripard
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       interrupt-parent = <&gic>;
+
+       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>;
+               };
+
+               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 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               osc: oscillator {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <24000000>;
+               };
+       };
+
+       soc@01c00000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               timer@01c20c00 {
+                       compatible = "allwinner,sun4i-timer";
+                       reg = <0x01c20c00 0xa0>;
+                       interrupts = <0 18 1>,
+                                    <0 19 1>,
+                                    <0 20 1>,
+                                    <0 21 1>,
+                                    <0 22 1>;
+                       clocks = <&osc>;
+               };
+
+               wdt1: watchdog@01c20ca0 {
+                       compatible = "allwinner,sun6i-wdt";
+                       reg = <0x01c20ca0 0x20>;
+               };
+
+               uart0: serial@01c28000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28000 0x400>;
+                       interrupts = <0 0 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc>;
+                       status = "disabled";
+               };
+
+               uart1: serial@01c28400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28400 0x400>;
+                       interrupts = <0 1 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc>;
+                       status = "disabled";
+               };
+
+               uart2: serial@01c28800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28800 0x400>;
+                       interrupts = <0 2 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc>;
+                       status = "disabled";
+               };
+
+               uart3: serial@01c28c00 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28c00 0x400>;
+                       interrupts = <0 3 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc>;
+                       status = "disabled";
+               };
+
+               uart4: serial@01c29000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c29000 0x400>;
+                       interrupts = <0 4 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc>;
+                       status = "disabled";
+               };
+
+               uart5: serial@01c29400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c29400 0x400>;
+                       interrupts = <0 5 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc>;
+                       status = "disabled";
+               };
+
+               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 = <1 9 0xf04>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
new file mode 100644 (file)
index 0000000..d339584
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2013 Maxime Ripard
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "sun7i-a20.dtsi"
+
+/ {
+       model = "Olimex A20-Olinuxino Micro";
+       compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20";
+
+       soc@01c00000 {
+               uart0: serial@01c28000 {
+                       status = "okay";
+               };
+
+               uart6: serial@01c29800 {
+                       status = "okay";
+               };
+
+               uart7: serial@01c29c00 {
+                       status = "okay";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
new file mode 100644 (file)
index 0000000..3339151
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2013 Maxime Ripard
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       interrupt-parent = <&gic>;
+
+       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 0x80000000>;
+       };
+
+       clocks {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               osc24M: osc24M@01c20050 {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <24000000>;
+               };
+
+               osc32k: osc32k {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <32768>;
+               };
+       };
+
+       soc@01c00000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               timer@01c20c00 {
+                       compatible = "allwinner,sun4i-timer";
+                       reg = <0x01c20c00 0x90>;
+                       interrupts = <0 22 1>,
+                                    <0 23 1>,
+                                    <0 24 1>,
+                                    <0 25 1>,
+                                    <0 67 1>,
+                                    <0 68 1>;
+                       clocks = <&osc24M>;
+               };
+
+               wdt: watchdog@01c20c90 {
+                       compatible = "allwinner,sun4i-wdt";
+                       reg = <0x01c20c90 0x10>;
+               };
+
+               uart0: serial@01c28000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28000 0x400>;
+                       interrupts = <0 1 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               uart1: serial@01c28400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28400 0x400>;
+                       interrupts = <0 2 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               uart2: serial@01c28800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28800 0x400>;
+                       interrupts = <0 3 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               uart3: serial@01c28c00 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28c00 0x400>;
+                       interrupts = <0 4 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               uart4: serial@01c29000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c29000 0x400>;
+                       interrupts = <0 17 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               uart5: serial@01c29400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c29400 0x400>;
+                       interrupts = <0 18 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               uart6: serial@01c29800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c29800 0x400>;
+                       interrupts = <0 19 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               uart7: serial@01c29c00 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c29c00 0x400>;
+                       interrupts = <0 20 1>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&osc24M>;
+                       status = "disabled";
+               };
+
+               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 = <1 9 0xf04>;
+               };
+       };
+};
index cb640eb..6023028 100644 (file)
                                        regulator-boot-on;
                                };
 
-                               dcdc3 {
+                               tps65090_dcdc3_reg: dcdc3 {
                                        regulator-name = "vdd-ao";
                                        regulator-always-on;
                                        regulator-boot-on;
                                };
                        };
                };
+
+               palmas: tps65913 {
+                       compatible = "ti,palmas";
+                       reg = <0x58>;
+                       interrupts = <0 86 IRQ_TYPE_LEVEL_LOW>;
+
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+
+                       ti,system-power-controller;
+
+                       palmas_gpio: gpio {
+                               compatible = "ti,palmas-gpio";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       pmic {
+                               compatible = "ti,tps65913-pmic", "ti,palmas-pmic";
+                               smps1-in-supply = <&tps65090_dcdc3_reg>;
+                               smps3-in-supply = <&tps65090_dcdc3_reg>;
+                               smps4-in-supply = <&tps65090_dcdc2_reg>;
+                               smps7-in-supply = <&tps65090_dcdc2_reg>;
+                               smps8-in-supply = <&tps65090_dcdc2_reg>;
+                               smps9-in-supply = <&tps65090_dcdc2_reg>;
+                               ldo1-in-supply = <&tps65090_dcdc2_reg>;
+                               ldo2-in-supply = <&tps65090_dcdc2_reg>;
+                               ldo3-in-supply = <&palmas_smps3_reg>;
+                               ldo4-in-supply = <&tps65090_dcdc2_reg>;
+                               ldo5-in-supply = <&vdd_ac_bat_reg>;
+                               ldo6-in-supply = <&tps65090_dcdc2_reg>;
+                               ldo7-in-supply = <&tps65090_dcdc2_reg>;
+                               ldo8-in-supply = <&tps65090_dcdc3_reg>;
+                               ldo9-in-supply = <&palmas_smps9_reg>;
+                               ldoln-in-supply = <&tps65090_dcdc1_reg>;
+                               ldousb-in-supply = <&tps65090_dcdc1_reg>;
+
+                               regulators {
+                                       smps12 {
+                                               regulator-name = "vddio-ddr";
+                                               regulator-min-microvolt = <1350000>;
+                                               regulator-max-microvolt = <1350000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       palmas_smps3_reg: smps3 {
+                                               regulator-name = "vddio-1v8";
+                                               regulator-min-microvolt = <1800000>;
+                                               regulator-max-microvolt = <1800000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       smps45 {
+                                               regulator-name = "vdd-core";
+                                               regulator-min-microvolt = <900000>;
+                                               regulator-max-microvolt = <1400000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       smps457 {
+                                               regulator-name = "vdd-core";
+                                               regulator-min-microvolt = <900000>;
+                                               regulator-max-microvolt = <1400000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       smps8 {
+                                               regulator-name = "avdd-pll";
+                                               regulator-min-microvolt = <1050000>;
+                                               regulator-max-microvolt = <1050000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       palmas_smps9_reg: smps9 {
+                                               regulator-name = "sdhci-vdd-sd-slot";
+                                               regulator-min-microvolt = <2800000>;
+                                               regulator-max-microvolt = <2800000>;
+                                               regulator-always-on;
+                                       };
+
+                                       ldo1 {
+                                               regulator-name = "avdd-cam1";
+                                               regulator-min-microvolt = <2800000>;
+                                               regulator-max-microvolt = <2800000>;
+                                       };
+
+                                       ldo2 {
+                                               regulator-name = "avdd-cam2";
+                                               regulator-min-microvolt = <2800000>;
+                                               regulator-max-microvolt = <2800000>;
+                                       };
+
+                                       ldo3 {
+                                               regulator-name = "avdd-dsi-csi";
+                                               regulator-min-microvolt = <1200000>;
+                                               regulator-max-microvolt = <1200000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       ldo4 {
+                                               regulator-name = "vpp-fuse";
+                                               regulator-min-microvolt = <1800000>;
+                                               regulator-max-microvolt = <1800000>;
+                                       };
+
+                                       ldo6 {
+                                               regulator-name = "vdd-sensor-2v85";
+                                               regulator-min-microvolt = <2850000>;
+                                               regulator-max-microvolt = <2850000>;
+                                       };
+
+                                       ldo7 {
+                                               regulator-name = "vdd-af-cam1";
+                                               regulator-min-microvolt = <2800000>;
+                                               regulator-max-microvolt = <2800000>;
+                                       };
+
+                                       ldo8 {
+                                               regulator-name = "vdd-rtc";
+                                               regulator-min-microvolt = <900000>;
+                                               regulator-max-microvolt = <900000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                               ti,enable-ldo8-tracking;
+                                       };
+
+                                       ldo9 {
+                                               regulator-name = "vddio-sdmmc-2";
+                                               regulator-min-microvolt = <1800000>;
+                                               regulator-max-microvolt = <3300000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       ldoln {
+                                               regulator-name = "hvdd-usb";
+                                               regulator-min-microvolt = <3300000>;
+                                               regulator-max-microvolt = <3300000>;
+                                       };
+
+                                       ldousb {
+                                               regulator-name = "avdd-usb";
+                                               regulator-min-microvolt = <3300000>;
+                                               regulator-max-microvolt = <3300000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       regen1 {
+                                               regulator-name = "rail-3v3";
+                                               regulator-max-microvolt = <3300000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+
+                                       regen2 {
+                                               regulator-name = "rail-5v0";
+                                               regulator-max-microvolt = <5000000>;
+                                               regulator-always-on;
+                                               regulator-boot-on;
+                                       };
+                               };
+                       };
+
+                       rtc {
+                               compatible = "ti,palmas-rtc";
+                               interrupt-parent = <&palmas>;
+                               interrupts = <8 0>;
+                       };
+               };
        };
 
        spi@7000da00 {
 
        pmc {
                nvidia,invert-interrupt;
+               nvidia,suspend-mode = <1>;
+               nvidia,cpu-pwr-good-time = <500>;
+               nvidia,cpu-pwr-off-time = <300>;
+               nvidia,core-pwr-good-time = <641 3845>;
+               nvidia,core-pwr-off-time = <61036>;
+               nvidia,core-power-req-active-high;
+               nvidia,sys-clock-req-active-high;
        };
 
        ahub {
                non-removable;
        };
 
+       usb@7d008000 {
+               status = "okay";
+       };
+
+       usb-phy@7d008000 {
+               status = "okay";
+               vbus-supply = <&usb3_vbus_reg>;
+       };
+
        clocks {
                compatible = "simple-bus";
                #address-cells = <1>;
                };
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               home {
+                       label = "Home";
+                       gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+                       linux,code = <102>; /* KEY_HOME */
+               };
+
+               power {
+                       label = "Power";
+                       gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
+                       linux,code = <116>; /* KEY_POWER */
+                       gpio-key,wakeup;
+               };
+
+               volume_down {
+                       label = "Volume Down";
+                       gpios = <&gpio TEGRA_GPIO(R, 1) GPIO_ACTIVE_LOW>;
+                       linux,code = <114>; /* KEY_VOLUMEDOWN */
+               };
+
+               volume_up {
+                       label = "Volume Up";
+                       gpios = <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_LOW>;
+                       linux,code = <115>; /* KEY_VOLUMEUP */
+               };
+       };
+
        regulators {
                compatible = "simple-bus";
                #address-cells = <1>;
                        gpio = <&gpio TEGRA_GPIO(K, 1) GPIO_ACTIVE_HIGH>;
                        vin-supply = <&tps65090_dcdc1_reg>;
                };
+
+               vdd_cam_1v8_reg: regulator@6 {
+                       compatible = "regulator-fixed";
+                       reg = <6>;
+                       regulator-name = "vdd_cam_1v8_reg";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       enable-active-high;
+                       gpio = <&palmas_gpio 6 0>;
+               };
        };
 
        sound {
                        "Speakers", "SPORP",
                        "Speakers", "SPORN",
                        "Speakers", "SPOLP",
-                       "Speakers", "SPOLN";
+                       "Speakers", "SPOLN",
+                       "Mic Jack", "MICBIAS1",
+                       "IN2P", "Mic Jack";
 
                nvidia,i2s-controller = <&tegra_i2s1>;
                nvidia,audio-codec = <&rt5640>;
diff --git a/arch/arm/boot/dts/tegra114-pluto.dts b/arch/arm/boot/dts/tegra114-pluto.dts
deleted file mode 100644 (file)
index d5f8d3e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/dts-v1/;
-
-#include "tegra114.dtsi"
-
-/ {
-       model = "NVIDIA Tegra114 Pluto evaluation board";
-       compatible = "nvidia,pluto", "nvidia,tegra114";
-
-       memory {
-               reg = <0x80000000 0x40000000>;
-       };
-
-       serial@70006300 {
-               status = "okay";
-       };
-
-       pmc {
-               nvidia,invert-interrupt;
-       };
-
-       clocks {
-               compatible = "simple-bus";
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               clk32k_in: clock {
-                       compatible = "fixed-clock";
-                       reg=<0>;
-                       #clock-cells = <0>;
-                       clock-frequency = <32768>;
-               };
-       };
-};
index abf6c40..2905145 100644 (file)
                status = "disable";
        };
 
+       usb@7d000000 {
+               compatible = "nvidia,tegra30-ehci", "usb-ehci";
+               reg = <0x7d000000 0x4000>;
+               interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA114_CLK_USBD>;
+               nvidia,phy = <&phy1>;
+               status = "disabled";
+       };
+
+       phy1: usb-phy@7d000000 {
+               compatible = "nvidia,tegra30-usb-phy";
+               reg = <0x7d000000 0x4000 0x7d000000 0x4000>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA114_CLK_USBD>,
+                        <&tegra_car TEGRA114_CLK_PLL_U>,
+                        <&tegra_car TEGRA114_CLK_USBD>;
+               clock-names = "reg", "pll_u", "utmi-pads";
+               nvidia,hssync-start-delay = <0>;
+               nvidia,idle-wait-delay = <17>;
+               nvidia,elastic-limit = <16>;
+               nvidia,term-range-adj = <6>;
+               nvidia,xcvr-setup = <9>;
+               nvidia,xcvr-lsfslew = <0>;
+               nvidia,xcvr-lsrslew = <3>;
+               nvidia,hssquelch-level = <2>;
+               nvidia,hsdiscon-level = <5>;
+               nvidia,xcvr-hsslew = <12>;
+               status = "disabled";
+       };
+
+       usb@7d008000 {
+               compatible = "nvidia,tegra30-ehci", "usb-ehci";
+               reg = <0x7d008000 0x4000>;
+               interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA114_CLK_USB3>;
+               nvidia,phy = <&phy3>;
+               status = "disabled";
+       };
+
+       phy3: usb-phy@7d008000 {
+               compatible = "nvidia,tegra30-usb-phy";
+               reg = <0x7d008000 0x4000 0x7d000000 0x4000>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA114_CLK_USB3>,
+                        <&tegra_car TEGRA114_CLK_PLL_U>,
+                        <&tegra_car TEGRA114_CLK_USBD>;
+               clock-names = "reg", "pll_u", "utmi-pads";
+               nvidia,hssync-start-delay = <0>;
+               nvidia,idle-wait-delay = <17>;
+               nvidia,elastic-limit = <16>;
+               nvidia,term-range-adj = <6>;
+               nvidia,xcvr-setup = <9>;
+               nvidia,xcvr-lsfslew = <0>;
+               nvidia,xcvr-lsrslew = <3>;
+               nvidia,hssquelch-level = <2>;
+               nvidia,hsdiscon-level = <5>;
+               nvidia,xcvr-hsslew = <12>;
+               status = "disabled";
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
index 5592be6..d5c9bca 100644 (file)
        };
 
        pmc {
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <5000>;
                nvidia,cpu-pwr-off-time = <5000>;
                nvidia,core-pwr-good-time = <3845 3845>;
index d9f89cd..e156ab3 100644 (file)
                                        regulator-always-on;
                                };
 
-                               ldo0 {
+                               pci_clk_reg: ldo0 {
                                        regulator-name = "vdd_ldo0,vddio_pex_clk";
                                        regulator-min-microvolt = <3300000>;
                                        regulator-max-microvolt = <3300000>;
 
        pmc {
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <5000>;
                nvidia,cpu-pwr-off-time = <5000>;
                nvidia,core-pwr-good-time = <3845 3845>;
                nvidia,sys-clock-req-active-high;
        };
 
+       pcie-controller {
+               pex-clk-supply = <&pci_clk_reg>;
+               vdd-supply = <&pci_vdd_reg>;
+               status = "okay";
+
+               pci@1,0 {
+                       status = "okay";
+               };
+
+               pci@2,0 {
+                       status = "okay";
+               };
+       };
+
        usb@c5000000 {
                status = "okay";
        };
                        enable-active-high;
                };
 
-               regulator@3 {
+               pci_vdd_reg: regulator@3 {
                        compatible = "regulator-fixed";
                        reg = <3>;
                        regulator-name = "vdd_1v05";
                        regulator-max-microvolt = <1050000>;
                        gpio = <&pmic 2 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
-                       /* Hack until board-harmony-pcie.c is removed */
-                       status = "disabled";
                };
 
                regulator@4 {
index cfd1276..8d71fc9 100644 (file)
 
        pmc {
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <2000>;
                nvidia,cpu-pwr-off-time = <0>;
                nvidia,core-pwr-good-time = <3845 3845>;
index c824253..315aae2 100644 (file)
 
        pmc {
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <5000>;
                nvidia,cpu-pwr-off-time = <5000>;
                nvidia,core-pwr-good-time = <3845 3845>;
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                        enable-active-high;
-                       gpio = <&gpio 24 0>; /* PD0 */
+                       gpio = <&gpio TEGRA_GPIO(D, 0) 0>;
                        regulator-always-on;
                        regulator-boot-on;
                };
index c54faae..7726dab 100644 (file)
                                        regulator-always-on;
                                };
 
-                               ldo0 {
+                               pci_clk_reg: ldo0 {
                                        regulator-name = "vdd_ldo0,vddio_pex_clk";
                                        regulator-min-microvolt = <3300000>;
                                        regulator-max-microvolt = <3300000>;
 
        pmc {
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <5000>;
                nvidia,cpu-pwr-off-time = <5000>;
                nvidia,core-pwr-good-time = <3845 3845>;
                nvidia,sys-clock-req-active-high;
        };
 
+       pcie-controller {
+               pex-clk-supply = <&pci_clk_reg>;
+               vdd-supply = <&pci_vdd_reg>;
+       };
+
        usb@c5008000 {
                status = "okay";
        };
                        regulator-max-microvolt = <5000000>;
                        regulator-always-on;
                };
+
+               pci_vdd_reg: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "vdd_1v05";
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1050000>;
+                       gpio = <&pmic 2 0>;
+                       enable-active-high;
+               };
        };
 };
index c572c43..3ada3cb 100644 (file)
                };
        };
 
+       pcie-controller {
+               status = "okay";
+
+               pci@1,0 {
+                       status = "okay";
+               };
+       };
+
        sound {
                compatible = "ad,tegra-audio-wm8903-tec",
                             "nvidia,tegra-audio-wm8903";
index 1e9d33a..78deea5 100644 (file)
        };
 
        pmc {
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <5000>;
                nvidia,cpu-pwr-off-time = <5000>;
                nvidia,core-pwr-good-time = <3845 3845>;
                nvidia,sys-clock-req-active-high;
        };
 
+       pcie-controller {
+               status = "okay";
+               pex-clk-supply = <&pci_clk_reg>;
+               vdd-supply = <&pci_vdd_reg>;
+
+               pci@1,0 {
+                       status = "okay";
+               };
+       };
+
        usb@c5000000 {
                status = "okay";
        };
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                        enable-active-high;
-                       gpio = <&gpio 170 0>; /* PV2 */
+                       gpio = <&gpio TEGRA_GPIO(V, 2) 0>;
                        regulator-always-on;
                        regulator-boot-on;
                };
+
+               pci_clk_reg: regulator@3 {
+                       compatible = "regulator-fixed";
+                       reg = <3>;
+                       regulator-name = "pci_clk";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+
+               pci_vdd_reg: regulator@4 {
+                       compatible = "regulator-fixed";
+                       reg = <4>;
+                       regulator-name = "pci_vdd";
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1050000>;
+                       regulator-always-on;
+               };
        };
 
        sound {
index 7f8c28d..aab872c 100644 (file)
 
        pmc {
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <2000>;
                nvidia,cpu-pwr-off-time = <100>;
                nvidia,core-pwr-good-time = <3845 3845>;
index c703197..d33a73c 100644 (file)
 
        pmc {
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <2000>;
                nvidia,cpu-pwr-off-time = <1000>;
                nvidia,core-pwr-good-time = <0 3845>;
index e457083..df40b54 100644 (file)
                #size-cells = <0>;
        };
 
+       pcie-controller {
+               compatible = "nvidia,tegra20-pcie";
+               device_type = "pci";
+               reg = <0x80003000 0x00000800   /* PADS registers */
+                      0x80003800 0x00000200   /* AFI registers */
+                      0x90000000 0x10000000>; /* configuration space */
+               reg-names = "pads", "afi", "cs";
+               interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH   /* controller interrupt */
+                             GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */
+               interrupt-names = "intr", "msi";
+
+               bus-range = <0x00 0xff>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+
+               ranges = <0x82000000 0 0x80000000 0x80000000 0 0x00001000   /* port 0 registers */
+                         0x82000000 0 0x80001000 0x80001000 0 0x00001000   /* port 1 registers */
+                         0x81000000 0 0          0x82000000 0 0x00010000   /* downstream I/O */
+                         0x82000000 0 0xa0000000 0xa0000000 0 0x08000000   /* non-prefetchable memory */
+                         0xc2000000 0 0xa8000000 0xa8000000 0 0x18000000>; /* prefetchable memory */
+
+               clocks = <&tegra_car TEGRA20_CLK_PEX>,
+                        <&tegra_car TEGRA20_CLK_AFI>,
+                        <&tegra_car TEGRA20_CLK_PCIE_XCLK>,
+                        <&tegra_car TEGRA20_CLK_PLL_E>;
+               clock-names = "pex", "afi", "pcie_xclk", "pll_e";
+               status = "disabled";
+
+               pci@1,0 {
+                       device_type = "pci";
+                       assigned-addresses = <0x82000800 0 0x80000000 0 0x1000>;
+                       reg = <0x000800 0 0 0 0>;
+                       status = "disabled";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       nvidia,num-lanes = <2>;
+               };
+
+               pci@2,0 {
+                       device_type = "pci";
+                       assigned-addresses = <0x82001000 0 0x80001000 0 0x1000>;
+                       reg = <0x001000 0 0 0 0>;
+                       status = "disabled";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       nvidia,num-lanes = <2>;
+               };
+       };
+
        usb@c5000000 {
                compatible = "nvidia,tegra20-ehci", "usb-ehci";
                reg = <0xc5000000 0x4000>;
index 87c5f7b..08cad69 100644 (file)
                reg = <0x80000000 0x7ff00000>;
        };
 
+       pcie-controller {
+               status = "okay";
+               pex-clk-supply = <&sys_3v3_pexs_reg>;
+               vdd-supply = <&ldo1_reg>;
+               avdd-supply = <&ldo2_reg>;
+
+               pci@1,0 {
+                       status = "okay";
+                       nvidia,num-lanes = <2>;
+               };
+
+               pci@2,0 {
+                       nvidia,num-lanes = <2>;
+               };
+
+               pci@3,0 {
+                       status = "okay";
+                       nvidia,num-lanes = <2>;
+               };
+       };
+
+       host1x {
+               hdmi {
+                       status = "okay";
+
+                       vdd-supply = <&sys_3v3_reg>;
+                       pll-supply = <&vio_reg>;
+
+                       nvidia,hpd-gpio =
+                               <&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
+                       nvidia,ddc-i2c-bus = <&hdmiddc>;
+               };
+       };
+
        pinmux {
                pinctrl-names = "default";
                pinctrl-0 = <&state_default>;
                                nvidia,pull = <0>;
                                nvidia,tristate = <0>;
                        };
+                       pex_l1_prsnt_n_pdd4 {
+                               nvidia,pins =   "pex_l1_prsnt_n_pdd4",
+                                               "pex_l1_clkreq_n_pdd6";
+                               nvidia,pull = <2>;
+                       };
                        sdio3 {
                                nvidia,pins = "drive_sdio3";
                                nvidia,high-speed-mode = <0>;
                                nvidia,slew-rate-rising = <1>;
                                nvidia,slew-rate-falling = <1>;
                        };
+                       gpv {
+                               nvidia,pins = "drive_gpv";
+                               nvidia,pull-up-strength = <16>;
+                       };
                };
        };
 
                clock-frequency = <100000>;
        };
 
-       i2c@7000c700 {
+       hdmiddc: i2c@7000c700 {
                status = "okay";
                clock-frequency = <100000>;
        };
        pmc {
                status = "okay";
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <2000>;
                nvidia,cpu-pwr-off-time = <200>;
                nvidia,core-pwr-good-time = <3845 3845>;
                non-removable;
        };
 
+       usb@7d008000 {
+               status = "okay";
+       };
+
+       usb-phy@7d008000 {
+               vbus-supply = <&usb3_vbus_reg>;
+               status = "okay";
+       };
+
        clocks {
                compatible = "simple-bus";
                #address-cells = <1>;
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                        enable-active-high;
-                       gpio = <&gpio TEGRA_GPIO(I, 4) GPIO_ACTIVE_HIGH>;
+                       gpio = <&gpio TEGRA_GPIO(DD, 6) GPIO_ACTIVE_HIGH>;
                        gpio-open-drain;
                        vin-supply = <&vdd_5v_in_reg>;
                };
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                        enable-active-high;
-                       gpio = <&gpio TEGRA_GPIO(H, 7) GPIO_ACTIVE_HIGH>;
+                       gpio = <&gpio TEGRA_GPIO(DD, 4) GPIO_ACTIVE_HIGH>;
                        gpio-open-drain;
                        vin-supply = <&vdd_5v_in_reg>;
                };
 
                nvidia,audio-routing =
                        "Headphones", "HPOR",
-                       "Headphones", "HPOL";
+                       "Headphones", "HPOL",
+                       "Mic Jack", "MICBIAS1",
+                       "IN2P", "Mic Jack";
 
                nvidia,i2s-controller = <&tegra_i2s1>;
                nvidia,audio-codec = <&rt5640>;
index f65b53d..e19dbf2 100644 (file)
                reg = <0x80000000 0x40000000>;
        };
 
+       pcie-controller {
+               status = "okay";
+               pex-clk-supply = <&pex_hvdd_3v3_reg>;
+               vdd-supply = <&ldo1_reg>;
+               avdd-supply = <&ldo2_reg>;
+
+               pci@1,0 {
+                       nvidia,num-lanes = <4>;
+               };
+
+               pci@2,0 {
+                       nvidia,num-lanes = <1>;
+               };
+
+               pci@3,0 {
+                       status = "okay";
+                       nvidia,num-lanes = <1>;
+               };
+       };
+
        pinmux {
                pinctrl-names = "default";
                pinctrl-0 = <&state_default>;
                        gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
                };
 
-               tps62361 {
-                       compatible = "ti,tps62361";
-                       reg = <0x60>;
-
-                       regulator-name = "tps62361-vout";
-                       regulator-min-microvolt = <500000>;
-                       regulator-max-microvolt = <1500000>;
-                       regulator-boot-on;
-                       regulator-always-on;
-                       ti,vsel0-state-high;
-                       ti,vsel1-state-high;
-               };
-
                pmic: tps65911@2d {
                        compatible = "ti,tps65911";
                        reg = <0x2d>;
                                };
                        };
                };
+
+               nct1008 {
+                       compatible = "onnn,nct1008";
+                       reg = <0x4c>;
+                       interrupt-parent = <&gpio>;
+                       interrupts = <TEGRA_GPIO(CC, 2) IRQ_TYPE_LEVEL_LOW>;
+               };
+
+               tps62361 {
+                       compatible = "ti,tps62361";
+                       reg = <0x60>;
+
+                       regulator-name = "tps62361-vout";
+                       regulator-min-microvolt = <500000>;
+                       regulator-max-microvolt = <1500000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+                       ti,vsel0-state-high;
+                       ti,vsel1-state-high;
+               };
        };
 
        spi@7000da00 {
        pmc {
                status = "okay";
                nvidia,invert-interrupt;
-               nvidia,suspend-mode = <2>;
+               nvidia,suspend-mode = <1>;
                nvidia,cpu-pwr-good-time = <2000>;
                nvidia,cpu-pwr-off-time = <200>;
                nvidia,core-pwr-good-time = <3845 3845>;
                non-removable;
        };
 
+       usb@7d008000 {
+               status = "okay";
+       };
+
+       usb-phy@7d008000 {
+               vbus-supply = <&usb3_vbus_reg>;
+               status = "okay";
+       };
+
        clocks {
                compatible = "simple-bus";
                #address-cells = <1>;
index d8783f0..0022c12 100644 (file)
                serial4 = &uarte;
        };
 
+       pcie-controller {
+               compatible = "nvidia,tegra30-pcie";
+               device_type = "pci";
+               reg = <0x00003000 0x00000800   /* PADS registers */
+                      0x00003800 0x00000200   /* AFI registers */
+                      0x10000000 0x10000000>; /* configuration space */
+               reg-names = "pads", "afi", "cs";
+               interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH   /* controller interrupt */
+                             GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */
+               interrupt-names = "intr", "msi";
+
+               bus-range = <0x00 0xff>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+
+               ranges = <0x82000000 0 0x00000000 0x00000000 0 0x00001000   /* port 0 configuration space */
+                         0x82000000 0 0x00001000 0x00001000 0 0x00001000   /* port 1 configuration space */
+                         0x82000000 0 0x00004000 0x00004000 0 0x00001000   /* port 2 configuration space */
+                         0x81000000 0 0          0x02000000 0 0x00010000   /* downstream I/O */
+                         0x82000000 0 0x20000000 0x20000000 0 0x08000000   /* non-prefetchable memory */
+                         0xc2000000 0 0x28000000 0x28000000 0 0x18000000>; /* prefetchable memory */
+
+               clocks = <&tegra_car TEGRA30_CLK_PCIE>,
+                        <&tegra_car TEGRA30_CLK_AFI>,
+                        <&tegra_car TEGRA30_CLK_PCIEX>,
+                        <&tegra_car TEGRA30_CLK_PLL_E>,
+                        <&tegra_car TEGRA30_CLK_CML0>;
+               clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml";
+               status = "disabled";
+
+               pci@1,0 {
+                       device_type = "pci";
+                       assigned-addresses = <0x82000800 0 0x00000000 0 0x1000>;
+                       reg = <0x000800 0 0 0 0>;
+                       status = "disabled";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       nvidia,num-lanes = <2>;
+               };
+
+               pci@2,0 {
+                       device_type = "pci";
+                       assigned-addresses = <0x82001000 0 0x00001000 0 0x1000>;
+                       reg = <0x001000 0 0 0 0>;
+                       status = "disabled";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       nvidia,num-lanes = <2>;
+               };
+
+               pci@3,0 {
+                       device_type = "pci";
+                       assigned-addresses = <0x82001800 0 0x00004000 0 0x1000>;
+                       reg = <0x001800 0 0 0 0>;
+                       status = "disabled";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       nvidia,num-lanes = <2>;
+               };
+       };
+
        host1x {
                compatible = "nvidia,tegra30-host1x", "simple-bus";
                reg = <0x50000000 0x00024000>;
                status = "disabled";
        };
 
+       usb@7d000000 {
+               compatible = "nvidia,tegra30-ehci", "usb-ehci";
+               reg = <0x7d000000 0x4000>;
+               interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA30_CLK_USBD>;
+               nvidia,needs-double-reset;
+               nvidia,phy = <&phy1>;
+               status = "disabled";
+       };
+
+       phy1: usb-phy@7d000000 {
+               compatible = "nvidia,tegra30-usb-phy";
+               reg = <0x7d000000 0x4000 0x7d000000 0x4000>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA30_CLK_USBD>,
+                        <&tegra_car TEGRA30_CLK_PLL_U>,
+                        <&tegra_car TEGRA30_CLK_USBD>;
+               clock-names = "reg", "pll_u", "utmi-pads";
+               nvidia,hssync-start-delay = <9>;
+               nvidia,idle-wait-delay = <17>;
+               nvidia,elastic-limit = <16>;
+               nvidia,term-range-adj = <6>;
+               nvidia,xcvr-setup = <51>;
+               nvidia.xcvr-setup-use-fuses;
+               nvidia,xcvr-lsfslew = <1>;
+               nvidia,xcvr-lsrslew = <1>;
+               nvidia,xcvr-hsslew = <32>;
+               nvidia,hssquelch-level = <2>;
+               nvidia,hsdiscon-level = <5>;
+               status = "disabled";
+       };
+
+       usb@7d004000 {
+               compatible = "nvidia,tegra30-ehci", "usb-ehci";
+               reg = <0x7d004000 0x4000>;
+               interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+               phy_type = "ulpi";
+               clocks = <&tegra_car TEGRA30_CLK_USB2>;
+               nvidia,phy = <&phy2>;
+               status = "disabled";
+       };
+
+       phy2: usb-phy@7d004000 {
+               compatible = "nvidia,tegra30-usb-phy";
+               reg = <0x7d004000 0x4000>;
+               phy_type = "ulpi";
+               clocks = <&tegra_car TEGRA30_CLK_USB2>,
+                        <&tegra_car TEGRA30_CLK_PLL_U>,
+                        <&tegra_car TEGRA30_CLK_CDEV2>;
+               clock-names = "reg", "pll_u", "ulpi-link";
+               status = "disabled";
+       };
+
+       usb@7d008000 {
+               compatible = "nvidia,tegra30-ehci", "usb-ehci";
+               reg = <0x7d008000 0x4000>;
+               interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA30_CLK_USB3>;
+               nvidia,phy = <&phy3>;
+               status = "disabled";
+       };
+
+       phy3: usb-phy@7d008000 {
+               compatible = "nvidia,tegra30-usb-phy";
+               reg = <0x7d008000 0x4000 0x7d000000 0x4000>;
+               phy_type = "utmi";
+               clocks = <&tegra_car TEGRA30_CLK_USB3>,
+                        <&tegra_car TEGRA30_CLK_PLL_U>,
+                        <&tegra_car TEGRA30_CLK_USBD>;
+               clock-names = "reg", "pll_u", "utmi-pads";
+               nvidia,hssync-start-delay = <0>;
+               nvidia,idle-wait-delay = <17>;
+               nvidia,elastic-limit = <16>;
+               nvidia,term-range-adj = <6>;
+               nvidia,xcvr-setup = <51>;
+               nvidia.xcvr-setup-use-fuses;
+               nvidia,xcvr-lsfslew = <2>;
+               nvidia,xcvr-lsrslew = <2>;
+               nvidia,xcvr-hsslew = <32>;
+               nvidia,hssquelch-level = <2>;
+               nvidia,hsdiscon-level = <5>;
+               status = "disabled";
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
diff --git a/arch/arm/boot/dts/u9540.dts b/arch/arm/boot/dts/u9540.dts
deleted file mode 100644 (file)
index 95892ec..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2012 ST-Ericsson AB
- *
- * 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
- */
-
-/dts-v1/;
-/include/ "dbx5x0.dtsi"
-
-/ {
-       model = "ST-Ericsson U9540 platform with Device Tree";
-       compatible = "st-ericsson,u9540";
-
-       memory {
-               reg = <0x00000000 0x20000000>;
-       };
-
-       soc-u9500 {
-               uart@80120000 {
-                       status = "okay";
-               };
-
-               uart@80121000 {
-                       status = "okay";
-               };
-
-               uart@80007000 {
-                       status = "okay";
-               };
-
-               // External Micro SD slot
-               sdi0_per1@80126000 {
-                       arm,primecell-periphid = <0x10480180>;
-                       max-frequency = <100000000>;
-                       bus-width = <4>;
-                       mmc-cap-sd-highspeed;
-                       mmc-cap-mmc-highspeed;
-                       vmmc-supply = <&ab8500_ldo_aux3_reg>;
-
-                       cd-gpios  = <&gpio7 6 0x4>; // 230
-                       cd-inverted;
-
-                       status = "okay";
-               };
-
-
-               // WLAN SDIO channel
-               sdi1_per2@80118000 {
-                       arm,primecell-periphid = <0x10480180>;
-                       max-frequency = <50000000>;
-                       bus-width = <4>;
-
-                       status = "okay";
-               };
-
-               // On-board eMMC
-               sdi4_per2@80114000 {
-                       arm,primecell-periphid = <0x10480180>;
-                       max-frequency = <100000000>;
-                       bus-width = <8>;
-                       mmc-cap-mmc-highspeed;
-                       vmmc-supply = <&ab8500_ldo_aux2_reg>;
-
-                       status = "okay";
-               };
-       };
-};
index d2803be..759b0cd 100644 (file)
                clock-names = "apb_pclk";
        };
 
+        scc@7fff0000 {
+               compatible = "arm,vexpress-scc,v2p-ca15_a7", "arm,vexpress-scc";
+               reg = <0 0x7fff0000 0 0x1000>;
+               interrupts = <0 95 4>;
+        };
+
        timer {
                compatible = "arm,armv7-timer";
                interrupts = <1 13 0xf08>,
index b3905f5..1a58678 100644 (file)
        status = "okay";
 };
 
+&i2c0 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c0_1>;
+       status = "okay";
+};
+
 &uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart1_1>;
index 6f54a64..e32b92b 100644 (file)
@@ -41,8 +41,8 @@
                L2: cache-controller {
                        compatible = "arm,pl310-cache";
                        reg = <0xF8F02000 0x1000>;
-                       arm,data-latency = <2 3 2>;
-                       arm,tag-latency = <2 3 2>;
+                       arm,data-latency = <3 2 2>;
+                       arm,tag-latency = <2 2 2>;
                        cache-unified;
                        cache-level = <2>;
                };
index dab5a7d..1ce3994 100644 (file)
@@ -54,7 +54,8 @@ CONFIG_NETDEVICES=y
 CONFIG_SMC91X=y
 CONFIG_SMSC911X=y
 # CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_EVDEV=y
+CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
 CONFIG_SERIAL_NONSTANDARD=y
@@ -71,6 +72,9 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_GPIO=y
 # CONFIG_HID is not set
 # CONFIG_USB_SUPPORT is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
 # CONFIG_IOMMU_SUPPORT is not set
 # CONFIG_DNOTIFY is not set
 CONFIG_TMPFS=y
index 65edf6d..6e49310 100644 (file)
@@ -42,6 +42,18 @@ CONFIG_VFP=y
 CONFIG_NEON=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_PACKET_DIAG=y
+CONFIG_UNIX=y
+CONFIG_UNIX_DIAG=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_ARPD=y
+CONFIG_SYN_COOKIES=y
+CONFIG_TCP_MD5SIG=y
+CONFIG_IPV6=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_PROC_DEVICETREE=y
@@ -112,7 +124,6 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=110
 CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_FTRACE is not set
-CONFIG_DEBUG_LL=y
 CONFIG_CRC_CCITT=y
 CONFIG_CRC_T10DIF=y
 CONFIG_CRC_ITU_T=y
index 4364eff..1101054 100644 (file)
@@ -13,6 +13,9 @@ CONFIG_ARCH_DOVE=y
 CONFIG_MACH_DOVE_DB=y
 CONFIG_MACH_CM_A510=y
 CONFIG_MACH_DOVE_DT=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_MVEBU=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
@@ -78,6 +81,7 @@ CONFIG_SPI_ORION=y
 CONFIG_THERMAL=y
 CONFIG_DOVE_THERMAL=y
 CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_STORAGE=y
diff --git a/arch/arm/configs/exynos4_defconfig b/arch/arm/configs/exynos4_defconfig
deleted file mode 100644 (file)
index bffe68e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-CONFIG_EXPERIMENTAL=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_ARCH_EXYNOS=y
-CONFIG_S3C_LOWLEVEL_UART_PORT=1
-CONFIG_MACH_SMDKC210=y
-CONFIG_MACH_ARMLEX4210=y
-CONFIG_MACH_UNIVERSAL_C210=y
-CONFIG_MACH_NURI=y
-CONFIG_MACH_ORIGEN=y
-CONFIG_MACH_SMDK4412=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_SMP=y
-CONFIG_NR_CPUS=2
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
-CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc mem=256M"
-CONFIG_VFP=y
-CONFIG_NEON=y
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_SCSI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_CHR_DEV_SG=y
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_SAMSUNG=y
-CONFIG_SERIAL_SAMSUNG_CONSOLE=y
-CONFIG_HW_RANDOM=y
-CONFIG_I2C=y
-# CONFIG_HWMON is not set
-# CONFIG_MFD_SUPPORT is not set
-# CONFIG_HID_SUPPORT is not set
-# CONFIG_USB_SUPPORT is not set
-CONFIG_EXT2_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-CONFIG_CRAMFS=y
-CONFIG_ROMFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_BSD_DISKLABEL=y
-CONFIG_SOLARIS_X86_PARTITION=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_KERNEL=y
-CONFIG_DETECT_HUNG_TASK=y
-CONFIG_DEBUG_RT_MUTEXES=y
-CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_MUTEXES=y
-CONFIG_DEBUG_INFO=y
-CONFIG_SYSCTL_SYSCALL_CHECK=y
-CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_LL=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_CRC_CCITT=y
index f07a847..e958ebe 100644 (file)
@@ -1,4 +1,3 @@
-CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
@@ -17,16 +16,18 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_MXC=y
 CONFIG_ARCH_MULTI_V4T=y
 CONFIG_ARCH_MULTI_V5=y
 # CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_MXC=y
+CONFIG_MXC_IRQ_PRIOR=y
 CONFIG_ARCH_MX1ADS=y
 CONFIG_MACH_SCB9328=y
 CONFIG_MACH_APF9328=y
 CONFIG_MACH_MX21ADS=y
 CONFIG_MACH_MX25_3DS=y
 CONFIG_MACH_EUKREA_CPUIMX25SD=y
+CONFIG_MACH_IMX25_DT=y
 CONFIG_MACH_MX27ADS=y
 CONFIG_MACH_PCM038=y
 CONFIG_MACH_CPUIMX27=y
@@ -39,8 +40,6 @@ CONFIG_MACH_PCA100=y
 CONFIG_MACH_MXT_TD60=y
 CONFIG_MACH_IMX27IPCAM=y
 CONFIG_MACH_IMX27_DT=y
-CONFIG_MXC_IRQ_PRIOR=y
-CONFIG_MXC_PWM=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
@@ -67,7 +66,6 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -123,24 +121,20 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_MC13783=y
 CONFIG_REGULATOR_MC13892=y
 CONFIG_MEDIA_SUPPORT=y
-CONFIG_VIDEO_DEV=y
-CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_SOC_CAMERA=y
-CONFIG_SOC_CAMERA_OV2640=y
 CONFIG_VIDEO_MX2=y
 CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_CODA=y
+CONFIG_SOC_CAMERA_OV2640=y
 CONFIG_FB=y
 CONFIG_FB_IMX=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_LCD_L4F00242T03=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_PWM=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
@@ -157,7 +151,6 @@ CONFIG_USB_HID=m
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_MXC=y
-CONFIG_USB_ULPI=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
@@ -198,3 +191,5 @@ CONFIG_NLS_CODEPAGE_850=m
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
index 06686e7..5d488c2 100644 (file)
@@ -1,4 +1,3 @@
-CONFIG_EXPERIMENTAL=y
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_KERNEL_LZO=y
 CONFIG_SYSVIPC=y
@@ -17,10 +16,8 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 # CONFIG_BLK_DEV_BSG is not set
-CONFIG_ARCH_MXC=y
 CONFIG_ARCH_MULTI_V6=y
-CONFIG_ARCH_MULTI_V7=y
-CONFIG_MACH_IMX31_DT=y
+CONFIG_ARCH_MXC=y
 CONFIG_MACH_MX31LILLY=y
 CONFIG_MACH_MX31LITE=y
 CONFIG_MACH_PCM037=y
@@ -30,6 +27,7 @@ CONFIG_MACH_MX31MOBOARD=y
 CONFIG_MACH_QONG=y
 CONFIG_MACH_ARMADILLO5X0=y
 CONFIG_MACH_KZM_ARM11_01=y
+CONFIG_MACH_IMX31_DT=y
 CONFIG_MACH_PCM043=y
 CONFIG_MACH_MX35_3DS=y
 CONFIG_MACH_VPR200=y
@@ -39,7 +37,6 @@ CONFIG_SOC_IMX53=y
 CONFIG_SOC_IMX6Q=y
 CONFIG_SOC_IMX6SL=y
 CONFIG_SOC_VF610=y
-CONFIG_MXC_PWM=y
 CONFIG_SMP=y
 CONFIG_VMSPLIT_2G=y
 CONFIG_PREEMPT_VOLUNTARY=y
@@ -64,20 +61,24 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_LRO is not set
 CONFIG_IPV6=y
 CONFIG_NETFILTER=y
-# CONFIG_WIRELESS is not set
+CONFIG_CFG80211=y
+CONFIG_MAC80211=y
+CONFIG_RFKILL=y
+CONFIG_RFKILL_INPUT=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_STANDALONE is not set
+CONFIG_IMX_WEIM=y
 CONFIG_CONNECTOR=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_MTD_DATAFLASH=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_SST25L=y
@@ -88,6 +89,7 @@ CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=65536
+CONFIG_SRAM=y
 CONFIG_EEPROM_AT24=y
 CONFIG_EEPROM_AT25=y
 # CONFIG_SCSI_PROC_FS is not set
@@ -98,10 +100,11 @@ CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_SCAN_ASYNC=y
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_ATA=y
+CONFIG_SATA_AHCI_PLATFORM=y
+CONFIG_AHCI_IMX=y
 CONFIG_PATA_IMX=y
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_CHELSIO is not set
 CONFIG_CS89x0=y
 CONFIG_CS89x0_PLATFORM=y
 # CONFIG_NET_VENDOR_FARADAY is not set
@@ -115,7 +118,7 @@ CONFIG_SMC91X=y
 CONFIG_SMC911X=y
 CONFIG_SMSC911X=y
 # CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_WLAN is not set
+CONFIG_BRCMFMAC=m
 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_EVBUG=m
@@ -124,6 +127,7 @@ CONFIG_KEYBOARD_IMX=y
 CONFIG_MOUSE_PS2=m
 CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_EGALAX=y
 CONFIG_TOUCHSCREEN_MC13783=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_MMA8450=y
@@ -133,13 +137,13 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_IMX=y
 CONFIG_SERIAL_IMX_CONSOLE=y
+CONFIG_SERIAL_FSL_LPUART=y
+CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MXC_RNGA=y
-CONFIG_I2C=y
 # CONFIG_I2C_COMPAT is not set
 CONFIG_I2C_CHARDEV=y
 # CONFIG_I2C_HELPER_AUTO is not set
-CONFIG_I2C_ALGOBIT=m
 CONFIG_I2C_ALGOPCF=m
 CONFIG_I2C_ALGOPCA=m
 CONFIG_I2C_IMX=y
@@ -155,30 +159,26 @@ CONFIG_MFD_MC13XXX_SPI=y
 CONFIG_MFD_MC13XXX_I2C=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
-CONFIG_REGULATOR_DA9052=y
 CONFIG_REGULATOR_ANATOP=y
+CONFIG_REGULATOR_DA9052=y
 CONFIG_REGULATOR_MC13783=y
 CONFIG_REGULATOR_MC13892=y
 CONFIG_MEDIA_SUPPORT=y
-CONFIG_VIDEO_DEV=y
-CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_SOC_CAMERA=y
+CONFIG_VIDEO_MX3=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_CODA=y
 CONFIG_SOC_CAMERA_OV2640=y
 CONFIG_DRM=y
-CONFIG_VIDEO_MX3=y
-CONFIG_FB=y
-CONFIG_LCD_PLATFORM=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_LCD_L4F00242T03=y
+CONFIG_LCD_PLATFORM=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_PWM=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
@@ -192,11 +192,12 @@ CONFIG_SND_SOC_IMX_MC13783=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_MXC=y
+CONFIG_USB_STORAGE=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_HOST=y
 CONFIG_USB_PHY=y
+CONFIG_NOP_USB_XCEIV=y
 CONFIG_USB_MXS_PHY=y
-CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
@@ -213,9 +214,10 @@ CONFIG_IMX_SDMA=y
 CONFIG_MXS_DMA=y
 CONFIG_STAGING=y
 CONFIG_DRM_IMX=y
-CONFIG_DRM_IMX_TVE=y
 CONFIG_DRM_IMX_FB_HELPER=y
 CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
+CONFIG_DRM_IMX_TVE=y
+CONFIG_DRM_IMX_LDB=y
 CONFIG_DRM_IMX_IPUV3_CORE=y
 CONFIG_DRM_IMX_IPUV3=y
 CONFIG_COMMON_CLK_DEBUG=y
@@ -269,3 +271,6 @@ CONFIG_CRC_CCITT=m
 CONFIG_CRC_T10DIF=y
 CONFIG_CRC7=m
 CONFIG_LIBCRC32C=m
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
index 0f2aa61..0ae0eae 100644 (file)
@@ -10,49 +10,18 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_KIRKWOOD=y
 CONFIG_MACH_D2NET_V2=y
-CONFIG_MACH_DB88F6281_BP=y
-CONFIG_MACH_DOCKSTAR=y
-CONFIG_MACH_ESATA_SHEEVAPLUG=y
-CONFIG_MACH_GURUPLUG=y
-CONFIG_MACH_INETSPACE_V2=y
-CONFIG_MACH_MV88F6281GTW_GE=y
 CONFIG_MACH_NET2BIG_V2=y
 CONFIG_MACH_NET5BIG_V2=y
-CONFIG_MACH_NETSPACE_MAX_V2=y
-CONFIG_MACH_NETSPACE_V2=y
 CONFIG_MACH_OPENRD_BASE=y
 CONFIG_MACH_OPENRD_CLIENT=y
 CONFIG_MACH_OPENRD_ULTIMATE=y
 CONFIG_MACH_RD88F6192_NAS=y
 CONFIG_MACH_RD88F6281=y
-CONFIG_MACH_SHEEVAPLUG=y
 CONFIG_MACH_T5325=y
 CONFIG_MACH_TS219=y
 CONFIG_MACH_TS41X=y
-CONFIG_MACH_CLOUDBOX_DT=y
-CONFIG_MACH_DB88F628X_BP_DT=y
-CONFIG_MACH_DLINK_KIRKWOOD_DT=y
-CONFIG_MACH_DOCKSTAR_DT=y
-CONFIG_MACH_DREAMPLUG_DT=y
-CONFIG_MACH_GOFLEXNET_DT=y
-CONFIG_MACH_GURUPLUG_DT=y
-CONFIG_MACH_IB62X0_DT=y
-CONFIG_MACH_ICONNECT_DT=y
-CONFIG_MACH_INETSPACE_V2_DT=y
-CONFIG_MACH_IOMEGA_IX2_200_DT=y
-CONFIG_MACH_KM_KIRKWOOD_DT=y
-CONFIG_MACH_LSXL_DT=y
-CONFIG_MACH_MPLCEC4_DT=y
-CONFIG_MACH_NETSPACE_LITE_V2_DT=y
-CONFIG_MACH_NETSPACE_MAX_V2_DT=y
-CONFIG_MACH_NETSPACE_MINI_V2_DT=y
-CONFIG_MACH_NETSPACE_V2_DT=y
-CONFIG_MACH_NSA310_DT=y
-CONFIG_MACH_OPENBLOCKS_A6_DT=y
-CONFIG_MACH_READYNAS_DT=y
-CONFIG_MACH_SHEEVAPLUG_DT=y
-CONFIG_MACH_TOPKICK_DT=y
-CONFIG_MACH_TS219_DT=y
+CONFIG_ARCH_KIRKWOOD_DT=y
+CONFIG_MACH_MV88F6281GTW_GE_DT=y
 # CONFIG_CPU_FEROCEON_OLD_ID is not set
 CONFIG_PCI_MVEBU=y
 CONFIG_PREEMPT=y
@@ -92,6 +61,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ORION=y
 CONFIG_BLK_DEV_LOOP=y
+CONFIG_EEPROM_AT24=y
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=m
@@ -100,9 +70,9 @@ CONFIG_ATA=y
 CONFIG_SATA_AHCI=y
 CONFIG_SATA_MV=y
 CONFIG_NETDEVICES=y
-CONFIG_MII=y
 CONFIG_NET_DSA_MV88E6123_61_65=y
 CONFIG_MV643XX_ETH=y
+CONFIG_R8169=y
 CONFIG_MARVELL_PHY=y
 CONFIG_LIBERTAS=y
 CONFIG_LIBERTAS_SDIO=y
@@ -123,9 +93,11 @@ CONFIG_I2C_MV64XXX=y
 CONFIG_SPI=y
 CONFIG_SPI_ORION=y
 CONFIG_GPIO_SYSFS=y
-# CONFIG_HWMON is not set
+CONFIG_SENSORS_ADT7475=y
+CONFIG_SENSORS_LM63=y
+CONFIG_SENSORS_LM75=y
+CONFIG_SENSORS_LM85=y
 CONFIG_THERMAL=y
-CONFIG_KIRKWOOD_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_ORION_WATCHDOG=y
 CONFIG_HID_DRAGONRISE=y
@@ -164,6 +136,8 @@ CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_RS5C372=y
+CONFIG_RTC_DRV_PCF8563=y
 CONFIG_RTC_DRV_S35390A=y
 CONFIG_RTC_DRV_MV=y
 CONFIG_DMADEVICES=y
@@ -171,6 +145,7 @@ CONFIG_MV_XOR=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
 CONFIG_ISO9660_FS=m
 CONFIG_JOLIET=y
 CONFIG_UDF_FS=m
@@ -186,12 +161,12 @@ CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
 CONFIG_NLS_UTF8=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
-CONFIG_DEBUG_INFO=y
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
diff --git a/arch/arm/configs/lager_defconfig b/arch/arm/configs/lager_defconfig
new file mode 100644 (file)
index 0000000..e777ef2
--- /dev/null
@@ -0,0 +1,120 @@
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=16
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_EMBEDDED=y
+CONFIG_PERF_EVENTS=y
+CONFIG_SLAB=y
+# 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_ARCH_SHMOBILE=y
+CONFIG_ARCH_R8A7790=y
+CONFIG_MACH_LAGER=y
+# CONFIG_SH_TIMER_TMU is not set
+# CONFIG_EM_TIMER_STI is not set
+CONFIG_ARM_ERRATA_430973=y
+CONFIG_ARM_ERRATA_458693=y
+CONFIG_ARM_ERRATA_460075=y
+CONFIG_ARM_ERRATA_743622=y
+CONFIG_ARM_ERRATA_754322=y
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_KEXEC=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_VFP=y
+CONFIG_NEON=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_NETDEVICES=y
+# CONFIG_NET_CORE is not set
+# 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_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+CONFIG_SH_ETH=y
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+# CONFIG_WLAN is not set
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_SH_SCI=y
+CONFIG_SERIAL_SH_SCI_NR_UARTS=10
+CONFIG_SERIAL_SH_SCI_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_GPIO=y
+CONFIG_I2C_SH_MOBILE=y
+CONFIG_GPIO_SH_PFC=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_RCAR=y
+# CONFIG_HWMON is not set
+CONFIG_THERMAL=y
+CONFIG_RCAR_THERMAL=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_SDHI=y
+CONFIG_MMC_SH_MMCIF=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_RTC_CLASS=y
+CONFIG_DMADEVICES=y
+CONFIG_SH_DMAE=y
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_CONFIGFS_FS=y
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_ROOT_NFS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
index c50e52b..000e920 100644 (file)
@@ -29,6 +29,7 @@ CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
 CONFIG_CMDLINE="console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on"
 CONFIG_CMDLINE_FORCE=y
 CONFIG_KEXEC=y
index 731814e..594d706 100644 (file)
@@ -39,6 +39,8 @@ CONFIG_MVNETA=y
 CONFIG_MARVELL_PHY=y
 CONFIG_MWIFIEX=y
 CONFIG_MWIFIEX_SDIO=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_KEYBOARD_GPIO=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_I2C=y
index 1d6d8fb..4555c02 100644 (file)
@@ -1,4 +1,3 @@
-CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -27,7 +26,6 @@ CONFIG_ARCH_MXS=y
 # CONFIG_ARM_THUMB is not set
 CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_AEABI=y
-CONFIG_AUTO_ZRELADDR=y
 CONFIG_FPE_NWFPE=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -43,8 +41,6 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_DIAG is not set
 # CONFIG_IPV6 is not set
 CONFIG_CAN=m
-CONFIG_CAN_RAW=m
-CONFIG_CAN_BCM=m
 CONFIG_CAN_FLEXCAN=m
 # CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
@@ -52,7 +48,6 @@ CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_FIRMWARE_IN_KERNEL is not set
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_DATAFLASH=y
 CONFIG_MTD_M25P80=y
@@ -67,12 +62,12 @@ CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 CONFIG_ENC28J60=y
-CONFIG_USB_USBNET=y
-CONFIG_USB_NET_SMSC95XX=y
 CONFIG_SMSC_PHY=y
 CONFIG_ICPLUS_PHY=y
 CONFIG_REALTEK_PHY=y
 CONFIG_MICREL_PHY=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_SMSC95XX=y
 # CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=y
@@ -110,7 +105,6 @@ CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_PWM=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
@@ -119,9 +113,9 @@ CONFIG_SND_MXS_SOC=y
 CONFIG_SND_SOC_MXS_SGTL5000=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_HOST=y
-CONFIG_USB_STORAGE=y
 CONFIG_USB_PHY=y
 CONFIG_USB_MXS_PHY=y
 CONFIG_MMC=y
@@ -143,9 +137,9 @@ CONFIG_DMADEVICES=y
 CONFIG_MXS_DMA=y
 CONFIG_STAGING=y
 CONFIG_MXS_LRADC=y
-CONFIG_IIO_SYSFS_TRIGGER=y
 CONFIG_COMMON_CLK_DEBUG=y
 CONFIG_IIO=y
+CONFIG_IIO_SYSFS_TRIGGER=y
 CONFIG_PWM=y
 CONFIG_PWM_MXS=y
 CONFIG_EXT2_FS=y
@@ -173,14 +167,14 @@ CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=y
 CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
 CONFIG_FRAME_WARN=2048
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_UNUSED_SYMBOLS=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_TIMER_STATS=y
 CONFIG_PROVE_LOCKING=y
-CONFIG_DEBUG_INFO=y
 CONFIG_BLK_DEV_IO_TRACE=y
 CONFIG_STRICT_DEVMEM=y
 CONFIG_DEBUG_USER=y
@@ -188,3 +182,4 @@ CONFIG_DEBUG_USER=y
 # CONFIG_CRYPTO_HW is not set
 CONFIG_CRC_ITU_T=m
 CONFIG_CRC7=m
+CONFIG_FONTS=y
index 056b27a..254cf05 100644 (file)
@@ -305,3 +305,4 @@ CONFIG_TI_DAVINCI_MDIO=y
 CONFIG_TI_DAVINCI_CPDMA=y
 CONFIG_TI_CPSW=y
 CONFIG_AT803X_PHY=y
+CONFIG_SOC_DRA7XX=y
index 92d0a14..ea042e8 100644 (file)
@@ -1,3 +1,4 @@
+CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
@@ -26,8 +27,11 @@ CONFIG_ARCH_TEGRA=y
 CONFIG_ARCH_TEGRA_2x_SOC=y
 CONFIG_ARCH_TEGRA_3x_SOC=y
 CONFIG_ARCH_TEGRA_114_SOC=y
-CONFIG_TEGRA_PCI=y
 CONFIG_TEGRA_EMC_SCALING_ENABLE=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_TEGRA=y
+CONFIG_PCIEPORTBUS=y
 CONFIG_SMP=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
@@ -92,6 +96,7 @@ CONFIG_ISL29003=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=y
+CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=y
@@ -106,6 +111,7 @@ CONFIG_RT2800USB=m
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_TEGRA=y
+CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_MPU3050=y
 # CONFIG_LEGACY_PTYS is not set
@@ -178,6 +184,7 @@ CONFIG_SND_SOC_TEGRA_WM8903=y
 CONFIG_SND_SOC_TEGRA_TRIMSLICE=y
 CONFIG_SND_SOC_TEGRA_ALC5632=y
 CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_ACM=y
index 56211f2..f4b46d3 100644 (file)
@@ -19,8 +19,6 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
 typedef struct user_fp elf_fpregset_t;
 
-#define EM_ARM 40
-
 #define EF_ARM_EABI_MASK       0xff000000
 #define EF_ARM_EABI_UNKNOWN    0x00000000
 #define EF_ARM_EABI_VER1       0x01000000
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
deleted file mode 100644 (file)
index f77ffc1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *  arch/arm/include/asm/localtimer.h
- *
- *  Copyright (C) 2004-2005 ARM 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 __ASM_ARM_LOCALTIMER_H
-#define __ASM_ARM_LOCALTIMER_H
-
-#include <linux/errno.h>
-
-struct clock_event_device;
-
-struct local_timer_ops {
-       int  (*setup)(struct clock_event_device *);
-       void (*stop)(struct clock_event_device *);
-};
-
-#ifdef CONFIG_LOCAL_TIMERS
-/*
- * Register a local timer driver
- */
-int local_timer_register(struct local_timer_ops *);
-#else
-static inline int local_timer_register(struct local_timer_ops *ops)
-{
-       return -ENXIO;
-}
-#endif
-
-#endif
index a1c90d7..454d642 100644 (file)
@@ -36,6 +36,8 @@ struct hw_pci {
                                          resource_size_t start,
                                          resource_size_t size,
                                          resource_size_t align);
+       void            (*add_bus)(struct pci_bus *bus);
+       void            (*remove_bus)(struct pci_bus *bus);
 };
 
 /*
@@ -63,6 +65,8 @@ struct pci_sys_data {
                                          resource_size_t start,
                                          resource_size_t size,
                                          resource_size_t align);
+       void            (*add_bus)(struct pci_bus *bus);
+       void            (*remove_bus)(struct pci_bus *bus);
        void            *private_data;  /* platform controller private data     */
 };
 
similarity index 61%
rename from arch/arm/mach-msm/include/mach/debug-macro.S
rename to arch/arm/include/debug/msm.S
index 0e05f88..9166e1b 100644 (file)
  *
  */
 
-#include <mach/hardware.h>
-#include <mach/msm_iomap.h>
+#if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_QSD8X50)
+#define MSM_UART1_PHYS        0xA9A00000
+#define MSM_UART2_PHYS        0xA9B00000
+#define MSM_UART3_PHYS        0xA9C00000
+#elif defined(CONFIG_ARCH_MSM7X30)
+#define MSM_UART1_PHYS        0xACA00000
+#define MSM_UART2_PHYS        0xACB00000
+#define MSM_UART3_PHYS        0xACC00000
+#endif
+
+#if defined(CONFIG_DEBUG_MSM_UART1)
+#define MSM_DEBUG_UART_BASE    0xE1000000
+#define MSM_DEBUG_UART_PHYS    MSM_UART1_PHYS
+#elif defined(CONFIG_DEBUG_MSM_UART2)
+#define MSM_DEBUG_UART_BASE    0xE1000000
+#define MSM_DEBUG_UART_PHYS    MSM_UART2_PHYS
+#elif defined(CONFIG_DEBUG_MSM_UART3)
+#define MSM_DEBUG_UART_BASE    0xE1000000
+#define MSM_DEBUG_UART_PHYS    MSM_UART3_PHYS
+#endif
+
+#ifdef CONFIG_DEBUG_MSM8660_UART
+#define MSM_DEBUG_UART_BASE    0xF0040000
+#define MSM_DEBUG_UART_PHYS    0x19C40000
+#endif
+
+#ifdef CONFIG_DEBUG_MSM8960_UART
+#define MSM_DEBUG_UART_BASE    0xF0040000
+#define MSM_DEBUG_UART_PHYS    0x16440000
+#endif
 
        .macro  addruart, rp, rv, tmp
 #ifdef MSM_DEBUG_UART_PHYS
index 88e14d7..317da88 100644 (file)
@@ -363,6 +363,20 @@ void pcibios_fixup_bus(struct pci_bus *bus)
 }
 EXPORT_SYMBOL(pcibios_fixup_bus);
 
+void pcibios_add_bus(struct pci_bus *bus)
+{
+       struct pci_sys_data *sys = bus->sysdata;
+       if (sys->add_bus)
+               sys->add_bus(bus);
+}
+
+void pcibios_remove_bus(struct pci_bus *bus)
+{
+       struct pci_sys_data *sys = bus->sysdata;
+       if (sys->remove_bus)
+               sys->remove_bus(bus);
+}
+
 /*
  * Swizzle the device pin each time we cross a bridge.  If a platform does
  * not provide a swizzle function, we perform the standard PCI swizzling.
@@ -464,6 +478,8 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
                sys->swizzle = hw->swizzle;
                sys->map_irq = hw->map_irq;
                sys->align_resource = hw->align_resource;
+               sys->add_bus = hw->add_bus;
+               sys->remove_bus = hw->remove_bus;
                INIT_LIST_HEAD(&sys->resources);
 
                if (hw->private_data)
index 92d10e5..72024ea 100644 (file)
@@ -41,7 +41,6 @@
 #include <asm/sections.h>
 #include <asm/tlbflush.h>
 #include <asm/ptrace.h>
-#include <asm/localtimer.h>
 #include <asm/smp_plat.h>
 #include <asm/virt.h>
 #include <asm/mach/arch.h>
@@ -156,8 +155,6 @@ int platform_can_cpu_hotplug(void)
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-static void percpu_timer_stop(void);
-
 static int platform_cpu_kill(unsigned int cpu)
 {
        if (smp_ops.cpu_kill)
@@ -201,11 +198,6 @@ int __cpu_disable(void)
        migrate_irqs();
 
        /*
-        * Stop the local timer for this CPU.
-        */
-       percpu_timer_stop();
-
-       /*
         * Flush user cache and TLB mappings, and then remove this CPU
         * from the vm mask set of all processes.
         *
@@ -326,8 +318,6 @@ static void smp_store_cpu_info(unsigned int cpuid)
        store_cpu_topology(cpuid);
 }
 
-static void percpu_timer_setup(void);
-
 /*
  * This is the secondary CPU boot entry.  We're using this CPUs
  * idle thread stack, but a set of temporary page tables.
@@ -382,11 +372,6 @@ asmlinkage void secondary_start_kernel(void)
        set_cpu_online(cpu, true);
        complete(&cpu_running);
 
-       /*
-        * Setup the percpu timer for this CPU.
-        */
-       percpu_timer_setup();
-
        local_irq_enable();
        local_fiq_enable();
 
@@ -424,12 +409,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
                max_cpus = ncores;
        if (ncores > 1 && max_cpus) {
                /*
-                * Enable the local timer or broadcast device for the
-                * boot CPU, but only if we have more than one CPU.
-                */
-               percpu_timer_setup();
-
-               /*
                 * Initialise the present map, which describes the set of CPUs
                 * actually populated at the present time. A platform should
                 * re-initialize the map in the platforms smp_prepare_cpus()
@@ -505,11 +484,6 @@ u64 smp_irq_stat_cpu(unsigned int cpu)
        return sum;
 }
 
-/*
- * Timer (local or broadcast) support
- */
-static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
-
 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
 void tick_broadcast(const struct cpumask *mask)
 {
@@ -517,67 +491,6 @@ void tick_broadcast(const struct cpumask *mask)
 }
 #endif
 
-static void broadcast_timer_set_mode(enum clock_event_mode mode,
-       struct clock_event_device *evt)
-{
-}
-
-static void broadcast_timer_setup(struct clock_event_device *evt)
-{
-       evt->name       = "dummy_timer";
-       evt->features   = CLOCK_EVT_FEAT_ONESHOT |
-                         CLOCK_EVT_FEAT_PERIODIC |
-                         CLOCK_EVT_FEAT_DUMMY;
-       evt->rating     = 100;
-       evt->mult       = 1;
-       evt->set_mode   = broadcast_timer_set_mode;
-
-       clockevents_register_device(evt);
-}
-
-static struct local_timer_ops *lt_ops;
-
-#ifdef CONFIG_LOCAL_TIMERS
-int local_timer_register(struct local_timer_ops *ops)
-{
-       if (!is_smp() || !setup_max_cpus)
-               return -ENXIO;
-
-       if (lt_ops)
-               return -EBUSY;
-
-       lt_ops = ops;
-       return 0;
-}
-#endif
-
-static void percpu_timer_setup(void)
-{
-       unsigned int cpu = smp_processor_id();
-       struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
-
-       evt->cpumask = cpumask_of(cpu);
-
-       if (!lt_ops || lt_ops->setup(evt))
-               broadcast_timer_setup(evt);
-}
-
-#ifdef CONFIG_HOTPLUG_CPU
-/*
- * The generic clock events code purposely does not stop the local timer
- * on CPU_DEAD/CPU_DEAD_FROZEN hotplug events, so we have to do it
- * manually here.
- */
-static void percpu_timer_stop(void)
-{
-       unsigned int cpu = smp_processor_id();
-       struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
-
-       if (lt_ops)
-               lt_ops->stop(evt);
-}
-#endif
-
 static DEFINE_RAW_SPINLOCK(stop_lock);
 
 /*
index 2595620..2985c9f 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/clk.h>
+#include <linux/cpu.h>
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/err.h>
@@ -24,7 +25,6 @@
 
 #include <asm/smp_plat.h>
 #include <asm/smp_twd.h>
-#include <asm/localtimer.h>
 
 /* set up by the platform code */
 static void __iomem *twd_base;
@@ -33,7 +33,7 @@ static struct clk *twd_clk;
 static unsigned long twd_timer_rate;
 static DEFINE_PER_CPU(bool, percpu_setup_called);
 
-static struct clock_event_device __percpu **twd_evt;
+static struct clock_event_device __percpu *twd_evt;
 static int twd_ppi;
 
 static void twd_set_mode(enum clock_event_mode mode,
@@ -90,8 +90,10 @@ static int twd_timer_ack(void)
        return 0;
 }
 
-static void twd_timer_stop(struct clock_event_device *clk)
+static void twd_timer_stop(void)
 {
+       struct clock_event_device *clk = __this_cpu_ptr(twd_evt);
+
        twd_set_mode(CLOCK_EVT_MODE_UNUSED, clk);
        disable_percpu_irq(clk->irq);
 }
@@ -106,7 +108,7 @@ static void twd_update_frequency(void *new_rate)
 {
        twd_timer_rate = *((unsigned long *) new_rate);
 
-       clockevents_update_freq(*__this_cpu_ptr(twd_evt), twd_timer_rate);
+       clockevents_update_freq(__this_cpu_ptr(twd_evt), twd_timer_rate);
 }
 
 static int twd_rate_change(struct notifier_block *nb,
@@ -132,7 +134,7 @@ static struct notifier_block twd_clk_nb = {
 
 static int twd_clk_init(void)
 {
-       if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
+       if (twd_evt && __this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
                return clk_notifier_register(twd_clk, &twd_clk_nb);
 
        return 0;
@@ -151,7 +153,7 @@ static void twd_update_frequency(void *data)
 {
        twd_timer_rate = clk_get_rate(twd_clk);
 
-       clockevents_update_freq(*__this_cpu_ptr(twd_evt), twd_timer_rate);
+       clockevents_update_freq(__this_cpu_ptr(twd_evt), twd_timer_rate);
 }
 
 static int twd_cpufreq_transition(struct notifier_block *nb,
@@ -177,7 +179,7 @@ static struct notifier_block twd_cpufreq_nb = {
 
 static int twd_cpufreq_init(void)
 {
-       if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
+       if (twd_evt && __this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
                return cpufreq_register_notifier(&twd_cpufreq_nb,
                        CPUFREQ_TRANSITION_NOTIFIER);
 
@@ -228,7 +230,7 @@ static void twd_calibrate_rate(void)
 
 static irqreturn_t twd_handler(int irq, void *dev_id)
 {
-       struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
+       struct clock_event_device *evt = dev_id;
 
        if (twd_timer_ack()) {
                evt->event_handler(evt);
@@ -265,9 +267,9 @@ static void twd_get_clock(struct device_node *np)
 /*
  * Setup the local clock events for a CPU.
  */
-static int twd_timer_setup(struct clock_event_device *clk)
+static void twd_timer_setup(void)
 {
-       struct clock_event_device **this_cpu_clk;
+       struct clock_event_device *clk = __this_cpu_ptr(twd_evt);
        int cpu = smp_processor_id();
 
        /*
@@ -276,9 +278,9 @@ static int twd_timer_setup(struct clock_event_device *clk)
         */
        if (per_cpu(percpu_setup_called, cpu)) {
                __raw_writel(0, twd_base + TWD_TIMER_CONTROL);
-               clockevents_register_device(*__this_cpu_ptr(twd_evt));
+               clockevents_register_device(clk);
                enable_percpu_irq(clk->irq, 0);
-               return 0;
+               return;
        }
        per_cpu(percpu_setup_called, cpu) = true;
 
@@ -297,27 +299,37 @@ static int twd_timer_setup(struct clock_event_device *clk)
        clk->set_mode = twd_set_mode;
        clk->set_next_event = twd_set_next_event;
        clk->irq = twd_ppi;
-
-       this_cpu_clk = __this_cpu_ptr(twd_evt);
-       *this_cpu_clk = clk;
+       clk->cpumask = cpumask_of(cpu);
 
        clockevents_config_and_register(clk, twd_timer_rate,
                                        0xf, 0xffffffff);
        enable_percpu_irq(clk->irq, 0);
+}
 
-       return 0;
+static int twd_timer_cpu_notify(struct notifier_block *self,
+                               unsigned long action, void *hcpu)
+{
+       switch (action & ~CPU_TASKS_FROZEN) {
+       case CPU_STARTING:
+               twd_timer_setup();
+               break;
+       case CPU_DYING:
+               twd_timer_stop();
+               break;
+       }
+
+       return NOTIFY_OK;
 }
 
-static struct local_timer_ops twd_lt_ops = {
-       .setup  = twd_timer_setup,
-       .stop   = twd_timer_stop,
+static struct notifier_block twd_timer_cpu_nb = {
+       .notifier_call = twd_timer_cpu_notify,
 };
 
 static int __init twd_local_timer_common_register(struct device_node *np)
 {
        int err;
 
-       twd_evt = alloc_percpu(struct clock_event_device *);
+       twd_evt = alloc_percpu(struct clock_event_device);
        if (!twd_evt) {
                err = -ENOMEM;
                goto out_free;
@@ -329,12 +341,22 @@ static int __init twd_local_timer_common_register(struct device_node *np)
                goto out_free;
        }
 
-       err = local_timer_register(&twd_lt_ops);
+       err = register_cpu_notifier(&twd_timer_cpu_nb);
        if (err)
                goto out_irq;
 
        twd_get_clock(np);
 
+       /*
+        * Immediately configure the timer on the boot CPU, unless we need
+        * jiffies to be incrementing to calibrate the rate in which case
+        * setup the timer in late_time_init.
+        */
+       if (twd_timer_rate)
+               twd_timer_setup();
+       else
+               late_time_init = twd_timer_setup;
+
        return 0;
 
 out_irq:
index ad95f6a..bf00d15 100644 (file)
@@ -42,20 +42,15 @@ static int ksz9021rn_phy_fixup(struct phy_device *phy)
 {
        int value;
 
-#define GMII_RCCPSR    260
-#define GMII_RRDPSR    261
-#define GMII_ERCR      11
-#define GMII_ERDWR     12
-
        /* Set delay values */
-       value = GMII_RCCPSR | 0x8000;
-       phy_write(phy, GMII_ERCR, value);
+       value = MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW | 0x8000;
+       phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value);
        value = 0xF2F4;
-       phy_write(phy, GMII_ERDWR, value);
-       value = GMII_RRDPSR | 0x8000;
-       phy_write(phy, GMII_ERCR, value);
+       phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value);
+       value = MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW | 0x8000;
+       phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value);
        value = 0x2222;
-       phy_write(phy, GMII_ERDWR, value);
+       phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value);
 
        return 0;
 }
index 3aaa978..f1d49e9 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
index f112895..69d67f7 100644 (file)
@@ -12,6 +12,7 @@ config ARCH_BCM
        select GPIO_BCM
        select SPARSE_IRQ
        select TICK_ONESHOT
+       select CACHE_L2X0
        help
          This enables support for system based on Broadcom SoCs.
          It currently supports the 'BCM281XX' family, which includes
index 6adb6ae..e3d0303 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2012 Broadcom Corporation
+# Copyright (C) 2012-2013 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
@@ -10,6 +10,6 @@
 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-obj-$(CONFIG_ARCH_BCM)         := board_bcm.o bcm_kona_smc.o bcm_kona_smc_asm.o
+obj-$(CONFIG_ARCH_BCM)         := board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_bcm_kona_smc_asm.o      :=-Wa,-march=armv7-a$(plus_sec)
index 56d9d19..5e31e91 100644 (file)
@@ -36,18 +36,20 @@ struct bcm_kona_smc_data {
 };
 
 static const struct of_device_id bcm_kona_smc_ids[] __initconst = {
-       {.compatible = "bcm,kona-smc"},
+       {.compatible = "brcm,kona-smc"},
+       {.compatible = "bcm,kona-smc"}, /* deprecated name */
        {},
 };
 
 /* Map in the bounce area */
-void __init bcm_kona_smc_init(void)
+int __init bcm_kona_smc_init(void)
 {
        struct device_node *node;
 
        /* Read buffer addr and size from the device tree node */
        node = of_find_matching_node(NULL, bcm_kona_smc_ids);
-       BUG_ON(!node);
+       if (!node)
+               return -ENODEV;
 
        /* Don't care about size or flags of the DT node */
        bridge_data.buffer_addr =
@@ -59,7 +61,9 @@ void __init bcm_kona_smc_init(void)
 
        bridge_data.initialized = 1;
 
-       pr_info("Secure API initialized!\n");
+       pr_info("Kona Secure API initialized\n");
+
+       return 0;
 }
 
 /* __bcm_kona_smc() should only run on CPU 0, with pre-emption disabled */
index 3bedbed..d098a7e 100644 (file)
@@ -64,7 +64,7 @@
 #define SSAPI_BRCM_START_VC_CORE       0x0E000008
 
 #ifndef        __ASSEMBLY__
-extern void bcm_kona_smc_init(void);
+extern int __init bcm_kona_smc_init(void);
 
 extern unsigned bcm_kona_smc(unsigned service_id,
                             unsigned arg0,
similarity index 68%
rename from arch/arm/mach-bcm/board_bcm.c
rename to arch/arm/mach-bcm/board_bcm281xx.c
index 2859932..8d9f931 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Broadcom Corporation
+ * Copyright (C) 2012-2013 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
 #include <asm/mach/time.h>
 #include <asm/hardware/cache-l2x0.h>
 
-
 #include "bcm_kona_smc.h"
+#include "kona.h"
 
 static int __init kona_l2_cache_init(void)
 {
        if (!IS_ENABLED(CONFIG_CACHE_L2X0))
                return 0;
 
+       if (bcm_kona_smc_init() < 0) {
+               pr_info("Kona secure API not available. Skipping L2 init\n");
+               return 0;
+       }
+
        bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0);
 
        /*
         * The aux_val and aux_mask have no effect since L2 cache is already
         * enabled.  Pass 0s for aux_val and 1s for aux_mask for default value.
         */
-       l2x0_of_init(0, ~0);
+       return l2x0_of_init(0, ~0);
+}
 
-       return 0;
+static void bcm_board_setup_restart(void)
+{
+       struct device_node *np;
+
+       np = of_find_compatible_node(NULL, NULL, "brcm,bcm11351");
+       if (np) {
+               if (of_device_is_available(np))
+                       bcm_kona_setup_restart();
+               of_node_put(np);
+       }
+       /* Restart setup for other boards goes here */
 }
 
 static void __init board_init(void)
@@ -45,15 +61,15 @@ static void __init board_init(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL,
                &platform_bus);
 
-       bcm_kona_smc_init();
-
+       bcm_board_setup_restart();
        kona_l2_cache_init();
 }
 
-static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, };
+static const char * const bcm11351_dt_compat[] = { "brcm,bcm11351", NULL, };
 
 DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor")
        .init_time = clocksource_of_init,
        .init_machine = board_init,
+       .restart = bcm_kona_restart,
        .dt_compat = bcm11351_dt_compat,
 MACHINE_END
diff --git a/arch/arm/mach-bcm/kona.c b/arch/arm/mach-bcm/kona.c
new file mode 100644 (file)
index 0000000..6939d90
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2013 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/of_address.h>
+#include <asm/io.h>
+
+#include "kona.h"
+
+static void __iomem *watchdog_base;
+
+void bcm_kona_setup_restart(void)
+{
+       struct device_node *np_wdog;
+
+       /*
+        * The assumption is that whoever calls bcm_kona_setup_restart()
+        * also needs a Kona Watchdog Timer entry in Device Tree, i.e. we
+        * report an error if the DT entry is missing.
+        */
+       np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt");
+       if (!np_wdog) {
+               pr_err("brcm,kona-wdt not found in DT, reboot disabled\n");
+               return;
+       }
+       watchdog_base = of_iomap(np_wdog, 0);
+       WARN(!watchdog_base, "failed to map watchdog base");
+       of_node_put(np_wdog);
+}
+
+#define SECWDOG_OFFSET                 0x00000000
+#define SECWDOG_RESERVED_MASK          0xE2000000
+#define SECWDOG_WD_LOAD_FLAG_MASK      0x10000000
+#define SECWDOG_EN_MASK                        0x08000000
+#define SECWDOG_SRSTEN_MASK            0x04000000
+#define SECWDOG_CLKS_SHIFT             20
+#define SECWDOG_LOCK_SHIFT             0
+
+void bcm_kona_restart(enum reboot_mode mode, const char *cmd)
+{
+       uint32_t val;
+
+       if (!watchdog_base)
+               panic("Watchdog not mapped. Reboot failed.\n");
+
+       /* Enable watchdog2 with very short timeout. */
+       val = readl(watchdog_base + SECWDOG_OFFSET);
+       val &= SECWDOG_RESERVED_MASK | SECWDOG_WD_LOAD_FLAG_MASK;
+       val |= SECWDOG_EN_MASK | SECWDOG_SRSTEN_MASK |
+               (0x8 << SECWDOG_CLKS_SHIFT) |
+               (0x8 << SECWDOG_LOCK_SHIFT);
+       writel(val, watchdog_base + SECWDOG_OFFSET);
+
+       while (1)
+               ;
+}
diff --git a/arch/arm/mach-bcm/kona.h b/arch/arm/mach-bcm/kona.h
new file mode 100644 (file)
index 0000000..291eca3
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2013 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/reboot.h>
+
+void bcm_kona_setup_restart(void);
+void bcm_kona_restart(enum reboot_mode mode, const char *cmd);
index 01ad4d4..bea6295 100644 (file)
@@ -33,9 +33,6 @@ config ARCH_P720T
          Say Y here if you intend to run this kernel on the ARM Prospector
          720T.
 
-config ARCH_FORTUNET
-       bool "FORTUNET"
-
 config EP72XX_ROM_BOOT
        bool "EP721x/EP731x ROM boot"
        help
index f30ed2b..f04151e 100644 (file)
@@ -10,5 +10,4 @@ obj-$(CONFIG_ARCH_AUTCPU12)   += board-autcpu12.o
 obj-$(CONFIG_ARCH_CDB89712)    += board-cdb89712.o
 obj-$(CONFIG_ARCH_CLEP7312)    += board-clep7312.o
 obj-$(CONFIG_ARCH_EDB7211)     += board-edb7211.o
-obj-$(CONFIG_ARCH_FORTUNET)    += board-fortunet.o
 obj-$(CONFIG_ARCH_P720T)       += board-p720t.o
index 5867aeb..f8d71a8 100644 (file)
@@ -259,11 +259,7 @@ static void __init autcpu12_init(void)
 static void __init autcpu12_init_late(void)
 {
        gpio_request_array(autcpu12_gpios, ARRAY_SIZE(autcpu12_gpios));
-
-       if (IS_ENABLED(MTD_NAND_GPIO) && IS_ENABLED(GPIO_GENERIC_PLATFORM)) {
-               /* We are need both drivers to handle NAND */
-               platform_device_register(&autcpu12_nand_pdev);
-       }
+       platform_device_register(&autcpu12_nand_pdev);
 }
 
 MACHINE_START(AUTCPU12, "autronix autcpu12")
index 9dfb990..fe6184e 100644 (file)
@@ -126,21 +126,6 @@ static struct gpio edb7211_gpios[] __initconst = {
        { EDB7211_LCDBL,        GPIOF_OUT_INIT_LOW,     "LCD BACKLIGHT" },
 };
 
-static struct map_desc edb7211_io_desc[] __initdata = {
-       {       /* Memory-mapped extra keyboard row */
-               .virtual        = IO_ADDRESS(EDB7211_EXTKBD_BASE),
-               .pfn            = __phys_to_pfn(EDB7211_EXTKBD_BASE),
-               .length         = SZ_1M,
-               .type           = MT_DEVICE,
-       },
-};
-
-void __init edb7211_map_io(void)
-{
-       clps711x_map_io();
-       iotable_init(edb7211_io_desc, ARRAY_SIZE(edb7211_io_desc));
-}
-
 /* Reserve screen memory region at the start of main system memory. */
 static void __init edb7211_reserve(void)
 {
@@ -195,7 +180,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
        .nr_irqs        = CLPS711X_NR_IRQS,
        .fixup          = fixup_edb7211,
        .reserve        = edb7211_reserve,
-       .map_io         = edb7211_map_io,
+       .map_io         = clps711x_map_io,
        .init_early     = clps711x_init_early,
        .init_irq       = clps711x_init_irq,
        .init_time      = clps711x_timer_init,
diff --git a/arch/arm/mach-clps711x/board-fortunet.c b/arch/arm/mach-clps711x/board-fortunet.c
deleted file mode 100644 (file)
index b1561e3..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *  linux/arch/arm/mach-clps711x/fortunet.c
- *
- *  Derived from linux/arch/arm/mach-integrator/arch.c
- *
- *  Copyright (C) 2000 Deep Blue Solutions Ltd
- *
- * 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/initrd.h>
-
-#include <mach/hardware.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-
-#include <asm/mach/arch.h>
-
-#include <asm/memory.h>
-
-#include "common.h"
-
-struct meminfo memmap = {
-       .nr_banks       = 1,
-       .bank           = {
-               {
-                       .start  = 0xC0000000,
-                       .size   = 0x01000000,
-               },
-       },
-};
-
-typedef struct tag_IMAGE_PARAMS
-{
-       int     ramdisk_ok;
-       int     ramdisk_address;
-       int     ramdisk_size;
-       int     ram_size;
-       int     extra_param_type;
-       int     extra_param_ptr;
-       int     command_line;
-} IMAGE_PARAMS;
-
-#define IMAGE_PARAMS_PHYS      0xC01F0000
-
-static void __init
-fortunet_fixup(struct tag *tags, char **cmdline, struct meminfo *mi)
-{
-       IMAGE_PARAMS *ip = phys_to_virt(IMAGE_PARAMS_PHYS);
-       *cmdline = phys_to_virt(ip->command_line);
-#ifdef CONFIG_BLK_DEV_INITRD
-       if(ip->ramdisk_ok)
-       {
-               initrd_start = __phys_to_virt(ip->ramdisk_address);
-               initrd_end = initrd_start + ip->ramdisk_size;
-       }
-#endif
-       memmap.bank[0].size = ip->ram_size;
-       *mi = memmap;
-}
-
-MACHINE_START(FORTUNET, "ARM-FortuNet")
-       /* Maintainer: FortuNet Inc. */
-       .nr_irqs        = CLPS711X_NR_IRQS,
-       .fixup          = fortunet_fixup,
-       .map_io         = clps711x_map_io,
-       .init_early     = clps711x_init_early,
-       .init_irq       = clps711x_init_irq,
-       .init_time      = clps711x_timer_init,
-       .handle_irq     = clps711x_handle_irq,
-       .restart        = clps711x_restart,
-MACHINE_END
index 856b81c..fb77d14 100644 (file)
@@ -57,7 +57,7 @@ static void __init clps711x_add_syscon(void)
        unsigned i;
 
        for (i = 0; i < ARRAY_SIZE(clps711x_syscon_res); i++)
-               platform_device_register_simple("clps711x-syscon", i + 1,
+               platform_device_register_simple("syscon", i + 1,
                                                &clps711x_syscon_res[i], 1);
 }
 
index 1332de8..c4bdc0a 100644 (file)
@@ -185,10 +185,6 @@ static __init void da830_evm_usb_init(void)
                           __func__, ret);
 }
 
-static struct davinci_uart_config da830_evm_uart_config __initdata = {
-       .enabled_uarts = 0x7,
-};
-
 static const short da830_evm_mcasp1_pins[] = {
        DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1, DA830_AHCLKR1, DA830_AFSR1,
        DA830_AMUTE1, DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_5,
@@ -630,7 +626,7 @@ static __init void da830_evm_init(void)
                pr_warning("da830_evm_init: watchdog registration failed: %d\n",
                                ret);
 
-       davinci_serial_init(&da830_evm_uart_config);
+       davinci_serial_init(da8xx_serial_device);
        i2c_register_board_info(1, da830_evm_i2c_devices,
                        ARRAY_SIZE(da830_evm_i2c_devices));
 
index 9f09f45..dd1fb24 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/i2c.h>
 #include <linux/i2c/at24.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/input.h>
 #include <linux/input/tps6507x-ts.h>
 #include <linux/mfd/tps6507x.h>
@@ -746,10 +746,6 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
        .bus_delay      = 0,    /* usec */
 };
 
-static struct davinci_uart_config da850_evm_uart_config __initdata = {
-       .enabled_uarts = 0x7,
-};
-
 /* davinci da850 evm audio machine driver */
 static u8 da850_iis_serializer_direction[] = {
        INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
@@ -1492,7 +1488,7 @@ static __init void da850_evm_init(void)
                                __func__, ret);
        }
 
-       davinci_serial_init(&da850_evm_uart_config);
+       davinci_serial_init(da8xx_serial_device);
 
        i2c_register_board_info(1, da850_evm_i2c_devices,
                        ARRAY_SIZE(da850_evm_i2c_devices));
index c2a0a67..42b23a3 100644 (file)
@@ -314,10 +314,6 @@ static struct platform_device *davinci_evm_devices[] __initdata = {
        &davinci_nand_device,
 };
 
-static struct davinci_uart_config uart_config __initdata = {
-       .enabled_uarts = (1 << 0),
-};
-
 static void __init dm355_evm_map_io(void)
 {
        dm355_init();
@@ -393,7 +389,7 @@ static __init void dm355_evm_init(void)
        platform_add_devices(davinci_evm_devices,
                             ARRAY_SIZE(davinci_evm_devices));
        evm_init_i2c();
-       davinci_serial_init(&uart_config);
+       davinci_serial_init(dm355_serial_device);
 
        /* NOTE:  NAND flash timings set by the UBL are slower than
         * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204
index 139e42d..65a984c 100644 (file)
@@ -173,10 +173,6 @@ static struct platform_device *davinci_leopard_devices[] __initdata = {
        &davinci_nand_device,
 };
 
-static struct davinci_uart_config uart_config __initdata = {
-       .enabled_uarts = (1 << 0),
-};
-
 static void __init dm355_leopard_map_io(void)
 {
        dm355_init();
@@ -252,7 +248,7 @@ static __init void dm355_leopard_init(void)
        platform_add_devices(davinci_leopard_devices,
                             ARRAY_SIZE(davinci_leopard_devices));
        leopard_init_i2c();
-       davinci_serial_init(&uart_config);
+       davinci_serial_init(dm355_serial_device);
 
        /* NOTE:  NAND flash timings set by the UBL are slower than
         * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204
index 4cdb61c..92b7f77 100644 (file)
@@ -718,10 +718,6 @@ fail:
        /* REVISIT export switches: NTSC/PAL (SW5.6), EXTRA1 (SW5.2), etc */
 }
 
-static struct davinci_uart_config uart_config __initdata = {
-       .enabled_uarts = (1 << 0),
-};
-
 static void __init dm365_evm_map_io(void)
 {
        dm365_init();
@@ -748,7 +744,7 @@ static struct spi_board_info dm365_evm_spi_info[] __initconst = {
 static __init void dm365_evm_init(void)
 {
        evm_init_i2c();
-       davinci_serial_init(&uart_config);
+       davinci_serial_init(dm365_serial_device);
 
        dm365evm_emac_configure();
        dm365evm_mmc_configure();
index fa4bfaf..40bb9b5 100644 (file)
@@ -727,10 +727,6 @@ static struct platform_device *davinci_evm_devices[] __initdata = {
        &rtc_dev,
 };
 
-static struct davinci_uart_config uart_config __initdata = {
-       .enabled_uarts = (1 << 0),
-};
-
 static void __init
 davinci_evm_map_io(void)
 {
@@ -792,7 +788,7 @@ static __init void davinci_evm_init(void)
        davinci_setup_mmc(0, &dm6446evm_mmc_config);
        dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg);
 
-       davinci_serial_init(&uart_config);
+       davinci_serial_init(dm644x_serial_device);
        dm644x_init_asp(&dm644x_evm_snd_data);
 
        /* irlml6401 switches over 1A, in under 8 msec */
index 0c005e8..2bc3651 100644 (file)
@@ -750,10 +750,6 @@ static void __init davinci_map_io(void)
        cdce_clk_init();
 }
 
-static struct davinci_uart_config uart_config __initdata = {
-       .enabled_uarts = (1 << 0),
-};
-
 #define DM646X_EVM_PHY_ID              "davinci_mdio-0:01"
 /*
  * The following EDMA channels/slots are not being used by drivers (for
@@ -793,7 +789,7 @@ static __init void evm_init(void)
        struct davinci_soc_info *soc_info = &davinci_soc_info;
 
        evm_init_i2c();
-       davinci_serial_init(&uart_config);
+       davinci_serial_init(dm646x_serial_device);
        dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
        dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
 
index 9549d53..cd0f587 100644 (file)
@@ -434,10 +434,6 @@ static void __init mityomapl138_setup_nand(void)
                                 ARRAY_SIZE(mityomapl138_devices));
 }
 
-static struct davinci_uart_config mityomapl138_uart_config __initdata = {
-       .enabled_uarts = 0x7,
-};
-
 static const short mityomap_mii_pins[] = {
        DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3,
        DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER,
@@ -517,7 +513,7 @@ static void __init mityomapl138_init(void)
        if (ret)
                pr_warning("watchdog registration failed: %d\n", ret);
 
-       davinci_serial_init(&mityomapl138_uart_config);
+       davinci_serial_init(da8xx_serial_device);
 
        ret = da8xx_register_i2c(0, &mityomap_i2c_0_pdata);
        if (ret)
index 808233b..46f336f 100644 (file)
@@ -154,10 +154,6 @@ static struct platform_device *davinci_ntosd2_devices[] __initdata = {
        &ntosd2_leds_dev,
 };
 
-static struct davinci_uart_config uart_config __initdata = {
-       .enabled_uarts = (1 << 0),
-};
-
 static void __init davinci_ntosd2_map_io(void)
 {
        dm644x_init();
@@ -198,7 +194,7 @@ static __init void davinci_ntosd2_init(void)
        platform_add_devices(davinci_ntosd2_devices,
                                ARRAY_SIZE(davinci_ntosd2_devices));
 
-       davinci_serial_init(&uart_config);
+       davinci_serial_init(dm644x_serial_device);
        dm644x_init_asp(&dm644x_ntosd2_snd_data);
 
        soc_info->emac_pdata->phy_id = NEUROS_OSD2_PHY_ID;
index b8c20de..ab98c75 100644 (file)
@@ -286,15 +286,11 @@ usb11_setup_oc_fail:
        gpio_free(DA850_USB1_VBUS_PIN);
 }
 
-static struct davinci_uart_config omapl138_hawk_uart_config __initdata = {
-       .enabled_uarts = 0x7,
-};
-
 static __init void omapl138_hawk_init(void)
 {
        int ret;
 
-       davinci_serial_init(&omapl138_hawk_uart_config);
+       davinci_serial_init(da8xx_serial_device);
 
        omapl138_hawk_config_emac();
 
index 513eee1..d843601 100644 (file)
@@ -125,10 +125,6 @@ static struct platform_device *davinci_sffsdr_devices[] __initdata = {
        &davinci_sffsdr_nandflash_device,
 };
 
-static struct davinci_uart_config uart_config __initdata = {
-       .enabled_uarts = (1 << 0),
-};
-
 static void __init davinci_sffsdr_map_io(void)
 {
        dm644x_init();
@@ -141,7 +137,7 @@ static __init void davinci_sffsdr_init(void)
        platform_add_devices(davinci_sffsdr_devices,
                             ARRAY_SIZE(davinci_sffsdr_devices));
        sffsdr_init_i2c();
-       davinci_serial_init(&uart_config);
+       davinci_serial_init(dm644x_serial_device);
        soc_info->emac_pdata->phy_id = SFFSDR_PHY_ID;
        davinci_setup_usb(0, 0); /* We support only peripheral mode. */
 
index abbaf02..d6c746e 100644 (file)
@@ -395,9 +395,9 @@ static struct clk_lookup da830_clks[] = {
        CLK(NULL,               "tptc0",        &tptc0_clk),
        CLK(NULL,               "tptc1",        &tptc1_clk),
        CLK("da830-mmc.0",      NULL,           &mmcsd_clk),
-       CLK(NULL,               "uart0",        &uart0_clk),
-       CLK(NULL,               "uart1",        &uart1_clk),
-       CLK(NULL,               "uart2",        &uart2_clk),
+       CLK("serial8250.0",     NULL,           &uart0_clk),
+       CLK("serial8250.1",     NULL,           &uart1_clk),
+       CLK("serial8250.2",     NULL,           &uart2_clk),
        CLK("spi_davinci.0",    NULL,           &spi0_clk),
        CLK("spi_davinci.1",    NULL,           &spi1_clk),
        CLK(NULL,               "ecap0",        &ecap0_clk),
@@ -417,6 +417,7 @@ static struct clk_lookup da830_clks[] = {
        CLK(NULL,               "aintc",        &aintc_clk),
        CLK(NULL,               "secu_mgr",     &secu_mgr_clk),
        CLK("davinci_emac.1",   NULL,           &emac_clk),
+       CLK("davinci_mdio.0",   "fck",          &emac_clk),
        CLK(NULL,               "gpio",         &gpio_clk),
        CLK("i2c_davinci.2",    NULL,           &i2c1_clk),
        CLK(NULL,               "usb11",        &usb11_clk),
@@ -1199,7 +1200,6 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
        .gpio_base              = DA8XX_GPIO_BASE,
        .gpio_num               = 128,
        .gpio_irq               = IRQ_DA8XX_GPIO0,
-       .serial_dev             = &da8xx_serial_device,
        .emac_pdata             = &da8xx_emac_pdata,
 };
 
index a0d4f60..f56e5fb 100644 (file)
@@ -451,9 +451,9 @@ static struct clk_lookup da850_clks[] = {
        CLK(NULL,               "tpcc1",        &tpcc1_clk),
        CLK(NULL,               "tptc2",        &tptc2_clk),
        CLK("pruss_uio",        "pruss",        &pruss_clk),
-       CLK(NULL,               "uart0",        &uart0_clk),
-       CLK(NULL,               "uart1",        &uart1_clk),
-       CLK(NULL,               "uart2",        &uart2_clk),
+       CLK("serial8250.0",     NULL,           &uart0_clk),
+       CLK("serial8250.1",     NULL,           &uart1_clk),
+       CLK("serial8250.2",     NULL,           &uart2_clk),
        CLK(NULL,               "aintc",        &aintc_clk),
        CLK(NULL,               "gpio",         &gpio_clk),
        CLK("i2c_davinci.2",    NULL,           &i2c1_clk),
@@ -461,6 +461,7 @@ static struct clk_lookup da850_clks[] = {
        CLK(NULL,               "arm",          &arm_clk),
        CLK(NULL,               "rmii",         &rmii_clk),
        CLK("davinci_emac.1",   NULL,           &emac_clk),
+       CLK("davinci_mdio.0",   "fck",          &emac_clk),
        CLK("davinci-mcasp.0",  NULL,           &mcasp_clk),
        CLK("da8xx_lcdc.0",     "fck",          &lcdc_clk),
        CLK("da830-mmc.0",      NULL,           &mmcsd0_clk),
@@ -1301,7 +1302,6 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
        .gpio_base              = DA8XX_GPIO_BASE,
        .gpio_num               = 144,
        .gpio_irq               = IRQ_DA8XX_GPIO0,
-       .serial_dev             = &da8xx_serial_device,
        .emac_pdata             = &da8xx_emac_pdata,
        .sram_dma               = DA8XX_SHARED_RAM_BASE,
        .sram_len               = SZ_128K,
index 961aea8..d2bc574 100644 (file)
 
 #define DA8XX_NUM_UARTS        3
 
-static void __init da8xx_uart_clk_enable(void)
-{
-       int i;
-       for (i = 0; i < DA8XX_NUM_UARTS; i++)
-               davinci_serial_setup_clk(i, NULL);
-}
-
 static struct of_device_id da8xx_irq_match[] __initdata = {
        { .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
        { }
@@ -47,6 +40,12 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
        OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
        OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL),
+       OF_DEV_AUXDATA("ns16550a", 0x01c42000, "serial8250.0", NULL),
+       OF_DEV_AUXDATA("ns16550a", 0x01d0c000, "serial8250.1", NULL),
+       OF_DEV_AUXDATA("ns16550a", 0x01d0d000, "serial8250.2", NULL),
+       OF_DEV_AUXDATA("ti,davinci_mdio", 0x01e24000, "davinci_mdio.0", NULL),
+       OF_DEV_AUXDATA("ti,davinci-dm6467-emac", 0x01e20000, "davinci_emac.1",
+                      NULL),
        {}
 };
 
@@ -57,7 +56,6 @@ static void __init da850_init_machine(void)
        of_platform_populate(NULL, of_default_bus_match_table,
                             da850_auxdata_lookup, NULL);
 
-       da8xx_uart_clk_enable();
 }
 
 static const char *da850_boards_compat[] __initdata = {
index a883043..2ab5d57 100644 (file)
@@ -106,4 +106,9 @@ int dm646x_init_edma(struct edma_rsv_info *rsv);
 void dm646x_video_init(void);
 void dm646x_setup_vpif(struct vpif_display_config *,
                       struct vpif_capture_config *);
+
+extern struct platform_device dm365_serial_device[];
+extern struct platform_device dm355_serial_device[];
+extern struct platform_device dm644x_serial_device[];
+extern struct platform_device dm646x_serial_device[];
 #endif /*__DAVINCI_H */
index 71a46a3..2e473fe 100644 (file)
@@ -68,7 +68,7 @@
 void __iomem *da8xx_syscfg0_base;
 void __iomem *da8xx_syscfg1_base;
 
-static struct plat_serial8250_port da8xx_serial_pdata[] = {
+static struct plat_serial8250_port da8xx_serial0_pdata[] = {
        {
                .mapbase        = DA8XX_UART0_BASE,
                .irq            = IRQ_DA8XX_UARTINT0,
@@ -78,6 +78,11 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port da8xx_serial1_pdata[] = {
+       {
                .mapbase        = DA8XX_UART1_BASE,
                .irq            = IRQ_DA8XX_UARTINT1,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -86,6 +91,11 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port da8xx_serial2_pdata[] = {
+       {
                .mapbase        = DA8XX_UART2_BASE,
                .irq            = IRQ_DA8XX_UARTINT2,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -95,15 +105,33 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
        },
        {
                .flags  = 0,
-       },
+       }
 };
 
-struct platform_device da8xx_serial_device = {
-       .name   = "serial8250",
-       .id     = PLAT8250_DEV_PLATFORM,
-       .dev    = {
-               .platform_data  = da8xx_serial_pdata,
+struct platform_device da8xx_serial_device[] = {
+       {
+               .name   = "serial8250",
+               .id     = PLAT8250_DEV_PLATFORM,
+               .dev    = {
+                       .platform_data  = da8xx_serial0_pdata,
+               }
+       },
+       {
+               .name   = "serial8250",
+               .id     = PLAT8250_DEV_PLATFORM1,
+               .dev    = {
+                       .platform_data  = da8xx_serial1_pdata,
+               }
+       },
+       {
+               .name   = "serial8250",
+               .id     = PLAT8250_DEV_PLATFORM2,
+               .dev    = {
+                       .platform_data  = da8xx_serial2_pdata,
+               }
        },
+       {
+       }
 };
 
 static s8 da8xx_queue_tc_mapping[][2] = {
@@ -453,12 +481,8 @@ int __init da8xx_register_emac(void)
        ret = platform_device_register(&da8xx_mdio_device);
        if (ret < 0)
                return ret;
-       ret = platform_device_register(&da8xx_emac_device);
-       if (ret < 0)
-               return ret;
-       ret = clk_add_alias(NULL, dev_name(&da8xx_mdio_device.dev),
-                           NULL, &da8xx_emac_device.dev);
-       return ret;
+
+       return platform_device_register(&da8xx_emac_device);
 }
 
 static struct resource da830_mcasp1_resources[] = {
@@ -828,14 +852,7 @@ static struct platform_device da8xx_rtc_device = {
 
 int da8xx_register_rtc(void)
 {
-       int ret;
-
-       ret = platform_device_register(&da8xx_rtc_device);
-       if (!ret)
-               /* Atleast on DA850, RTC is a wakeup source */
-               device_init_wakeup(&da8xx_rtc_device.dev, true);
-
-       return ret;
+       return platform_device_register(&da8xx_rtc_device);
 }
 
 static void __iomem *da8xx_ddr2_ctlr_base;
index 128cb9a..01d8686 100644 (file)
@@ -126,7 +126,7 @@ static struct platform_device edma_device = {
        .dev.platform_data = tnetv107x_edma_info,
 };
 
-static struct plat_serial8250_port serial_data[] = {
+static struct plat_serial8250_port serial0_platform_data[] = {
        {
                .mapbase        = TNETV107X_UART0_BASE,
                .irq            = IRQ_TNETV107X_UART0,
@@ -137,6 +137,11 @@ static struct plat_serial8250_port serial_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port serial1_platform_data[] = {
+       {
                .mapbase        = TNETV107X_UART1_BASE,
                .irq            = IRQ_TNETV107X_UART1,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -146,6 +151,11 @@ static struct plat_serial8250_port serial_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port serial2_platform_data[] = {
+       {
                .mapbase        = TNETV107X_UART2_BASE,
                .irq            = IRQ_TNETV107X_UART2,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -156,13 +166,28 @@ static struct plat_serial8250_port serial_data[] = {
        },
        {
                .flags  = 0,
-       },
+       }
 };
 
-struct platform_device tnetv107x_serial_device = {
-       .name                   = "serial8250",
-       .id                     = PLAT8250_DEV_PLATFORM,
-       .dev.platform_data      = serial_data,
+
+struct platform_device tnetv107x_serial_device[] = {
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM,
+               .dev.platform_data      = serial0_platform_data,
+       },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM1,
+               .dev.platform_data      = serial1_platform_data,
+       },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM2,
+               .dev.platform_data      = serial2_platform_data,
+       },
+       {
+       }
 };
 
 static struct resource mmc0_resources[] = {
@@ -385,7 +410,7 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
        platform_device_register(&tsc_device);
 
        if (info->serial_config)
-               davinci_serial_init(info->serial_config);
+               davinci_serial_init(tnetv107x_serial_device);
 
        for (i = 0; i < 2; i++)
                if (info->mmc_config[i]) {
index 86100d1..3eaa5f6 100644 (file)
@@ -357,9 +357,9 @@ static struct clk_lookup dm355_clks[] = {
        CLK(NULL, "clkout3", &clkout3_clk),
        CLK(NULL, "arm", &arm_clk),
        CLK(NULL, "mjcp", &mjcp_clk),
-       CLK(NULL, "uart0", &uart0_clk),
-       CLK(NULL, "uart1", &uart1_clk),
-       CLK(NULL, "uart2", &uart2_clk),
+       CLK("serial8250.0", NULL, &uart0_clk),
+       CLK("serial8250.1", NULL, &uart1_clk),
+       CLK("serial8250.2", NULL, &uart2_clk),
        CLK("i2c_davinci.1", NULL, &i2c_clk),
        CLK("davinci-mcbsp.0", NULL, &asp0_clk),
        CLK("davinci-mcbsp.1", NULL, &asp1_clk),
@@ -922,7 +922,7 @@ static struct davinci_timer_info dm355_timer_info = {
        .clocksource_id = T0_TOP,
 };
 
-static struct plat_serial8250_port dm355_serial_platform_data[] = {
+static struct plat_serial8250_port dm355_serial0_platform_data[] = {
        {
                .mapbase        = DAVINCI_UART0_BASE,
                .irq            = IRQ_UARTINT0,
@@ -932,6 +932,11 @@ static struct plat_serial8250_port dm355_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port dm355_serial1_platform_data[] = {
+       {
                .mapbase        = DAVINCI_UART1_BASE,
                .irq            = IRQ_UARTINT1,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -940,6 +945,11 @@ static struct plat_serial8250_port dm355_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port dm355_serial2_platform_data[] = {
+       {
                .mapbase        = DM355_UART2_BASE,
                .irq            = IRQ_DM355_UARTINT2,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -948,16 +958,34 @@ static struct plat_serial8250_port dm355_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
-               .flags          = 0
-       },
+               .flags  = 0,
+       }
 };
 
-static struct platform_device dm355_serial_device = {
-       .name                   = "serial8250",
-       .id                     = PLAT8250_DEV_PLATFORM,
-       .dev                    = {
-               .platform_data  = dm355_serial_platform_data,
+struct platform_device dm355_serial_device[] = {
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM,
+               .dev                    = {
+                       .platform_data  = dm355_serial0_platform_data,
+               }
+       },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM1,
+               .dev                    = {
+                       .platform_data  = dm355_serial1_platform_data,
+               }
        },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM2,
+               .dev                    = {
+                       .platform_data  = dm355_serial2_platform_data,
+               }
+       },
+       {
+       }
 };
 
 static struct davinci_soc_info davinci_soc_info_dm355 = {
@@ -981,7 +1009,6 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
        .gpio_base              = DAVINCI_GPIO_BASE,
        .gpio_num               = 104,
        .gpio_irq               = IRQ_DM355_GPIOBNK0,
-       .serial_dev             = &dm355_serial_device,
        .sram_dma               = 0x00010000,
        .sram_len               = SZ_32K,
 };
index dad2802..c29e324 100644 (file)
@@ -455,8 +455,8 @@ static struct clk_lookup dm365_clks[] = {
        CLK("vpss", "master", &vpss_master_clk),
        CLK("vpss", "slave", &vpss_slave_clk),
        CLK(NULL, "arm", &arm_clk),
-       CLK(NULL, "uart0", &uart0_clk),
-       CLK(NULL, "uart1", &uart1_clk),
+       CLK("serial8250.0", NULL, &uart0_clk),
+       CLK("serial8250.1", NULL, &uart1_clk),
        CLK("i2c_davinci.1", NULL, &i2c_clk),
        CLK("da830-mmc.0", NULL, &mmcsd0_clk),
        CLK("da830-mmc.1", NULL, &mmcsd1_clk),
@@ -477,6 +477,7 @@ static struct clk_lookup dm365_clks[] = {
        CLK(NULL, "timer3", &timer3_clk),
        CLK(NULL, "usb", &usb_clk),
        CLK("davinci_emac.1", NULL, &emac_clk),
+       CLK("davinci_mdio.0", "fck", &emac_clk),
        CLK("davinci_voicecodec", NULL, &voicecodec_clk),
        CLK("davinci-mcbsp", NULL, &asp0_clk),
        CLK(NULL, "rto", &rto_clk),
@@ -1041,7 +1042,7 @@ static struct davinci_timer_info dm365_timer_info = {
 
 #define DM365_UART1_BASE       (IO_PHYS + 0x106000)
 
-static struct plat_serial8250_port dm365_serial_platform_data[] = {
+static struct plat_serial8250_port dm365_serial0_platform_data[] = {
        {
                .mapbase        = DAVINCI_UART0_BASE,
                .irq            = IRQ_UARTINT0,
@@ -1051,6 +1052,11 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port dm365_serial1_platform_data[] = {
+       {
                .mapbase        = DM365_UART1_BASE,
                .irq            = IRQ_UARTINT1,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -1059,16 +1065,27 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
-               .flags          = 0
-       },
+               .flags  = 0,
+       }
 };
 
-static struct platform_device dm365_serial_device = {
-       .name                   = "serial8250",
-       .id                     = PLAT8250_DEV_PLATFORM,
-       .dev                    = {
-               .platform_data  = dm365_serial_platform_data,
+struct platform_device dm365_serial_device[] = {
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM,
+               .dev                    = {
+                       .platform_data  = dm365_serial0_platform_data,
+               }
+       },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM1,
+               .dev                    = {
+                       .platform_data  = dm365_serial1_platform_data,
+               }
        },
+       {
+       }
 };
 
 static struct davinci_soc_info davinci_soc_info_dm365 = {
@@ -1093,7 +1110,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
        .gpio_num               = 104,
        .gpio_irq               = IRQ_DM365_GPIO0,
        .gpio_unbanked          = 8,    /* really 16 ... skip muxed GPIOs */
-       .serial_dev             = &dm365_serial_device,
        .emac_pdata             = &dm365_emac_pdata,
        .sram_dma               = 0x00010000,
        .sram_len               = SZ_32K,
@@ -1407,8 +1423,6 @@ static int __init dm365_init_devices(void)
 
        platform_device_register(&dm365_mdio_device);
        platform_device_register(&dm365_emac_device);
-       clk_add_alias(NULL, dev_name(&dm365_mdio_device.dev),
-                     NULL, &dm365_emac_device.dev);
 
        return 0;
 }
index a49d182..4f74682 100644 (file)
@@ -303,10 +303,11 @@ static struct clk_lookup dm644x_clks[] = {
        CLK("vpss", "master", &vpss_master_clk),
        CLK("vpss", "slave", &vpss_slave_clk),
        CLK(NULL, "arm", &arm_clk),
-       CLK(NULL, "uart0", &uart0_clk),
-       CLK(NULL, "uart1", &uart1_clk),
-       CLK(NULL, "uart2", &uart2_clk),
+       CLK("serial8250.0", NULL, &uart0_clk),
+       CLK("serial8250.1", NULL, &uart1_clk),
+       CLK("serial8250.2", NULL, &uart2_clk),
        CLK("davinci_emac.1", NULL, &emac_clk),
+       CLK("davinci_mdio.0", "fck", &emac_clk),
        CLK("i2c_davinci.1", NULL, &i2c_clk),
        CLK("palm_bk3710", NULL, &ide_clk),
        CLK("davinci-mcbsp", NULL, &asp_clk),
@@ -813,7 +814,7 @@ static struct davinci_timer_info dm644x_timer_info = {
        .clocksource_id = T0_TOP,
 };
 
-static struct plat_serial8250_port dm644x_serial_platform_data[] = {
+static struct plat_serial8250_port dm644x_serial0_platform_data[] = {
        {
                .mapbase        = DAVINCI_UART0_BASE,
                .irq            = IRQ_UARTINT0,
@@ -823,6 +824,11 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port dm644x_serial1_platform_data[] = {
+       {
                .mapbase        = DAVINCI_UART1_BASE,
                .irq            = IRQ_UARTINT1,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -831,6 +837,11 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port dm644x_serial2_platform_data[] = {
+       {
                .mapbase        = DAVINCI_UART2_BASE,
                .irq            = IRQ_UARTINT2,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -839,16 +850,34 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
-               .flags          = 0
-       },
+               .flags  = 0,
+       }
 };
 
-static struct platform_device dm644x_serial_device = {
-       .name                   = "serial8250",
-       .id                     = PLAT8250_DEV_PLATFORM,
-       .dev                    = {
-               .platform_data  = dm644x_serial_platform_data,
+struct platform_device dm644x_serial_device[] = {
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM,
+               .dev                    = {
+                       .platform_data  = dm644x_serial0_platform_data,
+               }
        },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM1,
+               .dev                    = {
+                       .platform_data  = dm644x_serial1_platform_data,
+               }
+       },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM2,
+               .dev                    = {
+                       .platform_data  = dm644x_serial2_platform_data,
+               }
+       },
+       {
+       }
 };
 
 static struct davinci_soc_info davinci_soc_info_dm644x = {
@@ -872,7 +901,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
        .gpio_base              = DAVINCI_GPIO_BASE,
        .gpio_num               = 71,
        .gpio_irq               = IRQ_GPIOBNK0,
-       .serial_dev             = &dm644x_serial_device,
        .emac_pdata             = &dm644x_emac_pdata,
        .sram_dma               = 0x00008000,
        .sram_len               = SZ_16K,
@@ -923,8 +951,6 @@ static int __init dm644x_init_devices(void)
 
        platform_device_register(&dm644x_mdio_device);
        platform_device_register(&dm644x_emac_device);
-       clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev),
-                     NULL, &dm644x_emac_device.dev);
 
        return 0;
 }
index d1259e8..68f8d1f 100644 (file)
@@ -342,15 +342,16 @@ static struct clk_lookup dm646x_clks[] = {
        CLK(NULL, "edma_tc1", &edma_tc1_clk),
        CLK(NULL, "edma_tc2", &edma_tc2_clk),
        CLK(NULL, "edma_tc3", &edma_tc3_clk),
-       CLK(NULL, "uart0", &uart0_clk),
-       CLK(NULL, "uart1", &uart1_clk),
-       CLK(NULL, "uart2", &uart2_clk),
+       CLK("serial8250.0", NULL, &uart0_clk),
+       CLK("serial8250.1", NULL, &uart1_clk),
+       CLK("serial8250.2", NULL, &uart2_clk),
        CLK("i2c_davinci.1", NULL, &i2c_clk),
        CLK(NULL, "gpio", &gpio_clk),
        CLK("davinci-mcasp.0", NULL, &mcasp0_clk),
        CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
        CLK(NULL, "aemif", &aemif_clk),
        CLK("davinci_emac.1", NULL, &emac_clk),
+       CLK("davinci_mdio.0", "fck", &emac_clk),
        CLK(NULL, "pwm0", &pwm0_clk),
        CLK(NULL, "pwm1", &pwm1_clk),
        CLK(NULL, "timer0", &timer0_clk),
@@ -790,7 +791,7 @@ static struct davinci_timer_info dm646x_timer_info = {
        .clocksource_id = T0_TOP,
 };
 
-static struct plat_serial8250_port dm646x_serial_platform_data[] = {
+static struct plat_serial8250_port dm646x_serial0_platform_data[] = {
        {
                .mapbase        = DAVINCI_UART0_BASE,
                .irq            = IRQ_UARTINT0,
@@ -800,6 +801,11 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port dm646x_serial1_platform_data[] = {
+       {
                .mapbase        = DAVINCI_UART1_BASE,
                .irq            = IRQ_UARTINT1,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -808,6 +814,11 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
+               .flags  = 0,
+       }
+};
+static struct plat_serial8250_port dm646x_serial2_platform_data[] = {
+       {
                .mapbase        = DAVINCI_UART2_BASE,
                .irq            = IRQ_DM646X_UARTINT2,
                .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -816,16 +827,34 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = {
                .regshift       = 2,
        },
        {
-               .flags          = 0
-       },
+               .flags  = 0,
+       }
 };
 
-static struct platform_device dm646x_serial_device = {
-       .name                   = "serial8250",
-       .id                     = PLAT8250_DEV_PLATFORM,
-       .dev                    = {
-               .platform_data  = dm646x_serial_platform_data,
+struct platform_device dm646x_serial_device[] = {
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM,
+               .dev                    = {
+                       .platform_data  = dm646x_serial0_platform_data,
+               }
+       },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM1,
+               .dev                    = {
+                       .platform_data  = dm646x_serial1_platform_data,
+               }
        },
+       {
+               .name                   = "serial8250",
+               .id                     = PLAT8250_DEV_PLATFORM2,
+               .dev                    = {
+                       .platform_data  = dm646x_serial2_platform_data,
+               }
+       },
+       {
+       }
 };
 
 static struct davinci_soc_info davinci_soc_info_dm646x = {
@@ -849,7 +878,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
        .gpio_base              = DAVINCI_GPIO_BASE,
        .gpio_num               = 43, /* Only 33 usable */
        .gpio_irq               = IRQ_DM646X_GPIOBNK0,
-       .serial_dev             = &dm646x_serial_device,
        .emac_pdata             = &dm646x_emac_pdata,
        .sram_dma               = 0x10010000,
        .sram_len               = SZ_32K,
@@ -913,8 +941,6 @@ static int __init dm646x_init_devices(void)
 
        platform_device_register(&dm646x_mdio_device);
        platform_device_register(&dm646x_emac_device);
-       clk_add_alias(NULL, dev_name(&dm646x_mdio_device.dev),
-                     NULL, &dm646x_emac_device.dev);
 
        return 0;
 }
index cce316b..0b3c169 100644 (file)
@@ -72,7 +72,6 @@ struct davinci_soc_info {
        unsigned                        gpio_unbanked;
        struct davinci_gpio_controller  *gpio_ctlrs;
        int                             gpio_ctlrs_num;
-       struct platform_device          *serial_dev;
        struct emac_platform_data       *emac_pdata;
        dma_addr_t                      sram_dma;
        unsigned                        sram_len;
index 7b41a5e..aae5307 100644 (file)
@@ -111,7 +111,7 @@ void da8xx_restart(enum reboot_mode mode, const char *cmd);
 void da8xx_rproc_reserve_cma(void);
 int da8xx_register_rproc(void);
 
-extern struct platform_device da8xx_serial_device;
+extern struct platform_device da8xx_serial_device[];
 extern struct emac_platform_data da8xx_emac_pdata;
 extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
 extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
index 62ad300..52b8571 100644 (file)
@@ -15,6 +15,8 @@
 
 #include <mach/hardware.h>
 
+#include <linux/platform_device.h>
+
 #define DAVINCI_UART0_BASE     (IO_PHYS + 0x20000)
 #define DAVINCI_UART1_BASE     (IO_PHYS + 0x20400)
 #define DAVINCI_UART2_BASE     (IO_PHYS + 0x20800)
 #define UART_DM646X_SCR_TX_WATERMARK   0x08
 
 #ifndef __ASSEMBLY__
-struct davinci_uart_config {
-       /* Bit field of UARTs present; bit 0 --> UART0 */
-       unsigned int enabled_uarts;
-};
-
-extern int davinci_serial_init(struct davinci_uart_config *);
-extern int davinci_serial_setup_clk(unsigned instance, unsigned int *rate);
+extern int davinci_serial_init(struct platform_device *);
 #endif
 
 #endif /* __ASM_ARCH_SERIAL_H */
index 16314c6..494fcf5 100644 (file)
@@ -42,7 +42,6 @@
 #include <mach/serial.h>
 
 struct tnetv107x_device_info {
-       struct davinci_uart_config      *serial_config;
        struct davinci_mmc_config       *mmc_config[2];  /* 2 controllers */
        struct davinci_nand_pdata       *nand_config[4]; /* 4 chipsels */
        struct matrix_keypad_platform_data *keypad_config;
@@ -50,7 +49,7 @@ struct tnetv107x_device_info {
 };
 
 extern struct platform_device tnetv107x_wdt_device;
-extern struct platform_device tnetv107x_serial_device;
+extern struct platform_device tnetv107x_serial_device[];
 
 extern void tnetv107x_init(void);
 extern void tnetv107x_devices_init(struct tnetv107x_device_info *);
index f262581..5e93a73 100644 (file)
@@ -70,49 +70,36 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
                                 UART_DM646X_SCR_TX_WATERMARK);
 }
 
-/* Enable UART clock and obtain its rate */
-int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate)
+int __init davinci_serial_init(struct platform_device *serial_dev)
 {
-       char name[16];
+       int i, ret = 0;
+       struct device *dev;
+       struct plat_serial8250_port *p;
        struct clk *clk;
-       struct davinci_soc_info *soc_info = &davinci_soc_info;
-       struct device *dev = &soc_info->serial_dev->dev;
-
-       sprintf(name, "uart%d", instance);
-       clk = clk_get(dev, name);
-       if (IS_ERR(clk)) {
-               pr_err("%s:%d: failed to get UART%d clock\n",
-                                       __func__, __LINE__, instance);
-               return PTR_ERR(clk);
-       }
-
-       clk_prepare_enable(clk);
-
-       if (rate)
-               *rate = clk_get_rate(clk);
-
-       return 0;
-}
-
-int __init davinci_serial_init(struct davinci_uart_config *info)
-{
-       int i, ret;
-       struct davinci_soc_info *soc_info = &davinci_soc_info;
-       struct device *dev = &soc_info->serial_dev->dev;
-       struct plat_serial8250_port *p = dev->platform_data;
 
        /*
         * Make sure the serial ports are muxed on at this point.
         * You have to mux them off in device drivers later on if not needed.
         */
-       for (i = 0; p->flags; i++, p++) {
-               if (!(info->enabled_uarts & (1 << i)))
-                       continue;
+       for (i = 0; serial_dev[i].dev.platform_data != NULL; i++) {
+               dev = &serial_dev[i].dev;
+               p = dev->platform_data;
 
-               ret = davinci_serial_setup_clk(i, &p->uartclk);
+               ret = platform_device_register(&serial_dev[i]);
                if (ret)
                        continue;
 
+               clk = clk_get(dev, NULL);
+               if (IS_ERR(clk)) {
+                       pr_err("%s:%d: failed to get UART%d clock\n",
+                              __func__, __LINE__, i);
+                       continue;
+               }
+
+               clk_prepare_enable(clk);
+
+               p->uartclk = clk_get_rate(clk);
+
                if (!p->membase && p->mapbase) {
                        p->membase = ioremap(p->mapbase, SZ_4K);
 
@@ -125,6 +112,5 @@ int __init davinci_serial_init(struct davinci_uart_config *info)
                if (p->membase && p->type != PORT_AR7)
                        davinci_serial_reset(p);
        }
-
-       return platform_device_register(soc_info->serial_dev);
+       return ret;
 }
index 4545667..f4d7fbb 100644 (file)
@@ -264,7 +264,7 @@ static struct clk_lookup clks[] = {
        CLK(NULL,               "clk_chipcfg",          &clk_chipcfg),
        CLK("tnetv107x-ts.0",   NULL,                   &clk_tsc),
        CLK(NULL,               "clk_rom",              &clk_rom),
-       CLK(NULL,               "uart2",                &clk_uart2),
+       CLK("serial8250.2",     NULL,                   &clk_uart2),
        CLK(NULL,               "clk_pktsec",           &clk_pktsec),
        CLK("tnetv107x-rng.0",  NULL,                   &clk_rng),
        CLK("tnetv107x-pka.0",  NULL,                   &clk_pka),
@@ -274,8 +274,8 @@ static struct clk_lookup clks[] = {
        CLK(NULL,               "clk_gpio",             &clk_gpio),
        CLK(NULL,               "clk_mdio",             &clk_mdio),
        CLK("dm6441-mmc.0",     NULL,                   &clk_sdio0),
-       CLK(NULL,               "uart0",                &clk_uart0),
-       CLK(NULL,               "uart1",                &clk_uart1),
+       CLK("serial8250.0",     NULL,                   &clk_uart0),
+       CLK("serial8250.1",     NULL,                   &clk_uart1),
        CLK(NULL,               "timer0",               &clk_timer0),
        CLK(NULL,               "timer1",               &clk_timer1),
        CLK("tnetv107x_wdt.0",  NULL,                   &clk_wdt_arm),
@@ -757,7 +757,7 @@ static struct davinci_soc_info tnetv107x_soc_info = {
        .gpio_type              = GPIO_TYPE_TNETV107X,
        .gpio_num               = TNETV107X_N_GPIO,
        .timer_info             = &timer_info,
-       .serial_dev             = &tnetv107x_serial_device,
+       .serial_dev             = tnetv107x_serial_device,
 };
 
 void __init tnetv107x_init(void)
index dff7b2f..0bc7cdf 100644 (file)
@@ -23,6 +23,8 @@ config MACH_CM_A510
 config MACH_DOVE_DT
        bool "Marvell Dove Flattened Device Tree"
        select DOVE_CLK
+       select ORION_IRQCHIP
+       select ORION_TIMER
        select REGULATOR
        select REGULATOR_FIXED_VOLTAGE
        select USE_OF
index 4d9d2ff..cbc5c06 100644 (file)
@@ -1,5 +1,5 @@
-obj-y                          += common.o irq.o
-obj-$(CONFIG_DOVE_LEGACY)      += mpp.o
+obj-y                          += common.o
+obj-$(CONFIG_DOVE_LEGACY)      += irq.o mpp.o
 obj-$(CONFIG_PCI)              += pcie.o
 obj-$(CONFIG_MACH_DOVE_DB)     += dove-db-setup.o
 obj-$(CONFIG_MACH_DOVE_DT)     += board-dt.o
index f3755ac..49f72a8 100644 (file)
 
 #include <linux/init.h>
 #include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+#include <linux/irqchip.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/platform_data/usb-ehci-orion.h>
 #include <asm/hardware/cache-tauros2.h>
 #include <asm/mach/arch.h>
+#include <mach/dove.h>
 #include <mach/pm.h>
 #include <plat/common.h>
 #include <plat/irq.h>
@@ -33,10 +36,6 @@ static void __init dove_legacy_clk_init(void)
        clkspec.np = np;
        clkspec.args_count = 1;
 
-       clkspec.args[0] = CLOCK_GATING_BIT_GBE;
-       orion_clkdev_add(NULL, "mv643xx_eth_port.0",
-                        of_clk_get_from_provider(&clkspec));
-
        clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
        orion_clkdev_add("0", "pcie",
                         of_clk_get_from_provider(&clkspec));
@@ -46,15 +45,18 @@ static void __init dove_legacy_clk_init(void)
                         of_clk_get_from_provider(&clkspec));
 }
 
-static void __init dove_of_clk_init(void)
+static void __init dove_dt_time_init(void)
 {
        of_clk_init(NULL);
-       dove_legacy_clk_init();
+       clocksource_of_init();
 }
 
-static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
-       .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
-};
+static void __init dove_dt_init_early(void)
+{
+       mvebu_mbus_init("marvell,dove-mbus",
+                       BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
+                       DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ);
+}
 
 static void __init dove_dt_init(void)
 {
@@ -65,11 +67,10 @@ static void __init dove_dt_init(void)
 #endif
        dove_setup_cpu_wins();
 
-       /* Setup root of clk tree */
-       dove_of_clk_init();
+       /* Setup clocks for legacy devices */
+       dove_legacy_clk_init();
 
        /* Internal devices not ported to DT yet */
-       dove_ge00_init(&dove_dt_ge00_data);
        dove_pcie_init(1, 1);
 
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
@@ -82,9 +83,8 @@ static const char * const dove_dt_board_compat[] = {
 
 DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
        .map_io         = dove_map_io,
-       .init_early     = dove_init_early,
-       .init_irq       = orion_dt_init_irq,
-       .init_time      = dove_timer_init,
+       .init_early     = dove_dt_init_early,
+       .init_time      = dove_dt_time_init,
        .init_machine   = dove_dt_init,
        .restart        = dove_restart,
        .dt_compat      = dove_dt_board_compat,
index 304f069..c122bcf 100644 (file)
 #include <plat/time.h>
 #include "common.h"
 
+/* These can go away once Dove uses the mvebu-mbus DT binding */
+#define DOVE_MBUS_PCIE0_MEM_TARGET    0x4
+#define DOVE_MBUS_PCIE0_MEM_ATTR      0xe8
+#define DOVE_MBUS_PCIE0_IO_TARGET     0x4
+#define DOVE_MBUS_PCIE0_IO_ATTR       0xe0
+#define DOVE_MBUS_PCIE1_MEM_TARGET    0x8
+#define DOVE_MBUS_PCIE1_MEM_ATTR      0xe8
+#define DOVE_MBUS_PCIE1_IO_TARGET     0x8
+#define DOVE_MBUS_PCIE1_IO_ATTR       0xe0
+#define DOVE_MBUS_CESA_TARGET         0x3
+#define DOVE_MBUS_CESA_ATTR           0x1
+#define DOVE_MBUS_BOOTROM_TARGET      0x1
+#define DOVE_MBUS_BOOTROM_ATTR        0xfd
+#define DOVE_MBUS_SCRATCHPAD_TARGET   0xd
+#define DOVE_MBUS_SCRATCHPAD_ATTR     0x0
+
 /*****************************************************************************
  * I/O Address Mapping
  ****************************************************************************/
@@ -332,34 +348,40 @@ void __init dove_setup_cpu_wins(void)
 {
        /*
         * The PCIe windows will no longer be statically allocated
-        * here once Dove is migrated to the pci-mvebu driver.
+        * here once Dove is migrated to the pci-mvebu driver. The
+        * non-PCIe windows will no longer be created here once Dove
+        * fully moves to DT.
         */
-       mvebu_mbus_add_window_remap_flags("pcie0.0",
+       mvebu_mbus_add_window_remap_by_id(DOVE_MBUS_PCIE0_IO_TARGET,
+                                         DOVE_MBUS_PCIE0_IO_ATTR,
                                          DOVE_PCIE0_IO_PHYS_BASE,
                                          DOVE_PCIE0_IO_SIZE,
-                                         DOVE_PCIE0_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pcie1.0",
+                                         DOVE_PCIE0_IO_BUS_BASE);
+       mvebu_mbus_add_window_remap_by_id(DOVE_MBUS_PCIE1_IO_TARGET,
+                                         DOVE_MBUS_PCIE1_IO_ATTR,
                                          DOVE_PCIE1_IO_PHYS_BASE,
                                          DOVE_PCIE1_IO_SIZE,
-                                         DOVE_PCIE1_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pcie0.0",
-                                         DOVE_PCIE0_MEM_PHYS_BASE,
-                                         DOVE_PCIE0_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
-       mvebu_mbus_add_window_remap_flags("pcie1.0",
-                                         DOVE_PCIE1_MEM_PHYS_BASE,
-                                         DOVE_PCIE1_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
-       mvebu_mbus_add_window("cesa", DOVE_CESA_PHYS_BASE,
-                             DOVE_CESA_SIZE);
-       mvebu_mbus_add_window("bootrom", DOVE_BOOTROM_PHYS_BASE,
-                             DOVE_BOOTROM_SIZE);
-       mvebu_mbus_add_window("scratchpad", DOVE_SCRATCHPAD_PHYS_BASE,
-                             DOVE_SCRATCHPAD_SIZE);
+                                         DOVE_PCIE1_IO_BUS_BASE);
+       mvebu_mbus_add_window_by_id(DOVE_MBUS_PCIE0_MEM_TARGET,
+                                   DOVE_MBUS_PCIE0_MEM_ATTR,
+                                   DOVE_PCIE0_MEM_PHYS_BASE,
+                                   DOVE_PCIE0_MEM_SIZE);
+       mvebu_mbus_add_window_by_id(DOVE_MBUS_PCIE1_MEM_TARGET,
+                                   DOVE_MBUS_PCIE1_MEM_ATTR,
+                                   DOVE_PCIE1_MEM_PHYS_BASE,
+                                   DOVE_PCIE1_MEM_SIZE);
+       mvebu_mbus_add_window_by_id(DOVE_MBUS_CESA_TARGET,
+                                   DOVE_MBUS_CESA_ATTR,
+                                   DOVE_CESA_PHYS_BASE,
+                                   DOVE_CESA_SIZE);
+       mvebu_mbus_add_window_by_id(DOVE_MBUS_BOOTROM_TARGET,
+                                   DOVE_MBUS_BOOTROM_ATTR,
+                                   DOVE_BOOTROM_PHYS_BASE,
+                                   DOVE_BOOTROM_SIZE);
+       mvebu_mbus_add_window_by_id(DOVE_MBUS_SCRATCHPAD_TARGET,
+                                   DOVE_MBUS_SCRATCHPAD_ATTR,
+                                   DOVE_SCRATCHPAD_PHYS_BASE,
+                                   DOVE_SCRATCHPAD_SIZE);
 }
 
 void __init dove_init(void)
index 60bd729..8a433a5 100644 (file)
@@ -47,7 +47,7 @@ static const struct dove_mpp_grp dove_mpp_grp[] = {
 
 /* Enable gpio for a range of pins. mode should be a combination of
    GPIO_OUTPUT_OK | GPIO_INPUT_OK */
-static void dove_mpp_gpio_mode(int start, int end, int gpio_mode)
+static void __init dove_mpp_gpio_mode(int start, int end, int gpio_mode)
 {
        int i;
 
index 605956f..64f2e50 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/mmc_spi.h>
index 972490f..8646a14 100644 (file)
@@ -17,7 +17,6 @@
 
 void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1);
 void exynos_init_time(void);
-extern unsigned long xxti_f, xusbxti_f;
 
 struct map_desc;
 void exynos_init_io(void);
@@ -25,56 +24,14 @@ void exynos4_restart(enum reboot_mode mode, const char *cmd);
 void exynos5_restart(enum reboot_mode mode, const char *cmd);
 void exynos_init_late(void);
 
-/* ToDo: remove these after migrating legacy exynos4 platforms to dt */
-void exynos4_clk_init(struct device_node *np, int is_exynos4210, void __iomem *reg_base, unsigned long xom);
-void exynos4_clk_register_fixed_ext(unsigned long, unsigned long);
-
 void exynos_firmware_init(void);
 
-void exynos_set_timer_source(u8 channels);
-
 #ifdef CONFIG_PM_GENERIC_DOMAINS
 int exynos_pm_late_initcall(void);
 #else
 static inline int exynos_pm_late_initcall(void) { return 0; }
 #endif
 
-#ifdef CONFIG_ARCH_EXYNOS4
-void exynos4_register_clocks(void);
-void exynos4_setup_clocks(void);
-
-#else
-#define exynos4_register_clocks()
-#define exynos4_setup_clocks()
-#endif
-
-#ifdef CONFIG_ARCH_EXYNOS5
-void exynos5_register_clocks(void);
-void exynos5_setup_clocks(void);
-
-#else
-#define exynos5_register_clocks()
-#define exynos5_setup_clocks()
-#endif
-
-#ifdef CONFIG_CPU_EXYNOS4210
-void exynos4210_register_clocks(void);
-
-#else
-#define exynos4210_register_clocks()
-#endif
-
-#ifdef CONFIG_SOC_EXYNOS4212
-void exynos4212_register_clocks(void);
-
-#else
-#define exynos4212_register_clocks()
-#endif
-
-struct device_node;
-void combiner_init(void __iomem *combiner_base, struct device_node *np,
-                       unsigned int max_nr, int irq_base);
-
 extern struct smp_operations exynos_smp_ops;
 
 extern void exynos_cpu_die(unsigned int cpu);
index cd9fcb1..6acbdab 100644 (file)
@@ -12,7 +12,7 @@ config ARCH_HIGHBANK
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select HAVE_ARM_SCU
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_SMP
        select MAILBOX
        select PL320_MBOX
index f546560..29a8af6 100644 (file)
@@ -1,6 +1,7 @@
 config ARCH_MXC
        bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
        select ARCH_REQUIRE_GPIOLIB
+       select ARM_CPU_SUSPEND if PM
        select ARM_PATCH_PHYS_VIRT
        select AUTO_ZRELADDR if !ZBOOT_ROM
        select CLKDEV_LOOKUP
@@ -8,6 +9,7 @@ config ARCH_MXC
        select GENERIC_ALLOCATOR
        select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
+       select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
        select USE_OF
@@ -785,7 +787,6 @@ config SOC_IMX6Q
        bool "i.MX6 Quad/DualLite support"
        select ARCH_HAS_CPUFREQ
        select ARCH_HAS_OPP
-       select ARM_CPU_SUSPEND if PM
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369 if SMP
        select ARM_ERRATA_775420
@@ -793,7 +794,7 @@ config SOC_IMX6Q
        select COMMON_CLK
        select CPU_V7
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_IMX_ANATOP
        select HAVE_IMX_GPC
        select HAVE_IMX_MMDC
index e20f22d..5383c58 100644 (file)
@@ -15,7 +15,8 @@ imx5-pm-$(CONFIG_PM) += pm-imx5.o
 obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.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-pfd.o clk-busy.o clk.o \
+                           clk-fixup-div.o clk-fixup-mux.o
 
 obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
 obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
index 0cfa07d..ad3b755 100644 (file)
@@ -66,7 +66,7 @@ void imx_anatop_post_resume(void)
        imx_anatop_enable_weak2p5(false);
 }
 
-void imx_anatop_usb_chrg_detect_disable(void)
+static void imx_anatop_usb_chrg_detect_disable(void)
 {
        regmap_write(anatop, ANADIG_USB1_CHRG_DETECT,
                BM_ANADIG_USB_CHRG_DETECT_EN_B
@@ -100,4 +100,6 @@ void __init imx_anatop_init(void)
                pr_err("%s: failed to find imx6q-anatop regmap!\n", __func__);
                return;
        }
+
+       imx_anatop_usb_chrg_detect_disable();
 }
diff --git a/arch/arm/mach-imx/clk-fixup-div.c b/arch/arm/mach-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/arch/arm/mach-imx/clk-fixup-mux.c b/arch/arm/mach-imx/clk-fixup-mux.c
new file mode 100644 (file)
index 0000000..deb4b80
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * 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;
+
+       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;
+}
index 9afac26..1a56a33 100644 (file)
@@ -119,7 +119,7 @@ enum imx5_clks {
        srtc_gate, pata_gate, sata_gate, spdif_xtal_sel, spdif0_sel,
        spdif1_sel, spdif0_pred, spdif0_podf, spdif1_pred, spdif1_podf,
        spdif0_com_s, spdif1_com_sel, spdif0_gate, spdif1_gate, spdif_ipg_gate,
-       clk_max
+       ocram, clk_max
 };
 
 static struct clk *clk[clk_max];
@@ -506,6 +506,7 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
                                mx53_can_sel, ARRAY_SIZE(mx53_can_sel));
        clk[can1_serial_gate] = imx_clk_gate2("can1_serial_gate", "can_sel", MXC_CCM_CCGR6, 22);
        clk[can1_ipg_gate] = imx_clk_gate2("can1_ipg_gate", "ipg", MXC_CCM_CCGR6, 20);
+       clk[ocram] = imx_clk_gate2("ocram", "ahb", MXC_CCM_CCGR6, 2);
        clk[can2_serial_gate] = imx_clk_gate2("can2_serial_gate", "can_sel", MXC_CCM_CCGR4, 8);
        clk[can2_ipg_gate] = imx_clk_gate2("can2_ipg_gate", "ipg", MXC_CCM_CCGR4, 6);
        clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22);
index 86567d9..9181a24 100644 (file)
@@ -206,6 +206,17 @@ 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_post_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", "eim_slow",
+       "uart_serial", "spdif", "asrc", "hsi_tx",
+};
+static const char *cko_sels[] = { "cko1", "cko2", };
 
 enum mx6q_clks {
        dummy, ckil, ckih, osc, pll2_pfd0_352m, pll2_pfd1_594m, pll2_pfd2_396m,
@@ -239,7 +250,8 @@ enum mx6q_clks {
        pll4_audio, pll5_video, pll8_mlb, pll7_usb_host, pll6_enet, ssi1_ipg,
        ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5,
        sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, usbphy1_gate,
-       usbphy2_gate, pll4_post_div, pll5_post_div, pll5_video_div, eim_slow, clk_max
+       usbphy2_gate, pll4_post_div, pll5_post_div, pll5_video_div, eim_slow,
+       spdif, cko2_sel, cko2_podf, cko2, cko, vdoa, clk_max
 };
 
 static struct clk *clk[clk_max];
@@ -276,6 +288,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        struct device_node *np;
        void __iomem *base;
        int i, irq;
+       int ret;
 
        clk[dummy] = imx_clk_fixed("dummy", 0);
        clk[ckil] = imx_obtain_fixed_clock("ckil", 0);
@@ -384,19 +397,21 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        clk[ipu2_di1_sel]     = imx_clk_mux("ipu2_di1_sel",     base + 0x38, 9,  3, ipu2_di1_sels,     ARRAY_SIZE(ipu2_di1_sels));
        clk[hsi_tx_sel]       = imx_clk_mux("hsi_tx_sel",       base + 0x30, 28, 1, hsi_tx_sels,       ARRAY_SIZE(hsi_tx_sels));
        clk[pcie_axi_sel]     = imx_clk_mux("pcie_axi_sel",     base + 0x18, 10, 1, pcie_axi_sels,     ARRAY_SIZE(pcie_axi_sels));
-       clk[ssi1_sel]         = imx_clk_mux("ssi1_sel",         base + 0x1c, 10, 2, ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clk[ssi2_sel]         = imx_clk_mux("ssi2_sel",         base + 0x1c, 12, 2, ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clk[ssi3_sel]         = imx_clk_mux("ssi3_sel",         base + 0x1c, 14, 2, ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clk[usdhc1_sel]       = imx_clk_mux("usdhc1_sel",       base + 0x1c, 16, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clk[usdhc2_sel]       = imx_clk_mux("usdhc2_sel",       base + 0x1c, 17, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clk[usdhc3_sel]       = imx_clk_mux("usdhc3_sel",       base + 0x1c, 18, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clk[usdhc4_sel]       = imx_clk_mux("usdhc4_sel",       base + 0x1c, 19, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
+       clk[ssi1_sel]         = imx_clk_fixup_mux("ssi1_sel",   base + 0x1c, 10, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),          imx_cscmr1_fixup);
+       clk[ssi2_sel]         = imx_clk_fixup_mux("ssi2_sel",   base + 0x1c, 12, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),          imx_cscmr1_fixup);
+       clk[ssi3_sel]         = imx_clk_fixup_mux("ssi3_sel",   base + 0x1c, 14, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),          imx_cscmr1_fixup);
+       clk[usdhc1_sel]       = imx_clk_fixup_mux("usdhc1_sel", base + 0x1c, 16, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),        imx_cscmr1_fixup);
+       clk[usdhc2_sel]       = imx_clk_fixup_mux("usdhc2_sel", base + 0x1c, 17, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),        imx_cscmr1_fixup);
+       clk[usdhc3_sel]       = imx_clk_fixup_mux("usdhc3_sel", base + 0x1c, 18, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),        imx_cscmr1_fixup);
+       clk[usdhc4_sel]       = imx_clk_fixup_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),        imx_cscmr1_fixup);
        clk[enfc_sel]         = imx_clk_mux("enfc_sel",         base + 0x2c, 16, 2, enfc_sels,         ARRAY_SIZE(enfc_sels));
-       clk[emi_sel]          = imx_clk_mux("emi_sel",          base + 0x1c, 27, 2, emi_sels,          ARRAY_SIZE(emi_sels));
-       clk[emi_slow_sel]     = imx_clk_mux("emi_slow_sel",     base + 0x1c, 29, 2, emi_slow_sels,     ARRAY_SIZE(emi_slow_sels));
+       clk[emi_sel]          = imx_clk_fixup_mux("emi_sel",      base + 0x1c, 27, 2, emi_sels,        ARRAY_SIZE(emi_sels),          imx_cscmr1_fixup);
+       clk[emi_slow_sel]     = imx_clk_fixup_mux("emi_slow_sel", base + 0x1c, 29, 2, emi_slow_sels,   ARRAY_SIZE(emi_slow_sels),     imx_cscmr1_fixup);
        clk[vdo_axi_sel]      = imx_clk_mux("vdo_axi_sel",      base + 0x18, 11, 1, vdo_axi_sels,      ARRAY_SIZE(vdo_axi_sels));
        clk[vpu_axi_sel]      = imx_clk_mux("vpu_axi_sel",      base + 0x18, 14, 2, vpu_axi_sels,      ARRAY_SIZE(vpu_axi_sels));
        clk[cko1_sel]         = imx_clk_mux("cko1_sel",         base + 0x60, 0,  4, cko1_sels,         ARRAY_SIZE(cko1_sels));
+       clk[cko2_sel]         = imx_clk_mux("cko2_sel",         base + 0x60, 16, 5, cko2_sels,         ARRAY_SIZE(cko2_sels));
+       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[periph]  = imx_clk_busy_mux("periph",  base + 0x14, 25,  1,   base + 0x48, 5,  periph_sels,  ARRAY_SIZE(periph_sels));
@@ -406,7 +421,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        clk[periph_clk2]      = imx_clk_divider("periph_clk2",      "periph_clk2_sel",   base + 0x14, 27, 3);
        clk[periph2_clk2]     = imx_clk_divider("periph2_clk2",     "periph2_clk2_sel",  base + 0x14, 0,  3);
        clk[ipg]              = imx_clk_divider("ipg",              "ahb",               base + 0x14, 8,  2);
-       clk[ipg_per]          = imx_clk_divider("ipg_per",          "ipg",               base + 0x1c, 0,  6);
+       clk[ipg_per]          = imx_clk_fixup_divider("ipg_per",    "ipg",               base + 0x1c, 0,  6, imx_cscmr1_fixup);
        clk[esai_pred]        = imx_clk_divider("esai_pred",        "esai_sel",          base + 0x28, 9,  3);
        clk[esai_podf]        = imx_clk_divider("esai_podf",        "esai_pred",         base + 0x28, 25, 3);
        clk[asrc_pred]        = imx_clk_divider("asrc_pred",        "asrc_sel",          base + 0x30, 12, 3);
@@ -442,10 +457,11 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        clk[usdhc4_podf]      = imx_clk_divider("usdhc4_podf",      "usdhc4_sel",        base + 0x24, 22, 3);
        clk[enfc_pred]        = imx_clk_divider("enfc_pred",        "enfc_sel",          base + 0x2c, 18, 3);
        clk[enfc_podf]        = imx_clk_divider("enfc_podf",        "enfc_pred",         base + 0x2c, 21, 6);
-       clk[emi_podf]         = imx_clk_divider("emi_podf",         "emi_sel",           base + 0x1c, 20, 3);
-       clk[emi_slow_podf]    = imx_clk_divider("emi_slow_podf",    "emi_slow_sel",      base + 0x1c, 23, 3);
+       clk[emi_podf]         = imx_clk_fixup_divider("emi_podf",   "emi_sel",           base + 0x1c, 20, 3, imx_cscmr1_fixup);
+       clk[emi_slow_podf]    = imx_clk_fixup_divider("emi_slow_podf", "emi_slow_sel",   base + 0x1c, 23, 3, imx_cscmr1_fixup);
        clk[vpu_axi_podf]     = imx_clk_divider("vpu_axi_podf",     "vpu_axi_sel",       base + 0x24, 25, 3);
        clk[cko1_podf]        = imx_clk_divider("cko1_podf",        "cko1_sel",          base + 0x60, 4,  3);
+       clk[cko2_podf]        = imx_clk_divider("cko2_podf",        "cko2_sel",          base + 0x60, 21, 3);
 
        /*                                            name                 parent_name    reg        shift width busy: reg, shift */
        clk[axi]               = imx_clk_busy_divider("axi",               "axi_sel",     base + 0x14, 16,  3,   base + 0x48, 0);
@@ -486,6 +502,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        clk[i2c3]         = imx_clk_gate2("i2c3",          "ipg_per",           base + 0x70, 10);
        clk[iim]          = imx_clk_gate2("iim",           "ipg",               base + 0x70, 12);
        clk[enfc]         = imx_clk_gate2("enfc",          "enfc_podf",         base + 0x70, 14);
+       clk[vdoa]         = imx_clk_gate2("vdoa",          "vdo_axi",           base + 0x70, 26);
        clk[ipu1]         = imx_clk_gate2("ipu1",          "ipu1_podf",         base + 0x74, 0);
        clk[ipu1_di0]     = imx_clk_gate2("ipu1_di0",      "ipu1_di0_sel",      base + 0x74, 2);
        clk[ipu1_di1]     = imx_clk_gate2("ipu1_di1",      "ipu1_di1_sel",      base + 0x74, 4);
@@ -521,6 +538,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        clk[sata]         = imx_clk_gate2("sata",          "ipg",               base + 0x7c, 4);
        clk[sdma]         = imx_clk_gate2("sdma",          "ahb",               base + 0x7c, 6);
        clk[spba]         = imx_clk_gate2("spba",          "ipg",               base + 0x7c, 12);
+       clk[spdif]        = imx_clk_gate2("spdif",         "spdif_podf",        base + 0x7c, 14);
        clk[ssi1_ipg]     = imx_clk_gate2("ssi1_ipg",      "ipg",               base + 0x7c, 18);
        clk[ssi2_ipg]     = imx_clk_gate2("ssi2_ipg",      "ipg",               base + 0x7c, 20);
        clk[ssi3_ipg]     = imx_clk_gate2("ssi3_ipg",      "ipg",               base + 0x7c, 22);
@@ -535,6 +553,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        clk[vdo_axi]      = imx_clk_gate2("vdo_axi",       "vdo_axi_sel",       base + 0x80, 12);
        clk[vpu_axi]      = imx_clk_gate2("vpu_axi",       "vpu_axi_podf",      base + 0x80, 14);
        clk[cko1]         = imx_clk_gate("cko1",           "cko1_podf",         base + 0x60, 7);
+       clk[cko2]         = imx_clk_gate("cko2",           "cko2_podf",         base + 0x60, 24);
 
        for (i = 0; i < ARRAY_SIZE(clk); i++)
                if (IS_ERR(clk[i]))
@@ -554,7 +573,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
        clk_register_clkdev(clk[pll4_post_div], "pll4_post_div", NULL);
        clk_register_clkdev(clk[pll4_audio], "pll4_audio", NULL);
 
-       if (imx6q_revision() != IMX_CHIP_REVISION_1_0) {
+       if ((imx6q_revision() != IMX_CHIP_REVISION_1_0) || cpu_is_imx6dl()) {
                clk_set_parent(clk[ldb_di0_sel], clk[pll5_video_div]);
                clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]);
        }
@@ -574,6 +593,16 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
                clk_prepare_enable(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[cko2_sel], clk[osc]);
+       if (!ret)
+               ret = clk_set_parent(clk[cko], clk[cko2]);
+       if (ret)
+               pr_warn("failed to set up CLKO: %d\n", ret);
+
        /* Set initial power mode */
        imx6q_set_lpm(WAIT_CLOCKED);
 
index a307ac2..a5c3c5d 100644 (file)
@@ -138,14 +138,14 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
        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_lcdif_sels,    ARRAY_SIZE(csi_lcdif_sels));
        clks[IMX6SL_CLK_LCDIF_AXI_SEL]    = imx_clk_mux("lcdif_axi_sel",    base + 0x3c, 14, 2, csi_lcdif_sels,    ARRAY_SIZE(csi_lcdif_sels));
-       clks[IMX6SL_CLK_USDHC1_SEL]       = imx_clk_mux("usdhc1_sel",       base + 0x1c, 16, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SL_CLK_USDHC2_SEL]       = imx_clk_mux("usdhc2_sel",       base + 0x1c, 17, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SL_CLK_USDHC3_SEL]       = imx_clk_mux("usdhc3_sel",       base + 0x1c, 18, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SL_CLK_USDHC4_SEL]       = imx_clk_mux("usdhc4_sel",       base + 0x1c, 19, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SL_CLK_SSI1_SEL]         = imx_clk_mux("ssi1_sel",         base + 0x1c, 10, 2, ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clks[IMX6SL_CLK_SSI2_SEL]         = imx_clk_mux("ssi2_sel",         base + 0x1c, 12, 2, ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clks[IMX6SL_CLK_SSI3_SEL]         = imx_clk_mux("ssi3_sel",         base + 0x1c, 14, 2, ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clks[IMX6SL_CLK_PERCLK_SEL]       = imx_clk_mux("perclk_sel",       base + 0x1c, 6,  1, perclk_sels,       ARRAY_SIZE(perclk_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, epdc_pxp_sels,     ARRAY_SIZE(epdc_pxp_sels));
        clks[IMX6SL_CLK_EPDC_AXI_SEL]     = imx_clk_mux("epdc_axi_sel",     base + 0x34, 15, 3, epdc_pxp_sels,     ARRAY_SIZE(epdc_pxp_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));
@@ -179,14 +179,14 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
        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_divider("perclk",            "perclk_sel",        base + 0x1c, 0,  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_divider("lcdif_pix_podf",    "lcdif_pix_pred",    base + 0x1c, 20, 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);
index a9fad5f..f6640b6 100644 (file)
@@ -48,7 +48,7 @@ struct clk_pllv3 {
 static int clk_pllv3_prepare(struct clk_hw *hw)
 {
        struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       unsigned long timeout = jiffies + msecs_to_jiffies(10);
+       unsigned long timeout;
        u32 val;
 
        val = readl_relaxed(pll->base);
@@ -59,12 +59,19 @@ static int clk_pllv3_prepare(struct clk_hw *hw)
                val &= ~BM_PLL_POWER;
        writel_relaxed(val, pll->base);
 
+       timeout = jiffies + msecs_to_jiffies(10);
        /* Wait for PLL to lock */
-       while (!(readl_relaxed(pll->base) & BM_PLL_LOCK))
+       do {
+               if (readl_relaxed(pll->base) & BM_PLL_LOCK)
+                       break;
                if (time_after(jiffies, timeout))
-                       return -ETIMEDOUT;
+                       break;
+       } while (1);
 
-       return 0;
+       if (readl_relaxed(pll->base) & BM_PLL_LOCK)
+               return 0;
+       else
+               return -ETIMEDOUT;
 }
 
 static void clk_pllv3_unprepare(struct clk_hw *hw)
index 55bc80a..edc35df 100644 (file)
@@ -37,3 +37,29 @@ struct clk * __init imx_obtain_fixed_clock(
                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;
+}
index 0e4e8bb..3451f1f 100644 (file)
@@ -6,6 +6,8 @@
 
 extern spinlock_t imx_ccm_lock;
 
+extern void imx_cscmr1_fixup(u32 *val);
+
 struct clk *imx_clk_pllv1(const char *name, const char *parent,
                void __iomem *base);
 
@@ -49,6 +51,14 @@ 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);
index cb6c838..4517fd7 100644 (file)
@@ -137,7 +137,6 @@ extern void imx_gpc_restore_all(void);
 extern void imx_anatop_init(void);
 extern void imx_anatop_pre_suspend(void);
 extern void imx_anatop_post_resume(void);
-extern void imx_anatop_usb_chrg_detect_disable(void);
 extern u32 imx_anatop_get_digprog(void);
 extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
 extern void imx6q_set_chicken_bit(void);
@@ -147,12 +146,10 @@ extern int imx_cpu_kill(unsigned int cpu);
 
 #ifdef CONFIG_PM
 extern void imx6q_pm_init(void);
-extern void imx51_pm_init(void);
-extern void imx53_pm_init(void);
+extern void imx5_pm_init(void);
 #else
 static inline void imx6q_pm_init(void) {}
-static inline void imx51_pm_init(void) {}
-static inline void imx53_pm_init(void) {}
+static inline void imx5_pm_init(void) {}
 #endif
 
 #ifdef CONFIG_NEON
@@ -161,6 +158,12 @@ extern int mx51_neon_fixup(void);
 static inline int mx51_neon_fixup(void) { return 0; }
 #endif
 
+#ifdef CONFIG_CACHE_L2X0
+extern void imx_init_l2cache(void);
+#else
+static inline void imx_init_l2cache(void) {}
+#endif
+
 extern struct smp_operations imx_smp_ops;
 
 #endif
index 29ac8ee..97f9c62 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/physmap.h>
 #include <linux/i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
 #include <linux/delay.h>
index a02f275..85a1b51 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/regmap.h>
 #include <linux/micrel_phy.h>
 #include <linux/mfd/syscon.h>
-#include <asm/hardware/cache-l2x0.h>
+#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
@@ -103,87 +103,77 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev)
 {
        if (IS_BUILTIN(CONFIG_PHYLIB)) {
                /* min rx data delay */
-               phy_write(phydev, 0x0b, 0x8105);
-               phy_write(phydev, 0x0c, 0x0000);
+               phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL,
+                       0x8000 | MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW);
+               phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0x0000);
 
                /* max rx/tx clock delay, min rx/tx control delay */
-               phy_write(phydev, 0x0b, 0x8104);
-               phy_write(phydev, 0x0c, 0xf0f0);
-               phy_write(phydev, 0x0b, 0x104);
+               phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL,
+                       0x8000 | MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW);
+               phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0xf0f0);
+               phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL,
+                       MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW);
        }
 
        return 0;
 }
 
-static void __init imx6q_sabrelite_cko1_setup(void)
+static void mmd_write_reg(struct phy_device *dev, int device, int reg, int val)
 {
-       struct clk *cko1_sel, *ahb, *cko1;
-       unsigned long rate;
-
-       cko1_sel = clk_get_sys(NULL, "cko1_sel");
-       ahb = clk_get_sys(NULL, "ahb");
-       cko1 = clk_get_sys(NULL, "cko1");
-       if (IS_ERR(cko1_sel) || IS_ERR(ahb) || IS_ERR(cko1)) {
-               pr_err("cko1 setup failed!\n");
-               goto put_clk;
-       }
-       clk_set_parent(cko1_sel, ahb);
-       rate = clk_round_rate(cko1, 16000000);
-       clk_set_rate(cko1, rate);
-put_clk:
-       if (!IS_ERR(cko1_sel))
-               clk_put(cko1_sel);
-       if (!IS_ERR(ahb))
-               clk_put(ahb);
-       if (!IS_ERR(cko1))
-               clk_put(cko1);
+       phy_write(dev, 0x0d, device);
+       phy_write(dev, 0x0e, reg);
+       phy_write(dev, 0x0d, (1 << 14) | device);
+       phy_write(dev, 0x0e, val);
 }
 
-static void __init imx6q_sabrelite_init(void)
+static int ksz9031rn_phy_fixup(struct phy_device *dev)
 {
-       if (IS_BUILTIN(CONFIG_PHYLIB))
-               phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
-                               ksz9021rn_phy_fixup);
-       imx6q_sabrelite_cko1_setup();
+       /*
+        * min rx data delay, max rx/tx clock delay,
+        * min rx/tx control delay
+        */
+       mmd_write_reg(dev, 2, 4, 0);
+       mmd_write_reg(dev, 2, 5, 0);
+       mmd_write_reg(dev, 2, 8, 0x003ff);
+
+       return 0;
 }
 
-static void __init imx6q_sabresd_cko1_setup(void)
+static int ar8031_phy_fixup(struct phy_device *dev)
 {
-       struct clk *cko1_sel, *pll4, *pll4_post, *cko1;
-       unsigned long rate;
-
-       cko1_sel = clk_get_sys(NULL, "cko1_sel");
-       pll4 = clk_get_sys(NULL, "pll4_audio");
-       pll4_post = clk_get_sys(NULL, "pll4_post_div");
-       cko1 = clk_get_sys(NULL, "cko1");
-       if (IS_ERR(cko1_sel) || IS_ERR(pll4)
-                       || IS_ERR(pll4_post) || IS_ERR(cko1)) {
-               pr_err("cko1 setup failed!\n");
-               goto put_clk;
-       }
-       /*
-        * Setting pll4 at 768MHz (24MHz * 32)
-        * So its child clock can get 24MHz easily
-        */
-       clk_set_rate(pll4, 768000000);
-
-       clk_set_parent(cko1_sel, pll4_post);
-       rate = clk_round_rate(cko1, 24000000);
-       clk_set_rate(cko1, rate);
-put_clk:
-       if (!IS_ERR(cko1_sel))
-               clk_put(cko1_sel);
-       if (!IS_ERR(pll4_post))
-               clk_put(pll4_post);
-       if (!IS_ERR(pll4))
-               clk_put(pll4);
-       if (!IS_ERR(cko1))
-               clk_put(cko1);
+       u16 val;
+
+       /* To enable AR8031 output a 125MHz clk from CLK_25M */
+       phy_write(dev, 0xd, 0x7);
+       phy_write(dev, 0xe, 0x8016);
+       phy_write(dev, 0xd, 0x4007);
+
+       val = phy_read(dev, 0xe);
+       val &= 0xffe3;
+       val |= 0x18;
+       phy_write(dev, 0xe, val);
+
+       /* introduce tx clock delay */
+       phy_write(dev, 0x1d, 0x5);
+       val = phy_read(dev, 0x1e);
+       val |= 0x0100;
+       phy_write(dev, 0x1e, val);
+
+       return 0;
 }
 
-static void __init imx6q_sabresd_init(void)
+#define PHY_ID_AR8031  0x004dd074
+
+static void __init imx6q_enet_phy_init(void)
 {
-       imx6q_sabresd_cko1_setup();
+       if (IS_BUILTIN(CONFIG_PHYLIB)) {
+               phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
+                               ksz9021rn_phy_fixup);
+               phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
+                               ksz9031rn_phy_fixup);
+               phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
+                               ar8031_phy_fixup);
+       }
 }
 
 static void __init imx6q_1588_init(void)
@@ -192,29 +182,22 @@ static void __init imx6q_1588_init(void)
 
        gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
        if (!IS_ERR(gpr))
-               regmap_update_bits(gpr, 0x4, 1 << 21, 1 << 21);
+               regmap_update_bits(gpr, IOMUXC_GPR1,
+                               IMX6Q_GPR1_ENET_CLK_SEL_MASK,
+                               IMX6Q_GPR1_ENET_CLK_SEL_ANATOP);
        else
                pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
 
 }
-static void __init imx6q_usb_init(void)
-{
-       imx_anatop_usb_chrg_detect_disable();
-}
 
 static void __init imx6q_init_machine(void)
 {
-       if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
-               imx6q_sabrelite_init();
-       else if (of_machine_is_compatible("fsl,imx6q-sabresd") ||
-                       of_machine_is_compatible("fsl,imx6dl-sabresd"))
-               imx6q_sabresd_init();
+       imx6q_enet_phy_init();
 
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
        imx_anatop_init();
        imx6q_pm_init();
-       imx6q_usb_init();
        imx6q_1588_init();
 }
 
@@ -296,44 +279,10 @@ static void __init imx6q_map_io(void)
        imx_scu_map_io();
 }
 
-#ifdef CONFIG_CACHE_L2X0
-static void __init imx6q_init_l2cache(void)
-{
-       void __iomem *l2x0_base;
-       struct device_node *np;
-       unsigned int val;
-
-       np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache");
-       if (!np)
-               goto out;
-
-       l2x0_base = of_iomap(np, 0);
-       if (!l2x0_base) {
-               of_node_put(np);
-               goto out;
-       }
-
-       /* Configure the L2 PREFETCH and POWER registers */
-       val = readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
-       val |= 0x70800000;
-       writel_relaxed(val, l2x0_base + L2X0_PREFETCH_CTRL);
-       val = L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN;
-       writel_relaxed(val, l2x0_base + L2X0_POWER_CTRL);
-
-       iounmap(l2x0_base);
-       of_node_put(np);
-
-out:
-       l2x0_of_init(0, ~0UL);
-}
-#else
-static inline void imx6q_init_l2cache(void) {}
-#endif
-
 static void __init imx6q_init_irq(void)
 {
        imx6q_init_revision();
-       imx6q_init_l2cache();
+       imx_init_l2cache();
        imx_src_init();
        imx_gpc_init();
        irqchip_init();
index 132db26..0d75dc5 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/irqchip.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -26,7 +25,7 @@ static void __init imx6sl_init_machine(void)
 
 static void __init imx6sl_init_irq(void)
 {
-       l2x0_of_init(0, ~0UL);
+       imx_init_l2cache();
        imx_src_init();
        imx_gpc_init();
        irqchip_init();
index a27faab..c918940 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/mach/time.h>
 #include <asm/mach/map.h>
 #include <linux/gpio.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 
 #include "common.h"
 #include "devices-imx27.h"
index cf193d8..a8229b7 100644 (file)
@@ -153,10 +153,10 @@ void __init imx51_soc_init(void)
 void __init imx51_init_late(void)
 {
        mx51_neon_fixup();
-       imx51_pm_init();
+       imx5_pm_init();
 }
 
 void __init imx53_init_late(void)
 {
-       imx53_pm_init();
+       imx5_pm_init();
 }
index 82e79c6..58aeaf5 100644 (file)
@@ -169,14 +169,9 @@ static int __init imx5_pm_common_init(void)
        return imx5_cpuidle_init();
 }
 
-void __init imx51_pm_init(void)
+void __init imx5_pm_init(void)
 {
        int ret = imx5_pm_common_init();
        if (!ret)
                suspend_set_ops(&mx5_suspend_ops);
 }
-
-void __init imx53_pm_init(void)
-{
-       imx5_pm_common_init();
-}
index 6fe81bb..64ff37e 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/system_misc.h>
 #include <asm/proc-fns.h>
 #include <asm/mach-types.h>
+#include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
 #include "hardware.h"
@@ -95,3 +96,35 @@ void __init mxc_arch_reset_init_dt(void)
 
        clk_prepare(wdog_clk);
 }
+
+#ifdef CONFIG_CACHE_L2X0
+void __init imx_init_l2cache(void)
+{
+       void __iomem *l2x0_base;
+       struct device_node *np;
+       unsigned int val;
+
+       np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache");
+       if (!np)
+               goto out;
+
+       l2x0_base = of_iomap(np, 0);
+       if (!l2x0_base) {
+               of_node_put(np);
+               goto out;
+       }
+
+       /* Configure the L2 PREFETCH and POWER registers */
+       val = readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
+       val |= 0x70800000;
+       writel_relaxed(val, l2x0_base + L2X0_PREFETCH_CTRL);
+       val = L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN;
+       writel_relaxed(val, l2x0_base + L2X0_POWER_CTRL);
+
+       iounmap(l2x0_base);
+       of_node_put(np);
+
+out:
+       l2x0_of_init(0, ~0UL);
+}
+#endif
index 51a50e9..366d1a3 100644 (file)
@@ -7,7 +7,6 @@ config ARCH_KEYSTONE
        select HAVE_SMP
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
-       select HAVE_SCHED_CLOCK
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_ERRATA_798181 if SMP
        help
index 14378e3..c122961 100644 (file)
@@ -38,6 +38,5 @@ static int keystone_smp_boot_secondary(unsigned int cpu,
 }
 
 struct smp_operations keystone_smp_ops __initdata = {
-       .smp_init_cpus          = arm_dt_init_cpu_maps,
        .smp_boot_secondary     = keystone_smp_boot_secondary,
 };
index 9b9e4f7..d15de81 100644 (file)
@@ -22,8 +22,7 @@
  * Return: Non zero value on failure
  */
 ENTRY(keystone_cpu_smc)
-       stmfd   sp!, {r4-r12, lr}
+       stmfd   sp!, {r4-r11, lr}
        smc     #0
-       dsb
-       ldmfd   sp!, {r4-r12, pc}
+       ldmfd   sp!, {r4-r11, pc}
 ENDPROC(keystone_cpu_smc)
index b634f96..fe8319a 100644 (file)
@@ -2,67 +2,32 @@ if ARCH_KIRKWOOD
 
 menu "Marvell Kirkwood Implementations"
 
+config KIRKWOOD_LEGACY
+       bool
+
 config MACH_D2NET_V2
        bool "LaCie d2 Network v2 NAS Board"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          LaCie d2 Network v2 NAS.
 
-config MACH_DOCKSTAR
-       bool "Seagate FreeAgent DockStar"
-       help
-         Say 'Y' here if you want your kernel to support the
-         Seagate FreeAgent DockStar.
-
-config MACH_ESATA_SHEEVAPLUG
-       bool "Marvell eSATA SheevaPlug Reference Board"
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell eSATA SheevaPlug Reference Board.
-
-config MACH_GURUPLUG
-       bool "Marvell GuruPlug Reference Board"
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell GuruPlug Reference Board.
-
-config MACH_INETSPACE_V2
-       bool "LaCie Internet Space v2 NAS Board"
-       help
-         Say 'Y' here if you want your kernel to support the
-         LaCie Internet Space v2 NAS.
-
-config MACH_MV88F6281GTW_GE
-       bool "Marvell 88F6281 GTW GE Board"
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell 88F6281 GTW GE Board.
-
 config MACH_NET2BIG_V2
        bool "LaCie 2Big Network v2 NAS Board"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          LaCie 2Big Network v2 NAS.
 
 config MACH_NET5BIG_V2
        bool "LaCie 5Big Network v2 NAS Board"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          LaCie 5Big Network v2 NAS.
 
-config MACH_NETSPACE_MAX_V2
-       bool "LaCie Network Space Max v2 NAS Board"
-       help
-         Say 'Y' here if you want your kernel to support the
-         LaCie Network Space Max v2 NAS.
-
-config MACH_NETSPACE_V2
-       bool "LaCie Network Space v2 NAS Board"
-       help
-         Say 'Y' here if you want your kernel to support the
-         LaCie Network Space v2 NAS.
-
 config MACH_OPENRD
+       select KIRKWOOD_LEGACY
         bool
 
 config MACH_OPENRD_BASE
@@ -88,30 +53,28 @@ config MACH_OPENRD_ULTIMATE
 
 config MACH_RD88F6192_NAS
        bool "Marvell RD-88F6192-NAS Reference Board"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          Marvell RD-88F6192-NAS Reference Board.
 
 config MACH_RD88F6281
        bool "Marvell RD-88F6281 Reference Board"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          Marvell RD-88F6281 Reference Board.
 
-config MACH_SHEEVAPLUG
-       bool "Marvell SheevaPlug Reference Board"
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell SheevaPlug Reference Board.
-
 config MACH_T5325
        bool "HP t5325 Thin Client"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          HP t5325 Thin Client.
 
 config MACH_TS219
        bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and
@@ -119,6 +82,7 @@ config MACH_TS219
 
 config MACH_TS41X
        bool "QNAP TS-410, TS-410U, TS-419P, TS-419P+ and TS-419U Turbo NAS"
+       select KIRKWOOD_LEGACY
        help
          Say 'Y' here if you want your kernel to support the
          QNAP TS-410, TS-410U, TS-419P, TS-419P+ and TS-419U Turbo
@@ -129,6 +93,9 @@ comment "Device tree entries"
 config ARCH_KIRKWOOD_DT
        bool "Marvell Kirkwood Flattened Device Tree"
        select KIRKWOOD_CLK
+       select OF_IRQ
+       select ORION_IRQCHIP
+       select ORION_TIMER
        select POWER_SUPPLY
        select POWER_RESET
        select POWER_RESET_GPIO
@@ -139,184 +106,12 @@ config ARCH_KIRKWOOD_DT
          Say 'Y' here if you want your kernel to support the
          Marvell Kirkwood using flattened device tree.
 
-config MACH_CLOUDBOX_DT
-       bool "LaCie CloudBox NAS (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the LaCie
-         CloudBox NAS, using Flattened Device Tree.
-
-config MACH_DB88F628X_BP_DT
-       bool "Marvell DB-88F628x-BP Development Board (Flattened Device Tree)"
-       help
-         Say 'Y' here if you want your kernel to support the Marvell
-         DB-88F6281-BP and DB-88F6282-BP Development Board (Flattened
-         Device Tree).
-
-config MACH_DLINK_KIRKWOOD_DT
-       bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
-         using Flattened Device Tree.
-
-config MACH_DOCKSTAR_DT
-       bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
+config MACH_MV88F6281GTW_GE_DT
+       bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)"
+       depends on ARCH_KIRKWOOD_DT
        help
          Say 'Y' here if you want your kernel to support the
-         Seagate FreeAgent Dockstar (Flattened Device Tree).
-
-config MACH_DREAMPLUG_DT
-       bool "Marvell DreamPlug (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell DreamPlug (Flattened Device Tree).
-
-config MACH_GOFLEXNET_DT
-       bool "Seagate GoFlex Net (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Seagate GoFlex Net (Flattened Device Tree).
-
-config MACH_GURUPLUG_DT
-       bool "Marvell GuruPlug Reference Board (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell GuruPlug Reference Board (Flattened Device Tree).
-
-config MACH_IB62X0_DT
-       bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
-         Flattened Device Tree.
-
-config MACH_ICONNECT_DT
-       bool "Iomega Iconnect (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here to enable Iomega Iconnect support.
-
-config MACH_INETSPACE_V2_DT
-       bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the LaCie
-         Internet Space v2 NAS, using Flattened Device Tree.
-
-config MACH_IOMEGA_IX2_200_DT
-       bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Iomega StorCenter ix2-200 (Flattened Device Tree).
-
-config MACH_KM_KIRKWOOD_DT
-       bool "Keymile Kirkwood Reference Design (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
-
-config MACH_LSXL_DT
-       bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       select POWER_RESET_RESTART
-       help
-         Say 'Y' here if you want your kernel to support the
-         Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
-         Flattened Device Tree.
-
-config MACH_MPLCEC4_DT
-       bool "MPL CEC4 (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         MPL CEC4 (Flattened Device Tree).
-
-config MACH_NETSPACE_LITE_V2_DT
-       bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the LaCie
-         Network Space Lite v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MAX_V2_DT
-       bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the LaCie
-         Network Space Max v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MINI_V2_DT
-       bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the LaCie
-         Network Space Mini v2 NAS using Flattened Device Tree.
-
-         This board is embedded in a product named CloudBox, which
-         provides automatic backup on a 100GB cloud storage. This
-         should not confused with a more recent LaCie NAS also named
-         CloudBox. For this last, the disk capacity is 1TB or above.
-
-config MACH_NETSPACE_V2_DT
-       bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the LaCie
-         Network Space v2 NAS, using Flattened Device Tree.
-
-config MACH_OPENBLOCKS_A6_DT
-       bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Plat'Home OpenBlocks A6 (Flattened Device Tree).
-
-config MACH_READYNAS_DT
-       bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       select ARM_APPENDED_DTB
-       select ARM_ATAG_DTB_COMPAT
-       help
-         Say 'Y' here if you want your kernel to support the
-         NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
-
-config MACH_SHEEVAPLUG_DT
-       bool "Marvell (eSATA) SheevaPlug (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell (eSATA) SheevaPlug (Flattened Device Tree).
-
-config MACH_TOPKICK_DT
-       bool "USI Topkick (Flattened Device Tree)"
-       select ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         USI Topkick, using Flattened Device Tree
-
-config MACH_TS219_DT
-       bool "Device Tree for QNAP TS-11X, TS-21X NAS"
-       select ARCH_KIRKWOOD_DT
-       select ARM_APPENDED_DTB
-       select ARM_ATAG_DTB_COMPAT
-       select POWER_RESET_QNAP
-       help
-         Say 'Y' here if you want your kernel to support the QNAP
-         TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and
-         TS-219P+ Turbo NAS devices using Fattened Device Tree.
-         There are two different Device Tree descriptions, depending
-         on if the device is based on an if the board uses the MV6281
-         or MV6282. If you have the wrong one, the buttons will not
-         work.
+         Marvell 88F6281 GTW GE Board (Flattened Device Tree).
 
 endmenu
 
index ac4cd75..d1f8e3d 100644 (file)
@@ -1,44 +1,14 @@
-obj-y                          += common.o irq.o pcie.o mpp.o
-
+obj-y                          += common.o pcie.o
+obj-$(CONFIG_KIRKWOOD_LEGACY)  += irq.o mpp.o
 obj-$(CONFIG_MACH_D2NET_V2)            += d2net_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_DOCKSTAR)            += dockstar-setup.o
-obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)    += sheevaplug-setup.o
-obj-$(CONFIG_MACH_GURUPLUG)            += guruplug-setup.o
-obj-$(CONFIG_MACH_INETSPACE_V2)                += netspace_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_MV88F6281GTW_GE)     += mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_NET2BIG_V2)          += netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_NET5BIG_V2)          += netxbig_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_NETSPACE_MAX_V2)     += netspace_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_NETSPACE_V2)         += netspace_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_OPENRD)              += openrd-setup.o
 obj-$(CONFIG_MACH_RD88F6192_NAS)       += rd88f6192-nas-setup.o
 obj-$(CONFIG_MACH_RD88F6281)           += rd88f6281-setup.o
-obj-$(CONFIG_MACH_SHEEVAPLUG)          += sheevaplug-setup.o
 obj-$(CONFIG_MACH_T5325)               += t5325-setup.o
 obj-$(CONFIG_MACH_TS219)               += ts219-setup.o tsx1x-common.o
 obj-$(CONFIG_MACH_TS41X)               += ts41x-setup.o tsx1x-common.o
 
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)         += board-dt.o
-obj-$(CONFIG_MACH_CLOUDBOX_DT)         += board-ns2.o
-obj-$(CONFIG_MACH_DB88F628X_BP_DT)     += board-db88f628x-bp.o
-obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)   += board-dnskw.o
-obj-$(CONFIG_MACH_DOCKSTAR_DT)         += board-dockstar.o
-obj-$(CONFIG_MACH_DREAMPLUG_DT)                += board-dreamplug.o
-obj-$(CONFIG_MACH_GOFLEXNET_DT)                += board-goflexnet.o
-obj-$(CONFIG_MACH_GURUPLUG_DT)         += board-guruplug.o
-obj-$(CONFIG_MACH_IB62X0_DT)           += board-ib62x0.o
-obj-$(CONFIG_MACH_ICONNECT_DT)         += board-iconnect.o
-obj-$(CONFIG_MACH_INETSPACE_V2_DT)     += board-ns2.o
-obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)   += board-iomega_ix2_200.o
-obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)      += board-km_kirkwood.o
-obj-$(CONFIG_MACH_LSXL_DT)             += board-lsxl.o
-obj-$(CONFIG_MACH_MPLCEC4_DT)          += board-mplcec4.o
-obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)  += board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_V2_DT)      += board-ns2.o
-obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)    += board-openblocks_a6.o
-obj-$(CONFIG_MACH_READYNAS_DT)         += board-readynas.o
-obj-$(CONFIG_MACH_SHEEVAPLUG_DT)       += board-sheevaplug.o
-obj-$(CONFIG_MACH_TOPKICK_DT)          += board-usi_topkick.o
-obj-$(CONFIG_MACH_TS219_DT)            += board-ts219.o tsx1x-common.o
+obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT)  += board-mv88f6281gtw_ge.o
diff --git a/arch/arm/mach-kirkwood/board-db88f628x-bp.c b/arch/arm/mach-kirkwood/board-db88f628x-bp.c
deleted file mode 100644 (file)
index 2f574bc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Saeed Bishara <saeed@marvell.com>
- *
- * Marvell DB-88F628{1,2}-BP Development Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/of.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data db88f628x_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init db88f628x_init(void)
-{
-       kirkwood_ge00_init(&db88f628x_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
deleted file mode 100644 (file)
index a1aa87f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2012 (C), Jamie Lentin <jm@lentin.co.uk>
- *
- * arch/arm/mach-kirkwood/board-dnskw.c
- *
- * D-link DNS-320 & DNS-325 NAS Init for drivers not converted to
- * flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dnskw_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-/* Register any GPIO for output and set the value */
-static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
-{
-       if (gpio_request(gpio, name) == 0 &&
-           gpio_direction_output(gpio, 0) == 0) {
-               gpio_set_value(gpio, def);
-               if (gpio_export(gpio, 0) != 0)
-                       pr_err("dnskw: Failed to export GPIO %s\n", name);
-       } else
-               pr_err("dnskw: Failed to register %s\n", name);
-}
-
-void __init dnskw_init(void)
-{
-       kirkwood_ge00_init(&dnskw_ge00_data);
-
-       /* Set NAS to turn back on after a power failure */
-       dnskw_gpio_register(37, "dnskw:power:recover", 1);
-}
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
deleted file mode 100644 (file)
index d7196db..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-dockstar.c
- *
- * Seagate FreeAgent Dockstar Board Init for drivers not converted to
- * flattened device tree yet.
- *
- * 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dockstar_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init dockstar_dt_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&dockstar_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
deleted file mode 100644 (file)
index 0903242..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-dreamplug.c
- *
- * Marvell DreamPlug Reference Board Init for drivers not converted to
- * flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(1),
-};
-
-void __init dreamplug_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&dreamplug_ge00_data);
-       kirkwood_ge01_init(&dreamplug_ge01_data);
-}
index 6e122ed..82d3ad8 100644 (file)
@@ -15,6 +15,9 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+#include <linux/dma-mapping.h>
+#include <linux/irqchip.h>
 #include <linux/kexec.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -49,10 +52,6 @@ static void __init kirkwood_legacy_clk_init(void)
        orion_clkdev_add("1", "pcie",
                         of_clk_get_from_provider(&clkspec));
 
-       clkspec.args[0] = CGC_BIT_SDIO;
-       orion_clkdev_add(NULL, "mvsdio",
-                        of_clk_get_from_provider(&clkspec));
-
        /*
         * The ethernet interfaces forget the MAC address assigned by
         * u-boot if the clocks are turned off. Until proper DT support
@@ -60,19 +59,24 @@ static void __init kirkwood_legacy_clk_init(void)
         */
        clkspec.args[0] = CGC_BIT_GE0;
        clk = of_clk_get_from_provider(&clkspec);
-       orion_clkdev_add(NULL, "mv643xx_eth_port.0", clk);
        clk_prepare_enable(clk);
 
        clkspec.args[0] = CGC_BIT_GE1;
        clk = of_clk_get_from_provider(&clkspec);
-       orion_clkdev_add(NULL, "mv643xx_eth_port.1", clk);
        clk_prepare_enable(clk);
 }
 
-static void __init kirkwood_of_clk_init(void)
+static void __init kirkwood_dt_time_init(void)
 {
        of_clk_init(NULL);
-       kirkwood_legacy_clk_init();
+       clocksource_of_init();
+}
+
+static void __init kirkwood_dt_init_early(void)
+{
+       mvebu_mbus_init("marvell,kirkwood-mbus",
+                       BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
+                       DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ);
 }
 
 static void __init kirkwood_dt_init(void)
@@ -87,14 +91,15 @@ static void __init kirkwood_dt_init(void)
         */
        writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
 
+       BUG_ON(mvebu_mbus_dt_init());
        kirkwood_setup_wins();
 
        kirkwood_l2_init();
 
        kirkwood_cpufreq_init();
 
-       /* Setup root of clk tree */
-       kirkwood_of_clk_init();
+       /* Setup clocks for legacy devices */
+       kirkwood_legacy_clk_init();
 
        kirkwood_cpuidle_init();
 
@@ -102,105 +107,22 @@ static void __init kirkwood_dt_init(void)
        kexec_reinit = kirkwood_enable_pcie;
 #endif
 
-       if (of_machine_is_compatible("globalscale,dreamplug"))
-               dreamplug_init();
-
-       if (of_machine_is_compatible("globalscale,guruplug"))
-               guruplug_dt_init();
-
-       if (of_machine_is_compatible("globalscale,sheevaplug"))
-               sheevaplug_dt_init();
-
-       if (of_machine_is_compatible("dlink,dns-kirkwood"))
-               dnskw_init();
-
-       if (of_machine_is_compatible("iom,iconnect"))
-               iconnect_init();
-
-       if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
-               ib62x0_init();
-
-       if (of_machine_is_compatible("qnap,ts219"))
-               qnap_dt_ts219_init();
-
-       if (of_machine_is_compatible("seagate,dockstar"))
-               dockstar_dt_init();
-
-       if (of_machine_is_compatible("seagate,goflexnet"))
-               goflexnet_init();
-
-       if (of_machine_is_compatible("buffalo,lsxl"))
-               lsxl_init();
-
-       if (of_machine_is_compatible("iom,ix2-200"))
-               iomega_ix2_200_init();
-
-       if (of_machine_is_compatible("keymile,km_kirkwood"))
-               km_kirkwood_init();
-
-       if (of_machine_is_compatible("lacie,cloudbox") ||
-           of_machine_is_compatible("lacie,inetspace_v2") ||
-           of_machine_is_compatible("lacie,netspace_lite_v2") ||
-           of_machine_is_compatible("lacie,netspace_max_v2") ||
-           of_machine_is_compatible("lacie,netspace_mini_v2") ||
-           of_machine_is_compatible("lacie,netspace_v2"))
-               ns2_init();
-
-       if (of_machine_is_compatible("marvell,db-88f6281-bp") ||
-           of_machine_is_compatible("marvell,db-88f6282-bp"))
-               db88f628x_init();
-
-       if (of_machine_is_compatible("mpl,cec4"))
-               mplcec4_init();
-
-       if (of_machine_is_compatible("netgear,readynas-duo-v2"))
-               netgear_readynas_init();
-
-       if (of_machine_is_compatible("plathome,openblocks-a6"))
-               openblocks_a6_init();
-
-       if (of_machine_is_compatible("usi,topkick"))
-               usi_topkick_init();
+       if (of_machine_is_compatible("marvell,mv88f6281gtw-ge"))
+               mv88f6281gtw_ge_init();
 
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static const char * const kirkwood_dt_board_compat[] = {
-       "globalscale,dreamplug",
-       "globalscale,guruplug",
-       "globalscale,sheevaplug",
-       "dlink,dns-320",
-       "dlink,dns-325",
-       "iom,iconnect",
-       "raidsonic,ib-nas62x0",
-       "qnap,ts219",
-       "seagate,dockstar",
-       "seagate,goflexnet",
-       "buffalo,lsxl",
-       "iom,ix2-200",
-       "keymile,km_kirkwood",
-       "lacie,cloudbox",
-       "lacie,inetspace_v2",
-       "lacie,netspace_lite_v2",
-       "lacie,netspace_max_v2",
-       "lacie,netspace_mini_v2",
-       "lacie,netspace_v2",
-       "marvell,db-88f6281-bp",
-       "marvell,db-88f6282-bp",
-       "mpl,cec4",
-       "netgear,readynas-duo-v2",
-       "plathome,openblocks-a6",
-       "usi,topkick",
-       "zyxel,nsa310",
+       "marvell,kirkwood",
        NULL
 };
 
 DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
        /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
        .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = orion_dt_init_irq,
-       .init_time      = kirkwood_timer_init,
+       .init_early     = kirkwood_dt_init_early,
+       .init_time      = kirkwood_dt_time_init,
        .init_machine   = kirkwood_dt_init,
        .restart        = kirkwood_restart,
        .dt_compat      = kirkwood_dt_board_compat,
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
deleted file mode 100644 (file)
index 9db979a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-goflexnet.c
- *
- * Seagate GoFlext Net Board Init for drivers not converted to
- * flattened device tree yet.
- *
- * 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init goflexnet_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&goflexnet_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-guruplug.c b/arch/arm/mach-kirkwood/board-guruplug.c
deleted file mode 100644 (file)
index a857163..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-guruplug.c
- *
- * Marvell Guruplug Reference Board Init for drivers not converted to
- * flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data guruplug_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data guruplug_ge01_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(1),
-};
-
-void __init guruplug_dt_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&guruplug_ge00_data);
-       kirkwood_ge01_init(&guruplug_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
deleted file mode 100644 (file)
index 9a857ae..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
- *
- * arch/arm/mach-kirkwood/board-ib62x0.c
- *
- * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not
- * converted to flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ib62x0_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&ib62x0_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
deleted file mode 100644 (file)
index 98b5ad1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-iconnect.c
- *
- * Iomega i-connect Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/of.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data iconnect_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
-};
-
-void __init iconnect_init(void)
-{
-       kirkwood_ge00_init(&iconnect_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c
deleted file mode 100644 (file)
index e5f7041..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-iomega_ix2_200.c
- *
- * Iomega StorCenter ix2-200
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/ethtool.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_NONE,
-       .speed          = SPEED_1000,
-       .duplex         = DUPLEX_FULL,
-};
-
-static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
-        .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
-};
-
-void __init iomega_ix2_200_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
-       kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-km_kirkwood.c b/arch/arm/mach-kirkwood/board-km_kirkwood.c
deleted file mode 100644 (file)
index 44e4605..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2012 2012 KEYMILE AG, CH-3097 Bern
- * Valentin Longchamp <valentin.longchamp@keymile.com>
- *
- * arch/arm/mach-kirkwood/board-km_kirkwood.c
- *
- * Keymile km_kirkwood Reference Desing Init for drivers not converted to
- * flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/clk.h>
-#include <linux/clk-private.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init km_kirkwood_init(void)
-{
-       struct clk *sata_clk;
-       /*
-        * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing
-        * SATA bits (14-15) of the Clock Gating Control Register. Since these
-        * devices are also not present in this variant, their clocks get
-        * disabled because unused when clk_disable_unused() gets called.
-        * That's why we change the flags to these clocks to CLK_IGNORE_UNUSED
-        */
-       sata_clk = clk_get_sys("sata_mv.0", "0");
-       if (!IS_ERR(sata_clk))
-               sata_clk->flags |= CLK_IGNORE_UNUSED;
-       sata_clk = clk_get_sys("sata_mv.0", "1");
-       if (!IS_ERR(sata_clk))
-               sata_clk->flags |= CLK_IGNORE_UNUSED;
-
-       kirkwood_ge00_init(&km_kirkwood_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
deleted file mode 100644 (file)
index 3483952..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2012 (C), Michael Walle <michael@walle.cc>
- *
- * arch/arm/mach-kirkwood/board-lsxl.c
- *
- * Buffalo Linkstation LS-XHL and LS-CHLv2 init for drivers not
- * converted to flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data lsxl_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data lsxl_ge01_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init lsxl_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-
-       kirkwood_ge00_init(&lsxl_ge00_data);
-       kirkwood_ge01_init(&lsxl_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
deleted file mode 100644 (file)
index 938712e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2012 MPL AG, Switzerland
- * Stefan Peter <s.peter@mpl.ch>
- *
- * arch/arm/mach-kirkwood/board-mplcec4.c
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data mplcec4_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(2),
-};
-
-void __init mplcec4_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&mplcec4_ge00_data);
-       kirkwood_ge01_init(&mplcec4_ge01_data);
-}
-
-
-
diff --git a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
new file mode 100644 (file)
index 0000000..ee5eea6
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
+ *
+ * Marvell 88F6281 GTW GE Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/timer.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/ethtool.h>
+#include <linux/gpio.h>
+#include <net/dsa.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/pci.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+
+static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
+       .phy_addr       = MV643XX_ETH_PHY_NONE,
+       .speed          = SPEED_1000,
+       .duplex         = DUPLEX_FULL,
+};
+
+static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
+       .port_names[0]  = "lan1",
+       .port_names[1]  = "lan2",
+       .port_names[2]  = "lan3",
+       .port_names[3]  = "lan4",
+       .port_names[4]  = "wan",
+       .port_names[5]  = "cpu",
+};
+
+static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
+       .nr_chips       = 1,
+       .chip           = &mv88f6281gtw_ge_switch_chip_data,
+};
+
+void __init mv88f6281gtw_ge_init(void)
+{
+       kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
+       kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
+}
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
deleted file mode 100644 (file)
index f8f6605..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Guinot <simon.guinot@sequanux.org>
- *
- * arch/arm/mach-kirkwood/board-ns2.c
- *
- * LaCie Network Space v2 board (and parents) initialization for drivers
- * not converted to flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/of.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data ns2_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ns2_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       if (of_machine_is_compatible("lacie,cloudbox") ||
-           of_machine_is_compatible("lacie,netspace_lite_v2") ||
-           of_machine_is_compatible("lacie,netspace_mini_v2"))
-               ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
-       kirkwood_ge00_init(&ns2_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c
deleted file mode 100644 (file)
index b11d8fd..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- *
- * arch/arm/mach-kirkwood/board-openblocks_a6.c
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data openblocks_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init openblocks_a6_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&openblocks_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
deleted file mode 100644 (file)
index 341b82d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already
- * converted to DT.
- *
- * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
- *
- * 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/init.h>
-#include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init netgear_readynas_init(void)
-{
-       kirkwood_ge00_init(&netgear_readynas_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-sheevaplug.c b/arch/arm/mach-kirkwood/board-sheevaplug.c
deleted file mode 100644 (file)
index fa38937..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-sheevaplug.c
- *
- * Marvell Sheevaplug Reference Board Init for drivers not converted to
- * flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init sheevaplug_dt_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&sheevaplug_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
deleted file mode 100644 (file)
index 860f44a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * QNAP TS-11x/TS-21x Turbo NAS Board Setup via DT
- *
- * Copyright (C) 2012 Andrew Lunn <andrew@lunn.ch>
- *
- * Based on the board file ts219-setup.c:
- *
- * Copyright (C) 2009  Martin Michlmayr <tbm@cyrius.com>
- * Copyright (C) 2008  Byron Bradley <byron.bbradley@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/init.h>
-#include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init qnap_dt_ts219_init(void)
-{
-       u32 dev, rev;
-
-       kirkwood_pcie_id(&dev, &rev);
-       if (dev == MV88F6282_DEV_ID)
-               qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
-
-       kirkwood_ge00_init(&qnap_ts219_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
deleted file mode 100644 (file)
index 1cc04ec..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-usi_topkick.c
- *
- * USI Topkick Init for drivers not converted to flattened device tree yet.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data topkick_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init usi_topkick_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_ge00_init(&topkick_ge00_data);
-}
index 1663de0..1767611 100644 (file)
 #include <linux/platform_data/dma-mv_xor.h>
 #include "common.h"
 
+/* These can go away once Kirkwood uses the mvebu-mbus DT binding */
+#define KIRKWOOD_MBUS_NAND_TARGET 0x01
+#define KIRKWOOD_MBUS_NAND_ATTR   0x2f
+#define KIRKWOOD_MBUS_SRAM_TARGET 0x03
+#define KIRKWOOD_MBUS_SRAM_ATTR   0x01
+
 /*****************************************************************************
  * I/O Address Mapping
  ****************************************************************************/
@@ -528,10 +534,6 @@ void __init kirkwood_cpuidle_init(void)
 void __init kirkwood_init_early(void)
 {
        orion_time_set_base(TIMER_VIRT_BASE);
-
-       mvebu_mbus_init("marvell,kirkwood-mbus",
-                       BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
-                       DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ);
 }
 
 int kirkwood_tclk;
@@ -666,10 +668,14 @@ char * __init kirkwood_id(void)
 
 void __init kirkwood_setup_wins(void)
 {
-       mvebu_mbus_add_window("nand", KIRKWOOD_NAND_MEM_PHYS_BASE,
-                             KIRKWOOD_NAND_MEM_SIZE);
-       mvebu_mbus_add_window("sram", KIRKWOOD_SRAM_PHYS_BASE,
-                             KIRKWOOD_SRAM_SIZE);
+       mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_NAND_TARGET,
+                                   KIRKWOOD_MBUS_NAND_ATTR,
+                                   KIRKWOOD_NAND_MEM_PHYS_BASE,
+                                   KIRKWOOD_NAND_MEM_SIZE);
+       mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_SRAM_TARGET,
+                                   KIRKWOOD_MBUS_SRAM_ATTR,
+                                   KIRKWOOD_SRAM_PHYS_BASE,
+                                   KIRKWOOD_SRAM_SIZE);
 }
 
 void __init kirkwood_l2_init(void)
@@ -697,6 +703,10 @@ void __init kirkwood_init(void)
         */
        writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
 
+       BUG_ON(mvebu_mbus_init("marvell,kirkwood-mbus",
+                       BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
+                       DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ));
+
        kirkwood_setup_wins();
 
        kirkwood_l2_init();
index fcf3ba6..1296de9 100644 (file)
@@ -59,119 +59,10 @@ void kirkwood_restart(enum reboot_mode, const char *);
 void kirkwood_clk_init(void);
 
 /* board init functions for boards not fully converted to fdt */
-#ifdef CONFIG_MACH_DREAMPLUG_DT
-void dreamplug_init(void);
+#ifdef CONFIG_MACH_MV88F6281GTW_GE_DT
+void mv88f6281gtw_ge_init(void);
 #else
-static inline void dreamplug_init(void) {};
-#endif
-#ifdef CONFIG_MACH_GURUPLUG_DT
-void guruplug_dt_init(void);
-#else
-static inline void guruplug_dt_init(void) {};
-#endif
-#ifdef CONFIG_MACH_SHEEVAPLUG_DT
-void sheevaplug_dt_init(void);
-#else
-static inline void sheevaplug_dt_init(void) {};
-#endif
-#ifdef CONFIG_MACH_TS219_DT
-void qnap_dt_ts219_init(void);
-#else
-static inline void qnap_dt_ts219_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT
-void dnskw_init(void);
-#else
-static inline void dnskw_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_ICONNECT_DT
-void iconnect_init(void);
-#else
-static inline void iconnect_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_IB62X0_DT
-void ib62x0_init(void);
-#else
-static inline void ib62x0_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_DOCKSTAR_DT
-void dockstar_dt_init(void);
-#else
-static inline void dockstar_dt_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_GOFLEXNET_DT
-void goflexnet_init(void);
-#else
-static inline void goflexnet_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_LSXL_DT
-void lsxl_init(void);
-#else
-static inline void lsxl_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_IOMEGA_IX2_200_DT
-void iomega_ix2_200_init(void);
-#else
-static inline void iomega_ix2_200_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_KM_KIRKWOOD_DT
-void km_kirkwood_init(void);
-#else
-static inline void km_kirkwood_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_DB88F628X_BP_DT
-void db88f628x_init(void);
-#else
-static inline void db88f628x_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_MPLCEC4_DT
-void mplcec4_init(void);
-#else
-static inline void mplcec4_init(void) {};
-#endif
-
-#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
-       defined(CONFIG_MACH_NETSPACE_V2_DT) || \
-       defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
-       defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \
-       defined(CONFIG_MACH_NETSPACE_MINI_V2_DT)
-void ns2_init(void);
-#else
-static inline void ns2_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
-void openblocks_a6_init(void);
-#else
-static inline void openblocks_a6_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_READYNAS_DT
-void netgear_readynas_init(void);
-#else
-static inline void netgear_readynas_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_TOPKICK_DT
-void usi_topkick_init(void);
-#else
-static inline void usi_topkick_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_CLOUDBOX_DT
-void cloudbox_init(void);
-#else
-static inline void cloudbox_init(void) {};
+static inline void mv88f6281gtw_ge_init(void) {};
 #endif
 
 /* early init functions not converted to fdt yet */
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c
deleted file mode 100644 (file)
index 060ccf9..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/dockstar-setup.c
- *
- * Seagate FreeAgent DockStar Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mtd_partition dockstar_nand_parts[] = {
-       {
-               .name = "u-boot",
-               .offset = 0,
-               .size = SZ_1M
-       }, {
-               .name = "uImage",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = SZ_4M
-       }, {
-               .name = "root",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = MTDPART_SIZ_FULL
-       },
-};
-
-static struct mv643xx_eth_platform_data dockstar_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct gpio_led dockstar_led_pins[] = {
-       {
-               .name                   = "dockstar:green:health",
-               .default_trigger        = "default-on",
-               .gpio                   = 46,
-               .active_low             = 1,
-       },
-       {
-               .name                   = "dockstar:orange:misc",
-               .default_trigger        = "none",
-               .gpio                   = 47,
-               .active_low             = 1,
-       },
-};
-
-static struct gpio_led_platform_data dockstar_led_data = {
-       .leds           = dockstar_led_pins,
-       .num_leds       = ARRAY_SIZE(dockstar_led_pins),
-};
-
-static struct platform_device dockstar_leds = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &dockstar_led_data,
-       }
-};
-
-static unsigned int dockstar_mpp_config[] __initdata = {
-       MPP29_GPIO,     /* USB Power Enable */
-       MPP46_GPIO,     /* LED green */
-       MPP47_GPIO,     /* LED orange */
-       0
-};
-
-static void __init dockstar_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_init();
-
-       /* setup gpio pin select */
-       kirkwood_mpp_conf(dockstar_mpp_config);
-
-       kirkwood_uart0_init();
-       kirkwood_nand_init(ARRAY_AND_SIZE(dockstar_nand_parts), 25);
-
-       if (gpio_request(29, "USB Power Enable") != 0 ||
-           gpio_direction_output(29, 1) != 0)
-               pr_err("can't set up GPIO 29 (USB Power Enable)\n");
-       kirkwood_ehci_init();
-
-       kirkwood_ge00_init(&dockstar_ge00_data);
-
-       platform_device_register(&dockstar_leds);
-}
-
-MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
-       .atag_offset    = 0x100,
-       .init_machine   = dockstar_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
deleted file mode 100644 (file)
index 08dd739..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/guruplug-setup.c
- *
- * Marvell GuruPlug Reference Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/partitions.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/mmc-mvsdio.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mtd_partition guruplug_nand_parts[] = {
-       {
-               .name = "u-boot",
-               .offset = 0,
-               .size = SZ_1M
-       }, {
-               .name = "uImage",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = SZ_4M
-       }, {
-               .name = "root",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = MTDPART_SIZ_FULL
-       },
-};
-
-static struct mv643xx_eth_platform_data guruplug_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data guruplug_ge01_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv_sata_platform_data guruplug_sata_data = {
-       .n_ports        = 1,
-};
-
-static struct mvsdio_platform_data guruplug_mvsdio_data = {
-       /* unfortunately the CD signal has not been connected */
-       .gpio_card_detect = -1,
-       .gpio_write_protect = -1,
-};
-
-static struct gpio_led guruplug_led_pins[] = {
-       {
-               .name                   = "guruplug:red:health",
-               .gpio                   = 46,
-               .active_low             = 1,
-       },
-       {
-               .name                   = "guruplug:green:health",
-               .gpio                   = 47,
-               .active_low             = 1,
-       },
-       {
-               .name                   = "guruplug:red:wmode",
-               .gpio                   = 48,
-               .active_low             = 1,
-       },
-       {
-               .name                   = "guruplug:green:wmode",
-               .gpio                   = 49,
-               .active_low             = 1,
-       },
-};
-
-static struct gpio_led_platform_data guruplug_led_data = {
-       .leds           = guruplug_led_pins,
-       .num_leds       = ARRAY_SIZE(guruplug_led_pins),
-};
-
-static struct platform_device guruplug_leds = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &guruplug_led_data,
-       }
-};
-
-static unsigned int guruplug_mpp_config[] __initdata = {
-       MPP46_GPIO,     /* M_RLED */
-       MPP47_GPIO,     /* M_GLED */
-       MPP48_GPIO,     /* B_RLED */
-       MPP49_GPIO,     /* B_GLED */
-       0
-};
-
-static void __init guruplug_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_init();
-       kirkwood_mpp_conf(guruplug_mpp_config);
-
-       kirkwood_uart0_init();
-       kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25);
-
-       kirkwood_ehci_init();
-       kirkwood_ge00_init(&guruplug_ge00_data);
-       kirkwood_ge01_init(&guruplug_ge01_data);
-       kirkwood_sata_init(&guruplug_sata_data);
-       kirkwood_sdio_init(&guruplug_mvsdio_data);
-
-       platform_device_register(&guruplug_leds);
-}
-
-MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
-       /* Maintainer: Siddarth Gore <gores@marvell.com> */
-       .atag_offset    = 0x100,
-       .init_machine   = guruplug_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
deleted file mode 100644 (file)
index ba384b9..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
- *
- * Marvell 88F6281 GTW GE Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
-#include <linux/irq.h>
-#include <linux/mtd/physmap.h>
-#include <linux/timer.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/ethtool.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <linux/input.h>
-#include <linux/gpio_keys.h>
-#include <linux/spi/flash.h>
-#include <linux/spi/spi.h>
-#include <net/dsa.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/pci.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_NONE,
-       .speed          = SPEED_1000,
-       .duplex         = DUPLEX_FULL,
-};
-
-static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
-       .port_names[0]  = "lan1",
-       .port_names[1]  = "lan2",
-       .port_names[2]  = "lan3",
-       .port_names[3]  = "lan4",
-       .port_names[4]  = "wan",
-       .port_names[5]  = "cpu",
-};
-
-static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
-       .nr_chips       = 1,
-       .chip           = &mv88f6281gtw_ge_switch_chip_data,
-};
-
-static const struct flash_platform_data mv88f6281gtw_ge_spi_slave_data = {
-       .type           = "mx25l12805d",
-};
-
-static struct spi_board_info __initdata mv88f6281gtw_ge_spi_slave_info[] = {
-       {
-               .modalias       = "m25p80",
-               .platform_data  = &mv88f6281gtw_ge_spi_slave_data,
-               .irq            = -1,
-               .max_speed_hz   = 50000000,
-               .bus_num        = 0,
-               .chip_select    = 0,
-       },
-};
-
-static struct gpio_keys_button mv88f6281gtw_ge_button_pins[] = {
-       {
-               .code           = KEY_RESTART,
-               .gpio           = 47,
-               .desc           = "SWR Button",
-               .active_low     = 1,
-       }, {
-               .code           = KEY_WPS_BUTTON,
-               .gpio           = 46,
-               .desc           = "WPS Button",
-               .active_low     = 1,
-       },
-};
-
-static struct gpio_keys_platform_data mv88f6281gtw_ge_button_data = {
-       .buttons        = mv88f6281gtw_ge_button_pins,
-       .nbuttons       = ARRAY_SIZE(mv88f6281gtw_ge_button_pins),
-};
-
-static struct platform_device mv88f6281gtw_ge_buttons = {
-       .name           = "gpio-keys",
-       .id             = -1,
-       .num_resources  = 0,
-       .dev            = {
-               .platform_data  = &mv88f6281gtw_ge_button_data,
-       },
-};
-
-static struct gpio_led mv88f6281gtw_ge_led_pins[] = {
-       {
-               .name           = "gtw:green:Status",
-               .gpio           = 20,
-               .active_low     = 0,
-       }, {
-               .name           = "gtw:red:Status",
-               .gpio           = 21,
-               .active_low     = 0,
-       }, {
-               .name           = "gtw:green:USB",
-               .gpio           = 12,
-               .active_low     = 0,
-       },
-};
-
-static struct gpio_led_platform_data mv88f6281gtw_ge_led_data = {
-       .leds           = mv88f6281gtw_ge_led_pins,
-       .num_leds       = ARRAY_SIZE(mv88f6281gtw_ge_led_pins),
-};
-
-static struct platform_device mv88f6281gtw_ge_leds = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &mv88f6281gtw_ge_led_data,
-       },
-};
-
-static unsigned int mv88f6281gtw_ge_mpp_config[] __initdata = {
-       MPP12_GPO,      /* Status#_USB pin  */
-       MPP20_GPIO,     /* Status#_GLED pin */
-       MPP21_GPIO,     /* Status#_RLED pin */
-       MPP46_GPIO,     /* WPS_Switch pin   */
-       MPP47_GPIO,     /* SW_Init pin      */
-       0
-};
-
-static void __init mv88f6281gtw_ge_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_init();
-       kirkwood_mpp_conf(mv88f6281gtw_ge_mpp_config);
-
-       kirkwood_ehci_init();
-       kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
-       kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
-       spi_register_board_info(mv88f6281gtw_ge_spi_slave_info,
-                               ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info));
-       kirkwood_spi_init();
-       kirkwood_uart0_init();
-       platform_device_register(&mv88f6281gtw_ge_leds);
-       platform_device_register(&mv88f6281gtw_ge_buttons);
-}
-
-static int __init mv88f6281gtw_ge_pci_init(void)
-{
-       if (machine_is_mv88f6281gtw_ge())
-               kirkwood_pcie_init(KW_PCIE0);
-
-       return 0;
-}
-subsys_initcall(mv88f6281gtw_ge_pci_init);
-
-MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
-       /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
-       .atag_offset    = 0x100,
-       .init_machine   = mv88f6281gtw_ge_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
deleted file mode 100644 (file)
index 3b70661..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/netspace_v2-setup.c
- *
- * LaCie Network Space v2 board setup
- *
- * Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
- * Copyright (C) 2009 Benoît Canet <benoit.canet@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.
- *
- * 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/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/input.h>
-#include <linux/gpio.h>
-#include <linux/gpio_keys.h>
-#include <linux/leds.h>
-#include <linux/gpio-fan.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/leds-kirkwood-ns2.h>
-#include "common.h"
-#include "mpp.h"
-#include "lacie_v2-common.h"
-
-/*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data netspace_v2_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
-};
-
-/*****************************************************************************
- * SATA
- ****************************************************************************/
-
-static struct mv_sata_platform_data netspace_v2_sata_data = {
-       .n_ports        = 2,
-};
-
-/*****************************************************************************
- * GPIO keys
- ****************************************************************************/
-
-#define NETSPACE_V2_PUSH_BUTTON                32
-
-static struct gpio_keys_button netspace_v2_buttons[] = {
-       [0] = {
-               .code           = KEY_POWER,
-               .gpio           = NETSPACE_V2_PUSH_BUTTON,
-               .desc           = "Power push button",
-               .active_low     = 0,
-       },
-};
-
-static struct gpio_keys_platform_data netspace_v2_button_data = {
-       .buttons        = netspace_v2_buttons,
-       .nbuttons       = ARRAY_SIZE(netspace_v2_buttons),
-};
-
-static struct platform_device netspace_v2_gpio_buttons = {
-       .name           = "gpio-keys",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &netspace_v2_button_data,
-       },
-};
-
-/*****************************************************************************
- * GPIO LEDs
- ****************************************************************************/
-
-#define NETSPACE_V2_GPIO_RED_LED       12
-
-static struct gpio_led netspace_v2_gpio_led_pins[] = {
-       {
-               .name   = "ns_v2:red:fail",
-               .gpio   = NETSPACE_V2_GPIO_RED_LED,
-       },
-};
-
-static struct gpio_led_platform_data netspace_v2_gpio_leds_data = {
-       .num_leds       = ARRAY_SIZE(netspace_v2_gpio_led_pins),
-       .leds           = netspace_v2_gpio_led_pins,
-};
-
-static struct platform_device netspace_v2_gpio_leds = {
-       .name           = "leds-gpio",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &netspace_v2_gpio_leds_data,
-       },
-};
-
-/*****************************************************************************
- * Dual-GPIO CPLD LEDs
- ****************************************************************************/
-
-#define NETSPACE_V2_GPIO_BLUE_LED_SLOW 29
-#define NETSPACE_V2_GPIO_BLUE_LED_CMD  30
-
-static struct ns2_led netspace_v2_led_pins[] = {
-       {
-               .name   = "ns_v2:blue:sata",
-               .cmd    = NETSPACE_V2_GPIO_BLUE_LED_CMD,
-               .slow   = NETSPACE_V2_GPIO_BLUE_LED_SLOW,
-       },
-};
-
-static struct ns2_led_platform_data netspace_v2_leds_data = {
-       .num_leds       = ARRAY_SIZE(netspace_v2_led_pins),
-       .leds           = netspace_v2_led_pins,
-};
-
-static struct platform_device netspace_v2_leds = {
-       .name           = "leds-ns2",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &netspace_v2_leds_data,
-       },
-};
-
-/*****************************************************************************
- * GPIO fan
- ****************************************************************************/
-
-/* Designed for fan 40x40x16: ADDA AD0412LB-D50 6000rpm@12v */
-static struct gpio_fan_speed netspace_max_v2_fan_speed[] = {
-       {    0,  0 },
-       { 1500, 15 },
-       { 1700, 14 },
-       { 1800, 13 },
-       { 2100, 12 },
-       { 3100, 11 },
-       { 3300, 10 },
-       { 4300,  9 },
-       { 5500,  8 },
-};
-
-static unsigned netspace_max_v2_fan_ctrl[] = { 22, 7, 33, 23 };
-
-static struct gpio_fan_alarm netspace_max_v2_fan_alarm = {
-       .gpio           = 25,
-       .active_low     = 1,
-};
-
-static struct gpio_fan_platform_data netspace_max_v2_fan_data = {
-       .num_ctrl       = ARRAY_SIZE(netspace_max_v2_fan_ctrl),
-       .ctrl           = netspace_max_v2_fan_ctrl,
-       .alarm          = &netspace_max_v2_fan_alarm,
-       .num_speed      = ARRAY_SIZE(netspace_max_v2_fan_speed),
-       .speed          = netspace_max_v2_fan_speed,
-};
-
-static struct platform_device netspace_max_v2_gpio_fan = {
-       .name   = "gpio-fan",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &netspace_max_v2_fan_data,
-       },
-};
-
-/*****************************************************************************
- * General Setup
- ****************************************************************************/
-
-static unsigned int netspace_v2_mpp_config[] __initdata = {
-       MPP0_SPI_SCn,
-       MPP1_SPI_MOSI,
-       MPP2_SPI_SCK,
-       MPP3_SPI_MISO,
-       MPP4_NF_IO6,
-       MPP5_NF_IO7,
-       MPP6_SYSRST_OUTn,
-       MPP7_GPO,               /* Fan speed (bit 1) */
-       MPP8_TW0_SDA,
-       MPP9_TW0_SCK,
-       MPP10_UART0_TXD,
-       MPP11_UART0_RXD,
-       MPP12_GPO,              /* Red led */
-       MPP14_GPIO,             /* USB fuse */
-       MPP16_GPIO,             /* SATA 0 power */
-       MPP17_GPIO,             /* SATA 1 power */
-       MPP18_NF_IO0,
-       MPP19_NF_IO1,
-       MPP20_SATA1_ACTn,
-       MPP21_SATA0_ACTn,
-       MPP22_GPIO,             /* Fan speed (bit 0) */
-       MPP23_GPIO,             /* Fan power */
-       MPP24_GPIO,             /* USB mode select */
-       MPP25_GPIO,             /* Fan rotation fail */
-       MPP26_GPIO,             /* USB device vbus */
-       MPP28_GPIO,             /* USB enable host vbus */
-       MPP29_GPIO,             /* Blue led (slow register) */
-       MPP30_GPIO,             /* Blue led (command register) */
-       MPP31_GPIO,             /* Board power off */
-       MPP32_GPIO,             /* Power button (0 = Released, 1 = Pushed) */
-       MPP33_GPO,              /* Fan speed (bit 2) */
-       0
-};
-
-#define NETSPACE_V2_GPIO_POWER_OFF     31
-
-static void netspace_v2_power_off(void)
-{
-       gpio_set_value(NETSPACE_V2_GPIO_POWER_OFF, 1);
-}
-
-static void __init netspace_v2_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_init();
-       kirkwood_mpp_conf(netspace_v2_mpp_config);
-
-       if (machine_is_netspace_max_v2())
-               lacie_v2_hdd_power_init(2);
-       else
-               lacie_v2_hdd_power_init(1);
-
-       kirkwood_ehci_init();
-       kirkwood_ge00_init(&netspace_v2_ge00_data);
-       kirkwood_sata_init(&netspace_v2_sata_data);
-       kirkwood_uart0_init();
-       lacie_v2_register_flash();
-       lacie_v2_register_i2c_devices();
-
-       platform_device_register(&netspace_v2_leds);
-       platform_device_register(&netspace_v2_gpio_leds);
-       platform_device_register(&netspace_v2_gpio_buttons);
-       if (machine_is_netspace_max_v2())
-               platform_device_register(&netspace_max_v2_gpio_fan);
-
-       if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 &&
-           gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0)
-               pm_power_off = netspace_v2_power_off;
-       else
-               pr_err("netspace_v2: failed to configure power-off GPIO\n");
-}
-
-#ifdef CONFIG_MACH_NETSPACE_V2
-MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
-       .atag_offset    = 0x100,
-       .init_machine   = netspace_v2_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_INETSPACE_V2
-MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
-       .atag_offset    = 0x100,
-       .init_machine   = netspace_v2_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_NETSPACE_MAX_V2
-MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
-       .atag_offset    = 0x100,
-       .init_machine   = netspace_v2_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
-#endif
index 6a6eb54..e5cf841 100644 (file)
@@ -158,7 +158,8 @@ static void __init openrd_init(void)
        kirkwood_mpp_conf(openrd_mpp_config);
 
        kirkwood_uart0_init();
-       kirkwood_nand_init(ARRAY_AND_SIZE(openrd_nand_parts), 25);
+       kirkwood_nand_init(openrd_nand_parts, ARRAY_SIZE(openrd_nand_parts),
+                          25);
 
        kirkwood_ehci_init();
 
index ddcb09f..12d86f3 100644 (file)
 #include <mach/bridge-regs.h>
 #include "common.h"
 
+/* These can go away once Kirkwood uses the mvebu-mbus DT binding */
+#define KIRKWOOD_MBUS_PCIE0_MEM_TARGET    0x4
+#define KIRKWOOD_MBUS_PCIE0_MEM_ATTR      0xe8
+#define KIRKWOOD_MBUS_PCIE0_IO_TARGET     0x4
+#define KIRKWOOD_MBUS_PCIE0_IO_ATTR       0xe0
+#define KIRKWOOD_MBUS_PCIE1_MEM_TARGET    0x4
+#define KIRKWOOD_MBUS_PCIE1_MEM_ATTR      0xd8
+#define KIRKWOOD_MBUS_PCIE1_IO_TARGET     0x4
+#define KIRKWOOD_MBUS_PCIE1_IO_ATTR       0xd0
+
 static void kirkwood_enable_pcie_clk(const char *port)
 {
        struct clk *clk;
@@ -254,26 +264,24 @@ static void __init add_pcie_port(int index, void __iomem *base)
 
 void __init kirkwood_pcie_init(unsigned int portmask)
 {
-       mvebu_mbus_add_window_remap_flags("pcie0.0",
+       mvebu_mbus_add_window_remap_by_id(KIRKWOOD_MBUS_PCIE0_IO_TARGET,
+                                         KIRKWOOD_MBUS_PCIE0_IO_ATTR,
                                          KIRKWOOD_PCIE_IO_PHYS_BASE,
                                          KIRKWOOD_PCIE_IO_SIZE,
-                                         KIRKWOOD_PCIE_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pcie0.0",
-                                         KIRKWOOD_PCIE_MEM_PHYS_BASE,
-                                         KIRKWOOD_PCIE_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
-       mvebu_mbus_add_window_remap_flags("pcie1.0",
+                                         KIRKWOOD_PCIE_IO_BUS_BASE);
+       mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_PCIE0_MEM_TARGET,
+                                   KIRKWOOD_MBUS_PCIE0_MEM_ATTR,
+                                   KIRKWOOD_PCIE_MEM_PHYS_BASE,
+                                   KIRKWOOD_PCIE_MEM_SIZE);
+       mvebu_mbus_add_window_remap_by_id(KIRKWOOD_MBUS_PCIE1_IO_TARGET,
+                                         KIRKWOOD_MBUS_PCIE1_IO_ATTR,
                                          KIRKWOOD_PCIE1_IO_PHYS_BASE,
                                          KIRKWOOD_PCIE1_IO_SIZE,
-                                         KIRKWOOD_PCIE1_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pcie1.0",
-                                         KIRKWOOD_PCIE1_MEM_PHYS_BASE,
-                                         KIRKWOOD_PCIE1_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
+                                         KIRKWOOD_PCIE1_IO_BUS_BASE);
+       mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_PCIE1_MEM_TARGET,
+                                   KIRKWOOD_MBUS_PCIE1_MEM_ATTR,
+                                   KIRKWOOD_PCIE1_MEM_PHYS_BASE,
+                                   KIRKWOOD_PCIE1_MEM_SIZE);
 
        vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
 
index d242231..5154bd2 100644 (file)
@@ -87,7 +87,9 @@ static void __init rd88f6281_init(void)
        kirkwood_init();
        kirkwood_mpp_conf(rd88f6281_mpp_config);
 
-       kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
+       kirkwood_nand_init(rd88f6281_nand_parts,
+                          ARRAY_SIZE(rd88f6281_nand_parts),
+                          25);
        kirkwood_ehci_init();
 
        kirkwood_ge00_init(&rd88f6281_ge00_data);
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
deleted file mode 100644 (file)
index 55b68fa..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/sheevaplug-setup.c
- *
- * Marvell SheevaPlug Reference Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/mmc-mvsdio.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mtd_partition sheevaplug_nand_parts[] = {
-       {
-               .name = "u-boot",
-               .offset = 0,
-               .size = SZ_1M
-       }, {
-               .name = "uImage",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = SZ_4M
-       }, {
-               .name = "root",
-               .offset = MTDPART_OFS_NXTBLK,
-               .size = MTDPART_SIZ_FULL
-       },
-};
-
-static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv_sata_platform_data sheeva_esata_sata_data = {
-       .n_ports        = 2,
-};
-
-static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
-       /* unfortunately the CD signal has not been connected */
-};
-
-static struct mvsdio_platform_data sheeva_esata_mvsdio_data = {
-       .gpio_write_protect = 44, /* MPP44 used as SD write protect */
-       .gpio_card_detect = 47,   /* MPP47 used as SD card detect */
-};
-
-static struct gpio_led sheevaplug_led_pins[] = {
-       {
-               .name                   = "plug:red:misc",
-               .default_trigger        = "none",
-               .gpio                   = 46,
-               .active_low             = 1,
-       },
-       {
-               .name                   = "plug:green:health",
-               .default_trigger        = "default-on",
-               .gpio                   = 49,
-               .active_low             = 1,
-       },
-};
-
-static struct gpio_led_platform_data sheevaplug_led_data = {
-       .leds           = sheevaplug_led_pins,
-       .num_leds       = ARRAY_SIZE(sheevaplug_led_pins),
-};
-
-static struct platform_device sheevaplug_leds = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &sheevaplug_led_data,
-       }
-};
-
-static unsigned int sheevaplug_mpp_config[] __initdata = {
-       MPP29_GPIO,     /* USB Power Enable */
-       MPP46_GPIO,     /* LED Red */
-       MPP49_GPIO,     /* LED */
-       0
-};
-
-static unsigned int sheeva_esata_mpp_config[] __initdata = {
-       MPP29_GPIO,     /* USB Power Enable */
-       MPP44_GPIO,     /* SD Write Protect */
-       MPP47_GPIO,     /* SD Card Detect */
-       MPP49_GPIO,     /* LED Green */
-       0
-};
-
-static void __init sheevaplug_init(void)
-{
-       /*
-        * Basic setup. Needs to be called early.
-        */
-       kirkwood_init();
-
-       /* setup gpio pin select */
-       if (machine_is_esata_sheevaplug())
-               kirkwood_mpp_conf(sheeva_esata_mpp_config);
-       else
-               kirkwood_mpp_conf(sheevaplug_mpp_config);
-
-       kirkwood_uart0_init();
-       kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
-
-       if (gpio_request(29, "USB Power Enable") != 0 ||
-           gpio_direction_output(29, 1) != 0)
-               pr_err("can't set up GPIO 29 (USB Power Enable)\n");
-       kirkwood_ehci_init();
-
-       kirkwood_ge00_init(&sheevaplug_ge00_data);
-
-       /* honor lower power consumption for plugs with out eSATA */
-       if (machine_is_esata_sheevaplug())
-               kirkwood_sata_init(&sheeva_esata_sata_data);
-
-       /* enable sd wp and sd cd on plugs with esata */
-       if (machine_is_esata_sheevaplug())
-               kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
-       else
-               kirkwood_sdio_init(&sheevaplug_mvsdio_data);
-
-       platform_device_register(&sheevaplug_leds);
-}
-
-#ifdef CONFIG_MACH_SHEEVAPLUG
-MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
-       /* Maintainer: shadi Ammouri <shadi@marvell.com> */
-       .atag_offset    = 0x100,
-       .init_machine   = sheevaplug_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_ESATA_SHEEVAPLUG
-MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
-       .atag_offset    = 0x100,
-       .init_machine   = sheevaplug_init,
-       .map_io         = kirkwood_map_io,
-       .init_early     = kirkwood_init_early,
-       .init_irq       = kirkwood_init_irq,
-       .init_time      = kirkwood_timer_init,
-       .restart        = kirkwood_restart,
-MACHINE_END
-#endif
index 456d638..9f9c044 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 #include <linux/i2c-gpio.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
index 8483906..7022329 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/onenand.h>
 #include <linux/interrupt.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/gpio.h>
 #include <linux/gpio-pxa.h>
 #include <linux/mfd/88pm860x.h>
index d257ff4..d872634 100644 (file)
@@ -1,17 +1,16 @@
-obj-y += io.o timer.o
+obj-y += timer.o
 obj-y += clock.o
 
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
-obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o
 
 obj-$(CONFIG_ARCH_MSM7X00A) += irq.o
 obj-$(CONFIG_ARCH_QSD8X50) += sirc.o
 
 obj-$(CONFIG_MSM_PROC_COMM) += proc_comm.o clock-pcom.o vreg.o
 
-obj-$(CONFIG_ARCH_MSM7X00A) += dma.o
-obj-$(CONFIG_ARCH_MSM7X30) += dma.o
-obj-$(CONFIG_ARCH_QSD8X50) += dma.o
+obj-$(CONFIG_ARCH_MSM7X00A) += dma.o io.o
+obj-$(CONFIG_ARCH_MSM7X30) += dma.o io.o
+obj-$(CONFIG_ARCH_QSD8X50) += dma.o io.o
 
 obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
 obj-$(CONFIG_MSM_SMD) += last_radio_log.o
index 492f5cd..c294689 100644 (file)
@@ -15,8 +15,8 @@
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 
-#include <mach/board.h>
 #include "common.h"
 
 static void __init msm8x60_init_late(void)
@@ -42,9 +42,7 @@ static const char *msm8x60_fluid_match[] __initdata = {
 
 DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
        .smp = smp_ops(msm_smp_ops),
-       .map_io = msm_map_msm8x60_io,
        .init_machine = msm8x60_dt_init,
        .init_late = msm8x60_init_late,
-       .init_time      = msm_dt_timer_init,
        .dt_compat = msm8x60_fluid_match,
 MACHINE_END
index bb55309..d4ca52c 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 
 #include "common.h"
 
@@ -29,8 +30,6 @@ static const char * const msm8960_dt_match[] __initconst = {
 
 DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)")
        .smp = smp_ops(msm_smp_ops),
-       .map_io = msm_map_msm8960_io,
-       .init_time      = msm_dt_timer_init,
        .init_machine = msm_dt_init,
        .dt_compat = msm8960_dt_match,
 MACHINE_END
index 803651a..a775298 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/setup.h>
 
 #include <mach/irqs.h>
-#include <mach/board.h>
 #include <mach/msm_iomap.h>
 
 #include <linux/mtd/nand.h>
index 30c3496..7d9981c 100644 (file)
 #include <asm/mach/map.h>
 #include <asm/setup.h>
 
-#include <mach/board.h>
 #include <mach/hardware.h>
 
 #include "board-mahimahi.h"
 #include "devices.h"
 #include "proc_comm.h"
+#include "common.h"
 
 static uint debug_uart;
 
index db3d8c0..f9af5a4 100644 (file)
@@ -30,7 +30,6 @@
 #include <asm/memory.h>
 #include <asm/setup.h>
 
-#include <mach/board.h>
 #include <mach/msm_iomap.h>
 #include <mach/dma.h>
 
index f14a73d..5f933bc 100644 (file)
@@ -28,7 +28,6 @@
 #include <asm/io.h>
 #include <asm/setup.h>
 
-#include <mach/board.h>
 #include <mach/irqs.h>
 #include <mach/sirc.h>
 #include <mach/vreg.h>
index 7073011..3276051 100644 (file)
@@ -28,7 +28,6 @@
 #include <asm/mach/map.h>
 #include <asm/mach/flash.h>
 #include <mach/vreg.h>
-#include <mach/board.h>
 
 #include <asm/io.h>
 #include <asm/delay.h>
@@ -41,6 +40,7 @@
 #include "board-sapphire.h"
 #include "proc_comm.h"
 #include "devices.h"
+#include "common.h"
 
 void msm_init_irq(void);
 void msm_init_gpio(void);
index 64a46eb..ccf6621 100644 (file)
@@ -25,7 +25,6 @@
 #include <asm/mach/map.h>
 #include <asm/setup.h>
 
-#include <mach/board.h>
 #include <mach/hardware.h>
 #include <mach/msm_iomap.h>
 
index 651851c..b2379ed 100644 (file)
@@ -4,7 +4,7 @@
 #ifndef __ARCH_ARM_MACH_MSM_BOARD_TROUT_H
 #define __ARCH_ARM_MACH_MSM_BOARD_TROUT_H
 
-#include <mach/board.h>
+#include "common.h"
 
 #define MSM_SMI_BASE           0x00000000
 #define MSM_SMI_SIZE           0x00800000
index 421cf77..33c7725 100644 (file)
 
 extern void msm7x01_timer_init(void);
 extern void msm7x30_timer_init(void);
-extern void msm_dt_timer_init(void);
 extern void qsd8x50_timer_init(void);
 
 extern void msm_map_common_io(void);
 extern void msm_map_msm7x30_io(void);
-extern void msm_map_msm8x60_io(void);
-extern void msm_map_msm8960_io(void);
 extern void msm_map_qsd8x50_io(void);
 
 extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
@@ -29,4 +26,19 @@ extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
 extern struct smp_operations msm_smp_ops;
 extern void msm_cpu_die(unsigned int cpu);
 
+struct msm_mmc_platform_data;
+
+extern void msm_add_devices(void);
+extern void msm_init_irq(void);
+extern void msm_init_gpio(void);
+extern int msm_add_sdcc(unsigned int controller,
+                       struct msm_mmc_platform_data *plat,
+                       unsigned int stat_irq, unsigned long stat_irq_flags);
+
+#if defined(CONFIG_MSM_SMD) && defined(CONFIG_DEBUG_FS)
+extern int smd_debugfs_init(void);
+#else
+static inline int smd_debugfs_init(void) { return 0; }
+#endif
+
 #endif
diff --git a/arch/arm/mach-msm/devices-iommu.c b/arch/arm/mach-msm/devices-iommu.c
deleted file mode 100644 (file)
index 0fb7a17..0000000
+++ /dev/null
@@ -1,912 +0,0 @@
-/* Copyright (c) 2010-2011, Code Aurora Forum. 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.
- *
- * 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/platform_device.h>
-#include <linux/bootmem.h>
-#include <linux/module.h>
-#include <mach/irqs.h>
-#include <mach/iommu.h>
-
-static struct resource msm_iommu_jpegd_resources[] = {
-       {
-               .start = 0x07300000,
-               .end   = 0x07300000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_JPEGD_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_JPEGD_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_JPEGD_CB_SC_SECURE_IRQ,
-               .end   = SMMU_JPEGD_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_vpe_resources[] = {
-       {
-               .start = 0x07400000,
-               .end   = 0x07400000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_VPE_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_VPE_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_VPE_CB_SC_SECURE_IRQ,
-               .end   = SMMU_VPE_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_mdp0_resources[] = {
-       {
-               .start = 0x07500000,
-               .end   = 0x07500000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_MDP0_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_MDP0_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_MDP0_CB_SC_SECURE_IRQ,
-               .end   = SMMU_MDP0_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_mdp1_resources[] = {
-       {
-               .start = 0x07600000,
-               .end   = 0x07600000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_MDP1_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_MDP1_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_MDP1_CB_SC_SECURE_IRQ,
-               .end   = SMMU_MDP1_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_rot_resources[] = {
-       {
-               .start = 0x07700000,
-               .end   = 0x07700000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_ROT_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_ROT_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_ROT_CB_SC_SECURE_IRQ,
-               .end   = SMMU_ROT_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_ijpeg_resources[] = {
-       {
-               .start = 0x07800000,
-               .end   = 0x07800000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_IJPEG_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_IJPEG_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_IJPEG_CB_SC_SECURE_IRQ,
-               .end   = SMMU_IJPEG_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_vfe_resources[] = {
-       {
-               .start = 0x07900000,
-               .end   = 0x07900000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_VFE_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_VFE_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_VFE_CB_SC_SECURE_IRQ,
-               .end   = SMMU_VFE_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_vcodec_a_resources[] = {
-       {
-               .start = 0x07A00000,
-               .end   = 0x07A00000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_VCODEC_A_CB_SC_SECURE_IRQ,
-               .end   = SMMU_VCODEC_A_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_vcodec_b_resources[] = {
-       {
-               .start = 0x07B00000,
-               .end   = 0x07B00000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_VCODEC_B_CB_SC_SECURE_IRQ,
-               .end   = SMMU_VCODEC_B_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_gfx3d_resources[] = {
-       {
-               .start = 0x07C00000,
-               .end   = 0x07C00000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_GFX3D_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_GFX3D_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_GFX3D_CB_SC_SECURE_IRQ,
-               .end   = SMMU_GFX3D_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_gfx2d0_resources[] = {
-       {
-               .start = 0x07D00000,
-               .end   = 0x07D00000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_GFX2D0_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_GFX2D0_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_GFX2D0_CB_SC_SECURE_IRQ,
-               .end   = SMMU_GFX2D0_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct resource msm_iommu_gfx2d1_resources[] = {
-       {
-               .start = 0x07E00000,
-               .end   = 0x07E00000 + SZ_1M - 1,
-               .name  = "physbase",
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .name = "nonsecure_irq",
-               .start = SMMU_GFX2D1_CB_SC_NON_SECURE_IRQ,
-               .end   = SMMU_GFX2D1_CB_SC_NON_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .name = "secure_irq",
-               .start = SMMU_GFX2D1_CB_SC_SECURE_IRQ,
-               .end   = SMMU_GFX2D1_CB_SC_SECURE_IRQ,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device msm_root_iommu_dev = {
-       .name = "msm_iommu",
-       .id = -1,
-};
-
-static struct msm_iommu_dev jpegd_iommu = {
-       .name = "jpegd",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev vpe_iommu = {
-       .name = "vpe",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev mdp0_iommu = {
-       .name = "mdp0",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev mdp1_iommu = {
-       .name = "mdp1",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev rot_iommu = {
-       .name = "rot",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev ijpeg_iommu = {
-       .name = "ijpeg",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev vfe_iommu = {
-       .name = "vfe",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev vcodec_a_iommu = {
-       .name = "vcodec_a",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev vcodec_b_iommu = {
-       .name = "vcodec_b",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev gfx3d_iommu = {
-       .name = "gfx3d",
-       .ncb = 3,
-};
-
-static struct msm_iommu_dev gfx2d0_iommu = {
-       .name = "gfx2d0",
-       .ncb = 2,
-};
-
-static struct msm_iommu_dev gfx2d1_iommu = {
-       .name = "gfx2d1",
-       .ncb = 2,
-};
-
-static struct platform_device msm_device_iommu_jpegd = {
-       .name = "msm_iommu",
-       .id = 0,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_jpegd_resources),
-       .resource = msm_iommu_jpegd_resources,
-};
-
-static struct platform_device msm_device_iommu_vpe = {
-       .name = "msm_iommu",
-       .id = 1,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_vpe_resources),
-       .resource = msm_iommu_vpe_resources,
-};
-
-static struct platform_device msm_device_iommu_mdp0 = {
-       .name = "msm_iommu",
-       .id = 2,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_mdp0_resources),
-       .resource = msm_iommu_mdp0_resources,
-};
-
-static struct platform_device msm_device_iommu_mdp1 = {
-       .name = "msm_iommu",
-       .id = 3,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_mdp1_resources),
-       .resource = msm_iommu_mdp1_resources,
-};
-
-static struct platform_device msm_device_iommu_rot = {
-       .name = "msm_iommu",
-       .id = 4,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_rot_resources),
-       .resource = msm_iommu_rot_resources,
-};
-
-static struct platform_device msm_device_iommu_ijpeg = {
-       .name = "msm_iommu",
-       .id = 5,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_ijpeg_resources),
-       .resource = msm_iommu_ijpeg_resources,
-};
-
-static struct platform_device msm_device_iommu_vfe = {
-       .name = "msm_iommu",
-       .id = 6,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_vfe_resources),
-       .resource = msm_iommu_vfe_resources,
-};
-
-static struct platform_device msm_device_iommu_vcodec_a = {
-       .name = "msm_iommu",
-       .id = 7,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_vcodec_a_resources),
-       .resource = msm_iommu_vcodec_a_resources,
-};
-
-static struct platform_device msm_device_iommu_vcodec_b = {
-       .name = "msm_iommu",
-       .id = 8,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_vcodec_b_resources),
-       .resource = msm_iommu_vcodec_b_resources,
-};
-
-static struct platform_device msm_device_iommu_gfx3d = {
-       .name = "msm_iommu",
-       .id = 9,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_gfx3d_resources),
-       .resource = msm_iommu_gfx3d_resources,
-};
-
-static struct platform_device msm_device_iommu_gfx2d0 = {
-       .name = "msm_iommu",
-       .id = 10,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_gfx2d0_resources),
-       .resource = msm_iommu_gfx2d0_resources,
-};
-
-struct platform_device msm_device_iommu_gfx2d1 = {
-       .name = "msm_iommu",
-       .id = 11,
-       .dev = {
-               .parent = &msm_root_iommu_dev.dev,
-       },
-       .num_resources = ARRAY_SIZE(msm_iommu_gfx2d1_resources),
-       .resource = msm_iommu_gfx2d1_resources,
-};
-
-static struct msm_iommu_ctx_dev jpegd_src_ctx = {
-       .name = "jpegd_src",
-       .num = 0,
-       .mids = {0, -1}
-};
-
-static struct msm_iommu_ctx_dev jpegd_dst_ctx = {
-       .name = "jpegd_dst",
-       .num = 1,
-       .mids = {1, -1}
-};
-
-static struct msm_iommu_ctx_dev vpe_src_ctx = {
-       .name = "vpe_src",
-       .num = 0,
-       .mids = {0, -1}
-};
-
-static struct msm_iommu_ctx_dev vpe_dst_ctx = {
-       .name = "vpe_dst",
-       .num = 1,
-       .mids = {1, -1}
-};
-
-static struct msm_iommu_ctx_dev mdp_vg1_ctx = {
-       .name = "mdp_vg1",
-       .num = 0,
-       .mids = {0, 2, -1}
-};
-
-static struct msm_iommu_ctx_dev mdp_rgb1_ctx = {
-       .name = "mdp_rgb1",
-       .num = 1,
-       .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1}
-};
-
-static struct msm_iommu_ctx_dev mdp_vg2_ctx = {
-       .name = "mdp_vg2",
-       .num = 0,
-       .mids = {0, 2, -1}
-};
-
-static struct msm_iommu_ctx_dev mdp_rgb2_ctx = {
-       .name = "mdp_rgb2",
-       .num = 1,
-       .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1}
-};
-
-static struct msm_iommu_ctx_dev rot_src_ctx = {
-       .name = "rot_src",
-       .num = 0,
-       .mids = {0, -1}
-};
-
-static struct msm_iommu_ctx_dev rot_dst_ctx = {
-       .name = "rot_dst",
-       .num = 1,
-       .mids = {1, -1}
-};
-
-static struct msm_iommu_ctx_dev ijpeg_src_ctx = {
-       .name = "ijpeg_src",
-       .num = 0,
-       .mids = {0, -1}
-};
-
-static struct msm_iommu_ctx_dev ijpeg_dst_ctx = {
-       .name = "ijpeg_dst",
-       .num = 1,
-       .mids = {1, -1}
-};
-
-static struct msm_iommu_ctx_dev vfe_imgwr_ctx = {
-       .name = "vfe_imgwr",
-       .num = 0,
-       .mids = {2, 3, 4, 5, 6, 7, 8, -1}
-};
-
-static struct msm_iommu_ctx_dev vfe_misc_ctx = {
-       .name = "vfe_misc",
-       .num = 1,
-       .mids = {0, 1, 9, -1}
-};
-
-static struct msm_iommu_ctx_dev vcodec_a_stream_ctx = {
-       .name = "vcodec_a_stream",
-       .num = 0,
-       .mids = {2, 5, -1}
-};
-
-static struct msm_iommu_ctx_dev vcodec_a_mm1_ctx = {
-       .name = "vcodec_a_mm1",
-       .num = 1,
-       .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}
-};
-
-static struct msm_iommu_ctx_dev vcodec_b_mm2_ctx = {
-       .name = "vcodec_b_mm2",
-       .num = 0,
-       .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}
-};
-
-static struct msm_iommu_ctx_dev gfx3d_user_ctx = {
-       .name = "gfx3d_user",
-       .num = 0,
-       .mids = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}
-};
-
-static struct msm_iommu_ctx_dev gfx3d_priv_ctx = {
-       .name = "gfx3d_priv",
-       .num = 1,
-       .mids = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
-                31, -1}
-};
-
-static struct msm_iommu_ctx_dev gfx2d0_2d0_ctx = {
-       .name = "gfx2d0_2d0",
-       .num = 0,
-       .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1}
-};
-
-static struct msm_iommu_ctx_dev gfx2d1_2d1_ctx = {
-       .name = "gfx2d1_2d1",
-       .num = 0,
-       .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1}
-};
-
-static struct platform_device msm_device_jpegd_src_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 0,
-       .dev = {
-               .parent = &msm_device_iommu_jpegd.dev,
-       },
-};
-
-static struct platform_device msm_device_jpegd_dst_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 1,
-       .dev = {
-               .parent = &msm_device_iommu_jpegd.dev,
-       },
-};
-
-static struct platform_device msm_device_vpe_src_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 2,
-       .dev = {
-               .parent = &msm_device_iommu_vpe.dev,
-       },
-};
-
-static struct platform_device msm_device_vpe_dst_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 3,
-       .dev = {
-               .parent = &msm_device_iommu_vpe.dev,
-       },
-};
-
-static struct platform_device msm_device_mdp_vg1_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 4,
-       .dev = {
-               .parent = &msm_device_iommu_mdp0.dev,
-       },
-};
-
-static struct platform_device msm_device_mdp_rgb1_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 5,
-       .dev = {
-               .parent = &msm_device_iommu_mdp0.dev,
-       },
-};
-
-static struct platform_device msm_device_mdp_vg2_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 6,
-       .dev = {
-               .parent = &msm_device_iommu_mdp1.dev,
-       },
-};
-
-static struct platform_device msm_device_mdp_rgb2_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 7,
-       .dev = {
-               .parent = &msm_device_iommu_mdp1.dev,
-       },
-};
-
-static struct platform_device msm_device_rot_src_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 8,
-       .dev = {
-               .parent = &msm_device_iommu_rot.dev,
-       },
-};
-
-static struct platform_device msm_device_rot_dst_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 9,
-       .dev = {
-               .parent = &msm_device_iommu_rot.dev,
-       },
-};
-
-static struct platform_device msm_device_ijpeg_src_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 10,
-       .dev = {
-               .parent = &msm_device_iommu_ijpeg.dev,
-       },
-};
-
-static struct platform_device msm_device_ijpeg_dst_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 11,
-       .dev = {
-               .parent = &msm_device_iommu_ijpeg.dev,
-       },
-};
-
-static struct platform_device msm_device_vfe_imgwr_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 12,
-       .dev = {
-               .parent = &msm_device_iommu_vfe.dev,
-       },
-};
-
-static struct platform_device msm_device_vfe_misc_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 13,
-       .dev = {
-               .parent = &msm_device_iommu_vfe.dev,
-       },
-};
-
-static struct platform_device msm_device_vcodec_a_stream_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 14,
-       .dev = {
-               .parent = &msm_device_iommu_vcodec_a.dev,
-       },
-};
-
-static struct platform_device msm_device_vcodec_a_mm1_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 15,
-       .dev = {
-               .parent = &msm_device_iommu_vcodec_a.dev,
-       },
-};
-
-static struct platform_device msm_device_vcodec_b_mm2_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 16,
-       .dev = {
-               .parent = &msm_device_iommu_vcodec_b.dev,
-       },
-};
-
-static struct platform_device msm_device_gfx3d_user_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 17,
-       .dev = {
-               .parent = &msm_device_iommu_gfx3d.dev,
-       },
-};
-
-static struct platform_device msm_device_gfx3d_priv_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 18,
-       .dev = {
-               .parent = &msm_device_iommu_gfx3d.dev,
-       },
-};
-
-static struct platform_device msm_device_gfx2d0_2d0_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 19,
-       .dev = {
-               .parent = &msm_device_iommu_gfx2d0.dev,
-       },
-};
-
-static struct platform_device msm_device_gfx2d1_2d1_ctx = {
-       .name = "msm_iommu_ctx",
-       .id = 20,
-       .dev = {
-               .parent = &msm_device_iommu_gfx2d1.dev,
-       },
-};
-
-static struct platform_device *msm_iommu_devs[] = {
-       &msm_device_iommu_jpegd,
-       &msm_device_iommu_vpe,
-       &msm_device_iommu_mdp0,
-       &msm_device_iommu_mdp1,
-       &msm_device_iommu_rot,
-       &msm_device_iommu_ijpeg,
-       &msm_device_iommu_vfe,
-       &msm_device_iommu_vcodec_a,
-       &msm_device_iommu_vcodec_b,
-       &msm_device_iommu_gfx3d,
-       &msm_device_iommu_gfx2d0,
-       &msm_device_iommu_gfx2d1,
-};
-
-static struct msm_iommu_dev *msm_iommu_data[] = {
-       &jpegd_iommu,
-       &vpe_iommu,
-       &mdp0_iommu,
-       &mdp1_iommu,
-       &rot_iommu,
-       &ijpeg_iommu,
-       &vfe_iommu,
-       &vcodec_a_iommu,
-       &vcodec_b_iommu,
-       &gfx3d_iommu,
-       &gfx2d0_iommu,
-       &gfx2d1_iommu,
-};
-
-static struct platform_device *msm_iommu_ctx_devs[] = {
-       &msm_device_jpegd_src_ctx,
-       &msm_device_jpegd_dst_ctx,
-       &msm_device_vpe_src_ctx,
-       &msm_device_vpe_dst_ctx,
-       &msm_device_mdp_vg1_ctx,
-       &msm_device_mdp_rgb1_ctx,
-       &msm_device_mdp_vg2_ctx,
-       &msm_device_mdp_rgb2_ctx,
-       &msm_device_rot_src_ctx,
-       &msm_device_rot_dst_ctx,
-       &msm_device_ijpeg_src_ctx,
-       &msm_device_ijpeg_dst_ctx,
-       &msm_device_vfe_imgwr_ctx,
-       &msm_device_vfe_misc_ctx,
-       &msm_device_vcodec_a_stream_ctx,
-       &msm_device_vcodec_a_mm1_ctx,
-       &msm_device_vcodec_b_mm2_ctx,
-       &msm_device_gfx3d_user_ctx,
-       &msm_device_gfx3d_priv_ctx,
-       &msm_device_gfx2d0_2d0_ctx,
-       &msm_device_gfx2d1_2d1_ctx,
-};
-
-static struct msm_iommu_ctx_dev *msm_iommu_ctx_data[] = {
-       &jpegd_src_ctx,
-       &jpegd_dst_ctx,
-       &vpe_src_ctx,
-       &vpe_dst_ctx,
-       &mdp_vg1_ctx,
-       &mdp_rgb1_ctx,
-       &mdp_vg2_ctx,
-       &mdp_rgb2_ctx,
-       &rot_src_ctx,
-       &rot_dst_ctx,
-       &ijpeg_src_ctx,
-       &ijpeg_dst_ctx,
-       &vfe_imgwr_ctx,
-       &vfe_misc_ctx,
-       &vcodec_a_stream_ctx,
-       &vcodec_a_mm1_ctx,
-       &vcodec_b_mm2_ctx,
-       &gfx3d_user_ctx,
-       &gfx3d_priv_ctx,
-       &gfx2d0_2d0_ctx,
-       &gfx2d1_2d1_ctx,
-};
-
-static int __init msm8x60_iommu_init(void)
-{
-       int ret, i;
-
-       ret = platform_device_register(&msm_root_iommu_dev);
-       if (ret != 0) {
-               pr_err("Failed to register root IOMMU device!\n");
-               goto failure;
-       }
-
-       for (i = 0; i < ARRAY_SIZE(msm_iommu_devs); i++) {
-               ret = platform_device_add_data(msm_iommu_devs[i],
-                                              msm_iommu_data[i],
-                                              sizeof(struct msm_iommu_dev));
-               if (ret != 0) {
-                       pr_err("platform_device_add_data failed, "
-                              "i = %d\n", i);
-                       goto failure_unwind;
-               }
-
-               ret = platform_device_register(msm_iommu_devs[i]);
-
-               if (ret != 0) {
-                       pr_err("platform_device_register iommu failed, "
-                              "i = %d\n", i);
-                       goto failure_unwind;
-               }
-       }
-
-       for (i = 0; i < ARRAY_SIZE(msm_iommu_ctx_devs); i++) {
-               ret = platform_device_add_data(msm_iommu_ctx_devs[i],
-                                              msm_iommu_ctx_data[i],
-                                              sizeof(*msm_iommu_ctx_devs[i]));
-               if (ret != 0) {
-                       pr_err("platform_device_add_data iommu failed, "
-                              "i = %d\n", i);
-                       goto failure_unwind2;
-               }
-
-               ret = platform_device_register(msm_iommu_ctx_devs[i]);
-               if (ret != 0) {
-                       pr_err("platform_device_register ctx failed, "
-                              "i = %d\n", i);
-                       goto failure_unwind2;
-               }
-       }
-       return 0;
-
-failure_unwind2:
-       while (--i >= 0)
-               platform_device_unregister(msm_iommu_ctx_devs[i]);
-failure_unwind:
-       while (--i >= 0)
-               platform_device_unregister(msm_iommu_devs[i]);
-
-       platform_device_unregister(&msm_root_iommu_dev);
-failure:
-       return ret;
-}
-
-static void __exit msm8x60_iommu_exit(void)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(msm_iommu_ctx_devs); i++)
-               platform_device_unregister(msm_iommu_ctx_devs[i]);
-
-       for (i = 0; i < ARRAY_SIZE(msm_iommu_devs); ++i)
-               platform_device_unregister(msm_iommu_devs[i]);
-
-       platform_device_unregister(&msm_root_iommu_dev);
-}
-
-subsys_initcall(msm8x60_iommu_init);
-module_exit(msm8x60_iommu_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>");
index 14e2869..c15ea8a 100644 (file)
 #include <mach/irqs.h>
 #include <mach/msm_iomap.h>
 #include <mach/dma.h>
-#include <mach/board.h>
 
 #include "devices.h"
 #include "smd_private.h"
+#include "common.h"
 
 #include <asm/mach/flash.h>
 
index 2ed89b2..9e1e9ce 100644 (file)
@@ -21,9 +21,9 @@
 #include <mach/irqs.h>
 #include <mach/msm_iomap.h>
 #include <mach/dma.h>
-#include <mach/board.h>
 
 #include "devices.h"
+#include "common.h"
 
 #include <asm/mach/flash.h>
 
diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h
deleted file mode 100644 (file)
index c34e246..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* arch/arm/mach-msm/include/mach/board.h
- *
- * Copyright (C) 2007 Google, Inc.
- * Author: Brian Swetland <swetland@google.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.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_BOARD_H
-#define __ASM_ARCH_MSM_BOARD_H
-
-#include <linux/types.h>
-#include <linux/platform_data/mmc-msm_sdcc.h>
-
-/* common init routines for use by arch/arm/mach-msm/board-*.c */
-
-void __init msm_add_devices(void);
-void __init msm_init_irq(void);
-void __init msm_init_gpio(void);
-int __init msm_add_sdcc(unsigned int controller,
-                       struct msm_mmc_platform_data *plat,
-                       unsigned int stat_irq, unsigned long stat_irq_flags);
-
-#if defined(CONFIG_MSM_SMD) && defined(CONFIG_DEBUG_FS)
-int smd_debugfs_init(void);
-#else
-static inline int smd_debugfs_init(void) { return 0; }
-#endif
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
deleted file mode 100644 (file)
index 7bca8d7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.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.
- *
- *
- * The MSM peripherals are spread all over across 768MB of physical
- * space, which makes just having a simple IO_ADDRESS macro to slide
- * them into the right virtual location rough.  Instead, we will
- * provide a master phys->virt mapping for peripherals here.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_IOMAP_8960_H
-#define __ASM_ARCH_MSM_IOMAP_8960_H
-
-/* Physical base address and size of peripherals.
- * Ordered by the virtual base addresses they will be mapped at.
- *
- * If you add or remove entries here, you'll want to edit the
- * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
- * changes.
- *
- */
-
-#define MSM8960_TMR_PHYS       0x0200A000
-#define MSM8960_TMR_SIZE       SZ_4K
-
-#define MSM8960_TMR0_PHYS      0x0208A000
-#define MSM8960_TMR0_SIZE      SZ_4K
-
-#ifdef CONFIG_DEBUG_MSM8960_UART
-#define MSM_DEBUG_UART_BASE    0xF0040000
-#define MSM_DEBUG_UART_PHYS    0x16440000
-#endif
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
deleted file mode 100644 (file)
index 75a7b62..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.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.
- *
- *
- * The MSM peripherals are spread all over across 768MB of physical
- * space, which makes just having a simple IO_ADDRESS macro to slide
- * them into the right virtual location rough.  Instead, we will
- * provide a master phys->virt mapping for peripherals here.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_IOMAP_8X60_H
-#define __ASM_ARCH_MSM_IOMAP_8X60_H
-
-/* Physical base address and size of peripherals.
- * Ordered by the virtual base addresses they will be mapped at.
- *
- * MSM_VIC_BASE must be an value that can be loaded via a "mov"
- * instruction, otherwise entry-macro.S will not compile.
- *
- * If you add or remove entries here, you'll want to edit the
- * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
- * changes.
- *
- */
-
-#define MSM_TLMM_BASE          IOMEM(0xF0004000)
-#define MSM_TLMM_PHYS          0x00800000
-#define MSM_TLMM_SIZE          SZ_16K
-
-#define MSM8X60_TMR_PHYS       0x02000000
-#define MSM8X60_TMR_SIZE       SZ_4K
-
-#define MSM8X60_TMR0_PHYS      0x02040000
-#define MSM8X60_TMR0_SIZE      SZ_4K
-
-#ifdef CONFIG_DEBUG_MSM8660_UART
-#define MSM_DEBUG_UART_BASE    0xF0040000
-#define MSM_DEBUG_UART_PHYS    0x19C40000
-#endif
-
-#endif
index c56e81f..0e4f491 100644 (file)
 #include "msm_iomap-7x00.h"
 #endif
 
-#include "msm_iomap-8x60.h"
-#include "msm_iomap-8960.h"
-
-#define MSM_DEBUG_UART_SIZE    SZ_4K
-#if defined(CONFIG_DEBUG_MSM_UART1)
-#define MSM_DEBUG_UART_BASE    0xE1000000
-#define MSM_DEBUG_UART_PHYS    MSM_UART1_PHYS
-#elif defined(CONFIG_DEBUG_MSM_UART2)
-#define MSM_DEBUG_UART_BASE    0xE1000000
-#define MSM_DEBUG_UART_PHYS    MSM_UART2_PHYS
-#elif defined(CONFIG_DEBUG_MSM_UART3)
-#define MSM_DEBUG_UART_BASE    0xE1000000
-#define MSM_DEBUG_UART_PHYS    MSM_UART3_PHYS
-#endif
-
 /* Virtual addresses shared across all MSM targets. */
 #define MSM_CSR_BASE           IOMEM(0xE0001000)
-#define MSM_TMR_BASE           IOMEM(0xF0200000)
-#define MSM_TMR0_BASE          IOMEM(0xF0201000)
 #define MSM_GPIO1_BASE         IOMEM(0xE0003000)
 #define MSM_GPIO2_BASE         IOMEM(0xE0004000)
 
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h
deleted file mode 100644 (file)
index 9432487..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
- *
- * 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.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_UNCOMPRESS_H
-#define __ASM_ARCH_MSM_UNCOMPRESS_H
-
-#include <asm/barrier.h>
-#include <asm/processor.h>
-#include <mach/msm_iomap.h>
-
-#define UART_CSR      (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08))
-#define UART_TF       (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x0c))
-
-#define UART_DM_SR    (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08)))
-#define UART_DM_CR    (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x10)))
-#define UART_DM_ISR   (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x14)))
-#define UART_DM_NCHAR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x40)))
-#define UART_DM_TF    (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x70)))
-
-static void putc(int c)
-{
-#if defined(MSM_DEBUG_UART_PHYS)
-#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
-       /*
-        * Wait for TX_READY to be set; but skip it if we have a
-        * TX underrun.
-        */
-       if (!(UART_DM_SR & 0x08))
-               while (!(UART_DM_ISR & 0x80))
-                       cpu_relax();
-
-       UART_DM_CR = 0x300;
-       UART_DM_NCHAR = 0x1;
-       UART_DM_TF = c;
-#else
-       while (!(UART_CSR & 0x04))
-               cpu_relax();
-       UART_TF = c;
-#endif
-#endif
-}
-
-static inline void flush(void)
-{
-}
-
-static inline void arch_decomp_setup(void)
-{
-}
-
-#endif
index 3dc04cc..adc8971 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/bug.h>
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/export.h>
@@ -27,8 +28,6 @@
 #include <mach/msm_iomap.h>
 #include <asm/mach/map.h>
 
-#include <mach/board.h>
-
 #include "common.h"
 
 #define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) {                         \
@@ -52,26 +51,38 @@ static struct map_desc msm_io_desc[] __initdata = {
        MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
        MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
        MSM_DEVICE_TYPE(CLK_CTL, MT_DEVICE_NONSHARED),
-#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
-       defined(CONFIG_DEBUG_MSM_UART3)
-       MSM_DEVICE_TYPE(DEBUG_UART, MT_DEVICE_NONSHARED),
-#endif
        {
                .virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
                .pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
                .length =   MSM_SHARED_RAM_SIZE,
                .type =     MT_DEVICE,
        },
+#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
+               defined(CONFIG_DEBUG_MSM_UART3)
+       {
+               /* Must be last: virtual and pfn filled in by debug_ll_addr() */
+               .length = SZ_4K,
+               .type = MT_DEVICE_NONSHARED,
+       }
+#endif
 };
 
 void __init msm_map_common_io(void)
 {
+       size_t size = ARRAY_SIZE(msm_io_desc);
+
        /* Make sure the peripheral register window is closed, since
         * we will use PTE flags (TEX[1]=1,B=0,C=1) to determine which
         * pages are peripheral interface or not.
         */
        asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0));
-       iotable_init(msm_io_desc, ARRAY_SIZE(msm_io_desc));
+#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
+               defined(CONFIG_DEBUG_MSM_UART3)
+       debug_ll_addr(&msm_io_desc[size - 1].pfn,
+                     &msm_io_desc[size - 1].virtual);
+       msm_io_desc[size - 1].pfn = __phys_to_pfn(msm_io_desc[size - 1].pfn);
+#endif
+       iotable_init(msm_io_desc, size);
 }
 #endif
 
@@ -87,10 +98,6 @@ static struct map_desc qsd8x50_io_desc[] __initdata = {
        MSM_DEVICE(SCPLL),
        MSM_DEVICE(AD5),
        MSM_DEVICE(MDC),
-#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
-       defined(CONFIG_DEBUG_MSM_UART3)
-       MSM_DEVICE(DEBUG_UART),
-#endif
        {
                .virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
                .pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
@@ -101,40 +108,11 @@ static struct map_desc qsd8x50_io_desc[] __initdata = {
 
 void __init msm_map_qsd8x50_io(void)
 {
+       debug_ll_io_init();
        iotable_init(qsd8x50_io_desc, ARRAY_SIZE(qsd8x50_io_desc));
 }
 #endif /* CONFIG_ARCH_QSD8X50 */
 
-#ifdef CONFIG_ARCH_MSM8X60
-static struct map_desc msm8x60_io_desc[] __initdata = {
-       MSM_CHIP_DEVICE(TMR, MSM8X60),
-       MSM_CHIP_DEVICE(TMR0, MSM8X60),
-#ifdef CONFIG_DEBUG_MSM8660_UART
-       MSM_DEVICE(DEBUG_UART),
-#endif
-};
-
-void __init msm_map_msm8x60_io(void)
-{
-       iotable_init(msm8x60_io_desc, ARRAY_SIZE(msm8x60_io_desc));
-}
-#endif /* CONFIG_ARCH_MSM8X60 */
-
-#ifdef CONFIG_ARCH_MSM8960
-static struct map_desc msm8960_io_desc[] __initdata = {
-       MSM_CHIP_DEVICE(TMR, MSM8960),
-       MSM_CHIP_DEVICE(TMR0, MSM8960),
-#ifdef CONFIG_DEBUG_MSM8960_UART
-       MSM_DEVICE(DEBUG_UART),
-#endif
-};
-
-void __init msm_map_msm8960_io(void)
-{
-       iotable_init(msm8960_io_desc, ARRAY_SIZE(msm8960_io_desc));
-}
-#endif /* CONFIG_ARCH_MSM8960 */
-
 #ifdef CONFIG_ARCH_MSM7X30
 static struct map_desc msm7x30_io_desc[] __initdata = {
        MSM_DEVICE(VIC),
@@ -150,10 +128,6 @@ static struct map_desc msm7x30_io_desc[] __initdata = {
        MSM_DEVICE(SAW),
        MSM_DEVICE(GCC),
        MSM_DEVICE(TCSR),
-#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
-       defined(CONFIG_DEBUG_MSM_UART3)
-       MSM_DEVICE(DEBUG_UART),
-#endif
        {
                .virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
                .pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
@@ -164,10 +138,12 @@ static struct map_desc msm7x30_io_desc[] __initdata = {
 
 void __init msm_map_msm7x30_io(void)
 {
+       debug_ll_io_init();
        iotable_init(msm7x30_io_desc, ARRAY_SIZE(msm7x30_io_desc));
 }
 #endif /* CONFIG_ARCH_MSM7X30 */
 
+#ifdef CONFIG_ARCH_MSM7X00A
 void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
                                   unsigned int mtype, void *caller)
 {
@@ -182,3 +158,4 @@ void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
 
        return __arm_ioremap_caller(phys_addr, size, mtype, caller);
 }
+#endif
index 8697cfc..696fb73 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
+#include <linux/cpu.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -26,7 +27,6 @@
 #include <linux/sched_clock.h>
 
 #include <asm/mach/time.h>
-#include <asm/localtimer.h>
 
 #include "common.h"
 
@@ -49,7 +49,7 @@ static void __iomem *sts_base;
 
 static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
 {
-       struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
+       struct clock_event_device *evt = dev_id;
        /* Stop the timer tick */
        if (evt->mode == CLOCK_EVT_MODE_ONESHOT) {
                u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
@@ -101,18 +101,7 @@ static void msm_timer_set_mode(enum clock_event_mode mode,
        writel_relaxed(ctrl, event_base + TIMER_ENABLE);
 }
 
-static struct clock_event_device msm_clockevent = {
-       .name           = "gp_timer",
-       .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .rating         = 200,
-       .set_next_event = msm_timer_set_next_event,
-       .set_mode       = msm_timer_set_mode,
-};
-
-static union {
-       struct clock_event_device *evt;
-       struct clock_event_device * __percpu *percpu_evt;
-} msm_evt;
+static struct clock_event_device __percpu *msm_evt;
 
 static void __iomem *source_base;
 
@@ -138,23 +127,34 @@ static struct clocksource msm_clocksource = {
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-#ifdef CONFIG_LOCAL_TIMERS
+static int msm_timer_irq;
+static int msm_timer_has_ppi;
+
 static int msm_local_timer_setup(struct clock_event_device *evt)
 {
-       /* Use existing clock_event for cpu 0 */
-       if (!smp_processor_id())
-               return 0;
-
-       evt->irq = msm_clockevent.irq;
-       evt->name = "local_timer";
-       evt->features = msm_clockevent.features;
-       evt->rating = msm_clockevent.rating;
+       int cpu = smp_processor_id();
+       int err;
+
+       evt->irq = msm_timer_irq;
+       evt->name = "msm_timer";
+       evt->features = CLOCK_EVT_FEAT_ONESHOT;
+       evt->rating = 200;
        evt->set_mode = msm_timer_set_mode;
        evt->set_next_event = msm_timer_set_next_event;
+       evt->cpumask = cpumask_of(cpu);
+
+       clockevents_config_and_register(evt, GPT_HZ, 4, 0xffffffff);
+
+       if (msm_timer_has_ppi) {
+               enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING);
+       } else {
+               err = request_irq(evt->irq, msm_timer_interrupt,
+                               IRQF_TIMER | IRQF_NOBALANCING |
+                               IRQF_TRIGGER_RISING, "gp_timer", evt);
+               if (err)
+                       pr_err("request_irq failed\n");
+       }
 
-       *__this_cpu_ptr(msm_evt.percpu_evt) = evt;
-       clockevents_config_and_register(evt, GPT_HZ, 4, 0xf0000000);
-       enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING);
        return 0;
 }
 
@@ -164,11 +164,28 @@ static void msm_local_timer_stop(struct clock_event_device *evt)
        disable_percpu_irq(evt->irq);
 }
 
-static struct local_timer_ops msm_local_timer_ops = {
-       .setup  = msm_local_timer_setup,
-       .stop   = msm_local_timer_stop,
+static int msm_timer_cpu_notify(struct notifier_block *self,
+                                          unsigned long action, void *hcpu)
+{
+       /*
+        * Grab cpu pointer in each case to avoid spurious
+        * preemptible warnings
+        */
+       switch (action & ~CPU_TASKS_FROZEN) {
+       case CPU_STARTING:
+               msm_local_timer_setup(this_cpu_ptr(msm_evt));
+               break;
+       case CPU_DYING:
+               msm_local_timer_stop(this_cpu_ptr(msm_evt));
+               break;
+       }
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block msm_timer_cpu_nb = {
+       .notifier_call = msm_timer_cpu_notify,
 };
-#endif /* CONFIG_LOCAL_TIMERS */
 
 static notrace u32 msm_sched_clock_read(void)
 {
@@ -178,38 +195,35 @@ static notrace u32 msm_sched_clock_read(void)
 static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
                                  bool percpu)
 {
-       struct clock_event_device *ce = &msm_clockevent;
        struct clocksource *cs = &msm_clocksource;
-       int res;
+       int res = 0;
+
+       msm_timer_irq = irq;
+       msm_timer_has_ppi = percpu;
+
+       msm_evt = alloc_percpu(struct clock_event_device);
+       if (!msm_evt) {
+               pr_err("memory allocation failed for clockevents\n");
+               goto err;
+       }
 
-       ce->cpumask = cpumask_of(0);
-       ce->irq = irq;
+       if (percpu)
+               res = request_percpu_irq(irq, msm_timer_interrupt,
+                                        "gp_timer", msm_evt);
 
-       clockevents_config_and_register(ce, GPT_HZ, 4, 0xffffffff);
-       if (percpu) {
-               msm_evt.percpu_evt = alloc_percpu(struct clock_event_device *);
-               if (!msm_evt.percpu_evt) {
-                       pr_err("memory allocation failed for %s\n", ce->name);
+       if (res) {
+               pr_err("request_percpu_irq failed\n");
+       } else {
+               res = register_cpu_notifier(&msm_timer_cpu_nb);
+               if (res) {
+                       free_percpu_irq(irq, msm_evt);
                        goto err;
                }
-               *__this_cpu_ptr(msm_evt.percpu_evt) = ce;
-               res = request_percpu_irq(ce->irq, msm_timer_interrupt,
-                                        ce->name, msm_evt.percpu_evt);
-               if (!res) {
-                       enable_percpu_irq(ce->irq, IRQ_TYPE_EDGE_RISING);
-#ifdef CONFIG_LOCAL_TIMERS
-                       local_timer_register(&msm_local_timer_ops);
-#endif
-               }
-       } else {
-               msm_evt.evt = ce;
-               res = request_irq(ce->irq, msm_timer_interrupt,
-                                 IRQF_TIMER | IRQF_NOBALANCING |
-                                 IRQF_TRIGGER_RISING, ce->name, &msm_evt.evt);
+
+               /* Immediately configure the timer on the boot CPU */
+               msm_local_timer_setup(__this_cpu_ptr(msm_evt));
        }
 
-       if (res)
-               pr_err("request_irq failed for %s\n", ce->name);
 err:
        writel_relaxed(TIMER_ENABLE_EN, source_base + TIMER_ENABLE);
        res = clocksource_register_hz(cs, dgt_hz);
@@ -219,15 +233,8 @@ err:
 }
 
 #ifdef CONFIG_OF
-static const struct of_device_id msm_timer_match[] __initconst = {
-       { .compatible = "qcom,kpss-timer" },
-       { .compatible = "qcom,scss-timer" },
-       { },
-};
-
-void __init msm_dt_timer_init(void)
+static void __init msm_dt_timer_init(struct device_node *np)
 {
-       struct device_node *np;
        u32 freq;
        int irq;
        struct resource res;
@@ -235,12 +242,6 @@ void __init msm_dt_timer_init(void)
        void __iomem *base;
        void __iomem *cpu0_base;
 
-       np = of_find_matching_node(NULL, msm_timer_match);
-       if (!np) {
-               pr_err("Can't find msm timer DT node\n");
-               return;
-       }
-
        base = of_iomap(np, 0);
        if (!base) {
                pr_err("Failed to map event base\n");
@@ -283,6 +284,8 @@ void __init msm_dt_timer_init(void)
 
        msm_timer_init(freq, 32, irq, !!percpu_offset);
 }
+CLOCKSOURCE_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
+CLOCKSOURCE_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
 #endif
 
 static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source,
index dc26a65..445e553 100644 (file)
 #include <mach/mv78xx0.h>
 #include "common.h"
 
+#define MV78XX0_MBUS_PCIE_MEM_TARGET(port, lane) ((port) ? 8 : 4)
+#define MV78XX0_MBUS_PCIE_MEM_ATTR(port, lane)   (0xf8 & ~(0x10 << (lane)))
+#define MV78XX0_MBUS_PCIE_IO_TARGET(port, lane)  ((port) ? 8 : 4)
+#define MV78XX0_MBUS_PCIE_IO_ATTR(port, lane)    (0xf0 & ~(0x10 << (lane)))
+
 struct pcie_port {
        u8                      maj;
        u8                      min;
@@ -71,7 +76,6 @@ static void __init mv78xx0_pcie_preinit(void)
        start = MV78XX0_PCIE_MEM_PHYS_BASE;
        for (i = 0; i < num_pcie_ports; i++) {
                struct pcie_port *pp = pcie_port + i;
-               char winname[MVEBU_MBUS_MAX_WINNAME_SZ];
 
                snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
                        "PCIe %d.%d MEM", pp->maj, pp->min);
@@ -85,17 +89,12 @@ static void __init mv78xx0_pcie_preinit(void)
                if (request_resource(&iomem_resource, &pp->res))
                        panic("can't allocate PCIe MEM sub-space");
 
-               snprintf(winname, sizeof(winname), "pcie%d.%d",
-                        pp->maj, pp->min);
-
-               mvebu_mbus_add_window_remap_flags(winname,
-                                                 pp->res.start,
-                                                 resource_size(&pp->res),
-                                                 MVEBU_MBUS_NO_REMAP,
-                                                 MVEBU_MBUS_PCI_MEM);
-               mvebu_mbus_add_window_remap_flags(winname,
-                                                 i * SZ_64K, SZ_64K,
-                                                 0, MVEBU_MBUS_PCI_IO);
+               mvebu_mbus_add_window_by_id(MV78XX0_MBUS_PCIE_MEM_TARGET(pp->maj, pp->min),
+                                           MV78XX0_MBUS_PCIE_MEM_ATTR(pp->maj, pp->min),
+                                           pp->res.start, resource_size(&pp->res));
+               mvebu_mbus_add_window_remap_by_id(MV78XX0_MBUS_PCIE_IO_TARGET(pp->maj, pp->min),
+                                                 MV78XX0_MBUS_PCIE_IO_ATTR(pp->maj, pp->min),
+                                                 i * SZ_64K, SZ_64K, 0);
        }
 }
 
index 97cbb80..829b573 100644 (file)
@@ -34,44 +34,12 @@ static void __init armada_370_xp_map_io(void)
        debug_ll_io_init();
 }
 
-/*
- * This initialization will be replaced by a DT-based
- * initialization once the mvebu-mbus driver gains DT support.
- */
-
-#define ARMADA_370_XP_MBUS_WINS_OFFS   0x20000
-#define ARMADA_370_XP_MBUS_WINS_SIZE   0x100
-#define ARMADA_370_XP_SDRAM_WINS_OFFS  0x20180
-#define ARMADA_370_XP_SDRAM_WINS_SIZE  0x20
-
-static void __init armada_370_xp_mbus_init(void)
-{
-       char *mbus_soc_name;
-       struct device_node *dn;
-       const __be32 mbus_wins_offs = cpu_to_be32(ARMADA_370_XP_MBUS_WINS_OFFS);
-       const __be32 sdram_wins_offs = cpu_to_be32(ARMADA_370_XP_SDRAM_WINS_OFFS);
-
-       if (of_machine_is_compatible("marvell,armada370"))
-               mbus_soc_name = "marvell,armada370-mbus";
-       else
-               mbus_soc_name = "marvell,armadaxp-mbus";
-
-       dn = of_find_node_by_name(NULL, "internal-regs");
-       BUG_ON(!dn);
-
-       mvebu_mbus_init(mbus_soc_name,
-                       of_translate_address(dn, &mbus_wins_offs),
-                       ARMADA_370_XP_MBUS_WINS_SIZE,
-                       of_translate_address(dn, &sdram_wins_offs),
-                       ARMADA_370_XP_SDRAM_WINS_SIZE);
-}
-
 static void __init armada_370_xp_timer_and_clk_init(void)
 {
        of_clk_init(NULL);
        armada_370_xp_timer_init();
        coherency_init();
-       armada_370_xp_mbus_init();
+       BUG_ON(mvebu_mbus_dt_init());
 #ifdef CONFIG_CACHE_L2X0
        l2x0_of_init(0, ~0UL);
 #endif
index 594b63d..ff69c2d 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/smp.h>
 #include <linux/clk.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/mbus.h>
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
@@ -29,6 +30,9 @@
 #include "pmsu.h"
 #include "coherency.h"
 
+#define AXP_BOOTROM_BASE 0xfff00000
+#define AXP_BOOTROM_SIZE 0x100000
+
 static struct clk *__init get_cpu_clk(int cpu)
 {
        struct clk *cpu_clk;
@@ -82,37 +86,39 @@ static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 static void __init armada_xp_smp_init_cpus(void)
 {
-       struct device_node *np;
-       unsigned int i, ncores;
-
-       np = of_find_node_by_name(NULL, "cpus");
-       if (!np)
-               panic("No 'cpus' node found\n");
+       unsigned int ncores = num_possible_cpus();
 
-       ncores = of_get_child_count(np);
        if (ncores == 0 || ncores > ARMADA_XP_MAX_CPUS)
                panic("Invalid number of CPUs in DT\n");
 
-       /* Limit possible CPUs to defconfig */
-       if (ncores > nr_cpu_ids) {
-               pr_warn("SMP: %d CPUs physically present. Only %d configured.",
-                       ncores, nr_cpu_ids);
-               pr_warn("Clipping CPU count to %d\n", nr_cpu_ids);
-               ncores = nr_cpu_ids;
-       }
-
-       for (i = 0; i < ncores; i++)
-               set_cpu_possible(i, true);
-
        set_smp_cross_call(armada_mpic_send_doorbell);
 }
 
 void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
 {
+       struct device_node *node;
+       struct resource res;
+       int err;
+
        set_secondary_cpus_clock();
        flush_cache_all();
        set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
-       mvebu_mbus_add_window("bootrom", 0xfff00000, SZ_1M);
+
+       /*
+        * In order to boot the secondary CPUs we need to ensure
+        * the bootROM is mapped at the correct address.
+        */
+       node = of_find_compatible_node(NULL, NULL, "marvell,bootrom");
+       if (!node)
+               panic("Cannot find 'marvell,bootrom' compatible node");
+
+       err = of_address_to_resource(node, 0, &res);
+       if (err < 0)
+               panic("Cannot get 'bootrom' node address");
+
+       if (res.start != AXP_BOOTROM_BASE ||
+           resource_size(&res) != AXP_BOOTROM_SIZE)
+               panic("The address for the BootROM is incorrect");
 }
 
 struct smp_operations armada_xp_smp_ops __initdata = {
index 4ce27b5..98f6e2a 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/clk/mxs.h>
 #include <linux/clkdev.h>
 #include <linux/clocksource.h>
+#include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/gpio.h>
@@ -61,6 +62,8 @@
 static u32 chipid;
 static u32 socid;
 
+static void __iomem *reset_addr;
+
 static inline void __mxs_setl(u32 mask, void __iomem *reg)
 {
        __raw_writel(mask, reg + MXS_SET_ADDR);
@@ -393,12 +396,33 @@ static const char __init *mxs_get_revision(void)
        u32 rev = mxs_get_cpu_rev();
 
        if (rev != MXS_CHIP_REV_UNKNOWN)
-               return kasprintf(GFP_KERNEL, "TO%d.%d", (rev >> 4) & 0xf,
+               return kasprintf(GFP_KERNEL, "%d.%d", (rev >> 4) & 0xf,
                                rev & 0xf);
        else
                return kasprintf(GFP_KERNEL, "%s", "Unknown");
 }
 
+#define MX23_CLKCTRL_RESET_OFFSET      0x120
+#define MX28_CLKCTRL_RESET_OFFSET      0x1e0
+
+static int __init mxs_restart_init(void)
+{
+       struct device_node *np;
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
+       reset_addr = of_iomap(np, 0);
+       if (!reset_addr)
+               return -ENODEV;
+
+       if (of_device_is_compatible(np, "fsl,imx23-clkctrl"))
+               reset_addr += MX23_CLKCTRL_RESET_OFFSET;
+       else
+               reset_addr += MX28_CLKCTRL_RESET_OFFSET;
+       of_node_put(np);
+
+       return 0;
+}
+
 static void __init mxs_machine_init(void)
 {
        struct device_node *root;
@@ -433,21 +457,18 @@ static void __init mxs_machine_init(void)
                imx28_evk_init();
        else if (of_machine_is_compatible("bluegiga,apx4devkit"))
                apx4devkit_init();
-       else if (of_machine_is_compatible("crystalfontz,cfa10037") ||
-                of_machine_is_compatible("crystalfontz,cfa10049") ||
-                of_machine_is_compatible("crystalfontz,cfa10055") ||
-                of_machine_is_compatible("crystalfontz,cfa10057"))
+       else if (of_machine_is_compatible("crystalfontz,cfa10036"))
                crystalfontz_init();
 
        of_platform_populate(NULL, of_default_bus_match_table,
                             NULL, parent);
 
+       mxs_restart_init();
+
        if (of_machine_is_compatible("karo,tx28"))
                tx28_post_init();
 }
 
-#define MX23_CLKCTRL_RESET_OFFSET      0x120
-#define MX28_CLKCTRL_RESET_OFFSET      0x1e0
 #define MXS_CLKCTRL_RESET_CHIP         (1 << 1)
 
 /*
@@ -455,28 +476,16 @@ static void __init mxs_machine_init(void)
  */
 static void mxs_restart(enum reboot_mode mode, const char *cmd)
 {
-       struct device_node *np;
-       void __iomem *reset_addr;
+       if (reset_addr) {
+               /* reset the chip */
+               __mxs_setl(MXS_CLKCTRL_RESET_CHIP, reset_addr);
 
-       np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
-       reset_addr = of_iomap(np, 0);
-       if (!reset_addr)
-               goto soft;
+               pr_err("Failed to assert the chip reset\n");
 
-       if (of_device_is_compatible(np, "fsl,imx23-clkctrl"))
-               reset_addr += MX23_CLKCTRL_RESET_OFFSET;
-       else
-               reset_addr += MX28_CLKCTRL_RESET_OFFSET;
-
-       /* reset the chip */
-       __mxs_setl(MXS_CLKCTRL_RESET_CHIP, reset_addr);
-
-       pr_err("Failed to assert the chip reset\n");
-
-       /* Delay to allow the serial port to show the message */
-       mdelay(50);
+               /* Delay to allow the serial port to show the message */
+               mdelay(50);
+       }
 
-soft:
        /* We'll take a jump through zero as a poor second */
        soft_restart(0);
 }
@@ -487,6 +496,7 @@ static void __init mxs_timer_init(void)
                mx23_clocks_init();
        else
                mx28_clocks_init();
+       of_clk_init(NULL);
        clocksource_of_init();
 }
 
index b2494d2..0170e99 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/suspend.h>
 #include <linux/io.h>
+#include "pm.h"
 
 static int mxs_suspend_enter(suspend_state_t state)
 {
index 5981c3d..4d42da4 100644 (file)
@@ -27,6 +27,7 @@ config MACH_NOMADIK_8815NHK
        select NOMADIK_8815
        select I2C
        select I2C_ALGOBIT
+       select I2C_NOMADIK
 
 endmenu
 endif
index 6cf9c1c..612bd1c 100644 (file)
@@ -195,6 +195,7 @@ IS_OMAP_TYPE(1710, 0x1710)
 #define cpu_is_omap34xx()              0
 #define cpu_is_omap44xx()              0
 #define soc_is_omap54xx()              0
+#define soc_is_dra7xx()                        0
 #define soc_is_am33xx()                        0
 #define cpu_class_is_omap1()           1
 #define cpu_class_is_omap2()           0
index 3eed000..b5fb5f7 100644 (file)
@@ -37,9 +37,8 @@ config ARCH_OMAP4
        select CACHE_L2X0
        select CPU_V7
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_SMP
-       select LOCAL_TIMERS if SMP
        select OMAP_INTERCONNECT
        select PL310_ERRATA_588369
        select PL310_ERRATA_727915
@@ -65,7 +64,7 @@ config SOC_OMAP5
        select ARM_ERRATA_798181 if SMP
 
 config SOC_AM33XX
-       bool "AM33XX support"
+       bool "TI AM33XX"
        depends on ARCH_MULTI_V7
        select ARCH_OMAP2PLUS
        select ARM_CPU_SUSPEND if PM
@@ -118,7 +117,7 @@ config ARCH_OMAP2PLUS_TYPICAL
        select I2C
        select I2C_OMAP
        select MENELAUS if ARCH_OMAP2
-       select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
+       select NEON if CPU_V7
        select PM_RUNTIME
        select REGULATOR
        select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
@@ -132,9 +131,17 @@ config SOC_HAS_OMAP2_SDRC
 
 config SOC_HAS_REALTIME_COUNTER
        bool "Real time free running counter"
-       depends on SOC_OMAP5
+       depends on SOC_OMAP5 || SOC_DRA7XX
        default y
 
+config SOC_DRA7XX
+       bool "TI DRA7XX"
+       select ARM_ARCH_TIMER
+       select CPU_V7
+       select ARM_GIC
+       select HAVE_SMP
+       select COMMON_CLK
+
 comment "OMAP Core Type"
        depends on ARCH_OMAP2
 
index d4f6715..cc36bfe 100644 (file)
@@ -23,6 +23,7 @@ obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
 obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common)
 obj-$(CONFIG_SOC_OMAP5)         += prm44xx.o $(hwmod-common) $(secure-common)
 obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common)
+obj-$(CONFIG_SOC_DRA7XX) += prm44xx.o $(hwmod-common) $(secure-common)
 
 ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
 obj-y += mcbsp.o
@@ -39,6 +40,7 @@ omap-4-5-common                               =  omap4-common.o omap-wakeupgen.o
 obj-$(CONFIG_ARCH_OMAP4)               += $(omap-4-5-common) $(smp-y) sleep44xx.o
 obj-$(CONFIG_SOC_OMAP5)                        += $(omap-4-5-common) $(smp-y) sleep44xx.o
 obj-$(CONFIG_SOC_AM43XX)               += $(omap-4-5-common)
+obj-$(CONFIG_SOC_DRA7XX)               += $(omap-4-5-common) $(smp-y)
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_omap-headsmp.o                  :=-Wa,-march=armv7-a$(plus_sec)
@@ -87,6 +89,7 @@ obj-$(CONFIG_ARCH_OMAP2)              += sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)               += pm34xx.o sleep34xx.o
 obj-$(CONFIG_ARCH_OMAP4)               += pm44xx.o omap-mpuss-lowpower.o
 obj-$(CONFIG_SOC_OMAP5)                        += omap-mpuss-lowpower.o
+obj-$(CONFIG_SOC_DRA7XX)               += omap-mpuss-lowpower.o
 obj-$(CONFIG_PM_DEBUG)                 += pm-debug.o
 
 obj-$(CONFIG_POWER_AVS_OMAP)           += sr_device.o
@@ -114,6 +117,7 @@ omap-prcm-4-5-common                        =  cminst44xx.o cm44xx.o prm44xx.o \
                                           vc44xx_data.o vp44xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)               += $(omap-prcm-4-5-common)
 obj-$(CONFIG_SOC_OMAP5)                        += $(omap-prcm-4-5-common)
+obj-$(CONFIG_SOC_DRA7XX)               += $(omap-prcm-4-5-common)
 
 # OMAP voltage domains
 voltagedomain-common                   := voltage.o vc.o vp.o
@@ -143,6 +147,7 @@ obj-$(CONFIG_SOC_AM33XX)            += powerdomains33xx_data.o
 obj-$(CONFIG_SOC_AM43XX)               += $(powerdomain-common)
 obj-$(CONFIG_SOC_OMAP5)                        += $(powerdomain-common)
 obj-$(CONFIG_SOC_OMAP5)                        += powerdomains54xx_data.o
+obj-$(CONFIG_SOC_DRA7XX)               += $(powerdomain-common)
 
 # PRCM clockdomain control
 clockdomain-common                     += clockdomain.o
@@ -160,6 +165,7 @@ obj-$(CONFIG_SOC_AM33XX)            += clockdomains33xx_data.o
 obj-$(CONFIG_SOC_AM43XX)               += $(clockdomain-common)
 obj-$(CONFIG_SOC_OMAP5)                        += $(clockdomain-common)
 obj-$(CONFIG_SOC_OMAP5)                        += clockdomains54xx_data.o
+obj-$(CONFIG_SOC_DRA7XX)               += $(clockdomain-common)
 
 # Clock framework
 obj-$(CONFIG_ARCH_OMAP2)               += $(clock-common) clock2xxx.o
index 1eae962..c88d8df 100644 (file)
@@ -24,8 +24,8 @@ void am33xx_restart(enum reboot_mode mode, const char *cmd)
 {
        /* TODO: Handle mode and cmd if necessary */
 
-       am33xx_prm_rmw_reg_bits(AM33XX_GLOBAL_WARM_SW_RST_MASK,
-                               AM33XX_GLOBAL_WARM_SW_RST_MASK,
+       am33xx_prm_rmw_reg_bits(AM33XX_RST_GLOBAL_WARM_SW_MASK,
+                               AM33XX_RST_GLOBAL_WARM_SW_MASK,
                                AM33XX_PRM_DEVICE_MOD,
                                AM33XX_PRM_RSTCTRL_OFFSET);
 
index fc53911..0d499a1 100644 (file)
@@ -110,8 +110,6 @@ static void __init am3517_crane_i2c_init(void)
 
 static void __init am3517_crane_init(void)
 {
-       int ret;
-
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_serial_init();
        omap_sdrc_init(NULL, NULL);
index 8cc2c9e..543d9a8 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/can/platform/ti_hecc.h>
 #include <linux/davinci_emac.h>
 #include <linux/mmc/host.h>
index be5d005..b89e55b 100644 (file)
@@ -222,3 +222,21 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
        .dt_compat      = am43_boards_compat,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_SOC_DRA7XX
+static const char *dra7xx_boards_compat[] __initdata = {
+       "ti,dra7",
+       NULL,
+};
+
+DT_MACHINE_START(DRA7XX_DT, "Generic DRA7XX (Flattened Device Tree)")
+       .reserve        = omap_reserve,
+       .smp            = smp_ops(omap4_smp_ops),
+       .map_io         = omap5_map_io,
+       .init_early     = dra7xx_init_early,
+       .init_irq       = omap_gic_of_init,
+       .init_machine   = omap_generic_init,
+       .init_time      = omap5_realtime_timer_init,
+       .dt_compat      = dra7xx_boards_compat,
+MACHINE_END
+#endif
index 669ef51..8538669 100644 (file)
  * published by the Free Software Foundation.
  */
 
-/* Bits shared between registers */
-
-/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
 #define OMAP24XX_EN_CAM_SHIFT                          31
-#define OMAP24XX_EN_CAM_MASK                           (1 << 31)
 #define OMAP24XX_EN_WDT4_SHIFT                         29
-#define OMAP24XX_EN_WDT4_MASK                          (1 << 29)
 #define OMAP2420_EN_WDT3_SHIFT                         28
-#define OMAP2420_EN_WDT3_MASK                          (1 << 28)
 #define OMAP24XX_EN_MSPRO_SHIFT                                27
-#define OMAP24XX_EN_MSPRO_MASK                         (1 << 27)
 #define OMAP24XX_EN_FAC_SHIFT                          25
-#define OMAP24XX_EN_FAC_MASK                           (1 << 25)
 #define OMAP2420_EN_EAC_SHIFT                          24
-#define OMAP2420_EN_EAC_MASK                           (1 << 24)
 #define OMAP24XX_EN_HDQ_SHIFT                          23
-#define OMAP24XX_EN_HDQ_MASK                           (1 << 23)
 #define OMAP2420_EN_I2C2_SHIFT                         20
-#define OMAP2420_EN_I2C2_MASK                          (1 << 20)
 #define OMAP2420_EN_I2C1_SHIFT                         19
-#define OMAP2420_EN_I2C1_MASK                          (1 << 19)
-
-/* CM_FCLKEN2_CORE and CM_ICLKEN2_CORE shared bits */
 #define OMAP2430_EN_MCBSP5_SHIFT                       5
-#define OMAP2430_EN_MCBSP5_MASK                                (1 << 5)
 #define OMAP2430_EN_MCBSP4_SHIFT                       4
-#define OMAP2430_EN_MCBSP4_MASK                                (1 << 4)
 #define OMAP2430_EN_MCBSP3_SHIFT                       3
-#define OMAP2430_EN_MCBSP3_MASK                                (1 << 3)
 #define OMAP24XX_EN_SSI_SHIFT                          1
-#define OMAP24XX_EN_SSI_MASK                           (1 << 1)
-
-/* CM_FCLKEN_WKUP and CM_ICLKEN_WKUP shared bits */
 #define OMAP24XX_EN_MPU_WDT_SHIFT                      3
-#define OMAP24XX_EN_MPU_WDT_MASK                       (1 << 3)
-
-/* Bits specific to each register */
-
-/* CM_IDLEST_MPU */
-/* 2430 only */
-#define OMAP2430_ST_MPU_MASK                           (1 << 0)
-
-/* CM_CLKSEL_MPU */
 #define OMAP24XX_CLKSEL_MPU_SHIFT                      0
-#define OMAP24XX_CLKSEL_MPU_MASK                       (0x1f << 0)
 #define OMAP24XX_CLKSEL_MPU_WIDTH                      5
-
-/* CM_CLKSTCTRL_MPU */
-#define OMAP24XX_AUTOSTATE_MPU_SHIFT                   0
 #define OMAP24XX_AUTOSTATE_MPU_MASK                    (1 << 0)
-
-/* CM_FCLKEN1_CORE specific bits*/
 #define OMAP24XX_EN_TV_SHIFT                           2
-#define OMAP24XX_EN_TV_MASK                            (1 << 2)
 #define OMAP24XX_EN_DSS2_SHIFT                         1
-#define OMAP24XX_EN_DSS2_MASK                          (1 << 1)
 #define OMAP24XX_EN_DSS1_SHIFT                         0
 #define OMAP24XX_EN_DSS1_MASK                          (1 << 0)
-
-/* CM_FCLKEN2_CORE specific bits */
 #define OMAP2430_EN_I2CHS2_SHIFT                       20
-#define OMAP2430_EN_I2CHS2_MASK                                (1 << 20)
 #define OMAP2430_EN_I2CHS1_SHIFT                       19
-#define OMAP2430_EN_I2CHS1_MASK                                (1 << 19)
 #define OMAP2430_EN_MMCHSDB2_SHIFT                     17
-#define OMAP2430_EN_MMCHSDB2_MASK                      (1 << 17)
 #define OMAP2430_EN_MMCHSDB1_SHIFT                     16
-#define OMAP2430_EN_MMCHSDB1_MASK                      (1 << 16)
-
-/* CM_ICLKEN1_CORE specific bits */
 #define OMAP24XX_EN_MAILBOXES_SHIFT                    30
-#define OMAP24XX_EN_MAILBOXES_MASK                     (1 << 30)
-#define OMAP24XX_EN_DSS_SHIFT                          0
-#define OMAP24XX_EN_DSS_MASK                           (1 << 0)
-
-/* CM_ICLKEN2_CORE specific bits */
-
-/* CM_ICLKEN3_CORE */
-/* 2430 only */
 #define OMAP2430_EN_SDRC_SHIFT                         2
-#define OMAP2430_EN_SDRC_MASK                          (1 << 2)
-
-/* CM_ICLKEN4_CORE */
 #define OMAP24XX_EN_PKA_SHIFT                          4
-#define OMAP24XX_EN_PKA_MASK                           (1 << 4)
 #define OMAP24XX_EN_AES_SHIFT                          3
-#define OMAP24XX_EN_AES_MASK                           (1 << 3)
 #define OMAP24XX_EN_RNG_SHIFT                          2
-#define OMAP24XX_EN_RNG_MASK                           (1 << 2)
 #define OMAP24XX_EN_SHA_SHIFT                          1
-#define OMAP24XX_EN_SHA_MASK                           (1 << 1)
 #define OMAP24XX_EN_DES_SHIFT                          0
-#define OMAP24XX_EN_DES_MASK                           (1 << 0)
-
-/* CM_IDLEST1_CORE specific bits */
 #define OMAP24XX_ST_MAILBOXES_SHIFT                    30
-#define OMAP24XX_ST_MAILBOXES_MASK                     (1 << 30)
-#define OMAP24XX_ST_WDT4_SHIFT                         29
-#define OMAP24XX_ST_WDT4_MASK                          (1 << 29)
-#define OMAP2420_ST_WDT3_SHIFT                         28
-#define OMAP2420_ST_WDT3_MASK                          (1 << 28)
-#define OMAP24XX_ST_MSPRO_SHIFT                                27
-#define OMAP24XX_ST_MSPRO_MASK                         (1 << 27)
-#define OMAP24XX_ST_FAC_SHIFT                          25
-#define OMAP24XX_ST_FAC_MASK                           (1 << 25)
-#define OMAP2420_ST_EAC_SHIFT                          24
-#define OMAP2420_ST_EAC_MASK                           (1 << 24)
 #define OMAP24XX_ST_HDQ_SHIFT                          23
-#define OMAP24XX_ST_HDQ_MASK                           (1 << 23)
 #define OMAP2420_ST_I2C2_SHIFT                         20
-#define OMAP2420_ST_I2C2_MASK                          (1 << 20)
 #define OMAP2430_ST_I2CHS1_SHIFT                       19
-#define OMAP2430_ST_I2CHS1_MASK                                (1 << 19)
 #define OMAP2420_ST_I2C1_SHIFT                         19
-#define OMAP2420_ST_I2C1_MASK                          (1 << 19)
 #define OMAP2430_ST_I2CHS2_SHIFT                       20
-#define OMAP2430_ST_I2CHS2_MASK                                (1 << 20)
 #define OMAP24XX_ST_MCBSP2_SHIFT                       16
-#define OMAP24XX_ST_MCBSP2_MASK                                (1 << 16)
 #define OMAP24XX_ST_MCBSP1_SHIFT                       15
-#define OMAP24XX_ST_MCBSP1_MASK                                (1 << 15)
 #define OMAP24XX_ST_DSS_SHIFT                          0
-#define OMAP24XX_ST_DSS_MASK                           (1 << 0)
-
-/* CM_IDLEST2_CORE */
 #define OMAP2430_ST_MCBSP5_SHIFT                       5
-#define OMAP2430_ST_MCBSP5_MASK                                (1 << 5)
 #define OMAP2430_ST_MCBSP4_SHIFT                       4
-#define OMAP2430_ST_MCBSP4_MASK                                (1 << 4)
 #define OMAP2430_ST_MCBSP3_SHIFT                       3
-#define OMAP2430_ST_MCBSP3_MASK                                (1 << 3)
-#define OMAP24XX_ST_SSI_SHIFT                          1
-#define OMAP24XX_ST_SSI_MASK                           (1 << 1)
-
-/* CM_IDLEST3_CORE */
-/* 2430 only */
-#define OMAP2430_ST_SDRC_MASK                          (1 << 2)
-
-/* CM_IDLEST4_CORE */
-#define OMAP24XX_ST_PKA_SHIFT                          4
-#define OMAP24XX_ST_PKA_MASK                           (1 << 4)
 #define OMAP24XX_ST_AES_SHIFT                          3
-#define OMAP24XX_ST_AES_MASK                           (1 << 3)
 #define OMAP24XX_ST_RNG_SHIFT                          2
-#define OMAP24XX_ST_RNG_MASK                           (1 << 2)
 #define OMAP24XX_ST_SHA_SHIFT                          1
-#define OMAP24XX_ST_SHA_MASK                           (1 << 1)
-#define OMAP24XX_ST_DES_SHIFT                          0
-#define OMAP24XX_ST_DES_MASK                           (1 << 0)
-
-/* CM_AUTOIDLE1_CORE */
-#define OMAP24XX_AUTO_CAM_MASK                         (1 << 31)
-#define OMAP24XX_AUTO_MAILBOXES_MASK                   (1 << 30)
-#define OMAP24XX_AUTO_WDT4_MASK                                (1 << 29)
-#define OMAP2420_AUTO_WDT3_MASK                                (1 << 28)
-#define OMAP24XX_AUTO_MSPRO_MASK                       (1 << 27)
-#define OMAP2420_AUTO_MMC_MASK                         (1 << 26)
-#define OMAP24XX_AUTO_FAC_MASK                         (1 << 25)
-#define OMAP2420_AUTO_EAC_MASK                         (1 << 24)
-#define OMAP24XX_AUTO_HDQ_MASK                         (1 << 23)
-#define OMAP24XX_AUTO_UART2_MASK                       (1 << 22)
-#define OMAP24XX_AUTO_UART1_MASK                       (1 << 21)
-#define OMAP24XX_AUTO_I2C2_MASK                                (1 << 20)
-#define OMAP24XX_AUTO_I2C1_MASK                                (1 << 19)
-#define OMAP24XX_AUTO_MCSPI2_MASK                      (1 << 18)
-#define OMAP24XX_AUTO_MCSPI1_MASK                      (1 << 17)
-#define OMAP24XX_AUTO_MCBSP2_MASK                      (1 << 16)
-#define OMAP24XX_AUTO_MCBSP1_MASK                      (1 << 15)
-#define OMAP24XX_AUTO_GPT12_MASK                       (1 << 14)
-#define OMAP24XX_AUTO_GPT11_MASK                       (1 << 13)
-#define OMAP24XX_AUTO_GPT10_MASK                       (1 << 12)
-#define OMAP24XX_AUTO_GPT9_MASK                                (1 << 11)
-#define OMAP24XX_AUTO_GPT8_MASK                                (1 << 10)
-#define OMAP24XX_AUTO_GPT7_MASK                                (1 << 9)
-#define OMAP24XX_AUTO_GPT6_MASK                                (1 << 8)
-#define OMAP24XX_AUTO_GPT5_MASK                                (1 << 7)
-#define OMAP24XX_AUTO_GPT4_MASK                                (1 << 6)
-#define OMAP24XX_AUTO_GPT3_MASK                                (1 << 5)
-#define OMAP24XX_AUTO_GPT2_MASK                                (1 << 4)
-#define OMAP2420_AUTO_VLYNQ_MASK                       (1 << 3)
-#define OMAP24XX_AUTO_DSS_MASK                         (1 << 0)
-
-/* CM_AUTOIDLE2_CORE */
-#define OMAP2430_AUTO_MDM_INTC_MASK                    (1 << 11)
-#define OMAP2430_AUTO_GPIO5_MASK                       (1 << 10)
-#define OMAP2430_AUTO_MCSPI3_MASK                      (1 << 9)
-#define OMAP2430_AUTO_MMCHS2_MASK                      (1 << 8)
-#define OMAP2430_AUTO_MMCHS1_MASK                      (1 << 7)
-#define OMAP2430_AUTO_USBHS_MASK                       (1 << 6)
-#define OMAP2430_AUTO_MCBSP5_MASK                      (1 << 5)
-#define OMAP2430_AUTO_MCBSP4_MASK                      (1 << 4)
-#define OMAP2430_AUTO_MCBSP3_MASK                      (1 << 3)
-#define OMAP24XX_AUTO_UART3_MASK                       (1 << 2)
-#define OMAP24XX_AUTO_SSI_MASK                         (1 << 1)
-#define OMAP24XX_AUTO_USB_MASK                         (1 << 0)
-
-/* CM_AUTOIDLE3_CORE */
 #define OMAP24XX_AUTO_SDRC_SHIFT                       2
-#define OMAP24XX_AUTO_SDRC_MASK                                (1 << 2)
 #define OMAP24XX_AUTO_GPMC_SHIFT                       1
-#define OMAP24XX_AUTO_GPMC_MASK                                (1 << 1)
 #define OMAP24XX_AUTO_SDMA_SHIFT                       0
-#define OMAP24XX_AUTO_SDMA_MASK                                (1 << 0)
-
-/* CM_AUTOIDLE4_CORE */
-#define OMAP24XX_AUTO_PKA_MASK                         (1 << 4)
-#define OMAP24XX_AUTO_AES_MASK                         (1 << 3)
-#define OMAP24XX_AUTO_RNG_MASK                         (1 << 2)
-#define OMAP24XX_AUTO_SHA_MASK                         (1 << 1)
-#define OMAP24XX_AUTO_DES_MASK                         (1 << 0)
-
-/* CM_CLKSEL1_CORE */
-#define OMAP24XX_CLKSEL_USB_SHIFT                      25
 #define OMAP24XX_CLKSEL_USB_MASK                       (0x7 << 25)
-#define OMAP24XX_CLKSEL_SSI_SHIFT                      20
 #define OMAP24XX_CLKSEL_SSI_MASK                       (0x1f << 20)
-#define OMAP2420_CLKSEL_VLYNQ_SHIFT                    15
 #define OMAP2420_CLKSEL_VLYNQ_MASK                     (0x1f << 15)
-#define OMAP24XX_CLKSEL_DSS2_SHIFT                     13
 #define OMAP24XX_CLKSEL_DSS2_MASK                      (0x1 << 13)
-#define OMAP24XX_CLKSEL_DSS1_SHIFT                     8
 #define OMAP24XX_CLKSEL_DSS1_MASK                      (0x1f << 8)
 #define OMAP24XX_CLKSEL_L4_SHIFT                       5
-#define OMAP24XX_CLKSEL_L4_MASK                                (0x3 << 5)
 #define OMAP24XX_CLKSEL_L4_WIDTH                       2
 #define OMAP24XX_CLKSEL_L3_SHIFT                       0
-#define OMAP24XX_CLKSEL_L3_MASK                                (0x1f << 0)
 #define OMAP24XX_CLKSEL_L3_WIDTH                       5
-
-/* CM_CLKSEL2_CORE */
-#define OMAP24XX_CLKSEL_GPT12_SHIFT                    22
 #define OMAP24XX_CLKSEL_GPT12_MASK                     (0x3 << 22)
-#define OMAP24XX_CLKSEL_GPT11_SHIFT                    20
 #define OMAP24XX_CLKSEL_GPT11_MASK                     (0x3 << 20)
-#define OMAP24XX_CLKSEL_GPT10_SHIFT                    18
 #define OMAP24XX_CLKSEL_GPT10_MASK                     (0x3 << 18)
-#define OMAP24XX_CLKSEL_GPT9_SHIFT                     16
 #define OMAP24XX_CLKSEL_GPT9_MASK                      (0x3 << 16)
-#define OMAP24XX_CLKSEL_GPT8_SHIFT                     14
 #define OMAP24XX_CLKSEL_GPT8_MASK                      (0x3 << 14)
-#define OMAP24XX_CLKSEL_GPT7_SHIFT                     12
 #define OMAP24XX_CLKSEL_GPT7_MASK                      (0x3 << 12)
-#define OMAP24XX_CLKSEL_GPT6_SHIFT                     10
 #define OMAP24XX_CLKSEL_GPT6_MASK                      (0x3 << 10)
-#define OMAP24XX_CLKSEL_GPT5_SHIFT                     8
 #define OMAP24XX_CLKSEL_GPT5_MASK                      (0x3 << 8)
-#define OMAP24XX_CLKSEL_GPT4_SHIFT                     6
 #define OMAP24XX_CLKSEL_GPT4_MASK                      (0x3 << 6)
-#define OMAP24XX_CLKSEL_GPT3_SHIFT                     4
 #define OMAP24XX_CLKSEL_GPT3_MASK                      (0x3 << 4)
-#define OMAP24XX_CLKSEL_GPT2_SHIFT                     2
 #define OMAP24XX_CLKSEL_GPT2_MASK                      (0x3 << 2)
-
-/* CM_CLKSTCTRL_CORE */
-#define OMAP24XX_AUTOSTATE_DSS_SHIFT                   2
 #define OMAP24XX_AUTOSTATE_DSS_MASK                    (1 << 2)
-#define OMAP24XX_AUTOSTATE_L4_SHIFT                    1
 #define OMAP24XX_AUTOSTATE_L4_MASK                     (1 << 1)
-#define OMAP24XX_AUTOSTATE_L3_SHIFT                    0
 #define OMAP24XX_AUTOSTATE_L3_MASK                     (1 << 0)
-
-/* CM_FCLKEN_GFX */
 #define OMAP24XX_EN_3D_SHIFT                           2
-#define OMAP24XX_EN_3D_MASK                            (1 << 2)
 #define OMAP24XX_EN_2D_SHIFT                           1
-#define OMAP24XX_EN_2D_MASK                            (1 << 1)
-
-/* CM_ICLKEN_GFX specific bits */
-
-/* CM_IDLEST_GFX specific bits */
-
-/* CM_CLKSEL_GFX specific bits */
-
-/* CM_CLKSTCTRL_GFX */
-#define OMAP24XX_AUTOSTATE_GFX_SHIFT                   0
 #define OMAP24XX_AUTOSTATE_GFX_MASK                    (1 << 0)
-
-/* CM_FCLKEN_WKUP specific bits */
-
-/* CM_ICLKEN_WKUP specific bits */
 #define OMAP2430_EN_ICR_SHIFT                          6
-#define OMAP2430_EN_ICR_MASK                           (1 << 6)
 #define OMAP24XX_EN_OMAPCTRL_SHIFT                     5
-#define OMAP24XX_EN_OMAPCTRL_MASK                      (1 << 5)
 #define OMAP24XX_EN_WDT1_SHIFT                         4
-#define OMAP24XX_EN_WDT1_MASK                          (1 << 4)
 #define OMAP24XX_EN_32KSYNC_SHIFT                      1
-#define OMAP24XX_EN_32KSYNC_MASK                       (1 << 1)
-
-/* CM_IDLEST_WKUP specific bits */
-#define OMAP2430_ST_ICR_SHIFT                          6
-#define OMAP2430_ST_ICR_MASK                           (1 << 6)
-#define OMAP24XX_ST_OMAPCTRL_SHIFT                     5
-#define OMAP24XX_ST_OMAPCTRL_MASK                      (1 << 5)
-#define OMAP24XX_ST_WDT1_SHIFT                         4
-#define OMAP24XX_ST_WDT1_MASK                          (1 << 4)
 #define OMAP24XX_ST_MPU_WDT_SHIFT                      3
-#define OMAP24XX_ST_MPU_WDT_MASK                       (1 << 3)
 #define OMAP24XX_ST_32KSYNC_SHIFT                      1
-#define OMAP24XX_ST_32KSYNC_MASK                       (1 << 1)
-
-/* CM_AUTOIDLE_WKUP */
-#define OMAP24XX_AUTO_OMAPCTRL_MASK                    (1 << 5)
-#define OMAP24XX_AUTO_WDT1_MASK                                (1 << 4)
-#define OMAP24XX_AUTO_MPU_WDT_MASK                     (1 << 3)
-#define OMAP24XX_AUTO_GPIOS_MASK                       (1 << 2)
-#define OMAP24XX_AUTO_32KSYNC_MASK                     (1 << 1)
-#define OMAP24XX_AUTO_GPT1_MASK                                (1 << 0)
-
-/* CM_CLKSEL_WKUP */
-#define OMAP24XX_CLKSEL_GPT1_SHIFT                     0
 #define OMAP24XX_CLKSEL_GPT1_MASK                      (0x3 << 0)
-
-/* CM_CLKEN_PLL */
 #define OMAP24XX_EN_54M_PLL_SHIFT                      6
-#define OMAP24XX_EN_54M_PLL_MASK                       (0x3 << 6)
 #define OMAP24XX_EN_96M_PLL_SHIFT                      2
-#define OMAP24XX_EN_96M_PLL_MASK                       (0x3 << 2)
-#define OMAP24XX_EN_DPLL_SHIFT                         0
 #define OMAP24XX_EN_DPLL_MASK                          (0x3 << 0)
-
-/* CM_IDLEST_CKGEN */
 #define OMAP24XX_ST_54M_APLL_SHIFT                     9
-#define OMAP24XX_ST_54M_APLL_MASK                      (1 << 9)
 #define OMAP24XX_ST_96M_APLL_SHIFT                     8
-#define OMAP24XX_ST_96M_APLL_MASK                      (1 << 8)
-#define OMAP24XX_ST_54M_CLK_MASK                       (1 << 6)
-#define OMAP24XX_ST_12M_CLK_MASK                       (1 << 5)
-#define OMAP24XX_ST_48M_CLK_MASK                       (1 << 4)
-#define OMAP24XX_ST_96M_CLK_MASK                       (1 << 2)
-#define OMAP24XX_ST_CORE_CLK_SHIFT                     0
-#define OMAP24XX_ST_CORE_CLK_MASK                      (0x3 << 0)
-
-/* CM_AUTOIDLE_PLL */
-#define OMAP24XX_AUTO_54M_SHIFT                                6
 #define OMAP24XX_AUTO_54M_MASK                         (0x3 << 6)
-#define OMAP24XX_AUTO_96M_SHIFT                                2
 #define OMAP24XX_AUTO_96M_MASK                         (0x3 << 2)
 #define OMAP24XX_AUTO_DPLL_SHIFT                       0
 #define OMAP24XX_AUTO_DPLL_MASK                                (0x3 << 0)
-
-/* CM_CLKSEL1_PLL */
-#define OMAP2430_MAXDPLLFASTLOCK_SHIFT                 28
-#define OMAP2430_MAXDPLLFASTLOCK_MASK                  (0x7 << 28)
 #define OMAP24XX_APLLS_CLKIN_SHIFT                     23
 #define OMAP24XX_APLLS_CLKIN_MASK                      (0x7 << 23)
-#define OMAP24XX_DPLL_MULT_SHIFT                       12
 #define OMAP24XX_DPLL_MULT_MASK                                (0x3ff << 12)
-#define OMAP24XX_DPLL_DIV_SHIFT                                8
 #define OMAP24XX_DPLL_DIV_MASK                         (0xf << 8)
 #define OMAP24XX_54M_SOURCE_SHIFT                      5
-#define OMAP24XX_54M_SOURCE_MASK                       (1 << 5)
 #define OMAP24XX_54M_SOURCE_WIDTH                      1
 #define OMAP2430_96M_SOURCE_SHIFT                      4
-#define OMAP2430_96M_SOURCE_MASK                       (1 << 4)
 #define OMAP2430_96M_SOURCE_WIDTH                      1
-#define OMAP24XX_48M_SOURCE_SHIFT                      3
 #define OMAP24XX_48M_SOURCE_MASK                       (1 << 3)
-#define OMAP2430_ALTCLK_SOURCE_SHIFT                   0
-#define OMAP2430_ALTCLK_SOURCE_MASK                    (0x7 << 0)
-
-/* CM_CLKSEL2_PLL */
-#define OMAP24XX_CORE_CLK_SRC_SHIFT                    0
 #define OMAP24XX_CORE_CLK_SRC_MASK                     (0x3 << 0)
-
-/* CM_FCLKEN_DSP */
 #define OMAP2420_EN_IVA_COP_SHIFT                      10
-#define OMAP2420_EN_IVA_COP_MASK                       (1 << 10)
 #define OMAP2420_EN_IVA_MPU_SHIFT                      8
-#define OMAP2420_EN_IVA_MPU_MASK                       (1 << 8)
 #define OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT            0
-#define OMAP24XX_CM_FCLKEN_DSP_EN_DSP_MASK             (1 << 0)
-
-/* CM_ICLKEN_DSP */
 #define OMAP2420_EN_DSP_IPI_SHIFT                      1
-#define OMAP2420_EN_DSP_IPI_MASK                       (1 << 1)
-
-/* CM_IDLEST_DSP */
-#define OMAP2420_ST_IVA_MASK                           (1 << 8)
-#define OMAP2420_ST_IPI_MASK                           (1 << 1)
-#define OMAP24XX_ST_DSP_MASK                           (1 << 0)
-
-/* CM_AUTOIDLE_DSP */
-#define OMAP2420_AUTO_DSP_IPI_MASK                     (1 << 1)
-
-/* CM_CLKSEL_DSP */
-#define OMAP2420_SYNC_IVA_MASK                         (1 << 13)
-#define OMAP2420_CLKSEL_IVA_SHIFT                      8
 #define OMAP2420_CLKSEL_IVA_MASK                       (0x1f << 8)
-#define OMAP24XX_SYNC_DSP_MASK                         (1 << 7)
-#define OMAP24XX_CLKSEL_DSP_IF_SHIFT                   5
 #define OMAP24XX_CLKSEL_DSP_IF_MASK                    (0x3 << 5)
-#define OMAP24XX_CLKSEL_DSP_SHIFT                      0
 #define OMAP24XX_CLKSEL_DSP_MASK                       (0x1f << 0)
-
-/* CM_CLKSTCTRL_DSP */
-#define OMAP2420_AUTOSTATE_IVA_SHIFT                   8
 #define OMAP2420_AUTOSTATE_IVA_MASK                    (1 << 8)
-#define OMAP24XX_AUTOSTATE_DSP_SHIFT                   0
 #define OMAP24XX_AUTOSTATE_DSP_MASK                    (1 << 0)
-
-/* CM_FCLKEN_MDM */
-/* 2430 only */
 #define OMAP2430_EN_OSC_SHIFT                          1
-#define OMAP2430_EN_OSC_MASK                           (1 << 1)
-
-/* CM_ICLKEN_MDM */
-/* 2430 only */
 #define OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT            0
-#define OMAP2430_CM_ICLKEN_MDM_EN_MDM_MASK             (1 << 0)
-
-/* CM_IDLEST_MDM specific bits */
-/* 2430 only */
-
-/* CM_AUTOIDLE_MDM */
-/* 2430 only */
-#define OMAP2430_AUTO_OSC_MASK                         (1 << 1)
-#define OMAP2430_AUTO_MDM_MASK                         (1 << 0)
-
-/* CM_CLKSEL_MDM */
-/* 2430 only */
-#define OMAP2430_SYNC_MDM_MASK                         (1 << 4)
-#define OMAP2430_CLKSEL_MDM_SHIFT                      0
 #define OMAP2430_CLKSEL_MDM_MASK                       (0xf << 0)
-
-/* CM_CLKSTCTRL_MDM */
-/* 2430 only */
-#define OMAP2430_AUTOSTATE_MDM_SHIFT                   0
 #define OMAP2430_AUTOSTATE_MDM_MASK                    (1 << 0)
-
-/* OMAP24XX CM_CLKSTCTRL_*.AUTOSTATE_* register bit values */
 #define OMAP24XX_CLKSTCTRL_DISABLE_AUTO                0x0
 #define OMAP24XX_CLKSTCTRL_ENABLE_AUTO         0x1
-
-
 #endif
index adf7bb7..c0823fd 100644 (file)
 #ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_33XX_H
 #define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_33XX_H
 
-/*
- * Used by CM_AUTOIDLE_DPLL_CORE, CM_AUTOIDLE_DPLL_DDR, CM_AUTOIDLE_DPLL_DISP,
- * CM_AUTOIDLE_DPLL_MPU, CM_AUTOIDLE_DPLL_PER
- */
-#define AM33XX_AUTO_DPLL_MODE_SHIFT                    0
-#define AM33XX_AUTO_DPLL_MODE_WIDTH                    3
-#define AM33XX_AUTO_DPLL_MODE_MASK                     (0x7 << 0)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_ADC_FCLK_SHIFT              14
-#define AM33XX_CLKACTIVITY_ADC_FCLK_WIDTH              1
-#define AM33XX_CLKACTIVITY_ADC_FCLK_MASK               (1 << 16)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CAN_CLK_SHIFT               11
-#define AM33XX_CLKACTIVITY_CAN_CLK_WIDTH               1
-#define AM33XX_CLKACTIVITY_CAN_CLK_MASK                        (1 << 11)
-
-/* Used by CM_PER_CLK_24MHZ_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_SHIFT                4
-#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_WIDTH                1
-#define AM33XX_CLKACTIVITY_CLK_24MHZ_GCLK_MASK         (1 << 4)
-
-/* Used by CM_PER_CPSW_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_SHIFT      4
-#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_WIDTH      1
-#define AM33XX_CLKACTIVITY_CPSW_125MHZ_GCLK_MASK       (1 << 4)
-
-/* Used by CM_PER_L4HS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_SHIFT      4
-#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_WIDTH      1
-#define AM33XX_CLKACTIVITY_CPSW_250MHZ_GCLK_MASK       (1 << 4)
-
-/* Used by CM_PER_L4HS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_SHIFT       5
-#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_WIDTH       1
-#define AM33XX_CLKACTIVITY_CPSW_50MHZ_GCLK_MASK                (1 << 5)
-
-/* Used by CM_PER_L4HS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_SHIFT                6
-#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_WIDTH                1
-#define AM33XX_CLKACTIVITY_CPSW_5MHZ_GCLK_MASK         (1 << 6)
-
-/* Used by CM_PER_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_SHIFT         6
-#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_CPTS_RFT_GCLK_MASK          (1 << 6)
-
-/* Used by CM_CEFUSE_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT    9
-#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_WIDTH    1
-#define AM33XX_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK     (1 << 9)
-
-/* Used by CM_L3_AON_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_DBGSYSCLK_SHIFT             2
-#define AM33XX_CLKACTIVITY_DBGSYSCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_DBGSYSCLK_MASK              (1 << 2)
-
-/* Used by CM_L3_AON_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_DEBUG_CLKA_SHIFT            4
-#define AM33XX_CLKACTIVITY_DEBUG_CLKA_WIDTH            1
-#define AM33XX_CLKACTIVITY_DEBUG_CLKA_MASK             (1 << 4)
-
-/* Used by CM_PER_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_EMIF_GCLK_SHIFT             2
-#define AM33XX_CLKACTIVITY_EMIF_GCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_EMIF_GCLK_MASK              (1 << 2)
-
-/* Used by CM_GFX_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GFX_FCLK_SHIFT              9
-#define AM33XX_CLKACTIVITY_GFX_FCLK_WIDTH              1
-#define AM33XX_CLKACTIVITY_GFX_FCLK_MASK               (1 << 9)
-
-/* Used by CM_GFX_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_SHIFT           8
-#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_GFX_L3_GCLK_MASK            (1 << 8)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_SHIFT          8
-#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_WIDTH          1
-#define AM33XX_CLKACTIVITY_GPIO0_GDBCLK_MASK           (1 << 8)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_SHIFT         19
-#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_GPIO_1_GDBCLK_MASK          (1 << 19)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_SHIFT         20
-#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_GPIO_2_GDBCLK_MASK          (1 << 20)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_SHIFT         21
-#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_GPIO_3_GDBCLK_MASK          (1 << 21)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_SHIFT         22
-#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_GPIO_4_GDBCLK_MASK          (1 << 22)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_SHIFT         26
-#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_GPIO_5_GDBCLK_MASK          (1 << 26)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_SHIFT         18
-#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_GPIO_6_GDBCLK_MASK          (1 << 18)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_I2C0_GFCLK_SHIFT            11
-#define AM33XX_CLKACTIVITY_I2C0_GFCLK_WIDTH            1
-#define AM33XX_CLKACTIVITY_I2C0_GFCLK_MASK             (1 << 11)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_I2C_FCLK_SHIFT              24
-#define AM33XX_CLKACTIVITY_I2C_FCLK_WIDTH              1
-#define AM33XX_CLKACTIVITY_I2C_FCLK_MASK               (1 << 24)
-
-/* Used by CM_PER_PRUSS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_SHIFT                5
-#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_WIDTH                1
-#define AM33XX_CLKACTIVITY_PRUSS_IEP_GCLK_MASK         (1 << 5)
-
-/* Used by CM_PER_PRUSS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_SHIFT                4
-#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_WIDTH                1
-#define AM33XX_CLKACTIVITY_PRUSS_OCP_GCLK_MASK         (1 << 4)
-
-/* Used by CM_PER_PRUSS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_SHIFT       6
-#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_WIDTH       1
-#define AM33XX_CLKACTIVITY_PRUSS_UART_GCLK_MASK                (1 << 6)
-
-/* Used by CM_PER_L3S_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L3S_GCLK_SHIFT              3
-#define AM33XX_CLKACTIVITY_L3S_GCLK_WIDTH              1
-#define AM33XX_CLKACTIVITY_L3S_GCLK_MASK               (1 << 3)
-
-/* Used by CM_L3_AON_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L3_AON_GCLK_SHIFT           3
-#define AM33XX_CLKACTIVITY_L3_AON_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_L3_AON_GCLK_MASK            (1 << 3)
-
-/* Used by CM_PER_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L3_GCLK_SHIFT               4
-#define AM33XX_CLKACTIVITY_L3_GCLK_WIDTH               1
-#define AM33XX_CLKACTIVITY_L3_GCLK_MASK                        (1 << 4)
-
-/* Used by CM_PER_L4FW_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L4FW_GCLK_SHIFT             8
-#define AM33XX_CLKACTIVITY_L4FW_GCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_L4FW_GCLK_MASK              (1 << 8)
-
-/* Used by CM_PER_L4HS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L4HS_GCLK_SHIFT             3
-#define AM33XX_CLKACTIVITY_L4HS_GCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_L4HS_GCLK_MASK              (1 << 3)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L4LS_GCLK_SHIFT             8
-#define AM33XX_CLKACTIVITY_L4LS_GCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_L4LS_GCLK_MASK              (1 << 8)
-
-/* Used by CM_GFX_L4LS_GFX_CLKSTCTRL__1 */
-#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_SHIFT         8
-#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_L4LS_GFX_GCLK_MASK          (1 << 8)
-
-/* Used by CM_CEFUSE_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT       8
-#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_WIDTH       1
-#define AM33XX_CLKACTIVITY_L4_CEFUSE_GICLK_MASK                (1 << 8)
-
-/* Used by CM_RTC_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_SHIFT           8
-#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_L4_RTC_GCLK_MASK            (1 << 8)
-
-/* Used by CM_L4_WKUP_AON_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_SHIFT      2
-#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_WIDTH      1
-#define AM33XX_CLKACTIVITY_L4_WKUP_AON_GCLK_MASK       (1 << 2)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_SHIFT          2
-#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_WIDTH          1
-#define AM33XX_CLKACTIVITY_L4_WKUP_GCLK_MASK           (1 << 2)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_LCDC_GCLK_SHIFT             17
-#define AM33XX_CLKACTIVITY_LCDC_GCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_LCDC_GCLK_MASK              (1 << 17)
-
-/* Used by CM_PER_LCDC_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_SHIFT      4
-#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_WIDTH      1
-#define AM33XX_CLKACTIVITY_LCDC_L3_OCP_GCLK_MASK       (1 << 4)
-
-/* Used by CM_PER_LCDC_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_SHIFT      5
-#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_WIDTH      1
-#define AM33XX_CLKACTIVITY_LCDC_L4_OCP_GCLK_MASK       (1 << 5)
-
-/* Used by CM_PER_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_MCASP_GCLK_SHIFT            7
-#define AM33XX_CLKACTIVITY_MCASP_GCLK_WIDTH            1
-#define AM33XX_CLKACTIVITY_MCASP_GCLK_MASK             (1 << 7)
-
-/* Used by CM_PER_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_MMC_FCLK_SHIFT              3
-#define AM33XX_CLKACTIVITY_MMC_FCLK_WIDTH              1
-#define AM33XX_CLKACTIVITY_MMC_FCLK_MASK               (1 << 3)
-
-/* Used by CM_MPU_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_MPU_CLK_SHIFT               2
-#define AM33XX_CLKACTIVITY_MPU_CLK_WIDTH               1
-#define AM33XX_CLKACTIVITY_MPU_CLK_MASK                        (1 << 2)
-
-/* Used by CM_PER_OCPWP_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_SHIFT         4
-#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_OCPWP_L3_GCLK_MASK          (1 << 4)
-
-/* Used by CM_PER_OCPWP_L3_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_SHIFT         5
-#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_WIDTH         1
-#define AM33XX_CLKACTIVITY_OCPWP_L4_GCLK_MASK          (1 << 5)
-
-/* Used by CM_RTC_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_RTC_32KCLK_SHIFT            9
-#define AM33XX_CLKACTIVITY_RTC_32KCLK_WIDTH            1
-#define AM33XX_CLKACTIVITY_RTC_32KCLK_MASK             (1 << 9)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_SPI_GCLK_SHIFT              25
-#define AM33XX_CLKACTIVITY_SPI_GCLK_WIDTH              1
-#define AM33XX_CLKACTIVITY_SPI_GCLK_MASK               (1 << 25)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_SR_SYSCLK_SHIFT             3
-#define AM33XX_CLKACTIVITY_SR_SYSCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_SR_SYSCLK_MASK              (1 << 3)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER0_GCLK_SHIFT           10
-#define AM33XX_CLKACTIVITY_TIMER0_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER0_GCLK_MASK            (1 << 10)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER1_GCLK_SHIFT           13
-#define AM33XX_CLKACTIVITY_TIMER1_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER1_GCLK_MASK            (1 << 13)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER2_GCLK_SHIFT           14
-#define AM33XX_CLKACTIVITY_TIMER2_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER2_GCLK_MASK            (1 << 14)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER3_GCLK_SHIFT           15
-#define AM33XX_CLKACTIVITY_TIMER3_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER3_GCLK_MASK            (1 << 15)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER4_GCLK_SHIFT           16
-#define AM33XX_CLKACTIVITY_TIMER4_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER4_GCLK_MASK            (1 << 16)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER5_GCLK_SHIFT           27
-#define AM33XX_CLKACTIVITY_TIMER5_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER5_GCLK_MASK            (1 << 27)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER6_GCLK_SHIFT           28
-#define AM33XX_CLKACTIVITY_TIMER6_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER6_GCLK_MASK            (1 << 28)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_TIMER7_GCLK_SHIFT           13
-#define AM33XX_CLKACTIVITY_TIMER7_GCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_TIMER7_GCLK_MASK            (1 << 13)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_UART0_GFCLK_SHIFT           12
-#define AM33XX_CLKACTIVITY_UART0_GFCLK_WIDTH           1
-#define AM33XX_CLKACTIVITY_UART0_GFCLK_MASK            (1 << 12)
-
-/* Used by CM_PER_L4LS_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_UART_GFCLK_SHIFT            10
-#define AM33XX_CLKACTIVITY_UART_GFCLK_WIDTH            1
-#define AM33XX_CLKACTIVITY_UART_GFCLK_MASK             (1 << 10)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_WDT0_GCLK_SHIFT             9
-#define AM33XX_CLKACTIVITY_WDT0_GCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_WDT0_GCLK_MASK              (1 << 9)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define AM33XX_CLKACTIVITY_WDT1_GCLK_SHIFT             4
-#define AM33XX_CLKACTIVITY_WDT1_GCLK_WIDTH             1
-#define AM33XX_CLKACTIVITY_WDT1_GCLK_MASK              (1 << 4)
-
-/* Used by CLKSEL_GFX_FCLK */
-#define AM33XX_CLKDIV_SEL_GFX_FCLK_SHIFT               0
-#define AM33XX_CLKDIV_SEL_GFX_FCLK_WIDTH               1
-#define AM33XX_CLKDIV_SEL_GFX_FCLK_MASK                        (1 << 0)
-
-/* Used by CM_CLKOUT_CTRL */
 #define AM33XX_CLKOUT2DIV_SHIFT                                3
 #define AM33XX_CLKOUT2DIV_WIDTH                                3
-#define AM33XX_CLKOUT2DIV_MASK                         (0x7 << 3)
-
-/* Used by CM_CLKOUT_CTRL */
 #define AM33XX_CLKOUT2EN_SHIFT                         7
-#define AM33XX_CLKOUT2EN_WIDTH                         1
-#define AM33XX_CLKOUT2EN_MASK                          (1 << 7)
-
-/* Used by CM_CLKOUT_CTRL */
-#define AM33XX_CLKOUT2SOURCE_SHIFT                     0
-#define AM33XX_CLKOUT2SOURCE_WIDTH                     3
 #define AM33XX_CLKOUT2SOURCE_MASK                      (0x7 << 0)
-
-/*
- * Used by CLKSEL_GPIO0_DBCLK, CLKSEL_LCDC_PIXEL_CLK, CLKSEL_TIMER2_CLK,
- * CLKSEL_TIMER3_CLK, CLKSEL_TIMER4_CLK, CLKSEL_TIMER5_CLK, CLKSEL_TIMER6_CLK,
- * CLKSEL_TIMER7_CLK
- */
-#define AM33XX_CLKSEL_SHIFT                            0
-#define AM33XX_CLKSEL_WIDTH                            1
-#define AM33XX_CLKSEL_MASK                             (0x01 << 0)
-
-/*
- * Renamed from CLKSEL Used by CLKSEL_PRUSS_OCP_CLK, CLKSEL_WDT1_CLK,
- * CM_CPTS_RFT_CLKSEL
- */
 #define AM33XX_CLKSEL_0_0_SHIFT                                0
 #define AM33XX_CLKSEL_0_0_WIDTH                                1
 #define AM33XX_CLKSEL_0_0_MASK                         (1 << 0)
-
-#define AM33XX_CLKSEL_0_1_SHIFT                                0
-#define AM33XX_CLKSEL_0_1_WIDTH                                2
 #define AM33XX_CLKSEL_0_1_MASK                         (3 << 0)
-
-/* Renamed from CLKSEL Used by CLKSEL_TIMER1MS_CLK */
-#define AM33XX_CLKSEL_0_2_SHIFT                                0
-#define AM33XX_CLKSEL_0_2_WIDTH                                3
 #define AM33XX_CLKSEL_0_2_MASK                         (7 << 0)
-
-/* Used by CLKSEL_GFX_FCLK */
-#define AM33XX_CLKSEL_GFX_FCLK_SHIFT                   1
-#define AM33XX_CLKSEL_GFX_FCLK_WIDTH                   1
 #define AM33XX_CLKSEL_GFX_FCLK_MASK                    (1 << 1)
-
-/*
- * Used by CM_MPU_CLKSTCTRL, CM_RTC_CLKSTCTRL, CM_PER_CLK_24MHZ_CLKSTCTRL,
- * CM_PER_CPSW_CLKSTCTRL, CM_PER_PRUSS_CLKSTCTRL, CM_PER_L3S_CLKSTCTRL,
- * CM_PER_L3_CLKSTCTRL, CM_PER_L4FW_CLKSTCTRL, CM_PER_L4HS_CLKSTCTRL,
- * CM_PER_L4LS_CLKSTCTRL, CM_PER_LCDC_CLKSTCTRL, CM_PER_OCPWP_L3_CLKSTCTRL,
- * CM_L3_AON_CLKSTCTRL, CM_L4_WKUP_AON_CLKSTCTRL, CM_WKUP_CLKSTCTRL,
- * CM_GFX_L3_CLKSTCTRL, CM_GFX_L4LS_GFX_CLKSTCTRL__1, CM_CEFUSE_CLKSTCTRL
- */
 #define AM33XX_CLKTRCTRL_SHIFT                         0
-#define AM33XX_CLKTRCTRL_WIDTH                         2
 #define AM33XX_CLKTRCTRL_MASK                          (0x3 << 0)
-
-/*
- * Used by CM_SSC_DELTAMSTEP_DPLL_CORE, CM_SSC_DELTAMSTEP_DPLL_DDR,
- * CM_SSC_DELTAMSTEP_DPLL_DISP, CM_SSC_DELTAMSTEP_DPLL_MPU,
- * CM_SSC_DELTAMSTEP_DPLL_PER
- */
-#define AM33XX_DELTAMSTEP_SHIFT                                0
-#define AM33XX_DELTAMSTEP_WIDTH                                20
-#define AM33XX_DELTAMSTEP_MASK                         (0xfffff << 0)
-
-/* Used by CM_CLKSEL_DPLL_DDR, CM_CLKSEL_DPLL_DISP, CM_CLKSEL_DPLL_MPU */
-#define AM33XX_DPLL_BYP_CLKSEL_SHIFT                   23
-#define AM33XX_DPLL_BYP_CLKSEL_WIDTH                   1
-#define AM33XX_DPLL_BYP_CLKSEL_MASK                    (1 << 23)
-
-/* Used by CM_CLKDCOLDO_DPLL_PER */
-#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT          8
-#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_WIDTH          1
-#define AM33XX_DPLL_CLKDCOLDO_GATE_CTRL_MASK           (1 << 8)
-
-/* Used by CM_CLKDCOLDO_DPLL_PER */
-#define AM33XX_DPLL_CLKDCOLDO_PWDN_SHIFT               12
-#define AM33XX_DPLL_CLKDCOLDO_PWDN_WIDTH               1
-#define AM33XX_DPLL_CLKDCOLDO_PWDN_MASK                        (1 << 12)
-
-/* Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU */
 #define AM33XX_DPLL_CLKOUT_DIV_SHIFT                   0
 #define AM33XX_DPLL_CLKOUT_DIV_WIDTH                   5
-#define AM33XX_DPLL_CLKOUT_DIV_MASK                    (0x1f << 0)
-
-/* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_PER */
-#define AM33XX_DPLL_CLKOUT_DIV_0_6_SHIFT               0
-#define AM33XX_DPLL_CLKOUT_DIV_0_6_WIDTH               7
-#define AM33XX_DPLL_CLKOUT_DIV_0_6_MASK                        (0x7f << 0)
-
-/* Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU */
-#define AM33XX_DPLL_CLKOUT_DIVCHACK_SHIFT              5
-#define AM33XX_DPLL_CLKOUT_DIVCHACK_WIDTH              1
-#define AM33XX_DPLL_CLKOUT_DIVCHACK_MASK               (1 << 5)
-
-/* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_PER */
-#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_SHIFT       7
-#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_WIDTH       1
-#define AM33XX_DPLL_CLKOUT_DIVCHACK_M2_PER_MASK                (1 << 7)
-
-/*
- * Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU,
- * CM_DIV_M2_DPLL_PER
- */
-#define AM33XX_DPLL_CLKOUT_GATE_CTRL_SHIFT             8
-#define AM33XX_DPLL_CLKOUT_GATE_CTRL_WIDTH             1
-#define AM33XX_DPLL_CLKOUT_GATE_CTRL_MASK              (1 << 8)
-
-/*
- * Used by CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_DDR, CM_CLKSEL_DPLL_DISP,
- * CM_CLKSEL_DPLL_MPU
- */
-#define AM33XX_DPLL_DIV_SHIFT                          0
-#define AM33XX_DPLL_DIV_WIDTH                          7
 #define AM33XX_DPLL_DIV_MASK                           (0x7f << 0)
-
 #define AM33XX_DPLL_PER_DIV_MASK                       (0xff << 0)
-
-/* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_PERIPH */
-#define AM33XX_DPLL_DIV_0_7_SHIFT                      0
-#define AM33XX_DPLL_DIV_0_7_WIDTH                      8
-#define AM33XX_DPLL_DIV_0_7_MASK                       (0xff << 0)
-
-/*
- * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
- * CM_CLKMODE_DPLL_MPU
- */
-#define AM33XX_DPLL_DRIFTGUARD_EN_SHIFT                        8
-#define AM33XX_DPLL_DRIFTGUARD_EN_WIDTH                        1
-#define AM33XX_DPLL_DRIFTGUARD_EN_MASK                 (1 << 8)
-
-/*
- * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define AM33XX_DPLL_EN_SHIFT                           0
-#define AM33XX_DPLL_EN_WIDTH                           3
 #define AM33XX_DPLL_EN_MASK                            (0x7 << 0)
-
-/*
- * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
- * CM_CLKMODE_DPLL_MPU
- */
-#define AM33XX_DPLL_LPMODE_EN_SHIFT                    10
-#define AM33XX_DPLL_LPMODE_EN_WIDTH                    1
-#define AM33XX_DPLL_LPMODE_EN_MASK                     (1 << 10)
-
-/*
- * Used by CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_DDR, CM_CLKSEL_DPLL_DISP,
- * CM_CLKSEL_DPLL_MPU
- */
-#define AM33XX_DPLL_MULT_SHIFT                         8
-#define AM33XX_DPLL_MULT_WIDTH                         11
 #define AM33XX_DPLL_MULT_MASK                          (0x7ff << 8)
-
-/* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_PERIPH */
-#define AM33XX_DPLL_MULT_PERIPH_SHIFT                  8
-#define AM33XX_DPLL_MULT_PERIPH_WIDTH                  12
 #define AM33XX_DPLL_MULT_PERIPH_MASK                   (0xfff << 8)
-
-/*
- * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
- * CM_CLKMODE_DPLL_MPU
- */
-#define AM33XX_DPLL_REGM4XEN_SHIFT                     11
-#define AM33XX_DPLL_REGM4XEN_WIDTH                     1
-#define AM33XX_DPLL_REGM4XEN_MASK                      (1 << 11)
-
-/* Used by CM_CLKSEL_DPLL_PERIPH */
-#define AM33XX_DPLL_SD_DIV_SHIFT                       24
-#define AM33XX_DPLL_SD_DIV_WIDTH                       8
-#define AM33XX_DPLL_SD_DIV_MASK                                (0xff << 24)
-
-/*
- * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define AM33XX_DPLL_SSC_ACK_SHIFT                      13
-#define AM33XX_DPLL_SSC_ACK_WIDTH                      1
-#define AM33XX_DPLL_SSC_ACK_MASK                       (1 << 13)
-
-/*
- * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define AM33XX_DPLL_SSC_DOWNSPREAD_SHIFT               14
-#define AM33XX_DPLL_SSC_DOWNSPREAD_WIDTH               1
-#define AM33XX_DPLL_SSC_DOWNSPREAD_MASK                        (1 << 14)
-
-/*
- * Used by CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDR, CM_CLKMODE_DPLL_DISP,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define AM33XX_DPLL_SSC_EN_SHIFT                       12
-#define AM33XX_DPLL_SSC_EN_WIDTH                       1
-#define AM33XX_DPLL_SSC_EN_MASK                                (1 << 12)
-
-/* Used by CM_DIV_M4_DPLL_CORE */
 #define AM33XX_HSDIVIDER_CLKOUT1_DIV_SHIFT             0
 #define AM33XX_HSDIVIDER_CLKOUT1_DIV_WIDTH             5
-#define AM33XX_HSDIVIDER_CLKOUT1_DIV_MASK              (0x1f << 0)
-
-/* Used by CM_DIV_M4_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT                5
-#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_WIDTH                1
-#define AM33XX_HSDIVIDER_CLKOUT1_DIVCHACK_MASK         (1 << 5)
-
-/* Used by CM_DIV_M4_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT       8
-#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_WIDTH       1
-#define AM33XX_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK                (1 << 8)
-
-/* Used by CM_DIV_M4_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_SHIFT            12
-#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_WIDTH            1
-#define AM33XX_HSDIVIDER_CLKOUT1_PWDN_MASK             (1 << 12)
-
-/* Used by CM_DIV_M5_DPLL_CORE */
 #define AM33XX_HSDIVIDER_CLKOUT2_DIV_SHIFT             0
 #define AM33XX_HSDIVIDER_CLKOUT2_DIV_WIDTH             5
-#define AM33XX_HSDIVIDER_CLKOUT2_DIV_MASK              (0x1f << 0)
-
-/* Used by CM_DIV_M5_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT                5
-#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_WIDTH                1
-#define AM33XX_HSDIVIDER_CLKOUT2_DIVCHACK_MASK         (1 << 5)
-
-/* Used by CM_DIV_M5_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT       8
-#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_WIDTH       1
-#define AM33XX_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK                (1 << 8)
-
-/* Used by CM_DIV_M5_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_SHIFT            12
-#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_WIDTH            1
-#define AM33XX_HSDIVIDER_CLKOUT2_PWDN_MASK             (1 << 12)
-
-/* Used by CM_DIV_M6_DPLL_CORE */
 #define AM33XX_HSDIVIDER_CLKOUT3_DIV_SHIFT             0
 #define AM33XX_HSDIVIDER_CLKOUT3_DIV_WIDTH             5
-#define AM33XX_HSDIVIDER_CLKOUT3_DIV_MASK              (0x1f << 0)
-
-/* Used by CM_DIV_M6_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT                5
-#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_WIDTH                1
-#define AM33XX_HSDIVIDER_CLKOUT3_DIVCHACK_MASK         (1 << 5)
-
-/* Used by CM_DIV_M6_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT       8
-#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_WIDTH       1
-#define AM33XX_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK                (1 << 8)
-
-/* Used by CM_DIV_M6_DPLL_CORE */
-#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_SHIFT            12
-#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_WIDTH            1
-#define AM33XX_HSDIVIDER_CLKOUT3_PWDN_MASK             (1 << 12)
-
-/*
- * Used by CM_MPU_MPU_CLKCTRL, CM_RTC_RTC_CLKCTRL, CM_PER_AES0_CLKCTRL,
- * CM_PER_AES1_CLKCTRL, CM_PER_CLKDIV32K_CLKCTRL, CM_PER_CPGMAC0_CLKCTRL,
- * CM_PER_DCAN0_CLKCTRL, CM_PER_DCAN1_CLKCTRL, CM_PER_DES_CLKCTRL,
- * CM_PER_ELM_CLKCTRL, CM_PER_EMIF_CLKCTRL, CM_PER_EMIF_FW_CLKCTRL,
- * CM_PER_EPWMSS0_CLKCTRL, CM_PER_EPWMSS1_CLKCTRL, CM_PER_EPWMSS2_CLKCTRL,
- * CM_PER_GPIO1_CLKCTRL, CM_PER_GPIO2_CLKCTRL, CM_PER_GPIO3_CLKCTRL,
- * CM_PER_GPIO4_CLKCTRL, CM_PER_GPIO5_CLKCTRL, CM_PER_GPIO6_CLKCTRL,
- * CM_PER_GPMC_CLKCTRL, CM_PER_I2C1_CLKCTRL, CM_PER_I2C2_CLKCTRL,
- * CM_PER_PRUSS_CLKCTRL, CM_PER_IEEE5000_CLKCTRL, CM_PER_L3_CLKCTRL,
- * CM_PER_L3_INSTR_CLKCTRL, CM_PER_L4FW_CLKCTRL, CM_PER_L4HS_CLKCTRL,
- * CM_PER_L4LS_CLKCTRL, CM_PER_LCDC_CLKCTRL, CM_PER_MAILBOX0_CLKCTRL,
- * CM_PER_MAILBOX1_CLKCTRL, CM_PER_MCASP0_CLKCTRL, CM_PER_MCASP1_CLKCTRL,
- * CM_PER_MCASP2_CLKCTRL, CM_PER_MLB_CLKCTRL, CM_PER_MMC0_CLKCTRL,
- * CM_PER_MMC1_CLKCTRL, CM_PER_MMC2_CLKCTRL, CM_PER_MSTR_EXPS_CLKCTRL,
- * CM_PER_OCMCRAM_CLKCTRL, CM_PER_OCPWP_CLKCTRL, CM_PER_PCIE_CLKCTRL,
- * CM_PER_PKA_CLKCTRL, CM_PER_RNG_CLKCTRL, CM_PER_SHA0_CLKCTRL,
- * CM_PER_SLV_EXPS_CLKCTRL, CM_PER_SPARE0_CLKCTRL, CM_PER_SPARE1_CLKCTRL,
- * CM_PER_SPARE_CLKCTRL, CM_PER_SPI0_CLKCTRL, CM_PER_SPI1_CLKCTRL,
- * CM_PER_SPI2_CLKCTRL, CM_PER_SPI3_CLKCTRL, CM_PER_SPINLOCK_CLKCTRL,
- * CM_PER_TIMER2_CLKCTRL, CM_PER_TIMER3_CLKCTRL, CM_PER_TIMER4_CLKCTRL,
- * CM_PER_TIMER5_CLKCTRL, CM_PER_TIMER6_CLKCTRL, CM_PER_TIMER7_CLKCTRL,
- * CM_PER_TPCC_CLKCTRL, CM_PER_TPTC0_CLKCTRL, CM_PER_TPTC1_CLKCTRL,
- * CM_PER_TPTC2_CLKCTRL, CM_PER_UART1_CLKCTRL, CM_PER_UART2_CLKCTRL,
- * CM_PER_UART3_CLKCTRL, CM_PER_UART4_CLKCTRL, CM_PER_UART5_CLKCTRL,
- * CM_PER_USB0_CLKCTRL, CM_WKUP_ADC_TSC_CLKCTRL, CM_WKUP_CONTROL_CLKCTRL,
- * CM_WKUP_DEBUGSS_CLKCTRL, CM_WKUP_GPIO0_CLKCTRL, CM_WKUP_I2C0_CLKCTRL,
- * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_SMARTREFLEX0_CLKCTRL,
- * CM_WKUP_SMARTREFLEX1_CLKCTRL, CM_WKUP_TIMER0_CLKCTRL,
- * CM_WKUP_TIMER1_CLKCTRL, CM_WKUP_UART0_CLKCTRL, CM_WKUP_WDT0_CLKCTRL,
- * CM_WKUP_WDT1_CLKCTRL, CM_GFX_BITBLT_CLKCTRL, CM_GFX_GFX_CLKCTRL,
- * CM_GFX_MMUCFG_CLKCTRL, CM_GFX_MMUDATA_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL
- */
 #define AM33XX_IDLEST_SHIFT                            16
-#define AM33XX_IDLEST_WIDTH                            2
 #define AM33XX_IDLEST_MASK                             (0x3 << 16)
-
-/* Used by CM_MAC_CLKSEL */
-#define AM33XX_MII_CLK_SEL_SHIFT                       2
-#define AM33XX_MII_CLK_SEL_WIDTH                       1
-#define AM33XX_MII_CLK_SEL_MASK                                (1 << 2)
-
-/*
- * Used by CM_SSC_MODFREQDIV_DPLL_CORE, CM_SSC_MODFREQDIV_DPLL_DDR,
- * CM_SSC_MODFREQDIV_DPLL_DISP, CM_SSC_MODFREQDIV_DPLL_MPU,
- * CM_SSC_MODFREQDIV_DPLL_PER
- */
-#define AM33XX_MODFREQDIV_EXPONENT_SHIFT               8
-#define AM33XX_MODFREQDIV_EXPONENT_WIDTH               3
-#define AM33XX_MODFREQDIV_EXPONENT_MASK                        (0x7 << 8)
-
-/*
- * Used by CM_SSC_MODFREQDIV_DPLL_CORE, CM_SSC_MODFREQDIV_DPLL_DDR,
- * CM_SSC_MODFREQDIV_DPLL_DISP, CM_SSC_MODFREQDIV_DPLL_MPU,
- * CM_SSC_MODFREQDIV_DPLL_PER
- */
-#define AM33XX_MODFREQDIV_MANTISSA_SHIFT               0
-#define AM33XX_MODFREQDIV_MANTISSA_WIDTH               7
-#define AM33XX_MODFREQDIV_MANTISSA_MASK                        (0x7f << 0)
-
-/*
- * Used by CM_MPU_MPU_CLKCTRL, CM_RTC_RTC_CLKCTRL, CM_PER_AES0_CLKCTRL,
- * CM_PER_AES1_CLKCTRL, CM_PER_CLKDIV32K_CLKCTRL, CM_PER_CPGMAC0_CLKCTRL,
- * CM_PER_DCAN0_CLKCTRL, CM_PER_DCAN1_CLKCTRL, CM_PER_DES_CLKCTRL,
- * CM_PER_ELM_CLKCTRL, CM_PER_EMIF_CLKCTRL, CM_PER_EMIF_FW_CLKCTRL,
- * CM_PER_EPWMSS0_CLKCTRL, CM_PER_EPWMSS1_CLKCTRL, CM_PER_EPWMSS2_CLKCTRL,
- * CM_PER_GPIO1_CLKCTRL, CM_PER_GPIO2_CLKCTRL, CM_PER_GPIO3_CLKCTRL,
- * CM_PER_GPIO4_CLKCTRL, CM_PER_GPIO5_CLKCTRL, CM_PER_GPIO6_CLKCTRL,
- * CM_PER_GPMC_CLKCTRL, CM_PER_I2C1_CLKCTRL, CM_PER_I2C2_CLKCTRL,
- * CM_PER_PRUSS_CLKCTRL, CM_PER_IEEE5000_CLKCTRL, CM_PER_L3_CLKCTRL,
- * CM_PER_L3_INSTR_CLKCTRL, CM_PER_L4FW_CLKCTRL, CM_PER_L4HS_CLKCTRL,
- * CM_PER_L4LS_CLKCTRL, CM_PER_LCDC_CLKCTRL, CM_PER_MAILBOX0_CLKCTRL,
- * CM_PER_MAILBOX1_CLKCTRL, CM_PER_MCASP0_CLKCTRL, CM_PER_MCASP1_CLKCTRL,
- * CM_PER_MCASP2_CLKCTRL, CM_PER_MLB_CLKCTRL, CM_PER_MMC0_CLKCTRL,
- * CM_PER_MMC1_CLKCTRL, CM_PER_MMC2_CLKCTRL, CM_PER_MSTR_EXPS_CLKCTRL,
- * CM_PER_OCMCRAM_CLKCTRL, CM_PER_OCPWP_CLKCTRL, CM_PER_PCIE_CLKCTRL,
- * CM_PER_PKA_CLKCTRL, CM_PER_RNG_CLKCTRL, CM_PER_SHA0_CLKCTRL,
- * CM_PER_SLV_EXPS_CLKCTRL, CM_PER_SPARE0_CLKCTRL, CM_PER_SPARE1_CLKCTRL,
- * CM_PER_SPARE_CLKCTRL, CM_PER_SPI0_CLKCTRL, CM_PER_SPI1_CLKCTRL,
- * CM_PER_SPI2_CLKCTRL, CM_PER_SPI3_CLKCTRL, CM_PER_SPINLOCK_CLKCTRL,
- * CM_PER_TIMER2_CLKCTRL, CM_PER_TIMER3_CLKCTRL, CM_PER_TIMER4_CLKCTRL,
- * CM_PER_TIMER5_CLKCTRL, CM_PER_TIMER6_CLKCTRL, CM_PER_TIMER7_CLKCTRL,
- * CM_PER_TPCC_CLKCTRL, CM_PER_TPTC0_CLKCTRL, CM_PER_TPTC1_CLKCTRL,
- * CM_PER_TPTC2_CLKCTRL, CM_PER_UART1_CLKCTRL, CM_PER_UART2_CLKCTRL,
- * CM_PER_UART3_CLKCTRL, CM_PER_UART4_CLKCTRL, CM_PER_UART5_CLKCTRL,
- * CM_PER_USB0_CLKCTRL, CM_WKUP_ADC_TSC_CLKCTRL, CM_WKUP_CONTROL_CLKCTRL,
- * CM_WKUP_DEBUGSS_CLKCTRL, CM_WKUP_GPIO0_CLKCTRL, CM_WKUP_I2C0_CLKCTRL,
- * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_SMARTREFLEX0_CLKCTRL,
- * CM_WKUP_SMARTREFLEX1_CLKCTRL, CM_WKUP_TIMER0_CLKCTRL,
- * CM_WKUP_TIMER1_CLKCTRL, CM_WKUP_UART0_CLKCTRL, CM_WKUP_WDT0_CLKCTRL,
- * CM_WKUP_WDT1_CLKCTRL, CM_WKUP_WKUP_M3_CLKCTRL, CM_GFX_BITBLT_CLKCTRL,
- * CM_GFX_GFX_CLKCTRL, CM_GFX_MMUCFG_CLKCTRL, CM_GFX_MMUDATA_CLKCTRL,
- * CM_CEFUSE_CEFUSE_CLKCTRL
- */
 #define AM33XX_MODULEMODE_SHIFT                                0
-#define AM33XX_MODULEMODE_WIDTH                                2
 #define AM33XX_MODULEMODE_MASK                         (0x3 << 0)
-
-/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
 #define AM33XX_OPTCLK_DEBUG_CLKA_SHIFT                 30
-#define AM33XX_OPTCLK_DEBUG_CLKA_WIDTH                 1
-#define AM33XX_OPTCLK_DEBUG_CLKA_MASK                  (1 << 30)
-
-/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
 #define AM33XX_OPTFCLKEN_DBGSYSCLK_SHIFT               19
-#define AM33XX_OPTFCLKEN_DBGSYSCLK_WIDTH               1
-#define AM33XX_OPTFCLKEN_DBGSYSCLK_MASK                        (1 << 19)
-
-/* Used by CM_WKUP_GPIO0_CLKCTRL */
 #define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_SHIFT            18
-#define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_WIDTH            1
-#define AM33XX_OPTFCLKEN_GPIO0_GDBCLK_MASK             (1 << 18)
-
-/* Used by CM_PER_GPIO1_CLKCTRL */
 #define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_SHIFT           18
-#define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_WIDTH           1
-#define AM33XX_OPTFCLKEN_GPIO_1_GDBCLK_MASK            (1 << 18)
-
-/* Used by CM_PER_GPIO2_CLKCTRL */
 #define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_SHIFT           18
-#define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_WIDTH           1
-#define AM33XX_OPTFCLKEN_GPIO_2_GDBCLK_MASK            (1 << 18)
-
-/* Used by CM_PER_GPIO3_CLKCTRL */
 #define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_SHIFT           18
-#define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_WIDTH           1
-#define AM33XX_OPTFCLKEN_GPIO_3_GDBCLK_MASK            (1 << 18)
-
-/* Used by CM_PER_GPIO4_CLKCTRL */
-#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_SHIFT           18
-#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_WIDTH           1
-#define AM33XX_OPTFCLKEN_GPIO_4_GDBCLK_MASK            (1 << 18)
-
-/* Used by CM_PER_GPIO5_CLKCTRL */
-#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_SHIFT           18
-#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_WIDTH           1
-#define AM33XX_OPTFCLKEN_GPIO_5_GDBCLK_MASK            (1 << 18)
-
-/* Used by CM_PER_GPIO6_CLKCTRL */
-#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_SHIFT           18
-#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_WIDTH           1
-#define AM33XX_OPTFCLKEN_GPIO_6_GDBCLK_MASK            (1 << 18)
-
-/*
- * Used by CM_MPU_MPU_CLKCTRL, CM_PER_CPGMAC0_CLKCTRL, CM_PER_PRUSS_CLKCTRL,
- * CM_PER_IEEE5000_CLKCTRL, CM_PER_LCDC_CLKCTRL, CM_PER_MLB_CLKCTRL,
- * CM_PER_MSTR_EXPS_CLKCTRL, CM_PER_OCPWP_CLKCTRL, CM_PER_PCIE_CLKCTRL,
- * CM_PER_SPARE_CLKCTRL, CM_PER_TPTC0_CLKCTRL, CM_PER_TPTC1_CLKCTRL,
- * CM_PER_TPTC2_CLKCTRL, CM_PER_USB0_CLKCTRL, CM_WKUP_DEBUGSS_CLKCTRL,
- * CM_WKUP_WKUP_M3_CLKCTRL, CM_GFX_BITBLT_CLKCTRL, CM_GFX_GFX_CLKCTRL
- */
-#define AM33XX_STBYST_SHIFT                            18
-#define AM33XX_STBYST_WIDTH                            1
-#define AM33XX_STBYST_MASK                             (1 << 18)
-
-/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
 #define AM33XX_STM_PMD_CLKDIVSEL_SHIFT                 27
 #define AM33XX_STM_PMD_CLKDIVSEL_WIDTH                 3
-#define AM33XX_STM_PMD_CLKDIVSEL_MASK                  (0x7 << 27)
-
-/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
 #define AM33XX_STM_PMD_CLKSEL_SHIFT                    22
 #define AM33XX_STM_PMD_CLKSEL_WIDTH                    2
-#define AM33XX_STM_PMD_CLKSEL_MASK                     (0x3 << 22)
-
-/*
- * Used by CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDR, CM_IDLEST_DPLL_DISP,
- * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER
- */
-#define AM33XX_ST_DPLL_CLK_SHIFT                       0
-#define AM33XX_ST_DPLL_CLK_WIDTH                       1
 #define AM33XX_ST_DPLL_CLK_MASK                                (1 << 0)
-
-/* Used by CM_CLKDCOLDO_DPLL_PER */
 #define AM33XX_ST_DPLL_CLKDCOLDO_SHIFT                 8
-#define AM33XX_ST_DPLL_CLKDCOLDO_WIDTH                 1
-#define AM33XX_ST_DPLL_CLKDCOLDO_MASK                  (1 << 8)
-
-/*
- * Used by CM_DIV_M2_DPLL_DDR, CM_DIV_M2_DPLL_DISP, CM_DIV_M2_DPLL_MPU,
- * CM_DIV_M2_DPLL_PER
- */
-#define AM33XX_ST_DPLL_CLKOUT_SHIFT                    9
-#define AM33XX_ST_DPLL_CLKOUT_WIDTH                    1
-#define AM33XX_ST_DPLL_CLKOUT_MASK                     (1 << 9)
-
-/* Used by CM_DIV_M4_DPLL_CORE */
-#define AM33XX_ST_HSDIVIDER_CLKOUT1_SHIFT              9
-#define AM33XX_ST_HSDIVIDER_CLKOUT1_WIDTH              1
-#define AM33XX_ST_HSDIVIDER_CLKOUT1_MASK               (1 << 9)
-
-/* Used by CM_DIV_M5_DPLL_CORE */
-#define AM33XX_ST_HSDIVIDER_CLKOUT2_SHIFT              9
-#define AM33XX_ST_HSDIVIDER_CLKOUT2_WIDTH              1
-#define AM33XX_ST_HSDIVIDER_CLKOUT2_MASK               (1 << 9)
-
-/* Used by CM_DIV_M6_DPLL_CORE */
-#define AM33XX_ST_HSDIVIDER_CLKOUT3_SHIFT              9
-#define AM33XX_ST_HSDIVIDER_CLKOUT3_WIDTH              1
-#define AM33XX_ST_HSDIVIDER_CLKOUT3_MASK               (1 << 9)
-
-/*
- * Used by CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDR, CM_IDLEST_DPLL_DISP,
- * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER
- */
-#define AM33XX_ST_MN_BYPASS_SHIFT                      8
-#define AM33XX_ST_MN_BYPASS_WIDTH                      1
-#define AM33XX_ST_MN_BYPASS_MASK                       (1 << 8)
-
-/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
 #define AM33XX_TRC_PMD_CLKDIVSEL_SHIFT                 24
 #define AM33XX_TRC_PMD_CLKDIVSEL_WIDTH                 3
-#define AM33XX_TRC_PMD_CLKDIVSEL_MASK                  (0x7 << 24)
-
-/* Used by CM_WKUP_DEBUGSS_CLKCTRL */
 #define AM33XX_TRC_PMD_CLKSEL_SHIFT                    20
 #define AM33XX_TRC_PMD_CLKSEL_WIDTH                    2
-#define AM33XX_TRC_PMD_CLKSEL_MASK                     (0x3 << 20)
-
-/* Used by CONTROL_SEC_CLK_CTRL */
-#define AM33XX_TIMER0_CLKSEL_WIDTH                     2
-#define AM33XX_TIMER0_CLKSEL_MASK                      (0x3 << 4)
 #endif
index adf78d3..04dab2f 100644 (file)
  * published by the Free Software Foundation.
  */
 
-/* Bits shared between registers */
-
-/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
-#define OMAP3430ES2_EN_MMC3_MASK                       (1 << 30)
 #define OMAP3430ES2_EN_MMC3_SHIFT                      30
-#define OMAP3430_EN_MSPRO_MASK                         (1 << 23)
 #define OMAP3430_EN_MSPRO_SHIFT                                23
-#define OMAP3430_EN_HDQ_MASK                           (1 << 22)
 #define OMAP3430_EN_HDQ_SHIFT                          22
-#define OMAP3430ES1_EN_FSHOSTUSB_MASK                  (1 << 5)
 #define OMAP3430ES1_EN_FSHOSTUSB_SHIFT                 5
-#define OMAP3430ES1_EN_D2D_MASK                                (1 << 3)
 #define OMAP3430ES1_EN_D2D_SHIFT                       3
-#define OMAP3430_EN_SSI_MASK                           (1 << 0)
 #define OMAP3430_EN_SSI_SHIFT                          0
-
-/* CM_FCLKEN3_CORE and CM_ICLKEN3_CORE shared bits */
 #define OMAP3430ES2_EN_USBTLL_SHIFT                    2
-#define OMAP3430ES2_EN_USBTLL_MASK                     (1 << 2)
-
-/* CM_FCLKEN_WKUP and CM_ICLKEN_WKUP shared bits */
-#define OMAP3430_EN_WDT2_MASK                          (1 << 5)
 #define OMAP3430_EN_WDT2_SHIFT                         5
-
-/* CM_ICLKEN_CAM, CM_FCLKEN_CAM shared bits */
-#define OMAP3430_EN_CAM_MASK                           (1 << 0)
 #define OMAP3430_EN_CAM_SHIFT                          0
-
-/* CM_FCLKEN_PER, CM_ICLKEN_PER shared bits */
-#define OMAP3430_EN_WDT3_MASK                          (1 << 12)
 #define OMAP3430_EN_WDT3_SHIFT                         12
-
-/* CM_CLKSEL2_EMU, CM_CLKSEL3_EMU shared bits */
-#define OMAP3430_OVERRIDE_ENABLE_MASK                  (1 << 19)
-
-
-/* Bits specific to each register */
-
-/* CM_FCLKEN_IVA2 */
 #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK           (1 << 0)
 #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT          0
-
-/* CM_CLKEN_PLL_IVA2 */
-#define OMAP3430_IVA2_DPLL_RAMPTIME_SHIFT              8
-#define OMAP3430_IVA2_DPLL_RAMPTIME_MASK               (0x3 << 8)
-#define OMAP3430_IVA2_DPLL_FREQSEL_SHIFT               4
 #define OMAP3430_IVA2_DPLL_FREQSEL_MASK                        (0xf << 4)
 #define OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT         3
-#define OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_MASK          (1 << 3)
-#define OMAP3430_EN_IVA2_DPLL_SHIFT                    0
 #define OMAP3430_EN_IVA2_DPLL_MASK                     (0x7 << 0)
-
-/* CM_IDLEST_IVA2 */
 #define OMAP3430_ST_IVA2_SHIFT                         0
-#define OMAP3430_ST_IVA2_MASK                          (1 << 0)
-
-/* CM_IDLEST_PLL_IVA2 */
-#define OMAP3430_ST_IVA2_CLK_SHIFT                     0
 #define OMAP3430_ST_IVA2_CLK_MASK                      (1 << 0)
-
-/* CM_AUTOIDLE_PLL_IVA2 */
-#define OMAP3430_AUTO_IVA2_DPLL_SHIFT                  0
 #define OMAP3430_AUTO_IVA2_DPLL_MASK                   (0x7 << 0)
-
-/* CM_CLKSEL1_PLL_IVA2 */
 #define OMAP3430_IVA2_CLK_SRC_SHIFT                    19
-#define OMAP3430_IVA2_CLK_SRC_MASK                     (0x7 << 19)
 #define OMAP3430_IVA2_CLK_SRC_WIDTH                    3
-#define OMAP3430_IVA2_DPLL_MULT_SHIFT                  8
 #define OMAP3430_IVA2_DPLL_MULT_MASK                   (0x7ff << 8)
-#define OMAP3430_IVA2_DPLL_DIV_SHIFT                   0
 #define OMAP3430_IVA2_DPLL_DIV_MASK                    (0x7f << 0)
-
-/* CM_CLKSEL2_PLL_IVA2 */
 #define OMAP3430_IVA2_DPLL_CLKOUT_DIV_SHIFT            0
-#define OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK             (0x1f << 0)
 #define OMAP3430_IVA2_DPLL_CLKOUT_DIV_WIDTH            5
-
-/* CM_CLKSTCTRL_IVA2 */
-#define OMAP3430_CLKTRCTRL_IVA2_SHIFT                  0
 #define OMAP3430_CLKTRCTRL_IVA2_MASK                   (0x3 << 0)
-
-/* CM_CLKSTST_IVA2 */
-#define OMAP3430_CLKACTIVITY_IVA2_SHIFT                        0
 #define OMAP3430_CLKACTIVITY_IVA2_MASK                 (1 << 0)
-
-/* CM_REVISION specific bits */
-
-/* CM_SYSCONFIG specific bits */
-
-/* CM_CLKEN_PLL_MPU */
-#define OMAP3430_MPU_DPLL_RAMPTIME_SHIFT               8
-#define OMAP3430_MPU_DPLL_RAMPTIME_MASK                        (0x3 << 8)
-#define OMAP3430_MPU_DPLL_FREQSEL_SHIFT                        4
 #define OMAP3430_MPU_DPLL_FREQSEL_MASK                 (0xf << 4)
 #define OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT          3
-#define OMAP3430_EN_MPU_DPLL_DRIFTGUARD_MASK           (1 << 3)
-#define OMAP3430_EN_MPU_DPLL_SHIFT                     0
 #define OMAP3430_EN_MPU_DPLL_MASK                      (0x7 << 0)
-
-/* CM_IDLEST_MPU */
-#define OMAP3430_ST_MPU_MASK                           (1 << 0)
-
-/* CM_IDLEST_PLL_MPU */
 #define OMAP3430_ST_MPU_CLK_SHIFT                      0
 #define OMAP3430_ST_MPU_CLK_MASK                       (1 << 0)
 #define OMAP3430_ST_MPU_CLK_WIDTH                      1
-
-/* CM_AUTOIDLE_PLL_MPU */
-#define OMAP3430_AUTO_MPU_DPLL_SHIFT                   0
 #define OMAP3430_AUTO_MPU_DPLL_MASK                    (0x7 << 0)
-
-/* CM_CLKSEL1_PLL_MPU */
 #define OMAP3430_MPU_CLK_SRC_SHIFT                     19
-#define OMAP3430_MPU_CLK_SRC_MASK                      (0x7 << 19)
 #define OMAP3430_MPU_CLK_SRC_WIDTH                     3
-#define OMAP3430_MPU_DPLL_MULT_SHIFT                   8
 #define OMAP3430_MPU_DPLL_MULT_MASK                    (0x7ff << 8)
-#define OMAP3430_MPU_DPLL_DIV_SHIFT                    0
 #define OMAP3430_MPU_DPLL_DIV_MASK                     (0x7f << 0)
-
-/* CM_CLKSEL2_PLL_MPU */
 #define OMAP3430_MPU_DPLL_CLKOUT_DIV_SHIFT             0
-#define OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK              (0x1f << 0)
 #define OMAP3430_MPU_DPLL_CLKOUT_DIV_WIDTH             5
-
-/* CM_CLKSTCTRL_MPU */
-#define OMAP3430_CLKTRCTRL_MPU_SHIFT                   0
 #define OMAP3430_CLKTRCTRL_MPU_MASK                    (0x3 << 0)
-
-/* CM_CLKSTST_MPU */
-#define OMAP3430_CLKACTIVITY_MPU_SHIFT                 0
-#define OMAP3430_CLKACTIVITY_MPU_MASK                  (1 << 0)
-
-/* CM_FCLKEN1_CORE specific bits */
-#define OMAP3430_EN_MODEM_MASK                         (1 << 31)
 #define OMAP3430_EN_MODEM_SHIFT                                31
-
-/* CM_ICLKEN1_CORE specific bits */
-#define OMAP3430_EN_ICR_MASK                           (1 << 29)
 #define OMAP3430_EN_ICR_SHIFT                          29
-#define OMAP3430_EN_AES2_MASK                          (1 << 28)
 #define OMAP3430_EN_AES2_SHIFT                         28
-#define OMAP3430_EN_SHA12_MASK                         (1 << 27)
 #define OMAP3430_EN_SHA12_SHIFT                                27
-#define OMAP3430_EN_DES2_MASK                          (1 << 26)
 #define OMAP3430_EN_DES2_SHIFT                         26
-#define OMAP3430ES1_EN_FAC_MASK                                (1 << 8)
 #define OMAP3430ES1_EN_FAC_SHIFT                       8
-#define OMAP3430_EN_MAILBOXES_MASK                     (1 << 7)
 #define OMAP3430_EN_MAILBOXES_SHIFT                    7
-#define OMAP3430_EN_OMAPCTRL_MASK                      (1 << 6)
 #define OMAP3430_EN_OMAPCTRL_SHIFT                     6
-#define OMAP3430_EN_SAD2D_MASK                         (1 << 3)
 #define OMAP3430_EN_SAD2D_SHIFT                                3
-#define OMAP3430_EN_SDRC_MASK                          (1 << 1)
 #define OMAP3430_EN_SDRC_SHIFT                         1
-
-/* AM35XX specific CM_ICLKEN1_CORE bits */
-#define AM35XX_EN_IPSS_MASK                            (1 << 4)
 #define AM35XX_EN_IPSS_SHIFT                           4
-
-/* CM_ICLKEN2_CORE */
-#define OMAP3430_EN_PKA_MASK                           (1 << 4)
 #define OMAP3430_EN_PKA_SHIFT                          4
-#define OMAP3430_EN_AES1_MASK                          (1 << 3)
 #define OMAP3430_EN_AES1_SHIFT                         3
-#define OMAP3430_EN_RNG_MASK                           (1 << 2)
 #define OMAP3430_EN_RNG_SHIFT                          2
-#define OMAP3430_EN_SHA11_MASK                         (1 << 1)
 #define OMAP3430_EN_SHA11_SHIFT                                1
-#define OMAP3430_EN_DES1_MASK                          (1 << 0)
 #define OMAP3430_EN_DES1_SHIFT                         0
-
-/* CM_ICLKEN3_CORE */
 #define OMAP3430_EN_MAD2D_SHIFT                                3
-#define OMAP3430_EN_MAD2D_MASK                         (1 << 3)
-
-/* CM_FCLKEN3_CORE specific bits */
 #define OMAP3430ES2_EN_TS_SHIFT                                1
-#define OMAP3430ES2_EN_TS_MASK                         (1 << 1)
 #define OMAP3430ES2_EN_CPEFUSE_SHIFT                   0
-#define OMAP3430ES2_EN_CPEFUSE_MASK                    (1 << 0)
-
-/* CM_IDLEST1_CORE specific bits */
-#define OMAP3430ES2_ST_MMC3_SHIFT                      30
-#define OMAP3430ES2_ST_MMC3_MASK                       (1 << 30)
-#define OMAP3430_ST_ICR_SHIFT                          29
-#define OMAP3430_ST_ICR_MASK                           (1 << 29)
 #define OMAP3430_ST_AES2_SHIFT                         28
-#define OMAP3430_ST_AES2_MASK                          (1 << 28)
 #define OMAP3430_ST_SHA12_SHIFT                                27
-#define OMAP3430_ST_SHA12_MASK                         (1 << 27)
-#define OMAP3430_ST_DES2_SHIFT                         26
-#define OMAP3430_ST_DES2_MASK                          (1 << 26)
-#define OMAP3430_ST_MSPRO_SHIFT                                23
-#define OMAP3430_ST_MSPRO_MASK                         (1 << 23)
 #define AM35XX_ST_UART4_SHIFT                          23
-#define AM35XX_ST_UART4_MASK                           (1 << 23)
 #define OMAP3430_ST_HDQ_SHIFT                          22
-#define OMAP3430_ST_HDQ_MASK                           (1 << 22)
-#define OMAP3430ES1_ST_FAC_SHIFT                       8
-#define OMAP3430ES1_ST_FAC_MASK                                (1 << 8)
 #define OMAP3430ES2_ST_SSI_IDLE_SHIFT                  8
-#define OMAP3430ES2_ST_SSI_IDLE_MASK                   (1 << 8)
 #define OMAP3430_ST_MAILBOXES_SHIFT                    7
-#define OMAP3430_ST_MAILBOXES_MASK                     (1 << 7)
-#define OMAP3430_ST_OMAPCTRL_SHIFT                     6
-#define OMAP3430_ST_OMAPCTRL_MASK                      (1 << 6)
 #define OMAP3430_ST_SAD2D_SHIFT                                3
-#define OMAP3430_ST_SAD2D_MASK                         (1 << 3)
 #define OMAP3430_ST_SDMA_SHIFT                         2
-#define OMAP3430_ST_SDMA_MASK                          (1 << 2)
-#define OMAP3430_ST_SDRC_SHIFT                         1
-#define OMAP3430_ST_SDRC_MASK                          (1 << 1)
-#define OMAP3430_ST_SSI_STDBY_SHIFT                    0
-#define OMAP3430_ST_SSI_STDBY_MASK                     (1 << 0)
-
-/* AM35xx specific CM_IDLEST1_CORE bits */
 #define AM35XX_ST_IPSS_SHIFT                           5
-#define AM35XX_ST_IPSS_MASK                            (1 << 5)
-
-/* CM_IDLEST2_CORE */
-#define OMAP3430_ST_PKA_SHIFT                          4
-#define OMAP3430_ST_PKA_MASK                           (1 << 4)
-#define OMAP3430_ST_AES1_SHIFT                         3
-#define OMAP3430_ST_AES1_MASK                          (1 << 3)
-#define OMAP3430_ST_RNG_SHIFT                          2
-#define OMAP3430_ST_RNG_MASK                           (1 << 2)
-#define OMAP3430_ST_SHA11_SHIFT                                1
-#define OMAP3430_ST_SHA11_MASK                         (1 << 1)
-#define OMAP3430_ST_DES1_SHIFT                         0
-#define OMAP3430_ST_DES1_MASK                          (1 << 0)
-
-/* CM_IDLEST3_CORE */
 #define OMAP3430ES2_ST_USBTLL_SHIFT                    2
-#define OMAP3430ES2_ST_USBTLL_MASK                     (1 << 2)
-#define OMAP3430ES2_ST_CPEFUSE_SHIFT                   0
-#define OMAP3430ES2_ST_CPEFUSE_MASK                    (1 << 0)
-
-/* CM_AUTOIDLE1_CORE */
-#define OMAP3430_AUTO_MODEM_MASK                       (1 << 31)
-#define OMAP3430_AUTO_MODEM_SHIFT                      31
-#define OMAP3430ES2_AUTO_MMC3_MASK                     (1 << 30)
-#define OMAP3430ES2_AUTO_MMC3_SHIFT                    30
-#define OMAP3430ES2_AUTO_ICR_MASK                      (1 << 29)
-#define OMAP3430ES2_AUTO_ICR_SHIFT                     29
-#define OMAP3430_AUTO_AES2_MASK                                (1 << 28)
-#define OMAP3430_AUTO_AES2_SHIFT                       28
-#define OMAP3430_AUTO_SHA12_MASK                       (1 << 27)
-#define OMAP3430_AUTO_SHA12_SHIFT                      27
-#define OMAP3430_AUTO_DES2_MASK                                (1 << 26)
-#define OMAP3430_AUTO_DES2_SHIFT                       26
-#define OMAP3430_AUTO_MMC2_MASK                                (1 << 25)
-#define OMAP3430_AUTO_MMC2_SHIFT                       25
-#define OMAP3430_AUTO_MMC1_MASK                                (1 << 24)
-#define OMAP3430_AUTO_MMC1_SHIFT                       24
-#define OMAP3430_AUTO_MSPRO_MASK                       (1 << 23)
-#define OMAP3430_AUTO_MSPRO_SHIFT                      23
-#define OMAP3430_AUTO_HDQ_MASK                         (1 << 22)
-#define OMAP3430_AUTO_HDQ_SHIFT                                22
-#define OMAP3430_AUTO_MCSPI4_MASK                      (1 << 21)
-#define OMAP3430_AUTO_MCSPI4_SHIFT                     21
-#define OMAP3430_AUTO_MCSPI3_MASK                      (1 << 20)
-#define OMAP3430_AUTO_MCSPI3_SHIFT                     20
-#define OMAP3430_AUTO_MCSPI2_MASK                      (1 << 19)
-#define OMAP3430_AUTO_MCSPI2_SHIFT                     19
-#define OMAP3430_AUTO_MCSPI1_MASK                      (1 << 18)
-#define OMAP3430_AUTO_MCSPI1_SHIFT                     18
-#define OMAP3430_AUTO_I2C3_MASK                                (1 << 17)
-#define OMAP3430_AUTO_I2C3_SHIFT                       17
-#define OMAP3430_AUTO_I2C2_MASK                                (1 << 16)
-#define OMAP3430_AUTO_I2C2_SHIFT                       16
-#define OMAP3430_AUTO_I2C1_MASK                                (1 << 15)
-#define OMAP3430_AUTO_I2C1_SHIFT                       15
-#define OMAP3430_AUTO_UART2_MASK                       (1 << 14)
-#define OMAP3430_AUTO_UART2_SHIFT                      14
-#define OMAP3430_AUTO_UART1_MASK                       (1 << 13)
-#define OMAP3430_AUTO_UART1_SHIFT                      13
-#define OMAP3430_AUTO_GPT11_MASK                       (1 << 12)
-#define OMAP3430_AUTO_GPT11_SHIFT                      12
-#define OMAP3430_AUTO_GPT10_MASK                       (1 << 11)
-#define OMAP3430_AUTO_GPT10_SHIFT                      11
-#define OMAP3430_AUTO_MCBSP5_MASK                      (1 << 10)
-#define OMAP3430_AUTO_MCBSP5_SHIFT                     10
-#define OMAP3430_AUTO_MCBSP1_MASK                      (1 << 9)
-#define OMAP3430_AUTO_MCBSP1_SHIFT                     9
-#define OMAP3430ES1_AUTO_FAC_MASK                      (1 << 8)
-#define OMAP3430ES1_AUTO_FAC_SHIFT                     8
-#define OMAP3430_AUTO_MAILBOXES_MASK                   (1 << 7)
-#define OMAP3430_AUTO_MAILBOXES_SHIFT                  7
-#define OMAP3430_AUTO_OMAPCTRL_MASK                    (1 << 6)
-#define OMAP3430_AUTO_OMAPCTRL_SHIFT                   6
-#define OMAP3430ES1_AUTO_FSHOSTUSB_MASK                        (1 << 5)
-#define OMAP3430ES1_AUTO_FSHOSTUSB_SHIFT               5
-#define OMAP3430_AUTO_HSOTGUSB_MASK                    (1 << 4)
-#define OMAP3430_AUTO_HSOTGUSB_SHIFT                   4
-#define OMAP3430ES1_AUTO_D2D_MASK                      (1 << 3)
-#define OMAP3430ES1_AUTO_D2D_SHIFT                     3
-#define OMAP3430_AUTO_SAD2D_MASK                       (1 << 3)
-#define OMAP3430_AUTO_SAD2D_SHIFT                      3
-#define OMAP3430_AUTO_SSI_MASK                         (1 << 0)
-#define OMAP3430_AUTO_SSI_SHIFT                                0
-
-/* CM_AUTOIDLE2_CORE */
-#define OMAP3430_AUTO_PKA_MASK                         (1 << 4)
-#define OMAP3430_AUTO_PKA_SHIFT                                4
-#define OMAP3430_AUTO_AES1_MASK                                (1 << 3)
-#define OMAP3430_AUTO_AES1_SHIFT                       3
-#define OMAP3430_AUTO_RNG_MASK                         (1 << 2)
-#define OMAP3430_AUTO_RNG_SHIFT                                2
-#define OMAP3430_AUTO_SHA11_MASK                       (1 << 1)
-#define OMAP3430_AUTO_SHA11_SHIFT                      1
-#define OMAP3430_AUTO_DES1_MASK                                (1 << 0)
-#define OMAP3430_AUTO_DES1_SHIFT                       0
-
-/* CM_AUTOIDLE3_CORE */
-#define        OMAP3430ES2_AUTO_USBHOST                        (1 << 0)
-#define        OMAP3430ES2_AUTO_USBHOST_SHIFT                  0
-#define        OMAP3430ES2_AUTO_USBTLL                         (1 << 2)
-#define OMAP3430ES2_AUTO_USBTLL_SHIFT                  2
-#define OMAP3430ES2_AUTO_USBTLL_MASK                   (1 << 2)
-#define OMAP3430_AUTO_MAD2D_SHIFT                      3
-#define OMAP3430_AUTO_MAD2D_MASK                       (1 << 3)
-
-/* CM_CLKSEL_CORE */
-#define OMAP3430_CLKSEL_SSI_SHIFT                      8
 #define OMAP3430_CLKSEL_SSI_MASK                       (0xf << 8)
 #define OMAP3430_CLKSEL_GPT11_MASK                     (1 << 7)
-#define OMAP3430_CLKSEL_GPT11_SHIFT                    7
 #define OMAP3430_CLKSEL_GPT10_MASK                     (1 << 6)
-#define OMAP3430_CLKSEL_GPT10_SHIFT                    6
-#define OMAP3430ES1_CLKSEL_FSHOSTUSB_SHIFT             4
 #define OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK              (0x3 << 4)
 #define OMAP3430_CLKSEL_L4_SHIFT                       2
-#define OMAP3430_CLKSEL_L4_MASK                                (0x3 << 2)
 #define OMAP3430_CLKSEL_L4_WIDTH                       2
 #define OMAP3430_CLKSEL_L3_SHIFT                       0
-#define OMAP3430_CLKSEL_L3_MASK                                (0x3 << 0)
 #define OMAP3430_CLKSEL_L3_WIDTH                       2
-#define OMAP3630_CLKSEL_96M_SHIFT                      12
 #define OMAP3630_CLKSEL_96M_MASK                       (0x3 << 12)
-#define OMAP3630_CLKSEL_96M_WIDTH                      2
-
-/* CM_CLKSTCTRL_CORE */
-#define OMAP3430ES1_CLKTRCTRL_D2D_SHIFT                        4
 #define OMAP3430ES1_CLKTRCTRL_D2D_MASK                 (0x3 << 4)
-#define OMAP3430_CLKTRCTRL_L4_SHIFT                    2
 #define OMAP3430_CLKTRCTRL_L4_MASK                     (0x3 << 2)
-#define OMAP3430_CLKTRCTRL_L3_SHIFT                    0
 #define OMAP3430_CLKTRCTRL_L3_MASK                     (0x3 << 0)
-
-/* CM_CLKSTST_CORE */
-#define OMAP3430ES1_CLKACTIVITY_D2D_SHIFT              2
-#define OMAP3430ES1_CLKACTIVITY_D2D_MASK               (1 << 2)
-#define OMAP3430_CLKACTIVITY_L4_SHIFT                  1
-#define OMAP3430_CLKACTIVITY_L4_MASK                   (1 << 1)
-#define OMAP3430_CLKACTIVITY_L3_SHIFT                  0
-#define OMAP3430_CLKACTIVITY_L3_MASK                   (1 << 0)
-
-/* CM_FCLKEN_GFX */
-#define OMAP3430ES1_EN_3D_MASK                         (1 << 2)
 #define OMAP3430ES1_EN_3D_SHIFT                                2
-#define OMAP3430ES1_EN_2D_MASK                         (1 << 1)
 #define OMAP3430ES1_EN_2D_SHIFT                                1
-
-/* CM_ICLKEN_GFX specific bits */
-
-/* CM_IDLEST_GFX specific bits */
-
-/* CM_CLKSEL_GFX specific bits */
-
-/* CM_SLEEPDEP_GFX specific bits */
-
-/* CM_CLKSTCTRL_GFX */
-#define OMAP3430ES1_CLKTRCTRL_GFX_SHIFT                        0
 #define OMAP3430ES1_CLKTRCTRL_GFX_MASK                 (0x3 << 0)
-
-/* CM_CLKSTST_GFX */
-#define OMAP3430ES1_CLKACTIVITY_GFX_SHIFT              0
-#define OMAP3430ES1_CLKACTIVITY_GFX_MASK               (1 << 0)
-
-/* CM_FCLKEN_SGX */
 #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT         1
-#define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_MASK          (1 << 1)
-
-/* CM_IDLEST_SGX */
-#define OMAP3430ES2_ST_SGX_SHIFT                       1
-#define OMAP3430ES2_ST_SGX_MASK                                (1 << 1)
-
-/* CM_ICLKEN_SGX */
 #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT         0
-#define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_MASK          (1 << 0)
-
-/* CM_CLKSEL_SGX */
-#define OMAP3430ES2_CLKSEL_SGX_SHIFT                   0
 #define OMAP3430ES2_CLKSEL_SGX_MASK                    (0x7 << 0)
-
-/* CM_CLKSTCTRL_SGX */
-#define OMAP3430ES2_CLKTRCTRL_SGX_SHIFT                        0
 #define OMAP3430ES2_CLKTRCTRL_SGX_MASK                 (0x3 << 0)
-
-/* CM_CLKSTST_SGX */
-#define OMAP3430ES2_CLKACTIVITY_SGX_SHIFT              0
-#define OMAP3430ES2_CLKACTIVITY_SGX_MASK               (1 << 0)
-
-/* CM_FCLKEN_WKUP specific bits */
 #define OMAP3430ES2_EN_USIMOCP_SHIFT                   9
-#define OMAP3430ES2_EN_USIMOCP_MASK                    (1 << 9)
-
-/* CM_ICLKEN_WKUP specific bits */
-#define OMAP3430_EN_WDT1_MASK                          (1 << 4)
 #define OMAP3430_EN_WDT1_SHIFT                         4
-#define OMAP3430_EN_32KSYNC_MASK                       (1 << 2)
 #define OMAP3430_EN_32KSYNC_SHIFT                      2
-
-/* CM_IDLEST_WKUP specific bits */
-#define OMAP3430ES2_ST_USIMOCP_SHIFT                   9
-#define OMAP3430ES2_ST_USIMOCP_MASK                    (1 << 9)
 #define OMAP3430_ST_WDT2_SHIFT                         5
-#define OMAP3430_ST_WDT2_MASK                          (1 << 5)
-#define OMAP3430_ST_WDT1_SHIFT                         4
-#define OMAP3430_ST_WDT1_MASK                          (1 << 4)
 #define OMAP3430_ST_32KSYNC_SHIFT                      2
-#define OMAP3430_ST_32KSYNC_MASK                       (1 << 2)
-
-/* CM_AUTOIDLE_WKUP */
-#define OMAP3430ES2_AUTO_USIMOCP_MASK                  (1 << 9)
-#define OMAP3430ES2_AUTO_USIMOCP_SHIFT                 9
-#define OMAP3430_AUTO_WDT2_MASK                                (1 << 5)
-#define OMAP3430_AUTO_WDT2_SHIFT                       5
-#define OMAP3430_AUTO_WDT1_MASK                                (1 << 4)
-#define OMAP3430_AUTO_WDT1_SHIFT                       4
-#define OMAP3430_AUTO_GPIO1_MASK                       (1 << 3)
-#define OMAP3430_AUTO_GPIO1_SHIFT                      3
-#define OMAP3430_AUTO_32KSYNC_MASK                     (1 << 2)
-#define OMAP3430_AUTO_32KSYNC_SHIFT                    2
-#define OMAP3430_AUTO_GPT12_MASK                       (1 << 1)
-#define OMAP3430_AUTO_GPT12_SHIFT                      1
-#define OMAP3430_AUTO_GPT1_MASK                                (1 << 0)
-#define OMAP3430_AUTO_GPT1_SHIFT                       0
-
-/* CM_CLKSEL_WKUP */
 #define OMAP3430ES2_CLKSEL_USIMOCP_MASK                        (0xf << 3)
 #define OMAP3430_CLKSEL_RM_SHIFT                       1
-#define OMAP3430_CLKSEL_RM_MASK                                (0x3 << 1)
 #define OMAP3430_CLKSEL_RM_WIDTH                       2
-#define OMAP3430_CLKSEL_GPT1_SHIFT                     0
 #define OMAP3430_CLKSEL_GPT1_MASK                      (1 << 0)
-
-/* CM_CLKEN_PLL */
 #define OMAP3430_PWRDN_EMU_PERIPH_SHIFT                        31
 #define OMAP3430_PWRDN_CAM_SHIFT                       30
 #define OMAP3430_PWRDN_DSS1_SHIFT                      29
 #define OMAP3430_PWRDN_TV_SHIFT                                28
 #define OMAP3430_PWRDN_96M_SHIFT                       27
-#define OMAP3430_PERIPH_DPLL_RAMPTIME_SHIFT            24
-#define OMAP3430_PERIPH_DPLL_RAMPTIME_MASK             (0x3 << 24)
-#define OMAP3430_PERIPH_DPLL_FREQSEL_SHIFT             20
 #define OMAP3430_PERIPH_DPLL_FREQSEL_MASK              (0xf << 20)
 #define OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT       19
-#define OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_MASK                (1 << 19)
-#define OMAP3430_EN_PERIPH_DPLL_SHIFT                  16
 #define OMAP3430_EN_PERIPH_DPLL_MASK                   (0x7 << 16)
 #define OMAP3430_PWRDN_EMU_CORE_SHIFT                  12
-#define OMAP3430_CORE_DPLL_RAMPTIME_SHIFT              8
-#define OMAP3430_CORE_DPLL_RAMPTIME_MASK               (0x3 << 8)
-#define OMAP3430_CORE_DPLL_FREQSEL_SHIFT               4
 #define OMAP3430_CORE_DPLL_FREQSEL_MASK                        (0xf << 4)
 #define OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT         3
-#define OMAP3430_EN_CORE_DPLL_DRIFTGUARD_MASK          (1 << 3)
-#define OMAP3430_EN_CORE_DPLL_SHIFT                    0
 #define OMAP3430_EN_CORE_DPLL_MASK                     (0x7 << 0)
-
-/* CM_CLKEN2_PLL */
-#define OMAP3430ES2_EN_PERIPH2_DPLL_LPMODE_SHIFT       10
-#define OMAP3430ES2_PERIPH2_DPLL_RAMPTIME_MASK         (0x3 << 8)
-#define OMAP3430ES2_PERIPH2_DPLL_FREQSEL_SHIFT         4
 #define OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK          (0xf << 4)
 #define OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT   3
-#define OMAP3430ES2_EN_PERIPH2_DPLL_SHIFT              0
 #define OMAP3430ES2_EN_PERIPH2_DPLL_MASK               (0x7 << 0)
-
-/* CM_IDLEST_CKGEN */
-#define OMAP3430_ST_54M_CLK_MASK                       (1 << 5)
-#define OMAP3430_ST_12M_CLK_MASK                       (1 << 4)
-#define OMAP3430_ST_48M_CLK_MASK                       (1 << 3)
-#define OMAP3430_ST_96M_CLK_MASK                       (1 << 2)
-#define OMAP3430_ST_PERIPH_CLK_SHIFT                   1
 #define OMAP3430_ST_PERIPH_CLK_MASK                    (1 << 1)
-#define OMAP3430_ST_CORE_CLK_SHIFT                     0
 #define OMAP3430_ST_CORE_CLK_MASK                      (1 << 0)
-
-/* CM_IDLEST2_CKGEN */
-#define OMAP3430ES2_ST_USIM_CLK_SHIFT                  2
-#define OMAP3430ES2_ST_USIM_CLK_MASK                   (1 << 2)
-#define OMAP3430ES2_ST_120M_CLK_SHIFT                  1
-#define OMAP3430ES2_ST_120M_CLK_MASK                   (1 << 1)
-#define OMAP3430ES2_ST_PERIPH2_CLK_SHIFT               0
 #define OMAP3430ES2_ST_PERIPH2_CLK_MASK                        (1 << 0)
-
-/* CM_AUTOIDLE_PLL */
-#define OMAP3430_AUTO_PERIPH_DPLL_SHIFT                        3
 #define OMAP3430_AUTO_PERIPH_DPLL_MASK                 (0x7 << 3)
-#define OMAP3430_AUTO_CORE_DPLL_SHIFT                  0
 #define OMAP3430_AUTO_CORE_DPLL_MASK                   (0x7 << 0)
-
-/* CM_AUTOIDLE2_PLL */
-#define OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT            0
 #define OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK             (0x7 << 0)
-
-/* CM_CLKSEL1_PLL */
-/* Note that OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK was (0x3 << 27) on 3430ES1 */
 #define OMAP3430_CORE_DPLL_CLKOUT_DIV_SHIFT            27
-#define OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK             (0x1f << 27)
 #define OMAP3430_CORE_DPLL_CLKOUT_DIV_WIDTH            5
-#define OMAP3430_CORE_DPLL_MULT_SHIFT                  16
 #define OMAP3430_CORE_DPLL_MULT_MASK                   (0x7ff << 16)
-#define OMAP3430_CORE_DPLL_DIV_SHIFT                   8
 #define OMAP3430_CORE_DPLL_DIV_MASK                    (0x7f << 8)
 #define OMAP3430_SOURCE_96M_SHIFT                      6
-#define OMAP3430_SOURCE_96M_MASK                       (1 << 6)
 #define OMAP3430_SOURCE_96M_WIDTH                      1
 #define OMAP3430_SOURCE_54M_SHIFT                      5
-#define OMAP3430_SOURCE_54M_MASK                       (1 << 5)
 #define OMAP3430_SOURCE_54M_WIDTH                      1
-#define OMAP3430_SOURCE_48M_SHIFT                      3
 #define OMAP3430_SOURCE_48M_MASK                       (1 << 3)
-
-/* CM_CLKSEL2_PLL */
-#define OMAP3430_PERIPH_DPLL_MULT_SHIFT                        8
 #define OMAP3430_PERIPH_DPLL_MULT_MASK                 (0x7ff << 8)
 #define OMAP3630_PERIPH_DPLL_MULT_MASK                 (0xfff << 8)
-#define OMAP3430_PERIPH_DPLL_DIV_SHIFT                 0
 #define OMAP3430_PERIPH_DPLL_DIV_MASK                  (0x7f << 0)
-#define OMAP3630_PERIPH_DPLL_DCO_SEL_SHIFT             21
 #define OMAP3630_PERIPH_DPLL_DCO_SEL_MASK              (0x7 << 21)
-#define OMAP3630_PERIPH_DPLL_SD_DIV_SHIFT              24
 #define OMAP3630_PERIPH_DPLL_SD_DIV_MASK               (0xff << 24)
-
-/* CM_CLKSEL3_PLL */
 #define OMAP3430_DIV_96M_SHIFT                         0
-#define OMAP3430_DIV_96M_MASK                          (0x1f << 0)
-#define OMAP3430_DIV_96M_WIDTH                         5
-#define OMAP3630_DIV_96M_MASK                          (0x3f << 0)
 #define OMAP3630_DIV_96M_WIDTH                         6
-
-/* CM_CLKSEL4_PLL */
-#define OMAP3430ES2_PERIPH2_DPLL_MULT_SHIFT            8
 #define OMAP3430ES2_PERIPH2_DPLL_MULT_MASK             (0x7ff << 8)
-#define OMAP3430ES2_PERIPH2_DPLL_DIV_SHIFT             0
 #define OMAP3430ES2_PERIPH2_DPLL_DIV_MASK              (0x7f << 0)
-
-/* CM_CLKSEL5_PLL */
 #define OMAP3430ES2_DIV_120M_SHIFT                     0
-#define OMAP3430ES2_DIV_120M_MASK                      (0x1f << 0)
 #define OMAP3430ES2_DIV_120M_WIDTH                     5
-
-/* CM_CLKOUT_CTRL */
 #define OMAP3430_CLKOUT2_EN_SHIFT                      7
-#define OMAP3430_CLKOUT2_EN_MASK                       (1 << 7)
 #define OMAP3430_CLKOUT2_DIV_SHIFT                     3
-#define OMAP3430_CLKOUT2_DIV_MASK                      (0x7 << 3)
 #define OMAP3430_CLKOUT2_DIV_WIDTH                     3
-#define OMAP3430_CLKOUT2SOURCE_SHIFT                   0
 #define OMAP3430_CLKOUT2SOURCE_MASK                    (0x3 << 0)
-
-/* CM_FCLKEN_DSS */
-#define OMAP3430_EN_TV_MASK                            (1 << 2)
 #define OMAP3430_EN_TV_SHIFT                           2
-#define OMAP3430_EN_DSS2_MASK                          (1 << 1)
 #define OMAP3430_EN_DSS2_SHIFT                         1
-#define OMAP3430_EN_DSS1_MASK                          (1 << 0)
 #define OMAP3430_EN_DSS1_SHIFT                         0
-
-/* CM_ICLKEN_DSS */
-#define OMAP3430_CM_ICLKEN_DSS_EN_DSS_MASK             (1 << 0)
 #define OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT            0
-
-/* CM_IDLEST_DSS */
 #define OMAP3430ES2_ST_DSS_IDLE_SHIFT                  1
-#define OMAP3430ES2_ST_DSS_IDLE_MASK                   (1 << 1)
 #define OMAP3430ES2_ST_DSS_STDBY_SHIFT                 0
-#define OMAP3430ES2_ST_DSS_STDBY_MASK                  (1 << 0)
 #define OMAP3430ES1_ST_DSS_SHIFT                       0
-#define OMAP3430ES1_ST_DSS_MASK                                (1 << 0)
-
-/* CM_AUTOIDLE_DSS */
-#define OMAP3430_AUTO_DSS_MASK                         (1 << 0)
-#define OMAP3430_AUTO_DSS_SHIFT                                0
-
-/* CM_CLKSEL_DSS */
 #define OMAP3430_CLKSEL_TV_SHIFT                       8
-#define OMAP3430_CLKSEL_TV_MASK                                (0x1f << 8)
-#define OMAP3430_CLKSEL_TV_WIDTH                       5
-#define OMAP3630_CLKSEL_TV_MASK                                (0x3f << 8)
 #define OMAP3630_CLKSEL_TV_WIDTH                       6
 #define OMAP3430_CLKSEL_DSS1_SHIFT                     0
-#define OMAP3430_CLKSEL_DSS1_MASK                      (0x1f << 0)
-#define OMAP3430_CLKSEL_DSS1_WIDTH                     5
-#define OMAP3630_CLKSEL_DSS1_MASK                      (0x3f << 0)
 #define OMAP3630_CLKSEL_DSS1_WIDTH                     6
-
-/* CM_SLEEPDEP_DSS specific bits */
-
-/* CM_CLKSTCTRL_DSS */
-#define OMAP3430_CLKTRCTRL_DSS_SHIFT                   0
 #define OMAP3430_CLKTRCTRL_DSS_MASK                    (0x3 << 0)
-
-/* CM_CLKSTST_DSS */
-#define OMAP3430_CLKACTIVITY_DSS_SHIFT                 0
-#define OMAP3430_CLKACTIVITY_DSS_MASK                  (1 << 0)
-
-/* CM_FCLKEN_CAM specific bits */
-#define OMAP3430_EN_CSI2_MASK                          (1 << 1)
 #define OMAP3430_EN_CSI2_SHIFT                         1
-
-/* CM_ICLKEN_CAM specific bits */
-
-/* CM_IDLEST_CAM */
-#define OMAP3430_ST_CAM_MASK                           (1 << 0)
-
-/* CM_AUTOIDLE_CAM */
-#define OMAP3430_AUTO_CAM_MASK                         (1 << 0)
-#define OMAP3430_AUTO_CAM_SHIFT                                0
-
-/* CM_CLKSEL_CAM */
 #define OMAP3430_CLKSEL_CAM_SHIFT                      0
-#define OMAP3430_CLKSEL_CAM_MASK                       (0x1f << 0)
-#define OMAP3430_CLKSEL_CAM_WIDTH                      5
-#define OMAP3630_CLKSEL_CAM_MASK                       (0x3f << 0)
 #define OMAP3630_CLKSEL_CAM_WIDTH                      6
-
-/* CM_SLEEPDEP_CAM specific bits */
-
-/* CM_CLKSTCTRL_CAM */
-#define OMAP3430_CLKTRCTRL_CAM_SHIFT                   0
 #define OMAP3430_CLKTRCTRL_CAM_MASK                    (0x3 << 0)
-
-/* CM_CLKSTST_CAM */
-#define OMAP3430_CLKACTIVITY_CAM_SHIFT                 0
-#define OMAP3430_CLKACTIVITY_CAM_MASK                  (1 << 0)
-
-/* CM_FCLKEN_PER specific bits */
-
-/* CM_ICLKEN_PER specific bits */
-
-/* CM_IDLEST_PER */
-#define OMAP3430_ST_WDT3_SHIFT                         12
-#define OMAP3430_ST_WDT3_MASK                          (1 << 12)
 #define OMAP3430_ST_MCBSP4_SHIFT                       2
-#define OMAP3430_ST_MCBSP4_MASK                                (1 << 2)
 #define OMAP3430_ST_MCBSP3_SHIFT                       1
-#define OMAP3430_ST_MCBSP3_MASK                                (1 << 1)
 #define OMAP3430_ST_MCBSP2_SHIFT                       0
-#define OMAP3430_ST_MCBSP2_MASK                                (1 << 0)
-
-/* CM_AUTOIDLE_PER */
-#define OMAP3630_AUTO_UART4_MASK                       (1 << 18)
-#define OMAP3630_AUTO_UART4_SHIFT                      18
-#define OMAP3430_AUTO_GPIO6_MASK                       (1 << 17)
-#define OMAP3430_AUTO_GPIO6_SHIFT                      17
-#define OMAP3430_AUTO_GPIO5_MASK                       (1 << 16)
-#define OMAP3430_AUTO_GPIO5_SHIFT                      16
-#define OMAP3430_AUTO_GPIO4_MASK                       (1 << 15)
-#define OMAP3430_AUTO_GPIO4_SHIFT                      15
-#define OMAP3430_AUTO_GPIO3_MASK                       (1 << 14)
-#define OMAP3430_AUTO_GPIO3_SHIFT                      14
-#define OMAP3430_AUTO_GPIO2_MASK                       (1 << 13)
-#define OMAP3430_AUTO_GPIO2_SHIFT                      13
-#define OMAP3430_AUTO_WDT3_MASK                                (1 << 12)
-#define OMAP3430_AUTO_WDT3_SHIFT                       12
-#define OMAP3430_AUTO_UART3_MASK                       (1 << 11)
-#define OMAP3430_AUTO_UART3_SHIFT                      11
-#define OMAP3430_AUTO_GPT9_MASK                                (1 << 10)
-#define OMAP3430_AUTO_GPT9_SHIFT                       10
-#define OMAP3430_AUTO_GPT8_MASK                                (1 << 9)
-#define OMAP3430_AUTO_GPT8_SHIFT                       9
-#define OMAP3430_AUTO_GPT7_MASK                                (1 << 8)
-#define OMAP3430_AUTO_GPT7_SHIFT                       8
-#define OMAP3430_AUTO_GPT6_MASK                                (1 << 7)
-#define OMAP3430_AUTO_GPT6_SHIFT                       7
-#define OMAP3430_AUTO_GPT5_MASK                                (1 << 6)
-#define OMAP3430_AUTO_GPT5_SHIFT                       6
-#define OMAP3430_AUTO_GPT4_MASK                                (1 << 5)
-#define OMAP3430_AUTO_GPT4_SHIFT                       5
-#define OMAP3430_AUTO_GPT3_MASK                                (1 << 4)
-#define OMAP3430_AUTO_GPT3_SHIFT                       4
-#define OMAP3430_AUTO_GPT2_MASK                                (1 << 3)
-#define OMAP3430_AUTO_GPT2_SHIFT                       3
-#define OMAP3430_AUTO_MCBSP4_MASK                      (1 << 2)
-#define OMAP3430_AUTO_MCBSP4_SHIFT                     2
-#define OMAP3430_AUTO_MCBSP3_MASK                      (1 << 1)
-#define OMAP3430_AUTO_MCBSP3_SHIFT                     1
-#define OMAP3430_AUTO_MCBSP2_MASK                      (1 << 0)
-#define OMAP3430_AUTO_MCBSP2_SHIFT                     0
-
-/* CM_CLKSEL_PER */
 #define OMAP3430_CLKSEL_GPT9_MASK                      (1 << 7)
-#define OMAP3430_CLKSEL_GPT9_SHIFT                     7
 #define OMAP3430_CLKSEL_GPT8_MASK                      (1 << 6)
-#define OMAP3430_CLKSEL_GPT8_SHIFT                     6
 #define OMAP3430_CLKSEL_GPT7_MASK                      (1 << 5)
-#define OMAP3430_CLKSEL_GPT7_SHIFT                     5
 #define OMAP3430_CLKSEL_GPT6_MASK                      (1 << 4)
-#define OMAP3430_CLKSEL_GPT6_SHIFT                     4
 #define OMAP3430_CLKSEL_GPT5_MASK                      (1 << 3)
-#define OMAP3430_CLKSEL_GPT5_SHIFT                     3
 #define OMAP3430_CLKSEL_GPT4_MASK                      (1 << 2)
-#define OMAP3430_CLKSEL_GPT4_SHIFT                     2
 #define OMAP3430_CLKSEL_GPT3_MASK                      (1 << 1)
-#define OMAP3430_CLKSEL_GPT3_SHIFT                     1
 #define OMAP3430_CLKSEL_GPT2_MASK                      (1 << 0)
-#define OMAP3430_CLKSEL_GPT2_SHIFT                     0
-
-/* CM_SLEEPDEP_PER specific bits */
-#define OMAP3430_CM_SLEEPDEP_PER_EN_IVA2_MASK          (1 << 2)
-
-/* CM_CLKSTCTRL_PER */
-#define OMAP3430_CLKTRCTRL_PER_SHIFT                   0
 #define OMAP3430_CLKTRCTRL_PER_MASK                    (0x3 << 0)
-
-/* CM_CLKSTST_PER */
-#define OMAP3430_CLKACTIVITY_PER_SHIFT                 0
-#define OMAP3430_CLKACTIVITY_PER_MASK                  (1 << 0)
-
-/* CM_CLKSEL1_EMU */
 #define OMAP3430_DIV_DPLL4_SHIFT                       24
-#define OMAP3430_DIV_DPLL4_MASK                                (0x1f << 24)
-#define OMAP3430_DIV_DPLL4_WIDTH                       5
-#define OMAP3630_DIV_DPLL4_MASK                                (0x3f << 24)
 #define OMAP3630_DIV_DPLL4_WIDTH                       6
 #define OMAP3430_DIV_DPLL3_SHIFT                       16
-#define OMAP3430_DIV_DPLL3_MASK                                (0x1f << 16)
 #define OMAP3430_DIV_DPLL3_WIDTH                       5
 #define OMAP3430_CLKSEL_TRACECLK_SHIFT                 11
-#define OMAP3430_CLKSEL_TRACECLK_MASK                  (0x7 << 11)
 #define OMAP3430_CLKSEL_TRACECLK_WIDTH                 3
 #define OMAP3430_CLKSEL_PCLK_SHIFT                     8
-#define OMAP3430_CLKSEL_PCLK_MASK                      (0x7 << 8)
 #define OMAP3430_CLKSEL_PCLK_WIDTH                     3
 #define OMAP3430_CLKSEL_PCLKX2_SHIFT                   6
-#define OMAP3430_CLKSEL_PCLKX2_MASK                    (0x3 << 6)
 #define OMAP3430_CLKSEL_PCLKX2_WIDTH                   2
 #define OMAP3430_CLKSEL_ATCLK_SHIFT                    4
-#define OMAP3430_CLKSEL_ATCLK_MASK                     (0x3 << 4)
 #define OMAP3430_CLKSEL_ATCLK_WIDTH                    2
 #define OMAP3430_TRACE_MUX_CTRL_SHIFT                  2
-#define OMAP3430_TRACE_MUX_CTRL_MASK                   (0x3 << 2)
 #define OMAP3430_TRACE_MUX_CTRL_WIDTH                  2
-#define OMAP3430_MUX_CTRL_SHIFT                                0
 #define OMAP3430_MUX_CTRL_MASK                         (0x3 << 0)
-#define OMAP3430_MUX_CTRL_WIDTH                                2
-
-/* CM_CLKSTCTRL_EMU */
-#define OMAP3430_CLKTRCTRL_EMU_SHIFT                   0
 #define OMAP3430_CLKTRCTRL_EMU_MASK                    (0x3 << 0)
-
-/* CM_CLKSTST_EMU */
-#define OMAP3430_CLKACTIVITY_EMU_SHIFT                 0
-#define OMAP3430_CLKACTIVITY_EMU_MASK                  (1 << 0)
-
-/* CM_CLKSEL2_EMU specific bits */
-#define OMAP3430_CORE_DPLL_EMU_MULT_SHIFT              8
-#define OMAP3430_CORE_DPLL_EMU_MULT_MASK               (0x7ff << 8)
-#define OMAP3430_CORE_DPLL_EMU_DIV_SHIFT               0
-#define OMAP3430_CORE_DPLL_EMU_DIV_MASK                        (0x7f << 0)
-
-/* CM_CLKSEL3_EMU specific bits */
-#define OMAP3430_PERIPH_DPLL_EMU_MULT_SHIFT            8
-#define OMAP3430_PERIPH_DPLL_EMU_MULT_MASK             (0x7ff << 8)
-#define OMAP3430_PERIPH_DPLL_EMU_DIV_SHIFT             0
-#define OMAP3430_PERIPH_DPLL_EMU_DIV_MASK              (0x7f << 0)
-
-/* CM_POLCTRL */
-#define OMAP3430_CLKOUT2_POL_MASK                      (1 << 0)
-
-/* CM_IDLEST_NEON */
-#define OMAP3430_ST_NEON_MASK                          (1 << 0)
-
-/* CM_CLKSTCTRL_NEON */
-#define OMAP3430_CLKTRCTRL_NEON_SHIFT                  0
 #define OMAP3430_CLKTRCTRL_NEON_MASK                   (0x3 << 0)
-
-/* CM_FCLKEN_USBHOST */
 #define OMAP3430ES2_EN_USBHOST2_SHIFT                  1
-#define OMAP3430ES2_EN_USBHOST2_MASK                   (1 << 1)
 #define OMAP3430ES2_EN_USBHOST1_SHIFT                  0
-#define OMAP3430ES2_EN_USBHOST1_MASK                   (1 << 0)
-
-/* CM_ICLKEN_USBHOST */
 #define OMAP3430ES2_EN_USBHOST_SHIFT                   0
-#define OMAP3430ES2_EN_USBHOST_MASK                    (1 << 0)
-
-/* CM_IDLEST_USBHOST */
 #define OMAP3430ES2_ST_USBHOST_IDLE_SHIFT              1
-#define OMAP3430ES2_ST_USBHOST_IDLE_MASK               (1 << 1)
 #define OMAP3430ES2_ST_USBHOST_STDBY_SHIFT             0
-#define OMAP3430ES2_ST_USBHOST_STDBY_MASK              (1 << 0)
-
-/* CM_AUTOIDLE_USBHOST */
-#define OMAP3430ES2_AUTO_USBHOST_SHIFT                 0
-#define OMAP3430ES2_AUTO_USBHOST_MASK                  (1 << 0)
-
-/* CM_SLEEPDEP_USBHOST */
-#define OMAP3430ES2_EN_MPU_SHIFT                       1
-#define OMAP3430ES2_EN_MPU_MASK                                (1 << 1)
-#define OMAP3430ES2_EN_IVA2_SHIFT                      2
-#define OMAP3430ES2_EN_IVA2_MASK                       (1 << 2)
-
-/* CM_CLKSTCTRL_USBHOST */
-#define OMAP3430ES2_CLKTRCTRL_USBHOST_SHIFT            0
 #define OMAP3430ES2_CLKTRCTRL_USBHOST_MASK             (3 << 0)
-
-/* CM_CLKSTST_USBHOST */
-#define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT          0
-#define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK           (1 << 0)
-
-/*
- *
- */
-
-/* OMAP3XXX CM_CLKSTCTRL_*.CLKTRCTRL_* register bit values */
 #define OMAP34XX_CLKSTCTRL_DISABLE_AUTO                0x0
 #define OMAP34XX_CLKSTCTRL_FORCE_SLEEP         0x1
 #define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP                0x2
 #define OMAP34XX_CLKSTCTRL_ENABLE_AUTO         0x3
-
-
 #endif
index 4c6c2f7..4dbbd99 100644 (file)
 #ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
 
-/* Used by CM_L3_1_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP */
-#define OMAP4430_ABE_DYNDEP_SHIFT                              3
-#define OMAP4430_ABE_DYNDEP_WIDTH                              0x1
-#define OMAP4430_ABE_DYNDEP_MASK                               (1 << 3)
-
-/*
- * Used by CM_D2D_STATICDEP, CM_DUCATI_STATICDEP, CM_L3INIT_STATICDEP,
- * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_ABE_STATDEP_SHIFT                             3
-#define OMAP4430_ABE_STATDEP_WIDTH                             0x1
-#define OMAP4430_ABE_STATDEP_MASK                              (1 << 3)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP4430_ALWONCORE_DYNDEP_SHIFT                                16
-#define OMAP4430_ALWONCORE_DYNDEP_WIDTH                                0x1
-#define OMAP4430_ALWONCORE_DYNDEP_MASK                         (1 << 16)
-
-/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */
-#define OMAP4430_ALWONCORE_STATDEP_SHIFT                       16
-#define OMAP4430_ALWONCORE_STATDEP_WIDTH                       0x1
-#define OMAP4430_ALWONCORE_STATDEP_MASK                                (1 << 16)
-
-/*
- * Used by CM_AUTOIDLE_DPLL_ABE, CM_AUTOIDLE_DPLL_CORE,
- * CM_AUTOIDLE_DPLL_DDRPHY, CM_AUTOIDLE_DPLL_IVA, CM_AUTOIDLE_DPLL_MPU,
- * CM_AUTOIDLE_DPLL_PER, CM_AUTOIDLE_DPLL_UNIPRO, CM_AUTOIDLE_DPLL_USB
- */
-#define OMAP4430_AUTO_DPLL_MODE_SHIFT                          0
-#define OMAP4430_AUTO_DPLL_MODE_WIDTH                          0x3
 #define OMAP4430_AUTO_DPLL_MODE_MASK                           (0x7 << 0)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP4430_CEFUSE_DYNDEP_SHIFT                           17
-#define OMAP4430_CEFUSE_DYNDEP_WIDTH                           0x1
-#define OMAP4430_CEFUSE_DYNDEP_MASK                            (1 << 17)
-
-/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */
-#define OMAP4430_CEFUSE_STATDEP_SHIFT                          17
-#define OMAP4430_CEFUSE_STATDEP_WIDTH                          0x1
-#define OMAP4430_CEFUSE_STATDEP_MASK                           (1 << 17)
-
-/* Used by CM1_ABE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_SHIFT               13
-#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_MASK                        (1 << 13)
-
-/* Used by CM1_ABE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_SHIFT           12
-#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_MASK            (1 << 12)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_SHIFT                  9
-#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_ABE_LP_CLK_MASK                   (1 << 9)
-
-/* Used by CM1_ABE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_SHIFT                  11
-#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_ABE_SYSCLK_MASK                   (1 << 11)
-
-/* Used by CM1_ABE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_SHIFT                  8
-#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_ABE_X2_CLK_MASK                   (1 << 8)
-
-/* Used by CM_MEMIF_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_SHIFT               11
-#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_MASK                        (1 << 11)
-
-/* Used by CM_MEMIF_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_SHIFT              12
-#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_MASK               (1 << 12)
-
-/* Used by CM_MEMIF_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_SHIFT              13
-#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_MASK               (1 << 13)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_SHIFT           9
-#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_MASK            (1 << 9)
-
-/* Used by CM_ALWON_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_SHIFT                12
-#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_WIDTH                0x1
-#define OMAP4430_CLKACTIVITY_CORE_ALWON_32K_GFCLK_MASK         (1 << 12)
-
-/* Used by CM_EMU_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_SHIFT           9
-#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_MASK            (1 << 9)
-
-/* Used by CM_L4CFG_CLKSTCTRL */
-#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_SHIFT               9
-#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_WIDTH               0x1
-#define OMAP4460_CLKACTIVITY_CORE_TS_GFCLK_MASK                        (1 << 9)
-
-/* Used by CM_CEFUSE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT          9
-#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_WIDTH          0x1
-#define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK           (1 << 9)
-
-/* Used by CM_MEMIF_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DLL_CLK_SHIFT                     9
-#define OMAP4430_CLKACTIVITY_DLL_CLK_WIDTH                     0x1
-#define OMAP4430_CLKACTIVITY_DLL_CLK_MASK                      (1 << 9)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_SHIFT                 9
-#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_WIDTH                 0x1
-#define OMAP4430_CLKACTIVITY_DMT10_GFCLK_MASK                  (1 << 9)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_SHIFT                 10
-#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_WIDTH                 0x1
-#define OMAP4430_CLKACTIVITY_DMT11_GFCLK_MASK                  (1 << 10)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_SHIFT                  11
-#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_DMT2_GFCLK_MASK                   (1 << 11)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_SHIFT                  12
-#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_DMT3_GFCLK_MASK                   (1 << 12)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_SHIFT                  13
-#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_DMT4_GFCLK_MASK                   (1 << 13)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_SHIFT                  14
-#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_DMT9_GFCLK_MASK                   (1 << 14)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_SHIFT           10
-#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_MASK            (1 << 10)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DSS_FCLK_SHIFT                    9
-#define OMAP4430_CLKACTIVITY_DSS_FCLK_WIDTH                    0x1
-#define OMAP4430_CLKACTIVITY_DSS_FCLK_MASK                     (1 << 9)
-
-/* Used by CM_DUCATI_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_SHIFT                 8
-#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_WIDTH                 0x1
-#define OMAP4430_CLKACTIVITY_DUCATI_GCLK_MASK                  (1 << 8)
-
-/* Used by CM_EMU_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_SHIFT                 8
-#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_WIDTH                 0x1
-#define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_MASK                  (1 << 8)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_SHIFT                  10
-#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_FDIF_GFCLK_MASK                   (1 << 10)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_SHIFT              15
-#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_MASK               (1 << 15)
-
-/* Used by CM1_ABE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_SHIFT              10
-#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_MASK               (1 << 10)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_SHIFT                11
-#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_WIDTH                0x1
-#define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_MASK         (1 << 11)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_SHIFT          20
-#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_WIDTH          0x1
-#define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_MASK           (1 << 20)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_SHIFT               26
-#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_MASK                        (1 << 26)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_SHIFT          21
-#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_WIDTH          0x1
-#define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_MASK           (1 << 21)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_SHIFT               27
-#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_MASK                        (1 << 27)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_SHIFT             13
-#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_WIDTH             0x1
-#define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_MASK              (1 << 13)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_SHIFT              12
-#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_MASK               (1 << 12)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_SHIFT           28
-#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_MASK            (1 << 28)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_SHIFT           29
-#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_MASK            (1 << 29)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_SHIFT              11
-#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_MASK               (1 << 11)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_SHIFT              16
-#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_MASK               (1 << 16)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_SHIFT           17
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_MASK            (1 << 17)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_SHIFT           18
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_MASK            (1 << 18)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_SHIFT           19
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_MASK            (1 << 19)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_ISS_GCLK_SHIFT                    8
-#define OMAP4430_CLKACTIVITY_ISS_GCLK_WIDTH                    0x1
-#define OMAP4430_CLKACTIVITY_ISS_GCLK_MASK                     (1 << 8)
-
-/* Used by CM_IVAHD_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_SHIFT              8
-#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_MASK               (1 << 8)
-
-/* Used by CM_D2D_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_SHIFT              10
-#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_L3X2_D2D_GICLK_MASK               (1 << 10)
-
-/* Used by CM_L3_1_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_1_GICLK_SHIFT                  8
-#define OMAP4430_CLKACTIVITY_L3_1_GICLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_L3_1_GICLK_MASK                   (1 << 8)
-
-/* Used by CM_L3_2_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_2_GICLK_SHIFT                  8
-#define OMAP4430_CLKACTIVITY_L3_2_GICLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_L3_2_GICLK_MASK                   (1 << 8)
-
-/* Used by CM_D2D_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_SHIFT                        8
-#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_MASK                 (1 << 8)
-
-/* Used by CM_SDMA_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_SHIFT                        8
-#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_MASK                 (1 << 8)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_SHIFT                        8
-#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_MASK                 (1 << 8)
-
-/* Used by CM_MEMIF_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_SHIFT               8
-#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_MASK                        (1 << 8)
-
-/* Used by CM_GFX_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_SHIFT                        8
-#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_MASK                 (1 << 8)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_SHIFT               8
-#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_MASK                        (1 << 8)
-
-/* Used by CM_L3INSTR_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_SHIFT              8
-#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_MASK               (1 << 8)
-
-/* Used by CM_L4SEC_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_SHIFT             8
-#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_WIDTH             0x1
-#define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_MASK              (1 << 8)
-
-/* Used by CM_ALWON_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_SHIFT                  8
-#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_L4_AO_ICLK_MASK                   (1 << 8)
-
-/* Used by CM_CEFUSE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT             8
-#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_WIDTH             0x1
-#define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_MASK              (1 << 8)
-
-/* Used by CM_L4CFG_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_SHIFT                        8
-#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_MASK                 (1 << 8)
-
-/* Used by CM_D2D_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_SHIFT                        9
-#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_MASK                 (1 << 9)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_SHIFT               9
-#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_MASK                        (1 << 9)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_SHIFT                        8
-#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_L4_PER_GICLK_MASK                 (1 << 8)
-
-/* Used by CM_L4SEC_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_SHIFT             9
-#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_WIDTH             0x1
-#define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_MASK              (1 << 9)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_SHIFT               12
-#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_MASK                        (1 << 12)
-
-/* Used by CM_MPU_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_SHIFT                        8
-#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_MASK                 (1 << 8)
-
-/* Used by CM1_ABE_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_SHIFT               9
-#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_MASK                        (1 << 9)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_SHIFT              16
-#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_MASK               (1 << 16)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_SHIFT               17
-#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_MASK                        (1 << 17)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_SHIFT               18
-#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_MASK                        (1 << 18)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_SHIFT               19
-#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_MASK                        (1 << 19)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_SHIFT           25
-#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_WIDTH           0x1
-#define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_MASK            (1 << 25)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_SHIFT            20
-#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_WIDTH            0x1
-#define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_MASK             (1 << 20)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_MCASP3_GFCLK_SHIFT            21
-#define OMAP4430_CLKACTIVITY_PER_MCASP3_GFCLK_MASK             (1 << 21)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_SHIFT            22
-#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_WIDTH            0x1
-#define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_MASK             (1 << 22)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_SHIFT               24
-#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_MASK                        (1 << 24)
-
-/* Used by CM_MEMIF_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_SHIFT                        10
-#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_MASK                 (1 << 10)
-
-/* Used by CM_GFX_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_SGX_GFCLK_SHIFT                   9
-#define OMAP4430_CLKACTIVITY_SGX_GFCLK_WIDTH                   0x1
-#define OMAP4430_CLKACTIVITY_SGX_GFCLK_MASK                    (1 << 9)
-
-/* Used by CM_ALWON_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_SHIFT              11
-#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_MASK               (1 << 11)
-
-/* Used by CM_ALWON_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_SHIFT               10
-#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_MASK                        (1 << 10)
-
-/* Used by CM_ALWON_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_SHIFT               9
-#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_MASK                        (1 << 9)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_SYS_CLK_SHIFT                     8
-#define OMAP4430_CLKACTIVITY_SYS_CLK_WIDTH                     0x1
-#define OMAP4430_CLKACTIVITY_SYS_CLK_MASK                      (1 << 8)
-
-/* Used by CM_TESLA_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_SHIFT              8
-#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_MASK               (1 << 8)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_SHIFT               22
-#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_MASK                        (1 << 22)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_SHIFT               23
-#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_MASK                        (1 << 23)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_SHIFT               24
-#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_MASK                        (1 << 24)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_SHIFT             10
-#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_WIDTH             0x1
-#define OMAP4430_CLKACTIVITY_UNIPRO_DPLL_CLK_MASK              (1 << 10)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_SHIFT                        14
-#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_WIDTH                        0x1
-#define OMAP4430_CLKACTIVITY_USB_DPLL_CLK_MASK                 (1 << 14)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_SHIFT             15
-#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_WIDTH             0x1
-#define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_MASK              (1 << 15)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_USIM_GFCLK_SHIFT                  10
-#define OMAP4430_CLKACTIVITY_USIM_GFCLK_WIDTH                  0x1
-#define OMAP4430_CLKACTIVITY_USIM_GFCLK_MASK                   (1 << 10)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_SHIFT               30
-#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_WIDTH               0x1
-#define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_MASK                        (1 << 30)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_SHIFT             25
-#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_WIDTH             0x1
-#define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_MASK              (1 << 25)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_SHIFT              11
-#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_WIDTH              0x1
-#define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_MASK               (1 << 11)
-
-/* Used by CM_WKUP_CLKSTCTRL */
-#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_SHIFT               13
-#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_WIDTH               0x1
-#define OMAP4460_CLKACTIVITY_WKUP_TS_GFCLK_MASK                        (1 << 13)
-
-/*
- * Used by CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL,
- * CM1_ABE_TIMER7_CLKCTRL, CM1_ABE_TIMER8_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
- * CM_L3INIT_MMC2_CLKCTRL, CM_L4PER_DMTIMER10_CLKCTRL,
- * CM_L4PER_DMTIMER11_CLKCTRL, CM_L4PER_DMTIMER2_CLKCTRL,
- * CM_L4PER_DMTIMER3_CLKCTRL, CM_L4PER_DMTIMER4_CLKCTRL,
- * CM_L4PER_DMTIMER9_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL
- */
 #define OMAP4430_CLKSEL_SHIFT                                  24
 #define OMAP4430_CLKSEL_WIDTH                                  0x1
 #define OMAP4430_CLKSEL_MASK                                   (1 << 24)
-
-/*
- * Renamed from CLKSEL Used by CM_ABE_DSS_SYS_CLKSEL, CM_ABE_PLL_REF_CLKSEL,
- * CM_CLKSEL_DUCATI_ISS_ROOT, CM_CLKSEL_USB_60MHZ, CM_L4_WKUP_CLKSEL
- */
 #define OMAP4430_CLKSEL_0_0_SHIFT                              0
 #define OMAP4430_CLKSEL_0_0_WIDTH                              0x1
-#define OMAP4430_CLKSEL_0_0_MASK                               (1 << 0)
-
-/* Renamed from CLKSEL Used by CM_BYPCLK_DPLL_IVA, CM_BYPCLK_DPLL_MPU */
 #define OMAP4430_CLKSEL_0_1_SHIFT                              0
 #define OMAP4430_CLKSEL_0_1_WIDTH                              0x2
-#define OMAP4430_CLKSEL_0_1_MASK                               (0x3 << 0)
-
-/* Renamed from CLKSEL Used by CM_L3INIT_HSI_CLKCTRL */
 #define OMAP4430_CLKSEL_24_25_SHIFT                            24
 #define OMAP4430_CLKSEL_24_25_WIDTH                            0x2
-#define OMAP4430_CLKSEL_24_25_MASK                             (0x3 << 24)
-
-/* Used by CM_L3INIT_USB_OTG_CLKCTRL */
 #define OMAP4430_CLKSEL_60M_SHIFT                              24
 #define OMAP4430_CLKSEL_60M_WIDTH                              0x1
-#define OMAP4430_CLKSEL_60M_MASK                               (1 << 24)
-
-/* Used by CM_MPU_MPU_CLKCTRL */
-#define OMAP4460_CLKSEL_ABE_DIV_MODE_SHIFT                     25
-#define OMAP4460_CLKSEL_ABE_DIV_MODE_WIDTH                     0x1
-#define OMAP4460_CLKSEL_ABE_DIV_MODE_MASK                      (1 << 25)
-
-/* Used by CM1_ABE_AESS_CLKCTRL */
 #define OMAP4430_CLKSEL_AESS_FCLK_SHIFT                                24
 #define OMAP4430_CLKSEL_AESS_FCLK_WIDTH                                0x1
-#define OMAP4430_CLKSEL_AESS_FCLK_MASK                         (1 << 24)
-
-/* Used by CM_CLKSEL_CORE */
 #define OMAP4430_CLKSEL_CORE_SHIFT                             0
 #define OMAP4430_CLKSEL_CORE_WIDTH                             0x1
-#define OMAP4430_CLKSEL_CORE_MASK                              (1 << 0)
-
-/* Renamed from CLKSEL_CORE Used by CM_SHADOW_FREQ_CONFIG2 */
-#define OMAP4430_CLKSEL_CORE_1_1_SHIFT                         1
-#define OMAP4430_CLKSEL_CORE_1_1_WIDTH                         0x1
-#define OMAP4430_CLKSEL_CORE_1_1_MASK                          (1 << 1)
-
-/* Used by CM_WKUP_USIM_CLKCTRL */
 #define OMAP4430_CLKSEL_DIV_SHIFT                              24
 #define OMAP4430_CLKSEL_DIV_WIDTH                              0x1
-#define OMAP4430_CLKSEL_DIV_MASK                               (1 << 24)
-
-/* Used by CM_MPU_MPU_CLKCTRL */
-#define OMAP4460_CLKSEL_EMIF_DIV_MODE_SHIFT                    24
-#define OMAP4460_CLKSEL_EMIF_DIV_MODE_WIDTH                    0x1
-#define OMAP4460_CLKSEL_EMIF_DIV_MODE_MASK                     (1 << 24)
-
-/* Used by CM_CAM_FDIF_CLKCTRL */
 #define OMAP4430_CLKSEL_FCLK_SHIFT                             24
 #define OMAP4430_CLKSEL_FCLK_WIDTH                             0x2
-#define OMAP4430_CLKSEL_FCLK_MASK                              (0x3 << 24)
-
-/* Used by CM_L4PER_MCBSP4_CLKCTRL */
 #define OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT                  25
 #define OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH                  0x1
-#define OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK                   (1 << 25)
-
-/*
- * Renamed from CLKSEL_INTERNAL_SOURCE Used by CM1_ABE_DMIC_CLKCTRL,
- * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL,
- * CM1_ABE_MCBSP3_CLKCTRL
- */
-#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_SHIFT     26
-#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_WIDTH     0x2
-#define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_MASK      (0x3 << 26)
-
-/* Used by CM_CLKSEL_CORE */
 #define OMAP4430_CLKSEL_L3_SHIFT                               4
 #define OMAP4430_CLKSEL_L3_WIDTH                               0x1
-#define OMAP4430_CLKSEL_L3_MASK                                        (1 << 4)
-
-/* Renamed from CLKSEL_L3 Used by CM_SHADOW_FREQ_CONFIG2 */
-#define OMAP4430_CLKSEL_L3_SHADOW_SHIFT                                2
-#define OMAP4430_CLKSEL_L3_SHADOW_WIDTH                                0x1
-#define OMAP4430_CLKSEL_L3_SHADOW_MASK                         (1 << 2)
-
-/* Used by CM_CLKSEL_CORE */
 #define OMAP4430_CLKSEL_L4_SHIFT                               8
 #define OMAP4430_CLKSEL_L4_WIDTH                               0x1
-#define OMAP4430_CLKSEL_L4_MASK                                        (1 << 8)
-
-/* Used by CM_CLKSEL_ABE */
 #define OMAP4430_CLKSEL_OPP_SHIFT                              0
 #define OMAP4430_CLKSEL_OPP_WIDTH                              0x2
-#define OMAP4430_CLKSEL_OPP_MASK                               (0x3 << 0)
-
-/* Used by CM_EMU_DEBUGSS_CLKCTRL */
 #define OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT                      27
 #define OMAP4430_CLKSEL_PMD_STM_CLK_WIDTH                      0x3
-#define OMAP4430_CLKSEL_PMD_STM_CLK_MASK                       (0x7 << 27)
-
-/* Used by CM_EMU_DEBUGSS_CLKCTRL */
-#define OMAP4430_CLKSEL_PMD_TRACE_CLK_SHIFT                    24
-#define OMAP4430_CLKSEL_PMD_TRACE_CLK_WIDTH                    0x3
 #define OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK                     (0x7 << 24)
-
-/* Used by CM_GFX_GFX_CLKCTRL */
-#define OMAP4430_CLKSEL_SGX_FCLK_SHIFT                         24
-#define OMAP4430_CLKSEL_SGX_FCLK_WIDTH                         0x1
 #define OMAP4430_CLKSEL_SGX_FCLK_MASK                          (1 << 24)
-
-/*
- * Used by CM1_ABE_DMIC_CLKCTRL, CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL,
- * CM1_ABE_MCBSP2_CLKCTRL, CM1_ABE_MCBSP3_CLKCTRL
- */
-#define OMAP4430_CLKSEL_SOURCE_SHIFT                           24
-#define OMAP4430_CLKSEL_SOURCE_WIDTH                           0x2
 #define OMAP4430_CLKSEL_SOURCE_MASK                            (0x3 << 24)
-
-/* Renamed from CLKSEL_SOURCE Used by CM_L4PER_MCBSP4_CLKCTRL */
-#define OMAP4430_CLKSEL_SOURCE_24_24_SHIFT                     24
-#define OMAP4430_CLKSEL_SOURCE_24_24_WIDTH                     0x1
 #define OMAP4430_CLKSEL_SOURCE_24_24_MASK                      (1 << 24)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_CLKSEL_UTMI_P1_SHIFT                          24
 #define OMAP4430_CLKSEL_UTMI_P1_WIDTH                          0x1
-#define OMAP4430_CLKSEL_UTMI_P1_MASK                           (1 << 24)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_CLKSEL_UTMI_P2_SHIFT                          25
 #define OMAP4430_CLKSEL_UTMI_P2_WIDTH                          0x1
-#define OMAP4430_CLKSEL_UTMI_P2_MASK                           (1 << 25)
-
-/*
- * Used by CM1_ABE_CLKSTCTRL, CM_ALWON_CLKSTCTRL, CM_CAM_CLKSTCTRL,
- * CM_CEFUSE_CLKSTCTRL, CM_D2D_CLKSTCTRL, CM_DSS_CLKSTCTRL,
- * CM_DUCATI_CLKSTCTRL, CM_EMU_CLKSTCTRL, CM_GFX_CLKSTCTRL, CM_IVAHD_CLKSTCTRL,
- * CM_L3INIT_CLKSTCTRL, CM_L3INSTR_CLKSTCTRL, CM_L3_1_CLKSTCTRL,
- * CM_L3_2_CLKSTCTRL, CM_L4CFG_CLKSTCTRL, CM_L4PER_CLKSTCTRL,
- * CM_L4SEC_CLKSTCTRL, CM_MEMIF_CLKSTCTRL, CM_MPU_CLKSTCTRL, CM_SDMA_CLKSTCTRL,
- * CM_TESLA_CLKSTCTRL, CM_WKUP_CLKSTCTRL
- */
 #define OMAP4430_CLKTRCTRL_SHIFT                               0
-#define OMAP4430_CLKTRCTRL_WIDTH                               0x2
 #define OMAP4430_CLKTRCTRL_MASK                                        (0x3 << 0)
-
-/* Used by CM_EMU_OVERRIDE_DPLL_CORE */
-#define OMAP4430_CORE_DPLL_EMU_DIV_SHIFT                       0
-#define OMAP4430_CORE_DPLL_EMU_DIV_WIDTH                       0x7
-#define OMAP4430_CORE_DPLL_EMU_DIV_MASK                                (0x7f << 0)
-
-/* Used by CM_EMU_OVERRIDE_DPLL_CORE */
-#define OMAP4430_CORE_DPLL_EMU_MULT_SHIFT                      8
-#define OMAP4430_CORE_DPLL_EMU_MULT_WIDTH                      0xb
-#define OMAP4430_CORE_DPLL_EMU_MULT_MASK                       (0x7ff << 8)
-
-/* Used by REVISION_CM1, REVISION_CM2 */
-#define OMAP4430_CUSTOM_SHIFT                                  6
-#define OMAP4430_CUSTOM_WIDTH                                  0x2
-#define OMAP4430_CUSTOM_MASK                                   (0x3 << 6)
-
-/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */
-#define OMAP4430_D2D_DYNDEP_SHIFT                              18
-#define OMAP4430_D2D_DYNDEP_WIDTH                              0x1
-#define OMAP4430_D2D_DYNDEP_MASK                               (1 << 18)
-
-/* Used by CM_MPU_STATICDEP */
-#define OMAP4430_D2D_STATDEP_SHIFT                             18
-#define OMAP4430_D2D_STATDEP_WIDTH                             0x1
-#define OMAP4430_D2D_STATDEP_MASK                              (1 << 18)
-
-/* Used by CM_CLKSEL_DPLL_MPU */
-#define OMAP4460_DCC_COUNT_MAX_SHIFT                           24
-#define OMAP4460_DCC_COUNT_MAX_WIDTH                           0x8
-#define OMAP4460_DCC_COUNT_MAX_MASK                            (0xff << 24)
-
-/* Used by CM_CLKSEL_DPLL_MPU */
-#define OMAP4460_DCC_EN_SHIFT                                  22
-#define OMAP4460_DCC_EN_MASK                                   (1 << 22)
-
-/*
- * Used by CM_SSC_DELTAMSTEP_DPLL_ABE, CM_SSC_DELTAMSTEP_DPLL_CORE,
- * CM_SSC_DELTAMSTEP_DPLL_DDRPHY, CM_SSC_DELTAMSTEP_DPLL_IVA,
- * CM_SSC_DELTAMSTEP_DPLL_MPU, CM_SSC_DELTAMSTEP_DPLL_PER,
- * CM_SSC_DELTAMSTEP_DPLL_UNIPRO, CM_SSC_DELTAMSTEP_DPLL_USB
- */
-#define OMAP4430_DELTAMSTEP_SHIFT                              0
-#define OMAP4430_DELTAMSTEP_WIDTH                              0x14
-#define OMAP4430_DELTAMSTEP_MASK                               (0xfffff << 0)
-
-/* Renamed from DELTAMSTEP Used by CM_SSC_DELTAMSTEP_DPLL_USB */
-#define OMAP4460_DELTAMSTEP_0_20_SHIFT                         0
-#define OMAP4460_DELTAMSTEP_0_20_WIDTH                         0x15
-#define OMAP4460_DELTAMSTEP_0_20_MASK                          (0x1fffff << 0)
-
-/* Used by CM_DLL_CTRL */
-#define OMAP4430_DLL_OVERRIDE_SHIFT                            0
-#define OMAP4430_DLL_OVERRIDE_WIDTH                            0x1
-#define OMAP4430_DLL_OVERRIDE_MASK                             (1 << 0)
-
-/* Renamed from DLL_OVERRIDE Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP4430_DLL_OVERRIDE_2_2_SHIFT                                2
-#define OMAP4430_DLL_OVERRIDE_2_2_WIDTH                                0x1
-#define OMAP4430_DLL_OVERRIDE_2_2_MASK                         (1 << 2)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP4430_DLL_RESET_SHIFT                               3
-#define OMAP4430_DLL_RESET_WIDTH                               0x1
-#define OMAP4430_DLL_RESET_MASK                                        (1 << 3)
-
-/*
- * Used by CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_DDRPHY,
- * CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU, CM_CLKSEL_DPLL_PER,
- * CM_CLKSEL_DPLL_UNIPRO, CM_CLKSEL_DPLL_USB
- */
 #define OMAP4430_DPLL_BYP_CLKSEL_SHIFT                         23
 #define OMAP4430_DPLL_BYP_CLKSEL_WIDTH                         0x1
-#define OMAP4430_DPLL_BYP_CLKSEL_MASK                          (1 << 23)
-
-/* Used by CM_CLKDCOLDO_DPLL_USB */
-#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT                        8
-#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_WIDTH                        0x1
-#define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_MASK                 (1 << 8)
-
-/* Used by CM_CLKSEL_DPLL_CORE */
-#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_SHIFT                   20
-#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_WIDTH                   0x1
-#define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_MASK                    (1 << 20)
-
-/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
-#define OMAP4430_DPLL_CLKOUTHIF_DIV_SHIFT                      0
-#define OMAP4430_DPLL_CLKOUTHIF_DIV_WIDTH                      0x5
 #define OMAP4430_DPLL_CLKOUTHIF_DIV_MASK                       (0x1f << 0)
-
-/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
-#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_SHIFT                 5
-#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_WIDTH                 0x1
-#define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_MASK                  (1 << 5)
-
-/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
 #define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT                        8
-#define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_WIDTH                        0x1
-#define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_MASK                 (1 << 8)
-
-/* Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO */
-#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_SHIFT                 10
-#define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_WIDTH                 0x1
 #define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK                  (1 << 10)
-
-/*
- * Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY,
- * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO
- */
 #define OMAP4430_DPLL_CLKOUT_DIV_SHIFT                         0
 #define OMAP4430_DPLL_CLKOUT_DIV_WIDTH                         0x5
 #define OMAP4430_DPLL_CLKOUT_DIV_MASK                          (0x1f << 0)
-
-/* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_USB */
-#define OMAP4430_DPLL_CLKOUT_DIV_0_6_SHIFT                     0
-#define OMAP4430_DPLL_CLKOUT_DIV_0_6_WIDTH                     0x7
 #define OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK                      (0x7f << 0)
-
-/*
- * Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY,
- * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO
- */
-#define OMAP4430_DPLL_CLKOUT_DIVCHACK_SHIFT                    5
-#define OMAP4430_DPLL_CLKOUT_DIVCHACK_WIDTH                    0x1
-#define OMAP4430_DPLL_CLKOUT_DIVCHACK_MASK                     (1 << 5)
-
-/* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_USB */
-#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_SHIFT             7
-#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_WIDTH             0x1
-#define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_MASK              (1 << 7)
-
-/*
- * Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY,
- * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_USB
- */
-#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_SHIFT                   8
-#define OMAP4430_DPLL_CLKOUT_GATE_CTRL_WIDTH                   0x1
 #define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK                    (1 << 8)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP4430_DPLL_CORE_DPLL_EN_SHIFT                       8
-#define OMAP4430_DPLL_CORE_DPLL_EN_WIDTH                       0x3
-#define OMAP4430_DPLL_CORE_DPLL_EN_MASK                                (0x7 << 8)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP4430_DPLL_CORE_M2_DIV_SHIFT                                11
-#define OMAP4430_DPLL_CORE_M2_DIV_WIDTH                                0x5
-#define OMAP4430_DPLL_CORE_M2_DIV_MASK                         (0x1f << 11)
-
-/* Used by CM_SHADOW_FREQ_CONFIG2 */
-#define OMAP4430_DPLL_CORE_M5_DIV_SHIFT                                3
-#define OMAP4430_DPLL_CORE_M5_DIV_WIDTH                                0x5
-#define OMAP4430_DPLL_CORE_M5_DIV_MASK                         (0x1f << 3)
-
-/*
- * Used by CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_DDRPHY,
- * CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU, CM_CLKSEL_DPLL_PER,
- * CM_CLKSEL_DPLL_UNIPRO
- */
-#define OMAP4430_DPLL_DIV_SHIFT                                        0
-#define OMAP4430_DPLL_DIV_WIDTH                                        0x7
 #define OMAP4430_DPLL_DIV_MASK                                 (0x7f << 0)
-
-/* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_USB */
-#define OMAP4430_DPLL_DIV_0_7_SHIFT                            0
-#define OMAP4430_DPLL_DIV_0_7_WIDTH                            0x8
 #define OMAP4430_DPLL_DIV_0_7_MASK                             (0xff << 0)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDRPHY,
- * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define OMAP4430_DPLL_DRIFTGUARD_EN_SHIFT                      8
-#define OMAP4430_DPLL_DRIFTGUARD_EN_WIDTH                      0x1
-#define OMAP4430_DPLL_DRIFTGUARD_EN_MASK                       (1 << 8)
-
-/* Renamed from DPLL_DRIFTGUARD_EN Used by CM_CLKMODE_DPLL_UNIPRO */
-#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_SHIFT                  3
-#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_WIDTH                  0x1
-#define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_MASK                   (1 << 3)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDRPHY,
- * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER,
- * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
- */
-#define OMAP4430_DPLL_EN_SHIFT                                 0
-#define OMAP4430_DPLL_EN_WIDTH                                 0x3
 #define OMAP4430_DPLL_EN_MASK                                  (0x7 << 0)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDRPHY,
- * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER,
- * CM_CLKMODE_DPLL_UNIPRO
- */
-#define OMAP4430_DPLL_LPMODE_EN_SHIFT                          10
-#define OMAP4430_DPLL_LPMODE_EN_WIDTH                          0x1
 #define OMAP4430_DPLL_LPMODE_EN_MASK                           (1 << 10)
-
-/*
- * Used by CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_DDRPHY,
- * CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU, CM_CLKSEL_DPLL_PER,
- * CM_CLKSEL_DPLL_UNIPRO
- */
-#define OMAP4430_DPLL_MULT_SHIFT                               8
-#define OMAP4430_DPLL_MULT_WIDTH                               0xb
 #define OMAP4430_DPLL_MULT_MASK                                        (0x7ff << 8)
-
-/* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_USB */
-#define OMAP4430_DPLL_MULT_USB_SHIFT                           8
-#define OMAP4430_DPLL_MULT_USB_WIDTH                           0xc
 #define OMAP4430_DPLL_MULT_USB_MASK                            (0xfff << 8)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDRPHY,
- * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER,
- * CM_CLKMODE_DPLL_UNIPRO
- */
-#define OMAP4430_DPLL_REGM4XEN_SHIFT                           11
-#define OMAP4430_DPLL_REGM4XEN_WIDTH                           0x1
 #define OMAP4430_DPLL_REGM4XEN_MASK                            (1 << 11)
-
-/* Used by CM_CLKSEL_DPLL_USB */
-#define OMAP4430_DPLL_SD_DIV_SHIFT                             24
-#define OMAP4430_DPLL_SD_DIV_WIDTH                             0x8
 #define OMAP4430_DPLL_SD_DIV_MASK                              (0xff << 24)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDRPHY,
- * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER,
- * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
- */
-#define OMAP4430_DPLL_SSC_ACK_SHIFT                            13
-#define OMAP4430_DPLL_SSC_ACK_WIDTH                            0x1
-#define OMAP4430_DPLL_SSC_ACK_MASK                             (1 << 13)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDRPHY,
- * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER,
- * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
- */
-#define OMAP4430_DPLL_SSC_DOWNSPREAD_SHIFT                     14
-#define OMAP4430_DPLL_SSC_DOWNSPREAD_WIDTH                     0x1
-#define OMAP4430_DPLL_SSC_DOWNSPREAD_MASK                      (1 << 14)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_DDRPHY,
- * CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER,
- * CM_CLKMODE_DPLL_UNIPRO, CM_CLKMODE_DPLL_USB
- */
-#define OMAP4430_DPLL_SSC_EN_SHIFT                             12
-#define OMAP4430_DPLL_SSC_EN_WIDTH                             0x1
-#define OMAP4430_DPLL_SSC_EN_MASK                              (1 << 12)
-
-/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
-#define OMAP4430_DSS_DYNDEP_SHIFT                              8
-#define OMAP4430_DSS_DYNDEP_WIDTH                              0x1
-#define OMAP4430_DSS_DYNDEP_MASK                               (1 << 8)
-
-/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_SDMA_STATICDEP */
 #define OMAP4430_DSS_STATDEP_SHIFT                             8
-#define OMAP4430_DSS_STATDEP_WIDTH                             0x1
-#define OMAP4430_DSS_STATDEP_MASK                              (1 << 8)
-
-/* Used by CM_L3_2_DYNAMICDEP */
-#define OMAP4430_DUCATI_DYNDEP_SHIFT                           0
-#define OMAP4430_DUCATI_DYNDEP_WIDTH                           0x1
-#define OMAP4430_DUCATI_DYNDEP_MASK                            (1 << 0)
-
-/* Used by CM_MPU_STATICDEP, CM_SDMA_STATICDEP */
 #define OMAP4430_DUCATI_STATDEP_SHIFT                          0
-#define OMAP4430_DUCATI_STATDEP_WIDTH                          0x1
-#define OMAP4430_DUCATI_STATDEP_MASK                           (1 << 0)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP4430_FREQ_UPDATE_SHIFT                             0
-#define OMAP4430_FREQ_UPDATE_WIDTH                             0x1
-#define OMAP4430_FREQ_UPDATE_MASK                              (1 << 0)
-
-/* Used by REVISION_CM1, REVISION_CM2 */
-#define OMAP4430_FUNC_SHIFT                                    16
-#define OMAP4430_FUNC_WIDTH                                    0xc
-#define OMAP4430_FUNC_MASK                                     (0xfff << 16)
-
-/* Used by CM_L3_2_DYNAMICDEP */
-#define OMAP4430_GFX_DYNDEP_SHIFT                              10
-#define OMAP4430_GFX_DYNDEP_WIDTH                              0x1
-#define OMAP4430_GFX_DYNDEP_MASK                               (1 << 10)
-
-/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */
 #define OMAP4430_GFX_STATDEP_SHIFT                             10
-#define OMAP4430_GFX_STATDEP_WIDTH                             0x1
-#define OMAP4430_GFX_STATDEP_MASK                              (1 << 10)
-
-/* Used by CM_SHADOW_FREQ_CONFIG2 */
-#define OMAP4430_GPMC_FREQ_UPDATE_SHIFT                                0
-#define OMAP4430_GPMC_FREQ_UPDATE_WIDTH                                0x1
-#define OMAP4430_GPMC_FREQ_UPDATE_MASK                         (1 << 0)
-
-/*
- * Used by CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA,
- * CM_DIV_M4_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT1_DIV_SHIFT                   0
-#define OMAP4430_HSDIVIDER_CLKOUT1_DIV_WIDTH                   0x5
 #define OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK                    (0x1f << 0)
-
-/*
- * Used by CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA,
- * CM_DIV_M4_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT              5
-#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_WIDTH              0x1
-#define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_MASK               (1 << 5)
-
-/*
- * Used by CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA,
- * CM_DIV_M4_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT             8
-#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_WIDTH             0x1
-#define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK              (1 << 8)
-
-/*
- * Used by CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA,
- * CM_DIV_M4_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_SHIFT                  12
-#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_WIDTH                  0x1
-#define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_MASK                   (1 << 12)
-
-/*
- * Used by CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA,
- * CM_DIV_M5_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT2_DIV_SHIFT                   0
-#define OMAP4430_HSDIVIDER_CLKOUT2_DIV_WIDTH                   0x5
 #define OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK                    (0x1f << 0)
-
-/*
- * Used by CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA,
- * CM_DIV_M5_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT              5
-#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_WIDTH              0x1
-#define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_MASK               (1 << 5)
-
-/*
- * Used by CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA,
- * CM_DIV_M5_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT             8
-#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_WIDTH             0x1
-#define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK              (1 << 8)
-
-/*
- * Used by CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA,
- * CM_DIV_M5_DPLL_PER
- */
-#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_SHIFT                  12
-#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_WIDTH                  0x1
-#define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_MASK                   (1 << 12)
-
-/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT3_DIV_SHIFT                   0
-#define OMAP4430_HSDIVIDER_CLKOUT3_DIV_WIDTH                   0x5
 #define OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK                    (0x1f << 0)
-
-/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT              5
-#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_WIDTH              0x1
-#define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_MASK               (1 << 5)
-
-/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT             8
-#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_WIDTH             0x1
-#define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK              (1 << 8)
-
-/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_SHIFT                  12
-#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_WIDTH                  0x1
-#define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_MASK                   (1 << 12)
-
-/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT4_DIV_SHIFT                   0
-#define OMAP4430_HSDIVIDER_CLKOUT4_DIV_WIDTH                   0x5
 #define OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK                    (0x1f << 0)
-
-/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_SHIFT              5
-#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_WIDTH              0x1
-#define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_MASK               (1 << 5)
-
-/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_SHIFT             8
-#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_WIDTH             0x1
-#define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_MASK              (1 << 8)
-
-/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
-#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_SHIFT                  12
-#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_WIDTH                  0x1
-#define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_MASK                   (1 << 12)
-
-/*
- * Used by CM1_ABE_AESS_CLKCTRL, CM1_ABE_DMIC_CLKCTRL, CM1_ABE_L4ABE_CLKCTRL,
- * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL,
- * CM1_ABE_MCBSP3_CLKCTRL, CM1_ABE_PDM_CLKCTRL, CM1_ABE_SLIMBUS_CLKCTRL,
- * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL,
- * CM1_ABE_TIMER8_CLKCTRL, CM1_ABE_WDT3_CLKCTRL, CM_ALWON_SR_CORE_CLKCTRL,
- * CM_ALWON_SR_IVA_CLKCTRL, CM_ALWON_SR_MPU_CLKCTRL, CM_CAM_FDIF_CLKCTRL,
- * CM_CAM_ISS_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL, CM_CM1_PROFILING_CLKCTRL,
- * CM_CM2_PROFILING_CLKCTRL, CM_D2D_MODEM_ICR_CLKCTRL, CM_D2D_SAD2D_CLKCTRL,
- * CM_D2D_SAD2D_FW_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
- * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL,
- * CM_IVAHD_SL2_CLKCTRL, CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
- * CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
- * CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_FS_CLKCTRL,
- * CM_L3INIT_USB_OTG_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL,
- * CM_L3INSTR_L3_3_CLKCTRL, CM_L3INSTR_L3_INSTR_CLKCTRL,
- * CM_L3INSTR_OCP_WP1_CLKCTRL, CM_L3_1_L3_1_CLKCTRL, CM_L3_2_GPMC_CLKCTRL,
- * CM_L3_2_L3_2_CLKCTRL, CM_L3_2_OCMC_RAM_CLKCTRL, CM_L4CFG_HW_SEM_CLKCTRL,
- * CM_L4CFG_L4_CFG_CLKCTRL, CM_L4CFG_MAILBOX_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL,
- * CM_L4PER_DMTIMER10_CLKCTRL, CM_L4PER_DMTIMER11_CLKCTRL,
- * CM_L4PER_DMTIMER2_CLKCTRL, CM_L4PER_DMTIMER3_CLKCTRL,
- * CM_L4PER_DMTIMER4_CLKCTRL, CM_L4PER_DMTIMER9_CLKCTRL, CM_L4PER_ELM_CLKCTRL,
- * CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL,
- * CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_HDQ1W_CLKCTRL,
- * CM_L4PER_I2C1_CLKCTRL, CM_L4PER_I2C2_CLKCTRL, CM_L4PER_I2C3_CLKCTRL,
- * CM_L4PER_I2C4_CLKCTRL, CM_L4PER_I2C5_CLKCTRL, CM_L4PER_L4PER_CLKCTRL,
- * CM_L4PER_MCBSP4_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, CM_L4PER_MCSPI2_CLKCTRL,
- * CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, CM_L4PER_MMCSD3_CLKCTRL,
- * CM_L4PER_MMCSD4_CLKCTRL, CM_L4PER_MMCSD5_CLKCTRL, CM_L4PER_SLIMBUS2_CLKCTRL,
- * CM_L4PER_UART1_CLKCTRL, CM_L4PER_UART2_CLKCTRL, CM_L4PER_UART3_CLKCTRL,
- * CM_L4PER_UART4_CLKCTRL, CM_L4SEC_AES1_CLKCTRL, CM_L4SEC_AES2_CLKCTRL,
- * CM_L4SEC_CRYPTODMA_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
- * CM_L4SEC_PKAEIP29_CLKCTRL, CM_L4SEC_RNG_CLKCTRL, CM_L4SEC_SHA2MD51_CLKCTRL,
- * CM_MEMIF_DMM_CLKCTRL, CM_MEMIF_EMIF_1_CLKCTRL, CM_MEMIF_EMIF_2_CLKCTRL,
- * CM_MEMIF_EMIF_FW_CLKCTRL, CM_MPU_MPU_CLKCTRL, CM_SDMA_SDMA_CLKCTRL,
- * CM_TESLA_TESLA_CLKCTRL, CM_WKUP_GPIO1_CLKCTRL, CM_WKUP_KEYBOARD_CLKCTRL,
- * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_SARRAM_CLKCTRL, CM_WKUP_SYNCTIMER_CLKCTRL,
- * CM_WKUP_TIMER12_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL, CM_WKUP_USIM_CLKCTRL,
- * CM_WKUP_WDT1_CLKCTRL, CM_WKUP_WDT2_CLKCTRL
- */
 #define OMAP4430_IDLEST_SHIFT                                  16
-#define OMAP4430_IDLEST_WIDTH                                  0x2
 #define OMAP4430_IDLEST_MASK                                   (0x3 << 16)
-
-/* Used by CM_DUCATI_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */
-#define OMAP4430_ISS_DYNDEP_SHIFT                              9
-#define OMAP4430_ISS_DYNDEP_WIDTH                              0x1
-#define OMAP4430_ISS_DYNDEP_MASK                               (1 << 9)
-
-/*
- * Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_SDMA_STATICDEP,
- * CM_TESLA_STATICDEP
- */
-#define OMAP4430_ISS_STATDEP_SHIFT                             9
-#define OMAP4430_ISS_STATDEP_WIDTH                             0x1
-#define OMAP4430_ISS_STATDEP_MASK                              (1 << 9)
-
-/* Used by CM_L3_2_DYNAMICDEP, CM_TESLA_DYNAMICDEP */
-#define OMAP4430_IVAHD_DYNDEP_SHIFT                            2
-#define OMAP4430_IVAHD_DYNDEP_WIDTH                            0x1
-#define OMAP4430_IVAHD_DYNDEP_MASK                             (1 << 2)
-
-/*
- * Used by CM_CAM_STATICDEP, CM_D2D_STATICDEP, CM_DSS_STATICDEP,
- * CM_DUCATI_STATICDEP, CM_GFX_STATICDEP, CM_L3INIT_STATICDEP,
- * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_IVAHD_STATDEP_SHIFT                           2
-#define OMAP4430_IVAHD_STATDEP_WIDTH                           0x1
-#define OMAP4430_IVAHD_STATDEP_MASK                            (1 << 2)
-
-/* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
-#define OMAP4430_L3INIT_DYNDEP_SHIFT                           7
-#define OMAP4430_L3INIT_DYNDEP_WIDTH                           0x1
-#define OMAP4430_L3INIT_DYNDEP_MASK                            (1 << 7)
-
-/*
- * Used by CM_D2D_STATICDEP, CM_DUCATI_STATICDEP, CM_MPU_STATICDEP,
- * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_L3INIT_STATDEP_SHIFT                          7
-#define OMAP4430_L3INIT_STATDEP_WIDTH                          0x1
-#define OMAP4430_L3INIT_STATDEP_MASK                           (1 << 7)
-
-/*
- * Used by CM_DSS_DYNAMICDEP, CM_L3INIT_DYNAMICDEP, CM_L3_2_DYNAMICDEP,
- * CM_L4CFG_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP
- */
-#define OMAP4430_L3_1_DYNDEP_SHIFT                             5
-#define OMAP4430_L3_1_DYNDEP_WIDTH                             0x1
-#define OMAP4430_L3_1_DYNDEP_MASK                              (1 << 5)
-
-/*
- * Used by CM_CAM_STATICDEP, CM_D2D_STATICDEP, CM_DSS_STATICDEP,
- * CM_DUCATI_STATICDEP, CM_GFX_STATICDEP, CM_IVAHD_STATICDEP,
- * CM_L3INIT_STATICDEP, CM_L4SEC_STATICDEP, CM_MPU_STATICDEP,
- * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_L3_1_STATDEP_SHIFT                            5
-#define OMAP4430_L3_1_STATDEP_WIDTH                            0x1
-#define OMAP4430_L3_1_STATDEP_MASK                             (1 << 5)
-
-/*
- * Used by CM_CAM_DYNAMICDEP, CM_D2D_DYNAMICDEP, CM_DUCATI_DYNAMICDEP,
- * CM_EMU_DYNAMICDEP, CM_GFX_DYNAMICDEP, CM_IVAHD_DYNAMICDEP,
- * CM_L3INIT_DYNAMICDEP, CM_L3_1_DYNAMICDEP, CM_L4CFG_DYNAMICDEP,
- * CM_L4SEC_DYNAMICDEP, CM_SDMA_DYNAMICDEP
- */
-#define OMAP4430_L3_2_DYNDEP_SHIFT                             6
-#define OMAP4430_L3_2_DYNDEP_WIDTH                             0x1
-#define OMAP4430_L3_2_DYNDEP_MASK                              (1 << 6)
-
-/*
- * Used by CM_CAM_STATICDEP, CM_D2D_STATICDEP, CM_DSS_STATICDEP,
- * CM_DUCATI_STATICDEP, CM_GFX_STATICDEP, CM_IVAHD_STATICDEP,
- * CM_L3INIT_STATICDEP, CM_L4SEC_STATICDEP, CM_MPU_STATICDEP,
- * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_L3_2_STATDEP_SHIFT                            6
-#define OMAP4430_L3_2_STATDEP_WIDTH                            0x1
-#define OMAP4430_L3_2_STATDEP_MASK                             (1 << 6)
-
-/* Used by CM_L3_1_DYNAMICDEP */
-#define OMAP4430_L4CFG_DYNDEP_SHIFT                            12
-#define OMAP4430_L4CFG_DYNDEP_WIDTH                            0x1
-#define OMAP4430_L4CFG_DYNDEP_MASK                             (1 << 12)
-
-/*
- * Used by CM_D2D_STATICDEP, CM_DUCATI_STATICDEP, CM_L3INIT_STATICDEP,
- * CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_L4CFG_STATDEP_SHIFT                           12
-#define OMAP4430_L4CFG_STATDEP_WIDTH                           0x1
-#define OMAP4430_L4CFG_STATDEP_MASK                            (1 << 12)
-
-/* Used by CM_L3_2_DYNAMICDEP */
-#define OMAP4430_L4PER_DYNDEP_SHIFT                            13
-#define OMAP4430_L4PER_DYNDEP_WIDTH                            0x1
-#define OMAP4430_L4PER_DYNDEP_MASK                             (1 << 13)
-
-/*
- * Used by CM_D2D_STATICDEP, CM_DUCATI_STATICDEP, CM_L3INIT_STATICDEP,
- * CM_L4SEC_STATICDEP, CM_MPU_STATICDEP, CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_L4PER_STATDEP_SHIFT                           13
-#define OMAP4430_L4PER_STATDEP_WIDTH                           0x1
-#define OMAP4430_L4PER_STATDEP_MASK                            (1 << 13)
-
-/* Used by CM_L3_2_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
-#define OMAP4430_L4SEC_DYNDEP_SHIFT                            14
-#define OMAP4430_L4SEC_DYNDEP_WIDTH                            0x1
-#define OMAP4430_L4SEC_DYNDEP_MASK                             (1 << 14)
-
-/*
- * Used by CM_DUCATI_STATICDEP, CM_L3INIT_STATICDEP, CM_MPU_STATICDEP,
- * CM_SDMA_STATICDEP
- */
 #define OMAP4430_L4SEC_STATDEP_SHIFT                           14
-#define OMAP4430_L4SEC_STATDEP_WIDTH                           0x1
-#define OMAP4430_L4SEC_STATDEP_MASK                            (1 << 14)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP4430_L4WKUP_DYNDEP_SHIFT                           15
-#define OMAP4430_L4WKUP_DYNDEP_WIDTH                           0x1
-#define OMAP4430_L4WKUP_DYNDEP_MASK                            (1 << 15)
-
-/*
- * Used by CM_DUCATI_STATICDEP, CM_L3INIT_STATICDEP, CM_MPU_STATICDEP,
- * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_L4WKUP_STATDEP_SHIFT                          15
-#define OMAP4430_L4WKUP_STATDEP_WIDTH                          0x1
-#define OMAP4430_L4WKUP_STATDEP_MASK                           (1 << 15)
-
-/*
- * Used by CM_D2D_DYNAMICDEP, CM_L3_1_DYNAMICDEP, CM_L4CFG_DYNAMICDEP,
- * CM_MPU_DYNAMICDEP
- */
-#define OMAP4430_MEMIF_DYNDEP_SHIFT                            4
-#define OMAP4430_MEMIF_DYNDEP_WIDTH                            0x1
-#define OMAP4430_MEMIF_DYNDEP_MASK                             (1 << 4)
-
-/*
- * Used by CM_CAM_STATICDEP, CM_D2D_STATICDEP, CM_DSS_STATICDEP,
- * CM_DUCATI_STATICDEP, CM_GFX_STATICDEP, CM_IVAHD_STATICDEP,
- * CM_L3INIT_STATICDEP, CM_L4SEC_STATICDEP, CM_MPU_STATICDEP,
- * CM_SDMA_STATICDEP, CM_TESLA_STATICDEP
- */
 #define OMAP4430_MEMIF_STATDEP_SHIFT                           4
-#define OMAP4430_MEMIF_STATDEP_WIDTH                           0x1
-#define OMAP4430_MEMIF_STATDEP_MASK                            (1 << 4)
-
-/*
- * Used by CM_SSC_MODFREQDIV_DPLL_ABE, CM_SSC_MODFREQDIV_DPLL_CORE,
- * CM_SSC_MODFREQDIV_DPLL_DDRPHY, CM_SSC_MODFREQDIV_DPLL_IVA,
- * CM_SSC_MODFREQDIV_DPLL_MPU, CM_SSC_MODFREQDIV_DPLL_PER,
- * CM_SSC_MODFREQDIV_DPLL_UNIPRO, CM_SSC_MODFREQDIV_DPLL_USB
- */
-#define OMAP4430_MODFREQDIV_EXPONENT_SHIFT                     8
-#define OMAP4430_MODFREQDIV_EXPONENT_WIDTH                     0x3
-#define OMAP4430_MODFREQDIV_EXPONENT_MASK                      (0x7 << 8)
-
-/*
- * Used by CM_SSC_MODFREQDIV_DPLL_ABE, CM_SSC_MODFREQDIV_DPLL_CORE,
- * CM_SSC_MODFREQDIV_DPLL_DDRPHY, CM_SSC_MODFREQDIV_DPLL_IVA,
- * CM_SSC_MODFREQDIV_DPLL_MPU, CM_SSC_MODFREQDIV_DPLL_PER,
- * CM_SSC_MODFREQDIV_DPLL_UNIPRO, CM_SSC_MODFREQDIV_DPLL_USB
- */
-#define OMAP4430_MODFREQDIV_MANTISSA_SHIFT                     0
-#define OMAP4430_MODFREQDIV_MANTISSA_WIDTH                     0x7
-#define OMAP4430_MODFREQDIV_MANTISSA_MASK                      (0x7f << 0)
-
-/*
- * Used by CM1_ABE_AESS_CLKCTRL, CM1_ABE_DMIC_CLKCTRL, CM1_ABE_L4ABE_CLKCTRL,
- * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL,
- * CM1_ABE_MCBSP3_CLKCTRL, CM1_ABE_PDM_CLKCTRL, CM1_ABE_SLIMBUS_CLKCTRL,
- * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL,
- * CM1_ABE_TIMER8_CLKCTRL, CM1_ABE_WDT3_CLKCTRL, CM_ALWON_SR_CORE_CLKCTRL,
- * CM_ALWON_SR_IVA_CLKCTRL, CM_ALWON_SR_MPU_CLKCTRL, CM_CAM_FDIF_CLKCTRL,
- * CM_CAM_ISS_CLKCTRL, CM_CEFUSE_CEFUSE_CLKCTRL, CM_CM1_PROFILING_CLKCTRL,
- * CM_CM2_PROFILING_CLKCTRL, CM_D2D_MODEM_ICR_CLKCTRL, CM_D2D_SAD2D_CLKCTRL,
- * CM_D2D_SAD2D_FW_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
- * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL,
- * CM_IVAHD_SL2_CLKCTRL, CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
- * CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
- * CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_FS_CLKCTRL,
- * CM_L3INIT_USB_OTG_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL,
- * CM_L3INSTR_L3_3_CLKCTRL, CM_L3INSTR_L3_INSTR_CLKCTRL,
- * CM_L3INSTR_OCP_WP1_CLKCTRL, CM_L3_1_L3_1_CLKCTRL, CM_L3_2_GPMC_CLKCTRL,
- * CM_L3_2_L3_2_CLKCTRL, CM_L3_2_OCMC_RAM_CLKCTRL, CM_L4CFG_HW_SEM_CLKCTRL,
- * CM_L4CFG_L4_CFG_CLKCTRL, CM_L4CFG_MAILBOX_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL,
- * CM_L4PER_DMTIMER10_CLKCTRL, CM_L4PER_DMTIMER11_CLKCTRL,
- * CM_L4PER_DMTIMER2_CLKCTRL, CM_L4PER_DMTIMER3_CLKCTRL,
- * CM_L4PER_DMTIMER4_CLKCTRL, CM_L4PER_DMTIMER9_CLKCTRL, CM_L4PER_ELM_CLKCTRL,
- * CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL,
- * CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_HDQ1W_CLKCTRL,
- * CM_L4PER_I2C1_CLKCTRL, CM_L4PER_I2C2_CLKCTRL, CM_L4PER_I2C3_CLKCTRL,
- * CM_L4PER_I2C4_CLKCTRL, CM_L4PER_I2C5_CLKCTRL, CM_L4PER_L4PER_CLKCTRL,
- * CM_L4PER_MCBSP4_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, CM_L4PER_MCSPI2_CLKCTRL,
- * CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, CM_L4PER_MMCSD3_CLKCTRL,
- * CM_L4PER_MMCSD4_CLKCTRL, CM_L4PER_MMCSD5_CLKCTRL, CM_L4PER_SLIMBUS2_CLKCTRL,
- * CM_L4PER_UART1_CLKCTRL, CM_L4PER_UART2_CLKCTRL, CM_L4PER_UART3_CLKCTRL,
- * CM_L4PER_UART4_CLKCTRL, CM_L4SEC_AES1_CLKCTRL, CM_L4SEC_AES2_CLKCTRL,
- * CM_L4SEC_CRYPTODMA_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
- * CM_L4SEC_PKAEIP29_CLKCTRL, CM_L4SEC_RNG_CLKCTRL, CM_L4SEC_SHA2MD51_CLKCTRL,
- * CM_MEMIF_DMM_CLKCTRL, CM_MEMIF_EMIF_1_CLKCTRL, CM_MEMIF_EMIF_2_CLKCTRL,
- * CM_MEMIF_EMIF_FW_CLKCTRL, CM_MPU_MPU_CLKCTRL, CM_SDMA_SDMA_CLKCTRL,
- * CM_TESLA_TESLA_CLKCTRL, CM_WKUP_GPIO1_CLKCTRL, CM_WKUP_KEYBOARD_CLKCTRL,
- * CM_WKUP_L4WKUP_CLKCTRL, CM_WKUP_SARRAM_CLKCTRL, CM_WKUP_SYNCTIMER_CLKCTRL,
- * CM_WKUP_TIMER12_CLKCTRL, CM_WKUP_TIMER1_CLKCTRL, CM_WKUP_USIM_CLKCTRL,
- * CM_WKUP_WDT1_CLKCTRL, CM_WKUP_WDT2_CLKCTRL
- */
 #define OMAP4430_MODULEMODE_SHIFT                              0
-#define OMAP4430_MODULEMODE_WIDTH                              0x2
 #define OMAP4430_MODULEMODE_MASK                               (0x3 << 0)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP4460_MPU_DYNDEP_SHIFT                              19
-#define OMAP4460_MPU_DYNDEP_WIDTH                              0x1
-#define OMAP4460_MPU_DYNDEP_MASK                               (1 << 19)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT                     9
-#define OMAP4430_OPTFCLKEN_48MHZ_CLK_WIDTH                     0x1
-#define OMAP4430_OPTFCLKEN_48MHZ_CLK_MASK                      (1 << 9)
-
-/* Used by CM_WKUP_BANDGAP_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT                      8
-#define OMAP4430_OPTFCLKEN_BGAP_32K_WIDTH                      0x1
-#define OMAP4430_OPTFCLKEN_BGAP_32K_MASK                       (1 << 8)
-
-/* Used by CM_ALWON_USBPHY_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_CLK32K_SHIFT                                8
-#define OMAP4430_OPTFCLKEN_CLK32K_WIDTH                                0x1
-#define OMAP4430_OPTFCLKEN_CLK32K_MASK                         (1 << 8)
-
-/* Used by CM_CAM_ISS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT                       8
-#define OMAP4430_OPTFCLKEN_CTRLCLK_WIDTH                       0x1
-#define OMAP4430_OPTFCLKEN_CTRLCLK_MASK                                (1 << 8)
-
-/*
- * Used by CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL,
- * CM_L4PER_GPIO4_CLKCTRL, CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL,
- * CM_WKUP_GPIO1_CLKCTRL
- */
 #define OMAP4430_OPTFCLKEN_DBCLK_SHIFT                         8
-#define OMAP4430_OPTFCLKEN_DBCLK_WIDTH                         0x1
-#define OMAP4430_OPTFCLKEN_DBCLK_MASK                          (1 << 8)
-
-/* Used by CM_MEMIF_DLL_CLKCTRL, CM_MEMIF_DLL_H_CLKCTRL */
-#define OMAP4430_OPTFCLKEN_DLL_CLK_SHIFT                       8
-#define OMAP4430_OPTFCLKEN_DLL_CLK_WIDTH                       0x1
-#define OMAP4430_OPTFCLKEN_DLL_CLK_MASK                                (1 << 8)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_DSSCLK_SHIFT                                8
-#define OMAP4430_OPTFCLKEN_DSSCLK_WIDTH                                0x1
-#define OMAP4430_OPTFCLKEN_DSSCLK_MASK                         (1 << 8)
-
-/* Used by CM_WKUP_USIM_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_FCLK_SHIFT                          8
-#define OMAP4430_OPTFCLKEN_FCLK_WIDTH                          0x1
-#define OMAP4430_OPTFCLKEN_FCLK_MASK                           (1 << 8)
-
-/* Used by CM1_ABE_SLIMBUS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_FCLK0_SHIFT                         8
-#define OMAP4430_OPTFCLKEN_FCLK0_WIDTH                         0x1
-#define OMAP4430_OPTFCLKEN_FCLK0_MASK                          (1 << 8)
-
-/* Used by CM1_ABE_SLIMBUS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_FCLK1_SHIFT                         9
-#define OMAP4430_OPTFCLKEN_FCLK1_WIDTH                         0x1
-#define OMAP4430_OPTFCLKEN_FCLK1_MASK                          (1 << 9)
-
-/* Used by CM1_ABE_SLIMBUS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_FCLK2_SHIFT                         10
-#define OMAP4430_OPTFCLKEN_FCLK2_WIDTH                         0x1
-#define OMAP4430_OPTFCLKEN_FCLK2_MASK                          (1 << 10)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT                    15
-#define OMAP4430_OPTFCLKEN_FUNC48MCLK_WIDTH                    0x1
-#define OMAP4430_OPTFCLKEN_FUNC48MCLK_MASK                     (1 << 15)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT               13
-#define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_WIDTH               0x1
-#define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_MASK                        (1 << 13)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT               14
-#define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_WIDTH               0x1
-#define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_MASK                        (1 << 14)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT                        11
-#define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_WIDTH                        0x1
-#define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_MASK                 (1 << 11)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT                        12
-#define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_WIDTH                        0x1
-#define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_MASK                 (1 << 12)
-
-/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT                 8
-#define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_WIDTH                 0x1
-#define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_MASK                  (1 << 8)
-
-/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT               9
-#define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_WIDTH               0x1
-#define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_MASK                        (1 << 9)
-
-/* Used by CM_L3INIT_USBPHYOCP2SCP_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_PHY_48M_SHIFT                       8
-#define OMAP4430_OPTFCLKEN_PHY_48M_WIDTH                       0x1
-#define OMAP4430_OPTFCLKEN_PHY_48M_MASK                                (1 << 8)
-
-/* Used by CM_L4PER_SLIMBUS2_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT                   10
-#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_WIDTH                   0x1
-#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_MASK                    (1 << 10)
-
-/* Renamed from OPTFCLKEN_SLIMBUS_CLK Used by CM1_ABE_SLIMBUS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT             11
-#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_WIDTH             0x1
-#define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_MASK              (1 << 11)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT                       10
-#define OMAP4430_OPTFCLKEN_SYS_CLK_WIDTH                       0x1
-#define OMAP4430_OPTFCLKEN_SYS_CLK_MASK                                (1 << 10)
-
-/* Used by CM_WKUP_BANDGAP_CLKCTRL */
 #define OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT                       8
-#define OMAP4460_OPTFCLKEN_TS_FCLK_WIDTH                       0x1
-#define OMAP4460_OPTFCLKEN_TS_FCLK_MASK                                (1 << 8)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_TV_CLK_SHIFT                                11
-#define OMAP4430_OPTFCLKEN_TV_CLK_WIDTH                                0x1
-#define OMAP4430_OPTFCLKEN_TV_CLK_MASK                         (1 << 11)
-
-/* Used by CM_L3INIT_UNIPRO1_CLKCTRL */
-#define OMAP4430_OPTFCLKEN_TXPHYCLK_SHIFT                      8
-#define OMAP4430_OPTFCLKEN_TXPHYCLK_WIDTH                      0x1
-#define OMAP4430_OPTFCLKEN_TXPHYCLK_MASK                       (1 << 8)
-
-/* Used by CM_L3INIT_USB_TLL_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT                   8
-#define OMAP4430_OPTFCLKEN_USB_CH0_CLK_WIDTH                   0x1
-#define OMAP4430_OPTFCLKEN_USB_CH0_CLK_MASK                    (1 << 8)
-
-/* Used by CM_L3INIT_USB_TLL_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT                   9
-#define OMAP4430_OPTFCLKEN_USB_CH1_CLK_WIDTH                   0x1
-#define OMAP4430_OPTFCLKEN_USB_CH1_CLK_MASK                    (1 << 9)
-
-/* Used by CM_L3INIT_USB_TLL_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT                   10
-#define OMAP4430_OPTFCLKEN_USB_CH2_CLK_WIDTH                   0x1
-#define OMAP4430_OPTFCLKEN_USB_CH2_CLK_MASK                    (1 << 10)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT                   8
-#define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_WIDTH                   0x1
-#define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_MASK                    (1 << 8)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT                   9
-#define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_WIDTH                   0x1
-#define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_MASK                    (1 << 9)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT                   10
-#define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_WIDTH                   0x1
-#define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_MASK                    (1 << 10)
-
-/* Used by CM_L3INIT_USB_OTG_CLKCTRL */
 #define OMAP4430_OPTFCLKEN_XCLK_SHIFT                          8
-#define OMAP4430_OPTFCLKEN_XCLK_WIDTH                          0x1
-#define OMAP4430_OPTFCLKEN_XCLK_MASK                           (1 << 8)
-
-/* Used by CM_EMU_OVERRIDE_DPLL_CORE */
-#define OMAP4430_OVERRIDE_ENABLE_SHIFT                         19
-#define OMAP4430_OVERRIDE_ENABLE_WIDTH                         0x1
-#define OMAP4430_OVERRIDE_ENABLE_MASK                          (1 << 19)
-
-/* Used by CM_CLKSEL_ABE */
 #define OMAP4430_PAD_CLKS_GATE_SHIFT                           8
-#define OMAP4430_PAD_CLKS_GATE_WIDTH                           0x1
-#define OMAP4430_PAD_CLKS_GATE_MASK                            (1 << 8)
-
-/* Used by CM_CORE_DVFS_CURRENT, CM_IVA_DVFS_CURRENT */
-#define OMAP4430_PERF_CURRENT_SHIFT                            0
-#define OMAP4430_PERF_CURRENT_WIDTH                            0x8
-#define OMAP4430_PERF_CURRENT_MASK                             (0xff << 0)
-
-/*
- * Used by CM_CORE_DVFS_PERF1, CM_CORE_DVFS_PERF2, CM_CORE_DVFS_PERF3,
- * CM_CORE_DVFS_PERF4, CM_IVA_DVFS_PERF_ABE, CM_IVA_DVFS_PERF_IVAHD,
- * CM_IVA_DVFS_PERF_TESLA
- */
-#define OMAP4430_PERF_REQ_SHIFT                                        0
-#define OMAP4430_PERF_REQ_WIDTH                                        0x8
-#define OMAP4430_PERF_REQ_MASK                                 (0xff << 0)
-
-/* Used by CM_RESTORE_ST */
-#define OMAP4430_PHASE1_COMPLETED_SHIFT                                0
-#define OMAP4430_PHASE1_COMPLETED_WIDTH                                0x1
-#define OMAP4430_PHASE1_COMPLETED_MASK                         (1 << 0)
-
-/* Used by CM_RESTORE_ST */
-#define OMAP4430_PHASE2A_COMPLETED_SHIFT                       1
-#define OMAP4430_PHASE2A_COMPLETED_WIDTH                       0x1
-#define OMAP4430_PHASE2A_COMPLETED_MASK                                (1 << 1)
-
-/* Used by CM_RESTORE_ST */
-#define OMAP4430_PHASE2B_COMPLETED_SHIFT                       2
-#define OMAP4430_PHASE2B_COMPLETED_WIDTH                       0x1
-#define OMAP4430_PHASE2B_COMPLETED_MASK                                (1 << 2)
-
-/* Used by CM_EMU_DEBUGSS_CLKCTRL */
 #define OMAP4430_PMD_STM_MUX_CTRL_SHIFT                                20
 #define OMAP4430_PMD_STM_MUX_CTRL_WIDTH                                0x2
-#define OMAP4430_PMD_STM_MUX_CTRL_MASK                         (0x3 << 20)
-
-/* Used by CM_EMU_DEBUGSS_CLKCTRL */
 #define OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT                      22
 #define OMAP4430_PMD_TRACE_MUX_CTRL_WIDTH                      0x2
-#define OMAP4430_PMD_TRACE_MUX_CTRL_MASK                       (0x3 << 22)
-
-/* Used by CM_DYN_DEP_PRESCAL */
-#define OMAP4430_PRESCAL_SHIFT                                 0
-#define OMAP4430_PRESCAL_WIDTH                                 0x6
-#define OMAP4430_PRESCAL_MASK                                  (0x3f << 0)
-
-/* Used by REVISION_CM1, REVISION_CM2 */
-#define OMAP4430_R_RTL_SHIFT                                   11
-#define OMAP4430_R_RTL_WIDTH                                   0x5
-#define OMAP4430_R_RTL_MASK                                    (0x1f << 11)
-
-/* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL */
-#define OMAP4430_SAR_MODE_SHIFT                                        4
-#define OMAP4430_SAR_MODE_WIDTH                                        0x1
-#define OMAP4430_SAR_MODE_MASK                                 (1 << 4)
-
-/* Used by CM_SCALE_FCLK */
 #define OMAP4430_SCALE_FCLK_SHIFT                              0
 #define OMAP4430_SCALE_FCLK_WIDTH                              0x1
-#define OMAP4430_SCALE_FCLK_MASK                               (1 << 0)
-
-/* Used by REVISION_CM1, REVISION_CM2 */
-#define OMAP4430_SCHEME_SHIFT                                  30
-#define OMAP4430_SCHEME_WIDTH                                  0x2
-#define OMAP4430_SCHEME_MASK                                   (0x3 << 30)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP4430_SDMA_DYNDEP_SHIFT                             11
-#define OMAP4430_SDMA_DYNDEP_WIDTH                             0x1
-#define OMAP4430_SDMA_DYNDEP_MASK                              (1 << 11)
-
-/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */
-#define OMAP4430_SDMA_STATDEP_SHIFT                            11
-#define OMAP4430_SDMA_STATDEP_WIDTH                            0x1
-#define OMAP4430_SDMA_STATDEP_MASK                             (1 << 11)
-
-/* Used by CM_CLKSEL_ABE */
 #define OMAP4430_SLIMBUS_CLK_GATE_SHIFT                                10
-#define OMAP4430_SLIMBUS_CLK_GATE_WIDTH                                0x1
-#define OMAP4430_SLIMBUS_CLK_GATE_MASK                         (1 << 10)
-
-/*
- * Used by CM1_ABE_AESS_CLKCTRL, CM_CAM_FDIF_CLKCTRL, CM_CAM_ISS_CLKCTRL,
- * CM_D2D_SAD2D_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_DUCATI_DUCATI_CLKCTRL,
- * CM_EMU_DEBUGSS_CLKCTRL, CM_GFX_GFX_CLKCTRL, CM_IVAHD_IVAHD_CLKCTRL,
- * CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL, CM_L3INIT_MMC2_CLKCTRL,
- * CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_FS_CLKCTRL,
- * CM_L3INIT_USB_OTG_CLKCTRL, CM_L4SEC_CRYPTODMA_CLKCTRL, CM_MPU_MPU_CLKCTRL,
- * CM_SDMA_SDMA_CLKCTRL, CM_TESLA_TESLA_CLKCTRL
- */
-#define OMAP4430_STBYST_SHIFT                                  18
-#define OMAP4430_STBYST_WIDTH                                  0x1
-#define OMAP4430_STBYST_MASK                                   (1 << 18)
-
-/*
- * Used by CM_IDLEST_DPLL_ABE, CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDRPHY,
- * CM_IDLEST_DPLL_IVA, CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER,
- * CM_IDLEST_DPLL_UNIPRO, CM_IDLEST_DPLL_USB
- */
-#define OMAP4430_ST_DPLL_CLK_SHIFT                             0
-#define OMAP4430_ST_DPLL_CLK_WIDTH                             0x1
 #define OMAP4430_ST_DPLL_CLK_MASK                              (1 << 0)
-
-/* Used by CM_CLKDCOLDO_DPLL_USB */
-#define OMAP4430_ST_DPLL_CLKDCOLDO_SHIFT                       9
-#define OMAP4430_ST_DPLL_CLKDCOLDO_WIDTH                       0x1
-#define OMAP4430_ST_DPLL_CLKDCOLDO_MASK                                (1 << 9)
-
-/*
- * Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY,
- * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_USB
- */
-#define OMAP4430_ST_DPLL_CLKOUT_SHIFT                          9
-#define OMAP4430_ST_DPLL_CLKOUT_WIDTH                          0x1
-#define OMAP4430_ST_DPLL_CLKOUT_MASK                           (1 << 9)
-
-/* Used by CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER */
-#define OMAP4430_ST_DPLL_CLKOUTHIF_SHIFT                       9
-#define OMAP4430_ST_DPLL_CLKOUTHIF_WIDTH                       0x1
-#define OMAP4430_ST_DPLL_CLKOUTHIF_MASK                                (1 << 9)
-
-/* Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO */
-#define OMAP4430_ST_DPLL_CLKOUTX2_SHIFT                                11
-#define OMAP4430_ST_DPLL_CLKOUTX2_WIDTH                                0x1
-#define OMAP4430_ST_DPLL_CLKOUTX2_MASK                         (1 << 11)
-
-/*
- * Used by CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA,
- * CM_DIV_M4_DPLL_PER
- */
-#define OMAP4430_ST_HSDIVIDER_CLKOUT1_SHIFT                    9
-#define OMAP4430_ST_HSDIVIDER_CLKOUT1_WIDTH                    0x1
-#define OMAP4430_ST_HSDIVIDER_CLKOUT1_MASK                     (1 << 9)
-
-/*
- * Used by CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA,
- * CM_DIV_M5_DPLL_PER
- */
-#define OMAP4430_ST_HSDIVIDER_CLKOUT2_SHIFT                    9
-#define OMAP4430_ST_HSDIVIDER_CLKOUT2_WIDTH                    0x1
-#define OMAP4430_ST_HSDIVIDER_CLKOUT2_MASK                     (1 << 9)
-
-/* Used by CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY, CM_DIV_M6_DPLL_PER */
-#define OMAP4430_ST_HSDIVIDER_CLKOUT3_SHIFT                    9
-#define OMAP4430_ST_HSDIVIDER_CLKOUT3_WIDTH                    0x1
-#define OMAP4430_ST_HSDIVIDER_CLKOUT3_MASK                     (1 << 9)
-
-/* Used by CM_DIV_M7_DPLL_CORE, CM_DIV_M7_DPLL_PER */
-#define OMAP4430_ST_HSDIVIDER_CLKOUT4_SHIFT                    9
-#define OMAP4430_ST_HSDIVIDER_CLKOUT4_WIDTH                    0x1
-#define OMAP4430_ST_HSDIVIDER_CLKOUT4_MASK                     (1 << 9)
-
-/*
- * Used by CM_IDLEST_DPLL_ABE, CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDRPHY,
- * CM_IDLEST_DPLL_IVA, CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER,
- * CM_IDLEST_DPLL_UNIPRO, CM_IDLEST_DPLL_USB
- */
-#define OMAP4430_ST_MN_BYPASS_SHIFT                            8
-#define OMAP4430_ST_MN_BYPASS_WIDTH                            0x1
-#define OMAP4430_ST_MN_BYPASS_MASK                             (1 << 8)
-
-/* Used by CM_SYS_CLKSEL */
 #define OMAP4430_SYS_CLKSEL_SHIFT                              0
 #define OMAP4430_SYS_CLKSEL_WIDTH                              0x3
-#define OMAP4430_SYS_CLKSEL_MASK                               (0x7 << 0)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP4430_TESLA_DYNDEP_SHIFT                            1
-#define OMAP4430_TESLA_DYNDEP_WIDTH                            0x1
-#define OMAP4430_TESLA_DYNDEP_MASK                             (1 << 1)
-
-/* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */
 #define OMAP4430_TESLA_STATDEP_SHIFT                           1
-#define OMAP4430_TESLA_STATDEP_WIDTH                           0x1
-#define OMAP4430_TESLA_STATDEP_MASK                            (1 << 1)
-
-/*
- * Used by CM_D2D_DYNAMICDEP, CM_DUCATI_DYNAMICDEP, CM_EMU_DYNAMICDEP,
- * CM_L3_1_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP,
- * CM_L4PER_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP
- */
-#define OMAP4430_WINDOWSIZE_SHIFT                              24
-#define OMAP4430_WINDOWSIZE_WIDTH                              0x4
-#define OMAP4430_WINDOWSIZE_MASK                               (0xf << 24)
-
-/* Used by REVISION_CM1, REVISION_CM2 */
-#define OMAP4430_X_MAJOR_SHIFT                                 8
-#define OMAP4430_X_MAJOR_WIDTH                                 0x3
-#define OMAP4430_X_MAJOR_MASK                                  (0x7 << 8)
-
-/* Used by REVISION_CM1, REVISION_CM2 */
-#define OMAP4430_Y_MINOR_SHIFT                                 0
-#define OMAP4430_Y_MINOR_WIDTH                                 0x6
-#define OMAP4430_Y_MINOR_MASK                                  (0x3f << 0)
 #endif
index e83b8e3..896ae9f 100644 (file)
 #ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_54XX_H
 #define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_54XX_H
 
-/* Used by CM_DSP_DYNAMICDEP, CM_L3MAIN1_DYNAMICDEP, CM_MPU_DYNAMICDEP */
-#define OMAP54XX_ABE_DYNDEP_SHIFT                                      3
-#define OMAP54XX_ABE_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_ABE_DYNDEP_MASK                                       (1 << 3)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_DMA_STATICDEP, CM_DSP_STATICDEP,
- * CM_IPU_STATICDEP, CM_L3INIT_STATICDEP, CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_ABE_STATDEP_SHIFT                                     3
-#define OMAP54XX_ABE_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_ABE_STATDEP_MASK                                      (1 << 3)
-
-/*
- * Used by CM_AUTOIDLE_DPLL_ABE, CM_AUTOIDLE_DPLL_CORE, CM_AUTOIDLE_DPLL_IVA,
- * CM_AUTOIDLE_DPLL_MPU, CM_AUTOIDLE_DPLL_PER, CM_AUTOIDLE_DPLL_UNIPRO1,
- * CM_AUTOIDLE_DPLL_UNIPRO2, CM_AUTOIDLE_DPLL_USB
- */
-#define OMAP54XX_AUTO_DPLL_MODE_SHIFT                                  0
-#define OMAP54XX_AUTO_DPLL_MODE_WIDTH                                  0x3
 #define OMAP54XX_AUTO_DPLL_MODE_MASK                                   (0x7 << 0)
-
-/* Used by CM_L3MAIN2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_C2C_DYNDEP_SHIFT                                      18
-#define OMAP54XX_C2C_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_C2C_DYNDEP_MASK                                       (1 << 18)
-
-/* Used by CM_MPU_STATICDEP */
-#define OMAP54XX_C2C_STATDEP_SHIFT                                     18
-#define OMAP54XX_C2C_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_C2C_STATDEP_MASK                                      (1 << 18)
-
-/* Used by CM_IPU_DYNAMICDEP, CM_L3MAIN2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_CAM_DYNDEP_SHIFT                                      9
-#define OMAP54XX_CAM_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_CAM_DYNDEP_MASK                                       (1 << 9)
-
-/*
- * Used by CM_DMA_STATICDEP, CM_DSP_STATICDEP, CM_IPU_STATICDEP,
- * CM_MPU_STATICDEP
- */
-#define OMAP54XX_CAM_STATDEP_SHIFT                                     9
-#define OMAP54XX_CAM_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_CAM_STATDEP_MASK                                      (1 << 9)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_ABE_24M_GFCLK_SHIFT                       13
-#define OMAP54XX_CLKACTIVITY_ABE_24M_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_ABE_24M_GFCLK_MASK                                (1 << 13)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_ABE_32K_CLK_SHIFT                         12
-#define OMAP54XX_CLKACTIVITY_ABE_32K_CLK_WIDTH                         0x1
-#define OMAP54XX_CLKACTIVITY_ABE_32K_CLK_MASK                          (1 << 12)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_ABE_GICLK_SHIFT                           9
-#define OMAP54XX_CLKACTIVITY_ABE_GICLK_WIDTH                           0x1
-#define OMAP54XX_CLKACTIVITY_ABE_GICLK_MASK                            (1 << 9)
-
-/* Used by CM_WKUPAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_ABE_LP_CLK_SHIFT                          9
-#define OMAP54XX_CLKACTIVITY_ABE_LP_CLK_WIDTH                          0x1
-#define OMAP54XX_CLKACTIVITY_ABE_LP_CLK_MASK                           (1 << 9)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_ABE_SYS_CLK_SHIFT                         11
-#define OMAP54XX_CLKACTIVITY_ABE_SYS_CLK_WIDTH                         0x1
-#define OMAP54XX_CLKACTIVITY_ABE_SYS_CLK_MASK                          (1 << 11)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_ABE_X2_CLK_SHIFT                          8
-#define OMAP54XX_CLKACTIVITY_ABE_X2_CLK_WIDTH                          0x1
-#define OMAP54XX_CLKACTIVITY_ABE_X2_CLK_MASK                           (1 << 8)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_BB2D_GFCLK_SHIFT                          13
-#define OMAP54XX_CLKACTIVITY_BB2D_GFCLK_WIDTH                          0x1
-#define OMAP54XX_CLKACTIVITY_BB2D_GFCLK_MASK                           (1 << 13)
-
-/* Used by CM_C2C_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_C2C_GFCLK_SHIFT                           9
-#define OMAP54XX_CLKACTIVITY_C2C_GFCLK_WIDTH                           0x1
-#define OMAP54XX_CLKACTIVITY_C2C_GFCLK_MASK                            (1 << 9)
-
-/* Used by CM_C2C_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_C2C_GICLK_SHIFT                           10
-#define OMAP54XX_CLKACTIVITY_C2C_GICLK_WIDTH                           0x1
-#define OMAP54XX_CLKACTIVITY_C2C_GICLK_MASK                            (1 << 10)
-
-/* Used by CM_C2C_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_C2C_L4_GICLK_SHIFT                                8
-#define OMAP54XX_CLKACTIVITY_C2C_L4_GICLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_C2C_L4_GICLK_MASK                         (1 << 8)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_CAM_BOOST_GCLK_SHIFT                      11
-#define OMAP54XX_CLKACTIVITY_CAM_BOOST_GCLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_CAM_BOOST_GCLK_MASK                       (1 << 11)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_CAM_GCLK_SHIFT                            8
-#define OMAP54XX_CLKACTIVITY_CAM_GCLK_WIDTH                            0x1
-#define OMAP54XX_CLKACTIVITY_CAM_GCLK_MASK                             (1 << 8)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_CAM_L3_GICLK_SHIFT                                12
-#define OMAP54XX_CLKACTIVITY_CAM_L3_GICLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_CAM_L3_GICLK_MASK                         (1 << 12)
-
-/* Used by CM_COREAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_COREAON_32K_GFCLK_SHIFT                   12
-#define OMAP54XX_CLKACTIVITY_COREAON_32K_GFCLK_WIDTH                   0x1
-#define OMAP54XX_CLKACTIVITY_COREAON_32K_GFCLK_MASK                    (1 << 12)
-
-/* Used by CM_COREAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_COREAON_IO_SRCOMP_GFCLK_SHIFT             14
-#define OMAP54XX_CLKACTIVITY_COREAON_IO_SRCOMP_GFCLK_WIDTH             0x1
-#define OMAP54XX_CLKACTIVITY_COREAON_IO_SRCOMP_GFCLK_MASK              (1 << 14)
-
-/* Used by CM_COREAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_COREAON_L4_GICLK_SHIFT                    8
-#define OMAP54XX_CLKACTIVITY_COREAON_L4_GICLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_COREAON_L4_GICLK_MASK                     (1 << 8)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_CSI_PHY_GFCLK_SHIFT                       9
-#define OMAP54XX_CLKACTIVITY_CSI_PHY_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_CSI_PHY_GFCLK_MASK                                (1 << 9)
-
-/* Used by CM_CUSTEFUSE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_CUSTEFUSE_L4_GICLK_SHIFT                  8
-#define OMAP54XX_CLKACTIVITY_CUSTEFUSE_L4_GICLK_WIDTH                  0x1
-#define OMAP54XX_CLKACTIVITY_CUSTEFUSE_L4_GICLK_MASK                   (1 << 8)
-
-/* Used by CM_CUSTEFUSE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_CUSTEFUSE_SYS_GFCLK_SHIFT                 9
-#define OMAP54XX_CLKACTIVITY_CUSTEFUSE_SYS_GFCLK_WIDTH                 0x1
-#define OMAP54XX_CLKACTIVITY_CUSTEFUSE_SYS_GFCLK_MASK                  (1 << 9)
-
-/* Used by CM_EMIF_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_DLL_GCLK_SHIFT                            9
-#define OMAP54XX_CLKACTIVITY_DLL_GCLK_WIDTH                            0x1
-#define OMAP54XX_CLKACTIVITY_DLL_GCLK_MASK                             (1 << 9)
-
-/* Used by CM_DMA_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_DMA_L3_GICLK_SHIFT                                8
-#define OMAP54XX_CLKACTIVITY_DMA_L3_GICLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_DMA_L3_GICLK_MASK                         (1 << 8)
-
-/* Used by CM_DSP_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_DSP_GCLK_SHIFT                            8
-#define OMAP54XX_CLKACTIVITY_DSP_GCLK_WIDTH                            0x1
-#define OMAP54XX_CLKACTIVITY_DSP_GCLK_MASK                             (1 << 8)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_DSS_GFCLK_SHIFT                           9
-#define OMAP54XX_CLKACTIVITY_DSS_GFCLK_WIDTH                           0x1
-#define OMAP54XX_CLKACTIVITY_DSS_GFCLK_MASK                            (1 << 9)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_DSS_L3_GICLK_SHIFT                                8
-#define OMAP54XX_CLKACTIVITY_DSS_L3_GICLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_DSS_L3_GICLK_MASK                         (1 << 8)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_DSS_SYS_GFCLK_SHIFT                       10
-#define OMAP54XX_CLKACTIVITY_DSS_SYS_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_DSS_SYS_GFCLK_MASK                                (1 << 10)
-
-/* Used by CM_EMIF_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_EMIF_L3_GICLK_SHIFT                       8
-#define OMAP54XX_CLKACTIVITY_EMIF_L3_GICLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_EMIF_L3_GICLK_MASK                                (1 << 8)
-
-/* Used by CM_EMIF_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_EMIF_LL_GCLK_SHIFT                                11
-#define OMAP54XX_CLKACTIVITY_EMIF_LL_GCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_EMIF_LL_GCLK_MASK                         (1 << 11)
-
-/* Used by CM_EMIF_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_EMIF_PHY_GCLK_SHIFT                       10
-#define OMAP54XX_CLKACTIVITY_EMIF_PHY_GCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_EMIF_PHY_GCLK_MASK                                (1 << 10)
-
-/* Used by CM_EMU_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_EMU_SYS_GCLK_SHIFT                                8
-#define OMAP54XX_CLKACTIVITY_EMU_SYS_GCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_EMU_SYS_GCLK_MASK                         (1 << 8)
-
-/* Used by CM_CAM_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_FDIF_GCLK_SHIFT                           10
-#define OMAP54XX_CLKACTIVITY_FDIF_GCLK_WIDTH                           0x1
-#define OMAP54XX_CLKACTIVITY_FDIF_GCLK_MASK                            (1 << 10)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_FUNC_24M_GFCLK_SHIFT                      10
-#define OMAP54XX_CLKACTIVITY_FUNC_24M_GFCLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_FUNC_24M_GFCLK_MASK                       (1 << 10)
-
-/* Used by CM_GPU_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_GPU_CORE_GCLK_SHIFT                       9
-#define OMAP54XX_CLKACTIVITY_GPU_CORE_GCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_GPU_CORE_GCLK_MASK                                (1 << 9)
-
-/* Used by CM_GPU_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_GPU_HYD_GCLK_SHIFT                                10
-#define OMAP54XX_CLKACTIVITY_GPU_HYD_GCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_GPU_HYD_GCLK_MASK                         (1 << 10)
-
-/* Used by CM_GPU_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_GPU_SYS_GCLK_SHIFT                                8
-#define OMAP54XX_CLKACTIVITY_GPU_SYS_GCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_GPU_SYS_GCLK_MASK                         (1 << 8)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HDMI_CEC_GFCLK_SHIFT                      12
-#define OMAP54XX_CLKACTIVITY_HDMI_CEC_GFCLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_HDMI_CEC_GFCLK_MASK                       (1 << 12)
-
-/* Used by CM_DSS_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HDMI_PHY_GFCLK_SHIFT                      11
-#define OMAP54XX_CLKACTIVITY_HDMI_PHY_GFCLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_HDMI_PHY_GFCLK_MASK                       (1 << 11)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HSIC_P1_480M_GFCLK_SHIFT                  20
-#define OMAP54XX_CLKACTIVITY_HSIC_P1_480M_GFCLK_WIDTH                  0x1
-#define OMAP54XX_CLKACTIVITY_HSIC_P1_480M_GFCLK_MASK                   (1 << 20)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HSIC_P1_GFCLK_SHIFT                       26
-#define OMAP54XX_CLKACTIVITY_HSIC_P1_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_HSIC_P1_GFCLK_MASK                                (1 << 26)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HSIC_P2_480M_GFCLK_SHIFT                  21
-#define OMAP54XX_CLKACTIVITY_HSIC_P2_480M_GFCLK_WIDTH                  0x1
-#define OMAP54XX_CLKACTIVITY_HSIC_P2_480M_GFCLK_MASK                   (1 << 21)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HSIC_P2_GFCLK_SHIFT                       27
-#define OMAP54XX_CLKACTIVITY_HSIC_P2_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_HSIC_P2_GFCLK_MASK                                (1 << 27)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HSIC_P3_480M_GFCLK_SHIFT                  6
-#define OMAP54XX_CLKACTIVITY_HSIC_P3_480M_GFCLK_WIDTH                  0x1
-#define OMAP54XX_CLKACTIVITY_HSIC_P3_480M_GFCLK_MASK                   (1 << 6)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HSIC_P3_GFCLK_SHIFT                       7
-#define OMAP54XX_CLKACTIVITY_HSIC_P3_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_HSIC_P3_GFCLK_MASK                                (1 << 7)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_HSI_GFCLK_SHIFT                           16
-#define OMAP54XX_CLKACTIVITY_HSI_GFCLK_WIDTH                           0x1
-#define OMAP54XX_CLKACTIVITY_HSI_GFCLK_MASK                            (1 << 16)
-
-/* Used by CM_IPU_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_IPU_GCLK_SHIFT                            8
-#define OMAP54XX_CLKACTIVITY_IPU_GCLK_WIDTH                            0x1
-#define OMAP54XX_CLKACTIVITY_IPU_GCLK_MASK                             (1 << 8)
-
-/* Used by CM_IVA_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_IVA_GCLK_SHIFT                            8
-#define OMAP54XX_CLKACTIVITY_IVA_GCLK_WIDTH                            0x1
-#define OMAP54XX_CLKACTIVITY_IVA_GCLK_MASK                             (1 << 8)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INIT_48M_GFCLK_SHIFT                    12
-#define OMAP54XX_CLKACTIVITY_L3INIT_48M_GFCLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_L3INIT_48M_GFCLK_MASK                     (1 << 12)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INIT_60M_P1_GFCLK_SHIFT                 28
-#define OMAP54XX_CLKACTIVITY_L3INIT_60M_P1_GFCLK_WIDTH                 0x1
-#define OMAP54XX_CLKACTIVITY_L3INIT_60M_P1_GFCLK_MASK                  (1 << 28)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INIT_60M_P2_GFCLK_SHIFT                 29
-#define OMAP54XX_CLKACTIVITY_L3INIT_60M_P2_GFCLK_WIDTH                 0x1
-#define OMAP54XX_CLKACTIVITY_L3INIT_60M_P2_GFCLK_MASK                  (1 << 29)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INIT_L3_GICLK_SHIFT                     8
-#define OMAP54XX_CLKACTIVITY_L3INIT_L3_GICLK_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_L3INIT_L3_GICLK_MASK                      (1 << 8)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INIT_L4_GICLK_SHIFT                     9
-#define OMAP54XX_CLKACTIVITY_L3INIT_L4_GICLK_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_L3INIT_L4_GICLK_MASK                      (1 << 9)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INIT_USB_OTG_SS_LFPS_TX_GFCLK_SHIFT     11
-#define OMAP54XX_CLKACTIVITY_L3INIT_USB_OTG_SS_LFPS_TX_GFCLK_WIDTH     0x1
-#define OMAP54XX_CLKACTIVITY_L3INIT_USB_OTG_SS_LFPS_TX_GFCLK_MASK      (1 << 11)
-
-/* Used by CM_L3INSTR_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INSTR_DLL_AGING_GCLK_SHIFT              9
-#define OMAP54XX_CLKACTIVITY_L3INSTR_DLL_AGING_GCLK_WIDTH              0x1
-#define OMAP54XX_CLKACTIVITY_L3INSTR_DLL_AGING_GCLK_MASK               (1 << 9)
-
-/* Used by CM_L3INSTR_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INSTR_L3_GICLK_SHIFT                    8
-#define OMAP54XX_CLKACTIVITY_L3INSTR_L3_GICLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_L3INSTR_L3_GICLK_MASK                     (1 << 8)
-
-/* Used by CM_L3INSTR_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3INSTR_TS_GCLK_SHIFT                     10
-#define OMAP54XX_CLKACTIVITY_L3INSTR_TS_GCLK_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_L3INSTR_TS_GCLK_MASK                      (1 << 10)
-
-/* Used by CM_L3MAIN1_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3MAIN1_L3_GICLK_SHIFT                    8
-#define OMAP54XX_CLKACTIVITY_L3MAIN1_L3_GICLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_L3MAIN1_L3_GICLK_MASK                     (1 << 8)
-
-/* Used by CM_L3MAIN2_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L3MAIN2_L3_GICLK_SHIFT                    8
-#define OMAP54XX_CLKACTIVITY_L3MAIN2_L3_GICLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_L3MAIN2_L3_GICLK_MASK                     (1 << 8)
-
-/* Used by CM_L4CFG_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L4CFG_L4_GICLK_SHIFT                      8
-#define OMAP54XX_CLKACTIVITY_L4CFG_L4_GICLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_L4CFG_L4_GICLK_MASK                       (1 << 8)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L4PER_L4_GICLK_SHIFT                      8
-#define OMAP54XX_CLKACTIVITY_L4PER_L4_GICLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_L4PER_L4_GICLK_MASK                       (1 << 8)
-
-/* Used by CM_L4SEC_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L4SEC_L3_GICLK_SHIFT                      8
-#define OMAP54XX_CLKACTIVITY_L4SEC_L3_GICLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_L4SEC_L3_GICLK_MASK                       (1 << 8)
-
-/* Used by CM_L4SEC_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_L4SEC_L4_GICLK_SHIFT                      9
-#define OMAP54XX_CLKACTIVITY_L4SEC_L4_GICLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_L4SEC_L4_GICLK_MASK                       (1 << 9)
-
-/* Used by CM_MIPIEXT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_MIPIEXT_L3_GICLK_SHIFT                    8
-#define OMAP54XX_CLKACTIVITY_MIPIEXT_L3_GICLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_MIPIEXT_L3_GICLK_MASK                     (1 << 8)
-
-/* Used by CM_MIPIEXT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_MIPIEXT_PHY_REF_GFCLK_SHIFT               11
-#define OMAP54XX_CLKACTIVITY_MIPIEXT_PHY_REF_GFCLK_WIDTH               0x1
-#define OMAP54XX_CLKACTIVITY_MIPIEXT_PHY_REF_GFCLK_MASK                        (1 << 11)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_MMC1_32K_GFCLK_SHIFT                      2
-#define OMAP54XX_CLKACTIVITY_MMC1_32K_GFCLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_MMC1_32K_GFCLK_MASK                       (1 << 2)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_MMC1_GFCLK_SHIFT                          17
-#define OMAP54XX_CLKACTIVITY_MMC1_GFCLK_WIDTH                          0x1
-#define OMAP54XX_CLKACTIVITY_MMC1_GFCLK_MASK                           (1 << 17)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_MMC2_GFCLK_SHIFT                          18
-#define OMAP54XX_CLKACTIVITY_MMC2_GFCLK_WIDTH                          0x1
-#define OMAP54XX_CLKACTIVITY_MMC2_GFCLK_MASK                           (1 << 18)
-
-/* Used by CM_MPU_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_MPU_GCLK_SHIFT                            8
-#define OMAP54XX_CLKACTIVITY_MPU_GCLK_WIDTH                            0x1
-#define OMAP54XX_CLKACTIVITY_MPU_GCLK_MASK                             (1 << 8)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PAD_CLKS_SHIFT                            14
-#define OMAP54XX_CLKACTIVITY_PAD_CLKS_WIDTH                            0x1
-#define OMAP54XX_CLKACTIVITY_PAD_CLKS_MASK                             (1 << 14)
-
-/* Used by CM_ABE_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PAD_SLIMBUS1_CLK_SHIFT                    15
-#define OMAP54XX_CLKACTIVITY_PAD_SLIMBUS1_CLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_PAD_SLIMBUS1_CLK_MASK                     (1 << 15)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PAD_XCLK60MHSP1_SHIFT                     3
-#define OMAP54XX_CLKACTIVITY_PAD_XCLK60MHSP1_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_PAD_XCLK60MHSP1_MASK                      (1 << 3)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PAD_XCLK60MHSP2_SHIFT                     4
-#define OMAP54XX_CLKACTIVITY_PAD_XCLK60MHSP2_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_PAD_XCLK60MHSP2_MASK                      (1 << 4)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PER_12M_GFCLK_SHIFT                       15
-#define OMAP54XX_CLKACTIVITY_PER_12M_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_PER_12M_GFCLK_MASK                                (1 << 15)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PER_32K_GFCLK_SHIFT                       17
-#define OMAP54XX_CLKACTIVITY_PER_32K_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_PER_32K_GFCLK_MASK                                (1 << 17)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PER_48M_GFCLK_SHIFT                       18
-#define OMAP54XX_CLKACTIVITY_PER_48M_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_PER_48M_GFCLK_MASK                                (1 << 18)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_PER_96M_GFCLK_SHIFT                       19
-#define OMAP54XX_CLKACTIVITY_PER_96M_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_PER_96M_GFCLK_MASK                                (1 << 19)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_SATA_REF_GFCLK_SHIFT                      19
-#define OMAP54XX_CLKACTIVITY_SATA_REF_GFCLK_WIDTH                      0x1
-#define OMAP54XX_CLKACTIVITY_SATA_REF_GFCLK_MASK                       (1 << 19)
-
-/* Used by CM_COREAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_SR_CORE_SYS_GFCLK_SHIFT                   11
-#define OMAP54XX_CLKACTIVITY_SR_CORE_SYS_GFCLK_WIDTH                   0x1
-#define OMAP54XX_CLKACTIVITY_SR_CORE_SYS_GFCLK_MASK                    (1 << 11)
-
-/* Used by CM_COREAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_SR_MM_SYS_GFCLK_SHIFT                     10
-#define OMAP54XX_CLKACTIVITY_SR_MM_SYS_GFCLK_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_SR_MM_SYS_GFCLK_MASK                      (1 << 10)
-
-/* Used by CM_COREAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_SR_MPU_SYS_GFCLK_SHIFT                    9
-#define OMAP54XX_CLKACTIVITY_SR_MPU_SYS_GFCLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_SR_MPU_SYS_GFCLK_MASK                     (1 << 9)
-
-/* Used by CM_WKUPAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_SHIFT                             8
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_WIDTH                             0x1
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_MASK                              (1 << 8)
-
-/* Used by CM_WKUPAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_ALL_SHIFT                         15
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_ALL_WIDTH                         0x1
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_ALL_MASK                          (1 << 15)
-
-/* Used by CM_WKUPAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_FUNC_SHIFT                                14
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_FUNC_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_SYS_CLK_FUNC_MASK                         (1 << 14)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TIMER10_GFCLK_SHIFT                       9
-#define OMAP54XX_CLKACTIVITY_TIMER10_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_TIMER10_GFCLK_MASK                                (1 << 9)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TIMER11_GFCLK_SHIFT                       10
-#define OMAP54XX_CLKACTIVITY_TIMER11_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_TIMER11_GFCLK_MASK                                (1 << 10)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TIMER2_GFCLK_SHIFT                                11
-#define OMAP54XX_CLKACTIVITY_TIMER2_GFCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_TIMER2_GFCLK_MASK                         (1 << 11)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TIMER3_GFCLK_SHIFT                                12
-#define OMAP54XX_CLKACTIVITY_TIMER3_GFCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_TIMER3_GFCLK_MASK                         (1 << 12)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TIMER4_GFCLK_SHIFT                                13
-#define OMAP54XX_CLKACTIVITY_TIMER4_GFCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_TIMER4_GFCLK_MASK                         (1 << 13)
-
-/* Used by CM_L4PER_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TIMER9_GFCLK_SHIFT                                14
-#define OMAP54XX_CLKACTIVITY_TIMER9_GFCLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_TIMER9_GFCLK_MASK                         (1 << 14)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TLL_CH0_GFCLK_SHIFT                       22
-#define OMAP54XX_CLKACTIVITY_TLL_CH0_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_TLL_CH0_GFCLK_MASK                                (1 << 22)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TLL_CH1_GFCLK_SHIFT                       23
-#define OMAP54XX_CLKACTIVITY_TLL_CH1_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_TLL_CH1_GFCLK_MASK                                (1 << 23)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_TLL_CH2_GFCLK_SHIFT                       24
-#define OMAP54XX_CLKACTIVITY_TLL_CH2_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_TLL_CH2_GFCLK_MASK                                (1 << 24)
-
-/* Used by CM_MIPIEXT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_DPLL_CLK_SHIFT                    10
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_DPLL_CLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_DPLL_CLK_MASK                     (1 << 10)
-
-/* Used by CM_MIPIEXT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_PHY_GFCLK_SHIFT                   13
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_PHY_GFCLK_WIDTH                   0x1
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_PHY_GFCLK_MASK                    (1 << 13)
-
-/* Used by CM_MIPIEXT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_TXPHY_LS_GFCLK_SHIFT              12
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_TXPHY_LS_GFCLK_WIDTH              0x1
-#define OMAP54XX_CLKACTIVITY_UNIPRO1_TXPHY_LS_GFCLK_MASK               (1 << 12)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_DPLL_CLK_SHIFT                    10
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_DPLL_CLK_WIDTH                    0x1
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_DPLL_CLK_MASK                     (1 << 10)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_PHY_GFCLK_SHIFT                   13
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_PHY_GFCLK_WIDTH                   0x1
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_PHY_GFCLK_MASK                    (1 << 13)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_PHY_REF_GFCLK_SHIFT               5
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_PHY_REF_GFCLK_WIDTH               0x1
-#define OMAP54XX_CLKACTIVITY_UNIPRO2_PHY_REF_GFCLK_MASK                        (1 << 5)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_USB_DPLL_CLK_SHIFT                                14
-#define OMAP54XX_CLKACTIVITY_USB_DPLL_CLK_WIDTH                                0x1
-#define OMAP54XX_CLKACTIVITY_USB_DPLL_CLK_MASK                         (1 << 14)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_USB_DPLL_HS_CLK_SHIFT                     15
-#define OMAP54XX_CLKACTIVITY_USB_DPLL_HS_CLK_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_USB_DPLL_HS_CLK_MASK                      (1 << 15)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_USB_OTG_SS_REF_CLK_SHIFT                  31
-#define OMAP54XX_CLKACTIVITY_USB_OTG_SS_REF_CLK_WIDTH                  0x1
-#define OMAP54XX_CLKACTIVITY_USB_OTG_SS_REF_CLK_MASK                   (1 << 31)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UTMI_P3_GFCLK_SHIFT                       30
-#define OMAP54XX_CLKACTIVITY_UTMI_P3_GFCLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_UTMI_P3_GFCLK_MASK                                (1 << 30)
-
-/* Used by CM_L3INIT_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_UTMI_ROOT_GFCLK_SHIFT                     25
-#define OMAP54XX_CLKACTIVITY_UTMI_ROOT_GFCLK_WIDTH                     0x1
-#define OMAP54XX_CLKACTIVITY_UTMI_ROOT_GFCLK_MASK                      (1 << 25)
-
-/* Used by CM_WKUPAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_WKUPAON_32K_GFCLK_SHIFT                   11
-#define OMAP54XX_CLKACTIVITY_WKUPAON_32K_GFCLK_WIDTH                   0x1
-#define OMAP54XX_CLKACTIVITY_WKUPAON_32K_GFCLK_MASK                    (1 << 11)
-
-/* Used by CM_WKUPAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_WKUPAON_GICLK_SHIFT                       12
-#define OMAP54XX_CLKACTIVITY_WKUPAON_GICLK_WIDTH                       0x1
-#define OMAP54XX_CLKACTIVITY_WKUPAON_GICLK_MASK                                (1 << 12)
-
-/* Used by CM_WKUPAON_CLKSTCTRL */
-#define OMAP54XX_CLKACTIVITY_WKUPAON_IO_SRCOMP_GFCLK_SHIFT             13
-#define OMAP54XX_CLKACTIVITY_WKUPAON_IO_SRCOMP_GFCLK_WIDTH             0x1
-#define OMAP54XX_CLKACTIVITY_WKUPAON_IO_SRCOMP_GFCLK_MASK              (1 << 13)
-
-/* Used by CM_COREAON_IO_SRCOMP_CLKCTRL, CM_WKUPAON_IO_SRCOMP_CLKCTRL */
-#define OMAP54XX_CLKEN_SRCOMP_FCLK_SHIFT                               8
-#define OMAP54XX_CLKEN_SRCOMP_FCLK_WIDTH                               0x1
-#define OMAP54XX_CLKEN_SRCOMP_FCLK_MASK                                        (1 << 8)
-
-/*
- * Used by CM_ABE_TIMER5_CLKCTRL, CM_ABE_TIMER6_CLKCTRL, CM_ABE_TIMER7_CLKCTRL,
- * CM_ABE_TIMER8_CLKCTRL, CM_L3INIT_HSI_CLKCTRL, CM_L4PER_TIMER10_CLKCTRL,
- * CM_L4PER_TIMER11_CLKCTRL, CM_L4PER_TIMER2_CLKCTRL, CM_L4PER_TIMER3_CLKCTRL,
- * CM_L4PER_TIMER4_CLKCTRL, CM_L4PER_TIMER9_CLKCTRL, CM_WKUPAON_TIMER1_CLKCTRL
- */
 #define OMAP54XX_CLKSEL_SHIFT                                          24
 #define OMAP54XX_CLKSEL_WIDTH                                          0x1
-#define OMAP54XX_CLKSEL_MASK                                           (1 << 24)
-
-/*
- * Renamed from CLKSEL Used by CM_CLKSEL_ABE_DSS_SYS, CM_CLKSEL_ABE_PLL_REF,
- * CM_CLKSEL_USB_60MHZ, CM_CLKSEL_WKUPAON
- */
 #define OMAP54XX_CLKSEL_0_0_SHIFT                                      0
 #define OMAP54XX_CLKSEL_0_0_WIDTH                                      0x1
-#define OMAP54XX_CLKSEL_0_0_MASK                                       (1 << 0)
-
-/* Renamed from CLKSEL Used by CM_BYPCLK_DPLL_IVA, CM_BYPCLK_DPLL_MPU */
-#define OMAP54XX_CLKSEL_0_1_SHIFT                                      0
-#define OMAP54XX_CLKSEL_0_1_WIDTH                                      0x2
-#define OMAP54XX_CLKSEL_0_1_MASK                                       (0x3 << 0)
-
-/* Renamed from CLKSEL Used by CM_L3INSTR_CTRL_MODULE_BANDGAP_CLKCTRL */
-#define OMAP54XX_CLKSEL_24_25_SHIFT                                    24
-#define OMAP54XX_CLKSEL_24_25_WIDTH                                    0x2
-#define OMAP54XX_CLKSEL_24_25_MASK                                     (0x3 << 24)
-
-/* Used by CM_MPU_MPU_CLKCTRL */
-#define OMAP54XX_CLKSEL_ABE_DIV_MODE_SHIFT                             26
-#define OMAP54XX_CLKSEL_ABE_DIV_MODE_WIDTH                             0x1
-#define OMAP54XX_CLKSEL_ABE_DIV_MODE_MASK                              (1 << 26)
-
-/* Used by CM_ABE_AESS_CLKCTRL */
 #define OMAP54XX_CLKSEL_AESS_FCLK_SHIFT                                        24
 #define OMAP54XX_CLKSEL_AESS_FCLK_WIDTH                                        0x1
-#define OMAP54XX_CLKSEL_AESS_FCLK_MASK                                 (1 << 24)
-
-/* Used by CM_L3INIT_MMC1_CLKCTRL, CM_L3INIT_MMC2_CLKCTRL */
 #define OMAP54XX_CLKSEL_DIV_SHIFT                                      25
 #define OMAP54XX_CLKSEL_DIV_WIDTH                                      0x1
-#define OMAP54XX_CLKSEL_DIV_MASK                                       (1 << 25)
-
-/* Used by CM_MPU_MPU_CLKCTRL */
-#define OMAP54XX_CLKSEL_EMIF_DIV_MODE_SHIFT                            24
-#define OMAP54XX_CLKSEL_EMIF_DIV_MODE_WIDTH                            0x2
-#define OMAP54XX_CLKSEL_EMIF_DIV_MODE_MASK                             (0x3 << 24)
-
-/* Used by CM_CAM_FDIF_CLKCTRL */
 #define OMAP54XX_CLKSEL_FCLK_SHIFT                                     24
 #define OMAP54XX_CLKSEL_FCLK_WIDTH                                     0x1
-#define OMAP54XX_CLKSEL_FCLK_MASK                                      (1 << 24)
-
-/* Used by CM_GPU_GPU_CLKCTRL */
 #define OMAP54XX_CLKSEL_GPU_CORE_GCLK_SHIFT                            24
 #define OMAP54XX_CLKSEL_GPU_CORE_GCLK_WIDTH                            0x1
-#define OMAP54XX_CLKSEL_GPU_CORE_GCLK_MASK                             (1 << 24)
-
-/* Used by CM_GPU_GPU_CLKCTRL */
 #define OMAP54XX_CLKSEL_GPU_HYD_GCLK_SHIFT                             25
 #define OMAP54XX_CLKSEL_GPU_HYD_GCLK_WIDTH                             0x1
-#define OMAP54XX_CLKSEL_GPU_HYD_GCLK_MASK                              (1 << 25)
-
-/* Used by CM_GPU_GPU_CLKCTRL */
-#define OMAP54XX_CLKSEL_GPU_SYS_CLK_SHIFT                              26
-#define OMAP54XX_CLKSEL_GPU_SYS_CLK_WIDTH                              0x1
-#define OMAP54XX_CLKSEL_GPU_SYS_CLK_MASK                               (1 << 26)
-
-/*
- * Used by CM_ABE_DMIC_CLKCTRL, CM_ABE_MCASP_CLKCTRL, CM_ABE_MCBSP1_CLKCTRL,
- * CM_ABE_MCBSP2_CLKCTRL, CM_ABE_MCBSP3_CLKCTRL
- */
 #define OMAP54XX_CLKSEL_INTERNAL_SOURCE_SHIFT                          26
 #define OMAP54XX_CLKSEL_INTERNAL_SOURCE_WIDTH                          0x2
-#define OMAP54XX_CLKSEL_INTERNAL_SOURCE_MASK                           (0x3 << 26)
-
-/* Used by CM_CLKSEL_CORE */
-#define OMAP54XX_CLKSEL_L3_SHIFT                                       4
-#define OMAP54XX_CLKSEL_L3_WIDTH                                       0x1
-#define OMAP54XX_CLKSEL_L3_MASK                                                (1 << 4)
-
-/* Renamed from CLKSEL_L3 Used by CM_SHADOW_FREQ_CONFIG2 */
-#define OMAP54XX_CLKSEL_L3_1_1_SHIFT                                   1
-#define OMAP54XX_CLKSEL_L3_1_1_WIDTH                                   0x1
-#define OMAP54XX_CLKSEL_L3_1_1_MASK                                    (1 << 1)
-
-/* Used by CM_CLKSEL_CORE */
-#define OMAP54XX_CLKSEL_L4_SHIFT                                       8
-#define OMAP54XX_CLKSEL_L4_WIDTH                                       0x1
-#define OMAP54XX_CLKSEL_L4_MASK                                                (1 << 8)
-
-/* Used by CM_EMIF_EMIF1_CLKCTRL */
-#define OMAP54XX_CLKSEL_LL_SHIFT                                       24
-#define OMAP54XX_CLKSEL_LL_WIDTH                                       0x1
-#define OMAP54XX_CLKSEL_LL_MASK                                                (1 << 24)
-
-/* Used by CM_CLKSEL_ABE */
 #define OMAP54XX_CLKSEL_OPP_SHIFT                                      0
 #define OMAP54XX_CLKSEL_OPP_WIDTH                                      0x2
-#define OMAP54XX_CLKSEL_OPP_MASK                                       (0x3 << 0)
-
-/* Renamed from CLKSEL_OPP Used by CM_L3INIT_UNIPRO2_CLKCTRL */
-#define OMAP54XX_CLKSEL_OPP_24_24_SHIFT                                        24
-#define OMAP54XX_CLKSEL_OPP_24_24_WIDTH                                        0x1
-#define OMAP54XX_CLKSEL_OPP_24_24_MASK                                 (1 << 24)
-
-/*
- * Used by CM_ABE_DMIC_CLKCTRL, CM_ABE_MCASP_CLKCTRL, CM_ABE_MCBSP1_CLKCTRL,
- * CM_ABE_MCBSP2_CLKCTRL, CM_ABE_MCBSP3_CLKCTRL
- */
 #define OMAP54XX_CLKSEL_SOURCE_SHIFT                                   24
 #define OMAP54XX_CLKSEL_SOURCE_WIDTH                                   0x2
-#define OMAP54XX_CLKSEL_SOURCE_MASK                                    (0x3 << 24)
-
-/*
- * Renamed from CLKSEL_SOURCE Used by CM_L3INIT_MMC1_CLKCTRL,
- * CM_L3INIT_MMC2_CLKCTRL
- */
 #define OMAP54XX_CLKSEL_SOURCE_L3INIT_MMC1_SHIFT                       24
 #define OMAP54XX_CLKSEL_SOURCE_L3INIT_MMC1_WIDTH                       0x1
-#define OMAP54XX_CLKSEL_SOURCE_L3INIT_MMC1_MASK                                (1 << 24)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_CLKSEL_UTMI_P1_SHIFT                                  24
 #define OMAP54XX_CLKSEL_UTMI_P1_WIDTH                                  0x1
-#define OMAP54XX_CLKSEL_UTMI_P1_MASK                                   (1 << 24)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_CLKSEL_UTMI_P2_SHIFT                                  25
 #define OMAP54XX_CLKSEL_UTMI_P2_WIDTH                                  0x1
-#define OMAP54XX_CLKSEL_UTMI_P2_MASK                                   (1 << 25)
-
-/*
- * Used by CM_DIV_H11_DPLL_CORE, CM_DIV_H11_DPLL_IVA, CM_DIV_H11_DPLL_PER,
- * CM_DIV_H12_DPLL_CORE, CM_DIV_H12_DPLL_IVA, CM_DIV_H12_DPLL_PER,
- * CM_DIV_H13_DPLL_CORE, CM_DIV_H13_DPLL_PER, CM_DIV_H14_DPLL_CORE,
- * CM_DIV_H14_DPLL_PER, CM_DIV_H21_DPLL_CORE, CM_DIV_H22_DPLL_CORE,
- * CM_DIV_H23_DPLL_CORE, CM_DIV_H24_DPLL_CORE, CM_DIV_M2_DPLL_ABE,
- * CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER,
- * CM_DIV_M2_DPLL_UNIPRO1, CM_DIV_M2_DPLL_UNIPRO2, CM_DIV_M2_DPLL_USB,
- * CM_DIV_M3_DPLL_ABE, CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER
- */
-#define OMAP54XX_CLKST_SHIFT                                           9
-#define OMAP54XX_CLKST_WIDTH                                           0x1
-#define OMAP54XX_CLKST_MASK                                            (1 << 9)
-
-/*
- * Used by CM_ABE_CLKSTCTRL, CM_C2C_CLKSTCTRL, CM_CAM_CLKSTCTRL,
- * CM_COREAON_CLKSTCTRL, CM_CUSTEFUSE_CLKSTCTRL, CM_DMA_CLKSTCTRL,
- * CM_DSP_CLKSTCTRL, CM_DSS_CLKSTCTRL, CM_EMIF_CLKSTCTRL, CM_EMU_CLKSTCTRL,
- * CM_GPU_CLKSTCTRL, CM_IPU_CLKSTCTRL, CM_IVA_CLKSTCTRL, CM_L3INIT_CLKSTCTRL,
- * CM_L3INSTR_CLKSTCTRL, CM_L3MAIN1_CLKSTCTRL, CM_L3MAIN2_CLKSTCTRL,
- * CM_L4CFG_CLKSTCTRL, CM_L4PER_CLKSTCTRL, CM_L4SEC_CLKSTCTRL,
- * CM_MIPIEXT_CLKSTCTRL, CM_MPU_CLKSTCTRL, CM_WKUPAON_CLKSTCTRL
- */
-#define OMAP54XX_CLKTRCTRL_SHIFT                                       0
-#define OMAP54XX_CLKTRCTRL_WIDTH                                       0x2
-#define OMAP54XX_CLKTRCTRL_MASK                                                (0x3 << 0)
-
-/* Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_PER */
-#define OMAP54XX_CLKX2ST_SHIFT                                         11
-#define OMAP54XX_CLKX2ST_WIDTH                                         0x1
-#define OMAP54XX_CLKX2ST_MASK                                          (1 << 11)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_COREAON_DYNDEP_SHIFT                                  16
-#define OMAP54XX_COREAON_DYNDEP_WIDTH                                  0x1
-#define OMAP54XX_COREAON_DYNDEP_MASK                                   (1 << 16)
-
-/* Used by CM_DSP_STATICDEP, CM_IPU_STATICDEP, CM_MPU_STATICDEP */
-#define OMAP54XX_COREAON_STATDEP_SHIFT                                 16
-#define OMAP54XX_COREAON_STATDEP_WIDTH                                 0x1
-#define OMAP54XX_COREAON_STATDEP_MASK                                  (1 << 16)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_CUSTEFUSE_DYNDEP_SHIFT                                        17
-#define OMAP54XX_CUSTEFUSE_DYNDEP_WIDTH                                        0x1
-#define OMAP54XX_CUSTEFUSE_DYNDEP_MASK                                 (1 << 17)
-
-/* Used by CM_DSP_STATICDEP, CM_IPU_STATICDEP, CM_MPU_STATICDEP */
-#define OMAP54XX_CUSTEFUSE_STATDEP_SHIFT                               17
-#define OMAP54XX_CUSTEFUSE_STATDEP_WIDTH                               0x1
-#define OMAP54XX_CUSTEFUSE_STATDEP_MASK                                        (1 << 17)
-
-/* Used by REVISION_CM_CORE, REVISION_CM_CORE_AON */
-#define OMAP54XX_CUSTOM_SHIFT                                          6
-#define OMAP54XX_CUSTOM_WIDTH                                          0x2
-#define OMAP54XX_CUSTOM_MASK                                           (0x3 << 6)
-
-/*
- * Used by CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_IVA,
- * CM_CLKSEL_DPLL_MPU, CM_CLKSEL_DPLL_PER, CM_CLKSEL_DPLL_UNIPRO1,
- * CM_CLKSEL_DPLL_UNIPRO2, CM_CLKSEL_DPLL_USB
- */
-#define OMAP54XX_DCC_EN_SHIFT                                          22
-#define OMAP54XX_DCC_EN_WIDTH                                          0x1
-#define OMAP54XX_DCC_EN_MASK                                           (1 << 22)
-
-/*
- * Used by CM_CORE_AON_DEBUG_CM_CORE_AON_FD_TRANS,
- * CM_CORE_AON_DEBUG_DSS_FD_TRANS, CM_CORE_AON_DEBUG_EMIF_FD_TRANS,
- * CM_CORE_AON_DEBUG_L4SEC_FD_TRANS
- */
-#define OMAP54XX_CM_DEBUG_OUT_SHIFT                                    0
-#define OMAP54XX_CM_DEBUG_OUT_WIDTH                                    0xd
-#define OMAP54XX_CM_DEBUG_OUT_MASK                                     (0x1fff << 0)
-
-/*
- * Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_ABE_FD_TRANS,
- * CM_CORE_AON_DEBUG_L3INIT_FD_TRANS, CM_CORE_AON_DEBUG_L4PER_FD_TRANS
- */
-#define OMAP54XX_DEBUG_OUT_0_31_SHIFT                                  0
-#define OMAP54XX_DEBUG_OUT_0_31_WIDTH                                  0x20
-#define OMAP54XX_DEBUG_OUT_0_31_MASK                                   (0xffffffff << 0)
-
-/*
- * Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_C2C_FD_TRANS,
- * CM_CORE_AON_DEBUG_COREAON_FD_TRANS, CM_CORE_AON_DEBUG_L4CFG_FD_TRANS
- */
-#define OMAP54XX_DEBUG_OUT_0_8_SHIFT                                   0
-#define OMAP54XX_DEBUG_OUT_0_8_WIDTH                                   0x9
-#define OMAP54XX_DEBUG_OUT_0_8_MASK                                    (0x1ff << 0)
-
-/*
- * Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_CUSTEFUSE_FD_TRANS,
- * CM_CORE_AON_DEBUG_DMA_FD_TRANS, CM_CORE_AON_DEBUG_L3MAIN1_FD_TRANS
- */
-#define OMAP54XX_DEBUG_OUT_0_4_SHIFT                                   0
-#define OMAP54XX_DEBUG_OUT_0_4_WIDTH                                   0x5
-#define OMAP54XX_DEBUG_OUT_0_4_MASK                                    (0x1f << 0)
-
-/*
- * Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_DSP_FD_TRANS,
- * CM_CORE_AON_DEBUG_IPU_FD_TRANS, CM_CORE_AON_DEBUG_MPU_FD_TRANS
- */
-#define OMAP54XX_DEBUG_OUT_0_5_SHIFT                                   0
-#define OMAP54XX_DEBUG_OUT_0_5_WIDTH                                   0x6
-#define OMAP54XX_DEBUG_OUT_0_5_MASK                                    (0x3f << 0)
-
-/*
- * Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_CAM_FD_TRANS,
- * CM_CORE_AON_DEBUG_MIPIEXT_FD_TRANS
- */
-#define OMAP54XX_DEBUG_OUT_0_10_SHIFT                                  0
-#define OMAP54XX_DEBUG_OUT_0_10_WIDTH                                  0xb
-#define OMAP54XX_DEBUG_OUT_0_10_MASK                                   (0x7ff << 0)
-
-/*
- * Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_IVA_FD_TRANS,
- * CM_CORE_AON_DEBUG_L3MAIN2_FD_TRANS
- */
-#define OMAP54XX_DEBUG_OUT_0_6_SHIFT                                   0
-#define OMAP54XX_DEBUG_OUT_0_6_WIDTH                                   0x7
-#define OMAP54XX_DEBUG_OUT_0_6_MASK                                    (0x7f << 0)
-
-/* Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_ABE_FD_TRANS2 */
-#define OMAP54XX_DEBUG_OUT_0_19_SHIFT                                  0
-#define OMAP54XX_DEBUG_OUT_0_19_WIDTH                                  0x14
-#define OMAP54XX_DEBUG_OUT_0_19_MASK                                   (0xfffff << 0)
-
-/* Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_GPU_FD_TRANS */
-#define OMAP54XX_DEBUG_OUT_0_9_SHIFT                                   0
-#define OMAP54XX_DEBUG_OUT_0_9_WIDTH                                   0xa
-#define OMAP54XX_DEBUG_OUT_0_9_MASK                                    (0x3ff << 0)
-
-/* Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_L3INIT_FD_TRANS2 */
-#define OMAP54XX_DEBUG_OUT_0_26_SHIFT                                  0
-#define OMAP54XX_DEBUG_OUT_0_26_WIDTH                                  0x1b
-#define OMAP54XX_DEBUG_OUT_0_26_MASK                                   (0x7ffffff << 0)
-
-/* Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_L3INSTR_FD_TRANS */
-#define OMAP54XX_DEBUG_OUT_0_13_SHIFT                                  0
-#define OMAP54XX_DEBUG_OUT_0_13_WIDTH                                  0xe
-#define OMAP54XX_DEBUG_OUT_0_13_MASK                                   (0x3fff << 0)
-
-/* Renamed from DEBUG_OUT Used by CM_CORE_AON_DEBUG_L4PER_FD_TRANS2 */
-#define OMAP54XX_DEBUG_OUT_0_21_SHIFT                                  0
-#define OMAP54XX_DEBUG_OUT_0_21_WIDTH                                  0x16
-#define OMAP54XX_DEBUG_OUT_0_21_MASK                                   (0x3fffff << 0)
-
-/*
- * Used by CM_SSC_DELTAMSTEP_DPLL_ABE, CM_SSC_DELTAMSTEP_DPLL_CORE,
- * CM_SSC_DELTAMSTEP_DPLL_IVA, CM_SSC_DELTAMSTEP_DPLL_MPU,
- * CM_SSC_DELTAMSTEP_DPLL_PER
- */
-#define OMAP54XX_DELTAMSTEP_SHIFT                                      0
-#define OMAP54XX_DELTAMSTEP_WIDTH                                      0x14
-#define OMAP54XX_DELTAMSTEP_MASK                                       (0xfffff << 0)
-
-/*
- * Renamed from DELTAMSTEP Used by CM_SSC_DELTAMSTEP_DPLL_UNIPRO1,
- * CM_SSC_DELTAMSTEP_DPLL_UNIPRO2, CM_SSC_DELTAMSTEP_DPLL_USB
- */
-#define OMAP54XX_DELTAMSTEP_0_20_SHIFT                                 0
-#define OMAP54XX_DELTAMSTEP_0_20_WIDTH                                 0x15
-#define OMAP54XX_DELTAMSTEP_0_20_MASK                                  (0x1fffff << 0)
-
-/*
- * Used by CM_DIV_H11_DPLL_CORE, CM_DIV_H11_DPLL_IVA, CM_DIV_H11_DPLL_PER,
- * CM_DIV_H12_DPLL_CORE, CM_DIV_H12_DPLL_IVA, CM_DIV_H12_DPLL_PER,
- * CM_DIV_H13_DPLL_CORE, CM_DIV_H13_DPLL_PER, CM_DIV_H14_DPLL_CORE,
- * CM_DIV_H14_DPLL_PER, CM_DIV_H21_DPLL_CORE, CM_DIV_H22_DPLL_CORE,
- * CM_DIV_H23_DPLL_CORE, CM_DIV_H24_DPLL_CORE
- */
-#define OMAP54XX_DIVHS_SHIFT                                           0
-#define OMAP54XX_DIVHS_WIDTH                                           0x6
 #define OMAP54XX_DIVHS_MASK                                            (0x3f << 0)
-
-/*
- * Renamed from DIVHS Used by CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE,
- * CM_DIV_M2_DPLL_MPU, CM_DIV_M2_DPLL_PER, CM_DIV_M3_DPLL_ABE,
- * CM_DIV_M3_DPLL_CORE, CM_DIV_M3_DPLL_PER
- */
-#define OMAP54XX_DIVHS_0_4_SHIFT                                       0
-#define OMAP54XX_DIVHS_0_4_WIDTH                                       0x5
 #define OMAP54XX_DIVHS_0_4_MASK                                                (0x1f << 0)
-
-/*
- * Renamed from DIVHS Used by CM_DIV_M2_DPLL_UNIPRO1, CM_DIV_M2_DPLL_UNIPRO2,
- * CM_DIV_M2_DPLL_USB
- */
-#define OMAP54XX_DIVHS_0_6_SHIFT                                       0
-#define OMAP54XX_DIVHS_0_6_WIDTH                                       0x7
 #define OMAP54XX_DIVHS_0_6_MASK                                                (0x7f << 0)
-
-/* Used by CM_DLL_CTRL */
-#define OMAP54XX_DLL_OVERRIDE_SHIFT                                    0
-#define OMAP54XX_DLL_OVERRIDE_WIDTH                                    0x1
-#define OMAP54XX_DLL_OVERRIDE_MASK                                     (1 << 0)
-
-/* Renamed from DLL_OVERRIDE Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP54XX_DLL_OVERRIDE_2_2_SHIFT                                        2
-#define OMAP54XX_DLL_OVERRIDE_2_2_WIDTH                                        0x1
-#define OMAP54XX_DLL_OVERRIDE_2_2_MASK                                 (1 << 2)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP54XX_DLL_RESET_SHIFT                                       3
-#define OMAP54XX_DLL_RESET_WIDTH                                       0x1
-#define OMAP54XX_DLL_RESET_MASK                                                (1 << 3)
-
-/*
- * Used by CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_IVA,
- * CM_CLKSEL_DPLL_MPU, CM_CLKSEL_DPLL_PER, CM_CLKSEL_DPLL_UNIPRO1,
- * CM_CLKSEL_DPLL_UNIPRO2, CM_CLKSEL_DPLL_USB
- */
-#define OMAP54XX_DPLL_BYP_CLKSEL_SHIFT                                 23
-#define OMAP54XX_DPLL_BYP_CLKSEL_WIDTH                                 0x1
-#define OMAP54XX_DPLL_BYP_CLKSEL_MASK                                  (1 << 23)
-
-/* Used by CM_CLKSEL_DPLL_CORE */
-#define OMAP54XX_DPLL_CLKOUTHIF_CLKSEL_SHIFT                           20
-#define OMAP54XX_DPLL_CLKOUTHIF_CLKSEL_WIDTH                           0x1
-#define OMAP54XX_DPLL_CLKOUTHIF_CLKSEL_MASK                            (1 << 20)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP54XX_DPLL_CORE_DPLL_EN_SHIFT                               8
-#define OMAP54XX_DPLL_CORE_DPLL_EN_WIDTH                               0x3
-#define OMAP54XX_DPLL_CORE_DPLL_EN_MASK                                        (0x7 << 8)
-
-/* Used by CM_SHADOW_FREQ_CONFIG2 */
-#define OMAP54XX_DPLL_CORE_H12_DIV_SHIFT                               2
-#define OMAP54XX_DPLL_CORE_H12_DIV_WIDTH                               0x6
-#define OMAP54XX_DPLL_CORE_H12_DIV_MASK                                        (0x3f << 2)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP54XX_DPLL_CORE_M2_DIV_SHIFT                                        11
-#define OMAP54XX_DPLL_CORE_M2_DIV_WIDTH                                        0x5
-#define OMAP54XX_DPLL_CORE_M2_DIV_MASK                                 (0x1f << 11)
-
-/*
- * Used by CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_IVA,
- * CM_CLKSEL_DPLL_MPU, CM_CLKSEL_DPLL_PER
- */
-#define OMAP54XX_DPLL_DIV_SHIFT                                                0
-#define OMAP54XX_DPLL_DIV_WIDTH                                                0x7
 #define OMAP54XX_DPLL_DIV_MASK                                         (0x7f << 0)
-
-/*
- * Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_UNIPRO1,
- * CM_CLKSEL_DPLL_UNIPRO2, CM_CLKSEL_DPLL_USB
- */
-#define OMAP54XX_DPLL_DIV_0_7_SHIFT                                    0
-#define OMAP54XX_DPLL_DIV_0_7_WIDTH                                    0x8
-#define OMAP54XX_DPLL_DIV_0_7_MASK                                     (0xff << 0)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_IVA,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define OMAP54XX_DPLL_DRIFTGUARD_EN_SHIFT                              8
-#define OMAP54XX_DPLL_DRIFTGUARD_EN_WIDTH                              0x1
-#define OMAP54XX_DPLL_DRIFTGUARD_EN_MASK                               (1 << 8)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_IVA,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER, CM_CLKMODE_DPLL_UNIPRO1,
- * CM_CLKMODE_DPLL_UNIPRO2, CM_CLKMODE_DPLL_USB
- */
-#define OMAP54XX_DPLL_EN_SHIFT                                         0
-#define OMAP54XX_DPLL_EN_WIDTH                                         0x3
 #define OMAP54XX_DPLL_EN_MASK                                          (0x7 << 0)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_IVA,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define OMAP54XX_DPLL_LPMODE_EN_SHIFT                                  10
-#define OMAP54XX_DPLL_LPMODE_EN_WIDTH                                  0x1
 #define OMAP54XX_DPLL_LPMODE_EN_MASK                                   (1 << 10)
-
-/*
- * Used by CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, CM_CLKSEL_DPLL_IVA,
- * CM_CLKSEL_DPLL_MPU, CM_CLKSEL_DPLL_PER
- */
-#define OMAP54XX_DPLL_MULT_SHIFT                                       8
-#define OMAP54XX_DPLL_MULT_WIDTH                                       0xb
 #define OMAP54XX_DPLL_MULT_MASK                                                (0x7ff << 8)
-
-/*
- * Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_UNIPRO1,
- * CM_CLKSEL_DPLL_UNIPRO2, CM_CLKSEL_DPLL_USB
- */
-#define OMAP54XX_DPLL_MULT_UNIPRO1_SHIFT                               8
-#define OMAP54XX_DPLL_MULT_UNIPRO1_WIDTH                               0xc
-#define OMAP54XX_DPLL_MULT_UNIPRO1_MASK                                        (0xfff << 8)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_IVA,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER
- */
-#define OMAP54XX_DPLL_REGM4XEN_SHIFT                                   11
-#define OMAP54XX_DPLL_REGM4XEN_WIDTH                                   0x1
 #define OMAP54XX_DPLL_REGM4XEN_MASK                                    (1 << 11)
-
-/* Used by CM_CLKSEL_DPLL_UNIPRO1, CM_CLKSEL_DPLL_UNIPRO2, CM_CLKSEL_DPLL_USB */
-#define OMAP54XX_DPLL_SD_DIV_SHIFT                                     24
-#define OMAP54XX_DPLL_SD_DIV_WIDTH                                     0x8
 #define OMAP54XX_DPLL_SD_DIV_MASK                                      (0xff << 24)
-
-/* Used by CM_CLKSEL_DPLL_UNIPRO1, CM_CLKSEL_DPLL_UNIPRO2, CM_CLKSEL_DPLL_USB */
-#define OMAP54XX_DPLL_SELFREQDCO_SHIFT                                 21
-#define OMAP54XX_DPLL_SELFREQDCO_WIDTH                                 0x1
-#define OMAP54XX_DPLL_SELFREQDCO_MASK                                  (1 << 21)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_IVA,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER, CM_CLKMODE_DPLL_UNIPRO1,
- * CM_CLKMODE_DPLL_UNIPRO2, CM_CLKMODE_DPLL_USB
- */
-#define OMAP54XX_DPLL_SSC_ACK_SHIFT                                    13
-#define OMAP54XX_DPLL_SSC_ACK_WIDTH                                    0x1
-#define OMAP54XX_DPLL_SSC_ACK_MASK                                     (1 << 13)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_IVA,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER, CM_CLKMODE_DPLL_UNIPRO1,
- * CM_CLKMODE_DPLL_UNIPRO2, CM_CLKMODE_DPLL_USB
- */
-#define OMAP54XX_DPLL_SSC_DOWNSPREAD_SHIFT                             14
-#define OMAP54XX_DPLL_SSC_DOWNSPREAD_WIDTH                             0x1
-#define OMAP54XX_DPLL_SSC_DOWNSPREAD_MASK                              (1 << 14)
-
-/*
- * Used by CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, CM_CLKMODE_DPLL_IVA,
- * CM_CLKMODE_DPLL_MPU, CM_CLKMODE_DPLL_PER, CM_CLKMODE_DPLL_UNIPRO1,
- * CM_CLKMODE_DPLL_UNIPRO2, CM_CLKMODE_DPLL_USB
- */
-#define OMAP54XX_DPLL_SSC_EN_SHIFT                                     12
-#define OMAP54XX_DPLL_SSC_EN_WIDTH                                     0x1
-#define OMAP54XX_DPLL_SSC_EN_MASK                                      (1 << 12)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_DSP_DYNDEP_SHIFT                                      1
-#define OMAP54XX_DSP_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_DSP_DYNDEP_MASK                                       (1 << 1)
-
-/* Used by CM_IPU_STATICDEP, CM_MPU_STATICDEP */
 #define OMAP54XX_DSP_STATDEP_SHIFT                                     1
-#define OMAP54XX_DSP_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_DSP_STATDEP_MASK                                      (1 << 1)
-
-/* Used by CM_L3MAIN2_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
-#define OMAP54XX_DSS_DYNDEP_SHIFT                                      8
-#define OMAP54XX_DSS_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_DSS_DYNDEP_MASK                                       (1 << 8)
-
-/* Used by CM_DMA_STATICDEP, CM_IPU_STATICDEP, CM_MPU_STATICDEP */
 #define OMAP54XX_DSS_STATDEP_SHIFT                                     8
-#define OMAP54XX_DSS_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_DSS_STATDEP_MASK                                      (1 << 8)
-
-/*
- * Used by CM_C2C_DYNAMICDEP, CM_L3MAIN1_DYNAMICDEP, CM_L4CFG_DYNAMICDEP,
- * CM_MIPIEXT_DYNAMICDEP, CM_MPU_DYNAMICDEP
- */
-#define OMAP54XX_EMIF_DYNDEP_SHIFT                                     4
-#define OMAP54XX_EMIF_DYNDEP_WIDTH                                     0x1
-#define OMAP54XX_EMIF_DYNDEP_MASK                                      (1 << 4)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_CAM_STATICDEP, CM_DMA_STATICDEP,
- * CM_DSP_STATICDEP, CM_DSS_STATICDEP, CM_GPU_STATICDEP, CM_IPU_STATICDEP,
- * CM_IVA_STATICDEP, CM_L3INIT_STATICDEP, CM_L4SEC_STATICDEP,
- * CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_EMIF_STATDEP_SHIFT                                    4
-#define OMAP54XX_EMIF_STATDEP_WIDTH                                    0x1
-#define OMAP54XX_EMIF_STATDEP_MASK                                     (1 << 4)
-
-/* Used by CM_SHADOW_FREQ_CONFIG1 */
-#define OMAP54XX_FREQ_UPDATE_SHIFT                                     0
-#define OMAP54XX_FREQ_UPDATE_WIDTH                                     0x1
-#define OMAP54XX_FREQ_UPDATE_MASK                                      (1 << 0)
-
-/* Used by REVISION_CM_CORE, REVISION_CM_CORE_AON */
-#define OMAP54XX_FUNC_SHIFT                                            16
-#define OMAP54XX_FUNC_WIDTH                                            0xc
-#define OMAP54XX_FUNC_MASK                                             (0xfff << 16)
-
-/* Used by CM_SHADOW_FREQ_CONFIG2 */
-#define OMAP54XX_GPMC_FREQ_UPDATE_SHIFT                                        0
-#define OMAP54XX_GPMC_FREQ_UPDATE_WIDTH                                        0x1
-#define OMAP54XX_GPMC_FREQ_UPDATE_MASK                                 (1 << 0)
-
-/* Used by CM_L3MAIN2_DYNAMICDEP */
-#define OMAP54XX_GPU_DYNDEP_SHIFT                                      10
-#define OMAP54XX_GPU_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_GPU_DYNDEP_MASK                                       (1 << 10)
-
-/* Used by CM_IPU_STATICDEP, CM_MPU_STATICDEP */
 #define OMAP54XX_GPU_STATDEP_SHIFT                                     10
-#define OMAP54XX_GPU_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_GPU_STATDEP_MASK                                      (1 << 10)
-
-/*
- * Used by CM_ABE_AESS_CLKCTRL, CM_ABE_DMIC_CLKCTRL, CM_ABE_L4_ABE_CLKCTRL,
- * CM_ABE_MCASP_CLKCTRL, CM_ABE_MCBSP1_CLKCTRL, CM_ABE_MCBSP2_CLKCTRL,
- * CM_ABE_MCBSP3_CLKCTRL, CM_ABE_MCPDM_CLKCTRL, CM_ABE_SLIMBUS1_CLKCTRL,
- * CM_ABE_TIMER5_CLKCTRL, CM_ABE_TIMER6_CLKCTRL, CM_ABE_TIMER7_CLKCTRL,
- * CM_ABE_TIMER8_CLKCTRL, CM_ABE_WD_TIMER3_CLKCTRL, CM_C2C_C2C_CLKCTRL,
- * CM_C2C_C2C_OCP_FW_CLKCTRL, CM_C2C_MODEM_ICR_CLKCTRL, CM_CAM_CAL_CLKCTRL,
- * CM_CAM_FDIF_CLKCTRL, CM_CAM_ISS_CLKCTRL, CM_CM_CORE_AON_PROFILING_CLKCTRL,
- * CM_CM_CORE_PROFILING_CLKCTRL, CM_COREAON_SMARTREFLEX_CORE_CLKCTRL,
- * CM_COREAON_SMARTREFLEX_MM_CLKCTRL, CM_COREAON_SMARTREFLEX_MPU_CLKCTRL,
- * CM_CUSTEFUSE_EFUSE_CTRL_CUST_CLKCTRL, CM_DMA_DMA_SYSTEM_CLKCTRL,
- * CM_DSP_DSP_CLKCTRL, CM_DSS_BB2D_CLKCTRL, CM_DSS_DSS_CLKCTRL,
- * CM_EMIF_DMM_CLKCTRL, CM_EMIF_EMIF1_CLKCTRL, CM_EMIF_EMIF2_CLKCTRL,
- * CM_EMIF_EMIF_OCP_FW_CLKCTRL, CM_EMU_DEBUGSS_CLKCTRL,
- * CM_EMU_MPU_EMU_DBG_CLKCTRL, CM_GPU_GPU_CLKCTRL, CM_IPU_IPU_CLKCTRL,
- * CM_IVA_IVA_CLKCTRL, CM_IVA_SL2_CLKCTRL, CM_L3INIT_HSI_CLKCTRL,
- * CM_L3INIT_IEEE1500_2_OCP_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
- * CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_MPHY_UNIPRO2_CLKCTRL,
- * CM_L3INIT_OCP2SCP1_CLKCTRL, CM_L3INIT_OCP2SCP3_CLKCTRL,
- * CM_L3INIT_SATA_CLKCTRL, CM_L3INIT_UNIPRO2_CLKCTRL,
- * CM_L3INIT_USB_HOST_HS_CLKCTRL, CM_L3INIT_USB_OTG_SS_CLKCTRL,
- * CM_L3INIT_USB_TLL_HS_CLKCTRL, CM_L3INSTR_CTRL_MODULE_BANDGAP_CLKCTRL,
- * CM_L3INSTR_DLL_AGING_CLKCTRL, CM_L3INSTR_L3_INSTR_CLKCTRL,
- * CM_L3INSTR_L3_MAIN_3_CLKCTRL, CM_L3INSTR_OCP_WP_NOC_CLKCTRL,
- * CM_L3MAIN1_L3_MAIN_1_CLKCTRL, CM_L3MAIN2_GPMC_CLKCTRL,
- * CM_L3MAIN2_L3_MAIN_2_CLKCTRL, CM_L3MAIN2_OCMC_RAM_CLKCTRL,
- * CM_L4CFG_L4_CFG_CLKCTRL, CM_L4CFG_MAILBOX_CLKCTRL,
- * CM_L4CFG_OCP2SCP2_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL,
- * CM_L4CFG_SPINLOCK_CLKCTRL, CM_L4PER_ELM_CLKCTRL, CM_L4PER_GPIO2_CLKCTRL,
- * CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL, CM_L4PER_GPIO5_CLKCTRL,
- * CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_GPIO7_CLKCTRL, CM_L4PER_GPIO8_CLKCTRL,
- * CM_L4PER_HDQ1W_CLKCTRL, CM_L4PER_I2C1_CLKCTRL, CM_L4PER_I2C2_CLKCTRL,
- * CM_L4PER_I2C3_CLKCTRL, CM_L4PER_I2C4_CLKCTRL, CM_L4PER_I2C5_CLKCTRL,
- * CM_L4PER_L4_PER_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, CM_L4PER_MCSPI2_CLKCTRL,
- * CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, CM_L4PER_MMC3_CLKCTRL,
- * CM_L4PER_MMC4_CLKCTRL, CM_L4PER_MMC5_CLKCTRL, CM_L4PER_TIMER10_CLKCTRL,
- * CM_L4PER_TIMER11_CLKCTRL, CM_L4PER_TIMER2_CLKCTRL, CM_L4PER_TIMER3_CLKCTRL,
- * CM_L4PER_TIMER4_CLKCTRL, CM_L4PER_TIMER9_CLKCTRL, CM_L4PER_UART1_CLKCTRL,
- * CM_L4PER_UART2_CLKCTRL, CM_L4PER_UART3_CLKCTRL, CM_L4PER_UART4_CLKCTRL,
- * CM_L4PER_UART5_CLKCTRL, CM_L4PER_UART6_CLKCTRL, CM_L4SEC_AES1_CLKCTRL,
- * CM_L4SEC_AES2_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
- * CM_L4SEC_DMA_CRYPTO_CLKCTRL, CM_L4SEC_FPKA_CLKCTRL, CM_L4SEC_RNG_CLKCTRL,
- * CM_L4SEC_SHA2MD5_CLKCTRL, CM_MIPIEXT_LLI_CLKCTRL,
- * CM_MIPIEXT_LLI_OCP_FW_CLKCTRL, CM_MIPIEXT_MPHY_CLKCTRL, CM_MPU_MPU_CLKCTRL,
- * CM_MPU_MPU_MPU_DBG_CLKCTRL, CM_WKUPAON_COUNTER_32K_CLKCTRL,
- * CM_WKUPAON_GPIO1_CLKCTRL, CM_WKUPAON_KBD_CLKCTRL,
- * CM_WKUPAON_L4_WKUP_CLKCTRL, CM_WKUPAON_SAR_RAM_CLKCTRL,
- * CM_WKUPAON_TIMER12_CLKCTRL, CM_WKUPAON_TIMER1_CLKCTRL,
- * CM_WKUPAON_WD_TIMER1_CLKCTRL, CM_WKUPAON_WD_TIMER2_CLKCTRL
- */
-#define OMAP54XX_IDLEST_SHIFT                                          16
-#define OMAP54XX_IDLEST_WIDTH                                          0x2
-#define OMAP54XX_IDLEST_MASK                                           (0x3 << 16)
-
-/* Used by CM_L3MAIN2_DYNAMICDEP */
-#define OMAP54XX_IPU_DYNDEP_SHIFT                                      0
-#define OMAP54XX_IPU_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_IPU_DYNDEP_MASK                                       (1 << 0)
-
-/* Used by CM_DMA_STATICDEP, CM_MPU_STATICDEP */
 #define OMAP54XX_IPU_STATDEP_SHIFT                                     0
-#define OMAP54XX_IPU_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_IPU_STATDEP_MASK                                      (1 << 0)
-
-/* Used by CM_DSP_DYNAMICDEP, CM_L3MAIN2_DYNAMICDEP */
-#define OMAP54XX_IVA_DYNDEP_SHIFT                                      2
-#define OMAP54XX_IVA_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_IVA_DYNDEP_MASK                                       (1 << 2)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_CAM_STATICDEP, CM_DMA_STATICDEP,
- * CM_DSP_STATICDEP, CM_DSS_STATICDEP, CM_GPU_STATICDEP, CM_IPU_STATICDEP,
- * CM_L3INIT_STATICDEP, CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_IVA_STATDEP_SHIFT                                     2
-#define OMAP54XX_IVA_STATDEP_WIDTH                                     0x1
-#define OMAP54XX_IVA_STATDEP_MASK                                      (1 << 2)
-
-/* Used by CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
-#define OMAP54XX_L3INIT_DYNDEP_SHIFT                                   7
-#define OMAP54XX_L3INIT_DYNDEP_WIDTH                                   0x1
-#define OMAP54XX_L3INIT_DYNDEP_MASK                                    (1 << 7)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_DMA_STATICDEP, CM_DSP_STATICDEP,
- * CM_IPU_STATICDEP, CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_L3INIT_STATDEP_SHIFT                                  7
-#define OMAP54XX_L3INIT_STATDEP_WIDTH                                  0x1
-#define OMAP54XX_L3INIT_STATDEP_MASK                                   (1 << 7)
-
-/*
- * Used by CM_DSP_DYNAMICDEP, CM_DSS_DYNAMICDEP, CM_L3INIT_DYNAMICDEP,
- * CM_L3MAIN2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_MPU_DYNAMICDEP
- */
-#define OMAP54XX_L3MAIN1_DYNDEP_SHIFT                                  5
-#define OMAP54XX_L3MAIN1_DYNDEP_WIDTH                                  0x1
-#define OMAP54XX_L3MAIN1_DYNDEP_MASK                                   (1 << 5)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_CAM_STATICDEP, CM_DMA_STATICDEP,
- * CM_DSP_STATICDEP, CM_DSS_STATICDEP, CM_GPU_STATICDEP, CM_IPU_STATICDEP,
- * CM_IVA_STATICDEP, CM_L3INIT_STATICDEP, CM_L4SEC_STATICDEP,
- * CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_L3MAIN1_STATDEP_SHIFT                                 5
-#define OMAP54XX_L3MAIN1_STATDEP_WIDTH                                 0x1
-#define OMAP54XX_L3MAIN1_STATDEP_MASK                                  (1 << 5)
-
-/*
- * Used by CM_C2C_DYNAMICDEP, CM_CAM_DYNAMICDEP, CM_DMA_DYNAMICDEP,
- * CM_DSS_DYNAMICDEP, CM_EMU_DYNAMICDEP, CM_GPU_DYNAMICDEP, CM_IPU_DYNAMICDEP,
- * CM_IVA_DYNAMICDEP, CM_L3INIT_DYNAMICDEP, CM_L3MAIN1_DYNAMICDEP,
- * CM_L4CFG_DYNAMICDEP, CM_L4SEC_DYNAMICDEP, CM_MIPIEXT_DYNAMICDEP
- */
-#define OMAP54XX_L3MAIN2_DYNDEP_SHIFT                                  6
-#define OMAP54XX_L3MAIN2_DYNDEP_WIDTH                                  0x1
-#define OMAP54XX_L3MAIN2_DYNDEP_MASK                                   (1 << 6)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_CAM_STATICDEP, CM_DMA_STATICDEP,
- * CM_DSP_STATICDEP, CM_DSS_STATICDEP, CM_GPU_STATICDEP, CM_IPU_STATICDEP,
- * CM_IVA_STATICDEP, CM_L3INIT_STATICDEP, CM_L4SEC_STATICDEP,
- * CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_L3MAIN2_STATDEP_SHIFT                                 6
-#define OMAP54XX_L3MAIN2_STATDEP_WIDTH                                 0x1
-#define OMAP54XX_L3MAIN2_STATDEP_MASK                                  (1 << 6)
-
-/* Used by CM_L3MAIN1_DYNAMICDEP */
-#define OMAP54XX_L4CFG_DYNDEP_SHIFT                                    12
-#define OMAP54XX_L4CFG_DYNDEP_WIDTH                                    0x1
-#define OMAP54XX_L4CFG_DYNDEP_MASK                                     (1 << 12)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_DMA_STATICDEP, CM_DSP_STATICDEP,
- * CM_IPU_STATICDEP, CM_L3INIT_STATICDEP, CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_L4CFG_STATDEP_SHIFT                                   12
-#define OMAP54XX_L4CFG_STATDEP_WIDTH                                   0x1
-#define OMAP54XX_L4CFG_STATDEP_MASK                                    (1 << 12)
-
-/* Used by CM_L3MAIN2_DYNAMICDEP */
-#define OMAP54XX_L4PER_DYNDEP_SHIFT                                    13
-#define OMAP54XX_L4PER_DYNDEP_WIDTH                                    0x1
-#define OMAP54XX_L4PER_DYNDEP_MASK                                     (1 << 13)
-
-/*
- * Used by CM_C2C_STATICDEP, CM_DMA_STATICDEP, CM_DSP_STATICDEP,
- * CM_IPU_STATICDEP, CM_L3INIT_STATICDEP, CM_L4SEC_STATICDEP,
- * CM_MIPIEXT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_L4PER_STATDEP_SHIFT                                   13
-#define OMAP54XX_L4PER_STATDEP_WIDTH                                   0x1
-#define OMAP54XX_L4PER_STATDEP_MASK                                    (1 << 13)
-
-/* Used by CM_L3MAIN2_DYNAMICDEP, CM_L4PER_DYNAMICDEP */
-#define OMAP54XX_L4SEC_DYNDEP_SHIFT                                    14
-#define OMAP54XX_L4SEC_DYNDEP_WIDTH                                    0x1
-#define OMAP54XX_L4SEC_DYNDEP_MASK                                     (1 << 14)
-
-/*
- * Used by CM_DMA_STATICDEP, CM_IPU_STATICDEP, CM_L3INIT_STATICDEP,
- * CM_MPU_STATICDEP
- */
 #define OMAP54XX_L4SEC_STATDEP_SHIFT                                   14
-#define OMAP54XX_L4SEC_STATDEP_WIDTH                                   0x1
-#define OMAP54XX_L4SEC_STATDEP_MASK                                    (1 << 14)
-
-/* Used by CM_L3MAIN2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_MIPIEXT_DYNDEP_SHIFT                                  21
-#define OMAP54XX_MIPIEXT_DYNDEP_WIDTH                                  0x1
-#define OMAP54XX_MIPIEXT_DYNDEP_MASK                                   (1 << 21)
-
-/* Used by CM_MPU_STATICDEP */
-#define OMAP54XX_MIPIEXT_STATDEP_SHIFT                                 21
-#define OMAP54XX_MIPIEXT_STATDEP_WIDTH                                 0x1
-#define OMAP54XX_MIPIEXT_STATDEP_MASK                                  (1 << 21)
-
-/*
- * Used by CM_SSC_MODFREQDIV_DPLL_ABE, CM_SSC_MODFREQDIV_DPLL_CORE,
- * CM_SSC_MODFREQDIV_DPLL_IVA, CM_SSC_MODFREQDIV_DPLL_MPU,
- * CM_SSC_MODFREQDIV_DPLL_PER, CM_SSC_MODFREQDIV_DPLL_UNIPRO1,
- * CM_SSC_MODFREQDIV_DPLL_UNIPRO2, CM_SSC_MODFREQDIV_DPLL_USB
- */
-#define OMAP54XX_MODFREQDIV_EXPONENT_SHIFT                             8
-#define OMAP54XX_MODFREQDIV_EXPONENT_WIDTH                             0x3
-#define OMAP54XX_MODFREQDIV_EXPONENT_MASK                              (0x7 << 8)
-
-/*
- * Used by CM_SSC_MODFREQDIV_DPLL_ABE, CM_SSC_MODFREQDIV_DPLL_CORE,
- * CM_SSC_MODFREQDIV_DPLL_IVA, CM_SSC_MODFREQDIV_DPLL_MPU,
- * CM_SSC_MODFREQDIV_DPLL_PER, CM_SSC_MODFREQDIV_DPLL_UNIPRO1,
- * CM_SSC_MODFREQDIV_DPLL_UNIPRO2, CM_SSC_MODFREQDIV_DPLL_USB
- */
-#define OMAP54XX_MODFREQDIV_MANTISSA_SHIFT                             0
-#define OMAP54XX_MODFREQDIV_MANTISSA_WIDTH                             0x7
-#define OMAP54XX_MODFREQDIV_MANTISSA_MASK                              (0x7f << 0)
-
-/*
- * Used by CM_ABE_AESS_CLKCTRL, CM_ABE_DMIC_CLKCTRL, CM_ABE_L4_ABE_CLKCTRL,
- * CM_ABE_MCASP_CLKCTRL, CM_ABE_MCBSP1_CLKCTRL, CM_ABE_MCBSP2_CLKCTRL,
- * CM_ABE_MCBSP3_CLKCTRL, CM_ABE_MCPDM_CLKCTRL, CM_ABE_SLIMBUS1_CLKCTRL,
- * CM_ABE_TIMER5_CLKCTRL, CM_ABE_TIMER6_CLKCTRL, CM_ABE_TIMER7_CLKCTRL,
- * CM_ABE_TIMER8_CLKCTRL, CM_ABE_WD_TIMER3_CLKCTRL, CM_C2C_C2C_CLKCTRL,
- * CM_C2C_C2C_OCP_FW_CLKCTRL, CM_C2C_MODEM_ICR_CLKCTRL, CM_CAM_CAL_CLKCTRL,
- * CM_CAM_FDIF_CLKCTRL, CM_CAM_ISS_CLKCTRL, CM_CM_CORE_AON_PROFILING_CLKCTRL,
- * CM_CM_CORE_PROFILING_CLKCTRL, CM_COREAON_SMARTREFLEX_CORE_CLKCTRL,
- * CM_COREAON_SMARTREFLEX_MM_CLKCTRL, CM_COREAON_SMARTREFLEX_MPU_CLKCTRL,
- * CM_CUSTEFUSE_EFUSE_CTRL_CUST_CLKCTRL, CM_DMA_DMA_SYSTEM_CLKCTRL,
- * CM_DSP_DSP_CLKCTRL, CM_DSS_BB2D_CLKCTRL, CM_DSS_DSS_CLKCTRL,
- * CM_EMIF_DMM_CLKCTRL, CM_EMIF_EMIF1_CLKCTRL, CM_EMIF_EMIF2_CLKCTRL,
- * CM_EMIF_EMIF_OCP_FW_CLKCTRL, CM_EMU_DEBUGSS_CLKCTRL,
- * CM_EMU_MPU_EMU_DBG_CLKCTRL, CM_GPU_GPU_CLKCTRL, CM_IPU_IPU_CLKCTRL,
- * CM_IVA_IVA_CLKCTRL, CM_IVA_SL2_CLKCTRL, CM_L3INIT_HSI_CLKCTRL,
- * CM_L3INIT_IEEE1500_2_OCP_CLKCTRL, CM_L3INIT_MMC1_CLKCTRL,
- * CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_MPHY_UNIPRO2_CLKCTRL,
- * CM_L3INIT_OCP2SCP1_CLKCTRL, CM_L3INIT_OCP2SCP3_CLKCTRL,
- * CM_L3INIT_SATA_CLKCTRL, CM_L3INIT_UNIPRO2_CLKCTRL,
- * CM_L3INIT_USB_HOST_HS_CLKCTRL, CM_L3INIT_USB_OTG_SS_CLKCTRL,
- * CM_L3INIT_USB_TLL_HS_CLKCTRL, CM_L3INSTR_CTRL_MODULE_BANDGAP_CLKCTRL,
- * CM_L3INSTR_DLL_AGING_CLKCTRL, CM_L3INSTR_L3_INSTR_CLKCTRL,
- * CM_L3INSTR_L3_MAIN_3_CLKCTRL, CM_L3INSTR_OCP_WP_NOC_CLKCTRL,
- * CM_L3MAIN1_L3_MAIN_1_CLKCTRL, CM_L3MAIN2_GPMC_CLKCTRL,
- * CM_L3MAIN2_L3_MAIN_2_CLKCTRL, CM_L3MAIN2_OCMC_RAM_CLKCTRL,
- * CM_L4CFG_L4_CFG_CLKCTRL, CM_L4CFG_MAILBOX_CLKCTRL,
- * CM_L4CFG_OCP2SCP2_CLKCTRL, CM_L4CFG_SAR_ROM_CLKCTRL,
- * CM_L4CFG_SPINLOCK_CLKCTRL, CM_L4PER_ELM_CLKCTRL, CM_L4PER_GPIO2_CLKCTRL,
- * CM_L4PER_GPIO3_CLKCTRL, CM_L4PER_GPIO4_CLKCTRL, CM_L4PER_GPIO5_CLKCTRL,
- * CM_L4PER_GPIO6_CLKCTRL, CM_L4PER_GPIO7_CLKCTRL, CM_L4PER_GPIO8_CLKCTRL,
- * CM_L4PER_HDQ1W_CLKCTRL, CM_L4PER_I2C1_CLKCTRL, CM_L4PER_I2C2_CLKCTRL,
- * CM_L4PER_I2C3_CLKCTRL, CM_L4PER_I2C4_CLKCTRL, CM_L4PER_I2C5_CLKCTRL,
- * CM_L4PER_L4_PER_CLKCTRL, CM_L4PER_MCSPI1_CLKCTRL, CM_L4PER_MCSPI2_CLKCTRL,
- * CM_L4PER_MCSPI3_CLKCTRL, CM_L4PER_MCSPI4_CLKCTRL, CM_L4PER_MMC3_CLKCTRL,
- * CM_L4PER_MMC4_CLKCTRL, CM_L4PER_MMC5_CLKCTRL, CM_L4PER_TIMER10_CLKCTRL,
- * CM_L4PER_TIMER11_CLKCTRL, CM_L4PER_TIMER2_CLKCTRL, CM_L4PER_TIMER3_CLKCTRL,
- * CM_L4PER_TIMER4_CLKCTRL, CM_L4PER_TIMER9_CLKCTRL, CM_L4PER_UART1_CLKCTRL,
- * CM_L4PER_UART2_CLKCTRL, CM_L4PER_UART3_CLKCTRL, CM_L4PER_UART4_CLKCTRL,
- * CM_L4PER_UART5_CLKCTRL, CM_L4PER_UART6_CLKCTRL, CM_L4SEC_AES1_CLKCTRL,
- * CM_L4SEC_AES2_CLKCTRL, CM_L4SEC_DES3DES_CLKCTRL,
- * CM_L4SEC_DMA_CRYPTO_CLKCTRL, CM_L4SEC_FPKA_CLKCTRL, CM_L4SEC_RNG_CLKCTRL,
- * CM_L4SEC_SHA2MD5_CLKCTRL, CM_MIPIEXT_LLI_CLKCTRL,
- * CM_MIPIEXT_LLI_OCP_FW_CLKCTRL, CM_MIPIEXT_MPHY_CLKCTRL, CM_MPU_MPU_CLKCTRL,
- * CM_MPU_MPU_MPU_DBG_CLKCTRL, CM_WKUPAON_COUNTER_32K_CLKCTRL,
- * CM_WKUPAON_GPIO1_CLKCTRL, CM_WKUPAON_KBD_CLKCTRL,
- * CM_WKUPAON_L4_WKUP_CLKCTRL, CM_WKUPAON_SAR_RAM_CLKCTRL,
- * CM_WKUPAON_TIMER12_CLKCTRL, CM_WKUPAON_TIMER1_CLKCTRL,
- * CM_WKUPAON_WD_TIMER1_CLKCTRL, CM_WKUPAON_WD_TIMER2_CLKCTRL
- */
-#define OMAP54XX_MODULEMODE_SHIFT                                      0
-#define OMAP54XX_MODULEMODE_WIDTH                                      0x2
-#define OMAP54XX_MODULEMODE_MASK                                       (0x3 << 0)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_MPU_DYNDEP_SHIFT                                      19
-#define OMAP54XX_MPU_DYNDEP_WIDTH                                      0x1
-#define OMAP54XX_MPU_DYNDEP_MASK                                       (1 << 19)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_32KHZ_CLK_SHIFT                             11
-#define OMAP54XX_OPTFCLKEN_32KHZ_CLK_WIDTH                             0x1
-#define OMAP54XX_OPTFCLKEN_32KHZ_CLK_MASK                              (1 << 11)
-
-/* Renamed from OPTFCLKEN_32KHZ_CLK Used by CM_L3INIT_MMC1_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_32KHZ_CLK_8_8_SHIFT                         8
-#define OMAP54XX_OPTFCLKEN_32KHZ_CLK_8_8_WIDTH                         0x1
-#define OMAP54XX_OPTFCLKEN_32KHZ_CLK_8_8_MASK                          (1 << 8)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_48MHZ_CLK_SHIFT                             9
-#define OMAP54XX_OPTFCLKEN_48MHZ_CLK_WIDTH                             0x1
-#define OMAP54XX_OPTFCLKEN_48MHZ_CLK_MASK                              (1 << 9)
-
-/* Used by CM_COREAON_USB_PHY_CORE_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_CLK32K_SHIFT                                        8
-#define OMAP54XX_OPTFCLKEN_CLK32K_WIDTH                                        0x1
-#define OMAP54XX_OPTFCLKEN_CLK32K_MASK                                 (1 << 8)
-
-/* Used by CM_CAM_ISS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_CTRLCLK_SHIFT                               8
-#define OMAP54XX_OPTFCLKEN_CTRLCLK_WIDTH                               0x1
-#define OMAP54XX_OPTFCLKEN_CTRLCLK_MASK                                        (1 << 8)
-
-/*
- * Used by CM_L4PER_GPIO2_CLKCTRL, CM_L4PER_GPIO3_CLKCTRL,
- * CM_L4PER_GPIO4_CLKCTRL, CM_L4PER_GPIO5_CLKCTRL, CM_L4PER_GPIO6_CLKCTRL,
- * CM_L4PER_GPIO7_CLKCTRL, CM_L4PER_GPIO8_CLKCTRL, CM_WKUPAON_GPIO1_CLKCTRL
- */
 #define OMAP54XX_OPTFCLKEN_DBCLK_SHIFT                                 8
-#define OMAP54XX_OPTFCLKEN_DBCLK_WIDTH                                 0x1
-#define OMAP54XX_OPTFCLKEN_DBCLK_MASK                                  (1 << 8)
-
-/* Used by CM_EMIF_EMIF_DLL_CLKCTRL */
-#define OMAP54XX_OPTFCLKEN_DLL_CLK_SHIFT                               8
-#define OMAP54XX_OPTFCLKEN_DLL_CLK_WIDTH                               0x1
-#define OMAP54XX_OPTFCLKEN_DLL_CLK_MASK                                        (1 << 8)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_DSSCLK_SHIFT                                        8
-#define OMAP54XX_OPTFCLKEN_DSSCLK_WIDTH                                        0x1
-#define OMAP54XX_OPTFCLKEN_DSSCLK_MASK                                 (1 << 8)
-
-/* Used by CM_ABE_SLIMBUS1_CLKCTRL */
-#define OMAP54XX_OPTFCLKEN_FCLK0_SHIFT                                 8
-#define OMAP54XX_OPTFCLKEN_FCLK0_WIDTH                                 0x1
-#define OMAP54XX_OPTFCLKEN_FCLK0_MASK                                  (1 << 8)
-
-/* Used by CM_ABE_SLIMBUS1_CLKCTRL */
-#define OMAP54XX_OPTFCLKEN_FCLK1_SHIFT                                 9
-#define OMAP54XX_OPTFCLKEN_FCLK1_WIDTH                                 0x1
-#define OMAP54XX_OPTFCLKEN_FCLK1_MASK                                  (1 << 9)
-
-/* Used by CM_ABE_SLIMBUS1_CLKCTRL */
-#define OMAP54XX_OPTFCLKEN_FCLK2_SHIFT                                 10
-#define OMAP54XX_OPTFCLKEN_FCLK2_WIDTH                                 0x1
-#define OMAP54XX_OPTFCLKEN_FCLK2_MASK                                  (1 << 10)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
-#define OMAP54XX_OPTFCLKEN_FUNC48M_CLK_SHIFT                           15
-#define OMAP54XX_OPTFCLKEN_FUNC48M_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_FUNC48M_CLK_MASK                            (1 << 15)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT                       13
-#define OMAP54XX_OPTFCLKEN_HSIC480M_P1_CLK_WIDTH                       0x1
-#define OMAP54XX_OPTFCLKEN_HSIC480M_P1_CLK_MASK                                (1 << 13)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT                       14
-#define OMAP54XX_OPTFCLKEN_HSIC480M_P2_CLK_WIDTH                       0x1
-#define OMAP54XX_OPTFCLKEN_HSIC480M_P2_CLK_MASK                                (1 << 14)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_HSIC480M_P3_CLK_SHIFT                       7
-#define OMAP54XX_OPTFCLKEN_HSIC480M_P3_CLK_WIDTH                       0x1
-#define OMAP54XX_OPTFCLKEN_HSIC480M_P3_CLK_MASK                                (1 << 7)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT                                11
-#define OMAP54XX_OPTFCLKEN_HSIC60M_P1_CLK_WIDTH                                0x1
-#define OMAP54XX_OPTFCLKEN_HSIC60M_P1_CLK_MASK                         (1 << 11)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT                                12
-#define OMAP54XX_OPTFCLKEN_HSIC60M_P2_CLK_WIDTH                                0x1
-#define OMAP54XX_OPTFCLKEN_HSIC60M_P2_CLK_MASK                         (1 << 12)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_HSIC60M_P3_CLK_SHIFT                                6
-#define OMAP54XX_OPTFCLKEN_HSIC60M_P3_CLK_WIDTH                                0x1
-#define OMAP54XX_OPTFCLKEN_HSIC60M_P3_CLK_MASK                         (1 << 6)
-
-/* Used by CM_L3INIT_USB_OTG_SS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_REFCLK960M_SHIFT                            8
-#define OMAP54XX_OPTFCLKEN_REFCLK960M_WIDTH                            0x1
-#define OMAP54XX_OPTFCLKEN_REFCLK960M_MASK                             (1 << 8)
-
-/* Used by CM_L3INIT_SATA_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_REF_CLK_SHIFT                               8
-#define OMAP54XX_OPTFCLKEN_REF_CLK_WIDTH                               0x1
-#define OMAP54XX_OPTFCLKEN_REF_CLK_MASK                                        (1 << 8)
-
-/* Used by CM_WKUPAON_SCRM_CLKCTRL */
-#define OMAP54XX_OPTFCLKEN_SCRM_CORE_SHIFT                             8
-#define OMAP54XX_OPTFCLKEN_SCRM_CORE_WIDTH                             0x1
-#define OMAP54XX_OPTFCLKEN_SCRM_CORE_MASK                              (1 << 8)
-
-/* Used by CM_WKUPAON_SCRM_CLKCTRL */
-#define OMAP54XX_OPTFCLKEN_SCRM_PER_SHIFT                              9
-#define OMAP54XX_OPTFCLKEN_SCRM_PER_WIDTH                              0x1
-#define OMAP54XX_OPTFCLKEN_SCRM_PER_MASK                               (1 << 9)
-
-/* Used by CM_ABE_SLIMBUS1_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_SLIMBUS_CLK_SHIFT                           11
-#define OMAP54XX_OPTFCLKEN_SLIMBUS_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_SLIMBUS_CLK_MASK                            (1 << 11)
-
-/* Used by CM_DSS_DSS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_SYS_CLK_SHIFT                               10
-#define OMAP54XX_OPTFCLKEN_SYS_CLK_WIDTH                               0x1
-#define OMAP54XX_OPTFCLKEN_SYS_CLK_MASK                                        (1 << 10)
-
-/* Used by CM_MIPIEXT_LLI_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_TXPHY_CLK_SHIFT                             8
-#define OMAP54XX_OPTFCLKEN_TXPHY_CLK_WIDTH                             0x1
-#define OMAP54XX_OPTFCLKEN_TXPHY_CLK_MASK                              (1 << 8)
-
-/* Used by CM_MIPIEXT_LLI_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_TXPHY_LS_CLK_SHIFT                          9
-#define OMAP54XX_OPTFCLKEN_TXPHY_LS_CLK_WIDTH                          0x1
-#define OMAP54XX_OPTFCLKEN_TXPHY_LS_CLK_MASK                           (1 << 9)
-
-/* Used by CM_L3INIT_USB_TLL_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_USB_CH0_CLK_SHIFT                           8
-#define OMAP54XX_OPTFCLKEN_USB_CH0_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_USB_CH0_CLK_MASK                            (1 << 8)
-
-/* Used by CM_L3INIT_USB_TLL_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_USB_CH1_CLK_SHIFT                           9
-#define OMAP54XX_OPTFCLKEN_USB_CH1_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_USB_CH1_CLK_MASK                            (1 << 9)
-
-/* Used by CM_L3INIT_USB_TLL_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_USB_CH2_CLK_SHIFT                           10
-#define OMAP54XX_OPTFCLKEN_USB_CH2_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_USB_CH2_CLK_MASK                            (1 << 10)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_UTMI_P1_CLK_SHIFT                           8
-#define OMAP54XX_OPTFCLKEN_UTMI_P1_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_UTMI_P1_CLK_MASK                            (1 << 8)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_UTMI_P2_CLK_SHIFT                           9
-#define OMAP54XX_OPTFCLKEN_UTMI_P2_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_UTMI_P2_CLK_MASK                            (1 << 9)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL */
 #define OMAP54XX_OPTFCLKEN_UTMI_P3_CLK_SHIFT                           10
-#define OMAP54XX_OPTFCLKEN_UTMI_P3_CLK_WIDTH                           0x1
-#define OMAP54XX_OPTFCLKEN_UTMI_P3_CLK_MASK                            (1 << 10)
-
-/* Used by CM_CORE_AON_DEBUG_OUT, CM_CORE_DEBUG_OUT */
-#define OMAP54XX_OUTPUT_SHIFT                                          0
-#define OMAP54XX_OUTPUT_WIDTH                                          0x20
-#define OMAP54XX_OUTPUT_MASK                                           (0xffffffff << 0)
-
-/* Used by CM_CLKSEL_ABE */
 #define OMAP54XX_PAD_CLKS_GATE_SHIFT                                   8
-#define OMAP54XX_PAD_CLKS_GATE_WIDTH                                   0x1
-#define OMAP54XX_PAD_CLKS_GATE_MASK                                    (1 << 8)
-
-/* Used by CM_RESTORE_ST */
-#define OMAP54XX_PHASE1_COMPLETED_SHIFT                                        0
-#define OMAP54XX_PHASE1_COMPLETED_WIDTH                                        0x1
-#define OMAP54XX_PHASE1_COMPLETED_MASK                                 (1 << 0)
-
-/* Used by CM_RESTORE_ST */
-#define OMAP54XX_PHASE2A_COMPLETED_SHIFT                               1
-#define OMAP54XX_PHASE2A_COMPLETED_WIDTH                               0x1
-#define OMAP54XX_PHASE2A_COMPLETED_MASK                                        (1 << 1)
-
-/* Used by CM_RESTORE_ST */
-#define OMAP54XX_PHASE2B_COMPLETED_SHIFT                               2
-#define OMAP54XX_PHASE2B_COMPLETED_WIDTH                               0x1
-#define OMAP54XX_PHASE2B_COMPLETED_MASK                                        (1 << 2)
-
-/* Used by CM_DYN_DEP_PRESCAL */
-#define OMAP54XX_PRESCAL_SHIFT                                         0
-#define OMAP54XX_PRESCAL_WIDTH                                         0x6
-#define OMAP54XX_PRESCAL_MASK                                          (0x3f << 0)
-
-/* Used by REVISION_CM_CORE, REVISION_CM_CORE_AON */
-#define OMAP54XX_R_RTL_SHIFT                                           11
-#define OMAP54XX_R_RTL_WIDTH                                           0x5
-#define OMAP54XX_R_RTL_MASK                                            (0x1f << 11)
-
-/* Used by CM_L3INIT_USB_HOST_HS_CLKCTRL, CM_L3INIT_USB_TLL_HS_CLKCTRL */
-#define OMAP54XX_SAR_MODE_SHIFT                                                4
-#define OMAP54XX_SAR_MODE_WIDTH                                                0x1
-#define OMAP54XX_SAR_MODE_MASK                                         (1 << 4)
-
-/* Used by REVISION_CM_CORE, REVISION_CM_CORE_AON */
-#define OMAP54XX_SCHEME_SHIFT                                          30
-#define OMAP54XX_SCHEME_WIDTH                                          0x2
-#define OMAP54XX_SCHEME_MASK                                           (0x3 << 30)
-
-/* Used by CM_L4CFG_DYNAMICDEP */
-#define OMAP54XX_SDMA_DYNDEP_SHIFT                                     11
-#define OMAP54XX_SDMA_DYNDEP_WIDTH                                     0x1
-#define OMAP54XX_SDMA_DYNDEP_MASK                                      (1 << 11)
-
-/* Used by CM_IPU_STATICDEP, CM_MPU_STATICDEP */
-#define OMAP54XX_SDMA_STATDEP_SHIFT                                    11
-#define OMAP54XX_SDMA_STATDEP_WIDTH                                    0x1
-#define OMAP54XX_SDMA_STATDEP_MASK                                     (1 << 11)
-
-/* Used by CM_CORE_AON_DEBUG_CFG */
-#define OMAP54XX_SEL0_SHIFT                                            0
-#define OMAP54XX_SEL0_WIDTH                                            0x7
-#define OMAP54XX_SEL0_MASK                                             (0x7f << 0)
-
-/* Renamed from SEL0 Used by CM_CORE_DEBUG_CFG */
-#define OMAP54XX_SEL0_0_7_SHIFT                                                0
-#define OMAP54XX_SEL0_0_7_WIDTH                                                0x8
-#define OMAP54XX_SEL0_0_7_MASK                                         (0xff << 0)
-
-/* Used by CM_CORE_AON_DEBUG_CFG */
-#define OMAP54XX_SEL1_SHIFT                                            8
-#define OMAP54XX_SEL1_WIDTH                                            0x7
-#define OMAP54XX_SEL1_MASK                                             (0x7f << 8)
-
-/* Renamed from SEL1 Used by CM_CORE_DEBUG_CFG */
-#define OMAP54XX_SEL1_CORE_DEBUG_CFG_SHIFT                             8
-#define OMAP54XX_SEL1_CORE_DEBUG_CFG_WIDTH                             0x8
-#define OMAP54XX_SEL1_CORE_DEBUG_CFG_MASK                              (0xff << 8)
-
-/* Used by CM_CORE_AON_DEBUG_CFG */
-#define OMAP54XX_SEL2_SHIFT                                            16
-#define OMAP54XX_SEL2_WIDTH                                            0x7
-#define OMAP54XX_SEL2_MASK                                             (0x7f << 16)
-
-/* Renamed from SEL2 Used by CM_CORE_DEBUG_CFG */
-#define OMAP54XX_SEL2_CORE_DEBUG_CFG_SHIFT                             16
-#define OMAP54XX_SEL2_CORE_DEBUG_CFG_WIDTH                             0x8
-#define OMAP54XX_SEL2_CORE_DEBUG_CFG_MASK                              (0xff << 16)
-
-/* Used by CM_CORE_AON_DEBUG_CFG */
-#define OMAP54XX_SEL3_SHIFT                                            24
-#define OMAP54XX_SEL3_WIDTH                                            0x7
-#define OMAP54XX_SEL3_MASK                                             (0x7f << 24)
-
-/* Renamed from SEL3 Used by CM_CORE_DEBUG_CFG */
-#define OMAP54XX_SEL3_CORE_DEBUG_CFG_SHIFT                             24
-#define OMAP54XX_SEL3_CORE_DEBUG_CFG_WIDTH                             0x8
-#define OMAP54XX_SEL3_CORE_DEBUG_CFG_MASK                              (0xff << 24)
-
-/* Used by CM_CLKSEL_ABE */
 #define OMAP54XX_SLIMBUS1_CLK_GATE_SHIFT                               10
-#define OMAP54XX_SLIMBUS1_CLK_GATE_WIDTH                               0x1
-#define OMAP54XX_SLIMBUS1_CLK_GATE_MASK                                        (1 << 10)
-
-/*
- * Used by CM_ABE_AESS_CLKCTRL, CM_C2C_C2C_CLKCTRL, CM_CAM_FDIF_CLKCTRL,
- * CM_CAM_ISS_CLKCTRL, CM_DMA_DMA_SYSTEM_CLKCTRL, CM_DSP_DSP_CLKCTRL,
- * CM_DSS_BB2D_CLKCTRL, CM_DSS_DSS_CLKCTRL, CM_EMU_DEBUGSS_CLKCTRL,
- * CM_GPU_GPU_CLKCTRL, CM_IPU_IPU_CLKCTRL, CM_IVA_IVA_CLKCTRL,
- * CM_L3INIT_HSI_CLKCTRL, CM_L3INIT_IEEE1500_2_OCP_CLKCTRL,
- * CM_L3INIT_MMC1_CLKCTRL, CM_L3INIT_MMC2_CLKCTRL, CM_L3INIT_SATA_CLKCTRL,
- * CM_L3INIT_UNIPRO2_CLKCTRL, CM_L3INIT_USB_HOST_HS_CLKCTRL,
- * CM_L3INIT_USB_OTG_SS_CLKCTRL, CM_L4SEC_DMA_CRYPTO_CLKCTRL,
- * CM_MIPIEXT_LLI_CLKCTRL, CM_MPU_MPU_CLKCTRL
- */
-#define OMAP54XX_STBYST_SHIFT                                          18
-#define OMAP54XX_STBYST_WIDTH                                          0x1
-#define OMAP54XX_STBYST_MASK                                           (1 << 18)
-
-/*
- * Used by CM_IDLEST_DPLL_ABE, CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_IVA,
- * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER, CM_IDLEST_DPLL_UNIPRO1,
- * CM_IDLEST_DPLL_UNIPRO2, CM_IDLEST_DPLL_USB
- */
-#define OMAP54XX_ST_DPLL_CLK_SHIFT                                     0
-#define OMAP54XX_ST_DPLL_CLK_WIDTH                                     0x1
 #define OMAP54XX_ST_DPLL_CLK_MASK                                      (1 << 0)
-
-/*
- * Used by CM_CLKDCOLDO_DPLL_UNIPRO1, CM_CLKDCOLDO_DPLL_UNIPRO2,
- * CM_CLKDCOLDO_DPLL_USB
- */
-#define OMAP54XX_ST_DPLL_CLKDCOLDO_SHIFT                               9
-#define OMAP54XX_ST_DPLL_CLKDCOLDO_WIDTH                               0x1
-#define OMAP54XX_ST_DPLL_CLKDCOLDO_MASK                                        (1 << 9)
-
-/*
- * Used by CM_IDLEST_DPLL_ABE, CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_IVA,
- * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER, CM_IDLEST_DPLL_UNIPRO1,
- * CM_IDLEST_DPLL_UNIPRO2, CM_IDLEST_DPLL_USB
- */
-#define OMAP54XX_ST_DPLL_INIT_SHIFT                                    4
-#define OMAP54XX_ST_DPLL_INIT_WIDTH                                    0x1
-#define OMAP54XX_ST_DPLL_INIT_MASK                                     (1 << 4)
-
-/*
- * Used by CM_IDLEST_DPLL_ABE, CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_IVA,
- * CM_IDLEST_DPLL_MPU, CM_IDLEST_DPLL_PER, CM_IDLEST_DPLL_UNIPRO1,
- * CM_IDLEST_DPLL_UNIPRO2, CM_IDLEST_DPLL_USB
- */
-#define OMAP54XX_ST_DPLL_MODE_SHIFT                                    1
-#define OMAP54XX_ST_DPLL_MODE_WIDTH                                    0x3
-#define OMAP54XX_ST_DPLL_MODE_MASK                                     (0x7 << 1)
-
-/* Used by CM_CLKSEL_SYS */
 #define OMAP54XX_SYS_CLKSEL_SHIFT                                      0
 #define OMAP54XX_SYS_CLKSEL_WIDTH                                      0x3
-#define OMAP54XX_SYS_CLKSEL_MASK                                       (0x7 << 0)
-
-/*
- * Used by CM_C2C_DYNAMICDEP, CM_DSP_DYNAMICDEP, CM_EMU_DYNAMICDEP,
- * CM_IPU_DYNAMICDEP, CM_L3MAIN1_DYNAMICDEP, CM_L3MAIN2_DYNAMICDEP,
- * CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP, CM_MIPIEXT_DYNAMICDEP,
- * CM_MPU_DYNAMICDEP
- */
-#define OMAP54XX_WINDOWSIZE_SHIFT                                      24
-#define OMAP54XX_WINDOWSIZE_WIDTH                                      0x4
-#define OMAP54XX_WINDOWSIZE_MASK                                       (0xf << 24)
-
-/* Used by CM_L3MAIN1_DYNAMICDEP */
-#define OMAP54XX_WKUPAON_DYNDEP_SHIFT                                  15
-#define OMAP54XX_WKUPAON_DYNDEP_WIDTH                                  0x1
-#define OMAP54XX_WKUPAON_DYNDEP_MASK                                   (1 << 15)
-
-/*
- * Used by CM_DMA_STATICDEP, CM_DSP_STATICDEP, CM_IPU_STATICDEP,
- * CM_L3INIT_STATICDEP, CM_MPU_STATICDEP
- */
 #define OMAP54XX_WKUPAON_STATDEP_SHIFT                                 15
-#define OMAP54XX_WKUPAON_STATDEP_WIDTH                                 0x1
-#define OMAP54XX_WKUPAON_STATDEP_MASK                                  (1 << 15)
-
-/* Used by REVISION_CM_CORE, REVISION_CM_CORE_AON */
-#define OMAP54XX_X_MAJOR_SHIFT                                         8
-#define OMAP54XX_X_MAJOR_WIDTH                                         0x3
-#define OMAP54XX_X_MAJOR_MASK                                          (0x7 << 8)
-
-/* Used by REVISION_CM_CORE, REVISION_CM_CORE_AON */
-#define OMAP54XX_Y_MINOR_SHIFT                                         0
-#define OMAP54XX_Y_MINOR_WIDTH                                         0x6
-#define OMAP54XX_Y_MINOR_MASK                                          (0x3f << 0)
 #endif
index dfcc182..4a5684b 100644 (file)
@@ -110,6 +110,7 @@ void omap3630_init_late(void);
 void am35xx_init_late(void);
 void ti81xx_init_late(void);
 int omap2_common_pm_late_init(void);
+void dra7xx_init_early(void);
 
 #ifdef CONFIG_SOC_BUS
 void omap_soc_device_init(void);
index 3c1279f..73ae753 100644 (file)
@@ -327,44 +327,6 @@ static void omap_init_audio(void)
 static inline void omap_init_audio(void) {}
 #endif
 
-#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
-               defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
-
-static void __init omap_init_mcpdm(void)
-{
-       struct omap_hwmod *oh;
-       struct platform_device *pdev;
-
-       oh = omap_hwmod_lookup("mcpdm");
-       if (!oh)
-               return;
-
-       pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0);
-       WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n");
-}
-#else
-static inline void omap_init_mcpdm(void) {}
-#endif
-
-#if defined(CONFIG_SND_OMAP_SOC_DMIC) || \
-               defined(CONFIG_SND_OMAP_SOC_DMIC_MODULE)
-
-static void __init omap_init_dmic(void)
-{
-       struct omap_hwmod *oh;
-       struct platform_device *pdev;
-
-       oh = omap_hwmod_lookup("dmic");
-       if (!oh)
-               return;
-
-       pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0);
-       WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n");
-}
-#else
-static inline void omap_init_dmic(void) {}
-#endif
-
 #if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
                defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
 
@@ -565,8 +527,6 @@ static int __init omap2_init_devices(void)
        omap_init_mbox();
        /* If dtb is there, the devices will be created dynamically */
        if (!of_have_populated_dt()) {
-               omap_init_dmic();
-               omap_init_mcpdm();
                omap_init_mcspi();
                omap_init_sham();
                omap_init_aes();
index f3fdd6a..9f4795a 100644 (file)
@@ -149,7 +149,7 @@ struct omap3_gpmc_regs {
 
 static struct gpmc_client_irq gpmc_client_irq[GPMC_NR_IRQ];
 static struct irq_chip gpmc_irq_chip;
-static unsigned gpmc_irq_start;
+static int gpmc_irq_start;
 
 static struct resource gpmc_mem_root;
 static struct resource gpmc_cs_mem[GPMC_CS_NUM];
index 2dc62a2..0289adc 100644 (file)
@@ -61,7 +61,7 @@ int omap_type(void)
                val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
        } else if (cpu_is_omap44xx()) {
                val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
-       } else if (soc_is_omap54xx()) {
+       } else if (soc_is_omap54xx() || soc_is_dra7xx()) {
                val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
                val &= OMAP5_DEVICETYPE_MASK;
                val >>= 6;
@@ -116,7 +116,7 @@ static u16 tap_prod_id;
 
 void omap_get_die_id(struct omap_die_id *odi)
 {
-       if (cpu_is_omap44xx() || soc_is_omap54xx()) {
+       if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
                odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
                odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
                odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
index 4a3f06f..3656b80 100644 (file)
@@ -251,7 +251,7 @@ static struct map_desc omap44xx_io_desc[] __initdata = {
 };
 #endif
 
-#ifdef CONFIG_SOC_OMAP5
+#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 static struct map_desc omap54xx_io_desc[] __initdata = {
        {
                .virtual        = L3_54XX_VIRT,
@@ -333,7 +333,7 @@ void __init omap4_map_io(void)
 }
 #endif
 
-#ifdef CONFIG_SOC_OMAP5
+#if defined(CONFIG_SOC_OMAP5) ||  defined(CONFIG_SOC_DRA7XX)
 void __init omap5_map_io(void)
 {
        iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc));
@@ -653,6 +653,22 @@ void __init omap5_init_early(void)
 }
 #endif
 
+#ifdef CONFIG_SOC_DRA7XX
+void __init dra7xx_init_early(void)
+{
+       omap2_set_globals_tap(-1, OMAP2_L4_IO_ADDRESS(DRA7XX_TAP_BASE));
+       omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
+                                 OMAP2_L4_IO_ADDRESS(DRA7XX_CTRL_BASE));
+       omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRM_BASE));
+       omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(DRA7XX_CM_CORE_AON_BASE),
+                            OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE));
+       omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
+       omap_prm_base_init();
+       omap_cm_base_init();
+}
+#endif
+
+
 void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
                                      struct omap_sdrc_params *sdrc_cs1)
 {
index a086ba1..2d35c57 100644 (file)
@@ -30,4 +30,8 @@
 #define OMAP54XX_CTRL_BASE             0x4a002800
 #define OMAP54XX_SAR_RAM_BASE          0x4ae26000
 
+#define DRA7XX_CM_CORE_AON_BASE                0x4a005000
+#define DRA7XX_CTRL_BASE               0x4a003400
+#define DRA7XX_TAP_BASE                        0x4ae0c000
+
 #endif /* __ASM_SOC_OMAP555554XX_H */
index 7f4db12..b4ecd2c 100644 (file)
@@ -4113,7 +4113,7 @@ void __init omap_hwmod_init(void)
                soc_ops.assert_hardreset = _omap2_assert_hardreset;
                soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
                soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
-       } else if (cpu_is_omap44xx() || soc_is_omap54xx()) {
+       } else if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
                soc_ops.enable_module = _omap4_enable_module;
                soc_ops.disable_module = _omap4_disable_module;
                soc_ops.wait_target_ready = _omap4_wait_target_ready;
index 3c70f5c..b4d0474 100644 (file)
@@ -32,7 +32,6 @@
 #include "cm1_54xx.h"
 #include "cm2_54xx.h"
 #include "prm54xx.h"
-#include "prm-regbits-54xx.h"
 #include "i2c.h"
 #include "mmc.h"
 #include "wd_timer.h"
index 81f8a7c..ce1d752 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "prcm-common.h"
 #include "prcm44xx.h"
-#include "prm-regbits-54xx.h"
 #include "prm54xx.h"
 #include "prcm_mpu54xx.h"
 
index 91aa510..37fc905 100644 (file)
 
 #include "prm2xxx.h"
 
-/* Bits shared between registers */
-
-/* PRCM_IRQSTATUS_MPU, PM_IRQSTATUS_DSP, PRCM_IRQSTATUS_IVA shared bits */
-#define OMAP24XX_VOLTTRANS_ST_MASK                     (1 << 2)
-#define OMAP24XX_WKUP2_ST_MASK                         (1 << 1)
-#define OMAP24XX_WKUP1_ST_MASK                         (1 << 0)
-
-/* PRCM_IRQENABLE_MPU, PM_IRQENABLE_DSP, PRCM_IRQENABLE_IVA shared bits */
-#define OMAP24XX_VOLTTRANS_EN_MASK                     (1 << 2)
-#define OMAP24XX_WKUP2_EN_MASK                         (1 << 1)
-#define OMAP24XX_WKUP1_EN_MASK                         (1 << 0)
-
-/* PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_DSP, PM_WKDEP_MDM shared bits */
-#define OMAP24XX_EN_MPU_SHIFT                          1
-#define OMAP24XX_EN_MPU_MASK                           (1 << 1)
 #define OMAP24XX_EN_CORE_SHIFT                                 0
-#define OMAP24XX_EN_CORE_MASK                          (1 << 0)
-
-/*
- * PM_PWSTCTRL_MPU, PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSP, PM_PWSTCTRL_MDM
- * shared bits
- */
-#define OMAP24XX_MEMONSTATE_SHIFT                      10
-#define OMAP24XX_MEMONSTATE_MASK                       (0x3 << 10)
-#define OMAP24XX_MEMRETSTATE_MASK                      (1 << 3)
-
-/* PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSP, PM_PWSTCTRL_MDM shared bits */
 #define OMAP24XX_FORCESTATE_MASK                       (1 << 18)
-
-/*
- * PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP,
- * PM_PWSTST_MDM shared bits
- */
-#define OMAP24XX_CLKACTIVITY_MASK                      (1 << 19)
-
-/* PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_DSP shared bits */
-#define OMAP24XX_LASTSTATEENTERED_SHIFT                        4
-#define OMAP24XX_LASTSTATEENTERED_MASK                 (0x3 << 4)
-
-/* PM_PWSTST_MPU and PM_PWSTST_DSP shared bits */
-#define OMAP2430_MEMSTATEST_SHIFT                      10
-#define OMAP2430_MEMSTATEST_MASK                       (0x3 << 10)
-
-/* PM_PWSTST_GFX, PM_PWSTST_DSP, PM_PWSTST_MDM shared bits */
-#define OMAP24XX_POWERSTATEST_SHIFT                    0
-#define OMAP24XX_POWERSTATEST_MASK                     (0x3 << 0)
-
-
-/* Bits specific to each register */
-
-/* PRCM_REVISION */
-#define OMAP24XX_REV_SHIFT                             0
-#define OMAP24XX_REV_MASK                              (0xff << 0)
-
-/* PRCM_SYSCONFIG */
 #define OMAP24XX_AUTOIDLE_MASK                         (1 << 0)
-
-/* PRCM_IRQSTATUS_MPU specific bits */
-#define OMAP2430_DPLL_RECAL_ST_MASK                    (1 << 6)
-#define OMAP24XX_TRANSITION_ST_MASK                    (1 << 5)
-#define OMAP24XX_EVGENOFF_ST_MASK                      (1 << 4)
-#define OMAP24XX_EVGENON_ST_MASK                       (1 << 3)
-
-/* PRCM_IRQENABLE_MPU specific bits */
-#define OMAP2430_DPLL_RECAL_EN_MASK                    (1 << 6)
-#define OMAP24XX_TRANSITION_EN_MASK                    (1 << 5)
-#define OMAP24XX_EVGENOFF_EN_MASK                      (1 << 4)
-#define OMAP24XX_EVGENON_EN_MASK                       (1 << 3)
-
-/* PRCM_VOLTCTRL */
 #define OMAP24XX_AUTO_EXTVOLT_MASK                     (1 << 15)
-#define OMAP24XX_FORCE_EXTVOLT_MASK                    (1 << 14)
 #define OMAP24XX_SETOFF_LEVEL_SHIFT                    12
-#define OMAP24XX_SETOFF_LEVEL_MASK                     (0x3 << 12)
 #define OMAP24XX_MEMRETCTRL_MASK                       (1 << 8)
 #define OMAP24XX_SETRET_LEVEL_SHIFT                    6
-#define OMAP24XX_SETRET_LEVEL_MASK                     (0x3 << 6)
 #define OMAP24XX_VOLT_LEVEL_SHIFT                      0
-#define OMAP24XX_VOLT_LEVEL_MASK                       (0x3 << 0)
-
-/* PRCM_VOLTST */
-#define OMAP24XX_ST_VOLTLEVEL_SHIFT                    0
-#define OMAP24XX_ST_VOLTLEVEL_MASK                     (0x3 << 0)
-
-/* PRCM_CLKSRC_CTRL specific bits */
-
-/* PRCM_CLKOUT_CTRL */
 #define OMAP2420_CLKOUT2_EN_SHIFT                      15
-#define OMAP2420_CLKOUT2_EN_MASK                       (1 << 15)
 #define OMAP2420_CLKOUT2_DIV_SHIFT                     11
-#define OMAP2420_CLKOUT2_DIV_MASK                      (0x7 << 11)
 #define OMAP2420_CLKOUT2_DIV_WIDTH                     3
-#define OMAP2420_CLKOUT2_SOURCE_SHIFT                  8
 #define OMAP2420_CLKOUT2_SOURCE_MASK                   (0x3 << 8)
 #define OMAP24XX_CLKOUT_EN_SHIFT                       7
-#define OMAP24XX_CLKOUT_EN_MASK                                (1 << 7)
 #define OMAP24XX_CLKOUT_DIV_SHIFT                      3
-#define OMAP24XX_CLKOUT_DIV_MASK                       (0x7 << 3)
 #define OMAP24XX_CLKOUT_DIV_WIDTH                      3
-#define OMAP24XX_CLKOUT_SOURCE_SHIFT                   0
 #define OMAP24XX_CLKOUT_SOURCE_MASK                    (0x3 << 0)
-
-/* PRCM_CLKEMUL_CTRL */
 #define OMAP24XX_EMULATION_EN_SHIFT                    0
-#define OMAP24XX_EMULATION_EN_MASK                     (1 << 0)
-
-/* PRCM_CLKCFG_CTRL */
-#define OMAP24XX_VALID_CONFIG_MASK                     (1 << 0)
-
-/* PRCM_CLKCFG_STATUS */
-#define OMAP24XX_CONFIG_STATUS_MASK                    (1 << 0)
-
-/* PRCM_VOLTSETUP specific bits */
-
-/* PRCM_CLKSSETUP specific bits */
-
-/* PRCM_POLCTRL */
-#define OMAP2420_CLKOUT2_POL_MASK                      (1 << 10)
-#define OMAP24XX_CLKOUT_POL_MASK                       (1 << 9)
-#define OMAP24XX_CLKREQ_POL_MASK                       (1 << 8)
-#define OMAP2430_USE_POWEROK_MASK                      (1 << 2)
-#define OMAP2430_POWEROK_POL_MASK                      (1 << 1)
-#define OMAP24XX_EXTVOL_POL_MASK                       (1 << 0)
-
-/* RM_RSTST_MPU specific bits */
-/* 2430 calls GLOBALWMPU_RST "GLOBALWARM_RST" instead */
-
-/* PM_WKDEP_MPU specific bits */
 #define OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT             5
-#define OMAP2430_PM_WKDEP_MPU_EN_MDM_MASK              (1 << 5)
 #define OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT             2
-#define OMAP24XX_PM_WKDEP_MPU_EN_DSP_MASK              (1 << 2)
-
-/* PM_EVGENCTRL_MPU specific bits */
-
-/* PM_EVEGENONTIM_MPU specific bits */
-
-/* PM_EVEGENOFFTIM_MPU specific bits */
-
-/* PM_PWSTCTRL_MPU specific bits */
-#define OMAP2430_FORCESTATE_MASK                       (1 << 18)
-
-/* PM_PWSTST_MPU specific bits */
-/* INTRANSITION, CLKACTIVITY, POWERSTATE, MEMSTATEST are 2430 only */
-
-/* PM_WKEN1_CORE specific bits */
-
-/* PM_WKEN2_CORE specific bits */
-
-/* PM_WKST1_CORE specific bits*/
-
-/* PM_WKST2_CORE specific bits */
-
-/* PM_WKDEP_CORE specific bits*/
-#define OMAP2430_PM_WKDEP_CORE_EN_MDM_MASK             (1 << 5)
-#define OMAP24XX_PM_WKDEP_CORE_EN_GFX_MASK             (1 << 3)
-#define OMAP24XX_PM_WKDEP_CORE_EN_DSP_MASK             (1 << 2)
-
-/* PM_PWSTCTRL_CORE specific bits */
-#define OMAP24XX_MEMORYCHANGE_MASK                     (1 << 20)
-#define OMAP24XX_MEM3ONSTATE_SHIFT                     14
-#define OMAP24XX_MEM3ONSTATE_MASK                      (0x3 << 14)
-#define OMAP24XX_MEM2ONSTATE_SHIFT                     12
-#define OMAP24XX_MEM2ONSTATE_MASK                      (0x3 << 12)
-#define OMAP24XX_MEM1ONSTATE_SHIFT                     10
-#define OMAP24XX_MEM1ONSTATE_MASK                      (0x3 << 10)
-#define OMAP24XX_MEM3RETSTATE_MASK                     (1 << 5)
-#define OMAP24XX_MEM2RETSTATE_MASK                     (1 << 4)
-#define OMAP24XX_MEM1RETSTATE_MASK                     (1 << 3)
-
-/* PM_PWSTST_CORE specific bits */
-#define OMAP24XX_MEM3STATEST_SHIFT                     14
-#define OMAP24XX_MEM3STATEST_MASK                      (0x3 << 14)
-#define OMAP24XX_MEM2STATEST_SHIFT                     12
-#define OMAP24XX_MEM2STATEST_MASK                      (0x3 << 12)
-#define OMAP24XX_MEM1STATEST_SHIFT                     10
-#define OMAP24XX_MEM1STATEST_MASK                      (0x3 << 10)
-
-/* RM_RSTCTRL_GFX */
-#define OMAP24XX_GFX_RST_MASK                          (1 << 0)
-
-/* RM_RSTST_GFX specific bits */
-#define OMAP24XX_GFX_SW_RST_MASK                       (1 << 4)
-
-/* PM_PWSTCTRL_GFX specific bits */
-
-/* PM_WKDEP_GFX specific bits */
-/* 2430 often calls EN_WAKEUP "EN_WKUP" */
-
-/* RM_RSTCTRL_WKUP specific bits */
-
-/* RM_RSTTIME_WKUP specific bits */
-
-/* RM_RSTST_WKUP specific bits */
-/* 2430 calls EXTWMPU_RST "EXTWARM_RST" and GLOBALWMPU_RST "GLOBALWARM_RST" */
 #define OMAP24XX_EXTWMPU_RST_SHIFT                     6
-#define OMAP24XX_EXTWMPU_RST_MASK                      (1 << 6)
 #define OMAP24XX_SECU_WD_RST_SHIFT                     5
-#define OMAP24XX_SECU_WD_RST_MASK                      (1 << 5)
 #define OMAP24XX_MPU_WD_RST_SHIFT                      4
-#define OMAP24XX_MPU_WD_RST_MASK                       (1 << 4)
 #define OMAP24XX_SECU_VIOL_RST_SHIFT                   3
-#define OMAP24XX_SECU_VIOL_RST_MASK                    (1 << 3)
-
-/* PM_WKEN_WKUP specific bits */
-
-/* PM_WKST_WKUP specific bits */
-
-/* RM_RSTCTRL_DSP */
-#define OMAP2420_RST_IVA_MASK                          (1 << 8)
-#define OMAP24XX_RST2_DSP_MASK                         (1 << 1)
-#define OMAP24XX_RST1_DSP_MASK                         (1 << 0)
-
-/* RM_RSTST_DSP specific bits */
-/* 2430 calls GLOBALWMPU_RST "GLOBALWARM_RST" */
-#define OMAP2420_IVA_SW_RST_MASK                       (1 << 8)
-#define OMAP24XX_DSP_SW_RST2_MASK                      (1 << 5)
-#define OMAP24XX_DSP_SW_RST1_MASK                      (1 << 4)
-
-/* PM_WKDEP_DSP specific bits */
-
-/* PM_PWSTCTRL_DSP specific bits */
-/* 2430 only: MEMONSTATE, MEMRETSTATE */
-#define OMAP2420_MEMIONSTATE_SHIFT                     12
-#define OMAP2420_MEMIONSTATE_MASK                      (0x3 << 12)
-#define OMAP2420_MEMIRETSTATE_MASK                     (1 << 4)
-
-/* PM_PWSTST_DSP specific bits */
-/* MEMSTATEST is 2430 only */
-#define OMAP2420_MEMISTATEST_SHIFT                     12
-#define OMAP2420_MEMISTATEST_MASK                      (0x3 << 12)
-
-/* PRCM_IRQSTATUS_DSP specific bits */
-
-/* PRCM_IRQENABLE_DSP specific bits */
-
-/* RM_RSTCTRL_MDM */
-/* 2430 only */
-#define OMAP2430_PWRON1_MDM_MASK                       (1 << 1)
-#define OMAP2430_RST1_MDM_MASK                         (1 << 0)
-
-/* RM_RSTST_MDM specific bits */
-/* 2430 only */
-#define OMAP2430_MDM_SECU_VIOL_MASK                    (1 << 6)
-#define OMAP2430_MDM_SW_PWRON1_MASK                    (1 << 5)
-#define OMAP2430_MDM_SW_RST1_MASK                      (1 << 4)
-
-/* PM_WKEN_MDM */
-/* 2430 only */
-#define OMAP2430_PM_WKEN_MDM_EN_MDM_MASK               (1 << 0)
-
-/* PM_WKST_MDM specific bits */
-/* 2430 only */
-
-/* PM_WKDEP_MDM specific bits */
-/* 2430 only */
-
-/* PM_PWSTCTRL_MDM specific bits */
-/* 2430 only */
-#define OMAP2430_KILLDOMAINWKUP_MASK                   (1 << 19)
-
-/* PM_PWSTST_MDM specific bits */
-/* 2430 only */
-
-/* PRCM_IRQSTATUS_IVA */
-/* 2420 only */
-
-/* PRCM_IRQENABLE_IVA */
-/* 2420 only */
-
 #endif
index 0221b5c..84feece 100644 (file)
 
 #include "prm.h"
 
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_ABBOFF_ACT_EXPORT_SHIFT                 1
-#define AM33XX_ABBOFF_ACT_EXPORT_MASK                  (1 << 1)
-
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_ABBOFF_SLEEP_EXPORT_SHIFT               2
-#define AM33XX_ABBOFF_SLEEP_EXPORT_MASK                        (1 << 2)
-
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_AIPOFF_SHIFT                            8
-#define AM33XX_AIPOFF_MASK                             (1 << 8)
-
-/* Used by PM_WKUP_PWRSTST */
-#define AM33XX_DEBUGSS_MEM_STATEST_SHIFT               17
-#define AM33XX_DEBUGSS_MEM_STATEST_MASK                        (0x3 << 17)
-
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_DISABLE_RTA_EXPORT_SHIFT                        0
-#define AM33XX_DISABLE_RTA_EXPORT_MASK                 (1 << 0)
-
-/* Used by PRM_IRQENABLE_M3, PRM_IRQENABLE_MPU */
-#define AM33XX_DPLL_CORE_RECAL_EN_SHIFT                        12
-#define AM33XX_DPLL_CORE_RECAL_EN_MASK                 (1 << 12)
-
-/* Used by PRM_IRQSTATUS_M3, PRM_IRQSTATUS_MPU */
-#define AM33XX_DPLL_CORE_RECAL_ST_SHIFT                        12
-#define AM33XX_DPLL_CORE_RECAL_ST_MASK                 (1 << 12)
-
-/* Used by PRM_IRQENABLE_M3, PRM_IRQENABLE_MPU */
-#define AM33XX_DPLL_DDR_RECAL_EN_SHIFT                 14
-#define AM33XX_DPLL_DDR_RECAL_EN_MASK                  (1 << 14)
-
-/* Used by PRM_IRQSTATUS_M3, PRM_IRQSTATUS_MPU */
-#define AM33XX_DPLL_DDR_RECAL_ST_SHIFT                 14
-#define AM33XX_DPLL_DDR_RECAL_ST_MASK                  (1 << 14)
-
-/* Used by PRM_IRQENABLE_M3, PRM_IRQENABLE_MPU */
-#define AM33XX_DPLL_DISP_RECAL_EN_SHIFT                        15
-#define AM33XX_DPLL_DISP_RECAL_EN_MASK                 (1 << 15)
-
-/* Used by PRM_IRQSTATUS_M3, PRM_IRQSTATUS_MPU */
-#define AM33XX_DPLL_DISP_RECAL_ST_SHIFT                        13
-#define AM33XX_DPLL_DISP_RECAL_ST_MASK                 (1 << 13)
-
-/* Used by PRM_IRQENABLE_M3, PRM_IRQENABLE_MPU */
-#define AM33XX_DPLL_MPU_RECAL_EN_SHIFT                 11
-#define AM33XX_DPLL_MPU_RECAL_EN_MASK                  (1 << 11)
-
-/* Used by PRM_IRQSTATUS_M3, PRM_IRQSTATUS_MPU */
-#define AM33XX_DPLL_MPU_RECAL_ST_SHIFT                 11
-#define AM33XX_DPLL_MPU_RECAL_ST_MASK                  (1 << 11)
-
-/* Used by PRM_IRQENABLE_M3, PRM_IRQENABLE_MPU */
-#define AM33XX_DPLL_PER_RECAL_EN_SHIFT                 13
-#define AM33XX_DPLL_PER_RECAL_EN_MASK                  (1 << 13)
-
-/* Used by PRM_IRQSTATUS_M3, PRM_IRQSTATUS_MPU */
-#define AM33XX_DPLL_PER_RECAL_ST_SHIFT                 15
-#define AM33XX_DPLL_PER_RECAL_ST_MASK                  (1 << 15)
-
-/* Used by RM_WKUP_RSTST */
-#define AM33XX_EMULATION_M3_RST_SHIFT                  6
-#define AM33XX_EMULATION_M3_RST_MASK                   (1 << 6)
-
-/* Used by RM_MPU_RSTST */
-#define AM33XX_EMULATION_MPU_RST_SHIFT                 5
-#define AM33XX_EMULATION_MPU_RST_MASK                  (1 << 5)
-
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_ENFUNC1_EXPORT_SHIFT                    3
-#define AM33XX_ENFUNC1_EXPORT_MASK                     (1 << 3)
-
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_ENFUNC3_EXPORT_SHIFT                    5
-#define AM33XX_ENFUNC3_EXPORT_MASK                     (1 << 5)
-
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_ENFUNC4_SHIFT                           6
-#define AM33XX_ENFUNC4_MASK                            (1 << 6)
-
-/* Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_MPU_SETUP */
-#define AM33XX_ENFUNC5_SHIFT                           7
-#define AM33XX_ENFUNC5_MASK                            (1 << 7)
-
-/* Used by PRM_RSTST */
-#define AM33XX_EXTERNAL_WARM_RST_SHIFT                 5
-#define AM33XX_EXTERNAL_WARM_RST_MASK                  (1 << 5)
-
-/* Used by PRM_IRQENABLE_M3, PRM_IRQENABLE_MPU */
-#define AM33XX_FORCEWKUP_EN_SHIFT                      10
-#define AM33XX_FORCEWKUP_EN_MASK                       (1 << 10)
-
-/* Used by PRM_IRQSTATUS_M3, PRM_IRQSTATUS_MPU */
-#define AM33XX_FORCEWKUP_ST_SHIFT                      10
-#define AM33XX_FORCEWKUP_ST_MASK                       (1 << 10)
-
-/* Used by PM_GFX_PWRSTCTRL */
-#define AM33XX_GFX_MEM_ONSTATE_SHIFT                   17
 #define AM33XX_GFX_MEM_ONSTATE_MASK                    (0x3 << 17)
-
-/* Used by PM_GFX_PWRSTCTRL */
-#define AM33XX_GFX_MEM_RETSTATE_SHIFT                  6
 #define AM33XX_GFX_MEM_RETSTATE_MASK                   (1 << 6)
-
-/* Used by PM_GFX_PWRSTST */
-#define AM33XX_GFX_MEM_STATEST_SHIFT                   4
 #define AM33XX_GFX_MEM_STATEST_MASK                    (0x3 << 4)
-
-/* Used by RM_GFX_RSTCTRL, RM_GFX_RSTST */
-#define AM33XX_GFX_RST_SHIFT                           0
-#define AM33XX_GFX_RST_MASK                            (1 << 0)
-
-/* Used by PRM_RSTST */
-#define AM33XX_GLOBAL_COLD_RST_SHIFT                   0
-#define AM33XX_GLOBAL_COLD_RST_MASK                    (1 << 0)
-
-/* Used by PRM_RSTST */
-#define AM33XX_GLOBAL_WARM_SW_RST_SHIFT                        1
 #define AM33XX_GLOBAL_WARM_SW_RST_MASK                 (1 << 1)
-
-/* Used by RM_WKUP_RSTST */
-#define AM33XX_ICECRUSHER_M3_RST_SHIFT                 7
-#define AM33XX_ICECRUSHER_M3_RST_MASK                  (1 << 7)
-
-/* Used by RM_MPU_RSTST */
-#define AM33XX_ICECRUSHER_MPU_RST_SHIFT                        6
-#define AM33XX_ICECRUSHER_MPU_RST_MASK                 (1 << 6)
-
-/* Used by PRM_RSTST */
-#define AM33XX_ICEPICK_RST_SHIFT                       9
-#define AM33XX_ICEPICK_RST_MASK                                (1 << 9)
-
-/* Used by RM_PER_RSTCTRL */
-#define AM33XX_PRUSS_LRST_SHIFT                                1
-#define AM33XX_PRUSS_LRST_MASK                         (1 << 1)
-
-/* Used by PM_PER_PWRSTCTRL */
-#define AM33XX_PRUSS_MEM_ONSTATE_SHIFT                 5
+#define AM33XX_RST_GLOBAL_WARM_SW_MASK                 (1 << 0)
 #define AM33XX_PRUSS_MEM_ONSTATE_MASK                  (0x3 << 5)
-
-/* Used by PM_PER_PWRSTCTRL */
-#define AM33XX_PRUSS_MEM_RETSTATE_SHIFT                        7
 #define AM33XX_PRUSS_MEM_RETSTATE_MASK                 (1 << 7)
-
-/* Used by PM_PER_PWRSTST */
-#define AM33XX_PRUSS_MEM_STATEST_SHIFT                 23
 #define AM33XX_PRUSS_MEM_STATEST_MASK                  (0x3 << 23)
-
-/*
- * Used by PM_GFX_PWRSTST, PM_CEFUSE_PWRSTST, PM_PER_PWRSTST, PM_MPU_PWRSTST,
- * PM_WKUP_PWRSTST, PM_RTC_PWRSTST
- */
-#define AM33XX_INTRANSITION_SHIFT                      20
-#define AM33XX_INTRANSITION_MASK                       (1 << 20)
-
-/* Used by PM_CEFUSE_PWRSTST */
 #define AM33XX_LASTPOWERSTATEENTERED_SHIFT             24
 #define AM33XX_LASTPOWERSTATEENTERED_MASK              (0x3 << 24)
-
-/* Used by PM_GFX_PWRSTCTRL, PM_MPU_PWRSTCTRL, PM_RTC_PWRSTCTRL */
-#define AM33XX_LOGICRETSTATE_SHIFT                     2
 #define AM33XX_LOGICRETSTATE_MASK                      (1 << 2)
-
-/* Renamed from LOGICRETSTATE Used by PM_PER_PWRSTCTRL, PM_WKUP_PWRSTCTRL */
-#define AM33XX_LOGICRETSTATE_3_3_SHIFT                 3
 #define AM33XX_LOGICRETSTATE_3_3_MASK                  (1 << 3)
-
-/*
- * Used by PM_GFX_PWRSTST, PM_CEFUSE_PWRSTST, PM_PER_PWRSTST, PM_MPU_PWRSTST,
- * PM_WKUP_PWRSTST, PM_RTC_PWRSTST
- */
 #define AM33XX_LOGICSTATEST_SHIFT                      2
 #define AM33XX_LOGICSTATEST_MASK                       (1 << 2)
-
-/*
- * Used by PM_GFX_PWRSTCTRL, PM_CEFUSE_PWRSTCTRL, PM_PER_PWRSTCTRL,
- * PM_MPU_PWRSTCTRL, PM_WKUP_PWRSTCTRL, PM_RTC_PWRSTCTRL
- */
 #define AM33XX_LOWPOWERSTATECHANGE_SHIFT               4
 #define AM33XX_LOWPOWERSTATECHANGE_MASK                        (1 << 4)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define AM33XX_MPU_L1_ONSTATE_SHIFT                    18
 #define AM33XX_MPU_L1_ONSTATE_MASK                     (0x3 << 18)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define AM33XX_MPU_L1_RETSTATE_SHIFT                   22
 #define AM33XX_MPU_L1_RETSTATE_MASK                    (1 << 22)
-
-/* Used by PM_MPU_PWRSTST */
-#define AM33XX_MPU_L1_STATEST_SHIFT                    6
 #define AM33XX_MPU_L1_STATEST_MASK                     (0x3 << 6)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define AM33XX_MPU_L2_ONSTATE_SHIFT                    20
 #define AM33XX_MPU_L2_ONSTATE_MASK                     (0x3 << 20)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define AM33XX_MPU_L2_RETSTATE_SHIFT                   23
 #define AM33XX_MPU_L2_RETSTATE_MASK                    (1 << 23)
-
-/* Used by PM_MPU_PWRSTST */
-#define AM33XX_MPU_L2_STATEST_SHIFT                    8
 #define AM33XX_MPU_L2_STATEST_MASK                     (0x3 << 8)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define AM33XX_MPU_RAM_ONSTATE_SHIFT                   16
 #define AM33XX_MPU_RAM_ONSTATE_MASK                    (0x3 << 16)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define AM33XX_MPU_RAM_RETSTATE_SHIFT                  24
 #define AM33XX_MPU_RAM_RETSTATE_MASK                   (1 << 24)
-
-/* Used by PM_MPU_PWRSTST */
-#define AM33XX_MPU_RAM_STATEST_SHIFT                   4
 #define AM33XX_MPU_RAM_STATEST_MASK                    (0x3 << 4)
-
-/* Used by PRM_RSTST */
-#define AM33XX_MPU_SECURITY_VIOL_RST_SHIFT             2
-#define AM33XX_MPU_SECURITY_VIOL_RST_MASK              (1 << 2)
-
-/* Used by PRM_SRAM_COUNT */
-#define AM33XX_PCHARGECNT_VALUE_SHIFT                  0
-#define AM33XX_PCHARGECNT_VALUE_MASK                   (0x3f << 0)
-
-/* Used by RM_PER_RSTCTRL */
-#define AM33XX_PCI_LRST_SHIFT                          0
-#define AM33XX_PCI_LRST_MASK                           (1 << 0)
-
-/* Renamed from PCI_LRST Used by RM_PER_RSTST */
-#define AM33XX_PCI_LRST_5_5_SHIFT                      5
-#define AM33XX_PCI_LRST_5_5_MASK                       (1 << 5)
-
-/* Used by PM_PER_PWRSTCTRL */
-#define AM33XX_PER_MEM_ONSTATE_SHIFT                   25
 #define AM33XX_PER_MEM_ONSTATE_MASK                    (0x3 << 25)
-
-/* Used by PM_PER_PWRSTCTRL */
-#define AM33XX_PER_MEM_RETSTATE_SHIFT                  29
 #define AM33XX_PER_MEM_RETSTATE_MASK                   (1 << 29)
-
-/* Used by PM_PER_PWRSTST */
-#define AM33XX_PER_MEM_STATEST_SHIFT                   17
 #define AM33XX_PER_MEM_STATEST_MASK                    (0x3 << 17)
-
-/*
- * Used by PM_GFX_PWRSTCTRL, PM_CEFUSE_PWRSTCTRL, PM_PER_PWRSTCTRL,
- * PM_MPU_PWRSTCTRL
- */
-#define AM33XX_POWERSTATE_SHIFT                                0
-#define AM33XX_POWERSTATE_MASK                         (0x3 << 0)
-
-/* Used by PM_GFX_PWRSTST, PM_CEFUSE_PWRSTST, PM_PER_PWRSTST, PM_MPU_PWRSTST */
-#define AM33XX_POWERSTATEST_SHIFT                      0
-#define AM33XX_POWERSTATEST_MASK                       (0x3 << 0)
-
-/* Used by PM_PER_PWRSTCTRL */
-#define AM33XX_RAM_MEM_ONSTATE_SHIFT                   30
 #define AM33XX_RAM_MEM_ONSTATE_MASK                    (0x3 << 30)
-
-/* Used by PM_PER_PWRSTCTRL */
-#define AM33XX_RAM_MEM_RETSTATE_SHIFT                  27
 #define AM33XX_RAM_MEM_RETSTATE_MASK                   (1 << 27)
-
-/* Used by PM_PER_PWRSTST */
-#define AM33XX_RAM_MEM_STATEST_SHIFT                   21
 #define AM33XX_RAM_MEM_STATEST_MASK                    (0x3 << 21)
-
-/* Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_MPU_CTRL */
-#define AM33XX_RETMODE_ENABLE_SHIFT                    0
-#define AM33XX_RETMODE_ENABLE_MASK                     (1 << 0)
-
-/* Used by REVISION_PRM */
-#define AM33XX_REV_SHIFT                               0
-#define AM33XX_REV_MASK                                        (0xff << 0)
-
-/* Used by PRM_RSTTIME */
-#define AM33XX_RSTTIME1_SHIFT                          0
-#define AM33XX_RSTTIME1_MASK                           (0xff << 0)
-
-/* Used by PRM_RSTTIME */
-#define AM33XX_RSTTIME2_SHIFT                          8
-#define AM33XX_RSTTIME2_MASK                           (0x1f << 8)
-
-/* Used by PRM_RSTCTRL */
-#define AM33XX_RST_GLOBAL_COLD_SW_SHIFT                        1
-#define AM33XX_RST_GLOBAL_COLD_SW_MASK                 (1 << 1)
-
-/* Used by PRM_RSTCTRL */
-#define AM33XX_RST_GLOBAL_WARM_SW_SHIFT                        0
-#define AM33XX_RST_GLOBAL_WARM_SW_MASK                 (1 << 0)
-
-/* Used by PRM_SRAM_COUNT */
-#define AM33XX_SLPCNT_VALUE_SHIFT                      16
-#define AM33XX_SLPCNT_VALUE_MASK                       (0xff << 16)
-
-/* Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_MPU_CTRL */
-#define AM33XX_SRAMLDO_STATUS_SHIFT                    8
-#define AM33XX_SRAMLDO_STATUS_MASK                     (1 << 8)
-
-/* Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_MPU_CTRL */
-#define AM33XX_SRAM_IN_TRANSITION_SHIFT                        9
-#define AM33XX_SRAM_IN_TRANSITION_MASK                 (1 << 9)
-
-/* Used by PRM_SRAM_COUNT */
-#define AM33XX_STARTUP_COUNT_SHIFT                     24
-#define AM33XX_STARTUP_COUNT_MASK                      (0xff << 24)
-
-/* Used by PRM_IRQENABLE_M3, PRM_IRQENABLE_MPU */
-#define AM33XX_TRANSITION_EN_SHIFT                     8
-#define AM33XX_TRANSITION_EN_MASK                      (1 << 8)
-
-/* Used by PRM_IRQSTATUS_M3, PRM_IRQSTATUS_MPU */
-#define AM33XX_TRANSITION_ST_SHIFT                     8
-#define AM33XX_TRANSITION_ST_MASK                      (1 << 8)
-
-/* Used by PRM_SRAM_COUNT */
-#define AM33XX_VSETUPCNT_VALUE_SHIFT                   8
-#define AM33XX_VSETUPCNT_VALUE_MASK                    (0xff << 8)
-
-/* Used by PRM_RSTST */
-#define AM33XX_WDT0_RST_SHIFT                          3
-#define AM33XX_WDT0_RST_MASK                           (1 << 3)
-
-/* Used by PRM_RSTST */
-#define AM33XX_WDT1_RST_SHIFT                          4
-#define AM33XX_WDT1_RST_MASK                           (1 << 4)
-
-/* Used by RM_WKUP_RSTCTRL */
-#define AM33XX_WKUP_M3_LRST_SHIFT                      3
-#define AM33XX_WKUP_M3_LRST_MASK                       (1 << 3)
-
-/* Renamed from WKUP_M3_LRST Used by RM_WKUP_RSTST */
-#define AM33XX_WKUP_M3_LRST_5_5_SHIFT                  5
-#define AM33XX_WKUP_M3_LRST_5_5_MASK                   (1 << 5)
-
 #endif
index b0a2142..cebad56 100644 (file)
 
 #include "prm3xxx.h"
 
-/* Shared register bits */
-
-/* PRM_VC_CMD_VAL_0, PRM_VC_CMD_VAL_1 shared bits */
-#define OMAP3430_ON_SHIFT                              24
-#define OMAP3430_ON_MASK                               (0xff << 24)
-#define OMAP3430_ONLP_SHIFT                            16
-#define OMAP3430_ONLP_MASK                             (0xff << 16)
-#define OMAP3430_RET_SHIFT                             8
-#define OMAP3430_RET_MASK                              (0xff << 8)
-#define OMAP3430_OFF_SHIFT                             0
-#define OMAP3430_OFF_MASK                              (0xff << 0)
-
-/* PRM_VP1_CONFIG, PRM_VP2_CONFIG shared bits */
-#define OMAP3430_ERROROFFSET_SHIFT                     24
 #define OMAP3430_ERROROFFSET_MASK                      (0xff << 24)
-#define OMAP3430_ERRORGAIN_SHIFT                       16
 #define OMAP3430_ERRORGAIN_MASK                                (0xff << 16)
-#define OMAP3430_INITVOLTAGE_SHIFT                     8
 #define OMAP3430_INITVOLTAGE_MASK                      (0xff << 8)
 #define OMAP3430_TIMEOUTEN_MASK                                (1 << 3)
 #define OMAP3430_INITVDD_MASK                          (1 << 2)
 #define OMAP3430_FORCEUPDATE_MASK                      (1 << 1)
 #define OMAP3430_VPENABLE_MASK                         (1 << 0)
-
-/* PRM_VP1_VSTEPMIN, PRM_VP2_VSTEPMIN shared bits */
 #define OMAP3430_SMPSWAITTIMEMIN_SHIFT                 8
-#define OMAP3430_SMPSWAITTIMEMIN_MASK                  (0xffff << 8)
 #define OMAP3430_VSTEPMIN_SHIFT                                0
-#define OMAP3430_VSTEPMIN_MASK                         (0xff << 0)
-
-/* PRM_VP1_VSTEPMAX, PRM_VP2_VSTEPMAX shared bits */
 #define OMAP3430_SMPSWAITTIMEMAX_SHIFT                 8
-#define OMAP3430_SMPSWAITTIMEMAX_MASK                  (0xffff << 8)
 #define OMAP3430_VSTEPMAX_SHIFT                                0
-#define OMAP3430_VSTEPMAX_MASK                         (0xff << 0)
-
-/* PRM_VP1_VLIMITTO, PRM_VP2_VLIMITTO shared bits */
 #define OMAP3430_VDDMAX_SHIFT                          24
-#define OMAP3430_VDDMAX_MASK                           (0xff << 24)
 #define OMAP3430_VDDMIN_SHIFT                          16
-#define OMAP3430_VDDMIN_MASK                           (0xff << 16)
 #define OMAP3430_TIMEOUT_SHIFT                         0
-#define OMAP3430_TIMEOUT_MASK                          (0xffff << 0)
-
-/* PRM_VP1_VOLTAGE, PRM_VP2_VOLTAGE shared bits */
-#define OMAP3430_VPVOLTAGE_SHIFT                       0
 #define OMAP3430_VPVOLTAGE_MASK                                (0xff << 0)
-
-/* PRM_VP1_STATUS, PRM_VP2_STATUS shared bits */
-#define OMAP3430_VPINIDLE_MASK                         (1 << 0)
-
-/* PM_WKDEP_IVA2, PM_WKDEP_MPU shared bits */
 #define OMAP3430_EN_PER_SHIFT                          7
-#define OMAP3430_EN_PER_MASK                           (1 << 7)
-
-/* PM_PWSTCTRL_IVA2, PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE shared bits */
-#define OMAP3430_MEMORYCHANGE_MASK                     (1 << 3)
-
-/* PM_PWSTST_IVA2, PM_PWSTST_CORE shared bits */
 #define OMAP3430_LOGICSTATEST_MASK                     (1 << 2)
-
-/* PM_PREPWSTST_IVA2, PM_PREPWSTST_CORE shared bits */
 #define OMAP3430_LASTLOGICSTATEENTERED_MASK            (1 << 2)
-
-/*
- * PM_PREPWSTST_IVA2, PM_PREPWSTST_MPU, PM_PREPWSTST_CORE,
- * PM_PREPWSTST_GFX, PM_PREPWSTST_DSS, PM_PREPWSTST_CAM,
- * PM_PREPWSTST_PER, PM_PREPWSTST_NEON shared bits
- */
-#define OMAP3430_LASTPOWERSTATEENTERED_SHIFT           0
 #define OMAP3430_LASTPOWERSTATEENTERED_MASK            (0x3 << 0)
-
-/* PRM_IRQSTATUS_IVA2, PRM_IRQSTATUS_MPU shared bits */
-#define OMAP3430_WKUP_ST_MASK                          (1 << 0)
-
-/* PRM_IRQENABLE_IVA2, PRM_IRQENABLE_MPU shared bits */
-#define OMAP3430_WKUP_EN_MASK                          (1 << 0)
-
-/* PM_MPUGRPSEL1_CORE, PM_IVA2GRPSEL1_CORE shared bits */
-#define OMAP3430_GRPSEL_MMC2_MASK                      (1 << 25)
-#define OMAP3430_GRPSEL_MMC1_MASK                      (1 << 24)
-#define OMAP3430_GRPSEL_MCSPI4_MASK                    (1 << 21)
-#define OMAP3430_GRPSEL_MCSPI3_MASK                    (1 << 20)
-#define OMAP3430_GRPSEL_MCSPI2_MASK                    (1 << 19)
-#define OMAP3430_GRPSEL_MCSPI1_MASK                    (1 << 18)
-#define OMAP3430_GRPSEL_I2C3_SHIFT                     17
-#define OMAP3430_GRPSEL_I2C3_MASK                      (1 << 17)
-#define OMAP3430_GRPSEL_I2C2_SHIFT                     16
-#define OMAP3430_GRPSEL_I2C2_MASK                      (1 << 16)
-#define OMAP3430_GRPSEL_I2C1_SHIFT                     15
-#define OMAP3430_GRPSEL_I2C1_MASK                      (1 << 15)
-#define OMAP3430_GRPSEL_UART2_MASK                     (1 << 14)
-#define OMAP3430_GRPSEL_UART1_MASK                     (1 << 13)
-#define OMAP3430_GRPSEL_GPT11_MASK                     (1 << 12)
-#define OMAP3430_GRPSEL_GPT10_MASK                     (1 << 11)
-#define OMAP3430_GRPSEL_MCBSP5_MASK                    (1 << 10)
-#define OMAP3430_GRPSEL_MCBSP1_MASK                    (1 << 9)
-#define OMAP3430_GRPSEL_HSOTGUSB_MASK                  (1 << 4)
-#define OMAP3430_GRPSEL_D2D_MASK                       (1 << 3)
-
-/*
- * PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM,
- * PM_PWSTCTRL_PER shared bits
- */
-#define OMAP3430_MEMONSTATE_SHIFT                      16
-#define OMAP3430_MEMONSTATE_MASK                       (0x3 << 16)
-#define OMAP3430_MEMRETSTATE_MASK                      (1 << 8)
-
-/* PM_MPUGRPSEL_PER, PM_IVA2GRPSEL_PER shared bits */
 #define OMAP3630_GRPSEL_UART4_MASK                     (1 << 18)
 #define OMAP3430_GRPSEL_GPIO6_MASK                     (1 << 17)
 #define OMAP3430_GRPSEL_GPIO5_MASK                     (1 << 16)
 #define OMAP3430_GRPSEL_GPIO3_MASK                     (1 << 14)
 #define OMAP3430_GRPSEL_GPIO2_MASK                     (1 << 13)
 #define OMAP3430_GRPSEL_UART3_MASK                     (1 << 11)
-#define OMAP3430_GRPSEL_GPT9_MASK                      (1 << 10)
-#define OMAP3430_GRPSEL_GPT8_MASK                      (1 << 9)
-#define OMAP3430_GRPSEL_GPT7_MASK                      (1 << 8)
-#define OMAP3430_GRPSEL_GPT6_MASK                      (1 << 7)
-#define OMAP3430_GRPSEL_GPT5_MASK                      (1 << 6)
-#define OMAP3430_GRPSEL_GPT4_MASK                      (1 << 5)
-#define OMAP3430_GRPSEL_GPT3_MASK                      (1 << 4)
-#define OMAP3430_GRPSEL_GPT2_MASK                      (1 << 3)
 #define OMAP3430_GRPSEL_MCBSP4_MASK                    (1 << 2)
 #define OMAP3430_GRPSEL_MCBSP3_MASK                    (1 << 1)
 #define OMAP3430_GRPSEL_MCBSP2_MASK                    (1 << 0)
-
-/* PM_MPUGRPSEL_WKUP, PM_IVA2GRPSEL_WKUP shared bits */
-#define OMAP3430_GRPSEL_IO_MASK                                (1 << 8)
-#define OMAP3430_GRPSEL_SR2_MASK                       (1 << 7)
-#define OMAP3430_GRPSEL_SR1_MASK                       (1 << 6)
 #define OMAP3430_GRPSEL_GPIO1_MASK                     (1 << 3)
 #define OMAP3430_GRPSEL_GPT12_MASK                     (1 << 1)
 #define OMAP3430_GRPSEL_GPT1_MASK                      (1 << 0)
-
-/* Bits specific to each register */
-
-/* RM_RSTCTRL_IVA2 */
 #define OMAP3430_RST3_IVA2_MASK                                (1 << 2)
 #define OMAP3430_RST2_IVA2_MASK                                (1 << 1)
 #define OMAP3430_RST1_IVA2_MASK                                (1 << 0)
-
-/* RM_RSTST_IVA2 specific bits */
-#define OMAP3430_EMULATION_VSEQ_RST_MASK               (1 << 13)
-#define OMAP3430_EMULATION_VHWA_RST_MASK               (1 << 12)
-#define OMAP3430_EMULATION_IVA2_RST_MASK               (1 << 11)
-#define OMAP3430_IVA2_SW_RST3_MASK                     (1 << 10)
-#define OMAP3430_IVA2_SW_RST2_MASK                     (1 << 9)
-#define OMAP3430_IVA2_SW_RST1_MASK                     (1 << 8)
-
-/* PM_WKDEP_IVA2 specific bits */
-
-/* PM_PWSTCTRL_IVA2 specific bits */
-#define OMAP3430_L2FLATMEMONSTATE_SHIFT                        22
 #define OMAP3430_L2FLATMEMONSTATE_MASK                 (0x3 << 22)
-#define OMAP3430_SHAREDL2CACHEFLATONSTATE_SHIFT                20
 #define OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK         (0x3 << 20)
-#define OMAP3430_L1FLATMEMONSTATE_SHIFT                        18
 #define OMAP3430_L1FLATMEMONSTATE_MASK                 (0x3 << 18)
-#define OMAP3430_SHAREDL1CACHEFLATONSTATE_SHIFT                16
 #define OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK         (0x3 << 16)
 #define OMAP3430_L2FLATMEMRETSTATE_MASK                        (1 << 11)
 #define OMAP3430_SHAREDL2CACHEFLATRETSTATE_MASK                (1 << 10)
 #define OMAP3430_L1FLATMEMRETSTATE_MASK                        (1 << 9)
 #define OMAP3430_SHAREDL1CACHEFLATRETSTATE_MASK                (1 << 8)
-
-/* PM_PWSTST_IVA2 specific bits */
-#define OMAP3430_L2FLATMEMSTATEST_SHIFT                        10
 #define OMAP3430_L2FLATMEMSTATEST_MASK                 (0x3 << 10)
-#define OMAP3430_SHAREDL2CACHEFLATSTATEST_SHIFT                8
 #define OMAP3430_SHAREDL2CACHEFLATSTATEST_MASK         (0x3 << 8)
-#define OMAP3430_L1FLATMEMSTATEST_SHIFT                        6
 #define OMAP3430_L1FLATMEMSTATEST_MASK                 (0x3 << 6)
-#define OMAP3430_SHAREDL1CACHEFLATSTATEST_SHIFT                4
 #define OMAP3430_SHAREDL1CACHEFLATSTATEST_MASK         (0x3 << 4)
-
-/* PM_PREPWSTST_IVA2 specific bits */
-#define OMAP3430_LASTL2FLATMEMSTATEENTERED_SHIFT               10
 #define OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK                        (0x3 << 10)
-#define OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_SHIFT       8
 #define OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK                (0x3 << 8)
-#define OMAP3430_LASTL1FLATMEMSTATEENTERED_SHIFT               6
-#define OMAP3430_LASTL1FLATMEMSTATEENTERED_MASK                        (0x3 << 6)
-#define OMAP3430_LASTSHAREDL1CACHEFLATSTATEENTERED_SHIFT       4
-#define OMAP3430_LASTSHAREDL1CACHEFLATSTATEENTERED_MASK                (0x3 << 4)
-
-/* PRM_IRQSTATUS_IVA2 specific bits */
-#define OMAP3430_PRM_IRQSTATUS_IVA2_IVA2_DPLL_ST_MASK  (1 << 2)
-#define OMAP3430_FORCEWKUP_ST_MASK                     (1 << 1)
-
-/* PRM_IRQENABLE_IVA2 specific bits */
-#define OMAP3430_PRM_IRQENABLE_IVA2_IVA2_DPLL_RECAL_EN_MASK    (1 << 2)
-#define OMAP3430_FORCEWKUP_EN_MASK                             (1 << 1)
-
-/* PRM_REVISION specific bits */
-
-/* PRM_SYSCONFIG specific bits */
-
-/* PRM_IRQSTATUS_MPU specific bits */
 #define OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT           25
-#define OMAP3430ES2_SND_PERIPH_DPLL_ST_MASK            (1 << 25)
-#define OMAP3430_VC_TIMEOUTERR_ST_MASK                 (1 << 24)
-#define OMAP3430_VC_RAERR_ST_MASK                      (1 << 23)
-#define OMAP3430_VC_SAERR_ST_MASK                      (1 << 22)
 #define OMAP3430_VP2_TRANXDONE_ST_MASK                 (1 << 21)
-#define OMAP3430_VP2_EQVALUE_ST_MASK                   (1 << 20)
-#define OMAP3430_VP2_NOSMPSACK_ST_MASK                 (1 << 19)
-#define OMAP3430_VP2_MAXVDD_ST_MASK                    (1 << 18)
-#define OMAP3430_VP2_MINVDD_ST_MASK                    (1 << 17)
-#define OMAP3430_VP2_OPPCHANGEDONE_ST_MASK             (1 << 16)
 #define OMAP3430_VP1_TRANXDONE_ST_MASK                 (1 << 15)
-#define OMAP3430_VP1_EQVALUE_ST_MASK                   (1 << 14)
-#define OMAP3430_VP1_NOSMPSACK_ST_MASK                 (1 << 13)
-#define OMAP3430_VP1_MAXVDD_ST_MASK                    (1 << 12)
-#define OMAP3430_VP1_MINVDD_ST_MASK                    (1 << 11)
-#define OMAP3430_VP1_OPPCHANGEDONE_ST_MASK             (1 << 10)
-#define OMAP3430_IO_ST_MASK                            (1 << 9)
-#define OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_MASK   (1 << 8)
 #define OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT  8
-#define OMAP3430_MPU_DPLL_ST_MASK                      (1 << 7)
 #define OMAP3430_MPU_DPLL_ST_SHIFT                     7
-#define OMAP3430_PERIPH_DPLL_ST_MASK                   (1 << 6)
 #define OMAP3430_PERIPH_DPLL_ST_SHIFT                  6
-#define OMAP3430_CORE_DPLL_ST_MASK                     (1 << 5)
 #define OMAP3430_CORE_DPLL_ST_SHIFT                    5
-#define OMAP3430_TRANSITION_ST_MASK                    (1 << 4)
-#define OMAP3430_EVGENOFF_ST_MASK                      (1 << 3)
-#define OMAP3430_EVGENON_ST_MASK                       (1 << 2)
-#define OMAP3430_FS_USB_WKUP_ST_MASK                   (1 << 1)
-
-/* PRM_IRQENABLE_MPU specific bits */
 #define OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT             25
-#define OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_MASK              (1 << 25)
-#define OMAP3430_VC_TIMEOUTERR_EN_MASK                         (1 << 24)
-#define OMAP3430_VC_RAERR_EN_MASK                              (1 << 23)
-#define OMAP3430_VC_SAERR_EN_MASK                              (1 << 22)
-#define OMAP3430_VP2_TRANXDONE_EN_MASK                         (1 << 21)
-#define OMAP3430_VP2_EQVALUE_EN_MASK                           (1 << 20)
-#define OMAP3430_VP2_NOSMPSACK_EN_MASK                         (1 << 19)
-#define OMAP3430_VP2_MAXVDD_EN_MASK                            (1 << 18)
-#define OMAP3430_VP2_MINVDD_EN_MASK                            (1 << 17)
-#define OMAP3430_VP2_OPPCHANGEDONE_EN_MASK                     (1 << 16)
-#define OMAP3430_VP1_TRANXDONE_EN_MASK                         (1 << 15)
-#define OMAP3430_VP1_EQVALUE_EN_MASK                           (1 << 14)
-#define OMAP3430_VP1_NOSMPSACK_EN_MASK                         (1 << 13)
-#define OMAP3430_VP1_MAXVDD_EN_MASK                            (1 << 12)
-#define OMAP3430_VP1_MINVDD_EN_MASK                            (1 << 11)
-#define OMAP3430_VP1_OPPCHANGEDONE_EN_MASK                     (1 << 10)
-#define OMAP3430_IO_EN_MASK                                    (1 << 9)
-#define OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_MASK     (1 << 8)
 #define OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT    8
-#define OMAP3430_MPU_DPLL_RECAL_EN_MASK                                (1 << 7)
 #define OMAP3430_MPU_DPLL_RECAL_EN_SHIFT                       7
-#define OMAP3430_PERIPH_DPLL_RECAL_EN_MASK                     (1 << 6)
 #define OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT                    6
-#define OMAP3430_CORE_DPLL_RECAL_EN_MASK                       (1 << 5)
 #define OMAP3430_CORE_DPLL_RECAL_EN_SHIFT                      5
-#define OMAP3430_TRANSITION_EN_MASK                            (1 << 4)
-#define OMAP3430_EVGENOFF_EN_MASK                              (1 << 3)
-#define OMAP3430_EVGENON_EN_MASK                               (1 << 2)
-#define OMAP3430_FS_USB_WKUP_EN_MASK                           (1 << 1)
-
-/* RM_RSTST_MPU specific bits */
-#define OMAP3430_EMULATION_MPU_RST_MASK                        (1 << 11)
-
-/* PM_WKDEP_MPU specific bits */
 #define OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT             5
-#define OMAP3430_PM_WKDEP_MPU_EN_DSS_MASK              (1 << 5)
 #define OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT            2
-#define OMAP3430_PM_WKDEP_MPU_EN_IVA2_MASK             (1 << 2)
-
-/* PM_EVGENCTRL_MPU */
-#define OMAP3430_OFFLOADMODE_SHIFT                     3
-#define OMAP3430_OFFLOADMODE_MASK                      (0x3 << 3)
-#define OMAP3430_ONLOADMODE_SHIFT                      1
-#define OMAP3430_ONLOADMODE_MASK                       (0x3 << 1)
-#define OMAP3430_ENABLE_MASK                           (1 << 0)
-
-/* PM_EVGENONTIM_MPU */
-#define OMAP3430_ONTIMEVAL_SHIFT                       0
-#define OMAP3430_ONTIMEVAL_MASK                                (0xffffffff << 0)
-
-/* PM_EVGENOFFTIM_MPU */
-#define OMAP3430_OFFTIMEVAL_SHIFT                      0
-#define OMAP3430_OFFTIMEVAL_MASK                       (0xffffffff << 0)
-
-/* PM_PWSTCTRL_MPU specific bits */
-#define OMAP3430_L2CACHEONSTATE_SHIFT                  16
-#define OMAP3430_L2CACHEONSTATE_MASK                   (0x3 << 16)
-#define OMAP3430_L2CACHERETSTATE_MASK                  (1 << 8)
-#define OMAP3430_LOGICL1CACHERETSTATE_MASK             (1 << 2)
-
-/* PM_PWSTST_MPU specific bits */
-#define OMAP3430_L2CACHESTATEST_SHIFT                  6
-#define OMAP3430_L2CACHESTATEST_MASK                   (0x3 << 6)
-#define OMAP3430_LOGICL1CACHESTATEST_MASK              (1 << 2)
-
-/* PM_PREPWSTST_MPU specific bits */
-#define OMAP3430_LASTL2CACHESTATEENTERED_SHIFT         6
-#define OMAP3430_LASTL2CACHESTATEENTERED_MASK          (0x3 << 6)
-#define OMAP3430_LASTLOGICL1CACHESTATEENTERED_MASK     (1 << 2)
-
-/* RM_RSTCTRL_CORE */
 #define OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON_MASK                (1 << 1)
 #define OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST_MASK             (1 << 0)
-
-/* RM_RSTST_CORE specific bits */
-#define OMAP3430_MODEM_SECURITY_VIOL_RST_MASK          (1 << 10)
-#define OMAP3430_RM_RSTST_CORE_MODEM_SW_RSTPWRON_MASK  (1 << 9)
-#define OMAP3430_RM_RSTST_CORE_MODEM_SW_RST_MASK       (1 << 8)
-
-/* PM_WKEN1_CORE specific bits */
-
-/* PM_MPUGRPSEL1_CORE specific bits */
-#define OMAP3430_GRPSEL_FSHOSTUSB_MASK                 (1 << 5)
-
-/* PM_IVA2GRPSEL1_CORE specific bits */
-
-/* PM_WKST1_CORE specific bits */
-
-/* PM_PWSTCTRL_CORE specific bits */
-#define OMAP3430_MEM2ONSTATE_SHIFT                     18
-#define OMAP3430_MEM2ONSTATE_MASK                      (0x3 << 18)
-#define OMAP3430_MEM1ONSTATE_SHIFT                     16
-#define OMAP3430_MEM1ONSTATE_MASK                      (0x3 << 16)
-#define OMAP3430_MEM2RETSTATE_MASK                     (1 << 9)
-#define OMAP3430_MEM1RETSTATE_MASK                     (1 << 8)
-
-/* PM_PWSTST_CORE specific bits */
-#define OMAP3430_MEM2STATEST_SHIFT                     6
-#define OMAP3430_MEM2STATEST_MASK                      (0x3 << 6)
-#define OMAP3430_MEM1STATEST_SHIFT                     4
-#define OMAP3430_MEM1STATEST_MASK                      (0x3 << 4)
-
-/* PM_PREPWSTST_CORE specific bits */
-#define OMAP3430_LASTMEM2STATEENTERED_SHIFT            6
 #define OMAP3430_LASTMEM2STATEENTERED_MASK             (0x3 << 6)
-#define OMAP3430_LASTMEM1STATEENTERED_SHIFT            4
 #define OMAP3430_LASTMEM1STATEENTERED_MASK             (0x3 << 4)
-
-/* RM_RSTST_GFX specific bits */
-
-/* PM_WKDEP_GFX specific bits */
-#define OMAP3430_PM_WKDEP_GFX_EN_IVA2_MASK             (1 << 2)
-
-/* PM_PWSTCTRL_GFX specific bits */
-
-/* PM_PWSTST_GFX specific bits */
-
-/* PM_PREPWSTST_GFX specific bits */
-
-/* PM_WKEN_WKUP specific bits */
 #define OMAP3430_EN_IO_CHAIN_MASK                      (1 << 16)
 #define OMAP3430_EN_IO_MASK                            (1 << 8)
 #define OMAP3430_EN_GPIO1_MASK                         (1 << 3)
-
-/* PM_MPUGRPSEL_WKUP specific bits */
-
-/* PM_IVA2GRPSEL_WKUP specific bits */
-
-/* PM_WKST_WKUP specific bits */
 #define OMAP3430_ST_IO_CHAIN_MASK                      (1 << 16)
 #define OMAP3430_ST_IO_MASK                            (1 << 8)
-
-/* PRM_CLKSEL */
 #define OMAP3430_SYS_CLKIN_SEL_SHIFT                   0
-#define OMAP3430_SYS_CLKIN_SEL_MASK                    (0x7 << 0)
 #define OMAP3430_SYS_CLKIN_SEL_WIDTH                   3
-
-/* PRM_CLKOUT_CTRL */
-#define OMAP3430_CLKOUT_EN_MASK                                (1 << 7)
 #define OMAP3430_CLKOUT_EN_SHIFT                       7
-
-/* RM_RSTST_DSS specific bits */
-
-/* PM_WKEN_DSS */
 #define OMAP3430_PM_WKEN_DSS_EN_DSS_MASK               (1 << 0)
-
-/* PM_WKDEP_DSS specific bits */
-#define OMAP3430_PM_WKDEP_DSS_EN_IVA2_MASK             (1 << 2)
-
-/* PM_PWSTCTRL_DSS specific bits */
-
-/* PM_PWSTST_DSS specific bits */
-
-/* PM_PREPWSTST_DSS specific bits */
-
-/* RM_RSTST_CAM specific bits */
-
-/* PM_WKDEP_CAM specific bits */
-#define OMAP3430_PM_WKDEP_CAM_EN_IVA2_MASK             (1 << 2)
-
-/* PM_PWSTCTRL_CAM specific bits */
-
-/* PM_PWSTST_CAM specific bits */
-
-/* PM_PREPWSTST_CAM specific bits */
-
-/* PM_PWSTCTRL_USBHOST specific bits */
 #define OMAP3430ES2_SAVEANDRESTORE_SHIFT               4
-
-/* RM_RSTST_PER specific bits */
-
-/* PM_WKEN_PER specific bits */
-
-/* PM_MPUGRPSEL_PER specific bits */
-
-/* PM_IVA2GRPSEL_PER specific bits */
-
-/* PM_WKST_PER specific bits */
-
-/* PM_WKDEP_PER specific bits */
-#define OMAP3430_PM_WKDEP_PER_EN_IVA2_MASK             (1 << 2)
-
-/* PM_PWSTCTRL_PER specific bits */
-
-/* PM_PWSTST_PER specific bits */
-
-/* PM_PREPWSTST_PER specific bits */
-
-/* RM_RSTST_EMU specific bits */
-
-/* PM_PWSTST_EMU specific bits */
-
-/* PRM_VC_SMPS_SA */
 #define OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT              16
 #define OMAP3430_PRM_VC_SMPS_SA_SA1_MASK               (0x7f << 16)
 #define OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT              0
 #define OMAP3430_PRM_VC_SMPS_SA_SA0_MASK               (0x7f << 0)
-
-/* PRM_VC_SMPS_VOL_RA */
-#define OMAP3430_VOLRA1_SHIFT                          16
 #define OMAP3430_VOLRA1_MASK                           (0xff << 16)
-#define OMAP3430_VOLRA0_SHIFT                          0
 #define OMAP3430_VOLRA0_MASK                           (0xff << 0)
-
-/* PRM_VC_SMPS_CMD_RA */
-#define OMAP3430_CMDRA1_SHIFT                          16
 #define OMAP3430_CMDRA1_MASK                           (0xff << 16)
-#define OMAP3430_CMDRA0_SHIFT                          0
 #define OMAP3430_CMDRA0_MASK                           (0xff << 0)
-
-/* PRM_VC_CMD_VAL_0 specific bits */
 #define OMAP3430_VC_CMD_ON_SHIFT                       24
 #define OMAP3430_VC_CMD_ON_MASK                                (0xFF << 24)
 #define OMAP3430_VC_CMD_ONLP_SHIFT                     16
-#define OMAP3430_VC_CMD_ONLP_MASK                      (0xFF << 16)
 #define OMAP3430_VC_CMD_RET_SHIFT                      8
-#define OMAP3430_VC_CMD_RET_MASK                       (0xFF << 8)
 #define OMAP3430_VC_CMD_OFF_SHIFT                      0
-#define OMAP3430_VC_CMD_OFF_MASK                       (0xFF << 0)
-
-/* PRM_VC_CMD_VAL_1 specific bits */
-
-/* PRM_VC_CH_CONF */
-#define OMAP3430_CMD1_MASK                             (1 << 20)
-#define OMAP3430_RACEN1_MASK                           (1 << 19)
-#define OMAP3430_RAC1_MASK                             (1 << 18)
-#define OMAP3430_RAV1_MASK                             (1 << 17)
-#define OMAP3430_PRM_VC_CH_CONF_SA1_MASK               (1 << 16)
-#define OMAP3430_CMD0_MASK                             (1 << 4)
-#define OMAP3430_RACEN0_MASK                           (1 << 3)
-#define OMAP3430_RAC0_MASK                             (1 << 2)
-#define OMAP3430_RAV0_MASK                             (1 << 1)
-#define OMAP3430_PRM_VC_CH_CONF_SA0_MASK               (1 << 0)
-
-/* PRM_VC_I2C_CFG */
-#define OMAP3430_HSMASTER_MASK                         (1 << 5)
-#define OMAP3430_SREN_MASK                             (1 << 4)
 #define OMAP3430_HSEN_MASK                             (1 << 3)
-#define OMAP3430_MCODE_SHIFT                           0
 #define OMAP3430_MCODE_MASK                            (0x7 << 0)
-
-/* PRM_VC_BYPASS_VAL */
 #define OMAP3430_VALID_MASK                            (1 << 24)
 #define OMAP3430_DATA_SHIFT                            16
-#define OMAP3430_DATA_MASK                             (0xff << 16)
 #define OMAP3430_REGADDR_SHIFT                         8
-#define OMAP3430_REGADDR_MASK                          (0xff << 8)
 #define OMAP3430_SLAVEADDR_SHIFT                       0
-#define OMAP3430_SLAVEADDR_MASK                                (0x7f << 0)
-
-/* PRM_RSTCTRL */
-#define OMAP3430_RST_DPLL3_MASK                                (1 << 2)
-#define OMAP3430_RST_GS_MASK                           (1 << 1)
-
-/* PRM_RSTTIME */
-#define OMAP3430_RSTTIME2_SHIFT                                8
-#define OMAP3430_RSTTIME2_MASK                         (0x1f << 8)
-#define OMAP3430_RSTTIME1_SHIFT                                0
-#define OMAP3430_RSTTIME1_MASK                         (0xff << 0)
-
-/* PRM_RSTST */
 #define OMAP3430_ICECRUSHER_RST_SHIFT                  10
-#define OMAP3430_ICECRUSHER_RST_MASK                   (1 << 10)
 #define OMAP3430_ICEPICK_RST_SHIFT                     9
-#define OMAP3430_ICEPICK_RST_MASK                      (1 << 9)
 #define OMAP3430_VDD2_VOLTAGE_MANAGER_RST_SHIFT                8
-#define OMAP3430_VDD2_VOLTAGE_MANAGER_RST_MASK         (1 << 8)
 #define OMAP3430_VDD1_VOLTAGE_MANAGER_RST_SHIFT                7
-#define OMAP3430_VDD1_VOLTAGE_MANAGER_RST_MASK         (1 << 7)
 #define OMAP3430_EXTERNAL_WARM_RST_SHIFT               6
-#define OMAP3430_EXTERNAL_WARM_RST_MASK                        (1 << 6)
 #define OMAP3430_SECURE_WD_RST_SHIFT                   5
-#define OMAP3430_SECURE_WD_RST_MASK                    (1 << 5)
 #define OMAP3430_MPU_WD_RST_SHIFT                      4
-#define OMAP3430_MPU_WD_RST_MASK                       (1 << 4)
 #define OMAP3430_SECURITY_VIOL_RST_SHIFT               3
-#define OMAP3430_SECURITY_VIOL_RST_MASK                        (1 << 3)
 #define OMAP3430_GLOBAL_SW_RST_SHIFT                   1
-#define OMAP3430_GLOBAL_SW_RST_MASK                    (1 << 1)
 #define OMAP3430_GLOBAL_COLD_RST_SHIFT                 0
 #define OMAP3430_GLOBAL_COLD_RST_MASK                  (1 << 0)
-
-/* PRM_VOLTCTRL */
-#define OMAP3430_SEL_VMODE_MASK                                (1 << 4)
 #define OMAP3430_SEL_OFF_MASK                          (1 << 3)
 #define OMAP3430_AUTO_OFF_MASK                         (1 << 2)
-#define OMAP3430_AUTO_RET_MASK                         (1 << 1)
-#define OMAP3430_AUTO_SLEEP_MASK                       (1 << 0)
-
-/* PRM_SRAM_PCHARGE */
-#define OMAP3430_PCHARGE_TIME_SHIFT                    0
-#define OMAP3430_PCHARGE_TIME_MASK                     (0xff << 0)
-
-/* PRM_CLKSRC_CTRL */
-#define OMAP3430_SYSCLKDIV_SHIFT                       6
-#define OMAP3430_SYSCLKDIV_MASK                                (0x3 << 6)
-#define OMAP3430_AUTOEXTCLKMODE_SHIFT                  3
-#define OMAP3430_AUTOEXTCLKMODE_MASK                   (0x3 << 3)
-#define OMAP3430_SYSCLKSEL_SHIFT                       0
-#define OMAP3430_SYSCLKSEL_MASK                                (0x3 << 0)
-
-/* PRM_VOLTSETUP1 */
-#define OMAP3430_SETUP_TIME2_SHIFT                     16
 #define OMAP3430_SETUP_TIME2_MASK                      (0xffff << 16)
-#define OMAP3430_SETUP_TIME1_SHIFT                     0
 #define OMAP3430_SETUP_TIME1_MASK                      (0xffff << 0)
-
-/* PRM_VOLTOFFSET */
-#define OMAP3430_OFFSET_TIME_SHIFT                     0
-#define OMAP3430_OFFSET_TIME_MASK                      (0xffff << 0)
-
-/* PRM_CLKSETUP */
-#define OMAP3430_SETUP_TIME_SHIFT                      0
-#define OMAP3430_SETUP_TIME_MASK                       (0xffff << 0)
-
-/* PRM_POLCTRL */
-#define OMAP3430_OFFMODE_POL_MASK                      (1 << 3)
-#define OMAP3430_CLKOUT_POL_MASK                       (1 << 2)
-#define OMAP3430_CLKREQ_POL_MASK                       (1 << 1)
-#define OMAP3430_EXTVOL_POL_MASK                       (1 << 0)
-
-/* PRM_VOLTSETUP2 */
-#define OMAP3430_OFFMODESETUPTIME_SHIFT                        0
-#define OMAP3430_OFFMODESETUPTIME_MASK                 (0xffff << 0)
-
-/* PRM_VP1_CONFIG specific bits */
-
-/* PRM_VP1_VSTEPMIN specific bits */
-
-/* PRM_VP1_VSTEPMAX specific bits */
-
-/* PRM_VP1_VLIMITTO specific bits */
-
-/* PRM_VP1_VOLTAGE specific bits */
-
-/* PRM_VP1_STATUS specific bits */
-
-/* PRM_VP2_CONFIG specific bits */
-
-/* PRM_VP2_VSTEPMIN specific bits */
-
-/* PRM_VP2_VSTEPMAX specific bits */
-
-/* PRM_VP2_VLIMITTO specific bits */
-
-/* PRM_VP2_VOLTAGE specific bits */
-
-/* PRM_VP2_STATUS specific bits */
-
-/* RM_RSTST_NEON specific bits */
-
-/* PM_WKDEP_NEON specific bits */
-
-/* PM_PWSTCTRL_NEON specific bits */
-
-/* PM_PWSTST_NEON specific bits */
-
-/* PM_PREPWSTST_NEON specific bits */
-
 #endif
index 3cb247b..b1c7a33 100644 (file)
 #ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 #define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
 
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP
- */
-#define OMAP4430_ABBOFF_ACT_EXPORT_SHIFT                               1
-#define OMAP4430_ABBOFF_ACT_EXPORT_MASK                                        (1 << 1)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP
- */
-#define OMAP4430_ABBOFF_SLEEP_EXPORT_SHIFT                             2
-#define OMAP4430_ABBOFF_SLEEP_EXPORT_MASK                              (1 << 2)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_ABB_IVA_DONE_EN_SHIFT                                 31
-#define OMAP4430_ABB_IVA_DONE_EN_MASK                                  (1 << 31)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_ABB_IVA_DONE_ST_SHIFT                                 31
-#define OMAP4430_ABB_IVA_DONE_ST_MASK                                  (1 << 31)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_ABB_MPU_DONE_EN_SHIFT                                 7
-#define OMAP4430_ABB_MPU_DONE_EN_MASK                                  (1 << 7)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_ABB_MPU_DONE_ST_SHIFT                                 7
-#define OMAP4430_ABB_MPU_DONE_ST_MASK                                  (1 << 7)
-
-/* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */
-#define OMAP4430_ACTIVE_FBB_SEL_SHIFT                                  2
-#define OMAP4430_ACTIVE_FBB_SEL_MASK                                   (1 << 2)
-
-/* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */
-#define OMAP4430_ACTIVE_RBB_SEL_SHIFT                                  1
-#define OMAP4430_ACTIVE_RBB_SEL_MASK                                   (1 << 1)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP4430_AESSMEM_ONSTATE_SHIFT                                 16
-#define OMAP4430_AESSMEM_ONSTATE_MASK                                  (0x3 << 16)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP4430_AESSMEM_RETSTATE_SHIFT                                        8
-#define OMAP4430_AESSMEM_RETSTATE_MASK                                 (1 << 8)
-
-/* Used by PM_ABE_PWRSTST */
-#define OMAP4430_AESSMEM_STATEST_SHIFT                                 4
-#define OMAP4430_AESSMEM_STATEST_MASK                                  (0x3 << 4)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP
- */
-#define OMAP4430_AIPOFF_SHIFT                                          8
-#define OMAP4430_AIPOFF_MASK                                           (1 << 8)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_AUTO_CTRL_VDD_CORE_L_SHIFT                            0
-#define OMAP4430_AUTO_CTRL_VDD_CORE_L_MASK                             (0x3 << 0)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_AUTO_CTRL_VDD_IVA_L_SHIFT                             4
-#define OMAP4430_AUTO_CTRL_VDD_IVA_L_MASK                              (0x3 << 4)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_AUTO_CTRL_VDD_MPU_L_SHIFT                             2
-#define OMAP4430_AUTO_CTRL_VDD_MPU_L_MASK                              (0x3 << 2)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_BYPS_RA_ERR_SHIFT                                     25
-#define OMAP4430_BYPS_RA_ERR_MASK                                      (1 << 25)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_BYPS_SA_ERR_SHIFT                                     24
-#define OMAP4430_BYPS_SA_ERR_MASK                                      (1 << 24)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_BYPS_TIMEOUT_ERR_SHIFT                                        26
-#define OMAP4430_BYPS_TIMEOUT_ERR_MASK                                 (1 << 26)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_C2C_RST_SHIFT                                         10
-#define OMAP4430_C2C_RST_MASK                                          (1 << 10)
-
-/* Used by PM_CAM_PWRSTCTRL */
-#define OMAP4430_CAM_MEM_ONSTATE_SHIFT                                 16
-#define OMAP4430_CAM_MEM_ONSTATE_MASK                                  (0x3 << 16)
-
-/* Used by PM_CAM_PWRSTST */
-#define OMAP4430_CAM_MEM_STATEST_SHIFT                                 4
-#define OMAP4430_CAM_MEM_STATEST_MASK                                  (0x3 << 4)
-
-/* Used by PRM_CLKREQCTRL */
-#define OMAP4430_CLKREQ_COND_SHIFT                                     0
-#define OMAP4430_CLKREQ_COND_MASK                                      (0x7 << 0)
-
-/* Used by PRM_VC_VAL_SMPS_RA_CMD */
-#define OMAP4430_CMDRA_VDD_CORE_L_SHIFT                                        0
 #define OMAP4430_CMDRA_VDD_CORE_L_MASK                                 (0xff << 0)
-
-/* Used by PRM_VC_VAL_SMPS_RA_CMD */
-#define OMAP4430_CMDRA_VDD_IVA_L_SHIFT                                 8
 #define OMAP4430_CMDRA_VDD_IVA_L_MASK                                  (0xff << 8)
-
-/* Used by PRM_VC_VAL_SMPS_RA_CMD */
-#define OMAP4430_CMDRA_VDD_MPU_L_SHIFT                                 16
 #define OMAP4430_CMDRA_VDD_MPU_L_MASK                                  (0xff << 16)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_CMD_VDD_CORE_L_SHIFT                                  4
-#define OMAP4430_CMD_VDD_CORE_L_MASK                                   (1 << 4)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_CMD_VDD_IVA_L_SHIFT                                   12
-#define OMAP4430_CMD_VDD_IVA_L_MASK                                    (1 << 12)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_CMD_VDD_MPU_L_SHIFT                                   17
-#define OMAP4430_CMD_VDD_MPU_L_MASK                                    (1 << 17)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_CORE_OCMRAM_ONSTATE_SHIFT                             18
-#define OMAP4430_CORE_OCMRAM_ONSTATE_MASK                              (0x3 << 18)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_CORE_OCMRAM_RETSTATE_SHIFT                            9
-#define OMAP4430_CORE_OCMRAM_RETSTATE_MASK                             (1 << 9)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP4430_CORE_OCMRAM_STATEST_SHIFT                             6
-#define OMAP4430_CORE_OCMRAM_STATEST_MASK                              (0x3 << 6)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_CORE_OTHER_BANK_ONSTATE_SHIFT                         16
-#define OMAP4430_CORE_OTHER_BANK_ONSTATE_MASK                          (0x3 << 16)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_CORE_OTHER_BANK_RETSTATE_SHIFT                                8
-#define OMAP4430_CORE_OTHER_BANK_RETSTATE_MASK                         (1 << 8)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP4430_CORE_OTHER_BANK_STATEST_SHIFT                         4
-#define OMAP4430_CORE_OTHER_BANK_STATEST_MASK                          (0x3 << 4)
-
-/* Used by REVISION_PRM */
-#define OMAP4430_CUSTOM_SHIFT                                          6
-#define OMAP4430_CUSTOM_MASK                                           (0x3 << 6)
-
-/* Used by PRM_VC_VAL_BYPASS */
 #define OMAP4430_DATA_SHIFT                                            16
-#define OMAP4430_DATA_MASK                                             (0xff << 16)
-
-/* Used by PRM_DEVICE_OFF_CTRL */
-#define OMAP4430_DEVICE_OFF_ENABLE_SHIFT                               0
-#define OMAP4430_DEVICE_OFF_ENABLE_MASK                                        (1 << 0)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP4430_DFILTEREN_SHIFT                                       6
-#define OMAP4430_DFILTEREN_MASK                                                (1 << 6)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP, PRM_SRAM_WKUP_SETUP
- */
-#define OMAP4430_DISABLE_RTA_EXPORT_SHIFT                              0
-#define OMAP4430_DISABLE_RTA_EXPORT_MASK                               (1 << 0)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU, PRM_IRQENABLE_TESLA */
-#define OMAP4430_DPLL_ABE_RECAL_EN_SHIFT                               4
-#define OMAP4430_DPLL_ABE_RECAL_EN_MASK                                        (1 << 4)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU, PRM_IRQSTATUS_TESLA */
-#define OMAP4430_DPLL_ABE_RECAL_ST_SHIFT                               4
-#define OMAP4430_DPLL_ABE_RECAL_ST_MASK                                        (1 << 4)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_DPLL_CORE_RECAL_EN_SHIFT                              0
-#define OMAP4430_DPLL_CORE_RECAL_EN_MASK                               (1 << 0)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_DPLL_CORE_RECAL_ST_SHIFT                              0
-#define OMAP4430_DPLL_CORE_RECAL_ST_MASK                               (1 << 0)
-
-/* Used by PRM_IRQENABLE_MPU */
-#define OMAP4430_DPLL_DDRPHY_RECAL_EN_SHIFT                            6
-#define OMAP4430_DPLL_DDRPHY_RECAL_EN_MASK                             (1 << 6)
-
-/* Used by PRM_IRQSTATUS_MPU */
-#define OMAP4430_DPLL_DDRPHY_RECAL_ST_SHIFT                            6
-#define OMAP4430_DPLL_DDRPHY_RECAL_ST_MASK                             (1 << 6)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU, PRM_IRQENABLE_TESLA */
-#define OMAP4430_DPLL_IVA_RECAL_EN_SHIFT                               2
-#define OMAP4430_DPLL_IVA_RECAL_EN_MASK                                        (1 << 2)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU, PRM_IRQSTATUS_TESLA */
-#define OMAP4430_DPLL_IVA_RECAL_ST_SHIFT                               2
-#define OMAP4430_DPLL_IVA_RECAL_ST_MASK                                        (1 << 2)
-
-/* Used by PRM_IRQENABLE_MPU */
-#define OMAP4430_DPLL_MPU_RECAL_EN_SHIFT                               1
-#define OMAP4430_DPLL_MPU_RECAL_EN_MASK                                        (1 << 1)
-
-/* Used by PRM_IRQSTATUS_MPU */
-#define OMAP4430_DPLL_MPU_RECAL_ST_SHIFT                               1
-#define OMAP4430_DPLL_MPU_RECAL_ST_MASK                                        (1 << 1)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_DPLL_PER_RECAL_EN_SHIFT                               3
-#define OMAP4430_DPLL_PER_RECAL_EN_MASK                                        (1 << 3)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_DPLL_PER_RECAL_ST_SHIFT                               3
-#define OMAP4430_DPLL_PER_RECAL_ST_MASK                                        (1 << 3)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_DPLL_UNIPRO_RECAL_EN_SHIFT                            7
-#define OMAP4430_DPLL_UNIPRO_RECAL_EN_MASK                             (1 << 7)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_DPLL_UNIPRO_RECAL_ST_SHIFT                            7
-#define OMAP4430_DPLL_UNIPRO_RECAL_ST_MASK                             (1 << 7)
-
-/* Used by PM_DSS_PWRSTCTRL */
-#define OMAP4430_DSS_MEM_ONSTATE_SHIFT                                 16
-#define OMAP4430_DSS_MEM_ONSTATE_MASK                                  (0x3 << 16)
-
-/* Used by PM_DSS_PWRSTCTRL */
-#define OMAP4430_DSS_MEM_RETSTATE_SHIFT                                        8
-#define OMAP4430_DSS_MEM_RETSTATE_MASK                                 (1 << 8)
-
-/* Used by PM_DSS_PWRSTST */
-#define OMAP4430_DSS_MEM_STATEST_SHIFT                                 4
-#define OMAP4430_DSS_MEM_STATEST_MASK                                  (0x3 << 4)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_DUCATI_L2RAM_ONSTATE_SHIFT                            20
-#define OMAP4430_DUCATI_L2RAM_ONSTATE_MASK                             (0x3 << 20)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_DUCATI_L2RAM_RETSTATE_SHIFT                           10
-#define OMAP4430_DUCATI_L2RAM_RETSTATE_MASK                            (1 << 10)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP4430_DUCATI_L2RAM_STATEST_SHIFT                            8
-#define OMAP4430_DUCATI_L2RAM_STATEST_MASK                             (0x3 << 8)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_DUCATI_UNICACHE_ONSTATE_SHIFT                         22
-#define OMAP4430_DUCATI_UNICACHE_ONSTATE_MASK                          (0x3 << 22)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_DUCATI_UNICACHE_RETSTATE_SHIFT                                11
-#define OMAP4430_DUCATI_UNICACHE_RETSTATE_MASK                         (1 << 11)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP4430_DUCATI_UNICACHE_STATEST_SHIFT                         10
-#define OMAP4430_DUCATI_UNICACHE_STATEST_MASK                          (0x3 << 10)
-
-/* Used by PRM_DEVICE_OFF_CTRL */
-#define OMAP4460_EMIF1_OFFWKUP_DISABLE_SHIFT                           8
-#define OMAP4460_EMIF1_OFFWKUP_DISABLE_MASK                            (1 << 8)
-
-/* Used by PRM_DEVICE_OFF_CTRL */
-#define OMAP4460_EMIF2_OFFWKUP_DISABLE_SHIFT                           9
-#define OMAP4460_EMIF2_OFFWKUP_DISABLE_MASK                            (1 << 9)
-
-/* Used by RM_MPU_RSTST */
-#define OMAP4430_EMULATION_RST_SHIFT                                   0
-#define OMAP4430_EMULATION_RST_MASK                                    (1 << 0)
-
-/* Used by RM_DUCATI_RSTST */
-#define OMAP4430_EMULATION_RST1ST_SHIFT                                        3
-#define OMAP4430_EMULATION_RST1ST_MASK                                 (1 << 3)
-
-/* Used by RM_DUCATI_RSTST */
-#define OMAP4430_EMULATION_RST2ST_SHIFT                                        4
-#define OMAP4430_EMULATION_RST2ST_MASK                                 (1 << 4)
-
-/* Used by RM_IVAHD_RSTST */
-#define OMAP4430_EMULATION_SEQ1_RST1ST_SHIFT                           3
-#define OMAP4430_EMULATION_SEQ1_RST1ST_MASK                            (1 << 3)
-
-/* Used by RM_IVAHD_RSTST */
-#define OMAP4430_EMULATION_SEQ2_RST2ST_SHIFT                           4
-#define OMAP4430_EMULATION_SEQ2_RST2ST_MASK                            (1 << 4)
-
-/* Used by PM_EMU_PWRSTCTRL */
-#define OMAP4430_EMU_BANK_ONSTATE_SHIFT                                        16
-#define OMAP4430_EMU_BANK_ONSTATE_MASK                                 (0x3 << 16)
-
-/* Used by PM_EMU_PWRSTST */
-#define OMAP4430_EMU_BANK_STATEST_SHIFT                                        4
-#define OMAP4430_EMU_BANK_STATEST_MASK                                 (0x3 << 4)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP
- */
-#define OMAP4430_ENFUNC1_EXPORT_SHIFT                                  3
-#define OMAP4430_ENFUNC1_EXPORT_MASK                                   (1 << 3)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP
- */
-#define OMAP4430_ENFUNC3_EXPORT_SHIFT                                  5
-#define OMAP4430_ENFUNC3_EXPORT_MASK                                   (1 << 5)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP
- */
-#define OMAP4430_ENFUNC4_SHIFT                                         6
-#define OMAP4430_ENFUNC4_MASK                                          (1 << 6)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
- * PRM_LDO_SRAM_MPU_SETUP
- */
-#define OMAP4430_ENFUNC5_SHIFT                                         7
-#define OMAP4430_ENFUNC5_MASK                                          (1 << 7)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP4430_ERRORGAIN_SHIFT                                       16
 #define OMAP4430_ERRORGAIN_MASK                                                (0xff << 16)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP4430_ERROROFFSET_SHIFT                                     24
 #define OMAP4430_ERROROFFSET_MASK                                      (0xff << 24)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_EXTERNAL_WARM_RST_SHIFT                               5
-#define OMAP4430_EXTERNAL_WARM_RST_MASK                                        (1 << 5)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP4430_FORCEUPDATE_SHIFT                                     1
 #define OMAP4430_FORCEUPDATE_MASK                                      (1 << 1)
-
-/* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_IVA_VOLTAGE, PRM_VP_MPU_VOLTAGE */
-#define OMAP4430_FORCEUPDATEWAIT_SHIFT                                 8
-#define OMAP4430_FORCEUPDATEWAIT_MASK                                  (0xffffff << 8)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_TESLA */
-#define OMAP4430_FORCEWKUP_EN_SHIFT                                    10
-#define OMAP4430_FORCEWKUP_EN_MASK                                     (1 << 10)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_TESLA */
-#define OMAP4430_FORCEWKUP_ST_SHIFT                                    10
-#define OMAP4430_FORCEWKUP_ST_MASK                                     (1 << 10)
-
-/* Used by REVISION_PRM */
-#define OMAP4430_FUNC_SHIFT                                            16
-#define OMAP4430_FUNC_MASK                                             (0xfff << 16)
-
-/* Used by PM_GFX_PWRSTCTRL */
-#define OMAP4430_GFX_MEM_ONSTATE_SHIFT                                 16
-#define OMAP4430_GFX_MEM_ONSTATE_MASK                                  (0x3 << 16)
-
-/* Used by PM_GFX_PWRSTST */
-#define OMAP4430_GFX_MEM_STATEST_SHIFT                                 4
-#define OMAP4430_GFX_MEM_STATEST_MASK                                  (0x3 << 4)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_GLOBAL_COLD_RST_SHIFT                                 0
-#define OMAP4430_GLOBAL_COLD_RST_MASK                                  (1 << 0)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_GLOBAL_WARM_SW_RST_SHIFT                              1
-#define OMAP4430_GLOBAL_WARM_SW_RST_MASK                               (1 << 1)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP4430_GLOBAL_WUEN_SHIFT                                     16
 #define OMAP4430_GLOBAL_WUEN_MASK                                      (1 << 16)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP4430_HSMCODE_SHIFT                                         0
 #define OMAP4430_HSMCODE_MASK                                          (0x7 << 0)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP4430_HSMODEEN_SHIFT                                                3
 #define OMAP4430_HSMODEEN_MASK                                         (1 << 3)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
-#define OMAP4430_HSSCLH_SHIFT                                          16
-#define OMAP4430_HSSCLH_MASK                                           (0xff << 16)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
 #define OMAP4430_HSSCLL_SHIFT                                          24
-#define OMAP4430_HSSCLL_MASK                                           (0xff << 24)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_HWA_MEM_ONSTATE_SHIFT                                 16
-#define OMAP4430_HWA_MEM_ONSTATE_MASK                                  (0x3 << 16)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_HWA_MEM_RETSTATE_SHIFT                                        8
-#define OMAP4430_HWA_MEM_RETSTATE_MASK                                 (1 << 8)
-
-/* Used by PM_IVAHD_PWRSTST */
-#define OMAP4430_HWA_MEM_STATEST_SHIFT                                 4
-#define OMAP4430_HWA_MEM_STATEST_MASK                                  (0x3 << 4)
-
-/* Used by RM_MPU_RSTST */
-#define OMAP4430_ICECRUSHER_MPU_RST_SHIFT                              1
-#define OMAP4430_ICECRUSHER_MPU_RST_MASK                               (1 << 1)
-
-/* Used by RM_DUCATI_RSTST */
-#define OMAP4430_ICECRUSHER_RST1ST_SHIFT                               5
-#define OMAP4430_ICECRUSHER_RST1ST_MASK                                        (1 << 5)
-
-/* Used by RM_DUCATI_RSTST */
-#define OMAP4430_ICECRUSHER_RST2ST_SHIFT                               6
-#define OMAP4430_ICECRUSHER_RST2ST_MASK                                        (1 << 6)
-
-/* Used by RM_IVAHD_RSTST */
-#define OMAP4430_ICECRUSHER_SEQ1_RST1ST_SHIFT                          5
-#define OMAP4430_ICECRUSHER_SEQ1_RST1ST_MASK                           (1 << 5)
-
-/* Used by RM_IVAHD_RSTST */
-#define OMAP4430_ICECRUSHER_SEQ2_RST2ST_SHIFT                          6
-#define OMAP4430_ICECRUSHER_SEQ2_RST2ST_MASK                           (1 << 6)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_ICEPICK_RST_SHIFT                                     9
-#define OMAP4430_ICEPICK_RST_MASK                                      (1 << 9)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP4430_INITVDD_SHIFT                                         2
 #define OMAP4430_INITVDD_MASK                                          (1 << 2)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP4430_INITVOLTAGE_SHIFT                                     8
 #define OMAP4430_INITVOLTAGE_MASK                                      (0xff << 8)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CAM_PWRSTST, PM_CEFUSE_PWRSTST, PM_CORE_PWRSTST,
- * PM_DSS_PWRSTST, PM_EMU_PWRSTST, PM_GFX_PWRSTST, PM_IVAHD_PWRSTST,
- * PM_L3INIT_PWRSTST, PM_L4PER_PWRSTST, PM_MPU_PWRSTST, PM_TESLA_PWRSTST
- */
-#define OMAP4430_INTRANSITION_SHIFT                                    20
-#define OMAP4430_INTRANSITION_MASK                                     (1 << 20)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_IO_EN_SHIFT                                           9
-#define OMAP4430_IO_EN_MASK                                            (1 << 9)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP4430_IO_ON_STATUS_SHIFT                                    5
-#define OMAP4430_IO_ON_STATUS_MASK                                     (1 << 5)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_IO_ST_SHIFT                                           9
-#define OMAP4430_IO_ST_MASK                                            (1 << 9)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP4430_ISOCLK_OVERRIDE_SHIFT                                 0
-#define OMAP4430_ISOCLK_OVERRIDE_MASK                                  (1 << 0)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP4430_ISOCLK_STATUS_SHIFT                                   1
-#define OMAP4430_ISOCLK_STATUS_MASK                                    (1 << 1)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP4430_ISOOVR_EXTEND_SHIFT                                   4
-#define OMAP4430_ISOOVR_EXTEND_MASK                                    (1 << 4)
-
-/* Used by PRM_IO_COUNT */
-#define OMAP4430_ISO_2_ON_TIME_SHIFT                                   0
-#define OMAP4430_ISO_2_ON_TIME_MASK                                    (0xff << 0)
-
-/* Used by PM_L3INIT_PWRSTCTRL */
-#define OMAP4430_L3INIT_BANK1_ONSTATE_SHIFT                            16
-#define OMAP4430_L3INIT_BANK1_ONSTATE_MASK                             (0x3 << 16)
-
-/* Used by PM_L3INIT_PWRSTCTRL */
-#define OMAP4430_L3INIT_BANK1_RETSTATE_SHIFT                           8
-#define OMAP4430_L3INIT_BANK1_RETSTATE_MASK                            (1 << 8)
-
-/* Used by PM_L3INIT_PWRSTST */
-#define OMAP4430_L3INIT_BANK1_STATEST_SHIFT                            4
-#define OMAP4430_L3INIT_BANK1_STATEST_MASK                             (0x3 << 4)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CORE_PWRSTST, PM_IVAHD_PWRSTST,
- * PM_L3INIT_PWRSTST, PM_L4PER_PWRSTST, PM_MPU_PWRSTST, PM_TESLA_PWRSTST
- */
 #define OMAP4430_LASTPOWERSTATEENTERED_SHIFT                           24
 #define OMAP4430_LASTPOWERSTATEENTERED_MASK                            (0x3 << 24)
-
-/*
- * Used by PM_ABE_PWRSTCTRL, PM_CORE_PWRSTCTRL, PM_DSS_PWRSTCTRL,
- * PM_IVAHD_PWRSTCTRL, PM_L3INIT_PWRSTCTRL, PM_L4PER_PWRSTCTRL,
- * PM_MPU_PWRSTCTRL, PM_TESLA_PWRSTCTRL
- */
 #define OMAP4430_LOGICRETSTATE_SHIFT                                   2
 #define OMAP4430_LOGICRETSTATE_MASK                                    (1 << 2)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CAM_PWRSTST, PM_CEFUSE_PWRSTST, PM_CORE_PWRSTST,
- * PM_DSS_PWRSTST, PM_EMU_PWRSTST, PM_GFX_PWRSTST, PM_IVAHD_PWRSTST,
- * PM_L3INIT_PWRSTST, PM_L4PER_PWRSTST, PM_MPU_PWRSTST, PM_TESLA_PWRSTST
- */
 #define OMAP4430_LOGICSTATEST_SHIFT                                    2
 #define OMAP4430_LOGICSTATEST_MASK                                     (1 << 2)
-
-/*
- * Used by RM_ABE_AESS_CONTEXT, RM_ABE_DMIC_CONTEXT, RM_ABE_MCASP_CONTEXT,
- * RM_ABE_MCBSP1_CONTEXT, RM_ABE_MCBSP2_CONTEXT, RM_ABE_MCBSP3_CONTEXT,
- * RM_ABE_PDM_CONTEXT, RM_ABE_SLIMBUS_CONTEXT, RM_ABE_TIMER5_CONTEXT,
- * RM_ABE_TIMER6_CONTEXT, RM_ABE_TIMER7_CONTEXT, RM_ABE_TIMER8_CONTEXT,
- * RM_ABE_WDT3_CONTEXT, RM_ALWON_MDMINTC_CONTEXT, RM_ALWON_SR_CORE_CONTEXT,
- * RM_ALWON_SR_IVA_CONTEXT, RM_ALWON_SR_MPU_CONTEXT, RM_CAM_FDIF_CONTEXT,
- * RM_CAM_ISS_CONTEXT, RM_CEFUSE_CEFUSE_CONTEXT, RM_D2D_SAD2D_CONTEXT,
- * RM_D2D_SAD2D_FW_CONTEXT, RM_DSS_DEISS_CONTEXT, RM_DSS_DSS_CONTEXT,
- * RM_DUCATI_DUCATI_CONTEXT, RM_EMU_DEBUGSS_CONTEXT, RM_GFX_GFX_CONTEXT,
- * RM_IVAHD_IVAHD_CONTEXT, RM_IVAHD_SL2_CONTEXT, RM_L3INIT_CCPTX_CONTEXT,
- * RM_L3INIT_EMAC_CONTEXT, RM_L3INIT_P1500_CONTEXT, RM_L3INIT_PCIESS_CONTEXT,
- * RM_L3INIT_SATA_CONTEXT, RM_L3INIT_TPPSS_CONTEXT, RM_L3INIT_UNIPRO1_CONTEXT,
- * RM_L3INIT_USBPHYOCP2SCP_CONTEXT, RM_L3INIT_XHPI_CONTEXT,
- * RM_L3INSTR_L3_3_CONTEXT, RM_L3INSTR_L3_INSTR_CONTEXT,
- * RM_L3INSTR_OCP_WP1_CONTEXT, RM_L3_1_L3_1_CONTEXT, RM_L3_2_L3_2_CONTEXT,
- * RM_L3_2_OCMC_RAM_CONTEXT, RM_L4CFG_L4_CFG_CONTEXT, RM_L4CFG_SAR_ROM_CONTEXT,
- * RM_L4PER_ADC_CONTEXT, RM_L4PER_DMTIMER10_CONTEXT,
- * RM_L4PER_DMTIMER11_CONTEXT, RM_L4PER_DMTIMER2_CONTEXT,
- * RM_L4PER_DMTIMER3_CONTEXT, RM_L4PER_DMTIMER4_CONTEXT,
- * RM_L4PER_DMTIMER9_CONTEXT, RM_L4PER_ELM_CONTEXT, RM_L4PER_HDQ1W_CONTEXT,
- * RM_L4PER_HECC1_CONTEXT, RM_L4PER_HECC2_CONTEXT, RM_L4PER_I2C2_CONTEXT,
- * RM_L4PER_I2C3_CONTEXT, RM_L4PER_I2C4_CONTEXT, RM_L4PER_I2C5_CONTEXT,
- * RM_L4PER_L4_PER_CONTEXT, RM_L4PER_MCASP2_CONTEXT, RM_L4PER_MCASP3_CONTEXT,
- * RM_L4PER_MCBSP4_CONTEXT, RM_L4PER_MCSPI1_CONTEXT, RM_L4PER_MCSPI2_CONTEXT,
- * RM_L4PER_MCSPI3_CONTEXT, RM_L4PER_MCSPI4_CONTEXT, RM_L4PER_MGATE_CONTEXT,
- * RM_L4PER_MMCSD3_CONTEXT, RM_L4PER_MMCSD4_CONTEXT, RM_L4PER_MMCSD5_CONTEXT,
- * RM_L4PER_MSPROHG_CONTEXT, RM_L4PER_SLIMBUS2_CONTEXT,
- * RM_L4SEC_PKAEIP29_CONTEXT, RM_MEMIF_DLL_CONTEXT, RM_MEMIF_DLL_H_CONTEXT,
- * RM_MEMIF_DMM_CONTEXT, RM_MEMIF_EMIF_1_CONTEXT, RM_MEMIF_EMIF_2_CONTEXT,
- * RM_MEMIF_EMIF_FW_CONTEXT, RM_MPU_MPU_CONTEXT, RM_TESLA_TESLA_CONTEXT,
- * RM_WKUP_GPIO1_CONTEXT, RM_WKUP_KEYBOARD_CONTEXT, RM_WKUP_L4WKUP_CONTEXT,
- * RM_WKUP_RTC_CONTEXT, RM_WKUP_SARRAM_CONTEXT, RM_WKUP_SYNCTIMER_CONTEXT,
- * RM_WKUP_TIMER12_CONTEXT, RM_WKUP_TIMER1_CONTEXT, RM_WKUP_USIM_CONTEXT,
- * RM_WKUP_WDT1_CONTEXT, RM_WKUP_WDT2_CONTEXT
- */
-#define OMAP4430_LOSTCONTEXT_DFF_SHIFT                                 0
 #define OMAP4430_LOSTCONTEXT_DFF_MASK                                  (1 << 0)
-
-/*
- * Used by RM_D2D_MODEM_ICR_CONTEXT, RM_D2D_SAD2D_CONTEXT,
- * RM_D2D_SAD2D_FW_CONTEXT, RM_DSS_DSS_CONTEXT, RM_DUCATI_DUCATI_CONTEXT,
- * RM_L3INIT_HSI_CONTEXT, RM_L3INIT_MMC1_CONTEXT, RM_L3INIT_MMC2_CONTEXT,
- * RM_L3INIT_MMC6_CONTEXT, RM_L3INIT_USB_HOST_CONTEXT,
- * RM_L3INIT_USB_HOST_FS_CONTEXT, RM_L3INIT_USB_OTG_CONTEXT,
- * RM_L3INIT_USB_TLL_CONTEXT, RM_L3INSTR_L3_3_CONTEXT,
- * RM_L3INSTR_OCP_WP1_CONTEXT, RM_L3_1_L3_1_CONTEXT, RM_L3_2_GPMC_CONTEXT,
- * RM_L3_2_L3_2_CONTEXT, RM_L4CFG_HW_SEM_CONTEXT, RM_L4CFG_L4_CFG_CONTEXT,
- * RM_L4CFG_MAILBOX_CONTEXT, RM_L4PER_GPIO2_CONTEXT, RM_L4PER_GPIO3_CONTEXT,
- * RM_L4PER_GPIO4_CONTEXT, RM_L4PER_GPIO5_CONTEXT, RM_L4PER_GPIO6_CONTEXT,
- * RM_L4PER_I2C1_CONTEXT, RM_L4PER_L4_PER_CONTEXT, RM_L4PER_UART1_CONTEXT,
- * RM_L4PER_UART2_CONTEXT, RM_L4PER_UART3_CONTEXT, RM_L4PER_UART4_CONTEXT,
- * RM_L4SEC_AES1_CONTEXT, RM_L4SEC_AES2_CONTEXT, RM_L4SEC_CRYPTODMA_CONTEXT,
- * RM_L4SEC_DES3DES_CONTEXT, RM_L4SEC_RNG_CONTEXT, RM_L4SEC_SHA2MD51_CONTEXT,
- * RM_MEMIF_DMM_CONTEXT, RM_MEMIF_EMIF_1_CONTEXT, RM_MEMIF_EMIF_2_CONTEXT,
- * RM_MEMIF_EMIF_FW_CONTEXT, RM_MEMIF_EMIF_H1_CONTEXT,
- * RM_MEMIF_EMIF_H2_CONTEXT, RM_SDMA_SDMA_CONTEXT, RM_TESLA_TESLA_CONTEXT
- */
-#define OMAP4430_LOSTCONTEXT_RFF_SHIFT                                 1
-#define OMAP4430_LOSTCONTEXT_RFF_MASK                                  (1 << 1)
-
-/* Used by RM_ABE_AESS_CONTEXT */
-#define OMAP4430_LOSTMEM_AESSMEM_SHIFT                                 8
 #define OMAP4430_LOSTMEM_AESSMEM_MASK                                  (1 << 8)
-
-/* Used by RM_CAM_FDIF_CONTEXT, RM_CAM_ISS_CONTEXT */
-#define OMAP4430_LOSTMEM_CAM_MEM_SHIFT                                 8
-#define OMAP4430_LOSTMEM_CAM_MEM_MASK                                  (1 << 8)
-
-/* Used by RM_L3INSTR_OCP_WP1_CONTEXT */
-#define OMAP4430_LOSTMEM_CORE_NRET_BANK_SHIFT                          8
-#define OMAP4430_LOSTMEM_CORE_NRET_BANK_MASK                           (1 << 8)
-
-/* Renamed from LOSTMEM_CORE_NRET_BANK Used by RM_MEMIF_DMM_CONTEXT */
-#define OMAP4430_LOSTMEM_CORE_NRET_BANK_9_9_SHIFT                      9
-#define OMAP4430_LOSTMEM_CORE_NRET_BANK_9_9_MASK                       (1 << 9)
-
-/* Used by RM_L3_2_OCMC_RAM_CONTEXT */
-#define OMAP4430_LOSTMEM_CORE_OCMRAM_SHIFT                             8
-#define OMAP4430_LOSTMEM_CORE_OCMRAM_MASK                              (1 << 8)
-
-/*
- * Used by RM_D2D_MODEM_ICR_CONTEXT, RM_MEMIF_DMM_CONTEXT,
- * RM_SDMA_SDMA_CONTEXT
- */
-#define OMAP4430_LOSTMEM_CORE_OTHER_BANK_SHIFT                         8
-#define OMAP4430_LOSTMEM_CORE_OTHER_BANK_MASK                          (1 << 8)
-
-/* Used by RM_DSS_DEISS_CONTEXT, RM_DSS_DSS_CONTEXT */
-#define OMAP4430_LOSTMEM_DSS_MEM_SHIFT                                 8
-#define OMAP4430_LOSTMEM_DSS_MEM_MASK                                  (1 << 8)
-
-/* Used by RM_DUCATI_DUCATI_CONTEXT */
-#define OMAP4430_LOSTMEM_DUCATI_L2RAM_SHIFT                            9
-#define OMAP4430_LOSTMEM_DUCATI_L2RAM_MASK                             (1 << 9)
-
-/* Used by RM_DUCATI_DUCATI_CONTEXT */
-#define OMAP4430_LOSTMEM_DUCATI_UNICACHE_SHIFT                         8
-#define OMAP4430_LOSTMEM_DUCATI_UNICACHE_MASK                          (1 << 8)
-
-/* Used by RM_EMU_DEBUGSS_CONTEXT */
-#define OMAP4430_LOSTMEM_EMU_BANK_SHIFT                                        8
-#define OMAP4430_LOSTMEM_EMU_BANK_MASK                                 (1 << 8)
-
-/* Used by RM_GFX_GFX_CONTEXT */
-#define OMAP4430_LOSTMEM_GFX_MEM_SHIFT                                 8
-#define OMAP4430_LOSTMEM_GFX_MEM_MASK                                  (1 << 8)
-
-/* Used by RM_IVAHD_IVAHD_CONTEXT */
-#define OMAP4430_LOSTMEM_HWA_MEM_SHIFT                                 10
-#define OMAP4430_LOSTMEM_HWA_MEM_MASK                                  (1 << 10)
-
-/*
- * Used by RM_L3INIT_CCPTX_CONTEXT, RM_L3INIT_EMAC_CONTEXT,
- * RM_L3INIT_HSI_CONTEXT, RM_L3INIT_MMC1_CONTEXT, RM_L3INIT_MMC2_CONTEXT,
- * RM_L3INIT_MMC6_CONTEXT, RM_L3INIT_PCIESS_CONTEXT, RM_L3INIT_SATA_CONTEXT,
- * RM_L3INIT_TPPSS_CONTEXT, RM_L3INIT_UNIPRO1_CONTEXT,
- * RM_L3INIT_USB_OTG_CONTEXT, RM_L3INIT_XHPI_CONTEXT
- */
-#define OMAP4430_LOSTMEM_L3INIT_BANK1_SHIFT                            8
-#define OMAP4430_LOSTMEM_L3INIT_BANK1_MASK                             (1 << 8)
-
-/* Used by RM_MPU_MPU_CONTEXT */
-#define OMAP4430_LOSTMEM_MPU_L1_SHIFT                                  8
-#define OMAP4430_LOSTMEM_MPU_L1_MASK                                   (1 << 8)
-
-/* Used by RM_MPU_MPU_CONTEXT */
-#define OMAP4430_LOSTMEM_MPU_L2_SHIFT                                  9
-#define OMAP4430_LOSTMEM_MPU_L2_MASK                                   (1 << 9)
-
-/* Used by RM_MPU_MPU_CONTEXT */
-#define OMAP4430_LOSTMEM_MPU_RAM_SHIFT                                 10
-#define OMAP4430_LOSTMEM_MPU_RAM_MASK                                  (1 << 10)
-
-/*
- * Used by RM_L4PER_HECC1_CONTEXT, RM_L4PER_HECC2_CONTEXT,
- * RM_L4PER_MCBSP4_CONTEXT, RM_L4PER_MMCSD3_CONTEXT, RM_L4PER_MMCSD4_CONTEXT,
- * RM_L4PER_MMCSD5_CONTEXT, RM_L4PER_SLIMBUS2_CONTEXT, RM_L4SEC_PKAEIP29_CONTEXT
- */
-#define OMAP4430_LOSTMEM_NONRETAINED_BANK_SHIFT                                8
-#define OMAP4430_LOSTMEM_NONRETAINED_BANK_MASK                         (1 << 8)
-
-/*
- * Used by RM_ABE_DMIC_CONTEXT, RM_ABE_MCBSP1_CONTEXT, RM_ABE_MCBSP2_CONTEXT,
- * RM_ABE_MCBSP3_CONTEXT, RM_ABE_PDM_CONTEXT, RM_ABE_SLIMBUS_CONTEXT
- */
-#define OMAP4430_LOSTMEM_PERIHPMEM_SHIFT                               8
-#define OMAP4430_LOSTMEM_PERIHPMEM_MASK                                        (1 << 8)
-
-/*
- * Used by RM_L4PER_MSPROHG_CONTEXT, RM_L4PER_UART1_CONTEXT,
- * RM_L4PER_UART2_CONTEXT, RM_L4PER_UART3_CONTEXT, RM_L4PER_UART4_CONTEXT,
- * RM_L4SEC_CRYPTODMA_CONTEXT
- */
-#define OMAP4430_LOSTMEM_RETAINED_BANK_SHIFT                           8
-#define OMAP4430_LOSTMEM_RETAINED_BANK_MASK                            (1 << 8)
-
-/* Used by RM_IVAHD_SL2_CONTEXT */
-#define OMAP4430_LOSTMEM_SL2_MEM_SHIFT                                 8
-#define OMAP4430_LOSTMEM_SL2_MEM_MASK                                  (1 << 8)
-
-/* Used by RM_IVAHD_IVAHD_CONTEXT */
-#define OMAP4430_LOSTMEM_TCM1_MEM_SHIFT                                        8
-#define OMAP4430_LOSTMEM_TCM1_MEM_MASK                                 (1 << 8)
-
-/* Used by RM_IVAHD_IVAHD_CONTEXT */
-#define OMAP4430_LOSTMEM_TCM2_MEM_SHIFT                                        9
-#define OMAP4430_LOSTMEM_TCM2_MEM_MASK                                 (1 << 9)
-
-/* Used by RM_TESLA_TESLA_CONTEXT */
-#define OMAP4430_LOSTMEM_TESLA_EDMA_SHIFT                              10
-#define OMAP4430_LOSTMEM_TESLA_EDMA_MASK                               (1 << 10)
-
-/* Used by RM_TESLA_TESLA_CONTEXT */
-#define OMAP4430_LOSTMEM_TESLA_L1_SHIFT                                        8
-#define OMAP4430_LOSTMEM_TESLA_L1_MASK                                 (1 << 8)
-
-/* Used by RM_TESLA_TESLA_CONTEXT */
-#define OMAP4430_LOSTMEM_TESLA_L2_SHIFT                                        9
-#define OMAP4430_LOSTMEM_TESLA_L2_MASK                                 (1 << 9)
-
-/* Used by RM_WKUP_SARRAM_CONTEXT */
-#define OMAP4430_LOSTMEM_WKUP_BANK_SHIFT                               8
-#define OMAP4430_LOSTMEM_WKUP_BANK_MASK                                        (1 << 8)
-
-/*
- * Used by PM_ABE_PWRSTCTRL, PM_CAM_PWRSTCTRL, PM_CEFUSE_PWRSTCTRL,
- * PM_CORE_PWRSTCTRL, PM_DSS_PWRSTCTRL, PM_GFX_PWRSTCTRL, PM_IVAHD_PWRSTCTRL,
- * PM_L3INIT_PWRSTCTRL, PM_L4PER_PWRSTCTRL, PM_MPU_PWRSTCTRL, PM_TESLA_PWRSTCTRL
- */
 #define OMAP4430_LOWPOWERSTATECHANGE_SHIFT                             4
 #define OMAP4430_LOWPOWERSTATECHANGE_MASK                              (1 << 4)
-
-/* Used by PRM_MODEM_IF_CTRL */
-#define OMAP4430_MODEM_READY_SHIFT                                     1
-#define OMAP4430_MODEM_READY_MASK                                      (1 << 1)
-
-/* Used by PRM_MODEM_IF_CTRL */
-#define OMAP4430_MODEM_SHUTDOWN_IRQ_SHIFT                              9
-#define OMAP4430_MODEM_SHUTDOWN_IRQ_MASK                               (1 << 9)
-
-/* Used by PRM_MODEM_IF_CTRL */
-#define OMAP4430_MODEM_SLEEP_ST_SHIFT                                  16
-#define OMAP4430_MODEM_SLEEP_ST_MASK                                   (1 << 16)
-
-/* Used by PRM_MODEM_IF_CTRL */
-#define OMAP4430_MODEM_WAKE_IRQ_SHIFT                                  8
-#define OMAP4430_MODEM_WAKE_IRQ_MASK                                   (1 << 8)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP4430_MPU_L1_ONSTATE_SHIFT                                  16
-#define OMAP4430_MPU_L1_ONSTATE_MASK                                   (0x3 << 16)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP4430_MPU_L1_RETSTATE_SHIFT                                 8
-#define OMAP4430_MPU_L1_RETSTATE_MASK                                  (1 << 8)
-
-/* Used by PM_MPU_PWRSTST */
-#define OMAP4430_MPU_L1_STATEST_SHIFT                                  4
-#define OMAP4430_MPU_L1_STATEST_MASK                                   (0x3 << 4)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP4430_MPU_L2_ONSTATE_SHIFT                                  18
-#define OMAP4430_MPU_L2_ONSTATE_MASK                                   (0x3 << 18)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP4430_MPU_L2_RETSTATE_SHIFT                                 9
-#define OMAP4430_MPU_L2_RETSTATE_MASK                                  (1 << 9)
-
-/* Used by PM_MPU_PWRSTST */
-#define OMAP4430_MPU_L2_STATEST_SHIFT                                  6
-#define OMAP4430_MPU_L2_STATEST_MASK                                   (0x3 << 6)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP4430_MPU_RAM_ONSTATE_SHIFT                                 20
-#define OMAP4430_MPU_RAM_ONSTATE_MASK                                  (0x3 << 20)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP4430_MPU_RAM_RETSTATE_SHIFT                                        10
-#define OMAP4430_MPU_RAM_RETSTATE_MASK                                 (1 << 10)
-
-/* Used by PM_MPU_PWRSTST */
-#define OMAP4430_MPU_RAM_STATEST_SHIFT                                 8
-#define OMAP4430_MPU_RAM_STATEST_MASK                                  (0x3 << 8)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT                           2
-#define OMAP4430_MPU_SECURITY_VIOL_RST_MASK                            (1 << 2)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_MPU_WDT_RST_SHIFT                                     3
-#define OMAP4430_MPU_WDT_RST_MASK                                      (1 << 3)
-
-/* Used by PM_L4PER_PWRSTCTRL */
-#define OMAP4430_NONRETAINED_BANK_ONSTATE_SHIFT                                18
-#define OMAP4430_NONRETAINED_BANK_ONSTATE_MASK                         (0x3 << 18)
-
-/* Used by PM_L4PER_PWRSTCTRL */
-#define OMAP4430_NONRETAINED_BANK_RETSTATE_SHIFT                       9
-#define OMAP4430_NONRETAINED_BANK_RETSTATE_MASK                                (1 << 9)
-
-/* Used by PM_L4PER_PWRSTST */
-#define OMAP4430_NONRETAINED_BANK_STATEST_SHIFT                                6
-#define OMAP4430_NONRETAINED_BANK_STATEST_MASK                         (0x3 << 6)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_OCP_NRET_BANK_ONSTATE_SHIFT                           24
 #define OMAP4430_OCP_NRET_BANK_ONSTATE_MASK                            (0x3 << 24)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP4430_OCP_NRET_BANK_RETSTATE_SHIFT                          12
 #define OMAP4430_OCP_NRET_BANK_RETSTATE_MASK                           (1 << 12)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP4430_OCP_NRET_BANK_STATEST_SHIFT                           12
 #define OMAP4430_OCP_NRET_BANK_STATEST_MASK                            (0x3 << 12)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
 #define OMAP4430_OFF_SHIFT                                             0
-#define OMAP4430_OFF_MASK                                              (0xff << 0)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
 #define OMAP4430_ON_SHIFT                                              24
 #define OMAP4430_ON_MASK                                               (0xff << 24)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
 #define OMAP4430_ONLP_SHIFT                                            16
-#define OMAP4430_ONLP_MASK                                             (0xff << 16)
-
-/* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */
-#define OMAP4430_OPP_CHANGE_SHIFT                                      2
-#define OMAP4430_OPP_CHANGE_MASK                                       (1 << 2)
-
-/* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */
-#define OMAP4430_OPP_SEL_SHIFT                                         0
-#define OMAP4430_OPP_SEL_MASK                                          (0x3 << 0)
-
-/* Used by PRM_SRAM_COUNT */
-#define OMAP4430_PCHARGECNT_VALUE_SHIFT                                        0
-#define OMAP4430_PCHARGECNT_VALUE_MASK                                 (0x3f << 0)
-
-/* Used by PRM_PSCON_COUNT */
-#define OMAP4430_PCHARGE_TIME_SHIFT                                    0
-#define OMAP4430_PCHARGE_TIME_MASK                                     (0xff << 0)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP4430_PERIPHMEM_ONSTATE_SHIFT                               20
-#define OMAP4430_PERIPHMEM_ONSTATE_MASK                                        (0x3 << 20)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP4430_PERIPHMEM_RETSTATE_SHIFT                              10
-#define OMAP4430_PERIPHMEM_RETSTATE_MASK                               (1 << 10)
-
-/* Used by PM_ABE_PWRSTST */
-#define OMAP4430_PERIPHMEM_STATEST_SHIFT                               8
-#define OMAP4430_PERIPHMEM_STATEST_MASK                                        (0x3 << 8)
-
-/* Used by PRM_PHASE1_CNDP */
-#define OMAP4430_PHASE1_CNDP_SHIFT                                     0
-#define OMAP4430_PHASE1_CNDP_MASK                                      (0xffffffff << 0)
-
-/* Used by PRM_PHASE2A_CNDP */
-#define OMAP4430_PHASE2A_CNDP_SHIFT                                    0
-#define OMAP4430_PHASE2A_CNDP_MASK                                     (0xffffffff << 0)
-
-/* Used by PRM_PHASE2B_CNDP */
-#define OMAP4430_PHASE2B_CNDP_SHIFT                                    0
-#define OMAP4430_PHASE2B_CNDP_MASK                                     (0xffffffff << 0)
-
-/* Used by PRM_PSCON_COUNT */
-#define OMAP4430_PONOUT_2_PGOODIN_TIME_SHIFT                           8
-#define OMAP4430_PONOUT_2_PGOODIN_TIME_MASK                            (0xff << 8)
-
-/*
- * Used by PM_ABE_PWRSTCTRL, PM_CAM_PWRSTCTRL, PM_CEFUSE_PWRSTCTRL,
- * PM_CORE_PWRSTCTRL, PM_DSS_PWRSTCTRL, PM_EMU_PWRSTCTRL, PM_GFX_PWRSTCTRL,
- * PM_IVAHD_PWRSTCTRL, PM_L3INIT_PWRSTCTRL, PM_L4PER_PWRSTCTRL,
- * PM_MPU_PWRSTCTRL, PM_TESLA_PWRSTCTRL
- */
-#define OMAP4430_POWERSTATE_SHIFT                                      0
-#define OMAP4430_POWERSTATE_MASK                                       (0x3 << 0)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CAM_PWRSTST, PM_CEFUSE_PWRSTST, PM_CORE_PWRSTST,
- * PM_DSS_PWRSTST, PM_EMU_PWRSTST, PM_GFX_PWRSTST, PM_IVAHD_PWRSTST,
- * PM_L3INIT_PWRSTST, PM_L4PER_PWRSTST, PM_MPU_PWRSTST, PM_TESLA_PWRSTST
- */
-#define OMAP4430_POWERSTATEST_SHIFT                                    0
-#define OMAP4430_POWERSTATEST_MASK                                     (0x3 << 0)
-
-/* Used by PRM_PWRREQCTRL */
-#define OMAP4430_PWRREQ_COND_SHIFT                                     0
-#define OMAP4430_PWRREQ_COND_MASK                                      (0x3 << 0)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RACEN_VDD_CORE_L_SHIFT                                        3
-#define OMAP4430_RACEN_VDD_CORE_L_MASK                                 (1 << 3)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RACEN_VDD_IVA_L_SHIFT                                 11
-#define OMAP4430_RACEN_VDD_IVA_L_MASK                                  (1 << 11)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RACEN_VDD_MPU_L_SHIFT                                 20
-#define OMAP4430_RACEN_VDD_MPU_L_MASK                                  (1 << 20)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RAC_VDD_CORE_L_SHIFT                                  2
-#define OMAP4430_RAC_VDD_CORE_L_MASK                                   (1 << 2)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RAC_VDD_IVA_L_SHIFT                                   10
-#define OMAP4430_RAC_VDD_IVA_L_MASK                                    (1 << 10)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RAC_VDD_MPU_L_SHIFT                                   19
-#define OMAP4430_RAC_VDD_MPU_L_MASK                                    (1 << 19)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
 #define OMAP4430_RAMP_DOWN_COUNT_SHIFT                                 16
-#define OMAP4430_RAMP_DOWN_COUNT_MASK                                  (0x3f << 16)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
-#define OMAP4430_RAMP_DOWN_PRESCAL_SHIFT                               24
-#define OMAP4430_RAMP_DOWN_PRESCAL_MASK                                        (0x3 << 24)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
 #define OMAP4430_RAMP_UP_COUNT_SHIFT                                   0
-#define OMAP4430_RAMP_UP_COUNT_MASK                                    (0x3f << 0)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
 #define OMAP4430_RAMP_UP_PRESCAL_SHIFT                                 8
-#define OMAP4430_RAMP_UP_PRESCAL_MASK                                  (0x3 << 8)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RAV_VDD_CORE_L_SHIFT                                  1
-#define OMAP4430_RAV_VDD_CORE_L_MASK                                   (1 << 1)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RAV_VDD_IVA_L_SHIFT                                   9
-#define OMAP4430_RAV_VDD_IVA_L_MASK                                    (1 << 9)
-
-/* Used by PRM_VC_CFG_CHANNEL */
-#define OMAP4430_RAV_VDD_MPU_L_SHIFT                                   18
-#define OMAP4430_RAV_VDD_MPU_L_MASK                                    (1 << 18)
-
-/* Used by PRM_VC_VAL_BYPASS */
 #define OMAP4430_REGADDR_SHIFT                                         8
-#define OMAP4430_REGADDR_MASK                                          (0xff << 8)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
 #define OMAP4430_RET_SHIFT                                             8
-#define OMAP4430_RET_MASK                                              (0xff << 8)
-
-/* Used by PM_L4PER_PWRSTCTRL */
-#define OMAP4430_RETAINED_BANK_ONSTATE_SHIFT                           16
-#define OMAP4430_RETAINED_BANK_ONSTATE_MASK                            (0x3 << 16)
-
-/* Used by PM_L4PER_PWRSTCTRL */
-#define OMAP4430_RETAINED_BANK_RETSTATE_SHIFT                          8
-#define OMAP4430_RETAINED_BANK_RETSTATE_MASK                           (1 << 8)
-
-/* Used by PM_L4PER_PWRSTST */
-#define OMAP4430_RETAINED_BANK_STATEST_SHIFT                           4
-#define OMAP4430_RETAINED_BANK_STATEST_MASK                            (0x3 << 4)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL,
- * PRM_LDO_SRAM_MPU_CTRL
- */
-#define OMAP4430_RETMODE_ENABLE_SHIFT                                  0
-#define OMAP4430_RETMODE_ENABLE_MASK                                   (1 << 0)
-
-/* Used by RM_DUCATI_RSTCTRL, RM_IVAHD_RSTCTRL, RM_TESLA_RSTCTRL */
-#define OMAP4430_RST1_SHIFT                                            0
-#define OMAP4430_RST1_MASK                                             (1 << 0)
-
-/* Used by RM_DUCATI_RSTST, RM_IVAHD_RSTST, RM_TESLA_RSTST */
-#define OMAP4430_RST1ST_SHIFT                                          0
-#define OMAP4430_RST1ST_MASK                                           (1 << 0)
-
-/* Used by RM_DUCATI_RSTCTRL, RM_IVAHD_RSTCTRL, RM_TESLA_RSTCTRL */
-#define OMAP4430_RST2_SHIFT                                            1
-#define OMAP4430_RST2_MASK                                             (1 << 1)
-
-/* Used by RM_DUCATI_RSTST, RM_IVAHD_RSTST, RM_TESLA_RSTST */
-#define OMAP4430_RST2ST_SHIFT                                          1
-#define OMAP4430_RST2ST_MASK                                           (1 << 1)
-
-/* Used by RM_DUCATI_RSTCTRL, RM_IVAHD_RSTCTRL */
-#define OMAP4430_RST3_SHIFT                                            2
-#define OMAP4430_RST3_MASK                                             (1 << 2)
-
-/* Used by RM_DUCATI_RSTST, RM_IVAHD_RSTST */
-#define OMAP4430_RST3ST_SHIFT                                          2
-#define OMAP4430_RST3ST_MASK                                           (1 << 2)
-
-/* Used by PRM_RSTTIME */
-#define OMAP4430_RSTTIME1_SHIFT                                                0
-#define OMAP4430_RSTTIME1_MASK                                         (0x3ff << 0)
-
-/* Used by PRM_RSTTIME */
-#define OMAP4430_RSTTIME2_SHIFT                                                10
-#define OMAP4430_RSTTIME2_MASK                                         (0x1f << 10)
-
-/* Used by PRM_RSTCTRL */
-#define OMAP4430_RST_GLOBAL_COLD_SW_SHIFT                              1
-#define OMAP4430_RST_GLOBAL_COLD_SW_MASK                               (1 << 1)
-
-/* Used by PRM_RSTCTRL */
-#define OMAP4430_RST_GLOBAL_WARM_SW_SHIFT                              0
 #define OMAP4430_RST_GLOBAL_WARM_SW_MASK                               (1 << 0)
-
-/* Used by REVISION_PRM */
-#define OMAP4430_R_RTL_SHIFT                                           11
-#define OMAP4430_R_RTL_MASK                                            (0x1f << 11)
-
-/* Used by PRM_VC_CFG_CHANNEL */
 #define OMAP4430_SA_VDD_CORE_L_SHIFT                                   0
-#define OMAP4430_SA_VDD_CORE_L_MASK                                    (1 << 0)
-
-/* Renamed from SA_VDD_CORE_L Used by PRM_VC_SMPS_SA */
-#define OMAP4430_SA_VDD_CORE_L_0_6_SHIFT                               0
 #define OMAP4430_SA_VDD_CORE_L_0_6_MASK                                        (0x7f << 0)
-
-/* Used by PRM_VC_CFG_CHANNEL */
 #define OMAP4430_SA_VDD_IVA_L_SHIFT                                    8
-#define OMAP4430_SA_VDD_IVA_L_MASK                                     (1 << 8)
-
-/* Renamed from SA_VDD_IVA_L Used by PRM_VC_SMPS_SA */
-#define OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT                     8
 #define OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK                      (0x7f << 8)
-
-/* Used by PRM_VC_CFG_CHANNEL */
 #define OMAP4430_SA_VDD_MPU_L_SHIFT                                    16
-#define OMAP4430_SA_VDD_MPU_L_MASK                                     (1 << 16)
-
-/* Renamed from SA_VDD_MPU_L Used by PRM_VC_SMPS_SA */
-#define OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT                     16
 #define OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK                      (0x7f << 16)
-
-/* Used by REVISION_PRM */
-#define OMAP4430_SCHEME_SHIFT                                          30
-#define OMAP4430_SCHEME_MASK                                           (0x3 << 30)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
 #define OMAP4430_SCLH_SHIFT                                            0
-#define OMAP4430_SCLH_MASK                                             (0xff << 0)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
 #define OMAP4430_SCLL_SHIFT                                            8
-#define OMAP4430_SCLL_MASK                                             (0xff << 8)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_SECURE_WDT_RST_SHIFT                                  4
-#define OMAP4430_SECURE_WDT_RST_MASK                                   (1 << 4)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_SL2_MEM_ONSTATE_SHIFT                                 18
-#define OMAP4430_SL2_MEM_ONSTATE_MASK                                  (0x3 << 18)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_SL2_MEM_RETSTATE_SHIFT                                        9
-#define OMAP4430_SL2_MEM_RETSTATE_MASK                                 (1 << 9)
-
-/* Used by PM_IVAHD_PWRSTST */
-#define OMAP4430_SL2_MEM_STATEST_SHIFT                                 6
-#define OMAP4430_SL2_MEM_STATEST_MASK                                  (0x3 << 6)
-
-/* Used by PRM_VC_VAL_BYPASS */
 #define OMAP4430_SLAVEADDR_SHIFT                                       0
-#define OMAP4430_SLAVEADDR_MASK                                                (0x7f << 0)
-
-/* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */
-#define OMAP4430_SLEEP_RBB_SEL_SHIFT                                   3
-#define OMAP4430_SLEEP_RBB_SEL_MASK                                    (1 << 3)
-
-/* Used by PRM_SRAM_COUNT */
-#define OMAP4430_SLPCNT_VALUE_SHIFT                                    16
-#define OMAP4430_SLPCNT_VALUE_MASK                                     (0xff << 16)
-
-/* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_IVA_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */
 #define OMAP4430_SMPSWAITTIMEMAX_SHIFT                                 8
-#define OMAP4430_SMPSWAITTIMEMAX_MASK                                  (0xffff << 8)
-
-/* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_IVA_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */
 #define OMAP4430_SMPSWAITTIMEMIN_SHIFT                                 8
-#define OMAP4430_SMPSWAITTIMEMIN_MASK                                  (0xffff << 8)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_RA_ERR_CORE_SHIFT                                        1
-#define OMAP4430_SMPS_RA_ERR_CORE_MASK                                 (1 << 1)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_RA_ERR_IVA_SHIFT                                 9
-#define OMAP4430_SMPS_RA_ERR_IVA_MASK                                  (1 << 9)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_RA_ERR_MPU_SHIFT                                 17
-#define OMAP4430_SMPS_RA_ERR_MPU_MASK                                  (1 << 17)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_SA_ERR_CORE_SHIFT                                        0
-#define OMAP4430_SMPS_SA_ERR_CORE_MASK                                 (1 << 0)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_SA_ERR_IVA_SHIFT                                 8
-#define OMAP4430_SMPS_SA_ERR_IVA_MASK                                  (1 << 8)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_SA_ERR_MPU_SHIFT                                 16
-#define OMAP4430_SMPS_SA_ERR_MPU_MASK                                  (1 << 16)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_TIMEOUT_ERR_CORE_SHIFT                           2
-#define OMAP4430_SMPS_TIMEOUT_ERR_CORE_MASK                            (1 << 2)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_TIMEOUT_ERR_IVA_SHIFT                            10
-#define OMAP4430_SMPS_TIMEOUT_ERR_IVA_MASK                             (1 << 10)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_SMPS_TIMEOUT_ERR_MPU_SHIFT                            18
-#define OMAP4430_SMPS_TIMEOUT_ERR_MPU_MASK                             (1 << 18)
-
-/* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */
-#define OMAP4430_SR2EN_SHIFT                                           0
-#define OMAP4430_SR2EN_MASK                                            (1 << 0)
-
-/* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */
-#define OMAP4430_SR2_IN_TRANSITION_SHIFT                               6
-#define OMAP4430_SR2_IN_TRANSITION_MASK                                        (1 << 6)
-
-/* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */
-#define OMAP4430_SR2_STATUS_SHIFT                                      3
-#define OMAP4430_SR2_STATUS_MASK                                       (0x3 << 3)
-
-/* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */
-#define OMAP4430_SR2_WTCNT_VALUE_SHIFT                                 8
-#define OMAP4430_SR2_WTCNT_VALUE_MASK                                  (0xff << 8)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL,
- * PRM_LDO_SRAM_MPU_CTRL
- */
-#define OMAP4430_SRAMLDO_STATUS_SHIFT                                  8
-#define OMAP4430_SRAMLDO_STATUS_MASK                                   (1 << 8)
-
-/*
- * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL,
- * PRM_LDO_SRAM_MPU_CTRL
- */
-#define OMAP4430_SRAM_IN_TRANSITION_SHIFT                              9
-#define OMAP4430_SRAM_IN_TRANSITION_MASK                               (1 << 9)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP4430_SRMODEEN_SHIFT                                                4
-#define OMAP4430_SRMODEEN_MASK                                         (1 << 4)
-
-/* Used by PRM_VOLTSETUP_WARMRESET */
-#define OMAP4430_STABLE_COUNT_SHIFT                                    0
-#define OMAP4430_STABLE_COUNT_MASK                                     (0x3f << 0)
-
-/* Used by PRM_VOLTSETUP_WARMRESET */
-#define OMAP4430_STABLE_PRESCAL_SHIFT                                  8
-#define OMAP4430_STABLE_PRESCAL_MASK                                   (0x3 << 8)
-
-/* Used by PRM_LDO_BANDGAP_SETUP */
-#define OMAP4430_STARTUP_COUNT_SHIFT                                   0
-#define OMAP4430_STARTUP_COUNT_MASK                                    (0xff << 0)
-
-/* Renamed from STARTUP_COUNT Used by PRM_SRAM_COUNT */
-#define OMAP4430_STARTUP_COUNT_24_31_SHIFT                             24
-#define OMAP4430_STARTUP_COUNT_24_31_MASK                              (0xff << 24)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_TCM1_MEM_ONSTATE_SHIFT                                        20
-#define OMAP4430_TCM1_MEM_ONSTATE_MASK                                 (0x3 << 20)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_TCM1_MEM_RETSTATE_SHIFT                               10
-#define OMAP4430_TCM1_MEM_RETSTATE_MASK                                        (1 << 10)
-
-/* Used by PM_IVAHD_PWRSTST */
-#define OMAP4430_TCM1_MEM_STATEST_SHIFT                                        8
-#define OMAP4430_TCM1_MEM_STATEST_MASK                                 (0x3 << 8)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_TCM2_MEM_ONSTATE_SHIFT                                        22
-#define OMAP4430_TCM2_MEM_ONSTATE_MASK                                 (0x3 << 22)
-
-/* Used by PM_IVAHD_PWRSTCTRL */
-#define OMAP4430_TCM2_MEM_RETSTATE_SHIFT                               11
-#define OMAP4430_TCM2_MEM_RETSTATE_MASK                                        (1 << 11)
-
-/* Used by PM_IVAHD_PWRSTST */
-#define OMAP4430_TCM2_MEM_STATEST_SHIFT                                        10
-#define OMAP4430_TCM2_MEM_STATEST_MASK                                 (0x3 << 10)
-
-/* Used by RM_TESLA_RSTST */
-#define OMAP4430_TESLASS_EMU_RSTST_SHIFT                               2
-#define OMAP4430_TESLASS_EMU_RSTST_MASK                                        (1 << 2)
-
-/* Used by RM_TESLA_RSTST */
-#define OMAP4430_TESLA_DSP_EMU_REQ_RSTST_SHIFT                         3
-#define OMAP4430_TESLA_DSP_EMU_REQ_RSTST_MASK                          (1 << 3)
-
-/* Used by PM_TESLA_PWRSTCTRL */
-#define OMAP4430_TESLA_EDMA_ONSTATE_SHIFT                              20
-#define OMAP4430_TESLA_EDMA_ONSTATE_MASK                               (0x3 << 20)
-
-/* Used by PM_TESLA_PWRSTCTRL */
-#define OMAP4430_TESLA_EDMA_RETSTATE_SHIFT                             10
-#define OMAP4430_TESLA_EDMA_RETSTATE_MASK                              (1 << 10)
-
-/* Used by PM_TESLA_PWRSTST */
-#define OMAP4430_TESLA_EDMA_STATEST_SHIFT                              8
-#define OMAP4430_TESLA_EDMA_STATEST_MASK                               (0x3 << 8)
-
-/* Used by PM_TESLA_PWRSTCTRL */
-#define OMAP4430_TESLA_L1_ONSTATE_SHIFT                                        16
-#define OMAP4430_TESLA_L1_ONSTATE_MASK                                 (0x3 << 16)
-
-/* Used by PM_TESLA_PWRSTCTRL */
-#define OMAP4430_TESLA_L1_RETSTATE_SHIFT                               8
-#define OMAP4430_TESLA_L1_RETSTATE_MASK                                        (1 << 8)
-
-/* Used by PM_TESLA_PWRSTST */
-#define OMAP4430_TESLA_L1_STATEST_SHIFT                                        4
-#define OMAP4430_TESLA_L1_STATEST_MASK                                 (0x3 << 4)
-
-/* Used by PM_TESLA_PWRSTCTRL */
-#define OMAP4430_TESLA_L2_ONSTATE_SHIFT                                        18
-#define OMAP4430_TESLA_L2_ONSTATE_MASK                                 (0x3 << 18)
-
-/* Used by PM_TESLA_PWRSTCTRL */
-#define OMAP4430_TESLA_L2_RETSTATE_SHIFT                               9
-#define OMAP4430_TESLA_L2_RETSTATE_MASK                                        (1 << 9)
-
-/* Used by PM_TESLA_PWRSTST */
-#define OMAP4430_TESLA_L2_STATEST_SHIFT                                        6
-#define OMAP4430_TESLA_L2_STATEST_MASK                                 (0x3 << 6)
-
-/* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */
 #define OMAP4430_TIMEOUT_SHIFT                                         0
-#define OMAP4430_TIMEOUT_MASK                                          (0xffff << 0)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP4430_TIMEOUTEN_SHIFT                                       3
 #define OMAP4430_TIMEOUTEN_MASK                                                (1 << 3)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_TRANSITION_EN_SHIFT                                   8
-#define OMAP4430_TRANSITION_EN_MASK                                    (1 << 8)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_TRANSITION_ST_SHIFT                                   8
-#define OMAP4430_TRANSITION_ST_MASK                                    (1 << 8)
-
-/* Used by PRM_VC_VAL_BYPASS */
-#define OMAP4430_VALID_SHIFT                                           24
 #define OMAP4430_VALID_MASK                                            (1 << 24)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VC_BYPASSACK_EN_SHIFT                                 14
-#define OMAP4430_VC_BYPASSACK_EN_MASK                                  (1 << 14)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VC_BYPASSACK_ST_SHIFT                                 14
-#define OMAP4430_VC_BYPASSACK_ST_MASK                                  (1 << 14)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VC_CORE_VPACK_EN_SHIFT                                        22
-#define OMAP4430_VC_CORE_VPACK_EN_MASK                                 (1 << 22)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VC_CORE_VPACK_ST_SHIFT                                        22
-#define OMAP4430_VC_CORE_VPACK_ST_MASK                                 (1 << 22)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VC_IVA_VPACK_EN_SHIFT                                 30
-#define OMAP4430_VC_IVA_VPACK_EN_MASK                                  (1 << 30)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VC_IVA_VPACK_ST_SHIFT                                 30
-#define OMAP4430_VC_IVA_VPACK_ST_MASK                                  (1 << 30)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_VC_MPU_VPACK_EN_SHIFT                                 6
-#define OMAP4430_VC_MPU_VPACK_EN_MASK                                  (1 << 6)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_VC_MPU_VPACK_ST_SHIFT                                 6
-#define OMAP4430_VC_MPU_VPACK_ST_MASK                                  (1 << 6)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VC_RAERR_EN_SHIFT                                     12
-#define OMAP4430_VC_RAERR_EN_MASK                                      (1 << 12)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VC_RAERR_ST_SHIFT                                     12
-#define OMAP4430_VC_RAERR_ST_MASK                                      (1 << 12)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VC_SAERR_EN_SHIFT                                     11
-#define OMAP4430_VC_SAERR_EN_MASK                                      (1 << 11)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VC_SAERR_ST_SHIFT                                     11
-#define OMAP4430_VC_SAERR_ST_MASK                                      (1 << 11)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VC_TOERR_EN_SHIFT                                     13
-#define OMAP4430_VC_TOERR_EN_MASK                                      (1 << 13)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VC_TOERR_ST_SHIFT                                     13
-#define OMAP4430_VC_TOERR_ST_MASK                                      (1 << 13)
-
-/* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */
 #define OMAP4430_VDDMAX_SHIFT                                          24
-#define OMAP4430_VDDMAX_MASK                                           (0xff << 24)
-
-/* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */
 #define OMAP4430_VDDMIN_SHIFT                                          16
-#define OMAP4430_VDDMIN_MASK                                           (0xff << 16)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_VDD_CORE_I2C_DISABLE_SHIFT                            12
-#define OMAP4430_VDD_CORE_I2C_DISABLE_MASK                             (1 << 12)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_VDD_CORE_VOLT_MGR_RST_SHIFT                           8
-#define OMAP4430_VDD_CORE_VOLT_MGR_RST_MASK                            (1 << 8)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_VDD_IVA_I2C_DISABLE_SHIFT                             14
-#define OMAP4430_VDD_IVA_I2C_DISABLE_MASK                              (1 << 14)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_VDD_IVA_PRESENCE_SHIFT                                        9
-#define OMAP4430_VDD_IVA_PRESENCE_MASK                                 (1 << 9)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_VDD_IVA_VOLT_MGR_RST_SHIFT                            7
-#define OMAP4430_VDD_IVA_VOLT_MGR_RST_MASK                             (1 << 7)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_VDD_MPU_I2C_DISABLE_SHIFT                             13
-#define OMAP4430_VDD_MPU_I2C_DISABLE_MASK                              (1 << 13)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP4430_VDD_MPU_PRESENCE_SHIFT                                        8
-#define OMAP4430_VDD_MPU_PRESENCE_MASK                                 (1 << 8)
-
-/* Used by PRM_RSTST */
 #define OMAP4430_VDD_MPU_VOLT_MGR_RST_SHIFT                            6
-#define OMAP4430_VDD_MPU_VOLT_MGR_RST_MASK                             (1 << 6)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_RA_ERR_CORE_SHIFT                                        4
-#define OMAP4430_VFSM_RA_ERR_CORE_MASK                                 (1 << 4)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_RA_ERR_IVA_SHIFT                                 12
-#define OMAP4430_VFSM_RA_ERR_IVA_MASK                                  (1 << 12)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_RA_ERR_MPU_SHIFT                                 20
-#define OMAP4430_VFSM_RA_ERR_MPU_MASK                                  (1 << 20)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_SA_ERR_CORE_SHIFT                                        3
-#define OMAP4430_VFSM_SA_ERR_CORE_MASK                                 (1 << 3)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_SA_ERR_IVA_SHIFT                                 11
-#define OMAP4430_VFSM_SA_ERR_IVA_MASK                                  (1 << 11)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_SA_ERR_MPU_SHIFT                                 19
-#define OMAP4430_VFSM_SA_ERR_MPU_MASK                                  (1 << 19)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_TIMEOUT_ERR_CORE_SHIFT                           5
-#define OMAP4430_VFSM_TIMEOUT_ERR_CORE_MASK                            (1 << 5)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_TIMEOUT_ERR_IVA_SHIFT                            13
-#define OMAP4430_VFSM_TIMEOUT_ERR_IVA_MASK                             (1 << 13)
-
-/* Used by PRM_VC_ERRST */
-#define OMAP4430_VFSM_TIMEOUT_ERR_MPU_SHIFT                            21
-#define OMAP4430_VFSM_TIMEOUT_ERR_MPU_MASK                             (1 << 21)
-
-/* Used by PRM_VC_VAL_SMPS_RA_VOL */
-#define OMAP4430_VOLRA_VDD_CORE_L_SHIFT                                        0
 #define OMAP4430_VOLRA_VDD_CORE_L_MASK                                 (0xff << 0)
-
-/* Used by PRM_VC_VAL_SMPS_RA_VOL */
-#define OMAP4430_VOLRA_VDD_IVA_L_SHIFT                                 8
 #define OMAP4430_VOLRA_VDD_IVA_L_MASK                                  (0xff << 8)
-
-/* Used by PRM_VC_VAL_SMPS_RA_VOL */
-#define OMAP4430_VOLRA_VDD_MPU_L_SHIFT                                 16
 #define OMAP4430_VOLRA_VDD_MPU_L_MASK                                  (0xff << 16)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP4430_VPENABLE_SHIFT                                                0
 #define OMAP4430_VPENABLE_MASK                                         (1 << 0)
-
-/* Used by PRM_VP_CORE_STATUS, PRM_VP_IVA_STATUS, PRM_VP_MPU_STATUS */
-#define OMAP4430_VPINIDLE_SHIFT                                                0
-#define OMAP4430_VPINIDLE_MASK                                         (1 << 0)
-
-/* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_IVA_VOLTAGE, PRM_VP_MPU_VOLTAGE */
-#define OMAP4430_VPVOLTAGE_SHIFT                                       0
 #define OMAP4430_VPVOLTAGE_MASK                                                (0xff << 0)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_CORE_EQVALUE_EN_SHIFT                              20
-#define OMAP4430_VP_CORE_EQVALUE_EN_MASK                               (1 << 20)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_CORE_EQVALUE_ST_SHIFT                              20
-#define OMAP4430_VP_CORE_EQVALUE_ST_MASK                               (1 << 20)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_CORE_MAXVDD_EN_SHIFT                               18
-#define OMAP4430_VP_CORE_MAXVDD_EN_MASK                                        (1 << 18)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_CORE_MAXVDD_ST_SHIFT                               18
-#define OMAP4430_VP_CORE_MAXVDD_ST_MASK                                        (1 << 18)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_CORE_MINVDD_EN_SHIFT                               17
-#define OMAP4430_VP_CORE_MINVDD_EN_MASK                                        (1 << 17)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_CORE_MINVDD_ST_SHIFT                               17
-#define OMAP4430_VP_CORE_MINVDD_ST_MASK                                        (1 << 17)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_CORE_NOSMPSACK_EN_SHIFT                            19
-#define OMAP4430_VP_CORE_NOSMPSACK_EN_MASK                             (1 << 19)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_CORE_NOSMPSACK_ST_SHIFT                            19
-#define OMAP4430_VP_CORE_NOSMPSACK_ST_MASK                             (1 << 19)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_CORE_OPPCHANGEDONE_EN_SHIFT                                16
-#define OMAP4430_VP_CORE_OPPCHANGEDONE_EN_MASK                         (1 << 16)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_CORE_OPPCHANGEDONE_ST_SHIFT                                16
-#define OMAP4430_VP_CORE_OPPCHANGEDONE_ST_MASK                         (1 << 16)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_CORE_TRANXDONE_EN_SHIFT                            21
-#define OMAP4430_VP_CORE_TRANXDONE_EN_MASK                             (1 << 21)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_CORE_TRANXDONE_ST_SHIFT                            21
 #define OMAP4430_VP_CORE_TRANXDONE_ST_MASK                             (1 << 21)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_IVA_EQVALUE_EN_SHIFT                               28
-#define OMAP4430_VP_IVA_EQVALUE_EN_MASK                                        (1 << 28)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_IVA_EQVALUE_ST_SHIFT                               28
-#define OMAP4430_VP_IVA_EQVALUE_ST_MASK                                        (1 << 28)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_IVA_MAXVDD_EN_SHIFT                                        26
-#define OMAP4430_VP_IVA_MAXVDD_EN_MASK                                 (1 << 26)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_IVA_MAXVDD_ST_SHIFT                                        26
-#define OMAP4430_VP_IVA_MAXVDD_ST_MASK                                 (1 << 26)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_IVA_MINVDD_EN_SHIFT                                        25
-#define OMAP4430_VP_IVA_MINVDD_EN_MASK                                 (1 << 25)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_IVA_MINVDD_ST_SHIFT                                        25
-#define OMAP4430_VP_IVA_MINVDD_ST_MASK                                 (1 << 25)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_IVA_NOSMPSACK_EN_SHIFT                             27
-#define OMAP4430_VP_IVA_NOSMPSACK_EN_MASK                              (1 << 27)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_IVA_NOSMPSACK_ST_SHIFT                             27
-#define OMAP4430_VP_IVA_NOSMPSACK_ST_MASK                              (1 << 27)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_IVA_OPPCHANGEDONE_EN_SHIFT                         24
-#define OMAP4430_VP_IVA_OPPCHANGEDONE_EN_MASK                          (1 << 24)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_IVA_OPPCHANGEDONE_ST_SHIFT                         24
-#define OMAP4430_VP_IVA_OPPCHANGEDONE_ST_MASK                          (1 << 24)
-
-/* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */
-#define OMAP4430_VP_IVA_TRANXDONE_EN_SHIFT                             29
-#define OMAP4430_VP_IVA_TRANXDONE_EN_MASK                              (1 << 29)
-
-/* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */
-#define OMAP4430_VP_IVA_TRANXDONE_ST_SHIFT                             29
 #define OMAP4430_VP_IVA_TRANXDONE_ST_MASK                              (1 << 29)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_VP_MPU_EQVALUE_EN_SHIFT                               4
-#define OMAP4430_VP_MPU_EQVALUE_EN_MASK                                        (1 << 4)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_VP_MPU_EQVALUE_ST_SHIFT                               4
-#define OMAP4430_VP_MPU_EQVALUE_ST_MASK                                        (1 << 4)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_VP_MPU_MAXVDD_EN_SHIFT                                        2
-#define OMAP4430_VP_MPU_MAXVDD_EN_MASK                                 (1 << 2)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_VP_MPU_MAXVDD_ST_SHIFT                                        2
-#define OMAP4430_VP_MPU_MAXVDD_ST_MASK                                 (1 << 2)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_VP_MPU_MINVDD_EN_SHIFT                                        1
-#define OMAP4430_VP_MPU_MINVDD_EN_MASK                                 (1 << 1)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_VP_MPU_MINVDD_ST_SHIFT                                        1
-#define OMAP4430_VP_MPU_MINVDD_ST_MASK                                 (1 << 1)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_VP_MPU_NOSMPSACK_EN_SHIFT                             3
-#define OMAP4430_VP_MPU_NOSMPSACK_EN_MASK                              (1 << 3)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_VP_MPU_NOSMPSACK_ST_SHIFT                             3
-#define OMAP4430_VP_MPU_NOSMPSACK_ST_MASK                              (1 << 3)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_VP_MPU_OPPCHANGEDONE_EN_SHIFT                         0
-#define OMAP4430_VP_MPU_OPPCHANGEDONE_EN_MASK                          (1 << 0)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_VP_MPU_OPPCHANGEDONE_ST_SHIFT                         0
-#define OMAP4430_VP_MPU_OPPCHANGEDONE_ST_MASK                          (1 << 0)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP4430_VP_MPU_TRANXDONE_EN_SHIFT                             5
-#define OMAP4430_VP_MPU_TRANXDONE_EN_MASK                              (1 << 5)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP4430_VP_MPU_TRANXDONE_ST_SHIFT                             5
 #define OMAP4430_VP_MPU_TRANXDONE_ST_MASK                              (1 << 5)
-
-/* Used by PRM_SRAM_COUNT */
-#define OMAP4430_VSETUPCNT_VALUE_SHIFT                                 8
-#define OMAP4430_VSETUPCNT_VALUE_MASK                                  (0xff << 8)
-
-/* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_IVA_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */
 #define OMAP4430_VSTEPMAX_SHIFT                                                0
-#define OMAP4430_VSTEPMAX_MASK                                         (0xff << 0)
-
-/* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_IVA_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */
 #define OMAP4430_VSTEPMIN_SHIFT                                                0
-#define OMAP4430_VSTEPMIN_MASK                                         (0xff << 0)
-
-/* Used by PRM_MODEM_IF_CTRL */
-#define OMAP4430_WAKE_MODEM_SHIFT                                      0
-#define OMAP4430_WAKE_MODEM_MASK                                       (1 << 0)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DISPC_DUCATI_SHIFT                            1
-#define OMAP4430_WKUPDEP_DISPC_DUCATI_MASK                             (1 << 1)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DISPC_MPU_SHIFT                               0
-#define OMAP4430_WKUPDEP_DISPC_MPU_MASK                                        (1 << 0)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DISPC_SDMA_SHIFT                              3
-#define OMAP4430_WKUPDEP_DISPC_SDMA_MASK                               (1 << 3)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DISPC_TESLA_SHIFT                             2
-#define OMAP4430_WKUPDEP_DISPC_TESLA_MASK                              (1 << 2)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP4430_WKUPDEP_DMIC_DMA_SDMA_SHIFT                           7
-#define OMAP4430_WKUPDEP_DMIC_DMA_SDMA_MASK                            (1 << 7)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP4430_WKUPDEP_DMIC_DMA_TESLA_SHIFT                          6
-#define OMAP4430_WKUPDEP_DMIC_DMA_TESLA_MASK                           (1 << 6)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP4430_WKUPDEP_DMIC_IRQ_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_DMIC_IRQ_MPU_MASK                             (1 << 0)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP4430_WKUPDEP_DMIC_IRQ_TESLA_SHIFT                          2
-#define OMAP4430_WKUPDEP_DMIC_IRQ_TESLA_MASK                           (1 << 2)
-
-/* Used by PM_L4PER_DMTIMER10_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER10_MPU_SHIFT                           0
-#define OMAP4430_WKUPDEP_DMTIMER10_MPU_MASK                            (1 << 0)
-
-/* Used by PM_L4PER_DMTIMER11_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER11_DUCATI_SHIFT                                1
-#define OMAP4430_WKUPDEP_DMTIMER11_DUCATI_MASK                         (1 << 1)
-
-/* Used by PM_L4PER_DMTIMER11_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER11_MPU_SHIFT                           0
-#define OMAP4430_WKUPDEP_DMTIMER11_MPU_MASK                            (1 << 0)
-
-/* Used by PM_L4PER_DMTIMER2_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER2_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_DMTIMER2_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L4PER_DMTIMER3_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER3_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_DMTIMER3_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L4PER_DMTIMER3_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER3_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_DMTIMER3_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L4PER_DMTIMER4_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER4_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_DMTIMER4_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L4PER_DMTIMER4_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER4_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_DMTIMER4_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L4PER_DMTIMER9_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER9_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_DMTIMER9_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L4PER_DMTIMER9_WKDEP */
-#define OMAP4430_WKUPDEP_DMTIMER9_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_DMTIMER9_MPU_MASK                             (1 << 0)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI1_DUCATI_SHIFT                             5
-#define OMAP4430_WKUPDEP_DSI1_DUCATI_MASK                              (1 << 5)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI1_MPU_SHIFT                                        4
-#define OMAP4430_WKUPDEP_DSI1_MPU_MASK                                 (1 << 4)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI1_SDMA_SHIFT                               7
-#define OMAP4430_WKUPDEP_DSI1_SDMA_MASK                                        (1 << 7)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI1_TESLA_SHIFT                              6
-#define OMAP4430_WKUPDEP_DSI1_TESLA_MASK                               (1 << 6)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI2_DUCATI_SHIFT                             9
-#define OMAP4430_WKUPDEP_DSI2_DUCATI_MASK                              (1 << 9)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI2_MPU_SHIFT                                        8
-#define OMAP4430_WKUPDEP_DSI2_MPU_MASK                                 (1 << 8)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI2_SDMA_SHIFT                               11
-#define OMAP4430_WKUPDEP_DSI2_SDMA_MASK                                        (1 << 11)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_DSI2_TESLA_SHIFT                              10
-#define OMAP4430_WKUPDEP_DSI2_TESLA_MASK                               (1 << 10)
-
-/* Used by PM_WKUP_GPIO1_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO1_IRQ1_DUCATI_SHIFT                       1
-#define OMAP4430_WKUPDEP_GPIO1_IRQ1_DUCATI_MASK                                (1 << 1)
-
-/* Used by PM_WKUP_GPIO1_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO1_IRQ1_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_GPIO1_IRQ1_MPU_MASK                           (1 << 0)
-
-/* Used by PM_WKUP_GPIO1_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO1_IRQ2_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_GPIO1_IRQ2_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_L4PER_GPIO2_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO2_IRQ1_DUCATI_SHIFT                       1
-#define OMAP4430_WKUPDEP_GPIO2_IRQ1_DUCATI_MASK                                (1 << 1)
-
-/* Used by PM_L4PER_GPIO2_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO2_IRQ1_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_GPIO2_IRQ1_MPU_MASK                           (1 << 0)
-
-/* Used by PM_L4PER_GPIO2_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO2_IRQ2_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_GPIO2_IRQ2_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_L4PER_GPIO3_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO3_IRQ1_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_GPIO3_IRQ1_MPU_MASK                           (1 << 0)
-
-/* Used by PM_L4PER_GPIO3_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO3_IRQ2_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_GPIO3_IRQ2_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_L4PER_GPIO4_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO4_IRQ1_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_GPIO4_IRQ1_MPU_MASK                           (1 << 0)
-
-/* Used by PM_L4PER_GPIO4_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO4_IRQ2_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_GPIO4_IRQ2_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_L4PER_GPIO5_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO5_IRQ1_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_GPIO5_IRQ1_MPU_MASK                           (1 << 0)
-
-/* Used by PM_L4PER_GPIO5_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO5_IRQ2_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_GPIO5_IRQ2_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_L4PER_GPIO6_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO6_IRQ1_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_GPIO6_IRQ1_MPU_MASK                           (1 << 0)
-
-/* Used by PM_L4PER_GPIO6_WKDEP */
-#define OMAP4430_WKUPDEP_GPIO6_IRQ2_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_GPIO6_IRQ2_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_HDMIDMA_SDMA_SHIFT                            19
-#define OMAP4430_WKUPDEP_HDMIDMA_SDMA_MASK                             (1 << 19)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_HDMIIRQ_DUCATI_SHIFT                          13
-#define OMAP4430_WKUPDEP_HDMIIRQ_DUCATI_MASK                           (1 << 13)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_HDMIIRQ_MPU_SHIFT                             12
-#define OMAP4430_WKUPDEP_HDMIIRQ_MPU_MASK                              (1 << 12)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP4430_WKUPDEP_HDMIIRQ_TESLA_SHIFT                           14
-#define OMAP4430_WKUPDEP_HDMIIRQ_TESLA_MASK                            (1 << 14)
-
-/* Used by PM_L4PER_HECC1_WKDEP */
-#define OMAP4430_WKUPDEP_HECC1_MPU_SHIFT                               0
-#define OMAP4430_WKUPDEP_HECC1_MPU_MASK                                        (1 << 0)
-
-/* Used by PM_L4PER_HECC2_WKDEP */
-#define OMAP4430_WKUPDEP_HECC2_MPU_SHIFT                               0
-#define OMAP4430_WKUPDEP_HECC2_MPU_MASK                                        (1 << 0)
-
-/* Used by PM_L3INIT_HSI_WKDEP */
-#define OMAP4430_WKUPDEP_HSI_DSP_TESLA_SHIFT                           6
-#define OMAP4430_WKUPDEP_HSI_DSP_TESLA_MASK                            (1 << 6)
-
-/* Used by PM_L3INIT_HSI_WKDEP */
-#define OMAP4430_WKUPDEP_HSI_MCU_DUCATI_SHIFT                          1
-#define OMAP4430_WKUPDEP_HSI_MCU_DUCATI_MASK                           (1 << 1)
-
-/* Used by PM_L3INIT_HSI_WKDEP */
-#define OMAP4430_WKUPDEP_HSI_MCU_MPU_SHIFT                             0
-#define OMAP4430_WKUPDEP_HSI_MCU_MPU_MASK                              (1 << 0)
-
-/* Used by PM_L4PER_I2C1_WKDEP */
-#define OMAP4430_WKUPDEP_I2C1_DMA_SDMA_SHIFT                           7
-#define OMAP4430_WKUPDEP_I2C1_DMA_SDMA_MASK                            (1 << 7)
-
-/* Used by PM_L4PER_I2C1_WKDEP */
-#define OMAP4430_WKUPDEP_I2C1_IRQ_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_I2C1_IRQ_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L4PER_I2C1_WKDEP */
-#define OMAP4430_WKUPDEP_I2C1_IRQ_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_I2C1_IRQ_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L4PER_I2C2_WKDEP */
-#define OMAP4430_WKUPDEP_I2C2_DMA_SDMA_SHIFT                           7
-#define OMAP4430_WKUPDEP_I2C2_DMA_SDMA_MASK                            (1 << 7)
-
-/* Used by PM_L4PER_I2C2_WKDEP */
-#define OMAP4430_WKUPDEP_I2C2_IRQ_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_I2C2_IRQ_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L4PER_I2C2_WKDEP */
-#define OMAP4430_WKUPDEP_I2C2_IRQ_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_I2C2_IRQ_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L4PER_I2C3_WKDEP */
-#define OMAP4430_WKUPDEP_I2C3_DMA_SDMA_SHIFT                           7
-#define OMAP4430_WKUPDEP_I2C3_DMA_SDMA_MASK                            (1 << 7)
-
-/* Used by PM_L4PER_I2C3_WKDEP */
-#define OMAP4430_WKUPDEP_I2C3_IRQ_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_I2C3_IRQ_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L4PER_I2C3_WKDEP */
-#define OMAP4430_WKUPDEP_I2C3_IRQ_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_I2C3_IRQ_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L4PER_I2C4_WKDEP */
-#define OMAP4430_WKUPDEP_I2C4_DMA_SDMA_SHIFT                           7
-#define OMAP4430_WKUPDEP_I2C4_DMA_SDMA_MASK                            (1 << 7)
-
-/* Used by PM_L4PER_I2C4_WKDEP */
-#define OMAP4430_WKUPDEP_I2C4_IRQ_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_I2C4_IRQ_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L4PER_I2C4_WKDEP */
-#define OMAP4430_WKUPDEP_I2C4_IRQ_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_I2C4_IRQ_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L4PER_I2C5_WKDEP */
-#define OMAP4430_WKUPDEP_I2C5_DMA_SDMA_SHIFT                           7
-#define OMAP4430_WKUPDEP_I2C5_DMA_SDMA_MASK                            (1 << 7)
-
-/* Used by PM_L4PER_I2C5_WKDEP */
-#define OMAP4430_WKUPDEP_I2C5_IRQ_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_I2C5_IRQ_MPU_MASK                             (1 << 0)
-
-/* Used by PM_WKUP_KEYBOARD_WKDEP */
-#define OMAP4430_WKUPDEP_KEYBOARD_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_KEYBOARD_MPU_MASK                             (1 << 0)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP1_DMA_SDMA_SHIFT                         7
-#define OMAP4430_WKUPDEP_MCASP1_DMA_SDMA_MASK                          (1 << 7)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP1_DMA_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_MCASP1_DMA_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP1_IRQ_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_MCASP1_IRQ_MPU_MASK                           (1 << 0)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP1_IRQ_TESLA_SHIFT                                2
-#define OMAP4430_WKUPDEP_MCASP1_IRQ_TESLA_MASK                         (1 << 2)
-
-/* Used by PM_L4PER_MCASP2_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP2_DMA_SDMA_SHIFT                         7
-#define OMAP4430_WKUPDEP_MCASP2_DMA_SDMA_MASK                          (1 << 7)
-
-/* Used by PM_L4PER_MCASP2_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP2_DMA_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_MCASP2_DMA_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_L4PER_MCASP2_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP2_IRQ_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_MCASP2_IRQ_MPU_MASK                           (1 << 0)
-
-/* Used by PM_L4PER_MCASP2_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP2_IRQ_TESLA_SHIFT                                2
-#define OMAP4430_WKUPDEP_MCASP2_IRQ_TESLA_MASK                         (1 << 2)
-
-/* Used by PM_L4PER_MCASP3_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP3_DMA_SDMA_SHIFT                         7
-#define OMAP4430_WKUPDEP_MCASP3_DMA_SDMA_MASK                          (1 << 7)
-
-/* Used by PM_L4PER_MCASP3_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP3_DMA_TESLA_SHIFT                                6
-#define OMAP4430_WKUPDEP_MCASP3_DMA_TESLA_MASK                         (1 << 6)
-
-/* Used by PM_L4PER_MCASP3_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP3_IRQ_MPU_SHIFT                          0
-#define OMAP4430_WKUPDEP_MCASP3_IRQ_MPU_MASK                           (1 << 0)
-
-/* Used by PM_L4PER_MCASP3_WKDEP */
-#define OMAP4430_WKUPDEP_MCASP3_IRQ_TESLA_SHIFT                                2
-#define OMAP4430_WKUPDEP_MCASP3_IRQ_TESLA_MASK                         (1 << 2)
-
-/* Used by PM_ABE_MCBSP1_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP1_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCBSP1_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_MCBSP1_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP1_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCBSP1_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_ABE_MCBSP1_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP1_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_MCBSP1_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_ABE_MCBSP2_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP2_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCBSP2_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_MCBSP2_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP2_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCBSP2_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_ABE_MCBSP2_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP2_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_MCBSP2_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_ABE_MCBSP3_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP3_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCBSP3_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_MCBSP3_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP3_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCBSP3_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_ABE_MCBSP3_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP3_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_MCBSP3_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_L4PER_MCBSP4_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP4_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCBSP4_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MCBSP4_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP4_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCBSP4_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L4PER_MCBSP4_WKDEP */
-#define OMAP4430_WKUPDEP_MCBSP4_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_MCBSP4_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI1_DUCATI_SHIFT                           1
-#define OMAP4430_WKUPDEP_MCSPI1_DUCATI_MASK                            (1 << 1)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI1_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCSPI1_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI1_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCSPI1_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI1_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_MCSPI1_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_L4PER_MCSPI2_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI2_DUCATI_SHIFT                           1
-#define OMAP4430_WKUPDEP_MCSPI2_DUCATI_MASK                            (1 << 1)
-
-/* Used by PM_L4PER_MCSPI2_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI2_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCSPI2_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MCSPI2_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI2_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCSPI2_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L4PER_MCSPI3_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI3_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCSPI3_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MCSPI3_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI3_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCSPI3_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L4PER_MCSPI4_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI4_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MCSPI4_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MCSPI4_WKDEP */
-#define OMAP4430_WKUPDEP_MCSPI4_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MCSPI4_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP4430_WKUPDEP_MMC1_DUCATI_SHIFT                             1
-#define OMAP4430_WKUPDEP_MMC1_DUCATI_MASK                              (1 << 1)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP4430_WKUPDEP_MMC1_MPU_SHIFT                                        0
-#define OMAP4430_WKUPDEP_MMC1_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP4430_WKUPDEP_MMC1_SDMA_SHIFT                               3
-#define OMAP4430_WKUPDEP_MMC1_SDMA_MASK                                        (1 << 3)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP4430_WKUPDEP_MMC1_TESLA_SHIFT                              2
-#define OMAP4430_WKUPDEP_MMC1_TESLA_MASK                               (1 << 2)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP4430_WKUPDEP_MMC2_DUCATI_SHIFT                             1
-#define OMAP4430_WKUPDEP_MMC2_DUCATI_MASK                              (1 << 1)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP4430_WKUPDEP_MMC2_MPU_SHIFT                                        0
-#define OMAP4430_WKUPDEP_MMC2_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP4430_WKUPDEP_MMC2_SDMA_SHIFT                               3
-#define OMAP4430_WKUPDEP_MMC2_SDMA_MASK                                        (1 << 3)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP4430_WKUPDEP_MMC2_TESLA_SHIFT                              2
-#define OMAP4430_WKUPDEP_MMC2_TESLA_MASK                               (1 << 2)
-
-/* Used by PM_L3INIT_MMC6_WKDEP */
-#define OMAP4430_WKUPDEP_MMC6_DUCATI_SHIFT                             1
-#define OMAP4430_WKUPDEP_MMC6_DUCATI_MASK                              (1 << 1)
-
-/* Used by PM_L3INIT_MMC6_WKDEP */
-#define OMAP4430_WKUPDEP_MMC6_MPU_SHIFT                                        0
-#define OMAP4430_WKUPDEP_MMC6_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_L3INIT_MMC6_WKDEP */
-#define OMAP4430_WKUPDEP_MMC6_TESLA_SHIFT                              2
-#define OMAP4430_WKUPDEP_MMC6_TESLA_MASK                               (1 << 2)
-
-/* Used by PM_L4PER_MMCSD3_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD3_DUCATI_SHIFT                           1
-#define OMAP4430_WKUPDEP_MMCSD3_DUCATI_MASK                            (1 << 1)
-
-/* Used by PM_L4PER_MMCSD3_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD3_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MMCSD3_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MMCSD3_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD3_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MMCSD3_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L4PER_MMCSD4_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD4_DUCATI_SHIFT                           1
-#define OMAP4430_WKUPDEP_MMCSD4_DUCATI_MASK                            (1 << 1)
-
-/* Used by PM_L4PER_MMCSD4_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD4_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MMCSD4_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MMCSD4_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD4_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MMCSD4_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L4PER_MMCSD5_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD5_DUCATI_SHIFT                           1
-#define OMAP4430_WKUPDEP_MMCSD5_DUCATI_MASK                            (1 << 1)
-
-/* Used by PM_L4PER_MMCSD5_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD5_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_MMCSD5_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L4PER_MMCSD5_WKDEP */
-#define OMAP4430_WKUPDEP_MMCSD5_SDMA_SHIFT                             3
-#define OMAP4430_WKUPDEP_MMCSD5_SDMA_MASK                              (1 << 3)
-
-/* Used by PM_L3INIT_PCIESS_WKDEP */
-#define OMAP4430_WKUPDEP_PCIESS_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_PCIESS_MPU_MASK                               (1 << 0)
-
-/* Used by PM_L3INIT_PCIESS_WKDEP */
-#define OMAP4430_WKUPDEP_PCIESS_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_PCIESS_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_ABE_PDM_WKDEP */
-#define OMAP4430_WKUPDEP_PDM_DMA_SDMA_SHIFT                            7
-#define OMAP4430_WKUPDEP_PDM_DMA_SDMA_MASK                             (1 << 7)
-
-/* Used by PM_ABE_PDM_WKDEP */
-#define OMAP4430_WKUPDEP_PDM_DMA_TESLA_SHIFT                           6
-#define OMAP4430_WKUPDEP_PDM_DMA_TESLA_MASK                            (1 << 6)
-
-/* Used by PM_ABE_PDM_WKDEP */
-#define OMAP4430_WKUPDEP_PDM_IRQ_MPU_SHIFT                             0
-#define OMAP4430_WKUPDEP_PDM_IRQ_MPU_MASK                              (1 << 0)
-
-/* Used by PM_ABE_PDM_WKDEP */
-#define OMAP4430_WKUPDEP_PDM_IRQ_TESLA_SHIFT                           2
-#define OMAP4430_WKUPDEP_PDM_IRQ_TESLA_MASK                            (1 << 2)
-
-/* Used by PM_WKUP_RTC_WKDEP */
-#define OMAP4430_WKUPDEP_RTC_MPU_SHIFT                                 0
-#define OMAP4430_WKUPDEP_RTC_MPU_MASK                                  (1 << 0)
-
-/* Used by PM_L3INIT_SATA_WKDEP */
-#define OMAP4430_WKUPDEP_SATA_MPU_SHIFT                                        0
-#define OMAP4430_WKUPDEP_SATA_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_L3INIT_SATA_WKDEP */
-#define OMAP4430_WKUPDEP_SATA_TESLA_SHIFT                              2
-#define OMAP4430_WKUPDEP_SATA_TESLA_MASK                               (1 << 2)
-
-/* Used by PM_ABE_SLIMBUS_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS1_DMA_SDMA_SHIFT                       7
-#define OMAP4430_WKUPDEP_SLIMBUS1_DMA_SDMA_MASK                                (1 << 7)
-
-/* Used by PM_ABE_SLIMBUS_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS1_DMA_TESLA_SHIFT                      6
-#define OMAP4430_WKUPDEP_SLIMBUS1_DMA_TESLA_MASK                       (1 << 6)
-
-/* Used by PM_ABE_SLIMBUS_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_MPU_SHIFT                                0
-#define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_MPU_MASK                         (1 << 0)
-
-/* Used by PM_ABE_SLIMBUS_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_TESLA_SHIFT                      2
-#define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_TESLA_MASK                       (1 << 2)
-
-/* Used by PM_L4PER_SLIMBUS2_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS2_DMA_SDMA_SHIFT                       7
-#define OMAP4430_WKUPDEP_SLIMBUS2_DMA_SDMA_MASK                                (1 << 7)
-
-/* Used by PM_L4PER_SLIMBUS2_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS2_DMA_TESLA_SHIFT                      6
-#define OMAP4430_WKUPDEP_SLIMBUS2_DMA_TESLA_MASK                       (1 << 6)
-
-/* Used by PM_L4PER_SLIMBUS2_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_MPU_SHIFT                                0
-#define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_MPU_MASK                         (1 << 0)
-
-/* Used by PM_L4PER_SLIMBUS2_WKDEP */
-#define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_TESLA_SHIFT                      2
-#define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_TESLA_MASK                       (1 << 2)
-
-/* Used by PM_ALWON_SR_CORE_WKDEP */
-#define OMAP4430_WKUPDEP_SR_CORE_DUCATI_SHIFT                          1
-#define OMAP4430_WKUPDEP_SR_CORE_DUCATI_MASK                           (1 << 1)
-
-/* Used by PM_ALWON_SR_CORE_WKDEP */
-#define OMAP4430_WKUPDEP_SR_CORE_MPU_SHIFT                             0
-#define OMAP4430_WKUPDEP_SR_CORE_MPU_MASK                              (1 << 0)
-
-/* Used by PM_ALWON_SR_IVA_WKDEP */
-#define OMAP4430_WKUPDEP_SR_IVA_DUCATI_SHIFT                           1
-#define OMAP4430_WKUPDEP_SR_IVA_DUCATI_MASK                            (1 << 1)
-
-/* Used by PM_ALWON_SR_IVA_WKDEP */
-#define OMAP4430_WKUPDEP_SR_IVA_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_SR_IVA_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ALWON_SR_MPU_WKDEP */
-#define OMAP4430_WKUPDEP_SR_MPU_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_SR_MPU_MPU_MASK                               (1 << 0)
-
-/* Used by PM_WKUP_TIMER12_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER12_MPU_SHIFT                             0
-#define OMAP4430_WKUPDEP_TIMER12_MPU_MASK                              (1 << 0)
-
-/* Used by PM_WKUP_TIMER1_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER1_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_TIMER1_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_TIMER5_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER5_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_TIMER5_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_TIMER5_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER5_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_TIMER5_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_ABE_TIMER6_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER6_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_TIMER6_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_TIMER6_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER6_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_TIMER6_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_ABE_TIMER7_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER7_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_TIMER7_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_TIMER7_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER7_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_TIMER7_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_ABE_TIMER8_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER8_MPU_SHIFT                              0
-#define OMAP4430_WKUPDEP_TIMER8_MPU_MASK                               (1 << 0)
-
-/* Used by PM_ABE_TIMER8_WKDEP */
-#define OMAP4430_WKUPDEP_TIMER8_TESLA_SHIFT                            2
-#define OMAP4430_WKUPDEP_TIMER8_TESLA_MASK                             (1 << 2)
-
-/* Used by PM_L4PER_UART1_WKDEP */
-#define OMAP4430_WKUPDEP_UART1_MPU_SHIFT                               0
-#define OMAP4430_WKUPDEP_UART1_MPU_MASK                                        (1 << 0)
-
-/* Used by PM_L4PER_UART1_WKDEP */
-#define OMAP4430_WKUPDEP_UART1_SDMA_SHIFT                              3
-#define OMAP4430_WKUPDEP_UART1_SDMA_MASK                               (1 << 3)
-
-/* Used by PM_L4PER_UART2_WKDEP */
-#define OMAP4430_WKUPDEP_UART2_MPU_SHIFT                               0
-#define OMAP4430_WKUPDEP_UART2_MPU_MASK                                        (1 << 0)
-
-/* Used by PM_L4PER_UART2_WKDEP */
-#define OMAP4430_WKUPDEP_UART2_SDMA_SHIFT                              3
-#define OMAP4430_WKUPDEP_UART2_SDMA_MASK                               (1 << 3)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP4430_WKUPDEP_UART3_DUCATI_SHIFT                            1
-#define OMAP4430_WKUPDEP_UART3_DUCATI_MASK                             (1 << 1)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP4430_WKUPDEP_UART3_MPU_SHIFT                               0
-#define OMAP4430_WKUPDEP_UART3_MPU_MASK                                        (1 << 0)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP4430_WKUPDEP_UART3_SDMA_SHIFT                              3
-#define OMAP4430_WKUPDEP_UART3_SDMA_MASK                               (1 << 3)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP4430_WKUPDEP_UART3_TESLA_SHIFT                             2
-#define OMAP4430_WKUPDEP_UART3_TESLA_MASK                              (1 << 2)
-
-/* Used by PM_L4PER_UART4_WKDEP */
-#define OMAP4430_WKUPDEP_UART4_MPU_SHIFT                               0
-#define OMAP4430_WKUPDEP_UART4_MPU_MASK                                        (1 << 0)
-
-/* Used by PM_L4PER_UART4_WKDEP */
-#define OMAP4430_WKUPDEP_UART4_SDMA_SHIFT                              3
-#define OMAP4430_WKUPDEP_UART4_SDMA_MASK                               (1 << 3)
-
-/* Used by PM_L3INIT_UNIPRO1_WKDEP */
-#define OMAP4430_WKUPDEP_UNIPRO1_DUCATI_SHIFT                          1
-#define OMAP4430_WKUPDEP_UNIPRO1_DUCATI_MASK                           (1 << 1)
-
-/* Used by PM_L3INIT_UNIPRO1_WKDEP */
-#define OMAP4430_WKUPDEP_UNIPRO1_MPU_SHIFT                             0
-#define OMAP4430_WKUPDEP_UNIPRO1_MPU_MASK                              (1 << 0)
-
-/* Used by PM_L3INIT_USB_HOST_WKDEP */
-#define OMAP4430_WKUPDEP_USB_HOST_DUCATI_SHIFT                         1
-#define OMAP4430_WKUPDEP_USB_HOST_DUCATI_MASK                          (1 << 1)
-
-/* Used by PM_L3INIT_USB_HOST_FS_WKDEP */
-#define OMAP4430_WKUPDEP_USB_HOST_FS_DUCATI_SHIFT                      1
-#define OMAP4430_WKUPDEP_USB_HOST_FS_DUCATI_MASK                       (1 << 1)
-
-/* Used by PM_L3INIT_USB_HOST_FS_WKDEP */
-#define OMAP4430_WKUPDEP_USB_HOST_FS_MPU_SHIFT                         0
-#define OMAP4430_WKUPDEP_USB_HOST_FS_MPU_MASK                          (1 << 0)
-
-/* Used by PM_L3INIT_USB_HOST_WKDEP */
-#define OMAP4430_WKUPDEP_USB_HOST_MPU_SHIFT                            0
-#define OMAP4430_WKUPDEP_USB_HOST_MPU_MASK                             (1 << 0)
-
-/* Used by PM_L3INIT_USB_OTG_WKDEP */
-#define OMAP4430_WKUPDEP_USB_OTG_DUCATI_SHIFT                          1
-#define OMAP4430_WKUPDEP_USB_OTG_DUCATI_MASK                           (1 << 1)
-
-/* Used by PM_L3INIT_USB_OTG_WKDEP */
-#define OMAP4430_WKUPDEP_USB_OTG_MPU_SHIFT                             0
-#define OMAP4430_WKUPDEP_USB_OTG_MPU_MASK                              (1 << 0)
-
-/* Used by PM_L3INIT_USB_TLL_WKDEP */
-#define OMAP4430_WKUPDEP_USB_TLL_DUCATI_SHIFT                          1
-#define OMAP4430_WKUPDEP_USB_TLL_DUCATI_MASK                           (1 << 1)
-
-/* Used by PM_L3INIT_USB_TLL_WKDEP */
-#define OMAP4430_WKUPDEP_USB_TLL_MPU_SHIFT                             0
-#define OMAP4430_WKUPDEP_USB_TLL_MPU_MASK                              (1 << 0)
-
-/* Used by PM_WKUP_USIM_WKDEP */
-#define OMAP4430_WKUPDEP_USIM_MPU_SHIFT                                        0
-#define OMAP4430_WKUPDEP_USIM_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_WKUP_USIM_WKDEP */
-#define OMAP4430_WKUPDEP_USIM_SDMA_SHIFT                               3
-#define OMAP4430_WKUPDEP_USIM_SDMA_MASK                                        (1 << 3)
-
-/* Used by PM_WKUP_WDT2_WKDEP */
-#define OMAP4430_WKUPDEP_WDT2_DUCATI_SHIFT                             1
-#define OMAP4430_WKUPDEP_WDT2_DUCATI_MASK                              (1 << 1)
-
-/* Used by PM_WKUP_WDT2_WKDEP */
-#define OMAP4430_WKUPDEP_WDT2_MPU_SHIFT                                        0
-#define OMAP4430_WKUPDEP_WDT2_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_ABE_WDT3_WKDEP */
-#define OMAP4430_WKUPDEP_WDT3_MPU_SHIFT                                        0
-#define OMAP4430_WKUPDEP_WDT3_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_L3INIT_HSI_WKDEP */
-#define OMAP4430_WKUPDEP_WGM_HSI_WAKE_MPU_SHIFT                                8
-#define OMAP4430_WKUPDEP_WGM_HSI_WAKE_MPU_MASK                         (1 << 8)
-
-/* Used by PM_L3INIT_XHPI_WKDEP */
-#define OMAP4430_WKUPDEP_XHPI_DUCATI_SHIFT                             1
-#define OMAP4430_WKUPDEP_XHPI_DUCATI_MASK                              (1 << 1)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP4430_WUCLK_CTRL_SHIFT                                      8
 #define OMAP4430_WUCLK_CTRL_MASK                                       (1 << 8)
-
-/* Used by PRM_IO_PMCTRL */
 #define OMAP4430_WUCLK_STATUS_SHIFT                                    9
 #define OMAP4430_WUCLK_STATUS_MASK                                     (1 << 9)
-
-/* Used by REVISION_PRM */
-#define OMAP4430_X_MAJOR_SHIFT                                         8
-#define OMAP4430_X_MAJOR_MASK                                          (0x7 << 8)
-
-/* Used by REVISION_PRM */
-#define OMAP4430_Y_MINOR_SHIFT                                         0
-#define OMAP4430_Y_MINOR_MASK                                          (0x3f << 0)
 #endif
diff --git a/arch/arm/mach-omap2/prm-regbits-54xx.h b/arch/arm/mach-omap2/prm-regbits-54xx.h
deleted file mode 100644 (file)
index be31b21..0000000
+++ /dev/null
@@ -1,2701 +0,0 @@
-/*
- * OMAP54xx Power Management register bits
- *
- * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
- *
- * Paul Walmsley (paul@pwsan.com)
- * Rajendra Nayak (rnayak@ti.com)
- * Benoit Cousson (b-cousson@ti.com)
- *
- * This file is automatically generated from the OMAP hardware databases.
- * We respectfully ask that any modifications to this file be coordinated
- * with the public linux-omap@vger.kernel.org mailing list and the
- * authors above to ensure that the autogeneration scripts are kept
- * up-to-date with the file contents.
- *
- * 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 __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_54XX_H
-#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_54XX_H
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_ABBOFF_ACT_SHIFT                                              1
-#define OMAP54XX_ABBOFF_ACT_WIDTH                                              0x1
-#define OMAP54XX_ABBOFF_ACT_MASK                                               (1 << 1)
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_ABBOFF_SLEEP_SHIFT                                            2
-#define OMAP54XX_ABBOFF_SLEEP_WIDTH                                            0x1
-#define OMAP54XX_ABBOFF_SLEEP_MASK                                             (1 << 2)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_ABB_MM_DONE_EN_SHIFT                                          31
-#define OMAP54XX_ABB_MM_DONE_EN_WIDTH                                          0x1
-#define OMAP54XX_ABB_MM_DONE_EN_MASK                                           (1 << 31)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_ABB_MM_DONE_ST_SHIFT                                          31
-#define OMAP54XX_ABB_MM_DONE_ST_WIDTH                                          0x1
-#define OMAP54XX_ABB_MM_DONE_ST_MASK                                           (1 << 31)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_ABB_MPU_DONE_EN_SHIFT                                         7
-#define OMAP54XX_ABB_MPU_DONE_EN_WIDTH                                         0x1
-#define OMAP54XX_ABB_MPU_DONE_EN_MASK                                          (1 << 7)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_ABB_MPU_DONE_ST_SHIFT                                         7
-#define OMAP54XX_ABB_MPU_DONE_ST_WIDTH                                         0x1
-#define OMAP54XX_ABB_MPU_DONE_ST_MASK                                          (1 << 7)
-
-/* Used by PRM_ABBLDO_MM_SETUP, PRM_ABBLDO_MPU_SETUP */
-#define OMAP54XX_ACTIVE_FBB_SEL_SHIFT                                          2
-#define OMAP54XX_ACTIVE_FBB_SEL_WIDTH                                          0x1
-#define OMAP54XX_ACTIVE_FBB_SEL_MASK                                           (1 << 2)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP54XX_AESSMEM_ONSTATE_SHIFT                                         16
-#define OMAP54XX_AESSMEM_ONSTATE_WIDTH                                         0x2
-#define OMAP54XX_AESSMEM_ONSTATE_MASK                                          (0x3 << 16)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP54XX_AESSMEM_RETSTATE_SHIFT                                                8
-#define OMAP54XX_AESSMEM_RETSTATE_WIDTH                                                0x1
-#define OMAP54XX_AESSMEM_RETSTATE_MASK                                         (1 << 8)
-
-/* Used by PM_ABE_PWRSTST */
-#define OMAP54XX_AESSMEM_STATEST_SHIFT                                         4
-#define OMAP54XX_AESSMEM_STATEST_WIDTH                                         0x2
-#define OMAP54XX_AESSMEM_STATEST_MASK                                          (0x3 << 4)
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_AIPOFF_SHIFT                                                  8
-#define OMAP54XX_AIPOFF_WIDTH                                                  0x1
-#define OMAP54XX_AIPOFF_MASK                                                   (1 << 8)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_AUTO_CTRL_VDD_CORE_L_SHIFT                                    0
-#define OMAP54XX_AUTO_CTRL_VDD_CORE_L_WIDTH                                    0x2
-#define OMAP54XX_AUTO_CTRL_VDD_CORE_L_MASK                                     (0x3 << 0)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_AUTO_CTRL_VDD_MM_L_SHIFT                                      4
-#define OMAP54XX_AUTO_CTRL_VDD_MM_L_WIDTH                                      0x2
-#define OMAP54XX_AUTO_CTRL_VDD_MM_L_MASK                                       (0x3 << 4)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_AUTO_CTRL_VDD_MPU_L_SHIFT                                     2
-#define OMAP54XX_AUTO_CTRL_VDD_MPU_L_WIDTH                                     0x2
-#define OMAP54XX_AUTO_CTRL_VDD_MPU_L_MASK                                      (0x3 << 2)
-
-/* Used by PRM_VC_BYPASS_ERRST */
-#define OMAP54XX_BYPS_RA_ERR_SHIFT                                             1
-#define OMAP54XX_BYPS_RA_ERR_WIDTH                                             0x1
-#define OMAP54XX_BYPS_RA_ERR_MASK                                              (1 << 1)
-
-/* Used by PRM_VC_BYPASS_ERRST */
-#define OMAP54XX_BYPS_SA_ERR_SHIFT                                             0
-#define OMAP54XX_BYPS_SA_ERR_WIDTH                                             0x1
-#define OMAP54XX_BYPS_SA_ERR_MASK                                              (1 << 0)
-
-/* Used by PRM_VC_BYPASS_ERRST */
-#define OMAP54XX_BYPS_TIMEOUT_ERR_SHIFT                                                2
-#define OMAP54XX_BYPS_TIMEOUT_ERR_WIDTH                                                0x1
-#define OMAP54XX_BYPS_TIMEOUT_ERR_MASK                                         (1 << 2)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_C2C_RST_SHIFT                                                 10
-#define OMAP54XX_C2C_RST_WIDTH                                                 0x1
-#define OMAP54XX_C2C_RST_MASK                                                  (1 << 10)
-
-/* Used by PM_CAM_PWRSTCTRL */
-#define OMAP54XX_CAM_MEM_ONSTATE_SHIFT                                         16
-#define OMAP54XX_CAM_MEM_ONSTATE_WIDTH                                         0x2
-#define OMAP54XX_CAM_MEM_ONSTATE_MASK                                          (0x3 << 16)
-
-/* Used by PM_CAM_PWRSTST */
-#define OMAP54XX_CAM_MEM_STATEST_SHIFT                                         4
-#define OMAP54XX_CAM_MEM_STATEST_WIDTH                                         0x2
-#define OMAP54XX_CAM_MEM_STATEST_MASK                                          (0x3 << 4)
-
-/* Used by PRM_CLKREQCTRL */
-#define OMAP54XX_CLKREQ_COND_SHIFT                                             0
-#define OMAP54XX_CLKREQ_COND_WIDTH                                             0x3
-#define OMAP54XX_CLKREQ_COND_MASK                                              (0x7 << 0)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_CMDRA_VDD_CORE_L_SHIFT                                                16
-#define OMAP54XX_CMDRA_VDD_CORE_L_WIDTH                                                0x8
-#define OMAP54XX_CMDRA_VDD_CORE_L_MASK                                         (0xff << 16)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_CMDRA_VDD_MM_L_SHIFT                                          16
-#define OMAP54XX_CMDRA_VDD_MM_L_WIDTH                                          0x8
-#define OMAP54XX_CMDRA_VDD_MM_L_MASK                                           (0xff << 16)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_CMDRA_VDD_MPU_L_SHIFT                                         16
-#define OMAP54XX_CMDRA_VDD_MPU_L_WIDTH                                         0x8
-#define OMAP54XX_CMDRA_VDD_MPU_L_MASK                                          (0xff << 16)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_CMD_VDD_CORE_L_SHIFT                                          28
-#define OMAP54XX_CMD_VDD_CORE_L_WIDTH                                          0x1
-#define OMAP54XX_CMD_VDD_CORE_L_MASK                                           (1 << 28)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_CMD_VDD_MM_L_SHIFT                                            28
-#define OMAP54XX_CMD_VDD_MM_L_WIDTH                                            0x1
-#define OMAP54XX_CMD_VDD_MM_L_MASK                                             (1 << 28)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_CMD_VDD_MPU_L_SHIFT                                           28
-#define OMAP54XX_CMD_VDD_MPU_L_WIDTH                                           0x1
-#define OMAP54XX_CMD_VDD_MPU_L_MASK                                            (1 << 28)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_CORE_OCMRAM_ONSTATE_SHIFT                                     18
-#define OMAP54XX_CORE_OCMRAM_ONSTATE_WIDTH                                     0x2
-#define OMAP54XX_CORE_OCMRAM_ONSTATE_MASK                                      (0x3 << 18)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_CORE_OCMRAM_RETSTATE_SHIFT                                    9
-#define OMAP54XX_CORE_OCMRAM_RETSTATE_WIDTH                                    0x1
-#define OMAP54XX_CORE_OCMRAM_RETSTATE_MASK                                     (1 << 9)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP54XX_CORE_OCMRAM_STATEST_SHIFT                                     6
-#define OMAP54XX_CORE_OCMRAM_STATEST_WIDTH                                     0x2
-#define OMAP54XX_CORE_OCMRAM_STATEST_MASK                                      (0x3 << 6)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_CORE_OTHER_BANK_ONSTATE_SHIFT                                 16
-#define OMAP54XX_CORE_OTHER_BANK_ONSTATE_WIDTH                                 0x2
-#define OMAP54XX_CORE_OTHER_BANK_ONSTATE_MASK                                  (0x3 << 16)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_CORE_OTHER_BANK_RETSTATE_SHIFT                                        8
-#define OMAP54XX_CORE_OTHER_BANK_RETSTATE_WIDTH                                        0x1
-#define OMAP54XX_CORE_OTHER_BANK_RETSTATE_MASK                                 (1 << 8)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP54XX_CORE_OTHER_BANK_STATEST_SHIFT                                 4
-#define OMAP54XX_CORE_OTHER_BANK_STATEST_WIDTH                                 0x2
-#define OMAP54XX_CORE_OTHER_BANK_STATEST_MASK                                  (0x3 << 4)
-
-/* Used by REVISION_PRM */
-#define OMAP54XX_CUSTOM_SHIFT                                                  6
-#define OMAP54XX_CUSTOM_WIDTH                                                  0x2
-#define OMAP54XX_CUSTOM_MASK                                                   (0x3 << 6)
-
-/* Used by PRM_VC_VAL_BYPASS */
-#define OMAP54XX_DATA_SHIFT                                                    16
-#define OMAP54XX_DATA_WIDTH                                                    0x8
-#define OMAP54XX_DATA_MASK                                                     (0xff << 16)
-
-/* Used by PRM_DEBUG_CORE_RET_TRANS */
-#define OMAP54XX_PRM_DEBUG_OUT_SHIFT                                           0
-#define OMAP54XX_PRM_DEBUG_OUT_WIDTH                                           0x1c
-#define OMAP54XX_PRM_DEBUG_OUT_MASK                                            (0xfffffff << 0)
-
-/* Renamed from DEBUG_OUT Used by PRM_DEBUG_MM_RET_TRANS */
-#define OMAP54XX_DEBUG_OUT_0_9_SHIFT                                           0
-#define OMAP54XX_DEBUG_OUT_0_9_WIDTH                                           0xa
-#define OMAP54XX_DEBUG_OUT_0_9_MASK                                            (0x3ff << 0)
-
-/* Renamed from DEBUG_OUT Used by PRM_DEBUG_MPU_RET_TRANS */
-#define OMAP54XX_DEBUG_OUT_0_6_SHIFT                                           0
-#define OMAP54XX_DEBUG_OUT_0_6_WIDTH                                           0x7
-#define OMAP54XX_DEBUG_OUT_0_6_MASK                                            (0x7f << 0)
-
-/* Renamed from DEBUG_OUT Used by PRM_DEBUG_OFF_TRANS */
-#define OMAP54XX_DEBUG_OUT_0_31_SHIFT                                          0
-#define OMAP54XX_DEBUG_OUT_0_31_WIDTH                                          0x20
-#define OMAP54XX_DEBUG_OUT_0_31_MASK                                           (0xffffffff << 0)
-
-/* Renamed from DEBUG_OUT Used by PRM_DEBUG_WKUPAON_FD_TRANS */
-#define OMAP54XX_DEBUG_OUT_0_11_SHIFT                                          0
-#define OMAP54XX_DEBUG_OUT_0_11_WIDTH                                          0xc
-#define OMAP54XX_DEBUG_OUT_0_11_MASK                                           (0xfff << 0)
-
-/* Used by PRM_DEVICE_OFF_CTRL */
-#define OMAP54XX_DEVICE_OFF_ENABLE_SHIFT                                       0
-#define OMAP54XX_DEVICE_OFF_ENABLE_WIDTH                                       0x1
-#define OMAP54XX_DEVICE_OFF_ENABLE_MASK                                                (1 << 0)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP54XX_DFILTEREN_SHIFT                                               6
-#define OMAP54XX_DFILTEREN_WIDTH                                               0x1
-#define OMAP54XX_DFILTEREN_MASK                                                        (1 << 6)
-
-/* Used by PRM_IRQENABLE_DSP, PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_DPLL_ABE_RECAL_EN_SHIFT                                       4
-#define OMAP54XX_DPLL_ABE_RECAL_EN_WIDTH                                       0x1
-#define OMAP54XX_DPLL_ABE_RECAL_EN_MASK                                                (1 << 4)
-
-/* Used by PRM_IRQSTATUS_DSP, PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_DPLL_ABE_RECAL_ST_SHIFT                                       4
-#define OMAP54XX_DPLL_ABE_RECAL_ST_WIDTH                                       0x1
-#define OMAP54XX_DPLL_ABE_RECAL_ST_MASK                                                (1 << 4)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_DPLL_CORE_RECAL_EN_SHIFT                                      0
-#define OMAP54XX_DPLL_CORE_RECAL_EN_WIDTH                                      0x1
-#define OMAP54XX_DPLL_CORE_RECAL_EN_MASK                                       (1 << 0)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_DPLL_CORE_RECAL_ST_SHIFT                                      0
-#define OMAP54XX_DPLL_CORE_RECAL_ST_WIDTH                                      0x1
-#define OMAP54XX_DPLL_CORE_RECAL_ST_MASK                                       (1 << 0)
-
-/* Used by PRM_IRQENABLE_DSP, PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_DPLL_IVA_RECAL_EN_SHIFT                                       2
-#define OMAP54XX_DPLL_IVA_RECAL_EN_WIDTH                                       0x1
-#define OMAP54XX_DPLL_IVA_RECAL_EN_MASK                                                (1 << 2)
-
-/* Used by PRM_IRQSTATUS_DSP, PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_DPLL_IVA_RECAL_ST_SHIFT                                       2
-#define OMAP54XX_DPLL_IVA_RECAL_ST_WIDTH                                       0x1
-#define OMAP54XX_DPLL_IVA_RECAL_ST_MASK                                                (1 << 2)
-
-/* Used by PRM_IRQENABLE_MPU */
-#define OMAP54XX_DPLL_MPU_RECAL_EN_SHIFT                                       1
-#define OMAP54XX_DPLL_MPU_RECAL_EN_WIDTH                                       0x1
-#define OMAP54XX_DPLL_MPU_RECAL_EN_MASK                                                (1 << 1)
-
-/* Used by PRM_IRQSTATUS_MPU */
-#define OMAP54XX_DPLL_MPU_RECAL_ST_SHIFT                                       1
-#define OMAP54XX_DPLL_MPU_RECAL_ST_WIDTH                                       0x1
-#define OMAP54XX_DPLL_MPU_RECAL_ST_MASK                                                (1 << 1)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_DPLL_PER_RECAL_EN_SHIFT                                       3
-#define OMAP54XX_DPLL_PER_RECAL_EN_WIDTH                                       0x1
-#define OMAP54XX_DPLL_PER_RECAL_EN_MASK                                                (1 << 3)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_DPLL_PER_RECAL_ST_SHIFT                                       3
-#define OMAP54XX_DPLL_PER_RECAL_ST_WIDTH                                       0x1
-#define OMAP54XX_DPLL_PER_RECAL_ST_MASK                                                (1 << 3)
-
-/* Used by PM_DSP_PWRSTCTRL */
-#define OMAP54XX_DSP_EDMA_ONSTATE_SHIFT                                                20
-#define OMAP54XX_DSP_EDMA_ONSTATE_WIDTH                                                0x2
-#define OMAP54XX_DSP_EDMA_ONSTATE_MASK                                         (0x3 << 20)
-
-/* Used by PM_DSP_PWRSTCTRL */
-#define OMAP54XX_DSP_EDMA_RETSTATE_SHIFT                                       10
-#define OMAP54XX_DSP_EDMA_RETSTATE_WIDTH                                       0x1
-#define OMAP54XX_DSP_EDMA_RETSTATE_MASK                                                (1 << 10)
-
-/* Used by PM_DSP_PWRSTST */
-#define OMAP54XX_DSP_EDMA_STATEST_SHIFT                                                8
-#define OMAP54XX_DSP_EDMA_STATEST_WIDTH                                                0x2
-#define OMAP54XX_DSP_EDMA_STATEST_MASK                                         (0x3 << 8)
-
-/* Used by PM_DSP_PWRSTCTRL */
-#define OMAP54XX_DSP_L1_ONSTATE_SHIFT                                          16
-#define OMAP54XX_DSP_L1_ONSTATE_WIDTH                                          0x2
-#define OMAP54XX_DSP_L1_ONSTATE_MASK                                           (0x3 << 16)
-
-/* Used by PM_DSP_PWRSTCTRL */
-#define OMAP54XX_DSP_L1_RETSTATE_SHIFT                                         8
-#define OMAP54XX_DSP_L1_RETSTATE_WIDTH                                         0x1
-#define OMAP54XX_DSP_L1_RETSTATE_MASK                                          (1 << 8)
-
-/* Used by PM_DSP_PWRSTST */
-#define OMAP54XX_DSP_L1_STATEST_SHIFT                                          4
-#define OMAP54XX_DSP_L1_STATEST_WIDTH                                          0x2
-#define OMAP54XX_DSP_L1_STATEST_MASK                                           (0x3 << 4)
-
-/* Used by PM_DSP_PWRSTCTRL */
-#define OMAP54XX_DSP_L2_ONSTATE_SHIFT                                          18
-#define OMAP54XX_DSP_L2_ONSTATE_WIDTH                                          0x2
-#define OMAP54XX_DSP_L2_ONSTATE_MASK                                           (0x3 << 18)
-
-/* Used by PM_DSP_PWRSTCTRL */
-#define OMAP54XX_DSP_L2_RETSTATE_SHIFT                                         9
-#define OMAP54XX_DSP_L2_RETSTATE_WIDTH                                         0x1
-#define OMAP54XX_DSP_L2_RETSTATE_MASK                                          (1 << 9)
-
-/* Used by PM_DSP_PWRSTST */
-#define OMAP54XX_DSP_L2_STATEST_SHIFT                                          6
-#define OMAP54XX_DSP_L2_STATEST_WIDTH                                          0x2
-#define OMAP54XX_DSP_L2_STATEST_MASK                                           (0x3 << 6)
-
-/* Used by PM_DSS_PWRSTCTRL */
-#define OMAP54XX_DSS_MEM_ONSTATE_SHIFT                                         16
-#define OMAP54XX_DSS_MEM_ONSTATE_WIDTH                                         0x2
-#define OMAP54XX_DSS_MEM_ONSTATE_MASK                                          (0x3 << 16)
-
-/* Used by PM_DSS_PWRSTCTRL */
-#define OMAP54XX_DSS_MEM_RETSTATE_SHIFT                                                8
-#define OMAP54XX_DSS_MEM_RETSTATE_WIDTH                                                0x1
-#define OMAP54XX_DSS_MEM_RETSTATE_MASK                                         (1 << 8)
-
-/* Used by PM_DSS_PWRSTST */
-#define OMAP54XX_DSS_MEM_STATEST_SHIFT                                         4
-#define OMAP54XX_DSS_MEM_STATEST_WIDTH                                         0x2
-#define OMAP54XX_DSS_MEM_STATEST_MASK                                          (0x3 << 4)
-
-/* Used by PRM_DEVICE_OFF_CTRL */
-#define OMAP54XX_EMIF1_OFFWKUP_DISABLE_SHIFT                                   8
-#define OMAP54XX_EMIF1_OFFWKUP_DISABLE_WIDTH                                   0x1
-#define OMAP54XX_EMIF1_OFFWKUP_DISABLE_MASK                                    (1 << 8)
-
-/* Used by PRM_DEVICE_OFF_CTRL */
-#define OMAP54XX_EMIF2_OFFWKUP_DISABLE_SHIFT                                   9
-#define OMAP54XX_EMIF2_OFFWKUP_DISABLE_WIDTH                                   0x1
-#define OMAP54XX_EMIF2_OFFWKUP_DISABLE_MASK                                    (1 << 9)
-
-/* Used by PM_EMU_PWRSTCTRL */
-#define OMAP54XX_EMU_BANK_ONSTATE_SHIFT                                                16
-#define OMAP54XX_EMU_BANK_ONSTATE_WIDTH                                                0x2
-#define OMAP54XX_EMU_BANK_ONSTATE_MASK                                         (0x3 << 16)
-
-/* Used by PM_EMU_PWRSTST */
-#define OMAP54XX_EMU_BANK_STATEST_SHIFT                                                4
-#define OMAP54XX_EMU_BANK_STATEST_WIDTH                                                0x2
-#define OMAP54XX_EMU_BANK_STATEST_MASK                                         (0x3 << 4)
-
-/*
- * Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP,
- * PRM_SRAM_WKUP_SETUP
- */
-#define OMAP54XX_ENABLE_RTA_SHIFT                                              0
-#define OMAP54XX_ENABLE_RTA_WIDTH                                              0x1
-#define OMAP54XX_ENABLE_RTA_MASK                                               (1 << 0)
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_ENFUNC1_SHIFT                                                 3
-#define OMAP54XX_ENFUNC1_WIDTH                                                 0x1
-#define OMAP54XX_ENFUNC1_MASK                                                  (1 << 3)
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_ENFUNC2_SHIFT                                                 4
-#define OMAP54XX_ENFUNC2_WIDTH                                                 0x1
-#define OMAP54XX_ENFUNC2_MASK                                                  (1 << 4)
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_ENFUNC3_SHIFT                                                 5
-#define OMAP54XX_ENFUNC3_WIDTH                                                 0x1
-#define OMAP54XX_ENFUNC3_MASK                                                  (1 << 5)
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_ENFUNC4_SHIFT                                                 6
-#define OMAP54XX_ENFUNC4_WIDTH                                                 0x1
-#define OMAP54XX_ENFUNC4_MASK                                                  (1 << 6)
-
-/* Used by PRM_SLDO_CORE_SETUP, PRM_SLDO_MM_SETUP, PRM_SLDO_MPU_SETUP */
-#define OMAP54XX_ENFUNC5_SHIFT                                                 7
-#define OMAP54XX_ENFUNC5_WIDTH                                                 0x1
-#define OMAP54XX_ENFUNC5_MASK                                                  (1 << 7)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_MM_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP54XX_ERRORGAIN_SHIFT                                               16
-#define OMAP54XX_ERRORGAIN_WIDTH                                               0x8
-#define OMAP54XX_ERRORGAIN_MASK                                                        (0xff << 16)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_MM_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP54XX_ERROROFFSET_SHIFT                                             24
-#define OMAP54XX_ERROROFFSET_WIDTH                                             0x8
-#define OMAP54XX_ERROROFFSET_MASK                                              (0xff << 24)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_EXTERNAL_WARM_RST_SHIFT                                       5
-#define OMAP54XX_EXTERNAL_WARM_RST_WIDTH                                       0x1
-#define OMAP54XX_EXTERNAL_WARM_RST_MASK                                                (1 << 5)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_MM_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP54XX_FORCEUPDATE_SHIFT                                             1
-#define OMAP54XX_FORCEUPDATE_WIDTH                                             0x1
-#define OMAP54XX_FORCEUPDATE_MASK                                              (1 << 1)
-
-/* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_MM_VOLTAGE, PRM_VP_MPU_VOLTAGE */
-#define OMAP54XX_FORCEUPDATEWAIT_SHIFT                                         8
-#define OMAP54XX_FORCEUPDATEWAIT_WIDTH                                         0x18
-#define OMAP54XX_FORCEUPDATEWAIT_MASK                                          (0xffffff << 8)
-
-/* Used by PRM_IRQENABLE_DSP, PRM_IRQENABLE_IPU */
-#define OMAP54XX_FORCEWKUP_EN_SHIFT                                            10
-#define OMAP54XX_FORCEWKUP_EN_WIDTH                                            0x1
-#define OMAP54XX_FORCEWKUP_EN_MASK                                             (1 << 10)
-
-/* Used by PRM_IRQSTATUS_DSP, PRM_IRQSTATUS_IPU */
-#define OMAP54XX_FORCEWKUP_ST_SHIFT                                            10
-#define OMAP54XX_FORCEWKUP_ST_WIDTH                                            0x1
-#define OMAP54XX_FORCEWKUP_ST_MASK                                             (1 << 10)
-
-/* Used by REVISION_PRM */
-#define OMAP54XX_FUNC_SHIFT                                                    16
-#define OMAP54XX_FUNC_WIDTH                                                    0xc
-#define OMAP54XX_FUNC_MASK                                                     (0xfff << 16)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_GLOBAL_COLD_RST_SHIFT                                         0
-#define OMAP54XX_GLOBAL_COLD_RST_WIDTH                                         0x1
-#define OMAP54XX_GLOBAL_COLD_RST_MASK                                          (1 << 0)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_GLOBAL_WARM_SW_RST_SHIFT                                      1
-#define OMAP54XX_GLOBAL_WARM_SW_RST_WIDTH                                      0x1
-#define OMAP54XX_GLOBAL_WARM_SW_RST_MASK                                       (1 << 1)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP54XX_GLOBAL_WUEN_SHIFT                                             16
-#define OMAP54XX_GLOBAL_WUEN_WIDTH                                             0x1
-#define OMAP54XX_GLOBAL_WUEN_MASK                                              (1 << 16)
-
-/* Used by PM_GPU_PWRSTCTRL */
-#define OMAP54XX_GPU_MEM_ONSTATE_SHIFT                                         16
-#define OMAP54XX_GPU_MEM_ONSTATE_WIDTH                                         0x2
-#define OMAP54XX_GPU_MEM_ONSTATE_MASK                                          (0x3 << 16)
-
-/* Used by PM_GPU_PWRSTST */
-#define OMAP54XX_GPU_MEM_STATEST_SHIFT                                         4
-#define OMAP54XX_GPU_MEM_STATEST_WIDTH                                         0x2
-#define OMAP54XX_GPU_MEM_STATEST_MASK                                          (0x3 << 4)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP54XX_HSMCODE_SHIFT                                                 0
-#define OMAP54XX_HSMCODE_WIDTH                                                 0x3
-#define OMAP54XX_HSMCODE_MASK                                                  (0x7 << 0)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP54XX_HSMODEEN_SHIFT                                                        3
-#define OMAP54XX_HSMODEEN_WIDTH                                                        0x1
-#define OMAP54XX_HSMODEEN_MASK                                                 (1 << 3)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
-#define OMAP54XX_HSSCLH_SHIFT                                                  16
-#define OMAP54XX_HSSCLH_WIDTH                                                  0x8
-#define OMAP54XX_HSSCLH_MASK                                                   (0xff << 16)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
-#define OMAP54XX_HSSCLL_SHIFT                                                  24
-#define OMAP54XX_HSSCLL_WIDTH                                                  0x8
-#define OMAP54XX_HSSCLL_MASK                                                   (0xff << 24)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_HWA_MEM_ONSTATE_SHIFT                                         16
-#define OMAP54XX_HWA_MEM_ONSTATE_WIDTH                                         0x2
-#define OMAP54XX_HWA_MEM_ONSTATE_MASK                                          (0x3 << 16)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_HWA_MEM_RETSTATE_SHIFT                                                8
-#define OMAP54XX_HWA_MEM_RETSTATE_WIDTH                                                0x1
-#define OMAP54XX_HWA_MEM_RETSTATE_MASK                                         (1 << 8)
-
-/* Used by PM_IVA_PWRSTST */
-#define OMAP54XX_HWA_MEM_STATEST_SHIFT                                         4
-#define OMAP54XX_HWA_MEM_STATEST_WIDTH                                         0x2
-#define OMAP54XX_HWA_MEM_STATEST_MASK                                          (0x3 << 4)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_ICEPICK_RST_SHIFT                                             9
-#define OMAP54XX_ICEPICK_RST_WIDTH                                             0x1
-#define OMAP54XX_ICEPICK_RST_MASK                                              (1 << 9)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_MM_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP54XX_INITVDD_SHIFT                                                 2
-#define OMAP54XX_INITVDD_WIDTH                                                 0x1
-#define OMAP54XX_INITVDD_MASK                                                  (1 << 2)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_MM_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP54XX_INITVOLTAGE_SHIFT                                             8
-#define OMAP54XX_INITVOLTAGE_WIDTH                                             0x8
-#define OMAP54XX_INITVOLTAGE_MASK                                              (0xff << 8)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CAM_PWRSTST, PM_CORE_PWRSTST,
- * PM_CUSTEFUSE_PWRSTST, PM_DSP_PWRSTST, PM_DSS_PWRSTST, PM_EMU_PWRSTST,
- * PM_GPU_PWRSTST, PM_IVA_PWRSTST, PM_L3INIT_PWRSTST, PM_MPU_PWRSTST,
- * PRM_VOLTST_MM, PRM_VOLTST_MPU
- */
-#define OMAP54XX_INTRANSITION_SHIFT                                            20
-#define OMAP54XX_INTRANSITION_WIDTH                                            0x1
-#define OMAP54XX_INTRANSITION_MASK                                             (1 << 20)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_IO_EN_SHIFT                                                   9
-#define OMAP54XX_IO_EN_WIDTH                                                   0x1
-#define OMAP54XX_IO_EN_MASK                                                    (1 << 9)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP54XX_IO_ON_STATUS_SHIFT                                            5
-#define OMAP54XX_IO_ON_STATUS_WIDTH                                            0x1
-#define OMAP54XX_IO_ON_STATUS_MASK                                             (1 << 5)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_IO_ST_SHIFT                                                   9
-#define OMAP54XX_IO_ST_WIDTH                                                   0x1
-#define OMAP54XX_IO_ST_MASK                                                    (1 << 9)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_IPU_L2RAM_ONSTATE_SHIFT                                       20
-#define OMAP54XX_IPU_L2RAM_ONSTATE_WIDTH                                       0x2
-#define OMAP54XX_IPU_L2RAM_ONSTATE_MASK                                                (0x3 << 20)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_IPU_L2RAM_RETSTATE_SHIFT                                      10
-#define OMAP54XX_IPU_L2RAM_RETSTATE_WIDTH                                      0x1
-#define OMAP54XX_IPU_L2RAM_RETSTATE_MASK                                       (1 << 10)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP54XX_IPU_L2RAM_STATEST_SHIFT                                       8
-#define OMAP54XX_IPU_L2RAM_STATEST_WIDTH                                       0x2
-#define OMAP54XX_IPU_L2RAM_STATEST_MASK                                                (0x3 << 8)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_IPU_UNICACHE_ONSTATE_SHIFT                                    22
-#define OMAP54XX_IPU_UNICACHE_ONSTATE_WIDTH                                    0x2
-#define OMAP54XX_IPU_UNICACHE_ONSTATE_MASK                                     (0x3 << 22)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_IPU_UNICACHE_RETSTATE_SHIFT                                   11
-#define OMAP54XX_IPU_UNICACHE_RETSTATE_WIDTH                                   0x1
-#define OMAP54XX_IPU_UNICACHE_RETSTATE_MASK                                    (1 << 11)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP54XX_IPU_UNICACHE_STATEST_SHIFT                                    10
-#define OMAP54XX_IPU_UNICACHE_STATEST_WIDTH                                    0x2
-#define OMAP54XX_IPU_UNICACHE_STATEST_MASK                                     (0x3 << 10)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP54XX_ISOCLK_OVERRIDE_SHIFT                                         0
-#define OMAP54XX_ISOCLK_OVERRIDE_WIDTH                                         0x1
-#define OMAP54XX_ISOCLK_OVERRIDE_MASK                                          (1 << 0)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP54XX_ISOCLK_STATUS_SHIFT                                           1
-#define OMAP54XX_ISOCLK_STATUS_WIDTH                                           0x1
-#define OMAP54XX_ISOCLK_STATUS_MASK                                            (1 << 1)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP54XX_ISOOVR_EXTEND_SHIFT                                           4
-#define OMAP54XX_ISOOVR_EXTEND_WIDTH                                           0x1
-#define OMAP54XX_ISOOVR_EXTEND_MASK                                            (1 << 4)
-
-/* Used by PRM_IO_COUNT */
-#define OMAP54XX_ISO_2_ON_TIME_SHIFT                                           0
-#define OMAP54XX_ISO_2_ON_TIME_WIDTH                                           0x8
-#define OMAP54XX_ISO_2_ON_TIME_MASK                                            (0xff << 0)
-
-/* Used by PM_L3INIT_PWRSTCTRL */
-#define OMAP54XX_L3INIT_BANK1_ONSTATE_SHIFT                                    16
-#define OMAP54XX_L3INIT_BANK1_ONSTATE_WIDTH                                    0x2
-#define OMAP54XX_L3INIT_BANK1_ONSTATE_MASK                                     (0x3 << 16)
-
-/* Used by PM_L3INIT_PWRSTCTRL */
-#define OMAP54XX_L3INIT_BANK1_RETSTATE_SHIFT                                   8
-#define OMAP54XX_L3INIT_BANK1_RETSTATE_WIDTH                                   0x1
-#define OMAP54XX_L3INIT_BANK1_RETSTATE_MASK                                    (1 << 8)
-
-/* Used by PM_L3INIT_PWRSTST */
-#define OMAP54XX_L3INIT_BANK1_STATEST_SHIFT                                    4
-#define OMAP54XX_L3INIT_BANK1_STATEST_WIDTH                                    0x2
-#define OMAP54XX_L3INIT_BANK1_STATEST_MASK                                     (0x3 << 4)
-
-/* Used by PM_L3INIT_PWRSTCTRL */
-#define OMAP54XX_L3INIT_BANK2_ONSTATE_SHIFT                                    18
-#define OMAP54XX_L3INIT_BANK2_ONSTATE_WIDTH                                    0x2
-#define OMAP54XX_L3INIT_BANK2_ONSTATE_MASK                                     (0x3 << 18)
-
-/* Used by PM_L3INIT_PWRSTCTRL */
-#define OMAP54XX_L3INIT_BANK2_RETSTATE_SHIFT                                   9
-#define OMAP54XX_L3INIT_BANK2_RETSTATE_WIDTH                                   0x1
-#define OMAP54XX_L3INIT_BANK2_RETSTATE_MASK                                    (1 << 9)
-
-/* Used by PM_L3INIT_PWRSTST */
-#define OMAP54XX_L3INIT_BANK2_STATEST_SHIFT                                    6
-#define OMAP54XX_L3INIT_BANK2_STATEST_WIDTH                                    0x2
-#define OMAP54XX_L3INIT_BANK2_STATEST_MASK                                     (0x3 << 6)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CAM_PWRSTST, PM_CORE_PWRSTST,
- * PM_CUSTEFUSE_PWRSTST, PM_DSP_PWRSTST, PM_DSS_PWRSTST, PM_EMU_PWRSTST,
- * PM_GPU_PWRSTST, PM_IVA_PWRSTST, PM_L3INIT_PWRSTST, PM_MPU_PWRSTST
- */
-#define OMAP54XX_LASTPOWERSTATEENTERED_SHIFT                                   24
-#define OMAP54XX_LASTPOWERSTATEENTERED_WIDTH                                   0x2
-#define OMAP54XX_LASTPOWERSTATEENTERED_MASK                                    (0x3 << 24)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_LLI_RST_SHIFT                                                 14
-#define OMAP54XX_LLI_RST_WIDTH                                                 0x1
-#define OMAP54XX_LLI_RST_MASK                                                  (1 << 14)
-
-/*
- * Used by PM_ABE_PWRSTCTRL, PM_CORE_PWRSTCTRL, PM_DSP_PWRSTCTRL,
- * PM_DSS_PWRSTCTRL, PM_IVA_PWRSTCTRL, PM_L3INIT_PWRSTCTRL, PM_MPU_PWRSTCTRL
- */
-#define OMAP54XX_LOGICRETSTATE_SHIFT                                           2
-#define OMAP54XX_LOGICRETSTATE_WIDTH                                           0x1
-#define OMAP54XX_LOGICRETSTATE_MASK                                            (1 << 2)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CAM_PWRSTST, PM_CORE_PWRSTST,
- * PM_CUSTEFUSE_PWRSTST, PM_DSP_PWRSTST, PM_DSS_PWRSTST, PM_EMU_PWRSTST,
- * PM_GPU_PWRSTST, PM_IVA_PWRSTST, PM_L3INIT_PWRSTST, PM_MPU_PWRSTST
- */
-#define OMAP54XX_LOGICSTATEST_SHIFT                                            2
-#define OMAP54XX_LOGICSTATEST_WIDTH                                            0x1
-#define OMAP54XX_LOGICSTATEST_MASK                                             (1 << 2)
-
-/*
- * Used by RM_ABE_AESS_CONTEXT, RM_ABE_DMIC_CONTEXT, RM_ABE_MCASP_CONTEXT,
- * RM_ABE_MCBSP1_CONTEXT, RM_ABE_MCBSP2_CONTEXT, RM_ABE_MCBSP3_CONTEXT,
- * RM_ABE_MCPDM_CONTEXT, RM_ABE_SLIMBUS1_CONTEXT, RM_ABE_TIMER5_CONTEXT,
- * RM_ABE_TIMER6_CONTEXT, RM_ABE_TIMER7_CONTEXT, RM_ABE_TIMER8_CONTEXT,
- * RM_ABE_WD_TIMER3_CONTEXT, RM_C2C_C2C_CONTEXT, RM_C2C_C2C_OCP_FW_CONTEXT,
- * RM_CAM_CAL_CONTEXT, RM_CAM_FDIF_CONTEXT, RM_CAM_ISS_CONTEXT,
- * RM_COREAON_SMARTREFLEX_CORE_CONTEXT, RM_COREAON_SMARTREFLEX_MM_CONTEXT,
- * RM_COREAON_SMARTREFLEX_MPU_CONTEXT, RM_CUSTEFUSE_EFUSE_CTRL_CUST_CONTEXT,
- * RM_DSP_DSP_CONTEXT, RM_DSS_BB2D_CONTEXT, RM_DSS_DSS_CONTEXT,
- * RM_EMIF_DMM_CONTEXT, RM_EMIF_EMIF1_CONTEXT, RM_EMIF_EMIF2_CONTEXT,
- * RM_EMIF_EMIF_DLL_CONTEXT, RM_EMIF_EMIF_OCP_FW_CONTEXT,
- * RM_EMU_DEBUGSS_CONTEXT, RM_GPU_GPU_CONTEXT, RM_IPU_IPU_CONTEXT,
- * RM_IVA_IVA_CONTEXT, RM_IVA_SL2_CONTEXT, RM_L3INIT_IEEE1500_2_OCP_CONTEXT,
- * RM_L3INIT_OCP2SCP1_CONTEXT, RM_L3INIT_OCP2SCP3_CONTEXT,
- * RM_L3INIT_SATA_CONTEXT, RM_L3INIT_UNIPRO2_CONTEXT,
- * RM_L3INSTR_L3_INSTR_CONTEXT, RM_L3INSTR_L3_MAIN_3_CONTEXT,
- * RM_L3INSTR_OCP_WP_NOC_CONTEXT, RM_L3MAIN1_L3_MAIN_1_CONTEXT,
- * RM_L3MAIN2_L3_MAIN_2_CONTEXT, RM_L3MAIN2_OCMC_RAM_CONTEXT,
- * RM_L4CFG_L4_CFG_CONTEXT, RM_L4CFG_OCP2SCP2_CONTEXT,
- * RM_L4CFG_SAR_ROM_CONTEXT, RM_L4PER_ELM_CONTEXT, RM_L4PER_HDQ1W_CONTEXT,
- * RM_L4PER_I2C2_CONTEXT, RM_L4PER_I2C3_CONTEXT, RM_L4PER_I2C4_CONTEXT,
- * RM_L4PER_I2C5_CONTEXT, RM_L4PER_L4_PER_CONTEXT, RM_L4PER_MCSPI1_CONTEXT,
- * RM_L4PER_MCSPI2_CONTEXT, RM_L4PER_MCSPI3_CONTEXT, RM_L4PER_MCSPI4_CONTEXT,
- * RM_L4PER_MMC3_CONTEXT, RM_L4PER_MMC4_CONTEXT, RM_L4PER_MMC5_CONTEXT,
- * RM_L4PER_TIMER10_CONTEXT, RM_L4PER_TIMER11_CONTEXT, RM_L4PER_TIMER2_CONTEXT,
- * RM_L4PER_TIMER3_CONTEXT, RM_L4PER_TIMER4_CONTEXT, RM_L4PER_TIMER9_CONTEXT,
- * RM_L4SEC_FPKA_CONTEXT, RM_MIPIEXT_LLI_CONTEXT,
- * RM_MIPIEXT_LLI_OCP_FW_CONTEXT, RM_MIPIEXT_MPHY_CONTEXT, RM_MPU_MPU_CONTEXT,
- * RM_WKUPAON_COUNTER_32K_CONTEXT, RM_WKUPAON_GPIO1_CONTEXT,
- * RM_WKUPAON_KBD_CONTEXT, RM_WKUPAON_L4_WKUP_CONTEXT,
- * RM_WKUPAON_SAR_RAM_CONTEXT, RM_WKUPAON_TIMER12_CONTEXT,
- * RM_WKUPAON_TIMER1_CONTEXT, RM_WKUPAON_WD_TIMER1_CONTEXT,
- * RM_WKUPAON_WD_TIMER2_CONTEXT
- */
-#define OMAP54XX_LOSTCONTEXT_DFF_SHIFT                                         0
-#define OMAP54XX_LOSTCONTEXT_DFF_WIDTH                                         0x1
-#define OMAP54XX_LOSTCONTEXT_DFF_MASK                                          (1 << 0)
-
-/*
- * Used by RM_C2C_C2C_CONTEXT, RM_C2C_C2C_OCP_FW_CONTEXT,
- * RM_C2C_MODEM_ICR_CONTEXT, RM_DMA_DMA_SYSTEM_CONTEXT, RM_DSP_DSP_CONTEXT,
- * RM_DSS_DSS_CONTEXT, RM_EMIF_DMM_CONTEXT, RM_EMIF_EMIF1_CONTEXT,
- * RM_EMIF_EMIF2_CONTEXT, RM_EMIF_EMIF_OCP_FW_CONTEXT, RM_IPU_IPU_CONTEXT,
- * RM_L3INIT_HSI_CONTEXT, RM_L3INIT_MMC1_CONTEXT, RM_L3INIT_MMC2_CONTEXT,
- * RM_L3INIT_USB_HOST_HS_CONTEXT, RM_L3INIT_USB_OTG_SS_CONTEXT,
- * RM_L3INIT_USB_TLL_HS_CONTEXT, RM_L3INSTR_L3_MAIN_3_CONTEXT,
- * RM_L3INSTR_OCP_WP_NOC_CONTEXT, RM_L3MAIN1_L3_MAIN_1_CONTEXT,
- * RM_L3MAIN2_GPMC_CONTEXT, RM_L3MAIN2_L3_MAIN_2_CONTEXT,
- * RM_L4CFG_L4_CFG_CONTEXT, RM_L4CFG_MAILBOX_CONTEXT,
- * RM_L4CFG_SPINLOCK_CONTEXT, RM_L4PER_GPIO2_CONTEXT, RM_L4PER_GPIO3_CONTEXT,
- * RM_L4PER_GPIO4_CONTEXT, RM_L4PER_GPIO5_CONTEXT, RM_L4PER_GPIO6_CONTEXT,
- * RM_L4PER_GPIO7_CONTEXT, RM_L4PER_GPIO8_CONTEXT, RM_L4PER_I2C1_CONTEXT,
- * RM_L4PER_L4_PER_CONTEXT, RM_L4PER_UART1_CONTEXT, RM_L4PER_UART2_CONTEXT,
- * RM_L4PER_UART3_CONTEXT, RM_L4PER_UART4_CONTEXT, RM_L4PER_UART5_CONTEXT,
- * RM_L4PER_UART6_CONTEXT, RM_L4SEC_AES1_CONTEXT, RM_L4SEC_AES2_CONTEXT,
- * RM_L4SEC_DES3DES_CONTEXT, RM_L4SEC_DMA_CRYPTO_CONTEXT, RM_L4SEC_RNG_CONTEXT,
- * RM_L4SEC_SHA2MD5_CONTEXT, RM_MIPIEXT_LLI_CONTEXT,
- * RM_MIPIEXT_LLI_OCP_FW_CONTEXT, RM_MIPIEXT_MPHY_CONTEXT, RM_MPU_MPU_CONTEXT
- */
-#define OMAP54XX_LOSTCONTEXT_RFF_SHIFT                                         1
-#define OMAP54XX_LOSTCONTEXT_RFF_WIDTH                                         0x1
-#define OMAP54XX_LOSTCONTEXT_RFF_MASK                                          (1 << 1)
-
-/* Used by RM_ABE_AESS_CONTEXT */
-#define OMAP54XX_LOSTMEM_AESSMEM_SHIFT                                         8
-#define OMAP54XX_LOSTMEM_AESSMEM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_AESSMEM_MASK                                          (1 << 8)
-
-/* Used by RM_CAM_CAL_CONTEXT */
-#define OMAP54XX_LOSTMEM_CAL_MEM_SHIFT                                         8
-#define OMAP54XX_LOSTMEM_CAL_MEM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_CAL_MEM_MASK                                          (1 << 8)
-
-/* Used by RM_CAM_FDIF_CONTEXT, RM_CAM_ISS_CONTEXT */
-#define OMAP54XX_LOSTMEM_CAM_MEM_SHIFT                                         8
-#define OMAP54XX_LOSTMEM_CAM_MEM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_CAM_MEM_MASK                                          (1 << 8)
-
-/* Used by RM_EMIF_DMM_CONTEXT */
-#define OMAP54XX_LOSTMEM_CORE_NRET_BANK_SHIFT                                  9
-#define OMAP54XX_LOSTMEM_CORE_NRET_BANK_WIDTH                                  0x1
-#define OMAP54XX_LOSTMEM_CORE_NRET_BANK_MASK                                   (1 << 9)
-
-/* Renamed from LOSTMEM_CORE_NRET_BANK Used by RM_L3INSTR_OCP_WP_NOC_CONTEXT */
-#define OMAP54XX_LOSTMEM_CORE_NRET_BANK_8_8_SHIFT                              8
-#define OMAP54XX_LOSTMEM_CORE_NRET_BANK_8_8_WIDTH                              0x1
-#define OMAP54XX_LOSTMEM_CORE_NRET_BANK_8_8_MASK                               (1 << 8)
-
-/* Used by RM_L3MAIN2_OCMC_RAM_CONTEXT */
-#define OMAP54XX_LOSTMEM_CORE_OCMRAM_SHIFT                                     8
-#define OMAP54XX_LOSTMEM_CORE_OCMRAM_WIDTH                                     0x1
-#define OMAP54XX_LOSTMEM_CORE_OCMRAM_MASK                                      (1 << 8)
-
-/* Used by RM_DMA_DMA_SYSTEM_CONTEXT, RM_EMIF_DMM_CONTEXT */
-#define OMAP54XX_LOSTMEM_CORE_OTHER_BANK_SHIFT                                 8
-#define OMAP54XX_LOSTMEM_CORE_OTHER_BANK_WIDTH                                 0x1
-#define OMAP54XX_LOSTMEM_CORE_OTHER_BANK_MASK                                  (1 << 8)
-
-/* Used by RM_DSP_DSP_CONTEXT */
-#define OMAP54XX_LOSTMEM_DSP_EDMA_SHIFT                                                10
-#define OMAP54XX_LOSTMEM_DSP_EDMA_WIDTH                                                0x1
-#define OMAP54XX_LOSTMEM_DSP_EDMA_MASK                                         (1 << 10)
-
-/* Used by RM_DSP_DSP_CONTEXT */
-#define OMAP54XX_LOSTMEM_DSP_L1_SHIFT                                          8
-#define OMAP54XX_LOSTMEM_DSP_L1_WIDTH                                          0x1
-#define OMAP54XX_LOSTMEM_DSP_L1_MASK                                           (1 << 8)
-
-/* Used by RM_DSP_DSP_CONTEXT */
-#define OMAP54XX_LOSTMEM_DSP_L2_SHIFT                                          9
-#define OMAP54XX_LOSTMEM_DSP_L2_WIDTH                                          0x1
-#define OMAP54XX_LOSTMEM_DSP_L2_MASK                                           (1 << 9)
-
-/* Used by RM_DSS_BB2D_CONTEXT, RM_DSS_DSS_CONTEXT */
-#define OMAP54XX_LOSTMEM_DSS_MEM_SHIFT                                         8
-#define OMAP54XX_LOSTMEM_DSS_MEM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_DSS_MEM_MASK                                          (1 << 8)
-
-/* Used by RM_EMU_DEBUGSS_CONTEXT */
-#define OMAP54XX_LOSTMEM_EMU_BANK_SHIFT                                                8
-#define OMAP54XX_LOSTMEM_EMU_BANK_WIDTH                                                0x1
-#define OMAP54XX_LOSTMEM_EMU_BANK_MASK                                         (1 << 8)
-
-/* Used by RM_GPU_GPU_CONTEXT */
-#define OMAP54XX_LOSTMEM_GPU_MEM_SHIFT                                         8
-#define OMAP54XX_LOSTMEM_GPU_MEM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_GPU_MEM_MASK                                          (1 << 8)
-
-/* Used by RM_IVA_IVA_CONTEXT */
-#define OMAP54XX_LOSTMEM_HWA_MEM_SHIFT                                         10
-#define OMAP54XX_LOSTMEM_HWA_MEM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_HWA_MEM_MASK                                          (1 << 10)
-
-/* Used by RM_IPU_IPU_CONTEXT */
-#define OMAP54XX_LOSTMEM_IPU_L2RAM_SHIFT                                       9
-#define OMAP54XX_LOSTMEM_IPU_L2RAM_WIDTH                                       0x1
-#define OMAP54XX_LOSTMEM_IPU_L2RAM_MASK                                                (1 << 9)
-
-/* Used by RM_IPU_IPU_CONTEXT */
-#define OMAP54XX_LOSTMEM_IPU_UNICACHE_SHIFT                                    8
-#define OMAP54XX_LOSTMEM_IPU_UNICACHE_WIDTH                                    0x1
-#define OMAP54XX_LOSTMEM_IPU_UNICACHE_MASK                                     (1 << 8)
-
-/*
- * Used by RM_L3INIT_HSI_CONTEXT, RM_L3INIT_MMC1_CONTEXT,
- * RM_L3INIT_MMC2_CONTEXT, RM_L3INIT_SATA_CONTEXT, RM_L3INIT_UNIPRO2_CONTEXT,
- * RM_L3INIT_USB_OTG_SS_CONTEXT
- */
-#define OMAP54XX_LOSTMEM_L3INIT_BANK1_SHIFT                                    8
-#define OMAP54XX_LOSTMEM_L3INIT_BANK1_WIDTH                                    0x1
-#define OMAP54XX_LOSTMEM_L3INIT_BANK1_MASK                                     (1 << 8)
-
-/* Used by RM_MPU_MPU_CONTEXT */
-#define OMAP54XX_LOSTMEM_MPU_L2_SHIFT                                          9
-#define OMAP54XX_LOSTMEM_MPU_L2_WIDTH                                          0x1
-#define OMAP54XX_LOSTMEM_MPU_L2_MASK                                           (1 << 9)
-
-/* Used by RM_MPU_MPU_CONTEXT */
-#define OMAP54XX_LOSTMEM_MPU_RAM_SHIFT                                         10
-#define OMAP54XX_LOSTMEM_MPU_RAM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_MPU_RAM_MASK                                          (1 << 10)
-
-/*
- * Used by RM_L4PER_MMC3_CONTEXT, RM_L4PER_MMC4_CONTEXT, RM_L4PER_MMC5_CONTEXT,
- * RM_L4SEC_FPKA_CONTEXT
- */
-#define OMAP54XX_LOSTMEM_NONRETAINED_BANK_SHIFT                                        8
-#define OMAP54XX_LOSTMEM_NONRETAINED_BANK_WIDTH                                        0x1
-#define OMAP54XX_LOSTMEM_NONRETAINED_BANK_MASK                                 (1 << 8)
-
-/*
- * Used by RM_ABE_DMIC_CONTEXT, RM_ABE_MCBSP1_CONTEXT, RM_ABE_MCBSP2_CONTEXT,
- * RM_ABE_MCBSP3_CONTEXT, RM_ABE_MCPDM_CONTEXT, RM_ABE_SLIMBUS1_CONTEXT
- */
-#define OMAP54XX_LOSTMEM_PERIHPMEM_SHIFT                                       8
-#define OMAP54XX_LOSTMEM_PERIHPMEM_WIDTH                                       0x1
-#define OMAP54XX_LOSTMEM_PERIHPMEM_MASK                                                (1 << 8)
-
-/*
- * Used by RM_L4PER_UART1_CONTEXT, RM_L4PER_UART2_CONTEXT,
- * RM_L4PER_UART3_CONTEXT, RM_L4PER_UART4_CONTEXT, RM_L4PER_UART5_CONTEXT,
- * RM_L4PER_UART6_CONTEXT, RM_L4SEC_DMA_CRYPTO_CONTEXT
- */
-#define OMAP54XX_LOSTMEM_RETAINED_BANK_SHIFT                                   8
-#define OMAP54XX_LOSTMEM_RETAINED_BANK_WIDTH                                   0x1
-#define OMAP54XX_LOSTMEM_RETAINED_BANK_MASK                                    (1 << 8)
-
-/* Used by RM_IVA_SL2_CONTEXT */
-#define OMAP54XX_LOSTMEM_SL2_MEM_SHIFT                                         8
-#define OMAP54XX_LOSTMEM_SL2_MEM_WIDTH                                         0x1
-#define OMAP54XX_LOSTMEM_SL2_MEM_MASK                                          (1 << 8)
-
-/* Used by RM_IVA_IVA_CONTEXT */
-#define OMAP54XX_LOSTMEM_TCM1_MEM_SHIFT                                                8
-#define OMAP54XX_LOSTMEM_TCM1_MEM_WIDTH                                                0x1
-#define OMAP54XX_LOSTMEM_TCM1_MEM_MASK                                         (1 << 8)
-
-/* Used by RM_IVA_IVA_CONTEXT */
-#define OMAP54XX_LOSTMEM_TCM2_MEM_SHIFT                                                9
-#define OMAP54XX_LOSTMEM_TCM2_MEM_WIDTH                                                0x1
-#define OMAP54XX_LOSTMEM_TCM2_MEM_MASK                                         (1 << 9)
-
-/* Used by RM_WKUPAON_SAR_RAM_CONTEXT */
-#define OMAP54XX_LOSTMEM_WKUP_BANK_SHIFT                                       8
-#define OMAP54XX_LOSTMEM_WKUP_BANK_WIDTH                                       0x1
-#define OMAP54XX_LOSTMEM_WKUP_BANK_MASK                                                (1 << 8)
-
-/*
- * Used by PM_ABE_PWRSTCTRL, PM_CAM_PWRSTCTRL, PM_CORE_PWRSTCTRL,
- * PM_CUSTEFUSE_PWRSTCTRL, PM_DSP_PWRSTCTRL, PM_DSS_PWRSTCTRL,
- * PM_GPU_PWRSTCTRL, PM_IVA_PWRSTCTRL, PM_L3INIT_PWRSTCTRL, PM_MPU_PWRSTCTRL
- */
-#define OMAP54XX_LOWPOWERSTATECHANGE_SHIFT                                     4
-#define OMAP54XX_LOWPOWERSTATECHANGE_WIDTH                                     0x1
-#define OMAP54XX_LOWPOWERSTATECHANGE_MASK                                      (1 << 4)
-
-/* Used by PRM_DEBUG_TRANS_CFG */
-#define OMAP54XX_MODE_SHIFT                                                    0
-#define OMAP54XX_MODE_WIDTH                                                    0x2
-#define OMAP54XX_MODE_MASK                                                     (0x3 << 0)
-
-/* Used by PRM_MODEM_IF_CTRL */
-#define OMAP54XX_MODEM_SHUTDOWN_IRQ_SHIFT                                      9
-#define OMAP54XX_MODEM_SHUTDOWN_IRQ_WIDTH                                      0x1
-#define OMAP54XX_MODEM_SHUTDOWN_IRQ_MASK                                       (1 << 9)
-
-/* Used by PRM_MODEM_IF_CTRL */
-#define OMAP54XX_MODEM_WAKE_IRQ_SHIFT                                          8
-#define OMAP54XX_MODEM_WAKE_IRQ_WIDTH                                          0x1
-#define OMAP54XX_MODEM_WAKE_IRQ_MASK                                           (1 << 8)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP54XX_MPU_L2_ONSTATE_SHIFT                                          18
-#define OMAP54XX_MPU_L2_ONSTATE_WIDTH                                          0x2
-#define OMAP54XX_MPU_L2_ONSTATE_MASK                                           (0x3 << 18)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP54XX_MPU_L2_RETSTATE_SHIFT                                         9
-#define OMAP54XX_MPU_L2_RETSTATE_WIDTH                                         0x1
-#define OMAP54XX_MPU_L2_RETSTATE_MASK                                          (1 << 9)
-
-/* Used by PM_MPU_PWRSTST */
-#define OMAP54XX_MPU_L2_STATEST_SHIFT                                          6
-#define OMAP54XX_MPU_L2_STATEST_WIDTH                                          0x2
-#define OMAP54XX_MPU_L2_STATEST_MASK                                           (0x3 << 6)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP54XX_MPU_RAM_ONSTATE_SHIFT                                         20
-#define OMAP54XX_MPU_RAM_ONSTATE_WIDTH                                         0x2
-#define OMAP54XX_MPU_RAM_ONSTATE_MASK                                          (0x3 << 20)
-
-/* Used by PM_MPU_PWRSTCTRL */
-#define OMAP54XX_MPU_RAM_RETSTATE_SHIFT                                                10
-#define OMAP54XX_MPU_RAM_RETSTATE_WIDTH                                                0x1
-#define OMAP54XX_MPU_RAM_RETSTATE_MASK                                         (1 << 10)
-
-/* Used by PM_MPU_PWRSTST */
-#define OMAP54XX_MPU_RAM_STATEST_SHIFT                                         8
-#define OMAP54XX_MPU_RAM_STATEST_WIDTH                                         0x2
-#define OMAP54XX_MPU_RAM_STATEST_MASK                                          (0x3 << 8)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_MPU_SECURITY_VIOL_RST_SHIFT                                   2
-#define OMAP54XX_MPU_SECURITY_VIOL_RST_WIDTH                                   0x1
-#define OMAP54XX_MPU_SECURITY_VIOL_RST_MASK                                    (1 << 2)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_MPU_WDT_RST_SHIFT                                             3
-#define OMAP54XX_MPU_WDT_RST_WIDTH                                             0x1
-#define OMAP54XX_MPU_WDT_RST_MASK                                              (1 << 3)
-
-/* Used by PRM_ABBLDO_MM_SETUP, PRM_ABBLDO_MPU_SETUP */
-#define OMAP54XX_NOCAP_SHIFT                                                   4
-#define OMAP54XX_NOCAP_WIDTH                                                   0x1
-#define OMAP54XX_NOCAP_MASK                                                    (1 << 4)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_OCP_NRET_BANK_ONSTATE_SHIFT                                   24
-#define OMAP54XX_OCP_NRET_BANK_ONSTATE_WIDTH                                   0x2
-#define OMAP54XX_OCP_NRET_BANK_ONSTATE_MASK                                    (0x3 << 24)
-
-/* Used by PM_CORE_PWRSTCTRL */
-#define OMAP54XX_OCP_NRET_BANK_RETSTATE_SHIFT                                  12
-#define OMAP54XX_OCP_NRET_BANK_RETSTATE_WIDTH                                  0x1
-#define OMAP54XX_OCP_NRET_BANK_RETSTATE_MASK                                   (1 << 12)
-
-/* Used by PM_CORE_PWRSTST */
-#define OMAP54XX_OCP_NRET_BANK_STATEST_SHIFT                                   12
-#define OMAP54XX_OCP_NRET_BANK_STATEST_WIDTH                                   0x2
-#define OMAP54XX_OCP_NRET_BANK_STATEST_MASK                                    (0x3 << 12)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_MM_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
-#define OMAP54XX_OFF_SHIFT                                                     0
-#define OMAP54XX_OFF_WIDTH                                                     0x8
-#define OMAP54XX_OFF_MASK                                                      (0xff << 0)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_MM_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
-#define OMAP54XX_ON_SHIFT                                                      24
-#define OMAP54XX_ON_WIDTH                                                      0x8
-#define OMAP54XX_ON_MASK                                                       (0xff << 24)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_MM_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
-#define OMAP54XX_ONLP_SHIFT                                                    16
-#define OMAP54XX_ONLP_WIDTH                                                    0x8
-#define OMAP54XX_ONLP_MASK                                                     (0xff << 16)
-
-/* Used by PRM_ABBLDO_MM_CTRL, PRM_ABBLDO_MPU_CTRL */
-#define OMAP54XX_OPP_CHANGE_SHIFT                                              2
-#define OMAP54XX_OPP_CHANGE_WIDTH                                              0x1
-#define OMAP54XX_OPP_CHANGE_MASK                                               (1 << 2)
-
-/* Used by PRM_VC_VAL_BYPASS */
-#define OMAP54XX_OPP_CHANGE_EMIF_LVL_SHIFT                                     25
-#define OMAP54XX_OPP_CHANGE_EMIF_LVL_WIDTH                                     0x1
-#define OMAP54XX_OPP_CHANGE_EMIF_LVL_MASK                                      (1 << 25)
-
-/* Used by PRM_ABBLDO_MM_CTRL, PRM_ABBLDO_MPU_CTRL */
-#define OMAP54XX_OPP_SEL_SHIFT                                                 0
-#define OMAP54XX_OPP_SEL_WIDTH                                                 0x2
-#define OMAP54XX_OPP_SEL_MASK                                                  (0x3 << 0)
-
-/* Used by PRM_DEBUG_OUT */
-#define OMAP54XX_OUTPUT_SHIFT                                                  0
-#define OMAP54XX_OUTPUT_WIDTH                                                  0x20
-#define OMAP54XX_OUTPUT_MASK                                                   (0xffffffff << 0)
-
-/* Used by PRM_SRAM_COUNT */
-#define OMAP54XX_PCHARGECNT_VALUE_SHIFT                                                0
-#define OMAP54XX_PCHARGECNT_VALUE_WIDTH                                                0x6
-#define OMAP54XX_PCHARGECNT_VALUE_MASK                                         (0x3f << 0)
-
-/* Used by PRM_PSCON_COUNT */
-#define OMAP54XX_PCHARGE_TIME_SHIFT                                            0
-#define OMAP54XX_PCHARGE_TIME_WIDTH                                            0x8
-#define OMAP54XX_PCHARGE_TIME_MASK                                             (0xff << 0)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP54XX_PERIPHMEM_ONSTATE_SHIFT                                       20
-#define OMAP54XX_PERIPHMEM_ONSTATE_WIDTH                                       0x2
-#define OMAP54XX_PERIPHMEM_ONSTATE_MASK                                                (0x3 << 20)
-
-/* Used by PM_ABE_PWRSTCTRL */
-#define OMAP54XX_PERIPHMEM_RETSTATE_SHIFT                                      10
-#define OMAP54XX_PERIPHMEM_RETSTATE_WIDTH                                      0x1
-#define OMAP54XX_PERIPHMEM_RETSTATE_MASK                                       (1 << 10)
-
-/* Used by PM_ABE_PWRSTST */
-#define OMAP54XX_PERIPHMEM_STATEST_SHIFT                                       8
-#define OMAP54XX_PERIPHMEM_STATEST_WIDTH                                       0x2
-#define OMAP54XX_PERIPHMEM_STATEST_MASK                                                (0x3 << 8)
-
-/* Used by PRM_PHASE1_CNDP */
-#define OMAP54XX_PHASE1_CNDP_SHIFT                                             0
-#define OMAP54XX_PHASE1_CNDP_WIDTH                                             0x20
-#define OMAP54XX_PHASE1_CNDP_MASK                                              (0xffffffff << 0)
-
-/* Used by PRM_PHASE2A_CNDP */
-#define OMAP54XX_PHASE2A_CNDP_SHIFT                                            0
-#define OMAP54XX_PHASE2A_CNDP_WIDTH                                            0x20
-#define OMAP54XX_PHASE2A_CNDP_MASK                                             (0xffffffff << 0)
-
-/* Used by PRM_PHASE2B_CNDP */
-#define OMAP54XX_PHASE2B_CNDP_SHIFT                                            0
-#define OMAP54XX_PHASE2B_CNDP_WIDTH                                            0x20
-#define OMAP54XX_PHASE2B_CNDP_MASK                                             (0xffffffff << 0)
-
-/* Used by PRM_PSCON_COUNT */
-#define OMAP54XX_PONOUT_2_PGOODIN_TIME_SHIFT                                   8
-#define OMAP54XX_PONOUT_2_PGOODIN_TIME_WIDTH                                   0x8
-#define OMAP54XX_PONOUT_2_PGOODIN_TIME_MASK                                    (0xff << 8)
-
-/*
- * Used by PM_ABE_PWRSTCTRL, PM_CAM_PWRSTCTRL, PM_CORE_PWRSTCTRL,
- * PM_CUSTEFUSE_PWRSTCTRL, PM_DSP_PWRSTCTRL, PM_DSS_PWRSTCTRL,
- * PM_EMU_PWRSTCTRL, PM_GPU_PWRSTCTRL, PM_IVA_PWRSTCTRL, PM_L3INIT_PWRSTCTRL,
- * PM_MPU_PWRSTCTRL
- */
-#define OMAP54XX_POWERSTATE_SHIFT                                              0
-#define OMAP54XX_POWERSTATE_WIDTH                                              0x2
-#define OMAP54XX_POWERSTATE_MASK                                               (0x3 << 0)
-
-/*
- * Used by PM_ABE_PWRSTST, PM_CAM_PWRSTST, PM_CORE_PWRSTST,
- * PM_CUSTEFUSE_PWRSTST, PM_DSP_PWRSTST, PM_DSS_PWRSTST, PM_EMU_PWRSTST,
- * PM_GPU_PWRSTST, PM_IVA_PWRSTST, PM_L3INIT_PWRSTST, PM_MPU_PWRSTST
- */
-#define OMAP54XX_POWERSTATEST_SHIFT                                            0
-#define OMAP54XX_POWERSTATEST_WIDTH                                            0x2
-#define OMAP54XX_POWERSTATEST_MASK                                             (0x3 << 0)
-
-/* Used by PRM_PWRREQCTRL */
-#define OMAP54XX_PWRREQ_COND_SHIFT                                             0
-#define OMAP54XX_PWRREQ_COND_WIDTH                                             0x2
-#define OMAP54XX_PWRREQ_COND_MASK                                              (0x3 << 0)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_RACEN_VDD_CORE_L_SHIFT                                                27
-#define OMAP54XX_RACEN_VDD_CORE_L_WIDTH                                                0x1
-#define OMAP54XX_RACEN_VDD_CORE_L_MASK                                         (1 << 27)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_RACEN_VDD_MM_L_SHIFT                                          27
-#define OMAP54XX_RACEN_VDD_MM_L_WIDTH                                          0x1
-#define OMAP54XX_RACEN_VDD_MM_L_MASK                                           (1 << 27)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_RACEN_VDD_MPU_L_SHIFT                                         27
-#define OMAP54XX_RACEN_VDD_MPU_L_WIDTH                                         0x1
-#define OMAP54XX_RACEN_VDD_MPU_L_MASK                                          (1 << 27)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_RAC_VDD_CORE_L_SHIFT                                          26
-#define OMAP54XX_RAC_VDD_CORE_L_WIDTH                                          0x1
-#define OMAP54XX_RAC_VDD_CORE_L_MASK                                           (1 << 26)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_RAC_VDD_MM_L_SHIFT                                            26
-#define OMAP54XX_RAC_VDD_MM_L_WIDTH                                            0x1
-#define OMAP54XX_RAC_VDD_MM_L_MASK                                             (1 << 26)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_RAC_VDD_MPU_L_SHIFT                                           26
-#define OMAP54XX_RAC_VDD_MPU_L_WIDTH                                           0x1
-#define OMAP54XX_RAC_VDD_MPU_L_MASK                                            (1 << 26)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_MM_OFF, PRM_VOLTSETUP_MM_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
-#define OMAP54XX_RAMP_DOWN_COUNT_SHIFT                                         16
-#define OMAP54XX_RAMP_DOWN_COUNT_WIDTH                                         0x6
-#define OMAP54XX_RAMP_DOWN_COUNT_MASK                                          (0x3f << 16)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_MM_OFF, PRM_VOLTSETUP_MM_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
-#define OMAP54XX_RAMP_DOWN_PRESCAL_SHIFT                                       24
-#define OMAP54XX_RAMP_DOWN_PRESCAL_WIDTH                                       0x2
-#define OMAP54XX_RAMP_DOWN_PRESCAL_MASK                                                (0x3 << 24)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_MM_OFF, PRM_VOLTSETUP_MM_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
-#define OMAP54XX_RAMP_UP_COUNT_SHIFT                                           0
-#define OMAP54XX_RAMP_UP_COUNT_WIDTH                                           0x6
-#define OMAP54XX_RAMP_UP_COUNT_MASK                                            (0x3f << 0)
-
-/*
- * Used by PRM_VOLTSETUP_CORE_OFF, PRM_VOLTSETUP_CORE_RET_SLEEP,
- * PRM_VOLTSETUP_MM_OFF, PRM_VOLTSETUP_MM_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF,
- * PRM_VOLTSETUP_MPU_RET_SLEEP
- */
-#define OMAP54XX_RAMP_UP_PRESCAL_SHIFT                                         8
-#define OMAP54XX_RAMP_UP_PRESCAL_WIDTH                                         0x2
-#define OMAP54XX_RAMP_UP_PRESCAL_MASK                                          (0x3 << 8)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_RAV_VDD_CORE_L_SHIFT                                          25
-#define OMAP54XX_RAV_VDD_CORE_L_WIDTH                                          0x1
-#define OMAP54XX_RAV_VDD_CORE_L_MASK                                           (1 << 25)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_RAV_VDD_MM_L_SHIFT                                            25
-#define OMAP54XX_RAV_VDD_MM_L_WIDTH                                            0x1
-#define OMAP54XX_RAV_VDD_MM_L_MASK                                             (1 << 25)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_RAV_VDD_MPU_L_SHIFT                                           25
-#define OMAP54XX_RAV_VDD_MPU_L_WIDTH                                           0x1
-#define OMAP54XX_RAV_VDD_MPU_L_MASK                                            (1 << 25)
-
-/* Used by PRM_VC_VAL_BYPASS */
-#define OMAP54XX_REGADDR_SHIFT                                                 8
-#define OMAP54XX_REGADDR_WIDTH                                                 0x8
-#define OMAP54XX_REGADDR_MASK                                                  (0xff << 8)
-
-/*
- * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_MM_L,
- * PRM_VC_VAL_CMD_VDD_MPU_L
- */
-#define OMAP54XX_RET_SHIFT                                                     8
-#define OMAP54XX_RET_WIDTH                                                     0x8
-#define OMAP54XX_RET_MASK                                                      (0xff << 8)
-
-/* Used by PRM_SLDO_CORE_CTRL, PRM_SLDO_MM_CTRL, PRM_SLDO_MPU_CTRL */
-#define OMAP54XX_RETMODE_ENABLE_SHIFT                                          0
-#define OMAP54XX_RETMODE_ENABLE_WIDTH                                          0x1
-#define OMAP54XX_RETMODE_ENABLE_MASK                                           (1 << 0)
-
-/* Used by PRM_RSTTIME */
-#define OMAP54XX_RSTTIME1_SHIFT                                                        0
-#define OMAP54XX_RSTTIME1_WIDTH                                                        0xa
-#define OMAP54XX_RSTTIME1_MASK                                                 (0x3ff << 0)
-
-/* Used by PRM_RSTTIME */
-#define OMAP54XX_RSTTIME2_SHIFT                                                        10
-#define OMAP54XX_RSTTIME2_WIDTH                                                        0x5
-#define OMAP54XX_RSTTIME2_MASK                                                 (0x1f << 10)
-
-/* Used by RM_IPU_RSTCTRL, RM_IPU_RSTST */
-#define OMAP54XX_RST_CPU0_SHIFT                                                        0
-#define OMAP54XX_RST_CPU0_WIDTH                                                        0x1
-#define OMAP54XX_RST_CPU0_MASK                                                 (1 << 0)
-
-/* Used by RM_IPU_RSTCTRL, RM_IPU_RSTST */
-#define OMAP54XX_RST_CPU1_SHIFT                                                        1
-#define OMAP54XX_RST_CPU1_WIDTH                                                        0x1
-#define OMAP54XX_RST_CPU1_MASK                                                 (1 << 1)
-
-/* Used by RM_DSP_RSTCTRL, RM_DSP_RSTST */
-#define OMAP54XX_RST_DSP_SHIFT                                                 0
-#define OMAP54XX_RST_DSP_WIDTH                                                 0x1
-#define OMAP54XX_RST_DSP_MASK                                                  (1 << 0)
-
-/* Used by RM_DSP_RSTST */
-#define OMAP54XX_RST_DSP_EMU_SHIFT                                             2
-#define OMAP54XX_RST_DSP_EMU_WIDTH                                             0x1
-#define OMAP54XX_RST_DSP_EMU_MASK                                              (1 << 2)
-
-/* Used by RM_DSP_RSTST */
-#define OMAP54XX_RST_DSP_EMU_REQ_SHIFT                                         3
-#define OMAP54XX_RST_DSP_EMU_REQ_WIDTH                                         0x1
-#define OMAP54XX_RST_DSP_EMU_REQ_MASK                                          (1 << 3)
-
-/* Used by RM_DSP_RSTCTRL, RM_DSP_RSTST */
-#define OMAP54XX_RST_DSP_MMU_CACHE_SHIFT                                       1
-#define OMAP54XX_RST_DSP_MMU_CACHE_WIDTH                                       0x1
-#define OMAP54XX_RST_DSP_MMU_CACHE_MASK                                                (1 << 1)
-
-/* Used by RM_IPU_RSTST */
-#define OMAP54XX_RST_EMULATION_CPU0_SHIFT                                      3
-#define OMAP54XX_RST_EMULATION_CPU0_WIDTH                                      0x1
-#define OMAP54XX_RST_EMULATION_CPU0_MASK                                       (1 << 3)
-
-/* Used by RM_IPU_RSTST */
-#define OMAP54XX_RST_EMULATION_CPU1_SHIFT                                      4
-#define OMAP54XX_RST_EMULATION_CPU1_WIDTH                                      0x1
-#define OMAP54XX_RST_EMULATION_CPU1_MASK                                       (1 << 4)
-
-/* Used by RM_IVA_RSTST */
-#define OMAP54XX_RST_EMULATION_SEQ1_SHIFT                                      3
-#define OMAP54XX_RST_EMULATION_SEQ1_WIDTH                                      0x1
-#define OMAP54XX_RST_EMULATION_SEQ1_MASK                                       (1 << 3)
-
-/* Used by RM_IVA_RSTST */
-#define OMAP54XX_RST_EMULATION_SEQ2_SHIFT                                      4
-#define OMAP54XX_RST_EMULATION_SEQ2_WIDTH                                      0x1
-#define OMAP54XX_RST_EMULATION_SEQ2_MASK                                       (1 << 4)
-
-/* Used by PRM_RSTCTRL */
-#define OMAP54XX_RST_GLOBAL_COLD_SW_SHIFT                                      1
-#define OMAP54XX_RST_GLOBAL_COLD_SW_WIDTH                                      0x1
-#define OMAP54XX_RST_GLOBAL_COLD_SW_MASK                                       (1 << 1)
-
-/* Used by PRM_RSTCTRL */
-#define OMAP54XX_RST_GLOBAL_WARM_SW_SHIFT                                      0
-#define OMAP54XX_RST_GLOBAL_WARM_SW_WIDTH                                      0x1
-#define OMAP54XX_RST_GLOBAL_WARM_SW_MASK                                       (1 << 0)
-
-/* Used by RM_IPU_RSTST */
-#define OMAP54XX_RST_ICECRUSHER_CPU0_SHIFT                                     5
-#define OMAP54XX_RST_ICECRUSHER_CPU0_WIDTH                                     0x1
-#define OMAP54XX_RST_ICECRUSHER_CPU0_MASK                                      (1 << 5)
-
-/* Used by RM_IPU_RSTST */
-#define OMAP54XX_RST_ICECRUSHER_CPU1_SHIFT                                     6
-#define OMAP54XX_RST_ICECRUSHER_CPU1_WIDTH                                     0x1
-#define OMAP54XX_RST_ICECRUSHER_CPU1_MASK                                      (1 << 6)
-
-/* Used by RM_IVA_RSTST */
-#define OMAP54XX_RST_ICECRUSHER_SEQ1_SHIFT                                     5
-#define OMAP54XX_RST_ICECRUSHER_SEQ1_WIDTH                                     0x1
-#define OMAP54XX_RST_ICECRUSHER_SEQ1_MASK                                      (1 << 5)
-
-/* Used by RM_IVA_RSTST */
-#define OMAP54XX_RST_ICECRUSHER_SEQ2_SHIFT                                     6
-#define OMAP54XX_RST_ICECRUSHER_SEQ2_WIDTH                                     0x1
-#define OMAP54XX_RST_ICECRUSHER_SEQ2_MASK                                      (1 << 6)
-
-/* Used by RM_IPU_RSTCTRL, RM_IPU_RSTST */
-#define OMAP54XX_RST_IPU_MMU_CACHE_SHIFT                                       2
-#define OMAP54XX_RST_IPU_MMU_CACHE_WIDTH                                       0x1
-#define OMAP54XX_RST_IPU_MMU_CACHE_MASK                                                (1 << 2)
-
-/* Used by RM_IVA_RSTCTRL, RM_IVA_RSTST */
-#define OMAP54XX_RST_LOGIC_SHIFT                                               2
-#define OMAP54XX_RST_LOGIC_WIDTH                                               0x1
-#define OMAP54XX_RST_LOGIC_MASK                                                        (1 << 2)
-
-/* Used by RM_IVA_RSTCTRL, RM_IVA_RSTST */
-#define OMAP54XX_RST_SEQ1_SHIFT                                                        0
-#define OMAP54XX_RST_SEQ1_WIDTH                                                        0x1
-#define OMAP54XX_RST_SEQ1_MASK                                                 (1 << 0)
-
-/* Used by RM_IVA_RSTCTRL, RM_IVA_RSTST */
-#define OMAP54XX_RST_SEQ2_SHIFT                                                        1
-#define OMAP54XX_RST_SEQ2_WIDTH                                                        0x1
-#define OMAP54XX_RST_SEQ2_MASK                                                 (1 << 1)
-
-/* Used by REVISION_PRM */
-#define OMAP54XX_R_RTL_SHIFT                                                   11
-#define OMAP54XX_R_RTL_WIDTH                                                   0x5
-#define OMAP54XX_R_RTL_MASK                                                    (0x1f << 11)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_SA_VDD_CORE_L_SHIFT                                           0
-#define OMAP54XX_SA_VDD_CORE_L_WIDTH                                           0x7
-#define OMAP54XX_SA_VDD_CORE_L_MASK                                            (0x7f << 0)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_SA_VDD_MM_L_SHIFT                                             0
-#define OMAP54XX_SA_VDD_MM_L_WIDTH                                             0x7
-#define OMAP54XX_SA_VDD_MM_L_MASK                                              (0x7f << 0)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_SA_VDD_MPU_L_SHIFT                                            0
-#define OMAP54XX_SA_VDD_MPU_L_WIDTH                                            0x7
-#define OMAP54XX_SA_VDD_MPU_L_MASK                                             (0x7f << 0)
-
-/* Used by REVISION_PRM */
-#define OMAP54XX_SCHEME_SHIFT                                                  30
-#define OMAP54XX_SCHEME_WIDTH                                                  0x2
-#define OMAP54XX_SCHEME_MASK                                                   (0x3 << 30)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
-#define OMAP54XX_SCLH_SHIFT                                                    0
-#define OMAP54XX_SCLH_WIDTH                                                    0x8
-#define OMAP54XX_SCLH_MASK                                                     (0xff << 0)
-
-/* Used by PRM_VC_CFG_I2C_CLK */
-#define OMAP54XX_SCLL_SHIFT                                                    8
-#define OMAP54XX_SCLL_WIDTH                                                    0x8
-#define OMAP54XX_SCLL_MASK                                                     (0xff << 8)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_SECURE_WDT_RST_SHIFT                                          4
-#define OMAP54XX_SECURE_WDT_RST_WIDTH                                          0x1
-#define OMAP54XX_SECURE_WDT_RST_MASK                                           (1 << 4)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_SEL_SA_VDD_CORE_L_SHIFT                                       24
-#define OMAP54XX_SEL_SA_VDD_CORE_L_WIDTH                                       0x1
-#define OMAP54XX_SEL_SA_VDD_CORE_L_MASK                                                (1 << 24)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_SEL_SA_VDD_MM_L_SHIFT                                         24
-#define OMAP54XX_SEL_SA_VDD_MM_L_WIDTH                                         0x1
-#define OMAP54XX_SEL_SA_VDD_MM_L_MASK                                          (1 << 24)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_SEL_SA_VDD_MPU_L_SHIFT                                                24
-#define OMAP54XX_SEL_SA_VDD_MPU_L_WIDTH                                                0x1
-#define OMAP54XX_SEL_SA_VDD_MPU_L_MASK                                         (1 << 24)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_SL2_MEM_ONSTATE_SHIFT                                         18
-#define OMAP54XX_SL2_MEM_ONSTATE_WIDTH                                         0x2
-#define OMAP54XX_SL2_MEM_ONSTATE_MASK                                          (0x3 << 18)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_SL2_MEM_RETSTATE_SHIFT                                                9
-#define OMAP54XX_SL2_MEM_RETSTATE_WIDTH                                                0x1
-#define OMAP54XX_SL2_MEM_RETSTATE_MASK                                         (1 << 9)
-
-/* Used by PM_IVA_PWRSTST */
-#define OMAP54XX_SL2_MEM_STATEST_SHIFT                                         6
-#define OMAP54XX_SL2_MEM_STATEST_WIDTH                                         0x2
-#define OMAP54XX_SL2_MEM_STATEST_MASK                                          (0x3 << 6)
-
-/* Used by PRM_VC_VAL_BYPASS */
-#define OMAP54XX_SLAVEADDR_SHIFT                                               0
-#define OMAP54XX_SLAVEADDR_WIDTH                                               0x7
-#define OMAP54XX_SLAVEADDR_MASK                                                        (0x7f << 0)
-
-/* Used by PRM_SRAM_COUNT */
-#define OMAP54XX_SLPCNT_VALUE_SHIFT                                            16
-#define OMAP54XX_SLPCNT_VALUE_WIDTH                                            0x8
-#define OMAP54XX_SLPCNT_VALUE_MASK                                             (0xff << 16)
-
-/* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_MM_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */
-#define OMAP54XX_SMPSWAITTIMEMAX_SHIFT                                         8
-#define OMAP54XX_SMPSWAITTIMEMAX_WIDTH                                         0x10
-#define OMAP54XX_SMPSWAITTIMEMAX_MASK                                          (0xffff << 8)
-
-/* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_MM_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */
-#define OMAP54XX_SMPSWAITTIMEMIN_SHIFT                                         8
-#define OMAP54XX_SMPSWAITTIMEMIN_WIDTH                                         0x10
-#define OMAP54XX_SMPSWAITTIMEMIN_MASK                                          (0xffff << 8)
-
-/* Used by PRM_VC_CORE_ERRST */
-#define OMAP54XX_SMPS_RA_ERR_CORE_SHIFT                                                1
-#define OMAP54XX_SMPS_RA_ERR_CORE_WIDTH                                                0x1
-#define OMAP54XX_SMPS_RA_ERR_CORE_MASK                                         (1 << 1)
-
-/* Used by PRM_VC_MM_ERRST */
-#define OMAP54XX_SMPS_RA_ERR_MM_SHIFT                                          1
-#define OMAP54XX_SMPS_RA_ERR_MM_WIDTH                                          0x1
-#define OMAP54XX_SMPS_RA_ERR_MM_MASK                                           (1 << 1)
-
-/* Used by PRM_VC_MPU_ERRST */
-#define OMAP54XX_SMPS_RA_ERR_MPU_SHIFT                                         1
-#define OMAP54XX_SMPS_RA_ERR_MPU_WIDTH                                         0x1
-#define OMAP54XX_SMPS_RA_ERR_MPU_MASK                                          (1 << 1)
-
-/* Used by PRM_VC_CORE_ERRST */
-#define OMAP54XX_SMPS_SA_ERR_CORE_SHIFT                                                0
-#define OMAP54XX_SMPS_SA_ERR_CORE_WIDTH                                                0x1
-#define OMAP54XX_SMPS_SA_ERR_CORE_MASK                                         (1 << 0)
-
-/* Used by PRM_VC_MM_ERRST */
-#define OMAP54XX_SMPS_SA_ERR_MM_SHIFT                                          0
-#define OMAP54XX_SMPS_SA_ERR_MM_WIDTH                                          0x1
-#define OMAP54XX_SMPS_SA_ERR_MM_MASK                                           (1 << 0)
-
-/* Used by PRM_VC_MPU_ERRST */
-#define OMAP54XX_SMPS_SA_ERR_MPU_SHIFT                                         0
-#define OMAP54XX_SMPS_SA_ERR_MPU_WIDTH                                         0x1
-#define OMAP54XX_SMPS_SA_ERR_MPU_MASK                                          (1 << 0)
-
-/* Used by PRM_VC_CORE_ERRST */
-#define OMAP54XX_SMPS_TIMEOUT_ERR_CORE_SHIFT                                   2
-#define OMAP54XX_SMPS_TIMEOUT_ERR_CORE_WIDTH                                   0x1
-#define OMAP54XX_SMPS_TIMEOUT_ERR_CORE_MASK                                    (1 << 2)
-
-/* Used by PRM_VC_MM_ERRST */
-#define OMAP54XX_SMPS_TIMEOUT_ERR_MM_SHIFT                                     2
-#define OMAP54XX_SMPS_TIMEOUT_ERR_MM_WIDTH                                     0x1
-#define OMAP54XX_SMPS_TIMEOUT_ERR_MM_MASK                                      (1 << 2)
-
-/* Used by PRM_VC_MPU_ERRST */
-#define OMAP54XX_SMPS_TIMEOUT_ERR_MPU_SHIFT                                    2
-#define OMAP54XX_SMPS_TIMEOUT_ERR_MPU_WIDTH                                    0x1
-#define OMAP54XX_SMPS_TIMEOUT_ERR_MPU_MASK                                     (1 << 2)
-
-/* Used by PRM_ABBLDO_MM_SETUP, PRM_ABBLDO_MPU_SETUP */
-#define OMAP54XX_SR2EN_SHIFT                                                   0
-#define OMAP54XX_SR2EN_WIDTH                                                   0x1
-#define OMAP54XX_SR2EN_MASK                                                    (1 << 0)
-
-/* Used by PRM_ABBLDO_MM_CTRL, PRM_ABBLDO_MPU_CTRL */
-#define OMAP54XX_SR2_IN_TRANSITION_SHIFT                                       6
-#define OMAP54XX_SR2_IN_TRANSITION_WIDTH                                       0x1
-#define OMAP54XX_SR2_IN_TRANSITION_MASK                                                (1 << 6)
-
-/* Used by PRM_ABBLDO_MM_CTRL, PRM_ABBLDO_MPU_CTRL */
-#define OMAP54XX_SR2_STATUS_SHIFT                                              3
-#define OMAP54XX_SR2_STATUS_WIDTH                                              0x2
-#define OMAP54XX_SR2_STATUS_MASK                                               (0x3 << 3)
-
-/* Used by PRM_ABBLDO_MM_SETUP, PRM_ABBLDO_MPU_SETUP */
-#define OMAP54XX_SR2_WTCNT_VALUE_SHIFT                                         8
-#define OMAP54XX_SR2_WTCNT_VALUE_WIDTH                                         0x8
-#define OMAP54XX_SR2_WTCNT_VALUE_MASK                                          (0xff << 8)
-
-/* Used by PRM_SLDO_CORE_CTRL, PRM_SLDO_MM_CTRL, PRM_SLDO_MPU_CTRL */
-#define OMAP54XX_SRAMLDO_STATUS_SHIFT                                          8
-#define OMAP54XX_SRAMLDO_STATUS_WIDTH                                          0x1
-#define OMAP54XX_SRAMLDO_STATUS_MASK                                           (1 << 8)
-
-/* Used by PRM_SLDO_CORE_CTRL, PRM_SLDO_MM_CTRL, PRM_SLDO_MPU_CTRL */
-#define OMAP54XX_SRAM_IN_TRANSITION_SHIFT                                      9
-#define OMAP54XX_SRAM_IN_TRANSITION_WIDTH                                      0x1
-#define OMAP54XX_SRAM_IN_TRANSITION_MASK                                       (1 << 9)
-
-/* Used by PRM_VC_CFG_I2C_MODE */
-#define OMAP54XX_SRMODEEN_SHIFT                                                        4
-#define OMAP54XX_SRMODEEN_WIDTH                                                        0x1
-#define OMAP54XX_SRMODEEN_MASK                                                 (1 << 4)
-
-/* Used by PRM_VOLTSETUP_WARMRESET */
-#define OMAP54XX_STABLE_COUNT_SHIFT                                            0
-#define OMAP54XX_STABLE_COUNT_WIDTH                                            0x6
-#define OMAP54XX_STABLE_COUNT_MASK                                             (0x3f << 0)
-
-/* Used by PRM_VOLTSETUP_WARMRESET */
-#define OMAP54XX_STABLE_PRESCAL_SHIFT                                          8
-#define OMAP54XX_STABLE_PRESCAL_WIDTH                                          0x2
-#define OMAP54XX_STABLE_PRESCAL_MASK                                           (0x3 << 8)
-
-/* Used by PRM_BANDGAP_SETUP */
-#define OMAP54XX_STARTUP_COUNT_SHIFT                                           0
-#define OMAP54XX_STARTUP_COUNT_WIDTH                                           0x8
-#define OMAP54XX_STARTUP_COUNT_MASK                                            (0xff << 0)
-
-/* Renamed from STARTUP_COUNT Used by PRM_SRAM_COUNT */
-#define OMAP54XX_STARTUP_COUNT_24_31_SHIFT                                     24
-#define OMAP54XX_STARTUP_COUNT_24_31_WIDTH                                     0x8
-#define OMAP54XX_STARTUP_COUNT_24_31_MASK                                      (0xff << 24)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_TCM1_MEM_ONSTATE_SHIFT                                                20
-#define OMAP54XX_TCM1_MEM_ONSTATE_WIDTH                                                0x2
-#define OMAP54XX_TCM1_MEM_ONSTATE_MASK                                         (0x3 << 20)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_TCM1_MEM_RETSTATE_SHIFT                                       10
-#define OMAP54XX_TCM1_MEM_RETSTATE_WIDTH                                       0x1
-#define OMAP54XX_TCM1_MEM_RETSTATE_MASK                                                (1 << 10)
-
-/* Used by PM_IVA_PWRSTST */
-#define OMAP54XX_TCM1_MEM_STATEST_SHIFT                                                8
-#define OMAP54XX_TCM1_MEM_STATEST_WIDTH                                                0x2
-#define OMAP54XX_TCM1_MEM_STATEST_MASK                                         (0x3 << 8)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_TCM2_MEM_ONSTATE_SHIFT                                                22
-#define OMAP54XX_TCM2_MEM_ONSTATE_WIDTH                                                0x2
-#define OMAP54XX_TCM2_MEM_ONSTATE_MASK                                         (0x3 << 22)
-
-/* Used by PM_IVA_PWRSTCTRL */
-#define OMAP54XX_TCM2_MEM_RETSTATE_SHIFT                                       11
-#define OMAP54XX_TCM2_MEM_RETSTATE_WIDTH                                       0x1
-#define OMAP54XX_TCM2_MEM_RETSTATE_MASK                                                (1 << 11)
-
-/* Used by PM_IVA_PWRSTST */
-#define OMAP54XX_TCM2_MEM_STATEST_SHIFT                                                10
-#define OMAP54XX_TCM2_MEM_STATEST_WIDTH                                                0x2
-#define OMAP54XX_TCM2_MEM_STATEST_MASK                                         (0x3 << 10)
-
-/* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_MM_VLIMITTO, PRM_VP_MPU_VLIMITTO */
-#define OMAP54XX_TIMEOUT_SHIFT                                                 0
-#define OMAP54XX_TIMEOUT_WIDTH                                                 0x10
-#define OMAP54XX_TIMEOUT_MASK                                                  (0xffff << 0)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_MM_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP54XX_TIMEOUTEN_SHIFT                                               3
-#define OMAP54XX_TIMEOUTEN_WIDTH                                               0x1
-#define OMAP54XX_TIMEOUTEN_MASK                                                        (1 << 3)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_TRANSITION_EN_SHIFT                                           8
-#define OMAP54XX_TRANSITION_EN_WIDTH                                           0x1
-#define OMAP54XX_TRANSITION_EN_MASK                                            (1 << 8)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_TRANSITION_ST_SHIFT                                           8
-#define OMAP54XX_TRANSITION_ST_WIDTH                                           0x1
-#define OMAP54XX_TRANSITION_ST_MASK                                            (1 << 8)
-
-/* Used by PRM_DEBUG_TRANS_CFG */
-#define OMAP54XX_TRIGGER_CLEAR_SHIFT                                           2
-#define OMAP54XX_TRIGGER_CLEAR_WIDTH                                           0x1
-#define OMAP54XX_TRIGGER_CLEAR_MASK                                            (1 << 2)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_TSHUT_CORE_RST_SHIFT                                          13
-#define OMAP54XX_TSHUT_CORE_RST_WIDTH                                          0x1
-#define OMAP54XX_TSHUT_CORE_RST_MASK                                           (1 << 13)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_TSHUT_MM_RST_SHIFT                                            12
-#define OMAP54XX_TSHUT_MM_RST_WIDTH                                            0x1
-#define OMAP54XX_TSHUT_MM_RST_MASK                                             (1 << 12)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_TSHUT_MPU_RST_SHIFT                                           11
-#define OMAP54XX_TSHUT_MPU_RST_WIDTH                                           0x1
-#define OMAP54XX_TSHUT_MPU_RST_MASK                                            (1 << 11)
-
-/* Used by PRM_VC_VAL_BYPASS */
-#define OMAP54XX_VALID_SHIFT                                                   24
-#define OMAP54XX_VALID_WIDTH                                                   0x1
-#define OMAP54XX_VALID_MASK                                                    (1 << 24)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VC_BYPASSACK_EN_SHIFT                                         14
-#define OMAP54XX_VC_BYPASSACK_EN_WIDTH                                         0x1
-#define OMAP54XX_VC_BYPASSACK_EN_MASK                                          (1 << 14)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VC_BYPASSACK_ST_SHIFT                                         14
-#define OMAP54XX_VC_BYPASSACK_ST_WIDTH                                         0x1
-#define OMAP54XX_VC_BYPASSACK_ST_MASK                                          (1 << 14)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VC_CORE_VPACK_EN_SHIFT                                                22
-#define OMAP54XX_VC_CORE_VPACK_EN_WIDTH                                                0x1
-#define OMAP54XX_VC_CORE_VPACK_EN_MASK                                         (1 << 22)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VC_CORE_VPACK_ST_SHIFT                                                22
-#define OMAP54XX_VC_CORE_VPACK_ST_WIDTH                                                0x1
-#define OMAP54XX_VC_CORE_VPACK_ST_MASK                                         (1 << 22)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VC_MM_VPACK_EN_SHIFT                                          30
-#define OMAP54XX_VC_MM_VPACK_EN_WIDTH                                          0x1
-#define OMAP54XX_VC_MM_VPACK_EN_MASK                                           (1 << 30)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VC_MM_VPACK_ST_SHIFT                                          30
-#define OMAP54XX_VC_MM_VPACK_ST_WIDTH                                          0x1
-#define OMAP54XX_VC_MM_VPACK_ST_MASK                                           (1 << 30)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_VC_MPU_VPACK_EN_SHIFT                                         6
-#define OMAP54XX_VC_MPU_VPACK_EN_WIDTH                                         0x1
-#define OMAP54XX_VC_MPU_VPACK_EN_MASK                                          (1 << 6)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_VC_MPU_VPACK_ST_SHIFT                                         6
-#define OMAP54XX_VC_MPU_VPACK_ST_WIDTH                                         0x1
-#define OMAP54XX_VC_MPU_VPACK_ST_MASK                                          (1 << 6)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VC_RAERR_EN_SHIFT                                             12
-#define OMAP54XX_VC_RAERR_EN_WIDTH                                             0x1
-#define OMAP54XX_VC_RAERR_EN_MASK                                              (1 << 12)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VC_RAERR_ST_SHIFT                                             12
-#define OMAP54XX_VC_RAERR_ST_WIDTH                                             0x1
-#define OMAP54XX_VC_RAERR_ST_MASK                                              (1 << 12)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VC_SAERR_EN_SHIFT                                             11
-#define OMAP54XX_VC_SAERR_EN_WIDTH                                             0x1
-#define OMAP54XX_VC_SAERR_EN_MASK                                              (1 << 11)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VC_SAERR_ST_SHIFT                                             11
-#define OMAP54XX_VC_SAERR_ST_WIDTH                                             0x1
-#define OMAP54XX_VC_SAERR_ST_MASK                                              (1 << 11)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VC_TOERR_EN_SHIFT                                             13
-#define OMAP54XX_VC_TOERR_EN_WIDTH                                             0x1
-#define OMAP54XX_VC_TOERR_EN_MASK                                              (1 << 13)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VC_TOERR_ST_SHIFT                                             13
-#define OMAP54XX_VC_TOERR_ST_WIDTH                                             0x1
-#define OMAP54XX_VC_TOERR_ST_MASK                                              (1 << 13)
-
-/* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_MM_VLIMITTO, PRM_VP_MPU_VLIMITTO */
-#define OMAP54XX_VDDMAX_SHIFT                                                  24
-#define OMAP54XX_VDDMAX_WIDTH                                                  0x8
-#define OMAP54XX_VDDMAX_MASK                                                   (0xff << 24)
-
-/* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_MM_VLIMITTO, PRM_VP_MPU_VLIMITTO */
-#define OMAP54XX_VDDMIN_SHIFT                                                  16
-#define OMAP54XX_VDDMIN_WIDTH                                                  0x8
-#define OMAP54XX_VDDMIN_MASK                                                   (0xff << 16)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_VDD_CORE_I2C_DISABLE_SHIFT                                    12
-#define OMAP54XX_VDD_CORE_I2C_DISABLE_WIDTH                                    0x1
-#define OMAP54XX_VDD_CORE_I2C_DISABLE_MASK                                     (1 << 12)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_VDD_CORE_VOLT_MGR_RST_SHIFT                                   8
-#define OMAP54XX_VDD_CORE_VOLT_MGR_RST_WIDTH                                   0x1
-#define OMAP54XX_VDD_CORE_VOLT_MGR_RST_MASK                                    (1 << 8)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_VDD_MM_I2C_DISABLE_SHIFT                                      14
-#define OMAP54XX_VDD_MM_I2C_DISABLE_WIDTH                                      0x1
-#define OMAP54XX_VDD_MM_I2C_DISABLE_MASK                                       (1 << 14)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_VDD_MM_PRESENCE_SHIFT                                         9
-#define OMAP54XX_VDD_MM_PRESENCE_WIDTH                                         0x1
-#define OMAP54XX_VDD_MM_PRESENCE_MASK                                          (1 << 9)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_VDD_MM_VOLT_MGR_RST_SHIFT                                     7
-#define OMAP54XX_VDD_MM_VOLT_MGR_RST_WIDTH                                     0x1
-#define OMAP54XX_VDD_MM_VOLT_MGR_RST_MASK                                      (1 << 7)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_VDD_MPU_I2C_DISABLE_SHIFT                                     13
-#define OMAP54XX_VDD_MPU_I2C_DISABLE_WIDTH                                     0x1
-#define OMAP54XX_VDD_MPU_I2C_DISABLE_MASK                                      (1 << 13)
-
-/* Used by PRM_VOLTCTRL */
-#define OMAP54XX_VDD_MPU_PRESENCE_SHIFT                                                8
-#define OMAP54XX_VDD_MPU_PRESENCE_WIDTH                                                0x1
-#define OMAP54XX_VDD_MPU_PRESENCE_MASK                                         (1 << 8)
-
-/* Used by PRM_RSTST */
-#define OMAP54XX_VDD_MPU_VOLT_MGR_RST_SHIFT                                    6
-#define OMAP54XX_VDD_MPU_VOLT_MGR_RST_WIDTH                                    0x1
-#define OMAP54XX_VDD_MPU_VOLT_MGR_RST_MASK                                     (1 << 6)
-
-/* Used by PRM_VC_CORE_ERRST */
-#define OMAP54XX_VFSM_RA_ERR_CORE_SHIFT                                                4
-#define OMAP54XX_VFSM_RA_ERR_CORE_WIDTH                                                0x1
-#define OMAP54XX_VFSM_RA_ERR_CORE_MASK                                         (1 << 4)
-
-/* Used by PRM_VC_MM_ERRST */
-#define OMAP54XX_VFSM_RA_ERR_MM_SHIFT                                          4
-#define OMAP54XX_VFSM_RA_ERR_MM_WIDTH                                          0x1
-#define OMAP54XX_VFSM_RA_ERR_MM_MASK                                           (1 << 4)
-
-/* Used by PRM_VC_MPU_ERRST */
-#define OMAP54XX_VFSM_RA_ERR_MPU_SHIFT                                         4
-#define OMAP54XX_VFSM_RA_ERR_MPU_WIDTH                                         0x1
-#define OMAP54XX_VFSM_RA_ERR_MPU_MASK                                          (1 << 4)
-
-/* Used by PRM_VC_CORE_ERRST */
-#define OMAP54XX_VFSM_SA_ERR_CORE_SHIFT                                                3
-#define OMAP54XX_VFSM_SA_ERR_CORE_WIDTH                                                0x1
-#define OMAP54XX_VFSM_SA_ERR_CORE_MASK                                         (1 << 3)
-
-/* Used by PRM_VC_MM_ERRST */
-#define OMAP54XX_VFSM_SA_ERR_MM_SHIFT                                          3
-#define OMAP54XX_VFSM_SA_ERR_MM_WIDTH                                          0x1
-#define OMAP54XX_VFSM_SA_ERR_MM_MASK                                           (1 << 3)
-
-/* Used by PRM_VC_MPU_ERRST */
-#define OMAP54XX_VFSM_SA_ERR_MPU_SHIFT                                         3
-#define OMAP54XX_VFSM_SA_ERR_MPU_WIDTH                                         0x1
-#define OMAP54XX_VFSM_SA_ERR_MPU_MASK                                          (1 << 3)
-
-/* Used by PRM_VC_CORE_ERRST */
-#define OMAP54XX_VFSM_TIMEOUT_ERR_CORE_SHIFT                                   5
-#define OMAP54XX_VFSM_TIMEOUT_ERR_CORE_WIDTH                                   0x1
-#define OMAP54XX_VFSM_TIMEOUT_ERR_CORE_MASK                                    (1 << 5)
-
-/* Used by PRM_VC_MM_ERRST */
-#define OMAP54XX_VFSM_TIMEOUT_ERR_MM_SHIFT                                     5
-#define OMAP54XX_VFSM_TIMEOUT_ERR_MM_WIDTH                                     0x1
-#define OMAP54XX_VFSM_TIMEOUT_ERR_MM_MASK                                      (1 << 5)
-
-/* Used by PRM_VC_MPU_ERRST */
-#define OMAP54XX_VFSM_TIMEOUT_ERR_MPU_SHIFT                                    5
-#define OMAP54XX_VFSM_TIMEOUT_ERR_MPU_WIDTH                                    0x1
-#define OMAP54XX_VFSM_TIMEOUT_ERR_MPU_MASK                                     (1 << 5)
-
-/* Used by PRM_VC_SMPS_CORE_CONFIG */
-#define OMAP54XX_VOLRA_VDD_CORE_L_SHIFT                                                8
-#define OMAP54XX_VOLRA_VDD_CORE_L_WIDTH                                                0x8
-#define OMAP54XX_VOLRA_VDD_CORE_L_MASK                                         (0xff << 8)
-
-/* Used by PRM_VC_SMPS_MM_CONFIG */
-#define OMAP54XX_VOLRA_VDD_MM_L_SHIFT                                          8
-#define OMAP54XX_VOLRA_VDD_MM_L_WIDTH                                          0x8
-#define OMAP54XX_VOLRA_VDD_MM_L_MASK                                           (0xff << 8)
-
-/* Used by PRM_VC_SMPS_MPU_CONFIG */
-#define OMAP54XX_VOLRA_VDD_MPU_L_SHIFT                                         8
-#define OMAP54XX_VOLRA_VDD_MPU_L_WIDTH                                         0x8
-#define OMAP54XX_VOLRA_VDD_MPU_L_MASK                                          (0xff << 8)
-
-/* Used by PRM_VOLTST_MM, PRM_VOLTST_MPU */
-#define OMAP54XX_VOLTSTATEST_SHIFT                                             0
-#define OMAP54XX_VOLTSTATEST_WIDTH                                             0x2
-#define OMAP54XX_VOLTSTATEST_MASK                                              (0x3 << 0)
-
-/* Used by PRM_VP_CORE_CONFIG, PRM_VP_MM_CONFIG, PRM_VP_MPU_CONFIG */
-#define OMAP54XX_VPENABLE_SHIFT                                                        0
-#define OMAP54XX_VPENABLE_WIDTH                                                        0x1
-#define OMAP54XX_VPENABLE_MASK                                                 (1 << 0)
-
-/* Used by PRM_VP_CORE_STATUS, PRM_VP_MM_STATUS, PRM_VP_MPU_STATUS */
-#define OMAP54XX_VPINIDLE_SHIFT                                                        0
-#define OMAP54XX_VPINIDLE_WIDTH                                                        0x1
-#define OMAP54XX_VPINIDLE_MASK                                                 (1 << 0)
-
-/* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_MM_VOLTAGE, PRM_VP_MPU_VOLTAGE */
-#define OMAP54XX_VPVOLTAGE_SHIFT                                               0
-#define OMAP54XX_VPVOLTAGE_WIDTH                                               0x8
-#define OMAP54XX_VPVOLTAGE_MASK                                                        (0xff << 0)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_CORE_EQVALUE_EN_SHIFT                                      20
-#define OMAP54XX_VP_CORE_EQVALUE_EN_WIDTH                                      0x1
-#define OMAP54XX_VP_CORE_EQVALUE_EN_MASK                                       (1 << 20)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_CORE_EQVALUE_ST_SHIFT                                      20
-#define OMAP54XX_VP_CORE_EQVALUE_ST_WIDTH                                      0x1
-#define OMAP54XX_VP_CORE_EQVALUE_ST_MASK                                       (1 << 20)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_CORE_MAXVDD_EN_SHIFT                                       18
-#define OMAP54XX_VP_CORE_MAXVDD_EN_WIDTH                                       0x1
-#define OMAP54XX_VP_CORE_MAXVDD_EN_MASK                                                (1 << 18)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_CORE_MAXVDD_ST_SHIFT                                       18
-#define OMAP54XX_VP_CORE_MAXVDD_ST_WIDTH                                       0x1
-#define OMAP54XX_VP_CORE_MAXVDD_ST_MASK                                                (1 << 18)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_CORE_MINVDD_EN_SHIFT                                       17
-#define OMAP54XX_VP_CORE_MINVDD_EN_WIDTH                                       0x1
-#define OMAP54XX_VP_CORE_MINVDD_EN_MASK                                                (1 << 17)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_CORE_MINVDD_ST_SHIFT                                       17
-#define OMAP54XX_VP_CORE_MINVDD_ST_WIDTH                                       0x1
-#define OMAP54XX_VP_CORE_MINVDD_ST_MASK                                                (1 << 17)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_CORE_NOSMPSACK_EN_SHIFT                                    19
-#define OMAP54XX_VP_CORE_NOSMPSACK_EN_WIDTH                                    0x1
-#define OMAP54XX_VP_CORE_NOSMPSACK_EN_MASK                                     (1 << 19)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_CORE_NOSMPSACK_ST_SHIFT                                    19
-#define OMAP54XX_VP_CORE_NOSMPSACK_ST_WIDTH                                    0x1
-#define OMAP54XX_VP_CORE_NOSMPSACK_ST_MASK                                     (1 << 19)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_CORE_OPPCHANGEDONE_EN_SHIFT                                        16
-#define OMAP54XX_VP_CORE_OPPCHANGEDONE_EN_WIDTH                                        0x1
-#define OMAP54XX_VP_CORE_OPPCHANGEDONE_EN_MASK                                 (1 << 16)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_CORE_OPPCHANGEDONE_ST_SHIFT                                        16
-#define OMAP54XX_VP_CORE_OPPCHANGEDONE_ST_WIDTH                                        0x1
-#define OMAP54XX_VP_CORE_OPPCHANGEDONE_ST_MASK                                 (1 << 16)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_CORE_TRANXDONE_EN_SHIFT                                    21
-#define OMAP54XX_VP_CORE_TRANXDONE_EN_WIDTH                                    0x1
-#define OMAP54XX_VP_CORE_TRANXDONE_EN_MASK                                     (1 << 21)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_CORE_TRANXDONE_ST_SHIFT                                    21
-#define OMAP54XX_VP_CORE_TRANXDONE_ST_WIDTH                                    0x1
-#define OMAP54XX_VP_CORE_TRANXDONE_ST_MASK                                     (1 << 21)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_MM_EQVALUE_EN_SHIFT                                                28
-#define OMAP54XX_VP_MM_EQVALUE_EN_WIDTH                                                0x1
-#define OMAP54XX_VP_MM_EQVALUE_EN_MASK                                         (1 << 28)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_MM_EQVALUE_ST_SHIFT                                                28
-#define OMAP54XX_VP_MM_EQVALUE_ST_WIDTH                                                0x1
-#define OMAP54XX_VP_MM_EQVALUE_ST_MASK                                         (1 << 28)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_MM_MAXVDD_EN_SHIFT                                         26
-#define OMAP54XX_VP_MM_MAXVDD_EN_WIDTH                                         0x1
-#define OMAP54XX_VP_MM_MAXVDD_EN_MASK                                          (1 << 26)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_MM_MAXVDD_ST_SHIFT                                         26
-#define OMAP54XX_VP_MM_MAXVDD_ST_WIDTH                                         0x1
-#define OMAP54XX_VP_MM_MAXVDD_ST_MASK                                          (1 << 26)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_MM_MINVDD_EN_SHIFT                                         25
-#define OMAP54XX_VP_MM_MINVDD_EN_WIDTH                                         0x1
-#define OMAP54XX_VP_MM_MINVDD_EN_MASK                                          (1 << 25)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_MM_MINVDD_ST_SHIFT                                         25
-#define OMAP54XX_VP_MM_MINVDD_ST_WIDTH                                         0x1
-#define OMAP54XX_VP_MM_MINVDD_ST_MASK                                          (1 << 25)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_MM_NOSMPSACK_EN_SHIFT                                      27
-#define OMAP54XX_VP_MM_NOSMPSACK_EN_WIDTH                                      0x1
-#define OMAP54XX_VP_MM_NOSMPSACK_EN_MASK                                       (1 << 27)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_MM_NOSMPSACK_ST_SHIFT                                      27
-#define OMAP54XX_VP_MM_NOSMPSACK_ST_WIDTH                                      0x1
-#define OMAP54XX_VP_MM_NOSMPSACK_ST_MASK                                       (1 << 27)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_MM_OPPCHANGEDONE_EN_SHIFT                                  24
-#define OMAP54XX_VP_MM_OPPCHANGEDONE_EN_WIDTH                                  0x1
-#define OMAP54XX_VP_MM_OPPCHANGEDONE_EN_MASK                                   (1 << 24)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_MM_OPPCHANGEDONE_ST_SHIFT                                  24
-#define OMAP54XX_VP_MM_OPPCHANGEDONE_ST_WIDTH                                  0x1
-#define OMAP54XX_VP_MM_OPPCHANGEDONE_ST_MASK                                   (1 << 24)
-
-/* Used by PRM_IRQENABLE_IPU, PRM_IRQENABLE_MPU */
-#define OMAP54XX_VP_MM_TRANXDONE_EN_SHIFT                                      29
-#define OMAP54XX_VP_MM_TRANXDONE_EN_WIDTH                                      0x1
-#define OMAP54XX_VP_MM_TRANXDONE_EN_MASK                                       (1 << 29)
-
-/* Used by PRM_IRQSTATUS_IPU, PRM_IRQSTATUS_MPU */
-#define OMAP54XX_VP_MM_TRANXDONE_ST_SHIFT                                      29
-#define OMAP54XX_VP_MM_TRANXDONE_ST_WIDTH                                      0x1
-#define OMAP54XX_VP_MM_TRANXDONE_ST_MASK                                       (1 << 29)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_VP_MPU_EQVALUE_EN_SHIFT                                       4
-#define OMAP54XX_VP_MPU_EQVALUE_EN_WIDTH                                       0x1
-#define OMAP54XX_VP_MPU_EQVALUE_EN_MASK                                                (1 << 4)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_VP_MPU_EQVALUE_ST_SHIFT                                       4
-#define OMAP54XX_VP_MPU_EQVALUE_ST_WIDTH                                       0x1
-#define OMAP54XX_VP_MPU_EQVALUE_ST_MASK                                                (1 << 4)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_VP_MPU_MAXVDD_EN_SHIFT                                                2
-#define OMAP54XX_VP_MPU_MAXVDD_EN_WIDTH                                                0x1
-#define OMAP54XX_VP_MPU_MAXVDD_EN_MASK                                         (1 << 2)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_VP_MPU_MAXVDD_ST_SHIFT                                                2
-#define OMAP54XX_VP_MPU_MAXVDD_ST_WIDTH                                                0x1
-#define OMAP54XX_VP_MPU_MAXVDD_ST_MASK                                         (1 << 2)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_VP_MPU_MINVDD_EN_SHIFT                                                1
-#define OMAP54XX_VP_MPU_MINVDD_EN_WIDTH                                                0x1
-#define OMAP54XX_VP_MPU_MINVDD_EN_MASK                                         (1 << 1)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_VP_MPU_MINVDD_ST_SHIFT                                                1
-#define OMAP54XX_VP_MPU_MINVDD_ST_WIDTH                                                0x1
-#define OMAP54XX_VP_MPU_MINVDD_ST_MASK                                         (1 << 1)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_VP_MPU_NOSMPSACK_EN_SHIFT                                     3
-#define OMAP54XX_VP_MPU_NOSMPSACK_EN_WIDTH                                     0x1
-#define OMAP54XX_VP_MPU_NOSMPSACK_EN_MASK                                      (1 << 3)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_VP_MPU_NOSMPSACK_ST_SHIFT                                     3
-#define OMAP54XX_VP_MPU_NOSMPSACK_ST_WIDTH                                     0x1
-#define OMAP54XX_VP_MPU_NOSMPSACK_ST_MASK                                      (1 << 3)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_VP_MPU_OPPCHANGEDONE_EN_SHIFT                                 0
-#define OMAP54XX_VP_MPU_OPPCHANGEDONE_EN_WIDTH                                 0x1
-#define OMAP54XX_VP_MPU_OPPCHANGEDONE_EN_MASK                                  (1 << 0)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_VP_MPU_OPPCHANGEDONE_ST_SHIFT                                 0
-#define OMAP54XX_VP_MPU_OPPCHANGEDONE_ST_WIDTH                                 0x1
-#define OMAP54XX_VP_MPU_OPPCHANGEDONE_ST_MASK                                  (1 << 0)
-
-/* Used by PRM_IRQENABLE_MPU_2 */
-#define OMAP54XX_VP_MPU_TRANXDONE_EN_SHIFT                                     5
-#define OMAP54XX_VP_MPU_TRANXDONE_EN_WIDTH                                     0x1
-#define OMAP54XX_VP_MPU_TRANXDONE_EN_MASK                                      (1 << 5)
-
-/* Used by PRM_IRQSTATUS_MPU_2 */
-#define OMAP54XX_VP_MPU_TRANXDONE_ST_SHIFT                                     5
-#define OMAP54XX_VP_MPU_TRANXDONE_ST_WIDTH                                     0x1
-#define OMAP54XX_VP_MPU_TRANXDONE_ST_MASK                                      (1 << 5)
-
-/* Used by PRM_SRAM_COUNT */
-#define OMAP54XX_VSETUPCNT_VALUE_SHIFT                                         8
-#define OMAP54XX_VSETUPCNT_VALUE_WIDTH                                         0x8
-#define OMAP54XX_VSETUPCNT_VALUE_MASK                                          (0xff << 8)
-
-/* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_MM_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */
-#define OMAP54XX_VSTEPMAX_SHIFT                                                        0
-#define OMAP54XX_VSTEPMAX_WIDTH                                                        0x8
-#define OMAP54XX_VSTEPMAX_MASK                                                 (0xff << 0)
-
-/* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_MM_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */
-#define OMAP54XX_VSTEPMIN_SHIFT                                                        0
-#define OMAP54XX_VSTEPMIN_WIDTH                                                        0x8
-#define OMAP54XX_VSTEPMIN_MASK                                                 (0xff << 0)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DISPC_DSP_SHIFT                                       2
-#define OMAP54XX_WKUPDEP_DISPC_DSP_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_DISPC_DSP_MASK                                                (1 << 2)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DISPC_IPU_SHIFT                                       1
-#define OMAP54XX_WKUPDEP_DISPC_IPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_DISPC_IPU_MASK                                                (1 << 1)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DISPC_MPU_SHIFT                                       0
-#define OMAP54XX_WKUPDEP_DISPC_MPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_DISPC_MPU_MASK                                                (1 << 0)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DISPC_SDMA_SHIFT                                      3
-#define OMAP54XX_WKUPDEP_DISPC_SDMA_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DISPC_SDMA_MASK                                       (1 << 3)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP54XX_WKUPDEP_DMIC_DMA_DSP_SHIFT                                    6
-#define OMAP54XX_WKUPDEP_DMIC_DMA_DSP_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_DMIC_DMA_DSP_MASK                                     (1 << 6)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP54XX_WKUPDEP_DMIC_DMA_SDMA_SHIFT                                   7
-#define OMAP54XX_WKUPDEP_DMIC_DMA_SDMA_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_DMIC_DMA_SDMA_MASK                                    (1 << 7)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP54XX_WKUPDEP_DMIC_IRQ_DSP_SHIFT                                    2
-#define OMAP54XX_WKUPDEP_DMIC_IRQ_DSP_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_DMIC_IRQ_DSP_MASK                                     (1 << 2)
-
-/* Used by PM_ABE_DMIC_WKDEP */
-#define OMAP54XX_WKUPDEP_DMIC_IRQ_MPU_SHIFT                                    0
-#define OMAP54XX_WKUPDEP_DMIC_IRQ_MPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_DMIC_IRQ_MPU_MASK                                     (1 << 0)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_A_DSP_SHIFT                                      6
-#define OMAP54XX_WKUPDEP_DSI1_A_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_A_DSP_MASK                                       (1 << 6)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_A_IPU_SHIFT                                      5
-#define OMAP54XX_WKUPDEP_DSI1_A_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_A_IPU_MASK                                       (1 << 5)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_A_MPU_SHIFT                                      4
-#define OMAP54XX_WKUPDEP_DSI1_A_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_A_MPU_MASK                                       (1 << 4)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_A_SDMA_SHIFT                                     7
-#define OMAP54XX_WKUPDEP_DSI1_A_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_DSI1_A_SDMA_MASK                                      (1 << 7)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_B_DSP_SHIFT                                      10
-#define OMAP54XX_WKUPDEP_DSI1_B_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_B_DSP_MASK                                       (1 << 10)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_B_IPU_SHIFT                                      9
-#define OMAP54XX_WKUPDEP_DSI1_B_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_B_IPU_MASK                                       (1 << 9)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_B_MPU_SHIFT                                      8
-#define OMAP54XX_WKUPDEP_DSI1_B_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_B_MPU_MASK                                       (1 << 8)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_B_SDMA_SHIFT                                     11
-#define OMAP54XX_WKUPDEP_DSI1_B_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_DSI1_B_SDMA_MASK                                      (1 << 11)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_C_DSP_SHIFT                                      17
-#define OMAP54XX_WKUPDEP_DSI1_C_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_C_DSP_MASK                                       (1 << 17)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_C_IPU_SHIFT                                      16
-#define OMAP54XX_WKUPDEP_DSI1_C_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_C_IPU_MASK                                       (1 << 16)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_C_MPU_SHIFT                                      15
-#define OMAP54XX_WKUPDEP_DSI1_C_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_DSI1_C_MPU_MASK                                       (1 << 15)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_DSI1_C_SDMA_SHIFT                                     18
-#define OMAP54XX_WKUPDEP_DSI1_C_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_DSI1_C_SDMA_MASK                                      (1 << 18)
-
-/* Used by PM_WKUPAON_GPIO1_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ1_IPU_SHIFT                                  1
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ1_IPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ1_IPU_MASK                                   (1 << 1)
-
-/* Used by PM_WKUPAON_GPIO1_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_WKUPAON_GPIO1_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ2_DSP_SHIFT                                  6
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ2_DSP_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO1_IRQ2_DSP_MASK                                   (1 << 6)
-
-/* Used by PM_L4PER_GPIO2_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ1_IPU_SHIFT                                  1
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ1_IPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ1_IPU_MASK                                   (1 << 1)
-
-/* Used by PM_L4PER_GPIO2_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_L4PER_GPIO2_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ2_DSP_SHIFT                                  6
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ2_DSP_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO2_IRQ2_DSP_MASK                                   (1 << 6)
-
-/* Used by PM_L4PER_GPIO3_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO3_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO3_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO3_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_L4PER_GPIO3_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO3_IRQ2_DSP_SHIFT                                  6
-#define OMAP54XX_WKUPDEP_GPIO3_IRQ2_DSP_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO3_IRQ2_DSP_MASK                                   (1 << 6)
-
-/* Used by PM_L4PER_GPIO4_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO4_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO4_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO4_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_L4PER_GPIO4_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO4_IRQ2_DSP_SHIFT                                  6
-#define OMAP54XX_WKUPDEP_GPIO4_IRQ2_DSP_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO4_IRQ2_DSP_MASK                                   (1 << 6)
-
-/* Used by PM_L4PER_GPIO5_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO5_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO5_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO5_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_L4PER_GPIO5_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO5_IRQ2_DSP_SHIFT                                  6
-#define OMAP54XX_WKUPDEP_GPIO5_IRQ2_DSP_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO5_IRQ2_DSP_MASK                                   (1 << 6)
-
-/* Used by PM_L4PER_GPIO6_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO6_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO6_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO6_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_L4PER_GPIO6_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO6_IRQ2_DSP_SHIFT                                  6
-#define OMAP54XX_WKUPDEP_GPIO6_IRQ2_DSP_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO6_IRQ2_DSP_MASK                                   (1 << 6)
-
-/* Used by PM_L4PER_GPIO7_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO7_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO7_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO7_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_L4PER_GPIO8_WKDEP */
-#define OMAP54XX_WKUPDEP_GPIO8_IRQ1_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_GPIO8_IRQ1_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_GPIO8_IRQ1_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_HDMIDMA_SDMA_SHIFT                                    19
-#define OMAP54XX_WKUPDEP_HDMIDMA_SDMA_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_HDMIDMA_SDMA_MASK                                     (1 << 19)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_HDMIIRQ_DSP_SHIFT                                     14
-#define OMAP54XX_WKUPDEP_HDMIIRQ_DSP_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_HDMIIRQ_DSP_MASK                                      (1 << 14)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_HDMIIRQ_IPU_SHIFT                                     13
-#define OMAP54XX_WKUPDEP_HDMIIRQ_IPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_HDMIIRQ_IPU_MASK                                      (1 << 13)
-
-/* Used by PM_DSS_DSS_WKDEP */
-#define OMAP54XX_WKUPDEP_HDMIIRQ_MPU_SHIFT                                     12
-#define OMAP54XX_WKUPDEP_HDMIIRQ_MPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_HDMIIRQ_MPU_MASK                                      (1 << 12)
-
-/* Used by PM_L3INIT_HSI_WKDEP */
-#define OMAP54XX_WKUPDEP_HSI_DSP_DSP_SHIFT                                     6
-#define OMAP54XX_WKUPDEP_HSI_DSP_DSP_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_HSI_DSP_DSP_MASK                                      (1 << 6)
-
-/* Used by PM_L3INIT_HSI_WKDEP */
-#define OMAP54XX_WKUPDEP_HSI_MCU_IPU_SHIFT                                     1
-#define OMAP54XX_WKUPDEP_HSI_MCU_IPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_HSI_MCU_IPU_MASK                                      (1 << 1)
-
-/* Used by PM_L3INIT_HSI_WKDEP */
-#define OMAP54XX_WKUPDEP_HSI_MCU_MPU_SHIFT                                     0
-#define OMAP54XX_WKUPDEP_HSI_MCU_MPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_HSI_MCU_MPU_MASK                                      (1 << 0)
-
-/* Used by PM_L4PER_I2C1_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C1_DMA_SDMA_SHIFT                                   7
-#define OMAP54XX_WKUPDEP_I2C1_DMA_SDMA_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_I2C1_DMA_SDMA_MASK                                    (1 << 7)
-
-/* Used by PM_L4PER_I2C1_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C1_IRQ_IPU_SHIFT                                    1
-#define OMAP54XX_WKUPDEP_I2C1_IRQ_IPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C1_IRQ_IPU_MASK                                     (1 << 1)
-
-/* Used by PM_L4PER_I2C1_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C1_IRQ_MPU_SHIFT                                    0
-#define OMAP54XX_WKUPDEP_I2C1_IRQ_MPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C1_IRQ_MPU_MASK                                     (1 << 0)
-
-/* Used by PM_L4PER_I2C2_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C2_DMA_SDMA_SHIFT                                   7
-#define OMAP54XX_WKUPDEP_I2C2_DMA_SDMA_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_I2C2_DMA_SDMA_MASK                                    (1 << 7)
-
-/* Used by PM_L4PER_I2C2_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C2_IRQ_IPU_SHIFT                                    1
-#define OMAP54XX_WKUPDEP_I2C2_IRQ_IPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C2_IRQ_IPU_MASK                                     (1 << 1)
-
-/* Used by PM_L4PER_I2C2_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C2_IRQ_MPU_SHIFT                                    0
-#define OMAP54XX_WKUPDEP_I2C2_IRQ_MPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C2_IRQ_MPU_MASK                                     (1 << 0)
-
-/* Used by PM_L4PER_I2C3_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C3_DMA_SDMA_SHIFT                                   7
-#define OMAP54XX_WKUPDEP_I2C3_DMA_SDMA_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_I2C3_DMA_SDMA_MASK                                    (1 << 7)
-
-/* Used by PM_L4PER_I2C3_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C3_IRQ_IPU_SHIFT                                    1
-#define OMAP54XX_WKUPDEP_I2C3_IRQ_IPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C3_IRQ_IPU_MASK                                     (1 << 1)
-
-/* Used by PM_L4PER_I2C3_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C3_IRQ_MPU_SHIFT                                    0
-#define OMAP54XX_WKUPDEP_I2C3_IRQ_MPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C3_IRQ_MPU_MASK                                     (1 << 0)
-
-/* Used by PM_L4PER_I2C4_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C4_DMA_SDMA_SHIFT                                   7
-#define OMAP54XX_WKUPDEP_I2C4_DMA_SDMA_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_I2C4_DMA_SDMA_MASK                                    (1 << 7)
-
-/* Used by PM_L4PER_I2C4_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C4_IRQ_IPU_SHIFT                                    1
-#define OMAP54XX_WKUPDEP_I2C4_IRQ_IPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C4_IRQ_IPU_MASK                                     (1 << 1)
-
-/* Used by PM_L4PER_I2C4_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C4_IRQ_MPU_SHIFT                                    0
-#define OMAP54XX_WKUPDEP_I2C4_IRQ_MPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C4_IRQ_MPU_MASK                                     (1 << 0)
-
-/* Used by PM_L4PER_I2C5_WKDEP */
-#define OMAP54XX_WKUPDEP_I2C5_IRQ_MPU_SHIFT                                    0
-#define OMAP54XX_WKUPDEP_I2C5_IRQ_MPU_WIDTH                                    0x1
-#define OMAP54XX_WKUPDEP_I2C5_IRQ_MPU_MASK                                     (1 << 0)
-
-/* Used by PM_WKUPAON_KBD_WKDEP */
-#define OMAP54XX_WKUPDEP_KBD_MPU_SHIFT                                         0
-#define OMAP54XX_WKUPDEP_KBD_MPU_WIDTH                                         0x1
-#define OMAP54XX_WKUPDEP_KBD_MPU_MASK                                          (1 << 0)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP54XX_WKUPDEP_MCASP_DMA_DSP_SHIFT                                   6
-#define OMAP54XX_WKUPDEP_MCASP_DMA_DSP_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_MCASP_DMA_DSP_MASK                                    (1 << 6)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP54XX_WKUPDEP_MCASP_DMA_SDMA_SHIFT                                  7
-#define OMAP54XX_WKUPDEP_MCASP_DMA_SDMA_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_MCASP_DMA_SDMA_MASK                                   (1 << 7)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP54XX_WKUPDEP_MCASP_IRQ_DSP_SHIFT                                   2
-#define OMAP54XX_WKUPDEP_MCASP_IRQ_DSP_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_MCASP_IRQ_DSP_MASK                                    (1 << 2)
-
-/* Used by PM_ABE_MCASP_WKDEP */
-#define OMAP54XX_WKUPDEP_MCASP_IRQ_MPU_SHIFT                                   0
-#define OMAP54XX_WKUPDEP_MCASP_IRQ_MPU_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_MCASP_IRQ_MPU_MASK                                    (1 << 0)
-
-/* Used by PM_ABE_MCBSP1_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP1_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_MCBSP1_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCBSP1_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_ABE_MCBSP1_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP1_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_MCBSP1_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCBSP1_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_ABE_MCBSP1_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP1_SDMA_SHIFT                                     3
-#define OMAP54XX_WKUPDEP_MCBSP1_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_MCBSP1_SDMA_MASK                                      (1 << 3)
-
-/* Used by PM_ABE_MCBSP2_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP2_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_MCBSP2_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCBSP2_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_ABE_MCBSP2_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP2_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_MCBSP2_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCBSP2_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_ABE_MCBSP2_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP2_SDMA_SHIFT                                     3
-#define OMAP54XX_WKUPDEP_MCBSP2_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_MCBSP2_SDMA_MASK                                      (1 << 3)
-
-/* Used by PM_ABE_MCBSP3_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP3_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_MCBSP3_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCBSP3_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_ABE_MCBSP3_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP3_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_MCBSP3_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCBSP3_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_ABE_MCBSP3_WKDEP */
-#define OMAP54XX_WKUPDEP_MCBSP3_SDMA_SHIFT                                     3
-#define OMAP54XX_WKUPDEP_MCBSP3_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_MCBSP3_SDMA_MASK                                      (1 << 3)
-
-/* Used by PM_ABE_MCPDM_WKDEP */
-#define OMAP54XX_WKUPDEP_MCPDM_DMA_DSP_SHIFT                                   6
-#define OMAP54XX_WKUPDEP_MCPDM_DMA_DSP_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_MCPDM_DMA_DSP_MASK                                    (1 << 6)
-
-/* Used by PM_ABE_MCPDM_WKDEP */
-#define OMAP54XX_WKUPDEP_MCPDM_DMA_SDMA_SHIFT                                  7
-#define OMAP54XX_WKUPDEP_MCPDM_DMA_SDMA_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_MCPDM_DMA_SDMA_MASK                                   (1 << 7)
-
-/* Used by PM_ABE_MCPDM_WKDEP */
-#define OMAP54XX_WKUPDEP_MCPDM_IRQ_DSP_SHIFT                                   2
-#define OMAP54XX_WKUPDEP_MCPDM_IRQ_DSP_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_MCPDM_IRQ_DSP_MASK                                    (1 << 2)
-
-/* Used by PM_ABE_MCPDM_WKDEP */
-#define OMAP54XX_WKUPDEP_MCPDM_IRQ_MPU_SHIFT                                   0
-#define OMAP54XX_WKUPDEP_MCPDM_IRQ_MPU_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_MCPDM_IRQ_MPU_MASK                                    (1 << 0)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI1_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_MCSPI1_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCSPI1_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI1_IPU_SHIFT                                      1
-#define OMAP54XX_WKUPDEP_MCSPI1_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCSPI1_IPU_MASK                                       (1 << 1)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI1_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_MCSPI1_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCSPI1_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_MCSPI1_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI1_SDMA_SHIFT                                     3
-#define OMAP54XX_WKUPDEP_MCSPI1_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_MCSPI1_SDMA_MASK                                      (1 << 3)
-
-/* Used by PM_L4PER_MCSPI2_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI2_IPU_SHIFT                                      1
-#define OMAP54XX_WKUPDEP_MCSPI2_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCSPI2_IPU_MASK                                       (1 << 1)
-
-/* Used by PM_L4PER_MCSPI2_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI2_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_MCSPI2_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCSPI2_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_MCSPI2_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI2_SDMA_SHIFT                                     3
-#define OMAP54XX_WKUPDEP_MCSPI2_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_MCSPI2_SDMA_MASK                                      (1 << 3)
-
-/* Used by PM_L4PER_MCSPI3_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI3_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_MCSPI3_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCSPI3_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_MCSPI3_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI3_SDMA_SHIFT                                     3
-#define OMAP54XX_WKUPDEP_MCSPI3_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_MCSPI3_SDMA_MASK                                      (1 << 3)
-
-/* Used by PM_L4PER_MCSPI4_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI4_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_MCSPI4_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_MCSPI4_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_MCSPI4_WKDEP */
-#define OMAP54XX_WKUPDEP_MCSPI4_SDMA_SHIFT                                     3
-#define OMAP54XX_WKUPDEP_MCSPI4_SDMA_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_MCSPI4_SDMA_MASK                                      (1 << 3)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC1_DSP_SHIFT                                                2
-#define OMAP54XX_WKUPDEP_MMC1_DSP_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC1_DSP_MASK                                         (1 << 2)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC1_IPU_SHIFT                                                1
-#define OMAP54XX_WKUPDEP_MMC1_IPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC1_IPU_MASK                                         (1 << 1)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC1_MPU_SHIFT                                                0
-#define OMAP54XX_WKUPDEP_MMC1_MPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC1_MPU_MASK                                         (1 << 0)
-
-/* Used by PM_L3INIT_MMC1_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC1_SDMA_SHIFT                                       3
-#define OMAP54XX_WKUPDEP_MMC1_SDMA_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_MMC1_SDMA_MASK                                                (1 << 3)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC2_DSP_SHIFT                                                2
-#define OMAP54XX_WKUPDEP_MMC2_DSP_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC2_DSP_MASK                                         (1 << 2)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC2_IPU_SHIFT                                                1
-#define OMAP54XX_WKUPDEP_MMC2_IPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC2_IPU_MASK                                         (1 << 1)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC2_MPU_SHIFT                                                0
-#define OMAP54XX_WKUPDEP_MMC2_MPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC2_MPU_MASK                                         (1 << 0)
-
-/* Used by PM_L3INIT_MMC2_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC2_SDMA_SHIFT                                       3
-#define OMAP54XX_WKUPDEP_MMC2_SDMA_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_MMC2_SDMA_MASK                                                (1 << 3)
-
-/* Used by PM_L4PER_MMC3_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC3_IPU_SHIFT                                                1
-#define OMAP54XX_WKUPDEP_MMC3_IPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC3_IPU_MASK                                         (1 << 1)
-
-/* Used by PM_L4PER_MMC3_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC3_MPU_SHIFT                                                0
-#define OMAP54XX_WKUPDEP_MMC3_MPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC3_MPU_MASK                                         (1 << 0)
-
-/* Used by PM_L4PER_MMC3_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC3_SDMA_SHIFT                                       3
-#define OMAP54XX_WKUPDEP_MMC3_SDMA_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_MMC3_SDMA_MASK                                                (1 << 3)
-
-/* Used by PM_L4PER_MMC4_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC4_MPU_SHIFT                                                0
-#define OMAP54XX_WKUPDEP_MMC4_MPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC4_MPU_MASK                                         (1 << 0)
-
-/* Used by PM_L4PER_MMC4_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC4_SDMA_SHIFT                                       3
-#define OMAP54XX_WKUPDEP_MMC4_SDMA_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_MMC4_SDMA_MASK                                                (1 << 3)
-
-/* Used by PM_L4PER_MMC5_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC5_MPU_SHIFT                                                0
-#define OMAP54XX_WKUPDEP_MMC5_MPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_MMC5_MPU_MASK                                         (1 << 0)
-
-/* Used by PM_L4PER_MMC5_WKDEP */
-#define OMAP54XX_WKUPDEP_MMC5_SDMA_SHIFT                                       3
-#define OMAP54XX_WKUPDEP_MMC5_SDMA_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_MMC5_SDMA_MASK                                                (1 << 3)
-
-/* Used by PM_L3INIT_SATA_WKDEP */
-#define OMAP54XX_WKUPDEP_SATA_MPU_SHIFT                                                0
-#define OMAP54XX_WKUPDEP_SATA_MPU_WIDTH                                                0x1
-#define OMAP54XX_WKUPDEP_SATA_MPU_MASK                                         (1 << 0)
-
-/* Used by PM_ABE_SLIMBUS1_WKDEP */
-#define OMAP54XX_WKUPDEP_SLIMBUS1_DMA_DSP_SHIFT                                        6
-#define OMAP54XX_WKUPDEP_SLIMBUS1_DMA_DSP_WIDTH                                        0x1
-#define OMAP54XX_WKUPDEP_SLIMBUS1_DMA_DSP_MASK                                 (1 << 6)
-
-/* Used by PM_ABE_SLIMBUS1_WKDEP */
-#define OMAP54XX_WKUPDEP_SLIMBUS1_DMA_SDMA_SHIFT                               7
-#define OMAP54XX_WKUPDEP_SLIMBUS1_DMA_SDMA_WIDTH                               0x1
-#define OMAP54XX_WKUPDEP_SLIMBUS1_DMA_SDMA_MASK                                        (1 << 7)
-
-/* Used by PM_ABE_SLIMBUS1_WKDEP */
-#define OMAP54XX_WKUPDEP_SLIMBUS1_IRQ_DSP_SHIFT                                        2
-#define OMAP54XX_WKUPDEP_SLIMBUS1_IRQ_DSP_WIDTH                                        0x1
-#define OMAP54XX_WKUPDEP_SLIMBUS1_IRQ_DSP_MASK                                 (1 << 2)
-
-/* Used by PM_ABE_SLIMBUS1_WKDEP */
-#define OMAP54XX_WKUPDEP_SLIMBUS1_IRQ_MPU_SHIFT                                        0
-#define OMAP54XX_WKUPDEP_SLIMBUS1_IRQ_MPU_WIDTH                                        0x1
-#define OMAP54XX_WKUPDEP_SLIMBUS1_IRQ_MPU_MASK                                 (1 << 0)
-
-/* Used by PM_COREAON_SMARTREFLEX_CORE_WKDEP */
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_CORE_IPU_SHIFT                            1
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_CORE_IPU_WIDTH                            0x1
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_CORE_IPU_MASK                             (1 << 1)
-
-/* Used by PM_COREAON_SMARTREFLEX_CORE_WKDEP */
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_CORE_MPU_SHIFT                            0
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_CORE_MPU_WIDTH                            0x1
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_CORE_MPU_MASK                             (1 << 0)
-
-/* Used by PM_COREAON_SMARTREFLEX_MM_WKDEP */
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_MM_MPU_SHIFT                              0
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_MM_MPU_WIDTH                              0x1
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_MM_MPU_MASK                               (1 << 0)
-
-/* Used by PM_COREAON_SMARTREFLEX_MPU_WKDEP */
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_MPU_MPU_SHIFT                             0
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_MPU_MPU_WIDTH                             0x1
-#define OMAP54XX_WKUPDEP_SMARTREFLEX_MPU_MPU_MASK                              (1 << 0)
-
-/* Used by PM_L4PER_TIMER10_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER10_MPU_SHIFT                                     0
-#define OMAP54XX_WKUPDEP_TIMER10_MPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_TIMER10_MPU_MASK                                      (1 << 0)
-
-/* Used by PM_L4PER_TIMER11_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER11_IPU_SHIFT                                     1
-#define OMAP54XX_WKUPDEP_TIMER11_IPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_TIMER11_IPU_MASK                                      (1 << 1)
-
-/* Used by PM_L4PER_TIMER11_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER11_MPU_SHIFT                                     0
-#define OMAP54XX_WKUPDEP_TIMER11_MPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_TIMER11_MPU_MASK                                      (1 << 0)
-
-/* Used by PM_WKUPAON_TIMER12_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER12_MPU_SHIFT                                     0
-#define OMAP54XX_WKUPDEP_TIMER12_MPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_TIMER12_MPU_MASK                                      (1 << 0)
-
-/* Used by PM_WKUPAON_TIMER1_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER1_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER1_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER1_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_TIMER2_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER2_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER2_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER2_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_TIMER3_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER3_IPU_SHIFT                                      1
-#define OMAP54XX_WKUPDEP_TIMER3_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER3_IPU_MASK                                       (1 << 1)
-
-/* Used by PM_L4PER_TIMER3_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER3_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER3_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER3_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_TIMER4_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER4_IPU_SHIFT                                      1
-#define OMAP54XX_WKUPDEP_TIMER4_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER4_IPU_MASK                                       (1 << 1)
-
-/* Used by PM_L4PER_TIMER4_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER4_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER4_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER4_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_ABE_TIMER5_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER5_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_TIMER5_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER5_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_ABE_TIMER5_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER5_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER5_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER5_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_ABE_TIMER6_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER6_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_TIMER6_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER6_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_ABE_TIMER6_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER6_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER6_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER6_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_ABE_TIMER7_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER7_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_TIMER7_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER7_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_ABE_TIMER7_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER7_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER7_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER7_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_ABE_TIMER8_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER8_DSP_SHIFT                                      2
-#define OMAP54XX_WKUPDEP_TIMER8_DSP_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER8_DSP_MASK                                       (1 << 2)
-
-/* Used by PM_ABE_TIMER8_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER8_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER8_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER8_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_TIMER9_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER9_IPU_SHIFT                                      1
-#define OMAP54XX_WKUPDEP_TIMER9_IPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER9_IPU_MASK                                       (1 << 1)
-
-/* Used by PM_L4PER_TIMER9_WKDEP */
-#define OMAP54XX_WKUPDEP_TIMER9_MPU_SHIFT                                      0
-#define OMAP54XX_WKUPDEP_TIMER9_MPU_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_TIMER9_MPU_MASK                                       (1 << 0)
-
-/* Used by PM_L4PER_UART1_WKDEP */
-#define OMAP54XX_WKUPDEP_UART1_MPU_SHIFT                                       0
-#define OMAP54XX_WKUPDEP_UART1_MPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART1_MPU_MASK                                                (1 << 0)
-
-/* Used by PM_L4PER_UART1_WKDEP */
-#define OMAP54XX_WKUPDEP_UART1_SDMA_SHIFT                                      3
-#define OMAP54XX_WKUPDEP_UART1_SDMA_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_UART1_SDMA_MASK                                       (1 << 3)
-
-/* Used by PM_L4PER_UART2_WKDEP */
-#define OMAP54XX_WKUPDEP_UART2_MPU_SHIFT                                       0
-#define OMAP54XX_WKUPDEP_UART2_MPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART2_MPU_MASK                                                (1 << 0)
-
-/* Used by PM_L4PER_UART2_WKDEP */
-#define OMAP54XX_WKUPDEP_UART2_SDMA_SHIFT                                      3
-#define OMAP54XX_WKUPDEP_UART2_SDMA_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_UART2_SDMA_MASK                                       (1 << 3)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP54XX_WKUPDEP_UART3_DSP_SHIFT                                       2
-#define OMAP54XX_WKUPDEP_UART3_DSP_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART3_DSP_MASK                                                (1 << 2)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP54XX_WKUPDEP_UART3_IPU_SHIFT                                       1
-#define OMAP54XX_WKUPDEP_UART3_IPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART3_IPU_MASK                                                (1 << 1)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP54XX_WKUPDEP_UART3_MPU_SHIFT                                       0
-#define OMAP54XX_WKUPDEP_UART3_MPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART3_MPU_MASK                                                (1 << 0)
-
-/* Used by PM_L4PER_UART3_WKDEP */
-#define OMAP54XX_WKUPDEP_UART3_SDMA_SHIFT                                      3
-#define OMAP54XX_WKUPDEP_UART3_SDMA_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_UART3_SDMA_MASK                                       (1 << 3)
-
-/* Used by PM_L4PER_UART4_WKDEP */
-#define OMAP54XX_WKUPDEP_UART4_MPU_SHIFT                                       0
-#define OMAP54XX_WKUPDEP_UART4_MPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART4_MPU_MASK                                                (1 << 0)
-
-/* Used by PM_L4PER_UART4_WKDEP */
-#define OMAP54XX_WKUPDEP_UART4_SDMA_SHIFT                                      3
-#define OMAP54XX_WKUPDEP_UART4_SDMA_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_UART4_SDMA_MASK                                       (1 << 3)
-
-/* Used by PM_L4PER_UART5_WKDEP */
-#define OMAP54XX_WKUPDEP_UART5_MPU_SHIFT                                       0
-#define OMAP54XX_WKUPDEP_UART5_MPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART5_MPU_MASK                                                (1 << 0)
-
-/* Used by PM_L4PER_UART5_WKDEP */
-#define OMAP54XX_WKUPDEP_UART5_SDMA_SHIFT                                      3
-#define OMAP54XX_WKUPDEP_UART5_SDMA_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_UART5_SDMA_MASK                                       (1 << 3)
-
-/* Used by PM_L4PER_UART6_WKDEP */
-#define OMAP54XX_WKUPDEP_UART6_MPU_SHIFT                                       0
-#define OMAP54XX_WKUPDEP_UART6_MPU_WIDTH                                       0x1
-#define OMAP54XX_WKUPDEP_UART6_MPU_MASK                                                (1 << 0)
-
-/* Used by PM_L4PER_UART6_WKDEP */
-#define OMAP54XX_WKUPDEP_UART6_SDMA_SHIFT                                      3
-#define OMAP54XX_WKUPDEP_UART6_SDMA_WIDTH                                      0x1
-#define OMAP54XX_WKUPDEP_UART6_SDMA_MASK                                       (1 << 3)
-
-/* Used by PM_L3INIT_UNIPRO2_WKDEP */
-#define OMAP54XX_WKUPDEP_UNIPRO2_MPU_SHIFT                                     0
-#define OMAP54XX_WKUPDEP_UNIPRO2_MPU_WIDTH                                     0x1
-#define OMAP54XX_WKUPDEP_UNIPRO2_MPU_MASK                                      (1 << 0)
-
-/* Used by PM_L3INIT_USB_HOST_HS_WKDEP */
-#define OMAP54XX_WKUPDEP_USB_HOST_HS_IPU_SHIFT                                 1
-#define OMAP54XX_WKUPDEP_USB_HOST_HS_IPU_WIDTH                                 0x1
-#define OMAP54XX_WKUPDEP_USB_HOST_HS_IPU_MASK                                  (1 << 1)
-
-/* Used by PM_L3INIT_USB_HOST_HS_WKDEP */
-#define OMAP54XX_WKUPDEP_USB_HOST_HS_MPU_SHIFT                                 0
-#define OMAP54XX_WKUPDEP_USB_HOST_HS_MPU_WIDTH                                 0x1
-#define OMAP54XX_WKUPDEP_USB_HOST_HS_MPU_MASK                                  (1 << 0)
-
-/* Used by PM_L3INIT_USB_OTG_SS_WKDEP */
-#define OMAP54XX_WKUPDEP_USB_OTG_SS_IPU_SHIFT                                  1
-#define OMAP54XX_WKUPDEP_USB_OTG_SS_IPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_USB_OTG_SS_IPU_MASK                                   (1 << 1)
-
-/* Used by PM_L3INIT_USB_OTG_SS_WKDEP */
-#define OMAP54XX_WKUPDEP_USB_OTG_SS_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_USB_OTG_SS_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_USB_OTG_SS_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_L3INIT_USB_TLL_HS_WKDEP */
-#define OMAP54XX_WKUPDEP_USB_TLL_HS_IPU_SHIFT                                  1
-#define OMAP54XX_WKUPDEP_USB_TLL_HS_IPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_USB_TLL_HS_IPU_MASK                                   (1 << 1)
-
-/* Used by PM_L3INIT_USB_TLL_HS_WKDEP */
-#define OMAP54XX_WKUPDEP_USB_TLL_HS_MPU_SHIFT                                  0
-#define OMAP54XX_WKUPDEP_USB_TLL_HS_MPU_WIDTH                                  0x1
-#define OMAP54XX_WKUPDEP_USB_TLL_HS_MPU_MASK                                   (1 << 0)
-
-/* Used by PM_WKUPAON_WD_TIMER2_WKDEP */
-#define OMAP54XX_WKUPDEP_WD_TIMER2_MPU_SHIFT                                   0
-#define OMAP54XX_WKUPDEP_WD_TIMER2_MPU_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_WD_TIMER2_MPU_MASK                                    (1 << 0)
-
-/* Used by PM_ABE_WD_TIMER3_WKDEP */
-#define OMAP54XX_WKUPDEP_WD_TIMER3_MPU_SHIFT                                   0
-#define OMAP54XX_WKUPDEP_WD_TIMER3_MPU_WIDTH                                   0x1
-#define OMAP54XX_WKUPDEP_WD_TIMER3_MPU_MASK                                    (1 << 0)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP54XX_WUCLK_CTRL_SHIFT                                              8
-#define OMAP54XX_WUCLK_CTRL_WIDTH                                              0x1
-#define OMAP54XX_WUCLK_CTRL_MASK                                               (1 << 8)
-
-/* Used by PRM_IO_PMCTRL */
-#define OMAP54XX_WUCLK_STATUS_SHIFT                                            9
-#define OMAP54XX_WUCLK_STATUS_WIDTH                                            0x1
-#define OMAP54XX_WUCLK_STATUS_MASK                                             (1 << 9)
-
-/* Used by REVISION_PRM */
-#define OMAP54XX_X_MAJOR_SHIFT                                                 8
-#define OMAP54XX_X_MAJOR_WIDTH                                                 0x3
-#define OMAP54XX_X_MAJOR_MASK                                                  (0x7 << 8)
-
-/* Used by REVISION_PRM */
-#define OMAP54XX_Y_MINOR_SHIFT                                                 0
-#define OMAP54XX_Y_MINOR_WIDTH                                                 0x6
-#define OMAP54XX_Y_MINOR_MASK                                                  (0x3f << 0)
-#endif
index 8c616e4..4588df1 100644 (file)
@@ -8,6 +8,7 @@
  * Written by Tony Lindgren <tony.lindgren@nokia.com>
  *
  * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
+ * Added DRA7xxx specific defines - Sricharan R<r.sricharan@ti.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
@@ -35,6 +36,7 @@
 #ifndef __ASSEMBLY__
 
 #include <linux/bitops.h>
+#include <linux/of.h>
 
 /*
  * Test if multicore OMAP support is needed
 # endif
 #endif
 
+#ifdef CONFIG_SOC_DRA7XX
+# ifdef OMAP_NAME
+#  undef MULTI_OMAP2
+#  define MULTI_OMAP2
+# else
+#  define OMAP_NAME DRA7XX
+# endif
+#endif
+
 /*
  * Omap device type i.e. EMU/HS/TST/GP/BAD
  */
@@ -233,6 +244,7 @@ IS_AM_SUBCLASS(437x, 0x437)
 #define cpu_is_omap447x()              0
 #define soc_is_omap54xx()              0
 #define soc_is_omap543x()              0
+#define soc_is_dra7xx()                        0
 
 #if defined(MULTI_OMAP2)
 # if defined(CONFIG_ARCH_OMAP2)
@@ -379,6 +391,11 @@ IS_OMAP_TYPE(3430, 0x3430)
 # define soc_is_omap543x()             is_omap543x()
 #endif
 
+#if defined(CONFIG_SOC_DRA7XX)
+#undef soc_is_dra7xx
+#define soc_is_dra7xx()        (of_machine_is_compatible("ti,dra7"))
+#endif
+
 /* Various silicon revisions for omap2 */
 #define OMAP242X_CLASS         0x24200024
 #define OMAP2420_REV_ES1_0     OMAP242X_CLASS
index b37e1fc..fa74a06 100644 (file)
@@ -537,7 +537,7 @@ static void __init realtime_counter_init(void)
        reg |= num;
        __raw_writel(reg, base + INCREMENTER_NUMERATOR_OFFSET);
 
-       reg = __raw_readl(base + INCREMENTER_NUMERATOR_OFFSET) &
+       reg = __raw_readl(base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET) &
                        NUMERATOR_DENUMERATOR_MASK;
        reg |= den;
        __raw_writel(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
@@ -594,13 +594,14 @@ OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
                       1, "timer_sys_ck", "ti,timer-alwon");
 #endif
 
-#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
+       defined(CONFIG_SOC_DRA7XX)
 static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
                               2, "sys_clkin_ck", NULL);
 #endif
 
 #ifdef CONFIG_ARCH_OMAP4
-#ifdef CONFIG_LOCAL_TIMERS
+#ifdef CONFIG_HAVE_ARM_TWD
 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29);
 void __init omap4_local_timer_init(void)
 {
@@ -619,12 +620,12 @@ void __init omap4_local_timer_init(void)
                        pr_err("twd_local_timer_register failed %d\n", err);
        }
 }
-#else /* CONFIG_LOCAL_TIMERS */
+#else
 void __init omap4_local_timer_init(void)
 {
        omap4_sync32k_timer_init();
 }
-#endif /* CONFIG_LOCAL_TIMERS */
+#endif /* CONFIG_HAVE_ARM_TWD */
 #endif /* CONFIG_ARCH_OMAP4 */
 
 #ifdef CONFIG_SOC_OMAP5
index b41599f..91a5852 100644 (file)
@@ -174,8 +174,10 @@ void __init orion5x_xor_init(void)
  ****************************************************************************/
 static void __init orion5x_crypto_init(void)
 {
-       mvebu_mbus_add_window("sram", ORION5X_SRAM_PHYS_BASE,
-                             ORION5X_SRAM_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_SRAM_TARGET,
+                                   ORION_MBUS_SRAM_ATTR,
+                                   ORION5X_SRAM_PHYS_BASE,
+                                   ORION5X_SRAM_SIZE);
        orion_crypto_init(ORION5X_CRYPTO_PHYS_BASE, ORION5X_SRAM_PHYS_BASE,
                          SZ_8K, IRQ_ORION5X_CESA);
 }
@@ -222,22 +224,24 @@ void orion5x_setup_wins(void)
         * The PCIe windows will no longer be statically allocated
         * here once Orion5x is migrated to the pci-mvebu driver.
         */
-       mvebu_mbus_add_window_remap_flags("pcie0.0", ORION5X_PCIE_IO_PHYS_BASE,
+       mvebu_mbus_add_window_remap_by_id(ORION_MBUS_PCIE_IO_TARGET,
+                                         ORION_MBUS_PCIE_IO_ATTR,
+                                         ORION5X_PCIE_IO_PHYS_BASE,
                                          ORION5X_PCIE_IO_SIZE,
-                                         ORION5X_PCIE_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pcie0.0", ORION5X_PCIE_MEM_PHYS_BASE,
-                                         ORION5X_PCIE_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
-       mvebu_mbus_add_window_remap_flags("pci0.0", ORION5X_PCI_IO_PHYS_BASE,
+                                         ORION5X_PCIE_IO_BUS_BASE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_PCIE_MEM_TARGET,
+                                   ORION_MBUS_PCIE_MEM_ATTR,
+                                   ORION5X_PCIE_MEM_PHYS_BASE,
+                                   ORION5X_PCIE_MEM_SIZE);
+       mvebu_mbus_add_window_remap_by_id(ORION_MBUS_PCI_IO_TARGET,
+                                         ORION_MBUS_PCI_IO_ATTR,
+                                         ORION5X_PCI_IO_PHYS_BASE,
                                          ORION5X_PCI_IO_SIZE,
-                                         ORION5X_PCI_IO_BUS_BASE,
-                                         MVEBU_MBUS_PCI_IO);
-       mvebu_mbus_add_window_remap_flags("pci0.0", ORION5X_PCI_MEM_PHYS_BASE,
-                                         ORION5X_PCI_MEM_SIZE,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
+                                         ORION5X_PCI_IO_BUS_BASE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_PCI_MEM_TARGET,
+                                   ORION_MBUS_PCI_MEM_ATTR,
+                                   ORION5X_PCI_MEM_PHYS_BASE,
+                                   ORION5X_PCI_MEM_SIZE);
 }
 
 int orion5x_tclk;
index a909afb..f565f99 100644 (file)
@@ -7,6 +7,23 @@ struct dsa_platform_data;
 struct mv643xx_eth_platform_data;
 struct mv_sata_platform_data;
 
+#define ORION_MBUS_PCIE_MEM_TARGET    0x04
+#define ORION_MBUS_PCIE_MEM_ATTR      0x59
+#define ORION_MBUS_PCIE_IO_TARGET     0x04
+#define ORION_MBUS_PCIE_IO_ATTR       0x51
+#define ORION_MBUS_PCIE_WA_TARGET     0x04
+#define ORION_MBUS_PCIE_WA_ATTR       0x79
+#define ORION_MBUS_PCI_MEM_TARGET     0x03
+#define ORION_MBUS_PCI_MEM_ATTR       0x59
+#define ORION_MBUS_PCI_IO_TARGET      0x03
+#define ORION_MBUS_PCI_IO_ATTR        0x51
+#define ORION_MBUS_DEVBUS_BOOT_TARGET 0x01
+#define ORION_MBUS_DEVBUS_BOOT_ATTR   0x0f
+#define ORION_MBUS_DEVBUS_TARGET(cs)  0x01
+#define ORION_MBUS_DEVBUS_ATTR(cs)    (~(1 << cs))
+#define ORION_MBUS_SRAM_TARGET        0x00
+#define ORION_MBUS_SRAM_ATTR          0x00
+
 /*
  * Basic Orion init functions used early by machine-setup.
  */
index 16c88bb..8f68b74 100644 (file)
@@ -317,8 +317,10 @@ static void __init d2net_init(void)
        d2net_sata_power_init();
        orion5x_sata_init(&d2net_sata_data);
 
-       mvebu_mbus_add_window("devbus-boot", D2NET_NOR_BOOT_BASE,
-                             D2NET_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   D2NET_NOR_BOOT_BASE,
+                                   D2NET_NOR_BOOT_SIZE);
        platform_device_register(&d2net_nor_flash);
 
        platform_device_register(&d2net_gpio_buttons);
index 4e1263d..4b2aefd 100644 (file)
@@ -340,19 +340,27 @@ static void __init db88f5281_init(void)
        orion5x_uart0_init();
        orion5x_uart1_init();
 
-       mvebu_mbus_add_window("devbus-boot", DB88F5281_NOR_BOOT_BASE,
-                             DB88F5281_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   DB88F5281_NOR_BOOT_BASE,
+                                   DB88F5281_NOR_BOOT_SIZE);
        platform_device_register(&db88f5281_boot_flash);
 
-       mvebu_mbus_add_window("devbus-cs0", DB88F5281_7SEG_BASE,
-                             DB88F5281_7SEG_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(0),
+                                   ORION_MBUS_DEVBUS_ATTR(0),
+                                   DB88F5281_7SEG_BASE,
+                                   DB88F5281_7SEG_SIZE);
 
-       mvebu_mbus_add_window("devbus-cs1", DB88F5281_NOR_BASE,
-                             DB88F5281_NOR_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(1),
+                                   ORION_MBUS_DEVBUS_ATTR(1),
+                                   DB88F5281_NOR_BASE,
+                                   DB88F5281_NOR_SIZE);
        platform_device_register(&db88f5281_nor_flash);
 
-       mvebu_mbus_add_window("devbus-cs2", DB88F5281_NAND_BASE,
-                             DB88F5281_NAND_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(2),
+                                   ORION_MBUS_DEVBUS_ATTR(2),
+                                   DB88F5281_NAND_BASE,
+                                   DB88F5281_NAND_SIZE);
        platform_device_register(&db88f5281_nand_flash);
 
        i2c_register_board_info(0, &db88f5281_i2c_rtc, 1);
index 9e6baf5..7097473 100644 (file)
@@ -611,8 +611,10 @@ static void __init dns323_init(void)
        /* setup flash mapping
         * CS3 holds a 8 MB Spansion S29GL064M90TFIR4
         */
-       mvebu_mbus_add_window("devbus-boot", DNS323_NOR_BOOT_BASE,
-                             DNS323_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   DNS323_NOR_BOOT_BASE,
+                                   DNS323_NOR_BOOT_SIZE);
        platform_device_register(&dns323_nor_flash);
 
        /* Sort out LEDs, Buttons and i2c devices */
index 1476155..f66c1b2 100644 (file)
@@ -23,8 +23,8 @@
 #include <linux/platform_device.h>
 #include <linux/pci.h>
 #include <linux/irq.h>
+#include <linux/mbus.h>
 #include <linux/mtd/physmap.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/leds.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
@@ -96,14 +96,6 @@ static struct platform_device edmini_v2_nor_flash = {
 };
 
 /*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data edmini_v2_eth_data = {
-       .phy_addr       = 8,
-};
-
-/*****************************************************************************
  * RTC 5C372a on I2C bus
  ****************************************************************************/
 
@@ -152,10 +144,11 @@ void __init edmini_v2_init(void)
         * Configure peripherals.
         */
        orion5x_ehci0_init();
-       orion5x_eth_init(&edmini_v2_eth_data);
 
-       mvebu_mbus_add_window("devbus-boot", EDMINI_V2_NOR_BOOT_BASE,
-                             EDMINI_V2_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   EDMINI_V2_NOR_BOOT_BASE,
+                                   EDMINI_V2_NOR_BOOT_SIZE);
        platform_device_register(&edmini_v2_nor_flash);
 
        pr_notice("edmini_v2: USB device port, flash write and power-off "
index aae10e4..fe6a48a 100644 (file)
@@ -359,13 +359,17 @@ static void __init kurobox_pro_init(void)
        orion5x_uart1_init();
        orion5x_xor_init();
 
-       mvebu_mbus_add_window("devbus-boot", KUROBOX_PRO_NOR_BOOT_BASE,
-                             KUROBOX_PRO_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   KUROBOX_PRO_NOR_BOOT_BASE,
+                                   KUROBOX_PRO_NOR_BOOT_SIZE);
        platform_device_register(&kurobox_pro_nor_flash);
 
        if (machine_is_kurobox_pro()) {
-               mvebu_mbus_add_window("devbus-cs0", KUROBOX_PRO_NAND_BASE,
-                                     KUROBOX_PRO_NAND_SIZE);
+               mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(0),
+                                           ORION_MBUS_DEVBUS_ATTR(0),
+                                           KUROBOX_PRO_NAND_BASE,
+                                           KUROBOX_PRO_NAND_SIZE);
                platform_device_register(&kurobox_pro_nand_flash);
        }
 
index 6234977..028ea03 100644 (file)
@@ -294,8 +294,10 @@ static void __init lschl_init(void)
        orion5x_uart0_init();
        orion5x_xor_init();
 
-       mvebu_mbus_add_window("devbus-boot", LSCHL_NOR_BOOT_BASE,
-                             LSCHL_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   LSCHL_NOR_BOOT_BASE,
+                                   LSCHL_NOR_BOOT_SIZE);
        platform_device_register(&lschl_nor_flash);
 
        platform_device_register(&lschl_leds);
index fe04c4b..32b7129 100644 (file)
@@ -243,8 +243,10 @@ static void __init ls_hgl_init(void)
        orion5x_uart0_init();
        orion5x_xor_init();
 
-       mvebu_mbus_add_window("devbus-boot", LS_HGL_NOR_BOOT_BASE,
-                             LS_HGL_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   LS_HGL_NOR_BOOT_BASE,
+                                   LS_HGL_NOR_BOOT_SIZE);
        platform_device_register(&ls_hgl_nor_flash);
 
        platform_device_register(&ls_hgl_button_device);
index ca4dbe9..a6493e7 100644 (file)
@@ -244,8 +244,10 @@ static void __init lsmini_init(void)
        orion5x_uart0_init();
        orion5x_xor_init();
 
-       mvebu_mbus_add_window("devbus-boot", LSMINI_NOR_BOOT_BASE,
-                             LSMINI_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   LSMINI_NOR_BOOT_BASE,
+                                   LSMINI_NOR_BOOT_SIZE);
        platform_device_register(&lsmini_nor_flash);
 
        platform_device_register(&lsmini_button_device);
index 827acba..e105130 100644 (file)
@@ -241,8 +241,10 @@ static void __init mss2_init(void)
        orion5x_uart0_init();
        orion5x_xor_init();
 
-       mvebu_mbus_add_window("devbus-boot", MSS2_NOR_BOOT_BASE,
-                             MSS2_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   MSS2_NOR_BOOT_BASE,
+                                   MSS2_NOR_BOOT_SIZE);
        platform_device_register(&mss2_nor_flash);
 
        platform_device_register(&mss2_button_device);
index 92600ae..e032f01 100644 (file)
@@ -204,8 +204,10 @@ static void __init mv2120_init(void)
        orion5x_uart0_init();
        orion5x_xor_init();
 
-       mvebu_mbus_add_window("devbus-boot", MV2120_NOR_BOOT_BASE,
-                             MV2120_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   MV2120_NOR_BOOT_BASE,
+                                   MV2120_NOR_BOOT_SIZE);
        platform_device_register(&mv2120_nor_flash);
 
        platform_device_register(&mv2120_button_device);
index dd0641a..ba73dc7 100644 (file)
@@ -397,8 +397,10 @@ static void __init net2big_init(void)
        net2big_sata_power_init();
        orion5x_sata_init(&net2big_sata_data);
 
-       mvebu_mbus_add_window("devbus-boot", NET2BIG_NOR_BOOT_BASE,
-                             NET2BIG_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   NET2BIG_NOR_BOOT_BASE,
+                                   NET2BIG_NOR_BOOT_SIZE);
        platform_device_register(&net2big_nor_flash);
 
        platform_device_register(&net2big_gpio_buttons);
index 5033680..7fab670 100644 (file)
@@ -157,11 +157,10 @@ static int __init pcie_setup(struct pci_sys_data *sys)
        if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
                printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config "
                                   "read transaction workaround\n");
-               mvebu_mbus_add_window_remap_flags("pcie0.0",
-                                                 ORION5X_PCIE_WA_PHYS_BASE,
-                                                 ORION5X_PCIE_WA_SIZE,
-                                                 MVEBU_MBUS_NO_REMAP,
-                                                 MVEBU_MBUS_PCI_WA);
+               mvebu_mbus_add_window_by_id(ORION_MBUS_PCIE_WA_TARGET,
+                                           ORION_MBUS_PCIE_WA_ATTR,
+                                           ORION5X_PCIE_WA_PHYS_BASE,
+                                           ORION5X_PCIE_WA_SIZE);
                pcie_ops.read = pcie_rd_conf_wa;
        }
 
index 1c4498b..213b3e1 100644 (file)
@@ -123,8 +123,10 @@ static void __init rd88f5181l_fxo_init(void)
        orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
        orion5x_uart0_init();
 
-       mvebu_mbus_add_window("devbus-boot", RD88F5181L_FXO_NOR_BOOT_BASE,
-                             RD88F5181L_FXO_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   RD88F5181L_FXO_NOR_BOOT_BASE,
+                                   RD88F5181L_FXO_NOR_BOOT_SIZE);
        platform_device_register(&rd88f5181l_fxo_nor_boot_flash);
 }
 
index adabe34..594800e 100644 (file)
@@ -130,8 +130,10 @@ static void __init rd88f5181l_ge_init(void)
        orion5x_i2c_init();
        orion5x_uart0_init();
 
-       mvebu_mbus_add_window("devbus-boot", RD88F5181L_GE_NOR_BOOT_BASE,
-                             RD88F5181L_GE_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   RD88F5181L_GE_NOR_BOOT_BASE,
+                                   RD88F5181L_GE_NOR_BOOT_SIZE);
        platform_device_register(&rd88f5181l_ge_nor_boot_flash);
 
        i2c_register_board_info(0, &rd88f5181l_ge_i2c_rtc, 1);
index 66e77ec..b1cf684 100644 (file)
@@ -264,11 +264,14 @@ static void __init rd88f5182_init(void)
        orion5x_uart0_init();
        orion5x_xor_init();
 
-       mvebu_mbus_add_window("devbus-boot", RD88F5182_NOR_BOOT_BASE,
-                             RD88F5182_NOR_BOOT_SIZE);
-
-       mvebu_mbus_add_window("devbus-cs1", RD88F5182_NOR_BASE,
-                             RD88F5182_NOR_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   RD88F5182_NOR_BOOT_BASE,
+                                   RD88F5182_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(1),
+                                   ORION_MBUS_DEVBUS_ATTR(1),
+                                   RD88F5182_NOR_BASE,
+                                   RD88F5182_NOR_SIZE);
        platform_device_register(&rd88f5182_nor_flash);
        platform_device_register(&rd88f5182_gpio_leds);
 
index a0bfa53..7e90648 100644 (file)
@@ -329,8 +329,10 @@ static void __init tsp2_init(void)
        /*
         * Configure peripherals.
         */
-       mvebu_mbus_add_window("devbus-boot", TSP2_NOR_BOOT_BASE,
-                             TSP2_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   TSP2_NOR_BOOT_BASE,
+                                   TSP2_NOR_BOOT_SIZE);
        platform_device_register(&tsp2_nor_flash);
 
        orion5x_ehci0_init();
index 80174f0..e90c061 100644 (file)
@@ -286,8 +286,10 @@ static void __init qnap_ts209_init(void)
        /*
         * Configure peripherals.
         */
-       mvebu_mbus_add_window("devbus-boot", QNAP_TS209_NOR_BOOT_BASE,
-                             QNAP_TS209_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   QNAP_TS209_NOR_BOOT_BASE,
+                                   QNAP_TS209_NOR_BOOT_SIZE);
        platform_device_register(&qnap_ts209_nor_flash);
 
        orion5x_ehci0_init();
index 9259279..5c079d3 100644 (file)
@@ -277,8 +277,10 @@ static void __init qnap_ts409_init(void)
        /*
         * Configure peripherals.
         */
-       mvebu_mbus_add_window("devbus-boot", QNAP_TS409_NOR_BOOT_BASE,
-                             QNAP_TS409_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   QNAP_TS409_NOR_BOOT_BASE,
+                                   QNAP_TS409_NOR_BOOT_SIZE);
        platform_device_register(&qnap_ts409_nor_flash);
 
        orion5x_ehci0_init();
index 6b84863..80a56ee 100644 (file)
@@ -127,8 +127,10 @@ static void __init wnr854t_init(void)
        orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
        orion5x_uart0_init();
 
-       mvebu_mbus_add_window("devbus-boot", WNR854T_NOR_BOOT_BASE,
-                             WNR854T_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   WNR854T_NOR_BOOT_BASE,
+                                   WNR854T_NOR_BOOT_SIZE);
        platform_device_register(&wnr854t_nor_flash);
 }
 
index fae684b..670e30d 100644 (file)
@@ -213,8 +213,10 @@ static void __init wrt350n_v2_init(void)
        orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
        orion5x_uart0_init();
 
-       mvebu_mbus_add_window("devbus-boot", WRT350N_V2_NOR_BOOT_BASE,
-                             WRT350N_V2_NOR_BOOT_SIZE);
+       mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+                                   ORION_MBUS_DEVBUS_BOOT_ATTR,
+                                   WRT350N_V2_NOR_BOOT_BASE,
+                                   WRT350N_V2_NOR_BOOT_SIZE);
        platform_device_register(&wrt350n_v2_nor_flash);
        platform_device_register(&wrt350n_v2_leds);
        platform_device_register(&wrt350n_v2_button_device);
index 02cc343..c4525a8 100644 (file)
@@ -34,7 +34,10 @@ static void sirfsoc_set_wakeup_source(void)
        pwr_trigger_en_reg = sirfsoc_rtc_iobrg_readl(sirfsoc_pwrc_base +
                SIRFSOC_PWRC_TRIGGER_EN);
 #define X_ON_KEY_B (1 << 0)
-       sirfsoc_rtc_iobrg_writel(pwr_trigger_en_reg | X_ON_KEY_B,
+#define RTC_ALARM0_B (1 << 2)
+#define RTC_ALARM1_B (1 << 3)
+       sirfsoc_rtc_iobrg_writel(pwr_trigger_en_reg | X_ON_KEY_B |
+               RTC_ALARM0_B | RTC_ALARM1_B,
                sirfsoc_pwrc_base + SIRFSOC_PWRC_TRIGGER_EN);
 }
 
@@ -85,12 +88,6 @@ static const struct platform_suspend_ops sirfsoc_pm_ops = {
        .valid = suspend_valid_only_mem,
 };
 
-int __init sirfsoc_pm_init(void)
-{
-       suspend_set_ops(&sirfsoc_pm_ops);
-       return 0;
-}
-
 static const struct of_device_id pwrc_ids[] = {
        { .compatible = "sirf,prima2-pwrc" },
        {}
@@ -118,7 +115,6 @@ static int __init sirfsoc_of_pwrc_init(void)
 
        return 0;
 }
-postcore_initcall(sirfsoc_of_pwrc_init);
 
 static const struct of_device_id memc_ids[] = {
        { .compatible = "sirf,prima2-memc" },
@@ -149,4 +145,11 @@ static int __init sirfsoc_memc_init(void)
 {
        return platform_driver_register(&sirfsoc_memc_driver);
 }
-postcore_initcall(sirfsoc_memc_init);
+
+int __init sirfsoc_pm_init(void)
+{
+       sirfsoc_of_pwrc_init();
+       sirfsoc_memc_init();
+       suspend_set_ops(&sirfsoc_pm_ops);
+       return 0;
+}
index 8091aac..f942349 100644 (file)
@@ -29,7 +29,7 @@
 #include <linux/pwm_backlight.h>
 
 #include <linux/i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/i2c/pxa-i2c.h>
 
 #include <linux/mfd/da903x.h>
index 3a3362f..8eb4e23 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/power_supply.h>
 #include <linux/apm-emulation.h>
 #include <linux/i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/i2c/pxa-i2c.h>
 #include <linux/regulator/userspace-consumer.h>
 
index 13e5b00..3133ba8 100644 (file)
@@ -408,7 +408,7 @@ struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
        .mclk_10khz = 1000,
 };
 
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 
 static struct pca953x_platform_data pca9536_data = {
        .gpio_base      = PXA_NR_BUILTIN_GPIO,
index 3835979..f6a2c4b 100644 (file)
@@ -28,7 +28,7 @@ static const struct of_dev_auxdata pxa3xx_auxdata_lookup[] __initconst = {
        OF_DEV_AUXDATA("mrvl,pxa-uart",         0x40700000, "pxa2xx-uart.2", NULL),
        OF_DEV_AUXDATA("mrvl,pxa-uart",         0x41600000, "pxa2xx-uart.3", NULL),
        OF_DEV_AUXDATA("marvell,pxa-mmc",       0x41100000, "pxa2xx-mci.0", NULL),
-       OF_DEV_AUXDATA("mrvl,pxa-gpio",         0x40e00000, "pxa-gpio", NULL),
+       OF_DEV_AUXDATA("intel,pxa3xx-gpio",     0x40e00000, "pxa3xx-gpio", NULL),
        OF_DEV_AUXDATA("marvell,pxa-ohci",      0x4c000000, "pxa27x-ohci", NULL),
        OF_DEV_AUXDATA("mrvl,pxa-i2c",          0x40301680, "pxa2xx-i2c.0", NULL),
        OF_DEV_AUXDATA("mrvl,pwri2c",           0x40f500c0, "pxa3xx-i2c.1", NULL),
index 4c29173..0b11c1a 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/leds.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/spi/corgi_lcd.h>
index 04a0aea..b19d1c3 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/mtd/physmap.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/apm-emulation.h>
 #include <linux/can/platform/mcp251x.h>
 #include <linux/regulator/fixed.h>
index 86e59c0..869bce7 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/gpio.h>
 
 #include <mach/pxa300.h>
index d210c0f..9db2029 100644 (file)
@@ -13,7 +13,7 @@ config REALVIEW_EB_A9MP
        depends on MACH_REALVIEW_EB
        select CPU_V7
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
@@ -26,7 +26,7 @@ config REALVIEW_EB_ARM11MP
        select ARCH_HAS_BARRIERS if SMP
        select CPU_V6K
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
@@ -48,7 +48,7 @@ config MACH_REALVIEW_PB11MP
        select ARM_GIC
        select CPU_V6K
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_PATA_PLATFORM
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
@@ -92,7 +92,7 @@ config MACH_REALVIEW_PBX
        select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
        select ARM_GIC
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_PATA_PLATFORM
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
index 7791ac7..dba2173 100644 (file)
@@ -30,7 +30,6 @@ config CPU_S3C2410
        select S3C2410_CLOCK
        select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ
        select S3C2410_PM if PM
-       select SAMSUNG_HRT
        select SAMSUNG_WDT_RESET
        help
          Support for S3C2410 and S3C2410A family from the S3C24XX line
@@ -42,7 +41,6 @@ config CPU_S3C2412
        select CPU_LLSERIAL_S3C2440
        select S3C2412_DMA if S3C24XX_DMA
        select S3C2412_PM if PM
-       select SAMSUNG_HRT
        help
          Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
 
@@ -54,7 +52,6 @@ config CPU_S3C2416
        select S3C2443_COMMON
        select S3C2443_DMA if S3C24XX_DMA
        select SAMSUNG_CLKSRC
-       select SAMSUNG_HRT
        help
          Support for the S3C2416 SoC from the S3C24XX line
 
@@ -65,7 +62,6 @@ config CPU_S3C2440
        select S3C2410_CLOCK
        select S3C2410_PM if PM
        select S3C2440_DMA if S3C24XX_DMA
-       select SAMSUNG_HRT
        help
          Support for S3C2440 Samsung Mobile CPU based systems.
 
@@ -75,7 +71,6 @@ config CPU_S3C2442
        select CPU_LLSERIAL_S3C2440
        select S3C2410_CLOCK
        select S3C2410_PM if PM
-       select SAMSUNG_HRT
        help
          Support for S3C2442 Samsung Mobile CPU based systems.
 
@@ -91,7 +86,6 @@ config CPU_S3C2443
        select S3C2443_COMMON
        select S3C2443_DMA if S3C24XX_DMA
        select SAMSUNG_CLKSRC
-       select SAMSUNG_HRT
        help
          Support for the S3C2443 SoC from the S3C24XX line
 
index 5645536..d39d3c7 100644 (file)
@@ -281,6 +281,5 @@ int __init s3c2410_baseclk_add(void)
               (clkslow & S3C2410_CLKSLOW_MPLL_OFF) ? "off" : "on",
               (clkslow & S3C2410_CLKSLOW_UCLK_OFF) ? "off" : "on");
 
-       s3c_pwmclk_init();
        return 0;
 }
index 2cc017d..d8f253f 100644 (file)
@@ -757,6 +757,5 @@ int __init s3c2412_baseclk_add(void)
        }
 
        clkdev_add_table(s3c2412_clk_lookup, ARRAY_SIZE(s3c2412_clk_lookup));
-       s3c_pwmclk_init();
        return 0;
 }
index 036056c..d421a72 100644 (file)
@@ -168,6 +168,4 @@ void __init s3c2416_init_clocks(int xtal)
        s3c24xx_register_clock(&hsmmc0_clk);
        clkdev_add_table(s3c2416_clk_lookup, ARRAY_SIZE(s3c2416_clk_lookup));
 
-       s3c_pwmclk_init();
-
 }
index 0a53051..76cd31f 100644 (file)
@@ -209,6 +209,4 @@ void __init s3c2443_init_clocks(int xtal)
        s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
        clkdev_add_table(s3c2443_clk_lookup, ARRAY_SIZE(s3c2443_clk_lookup));
-
-       s3c_pwmclk_init();
 }
index c157103..457261c 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/serial_core.h>
+#include <clocksource/samsung_pwm.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/io.h>
@@ -49,6 +50,7 @@
 #include <plat/clock.h>
 #include <plat/cpu-freq.h>
 #include <plat/pll.h>
+#include <plat/pwm-core.h>
 
 #include "common.h"
 
@@ -216,6 +218,13 @@ static void s3c24xx_default_idle(void)
                     S3C2410_CLKCON);
 }
 
+static struct samsung_pwm_variant s3c24xx_pwm_variant = {
+       .bits           = 16,
+       .div_base       = 1,
+       .has_tint_cstat = false,
+       .tclk_mask      = (1 << 4),
+};
+
 void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
 {
        arm_pm_idle = s3c24xx_default_idle;
@@ -232,6 +241,24 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
        s3c24xx_init_cpu();
 
        s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
+
+       samsung_pwm_set_platdata(&s3c24xx_pwm_variant);
+}
+
+void __init samsung_set_timer_source(unsigned int event, unsigned int source)
+{
+       s3c24xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
+       s3c24xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
+}
+
+void __init samsung_timer_init(void)
+{
+       unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
+               IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, IRQ_TIMER3, IRQ_TIMER4,
+       };
+
+       samsung_pwm_clocksource_init(S3C_VA_TIMER,
+                                       timer_irqs, &s3c24xx_pwm_variant);
 }
 
 /* Serial port registrations */
index 8ba381f..444793f 100644 (file)
 #define S3C_PA_SPI0            S3C2443_PA_SPI0
 #define S3C_PA_SPI1            S3C2443_PA_SPI1
 
+#define SAMSUNG_PA_TIMER       S3C2410_PA_TIMER
+
 #endif /* __ASM_ARCH_MAP_H */
index af4334d..74dd479 100644 (file)
@@ -512,7 +512,7 @@ static struct platform_pwm_backlight_data backlight_data = {
 static struct platform_device h1940_backlight = {
        .name = "pwm-backlight",
        .dev  = {
-               .parent = &s3c_device_timer[0].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &backlight_data,
        },
        .id   = -1,
@@ -632,7 +632,7 @@ static struct platform_device *h1940_devices[] __initdata = {
        &h1940_device_bluetooth,
        &s3c_device_sdi,
        &s3c_device_rtc,
-       &s3c_device_timer[0],
+       &samsung_device_pwm,
        &h1940_backlight,
        &h1940_lcd_powerdev,
        &s3c_device_adc,
index 44ca018..206b1f7 100644 (file)
@@ -530,7 +530,7 @@ static struct platform_pwm_backlight_data rx1950_backlight_data = {
 static struct platform_device rx1950_backlight = {
        .name = "pwm-backlight",
        .dev = {
-               .parent = &s3c_device_timer[0].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &rx1950_backlight_data,
        },
 };
@@ -717,8 +717,7 @@ static struct platform_device *rx1950_devices[] __initdata = {
        &s3c_device_sdi,
        &s3c_device_adc,
        &s3c_device_ts,
-       &s3c_device_timer[0],
-       &s3c_device_timer[1],
+       &samsung_device_pwm,
        &rx1950_backlight,
        &rx1950_device_gpiokeys,
        &power_supply,
index 2057853..041da51 100644 (file)
@@ -17,13 +17,11 @@ config PLAT_S3C64XX
 # Configuration options for the S3C6410 CPU
 
 config CPU_S3C6400
-       select SAMSUNG_HRT
        bool
        help
          Enable S3C6400 CPU support
 
 config CPU_S3C6410
-       select SAMSUNG_HRT
        bool
        help
          Enable S3C6410 CPU support
index 8499415..c1bcc4a 100644 (file)
@@ -1004,6 +1004,4 @@ void __init s3c64xx_register_clocks(unsigned long xtal,
        for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++)
                s3c_register_clksrc(clksrc_cdev[cnt], 1);
        clkdev_add_table(s3c64xx_clk_lookup, ARRAY_SIZE(s3c64xx_clk_lookup));
-
-       s3c_pwmclk_init();
 }
index 3f62e46..73d79cf 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/irq.h>
 #include <linux/gpio.h>
 #include <linux/irqchip/arm-vic.h>
+#include <clocksource/samsung_pwm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -42,7 +43,7 @@
 #include <plat/pm.h>
 #include <plat/gpio-cfg.h>
 #include <plat/irq-uart.h>
-#include <plat/irq-vic-timer.h>
+#include <plat/pwm-core.h>
 #include <plat/regs-irqtype.h>
 #include <plat/regs-serial.h>
 #include <plat/watchdog-reset.h>
@@ -149,6 +150,30 @@ static struct device s3c64xx_dev = {
        .bus    = &s3c64xx_subsys,
 };
 
+static struct samsung_pwm_variant s3c64xx_pwm_variant = {
+       .bits           = 32,
+       .div_base       = 0,
+       .has_tint_cstat = true,
+       .tclk_mask      = (1 << 7) | (1 << 6) | (1 << 5),
+};
+
+void __init samsung_set_timer_source(unsigned int event, unsigned int source)
+{
+       s3c64xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
+       s3c64xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
+}
+
+void __init samsung_timer_init(void)
+{
+       unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
+               IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
+               IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
+       };
+
+       samsung_pwm_clocksource_init(S3C_VA_TIMER,
+                                       timer_irqs, &s3c64xx_pwm_variant);
+}
+
 /* read cpu identification code */
 
 void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
@@ -161,6 +186,8 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
        s3c64xx_init_cpu();
 
        s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
+
+       samsung_pwm_set_platdata(&s3c64xx_pwm_variant);
 }
 
 static __init int s3c64xx_dev_init(void)
@@ -195,9 +222,6 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
        /* initialise the pair of VICs */
        vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
        vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
-
-       /* add the timer sub-irqs */
-       s3c_init_vic_timer_irq(5, IRQ_TIMER0);
 }
 
 #define eint_offset(irq)       ((irq) - IRQ_EINT(0))
index 96d60e0..67bbd1d 100644 (file)
 #define IRQ_TC                 IRQ_PENDN
 #define IRQ_ADC                        S3C64XX_IRQ_VIC1(31)
 
-#define S3C64XX_TIMER_IRQ(x)   S3C_IRQ(64 + (x))
-
-#define IRQ_TIMER0             S3C64XX_TIMER_IRQ(0)
-#define IRQ_TIMER1             S3C64XX_TIMER_IRQ(1)
-#define IRQ_TIMER2             S3C64XX_TIMER_IRQ(2)
-#define IRQ_TIMER3             S3C64XX_TIMER_IRQ(3)
-#define IRQ_TIMER4             S3C64XX_TIMER_IRQ(4)
-
 /* compatibility for device defines */
 
 #define IRQ_IIC1               IRQ_S3C6410_IIC1
index 8e2097b..f55ccb1 100644 (file)
 #define SAMSUNG_PA_ADC         S3C64XX_PA_ADC
 #define SAMSUNG_PA_CFCON       S3C64XX_PA_CFCON
 #define SAMSUNG_PA_KEYPAD      S3C64XX_PA_KEYPAD
+#define SAMSUNG_PA_TIMER       S3C64XX_PA_TIMER
 
 #endif /* __ASM_ARCH_6400_MAP_H */
index 0c7e1d9..c3da1b6 100644 (file)
@@ -22,7 +22,6 @@
 #include <mach/map.h>
 
 #include <plat/regs-serial.h>
-#include <plat/regs-timer.h>
 #include <mach/regs-gpio.h>
 #include <plat/cpu.h>
 #include <plat/pm.h>
@@ -43,7 +42,6 @@ static struct sleep_save irq_save[] = {
        SAVE_ITEM(S3C64XX_EINT0FLTCON2),
        SAVE_ITEM(S3C64XX_EINT0FLTCON3),
        SAVE_ITEM(S3C64XX_EINT0MASK),
-       SAVE_ITEM(S3C64XX_TINT_CSTAT),
 };
 
 static struct irq_grp_save {
index 8ad88ac..eb8e5a1 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/basic_mmio_gpio.h>
 #include <linux/spi/spi.h>
 
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/platform_data/s3c-hsotg.h>
 
 #include <video/platform_lcd.h>
@@ -120,7 +120,7 @@ static struct platform_device crag6410_backlight_device = {
        .name           = "pwm-backlight",
        .id             = -1,
        .dev            = {
-               .parent = &s3c_device_timer[0].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &crag6410_backlight_data,
        },
 };
@@ -375,7 +375,7 @@ static struct platform_device *crag6410_devices[] __initdata = {
        &s3c_device_fb,
        &s3c_device_ohci,
        &s3c_device_usb_hsotg,
-       &s3c_device_timer[0],
+       &samsung_device_pwm,
        &s3c64xx_device_iis0,
        &s3c64xx_device_iis1,
        &samsung_device_keypad,
index 5b7f357..f39569e 100644 (file)
@@ -123,7 +123,7 @@ static struct platform_pwm_backlight_data hmt_backlight_data = {
 static struct platform_device hmt_backlight_device = {
        .name           = "pwm-backlight",
        .dev            = {
-               .parent = &s3c_device_timer[1].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &hmt_backlight_data,
        },
 };
@@ -239,7 +239,7 @@ static struct platform_device *hmt_devices[] __initdata = {
        &s3c_device_nand,
        &s3c_device_fb,
        &s3c_device_ohci,
-       &s3c_device_timer[1],
+       &samsung_device_pwm,
        &hmt_backlight_device,
        &hmt_leds_device,
 };
index 58ac990..86d980b 100644 (file)
@@ -157,7 +157,7 @@ static struct platform_pwm_backlight_data smartq_backlight_data = {
 static struct platform_device smartq_backlight_device = {
        .name           = "pwm-backlight",
        .dev            = {
-               .parent = &s3c_device_timer[1].dev,
+               .parent = &samsung_device_pwm.dev,
                .platform_data = &smartq_backlight_data,
        },
 };
@@ -246,7 +246,7 @@ static struct platform_device *smartq_devices[] __initdata = {
        &s3c_device_i2c0,
        &s3c_device_ohci,
        &s3c_device_rtc,
-       &s3c_device_timer[1],
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_usb_hsotg,
        &s3c64xx_device_iis0,
index bd3295a..d90b450 100644 (file)
@@ -274,6 +274,7 @@ static struct platform_device *smdk6410_devices[] __initdata = {
        &s3c_device_i2c1,
        &s3c_device_fb,
        &s3c_device_ohci,
+       &samsung_device_pwm,
        &s3c_device_usb_hsotg,
        &s3c64xx_device_iisv4,
        &samsung_device_keypad,
@@ -691,9 +692,9 @@ static void __init smdk6410_machine_init(void)
 
        s3c_ide_set_platdata(&smdk6410_ide_pdata);
 
-       samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
-
        platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
+
+       samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
 }
 
 MACHINE_START(SMDK6410, "SMDK6410")
index 5a707bd..bb2111b 100644 (file)
@@ -11,14 +11,12 @@ config CPU_S5P6440
        bool
        select S5P_SLEEP if PM
        select SAMSUNG_DMADEV
-       select SAMSUNG_HRT
        select SAMSUNG_WAKEMASK if PM
        help
          Enable S5P6440 CPU support
 
 config CPU_S5P6450
        bool
-       select SAMSUNG_HRT
        select S5P_SLEEP if PM
        select SAMSUNG_DMADEV
        select SAMSUNG_WAKEMASK if PM
index 3537815..ae34a1d 100644 (file)
@@ -629,6 +629,4 @@ void __init s5p6440_register_clocks(void)
        clkdev_add_table(s5p6440_clk_lookup, ARRAY_SIZE(s5p6440_clk_lookup));
 
        s3c24xx_register_clock(&dummy_apb_pclk);
-
-       s3c_pwmclk_init();
 }
index af384dd..0b3ca2e 100644 (file)
@@ -698,6 +698,4 @@ void __init s5p6450_register_clocks(void)
        clkdev_add_table(s5p6450_clk_lookup, ARRAY_SIZE(s5p6450_clk_lookup));
 
        s3c24xx_register_clock(&dummy_apb_pclk);
-
-       s3c_pwmclk_init();
 }
index dfdfdc3..42e14f2 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/io.h>
 #include <linux/device.h>
 #include <linux/serial_core.h>
+#include <clocksource/samsung_pwm.h>
 #include <linux/platform_device.h>
 #include <linux/sched.h>
 #include <linux/dma-mapping.h>
@@ -47,6 +48,7 @@
 #include <plat/fb-core.h>
 #include <plat/spi-core.h>
 #include <plat/gpio-cfg.h>
+#include <plat/pwm-core.h>
 #include <plat/regs-irqtype.h>
 #include <plat/regs-serial.h>
 #include <plat/watchdog-reset.h>
@@ -157,6 +159,30 @@ static void s5p64x0_idle(void)
        cpu_do_idle();
 }
 
+static struct samsung_pwm_variant s5p64x0_pwm_variant = {
+       .bits           = 32,
+       .div_base       = 0,
+       .has_tint_cstat = true,
+       .tclk_mask      = 0,
+};
+
+void __init samsung_set_timer_source(unsigned int event, unsigned int source)
+{
+       s5p64x0_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
+       s5p64x0_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
+}
+
+void __init samsung_timer_init(void)
+{
+       unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
+               IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
+               IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
+       };
+
+       samsung_pwm_clocksource_init(S3C_VA_TIMER,
+                                       timer_irqs, &s5p64x0_pwm_variant);
+}
+
 /*
  * s5p64x0_map_io
  *
@@ -176,6 +202,7 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size)
        s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
        samsung_wdt_reset_init(S3C_VA_WATCHDOG);
 
+       samsung_pwm_set_platdata(&s5p64x0_pwm_variant);
 }
 
 void __init s5p6440_map_io(void)
index 5b845e8..53982db 100644 (file)
 
 #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x))
 
-#define IRQ_TIMER_BASE         (11)
-
 /* Set the default NR_IRQS */
 
 #define NR_IRQS                        (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1)
index 0c0175d..50a6e96 100644 (file)
@@ -76,6 +76,7 @@
 #define S5P_PA_TIMER           S5P64X0_PA_TIMER
 
 #define SAMSUNG_PA_ADC         S5P64X0_PA_ADC
+#define SAMSUNG_PA_TIMER       S5P64X0_PA_TIMER
 
 /* UART */
 
index 73f71a6..0b00304 100644 (file)
@@ -162,6 +162,7 @@ static struct platform_device *smdk6440_devices[] __initdata = {
        &s3c_device_rtc,
        &s3c_device_i2c0,
        &s3c_device_i2c1,
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_wdt,
        &s5p6440_device_iis,
@@ -254,8 +255,6 @@ static void __init smdk6440_machine_init(void)
        i2c_register_board_info(1, smdk6440_i2c_devs1,
                        ARRAY_SIZE(smdk6440_i2c_devs1));
 
-       samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
-
        s5p6440_set_lcd_interface();
        s3c_fb_set_platdata(&smdk6440_lcd_pdata);
 
@@ -264,6 +263,8 @@ static void __init smdk6440_machine_init(void)
        s3c_sdhci2_set_platdata(&smdk6440_hsmmc2_pdata);
 
        platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
+
+       samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
 }
 
 MACHINE_START(SMDK6440, "SMDK6440")
index 18303e1..5949296 100644 (file)
@@ -180,6 +180,7 @@ static struct platform_device *smdk6450_devices[] __initdata = {
        &s3c_device_rtc,
        &s3c_device_i2c0,
        &s3c_device_i2c1,
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_wdt,
        &s5p6450_device_iis0,
@@ -273,8 +274,6 @@ static void __init smdk6450_machine_init(void)
        i2c_register_board_info(1, smdk6450_i2c_devs1,
                        ARRAY_SIZE(smdk6450_i2c_devs1));
 
-       samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
-
        s5p6450_set_lcd_interface();
        s3c_fb_set_platdata(&smdk6450_lcd_pdata);
 
@@ -283,6 +282,8 @@ static void __init smdk6450_machine_init(void)
        s3c_sdhci2_set_platdata(&smdk6450_hsmmc2_pdata);
 
        platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
+
+       samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
 }
 
 MACHINE_START(SMDK6450, "SMDK6450")
index 97c2a08..861e15c 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <plat/cpu.h>
 #include <plat/pm.h>
-#include <plat/regs-timer.h>
 #include <plat/wakeup-mask.h>
 
 #include <mach/regs-clock.h>
@@ -48,8 +47,6 @@ static struct sleep_save s5p64x0_misc_save[] = {
        SAVE_ITEM(S5P64X0_MEM0CONSLP1),
        SAVE_ITEM(S5P64X0_MEM0DRVCON),
        SAVE_ITEM(S5P64X0_MEM1DRVCON),
-
-       SAVE_ITEM(S3C64XX_TINT_CSTAT),
 };
 
 /* DPLL is present only in S5P6450 */
index 2f456a4..15170be 100644 (file)
@@ -11,7 +11,6 @@ config CPU_S5PC100
        bool
        select S5P_EXT_INT
        select SAMSUNG_DMADEV
-       select SAMSUNG_HRT
        help
          Enable S5PC100 CPU support
 
index a206dc3..d0dc10e 100644 (file)
@@ -1358,6 +1358,4 @@ void __init s5pc100_register_clocks(void)
                s3c_disable_clocks(clk_cdev[ptr], 1);
 
        s3c24xx_register_clock(&dummy_apb_pclk);
-
-       s3c_pwmclk_init();
 }
index 4bdfecf..c5a8eea 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/io.h>
 #include <linux/device.h>
 #include <linux/serial_core.h>
+#include <clocksource/samsung_pwm.h>
 #include <linux/platform_device.h>
 #include <linux/sched.h>
 #include <linux/reboot.h>
@@ -46,6 +47,7 @@
 #include <plat/fb-core.h>
 #include <plat/iic-core.h>
 #include <plat/onenand-core.h>
+#include <plat/pwm-core.h>
 #include <plat/spi-core.h>
 #include <plat/regs-serial.h>
 #include <plat/watchdog-reset.h>
@@ -132,6 +134,30 @@ static struct map_desc s5pc100_iodesc[] __initdata = {
        }
 };
 
+static struct samsung_pwm_variant s5pc100_pwm_variant = {
+       .bits           = 32,
+       .div_base       = 0,
+       .has_tint_cstat = true,
+       .tclk_mask      = (1 << 5),
+};
+
+void __init samsung_set_timer_source(unsigned int event, unsigned int source)
+{
+       s5pc100_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
+       s5pc100_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
+}
+
+void __init samsung_timer_init(void)
+{
+       unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
+               IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
+               IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
+       };
+
+       samsung_pwm_clocksource_init(S3C_VA_TIMER,
+                                       timer_irqs, &s5pc100_pwm_variant);
+}
+
 /*
  * s5pc100_map_io
  *
@@ -149,6 +175,8 @@ void __init s5pc100_init_io(struct map_desc *mach_desc, int size)
        s5p_init_cpu(S5P_VA_CHIPID);
 
        s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
+
+       samsung_pwm_set_platdata(&s5pc100_pwm_variant);
 }
 
 void __init s5pc100_map_io(void)
index 2870f12..d2eb475 100644 (file)
@@ -97,8 +97,6 @@
 #define IRQ_SDMFIQ             S5P_IRQ_VIC2(31)
 #define IRQ_VIC_END            S5P_IRQ_VIC2(31)
 
-#define IRQ_TIMER_BASE         (11)
-
 #define S5P_EINT_BASE1         (S5P_IRQ_VIC0(0))
 #define S5P_EINT_BASE2         (IRQ_VIC_END + 1)
 
index 54bc4f8..2550b61 100644 (file)
 #define SAMSUNG_PA_ADC                 S5PC100_PA_TSADC
 #define SAMSUNG_PA_CFCON               S5PC100_PA_CFCON
 #define SAMSUNG_PA_KEYPAD              S5PC100_PA_KEYPAD
+#define SAMSUNG_PA_TIMER               S5PC100_PA_TIMER
 
 #define S5PC100_VA_OTHERS              (S3C_VA_SYS + 0x10000)
 
index 8c880f7..7c57a22 100644 (file)
@@ -194,6 +194,7 @@ static struct platform_device *smdkc100_devices[] __initdata = {
        &s3c_device_hsmmc0,
        &s3c_device_hsmmc1,
        &s3c_device_hsmmc2,
+       &samsung_device_pwm,
        &s3c_device_ts,
        &s3c_device_wdt,
        &smdkc100_lcd_powerdev,
@@ -246,9 +247,9 @@ static void __init smdkc100_machine_init(void)
        gpio_request(S5PC100_GPH0(6), "GPH0");
        smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
 
-       samsung_bl_set(&smdkc100_bl_gpio_info, &smdkc100_bl_data);
-
        platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
+
+       samsung_bl_set(&smdkc100_bl_gpio_info, &smdkc100_bl_data);
 }
 
 MACHINE_START(SMDKC100, "SMDKC100")
index 0963283..caaedaf 100644 (file)
@@ -15,7 +15,6 @@ config CPU_S5PV210
        select S5P_PM if PM
        select S5P_SLEEP if PM
        select SAMSUNG_DMADEV
-       select SAMSUNG_HRT
        help
          Enable S5PV210 CPU support
 
index f051f53..ca46372 100644 (file)
@@ -1362,5 +1362,4 @@ void __init s5pv210_register_clocks(void)
        for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++)
                s3c_disable_clocks(clk_cdev[ptr], 1);
 
-       s3c_pwmclk_init();
 }
index 023f1a7..26027a2 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/device.h>
+#include <clocksource/samsung_pwm.h>
 #include <linux/platform_device.h>
 #include <linux/sched.h>
 #include <linux/dma-mapping.h>
@@ -42,6 +43,7 @@
 #include <plat/fimc-core.h>
 #include <plat/iic-core.h>
 #include <plat/keypad-core.h>
+#include <plat/pwm-core.h>
 #include <plat/tv-core.h>
 #include <plat/spi-core.h>
 #include <plat/regs-serial.h>
@@ -148,6 +150,30 @@ void s5pv210_restart(enum reboot_mode mode, const char *cmd)
        __raw_writel(0x1, S5P_SWRESET);
 }
 
+static struct samsung_pwm_variant s5pv210_pwm_variant = {
+       .bits           = 32,
+       .div_base       = 0,
+       .has_tint_cstat = true,
+       .tclk_mask      = (1 << 5),
+};
+
+void __init samsung_set_timer_source(unsigned int event, unsigned int source)
+{
+       s5pv210_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1;
+       s5pv210_pwm_variant.output_mask &= ~(BIT(event) | BIT(source));
+}
+
+void __init samsung_timer_init(void)
+{
+       unsigned int timer_irqs[SAMSUNG_PWM_NUM] = {
+               IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
+               IRQ_TIMER3_VIC, IRQ_TIMER4_VIC,
+       };
+
+       samsung_pwm_clocksource_init(S3C_VA_TIMER,
+                                       timer_irqs, &s5pv210_pwm_variant);
+}
+
 /*
  * s5pv210_map_io
  *
@@ -165,6 +191,8 @@ void __init s5pv210_init_io(struct map_desc *mach_desc, int size)
        s5p_init_cpu(S5P_VA_CHIPID);
 
        s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
+
+       samsung_pwm_set_platdata(&s5pv210_pwm_variant);
 }
 
 void __init s5pv210_map_io(void)
index e777e01..5e0de3a 100644 (file)
 #define IRQ_MDNIE3             S5P_IRQ_VIC3(8)
 #define IRQ_VIC_END            S5P_IRQ_VIC3(31)
 
-#define IRQ_TIMER_BASE         (11)
-
 #define S5P_EINT_BASE1         (S5P_IRQ_VIC0(0))
 #define S5P_EINT_BASE2         (IRQ_VIC_END + 1)
 
index b7c8a19..763929a 100644 (file)
 #define SAMSUNG_PA_ADC                 S5PV210_PA_ADC
 #define SAMSUNG_PA_CFCON               S5PV210_PA_CFCON
 #define SAMSUNG_PA_KEYPAD              S5PV210_PA_KEYPAD
+#define SAMSUNG_PA_TIMER               S5PV210_PA_TIMER
 
 /* UART */
 
index d50b6f1..6d72bb9 100644 (file)
@@ -218,6 +218,7 @@ static struct platform_device *smdkv210_devices[] __initdata = {
        &s3c_device_i2c0,
        &s3c_device_i2c1,
        &s3c_device_i2c2,
+       &samsung_device_pwm,
        &s3c_device_rtc,
        &s3c_device_ts,
        &s3c_device_usb_hsotg,
@@ -316,11 +317,11 @@ static void __init smdkv210_machine_init(void)
 
        s3c_fb_set_platdata(&smdkv210_lcd0_pdata);
 
-       samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data);
-
        s3c_hsotg_set_platdata(&smdkv210_hsotg_pdata);
 
        platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
+
+       samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data);
 }
 
 MACHINE_START(SMDKV210, "SMDKV210")
index 2b68a67..3cf3f9c 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <plat/cpu.h>
 #include <plat/pm.h>
-#include <plat/regs-timer.h>
 
 #include <mach/regs-irq.h>
 #include <mach/regs-clock.h>
@@ -77,15 +76,6 @@ static struct sleep_save s5pv210_core_save[] = {
        /* Clock ETC */
        SAVE_ITEM(S5P_CLK_OUT),
        SAVE_ITEM(S5P_MDNIE_SEL),
-
-       /* PWM Register */
-       SAVE_ITEM(S3C2410_TCFG0),
-       SAVE_ITEM(S3C2410_TCFG1),
-       SAVE_ITEM(S3C64XX_TINT_CSTAT),
-       SAVE_ITEM(S3C2410_TCON),
-       SAVE_ITEM(S3C2410_TCNTB(0)),
-       SAVE_ITEM(S3C2410_TCMPB(0)),
-       SAVE_ITEM(S3C2410_TCNTO(0)),
 };
 
 static int s5pv210_cpu_suspend(unsigned long arg)
index 3912ce9..e817fde 100644 (file)
@@ -1,3 +1,41 @@
+config ARCH_SHMOBILE_MULTI
+       bool "SH-Mobile Series" if ARCH_MULTI_V7
+       depends on MMU
+       select CPU_V7
+       select GENERIC_CLOCKEVENTS
+       select HAVE_ARM_SCU if SMP
+       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_SMP
+       select ARM_GIC
+       select MIGHT_HAVE_CACHE_L2X0
+       select NO_IOPORT
+       select PINCTRL
+       select ARCH_REQUIRE_GPIOLIB
+       select CLKDEV_LOOKUP
+
+if ARCH_SHMOBILE_MULTI
+
+comment "SH-Mobile System Type"
+
+config ARCH_EMEV2
+       bool "Emma Mobile EV2"
+
+comment "SH-Mobile Board Type"
+
+config MACH_KZM9D_REFERENCE
+       bool "KZM9D board - Reference Device Tree Implementation"
+       depends on ARCH_EMEV2
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       ---help---
+          Use reference implementation of KZM9D board support
+          which makes a greater use of device tree at the expense
+          of not supporting a number of devices.
+
+          This is intended to aid developers
+
+comment "SH-Mobile System Configuration"
+endif
+
 if ARCH_SHMOBILE
 
 comment "SH-Mobile System Type"
@@ -23,9 +61,10 @@ config ARCH_R8A73A4
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_GIC
        select CPU_V7
-       select HAVE_ARM_ARCH_TIMER
        select SH_CLK_CPG
        select RENESAS_IRQC
+       select ARCH_HAS_CPUFREQ
+       select ARCH_HAS_OPP
 
 config ARCH_R8A7740
        bool "R-Mobile A1 (R8A77400)"
@@ -59,7 +98,6 @@ config ARCH_R8A7790
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_GIC
        select CPU_V7
-       select HAVE_ARM_ARCH_TIMER
        select SH_CLK_CPG
        select RENESAS_IRQC
 
@@ -124,6 +162,7 @@ config MACH_BOCKW
        depends on ARCH_R8A7778
        select ARCH_REQUIRE_GPIOLIB
        select RENESAS_INTC_IRQPIN
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select USE_OF
 
 config MACH_MARZEN
@@ -156,6 +195,18 @@ config MACH_KZM9D
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select USE_OF
 
+config MACH_KZM9D_REFERENCE
+       bool "KZM9D board - Reference Device Tree Implementation"
+       depends on ARCH_EMEV2
+       select REGULATOR_FIXED_VOLTAGE if REGULATOR
+       select USE_OF
+       ---help---
+          Use reference implementation of KZM9D board support
+          which makes a greater use of device tree at the expense
+          of not supporting a number of devices.
+
+          This is intended to aid developers
+
 config MACH_KZM9G
        bool "KZM-A9-GT board"
        depends on ARCH_SH73A0
@@ -186,6 +237,15 @@ config CPU_HAS_INTEVT
         bool
        default y
 
+config SH_CLK_CPG
+       bool
+
+source "drivers/sh/Kconfig"
+
+endif
+
+if ARCH_SHMOBILE || ARCH_SHMOBILE_MULTI
+
 menu "Timer and clock configuration"
 
 config SHMOBILE_TIMER_HZ
@@ -220,9 +280,4 @@ config EM_TIMER_STI
 
 endmenu
 
-config SH_CLK_CPG
-       bool
-
-source "drivers/sh/Kconfig"
-
 endif
index 6165a51..b150c45 100644 (file)
@@ -2,18 +2,33 @@
 # Makefile for the linux kernel.
 #
 
+ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/mach-shmobile/include
+
 # Common objects
-obj-y                          := timer.o console.o clock.o
+obj-y                          := timer.o console.o
 
 # CPU objects
-obj-$(CONFIG_ARCH_SH7372)      += setup-sh7372.o clock-sh7372.o intc-sh7372.o
-obj-$(CONFIG_ARCH_SH73A0)      += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
-obj-$(CONFIG_ARCH_R8A73A4)     += setup-r8a73a4.o clock-r8a73a4.o
-obj-$(CONFIG_ARCH_R8A7740)     += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o
-obj-$(CONFIG_ARCH_R8A7778)     += setup-r8a7778.o clock-r8a7778.o
-obj-$(CONFIG_ARCH_R8A7779)     += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o
-obj-$(CONFIG_ARCH_R8A7790)     += setup-r8a7790.o clock-r8a7790.o
-obj-$(CONFIG_ARCH_EMEV2)       += setup-emev2.o clock-emev2.o
+obj-$(CONFIG_ARCH_SH7372)      += setup-sh7372.o intc-sh7372.o
+obj-$(CONFIG_ARCH_SH73A0)      += setup-sh73a0.o intc-sh73a0.o
+obj-$(CONFIG_ARCH_R8A73A4)     += setup-r8a73a4.o
+obj-$(CONFIG_ARCH_R8A7740)     += setup-r8a7740.o intc-r8a7740.o
+obj-$(CONFIG_ARCH_R8A7778)     += setup-r8a7778.o
+obj-$(CONFIG_ARCH_R8A7779)     += setup-r8a7779.o intc-r8a7779.o
+obj-$(CONFIG_ARCH_R8A7790)     += setup-r8a7790.o
+obj-$(CONFIG_ARCH_EMEV2)       += setup-emev2.o
+
+# Clock objects
+ifndef CONFIG_COMMON_CLK
+obj-y                          += clock.o
+obj-$(CONFIG_ARCH_SH7372)      += clock-sh7372.o
+obj-$(CONFIG_ARCH_SH73A0)      += clock-sh73a0.o
+obj-$(CONFIG_ARCH_R8A73A4)     += clock-r8a73a4.o
+obj-$(CONFIG_ARCH_R8A7740)     += clock-r8a7740.o
+obj-$(CONFIG_ARCH_R8A7778)     += clock-r8a7778.o
+obj-$(CONFIG_ARCH_R8A7779)     += clock-r8a7779.o
+obj-$(CONFIG_ARCH_R8A7790)     += clock-r8a7790.o
+obj-$(CONFIG_ARCH_EMEV2)       += clock-emev2.o
+endif
 
 # SMP objects
 smp-y                          := platsmp.o headsmp.o
@@ -46,6 +61,7 @@ obj-$(CONFIG_MACH_LAGER)      += board-lager.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA)     += board-armadillo800eva.o
 obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE)   += board-armadillo800eva-reference.o
 obj-$(CONFIG_MACH_KZM9D)       += board-kzm9d.o
+obj-$(CONFIG_MACH_KZM9D_REFERENCE)     += board-kzm9d-reference.o
 obj-$(CONFIG_MACH_KZM9G)       += board-kzm9g.o
 obj-$(CONFIG_MACH_KZM9G_REFERENCE)     += board-kzm9g-reference.o
 
index 84c6868..7785c52 100644 (file)
@@ -7,6 +7,7 @@ loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
 loadaddr-$(CONFIG_MACH_KOTA2) += 0x41008000
 loadaddr-$(CONFIG_MACH_KZM9D) += 0x40008000
+loadaddr-$(CONFIG_MACH_KZM9D_REFERENCE) += 0x40008000
 loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
 loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
 loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000
index c754071..f6d6449 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/mmc/sh_mmcif.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
+#include <linux/platform_data/bd6107.h>
 #include <linux/sh_clk.h>
 #include <linux/irqchip/arm-gic.h>
 #include <video/sh_mobile_lcdc.h>
@@ -291,47 +292,7 @@ static struct platform_device mipidsi0_device = {
        },
 };
 
-static unsigned char lcd_backlight_seq[3][2] = {
-       { 0x04, 0x07 },
-       { 0x23, 0x80 },
-       { 0x03, 0x01 },
-};
-
-static int lcd_backlight_set_brightness(int brightness)
-{
-       struct i2c_adapter *adap;
-       struct i2c_msg msg;
-       unsigned int i;
-       int ret;
-
-       if (brightness == 0) {
-               /* Reset the chip */
-               gpio_set_value(235, 0);
-               mdelay(24);
-               gpio_set_value(235, 1);
-               return 0;
-       }
-
-       adap = i2c_get_adapter(1);
-       if (adap == NULL)
-               return -ENODEV;
-
-       for (i = 0; i < ARRAY_SIZE(lcd_backlight_seq); i++) {
-               msg.addr = 0x6d;
-               msg.buf = &lcd_backlight_seq[i][0];
-               msg.len = 2;
-               msg.flags = 0;
-
-               ret = i2c_transfer(adap, &msg, 1);
-               if (ret < 0)
-                       break;
-       }
-
-       i2c_put_adapter(adap);
-       return ret < 0 ? ret : 0;
-}
-
-/* LCDC0 */
+/* LCDC0 and backlight */
 static const struct fb_videomode lcdc0_modes[] = {
        {
                .name           = "R63302(QHD)",
@@ -361,11 +322,6 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
                        .width = 44,
                        .height = 79,
                },
-               .bl_info = {
-                       .name = "sh_mobile_lcdc_bl",
-                       .max_brightness = 1,
-                       .set_brightness = lcd_backlight_set_brightness,
-               },
                .tx_dev = &mipidsi0_device,
        }
 };
@@ -394,6 +350,17 @@ static struct platform_device lcdc0_device = {
        },
 };
 
+static struct bd6107_platform_data backlight_data = {
+       .fbdev = &lcdc0_device.dev,
+       .reset = 235,
+       .def_value = 0,
+};
+
+static struct i2c_board_info backlight_board_info = {
+       I2C_BOARD_INFO("bd6107", 0x6d),
+       .platform_data = &backlight_data,
+};
+
 /* Fixed 2.8V regulators to be used by SDHI0 */
 static struct regulator_consumer_supply fixed2v8_power_consumers[] =
 {
@@ -648,15 +615,15 @@ static void __init ag5evm_init(void)
        gpio_set_value(217, 1);
        mdelay(100);
 
-       /* LCD backlight controller */
-       gpio_request_one(235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
-       lcd_backlight_set_brightness(0);
 
 #ifdef CONFIG_CACHE_L2X0
        /* Shared attribute override enable, 64K*8way */
        l2x0_init(IOMEM(0xf0100000), 0x00460000, 0xc2000fff);
 #endif
        sh73a0_add_standard_devices();
+
+       i2c_register_board_info(1, &backlight_board_info, 1);
+
        platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
 }
 
index 5eb0caa..38c6c73 100644 (file)
  */
 
 #include <linux/gpio.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
 #include <linux/interrupt.h>
-#include <linux/irqchip.h>
 #include <linux/kernel.h>
+#include <linux/mfd/tmio.h>
+#include <linux/mmc/host.h>
+#include <linux/mmc/sh_mmcif.h>
+#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/fixed.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+/* LEDS */
+static struct gpio_led ape6evm_leds[] = {
+       {
+               .name           = "gnss-en",
+               .gpio           = 28,
+               .default_state  = LEDS_GPIO_DEFSTATE_OFF,
+       }, {
+               .name           = "nfc-nrst",
+               .gpio           = 126,
+               .default_state  = LEDS_GPIO_DEFSTATE_OFF,
+       }, {
+               .name           = "gnss-nrst",
+               .gpio           = 132,
+               .default_state  = LEDS_GPIO_DEFSTATE_OFF,
+       }, {
+               .name           = "bt-wakeup",
+               .gpio           = 232,
+               .default_state  = LEDS_GPIO_DEFSTATE_OFF,
+       }, {
+               .name           = "strobe",
+               .gpio           = 250,
+               .default_state  = LEDS_GPIO_DEFSTATE_OFF,
+       }, {
+               .name           = "bbresetout",
+               .gpio           = 288,
+               .default_state  = LEDS_GPIO_DEFSTATE_OFF,
+       },
+};
+
+static __initdata struct gpio_led_platform_data ape6evm_leds_pdata = {
+       .leds           = ape6evm_leds,
+       .num_leds       = ARRAY_SIZE(ape6evm_leds),
+};
+
+/* GPIO KEY */
+#define GPIO_KEY(c, g, d, ...) \
+       { .code = c, .gpio = g, .desc = d, .active_low = 1 }
+
+static struct gpio_keys_button gpio_buttons[] = {
+       GPIO_KEY(KEY_0,                 324,    "S16"),
+       GPIO_KEY(KEY_MENU,              325,    "S17"),
+       GPIO_KEY(KEY_HOME,              326,    "S18"),
+       GPIO_KEY(KEY_BACK,              327,    "S19"),
+       GPIO_KEY(KEY_VOLUMEUP,          328,    "S20"),
+       GPIO_KEY(KEY_VOLUMEDOWN,        329,    "S21"),
+};
+
+static struct __initdata gpio_keys_platform_data ape6evm_keys_pdata = {
+       .buttons        = gpio_buttons,
+       .nbuttons       = ARRAY_SIZE(gpio_buttons),
+};
+
 /* Dummy supplies, where voltage doesn't matter */
 static struct regulator_consumer_supply dummy_supplies[] = {
        REGULATOR_SUPPLY("vddvario", "smsc911x"),
@@ -41,7 +98,7 @@ static struct regulator_consumer_supply dummy_supplies[] = {
 };
 
 /* SMSC LAN9220 */
-static const struct resource lan9220_res[] = {
+static const struct resource lan9220_res[] __initconst = {
        DEFINE_RES_MEM(0x08000000, 0x1000),
        {
                .start  = irq_pin(40), /* IRQ40 */
@@ -49,19 +106,83 @@ static const struct resource lan9220_res[] = {
        },
 };
 
-static const struct smsc911x_platform_config lan9220_data = {
+static const struct smsc911x_platform_config lan9220_data __initconst = {
        .flags          = SMSC911X_USE_32BIT,
        .irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
        .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
 };
 
-static const struct pinctrl_map ape6evm_pinctrl_map[] = {
+/*
+ * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we
+ * model a VDD supply to MMCIF, using a fixed 3.3V regulator. Also use the
+ * static power supply for SDHI0 and SDHI1, whereas SDHI0's VccQ is also
+ * supplied by the same tps80032 regulator and thus can also be adjusted
+ * dynamically.
+ */
+static struct regulator_consumer_supply fixed3v3_power_consumers[] =
+{
+       REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
+       REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
+       REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
+};
+
+/* MMCIF */
+static const struct sh_mmcif_plat_data mmcif0_pdata __initconst = {
+       .caps           = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
+};
+
+static const struct resource mmcif0_resources[] __initconst = {
+       DEFINE_RES_MEM_NAMED(0xee200000, 0x100, "MMCIF0"),
+       DEFINE_RES_IRQ(gic_spi(169)),
+};
+
+/* SDHI0 */
+static const struct sh_mobile_sdhi_info sdhi0_pdata __initconst = {
+       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
+};
+
+static const struct resource sdhi0_resources[] __initconst = {
+       DEFINE_RES_MEM_NAMED(0xee100000, 0x100, "SDHI0"),
+       DEFINE_RES_IRQ(gic_spi(165)),
+};
+
+/* SDHI1 */
+static const struct sh_mobile_sdhi_info sdhi1_pdata __initconst = {
+       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+       .tmio_caps      = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
+                         MMC_CAP_NEEDS_POLL,
+};
+
+static const struct resource sdhi1_resources[] __initconst = {
+       DEFINE_RES_MEM_NAMED(0xee120000, 0x100, "SDHI1"),
+       DEFINE_RES_IRQ(gic_spi(166)),
+};
+
+static const struct pinctrl_map ape6evm_pinctrl_map[] __initconst = {
        /* SCIFA0 console */
        PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4",
                                  "scifa0_data", "scifa0"),
        /* SMSC */
        PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a73a4",
                                  "irqc_irq40", "irqc"),
+       /* MMCIF0 */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4",
+                                 "mmc0_data8", "mmc0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-r8a73a4",
+                                 "mmc0_ctrl", "mmc0"),
+       /* SDHI0: uSD: no WP */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4",
+                                 "sdhi0_data4", "sdhi0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4",
+                                 "sdhi0_ctrl", "sdhi0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a73a4",
+                                 "sdhi0_cd", "sdhi0"),
+       /* SDHI1 */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4",
+                                 "sdhi1_data4", "sdhi1"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a73a4",
+                                 "sdhi1_ctrl", "sdhi1"),
 };
 
 static void __init ape6evm_add_standard_devices(void)
@@ -94,6 +215,23 @@ static void __init ape6evm_add_standard_devices(void)
        platform_device_register_resndata(&platform_bus, "smsc911x", -1,
                                          lan9220_res, ARRAY_SIZE(lan9220_res),
                                          &lan9220_data, sizeof(lan9220_data));
+       regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
+                                    ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
+       platform_device_register_resndata(&platform_bus, "sh_mmcif", 0,
+                                         mmcif0_resources, ARRAY_SIZE(mmcif0_resources),
+                                         &mmcif0_pdata, sizeof(mmcif0_pdata));
+       platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
+                                         sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
+                                         &sdhi0_pdata, sizeof(sdhi0_pdata));
+       platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
+                                         sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
+                                         &sdhi1_pdata, sizeof(sdhi1_pdata));
+       platform_device_register_data(&platform_bus, "gpio-keys", -1,
+                                     &ape6evm_keys_pdata,
+                                     sizeof(ape6evm_keys_pdata));
+       platform_device_register_data(&platform_bus, "leds-gpio", -1,
+                                     &ape6evm_leds_pdata,
+                                     sizeof(ape6evm_leds_pdata));
 }
 
 static const char *ape6evm_boards_compat_dt[] __initdata = {
@@ -102,7 +240,7 @@ static const char *ape6evm_boards_compat_dt[] __initdata = {
 };
 
 DT_MACHINE_START(APE6EVM_DT, "ape6evm")
-       .init_irq       = irqchip_init,
+       .init_early     = r8a73a4_init_delay,
        .init_time      = shmobile_timer_init,
        .init_machine   = ape6evm_add_standard_devices,
        .dt_compat      = ape6evm_boards_compat_dt,
index 03b85fe..fd2446d 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/kernel.h>
 #include <linux/gpio.h>
 #include <linux/io.h>
-#include <linux/pinctrl/machine.h>
 #include <mach/common.h>
 #include <mach/r8a7740.h>
 #include <asm/mach/arch.h>
  *     usbhsf_power_ctrl()
  */
 
-static const struct pinctrl_map eva_pinctrl_map[] = {
-       /* SCIFA1 */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.1", "pfc-r8a7740",
-                                 "scifa1_data", "scifa1"),
-};
-
 static void __init eva_clock_init(void)
 {
        struct clk *system      = clk_get(NULL, "system_clk");
@@ -165,35 +158,26 @@ clock_error:
  */
 static void __init eva_init(void)
 {
-
        r8a7740_clock_init(MD_CK0 | MD_CK2);
        eva_clock_init();
 
-       pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map));
-       r8a7740_pinmux_init();
-
        r8a7740_meram_workaround();
 
-       /*
-        * Touchscreen
-        * TODO: Move reset GPIO over to .dts when we can reference it
-        */
-       gpio_request_one(166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */
-
 #ifdef CONFIG_CACHE_L2X0
        /* Early BRESP enable, Shared attribute override enable, 32K*8way */
        l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff);
 #endif
 
        r8a7740_add_standard_devices_dt();
+
        r8a7740_pm_init();
 }
 
 #define RESCNT2 IOMEM(0xe6188020)
-static void eva_restart(char mode, const char *cmd)
+static void eva_restart(enum reboot_mode mode, const char *cmd)
 {
        /* Do soft power on reset */
-       writel((1 << 31), RESCNT2);
+       writel(1 << 31, RESCNT2);
 }
 
 static const char *eva_boards_compat_dt[] __initdata = {
index 3a6ffa2..6b4b77d 100644 (file)
@@ -31,6 +31,8 @@
 #include <linux/gpio_keys.h>
 #include <linux/regulator/driver.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/platform_data/pwm-renesas-tpu.h>
+#include <linux/pwm_backlight.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
@@ -386,7 +388,50 @@ static struct platform_device sh_eth_device = {
        .num_resources = ARRAY_SIZE(sh_eth_resources),
 };
 
-/* LCDC */
+/* PWM */
+static struct resource pwm_resources[] = {
+       [0] = {
+               .start = 0xe6600000,
+               .end = 0xe66000ff,
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct tpu_pwm_platform_data pwm_device_data = {
+       .channels[2] = {
+               .polarity = PWM_POLARITY_INVERSED,
+       }
+};
+
+static struct platform_device pwm_device = {
+       .name = "renesas-tpu-pwm",
+       .id = -1,
+       .dev = {
+               .platform_data = &pwm_device_data,
+       },
+       .num_resources = ARRAY_SIZE(pwm_resources),
+       .resource = pwm_resources,
+};
+
+static struct pwm_lookup pwm_lookup[] = {
+       PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL),
+};
+
+/* LCDC and backlight */
+static struct platform_pwm_backlight_data pwm_backlight_data = {
+       .lth_brightness = 50,
+       .max_brightness = 255,
+       .dft_brightness = 255,
+       .pwm_period_ns = 33333, /* 30kHz */
+};
+
+static struct platform_device pwm_backlight_device = {
+       .name = "pwm-backlight",
+       .dev = {
+               .platform_data = &pwm_backlight_data,
+       },
+};
+
 static struct fb_videomode lcdc0_mode = {
        .name           = "AMPIER/AM-800480",
        .xres           = 800,
@@ -678,15 +723,6 @@ static struct platform_device vcc_sdhi1 = {
 };
 
 /* SDHI0 */
-/*
- * FIXME
- *
- * It use polling mode here, since
- * CD (= Card Detect) pin is not connected to SDHI0_CD.
- * We can use IRQ31 as card detect irq,
- * but it needs chattering removal operation
- */
-#define IRQ31  irq_pin(31)
 static struct sh_mobile_sdhi_info sdhi0_info = {
        .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
        .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
@@ -787,6 +823,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
        .caps           = MMC_CAP_4_BIT_DATA |
                          MMC_CAP_8_BIT_DATA |
                          MMC_CAP_NONREMOVABLE,
+       .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
+       .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
 };
 
 static struct resource sh_mmcif_resources[] = {
@@ -1029,6 +1067,8 @@ static struct i2c_board_info i2c2_devices[] = {
  */
 static struct platform_device *eva_devices[] __initdata = {
        &lcdc0_device,
+       &pwm_device,
+       &pwm_backlight_device,
        &gpio_keys_device,
        &sh_eth_device,
        &vcc_sdhi0,
@@ -1100,6 +1140,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = {
        /* ST1232 */
        PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-r8a7740",
                                  "intc_irq10", "intc"),
+       /* TPU0 */
+       PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm", "pfc-r8a7740",
+                                 "tpu0_to2_1", "tpu0"),
        /* USBHS */
        PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7740",
                                  "intc_irq7_1", "intc"),
@@ -1153,13 +1196,13 @@ static void __init eva_init(void)
                                     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
 
        pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map));
+       pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
 
        r8a7740_pinmux_init();
        r8a7740_meram_workaround();
 
        /* LCDC0 */
        gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
-       gpio_request_one(202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
 
        /* GETHER */
        gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */
index ef5ca0e..6af20d9 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/irq.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/pinctrl/pinconf-generic.h>
+#include <linux/platform_data/pwm-renesas-tpu.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/io.h>
@@ -37,8 +38,8 @@
 #include <linux/input/sh_keysc.h>
 #include <linux/gpio_keys.h>
 #include <linux/leds.h>
+#include <linux/leds_pwm.h>
 #include <linux/irqchip/arm-gic.h>
-#include <linux/platform_data/leds-renesas-tpu.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mmcif.h>
 #include <linux/mfd/tmio.h>
@@ -186,116 +187,100 @@ static struct platform_device gpio_leds_device = {
 };
 
 /* TPU LED */
-static struct led_renesas_tpu_config led_renesas_tpu12_pdata = {
-       .name           = "V2513",
-       .pin_gpio_fn    = GPIO_FN_TPU1TO2,
-       .pin_gpio       = 153,
-       .channel_offset = 0x90,
-       .timer_bit = 2,
-       .max_brightness = 1000,
-};
-
-static struct resource tpu12_resources[] = {
+static struct resource tpu1_pwm_resources[] = {
        [0] = {
-               .name   = "TPU12",
-               .start  = 0xe6610090,
-               .end    = 0xe66100b5,
+               .start  = 0xe6610000,
+               .end    = 0xe66100ff,
                .flags  = IORESOURCE_MEM,
        },
 };
 
-static struct platform_device leds_tpu12_device = {
-       .name = "leds-renesas-tpu",
-       .id = 12,
-       .dev = {
-               .platform_data  = &led_renesas_tpu12_pdata,
-       },
-       .num_resources  = ARRAY_SIZE(tpu12_resources),
-       .resource       = tpu12_resources,
+static struct platform_device tpu1_pwm_device = {
+       .name = "renesas-tpu-pwm",
+       .id = 1,
+       .num_resources  = ARRAY_SIZE(tpu1_pwm_resources),
+       .resource       = tpu1_pwm_resources,
 };
 
-static struct led_renesas_tpu_config led_renesas_tpu41_pdata = {
-       .name           = "V2514",
-       .pin_gpio_fn    = GPIO_FN_TPU4TO1,
-       .pin_gpio       = 199,
-       .channel_offset = 0x50,
-       .timer_bit = 1,
-       .max_brightness = 1000,
-};
-
-static struct resource tpu41_resources[] = {
+static struct resource tpu2_pwm_resources[] = {
        [0] = {
-               .name   = "TPU41",
-               .start  = 0xe6640050,
-               .end    = 0xe6640075,
+               .start  = 0xe6620000,
+               .end    = 0xe66200ff,
                .flags  = IORESOURCE_MEM,
        },
 };
 
-static struct platform_device leds_tpu41_device = {
-       .name = "leds-renesas-tpu",
-       .id = 41,
-       .dev = {
-               .platform_data  = &led_renesas_tpu41_pdata,
+static struct platform_device tpu2_pwm_device = {
+       .name = "renesas-tpu-pwm",
+       .id = 2,
+       .num_resources  = ARRAY_SIZE(tpu2_pwm_resources),
+       .resource       = tpu2_pwm_resources,
+};
+
+static struct resource tpu3_pwm_resources[] = {
+       [0] = {
+               .start  = 0xe6630000,
+               .end    = 0xe66300ff,
+               .flags  = IORESOURCE_MEM,
        },
-       .num_resources  = ARRAY_SIZE(tpu41_resources),
-       .resource       = tpu41_resources,
 };
 
-static struct led_renesas_tpu_config led_renesas_tpu21_pdata = {
-       .name           = "V2515",
-       .pin_gpio_fn    = GPIO_FN_TPU2TO1,
-       .pin_gpio       = 197,
-       .channel_offset = 0x50,
-       .timer_bit = 1,
-       .max_brightness = 1000,
+static struct platform_device tpu3_pwm_device = {
+       .name = "renesas-tpu-pwm",
+       .id = 3,
+       .num_resources  = ARRAY_SIZE(tpu3_pwm_resources),
+       .resource       = tpu3_pwm_resources,
 };
 
-static struct resource tpu21_resources[] = {
+static struct resource tpu4_pwm_resources[] = {
        [0] = {
-               .name   = "TPU21",
-               .start  = 0xe6620050,
-               .end    = 0xe6620075,
+               .start  = 0xe6640000,
+               .end    = 0xe66400ff,
                .flags  = IORESOURCE_MEM,
        },
 };
 
-static struct platform_device leds_tpu21_device = {
-       .name = "leds-renesas-tpu",
-       .id = 21,
-       .dev = {
-               .platform_data  = &led_renesas_tpu21_pdata,
+static struct platform_device tpu4_pwm_device = {
+       .name = "renesas-tpu-pwm",
+       .id = 4,
+       .num_resources  = ARRAY_SIZE(tpu4_pwm_resources),
+       .resource       = tpu4_pwm_resources,
+};
+
+static struct pwm_lookup pwm_lookup[] = {
+       PWM_LOOKUP("renesas-tpu-pwm.1", 2, "leds-pwm.0", "V2513"),
+       PWM_LOOKUP("renesas-tpu-pwm.2", 1, "leds-pwm.0", "V2515"),
+       PWM_LOOKUP("renesas-tpu-pwm.3", 0, "leds-pwm.0", "KEYLED"),
+       PWM_LOOKUP("renesas-tpu-pwm.4", 1, "leds-pwm.0", "V2514"),
+};
+
+static struct led_pwm tpu_pwm_leds[] = {
+       {
+               .name           = "V2513",
+               .max_brightness = 1000,
+       }, {
+               .name           = "V2515",
+               .max_brightness = 1000,
+       }, {
+               .name           = "KEYLED",
+               .max_brightness = 1000,
+       }, {
+               .name           = "V2514",
+               .max_brightness = 1000,
        },
-       .num_resources  = ARRAY_SIZE(tpu21_resources),
-       .resource       = tpu21_resources,
 };
 
-static struct led_renesas_tpu_config led_renesas_tpu30_pdata = {
-       .name           = "KEYLED",
-       .pin_gpio_fn    = GPIO_FN_TPU3TO0,
-       .pin_gpio       = 163,
-       .channel_offset = 0x10,
-       .timer_bit = 0,
-       .max_brightness = 1000,
+static struct led_pwm_platform_data leds_pwm_pdata = {
+       .num_leds = ARRAY_SIZE(tpu_pwm_leds),
+       .leds = tpu_pwm_leds,
 };
 
-static struct resource tpu30_resources[] = {
-       [0] = {
-               .name   = "TPU30",
-               .start  = 0xe6630010,
-               .end    = 0xe6630035,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device leds_tpu30_device = {
-       .name = "leds-renesas-tpu",
-       .id = 30,
+static struct platform_device leds_pwm_device = {
+       .name = "leds-pwm",
+       .id = 0,
        .dev = {
-               .platform_data  = &led_renesas_tpu30_pdata,
+               .platform_data = &leds_pwm_pdata,
        },
-       .num_resources  = ARRAY_SIZE(tpu30_resources),
-       .resource       = tpu30_resources,
 };
 
 /* Fixed 1.8V regulator to be used by MMCIF */
@@ -426,10 +411,11 @@ static struct platform_device *kota2_devices[] __initdata = {
        &keysc_device,
        &gpio_keys_device,
        &gpio_leds_device,
-       &leds_tpu12_device,
-       &leds_tpu41_device,
-       &leds_tpu21_device,
-       &leds_tpu30_device,
+       &tpu1_pwm_device,
+       &tpu2_pwm_device,
+       &tpu3_pwm_device,
+       &tpu4_pwm_device,
+       &leds_pwm_device,
        &mmcif_device,
        &sdhi0_device,
        &sdhi1_device,
@@ -512,6 +498,15 @@ static const struct pinctrl_map kota2_pinctrl_map[] = {
                                  "bsc_cs5_a", "bsc"),
        PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
                                  "bsc_we0", "bsc"),
+       /* TPU */
+       PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.1", "pfc-sh73a0",
+                                 "tpu1_to2", "tpu1"),
+       PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.2", "pfc-sh73a0",
+                                 "tpu2_to1", "tpu2"),
+       PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.3", "pfc-sh73a0",
+                                 "tpu3_to0", "tpu3"),
+       PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.4", "pfc-sh73a0",
+                                 "tpu4_to1", "tpu4"),
 };
 
 static void __init kota2_init(void)
@@ -524,6 +519,8 @@ static void __init kota2_init(void)
 
        pinctrl_register_mappings(kota2_pinctrl_map,
                                  ARRAY_SIZE(kota2_pinctrl_map));
+       pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
+
        sh73a0_pinmux_init();
 
        /* SMSC911X */
diff --git a/arch/arm/mach-shmobile/board-kzm9d-reference.c b/arch/arm/mach-shmobile/board-kzm9d-reference.c
new file mode 100644 (file)
index 0000000..8f8bb2f
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * kzm9d board support - Reference DT implementation
+ *
+ * Copyright (C) 2013  Renesas Solutions Corp.
+ * Copyright (C) 2013  Magnus Damm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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/init.h>
+#include <linux/of_platform.h>
+#include <mach/emev2.h>
+#include <mach/common.h>
+#include <asm/mach/arch.h>
+
+static void __init kzm9d_add_standard_devices(void)
+{
+       if (!IS_ENABLED(CONFIG_COMMON_CLK))
+               emev2_clock_init();
+
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *kzm9d_boards_compat_dt[] __initdata = {
+       "renesas,kzm9d-reference",
+       NULL,
+};
+
+DT_MACHINE_START(KZM9D_DT, "kzm9d")
+       .smp            = smp_ops(emev2_smp_ops),
+       .map_io         = emev2_map_io,
+       .init_early     = emev2_init_delay,
+       .init_machine   = kzm9d_add_standard_devices,
+       .init_late      = shmobile_init_late,
+       .dt_compat      = kzm9d_boards_compat_dt,
+MACHINE_END
index 4368000..30c2cc6 100644 (file)
@@ -85,9 +85,7 @@ static const char *kzm9d_boards_compat_dt[] __initdata = {
 DT_MACHINE_START(KZM9D_DT, "kzm9d")
        .smp            = smp_ops(emev2_smp_ops),
        .map_io         = emev2_map_io,
-       .init_early     = emev2_add_early_devices,
-       .nr_irqs        = NR_IRQS_LEGACY,
-       .init_irq       = emev2_init_irq,
+       .init_early     = emev2_init_delay,
        .init_machine   = kzm9d_add_standard_devices,
        .init_late      = shmobile_init_late,
        .dt_compat      = kzm9d_boards_compat_dt,
index 44055fe..a66a808 100644 (file)
  */
 
 #include <linux/delay.h>
-#include <linux/gpio.h>
 #include <linux/io.h>
 #include <linux/irq.h>
-#include <linux/irqchip.h>
 #include <linux/input.h>
 #include <linux/of_platform.h>
-#include <linux/pinctrl/machine.h>
-#include <linux/pinctrl/pinconf-generic.h>
 #include <mach/sh73a0.h>
 #include <mach/common.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-static unsigned long pin_pullup_conf[] = {
-       PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
-};
-
-static const struct pinctrl_map kzm_pinctrl_map[] = {
-       PIN_MAP_MUX_GROUP_DEFAULT("e6826000.i2c", "pfc-sh73a0",
-                                 "i2c3_1", "i2c3"),
-       /* MMCIF */
-       PIN_MAP_MUX_GROUP_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
-                                 "mmc0_data8_0", "mmc0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
-                                 "mmc0_ctrl_0", "mmc0"),
-       PIN_MAP_CONFIGS_PIN_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
-                                   "PORT279", pin_pullup_conf),
-       PIN_MAP_CONFIGS_GROUP_DEFAULT("e6bd0000.mmcif", "pfc-sh73a0",
-                                     "mmc0_data8_0", pin_pullup_conf),
-       /* SCIFA4 */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
-                                 "scifa4_data", "scifa4"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
-                                 "scifa4_ctrl", "scifa4"),
-       /* SDHI0 */
-       PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
-                                 "sdhi0_data4", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
-                                 "sdhi0_ctrl", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
-                                 "sdhi0_cd", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("ee100000.sdhi", "pfc-sh73a0",
-                                 "sdhi0_wp", "sdhi0"),
-       /* SDHI2 */
-       PIN_MAP_MUX_GROUP_DEFAULT("ee140000.sdhi", "pfc-sh73a0",
-                                 "sdhi2_data4", "sdhi2"),
-       PIN_MAP_MUX_GROUP_DEFAULT("ee140000.sdhi", "pfc-sh73a0",
-                                 "sdhi2_ctrl", "sdhi2"),
-};
-
 static void __init kzm_init(void)
 {
        sh73a0_add_standard_devices_dt();
-       pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
-       sh73a0_pinmux_init();
-
-       /* enable SD */
-       gpio_request_one(15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
-
-       gpio_request_one(14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
 
 #ifdef CONFIG_CACHE_L2X0
        /* Early BRESP enable, Shared attribute override enable, 64K*8way */
@@ -99,7 +51,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g-reference")
        .map_io         = sh73a0_map_io,
        .init_early     = sh73a0_init_delay,
        .nr_irqs        = NR_IRQS_LEGACY,
-       .init_irq       = irqchip_init,
        .init_machine   = kzm_init,
        .init_time      = shmobile_timer_init,
        .dt_compat      = kzm9g_boards_compat_dt,
index 8d6bd5c..4872939 100644 (file)
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/interrupt.h>
-#include <linux/irqchip.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
+#include <linux/mmc/host.h>
+#include <linux/mmc/sh_mmcif.h>
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_device.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+#include <linux/sh_eth.h>
 #include <mach/common.h>
+#include <mach/irqs.h>
 #include <mach/r8a7790.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -71,6 +76,36 @@ static __initdata struct gpio_keys_platform_data lager_keys_pdata = {
        .nbuttons       = ARRAY_SIZE(gpio_buttons),
 };
 
+/* Fixed 3.3V regulator to be used by MMCIF */
+static struct regulator_consumer_supply fixed3v3_power_consumers[] =
+{
+       REGULATOR_SUPPLY("vmmc", "sh_mmcif.1"),
+};
+
+/* MMCIF */
+static struct sh_mmcif_plat_data mmcif1_pdata __initdata = {
+       .caps           = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
+};
+
+static struct resource mmcif1_resources[] __initdata = {
+       DEFINE_RES_MEM_NAMED(0xee220000, 0x80, "MMCIF1"),
+       DEFINE_RES_IRQ(gic_spi(170)),
+};
+
+/* Ether */
+static struct sh_eth_plat_data ether_pdata __initdata = {
+       .phy                    = 0x1,
+       .edmac_endian           = EDMAC_LITTLE_ENDIAN,
+       .register_type          = SH_ETH_REG_FAST_RCAR,
+       .phy_interface          = PHY_INTERFACE_MODE_RMII,
+       .ether_link_active_low  = 1,
+};
+
+static struct resource ether_resources[] __initdata = {
+       DEFINE_RES_MEM(0xee700000, 0x400),
+       DEFINE_RES_IRQ(gic_spi(162)),
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
        /* SCIF0 (CN19: DEBUG SERIAL0) */
        PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -78,6 +113,20 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
        /* SCIF1 (CN20: DEBUG SERIAL1) */
        PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
                                  "scif1_data", "scif1"),
+       /* MMCIF1 */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790",
+                                 "mmc1_data8", "mmc1"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790",
+                                 "mmc1_ctrl", "mmc1"),
+       /* Ether */
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790",
+                                 "eth_link", "eth"),
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790",
+                                 "eth_mdio", "eth"),
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790",
+                                 "eth_rmii", "eth"),
+       PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790",
+                                 "intc_irq0", "intc"),
 };
 
 static void __init lager_add_standard_devices(void)
@@ -95,6 +144,16 @@ static void __init lager_add_standard_devices(void)
        platform_device_register_data(&platform_bus, "gpio-keys", -1,
                                      &lager_keys_pdata,
                                      sizeof(lager_keys_pdata));
+       regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
+                                    ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
+       platform_device_register_resndata(&platform_bus, "sh_mmcif", 1,
+                                         mmcif1_resources, ARRAY_SIZE(mmcif1_resources),
+                                         &mmcif1_pdata, sizeof(mmcif1_pdata));
+
+       platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1,
+                                         ether_resources,
+                                         ARRAY_SIZE(ether_resources),
+                                         &ether_pdata, sizeof(ether_pdata));
 }
 
 static const char *lager_boards_compat_dt[] __initdata = {
@@ -103,7 +162,7 @@ static const char *lager_boards_compat_dt[] __initdata = {
 };
 
 DT_MACHINE_START(LAGER_DT, "lager")
-       .init_irq       = irqchip_init,
+       .init_early     = r8a7790_init_delay,
        .init_time      = r8a7790_timer_init,
        .init_machine   = lager_add_standard_devices,
        .dt_compat      = lager_boards_compat_dt,
index 85f51a8..af06753 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/sh_flctl.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/platform_data/gpio_backlight.h>
 #include <linux/pm_clock.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
@@ -49,7 +50,6 @@
 #include <linux/tca6416_keypad.h>
 #include <linux/usb/renesas_usbhs.h>
 #include <linux/dma-mapping.h>
-
 #include <video/sh_mobile_hdmi.h>
 #include <video/sh_mobile_lcdc.h>
 #include <media/sh_mobile_ceu.h>
@@ -346,7 +346,7 @@ static struct platform_device meram_device = {
        },
 };
 
-/* LCDC */
+/* LCDC and backlight */
 static struct fb_videomode mackerel_lcdc_modes[] = {
        {
                .name           = "WVGA Panel",
@@ -362,13 +362,6 @@ static struct fb_videomode mackerel_lcdc_modes[] = {
        },
 };
 
-static int mackerel_set_brightness(int brightness)
-{
-       gpio_set_value(31, brightness);
-
-       return 0;
-}
-
 static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
        .icb[0] = {
                .meram_size     = 0x40,
@@ -393,11 +386,6 @@ static struct sh_mobile_lcdc_info lcdc_info = {
                        .width          = 152,
                        .height         = 91,
                },
-               .bl_info = {
-                       .name = "sh_mobile_lcdc_bl",
-                       .max_brightness = 1,
-                       .set_brightness = mackerel_set_brightness,
-               },
                .meram_cfg = &lcd_meram_cfg,
        }
 };
@@ -425,6 +413,20 @@ static struct platform_device lcdc_device = {
        },
 };
 
+static struct gpio_backlight_platform_data gpio_backlight_data = {
+       .fbdev = &lcdc_device.dev,
+       .gpio = 31,
+       .def_value = 1,
+       .name = "backlight",
+};
+
+static struct platform_device gpio_backlight_device = {
+       .name = "gpio-backlight",
+       .dev = {
+               .platform_data = &gpio_backlight_data,
+       },
+};
+
 /* HDMI */
 static struct sh_mobile_hdmi_info hdmi_info = {
        .flags          = HDMI_SND_SRC_SPDIF,
@@ -1231,6 +1233,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
        &nor_flash_device,
        &smc911x_device,
        &lcdc_device,
+       &gpio_backlight_device,
        &usbhs0_device,
        &usbhs1_device,
        &leds_device,
@@ -1441,9 +1444,6 @@ static void __init mackerel_init(void)
                                  ARRAY_SIZE(mackerel_pinctrl_map));
        sh7372_pinmux_init();
 
-       /* backlight, off by default */
-       gpio_request_one(31, GPIOF_OUT_INIT_LOW, NULL);
-
        gpio_request_one(151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
 
        /* USBHS0 */
index 480d882..3d1c439 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/pinctrl/machine.h>
 #include <mach/r8a7779.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 
-static const struct pinctrl_map marzen_pinctrl_map[] = {
-       /* SCIF2 (CN18: DEBUG0) */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-r8a7779",
-                                 "scif2_data_c", "scif2"),
-       /* SCIF4 (CN19: DEBUG1) */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-r8a7779",
-                                 "scif4_data", "scif4"),
-       /* SDHI0 */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
-                                 "sdhi0_data4", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
-                                 "sdhi0_ctrl", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
-                                 "sdhi0_cd", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7779",
-                                 "sdhi0_wp", "sdhi0"),
-       /* SMSC */
-       PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
-                                 "intc_irq1_b", "intc"),
-       PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a7779",
-                                 "lbsc_ex_cs0", "lbsc"),
-};
-
 static void __init marzen_init(void)
 {
-       pinctrl_register_mappings(marzen_pinctrl_map,
-                                 ARRAY_SIZE(marzen_pinctrl_map));
-       r8a7779_pinmux_init();
-
        r8a7779_add_standard_devices_dt();
 }
 
index 4710f18..5ac13ba 100644 (file)
@@ -40,7 +40,6 @@
 #define USIB2SCLKDIV 0x65c
 #define USIB3SCLKDIV 0x660
 #define STI_CLKSEL 0x688
-#define SMU_GENERAL_REG0 0x7c0
 
 /* not pretty, but hey */
 static void __iomem *smu_base;
@@ -51,11 +50,6 @@ static void emev2_smu_write(unsigned long value, int offs)
        iowrite32(value, smu_base + offs);
 }
 
-void emev2_set_boot_vector(unsigned long value)
-{
-       emev2_smu_write(value, SMU_GENERAL_REG0);
-}
-
 static struct clk_mapping smu_mapping = {
        .phys   = EMEV2_SMU_BASE,
        .len    = PAGE_SIZE,
@@ -205,23 +199,11 @@ static struct clk_lookup lookups[] = {
 void __init emev2_clock_init(void)
 {
        int k, ret = 0;
-       static int is_setup;
-
-       /* yuck, this is ugly as hell, but the non-smp case of clocks
-        * code is now designed to rely on ioremap() instead of static
-        * entity maps. in the case of smp we need access to the SMU
-        * register earlier than ioremap() is actually working without
-        * any static maps. to enable SMP in ugly but with dynamic
-        * mappings we have to call emev2_clock_init() from different
-        * places depending on UP and SMP...
-        */
-       if (is_setup++)
-               return;
 
        smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
        BUG_ON(!smu_base);
 
-       /* setup STI timer to run on 37.768 kHz and deassert reset */
+       /* setup STI timer to run on 32.768 kHz and deassert reset */
        emev2_smu_write(0, STI_CLKSEL);
        emev2_smu_write(1, STI_RSTCTRL);
 
index 5f7fe62..8ea5ef6 100644 (file)
 
 #define SMSTPCR2 0xe6150138
 #define SMSTPCR3 0xe615013c
+#define SMSTPCR4 0xe6150140
 #define SMSTPCR5 0xe6150144
 
 #define FRQCRA         0xE6150000
 #define FRQCRB         0xE6150004
+#define FRQCRC         0xE61500E0
 #define VCLKCR1                0xE6150008
 #define VCLKCR2                0xE615000C
 #define VCLKCR3                0xE615001C
@@ -52,6 +54,7 @@
 #define HSICKCR                0xE615026C
 #define M4CKCR         0xE6150098
 #define PLLECR         0xE61500D0
+#define PLL0CR         0xE61500D8
 #define PLL1CR         0xE6150028
 #define PLL2CR         0xE615002C
 #define PLL2SCR                0xE61501F4
@@ -177,6 +180,7 @@ static struct sh_clk_ops pll_clk_ops = {
                .mapping        = &cpg_mapping,         \
        }
 
+PLL_CLOCK(pll0_clk,  &main_clk,      pll_parent_main,      1, 20, PLL0CR,  0);
 PLL_CLOCK(pll1_clk,  &main_clk,      pll_parent_main,       1, 7, PLL1CR,  1);
 PLL_CLOCK(pll2_clk,  &main_div2_clk, pll_parent_main_extal, 3, 5, PLL2CR,  2);
 PLL_CLOCK(pll2s_clk, &main_div2_clk, pll_parent_main_extal, 3, 5, PLL2SCR, 4);
@@ -184,6 +188,157 @@ PLL_CLOCK(pll2h_clk, &main_div2_clk, pll_parent_main_extal, 3, 5, PLL2HCR, 5);
 
 SH_FIXED_RATIO_CLK(pll1_div2_clk,      pll1_clk,       div2);
 
+static atomic_t frqcr_lock;
+
+/* Several clocks need to access FRQCRB, have to lock */
+static bool frqcr_kick_check(struct clk *clk)
+{
+       return !(ioread32(CPG_MAP(FRQCRB)) & BIT(31));
+}
+
+static int frqcr_kick_do(struct clk *clk)
+{
+       int i;
+
+       /* set KICK bit in FRQCRB to update hardware setting, check success */
+       iowrite32(ioread32(CPG_MAP(FRQCRB)) | BIT(31), CPG_MAP(FRQCRB));
+       for (i = 1000; i; i--)
+               if (ioread32(CPG_MAP(FRQCRB)) & BIT(31))
+                       cpu_relax();
+               else
+                       return 0;
+
+       return -ETIMEDOUT;
+}
+
+static int zclk_set_rate(struct clk *clk, unsigned long rate)
+{
+       void __iomem *frqcrc;
+       int ret;
+       unsigned long step, p_rate;
+       u32 val;
+
+       if (!clk->parent || !__clk_get(clk->parent))
+               return -ENODEV;
+
+       if (!atomic_inc_and_test(&frqcr_lock) || !frqcr_kick_check(clk)) {
+               ret = -EBUSY;
+               goto done;
+       }
+
+       /*
+        * Users are supposed to first call clk_set_rate() only with
+        * clk_round_rate() results. So, we don't fix wrong rates here, but
+        * guard against them anyway
+        */
+
+       p_rate = clk_get_rate(clk->parent);
+       if (rate == p_rate) {
+               val = 0;
+       } else {
+               step = DIV_ROUND_CLOSEST(p_rate, 32);
+
+               if (rate > p_rate || rate < step) {
+                       ret = -EINVAL;
+                       goto done;
+               }
+
+               val = 32 - rate / step;
+       }
+
+       frqcrc = clk->mapped_reg + (FRQCRC - (u32)clk->enable_reg);
+
+       iowrite32((ioread32(frqcrc) & ~(clk->div_mask << clk->enable_bit)) |
+                 (val << clk->enable_bit), frqcrc);
+
+       ret = frqcr_kick_do(clk);
+
+done:
+       atomic_dec(&frqcr_lock);
+       __clk_put(clk->parent);
+       return ret;
+}
+
+static long zclk_round_rate(struct clk *clk, unsigned long rate)
+{
+       /*
+        * theoretical rate = parent rate * multiplier / 32,
+        * where 1 <= multiplier <= 32. Therefore we should do
+        * multiplier = rate * 32 / parent rate
+        * rounded rate = parent rate * multiplier / 32.
+        * However, multiplication before division won't fit in 32 bits, so
+        * we sacrifice some precision by first dividing and then multiplying.
+        * To find the nearest divisor we calculate both and pick up the best
+        * one. This avoids 64-bit arithmetics.
+        */
+       unsigned long step, mul_min, mul_max, rate_min, rate_max;
+
+       rate_max = clk_get_rate(clk->parent);
+
+       /* output freq <= parent */
+       if (rate >= rate_max)
+               return rate_max;
+
+       step = DIV_ROUND_CLOSEST(rate_max, 32);
+       /* output freq >= parent / 32 */
+       if (step >= rate)
+               return step;
+
+       mul_min = rate / step;
+       mul_max = DIV_ROUND_UP(rate, step);
+       rate_min = step * mul_min;
+       if (mul_max == mul_min)
+               return rate_min;
+
+       rate_max = step * mul_max;
+
+       if (rate_max - rate <  rate - rate_min)
+               return rate_max;
+
+       return rate_min;
+}
+
+static unsigned long zclk_recalc(struct clk *clk)
+{
+       void __iomem *frqcrc = FRQCRC - (u32)clk->enable_reg + clk->mapped_reg;
+       unsigned int max = clk->div_mask + 1;
+       unsigned long val = ((ioread32(frqcrc) >> clk->enable_bit) &
+                            clk->div_mask);
+
+       return DIV_ROUND_CLOSEST(clk_get_rate(clk->parent), max) *
+               (max - val);
+}
+
+static struct sh_clk_ops zclk_ops = {
+       .recalc = zclk_recalc,
+       .set_rate = zclk_set_rate,
+       .round_rate = zclk_round_rate,
+};
+
+static struct clk z_clk = {
+       .parent = &pll0_clk,
+       .div_mask = 0x1f,
+       .enable_bit = 8,
+       /* We'll need to access FRQCRB and FRQCRC */
+       .enable_reg = (void __iomem *)FRQCRB,
+       .ops = &zclk_ops,
+};
+
+/*
+ * It seems only 1/2 divider is usable in manual mode. 1/2 / 2/3
+ * switching is only available in auto-DVFS mode
+ */
+SH_FIXED_RATIO_CLK(pll0_div2_clk,      pll0_clk,               div2);
+
+static struct clk z2_clk = {
+       .parent = &pll0_div2_clk,
+       .div_mask = 0x1f,
+       .enable_bit = 0,
+       /* We'll need to access FRQCRB and FRQCRC */
+       .enable_reg = (void __iomem *)FRQCRB,
+       .ops = &zclk_ops,
+};
+
 static struct clk *main_clks[] = {
        &extalr_clk,
        &extal1_clk,
@@ -195,22 +350,23 @@ static struct clk *main_clks[] = {
        &main_div2_clk,
        &fsiack_clk,
        &fsibck_clk,
+       &pll0_clk,
        &pll1_clk,
        &pll1_div2_clk,
        &pll2_clk,
        &pll2s_clk,
        &pll2h_clk,
+       &z_clk,
+       &pll0_div2_clk,
+       &z2_clk,
 };
 
 /* DIV4 */
 static void div4_kick(struct clk *clk)
 {
-       unsigned long value;
-
-       /* set KICK bit in FRQCRB to update hardware setting */
-       value = ioread32(CPG_MAP(FRQCRB));
-       value |= (1 << 31);
-       iowrite32(value, CPG_MAP(FRQCRB));
+       if (!WARN(!atomic_inc_and_test(&frqcr_lock), "FRQCR* lock broken!\n"))
+               frqcr_kick_do(clk);
+       atomic_dec(&frqcr_lock);
 }
 
 static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 24, 0, 36, 48, 10};
@@ -349,8 +505,10 @@ static struct clk div6_clks[DIV6_NR] = {
 /* MSTP */
 enum {
        MSTP217, MSTP216, MSTP207, MSTP206, MSTP204, MSTP203,
-       MSTP315, MSTP314, MSTP313, MSTP312, MSTP305,
-       MSTP522,
+       MSTP329, MSTP323, MSTP318, MSTP317, MSTP316,
+       MSTP315, MSTP314, MSTP313, MSTP312, MSTP305, MSTP300,
+       MSTP411, MSTP410, MSTP409,
+       MSTP522, MSTP515,
        MSTP_NR
 };
 
@@ -361,12 +519,22 @@ static struct clk mstp_clks[MSTP_NR] = {
        [MSTP207] = SH_CLK_MSTP32(&div6_clks[DIV6_MP],  SMSTPCR2, 7, 0), /* SCIFB1 */
        [MSTP216] = SH_CLK_MSTP32(&div6_clks[DIV6_MP],  SMSTPCR2, 16, 0), /* SCIFB2 */
        [MSTP217] = SH_CLK_MSTP32(&div6_clks[DIV6_MP],  SMSTPCR2, 17, 0), /* SCIFB3 */
+       [MSTP300] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR3, 0, 0), /* IIC2 */
        [MSTP305] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC1],SMSTPCR3, 5, 0), /* MMCIF1 */
        [MSTP312] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI2],SMSTPCR3, 12, 0), /* SDHI2 */
        [MSTP313] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI1],SMSTPCR3, 13, 0), /* SDHI1 */
        [MSTP314] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI0],SMSTPCR3, 14, 0), /* SDHI0 */
        [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0],SMSTPCR3, 15, 0), /* MMCIF0 */
+       [MSTP316] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR3, 16, 0), /* IIC6 */
+       [MSTP317] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR3, 17, 0), /* IIC7 */
+       [MSTP318] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR3, 18, 0), /* IIC0 */
+       [MSTP323] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR3, 23, 0), /* IIC1 */
+       [MSTP329] = SH_CLK_MSTP32(&extalr_clk, SMSTPCR3, 29, 0), /* CMT10 */
+       [MSTP409] = SH_CLK_MSTP32(&main_div2_clk,       SMSTPCR4, 9, 0), /* IIC5 */
+       [MSTP410] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR4, 10, 0), /* IIC4 */
+       [MSTP411] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR4, 11, 0), /* IIC3 */
        [MSTP522] = SH_CLK_MSTP32(&extal2_clk, SMSTPCR5, 22, 0), /* Thermal */
+       [MSTP515] = SH_CLK_MSTP32(&div4_clks[DIV4_HP],  SMSTPCR5, 15, 0), /* IIC8 */
 };
 
 static struct clk_lookup lookups[] = {
@@ -386,6 +554,9 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("pll2s",                  &pll2s_clk),
        CLKDEV_CON_ID("pll2h",                  &pll2h_clk),
 
+       /* CPU clock */
+       CLKDEV_DEV_ID("cpufreq-cpu0",           &z_clk),
+
        /* DIV6 */
        CLKDEV_CON_ID("zb",                     &div6_clks[DIV6_ZB]),
        CLKDEV_CON_ID("vck1",                   &div6_clks[DIV6_VCK1]),
@@ -408,6 +579,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP216]),
        CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP217]),
        CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
+       CLKDEV_DEV_ID("e6520000.i2c", &mstp_clks[MSTP300]),
        CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
        CLKDEV_DEV_ID("ee220000.mmcif", &mstp_clks[MSTP305]),
        CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]),
@@ -418,6 +590,15 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("ee100000.sdhi", &mstp_clks[MSTP314]),
        CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
        CLKDEV_DEV_ID("ee200000.mmcif", &mstp_clks[MSTP315]),
+       CLKDEV_DEV_ID("e6550000.i2c", &mstp_clks[MSTP316]),
+       CLKDEV_DEV_ID("e6560000.i2c", &mstp_clks[MSTP317]),
+       CLKDEV_DEV_ID("e6500000.i2c", &mstp_clks[MSTP318]),
+       CLKDEV_DEV_ID("e6510000.i2c", &mstp_clks[MSTP323]),
+       CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]),
+       CLKDEV_DEV_ID("e60b0000.i2c", &mstp_clks[MSTP409]),
+       CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP410]),
+       CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP411]),
+       CLKDEV_DEV_ID("e6570000.i2c", &mstp_clks[MSTP515]),
 
        /* for DT */
        CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
@@ -429,6 +610,8 @@ void __init r8a73a4_clock_init(void)
        int k, ret = 0;
        u32 ckscr;
 
+       atomic_set(&frqcr_lock, -1);
+
        reg = ioremap_nocache(CKSCR, PAGE_SIZE);
        BUG_ON(!reg);
        ckscr = ioread32(reg);
index de10fd7..c826bca 100644 (file)
@@ -596,7 +596,8 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("e6bd0000.mmcif",         &mstp_clks[MSTP312]),
        CLKDEV_DEV_ID("r8a7740-gether",         &mstp_clks[MSTP309]),
        CLKDEV_DEV_ID("e9a00000.sh-eth",        &mstp_clks[MSTP309]),
-       CLKDEV_DEV_ID("renesas_tpu_pwm",        &mstp_clks[MSTP304]),
+       CLKDEV_DEV_ID("renesas-tpu-pwm",        &mstp_clks[MSTP304]),
+       CLKDEV_DEV_ID("e6600000.pwm",           &mstp_clks[MSTP304]),
 
        CLKDEV_DEV_ID("sh_mobile_sdhi.2",       &mstp_clks[MSTP415]),
        CLKDEV_DEV_ID("e6870000.sdhi",          &mstp_clks[MSTP415]),
index 5d71313..fc36d3d 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/clkdev.h>
 #include <mach/clock.h>
 #include <mach/common.h>
+#include <mach/r8a7790.h>
 
 /*
  *   MD                EXTAL           PLL0    PLL1    PLL3
  *     see "p1 / 2" on R8A7790_CLOCK_ROOT() below
  */
 
-#define MD(nr) (1 << nr)
-
 #define CPG_BASE 0xe6150000
 #define CPG_LEN 0x1000
 
+#define SMSTPCR1 0xe6150134
 #define SMSTPCR2 0xe6150138
 #define SMSTPCR3 0xe615013c
+#define SMSTPCR5 0xe6150144
 #define SMSTPCR7 0xe615014c
+#define SMSTPCR8 0xe6150990
 
-#define MODEMR         0xE6160060
 #define SDCKCR         0xE6150074
 #define SD2CKCR                0xE6150078
 #define SD3CKCR                0xE615007C
@@ -180,16 +181,23 @@ static struct clk div6_clks[DIV6_NR] = {
 
 /* MSTP */
 enum {
+       MSTP813,
        MSTP721, MSTP720,
        MSTP717, MSTP716,
+       MSTP522,
        MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
        MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
+       MSTP124,
        MSTP_NR
 };
 
 static struct clk mstp_clks[MSTP_NR] = {
+       [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
        [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
        [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
+       [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
+       [MSTP716] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */
+       [MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */
        [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, 0), /* MMC0 */
        [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_SD0], SMSTPCR3, 14, 0), /* SDHI0 */
        [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_SD1], SMSTPCR3, 13, 0), /* SDHI1 */
@@ -203,8 +211,7 @@ static struct clk mstp_clks[MSTP_NR] = {
        [MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
        [MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */
        [MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */
-       [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
-       [MSTP716] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */
+       [MSTP124] = SH_CLK_MSTP32(&rclk_clk, SMSTPCR1, 24, 0), /* CMT0 */
 };
 
 static struct clk_lookup lookups[] = {
@@ -254,6 +261,8 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
        CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
        CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
+       CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
+       CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
        CLKDEV_DEV_ID("ee200000.mmcif", &mstp_clks[MSTP315]),
        CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
        CLKDEV_DEV_ID("ee100000.sdhi", &mstp_clks[MSTP314]),
@@ -266,6 +275,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]),
        CLKDEV_DEV_ID("ee220000.mmcif", &mstp_clks[MSTP305]),
        CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
+       CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
 };
 
 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31)             \
@@ -280,14 +290,9 @@ static struct clk_lookup lookups[] = {
 
 void __init r8a7790_clock_init(void)
 {
-       void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
-       u32 mode;
+       u32 mode = r8a7790_read_mode_pins();
        int k, ret = 0;
 
-       BUG_ON(!modemr);
-       mode = ioread32(modemr);
-       iounmap(modemr);
-
        switch (mode & (MD(14) | MD(13))) {
        case 0:
                R8A7790_CLOCK_ROOT(15, &extal_clk, 172, 208, 106, 88);
index d9fd033..1942eae 100644 (file)
@@ -555,7 +555,7 @@ enum { MSTP001,
        MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
        MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, MSTP322,
        MSTP314, MSTP313, MSTP312, MSTP311,
-       MSTP303, MSTP302, MSTP301, MSTP300,
+       MSTP304, MSTP303, MSTP302, MSTP301, MSTP300,
        MSTP411, MSTP410, MSTP403,
        MSTP_NR };
 
@@ -593,6 +593,7 @@ static struct clk mstp_clks[MSTP_NR] = {
        [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */
        [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
        [MSTP311] = MSTP(&div6_clks[DIV6_SDHI2], SMSTPCR3, 11, 0), /* SDHI2 */
+       [MSTP304] = MSTP(&main_div2_clk, SMSTPCR3, 4, 0), /* TPU0 */
        [MSTP303] = MSTP(&main_div2_clk, SMSTPCR3, 3, 0), /* TPU1 */
        [MSTP302] = MSTP(&main_div2_clk, SMSTPCR3, 2, 0), /* TPU2 */
        [MSTP301] = MSTP(&main_div2_clk, SMSTPCR3, 1, 0), /* TPU3 */
@@ -669,10 +670,11 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]), /* MMCIF0 */
        CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */
        CLKDEV_DEV_ID("ee140000.sdhi", &mstp_clks[MSTP311]), /* SDHI2 */
-       CLKDEV_DEV_ID("leds-renesas-tpu.12", &mstp_clks[MSTP303]), /* TPU1 */
-       CLKDEV_DEV_ID("leds-renesas-tpu.21", &mstp_clks[MSTP302]), /* TPU2 */
-       CLKDEV_DEV_ID("leds-renesas-tpu.30", &mstp_clks[MSTP301]), /* TPU3 */
-       CLKDEV_DEV_ID("leds-renesas-tpu.41", &mstp_clks[MSTP300]), /* TPU4 */
+       CLKDEV_DEV_ID("renesas-tpu-pwm.0", &mstp_clks[MSTP304]), /* TPU0 */
+       CLKDEV_DEV_ID("renesas-tpu-pwm.1", &mstp_clks[MSTP303]), /* TPU1 */
+       CLKDEV_DEV_ID("renesas-tpu-pwm.2", &mstp_clks[MSTP302]), /* TPU2 */
+       CLKDEV_DEV_ID("renesas-tpu-pwm.3", &mstp_clks[MSTP301]), /* TPU3 */
+       CLKDEV_DEV_ID("renesas-tpu-pwm.4", &mstp_clks[MSTP300]), /* TPU4 */
        CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
        CLKDEV_DEV_ID("e6826000.i2c", &mstp_clks[MSTP411]), /* I2C3 */
        CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
index bfd9200..f45dde7 100644 (file)
@@ -37,13 +37,15 @@ ENTRY(shmobile_boot_scu)
        lsl     r1, r1, #3              @ we will shift by cpu_id * 8 bits
        ldr     r2, [r0, #8]            @ SCU Power Status Register
        mov     r3, #3
-       bic     r2, r2, r3, lsl r1      @ Clear bits of our CPU (Run Mode)
+       lsl     r3, r3, r1
+       bic     r2, r2, r3              @ Clear bits of our CPU (Run Mode)
        str     r2, [r0, #8]            @ write back
 
        b       shmobile_invalidate_start
 ENDPROC(shmobile_boot_scu)
 
        .text
+       .align  2
        .globl  shmobile_scu_base
 shmobile_scu_base:
        .space  4
index a9d2124..2667db8 100644 (file)
@@ -24,12 +24,16 @@ ENDPROC(shmobile_invalidate_start)
  * This will be mapped at address 0 by SBAR register.
  * We need _long_ jump to the physical address.
  */
+       .arm
        .align  12
 ENTRY(shmobile_boot_vector)
        ldr     r0, 2f
-       ldr     pc, 1f
+       ldr     r1, 1f
+       bx      r1
+
 ENDPROC(shmobile_boot_vector)
 
+       .align  2
        .globl  shmobile_boot_fn
 shmobile_boot_fn:
 1:     .space  4
diff --git a/arch/arm/mach-shmobile/include/mach/dma.h b/arch/arm/mach-shmobile/include/mach/dma.h
deleted file mode 100644 (file)
index 40a8c17..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/* empty */
index ac37517..c2eb756 100644 (file)
@@ -2,11 +2,9 @@
 #define __ASM_EMEV2_H__
 
 extern void emev2_map_io(void);
-extern void emev2_init_irq(void);
-extern void emev2_add_early_devices(void);
+extern void emev2_init_delay(void);
 extern void emev2_add_standard_devices(void);
 extern void emev2_clock_init(void);
-extern void emev2_set_boot_vector(unsigned long value);
 
 #define EMEV2_GPIO_BASE 200
 #define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n))
index f043103..144a85e 100644 (file)
@@ -4,5 +4,6 @@
 void r8a73a4_add_standard_devices(void);
 void r8a73a4_clock_init(void);
 void r8a73a4_pinmux_init(void);
+void r8a73a4_init_delay(void);
 
 #endif /* __ASM_R8A73A4_H__ */
index b34d19b..56f3750 100644 (file)
@@ -42,6 +42,8 @@ enum {
        SHDMA_SLAVE_FSIB_TX,
        SHDMA_SLAVE_USBHS_TX,
        SHDMA_SLAVE_USBHS_RX,
+       SHDMA_SLAVE_MMCIF_TX,
+       SHDMA_SLAVE_MMCIF_RX,
 };
 
 extern void r8a7740_meram_workaround(void);
index a7c6d15..2866704 100644 (file)
@@ -36,7 +36,6 @@ extern void r8a7778_add_vin_device(int id,
 
 extern void r8a7778_init_late(void);
 extern void r8a7778_init_delay(void);
-extern void r8a7778_init_irq(void);
 extern void r8a7778_init_irq_dt(void);
 extern void r8a7778_clock_init(void);
 extern void r8a7778_init_irq_extpin(int irlm);
index 2e919e6..7aaef40 100644 (file)
@@ -4,6 +4,10 @@
 void r8a7790_add_standard_devices(void);
 void r8a7790_clock_init(void);
 void r8a7790_pinmux_init(void);
+void r8a7790_init_delay(void);
 void r8a7790_timer_init(void);
 
+#define MD(nr) BIT(nr)
+u32 r8a7790_read_mode_pins(void);
+
 #endif /* __ASM_R8A7790_H__ */
index eb7a432..680dc5f 100644 (file)
@@ -1,378 +1,7 @@
 #ifndef __ASM_SH73A0_H__
 #define __ASM_SH73A0_H__
 
-/* Pin Function Controller:
- * GPIO_FN_xx - GPIO used to select pin function and MSEL switch
- * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
- */
-enum {
-       /* Hardware manual Table 25-1 (GPIO) */
-       GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
-       GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
-
-       GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
-       GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
-
-       GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
-       GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
-
-       GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
-       GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
-
-       GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
-       GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
-
-       GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
-       GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
-
-       GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
-       GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
-
-       GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
-       GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
-
-       GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
-       GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
-
-       GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
-       GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
-
-       GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
-       GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
-
-       GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
-       GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118,
-
-       GPIO_PORT128, GPIO_PORT129,
-
-       GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
-       GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
-
-       GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
-       GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
-
-       GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
-       GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
-
-       GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
-
-       GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
-       GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
-
-       GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
-       GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
-
-       GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
-       GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
-
-       GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
-       GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
-
-       GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
-       GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
-
-       GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
-       GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
-
-       GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
-       GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
-
-       GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
-       GPIO_PORT265, GPIO_PORT266, GPIO_PORT267, GPIO_PORT268, GPIO_PORT269,
-
-       GPIO_PORT270, GPIO_PORT271, GPIO_PORT272, GPIO_PORT273, GPIO_PORT274,
-       GPIO_PORT275, GPIO_PORT276, GPIO_PORT277, GPIO_PORT278, GPIO_PORT279,
-
-       GPIO_PORT280, GPIO_PORT281, GPIO_PORT282,
-
-       GPIO_PORT288, GPIO_PORT289,
-
-       GPIO_PORT290, GPIO_PORT291, GPIO_PORT292, GPIO_PORT293, GPIO_PORT294,
-       GPIO_PORT295, GPIO_PORT296, GPIO_PORT297, GPIO_PORT298, GPIO_PORT299,
-
-       GPIO_PORT300, GPIO_PORT301, GPIO_PORT302, GPIO_PORT303, GPIO_PORT304,
-       GPIO_PORT305, GPIO_PORT306, GPIO_PORT307, GPIO_PORT308, GPIO_PORT309,
-
-       /* Table 25-1 (Function 0-7) */
-       GPIO_FN_GPI0 = 310,
-       GPIO_FN_GPI1,
-       GPIO_FN_GPI2,
-       GPIO_FN_GPI3,
-       GPIO_FN_GPI4,
-       GPIO_FN_GPI5,
-       GPIO_FN_GPI6,
-       GPIO_FN_GPI7,
-       GPIO_FN_GPO7, GPIO_FN_MFG0_OUT2,
-       GPIO_FN_GPO6, GPIO_FN_MFG1_OUT2,
-       GPIO_FN_GPO5,
-       GPIO_FN_PORT16_VIO_CKOR,
-       GPIO_FN_PORT19_VIO_CKO2,
-       GPIO_FN_GPO0,
-       GPIO_FN_GPO1,
-       GPIO_FN_GPO2, GPIO_FN_STATUS0,
-       GPIO_FN_GPO3, GPIO_FN_STATUS1,
-       GPIO_FN_GPO4, GPIO_FN_STATUS2,
-       GPIO_FN_VINT,
-       GPIO_FN_TCKON,
-       GPIO_FN_XDVFS1,
-       GPIO_FN_MFG0_OUT1, GPIO_FN_PORT27_IROUT,
-       GPIO_FN_XDVFS2,
-       GPIO_FN_PORT28_TPU1TO1,
-       GPIO_FN_SIM_RST, GPIO_FN_PORT29_TPU1TO1,
-       GPIO_FN_SIM_CLK, GPIO_FN_PORT30_VIO_CKOR,
-       GPIO_FN_SIM_D, GPIO_FN_PORT31_IROUT,
-       GPIO_FN_XWUP,
-       GPIO_FN_VACK,
-       GPIO_FN_XTAL1L,
-       GPIO_FN_PORT49_IROUT,
-       GPIO_FN_BBIF2_TSYNC2, GPIO_FN_TPU2TO2,
-
-       GPIO_FN_BBIF2_TSCK2, GPIO_FN_TPU2TO3,
-       GPIO_FN_BBIF2_TXD2,
-       GPIO_FN_TPU3TO3,
-       GPIO_FN_TPU3TO2,
-       GPIO_FN_TPU0TO0,
-       GPIO_FN_A0, GPIO_FN_BS_,
-       GPIO_FN_A12, GPIO_FN_TPU4TO2,
-       GPIO_FN_A13, GPIO_FN_TPU0TO1,
-       GPIO_FN_A14,
-       GPIO_FN_A15,
-       GPIO_FN_A16, GPIO_FN_MSIOF0_SS1,
-       GPIO_FN_A17, GPIO_FN_MSIOF0_TSYNC,
-       GPIO_FN_A18, GPIO_FN_MSIOF0_TSCK,
-       GPIO_FN_A19, GPIO_FN_MSIOF0_TXD,
-       GPIO_FN_A20, GPIO_FN_MSIOF0_RSCK,
-       GPIO_FN_A21, GPIO_FN_MSIOF0_RSYNC,
-       GPIO_FN_A22, GPIO_FN_MSIOF0_MCK0,
-       GPIO_FN_A23, GPIO_FN_MSIOF0_MCK1,
-       GPIO_FN_A24, GPIO_FN_MSIOF0_RXD,
-       GPIO_FN_A25, GPIO_FN_MSIOF0_SS2,
-       GPIO_FN_A26,
-       GPIO_FN_FCE1_,
-       GPIO_FN_DACK0,
-       GPIO_FN_FCE0_,
-       GPIO_FN_WAIT_, GPIO_FN_DREQ0,
-       GPIO_FN_FRB,
-       GPIO_FN_CKO,
-       GPIO_FN_NBRSTOUT_,
-       GPIO_FN_NBRST_,
-       GPIO_FN_BBIF2_TXD,
-       GPIO_FN_BBIF2_RXD,
-       GPIO_FN_BBIF2_SYNC,
-       GPIO_FN_BBIF2_SCK,
-       GPIO_FN_MFG3_IN2,
-       GPIO_FN_MFG3_IN1,
-       GPIO_FN_BBIF1_SS2, GPIO_FN_MFG3_OUT1,
-       GPIO_FN_HSI_RX_DATA, GPIO_FN_BBIF1_RXD,
-       GPIO_FN_HSI_TX_WAKE, GPIO_FN_BBIF1_TSCK,
-       GPIO_FN_HSI_TX_DATA, GPIO_FN_BBIF1_TSYNC,
-       GPIO_FN_HSI_TX_READY, GPIO_FN_BBIF1_TXD,
-       GPIO_FN_HSI_RX_READY, GPIO_FN_BBIF1_RSCK,
-       GPIO_FN_HSI_RX_WAKE, GPIO_FN_BBIF1_RSYNC,
-       GPIO_FN_HSI_RX_FLAG, GPIO_FN_BBIF1_SS1, GPIO_FN_BBIF1_FLOW,
-       GPIO_FN_HSI_TX_FLAG,
-       GPIO_FN_VIO_VD, GPIO_FN_VIO2_VD,
-
-       GPIO_FN_VIO_HD,
-       GPIO_FN_VIO2_HD,
-       GPIO_FN_VIO_D0, GPIO_FN_PORT130_MSIOF2_RXD,
-       GPIO_FN_VIO_D1, GPIO_FN_PORT131_MSIOF2_SS1,
-       GPIO_FN_VIO_D2, GPIO_FN_PORT132_MSIOF2_SS2,
-       GPIO_FN_VIO_D3, GPIO_FN_MSIOF2_TSYNC,
-       GPIO_FN_VIO_D4, GPIO_FN_MSIOF2_TXD,
-       GPIO_FN_VIO_D5, GPIO_FN_MSIOF2_TSCK,
-       GPIO_FN_VIO_D6,
-       GPIO_FN_VIO_D7,
-       GPIO_FN_VIO_D8, GPIO_FN_VIO2_D0,
-       GPIO_FN_VIO_D9, GPIO_FN_VIO2_D1,
-       GPIO_FN_VIO_D10, GPIO_FN_TPU0TO2, GPIO_FN_VIO2_D2,
-       GPIO_FN_VIO_D11, GPIO_FN_TPU0TO3, GPIO_FN_VIO2_D3,
-       GPIO_FN_VIO_D12, GPIO_FN_VIO2_D4,
-       GPIO_FN_VIO_D13,
-       GPIO_FN_VIO2_D5,
-       GPIO_FN_VIO_D14, GPIO_FN_VIO2_D6,
-       GPIO_FN_VIO_D15, GPIO_FN_TPU1TO3,
-       GPIO_FN_VIO2_D7,
-       GPIO_FN_VIO_CLK,
-       GPIO_FN_VIO2_CLK,
-       GPIO_FN_VIO_FIELD, GPIO_FN_VIO2_FIELD,
-       GPIO_FN_VIO_CKO,
-       GPIO_FN_A27, GPIO_FN_MFG0_IN1,
-       GPIO_FN_MFG0_IN2,
-       GPIO_FN_TS_SPSYNC3, GPIO_FN_MSIOF2_RSCK,
-       GPIO_FN_TS_SDAT3, GPIO_FN_MSIOF2_RSYNC,
-       GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT153_MSIOF2_SS1,
-       GPIO_FN_MSIOF2_MCK0,
-       GPIO_FN_MSIOF2_MCK1,
-       GPIO_FN_PORT156_MSIOF2_SS2,
-       GPIO_FN_PORT157_MSIOF2_RXD,
-       GPIO_FN_DINT_, GPIO_FN_TS_SCK3,
-       GPIO_FN_NMI,
-       GPIO_FN_TPU3TO0,
-       GPIO_FN_BBIF2_TSYNC1,
-       GPIO_FN_BBIF2_TSCK1,
-       GPIO_FN_BBIF2_TXD1,
-       GPIO_FN_MFG2_OUT2,
-       GPIO_FN_TPU2TO1,
-       GPIO_FN_TPU4TO1, GPIO_FN_MFG4_OUT2,
-       GPIO_FN_D16,
-       GPIO_FN_D17,
-       GPIO_FN_D18,
-       GPIO_FN_D19,
-       GPIO_FN_D20,
-       GPIO_FN_D21,
-       GPIO_FN_D22,
-       GPIO_FN_PORT207_MSIOF0L_SS1, GPIO_FN_D23,
-       GPIO_FN_PORT208_MSIOF0L_SS2, GPIO_FN_D24,
-       GPIO_FN_D25,
-       GPIO_FN_DREQ2, GPIO_FN_PORT210_MSIOF0L_SS1, GPIO_FN_D26,
-       GPIO_FN_PORT211_MSIOF0L_SS2, GPIO_FN_D27,
-       GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0, GPIO_FN_D28,
-       GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1, GPIO_FN_D29,
-       GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_RSCK, GPIO_FN_D30,
-       GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_RSYNC, GPIO_FN_D31,
-       GPIO_FN_DACK2,
-       GPIO_FN_MSIOF0L_TSYNC, GPIO_FN_VIO2_FIELD3,
-       GPIO_FN_DACK3,
-       GPIO_FN_PORT218_VIO_CKOR,
-       GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_TSCK, GPIO_FN_VIO2_CLK3, \
-       GPIO_FN_DREQ1,
-       GPIO_FN_PWEN, GPIO_FN_MSIOF0L_RXD, GPIO_FN_VIO2_HD3, \
-       GPIO_FN_DACK1, GPIO_FN_OVCN,
-       GPIO_FN_MSIOF0L_TXD, GPIO_FN_VIO2_VD3,
-
-       GPIO_FN_OVCN2,
-       GPIO_FN_EXTLP, GPIO_FN_PORT226_VIO_CKO2,
-       GPIO_FN_IDIN,
-       GPIO_FN_MFG1_IN1,
-       GPIO_FN_MSIOF1_TXD,
-       GPIO_FN_MSIOF1_TSYNC,
-       GPIO_FN_MSIOF1_TSCK,
-       GPIO_FN_MSIOF1_RXD,
-       GPIO_FN_MSIOF1_RSCK, GPIO_FN_VIO2_CLK2,
-       GPIO_FN_MSIOF1_RSYNC, GPIO_FN_MFG1_IN2, GPIO_FN_VIO2_VD2, \
-       GPIO_FN_MSIOF1_MCK0,
-       GPIO_FN_MSIOF1_MCK1,
-       GPIO_FN_MSIOF1_SS1, GPIO_FN_VIO2_FIELD2,
-       GPIO_FN_MSIOF1_SS2, GPIO_FN_VIO2_HD2,
-       GPIO_FN_PORT241_IROUT, GPIO_FN_MFG4_OUT1, \
-       GPIO_FN_TPU4TO0,
-       GPIO_FN_MFG4_IN2,
-       GPIO_FN_PORT243_VIO_CKO2,
-       GPIO_FN_MFG2_IN1,
-       GPIO_FN_MSIOF2R_RXD,
-       GPIO_FN_MFG2_IN2,
-       GPIO_FN_MSIOF2R_TXD,
-       GPIO_FN_MFG1_OUT1,
-       GPIO_FN_TPU1TO0,
-       GPIO_FN_MFG3_OUT2,
-       GPIO_FN_TPU3TO1,
-       GPIO_FN_MFG2_OUT1,
-       GPIO_FN_TPU2TO0,
-       GPIO_FN_MSIOF2R_TSCK,
-       GPIO_FN_PORT249_IROUT, GPIO_FN_MFG4_IN1, \
-       GPIO_FN_MSIOF2R_TSYNC,
-       GPIO_FN_SDHICLK0,
-       GPIO_FN_SDHICD0,
-       GPIO_FN_SDHID0_0,
-       GPIO_FN_SDHID0_1,
-       GPIO_FN_SDHID0_2,
-       GPIO_FN_SDHID0_3,
-       GPIO_FN_SDHICMD0,
-       GPIO_FN_SDHIWP0,
-       GPIO_FN_SDHICLK1,
-       GPIO_FN_SDHID1_0, GPIO_FN_TS_SPSYNC2,
-       GPIO_FN_SDHID1_1, GPIO_FN_TS_SDAT2,
-       GPIO_FN_SDHID1_2, GPIO_FN_TS_SDEN2,
-       GPIO_FN_SDHID1_3, GPIO_FN_TS_SCK2,
-       GPIO_FN_SDHICMD1,
-       GPIO_FN_SDHICLK2,
-       GPIO_FN_SDHID2_0, GPIO_FN_TS_SPSYNC4,
-       GPIO_FN_SDHID2_1, GPIO_FN_TS_SDAT4,
-       GPIO_FN_SDHID2_2, GPIO_FN_TS_SDEN4,
-       GPIO_FN_SDHID2_3, GPIO_FN_TS_SCK4,
-       GPIO_FN_SDHICMD2,
-       GPIO_FN_MMCCLK0,
-       GPIO_FN_MMCD0_0,
-       GPIO_FN_MMCD0_1,
-       GPIO_FN_MMCD0_2,
-       GPIO_FN_MMCD0_3,
-       GPIO_FN_MMCD0_4, GPIO_FN_TS_SPSYNC5,
-       GPIO_FN_MMCD0_5, GPIO_FN_TS_SDAT5,
-       GPIO_FN_MMCD0_6, GPIO_FN_TS_SDEN5,
-       GPIO_FN_MMCD0_7, GPIO_FN_TS_SCK5,
-       GPIO_FN_MMCCMD0,
-       GPIO_FN_RESETOUTS_, GPIO_FN_EXTAL2OUT,
-       GPIO_FN_MCP_WAIT__MCP_FRB,
-       GPIO_FN_MCP_CKO, GPIO_FN_MMCCLK1,
-       GPIO_FN_MCP_D15_MCP_NAF15,
-       GPIO_FN_MCP_D14_MCP_NAF14,
-       GPIO_FN_MCP_D13_MCP_NAF13,
-       GPIO_FN_MCP_D12_MCP_NAF12,
-       GPIO_FN_MCP_D11_MCP_NAF11,
-       GPIO_FN_MCP_D10_MCP_NAF10,
-       GPIO_FN_MCP_D9_MCP_NAF9,
-       GPIO_FN_MCP_D8_MCP_NAF8, GPIO_FN_MMCCMD1,
-       GPIO_FN_MCP_D7_MCP_NAF7, GPIO_FN_MMCD1_7,
-
-       GPIO_FN_MCP_D6_MCP_NAF6, GPIO_FN_MMCD1_6,
-       GPIO_FN_MCP_D5_MCP_NAF5, GPIO_FN_MMCD1_5,
-       GPIO_FN_MCP_D4_MCP_NAF4, GPIO_FN_MMCD1_4,
-       GPIO_FN_MCP_D3_MCP_NAF3, GPIO_FN_MMCD1_3,
-       GPIO_FN_MCP_D2_MCP_NAF2, GPIO_FN_MMCD1_2,
-       GPIO_FN_MCP_D1_MCP_NAF1, GPIO_FN_MMCD1_1,
-       GPIO_FN_MCP_D0_MCP_NAF0, GPIO_FN_MMCD1_0,
-       GPIO_FN_MCP_NBRSTOUT_,
-       GPIO_FN_MCP_WE0__MCP_FWE, GPIO_FN_MCP_RDWR_MCP_FWE,
-
-       /* MSEL2 special case */
-       GPIO_FN_TSIF2_TS_XX1,
-       GPIO_FN_TSIF2_TS_XX2,
-       GPIO_FN_TSIF2_TS_XX3,
-       GPIO_FN_TSIF2_TS_XX4,
-       GPIO_FN_TSIF2_TS_XX5,
-       GPIO_FN_TSIF1_TS_XX1,
-       GPIO_FN_TSIF1_TS_XX2,
-       GPIO_FN_TSIF1_TS_XX3,
-       GPIO_FN_TSIF1_TS_XX4,
-       GPIO_FN_TSIF1_TS_XX5,
-       GPIO_FN_TSIF0_TS_XX1,
-       GPIO_FN_TSIF0_TS_XX2,
-       GPIO_FN_TSIF0_TS_XX3,
-       GPIO_FN_TSIF0_TS_XX4,
-       GPIO_FN_TSIF0_TS_XX5,
-       GPIO_FN_MST1_TS_XX1,
-       GPIO_FN_MST1_TS_XX2,
-       GPIO_FN_MST1_TS_XX3,
-       GPIO_FN_MST1_TS_XX4,
-       GPIO_FN_MST1_TS_XX5,
-       GPIO_FN_MST0_TS_XX1,
-       GPIO_FN_MST0_TS_XX2,
-       GPIO_FN_MST0_TS_XX3,
-       GPIO_FN_MST0_TS_XX4,
-       GPIO_FN_MST0_TS_XX5,
-
-       /* MSEL3 special cases */
-       GPIO_FN_SDHI0_VCCQ_MC0_ON,
-       GPIO_FN_SDHI0_VCCQ_MC0_OFF,
-       GPIO_FN_DEBUG_MON_VIO,
-       GPIO_FN_DEBUG_MON_LCDD,
-       GPIO_FN_LCDC_LCDC0,
-       GPIO_FN_LCDC_LCDC1,
-
-       /* MSEL4 special cases */
-       GPIO_FN_IRQ9_MEM_INT,
-       GPIO_FN_IRQ9_MCP_INT,
-       GPIO_FN_A11,
-       GPIO_FN_TPU4TO3,
-       GPIO_FN_RESETA_N_PU_ON,
-       GPIO_FN_RESETA_N_PU_OFF,
-       GPIO_FN_EDBGREQ_PD,
-       GPIO_FN_EDBGREQ_PU,
-
-       /* end of GPIO */
-       GPIO_NR,
-};
+#define GPIO_NR                        310
 
 /* DMA slave IDs */
 enum {
index f2d8744..c3c4669 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef ZBOOT_H
 #define ZBOOT_H
 
-#include <asm/mach-types.h>
 #include <mach/zboot_macros.h>
 
 /**************************************************
@@ -11,7 +10,6 @@
  **************************************************/
 
 #ifdef CONFIG_MACH_MACKEREL
-#define MACH_TYPE      MACH_TYPE_MACKEREL
 #define MEMORY_START   0x40000000
 #include "mach/head-mackerel.txt"
 #else
index 1ccddd2..1553af8 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
-#include <linux/irqchip.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/gpio-em.h>
 #include <linux/of_platform.h>
 
 static struct map_desc emev2_io_desc[] __initdata = {
 #ifdef CONFIG_SMP
-       /* 128K entity map for 0xe0100000 (SMU) */
-       {
-               .virtual        = 0xe0100000,
-               .pfn            = __phys_to_pfn(0xe0100000),
-               .length         = SZ_128K,
-               .type           = MT_DEVICE
-       },
        /* 2M mapping for SCU + L2 controller */
        {
                .virtual        = 0xf0000000,
@@ -63,102 +55,40 @@ void __init emev2_map_io(void)
 
 /* UART */
 static struct resource uart0_resources[] = {
-       [0]     = {
-               .start  = 0xe1020000,
-               .end    = 0xe1020037,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = 40,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-
-static struct platform_device uart0_device = {
-       .name           = "serial8250-em",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(uart0_resources),
-       .resource       = uart0_resources,
+       DEFINE_RES_MEM(0xe1020000, 0x38),
+       DEFINE_RES_IRQ(40),
 };
 
 static struct resource uart1_resources[] = {
-       [0]     = {
-               .start  = 0xe1030000,
-               .end    = 0xe1030037,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = 41,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-
-static struct platform_device uart1_device = {
-       .name           = "serial8250-em",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(uart1_resources),
-       .resource       = uart1_resources,
+       DEFINE_RES_MEM(0xe1030000, 0x38),
+       DEFINE_RES_IRQ(41),
 };
 
 static struct resource uart2_resources[] = {
-       [0]     = {
-               .start  = 0xe1040000,
-               .end    = 0xe1040037,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = 42,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-
-static struct platform_device uart2_device = {
-       .name           = "serial8250-em",
-       .id             = 2,
-       .num_resources  = ARRAY_SIZE(uart2_resources),
-       .resource       = uart2_resources,
+       DEFINE_RES_MEM(0xe1040000, 0x38),
+       DEFINE_RES_IRQ(42),
 };
 
 static struct resource uart3_resources[] = {
-       [0]     = {
-               .start  = 0xe1050000,
-               .end    = 0xe1050037,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1]     = {
-               .start  = 43,
-               .flags  = IORESOURCE_IRQ,
-       }
+       DEFINE_RES_MEM(0xe1050000, 0x38),
+       DEFINE_RES_IRQ(43),
 };
 
-static struct platform_device uart3_device = {
-       .name           = "serial8250-em",
-       .id             = 3,
-       .num_resources  = ARRAY_SIZE(uart3_resources),
-       .resource       = uart3_resources,
-};
+#define emev2_register_uart(idx)                                       \
+       platform_device_register_simple("serial8250-em", idx,           \
+                                       uart##idx##_resources,          \
+                                       ARRAY_SIZE(uart##idx##_resources))
 
 /* STI */
 static struct resource sti_resources[] = {
-       [0] = {
-               .name   = "STI",
-               .start  = 0xe0180000,
-               .end    = 0xe0180053,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 157,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device sti_device = {
-       .name           = "em_sti",
-       .id             = 0,
-       .resource       = sti_resources,
-       .num_resources  = ARRAY_SIZE(sti_resources),
+       DEFINE_RES_MEM(0xe0180000, 0x54),
+       DEFINE_RES_IRQ(157),
 };
 
+#define emev2_register_sti()                                   \
+       platform_device_register_simple("em_sti", 0,            \
+                                       sti_resources,          \
+                                       ARRAY_SIZE(sti_resources))
 
 /* GIO */
 static struct gpio_em_config gio0_config = {
@@ -168,36 +98,10 @@ static struct gpio_em_config gio0_config = {
 };
 
 static struct resource gio0_resources[] = {
-       [0] = {
-               .name   = "GIO_000",
-               .start  = 0xe0050000,
-               .end    = 0xe005002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "GIO_000",
-               .start  = 0xe0050040,
-               .end    = 0xe005005f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = 99,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [3] = {
-               .start  = 100,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device gio0_device = {
-       .name           = "em_gio",
-       .id             = 0,
-       .resource       = gio0_resources,
-       .num_resources  = ARRAY_SIZE(gio0_resources),
-       .dev            = {
-               .platform_data  = &gio0_config,
-       },
+       DEFINE_RES_MEM(0xe0050000, 0x2c),
+       DEFINE_RES_MEM(0xe0050040, 0x20),
+       DEFINE_RES_IRQ(99),
+       DEFINE_RES_IRQ(100),
 };
 
 static struct gpio_em_config gio1_config = {
@@ -207,36 +111,10 @@ static struct gpio_em_config gio1_config = {
 };
 
 static struct resource gio1_resources[] = {
-       [0] = {
-               .name   = "GIO_032",
-               .start  = 0xe0050080,
-               .end    = 0xe00500ab,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "GIO_032",
-               .start  = 0xe00500c0,
-               .end    = 0xe00500df,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = 101,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [3] = {
-               .start  = 102,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device gio1_device = {
-       .name           = "em_gio",
-       .id             = 1,
-       .resource       = gio1_resources,
-       .num_resources  = ARRAY_SIZE(gio1_resources),
-       .dev            = {
-               .platform_data  = &gio1_config,
-       },
+       DEFINE_RES_MEM(0xe0050080, 0x2c),
+       DEFINE_RES_MEM(0xe00500c0, 0x20),
+       DEFINE_RES_IRQ(101),
+       DEFINE_RES_IRQ(102),
 };
 
 static struct gpio_em_config gio2_config = {
@@ -246,36 +124,10 @@ static struct gpio_em_config gio2_config = {
 };
 
 static struct resource gio2_resources[] = {
-       [0] = {
-               .name   = "GIO_064",
-               .start  = 0xe0050100,
-               .end    = 0xe005012b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "GIO_064",
-               .start  = 0xe0050140,
-               .end    = 0xe005015f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = 103,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [3] = {
-               .start  = 104,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device gio2_device = {
-       .name           = "em_gio",
-       .id             = 2,
-       .resource       = gio2_resources,
-       .num_resources  = ARRAY_SIZE(gio2_resources),
-       .dev            = {
-               .platform_data  = &gio2_config,
-       },
+       DEFINE_RES_MEM(0xe0050100, 0x2c),
+       DEFINE_RES_MEM(0xe0050140, 0x20),
+       DEFINE_RES_IRQ(103),
+       DEFINE_RES_IRQ(104),
 };
 
 static struct gpio_em_config gio3_config = {
@@ -285,36 +137,10 @@ static struct gpio_em_config gio3_config = {
 };
 
 static struct resource gio3_resources[] = {
-       [0] = {
-               .name   = "GIO_096",
-               .start  = 0xe0050180,
-               .end    = 0xe00501ab,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "GIO_096",
-               .start  = 0xe00501c0,
-               .end    = 0xe00501df,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = 105,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [3] = {
-               .start  = 106,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device gio3_device = {
-       .name           = "em_gio",
-       .id             = 3,
-       .resource       = gio3_resources,
-       .num_resources  = ARRAY_SIZE(gio3_resources),
-       .dev            = {
-               .platform_data  = &gio3_config,
-       },
+       DEFINE_RES_MEM(0xe0050180, 0x2c),
+       DEFINE_RES_MEM(0xe00501c0, 0x20),
+       DEFINE_RES_IRQ(105),
+       DEFINE_RES_IRQ(106),
 };
 
 static struct gpio_em_config gio4_config = {
@@ -324,126 +150,53 @@ static struct gpio_em_config gio4_config = {
 };
 
 static struct resource gio4_resources[] = {
-       [0] = {
-               .name   = "GIO_128",
-               .start  = 0xe0050200,
-               .end    = 0xe005022b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .name   = "GIO_128",
-               .start  = 0xe0050240,
-               .end    = 0xe005025f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [2] = {
-               .start  = 107,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [3] = {
-               .start  = 108,
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xe0050200, 0x2c),
+       DEFINE_RES_MEM(0xe0050240, 0x20),
+       DEFINE_RES_IRQ(107),
+       DEFINE_RES_IRQ(108),
 };
 
-static struct platform_device gio4_device = {
-       .name           = "em_gio",
-       .id             = 4,
-       .resource       = gio4_resources,
-       .num_resources  = ARRAY_SIZE(gio4_resources),
-       .dev            = {
-               .platform_data  = &gio4_config,
-       },
-};
+#define emev2_register_gio(idx)                                                \
+       platform_device_register_resndata(&platform_bus, "em_gio",      \
+                                         idx, gio##idx##_resources,    \
+                                         ARRAY_SIZE(gio##idx##_resources), \
+                                         &gio##idx##_config,           \
+                                         sizeof(struct gpio_em_config))
 
 static struct resource pmu_resources[] = {
-       [0] = {
-               .start  = 152,
-               .end    = 152,
-               .flags  = IORESOURCE_IRQ,
-       },
-       [1] = {
-               .start  = 153,
-               .end    = 153,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device pmu_device = {
-       .name           = "arm-pmu",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(pmu_resources),
-       .resource       = pmu_resources,
+       DEFINE_RES_IRQ(152),
+       DEFINE_RES_IRQ(153),
 };
 
-static struct platform_device *emev2_early_devices[] __initdata = {
-       &uart0_device,
-       &uart1_device,
-       &uart2_device,
-       &uart3_device,
-};
-
-static struct platform_device *emev2_late_devices[] __initdata = {
-       &sti_device,
-       &gio0_device,
-       &gio1_device,
-       &gio2_device,
-       &gio3_device,
-       &gio4_device,
-       &pmu_device,
-};
+#define emev2_register_pmu()                                   \
+       platform_device_register_simple("arm-pmu", -1,          \
+                                       pmu_resources,          \
+                                       ARRAY_SIZE(pmu_resources))
 
 void __init emev2_add_standard_devices(void)
 {
-       emev2_clock_init();
-
-       platform_add_devices(emev2_early_devices,
-                            ARRAY_SIZE(emev2_early_devices));
-
-       platform_add_devices(emev2_late_devices,
-                            ARRAY_SIZE(emev2_late_devices));
+       if (!IS_ENABLED(CONFIG_COMMON_CLK))
+               emev2_clock_init();
+
+       emev2_register_uart(0);
+       emev2_register_uart(1);
+       emev2_register_uart(2);
+       emev2_register_uart(3);
+       emev2_register_sti();
+       emev2_register_gio(0);
+       emev2_register_gio(1);
+       emev2_register_gio(2);
+       emev2_register_gio(3);
+       emev2_register_gio(4);
+       emev2_register_pmu();
 }
 
-static void __init emev2_init_delay(void)
+void __init emev2_init_delay(void)
 {
        shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */
 }
 
-void __init emev2_add_early_devices(void)
-{
-       emev2_init_delay();
-
-       early_platform_add_devices(emev2_early_devices,
-                                  ARRAY_SIZE(emev2_early_devices));
-
-       /* setup early console here as well */
-       shmobile_setup_console();
-}
-
-void __init emev2_init_irq(void)
-{
-       void __iomem *gic_dist_base;
-       void __iomem *gic_cpu_base;
-
-       /* Static mappings, never released */
-       gic_dist_base = ioremap(0xe0028000, PAGE_SIZE);
-       gic_cpu_base = ioremap(0xe0020000, PAGE_SIZE);
-       BUG_ON(!gic_dist_base || !gic_cpu_base);
-
-       /* Use GIC to handle interrupts */
-       gic_init(0, 29, gic_dist_base, gic_cpu_base);
-}
-
 #ifdef CONFIG_USE_OF
-static const struct of_dev_auxdata emev2_auxdata_lookup[] __initconst = {
-       { }
-};
-
-static void __init emev2_add_standard_devices_dt(void)
-{
-       of_platform_populate(NULL, of_default_bus_match_table,
-                            emev2_auxdata_lookup, NULL);
-}
 
 static const char *emev2_boards_compat_dt[] __initdata = {
        "renesas,emev2",
@@ -452,10 +205,8 @@ static const char *emev2_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
        .smp            = smp_ops(emev2_smp_ops),
+       .map_io         = emev2_map_io,
        .init_early     = emev2_init_delay,
-       .nr_irqs        = NR_IRQS_LEGACY,
-       .init_irq       = irqchip_init,
-       .init_machine   = emev2_add_standard_devices_dt,
        .dt_compat      = emev2_boards_compat_dt,
 MACHINE_END
 
index 7f45c2e..d533bd2 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include <linux/irq.h>
-#include <linux/irqchip.h>
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 #include <linux/platform_data/irq-renesas-irqc.h>
 #include <linux/serial_sci.h>
+#include <linux/sh_timer.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
 #include <mach/r8a73a4.h>
@@ -169,6 +169,25 @@ static const struct resource thermal0_resources[] = {
                                        thermal0_resources,             \
                                        ARRAY_SIZE(thermal0_resources))
 
+static struct sh_timer_config cmt10_platform_data = {
+       .name = "CMT10",
+       .timer_bit = 0,
+       .clockevent_rating = 80,
+};
+
+static struct resource cmt10_resources[] = {
+       DEFINE_RES_MEM(0xe6130010, 0x0c),
+       DEFINE_RES_MEM(0xe6130000, 0x04),
+       DEFINE_RES_IRQ(gic_spi(120)), /* CMT1_0 */
+};
+
+#define r8a7790_register_cmt(idx)                                      \
+       platform_device_register_resndata(&platform_bus, "sh_cmt",      \
+                                         idx, cmt##idx##_resources,    \
+                                         ARRAY_SIZE(cmt##idx##_resources), \
+                                         &cmt##idx##_platform_data,    \
+                                         sizeof(struct sh_timer_config))
+
 void __init r8a73a4_add_standard_devices(void)
 {
        r8a73a4_register_scif(SCIFA0);
@@ -180,11 +199,20 @@ void __init r8a73a4_add_standard_devices(void)
        r8a73a4_register_irqc(0);
        r8a73a4_register_irqc(1);
        r8a73a4_register_thermal();
+       r8a7790_register_cmt(10);
+}
+
+void __init r8a73a4_init_delay(void)
+{
+#ifndef CONFIG_ARM_ARCH_TIMER
+       shmobile_setup_delay(1500, 2, 4); /* Cortex-A15 @ 1500MHz */
+#endif
 }
 
 #ifdef CONFIG_USE_OF
 void __init r8a73a4_add_standard_devices_dt(void)
 {
+       platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -194,7 +222,7 @@ static const char *r8a73a4_boards_compat_dt[] __initdata = {
 };
 
 DT_MACHINE_START(R8A73A4_DT, "Generic R8A73A4 (Flattened Device Tree)")
-       .init_irq       = irqchip_init,
+       .init_early     = r8a73a4_init_delay,
        .init_machine   = r8a73a4_add_standard_devices_dt,
        .init_time      = shmobile_timer_init,
        .dt_compat      = r8a73a4_boards_compat_dt,
index 00c5a70..84c5bb6 100644 (file)
@@ -588,6 +588,16 @@ static const struct sh_dmae_slave_config r8a7740_dmae_slaves[] = {
                .addr           = 0xfe1f0064,
                .chcr           = CHCR_TX(XMIT_SZ_32BIT),
                .mid_rid        = 0xb5,
+       }, {
+               .slave_id       = SHDMA_SLAVE_MMCIF_TX,
+               .addr           = 0xe6bd0034,
+               .chcr           = CHCR_TX(XMIT_SZ_32BIT),
+               .mid_rid        = 0xd1,
+       }, {
+               .slave_id       = SHDMA_SLAVE_MMCIF_RX,
+               .addr           = 0xe6bd0034,
+               .chcr           = CHCR_RX(XMIT_SZ_32BIT),
+               .mid_rid        = 0xd2,
        },
 };
 
@@ -986,16 +996,22 @@ void __init r8a7740_add_early_devices(void)
 
 #ifdef CONFIG_USE_OF
 
-static const struct of_dev_auxdata r8a7740_auxdata_lookup[] __initconst = {
-       { }
-};
+void __init r8a7740_add_early_devices_dt(void)
+{
+       shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
+
+       early_platform_add_devices(r8a7740_early_devices,
+                                  ARRAY_SIZE(r8a7740_early_devices));
+
+       /* setup early console here as well */
+       shmobile_setup_console();
+}
 
 void __init r8a7740_add_standard_devices_dt(void)
 {
        platform_add_devices(r8a7740_devices_dt,
                            ARRAY_SIZE(r8a7740_devices_dt));
-       of_platform_populate(NULL, of_default_bus_match_table,
-                            r8a7740_auxdata_lookup, NULL);
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 void __init r8a7740_init_delay(void)
index 0174f05..203becf 100644 (file)
@@ -53,7 +53,7 @@
        .irqs           = SCIx_IRQ_MUXED(irq),                  \
 }
 
-static struct plat_sci_port scif_platform_data[] = {
+static struct plat_sci_port scif_platform_data[] __initdata = {
        SCIF_INFO(0xffe40000, gic_iid(0x66)),
        SCIF_INFO(0xffe41000, gic_iid(0x67)),
        SCIF_INFO(0xffe42000, gic_iid(0x68)),
@@ -63,24 +63,24 @@ static struct plat_sci_port scif_platform_data[] = {
 };
 
 /* TMU */
-static struct resource sh_tmu0_resources[] = {
+static struct resource sh_tmu0_resources[] __initdata = {
        DEFINE_RES_MEM(0xffd80008, 12),
        DEFINE_RES_IRQ(gic_iid(0x40)),
 };
 
-static struct sh_timer_config sh_tmu0_platform_data = {
+static struct sh_timer_config sh_tmu0_platform_data __initdata = {
        .name                   = "TMU00",
        .channel_offset         = 0x4,
        .timer_bit              = 0,
        .clockevent_rating      = 200,
 };
 
-static struct resource sh_tmu1_resources[] = {
+static struct resource sh_tmu1_resources[] __initdata = {
        DEFINE_RES_MEM(0xffd80014, 12),
        DEFINE_RES_IRQ(gic_iid(0x41)),
 };
 
-static struct sh_timer_config sh_tmu1_platform_data = {
+static struct sh_timer_config sh_tmu1_platform_data __initdata = {
        .name                   = "TMU01",
        .channel_offset         = 0x10,
        .timer_bit              = 1,
@@ -189,7 +189,7 @@ USB_PLATFORM_INFO(ehci);
 USB_PLATFORM_INFO(ohci);
 
 /* Ether */
-static struct resource ether_resources[] = {
+static struct resource ether_resources[] __initdata = {
        DEFINE_RES_MEM(0xfde00000, 0x400),
        DEFINE_RES_IRQ(gic_iid(0x89)),
 };
@@ -203,17 +203,17 @@ void __init r8a7778_add_ether_device(struct sh_eth_plat_data *pdata)
 }
 
 /* PFC/GPIO */
-static struct resource pfc_resources[] = {
+static struct resource pfc_resources[] __initdata = {
        DEFINE_RES_MEM(0xfffc0000, 0x118),
 };
 
 #define R8A7778_GPIO(idx)                                              \
-static struct resource r8a7778_gpio##idx##_resources[] = {             \
+static struct resource r8a7778_gpio##idx##_resources[] __initdata = {  \
        DEFINE_RES_MEM(0xffc40000 + 0x1000 * (idx), 0x30),              \
        DEFINE_RES_IRQ(gic_iid(0x87)),                                  \
 };                                                                     \
                                                                        \
-static struct gpio_rcar_config r8a7778_gpio##idx##_platform_data = {   \
+static struct gpio_rcar_config r8a7778_gpio##idx##_platform_data __initdata = { \
        .gpio_base      = 32 * (idx),                                   \
        .irq_base       = GPIO_IRQ_BASE(idx),                           \
        .number_of_pins = 32,                                           \
@@ -249,7 +249,7 @@ void __init r8a7778_pinmux_init(void)
 };
 
 /* SDHI */
-static struct resource sdhi_resources[] = {
+static struct resource sdhi_resources[] __initdata = {
        /* SDHI0 */
        DEFINE_RES_MEM(0xFFE4C000, 0x100),
        DEFINE_RES_IRQ(gic_iid(0x77)),
@@ -399,12 +399,12 @@ void __init r8a7778_init_late(void)
        platform_device_register_full(&ohci_info);
 }
 
-static struct renesas_intc_irqpin_config irqpin_platform_data = {
+static struct renesas_intc_irqpin_config irqpin_platform_data __initdata = {
        .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
        .sense_bitfield_width = 2,
 };
 
-static struct resource irqpin_resources[] = {
+static struct resource irqpin_resources[] __initdata = {
        DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
        DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
        DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
@@ -442,17 +442,25 @@ void __init r8a7778_init_irq_extpin(int irlm)
                        &irqpin_platform_data, sizeof(irqpin_platform_data));
 }
 
+void __init r8a7778_init_delay(void)
+{
+       shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
+}
+
+#ifdef CONFIG_USE_OF
 #define INT2SMSKCR0    0x82288 /* 0xfe782288 */
 #define INT2SMSKCR1    0x8228c /* 0xfe78228c */
 
 #define INT2NTSR0      0x00018 /* 0xfe700018 */
 #define INT2NTSR1      0x0002c /* 0xfe70002c */
-static void __init r8a7778_init_irq_common(void)
+void __init r8a7778_init_irq_dt(void)
 {
        void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000);
 
        BUG_ON(!base);
 
+       irqchip_init();
+
        /* route all interrupts to ARM */
        __raw_writel(0x73ffffff, base + INT2NTSR0);
        __raw_writel(0xffffffff, base + INT2NTSR1);
@@ -464,43 +472,6 @@ static void __init r8a7778_init_irq_common(void)
        iounmap(base);
 }
 
-void __init r8a7778_init_irq(void)
-{
-       void __iomem *gic_dist_base;
-       void __iomem *gic_cpu_base;
-
-       gic_dist_base = ioremap_nocache(0xfe438000, PAGE_SIZE);
-       gic_cpu_base  = ioremap_nocache(0xfe430000, PAGE_SIZE);
-       BUG_ON(!gic_dist_base || !gic_cpu_base);
-
-       /* use GIC to handle interrupts */
-       gic_init(0, 29, gic_dist_base, gic_cpu_base);
-
-       r8a7778_init_irq_common();
-}
-
-void __init r8a7778_init_delay(void)
-{
-       shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
-}
-
-#ifdef CONFIG_USE_OF
-void __init r8a7778_init_irq_dt(void)
-{
-       irqchip_init();
-       r8a7778_init_irq_common();
-}
-
-static const struct of_dev_auxdata r8a7778_auxdata_lookup[] __initconst = {
-       {},
-};
-
-void __init r8a7778_add_standard_devices_dt(void)
-{
-       of_platform_populate(NULL, of_default_bus_match_table,
-                            r8a7778_auxdata_lookup, NULL);
-}
-
 static const char *r8a7778_compat_dt[] __initdata = {
        "renesas,r8a7778",
        NULL,
@@ -509,7 +480,6 @@ static const char *r8a7778_compat_dt[] __initdata = {
 DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)")
        .init_early     = r8a7778_init_delay,
        .init_irq       = r8a7778_init_irq_dt,
-       .init_machine   = r8a7778_add_standard_devices_dt,
        .init_time      = shmobile_timer_init,
        .dt_compat      = r8a7778_compat_dt,
        .init_late      = r8a7778_init_late,
index 3d89288..41bab62 100644 (file)
@@ -702,10 +702,6 @@ void __init r8a7779_init_delay(void)
        shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */
 }
 
-static const struct of_dev_auxdata r8a7779_auxdata_lookup[] __initconst = {
-       {},
-};
-
 void __init r8a7779_add_standard_devices_dt(void)
 {
        /* clocks are setup late during boot in the case of DT */
@@ -713,8 +709,7 @@ void __init r8a7779_add_standard_devices_dt(void)
 
        platform_add_devices(r8a7779_devices_dt,
                             ARRAY_SIZE(r8a7779_devices_dt));
-       of_platform_populate(NULL, of_default_bus_match_table,
-                            r8a7779_auxdata_lookup, NULL);
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static const char *r8a7779_compat_dt[] __initdata = {
index 28f9475..4c96dad 100644 (file)
  */
 
 #include <linux/irq.h>
-#include <linux/irqchip.h>
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
-#include <linux/serial_sci.h>
 #include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_data/irq-renesas-irqc.h>
+#include <linux/serial_sci.h>
+#include <linux/sh_timer.h>
 #include <mach/common.h>
 #include <mach/irqs.h>
 #include <mach/r8a7790.h>
@@ -149,6 +149,36 @@ static struct resource irqc0_resources[] __initdata = {
                                          &irqc##idx##_data,            \
                                          sizeof(struct renesas_irqc_config))
 
+static struct resource thermal_resources[] __initdata = {
+       DEFINE_RES_MEM(0xe61f0000, 0x14),
+       DEFINE_RES_MEM(0xe61f0100, 0x38),
+       DEFINE_RES_IRQ(gic_spi(69)),
+};
+
+#define r8a7790_register_thermal()                                     \
+       platform_device_register_simple("rcar_thermal", -1,             \
+                                       thermal_resources,              \
+                                       ARRAY_SIZE(thermal_resources))
+
+static struct sh_timer_config cmt00_platform_data = {
+       .name = "CMT00",
+       .timer_bit = 0,
+       .clockevent_rating = 80,
+};
+
+static struct resource cmt00_resources[] = {
+       DEFINE_RES_MEM(0xffca0510, 0x0c),
+       DEFINE_RES_MEM(0xffca0500, 0x04),
+       DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */
+};
+
+#define r8a7790_register_cmt(idx)                                      \
+       platform_device_register_resndata(&platform_bus, "sh_cmt",      \
+                                         idx, cmt##idx##_resources,    \
+                                         ARRAY_SIZE(cmt##idx##_resources), \
+                                         &cmt##idx##_platform_data,    \
+                                         sizeof(struct sh_timer_config))
+
 void __init r8a7790_add_standard_devices(void)
 {
        r8a7790_register_scif(SCIFA0);
@@ -162,34 +192,91 @@ void __init r8a7790_add_standard_devices(void)
        r8a7790_register_scif(HSCIF0);
        r8a7790_register_scif(HSCIF1);
        r8a7790_register_irqc(0);
+       r8a7790_register_thermal();
+       r8a7790_register_cmt(00);
 }
 
+#define MODEMR 0xe6160060
+
+u32 __init r8a7790_read_mode_pins(void)
+{
+       void __iomem *modemr = ioremap_nocache(MODEMR, 4);
+       u32 mode;
+
+       BUG_ON(!modemr);
+       mode = ioread32(modemr);
+       iounmap(modemr);
+
+       return mode;
+}
+
+#define CNTCR 0
+#define CNTFID0 0x20
+
 void __init r8a7790_timer_init(void)
 {
-       void __iomem *cntcr;
+#ifdef CONFIG_ARM_ARCH_TIMER
+       u32 mode = r8a7790_read_mode_pins();
+       void __iomem *base;
+       int extal_mhz = 0;
+       u32 freq;
+
+       /* At Linux boot time the r8a7790 arch timer comes up
+        * with the counter disabled. Moreover, it may also report
+        * a potentially incorrect fixed 13 MHz frequency. To be
+        * correct these registers need to be updated to use the
+        * frequency EXTAL / 2 which can be determined by the MD pins.
+        */
+
+       switch (mode & (MD(14) | MD(13))) {
+       case 0:
+               extal_mhz = 15;
+               break;
+       case MD(13):
+               extal_mhz = 20;
+               break;
+       case MD(14):
+               extal_mhz = 26;
+               break;
+       case MD(13) | MD(14):
+               extal_mhz = 30;
+               break;
+       }
 
-       /* make sure arch timer is started by setting bit 0 of CNTCT */
-       cntcr = ioremap(0xe6080000, PAGE_SIZE);
-       iowrite32(1, cntcr);
-       iounmap(cntcr);
+       /* The arch timer frequency equals EXTAL / 2 */
+       freq = extal_mhz * (1000000 / 2);
+
+       /* Remap "armgcnt address map" space */
+       base = ioremap(0xe6080000, PAGE_SIZE);
+
+       /* Update registers with correct frequency */
+       iowrite32(freq, base + CNTFID0);
+       asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
+
+       /* make sure arch timer is started by setting bit 0 of CNTCR */
+       iowrite32(1, base + CNTCR);
+       iounmap(base);
+#endif /* CONFIG_ARM_ARCH_TIMER */
 
        shmobile_timer_init();
 }
 
-#ifdef CONFIG_USE_OF
-void __init r8a7790_add_standard_devices_dt(void)
+void __init r8a7790_init_delay(void)
 {
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+#ifndef CONFIG_ARM_ARCH_TIMER
+       shmobile_setup_delay(1300, 2, 4); /* Cortex-A15 @ 1300MHz */
+#endif
 }
 
+#ifdef CONFIG_USE_OF
+
 static const char *r8a7790_boards_compat_dt[] __initdata = {
        "renesas,r8a7790",
        NULL,
 };
 
 DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)")
-       .init_irq       = irqchip_init,
-       .init_machine   = r8a7790_add_standard_devices_dt,
+       .init_early     = r8a7790_init_delay,
        .init_time      = r8a7790_timer_init,
        .dt_compat      = r8a7790_boards_compat_dt,
 MACHINE_END
index 5502d62..13e6fdb 100644 (file)
@@ -1147,10 +1147,6 @@ void __init sh7372_add_early_devices_dt(void)
        shmobile_setup_console();
 }
 
-static const struct of_dev_auxdata sh7372_auxdata_lookup[] __initconst = {
-       { }
-};
-
 void __init sh7372_add_standard_devices_dt(void)
 {
        /* clocks are setup late during boot in the case of DT */
@@ -1159,8 +1155,7 @@ void __init sh7372_add_standard_devices_dt(void)
        platform_add_devices(sh7372_early_devices,
                            ARRAY_SIZE(sh7372_early_devices));
 
-       of_platform_populate(NULL, of_default_bus_match_table,
-                            sh7372_auxdata_lookup, NULL);
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static const char *sh7372_boards_compat_dt[] __initdata = {
index 96e7ca1..516c239 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
-#include <linux/irqchip.h>
 #include <linux/platform_device.h>
 #include <linux/of_platform.h>
 #include <linux/delay.h>
@@ -61,29 +60,16 @@ void __init sh73a0_map_io(void)
        iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
 }
 
-static struct resource sh73a0_pfc_resources[] = {
-       [0] = {
-               .start  = 0xe6050000,
-               .end    = 0xe6057fff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 0xe605801c,
-               .end    = 0xe6058027,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device sh73a0_pfc_device = {
-       .name           = "pfc-sh73a0",
-       .id             = -1,
-       .resource       = sh73a0_pfc_resources,
-       .num_resources  = ARRAY_SIZE(sh73a0_pfc_resources),
+/* PFC */
+static struct resource pfc_resources[] __initdata = {
+       DEFINE_RES_MEM(0xe6050000, 0x8000),
+       DEFINE_RES_MEM(0xe605801c, 0x000c),
 };
 
 void __init sh73a0_pinmux_init(void)
 {
-       platform_device_register(&sh73a0_pfc_device);
+       platform_device_register_simple("pfc-sh73a0", -1, pfc_resources,
+                                       ARRAY_SIZE(pfc_resources));
 }
 
 static struct plat_sci_port scif0_platform_data = {
@@ -958,10 +944,6 @@ void __init sh73a0_add_early_devices(void)
 
 #ifdef CONFIG_USE_OF
 
-static const struct of_dev_auxdata sh73a0_auxdata_lookup[] __initconst = {
-       {},
-};
-
 void __init sh73a0_add_standard_devices_dt(void)
 {
        struct platform_device_info devinfo = { .name = "cpufreq-cpu0", .id = -1, };
@@ -971,8 +953,7 @@ void __init sh73a0_add_standard_devices_dt(void)
 
        platform_add_devices(sh73a0_devices_dt,
                             ARRAY_SIZE(sh73a0_devices_dt));
-       of_platform_populate(NULL, of_default_bus_match_table,
-                            sh73a0_auxdata_lookup, NULL);
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
        /* Instantiate cpufreq-cpu0 */
        platform_device_register_full(&devinfo);
@@ -988,7 +969,6 @@ DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
        .map_io         = sh73a0_map_io,
        .init_early     = sh73a0_init_delay,
        .nr_irqs        = NR_IRQS_LEGACY,
-       .init_irq       = irqchip_init,
        .init_machine   = sh73a0_add_standard_devices_dt,
        .dt_compat      = sh73a0_boards_compat_dt,
 MACHINE_END
index 53f4840..9782862 100644 (file)
@@ -41,6 +41,7 @@
 sh7372_resume_core_standby_sysc:
        ldr     pc, 1f
 
+       .align  2
        .globl  sh7372_cpu_resume
 sh7372_cpu_resume:
 1:     .space  4
@@ -96,6 +97,7 @@ sh7372_do_idle_sysc:
 1:
        b      1b
 
+       .align  2
 kernel_flush:
        .word v7_flush_dcache_all
 #endif
index 22a05a8..78e84c5 100644 (file)
@@ -29,6 +29,8 @@
 #include <asm/smp_scu.h>
 
 #define EMEV2_SCU_BASE 0x1e000000
+#define EMEV2_SMU_BASE 0xe0110000
+#define SMU_GENERAL_REG0 0x7c0
 
 static int emev2_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
@@ -38,10 +40,18 @@ static int emev2_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
 {
+       void __iomem *smu;
+
+       /* setup EMEV2 specific SCU base, enable */
+       shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
        scu_enable(shmobile_scu_base);
 
        /* Tell ROM loader about our vector (in headsmp-scu.S, headsmp.S) */
-       emev2_set_boot_vector(__pa(shmobile_boot_vector));
+       smu = ioremap(EMEV2_SMU_BASE, PAGE_SIZE);
+       if (smu) {
+               iowrite32(__pa(shmobile_boot_vector), smu + SMU_GENERAL_REG0);
+               iounmap(smu);
+       }
        shmobile_boot_fn = virt_to_phys(shmobile_boot_scu);
        shmobile_boot_arg = (unsigned long)shmobile_scu_base;
 
@@ -49,21 +59,7 @@ static void __init emev2_smp_prepare_cpus(unsigned int max_cpus)
        scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
 }
 
-static void __init emev2_smp_init_cpus(void)
-{
-       unsigned int ncores;
-
-       /* setup EMEV2 specific SCU base */
-       shmobile_scu_base = ioremap(EMEV2_SCU_BASE, PAGE_SIZE);
-       emev2_clock_init(); /* need ioremapped SMU */
-
-       ncores = shmobile_scu_base ? scu_get_core_count(shmobile_scu_base) : 1;
-
-       shmobile_smp_init_cpus(ncores);
-}
-
 struct smp_operations emev2_smp_ops __initdata = {
-       .smp_init_cpus          = emev2_smp_init_cpus,
        .smp_prepare_cpus       = emev2_smp_prepare_cpus,
        .smp_boot_secondary     = emev2_boot_secondary,
 };
index 442917e..df0d59a 100644 (file)
@@ -23,7 +23,7 @@ config ARCH_SPEAR13XX
        select CPU_V7
        select GPIO_SPEAR_SPICS
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        select PINCTRL
index 5b045e3..3ab2f65 100644 (file)
@@ -10,3 +10,5 @@ config ARCH_SUNXI
        select SPARSE_IRQ
        select SUN4I_TIMER
        select PINCTRL_SUNXI
+       select ARM_GIC
+       select HAVE_SMP
diff --git a/arch/arm/mach-sunxi/Makefile.boot b/arch/arm/mach-sunxi/Makefile.boot
deleted file mode 100644 (file)
index 46d4cf0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-zreladdr-$(CONFIG_ARCH_SUNXI)  += 0x40008000
index 38a3c55..e79fb34 100644 (file)
 #include <asm/system_misc.h>
 
 #define SUN4I_WATCHDOG_CTRL_REG                0x00
-#define SUN4I_WATCHDOG_CTRL_RESTART            (1 << 0)
+#define SUN4I_WATCHDOG_CTRL_RESTART            BIT(0)
 #define SUN4I_WATCHDOG_MODE_REG                0x04
-#define SUN4I_WATCHDOG_MODE_ENABLE             (1 << 0)
-#define SUN4I_WATCHDOG_MODE_RESET_ENABLE       (1 << 1)
+#define SUN4I_WATCHDOG_MODE_ENABLE             BIT(0)
+#define SUN4I_WATCHDOG_MODE_RESET_ENABLE       BIT(1)
+
+#define SUN6I_WATCHDOG1_IRQ_REG                0x00
+#define SUN6I_WATCHDOG1_CTRL_REG       0x10
+#define SUN6I_WATCHDOG1_CTRL_RESTART           BIT(0)
+#define SUN6I_WATCHDOG1_CONFIG_REG     0x14
+#define SUN6I_WATCHDOG1_CONFIG_RESTART         BIT(0)
+#define SUN6I_WATCHDOG1_CONFIG_IRQ             BIT(1)
+#define SUN6I_WATCHDOG1_MODE_REG       0x18
+#define SUN6I_WATCHDOG1_MODE_ENABLE            BIT(0)
 
 static void __iomem *wdt_base;
 
@@ -56,8 +65,36 @@ static void sun4i_restart(enum reboot_mode mode, const char *cmd)
        }
 }
 
+static void sun6i_restart(enum reboot_mode mode, const char *cmd)
+{
+       if (!wdt_base)
+               return;
+
+       /* Disable interrupts */
+       writel(0, wdt_base + SUN6I_WATCHDOG1_IRQ_REG);
+
+       /* We want to disable the IRQ and just reset the whole system */
+       writel(SUN6I_WATCHDOG1_CONFIG_RESTART,
+               wdt_base + SUN6I_WATCHDOG1_CONFIG_REG);
+
+       /* Enable timer. The default and lowest interval value is 0.5s */
+       writel(SUN6I_WATCHDOG1_MODE_ENABLE,
+               wdt_base + SUN6I_WATCHDOG1_MODE_REG);
+
+       /* Restart the watchdog. */
+       writel(SUN6I_WATCHDOG1_CTRL_RESTART,
+               wdt_base + SUN6I_WATCHDOG1_CTRL_REG);
+
+       while (1) {
+               mdelay(5);
+               writel(SUN6I_WATCHDOG1_MODE_ENABLE,
+                       wdt_base + SUN6I_WATCHDOG1_MODE_REG);
+       }
+}
+
 static struct of_device_id sunxi_restart_ids[] = {
        { .compatible = "allwinner,sun4i-wdt", .data = sun4i_restart },
+       { .compatible = "allwinner,sun6i-wdt", .data = sun6i_restart },
        { /*sentinel*/ }
 };
 
@@ -96,6 +133,8 @@ static const char * const sunxi_board_dt_compat[] = {
        "allwinner,sun4i-a10",
        "allwinner,sun5i-a10s",
        "allwinner,sun5i-a13",
+       "allwinner,sun6i-a31",
+       "allwinner,sun7i-a20",
        NULL,
 };
 
index ef3a8da..67a76f2 100644 (file)
@@ -2,18 +2,25 @@ config ARCH_TEGRA
        bool "NVIDIA Tegra" if ARCH_MULTI_V7
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
+       select ARM_GIC
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select CLKSRC_OF
        select COMMON_CLK
+       select CPU_V7
        select GENERIC_CLOCKEVENTS
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
+       select MIGHT_HAVE_PCI
+       select PINCTRL
        select SOC_BUS
        select SPARSE_IRQ
+       select USB_ARCH_HAS_EHCI if USB_SUPPORT
+       select USB_ULPI if USB_PHY
+       select USB_ULPI_VIEWPORT if USB_PHY
        select USE_OF
        help
          This enables support for NVIDIA Tegra based systems.
@@ -27,15 +34,9 @@ config ARCH_TEGRA_2x_SOC
        select ARM_ERRATA_720789
        select ARM_ERRATA_754327 if SMP
        select ARM_ERRATA_764369 if SMP
-       select ARM_GIC
-       select CPU_V7
-       select PINCTRL
        select PINCTRL_TEGRA20
        select PL310_ERRATA_727915 if CACHE_L2X0
        select PL310_ERRATA_769419 if CACHE_L2X0
-       select USB_ARCH_HAS_EHCI if USB_SUPPORT
-       select USB_ULPI if USB_PHY
-       select USB_ULPI_VIEWPORT if USB_PHY
        help
          Support for NVIDIA Tegra AP20 and T20 processors, based on the
          ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -44,14 +45,8 @@ config ARCH_TEGRA_3x_SOC
        bool "Enable support for Tegra30 family"
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369 if SMP
-       select ARM_GIC
-       select CPU_V7
-       select PINCTRL
        select PINCTRL_TEGRA30
        select PL310_ERRATA_769419 if CACHE_L2X0
-       select USB_ARCH_HAS_EHCI if USB_SUPPORT
-       select USB_ULPI if USB_PHY
-       select USB_ULPI_VIEWPORT if USB_PHY
        help
          Support for NVIDIA Tegra T30 processor family, based on the
          ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -59,20 +54,13 @@ config ARCH_TEGRA_3x_SOC
 config ARCH_TEGRA_114_SOC
        bool "Enable support for Tegra114 family"
        select HAVE_ARM_ARCH_TIMER
-       select ARM_GIC
+       select ARM_ERRATA_798181
        select ARM_L1_CACHE_SHIFT_6
-       select CPU_V7
-       select PINCTRL
        select PINCTRL_TEGRA114
        help
          Support for NVIDIA Tegra T114 processor family, based on the
          ARM CortexA15MP CPU
 
-config TEGRA_PCI
-       bool "PCI Express support"
-       depends on ARCH_TEGRA_2x_SOC
-       select PCI
-
 config TEGRA_AHB
        bool "Enable AHB driver for NVIDIA Tegra SoCs"
        default y
index 98b184e..e7e5f45 100644 (file)
@@ -17,24 +17,24 @@ obj-$(CONFIG_CPU_IDLE)                      += cpuidle.o
 obj-$(CONFIG_ARCH_TEGRA_2x_SOC)                += tegra20_speedo.o
 obj-$(CONFIG_ARCH_TEGRA_2x_SOC)                += tegra2_emc.o
 obj-$(CONFIG_ARCH_TEGRA_2x_SOC)                += sleep-tegra20.o
+obj-$(CONFIG_ARCH_TEGRA_2x_SOC)                += pm-tegra20.o
 ifeq ($(CONFIG_CPU_IDLE),y)
 obj-$(CONFIG_ARCH_TEGRA_2x_SOC)                += cpuidle-tegra20.o
 endif
 obj-$(CONFIG_ARCH_TEGRA_3x_SOC)                += tegra30_speedo.o
 obj-$(CONFIG_ARCH_TEGRA_3x_SOC)                += sleep-tegra30.o
+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_HOTPLUG_CPU)               += hotplug.o
-obj-$(CONFIG_TEGRA_PCI)                        += pcie.o
 
 obj-$(CONFIG_ARCH_TEGRA_114_SOC)       += tegra114_speedo.o
 obj-$(CONFIG_ARCH_TEGRA_114_SOC)       += sleep-tegra30.o
+obj-$(CONFIG_ARCH_TEGRA_114_SOC)       += pm-tegra30.o
 ifeq ($(CONFIG_CPU_IDLE),y)
 obj-$(CONFIG_ARCH_TEGRA_114_SOC)       += cpuidle-tegra114.o
 endif
 
-obj-$(CONFIG_ARCH_TEGRA_2x_SOC)                += board-harmony-pcie.o
-
 obj-$(CONFIG_ARCH_TEGRA_2x_SOC)                += board-paz00.o
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c
deleted file mode 100644 (file)
index 035b240..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * arch/arm/mach-tegra/board-harmony-pcie.c
- *
- * Copyright (C) 2010 CompuLab, Ltd.
- * Mike Rapoport <mike@compulab.co.il>
- *
- * 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/kernel.h>
-#include <linux/gpio.h>
-#include <linux/err.h>
-#include <linux/of_gpio.h>
-#include <linux/regulator/consumer.h>
-
-#include <asm/mach-types.h>
-
-#include "board.h"
-
-#ifdef CONFIG_TEGRA_PCI
-
-int __init harmony_pcie_init(void)
-{
-       struct device_node *np;
-       int en_vdd_1v05;
-       struct regulator *regulator = NULL;
-       int err;
-
-       np = of_find_node_by_path("/regulators/regulator@3");
-       if (!np) {
-               pr_err("%s: of_find_node_by_path failed\n", __func__);
-               return -ENODEV;
-       }
-
-       en_vdd_1v05 = of_get_named_gpio(np, "gpio", 0);
-       if (en_vdd_1v05 < 0) {
-               pr_err("%s: of_get_named_gpio failed: %d\n", __func__,
-                      en_vdd_1v05);
-               return en_vdd_1v05;
-       }
-
-       err = gpio_request(en_vdd_1v05, "EN_VDD_1V05");
-       if (err) {
-               pr_err("%s: gpio_request failed: %d\n", __func__, err);
-               return err;
-       }
-
-       gpio_direction_output(en_vdd_1v05, 1);
-
-       regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk");
-       if (IS_ERR(regulator)) {
-               err = PTR_ERR(regulator);
-               pr_err("%s: regulator_get failed: %d\n", __func__, err);
-               goto err_reg;
-       }
-
-       err = regulator_enable(regulator);
-       if (err) {
-               pr_err("%s: regulator_enable failed: %d\n", __func__, err);
-               goto err_en;
-       }
-
-       err = tegra_pcie_init(true, true);
-       if (err) {
-               pr_err("%s: tegra_pcie_init failed: %d\n", __func__, err);
-               goto err_pcie;
-       }
-
-       return 0;
-
-err_pcie:
-       regulator_disable(regulator);
-err_en:
-       regulator_put(regulator);
-err_reg:
-       gpio_free(en_vdd_1v05);
-
-       return err;
-}
-
-#endif
index 9a6659f..db6810d 100644 (file)
@@ -31,7 +31,6 @@ void __init tegra_init_early(void);
 void __init tegra_map_common_io(void);
 void __init tegra_init_irq(void);
 void __init tegra_dt_init_irq(void);
-int __init tegra_pcie_init(bool init_port0, bool init_port1);
 
 void tegra_init_late(void);
 
@@ -48,13 +47,6 @@ int __init tegra_powergate_debugfs_init(void);
 static inline int tegra_powergate_debugfs_init(void) { return 0; }
 #endif
 
-int __init harmony_regulator_init(void);
-#ifdef CONFIG_TEGRA_PCI
-int __init harmony_pcie_init(void);
-#else
-static inline int harmony_pcie_init(void) { return 0; }
-#endif
-
 void __init tegra_paz00_wifikill_init(void);
 
 #endif
index 32f8eb3..5900cc4 100644 (file)
@@ -2,4 +2,3 @@ extern struct smp_operations tegra_smp_ops;
 
 extern int tegra_cpu_kill(unsigned int cpu);
 extern void tegra_cpu_die(unsigned int cpu);
-extern int tegra_cpu_disable(unsigned int cpu);
index 1d1c602..e0b8730 100644 (file)
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/cpuidle.h>
+#include <linux/cpu_pm.h>
+#include <linux/clockchips.h>
 
 #include <asm/cpuidle.h>
+#include <asm/suspend.h>
+#include <asm/smp_plat.h>
+
+#include "pm.h"
+#include "sleep.h"
+
+#ifdef CONFIG_PM_SLEEP
+#define TEGRA114_MAX_STATES 2
+#else
+#define TEGRA114_MAX_STATES 1
+#endif
+
+#ifdef CONFIG_PM_SLEEP
+static int tegra114_idle_power_down(struct cpuidle_device *dev,
+                                   struct cpuidle_driver *drv,
+                                   int index)
+{
+       local_fiq_disable();
+
+       tegra_set_cpu_in_lp2();
+       cpu_pm_enter();
+
+       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
+
+       cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
+
+       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
+
+       cpu_pm_exit();
+       tegra_clear_cpu_in_lp2();
+
+       local_fiq_enable();
+
+       return index;
+}
+#endif
 
 static struct cpuidle_driver tegra_idle_driver = {
        .name = "tegra_idle",
        .owner = THIS_MODULE,
-       .state_count = 1,
+       .state_count = TEGRA114_MAX_STATES,
        .states = {
                [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
+#ifdef CONFIG_PM_SLEEP
+               [1] = {
+                       .enter                  = tegra114_idle_power_down,
+                       .exit_latency           = 500,
+                       .target_residency       = 1000,
+                       .power_usage            = 0,
+                       .flags                  = CPUIDLE_FLAG_TIME_VALID,
+                       .name                   = "powered-down",
+                       .desc                   = "CPU power gated",
+               },
+#endif
        },
 };
 
index 706aa42..b82dcae 100644 (file)
@@ -211,6 +211,18 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
 }
 #endif
 
+/*
+ * Tegra20 HW appears to have a bug such that PCIe device interrupts, whether
+ * they are legacy IRQs or MSI, are lost when LP2 is enabled. To work around
+ * this, simply disable LP2 if the PCI driver and DT node are both enabled.
+ */
+void tegra20_cpuidle_pcie_irqs_in_use(void)
+{
+       pr_info_once(
+               "Disabling cpuidle LP2 state, since PCIe IRQs are in use\n");
+       tegra_idle_driver.states[1].disabled = true;
+}
+
 int __init tegra20_cpuidle_init(void)
 {
        return cpuidle_register(&tegra_idle_driver, cpu_possible_mask);
index e85973c..0961dfc 100644 (file)
@@ -44,3 +44,13 @@ void __init tegra_cpuidle_init(void)
                break;
        }
 }
+
+void tegra_cpuidle_pcie_irqs_in_use(void)
+{
+       switch (tegra_chip_id) {
+       case TEGRA20:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
+                       tegra20_cpuidle_pcie_irqs_in_use();
+               break;
+       }
+}
index 9ec2c1a..c017dab 100644 (file)
@@ -19,6 +19,7 @@
 
 #ifdef CONFIG_CPU_IDLE
 int tegra20_cpuidle_init(void);
+void tegra20_cpuidle_pcie_irqs_in_use(void);
 int tegra30_cpuidle_init(void);
 int tegra114_cpuidle_init(void);
 void tegra_cpuidle_init(void);
index b477ef3..5348543 100644 (file)
@@ -86,6 +86,7 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid)
                reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid;
                break;
        case TEGRA30:
+       case TEGRA114:
                /* clear wfe bitmap */
                reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
                /* clear wfi bitmap */
@@ -123,6 +124,7 @@ void flowctrl_cpu_suspend_exit(unsigned int cpuid)
                reg &= ~TEGRA20_FLOW_CTRL_CSR_WFI_BITMAP;
                break;
        case TEGRA30:
+       case TEGRA114:
                /* clear wfe bitmap */
                reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
                /* clear wfi bitmap */
index 7a29bae..c89aac6 100644 (file)
 #define FLOW_CTRL_SCLK_RESUME          (1 << 27)
 #define FLOW_CTRL_HALT_CPU_IRQ         (1 << 10)
 #define        FLOW_CTRL_HALT_CPU_FIQ          (1 << 8)
+#define FLOW_CTRL_HALT_LIC_IRQ         (1 << 11)
+#define FLOW_CTRL_HALT_LIC_FIQ         (1 << 10)
+#define FLOW_CTRL_HALT_GIC_IRQ         (1 << 9)
+#define FLOW_CTRL_HALT_GIC_FIQ         (1 << 8)
 #define FLOW_CTRL_CPU0_CSR             0x8
 #define        FLOW_CTRL_CSR_INTR_FLAG         (1 << 15)
 #define FLOW_CTRL_CSR_EVENT_FLAG       (1 << 14)
+#define FLOW_CTRL_CSR_ENABLE_EXT_CRAIL (1 << 13)
+#define FLOW_CTRL_CSR_ENABLE_EXT_NCPU  (1 << 12)
+#define FLOW_CTRL_CSR_ENABLE_EXT_MASK ( \
+               FLOW_CTRL_CSR_ENABLE_EXT_NCPU | \
+               FLOW_CTRL_CSR_ENABLE_EXT_CRAIL)
 #define FLOW_CTRL_CSR_ENABLE           (1 << 0)
 #define FLOW_CTRL_HALT_CPU1_EVENTS     0x14
 #define FLOW_CTRL_CPU1_CSR             0x18
index 045c16f..2072e73 100644 (file)
@@ -6,6 +6,7 @@
         .section ".text.head", "ax"
 
 ENTRY(tegra_secondary_startup)
-        bl      v7_invalidate_l1
+        check_cpu_part_num 0xc09, r8, r9
+        bleq    v7_invalidate_l1
         b       secondary_startup
 ENDPROC(tegra_secondary_startup)
index a52c10e..04de2e8 100644 (file)
@@ -37,7 +37,7 @@ int tegra_cpu_kill(unsigned cpu)
 void __ref tegra_cpu_die(unsigned int cpu)
 {
        /* Clean L1 data cache */
-       tegra_disable_clean_inv_dcache();
+       tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS);
 
        /* Shut down the current CPU. */
        tegra_hotplug_shutdown();
@@ -46,17 +46,6 @@ void __ref tegra_cpu_die(unsigned int cpu)
        BUG();
 }
 
-int tegra_cpu_disable(unsigned int cpu)
-{
-       switch (tegra_chip_id) {
-       case TEGRA20:
-       case TEGRA30:
-               return cpu == 0 ? -EPERM : 0;
-       default:
-               return 0;
-       }
-}
-
 void __init tegra_hotplug_init(void)
 {
        if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
index 399fbca..3f5fa07 100644 (file)
@@ -24,6 +24,8 @@
 #define TEGRA_IRAM_BASE                        0x40000000
 #define TEGRA_IRAM_SIZE                        SZ_256K
 
+#define TEGRA_IRAM_CODE_AREA           (TEGRA_IRAM_BASE + SZ_4K)
+
 #define TEGRA_HOST1X_BASE              0x50000000
 #define TEGRA_HOST1X_SIZE              0x24000
 
 #define TEGRA_KFUSE_BASE               0x7000FC00
 #define TEGRA_KFUSE_SIZE               SZ_1K
 
+#define TEGRA_EMC0_BASE                        0x7001A000
+#define TEGRA_EMC0_SIZE                        SZ_2K
+
+#define TEGRA_EMC1_BASE                        0x7001A800
+#define TEGRA_EMC1_SIZE                        SZ_2K
+
 #define TEGRA_CSITE_BASE               0x70040000
 #define TEGRA_CSITE_SIZE               SZ_256K
 
 #define IO_APB_VIRT    IOMEM(0xFE300000)
 #define IO_APB_SIZE    SZ_1M
 
-#define TEGRA_PCIE_BASE                0x80000000
-#define TEGRA_PCIE_IO_BASE     (TEGRA_PCIE_BASE + SZ_4M)
-
 #define IO_TO_VIRT_BETWEEN(p, st, sz)  ((p) >= (st) && (p) < ((st) + (sz)))
 #define IO_TO_VIRT_XLATE(p, pst, vst)  (((p) - (pst) + (vst)))
 
index 0de4eed..1a74d56 100644 (file)
  */
 
 #include <linux/kernel.h>
+#include <linux/cpu_pm.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/irqchip/arm-gic.h>
 #include <linux/syscore_ops.h>
 
@@ -65,6 +67,7 @@ static u32 cpu_ier[TEGRA_MAX_NUM_ICTLRS];
 static u32 cpu_iep[TEGRA_MAX_NUM_ICTLRS];
 
 static u32 ictlr_wake_mask[TEGRA_MAX_NUM_ICTLRS];
+static void __iomem *tegra_gic_cpu_base;
 #endif
 
 bool tegra_pending_sgi(void)
@@ -213,8 +216,43 @@ int tegra_legacy_irq_syscore_init(void)
 
        return 0;
 }
+
+static int tegra_gic_notifier(struct notifier_block *self,
+                             unsigned long cmd, void *v)
+{
+       switch (cmd) {
+       case CPU_PM_ENTER:
+               writel_relaxed(0x1E0, tegra_gic_cpu_base + GIC_CPU_CTRL);
+               break;
+       }
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block tegra_gic_notifier_block = {
+       .notifier_call = tegra_gic_notifier,
+};
+
+static const struct of_device_id tegra114_dt_gic_match[] __initconst = {
+       { .compatible = "arm,cortex-a15-gic" },
+       { }
+};
+
+static void tegra114_gic_cpu_pm_registration(void)
+{
+       struct device_node *dn;
+
+       dn = of_find_matching_node(NULL, tegra114_dt_gic_match);
+       if (!dn)
+               return;
+
+       tegra_gic_cpu_base = of_iomap(dn, 1);
+
+       cpu_pm_register_notifier(&tegra_gic_notifier_block);
+}
 #else
 #define tegra_set_wake NULL
+static void tegra114_gic_cpu_pm_registration(void) { }
 #endif
 
 void __init tegra_init_irq(void)
@@ -252,4 +290,6 @@ void __init tegra_init_irq(void)
        if (!of_have_populated_dt())
                gic_init(0, 29, distbase,
                        IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
+
+       tegra114_gic_cpu_pm_registration();
 }
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
deleted file mode 100644 (file)
index 46144a1..0000000
+++ /dev/null
@@ -1,886 +0,0 @@
-/*
- * arch/arm/mach-tegra/pci.c
- *
- * PCIe host controller driver for TEGRA(2) SOCs
- *
- * Copyright (c) 2010, CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
- *
- * Based on NVIDIA PCIe driver
- * Copyright (c) 2008-2009, NVIDIA Corporation.
- *
- * Bits taken from arch/arm/mach-dove/pcie.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; 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/pci.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/export.h>
-#include <linux/clk/tegra.h>
-#include <linux/tegra-powergate.h>
-
-#include <asm/sizes.h>
-#include <asm/mach/pci.h>
-
-#include "board.h"
-#include "iomap.h"
-
-/* Hack - need to parse this from DT */
-#define INT_PCIE_INTR 130
-
-/* register definitions */
-#define AFI_OFFSET     0x3800
-#define PADS_OFFSET    0x3000
-#define RP0_OFFSET     0x0000
-#define RP1_OFFSET     0x1000
-
-#define AFI_AXI_BAR0_SZ        0x00
-#define AFI_AXI_BAR1_SZ        0x04
-#define AFI_AXI_BAR2_SZ        0x08
-#define AFI_AXI_BAR3_SZ        0x0c
-#define AFI_AXI_BAR4_SZ        0x10
-#define AFI_AXI_BAR5_SZ        0x14
-
-#define AFI_AXI_BAR0_START     0x18
-#define AFI_AXI_BAR1_START     0x1c
-#define AFI_AXI_BAR2_START     0x20
-#define AFI_AXI_BAR3_START     0x24
-#define AFI_AXI_BAR4_START     0x28
-#define AFI_AXI_BAR5_START     0x2c
-
-#define AFI_FPCI_BAR0  0x30
-#define AFI_FPCI_BAR1  0x34
-#define AFI_FPCI_BAR2  0x38
-#define AFI_FPCI_BAR3  0x3c
-#define AFI_FPCI_BAR4  0x40
-#define AFI_FPCI_BAR5  0x44
-
-#define AFI_CACHE_BAR0_SZ      0x48
-#define AFI_CACHE_BAR0_ST      0x4c
-#define AFI_CACHE_BAR1_SZ      0x50
-#define AFI_CACHE_BAR1_ST      0x54
-
-#define AFI_MSI_BAR_SZ         0x60
-#define AFI_MSI_FPCI_BAR_ST    0x64
-#define AFI_MSI_AXI_BAR_ST     0x68
-
-#define AFI_CONFIGURATION              0xac
-#define  AFI_CONFIGURATION_EN_FPCI     (1 << 0)
-
-#define AFI_FPCI_ERROR_MASKS   0xb0
-
-#define AFI_INTR_MASK          0xb4
-#define  AFI_INTR_MASK_INT_MASK        (1 << 0)
-#define  AFI_INTR_MASK_MSI_MASK        (1 << 8)
-
-#define AFI_INTR_CODE          0xb8
-#define  AFI_INTR_CODE_MASK    0xf
-#define  AFI_INTR_MASTER_ABORT 4
-#define  AFI_INTR_LEGACY       6
-
-#define AFI_INTR_SIGNATURE     0xbc
-#define AFI_SM_INTR_ENABLE     0xc4
-
-#define AFI_AFI_INTR_ENABLE            0xc8
-#define  AFI_INTR_EN_INI_SLVERR                (1 << 0)
-#define  AFI_INTR_EN_INI_DECERR                (1 << 1)
-#define  AFI_INTR_EN_TGT_SLVERR                (1 << 2)
-#define  AFI_INTR_EN_TGT_DECERR                (1 << 3)
-#define  AFI_INTR_EN_TGT_WRERR         (1 << 4)
-#define  AFI_INTR_EN_DFPCI_DECERR      (1 << 5)
-#define  AFI_INTR_EN_AXI_DECERR                (1 << 6)
-#define  AFI_INTR_EN_FPCI_TIMEOUT      (1 << 7)
-
-#define AFI_PCIE_CONFIG                                        0x0f8
-#define  AFI_PCIE_CONFIG_PCIEC0_DISABLE_DEVICE         (1 << 1)
-#define  AFI_PCIE_CONFIG_PCIEC1_DISABLE_DEVICE         (1 << 2)
-#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_MASK      (0xf << 20)
-#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_SINGLE    (0x0 << 20)
-#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_DUAL      (0x1 << 20)
-
-#define AFI_FUSE                       0x104
-#define  AFI_FUSE_PCIE_T0_GEN2_DIS     (1 << 2)
-
-#define AFI_PEX0_CTRL                  0x110
-#define AFI_PEX1_CTRL                  0x118
-#define  AFI_PEX_CTRL_RST              (1 << 0)
-#define  AFI_PEX_CTRL_REFCLK_EN                (1 << 3)
-
-#define RP_VEND_XP     0x00000F00
-#define  RP_VEND_XP_DL_UP      (1 << 30)
-
-#define RP_LINK_CONTROL_STATUS                 0x00000090
-#define  RP_LINK_CONTROL_STATUS_LINKSTAT_MASK  0x3fff0000
-
-#define PADS_CTL_SEL           0x0000009C
-
-#define PADS_CTL               0x000000A0
-#define  PADS_CTL_IDDQ_1L      (1 << 0)
-#define  PADS_CTL_TX_DATA_EN_1L        (1 << 6)
-#define  PADS_CTL_RX_DATA_EN_1L        (1 << 10)
-
-#define PADS_PLL_CTL                           0x000000B8
-#define  PADS_PLL_CTL_RST_B4SM                 (1 << 1)
-#define  PADS_PLL_CTL_LOCKDET                  (1 << 8)
-#define  PADS_PLL_CTL_REFCLK_MASK              (0x3 << 16)
-#define  PADS_PLL_CTL_REFCLK_INTERNAL_CML      (0 << 16)
-#define  PADS_PLL_CTL_REFCLK_INTERNAL_CMOS     (1 << 16)
-#define  PADS_PLL_CTL_REFCLK_EXTERNAL          (2 << 16)
-#define  PADS_PLL_CTL_TXCLKREF_MASK            (0x1 << 20)
-#define  PADS_PLL_CTL_TXCLKREF_DIV10           (0 << 20)
-#define  PADS_PLL_CTL_TXCLKREF_DIV5            (1 << 20)
-
-/* PMC access is required for PCIE xclk (un)clamping */
-#define PMC_SCRATCH42          0x144
-#define PMC_SCRATCH42_PCX_CLAMP        (1 << 0)
-
-static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
-
-#define pmc_writel(value, reg) \
-       __raw_writel(value, reg_pmc_base + (reg))
-#define pmc_readl(reg) \
-       __raw_readl(reg_pmc_base + (reg))
-
-/*
- * Tegra2 defines 1GB in the AXI address map for PCIe.
- *
- * That address space is split into different regions, with sizes and
- * offsets as follows:
- *
- * 0x80000000 - 0x80003fff - PCI controller registers
- * 0x80004000 - 0x80103fff - PCI configuration space
- * 0x80104000 - 0x80203fff - PCI extended configuration space
- * 0x80203fff - 0x803fffff - unused
- * 0x80400000 - 0x8040ffff - downstream IO
- * 0x80410000 - 0x8fffffff - unused
- * 0x90000000 - 0x9fffffff - non-prefetchable memory
- * 0xa0000000 - 0xbfffffff - prefetchable memory
- */
-#define PCIE_REGS_SZ           SZ_16K
-#define PCIE_CFG_OFF           PCIE_REGS_SZ
-#define PCIE_CFG_SZ            SZ_1M
-#define PCIE_EXT_CFG_OFF       (PCIE_CFG_SZ + PCIE_CFG_OFF)
-#define PCIE_EXT_CFG_SZ                SZ_1M
-#define PCIE_IOMAP_SZ          (PCIE_REGS_SZ + PCIE_CFG_SZ + PCIE_EXT_CFG_SZ)
-
-#define MEM_BASE_0             (TEGRA_PCIE_BASE + SZ_256M)
-#define MEM_SIZE_0             SZ_128M
-#define MEM_BASE_1             (MEM_BASE_0 + MEM_SIZE_0)
-#define MEM_SIZE_1             SZ_128M
-#define PREFETCH_MEM_BASE_0    (MEM_BASE_1 + MEM_SIZE_1)
-#define PREFETCH_MEM_SIZE_0    SZ_128M
-#define PREFETCH_MEM_BASE_1    (PREFETCH_MEM_BASE_0 + PREFETCH_MEM_SIZE_0)
-#define PREFETCH_MEM_SIZE_1    SZ_128M
-
-#define  PCIE_CONF_BUS(b)      ((b) << 16)
-#define  PCIE_CONF_DEV(d)      ((d) << 11)
-#define  PCIE_CONF_FUNC(f)     ((f) << 8)
-#define  PCIE_CONF_REG(r)      \
-       (((r) & ~0x3) | (((r) < 256) ? PCIE_CFG_OFF : PCIE_EXT_CFG_OFF))
-
-struct tegra_pcie_port {
-       int                     index;
-       u8                      root_bus_nr;
-       void __iomem            *base;
-
-       bool                    link_up;
-
-       char                    mem_space_name[16];
-       char                    prefetch_space_name[20];
-       struct resource         res[2];
-};
-
-struct tegra_pcie_info {
-       struct tegra_pcie_port  port[2];
-       int                     num_ports;
-
-       void __iomem            *regs;
-       struct resource         res_mmio;
-
-       struct clk              *pex_clk;
-       struct clk              *afi_clk;
-       struct clk              *pcie_xclk;
-       struct clk              *pll_e;
-};
-
-static struct tegra_pcie_info tegra_pcie;
-
-static inline void afi_writel(u32 value, unsigned long offset)
-{
-       writel(value, offset + AFI_OFFSET + tegra_pcie.regs);
-}
-
-static inline u32 afi_readl(unsigned long offset)
-{
-       return readl(offset + AFI_OFFSET + tegra_pcie.regs);
-}
-
-static inline void pads_writel(u32 value, unsigned long offset)
-{
-       writel(value, offset + PADS_OFFSET + tegra_pcie.regs);
-}
-
-static inline u32 pads_readl(unsigned long offset)
-{
-       return readl(offset + PADS_OFFSET + tegra_pcie.regs);
-}
-
-static struct tegra_pcie_port *bus_to_port(int bus)
-{
-       int i;
-
-       for (i = tegra_pcie.num_ports - 1; i >= 0; i--) {
-               int rbus = tegra_pcie.port[i].root_bus_nr;
-               if (rbus != -1 && rbus == bus)
-                       break;
-       }
-
-       return i >= 0 ? tegra_pcie.port + i : NULL;
-}
-
-static int tegra_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
-                               int where, int size, u32 *val)
-{
-       struct tegra_pcie_port *pp = bus_to_port(bus->number);
-       void __iomem *addr;
-
-       if (pp) {
-               if (devfn != 0) {
-                       *val = 0xffffffff;
-                       return PCIBIOS_DEVICE_NOT_FOUND;
-               }
-
-               addr = pp->base + (where & ~0x3);
-       } else {
-               addr = tegra_pcie.regs + (PCIE_CONF_BUS(bus->number) +
-                                         PCIE_CONF_DEV(PCI_SLOT(devfn)) +
-                                         PCIE_CONF_FUNC(PCI_FUNC(devfn)) +
-                                         PCIE_CONF_REG(where));
-       }
-
-       *val = readl(addr);
-
-       if (size == 1)
-               *val = (*val >> (8 * (where & 3))) & 0xff;
-       else if (size == 2)
-               *val = (*val >> (8 * (where & 3))) & 0xffff;
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int tegra_pcie_write_conf(struct pci_bus *bus, unsigned int devfn,
-                                int where, int size, u32 val)
-{
-       struct tegra_pcie_port *pp = bus_to_port(bus->number);
-       void __iomem *addr;
-
-       u32 mask;
-       u32 tmp;
-
-       if (pp) {
-               if (devfn != 0)
-                       return PCIBIOS_DEVICE_NOT_FOUND;
-
-               addr = pp->base + (where & ~0x3);
-       } else {
-               addr = tegra_pcie.regs + (PCIE_CONF_BUS(bus->number) +
-                                         PCIE_CONF_DEV(PCI_SLOT(devfn)) +
-                                         PCIE_CONF_FUNC(PCI_FUNC(devfn)) +
-                                         PCIE_CONF_REG(where));
-       }
-
-       if (size == 4) {
-               writel(val, addr);
-               return PCIBIOS_SUCCESSFUL;
-       }
-
-       if (size == 2)
-               mask = ~(0xffff << ((where & 0x3) * 8));
-       else if (size == 1)
-               mask = ~(0xff << ((where & 0x3) * 8));
-       else
-               return PCIBIOS_BAD_REGISTER_NUMBER;
-
-       tmp = readl(addr) & mask;
-       tmp |= val << ((where & 0x3) * 8);
-       writel(tmp, addr);
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops tegra_pcie_ops = {
-       .read   = tegra_pcie_read_conf,
-       .write  = tegra_pcie_write_conf,
-};
-
-static void tegra_pcie_fixup_bridge(struct pci_dev *dev)
-{
-       u16 reg;
-
-       if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE) {
-               pci_read_config_word(dev, PCI_COMMAND, &reg);
-               reg |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
-                       PCI_COMMAND_MASTER | PCI_COMMAND_SERR);
-               pci_write_config_word(dev, PCI_COMMAND, reg);
-       }
-}
-DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_fixup_bridge);
-
-/* Tegra PCIE root complex wrongly reports device class */
-static void tegra_pcie_fixup_class(struct pci_dev *dev)
-{
-       dev->class = PCI_CLASS_BRIDGE_PCI << 8;
-}
-DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf0, tegra_pcie_fixup_class);
-DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class);
-
-/* Tegra PCIE requires relaxed ordering */
-static void tegra_pcie_relax_enable(struct pci_dev *dev)
-{
-       pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN);
-}
-DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable);
-
-static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
-{
-       struct tegra_pcie_port *pp;
-
-       if (nr >= tegra_pcie.num_ports)
-               return 0;
-
-       pp = tegra_pcie.port + nr;
-       pp->root_bus_nr = sys->busnr;
-
-       pci_ioremap_io(nr * SZ_64K, TEGRA_PCIE_IO_BASE);
-
-       /*
-        * IORESOURCE_MEM
-        */
-       snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
-                "PCIe %d MEM", pp->index);
-       pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
-       pp->res[0].name = pp->mem_space_name;
-       if (pp->index == 0) {
-               pp->res[0].start = MEM_BASE_0;
-               pp->res[0].end = pp->res[0].start + MEM_SIZE_0 - 1;
-       } else {
-               pp->res[0].start = MEM_BASE_1;
-               pp->res[0].end = pp->res[0].start + MEM_SIZE_1 - 1;
-       }
-       pp->res[0].flags = IORESOURCE_MEM;
-       if (request_resource(&iomem_resource, &pp->res[0]))
-               panic("Request PCIe Memory resource failed\n");
-       pci_add_resource_offset(&sys->resources, &pp->res[0], sys->mem_offset);
-
-       /*
-        * IORESOURCE_MEM | IORESOURCE_PREFETCH
-        */
-       snprintf(pp->prefetch_space_name, sizeof(pp->prefetch_space_name),
-                "PCIe %d PREFETCH MEM", pp->index);
-       pp->prefetch_space_name[sizeof(pp->prefetch_space_name) - 1] = 0;
-       pp->res[1].name = pp->prefetch_space_name;
-       if (pp->index == 0) {
-               pp->res[1].start = PREFETCH_MEM_BASE_0;
-               pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_0 - 1;
-       } else {
-               pp->res[1].start = PREFETCH_MEM_BASE_1;
-               pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_1 - 1;
-       }
-       pp->res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
-       if (request_resource(&iomem_resource, &pp->res[1]))
-               panic("Request PCIe Prefetch Memory resource failed\n");
-       pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset);
-
-       return 1;
-}
-
-static int tegra_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
-{
-       return INT_PCIE_INTR;
-}
-
-static struct pci_bus __init *tegra_pcie_scan_bus(int nr,
-                                                 struct pci_sys_data *sys)
-{
-       struct tegra_pcie_port *pp;
-
-       if (nr >= tegra_pcie.num_ports)
-               return NULL;
-
-       pp = tegra_pcie.port + nr;
-       pp->root_bus_nr = sys->busnr;
-
-       return pci_scan_root_bus(NULL, sys->busnr, &tegra_pcie_ops, sys,
-                                &sys->resources);
-}
-
-static struct hw_pci tegra_pcie_hw __initdata = {
-       .nr_controllers = 2,
-       .setup          = tegra_pcie_setup,
-       .scan           = tegra_pcie_scan_bus,
-       .map_irq        = tegra_pcie_map_irq,
-};
-
-
-static irqreturn_t tegra_pcie_isr(int irq, void *arg)
-{
-       const char *err_msg[] = {
-               "Unknown",
-               "AXI slave error",
-               "AXI decode error",
-               "Target abort",
-               "Master abort",
-               "Invalid write",
-               "Response decoding error",
-               "AXI response decoding error",
-               "Transcation timeout",
-       };
-
-       u32 code, signature;
-
-       code = afi_readl(AFI_INTR_CODE) & AFI_INTR_CODE_MASK;
-       signature = afi_readl(AFI_INTR_SIGNATURE);
-       afi_writel(0, AFI_INTR_CODE);
-
-       if (code == AFI_INTR_LEGACY)
-               return IRQ_NONE;
-
-       if (code >= ARRAY_SIZE(err_msg))
-               code = 0;
-
-       /*
-        * do not pollute kernel log with master abort reports since they
-        * happen a lot during enumeration
-        */
-       if (code == AFI_INTR_MASTER_ABORT)
-               pr_debug("PCIE: %s, signature: %08x\n", err_msg[code], signature);
-       else
-               pr_err("PCIE: %s, signature: %08x\n", err_msg[code], signature);
-
-       return IRQ_HANDLED;
-}
-
-static void tegra_pcie_setup_translations(void)
-{
-       u32 fpci_bar;
-       u32 size;
-       u32 axi_address;
-
-       /* Bar 0: config Bar */
-       fpci_bar = ((u32)0xfdff << 16);
-       size = PCIE_CFG_SZ;
-       axi_address = TEGRA_PCIE_BASE + PCIE_CFG_OFF;
-       afi_writel(axi_address, AFI_AXI_BAR0_START);
-       afi_writel(size >> 12, AFI_AXI_BAR0_SZ);
-       afi_writel(fpci_bar, AFI_FPCI_BAR0);
-
-       /* Bar 1: extended config Bar */
-       fpci_bar = ((u32)0xfe1 << 20);
-       size = PCIE_EXT_CFG_SZ;
-       axi_address = TEGRA_PCIE_BASE + PCIE_EXT_CFG_OFF;
-       afi_writel(axi_address, AFI_AXI_BAR1_START);
-       afi_writel(size >> 12, AFI_AXI_BAR1_SZ);
-       afi_writel(fpci_bar, AFI_FPCI_BAR1);
-
-       /* Bar 2: downstream IO bar */
-       fpci_bar = ((__u32)0xfdfc << 16);
-       size = SZ_128K;
-       axi_address = TEGRA_PCIE_IO_BASE;
-       afi_writel(axi_address, AFI_AXI_BAR2_START);
-       afi_writel(size >> 12, AFI_AXI_BAR2_SZ);
-       afi_writel(fpci_bar, AFI_FPCI_BAR2);
-
-       /* Bar 3: prefetchable memory BAR */
-       fpci_bar = (((PREFETCH_MEM_BASE_0 >> 12) & 0x0fffffff) << 4) | 0x1;
-       size =  PREFETCH_MEM_SIZE_0 +  PREFETCH_MEM_SIZE_1;
-       axi_address = PREFETCH_MEM_BASE_0;
-       afi_writel(axi_address, AFI_AXI_BAR3_START);
-       afi_writel(size >> 12, AFI_AXI_BAR3_SZ);
-       afi_writel(fpci_bar, AFI_FPCI_BAR3);
-
-       /* Bar 4: non prefetchable memory BAR */
-       fpci_bar = (((MEM_BASE_0 >> 12) & 0x0FFFFFFF) << 4) | 0x1;
-       size = MEM_SIZE_0 + MEM_SIZE_1;
-       axi_address = MEM_BASE_0;
-       afi_writel(axi_address, AFI_AXI_BAR4_START);
-       afi_writel(size >> 12, AFI_AXI_BAR4_SZ);
-       afi_writel(fpci_bar, AFI_FPCI_BAR4);
-
-       /* Bar 5: NULL out the remaining BAR as it is not used */
-       fpci_bar = 0;
-       size = 0;
-       axi_address = 0;
-       afi_writel(axi_address, AFI_AXI_BAR5_START);
-       afi_writel(size >> 12, AFI_AXI_BAR5_SZ);
-       afi_writel(fpci_bar, AFI_FPCI_BAR5);
-
-       /* map all upstream transactions as uncached */
-       afi_writel(PHYS_OFFSET, AFI_CACHE_BAR0_ST);
-       afi_writel(0, AFI_CACHE_BAR0_SZ);
-       afi_writel(0, AFI_CACHE_BAR1_ST);
-       afi_writel(0, AFI_CACHE_BAR1_SZ);
-
-       /* No MSI */
-       afi_writel(0, AFI_MSI_FPCI_BAR_ST);
-       afi_writel(0, AFI_MSI_BAR_SZ);
-       afi_writel(0, AFI_MSI_AXI_BAR_ST);
-       afi_writel(0, AFI_MSI_BAR_SZ);
-}
-
-static int tegra_pcie_enable_controller(void)
-{
-       u32 val, reg;
-       int i, timeout;
-
-       /* Enable slot clock and pulse the reset signals */
-       for (i = 0, reg = AFI_PEX0_CTRL; i < 2; i++, reg += 0x8) {
-               val = afi_readl(reg) |  AFI_PEX_CTRL_REFCLK_EN;
-               afi_writel(val, reg);
-               val &= ~AFI_PEX_CTRL_RST;
-               afi_writel(val, reg);
-
-               val = afi_readl(reg) | AFI_PEX_CTRL_RST;
-               afi_writel(val, reg);
-       }
-
-       /* Enable dual controller and both ports */
-       val = afi_readl(AFI_PCIE_CONFIG);
-       val &= ~(AFI_PCIE_CONFIG_PCIEC0_DISABLE_DEVICE |
-                AFI_PCIE_CONFIG_PCIEC1_DISABLE_DEVICE |
-                AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_MASK);
-       val |= AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_DUAL;
-       afi_writel(val, AFI_PCIE_CONFIG);
-
-       val = afi_readl(AFI_FUSE) & ~AFI_FUSE_PCIE_T0_GEN2_DIS;
-       afi_writel(val, AFI_FUSE);
-
-       /* Initialze internal PHY, enable up to 16 PCIE lanes */
-       pads_writel(0x0, PADS_CTL_SEL);
-
-       /* override IDDQ to 1 on all 4 lanes */
-       val = pads_readl(PADS_CTL) | PADS_CTL_IDDQ_1L;
-       pads_writel(val, PADS_CTL);
-
-       /*
-        * set up PHY PLL inputs select PLLE output as refclock,
-        * set TX ref sel to div10 (not div5)
-        */
-       val = pads_readl(PADS_PLL_CTL);
-       val &= ~(PADS_PLL_CTL_REFCLK_MASK | PADS_PLL_CTL_TXCLKREF_MASK);
-       val |= (PADS_PLL_CTL_REFCLK_INTERNAL_CML | PADS_PLL_CTL_TXCLKREF_DIV10);
-       pads_writel(val, PADS_PLL_CTL);
-
-       /* take PLL out of reset  */
-       val = pads_readl(PADS_PLL_CTL) | PADS_PLL_CTL_RST_B4SM;
-       pads_writel(val, PADS_PLL_CTL);
-
-       /*
-        * Hack, set the clock voltage to the DEFAULT provided by hw folks.
-        * This doesn't exist in the documentation
-        */
-       pads_writel(0xfa5cfa5c, 0xc8);
-
-       /* Wait for the PLL to lock */
-       timeout = 300;
-       do {
-               val = pads_readl(PADS_PLL_CTL);
-               usleep_range(1000, 1000);
-               if (--timeout == 0) {
-                       pr_err("Tegra PCIe error: timeout waiting for PLL\n");
-                       return -EBUSY;
-               }
-       } while (!(val & PADS_PLL_CTL_LOCKDET));
-
-       /* turn off IDDQ override */
-       val = pads_readl(PADS_CTL) & ~PADS_CTL_IDDQ_1L;
-       pads_writel(val, PADS_CTL);
-
-       /* enable TX/RX data */
-       val = pads_readl(PADS_CTL);
-       val |= (PADS_CTL_TX_DATA_EN_1L | PADS_CTL_RX_DATA_EN_1L);
-       pads_writel(val, PADS_CTL);
-
-       /* Take the PCIe interface module out of reset */
-       tegra_periph_reset_deassert(tegra_pcie.pcie_xclk);
-
-       /* Finally enable PCIe */
-       val = afi_readl(AFI_CONFIGURATION) | AFI_CONFIGURATION_EN_FPCI;
-       afi_writel(val, AFI_CONFIGURATION);
-
-       val = (AFI_INTR_EN_INI_SLVERR | AFI_INTR_EN_INI_DECERR |
-              AFI_INTR_EN_TGT_SLVERR | AFI_INTR_EN_TGT_DECERR |
-              AFI_INTR_EN_TGT_WRERR | AFI_INTR_EN_DFPCI_DECERR);
-       afi_writel(val, AFI_AFI_INTR_ENABLE);
-       afi_writel(0xffffffff, AFI_SM_INTR_ENABLE);
-
-       /* FIXME: No MSI for now, only INT */
-       afi_writel(AFI_INTR_MASK_INT_MASK, AFI_INTR_MASK);
-
-       /* Disable all execptions */
-       afi_writel(0, AFI_FPCI_ERROR_MASKS);
-
-       return 0;
-}
-
-static void tegra_pcie_xclk_clamp(bool clamp)
-{
-       u32 reg;
-
-       reg = pmc_readl(PMC_SCRATCH42) & ~PMC_SCRATCH42_PCX_CLAMP;
-
-       if (clamp)
-               reg |= PMC_SCRATCH42_PCX_CLAMP;
-
-       pmc_writel(reg, PMC_SCRATCH42);
-}
-
-static void tegra_pcie_power_off(void)
-{
-       tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
-       tegra_periph_reset_assert(tegra_pcie.afi_clk);
-       tegra_periph_reset_assert(tegra_pcie.pex_clk);
-
-       tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
-       tegra_pcie_xclk_clamp(true);
-}
-
-static int tegra_pcie_power_regate(void)
-{
-       int err;
-
-       tegra_pcie_power_off();
-
-       tegra_pcie_xclk_clamp(true);
-
-       tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
-       tegra_periph_reset_assert(tegra_pcie.afi_clk);
-
-       err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
-                                               tegra_pcie.pex_clk);
-       if (err) {
-               pr_err("PCIE: powerup sequence failed: %d\n", err);
-               return err;
-       }
-
-       tegra_periph_reset_deassert(tegra_pcie.afi_clk);
-
-       tegra_pcie_xclk_clamp(false);
-
-       clk_prepare_enable(tegra_pcie.afi_clk);
-       clk_prepare_enable(tegra_pcie.pex_clk);
-       return clk_prepare_enable(tegra_pcie.pll_e);
-}
-
-static int tegra_pcie_clocks_get(void)
-{
-       int err;
-
-       tegra_pcie.pex_clk = clk_get(NULL, "pex");
-       if (IS_ERR(tegra_pcie.pex_clk))
-               return PTR_ERR(tegra_pcie.pex_clk);
-
-       tegra_pcie.afi_clk = clk_get(NULL, "afi");
-       if (IS_ERR(tegra_pcie.afi_clk)) {
-               err = PTR_ERR(tegra_pcie.afi_clk);
-               goto err_afi_clk;
-       }
-
-       tegra_pcie.pcie_xclk = clk_get(NULL, "pcie_xclk");
-       if (IS_ERR(tegra_pcie.pcie_xclk)) {
-               err =  PTR_ERR(tegra_pcie.pcie_xclk);
-               goto err_pcie_xclk;
-       }
-
-       tegra_pcie.pll_e = clk_get_sys(NULL, "pll_e");
-       if (IS_ERR(tegra_pcie.pll_e)) {
-               err = PTR_ERR(tegra_pcie.pll_e);
-               goto err_pll_e;
-       }
-
-       return 0;
-
-err_pll_e:
-       clk_put(tegra_pcie.pcie_xclk);
-err_pcie_xclk:
-       clk_put(tegra_pcie.afi_clk);
-err_afi_clk:
-       clk_put(tegra_pcie.pex_clk);
-
-       return err;
-}
-
-static void tegra_pcie_clocks_put(void)
-{
-       clk_put(tegra_pcie.pll_e);
-       clk_put(tegra_pcie.pcie_xclk);
-       clk_put(tegra_pcie.afi_clk);
-       clk_put(tegra_pcie.pex_clk);
-}
-
-static int __init tegra_pcie_get_resources(void)
-{
-       int err;
-
-       err = tegra_pcie_clocks_get();
-       if (err) {
-               pr_err("PCIE: failed to get clocks: %d\n", err);
-               return err;
-       }
-
-       err = tegra_pcie_power_regate();
-       if (err) {
-               pr_err("PCIE: failed to power up: %d\n", err);
-               goto err_pwr_on;
-       }
-
-       tegra_pcie.regs = ioremap_nocache(TEGRA_PCIE_BASE, PCIE_IOMAP_SZ);
-       if (tegra_pcie.regs == NULL) {
-               pr_err("PCIE: Failed to map PCI/AFI registers\n");
-               err = -ENOMEM;
-               goto err_map_reg;
-       }
-
-       err = request_irq(INT_PCIE_INTR, tegra_pcie_isr,
-                         IRQF_SHARED, "PCIE", &tegra_pcie);
-       if (err) {
-               pr_err("PCIE: Failed to register IRQ: %d\n", err);
-               goto err_req_io;
-       }
-       set_irq_flags(INT_PCIE_INTR, IRQF_VALID);
-
-       return 0;
-
-err_req_io:
-       iounmap(tegra_pcie.regs);
-err_map_reg:
-       tegra_pcie_power_off();
-err_pwr_on:
-       tegra_pcie_clocks_put();
-
-       return err;
-}
-
-/*
- * FIXME: If there are no PCIe cards attached, then calling this function
- * can result in the increase of the bootup time as there are big timeout
- * loops.
- */
-#define TEGRA_PCIE_LINKUP_TIMEOUT      200     /* up to 1.2 seconds */
-static bool tegra_pcie_check_link(struct tegra_pcie_port *pp, int idx,
-                                 u32 reset_reg)
-{
-       u32 reg;
-       int retries = 3;
-       int timeout;
-
-       do {
-               timeout = TEGRA_PCIE_LINKUP_TIMEOUT;
-               while (timeout) {
-                       reg = readl(pp->base + RP_VEND_XP);
-
-                       if (reg & RP_VEND_XP_DL_UP)
-                               break;
-
-                       mdelay(1);
-                       timeout--;
-               }
-
-               if (!timeout)  {
-                       pr_err("PCIE: port %d: link down, retrying\n", idx);
-                       goto retry;
-               }
-
-               timeout = TEGRA_PCIE_LINKUP_TIMEOUT;
-               while (timeout) {
-                       reg = readl(pp->base + RP_LINK_CONTROL_STATUS);
-
-                       if (reg & 0x20000000)
-                               return true;
-
-                       mdelay(1);
-                       timeout--;
-               }
-
-retry:
-               /* Pulse the PEX reset */
-               reg = afi_readl(reset_reg) | AFI_PEX_CTRL_RST;
-               afi_writel(reg, reset_reg);
-               mdelay(1);
-               reg = afi_readl(reset_reg) & ~AFI_PEX_CTRL_RST;
-               afi_writel(reg, reset_reg);
-
-               retries--;
-       } while (retries);
-
-       return false;
-}
-
-static void __init tegra_pcie_add_port(int index, u32 offset, u32 reset_reg)
-{
-       struct tegra_pcie_port *pp;
-
-       pp = tegra_pcie.port + tegra_pcie.num_ports;
-
-       pp->index = -1;
-       pp->base = tegra_pcie.regs + offset;
-       pp->link_up = tegra_pcie_check_link(pp, index, reset_reg);
-
-       if (!pp->link_up) {
-               pp->base = NULL;
-               printk(KERN_INFO "PCIE: port %d: link down, ignoring\n", index);
-               return;
-       }
-
-       tegra_pcie.num_ports++;
-       pp->index = index;
-       pp->root_bus_nr = -1;
-       memset(pp->res, 0, sizeof(pp->res));
-}
-
-int __init tegra_pcie_init(bool init_port0, bool init_port1)
-{
-       int err;
-
-       if (!(init_port0 || init_port1))
-               return -ENODEV;
-
-       pcibios_min_mem = 0;
-
-       err = tegra_pcie_get_resources();
-       if (err)
-               return err;
-
-       err = tegra_pcie_enable_controller();
-       if (err)
-               return err;
-
-       /* setup the AFI address translations */
-       tegra_pcie_setup_translations();
-
-       if (init_port0)
-               tegra_pcie_add_port(0, RP0_OFFSET, AFI_PEX0_CTRL);
-
-       if (init_port1)
-               tegra_pcie_add_port(1, RP1_OFFSET, AFI_PEX1_CTRL);
-
-       pci_common_init(&tegra_pcie_hw);
-
-       return 0;
-}
index 97b33a2..2d02036 100644 (file)
@@ -196,6 +196,5 @@ struct smp_operations tegra_smp_ops __initdata = {
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_kill               = tegra_cpu_kill,
        .cpu_die                = tegra_cpu_die,
-       .cpu_disable            = tegra_cpu_disable,
 #endif
 };
diff --git a/arch/arm/mach-tegra/pm-tegra20.c b/arch/arm/mach-tegra/pm-tegra20.c
new file mode 100644 (file)
index 0000000..d65e1d7
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2013, NVIDIA 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/kernel.h>
+
+#include "pm.h"
+
+#ifdef CONFIG_PM_SLEEP
+extern u32 tegra20_iram_start, tegra20_iram_end;
+extern void tegra20_sleep_core_finish(unsigned long);
+
+void tegra20_lp1_iram_hook(void)
+{
+       tegra_lp1_iram.start_addr = &tegra20_iram_start;
+       tegra_lp1_iram.end_addr = &tegra20_iram_end;
+}
+
+void tegra20_sleep_core_init(void)
+{
+       tegra_sleep_core_finish = tegra20_sleep_core_finish;
+}
+#endif
diff --git a/arch/arm/mach-tegra/pm-tegra30.c b/arch/arm/mach-tegra/pm-tegra30.c
new file mode 100644 (file)
index 0000000..8fa326d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2013, NVIDIA 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/kernel.h>
+
+#include "pm.h"
+
+#ifdef CONFIG_PM_SLEEP
+extern u32 tegra30_iram_start, tegra30_iram_end;
+extern void tegra30_sleep_core_finish(unsigned long);
+
+void tegra30_lp1_iram_hook(void)
+{
+       tegra_lp1_iram.start_addr = &tegra30_iram_start;
+       tegra_lp1_iram.end_addr = &tegra30_iram_end;
+}
+
+void tegra30_sleep_core_init(void)
+{
+       tegra_sleep_core_finish = tegra30_sleep_core_finish;
+}
+#endif
index 261fec1..ed294a0 100644 (file)
 #include "reset.h"
 #include "flowctrl.h"
 #include "fuse.h"
+#include "pm.h"
 #include "pmc.h"
 #include "sleep.h"
 
 #ifdef CONFIG_PM_SLEEP
 static DEFINE_SPINLOCK(tegra_lp2_lock);
+static u32 iram_save_size;
+static void *iram_save_addr;
+struct tegra_lp1_iram tegra_lp1_iram;
 void (*tegra_tear_down_cpu)(void);
+void (*tegra_sleep_core_finish)(unsigned long v2p);
+static int (*tegra_sleep_func)(unsigned long v2p);
 
 static void tegra_tear_down_cpu_init(void)
 {
@@ -52,7 +58,9 @@ static void tegra_tear_down_cpu_init(void)
                        tegra_tear_down_cpu = tegra20_tear_down_cpu;
                break;
        case TEGRA30:
-               if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC))
+       case TEGRA114:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) ||
+                   IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC))
                        tegra_tear_down_cpu = tegra30_tear_down_cpu;
                break;
        }
@@ -171,19 +179,109 @@ void tegra_idle_lp2_last(void)
 enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
                                enum tegra_suspend_mode mode)
 {
-       /* Tegra114 didn't support any suspending mode yet. */
-       if (tegra_chip_id == TEGRA114)
-               return TEGRA_SUSPEND_NONE;
-
        /*
-        * The Tegra devices only support suspending to LP2 currently.
+        * The Tegra devices support suspending to LP1 or lower currently.
         */
-       if (mode > TEGRA_SUSPEND_LP2)
-               return TEGRA_SUSPEND_LP2;
+       if (mode > TEGRA_SUSPEND_LP1)
+               return TEGRA_SUSPEND_LP1;
 
        return mode;
 }
 
+static int tegra_sleep_core(unsigned long v2p)
+{
+       setup_mm_for_reboot();
+       tegra_sleep_core_finish(v2p);
+
+       /* should never here */
+       BUG();
+
+       return 0;
+}
+
+/*
+ * tegra_lp1_iram_hook
+ *
+ * Hooking the address of LP1 reset vector and SDRAM self-refresh code in
+ * SDRAM. These codes not be copied to IRAM in this fuction. We need to
+ * copy these code to IRAM before LP0/LP1 suspend and restore the content
+ * of IRAM after resume.
+ */
+static bool tegra_lp1_iram_hook(void)
+{
+       switch (tegra_chip_id) {
+       case TEGRA20:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
+                       tegra20_lp1_iram_hook();
+               break;
+       case TEGRA30:
+       case TEGRA114:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) ||
+                   IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC))
+                       tegra30_lp1_iram_hook();
+               break;
+       default:
+               break;
+       }
+
+       if (!tegra_lp1_iram.start_addr || !tegra_lp1_iram.end_addr)
+               return false;
+
+       iram_save_size = tegra_lp1_iram.end_addr - tegra_lp1_iram.start_addr;
+       iram_save_addr = kmalloc(iram_save_size, GFP_KERNEL);
+       if (!iram_save_addr)
+               return false;
+
+       return true;
+}
+
+static bool tegra_sleep_core_init(void)
+{
+       switch (tegra_chip_id) {
+       case TEGRA20:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
+                       tegra20_sleep_core_init();
+               break;
+       case TEGRA30:
+       case TEGRA114:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) ||
+                   IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC))
+                       tegra30_sleep_core_init();
+               break;
+       default:
+               break;
+       }
+
+       if (!tegra_sleep_core_finish)
+               return false;
+
+       return true;
+}
+
+static void tegra_suspend_enter_lp1(void)
+{
+       tegra_pmc_suspend();
+
+       /* copy the reset vector & SDRAM shutdown code into IRAM */
+       memcpy(iram_save_addr, IO_ADDRESS(TEGRA_IRAM_CODE_AREA),
+               iram_save_size);
+       memcpy(IO_ADDRESS(TEGRA_IRAM_CODE_AREA), tegra_lp1_iram.start_addr,
+               iram_save_size);
+
+       *((u32 *)tegra_cpu_lp1_mask) = 1;
+}
+
+static void tegra_suspend_exit_lp1(void)
+{
+       tegra_pmc_resume();
+
+       /* restore IRAM */
+       memcpy(IO_ADDRESS(TEGRA_IRAM_CODE_AREA), iram_save_addr,
+               iram_save_size);
+
+       *(u32 *)tegra_cpu_lp1_mask = 0;
+}
+
 static const char *lp_state[TEGRA_MAX_SUSPEND_MODE] = {
        [TEGRA_SUSPEND_NONE] = "none",
        [TEGRA_SUSPEND_LP2] = "LP2",
@@ -207,6 +305,9 @@ static int tegra_suspend_enter(suspend_state_t state)
 
        suspend_cpu_complex();
        switch (mode) {
+       case TEGRA_SUSPEND_LP1:
+               tegra_suspend_enter_lp1();
+               break;
        case TEGRA_SUSPEND_LP2:
                tegra_set_cpu_in_lp2();
                break;
@@ -214,9 +315,12 @@ static int tegra_suspend_enter(suspend_state_t state)
                break;
        }
 
-       cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu);
+       cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, tegra_sleep_func);
 
        switch (mode) {
+       case TEGRA_SUSPEND_LP1:
+               tegra_suspend_exit_lp1();
+               break;
        case TEGRA_SUSPEND_LP2:
                tegra_clear_cpu_in_lp2();
                break;
@@ -237,12 +341,36 @@ static const struct platform_suspend_ops tegra_suspend_ops = {
 
 void __init tegra_init_suspend(void)
 {
-       if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NONE)
+       enum tegra_suspend_mode mode = tegra_pmc_get_suspend_mode();
+
+       if (mode == TEGRA_SUSPEND_NONE)
                return;
 
        tegra_tear_down_cpu_init();
        tegra_pmc_suspend_init();
 
+       if (mode >= TEGRA_SUSPEND_LP1) {
+               if (!tegra_lp1_iram_hook() || !tegra_sleep_core_init()) {
+                       pr_err("%s: unable to allocate memory for SDRAM"
+                              "self-refresh -- LP0/LP1 unavailable\n",
+                              __func__);
+                       tegra_pmc_set_suspend_mode(TEGRA_SUSPEND_LP2);
+                       mode = TEGRA_SUSPEND_LP2;
+               }
+       }
+
+       /* set up sleep function for cpu_suspend */
+       switch (mode) {
+       case TEGRA_SUSPEND_LP1:
+               tegra_sleep_func = tegra_sleep_core;
+               break;
+       case TEGRA_SUSPEND_LP2:
+               tegra_sleep_func = tegra_sleep_cpu;
+               break;
+       default:
+               break;
+       }
+
        suspend_set_ops(&tegra_suspend_ops);
 }
 #endif
index 94c4b9d..fe204e5 100644 (file)
 
 #include "pmc.h"
 
+struct tegra_lp1_iram {
+       void    *start_addr;
+       void    *end_addr;
+};
+extern struct tegra_lp1_iram tegra_lp1_iram;
+extern void (*tegra_sleep_core_finish)(unsigned long v2p);
+
+void tegra20_lp1_iram_hook(void);
+void tegra20_sleep_core_init(void);
+void tegra30_lp1_iram_hook(void);
+void tegra30_sleep_core_init(void);
+
 extern unsigned long l2x0_saved_regs_addr;
 
 void save_cpu_arch_register(void);
index eb3fa4a..8acb881 100644 (file)
 #include <linux/of.h>
 #include <linux/of_address.h>
 
+#include "flowctrl.h"
 #include "fuse.h"
 #include "pm.h"
 #include "pmc.h"
 #include "sleep.h"
 
+#define TEGRA_POWER_SYSCLK_POLARITY    (1 << 10)  /* sys clk polarity */
+#define TEGRA_POWER_SYSCLK_OE          (1 << 11)  /* system clock enable */
 #define TEGRA_POWER_EFFECT_LP0         (1 << 14)  /* LP0 when CPU pwr gated */
 #define TEGRA_POWER_CPU_PWRREQ_POLARITY        (1 << 15)  /* CPU pwr req polarity */
 #define TEGRA_POWER_CPU_PWRREQ_OE      (1 << 16)  /* CPU pwr req enable */
@@ -193,16 +196,50 @@ enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void)
        return pmc_pm_data.suspend_mode;
 }
 
+void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode)
+{
+       if (mode < TEGRA_SUSPEND_NONE || mode >= TEGRA_MAX_SUSPEND_MODE)
+               return;
+
+       pmc_pm_data.suspend_mode = mode;
+}
+
+void tegra_pmc_suspend(void)
+{
+       tegra_pmc_writel(virt_to_phys(tegra_resume), PMC_SCRATCH41);
+}
+
+void tegra_pmc_resume(void)
+{
+       tegra_pmc_writel(0x0, PMC_SCRATCH41);
+}
+
 void tegra_pmc_pm_set(enum tegra_suspend_mode mode)
 {
-       u32 reg;
+       u32 reg, csr_reg;
        unsigned long rate = 0;
 
        reg = tegra_pmc_readl(PMC_CTRL);
        reg |= TEGRA_POWER_CPU_PWRREQ_OE;
        reg &= ~TEGRA_POWER_EFFECT_LP0;
 
+       switch (tegra_chip_id) {
+       case TEGRA20:
+       case TEGRA30:
+               break;
+       default:
+               /* Turn off CRAIL */
+               csr_reg = flowctrl_read_cpu_csr(0);
+               csr_reg &= ~FLOW_CTRL_CSR_ENABLE_EXT_MASK;
+               csr_reg |= FLOW_CTRL_CSR_ENABLE_EXT_CRAIL;
+               flowctrl_write_cpu_csr(0, csr_reg);
+               break;
+       }
+
        switch (mode) {
+       case TEGRA_SUSPEND_LP1:
+               rate = 32768;
+               break;
        case TEGRA_SUSPEND_LP2:
                rate = clk_get_rate(tegra_pclk);
                break;
@@ -224,6 +261,20 @@ void tegra_pmc_suspend_init(void)
        reg = tegra_pmc_readl(PMC_CTRL);
        reg |= TEGRA_POWER_CPU_PWRREQ_OE;
        tegra_pmc_writel(reg, PMC_CTRL);
+
+       reg = tegra_pmc_readl(PMC_CTRL);
+
+       if (!pmc_pm_data.sysclkreq_high)
+               reg |= TEGRA_POWER_SYSCLK_POLARITY;
+       else
+               reg &= ~TEGRA_POWER_SYSCLK_POLARITY;
+
+       /* configure the output polarity while the request is tristated */
+       tegra_pmc_writel(reg, PMC_CTRL);
+
+       /* now enable the request */
+       reg |= TEGRA_POWER_SYSCLK_OE;
+       tegra_pmc_writel(reg, PMC_CTRL);
 }
 #endif
 
index e1c2df2..549f8c7 100644 (file)
@@ -28,6 +28,9 @@ enum tegra_suspend_mode {
 
 #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);
+void tegra_pmc_suspend(void);
+void tegra_pmc_resume(void);
 void tegra_pmc_pm_set(enum tegra_suspend_mode mode);
 void tegra_pmc_suspend_init(void);
 #endif
index 39dc9e7..f527b2c 100644 (file)
  *       re-enabling sdram.
  *
  *     r6: SoC ID
+ *     r8: CPU part number
  */
 ENTRY(tegra_resume)
-       bl      v7_invalidate_l1
+       check_cpu_part_num 0xc09, r8, r9
+       bleq    v7_invalidate_l1
+       blne    tegra_init_l2_for_a15
 
        cpu_id  r0
        tegra_get_soc_id TEGRA_APB_MISC_BASE, r6
@@ -70,7 +73,8 @@ no_cpu0_chk:
        str     r1, [r2]
 1:
 
-       check_cpu_part_num 0xc09, r8, r9
+       mov32   r9, 0xc09
+       cmp     r8, r9
        bne     not_ca9
 #ifdef CONFIG_HAVE_ARM_SCU
        /* enable SCU */
@@ -178,6 +182,19 @@ after_errata:
 1:
 #endif
 
+       /* Waking up from LP1? */
+       ldr     r8, [r12, #RESET_DATA(MASK_LP1)]
+       tst     r8, r11                         @ if in_lp1
+       beq     __is_not_lp1
+       cmp     r10, #0
+       bne     __die                           @ only CPU0 can be here
+       ldr     lr, [r12, #RESET_DATA(STARTUP_LP1)]
+       cmp     lr, #0
+       bleq    __die                           @ no LP1 startup handler
+ THUMB(        add     lr, lr, #1 )                    @ switch to Thumb mode
+       bx      lr
+__is_not_lp1:
+
        /* Waking up from LP2? */
        ldr     r9, [r12, #RESET_DATA(MASK_LP2)]
        tst     r9, r11                         @ if in_lp2
index 1ac434e..fd0bbf8 100644 (file)
@@ -81,6 +81,8 @@ void __init tegra_cpu_reset_handler_init(void)
 #endif
 
 #ifdef CONFIG_PM_SLEEP
+       __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_LP1] =
+               TEGRA_IRAM_CODE_AREA;
        __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_LP2] =
                virt_to_phys((void *)tegra_resume);
 #endif
index c90d8e9..76a9343 100644 (file)
@@ -39,6 +39,10 @@ void __tegra_cpu_reset_handler_end(void);
 void tegra_secondary_startup(void);
 
 #ifdef CONFIG_PM_SLEEP
+#define tegra_cpu_lp1_mask \
+       (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
+       ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP1] - \
+        (u32)__tegra_cpu_reset_handler_start)))
 #define tegra_cpu_lp2_mask \
        (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
        ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP2] - \
index e3f2417..5c3bd11 100644 (file)
 #include <asm/assembler.h>
 #include <asm/proc-fns.h>
 #include <asm/cp15.h>
+#include <asm/cache.h>
 
 #include "sleep.h"
 #include "flowctrl.h"
 
+#define EMC_CFG                                0xc
+#define EMC_ADR_CFG                    0x10
+#define EMC_REFRESH                    0x70
+#define EMC_NOP                                0xdc
+#define EMC_SELF_REF                   0xe0
+#define EMC_REQ_CTRL                   0x2b0
+#define EMC_EMC_STATUS                 0x2b4
+
+#define CLK_RESET_CCLK_BURST           0x20
+#define CLK_RESET_CCLK_DIVIDER         0x24
+#define CLK_RESET_SCLK_BURST           0x28
+#define CLK_RESET_SCLK_DIVIDER         0x2c
+#define CLK_RESET_PLLC_BASE            0x80
+#define CLK_RESET_PLLM_BASE            0x90
+#define CLK_RESET_PLLP_BASE            0xa0
+
+#define APB_MISC_XM2CFGCPADCTRL                0x8c8
+#define APB_MISC_XM2CFGDPADCTRL                0x8cc
+#define APB_MISC_XM2CLKCFGPADCTRL      0x8d0
+#define APB_MISC_XM2COMPPADCTRL                0x8d4
+#define APB_MISC_XM2VTTGENPADCTRL      0x8d8
+#define APB_MISC_XM2CFGCPADCTRL2       0x8e4
+#define APB_MISC_XM2CFGDPADCTRL2       0x8e8
+
+.macro pll_enable, rd, r_car_base, pll_base
+       ldr     \rd, [\r_car_base, #\pll_base]
+       tst     \rd, #(1 << 30)
+       orreq   \rd, \rd, #(1 << 30)
+       streq   \rd, [\r_car_base, #\pll_base]
+.endm
+
+.macro emc_device_mask, rd, base
+       ldr     \rd, [\base, #EMC_ADR_CFG]
+       tst     \rd, #(0x3 << 24)
+       moveq   \rd, #(0x1 << 8)                @ just 1 device
+       movne   \rd, #(0x3 << 8)                @ 2 devices
+.endm
+
 #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PM_SLEEP)
 /*
  * tegra20_hotplug_shutdown(void)
@@ -181,6 +220,28 @@ ENTRY(tegra20_cpu_is_resettable_soon)
 ENDPROC(tegra20_cpu_is_resettable_soon)
 
 /*
+ * tegra20_sleep_core_finish(unsigned long v2p)
+ *
+ * Enters suspend in LP0 or LP1 by turning off the mmu and jumping to
+ * tegra20_tear_down_core in IRAM
+ */
+ENTRY(tegra20_sleep_core_finish)
+       /* Flush, disable the L1 data cache and exit SMP */
+       bl      tegra_disable_clean_inv_dcache
+
+       mov32   r3, tegra_shut_off_mmu
+       add     r3, r3, r0
+
+       mov32   r0, tegra20_tear_down_core
+       mov32   r1, tegra20_iram_start
+       sub     r0, r0, r1
+       mov32   r1, TEGRA_IRAM_CODE_AREA
+       add     r0, r0, r1
+
+       mov     pc, r3
+ENDPROC(tegra20_sleep_core_finish)
+
+/*
  * tegra20_sleep_cpu_secondary_finish(unsigned long v2p)
  *
  * Enters WFI on secondary CPU by exiting coherency.
@@ -191,6 +252,7 @@ ENTRY(tegra20_sleep_cpu_secondary_finish)
        mrc     p15, 0, r11, c1, c0, 1  @ save actlr before exiting coherency
 
        /* Flush and disable the L1 data cache */
+       mov     r0, #TEGRA_FLUSH_CACHE_LOUIS
        bl      tegra_disable_clean_inv_dcache
 
        mov32   r0, TEGRA_PMC_VIRT + PMC_SCRATCH41
@@ -250,6 +312,150 @@ ENTRY(tegra20_tear_down_cpu)
        b       tegra20_enter_sleep
 ENDPROC(tegra20_tear_down_cpu)
 
+/* START OF ROUTINES COPIED TO IRAM */
+       .align L1_CACHE_SHIFT
+       .globl tegra20_iram_start
+tegra20_iram_start:
+
+/*
+ * tegra20_lp1_reset
+ *
+ * reset vector for LP1 restore; copied into IRAM during suspend.
+ * Brings the system back up to a safe staring point (SDRAM out of
+ * self-refresh, PLLC, PLLM and PLLP reenabled, CPU running on PLLP,
+ * system clock running on the same PLL that it suspended at), and
+ * jumps to tegra_resume to restore virtual addressing and PLLX.
+ * The physical address of tegra_resume expected to be stored in
+ * PMC_SCRATCH41.
+ *
+ * NOTE: THIS *MUST* BE RELOCATED TO TEGRA_IRAM_CODE_AREA.
+ */
+ENTRY(tegra20_lp1_reset)
+       /*
+        * The CPU and system bus are running at 32KHz and executing from
+        * IRAM when this code is executed; immediately switch to CLKM and
+        * enable PLLM, PLLP, PLLC.
+        */
+       mov32   r0, TEGRA_CLK_RESET_BASE
+
+       mov     r1, #(1 << 28)
+       str     r1, [r0, #CLK_RESET_SCLK_BURST]
+       str     r1, [r0, #CLK_RESET_CCLK_BURST]
+       mov     r1, #0
+       str     r1, [r0, #CLK_RESET_CCLK_DIVIDER]
+       str     r1, [r0, #CLK_RESET_SCLK_DIVIDER]
+
+       pll_enable r1, r0, CLK_RESET_PLLM_BASE
+       pll_enable r1, r0, CLK_RESET_PLLP_BASE
+       pll_enable r1, r0, CLK_RESET_PLLC_BASE
+
+       adr     r2, tegra20_sdram_pad_address
+       adr     r4, tegra20_sdram_pad_save
+       mov     r5, #0
+
+       ldr     r6, tegra20_sdram_pad_size
+padload:
+       ldr     r7, [r2, r5]            @ r7 is the addr in the pad_address
+
+       ldr     r1, [r4, r5]
+       str     r1, [r7]                @ restore the value in pad_save
+
+       add     r5, r5, #4
+       cmp     r6, r5
+       bne     padload
+
+padload_done:
+       /* 255uS delay for PLL stabilization */
+       mov32   r7, TEGRA_TMRUS_BASE
+       ldr     r1, [r7]
+       add     r1, r1, #0xff
+       wait_until r1, r7, r9
+
+       adr     r4, tegra20_sclk_save
+       ldr     r4, [r4]
+       str     r4, [r0, #CLK_RESET_SCLK_BURST]
+       mov32   r4, ((1 << 28) | (4))   @ burst policy is PLLP
+       str     r4, [r0, #CLK_RESET_CCLK_BURST]
+
+       mov32   r0, TEGRA_EMC_BASE
+       ldr     r1, [r0, #EMC_CFG]
+       bic     r1, r1, #(1 << 31)      @ disable DRAM_CLK_STOP
+       str     r1, [r0, #EMC_CFG]
+
+       mov     r1, #0
+       str     r1, [r0, #EMC_SELF_REF] @ take DRAM out of self refresh
+       mov     r1, #1
+       str     r1, [r0, #EMC_NOP]
+       str     r1, [r0, #EMC_NOP]
+       str     r1, [r0, #EMC_REFRESH]
+
+       emc_device_mask r1, r0
+
+exit_selfrefresh_loop:
+       ldr     r2, [r0, #EMC_EMC_STATUS]
+       ands    r2, r2, r1
+       bne     exit_selfrefresh_loop
+
+       mov     r1, #0                  @ unstall all transactions
+       str     r1, [r0, #EMC_REQ_CTRL]
+
+       mov32   r0, TEGRA_PMC_BASE
+       ldr     r0, [r0, #PMC_SCRATCH41]
+       mov     pc, r0                  @ jump to tegra_resume
+ENDPROC(tegra20_lp1_reset)
+
+/*
+ * tegra20_tear_down_core
+ *
+ * copied into and executed from IRAM
+ * puts memory in self-refresh for LP0 and LP1
+ */
+tegra20_tear_down_core:
+       bl      tegra20_sdram_self_refresh
+       bl      tegra20_switch_cpu_to_clk32k
+       b       tegra20_enter_sleep
+
+/*
+ * tegra20_switch_cpu_to_clk32k
+ *
+ * In LP0 and LP1 all PLLs will be turned off. Switch the CPU and system clock
+ * to the 32KHz clock.
+ */
+tegra20_switch_cpu_to_clk32k:
+       /*
+        * start by switching to CLKM to safely disable PLLs, then switch to
+        * CLKS.
+        */
+       mov     r0, #(1 << 28)
+       str     r0, [r5, #CLK_RESET_SCLK_BURST]
+       str     r0, [r5, #CLK_RESET_CCLK_BURST]
+       mov     r0, #0
+       str     r0, [r5, #CLK_RESET_CCLK_DIVIDER]
+       str     r0, [r5, #CLK_RESET_SCLK_DIVIDER]
+
+       /* 2uS delay delay between changing SCLK and disabling PLLs */
+       mov32   r7, TEGRA_TMRUS_BASE
+       ldr     r1, [r7]
+       add     r1, r1, #2
+       wait_until r1, r7, r9
+
+       /* disable PLLM, PLLP and PLLC */
+       ldr     r0, [r5, #CLK_RESET_PLLM_BASE]
+       bic     r0, r0, #(1 << 30)
+       str     r0, [r5, #CLK_RESET_PLLM_BASE]
+       ldr     r0, [r5, #CLK_RESET_PLLP_BASE]
+       bic     r0, r0, #(1 << 30)
+       str     r0, [r5, #CLK_RESET_PLLP_BASE]
+       ldr     r0, [r5, #CLK_RESET_PLLC_BASE]
+       bic     r0, r0, #(1 << 30)
+       str     r0, [r5, #CLK_RESET_PLLC_BASE]
+
+       /* switch to CLKS */
+       mov     r0, #0  /* brust policy = 32KHz */
+       str     r0, [r5, #CLK_RESET_SCLK_BURST]
+
+       mov     pc, lr
+
 /*
  * tegra20_enter_sleep
  *
@@ -274,4 +480,95 @@ halted:
        isb
        b       halted
 
+/*
+ * tegra20_sdram_self_refresh
+ *
+ * called with MMU off and caches disabled
+ * puts sdram in self refresh
+ * must be executed from IRAM
+ */
+tegra20_sdram_self_refresh:
+       mov32   r1, TEGRA_EMC_BASE      @ r1 reserved for emc base addr
+
+       mov     r2, #3
+       str     r2, [r1, #EMC_REQ_CTRL] @ stall incoming DRAM requests
+
+emcidle:
+       ldr     r2, [r1, #EMC_EMC_STATUS]
+       tst     r2, #4
+       beq     emcidle
+
+       mov     r2, #1
+       str     r2, [r1, #EMC_SELF_REF]
+
+       emc_device_mask r2, r1
+
+emcself:
+       ldr     r3, [r1, #EMC_EMC_STATUS]
+       and     r3, r3, r2
+       cmp     r3, r2
+       bne     emcself                 @ loop until DDR in self-refresh
+
+       adr     r2, tegra20_sdram_pad_address
+       adr     r3, tegra20_sdram_pad_safe
+       adr     r4, tegra20_sdram_pad_save
+       mov     r5, #0
+
+       ldr     r6, tegra20_sdram_pad_size
+padsave:
+       ldr     r0, [r2, r5]            @ r0 is the addr in the pad_address
+
+       ldr     r1, [r0]
+       str     r1, [r4, r5]            @ save the content of the addr
+
+       ldr     r1, [r3, r5]
+       str     r1, [r0]                @ set the save val to the addr
+
+       add     r5, r5, #4
+       cmp     r6, r5
+       bne     padsave
+padsave_done:
+
+       mov32   r5, TEGRA_CLK_RESET_BASE
+       ldr     r0, [r5, #CLK_RESET_SCLK_BURST]
+       adr     r2, tegra20_sclk_save
+       str     r0, [r2]
+       dsb
+       mov     pc, lr
+
+tegra20_sdram_pad_address:
+       .word   TEGRA_APB_MISC_BASE + APB_MISC_XM2CFGCPADCTRL
+       .word   TEGRA_APB_MISC_BASE + APB_MISC_XM2CFGDPADCTRL
+       .word   TEGRA_APB_MISC_BASE + APB_MISC_XM2CLKCFGPADCTRL
+       .word   TEGRA_APB_MISC_BASE + APB_MISC_XM2COMPPADCTRL
+       .word   TEGRA_APB_MISC_BASE + APB_MISC_XM2VTTGENPADCTRL
+       .word   TEGRA_APB_MISC_BASE + APB_MISC_XM2CFGCPADCTRL2
+       .word   TEGRA_APB_MISC_BASE + APB_MISC_XM2CFGDPADCTRL2
+
+tegra20_sdram_pad_size:
+       .word   tegra20_sdram_pad_size - tegra20_sdram_pad_address
+
+tegra20_sdram_pad_safe:
+       .word   0x8
+       .word   0x8
+       .word   0x0
+       .word   0x8
+       .word   0x5500
+       .word   0x08080040
+       .word   0x0
+
+tegra20_sclk_save:
+       .word   0x0
+
+tegra20_sdram_pad_save:
+       .rept (tegra20_sdram_pad_size - tegra20_sdram_pad_address) / 4
+       .long   0
+       .endr
+
+       .ltorg
+/* dummy symbol for end of IRAM */
+       .align L1_CACHE_SHIFT
+       .globl tegra20_iram_end
+tegra20_iram_end:
+       b       .
 #endif
index ada8821..63fa91b 100644 (file)
 
 #include <asm/assembler.h>
 #include <asm/asm-offsets.h>
+#include <asm/cache.h>
 
 #include "fuse.h"
 #include "sleep.h"
 #include "flowctrl.h"
 
+#define EMC_CFG                                0xc
+#define EMC_ADR_CFG                    0x10
+#define EMC_TIMING_CONTROL             0x28
+#define EMC_REFRESH                    0x70
+#define EMC_NOP                                0xdc
+#define EMC_SELF_REF                   0xe0
+#define EMC_MRW                                0xe8
+#define EMC_FBIO_CFG5                  0x104
+#define EMC_AUTO_CAL_CONFIG            0x2a4
+#define EMC_AUTO_CAL_INTERVAL          0x2a8
+#define EMC_AUTO_CAL_STATUS            0x2ac
+#define EMC_REQ_CTRL                   0x2b0
+#define EMC_CFG_DIG_DLL                        0x2bc
+#define EMC_EMC_STATUS                 0x2b4
+#define EMC_ZCAL_INTERVAL              0x2e0
+#define EMC_ZQ_CAL                     0x2ec
+#define EMC_XM2VTTGENPADCTRL           0x310
+#define EMC_XM2VTTGENPADCTRL2          0x314
+
+#define PMC_CTRL                       0x0
+#define PMC_CTRL_SIDE_EFFECT_LP0 (1 << 14) /* enter LP0 when CPU pwr gated */
+
+#define PMC_PLLP_WB0_OVERRIDE          0xf8
+#define PMC_IO_DPD_REQ                 0x1b8
+#define PMC_IO_DPD_STATUS              0x1bc
+
+#define CLK_RESET_CCLK_BURST           0x20
+#define CLK_RESET_CCLK_DIVIDER         0x24
+#define CLK_RESET_SCLK_BURST           0x28
+#define CLK_RESET_SCLK_DIVIDER         0x2c
+
+#define CLK_RESET_PLLC_BASE            0x80
+#define CLK_RESET_PLLC_MISC            0x8c
+#define CLK_RESET_PLLM_BASE            0x90
+#define CLK_RESET_PLLM_MISC            0x9c
+#define CLK_RESET_PLLP_BASE            0xa0
+#define CLK_RESET_PLLP_MISC            0xac
+#define CLK_RESET_PLLA_BASE            0xb0
+#define CLK_RESET_PLLA_MISC            0xbc
+#define CLK_RESET_PLLX_BASE            0xe0
+#define CLK_RESET_PLLX_MISC            0xe4
+#define CLK_RESET_PLLX_MISC3           0x518
+#define CLK_RESET_PLLX_MISC3_IDDQ      3
+#define CLK_RESET_PLLM_MISC_IDDQ       5
+#define CLK_RESET_PLLC_MISC_IDDQ       26
+
+#define CLK_RESET_CLK_SOURCE_MSELECT   0x3b4
+
+#define MSELECT_CLKM                   (0x3 << 30)
+
+#define LOCK_DELAY 50 /* safety delay after lock is detected */
+
 #define TEGRA30_POWER_HOTPLUG_SHUTDOWN (1 << 27) /* Hotplug shutdown */
 
+.macro emc_device_mask, rd, base
+       ldr     \rd, [\base, #EMC_ADR_CFG]
+       tst     \rd, #0x1
+       moveq   \rd, #(0x1 << 8)                @ just 1 device
+       movne   \rd, #(0x3 << 8)                @ 2 devices
+.endm
+
+.macro emc_timing_update, rd, base
+       mov     \rd, #1
+       str     \rd, [\base, #EMC_TIMING_CONTROL]
+1001:
+       ldr     \rd, [\base, #EMC_EMC_STATUS]
+       tst     \rd, #(0x1<<23) @ wait EMC_STATUS_TIMING_UPDATE_STALLED is clear
+       bne     1001b
+.endm
+
+.macro pll_enable, rd, r_car_base, pll_base, pll_misc
+       ldr     \rd, [\r_car_base, #\pll_base]
+       tst     \rd, #(1 << 30)
+       orreq   \rd, \rd, #(1 << 30)
+       streq   \rd, [\r_car_base, #\pll_base]
+       /* Enable lock detector */
+       .if     \pll_misc
+       ldr     \rd, [\r_car_base, #\pll_misc]
+       bic     \rd, \rd, #(1 << 18)
+       str     \rd, [\r_car_base, #\pll_misc]
+       ldr     \rd, [\r_car_base, #\pll_misc]
+       ldr     \rd, [\r_car_base, #\pll_misc]
+       orr     \rd, \rd, #(1 << 18)
+       str     \rd, [\r_car_base, #\pll_misc]
+       .endif
+.endm
+
+.macro pll_locked, rd, r_car_base, pll_base
+1:
+       ldr     \rd, [\r_car_base, #\pll_base]
+       tst     \rd, #(1 << 27)
+       beq     1b
+.endm
+
+.macro pll_iddq_exit, rd, car, iddq, iddq_bit
+       ldr     \rd, [\car, #\iddq]
+       bic     \rd, \rd, #(1<<\iddq_bit)
+       str     \rd, [\car, #\iddq]
+.endm
+
+.macro pll_iddq_entry, rd, car, iddq, iddq_bit
+       ldr     \rd, [\car, #\iddq]
+       orr     \rd, \rd, #(1<<\iddq_bit)
+       str     \rd, [\car, #\iddq]
+.endm
+
 #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PM_SLEEP)
 /*
  * tegra30_hotplug_shutdown(void)
@@ -99,6 +204,8 @@ flow_ctrl_setting_for_lp2:
        cmp     r10, #TEGRA30
        moveq   r3, #FLOW_CTRL_WAIT_FOR_INTERRUPT       @ For LP2
        movne   r3, #FLOW_CTRL_WAITEVENT
+       orrne   r3, r3, #FLOW_CTRL_HALT_GIC_IRQ
+       orrne   r3, r3, #FLOW_CTRL_HALT_GIC_FIQ
 flow_ctrl_done:
        cmp     r10, #TEGRA30
        str     r3, [r2]
@@ -127,6 +234,41 @@ ENDPROC(tegra30_cpu_shutdown)
 
 #ifdef CONFIG_PM_SLEEP
 /*
+ * tegra30_sleep_core_finish(unsigned long v2p)
+ *
+ * Enters suspend in LP0 or LP1 by turning off the MMU and jumping to
+ * tegra30_tear_down_core in IRAM
+ */
+ENTRY(tegra30_sleep_core_finish)
+       /* Flush, disable the L1 data cache and exit SMP */
+       bl      tegra_disable_clean_inv_dcache
+
+       /*
+        * Preload all the address literals that are needed for the
+        * CPU power-gating process, to avoid loading from SDRAM which
+        * are not supported once SDRAM is put into self-refresh.
+        * LP0 / LP1 use physical address, since the MMU needs to be
+        * disabled before putting SDRAM into self-refresh to avoid
+        * memory access due to page table walks.
+        */
+       mov32   r4, TEGRA_PMC_BASE
+       mov32   r5, TEGRA_CLK_RESET_BASE
+       mov32   r6, TEGRA_FLOW_CTRL_BASE
+       mov32   r7, TEGRA_TMRUS_BASE
+
+       mov32   r3, tegra_shut_off_mmu
+       add     r3, r3, r0
+
+       mov32   r0, tegra30_tear_down_core
+       mov32   r1, tegra30_iram_start
+       sub     r0, r0, r1
+       mov32   r1, TEGRA_IRAM_CODE_AREA
+       add     r0, r0, r1
+
+       mov     pc, r3
+ENDPROC(tegra30_sleep_core_finish)
+
+/*
  * tegra30_sleep_cpu_secondary_finish(unsigned long v2p)
  *
  * Enters LP2 on secondary CPU by exiting coherency and powergating the CPU.
@@ -135,6 +277,7 @@ ENTRY(tegra30_sleep_cpu_secondary_finish)
        mov     r7, lr
 
        /* Flush and disable the L1 data cache */
+       mov     r0, #TEGRA_FLUSH_CACHE_LOUIS
        bl      tegra_disable_clean_inv_dcache
 
        /* Powergate this CPU. */
@@ -155,6 +298,351 @@ ENTRY(tegra30_tear_down_cpu)
        b       tegra30_enter_sleep
 ENDPROC(tegra30_tear_down_cpu)
 
+/* START OF ROUTINES COPIED TO IRAM */
+       .align L1_CACHE_SHIFT
+       .globl tegra30_iram_start
+tegra30_iram_start:
+
+/*
+ * tegra30_lp1_reset
+ *
+ * reset vector for LP1 restore; copied into IRAM during suspend.
+ * Brings the system back up to a safe staring point (SDRAM out of
+ * self-refresh, PLLC, PLLM and PLLP reenabled, CPU running on PLLX,
+ * system clock running on the same PLL that it suspended at), and
+ * jumps to tegra_resume to restore virtual addressing.
+ * The physical address of tegra_resume expected to be stored in
+ * PMC_SCRATCH41.
+ *
+ * NOTE: THIS *MUST* BE RELOCATED TO TEGRA_IRAM_CODE_AREA.
+ */
+ENTRY(tegra30_lp1_reset)
+       /*
+        * The CPU and system bus are running at 32KHz and executing from
+        * IRAM when this code is executed; immediately switch to CLKM and
+        * enable PLLP, PLLM, PLLC, PLLA and PLLX.
+        */
+       mov32   r0, TEGRA_CLK_RESET_BASE
+
+       mov     r1, #(1 << 28)
+       str     r1, [r0, #CLK_RESET_SCLK_BURST]
+       str     r1, [r0, #CLK_RESET_CCLK_BURST]
+       mov     r1, #0
+       str     r1, [r0, #CLK_RESET_CCLK_DIVIDER]
+       str     r1, [r0, #CLK_RESET_SCLK_DIVIDER]
+
+       tegra_get_soc_id TEGRA_APB_MISC_BASE, r10
+       cmp     r10, #TEGRA30
+       beq     _no_pll_iddq_exit
+
+       pll_iddq_exit r1, r0, CLK_RESET_PLLM_MISC, CLK_RESET_PLLM_MISC_IDDQ
+       pll_iddq_exit r1, r0, CLK_RESET_PLLC_MISC, CLK_RESET_PLLC_MISC_IDDQ
+       pll_iddq_exit r1, r0, CLK_RESET_PLLX_MISC3, CLK_RESET_PLLX_MISC3_IDDQ
+
+       mov32   r7, TEGRA_TMRUS_BASE
+       ldr     r1, [r7]
+       add     r1, r1, #2
+       wait_until r1, r7, r3
+
+       /* enable PLLM via PMC */
+       mov32   r2, TEGRA_PMC_BASE
+       ldr     r1, [r2, #PMC_PLLP_WB0_OVERRIDE]
+       orr     r1, r1, #(1 << 12)
+       str     r1, [r2, #PMC_PLLP_WB0_OVERRIDE]
+
+       pll_enable r1, r0, CLK_RESET_PLLM_BASE, 0
+       pll_enable r1, r0, CLK_RESET_PLLC_BASE, 0
+       pll_enable r1, r0, CLK_RESET_PLLX_BASE, 0
+
+       b       _pll_m_c_x_done
+
+_no_pll_iddq_exit:
+       /* enable PLLM via PMC */
+       mov32   r2, TEGRA_PMC_BASE
+       ldr     r1, [r2, #PMC_PLLP_WB0_OVERRIDE]
+       orr     r1, r1, #(1 << 12)
+       str     r1, [r2, #PMC_PLLP_WB0_OVERRIDE]
+
+       pll_enable r1, r0, CLK_RESET_PLLM_BASE, CLK_RESET_PLLM_MISC
+       pll_enable r1, r0, CLK_RESET_PLLC_BASE, CLK_RESET_PLLC_MISC
+       pll_enable r1, r0, CLK_RESET_PLLX_BASE, CLK_RESET_PLLX_MISC
+
+_pll_m_c_x_done:
+       pll_enable r1, r0, CLK_RESET_PLLP_BASE, CLK_RESET_PLLP_MISC
+       pll_enable r1, r0, CLK_RESET_PLLA_BASE, CLK_RESET_PLLA_MISC
+
+       pll_locked r1, r0, CLK_RESET_PLLM_BASE
+       pll_locked r1, r0, CLK_RESET_PLLP_BASE
+       pll_locked r1, r0, CLK_RESET_PLLA_BASE
+       pll_locked r1, r0, CLK_RESET_PLLC_BASE
+       pll_locked r1, r0, CLK_RESET_PLLX_BASE
+
+       mov32   r7, TEGRA_TMRUS_BASE
+       ldr     r1, [r7]
+       add     r1, r1, #LOCK_DELAY
+       wait_until r1, r7, r3
+
+       adr     r5, tegra30_sdram_pad_save
+
+       ldr     r4, [r5, #0x18]         @ restore CLK_SOURCE_MSELECT
+       str     r4, [r0, #CLK_RESET_CLK_SOURCE_MSELECT]
+
+       ldr     r4, [r5, #0x1C]         @ restore SCLK_BURST
+       str     r4, [r0, #CLK_RESET_SCLK_BURST]
+
+       cmp     r10, #TEGRA30
+       movweq  r4, #:lower16:((1 << 28) | (0x8))       @ burst policy is PLLX
+       movteq  r4, #:upper16:((1 << 28) | (0x8))
+       movwne  r4, #:lower16:((1 << 28) | (0xe))
+       movtne  r4, #:upper16:((1 << 28) | (0xe))
+       str     r4, [r0, #CLK_RESET_CCLK_BURST]
+
+       /* Restore pad power state to normal */
+       ldr     r1, [r5, #0x14]         @ PMC_IO_DPD_STATUS
+       mvn     r1, r1
+       bic     r1, r1, #(1 << 31)
+       orr     r1, r1, #(1 << 30)
+       str     r1, [r2, #PMC_IO_DPD_REQ]       @ DPD_OFF
+
+       cmp     r10, #TEGRA30
+       movweq  r0, #:lower16:TEGRA_EMC_BASE    @ r0 reserved for emc base
+       movteq  r0, #:upper16:TEGRA_EMC_BASE
+       movwne  r0, #:lower16:TEGRA_EMC0_BASE
+       movtne  r0, #:upper16:TEGRA_EMC0_BASE
+
+exit_self_refresh:
+       ldr     r1, [r5, #0xC]          @ restore EMC_XM2VTTGENPADCTRL
+       str     r1, [r0, #EMC_XM2VTTGENPADCTRL]
+       ldr     r1, [r5, #0x10]         @ restore EMC_XM2VTTGENPADCTRL2
+       str     r1, [r0, #EMC_XM2VTTGENPADCTRL2]
+       ldr     r1, [r5, #0x8]          @ restore EMC_AUTO_CAL_INTERVAL
+       str     r1, [r0, #EMC_AUTO_CAL_INTERVAL]
+
+       /* Relock DLL */
+       ldr     r1, [r0, #EMC_CFG_DIG_DLL]
+       orr     r1, r1, #(1 << 30)      @ set DLL_RESET
+       str     r1, [r0, #EMC_CFG_DIG_DLL]
+
+       emc_timing_update r1, r0
+
+       cmp     r10, #TEGRA114
+       movweq  r1, #:lower16:TEGRA_EMC1_BASE
+       movteq  r1, #:upper16:TEGRA_EMC1_BASE
+       cmpeq   r0, r1
+
+       ldr     r1, [r0, #EMC_AUTO_CAL_CONFIG]
+       orr     r1, r1, #(1 << 31)      @ set AUTO_CAL_ACTIVE
+       orreq   r1, r1, #(1 << 27)      @ set slave mode for channel 1
+       str     r1, [r0, #EMC_AUTO_CAL_CONFIG]
+
+emc_wait_auto_cal_onetime:
+       ldr     r1, [r0, #EMC_AUTO_CAL_STATUS]
+       tst     r1, #(1 << 31)          @ wait until AUTO_CAL_ACTIVE is cleared
+       bne     emc_wait_auto_cal_onetime
+
+       ldr     r1, [r0, #EMC_CFG]
+       bic     r1, r1, #(1 << 31)      @ disable DRAM_CLK_STOP_PD
+       str     r1, [r0, #EMC_CFG]
+
+       mov     r1, #0
+       str     r1, [r0, #EMC_SELF_REF] @ take DRAM out of self refresh
+       mov     r1, #1
+       cmp     r10, #TEGRA30
+       streq   r1, [r0, #EMC_NOP]
+       streq   r1, [r0, #EMC_NOP]
+       streq   r1, [r0, #EMC_REFRESH]
+
+       emc_device_mask r1, r0
+
+exit_selfrefresh_loop:
+       ldr     r2, [r0, #EMC_EMC_STATUS]
+       ands    r2, r2, r1
+       bne     exit_selfrefresh_loop
+
+       lsr     r1, r1, #8              @ devSel, bit0:dev0, bit1:dev1
+
+       mov32   r7, TEGRA_TMRUS_BASE
+       ldr     r2, [r0, #EMC_FBIO_CFG5]
+
+       and     r2, r2, #3              @ check DRAM_TYPE
+       cmp     r2, #2
+       beq     emc_lpddr2
+
+       /* Issue a ZQ_CAL for dev0 - DDR3 */
+       mov32   r2, 0x80000011          @ DEV_SELECTION=2, LENGTH=LONG, CMD=1
+       str     r2, [r0, #EMC_ZQ_CAL]
+       ldr     r2, [r7]
+       add     r2, r2, #10
+       wait_until r2, r7, r3
+
+       tst     r1, #2
+       beq     zcal_done
+
+       /* Issue a ZQ_CAL for dev1 - DDR3 */
+       mov32   r2, 0x40000011          @ DEV_SELECTION=1, LENGTH=LONG, CMD=1
+       str     r2, [r0, #EMC_ZQ_CAL]
+       ldr     r2, [r7]
+       add     r2, r2, #10
+       wait_until r2, r7, r3
+       b       zcal_done
+
+emc_lpddr2:
+       /* Issue a ZQ_CAL for dev0 - LPDDR2 */
+       mov32   r2, 0x800A00AB          @ DEV_SELECTION=2, MA=10, OP=0xAB
+       str     r2, [r0, #EMC_MRW]
+       ldr     r2, [r7]
+       add     r2, r2, #1
+       wait_until r2, r7, r3
+
+       tst     r1, #2
+       beq     zcal_done
+
+       /* Issue a ZQ_CAL for dev0 - LPDDR2 */
+       mov32   r2, 0x400A00AB          @ DEV_SELECTION=1, MA=10, OP=0xAB
+       str     r2, [r0, #EMC_MRW]
+       ldr     r2, [r7]
+       add     r2, r2, #1
+       wait_until r2, r7, r3
+
+zcal_done:
+       mov     r1, #0                  @ unstall all transactions
+       str     r1, [r0, #EMC_REQ_CTRL]
+       ldr     r1, [r5, #0x4]          @ restore EMC_ZCAL_INTERVAL
+       str     r1, [r0, #EMC_ZCAL_INTERVAL]
+       ldr     r1, [r5, #0x0]          @ restore EMC_CFG
+       str     r1, [r0, #EMC_CFG]
+
+       /* Tegra114 had dual EMC channel, now config the other one */
+       cmp     r10, #TEGRA114
+       bne     __no_dual_emc_chanl
+       mov32   r1, TEGRA_EMC1_BASE
+       cmp     r0, r1
+       movne   r0, r1
+       addne   r5, r5, #0x20
+       bne     exit_self_refresh
+__no_dual_emc_chanl:
+
+       mov32   r0, TEGRA_PMC_BASE
+       ldr     r0, [r0, #PMC_SCRATCH41]
+       mov     pc, r0                  @ jump to tegra_resume
+ENDPROC(tegra30_lp1_reset)
+
+       .align  L1_CACHE_SHIFT
+tegra30_sdram_pad_address:
+       .word   TEGRA_EMC_BASE + EMC_CFG                                @0x0
+       .word   TEGRA_EMC_BASE + EMC_ZCAL_INTERVAL                      @0x4
+       .word   TEGRA_EMC_BASE + EMC_AUTO_CAL_INTERVAL                  @0x8
+       .word   TEGRA_EMC_BASE + EMC_XM2VTTGENPADCTRL                   @0xc
+       .word   TEGRA_EMC_BASE + EMC_XM2VTTGENPADCTRL2                  @0x10
+       .word   TEGRA_PMC_BASE + PMC_IO_DPD_STATUS                      @0x14
+       .word   TEGRA_CLK_RESET_BASE + CLK_RESET_CLK_SOURCE_MSELECT     @0x18
+       .word   TEGRA_CLK_RESET_BASE + CLK_RESET_SCLK_BURST             @0x1c
+
+tegra114_sdram_pad_address:
+       .word   TEGRA_EMC0_BASE + EMC_CFG                               @0x0
+       .word   TEGRA_EMC0_BASE + EMC_ZCAL_INTERVAL                     @0x4
+       .word   TEGRA_EMC0_BASE + EMC_AUTO_CAL_INTERVAL                 @0x8
+       .word   TEGRA_EMC0_BASE + EMC_XM2VTTGENPADCTRL                  @0xc
+       .word   TEGRA_EMC0_BASE + EMC_XM2VTTGENPADCTRL2                 @0x10
+       .word   TEGRA_PMC_BASE + PMC_IO_DPD_STATUS                      @0x14
+       .word   TEGRA_CLK_RESET_BASE + CLK_RESET_CLK_SOURCE_MSELECT     @0x18
+       .word   TEGRA_CLK_RESET_BASE + CLK_RESET_SCLK_BURST             @0x1c
+       .word   TEGRA_EMC1_BASE + EMC_CFG                               @0x20
+       .word   TEGRA_EMC1_BASE + EMC_ZCAL_INTERVAL                     @0x24
+       .word   TEGRA_EMC1_BASE + EMC_AUTO_CAL_INTERVAL                 @0x28
+       .word   TEGRA_EMC1_BASE + EMC_XM2VTTGENPADCTRL                  @0x2c
+       .word   TEGRA_EMC1_BASE + EMC_XM2VTTGENPADCTRL2                 @0x30
+
+tegra30_sdram_pad_size:
+       .word   tegra114_sdram_pad_address - tegra30_sdram_pad_address
+
+tegra114_sdram_pad_size:
+       .word   tegra30_sdram_pad_size - tegra114_sdram_pad_address
+
+       .type   tegra30_sdram_pad_save, %object
+tegra30_sdram_pad_save:
+       .rept (tegra30_sdram_pad_size - tegra114_sdram_pad_address) / 4
+       .long   0
+       .endr
+
+/*
+ * tegra30_tear_down_core
+ *
+ * copied into and executed from IRAM
+ * puts memory in self-refresh for LP0 and LP1
+ */
+tegra30_tear_down_core:
+       bl      tegra30_sdram_self_refresh
+       bl      tegra30_switch_cpu_to_clk32k
+       b       tegra30_enter_sleep
+
+/*
+ * tegra30_switch_cpu_to_clk32k
+ *
+ * In LP0 and LP1 all PLLs will be turned off. Switching the CPU and System CLK
+ * to the 32KHz clock.
+ * r4 = TEGRA_PMC_BASE
+ * r5 = TEGRA_CLK_RESET_BASE
+ * r6 = TEGRA_FLOW_CTRL_BASE
+ * r7 = TEGRA_TMRUS_BASE
+ * r10= SoC ID
+ */
+tegra30_switch_cpu_to_clk32k:
+       /*
+        * start by jumping to CLKM to safely disable PLLs, then jump to
+        * CLKS.
+        */
+       mov     r0, #(1 << 28)
+       str     r0, [r5, #CLK_RESET_SCLK_BURST]
+       /* 2uS delay delay between changing SCLK and CCLK */
+       ldr     r1, [r7]
+       add     r1, r1, #2
+       wait_until r1, r7, r9
+       str     r0, [r5, #CLK_RESET_CCLK_BURST]
+       mov     r0, #0
+       str     r0, [r5, #CLK_RESET_CCLK_DIVIDER]
+       str     r0, [r5, #CLK_RESET_SCLK_DIVIDER]
+
+       /* switch the clock source of mselect to be CLK_M */
+       ldr     r0, [r5, #CLK_RESET_CLK_SOURCE_MSELECT]
+       orr     r0, r0, #MSELECT_CLKM
+       str     r0, [r5, #CLK_RESET_CLK_SOURCE_MSELECT]
+
+       /* 2uS delay delay between changing SCLK and disabling PLLs */
+       ldr     r1, [r7]
+       add     r1, r1, #2
+       wait_until r1, r7, r9
+
+       /* disable PLLM via PMC in LP1 */
+       ldr     r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
+       bic     r0, r0, #(1 << 12)
+       str     r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
+
+       /* disable PLLP, PLLA, PLLC and PLLX */
+       ldr     r0, [r5, #CLK_RESET_PLLP_BASE]
+       bic     r0, r0, #(1 << 30)
+       str     r0, [r5, #CLK_RESET_PLLP_BASE]
+       ldr     r0, [r5, #CLK_RESET_PLLA_BASE]
+       bic     r0, r0, #(1 << 30)
+       str     r0, [r5, #CLK_RESET_PLLA_BASE]
+       ldr     r0, [r5, #CLK_RESET_PLLC_BASE]
+       bic     r0, r0, #(1 << 30)
+       str     r0, [r5, #CLK_RESET_PLLC_BASE]
+       ldr     r0, [r5, #CLK_RESET_PLLX_BASE]
+       bic     r0, r0, #(1 << 30)
+       str     r0, [r5, #CLK_RESET_PLLX_BASE]
+
+       cmp     r10, #TEGRA30
+       beq     _no_pll_in_iddq
+       pll_iddq_entry r1, r5, CLK_RESET_PLLX_MISC3, CLK_RESET_PLLX_MISC3_IDDQ
+_no_pll_in_iddq:
+
+       /* switch to CLKS */
+       mov     r0, #0  /* brust policy = 32KHz */
+       str     r0, [r5, #CLK_RESET_SCLK_BURST]
+
+       mov     pc, lr
+
 /*
  * tegra30_enter_sleep
  *
@@ -172,8 +660,12 @@ tegra30_enter_sleep:
        orr     r0, r0, #FLOW_CTRL_CSR_ENABLE
        str     r0, [r6, r2]
 
+       tegra_get_soc_id TEGRA_APB_MISC_BASE, r10
+       cmp     r10, #TEGRA30
        mov     r0, #FLOW_CTRL_WAIT_FOR_INTERRUPT
-       orr     r0, r0, #FLOW_CTRL_HALT_CPU_IRQ | FLOW_CTRL_HALT_CPU_FIQ
+       orreq   r0, r0, #FLOW_CTRL_HALT_CPU_IRQ | FLOW_CTRL_HALT_CPU_FIQ
+       orrne   r0, r0, #FLOW_CTRL_HALT_LIC_IRQ | FLOW_CTRL_HALT_LIC_FIQ
+
        cpu_to_halt_reg r2, r1
        str     r0, [r6, r2]
        dsb
@@ -187,4 +679,126 @@ halted:
        /* !!!FIXME!!! Implement halt failure handler */
        b       halted
 
+/*
+ * tegra30_sdram_self_refresh
+ *
+ * called with MMU off and caches disabled
+ * must be executed from IRAM
+ * r4 = TEGRA_PMC_BASE
+ * r5 = TEGRA_CLK_RESET_BASE
+ * r6 = TEGRA_FLOW_CTRL_BASE
+ * r7 = TEGRA_TMRUS_BASE
+ * r10= SoC ID
+ */
+tegra30_sdram_self_refresh:
+
+       adr     r8, tegra30_sdram_pad_save
+       tegra_get_soc_id TEGRA_APB_MISC_BASE, r10
+       cmp     r10, #TEGRA30
+       adreq   r2, tegra30_sdram_pad_address
+       ldreq   r3, tegra30_sdram_pad_size
+       adrne   r2, tegra114_sdram_pad_address
+       ldrne   r3, tegra114_sdram_pad_size
+       mov     r9, #0
+
+padsave:
+       ldr     r0, [r2, r9]            @ r0 is the addr in the pad_address
+
+       ldr     r1, [r0]
+       str     r1, [r8, r9]            @ save the content of the addr
+
+       add     r9, r9, #4
+       cmp     r3, r9
+       bne     padsave
+padsave_done:
+
+       dsb
+
+       cmp     r10, #TEGRA30
+       ldreq   r0, =TEGRA_EMC_BASE     @ r0 reserved for emc base addr
+       ldrne   r0, =TEGRA_EMC0_BASE
+
+enter_self_refresh:
+       cmp     r10, #TEGRA30
+       mov     r1, #0
+       str     r1, [r0, #EMC_ZCAL_INTERVAL]
+       str     r1, [r0, #EMC_AUTO_CAL_INTERVAL]
+       ldr     r1, [r0, #EMC_CFG]
+       bic     r1, r1, #(1 << 28)
+       bicne   r1, r1, #(1 << 29)
+       str     r1, [r0, #EMC_CFG]      @ disable DYN_SELF_REF
+
+       emc_timing_update r1, r0
+
+       ldr     r1, [r7]
+       add     r1, r1, #5
+       wait_until r1, r7, r2
+
+emc_wait_auto_cal:
+       ldr     r1, [r0, #EMC_AUTO_CAL_STATUS]
+       tst     r1, #(1 << 31)          @ wait until AUTO_CAL_ACTIVE is cleared
+       bne     emc_wait_auto_cal
+
+       mov     r1, #3
+       str     r1, [r0, #EMC_REQ_CTRL] @ stall incoming DRAM requests
+
+emcidle:
+       ldr     r1, [r0, #EMC_EMC_STATUS]
+       tst     r1, #4
+       beq     emcidle
+
+       mov     r1, #1
+       str     r1, [r0, #EMC_SELF_REF]
+
+       emc_device_mask r1, r0
+
+emcself:
+       ldr     r2, [r0, #EMC_EMC_STATUS]
+       and     r2, r2, r1
+       cmp     r2, r1
+       bne     emcself                 @ loop until DDR in self-refresh
+
+       /* Put VTTGEN in the lowest power mode */
+       ldr     r1, [r0, #EMC_XM2VTTGENPADCTRL]
+       mov32   r2, 0xF8F8FFFF  @ clear XM2VTTGEN_DRVUP and XM2VTTGEN_DRVDN
+       and     r1, r1, r2
+       str     r1, [r0, #EMC_XM2VTTGENPADCTRL]
+       ldr     r1, [r0, #EMC_XM2VTTGENPADCTRL2]
+       cmp     r10, #TEGRA30
+       orreq   r1, r1, #7              @ set E_NO_VTTGEN
+       orrne   r1, r1, #0x3f
+       str     r1, [r0, #EMC_XM2VTTGENPADCTRL2]
+
+       emc_timing_update r1, r0
+
+       /* Tegra114 had dual EMC channel, now config the other one */
+       cmp     r10, #TEGRA114
+       bne     no_dual_emc_chanl
+       mov32   r1, TEGRA_EMC1_BASE
+       cmp     r0, r1
+       movne   r0, r1
+       bne     enter_self_refresh
+no_dual_emc_chanl:
+
+       ldr     r1, [r4, #PMC_CTRL]
+       tst     r1, #PMC_CTRL_SIDE_EFFECT_LP0
+       bne     pmc_io_dpd_skip
+       /*
+        * Put DDR_DATA, DISC_ADDR_CMD, DDR_ADDR_CMD, POP_ADDR_CMD, POP_CLK
+        * and COMP in the lowest power mode when LP1.
+        */
+       mov32   r1, 0x8EC00000
+       str     r1, [r4, #PMC_IO_DPD_REQ]
+pmc_io_dpd_skip:
+
+       dsb
+
+       mov     pc, lr
+
+       .ltorg
+/* dummy symbol for end of IRAM */
+       .align L1_CACHE_SHIFT
+       .global tegra30_iram_end
+tegra30_iram_end:
+       b       .
 #endif
index 9daaef2..8d06213 100644 (file)
@@ -56,7 +56,9 @@ ENTRY(tegra_disable_clean_inv_dcache)
        isb
 
        /* Flush the D-cache */
-       bl      v7_flush_dcache_louis
+       cmp     r0, #TEGRA_FLUSH_CACHE_ALL
+       blne    v7_flush_dcache_louis
+       bleq    v7_flush_dcache_all
 
        /* Trun off coherency */
        exit_smp r4, r5
@@ -67,15 +69,40 @@ ENDPROC(tegra_disable_clean_inv_dcache)
 
 #ifdef CONFIG_PM_SLEEP
 /*
+ * tegra_init_l2_for_a15
+ *
+ * set up the correct L2 cache data RAM latency
+ */
+ENTRY(tegra_init_l2_for_a15)
+       mrc     p15, 0, r0, c0, c0, 5
+       ubfx    r0, r0, #8, #4
+       tst     r0, #1                          @ only need for cluster 0
+       bne     _exit_init_l2_a15
+
+       mrc     p15, 0x1, r0, c9, c0, 2
+       and     r0, r0, #7
+       cmp     r0, #2
+       bicne   r0, r0, #7
+       orrne   r0, r0, #2
+       mcrne   p15, 0x1, r0, c9, c0, 2
+_exit_init_l2_a15:
+
+       mov     pc, lr
+ENDPROC(tegra_init_l2_for_a15)
+
+/*
  * tegra_sleep_cpu_finish(unsigned long v2p)
  *
  * enters suspend in LP2 by turning off the mmu and jumping to
  * tegra?_tear_down_cpu
  */
 ENTRY(tegra_sleep_cpu_finish)
+       mov     r4, r0
        /* Flush and disable the L1 data cache */
+       mov     r0, #TEGRA_FLUSH_CACHE_ALL
        bl      tegra_disable_clean_inv_dcache
 
+       mov     r0, r4
        mov32   r6, tegra_tear_down_cpu
        ldr     r1, [r6]
        add     r1, r1, r0
@@ -107,10 +134,10 @@ ENTRY(tegra_shut_off_mmu)
 #ifdef CONFIG_CACHE_L2X0
        /* Disable L2 cache */
        check_cpu_part_num 0xc09, r9, r10
-       movweq  r4, #:lower16:(TEGRA_ARM_PERIF_BASE + 0x3000)
-       movteq  r4, #:upper16:(TEGRA_ARM_PERIF_BASE + 0x3000)
-       moveq   r5, #0
-       streq   r5, [r4, #L2X0_CTRL]
+       movweq  r2, #:lower16:(TEGRA_ARM_PERIF_BASE + 0x3000)
+       movteq  r2, #:upper16:(TEGRA_ARM_PERIF_BASE + 0x3000)
+       moveq   r3, #0
+       streq   r3, [r2, #L2X0_CTRL]
 #endif
        mov     pc, r0
 ENDPROC(tegra_shut_off_mmu)
index 98b7da6..a4edbb3 100644 (file)
 #define CPU_NOT_RESETTABLE     0
 #endif
 
+/* flag of tegra_disable_clean_inv_dcache to do LoUIS or all */
+#define TEGRA_FLUSH_CACHE_LOUIS        0
+#define TEGRA_FLUSH_CACHE_ALL  1
+
 #ifdef __ASSEMBLY__
+/* waits until the microsecond counter (base) is > rn */
+.macro wait_until, rn, base, tmp
+       add     \rn, \rn, #1
+1001:  ldr     \tmp, [\base]
+       cmp     \tmp, \rn
+       bmi     1001b
+.endm
+
 /* returns the offset of the flow controller halt register for a cpu */
 .macro cpu_to_halt_reg rd, rcpu
        cmp     \rcpu, #0
@@ -144,7 +156,7 @@ void tegra_pen_lock(void);
 void tegra_pen_unlock(void);
 void tegra_resume(void);
 int tegra_sleep_cpu_finish(unsigned long);
-void tegra_disable_clean_inv_dcache(void);
+void tegra_disable_clean_inv_dcache(u32 flag);
 
 #ifdef CONFIG_HOTPLUG_CPU
 void tegra20_hotplug_shutdown(void);
index fc97cfd..5b86055 100644 (file)
@@ -80,28 +80,6 @@ out:
        of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
 }
 
-static void __init trimslice_init(void)
-{
-#ifdef CONFIG_TEGRA_PCI
-       int ret;
-
-       ret = tegra_pcie_init(true, true);
-       if (ret)
-               pr_err("tegra_pci_init() failed: %d\n", ret);
-#endif
-}
-
-static void __init harmony_init(void)
-{
-#ifdef CONFIG_TEGRA_PCI
-       int ret;
-
-       ret = harmony_pcie_init();
-       if (ret)
-               pr_err("harmony_pcie_init() failed: %d\n", ret);
-#endif
-}
-
 static void __init paz00_init(void)
 {
        if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
@@ -112,8 +90,6 @@ static struct {
        char *machine;
        void (*init)(void);
 } board_init_funcs[] = {
-       { "compulab,trimslice", trimslice_init },
-       { "nvidia,harmony", harmony_init },
        { "compal,paz00", paz00_init },
 };
 
index b19b072..99a28d6 100644 (file)
@@ -8,7 +8,7 @@ config ARCH_U8500
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
index df5d27a..4e7ab3a 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/platform_data/dma-ste-dma40.h>
 
 #include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 
 #include "setup.h"
 #include "devices.h"
@@ -686,6 +685,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
        .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
+       .restart        = ux500_restart,
 MACHINE_END
 
 MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
@@ -695,6 +695,7 @@ MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
        .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
+       .restart        = ux500_restart,
 MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
@@ -705,6 +706,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
        .init_time      = ux500_timer_init,
        .init_machine   = hrefv60_init_machine,
        .init_late      = ux500_init_late,
+       .restart        = ux500_restart,
 MACHINE_END
 
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
@@ -716,4 +718,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
        .init_time      = ux500_timer_init,
        .init_machine   = snowball_init_machine,
        .init_late      = NULL,
+       .restart        = ux500_restart,
 MACHINE_END
index 12eee81..bfaf95d 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <asm/pmu.h>
 #include <asm/mach/map.h>
-#include <asm/mach/arch.h>
 
 #include "setup.h"
 #include "devices.h"
@@ -223,10 +222,10 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", NULL),
        OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", NULL),
        OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
-       OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0",  &mop500_sdi0_data),
-       OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1",  &mop500_sdi1_data),
-       OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2",  &mop500_sdi2_data),
-       OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4",  &mop500_sdi4_data),
+       OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0",  NULL),
+       OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1",  NULL),
+       OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2",  NULL),
+       OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4",  NULL),
        /* Requires clock name bindings. */
        OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
        OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
@@ -325,6 +324,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
        .init_machine   = u8500_init_machine,
        .init_late      = NULL,
        .dt_compat      = stericsson_dt_platform_compat,
+       .restart        = ux500_restart,
 MACHINE_END
 
 #endif
index e6fb023..5d7eebc 100644 (file)
 #include "db8500-regs.h"
 #include "id.h"
 
+void ux500_restart(enum reboot_mode mode, const char *cmd)
+{
+       local_irq_disable();
+       local_fiq_disable();
+
+       prcmu_system_reset(0);
+}
+
 /*
  * FIXME: Should we set up the GPIO domain here?
  *
index 516a6f5..bc31606 100644 (file)
@@ -49,6 +49,7 @@ struct stedma40_platform_data dma40_plat_data = {
 struct platform_device u8500_dma40_device = {
        .dev = {
                .platform_data = &dma40_plat_data,
+               .coherent_dma_mask = DMA_BIT_MASK(32),
        },
        .name = "dma40",
        .id = 0,
index 08da558..9cdea04 100644 (file)
@@ -11,8 +11,6 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 
-       __INIT
-
 /*
  * U8500 specific entry point for secondary CPUs.
  */
index cad3ca8..656324a 100644 (file)
 #ifndef __ASM_ARCH_SETUP_H
 #define __ASM_ARCH_SETUP_H
 
+#include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <linux/init.h>
 #include <linux/mfd/abx500/ab8500.h>
 
+void ux500_restart(enum reboot_mode mode, const char *cmd);
+
 void __init ux500_map_io(void);
 extern void __init u8500_map_io(void);
 
index b8bbabe..3657954 100644 (file)
@@ -10,7 +10,7 @@ config ARCH_VEXPRESS
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select HAVE_CLK
        select HAVE_PATA_PLATFORM
        select HAVE_SMP
@@ -66,4 +66,12 @@ config ARCH_VEXPRESS_DCSCB
          This is needed to provide CPU and cluster power management
          on RTSM implementing big.LITTLE.
 
+config ARCH_VEXPRESS_TC2_PM
+       bool "Versatile Express TC2 power management"
+       depends on MCPM
+       select ARM_CCI
+       help
+         Support for CPU and cluster power management on Versatile Express
+         with a TC2 (A15x2 A7x3) big.LITTLE core tile.
+
 endmenu
index 48ba89a..36ea824 100644 (file)
@@ -7,5 +7,6 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 obj-y                                  := v2m.o
 obj-$(CONFIG_ARCH_VEXPRESS_CA9X4)      += ct-ca9x4.o
 obj-$(CONFIG_ARCH_VEXPRESS_DCSCB)      += dcscb.o      dcscb_setup.o
+obj-$(CONFIG_ARCH_VEXPRESS_TC2_PM)     += tc2_pm.o spc.o
 obj-$(CONFIG_SMP)                      += platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)              += hotplug.o
index 16d57a8..3a6384c 100644 (file)
@@ -136,14 +136,35 @@ static void dcscb_power_down(void)
                /*
                 * Flush all cache levels for this cluster.
                 *
-                * A15/A7 can hit in the cache with SCTLR.C=0, so we don't need
-                * a preliminary flush here for those CPUs.  At least, that's
-                * the theory -- without the extra flush, Linux explodes on
-                * RTSM (to be investigated).
+                * To do so we do:
+                * - Clear the SCTLR.C bit to prevent further cache allocations
+                * - Flush the whole cache
+                * - Clear the ACTLR "SMP" bit to disable local coherency
+                *
+                * Let's do it in the safest possible way i.e. with
+                * no memory access within the following sequence
+                * including to the stack.
+                *
+                * Note: fp is preserved to the stack explicitly prior doing
+                * this since adding it to the clobber list is incompatible
+                * with having CONFIG_FRAME_POINTER=y.
                 */
-               flush_cache_all();
-               set_cr(get_cr() & ~CR_C);
-               flush_cache_all();
+               asm volatile(
+               "str    fp, [sp, #-4]! \n\t"
+               "mrc    p15, 0, r0, c1, c0, 0   @ get CR \n\t"
+               "bic    r0, r0, #"__stringify(CR_C)" \n\t"
+               "mcr    p15, 0, r0, c1, c0, 0   @ set CR \n\t"
+               "isb    \n\t"
+               "bl     v7_flush_dcache_all \n\t"
+               "clrex  \n\t"
+               "mrc    p15, 0, r0, c1, c0, 1   @ get AUXCR \n\t"
+               "bic    r0, r0, #(1 << 6)       @ disable local coherency \n\t"
+               "mcr    p15, 0, r0, c1, c0, 1   @ set AUXCR \n\t"
+               "isb    \n\t"
+               "dsb    \n\t"
+               "ldr    fp, [sp], #4"
+               : : : "r0","r1","r2","r3","r4","r5","r6","r7",
+                     "r9","r10","lr","memory");
 
                /*
                 * This is a harmless no-op.  On platforms with a real
@@ -152,9 +173,6 @@ static void dcscb_power_down(void)
                 */
                outer_flush_all();
 
-               /* Disable local coherency by clearing the ACTLR "SMP" bit: */
-               set_auxcr(get_auxcr() & ~(1 << 6));
-
                /*
                 * Disable cluster-level coherency by masking
                 * incoming snoops and DVM messages:
@@ -167,18 +185,24 @@ static void dcscb_power_down(void)
 
                /*
                 * Flush the local CPU cache.
-                *
-                * A15/A7 can hit in the cache with SCTLR.C=0, so we don't need
-                * a preliminary flush here for those CPUs.  At least, that's
-                * the theory -- without the extra flush, Linux explodes on
-                * RTSM (to be investigated).
+                * Let's do it in the safest possible way as above.
                 */
-               flush_cache_louis();
-               set_cr(get_cr() & ~CR_C);
-               flush_cache_louis();
-
-               /* Disable local coherency by clearing the ACTLR "SMP" bit: */
-               set_auxcr(get_auxcr() & ~(1 << 6));
+               asm volatile(
+               "str    fp, [sp, #-4]! \n\t"
+               "mrc    p15, 0, r0, c1, c0, 0   @ get CR \n\t"
+               "bic    r0, r0, #"__stringify(CR_C)" \n\t"
+               "mcr    p15, 0, r0, c1, c0, 0   @ set CR \n\t"
+               "isb    \n\t"
+               "bl     v7_flush_dcache_louis \n\t"
+               "clrex  \n\t"
+               "mrc    p15, 0, r0, c1, c0, 1   @ get AUXCR \n\t"
+               "bic    r0, r0, #(1 << 6)       @ disable local coherency \n\t"
+               "mcr    p15, 0, r0, c1, c0, 1   @ set AUXCR \n\t"
+               "isb    \n\t"
+               "dsb    \n\t"
+               "ldr    fp, [sp], #4"
+               : : : "r0","r1","r2","r3","r4","r5","r6","r7",
+                     "r9","r10","lr","memory");
        }
 
        __mcpm_cpu_down(cpu, cluster);
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c
new file mode 100644 (file)
index 0000000..eefb029
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * Versatile Express Serial Power Controller (SPC) support
+ *
+ * Copyright (C) 2013 ARM Ltd.
+ *
+ * Authors: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
+ *          Achin Gupta           <achin.gupta@arm.com>
+ *          Lorenzo Pieralisi     <lorenzo.pieralisi@arm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#include <asm/cacheflush.h>
+
+#define SPCLOG "vexpress-spc: "
+
+/* SPC wake-up IRQs status and mask */
+#define WAKE_INT_MASK          0x24
+#define WAKE_INT_RAW           0x28
+#define WAKE_INT_STAT          0x2c
+/* SPC power down registers */
+#define A15_PWRDN_EN           0x30
+#define A7_PWRDN_EN            0x34
+/* SPC per-CPU mailboxes */
+#define A15_BX_ADDR0           0x68
+#define A7_BX_ADDR0            0x78
+
+/* wake-up interrupt masks */
+#define GBL_WAKEUP_INT_MSK     (0x3 << 10)
+
+/* TC2 static dual-cluster configuration */
+#define MAX_CLUSTERS           2
+
+struct ve_spc_drvdata {
+       void __iomem *baseaddr;
+       /*
+        * A15s cluster identifier
+        * It corresponds to A15 processors MPIDR[15:8] bitfield
+        */
+       u32 a15_clusid;
+};
+
+static struct ve_spc_drvdata *info;
+
+static inline bool cluster_is_a15(u32 cluster)
+{
+       return cluster == info->a15_clusid;
+}
+
+/**
+ * ve_spc_global_wakeup_irq()
+ *
+ * Function to set/clear global wakeup IRQs. Not protected by locking since
+ * it might be used in code paths where normal cacheable locks are not
+ * working. Locking must be provided by the caller to ensure atomicity.
+ *
+ * @set: if true, global wake-up IRQs are set, if false they are cleared
+ */
+void ve_spc_global_wakeup_irq(bool set)
+{
+       u32 reg;
+
+       reg = readl_relaxed(info->baseaddr + WAKE_INT_MASK);
+
+       if (set)
+               reg |= GBL_WAKEUP_INT_MSK;
+       else
+               reg &= ~GBL_WAKEUP_INT_MSK;
+
+       writel_relaxed(reg, info->baseaddr + WAKE_INT_MASK);
+}
+
+/**
+ * ve_spc_cpu_wakeup_irq()
+ *
+ * Function to set/clear per-CPU wake-up IRQs. Not protected by locking since
+ * it might be used in code paths where normal cacheable locks are not
+ * working. Locking must be provided by the caller to ensure atomicity.
+ *
+ * @cluster: mpidr[15:8] bitfield describing cluster affinity level
+ * @cpu: mpidr[7:0] bitfield describing cpu affinity level
+ * @set: if true, wake-up IRQs are set, if false they are cleared
+ */
+void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set)
+{
+       u32 mask, reg;
+
+       if (cluster >= MAX_CLUSTERS)
+               return;
+
+       mask = 1 << cpu;
+
+       if (!cluster_is_a15(cluster))
+               mask <<= 4;
+
+       reg = readl_relaxed(info->baseaddr + WAKE_INT_MASK);
+
+       if (set)
+               reg |= mask;
+       else
+               reg &= ~mask;
+
+       writel_relaxed(reg, info->baseaddr + WAKE_INT_MASK);
+}
+
+/**
+ * ve_spc_set_resume_addr() - set the jump address used for warm boot
+ *
+ * @cluster: mpidr[15:8] bitfield describing cluster affinity level
+ * @cpu: mpidr[7:0] bitfield describing cpu affinity level
+ * @addr: physical resume address
+ */
+void ve_spc_set_resume_addr(u32 cluster, u32 cpu, u32 addr)
+{
+       void __iomem *baseaddr;
+
+       if (cluster >= MAX_CLUSTERS)
+               return;
+
+       if (cluster_is_a15(cluster))
+               baseaddr = info->baseaddr + A15_BX_ADDR0 + (cpu << 2);
+       else
+               baseaddr = info->baseaddr + A7_BX_ADDR0 + (cpu << 2);
+
+       writel_relaxed(addr, baseaddr);
+}
+
+/**
+ * ve_spc_powerdown()
+ *
+ * Function to enable/disable cluster powerdown. Not protected by locking
+ * since it might be used in code paths where normal cacheable locks are not
+ * working. Locking must be provided by the caller to ensure atomicity.
+ *
+ * @cluster: mpidr[15:8] bitfield describing cluster affinity level
+ * @enable: if true enables powerdown, if false disables it
+ */
+void ve_spc_powerdown(u32 cluster, bool enable)
+{
+       u32 pwdrn_reg;
+
+       if (cluster >= MAX_CLUSTERS)
+               return;
+
+       pwdrn_reg = cluster_is_a15(cluster) ? A15_PWRDN_EN : A7_PWRDN_EN;
+       writel_relaxed(enable, info->baseaddr + pwdrn_reg);
+}
+
+int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid)
+{
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
+       if (!info) {
+               pr_err(SPCLOG "unable to allocate mem\n");
+               return -ENOMEM;
+       }
+
+       info->baseaddr = baseaddr;
+       info->a15_clusid = a15_clusid;
+
+       /*
+        * Multi-cluster systems may need this data when non-coherent, during
+        * cluster power-up/power-down. Make sure driver info reaches main
+        * memory.
+        */
+       sync_cache_w(info);
+       sync_cache_w(&info);
+
+       return 0;
+}
diff --git a/arch/arm/mach-vexpress/spc.h b/arch/arm/mach-vexpress/spc.h
new file mode 100644 (file)
index 0000000..5f7e4a4
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ *
+ * Copyright (C) 2012 ARM Limited
+ */
+
+
+#ifndef __SPC_H_
+#define __SPC_H_
+
+int __init ve_spc_init(void __iomem *base, u32 a15_clusid);
+void ve_spc_global_wakeup_irq(bool set);
+void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set);
+void ve_spc_set_resume_addr(u32 cluster, u32 cpu, u32 addr);
+void ve_spc_powerdown(u32 cluster, bool enable);
+
+#endif
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c
new file mode 100644 (file)
index 0000000..2b7c93a
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ * arch/arm/mach-vexpress/tc2_pm.c - TC2 power management support
+ *
+ * Created by: Nicolas Pitre, October 2012
+ * Copyright:  (C) 2012-2013  Linaro Limited
+ *
+ * Some portions of this file were originally written by Achin Gupta
+ * Copyright:   (C) 2012  ARM Limited
+ *
+ * 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/init.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/of_address.h>
+#include <linux/spinlock.h>
+#include <linux/errno.h>
+
+#include <asm/mcpm.h>
+#include <asm/proc-fns.h>
+#include <asm/cacheflush.h>
+#include <asm/cputype.h>
+#include <asm/cp15.h>
+
+#include <linux/arm-cci.h>
+
+#include "spc.h"
+
+/* SCC conf registers */
+#define A15_CONF               0x400
+#define A7_CONF                        0x500
+#define SYS_INFO               0x700
+#define SPC_BASE               0xb00
+
+/*
+ * We can't use regular spinlocks. In the switcher case, it is possible
+ * for an outbound CPU to call power_down() after its inbound counterpart
+ * is already live using the same logical CPU number which trips lockdep
+ * debugging.
+ */
+static arch_spinlock_t tc2_pm_lock = __ARCH_SPIN_LOCK_UNLOCKED;
+
+#define TC2_CLUSTERS                   2
+#define TC2_MAX_CPUS_PER_CLUSTER       3
+
+static unsigned int tc2_nr_cpus[TC2_CLUSTERS];
+
+/* Keep per-cpu usage count to cope with unordered up/down requests */
+static int tc2_pm_use_count[TC2_MAX_CPUS_PER_CLUSTER][TC2_CLUSTERS];
+
+#define tc2_cluster_unused(cluster) \
+       (!tc2_pm_use_count[0][cluster] && \
+        !tc2_pm_use_count[1][cluster] && \
+        !tc2_pm_use_count[2][cluster])
+
+static int tc2_pm_power_up(unsigned int cpu, unsigned int cluster)
+{
+       pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
+       if (cluster >= TC2_CLUSTERS || cpu >= tc2_nr_cpus[cluster])
+               return -EINVAL;
+
+       /*
+        * Since this is called with IRQs enabled, and no arch_spin_lock_irq
+        * variant exists, we need to disable IRQs manually here.
+        */
+       local_irq_disable();
+       arch_spin_lock(&tc2_pm_lock);
+
+       if (tc2_cluster_unused(cluster))
+               ve_spc_powerdown(cluster, false);
+
+       tc2_pm_use_count[cpu][cluster]++;
+       if (tc2_pm_use_count[cpu][cluster] == 1) {
+               ve_spc_set_resume_addr(cluster, cpu,
+                                      virt_to_phys(mcpm_entry_point));
+               ve_spc_cpu_wakeup_irq(cluster, cpu, true);
+       } else if (tc2_pm_use_count[cpu][cluster] != 2) {
+               /*
+                * The only possible values are:
+                * 0 = CPU down
+                * 1 = CPU (still) up
+                * 2 = CPU requested to be up before it had a chance
+                *     to actually make itself down.
+                * Any other value is a bug.
+                */
+               BUG();
+       }
+
+       arch_spin_unlock(&tc2_pm_lock);
+       local_irq_enable();
+
+       return 0;
+}
+
+static void tc2_pm_down(u64 residency)
+{
+       unsigned int mpidr, cpu, cluster;
+       bool last_man = false, skip_wfi = false;
+
+       mpidr = read_cpuid_mpidr();
+       cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+       cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+
+       pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
+       BUG_ON(cluster >= TC2_CLUSTERS || cpu >= TC2_MAX_CPUS_PER_CLUSTER);
+
+       __mcpm_cpu_going_down(cpu, cluster);
+
+       arch_spin_lock(&tc2_pm_lock);
+       BUG_ON(__mcpm_cluster_state(cluster) != CLUSTER_UP);
+       tc2_pm_use_count[cpu][cluster]--;
+       if (tc2_pm_use_count[cpu][cluster] == 0) {
+               ve_spc_cpu_wakeup_irq(cluster, cpu, true);
+               if (tc2_cluster_unused(cluster)) {
+                       ve_spc_powerdown(cluster, true);
+                       ve_spc_global_wakeup_irq(true);
+                       last_man = true;
+               }
+       } else if (tc2_pm_use_count[cpu][cluster] == 1) {
+               /*
+                * A power_up request went ahead of us.
+                * Even if we do not want to shut this CPU down,
+                * the caller expects a certain state as if the WFI
+                * was aborted.  So let's continue with cache cleaning.
+                */
+               skip_wfi = true;
+       } else
+               BUG();
+
+       if (last_man && __mcpm_outbound_enter_critical(cpu, cluster)) {
+               arch_spin_unlock(&tc2_pm_lock);
+
+               if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A15) {
+                       /*
+                        * On the Cortex-A15 we need to disable
+                        * L2 prefetching before flushing the cache.
+                        */
+                       asm volatile(
+                       "mcr    p15, 1, %0, c15, c0, 3 \n\t"
+                       "isb    \n\t"
+                       "dsb    "
+                       : : "r" (0x400) );
+               }
+
+               /*
+                * We need to disable and flush the whole (L1 and L2) cache.
+                * Let's do it in the safest possible way i.e. with
+                * no memory access within the following sequence
+                * including the stack.
+                *
+                * Note: fp is preserved to the stack explicitly prior doing
+                * this since adding it to the clobber list is incompatible
+                * with having CONFIG_FRAME_POINTER=y.
+                */
+               asm volatile(
+               "str    fp, [sp, #-4]! \n\t"
+               "mrc    p15, 0, r0, c1, c0, 0   @ get CR \n\t"
+               "bic    r0, r0, #"__stringify(CR_C)" \n\t"
+               "mcr    p15, 0, r0, c1, c0, 0   @ set CR \n\t"
+               "isb    \n\t"
+               "bl     v7_flush_dcache_all \n\t"
+               "clrex  \n\t"
+               "mrc    p15, 0, r0, c1, c0, 1   @ get AUXCR \n\t"
+               "bic    r0, r0, #(1 << 6)       @ disable local coherency \n\t"
+               "mcr    p15, 0, r0, c1, c0, 1   @ set AUXCR \n\t"
+               "isb    \n\t"
+               "dsb    \n\t"
+               "ldr    fp, [sp], #4"
+               : : : "r0","r1","r2","r3","r4","r5","r6","r7",
+                     "r9","r10","lr","memory");
+
+               cci_disable_port_by_cpu(mpidr);
+
+               __mcpm_outbound_leave_critical(cluster, CLUSTER_DOWN);
+       } else {
+               /*
+                * If last man then undo any setup done previously.
+                */
+               if (last_man) {
+                       ve_spc_powerdown(cluster, false);
+                       ve_spc_global_wakeup_irq(false);
+               }
+
+               arch_spin_unlock(&tc2_pm_lock);
+
+               /*
+                * We need to disable and flush only the L1 cache.
+                * Let's do it in the safest possible way as above.
+                */
+               asm volatile(
+               "str    fp, [sp, #-4]! \n\t"
+               "mrc    p15, 0, r0, c1, c0, 0   @ get CR \n\t"
+               "bic    r0, r0, #"__stringify(CR_C)" \n\t"
+               "mcr    p15, 0, r0, c1, c0, 0   @ set CR \n\t"
+               "isb    \n\t"
+               "bl     v7_flush_dcache_louis \n\t"
+               "clrex  \n\t"
+               "mrc    p15, 0, r0, c1, c0, 1   @ get AUXCR \n\t"
+               "bic    r0, r0, #(1 << 6)       @ disable local coherency \n\t"
+               "mcr    p15, 0, r0, c1, c0, 1   @ set AUXCR \n\t"
+               "isb    \n\t"
+               "dsb    \n\t"
+               "ldr    fp, [sp], #4"
+               : : : "r0","r1","r2","r3","r4","r5","r6","r7",
+                     "r9","r10","lr","memory");
+       }
+
+       __mcpm_cpu_down(cpu, cluster);
+
+       /* Now we are prepared for power-down, do it: */
+       if (!skip_wfi)
+               wfi();
+
+       /* Not dead at this point?  Let our caller cope. */
+}
+
+static void tc2_pm_power_down(void)
+{
+       tc2_pm_down(0);
+}
+
+static void tc2_pm_suspend(u64 residency)
+{
+       unsigned int mpidr, cpu, cluster;
+
+       mpidr = read_cpuid_mpidr();
+       cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+       cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+       ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point));
+       tc2_pm_down(residency);
+}
+
+static void tc2_pm_powered_up(void)
+{
+       unsigned int mpidr, cpu, cluster;
+       unsigned long flags;
+
+       mpidr = read_cpuid_mpidr();
+       cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+       cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+
+       pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
+       BUG_ON(cluster >= TC2_CLUSTERS || cpu >= TC2_MAX_CPUS_PER_CLUSTER);
+
+       local_irq_save(flags);
+       arch_spin_lock(&tc2_pm_lock);
+
+       if (tc2_cluster_unused(cluster)) {
+               ve_spc_powerdown(cluster, false);
+               ve_spc_global_wakeup_irq(false);
+       }
+
+       if (!tc2_pm_use_count[cpu][cluster])
+               tc2_pm_use_count[cpu][cluster] = 1;
+
+       ve_spc_cpu_wakeup_irq(cluster, cpu, false);
+       ve_spc_set_resume_addr(cluster, cpu, 0);
+
+       arch_spin_unlock(&tc2_pm_lock);
+       local_irq_restore(flags);
+}
+
+static const struct mcpm_platform_ops tc2_pm_power_ops = {
+       .power_up       = tc2_pm_power_up,
+       .power_down     = tc2_pm_power_down,
+       .suspend        = tc2_pm_suspend,
+       .powered_up     = tc2_pm_powered_up,
+};
+
+static bool __init tc2_pm_usage_count_init(void)
+{
+       unsigned int mpidr, cpu, cluster;
+
+       mpidr = read_cpuid_mpidr();
+       cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+       cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+
+       pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
+       if (cluster >= TC2_CLUSTERS || cpu >= tc2_nr_cpus[cluster]) {
+               pr_err("%s: boot CPU is out of bound!\n", __func__);
+               return false;
+       }
+       tc2_pm_use_count[cpu][cluster] = 1;
+       return true;
+}
+
+/*
+ * Enable cluster-level coherency, in preparation for turning on the MMU.
+ */
+static void __naked tc2_pm_power_up_setup(unsigned int affinity_level)
+{
+       asm volatile (" \n"
+"      cmp     r0, #1 \n"
+"      bxne    lr \n"
+"      b       cci_enable_port_for_self ");
+}
+
+static int __init tc2_pm_init(void)
+{
+       int ret;
+       void __iomem *scc;
+       u32 a15_cluster_id, a7_cluster_id, sys_info;
+       struct device_node *np;
+
+       /*
+        * The power management-related features are hidden behind
+        * SCC registers. We need to extract runtime information like
+        * cluster ids and number of CPUs really available in clusters.
+        */
+       np = of_find_compatible_node(NULL, NULL,
+                       "arm,vexpress-scc,v2p-ca15_a7");
+       scc = of_iomap(np, 0);
+       if (!scc)
+               return -ENODEV;
+
+       a15_cluster_id = readl_relaxed(scc + A15_CONF) & 0xf;
+       a7_cluster_id = readl_relaxed(scc + A7_CONF) & 0xf;
+       if (a15_cluster_id >= TC2_CLUSTERS || a7_cluster_id >= TC2_CLUSTERS)
+               return -EINVAL;
+
+       sys_info = readl_relaxed(scc + SYS_INFO);
+       tc2_nr_cpus[a15_cluster_id] = (sys_info >> 16) & 0xf;
+       tc2_nr_cpus[a7_cluster_id] = (sys_info >> 20) & 0xf;
+
+       /*
+        * A subset of the SCC registers is also used to communicate
+        * with the SPC (power controller). We need to be able to
+        * drive it very early in the boot process to power up
+        * processors, so we initialize the SPC driver here.
+        */
+       ret = ve_spc_init(scc + SPC_BASE, a15_cluster_id);
+       if (ret)
+               return ret;
+
+       if (!cci_probed())
+               return -ENODEV;
+
+       if (!tc2_pm_usage_count_init())
+               return -EINVAL;
+
+       ret = mcpm_platform_register(&tc2_pm_power_ops);
+       if (!ret) {
+               mcpm_sync_init(tc2_pm_power_up_setup);
+               pr_info("TC2 power management initialized\n");
+       }
+       return ret;
+}
+
+early_initcall(tc2_pm_init);
index c1d61f2..04f8a4a 100644 (file)
@@ -6,7 +6,7 @@ config ARCH_ZYNQ
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if LOCAL_TIMERS
+       select HAVE_ARM_TWD if SMP
        select ICST
        select MIGHT_HAVE_CACHE_L2X0
        select USE_OF
index c89672b..5052c70 100644 (file)
@@ -40,44 +40,6 @@ static inline void zynq_cpu_enter_lowpower(void)
          : "cc");
 }
 
-static inline void zynq_cpu_leave_lowpower(void)
-{
-       unsigned int v;
-
-       asm volatile(
-       "       mrc     p15, 0, %0, c1, c0, 0\n"
-       "       orr     %0, %0, %1\n"
-       "       mcr     p15, 0, %0, c1, c0, 0\n"
-       "       mrc     p15, 0, %0, c1, c0, 1\n"
-       "       orr     %0, %0, #0x40\n"
-       "       mcr     p15, 0, %0, c1, c0, 1\n"
-         : "=&r" (v)
-         : "Ir" (CR_C)
-         : "cc");
-}
-
-static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious)
-{
-       /*
-        * there is no power-control hardware on this platform, so all
-        * we can do is put the core into WFI; this is safe as the calling
-        * code will have already disabled interrupts
-        */
-       for (;;) {
-               dsb();
-               wfi();
-
-               /*
-                * Getting here, means that we have come out of WFI without
-                * having been woken up - this shouldn't happen
-                *
-                * Just note it happening - when we're woken, we can report
-                * its occurrence.
-                */
-               (*spurious)++;
-       }
-}
-
 /*
  * platform-specific code to shutdown a CPU
  *
@@ -85,20 +47,13 @@ static inline void zynq_platform_do_lowpower(unsigned int cpu, int *spurious)
  */
 void zynq_platform_cpu_die(unsigned int cpu)
 {
-       int spurious = 0;
-
-       /*
-        * we're ready for shutdown now, so do it
-        */
        zynq_cpu_enter_lowpower();
-       zynq_platform_do_lowpower(cpu, &spurious);
 
        /*
-        * bring this CPU back into the world of cache
-        * coherency, and then restore interrupts
+        * there is no power-control hardware on this platform, so all
+        * we can do is put the core into WFI; this is safe as the calling
+        * code will have already disabled interrupts
         */
-       zynq_cpu_leave_lowpower();
-
-       if (spurious)
-               pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
+       for (;;)
+               cpu_do_idle();
 }
index 50d008d..1836d5a 100644 (file)
  * 02139, USA.
  */
 
-#include <linux/export.h>
 #include <linux/io.h>
-#include <linux/fs.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/of_address.h>
-#include <linux/uaccess.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/string.h>
 #include <linux/clk/zynq.h>
 #include "common.h"
 
-#define SLCR_UNLOCK_MAGIC              0xDF0D
-#define SLCR_UNLOCK                    0x8   /* SCLR unlock register */
-
+/* register offsets */
+#define SLCR_UNLOCK_OFFSET             0x8   /* SCLR unlock register */
 #define SLCR_PS_RST_CTRL_OFFSET                0x200 /* PS Software Reset Control */
+#define SLCR_A9_CPU_RST_CTRL_OFFSET    0x244 /* CPU Software Reset Control */
+#define SLCR_REBOOT_STATUS_OFFSET      0x258 /* PS Reboot Status */
 
+#define SLCR_UNLOCK_MAGIC              0xDF0D
 #define SLCR_A9_CPU_CLKSTOP            0x10
 #define SLCR_A9_CPU_RST                        0x1
 
-#define SLCR_A9_CPU_RST_CTRL           0x244 /* CPU Software Reset Control */
-#define SLCR_REBOOT_STATUS             0x258 /* PS Reboot Status */
-
 void __iomem *zynq_slcr_base;
 
 /**
@@ -54,15 +43,15 @@ void zynq_slcr_system_reset(void)
         * Note that this seems to require raw i/o
         * functions or there's a lockup?
         */
-       writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK);
+       writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET);
 
        /*
         * Clear 0x0F000000 bits of reboot status register to workaround
         * the FSBL not loading the bitstream after soft-reboot
         * This is a temporary solution until we know more.
         */
-       reboot = readl(zynq_slcr_base + SLCR_REBOOT_STATUS);
-       writel(reboot & 0xF0FFFFFF, zynq_slcr_base + SLCR_REBOOT_STATUS);
+       reboot = readl(zynq_slcr_base + SLCR_REBOOT_STATUS_OFFSET);
+       writel(reboot & 0xF0FFFFFF, zynq_slcr_base + SLCR_REBOOT_STATUS_OFFSET);
        writel(1, zynq_slcr_base + SLCR_PS_RST_CTRL_OFFSET);
 }
 
@@ -72,11 +61,11 @@ void zynq_slcr_system_reset(void)
  */
 void zynq_slcr_cpu_start(int cpu)
 {
-       /* enable CPUn */
-       writel(SLCR_A9_CPU_CLKSTOP << cpu,
-              zynq_slcr_base + SLCR_A9_CPU_RST_CTRL);
-       /* enable CLK for CPUn */
-       writel(0x0 << cpu, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL);
+       u32 reg = readl(zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET);
+       reg &= ~(SLCR_A9_CPU_RST << cpu);
+       writel(reg, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET);
+       reg &= ~(SLCR_A9_CPU_CLKSTOP << cpu);
+       writel(reg, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET);
 }
 
 /**
@@ -85,9 +74,9 @@ void zynq_slcr_cpu_start(int cpu)
  */
 void zynq_slcr_cpu_stop(int cpu)
 {
-       /* stop CLK and reset CPUn */
-       writel((SLCR_A9_CPU_CLKSTOP | SLCR_A9_CPU_RST) << cpu,
-              zynq_slcr_base + SLCR_A9_CPU_RST_CTRL);
+       u32 reg = readl(zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET);
+       reg |= (SLCR_A9_CPU_CLKSTOP | SLCR_A9_CPU_RST) << cpu;
+       writel(reg, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET);
 }
 
 /**
@@ -113,7 +102,7 @@ int __init zynq_slcr_init(void)
        }
 
        /* unlock the SLCR so that registers can be changed */
-       writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK);
+       writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET);
 
        pr_info("%s mapped to %p\n", np->name, zynq_slcr_base);
 
index f82bae2..436ea97 100644 (file)
@@ -106,7 +106,7 @@ config OMAP_32K_TIMER
          This timer saves power compared to the OMAP_MPU_TIMER, and has
          support for no tick during idle. The 32KHz timer provides less
          intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is
-         currently only available for OMAP16XX, 24XX, 34XX and OMAP4/5.
+         currently only available for OMAP16XX, 24XX, 34XX, OMAP4/5 and DRA7XX.
 
          On OMAP2PLUS this value is only used for CONFIG_HZ and
          CLOCK_TICK_RATE compile time calculation.
index 4d463ca..0376606 100644 (file)
@@ -2083,6 +2083,7 @@ static int omap_system_dma_probe(struct platform_device *pdev)
                dma_irq = platform_get_irq_byname(pdev, irq_name);
                if (dma_irq < 0) {
                        dev_err(&pdev->dev, "failed: request IRQ %d", dma_irq);
+                       ret = dma_irq;
                        goto exit_dma_lch_fail;
                }
                ret = setup_irq(dma_irq, &omap24xx_dma_irq);
index 8db0b98..c492e1b 100644 (file)
@@ -47,7 +47,7 @@ static int __init orion_add_irq_domain(struct device_node *np,
        do {
                base = of_iomap(np, i);
                if (base) {
-                       orion_irq_init(i * 32, base);
+                       orion_irq_init(i * 32, base + 0x04);
                        i++;
                }
        } while (base);
index a5b5ff6..7dfba93 100644 (file)
@@ -25,7 +25,6 @@ config PLAT_S5P
        select S5P_GPIO_DRVSTR
        select SAMSUNG_CLKSRC if !COMMON_CLK
        select SAMSUNG_GPIOLIB_4BIT
-       select SAMSUNG_IRQ_VIC_TIMER
        help
          Base platform code for Samsung's S5P series SoC.
 
@@ -79,14 +78,6 @@ config SAMSUNG_ATAGS
 
 if SAMSUNG_ATAGS
 
-# timer options
-
-config SAMSUNG_HRT
-       bool
-       select SAMSUNG_DEV_PWM
-       help
-         Use the High Resolution timer support
-
 # clock options
 
 config SAMSUNG_CLOCK
@@ -106,11 +97,6 @@ config S5P_CLOCK
 
 # options for IRQ support
 
-config SAMSUNG_IRQ_VIC_TIMER
-       bool
-       help
-         Internal configuration to build the VIC timer interrupt code.
-
 config S5P_IRQ
        def_bool (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210)
        help
index 199bbe3..498c7c2 100644 (file)
@@ -12,15 +12,12 @@ obj-                                :=
 # Objects we always build independent of SoC choice
 
 obj-y                          += init.o cpu.o
-obj-$(CONFIG_SAMSUNG_HRT)      += samsung-time.o
 
 obj-$(CONFIG_SAMSUNG_CLOCK)    += clock.o
-obj-$(CONFIG_SAMSUNG_CLOCK)    += pwm-clock.o
 
 obj-$(CONFIG_SAMSUNG_CLKSRC)   += clock-clksrc.o
 obj-$(CONFIG_S5P_CLOCK)                += s5p-clock.o
 
-obj-$(CONFIG_SAMSUNG_IRQ_VIC_TIMER) += irq-vic-timer.o
 obj-$(CONFIG_S5P_IRQ)          += s5p-irq.o
 obj-$(CONFIG_S5P_EXT_INT)      += s5p-irq-eint.o
 obj-$(CONFIG_S5P_GPIO_INT)     += s5p-irq-gpioint.o
index 5f197dc..d51f956 100644 (file)
 #include <plat/gpio-cfg.h>
 #include <plat/backlight.h>
 
+struct samsung_bl_drvdata {
+       struct platform_pwm_backlight_data plat_data;
+       struct samsung_bl_gpio_info *gpio_info;
+};
+
 static int samsung_bl_init(struct device *dev)
 {
        int ret = 0;
-       struct platform_device *timer_dev =
-                       container_of(dev->parent, struct platform_device, dev);
-       struct samsung_bl_gpio_info *bl_gpio_info =
-                       timer_dev->dev.platform_data;
+       struct platform_pwm_backlight_data *pdata = dev->platform_data;
+       struct samsung_bl_drvdata *drvdata = container_of(pdata,
+                                       struct samsung_bl_drvdata, plat_data);
+       struct samsung_bl_gpio_info *bl_gpio_info = drvdata->gpio_info;
 
        ret = gpio_request(bl_gpio_info->no, "Backlight");
        if (ret) {
@@ -42,10 +47,10 @@ static int samsung_bl_init(struct device *dev)
 
 static void samsung_bl_exit(struct device *dev)
 {
-       struct platform_device *timer_dev =
-                       container_of(dev->parent, struct platform_device, dev);
-       struct samsung_bl_gpio_info *bl_gpio_info =
-                       timer_dev->dev.platform_data;
+       struct platform_pwm_backlight_data *pdata = dev->platform_data;
+       struct samsung_bl_drvdata *drvdata = container_of(pdata,
+                                       struct samsung_bl_drvdata, plat_data);
+       struct samsung_bl_gpio_info *bl_gpio_info = drvdata->gpio_info;
 
        s3c_gpio_cfgpin(bl_gpio_info->no, S3C_GPIO_OUTPUT);
        gpio_free(bl_gpio_info->no);
@@ -60,12 +65,14 @@ static void samsung_bl_exit(struct device *dev)
  * for their specific boards
  */
 
-static struct platform_pwm_backlight_data samsung_dfl_bl_data __initdata = {
-       .max_brightness = 255,
-       .dft_brightness = 255,
-       .pwm_period_ns  = 78770,
-       .init           = samsung_bl_init,
-       .exit           = samsung_bl_exit,
+static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = {
+       .plat_data = {
+               .max_brightness = 255,
+               .dft_brightness = 255,
+               .pwm_period_ns  = 78770,
+               .init           = samsung_bl_init,
+               .exit           = samsung_bl_exit,
+       },
 };
 
 static struct platform_device samsung_dfl_bl_device __initdata = {
@@ -82,6 +89,7 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
 {
        int ret = 0;
        struct platform_device *samsung_bl_device;
+       struct samsung_bl_drvdata *samsung_bl_drvdata;
        struct platform_pwm_backlight_data *samsung_bl_data;
 
        samsung_bl_device = kmemdup(&samsung_dfl_bl_device,
@@ -91,17 +99,19 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
                return;
        }
 
-       samsung_bl_data = s3c_set_platdata(&samsung_dfl_bl_data,
-               sizeof(struct platform_pwm_backlight_data), samsung_bl_device);
-       if (!samsung_bl_data) {
+       samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data,
+                               sizeof(samsung_dfl_bl_data), GFP_KERNEL);
+       if (!samsung_bl_drvdata) {
                printk(KERN_ERR "%s: no memory for platform dev\n", __func__);
                goto err_data;
        }
+       samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data;
+       samsung_bl_drvdata->gpio_info = gpio_info;
+       samsung_bl_data = &samsung_bl_drvdata->plat_data;
 
        /* Copy board specific data provided by user */
        samsung_bl_data->pwm_id = bl_data->pwm_id;
-       samsung_bl_device->dev.parent =
-                       &s3c_device_timer[samsung_bl_data->pwm_id].dev;
+       samsung_bl_device->dev.parent = &samsung_device_pwm.dev;
 
        if (bl_data->max_brightness)
                samsung_bl_data->max_brightness = bl_data->max_brightness;
@@ -122,17 +132,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
        if (bl_data->check_fb)
                samsung_bl_data->check_fb = bl_data->check_fb;
 
-       /* Keep the GPIO info for future use */
-       s3c_device_timer[samsung_bl_data->pwm_id].dev.platform_data = gpio_info;
-
-       /* Register the specific PWM timer dev for Backlight control */
-       ret = platform_device_register(
-                       &s3c_device_timer[samsung_bl_data->pwm_id]);
-       if (ret) {
-               printk(KERN_ERR "failed to register pwm timer for backlight: %d\n", ret);
-               goto err_plat_reg1;
-       }
-
        /* Register the Backlight dev */
        ret = platform_device_register(samsung_bl_device);
        if (ret) {
@@ -143,8 +142,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
        return;
 
 err_plat_reg2:
-       platform_device_unregister(&s3c_device_timer[samsung_bl_data->pwm_id]);
-err_plat_reg1:
        kfree(samsung_bl_data);
 err_data:
        kfree(samsung_bl_device);
index 0f9c3f4..8ce0ac0 100644 (file)
@@ -58,6 +58,7 @@
 #include <plat/keypad.h>
 #include <linux/platform_data/mmc-s3cmci.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
+#include <plat/pwm-core.h>
 #include <plat/sdhci.h>
 #include <linux/platform_data/touchscreen-s3c2410.h>
 #include <linux/platform_data/usb-s3c2410_udc.h>
@@ -1097,36 +1098,21 @@ arch_initcall(s5p_pmu_init);
 /* PWM Timer */
 
 #ifdef CONFIG_SAMSUNG_DEV_PWM
+static struct resource samsung_pwm_resource[] = {
+       DEFINE_RES_MEM(SAMSUNG_PA_TIMER, SZ_4K),
+};
 
-#define TIMER_RESOURCE_SIZE (1)
-
-#define TIMER_RESOURCE(_tmr, _irq)                     \
-       (struct resource [TIMER_RESOURCE_SIZE]) {       \
-               [0] = {                                 \
-                       .start  = _irq,                 \
-                       .end    = _irq,                 \
-                       .flags  = IORESOURCE_IRQ        \
-               }                                       \
-       }
-
-#define DEFINE_S3C_TIMER(_tmr_no, _irq)                        \
-       .name           = "s3c24xx-pwm",                \
-       .id             = _tmr_no,                      \
-       .num_resources  = TIMER_RESOURCE_SIZE,          \
-       .resource       = TIMER_RESOURCE(_tmr_no, _irq),        \
-
-/*
- * since we already have an static mapping for the timer,
- * we do not bother setting any IO resource for the base.
- */
-
-struct platform_device s3c_device_timer[] = {
-       [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
-       [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
-       [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
-       [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
-       [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
+struct platform_device samsung_device_pwm = {
+       .name           = "samsung-pwm",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(samsung_pwm_resource),
+       .resource       = samsung_pwm_resource,
 };
+
+void __init samsung_pwm_set_platdata(struct samsung_pwm_variant *pd)
+{
+       samsung_device_pwm.dev.platform_data = pd;
+}
 #endif /* CONFIG_SAMSUNG_DEV_PWM */
 
 /* RTC */
index df45d6e..63239f4 100644 (file)
@@ -145,10 +145,6 @@ extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable);
 
 extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable);
 
-/* Init for pwm clock code */
-
-extern void s3c_pwmclk_init(void);
-
 /* Global watchdog clock used by arch_wtd_reset() callback */
 
 extern struct clk *s3c2410_wdtclk;
index 87d501f..0dc4ac4 100644 (file)
@@ -134,6 +134,7 @@ extern struct platform_device exynos4_device_spdif;
 
 extern struct platform_device samsung_asoc_idma;
 extern struct platform_device samsung_device_keypad;
+extern struct platform_device samsung_device_pwm;
 
 /* s3c2440 specific devices */
 
diff --git a/arch/arm/plat-samsung/include/plat/irq-vic-timer.h b/arch/arm/plat-samsung/include/plat/irq-vic-timer.h
deleted file mode 100644 (file)
index 5b9c42f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* arch/arm/plat-samsung/include/plat/irq-vic-timer.h
- *
- * Copyright (c) 2010 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * Header file for Samsung SoC IRQ VIC timer
- *
- * 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 s3c_init_vic_timer_irq(unsigned int num, unsigned int timer_irq);
index df46b77..039001c 100644 (file)
 #define S5P_IRQ_VIC2(x)                (S5P_VIC2_BASE + (x))
 #define S5P_IRQ_VIC3(x)                (S5P_VIC3_BASE + (x))
 
-#define S5P_TIMER_IRQ(x)       (IRQ_TIMER_BASE + (x))
-
-#define IRQ_TIMER0             S5P_TIMER_IRQ(0)
-#define IRQ_TIMER1             S5P_TIMER_IRQ(1)
-#define IRQ_TIMER2             S5P_TIMER_IRQ(2)
-#define IRQ_TIMER3             S5P_TIMER_IRQ(3)
-#define IRQ_TIMER4             S5P_TIMER_IRQ(4)
-#define IRQ_TIMER_COUNT                (5)
-
 #define IRQ_EINT(x)            ((x) < 16 ? ((x) + S5P_EINT_BASE1) \
                                        : ((x) - 16 + S5P_EINT_BASE2))
 
diff --git a/arch/arm/plat-samsung/include/plat/pwm-clock.h b/arch/arm/plat-samsung/include/plat/pwm-clock.h
deleted file mode 100644 (file)
index bf6a60e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* linux/arch/arm/plat-samsung/include/plat/pwm-clock.h
- *
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * Copyright 2008 Openmoko, Inc.
- * Copyright 2008 Simtec Electronics
- *      Ben Dooks <ben@simtec.co.uk>
- *      http://armlinux.simtec.co.uk/
- *
- * SAMSUNG - pwm clock and timer support
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_PLAT_PWM_CLOCK_H
-#define __ASM_PLAT_PWM_CLOCK_H __FILE__
-
-/**
- * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
- * @tcfg: The timer TCFG1 register bits shifted down to 0.
- *
- * Return true if the given configuration from TCFG1 is a TCLK instead
- * any of the TDIV clocks.
- */
-static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
-{
-       if (soc_is_s3c24xx())
-               return tcfg == S3C2410_TCFG1_MUX_TCLK;
-       else if (soc_is_s3c64xx() || soc_is_s5pc100())
-               return tcfg >= S3C64XX_TCFG1_MUX_TCLK;
-       else if (soc_is_s5p6440() || soc_is_s5p6450())
-               return 0;
-       else
-               return tcfg == S3C64XX_TCFG1_MUX_TCLK;
-}
-
-/**
- * tcfg_to_divisor() - convert tcfg1 setting to a divisor
- * @tcfg1: The tcfg1 setting, shifted down.
- *
- * Get the divisor value for the given tcfg1 setting. We assume the
- * caller has already checked to see if this is not a TCLK source.
- */
-static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
-{
-       if (soc_is_s3c24xx())
-               return 1 << (tcfg1 + 1);
-       else
-               return 1 << tcfg1;
-}
-
-/**
- * pwm_tdiv_has_div1() - does the tdiv setting have a /1
- *
- * Return true if we have a /1 in the tdiv setting.
- */
-static inline unsigned int pwm_tdiv_has_div1(void)
-{
-       if (soc_is_s3c24xx())
-               return 0;
-       else
-               return 1;
-}
-
-/**
- * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
- * @div: The divisor to calculate the bit information for.
- *
- * Turn a divisor into the necessary bit field for TCFG1.
- */
-static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
-{
-       if (soc_is_s3c24xx())
-               return ilog2(div) - 1;
-       else
-               return ilog2(div);
-}
-#endif /* __ASM_PLAT_PWM_CLOCK_H */
diff --git a/arch/arm/plat-samsung/include/plat/pwm-core.h b/arch/arm/plat-samsung/include/plat/pwm-core.h
new file mode 100644 (file)
index 0000000..5bff1fa
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2013 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * Samsung PWM controller platform data helpers.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_PWM_CORE_H
+#define __ASM_ARCH_PWM_CORE_H __FILE__
+
+#include <clocksource/samsung_pwm.h>
+
+#ifdef CONFIG_SAMSUNG_DEV_PWM
+extern void samsung_pwm_set_platdata(struct samsung_pwm_variant *pd);
+#else
+static inline void samsung_pwm_set_platdata(struct samsung_pwm_variant *pd) { }
+#endif
+
+#endif /* __ASM_ARCH_PWM_CORE_H */
diff --git a/arch/arm/plat-samsung/include/plat/regs-timer.h b/arch/arm/plat-samsung/include/plat/regs-timer.h
deleted file mode 100644 (file)
index d097d92..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/regs-timer.h
- *
- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
- *                   http://www.simtec.co.uk/products/SWLINUX/
- *
- * 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.
- *
- * S3C2410 Timer configuration
-*/
-
-#ifndef __ASM_ARCH_REGS_TIMER_H
-#define __ASM_ARCH_REGS_TIMER_H
-
-#define S3C_TIMERREG(x) (S3C_VA_TIMER + (x))
-#define S3C_TIMERREG2(tmr,reg) S3C_TIMERREG((reg)+0x0c+((tmr)*0x0c))
-
-#define S3C2410_TCFG0        S3C_TIMERREG(0x00)
-#define S3C2410_TCFG1        S3C_TIMERREG(0x04)
-#define S3C2410_TCON         S3C_TIMERREG(0x08)
-
-#define S3C64XX_TINT_CSTAT    S3C_TIMERREG(0x44)
-
-#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
-#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
-#define S3C2410_TCFG_PRESCALER1_SHIFT (8)
-#define S3C2410_TCFG_DEADZONE_MASK   (255<<16)
-#define S3C2410_TCFG_DEADZONE_SHIFT  (16)
-
-#define S3C2410_TCFG1_MUX4_DIV2          (0<<16)
-#define S3C2410_TCFG1_MUX4_DIV4          (1<<16)
-#define S3C2410_TCFG1_MUX4_DIV8          (2<<16)
-#define S3C2410_TCFG1_MUX4_DIV16  (3<<16)
-#define S3C2410_TCFG1_MUX4_TCLK1  (4<<16)
-#define S3C2410_TCFG1_MUX4_MASK          (15<<16)
-#define S3C2410_TCFG1_MUX4_SHIFT  (16)
-
-#define S3C2410_TCFG1_MUX3_DIV2          (0<<12)
-#define S3C2410_TCFG1_MUX3_DIV4          (1<<12)
-#define S3C2410_TCFG1_MUX3_DIV8          (2<<12)
-#define S3C2410_TCFG1_MUX3_DIV16  (3<<12)
-#define S3C2410_TCFG1_MUX3_TCLK1  (4<<12)
-#define S3C2410_TCFG1_MUX3_MASK          (15<<12)
-
-
-#define S3C2410_TCFG1_MUX2_DIV2          (0<<8)
-#define S3C2410_TCFG1_MUX2_DIV4          (1<<8)
-#define S3C2410_TCFG1_MUX2_DIV8          (2<<8)
-#define S3C2410_TCFG1_MUX2_DIV16  (3<<8)
-#define S3C2410_TCFG1_MUX2_TCLK1  (4<<8)
-#define S3C2410_TCFG1_MUX2_MASK          (15<<8)
-
-
-#define S3C2410_TCFG1_MUX1_DIV2          (0<<4)
-#define S3C2410_TCFG1_MUX1_DIV4          (1<<4)
-#define S3C2410_TCFG1_MUX1_DIV8          (2<<4)
-#define S3C2410_TCFG1_MUX1_DIV16  (3<<4)
-#define S3C2410_TCFG1_MUX1_TCLK0  (4<<4)
-#define S3C2410_TCFG1_MUX1_MASK          (15<<4)
-
-#define S3C2410_TCFG1_MUX0_DIV2          (0<<0)
-#define S3C2410_TCFG1_MUX0_DIV4          (1<<0)
-#define S3C2410_TCFG1_MUX0_DIV8          (2<<0)
-#define S3C2410_TCFG1_MUX0_DIV16  (3<<0)
-#define S3C2410_TCFG1_MUX0_TCLK0  (4<<0)
-#define S3C2410_TCFG1_MUX0_MASK          (15<<0)
-
-#define S3C2410_TCFG1_MUX_DIV2   (0<<0)
-#define S3C2410_TCFG1_MUX_DIV4   (1<<0)
-#define S3C2410_TCFG1_MUX_DIV8   (2<<0)
-#define S3C2410_TCFG1_MUX_DIV16   (3<<0)
-#define S3C2410_TCFG1_MUX_TCLK    (4<<0)
-#define S3C2410_TCFG1_MUX_MASK   (15<<0)
-
-#define S3C64XX_TCFG1_MUX_DIV1   (0<<0)
-#define S3C64XX_TCFG1_MUX_DIV2   (1<<0)
-#define S3C64XX_TCFG1_MUX_DIV4   (2<<0)
-#define S3C64XX_TCFG1_MUX_DIV8    (3<<0)
-#define S3C64XX_TCFG1_MUX_DIV16   (4<<0)
-#define S3C64XX_TCFG1_MUX_TCLK    (5<<0)  /* 3 sets of TCLK */
-#define S3C64XX_TCFG1_MUX_MASK   (15<<0)
-
-#define S3C2410_TCFG1_SHIFT(x)   ((x) * 4)
-
-/* for each timer, we have an count buffer, an compare buffer and
- * an observation buffer
-*/
-
-/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */
-
-#define S3C2410_TCNTB(tmr)    S3C_TIMERREG2(tmr, 0x00)
-#define S3C2410_TCMPB(tmr)    S3C_TIMERREG2(tmr, 0x04)
-#define S3C2410_TCNTO(tmr)    S3C_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
-
-#define S3C2410_TCON_T4RELOAD    (1<<22)
-#define S3C2410_TCON_T4MANUALUPD  (1<<21)
-#define S3C2410_TCON_T4START     (1<<20)
-
-#define S3C2410_TCON_T3RELOAD    (1<<19)
-#define S3C2410_TCON_T3INVERT    (1<<18)
-#define S3C2410_TCON_T3MANUALUPD  (1<<17)
-#define S3C2410_TCON_T3START     (1<<16)
-
-#define S3C2410_TCON_T2RELOAD    (1<<15)
-#define S3C2410_TCON_T2INVERT    (1<<14)
-#define S3C2410_TCON_T2MANUALUPD  (1<<13)
-#define S3C2410_TCON_T2START     (1<<12)
-
-#define S3C2410_TCON_T1RELOAD    (1<<11)
-#define S3C2410_TCON_T1INVERT    (1<<10)
-#define S3C2410_TCON_T1MANUALUPD  (1<<9)
-#define S3C2410_TCON_T1START     (1<<8)
-
-#define S3C2410_TCON_T0DEADZONE          (1<<4)
-#define S3C2410_TCON_T0RELOAD    (1<<3)
-#define S3C2410_TCON_T0INVERT    (1<<2)
-#define S3C2410_TCON_T0MANUALUPD  (1<<1)
-#define S3C2410_TCON_T0START     (1<<0)
-
-#endif /*  __ASM_ARCH_REGS_TIMER_H */
-
-
-
index 4cc99bb..209464a 100644 (file)
@@ -22,29 +22,6 @@ enum samsung_timer_mode {
        SAMSUNG_PWM4,
 };
 
-struct samsung_timer_source {
-       unsigned int event_id;
-       unsigned int source_id;
-};
-
-/* Be able to sleep for atleast 4 seconds (usually more) */
-#define SAMSUNG_TIMER_MIN_RANGE        4
-
-#if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S5PC100)
-#define TCNT_MAX               0xffff
-#define TSCALER_DIV            25
-#define TDIV                   50
-#define TSIZE                  16
-#else
-#define TCNT_MAX               0xffffffff
-#define TSCALER_DIV            2
-#define TDIV                   2
-#define TSIZE                  32
-#endif
-
-#define NON_PERIODIC           0
-#define PERIODIC               1
-
 extern void __init samsung_set_timer_source(enum samsung_timer_mode event,
                                        enum samsung_timer_mode source);
 
index ce1d0f7..bf65021 100644 (file)
@@ -260,44 +260,6 @@ static inline void s5pv210_default_sdhci3(void) { }
 
 #endif /* CONFIG_S5PV210_SETUP_SDHCI */
 
-/* EXYNOS4 SDHCI setup */
-#ifdef CONFIG_EXYNOS4_SETUP_SDHCI
-static inline void exynos4_default_sdhci0(void)
-{
-#ifdef CONFIG_S3C_DEV_HSMMC
-       s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
-#endif
-}
-
-static inline void exynos4_default_sdhci1(void)
-{
-#ifdef CONFIG_S3C_DEV_HSMMC1
-       s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
-#endif
-}
-
-static inline void exynos4_default_sdhci2(void)
-{
-#ifdef CONFIG_S3C_DEV_HSMMC2
-       s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
-#endif
-}
-
-static inline void exynos4_default_sdhci3(void)
-{
-#ifdef CONFIG_S3C_DEV_HSMMC3
-       s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
-#endif
-}
-
-#else
-static inline void exynos4_default_sdhci0(void) { }
-static inline void exynos4_default_sdhci1(void) { }
-static inline void exynos4_default_sdhci2(void) { }
-static inline void exynos4_default_sdhci3(void) { }
-
-#endif /* CONFIG_EXYNOS4_SETUP_SDHCI */
-
 static inline void s3c_sdhci_setname(int id, char *name)
 {
        switch (id) {
diff --git a/arch/arm/plat-samsung/irq-vic-timer.c b/arch/arm/plat-samsung/irq-vic-timer.c
deleted file mode 100644 (file)
index 0fceb42..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/* arch/arm/plat-samsung/irq-vic-timer.c
- *     originally part of arch/arm/plat-s3c64xx/irq.c
- *
- * Copyright 2008 Openmoko, Inc.
- * Copyright 2008 Simtec Electronics
- *      Ben Dooks <ben@simtec.co.uk>
- *      http://armlinux.simtec.co.uk/
- *
- * S3C64XX - Interrupt handling
- *
- * 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/interrupt.h>
-#include <linux/irq.h>
-#include <linux/irqchip/chained_irq.h>
-#include <linux/io.h>
-
-#include <mach/map.h>
-#include <mach/irqs.h>
-#include <plat/cpu.h>
-#include <plat/irq-vic-timer.h>
-#include <plat/regs-timer.h>
-
-static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc)
-{
-       struct irq_chip *chip = irq_get_chip(irq);
-       chained_irq_enter(chip, desc);
-       generic_handle_irq((int)desc->irq_data.handler_data);
-       chained_irq_exit(chip, desc);
-}
-
-/* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */
-static void s3c_irq_timer_ack(struct irq_data *d)
-{
-       struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
-       u32 mask = (1 << 5) << (d->irq - gc->irq_base);
-
-       irq_reg_writel(mask | gc->mask_cache, gc->reg_base);
-}
-
-/**
- * s3c_init_vic_timer_irq() - initialise timer irq chanined off VIC.\
- * @num: Number of timers to initialize
- * @timer_irq: Base IRQ number to be used for the timers.
- *
- * Register the necessary IRQ chaining and support for the timer IRQs
- * chained of the VIC.
- */
-void __init s3c_init_vic_timer_irq(unsigned int num, unsigned int timer_irq)
-{
-       unsigned int pirq[5] = { IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC,
-                                IRQ_TIMER3_VIC, IRQ_TIMER4_VIC };
-       struct irq_chip_generic *s3c_tgc;
-       struct irq_chip_type *ct;
-       unsigned int i;
-
-#ifdef CONFIG_ARCH_EXYNOS
-       if (soc_is_exynos5250()) {
-               pirq[0] = EXYNOS5_IRQ_TIMER0_VIC;
-               pirq[1] = EXYNOS5_IRQ_TIMER1_VIC;
-               pirq[2] = EXYNOS5_IRQ_TIMER2_VIC;
-               pirq[3] = EXYNOS5_IRQ_TIMER3_VIC;
-               pirq[4] = EXYNOS5_IRQ_TIMER4_VIC;
-       } else {
-               pirq[0] = EXYNOS4_IRQ_TIMER0_VIC;
-               pirq[1] = EXYNOS4_IRQ_TIMER1_VIC;
-               pirq[2] = EXYNOS4_IRQ_TIMER2_VIC;
-               pirq[3] = EXYNOS4_IRQ_TIMER3_VIC;
-               pirq[4] = EXYNOS4_IRQ_TIMER4_VIC;
-       }
-#endif
-       s3c_tgc = irq_alloc_generic_chip("s3c-timer", 1, timer_irq,
-                                        S3C64XX_TINT_CSTAT, handle_level_irq);
-
-       if (!s3c_tgc) {
-               pr_err("%s: irq_alloc_generic_chip for IRQ %d failed\n",
-                      __func__, timer_irq);
-               return;
-       }
-
-       ct = s3c_tgc->chip_types;
-       ct->chip.irq_mask = irq_gc_mask_clr_bit;
-       ct->chip.irq_unmask = irq_gc_mask_set_bit;
-       ct->chip.irq_ack = s3c_irq_timer_ack;
-       irq_setup_generic_chip(s3c_tgc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
-                              IRQ_NOREQUEST | IRQ_NOPROBE, 0);
-       /* Clear the upper bits of the mask_cache*/
-       s3c_tgc->mask_cache &= 0x1f;
-
-       for (i = 0; i < num; i++, timer_irq++) {
-               irq_set_chained_handler(pirq[i], s3c_irq_demux_vic_timer);
-               irq_set_handler_data(pirq[i], (void *)timer_irq);
-       }
-}
diff --git a/arch/arm/plat-samsung/pwm-clock.c b/arch/arm/plat-samsung/pwm-clock.c
deleted file mode 100644 (file)
index a35ff3b..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-/* linux/arch/arm/plat-s3c24xx/pwm-clock.c
- *
- * Copyright (c) 2007 Simtec Electronics
- * Copyright (c) 2007, 2008 Ben Dooks
- *     Ben Dooks <ben-linux@fluff.org>
- *
- * 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.
-*/
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/log2.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-#include <mach/map.h>
-#include <asm/irq.h>
-
-#include <plat/clock.h>
-#include <plat/cpu.h>
-
-#include <plat/regs-timer.h>
-#include <plat/pwm-clock.h>
-
-/* Each of the timers 0 through 5 go through the following
- * clock tree, with the inputs depending on the timers.
- *
- * pclk ---- [ prescaler 0 ] -+---> timer 0
- *                           +---> timer 1
- *
- * pclk ---- [ prescaler 1 ] -+---> timer 2
- *                           +---> timer 3
- *                           \---> timer 4
- *
- * Which are fed into the timers as so:
- *
- * prescaled 0 ---- [ div 2,4,8,16 ] ---\
- *                                    [mux] -> timer 0
- * tclk 0 ------------------------------/
- *
- * prescaled 0 ---- [ div 2,4,8,16 ] ---\
- *                                    [mux] -> timer 1
- * tclk 0 ------------------------------/
- *
- *
- * prescaled 1 ---- [ div 2,4,8,16 ] ---\
- *                                    [mux] -> timer 2
- * tclk 1 ------------------------------/
- *
- * prescaled 1 ---- [ div 2,4,8,16 ] ---\
- *                                    [mux] -> timer 3
- * tclk 1 ------------------------------/
- *
- * prescaled 1 ---- [ div 2,4,8, 16 ] --\
- *                                    [mux] -> timer 4
- * tclk 1 ------------------------------/
- *
- * Since the mux and the divider are tied together in the
- * same register space, it is impossible to set the parent
- * and the rate at the same time. To avoid this, we add an
- * intermediate 'prescaled-and-divided' clock to select
- * as the parent for the timer input clock called tdiv.
- *
- * prescaled clk --> pwm-tdiv ---\
- *                             [ mux ] --> timer X
- * tclk -------------------------/
-*/
-
-static struct clk clk_timer_scaler[];
-
-static unsigned long clk_pwm_scaler_get_rate(struct clk *clk)
-{
-       unsigned long tcfg0 = __raw_readl(S3C2410_TCFG0);
-
-       if (clk == &clk_timer_scaler[1]) {
-               tcfg0 &= S3C2410_TCFG_PRESCALER1_MASK;
-               tcfg0 >>= S3C2410_TCFG_PRESCALER1_SHIFT;
-       } else {
-               tcfg0 &= S3C2410_TCFG_PRESCALER0_MASK;
-       }
-
-       return clk_get_rate(clk->parent) / (tcfg0 + 1);
-}
-
-static unsigned long clk_pwm_scaler_round_rate(struct clk *clk,
-                                              unsigned long rate)
-{
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long divisor = parent_rate / rate;
-
-       if (divisor > 256)
-               divisor = 256;
-       else if (divisor < 2)
-               divisor = 2;
-
-       return parent_rate / divisor;
-}
-
-static int clk_pwm_scaler_set_rate(struct clk *clk, unsigned long rate)
-{
-       unsigned long round = clk_pwm_scaler_round_rate(clk, rate);
-       unsigned long tcfg0;
-       unsigned long divisor;
-       unsigned long flags;
-
-       divisor = clk_get_rate(clk->parent) / round;
-       divisor--;
-
-       local_irq_save(flags);
-       tcfg0 = __raw_readl(S3C2410_TCFG0);
-
-       if (clk == &clk_timer_scaler[1]) {
-               tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK;
-               tcfg0 |= divisor << S3C2410_TCFG_PRESCALER1_SHIFT;
-       } else {
-               tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK;
-               tcfg0 |= divisor;
-       }
-
-       __raw_writel(tcfg0, S3C2410_TCFG0);
-       local_irq_restore(flags);
-
-       return 0;
-}
-
-static struct clk_ops clk_pwm_scaler_ops = {
-       .get_rate       = clk_pwm_scaler_get_rate,
-       .set_rate       = clk_pwm_scaler_set_rate,
-       .round_rate     = clk_pwm_scaler_round_rate,
-};
-
-static struct clk clk_timer_scaler[] = {
-       [0]     = {
-               .name           = "pwm-scaler0",
-               .id             = -1,
-               .ops            = &clk_pwm_scaler_ops,
-       },
-       [1]     = {
-               .name           = "pwm-scaler1",
-               .id             = -1,
-               .ops            = &clk_pwm_scaler_ops,
-       },
-};
-
-static struct clk clk_timer_tclk[] = {
-       [0]     = {
-               .name           = "pwm-tclk0",
-               .id             = -1,
-       },
-       [1]     = {
-               .name           = "pwm-tclk1",
-               .id             = -1,
-       },
-};
-
-struct pwm_tdiv_clk {
-       struct clk      clk;
-       unsigned int    divisor;
-};
-
-static inline struct pwm_tdiv_clk *to_tdiv(struct clk *clk)
-{
-       return container_of(clk, struct pwm_tdiv_clk, clk);
-}
-
-static unsigned long clk_pwm_tdiv_get_rate(struct clk *clk)
-{
-       unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1);
-       unsigned int divisor;
-
-       tcfg1 >>= S3C2410_TCFG1_SHIFT(clk->id);
-       tcfg1 &= S3C2410_TCFG1_MUX_MASK;
-
-       if (pwm_cfg_src_is_tclk(tcfg1))
-               divisor = to_tdiv(clk)->divisor;
-       else
-               divisor = tcfg_to_divisor(tcfg1);
-
-       return clk_get_rate(clk->parent) / divisor;
-}
-
-static unsigned long clk_pwm_tdiv_round_rate(struct clk *clk,
-                                            unsigned long rate)
-{
-       unsigned long parent_rate;
-       unsigned long divisor;
-
-       parent_rate = clk_get_rate(clk->parent);
-       divisor = parent_rate / rate;
-
-       if (divisor <= 1 && pwm_tdiv_has_div1())
-               divisor = 1;
-       else if (divisor <= 2)
-               divisor = 2;
-       else if (divisor <= 4)
-               divisor = 4;
-       else if (divisor <= 8)
-               divisor = 8;
-       else
-               divisor = 16;
-
-       return parent_rate / divisor;
-}
-
-static unsigned long clk_pwm_tdiv_bits(struct pwm_tdiv_clk *divclk)
-{
-       return pwm_tdiv_div_bits(divclk->divisor);
-}
-
-static void clk_pwm_tdiv_update(struct pwm_tdiv_clk *divclk)
-{
-       unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1);
-       unsigned long bits = clk_pwm_tdiv_bits(divclk);
-       unsigned long flags;
-       unsigned long shift =  S3C2410_TCFG1_SHIFT(divclk->clk.id);
-
-       local_irq_save(flags);
-
-       tcfg1 = __raw_readl(S3C2410_TCFG1);
-       tcfg1 &= ~(S3C2410_TCFG1_MUX_MASK << shift);
-       tcfg1 |= bits << shift;
-       __raw_writel(tcfg1, S3C2410_TCFG1);
-
-       local_irq_restore(flags);
-}
-
-static int clk_pwm_tdiv_set_rate(struct clk *clk, unsigned long rate)
-{
-       struct pwm_tdiv_clk *divclk = to_tdiv(clk);
-       unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1);
-       unsigned long parent_rate = clk_get_rate(clk->parent);
-       unsigned long divisor;
-
-       tcfg1 >>= S3C2410_TCFG1_SHIFT(clk->id);
-       tcfg1 &= S3C2410_TCFG1_MUX_MASK;
-
-       rate = clk_round_rate(clk, rate);
-       divisor = parent_rate / rate;
-
-       if (divisor > 16)
-               return -EINVAL;
-
-       divclk->divisor = divisor;
-
-       /* Update the current MUX settings if we are currently
-        * selected as the clock source for this clock. */
-
-       if (!pwm_cfg_src_is_tclk(tcfg1))
-               clk_pwm_tdiv_update(divclk);
-
-       return 0;
-}
-
-static struct clk_ops clk_tdiv_ops = {
-       .get_rate       = clk_pwm_tdiv_get_rate,
-       .set_rate       = clk_pwm_tdiv_set_rate,
-       .round_rate     = clk_pwm_tdiv_round_rate,
-};
-
-static struct pwm_tdiv_clk clk_timer_tdiv[] = {
-       [0]     = {
-               .clk    = {
-                       .name   = "pwm-tdiv",
-                       .devname        = "s3c24xx-pwm.0",
-                       .ops    = &clk_tdiv_ops,
-                       .parent = &clk_timer_scaler[0],
-               },
-       },
-       [1]     = {
-               .clk    = {
-                       .name   = "pwm-tdiv",
-                       .devname        = "s3c24xx-pwm.1",
-                       .ops    = &clk_tdiv_ops,
-                       .parent = &clk_timer_scaler[0],
-               }
-       },
-       [2]     = {
-               .clk    = {
-                       .name   = "pwm-tdiv",
-                       .devname        = "s3c24xx-pwm.2",
-                       .ops    = &clk_tdiv_ops,
-                       .parent = &clk_timer_scaler[1],
-               },
-       },
-       [3]     = {
-               .clk    = {
-                       .name   = "pwm-tdiv",
-                       .devname        = "s3c24xx-pwm.3",
-                       .ops    = &clk_tdiv_ops,
-                       .parent = &clk_timer_scaler[1],
-               },
-       },
-       [4]     = {
-               .clk    = {
-                       .name   = "pwm-tdiv",
-                       .devname        = "s3c24xx-pwm.4",
-                       .ops    = &clk_tdiv_ops,
-                       .parent = &clk_timer_scaler[1],
-               },
-       },
-};
-
-static int __init clk_pwm_tdiv_register(unsigned int id)
-{
-       struct pwm_tdiv_clk *divclk = &clk_timer_tdiv[id];
-       unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1);
-
-       tcfg1 >>= S3C2410_TCFG1_SHIFT(id);
-       tcfg1 &= S3C2410_TCFG1_MUX_MASK;
-
-       divclk->clk.id = id;
-       divclk->divisor = tcfg_to_divisor(tcfg1);
-
-       return s3c24xx_register_clock(&divclk->clk);
-}
-
-static inline struct clk *s3c24xx_pwmclk_tclk(unsigned int id)
-{
-       return (id >= 2) ? &clk_timer_tclk[1] : &clk_timer_tclk[0];
-}
-
-static inline struct clk *s3c24xx_pwmclk_tdiv(unsigned int id)
-{
-       return &clk_timer_tdiv[id].clk;
-}
-
-static int clk_pwm_tin_set_parent(struct clk *clk, struct clk *parent)
-{
-       unsigned int id = clk->id;
-       unsigned long tcfg1;
-       unsigned long flags;
-       unsigned long bits;
-       unsigned long shift = S3C2410_TCFG1_SHIFT(id);
-
-       unsigned long mux_tclk;
-
-       if (soc_is_s3c24xx())
-               mux_tclk = S3C2410_TCFG1_MUX_TCLK;
-       else if (soc_is_s5p6440() || soc_is_s5p6450())
-               mux_tclk = 0;
-       else
-               mux_tclk = S3C64XX_TCFG1_MUX_TCLK;
-
-       if (parent == s3c24xx_pwmclk_tclk(id))
-               bits = mux_tclk << shift;
-       else if (parent == s3c24xx_pwmclk_tdiv(id))
-               bits = clk_pwm_tdiv_bits(to_tdiv(parent)) << shift;
-       else
-               return -EINVAL;
-
-       clk->parent = parent;
-
-       local_irq_save(flags);
-
-       tcfg1 = __raw_readl(S3C2410_TCFG1);
-       tcfg1 &= ~(S3C2410_TCFG1_MUX_MASK << shift);
-       __raw_writel(tcfg1 | bits, S3C2410_TCFG1);
-
-       local_irq_restore(flags);
-
-       return 0;
-}
-
-static struct clk_ops clk_tin_ops = {
-       .set_parent     = clk_pwm_tin_set_parent,
-};
-
-static struct clk clk_tin[] = {
-       [0]     = {
-               .name   = "pwm-tin",
-               .devname        = "s3c24xx-pwm.0",
-               .id     = 0,
-               .ops    = &clk_tin_ops,
-       },
-       [1]     = {
-               .name   = "pwm-tin",
-               .devname        = "s3c24xx-pwm.1",
-               .id     = 1,
-               .ops    = &clk_tin_ops,
-       },
-       [2]     = {
-               .name   = "pwm-tin",
-               .devname        = "s3c24xx-pwm.2",
-               .id     = 2,
-               .ops    = &clk_tin_ops,
-       },
-       [3]     = {
-               .name   = "pwm-tin",
-               .devname        = "s3c24xx-pwm.3",
-               .id     = 3,
-               .ops    = &clk_tin_ops,
-       },
-       [4]     = {
-               .name   = "pwm-tin",
-               .devname        = "s3c24xx-pwm.4",
-               .id     = 4,
-               .ops    = &clk_tin_ops,
-       },
-};
-
-static __init int clk_pwm_tin_register(struct clk *pwm)
-{
-       unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1);
-       unsigned int id = pwm->id;
-
-       struct clk *parent;
-       int ret;
-
-       ret = s3c24xx_register_clock(pwm);
-       if (ret < 0)
-               return ret;
-
-       tcfg1 >>= S3C2410_TCFG1_SHIFT(id);
-       tcfg1 &= S3C2410_TCFG1_MUX_MASK;
-
-       if (pwm_cfg_src_is_tclk(tcfg1))
-               parent = s3c24xx_pwmclk_tclk(id);
-       else
-               parent = s3c24xx_pwmclk_tdiv(id);
-
-       return clk_set_parent(pwm, parent);
-}
-
-/**
- * s3c_pwmclk_init() - initialise pwm clocks
- *
- * Initialise and register the clocks which provide the inputs for the
- * pwm timer blocks.
- *
- * Note, this call is required by the time core, so must be called after
- * the base clocks are added and before any of the initcalls are run.
- */
-__init void s3c_pwmclk_init(void)
-{
-       struct clk *clk_timers;
-       unsigned int clk;
-       int ret;
-
-       clk_timers = clk_get(NULL, "timers");
-       if (IS_ERR(clk_timers)) {
-               printk(KERN_ERR "%s: no parent clock\n", __func__);
-               return;
-       }
-
-       for (clk = 0; clk < ARRAY_SIZE(clk_timer_scaler); clk++)
-               clk_timer_scaler[clk].parent = clk_timers;
-
-       s3c_register_clocks(clk_timer_scaler, ARRAY_SIZE(clk_timer_scaler));
-       s3c_register_clocks(clk_timer_tclk, ARRAY_SIZE(clk_timer_tclk));
-
-       for (clk = 0; clk < ARRAY_SIZE(clk_timer_tdiv); clk++) {
-               ret = clk_pwm_tdiv_register(clk);
-
-               if (ret < 0) {
-                       printk(KERN_ERR "error adding pwm%d tdiv clock\n", clk);
-                       return;
-               }
-       }
-
-       for (clk = 0; clk < ARRAY_SIZE(clk_tin); clk++) {
-               ret = clk_pwm_tin_register(&clk_tin[clk]);
-               if (ret < 0) {
-                       printk(KERN_ERR "error adding pwm%d tin clock\n", clk);
-                       return;
-               }
-       }
-}
index ff1a760..ddfaca9 100644 (file)
@@ -17,9 +17,7 @@
 
 #include <mach/irqs.h>
 #include <mach/map.h>
-#include <plat/regs-timer.h>
 #include <plat/cpu.h>
-#include <plat/irq-vic-timer.h>
 
 void __init s5p_init_irq(u32 *vic, u32 num_vic)
 {
@@ -30,6 +28,4 @@ void __init s5p_init_irq(u32 *vic, u32 num_vic)
        for (irq = 0; irq < num_vic; irq++)
                vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0);
 #endif
-
-       s3c_init_vic_timer_irq(5, IRQ_TIMER0);
 }
diff --git a/arch/arm/plat-samsung/samsung-time.c b/arch/arm/plat-samsung/samsung-time.c
deleted file mode 100644 (file)
index 2957075..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com/
- *
- * samsung - Common hr-timer support (s3c and s5p)
- *
- * 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/interrupt.h>
-#include <linux/irq.h>
-#include <linux/err.h>
-#include <linux/clk.h>
-#include <linux/clockchips.h>
-#include <linux/platform_device.h>
-#include <linux/sched_clock.h>
-
-#include <asm/smp_twd.h>
-#include <asm/mach/time.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <mach/map.h>
-#include <plat/devs.h>
-#include <plat/regs-timer.h>
-#include <plat/samsung-time.h>
-
-static struct clk *tin_event;
-static struct clk *tin_source;
-static struct clk *tdiv_event;
-static struct clk *tdiv_source;
-static struct clk *timerclk;
-static struct samsung_timer_source timer_source;
-static unsigned long clock_count_per_tick;
-static void samsung_timer_resume(void);
-
-static void samsung_time_stop(enum samsung_timer_mode mode)
-{
-       unsigned long tcon;
-
-       tcon = __raw_readl(S3C2410_TCON);
-
-       switch (mode) {
-       case SAMSUNG_PWM0:
-               tcon &= ~S3C2410_TCON_T0START;
-               break;
-
-       case SAMSUNG_PWM1:
-               tcon &= ~S3C2410_TCON_T1START;
-               break;
-
-       case SAMSUNG_PWM2:
-               tcon &= ~S3C2410_TCON_T2START;
-               break;
-
-       case SAMSUNG_PWM3:
-               tcon &= ~S3C2410_TCON_T3START;
-               break;
-
-       case SAMSUNG_PWM4:
-               tcon &= ~S3C2410_TCON_T4START;
-               break;
-
-       default:
-               printk(KERN_ERR "Invalid Timer %d\n", mode);
-               break;
-       }
-       __raw_writel(tcon, S3C2410_TCON);
-}
-
-static void samsung_time_setup(enum samsung_timer_mode mode, unsigned long tcnt)
-{
-       unsigned long tcon;
-
-       tcon = __raw_readl(S3C2410_TCON);
-
-       tcnt--;
-
-       switch (mode) {
-       case SAMSUNG_PWM0:
-               tcon &= ~(0x0f << 0);
-               tcon |= S3C2410_TCON_T0MANUALUPD;
-               break;
-
-       case SAMSUNG_PWM1:
-               tcon &= ~(0x0f << 8);
-               tcon |= S3C2410_TCON_T1MANUALUPD;
-               break;
-
-       case SAMSUNG_PWM2:
-               tcon &= ~(0x0f << 12);
-               tcon |= S3C2410_TCON_T2MANUALUPD;
-               break;
-
-       case SAMSUNG_PWM3:
-               tcon &= ~(0x0f << 16);
-               tcon |= S3C2410_TCON_T3MANUALUPD;
-               break;
-
-       case SAMSUNG_PWM4:
-               tcon &= ~(0x07 << 20);
-               tcon |= S3C2410_TCON_T4MANUALUPD;
-               break;
-
-       default:
-               printk(KERN_ERR "Invalid Timer %d\n", mode);
-               break;
-       }
-
-       __raw_writel(tcnt, S3C2410_TCNTB(mode));
-       __raw_writel(tcnt, S3C2410_TCMPB(mode));
-       __raw_writel(tcon, S3C2410_TCON);
-}
-
-static void samsung_time_start(enum samsung_timer_mode mode, bool periodic)
-{
-       unsigned long tcon;
-
-       tcon  = __raw_readl(S3C2410_TCON);
-
-       switch (mode) {
-       case SAMSUNG_PWM0:
-               tcon |= S3C2410_TCON_T0START;
-               tcon &= ~S3C2410_TCON_T0MANUALUPD;
-
-               if (periodic)
-                       tcon |= S3C2410_TCON_T0RELOAD;
-               else
-                       tcon &= ~S3C2410_TCON_T0RELOAD;
-               break;
-
-       case SAMSUNG_PWM1:
-               tcon |= S3C2410_TCON_T1START;
-               tcon &= ~S3C2410_TCON_T1MANUALUPD;
-
-               if (periodic)
-                       tcon |= S3C2410_TCON_T1RELOAD;
-               else
-                       tcon &= ~S3C2410_TCON_T1RELOAD;
-               break;
-
-       case SAMSUNG_PWM2:
-               tcon |= S3C2410_TCON_T2START;
-               tcon &= ~S3C2410_TCON_T2MANUALUPD;
-
-               if (periodic)
-                       tcon |= S3C2410_TCON_T2RELOAD;
-               else
-                       tcon &= ~S3C2410_TCON_T2RELOAD;
-               break;
-
-       case SAMSUNG_PWM3:
-               tcon |= S3C2410_TCON_T3START;
-               tcon &= ~S3C2410_TCON_T3MANUALUPD;
-
-               if (periodic)
-                       tcon |= S3C2410_TCON_T3RELOAD;
-               else
-                       tcon &= ~S3C2410_TCON_T3RELOAD;
-               break;
-
-       case SAMSUNG_PWM4:
-               tcon |= S3C2410_TCON_T4START;
-               tcon &= ~S3C2410_TCON_T4MANUALUPD;
-
-               if (periodic)
-                       tcon |= S3C2410_TCON_T4RELOAD;
-               else
-                       tcon &= ~S3C2410_TCON_T4RELOAD;
-               break;
-
-       default:
-               printk(KERN_ERR "Invalid Timer %d\n", mode);
-               break;
-       }
-       __raw_writel(tcon, S3C2410_TCON);
-}
-
-static int samsung_set_next_event(unsigned long cycles,
-                               struct clock_event_device *evt)
-{
-       samsung_time_setup(timer_source.event_id, cycles);
-       samsung_time_start(timer_source.event_id, NON_PERIODIC);
-
-       return 0;
-}
-
-static void samsung_set_mode(enum clock_event_mode mode,
-                               struct clock_event_device *evt)
-{
-       samsung_time_stop(timer_source.event_id);
-
-       switch (mode) {
-       case CLOCK_EVT_MODE_PERIODIC:
-               samsung_time_setup(timer_source.event_id, clock_count_per_tick);
-               samsung_time_start(timer_source.event_id, PERIODIC);
-               break;
-
-       case CLOCK_EVT_MODE_ONESHOT:
-               break;
-
-       case CLOCK_EVT_MODE_UNUSED:
-       case CLOCK_EVT_MODE_SHUTDOWN:
-               break;
-
-       case CLOCK_EVT_MODE_RESUME:
-               samsung_timer_resume();
-               break;
-       }
-}
-
-static void samsung_timer_resume(void)
-{
-       /* event timer restart */
-       samsung_time_setup(timer_source.event_id, clock_count_per_tick);
-       samsung_time_start(timer_source.event_id, PERIODIC);
-
-       /* source timer restart */
-       samsung_time_setup(timer_source.source_id, TCNT_MAX);
-       samsung_time_start(timer_source.source_id, PERIODIC);
-}
-
-void __init samsung_set_timer_source(enum samsung_timer_mode event,
-                                enum samsung_timer_mode source)
-{
-       s3c_device_timer[event].dev.bus = &platform_bus_type;
-       s3c_device_timer[source].dev.bus = &platform_bus_type;
-
-       timer_source.event_id = event;
-       timer_source.source_id = source;
-}
-
-static struct clock_event_device time_event_device = {
-       .name           = "samsung_event_timer",
-       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .rating         = 200,
-       .set_next_event = samsung_set_next_event,
-       .set_mode       = samsung_set_mode,
-};
-
-static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id)
-{
-       struct clock_event_device *evt = dev_id;
-
-       evt->event_handler(evt);
-
-       return IRQ_HANDLED;
-}
-
-static struct irqaction samsung_clock_event_irq = {
-       .name           = "samsung_time_irq",
-       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = samsung_clock_event_isr,
-       .dev_id         = &time_event_device,
-};
-
-static void __init samsung_clockevent_init(void)
-{
-       unsigned long pclk;
-       unsigned long clock_rate;
-       unsigned int irq_number;
-       struct clk *tscaler;
-
-       pclk = clk_get_rate(timerclk);
-
-       tscaler = clk_get_parent(tdiv_event);
-
-       clk_set_rate(tscaler, pclk / TSCALER_DIV);
-       clk_set_rate(tdiv_event, pclk / TDIV);
-       clk_set_parent(tin_event, tdiv_event);
-
-       clock_rate = clk_get_rate(tin_event);
-       clock_count_per_tick = clock_rate / HZ;
-
-       time_event_device.cpumask = cpumask_of(0);
-       clockevents_config_and_register(&time_event_device, clock_rate, 1, -1);
-
-       irq_number = timer_source.event_id + IRQ_TIMER0;
-       setup_irq(irq_number, &samsung_clock_event_irq);
-}
-
-static void __iomem *samsung_timer_reg(void)
-{
-       unsigned long offset = 0;
-
-       switch (timer_source.source_id) {
-       case SAMSUNG_PWM0:
-       case SAMSUNG_PWM1:
-       case SAMSUNG_PWM2:
-       case SAMSUNG_PWM3:
-               offset = (timer_source.source_id * 0x0c) + 0x14;
-               break;
-
-       case SAMSUNG_PWM4:
-               offset = 0x40;
-               break;
-
-       default:
-               printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
-               return NULL;
-       }
-
-       return S3C_TIMERREG(offset);
-}
-
-/*
- * Override the global weak sched_clock symbol with this
- * local implementation which uses the clocksource to get some
- * better resolution when scheduling the kernel. We accept that
- * this wraps around for now, since it is just a relative time
- * stamp. (Inspired by U300 implementation.)
- */
-static u32 notrace samsung_read_sched_clock(void)
-{
-       void __iomem *reg = samsung_timer_reg();
-
-       if (!reg)
-               return 0;
-
-       return ~__raw_readl(reg);
-}
-
-static void __init samsung_clocksource_init(void)
-{
-       unsigned long pclk;
-       unsigned long clock_rate;
-
-       pclk = clk_get_rate(timerclk);
-
-       clk_set_rate(tdiv_source, pclk / TDIV);
-       clk_set_parent(tin_source, tdiv_source);
-
-       clock_rate = clk_get_rate(tin_source);
-
-       samsung_time_setup(timer_source.source_id, TCNT_MAX);
-       samsung_time_start(timer_source.source_id, PERIODIC);
-
-       setup_sched_clock(samsung_read_sched_clock, TSIZE, clock_rate);
-
-       if (clocksource_mmio_init(samsung_timer_reg(), "samsung_clocksource_timer",
-                       clock_rate, 250, TSIZE, clocksource_mmio_readl_down))
-               panic("samsung_clocksource_timer: can't register clocksource\n");
-}
-
-static void __init samsung_timer_resources(void)
-{
-
-       unsigned long event_id = timer_source.event_id;
-       unsigned long source_id = timer_source.source_id;
-       char devname[15];
-
-       timerclk = clk_get(NULL, "timers");
-       if (IS_ERR(timerclk))
-               panic("failed to get timers clock for timer");
-
-       clk_enable(timerclk);
-
-       sprintf(devname, "s3c24xx-pwm.%lu", event_id);
-       s3c_device_timer[event_id].id = event_id;
-       s3c_device_timer[event_id].dev.init_name = devname;
-
-       tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin");
-       if (IS_ERR(tin_event))
-               panic("failed to get pwm-tin clock for event timer");
-
-       tdiv_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tdiv");
-       if (IS_ERR(tdiv_event))
-               panic("failed to get pwm-tdiv clock for event timer");
-
-       clk_enable(tin_event);
-
-       sprintf(devname, "s3c24xx-pwm.%lu", source_id);
-       s3c_device_timer[source_id].id = source_id;
-       s3c_device_timer[source_id].dev.init_name = devname;
-
-       tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin");
-       if (IS_ERR(tin_source))
-               panic("failed to get pwm-tin clock for source timer");
-
-       tdiv_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tdiv");
-       if (IS_ERR(tdiv_source))
-               panic("failed to get pwm-tdiv clock for source timer");
-
-       clk_enable(tin_source);
-}
-
-void __init samsung_timer_init(void)
-{
-       samsung_timer_resources();
-       samsung_clockevent_init();
-       samsung_clocksource_init();
-}
index 9737e97..ae323a4 100644 (file)
@@ -96,6 +96,9 @@ config SWIOTLB
 config IOMMU_HELPER
        def_bool SWIOTLB
 
+config KERNEL_MODE_NEON
+       def_bool y
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
index fe32c0e..e7fa87f 100644 (file)
@@ -33,8 +33,6 @@ typedef unsigned long elf_greg_t;
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 typedef struct user_fpsimd_state elf_fpregset_t;
 
-#define EM_AARCH64             183
-
 /*
  * AArch64 static relocation types.
  */
@@ -151,7 +149,6 @@ extern unsigned long arch_randomize_brk(struct mm_struct *mm);
 #define arch_randomize_brk arch_randomize_brk
 
 #ifdef CONFIG_COMPAT
-#define EM_ARM                         40
 #define COMPAT_ELF_PLATFORM            ("v8l")
 
 #define COMPAT_ELF_ET_DYN_BASE         (randomize_et_dyn(2 * TASK_SIZE_32 / 3))
diff --git a/arch/arm64/include/asm/neon.h b/arch/arm64/include/asm/neon.h
new file mode 100644 (file)
index 0000000..b0cc58a
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * linux/arch/arm64/include/asm/neon.h
+ *
+ * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@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.
+ */
+
+#define cpu_has_neon()         (1)
+
+void kernel_neon_begin(void);
+void kernel_neon_end(void);
index 3c3ca7d..5f101e6 100644 (file)
@@ -16,6 +16,8 @@
 #ifndef __ASM_PGTABLE_2LEVEL_TYPES_H
 #define __ASM_PGTABLE_2LEVEL_TYPES_H
 
+#include <asm/types.h>
+
 typedef u64 pteval_t;
 typedef u64 pgdval_t;
 typedef pgdval_t pmdval_t;
index 4489615..4e94424 100644 (file)
@@ -16,6 +16,8 @@
 #ifndef __ASM_PGTABLE_3LEVEL_TYPES_H
 #define __ASM_PGTABLE_3LEVEL_TYPES_H
 
+#include <asm/types.h>
+
 typedef u64 pteval_t;
 typedef u64 pmdval_t;
 typedef u64 pgdval_t;
index e182a35..d57e668 100644 (file)
 #define TCR_TG1_64K            (UL(1) << 30)
 #define TCR_IPS_40BIT          (UL(2) << 32)
 #define TCR_ASID16             (UL(1) << 36)
+#define TCR_TBI0               (UL(1) << 37)
 
 #endif
index 6ad781b..3881fd1 100644 (file)
@@ -423,6 +423,7 @@ el0_da:
         * Data abort handling
         */
        mrs     x0, far_el1
+       bic     x0, x0, #(0xff << 56)
        disable_step x1
        isb
        enable_dbg
@@ -476,6 +477,8 @@ el0_undef:
         * Undefined instruction
         */
        mov     x0, sp
+       // enable interrupts before calling the main handler
+       enable_irq
        b       do_undefinstr
 el0_dbg:
        /*
index e8b8357..1f2e4d5 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
+#include <linux/hardirq.h>
 
 #include <asm/fpsimd.h>
 #include <asm/cputype.h>
@@ -83,6 +84,33 @@ void fpsimd_flush_thread(void)
        fpsimd_load_state(&current->thread.fpsimd_state);
 }
 
+#ifdef CONFIG_KERNEL_MODE_NEON
+
+/*
+ * Kernel-side NEON support functions
+ */
+void kernel_neon_begin(void)
+{
+       /* Avoid using the NEON in interrupt context */
+       BUG_ON(in_interrupt());
+       preempt_disable();
+
+       if (current->mm)
+               fpsimd_save_state(&current->thread.fpsimd_state);
+}
+EXPORT_SYMBOL(kernel_neon_begin);
+
+void kernel_neon_end(void)
+{
+       if (current->mm)
+               fpsimd_load_state(&current->thread.fpsimd_state);
+
+       preempt_enable();
+}
+EXPORT_SYMBOL(kernel_neon_end);
+
+#endif /* CONFIG_KERNEL_MODE_NEON */
+
 /*
  * FP/SIMD support code initialisation.
  */
index 53dcae4..7090c12 100644 (file)
        .quad   TEXT_OFFSET                     // Image load offset from start of RAM
        .quad   0                               // reserved
        .quad   0                               // reserved
+       .quad   0                               // reserved
+       .quad   0                               // reserved
+       .quad   0                               // reserved
+       .byte   0x41                            // Magic number, "ARM\x64"
+       .byte   0x52
+       .byte   0x4d
+       .byte   0x64
+       .word   0                               // reserved
 
 ENTRY(stext)
        mov     x21, x0                         // x21=FDT
index 12e6ccb..cea1594 100644 (file)
@@ -325,7 +325,10 @@ validate_event(struct pmu_hw_events *hw_events,
        if (is_software_event(event))
                return 1;
 
-       if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF)
+       if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
+               return 1;
+
+       if (event->state == PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)
                return 1;
 
        return armpmu->get_event_idx(hw_events, &fake_event) >= 0;
@@ -781,7 +784,7 @@ static const unsigned armv8_pmuv3_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
 /*
  * PMXEVTYPER: Event selection reg
  */
-#define        ARMV8_EVTYPE_MASK       0xc00000ff      /* Mask for writable bits */
+#define        ARMV8_EVTYPE_MASK       0xc80000ff      /* Mask for writable bits */
 #define        ARMV8_EVTYPE_EVENT      0xff            /* Mask for EVENT bits */
 
 /*
index add6ea6..bca4c1c 100644 (file)
@@ -328,9 +328,6 @@ static int c_show(struct seq_file *m, void *v)
 #ifdef CONFIG_SMP
                seq_printf(m, "processor\t: %d\n", i);
 #endif
-               seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n",
-                          loops_per_jiffy / (500000UL/HZ),
-                          loops_per_jiffy / (5000UL/HZ) % 100);
        }
 
        /* dump out the processor features */
index fee5cce..78db90d 100644 (file)
@@ -223,11 +223,7 @@ asmlinkage void secondary_start_kernel(void)
 
 void __init smp_cpus_done(unsigned int max_cpus)
 {
-       unsigned long bogosum = loops_per_jiffy * num_online_cpus();
-
-       pr_info("SMP: Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
-               num_online_cpus(), bogosum / (500000/HZ),
-               (bogosum / (5000/HZ)) % 100);
+       pr_info("SMP: Total of %d processors activated.\n", num_online_cpus());
 }
 
 void __init smp_prepare_boot_cpu(void)
index f5e5574..f8ab9d8 100644 (file)
@@ -71,6 +71,7 @@ SECTIONS
 
        RO_DATA(PAGE_SIZE)
        EXCEPTION_TABLE(8)
+       NOTES
        _etext = .;                     /* End of text and rodata section */
 
        . = ALIGN(PAGE_SIZE);
@@ -122,8 +123,6 @@ SECTIONS
        }
        _edata_loc = __data_loc + SIZEOF(.data);
 
-       NOTES
-
        BSS_SECTION(0, 0, 0)
        _end = .;
 
index a8d1059..f557ebb 100644 (file)
@@ -296,6 +296,7 @@ void __iomem * __init early_io_map(phys_addr_t phys, unsigned long virt)
 static void __init map_mem(void)
 {
        struct memblock_region *reg;
+       phys_addr_t limit;
 
        /*
         * Temporarily limit the memblock range. We need to do this as
@@ -303,9 +304,11 @@ static void __init map_mem(void)
         * memory addressable from the initial direct kernel mapping.
         *
         * The initial direct kernel mapping, located at swapper_pg_dir,
-        * gives us PGDIR_SIZE memory starting from PHYS_OFFSET (aligned).
+        * gives us PGDIR_SIZE memory starting from PHYS_OFFSET (which must be
+        * aligned to 2MB as per Documentation/arm64/booting.txt).
         */
-       memblock_set_current_limit((PHYS_OFFSET & PGDIR_MASK) + PGDIR_SIZE);
+       limit = PHYS_OFFSET + PGDIR_SIZE;
+       memblock_set_current_limit(limit);
 
        /* map all the memory banks */
        for_each_memblock(memory, reg) {
@@ -315,6 +318,22 @@ static void __init map_mem(void)
                if (start >= end)
                        break;
 
+#ifndef CONFIG_ARM64_64K_PAGES
+               /*
+                * For the first memory bank align the start address and
+                * current memblock limit to prevent create_mapping() from
+                * allocating pte page tables from unmapped memory.
+                * When 64K pages are enabled, the pte page table for the
+                * first PGDIR_SIZE is already present in swapper_pg_dir.
+                */
+               if (start < limit)
+                       start = ALIGN(start, PMD_SIZE);
+               if (end < limit) {
+                       limit = end & PMD_MASK;
+                       memblock_set_current_limit(limit);
+               }
+#endif
+
                create_mapping(start, __phys_to_virt(start), end - start);
        }
 
index a82ae88..b1b31bb 100644 (file)
@@ -95,10 +95,6 @@ ENTRY(cpu_do_switch_mm)
        ret
 ENDPROC(cpu_do_switch_mm)
 
-cpu_name:
-       .ascii  "AArch64 Processor"
-       .align
-
        .section ".text.init", #alloc, #execinstr
 
 /*
@@ -151,7 +147,7 @@ ENTRY(__cpu_setup)
         * both user and kernel.
         */
        ldr     x10, =TCR_TxSZ(VA_BITS) | TCR_FLAGS | TCR_IPS_40BIT | \
-                     TCR_ASID16 | (1 << 31)
+                     TCR_ASID16 | TCR_TBI0 | (1 << 31)
 #ifdef CONFIG_ARM64_64K_PAGES
        orr     x10, x10, TCR_TG0_64K
        orr     x10, x10, TCR_TG1_64K
index 5666422..a86a56d 100644 (file)
@@ -9,7 +9,6 @@ config IA64
        select PCI if (!IA64_HP_SIM)
        select ACPI if (!IA64_HP_SIM)
        select PM if (!IA64_HP_SIM)
-       select ARCH_SUPPORTS_MSI
        select HAVE_UNSTABLE_SCHED_CLOCK
        select HAVE_IDE
        select HAVE_OPROFILE
index 8e20bff..c27eccd 100644 (file)
@@ -425,13 +425,7 @@ __fls (unsigned long x)
 
 #include <asm-generic/bitops/fls64.h>
 
-/*
- * ffs: find first bit set. This is defined the same way as the libc and
- * compiler builtin ffs routines, therefore differs in spirit from the above
- * ffz (man ffs): it operates on "int" values only and the result value is the
- * bit number + 1.  ffs(0) is defined to return zero.
- */
-#define ffs(x) __builtin_ffs(x)
+#include <asm-generic/bitops/builtin-ffs.h>
 
 /*
  * hweightN: returns the hamming weight (i.e. the number
index 1ed4c8f..185d3d1 100644 (file)
@@ -7,6 +7,6 @@
 /* Use normal IO mappings for DMI */
 #define dmi_ioremap ioremap
 #define dmi_iounmap(x,l) iounmap(x)
-#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
+#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC)
 
 #endif
index 4fab522..3f6659c 100644 (file)
@@ -29,6 +29,7 @@ config MICROBLAZE
        select GENERIC_IDLE_POLL_SETUP
        select MODULES_USE_ELF_RELA
        select CLONE_BACKWARDS3
+       select CLKSRC_OF
 
 config SWAP
        def_bool n
index 0a603d3..40350a3 100644 (file)
@@ -72,7 +72,7 @@ all: linux.bin
 archclean:
        $(Q)$(MAKE) $(clean)=$(boot)
 
-linux.bin linux.bin.gz: vmlinux
+linux.bin linux.bin.gz linux.bin.ub: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 simpleImage.%: vmlinux
@@ -81,6 +81,7 @@ simpleImage.%: vmlinux
 define archhelp
   echo '* linux.bin    - Create raw binary'
   echo '  linux.bin.gz - Create compressed raw binary'
+  echo '  linux.bin.ub - Create U-Boot wrapped raw binary'
   echo '  simpleImage.<dt> - ELF image with $(arch)/boot/dts/<dt>.dts linked in'
   echo '                   - stripped elf with fdt blob'
   echo '  simpleImage.<dt>.unstrip - full ELF image with fdt blob'
index 80fe54f..8e211cc 100644 (file)
@@ -2,12 +2,15 @@
 # arch/microblaze/boot/Makefile
 #
 
-targets := linux.bin linux.bin.gz simpleImage.%
+targets := linux.bin linux.bin.gz linux.bin.ub simpleImage.%
 
 OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary
 
 $(obj)/linux.bin: vmlinux FORCE
        $(call if_changed,objcopy)
+       @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
+
+$(obj)/linux.bin.ub: $(obj)/linux.bin FORCE
        $(call if_changed,uimage)
        @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
 
@@ -22,8 +25,6 @@ quiet_cmd_strip = STRIP   $@
        cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \
                                -K _fdt_start vmlinux -o $@
 
-UIMAGE_IN = $@
-UIMAGE_OUT = $@.ub
 UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR)
 
 $(obj)/simpleImage.%: vmlinux FORCE
diff --git a/arch/microblaze/include/asm/selfmod.h b/arch/microblaze/include/asm/selfmod.h
deleted file mode 100644 (file)
index c42aff2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2007-2008 Michal Simek <monstr@monstr.eu>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#ifndef _ASM_MICROBLAZE_SELFMOD_H
-#define _ASM_MICROBLAZE_SELFMOD_H
-
-/*
- * BARRIER_BASE_ADDR is constant address for selfmod function.
- * do not change this value - selfmod function is in
- * arch/microblaze/kernel/selfmod.c: selfmod_function()
- *
- * last 16 bits is used for storing register offset
- */
-
-#define BARRIER_BASE_ADDR      0x1234ff00
-
-void selfmod_function(const int *arr_fce, const unsigned int base);
-
-#endif /* _ASM_MICROBLAZE_SELFMOD_H */
index 928c950..5b0e512 100644 (file)
@@ -7,7 +7,6 @@ ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_timer.o = -pg
 CFLAGS_REMOVE_intc.o = -pg
 CFLAGS_REMOVE_early_printk.o = -pg
-CFLAGS_REMOVE_selfmod.o = -pg
 CFLAGS_REMOVE_heartbeat.o = -pg
 CFLAGS_REMOVE_ftrace.o = -pg
 CFLAGS_REMOVE_process.o = -pg
@@ -23,7 +22,6 @@ obj-y += dma.o exceptions.o \
 obj-y += cpu/
 
 obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
-obj-$(CONFIG_SELFMOD)          += selfmod.o
 obj-$(CONFIG_HEART_BEAT)       += heartbeat.o
 obj-$(CONFIG_MODULES)          += microblaze_ksyms.o module.o
 obj-$(CONFIG_MMU)              += misc.o
index 410398f..c9203b1 100644 (file)
@@ -39,6 +39,8 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
        {"8.30.a", 0x17},
        {"8.40.a", 0x18},
        {"8.40.b", 0x19},
+       {"9.0", 0x1b},
+       {"9.1", 0x1d},
        {NULL, 0},
 };
 
index d85fa3a..581451a 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
+ * Copyright (C) 2007-2013 Michal Simek <monstr@monstr.eu>
+ * Copyright (C) 2012-2013 Xilinx, Inc.
  * Copyright (C) 2007-2009 PetaLogix
  * Copyright (C) 2006 Atmark Techno, Inc.
  *
@@ -8,23 +9,15 @@
  * for more details.
  */
 
-#include <linux/init.h>
 #include <linux/irqdomain.h>
 #include <linux/irq.h>
-#include <asm/page.h>
+#include <linux/of_address.h>
 #include <linux/io.h>
 #include <linux/bug.h>
 
-#include <asm/prom.h>
-#include <asm/irq.h>
+#include "../../drivers/irqchip/irqchip.h"
 
-#ifdef CONFIG_SELFMOD_INTC
-#include <asm/selfmod.h>
-#define INTC_BASE      BARRIER_BASE_ADDR
-#else
-static unsigned int intc_baseaddr;
-#define INTC_BASE      intc_baseaddr
-#endif
+static void __iomem *intc_baseaddr;
 
 /* No one else should require these constants, so define them locally here. */
 #define ISR 0x00                       /* Interrupt Status Register */
@@ -50,21 +43,21 @@ static void intc_enable_or_unmask(struct irq_data *d)
         * acks the irq before calling the interrupt handler
         */
        if (irqd_is_level_type(d))
-               out_be32(INTC_BASE + IAR, mask);
+               out_be32(intc_baseaddr + IAR, mask);
 
-       out_be32(INTC_BASE + SIE, mask);
+       out_be32(intc_baseaddr + SIE, mask);
 }
 
 static void intc_disable_or_mask(struct irq_data *d)
 {
        pr_debug("disable: %ld\n", d->hwirq);
-       out_be32(INTC_BASE + CIE, 1 << d->hwirq);
+       out_be32(intc_baseaddr + CIE, 1 << d->hwirq);
 }
 
 static void intc_ack(struct irq_data *d)
 {
        pr_debug("ack: %ld\n", d->hwirq);
-       out_be32(INTC_BASE + IAR, 1 << d->hwirq);
+       out_be32(intc_baseaddr + IAR, 1 << d->hwirq);
 }
 
 static void intc_mask_ack(struct irq_data *d)
@@ -72,8 +65,8 @@ static void intc_mask_ack(struct irq_data *d)
        unsigned long mask = 1 << d->hwirq;
 
        pr_debug("disable_and_ack: %ld\n", d->hwirq);
-       out_be32(INTC_BASE + CIE, mask);
-       out_be32(INTC_BASE + IAR, mask);
+       out_be32(intc_baseaddr + CIE, mask);
+       out_be32(intc_baseaddr + IAR, mask);
 }
 
 static struct irq_chip intc_dev = {
@@ -90,7 +83,7 @@ unsigned int get_irq(void)
 {
        unsigned int hwirq, irq = -1;
 
-       hwirq = in_be32(INTC_BASE + IVR);
+       hwirq = in_be32(intc_baseaddr + IVR);
        if (hwirq != -1U)
                irq = irq_find_mapping(root_domain, hwirq);
 
@@ -120,40 +113,32 @@ static const struct irq_domain_ops xintc_irq_domain_ops = {
        .map = xintc_map,
 };
 
-void __init init_IRQ(void)
+static int __init xilinx_intc_of_init(struct device_node *intc,
+                                            struct device_node *parent)
 {
        u32 nr_irq, intr_mask;
-       struct device_node *intc = NULL;
-#ifdef CONFIG_SELFMOD_INTC
-       unsigned int intc_baseaddr = 0;
-       static int arr_func[] = {
-                               (int)&get_irq,
-                               (int)&intc_enable_or_unmask,
-                               (int)&intc_disable_or_mask,
-                               (int)&intc_mask_ack,
-                               (int)&intc_ack,
-                               (int)&intc_end,
-                               0
-                       };
-#endif
-       intc = of_find_compatible_node(NULL, NULL, "xlnx,xps-intc-1.00.a");
-       BUG_ON(!intc);
-
-       intc_baseaddr = be32_to_cpup(of_get_property(intc, "reg", NULL));
-       intc_baseaddr = (unsigned long) ioremap(intc_baseaddr, PAGE_SIZE);
-       nr_irq = be32_to_cpup(of_get_property(intc,
-                                               "xlnx,num-intr-inputs", NULL));
-
-       intr_mask =
-               be32_to_cpup(of_get_property(intc, "xlnx,kind-of-intr", NULL));
+       int ret;
+
+       intc_baseaddr = of_iomap(intc, 0);
+       BUG_ON(!intc_baseaddr);
+
+       ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &nr_irq);
+       if (ret < 0) {
+               pr_err("%s: unable to read xlnx,num-intr-inputs\n", __func__);
+               return -EINVAL;
+       }
+
+       ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &intr_mask);
+       if (ret < 0) {
+               pr_err("%s: unable to read xlnx,kind-of-intr\n", __func__);
+               return -EINVAL;
+       }
+
        if (intr_mask > (u32)((1ULL << nr_irq) - 1))
                pr_info(" ERROR: Mismatch in kind-of-intr param\n");
 
-#ifdef CONFIG_SELFMOD_INTC
-       selfmod_function((int *) arr_func, intc_baseaddr);
-#endif
-       pr_info("%s #0 at 0x%08x, num_irq=%d, edge=0x%x\n",
-               intc->name, intc_baseaddr, nr_irq, intr_mask);
+       pr_info("%s: num_irq=%d, edge=0x%x\n",
+               intc->full_name, nr_irq, intr_mask);
 
        /*
         * Disable all external interrupts until they are
@@ -174,4 +159,8 @@ void __init init_IRQ(void)
                                                        (void *)intr_mask);
 
        irq_set_default_host(root_domain);
+
+       return 0;
 }
+
+IRQCHIP_DECLARE(xilinx_intc, "xlnx,xps-intc-1.00.a", xilinx_intc_of_init);
index ace700a..11e24de 100644 (file)
 #include <linux/seq_file.h>
 #include <linux/kernel_stat.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/of_irq.h>
-#include <linux/export.h>
-
-#include <asm/prom.h>
 
 static u32 concurrent_irq;
 
@@ -47,3 +45,9 @@ next_irq:
        set_irq_regs(old_regs);
        trace_hardirqs_on();
 }
+
+void __init init_IRQ(void)
+{
+       /* process the entire interrupt tree in one go */
+       irqchip_init();
+}
index 2e5079a..fbe58c6 100644 (file)
@@ -67,7 +67,11 @@ static void gpio_system_reset(void)
                pr_notice("Reset GPIO unavailable - halting!\n");
 }
 #else
-#define gpio_system_reset() do {} while (0)
+static void gpio_system_reset(void)
+{
+       pr_notice("No reset GPIO present - halting!\n");
+}
+
 void of_platform_reset_gpio_probe(void)
 {
        return;
diff --git a/arch/microblaze/kernel/selfmod.c b/arch/microblaze/kernel/selfmod.c
deleted file mode 100644 (file)
index 89508bd..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
- * Copyright (C) 2009 PetaLogix
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-
-#include <linux/interrupt.h>
-#include <asm/selfmod.h>
-
-#undef DEBUG
-
-#if __GNUC__ > 3
-#error GCC 4 unsupported SELFMOD. Please disable SELFMOD from menuconfig.
-#endif
-
-#define OPCODE_IMM             0xB0000000
-#define OPCODE_LWI             0xE8000000
-#define OPCODE_LWI_MASK                0xEC000000
-#define OPCODE_RTSD            0xB60F0008 /* return from func: rtsd r15, 8 */
-#define OPCODE_ADDIK           0x30000000
-#define OPCODE_ADDIK_MASK      0xFC000000
-
-#define IMM_BASE       (OPCODE_IMM | (BARRIER_BASE_ADDR >> 16))
-#define LWI_BASE       (OPCODE_LWI | (BARRIER_BASE_ADDR & 0x0000ff00))
-#define LWI_BASE_MASK  (OPCODE_LWI_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))
-#define ADDIK_BASE     (OPCODE_ADDIK | (BARRIER_BASE_ADDR & 0x0000ff00))
-#define ADDIK_BASE_MASK        (OPCODE_ADDIK_MASK | (BARRIER_BASE_ADDR & 0x0000ff00))
-
-#define MODIFY_INSTR {                                         \
-       pr_debug("%s: curr instr, (%d):0x%x, next(%d):0x%x\n",          \
-               __func__, i, addr[i], i + 1, addr[i + 1]);              \
-       addr[i] = OPCODE_IMM + (base >> 16);                            \
-       /* keep instruction opcode and add only last 16bits */          \
-       addr[i + 1] = (addr[i + 1] & 0xffff00ff) + (base & 0xffff);     \
-       __invalidate_icache(addr[i]);                                   \
-       __invalidate_icache(addr[i + 1]);                               \
-       pr_debug("%s: hack instr, (%d):0x%x, next(%d):0x%x\n",          \
-               __func__, i, addr[i], i + 1, addr[i + 1]); }
-
-/* NOTE
- * self-modified part of code for improvement of interrupt controller
- * save instruction in interrupt rutine
- */
-void selfmod_function(const int *arr_fce, const unsigned int base)
-{
-       unsigned int flags, i, j, *addr = NULL;
-
-       local_irq_save(flags);
-       __disable_icache();
-
-       /* zero terminated array */
-       for (j = 0; arr_fce[j] != 0; j++) {
-               /* get start address of function */
-               addr = (unsigned int *) arr_fce[j];
-               pr_debug("%s: func(%d) at 0x%x\n",
-                                       __func__, j, (unsigned int) addr);
-               for (i = 0; ; i++) {
-                       pr_debug("%s: instruction code at %d: 0x%x\n",
-                                               __func__, i, addr[i]);
-                       if (addr[i] == IMM_BASE) {
-                               /* detecting of lwi (0xE8) or swi (0xF8) instr
-                                * I can detect both opcode with one mask */
-                               if ((addr[i + 1] & LWI_BASE_MASK) == LWI_BASE) {
-                                       MODIFY_INSTR;
-                               } else /* detection addik for ack */
-                               if ((addr[i + 1] & ADDIK_BASE_MASK) ==
-                                                               ADDIK_BASE) {
-                                       MODIFY_INSTR;
-                               }
-                       } else if (addr[i] == OPCODE_RTSD) {
-                               /* return from function means end of function */
-                               pr_debug("%s: end of array %d\n", __func__, i);
-                               break;
-                       }
-               }
-       }
-       local_irq_restore(flags);
-} /* end of self-modified code */
index 0263da7..0775e03 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/clocksource.h>
 #include <linux/string.h>
 #include <linux/seq_file.h>
 #include <linux/cpu.h>
@@ -68,10 +69,6 @@ void __init setup_arch(char **cmdline_p)
 
        xilinx_pci_init();
 
-#if defined(CONFIG_SELFMOD_INTC) || defined(CONFIG_SELFMOD_TIMER)
-       pr_notice("Self modified code enable\n");
-#endif
-
 #ifdef CONFIG_VT
 #if defined(CONFIG_XILINX_CONSOLE)
        conswitchp = &xil_con;
@@ -196,6 +193,11 @@ void __init machine_early_init(const char *cmdline, unsigned int ram,
        per_cpu(CURRENT_SAVE, 0) = (unsigned long)current;
 }
 
+void __init time_init(void)
+{
+       clocksource_of_init();
+}
+
 #ifdef CONFIG_DEBUG_FS
 struct dentry *of_debugfs_root;
 
index aec5020..e4b3f33 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
+ * Copyright (C) 2007-2013 Michal Simek <monstr@monstr.eu>
+ * Copyright (C) 2012-2013 Xilinx, Inc.
  * Copyright (C) 2007-2009 PetaLogix
  * Copyright (C) 2006 Atmark Techno, Inc.
  *
@@ -8,34 +9,16 @@
  * for more details.
  */
 
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
 #include <linux/interrupt.h>
-#include <linux/profile.h>
-#include <linux/irq.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/err.h>
 #include <linux/clk.h>
-#include <linux/clocksource.h>
 #include <linux/clockchips.h>
-#include <linux/io.h>
-#include <linux/bug.h>
+#include <linux/of_address.h>
 #include <asm/cpuinfo.h>
-#include <asm/setup.h>
-#include <asm/prom.h>
-#include <asm/irq.h>
 #include <linux/cnt32_to_63.h>
 
-#ifdef CONFIG_SELFMOD_TIMER
-#include <asm/selfmod.h>
-#define TIMER_BASE     BARRIER_BASE_ADDR
-#else
-static unsigned int timer_baseaddr;
-#define TIMER_BASE     timer_baseaddr
-#endif
+static void __iomem *timer_baseaddr;
 
 static unsigned int freq_div_hz;
 static unsigned int timer_clock_freq;
@@ -59,19 +42,21 @@ static unsigned int timer_clock_freq;
 #define TCSR_PWMA      (1<<9)
 #define TCSR_ENALL     (1<<10)
 
-static inline void microblaze_timer0_stop(void)
+static inline void xilinx_timer0_stop(void)
 {
-       out_be32(TIMER_BASE + TCSR0, in_be32(TIMER_BASE + TCSR0) & ~TCSR_ENT);
+       out_be32(timer_baseaddr + TCSR0,
+                in_be32(timer_baseaddr + TCSR0) & ~TCSR_ENT);
 }
 
-static inline void microblaze_timer0_start_periodic(unsigned long load_val)
+static inline void xilinx_timer0_start_periodic(unsigned long load_val)
 {
        if (!load_val)
                load_val = 1;
-       out_be32(TIMER_BASE + TLR0, load_val); /* loading value to timer reg */
+       /* loading value to timer reg */
+       out_be32(timer_baseaddr + TLR0, load_val);
 
        /* load the initial value */
-       out_be32(TIMER_BASE + TCSR0, TCSR_LOAD);
+       out_be32(timer_baseaddr + TCSR0, TCSR_LOAD);
 
        /* see timer data sheet for detail
         * !ENALL - don't enable 'em all
@@ -86,38 +71,39 @@ static inline void microblaze_timer0_start_periodic(unsigned long load_val)
         * UDT - set the timer as down counter
         * !MDT0 - generate mode
         */
-       out_be32(TIMER_BASE + TCSR0,
+       out_be32(timer_baseaddr + TCSR0,
                        TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT);
 }
 
-static inline void microblaze_timer0_start_oneshot(unsigned long load_val)
+static inline void xilinx_timer0_start_oneshot(unsigned long load_val)
 {
        if (!load_val)
                load_val = 1;
-       out_be32(TIMER_BASE + TLR0, load_val); /* loading value to timer reg */
+       /* loading value to timer reg */
+       out_be32(timer_baseaddr + TLR0, load_val);
 
        /* load the initial value */
-       out_be32(TIMER_BASE + TCSR0, TCSR_LOAD);
+       out_be32(timer_baseaddr + TCSR0, TCSR_LOAD);
 
-       out_be32(TIMER_BASE + TCSR0,
+       out_be32(timer_baseaddr + TCSR0,
                        TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT);
 }
 
-static int microblaze_timer_set_next_event(unsigned long delta,
+static int xilinx_timer_set_next_event(unsigned long delta,
                                        struct clock_event_device *dev)
 {
        pr_debug("%s: next event, delta %x\n", __func__, (u32)delta);
-       microblaze_timer0_start_oneshot(delta);
+       xilinx_timer0_start_oneshot(delta);
        return 0;
 }
 
-static void microblaze_timer_set_mode(enum clock_event_mode mode,
+static void xilinx_timer_set_mode(enum clock_event_mode mode,
                                struct clock_event_device *evt)
 {
        switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
                pr_info("%s: periodic\n", __func__);
-               microblaze_timer0_start_periodic(freq_div_hz);
+               xilinx_timer0_start_periodic(freq_div_hz);
                break;
        case CLOCK_EVT_MODE_ONESHOT:
                pr_info("%s: oneshot\n", __func__);
@@ -127,7 +113,7 @@ static void microblaze_timer_set_mode(enum clock_event_mode mode,
                break;
        case CLOCK_EVT_MODE_SHUTDOWN:
                pr_info("%s: shutdown\n", __func__);
-               microblaze_timer0_stop();
+               xilinx_timer0_stop();
                break;
        case CLOCK_EVT_MODE_RESUME:
                pr_info("%s: resume\n", __func__);
@@ -135,23 +121,23 @@ static void microblaze_timer_set_mode(enum clock_event_mode mode,
        }
 }
 
-static struct clock_event_device clockevent_microblaze_timer = {
-       .name           = "microblaze_clockevent",
+static struct clock_event_device clockevent_xilinx_timer = {
+       .name           = "xilinx_clockevent",
        .features       = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
        .shift          = 8,
        .rating         = 300,
-       .set_next_event = microblaze_timer_set_next_event,
-       .set_mode       = microblaze_timer_set_mode,
+       .set_next_event = xilinx_timer_set_next_event,
+       .set_mode       = xilinx_timer_set_mode,
 };
 
 static inline void timer_ack(void)
 {
-       out_be32(TIMER_BASE + TCSR0, in_be32(TIMER_BASE + TCSR0));
+       out_be32(timer_baseaddr + TCSR0, in_be32(timer_baseaddr + TCSR0));
 }
 
 static irqreturn_t timer_interrupt(int irq, void *dev_id)
 {
-       struct clock_event_device *evt = &clockevent_microblaze_timer;
+       struct clock_event_device *evt = &clockevent_xilinx_timer;
 #ifdef CONFIG_HEART_BEAT
        heartbeat();
 #endif
@@ -164,73 +150,74 @@ static struct irqaction timer_irqaction = {
        .handler = timer_interrupt,
        .flags = IRQF_DISABLED | IRQF_TIMER,
        .name = "timer",
-       .dev_id = &clockevent_microblaze_timer,
+       .dev_id = &clockevent_xilinx_timer,
 };
 
-static __init void microblaze_clockevent_init(void)
+static __init void xilinx_clockevent_init(void)
 {
-       clockevent_microblaze_timer.mult =
+       clockevent_xilinx_timer.mult =
                div_sc(timer_clock_freq, NSEC_PER_SEC,
-                               clockevent_microblaze_timer.shift);
-       clockevent_microblaze_timer.max_delta_ns =
-               clockevent_delta2ns((u32)~0, &clockevent_microblaze_timer);
-       clockevent_microblaze_timer.min_delta_ns =
-               clockevent_delta2ns(1, &clockevent_microblaze_timer);
-       clockevent_microblaze_timer.cpumask = cpumask_of(0);
-       clockevents_register_device(&clockevent_microblaze_timer);
+                               clockevent_xilinx_timer.shift);
+       clockevent_xilinx_timer.max_delta_ns =
+               clockevent_delta2ns((u32)~0, &clockevent_xilinx_timer);
+       clockevent_xilinx_timer.min_delta_ns =
+               clockevent_delta2ns(1, &clockevent_xilinx_timer);
+       clockevent_xilinx_timer.cpumask = cpumask_of(0);
+       clockevents_register_device(&clockevent_xilinx_timer);
 }
 
-static cycle_t microblaze_read(struct clocksource *cs)
+static cycle_t xilinx_read(struct clocksource *cs)
 {
        /* reading actual value of timer 1 */
-       return (cycle_t) (in_be32(TIMER_BASE + TCR1));
+       return (cycle_t) (in_be32(timer_baseaddr + TCR1));
 }
 
-static struct timecounter microblaze_tc = {
+static struct timecounter xilinx_tc = {
        .cc = NULL,
 };
 
-static cycle_t microblaze_cc_read(const struct cyclecounter *cc)
+static cycle_t xilinx_cc_read(const struct cyclecounter *cc)
 {
-       return microblaze_read(NULL);
+       return xilinx_read(NULL);
 }
 
-static struct cyclecounter microblaze_cc = {
-       .read = microblaze_cc_read,
+static struct cyclecounter xilinx_cc = {
+       .read = xilinx_cc_read,
        .mask = CLOCKSOURCE_MASK(32),
        .shift = 8,
 };
 
-static int __init init_microblaze_timecounter(void)
+static int __init init_xilinx_timecounter(void)
 {
-       microblaze_cc.mult = div_sc(timer_clock_freq, NSEC_PER_SEC,
-                               microblaze_cc.shift);
+       xilinx_cc.mult = div_sc(timer_clock_freq, NSEC_PER_SEC,
+                               xilinx_cc.shift);
 
-       timecounter_init(&microblaze_tc, &microblaze_cc, sched_clock());
+       timecounter_init(&xilinx_tc, &xilinx_cc, sched_clock());
 
        return 0;
 }
 
 static struct clocksource clocksource_microblaze = {
-       .name           = "microblaze_clocksource",
+       .name           = "xilinx_clocksource",
        .rating         = 300,
-       .read           = microblaze_read,
+       .read           = xilinx_read,
        .mask           = CLOCKSOURCE_MASK(32),
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-static int __init microblaze_clocksource_init(void)
+static int __init xilinx_clocksource_init(void)
 {
        if (clocksource_register_hz(&clocksource_microblaze, timer_clock_freq))
                panic("failed to register clocksource");
 
        /* stop timer1 */
-       out_be32(TIMER_BASE + TCSR1, in_be32(TIMER_BASE + TCSR1) & ~TCSR_ENT);
+       out_be32(timer_baseaddr + TCSR1,
+                in_be32(timer_baseaddr + TCSR1) & ~TCSR_ENT);
        /* start timer1 - up counting without interrupt */
-       out_be32(TIMER_BASE + TCSR1, TCSR_TINT|TCSR_ENT|TCSR_ARHT);
+       out_be32(timer_baseaddr + TCSR1, TCSR_TINT|TCSR_ENT|TCSR_ARHT);
 
        /* register timecounter - for ftrace support */
-       init_microblaze_timecounter();
+       init_xilinx_timecounter();
        return 0;
 }
 
@@ -240,55 +227,31 @@ static int __init microblaze_clocksource_init(void)
  */
 static int timer_initialized;
 
-void __init time_init(void)
+static void __init xilinx_timer_init(struct device_node *timer)
 {
        u32 irq;
        u32 timer_num = 1;
-       struct device_node *timer = NULL;
-       const void *prop;
-#ifdef CONFIG_SELFMOD_TIMER
-       unsigned int timer_baseaddr = 0;
-       int arr_func[] = {
-                               (int)&microblaze_read,
-                               (int)&timer_interrupt,
-                               (int)&microblaze_clocksource_init,
-                               (int)&microblaze_timer_set_mode,
-                               (int)&microblaze_timer_set_next_event,
-                               0
-                       };
-#endif
-       prop = of_get_property(of_chosen, "system-timer", NULL);
-       if (prop)
-               timer = of_find_node_by_phandle(be32_to_cpup(prop));
-       else
-               pr_info("No chosen timer found, using default\n");
-
-       if (!timer)
-               timer = of_find_compatible_node(NULL, NULL,
-                                               "xlnx,xps-timer-1.00.a");
-       BUG_ON(!timer);
-
-       timer_baseaddr = be32_to_cpup(of_get_property(timer, "reg", NULL));
-       timer_baseaddr = (unsigned long) ioremap(timer_baseaddr, PAGE_SIZE);
+       int ret;
+
+       timer_baseaddr = of_iomap(timer, 0);
+       if (!timer_baseaddr) {
+               pr_err("ERROR: invalid timer base address\n");
+               BUG();
+       }
+
        irq = irq_of_parse_and_map(timer, 0);
-       timer_num = be32_to_cpup(of_get_property(timer,
-                                               "xlnx,one-timer-only", NULL));
+
+       of_property_read_u32(timer, "xlnx,one-timer-only", &timer_num);
        if (timer_num) {
-               pr_emerg("Please   enable two timers in HW\n");
+               pr_emerg("Please enable two timers in HW\n");
                BUG();
        }
 
-#ifdef CONFIG_SELFMOD_TIMER
-       selfmod_function((int *) arr_func, timer_baseaddr);
-#endif
-       pr_info("%s #0 at 0x%08x, irq=%d\n",
-               timer->name, timer_baseaddr, irq);
+       pr_info("%s: irq=%d\n", timer->full_name, irq);
 
        /* If there is clock-frequency property than use it */
-       prop = of_get_property(timer, "clock-frequency", NULL);
-       if (prop)
-               timer_clock_freq = be32_to_cpup(prop);
-       else
+       ret = of_property_read_u32(timer, "clock-frequency", &timer_clock_freq);
+       if (ret < 0)
                timer_clock_freq = cpuinfo.cpu_clock_freq;
 
        freq_div_hz = timer_clock_freq / HZ;
@@ -297,8 +260,8 @@ void __init time_init(void)
 #ifdef CONFIG_HEART_BEAT
        setup_heartbeat();
 #endif
-       microblaze_clocksource_init();
-       microblaze_clockevent_init();
+       xilinx_clocksource_init();
+       xilinx_clockevent_init();
        timer_initialized = 1;
 }
 
@@ -312,3 +275,6 @@ unsigned long long notrace sched_clock(void)
        }
        return 0;
 }
+
+CLOCKSOURCE_OF_DECLARE(xilinx_timer, "xlnx,xps-timer-1.00.a",
+                      xilinx_timer_init);
index bdb8ea1..1b93bf0 100644 (file)
@@ -657,67 +657,42 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
 void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                                  struct device_node *dev, int primary)
 {
-       const u32 *ranges;
-       int rlen;
-       int pna = of_n_addr_cells(dev);
-       int np = pna + 5;
        int memno = 0, isa_hole = -1;
-       u32 pci_space;
-       unsigned long long pci_addr, cpu_addr, pci_next, cpu_next, size;
        unsigned long long isa_mb = 0;
        struct resource *res;
+       struct of_pci_range range;
+       struct of_pci_range_parser parser;
 
        pr_info("PCI host bridge %s %s ranges:\n",
               dev->full_name, primary ? "(primary)" : "");
 
-       /* Get ranges property */
-       ranges = of_get_property(dev, "ranges", &rlen);
-       if (ranges == NULL)
+       /* Check for ranges property */
+       if (of_pci_range_parser_init(&parser, dev))
                return;
 
-       /* Parse it */
        pr_debug("Parsing ranges property...\n");
-       while ((rlen -= np * 4) >= 0) {
+       for_each_of_pci_range(&parser, &range) {
                /* Read next ranges element */
-               pci_space = ranges[0];
-               pci_addr = of_read_number(ranges + 1, 2);
-               cpu_addr = of_translate_address(dev, ranges + 3);
-               size = of_read_number(ranges + pna + 3, 2);
-
                pr_debug("pci_space: 0x%08x pci_addr:0x%016llx ",
-                               pci_space, pci_addr);
+                               range.pci_space, range.pci_addr);
                pr_debug("cpu_addr:0x%016llx size:0x%016llx\n",
-                                       cpu_addr, size);
-
-               ranges += np;
+                                       range.cpu_addr, range.size);
 
                /* If we failed translation or got a zero-sized region
                 * (some FW try to feed us with non sensical zero sized regions
                 * such as power3 which look like some kind of attempt
                 * at exposing the VGA memory hole)
                 */
-               if (cpu_addr == OF_BAD_ADDR || size == 0)
+               if (range.cpu_addr == OF_BAD_ADDR || range.size == 0)
                        continue;
 
-               /* Now consume following elements while they are contiguous */
-               for (; rlen >= np * sizeof(u32);
-                    ranges += np, rlen -= np * 4) {
-                       if (ranges[0] != pci_space)
-                               break;
-                       pci_next = of_read_number(ranges + 1, 2);
-                       cpu_next = of_translate_address(dev, ranges + 3);
-                       if (pci_next != pci_addr + size ||
-                           cpu_next != cpu_addr + size)
-                               break;
-                       size += of_read_number(ranges + pna + 3, 2);
-               }
-
                /* Act based on address space type */
                res = NULL;
-               switch ((pci_space >> 24) & 0x3) {
-               case 1:         /* PCI IO space */
+               switch (range.flags & IORESOURCE_TYPE_BITS) {
+               case IORESOURCE_IO:
                        pr_info("  IO 0x%016llx..0x%016llx -> 0x%016llx\n",
-                              cpu_addr, cpu_addr + size - 1, pci_addr);
+                               range.cpu_addr, range.cpu_addr + range.size - 1,
+                               range.pci_addr);
 
                        /* We support only one IO range */
                        if (hose->pci_io_size) {
@@ -725,11 +700,12 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                                continue;
                        }
                        /* On 32 bits, limit I/O space to 16MB */
-                       if (size > 0x01000000)
-                               size = 0x01000000;
+                       if (range.size > 0x01000000)
+                               range.size = 0x01000000;
 
                        /* 32 bits needs to map IOs here */
-                       hose->io_base_virt = ioremap(cpu_addr, size);
+                       hose->io_base_virt = ioremap(range.cpu_addr,
+                                               range.size);
 
                        /* Expect trouble if pci_addr is not 0 */
                        if (primary)
@@ -738,19 +714,20 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                        /* pci_io_size and io_base_phys always represent IO
                         * space starting at 0 so we factor in pci_addr
                         */
-                       hose->pci_io_size = pci_addr + size;
-                       hose->io_base_phys = cpu_addr - pci_addr;
+                       hose->pci_io_size = range.pci_addr + range.size;
+                       hose->io_base_phys = range.cpu_addr - range.pci_addr;
 
                        /* Build resource */
                        res = &hose->io_resource;
-                       res->flags = IORESOURCE_IO;
-                       res->start = pci_addr;
+                       range.cpu_addr = range.pci_addr;
+
                        break;
-               case 2:         /* PCI Memory space */
-               case 3:         /* PCI 64 bits Memory space */
+               case IORESOURCE_MEM:
                        pr_info(" MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
-                              cpu_addr, cpu_addr + size - 1, pci_addr,
-                              (pci_space & 0x40000000) ? "Prefetch" : "");
+                               range.cpu_addr, range.cpu_addr + range.size - 1,
+                               range.pci_addr,
+                               (range.pci_space & 0x40000000) ?
+                               "Prefetch" : "");
 
                        /* We support only 3 memory ranges */
                        if (memno >= 3) {
@@ -758,13 +735,13 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                                continue;
                        }
                        /* Handles ISA memory hole space here */
-                       if (pci_addr == 0) {
-                               isa_mb = cpu_addr;
+                       if (range.pci_addr == 0) {
+                               isa_mb = range.cpu_addr;
                                isa_hole = memno;
                                if (primary || isa_mem_base == 0)
-                                       isa_mem_base = cpu_addr;
-                               hose->isa_mem_phys = cpu_addr;
-                               hose->isa_mem_size = size;
+                                       isa_mem_base = range.cpu_addr;
+                               hose->isa_mem_phys = range.cpu_addr;
+                               hose->isa_mem_size = range.size;
                        }
 
                        /* We get the PCI/Mem offset from the first range or
@@ -772,30 +749,23 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                         * hole. If they don't match, bugger.
                         */
                        if (memno == 0 ||
-                           (isa_hole >= 0 && pci_addr != 0 &&
+                           (isa_hole >= 0 && range.pci_addr != 0 &&
                             hose->pci_mem_offset == isa_mb))
-                               hose->pci_mem_offset = cpu_addr - pci_addr;
-                       else if (pci_addr != 0 &&
-                                hose->pci_mem_offset != cpu_addr - pci_addr) {
+                               hose->pci_mem_offset = range.cpu_addr -
+                                                       range.pci_addr;
+                       else if (range.pci_addr != 0 &&
+                                hose->pci_mem_offset != range.cpu_addr -
+                                                       range.pci_addr) {
                                pr_info(" \\--> Skipped (offset mismatch) !\n");
                                continue;
                        }
 
                        /* Build resource */
                        res = &hose->mem_resources[memno++];
-                       res->flags = IORESOURCE_MEM;
-                       if (pci_space & 0x40000000)
-                               res->flags |= IORESOURCE_PREFETCH;
-                       res->start = cpu_addr;
                        break;
                }
-               if (res != NULL) {
-                       res->name = dev->full_name;
-                       res->end = res->start + size - 1;
-                       res->parent = NULL;
-                       res->sibling = NULL;
-                       res->child = NULL;
-               }
+               if (res != NULL)
+                       of_pci_range_to_resource(&range, dev, res);
        }
 
        /* If there's an ISA hole and the pci_mem_offset is -not- matching
index b174721..db1aa5c 100644 (file)
@@ -18,28 +18,6 @@ config PLATFORM_GENERIC
 
 endchoice
 
-config SELFMOD
-       bool "Use self modified code for intc/timer"
-       depends on NO_MMU
-       default n
-       help
-         This choice enables self-modified code for interrupt controller
-         and timer.
-
-config SELFMOD_INTC
-       bool "Use self modified code for intc"
-       depends on SELFMOD
-       default y
-       help
-         This choice enables self-modified code for interrupt controller.
-
-config SELFMOD_TIMER
-       bool "Use self modified code for timer"
-       depends on SELFMOD
-       default y
-       help
-         This choice enables self-modified code for timer.
-
 config OPT_LIB_FUNCTION
        bool "Optimalized lib function"
        default y
index dccd7ce..71f15e7 100644 (file)
@@ -727,7 +727,6 @@ config CAVIUM_OCTEON_SOC
        select SYS_HAS_CPU_CAVIUM_OCTEON
        select SWAP_IO_SPACE
        select HW_HAS_PCI
-       select ARCH_SUPPORTS_MSI
        select ZONE_DMA32
        select USB_ARCH_HAS_OHCI
        select USB_ARCH_HAS_EHCI
@@ -763,7 +762,6 @@ config NLM_XLR_BOARD
        select CEVT_R4K
        select CSRC_R4K
        select IRQ_CPU
-       select ARCH_SUPPORTS_MSI
        select ZONE_DMA32 if 64BIT
        select SYNC_R4K
        select SYS_HAS_EARLY_PRINTK
index fa8e0aa..f194c08 100644 (file)
@@ -136,11 +136,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
        return channel ? 15 : 14;
 }
 
-#ifdef CONFIG_CPU_CAVIUM_OCTEON
-/* MSI arch hook for OCTEON */
-#define arch_setup_msi_irqs arch_setup_msi_irqs
-#endif
-
 extern char * (*pcibios_plat_setup)(char *str);
 
 #ifdef CONFIG_OF
index 07349b0..1cba8f2 100644 (file)
@@ -78,7 +78,7 @@ restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
        err |= __copy_from_user(regs->iaoq, sc->sc_iaoq, sizeof(regs->iaoq));
        err |= __copy_from_user(regs->iasq, sc->sc_iasq, sizeof(regs->iasq));
        err |= __get_user(regs->sar, &sc->sc_sar);
-       DBG(2,"restore_sigcontext: iaoq is 0x%#lx / 0x%#lx\n", 
+       DBG(2,"restore_sigcontext: iaoq is %#lx / %#lx\n",
                        regs->iaoq[0],regs->iaoq[1]);
        DBG(2,"restore_sigcontext: r28 is %ld\n", regs->gr[28]);
        return err;
index 5aecda0..6b7530f 100644 (file)
@@ -312,6 +312,26 @@ config MATH_EMULATION
          such as fsqrt on cores that do have an FPU but do not implement
          them (such as Freescale BookE).
 
+choice
+       prompt "Math emulation options"
+       default MATH_EMULATION_FULL
+       depends on MATH_EMULATION
+
+config MATH_EMULATION_FULL
+       bool "Emulate all the floating point instructions"
+       ---help---
+         Select this option will enable the kernel to support to emulate
+         all the floating point instructions. If your SoC doesn't have
+         a FPU, you should select this.
+
+config MATH_EMULATION_HW_UNIMPLEMENTED
+       bool "Just emulate the FPU unimplemented instructions"
+       ---help---
+         Select this if you know there does have a hardware FPU on your
+         SoC, but some floating point instructions are not implemented by that.
+
+endchoice
+
 config PPC_TRANSACTIONAL_MEM
        bool "Transactional Memory support for POWERPC"
        depends on PPC_BOOK3S_64
@@ -727,7 +747,6 @@ config PCI
        default y if !40x && !CPM2 && !8xx && !PPC_83xx \
                && !PPC_85xx && !PPC_86xx && !GAMECUBE_COMMON
        default PCI_QSPAN if !4xx && !CPM2 && 8xx
-       select ARCH_SUPPORTS_MSI
        select GENERIC_PCI_IOMAP
        help
          Find out whether your system includes a PCI bus. PCI is the name of
index 967fd23..51cfb78 100644 (file)
@@ -88,13 +88,30 @@ CFLAGS-$(CONFIG_PPC64)      += $(call cc-option,-mcmodel=medium,-mminimal-toc)
 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
 CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple
 
+ifeq ($(CONFIG_PPC_BOOK3S_64),y)
 CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4)
+else
+CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
+endif
+
 CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)
 CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4)
 CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5)
 CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6)
 CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
 
+E5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64)
+CFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU)
+CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU))
+
+ifeq ($(CONFIG_PPC32),y)
+ifeq ($(CONFIG_PPC_E500MC),y)
+CFLAGS-y += $(call cc-option,-mcpu=e500mc,-mcpu=powerpc)
+else
+CFLAGS-$(CONFIG_E500) += $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc)
+endif
+endif
+
 CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell)
 
 KBUILD_CPPFLAGS        += -Iarch/$(ARCH)
@@ -139,7 +156,6 @@ endif
 
 cpu-as-$(CONFIG_4xx)           += -Wa,-m405
 cpu-as-$(CONFIG_ALTIVEC)       += -Wa,-maltivec
-cpu-as-$(CONFIG_E500)          += -Wa,-me500
 cpu-as-$(CONFIG_E200)          += -Wa,-me200
 
 KBUILD_AFLAGS += $(cpu-as-y)
index c32ae5c..554734f 100644 (file)
@@ -22,6 +22,7 @@ zImage.initrd
 zImage.bin.*
 zImage.chrp
 zImage.coff
+zImage.epapr
 zImage.holly
 zImage.*lds
 zImage.miboot
index a27a460..a543c40 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 
-/include/ "mpc5121.dtsi"
+#include <mpc5121.dtsi>
 
 / {
        model = "ac14xx";
index 923156d..508dbdf 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 /include/ "fsl/b4420si-pre.dtsi"
-/include/ "b4qds.dts"
+/include/ "b4qds.dtsi"
 
 / {
        model = "fsl,B4420QDS";
index 78907f3..6bb3707 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 /include/ "fsl/b4860si-pre.dtsi"
-/include/ "b4qds.dts"
+/include/ "b4qds.dtsi"
 
 / {
        model = "fsl,B4860QDS";
diff --git a/arch/powerpc/boot/dts/c293pcie.dts b/arch/powerpc/boot/dts/c293pcie.dts
new file mode 100644 (file)
index 0000000..1238bda
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * C293 PCIE Device Tree Source
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/include/ "fsl/c293si-pre.dtsi"
+
+/ {
+       model = "fsl,C293PCIE";
+       compatible = "fsl,C293PCIE";
+
+       memory {
+               device_type = "memory";
+       };
+
+       ifc: ifc@fffe1e000 {
+               reg = <0xf 0xffe1e000 0 0x2000>;
+               ranges = <0x0 0x0 0xf 0xec000000 0x04000000
+                         0x2 0x0 0xf 0xffdf0000 0x00010000>;
+
+       };
+
+       soc: soc@fffe00000 {
+               ranges = <0x0 0xf 0xffe00000 0x100000>;
+       };
+
+       pci0: pcie@fffe0a000 {
+               reg = <0xf 0xffe0a000 0 0x1000>;
+               ranges = <0x2000000 0x0 0x80000000 0xc 0x00000000 0x0 0x20000000
+                         0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>;
+               pcie@0 {
+                       ranges = <0x2000000 0x0 0x80000000
+                                 0x2000000 0x0 0x80000000
+                                 0x0 0x20000000
+
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
+               };
+       };
+};
+
+&ifc {
+       nor@0,0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "cfi-flash";
+               reg = <0x0 0x0 0x4000000>;
+               bank-width = <2>;
+               device-width = <1>;
+
+               partition@0 {
+                       /* 1MB for DTB Image */
+                       reg = <0x0 0x00100000>;
+                       label = "NOR DTB Image";
+               };
+
+               partition@100000 {
+                       /* 8 MB for Linux Kernel Image */
+                       reg = <0x00100000 0x00800000>;
+                       label = "NOR Linux Kernel Image";
+               };
+
+               partition@900000 {
+                       /* 53MB for rootfs */
+                       reg = <0x00900000 0x03500000>;
+                       label = "NOR Rootfs Image";
+               };
+
+               partition@3e00000 {
+                       /* 1MB for blob encrypted key */
+                       reg = <0x03e00000 0x00100000>;
+                       label = "NOR blob encrypted key";
+               };
+
+               partition@3f00000 {
+                       /* 512KB for u-boot Bootloader Image and evn */
+                       reg = <0x03f00000 0x00100000>;
+                       label = "NOR U-Boot Image";
+                       read-only;
+               };
+       };
+
+       nand@1,0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "fsl,ifc-nand";
+               reg = <0x1 0x0 0x10000>;
+
+               partition@0 {
+                       /* This location must not be altered  */
+                       /* 1MB for u-boot Bootloader Image */
+                       reg = <0x0 0x00100000>;
+                       label = "NAND U-Boot Image";
+                       read-only;
+               };
+
+               partition@100000 {
+                       /* 1MB for DTB Image */
+                       reg = <0x00100000 0x00100000>;
+                       label = "NAND DTB Image";
+               };
+
+               partition@200000 {
+                       /* 16MB for Linux Kernel Image */
+                       reg = <0x00200000 0x01000000>;
+                       label = "NAND Linux Kernel Image";
+               };
+
+               partition@1200000 {
+                       /* 4078MB for Root file System Image */
+                       reg = <0x00600000 0xfee00000>;
+                       label = "NAND RFS Image";
+               };
+       };
+
+       cpld@2,0 {
+               compatible = "fsl,c293pcie-cpld";
+               reg = <0x2 0x0 0x20>;
+       };
+};
+
+&soc {
+       i2c@3000 {
+               eeprom@50 {
+                       compatible = "st,24c1024";
+                       reg = <0x50>;
+               };
+
+               adt7461@4c {
+                       compatible = "adi,adt7461";
+                       reg = <0x4c>;
+               };
+       };
+
+       spi@7000 {
+               flash@0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "spansion,s25sl12801";
+                       reg = <0>;
+                       spi-max-frequency = <50000000>;
+
+                       partition@0 {
+                               /* 1MB for u-boot Bootloader Image */
+                               /* 1MB for Environment */
+                               reg = <0x0 0x00100000>;
+                               label = "SPI Flash U-Boot Image";
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               /* 512KB for DTB Image */
+                               reg = <0x00100000 0x00080000>;
+                               label = "SPI Flash DTB Image";
+                       };
+
+                       partition@180000 {
+                               /* 4MB for Linux Kernel Image */
+                               reg = <0x00180000 0x00400000>;
+                               label = "SPI Flash Linux Kernel Image";
+                       };
+
+                       partition@580000 {
+                               /* 10.5MB for RFS Image */
+                               reg = <0x00580000 0x00a80000>;
+                               label = "SPI Flash RFS Image";
+                       };
+               };
+       };
+
+       mdio@24000 {
+               phy0: ethernet-phy@0 {
+                       interrupts = <2 1 0 0>;
+                       reg = <0x0>;
+               };
+
+               phy1: ethernet-phy@1 {
+                       interrupts = <2 1 0 0>;
+                       reg = <0x2>;
+               };
+       };
+
+       enet0: ethernet@b0000 {
+               phy-handle = <&phy0>;
+               phy-connection-type = "rgmii-id";
+       };
+
+       enet1: ethernet@b1000 {
+               phy-handle = <&phy1>;
+               phy-connection-type = "rgmii-id";
+       };
+};
+/include/ "fsl/c293si-post.dtsi"
index 7399154..4c617bf 100644 (file)
                };
        };
 
-/include/ "qoriq-mpic.dtsi"
+/include/ "qoriq-mpic4.3.dtsi"
 
        guts: global-utilities@e0000 {
                compatible = "fsl,b4-device-config";
diff --git a/arch/powerpc/boot/dts/fsl/c293si-post.dtsi b/arch/powerpc/boot/dts/fsl/c293si-post.dtsi
new file mode 100644 (file)
index 0000000..bd20832
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * C293 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2012 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+&ifc {
+       #address-cells = <2>;
+       #size-cells = <1>;
+       compatible = "fsl,ifc", "simple-bus";
+       interrupts = <19 2 0 0>;
+};
+
+/* controller at 0xa000 */
+&pci0 {
+       compatible = "fsl,qoriq-pcie-v2.2", "fsl,qoriq-pcie";
+       device_type = "pci";
+       #size-cells = <2>;
+       #address-cells = <3>;
+       bus-range = <0 255>;
+       clock-frequency = <33333333>;
+       interrupts = <16 2 0 0>;
+
+       pcie@0 {
+               reg = <0 0 0 0 0>;
+               #interrupt-cells = <1>;
+               #size-cells = <2>;
+               #address-cells = <3>;
+               device_type = "pci";
+               interrupts = <16 2 0 0>;
+               interrupt-map-mask = <0xf800 0 0 7>;
+               interrupt-map = <
+                       /* IDSEL 0x0 */
+                       0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
+                       0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
+                       0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
+                       0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
+                       >;
+       };
+};
+
+&soc {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       device_type = "soc";
+       compatible = "simple-bus";
+       bus-frequency = <0>;            // Filled out by uboot.
+
+       ecm-law@0 {
+               compatible = "fsl,ecm-law";
+               reg = <0x0 0x1000>;
+               fsl,num-laws = <12>;
+       };
+
+       ecm@1000 {
+               compatible = "fsl,c293-ecm", "fsl,ecm";
+               reg = <0x1000 0x1000>;
+               interrupts = <16 2 0 0>;
+       };
+
+       memory-controller@2000 {
+               compatible = "fsl,c293-memory-controller";
+               reg = <0x2000 0x1000>;
+               interrupts = <16 2 0 0>;
+       };
+
+/include/ "pq3-i2c-0.dtsi"
+/include/ "pq3-i2c-1.dtsi"
+/include/ "pq3-duart-0.dtsi"
+/include/ "pq3-espi-0.dtsi"
+       spi0: spi@7000 {
+               fsl,espi-num-chipselects = <1>;
+       };
+
+/include/ "pq3-gpio-0.dtsi"
+       L2: l2-cache-controller@20000 {
+               compatible = "fsl,c293-l2-cache-controller";
+               reg = <0x20000 0x1000>;
+               cache-line-size = <32>; // 32 bytes
+               cache-size = <0x80000>; // L2,512K
+               interrupts = <16 2 0 0>;
+       };
+
+/include/ "pq3-dma-0.dtsi"
+/include/ "pq3-esdhc-0.dtsi"
+       sdhc@2e000 {
+               compatible = "fsl,c293-esdhc", "fsl,esdhc";
+               sdhci,auto-cmd12;
+       };
+
+       crypto@80000 {
+/include/ "qoriq-sec6.0-0.dtsi"
+       };
+
+       crypto@80000 {
+               reg = <0x80000 0x20000>;
+               ranges = <0x0 0x80000 0x20000>;
+
+               jr@1000{
+                       interrupts = <45 2 0 0>;
+               };
+               jr@2000{
+                       interrupts = <57 2 0 0>;
+               };
+       };
+
+       crypto@a0000 {
+/include/ "qoriq-sec6.0-0.dtsi"
+       };
+
+       crypto@a0000 {
+               reg = <0xa0000 0x20000>;
+               ranges = <0x0 0xa0000 0x20000>;
+
+               jr@1000{
+                       interrupts = <49 2 0 0>;
+               };
+               jr@2000{
+                       interrupts = <50 2 0 0>;
+               };
+       };
+
+       crypto@c0000 {
+/include/ "qoriq-sec6.0-0.dtsi"
+       };
+
+       crypto@c0000 {
+               reg = <0xc0000 0x20000>;
+               ranges = <0x0 0xc0000 0x20000>;
+
+               jr@1000{
+                       interrupts = <55 2 0 0>;
+               };
+               jr@2000{
+                       interrupts = <56 2 0 0>;
+               };
+       };
+
+/include/ "pq3-mpic.dtsi"
+/include/ "pq3-mpic-timer-B.dtsi"
+
+/include/ "pq3-etsec2-0.dtsi"
+       enet0: ethernet@b0000 {
+               queue-group@b0000 {
+                       reg = <0x10000 0x1000>;
+                       fsl,rx-bit-map = <0xff>;
+                       fsl,tx-bit-map = <0xff>;
+               };
+       };
+
+/include/ "pq3-etsec2-1.dtsi"
+       enet1: ethernet@b1000 {
+               queue-group@b1000 {
+                       reg = <0x11000 0x1000>;
+                       fsl,rx-bit-map = <0xff>;
+                       fsl,tx-bit-map = <0xff>;
+               };
+       };
+
+       global-utilities@e0000 {
+               compatible = "fsl,c293-guts";
+               reg = <0xe0000 0x1000>;
+               fsl,has-rstcr;
+       };
+};
diff --git a/arch/powerpc/boot/dts/fsl/c293si-pre.dtsi b/arch/powerpc/boot/dts/fsl/c293si-pre.dtsi
new file mode 100644 (file)
index 0000000..065049d
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * C293 Silicon/SoC Device Tree Source (pre include)
+ *
+ * Copyright 2012 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/dts-v1/;
+
+/include/ "e500v2_power_isa.dtsi"
+
+/ {
+       compatible = "fsl,C293";
+       #address-cells = <2>;
+       #size-cells = <2>;
+       interrupt-parent = <&mpic>;
+
+       aliases {
+               serial0 = &serial0;
+               serial1 = &serial1;
+               ethernet0 = &enet0;
+               ethernet1 = &enet1;
+               pci0 = &pci0;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,e500v2@0 {
+                       device_type = "cpu";
+                       reg = <0x0>;
+                       next-level-cache = <&L2>;
+               };
+       };
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-mpic4.3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-mpic4.3.dtsi
new file mode 100644 (file)
index 0000000..64f713c
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * QorIQ MPIC device tree stub [ controller @ offset 0x40000 ]
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+mpic: pic@40000 {
+       interrupt-controller;
+       #address-cells = <0>;
+       #interrupt-cells = <4>;
+       reg = <0x40000 0x40000>;
+       compatible = "fsl,mpic";
+       device_type = "open-pic";
+       clock-frequency = <0x0>;
+};
+
+timer@41100 {
+       compatible = "fsl,mpic-global-timer";
+       reg = <0x41100 0x100 0x41300 4>;
+       interrupts = <0 0 3 0
+                     1 0 3 0
+                     2 0 3 0
+                     3 0 3 0>;
+};
+
+msi0: msi@41600 {
+       compatible = "fsl,mpic-msi-v4.3";
+       reg = <0x41600 0x200 0x44148 4>;
+       interrupts = <
+               0xe0 0 0 0
+               0xe1 0 0 0
+               0xe2 0 0 0
+               0xe3 0 0 0
+               0xe4 0 0 0
+               0xe5 0 0 0
+               0xe6 0 0 0
+               0xe7 0 0 0
+               0x100 0 0 0
+               0x101 0 0 0
+               0x102 0 0 0
+               0x103 0 0 0
+               0x104 0 0 0
+               0x105 0 0 0
+               0x106 0 0 0
+               0x107 0 0 0>;
+};
+
+msi1: msi@41800 {
+       compatible = "fsl,mpic-msi-v4.3";
+       reg = <0x41800 0x200 0x45148 4>;
+       interrupts = <
+               0xe8 0 0 0
+               0xe9 0 0 0
+               0xea 0 0 0
+               0xeb 0 0 0
+               0xec 0 0 0
+               0xed 0 0 0
+               0xee 0 0 0
+               0xef 0 0 0
+               0x108 0 0 0
+               0x109 0 0 0
+               0x10a 0 0 0
+               0x10b 0 0 0
+               0x10c 0 0 0
+               0x10d 0 0 0
+               0x10e 0 0 0
+               0x10f 0 0 0>;
+};
+
+msi2: msi@41a00 {
+       compatible = "fsl,mpic-msi-v4.3";
+       reg = <0x41a00 0x200 0x46148 4>;
+       interrupts = <
+               0xf0 0 0 0
+               0xf1 0 0 0
+               0xf2 0 0 0
+               0xf3 0 0 0
+               0xf4 0 0 0
+               0xf5 0 0 0
+               0xf6 0 0 0
+               0xf7 0 0 0
+               0x110 0 0 0
+               0x111 0 0 0
+               0x112 0 0 0
+               0x113 0 0 0
+               0x114 0 0 0
+               0x115 0 0 0
+               0x116 0 0 0
+               0x117 0 0 0>;
+};
+
+msi3: msi@41c00 {
+       compatible = "fsl,mpic-msi-v4.3";
+       reg = <0x41c00 0x200 0x47148 4>;
+       interrupts = <
+               0xf8 0 0 0
+               0xf9 0 0 0
+               0xfa 0 0 0
+               0xfb 0 0 0
+               0xfc 0 0 0
+               0xfd 0 0 0
+               0xfe 0 0 0
+               0xff 0 0 0
+               0x118 0 0 0
+               0x119 0 0 0
+               0x11a 0 0 0
+               0x11b 0 0 0
+               0x11c 0 0 0
+               0x11d 0 0 0
+               0x11e 0 0 0
+               0x11f 0 0 0>;
+};
+
+timer@42100 {
+       compatible = "fsl,mpic-global-timer";
+       reg = <0x42100 0x100 0x42300 4>;
+       interrupts = <4 0 3 0
+                     5 0 3 0
+                     6 0 3 0
+                     7 0 3 0>;
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi
new file mode 100644 (file)
index 0000000..f75b4f8
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * QorIQ Sec/Crypto 6.0 device tree stub
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+       compatible = "fsl,sec-v6.0";
+       fsl,sec-era = <6>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       jr@1000 {
+               compatible = "fsl,sec-v6.0-job-ring",
+                            "fsl,sec-v5.2-job-ring",
+                            "fsl,sec-v5.0-job-ring",
+                            "fsl,sec-v4.4-job-ring",
+                            "fsl,sec-v4.0-job-ring";
+               reg        = <0x1000 0x1000>;
+       };
+
+       jr@2000 {
+               compatible = "fsl,sec-v6.0-job-ring",
+                            "fsl,sec-v5.2-job-ring",
+                            "fsl,sec-v5.0-job-ring",
+                            "fsl,sec-v4.4-job-ring",
+                            "fsl,sec-v4.0-job-ring";
+               reg        = <0x2000 0x1000>;
+       };
index bd611a9..510afa3 100644 (file)
                        16 2 1 30>;
        };
 
-/include/ "qoriq-mpic.dtsi"
+/include/ "qoriq-mpic4.3.dtsi"
 
        guts: global-utilities@e0000 {
                compatible = "fsl,t4240-device-config", "fsl,qoriq-device-config-2.0";
diff --git a/arch/powerpc/boot/dts/include/dt-bindings b/arch/powerpc/boot/dts/include/dt-bindings
new file mode 120000 (symlink)
index 0000000..08c00e4
--- /dev/null
@@ -0,0 +1 @@
+../../../../../include/dt-bindings
\ No newline at end of file
index 7d3cb79..c228a0a 100644 (file)
@@ -9,7 +9,7 @@
  * option) any later version.
  */
 
-/include/ "mpc5121.dtsi"
+#include <mpc5121.dtsi>
 
 / {
        model = "mpc5121ads";
diff --git a/arch/powerpc/boot/dts/p1020rdb-pd.dts b/arch/powerpc/boot/dts/p1020rdb-pd.dts
new file mode 100644 (file)
index 0000000..987017e
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * P1020 RDB-PD Device Tree Source (32-bit address map)
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/include/ "fsl/p1020si-pre.dtsi"
+/ {
+       model = "fsl,P1020RDB-PD";
+       compatible = "fsl,P1020RDB-PD";
+
+       memory {
+               device_type = "memory";
+       };
+
+       lbc: localbus@ffe05000 {
+               reg = <0x0 0xffe05000 0x0 0x1000>;
+
+               /* NOR, NAND flash, L2 switch and CPLD */
+               ranges = <0x0 0x0 0x0 0xec000000 0x04000000
+                         0x1 0x0 0x0 0xff800000 0x00040000
+                         0x2 0x0 0x0 0xffa00000 0x00020000
+                         0x3 0x0 0x0 0xffb00000 0x00020000>;
+
+               nor@0,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "cfi-flash";
+                       reg = <0x0 0x0 0x4000000>;
+                       bank-width = <2>;
+                       device-width = <1>;
+
+                       partition@0 {
+                               /* 128KB for DTB Image */
+                               reg = <0x0 0x00020000>;
+                               label = "NOR DTB Image";
+                       };
+
+                       partition@20000 {
+                               /* 3.875 MB for Linux Kernel Image */
+                               reg = <0x00020000 0x003e0000>;
+                               label = "NOR Linux Kernel Image";
+                       };
+
+                       partition@400000 {
+                               /* 58MB for Root file System */
+                               reg = <0x00400000 0x03a00000>;
+                               label = "NOR Root File System";
+                       };
+
+                       partition@3e00000 {
+                               /* This location must not be altered  */
+                               /* 1M for Vitesse 7385 Switch firmware */
+                               reg = <0x3e00000 0x00100000>;
+                               label = "NOR Vitesse-7385 Firmware";
+                               read-only;
+                       };
+
+                       partition@3f00000 {
+                               /* This location must not be altered  */
+                               /* 512KB for u-boot Bootloader Image */
+                               /* 512KB for u-boot Environment Variables */
+                               reg = <0x03f00000 0x00100000>;
+                               label = "NOR U-Boot Image";
+                               read-only;
+                       };
+               };
+
+               nand@1,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,p1020-fcm-nand",
+                                    "fsl,elbc-fcm-nand";
+                       reg = <0x1 0x0 0x40000>;
+
+                       partition@0 {
+                               /* This location must not be altered  */
+                               /* 1MB for u-boot Bootloader Image */
+                               reg = <0x0 0x00100000>;
+                               label = "NAND U-Boot Image";
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               /* 1MB for DTB Image */
+                               reg = <0x00100000 0x00100000>;
+                               label = "NAND DTB Image";
+                       };
+
+                       partition@200000 {
+                               /* 4MB for Linux Kernel Image */
+                               reg = <0x00200000 0x00400000>;
+                               label = "NAND Linux Kernel Image";
+                       };
+
+                       partition@600000 {
+                               /* 122MB for File System Image */
+                               reg = <0x00600000 0x07a00000>;
+                               label = "NAND File System Image";
+                       };
+               };
+
+               cpld@2,0 {
+                       compatible = "fsl,p1020rdb-pd-cpld";
+                       reg = <0x2 0x0 0x20000>;
+               };
+
+               L2switch@3,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "vitesse-7385";
+                       reg = <0x3 0x0 0x20000>;
+               };
+       };
+
+       soc: soc@ffe00000 {
+               ranges = <0x0 0x0 0xffe00000 0x100000>;
+
+               i2c@3000 {
+                       rtc@68 {
+                               compatible = "dallas,ds1339";
+                               reg = <0x68>;
+                       };
+               };
+
+               spi@7000 {
+                       flash@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "spansion,s25sl12801";
+                               reg = <0>;
+                               /* input clock */
+                               spi-max-frequency = <40000000>;
+
+                               partition@0 {
+                                       /* 512KB for u-boot Bootloader Image */
+                                       reg = <0x0 0x00080000>;
+                                       label = "SPI U-Boot Image";
+                                       read-only;
+                               };
+
+                               partition@80000 {
+                                       /* 512KB for DTB Image*/
+                                       reg = <0x00080000 0x00080000>;
+                                       label = "SPI DTB Image";
+                               };
+
+                               partition@100000 {
+                                       /* 4MB for Linux Kernel Image */
+                                       reg = <0x00100000 0x00400000>;
+                                       label = "SPI Linux Kernel Image";
+                               };
+
+                               partition@500000 {
+                                       /* 11MB for FS System Image */
+                                       reg = <0x00500000 0x00b00000>;
+                                       label = "SPI File System Image";
+                               };
+                       };
+
+                       slic@0 {
+                               compatible = "zarlink,le88266";
+                               reg = <1>;
+                               spi-max-frequency = <8000000>;
+                       };
+
+                       slic@1 {
+                               compatible = "zarlink,le88266";
+                               reg = <2>;
+                               spi-max-frequency = <8000000>;
+                       };
+               };
+
+               mdio@24000 {
+                       phy0: ethernet-phy@0 {
+                               interrupts = <3 1 0 0>;
+                               reg = <0x0>;
+                       };
+
+                       phy1: ethernet-phy@1 {
+                               interrupts = <2 1 0 0>;
+                               reg = <0x1>;
+                       };
+               };
+
+               mdio@25000 {
+                       tbi1: tbi-phy@11 {
+                               reg = <0x11>;
+                               device_type = "tbi-phy";
+                       };
+               };
+
+               mdio@26000 {
+                       tbi2: tbi-phy@11 {
+                               reg = <0x11>;
+                               device_type = "tbi-phy";
+                       };
+               };
+
+               enet0: ethernet@b0000 {
+                       fixed-link = <1 1 1000 0 0>;
+                       phy-connection-type = "rgmii-id";
+               };
+
+               enet1: ethernet@b1000 {
+                       phy-handle = <&phy0>;
+                       tbi-handle = <&tbi1>;
+                       phy-connection-type = "sgmii";
+               };
+
+               enet2: ethernet@b2000 {
+                       phy-handle = <&phy1>;
+                       phy-connection-type = "rgmii-id";
+               };
+
+               usb@22000 {
+                       phy_type = "ulpi";
+               };
+       };
+
+       pci0: pcie@ffe09000 {
+               reg = <0x0 0xffe09000 0x0 0x1000>;
+               ranges = <0x2000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x00000000 0x0 0xffc10000 0x0 0x10000>;
+               pcie@0 {
+                       ranges = <0x2000000 0x0 0xa0000000
+                                 0x2000000 0x0 0xa0000000
+                                 0x0 0x20000000
+
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
+               };
+       };
+
+       pci1: pcie@ffe0a000 {
+               reg = <0x0 0xffe0a000 0x0 0x1000>;
+               ranges = <0x2000000 0x0 0x80000000 0x0 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x00000000 0x0 0xffc00000 0x0 0x10000>;
+               pcie@0 {
+                       ranges = <0x2000000 0x0 0x80000000
+                                 0x2000000 0x0 0x80000000
+                                 0x0 0x20000000
+
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
+               };
+       };
+};
+
+/include/ "fsl/p1020si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p1023rdb.dts b/arch/powerpc/boot/dts/p1023rdb.dts
new file mode 100644 (file)
index 0000000..0a06a88
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+ * P1023 RDB Device Tree Source
+ *
+ *    Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Author: Chunhe Lan <Chunhe.Lan@freescale.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/include/ "fsl/p1023si-pre.dtsi"
+
+/ {
+       model = "fsl,P1023";
+       compatible = "fsl,P1023RDB";
+       #address-cells = <2>;
+       #size-cells = <2>;
+       interrupt-parent = <&mpic>;
+
+       memory {
+               device_type = "memory";
+       };
+
+       soc: soc@ff600000 {
+               ranges = <0x0 0x0 0xff600000 0x200000>;
+
+               i2c@3000 {
+                       eeprom@53 {
+                               compatible = "at24,24c04";
+                               reg = <0x53>;
+                       };
+
+                       rtc@6f {
+                               compatible = "microchip,mcp7941x";
+                               reg = <0x6f>;
+                       };
+               };
+
+               usb@22000 {
+                       dr_mode = "host";
+                       phy_type = "ulpi";
+               };
+       };
+
+       lbc: localbus@ff605000 {
+               reg = <0 0xff605000 0 0x1000>;
+
+               /* NOR, NAND Flashes */
+               ranges = <0x0 0x0 0x0 0xec000000 0x04000000
+                         0x1 0x0 0x0 0xffa00000 0x08000000>;
+
+               nor@0,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "cfi-flash";
+                       reg = <0x0 0x0 0x04000000>;
+                       bank-width = <2>;
+                       device-width = <1>;
+
+                       partition@0 {
+                               /* 48MB for Root File System */
+                               reg = <0x00000000 0x03000000>;
+                               label = "NOR Root File System";
+                       };
+
+                       partition@3000000 {
+                               /* 1MB for DTB Image */
+                               reg = <0x03000000 0x00100000>;
+                               label = "NOR DTB Image";
+                       };
+
+                       partition@3100000 {
+                               /* 14MB for Linux Kernel Image */
+                               reg = <0x03100000 0x00e00000>;
+                               label = "NOR Linux Kernel Image";
+                       };
+
+                       partition@3f00000 {
+                               /* This location must not be altered  */
+                               /* 512KB for u-boot Bootloader Image */
+                               /* 512KB for u-boot Environment Variables */
+                               reg = <0x03f00000 0x00100000>;
+                               label = "NOR U-Boot Image";
+                               read-only;
+                       };
+               };
+
+               nand@1,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,elbc-fcm-nand";
+                       reg = <0x1 0x0 0x40000>;
+
+                       partition@0 {
+                               /* This location must not be altered  */
+                               /* 1MB for u-boot Bootloader Image */
+                               reg = <0x0 0x00100000>;
+                               label = "NAND U-Boot Image";
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               /* 1MB for DTB Image */
+                               reg = <0x00100000 0x00100000>;
+                               label = "NAND DTB Image";
+                       };
+
+                       partition@200000 {
+                               /* 14MB for Linux Kernel Image */
+                               reg = <0x00200000 0x00e00000>;
+                               label = "NAND Linux Kernel Image";
+                       };
+
+                       partition@1000000 {
+                               /* 96MB for Root File System Image */
+                               reg = <0x01000000 0x06000000>;
+                               label = "NAND Root File System";
+                       };
+
+                       partition@7000000 {
+                               /* 16MB for User Writable Area */
+                               reg = <0x07000000 0x01000000>;
+                               label = "NAND Writable User area";
+                       };
+               };
+       };
+
+       pci0: pcie@ff60a000 {
+               reg = <0 0xff60a000 0 0x1000>;
+               ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
+                         0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
+               pcie@0 {
+                       /* IRQ[0:3] are pulled up on board, set to active-low */
+                       interrupt-map-mask = <0xf800 0 0 7>;
+                       interrupt-map = <
+                               /* IDSEL 0x0 */
+                               0000 0 0 1 &mpic 0 1 0 0
+                               0000 0 0 2 &mpic 1 1 0 0
+                               0000 0 0 3 &mpic 2 1 0 0
+                               0000 0 0 4 &mpic 3 1 0 0
+                               >;
+                       ranges = <0x2000000 0x0 0xc0000000
+                                 0x2000000 0x0 0xc0000000
+                                 0x0 0x20000000
+
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
+               };
+       };
+
+       board_pci1: pci1: pcie@ff609000 {
+               reg = <0 0xff609000 0 0x1000>;
+               ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
+               pcie@0 {
+                       /*
+                        * IRQ[4:6] only for PCIe, set to active-high,
+                        * IRQ[7] is pulled up on board, set to active-low
+                        */
+                       interrupt-map-mask = <0xf800 0 0 7>;
+                       interrupt-map = <
+                               /* IDSEL 0x0 */
+                               0000 0 0 1 &mpic 4 2 0 0
+                               0000 0 0 2 &mpic 5 2 0 0
+                               0000 0 0 3 &mpic 6 2 0 0
+                               0000 0 0 4 &mpic 7 1 0 0
+                               >;
+                       ranges = <0x2000000 0x0 0xa0000000
+                                 0x2000000 0x0 0xa0000000
+                                 0x0 0x20000000
+
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
+               };
+       };
+
+       pci2: pcie@ff60b000 {
+               reg = <0 0xff60b000 0 0x1000>;
+               ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
+               pcie@0 {
+                       /*
+                        * IRQ[8:10] are pulled up on board, set to active-low
+                        * IRQ[11] only for PCIe, set to active-high,
+                        */
+                       interrupt-map-mask = <0xf800 0 0 7>;
+                       interrupt-map = <
+                               /* IDSEL 0x0 */
+                               0000 0 0 1 &mpic 8 1 0 0
+                               0000 0 0 2 &mpic 9 1 0 0
+                               0000 0 0 3 &mpic 10 1 0 0
+                               0000 0 0 4 &mpic 11 2 0 0
+                               >;
+                       ranges = <0x2000000 0x0 0x80000000
+                                 0x2000000 0x0 0x80000000
+                                 0x0 0x20000000
+
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
+               };
+       };
+
+};
+
+/include/ "fsl/p1023si-post.dtsi"
index 7433740..871c16d 100644 (file)
@@ -13,7 +13,7 @@
  * option) any later version.
  */
 
-/include/ "mpc5121.dtsi"
+#include <mpc5121.dtsi>
 
 / {
        model = "pdm360ng";
index 1c2c281..eb0e98b 100644 (file)
@@ -59,4 +59,7 @@
 #define        r30     30
 #define        r31     31
 
+#define SPRN_TBRL      268
+#define SPRN_TBRU      269
+
 #endif /* _PPC64_PPC_ASM_H */
index 427ddfc..5143228 100644 (file)
@@ -71,18 +71,18 @@ udelay:
        add     r4,r4,r5
        addi    r4,r4,-1
        divw    r4,r4,r5        /* BUS ticks */
-1:     mftbu   r5
-       mftb    r6
-       mftbu   r7
+1:     mfspr   r5, SPRN_TBRU
+       mfspr   r6, SPRN_TBRL
+       mfspr   r7, SPRN_TBRU
        cmpw    0,r5,r7
        bne     1b              /* Get [synced] base time */
        addc    r9,r6,r4        /* Compute end time */
        addze   r8,r5
-2:     mftbu   r5
+2:     mfspr   r5, SPRN_TBRU
        cmpw    0,r5,r8
        blt     2b
        bgt     3f
-       mftb    r6
+       mfspr   r6, SPRN_TBRL
        cmpw    0,r6,r9
        blt     2b
 3:     blr
similarity index 87%
rename from arch/powerpc/configs/85xx/p1023rds_defconfig
rename to arch/powerpc/configs/85xx/p1023_defconfig
index b80bcc6..b06d37d 100644 (file)
@@ -1,14 +1,13 @@
 CONFIG_PPC_85xx=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
-CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_AUDIT=y
-CONFIG_IRQ_DOMAIN_DEBUG=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_RCU_FANOUT=32
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -22,6 +21,8 @@ CONFIG_MODVERSIONS=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_MAC_PARTITION=y
+CONFIG_PHYSICAL_START=0x00000000
+CONFIG_P1023_RDB=y
 CONFIG_P1023_RDS=y
 CONFIG_QUICC_ENGINE=y
 CONFIG_QE_GPIO=y
@@ -63,10 +64,21 @@ CONFIG_IPV6=y
 CONFIG_IP_SCTP=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_FSL_ELBC=y
 CONFIG_PROC_DEVICETREE=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=131072
+CONFIG_EEPROM_AT24=y
 CONFIG_EEPROM_LEGACY=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=y
@@ -82,6 +94,8 @@ CONFIG_DUMMY=y
 CONFIG_FS_ENET=y
 CONFIG_FSL_PQ_MDIO=y
 CONFIG_E1000E=y
+CONFIG_PHYLIB=y
+CONFIG_AT803X_PHY=y
 CONFIG_MARVELL_PHY=y
 CONFIG_DAVICOM_PHY=y
 CONFIG_CICADA_PHY=y
@@ -96,12 +110,15 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=2
 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_8250_DETECT_IRQ=y
 CONFIG_SERIAL_8250_RSA=y
-CONFIG_SERIAL_QE=m
+CONFIG_HW_RANDOM=y
 CONFIG_NVRAM=y
 CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_CPM=m
 CONFIG_I2C_MPC=y
 CONFIG_GPIO_MPC8XXX=y
@@ -121,6 +138,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_EDAC=y
 CONFIG_EDAC_MM_EDAC=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_CMOS=y
 CONFIG_DMADEVICES=y
 CONFIG_FSL_DMA=y
@@ -161,6 +179,7 @@ CONFIG_DEBUG_FS=y
 CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_DEBUG_INFO=y
+CONFIG_STRICT_DEVMEM=y
 CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
index 60027c2..3dfab4c 100644 (file)
@@ -70,6 +70,7 @@ CONFIG_IPV6=y
 CONFIG_IP_SCTP=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_CHAR=y
index 6c8b020..fa94fb3 100644 (file)
@@ -27,6 +27,8 @@ CONFIG_P5040_DS=y
 CONFIG_T4240_QDS=y
 # CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_MATH_EMULATION=y
+CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED=y
 CONFIG_FSL_IFC=y
 CONFIG_PCIEPORTBUS=y
 CONFIG_PCI_MSI=y
@@ -59,6 +61,7 @@ CONFIG_IPV6=y
 CONFIG_IP_SCTP=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_PARTITIONS=y
 CONFIG_MTD_OF_PARTS=y
index 09116c6..23fec79 100644 (file)
@@ -42,6 +42,7 @@ CONFIG_INET_ESP=y
 # CONFIG_IPV6 is not set
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_FW_LOADER is not set
 CONFIG_MTD=y
 CONFIG_MTD_CHAR=y
index 5a58882..dc098d9 100644 (file)
@@ -27,6 +27,7 @@ CONFIG_MPC85xx_MDS=y
 CONFIG_MPC8536_DS=y
 CONFIG_MPC85xx_DS=y
 CONFIG_MPC85xx_RDB=y
+CONFIG_C293_PCIE=y
 CONFIG_P1010_RDB=y
 CONFIG_P1022_DS=y
 CONFIG_P1022_RDK=y
@@ -78,6 +79,7 @@ CONFIG_IPV6=y
 CONFIG_IP_SCTP=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_PARTITIONS=y
 CONFIG_MTD_OF_PARTS=y
index 152fa05..5bca601 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_MPC85xx_MDS=y
 CONFIG_MPC8536_DS=y
 CONFIG_MPC85xx_DS=y
 CONFIG_MPC85xx_RDB=y
+CONFIG_C293_PCIE=y
 CONFIG_P1010_RDB=y
 CONFIG_P1022_DS=y
 CONFIG_P1022_RDK=y
@@ -81,6 +82,7 @@ CONFIG_IPV6=y
 CONFIG_IP_SCTP=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_PARTITIONS=y
 CONFIG_MTD_OF_PARTS=y
index 6e82f5f..4b237aa 100644 (file)
 #define PPC_MTOCRF(FXM, RS) MTOCRF((FXM), RS)
 #define PPC_LR_STKOFF  16
 #define PPC_MIN_STKFRM 112
+
+#ifdef __BIG_ENDIAN__
+#define LDX_BE stringify_in_c(ldx)
+#define STDX_BE        stringify_in_c(stdx)
+#else
+#define LDX_BE stringify_in_c(ldbrx)
+#define STDX_BE        stringify_in_c(stdbrx)
+#endif
+
 #else /* 32-bit */
 
 /* operations for longs and pointers */
index 906f46e..89fc382 100644 (file)
@@ -13,6 +13,7 @@ extern void btext_update_display(unsigned long phys, int width, int height,
 extern void btext_setup_display(int width, int height, int depth, int pitch,
                                unsigned long address);
 extern void btext_prepare_BAT(void);
+extern void btext_map(void);
 extern void btext_unmap(void);
 
 extern void btext_drawchar(char c);
index b843e35..5b93122 100644 (file)
@@ -32,13 +32,7 @@ extern void flush_dcache_page(struct page *page);
 
 extern void __flush_disable_L1(void);
 
-extern void __flush_icache_range(unsigned long, unsigned long);
-static inline void flush_icache_range(unsigned long start, unsigned long stop)
-{
-       if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
-               __flush_icache_range(start, stop);
-}
-
+extern void flush_icache_range(unsigned long, unsigned long);
 extern void flush_icache_user_range(struct vm_area_struct *vma,
                                    struct page *page, unsigned long addr,
                                    int len);
index 6f3887d..0d4939b 100644 (file)
@@ -371,14 +371,19 @@ extern const char *powerpc_base_platform;
 #define CPU_FTRS_E500MC        (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
            CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
            CPU_FTR_DBELL | CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV)
+/*
+ * e5500/e6500 erratum A-006958 is a timebase bug that can use the
+ * same workaround as CPU_FTR_CELL_TB_BUG.
+ */
 #define CPU_FTRS_E5500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
            CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
            CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
-           CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV)
+           CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_CELL_TB_BUG)
 #define CPU_FTRS_E6500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \
            CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \
            CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
-           CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP)
+           CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \
+           CPU_FTR_CELL_TB_BUG)
 #define CPU_FTRS_GENERIC_32    (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
 
 /* 64-bit CPUs */
index 63f2a22..5a8b82a 100644 (file)
@@ -46,8 +46,6 @@ extern struct ppc_emulated {
        struct ppc_emulated_entry unaligned;
 #ifdef CONFIG_MATH_EMULATION
        struct ppc_emulated_entry math;
-#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
-       struct ppc_emulated_entry 8xx;
 #endif
 #ifdef CONFIG_VSX
        struct ppc_emulated_entry vsx;
index d3d6342..86b0ac7 100644 (file)
 extern bool epapr_paravirt_enabled;
 extern u32 epapr_hypercall_start[];
 
+#ifdef CONFIG_EPAPR_PARAVIRT
+int __init epapr_paravirt_early_init(void);
+#else
+static inline int epapr_paravirt_early_init(void) { return 0; }
+#endif
+
 /*
  * We use "uintptr_t" to define a register because it's guaranteed to be a
  * 32-bit integer on a 32-bit platform, and a 64-bit integer on a 64-bit
index 07ca627..cca12f0 100644 (file)
 #define EX_LR          72
 #define EX_CFAR                80
 #define EX_PPR         88      /* SMT thread status register (priority) */
+#define EX_CTR         96
 
 #ifdef CONFIG_RELOCATABLE
 #define __EXCEPTION_RELON_PROLOG_PSERIES_1(label, h)                   \
        ld      r12,PACAKBASE(r13);     /* get high part of &label */   \
        mfspr   r11,SPRN_##h##SRR0;     /* save SRR0 */                 \
        LOAD_HANDLER(r12,label);                                        \
-       mtlr    r12;                                                    \
+       mtctr   r12;                                                    \
        mfspr   r12,SPRN_##h##SRR1;     /* and SRR1 */                  \
        li      r10,MSR_RI;                                             \
        mtmsrd  r10,1;                  /* Set RI (EE=0) */             \
-       blr;
+       bctr;
 #else
 /* If not relocatable, we can jump directly -- and save messing with LR */
 #define __EXCEPTION_RELON_PROLOG_PSERIES_1(label, h)                   \
 
 #if defined(CONFIG_RELOCATABLE)
 /*
- * If we support interrupts with relocation on AND we're a relocatable
- * kernel, we need to use LR to get to the 2nd level handler.  So, save/restore
- * it when required.
+ * If we support interrupts with relocation on AND we're a relocatable kernel,
+ * we need to use CTR to get to the 2nd level handler.  So, save/restore it
+ * when required.
  */
-#define SAVE_LR(reg, area)     mflr    reg ;   std     reg,area+EX_LR(r13)
-#define GET_LR(reg, area)                      ld      reg,area+EX_LR(r13)
-#define RESTORE_LR(reg, area)  ld      reg,area+EX_LR(r13) ; mtlr reg
+#define SAVE_CTR(reg, area)    mfctr   reg ;   std     reg,area+EX_CTR(r13)
+#define GET_CTR(reg, area)                     ld      reg,area+EX_CTR(r13)
+#define RESTORE_CTR(reg, area) ld      reg,area+EX_CTR(r13) ; mtctr reg
 #else
-/* ...else LR is unused and in register. */
-#define SAVE_LR(reg, area)
-#define GET_LR(reg, area)      mflr    reg
-#define RESTORE_LR(reg, area)
+/* ...else CTR is unused and in register. */
+#define SAVE_CTR(reg, area)
+#define GET_CTR(reg, area)     mfctr   reg
+#define RESTORE_CTR(reg, area)
 #endif
 
 /*
@@ -164,7 +165,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
 #define __EXCEPTION_PROLOG_1(area, extra, vec)                         \
        OPT_SAVE_REG_TO_PACA(area+EX_PPR, r9, CPU_FTR_HAS_PPR);         \
        OPT_SAVE_REG_TO_PACA(area+EX_CFAR, r10, CPU_FTR_CFAR);          \
-       SAVE_LR(r10, area);                                             \
+       SAVE_CTR(r10, area);                                            \
        mfcr    r9;                                                     \
        extra(vec);                                                     \
        std     r11,area+EX_R11(r13);                                   \
@@ -270,7 +271,7 @@ do_kvm_##n:                                                         \
        sth     r1,PACA_TRAP_SAVE(r13);                                    \
        std     r3,area+EX_R3(r13);                                        \
        addi    r3,r13,area;            /* r3 -> where regs are saved*/    \
-       RESTORE_LR(r1, area);                                              \
+       RESTORE_CTR(r1, area);                                             \
        b       bad_stack;                                                 \
 3:     std     r9,_CCR(r1);            /* save CR in stackframe        */ \
        std     r11,_NIP(r1);           /* save SRR0 in stackframe      */ \
@@ -298,10 +299,10 @@ do_kvm_##n:                                                               \
        ld      r10,area+EX_CFAR(r13);                                     \
        std     r10,ORIG_GPR3(r1);                                         \
        END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66);            \
-       GET_LR(r9,area);                /* Get LR, later save to stack  */ \
+       mflr    r9;                     /* Get LR, later save to stack  */ \
        ld      r2,PACATOC(r13);        /* get kernel TOC into r2       */ \
        std     r9,_LINK(r1);                                              \
-       mfctr   r10;                    /* save CTR in stackframe       */ \
+       GET_CTR(r10, area);                                                \
        std     r10,_CTR(r1);                                              \
        lbz     r10,PACASOFTIRQEN(r13);                            \
        mfspr   r11,SPRN_XER;           /* save XER in stackframe       */ \
@@ -479,7 +480,7 @@ label##_relon_hv:                                                   \
  */
 
 /* Exception addition: Hard disable interrupts */
-#define DISABLE_INTS   SOFT_DISABLE_INTS(r10,r11)
+#define DISABLE_INTS   RECONCILE_IRQ_STATE(r10,r11)
 
 #define ADD_NVGPRS                             \
        bl      .save_nvgprs
index dd15e5e..5a64757 100644 (file)
@@ -69,8 +69,18 @@ extern unsigned long pci_dram_offset;
 
 extern resource_size_t isa_mem_base;
 
-#if defined(CONFIG_PPC32) && defined(CONFIG_PPC_INDIRECT_IO)
-#error CONFIG_PPC_INDIRECT_IO is not yet supported on 32 bits
+/* Boolean set by platform if PIO accesses are suppored while _IO_BASE
+ * is not set or addresses cannot be translated to MMIO. This is typically
+ * set when the platform supports "special" PIO accesses via a non memory
+ * mapped mechanism, and allows things like the early udbg UART code to
+ * function.
+ */
+extern bool isa_io_special;
+
+#ifdef CONFIG_PPC32
+#if defined(CONFIG_PPC_INDIRECT_PIO) || defined(CONFIG_PPC_INDIRECT_MMIO)
+#error CONFIG_PPC_INDIRECT_{PIO,MMIO} are not yet supported on 32 bits
+#endif
 #endif
 
 /*
@@ -222,9 +232,9 @@ extern void _memcpy_toio(volatile void __iomem *dest, const void *src,
  * for PowerPC is as close as possible to the x86 version of these, and thus
  * provides fairly heavy weight barriers for the non-raw versions
  *
- * In addition, they support a hook mechanism when CONFIG_PPC_INDIRECT_IO
- * allowing the platform to provide its own implementation of some or all
- * of the accessors.
+ * In addition, they support a hook mechanism when CONFIG_PPC_INDIRECT_MMIO
+ * or CONFIG_PPC_INDIRECT_PIO are set allowing the platform to provide its
+ * own implementation of some or all of the accessors.
  */
 
 /*
@@ -240,8 +250,8 @@ extern void _memcpy_toio(volatile void __iomem *dest, const void *src,
 
 /* Indirect IO address tokens:
  *
- * When CONFIG_PPC_INDIRECT_IO is set, the platform can provide hooks
- * on all IOs. (Note that this is all 64 bits only for now)
+ * When CONFIG_PPC_INDIRECT_MMIO is set, the platform can provide hooks
+ * on all MMIOs. (Note that this is all 64 bits only for now)
  *
  * To help platforms who may need to differenciate MMIO addresses in
  * their hooks, a bitfield is reserved for use by the platform near the
@@ -263,11 +273,14 @@ extern void _memcpy_toio(volatile void __iomem *dest, const void *src,
  *
  * The direct IO mapping operations will then mask off those bits
  * before doing the actual access, though that only happen when
- * CONFIG_PPC_INDIRECT_IO is set, thus be careful when you use that
+ * CONFIG_PPC_INDIRECT_MMIO is set, thus be careful when you use that
  * mechanism
+ *
+ * For PIO, there is a separate CONFIG_PPC_INDIRECT_PIO which makes
+ * all PIO functions call through a hook.
  */
 
-#ifdef CONFIG_PPC_INDIRECT_IO
+#ifdef CONFIG_PPC_INDIRECT_MMIO
 #define PCI_IO_IND_TOKEN_MASK  0x0fff000000000000ul
 #define PCI_IO_IND_TOKEN_SHIFT 48
 #define PCI_FIX_ADDR(addr)                                             \
@@ -672,7 +685,7 @@ extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea,
 extern void __iounmap_at(void *ea, unsigned long size);
 
 /*
- * When CONFIG_PPC_INDIRECT_IO is set, we use the generic iomap implementation
+ * When CONFIG_PPC_INDIRECT_PIO is set, we use the generic iomap implementation
  * which needs some additional definitions here. They basically allow PIO
  * space overall to be 1GB. This will work as long as we never try to use
  * iomap to map MMIO below 1GB which should be fine on ppc64
index 6f9b6e2..f51a558 100644 (file)
 #define TRACE_DISABLE_INTS     TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off)
 
 /*
- * This is used by assembly code to soft-disable interrupts
+ * This is used by assembly code to soft-disable interrupts first and
+ * reconcile irq state.
  */
-#define SOFT_DISABLE_INTS(__rA, __rB)          \
+#define RECONCILE_IRQ_STATE(__rA, __rB)                \
        lbz     __rA,PACASOFTIRQEN(r13);        \
        lbz     __rB,PACAIRQHAPPENED(r13);      \
        cmpwi   cr0,__rA,0;                     \
@@ -58,7 +59,7 @@
 #define TRACE_ENABLE_INTS
 #define TRACE_DISABLE_INTS
 
-#define SOFT_DISABLE_INTS(__rA, __rB)          \
+#define RECONCILE_IRQ_STATE(__rA, __rB)                \
        lbz     __rA,PACAIRQHAPPENED(r13);      \
        li      __rB,0;                         \
        ori     __rA,__rA,PACA_IRQ_HARD_DIS;    \
index 9b12f88..4470d1e 100644 (file)
 struct lppaca {
        /* cacheline 1 contains read-only data */
 
-       u32     desc;                   /* Eye catcher 0xD397D781 */
-       u16     size;                   /* Size of this struct */
-       u16     reserved1;
-       u16     reserved2:14;
-       u8      shared_proc:1;          /* Shared processor indicator */
-       u8      secondary_thread:1;     /* Secondary thread indicator */
+       __be32  desc;                   /* Eye catcher 0xD397D781 */
+       __be16  size;                   /* Size of this struct */
+       u8      reserved1[3];
+       u8      __old_status;           /* Old status, including shared proc */
        u8      reserved3[14];
-       volatile u32 dyn_hw_node_id;    /* Dynamic hardware node id */
-       volatile u32 dyn_hw_proc_id;    /* Dynamic hardware proc id */
+       volatile __be32 dyn_hw_node_id; /* Dynamic hardware node id */
+       volatile __be32 dyn_hw_proc_id; /* Dynamic hardware proc id */
        u8      reserved4[56];
        volatile u8 vphn_assoc_counts[8]; /* Virtual processor home node */
                                          /* associativity change counters */
@@ -73,9 +71,9 @@ struct lppaca {
        u8      fpregs_in_use;
        u8      pmcregs_in_use;
        u8      reserved8[28];
-       u64     wait_state_cycles;      /* Wait cycles for this proc */
+       __be64  wait_state_cycles;      /* Wait cycles for this proc */
        u8      reserved9[28];
-       u16     slb_count;              /* # of SLBs to maintain */
+       __be16  slb_count;              /* # of SLBs to maintain */
        u8      idle;                   /* Indicate OS is idle */
        u8      vmxregs_in_use;
 
@@ -89,17 +87,17 @@ struct lppaca {
         * NOTE: This value will ALWAYS be zero for dedicated processors and
         * will NEVER be zero for shared processors (ie, initialized to a 1).
         */
-       volatile u32 yield_count;
-       volatile u32 dispersion_count;  /* dispatch changed physical cpu */
-       volatile u64 cmo_faults;        /* CMO page fault count */
-       volatile u64 cmo_fault_time;    /* CMO page fault time */
+       volatile __be32 yield_count;
+       volatile __be32 dispersion_count; /* dispatch changed physical cpu */
+       volatile __be64 cmo_faults;     /* CMO page fault count */
+       volatile __be64 cmo_fault_time; /* CMO page fault time */
        u8      reserved10[104];
 
        /* cacheline 4-5 */
 
-       u32     page_ins;               /* CMO Hint - # page ins by OS */
+       __be32  page_ins;               /* CMO Hint - # page ins by OS */
        u8      reserved11[148];
-       volatile u64 dtl_idx;           /* Dispatch Trace Log head index */
+       volatile __be64 dtl_idx;                /* Dispatch Trace Log head index */
        u8      reserved12[96];
 } __attribute__((__aligned__(0x400)));
 
@@ -108,17 +106,29 @@ extern struct lppaca lppaca[];
 #define lppaca_of(cpu) (*paca[cpu].lppaca_ptr)
 
 /*
+ * Old kernels used a reserved bit in the VPA to determine if it was running
+ * in shared processor mode. New kernels look for a non zero yield count
+ * but KVM still needs to set the bit to keep the old stuff happy.
+ */
+#define LPPACA_OLD_SHARED_PROC         2
+
+static inline bool lppaca_shared_proc(struct lppaca *l)
+{
+       return l->yield_count != 0;
+}
+
+/*
  * SLB shadow buffer structure as defined in the PAPR.  The save_area
  * contains adjacent ESID and VSID pairs for each shadowed SLB.  The
  * ESID is stored in the lower 64bits, then the VSID.
  */
 struct slb_shadow {
-       u32     persistent;             /* Number of persistent SLBs */
-       u32     buffer_length;          /* Total shadow buffer length */
-       u64     reserved;
+       __be32  persistent;             /* Number of persistent SLBs */
+       __be32  buffer_length;          /* Total shadow buffer length */
+       __be64  reserved;
        struct  {
-               u64     esid;
-               u64     vsid;
+               __be64     esid;
+               __be64  vsid;
        } save_area[SLB_NUM_BOLTED];
 } ____cacheline_aligned;
 
@@ -130,14 +140,14 @@ extern struct slb_shadow slb_shadow[];
 struct dtl_entry {
        u8      dispatch_reason;
        u8      preempt_reason;
-       u16     processor_id;
-       u32     enqueue_to_dispatch_time;
-       u32     ready_to_enqueue_time;
-       u32     waiting_to_ready_time;
-       u64     timebase;
-       u64     fault_addr;
-       u64     srr0;
-       u64     srr1;
+       __be16  processor_id;
+       __be32  enqueue_to_dispatch_time;
+       __be32  ready_to_enqueue_time;
+       __be32  waiting_to_ready_time;
+       __be64  timebase;
+       __be64  fault_addr;
+       __be64  srr0;
+       __be64  srr1;
 };
 
 #define DISPATCH_LOG_BYTES     4096    /* bytes per cpu */
index 8ae133e..887d3d6 100644 (file)
@@ -32,25 +32,11 @@ struct mpc512x_ccm {
        u32     scfr2;  /* System Clock Frequency Register 2 */
        u32     scfr2s; /* System Clock Frequency Shadow Register 2 */
        u32     bcr;    /* Bread Crumb Register */
-       u32     p0ccr;  /* PSC0 Clock Control Register */
-       u32     p1ccr;  /* PSC1 CCR */
-       u32     p2ccr;  /* PSC2 CCR */
-       u32     p3ccr;  /* PSC3 CCR */
-       u32     p4ccr;  /* PSC4 CCR */
-       u32     p5ccr;  /* PSC5 CCR */
-       u32     p6ccr;  /* PSC6 CCR */
-       u32     p7ccr;  /* PSC7 CCR */
-       u32     p8ccr;  /* PSC8 CCR */
-       u32     p9ccr;  /* PSC9 CCR */
-       u32     p10ccr; /* PSC10 CCR */
-       u32     p11ccr; /* PSC11 CCR */
+       u32     psc_ccr[12];    /* PSC Clock Control Registers */
        u32     spccr;  /* SPDIF Clock Control Register */
        u32     cccr;   /* CFM Clock Control Register */
        u32     dccr;   /* DIU Clock Control Register */
-       u32     m1ccr;  /* MSCAN1 CCR */
-       u32     m2ccr;  /* MSCAN2 CCR */
-       u32     m3ccr;  /* MSCAN3 CCR */
-       u32     m4ccr;  /* MSCAN4 CCR */
+       u32     mscan_ccr[4];   /* MSCAN Clock Control Registers */
        u8      res[0x98]; /* Reserved */
 };
 
diff --git a/arch/powerpc/include/asm/mpc85xx.h b/arch/powerpc/include/asm/mpc85xx.h
new file mode 100644 (file)
index 0000000..736d4ac
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * MPC85xx cpu type detection
+ *
+ * Copyright 2011-2012 Freescale Semiconductor, Inc.
+ *
+ * This 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 __ASM_PPC_MPC85XX_H
+#define __ASM_PPC_MPC85XX_H
+
+#define SVR_REV(svr)   ((svr) & 0xFF)          /* SOC design resision */
+#define SVR_MAJ(svr)   (((svr) >>  4) & 0xF)   /* Major revision field*/
+#define SVR_MIN(svr)   (((svr) >>  0) & 0xF)   /* Minor revision field*/
+
+/* Some parts define SVR[0:23] as the SOC version */
+#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFF7FF)     /* SOC Version fields */
+
+#define SVR_8533       0x803400
+#define SVR_8535       0x803701
+#define SVR_8536       0x803700
+#define SVR_8540       0x803000
+#define SVR_8541       0x807200
+#define SVR_8543       0x803200
+#define SVR_8544       0x803401
+#define SVR_8545       0x803102
+#define SVR_8547       0x803101
+#define SVR_8548       0x803100
+#define SVR_8555       0x807100
+#define SVR_8560       0x807000
+#define SVR_8567       0x807501
+#define SVR_8568       0x807500
+#define SVR_8569       0x808000
+#define SVR_8572       0x80E000
+#define SVR_P1010      0x80F100
+#define SVR_P1011      0x80E500
+#define SVR_P1012      0x80E501
+#define SVR_P1013      0x80E700
+#define SVR_P1014      0x80F101
+#define SVR_P1017      0x80F700
+#define SVR_P1020      0x80E400
+#define SVR_P1021      0x80E401
+#define SVR_P1022      0x80E600
+#define SVR_P1023      0x80F600
+#define SVR_P1024      0x80E402
+#define SVR_P1025      0x80E403
+#define SVR_P2010      0x80E300
+#define SVR_P2020      0x80E200
+#define SVR_P2040      0x821000
+#define SVR_P2041      0x821001
+#define SVR_P3041      0x821103
+#define SVR_P4040      0x820100
+#define SVR_P4080      0x820000
+#define SVR_P5010      0x822100
+#define SVR_P5020      0x822000
+#define SVR_P5021      0X820500
+#define SVR_P5040      0x820400
+#define SVR_T4240      0x824000
+#define SVR_T4120      0x824001
+#define SVR_T4160      0x824100
+#define SVR_C291       0x850000
+#define SVR_C292       0x850020
+#define SVR_C293       0x850030
+#define SVR_B4860      0X868000
+#define SVR_G4860      0x868001
+#define SVR_G4060      0x868003
+#define SVR_B4440      0x868100
+#define SVR_G4440      0x868101
+#define SVR_B4420      0x868102
+#define SVR_B4220      0x868103
+#define SVR_T1040      0x852000
+#define SVR_T1041      0x852001
+#define SVR_T1042      0x852002
+#define SVR_T1020      0x852100
+#define SVR_T1021      0x852101
+#define SVR_T1022      0x852102
+
+#define SVR_8610       0x80A000
+#define SVR_8641       0x809000
+#define SVR_8641D      0x809001
+
+#define SVR_9130       0x860001
+#define SVR_9131       0x860000
+#define SVR_9132       0x861000
+#define SVR_9232       0x861400
+
+#define SVR_Unknown    0xFFFFFF
+
+#endif
index 4a1ac9f..754f93d 100644 (file)
@@ -396,7 +396,14 @@ extern struct bus_type mpic_subsys;
 #define        MPIC_REGSET_TSI108              MPIC_REGSET(1)  /* Tsi108/109 PIC */
 
 /* Get the version of primary MPIC */
+#ifdef CONFIG_MPIC
 extern u32 fsl_mpic_primary_get_version(void);
+#else
+static inline u32 fsl_mpic_primary_get_version(void)
+{
+       return 0;
+}
+#endif
 
 /* Allocate the controller structure and setup the linux irq descs
  * for the range if interrupts passed in. No HW initialization is
index 029fe85..c5cd728 100644 (file)
@@ -124,6 +124,11 @@ extern int opal_enter_rtas(struct rtas_args *args,
 #define OPAL_PCI_POLL                          62
 #define OPAL_PCI_MSI_EOI                       63
 #define OPAL_PCI_GET_PHB_DIAG_DATA2            64
+#define OPAL_XSCOM_READ                                65
+#define OPAL_XSCOM_WRITE                       66
+#define OPAL_LPC_READ                          67
+#define OPAL_LPC_WRITE                         68
+#define OPAL_RETURN_CPU                                69
 
 #ifndef __ASSEMBLY__
 
@@ -337,6 +342,17 @@ enum OpalEpowStatus {
        OPAL_EPOW_OVER_INTERNAL_TEMP = 3
 };
 
+/*
+ * Address cycle types for LPC accesses. These also correspond
+ * to the content of the first cell of the "reg" property for
+ * device nodes on the LPC bus
+ */
+enum OpalLPCAddressType {
+       OPAL_LPC_MEM    = 0,
+       OPAL_LPC_IO     = 1,
+       OPAL_LPC_FW     = 2,
+};
+
 struct opal_machine_check_event {
        enum OpalMCE_Version    version:8;      /* 0x00 */
        uint8_t                 in_use;         /* 0x01 */
@@ -631,6 +647,15 @@ int64_t opal_set_system_attention_led(uint8_t led_action);
 int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe,
                            uint16_t *pci_error_type, uint16_t *severity);
 int64_t opal_pci_poll(uint64_t phb_id);
+int64_t opal_return_cpu(void);
+
+int64_t opal_xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val);
+int64_t opal_xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val);
+
+int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type,
+                      uint32_t addr, uint32_t data, uint32_t sz);
+int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type,
+                     uint32_t addr, uint32_t *data, uint32_t sz);
 
 /* Internal functions */
 extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data);
@@ -664,6 +689,8 @@ extern int opal_machine_check(struct pt_regs *regs);
 
 extern void opal_shutdown(void);
 
+extern void opal_lpc_init(void);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __OPAL_H */
index 77c91e7..a5954ce 100644 (file)
@@ -68,8 +68,13 @@ struct paca_struct {
         * instruction.  They must travel together and be properly
         * aligned.
         */
+#ifdef __BIG_ENDIAN__
        u16 lock_token;                 /* Constant 0x8000, used in locks */
        u16 paca_index;                 /* Logical processor number */
+#else
+       u16 paca_index;                 /* Logical processor number */
+       u16 lock_token;                 /* Constant 0x8000, used in locks */
+#endif
 
        u64 kernel_toc;                 /* Kernel TOC address */
        u64 kernelbase;                 /* Base address of kernel */
@@ -93,9 +98,9 @@ struct paca_struct {
         * Now, starting in cacheline 2, the exception save areas
         */
        /* used for most interrupts/exceptions */
-       u64 exgen[12] __attribute__((aligned(0x80)));
-       u64 exmc[12];           /* used for machine checks */
-       u64 exslb[12];          /* used for SLB/segment table misses
+       u64 exgen[13] __attribute__((aligned(0x80)));
+       u64 exmc[13];           /* used for machine checks */
+       u64 exslb[13];          /* used for SLB/segment table misses
                                 * on the linear mapping */
        /* SLB related definitions */
        u16 vmalloc_sllp;
index 32d0d20..4ca90a3 100644 (file)
@@ -159,7 +159,7 @@ struct pci_dn {
 
        int     pci_ext_config_space;   /* for pci devices */
 
-       int     force_32bit_msi:1;
+       bool    force_32bit_msi;
 
        struct  pci_dev *pcidev;        /* back-pointer to the pci device */
 #ifdef CONFIG_EEH
index 6653f27..95145a1 100644 (file)
@@ -113,11 +113,6 @@ extern int pci_domain_nr(struct pci_bus *bus);
 /* Decide whether to display the domain number in /proc */
 extern int pci_proc_domain(struct pci_bus *bus);
 
-/* MSI arch hooks */
-#define arch_setup_msi_irqs arch_setup_msi_irqs
-#define arch_teardown_msi_irqs arch_teardown_msi_irqs
-#define arch_msi_check_device arch_msi_check_device
-
 struct vm_area_struct;
 /* Map a range of PCI memory or I/O space for a device into user space */
 int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
index 718a9fa..a581654 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/types.h>
 #include <asm/hw_irq.h>
 
-#define MAX_HWEVENTS 4
+#define MAX_HWEVENTS 6
 
 /* event flags */
 #define FSL_EMB_EVENT_VALID      1
similarity index 90%
rename from arch/powerpc/platforms/pseries/plpar_wrappers.h
rename to arch/powerpc/include/asm/plpar_wrappers.h
index f35787b..a63b045 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _PSERIES_PLPAR_WRAPPERS_H
-#define _PSERIES_PLPAR_WRAPPERS_H
+#ifndef _ASM_POWERPC_PLPAR_WRAPPERS_H
+#define _ASM_POWERPC_PLPAR_WRAPPERS_H
 
 #include <linux/string.h>
 #include <linux/irqflags.h>
@@ -256,30 +256,6 @@ static inline long plpar_tce_stuff(unsigned long liobn, unsigned long ioba,
        return plpar_hcall_norets(H_STUFF_TCE, liobn, ioba, tceval, count);
 }
 
-static inline long plpar_get_term_char(unsigned long termno,
-               unsigned long *len_ret, char *buf_ret)
-{
-       long rc;
-       unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
-       unsigned long *lbuf = (unsigned long *)buf_ret; /* TODO: alignment? */
-
-       rc = plpar_hcall(H_GET_TERM_CHAR, retbuf, termno);
-
-       *len_ret = retbuf[0];
-       lbuf[0] = retbuf[1];
-       lbuf[1] = retbuf[2];
-
-       return rc;
-}
-
-static inline long plpar_put_term_char(unsigned long termno, unsigned long len,
-               const char *buffer)
-{
-       unsigned long *lbuf = (unsigned long *)buffer;  /* TODO: alignment? */
-       return plpar_hcall_norets(H_PUT_TERM_CHAR, termno, len, lbuf[0],
-                       lbuf[1]);
-}
-
 /* Set various resource mode parameters */
 static inline long plpar_set_mode(unsigned long mflags, unsigned long resource,
                unsigned long value1, unsigned long value2)
@@ -321,4 +297,4 @@ static inline long plapr_set_watchpoint0(unsigned long dawr0, unsigned long dawr
        return plpar_set_mode(0, 2, dawr0, dawrx0);
 }
 
-#endif /* _PSERIES_PLPAR_WRAPPERS_H */
+#endif /* _ASM_POWERPC_PLPAR_WRAPPERS_H */
index eccfc16..d7fe9f5 100644 (file)
 #define        __REGA0_R30     30
 #define        __REGA0_R31     31
 
+/* opcode and xopcode for instructions */
+#define OP_TRAP 3
+#define OP_TRAP_64 2
+
+#define OP_31_XOP_TRAP      4
+#define OP_31_XOP_LWZX      23
+#define OP_31_XOP_DCBST     54
+#define OP_31_XOP_LWZUX     55
+#define OP_31_XOP_TRAP_64   68
+#define OP_31_XOP_DCBF      86
+#define OP_31_XOP_LBZX      87
+#define OP_31_XOP_STWX      151
+#define OP_31_XOP_STBX      215
+#define OP_31_XOP_LBZUX     119
+#define OP_31_XOP_STBUX     247
+#define OP_31_XOP_LHZX      279
+#define OP_31_XOP_LHZUX     311
+#define OP_31_XOP_MFSPR     339
+#define OP_31_XOP_LHAX      343
+#define OP_31_XOP_LHAUX     375
+#define OP_31_XOP_STHX      407
+#define OP_31_XOP_STHUX     439
+#define OP_31_XOP_MTSPR     467
+#define OP_31_XOP_DCBI      470
+#define OP_31_XOP_LWBRX     534
+#define OP_31_XOP_TLBSYNC   566
+#define OP_31_XOP_STWBRX    662
+#define OP_31_XOP_LHBRX     790
+#define OP_31_XOP_STHBRX    918
+
+#define OP_LWZ  32
+#define OP_LD   58
+#define OP_LWZU 33
+#define OP_LBZ  34
+#define OP_LBZU 35
+#define OP_STW  36
+#define OP_STWU 37
+#define OP_STD  62
+#define OP_STB  38
+#define OP_STBU 39
+#define OP_LHZ  40
+#define OP_LHZU 41
+#define OP_LHA  42
+#define OP_LHAU 43
+#define OP_STH  44
+#define OP_STHU 45
+
 /* sorted alphabetically */
 #define PPC_INST_BHRBE                 0x7c00025c
 #define PPC_INST_CLRBHRB               0x7c00035c
index 2f1b6c5..5995457 100644 (file)
@@ -54,7 +54,8 @@ BEGIN_FW_FTR_SECTION;                                                 \
        /* from user - see if there are any DTL entries to process */   \
        ld      r10,PACALPPACAPTR(r13); /* get ptr to VPA */            \
        ld      r11,PACA_DTL_RIDX(r13); /* get log read index */        \
-       ld      r10,LPPACA_DTLIDX(r10); /* get log write index */       \
+       addi    r10,r10,LPPACA_DTLIDX;                                  \
+       LDX_BE  r10,0,r10;              /* get log write index */       \
        cmpd    cr1,r11,r10;                                            \
        beq+    cr1,33f;                                                \
        bl      .accumulate_stolen_time;                                \
@@ -219,19 +220,6 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
 #define REST_8VSRS(n,b,base)   REST_4VSRS(n,b,base); REST_4VSRS(n+4,b,base)
 #define REST_16VSRS(n,b,base)  REST_8VSRS(n,b,base); REST_8VSRS(n+8,b,base)
 #define REST_32VSRS(n,b,base)  REST_16VSRS(n,b,base); REST_16VSRS(n+16,b,base)
-/* Save the upper 32 VSRs (32-63) in the thread VSX region (0-31) */
-#define SAVE_VSRU(n,b,base)    li b,THREAD_VR0+(16*(n));  STXVD2X(n+32,R##base,R##b)
-#define SAVE_2VSRSU(n,b,base)  SAVE_VSRU(n,b,base); SAVE_VSRU(n+1,b,base)
-#define SAVE_4VSRSU(n,b,base)  SAVE_2VSRSU(n,b,base); SAVE_2VSRSU(n+2,b,base)
-#define SAVE_8VSRSU(n,b,base)  SAVE_4VSRSU(n,b,base); SAVE_4VSRSU(n+4,b,base)
-#define SAVE_16VSRSU(n,b,base) SAVE_8VSRSU(n,b,base); SAVE_8VSRSU(n+8,b,base)
-#define SAVE_32VSRSU(n,b,base) SAVE_16VSRSU(n,b,base); SAVE_16VSRSU(n+16,b,base)
-#define REST_VSRU(n,b,base)    li b,THREAD_VR0+(16*(n)); LXVD2X(n+32,R##base,R##b)
-#define REST_2VSRSU(n,b,base)  REST_VSRU(n,b,base); REST_VSRU(n+1,b,base)
-#define REST_4VSRSU(n,b,base)  REST_2VSRSU(n,b,base); REST_2VSRSU(n+2,b,base)
-#define REST_8VSRSU(n,b,base)  REST_4VSRSU(n,b,base); REST_4VSRSU(n+4,b,base)
-#define REST_16VSRSU(n,b,base) REST_8VSRSU(n,b,base); REST_8VSRSU(n+8,b,base)
-#define REST_32VSRSU(n,b,base) REST_16VSRSU(n,b,base); REST_16VSRSU(n+16,b,base)
 
 /*
  * b = base register for addressing, o = base offset from register of 1st EVR
@@ -443,15 +431,15 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
 #define ISYNC_601
 #endif
 
-#ifdef CONFIG_PPC_CELL
+#if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E)
 #define MFTB(dest)                     \
-90:    mftb  dest;                     \
+90:    mfspr dest, SPRN_TBRL;          \
 BEGIN_FTR_SECTION_NESTED(96);          \
        cmpwi dest,0;                   \
        beq-  90b;                      \
 END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
 #else
-#define MFTB(dest)                     mftb dest
+#define MFTB(dest)                     mfspr dest, SPRN_TBRL
 #endif
 
 #ifndef CONFIG_SMP
index ac204e0..7d0c7f3 100644 (file)
@@ -38,8 +38,9 @@ extern unsigned long pci_address_to_pio(phys_addr_t address);
 /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  * size parameters.
  */
-void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
-               unsigned long *busno, unsigned long *phys, unsigned long *size);
+void of_parse_dma_window(struct device_node *dn, const __be32 *dma_window,
+                        unsigned long *busno, unsigned long *phys,
+                        unsigned long *size);
 
 extern void kdump_move_device_tree(void);
 
@@ -55,6 +56,8 @@ static inline int of_node_to_nid(struct device_node *device) { return 0; }
 
 extern void of_instantiate_rtc(void);
 
+extern int of_get_ibm_chip_id(struct device_node *np);
+
 /* The of_drconf_cell struct defines the layout of the LMB array
  * specified in the device tree property
  * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory
index 99222e2..10d1ef0 100644 (file)
 #define MSR_64BIT      MSR_SF
 
 /* Server variant */
-#define MSR_           MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF |MSR_HV
-#define MSR_KERNEL     MSR_ | MSR_64BIT
-#define MSR_USER32     MSR_ | MSR_PR | MSR_EE
-#define MSR_USER64     MSR_USER32 | MSR_64BIT
+#define MSR_           (MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF |MSR_HV)
+#define MSR_KERNEL     (MSR_ | MSR_64BIT)
+#define MSR_USER32     (MSR_ | MSR_PR | MSR_EE)
+#define MSR_USER64     (MSR_USER32 | MSR_64BIT)
 #elif defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_8xx)
 /* Default MSR for kernel mode. */
 #define MSR_KERNEL     (MSR_ME|MSR_RI|MSR_IR|MSR_DR)
 #define FSCR_TAR_LG    8       /* Enable Target Address Register */
 #define FSCR_EBB_LG    7       /* Enable Event Based Branching */
 #define FSCR_TM_LG     5       /* Enable Transactional Memory */
-#define FSCR_PM_LG     4       /* Enable prob/priv access to PMU SPRs */
-#define FSCR_BHRB_LG   3       /* Enable Branch History Rolling Buffer*/
+#define FSCR_BHRB_LG   4       /* Enable Branch History Rolling Buffer*/
+#define FSCR_PM_LG     3       /* Enable prob/priv access to PMU SPRs */
 #define FSCR_DSCR_LG   2       /* Enable Data Stream Control Register */
 #define FSCR_VECVSX_LG 1       /* Enable VMX/VSX  */
 #define FSCR_FP_LG     0       /* Enable Floating Point */
                                     : "memory")
 
 #ifdef __powerpc64__
-#ifdef CONFIG_PPC_CELL
+#if defined(CONFIG_PPC_CELL) || defined(CONFIG_PPC_FSL_BOOK3E)
 #define mftb()         ({unsigned long rval;                           \
                        asm volatile(                                   \
-                               "90:    mftb %0;\n"                     \
+                               "90:    mfspr %0, %2;\n"                \
                                "97:    cmpwi %0,0;\n"                  \
                                "       beq- 90b;\n"                    \
                                "99:\n"                                 \
                                "       .llong 0\n"                     \
                                "       .llong 0\n"                     \
                                ".previous"                             \
-                       : "=r" (rval) : "i" (CPU_FTR_CELL_TB_BUG)); rval;})
+                       : "=r" (rval) \
+                       : "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL)); \
+                       rval;})
 #else
 #define mftb()         ({unsigned long rval;   \
-                       asm volatile("mftb %0" : "=r" (rval)); rval;})
+                       asm volatile("mfspr %0, %1" : \
+                                    "=r" (rval) : "i" (SPRN_TBRL)); rval;})
 #endif /* !CONFIG_PPC_CELL */
 
 #else /* __powerpc64__ */
 
 #define mftbl()                ({unsigned long rval;   \
-                       asm volatile("mftbl %0" : "=r" (rval)); rval;})
+                       asm volatile("mfspr %0, %1" : "=r" (rval) : \
+                               "i" (SPRN_TBRL)); rval;})
 #define mftbu()                ({unsigned long rval;   \
-                       asm volatile("mftbu %0" : "=r" (rval)); rval;})
+                       asm volatile("mfspr %0, %1" : "=r" (rval) : \
+                               "i" (SPRN_TBRU)); rval;})
 #endif /* !__powerpc64__ */
 
 #define mttbl(v)       asm volatile("mttbl %0":: "r"(v))
index b417de3..ed8f836 100644 (file)
 #if defined(CONFIG_PPC_BOOK3E_64)
 #define MSR_64BIT      MSR_CM
 
-#define MSR_           MSR_ME | MSR_CE
-#define MSR_KERNEL     MSR_ | MSR_64BIT
-#define MSR_USER32     MSR_ | MSR_PR | MSR_EE
-#define MSR_USER64     MSR_USER32 | MSR_64BIT
+#define MSR_           (MSR_ME | MSR_CE)
+#define MSR_KERNEL     (MSR_ | MSR_64BIT)
+#define MSR_USER32     (MSR_ | MSR_PR | MSR_EE)
+#define MSR_USER64     (MSR_USER32 | MSR_64BIT)
 #elif defined (CONFIG_40x)
 #define MSR_KERNEL     (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE)
 #define MSR_USER       (MSR_KERNEL|MSR_PR|MSR_EE)
index 77bb71c..0e3ddf5 100644 (file)
 /* Freescale Book E Performance Monitor APU Registers */
 #define PMRN_PMC0      0x010   /* Performance Monitor Counter 0 */
 #define PMRN_PMC1      0x011   /* Performance Monitor Counter 1 */
-#define PMRN_PMC2      0x012   /* Performance Monitor Counter 1 */
-#define PMRN_PMC3      0x013   /* Performance Monitor Counter 1 */
+#define PMRN_PMC2      0x012   /* Performance Monitor Counter 2 */
+#define PMRN_PMC3      0x013   /* Performance Monitor Counter 3 */
+#define PMRN_PMC4      0x014   /* Performance Monitor Counter 4 */
+#define PMRN_PMC5      0x015   /* Performance Monitor Counter 5 */
 #define PMRN_PMLCA0    0x090   /* PM Local Control A0 */
 #define PMRN_PMLCA1    0x091   /* PM Local Control A1 */
 #define PMRN_PMLCA2    0x092   /* PM Local Control A2 */
 #define PMRN_PMLCA3    0x093   /* PM Local Control A3 */
+#define PMRN_PMLCA4    0x094   /* PM Local Control A4 */
+#define PMRN_PMLCA5    0x095   /* PM Local Control A5 */
 
 #define PMLCA_FC       0x80000000      /* Freeze Counter */
 #define PMLCA_FCS      0x40000000      /* Freeze in Supervisor */
 #define PMLCA_FCM1     0x10000000      /* Freeze when PMM==1 */
 #define PMLCA_FCM0     0x08000000      /* Freeze when PMM==0 */
 #define PMLCA_CE       0x04000000      /* Condition Enable */
+#define PMLCA_FGCS1    0x00000002      /* Freeze in guest state */
+#define PMLCA_FGCS0    0x00000001      /* Freeze in hypervisor state */
 
-#define PMLCA_EVENT_MASK 0x00ff0000    /* Event field */
+#define PMLCA_EVENT_MASK 0x01ff0000    /* Event field */
 #define PMLCA_EVENT_SHIFT      16
 
 #define PMRN_PMLCB0    0x110   /* PM Local Control B0 */
 #define PMRN_PMLCB1    0x111   /* PM Local Control B1 */
 #define PMRN_PMLCB2    0x112   /* PM Local Control B2 */
 #define PMRN_PMLCB3    0x113   /* PM Local Control B3 */
+#define PMRN_PMLCB4    0x114   /* PM Local Control B4 */
+#define PMRN_PMLCB5    0x115   /* PM Local Control B5 */
 
 #define PMLCB_THRESHMUL_MASK   0x0700  /* Threshold Multiple Field */
 #define PMLCB_THRESHMUL_SHIFT  8
 
 #define PMRN_UPMC0     0x000   /* User Performance Monitor Counter 0 */
 #define PMRN_UPMC1     0x001   /* User Performance Monitor Counter 1 */
-#define PMRN_UPMC2     0x002   /* User Performance Monitor Counter 1 */
-#define PMRN_UPMC3     0x003   /* User Performance Monitor Counter 1 */
+#define PMRN_UPMC2     0x002   /* User Performance Monitor Counter 2 */
+#define PMRN_UPMC3     0x003   /* User Performance Monitor Counter 3 */
+#define PMRN_UPMC4     0x004   /* User Performance Monitor Counter 4 */
+#define PMRN_UPMC5     0x005   /* User Performance Monitor Counter 5 */
 #define PMRN_UPMLCA0   0x080   /* User PM Local Control A0 */
 #define PMRN_UPMLCA1   0x081   /* User PM Local Control A1 */
 #define PMRN_UPMLCA2   0x082   /* User PM Local Control A2 */
 #define PMRN_UPMLCA3   0x083   /* User PM Local Control A3 */
+#define PMRN_UPMLCA4   0x084   /* User PM Local Control A4 */
+#define PMRN_UPMLCA5   0x085   /* User PM Local Control A5 */
 #define PMRN_UPMLCB0   0x100   /* User PM Local Control B0 */
 #define PMRN_UPMLCB1   0x101   /* User PM Local Control B1 */
 #define PMRN_UPMLCB2   0x102   /* User PM Local Control B2 */
 #define PMRN_UPMLCB3   0x103   /* User PM Local Control B3 */
+#define PMRN_UPMLCB4   0x104   /* User PM Local Control B4 */
+#define PMRN_UPMLCB5   0x105   /* User PM Local Control B5 */
 #define PMRN_UPMGC0    0x180   /* User PM Global Control 0 */
 
 
index c7a8bfc..9bd52c6 100644 (file)
  *
  */
 
-typedef u32 rtas_arg_t;
+typedef __be32 rtas_arg_t;
 
 struct rtas_args {
-       u32 token;
-       u32 nargs;
-       u32 nret; 
+       __be32 token;
+       __be32 nargs;
+       __be32 nret; 
        rtas_arg_t args[16];
        rtas_arg_t *rets;     /* Pointer to return values in args[]. */
 };  
index 48cfc85..98da78e 100644 (file)
@@ -112,6 +112,7 @@ static inline struct cpumask *cpu_core_mask(int cpu)
 }
 
 extern int cpu_to_core_id(int cpu);
+extern int cpu_to_chip_id(int cpu);
 
 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
  *
@@ -186,6 +187,8 @@ extern int smt_enabled_at_boot;
 extern int smp_mpic_probe(void);
 extern void smp_mpic_setup_cpu(int cpu);
 extern int smp_generic_kick_cpu(int nr);
+extern int smp_generic_cpu_bootable(unsigned int nr);
+
 
 extern void smp_generic_give_timebase(void);
 extern void smp_generic_take_timebase(void);
index 5b23f91..5f54a74 100644 (file)
 
 #ifdef CONFIG_PPC64
 /* use 0x800000yy when locked, where yy == CPU number */
+#ifdef __BIG_ENDIAN__
 #define LOCK_TOKEN     (*(u32 *)(&get_paca()->lock_token))
 #else
+#define LOCK_TOKEN     (*(u32 *)(&get_paca()->paca_index))
+#endif
+#else
 #define LOCK_TOKEN     1
 #endif
 
@@ -96,7 +100,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
 
 #if defined(CONFIG_PPC_SPLPAR)
 /* We only yield to the hypervisor if we are in shared processor mode */
-#define SHARED_PROCESSOR (local_paca->lppaca_ptr->shared_proc)
+#define SHARED_PROCESSOR (lppaca_shared_proc(local_paca->lppaca_ptr))
 extern void __spin_yield(arch_spinlock_t *lock);
 extern void __rw_yield(arch_rwlock_t *lock);
 #else /* SPLPAR */
index 294c2ce..2be5618 100644 (file)
@@ -25,11 +25,8 @@ static inline void save_tar(struct thread_struct *prev)
 static inline void save_tar(struct thread_struct *prev) {}
 #endif
 
-extern void giveup_fpu(struct task_struct *);
 extern void load_up_fpu(void);
-extern void disable_kernel_fp(void);
 extern void enable_kernel_fp(void);
-extern void flush_fp_to_thread(struct task_struct *);
 extern void enable_kernel_altivec(void);
 extern void load_up_altivec(struct task_struct *);
 extern int emulate_altivec(struct pt_regs *);
@@ -47,6 +44,14 @@ static inline void discard_lazy_cpu_state(void)
 }
 #endif
 
+#ifdef CONFIG_PPC_FPU
+extern void flush_fp_to_thread(struct task_struct *);
+extern void giveup_fpu(struct task_struct *);
+#else
+static inline void flush_fp_to_thread(struct task_struct *t) { }
+static inline void giveup_fpu(struct task_struct *t) { }
+#endif
+
 #ifdef CONFIG_ALTIVEC
 extern void flush_altivec_to_thread(struct task_struct *);
 extern void giveup_altivec(struct task_struct *);
index c55e14f..18908ca 100644 (file)
@@ -29,7 +29,7 @@ static inline cycles_t get_cycles(void)
        ret = 0;
 
        __asm__ __volatile__(
-               "97:    mftb %0\n"
+               "97:    mfspr %0, %2\n"
                "99:\n"
                ".section __ftr_fixup,\"a\"\n"
                ".align 2\n"
@@ -41,7 +41,7 @@ static inline cycles_t get_cycles(void)
                "       .long 0\n"
                "       .long 0\n"
                ".previous"
-               : "=r" (ret) : "i" (CPU_FTR_601));
+               : "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL));
        return ret;
 #endif
 }
index 161ab66..89e3ef2 100644 (file)
@@ -96,6 +96,7 @@ static inline int prrn_is_enabled(void)
 #ifdef CONFIG_PPC64
 #include <asm/smp.h>
 
+#define topology_physical_package_id(cpu)      (cpu_to_chip_id(cpu))
 #define topology_thread_cpumask(cpu)   (per_cpu(cpu_sibling_map, cpu))
 #define topology_core_cpumask(cpu)     (per_cpu(cpu_core_map, cpu))
 #define topology_core_id(cpu)          (cpu_to_core_id(cpu))
index dc59091..b51fba1 100644 (file)
@@ -27,10 +27,11 @@ extern void udbg_printf(const char *fmt, ...)
        __attribute__ ((format (printf, 1, 2)));
 extern void udbg_progress(char *s, unsigned short hex);
 
-extern void udbg_init_uart(void __iomem *comport, unsigned int speed,
-                          unsigned int clock);
-extern unsigned int udbg_probe_uart_speed(void __iomem *comport,
-                                         unsigned int clock);
+extern void udbg_uart_init_mmio(void __iomem *addr, unsigned int stride);
+extern void udbg_uart_init_pio(unsigned long port, unsigned int stride);
+
+extern void udbg_uart_setup(unsigned int speed, unsigned int clock);
+extern unsigned int udbg_probe_uart_speed(unsigned int clock);
 
 struct device_node;
 extern void udbg_scc_init(int force_scc);
index 05b8d56..7e39c91 100644 (file)
@@ -107,26 +107,25 @@ typedef elf_gregset_t32 compat_elf_gregset_t;
 # define ELF_NVRREG    34      /* includes vscr & vrsave in split vectors */
 # define ELF_NVSRHALFREG 32    /* Half the vsx registers */
 # define ELF_GREG_TYPE elf_greg_t64
+# define ELF_ARCH      EM_PPC64
+# define ELF_CLASS     ELFCLASS64
+typedef elf_greg_t64 elf_greg_t;
+typedef elf_gregset_t64 elf_gregset_t;
 #else
 # define ELF_NEVRREG   34      /* includes acc (as 2) */
 # define ELF_NVRREG    33      /* includes vscr */
 # define ELF_GREG_TYPE elf_greg_t32
 # define ELF_ARCH      EM_PPC
 # define ELF_CLASS     ELFCLASS32
-# define ELF_DATA      ELFDATA2MSB
+typedef elf_greg_t32 elf_greg_t;
+typedef elf_gregset_t32 elf_gregset_t;
 #endif /* __powerpc64__ */
 
-#ifndef ELF_ARCH
-# define ELF_ARCH      EM_PPC64
-# define ELF_CLASS     ELFCLASS64
-# define ELF_DATA      ELFDATA2MSB
-  typedef elf_greg_t64 elf_greg_t;
-  typedef elf_gregset_t64 elf_gregset_t;
+#ifdef __BIG_ENDIAN__
+#define ELF_DATA       ELFDATA2MSB
 #else
-  /* Assumption: ELF_ARCH == EM_PPC and ELF_CLASS == ELFCLASS32 */
-  typedef elf_greg_t32 elf_greg_t;
-  typedef elf_gregset_t32 elf_gregset_t;
-#endif /* ELF_ARCH */
+#define ELF_DATA       ELFDATA2LSB
+#endif
 
 /* Floating point registers */
 typedef double elf_fpreg_t;
index a8619bf..445cb6e 100644 (file)
@@ -55,7 +55,6 @@ obj-$(CONFIG_PPC_RTAS)                += rtas.o rtas-rtc.o $(rtaspci-y-y)
 obj-$(CONFIG_PPC_RTAS_DAEMON)  += rtasd.o
 obj-$(CONFIG_RTAS_FLASH)       += rtas_flash.o
 obj-$(CONFIG_RTAS_PROC)                += rtas-proc.o
-obj-$(CONFIG_LPARCFG)          += lparcfg.o
 obj-$(CONFIG_IBMVIO)           += vio.o
 obj-$(CONFIG_IBMEBUS)           += ibmebus.o
 obj-$(CONFIG_EEH)              += eeh.o eeh_pe.o eeh_dev.o eeh_cache.o \
@@ -117,9 +116,7 @@ obj-$(CONFIG_DYNAMIC_FTRACE)        += ftrace.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER)    += ftrace.o
 obj-$(CONFIG_FTRACE_SYSCALLS)  += ftrace.o
 
-obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
-
-ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
+ifneq ($(CONFIG_PPC_INDIRECT_PIO),y)
 obj-y                          += iomap.o
 endif
 
index ee5b690..a27ccd5 100644 (file)
@@ -651,6 +651,10 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
        int sw = 0;
        int i, j;
 
+       /* userland only */
+       if (unlikely(!user_mode(regs)))
+               return 0;
+
        flush_vsx_to_thread(current);
 
        if (reg < 32)
@@ -764,6 +768,16 @@ int fix_alignment(struct pt_regs *regs)
        nb = aligninfo[instr].len;
        flags = aligninfo[instr].flags;
 
+       /* ldbrx/stdbrx overlap lfs/stfs in the DSISR unfortunately */
+       if (IS_XFORM(instruction) && ((instruction >> 1) & 0x3ff) == 532) {
+               nb = 8;
+               flags = LD+SW;
+       } else if (IS_XFORM(instruction) &&
+                  ((instruction >> 1) & 0x3ff) == 660) {
+               nb = 8;
+               flags = ST+SW;
+       }
+
        /* Byteswap little endian loads and stores */
        swiz = 0;
        if (regs->msr & MSR_LE) {
index ac8f527..41c011c 100644 (file)
 static void scrollscreen(void);
 #endif
 
-static void draw_byte(unsigned char c, long locX, long locY);
-static void draw_byte_32(unsigned char *bits, unsigned int *base, int rb);
-static void draw_byte_16(unsigned char *bits, unsigned int *base, int rb);
-static void draw_byte_8(unsigned char *bits, unsigned int *base, int rb);
-
 #define __force_data __attribute__((__section__(".data")))
 
 static int g_loc_X __force_data;
@@ -52,6 +47,26 @@ static unsigned char vga_font[cmapsz];
 int boot_text_mapped __force_data = 0;
 int force_printk_to_btext = 0;
 
+extern void rmci_on(void);
+extern void rmci_off(void);
+
+static inline void rmci_maybe_on(void)
+{
+#if defined(CONFIG_PPC_EARLY_DEBUG_BOOTX) && defined(CONFIG_PPC64)
+       if (!(mfmsr() & MSR_DR))
+               rmci_on();
+#endif
+}
+
+static inline void rmci_maybe_off(void)
+{
+#if defined(CONFIG_PPC_EARLY_DEBUG_BOOTX) && defined(CONFIG_PPC64)
+       if (!(mfmsr() & MSR_DR))
+               rmci_off();
+#endif
+}
+
+
 #ifdef CONFIG_PPC32
 /* Calc BAT values for mapping the display and store them
  * in disp_BAT.  Those values are then used from head.S to map
@@ -134,7 +149,7 @@ void __init btext_unmap(void)
  *    changes.
  */
 
-static void map_boot_text(void)
+void btext_map(void)
 {
        unsigned long base, offset, size;
        unsigned char *vbase;
@@ -209,7 +224,7 @@ int btext_initialize(struct device_node *np)
        dispDeviceRect[2] = width;
        dispDeviceRect[3] = height;
 
-       map_boot_text();
+       btext_map();
 
        return 0;
 }
@@ -283,7 +298,7 @@ void btext_update_display(unsigned long phys, int width, int height,
                iounmap(logicalDisplayBase);
                boot_text_mapped = 0;
        }
-       map_boot_text();
+       btext_map();
        g_loc_X = 0;
        g_loc_Y = 0;
        g_max_loc_X = width / 8;
@@ -298,6 +313,7 @@ void btext_clearscreen(void)
                                        (dispDeviceDepth >> 3)) >> 2;
        int i,j;
 
+       rmci_maybe_on();
        for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1]); i++)
        {
                unsigned int *ptr = base;
@@ -305,6 +321,7 @@ void btext_clearscreen(void)
                        *(ptr++) = 0;
                base += (dispDeviceRowBytes >> 2);
        }
+       rmci_maybe_off();
 }
 
 void btext_flushscreen(void)
@@ -355,6 +372,8 @@ static void scrollscreen(void)
                                   (dispDeviceDepth >> 3)) >> 2;
        int i,j;
 
+       rmci_maybe_on();
+
        for (i=0; i<(dispDeviceRect[3] - dispDeviceRect[1] - 16); i++)
        {
                unsigned int *src_ptr = src;
@@ -371,9 +390,116 @@ static void scrollscreen(void)
                        *(dst_ptr++) = 0;
                dst += (dispDeviceRowBytes >> 2);
        }
+
+       rmci_maybe_off();
 }
 #endif /* ndef NO_SCROLL */
 
+static unsigned int expand_bits_8[16] = {
+       0x00000000,
+       0x000000ff,
+       0x0000ff00,
+       0x0000ffff,
+       0x00ff0000,
+       0x00ff00ff,
+       0x00ffff00,
+       0x00ffffff,
+       0xff000000,
+       0xff0000ff,
+       0xff00ff00,
+       0xff00ffff,
+       0xffff0000,
+       0xffff00ff,
+       0xffffff00,
+       0xffffffff
+};
+
+static unsigned int expand_bits_16[4] = {
+       0x00000000,
+       0x0000ffff,
+       0xffff0000,
+       0xffffffff
+};
+
+
+static void draw_byte_32(unsigned char *font, unsigned int *base, int rb)
+{
+       int l, bits;
+       int fg = 0xFFFFFFFFUL;
+       int bg = 0x00000000UL;
+
+       for (l = 0; l < 16; ++l)
+       {
+               bits = *font++;
+               base[0] = (-(bits >> 7) & fg) ^ bg;
+               base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
+               base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
+               base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
+               base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
+               base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
+               base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
+               base[7] = (-(bits & 1) & fg) ^ bg;
+               base = (unsigned int *) ((char *)base + rb);
+       }
+}
+
+static inline void draw_byte_16(unsigned char *font, unsigned int *base, int rb)
+{
+       int l, bits;
+       int fg = 0xFFFFFFFFUL;
+       int bg = 0x00000000UL;
+       unsigned int *eb = (int *)expand_bits_16;
+
+       for (l = 0; l < 16; ++l)
+       {
+               bits = *font++;
+               base[0] = (eb[bits >> 6] & fg) ^ bg;
+               base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
+               base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
+               base[3] = (eb[bits & 3] & fg) ^ bg;
+               base = (unsigned int *) ((char *)base + rb);
+       }
+}
+
+static inline void draw_byte_8(unsigned char *font, unsigned int *base, int rb)
+{
+       int l, bits;
+       int fg = 0x0F0F0F0FUL;
+       int bg = 0x00000000UL;
+       unsigned int *eb = (int *)expand_bits_8;
+
+       for (l = 0; l < 16; ++l)
+       {
+               bits = *font++;
+               base[0] = (eb[bits >> 4] & fg) ^ bg;
+               base[1] = (eb[bits & 0xf] & fg) ^ bg;
+               base = (unsigned int *) ((char *)base + rb);
+       }
+}
+
+static noinline void draw_byte(unsigned char c, long locX, long locY)
+{
+       unsigned char *base     = calc_base(locX << 3, locY << 4);
+       unsigned char *font     = &vga_font[((unsigned int)c) * 16];
+       int rb                  = dispDeviceRowBytes;
+
+       rmci_maybe_on();
+       switch(dispDeviceDepth) {
+       case 24:
+       case 32:
+               draw_byte_32(font, (unsigned int *)base, rb);
+               break;
+       case 15:
+       case 16:
+               draw_byte_16(font, (unsigned int *)base, rb);
+               break;
+       case 8:
+               draw_byte_8(font, (unsigned int *)base, rb);
+               break;
+       }
+       rmci_maybe_off();
+}
+
 void btext_drawchar(char c)
 {
        int cline = 0;
@@ -465,107 +591,12 @@ void btext_drawhex(unsigned long v)
        btext_drawchar(' ');
 }
 
-static void draw_byte(unsigned char c, long locX, long locY)
-{
-       unsigned char *base     = calc_base(locX << 3, locY << 4);
-       unsigned char *font     = &vga_font[((unsigned int)c) * 16];
-       int rb                  = dispDeviceRowBytes;
-
-       switch(dispDeviceDepth) {
-       case 24:
-       case 32:
-               draw_byte_32(font, (unsigned int *)base, rb);
-               break;
-       case 15:
-       case 16:
-               draw_byte_16(font, (unsigned int *)base, rb);
-               break;
-       case 8:
-               draw_byte_8(font, (unsigned int *)base, rb);
-               break;
-       }
-}
-
-static unsigned int expand_bits_8[16] = {
-       0x00000000,
-       0x000000ff,
-       0x0000ff00,
-       0x0000ffff,
-       0x00ff0000,
-       0x00ff00ff,
-       0x00ffff00,
-       0x00ffffff,
-       0xff000000,
-       0xff0000ff,
-       0xff00ff00,
-       0xff00ffff,
-       0xffff0000,
-       0xffff00ff,
-       0xffffff00,
-       0xffffffff
-};
-
-static unsigned int expand_bits_16[4] = {
-       0x00000000,
-       0x0000ffff,
-       0xffff0000,
-       0xffffffff
-};
-
-
-static void draw_byte_32(unsigned char *font, unsigned int *base, int rb)
-{
-       int l, bits;
-       int fg = 0xFFFFFFFFUL;
-       int bg = 0x00000000UL;
-
-       for (l = 0; l < 16; ++l)
-       {
-               bits = *font++;
-               base[0] = (-(bits >> 7) & fg) ^ bg;
-               base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
-               base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
-               base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
-               base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
-               base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
-               base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
-               base[7] = (-(bits & 1) & fg) ^ bg;
-               base = (unsigned int *) ((char *)base + rb);
-       }
-}
-
-static void draw_byte_16(unsigned char *font, unsigned int *base, int rb)
-{
-       int l, bits;
-       int fg = 0xFFFFFFFFUL;
-       int bg = 0x00000000UL;
-       unsigned int *eb = (int *)expand_bits_16;
-
-       for (l = 0; l < 16; ++l)
-       {
-               bits = *font++;
-               base[0] = (eb[bits >> 6] & fg) ^ bg;
-               base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
-               base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
-               base[3] = (eb[bits & 3] & fg) ^ bg;
-               base = (unsigned int *) ((char *)base + rb);
-       }
-}
-
-static void draw_byte_8(unsigned char *font, unsigned int *base, int rb)
+void __init udbg_init_btext(void)
 {
-       int l, bits;
-       int fg = 0x0F0F0F0FUL;
-       int bg = 0x00000000UL;
-       unsigned int *eb = (int *)expand_bits_8;
-
-       for (l = 0; l < 16; ++l)
-       {
-               bits = *font++;
-               base[0] = (eb[bits >> 4] & fg) ^ bg;
-               base[1] = (eb[bits & 0xf] & fg) ^ bg;
-               base = (unsigned int *) ((char *)base + rb);
-       }
+       /* If btext is enabled, we might have a BAT setup for early display,
+        * thus we do enable some very basic udbg output
+        */
+       udbg_putc = btext_drawchar;
 }
 
 static unsigned char vga_font[cmapsz] = {
@@ -913,10 +944,3 @@ static unsigned char vga_font[cmapsz] = {
 0x00, 0x00, 0x00, 0x00,
 };
 
-void __init udbg_init_btext(void)
-{
-       /* If btext is enabled, we might have a BAT setup for early display,
-        * thus we do enable some very basic udbg output
-        */
-       udbg_putc = btext_drawchar;
-}
index 9262cf2..6549327 100644 (file)
@@ -196,7 +196,7 @@ static void cache_cpu_set(struct cache *cache, int cpu)
 static int cache_size(const struct cache *cache, unsigned int *ret)
 {
        const char *propname;
-       const u32 *cache_size;
+       const __be32 *cache_size;
 
        propname = cache_type_info[cache->type].size_prop;
 
@@ -204,7 +204,7 @@ static int cache_size(const struct cache *cache, unsigned int *ret)
        if (!cache_size)
                return -ENODEV;
 
-       *ret = *cache_size;
+       *ret = of_read_number(cache_size, 1);
        return 0;
 }
 
@@ -222,7 +222,7 @@ static int cache_size_kb(const struct cache *cache, unsigned int *ret)
 /* not cache_line_size() because that's a macro in include/linux/cache.h */
 static int cache_get_line_size(const struct cache *cache, unsigned int *ret)
 {
-       const u32 *line_size;
+       const __be32 *line_size;
        int i, lim;
 
        lim = ARRAY_SIZE(cache_type_info[cache->type].line_size_props);
@@ -239,14 +239,14 @@ static int cache_get_line_size(const struct cache *cache, unsigned int *ret)
        if (!line_size)
                return -ENODEV;
 
-       *ret = *line_size;
+       *ret = of_read_number(line_size, 1);
        return 0;
 }
 
 static int cache_nr_sets(const struct cache *cache, unsigned int *ret)
 {
        const char *propname;
-       const u32 *nr_sets;
+       const __be32 *nr_sets;
 
        propname = cache_type_info[cache->type].nr_sets_prop;
 
@@ -254,7 +254,7 @@ static int cache_nr_sets(const struct cache *cache, unsigned int *ret)
        if (!nr_sets)
                return -ENODEV;
 
-       *ret = *nr_sets;
+       *ret = of_read_number(nr_sets, 1);
        return 0;
 }
 
index 0b9af01..bfb18c7 100644 (file)
@@ -75,7 +75,7 @@ _GLOBAL(__setup_cpu_e500v2)
        bl      __e500_icache_setup
        bl      __e500_dcache_setup
        bl      __setup_e500_ivors
-#ifdef CONFIG_FSL_RIO
+#if defined(CONFIG_FSL_RIO) || defined(CONFIG_FSL_PCI)
        /* Ensure that RFXE is set */
        mfspr   r3,SPRN_HID1
        oris    r3,r3,HID1_RFXE@h
index 22973a7..597d954 100644 (file)
@@ -2105,7 +2105,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
                        MMU_FTR_USE_TLBILX,
                .icache_bsize           = 64,
                .dcache_bsize           = 64,
-               .num_pmcs               = 4,
+               .num_pmcs               = 6,
                .oprofile_cpu_type      = "ppc/e6500",
                .oprofile_type          = PPC_OPROFILE_FSL_EMB,
                .cpu_setup              = __setup_cpu_e6500,
index 2bd0b88..c04cdf7 100644 (file)
@@ -102,7 +102,8 @@ BEGIN_FW_FTR_SECTION
        /* if from user, see if there are any DTL entries to process */
        ld      r10,PACALPPACAPTR(r13)  /* get ptr to VPA */
        ld      r11,PACA_DTL_RIDX(r13)  /* get log read index */
-       ld      r10,LPPACA_DTLIDX(r10)  /* get log write index */
+       addi    r10,r10,LPPACA_DTLIDX
+       LDX_BE  r10,0,r10               /* get log write index */
        cmpd    cr1,r11,r10
        beq+    cr1,33f
        bl      .accumulate_stolen_time
@@ -522,9 +523,11 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT)
         */
        ld      r9,PACA_SLBSHADOWPTR(r13)
        li      r12,0
-       std     r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */
-       std     r7,SLBSHADOW_STACKVSID(r9)  /* Save VSID */
-       std     r0,SLBSHADOW_STACKESID(r9)  /* Save ESID */
+       std     r12,SLBSHADOW_STACKESID(r9)     /* Clear ESID */
+       li      r12,SLBSHADOW_STACKVSID
+       STDX_BE r7,r12,r9                       /* Save VSID */
+       li      r12,SLBSHADOW_STACKESID
+       STDX_BE r0,r12,r9                       /* Save ESID */
 
        /* No need to check for MMU_FTR_NO_SLBIE_B here, since when
         * we have 1TB segments, the only CPUs known to have the errata
@@ -575,34 +578,15 @@ BEGIN_FTR_SECTION
        ld      r7,DSCR_DEFAULT@toc(2)
        ld      r0,THREAD_DSCR(r4)
        cmpwi   r6,0
-       li      r8, FSCR_DSCR
        bne     1f
        ld      r0,0(r7)
-       b       3f
 1:
-  BEGIN_FTR_SECTION_NESTED(70)
-       mfspr   r6, SPRN_FSCR
-       or      r6, r6, r8
-       mtspr   SPRN_FSCR, r6
-    BEGIN_FTR_SECTION_NESTED(69)
-       mfspr   r6, SPRN_HFSCR
-       or      r6, r6, r8
-       mtspr   SPRN_HFSCR, r6
-    END_FTR_SECTION_NESTED(CPU_FTR_HVMODE, CPU_FTR_HVMODE, 69)
-       b       4f
-  END_FTR_SECTION_NESTED(CPU_FTR_ARCH_207S, CPU_FTR_ARCH_207S, 70)
-3:
-  BEGIN_FTR_SECTION_NESTED(70)
-       mfspr   r6, SPRN_FSCR
-       andc    r6, r6, r8
-       mtspr   SPRN_FSCR, r6
-    BEGIN_FTR_SECTION_NESTED(69)
-       mfspr   r6, SPRN_HFSCR
-       andc    r6, r6, r8
-       mtspr   SPRN_HFSCR, r6
-    END_FTR_SECTION_NESTED(CPU_FTR_HVMODE, CPU_FTR_HVMODE, 69)
-  END_FTR_SECTION_NESTED(CPU_FTR_ARCH_207S, CPU_FTR_ARCH_207S, 70)
-4:     cmpd    r0,r25
+BEGIN_FTR_SECTION_NESTED(70)
+       mfspr   r8, SPRN_FSCR
+       rldimi  r8, r6, FSCR_DSCR_LG, (63 - FSCR_DSCR_LG)
+       mtspr   SPRN_FSCR, r8
+END_FTR_SECTION_NESTED(CPU_FTR_ARCH_207S, CPU_FTR_ARCH_207S, 70)
+       cmpd    r0,r25
        beq     2f
        mtspr   SPRN_DSCR,r0
 2:
@@ -737,9 +721,9 @@ resume_kernel:
 
        /*
         * Here we are preempting the current task. We want to make
-        * sure we are soft-disabled first
+        * sure we are soft-disabled first and reconcile irq state.
         */
-       SOFT_DISABLE_INTS(r3,r4)
+       RECONCILE_IRQ_STATE(r3,r4)
 1:     bl      .preempt_schedule_irq
 
        /* Re-test flags and eventually loop */
index d44a571..6300c13 100644 (file)
@@ -30,22 +30,20 @@ extern u32 epapr_ev_idle_start[];
 
 bool epapr_paravirt_enabled;
 
-static int __init epapr_paravirt_init(void)
+static int __init early_init_dt_scan_epapr(unsigned long node,
+                                          const char *uname,
+                                          int depth, void *data)
 {
-       struct device_node *hyper_node;
        const u32 *insts;
-       int len, i;
+       unsigned long len;
+       int i;
 
-       hyper_node = of_find_node_by_path("/hypervisor");
-       if (!hyper_node)
-               return -ENODEV;
-
-       insts = of_get_property(hyper_node, "hcall-instructions", &len);
+       insts = of_get_flat_dt_prop(node, "hcall-instructions", &len);
        if (!insts)
-               return -ENODEV;
+               return 0;
 
        if (len % 4 || len > (4 * 4))
-               return -ENODEV;
+               return -1;
 
        for (i = 0; i < (len / 4); i++) {
                patch_instruction(epapr_hypercall_start + i, insts[i]);
@@ -55,13 +53,19 @@ static int __init epapr_paravirt_init(void)
        }
 
 #if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
-       if (of_get_property(hyper_node, "has-idle", NULL))
+       if (of_get_flat_dt_prop(node, "has-idle", NULL))
                ppc_md.power_save = epapr_ev_idle;
 #endif
 
        epapr_paravirt_enabled = true;
 
+       return 1;
+}
+
+int __init epapr_paravirt_early_init(void)
+{
+       of_scan_flat_dt(early_init_dt_scan_epapr, NULL);
+
        return 0;
 }
 
-early_initcall(epapr_paravirt_init);
index 645170a..2d06704 100644 (file)
@@ -198,9 +198,9 @@ exc_##n##_common:                                                       \
 /* This second version is meant for exceptions that don't immediately
  * hard-enable. We set a bit in paca->irq_happened to ensure that
  * a subsequent call to arch_local_irq_restore() will properly
- * hard-enable and avoid the fast-path
+ * hard-enable and avoid the fast-path, and then reconcile irq state.
  */
-#define INTS_DISABLE   SOFT_DISABLE_INTS(r3,r4)
+#define INTS_DISABLE   RECONCILE_IRQ_STATE(r3,r4)
 
 /* This is called by exceptions that used INTS_KEEP (that did not touch
  * irq indicators in the PACA). This will restore MSR:EE to it's previous
index 902ca3c..3a9ed6a 100644 (file)
@@ -293,27 +293,31 @@ system_call_pSeries:
         * out of line to handle them
         */
        . = 0xe00
-hv_exception_trampoline:
+hv_data_storage_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       h_data_storage_hv
 
        . = 0xe20
+hv_instr_storage_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       h_instr_storage_hv
 
        . = 0xe40
+emulation_assist_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       emulation_assist_hv
 
        . = 0xe60
+hv_exception_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       hmi_exception_hv
 
        . = 0xe80
+hv_doorbell_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       h_doorbell_hv
@@ -323,32 +327,32 @@ hv_exception_trampoline:
         * prolog code of the PerformanceMonitor one. A little
         * trickery is thus necessary
         */
-performance_monitor_pSeries_1:
        . = 0xf00
+performance_monitor_pseries_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       performance_monitor_pSeries
 
-altivec_unavailable_pSeries_1:
        . = 0xf20
+altivec_unavailable_pseries_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       altivec_unavailable_pSeries
 
-vsx_unavailable_pSeries_1:
        . = 0xf40
+vsx_unavailable_pseries_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       vsx_unavailable_pSeries
 
-facility_unavailable_trampoline:
        . = 0xf60
+facility_unavailable_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       facility_unavailable_pSeries
 
-hv_facility_unavailable_trampoline:
        . = 0xf80
+hv_facility_unavailable_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       facility_unavailable_hv
@@ -367,11 +371,7 @@ denorm_exception_hv:
        HMT_MEDIUM_PPR_DISCARD
        mtspr   SPRN_SPRG_HSCRATCH0,r13
        EXCEPTION_PROLOG_0(PACA_EXGEN)
-       std     r11,PACA_EXGEN+EX_R11(r13)
-       std     r12,PACA_EXGEN+EX_R12(r13)
-       mfspr   r9,SPRN_SPRG_HSCRATCH0
-       std     r9,PACA_EXGEN+EX_R13(r13)
-       mfcr    r9
+       EXCEPTION_PROLOG_1(PACA_EXGEN, NOTEST, 0x1500)
 
 #ifdef CONFIG_PPC_DENORMALISATION
        mfspr   r10,SPRN_HSRR1
@@ -381,6 +381,7 @@ denorm_exception_hv:
        bne+    denorm_assist
 #endif
 
+       KVMTEST(0x1500)
        EXCEPTION_PROLOG_PSERIES_1(denorm_common, EXC_HV)
        KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x1500)
 
@@ -501,6 +502,10 @@ denorm_done:
        mtcrf   0x80,r9
        ld      r9,PACA_EXGEN+EX_R9(r13)
        RESTORE_PPR_PACA(PACA_EXGEN, r10)
+BEGIN_FTR_SECTION
+       ld      r10,PACA_EXGEN+EX_CFAR(r13)
+       mtspr   SPRN_CFAR,r10
+END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
        ld      r10,PACA_EXGEN+EX_R10(r13)
        ld      r11,PACA_EXGEN+EX_R11(r13)
        ld      r12,PACA_EXGEN+EX_R12(r13)
@@ -808,6 +813,7 @@ system_call_relon_pSeries:
        b       .       /* Can't happen, see v2.07 Book III-S section 6.5 */
 
        . = 0x4e40
+emulation_assist_relon_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       emulation_assist_relon_hv
@@ -816,36 +822,37 @@ system_call_relon_pSeries:
        b       .       /* Can't happen, see v2.07 Book III-S section 6.5 */
 
        . = 0x4e80
+h_doorbell_relon_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       h_doorbell_relon_hv
 
-performance_monitor_relon_pSeries_1:
        . = 0x4f00
+performance_monitor_relon_pseries_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       performance_monitor_relon_pSeries
 
-altivec_unavailable_relon_pSeries_1:
        . = 0x4f20
+altivec_unavailable_relon_pseries_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       altivec_unavailable_relon_pSeries
 
-vsx_unavailable_relon_pSeries_1:
        . = 0x4f40
+vsx_unavailable_relon_pseries_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       vsx_unavailable_relon_pSeries
 
-facility_unavailable_relon_trampoline:
        . = 0x4f60
+facility_unavailable_relon_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       facility_unavailable_relon_pSeries
 
-hv_facility_unavailable_relon_trampoline:
        . = 0x4f80
+hv_facility_unavailable_relon_trampoline:
        SET_SCRATCH0(r13)
        EXCEPTION_PROLOG_0(PACA_EXGEN)
        b       hv_facility_unavailable_relon_hv
index 8a9b6f5..67ee0d6 100644 (file)
@@ -822,14 +822,6 @@ finish_tlb_load:
        rfi                     /* Should sync shadow TLBs */
        b       .               /* prevent prefetch past rfi */
 
-/* extern void giveup_fpu(struct task_struct *prev)
- *
- * The PowerPC 4xx family of processors do not have an FPU, so this just
- * returns.
- */
-_ENTRY(giveup_fpu)
-       blr
-
 /* This is where the main kernel code starts.
  */
 start_here:
index 97e2671..c334f53 100644 (file)
@@ -784,16 +784,6 @@ _GLOBAL(__fixup_440A_mcheck)
        sync
        blr
 
-/*
- * extern void giveup_fpu(struct task_struct *prev)
- *
- * The 44x core does not have an FPU.
- */
-#ifndef CONFIG_PPC_FPU
-_GLOBAL(giveup_fpu)
-       blr
-#endif
-
 _GLOBAL(set_context)
 
 #ifdef CONFIG_BDI_SWITCH
index b61363d..3d11d80 100644 (file)
@@ -703,6 +703,7 @@ _GLOBAL(relative_toc)
        mtlr    r0
        blr
 
+.balign 8
 p_toc: .llong  __toc_start + 0x8000 - 0b
 
 /*
index b2a5860..1b92a97 100644 (file)
@@ -691,10 +691,6 @@ modified_instr:
        b       151b
 #endif
 
-       .globl  giveup_fpu
-giveup_fpu:
-       blr
-
 /*
  * This is where the main kernel code starts.
  */
index d10a7ca..289afaf 100644 (file)
@@ -948,16 +948,6 @@ _GLOBAL(giveup_spe)
 #endif /* CONFIG_SPE */
 
 /*
- * extern void giveup_fpu(struct task_struct *prev)
- *
- * Not all FSL Book-E cores have an FPU
- */
-#ifndef CONFIG_PPC_FPU
-_GLOBAL(giveup_fpu)
-       blr
-#endif
-
-/*
  * extern void abort(void)
  *
  * At present, this routine just applies a system reset.
index fa0b54b..24b968f 100644 (file)
@@ -53,6 +53,7 @@ static struct iowa_bus *iowa_pci_find(unsigned long vaddr, unsigned long paddr)
        return NULL;
 }
 
+#ifdef CONFIG_PPC_INDIRECT_MMIO
 struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr)
 {
        unsigned hugepage_shift;
@@ -90,13 +91,25 @@ struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr)
 
        return bus;
 }
+#else /* CONFIG_PPC_INDIRECT_MMIO */
+struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr)
+{
+       return NULL;
+}
+#endif /* !CONFIG_PPC_INDIRECT_MMIO */
 
+#ifdef CONFIG_PPC_INDIRECT_PIO
 struct iowa_bus *iowa_pio_find_bus(unsigned long port)
 {
        unsigned long vaddr = (unsigned long)pci_io_base + port;
        return iowa_pci_find(vaddr, 0);
 }
-
+#else
+struct iowa_bus *iowa_pio_find_bus(unsigned long port)
+{
+       return NULL;
+}
+#endif
 
 #define DEF_PCI_AC_RET(name, ret, at, al, space, aa)           \
 static ret iowa_##name at                                      \
@@ -137,6 +150,7 @@ static const struct ppc_pci_io iowa_pci_io = {
 
 };
 
+#ifdef CONFIG_PPC_INDIRECT_MMIO
 static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
                                  unsigned long flags, void *caller)
 {
@@ -151,6 +165,9 @@ static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
        }
        return res;
 }
+#else /* CONFIG_PPC_INDIRECT_MMIO */
+#define iowa_ioremap NULL
+#endif /* !CONFIG_PPC_INDIRECT_MMIO */
 
 /* Enable IO workaround */
 static void io_workaround_init(void)
index 886381f..2a2b4ae 100644 (file)
@@ -25,6 +25,9 @@
 #include <asm/firmware.h>
 #include <asm/bug.h>
 
+/* See definition in io.h */
+bool isa_io_special;
+
 void _insb(const volatile u8 __iomem *port, void *buf, long count)
 {
        u8 *tbuf = buf;
index 0733b05..22e88dd 100644 (file)
@@ -99,7 +99,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
                legacy_serial_count = index + 1;
 
        /* Check if there is a port who already claimed our slot */
-       if (legacy_serial_infos[index].np != 0) {
+       if (legacy_serial_infos[index].np != NULL) {
                /* if we still have some room, move it, else override */
                if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) {
                        printk(KERN_DEBUG "Moved legacy port %d -> %d\n",
@@ -152,7 +152,7 @@ static int __init add_legacy_soc_port(struct device_node *np,
                                      struct device_node *soc_dev)
 {
        u64 addr;
-       const u32 *addrp;
+       const __be32 *addrp;
        upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ
                | UPF_FIXED_PORT;
        struct device_node *tsi = of_get_parent(np);
@@ -221,14 +221,19 @@ static int __init add_legacy_isa_port(struct device_node *np,
        /* Translate ISA address. If it fails, we still register the port
         * with no translated address so that it can be picked up as an IO
         * port later by the serial driver
+        *
+        * Note: Don't even try on P8 lpc, we know it's not directly mapped
         */
-       taddr = of_translate_address(np, reg);
-       if (taddr == OF_BAD_ADDR)
+       if (!of_device_is_compatible(isa_brg, "ibm,power8-lpc")) {
+               taddr = of_translate_address(np, reg);
+               if (taddr == OF_BAD_ADDR)
+                       taddr = 0;
+       } else
                taddr = 0;
 
        /* Add port, irq will be dealt with later */
-       return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), taddr,
-                              NO_IRQ, UPF_BOOT_AUTOCONF, 0);
+       return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]),
+                              taddr, NO_IRQ, UPF_BOOT_AUTOCONF, 0);
 
 }
 
@@ -237,7 +242,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
                                      struct device_node *pci_dev)
 {
        u64 addr, base;
-       const u32 *addrp;
+       const __be32 *addrp;
        unsigned int flags;
        int iotype, index = -1, lindex = 0;
 
@@ -270,7 +275,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
        if (iotype == UPIO_MEM)
                base = addr;
        else
-               base = addrp[2];
+               base = of_read_number(&addrp[2], 1);
 
        /* Try to guess an index... If we have subdevices of the pci dev,
         * we get to their "reg" property
@@ -307,19 +312,31 @@ static int __init add_legacy_pci_port(struct device_node *np,
 
 static void __init setup_legacy_serial_console(int console)
 {
-       struct legacy_serial_info *info =
-               &legacy_serial_infos[console];
+       struct legacy_serial_info *info = &legacy_serial_infos[console];
+       struct plat_serial8250_port *port = &legacy_serial_ports[console];
        void __iomem *addr;
 
-       if (info->taddr == 0)
-               return;
-       addr = ioremap(info->taddr, 0x1000);
-       if (addr == NULL)
-               return;
+       /* Check if a translated MMIO address has been found */
+       if (info->taddr) {
+               addr = ioremap(info->taddr, 0x1000);
+               if (addr == NULL)
+                       return;
+               udbg_uart_init_mmio(addr, 1);
+       } else {
+               /* Check if it's PIO and we support untranslated PIO */
+               if (port->iotype == UPIO_PORT && isa_io_special)
+                       udbg_uart_init_pio(port->iobase, 1);
+               else
+                       return;
+       }
+
+       /* Try to query the current speed */
        if (info->speed == 0)
-               info->speed = udbg_probe_uart_speed(addr, info->clock);
+               info->speed = udbg_probe_uart_speed(info->clock);
+
+       /* Set it up */
        DBG("default console speed = %d\n", info->speed);
-       udbg_init_uart(addr, info->speed, info->clock);
+       udbg_uart_setup(info->speed, info->clock);
 }
 
 /*
@@ -367,10 +384,13 @@ void __init find_legacy_serial_ports(void)
        /* Next, fill our array with ISA ports */
        for_each_node_by_type(np, "serial") {
                struct device_node *isa = of_get_parent(np);
-               if (isa && !strcmp(isa->name, "isa")) {
-                       index = add_legacy_isa_port(np, isa);
-                       if (index >= 0 && np == stdout)
-                               legacy_serial_console = index;
+               if (isa && (!strcmp(isa->name, "isa") ||
+                           !strcmp(isa->name, "lpc"))) {
+                       if (of_device_is_available(np)) {
+                               index = add_legacy_isa_port(np, isa);
+                               if (index >= 0 && np == stdout)
+                                       legacy_serial_console = index;
+                       }
                }
                of_node_put(isa);
        }
index e469f30..777d999 100644 (file)
@@ -327,8 +327,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_UNIFIED_ID_CACHE)
  *
  * flush_icache_range(unsigned long start, unsigned long stop)
  */
-_KPROBE(__flush_icache_range)
+_KPROBE(flush_icache_range)
 BEGIN_FTR_SECTION
+       isync
        blr                             /* for 601, do nothing */
 END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
        li      r5,L1_CACHE_BYTES-1
index 6820e45..971d7e7 100644 (file)
@@ -67,8 +67,10 @@ PPC64_CACHES:
  *   flush all bytes from start through stop-1 inclusive
  */
 
-_KPROBE(__flush_icache_range)
-
+_KPROBE(flush_icache_range)
+BEGIN_FTR_SECTION
+       blr
+END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
 /*
  * Flush the data cache to memory 
  * 
@@ -247,6 +249,37 @@ _GLOBAL(__bswapdi2)
        blr
 
 #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
+
+_GLOBAL(rmci_on)
+       sync
+       isync
+       li      r3,0x100
+       rldicl  r3,r3,32,0
+       mfspr   r5,SPRN_HID4
+       or      r5,r5,r3
+       sync
+       mtspr   SPRN_HID4,r5
+       isync
+       slbia
+       isync
+       sync
+       blr
+
+_GLOBAL(rmci_off)
+       sync
+       isync
+       li      r3,0x100
+       rldicl  r3,r3,32,0
+       mfspr   r5,SPRN_HID4
+       andc    r5,r5,r3
+       sync
+       mtspr   SPRN_HID4,r5
+       isync
+       slbia
+       isync
+       sync
+       blr
+
 /*
  * Do an IO access in real mode
  */
@@ -416,19 +449,6 @@ _GLOBAL(scom970_write)
        blr
 #endif /* CONFIG_CPU_FREQ_PMAC64 || CONFIG_CPU_FREQ_MAPLE */
 
-
-/*
- * disable_kernel_fp()
- * Disable the FPU.
- */
-_GLOBAL(disable_kernel_fp)
-       mfmsr   r3
-       rldicl  r0,r3,(63-MSR_FP_LG),1
-       rldicl  r3,r0,(MSR_FP_LG+1),0
-       mtmsrd  r3                      /* disable use of fpu now */
-       isync
-       blr
-
 /* kexec_wait(phys_cpu)
  *
  * wait for the flag to change, indicating this kernel is going away but
index f8f2468..3fc16e3 100644 (file)
@@ -34,10 +34,10 @@ extern unsigned long __toc_start;
  */
 struct lppaca lppaca[] = {
        [0 ... (NR_LPPACAS-1)] = {
-               .desc = 0xd397d781,     /* "LpPa" */
-               .size = sizeof(struct lppaca),
+               .desc = cpu_to_be32(0xd397d781),        /* "LpPa" */
+               .size = cpu_to_be16(sizeof(struct lppaca)),
                .fpregs_in_use = 1,
-               .slb_count = 64,
+               .slb_count = cpu_to_be16(64),
                .vmxregs_in_use = 0,
                .page_ins = 0,
        },
@@ -101,8 +101,8 @@ static inline void free_lppacas(void) { }
  */
 struct slb_shadow slb_shadow[] __cacheline_aligned = {
        [0 ... (NR_CPUS-1)] = {
-               .persistent = SLB_NUM_BOLTED,
-               .buffer_length = sizeof(struct slb_shadow),
+               .persistent = cpu_to_be32(SLB_NUM_BOLTED),
+               .buffer_length = cpu_to_be32(sizeof(struct slb_shadow)),
        },
 };
 
index 2b4a9a4..905a24b 100644 (file)
@@ -306,7 +306,7 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev,
        unsigned long io_offset = 0;
        int i, res_bit;
 
-       if (hose == 0)
+       if (hose == NULL)
                return NULL;            /* should never happen */
 
        /* If memory, add on the PCI bridge address offset */
@@ -667,7 +667,7 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
 void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                                  struct device_node *dev, int primary)
 {
-       const u32 *ranges;
+       const __be32 *ranges;
        int rlen;
        int pna = of_n_addr_cells(dev);
        int np = pna + 5;
@@ -687,7 +687,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
        /* Parse it */
        while ((rlen -= np * 4) >= 0) {
                /* Read next ranges element */
-               pci_space = ranges[0];
+               pci_space = of_read_number(ranges, 1);
                pci_addr = of_read_number(ranges + 1, 2);
                cpu_addr = of_translate_address(dev, ranges + 3);
                size = of_read_number(ranges + pna + 3, 2);
@@ -704,7 +704,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                /* Now consume following elements while they are contiguous */
                for (; rlen >= np * sizeof(u32);
                     ranges += np, rlen -= np * 4) {
-                       if (ranges[0] != pci_space)
+                       if (of_read_number(ranges, 1) != pci_space)
                                break;
                        pci_next = of_read_number(ranges + 1, 2);
                        cpu_next = of_translate_address(dev, ranges + 3);
@@ -1055,8 +1055,7 @@ void pcibios_fixup_bus(struct pci_bus *bus)
         * bases. This is -not- called when generating the PCI tree from
         * the OF device-tree.
         */
-       if (bus->self != NULL)
-               pci_read_bridge_bases(bus);
+       pci_read_bridge_bases(bus);
 
        /* Now fixup the bus bus */
        pcibios_setup_bus_self(bus);
@@ -1578,7 +1577,7 @@ fake_pci_bus(struct pci_controller *hose, int busnr)
 {
        static struct pci_bus bus;
 
-       if (hose == 0) {
+       if (hose == NULL) {
                printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
        }
        bus.number = busnr;
index 2e86296..a9e311f 100644 (file)
@@ -109,7 +109,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
        hose = pci_bus_to_host(bus);
 
        /* Check if we have IOs allocated */
-       if (hose->io_base_alloc == 0)
+       if (hose->io_base_alloc == NULL)
                return 0;
 
        pr_debug("IO unmapping for PHB %s\n", hose->dn->full_name);
@@ -272,7 +272,7 @@ static void quirk_radeon_32bit_msi(struct pci_dev *dev)
        struct pci_dn *pdn = pci_get_pdn(dev);
 
        if (pdn)
-               pdn->force_32bit_msi = 1;
+               pdn->force_32bit_msi = true;
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x68f2, quirk_radeon_32bit_msi);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0xaa68, quirk_radeon_32bit_msi);
index df03844..1f61fab 100644 (file)
@@ -47,9 +47,8 @@ struct pci_dn *pci_get_pdn(struct pci_dev *pdev)
 void *update_dn_pci_info(struct device_node *dn, void *data)
 {
        struct pci_controller *phb = data;
-       const int *type =
-               of_get_property(dn, "ibm,pci-config-space-type", NULL);
-       const u32 *regs;
+       const __be32 *type = of_get_property(dn, "ibm,pci-config-space-type", NULL);
+       const __be32 *regs;
        struct pci_dn *pdn;
 
        pdn = zalloc_maybe_bootmem(sizeof(*pdn), GFP_KERNEL);
@@ -63,12 +62,14 @@ void *update_dn_pci_info(struct device_node *dn, void *data)
 #endif
        regs = of_get_property(dn, "reg", NULL);
        if (regs) {
+               u32 addr = of_read_number(regs, 1);
+
                /* First register entry is addr (00BBSS00)  */
-               pdn->busno = (regs[0] >> 16) & 0xff;
-               pdn->devfn = (regs[0] >> 8) & 0xff;
+               pdn->busno = (addr >> 16) & 0xff;
+               pdn->devfn = (addr >> 8) & 0xff;
        }
 
-       pdn->pci_ext_config_space = (type && *type == 1);
+       pdn->pci_ext_config_space = (type && of_read_number(type, 1) == 1);
        return NULL;
 }
 
@@ -98,12 +99,13 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
 
        /* We started with a phb, iterate all childs */
        for (dn = start->child; dn; dn = nextdn) {
-               const u32 *classp;
-               u32 class;
+               const __be32 *classp;
+               u32 class = 0;
 
                nextdn = NULL;
                classp = of_get_property(dn, "class-code", NULL);
-               class = classp ? *classp : 0;
+               if (classp)
+                       class = of_read_number(classp, 1);
 
                if (pre && ((ret = pre(dn, data)) != NULL))
                        return ret;
index 15d9105..4368ec6 100644 (file)
  */
 static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
 {
-       const u32 *prop;
+       const __be32 *prop;
        int len;
 
        prop = of_get_property(np, name, &len);
        if (prop && len >= 4)
-               return *prop;
+               return of_read_number(prop, 1);
        return def;
 }
 
@@ -77,7 +77,7 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
        unsigned int flags;
        struct pci_bus_region region;
        struct resource *res;
-       const u32 *addrs;
+       const __be32 *addrs;
        u32 i;
        int proplen;
 
@@ -86,14 +86,14 @@ static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
                return;
        pr_debug("    parse addresses (%d bytes) @ %p\n", proplen, addrs);
        for (; proplen >= 20; proplen -= 20, addrs += 5) {
-               flags = pci_parse_of_flags(addrs[0], 0);
+               flags = pci_parse_of_flags(of_read_number(addrs, 1), 0);
                if (!flags)
                        continue;
                base = of_read_number(&addrs[1], 2);
                size = of_read_number(&addrs[3], 2);
                if (!size)
                        continue;
-               i = addrs[0] & 0xff;
+               i = of_read_number(addrs, 1) & 0xff;
                pr_debug("  base: %llx, size: %llx, i: %x\n",
                         (unsigned long long)base,
                         (unsigned long long)size, i);
@@ -207,7 +207,7 @@ void of_scan_pci_bridge(struct pci_dev *dev)
 {
        struct device_node *node = dev->dev.of_node;
        struct pci_bus *bus;
-       const u32 *busrange, *ranges;
+       const __be32 *busrange, *ranges;
        int len, i, mode;
        struct pci_bus_region region;
        struct resource *res;
@@ -230,9 +230,11 @@ void of_scan_pci_bridge(struct pci_dev *dev)
                return;
        }
 
-       bus = pci_find_bus(pci_domain_nr(dev->bus), busrange[0]);
+       bus = pci_find_bus(pci_domain_nr(dev->bus),
+                          of_read_number(busrange, 1));
        if (!bus) {
-               bus = pci_add_new_bus(dev->bus, dev, busrange[0]);
+               bus = pci_add_new_bus(dev->bus, dev,
+                                     of_read_number(busrange, 1));
                if (!bus) {
                        printk(KERN_ERR "Failed to create pci bus for %s\n",
                               node->full_name);
@@ -241,7 +243,8 @@ void of_scan_pci_bridge(struct pci_dev *dev)
        }
 
        bus->primary = dev->bus->number;
-       pci_bus_insert_busn_res(bus, busrange[0], busrange[1]);
+       pci_bus_insert_busn_res(bus, of_read_number(busrange, 1),
+                               of_read_number(busrange+1, 1));
        bus->bridge_ctl = 0;
 
        /* parse ranges property */
@@ -254,7 +257,7 @@ void of_scan_pci_bridge(struct pci_dev *dev)
        }
        i = 1;
        for (; len >= 32; len -= 32, ranges += 8) {
-               flags = pci_parse_of_flags(ranges[0], 1);
+               flags = pci_parse_of_flags(of_read_number(ranges, 1), 1);
                size = of_read_number(&ranges[6], 2);
                if (flags == 0 || size == 0)
                        continue;
index c296665..21646db 100644 (file)
@@ -96,7 +96,9 @@ EXPORT_SYMBOL(pci_dram_offset);
 
 EXPORT_SYMBOL(start_thread);
 
+#ifdef CONFIG_PPC_FPU
 EXPORT_SYMBOL(giveup_fpu);
+#endif
 #ifdef CONFIG_ALTIVEC
 EXPORT_SYMBOL(giveup_altivec);
 #endif /* CONFIG_ALTIVEC */
@@ -111,7 +113,6 @@ EXPORT_SYMBOL(giveup_spe);
 #ifndef CONFIG_PPC64
 EXPORT_SYMBOL(flush_instruction_cache);
 #endif
-EXPORT_SYMBOL(__flush_icache_range);
 EXPORT_SYMBOL(flush_dcache_range);
 
 #ifdef CONFIG_SMP
index 8083be2..6f428da 100644 (file)
@@ -74,6 +74,7 @@ struct task_struct *last_task_used_vsx = NULL;
 struct task_struct *last_task_used_spe = NULL;
 #endif
 
+#ifdef CONFIG_PPC_FPU
 /*
  * Make sure the floating-point register state in the
  * the thread_struct is up to date for task tsk.
@@ -107,6 +108,7 @@ void flush_fp_to_thread(struct task_struct *tsk)
        }
 }
 EXPORT_SYMBOL_GPL(flush_fp_to_thread);
+#endif
 
 void enable_kernel_fp(void)
 {
index 1c14cd4..6bfcab9 100644 (file)
@@ -215,16 +215,16 @@ static void __init check_cpu_pa_features(unsigned long node)
 #ifdef CONFIG_PPC_STD_MMU_64
 static void __init check_cpu_slb_size(unsigned long node)
 {
-       u32 *slb_size_ptr;
+       __be32 *slb_size_ptr;
 
        slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL);
        if (slb_size_ptr != NULL) {
-               mmu_slb_size = *slb_size_ptr;
+               mmu_slb_size = be32_to_cpup(slb_size_ptr);
                return;
        }
        slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
        if (slb_size_ptr != NULL) {
-               mmu_slb_size = *slb_size_ptr;
+               mmu_slb_size = be32_to_cpup(slb_size_ptr);
        }
 }
 #else
@@ -279,11 +279,11 @@ static void __init check_cpu_feature_properties(unsigned long node)
 {
        unsigned long i;
        struct feature_property *fp = feature_properties;
-       const u32 *prop;
+       const __be32 *prop;
 
        for (i = 0; i < ARRAY_SIZE(feature_properties); ++i, ++fp) {
                prop = of_get_flat_dt_prop(node, fp->name, NULL);
-               if (prop && *prop >= fp->min_value) {
+               if (prop && be32_to_cpup(prop) >= fp->min_value) {
                        cur_cpu_spec->cpu_features |= fp->cpu_feature;
                        cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftr;
                }
@@ -295,8 +295,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
                                          void *data)
 {
        char *type = of_get_flat_dt_prop(node, "device_type", NULL);
-       const u32 *prop;
-       const u32 *intserv;
+       const __be32 *prop;
+       const __be32 *intserv;
        int i, nthreads;
        unsigned long len;
        int found = -1;
@@ -324,8 +324,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
                 * version 2 of the kexec param format adds the phys cpuid of
                 * booted proc.
                 */
-               if (initial_boot_params->version >= 2) {
-                       if (intserv[i] == initial_boot_params->boot_cpuid_phys) {
+               if (be32_to_cpu(initial_boot_params->version) >= 2) {
+                       if (be32_to_cpu(intserv[i]) ==
+                           be32_to_cpu(initial_boot_params->boot_cpuid_phys)) {
                                found = boot_cpu_count;
                                found_thread = i;
                        }
@@ -347,9 +348,10 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
 
        if (found >= 0) {
                DBG("boot cpu: logical %d physical %d\n", found,
-                       intserv[found_thread]);
+                       be32_to_cpu(intserv[found_thread]));
                boot_cpuid = found;
-               set_hard_smp_processor_id(found, intserv[found_thread]);
+               set_hard_smp_processor_id(found,
+                       be32_to_cpu(intserv[found_thread]));
 
                /*
                 * PAPR defines "logical" PVR values for cpus that
@@ -366,8 +368,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
                 * it uses 0x0f000001.
                 */
                prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
-               if (prop && (*prop & 0xff000000) == 0x0f000000)
-                       identify_cpu(0, *prop);
+               if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000)
+                       identify_cpu(0, be32_to_cpup(prop));
 
                identical_pvr_fixup(node);
        }
@@ -389,7 +391,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
 int __init early_init_dt_scan_chosen_ppc(unsigned long node, const char *uname,
                                         int depth, void *data)
 {
-       unsigned long *lprop;
+       unsigned long *lprop; /* All these set by kernel, so no need to convert endian */
 
        /* Use common scan routine to determine if this is the chosen node */
        if (early_init_dt_scan_chosen(node, uname, depth, data) == 0)
@@ -454,7 +456,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
        if (dm == NULL || l < sizeof(__be32))
                return 0;
 
-       n = *dm++;      /* number of entries */
+       n = of_read_number(dm++, 1);    /* number of entries */
        if (l < (n * (dt_root_addr_cells + 4) + 1) * sizeof(__be32))
                return 0;
 
@@ -466,7 +468,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
 
        for (; n != 0; --n) {
                base = dt_mem_next_cell(dt_root_addr_cells, &dm);
-               flags = dm[3];
+               flags = of_read_number(&dm[3], 1);
                /* skip DRC index, pad, assoc. list index, flags */
                dm += 4;
                /* skip this block if the reserved bit is set in flags (0x80)
@@ -591,16 +593,16 @@ static void __init early_reserve_mem_dt(void)
 static void __init early_reserve_mem(void)
 {
        u64 base, size;
-       u64 *reserve_map;
+       __be64 *reserve_map;
        unsigned long self_base;
        unsigned long self_size;
 
-       reserve_map = (u64 *)(((unsigned long)initial_boot_params) +
-                                       initial_boot_params->off_mem_rsvmap);
+       reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
+                       be32_to_cpu(initial_boot_params->off_mem_rsvmap));
 
        /* before we do anything, lets reserve the dt blob */
        self_base = __pa((unsigned long)initial_boot_params);
-       self_size = initial_boot_params->totalsize;
+       self_size = be32_to_cpu(initial_boot_params->totalsize);
        memblock_reserve(self_base, self_size);
 
        /* Look for the new "reserved-regions" property in the DT */
@@ -620,15 +622,15 @@ static void __init early_reserve_mem(void)
         * Handle the case where we might be booting from an old kexec
         * image that setup the mem_rsvmap as pairs of 32-bit values
         */
-       if (*reserve_map > 0xffffffffull) {
+       if (be64_to_cpup(reserve_map) > 0xffffffffull) {
                u32 base_32, size_32;
-               u32 *reserve_map_32 = (u32 *)reserve_map;
+               __be32 *reserve_map_32 = (__be32 *)reserve_map;
 
                DBG("Found old 32-bit reserve map\n");
 
                while (1) {
-                       base_32 = *(reserve_map_32++);
-                       size_32 = *(reserve_map_32++);
+                       base_32 = be32_to_cpup(reserve_map_32++);
+                       size_32 = be32_to_cpup(reserve_map_32++);
                        if (size_32 == 0)
                                break;
                        /* skip if the reservation is for the blob */
@@ -644,8 +646,8 @@ static void __init early_reserve_mem(void)
 
        /* Handle the reserve map in the fdt blob if it exists */
        while (1) {
-               base = *(reserve_map++);
-               size = *(reserve_map++);
+               base = be64_to_cpup(reserve_map++);
+               size = be64_to_cpup(reserve_map++);
                if (size == 0)
                        break;
                DBG("reserving: %llx -> %llx\n", base, size);
@@ -795,6 +797,32 @@ struct device_node *of_find_next_cache_node(struct device_node *np)
        return NULL;
 }
 
+/**
+ * of_get_ibm_chip_id - Returns the IBM "chip-id" of a device
+ * @np: device node of the device
+ *
+ * This looks for a property "ibm,chip-id" in the node or any
+ * of its parents and returns its content, or -1 if it cannot
+ * be found.
+ */
+int of_get_ibm_chip_id(struct device_node *np)
+{
+       of_node_get(np);
+       while(np) {
+               struct device_node *old = np;
+               const __be32 *prop;
+
+               prop = of_get_property(np, "ibm,chip-id", NULL);
+               if (prop) {
+                       of_node_put(np);
+                       return be32_to_cpup(prop);
+               }
+               np = of_get_parent(np);
+               of_node_put(old);
+       }
+       return -1;
+}
+
 #ifdef CONFIG_PPC_PSERIES
 /*
  * Fix up the uninitialized fields in a new device node:
@@ -878,7 +906,7 @@ static int __init export_flat_device_tree(void)
        struct dentry *d;
 
        flat_dt_blob.data = initial_boot_params;
-       flat_dt_blob.size = initial_boot_params->totalsize;
+       flat_dt_blob.size = be32_to_cpu(initial_boot_params->totalsize);
 
        d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
                                powerpc_debugfs_root, &flat_dt_blob);
index 6079024..7b6391b 100644 (file)
@@ -107,10 +107,10 @@ int of_workarounds;
 typedef u32 prom_arg_t;
 
 struct prom_args {
-        u32 service;
-        u32 nargs;
-        u32 nret;
-        prom_arg_t args[10];
+        __be32 service;
+        __be32 nargs;
+        __be32 nret;
+        __be32 args[10];
 };
 
 struct prom_t {
@@ -123,11 +123,11 @@ struct prom_t {
 };
 
 struct mem_map_entry {
-       u64     base;
-       u64     size;
+       __be64  base;
+       __be64  size;
 };
 
-typedef u32 cell_t;
+typedef __be32 cell_t;
 
 extern void __start(unsigned long r3, unsigned long r4, unsigned long r5,
                    unsigned long r6, unsigned long r7, unsigned long r8,
@@ -219,13 +219,13 @@ static int __init call_prom(const char *service, int nargs, int nret, ...)
        struct prom_args args;
        va_list list;
 
-       args.service = ADDR(service);
-       args.nargs = nargs;
-       args.nret = nret;
+       args.service = cpu_to_be32(ADDR(service));
+       args.nargs = cpu_to_be32(nargs);
+       args.nret = cpu_to_be32(nret);
 
        va_start(list, nret);
        for (i = 0; i < nargs; i++)
-               args.args[i] = va_arg(list, prom_arg_t);
+               args.args[i] = cpu_to_be32(va_arg(list, prom_arg_t));
        va_end(list);
 
        for (i = 0; i < nret; i++)
@@ -234,7 +234,7 @@ static int __init call_prom(const char *service, int nargs, int nret, ...)
        if (enter_prom(&args, prom_entry) < 0)
                return PROM_ERROR;
 
-       return (nret > 0) ? args.args[nargs] : 0;
+       return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0;
 }
 
 static int __init call_prom_ret(const char *service, int nargs, int nret,
@@ -244,13 +244,13 @@ static int __init call_prom_ret(const char *service, int nargs, int nret,
        struct prom_args args;
        va_list list;
 
-       args.service = ADDR(service);
-       args.nargs = nargs;
-       args.nret = nret;
+       args.service = cpu_to_be32(ADDR(service));
+       args.nargs = cpu_to_be32(nargs);
+       args.nret = cpu_to_be32(nret);
 
        va_start(list, rets);
        for (i = 0; i < nargs; i++)
-               args.args[i] = va_arg(list, prom_arg_t);
+               args.args[i] = cpu_to_be32(va_arg(list, prom_arg_t));
        va_end(list);
 
        for (i = 0; i < nret; i++)
@@ -261,9 +261,9 @@ static int __init call_prom_ret(const char *service, int nargs, int nret,
 
        if (rets != NULL)
                for (i = 1; i < nret; ++i)
-                       rets[i-1] = args.args[nargs+i];
+                       rets[i-1] = be32_to_cpu(args.args[nargs+i]);
 
-       return (nret > 0) ? args.args[nargs] : 0;
+       return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0;
 }
 
 
@@ -527,7 +527,7 @@ static int __init prom_setprop(phandle node, const char *nodename,
 #define islower(c)     ('a' <= (c) && (c) <= 'z')
 #define toupper(c)     (islower(c) ? ((c) - 'a' + 'A') : (c))
 
-unsigned long prom_strtoul(const char *cp, const char **endp)
+static unsigned long prom_strtoul(const char *cp, const char **endp)
 {
        unsigned long result = 0, base = 10, value;
 
@@ -552,7 +552,7 @@ unsigned long prom_strtoul(const char *cp, const char **endp)
        return result;
 }
 
-unsigned long prom_memparse(const char *ptr, const char **retptr)
+static unsigned long prom_memparse(const char *ptr, const char **retptr)
 {
        unsigned long ret = prom_strtoul(ptr, retptr);
        int shift = 0;
@@ -724,7 +724,8 @@ unsigned char ibm_architecture_vec[] = {
 
 };
 
-/* Old method - ELF header with PT_NOTE sections */
+/* Old method - ELF header with PT_NOTE sections only works on BE */
+#ifdef __BIG_ENDIAN__
 static struct fake_elf {
        Elf32_Ehdr      elfhdr;
        Elf32_Phdr      phdr[2];
@@ -810,6 +811,7 @@ static struct fake_elf {
                }
        }
 };
+#endif /* __BIG_ENDIAN__ */
 
 static int __init prom_count_smt_threads(void)
 {
@@ -852,9 +854,9 @@ static int __init prom_count_smt_threads(void)
 
 static void __init prom_send_capabilities(void)
 {
-       ihandle elfloader, root;
+       ihandle root;
        prom_arg_t ret;
-       u32 *cores;
+       __be32 *cores;
 
        root = call_prom("open", 1, 1, ADDR("/"));
        if (root != 0) {
@@ -864,15 +866,15 @@ static void __init prom_send_capabilities(void)
                 * (we assume this is the same for all cores) and use it to
                 * divide NR_CPUS.
                 */
-               cores = (u32 *)&ibm_architecture_vec[IBM_ARCH_VEC_NRCORES_OFFSET];
-               if (*cores != NR_CPUS) {
+               cores = (__be32 *)&ibm_architecture_vec[IBM_ARCH_VEC_NRCORES_OFFSET];
+               if (be32_to_cpup(cores) != NR_CPUS) {
                        prom_printf("WARNING ! "
                                    "ibm_architecture_vec structure inconsistent: %lu!\n",
-                                   *cores);
+                                   be32_to_cpup(cores));
                } else {
-                       *cores = DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads());
+                       *cores = cpu_to_be32(DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads()));
                        prom_printf("Max number of cores passed to firmware: %lu (NR_CPUS = %lu)\n",
-                                   *cores, NR_CPUS);
+                                   be32_to_cpup(cores), NR_CPUS);
                }
 
                /* try calling the ibm,client-architecture-support method */
@@ -893,17 +895,24 @@ static void __init prom_send_capabilities(void)
                prom_printf(" not implemented\n");
        }
 
-       /* no ibm,client-architecture-support call, try the old way */
-       elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));
-       if (elfloader == 0) {
-               prom_printf("couldn't open /packages/elf-loader\n");
-               return;
+#ifdef __BIG_ENDIAN__
+       {
+               ihandle elfloader;
+
+               /* no ibm,client-architecture-support call, try the old way */
+               elfloader = call_prom("open", 1, 1,
+                                     ADDR("/packages/elf-loader"));
+               if (elfloader == 0) {
+                       prom_printf("couldn't open /packages/elf-loader\n");
+                       return;
+               }
+               call_prom("call-method", 3, 1, ADDR("process-elf-header"),
+                         elfloader, ADDR(&fake_elf));
+               call_prom("close", 1, 0, elfloader);
        }
-       call_prom("call-method", 3, 1, ADDR("process-elf-header"),
-                       elfloader, ADDR(&fake_elf));
-       call_prom("close", 1, 0, elfloader);
+#endif /* __BIG_ENDIAN__ */
 }
-#endif
+#endif /* #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */
 
 /*
  * Memory allocation strategy... our layout is normally:
@@ -1050,11 +1059,11 @@ static unsigned long __init prom_next_cell(int s, cell_t **cellp)
                p++;
                s--;
        }
-       r = *p++;
+       r = be32_to_cpu(*p++);
 #ifdef CONFIG_PPC64
        if (s > 1) {
                r <<= 32;
-               r |= *(p++);
+               r |= be32_to_cpu(*(p++));
        }
 #endif
        *cellp = p;
@@ -1087,8 +1096,8 @@ static void __init reserve_mem(u64 base, u64 size)
 
        if (cnt >= (MEM_RESERVE_MAP_SIZE - 1))
                prom_panic("Memory reserve map exhausted !\n");
-       mem_reserve_map[cnt].base = base;
-       mem_reserve_map[cnt].size = size;
+       mem_reserve_map[cnt].base = cpu_to_be64(base);
+       mem_reserve_map[cnt].size = cpu_to_be64(size);
        mem_reserve_cnt = cnt + 1;
 }
 
@@ -1102,6 +1111,7 @@ static void __init prom_init_mem(void)
        char *path, type[64];
        unsigned int plen;
        cell_t *p, *endp;
+       __be32 val;
        u32 rac, rsc;
 
        /*
@@ -1109,12 +1119,14 @@ static void __init prom_init_mem(void)
         * 1) top of RMO (first node)
         * 2) top of memory
         */
-       rac = 2;
-       prom_getprop(prom.root, "#address-cells", &rac, sizeof(rac));
-       rsc = 1;
-       prom_getprop(prom.root, "#size-cells", &rsc, sizeof(rsc));
-       prom_debug("root_addr_cells: %x\n", (unsigned long) rac);
-       prom_debug("root_size_cells: %x\n", (unsigned long) rsc);
+       val = cpu_to_be32(2);
+       prom_getprop(prom.root, "#address-cells", &val, sizeof(val));
+       rac = be32_to_cpu(val);
+       val = cpu_to_be32(1);
+       prom_getprop(prom.root, "#size-cells", &val, sizeof(rsc));
+       rsc = be32_to_cpu(val);
+       prom_debug("root_addr_cells: %x\n", rac);
+       prom_debug("root_size_cells: %x\n", rsc);
 
        prom_debug("scanning memory:\n");
        path = prom_scratch;
@@ -1222,25 +1234,23 @@ static void __init prom_init_mem(void)
 
 static void __init prom_close_stdin(void)
 {
-       ihandle val;
+       __be32 val;
+       ihandle stdin;
 
-       if (prom_getprop(prom.chosen, "stdin", &val, sizeof(val)) > 0)
-               call_prom("close", 1, 0, val);
+       if (prom_getprop(prom.chosen, "stdin", &val, sizeof(val)) > 0) {
+               stdin = be32_to_cpu(val);
+               call_prom("close", 1, 0, stdin);
+       }
 }
 
 #ifdef CONFIG_PPC_POWERNV
 
-static u64 __initdata prom_opal_size;
-static u64 __initdata prom_opal_align;
-static int __initdata prom_rtas_start_cpu;
-static u64 __initdata prom_rtas_data;
-static u64 __initdata prom_rtas_entry;
-
 #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL
 static u64 __initdata prom_opal_base;
 static u64 __initdata prom_opal_entry;
 #endif
 
+#ifdef __BIG_ENDIAN__
 /* XXX Don't change this structure without updating opal-takeover.S */
 static struct opal_secondary_data {
        s64                             ack;    /*  0 */
@@ -1248,6 +1258,12 @@ static struct opal_secondary_data {
        struct opal_takeover_args       args;   /* 16 */
 } opal_secondary_data;
 
+static u64 __initdata prom_opal_align;
+static u64 __initdata prom_opal_size;
+static int __initdata prom_rtas_start_cpu;
+static u64 __initdata prom_rtas_data;
+static u64 __initdata prom_rtas_entry;
+
 extern char opal_secondary_entry;
 
 static void __init prom_query_opal(void)
@@ -1265,6 +1281,7 @@ static void __init prom_query_opal(void)
        }
 
        prom_printf("Querying for OPAL presence... ");
+
        rc = opal_query_takeover(&prom_opal_size,
                                 &prom_opal_align);
        prom_debug("(rc = %ld) ", rc);
@@ -1425,6 +1442,7 @@ static void __init prom_opal_takeover(void)
        for (;;)
                opal_do_takeover(args);
 }
+#endif /* __BIG_ENDIAN__ */
 
 /*
  * Allocate room for and instantiate OPAL
@@ -1435,6 +1453,7 @@ static void __init prom_instantiate_opal(void)
        ihandle opal_inst;
        u64 base, entry;
        u64 size = 0, align = 0x10000;
+       __be64 val64;
        u32 rets[2];
 
        prom_debug("prom_instantiate_opal: start...\n");
@@ -1444,11 +1463,14 @@ static void __init prom_instantiate_opal(void)
        if (!PHANDLE_VALID(opal_node))
                return;
 
-       prom_getprop(opal_node, "opal-runtime-size", &size, sizeof(size));
+       val64 = 0;
+       prom_getprop(opal_node, "opal-runtime-size", &val64, sizeof(val64));
+       size = be64_to_cpu(val64);
        if (size == 0)
                return;
-       prom_getprop(opal_node, "opal-runtime-alignment", &align,
-                    sizeof(align));
+       val64 = 0;
+       prom_getprop(opal_node, "opal-runtime-alignment", &val64,sizeof(val64));
+       align = be64_to_cpu(val64);
 
        base = alloc_down(size, align, 0);
        if (base == 0) {
@@ -1505,6 +1527,7 @@ static void __init prom_instantiate_rtas(void)
        phandle rtas_node;
        ihandle rtas_inst;
        u32 base, entry = 0;
+       __be32 val;
        u32 size = 0;
 
        prom_debug("prom_instantiate_rtas: start...\n");
@@ -1514,7 +1537,9 @@ static void __init prom_instantiate_rtas(void)
        if (!PHANDLE_VALID(rtas_node))
                return;
 
-       prom_getprop(rtas_node, "rtas-size", &size, sizeof(size));
+       val = 0;
+       prom_getprop(rtas_node, "rtas-size", &val, sizeof(size));
+       size = be32_to_cpu(val);
        if (size == 0)
                return;
 
@@ -1541,12 +1566,14 @@ static void __init prom_instantiate_rtas(void)
 
        reserve_mem(base, size);
 
+       val = cpu_to_be32(base);
        prom_setprop(rtas_node, "/rtas", "linux,rtas-base",
-                    &base, sizeof(base));
+                    &val, sizeof(val));
+       val = cpu_to_be32(entry);
        prom_setprop(rtas_node, "/rtas", "linux,rtas-entry",
-                    &entry, sizeof(entry));
+                    &val, sizeof(val));
 
-#ifdef CONFIG_PPC_POWERNV
+#if defined(CONFIG_PPC_POWERNV) && defined(__BIG_ENDIAN__)
        /* PowerVN takeover hack */
        prom_rtas_data = base;
        prom_rtas_entry = entry;
@@ -1620,6 +1647,7 @@ static void __init prom_instantiate_sml(void)
 /*
  * Allocate room for and initialize TCE tables
  */
+#ifdef __BIG_ENDIAN__
 static void __init prom_initialize_tce_table(void)
 {
        phandle node;
@@ -1748,7 +1776,8 @@ static void __init prom_initialize_tce_table(void)
        /* Flag the first invalid entry */
        prom_debug("ending prom_initialize_tce_table\n");
 }
-#endif
+#endif /* __BIG_ENDIAN__ */
+#endif /* CONFIG_PPC64 */
 
 /*
  * With CHRP SMP we need to use the OF to start the other processors.
@@ -1777,7 +1806,6 @@ static void __init prom_initialize_tce_table(void)
 static void __init prom_hold_cpus(void)
 {
        unsigned long i;
-       unsigned int reg;
        phandle node;
        char type[64];
        unsigned long *spinloop
@@ -1803,6 +1831,9 @@ static void __init prom_hold_cpus(void)
 
        /* look for cpus */
        for (node = 0; prom_next_node(&node); ) {
+               unsigned int cpu_no;
+               __be32 reg;
+
                type[0] = 0;
                prom_getprop(node, "device_type", type, sizeof(type));
                if (strcmp(type, "cpu") != 0)
@@ -1813,10 +1844,11 @@ static void __init prom_hold_cpus(void)
                        if (strcmp(type, "okay") != 0)
                                continue;
 
-               reg = -1;
+               reg = cpu_to_be32(-1); /* make sparse happy */
                prom_getprop(node, "reg", &reg, sizeof(reg));
+               cpu_no = be32_to_cpu(reg);
 
-               prom_debug("cpu hw idx   = %lu\n", reg);
+               prom_debug("cpu hw idx   = %lu\n", cpu_no);
 
                /* Init the acknowledge var which will be reset by
                 * the secondary cpu when it awakens from its OF
@@ -1824,24 +1856,24 @@ static void __init prom_hold_cpus(void)
                 */
                *acknowledge = (unsigned long)-1;
 
-               if (reg != prom.cpu) {
+               if (cpu_no != prom.cpu) {
                        /* Primary Thread of non-boot cpu or any thread */
-                       prom_printf("starting cpu hw idx %lu... ", reg);
+                       prom_printf("starting cpu hw idx %lu... ", cpu_no);
                        call_prom("start-cpu", 3, 0, node,
-                                 secondary_hold, reg);
+                                 secondary_hold, cpu_no);
 
                        for (i = 0; (i < 100000000) && 
                             (*acknowledge == ((unsigned long)-1)); i++ )
                                mb();
 
-                       if (*acknowledge == reg)
+                       if (*acknowledge == cpu_no)
                                prom_printf("done\n");
                        else
                                prom_printf("failed: %x\n", *acknowledge);
                }
 #ifdef CONFIG_SMP
                else
-                       prom_printf("boot cpu hw idx %lu\n", reg);
+                       prom_printf("boot cpu hw idx %lu\n", cpu_no);
 #endif /* CONFIG_SMP */
        }
 
@@ -1895,6 +1927,7 @@ static void __init prom_find_mmu(void)
        prom.memory = call_prom("open", 1, 1, ADDR("/memory"));
        prom_getprop(prom.chosen, "mmu", &prom.mmumap,
                     sizeof(prom.mmumap));
+       prom.mmumap = be32_to_cpu(prom.mmumap);
        if (!IHANDLE_VALID(prom.memory) || !IHANDLE_VALID(prom.mmumap))
                of_workarounds &= ~OF_WA_CLAIM;         /* hmmm */
 }
@@ -1906,17 +1939,19 @@ static void __init prom_init_stdout(void)
 {
        char *path = of_stdout_device;
        char type[16];
-       u32 val;
+       phandle stdout_node;
+       __be32 val;
 
        if (prom_getprop(prom.chosen, "stdout", &val, sizeof(val)) <= 0)
                prom_panic("cannot find stdout");
 
-       prom.stdout = val;
+       prom.stdout = be32_to_cpu(val);
 
        /* Get the full OF pathname of the stdout device */
        memset(path, 0, 256);
        call_prom("instance-to-path", 3, 1, prom.stdout, path, 255);
-       val = call_prom("instance-to-package", 1, 1, prom.stdout);
+       stdout_node = call_prom("instance-to-package", 1, 1, prom.stdout);
+       val = cpu_to_be32(stdout_node);
        prom_setprop(prom.chosen, "/chosen", "linux,stdout-package",
                     &val, sizeof(val));
        prom_printf("OF stdout device is: %s\n", of_stdout_device);
@@ -1925,9 +1960,9 @@ static void __init prom_init_stdout(void)
 
        /* If it's a display, note it */
        memset(type, 0, sizeof(type));
-       prom_getprop(val, "device_type", type, sizeof(type));
+       prom_getprop(stdout_node, "device_type", type, sizeof(type));
        if (strcmp(type, "display") == 0)
-               prom_setprop(val, path, "linux,boot-display", NULL, 0);
+               prom_setprop(stdout_node, path, "linux,boot-display", NULL, 0);
 }
 
 static int __init prom_find_machine_type(void)
@@ -2082,6 +2117,22 @@ static void __init prom_check_displays(void)
                                           clut[2]) != 0)
                                break;
 #endif /* CONFIG_LOGO_LINUX_CLUT224 */
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_BOOTX
+               if (prom_getprop(node, "linux,boot-display", NULL, 0) !=
+                   PROM_ERROR) {
+                       u32 width, height, pitch, addr;
+
+                       prom_printf("Setting btext !\n");
+                       prom_getprop(node, "width", &width, 4);
+                       prom_getprop(node, "height", &height, 4);
+                       prom_getprop(node, "linebytes", &pitch, 4);
+                       prom_getprop(node, "address", &addr, 4);
+                       prom_printf("W=%d H=%d LB=%d addr=0x%x\n",
+                                   width, height, pitch, addr);
+                       btext_setup_display(width, height, 8, pitch, addr);
+               }
+#endif /* CONFIG_PPC_EARLY_DEBUG_BOOTX */
        }
 }
 
@@ -2117,8 +2168,10 @@ static void __init *make_room(unsigned long *mem_start, unsigned long *mem_end,
        return ret;
 }
 
-#define dt_push_token(token, mem_start, mem_end) \
-       do { *((u32 *)make_room(mem_start, mem_end, 4, 4)) = token; } while(0)
+#define dt_push_token(token, mem_start, mem_end) do {                  \
+               void *room = make_room(mem_start, mem_end, 4, 4);       \
+               *(__be32 *)room = cpu_to_be32(token);                   \
+       } while(0)
 
 static unsigned long __init dt_find_string(char *str)
 {
@@ -2291,7 +2344,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,
                        dt_push_token(4, mem_start, mem_end);
                        dt_push_token(soff, mem_start, mem_end);
                        valp = make_room(mem_start, mem_end, 4, 4);
-                       *(u32 *)valp = node;
+                       *(__be32 *)valp = cpu_to_be32(node);
                }
        }
 
@@ -2364,16 +2417,16 @@ static void __init flatten_device_tree(void)
        dt_struct_end = PAGE_ALIGN(mem_start);
 
        /* Finish header */
-       hdr->boot_cpuid_phys = prom.cpu;
-       hdr->magic = OF_DT_HEADER;
-       hdr->totalsize = dt_struct_end - dt_header_start;
-       hdr->off_dt_struct = dt_struct_start - dt_header_start;
-       hdr->off_dt_strings = dt_string_start - dt_header_start;
-       hdr->dt_strings_size = dt_string_end - dt_string_start;
-       hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - dt_header_start;
-       hdr->version = OF_DT_VERSION;
+       hdr->boot_cpuid_phys = cpu_to_be32(prom.cpu);
+       hdr->magic = cpu_to_be32(OF_DT_HEADER);
+       hdr->totalsize = cpu_to_be32(dt_struct_end - dt_header_start);
+       hdr->off_dt_struct = cpu_to_be32(dt_struct_start - dt_header_start);
+       hdr->off_dt_strings = cpu_to_be32(dt_string_start - dt_header_start);
+       hdr->dt_strings_size = cpu_to_be32(dt_string_end - dt_string_start);
+       hdr->off_mem_rsvmap = cpu_to_be32(((unsigned long)rsvmap) - dt_header_start);
+       hdr->version = cpu_to_be32(OF_DT_VERSION);
        /* Version 16 is not backward compatible */
-       hdr->last_comp_version = 0x10;
+       hdr->last_comp_version = cpu_to_be32(0x10);
 
        /* Copy the reserve map in */
        memcpy(rsvmap, mem_reserve_map, sizeof(mem_reserve_map));
@@ -2384,8 +2437,8 @@ static void __init flatten_device_tree(void)
                prom_printf("reserved memory map:\n");
                for (i = 0; i < mem_reserve_cnt; i++)
                        prom_printf("  %x - %x\n",
-                                   mem_reserve_map[i].base,
-                                   mem_reserve_map[i].size);
+                                   be64_to_cpu(mem_reserve_map[i].base),
+                                   be64_to_cpu(mem_reserve_map[i].size));
        }
 #endif
        /* Bump mem_reserve_cnt to cause further reservations to fail
@@ -2397,7 +2450,6 @@ static void __init flatten_device_tree(void)
                    dt_string_start, dt_string_end);
        prom_printf("Device tree struct  0x%x -> 0x%x\n",
                    dt_struct_start, dt_struct_end);
-
 }
 
 #ifdef CONFIG_PPC_MAPLE
@@ -2730,18 +2782,19 @@ static void __init fixup_device_tree(void)
 
 static void __init prom_find_boot_cpu(void)
 {
-       u32 getprop_rval;
+       __be32 rval;
        ihandle prom_cpu;
        phandle cpu_pkg;
 
-       prom.cpu = 0;
-       if (prom_getprop(prom.chosen, "cpu", &prom_cpu, sizeof(prom_cpu)) <= 0)
+       rval = 0;
+       if (prom_getprop(prom.chosen, "cpu", &rval, sizeof(rval)) <= 0)
                return;
+       prom_cpu = be32_to_cpu(rval);
 
        cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
 
-       prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
-       prom.cpu = getprop_rval;
+       prom_getprop(cpu_pkg, "reg", &rval, sizeof(rval));
+       prom.cpu = be32_to_cpu(rval);
 
        prom_debug("Booting CPU hw index = %lu\n", prom.cpu);
 }
@@ -2750,15 +2803,15 @@ static void __init prom_check_initrd(unsigned long r3, unsigned long r4)
 {
 #ifdef CONFIG_BLK_DEV_INITRD
        if (r3 && r4 && r4 != 0xdeadbeef) {
-               unsigned long val;
+               __be64 val;
 
                prom_initrd_start = is_kernel_addr(r3) ? __pa(r3) : r3;
                prom_initrd_end = prom_initrd_start + r4;
 
-               val = prom_initrd_start;
+               val = cpu_to_be64(prom_initrd_start);
                prom_setprop(prom.chosen, "/chosen", "linux,initrd-start",
                             &val, sizeof(val));
-               val = prom_initrd_end;
+               val = cpu_to_be64(prom_initrd_end);
                prom_setprop(prom.chosen, "/chosen", "linux,initrd-end",
                             &val, sizeof(val));
 
@@ -2915,7 +2968,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
         */
        prom_check_displays();
 
-#ifdef CONFIG_PPC64
+#if defined(CONFIG_PPC64) && defined(__BIG_ENDIAN__)
        /*
         * Initialize IOMMU (TCE tables) on pSeries. Do that before anything else
         * that uses the allocator, we need to make sure we get the top of memory
@@ -2934,6 +2987,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
                prom_instantiate_rtas();
 
 #ifdef CONFIG_PPC_POWERNV
+#ifdef __BIG_ENDIAN__
        /* Detect HAL and try instanciating it & doing takeover */
        if (of_platform == PLATFORM_PSERIES_LPAR) {
                prom_query_opal();
@@ -2941,9 +2995,11 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
                        prom_opal_hold_cpus();
                        prom_opal_takeover();
                }
-       } else if (of_platform == PLATFORM_OPAL)
+       } else
+#endif /* __BIG_ENDIAN__ */
+       if (of_platform == PLATFORM_OPAL)
                prom_instantiate_opal();
-#endif
+#endif /* CONFIG_PPC_POWERNV */
 
 #ifdef CONFIG_PPC64
        /* instantiate sml */
@@ -2962,10 +3018,11 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
        /*
         * Fill in some infos for use by the kernel later on
         */
-       if (prom_memory_limit)
+       if (prom_memory_limit) {
+               __be64 val = cpu_to_be64(prom_memory_limit);
                prom_setprop(prom.chosen, "/chosen", "linux,memory-limit",
-                            &prom_memory_limit,
-                            sizeof(prom_memory_limit));
+                            &val, sizeof(val));
+       }
 #ifdef CONFIG_PPC64
        if (prom_iommu_off)
                prom_setprop(prom.chosen, "/chosen", "linux,iommu-off",
index 3765da6..b0c263d 100644 (file)
@@ -22,7 +22,8 @@ __secondary_hold_acknowledge __secondary_hold_spinloop __start
 strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
 reloc_got2 kernstart_addr memstart_addr linux_banner _stext
 opal_query_takeover opal_do_takeover opal_enter_rtas opal_secondary_entry
-boot_command_line __prom_init_toc_start __prom_init_toc_end"
+boot_command_line __prom_init_toc_start __prom_init_toc_end
+btext_setup_display"
 
 NM="$1"
 OBJ="$2"
index 4e1331b..6295e64 100644 (file)
@@ -7,28 +7,27 @@
 #include <linux/of_address.h>
 #include <asm/prom.h>
 
-void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
-               unsigned long *busno, unsigned long *phys, unsigned long *size)
+void of_parse_dma_window(struct device_node *dn, const __be32 *dma_window,
+                        unsigned long *busno, unsigned long *phys,
+                        unsigned long *size)
 {
-       const u32 *dma_window;
        u32 cells;
-       const unsigned char *prop;
-
-       dma_window = dma_window_prop;
+       const __be32 *prop;
 
        /* busno is always one cell */
-       *busno = *(dma_window++);
+       *busno = of_read_number(dma_window, 1);
+       dma_window++;
 
        prop = of_get_property(dn, "ibm,#dma-address-cells", NULL);
        if (!prop)
                prop = of_get_property(dn, "#address-cells", NULL);
 
-       cells = prop ? *(u32 *)prop : of_n_addr_cells(dn);
+       cells = prop ? of_read_number(prop, 1) : of_n_addr_cells(dn);
        *phys = of_read_number(dma_window, cells);
 
        dma_window += cells;
 
        prop = of_get_property(dn, "ibm,#dma-size-cells", NULL);
-       cells = prop ? *(u32 *)prop : of_n_size_cells(dn);
+       cells = prop ? of_read_number(prop, 1) : of_n_size_cells(dn);
        *size = of_read_number(dma_window, cells);
 }
index 80b5ef4..4cf674d 100644 (file)
@@ -91,7 +91,7 @@ static void unlock_rtas(unsigned long flags)
  * are designed only for very early low-level debugging, which
  * is why the token is hard-coded to 10.
  */
-static void call_rtas_display_status(char c)
+static void call_rtas_display_status(unsigned char c)
 {
        struct rtas_args *args = &rtas.args;
        unsigned long s;
@@ -100,11 +100,11 @@ static void call_rtas_display_status(char c)
                return;
        s = lock_rtas();
 
-       args->token = 10;
-       args->nargs = 1;
-       args->nret  = 1;
-       args->rets  = (rtas_arg_t *)&(args->args[1]);
-       args->args[0] = (unsigned char)c;
+       args->token = cpu_to_be32(10);
+       args->nargs = cpu_to_be32(1);
+       args->nret  = cpu_to_be32(1);
+       args->rets  = &(args->args[1]);
+       args->args[0] = cpu_to_be32(c);
 
        enter_rtas(__pa(args));
 
@@ -204,7 +204,7 @@ void rtas_progress(char *s, unsigned short hex)
 {
        struct device_node *root;
        int width;
-       const int *p;
+       const __be32 *p;
        char *os;
        static int display_character, set_indicator;
        static int display_width, display_lines, form_feed;
@@ -221,13 +221,13 @@ void rtas_progress(char *s, unsigned short hex)
                if ((root = of_find_node_by_path("/rtas"))) {
                        if ((p = of_get_property(root,
                                        "ibm,display-line-length", NULL)))
-                               display_width = *p;
+                               display_width = be32_to_cpu(*p);
                        if ((p = of_get_property(root,
                                        "ibm,form-feed", NULL)))
-                               form_feed = *p;
+                               form_feed = be32_to_cpu(*p);
                        if ((p = of_get_property(root,
                                        "ibm,display-number-of-lines", NULL)))
-                               display_lines = *p;
+                               display_lines = be32_to_cpu(*p);
                        row_width = of_get_property(root,
                                        "ibm,display-truncation-length", NULL);
                        of_node_put(root);
@@ -322,11 +322,11 @@ EXPORT_SYMBOL(rtas_progress);             /* needed by rtas_flash module */
 
 int rtas_token(const char *service)
 {
-       const int *tokp;
+       const __be32 *tokp;
        if (rtas.dev == NULL)
                return RTAS_UNKNOWN_SERVICE;
        tokp = of_get_property(rtas.dev, service, NULL);
-       return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
+       return tokp ? be32_to_cpu(*tokp) : RTAS_UNKNOWN_SERVICE;
 }
 EXPORT_SYMBOL(rtas_token);
 
@@ -380,11 +380,11 @@ static char *__fetch_rtas_last_error(char *altbuf)
 
        bufsz = rtas_get_error_log_max();
 
-       err_args.token = rtas_last_error_token;
-       err_args.nargs = 2;
-       err_args.nret = 1;
-       err_args.args[0] = (rtas_arg_t)__pa(rtas_err_buf);
-       err_args.args[1] = bufsz;
+       err_args.token = cpu_to_be32(rtas_last_error_token);
+       err_args.nargs = cpu_to_be32(2);
+       err_args.nret = cpu_to_be32(1);
+       err_args.args[0] = cpu_to_be32(__pa(rtas_err_buf));
+       err_args.args[1] = cpu_to_be32(bufsz);
        err_args.args[2] = 0;
 
        save_args = rtas.args;
@@ -433,13 +433,13 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
        s = lock_rtas();
        rtas_args = &rtas.args;
 
-       rtas_args->token = token;
-       rtas_args->nargs = nargs;
-       rtas_args->nret  = nret;
-       rtas_args->rets  = (rtas_arg_t *)&(rtas_args->args[nargs]);
+       rtas_args->token = cpu_to_be32(token);
+       rtas_args->nargs = cpu_to_be32(nargs);
+       rtas_args->nret  = cpu_to_be32(nret);
+       rtas_args->rets  = &(rtas_args->args[nargs]);
        va_start(list, outputs);
        for (i = 0; i < nargs; ++i)
-               rtas_args->args[i] = va_arg(list, rtas_arg_t);
+               rtas_args->args[i] = cpu_to_be32(va_arg(list, __u32));
        va_end(list);
 
        for (i = 0; i < nret; ++i)
@@ -449,13 +449,13 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
 
        /* A -1 return code indicates that the last command couldn't
           be completed due to a hardware error. */
-       if (rtas_args->rets[0] == -1)
+       if (be32_to_cpu(rtas_args->rets[0]) == -1)
                buff_copy = __fetch_rtas_last_error(NULL);
 
        if (nret > 1 && outputs != NULL)
                for (i = 0; i < nret-1; ++i)
-                       outputs[i] = rtas_args->rets[i+1];
-       ret = (nret > 0)? rtas_args->rets[0]: 0;
+                       outputs[i] = be32_to_cpu(rtas_args->rets[i+1]);
+       ret = (nret > 0)? be32_to_cpu(rtas_args->rets[0]): 0;
 
        unlock_rtas(s);
 
@@ -588,8 +588,8 @@ bool rtas_indicator_present(int token, int *maxindex)
 {
        int proplen, count, i;
        const struct indicator_elem {
-               u32 token;
-               u32 maxindex;
+               __be32 token;
+               __be32 maxindex;
        } *indicators;
 
        indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen);
@@ -599,10 +599,10 @@ bool rtas_indicator_present(int token, int *maxindex)
        count = proplen / sizeof(struct indicator_elem);
 
        for (i = 0; i < count; i++) {
-               if (indicators[i].token != token)
+               if (__be32_to_cpu(indicators[i].token) != token)
                        continue;
                if (maxindex)
-                       *maxindex = indicators[i].maxindex;
+                       *maxindex = __be32_to_cpu(indicators[i].maxindex);
                return true;
        }
 
@@ -1097,19 +1097,19 @@ void __init rtas_initialize(void)
         */
        rtas.dev = of_find_node_by_name(NULL, "rtas");
        if (rtas.dev) {
-               const u32 *basep, *entryp, *sizep;
+               const __be32 *basep, *entryp, *sizep;
 
                basep = of_get_property(rtas.dev, "linux,rtas-base", NULL);
                sizep = of_get_property(rtas.dev, "rtas-size", NULL);
                if (basep != NULL && sizep != NULL) {
-                       rtas.base = *basep;
-                       rtas.size = *sizep;
+                       rtas.base = __be32_to_cpu(*basep);
+                       rtas.size = __be32_to_cpu(*sizep);
                        entryp = of_get_property(rtas.dev,
                                        "linux,rtas-entry", NULL);
                        if (entryp == NULL) /* Ugh */
                                rtas.entry = rtas.base;
                        else
-                               rtas.entry = *entryp;
+                               rtas.entry = __be32_to_cpu(*entryp);
                } else
                        rtas.dev = NULL;
        }
index 63d051f..3d261c0 100644 (file)
@@ -436,7 +436,8 @@ void __init smp_setup_cpu_maps(void)
        DBG("smp_setup_cpu_maps()\n");
 
        while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < nr_cpu_ids) {
-               const int *intserv;
+               const __be32 *intserv;
+               __be32 cpu_be;
                int j, len;
 
                DBG("  * %s...\n", dn->full_name);
@@ -450,15 +451,17 @@ void __init smp_setup_cpu_maps(void)
                } else {
                        DBG("    no ibm,ppc-interrupt-server#s -> 1 thread\n");
                        intserv = of_get_property(dn, "reg", NULL);
-                       if (!intserv)
-                               intserv = &cpu; /* assume logical == phys */
+                       if (!intserv) {
+                               cpu_be = cpu_to_be32(cpu);
+                               intserv = &cpu_be;      /* assume logical == phys */
+                       }
                }
 
                for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) {
                        DBG("    thread %d -> cpu %d (hard id %d)\n",
-                           j, cpu, intserv[j]);
+                           j, cpu, be32_to_cpu(intserv[j]));
                        set_cpu_present(cpu, true);
-                       set_hard_smp_processor_id(cpu, intserv[j]);
+                       set_hard_smp_processor_id(cpu, be32_to_cpu(intserv[j]));
                        set_cpu_possible(cpu, true);
                        cpu++;
                }
index a8f54ec..a4bbcae 100644 (file)
@@ -38,6 +38,7 @@
 #include <asm/serial.h>
 #include <asm/udbg.h>
 #include <asm/mmu_context.h>
+#include <asm/epapr_hcalls.h>
 
 #include "setup.h"
 
@@ -128,6 +129,8 @@ notrace void __init machine_init(u64 dt_ptr)
        /* Do some early initialization based on the flat device tree */
        early_init_devtree(__va(dt_ptr));
 
+       epapr_paravirt_early_init();
+
        early_init_mmu();
 
        probe_machine();
@@ -326,5 +329,4 @@ void __init setup_arch(char **cmdline_p)
 
        /* Initialize the MMU context management stuff */
        mmu_context_init();
-
 }
index fe6a58c..278ca93 100644 (file)
@@ -10,7 +10,7 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#undef DEBUG
+#define DEBUG
 
 #include <linux/export.h>
 #include <linux/string.h>
@@ -66,6 +66,7 @@
 #include <asm/code-patching.h>
 #include <asm/kvm_ppc.h>
 #include <asm/hugetlb.h>
+#include <asm/epapr_hcalls.h>
 
 #include "setup.h"
 
@@ -215,6 +216,8 @@ void __init early_setup(unsigned long dt_ptr)
         */
        early_init_devtree(__va(dt_ptr));
 
+       epapr_paravirt_early_init();
+
        /* Now we know the logical id of our boot cpu, setup the paca. */
        setup_paca(&paca[boot_cpuid]);
        fixup_boot_paca();
@@ -239,6 +242,18 @@ void __init early_setup(unsigned long dt_ptr)
        reserve_hugetlb_gpages();
 
        DBG(" <- early_setup()\n");
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_BOOTX
+       /*
+        * This needs to be done *last* (after the above DBG() even)
+        *
+        * Right after we return from this function, we turn on the MMU
+        * which means the real-mode access trick that btext does will
+        * no longer work, it needs to switch to using a real MMU
+        * mapping. This call will ensure that it does
+        */
+       btext_map();
+#endif /* CONFIG_PPC_EARLY_DEBUG_BOOTX */
 }
 
 #ifdef CONFIG_SMP
@@ -307,14 +322,14 @@ static void __init initialize_cache_info(void)
                 * d-cache and i-cache sizes... -Peter
                 */
                if (num_cpus == 1) {
-                       const u32 *sizep, *lsizep;
+                       const __be32 *sizep, *lsizep;
                        u32 size, lsize;
 
                        size = 0;
                        lsize = cur_cpu_spec->dcache_bsize;
                        sizep = of_get_property(np, "d-cache-size", NULL);
                        if (sizep != NULL)
-                               size = *sizep;
+                               size = be32_to_cpu(*sizep);
                        lsizep = of_get_property(np, "d-cache-block-size",
                                                 NULL);
                        /* fallback if block size missing */
@@ -323,8 +338,8 @@ static void __init initialize_cache_info(void)
                                                         "d-cache-line-size",
                                                         NULL);
                        if (lsizep != NULL)
-                               lsize = *lsizep;
-                       if (sizep == 0 || lsizep == 0)
+                               lsize = be32_to_cpu(*lsizep);
+                       if (sizep == NULL || lsizep == NULL)
                                DBG("Argh, can't find dcache properties ! "
                                    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
@@ -337,7 +352,7 @@ static void __init initialize_cache_info(void)
                        lsize = cur_cpu_spec->icache_bsize;
                        sizep = of_get_property(np, "i-cache-size", NULL);
                        if (sizep != NULL)
-                               size = *sizep;
+                               size = be32_to_cpu(*sizep);
                        lsizep = of_get_property(np, "i-cache-block-size",
                                                 NULL);
                        if (lsizep == NULL)
@@ -345,8 +360,8 @@ static void __init initialize_cache_info(void)
                                                         "i-cache-line-size",
                                                         NULL);
                        if (lsizep != NULL)
-                               lsize = *lsizep;
-                       if (sizep == 0 || lsizep == 0)
+                               lsize = be32_to_cpu(*lsizep);
+                       if (sizep == NULL || lsizep == NULL)
                                DBG("Argh, can't find icache properties ! "
                                    "sizep: %p, lsizep: %p\n", sizep, lsizep);
 
@@ -701,8 +716,7 @@ void __init setup_per_cpu_areas(void)
 #endif
 
 
-#ifdef CONFIG_PPC_INDIRECT_IO
+#if defined(CONFIG_PPC_INDIRECT_PIO) || defined(CONFIG_PPC_INDIRECT_MMIO)
 struct ppc_pci_io ppc_pci_io;
 EXPORT_SYMBOL(ppc_pci_io);
-#endif /* CONFIG_PPC_INDIRECT_IO */
-
+#endif
index 0f83122..bebdf1a 100644 (file)
@@ -436,7 +436,10 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
         * use altivec. Since VSCR only contains 32 bits saved in the least
         * significant bits of a vector, we "cheat" and stuff VRSAVE in the
         * most significant bits of that same vector. --BenH
+        * Note that the current VRSAVE value is in the SPR at this point.
         */
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               current->thread.vrsave = mfspr(SPRN_VRSAVE);
        if (__put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32]))
                return 1;
 #endif /* CONFIG_ALTIVEC */
@@ -557,6 +560,8 @@ static int save_tm_user_regs(struct pt_regs *regs,
         * significant bits of a vector, we "cheat" and stuff VRSAVE in the
         * most significant bits of that same vector. --BenH
         */
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               current->thread.vrsave = mfspr(SPRN_VRSAVE);
        if (__put_user(current->thread.vrsave,
                       (u32 __user *)&frame->mc_vregs[32]))
                return 1;
@@ -696,6 +701,8 @@ static long restore_user_regs(struct pt_regs *regs,
        /* Always get VRSAVE back */
        if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
                return 1;
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               mtspr(SPRN_VRSAVE, current->thread.vrsave);
 #endif /* CONFIG_ALTIVEC */
        if (copy_fpr_from_user(current, &sr->mc_fregs))
                return 1;
@@ -809,6 +816,8 @@ static long restore_tm_user_regs(struct pt_regs *regs,
            __get_user(current->thread.transact_vrsave,
                       (u32 __user *)&tm_sr->mc_vregs[32]))
                return 1;
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               mtspr(SPRN_VRSAVE, current->thread.vrsave);
 #endif /* CONFIG_ALTIVEC */
 
        regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1);
index 887e99d..f93ec28 100644 (file)
@@ -96,8 +96,6 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
        unsigned long msr = regs->msr;
        long err = 0;
 
-       flush_fp_to_thread(current);
-
 #ifdef CONFIG_ALTIVEC
        err |= __put_user(v_regs, &sc->v_regs);
 
@@ -114,6 +112,8 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
        /* We always copy to/from vrsave, it's 0 if we don't have or don't
         * use altivec.
         */
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               current->thread.vrsave = mfspr(SPRN_VRSAVE);
        err |= __put_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
 #else /* CONFIG_ALTIVEC */
        err |= __put_user(0, &sc->v_regs);
@@ -217,6 +217,8 @@ static long setup_tm_sigcontexts(struct sigcontext __user *sc,
        /* We always copy to/from vrsave, it's 0 if we don't have or don't
         * use altivec.
         */
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               current->thread.vrsave = mfspr(SPRN_VRSAVE);
        err |= __put_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
        if (msr & MSR_VEC)
                err |= __put_user(current->thread.transact_vrsave,
@@ -346,16 +348,18 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
        if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128)))
                return -EFAULT;
        /* Copy 33 vec registers (vr0..31 and vscr) from the stack */
-       if (v_regs != 0 && (msr & MSR_VEC) != 0)
+       if (v_regs != NULL && (msr & MSR_VEC) != 0)
                err |= __copy_from_user(current->thread.vr, v_regs,
                                        33 * sizeof(vector128));
        else if (current->thread.used_vr)
                memset(current->thread.vr, 0, 33 * sizeof(vector128));
        /* Always get VRSAVE back */
-       if (v_regs != 0)
+       if (v_regs != NULL)
                err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
        else
                current->thread.vrsave = 0;
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               mtspr(SPRN_VRSAVE, current->thread.vrsave);
 #endif /* CONFIG_ALTIVEC */
        /* restore floating point */
        err |= copy_fpr_from_user(current, &sc->fp_regs);
@@ -463,7 +467,7 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
                                    tm_v_regs, 34 * sizeof(vector128)))
                return -EFAULT;
        /* Copy 33 vec registers (vr0..31 and vscr) from the stack */
-       if (v_regs != 0 && tm_v_regs != 0 && (msr & MSR_VEC) != 0) {
+       if (v_regs != NULL && tm_v_regs != NULL && (msr & MSR_VEC) != 0) {
                err |= __copy_from_user(current->thread.vr, v_regs,
                                        33 * sizeof(vector128));
                err |= __copy_from_user(current->thread.transact_vr, tm_v_regs,
@@ -474,7 +478,7 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
                memset(current->thread.transact_vr, 0, 33 * sizeof(vector128));
        }
        /* Always get VRSAVE back */
-       if (v_regs != 0 && tm_v_regs != 0) {
+       if (v_regs != NULL && tm_v_regs != NULL) {
                err |= __get_user(current->thread.vrsave,
                                  (u32 __user *)&v_regs[33]);
                err |= __get_user(current->thread.transact_vrsave,
@@ -484,6 +488,8 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
                current->thread.vrsave = 0;
                current->thread.transact_vrsave = 0;
        }
+       if (cpu_has_feature(CPU_FTR_ALTIVEC))
+               mtspr(SPRN_VRSAVE, current->thread.vrsave);
 #endif /* CONFIG_ALTIVEC */
        /* restore floating point */
        err |= copy_fpr_from_user(current, &sc->fp_regs);
index 38b0ba6..442d8e2 100644 (file)
@@ -81,6 +81,28 @@ int smt_enabled_at_boot = 1;
 
 static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
 
+/*
+ * Returns 1 if the specified cpu should be brought up during boot.
+ * Used to inhibit booting threads if they've been disabled or
+ * limited on the command line
+ */
+int smp_generic_cpu_bootable(unsigned int nr)
+{
+       /* Special case - we inhibit secondary thread startup
+        * during boot if the user requests it.
+        */
+       if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
+               if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
+                       return 0;
+               if (smt_enabled_at_boot
+                   && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
+                       return 0;
+       }
+
+       return 1;
+}
+
+
 #ifdef CONFIG_PPC64
 int smp_generic_kick_cpu(int nr)
 {
@@ -172,7 +194,7 @@ int smp_request_message_ipi(int virq, int msg)
 #endif
        err = request_irq(virq, smp_ipi_action[msg],
                          IRQF_PERCPU | IRQF_NO_THREAD | IRQF_NO_SUSPEND,
-                         smp_ipi_name[msg], 0);
+                         smp_ipi_name[msg], NULL);
        WARN(err < 0, "unable to request_irq %d for %s (rc %d)\n",
                virq, smp_ipi_name[msg], err);
 
@@ -210,6 +232,12 @@ void smp_muxed_ipi_message_pass(int cpu, int msg)
        smp_ops->cause_ipi(cpu, info->data);
 }
 
+#ifdef __BIG_ENDIAN__
+#define IPI_MESSAGE(A) (1 << (24 - 8 * (A)))
+#else
+#define IPI_MESSAGE(A) (1 << (8 * (A)))
+#endif
+
 irqreturn_t smp_ipi_demux(void)
 {
        struct cpu_messages *info = &__get_cpu_var(ipi_message);
@@ -219,19 +247,14 @@ irqreturn_t smp_ipi_demux(void)
 
        do {
                all = xchg(&info->messages, 0);
-
-#ifdef __BIG_ENDIAN
-               if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION)))
+               if (all & IPI_MESSAGE(PPC_MSG_CALL_FUNCTION))
                        generic_smp_call_function_interrupt();
-               if (all & (1 << (24 - 8 * PPC_MSG_RESCHEDULE)))
+               if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE))
                        scheduler_ipi();
-               if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNC_SINGLE)))
+               if (all & IPI_MESSAGE(PPC_MSG_CALL_FUNC_SINGLE))
                        generic_smp_call_function_single_interrupt();
-               if (all & (1 << (24 - 8 * PPC_MSG_DEBUGGER_BREAK)))
+               if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK))
                        debug_ipi_action(0, NULL);
-#else
-#error Unsupported ENDIAN
-#endif
        } while (info->messages);
 
        return IRQ_HANDLED;
@@ -574,6 +597,21 @@ out:
        return id;
 }
 
+/* Return the value of the chip-id property corresponding
+ * to the given logical cpu.
+ */
+int cpu_to_chip_id(int cpu)
+{
+       struct device_node *np;
+
+       np = of_get_cpu_node(cpu, NULL);
+       if (!np)
+               return -1;
+
+       of_node_put(np);
+       return of_get_ibm_chip_id(np);
+}
+
 /* Helper routines for cpu to core mapping */
 int cpu_core_index_of_thread(int cpu)
 {
@@ -587,6 +625,33 @@ int cpu_first_thread_of_core(int core)
 }
 EXPORT_SYMBOL_GPL(cpu_first_thread_of_core);
 
+static void traverse_siblings_chip_id(int cpu, bool add, int chipid)
+{
+       const struct cpumask *mask;
+       struct device_node *np;
+       int i, plen;
+       const __be32 *prop;
+
+       mask = add ? cpu_online_mask : cpu_present_mask;
+       for_each_cpu(i, mask) {
+               np = of_get_cpu_node(i, NULL);
+               if (!np)
+                       continue;
+               prop = of_get_property(np, "ibm,chip-id", &plen);
+               if (prop && plen == sizeof(int) &&
+                   of_read_number(prop, 1) == chipid) {
+                       if (add) {
+                               cpumask_set_cpu(cpu, cpu_core_mask(i));
+                               cpumask_set_cpu(i, cpu_core_mask(cpu));
+                       } else {
+                               cpumask_clear_cpu(cpu, cpu_core_mask(i));
+                               cpumask_clear_cpu(i, cpu_core_mask(cpu));
+                       }
+               }
+               of_node_put(np);
+       }
+}
+
 /* Must be called when no change can occur to cpu_present_mask,
  * i.e. during cpu online or offline.
  */
@@ -609,11 +674,51 @@ static struct device_node *cpu_to_l2cache(int cpu)
        return cache;
 }
 
+static void traverse_core_siblings(int cpu, bool add)
+{
+       struct device_node *l2_cache, *np;
+       const struct cpumask *mask;
+       int i, chip, plen;
+       const __be32 *prop;
+
+       /* First see if we have ibm,chip-id properties in cpu nodes */
+       np = of_get_cpu_node(cpu, NULL);
+       if (np) {
+               chip = -1;
+               prop = of_get_property(np, "ibm,chip-id", &plen);
+               if (prop && plen == sizeof(int))
+                       chip = of_read_number(prop, 1);
+               of_node_put(np);
+               if (chip >= 0) {
+                       traverse_siblings_chip_id(cpu, add, chip);
+                       return;
+               }
+       }
+
+       l2_cache = cpu_to_l2cache(cpu);
+       mask = add ? cpu_online_mask : cpu_present_mask;
+       for_each_cpu(i, mask) {
+               np = cpu_to_l2cache(i);
+               if (!np)
+                       continue;
+               if (np == l2_cache) {
+                       if (add) {
+                               cpumask_set_cpu(cpu, cpu_core_mask(i));
+                               cpumask_set_cpu(i, cpu_core_mask(cpu));
+                       } else {
+                               cpumask_clear_cpu(cpu, cpu_core_mask(i));
+                               cpumask_clear_cpu(i, cpu_core_mask(cpu));
+                       }
+               }
+               of_node_put(np);
+       }
+       of_node_put(l2_cache);
+}
+
 /* Activate a secondary processor. */
 void start_secondary(void *unused)
 {
        unsigned int cpu = smp_processor_id();
-       struct device_node *l2_cache;
        int i, base;
 
        atomic_inc(&init_mm.mm_count);
@@ -652,18 +757,7 @@ void start_secondary(void *unused)
                cpumask_set_cpu(cpu, cpu_core_mask(base + i));
                cpumask_set_cpu(base + i, cpu_core_mask(cpu));
        }
-       l2_cache = cpu_to_l2cache(cpu);
-       for_each_online_cpu(i) {
-               struct device_node *np = cpu_to_l2cache(i);
-               if (!np)
-                       continue;
-               if (np == l2_cache) {
-                       cpumask_set_cpu(cpu, cpu_core_mask(i));
-                       cpumask_set_cpu(i, cpu_core_mask(cpu));
-               }
-               of_node_put(np);
-       }
-       of_node_put(l2_cache);
+       traverse_core_siblings(cpu, true);
 
        smp_wmb();
        notify_cpu_starting(cpu);
@@ -719,7 +813,6 @@ int arch_sd_sibling_asym_packing(void)
 #ifdef CONFIG_HOTPLUG_CPU
 int __cpu_disable(void)
 {
-       struct device_node *l2_cache;
        int cpu = smp_processor_id();
        int base, i;
        int err;
@@ -739,20 +832,7 @@ int __cpu_disable(void)
                cpumask_clear_cpu(cpu, cpu_core_mask(base + i));
                cpumask_clear_cpu(base + i, cpu_core_mask(cpu));
        }
-
-       l2_cache = cpu_to_l2cache(cpu);
-       for_each_present_cpu(i) {
-               struct device_node *np = cpu_to_l2cache(i);
-               if (!np)
-                       continue;
-               if (np == l2_cache) {
-                       cpumask_clear_cpu(cpu, cpu_core_mask(i));
-                       cpumask_clear_cpu(i, cpu_core_mask(cpu));
-               }
-               of_node_put(np);
-       }
-       of_node_put(l2_cache);
-
+       traverse_core_siblings(cpu, false);
 
        return 0;
 }
diff --git a/arch/powerpc/kernel/softemu8xx.c b/arch/powerpc/kernel/softemu8xx.c
deleted file mode 100644 (file)
index 29b2f81..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Software emulation of some PPC instructions for the 8xx core.
- *
- * Copyright (C) 1998 Dan Malek (dmalek@jlc.net)
- *
- * Software floating emuation for the MPC8xx processor.  I did this mostly
- * because it was easier than trying to get the libraries compiled for
- * software floating point.  The goal is still to get the libraries done,
- * but I lost patience and needed some hacks to at least get init and
- * shells running.  The first problem is the setjmp/longjmp that save
- * and restore the floating point registers.
- *
- * For this emulation, our working registers are found on the register
- * save area.
- */
-
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/stddef.h>
-#include <linux/unistd.h>
-#include <linux/ptrace.h>
-#include <linux/user.h>
-#include <linux/interrupt.h>
-
-#include <asm/pgtable.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-/* Eventually we may need a look-up table, but this works for now.
-*/
-#define LFS    48
-#define LFD    50
-#define LFDU   51
-#define STFD   54
-#define STFDU  55
-#define FMR    63
-
-void print_8xx_pte(struct mm_struct *mm, unsigned long addr)
-{
-       pgd_t *pgd;
-       pmd_t *pmd;
-       pte_t *pte;
-
-       printk(" pte @ 0x%8lx: ", addr);
-       pgd = pgd_offset(mm, addr & PAGE_MASK);
-       if (pgd) {
-               pmd = pmd_offset(pud_offset(pgd, addr & PAGE_MASK),
-                                addr & PAGE_MASK);
-               if (pmd && pmd_present(*pmd)) {
-                       pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
-                       if (pte) {
-                               printk(" (0x%08lx)->(0x%08lx)->0x%08lx\n",
-                                       (long)pgd, (long)pte, (long)pte_val(*pte));
-#define pp ((long)pte_val(*pte))
-                               printk(" RPN: %05lx PP: %lx SPS: %lx SH: %lx "
-                                      "CI: %lx v: %lx\n",
-                                      pp>>12,    /* rpn */
-                                      (pp>>10)&3, /* pp */
-                                      (pp>>3)&1, /* small */
-                                      (pp>>2)&1, /* shared */
-                                      (pp>>1)&1, /* cache inhibit */
-                                      pp&1       /* valid */
-                                      );
-#undef pp
-                       }
-                       else {
-                               printk("no pte\n");
-                       }
-               }
-               else {
-                       printk("no pmd\n");
-               }
-       }
-       else {
-               printk("no pgd\n");
-       }
-}
-
-int get_8xx_pte(struct mm_struct *mm, unsigned long addr)
-{
-       pgd_t *pgd;
-       pmd_t *pmd;
-       pte_t *pte;
-       int retval = 0;
-
-       pgd = pgd_offset(mm, addr & PAGE_MASK);
-       if (pgd) {
-               pmd = pmd_offset(pud_offset(pgd, addr & PAGE_MASK),
-                                addr & PAGE_MASK);
-               if (pmd && pmd_present(*pmd)) {
-                       pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
-                       if (pte) {
-                               retval = (int)pte_val(*pte);
-                       }
-               }
-       }
-       return retval;
-}
-
-/*
- * We return 0 on success, 1 on unimplemented instruction, and EFAULT
- * if a load/store faulted.
- */
-int Soft_emulate_8xx(struct pt_regs *regs)
-{
-       u32 inst, instword;
-       u32 flreg, idxreg, disp;
-       int retval;
-       s16 sdisp;
-       u32 *ea, *ip;
-
-       retval = 0;
-
-       instword = *((u32 *)regs->nip);
-       inst = instword >> 26;
-
-       flreg = (instword >> 21) & 0x1f;
-       idxreg = (instword >> 16) & 0x1f;
-       disp = instword & 0xffff;
-
-       ea = (u32 *)(regs->gpr[idxreg] + disp);
-       ip = (u32 *)&current->thread.TS_FPR(flreg);
-
-       switch ( inst )
-       {
-       case LFD:
-               /* this is a 16 bit quantity that is sign extended
-                * so use a signed short here -- Cort
-                */
-               sdisp = (instword & 0xffff);
-               ea = (u32 *)(regs->gpr[idxreg] + sdisp);
-               if (copy_from_user(ip, ea, sizeof(double)))
-                       retval = -EFAULT;
-               break;
-
-       case LFDU:
-               if (copy_from_user(ip, ea, sizeof(double)))
-                       retval = -EFAULT;
-               else
-                       regs->gpr[idxreg] = (u32)ea;
-               break;
-       case LFS:
-               sdisp = (instword & 0xffff);
-               ea = (u32 *)(regs->gpr[idxreg] + sdisp);
-               if (copy_from_user(ip, ea, sizeof(float)))
-                       retval = -EFAULT;
-               break;
-       case STFD:
-               /* this is a 16 bit quantity that is sign extended
-                * so use a signed short here -- Cort
-                */
-               sdisp = (instword & 0xffff);
-               ea = (u32 *)(regs->gpr[idxreg] + sdisp);
-               if (copy_to_user(ea, ip, sizeof(double)))
-                       retval = -EFAULT;
-               break;
-
-       case STFDU:
-               if (copy_to_user(ea, ip, sizeof(double)))
-                       retval = -EFAULT;
-               else
-                       regs->gpr[idxreg] = (u32)ea;
-               break;
-       case FMR:
-               /* assume this is a fp move -- Cort */
-               memcpy(ip, &current->thread.TS_FPR((instword>>11)&0x1f),
-                      sizeof(double));
-               break;
-       default:
-               retval = 1;
-               printk("Bad emulation %s/%d\n"
-                      " NIP: %08lx instruction: %08x opcode: %x "
-                      "A: %x B: %x C: %x code: %x rc: %x\n",
-                      current->comm,current->pid,
-                      regs->nip,
-                      instword,inst,
-                      (instword>>16)&0x1f,
-                      (instword>>11)&0x1f,
-                      (instword>>6)&0x1f,
-                      (instword>>1)&0x3ff,
-                      instword&1);
-               {
-                       int pa;
-                       print_8xx_pte(current->mm,regs->nip);
-                       pa = get_8xx_pte(current->mm,regs->nip) & PAGE_MASK;
-                       pa |= (regs->nip & ~PAGE_MASK);
-                       pa = (unsigned long)__va(pa);
-                       printk("Kernel VA for NIP %x ", pa);
-                       print_8xx_pte(current->mm,pa);
-               }
-       }
-
-       if (retval == 0)
-               regs->nip += 4;
-
-       return retval;
-}
index 86ac1d9..2204598 100644 (file)
 #define SL_r29         0xe8
 #define SL_r30         0xf0
 #define SL_r31         0xf8
-#define SL_SIZE                SL_r31+8
+#define SL_SPRG1       0x100
+#define SL_TCR         0x108
+#define SL_SIZE                SL_TCR+8
 
 /* these macros rely on the save area being
  * pointed to by r11 */
+
+#define SAVE_SPR(register)             \
+       mfspr   r0, SPRN_##register     ;\
+       std     r0, SL_##register(r11)
+#define RESTORE_SPR(register)          \
+       ld      r0, SL_##register(r11)  ;\
+       mtspr   SPRN_##register, r0
 #define SAVE_SPECIAL(special)          \
        mf##special     r0              ;\
        std     r0, SL_##special(r11)
@@ -103,8 +112,15 @@ _GLOBAL(swsusp_arch_suspend)
        SAVE_REGISTER(r30)
        SAVE_REGISTER(r31)
        SAVE_SPECIAL(MSR)
-       SAVE_SPECIAL(SDR1)
        SAVE_SPECIAL(XER)
+#ifdef CONFIG_PPC_BOOK3S_64
+       SAVE_SPECIAL(SDR1)
+#else
+       SAVE_SPR(TCR)
+
+       /* Save SPRG1, SPRG1 be used save paca */
+       SAVE_SPR(SPRG1)
+#endif
 
        /* we push the stack up 128 bytes but don't store the
         * stack pointer on the stack like a real stackframe */
@@ -151,6 +167,7 @@ copy_page_loop:
        bne+    copyloop
 nothing_to_copy:
 
+#ifdef CONFIG_PPC_BOOK3S_64
        /* flush caches */
        lis     r3, 0x10
        mtctr   r3
@@ -167,6 +184,7 @@ nothing_to_copy:
        sync
 
        tlbia
+#endif
 
        ld      r11,swsusp_save_area_ptr@toc(r2)
 
@@ -208,16 +226,39 @@ nothing_to_copy:
        RESTORE_REGISTER(r29)
        RESTORE_REGISTER(r30)
        RESTORE_REGISTER(r31)
+
+#ifdef CONFIG_PPC_BOOK3S_64
        /* can't use RESTORE_SPECIAL(MSR) */
        ld      r0, SL_MSR(r11)
        mtmsrd  r0, 0
        RESTORE_SPECIAL(SDR1)
+#else
+       /* Restore SPRG1, be used to save paca */
+       ld      r0, SL_SPRG1(r11)
+       mtsprg  1, r0
+
+       RESTORE_SPECIAL(MSR)
+
+       /* Restore TCR and clear any pending bits in TSR. */
+       RESTORE_SPR(TCR)
+       lis     r0, (TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS)@h
+       mtspr   SPRN_TSR, r0
+
+       /* Kick decrementer */
+       li      r0, 1
+       mtdec   r0
+
+       /* Invalidate all tlbs */
+       bl      _tlbil_all
+#endif
        RESTORE_SPECIAL(XER)
 
        sync
 
        addi    r1,r1,-128
+#ifdef CONFIG_PPC_BOOK3S_64
        bl      slb_flush_and_rebolt
+#endif
        bl      do_after_copyback
        addi    r1,r1,128
 
index 11a3930..0f20405 100644 (file)
@@ -141,6 +141,14 @@ _GLOBAL(swsusp_arch_resume)
        lis     r11,swsusp_save_area@h
        ori     r11,r11,swsusp_save_area@l
 
+       /*
+        * Mappings from virtual addresses to physical addresses may be
+        * different than they were prior to restoring hibernation state. 
+        * Invalidate the TLB so that the boot CPU is using the new
+        * mappings.
+        */
+       bl      _tlbil_all
+
        lwz     r4,SL_SPRG0(r11)
        mtsprg  0,r4
        lwz     r4,SL_SPRG1(r11)
index cdcc156..192b051 100644 (file)
@@ -210,18 +210,18 @@ static u64 scan_dispatch_log(u64 stop_tb)
        if (!dtl)
                return 0;
 
-       if (i == vpa->dtl_idx)
+       if (i == be64_to_cpu(vpa->dtl_idx))
                return 0;
-       while (i < vpa->dtl_idx) {
+       while (i < be64_to_cpu(vpa->dtl_idx)) {
                if (dtl_consumer)
                        dtl_consumer(dtl, i);
-               dtb = dtl->timebase;
-               tb_delta = dtl->enqueue_to_dispatch_time +
-                       dtl->ready_to_enqueue_time;
+               dtb = be64_to_cpu(dtl->timebase);
+               tb_delta = be32_to_cpu(dtl->enqueue_to_dispatch_time) +
+                       be32_to_cpu(dtl->ready_to_enqueue_time);
                barrier();
-               if (i + N_DISPATCH_LOG < vpa->dtl_idx) {
+               if (i + N_DISPATCH_LOG < be64_to_cpu(vpa->dtl_idx)) {
                        /* buffer has overflowed */
-                       i = vpa->dtl_idx - N_DISPATCH_LOG;
+                       i = be64_to_cpu(vpa->dtl_idx) - N_DISPATCH_LOG;
                        dtl = local_paca->dispatch_log + (i % N_DISPATCH_LOG);
                        continue;
                }
@@ -269,7 +269,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb)
 {
        u64 stolen = 0;
 
-       if (get_paca()->dtl_ridx != get_paca()->lppaca_ptr->dtl_idx) {
+       if (get_paca()->dtl_ridx != be64_to_cpu(get_lppaca()->dtl_idx)) {
                stolen = scan_dispatch_log(stop_tb);
                get_paca()->system_time -= stolen;
        }
@@ -612,7 +612,7 @@ unsigned long long sched_clock(void)
 static int __init get_freq(char *name, int cells, unsigned long *val)
 {
        struct device_node *cpu;
-       const unsigned int *fp;
+       const __be32 *fp;
        int found = 0;
 
        /* The cpu node should have timebase and clock frequency properties */
index 0554d1f..7b60b98 100644 (file)
@@ -155,10 +155,10 @@ _GLOBAL(tm_reclaim)
        mfvscr  vr0
        li      r6, THREAD_TRANSACT_VSCR
        stvx    vr0, r3, r6
+dont_backup_vec:
        mfspr   r0, SPRN_VRSAVE
        std     r0, THREAD_TRANSACT_VRSAVE(r3)
 
-dont_backup_vec:
        andi.   r0, r4, MSR_FP
        beq     dont_backup_fp
 
@@ -341,11 +341,11 @@ _GLOBAL(tm_recheckpoint)
        lvx     vr0, r3, r5
        mtvscr  vr0
        REST_32VRS(0, r5, r3)                   /* r5 scratch, r3 THREAD ptr */
+dont_restore_vec:
        ld      r5, THREAD_VRSAVE(r3)
        mtspr   SPRN_VRSAVE, r5
 #endif
 
-dont_restore_vec:
        andi.   r0, r4, MSR_FP
        beq     dont_restore_fp
 
index e435bc0..f783c93 100644 (file)
@@ -60,6 +60,7 @@
 #include <asm/switch_to.h>
 #include <asm/tm.h>
 #include <asm/debug.h>
+#include <sysdev/fsl_pci.h>
 
 #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
 int (*__debugger)(struct pt_regs *regs) __read_mostly;
@@ -565,6 +566,8 @@ int machine_check_e500(struct pt_regs *regs)
        if (reason & MCSR_BUS_RBERR) {
                if (fsl_rio_mcheck_exception(regs))
                        return 1;
+               if (fsl_pci_mcheck_exception(regs))
+                       return 1;
        }
 
        printk("Machine check in kernel mode.\n");
@@ -962,7 +965,7 @@ static int emulate_instruction(struct pt_regs *regs)
        u32 instword;
        u32 rd;
 
-       if (!user_mode(regs) || (regs->msr & MSR_LE))
+       if (!user_mode(regs))
                return -EINVAL;
        CHECK_FULL_REGS(regs);
 
@@ -1050,11 +1053,41 @@ int is_valid_bugaddr(unsigned long addr)
        return is_kernel_addr(addr);
 }
 
+#ifdef CONFIG_MATH_EMULATION
+static int emulate_math(struct pt_regs *regs)
+{
+       int ret;
+       extern int do_mathemu(struct pt_regs *regs);
+
+       ret = do_mathemu(regs);
+       if (ret >= 0)
+               PPC_WARN_EMULATED(math, regs);
+
+       switch (ret) {
+       case 0:
+               emulate_single_step(regs);
+               return 0;
+       case 1: {
+                       int code = 0;
+                       code = __parse_fpscr(current->thread.fpscr.val);
+                       _exception(SIGFPE, regs, code, regs->nip);
+                       return 0;
+               }
+       case -EFAULT:
+               _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
+               return 0;
+       }
+
+       return -1;
+}
+#else
+static inline int emulate_math(struct pt_regs *regs) { return -1; }
+#endif
+
 void __kprobes program_check_exception(struct pt_regs *regs)
 {
        enum ctx_state prev_state = exception_enter();
        unsigned int reason = get_reason(regs);
-       extern int do_mathemu(struct pt_regs *regs);
 
        /* We can now get here via a FP Unavailable exception if the core
         * has no FPU, in that case the reason flags will be 0 */
@@ -1116,11 +1149,20 @@ void __kprobes program_check_exception(struct pt_regs *regs)
        }
 #endif
 
+       /*
+        * If we took the program check in the kernel skip down to sending a
+        * SIGILL. The subsequent cases all relate to emulating instructions
+        * which we should only do for userspace. We also do not want to enable
+        * interrupts for kernel faults because that might lead to further
+        * faults, and loose the context of the original exception.
+        */
+       if (!user_mode(regs))
+               goto sigill;
+
        /* We restore the interrupt state now */
        if (!arch_irq_disabled_regs(regs))
                local_irq_enable();
 
-#ifdef CONFIG_MATH_EMULATION
        /* (reason & REASON_ILLEGAL) would be the obvious thing here,
         * but there seems to be a hardware bug on the 405GP (RevD)
         * that means ESR is sometimes set incorrectly - either to
@@ -1129,31 +1171,8 @@ void __kprobes program_check_exception(struct pt_regs *regs)
         * instruction or only on FP instructions, whether there is a
         * pattern to occurrences etc. -dgibson 31/Mar/2003
         */
-
-       /*
-        * If we support a HW FPU, we need to ensure the FP state
-        * if flushed into the thread_struct before attempting
-        * emulation
-        */
-#ifdef CONFIG_PPC_FPU
-       flush_fp_to_thread(current);
-#endif
-       switch (do_mathemu(regs)) {
-       case 0:
-               emulate_single_step(regs);
-               goto bail;
-       case 1: {
-                       int code = 0;
-                       code = __parse_fpscr(current->thread.fpscr.val);
-                       _exception(SIGFPE, regs, code, regs->nip);
-                       goto bail;
-               }
-       case -EFAULT:
-               _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
+       if (!emulate_math(regs))
                goto bail;
-       }
-       /* fall through on any other errors */
-#endif /* CONFIG_MATH_EMULATION */
 
        /* Try to emulate it if we should. */
        if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
@@ -1168,6 +1187,7 @@ void __kprobes program_check_exception(struct pt_regs *regs)
                }
        }
 
+sigill:
        if (reason & REASON_PRIVILEGED)
                _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
        else
@@ -1322,13 +1342,10 @@ void facility_unavailable_exception(struct pt_regs *regs)
        if (status == FSCR_DSCR_LG) {
                /* User is acessing the DSCR.  Set the inherit bit and allow
                 * the user to set it directly in future by setting via the
-                * H/FSCR DSCR bit.
+                * FSCR DSCR bit.  We always leave HFSCR DSCR set.
                 */
                current->thread.dscr_inherit = 1;
-               if (hv)
-                       mtspr(SPRN_HFSCR, value | HFSCR_DSCR);
-               else
-                       mtspr(SPRN_FSCR,  value | FSCR_DSCR);
+               mtspr(SPRN_FSCR, value | FSCR_DSCR);
                return;
        }
 
@@ -1444,11 +1461,6 @@ void performance_monitor_exception(struct pt_regs *regs)
 #ifdef CONFIG_8xx
 void SoftwareEmulation(struct pt_regs *regs)
 {
-       extern int do_mathemu(struct pt_regs *);
-#if defined(CONFIG_MATH_EMULATION)
-       int errcode;
-#endif
-
        CHECK_FULL_REGS(regs);
 
        if (!user_mode(regs)) {
@@ -1456,31 +1468,10 @@ void SoftwareEmulation(struct pt_regs *regs)
                die("Kernel Mode Software FPU Emulation", regs, SIGFPE);
        }
 
-#ifdef CONFIG_MATH_EMULATION
-       errcode = do_mathemu(regs);
-       if (errcode >= 0)
-               PPC_WARN_EMULATED(math, regs);
-
-       switch (errcode) {
-       case 0:
-               emulate_single_step(regs);
+       if (!emulate_math(regs))
                return;
-       case 1: {
-                       int code = 0;
-                       code = __parse_fpscr(current->thread.fpscr.val);
-                       _exception(SIGFPE, regs, code, regs->nip);
-                       return;
-               }
-       case -EFAULT:
-               _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
-               return;
-       default:
-               _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
-               return;
-       }
-#else
+
        _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
-#endif
 }
 #endif /* CONFIG_8xx */
 
index 6837f83..75702e2 100644 (file)
@@ -18,23 +18,19 @@ extern void real_writeb(u8 data, volatile u8 __iomem *addr);
 extern u8 real_205_readb(volatile u8 __iomem  *addr);
 extern void real_205_writeb(u8 data, volatile u8 __iomem *addr);
 
-struct NS16550 {
-       /* this struct must be packed */
-       unsigned char rbr;  /* 0 */
-       unsigned char ier;  /* 1 */
-       unsigned char fcr;  /* 2 */
-       unsigned char lcr;  /* 3 */
-       unsigned char mcr;  /* 4 */
-       unsigned char lsr;  /* 5 */
-       unsigned char msr;  /* 6 */
-       unsigned char scr;  /* 7 */
-};
-
-#define thr rbr
-#define iir fcr
-#define dll rbr
-#define dlm ier
-#define dlab lcr
+#define UART_RBR       0
+#define UART_IER       1
+#define UART_FCR       2
+#define UART_LCR       3
+#define UART_MCR       4
+#define UART_LSR       5
+#define UART_MSR       6
+#define UART_SCR       7
+#define UART_THR       UART_RBR
+#define UART_IIR       UART_FCR
+#define UART_DLL       UART_RBR
+#define UART_DLM       UART_IER
+#define UART_DLAB      UART_LCR
 
 #define LSR_DR   0x01  /* Data ready */
 #define LSR_OE   0x02  /* Overrun */
@@ -47,52 +43,62 @@ struct NS16550 {
 
 #define LCR_DLAB 0x80
 
-static struct NS16550 __iomem *udbg_comport;
+static u8 (*udbg_uart_in)(unsigned int reg);
+static void (*udbg_uart_out)(unsigned int reg, u8 data);
 
-static void udbg_550_flush(void)
+static void udbg_uart_flush(void)
 {
-       if (udbg_comport) {
-               while ((in_8(&udbg_comport->lsr) & LSR_THRE) == 0)
-                       /* wait for idle */;
-       }
+       if (!udbg_uart_in)
+               return;
+
+       /* wait for idle */
+       while ((udbg_uart_in(UART_LSR) & LSR_THRE) == 0)
+               cpu_relax();
 }
 
-static void udbg_550_putc(char c)
+static void udbg_uart_putc(char c)
 {
-       if (udbg_comport) {
-               if (c == '\n')
-                       udbg_550_putc('\r');
-               udbg_550_flush();
-               out_8(&udbg_comport->thr, c);
-       }
+       if (!udbg_uart_out)
+               return;
+
+       if (c == '\n')
+               udbg_uart_putc('\r');
+       udbg_uart_flush();
+       udbg_uart_out(UART_THR, c);
 }
 
-static int udbg_550_getc_poll(void)
+static int udbg_uart_getc_poll(void)
 {
-       if (udbg_comport) {
-               if ((in_8(&udbg_comport->lsr) & LSR_DR) != 0)
-                       return in_8(&udbg_comport->rbr);
-               else
-                       return -1;
-       }
+       if (!udbg_uart_in || !(udbg_uart_in(UART_LSR) & LSR_DR))
+               return udbg_uart_in(UART_RBR);
        return -1;
 }
 
-static int udbg_550_getc(void)
+static int udbg_uart_getc(void)
 {
-       if (udbg_comport) {
-               while ((in_8(&udbg_comport->lsr) & LSR_DR) == 0)
-                       /* wait for char */;
-               return in_8(&udbg_comport->rbr);
-       }
-       return -1;
+       if (!udbg_uart_in)
+               return -1;
+       /* wait for char */
+       while (!(udbg_uart_in(UART_LSR) & LSR_DR))
+               cpu_relax();
+       return udbg_uart_in(UART_RBR);
+}
+
+static void udbg_use_uart(void)
+{
+       udbg_putc = udbg_uart_putc;
+       udbg_flush = udbg_uart_flush;
+       udbg_getc = udbg_uart_getc;
+       udbg_getc_poll = udbg_uart_getc_poll;
 }
 
-void udbg_init_uart(void __iomem *comport, unsigned int speed,
-                   unsigned int clock)
+void udbg_uart_setup(unsigned int speed, unsigned int clock)
 {
        unsigned int dll, base_bauds;
 
+       if (!udbg_uart_out)
+               return;
+
        if (clock == 0)
                clock = 1843200;
        if (speed == 0)
@@ -101,51 +107,43 @@ void udbg_init_uart(void __iomem *comport, unsigned int speed,
        base_bauds = clock / 16;
        dll = base_bauds / speed;
 
-       if (comport) {
-               udbg_comport = (struct NS16550 __iomem *)comport;
-               out_8(&udbg_comport->lcr, 0x00);
-               out_8(&udbg_comport->ier, 0xff);
-               out_8(&udbg_comport->ier, 0x00);
-               out_8(&udbg_comport->lcr, LCR_DLAB);
-               out_8(&udbg_comport->dll, dll & 0xff);
-               out_8(&udbg_comport->dlm, dll >> 8);
-               /* 8 data, 1 stop, no parity */
-               out_8(&udbg_comport->lcr, 0x03);
-               /* RTS/DTR */
-               out_8(&udbg_comport->mcr, 0x03);
-               /* Clear & enable FIFOs */
-               out_8(&udbg_comport->fcr ,0x07);
-               udbg_putc = udbg_550_putc;
-               udbg_flush = udbg_550_flush;
-               udbg_getc = udbg_550_getc;
-               udbg_getc_poll = udbg_550_getc_poll;
-       }
+       udbg_uart_out(UART_LCR, 0x00);
+       udbg_uart_out(UART_IER, 0xff);
+       udbg_uart_out(UART_IER, 0x00);
+       udbg_uart_out(UART_LCR, LCR_DLAB);
+       udbg_uart_out(UART_DLL, dll & 0xff);
+       udbg_uart_out(UART_DLM, dll >> 8);
+       /* 8 data, 1 stop, no parity */
+       udbg_uart_out(UART_LCR, 0x3);
+       /* RTS/DTR */
+       udbg_uart_out(UART_MCR, 0x3);
+       /* Clear & enable FIFOs */
+       udbg_uart_out(UART_FCR, 0x7);
 }
 
-unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
+unsigned int udbg_probe_uart_speed(unsigned int clock)
 {
        unsigned int dll, dlm, divisor, prescaler, speed;
        u8 old_lcr;
-       struct NS16550 __iomem *port = comport;
 
-       old_lcr = in_8(&port->lcr);
+       old_lcr = udbg_uart_in(UART_LCR);
 
        /* select divisor latch registers.  */
-       out_8(&port->lcr, LCR_DLAB);
+       udbg_uart_out(UART_LCR, old_lcr | LCR_DLAB);
 
        /* now, read the divisor */
-       dll = in_8(&port->dll);
-       dlm = in_8(&port->dlm);
+       dll = udbg_uart_in(UART_DLL);
+       dlm = udbg_uart_in(UART_DLM);
        divisor = dlm << 8 | dll;
 
        /* check prescaling */
-       if (in_8(&port->mcr) & 0x80)
+       if (udbg_uart_in(UART_MCR) & 0x80)
                prescaler = 4;
        else
                prescaler = 1;
 
        /* restore the LCR */
-       out_8(&port->lcr, old_lcr);
+       udbg_uart_out(UART_LCR, old_lcr);
 
        /* calculate speed */
        speed = (clock / prescaler) / (divisor * 16);
@@ -157,195 +155,155 @@ unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
        return speed;
 }
 
-#ifdef CONFIG_PPC_MAPLE
-void udbg_maple_real_flush(void)
+static union {
+       unsigned char __iomem *mmio_base;
+       unsigned long pio_base;
+} udbg_uart;
+
+static unsigned int udbg_uart_stride = 1;
+
+static u8 udbg_uart_in_pio(unsigned int reg)
 {
-       if (udbg_comport) {
-               while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
-                       /* wait for idle */;
-       }
+       return inb(udbg_uart.pio_base + (reg * udbg_uart_stride));
 }
 
-void udbg_maple_real_putc(char c)
+static void udbg_uart_out_pio(unsigned int reg, u8 data)
 {
-       if (udbg_comport) {
-               if (c == '\n')
-                       udbg_maple_real_putc('\r');
-               udbg_maple_real_flush();
-               real_writeb(c, &udbg_comport->thr); eieio();
-       }
+       outb(data, udbg_uart.pio_base + (reg * udbg_uart_stride));
 }
 
-void __init udbg_init_maple_realmode(void)
+void udbg_uart_init_pio(unsigned long port, unsigned int stride)
 {
-       udbg_comport = (struct NS16550 __iomem *)0xf40003f8;
-
-       udbg_putc = udbg_maple_real_putc;
-       udbg_flush = udbg_maple_real_flush;
-       udbg_getc = NULL;
-       udbg_getc_poll = NULL;
+       if (!port)
+               return;
+       udbg_uart.pio_base = port;
+       udbg_uart_stride = stride;
+       udbg_uart_in = udbg_uart_in_pio;
+       udbg_uart_out = udbg_uart_out_pio;
+       udbg_use_uart();
 }
-#endif /* CONFIG_PPC_MAPLE */
 
-#ifdef CONFIG_PPC_PASEMI
-void udbg_pas_real_flush(void)
+static u8 udbg_uart_in_mmio(unsigned int reg)
 {
-       if (udbg_comport) {
-               while ((real_205_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
-                       /* wait for idle */;
-       }
+       return in_8(udbg_uart.mmio_base + (reg * udbg_uart_stride));
 }
 
-void udbg_pas_real_putc(char c)
+static void udbg_uart_out_mmio(unsigned int reg, u8 data)
 {
-       if (udbg_comport) {
-               if (c == '\n')
-                       udbg_pas_real_putc('\r');
-               udbg_pas_real_flush();
-               real_205_writeb(c, &udbg_comport->thr); eieio();
-       }
+       out_8(udbg_uart.mmio_base + (reg * udbg_uart_stride), data);
 }
 
-void udbg_init_pas_realmode(void)
-{
-       udbg_comport = (struct NS16550 __iomem *)0xfcff03f8UL;
 
-       udbg_putc = udbg_pas_real_putc;
-       udbg_flush = udbg_pas_real_flush;
-       udbg_getc = NULL;
-       udbg_getc_poll = NULL;
+void udbg_uart_init_mmio(void __iomem *addr, unsigned int stride)
+{
+       if (!addr)
+               return;
+       udbg_uart.mmio_base = addr;
+       udbg_uart_stride = stride;
+       udbg_uart_in = udbg_uart_in_mmio;
+       udbg_uart_out = udbg_uart_out_mmio;
+       udbg_use_uart();
 }
-#endif /* CONFIG_PPC_MAPLE */
 
-#ifdef CONFIG_PPC_EARLY_DEBUG_44x
-#include <platforms/44x/44x.h>
+#ifdef CONFIG_PPC_MAPLE
+
+#define UDBG_UART_MAPLE_ADDR   ((void __iomem *)0xf40003f8)
 
-static void udbg_44x_as1_flush(void)
+static u8 udbg_uart_in_maple(unsigned int reg)
 {
-       if (udbg_comport) {
-               while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
-                       /* wait for idle */;
-       }
+       return real_readb(UDBG_UART_MAPLE_ADDR + reg);
 }
 
-static void udbg_44x_as1_putc(char c)
+static void udbg_uart_out_maple(unsigned int reg, u8 val)
 {
-       if (udbg_comport) {
-               if (c == '\n')
-                       udbg_44x_as1_putc('\r');
-               udbg_44x_as1_flush();
-               as1_writeb(c, &udbg_comport->thr); eieio();
-       }
+       real_writeb(val, UDBG_UART_MAPLE_ADDR + reg);
 }
 
-static int udbg_44x_as1_getc(void)
+void __init udbg_init_maple_realmode(void)
 {
-       if (udbg_comport) {
-               while ((as1_readb(&udbg_comport->lsr) & LSR_DR) == 0)
-                       ; /* wait for char */
-               return as1_readb(&udbg_comport->rbr);
-       }
-       return -1;
+       udbg_uart_in = udbg_uart_in_maple;
+       udbg_uart_out = udbg_uart_out_maple;
+       udbg_use_uart();
 }
 
-void __init udbg_init_44x_as1(void)
-{
-       udbg_comport =
-               (struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
+#endif /* CONFIG_PPC_MAPLE */
 
-       udbg_putc = udbg_44x_as1_putc;
-       udbg_flush = udbg_44x_as1_flush;
-       udbg_getc = udbg_44x_as1_getc;
-}
-#endif /* CONFIG_PPC_EARLY_DEBUG_44x */
+#ifdef CONFIG_PPC_PASEMI
 
-#ifdef CONFIG_PPC_EARLY_DEBUG_40x
-static void udbg_40x_real_flush(void)
+#define UDBG_UART_PAS_ADDR     ((void __iomem *)0xfcff03f8UL)
+
+static u8 udbg_uart_in_pas(unsigned int reg)
 {
-       if (udbg_comport) {
-               while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
-                       /* wait for idle */;
-       }
+       return real_205_readb(UDBG_UART_PAS_ADDR + reg);
 }
 
-static void udbg_40x_real_putc(char c)
+static void udbg_uart_out_pas(unsigned int reg, u8 val)
 {
-       if (udbg_comport) {
-               if (c == '\n')
-                       udbg_40x_real_putc('\r');
-               udbg_40x_real_flush();
-               real_writeb(c, &udbg_comport->thr); eieio();
-       }
+       real_205_writeb(val, UDBG_UART_PAS_ADDR + reg);
 }
 
-static int udbg_40x_real_getc(void)
+void __init udbg_init_pas_realmode(void)
 {
-       if (udbg_comport) {
-               while ((real_readb(&udbg_comport->lsr) & LSR_DR) == 0)
-                       ; /* wait for char */
-               return real_readb(&udbg_comport->rbr);
-       }
-       return -1;
+       udbg_uart_in = udbg_uart_in_pas;
+       udbg_uart_out = udbg_uart_out_pas;
+       udbg_use_uart();
 }
 
-void __init udbg_init_40x_realmode(void)
-{
-       udbg_comport = (struct NS16550 __iomem *)
-               CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR;
+#endif /* CONFIG_PPC_PASEMI */
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_44x
 
-       udbg_putc = udbg_40x_real_putc;
-       udbg_flush = udbg_40x_real_flush;
-       udbg_getc = udbg_40x_real_getc;
-       udbg_getc_poll = NULL;
+#include <platforms/44x/44x.h>
+
+static u8 udbg_uart_in_44x_as1(unsigned int reg)
+{
+       return as1_readb((void __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR + reg);
 }
-#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
 
-#ifdef CONFIG_PPC_EARLY_DEBUG_WSP
-static void udbg_wsp_flush(void)
+static void udbg_uart_out_44x_as1(unsigned int reg, u8 val)
 {
-       if (udbg_comport) {
-               while ((readb(&udbg_comport->lsr) & LSR_THRE) == 0)
-                       /* wait for idle */;
-       }
+       as1_writeb(val, (void __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR + reg);
 }
 
-static void udbg_wsp_putc(char c)
+void __init udbg_init_44x_as1(void)
 {
-       if (udbg_comport) {
-               if (c == '\n')
-                       udbg_wsp_putc('\r');
-               udbg_wsp_flush();
-               writeb(c, &udbg_comport->thr); eieio();
-       }
+       udbg_uart_in = udbg_uart_in_44x_as1;
+       udbg_uart_out = udbg_uart_out_44x_as1;
+       udbg_use_uart();
 }
 
-static int udbg_wsp_getc(void)
+#endif /* CONFIG_PPC_EARLY_DEBUG_44x */
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_40x
+
+static u8 udbg_uart_in_40x(unsigned int reg)
 {
-       if (udbg_comport) {
-               while ((readb(&udbg_comport->lsr) & LSR_DR) == 0)
-                       ; /* wait for char */
-               return readb(&udbg_comport->rbr);
-       }
-       return -1;
+       return real_readb((void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR
+                         + reg);
 }
 
-static int udbg_wsp_getc_poll(void)
+static void udbg_uart_out_40x(unsigned int reg, u8 val)
 {
-       if (udbg_comport)
-               if (readb(&udbg_comport->lsr) & LSR_DR)
-                       return readb(&udbg_comport->rbr);
-       return -1;
+       real_writeb(val, (void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR
+                   + reg);
 }
 
-void __init udbg_init_wsp(void)
+void __init udbg_init_40x_realmode(void)
 {
-       udbg_comport = (struct NS16550 __iomem *)WSP_UART_VIRT;
+       udbg_uart_in = udbg_uart_in_40x;
+       udbg_uart_out = udbg_uart_out_40x;
+       udbg_use_uart();
+}
 
-       udbg_init_uart(udbg_comport, 57600, 50000000);
+#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
+
+
+#ifdef CONFIG_PPC_EARLY_DEBUG_WSP
 
-       udbg_putc = udbg_wsp_putc;
-       udbg_flush = udbg_wsp_flush;
-       udbg_getc = udbg_wsp_getc;
-       udbg_getc_poll = udbg_wsp_getc_poll;
+void __init udbg_init_wsp(void)
+{
+       udbg_uart_init_mmio((void *)WSP_UART_VIRT, 1);
+       udbg_uart_setup(57600, 50000000);
 }
+
 #endif /* CONFIG_PPC_EARLY_DEBUG_WSP */
index 27e2f62..6b1f2a6 100644 (file)
@@ -232,9 +232,9 @@ __do_get_tspec:
        lwz     r6,(CFG_TB_ORIG_STAMP+4)(r9)
 
        /* Get a stable TB value */
-2:     mftbu   r3
-       mftbl   r4
-       mftbu   r0
+2:     mfspr   r3, SPRN_TBRU
+       mfspr   r4, SPRN_TBRL
+       mfspr   r0, SPRN_TBRU
        cmplw   cr0,r3,r0
        bne-    2b
 
index 536016d..78a3506 100644 (file)
@@ -1153,7 +1153,7 @@ EXPORT_SYMBOL(vio_h_cop_sync);
 
 static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
 {
-       const unsigned char *dma_window;
+       const __be32 *dma_window;
        struct iommu_table *tbl;
        unsigned long offset, size;
 
@@ -1312,8 +1312,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
 {
        struct vio_dev *viodev;
        struct device_node *parent_node;
-       const unsigned int *unit_address;
-       const unsigned int *pfo_resid = NULL;
+       const __be32 *prop;
        enum vio_dev_family family;
        const char *of_node_name = of_node->name ? of_node->name : "<unknown>";
 
@@ -1360,6 +1359,8 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
        /* we need the 'device_type' property, in order to match with drivers */
        viodev->family = family;
        if (viodev->family == VDEVICE) {
+               unsigned int unit_address;
+
                if (of_node->type != NULL)
                        viodev->type = of_node->type;
                else {
@@ -1368,24 +1369,24 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
                        goto out;
                }
 
-               unit_address = of_get_property(of_node, "reg", NULL);
-               if (unit_address == NULL) {
+               prop = of_get_property(of_node, "reg", NULL);
+               if (prop == NULL) {
                        pr_warn("%s: node %s missing 'reg'\n",
                                        __func__, of_node_name);
                        goto out;
                }
-               dev_set_name(&viodev->dev, "%x", *unit_address);
+               unit_address = of_read_number(prop, 1);
+               dev_set_name(&viodev->dev, "%x", unit_address);
                viodev->irq = irq_of_parse_and_map(of_node, 0);
-               viodev->unit_address = *unit_address;
+               viodev->unit_address = unit_address;
        } else {
                /* PFO devices need their resource_id for submitting COP_OPs
                 * This is an optional field for devices, but is required when
                 * performing synchronous ops */
-               pfo_resid = of_get_property(of_node, "ibm,resource-id", NULL);
-               if (pfo_resid != NULL)
-                       viodev->resource_id = *pfo_resid;
+               prop = of_get_property(of_node, "ibm,resource-id", NULL);
+               if (prop != NULL)
+                       viodev->resource_id = of_read_number(prop, 1);
 
-               unit_address = NULL;
                dev_set_name(&viodev->dev, "%s", of_node_name);
                viodev->type = of_node_name;
                viodev->irq = 0;
@@ -1622,7 +1623,6 @@ static struct vio_dev *vio_find_name(const char *name)
  */
 struct vio_dev *vio_find_node(struct device_node *vnode)
 {
-       const uint32_t *unit_address;
        char kobj_name[20];
        struct device_node *vnode_parent;
        const char *dev_type;
@@ -1638,10 +1638,13 @@ struct vio_dev *vio_find_node(struct device_node *vnode)
 
        /* construct the kobject name from the device node */
        if (!strcmp(dev_type, "vdevice")) {
-               unit_address = of_get_property(vnode, "reg", NULL);
-               if (!unit_address)
+               const __be32 *prop;
+               
+               prop = of_get_property(vnode, "reg", NULL);
+               if (!prop)
                        return NULL;
-               snprintf(kobj_name, sizeof(kobj_name), "%x", *unit_address);
+               snprintf(kobj_name, sizeof(kobj_name), "%x",
+                        (uint32_t)of_read_number(prop, 1));
        } else if (!strcmp(dev_type, "ibm,platform-facilities"))
                snprintf(kobj_name, sizeof(kobj_name), "%s", vnode->name);
        else
index 4f0caec..4f12e8f 100644 (file)
  * Authors: Alexander Graf <agraf@suse.de>
  */
 
+#ifdef __LITTLE_ENDIAN__
+#error Need to fix SLB shadow accesses in little endian mode
+#endif
+
 #define SHADOW_SLB_ESID(num)   (SLBSHADOW_SAVEAREA + (num * 0x10))
 #define SHADOW_SLB_VSID(num)   (SLBSHADOW_SAVEAREA + (num * 0x10) + 0x8)
 #define UNBOLT_SLB_ENTRY(num) \
index b0ee3bc..62a2b5a 100644 (file)
@@ -217,7 +217,7 @@ struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id)
 
 static void init_vpa(struct kvm_vcpu *vcpu, struct lppaca *vpa)
 {
-       vpa->shared_proc = 1;
+       vpa->__old_status |= LPPACA_OLD_SHARED_PROC;
        vpa->yield_count = 1;
 }
 
index 45e30d6..9c51544 100644 (file)
@@ -363,7 +363,11 @@ long kvmppc_h_enter(struct kvm_vcpu *vcpu, unsigned long flags,
                                 vcpu->arch.pgdir, true, &vcpu->arch.gpr[4]);
 }
 
+#ifdef __BIG_ENDIAN__
 #define LOCK_TOKEN     (*(u32 *)(&get_paca()->lock_token))
+#else
+#define LOCK_TOKEN     (*(u32 *)(&get_paca()->paca_index))
+#endif
 
 static inline int try_lock_tlbie(unsigned int *lock)
 {
index 60dce5b..294b7af 100644 (file)
 #include <asm/kvm_book3s_asm.h>
 #include <asm/mmu-hash64.h>
 
+#ifdef __LITTLE_ENDIAN__
+#error Need to fix lppaca and SLB shadow accesses in little endian mode
+#endif
+
 /*****************************************************************************
  *                                                                           *
  *        Real Mode handlers that need to be in the linear mapping           *
@@ -389,7 +393,11 @@ toc_tlbie_lock:
        .tc     native_tlbie_lock[TC],native_tlbie_lock
        .previous
        ld      r3,toc_tlbie_lock@toc(2)
+#ifdef __BIG_ENDIAN__
        lwz     r8,PACA_LOCK_TOKEN(r13)
+#else
+       lwz     r8,PACAPACAINDEX(r13)
+#endif
 24:    lwarx   r0,0,r3
        cmpwi   r0,0
        bne     24b
@@ -964,7 +972,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201)
 32:    ld      r4,VCPU_KVM(r9)         /* pointer to struct kvm */
 
        /* Take the guest's tlbie_lock */
+#ifdef __BIG_ENDIAN__
        lwz     r8,PACA_LOCK_TOKEN(r13)
+#else
+       lwz     r8,PACAPACAINDEX(r13)
+#endif
        addi    r3,r4,KVM_TLBIE_LOCK
 24:    lwarx   r0,0,r3
        cmpwi   r0,0
index 2c52ada..751cd45 100644 (file)
 #include <asm/byteorder.h>
 #include <asm/kvm_ppc.h>
 #include <asm/disassemble.h>
+#include <asm/ppc-opcode.h>
 #include "timing.h"
 #include "trace.h"
 
-#define OP_TRAP 3
-#define OP_TRAP_64 2
-
-#define OP_31_XOP_TRAP      4
-#define OP_31_XOP_LWZX      23
-#define OP_31_XOP_DCBST     54
-#define OP_31_XOP_TRAP_64   68
-#define OP_31_XOP_DCBF      86
-#define OP_31_XOP_LBZX      87
-#define OP_31_XOP_STWX      151
-#define OP_31_XOP_STBX      215
-#define OP_31_XOP_LBZUX     119
-#define OP_31_XOP_STBUX     247
-#define OP_31_XOP_LHZX      279
-#define OP_31_XOP_LHZUX     311
-#define OP_31_XOP_MFSPR     339
-#define OP_31_XOP_LHAX      343
-#define OP_31_XOP_STHX      407
-#define OP_31_XOP_STHUX     439
-#define OP_31_XOP_MTSPR     467
-#define OP_31_XOP_DCBI      470
-#define OP_31_XOP_LWBRX     534
-#define OP_31_XOP_TLBSYNC   566
-#define OP_31_XOP_STWBRX    662
-#define OP_31_XOP_LHBRX     790
-#define OP_31_XOP_STHBRX    918
-
-#define OP_LWZ  32
-#define OP_LD   58
-#define OP_LWZU 33
-#define OP_LBZ  34
-#define OP_LBZU 35
-#define OP_STW  36
-#define OP_STWU 37
-#define OP_STD  62
-#define OP_STB  38
-#define OP_STBU 39
-#define OP_LHZ  40
-#define OP_LHZU 41
-#define OP_LHA  42
-#define OP_LHAU 43
-#define OP_STH  44
-#define OP_STHU 45
-
 void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
 {
        unsigned long dec_nsec;
index bb7cfec..0c9c8d7 100644 (file)
@@ -32,7 +32,7 @@ void __spin_yield(arch_spinlock_t *lock)
                return;
        holder_cpu = lock_value & 0xffff;
        BUG_ON(holder_cpu >= NR_CPUS);
-       yield_count = lppaca_of(holder_cpu).yield_count;
+       yield_count = be32_to_cpu(lppaca_of(holder_cpu).yield_count);
        if ((yield_count & 1) == 0)
                return;         /* virtual cpu is currently running */
        rmb();
@@ -57,7 +57,7 @@ void __rw_yield(arch_rwlock_t *rw)
                return;         /* no write lock at present */
        holder_cpu = lock_value & 0xffff;
        BUG_ON(holder_cpu >= NR_CPUS);
-       yield_count = lppaca_of(holder_cpu).yield_count;
+       yield_count = be32_to_cpu(lppaca_of(holder_cpu).yield_count);
        if ((yield_count & 1) == 0)
                return;         /* virtual cpu is currently running */
        rmb();
index 99c7fc1..a7ee978 100644 (file)
@@ -100,8 +100,10 @@ static unsigned long __kprobes dform_ea(unsigned int instr, struct pt_regs *regs
        ea = (signed short) instr;              /* sign-extend */
        if (ra) {
                ea += regs->gpr[ra];
-               if (instr & 0x04000000)         /* update forms */
-                       regs->gpr[ra] = ea;
+               if (instr & 0x04000000) {               /* update forms */
+                       if ((instr>>26) != 47)          /* stmw is not an update form */
+                               regs->gpr[ra] = ea;
+               }
        }
 
        return truncate_if_32bit(regs->msr, ea);
@@ -279,7 +281,7 @@ static int __kprobes write_mem_unaligned(unsigned long val, unsigned long ea,
                err = write_mem_aligned(val >> (nb - c) * 8, ea, c);
                if (err)
                        return err;
-               ++ea;
+               ea += c;
        }
        return 0;
 }
index 8d035d2..1b46ab4 100644 (file)
@@ -1,15 +1,15 @@
-
-obj-$(CONFIG_MATH_EMULATION)   += fabs.o fadd.o fadds.o fcmpo.o fcmpu.o \
-                                       fctiw.o fctiwz.o fdiv.o fdivs.o \
-                                       fmadd.o fmadds.o fmsub.o fmsubs.o \
-                                       fmul.o fmuls.o fnabs.o fneg.o \
-                                       fnmadd.o fnmadds.o fnmsub.o fnmsubs.o \
-                                       fres.o fre.o frsp.o fsel.o lfs.o \
-                                       frsqrte.o frsqrtes.o \
-                                       fsqrt.o fsqrts.o fsub.o fsubs.o \
-                                       mcrfs.o mffs.o mtfsb0.o mtfsb1.o \
-                                       mtfsf.o mtfsfi.o stfiwx.o stfs.o \
-                                       math.o fmr.o lfd.o stfd.o
+math-emu-common-objs = math.o fre.o fsqrt.o fsqrts.o frsqrtes.o mtfsf.o mtfsfi.o
+obj-$(CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED) += $(math-emu-common-objs)
+obj-$(CONFIG_MATH_EMULATION_FULL) += $(math-emu-common-objs) fabs.o fadd.o \
+                                       fadds.o fcmpo.o fcmpu.o fctiw.o \
+                                       fctiwz.o fdiv.o fdivs.o  fmadd.o \
+                                       fmadds.o fmsub.o fmsubs.o fmul.o \
+                                       fmuls.o fnabs.o fneg.o fnmadd.o \
+                                       fnmadds.o fnmsub.o fnmsubs.o fres.o \
+                                       frsp.o fsel.o lfs.o frsqrte.o fsub.o \
+                                       fsubs.o  mcrfs.o mffs.o mtfsb0.o \
+                                       mtfsb1.o stfiwx.o stfs.o math.o \
+                                       fmr.o lfd.o stfd.o
 
 obj-$(CONFIG_SPE)              += math_efp.o
 
index 0328e66..ab151f0 100644 (file)
@@ -7,12 +7,27 @@
 
 #include <asm/uaccess.h>
 #include <asm/reg.h>
+#include <asm/switch_to.h>
 
 #include <asm/sfp-machine.h>
 #include <math-emu/double.h>
 
 #define FLOATFUNC(x)   extern int x(void *, void *, void *, void *)
 
+/* The instructions list which may be not implemented by a hardware FPU */
+FLOATFUNC(fre);
+FLOATFUNC(frsqrtes);
+FLOATFUNC(fsqrt);
+FLOATFUNC(fsqrts);
+FLOATFUNC(mtfsf);
+FLOATFUNC(mtfsfi);
+
+#ifdef CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED
+#undef FLOATFUNC(x)
+#define FLOATFUNC(x)   static inline int x(void *op1, void *op2, void *op3, \
+                                                void *op4) { }
+#endif
+
 FLOATFUNC(fadd);
 FLOATFUNC(fadds);
 FLOATFUNC(fdiv);
@@ -42,8 +57,6 @@ FLOATFUNC(mcrfs);
 FLOATFUNC(mffs);
 FLOATFUNC(mtfsb0);
 FLOATFUNC(mtfsb1);
-FLOATFUNC(mtfsf);
-FLOATFUNC(mtfsfi);
 
 FLOATFUNC(lfd);
 FLOATFUNC(lfs);
@@ -58,13 +71,9 @@ FLOATFUNC(fnabs);
 FLOATFUNC(fneg);
 
 /* Optional */
-FLOATFUNC(fre);
 FLOATFUNC(fres);
 FLOATFUNC(frsqrte);
-FLOATFUNC(frsqrtes);
 FLOATFUNC(fsel);
-FLOATFUNC(fsqrt);
-FLOATFUNC(fsqrts);
 
 
 #define OP31           0x1f            /*   31 */
@@ -154,7 +163,6 @@ FLOATFUNC(fsqrts);
 #define XEU    15
 #define XFLB   10
 
-#ifdef CONFIG_MATH_EMULATION
 static int
 record_exception(struct pt_regs *regs, int eflag)
 {
@@ -212,7 +220,6 @@ record_exception(struct pt_regs *regs, int eflag)
 
        return (fpscr & FPSCR_FEX) ? 1 : 0;
 }
-#endif /* CONFIG_MATH_EMULATION */
 
 int
 do_mathemu(struct pt_regs *regs)
@@ -222,56 +229,13 @@ do_mathemu(struct pt_regs *regs)
        signed short sdisp;
        u32 insn = 0;
        int idx = 0;
-#ifdef CONFIG_MATH_EMULATION
        int (*func)(void *, void *, void *, void *);
        int type = 0;
        int eflag, trap;
-#endif
 
        if (get_user(insn, (u32 *)pc))
                return -EFAULT;
 
-#ifndef CONFIG_MATH_EMULATION
-       switch (insn >> 26) {
-       case LFD:
-               idx = (insn >> 16) & 0x1f;
-               sdisp = (insn & 0xffff);
-               op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f);
-               op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp);
-               lfd(op0, op1, op2, op3);
-               break;
-       case LFDU:
-               idx = (insn >> 16) & 0x1f;
-               sdisp = (insn & 0xffff);
-               op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f);
-               op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp);
-               lfd(op0, op1, op2, op3);
-               regs->gpr[idx] = (unsigned long)op1;
-               break;
-       case STFD:
-               idx = (insn >> 16) & 0x1f;
-               sdisp = (insn & 0xffff);
-               op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f);
-               op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp);
-               stfd(op0, op1, op2, op3);
-               break;
-       case STFDU:
-               idx = (insn >> 16) & 0x1f;
-               sdisp = (insn & 0xffff);
-               op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f);
-               op1 = (void *)((idx ? regs->gpr[idx] : 0) + sdisp);
-               stfd(op0, op1, op2, op3);
-               regs->gpr[idx] = (unsigned long)op1;
-               break;
-       case OP63:
-               op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f);
-               op1 = (void *)&current->thread.TS_FPR((insn >> 11) & 0x1f);
-               fmr(op0, op1, op2, op3);
-               break;
-       default:
-               goto illegal;
-       }
-#else /* CONFIG_MATH_EMULATION */
        switch (insn >> 26) {
        case LFS:       func = lfs;     type = D;       break;
        case LFSU:      func = lfs;     type = DU;      break;
@@ -416,21 +380,16 @@ do_mathemu(struct pt_regs *regs)
        case XE:
                idx = (insn >> 16) & 0x1f;
                op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f);
-               if (!idx) {
-                       if (((insn >> 1) & 0x3ff) == STFIWX)
-                               op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]);
-                       else
-                               goto illegal;
-               } else {
-                       op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
-               }
-
+               op1 = (void *)((idx ? regs->gpr[idx] : 0)
+                               + regs->gpr[(insn >> 11) & 0x1f]);
                break;
 
        case XEU:
                idx = (insn >> 16) & 0x1f;
+               if (!idx)
+                       goto illegal;
                op0 = (void *)&current->thread.TS_FPR((insn >> 21) & 0x1f);
-               op1 = (void *)((idx ? regs->gpr[idx] : 0)
+               op1 = (void *)(regs->gpr[idx]
                                + regs->gpr[(insn >> 11) & 0x1f]);
                break;
 
@@ -465,6 +424,13 @@ do_mathemu(struct pt_regs *regs)
                goto illegal;
        }
 
+       /*
+        * If we support a HW FPU, we need to ensure the FP state
+        * is flushed into the thread_struct before attempting
+        * emulation
+        */
+       flush_fp_to_thread(current);
+
        eflag = func(op0, op1, op2, op3);
 
        if (insn & 1) {
@@ -485,7 +451,6 @@ do_mathemu(struct pt_regs *regs)
        default:
                break;
        }
-#endif /* CONFIG_MATH_EMULATION */
 
        regs->nip += 4;
        return 0;
index 8726779..76d8e7c 100644 (file)
@@ -443,8 +443,12 @@ good_area:
                                      regs, address);
 #ifdef CONFIG_PPC_SMLPAR
                        if (firmware_has_feature(FW_FEATURE_CMO)) {
+                               u32 page_ins;
+
                                preempt_disable();
-                               get_lppaca()->page_ins += (1 << PAGE_FACTOR);
+                               page_ins = be32_to_cpu(get_lppaca()->page_ins);
+                               page_ins += 1 << PAGE_FACTOR;
+                               get_lppaca()->page_ins = cpu_to_be32(page_ins);
                                preempt_enable();
                        }
 #endif /* CONFIG_PPC_SMLPAR */
index 49822d9..6936547 100644 (file)
@@ -117,8 +117,8 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
        return 1;
 }
 
-int get_user_pages_fast(unsigned long start, int nr_pages, int write,
-                       struct page **pages)
+int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
+                         struct page **pages)
 {
        struct mm_struct *mm = current->mm;
        unsigned long addr, len, end;
@@ -135,7 +135,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
 
        if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ,
                                        start, len)))
-               goto slow_irqon;
+               return 0;
 
        pr_devel("  aligned: %lx .. %lx\n", start, end);
 
@@ -166,30 +166,35 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
                         (void *)pgd_val(pgd));
                next = pgd_addr_end(addr, end);
                if (pgd_none(pgd))
-                       goto slow;
+                       break;
                if (pgd_huge(pgd)) {
                        if (!gup_hugepte((pte_t *)pgdp, PGDIR_SIZE, addr, next,
                                         write, pages, &nr))
-                               goto slow;
+                               break;
                } else if (is_hugepd(pgdp)) {
                        if (!gup_hugepd((hugepd_t *)pgdp, PGDIR_SHIFT,
                                        addr, next, write, pages, &nr))
-                               goto slow;
+                               break;
                } else if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
-                       goto slow;
+                       break;
        } while (pgdp++, addr = next, addr != end);
 
        local_irq_enable();
 
-       VM_BUG_ON(nr != (end - start) >> PAGE_SHIFT);
        return nr;
+}
 
-       {
-               int ret;
+int get_user_pages_fast(unsigned long start, int nr_pages, int write,
+                       struct page **pages)
+{
+       struct mm_struct *mm = current->mm;
+       int nr, ret;
+
+       start &= PAGE_MASK;
+       nr = __get_user_pages_fast(start, nr_pages, write, pages);
+       ret = nr;
 
-slow:
-               local_irq_enable();
-slow_irqon:
+       if (nr < nr_pages) {
                pr_devel("  slow path ! nr = %d\n", nr);
 
                /* Try to get the remaining pages with get_user_pages */
@@ -198,7 +203,7 @@ slow_irqon:
 
                down_read(&mm->mmap_sem);
                ret = get_user_pages(current, mm, start,
-                       (end - start) >> PAGE_SHIFT, write, 0, pages, NULL);
+                                    nr_pages - nr, write, 0, pages, NULL);
                up_read(&mm->mmap_sem);
 
                /* Have to be a bit careful with return values */
@@ -208,9 +213,9 @@ slow_irqon:
                        else
                                ret += nr;
                }
-
-               return ret;
        }
+
+       return ret;
 }
 
 #endif /* __HAVE_ARCH_PTE_SPECIAL */
index 6ecc38b..bde8b55 100644 (file)
@@ -907,7 +907,7 @@ static int subpage_protection(struct mm_struct *mm, unsigned long ea)
 
        if (ea >= spt->maxaddr)
                return 0;
-       if (ea < 0x100000000) {
+       if (ea < 0x100000000UL) {
                /* addresses below 4GB use spt->low_prot */
                sbpm = spt->low_prot;
        } else {
index 01e2db9..d47d3da 100644 (file)
@@ -52,7 +52,7 @@
 #if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
 /* The amount of lowmem must be within 0xF0000000 - KERNELBASE. */
 #if (CONFIG_LOWMEM_SIZE > (0xF0000000 - PAGE_OFFSET))
-#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL"
+#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_KERNEL_START"
 #endif
 #endif
 #define MAX_LOW_MEM    CONFIG_LOWMEM_SIZE
index 7f4bea1..1cf9c5b 100644 (file)
@@ -514,7 +514,7 @@ static int add_system_ram_resources(void)
                        res->name = "System RAM";
                        res->start = base;
                        res->end = base + size - 1;
-                       res->flags = IORESOURCE_MEM;
+                       res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
                        WARN_ON(request_resource(&iomem_resource, res) < 0);
                }
        }
index 5850798..c916127 100644 (file)
@@ -58,7 +58,7 @@ static int form1_affinity;
 
 #define MAX_DISTANCE_REF_POINTS 4
 static int distance_ref_points_depth;
-static const unsigned int *distance_ref_points;
+static const __be32 *distance_ref_points;
 static int distance_lookup_table[MAX_NUMNODES][MAX_DISTANCE_REF_POINTS];
 
 /*
@@ -179,7 +179,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
 #endif /* CONFIG_HOTPLUG_CPU || CONFIG_PPC_SPLPAR */
 
 /* must hold reference to node during call */
-static const int *of_get_associativity(struct device_node *dev)
+static const __be32 *of_get_associativity(struct device_node *dev)
 {
        return of_get_property(dev, "ibm,associativity", NULL);
 }
@@ -189,9 +189,9 @@ static const int *of_get_associativity(struct device_node *dev)
  * it exists (the property exists only in kexec/kdump kernels,
  * added by kexec-tools)
  */
-static const u32 *of_get_usable_memory(struct device_node *memory)
+static const __be32 *of_get_usable_memory(struct device_node *memory)
 {
-       const u32 *prop;
+       const __be32 *prop;
        u32 len;
        prop = of_get_property(memory, "linux,drconf-usable-memory", &len);
        if (!prop || len < sizeof(unsigned int))
@@ -219,7 +219,7 @@ int __node_distance(int a, int b)
 }
 
 static void initialize_distance_lookup_table(int nid,
-               const unsigned int *associativity)
+               const __be32 *associativity)
 {
        int i;
 
@@ -227,29 +227,32 @@ static void initialize_distance_lookup_table(int nid,
                return;
 
        for (i = 0; i < distance_ref_points_depth; i++) {
-               distance_lookup_table[nid][i] =
-                       associativity[distance_ref_points[i]];
+               const __be32 *entry;
+
+               entry = &associativity[be32_to_cpu(distance_ref_points[i])];
+               distance_lookup_table[nid][i] = of_read_number(entry, 1);
        }
 }
 
 /* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
  * info is found.
  */
-static int associativity_to_nid(const unsigned int *associativity)
+static int associativity_to_nid(const __be32 *associativity)
 {
        int nid = -1;
 
        if (min_common_depth == -1)
                goto out;
 
-       if (associativity[0] >= min_common_depth)
-               nid = associativity[min_common_depth];
+       if (of_read_number(associativity, 1) >= min_common_depth)
+               nid = of_read_number(&associativity[min_common_depth], 1);
 
        /* POWER4 LPAR uses 0xffff as invalid node */
        if (nid == 0xffff || nid >= MAX_NUMNODES)
                nid = -1;
 
-       if (nid > 0 && associativity[0] >= distance_ref_points_depth)
+       if (nid > 0 &&
+           of_read_number(associativity, 1) >= distance_ref_points_depth)
                initialize_distance_lookup_table(nid, associativity);
 
 out:
@@ -262,7 +265,7 @@ out:
 static int of_node_to_nid_single(struct device_node *device)
 {
        int nid = -1;
-       const unsigned int *tmp;
+       const __be32 *tmp;
 
        tmp = of_get_associativity(device);
        if (tmp)
@@ -334,7 +337,7 @@ static int __init find_min_common_depth(void)
        }
 
        if (form1_affinity) {
-               depth = distance_ref_points[0];
+               depth = of_read_number(distance_ref_points, 1);
        } else {
                if (distance_ref_points_depth < 2) {
                        printk(KERN_WARNING "NUMA: "
@@ -342,7 +345,7 @@ static int __init find_min_common_depth(void)
                        goto err;
                }
 
-               depth = distance_ref_points[1];
+               depth = of_read_number(&distance_ref_points[1], 1);
        }
 
        /*
@@ -376,12 +379,12 @@ static void __init get_n_mem_cells(int *n_addr_cells, int *n_size_cells)
        of_node_put(memory);
 }
 
-static unsigned long read_n_cells(int n, const unsigned int **buf)
+static unsigned long read_n_cells(int n, const __be32 **buf)
 {
        unsigned long result = 0;
 
        while (n--) {
-               result = (result << 32) | **buf;
+               result = (result << 32) | of_read_number(*buf, 1);
                (*buf)++;
        }
        return result;
@@ -391,17 +394,17 @@ static unsigned long read_n_cells(int n, const unsigned int **buf)
  * Read the next memblock list entry from the ibm,dynamic-memory property
  * and return the information in the provided of_drconf_cell structure.
  */
-static void read_drconf_cell(struct of_drconf_cell *drmem, const u32 **cellp)
+static void read_drconf_cell(struct of_drconf_cell *drmem, const __be32 **cellp)
 {
-       const u32 *cp;
+       const __be32 *cp;
 
        drmem->base_addr = read_n_cells(n_mem_addr_cells, cellp);
 
        cp = *cellp;
-       drmem->drc_index = cp[0];
-       drmem->reserved = cp[1];
-       drmem->aa_index = cp[2];
-       drmem->flags = cp[3];
+       drmem->drc_index = of_read_number(cp, 1);
+       drmem->reserved = of_read_number(&cp[1], 1);
+       drmem->aa_index = of_read_number(&cp[2], 1);
+       drmem->flags = of_read_number(&cp[3], 1);
 
        *cellp = cp + 4;
 }
@@ -413,16 +416,16 @@ static void read_drconf_cell(struct of_drconf_cell *drmem, const u32 **cellp)
  * list entries followed by N memblock list entries.  Each memblock list entry
  * contains information as laid out in the of_drconf_cell struct above.
  */
-static int of_get_drconf_memory(struct device_node *memory, const u32 **dm)
+static int of_get_drconf_memory(struct device_node *memory, const __be32 **dm)
 {
-       const u32 *prop;
+       const __be32 *prop;
        u32 len, entries;
 
        prop = of_get_property(memory, "ibm,dynamic-memory", &len);
        if (!prop || len < sizeof(unsigned int))
                return 0;
 
-       entries = *prop++;
+       entries = of_read_number(prop++, 1);
 
        /* Now that we know the number of entries, revalidate the size
         * of the property read in to ensure we have everything
@@ -440,7 +443,7 @@ static int of_get_drconf_memory(struct device_node *memory, const u32 **dm)
  */
 static u64 of_get_lmb_size(struct device_node *memory)
 {
-       const u32 *prop;
+       const __be32 *prop;
        u32 len;
 
        prop = of_get_property(memory, "ibm,lmb-size", &len);
@@ -453,7 +456,7 @@ static u64 of_get_lmb_size(struct device_node *memory)
 struct assoc_arrays {
        u32     n_arrays;
        u32     array_sz;
-       const u32 *arrays;
+       const __be32 *arrays;
 };
 
 /*
@@ -469,15 +472,15 @@ struct assoc_arrays {
 static int of_get_assoc_arrays(struct device_node *memory,
                               struct assoc_arrays *aa)
 {
-       const u32 *prop;
+       const __be32 *prop;
        u32 len;
 
        prop = of_get_property(memory, "ibm,associativity-lookup-arrays", &len);
        if (!prop || len < 2 * sizeof(unsigned int))
                return -1;
 
-       aa->n_arrays = *prop++;
-       aa->array_sz = *prop++;
+       aa->n_arrays = of_read_number(prop++, 1);
+       aa->array_sz = of_read_number(prop++, 1);
 
        /* Now that we know the number of arrays and size of each array,
         * revalidate the size of the property read in.
@@ -504,7 +507,7 @@ static int of_drconf_to_nid_single(struct of_drconf_cell *drmem,
            !(drmem->flags & DRCONF_MEM_AI_INVALID) &&
            drmem->aa_index < aa->n_arrays) {
                index = drmem->aa_index * aa->array_sz + min_common_depth - 1;
-               nid = aa->arrays[index];
+               nid = of_read_number(&aa->arrays[index], 1);
 
                if (nid == 0xffff || nid >= MAX_NUMNODES)
                        nid = default_nid;
@@ -595,7 +598,7 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start,
  * Reads the counter for a given entry in
  * linux,drconf-usable-memory property
  */
-static inline int __init read_usm_ranges(const u32 **usm)
+static inline int __init read_usm_ranges(const __be32 **usm)
 {
        /*
         * For each lmb in ibm,dynamic-memory a corresponding
@@ -612,7 +615,7 @@ static inline int __init read_usm_ranges(const u32 **usm)
  */
 static void __init parse_drconf_memory(struct device_node *memory)
 {
-       const u32 *uninitialized_var(dm), *usm;
+       const __be32 *uninitialized_var(dm), *usm;
        unsigned int n, rc, ranges, is_kexec_kdump = 0;
        unsigned long lmb_size, base, size, sz;
        int nid;
@@ -721,7 +724,7 @@ static int __init parse_numa_properties(void)
                unsigned long size;
                int nid;
                int ranges;
-               const unsigned int *memcell_buf;
+               const __be32 *memcell_buf;
                unsigned int len;
 
                memcell_buf = of_get_property(memory,
@@ -1106,7 +1109,7 @@ early_param("numa", early_numa);
 static int hot_add_drconf_scn_to_nid(struct device_node *memory,
                                     unsigned long scn_addr)
 {
-       const u32 *dm;
+       const __be32 *dm;
        unsigned int drconf_cell_cnt, rc;
        unsigned long lmb_size;
        struct assoc_arrays aa;
@@ -1159,7 +1162,7 @@ int hot_add_node_scn_to_nid(unsigned long scn_addr)
        for_each_node_by_type(memory, "memory") {
                unsigned long start, size;
                int ranges;
-               const unsigned int *memcell_buf;
+               const __be32 *memcell_buf;
                unsigned int len;
 
                memcell_buf = of_get_property(memory, "reg", &len);
@@ -1232,7 +1235,7 @@ static u64 hot_add_drconf_memory_max(void)
         struct device_node *memory = NULL;
         unsigned int drconf_cell_cnt = 0;
         u64 lmb_size = 0;
-        const u32 *dm = 0;
+       const __be32 *dm = 0;
 
         memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
         if (memory) {
@@ -1337,40 +1340,41 @@ static int update_cpu_associativity_changes_mask(void)
  * Convert the associativity domain numbers returned from the hypervisor
  * to the sequence they would appear in the ibm,associativity property.
  */
-static int vphn_unpack_associativity(const long *packed, unsigned int *unpacked)
+static int vphn_unpack_associativity(const long *packed, __be32 *unpacked)
 {
        int i, nr_assoc_doms = 0;
-       const u16 *field = (const u16*) packed;
+       const __be16 *field = (const __be16 *) packed;
 
 #define VPHN_FIELD_UNUSED      (0xffff)
 #define VPHN_FIELD_MSB         (0x8000)
 #define VPHN_FIELD_MASK                (~VPHN_FIELD_MSB)
 
        for (i = 1; i < VPHN_ASSOC_BUFSIZE; i++) {
-               if (*field == VPHN_FIELD_UNUSED) {
+               if (be16_to_cpup(field) == VPHN_FIELD_UNUSED) {
                        /* All significant fields processed, and remaining
                         * fields contain the reserved value of all 1's.
                         * Just store them.
                         */
-                       unpacked[i] = *((u32*)field);
+                       unpacked[i] = *((__be32 *)field);
                        field += 2;
-               } else if (*field & VPHN_FIELD_MSB) {
+               } else if (be16_to_cpup(field) & VPHN_FIELD_MSB) {
                        /* Data is in the lower 15 bits of this field */
-                       unpacked[i] = *field & VPHN_FIELD_MASK;
+                       unpacked[i] = cpu_to_be32(
+                               be16_to_cpup(field) & VPHN_FIELD_MASK);
                        field++;
                        nr_assoc_doms++;
                } else {
                        /* Data is in the lower 15 bits of this field
                         * concatenated with the next 16 bit field
                         */
-                       unpacked[i] = *((u32*)field);
+                       unpacked[i] = *((__be32 *)field);
                        field += 2;
                        nr_assoc_doms++;
                }
        }
 
        /* The first cell contains the length of the property */
-       unpacked[0] = nr_assoc_doms;
+       unpacked[0] = cpu_to_be32(nr_assoc_doms);
 
        return nr_assoc_doms;
 }
@@ -1379,7 +1383,7 @@ static int vphn_unpack_associativity(const long *packed, unsigned int *unpacked)
  * Retrieve the new associativity information for a virtual processor's
  * home node.
  */
-static long hcall_vphn(unsigned long cpu, unsigned int *associativity)
+static long hcall_vphn(unsigned long cpu, __be32 *associativity)
 {
        long rc;
        long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
@@ -1393,7 +1397,7 @@ static long hcall_vphn(unsigned long cpu, unsigned int *associativity)
 }
 
 static long vphn_get_associativity(unsigned long cpu,
-                                       unsigned int *associativity)
+                                       __be32 *associativity)
 {
        long rc;
 
@@ -1450,7 +1454,7 @@ int arch_update_cpu_topology(void)
 {
        unsigned int cpu, sibling, changed = 0;
        struct topology_update_data *updates, *ud;
-       unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0};
+       __be32 associativity[VPHN_ASSOC_BUFSIZE] = {0};
        cpumask_t updated_cpus;
        struct device *dev;
        int weight, new_nid, i = 0;
@@ -1609,7 +1613,7 @@ int start_topology_update(void)
 #endif
                }
        } else if (firmware_has_feature(FW_FEATURE_VPHN) &&
-                  get_lppaca()->shared_proc) {
+                  lppaca_shared_proc(get_lppaca())) {
                if (!vphn_enabled) {
                        prrn_enabled = 0;
                        vphn_enabled = 1;
index a538c80..9d1d33c 100644 (file)
@@ -66,8 +66,10 @@ static inline void slb_shadow_update(unsigned long ea, int ssize,
         * we only update the current CPU's SLB shadow buffer.
         */
        get_slb_shadow()->save_area[entry].esid = 0;
-       get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, ssize, flags);
-       get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, ssize, entry);
+       get_slb_shadow()->save_area[entry].vsid =
+                               cpu_to_be64(mk_vsid_data(ea, ssize, flags));
+       get_slb_shadow()->save_area[entry].esid =
+                               cpu_to_be64(mk_esid_data(ea, ssize, entry));
 }
 
 static inline void slb_shadow_clear(unsigned long entry)
@@ -112,7 +114,8 @@ static void __slb_flush_and_rebolt(void)
        } else {
                /* Update stack entry; others don't change */
                slb_shadow_update(get_paca()->kstack, mmu_kernel_ssize, lflags, 2);
-               ksp_vsid_data = get_slb_shadow()->save_area[2].vsid;
+               ksp_vsid_data =
+                       be64_to_cpu(get_slb_shadow()->save_area[2].vsid);
        }
 
        /* We need to do this all in asm, so we're sure we don't touch
index aa74acb..a770df2 100644 (file)
@@ -105,7 +105,7 @@ static void subpage_prot_clear(unsigned long addr, unsigned long len)
                limit = spt->maxaddr;
        for (; addr < limit; addr = next) {
                next = pmd_addr_end(addr, limit);
-               if (addr < 0x100000000) {
+               if (addr < 0x100000000UL) {
                        spm = spt->low_prot;
                } else {
                        spm = spt->protptrs[addr >> SBP_L3_SHIFT];
@@ -219,7 +219,7 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
        for (limit = addr + len; addr < limit; addr = next) {
                next = pmd_addr_end(addr, limit);
                err = -ENOMEM;
-               if (addr < 0x100000000) {
+               if (addr < 0x100000000UL) {
                        spm = spt->low_prot;
                } else {
                        spm = spt->protptrs[addr >> SBP_L3_SHIFT];
index ccc1daa..2a82d3e 100644 (file)
@@ -46,6 +46,12 @@ static inline u32 get_pmlca(int ctr)
                case 3:
                        pmlca = mfpmr(PMRN_PMLCA3);
                        break;
+               case 4:
+                       pmlca = mfpmr(PMRN_PMLCA4);
+                       break;
+               case 5:
+                       pmlca = mfpmr(PMRN_PMLCA5);
+                       break;
                default:
                        panic("Bad ctr number\n");
        }
@@ -68,6 +74,12 @@ static inline void set_pmlca(int ctr, u32 pmlca)
                case 3:
                        mtpmr(PMRN_PMLCA3, pmlca);
                        break;
+               case 4:
+                       mtpmr(PMRN_PMLCA4, pmlca);
+                       break;
+               case 5:
+                       mtpmr(PMRN_PMLCA5, pmlca);
+                       break;
                default:
                        panic("Bad ctr number\n");
        }
@@ -84,6 +96,10 @@ static inline unsigned int ctr_read(unsigned int i)
                        return mfpmr(PMRN_PMC2);
                case 3:
                        return mfpmr(PMRN_PMC3);
+               case 4:
+                       return mfpmr(PMRN_PMC4);
+               case 5:
+                       return mfpmr(PMRN_PMC5);
                default:
                        return 0;
        }
@@ -104,6 +120,12 @@ static inline void ctr_write(unsigned int i, unsigned int val)
                case 3:
                        mtpmr(PMRN_PMC3, val);
                        break;
+               case 4:
+                       mtpmr(PMRN_PMC4, val);
+                       break;
+               case 5:
+                       mtpmr(PMRN_PMC5, val);
+                       break;
                default:
                        break;
        }
@@ -133,6 +155,14 @@ static void init_pmc_stop(int ctr)
                        mtpmr(PMRN_PMLCA3, pmlca);
                        mtpmr(PMRN_PMLCB3, pmlcb);
                        break;
+               case 4:
+                       mtpmr(PMRN_PMLCA4, pmlca);
+                       mtpmr(PMRN_PMLCB4, pmlcb);
+                       break;
+               case 5:
+                       mtpmr(PMRN_PMLCA5, pmlca);
+                       mtpmr(PMRN_PMLCB5, pmlcb);
+                       break;
                default:
                        panic("Bad ctr number!\n");
        }
index 510fae1..60d71ee 100644 (file)
@@ -9,7 +9,7 @@ obj64-$(CONFIG_PPC_PERF_CTRS)   += power4-pmu.o ppc970-pmu.o power5-pmu.o \
 obj32-$(CONFIG_PPC_PERF_CTRS)  += mpc7450-pmu.o
 
 obj-$(CONFIG_FSL_EMB_PERF_EVENT) += core-fsl-emb.o
-obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o
+obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o e6500-pmu.o
 
 obj-$(CONFIG_PPC64)            += $(obj64-y)
 obj-$(CONFIG_PPC32)            += $(obj32-y)
index eeae308..29b89e8 100644 (file)
@@ -24,7 +24,7 @@
 #define BHRB_MAX_ENTRIES       32
 #define BHRB_TARGET            0x0000000000000002
 #define BHRB_PREDICTION                0x0000000000000001
-#define BHRB_EA                        0xFFFFFFFFFFFFFFFC
+#define BHRB_EA                        0xFFFFFFFFFFFFFFFCUL
 
 struct cpu_hw_events {
        int n_events;
index 106c533..d35ae52 100644 (file)
@@ -70,6 +70,12 @@ static unsigned long read_pmc(int idx)
        case 3:
                val = mfpmr(PMRN_PMC3);
                break;
+       case 4:
+               val = mfpmr(PMRN_PMC4);
+               break;
+       case 5:
+               val = mfpmr(PMRN_PMC5);
+               break;
        default:
                printk(KERN_ERR "oops trying to read PMC%d\n", idx);
                val = 0;
@@ -95,6 +101,12 @@ static void write_pmc(int idx, unsigned long val)
        case 3:
                mtpmr(PMRN_PMC3, val);
                break;
+       case 4:
+               mtpmr(PMRN_PMC4, val);
+               break;
+       case 5:
+               mtpmr(PMRN_PMC5, val);
+               break;
        default:
                printk(KERN_ERR "oops trying to write PMC%d\n", idx);
        }
@@ -120,6 +132,12 @@ static void write_pmlca(int idx, unsigned long val)
        case 3:
                mtpmr(PMRN_PMLCA3, val);
                break;
+       case 4:
+               mtpmr(PMRN_PMLCA4, val);
+               break;
+       case 5:
+               mtpmr(PMRN_PMLCA5, val);
+               break;
        default:
                printk(KERN_ERR "oops trying to write PMLCA%d\n", idx);
        }
@@ -145,6 +163,12 @@ static void write_pmlcb(int idx, unsigned long val)
        case 3:
                mtpmr(PMRN_PMLCB3, val);
                break;
+       case 4:
+               mtpmr(PMRN_PMLCB4, val);
+               break;
+       case 5:
+               mtpmr(PMRN_PMLCB5, val);
+               break;
        default:
                printk(KERN_ERR "oops trying to write PMLCB%d\n", idx);
        }
@@ -462,6 +486,12 @@ static int fsl_emb_pmu_event_init(struct perf_event *event)
        int num_restricted;
        int i;
 
+       if (ppmu->n_counter > MAX_HWEVENTS) {
+               WARN(1, "No. of perf counters (%d) is higher than max array size(%d)\n",
+                       ppmu->n_counter, MAX_HWEVENTS);
+               ppmu->n_counter = MAX_HWEVENTS;
+       }
+
        switch (event->attr.type) {
        case PERF_TYPE_HARDWARE:
                ev = event->attr.config;
diff --git a/arch/powerpc/perf/e6500-pmu.c b/arch/powerpc/perf/e6500-pmu.c
new file mode 100644 (file)
index 0000000..3d877aa
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Performance counter support for e6500 family processors.
+ *
+ * Author: Priyanka Jain, Priyanka.Jain@freescale.com
+ * Based on e500-pmu.c
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/string.h>
+#include <linux/perf_event.h>
+#include <asm/reg.h>
+#include <asm/cputable.h>
+
+/*
+ * Map of generic hardware event types to hardware events
+ * Zero if unsupported
+ */
+static int e6500_generic_events[] = {
+       [PERF_COUNT_HW_CPU_CYCLES] = 1,
+       [PERF_COUNT_HW_INSTRUCTIONS] = 2,
+       [PERF_COUNT_HW_CACHE_MISSES] = 221,
+       [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 12,
+       [PERF_COUNT_HW_BRANCH_MISSES] = 15,
+};
+
+#define C(x)   PERF_COUNT_HW_CACHE_##x
+
+/*
+ * Table of generalized cache-related events.
+ * 0 means not supported, -1 means nonsensical, other values
+ * are event codes.
+ */
+static int e6500_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
+       [C(L1D)] = {
+                               /*RESULT_ACCESS         RESULT_MISS */
+               [C(OP_READ)] = {        27,             222     },
+               [C(OP_WRITE)] = {       28,             223     },
+               [C(OP_PREFETCH)] = {    29,             0       },
+       },
+       [C(L1I)] = {
+                               /*RESULT_ACCESS         RESULT_MISS */
+               [C(OP_READ)] = {        2,              254     },
+               [C(OP_WRITE)] = {       -1,             -1      },
+               [C(OP_PREFETCH)] = {    37,             0       },
+       },
+       /*
+        * Assuming LL means L2, it's not a good match for this model.
+        * It does not have separate read/write events (but it does have
+        * separate instruction/data events).
+        */
+       [C(LL)] = {
+                               /*RESULT_ACCESS         RESULT_MISS */
+               [C(OP_READ)] = {        0,              0       },
+               [C(OP_WRITE)] = {       0,              0       },
+               [C(OP_PREFETCH)] = {    0,              0       },
+       },
+       /*
+        * There are data/instruction MMU misses, but that's a miss on
+        * the chip's internal level-one TLB which is probably not
+        * what the user wants.  Instead, unified level-two TLB misses
+        * are reported here.
+        */
+       [C(DTLB)] = {
+                               /*RESULT_ACCESS         RESULT_MISS */
+               [C(OP_READ)] = {        26,             66      },
+               [C(OP_WRITE)] = {       -1,             -1      },
+               [C(OP_PREFETCH)] = {    -1,             -1      },
+       },
+       [C(BPU)] = {
+                               /*RESULT_ACCESS         RESULT_MISS */
+               [C(OP_READ)] = {        12,             15      },
+               [C(OP_WRITE)] = {       -1,             -1      },
+               [C(OP_PREFETCH)] = {    -1,             -1      },
+       },
+       [C(NODE)] = {
+                               /* RESULT_ACCESS        RESULT_MISS */
+               [C(OP_READ)] = {        -1,             -1      },
+               [C(OP_WRITE)] = {       -1,             -1      },
+               [C(OP_PREFETCH)] = {    -1,             -1      },
+       },
+};
+
+static int num_events = 512;
+
+/* Upper half of event id is PMLCb, for threshold events */
+static u64 e6500_xlate_event(u64 event_id)
+{
+       u32 event_low = (u32)event_id;
+       if (event_low >= num_events ||
+               (event_id & (FSL_EMB_EVENT_THRESHMUL | FSL_EMB_EVENT_THRESH)))
+               return 0;
+
+       return FSL_EMB_EVENT_VALID;
+}
+
+static struct fsl_emb_pmu e6500_pmu = {
+       .name                   = "e6500 family",
+       .n_counter              = 6,
+       .n_restricted           = 0,
+       .xlate_event            = e6500_xlate_event,
+       .n_generic              = ARRAY_SIZE(e6500_generic_events),
+       .generic_events         = e6500_generic_events,
+       .cache_events           = &e6500_cache_events,
+};
+
+static int init_e6500_pmu(void)
+{
+       if (!cur_cpu_spec->oprofile_cpu_type ||
+               strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/e6500"))
+               return -ENODEV;
+
+       return register_fsl_emb_pmu(&e6500_pmu);
+}
+
+early_initcall(init_e6500_pmu);
index b89ef65..b69221b 100644 (file)
@@ -373,8 +373,9 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq,
        case MPC52xx_IRQ_L1_PERP: irqchip = &mpc52xx_periph_irqchip; break;
        case MPC52xx_IRQ_L1_SDMA: irqchip = &mpc52xx_sdma_irqchip; break;
        case MPC52xx_IRQ_L1_CRIT:
+       default:
                pr_warn("%s: Critical IRQ #%d is unsupported! Nopping it.\n",
-                       __func__, l2irq);
+                       __func__, l1irq);
                irq_set_chip(virq, &no_irq_chip);
                return 0;
        }
index efdd37c..de2eb93 100644 (file)
@@ -32,6 +32,12 @@ config BSC9131_RDB
          StarCore SC3850 DSP
          Manufacturer : Freescale Semiconductor, Inc
 
+config C293_PCIE
+         bool "Freescale C293PCIE"
+         select DEFAULT_UIMAGE
+         help
+         This option enables support for the C293PCIE board
+
 config MPC8540_ADS
        bool "Freescale MPC8540 ADS"
        select DEFAULT_UIMAGE
@@ -112,10 +118,10 @@ config P1022_RDK
          reference board.
 
 config P1023_RDS
-       bool "Freescale P1023 RDS"
+       bool "Freescale P1023 RDS/RDB"
        select DEFAULT_UIMAGE
        help
-         This option enables support for the P1023 RDS board
+         This option enables support for the P1023 RDS and RDB boards
 
 config SOCRATES
        bool "Socrates"
index 2eab37e..53c9f75 100644 (file)
@@ -6,6 +6,7 @@ obj-$(CONFIG_SMP) += smp.o
 obj-y += common.o
 
 obj-$(CONFIG_BSC9131_RDB) += bsc913x_rdb.o
+obj-$(CONFIG_C293_PCIE)   += c293pcie.o
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/c293pcie.c b/arch/powerpc/platforms/85xx/c293pcie.c
new file mode 100644 (file)
index 0000000..6208e49
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * C293PCIE Board Setup
+ *
+ * Copyright 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/stddef.h>
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/udbg.h>
+#include <asm/mpic.h>
+
+#include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
+
+#include "mpc85xx.h"
+
+void __init c293_pcie_pic_init(void)
+{
+       struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
+         MPIC_SINGLE_DEST_CPU, 0, 256, " OpenPIC  ");
+
+       BUG_ON(mpic == NULL);
+
+       mpic_init(mpic);
+}
+
+
+/*
+ * Setup the architecture
+ */
+static void __init c293_pcie_setup_arch(void)
+{
+       if (ppc_md.progress)
+               ppc_md.progress("c293_pcie_setup_arch()", 0);
+
+       fsl_pci_assign_primary();
+
+       printk(KERN_INFO "C293 PCIE board from Freescale Semiconductor\n");
+}
+
+machine_arch_initcall(c293_pcie, mpc85xx_common_publish_devices);
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init c293_pcie_probe(void)
+{
+       unsigned long root = of_get_flat_dt_root();
+
+       if (of_flat_dt_is_compatible(root, "fsl,C293PCIE"))
+               return 1;
+       return 0;
+}
+
+define_machine(c293_pcie) {
+       .name                   = "C293 PCIE",
+       .probe                  = c293_pcie_probe,
+       .setup_arch             = c293_pcie_setup_arch,
+       .init_IRQ               = c293_pcie_pic_init,
+#ifdef CONFIG_PCI
+       .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
+#endif
+       .get_irq                = mpic_get_irq,
+       .restart                = fsl_rstcr_restart,
+       .calibrate_decr         = generic_calibrate_decr,
+       .progress               = udbg_progress,
+};
index c59c617..aa3690b 100644 (file)
@@ -53,12 +53,6 @@ void __init corenet_ds_setup_arch(void)
 {
        mpc85xx_smp_init();
 
-#if defined(CONFIG_PCI) && defined(CONFIG_PPC64)
-       pci_devs_phb_init();
-#endif
-
-       fsl_pci_assign_primary();
-
        swiotlb_detect_4g();
 
        pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
index ede8771..53b6fb0 100644 (file)
@@ -160,6 +160,7 @@ machine_arch_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices);
 machine_arch_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices);
 machine_arch_initcall(p1020_rdb, mpc85xx_common_publish_devices);
 machine_arch_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1020_rdb_pd, mpc85xx_common_publish_devices);
 machine_arch_initcall(p1020_utm_pc, mpc85xx_common_publish_devices);
 machine_arch_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
 machine_arch_initcall(p1025_rdb, mpc85xx_common_publish_devices);
@@ -193,6 +194,13 @@ static int __init p1020_rdb_pc_probe(void)
        return of_flat_dt_is_compatible(root, "fsl,P1020RDB-PC");
 }
 
+static int __init p1020_rdb_pd_probe(void)
+{
+       unsigned long root = of_get_flat_dt_root();
+
+       return of_flat_dt_is_compatible(root, "fsl,P1020RDB-PD");
+}
+
 static int __init p1021_rdb_pc_probe(void)
 {
        unsigned long root = of_get_flat_dt_root();
@@ -351,6 +359,20 @@ define_machine(p1020_rdb_pc) {
        .progress               = udbg_progress,
 };
 
+define_machine(p1020_rdb_pd) {
+       .name                   = "P1020RDB-PD",
+       .probe                  = p1020_rdb_pd_probe,
+       .setup_arch             = mpc85xx_rdb_setup_arch,
+       .init_IRQ               = mpc85xx_rdb_pic_init,
+#ifdef CONFIG_PCI
+       .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
+#endif
+       .get_irq                = mpic_get_irq,
+       .restart                = fsl_rstcr_restart,
+       .calibrate_decr         = generic_calibrate_decr,
+       .progress               = udbg_progress,
+};
+
 define_machine(p1024_rdb) {
        .name                   = "P1024 RDB",
        .probe                  = p1024_rdb_probe,
index 9cc60a7..2ae9d49 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.
  *
  * Author: Roy Zang <tie-fei.zang@freescale.com>
  *
@@ -86,6 +86,7 @@ static void __init mpc85xx_rds_setup_arch(void)
 }
 
 machine_arch_initcall(p1023_rds, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1023_rdb, mpc85xx_common_publish_devices);
 
 static void __init mpc85xx_rds_pic_init(void)
 {
@@ -106,6 +107,14 @@ static int __init p1023_rds_probe(void)
 
 }
 
+static int __init p1023_rdb_probe(void)
+{
+       unsigned long root = of_get_flat_dt_root();
+
+       return of_flat_dt_is_compatible(root, "fsl,P1023RDB");
+
+}
+
 define_machine(p1023_rds) {
        .name                   = "P1023 RDS",
        .probe                  = p1023_rds_probe,
@@ -120,3 +129,16 @@ define_machine(p1023_rds) {
 #endif
 };
 
+define_machine(p1023_rdb) {
+       .name                   = "P1023 RDB",
+       .probe                  = p1023_rdb_probe,
+       .setup_arch             = mpc85xx_rds_setup_arch,
+       .init_IRQ               = mpc85xx_rds_pic_init,
+       .get_irq                = mpic_get_irq,
+       .restart                = fsl_rstcr_restart,
+       .calibrate_decr         = generic_calibrate_decr,
+       .progress               = udbg_progress,
+#ifdef CONFIG_PCI
+       .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
+#endif
+};
index 5ced4f5..281b7f0 100644 (file)
@@ -69,7 +69,32 @@ static void mpc85xx_give_timebase(void)
        tb_req = 0;
 
        mpc85xx_timebase_freeze(1);
+#ifdef CONFIG_PPC64
+       /*
+        * e5500/e6500 have a workaround for erratum A-006958 in place
+        * that will reread the timebase until TBL is non-zero.
+        * That would be a bad thing when the timebase is frozen.
+        *
+        * Thus, we read it manually, and instead of checking that
+        * TBL is non-zero, we ensure that TB does not change.  We don't
+        * do that for the main mftb implementation, because it requires
+        * a scratch register
+        */
+       {
+               u64 prev;
+
+               asm volatile("mfspr %0, %1" : "=r" (timebase) :
+                            "i" (SPRN_TBRL));
+
+               do {
+                       prev = timebase;
+                       asm volatile("mfspr %0, %1" : "=r" (timebase) :
+                                    "i" (SPRN_TBRL));
+               } while (prev != timebase);
+       }
+#else
        timebase = get_tb();
+#endif
        mb();
        tb_valid = 1;
 
@@ -255,6 +280,7 @@ out:
 
 struct smp_ops_t smp_85xx_ops = {
        .kick_cpu = smp_85xx_kick_cpu,
+       .cpu_bootable = smp_generic_cpu_bootable,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_disable    = generic_cpu_disable,
        .cpu_die        = generic_cpu_die,
index d703775..bf9c6d4 100644 (file)
@@ -202,17 +202,12 @@ config PPC_P7_NAP
        bool
        default n
 
-config PPC_INDIRECT_IO
-       bool
-       select GENERIC_IOMAP
-
 config PPC_INDIRECT_PIO
        bool
-       select PPC_INDIRECT_IO
+       select GENERIC_IOMAP
 
 config PPC_INDIRECT_MMIO
        bool
-       select PPC_INDIRECT_IO
 
 config PPC_IO_WORKAROUNDS
        bool
index 47d9a03..6704e2e 100644 (file)
@@ -96,18 +96,31 @@ config GENERIC_CPU
 
 config CELL_CPU
        bool "Cell Broadband Engine"
+       depends on PPC_BOOK3S_64
 
 config POWER4_CPU
        bool "POWER4"
+       depends on PPC_BOOK3S_64
 
 config POWER5_CPU
        bool "POWER5"
+       depends on PPC_BOOK3S_64
 
 config POWER6_CPU
        bool "POWER6"
+       depends on PPC_BOOK3S_64
 
 config POWER7_CPU
        bool "POWER7"
+       depends on PPC_BOOK3S_64
+
+config E5500_CPU
+       bool "Freescale e5500"
+       depends on E500
+
+config E6500_CPU
+       bool "Freescale e6500"
+       depends on E500
 
 endchoice
 
index 946306b..b535606 100644 (file)
@@ -697,7 +697,7 @@ static int __init cell_iommu_get_window(struct device_node *np,
                                         unsigned long *base,
                                         unsigned long *size)
 {
-       const void *dma_window;
+       const __be32 *dma_window;
        unsigned long index;
 
        /* Use ibm,dma-window if available, else, hard code ! */
index f75f6fc..90745ea 100644 (file)
@@ -136,25 +136,12 @@ static int smp_cell_kick_cpu(int nr)
        return 0;
 }
 
-static int smp_cell_cpu_bootable(unsigned int nr)
-{
-       /* Special case - we inhibit secondary thread startup
-        * during boot if the user requests it.  Odd-numbered
-        * cpus are assumed to be secondary threads.
-        */
-       if (system_state == SYSTEM_BOOTING &&
-           cpu_has_feature(CPU_FTR_SMT) &&
-           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
-               return 0;
-
-       return 1;
-}
 static struct smp_ops_t bpa_iic_smp_ops = {
        .message_pass   = iic_message_pass,
        .probe          = smp_iic_probe,
        .kick_cpu       = smp_cell_kick_cpu,
        .setup_cpu      = smp_cell_setup_cpu,
-       .cpu_bootable   = smp_cell_cpu_bootable,
+       .cpu_bootable   = smp_generic_cpu_bootable,
 };
 
 /* This is called very early */
index c24684c..6fae5eb 100644 (file)
@@ -7,6 +7,8 @@ config PPC_POWERNV
        select PPC_P7_NAP
        select PPC_PCI_CHOICE if EMBEDDED
        select EPAPR_BOOT
+       select PPC_INDIRECT_PIO
+       select PPC_UDBG_16550
        default y
 
 config POWERNV_MSI
index 7fe5951..300c437 100644 (file)
@@ -1,5 +1,5 @@
 obj-y                  += setup.o opal-takeover.o opal-wrappers.o opal.o
-obj-y                  += opal-rtc.o opal-nvram.o
+obj-y                  += opal-rtc.o opal-nvram.o opal-lpc.o
 
 obj-$(CONFIG_SMP)      += smp.o
 obj-$(CONFIG_PCI)      += pci.o pci-p5ioc2.o pci-ioda.o
index 0cd1c4a..cf42e74 100644 (file)
 #include "powernv.h"
 #include "pci.h"
 
-/* Debugging option */
-#ifdef IODA_EEH_DBG_ON
-#define IODA_EEH_DBG(args...)  pr_info(args)
-#else
-#define IODA_EEH_DBG(args...)
-#endif
-
 static char *hub_diag = NULL;
 static int ioda_eeh_nb_init = 0;
 
@@ -823,17 +816,17 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
 
                /* If OPAL API returns error, we needn't proceed */
                if (rc != OPAL_SUCCESS) {
-                       IODA_EEH_DBG("%s: Invalid return value on "
-                                    "PHB#%x (0x%lx) from opal_pci_next_error",
-                                    __func__, hose->global_number, rc);
+                       pr_devel("%s: Invalid return value on "
+                                "PHB#%x (0x%lx) from opal_pci_next_error",
+                                __func__, hose->global_number, rc);
                        continue;
                }
 
                /* If the PHB doesn't have error, stop processing */
                if (err_type == OPAL_EEH_NO_ERROR ||
                    severity == OPAL_EEH_SEV_NO_ERROR) {
-                       IODA_EEH_DBG("%s: No error found on PHB#%x\n",
-                                    __func__, hose->global_number);
+                       pr_devel("%s: No error found on PHB#%x\n",
+                                __func__, hose->global_number);
                        continue;
                }
 
@@ -842,8 +835,9 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
                 * highest priority reported upon multiple errors on the
                 * specific PHB.
                 */
-               IODA_EEH_DBG("%s: Error (%d, %d, %d) on PHB#%x\n",
-                       err_type, severity, pe_no, hose->global_number);
+               pr_devel("%s: Error (%d, %d, %llu) on PHB#%x\n",
+                        __func__, err_type, severity,
+                        frozen_pe_no, hose->global_number);
                switch (err_type) {
                case OPAL_EEH_IOC_ERROR:
                        if (severity == OPAL_EEH_SEV_IOC_DEAD) {
diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c
new file mode 100644 (file)
index 0000000..a7614bb
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * PowerNV LPC bus handling.
+ *
+ * Copyright 2013 IBM Corp.
+ *
+ * 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/of.h>
+#include <linux/bug.h>
+
+#include <asm/machdep.h>
+#include <asm/firmware.h>
+#include <asm/xics.h>
+#include <asm/opal.h>
+
+static int opal_lpc_chip_id = -1;
+
+static u8 opal_lpc_inb(unsigned long port)
+{
+       int64_t rc;
+       uint32_t data;
+
+       if (opal_lpc_chip_id < 0 || port > 0xffff)
+               return 0xff;
+       rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 1);
+       return rc ? 0xff : data;
+}
+
+static __le16 __opal_lpc_inw(unsigned long port)
+{
+       int64_t rc;
+       uint32_t data;
+
+       if (opal_lpc_chip_id < 0 || port > 0xfffe)
+               return 0xffff;
+       if (port & 1)
+               return (__le16)opal_lpc_inb(port) << 8 | opal_lpc_inb(port + 1);
+       rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 2);
+       return rc ? 0xffff : data;
+}
+static u16 opal_lpc_inw(unsigned long port)
+{
+       return le16_to_cpu(__opal_lpc_inw(port));
+}
+
+static __le32 __opal_lpc_inl(unsigned long port)
+{
+       int64_t rc;
+       uint32_t data;
+
+       if (opal_lpc_chip_id < 0 || port > 0xfffc)
+               return 0xffffffff;
+       if (port & 3)
+               return (__le32)opal_lpc_inb(port    ) << 24 |
+                      (__le32)opal_lpc_inb(port + 1) << 16 |
+                      (__le32)opal_lpc_inb(port + 2) <<  8 |
+                              opal_lpc_inb(port + 3);
+       rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 4);
+       return rc ? 0xffffffff : data;
+}
+
+static u32 opal_lpc_inl(unsigned long port)
+{
+       return le32_to_cpu(__opal_lpc_inl(port));
+}
+
+static void opal_lpc_outb(u8 val, unsigned long port)
+{
+       if (opal_lpc_chip_id < 0 || port > 0xffff)
+               return;
+       opal_lpc_write(opal_lpc_chip_id, OPAL_LPC_IO, port, val, 1);
+}
+
+static void __opal_lpc_outw(__le16 val, unsigned long port)
+{
+       if (opal_lpc_chip_id < 0 || port > 0xfffe)
+               return;
+       if (port & 1) {
+               opal_lpc_outb(val >> 8, port);
+               opal_lpc_outb(val     , port + 1);
+               return;
+       }
+       opal_lpc_write(opal_lpc_chip_id, OPAL_LPC_IO, port, val, 2);
+}
+
+static void opal_lpc_outw(u16 val, unsigned long port)
+{
+       __opal_lpc_outw(cpu_to_le16(val), port);
+}
+
+static void __opal_lpc_outl(__le32 val, unsigned long port)
+{
+       if (opal_lpc_chip_id < 0 || port > 0xfffc)
+               return;
+       if (port & 3) {
+               opal_lpc_outb(val >> 24, port);
+               opal_lpc_outb(val >> 16, port + 1);
+               opal_lpc_outb(val >>  8, port + 2);
+               opal_lpc_outb(val      , port + 3);
+               return;
+       }
+       opal_lpc_write(opal_lpc_chip_id, OPAL_LPC_IO, port, val, 4);
+}
+
+static void opal_lpc_outl(u32 val, unsigned long port)
+{
+       __opal_lpc_outl(cpu_to_le32(val), port);
+}
+
+static void opal_lpc_insb(unsigned long p, void *b, unsigned long c)
+{
+       u8 *ptr = b;
+
+       while(c--)
+               *(ptr++) = opal_lpc_inb(p);
+}
+
+static void opal_lpc_insw(unsigned long p, void *b, unsigned long c)
+{
+       __le16 *ptr = b;
+
+       while(c--)
+               *(ptr++) = __opal_lpc_inw(p);
+}
+
+static void opal_lpc_insl(unsigned long p, void *b, unsigned long c)
+{
+       __le32 *ptr = b;
+
+       while(c--)
+               *(ptr++) = __opal_lpc_inl(p);
+}
+
+static void opal_lpc_outsb(unsigned long p, const void *b, unsigned long c)
+{
+       const u8 *ptr = b;
+
+       while(c--)
+               opal_lpc_outb(*(ptr++), p);
+}
+
+static void opal_lpc_outsw(unsigned long p, const void *b, unsigned long c)
+{
+       const __le16 *ptr = b;
+
+       while(c--)
+               __opal_lpc_outw(*(ptr++), p);
+}
+
+static void opal_lpc_outsl(unsigned long p, const void *b, unsigned long c)
+{
+       const __le32 *ptr = b;
+
+       while(c--)
+               __opal_lpc_outl(*(ptr++), p);
+}
+
+static const struct ppc_pci_io opal_lpc_io = {
+       .inb    = opal_lpc_inb,
+       .inw    = opal_lpc_inw,
+       .inl    = opal_lpc_inl,
+       .outb   = opal_lpc_outb,
+       .outw   = opal_lpc_outw,
+       .outl   = opal_lpc_outl,
+       .insb   = opal_lpc_insb,
+       .insw   = opal_lpc_insw,
+       .insl   = opal_lpc_insl,
+       .outsb  = opal_lpc_outsb,
+       .outsw  = opal_lpc_outsw,
+       .outsl  = opal_lpc_outsl,
+};
+
+void opal_lpc_init(void)
+{
+       struct device_node *np;
+
+       /*
+        * Look for a Power8 LPC bus tagged as "primary",
+        * we currently support only one though the OPAL APIs
+        * support any number.
+        */
+       for_each_compatible_node(np, NULL, "ibm,power8-lpc") {
+               if (!of_device_is_available(np))
+                       continue;
+               if (!of_get_property(np, "primary", NULL))
+                       continue;
+               opal_lpc_chip_id = of_get_ibm_chip_id(np);
+               break;
+       }
+       if (opal_lpc_chip_id < 0)
+               return;
+
+       /* Setup special IO ops */
+       ppc_pci_io = opal_lpc_io;
+       isa_io_special = true;
+
+       pr_info("OPAL: Power8 LPC bus found, chip ID %d\n", opal_lpc_chip_id);
+}
index e88863f..8f38445 100644 (file)
@@ -111,3 +111,8 @@ OPAL_CALL(opal_pci_next_error,                      OPAL_PCI_NEXT_ERROR);
 OPAL_CALL(opal_pci_poll,                       OPAL_PCI_POLL);
 OPAL_CALL(opal_pci_msi_eoi,                    OPAL_PCI_MSI_EOI);
 OPAL_CALL(opal_pci_get_phb_diag_data2,         OPAL_PCI_GET_PHB_DIAG_DATA2);
+OPAL_CALL(opal_xscom_read,                     OPAL_XSCOM_READ);
+OPAL_CALL(opal_xscom_write,                    OPAL_XSCOM_WRITE);
+OPAL_CALL(opal_lpc_read,                       OPAL_LPC_READ);
+OPAL_CALL(opal_lpc_write,                      OPAL_LPC_WRITE);
+OPAL_CALL(opal_return_cpu,                     OPAL_RETURN_CPU);
index 106301f..2911abe 100644 (file)
@@ -380,18 +380,20 @@ static int __init opal_init(void)
                pr_warn("opal: Node not found\n");
                return -ENODEV;
        }
+
+       /* Register OPAL consoles if any ports */
        if (firmware_has_feature(FW_FEATURE_OPALv2))
                consoles = of_find_node_by_path("/ibm,opal/consoles");
        else
                consoles = of_node_get(opal_node);
-
-       /* Register serial ports */
-       for_each_child_of_node(consoles, np) {
-               if (strcmp(np->name, "serial"))
-                       continue;
-               of_platform_device_create(np, NULL, NULL);
+       if (consoles) {
+               for_each_child_of_node(consoles, np) {
+                       if (strcmp(np->name, "serial"))
+                               continue;
+                       of_platform_device_create(np, NULL, NULL);
+               }
+               of_node_put(consoles);
        }
-       of_node_put(consoles);
 
        /* Find all OPAL interrupts and request them */
        irqs = of_get_property(opal_node, "opal-interrupts", &irqlen);
@@ -422,7 +424,7 @@ void opal_shutdown(void)
 
        for (i = 0; i < opal_irq_count; i++) {
                if (opal_irqs[i])
-                       free_irq(opal_irqs[i], 0);
+                       free_irq(opal_irqs[i], NULL);
                opal_irqs[i] = 0;
        }
 }
index d8140b1..74a5a57 100644 (file)
@@ -1104,16 +1104,16 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
                                  u64 hub_id, int ioda_type)
 {
        struct pci_controller *hose;
-       static int primary = 1;
        struct pnv_phb *phb;
        unsigned long size, m32map_off, iomap_off, pemap_off;
        const u64 *prop64;
        const u32 *prop32;
+       int len;
        u64 phb_id;
        void *aux;
        long rc;
 
-       pr_info(" Initializing IODA%d OPAL PHB %s\n", ioda_type, np->full_name);
+       pr_info("Initializing IODA%d OPAL PHB %s\n", ioda_type, np->full_name);
 
        prop64 = of_get_property(np, "ibm,opal-phbid", NULL);
        if (!prop64) {
@@ -1124,20 +1124,31 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
        pr_debug("  PHB-ID  : 0x%016llx\n", phb_id);
 
        phb = alloc_bootmem(sizeof(struct pnv_phb));
-       if (phb) {
-               memset(phb, 0, sizeof(struct pnv_phb));
-               phb->hose = hose = pcibios_alloc_controller(np);
+       if (!phb) {
+               pr_err("  Out of memory !\n");
+               return;
        }
-       if (!phb || !phb->hose) {
-               pr_err("PCI: Failed to allocate PCI controller for %s\n",
+
+       /* Allocate PCI controller */
+       memset(phb, 0, sizeof(struct pnv_phb));
+       phb->hose = hose = pcibios_alloc_controller(np);
+       if (!phb->hose) {
+               pr_err("  Can't allocate PCI controller for %s\n",
                       np->full_name);
+               free_bootmem((unsigned long)phb, sizeof(struct pnv_phb));
                return;
        }
 
        spin_lock_init(&phb->lock);
-       /* XXX Use device-tree */
-       hose->first_busno = 0;
-       hose->last_busno = 0xff;
+       prop32 = of_get_property(np, "bus-range", &len);
+       if (prop32 && len == 8) {
+               hose->first_busno = prop32[0];
+               hose->last_busno = prop32[1];
+       } else {
+               pr_warn("  Broken <bus-range> on %s\n", np->full_name);
+               hose->first_busno = 0;
+               hose->last_busno = 0xff;
+       }
        hose->private_data = phb;
        phb->hub_id = hub_id;
        phb->opal_id = phb_id;
@@ -1152,8 +1163,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
                phb->model = PNV_PHB_MODEL_UNKNOWN;
 
        /* Parse 32-bit and IO ranges (if any) */
-       pci_process_bridge_OF_ranges(phb->hose, np, primary);
-       primary = 0;
+       pci_process_bridge_OF_ranges(hose, np, !hose->global_number);
 
        /* Get registers */
        phb->regs = of_iomap(np, 0);
@@ -1177,22 +1187,23 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
        phb->ioda.io_segsize = phb->ioda.io_size / phb->ioda.total_pe;
        phb->ioda.io_pci_base = 0; /* XXX calculate this ? */
 
-       /* Allocate aux data & arrays
-        *
-        * XXX TODO: Don't allocate io segmap on PHB3
-        */
+       /* Allocate aux data & arrays. We don't have IO ports on PHB3 */
        size = _ALIGN_UP(phb->ioda.total_pe / 8, sizeof(unsigned long));
        m32map_off = size;
        size += phb->ioda.total_pe * sizeof(phb->ioda.m32_segmap[0]);
        iomap_off = size;
-       size += phb->ioda.total_pe * sizeof(phb->ioda.io_segmap[0]);
+       if (phb->type == PNV_PHB_IODA1) {
+               iomap_off = size;
+               size += phb->ioda.total_pe * sizeof(phb->ioda.io_segmap[0]);
+       }
        pemap_off = size;
        size += phb->ioda.total_pe * sizeof(struct pnv_ioda_pe);
        aux = alloc_bootmem(size);
        memset(aux, 0, size);
        phb->ioda.pe_alloc = aux;
        phb->ioda.m32_segmap = aux + m32map_off;
-       phb->ioda.io_segmap = aux + iomap_off;
+       if (phb->type == PNV_PHB_IODA1)
+               phb->ioda.io_segmap = aux + iomap_off;
        phb->ioda.pe_array = aux + pemap_off;
        set_bit(0, phb->ioda.pe_alloc);
 
index a1c6f83..de6819b 100644 (file)
@@ -15,4 +15,6 @@ static inline void pnv_pci_init(void) { }
 static inline void pnv_pci_shutdown(void) { }
 #endif
 
+extern void pnv_lpc_init(void);
+
 #endif /* _POWERNV_H */
index 84438af..e239dcf 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/xics.h>
 #include <asm/rtas.h>
 #include <asm/opal.h>
+#include <asm/kexec.h>
 
 #include "powernv.h"
 
@@ -54,6 +55,12 @@ static void __init pnv_setup_arch(void)
 
 static void __init pnv_init_early(void)
 {
+       /*
+        * Initialize the LPC bus now so that legacy serial
+        * ports can be found on it
+        */
+       opal_lpc_init();
+
 #ifdef CONFIG_HVC_OPAL
        if (firmware_has_feature(FW_FEATURE_OPAL))
                hvc_opal_init_early();
@@ -147,6 +154,16 @@ static void pnv_shutdown(void)
 static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
 {
        xics_kexec_teardown_cpu(secondary);
+
+       /* Return secondary CPUs to firmware on OPAL v3 */
+       if (firmware_has_feature(FW_FEATURE_OPALv3) && secondary) {
+               mb();
+               get_paca()->kexec_state = KEXEC_STATE_REAL_MODE;
+               mb();
+
+               /* Return the CPU to OPAL */
+               opal_return_cpu();
+       }
 }
 #endif /* CONFIG_KEXEC */
 
index 89e3857..908672b 100644 (file)
@@ -46,22 +46,6 @@ static void pnv_smp_setup_cpu(int cpu)
                xics_setup_cpu();
 }
 
-static int pnv_smp_cpu_bootable(unsigned int nr)
-{
-       /* Special case - we inhibit secondary thread startup
-        * during boot if the user requests it.
-        */
-       if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
-               if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
-                       return 0;
-               if (smt_enabled_at_boot
-                   && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
-                       return 0;
-       }
-
-       return 1;
-}
-
 int pnv_smp_kick_cpu(int nr)
 {
        unsigned int pcpu = get_hard_smp_processor_id(nr);
@@ -195,7 +179,7 @@ static struct smp_ops_t pnv_smp_ops = {
        .probe          = xics_smp_probe,
        .kick_cpu       = pnv_smp_kick_cpu,
        .setup_cpu      = pnv_smp_setup_cpu,
-       .cpu_bootable   = pnv_smp_cpu_bootable,
+       .cpu_bootable   = smp_generic_cpu_bootable,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_disable    = pnv_smp_cpu_disable,
        .cpu_die        = generic_cpu_die,
index 8ae0103..6c61ec5 100644 (file)
@@ -22,6 +22,7 @@ obj-$(CONFIG_CMM)             += cmm.o
 obj-$(CONFIG_DTL)              += dtl.o
 obj-$(CONFIG_IO_EVENT_IRQ)     += io_event_irq.o
 obj-$(CONFIG_PSERIES_IDLE)     += processor_idle.o
+obj-$(CONFIG_LPARCFG)          += lparcfg.o
 
 ifeq ($(CONFIG_PPC_PSERIES),y)
 obj-$(CONFIG_SUSPEND)          += suspend.o
index c638535..1e561be 100644 (file)
@@ -40,8 +40,7 @@
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <linux/memory.h>
-
-#include "plpar_wrappers.h"
+#include <asm/plpar_wrappers.h>
 
 #define CMM_DRIVER_VERSION     "1.0.0"
 #define CMM_DEFAULT_DELAY      1
index a1a7b9a..7cfdaae 100644 (file)
@@ -63,26 +63,32 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
        return prop;
 }
 
-static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa)
+static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
+                                              const char *path)
 {
        struct device_node *dn;
        char *name;
 
+       /* If parent node path is "/" advance path to NULL terminator to
+        * prevent double leading slashs in full_name.
+        */
+       if (!path[1])
+               path++;
+
        dn = kzalloc(sizeof(*dn), GFP_KERNEL);
        if (!dn)
                return NULL;
 
-       /* The configure connector reported name does not contain a
-        * preceding '/', so we allocate a buffer large enough to
-        * prepend this to the full_name.
-        */
        name = (char *)ccwa + ccwa->name_offset;
-       dn->full_name = kasprintf(GFP_KERNEL, "/%s", name);
+       dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name);
        if (!dn->full_name) {
                kfree(dn);
                return NULL;
        }
 
+       of_node_set_flag(dn, OF_DYNAMIC);
+       kref_init(&dn->kref);
+
        return dn;
 }
 
@@ -120,7 +126,8 @@ void dlpar_free_cc_nodes(struct device_node *dn)
 #define CALL_AGAIN     -2
 #define ERR_CFG_USE     -9003
 
-struct device_node *dlpar_configure_connector(u32 drc_index)
+struct device_node *dlpar_configure_connector(u32 drc_index,
+                                             struct device_node *parent)
 {
        struct device_node *dn;
        struct device_node *first_dn = NULL;
@@ -129,6 +136,7 @@ struct device_node *dlpar_configure_connector(u32 drc_index)
        struct property *last_property = NULL;
        struct cc_workarea *ccwa;
        char *data_buf;
+       const char *parent_path = parent->full_name;
        int cc_token;
        int rc = -1;
 
@@ -162,7 +170,7 @@ struct device_node *dlpar_configure_connector(u32 drc_index)
                        break;
 
                case NEXT_SIBLING:
-                       dn = dlpar_parse_cc_node(ccwa);
+                       dn = dlpar_parse_cc_node(ccwa, parent_path);
                        if (!dn)
                                goto cc_error;
 
@@ -172,13 +180,17 @@ struct device_node *dlpar_configure_connector(u32 drc_index)
                        break;
 
                case NEXT_CHILD:
-                       dn = dlpar_parse_cc_node(ccwa);
+                       if (first_dn)
+                               parent_path = last_dn->full_name;
+
+                       dn = dlpar_parse_cc_node(ccwa, parent_path);
                        if (!dn)
                                goto cc_error;
 
-                       if (!first_dn)
+                       if (!first_dn) {
+                               dn->parent = parent;
                                first_dn = dn;
-                       else {
+                       else {
                                dn->parent = last_dn;
                                if (last_dn)
                                        last_dn->child = dn;
@@ -202,6 +214,7 @@ struct device_node *dlpar_configure_connector(u32 drc_index)
 
                case PREV_PARENT:
                        last_dn = last_dn->parent;
+                       parent_path = last_dn->parent->full_name;
                        break;
 
                case CALL_AGAIN:
@@ -256,8 +269,6 @@ int dlpar_attach_node(struct device_node *dn)
 {
        int rc;
 
-       of_node_set_flag(dn, OF_DYNAMIC);
-       kref_init(&dn->kref);
        dn->parent = derive_parent(dn->full_name);
        if (!dn->parent)
                return -ENOMEM;
@@ -275,8 +286,15 @@ int dlpar_attach_node(struct device_node *dn)
 
 int dlpar_detach_node(struct device_node *dn)
 {
+       struct device_node *child;
        int rc;
 
+       child = of_get_next_child(dn, NULL);
+       while (child) {
+               dlpar_detach_node(child);
+               child = of_get_next_child(dn, child);
+       }
+
        rc = of_detach_node(dn);
        if (rc)
                return rc;
@@ -382,9 +400,8 @@ out:
 
 static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
 {
-       struct device_node *dn;
+       struct device_node *dn, *parent;
        unsigned long drc_index;
-       char *cpu_name;
        int rc;
 
        cpu_hotplug_driver_lock();
@@ -394,25 +411,19 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
                goto out;
        }
 
-       dn = dlpar_configure_connector(drc_index);
-       if (!dn) {
-               rc = -EINVAL;
+       parent = of_find_node_by_path("/cpus");
+       if (!parent) {
+               rc = -ENODEV;
                goto out;
        }
 
-       /* configure-connector reports cpus as living in the base
-        * directory of the device tree.  CPUs actually live in the
-        * cpus directory so we need to fixup the full_name.
-        */
-       cpu_name = kasprintf(GFP_KERNEL, "/cpus%s", dn->full_name);
-       if (!cpu_name) {
-               dlpar_free_cc_nodes(dn);
-               rc = -ENOMEM;
+       dn = dlpar_configure_connector(drc_index, parent);
+       if (!dn) {
+               rc = -EINVAL;
                goto out;
        }
 
-       kfree(dn->full_name);
-       dn->full_name = cpu_name;
+       of_node_put(parent);
 
        rc = dlpar_acquire_drc(drc_index);
        if (rc) {
index 0cc0ac0..5db66f1 100644 (file)
@@ -29,8 +29,7 @@
 #include <asm/firmware.h>
 #include <asm/lppaca.h>
 #include <asm/debug.h>
-
-#include "plpar_wrappers.h"
+#include <asm/plpar_wrappers.h>
 
 struct dtl {
        struct dtl_entry        *buf;
@@ -87,7 +86,7 @@ static void consume_dtle(struct dtl_entry *dtle, u64 index)
        barrier();
 
        /* check for hypervisor ring buffer overflow, ignore this entry if so */
-       if (index + N_DISPATCH_LOG < vpa->dtl_idx)
+       if (index + N_DISPATCH_LOG < be64_to_cpu(vpa->dtl_idx))
                return;
 
        ++wp;
index 217ca5c..82789e7 100644 (file)
@@ -30,7 +30,8 @@
 #include <asm/machdep.h>
 #include <asm/vdso_datapage.h>
 #include <asm/xics.h>
-#include "plpar_wrappers.h"
+#include <asm/plpar_wrappers.h>
+
 #include "offline_states.h"
 
 /* This version can't take the spinlock, because it never returns */
@@ -123,7 +124,7 @@ static void pseries_mach_cpu_die(void)
                cede_latency_hint = 2;
 
                get_lppaca()->idle = 1;
-               if (!get_lppaca()->shared_proc)
+               if (!lppaca_shared_proc(get_lppaca()))
                        get_lppaca()->donate_dedicated_cpu = 1;
 
                while (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) {
@@ -137,7 +138,7 @@ static void pseries_mach_cpu_die(void)
 
                local_irq_disable();
 
-               if (!get_lppaca()->shared_proc)
+               if (!lppaca_shared_proc(get_lppaca()))
                        get_lppaca()->donate_dedicated_cpu = 0;
                get_lppaca()->idle = 0;
 
index b344f94..849b29b 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/errno.h>
 #include <asm/hvcall.h>
 #include <asm/hvconsole.h>
-#include "plpar_wrappers.h"
+#include <asm/plpar_wrappers.h>
 
 /**
  * hvc_get_chars - retrieve characters from firmware for denoted vterm adatper
  */
 int hvc_get_chars(uint32_t vtermno, char *buf, int count)
 {
-       unsigned long got;
+       long ret;
+       unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
+       unsigned long *lbuf = (unsigned long *)buf;
+
+       ret = plpar_hcall(H_GET_TERM_CHAR, retbuf, vtermno);
+       lbuf[0] = be64_to_cpu(retbuf[1]);
+       lbuf[1] = be64_to_cpu(retbuf[2]);
 
-       if (plpar_get_term_char(vtermno, &got, buf) == H_SUCCESS)
-               return got;
+       if (ret == H_SUCCESS)
+               return retbuf[0];
 
        return 0;
 }
@@ -69,8 +75,9 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
        if (count > MAX_VIO_PUT_CHARS)
                count = MAX_VIO_PUT_CHARS;
 
-       ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
-                                lbuf[1]);
+       ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count,
+                                cpu_to_be64(lbuf[0]),
+                                cpu_to_be64(lbuf[1]));
        if (ret == H_SUCCESS)
                return count;
        if (ret == H_BUSY)
index 23fc1dc..0307901 100644 (file)
@@ -48,8 +48,7 @@
 #include <asm/ppc-pci.h>
 #include <asm/udbg.h>
 #include <asm/mmzone.h>
-
-#include "plpar_wrappers.h"
+#include <asm/plpar_wrappers.h>
 
 
 static void tce_invalidate_pSeries_sw(struct iommu_table *tbl,
@@ -530,7 +529,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
 static void iommu_table_setparms_lpar(struct pci_controller *phb,
                                      struct device_node *dn,
                                      struct iommu_table *tbl,
-                                     const void *dma_window)
+                                     const __be32 *dma_window)
 {
        unsigned long offset, size;
 
@@ -630,7 +629,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
        struct iommu_table *tbl;
        struct device_node *dn, *pdn;
        struct pci_dn *ppci;
-       const void *dma_window = NULL;
+       const __be32 *dma_window = NULL;
 
        dn = pci_bus_to_OF_node(bus);
 
@@ -1152,7 +1151,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
 {
        struct device_node *pdn, *dn;
        struct iommu_table *tbl;
-       const void *dma_window = NULL;
+       const __be32 *dma_window = NULL;
        struct pci_dn *pci;
 
        pr_debug("pci_dma_dev_setup_pSeriesLP: %s\n", pci_name(dev));
@@ -1201,7 +1200,7 @@ static int dma_set_mask_pSeriesLP(struct device *dev, u64 dma_mask)
        bool ddw_enabled = false;
        struct device_node *pdn, *dn;
        struct pci_dev *pdev;
-       const void *dma_window = NULL;
+       const __be32 *dma_window = NULL;
        u64 dma_offset;
 
        if (!dev->dma_mask)
index 7d94bdc..13fa95b 100644 (file)
@@ -17,9 +17,9 @@
 #include <asm/mpic.h>
 #include <asm/xics.h>
 #include <asm/smp.h>
+#include <asm/plpar_wrappers.h>
 
 #include "pseries.h"
-#include "plpar_wrappers.h"
 
 static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
 {
index 8bad880..356bc75 100644 (file)
@@ -41,8 +41,8 @@
 #include <asm/smp.h>
 #include <asm/trace.h>
 #include <asm/firmware.h>
+#include <asm/plpar_wrappers.h>
 
-#include "plpar_wrappers.h"
 #include "pseries.h"
 
 /* Flag bits for H_BULK_REMOVE */
@@ -68,6 +68,12 @@ void vpa_init(int cpu)
        struct paca_struct *pp;
        struct dtl_entry *dtl;
 
+       /*
+        * The spec says it "may be problematic" if CPU x registers the VPA of
+        * CPU y. We should never do that, but wail if we ever do.
+        */
+       WARN_ON(cpu != smp_processor_id());
+
        if (cpu_has_feature(CPU_FTR_ALTIVEC))
                lppaca_of(cpu).vmxregs_in_use = 1;
 
@@ -106,7 +112,7 @@ void vpa_init(int cpu)
                lppaca_of(cpu).dtl_idx = 0;
 
                /* hypervisor reads buffer length from this field */
-               dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES;
+               dtl->enqueue_to_dispatch_time = cpu_to_be32(DISPATCH_LOG_BYTES);
                ret = register_dtl(hwcpu, __pa(dtl));
                if (ret)
                        pr_err("WARNING: DTL registration of cpu %d (hw %d) "
@@ -724,7 +730,7 @@ int h_get_mpp(struct hvcall_mpp_data *mpp_data)
 
        mpp_data->mem_weight = (retbuf[3] >> 7 * 8) & 0xff;
        mpp_data->unallocated_mem_weight = (retbuf[3] >> 6 * 8) & 0xff;
-       mpp_data->unallocated_entitlement = retbuf[3] & 0xffffffffffff;
+       mpp_data->unallocated_entitlement = retbuf[3] & 0xffffffffffffUL;
 
        mpp_data->pool_size = retbuf[4];
        mpp_data->loan_request = retbuf[5];
similarity index 98%
rename from arch/powerpc/kernel/lparcfg.c
rename to arch/powerpc/platforms/pseries/lparcfg.c
index e2a0a16..e738007 100644 (file)
@@ -171,7 +171,7 @@ static void parse_ppp_data(struct seq_file *m)
                   ppp_data.active_system_procs);
 
        /* pool related entries are appropriate for shared configs */
-       if (lppaca_of(0).shared_proc) {
+       if (lppaca_shared_proc(get_lppaca())) {
                unsigned long pool_idle_time, pool_procs;
 
                seq_printf(m, "pool=%d\n", ppp_data.pool_num);
@@ -393,8 +393,8 @@ static void pseries_cmo_data(struct seq_file *m)
                return;
 
        for_each_possible_cpu(cpu) {
-               cmo_faults += lppaca_of(cpu).cmo_faults;
-               cmo_fault_time += lppaca_of(cpu).cmo_fault_time;
+               cmo_faults += be64_to_cpu(lppaca_of(cpu).cmo_faults);
+               cmo_fault_time += be64_to_cpu(lppaca_of(cpu).cmo_fault_time);
        }
 
        seq_printf(m, "cmo_faults=%lu\n", cmo_faults);
@@ -412,8 +412,9 @@ static void splpar_dispatch_data(struct seq_file *m)
        unsigned long dispatch_dispersions = 0;
 
        for_each_possible_cpu(cpu) {
-               dispatches += lppaca_of(cpu).yield_count;
-               dispatch_dispersions += lppaca_of(cpu).dispersion_count;
+               dispatches += be32_to_cpu(lppaca_of(cpu).yield_count);
+               dispatch_dispersions +=
+                       be32_to_cpu(lppaca_of(cpu).dispersion_count);
        }
 
        seq_printf(m, "dispatches=%lu\n", dispatches);
@@ -480,7 +481,8 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
        seq_printf(m, "partition_potential_processors=%d\n",
                   partition_potential_processors);
 
-       seq_printf(m, "shared_processor_mode=%d\n", lppaca_of(0).shared_proc);
+       seq_printf(m, "shared_processor_mode=%d\n",
+                  lppaca_shared_proc(get_lppaca()));
 
        seq_printf(m, "slb_size=%d\n", mmu_slb_size);
 
index 3d01eee..cde4e0a 100644 (file)
@@ -28,7 +28,7 @@ struct update_props_workarea {
        u32 state;
        u64 reserved;
        u32 nprops;
-};
+} __packed;
 
 #define NODE_ACTION_MASK       0xff000000
 #define NODE_COUNT_MASK                0x00ffffff
@@ -62,6 +62,7 @@ static int delete_dt_node(u32 phandle)
                return -ENOENT;
 
        dlpar_detach_node(dn);
+       of_node_put(dn);
        return 0;
 }
 
@@ -119,7 +120,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,
 
        if (!more) {
                of_update_property(dn, new_prop);
-               new_prop = NULL;
+               *prop = NULL;
        }
 
        return 0;
@@ -130,7 +131,7 @@ static int update_dt_node(u32 phandle, s32 scope)
        struct update_props_workarea *upwa;
        struct device_node *dn;
        struct property *prop = NULL;
-       int i, rc;
+       int i, rc, rtas_rc;
        char *prop_data;
        char *rtas_buf;
        int update_properties_token;
@@ -154,25 +155,26 @@ static int update_dt_node(u32 phandle, s32 scope)
        upwa->phandle = phandle;
 
        do {
-               rc = mobility_rtas_call(update_properties_token, rtas_buf,
+               rtas_rc = mobility_rtas_call(update_properties_token, rtas_buf,
                                        scope);
-               if (rc < 0)
+               if (rtas_rc < 0)
                        break;
 
                prop_data = rtas_buf + sizeof(*upwa);
 
-               /* The first element of the buffer is the path of the node
-                * being updated in the form of a 8 byte string length
-                * followed by the string. Skip past this to get to the
-                * properties being updated.
+               /* On the first call to ibm,update-properties for a node the
+                * the first property value descriptor contains an empty
+                * property name, the property value length encoded as u32,
+                * and the property value is the node path being updated.
                 */
-               vd = *prop_data++;
-               prop_data += vd;
+               if (*prop_data == 0) {
+                       prop_data++;
+                       vd = *(u32 *)prop_data;
+                       prop_data += vd + sizeof(vd);
+                       upwa->nprops--;
+               }
 
-               /* The path we skipped over is counted as one of the elements
-                * returned so start counting at one.
-                */
-               for (i = 1; i < upwa->nprops; i++) {
+               for (i = 0; i < upwa->nprops; i++) {
                        char *prop_name;
 
                        prop_name = prop_data;
@@ -202,7 +204,7 @@ static int update_dt_node(u32 phandle, s32 scope)
                                prop_data += vd;
                        }
                }
-       } while (rc == 1);
+       } while (rtas_rc == 1);
 
        of_node_put(dn);
        kfree(rtas_buf);
@@ -215,17 +217,14 @@ static int add_dt_node(u32 parent_phandle, u32 drc_index)
        struct device_node *parent_dn;
        int rc;
 
-       dn = dlpar_configure_connector(drc_index);
-       if (!dn)
+       parent_dn = of_find_node_by_phandle(parent_phandle);
+       if (!parent_dn)
                return -ENOENT;
 
-       parent_dn = of_find_node_by_phandle(parent_phandle);
-       if (!parent_dn) {
-               dlpar_free_cc_nodes(dn);
+       dn = dlpar_configure_connector(drc_index, parent_dn);
+       if (!dn)
                return -ENOENT;
-       }
 
-       dn->parent = parent_dn;
        rc = dlpar_attach_node(dn);
        if (rc)
                dlpar_free_cc_nodes(dn);
index 4644efa..a166e38 100644 (file)
@@ -18,9 +18,7 @@
 #include <asm/machdep.h>
 #include <asm/firmware.h>
 #include <asm/runlatch.h>
-
-#include "plpar_wrappers.h"
-#include "pseries.h"
+#include <asm/plpar_wrappers.h>
 
 struct cpuidle_driver pseries_idle_driver = {
        .name             = "pseries_idle",
@@ -45,7 +43,11 @@ static inline void idle_loop_prolog(unsigned long *in_purr)
 
 static inline void idle_loop_epilog(unsigned long in_purr)
 {
-       get_lppaca()->wait_state_cycles += mfspr(SPRN_PURR) - in_purr;
+       u64 wait_cycles;
+
+       wait_cycles = be64_to_cpu(get_lppaca()->wait_state_cycles);
+       wait_cycles += mfspr(SPRN_PURR) - in_purr;
+       get_lppaca()->wait_state_cycles = cpu_to_be64(wait_cycles);
        get_lppaca()->idle = 0;
 }
 
@@ -308,7 +310,7 @@ static int pseries_idle_probe(void)
                return -EPERM;
        }
 
-       if (get_lppaca()->shared_proc)
+       if (lppaca_shared_proc(get_lppaca()))
                cpuidle_state_table = shared_states;
        else
                cpuidle_state_table = dedicated_states;
index c2a3a25..9921953 100644 (file)
@@ -56,13 +56,10 @@ extern void hvc_vio_init_early(void);
 /* Dynamic logical Partitioning/Mobility */
 extern void dlpar_free_cc_nodes(struct device_node *);
 extern void dlpar_free_cc_property(struct property *);
-extern struct device_node *dlpar_configure_connector(u32);
+extern struct device_node *dlpar_configure_connector(u32, struct device_node *);
 extern int dlpar_attach_node(struct device_node *);
 extern int dlpar_detach_node(struct device_node *);
 
-/* Snooze Delay, pseries_idle */
-DECLARE_PER_CPU(long, smt_snooze_delay);
-
 /* PCI root bridge prepare function override for pseries */
 struct pci_host_bridge;
 int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
index a91e6da..9276779 100644 (file)
@@ -108,8 +108,8 @@ err:
  * energy consumption.
  */
 
-#define FLAGS_MODE1    0x004E200000080E01
-#define FLAGS_MODE2    0x004E200000080401
+#define FLAGS_MODE1    0x004E200000080E01UL
+#define FLAGS_MODE2    0x004E200000080401UL
 #define FLAGS_ACTIVATE  0x100
 
 static ssize_t get_best_energy_list(char *page, int activate)
index c11c823..d64feb3 100644 (file)
@@ -66,8 +66,8 @@
 #include <asm/firmware.h>
 #include <asm/eeh.h>
 #include <asm/reg.h>
+#include <asm/plpar_wrappers.h>
 
-#include "plpar_wrappers.h"
 #include "pseries.h"
 
 int CMO_PrPSP = -1;
@@ -183,7 +183,7 @@ static void __init pseries_mpic_init_IRQ(void)
        np = of_find_node_by_path("/");
        naddr = of_n_addr_cells(np);
        opprop = of_get_property(np, "platform-open-pic", &opplen);
-       if (opprop != 0) {
+       if (opprop != NULL) {
                openpic_addr = of_read_number(opprop, naddr);
                printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
        }
@@ -323,7 +323,7 @@ static int alloc_dispatch_logs(void)
        get_paca()->lppaca_ptr->dtl_idx = 0;
 
        /* hypervisor reads buffer length from this field */
-       dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES;
+       dtl->enqueue_to_dispatch_time = cpu_to_be32(DISPATCH_LOG_BYTES);
        ret = register_dtl(hard_smp_processor_id(), __pa(dtl));
        if (ret)
                pr_err("WARNING: DTL registration of cpu %d (hw %d) failed "
index 306643c..1c1771a 100644 (file)
@@ -43,8 +43,8 @@
 #include <asm/cputhreads.h>
 #include <asm/xics.h>
 #include <asm/dbell.h>
+#include <asm/plpar_wrappers.h>
 
-#include "plpar_wrappers.h"
 #include "pseries.h"
 #include "offline_states.h"
 
@@ -187,22 +187,6 @@ static int smp_pSeries_kick_cpu(int nr)
        return 0;
 }
 
-static int smp_pSeries_cpu_bootable(unsigned int nr)
-{
-       /* Special case - we inhibit secondary thread startup
-        * during boot if the user requests it.
-        */
-       if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
-               if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
-                       return 0;
-               if (smt_enabled_at_boot
-                   && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
-                       return 0;
-       }
-
-       return 1;
-}
-
 /* Only used on systems that support multiple IPI mechanisms */
 static void pSeries_cause_ipi_mux(int cpu, unsigned long data)
 {
@@ -237,7 +221,7 @@ static struct smp_ops_t pSeries_xics_smp_ops = {
        .probe          = pSeries_smp_probe,
        .kick_cpu       = smp_pSeries_kick_cpu,
        .setup_cpu      = smp_xics_setup_cpu,
-       .cpu_bootable   = smp_pSeries_cpu_bootable,
+       .cpu_bootable   = smp_generic_cpu_bootable,
 };
 
 /* This is called very early */
index 62ef21a..a563a8a 100644 (file)
@@ -17,7 +17,6 @@ extern void scom_init_wsp(void);
 extern void a2_setup_smp(void);
 extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx,
                               struct device_node *np);
-extern int smp_a2_cpu_bootable(unsigned int nr);
 extern int smp_a2_kick_cpu(int nr);
 
 extern void opb_pic_init(void);
index ab02db3..77efbae 100644 (file)
 #include "fsl_msi.h"
 #include "fsl_pci.h"
 
+#define MSIIR_OFFSET_MASK      0xfffff
+#define MSIIR_IBS_SHIFT                0
+#define MSIIR_SRS_SHIFT                5
+#define MSIIR1_IBS_SHIFT       4
+#define MSIIR1_SRS_SHIFT       0
+#define MSI_SRS_MASK           0xf
+#define MSI_IBS_MASK           0x1f
+
+#define msi_hwirq(msi, msir_index, intr_index) \
+               ((msir_index) << (msi)->srs_shift | \
+                ((intr_index) << (msi)->ibs_shift))
+
 static LIST_HEAD(msi_head);
 
 struct fsl_msi_feature {
@@ -80,18 +92,19 @@ static const struct irq_domain_ops fsl_msi_host_ops = {
 
 static int fsl_msi_init_allocator(struct fsl_msi *msi_data)
 {
-       int rc;
+       int rc, hwirq;
 
-       rc = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS,
+       rc = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS_MAX,
                              msi_data->irqhost->of_node);
        if (rc)
                return rc;
 
-       rc = msi_bitmap_reserve_dt_hwirqs(&msi_data->bitmap);
-       if (rc < 0) {
-               msi_bitmap_free(&msi_data->bitmap);
-               return rc;
-       }
+       /*
+        * Reserve all the hwirqs
+        * The available hwirqs will be released in fsl_msi_setup_hwirq()
+        */
+       for (hwirq = 0; hwirq < NR_MSI_IRQS_MAX; hwirq++)
+               msi_bitmap_reserve_hwirq(&msi_data->bitmap, hwirq);
 
        return 0;
 }
@@ -144,8 +157,9 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
 
        msg->data = hwirq;
 
-       pr_debug("%s: allocated srs: %d, ibs: %d\n",
-               __func__, hwirq / IRQS_PER_MSI_REG, hwirq % IRQS_PER_MSI_REG);
+       pr_debug("%s: allocated srs: %d, ibs: %d\n", __func__,
+                (hwirq >> msi_data->srs_shift) & MSI_SRS_MASK,
+                (hwirq >> msi_data->ibs_shift) & MSI_IBS_MASK);
 }
 
 static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
@@ -255,7 +269,7 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
 
        msir_index = cascade_data->index;
 
-       if (msir_index >= NR_MSI_REG)
+       if (msir_index >= NR_MSI_REG_MAX)
                cascade_irq = NO_IRQ;
 
        irqd_set_chained_irq_inprogress(idata);
@@ -285,8 +299,8 @@ static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
                intr_index = ffs(msir_value) - 1;
 
                cascade_irq = irq_linear_revmap(msi_data->irqhost,
-                               msir_index * IRQS_PER_MSI_REG +
-                                       intr_index + have_shift);
+                               msi_hwirq(msi_data, msir_index,
+                                         intr_index + have_shift));
                if (cascade_irq != NO_IRQ)
                        generic_handle_irq(cascade_irq);
                have_shift += intr_index + 1;
@@ -316,7 +330,7 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
 
        if (msi->list.prev != NULL)
                list_del(&msi->list);
-       for (i = 0; i < NR_MSI_REG; i++) {
+       for (i = 0; i < NR_MSI_REG_MAX; i++) {
                virq = msi->msi_virqs[i];
                if (virq != NO_IRQ) {
                        cascade_data = irq_get_handler_data(virq);
@@ -339,7 +353,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev,
                               int offset, int irq_index)
 {
        struct fsl_msi_cascade_data *cascade_data = NULL;
-       int virt_msir;
+       int virt_msir, i;
 
        virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index);
        if (virt_msir == NO_IRQ) {
@@ -360,6 +374,11 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct platform_device *dev,
        irq_set_handler_data(virt_msir, cascade_data);
        irq_set_chained_handler(virt_msir, fsl_msi_cascade);
 
+       /* Release the hwirqs corresponding to this MSI register */
+       for (i = 0; i < IRQS_PER_MSI_REG; i++)
+               msi_bitmap_free_hwirqs(&msi->bitmap,
+                                      msi_hwirq(msi, offset, i), 1);
+
        return 0;
 }
 
@@ -368,14 +387,12 @@ static int fsl_of_msi_probe(struct platform_device *dev)
 {
        const struct of_device_id *match;
        struct fsl_msi *msi;
-       struct resource res;
+       struct resource res, msiir;
        int err, i, j, irq_index, count;
-       int rc;
        const u32 *p;
        const struct fsl_msi_feature *features;
        int len;
        u32 offset;
-       static const u32 all_avail[] = { 0, NR_MSI_IRQS };
 
        match = of_match_device(fsl_of_msi_ids, &dev->dev);
        if (!match)
@@ -392,7 +409,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
        platform_set_drvdata(dev, msi);
 
        msi->irqhost = irq_domain_add_linear(dev->dev.of_node,
-                                     NR_MSI_IRQS, &fsl_msi_host_ops, msi);
+                                     NR_MSI_IRQS_MAX, &fsl_msi_host_ops, msi);
 
        if (msi->irqhost == NULL) {
                dev_err(&dev->dev, "No memory for MSI irqhost\n");
@@ -421,6 +438,16 @@ static int fsl_of_msi_probe(struct platform_device *dev)
                }
                msi->msiir_offset =
                        features->msiir_offset + (res.start & 0xfffff);
+
+               /*
+                * First read the MSIIR/MSIIR1 offset from dts
+                * On failure use the hardcode MSIIR offset
+                */
+               if (of_address_to_resource(dev->dev.of_node, 1, &msiir))
+                       msi->msiir_offset = features->msiir_offset +
+                                           (res.start & MSIIR_OFFSET_MASK);
+               else
+                       msi->msiir_offset = msiir.start & MSIIR_OFFSET_MASK;
        }
 
        msi->feature = features->fsl_pic_ip;
@@ -431,42 +458,66 @@ static int fsl_of_msi_probe(struct platform_device *dev)
         */
        msi->phandle = dev->dev.of_node->phandle;
 
-       rc = fsl_msi_init_allocator(msi);
-       if (rc) {
+       err = fsl_msi_init_allocator(msi);
+       if (err) {
                dev_err(&dev->dev, "Error allocating MSI bitmap\n");
                goto error_out;
        }
 
        p = of_get_property(dev->dev.of_node, "msi-available-ranges", &len);
-       if (p && len % (2 * sizeof(u32)) != 0) {
-               dev_err(&dev->dev, "%s: Malformed msi-available-ranges property\n",
-                       __func__);
-               err = -EINVAL;
-               goto error_out;
-       }
 
-       if (!p) {
-               p = all_avail;
-               len = sizeof(all_avail);
-       }
+       if (of_device_is_compatible(dev->dev.of_node, "fsl,mpic-msi-v4.3")) {
+               msi->srs_shift = MSIIR1_SRS_SHIFT;
+               msi->ibs_shift = MSIIR1_IBS_SHIFT;
+               if (p)
+                       dev_warn(&dev->dev, "%s: dose not support msi-available-ranges property\n",
+                               __func__);
+
+               for (irq_index = 0; irq_index < NR_MSI_REG_MSIIR1;
+                    irq_index++) {
+                       err = fsl_msi_setup_hwirq(msi, dev,
+                                                 irq_index, irq_index);
+                       if (err)
+                               goto error_out;
+               }
+       } else {
+               static const u32 all_avail[] =
+                       { 0, NR_MSI_REG_MSIIR * IRQS_PER_MSI_REG };
 
-       for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) {
-               if (p[i * 2] % IRQS_PER_MSI_REG ||
-                   p[i * 2 + 1] % IRQS_PER_MSI_REG) {
-                       printk(KERN_WARNING "%s: %s: msi available range of %u at %u is not IRQ-aligned\n",
-                              __func__, dev->dev.of_node->full_name,
-                              p[i * 2 + 1], p[i * 2]);
+               msi->srs_shift = MSIIR_SRS_SHIFT;
+               msi->ibs_shift = MSIIR_IBS_SHIFT;
+
+               if (p && len % (2 * sizeof(u32)) != 0) {
+                       dev_err(&dev->dev, "%s: Malformed msi-available-ranges property\n",
+                               __func__);
                        err = -EINVAL;
                        goto error_out;
                }
 
-               offset = p[i * 2] / IRQS_PER_MSI_REG;
-               count = p[i * 2 + 1] / IRQS_PER_MSI_REG;
+               if (!p) {
+                       p = all_avail;
+                       len = sizeof(all_avail);
+               }
 
-               for (j = 0; j < count; j++, irq_index++) {
-                       err = fsl_msi_setup_hwirq(msi, dev, offset + j, irq_index);
-                       if (err)
+               for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) {
+                       if (p[i * 2] % IRQS_PER_MSI_REG ||
+                           p[i * 2 + 1] % IRQS_PER_MSI_REG) {
+                               pr_warn("%s: %s: msi available range of %u at %u is not IRQ-aligned\n",
+                                      __func__, dev->dev.of_node->full_name,
+                                      p[i * 2 + 1], p[i * 2]);
+                               err = -EINVAL;
                                goto error_out;
+                       }
+
+                       offset = p[i * 2] / IRQS_PER_MSI_REG;
+                       count = p[i * 2 + 1] / IRQS_PER_MSI_REG;
+
+                       for (j = 0; j < count; j++, irq_index++) {
+                               err = fsl_msi_setup_hwirq(msi, dev, offset + j,
+                                                         irq_index);
+                               if (err)
+                                       goto error_out;
+                       }
                }
        }
 
@@ -509,6 +560,10 @@ static const struct of_device_id fsl_of_msi_ids[] = {
                .data = &mpic_msi_feature,
        },
        {
+               .compatible = "fsl,mpic-msi-v4.3",
+               .data = &mpic_msi_feature,
+       },
+       {
                .compatible = "fsl,ipic-msi",
                .data = &ipic_msi_feature,
        },
index 8225f86..df9aa9f 100644 (file)
 #include <linux/of.h>
 #include <asm/msi_bitmap.h>
 
-#define NR_MSI_REG             8
+#define NR_MSI_REG_MSIIR       8  /* MSIIR can index 8 MSI registers */
+#define NR_MSI_REG_MSIIR1      16 /* MSIIR1 can index 16 MSI registers */
+#define NR_MSI_REG_MAX         NR_MSI_REG_MSIIR1
 #define IRQS_PER_MSI_REG       32
-#define NR_MSI_IRQS    (NR_MSI_REG * IRQS_PER_MSI_REG)
+#define NR_MSI_IRQS_MAX        (NR_MSI_REG_MAX * IRQS_PER_MSI_REG)
 
 #define FSL_PIC_IP_MASK   0x0000000F
 #define FSL_PIC_IP_MPIC   0x00000001
@@ -31,9 +33,11 @@ struct fsl_msi {
        unsigned long cascade_irq;
 
        u32 msiir_offset; /* Offset of MSIIR, relative to start of CCSR */
+       u32 ibs_shift; /* Shift of interrupt bit select */
+       u32 srs_shift; /* Shift of the shared interrupt register select */
        void __iomem *msi_regs;
        u32 feature;
-       int msi_virqs[NR_MSI_REG];
+       int msi_virqs[NR_MSI_REG_MAX];
 
        struct msi_bitmap bitmap;
 
index 46ac1dd..ccfb50d 100644 (file)
 #include <linux/memblock.h>
 #include <linux/log2.h>
 #include <linux/slab.h>
+#include <linux/uaccess.h>
 
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
+#include <asm/ppc-pci.h>
 #include <asm/machdep.h>
+#include <asm/disassemble.h>
+#include <asm/ppc-opcode.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
@@ -64,7 +68,7 @@ static int fsl_pcie_check_link(struct pci_controller *hose)
        if (hose->indirect_type & PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK) {
                if (hose->ops->read == fsl_indirect_read_config) {
                        struct pci_bus bus;
-                       bus.number = 0;
+                       bus.number = hose->first_busno;
                        bus.sysdata = hose;
                        bus.ops = hose->ops;
                        indirect_read_config(&bus, 0, PCIE_LTSSM, 4, &val);
@@ -297,10 +301,10 @@ static void setup_pci_atmu(struct pci_controller *hose)
        if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
                /* Size window to exact size if power-of-two or one size up */
                if ((1ull << mem_log) != mem) {
+                       mem_log++;
                        if ((1ull << mem_log) > mem)
                                pr_info("%s: Setting PCI inbound window "
                                        "greater than memory size\n", name);
-                       mem_log++;
                }
 
                piwar |= ((mem_log - 1) & PIWAR_SZ_MASK);
@@ -373,7 +377,9 @@ static void setup_pci_atmu(struct pci_controller *hose)
        }
 
        if (hose->dma_window_size < mem) {
-#ifndef CONFIG_SWIOTLB
+#ifdef CONFIG_SWIOTLB
+               ppc_swiotlb_enable = 1;
+#else
                pr_err("%s: ERROR: Memory size exceeds PCI ATMU ability to "
                        "map - enable CONFIG_SWIOTLB to avoid dma errors.\n",
                         name);
@@ -868,6 +874,160 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose)
        return 0;
 }
 
+#ifdef CONFIG_E500
+static int mcheck_handle_load(struct pt_regs *regs, u32 inst)
+{
+       unsigned int rd, ra, rb, d;
+
+       rd = get_rt(inst);
+       ra = get_ra(inst);
+       rb = get_rb(inst);
+       d = get_d(inst);
+
+       switch (get_op(inst)) {
+       case 31:
+               switch (get_xop(inst)) {
+               case OP_31_XOP_LWZX:
+               case OP_31_XOP_LWBRX:
+                       regs->gpr[rd] = 0xffffffff;
+                       break;
+
+               case OP_31_XOP_LWZUX:
+                       regs->gpr[rd] = 0xffffffff;
+                       regs->gpr[ra] += regs->gpr[rb];
+                       break;
+
+               case OP_31_XOP_LBZX:
+                       regs->gpr[rd] = 0xff;
+                       break;
+
+               case OP_31_XOP_LBZUX:
+                       regs->gpr[rd] = 0xff;
+                       regs->gpr[ra] += regs->gpr[rb];
+                       break;
+
+               case OP_31_XOP_LHZX:
+               case OP_31_XOP_LHBRX:
+                       regs->gpr[rd] = 0xffff;
+                       break;
+
+               case OP_31_XOP_LHZUX:
+                       regs->gpr[rd] = 0xffff;
+                       regs->gpr[ra] += regs->gpr[rb];
+                       break;
+
+               case OP_31_XOP_LHAX:
+                       regs->gpr[rd] = ~0UL;
+                       break;
+
+               case OP_31_XOP_LHAUX:
+                       regs->gpr[rd] = ~0UL;
+                       regs->gpr[ra] += regs->gpr[rb];
+                       break;
+
+               default:
+                       return 0;
+               }
+               break;
+
+       case OP_LWZ:
+               regs->gpr[rd] = 0xffffffff;
+               break;
+
+       case OP_LWZU:
+               regs->gpr[rd] = 0xffffffff;
+               regs->gpr[ra] += (s16)d;
+               break;
+
+       case OP_LBZ:
+               regs->gpr[rd] = 0xff;
+               break;
+
+       case OP_LBZU:
+               regs->gpr[rd] = 0xff;
+               regs->gpr[ra] += (s16)d;
+               break;
+
+       case OP_LHZ:
+               regs->gpr[rd] = 0xffff;
+               break;
+
+       case OP_LHZU:
+               regs->gpr[rd] = 0xffff;
+               regs->gpr[ra] += (s16)d;
+               break;
+
+       case OP_LHA:
+               regs->gpr[rd] = ~0UL;
+               break;
+
+       case OP_LHAU:
+               regs->gpr[rd] = ~0UL;
+               regs->gpr[ra] += (s16)d;
+               break;
+
+       default:
+               return 0;
+       }
+
+       return 1;
+}
+
+static int is_in_pci_mem_space(phys_addr_t addr)
+{
+       struct pci_controller *hose;
+       struct resource *res;
+       int i;
+
+       list_for_each_entry(hose, &hose_list, list_node) {
+               if (!(hose->indirect_type & PPC_INDIRECT_TYPE_EXT_REG))
+                       continue;
+
+               for (i = 0; i < 3; i++) {
+                       res = &hose->mem_resources[i];
+                       if ((res->flags & IORESOURCE_MEM) &&
+                               addr >= res->start && addr <= res->end)
+                               return 1;
+               }
+       }
+       return 0;
+}
+
+int fsl_pci_mcheck_exception(struct pt_regs *regs)
+{
+       u32 inst;
+       int ret;
+       phys_addr_t addr = 0;
+
+       /* Let KVM/QEMU deal with the exception */
+       if (regs->msr & MSR_GS)
+               return 0;
+
+#ifdef CONFIG_PHYS_64BIT
+       addr = mfspr(SPRN_MCARU);
+       addr <<= 32;
+#endif
+       addr += mfspr(SPRN_MCAR);
+
+       if (is_in_pci_mem_space(addr)) {
+               if (user_mode(regs)) {
+                       pagefault_disable();
+                       ret = get_user(regs->nip, &inst);
+                       pagefault_enable();
+               } else {
+                       ret = probe_kernel_address(regs->nip, inst);
+               }
+
+               if (mcheck_handle_load(regs, inst)) {
+                       regs->nip += 4;
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+#endif
+
 #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
 static const struct of_device_id pci_ids[] = {
        { .compatible = "fsl,mpc8540-pci", },
@@ -928,28 +1088,10 @@ static int fsl_pci_probe(struct platform_device *pdev)
 {
        int ret;
        struct device_node *node;
-#ifdef CONFIG_SWIOTLB
-       struct pci_controller *hose;
-#endif
 
        node = pdev->dev.of_node;
        ret = fsl_add_bridge(pdev, fsl_pci_primary == node);
 
-#ifdef CONFIG_SWIOTLB
-       if (ret == 0) {
-               hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
-
-               /*
-                * if we couldn't map all of DRAM via the dma windows
-                * we need SWIOTLB to handle buffers located outside of
-                * dma capable memory region
-                */
-               if (memblock_end_of_DRAM() - 1 > hose->dma_window_base_cur +
-                               hose->dma_window_size)
-                       ppc_swiotlb_enable = 1;
-       }
-#endif
-
        mpc85xx_pci_err_probe(pdev);
 
        return 0;
index 72b5625..defc422 100644 (file)
@@ -126,5 +126,11 @@ static inline int mpc85xx_pci_err_probe(struct platform_device *op)
 }
 #endif
 
+#ifdef CONFIG_FSL_PCI
+extern int fsl_pci_mcheck_exception(struct pt_regs *);
+#else
+static inline int fsl_pci_mcheck_exception(struct pt_regs *regs) {return 0; }
+#endif
+
 #endif /* __POWERPC_FSL_PCI_H */
 #endif /* __KERNEL__ */
index 7cd728b..9dee470 100644 (file)
@@ -216,7 +216,7 @@ static int __init icp_native_init_one_node(struct device_node *np,
                                           unsigned int *indx)
 {
        unsigned int ilen;
-       const u32 *ireg;
+       const __be32 *ireg;
        int i;
        int reg_tuple_size;
        int num_servers = 0;
index 9049d9f..fe0cca4 100644 (file)
@@ -49,7 +49,7 @@ void xics_update_irq_servers(void)
        int i, j;
        struct device_node *np;
        u32 ilen;
-       const u32 *ireg;
+       const __be32 *ireg;
        u32 hcpuid;
 
        /* Find the server numbers for the boot cpu. */
@@ -75,8 +75,8 @@ void xics_update_irq_servers(void)
         * default distribution server
         */
        for (j = 0; j < i; j += 2) {
-               if (ireg[j] == hcpuid) {
-                       xics_default_distrib_server = ireg[j+1];
+               if (be32_to_cpu(ireg[j]) == hcpuid) {
+                       xics_default_distrib_server = be32_to_cpu(ireg[j+1]);
                        break;
                }
        }
@@ -383,7 +383,7 @@ void __init xics_register_ics(struct ics *ics)
 static void __init xics_get_server_size(void)
 {
        struct device_node *np;
-       const u32 *isize;
+       const __be32 *isize;
 
        /* We fetch the interrupt server size from the first ICS node
         * we find if any
@@ -394,7 +394,7 @@ static void __init xics_get_server_size(void)
        isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
        if (!isize)
                return;
-       xics_interrupt_server_size = *isize;
+       xics_interrupt_server_size = be32_to_cpu(*isize);
        of_node_put(np);
 }
 
index 96bf5bd..af9d346 100644 (file)
@@ -972,27 +972,27 @@ static void bootcmds(void)
 static int cpu_cmd(void)
 {
 #ifdef CONFIG_SMP
-       unsigned long cpu;
+       unsigned long cpu, first_cpu, last_cpu;
        int timeout;
-       int count;
 
        if (!scanhex(&cpu)) {
                /* print cpus waiting or in xmon */
                printf("cpus stopped:");
-               count = 0;
+               last_cpu = first_cpu = NR_CPUS;
                for_each_possible_cpu(cpu) {
                        if (cpumask_test_cpu(cpu, &cpus_in_xmon)) {
-                               if (count == 0)
-                                       printf(" %x", cpu);
-                               ++count;
-                       } else {
-                               if (count > 1)
-                                       printf("-%x", cpu - 1);
-                               count = 0;
+                               if (cpu == last_cpu + 1) {
+                                       last_cpu = cpu;
+                               } else {
+                                       if (last_cpu != first_cpu)
+                                               printf("-%lx", last_cpu);
+                                       last_cpu = first_cpu = cpu;
+                                       printf(" %lx", cpu);
+                               }
                        }
                }
-               if (count > 1)
-                       printf("-%x", NR_CPUS - 1);
+               if (last_cpu != first_cpu)
+                       printf("-%lx", last_cpu);
                printf("\n");
                return 0;
        }
@@ -1256,11 +1256,18 @@ const char *getvecname(unsigned long vec)
        case 0x700:     ret = "(Program Check)"; break;
        case 0x800:     ret = "(FPU Unavailable)"; break;
        case 0x900:     ret = "(Decrementer)"; break;
+       case 0x980:     ret = "(Hypervisor Decrementer)"; break;
+       case 0xa00:     ret = "(Doorbell)"; break;
        case 0xc00:     ret = "(System Call)"; break;
        case 0xd00:     ret = "(Single Step)"; break;
+       case 0xe40:     ret = "(Emulation Assist)"; break;
+       case 0xe60:     ret = "(HMI)"; break;
+       case 0xe80:     ret = "(Hypervisor Doorbell)"; break;
        case 0xf00:     ret = "(Performance Monitor)"; break;
        case 0xf20:     ret = "(Altivec Unavailable)"; break;
        case 0x1300:    ret = "(Instruction Breakpoint)"; break;
+       case 0x1500:    ret = "(Denormalisation)"; break;
+       case 0x1700:    ret = "(Altivec Assist)"; break;
        default: ret = "";
        }
        return ret;
index 8b7892b..c696ad7 100644 (file)
@@ -431,7 +431,6 @@ menuconfig PCI
        bool "PCI support"
        default n
        depends on 64BIT
-       select ARCH_SUPPORTS_MSI
        select PCI_MSI
        help
          Enable PCI support.
index c290f13..1cc185d 100644 (file)
@@ -22,10 +22,6 @@ void pci_iounmap(struct pci_dev *, void __iomem *);
 int pci_domain_nr(struct pci_bus *);
 int pci_proc_domain(struct pci_bus *);
 
-/* MSI arch hooks */
-#define arch_setup_msi_irqs    arch_setup_msi_irqs
-#define arch_teardown_msi_irqs arch_teardown_msi_irqs
-
 #define ZPCI_BUS_NR                    0       /* default bus number */
 #define ZPCI_DEVFN                     0       /* default device number */
 
index a4f630f..65dd81b 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/spi/mmc_spi.h>
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
+#include <linux/platform_data/gpio_backlight.h>
 #include <linux/sh_eth.h>
 #include <linux/sh_intc.h>
 #include <linux/videodev2.h>
@@ -302,7 +303,7 @@ static struct platform_device usbhs_device = {
        .resource       = usbhs_resources,
 };
 
-/* LCDC */
+/* LCDC and backlight */
 static const struct fb_videomode ecovec_lcd_modes[] = {
        {
                .name           = "Panel",
@@ -333,13 +334,6 @@ static const struct fb_videomode ecovec_dvi_modes[] = {
        },
 };
 
-static int ecovec24_set_brightness(int brightness)
-{
-       gpio_set_value(GPIO_PTR1, brightness);
-
-       return 0;
-}
-
 static struct sh_mobile_lcdc_info lcdc_info = {
        .ch[0] = {
                .interface_type = RGB18,
@@ -349,11 +343,6 @@ static struct sh_mobile_lcdc_info lcdc_info = {
                        .width = 152,
                        .height = 91,
                },
-               .bl_info = {
-                       .name = "sh_mobile_lcdc_bl",
-                       .max_brightness = 1,
-                       .set_brightness = ecovec24_set_brightness,
-               },
        }
 };
 
@@ -379,6 +368,20 @@ static struct platform_device lcdc_device = {
        },
 };
 
+static struct gpio_backlight_platform_data gpio_backlight_data = {
+       .fbdev = &lcdc_device.dev,
+       .gpio = GPIO_PTR1,
+       .def_value = 1,
+       .name = "backlight",
+};
+
+static struct platform_device gpio_backlight_device = {
+       .name = "gpio-backlight",
+       .dev = {
+               .platform_data = &gpio_backlight_data,
+       },
+};
+
 /* CEU0 */
 static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
        .flags = SH_CEU_FLAG_USE_8BIT_BUS,
@@ -1048,6 +1051,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
        &usb1_common_device,
        &usbhs_device,
        &lcdc_device,
+       &gpio_backlight_device,
        &ceu0_device,
        &ceu1_device,
        &keysc_device,
@@ -1238,11 +1242,9 @@ static int __init arch_setup(void)
 
        gpio_request(GPIO_PTE6, NULL);
        gpio_request(GPIO_PTU1, NULL);
-       gpio_request(GPIO_PTR1, NULL);
        gpio_request(GPIO_PTA2, NULL);
        gpio_direction_input(GPIO_PTE6);
        gpio_direction_output(GPIO_PTU1, 0);
-       gpio_direction_output(GPIO_PTR1, 0);
        gpio_direction_output(GPIO_PTA2, 0);
 
        /* I/O buffer drive ability is high */
@@ -1255,6 +1257,9 @@ static int __init arch_setup(void)
                lcdc_info.ch[0].lcd_modes               = ecovec_dvi_modes;
                lcdc_info.ch[0].num_modes               = ARRAY_SIZE(ecovec_dvi_modes);
 
+               /* No backlight */
+               gpio_backlight_data.fbdev = NULL;
+
                gpio_set_value(GPIO_PTA2, 1);
                gpio_set_value(GPIO_PTU1, 1);
        } else {
@@ -1264,8 +1269,6 @@ static int __init arch_setup(void)
                lcdc_info.ch[0].lcd_modes               = ecovec_lcd_modes;
                lcdc_info.ch[0].num_modes               = ARRAY_SIZE(ecovec_lcd_modes);
 
-               gpio_set_value(GPIO_PTR1, 1);
-
                /* FIXME
                 *
                 * LCDDON control is needed for Panel,
index c620503..355a78a 100644 (file)
@@ -276,51 +276,3 @@ void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
 {
        write_memory_start(sohandle, so);
 }
-
-#define CTRL_CKSW       0x10
-#define CTRL_C10        0x20
-#define CTRL_CPSW       0x80
-#define MAIN_MLED4      0x40
-#define MAIN_MSW        0x80
-
-int kfr2r09_lcd_set_brightness(int brightness)
-{
-       struct i2c_adapter *a;
-       struct i2c_msg msg;
-       unsigned char buf[2];
-       int ret;
-
-       a = i2c_get_adapter(0);
-       if (!a)
-               return -ENODEV;
-
-       buf[0] = 0x00;
-       if (brightness)
-               buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW;
-       else
-               buf[1] = 0;
-
-       msg.addr = 0x75;
-       msg.buf = buf;
-       msg.len = 2;
-       msg.flags = 0;
-       ret = i2c_transfer(a, &msg, 1);
-       if (ret != 1)
-               return -ENODEV;
-
-       buf[0] = 0x01;
-       if (brightness)
-               buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c;
-       else
-               buf[1] = 0;
-
-       msg.addr = 0x75;
-       msg.buf = buf;
-       msg.len = 2;
-       msg.flags = 0;
-       ret = i2c_transfer(a, &msg, 1);
-       if (ret != 1)
-               return -ENODEV;
-
-       return 0;
-}
index ab502f1..1df4398 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
 #include <linux/i2c.h>
+#include <linux/platform_data/lv5207lp.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
 #include <linux/usb/r8a66597.h>
@@ -159,11 +160,6 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
                        .setup_sys = kfr2r09_lcd_setup,
                        .start_transfer = kfr2r09_lcd_start,
                },
-               .bl_info = {
-                       .name = "sh_mobile_lcdc_bl",
-                       .max_brightness = 1,
-                       .set_brightness = kfr2r09_lcd_set_brightness,
-               },
                .sys_bus_cfg = {
                        .ldmt2r = 0x07010904,
                        .ldmt3r = 0x14012914,
@@ -195,6 +191,17 @@ static struct platform_device kfr2r09_sh_lcdc_device = {
        },
 };
 
+static struct lv5207lp_platform_data kfr2r09_backlight_data = {
+       .fbdev = &kfr2r09_sh_lcdc_device.dev,
+       .def_value = 13,
+       .max_value = 13,
+};
+
+static struct i2c_board_info kfr2r09_backlight_board_info = {
+       I2C_BOARD_INFO("lv5207lp", 0x75),
+       .platform_data = &kfr2r09_backlight_data,
+};
+
 static struct r8a66597_platdata kfr2r09_usb0_gadget_data = {
        .on_chip = 1,
 };
@@ -627,6 +634,8 @@ static int __init kfr2r09_devices_setup(void)
        gpio_request(GPIO_FN_SDHI0CMD, NULL);
        gpio_request(GPIO_FN_SDHI0CLK, NULL);
 
+       i2c_register_board_info(0, &kfr2r09_backlight_board_info, 1);
+
        return platform_add_devices(kfr2r09_devices,
                                    ARRAY_SIZE(kfr2r09_devices));
 }
index c20c9e5..79f154e 100644 (file)
@@ -4,13 +4,11 @@
 #include <video/sh_mobile_lcdc.h>
 
 #if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE)
-int kfr2r09_lcd_set_brightness(int brightness);
 int kfr2r09_lcd_setup(void *sys_ops_handle,
                      struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
 void kfr2r09_lcd_start(void *sys_ops_handle,
                       struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
 #else
-static int kfr2r09_lcd_set_brightness(int brightness) {}
 static int kfr2r09_lcd_setup(void *sys_ops_handle,
                                struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
 {
index a00cbd3..1570ad2 100644 (file)
@@ -52,7 +52,6 @@ config SPARC32
 
 config SPARC64
        def_bool 64BIT
-       select ARCH_SUPPORTS_MSI
        select HAVE_FUNCTION_TRACER
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_GRAPH_FP_TEST
index 24565a7..932fa14 100644 (file)
@@ -26,6 +26,7 @@ config TILE
        select HAVE_SYSCALL_TRACEPOINTS
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select HAVE_DEBUG_STACKOVERFLOW
+       select ARCH_WANT_FRAME_POINTERS
 
 # FIXME: investigate whether we need/want these options.
 #      select HAVE_IOREMAP_PROT
@@ -64,6 +65,9 @@ config HUGETLB_SUPER_PAGES
        depends on HUGETLB_PAGE && TILEGX
        def_bool y
 
+config GENERIC_TIME_VSYSCALL
+       def_bool y
+
 # FIXME: tilegx can implement a more efficient rwsem.
 config RWSEM_GENERIC_SPINLOCK
        def_bool y
@@ -112,10 +116,19 @@ config SMP
 config HVC_TILE
        depends on TTY
        select HVC_DRIVER
+       select HVC_IRQ if TILEGX
        def_bool y
 
 config TILEGX
-       bool "Building with TILE-Gx (64-bit) compiler and toolchain"
+       bool "Building for TILE-Gx (64-bit) processor"
+       select HAVE_FUNCTION_TRACER
+       select HAVE_FUNCTION_TRACE_MCOUNT_TEST
+       select HAVE_FUNCTION_GRAPH_TRACER
+       select HAVE_DYNAMIC_FTRACE
+       select HAVE_FTRACE_MCOUNT_RECORD
+       select HAVE_KPROBES
+       select HAVE_KRETPROBES
+       select HAVE_ARCH_KGDB
 
 config TILEPRO
        def_bool !TILEGX
@@ -194,7 +207,7 @@ config SYSVIPC_COMPAT
        def_bool y
        depends on COMPAT && SYSVIPC
 
-# We do not currently support disabling HIGHMEM on tile64 and tilepro.
+# We do not currently support disabling HIGHMEM on tilepro.
 config HIGHMEM
        bool # "Support for more than 512 MB of RAM"
        default !TILEGX
@@ -300,6 +313,8 @@ config PAGE_OFFSET
 
 source "mm/Kconfig"
 
+source "kernel/Kconfig.preempt"
+
 config CMDLINE_BOOL
        bool "Built-in kernel command line"
        default n
@@ -380,7 +395,6 @@ config PCI
        select PCI_DOMAINS
        select GENERIC_PCI_IOMAP
        select TILE_GXIO_TRIO if TILEGX
-       select ARCH_SUPPORTS_MSI if TILEGX
        select PCI_MSI if TILEGX
        ---help---
          Enable PCI root complex support, so PCIe endpoint devices can
@@ -396,8 +410,20 @@ config NO_IOMEM
 config NO_IOPORT
        def_bool !PCI
 
+config TILE_PCI_IO
+       bool "PCI I/O space support"
+       default n
+       depends on PCI
+       depends on TILEGX
+       ---help---
+         Enable PCI I/O space support on TILEGx. Since the PCI I/O space
+         is used by few modern PCIe endpoint devices, its support is disabled
+         by default to save the TRIO PIO Region resource for other purposes.
+
 source "drivers/pci/Kconfig"
 
+source "drivers/pci/pcie/Kconfig"
+
 config TILE_USB
        tristate "Tilera USB host adapter support"
        default y
index 9165ea9..19734d3 100644 (file)
@@ -14,14 +14,12 @@ config EARLY_PRINTK
          with klogd/syslogd. You should normally N here,
          unless you want to debug such a crash.
 
-config DEBUG_EXTRA_FLAGS
-       string "Additional compiler arguments when building with '-g'"
-       depends on DEBUG_INFO
-       default ""
+config TILE_HVGLUE_TRACE
+       bool "Provide wrapper functions for hypervisor ABI calls"
+       default n
        help
-         Debug info can be large, and flags like
-         `-femit-struct-debug-baseonly' can reduce the kernel file
-         size and build time noticeably.  Such flags are often
-         helpful if the main use of debug info is line number info.
+         Provide wrapper functions for the hypervisor ABI calls
+         defined in arch/tile/kernel/hvglue.S.  This allows tracing
+         mechanisms, etc., to have visibility into those calls.
 
 endmenu
index 3d15364..4dc380a 100644 (file)
@@ -30,10 +30,6 @@ endif
 # In kernel modules, this causes load failures due to unsupported relocations.
 KBUILD_CFLAGS   += -fno-asynchronous-unwind-tables
 
-ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"")
-KBUILD_CFLAGS   += $(CONFIG_DEBUG_EXTRA_FLAGS)
-endif
-
 LIBGCC_PATH     := \
   $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
 
index 4768481..730e40d 100644 (file)
@@ -1,16 +1,15 @@
 CONFIG_TILEGX=y
-CONFIG_EXPERIMENTAL=y
-# CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_FHANDLE=y
+CONFIG_AUDIT=y
+CONFIG_NO_HZ=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
-CONFIG_FHANDLE=y
 CONFIG_TASKSTATS=y
 CONFIG_TASK_DELAY_ACCT=y
 CONFIG_TASK_XACCT=y
 CONFIG_TASK_IO_ACCOUNTING=y
-CONFIG_AUDIT=y
 CONFIG_LOG_BUF_SHIFT=19
 CONFIG_CGROUPS=y
 CONFIG_CGROUP_DEBUG=y
@@ -18,18 +17,18 @@ CONFIG_CGROUP_DEVICE=y
 CONFIG_CPUSETS=y
 CONFIG_CGROUP_CPUACCT=y
 CONFIG_RESOURCE_COUNTERS=y
-CONFIG_CGROUP_MEMCG=y
-CONFIG_CGROUP_MEMCG_SWAP=y
 CONFIG_CGROUP_SCHED=y
 CONFIG_RT_GROUP_SCHED=y
 CONFIG_BLK_CGROUP=y
 CONFIG_NAMESPACES=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_XZ=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_EMBEDDED=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
+CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
 CONFIG_MODULE_UNLOAD=y
@@ -45,12 +44,12 @@ CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_SGI_PARTITION=y
 CONFIG_SUN_PARTITION=y
 CONFIG_KARMA_PARTITION=y
-CONFIG_EFI_PARTITION=y
 CONFIG_CFQ_GROUP_IOSCHED=y
 CONFIG_NR_CPUS=100
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
 CONFIG_HZ_100=y
+# CONFIG_COMPACTION is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_TILE_PCI_IO=y
 CONFIG_PCI_DEBUG=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=y
@@ -108,150 +107,9 @@ CONFIG_IPV6_MULTIPLE_TABLES=y
 CONFIG_IPV6_MROUTE=y
 CONFIG_IPV6_PIMSM_V2=y
 CONFIG_NETLABEL=y
-CONFIG_NETFILTER=y
-CONFIG_NF_CONNTRACK=m
-CONFIG_NF_CONNTRACK_SECMARK=y
-CONFIG_NF_CONNTRACK_ZONES=y
-CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
-CONFIG_NF_CONNTRACK_AMANDA=m
-CONFIG_NF_CONNTRACK_FTP=m
-CONFIG_NF_CONNTRACK_H323=m
-CONFIG_NF_CONNTRACK_IRC=m
-CONFIG_NF_CONNTRACK_NETBIOS_NS=m
-CONFIG_NF_CONNTRACK_PPTP=m
-CONFIG_NF_CONNTRACK_SANE=m
-CONFIG_NF_CONNTRACK_SIP=m
-CONFIG_NF_CONNTRACK_TFTP=m
-CONFIG_NETFILTER_TPROXY=m
-CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
-CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
-CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
-CONFIG_NETFILTER_XT_TARGET_CT=m
-CONFIG_NETFILTER_XT_TARGET_DSCP=m
-CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
-CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFLOG=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
-CONFIG_NETFILTER_XT_TARGET_TEE=m
-CONFIG_NETFILTER_XT_TARGET_TPROXY=m
-CONFIG_NETFILTER_XT_TARGET_TRACE=m
-CONFIG_NETFILTER_XT_TARGET_SECMARK=m
-CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
-CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
-CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
-CONFIG_NETFILTER_XT_MATCH_COMMENT=m
-CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
-CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
-CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
-CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
-CONFIG_NETFILTER_XT_MATCH_DCCP=m
-CONFIG_NETFILTER_XT_MATCH_DSCP=m
-CONFIG_NETFILTER_XT_MATCH_ESP=m
-CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
-CONFIG_NETFILTER_XT_MATCH_HELPER=m
-CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
-CONFIG_NETFILTER_XT_MATCH_IPVS=m
-CONFIG_NETFILTER_XT_MATCH_LENGTH=m
-CONFIG_NETFILTER_XT_MATCH_LIMIT=m
-CONFIG_NETFILTER_XT_MATCH_MAC=m
-CONFIG_NETFILTER_XT_MATCH_MARK=m
-CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
-CONFIG_NETFILTER_XT_MATCH_OSF=m
-CONFIG_NETFILTER_XT_MATCH_OWNER=m
-CONFIG_NETFILTER_XT_MATCH_POLICY=m
-CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
-CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
-CONFIG_NETFILTER_XT_MATCH_QUOTA=m
-CONFIG_NETFILTER_XT_MATCH_RATEEST=m
-CONFIG_NETFILTER_XT_MATCH_REALM=m
-CONFIG_NETFILTER_XT_MATCH_RECENT=m
-CONFIG_NETFILTER_XT_MATCH_SOCKET=m
-CONFIG_NETFILTER_XT_MATCH_STATE=m
-CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
-CONFIG_NETFILTER_XT_MATCH_STRING=m
-CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
-CONFIG_NETFILTER_XT_MATCH_TIME=m
-CONFIG_NETFILTER_XT_MATCH_U32=m
-CONFIG_IP_VS=m
-CONFIG_IP_VS_IPV6=y
-CONFIG_IP_VS_PROTO_TCP=y
-CONFIG_IP_VS_PROTO_UDP=y
-CONFIG_IP_VS_PROTO_ESP=y
-CONFIG_IP_VS_PROTO_AH=y
-CONFIG_IP_VS_PROTO_SCTP=y
-CONFIG_IP_VS_RR=m
-CONFIG_IP_VS_WRR=m
-CONFIG_IP_VS_LC=m
-CONFIG_IP_VS_WLC=m
-CONFIG_IP_VS_LBLC=m
-CONFIG_IP_VS_LBLCR=m
-CONFIG_IP_VS_SED=m
-CONFIG_IP_VS_NQ=m
-CONFIG_NF_CONNTRACK_IPV4=m
-# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
-CONFIG_IP_NF_QUEUE=m
-CONFIG_IP_NF_IPTABLES=y
-CONFIG_IP_NF_MATCH_AH=m
-CONFIG_IP_NF_MATCH_ECN=m
-CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_FILTER=y
-CONFIG_IP_NF_TARGET_REJECT=y
-CONFIG_IP_NF_TARGET_LOG=m
-CONFIG_IP_NF_TARGET_ULOG=m
-CONFIG_IP_NF_MANGLE=m
-CONFIG_IP_NF_TARGET_ECN=m
-CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_SECURITY=m
-CONFIG_IP_NF_ARPTABLES=m
-CONFIG_IP_NF_ARPFILTER=m
-CONFIG_IP_NF_ARP_MANGLE=m
-CONFIG_NF_CONNTRACK_IPV6=m
-CONFIG_IP6_NF_QUEUE=m
-CONFIG_IP6_NF_IPTABLES=m
-CONFIG_IP6_NF_MATCH_AH=m
-CONFIG_IP6_NF_MATCH_EUI64=m
-CONFIG_IP6_NF_MATCH_FRAG=m
-CONFIG_IP6_NF_MATCH_OPTS=m
-CONFIG_IP6_NF_MATCH_HL=m
-CONFIG_IP6_NF_MATCH_IPV6HEADER=m
-CONFIG_IP6_NF_MATCH_MH=m
-CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_TARGET_HL=m
-CONFIG_IP6_NF_TARGET_LOG=m
-CONFIG_IP6_NF_FILTER=m
-CONFIG_IP6_NF_TARGET_REJECT=m
-CONFIG_IP6_NF_MANGLE=m
-CONFIG_IP6_NF_RAW=m
-CONFIG_IP6_NF_SECURITY=m
-CONFIG_BRIDGE_NF_EBTABLES=m
-CONFIG_BRIDGE_EBT_BROUTE=m
-CONFIG_BRIDGE_EBT_T_FILTER=m
-CONFIG_BRIDGE_EBT_T_NAT=m
-CONFIG_BRIDGE_EBT_802_3=m
-CONFIG_BRIDGE_EBT_AMONG=m
-CONFIG_BRIDGE_EBT_ARP=m
-CONFIG_BRIDGE_EBT_IP=m
-CONFIG_BRIDGE_EBT_IP6=m
-CONFIG_BRIDGE_EBT_LIMIT=m
-CONFIG_BRIDGE_EBT_MARK=m
-CONFIG_BRIDGE_EBT_PKTTYPE=m
-CONFIG_BRIDGE_EBT_STP=m
-CONFIG_BRIDGE_EBT_VLAN=m
-CONFIG_BRIDGE_EBT_ARPREPLY=m
-CONFIG_BRIDGE_EBT_DNAT=m
-CONFIG_BRIDGE_EBT_MARK_T=m
-CONFIG_BRIDGE_EBT_REDIRECT=m
-CONFIG_BRIDGE_EBT_SNAT=m
-CONFIG_BRIDGE_EBT_LOG=m
-CONFIG_BRIDGE_EBT_ULOG=m
-CONFIG_BRIDGE_EBT_NFLOG=m
 CONFIG_RDS=m
 CONFIG_RDS_TCP=m
 CONFIG_BRIDGE=m
-CONFIG_NET_DSA=y
 CONFIG_VLAN_8021Q=m
 CONFIG_VLAN_8021Q_GVRP=y
 CONFIG_PHONET=m
@@ -292,13 +150,13 @@ CONFIG_NET_ACT_POLICE=m
 CONFIG_NET_ACT_GACT=m
 CONFIG_GACT_PROB=y
 CONFIG_NET_ACT_MIRRED=m
-CONFIG_NET_ACT_IPT=m
 CONFIG_NET_ACT_NAT=m
 CONFIG_NET_ACT_PEDIT=m
 CONFIG_NET_ACT_SIMP=m
 CONFIG_NET_ACT_SKBEDIT=m
 CONFIG_NET_CLS_IND=y
 CONFIG_DCB=y
+CONFIG_DNS_RESOLVER=y
 # CONFIG_WIRELESS is not set
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
@@ -317,10 +175,12 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_SAS_ATA=y
+CONFIG_ISCSI_TCP=m
 CONFIG_SCSI_MVSAS=y
 # CONFIG_SCSI_MVSAS_DEBUG is not set
 CONFIG_SCSI_MVSAS_TASKLET=y
 CONFIG_ATA=y
+CONFIG_SATA_AHCI=y
 CONFIG_SATA_SIL24=y
 # CONFIG_ATA_SFF is not set
 CONFIG_MD=y
@@ -343,6 +203,12 @@ CONFIG_DM_MULTIPATH_QL=m
 CONFIG_DM_MULTIPATH_ST=m
 CONFIG_DM_DELAY=m
 CONFIG_DM_UEVENT=y
+CONFIG_TARGET_CORE=m
+CONFIG_TCM_IBLOCK=m
+CONFIG_TCM_FILEIO=m
+CONFIG_TCM_PSCSI=m
+CONFIG_LOOPBACK_TARGET=m
+CONFIG_ISCSI_TARGET=m
 CONFIG_FUSION=y
 CONFIG_FUSION_SAS=y
 CONFIG_NETDEVICES=y
@@ -359,42 +225,8 @@ CONFIG_VETH=m
 CONFIG_NET_DSA_MV88E6060=y
 CONFIG_NET_DSA_MV88E6131=y
 CONFIG_NET_DSA_MV88E6123_61_65=y
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NET_VENDOR_ADAPTEC is not set
-# CONFIG_NET_VENDOR_ALTEON is not set
-# CONFIG_NET_VENDOR_AMD is not set
-# CONFIG_NET_VENDOR_ATHEROS is not set
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_BROCADE is not set
-# CONFIG_NET_VENDOR_CHELSIO is not set
-# CONFIG_NET_VENDOR_CISCO is not set
-# CONFIG_NET_VENDOR_DEC is not set
-# CONFIG_NET_VENDOR_DLINK is not set
-# CONFIG_NET_VENDOR_EMULEX is not set
-# CONFIG_NET_VENDOR_EXAR is not set
-# CONFIG_NET_VENDOR_HP is not set
-# CONFIG_NET_VENDOR_INTEL is not set
-# CONFIG_NET_VENDOR_MARVELL is not set
-# CONFIG_NET_VENDOR_MELLANOX is not set
-# CONFIG_NET_VENDOR_MICREL is not set
-# CONFIG_NET_VENDOR_MYRI is not set
-# CONFIG_NET_VENDOR_NATSEMI is not set
-# CONFIG_NET_VENDOR_NVIDIA is not set
-# CONFIG_NET_VENDOR_OKI is not set
-# CONFIG_NET_PACKET_ENGINE is not set
-# CONFIG_NET_VENDOR_QLOGIC is not set
-# CONFIG_NET_VENDOR_REALTEK is not set
-# CONFIG_NET_VENDOR_RDC is not set
-# CONFIG_NET_VENDOR_SEEQ is not set
-# CONFIG_NET_VENDOR_SILAN is not set
-# CONFIG_NET_VENDOR_SIS is not set
-# CONFIG_NET_VENDOR_SMSC is not set
-# CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_NET_VENDOR_SUN is not set
-# CONFIG_NET_VENDOR_TEHUTI is not set
-# CONFIG_NET_VENDOR_TI is not set
-# CONFIG_TILE_NET is not set
-# CONFIG_NET_VENDOR_VIA is not set
+CONFIG_SKY2=y
+CONFIG_PTP_1588_CLOCK_TILEGX=y
 # CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
@@ -402,6 +234,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=y
 # CONFIG_SERIO is not set
 # CONFIG_VT is not set
 # CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_TILEGX=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_TIMERIOMEM=m
 CONFIG_I2C=y
@@ -410,13 +243,16 @@ CONFIG_I2C_CHARDEV=y
 CONFIG_WATCHDOG=y
 CONFIG_WATCHDOG_NOWAYOUT=y
 # CONFIG_VGA_ARB is not set
-# CONFIG_HID_SUPPORT is not set
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
 CONFIG_USB=y
-# CONFIG_USB_DEVICE_CLASS is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_USB_LIBUSUAL=y
 CONFIG_EDAC=y
 CONFIG_EDAC_MM_EDAC=y
 CONFIG_RTC_CLASS=y
@@ -464,9 +300,8 @@ CONFIG_ECRYPT_FS=m
 CONFIG_CRAMFS=m
 CONFIG_SQUASHFS=m
 CONFIG_NFS_FS=m
-CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
+CONFIG_NFS_V4=m
 CONFIG_NFS_V4_1=y
 CONFIG_NFS_FSCACHE=y
 CONFIG_NFSD=m
@@ -519,25 +354,28 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
+CONFIG_DLM=m
 CONFIG_DLM_DEBUG=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_REDUCED=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
 CONFIG_HEADERS_CHECK=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
+CONFIG_DEBUG_VM=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_SCHEDSTATS=y
 CONFIG_TIMER_STATS=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_INFO_REDUCED=y
-CONFIG_DEBUG_VM=y
-CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_DEBUG_LIST=y
 CONFIG_DEBUG_CREDENTIALS=y
-CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
-CONFIG_DYNAMIC_DEBUG=y
+CONFIG_RCU_CPU_STALL_TIMEOUT=60
 CONFIG_ASYNC_RAID6_TEST=m
-CONFIG_DEBUG_STACKOVERFLOW=y
+CONFIG_KGDB=y
 CONFIG_KEYS_DEBUG_PROC_KEYS=y
 CONFIG_SECURITY=y
 CONFIG_SECURITYFS=y
@@ -546,7 +384,6 @@ CONFIG_SECURITY_NETWORK_XFRM=y
 CONFIG_SECURITY_SELINUX=y
 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
 CONFIG_SECURITY_SELINUX_DISABLE=y
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_PCRYPT=m
 CONFIG_CRYPTO_CRYPTD=m
 CONFIG_CRYPTO_TEST=m
@@ -559,14 +396,12 @@ CONFIG_CRYPTO_XTS=m
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_XCBC=m
 CONFIG_CRYPTO_VMAC=m
-CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD128=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_RMD256=m
 CONFIG_CRYPTO_RMD320=m
 CONFIG_CRYPTO_SHA1=y
-CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
 CONFIG_CRYPTO_TGR192=m
 CONFIG_CRYPTO_WP512=m
index dd2b8f0..80fc32e 100644 (file)
@@ -1,15 +1,14 @@
-CONFIG_EXPERIMENTAL=y
-# CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_AUDIT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
-CONFIG_FHANDLE=y
 CONFIG_TASKSTATS=y
 CONFIG_TASK_DELAY_ACCT=y
 CONFIG_TASK_XACCT=y
 CONFIG_TASK_IO_ACCOUNTING=y
-CONFIG_AUDIT=y
 CONFIG_LOG_BUF_SHIFT=19
 CONFIG_CGROUPS=y
 CONFIG_CGROUP_DEBUG=y
@@ -17,14 +16,13 @@ CONFIG_CGROUP_DEVICE=y
 CONFIG_CPUSETS=y
 CONFIG_CGROUP_CPUACCT=y
 CONFIG_RESOURCE_COUNTERS=y
-CONFIG_CGROUP_MEMCG=y
-CONFIG_CGROUP_MEMCG_SWAP=y
 CONFIG_CGROUP_SCHED=y
 CONFIG_RT_GROUP_SCHED=y
 CONFIG_BLK_CGROUP=y
 CONFIG_NAMESPACES=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_XZ=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_EMBEDDED=y
 # CONFIG_COMPAT_BRK is not set
@@ -44,11 +42,10 @@ CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_SGI_PARTITION=y
 CONFIG_SUN_PARTITION=y
 CONFIG_KARMA_PARTITION=y
-CONFIG_EFI_PARTITION=y
 CONFIG_CFQ_GROUP_IOSCHED=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
 CONFIG_HZ_100=y
+# CONFIG_COMPACTION is not set
+CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_PCI_DEBUG=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=y
@@ -122,16 +119,15 @@ CONFIG_NF_CONNTRACK_PPTP=m
 CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
-CONFIG_NETFILTER_TPROXY=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
 CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
-CONFIG_NETFILTER_XT_TARGET_CT=m
 CONFIG_NETFILTER_XT_TARGET_DSCP=m
 CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
 CONFIG_NETFILTER_XT_TARGET_NFLOG=m
 CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
 CONFIG_NETFILTER_XT_TARGET_TEE=m
 CONFIG_NETFILTER_XT_TARGET_TPROXY=m
 CONFIG_NETFILTER_XT_TARGET_TRACE=m
@@ -189,14 +185,12 @@ CONFIG_IP_VS_SED=m
 CONFIG_IP_VS_NQ=m
 CONFIG_NF_CONNTRACK_IPV4=m
 # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
-CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=y
 CONFIG_IP_NF_MATCH_AH=m
 CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
 CONFIG_IP_NF_FILTER=y
 CONFIG_IP_NF_TARGET_REJECT=y
-CONFIG_IP_NF_TARGET_LOG=m
 CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_IP_NF_MANGLE=m
 CONFIG_IP_NF_TARGET_ECN=m
@@ -207,8 +201,6 @@ CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_NF_CONNTRACK_IPV6=m
-CONFIG_IP6_NF_QUEUE=m
-CONFIG_IP6_NF_IPTABLES=m
 CONFIG_IP6_NF_MATCH_AH=m
 CONFIG_IP6_NF_MATCH_EUI64=m
 CONFIG_IP6_NF_MATCH_FRAG=m
@@ -218,7 +210,6 @@ CONFIG_IP6_NF_MATCH_IPV6HEADER=m
 CONFIG_IP6_NF_MATCH_MH=m
 CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_TARGET_HL=m
-CONFIG_IP6_NF_TARGET_LOG=m
 CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
@@ -249,7 +240,6 @@ CONFIG_BRIDGE_EBT_NFLOG=m
 CONFIG_RDS=m
 CONFIG_RDS_TCP=m
 CONFIG_BRIDGE=m
-CONFIG_NET_DSA=y
 CONFIG_VLAN_8021Q=m
 CONFIG_VLAN_8021Q_GVRP=y
 CONFIG_PHONET=m
@@ -297,6 +287,7 @@ CONFIG_NET_ACT_SIMP=m
 CONFIG_NET_ACT_SKBEDIT=m
 CONFIG_NET_CLS_IND=y
 CONFIG_DCB=y
+CONFIG_DNS_RESOLVER=y
 # CONFIG_WIRELESS is not set
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
@@ -354,40 +345,7 @@ CONFIG_NET_DSA_MV88E6060=y
 CONFIG_NET_DSA_MV88E6131=y
 CONFIG_NET_DSA_MV88E6123_61_65=y
 # CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NET_VENDOR_ADAPTEC is not set
-# CONFIG_NET_VENDOR_ALTEON is not set
-# CONFIG_NET_VENDOR_AMD is not set
-# CONFIG_NET_VENDOR_ATHEROS is not set
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_BROCADE is not set
-# CONFIG_NET_VENDOR_CHELSIO is not set
-# CONFIG_NET_VENDOR_CISCO is not set
-# CONFIG_NET_VENDOR_DEC is not set
-# CONFIG_NET_VENDOR_DLINK is not set
-# CONFIG_NET_VENDOR_EMULEX is not set
-# CONFIG_NET_VENDOR_EXAR is not set
-# CONFIG_NET_VENDOR_HP is not set
-# CONFIG_NET_VENDOR_INTEL is not set
-# CONFIG_NET_VENDOR_MARVELL is not set
-# CONFIG_NET_VENDOR_MELLANOX is not set
-# CONFIG_NET_VENDOR_MICREL is not set
-# CONFIG_NET_VENDOR_MYRI is not set
-# CONFIG_NET_VENDOR_NATSEMI is not set
-# CONFIG_NET_VENDOR_NVIDIA is not set
-# CONFIG_NET_VENDOR_OKI is not set
-# CONFIG_NET_PACKET_ENGINE is not set
-# CONFIG_NET_VENDOR_QLOGIC is not set
-# CONFIG_NET_VENDOR_REALTEK is not set
-# CONFIG_NET_VENDOR_RDC is not set
-# CONFIG_NET_VENDOR_SEEQ is not set
-# CONFIG_NET_VENDOR_SILAN is not set
-# CONFIG_NET_VENDOR_SIS is not set
-# CONFIG_NET_VENDOR_SMSC is not set
-# CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_NET_VENDOR_SUN is not set
-# CONFIG_NET_VENDOR_TEHUTI is not set
-# CONFIG_NET_VENDOR_TI is not set
-# CONFIG_NET_VENDOR_VIA is not set
+CONFIG_E1000E=y
 # CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
@@ -403,7 +361,6 @@ CONFIG_I2C_CHARDEV=y
 CONFIG_WATCHDOG=y
 CONFIG_WATCHDOG_NOWAYOUT=y
 # CONFIG_VGA_ARB is not set
-# CONFIG_HID_SUPPORT is not set
 # CONFIG_USB_SUPPORT is not set
 CONFIG_EDAC=y
 CONFIG_EDAC_MM_EDAC=y
@@ -448,13 +405,13 @@ CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
 CONFIG_HUGETLBFS=y
+CONFIG_CONFIGFS_FS=m
 CONFIG_ECRYPT_FS=m
 CONFIG_CRAMFS=m
 CONFIG_SQUASHFS=m
 CONFIG_NFS_FS=m
-CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
+CONFIG_NFS_V4=m
 CONFIG_NFS_V4_1=y
 CONFIG_NFS_FSCACHE=y
 CONFIG_NFSD=m
@@ -508,26 +465,29 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
+CONFIG_DLM=m
 CONFIG_DLM_DEBUG=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_REDUCED=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
 CONFIG_FRAME_WARN=2048
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
 CONFIG_HEADERS_CHECK=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_VM=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_SCHEDSTATS=y
 CONFIG_TIMER_STATS=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_INFO_REDUCED=y
-CONFIG_DEBUG_VM=y
-CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_DEBUG_LIST=y
 CONFIG_DEBUG_CREDENTIALS=y
-CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
-CONFIG_DYNAMIC_DEBUG=y
+CONFIG_RCU_CPU_STALL_TIMEOUT=60
 CONFIG_ASYNC_RAID6_TEST=m
-CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_KEYS_DEBUG_PROC_KEYS=y
 CONFIG_SECURITY=y
 CONFIG_SECURITYFS=y
@@ -536,7 +496,6 @@ CONFIG_SECURITY_NETWORK_XFRM=y
 CONFIG_SECURITY_SELINUX=y
 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
 CONFIG_SECURITY_SELINUX_DISABLE=y
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_PCRYPT=m
 CONFIG_CRYPTO_CRYPTD=m
 CONFIG_CRYPTO_TEST=m
@@ -549,14 +508,12 @@ CONFIG_CRYPTO_XTS=m
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_XCBC=m
 CONFIG_CRYPTO_VMAC=m
-CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD128=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_RMD256=m
 CONFIG_CRYPTO_RMD320=m
 CONFIG_CRYPTO_SHA1=y
-CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
 CONFIG_CRYPTO_TGR192=m
 CONFIG_CRYPTO_WP512=m
index d221f8d..d4e10d5 100644 (file)
@@ -26,3 +26,8 @@ config TILE_GXIO_TRIO
 config TILE_GXIO_USB_HOST
        bool
        select TILE_GXIO
+
+# Support direct access to the TILE-Gx UART hardware from kernel space.
+config TILE_GXIO_UART
+       bool
+       select TILE_GXIO
index 8684bca..26ae2c7 100644 (file)
@@ -6,4 +6,5 @@ obj-$(CONFIG_TILE_GXIO) += iorpc_globals.o kiorpc.o
 obj-$(CONFIG_TILE_GXIO_DMA) += dma_queue.o
 obj-$(CONFIG_TILE_GXIO_MPIPE) += mpipe.o iorpc_mpipe.o iorpc_mpipe_info.o
 obj-$(CONFIG_TILE_GXIO_TRIO) += trio.o iorpc_trio.o
+obj-$(CONFIG_TILE_GXIO_UART) += uart.o iorpc_uart.o
 obj-$(CONFIG_TILE_GXIO_USB_HOST) += usb_host.o iorpc_usb_host.o
index cef4b22..da6e18e 100644 (file)
@@ -61,6 +61,29 @@ int gxio_trio_alloc_memory_maps(gxio_trio_context_t * context,
 
 EXPORT_SYMBOL(gxio_trio_alloc_memory_maps);
 
+struct alloc_scatter_queues_param {
+       unsigned int count;
+       unsigned int first;
+       unsigned int flags;
+};
+
+int gxio_trio_alloc_scatter_queues(gxio_trio_context_t * context,
+                                  unsigned int count, unsigned int first,
+                                  unsigned int flags)
+{
+       struct alloc_scatter_queues_param temp;
+       struct alloc_scatter_queues_param *params = &temp;
+
+       params->count = count;
+       params->first = first;
+       params->flags = flags;
+
+       return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
+                            sizeof(*params),
+                            GXIO_TRIO_OP_ALLOC_SCATTER_QUEUES);
+}
+
+EXPORT_SYMBOL(gxio_trio_alloc_scatter_queues);
 
 struct alloc_pio_regions_param {
        unsigned int count;
diff --git a/arch/tile/gxio/iorpc_uart.c b/arch/tile/gxio/iorpc_uart.c
new file mode 100644 (file)
index 0000000..b9a6d61
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+/* This file is machine-generated; DO NOT EDIT! */
+#include "gxio/iorpc_uart.h"
+
+struct cfg_interrupt_param {
+       union iorpc_interrupt interrupt;
+};
+
+int gxio_uart_cfg_interrupt(gxio_uart_context_t *context, int inter_x,
+                           int inter_y, int inter_ipi, int inter_event)
+{
+       struct cfg_interrupt_param temp;
+       struct cfg_interrupt_param *params = &temp;
+
+       params->interrupt.kernel.x = inter_x;
+       params->interrupt.kernel.y = inter_y;
+       params->interrupt.kernel.ipi = inter_ipi;
+       params->interrupt.kernel.event = inter_event;
+
+       return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
+                            sizeof(*params), GXIO_UART_OP_CFG_INTERRUPT);
+}
+
+EXPORT_SYMBOL(gxio_uart_cfg_interrupt);
+
+struct get_mmio_base_param {
+       HV_PTE base;
+};
+
+int gxio_uart_get_mmio_base(gxio_uart_context_t *context, HV_PTE *base)
+{
+       int __result;
+       struct get_mmio_base_param temp;
+       struct get_mmio_base_param *params = &temp;
+
+       __result =
+           hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
+                        GXIO_UART_OP_GET_MMIO_BASE);
+       *base = params->base;
+
+       return __result;
+}
+
+EXPORT_SYMBOL(gxio_uart_get_mmio_base);
+
+struct check_mmio_offset_param {
+       unsigned long offset;
+       unsigned long size;
+};
+
+int gxio_uart_check_mmio_offset(gxio_uart_context_t *context,
+                               unsigned long offset, unsigned long size)
+{
+       struct check_mmio_offset_param temp;
+       struct check_mmio_offset_param *params = &temp;
+
+       params->offset = offset;
+       params->size = size;
+
+       return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
+                            sizeof(*params), GXIO_UART_OP_CHECK_MMIO_OFFSET);
+}
+
+EXPORT_SYMBOL(gxio_uart_check_mmio_offset);
diff --git a/arch/tile/gxio/uart.c b/arch/tile/gxio/uart.c
new file mode 100644 (file)
index 0000000..ba58517
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+/*
+ * Implementation of UART gxio calls.
+ */
+
+#include <linux/io.h>
+#include <linux/errno.h>
+#include <linux/module.h>
+
+#include <gxio/uart.h>
+#include <gxio/iorpc_globals.h>
+#include <gxio/iorpc_uart.h>
+#include <gxio/kiorpc.h>
+
+int gxio_uart_init(gxio_uart_context_t *context, int uart_index)
+{
+       char file[32];
+       int fd;
+
+       snprintf(file, sizeof(file), "uart/%d/iorpc", uart_index);
+       fd = hv_dev_open((HV_VirtAddr) file, 0);
+       if (fd < 0) {
+               if (fd >= GXIO_ERR_MIN && fd <= GXIO_ERR_MAX)
+                       return fd;
+               else
+                       return -ENODEV;
+       }
+
+       context->fd = fd;
+
+       /* Map in the MMIO space. */
+       context->mmio_base = (void __force *)
+               iorpc_ioremap(fd, HV_UART_MMIO_OFFSET, HV_UART_MMIO_SIZE);
+
+       if (context->mmio_base == NULL) {
+               hv_dev_close(context->fd);
+               context->fd = -1;
+               return -ENODEV;
+       }
+
+       return 0;
+}
+
+EXPORT_SYMBOL_GPL(gxio_uart_init);
+
+int gxio_uart_destroy(gxio_uart_context_t *context)
+{
+       iounmap((void __force __iomem *)(context->mmio_base));
+       hv_dev_close(context->fd);
+
+       context->mmio_base = NULL;
+       context->fd = -1;
+
+       return 0;
+}
+
+EXPORT_SYMBOL_GPL(gxio_uart_destroy);
+
+/* UART register write wrapper. */
+void gxio_uart_write(gxio_uart_context_t *context, uint64_t offset,
+                    uint64_t word)
+{
+       __gxio_mmio_write(context->mmio_base + offset, word);
+}
+
+EXPORT_SYMBOL_GPL(gxio_uart_write);
+
+/* UART register read wrapper. */
+uint64_t gxio_uart_read(gxio_uart_context_t *context, uint64_t offset)
+{
+       return __gxio_mmio_read(context->mmio_base + offset);
+}
+
+EXPORT_SYMBOL_GPL(gxio_uart_read);
index d3000a8..c0ddedc 100644 (file)
 #ifndef __ASSEMBLER__
 
 /*
+ * Map SQ Doorbell Format.
+ * This describes the format of the write-only doorbell register that exists
+ * in the last 8-bytes of the MAP_SQ_BASE/LIM range.  This register is only
+ * writable from PCIe space.  Writes to this register will not be written to
+ * Tile memory space and thus no IO VA translation is required if the last
+ * page of the BASE/LIM range is not otherwise written.
+ */
+
+__extension__
+typedef union
+{
+  struct
+  {
+#ifndef __BIG_ENDIAN__
+    /*
+     * When written with a 1, the associated MAP_SQ region's doorbell
+     * interrupt will be triggered once all previous writes are visible to
+     * Tile software.
+     */
+    uint_reg_t doorbell   : 1;
+    /*
+     * When written with a 1, the descriptor at the head of the associated
+     * MAP_SQ's FIFO will be dequeued.
+     */
+    uint_reg_t pop        : 1;
+    /* Reserved. */
+    uint_reg_t __reserved : 62;
+#else   /* __BIG_ENDIAN__ */
+    uint_reg_t __reserved : 62;
+    uint_reg_t pop        : 1;
+    uint_reg_t doorbell   : 1;
+#endif
+  };
+
+  uint_reg_t word;
+} TRIO_MAP_SQ_DOORBELL_FMT_t;
+
+
+/*
  * Tile PIO Region Configuration - CFG Address Format.
  * This register describes the address format for PIO accesses when the
  * associated region is setup with TYPE=CFG.
diff --git a/arch/tile/include/arch/uart.h b/arch/tile/include/arch/uart.h
new file mode 100644 (file)
index 0000000..0796697
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+/* Machine-generated file; do not edit. */
+
+#ifndef __ARCH_UART_H__
+#define __ARCH_UART_H__
+
+#include <arch/abi.h>
+#include <arch/uart_def.h>
+
+#ifndef __ASSEMBLER__
+
+/* Divisor. */
+
+__extension__
+typedef union
+{
+  struct
+  {
+#ifndef __BIG_ENDIAN__
+    /*
+     * Baud Rate Divisor.  Desired_baud_rate = REF_CLK frequency / (baud *
+     * 16).
+     *                       Note: REF_CLK is always 125 MHz, the default
+     * divisor = 68, baud rate = 125M/(68*16) = 115200 baud.
+     */
+    uint_reg_t divisor    : 12;
+    /* Reserved. */
+    uint_reg_t __reserved : 52;
+#else   /* __BIG_ENDIAN__ */
+    uint_reg_t __reserved : 52;
+    uint_reg_t divisor    : 12;
+#endif
+  };
+
+  uint_reg_t word;
+} UART_DIVISOR_t;
+
+/* FIFO Count. */
+
+__extension__
+typedef union
+{
+  struct
+  {
+#ifndef __BIG_ENDIAN__
+    /*
+     * n: n active entries in the receive FIFO (max is 2**8). Each entry has
+     * 8 bits.
+     * 0: no active entry in the receive FIFO (that is empty).
+     */
+    uint_reg_t rfifo_count  : 9;
+    /* Reserved. */
+    uint_reg_t __reserved_0 : 7;
+    /*
+     * n: n active entries in the transmit FIFO (max is 2**8). Each entry has
+     * 8 bits.
+     * 0: no active entry in the transmit FIFO (that is empty).
+     */
+    uint_reg_t tfifo_count  : 9;
+    /* Reserved. */
+    uint_reg_t __reserved_1 : 7;
+    /*
+     * n: n active entries in the write FIFO (max is 2**2). Each entry has 8
+     * bits.
+     * 0: no active entry in the write FIFO (that is empty).
+     */
+    uint_reg_t wfifo_count  : 3;
+    /* Reserved. */
+    uint_reg_t __reserved_2 : 29;
+#else   /* __BIG_ENDIAN__ */
+    uint_reg_t __reserved_2 : 29;
+    uint_reg_t wfifo_count  : 3;
+    uint_reg_t __reserved_1 : 7;
+    uint_reg_t tfifo_count  : 9;
+    uint_reg_t __reserved_0 : 7;
+    uint_reg_t rfifo_count  : 9;
+#endif
+  };
+
+  uint_reg_t word;
+} UART_FIFO_COUNT_t;
+
+/* FLAG. */
+
+__extension__
+typedef union
+{
+  struct
+  {
+#ifndef __BIG_ENDIAN__
+    /* Reserved. */
+    uint_reg_t __reserved_0 : 1;
+    /* 1: receive FIFO is empty */
+    uint_reg_t rfifo_empty  : 1;
+    /* 1: write FIFO is empty. */
+    uint_reg_t wfifo_empty  : 1;
+    /* 1: transmit FIFO is empty. */
+    uint_reg_t tfifo_empty  : 1;
+    /* 1: receive FIFO is full. */
+    uint_reg_t rfifo_full   : 1;
+    /* 1: write FIFO is full. */
+    uint_reg_t wfifo_full   : 1;
+    /* 1: transmit FIFO is full. */
+    uint_reg_t tfifo_full   : 1;
+    /* Reserved. */
+    uint_reg_t __reserved_1 : 57;
+#else   /* __BIG_ENDIAN__ */
+    uint_reg_t __reserved_1 : 57;
+    uint_reg_t tfifo_full   : 1;
+    uint_reg_t wfifo_full   : 1;
+    uint_reg_t rfifo_full   : 1;
+    uint_reg_t tfifo_empty  : 1;
+    uint_reg_t wfifo_empty  : 1;
+    uint_reg_t rfifo_empty  : 1;
+    uint_reg_t __reserved_0 : 1;
+#endif
+  };
+
+  uint_reg_t word;
+} UART_FLAG_t;
+
+/*
+ * Interrupt Vector Mask.
+ * Each bit in this register corresponds to a specific interrupt. When set,
+ * the associated interrupt will not be dispatched.
+ */
+
+__extension__
+typedef union
+{
+  struct
+  {
+#ifndef __BIG_ENDIAN__
+    /* Read data FIFO read and no data available */
+    uint_reg_t rdat_err       : 1;
+    /* Write FIFO was written but it was full */
+    uint_reg_t wdat_err       : 1;
+    /* Stop bit not found when current data was received */
+    uint_reg_t frame_err      : 1;
+    /* Parity error was detected when current data was received */
+    uint_reg_t parity_err     : 1;
+    /* Data was received but the receive FIFO was full */
+    uint_reg_t rfifo_overflow : 1;
+    /*
+     * An almost full event is reached when data is to be written to the
+     * receive FIFO, and the receive FIFO has more than or equal to
+     * BUFFER_THRESHOLD.RFIFO_AFULL bytes.
+     */
+    uint_reg_t rfifo_afull    : 1;
+    /* Reserved. */
+    uint_reg_t __reserved_0   : 1;
+    /* An entry in the transmit FIFO was popped */
+    uint_reg_t tfifo_re       : 1;
+    /* An entry has been pushed into the receive FIFO */
+    uint_reg_t rfifo_we       : 1;
+    /* An entry of the write FIFO has been popped */
+    uint_reg_t wfifo_re       : 1;
+    /* Rshim read receive FIFO in protocol mode */
+    uint_reg_t rfifo_err      : 1;
+    /*
+     * An almost empty event is reached when data is to be read from the
+     * transmit FIFO, and the transmit FIFO has less than or equal to
+     * BUFFER_THRESHOLD.TFIFO_AEMPTY bytes.
+     */
+    uint_reg_t tfifo_aempty   : 1;
+    /* Reserved. */
+    uint_reg_t __reserved_1   : 52;
+#else   /* __BIG_ENDIAN__ */
+    uint_reg_t __reserved_1   : 52;
+    uint_reg_t tfifo_aempty   : 1;
+    uint_reg_t rfifo_err      : 1;
+    uint_reg_t wfifo_re       : 1;
+    uint_reg_t rfifo_we       : 1;
+    uint_reg_t tfifo_re       : 1;
+    uint_reg_t __reserved_0   : 1;
+    uint_reg_t rfifo_afull    : 1;
+    uint_reg_t rfifo_overflow : 1;
+    uint_reg_t parity_err     : 1;
+    uint_reg_t frame_err      : 1;
+    uint_reg_t wdat_err       : 1;
+    uint_reg_t rdat_err       : 1;
+#endif
+  };
+
+  uint_reg_t word;
+} UART_INTERRUPT_MASK_t;
+
+/*
+ * Interrupt vector, write-one-to-clear.
+ * Each bit in this register corresponds to a specific interrupt. Hardware
+ * sets the bit when the associated condition has occurred. Writing a 1
+ * clears the status bit.
+ */
+
+__extension__
+typedef union
+{
+  struct
+  {
+#ifndef __BIG_ENDIAN__
+    /* Read data FIFO read and no data available */
+    uint_reg_t rdat_err       : 1;
+    /* Write FIFO was written but it was full */
+    uint_reg_t wdat_err       : 1;
+    /* Stop bit not found when current data was received */
+    uint_reg_t frame_err      : 1;
+    /* Parity error was detected when current data was received */
+    uint_reg_t parity_err     : 1;
+    /* Data was received but the receive FIFO was full */
+    uint_reg_t rfifo_overflow : 1;
+    /*
+     * Data was received and the receive FIFO is now almost full (more than
+     * BUFFER_THRESHOLD.RFIFO_AFULL bytes in it)
+     */
+    uint_reg_t rfifo_afull    : 1;
+    /* Reserved. */
+    uint_reg_t __reserved_0   : 1;
+    /* An entry in the transmit FIFO was popped */
+    uint_reg_t tfifo_re       : 1;
+    /* An entry has been pushed into the receive FIFO */
+    uint_reg_t rfifo_we       : 1;
+    /* An entry of the write FIFO has been popped */
+    uint_reg_t wfifo_re       : 1;
+    /* Rshim read receive FIFO in protocol mode */
+    uint_reg_t rfifo_err      : 1;
+    /*
+     * Data was read from the transmit FIFO and now it is almost empty (less
+     * than or equal to BUFFER_THRESHOLD.TFIFO_AEMPTY bytes in it).
+     */
+    uint_reg_t tfifo_aempty   : 1;
+    /* Reserved. */
+    uint_reg_t __reserved_1   : 52;
+#else   /* __BIG_ENDIAN__ */
+    uint_reg_t __reserved_1   : 52;
+    uint_reg_t tfifo_aempty   : 1;
+    uint_reg_t rfifo_err      : 1;
+    uint_reg_t wfifo_re       : 1;
+    uint_reg_t rfifo_we       : 1;
+    uint_reg_t tfifo_re       : 1;
+    uint_reg_t __reserved_0   : 1;
+    uint_reg_t rfifo_afull    : 1;
+    uint_reg_t rfifo_overflow : 1;
+    uint_reg_t parity_err     : 1;
+    uint_reg_t frame_err      : 1;
+    uint_reg_t wdat_err       : 1;
+    uint_reg_t rdat_err       : 1;
+#endif
+  };
+
+  uint_reg_t word;
+} UART_INTERRUPT_STATUS_t;
+
+/* Type. */
+
+__extension__
+typedef union
+{
+  struct
+  {
+#ifndef __BIG_ENDIAN__
+    /* Number of stop bits, rx and tx */
+    uint_reg_t sbits        : 1;
+    /* Reserved. */
+    uint_reg_t __reserved_0 : 1;
+    /* Data word size, rx and tx */
+    uint_reg_t dbits        : 1;
+    /* Reserved. */
+    uint_reg_t __reserved_1 : 1;
+    /* Parity selection, rx and tx */
+    uint_reg_t ptype        : 3;
+    /* Reserved. */
+    uint_reg_t __reserved_2 : 57;
+#else   /* __BIG_ENDIAN__ */
+    uint_reg_t __reserved_2 : 57;
+    uint_reg_t ptype        : 3;
+    uint_reg_t __reserved_1 : 1;
+    uint_reg_t dbits        : 1;
+    uint_reg_t __reserved_0 : 1;
+    uint_reg_t sbits        : 1;
+#endif
+  };
+
+  uint_reg_t word;
+} UART_TYPE_t;
+#endif /* !defined(__ASSEMBLER__) */
+
+#endif /* !defined(__ARCH_UART_H__) */
diff --git a/arch/tile/include/arch/uart_def.h b/arch/tile/include/arch/uart_def.h
new file mode 100644 (file)
index 0000000..42bcaf5
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+/* Machine-generated file; do not edit. */
+
+#ifndef __ARCH_UART_DEF_H__
+#define __ARCH_UART_DEF_H__
+#define UART_DIVISOR 0x0158
+#define UART_FIFO_COUNT 0x0110
+#define UART_FLAG 0x0108
+#define UART_INTERRUPT_MASK 0x0208
+#define UART_INTERRUPT_MASK__RDAT_ERR_SHIFT 0
+#define UART_INTERRUPT_MASK__RDAT_ERR_WIDTH 1
+#define UART_INTERRUPT_MASK__RDAT_ERR_RESET_VAL 1
+#define UART_INTERRUPT_MASK__RDAT_ERR_RMASK 0x1
+#define UART_INTERRUPT_MASK__RDAT_ERR_MASK  0x1
+#define UART_INTERRUPT_MASK__RDAT_ERR_FIELD 0,0
+#define UART_INTERRUPT_MASK__WDAT_ERR_SHIFT 1
+#define UART_INTERRUPT_MASK__WDAT_ERR_WIDTH 1
+#define UART_INTERRUPT_MASK__WDAT_ERR_RESET_VAL 1
+#define UART_INTERRUPT_MASK__WDAT_ERR_RMASK 0x1
+#define UART_INTERRUPT_MASK__WDAT_ERR_MASK  0x2
+#define UART_INTERRUPT_MASK__WDAT_ERR_FIELD 1,1
+#define UART_INTERRUPT_MASK__FRAME_ERR_SHIFT 2
+#define UART_INTERRUPT_MASK__FRAME_ERR_WIDTH 1
+#define UART_INTERRUPT_MASK__FRAME_ERR_RESET_VAL 1
+#define UART_INTERRUPT_MASK__FRAME_ERR_RMASK 0x1
+#define UART_INTERRUPT_MASK__FRAME_ERR_MASK  0x4
+#define UART_INTERRUPT_MASK__FRAME_ERR_FIELD 2,2
+#define UART_INTERRUPT_MASK__PARITY_ERR_SHIFT 3
+#define UART_INTERRUPT_MASK__PARITY_ERR_WIDTH 1
+#define UART_INTERRUPT_MASK__PARITY_ERR_RESET_VAL 1
+#define UART_INTERRUPT_MASK__PARITY_ERR_RMASK 0x1
+#define UART_INTERRUPT_MASK__PARITY_ERR_MASK  0x8
+#define UART_INTERRUPT_MASK__PARITY_ERR_FIELD 3,3
+#define UART_INTERRUPT_MASK__RFIFO_OVERFLOW_SHIFT 4
+#define UART_INTERRUPT_MASK__RFIFO_OVERFLOW_WIDTH 1
+#define UART_INTERRUPT_MASK__RFIFO_OVERFLOW_RESET_VAL 1
+#define UART_INTERRUPT_MASK__RFIFO_OVERFLOW_RMASK 0x1
+#define UART_INTERRUPT_MASK__RFIFO_OVERFLOW_MASK  0x10
+#define UART_INTERRUPT_MASK__RFIFO_OVERFLOW_FIELD 4,4
+#define UART_INTERRUPT_MASK__RFIFO_AFULL_SHIFT 5
+#define UART_INTERRUPT_MASK__RFIFO_AFULL_WIDTH 1
+#define UART_INTERRUPT_MASK__RFIFO_AFULL_RESET_VAL 1
+#define UART_INTERRUPT_MASK__RFIFO_AFULL_RMASK 0x1
+#define UART_INTERRUPT_MASK__RFIFO_AFULL_MASK  0x20
+#define UART_INTERRUPT_MASK__RFIFO_AFULL_FIELD 5,5
+#define UART_INTERRUPT_MASK__TFIFO_RE_SHIFT 7
+#define UART_INTERRUPT_MASK__TFIFO_RE_WIDTH 1
+#define UART_INTERRUPT_MASK__TFIFO_RE_RESET_VAL 1
+#define UART_INTERRUPT_MASK__TFIFO_RE_RMASK 0x1
+#define UART_INTERRUPT_MASK__TFIFO_RE_MASK  0x80
+#define UART_INTERRUPT_MASK__TFIFO_RE_FIELD 7,7
+#define UART_INTERRUPT_MASK__RFIFO_WE_SHIFT 8
+#define UART_INTERRUPT_MASK__RFIFO_WE_WIDTH 1
+#define UART_INTERRUPT_MASK__RFIFO_WE_RESET_VAL 1
+#define UART_INTERRUPT_MASK__RFIFO_WE_RMASK 0x1
+#define UART_INTERRUPT_MASK__RFIFO_WE_MASK  0x100
+#define UART_INTERRUPT_MASK__RFIFO_WE_FIELD 8,8
+#define UART_INTERRUPT_MASK__WFIFO_RE_SHIFT 9
+#define UART_INTERRUPT_MASK__WFIFO_RE_WIDTH 1
+#define UART_INTERRUPT_MASK__WFIFO_RE_RESET_VAL 1
+#define UART_INTERRUPT_MASK__WFIFO_RE_RMASK 0x1
+#define UART_INTERRUPT_MASK__WFIFO_RE_MASK  0x200
+#define UART_INTERRUPT_MASK__WFIFO_RE_FIELD 9,9
+#define UART_INTERRUPT_MASK__RFIFO_ERR_SHIFT 10
+#define UART_INTERRUPT_MASK__RFIFO_ERR_WIDTH 1
+#define UART_INTERRUPT_MASK__RFIFO_ERR_RESET_VAL 1
+#define UART_INTERRUPT_MASK__RFIFO_ERR_RMASK 0x1
+#define UART_INTERRUPT_MASK__RFIFO_ERR_MASK  0x400
+#define UART_INTERRUPT_MASK__RFIFO_ERR_FIELD 10,10
+#define UART_INTERRUPT_MASK__TFIFO_AEMPTY_SHIFT 11
+#define UART_INTERRUPT_MASK__TFIFO_AEMPTY_WIDTH 1
+#define UART_INTERRUPT_MASK__TFIFO_AEMPTY_RESET_VAL 1
+#define UART_INTERRUPT_MASK__TFIFO_AEMPTY_RMASK 0x1
+#define UART_INTERRUPT_MASK__TFIFO_AEMPTY_MASK  0x800
+#define UART_INTERRUPT_MASK__TFIFO_AEMPTY_FIELD 11,11
+#define UART_INTERRUPT_STATUS 0x0200
+#define UART_RECEIVE_DATA 0x0148
+#define UART_TRANSMIT_DATA 0x0140
+#define UART_TYPE 0x0160
+#define UART_TYPE__SBITS_SHIFT 0
+#define UART_TYPE__SBITS_WIDTH 1
+#define UART_TYPE__SBITS_RESET_VAL 1
+#define UART_TYPE__SBITS_RMASK 0x1
+#define UART_TYPE__SBITS_MASK  0x1
+#define UART_TYPE__SBITS_FIELD 0,0
+#define UART_TYPE__SBITS_VAL_ONE_SBITS 0x0
+#define UART_TYPE__SBITS_VAL_TWO_SBITS 0x1
+#define UART_TYPE__DBITS_SHIFT 2
+#define UART_TYPE__DBITS_WIDTH 1
+#define UART_TYPE__DBITS_RESET_VAL 0
+#define UART_TYPE__DBITS_RMASK 0x1
+#define UART_TYPE__DBITS_MASK  0x4
+#define UART_TYPE__DBITS_FIELD 2,2
+#define UART_TYPE__DBITS_VAL_EIGHT_DBITS 0x0
+#define UART_TYPE__DBITS_VAL_SEVEN_DBITS 0x1
+#define UART_TYPE__PTYPE_SHIFT 4
+#define UART_TYPE__PTYPE_WIDTH 3
+#define UART_TYPE__PTYPE_RESET_VAL 3
+#define UART_TYPE__PTYPE_RMASK 0x7
+#define UART_TYPE__PTYPE_MASK  0x70
+#define UART_TYPE__PTYPE_FIELD 4,6
+#define UART_TYPE__PTYPE_VAL_NONE 0x0
+#define UART_TYPE__PTYPE_VAL_MARK 0x1
+#define UART_TYPE__PTYPE_VAL_SPACE 0x2
+#define UART_TYPE__PTYPE_VAL_EVEN 0x3
+#define UART_TYPE__PTYPE_VAL_ODD 0x4
+#endif /* !defined(__ARCH_UART_DEF_H__) */
index b17b9b8..664d6ad 100644 (file)
@@ -11,12 +11,13 @@ generic-y += errno.h
 generic-y += exec.h
 generic-y += fb.h
 generic-y += fcntl.h
+generic-y += hw_irq.h
 generic-y += ioctl.h
 generic-y += ioctls.h
 generic-y += ipcbuf.h
 generic-y += irq_regs.h
-generic-y += kdebug.h
 generic-y += local.h
+generic-y += local64.h
 generic-y += msgbuf.h
 generic-y += mutex.h
 generic-y += param.h
index e71387a..d385eaa 100644 (file)
@@ -114,6 +114,32 @@ static inline int atomic_read(const atomic_t *v)
 #define atomic_inc_and_test(v)         (atomic_inc_return(v) == 0)
 
 /**
+ * atomic_xchg - atomically exchange contents of memory with a new value
+ * @v: pointer of type atomic_t
+ * @i: integer value to store in memory
+ *
+ * Atomically sets @v to @i and returns old @v
+ */
+static inline int atomic_xchg(atomic_t *v, int n)
+{
+       return xchg(&v->counter, n);
+}
+
+/**
+ * atomic_cmpxchg - atomically exchange contents of memory if it matches
+ * @v: pointer of type atomic_t
+ * @o: old value that memory should have
+ * @n: new value to write to memory if it matches
+ *
+ * Atomically checks if @v holds @o and replaces it with @n if so.
+ * Returns the old value at @v.
+ */
+static inline int atomic_cmpxchg(atomic_t *v, int o, int n)
+{
+       return cmpxchg(&v->counter, o, n);
+}
+
+/**
  * atomic_add_negative - add and test if negative
  * @v: pointer of type atomic_t
  * @i: integer value to add
@@ -133,6 +159,32 @@ static inline int atomic_read(const atomic_t *v)
 
 #ifndef __ASSEMBLY__
 
+/**
+ * atomic64_xchg - atomically exchange contents of memory with a new value
+ * @v: pointer of type atomic64_t
+ * @i: integer value to store in memory
+ *
+ * Atomically sets @v to @i and returns old @v
+ */
+static inline u64 atomic64_xchg(atomic64_t *v, u64 n)
+{
+       return xchg64(&v->counter, n);
+}
+
+/**
+ * atomic64_cmpxchg - atomically exchange contents of memory if it matches
+ * @v: pointer of type atomic64_t
+ * @o: old value that memory should have
+ * @n: new value to write to memory if it matches
+ *
+ * Atomically checks if @v holds @o and replaces it with @n if so.
+ * Returns the old value at @v.
+ */
+static inline u64 atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n)
+{
+       return cmpxchg64(&v->counter, o, n);
+}
+
 static inline long long atomic64_dec_if_positive(atomic64_t *v)
 {
        long long c, old, dec;
index e7fb5cf..0d0395b 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-/* Tile-specific routines to support <linux/atomic.h>. */
-int _atomic_xchg(atomic_t *v, int n);
-int _atomic_xchg_add(atomic_t *v, int i);
-int _atomic_xchg_add_unless(atomic_t *v, int a, int u);
-int _atomic_cmpxchg(atomic_t *v, int o, int n);
-
-/**
- * atomic_xchg - atomically exchange contents of memory with a new value
- * @v: pointer of type atomic_t
- * @i: integer value to store in memory
- *
- * Atomically sets @v to @i and returns old @v
- */
-static inline int atomic_xchg(atomic_t *v, int n)
-{
-       smp_mb();  /* barrier for proper semantics */
-       return _atomic_xchg(v, n);
-}
-
-/**
- * atomic_cmpxchg - atomically exchange contents of memory if it matches
- * @v: pointer of type atomic_t
- * @o: old value that memory should have
- * @n: new value to write to memory if it matches
- *
- * Atomically checks if @v holds @o and replaces it with @n if so.
- * Returns the old value at @v.
- */
-static inline int atomic_cmpxchg(atomic_t *v, int o, int n)
-{
-       smp_mb();  /* barrier for proper semantics */
-       return _atomic_cmpxchg(v, o, n);
-}
-
 /**
  * atomic_add - add integer to atomic variable
  * @i: integer value to add
@@ -65,7 +31,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int o, int n)
  */
 static inline void atomic_add(int i, atomic_t *v)
 {
-       _atomic_xchg_add(v, i);
+       _atomic_xchg_add(&v->counter, i);
 }
 
 /**
@@ -78,7 +44,7 @@ static inline void atomic_add(int i, atomic_t *v)
 static inline int atomic_add_return(int i, atomic_t *v)
 {
        smp_mb();  /* barrier for proper semantics */
-       return _atomic_xchg_add(v, i) + i;
+       return _atomic_xchg_add(&v->counter, i) + i;
 }
 
 /**
@@ -93,7 +59,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
 static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        smp_mb();  /* barrier for proper semantics */
-       return _atomic_xchg_add_unless(v, a, u);
+       return _atomic_xchg_add_unless(&v->counter, a, u);
 }
 
 /**
@@ -108,7 +74,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
  */
 static inline void atomic_set(atomic_t *v, int n)
 {
-       _atomic_xchg(v, n);
+       _atomic_xchg(&v->counter, n);
 }
 
 /* A 64bit atomic type */
@@ -119,11 +85,6 @@ typedef struct {
 
 #define ATOMIC64_INIT(val) { (val) }
 
-u64 _atomic64_xchg(atomic64_t *v, u64 n);
-u64 _atomic64_xchg_add(atomic64_t *v, u64 i);
-u64 _atomic64_xchg_add_unless(atomic64_t *v, u64 a, u64 u);
-u64 _atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n);
-
 /**
  * atomic64_read - read atomic variable
  * @v: pointer of type atomic64_t
@@ -137,35 +98,7 @@ static inline u64 atomic64_read(const atomic64_t *v)
         * Casting away const is safe since the atomic support routines
         * do not write to memory if the value has not been modified.
         */
-       return _atomic64_xchg_add((atomic64_t *)v, 0);
-}
-
-/**
- * atomic64_xchg - atomically exchange contents of memory with a new value
- * @v: pointer of type atomic64_t
- * @i: integer value to store in memory
- *
- * Atomically sets @v to @i and returns old @v
- */
-static inline u64 atomic64_xchg(atomic64_t *v, u64 n)
-{
-       smp_mb();  /* barrier for proper semantics */
-       return _atomic64_xchg(v, n);
-}
-
-/**
- * atomic64_cmpxchg - atomically exchange contents of memory if it matches
- * @v: pointer of type atomic64_t
- * @o: old value that memory should have
- * @n: new value to write to memory if it matches
- *
- * Atomically checks if @v holds @o and replaces it with @n if so.
- * Returns the old value at @v.
- */
-static inline u64 atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n)
-{
-       smp_mb();  /* barrier for proper semantics */
-       return _atomic64_cmpxchg(v, o, n);
+       return _atomic64_xchg_add((u64 *)&v->counter, 0);
 }
 
 /**
@@ -177,7 +110,7 @@ static inline u64 atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n)
  */
 static inline void atomic64_add(u64 i, atomic64_t *v)
 {
-       _atomic64_xchg_add(v, i);
+       _atomic64_xchg_add(&v->counter, i);
 }
 
 /**
@@ -190,7 +123,7 @@ static inline void atomic64_add(u64 i, atomic64_t *v)
 static inline u64 atomic64_add_return(u64 i, atomic64_t *v)
 {
        smp_mb();  /* barrier for proper semantics */
-       return _atomic64_xchg_add(v, i) + i;
+       return _atomic64_xchg_add(&v->counter, i) + i;
 }
 
 /**
@@ -205,7 +138,7 @@ static inline u64 atomic64_add_return(u64 i, atomic64_t *v)
 static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
 {
        smp_mb();  /* barrier for proper semantics */
-       return _atomic64_xchg_add_unless(v, a, u) != u;
+       return _atomic64_xchg_add_unless(&v->counter, a, u) != u;
 }
 
 /**
@@ -220,7 +153,7 @@ static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
  */
 static inline void atomic64_set(atomic64_t *v, u64 n)
 {
-       _atomic64_xchg(v, n);
+       _atomic64_xchg(&v->counter, n);
 }
 
 #define atomic64_add_negative(a, v)    (atomic64_add_return((a), (v)) < 0)
@@ -252,21 +185,6 @@ static inline void atomic64_set(atomic64_t *v, u64 n)
  * Internal definitions only beyond this point.
  */
 
-#define ATOMIC_LOCKS_FOUND_VIA_TABLE() \
-  (!CHIP_HAS_CBOX_HOME_MAP() && defined(CONFIG_SMP))
-
-#if ATOMIC_LOCKS_FOUND_VIA_TABLE()
-
-/* Number of entries in atomic_lock_ptr[]. */
-#define ATOMIC_HASH_L1_SHIFT 6
-#define ATOMIC_HASH_L1_SIZE (1 << ATOMIC_HASH_L1_SHIFT)
-
-/* Number of locks in each struct pointed to by atomic_lock_ptr[]. */
-#define ATOMIC_HASH_L2_SHIFT (CHIP_L2_LOG_LINE_SIZE() - 2)
-#define ATOMIC_HASH_L2_SIZE (1 << ATOMIC_HASH_L2_SHIFT)
-
-#else /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
-
 /*
  * Number of atomic locks in atomic_locks[]. Must be a power of two.
  * There is no reason for more than PAGE_SIZE / 8 entries, since that
@@ -281,8 +199,6 @@ static inline void atomic64_set(atomic64_t *v, u64 n)
 extern int atomic_locks[];
 #endif
 
-#endif /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
-
 /*
  * All the code that may fault while holding an atomic lock must
  * place the pointer to the lock in ATOMIC_LOCK_REG so the fault code
index f4500c6..ad220ee 100644 (file)
  * on any routine which updates memory and returns a value.
  */
 
-static inline int atomic_cmpxchg(atomic_t *v, int o, int n)
-{
-       int val;
-       __insn_mtspr(SPR_CMPEXCH_VALUE, o);
-       smp_mb();  /* barrier for proper semantics */
-       val = __insn_cmpexch4((void *)&v->counter, n);
-       smp_mb();  /* barrier for proper semantics */
-       return val;
-}
-
-static inline int atomic_xchg(atomic_t *v, int n)
-{
-       int val;
-       smp_mb();  /* barrier for proper semantics */
-       val = __insn_exch4((void *)&v->counter, n);
-       smp_mb();  /* barrier for proper semantics */
-       return val;
-}
-
 static inline void atomic_add(int i, atomic_t *v)
 {
        __insn_fetchadd4((void *)&v->counter, i);
@@ -72,7 +53,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
                if (oldval == u)
                        break;
                guess = oldval;
-               oldval = atomic_cmpxchg(v, guess, guess + a);
+               oldval = cmpxchg(&v->counter, guess, guess + a);
        } while (guess != oldval);
        return oldval;
 }
@@ -84,25 +65,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 #define atomic64_read(v)               ((v)->counter)
 #define atomic64_set(v, i) ((v)->counter = (i))
 
-static inline long atomic64_cmpxchg(atomic64_t *v, long o, long n)
-{
-       long val;
-       smp_mb();  /* barrier for proper semantics */
-       __insn_mtspr(SPR_CMPEXCH_VALUE, o);
-       val = __insn_cmpexch((void *)&v->counter, n);
-       smp_mb();  /* barrier for proper semantics */
-       return val;
-}
-
-static inline long atomic64_xchg(atomic64_t *v, long n)
-{
-       long val;
-       smp_mb();  /* barrier for proper semantics */
-       val = __insn_exch((void *)&v->counter, n);
-       smp_mb();  /* barrier for proper semantics */
-       return val;
-}
-
 static inline void atomic64_add(long i, atomic64_t *v)
 {
        __insn_fetchadd((void *)&v->counter, i);
@@ -124,7 +86,7 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u)
                if (oldval == u)
                        break;
                guess = oldval;
-               oldval = atomic64_cmpxchg(v, guess, guess + a);
+               oldval = cmpxchg(&v->counter, guess, guess + a);
        } while (guess != oldval);
        return oldval != u;
 }
index 990a217..a9a73da 100644 (file)
@@ -77,7 +77,6 @@
 
 #define __sync()       __insn_mf()
 
-#if !CHIP_HAS_MF_WAITS_FOR_VICTIMS()
 #include <hv/syscall_public.h>
 /*
  * Issue an uncacheable load to each memory controller, then
@@ -96,7 +95,6 @@ static inline void __mb_incoherent(void)
                       "r20", "r21", "r22", "r23", "r24",
                       "r25", "r26", "r27", "r28", "r29");
 }
-#endif
 
 /* Fence to guarantee visibility of stores to incoherent memory. */
 static inline void
@@ -104,7 +102,6 @@ mb_incoherent(void)
 {
        __insn_mf();
 
-#if !CHIP_HAS_MF_WAITS_FOR_VICTIMS()
        {
 #if CHIP_HAS_TILE_WRITE_PENDING()
                const unsigned long WRITE_TIMEOUT_CYCLES = 400;
@@ -116,7 +113,6 @@ mb_incoherent(void)
 #endif /* CHIP_HAS_TILE_WRITE_PENDING() */
                (void) __mb_incoherent();
        }
-#endif /* CHIP_HAS_MF_WAITS_FOR_VICTIMS() */
 }
 
 #define fast_wmb()     __sync()
index bd186c4..d5a2068 100644 (file)
 #endif
 
 /**
- * __ffs - find first set bit in word
- * @word: The word to search
- *
- * Undefined if no set bit exists, so code should check against 0 first.
- */
-static inline unsigned long __ffs(unsigned long word)
-{
-       return __builtin_ctzl(word);
-}
-
-/**
  * ffz - find first zero bit in word
  * @word: The word to search
  *
@@ -50,33 +39,6 @@ static inline unsigned long ffz(unsigned long word)
        return __builtin_ctzl(~word);
 }
 
-/**
- * __fls - find last set bit in word
- * @word: The word to search
- *
- * Undefined if no set bit exists, so code should check against 0 first.
- */
-static inline unsigned long __fls(unsigned long word)
-{
-       return (sizeof(word) * 8) - 1 - __builtin_clzl(word);
-}
-
-/**
- * ffs - find first set bit in word
- * @x: the word to search
- *
- * This is defined the same way as the libc and compiler builtin ffs
- * routines, therefore differs in spirit from the other bitops.
- *
- * ffs(value) returns 0 if value is 0 or the position of the first
- * set bit if value is nonzero. The first (least significant) bit
- * is at position 1.
- */
-static inline int ffs(int x)
-{
-       return __builtin_ffs(x);
-}
-
 static inline int fls64(__u64 w)
 {
        return (sizeof(__u64) * 8) - __builtin_clzll(w);
@@ -118,6 +80,9 @@ static inline unsigned long __arch_hweight64(__u64 w)
        return __builtin_popcountll(w);
 }
 
+#include <asm-generic/bitops/builtin-__ffs.h>
+#include <asm-generic/bitops/builtin-__fls.h>
+#include <asm-generic/bitops/builtin-ffs.h>
 #include <asm-generic/bitops/const_hweight.h>
 #include <asm-generic/bitops/lock.h>
 #include <asm-generic/bitops/find.h>
index ddc4c1e..386865a 100644 (file)
@@ -16,7 +16,7 @@
 #define _ASM_TILE_BITOPS_32_H
 
 #include <linux/compiler.h>
-#include <linux/atomic.h>
+#include <asm/barrier.h>
 
 /* Tile-specific routines to support <asm/bitops.h>. */
 unsigned long _atomic_or(volatile unsigned long *p, unsigned long mask);
index 60b87ee..ad34cd0 100644 (file)
@@ -16,7 +16,7 @@
 #define _ASM_TILE_BITOPS_64_H
 
 #include <linux/compiler.h>
-#include <linux/atomic.h>
+#include <asm/cmpxchg.h>
 
 /* See <asm/bitops.h> for API comments. */
 
@@ -44,8 +44,7 @@ static inline void change_bit(unsigned nr, volatile unsigned long *addr)
        oldval = *addr;
        do {
                guess = oldval;
-               oldval = atomic64_cmpxchg((atomic64_t *)addr,
-                                         guess, guess ^ mask);
+               oldval = cmpxchg(addr, guess, guess ^ mask);
        } while (guess != oldval);
 }
 
@@ -90,8 +89,7 @@ static inline int test_and_change_bit(unsigned nr,
        oldval = *addr;
        do {
                guess = oldval;
-               oldval = atomic64_cmpxchg((atomic64_t *)addr,
-                                         guess, guess ^ mask);
+               oldval = cmpxchg(addr, guess, guess ^ mask);
        } while (guess != oldval);
        return (oldval & mask) != 0;
 }
index a9a5299..6160761 100644 (file)
 #define __read_mostly __attribute__((__section__(".data..read_mostly")))
 
 /*
- * Attribute for data that is kept read/write coherent until the end of
- * initialization, then bumped to read/only incoherent for performance.
+ * Originally we used small TLB pages for kernel data and grouped some
+ * things together as "write once", enforcing the property at the end
+ * of initialization by making those pages read-only and non-coherent.
+ * This allowed better cache utilization since cache inclusion did not
+ * need to be maintained.  However, to do this requires an extra TLB
+ * entry, which on balance is more of a performance hit than the
+ * non-coherence is a performance gain, so we now just make "read
+ * mostly" and "write once" be synonyms.  We keep the attribute
+ * separate in case we change our minds at a future date.
  */
-#define __write_once __attribute__((__section__(".w1data")))
+#define __write_once __read_mostly
 
 #endif /* _ASM_TILE_CACHE_H */
index 0fc63c4..92ee4c8 100644 (file)
@@ -75,23 +75,6 @@ static inline void copy_to_user_page(struct vm_area_struct *vma,
 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
        memcpy((dst), (src), (len))
 
-/*
- * Invalidate a VA range; pads to L2 cacheline boundaries.
- *
- * Note that on TILE64, __inv_buffer() actually flushes modified
- * cache lines in addition to invalidating them, i.e., it's the
- * same as __finv_buffer().
- */
-static inline void __inv_buffer(void *buffer, size_t size)
-{
-       char *next = (char *)((long)buffer & -L2_CACHE_BYTES);
-       char *finish = (char *)L2_CACHE_ALIGN((long)buffer + size);
-       while (next < finish) {
-               __insn_inv(next);
-               next += CHIP_INV_STRIDE();
-       }
-}
-
 /* Flush a VA range; pads to L2 cacheline boundaries. */
 static inline void __flush_buffer(void *buffer, size_t size)
 {
@@ -115,13 +98,6 @@ static inline void __finv_buffer(void *buffer, size_t size)
 }
 
 
-/* Invalidate a VA range and wait for it to be complete. */
-static inline void inv_buffer(void *buffer, size_t size)
-{
-       __inv_buffer(buffer, size);
-       mb();
-}
-
 /*
  * Flush a locally-homecached VA range and wait for the evicted
  * cachelines to hit memory.
@@ -142,6 +118,26 @@ static inline void finv_buffer_local(void *buffer, size_t size)
        mb_incoherent();
 }
 
+#ifdef __tilepro__
+/* Invalidate a VA range; pads to L2 cacheline boundaries. */
+static inline void __inv_buffer(void *buffer, size_t size)
+{
+       char *next = (char *)((long)buffer & -L2_CACHE_BYTES);
+       char *finish = (char *)L2_CACHE_ALIGN((long)buffer + size);
+       while (next < finish) {
+               __insn_inv(next);
+               next += CHIP_INV_STRIDE();
+       }
+}
+
+/* Invalidate a VA range and wait for it to be complete. */
+static inline void inv_buffer(void *buffer, size_t size)
+{
+       __inv_buffer(buffer, size);
+       mb();
+}
+#endif
+
 /*
  * Flush and invalidate a VA range that is homed remotely, waiting
  * until the memory controller holds the flushed values.  If "hfh" is
index 276f067..4001d5e 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-/* Nonexistent functions intended to cause link errors. */
-extern unsigned long __xchg_called_with_bad_pointer(void);
-extern unsigned long __cmpxchg_called_with_bad_pointer(void);
+#include <asm/barrier.h>
 
-#define xchg(ptr, x)                                                   \
+/* Nonexistent functions intended to cause compile errors. */
+extern void __xchg_called_with_bad_pointer(void)
+       __compiletime_error("Bad argument size for xchg");
+extern void __cmpxchg_called_with_bad_pointer(void)
+       __compiletime_error("Bad argument size for cmpxchg");
+
+#ifndef __tilegx__
+
+/* Note the _atomic_xxx() routines include a final mb(). */
+int _atomic_xchg(int *ptr, int n);
+int _atomic_xchg_add(int *v, int i);
+int _atomic_xchg_add_unless(int *v, int a, int u);
+int _atomic_cmpxchg(int *ptr, int o, int n);
+u64 _atomic64_xchg(u64 *v, u64 n);
+u64 _atomic64_xchg_add(u64 *v, u64 i);
+u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u);
+u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n);
+
+#define xchg(ptr, n)                                                   \
+       ({                                                              \
+               if (sizeof(*(ptr)) != 4)                                \
+                       __xchg_called_with_bad_pointer();               \
+               smp_mb();                                               \
+               (typeof(*(ptr)))_atomic_xchg((int *)(ptr), (int)(n));   \
+       })
+
+#define cmpxchg(ptr, o, n)                                             \
+       ({                                                              \
+               if (sizeof(*(ptr)) != 4)                                \
+                       __cmpxchg_called_with_bad_pointer();            \
+               smp_mb();                                               \
+               (typeof(*(ptr)))_atomic_cmpxchg((int *)ptr, (int)o, (int)n); \
+       })
+
+#define xchg64(ptr, n)                                                 \
+       ({                                                              \
+               if (sizeof(*(ptr)) != 8)                                \
+                       __xchg_called_with_bad_pointer();               \
+               smp_mb();                                               \
+               (typeof(*(ptr)))_atomic64_xchg((u64 *)(ptr), (u64)(n)); \
+       })
+
+#define cmpxchg64(ptr, o, n)                                           \
+       ({                                                              \
+               if (sizeof(*(ptr)) != 8)                                \
+                       __cmpxchg_called_with_bad_pointer();            \
+               smp_mb();                                               \
+               (typeof(*(ptr)))_atomic64_cmpxchg((u64 *)ptr, (u64)o, (u64)n); \
+       })
+
+#else
+
+#define xchg(ptr, n)                                                   \
        ({                                                              \
                typeof(*(ptr)) __x;                                     \
+               smp_mb();                                               \
                switch (sizeof(*(ptr))) {                               \
                case 4:                                                 \
-                       __x = (typeof(__x))(typeof(__x-__x))atomic_xchg( \
-                               (atomic_t *)(ptr),                      \
-                               (u32)(typeof((x)-(x)))(x));             \
+                       __x = (typeof(__x))(unsigned long)              \
+                               __insn_exch4((ptr), (u32)(unsigned long)(n)); \
                        break;                                          \
                case 8:                                                 \
-                       __x = (typeof(__x))(typeof(__x-__x))atomic64_xchg( \
-                               (atomic64_t *)(ptr),                    \
-                               (u64)(typeof((x)-(x)))(x));             \
+                       __x = (typeof(__x))                     \
+                               __insn_exch((ptr), (unsigned long)(n)); \
                        break;                                          \
                default:                                                \
                        __xchg_called_with_bad_pointer();               \
+                       break;                                          \
                }                                                       \
+               smp_mb();                                               \
                __x;                                                    \
        })
 
 #define cmpxchg(ptr, o, n)                                             \
        ({                                                              \
                typeof(*(ptr)) __x;                                     \
+               __insn_mtspr(SPR_CMPEXCH_VALUE, (unsigned long)(o));    \
+               smp_mb();                                               \
                switch (sizeof(*(ptr))) {                               \
                case 4:                                                 \
-                       __x = (typeof(__x))(typeof(__x-__x))atomic_cmpxchg( \
-                               (atomic_t *)(ptr),                      \
-                               (u32)(typeof((o)-(o)))(o),              \
-                               (u32)(typeof((n)-(n)))(n));             \
+                       __x = (typeof(__x))(unsigned long)              \
+                               __insn_cmpexch4((ptr), (u32)(unsigned long)(n)); \
                        break;                                          \
                case 8:                                                 \
-                       __x = (typeof(__x))(typeof(__x-__x))atomic64_cmpxchg( \
-                               (atomic64_t *)(ptr),                    \
-                               (u64)(typeof((o)-(o)))(o),              \
-                               (u64)(typeof((n)-(n)))(n));             \
+                       __x = (typeof(__x))__insn_cmpexch((ptr), (u64)(n)); \
                        break;                                          \
                default:                                                \
                        __cmpxchg_called_with_bad_pointer();            \
+                       break;                                          \
                }                                                       \
+               smp_mb();                                               \
                __x;                                                    \
        })
 
-#define tas(ptr) (xchg((ptr), 1))
+#define xchg64 xchg
+#define cmpxchg64 cmpxchg
+
+#endif
+
+#define tas(ptr) xchg((ptr), 1)
 
 #endif /* __ASSEMBLY__ */
 
index 5182705..6ab8bf1 100644 (file)
@@ -23,7 +23,10 @@ struct dev_archdata {
        /* Offset of the DMA address from the PA. */
        dma_addr_t              dma_offset;
 
-       /* Highest DMA address that can be generated by this device. */
+       /*
+        * Highest DMA address that can be generated by devices that
+        * have limited DMA capability, i.e. non 64-bit capable.
+        */
        dma_addr_t              max_direct_dma_addr;
 };
 
index f2ff191..1eae359 100644 (file)
 #include <linux/cache.h>
 #include <linux/io.h>
 
+#ifdef __tilegx__
+#define ARCH_HAS_DMA_GET_REQUIRED_MASK
+#endif
+
 extern struct dma_map_ops *tile_dma_map_ops;
 extern struct dma_map_ops *gx_pci_dma_map_ops;
 extern struct dma_map_ops *gx_legacy_pci_dma_map_ops;
+extern struct dma_map_ops *gx_hybrid_pci_dma_map_ops;
 
 static inline struct dma_map_ops *get_dma_ops(struct device *dev)
 {
@@ -44,12 +49,12 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off)
 
 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
 {
-       return paddr + get_dma_offset(dev);
+       return paddr;
 }
 
 static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
 {
-       return daddr - get_dma_offset(dev);
+       return daddr;
 }
 
 static inline void dma_mark_clean(void *addr, size_t size) {}
@@ -87,11 +92,19 @@ dma_set_mask(struct device *dev, u64 mask)
 {
        struct dma_map_ops *dma_ops = get_dma_ops(dev);
 
-       /* Handle legacy PCI devices with limited memory addressability. */
-       if ((dma_ops == gx_pci_dma_map_ops) && (mask <= DMA_BIT_MASK(32))) {
-               set_dma_ops(dev, gx_legacy_pci_dma_map_ops);
-               set_dma_offset(dev, 0);
-               if (mask > dev->archdata.max_direct_dma_addr)
+       /*
+        * For PCI devices with 64-bit DMA addressing capability, promote
+        * the dma_ops to hybrid, with the consistent memory DMA space limited
+        * to 32-bit. For 32-bit capable devices, limit the streaming DMA
+        * address range to max_direct_dma_addr.
+        */
+       if (dma_ops == gx_pci_dma_map_ops ||
+           dma_ops == gx_hybrid_pci_dma_map_ops ||
+           dma_ops == gx_legacy_pci_dma_map_ops) {
+               if (mask == DMA_BIT_MASK(64) &&
+                   dma_ops == gx_legacy_pci_dma_map_ops)
+                       set_dma_ops(dev, gx_hybrid_pci_dma_map_ops);
+               else if (mask > dev->archdata.max_direct_dma_addr)
                        mask = dev->archdata.max_direct_dma_addr;
        }
 
index ff8a934..41d9878 100644 (file)
@@ -30,7 +30,6 @@ typedef unsigned long elf_greg_t;
 #define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
-#define EM_TILE64  187
 #define EM_TILEPRO 188
 #define EM_TILEGX  191
 
@@ -132,6 +131,15 @@ extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
 struct linux_binprm;
 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
                                       int executable_stack);
+#define ARCH_DLINFO \
+do { \
+       NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \
+} while (0)
+
+struct mm_struct;
+extern unsigned long arch_randomize_brk(struct mm_struct *mm);
+#define arch_randomize_brk arch_randomize_brk
+
 #ifdef CONFIG_COMPAT
 
 #define COMPAT_ELF_PLATFORM "tilegx-m32"
index e16dbf9..c6b9c1b 100644 (file)
@@ -78,14 +78,6 @@ enum fixed_addresses {
 #endif
 };
 
-extern void __set_fixmap(enum fixed_addresses idx,
-                        unsigned long phys, pgprot_t flags);
-
-#define set_fixmap(idx, phys) \
-               __set_fixmap(idx, phys, PAGE_KERNEL)
-#define clear_fixmap(idx) \
-               __set_fixmap(idx, 0, __pgprot(0))
-
 #define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
 #define __FIXADDR_BOOT_SIZE    (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START          (FIXADDR_TOP + PAGE_SIZE - __FIXADDR_SIZE)
index 461459b..13a9bb8 100644 (file)
 #ifndef _ASM_TILE_FTRACE_H
 #define _ASM_TILE_FTRACE_H
 
-/* empty */
+#ifdef CONFIG_FUNCTION_TRACER
+
+#define MCOUNT_ADDR ((unsigned long)(__mcount))
+#define MCOUNT_INSN_SIZE 8             /* sizeof mcount call */
+
+#ifndef __ASSEMBLY__
+extern void __mcount(void);
+
+#ifdef CONFIG_DYNAMIC_FTRACE
+static inline unsigned long ftrace_call_adjust(unsigned long addr)
+{
+       return addr;
+}
+
+struct dyn_arch_ftrace {
+};
+#endif /*  CONFIG_DYNAMIC_FTRACE */
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* CONFIG_FUNCTION_TRACER */
 
 #endif /* _ASM_TILE_FTRACE_H */
index 5909ac3..1a6ef1b 100644 (file)
@@ -43,6 +43,7 @@
            ".pushsection .fixup,\"ax\"\n"                      \
            "0: { movei %0, %5; j 9f }\n"                       \
            ".section __ex_table,\"a\"\n"                       \
+           ".align 8\n"                                        \
            ".quad 1b, 0b\n"                                    \
            ".popsection\n"                                     \
            "9:"                                                \
index 7b77713..7ddd1b8 100644 (file)
@@ -33,8 +33,7 @@ struct zone;
 
 /*
  * Is this page immutable (unwritable) and thus able to be cached more
- * widely than would otherwise be possible?  On tile64 this means we
- * mark the PTE to cache locally; on tilepro it means we have "nc" set.
+ * widely than would otherwise be possible?  This means we have "nc" set.
  */
 #define PAGE_HOME_IMMUTABLE -2
 
@@ -44,16 +43,8 @@ struct zone;
  */
 #define PAGE_HOME_INCOHERENT -3
 
-#if CHIP_HAS_CBOX_HOME_MAP()
 /* Home for the page is distributed via hash-for-home. */
 #define PAGE_HOME_HASH -4
-#endif
-
-/* Homing is unknown or unspecified.  Not valid for page_home(). */
-#define PAGE_HOME_UNKNOWN -5
-
-/* Home on the current cpu.  Not valid for page_home(). */
-#define PAGE_HOME_HERE -6
 
 /* Support wrapper to use instead of explicit hv_flush_remote(). */
 extern void flush_remote(unsigned long cache_pfn, unsigned long cache_length,
index 3167291..9fe4349 100644 (file)
@@ -19,7 +19,8 @@
 #include <linux/bug.h>
 #include <asm/page.h>
 
-#define IO_SPACE_LIMIT 0xfffffffful
+/* Maximum PCI I/O space address supported. */
+#define IO_SPACE_LIMIT 0xffffffff
 
 /*
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
@@ -254,7 +255,7 @@ static inline void writeq(u64 val, unsigned long addr)
 
 static inline void memset_io(volatile void *dst, int val, size_t len)
 {
-       int x;
+       size_t x;
        BUG_ON((unsigned long)dst & 0x3);
        val = (val & 0xff) * 0x01010101;
        for (x = 0; x < len; x += 4)
@@ -264,7 +265,7 @@ static inline void memset_io(volatile void *dst, int val, size_t len)
 static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
                                 size_t len)
 {
-       int x;
+       size_t x;
        BUG_ON((unsigned long)src & 0x3);
        for (x = 0; x < len; x += 4)
                *(u32 *)(dst + x) = readl(src + x);
@@ -273,7 +274,7 @@ static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
 static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
                                size_t len)
 {
-       int x;
+       size_t x;
        BUG_ON((unsigned long)dst & 0x3);
        for (x = 0; x < len; x += 4)
                writel(*(u32 *)(src + x), dst + x);
@@ -281,8 +282,108 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
 
 #endif
 
+#if CHIP_HAS_MMIO() && defined(CONFIG_TILE_PCI_IO)
+
+static inline u8 inb(unsigned long addr)
+{
+       return readb((volatile void __iomem *) addr);
+}
+
+static inline u16 inw(unsigned long addr)
+{
+       return readw((volatile void __iomem *) addr);
+}
+
+static inline u32 inl(unsigned long addr)
+{
+       return readl((volatile void __iomem *) addr);
+}
+
+static inline void outb(u8 b, unsigned long addr)
+{
+       writeb(b, (volatile void __iomem *) addr);
+}
+
+static inline void outw(u16 b, unsigned long addr)
+{
+       writew(b, (volatile void __iomem *) addr);
+}
+
+static inline void outl(u32 b, unsigned long addr)
+{
+       writel(b, (volatile void __iomem *) addr);
+}
+
+static inline void insb(unsigned long addr, void *buffer, int count)
+{
+       if (count) {
+               u8 *buf = buffer;
+               do {
+                       u8 x = inb(addr);
+                       *buf++ = x;
+               } while (--count);
+       }
+}
+
+static inline void insw(unsigned long addr, void *buffer, int count)
+{
+       if (count) {
+               u16 *buf = buffer;
+               do {
+                       u16 x = inw(addr);
+                       *buf++ = x;
+               } while (--count);
+       }
+}
+
+static inline void insl(unsigned long addr, void *buffer, int count)
+{
+       if (count) {
+               u32 *buf = buffer;
+               do {
+                       u32 x = inl(addr);
+                       *buf++ = x;
+               } while (--count);
+       }
+}
+
+static inline void outsb(unsigned long addr, const void *buffer, int count)
+{
+       if (count) {
+               const u8 *buf = buffer;
+               do {
+                       outb(*buf++, addr);
+               } while (--count);
+       }
+}
+
+static inline void outsw(unsigned long addr, const void *buffer, int count)
+{
+       if (count) {
+               const u16 *buf = buffer;
+               do {
+                       outw(*buf++, addr);
+               } while (--count);
+       }
+}
+
+static inline void outsl(unsigned long addr, const void *buffer, int count)
+{
+       if (count) {
+               const u32 *buf = buffer;
+               do {
+                       outl(*buf++, addr);
+               } while (--count);
+       }
+}
+
+extern void __iomem *ioport_map(unsigned long port, unsigned int len);
+extern void ioport_unmap(void __iomem *addr);
+
+#else
+
 /*
- * The Tile architecture does not support IOPORT, even with PCI.
+ * The TilePro architecture does not support IOPORT, even with PCI.
  * Unfortunately we can't yet simply not declare these methods,
  * since some generic code that compiles into the kernel, but
  * we never run, uses them unconditionally.
@@ -290,7 +391,12 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src,
 
 static inline long ioport_panic(void)
 {
+#ifdef __tilegx__
+       panic("PCI IO space support is disabled. Configure the kernel with"
+             " CONFIG_TILE_PCI_IO to enable it");
+#else
        panic("inb/outb and friends do not exist on tile");
+#endif
        return 0;
 }
 
@@ -335,13 +441,6 @@ static inline void outl(u32 b, unsigned long addr)
        ioport_panic();
 }
 
-#define inb_p(addr)    inb(addr)
-#define inw_p(addr)    inw(addr)
-#define inl_p(addr)    inl(addr)
-#define outb_p(x, addr)        outb((x), (addr))
-#define outw_p(x, addr)        outw((x), (addr))
-#define outl_p(x, addr)        outl((x), (addr))
-
 static inline void insb(unsigned long addr, void *buffer, int count)
 {
        ioport_panic();
@@ -372,6 +471,15 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
        ioport_panic();
 }
 
+#endif /* CHIP_HAS_MMIO() && defined(CONFIG_TILE_PCI_IO) */
+
+#define inb_p(addr)    inb(addr)
+#define inw_p(addr)    inw(addr)
+#define inl_p(addr)    inl(addr)
+#define outb_p(x, addr)        outb((x), (addr))
+#define outw_p(x, addr)        outw((x), (addr))
+#define outl_p(x, addr)        outl((x), (addr))
+
 #define ioread16be(addr)       be16_to_cpu(ioread16(addr))
 #define ioread32be(addr)       be32_to_cpu(ioread32(addr))
 #define iowrite16be(v, addr)   iowrite16(be16_to_cpu(v), (addr))
index c96f9bb..71af574 100644 (file)
 DECLARE_PER_CPU(unsigned long long, interrupts_enabled_mask);
 #define INITIAL_INTERRUPTS_ENABLED (1ULL << INT_MEM_ERROR)
 
+#ifdef CONFIG_DEBUG_PREEMPT
+/* Due to inclusion issues, we can't rely on <linux/smp.h> here. */
+extern unsigned int debug_smp_processor_id(void);
+# define smp_processor_id() debug_smp_processor_id()
+#endif
+
 /* Disable interrupts. */
 #define arch_local_irq_disable() \
        interrupt_mask_set_mask(LINUX_MASKABLE_INTERRUPTS)
@@ -132,9 +138,18 @@ DECLARE_PER_CPU(unsigned long long, interrupts_enabled_mask);
 #define arch_local_irq_disable_all() \
        interrupt_mask_set_mask(-1ULL)
 
+/*
+ * Read the set of maskable interrupts.
+ * We avoid the preemption warning here via __this_cpu_ptr since even
+ * if irqs are already enabled, it's harmless to read the wrong cpu's
+ * enabled mask.
+ */
+#define arch_local_irqs_enabled() \
+       (*__this_cpu_ptr(&interrupts_enabled_mask))
+
 /* Re-enable all maskable interrupts. */
 #define arch_local_irq_enable() \
-       interrupt_mask_reset_mask(__get_cpu_var(interrupts_enabled_mask))
+       interrupt_mask_reset_mask(arch_local_irqs_enabled())
 
 /* Disable or enable interrupts based on flag argument. */
 #define arch_local_irq_restore(disabled) do { \
@@ -161,7 +176,7 @@ DECLARE_PER_CPU(unsigned long long, interrupts_enabled_mask);
 
 /* Prevent the given interrupt from being enabled next time we enable irqs. */
 #define arch_local_irq_mask(interrupt) \
-       (__get_cpu_var(interrupts_enabled_mask) &= ~(1ULL << (interrupt)))
+       this_cpu_and(interrupts_enabled_mask, ~(1ULL << (interrupt)))
 
 /* Prevent the given interrupt from being enabled immediately. */
 #define arch_local_irq_mask_now(interrupt) do { \
@@ -171,7 +186,7 @@ DECLARE_PER_CPU(unsigned long long, interrupts_enabled_mask);
 
 /* Allow the given interrupt to be enabled next time we enable irqs. */
 #define arch_local_irq_unmask(interrupt) \
-       (__get_cpu_var(interrupts_enabled_mask) |= (1ULL << (interrupt)))
+       this_cpu_or(interrupts_enabled_mask, (1ULL << (interrupt)))
 
 /* Allow the given interrupt to be enabled immediately, if !irqs_disabled. */
 #define arch_local_irq_unmask_now(interrupt) do { \
similarity index 65%
rename from arch/tile/include/asm/hw_irq.h
rename to arch/tile/include/asm/kdebug.h
index 4fac5fb..5bbbfa9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010 Tilera Corporation. All Rights Reserved.
+ * Copyright 2012 Tilera 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
  *   more details.
  */
 
-#ifndef _ASM_TILE_HW_IRQ_H
-#define _ASM_TILE_HW_IRQ_H
+#ifndef _ASM_TILE_KDEBUG_H
+#define _ASM_TILE_KDEBUG_H
 
-#endif /* _ASM_TILE_HW_IRQ_H */
+#include <linux/notifier.h>
+
+enum die_val {
+       DIE_OOPS = 1,
+       DIE_BREAK,
+       DIE_SSTEPBP,
+       DIE_PAGE_FAULT,
+       DIE_COMPILED_BPT
+};
+
+#endif /* _ASM_TILE_KDEBUG_H */
diff --git a/arch/tile/include/asm/kgdb.h b/arch/tile/include/asm/kgdb.h
new file mode 100644 (file)
index 0000000..280c181
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ *
+ * TILE-Gx KGDB support.
+ */
+
+#ifndef __TILE_KGDB_H__
+#define __TILE_KGDB_H__
+
+#include <linux/kdebug.h>
+#include <arch/opcode.h>
+
+#define GDB_SIZEOF_REG         sizeof(unsigned long)
+
+/*
+ * TILE-Gx gdb is expecting the following register layout:
+ * 56 GPRs(R0 - R52, TP, SP, LR), 8 special GPRs(networks and ZERO),
+ * plus the PC and the faultnum.
+ *
+ * Even though kernel not use the 8 special GPRs, they need to be present
+ * in the registers sent for correct processing in the host-side gdb.
+ *
+ */
+#define DBG_MAX_REG_NUM                (56+8+2)
+#define NUMREGBYTES            (DBG_MAX_REG_NUM * GDB_SIZEOF_REG)
+
+/*
+ * BUFMAX defines the maximum number of characters in inbound/outbound
+ * buffers at least NUMREGBYTES*2 are needed for register packets,
+ * Longer buffer is needed to list all threads.
+ */
+#define BUFMAX                 2048
+
+#define BREAK_INSTR_SIZE       TILEGX_BUNDLE_SIZE_IN_BYTES
+
+/*
+ * Require cache flush for set/clear a software breakpoint or write memory.
+ */
+#define CACHE_FLUSH_IS_SAFE    1
+
+/*
+ * The compiled-in breakpoint instruction can be used to "break" into
+ * the debugger via magic system request key (sysrq-G).
+ */
+static tile_bundle_bits compiled_bpt = TILEGX_BPT_BUNDLE | DIE_COMPILED_BPT;
+
+enum tilegx_regnum {
+       TILEGX_PC_REGNUM = TREG_LAST_GPR + 9,
+       TILEGX_FAULTNUM_REGNUM,
+};
+
+/*
+ * Generate a breakpoint exception to "break" into the debugger.
+ */
+static inline void arch_kgdb_breakpoint(void)
+{
+       asm volatile (".quad %0\n\t"
+                     ::""(compiled_bpt));
+}
+
+#endif /* __TILE_KGDB_H__ */
diff --git a/arch/tile/include/asm/kprobes.h b/arch/tile/include/asm/kprobes.h
new file mode 100644 (file)
index 0000000..d8f9a83
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * arch/tile/include/asm/kprobes.h
+ *
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#ifndef _ASM_TILE_KPROBES_H
+#define _ASM_TILE_KPROBES_H
+
+#include <linux/types.h>
+#include <linux/ptrace.h>
+#include <linux/percpu.h>
+
+#include <arch/opcode.h>
+
+#define __ARCH_WANT_KPROBES_INSN_SLOT
+#define MAX_INSN_SIZE                  2
+
+#define kretprobe_blacklist_size 0
+
+typedef tile_bundle_bits kprobe_opcode_t;
+
+#define flush_insn_slot(p)                                             \
+       flush_icache_range((unsigned long)p->addr,                      \
+                          (unsigned long)p->addr +                     \
+                          (MAX_INSN_SIZE * sizeof(kprobe_opcode_t)))
+
+struct kprobe;
+
+/* Architecture specific copy of original instruction. */
+struct arch_specific_insn {
+       kprobe_opcode_t *insn;
+};
+
+struct prev_kprobe {
+       struct kprobe *kp;
+       unsigned long status;
+       unsigned long saved_pc;
+};
+
+#define MAX_JPROBES_STACK_SIZE 128
+#define MAX_JPROBES_STACK_ADDR \
+       (((unsigned long)current_thread_info()) + THREAD_SIZE - 32 \
+               - sizeof(struct pt_regs))
+
+#define MIN_JPROBES_STACK_SIZE(ADDR)                                   \
+       ((((ADDR) + MAX_JPROBES_STACK_SIZE) > MAX_JPROBES_STACK_ADDR)   \
+               ? MAX_JPROBES_STACK_ADDR - (ADDR)                       \
+               : MAX_JPROBES_STACK_SIZE)
+
+/* per-cpu kprobe control block. */
+struct kprobe_ctlblk {
+       unsigned long kprobe_status;
+       unsigned long kprobe_saved_pc;
+       unsigned long jprobe_saved_sp;
+       struct prev_kprobe prev_kprobe;
+       struct pt_regs jprobe_saved_regs;
+       char jprobes_stack[MAX_JPROBES_STACK_SIZE];
+};
+
+extern tile_bundle_bits breakpoint2_insn;
+extern tile_bundle_bits breakpoint_insn;
+
+void arch_remove_kprobe(struct kprobe *);
+
+extern int kprobe_exceptions_notify(struct notifier_block *self,
+                            unsigned long val, void *data);
+
+#endif /* _ASM_TILE_KPROBES_H */
index e2c7890..0cab118 100644 (file)
@@ -22,6 +22,7 @@ struct mm_context {
         * semaphore but atomically, but it is conservatively set.
         */
        unsigned long priority_cached;
+       unsigned long vdso_base;
 };
 
 typedef struct mm_context mm_context_t;
index 37f0b74..4734215 100644 (file)
@@ -45,7 +45,7 @@ static inline void __install_page_table(pgd_t *pgdir, int asid, pgprot_t prot)
 
 static inline void install_page_table(pgd_t *pgdir, int asid)
 {
-       pte_t *ptep = virt_to_pte(NULL, (unsigned long)pgdir);
+       pte_t *ptep = virt_to_kpte((unsigned long)pgdir);
        __install_page_table(pgdir, asid, *ptep);
 }
 
index 9d3dbce..804f109 100644 (file)
@@ -42,7 +42,7 @@ static inline int pfn_to_nid(unsigned long pfn)
 
 #define kern_addr_valid(kaddr) virt_addr_valid((void *)kaddr)
 
-static inline int pfn_valid(int pfn)
+static inline int pfn_valid(unsigned long pfn)
 {
        int nid = pfn_to_nid(pfn);
 
index dd033a4..6346888 100644 (file)
 #define HPAGE_MASK     (~(HPAGE_SIZE - 1))
 
 /*
+ * We do define AT_SYSINFO_EHDR to support vDSO,
+ * but don't use the gate mechanism.
+ */
+#define __HAVE_ARCH_GATE_AREA          1
+
+/*
  * If the Kconfig doesn't specify, set a maximum zone order that
  * is enough so that we can create huge pages from small pages given
  * the respective sizes of the two page types.  See <linux/mmzone.h>.
@@ -142,8 +148,12 @@ static inline __attribute_const__ int get_order(unsigned long size)
 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
 #endif
 
+/* Allow overriding how much VA or PA the kernel will use. */
+#define MAX_PA_WIDTH CHIP_PA_WIDTH()
+#define MAX_VA_WIDTH CHIP_VA_WIDTH()
+
 /* Each memory controller has PAs distinct in their high bits. */
-#define NR_PA_HIGHBIT_SHIFT (CHIP_PA_WIDTH() - CHIP_LOG_NUM_MSHIMS())
+#define NR_PA_HIGHBIT_SHIFT (MAX_PA_WIDTH - CHIP_LOG_NUM_MSHIMS())
 #define NR_PA_HIGHBIT_VALUES (1 << CHIP_LOG_NUM_MSHIMS())
 #define __pa_to_highbits(pa) ((phys_addr_t)(pa) >> NR_PA_HIGHBIT_SHIFT)
 #define __pfn_to_highbits(pfn) ((pfn) >> (NR_PA_HIGHBIT_SHIFT - PAGE_SHIFT))
@@ -154,7 +164,7 @@ static inline __attribute_const__ int get_order(unsigned long size)
  * We reserve the lower half of memory for user-space programs, and the
  * upper half for system code.  We re-map all of physical memory in the
  * upper half, which takes a quarter of our VA space.  Then we have
- * the vmalloc regions.  The supervisor code lives at 0xfffffff700000000,
+ * the vmalloc regions.  The supervisor code lives at the highest address,
  * with the hypervisor above that.
  *
  * Loadable kernel modules are placed immediately after the static
@@ -166,26 +176,19 @@ static inline __attribute_const__ int get_order(unsigned long size)
  * Similarly, for now we don't play any struct page mapping games.
  */
 
-#if CHIP_PA_WIDTH() + 2 > CHIP_VA_WIDTH()
+#if MAX_PA_WIDTH + 2 > MAX_VA_WIDTH
 # error Too much PA to map with the VA available!
 #endif
-#define HALF_VA_SPACE           (_AC(1, UL) << (CHIP_VA_WIDTH() - 1))
 
-#define MEM_LOW_END            (HALF_VA_SPACE - 1)         /* low half */
-#define MEM_HIGH_START         (-HALF_VA_SPACE)            /* high half */
-#define PAGE_OFFSET            MEM_HIGH_START
-#define FIXADDR_BASE           _AC(0xfffffff400000000, UL) /* 4 GB */
-#define FIXADDR_TOP            _AC(0xfffffff500000000, UL) /* 4 GB */
+#define PAGE_OFFSET            (-(_AC(1, UL) << (MAX_VA_WIDTH - 1)))
+#define KERNEL_HIGH_VADDR      _AC(0xfffffff800000000, UL)  /* high 32GB */
+#define FIXADDR_BASE           (KERNEL_HIGH_VADDR - 0x400000000) /* 4 GB */
+#define FIXADDR_TOP            (KERNEL_HIGH_VADDR - 0x300000000) /* 4 GB */
 #define _VMALLOC_START         FIXADDR_TOP
-#define HUGE_VMAP_BASE         _AC(0xfffffff600000000, UL) /* 4 GB */
-#define MEM_SV_START           _AC(0xfffffff700000000, UL) /* 256 MB */
-#define MEM_SV_INTRPT          MEM_SV_START
-#define MEM_MODULE_START       _AC(0xfffffff710000000, UL) /* 256 MB */
+#define HUGE_VMAP_BASE         (KERNEL_HIGH_VADDR - 0x200000000) /* 4 GB */
+#define MEM_SV_START           (KERNEL_HIGH_VADDR - 0x100000000) /* 256 MB */
+#define MEM_MODULE_START       (MEM_SV_START + (256*1024*1024)) /* 256 MB */
 #define MEM_MODULE_END         (MEM_MODULE_START + (256*1024*1024))
-#define MEM_HV_START           _AC(0xfffffff800000000, UL) /* 32 GB */
-
-/* Highest DTLB address we will use */
-#define KERNEL_HIGH_VADDR      MEM_SV_START
 
 #else /* !__tilegx__ */
 
@@ -207,25 +210,18 @@ static inline __attribute_const__ int get_order(unsigned long size)
  * values, and after that, we show "typical" values, since the actual
  * addresses depend on kernel #defines.
  *
- * MEM_HV_INTRPT                   0xfe000000
- * MEM_SV_INTRPT (kernel code)     0xfd000000
+ * MEM_HV_START                    0xfe000000
+ * MEM_SV_START  (kernel code)     0xfd000000
  * MEM_USER_INTRPT (user vector)   0xfc000000
- * FIX_KMAP_xxx                    0xf8000000 (via NR_CPUS * KM_TYPE_NR)
- * PKMAP_BASE                      0xf7000000 (via LAST_PKMAP)
- * HUGE_VMAP                       0xf3000000 (via CONFIG_NR_HUGE_VMAPS)
- * VMALLOC_START                   0xf0000000 (via __VMALLOC_RESERVE)
+ * FIX_KMAP_xxx                    0xfa000000 (via NR_CPUS * KM_TYPE_NR)
+ * PKMAP_BASE                      0xf9000000 (via LAST_PKMAP)
+ * VMALLOC_START                   0xf7000000 (via VMALLOC_RESERVE)
  * mapped LOWMEM                   0xc0000000
  */
 
 #define MEM_USER_INTRPT                _AC(0xfc000000, UL)
-#if CONFIG_KERNEL_PL == 1
-#define MEM_SV_INTRPT          _AC(0xfd000000, UL)
-#define MEM_HV_INTRPT          _AC(0xfe000000, UL)
-#else
-#define MEM_GUEST_INTRPT       _AC(0xfd000000, UL)
-#define MEM_SV_INTRPT          _AC(0xfe000000, UL)
-#define MEM_HV_INTRPT          _AC(0xff000000, UL)
-#endif
+#define MEM_SV_START           _AC(0xfd000000, UL)
+#define MEM_HV_START           _AC(0xfe000000, UL)
 
 #define INTRPT_SIZE            0x4000
 
@@ -246,7 +242,7 @@ static inline __attribute_const__ int get_order(unsigned long size)
 
 #endif /* __tilegx__ */
 
-#ifndef __ASSEMBLY__
+#if !defined(__ASSEMBLY__) && !defined(VDSO_BUILD)
 
 #ifdef CONFIG_HIGHMEM
 
@@ -332,6 +328,7 @@ static inline int pfn_valid(unsigned long pfn)
 
 struct mm_struct;
 extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
+extern pte_t *virt_to_kpte(unsigned long kaddr);
 
 #endif /* !__ASSEMBLY__ */
 
index 54a9242..dfedd7a 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <linux/dma-mapping.h>
 #include <linux/pci.h>
-#include <linux/numa.h>
 #include <asm-generic/pci_iomap.h>
 
 #ifndef __tilegx__
@@ -29,7 +28,6 @@ struct pci_controller {
        int index;              /* PCI domain number */
        struct pci_bus *root_bus;
 
-       int first_busno;
        int last_busno;
 
        int hv_cfg_fd[2];       /* config{0,1} fds for this PCIe controller */
@@ -124,6 +122,11 @@ static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
  * the CPA plus TILE_PCI_MEM_MAP_BASE_OFFSET. To support 32-bit
  * devices, we create a separate map region that handles the low
  * 4GB.
+ *
+ * This design lets us avoid the "PCI hole" problem where the host bridge
+ * won't pass DMA traffic with target addresses that happen to fall within the
+ * BAR space. This enables us to use all the physical memory for DMA, instead
+ * of wasting the same amount of physical memory as the BAR window size.
  */
 #define        TILE_PCI_MEM_MAP_BASE_OFFSET    (1ULL << CHIP_PA_WIDTH())
 
@@ -145,6 +148,10 @@ struct pci_controller {
 
        int pio_mem_index;      /* PIO region index for memory access */
 
+#ifdef CONFIG_TILE_PCI_IO
+       int pio_io_index;       /* PIO region index for I/O space access */
+#endif
+
        /*
         * Mem-Map regions for all the memory controllers so that Linux can
         * map all of its physical memory space to the PCI bus.
@@ -154,6 +161,10 @@ struct pci_controller {
        int index;              /* PCI domain number */
        struct pci_bus *root_bus;
 
+       /* PCI I/O space resource for this controller. */
+       struct resource io_space;
+       char io_space_name[32];
+
        /* PCI memory space resource for this controller. */
        struct resource mem_space;
        char mem_space_name[32];
@@ -166,13 +177,11 @@ struct pci_controller {
 
        /* Table that maps the INTx numbers to Linux irq numbers. */
        int irq_intx_table[4];
-
-       /* Address ranges that are routed to this controller/bridge. */
-       struct resource mem_resources[3];
 };
 
 extern struct pci_controller pci_controllers[TILEGX_NUM_TRIO * TILEGX_TRIO_PCIES];
 extern gxio_trio_context_t trio_contexts[TILEGX_NUM_TRIO];
+extern int num_trio_shims;
 
 extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
 
@@ -211,7 +220,8 @@ static inline int pcibios_assign_all_busses(void)
 }
 
 #define PCIBIOS_MIN_MEM                0
-#define PCIBIOS_MIN_IO         0
+/* Minimum PCI I/O address, starting at the page boundary. */
+#define PCIBIOS_MIN_IO         PAGE_SIZE
 
 /* Use any cpu for PCI. */
 #define cpumask_of_pcibus(bus) cpu_online_mask
index 4ce4a7a..63142ab 100644 (file)
@@ -84,10 +84,12 @@ extern unsigned long VMALLOC_RESERVE /* = CONFIG_VMALLOC_RESERVE */;
 /* We have no pmd or pud since we are strictly a two-level page table */
 #include <asm-generic/pgtable-nopmd.h>
 
+static inline int pud_huge_page(pud_t pud)     { return 0; }
+
 /* We don't define any pgds for these addresses. */
 static inline int pgd_addr_invalid(unsigned long addr)
 {
-       return addr >= MEM_HV_INTRPT;
+       return addr >= MEM_HV_START;
 }
 
 /*
index 2492fa5..3421177 100644 (file)
 /* We have no pud since we are a three-level page table. */
 #include <asm-generic/pgtable-nopud.h>
 
+/*
+ * pmds are the same as pgds and ptes, so converting is a no-op.
+ */
+#define pmd_pte(pmd) (pmd)
+#define pmdp_ptep(pmdp) (pmdp)
+#define pte_pmd(pte) (pte)
+
+#define pud_pte(pud) ((pud).pgd)
+
 static inline int pud_none(pud_t pud)
 {
        return pud_val(pud) == 0;
@@ -73,6 +82,11 @@ static inline int pud_present(pud_t pud)
        return pud_val(pud) & _PAGE_PRESENT;
 }
 
+static inline int pud_huge_page(pud_t pud)
+{
+       return pud_val(pud) & _PAGE_HUGE_PAGE;
+}
+
 #define pmd_ERROR(e) \
        pr_err("%s:%d: bad pmd 0x%016llx.\n", __FILE__, __LINE__, pmd_val(e))
 
@@ -89,6 +103,9 @@ static inline int pud_bad(pud_t pud)
 /* Return the page-table frame number (ptfn) that a pud_t points at. */
 #define pud_ptfn(pud) hv_pte_get_ptfn((pud).pgd)
 
+/* Return the page frame number (pfn) that a pud_t points at. */
+#define pud_pfn(pud) pte_pfn(pud_pte(pud))
+
 /*
  * A given kernel pud_t maps to a kernel pmd_t table at a specific
  * virtual address.  Since kernel pmd_t tables can be aligned at
@@ -123,8 +140,7 @@ static inline unsigned long pgd_addr_normalize(unsigned long addr)
 /* We don't define any pgds for these addresses. */
 static inline int pgd_addr_invalid(unsigned long addr)
 {
-       return addr >= MEM_HV_START ||
-               (addr > MEM_LOW_END && addr < MEM_HIGH_START);
+       return addr >= KERNEL_HIGH_VADDR || addr != pgd_addr_normalize(addr);
 }
 
 /*
@@ -152,13 +168,6 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
        return hv_pte(__insn_exch(&ptep->val, 0UL));
 }
 
-/*
- * pmds are the same as pgds and ptes, so converting is a no-op.
- */
-#define pmd_pte(pmd) (pmd)
-#define pmdp_ptep(pmdp) (pmdp)
-#define pte_pmd(pte) (pte)
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_TILE_PGTABLE_64_H */
index b3f1049..4232363 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef _ASM_TILE_PROCESSOR_H
 #define _ASM_TILE_PROCESSOR_H
 
+#include <arch/chip.h>
+
 #ifndef __ASSEMBLY__
 
 /*
@@ -25,7 +27,6 @@
 #include <asm/ptrace.h>
 #include <asm/percpu.h>
 
-#include <arch/chip.h>
 #include <arch/spr_def.h>
 
 struct task_struct;
@@ -110,18 +111,16 @@ struct thread_struct {
        unsigned long long interrupt_mask;
        /* User interrupt-control 0 state */
        unsigned long intctrl_0;
-#if CHIP_HAS_PROC_STATUS_SPR()
+       /* Is this task currently doing a backtrace? */
+       bool in_backtrace;
        /* Any other miscellaneous processor state bits */
        unsigned long proc_status;
-#endif
 #if !CHIP_HAS_FIXED_INTVEC_BASE()
        /* Interrupt base for PL0 interrupts */
        unsigned long interrupt_vector_base;
 #endif
-#if CHIP_HAS_TILE_RTF_HWM()
        /* Tile cache retry fifo high-water mark */
        unsigned long tile_rtf_hwm;
-#endif
 #if CHIP_HAS_DSTREAM_PF()
        /* Data stream prefetch control */
        unsigned long dstream_pf;
@@ -134,21 +133,16 @@ struct thread_struct {
        /* Async DMA TLB fault information */
        struct async_tlb dma_async_tlb;
 #endif
-#if CHIP_HAS_SN_PROC()
-       /* Was static network processor when we were switched out? */
-       int sn_proc_running;
-       /* Async SNI TLB fault information */
-       struct async_tlb sn_async_tlb;
-#endif
 };
 
 #endif /* !__ASSEMBLY__ */
 
 /*
  * Start with "sp" this many bytes below the top of the kernel stack.
- * This preserves the invariant that a called function may write to *sp.
+ * This allows us to be cache-aware when handling the initial save
+ * of the pt_regs value to the stack.
  */
-#define STACK_TOP_DELTA 8
+#define STACK_TOP_DELTA 64
 
 /*
  * When entering the kernel via a fault, start with the top of the
@@ -164,7 +158,7 @@ struct thread_struct {
 #ifndef __ASSEMBLY__
 
 #ifdef __tilegx__
-#define TASK_SIZE_MAX          (MEM_LOW_END + 1)
+#define TASK_SIZE_MAX          (_AC(1, UL) << (MAX_VA_WIDTH - 1))
 #else
 #define TASK_SIZE_MAX          PAGE_OFFSET
 #endif
@@ -178,10 +172,10 @@ struct thread_struct {
 #define TASK_SIZE              TASK_SIZE_MAX
 #endif
 
-/* We provide a minimal "vdso" a la x86; just the sigreturn code for now. */
-#define VDSO_BASE              (TASK_SIZE - PAGE_SIZE)
+#define VDSO_BASE      ((unsigned long)current->active_mm->context.vdso_base)
+#define VDSO_SYM(x)    (VDSO_BASE + (unsigned long)(x))
 
-#define STACK_TOP              VDSO_BASE
+#define STACK_TOP              TASK_SIZE
 
 /* STACK_TOP_MAX is used temporarily in execve and should not check COMPAT. */
 #define STACK_TOP_MAX          TASK_SIZE_MAX
@@ -232,21 +226,28 @@ extern int do_work_pending(struct pt_regs *regs, u32 flags);
 unsigned long get_wchan(struct task_struct *p);
 
 /* Return initial ksp value for given task. */
-#define task_ksp0(task) ((unsigned long)(task)->stack + THREAD_SIZE)
+#define task_ksp0(task) \
+       ((unsigned long)(task)->stack + THREAD_SIZE - STACK_TOP_DELTA)
 
 /* Return some info about the user process TASK. */
-#define KSTK_TOP(task) (task_ksp0(task) - STACK_TOP_DELTA)
 #define task_pt_regs(task) \
-  ((struct pt_regs *)(task_ksp0(task) - KSTK_PTREGS_GAP) - 1)
+       ((struct pt_regs *)(task_ksp0(task) - KSTK_PTREGS_GAP) - 1)
 #define current_pt_regs()                                   \
-  ((struct pt_regs *)((stack_pointer | (THREAD_SIZE - 1)) - \
-                      (KSTK_PTREGS_GAP - 1)) - 1)
+       ((struct pt_regs *)((stack_pointer | (THREAD_SIZE - 1)) - \
+                           STACK_TOP_DELTA - (KSTK_PTREGS_GAP - 1)) - 1)
 #define task_sp(task)  (task_pt_regs(task)->sp)
 #define task_pc(task)  (task_pt_regs(task)->pc)
 /* Aliases for pc and sp (used in fs/proc/array.c) */
 #define KSTK_EIP(task) task_pc(task)
 #define KSTK_ESP(task) task_sp(task)
 
+/* Fine-grained unaligned JIT support */
+#define GET_UNALIGN_CTL(tsk, adr)      get_unalign_ctl((tsk), (adr))
+#define SET_UNALIGN_CTL(tsk, val)      set_unalign_ctl((tsk), (val))
+
+extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr);
+extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val);
+
 /* Standard format for printing registers and other word-size data. */
 #ifdef __tilegx__
 # define REGFMT "0x%016lx"
@@ -275,7 +276,6 @@ extern char chip_model[64];
 /* Data on which physical memory controller corresponds to which NUMA node. */
 extern int node_controller[];
 
-#if CHIP_HAS_CBOX_HOME_MAP()
 /* Does the heap allocator return hash-for-home pages by default? */
 extern int hash_default;
 
@@ -285,11 +285,6 @@ extern int kstack_hash;
 /* Does MAP_ANONYMOUS return hash-for-home pages by default? */
 #define uheap_hash hash_default
 
-#else
-#define hash_default 0
-#define kstack_hash 0
-#define uheap_hash 0
-#endif
 
 /* Are we using huge pages in the TLB for kernel data? */
 extern int kdata_huge;
@@ -337,7 +332,6 @@ extern int kdata_huge;
 
 /*
  * Provide symbolic constants for PLs.
- * Note that assembly code assumes that USER_PL is zero.
  */
 #define USER_PL 0
 #if CONFIG_KERNEL_PL == 2
@@ -346,20 +340,38 @@ extern int kdata_huge;
 #define KERNEL_PL CONFIG_KERNEL_PL
 
 /* SYSTEM_SAVE_K_0 holds the current cpu number ORed with ksp0. */
-#define CPU_LOG_MASK_VALUE 12
-#define CPU_MASK_VALUE ((1 << CPU_LOG_MASK_VALUE) - 1)
-#if CONFIG_NR_CPUS > CPU_MASK_VALUE
-# error Too many cpus!
+#ifdef __tilegx__
+#define CPU_SHIFT 48
+#if CHIP_VA_WIDTH() > CPU_SHIFT
+# error Too many VA bits!
 #endif
+#define MAX_CPU_ID ((1 << (64 - CPU_SHIFT)) - 1)
+#define raw_smp_processor_id() \
+       ((int)(__insn_mfspr(SPR_SYSTEM_SAVE_K_0) >> CPU_SHIFT))
+#define get_current_ksp0() \
+       ((unsigned long)(((long)__insn_mfspr(SPR_SYSTEM_SAVE_K_0) << \
+                         (64 - CPU_SHIFT)) >> (64 - CPU_SHIFT)))
+#define next_current_ksp0(task) ({ \
+       unsigned long __ksp0 = task_ksp0(task) & ((1UL << CPU_SHIFT) - 1); \
+       unsigned long __cpu = (long)raw_smp_processor_id() << CPU_SHIFT; \
+       __ksp0 | __cpu; \
+})
+#else
+#define LOG2_NR_CPU_IDS 6
+#define MAX_CPU_ID ((1 << LOG2_NR_CPU_IDS) - 1)
 #define raw_smp_processor_id() \
-       ((int)__insn_mfspr(SPR_SYSTEM_SAVE_K_0) & CPU_MASK_VALUE)
+       ((int)__insn_mfspr(SPR_SYSTEM_SAVE_K_0) & MAX_CPU_ID)
 #define get_current_ksp0() \
-       (__insn_mfspr(SPR_SYSTEM_SAVE_K_0) & ~CPU_MASK_VALUE)
+       (__insn_mfspr(SPR_SYSTEM_SAVE_K_0) & ~MAX_CPU_ID)
 #define next_current_ksp0(task) ({ \
        unsigned long __ksp0 = task_ksp0(task); \
        int __cpu = raw_smp_processor_id(); \
-       BUG_ON(__ksp0 & CPU_MASK_VALUE); \
+       BUG_ON(__ksp0 & MAX_CPU_ID); \
        __ksp0 | __cpu; \
 })
+#endif
+#if CONFIG_NR_CPUS > (MAX_CPU_ID + 1)
+# error Too many cpus!
+#endif
 
 #endif /* _ASM_TILE_PROCESSOR_H */
index fd41226..b9620c0 100644 (file)
@@ -33,12 +33,13 @@ typedef unsigned long pt_reg_t;
 
 #ifndef __ASSEMBLY__
 
+#define regs_return_value(regs) ((regs)->regs[0])
 #define instruction_pointer(regs) ((regs)->pc)
 #define profile_pc(regs) instruction_pointer(regs)
 #define user_stack_pointer(regs) ((regs)->sp)
 
 /* Does the process account for user or for system time? */
-#define user_mode(regs) (EX1_PL((regs)->ex1) == USER_PL)
+#define user_mode(regs) (EX1_PL((regs)->ex1) < KERNEL_PL)
 
 /* Fill in a struct pt_regs with the current kernel registers. */
 struct pt_regs *get_pt_regs(struct pt_regs *);
@@ -79,8 +80,7 @@ extern void single_step_execve(void);
 
 struct task_struct;
 
-extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs,
-                        int error_code);
+extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs);
 
 #ifdef __tilegx__
 /* We need this since sigval_t has a user pointer in it, for GETSIGINFO etc. */
index 7d8a935..5d5d3b7 100644 (file)
@@ -25,10 +25,16 @@ extern char _sinitdata[], _einitdata[];
 /* Write-once data is writable only till the end of initialization. */
 extern char __w1data_begin[], __w1data_end[];
 
+extern char vdso_start[], vdso_end[];
+#ifdef CONFIG_COMPAT
+extern char vdso32_start[], vdso32_end[];
+#endif
 
 /* Not exactly sections, but PC comparison points in the code. */
 extern char __rt_sigreturn[], __rt_sigreturn_end[];
-#ifndef __tilegx__
+#ifdef __tilegx__
+extern char __start_unalign_asm_code[], __end_unalign_asm_code[];
+#else
 extern char sys_cmpxchg[], __sys_cmpxchg_end[];
 extern char __sys_cmpxchg_grab_lock[];
 extern char __start_atomic_asm_code[], __end_atomic_asm_code[];
index d048888..e989090 100644 (file)
@@ -24,9 +24,8 @@
  */
 #define MAXMEM_PFN     PFN_DOWN(MAXMEM)
 
+int tile_console_write(const char *buf, int count);
 void early_panic(const char *fmt, ...);
-void warn_early_printk(void);
-void __init disable_early_printk(void);
 
 /* Init-time routine to do tile-specific per-cpu setup. */
 void setup_cpu(int boot);
index 1aa759a..9a326b6 100644 (file)
@@ -101,10 +101,8 @@ void print_disabled_cpus(void);
 extern struct cpumask cpu_lotar_map;
 #define cpu_is_valid_lotar(cpu) cpumask_test_cpu((cpu), &cpu_lotar_map)
 
-#if CHIP_HAS_CBOX_HOME_MAP()
 /* Which processors are used for hash-for-home mapping */
 extern struct cpumask hash_for_home_map;
-#endif
 
 /* Which cpus can have their cache flushed by hv_flush_remote(). */
 extern struct cpumask cpu_cacheable_map;
index 5f8b6a0..9a12b9c 100644 (file)
@@ -27,7 +27,7 @@
  * Return the "current" portion of a ticket lock value,
  * i.e. the number that currently owns the lock.
  */
-static inline int arch_spin_current(u32 val)
+static inline u32 arch_spin_current(u32 val)
 {
        return val >> __ARCH_SPIN_CURRENT_SHIFT;
 }
@@ -36,7 +36,7 @@ static inline int arch_spin_current(u32 val)
  * Return the "next" portion of a ticket lock value,
  * i.e. the number that the next task to try to acquire the lock will get.
  */
-static inline int arch_spin_next(u32 val)
+static inline u32 arch_spin_next(u32 val)
 {
        return val & __ARCH_SPIN_NEXT_MASK;
 }
index 7535cf1..92b271b 100644 (file)
 #define __HAVE_ARCH_MEMMOVE
 #define __HAVE_ARCH_STRCHR
 #define __HAVE_ARCH_STRLEN
+#define __HAVE_ARCH_STRNLEN
 
 extern __kernel_size_t strlen(const char *);
+extern __kernel_size_t strnlen(const char *, __kernel_size_t);
 extern char *strchr(const char *s, int c);
 extern void *memchr(const void *s, int c, size_t n);
 extern void *memset(void *, int, __kernel_size_t);
index d1733de..b8aa6df 100644 (file)
@@ -39,6 +39,11 @@ struct thread_info {
        struct restart_block    restart_block;
        struct single_step_state *step_state;   /* single step state
                                                   (if non-zero) */
+       int                     align_ctl;      /* controls unaligned access */
+#ifdef __tilegx__
+       unsigned long           unalign_jit_tmp[4]; /* temp r0..r3 storage */
+       void __user             *unalign_jit_base; /* unalign fixup JIT base */
+#endif
 };
 
 /*
@@ -56,6 +61,7 @@ struct thread_info {
                .fn = do_no_restart_syscall,    \
        },                                      \
        .step_state     = NULL,                 \
+       .align_ctl      = 0,                    \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index e28c3df..4b99a1c 100644 (file)
 #ifndef _ASM_TILE_TRAPS_H
 #define _ASM_TILE_TRAPS_H
 
+#ifndef __ASSEMBLY__
 #include <arch/chip.h>
 
 /* mm/fault.c */
 void do_page_fault(struct pt_regs *, int fault_num,
                   unsigned long address, unsigned long write);
-#if CHIP_HAS_TILE_DMA() || CHIP_HAS_SN_PROC()
+#if CHIP_HAS_TILE_DMA()
 void do_async_page_fault(struct pt_regs *);
 #endif
 
@@ -69,6 +70,16 @@ void gx_singlestep_handle(struct pt_regs *, int fault_num);
 
 /* kernel/intvec_64.S */
 void fill_ra_stack(void);
+
+/* Handle unalign data fixup. */
+extern void do_unaligned(struct pt_regs *regs, int vecnum);
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#ifdef __tilegx__
+/* 128 byte JIT per unalign fixup. */
+#define UNALIGN_JIT_SHIFT    7
 #endif
 
 #endif /* _ASM_TILE_TRAPS_H */
index e4d44bd..b6cde32 100644 (file)
@@ -127,8 +127,10 @@ extern int fixup_exception(struct pt_regs *regs);
 
 #ifdef __LP64__
 #define _ASM_PTR       ".quad"
+#define _ASM_ALIGN     ".align 8"
 #else
 #define _ASM_PTR       ".long"
+#define _ASM_ALIGN     ".align 4"
 #endif
 
 #define __get_user_asm(OP, x, ptr, ret)                                        \
@@ -137,6 +139,7 @@ extern int fixup_exception(struct pt_regs *regs);
                     "0: { movei %1, 0; movei %0, %3 }\n"               \
                     "j 9f\n"                                           \
                     ".section __ex_table,\"a\"\n"                      \
+                    _ASM_ALIGN "\n"                                    \
                     _ASM_PTR " 1b, 0b\n"                               \
                     ".popsection\n"                                    \
                     "9:"                                               \
@@ -168,6 +171,7 @@ extern int fixup_exception(struct pt_regs *regs);
                             "0: { movei %1, 0; movei %2, 0 }\n"        \
                             "{ movei %0, %4; j 9f }\n"                 \
                             ".section __ex_table,\"a\"\n"              \
+                            ".align 4\n"                               \
                             ".word 1b, 0b\n"                           \
                             ".word 2b, 0b\n"                           \
                             ".popsection\n"                            \
@@ -224,6 +228,7 @@ extern int __get_user_bad(void)
                     ".pushsection .fixup,\"ax\"\n"                     \
                     "0: { movei %0, %3; j 9f }\n"                      \
                     ".section __ex_table,\"a\"\n"                      \
+                    _ASM_ALIGN "\n"                                    \
                     _ASM_PTR " 1b, 0b\n"                               \
                     ".popsection\n"                                    \
                     "9:"                                               \
@@ -248,6 +253,7 @@ extern int __get_user_bad(void)
                             ".pushsection .fixup,\"ax\"\n"             \
                             "0: { movei %0, %4; j 9f }\n"              \
                             ".section __ex_table,\"a\"\n"              \
+                            ".align 4\n"                               \
                             ".word 1b, 0b\n"                           \
                             ".word 2b, 0b\n"                           \
                             ".popsection\n"                            \
@@ -567,37 +573,6 @@ static inline unsigned long __must_check flush_user(
 }
 
 /**
- * inv_user: - Invalidate a block of memory in user space from cache.
- * @mem:   Destination address, in user space.
- * @len:   Number of bytes to invalidate.
- *
- * Returns number of bytes that could not be invalidated.
- * On success, this will be zero.
- *
- * Note that on Tile64, the "inv" operation is in fact a
- * "flush and invalidate", so cache write-backs will occur prior
- * to the cache being marked invalid.
- */
-extern unsigned long inv_user_asm(void __user *mem, unsigned long len);
-static inline unsigned long __must_check __inv_user(
-       void __user *mem, unsigned long len)
-{
-       int retval;
-
-       might_fault();
-       retval = inv_user_asm(mem, len);
-       mb_incoherent();
-       return retval;
-}
-static inline unsigned long __must_check inv_user(
-       void __user *mem, unsigned long len)
-{
-       if (access_ok(VERIFY_WRITE, mem, len))
-               return __inv_user(mem, len);
-       return len;
-}
-
-/**
  * finv_user: - Flush-inval a block of memory in user space from cache.
  * @mem:   Destination address, in user space.
  * @len:   Number of bytes to invalidate.
index 37dfbe5..5a58a0d 100644 (file)
 #ifndef _ASM_TILE_UNALIGNED_H
 #define _ASM_TILE_UNALIGNED_H
 
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-#define get_unaligned  __get_unaligned_le
-#define put_unaligned  __put_unaligned_le
+/*
+ * We could implement faster get_unaligned_[be/le]64 using the ldna
+ * instruction on tilegx; however, we need to either copy all of the
+ * other generic functions to here (which is pretty ugly) or else
+ * modify both the generic code and other arch code to allow arch
+ * specific unaligned data access functions.  Given these functions
+ * are not often called, we'll stick with the generic version.
+ */
+#include <asm-generic/unaligned.h>
 
 /*
  * Is the kernel doing fixups of unaligned accesses?  If <0, no kernel
diff --git a/arch/tile/include/asm/vdso.h b/arch/tile/include/asm/vdso.h
new file mode 100644 (file)
index 0000000..9f6a78d
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#ifndef __TILE_VDSO_H__
+#define __TILE_VDSO_H__
+
+#include <linux/types.h>
+
+/*
+ * Note about the vdso_data structure:
+ *
+ * NEVER USE THEM IN USERSPACE CODE DIRECTLY. The layout of the
+ * structure is supposed to be known only to the function in the vdso
+ * itself and may change without notice.
+ */
+
+struct vdso_data {
+       __u64 tz_update_count;  /* Timezone atomicity ctr             */
+       __u64 tb_update_count;  /* Timebase atomicity ctr             */
+       __u64 xtime_tod_stamp;  /* TOD clock for xtime                */
+       __u64 xtime_clock_sec;  /* Kernel time second                 */
+       __u64 xtime_clock_nsec; /* Kernel time nanosecond             */
+       __u64 wtom_clock_sec;   /* Wall to monotonic clock second     */
+       __u64 wtom_clock_nsec;  /* Wall to monotonic clock nanosecond */
+       __u32 mult;             /* Cycle to nanosecond multiplier     */
+       __u32 shift;            /* Cycle to nanosecond divisor (power of two) */
+       __u32 tz_minuteswest;   /* Minutes west of Greenwich          */
+       __u32 tz_dsttime;       /* Type of dst correction             */
+};
+
+extern struct vdso_data *vdso_data;
+
+/* __vdso_rt_sigreturn is defined with the addresses in the vdso page. */
+extern void __vdso_rt_sigreturn(void);
+
+extern int setup_vdso_pages(void);
+
+#endif /* __TILE_VDSO_H__ */
index 58105c3..d95b96f 100644 (file)
@@ -30,6 +30,7 @@
 
 #define GXIO_TRIO_OP_ALLOC_MEMORY_MAPS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1404)
 
+#define GXIO_TRIO_OP_ALLOC_SCATTER_QUEUES IORPC_OPCODE(IORPC_FORMAT_NONE, 0x140e)
 #define GXIO_TRIO_OP_ALLOC_PIO_REGIONS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1412)
 
 #define GXIO_TRIO_OP_INIT_PIO_REGION_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1414)
@@ -54,6 +55,10 @@ int gxio_trio_alloc_memory_maps(gxio_trio_context_t * context,
                                unsigned int flags);
 
 
+int gxio_trio_alloc_scatter_queues(gxio_trio_context_t * context,
+                                  unsigned int count, unsigned int first,
+                                  unsigned int flags);
+
 int gxio_trio_alloc_pio_regions(gxio_trio_context_t * context,
                                unsigned int count, unsigned int first,
                                unsigned int flags);
diff --git a/arch/tile/include/gxio/iorpc_uart.h b/arch/tile/include/gxio/iorpc_uart.h
new file mode 100644 (file)
index 0000000..55429d4
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+/* This file is machine-generated; DO NOT EDIT! */
+#ifndef __GXIO_UART_LINUX_RPC_H__
+#define __GXIO_UART_LINUX_RPC_H__
+
+#include <hv/iorpc.h>
+
+#include <hv/drv_uart_intf.h>
+#include <gxio/uart.h>
+#include <gxio/kiorpc.h>
+#include <linux/string.h>
+#include <linux/module.h>
+#include <asm/pgtable.h>
+
+#define GXIO_UART_OP_CFG_INTERRUPT     IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1900)
+#define GXIO_UART_OP_GET_MMIO_BASE     IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
+#define GXIO_UART_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
+
+int gxio_uart_cfg_interrupt(gxio_uart_context_t *context, int inter_x,
+                           int inter_y, int inter_ipi, int inter_event);
+
+int gxio_uart_get_mmio_base(gxio_uart_context_t *context, HV_PTE *base);
+
+int gxio_uart_check_mmio_offset(gxio_uart_context_t *context,
+                               unsigned long offset, unsigned long size);
+
+#endif /* !__GXIO_UART_LINUX_RPC_H__ */
diff --git a/arch/tile/include/gxio/uart.h b/arch/tile/include/gxio/uart.h
new file mode 100644 (file)
index 0000000..438ee7e
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#ifndef _GXIO_UART_H_
+#define _GXIO_UART_H_
+
+#include "common.h"
+
+#include <hv/drv_uart_intf.h>
+#include <hv/iorpc.h>
+
+/*
+ *
+ * An API for manipulating UART interface.
+ */
+
+/*
+ *
+ * The Rshim allows access to the processor's UART interface.
+ */
+
+/* A context object used to manage UART resources. */
+typedef struct {
+
+       /* File descriptor for calling up to the hypervisor. */
+       int fd;
+
+       /* The VA at which our MMIO registers are mapped. */
+       char *mmio_base;
+
+} gxio_uart_context_t;
+
+/* Request UART interrupts.
+ *
+ *  Request that interrupts be delivered to a tile when the UART's
+ *  Receive FIFO is written, or the Write FIFO is read.
+ *
+ * @param context Pointer to a properly initialized gxio_uart_context_t.
+ * @param bind_cpu_x X coordinate of CPU to which interrupt will be delivered.
+ * @param bind_cpu_y Y coordinate of CPU to which interrupt will be delivered.
+ * @param bind_interrupt IPI interrupt number.
+ * @param bind_event Sub-interrupt event bit number; a negative value can
+ *  disable the interrupt.
+ * @return Zero if all of the requested UART events were successfully
+ *  configured to interrupt.
+ */
+extern int gxio_uart_cfg_interrupt(gxio_uart_context_t *context,
+                                  int bind_cpu_x,
+                                  int bind_cpu_y,
+                                  int bind_interrupt, int bind_event);
+
+/* Initialize a UART context.
+ *
+ *  A properly initialized context must be obtained before any of the other
+ *  gxio_uart routines may be used.
+ *
+ * @param context Pointer to a gxio_uart_context_t, which will be initialized
+ *  by this routine, if it succeeds.
+ * @param uart_index Index of the UART to use.
+ * @return Zero if the context was successfully initialized, else a
+ *  GXIO_ERR_xxx error code.
+ */
+extern int gxio_uart_init(gxio_uart_context_t *context, int uart_index);
+
+/* Destroy a UART context.
+ *
+ *  Once destroyed, a context may not be used with any gxio_uart routines
+ *  other than gxio_uart_init().  After this routine returns, no further
+ *  interrupts requested on this context will be delivered.  The state and
+ *  configuration of the pins which had been attached to this context are
+ *  unchanged by this operation.
+ *
+ * @param context Pointer to a gxio_uart_context_t.
+ * @return Zero if the context was successfully destroyed, else a
+ *  GXIO_ERR_xxx error code.
+ */
+extern int gxio_uart_destroy(gxio_uart_context_t *context);
+
+/* Write UART register.
+ * @param context Pointer to a gxio_uart_context_t.
+ * @param offset UART register offset.
+ * @param word Data will be wrote to UART reigister.
+ */
+extern void gxio_uart_write(gxio_uart_context_t *context, uint64_t offset,
+                           uint64_t word);
+
+/* Read UART register.
+ * @param context Pointer to a gxio_uart_context_t.
+ * @param offset UART register offset.
+ * @return Data read from UART register.
+ */
+extern uint64_t gxio_uart_read(gxio_uart_context_t *context, uint64_t offset);
+
+#endif /* _GXIO_UART_H_ */
index ef9f3f5..237e04d 100644 (file)
@@ -64,8 +64,9 @@ struct pcie_port_property
    *  will not consider it an error if the link comes up as a x8 link. */
   uint8_t allow_x8: 1;
 
-  /** Reserved. */
-  uint8_t reserved: 1;
+  /** If true, this link is connected to a device which may or may not
+   *  be present. */
+  uint8_t removable: 1;
 
 };
 
@@ -167,6 +168,9 @@ pcie_stream_intr_config_sel_t;
 struct pcie_trio_ports_property
 {
   struct pcie_port_property ports[TILEGX_TRIO_PCIES];
+
+  /** Set if this TRIO belongs to a Gx72 device. */
+  uint8_t is_gx72;
 };
 
 /* Flags indicating traffic class. */
diff --git a/arch/tile/include/hv/drv_uart_intf.h b/arch/tile/include/hv/drv_uart_intf.h
new file mode 100644 (file)
index 0000000..f5379e2
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+/**
+ * Interface definitions for the UART driver.
+ */
+
+#ifndef _SYS_HV_DRV_UART_INTF_H
+#define _SYS_HV_DRV_UART_INTF_H
+
+#include <arch/uart.h>
+
+/** Number of UART ports supported. */
+#define TILEGX_UART_NR        2
+
+/** The mmap file offset (PA) of the UART MMIO region. */
+#define HV_UART_MMIO_OFFSET   0
+
+/** The maximum size of the UARTs MMIO region (64K Bytes). */
+#define HV_UART_MMIO_SIZE     (1UL << 16)
+
+#endif /* _SYS_HV_DRV_UART_INTF_H */
index 837dca5..dfcdeb6 100644 (file)
 /** hv_set_pte_super_shift */
 #define HV_DISPATCH_SET_PTE_SUPER_SHIFT           57
 
+/** hv_console_set_ipi */
+#define HV_DISPATCH_CONSOLE_SET_IPI               63
+
 /** One more than the largest dispatch value */
-#define _HV_DISPATCH_END                          58
+#define _HV_DISPATCH_END                          64
 
 
 #ifndef __ASSEMBLER__
@@ -541,14 +544,24 @@ typedef enum {
   HV_CONFSTR_CPUMOD_REV      = 18,
 
   /** Human-readable CPU module description. */
-  HV_CONFSTR_CPUMOD_DESC     = 19
+  HV_CONFSTR_CPUMOD_DESC     = 19,
+
+  /** Per-tile hypervisor statistics.  When this identifier is specified,
+   *  the hv_confstr call takes two extra arguments.  The first is the
+   *  HV_XY_TO_LOTAR of the target tile's coordinates.  The second is
+   *  a flag word.  The only current flag is the lowest bit, which means
+   *  "zero out the stats instead of retrieving them"; in this case the
+   *  buffer and buffer length are ignored. */
+  HV_CONFSTR_HV_STATS        = 20
 
 } HV_ConfstrQuery;
 
 /** Query a configuration string from the hypervisor.
  *
  * @param query Identifier for the specific string to be retrieved
- *        (HV_CONFSTR_xxx).
+ *        (HV_CONFSTR_xxx).  Some strings may require or permit extra
+ *        arguments to be appended which select specific objects to be
+ *        described; see the string descriptions above.
  * @param buf Buffer in which to place the string.
  * @param len Length of the buffer.
  * @return If query is valid, then the length of the corresponding string,
@@ -556,21 +569,16 @@ typedef enum {
  *        was truncated.  If query is invalid, HV_EINVAL.  If the specified
  *        buffer is not writable by the client, HV_EFAULT.
  */
-int hv_confstr(HV_ConfstrQuery query, HV_VirtAddr buf, int len);
+int hv_confstr(HV_ConfstrQuery query, HV_VirtAddr buf, int len, ...);
 
 /** Tile coordinate */
 typedef struct
 {
-#ifndef __BIG_ENDIAN__
   /** X coordinate, relative to supervisor's top-left coordinate */
   int x;
 
   /** Y coordinate, relative to supervisor's top-left coordinate */
   int y;
-#else
-  int y;
-  int x;
-#endif
 } HV_Coord;
 
 
@@ -585,6 +593,30 @@ typedef struct
  */
 int hv_get_ipi_pte(HV_Coord tile, int pl, HV_PTE* pte);
 
+/** Configure the console interrupt.
+ *
+ * When the console client interrupt is enabled, the hypervisor will
+ * deliver the specified IPI to the client in the following situations:
+ *
+ * - The console has at least one character available for input.
+ *
+ * - The console can accept new characters for output, and the last call
+ *   to hv_console_write() did not write all of the characters requested
+ *   by the client.
+ *
+ * Note that in some system configurations, console interrupt will not
+ * be available; clients should be prepared for this routine to fail and
+ * to fall back to periodic console polling in that case.
+ *
+ * @param ipi Index of the IPI register which will receive the interrupt.
+ * @param event IPI event number for console interrupt. If less than 0,
+ *        disable the console IPI interrupt.
+ * @param coord Tile to be targeted for console interrupt.
+ * @return 0 on success, otherwise, HV_EINVAL if illegal parameter,
+ *         HV_ENOTSUP if console interrupt are not available.
+ */
+int hv_console_set_ipi(int ipi, int event, HV_Coord coord);
+
 #else /* !CHIP_HAS_IPI() */
 
 /** A set of interrupts. */
@@ -1092,13 +1124,8 @@ HV_VirtAddrRange hv_inquire_virtual(int idx);
 /** A range of ASID values. */
 typedef struct
 {
-#ifndef __BIG_ENDIAN__
   HV_ASID start;        /**< First ASID in the range. */
   unsigned int size;    /**< Number of ASIDs. Zero for an invalid range. */
-#else
-  unsigned int size;    /**< Number of ASIDs. Zero for an invalid range. */
-  HV_ASID start;        /**< First ASID in the range. */
-#endif
 } HV_ASIDRange;
 
 /** Returns information about a range of ASIDs.
@@ -1422,7 +1449,6 @@ typedef enum
 /** Message recipient. */
 typedef struct
 {
-#ifndef __BIG_ENDIAN__
   /** X coordinate, relative to supervisor's top-left coordinate */
   unsigned int x:11;
 
@@ -1431,11 +1457,6 @@ typedef struct
 
   /** Status of this recipient */
   HV_Recip_State state:10;
-#else //__BIG_ENDIAN__
-  HV_Recip_State state:10;
-  unsigned int y:11;
-  unsigned int x:11;
-#endif
 } HV_Recipient;
 
 /** Send a message to a set of recipients.
index 4ebc34f..97dfbec 100644 (file)
@@ -1,7 +1,6 @@
 # UAPI Header export list
 header-y += abi.h
 header-y += chip.h
-header-y += chip_tile64.h
 header-y += chip_tilegx.h
 header-y += chip_tilepro.h
 header-y += icache.h
index 926d3db..4c91f90 100644 (file)
@@ -12,9 +12,7 @@
  *   more details.
  */
 
-#if __tile_chip__ == 0
-#include <arch/chip_tile64.h>
-#elif __tile_chip__ == 1
+#if __tile_chip__ == 1
 #include <arch/chip_tilepro.h>
 #elif defined(__tilegx__)
 #include <arch/chip_tilegx.h>
diff --git a/arch/tile/include/uapi/arch/chip_tile64.h b/arch/tile/include/uapi/arch/chip_tile64.h
deleted file mode 100644 (file)
index 261aaba..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright 2010 Tilera 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
- *   as published by the Free Software Foundation, version 2.
- *
- *   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, GOOD TITLE or
- *   NON INFRINGEMENT.  See the GNU General Public License for
- *   more details.
- */
-
-/*
- * @file
- * Global header file.
- * This header file specifies defines for TILE64.
- */
-
-#ifndef __ARCH_CHIP_H__
-#define __ARCH_CHIP_H__
-
-/** Specify chip version.
- * When possible, prefer the CHIP_xxx symbols below for future-proofing.
- * This is intended for cross-compiling; native compilation should
- * use the predefined __tile_chip__ symbol.
- */
-#define TILE_CHIP 0
-
-/** Specify chip revision.
- * This provides for the case of a respin of a particular chip type;
- * the normal value for this symbol is "0".
- * This is intended for cross-compiling; native compilation should
- * use the predefined __tile_chip_rev__ symbol.
- */
-#define TILE_CHIP_REV 0
-
-/** The name of this architecture. */
-#define CHIP_ARCH_NAME "tile64"
-
-/** The ELF e_machine type for binaries for this chip. */
-#define CHIP_ELF_TYPE() EM_TILE64
-
-/** The alternate ELF e_machine type for binaries for this chip. */
-#define CHIP_COMPAT_ELF_TYPE() 0x2506
-
-/** What is the native word size of the machine? */
-#define CHIP_WORD_SIZE() 32
-
-/** How many bits of a virtual address are used. Extra bits must be
- * the sign extension of the low bits.
- */
-#define CHIP_VA_WIDTH() 32
-
-/** How many bits are in a physical address? */
-#define CHIP_PA_WIDTH() 36
-
-/** Size of the L2 cache, in bytes. */
-#define CHIP_L2_CACHE_SIZE() 65536
-
-/** Log size of an L2 cache line in bytes. */
-#define CHIP_L2_LOG_LINE_SIZE() 6
-
-/** Size of an L2 cache line, in bytes. */
-#define CHIP_L2_LINE_SIZE() (1 << CHIP_L2_LOG_LINE_SIZE())
-
-/** Associativity of the L2 cache. */
-#define CHIP_L2_ASSOC() 2
-
-/** Size of the L1 data cache, in bytes. */
-#define CHIP_L1D_CACHE_SIZE() 8192
-
-/** Log size of an L1 data cache line in bytes. */
-#define CHIP_L1D_LOG_LINE_SIZE() 4
-
-/** Size of an L1 data cache line, in bytes. */
-#define CHIP_L1D_LINE_SIZE() (1 << CHIP_L1D_LOG_LINE_SIZE())
-
-/** Associativity of the L1 data cache. */
-#define CHIP_L1D_ASSOC() 2
-
-/** Size of the L1 instruction cache, in bytes. */
-#define CHIP_L1I_CACHE_SIZE() 8192
-
-/** Log size of an L1 instruction cache line in bytes. */
-#define CHIP_L1I_LOG_LINE_SIZE() 6
-
-/** Size of an L1 instruction cache line, in bytes. */
-#define CHIP_L1I_LINE_SIZE() (1 << CHIP_L1I_LOG_LINE_SIZE())
-
-/** Associativity of the L1 instruction cache. */
-#define CHIP_L1I_ASSOC() 1
-
-/** Stride with which flush instructions must be issued. */
-#define CHIP_FLUSH_STRIDE() CHIP_L2_LINE_SIZE()
-
-/** Stride with which inv instructions must be issued. */
-#define CHIP_INV_STRIDE() CHIP_L1D_LINE_SIZE()
-
-/** Stride with which finv instructions must be issued. */
-#define CHIP_FINV_STRIDE() CHIP_L1D_LINE_SIZE()
-
-/** Can the local cache coherently cache data that is homed elsewhere? */
-#define CHIP_HAS_COHERENT_LOCAL_CACHE() 0
-
-/** How many simultaneous outstanding victims can the L2 cache have? */
-#define CHIP_MAX_OUTSTANDING_VICTIMS() 2
-
-/** Does the TLB support the NC and NOALLOC bits? */
-#define CHIP_HAS_NC_AND_NOALLOC_BITS() 0
-
-/** Does the chip support hash-for-home caching? */
-#define CHIP_HAS_CBOX_HOME_MAP() 0
-
-/** Number of entries in the chip's home map tables. */
-/* #define CHIP_CBOX_HOME_MAP_SIZE() -- does not apply to chip 0 */
-
-/** Do uncacheable requests miss in the cache regardless of whether
- * there is matching data? */
-#define CHIP_HAS_ENFORCED_UNCACHEABLE_REQUESTS() 0
-
-/** Does the mf instruction wait for victims? */
-#define CHIP_HAS_MF_WAITS_FOR_VICTIMS() 1
-
-/** Does the chip have an "inv" instruction that doesn't also flush? */
-#define CHIP_HAS_INV() 0
-
-/** Does the chip have a "wh64" instruction? */
-#define CHIP_HAS_WH64() 0
-
-/** Does this chip have a 'dword_align' instruction? */
-#define CHIP_HAS_DWORD_ALIGN() 0
-
-/** Number of performance counters. */
-#define CHIP_PERFORMANCE_COUNTERS() 2
-
-/** Does this chip have auxiliary performance counters? */
-#define CHIP_HAS_AUX_PERF_COUNTERS() 0
-
-/** Is the CBOX_MSR1 SPR supported? */
-#define CHIP_HAS_CBOX_MSR1() 0
-
-/** Is the TILE_RTF_HWM SPR supported? */
-#define CHIP_HAS_TILE_RTF_HWM() 0
-
-/** Is the TILE_WRITE_PENDING SPR supported? */
-#define CHIP_HAS_TILE_WRITE_PENDING() 0
-
-/** Is the PROC_STATUS SPR supported? */
-#define CHIP_HAS_PROC_STATUS_SPR() 0
-
-/** Is the DSTREAM_PF SPR supported? */
-#define CHIP_HAS_DSTREAM_PF() 0
-
-/** Log of the number of mshims we have. */
-#define CHIP_LOG_NUM_MSHIMS() 2
-
-/** Are the bases of the interrupt vector areas fixed? */
-#define CHIP_HAS_FIXED_INTVEC_BASE() 1
-
-/** Are the interrupt masks split up into 2 SPRs? */
-#define CHIP_HAS_SPLIT_INTR_MASK() 1
-
-/** Is the cycle count split up into 2 SPRs? */
-#define CHIP_HAS_SPLIT_CYCLE() 1
-
-/** Does the chip have a static network? */
-#define CHIP_HAS_SN() 1
-
-/** Does the chip have a static network processor? */
-#define CHIP_HAS_SN_PROC() 1
-
-/** Size of the L1 static network processor instruction cache, in bytes. */
-#define CHIP_L1SNI_CACHE_SIZE() 2048
-
-/** Does the chip have DMA support in each tile? */
-#define CHIP_HAS_TILE_DMA() 1
-
-/** Does the chip have the second revision of the directly accessible
- *  dynamic networks?  This encapsulates a number of characteristics,
- *  including the absence of the catch-all, the absence of inline message
- *  tags, the absence of support for network context-switching, and so on.
- */
-#define CHIP_HAS_REV1_XDN() 0
-
-/** Does the chip have cmpexch and similar (fetchadd, exch, etc.)? */
-#define CHIP_HAS_CMPEXCH() 0
-
-/** Does the chip have memory-mapped I/O support? */
-#define CHIP_HAS_MMIO() 0
-
-/** Does the chip have post-completion interrupts? */
-#define CHIP_HAS_POST_COMPLETION_INTERRUPTS() 0
-
-/** Does the chip have native single step support? */
-#define CHIP_HAS_SINGLE_STEP() 0
-
-#ifndef __OPEN_SOURCE__  /* features only relevant to hypervisor-level code */
-
-/** How many entries are present in the instruction TLB? */
-#define CHIP_ITLB_ENTRIES() 8
-
-/** How many entries are present in the data TLB? */
-#define CHIP_DTLB_ENTRIES() 16
-
-/** How many MAF entries does the XAUI shim have? */
-#define CHIP_XAUI_MAF_ENTRIES() 16
-
-/** Does the memory shim have a source-id table? */
-#define CHIP_HAS_MSHIM_SRCID_TABLE() 1
-
-/** Does the L1 instruction cache clear on reset? */
-#define CHIP_HAS_L1I_CLEAR_ON_RESET() 0
-
-/** Does the chip come out of reset with valid coordinates on all tiles?
- * Note that if defined, this also implies that the upper left is 1,1.
- */
-#define CHIP_HAS_VALID_TILE_COORD_RESET() 0
-
-/** Does the chip have unified packet formats? */
-#define CHIP_HAS_UNIFIED_PACKET_FORMATS() 0
-
-/** Does the chip support write reordering? */
-#define CHIP_HAS_WRITE_REORDERING() 0
-
-/** Does the chip support Y-X routing as well as X-Y? */
-#define CHIP_HAS_Y_X_ROUTING() 0
-
-/** Is INTCTRL_3 managed with the correct MPL? */
-#define CHIP_HAS_INTCTRL_3_STATUS_FIX() 0
-
-/** Is it possible to configure the chip to be big-endian? */
-#define CHIP_HAS_BIG_ENDIAN_CONFIG() 0
-
-/** Is the CACHE_RED_WAY_OVERRIDDEN SPR supported? */
-#define CHIP_HAS_CACHE_RED_WAY_OVERRIDDEN() 0
-
-/** Is the DIAG_TRACE_WAY SPR supported? */
-#define CHIP_HAS_DIAG_TRACE_WAY() 0
-
-/** Is the MEM_STRIPE_CONFIG SPR supported? */
-#define CHIP_HAS_MEM_STRIPE_CONFIG() 0
-
-/** Are the TLB_PERF SPRs supported? */
-#define CHIP_HAS_TLB_PERF() 0
-
-/** Is the VDN_SNOOP_SHIM_CTL SPR supported? */
-#define CHIP_HAS_VDN_SNOOP_SHIM_CTL() 0
-
-/** Does the chip support rev1 DMA packets? */
-#define CHIP_HAS_REV1_DMA_PACKETS() 0
-
-/** Does the chip have an IPI shim? */
-#define CHIP_HAS_IPI() 0
-
-#endif /* !__OPEN_SOURCE__ */
-#endif /* __ARCH_CHIP_H__ */
index c14d02c..d76ff2d 100644 (file)
@@ -61,6 +61,7 @@ typedef tilegx_bundle_bits tile_bundle_bits;
 #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEGX_BUNDLE_ALIGNMENT_IN_BYTES
 #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \
   TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
+#define TILE_BPT_BUNDLE TILEGX_BPT_BUNDLE
 
 /* 64-bit pattern for a { bpt ; nop } bundle. */
 #define TILEGX_BPT_BUNDLE 0x286a44ae51485000ULL
index 71b763b..4451cff 100644 (file)
@@ -71,6 +71,7 @@ typedef tilepro_bundle_bits tile_bundle_bits;
 #define TILE_BUNDLE_ALIGNMENT_IN_BYTES TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES
 #define TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES \
   TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
+#define TILE_BPT_BUNDLE TILEPRO_BPT_BUNDLE
 
 /* 64-bit pattern for a { bpt ; nop } bundle. */
 #define TILEPRO_BPT_BUNDLE 0x400b3cae70166000ULL
index c689446..78daa31 100644 (file)
 #define SPR_SIM_CONTROL 0x4e0c
 #define SPR_SNCTL 0x0805
 #define SPR_SNCTL__FRZFABRIC_MASK  0x1
-#define SPR_SNCTL__FRZPROC_MASK  0x2
-#define SPR_SNPC 0x080b
 #define SPR_SNSTATIC 0x080c
 #define SPR_SYSTEM_SAVE_0_0 0x4b00
 #define SPR_SYSTEM_SAVE_0_1 0x4b01
index 1d393ed..c93e927 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef _ASM_TILE_AUXVEC_H
 #define _ASM_TILE_AUXVEC_H
 
-/* No extensions to auxvec */
+/* The vDSO location. */
+#define AT_SYSINFO_EHDR         33
 
 #endif /* _ASM_TILE_AUXVEC_H */
index af4c9f9..572ddca 100644 (file)
@@ -29,8 +29,8 @@
  * to honor the arguments at some point.)
  *
  * Flush and invalidation of memory can normally be performed with the
- * __insn_flush(), __insn_inv(), and __insn_finv() instructions from
- * userspace.  The DCACHE option to the system call allows userspace
+ * __insn_flush() and __insn_finv() instructions from userspace.
+ * The DCACHE option to the system call allows userspace
  * to flush the entire L1+L2 data cache from the core.  In this case,
  * the address and length arguments are not used.  The DCACHE flush is
  * restricted to the current core, not all cores in the address space.
index 5334be8..27a2bf3 100644 (file)
@@ -3,11 +3,17 @@
 #
 
 extra-y := vmlinux.lds head_$(BITS).o
-obj-y := backtrace.o entry.o irq.o messaging.o \
+obj-y := backtrace.o entry.o hvglue.o irq.o messaging.o \
        pci-dma.o proc.o process.o ptrace.o reboot.o \
-       setup.o signal.o single_step.o stack.o sys.o sysfs.o time.o traps.o \
+       setup.o signal.o single_step.o stack.o sys.o \
+       sysfs.o time.o traps.o unaligned.o vdso.o \
        intvec_$(BITS).o regs_$(BITS).o tile-desc_$(BITS).o
 
+ifdef CONFIG_FUNCTION_TRACER
+CFLAGS_REMOVE_ftrace.o = -pg
+CFLAGS_REMOVE_early_printk.o = -pg
+endif
+
 obj-$(CONFIG_HARDWALL)         += hardwall.o
 obj-$(CONFIG_COMPAT)           += compat.o compat_signal.o
 obj-$(CONFIG_SMP)              += smpboot.o smp.o tlb.o
@@ -20,3 +26,9 @@ else
 obj-$(CONFIG_PCI)              += pci.o
 endif
 obj-$(CONFIG_TILE_USB)         += usb.o
+obj-$(CONFIG_TILE_HVGLUE_TRACE)        += hvglue_trace.o
+obj-$(CONFIG_FUNCTION_TRACER)  += ftrace.o mcount_64.o
+obj-$(CONFIG_KPROBES)          += kprobes.o
+obj-$(CONFIG_KGDB)             += kgdb.o
+
+obj-y                          += vdso/
index 01ddf19..375e7c3 100644 (file)
  * Generates definitions from c-type structures used by assembly sources.
  */
 
-#include <linux/kbuild.h>
-#include <linux/thread_info.h>
-#include <linux/sched.h>
-#include <linux/hardirq.h>
-#include <linux/ptrace.h>
-#include <hv/hypervisor.h>
-
 /* Check for compatible compiler early in the build. */
 #ifdef CONFIG_TILEGX
 # ifndef __tilegx__
 # endif
 #else
 # ifdef __tilegx__
-#  error Can not build TILEPro/TILE64 configurations with tilegx compiler
+#  error Can not build TILEPro configurations with tilegx compiler
 # endif
 #endif
 
+#include <linux/kbuild.h>
+#include <linux/thread_info.h>
+#include <linux/sched.h>
+#include <linux/hardirq.h>
+#include <linux/ptrace.h>
+#include <hv/hypervisor.h>
+
 void foo(void)
 {
-       DEFINE(SINGLESTEP_STATE_BUFFER_OFFSET, \
+       DEFINE(SINGLESTEP_STATE_BUFFER_OFFSET,
               offsetof(struct single_step_state, buffer));
-       DEFINE(SINGLESTEP_STATE_FLAGS_OFFSET, \
+       DEFINE(SINGLESTEP_STATE_FLAGS_OFFSET,
               offsetof(struct single_step_state, flags));
-       DEFINE(SINGLESTEP_STATE_ORIG_PC_OFFSET, \
+       DEFINE(SINGLESTEP_STATE_ORIG_PC_OFFSET,
               offsetof(struct single_step_state, orig_pc));
-       DEFINE(SINGLESTEP_STATE_NEXT_PC_OFFSET, \
+       DEFINE(SINGLESTEP_STATE_NEXT_PC_OFFSET,
               offsetof(struct single_step_state, next_pc));
-       DEFINE(SINGLESTEP_STATE_BRANCH_NEXT_PC_OFFSET, \
+       DEFINE(SINGLESTEP_STATE_BRANCH_NEXT_PC_OFFSET,
               offsetof(struct single_step_state, branch_next_pc));
-       DEFINE(SINGLESTEP_STATE_UPDATE_VALUE_OFFSET, \
+       DEFINE(SINGLESTEP_STATE_UPDATE_VALUE_OFFSET,
               offsetof(struct single_step_state, update_value));
 
-       DEFINE(THREAD_INFO_TASK_OFFSET, \
+       DEFINE(THREAD_INFO_TASK_OFFSET,
               offsetof(struct thread_info, task));
-       DEFINE(THREAD_INFO_FLAGS_OFFSET, \
+       DEFINE(THREAD_INFO_FLAGS_OFFSET,
               offsetof(struct thread_info, flags));
-       DEFINE(THREAD_INFO_STATUS_OFFSET, \
+       DEFINE(THREAD_INFO_STATUS_OFFSET,
               offsetof(struct thread_info, status));
-       DEFINE(THREAD_INFO_HOMECACHE_CPU_OFFSET, \
+       DEFINE(THREAD_INFO_HOMECACHE_CPU_OFFSET,
               offsetof(struct thread_info, homecache_cpu));
-       DEFINE(THREAD_INFO_STEP_STATE_OFFSET, \
+       DEFINE(THREAD_INFO_PREEMPT_COUNT_OFFSET,
+              offsetof(struct thread_info, preempt_count));
+       DEFINE(THREAD_INFO_STEP_STATE_OFFSET,
               offsetof(struct thread_info, step_state));
+#ifdef __tilegx__
+       DEFINE(THREAD_INFO_UNALIGN_JIT_BASE_OFFSET,
+              offsetof(struct thread_info, unalign_jit_base));
+       DEFINE(THREAD_INFO_UNALIGN_JIT_TMP_OFFSET,
+              offsetof(struct thread_info, unalign_jit_tmp));
+#endif
 
        DEFINE(TASK_STRUCT_THREAD_KSP_OFFSET,
               offsetof(struct task_struct, thread.ksp));
        DEFINE(TASK_STRUCT_THREAD_PC_OFFSET,
               offsetof(struct task_struct, thread.pc));
 
-       DEFINE(HV_TOPOLOGY_WIDTH_OFFSET, \
+       DEFINE(HV_TOPOLOGY_WIDTH_OFFSET,
               offsetof(HV_Topology, width));
-       DEFINE(HV_TOPOLOGY_HEIGHT_OFFSET, \
+       DEFINE(HV_TOPOLOGY_HEIGHT_OFFSET,
               offsetof(HV_Topology, height));
 
-       DEFINE(IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET, \
+       DEFINE(IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET,
               offsetof(irq_cpustat_t, irq_syscall_count));
 }
index d0a052e..85e00b2 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/ucontext.h>
 #include <asm/sigframe.h>
 #include <asm/syscalls.h>
+#include <asm/vdso.h>
 #include <arch/interrupts.h>
 
 struct compat_ucontext {
@@ -227,7 +228,7 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        if (err)
                goto give_sigsegv;
 
-       restorer = VDSO_BASE;
+       restorer = VDSO_SYM(&__vdso_rt_sigreturn);
        if (ka->sa.sa_flags & SA_RESTORER)
                restorer = ptr_to_compat_reg(ka->sa.sa_restorer);
 
index 34d72a1..b608e00 100644 (file)
 
 static void early_hv_write(struct console *con, const char *s, unsigned n)
 {
-       hv_console_write((HV_VirtAddr) s, n);
+       tile_console_write(s, n);
+
+       /*
+        * Convert NL to NLCR (close enough to CRNL) during early boot.
+        * We assume newlines are at the ends of strings, which turns out
+        * to be good enough for early boot console output.
+        */
+       if (n && s[n-1] == '\n')
+               tile_console_write("\r", 1);
 }
 
 static struct console early_hv_console = {
        .name =         "earlyhv",
        .write =        early_hv_write,
-       .flags =        CON_PRINTBUFFER,
+       .flags =        CON_PRINTBUFFER | CON_BOOT,
        .index =        -1,
 };
 
-/* Direct interface for emergencies */
-static int early_console_complete;
-
 void early_panic(const char *fmt, ...)
 {
        va_list ap;
@@ -43,51 +48,21 @@ void early_panic(const char *fmt, ...)
        va_start(ap, fmt);
        early_printk("Kernel panic - not syncing: ");
        early_vprintk(fmt, ap);
-       early_console->write(early_console, "\n", 1);
+       early_printk("\n");
        va_end(ap);
        dump_stack();
        hv_halt();
 }
 
-static int __initdata keep_early;
-
 static int __init setup_early_printk(char *str)
 {
        if (early_console)
                return 1;
 
-       if (str != NULL && strncmp(str, "keep", 4) == 0)
-               keep_early = 1;
-
        early_console = &early_hv_console;
        register_console(early_console);
 
        return 0;
 }
 
-void __init disable_early_printk(void)
-{
-       early_console_complete = 1;
-       if (!early_console)
-               return;
-       if (!keep_early) {
-               early_printk("disabling early console\n");
-               unregister_console(early_console);
-               early_console = NULL;
-       } else {
-               early_printk("keeping early console\n");
-       }
-}
-
-void warn_early_printk(void)
-{
-       if (early_console_complete || early_console)
-               return;
-       early_printk("\
-Machine shutting down before console output is fully initialized.\n\
-You may wish to reboot and add the option 'earlyprintk' to your\n\
-boot command line to see any diagnostic early console output.\n\
-");
-}
-
 early_param("earlyprintk", setup_early_printk);
index f116cb0..3d91759 100644 (file)
@@ -27,22 +27,6 @@ STD_ENTRY(current_text_addr)
        { move r0, lr; jrp lr }
        STD_ENDPROC(current_text_addr)
 
-/*
- * We don't run this function directly, but instead copy it to a page
- * we map into every user process.  See vdso_setup().
- *
- * Note that libc has a copy of this function that it uses to compare
- * against the PC when a stack backtrace ends, so if this code is
- * changed, the libc implementation(s) should also be updated.
- */
-       .pushsection .data
-ENTRY(__rt_sigreturn)
-       moveli TREG_SYSCALL_NR_NAME,__NR_rt_sigreturn
-       swint1
-       ENDPROC(__rt_sigreturn)
-       ENTRY(__rt_sigreturn_end)
-       .popsection
-
 STD_ENTRY(dump_stack)
        { move r2, lr; lnk r1 }
        { move r4, r52; addli r1, r1, dump_stack - . }
diff --git a/arch/tile/kernel/ftrace.c b/arch/tile/kernel/ftrace.c
new file mode 100644 (file)
index 0000000..f1c4520
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ *
+ * TILE-Gx specific ftrace support
+ */
+
+#include <linux/ftrace.h>
+#include <linux/uaccess.h>
+
+#include <asm/cacheflush.h>
+#include <asm/ftrace.h>
+#include <asm/sections.h>
+
+#include <arch/opcode.h>
+
+#ifdef CONFIG_DYNAMIC_FTRACE
+
+static inline tilegx_bundle_bits NOP(void)
+{
+       return create_UnaryOpcodeExtension_X0(FNOP_UNARY_OPCODE_X0) |
+               create_RRROpcodeExtension_X0(UNARY_RRR_0_OPCODE_X0) |
+               create_Opcode_X0(RRR_0_OPCODE_X0) |
+               create_UnaryOpcodeExtension_X1(NOP_UNARY_OPCODE_X1) |
+               create_RRROpcodeExtension_X1(UNARY_RRR_0_OPCODE_X1) |
+               create_Opcode_X1(RRR_0_OPCODE_X1);
+}
+
+static int machine_stopped __read_mostly;
+
+int ftrace_arch_code_modify_prepare(void)
+{
+       machine_stopped = 1;
+       return 0;
+}
+
+int ftrace_arch_code_modify_post_process(void)
+{
+       flush_icache_range(0, CHIP_L1I_CACHE_SIZE());
+       machine_stopped = 0;
+       return 0;
+}
+
+/*
+ * Put { move r10, lr; jal ftrace_caller } in a bundle, this lets dynamic
+ * tracer just add one cycle overhead to every kernel function when disabled.
+ */
+static unsigned long ftrace_gen_branch(unsigned long pc, unsigned long addr,
+                                      bool link)
+{
+       tilegx_bundle_bits opcode_x0, opcode_x1;
+       long pcrel_by_instr = (addr - pc) >> TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES;
+
+       if (link) {
+               /* opcode: jal addr */
+               opcode_x1 =
+                       create_Opcode_X1(JUMP_OPCODE_X1) |
+                       create_JumpOpcodeExtension_X1(JAL_JUMP_OPCODE_X1) |
+                       create_JumpOff_X1(pcrel_by_instr);
+       } else {
+               /* opcode: j addr */
+               opcode_x1 =
+                       create_Opcode_X1(JUMP_OPCODE_X1) |
+                       create_JumpOpcodeExtension_X1(J_JUMP_OPCODE_X1) |
+                       create_JumpOff_X1(pcrel_by_instr);
+       }
+
+       if (addr == FTRACE_ADDR) {
+               /* opcode: or r10, lr, zero */
+               opcode_x0 =
+                       create_Dest_X0(10) |
+                       create_SrcA_X0(TREG_LR) |
+                       create_SrcB_X0(TREG_ZERO) |
+                       create_RRROpcodeExtension_X0(OR_RRR_0_OPCODE_X0) |
+                       create_Opcode_X0(RRR_0_OPCODE_X0);
+       } else {
+               /* opcode: fnop */
+               opcode_x0 =
+                       create_UnaryOpcodeExtension_X0(FNOP_UNARY_OPCODE_X0) |
+                       create_RRROpcodeExtension_X0(UNARY_RRR_0_OPCODE_X0) |
+                       create_Opcode_X0(RRR_0_OPCODE_X0);
+       }
+
+       return opcode_x1 | opcode_x0;
+}
+
+static unsigned long ftrace_nop_replace(struct dyn_ftrace *rec)
+{
+       return NOP();
+}
+
+static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr)
+{
+       return ftrace_gen_branch(pc, addr, true);
+}
+
+static int ftrace_modify_code(unsigned long pc, unsigned long old,
+                             unsigned long new)
+{
+       unsigned long pc_wr;
+
+       /* Check if the address is in kernel text space and module space. */
+       if (!kernel_text_address(pc))
+               return -EINVAL;
+
+       /* Operate on writable kernel text mapping. */
+       pc_wr = pc - MEM_SV_START + PAGE_OFFSET;
+
+       if (probe_kernel_write((void *)pc_wr, &new, MCOUNT_INSN_SIZE))
+               return -EPERM;
+
+       smp_wmb();
+
+       if (!machine_stopped && num_online_cpus() > 1)
+               flush_icache_range(pc, pc + MCOUNT_INSN_SIZE);
+
+       return 0;
+}
+
+int ftrace_update_ftrace_func(ftrace_func_t func)
+{
+       unsigned long pc, old;
+       unsigned long new;
+       int ret;
+
+       pc = (unsigned long)&ftrace_call;
+       memcpy(&old, &ftrace_call, MCOUNT_INSN_SIZE);
+       new = ftrace_call_replace(pc, (unsigned long)func);
+
+       ret = ftrace_modify_code(pc, old, new);
+
+       return ret;
+}
+
+int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
+{
+       unsigned long new, old;
+       unsigned long ip = rec->ip;
+
+       old = ftrace_nop_replace(rec);
+       new = ftrace_call_replace(ip, addr);
+
+       return ftrace_modify_code(rec->ip, old, new);
+}
+
+int ftrace_make_nop(struct module *mod,
+                   struct dyn_ftrace *rec, unsigned long addr)
+{
+       unsigned long ip = rec->ip;
+       unsigned long old;
+       unsigned long new;
+       int ret;
+
+       old = ftrace_call_replace(ip, addr);
+       new = ftrace_nop_replace(rec);
+       ret = ftrace_modify_code(ip, old, new);
+
+       return ret;
+}
+
+int __init ftrace_dyn_arch_init(void *data)
+{
+       *(unsigned long *)data = 0;
+
+       return 0;
+}
+#endif /* CONFIG_DYNAMIC_FTRACE */
+
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
+                          unsigned long frame_pointer)
+{
+       unsigned long return_hooker = (unsigned long) &return_to_handler;
+       struct ftrace_graph_ent trace;
+       unsigned long old;
+       int err;
+
+       if (unlikely(atomic_read(&current->tracing_graph_pause)))
+               return;
+
+       old = *parent;
+       *parent = return_hooker;
+
+       err = ftrace_push_return_trace(old, self_addr, &trace.depth,
+                                      frame_pointer);
+       if (err == -EBUSY) {
+               *parent = old;
+               return;
+       }
+
+       trace.func = self_addr;
+
+       /* Only trace if the calling function expects to */
+       if (!ftrace_graph_entry(&trace)) {
+               current->curr_ret_stack--;
+               *parent = old;
+       }
+}
+
+#ifdef CONFIG_DYNAMIC_FTRACE
+extern unsigned long ftrace_graph_call;
+
+static int __ftrace_modify_caller(unsigned long *callsite,
+                                 void (*func) (void), bool enable)
+{
+       unsigned long caller_fn = (unsigned long) func;
+       unsigned long pc = (unsigned long) callsite;
+       unsigned long branch = ftrace_gen_branch(pc, caller_fn, false);
+       unsigned long nop = NOP();
+       unsigned long old = enable ? nop : branch;
+       unsigned long new = enable ? branch : nop;
+
+       return ftrace_modify_code(pc, old, new);
+}
+
+static int ftrace_modify_graph_caller(bool enable)
+{
+       int ret;
+
+       ret = __ftrace_modify_caller(&ftrace_graph_call,
+                                    ftrace_graph_caller,
+                                    enable);
+
+       return ret;
+}
+
+int ftrace_enable_ftrace_graph_caller(void)
+{
+       return ftrace_modify_graph_caller(true);
+}
+
+int ftrace_disable_ftrace_graph_caller(void)
+{
+       return ftrace_modify_graph_caller(false);
+}
+#endif /* CONFIG_DYNAMIC_FTRACE */
+#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
index 38ac189..df27a1f 100644 (file)
@@ -272,9 +272,9 @@ static void hardwall_setup_func(void *info)
        struct hardwall_info *r = info;
        struct hardwall_type *hwt = r->type;
 
-       int cpu = smp_processor_id();
-       int x = cpu % smp_width;
-       int y = cpu / smp_width;
+       int cpu = smp_processor_id();  /* on_each_cpu disables preemption */
+       int x = cpu_x(cpu);
+       int y = cpu_y(cpu);
        int bits = 0;
        if (x == r->ulhc_x)
                bits |= W_PROTECT;
@@ -317,6 +317,7 @@ static void hardwall_protect_rectangle(struct hardwall_info *r)
        on_each_cpu_mask(&rect_cpus, hardwall_setup_func, r, 1);
 }
 
+/* Entered from INT_xDN_FIREWALL interrupt vector with irqs disabled. */
 void __kprobes do_hardwall_trap(struct pt_regs* regs, int fault_num)
 {
        struct hardwall_info *rect;
@@ -325,7 +326,6 @@ void __kprobes do_hardwall_trap(struct pt_regs* regs, int fault_num)
        struct siginfo info;
        int cpu = smp_processor_id();
        int found_processes;
-       unsigned long flags;
        struct pt_regs *old_regs = set_irq_regs(regs);
 
        irq_enter();
@@ -346,7 +346,7 @@ void __kprobes do_hardwall_trap(struct pt_regs* regs, int fault_num)
        BUG_ON(hwt->disabled);
 
        /* This tile trapped a network access; find the rectangle. */
-       spin_lock_irqsave(&hwt->lock, flags);
+       spin_lock(&hwt->lock);
        list_for_each_entry(rect, &hwt->list, list) {
                if (cpumask_test_cpu(cpu, &rect->cpumask))
                        break;
@@ -401,7 +401,7 @@ void __kprobes do_hardwall_trap(struct pt_regs* regs, int fault_num)
                pr_notice("hardwall: no associated processes!\n");
 
  done:
-       spin_unlock_irqrestore(&hwt->lock, flags);
+       spin_unlock(&hwt->lock);
 
        /*
         * We have to disable firewall interrupts now, or else when we
@@ -540,6 +540,14 @@ static struct hardwall_info *hardwall_create(struct hardwall_type *hwt,
                }
        }
 
+       /*
+        * Eliminate cpus that are not part of this Linux client.
+        * Note that this allows for configurations that we might not want to
+        * support, such as one client on every even cpu, another client on
+        * every odd cpu.
+        */
+       cpumask_and(&info->cpumask, &info->cpumask, cpu_online_mask);
+
        /* Confirm it doesn't overlap and add it to the list. */
        spin_lock_irqsave(&hwt->lock, flags);
        list_for_each_entry(iter, &hwt->list, list) {
@@ -612,7 +620,7 @@ static int hardwall_activate(struct hardwall_info *info)
 
 /*
  * Deactivate a task's hardwall.  Must hold lock for hardwall_type.
- * This method may be called from free_task(), so we don't want to
+ * This method may be called from exit_thread(), so we don't want to
  * rely on too many fields of struct task_struct still being valid.
  * We assume the cpus_allowed, pid, and comm fields are still valid.
  */
@@ -653,7 +661,7 @@ static int hardwall_deactivate(struct hardwall_type *hwt,
                return -EINVAL;
 
        printk(KERN_DEBUG "Pid %d (%s) deactivated for %s hardwall: cpu %d\n",
-              task->pid, task->comm, hwt->name, smp_processor_id());
+              task->pid, task->comm, hwt->name, raw_smp_processor_id());
        return 0;
 }
 
@@ -795,8 +803,8 @@ static void reset_xdn_network_state(struct hardwall_type *hwt)
        /* Reset UDN coordinates to their standard value */
        {
                unsigned int cpu = smp_processor_id();
-               unsigned int x = cpu % smp_width;
-               unsigned int y = cpu / smp_width;
+               unsigned int x = cpu_x(cpu);
+               unsigned int y = cpu_y(cpu);
                __insn_mtspr(SPR_UDN_TILE_COORD, (x << 18) | (y << 7));
        }
 
index ac11530..8d5b40f 100644 (file)
@@ -39,12 +39,12 @@ ENTRY(_start)
        }
        {
          moveli r0, _HV_VERSION_OLD_HV_INIT
-         jal hv_init
+         jal _hv_init
        }
        /* Get a reasonable default ASID in r0 */
        {
          move r0, zero
-         jal hv_inquire_asid
+         jal _hv_inquire_asid
        }
        /* Install the default page table */
        {
@@ -64,7 +64,7 @@ ENTRY(_start)
          auli r0, r0, ha16(swapper_pg_dir - PAGE_OFFSET)
        }
        {
-         inv r6
+         finv r6
          move r1, zero   /* high 32 bits of CPA is zero */
        }
        {
@@ -73,12 +73,12 @@ ENTRY(_start)
        }
        {
          auli lr, lr, ha16(1f)
-         j hv_install_context
+         j _hv_install_context
        }
 1:
 
        /* Get our processor number and save it away in SAVE_K_0. */
-       jal hv_inquire_topology
+       jal _hv_inquire_topology
        mulll_uu r4, r1, r2        /* r1 == y, r2 == width */
        add r4, r4, r0             /* r0 == x, so r4 == cpu == y*width + x */
 
@@ -86,7 +86,7 @@ ENTRY(_start)
        /*
         * Load up our per-cpu offset.  When the first (master) tile
         * boots, this value is still zero, so we will load boot_pc
-        * with start_kernel, and boot_sp with init_stack + THREAD_SIZE.
+        * with start_kernel, and boot_sp at the top of init_stack.
         * The master tile initializes the per-cpu offset array, so that
         * when subsequent (secondary) tiles boot, they will instead load
         * from their per-cpu versions of boot_sp and boot_pc.
@@ -126,7 +126,6 @@ ENTRY(_start)
        lw sp, r1
        or r4, sp, r4
        mtspr SPR_SYSTEM_SAVE_K_0, r4  /* save ksp0 + cpu */
-       addi sp, sp, -STACK_TOP_DELTA
        {
          move lr, zero   /* stop backtraces in the called function */
          jr r0
@@ -163,8 +162,8 @@ ENTRY(swapper_pg_dir)
        .set addr, addr + PGDIR_SIZE
        .endr
 
-       /* The true text VAs are mapped as VA = PA + MEM_SV_INTRPT */
-       PTE MEM_SV_INTRPT, 0, (1 << (HV_PTE_INDEX_READABLE - 32)) | \
+       /* The true text VAs are mapped as VA = PA + MEM_SV_START */
+       PTE MEM_SV_START, 0, (1 << (HV_PTE_INDEX_READABLE - 32)) | \
                              (1 << (HV_PTE_INDEX_EXECUTABLE - 32))
        .org swapper_pg_dir + PGDIR_SIZE
        END(swapper_pg_dir)
index 6093964..bd0e12f 100644 (file)
 #include <arch/chip.h>
 #include <arch/spr_def.h>
 
+/* Extract two 32-bit bit values that were read into one register. */
+#ifdef __BIG_ENDIAN__
+#define GET_FIRST_INT(rd, rs) shrsi rd, rs, 32
+#define GET_SECOND_INT(rd, rs) addxi rd, rs, 0
+#else
+#define GET_FIRST_INT(rd, rs) addxi rd, rs, 0
+#define GET_SECOND_INT(rd, rs) shrsi rd, rs, 32
+#endif
+
 /*
  * This module contains the entry code for kernel images. It performs the
  * minimal setup needed to call the generic C routines.
@@ -46,11 +55,11 @@ ENTRY(_start)
          movei r2, TILE_CHIP_REV
          movei r3, KERNEL_PL
        }
-       jal hv_init
+       jal _hv_init
        /* Get a reasonable default ASID in r0 */
        {
          move r0, zero
-         jal hv_inquire_asid
+         jal _hv_inquire_asid
        }
 
        /*
@@ -61,7 +70,7 @@ ENTRY(_start)
         * other CPUs should see a properly-constructed page table.
         */
        {
-         v4int_l r2, zero, r0    /* ASID for hv_install_context */
+         GET_FIRST_INT(r2, r0)    /* ASID for hv_install_context */
          moveli r4, hw1_last(swapper_pgprot - PAGE_OFFSET)
        }
        {
@@ -77,7 +86,7 @@ ENTRY(_start)
        {
          /* After initializing swapper_pgprot, HV_PTE_GLOBAL is set. */
          bfextu r7, r1, HV_PTE_INDEX_GLOBAL, HV_PTE_INDEX_GLOBAL
-         inv r4
+         finv r4
        }
        bnez r7, .Lno_write
        {
@@ -121,29 +130,24 @@ ENTRY(_start)
        }
        {
          moveli r3, CTX_PAGE_FLAG
-         j hv_install_context
+         j _hv_install_context
        }
 1:
 
        /* Install the interrupt base. */
-       moveli r0, hw2_last(MEM_SV_START)
-       shl16insli r0, r0, hw1(MEM_SV_START)
-       shl16insli r0, r0, hw0(MEM_SV_START)
+       moveli r0, hw2_last(intrpt_start)
+       shl16insli r0, r0, hw1(intrpt_start)
+       shl16insli r0, r0, hw0(intrpt_start)
        mtspr SPR_INTERRUPT_VECTOR_BASE_K, r0
 
-       /*
-        * Get our processor number and save it away in SAVE_K_0.
-        * Extract stuff from the topology structure: r4 = y, r6 = x,
-        * r5 = width.  FIXME: consider whether we want to just make these
-        * 64-bit values (and if so fix smp_topology write below, too).
-        */
-       jal hv_inquire_topology
+       /* Get our processor number and save it away in SAVE_K_0. */
+       jal _hv_inquire_topology
        {
-         v4int_l r5, zero, r1    /* r5 = width */
-         shrui r4, r0, 32        /* r4 = y */
+         GET_FIRST_INT(r5, r1)   /* r5 = width */
+         GET_SECOND_INT(r4, r0)  /* r4 = y */
        }
        {
-         v4int_l r6, zero, r0    /* r6 = x */
+         GET_FIRST_INT(r6, r0)   /* r6 = x */
          mul_lu_lu r4, r4, r5
        }
        {
@@ -154,7 +158,7 @@ ENTRY(_start)
        /*
         * Load up our per-cpu offset.  When the first (master) tile
         * boots, this value is still zero, so we will load boot_pc
-        * with start_kernel, and boot_sp with init_stack + THREAD_SIZE.
+        * with start_kernel, and boot_sp with at the top of init_stack.
         * The master tile initializes the per-cpu offset array, so that
         * when subsequent (secondary) tiles boot, they will instead load
         * from their per-cpu versions of boot_sp and boot_pc.
@@ -198,9 +202,9 @@ ENTRY(_start)
        }
        ld r0, r0
        ld sp, r1
-       or r4, sp, r4
+       shli r4, r4, CPU_SHIFT
+       bfins r4, sp, 0, CPU_SHIFT-1
        mtspr SPR_SYSTEM_SAVE_K_0, r4  /* save ksp0 + cpu */
-       addi sp, sp, -STACK_TOP_DELTA
        {
          move lr, zero   /* stop backtraces in the called function */
          jr r0
diff --git a/arch/tile/kernel/hvglue.S b/arch/tile/kernel/hvglue.S
new file mode 100644 (file)
index 0000000..2ab4566
--- /dev/null
@@ -0,0 +1,74 @@
+/* Hypervisor call vector addresses; see <hv/hypervisor.h> */
+.macro gensym sym, val, size
+.org \val
+.global _\sym
+.type _\sym,function
+_\sym:
+.size _\sym,\size
+#ifndef CONFIG_TILE_HVGLUE_TRACE
+.globl \sym
+.set \sym,_\sym
+#endif
+.endm
+
+.section .hvglue,"x",@nobits
+.align 8
+gensym hv_init, 0x20, 32
+gensym hv_install_context, 0x40, 32
+gensym hv_sysconf, 0x60, 32
+gensym hv_get_rtc, 0x80, 32
+gensym hv_set_rtc, 0xa0, 32
+gensym hv_flush_asid, 0xc0, 32
+gensym hv_flush_page, 0xe0, 32
+gensym hv_flush_pages, 0x100, 32
+gensym hv_restart, 0x120, 32
+gensym hv_halt, 0x140, 32
+gensym hv_power_off, 0x160, 32
+gensym hv_inquire_physical, 0x180, 32
+gensym hv_inquire_memory_controller, 0x1a0, 32
+gensym hv_inquire_virtual, 0x1c0, 32
+gensym hv_inquire_asid, 0x1e0, 32
+gensym hv_nanosleep, 0x200, 32
+gensym hv_console_read_if_ready, 0x220, 32
+gensym hv_console_write, 0x240, 32
+gensym hv_downcall_dispatch, 0x260, 32
+gensym hv_inquire_topology, 0x280, 32
+gensym hv_fs_findfile, 0x2a0, 32
+gensym hv_fs_fstat, 0x2c0, 32
+gensym hv_fs_pread, 0x2e0, 32
+gensym hv_physaddr_read64, 0x300, 32
+gensym hv_physaddr_write64, 0x320, 32
+gensym hv_get_command_line, 0x340, 32
+gensym hv_set_caching, 0x360, 32
+gensym hv_bzero_page, 0x380, 32
+gensym hv_register_message_state, 0x3a0, 32
+gensym hv_send_message, 0x3c0, 32
+gensym hv_receive_message, 0x3e0, 32
+gensym hv_inquire_context, 0x400, 32
+gensym hv_start_all_tiles, 0x420, 32
+gensym hv_dev_open, 0x440, 32
+gensym hv_dev_close, 0x460, 32
+gensym hv_dev_pread, 0x480, 32
+gensym hv_dev_pwrite, 0x4a0, 32
+gensym hv_dev_poll, 0x4c0, 32
+gensym hv_dev_poll_cancel, 0x4e0, 32
+gensym hv_dev_preada, 0x500, 32
+gensym hv_dev_pwritea, 0x520, 32
+gensym hv_flush_remote, 0x540, 32
+gensym hv_console_putc, 0x560, 32
+gensym hv_inquire_tiles, 0x580, 32
+gensym hv_confstr, 0x5a0, 32
+gensym hv_reexec, 0x5c0, 32
+gensym hv_set_command_line, 0x5e0, 32
+gensym hv_clear_intr, 0x600, 32
+gensym hv_enable_intr, 0x620, 32
+gensym hv_disable_intr, 0x640, 32
+gensym hv_raise_intr, 0x660, 32
+gensym hv_trigger_ipi, 0x680, 32
+gensym hv_store_mapping, 0x6a0, 32
+gensym hv_inquire_realpa, 0x6c0, 32
+gensym hv_flush_all, 0x6e0, 32
+gensym hv_get_ipi_pte, 0x700, 32
+gensym hv_set_pte_super_shift, 0x720, 32
+gensym hv_console_set_ipi, 0x7e0, 32
+gensym hv_glue_internals, 0x800, 30720
diff --git a/arch/tile/kernel/hvglue.lds b/arch/tile/kernel/hvglue.lds
deleted file mode 100644 (file)
index d44c5a6..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Hypervisor call vector addresses; see <hv/hypervisor.h> */
-hv_init = TEXT_OFFSET + 0x10020;
-hv_install_context = TEXT_OFFSET + 0x10040;
-hv_sysconf = TEXT_OFFSET + 0x10060;
-hv_get_rtc = TEXT_OFFSET + 0x10080;
-hv_set_rtc = TEXT_OFFSET + 0x100a0;
-hv_flush_asid = TEXT_OFFSET + 0x100c0;
-hv_flush_page = TEXT_OFFSET + 0x100e0;
-hv_flush_pages = TEXT_OFFSET + 0x10100;
-hv_restart = TEXT_OFFSET + 0x10120;
-hv_halt = TEXT_OFFSET + 0x10140;
-hv_power_off = TEXT_OFFSET + 0x10160;
-hv_inquire_physical = TEXT_OFFSET + 0x10180;
-hv_inquire_memory_controller = TEXT_OFFSET + 0x101a0;
-hv_inquire_virtual = TEXT_OFFSET + 0x101c0;
-hv_inquire_asid = TEXT_OFFSET + 0x101e0;
-hv_nanosleep = TEXT_OFFSET + 0x10200;
-hv_console_read_if_ready = TEXT_OFFSET + 0x10220;
-hv_console_write = TEXT_OFFSET + 0x10240;
-hv_downcall_dispatch = TEXT_OFFSET + 0x10260;
-hv_inquire_topology = TEXT_OFFSET + 0x10280;
-hv_fs_findfile = TEXT_OFFSET + 0x102a0;
-hv_fs_fstat = TEXT_OFFSET + 0x102c0;
-hv_fs_pread = TEXT_OFFSET + 0x102e0;
-hv_physaddr_read64 = TEXT_OFFSET + 0x10300;
-hv_physaddr_write64 = TEXT_OFFSET + 0x10320;
-hv_get_command_line = TEXT_OFFSET + 0x10340;
-hv_set_caching = TEXT_OFFSET + 0x10360;
-hv_bzero_page = TEXT_OFFSET + 0x10380;
-hv_register_message_state = TEXT_OFFSET + 0x103a0;
-hv_send_message = TEXT_OFFSET + 0x103c0;
-hv_receive_message = TEXT_OFFSET + 0x103e0;
-hv_inquire_context = TEXT_OFFSET + 0x10400;
-hv_start_all_tiles = TEXT_OFFSET + 0x10420;
-hv_dev_open = TEXT_OFFSET + 0x10440;
-hv_dev_close = TEXT_OFFSET + 0x10460;
-hv_dev_pread = TEXT_OFFSET + 0x10480;
-hv_dev_pwrite = TEXT_OFFSET + 0x104a0;
-hv_dev_poll = TEXT_OFFSET + 0x104c0;
-hv_dev_poll_cancel = TEXT_OFFSET + 0x104e0;
-hv_dev_preada = TEXT_OFFSET + 0x10500;
-hv_dev_pwritea = TEXT_OFFSET + 0x10520;
-hv_flush_remote = TEXT_OFFSET + 0x10540;
-hv_console_putc = TEXT_OFFSET + 0x10560;
-hv_inquire_tiles = TEXT_OFFSET + 0x10580;
-hv_confstr = TEXT_OFFSET + 0x105a0;
-hv_reexec = TEXT_OFFSET + 0x105c0;
-hv_set_command_line = TEXT_OFFSET + 0x105e0;
-hv_clear_intr = TEXT_OFFSET + 0x10600;
-hv_enable_intr = TEXT_OFFSET + 0x10620;
-hv_disable_intr = TEXT_OFFSET + 0x10640;
-hv_raise_intr = TEXT_OFFSET + 0x10660;
-hv_trigger_ipi = TEXT_OFFSET + 0x10680;
-hv_store_mapping = TEXT_OFFSET + 0x106a0;
-hv_inquire_realpa = TEXT_OFFSET + 0x106c0;
-hv_flush_all = TEXT_OFFSET + 0x106e0;
-hv_get_ipi_pte = TEXT_OFFSET + 0x10700;
-hv_set_pte_super_shift = TEXT_OFFSET + 0x10720;
-hv_glue_internals = TEXT_OFFSET + 0x10740;
diff --git a/arch/tile/kernel/hvglue_trace.c b/arch/tile/kernel/hvglue_trace.c
new file mode 100644 (file)
index 0000000..85c74ad
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+/*
+ * Pull in the hypervisor header so we declare all the ABI functions
+ * with the underscore versions, then undef the names so that we can
+ * provide our own wrapper versions.
+ */
+#define hv_init _hv_init
+#define hv_install_context _hv_install_context
+#define hv_sysconf _hv_sysconf
+#define hv_get_rtc _hv_get_rtc
+#define hv_set_rtc _hv_set_rtc
+#define hv_flush_asid _hv_flush_asid
+#define hv_flush_page _hv_flush_page
+#define hv_flush_pages _hv_flush_pages
+#define hv_restart _hv_restart
+#define hv_halt _hv_halt
+#define hv_power_off _hv_power_off
+#define hv_inquire_physical _hv_inquire_physical
+#define hv_inquire_memory_controller _hv_inquire_memory_controller
+#define hv_inquire_virtual _hv_inquire_virtual
+#define hv_inquire_asid _hv_inquire_asid
+#define hv_nanosleep _hv_nanosleep
+#define hv_console_read_if_ready _hv_console_read_if_ready
+#define hv_console_write _hv_console_write
+#define hv_downcall_dispatch _hv_downcall_dispatch
+#define hv_inquire_topology _hv_inquire_topology
+#define hv_fs_findfile _hv_fs_findfile
+#define hv_fs_fstat _hv_fs_fstat
+#define hv_fs_pread _hv_fs_pread
+#define hv_physaddr_read64 _hv_physaddr_read64
+#define hv_physaddr_write64 _hv_physaddr_write64
+#define hv_get_command_line _hv_get_command_line
+#define hv_set_caching _hv_set_caching
+#define hv_bzero_page _hv_bzero_page
+#define hv_register_message_state _hv_register_message_state
+#define hv_send_message _hv_send_message
+#define hv_receive_message _hv_receive_message
+#define hv_inquire_context _hv_inquire_context
+#define hv_start_all_tiles _hv_start_all_tiles
+#define hv_dev_open _hv_dev_open
+#define hv_dev_close _hv_dev_close
+#define hv_dev_pread _hv_dev_pread
+#define hv_dev_pwrite _hv_dev_pwrite
+#define hv_dev_poll _hv_dev_poll
+#define hv_dev_poll_cancel _hv_dev_poll_cancel
+#define hv_dev_preada _hv_dev_preada
+#define hv_dev_pwritea _hv_dev_pwritea
+#define hv_flush_remote _hv_flush_remote
+#define hv_console_putc _hv_console_putc
+#define hv_inquire_tiles _hv_inquire_tiles
+#define hv_confstr _hv_confstr
+#define hv_reexec _hv_reexec
+#define hv_set_command_line _hv_set_command_line
+#define hv_clear_intr _hv_clear_intr
+#define hv_enable_intr _hv_enable_intr
+#define hv_disable_intr _hv_disable_intr
+#define hv_raise_intr _hv_raise_intr
+#define hv_trigger_ipi _hv_trigger_ipi
+#define hv_store_mapping _hv_store_mapping
+#define hv_inquire_realpa _hv_inquire_realpa
+#define hv_flush_all _hv_flush_all
+#define hv_get_ipi_pte _hv_get_ipi_pte
+#define hv_set_pte_super_shift _hv_set_pte_super_shift
+#define hv_console_set_ipi _hv_console_set_ipi
+#include <hv/hypervisor.h>
+#undef hv_init
+#undef hv_install_context
+#undef hv_sysconf
+#undef hv_get_rtc
+#undef hv_set_rtc
+#undef hv_flush_asid
+#undef hv_flush_page
+#undef hv_flush_pages
+#undef hv_restart
+#undef hv_halt
+#undef hv_power_off
+#undef hv_inquire_physical
+#undef hv_inquire_memory_controller
+#undef hv_inquire_virtual
+#undef hv_inquire_asid
+#undef hv_nanosleep
+#undef hv_console_read_if_ready
+#undef hv_console_write
+#undef hv_downcall_dispatch
+#undef hv_inquire_topology
+#undef hv_fs_findfile
+#undef hv_fs_fstat
+#undef hv_fs_pread
+#undef hv_physaddr_read64
+#undef hv_physaddr_write64
+#undef hv_get_command_line
+#undef hv_set_caching
+#undef hv_bzero_page
+#undef hv_register_message_state
+#undef hv_send_message
+#undef hv_receive_message
+#undef hv_inquire_context
+#undef hv_start_all_tiles
+#undef hv_dev_open
+#undef hv_dev_close
+#undef hv_dev_pread
+#undef hv_dev_pwrite
+#undef hv_dev_poll
+#undef hv_dev_poll_cancel
+#undef hv_dev_preada
+#undef hv_dev_pwritea
+#undef hv_flush_remote
+#undef hv_console_putc
+#undef hv_inquire_tiles
+#undef hv_confstr
+#undef hv_reexec
+#undef hv_set_command_line
+#undef hv_clear_intr
+#undef hv_enable_intr
+#undef hv_disable_intr
+#undef hv_raise_intr
+#undef hv_trigger_ipi
+#undef hv_store_mapping
+#undef hv_inquire_realpa
+#undef hv_flush_all
+#undef hv_get_ipi_pte
+#undef hv_set_pte_super_shift
+#undef hv_console_set_ipi
+
+/*
+ * Provide macros based on <linux/syscalls.h> to provide a wrapper
+ * function that invokes the same function with an underscore prefix.
+ * We can't use the existing __SC_xxx macros because we need to
+ * support up to nine arguments rather than up to six, and also this
+ * way the file stands alone from possible changes in the
+ * implementation of <linux/syscalls.h>.
+ */
+#define HV_WRAP0(type, name)                                   \
+       type name(void);                                        \
+       type name(void)                                         \
+       {                                                       \
+               return _##name();                               \
+       }
+#define __HV_DECL1(t1, a1)     t1 a1
+#define __HV_DECL2(t2, a2, ...) t2 a2, __HV_DECL1(__VA_ARGS__)
+#define __HV_DECL3(t3, a3, ...) t3 a3, __HV_DECL2(__VA_ARGS__)
+#define __HV_DECL4(t4, a4, ...) t4 a4, __HV_DECL3(__VA_ARGS__)
+#define __HV_DECL5(t5, a5, ...) t5 a5, __HV_DECL4(__VA_ARGS__)
+#define __HV_DECL6(t6, a6, ...) t6 a6, __HV_DECL5(__VA_ARGS__)
+#define __HV_DECL7(t7, a7, ...) t7 a7, __HV_DECL6(__VA_ARGS__)
+#define __HV_DECL8(t8, a8, ...) t8 a8, __HV_DECL7(__VA_ARGS__)
+#define __HV_DECL9(t9, a9, ...) t9 a9, __HV_DECL8(__VA_ARGS__)
+#define __HV_PASS1(t1, a1)     a1
+#define __HV_PASS2(t2, a2, ...) a2, __HV_PASS1(__VA_ARGS__)
+#define __HV_PASS3(t3, a3, ...) a3, __HV_PASS2(__VA_ARGS__)
+#define __HV_PASS4(t4, a4, ...) a4, __HV_PASS3(__VA_ARGS__)
+#define __HV_PASS5(t5, a5, ...) a5, __HV_PASS4(__VA_ARGS__)
+#define __HV_PASS6(t6, a6, ...) a6, __HV_PASS5(__VA_ARGS__)
+#define __HV_PASS7(t7, a7, ...) a7, __HV_PASS6(__VA_ARGS__)
+#define __HV_PASS8(t8, a8, ...) a8, __HV_PASS7(__VA_ARGS__)
+#define __HV_PASS9(t9, a9, ...) a9, __HV_PASS8(__VA_ARGS__)
+#define HV_WRAPx(x, type, name, ...)                           \
+       type name(__HV_DECL##x(__VA_ARGS__));                   \
+       type name(__HV_DECL##x(__VA_ARGS__))                    \
+       {                                                       \
+               return _##name(__HV_PASS##x(__VA_ARGS__));      \
+       }
+#define HV_WRAP1(type, name, ...) HV_WRAPx(1, type, name, __VA_ARGS__)
+#define HV_WRAP2(type, name, ...) HV_WRAPx(2, type, name, __VA_ARGS__)
+#define HV_WRAP3(type, name, ...) HV_WRAPx(3, type, name, __VA_ARGS__)
+#define HV_WRAP4(type, name, ...) HV_WRAPx(4, type, name, __VA_ARGS__)
+#define HV_WRAP5(type, name, ...) HV_WRAPx(5, type, name, __VA_ARGS__)
+#define HV_WRAP6(type, name, ...) HV_WRAPx(6, type, name, __VA_ARGS__)
+#define HV_WRAP7(type, name, ...) HV_WRAPx(7, type, name, __VA_ARGS__)
+#define HV_WRAP8(type, name, ...) HV_WRAPx(8, type, name, __VA_ARGS__)
+#define HV_WRAP9(type, name, ...) HV_WRAPx(9, type, name, __VA_ARGS__)
+
+/* List all the hypervisor API functions. */
+HV_WRAP4(void, hv_init, HV_VersionNumber, interface_version_number,
+        int, chip_num, int, chip_rev_num, int, client_pl)
+HV_WRAP1(long, hv_sysconf, HV_SysconfQuery, query)
+HV_WRAP3(int, hv_confstr, HV_ConfstrQuery, query, HV_VirtAddr, buf, int, len)
+#if CHIP_HAS_IPI()
+HV_WRAP3(int, hv_get_ipi_pte, HV_Coord, tile, int, pl, HV_PTE*, pte)
+HV_WRAP3(int, hv_console_set_ipi, int, ipi, int, event, HV_Coord, coord);
+#else
+HV_WRAP1(void, hv_enable_intr, HV_IntrMask, enab_mask)
+HV_WRAP1(void, hv_disable_intr, HV_IntrMask, disab_mask)
+HV_WRAP1(void, hv_clear_intr, HV_IntrMask, clear_mask)
+HV_WRAP1(void, hv_raise_intr, HV_IntrMask, raise_mask)
+HV_WRAP2(HV_Errno, hv_trigger_ipi, HV_Coord, tile, int, interrupt)
+#endif /* !CHIP_HAS_IPI() */
+HV_WRAP3(int, hv_store_mapping, HV_VirtAddr, va, unsigned int, len,
+        HV_PhysAddr, pa)
+HV_WRAP2(HV_PhysAddr, hv_inquire_realpa, HV_PhysAddr, cpa, unsigned int, len)
+HV_WRAP0(HV_RTCTime, hv_get_rtc)
+HV_WRAP1(void, hv_set_rtc, HV_RTCTime, time)
+HV_WRAP4(int, hv_install_context, HV_PhysAddr, page_table, HV_PTE, access,
+        HV_ASID, asid, __hv32, flags)
+HV_WRAP2(int, hv_set_pte_super_shift, int, level, int, log2_count)
+HV_WRAP0(HV_Context, hv_inquire_context)
+HV_WRAP1(int, hv_flush_asid, HV_ASID, asid)
+HV_WRAP2(int, hv_flush_page, HV_VirtAddr, address, HV_PageSize, page_size)
+HV_WRAP3(int, hv_flush_pages, HV_VirtAddr, start, HV_PageSize, page_size,
+        unsigned long, size)
+HV_WRAP1(int, hv_flush_all, int, preserve_global)
+HV_WRAP2(void, hv_restart, HV_VirtAddr, cmd, HV_VirtAddr, args)
+HV_WRAP0(void, hv_halt)
+HV_WRAP0(void, hv_power_off)
+HV_WRAP1(int, hv_reexec, HV_PhysAddr, entry)
+HV_WRAP0(HV_Topology, hv_inquire_topology)
+HV_WRAP3(HV_Errno, hv_inquire_tiles, HV_InqTileSet, set, HV_VirtAddr, cpumask,
+        int, length)
+HV_WRAP1(HV_PhysAddrRange, hv_inquire_physical, int, idx)
+HV_WRAP2(HV_MemoryControllerInfo, hv_inquire_memory_controller, HV_Coord, coord,
+        int, controller)
+HV_WRAP1(HV_VirtAddrRange, hv_inquire_virtual, int, idx)
+HV_WRAP1(HV_ASIDRange, hv_inquire_asid, int, idx)
+HV_WRAP1(void, hv_nanosleep, int, nanosecs)
+HV_WRAP0(int, hv_console_read_if_ready)
+HV_WRAP1(void, hv_console_putc, int, byte)
+HV_WRAP2(int, hv_console_write, HV_VirtAddr, bytes, int, len)
+HV_WRAP0(void, hv_downcall_dispatch)
+HV_WRAP1(int, hv_fs_findfile, HV_VirtAddr, filename)
+HV_WRAP1(HV_FS_StatInfo, hv_fs_fstat, int, inode)
+HV_WRAP4(int, hv_fs_pread, int, inode, HV_VirtAddr, buf,
+        int, length, int, offset)
+HV_WRAP2(unsigned long long, hv_physaddr_read64, HV_PhysAddr, addr,
+        HV_PTE, access)
+HV_WRAP3(void, hv_physaddr_write64, HV_PhysAddr, addr, HV_PTE, access,
+        unsigned long long, val)
+HV_WRAP2(int, hv_get_command_line, HV_VirtAddr, buf, int, length)
+HV_WRAP2(HV_Errno, hv_set_command_line, HV_VirtAddr, buf, int, length)
+HV_WRAP1(void, hv_set_caching, unsigned long, bitmask)
+HV_WRAP2(void, hv_bzero_page, HV_VirtAddr, va, unsigned int, size)
+HV_WRAP1(HV_Errno, hv_register_message_state, HV_MsgState*, msgstate)
+HV_WRAP4(int, hv_send_message, HV_Recipient *, recips, int, nrecip,
+        HV_VirtAddr, buf, int, buflen)
+HV_WRAP3(HV_RcvMsgInfo, hv_receive_message, HV_MsgState, msgstate,
+        HV_VirtAddr, buf, int, buflen)
+HV_WRAP0(void, hv_start_all_tiles)
+HV_WRAP2(int, hv_dev_open, HV_VirtAddr, name, __hv32, flags)
+HV_WRAP1(int, hv_dev_close, int, devhdl)
+HV_WRAP5(int, hv_dev_pread, int, devhdl, __hv32, flags, HV_VirtAddr, va,
+        __hv32, len, __hv64, offset)
+HV_WRAP5(int, hv_dev_pwrite, int, devhdl, __hv32, flags, HV_VirtAddr, va,
+        __hv32, len, __hv64, offset)
+HV_WRAP3(int, hv_dev_poll, int, devhdl, __hv32, events, HV_IntArg, intarg)
+HV_WRAP1(int, hv_dev_poll_cancel, int, devhdl)
+HV_WRAP6(int, hv_dev_preada, int, devhdl, __hv32, flags, __hv32, sgl_len,
+        HV_SGL *, sglp, __hv64, offset, HV_IntArg, intarg)
+HV_WRAP6(int, hv_dev_pwritea, int, devhdl, __hv32, flags, __hv32, sgl_len,
+        HV_SGL *, sglp, __hv64, offset, HV_IntArg, intarg)
+HV_WRAP9(int, hv_flush_remote, HV_PhysAddr, cache_pa,
+        unsigned long, cache_control, unsigned long*, cache_cpumask,
+        HV_VirtAddr, tlb_va, unsigned long, tlb_length,
+        unsigned long, tlb_pgsize, unsigned long*, tlb_cpumask,
+        HV_Remote_ASID*, asids, int, asidcount)
index cb52d66..088d5c1 100644 (file)
 #include <arch/interrupts.h>
 #include <arch/spr_def.h>
 
-#ifdef CONFIG_PREEMPT
-# error "No support for kernel preemption currently"
-#endif
-
 #define PTREGS_PTR(reg, ptreg) addli reg, sp, C_ABI_SAVE_AREA_SIZE + (ptreg)
 
 #define PTREGS_OFFSET_SYSCALL PTREGS_OFFSET_REG(TREG_SYSCALL_NR)
 
-#if !CHIP_HAS_WH64()
-       /* By making this an empty macro, we can use wh64 in the code. */
-       .macro  wh64 reg
-       .endm
-#endif
-
        .macro  push_reg reg, ptr=sp, delta=-4
        {
         sw     \ptr, \reg
@@ -189,7 +179,7 @@ intvec_\vecname:
         * point sp at the top aligned address on the actual stack page.
         */
        mfspr   r0, SPR_SYSTEM_SAVE_K_0
-       mm      r0, r0, zero, LOG2_THREAD_SIZE, 31
+       mm      r0, r0, zero, LOG2_NR_CPU_IDS, 31
 
 0:
        /*
@@ -207,6 +197,9 @@ intvec_\vecname:
         *    cache line 1: r14...r29
         *    cache line 0: 2 x frame, r0..r13
         */
+#if STACK_TOP_DELTA != 64
+#error STACK_TOP_DELTA must be 64 for assumptions here and in task_pt_regs()
+#endif
        andi    r0, r0, -64
 
        /*
@@ -326,18 +319,14 @@ intvec_\vecname:
         movei  r3, -1   /* not used, but set for consistency */
        }
        .else
-#if CHIP_HAS_AUX_PERF_COUNTERS()
        .ifc \c_routine, op_handle_aux_perf_interrupt
        {
         mfspr  r2, AUX_PERF_COUNT_STS
         movei  r3, -1   /* not used, but set for consistency */
        }
        .else
-#endif
        movei   r3, 0
-#if CHIP_HAS_AUX_PERF_COUNTERS()
        .endif
-#endif
        .endif
        .endif
        .endif
@@ -354,7 +343,7 @@ intvec_\vecname:
 #ifdef __COLLECT_LINKER_FEEDBACK__
        .pushsection .text.intvec_feedback,"ax"
        .org    (\vecnum << 5)
-       FEEDBACK_ENTER_EXPLICIT(intvec_\vecname, .intrpt1, 1 << 8)
+       FEEDBACK_ENTER_EXPLICIT(intvec_\vecname, .intrpt, 1 << 8)
        jrp     lr
        .popsection
 #endif
@@ -468,7 +457,7 @@ intvec_\vecname:
        }
        {
         auli   r21, r21, ha16(__per_cpu_offset)
-        mm     r20, r20, zero, 0, LOG2_THREAD_SIZE-1
+        mm     r20, r20, zero, 0, LOG2_NR_CPU_IDS-1
        }
        s2a     r20, r20, r21
        lw      tp, r20
@@ -562,7 +551,6 @@ intvec_\vecname:
        .endif
        mtspr   INTERRUPT_CRITICAL_SECTION, zero
 
-#if CHIP_HAS_WH64()
        /*
         * Prepare the first 256 stack bytes to be rapidly accessible
         * without having to fetch the background data.  We don't really
@@ -583,7 +571,6 @@ intvec_\vecname:
         addi   r52, r52, -64
        }
        wh64    r52
-#endif
 
 #ifdef CONFIG_TRACE_IRQFLAGS
        .ifnc \function,handle_nmi
@@ -762,7 +749,7 @@ intvec_\vecname:
        .macro  dc_dispatch vecnum, vecname
        .org    (\vecnum << 8)
 intvec_\vecname:
-       j       hv_downcall_dispatch
+       j       _hv_downcall_dispatch
        ENDPROC(intvec_\vecname)
        .endm
 
@@ -812,17 +799,34 @@ STD_ENTRY(interrupt_return)
        }
        lw      r29, r29
        andi    r29, r29, SPR_EX_CONTEXT_1_1__PL_MASK  /* mask off ICS */
+       bzt     r29, .Lresume_userspace
+
+#ifdef CONFIG_PREEMPT
+       /* Returning to kernel space. Check if we need preemption. */
+       GET_THREAD_INFO(r29)
+       addli   r28, r29, THREAD_INFO_FLAGS_OFFSET
        {
-        bzt    r29, .Lresume_userspace
-        PTREGS_PTR(r29, PTREGS_OFFSET_PC)
+        lw     r28, r28
+        addli  r29, r29, THREAD_INFO_PREEMPT_COUNT_OFFSET
        }
+       {
+        andi   r28, r28, _TIF_NEED_RESCHED
+        lw     r29, r29
+       }
+       bzt     r28, 1f
+       bnz     r29, 1f
+       jal     preempt_schedule_irq
+       FEEDBACK_REENTER(interrupt_return)
+1:
+#endif
 
        /* If we're resuming to _cpu_idle_nap, bump PC forward by 8. */
        {
-        lw     r28, r29
+        PTREGS_PTR(r29, PTREGS_OFFSET_PC)
         moveli r27, lo16(_cpu_idle_nap)
        }
        {
+        lw     r28, r29
         auli   r27, r27, ha16(_cpu_idle_nap)
        }
        {
@@ -1420,7 +1424,6 @@ handle_ill:
        {
         lw     r0, r0          /* indirect thru thread_info to get task_info*/
         addi   r1, sp, C_ABI_SAVE_AREA_SIZE  /* put ptregs pointer into r1 */
-        move   r2, zero        /* load error code into r2 */
        }
 
        jal     send_sigtrap    /* issue a SIGTRAP */
@@ -1518,12 +1521,10 @@ STD_ENTRY(_sys_clone)
        __HEAD
        .align 64
        /* Align much later jump on the start of a cache line. */
-#if !ATOMIC_LOCKS_FOUND_VIA_TABLE()
        nop
 #if PAGE_SIZE >= 0x10000
        nop
 #endif
-#endif
 ENTRY(sys_cmpxchg)
 
        /*
@@ -1557,45 +1558,6 @@ ENTRY(sys_cmpxchg)
 # error Code here assumes PAGE_OFFSET can be loaded with just hi16()
 #endif
 
-#if ATOMIC_LOCKS_FOUND_VIA_TABLE()
-       {
-        /* Check for unaligned input. */
-        bnz    sp, .Lcmpxchg_badaddr
-        mm     r25, r0, zero, 3, PAGE_SHIFT-1
-       }
-       {
-        crc32_32 r25, zero, r25
-        moveli r21, lo16(atomic_lock_ptr)
-       }
-       {
-        auli   r21, r21, ha16(atomic_lock_ptr)
-        auli   r23, zero, hi16(PAGE_OFFSET)  /* hugepage-aligned */
-       }
-       {
-        shri   r20, r25, 32 - ATOMIC_HASH_L1_SHIFT
-        slt_u  r23, r0, r23
-        lw     r26, r0  /* see comment in the "#else" for the "lw r26". */
-       }
-       {
-        s2a    r21, r20, r21
-        bbns   r23, .Lcmpxchg_badaddr
-       }
-       {
-        lw     r21, r21
-        seqi   r23, TREG_SYSCALL_NR_NAME, __NR_FAST_cmpxchg64
-        andi   r25, r25, ATOMIC_HASH_L2_SIZE - 1
-       }
-       {
-        /* Branch away at this point if we're doing a 64-bit cmpxchg. */
-        bbs    r23, .Lcmpxchg64
-        andi   r23, r0, 7       /* Precompute alignment for cmpxchg64. */
-       }
-       {
-        s2a    ATOMIC_LOCK_REG_NAME, r25, r21
-        j      .Lcmpxchg32_tns   /* see comment in the #else for the jump. */
-       }
-
-#else /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
        {
         /* Check for unaligned input. */
         bnz    sp, .Lcmpxchg_badaddr
@@ -1609,7 +1571,7 @@ ENTRY(sys_cmpxchg)
          * Because of C pointer arithmetic, we want to compute this:
          *
          * ((char*)atomic_locks +
-         *  (((r0 >> 3) & (1 << (ATOMIC_HASH_SIZE - 1))) << 2))
+         *  (((r0 >> 3) & ((1 << ATOMIC_HASH_SHIFT) - 1)) << 2))
          *
          * Instead of two shifts we just ">> 1", and use 'mm'
          * to ignore the low and high bits we don't want.
@@ -1620,12 +1582,9 @@ ENTRY(sys_cmpxchg)
 
         /*
          * Ensure that the TLB is loaded before we take out the lock.
-         * On tilepro, this will start fetching the value all the way
-         * into our L1 as well (and if it gets modified before we
-         * grab the lock, it will be invalidated from our cache
-         * before we reload it).  On tile64, we'll start fetching it
-         * into our L1 if we're the home, and if we're not, we'll
-         * still at least start fetching it into the home's L2.
+         * This will start fetching the value all the way into our L1
+         * as well (and if it gets modified before we grab the lock,
+         * it will be invalidated from our cache before we reload it).
          */
         lw     r26, r0
        }
@@ -1668,8 +1627,6 @@ ENTRY(sys_cmpxchg)
         j      .Lcmpxchg32_tns
        }
 
-#endif /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
-
 /* Symbol for do_page_fault_ics() to use to compare against the PC. */
 .global __sys_cmpxchg_grab_lock
 __sys_cmpxchg_grab_lock:
@@ -1807,9 +1764,6 @@ __sys_cmpxchg_grab_lock:
        .align 64
 .Lcmpxchg64:
        {
-#if ATOMIC_LOCKS_FOUND_VIA_TABLE()
-        s2a    ATOMIC_LOCK_REG_NAME, r25, r21
-#endif
         bzt     r23, .Lcmpxchg64_tns
        }
        j       .Lcmpxchg_badaddr
@@ -1875,8 +1829,8 @@ int_unalign:
        push_extra_callee_saves r0
        j       do_trap
 
-/* Include .intrpt1 array of interrupt vectors */
-       .section ".intrpt1", "ax"
+/* Include .intrpt array of interrupt vectors */
+       .section ".intrpt", "ax"
 
 #define op_handle_perf_interrupt bad_intr
 #define op_handle_aux_perf_interrupt bad_intr
@@ -1944,10 +1898,8 @@ int_unalign:
                     do_page_fault
        int_hand     INT_SN_CPL, SN_CPL, bad_intr
        int_hand     INT_DOUBLE_FAULT, DOUBLE_FAULT, do_trap
-#if CHIP_HAS_AUX_PERF_COUNTERS()
        int_hand     INT_AUX_PERF_COUNT, AUX_PERF_COUNT, \
                     op_handle_aux_perf_interrupt, handle_nmi
-#endif
 
        /* Synthetic interrupt delivered only by the simulator */
        int_hand     INT_BREAKPOINT, BREAKPOINT, do_breakpoint
index 85d4839..ec755d3 100644 (file)
 #include <linux/linkage.h>
 #include <linux/errno.h>
 #include <linux/unistd.h>
+#include <linux/init.h>
 #include <asm/ptrace.h>
 #include <asm/thread_info.h>
 #include <asm/irqflags.h>
 #include <asm/asm-offsets.h>
 #include <asm/types.h>
+#include <asm/traps.h>
 #include <asm/signal.h>
 #include <hv/hypervisor.h>
 #include <arch/abi.h>
 #include <arch/interrupts.h>
 #include <arch/spr_def.h>
 
-#ifdef CONFIG_PREEMPT
-# error "No support for kernel preemption currently"
-#endif
-
 #define PTREGS_PTR(reg, ptreg) addli reg, sp, C_ABI_SAVE_AREA_SIZE + (ptreg)
 
 #define PTREGS_OFFSET_SYSCALL PTREGS_OFFSET_REG(TREG_SYSCALL_NR)
 
+#if CONFIG_KERNEL_PL == 1 || CONFIG_KERNEL_PL == 2
+/*
+ * Set "result" non-zero if ex1 holds the PL of the kernel
+ * (with or without ICS being set).  Note this works only
+ * because we never find the PL at level 3.
+ */
+# define IS_KERNEL_EX1(result, ex1) andi result, ex1, CONFIG_KERNEL_PL
+#else
+# error Recode IS_KERNEL_EX1 for CONFIG_KERNEL_PL
+#endif
 
        .macro  push_reg reg, ptr=sp, delta=-8
        {
        }
        .endm
 
+       /*
+        * Unalign data exception fast handling: In order to handle
+        * unaligned data access, a fast JIT version is generated and stored
+        * in a specific area in user space. We first need to do a quick poke
+        * to see if the JIT is available. We use certain bits in the fault
+        * PC (3 to 9 is used for 16KB page size) as index to address the JIT
+        * code area. The first 64bit word is the fault PC, and the 2nd one is
+        * the fault bundle itself. If these 2 words both match, then we
+        * directly "iret" to JIT code. If not, a slow path is invoked to
+        * generate new JIT code. Note: the current JIT code WILL be
+        * overwritten if it existed. So, ideally we can handle 128 unalign
+        * fixups via JIT. For lookup efficiency and to effectively support
+        * tight loops with multiple unaligned reference, a simple
+        * direct-mapped cache is used.
+        *
+        * SPR_EX_CONTEXT_K_0 is modified to return to JIT code.
+        * SPR_EX_CONTEXT_K_1 has ICS set.
+        * SPR_EX_CONTEXT_0_0 is setup to user program's next PC.
+        * SPR_EX_CONTEXT_0_1 = 0.
+        */
+       .macro int_hand_unalign_fast  vecnum, vecname
+       .org  (\vecnum << 8)
+intvec_\vecname:
+       /* Put r3 in SPR_SYSTEM_SAVE_K_1.  */
+       mtspr   SPR_SYSTEM_SAVE_K_1, r3
+
+       mfspr   r3, SPR_EX_CONTEXT_K_1
+       /*
+        * Examine if exception comes from user without ICS set.
+        * If not, just go directly to the slow path.
+        */
+       bnez    r3, hand_unalign_slow_nonuser
+
+       mfspr   r3, SPR_SYSTEM_SAVE_K_0
+
+       /* Get &thread_info->unalign_jit_tmp[0] in r3. */
+       bfexts  r3, r3, 0, CPU_SHIFT-1
+       mm      r3, zero, LOG2_THREAD_SIZE, 63
+       addli   r3, r3, THREAD_INFO_UNALIGN_JIT_TMP_OFFSET
+
+       /*
+        * Save r0, r1, r2 into thread_info array r3 points to
+        * from low to high memory in order.
+        */
+       st_add  r3, r0, 8
+       st_add  r3, r1, 8
+       {
+        st_add r3, r2, 8
+        andi   r2, sp, 7
+       }
+
+       /* Save stored r3 value so we can revert it on a page fault. */
+       mfspr   r1, SPR_SYSTEM_SAVE_K_1
+       st      r3, r1
+
+       {
+        /* Generate a SIGBUS if sp is not 8-byte aligned. */
+        bnez   r2, hand_unalign_slow_badsp
+       }
+
+       /*
+        * Get the thread_info in r0; load r1 with pc. Set the low bit of sp
+        * as an indicator to the page fault code in case we fault.
+        */
+       {
+        ori    sp, sp, 1
+        mfspr  r1, SPR_EX_CONTEXT_K_0
+       }
+
+       /* Add the jit_info offset in thread_info; extract r1 [3:9] into r2. */
+       {
+        addli  r0, r3, THREAD_INFO_UNALIGN_JIT_BASE_OFFSET - \
+         (THREAD_INFO_UNALIGN_JIT_TMP_OFFSET + (3 * 8))
+        bfextu r2, r1, 3, (2 + PAGE_SHIFT - UNALIGN_JIT_SHIFT)
+       }
+
+       /* Load the jit_info; multiply r2 by 128. */
+       {
+        ld     r0, r0
+        shli   r2, r2, UNALIGN_JIT_SHIFT
+       }
+
+       /*
+        * If r0 is NULL, the JIT page is not mapped, so go to slow path;
+        * add offset r2 to r0 at the same time.
+        */
+       {
+        beqz   r0, hand_unalign_slow
+        add    r2, r0, r2
+       }
+
+        /*
+        * We are loading from userspace (both the JIT info PC and
+        * instruction word, and the instruction word we executed)
+        * and since either could fault while holding the interrupt
+        * critical section, we must tag this region and check it in
+        * do_page_fault() to handle it properly.
+        */
+ENTRY(__start_unalign_asm_code)
+
+       /* Load first word of JIT in r0 and increment r2 by 8. */
+       ld_add  r0, r2, 8
+
+       /*
+        * Compare the PC with the 1st word in JIT; load the fault bundle
+        * into r1.
+        */
+       {
+        cmpeq  r0, r0, r1
+        ld     r1, r1
+       }
+
+       /* Go to slow path if PC doesn't match. */
+       beqz    r0, hand_unalign_slow
+
+       /*
+        * Load the 2nd word of JIT, which is supposed to be the fault
+        * bundle for a cache hit. Increment r2; after this bundle r2 will
+        * point to the potential start of the JIT code we want to run.
+        */
+       ld_add  r0, r2, 8
+
+       /* No further accesses to userspace are done after this point. */
+ENTRY(__end_unalign_asm_code)
+
+       /* Compare the real bundle with what is saved in the JIT area. */
+       {
+        cmpeq  r0, r1, r0
+        mtspr  SPR_EX_CONTEXT_0_1, zero
+       }
+
+       /* Go to slow path if the fault bundle does not match. */
+       beqz    r0, hand_unalign_slow
+
+       /*
+        * A cache hit is found.
+        * r2 points to start of JIT code (3rd word).
+        * r0 is the fault pc.
+        * r1 is the fault bundle.
+        * Reset the low bit of sp.
+        */
+       {
+        mfspr  r0, SPR_EX_CONTEXT_K_0
+        andi   sp, sp, ~1
+       }
+
+       /* Write r2 into EX_CONTEXT_K_0 and increment PC. */
+       {
+        mtspr  SPR_EX_CONTEXT_K_0, r2
+        addi   r0, r0, 8
+       }
+
+       /*
+        * Set ICS on kernel EX_CONTEXT_K_1 in order to "iret" to
+        * user with ICS set. This way, if the JIT fixup causes another
+        * unalign exception (which shouldn't be possible) the user
+        * process will be terminated with SIGBUS. Also, our fixup will
+        * run without interleaving with external interrupts.
+        * Each fixup is at most 14 bundles, so it won't hold ICS for long.
+        */
+       {
+        movei  r1, PL_ICS_EX1(USER_PL, 1)
+        mtspr  SPR_EX_CONTEXT_0_0, r0
+       }
+
+       {
+        mtspr  SPR_EX_CONTEXT_K_1, r1
+        addi   r3, r3, -(3 * 8)
+       }
+
+       /* Restore r0..r3. */
+       ld_add  r0, r3, 8
+       ld_add  r1, r3, 8
+       ld_add  r2, r3, 8
+       ld      r3, r3
+
+       iret
+       ENDPROC(intvec_\vecname)
+       .endm
 
 #ifdef __COLLECT_LINKER_FEEDBACK__
        .pushsection .text.intvec_feedback,"ax"
@@ -118,15 +305,21 @@ intvec_feedback:
         * The "processing" argument specifies the code for processing
         * the interrupt. Defaults to "handle_interrupt".
         */
-       .macro  int_hand vecnum, vecname, c_routine, processing=handle_interrupt
-       .org    (\vecnum << 8)
+       .macro __int_hand vecnum, vecname, c_routine,processing=handle_interrupt
 intvec_\vecname:
        /* Temporarily save a register so we have somewhere to work. */
 
        mtspr   SPR_SYSTEM_SAVE_K_1, r0
        mfspr   r0, SPR_EX_CONTEXT_K_1
 
-       andi    r0, r0, SPR_EX_CONTEXT_1_1__PL_MASK  /* mask off ICS */
+       /*
+        * The unalign data fastpath code sets the low bit in sp to
+        * force us to reset it here on fault.
+        */
+       {
+        blbs   sp, 2f
+        IS_KERNEL_EX1(r0, r0)
+       }
 
        .ifc    \vecnum, INT_DOUBLE_FAULT
        /*
@@ -176,15 +369,15 @@ intvec_\vecname:
        }
        .endif
 
-
+2:
        /*
-        * SYSTEM_SAVE_K_0 holds the cpu number in the low bits, and
-        * the current stack top in the higher bits.  So we recover
-        * our stack top by just masking off the low bits, then
+        * SYSTEM_SAVE_K_0 holds the cpu number in the high bits, and
+        * the current stack top in the lower bits.  So we recover
+        * our starting stack value by sign-extending the low bits, then
         * point sp at the top aligned address on the actual stack page.
         */
        mfspr   r0, SPR_SYSTEM_SAVE_K_0
-       mm      r0, zero, LOG2_THREAD_SIZE, 63
+       bfexts  r0, r0, 0, CPU_SHIFT-1
 
 0:
        /*
@@ -206,6 +399,9 @@ intvec_\vecname:
         *    cache line 1: r6...r13
         *    cache line 0: 2 x frame, r0..r5
         */
+#if STACK_TOP_DELTA != 64
+#error STACK_TOP_DELTA must be 64 for assumptions here and in task_pt_regs()
+#endif
        andi    r0, r0, -64
 
        /*
@@ -305,7 +501,7 @@ intvec_\vecname:
        mfspr   r3, SPR_SYSTEM_SAVE_K_2   /* info about page fault */
        .else
        .ifc \vecnum, INT_ILL_TRANS
-       mfspr   r2, ILL_TRANS_REASON
+       mfspr   r2, ILL_VA_PC
        .else
        .ifc \vecnum, INT_DOUBLE_FAULT
        mfspr   r2, SPR_SYSTEM_SAVE_K_2   /* double fault info from HV */
@@ -315,12 +511,10 @@ intvec_\vecname:
        .else
        .ifc \c_routine, op_handle_perf_interrupt
        mfspr   r2, PERF_COUNT_STS
-#if CHIP_HAS_AUX_PERF_COUNTERS()
        .else
        .ifc \c_routine, op_handle_aux_perf_interrupt
        mfspr   r2, AUX_PERF_COUNT_STS
        .endif
-#endif
        .endif
        .endif
        .endif
@@ -339,7 +533,7 @@ intvec_\vecname:
 #ifdef __COLLECT_LINKER_FEEDBACK__
        .pushsection .text.intvec_feedback,"ax"
        .org    (\vecnum << 5)
-       FEEDBACK_ENTER_EXPLICIT(intvec_\vecname, .intrpt1, 1 << 8)
+       FEEDBACK_ENTER_EXPLICIT(intvec_\vecname, .intrpt, 1 << 8)
        jrp     lr
        .popsection
 #endif
@@ -455,11 +649,12 @@ intvec_\vecname:
        /*
         * If we will be returning to the kernel, we will need to
         * reset the interrupt masks to the state they had before.
-        * Set DISABLE_IRQ in flags iff we came from PL1 with irqs disabled.
+        * Set DISABLE_IRQ in flags iff we came from kernel pl with
+        * irqs disabled.
         */
        mfspr   r32, SPR_EX_CONTEXT_K_1
        {
-        andi   r32, r32, SPR_EX_CONTEXT_1_1__PL_MASK  /* mask off ICS */
+        IS_KERNEL_EX1(r22, r22)
         PTREGS_PTR(r21, PTREGS_OFFSET_FLAGS)
        }
        beqzt   r32, 1f       /* zero if from user space */
@@ -503,7 +698,7 @@ intvec_\vecname:
        }
        {
         shl16insli r21, r21, hw1(__per_cpu_offset)
-        bfextu r20, r20, 0, LOG2_THREAD_SIZE-1
+        bfextu r20, r20, CPU_SHIFT, 63
        }
        shl16insli r21, r21, hw0(__per_cpu_offset)
        shl3add r20, r20, r21
@@ -585,7 +780,7 @@ intvec_\vecname:
        .macro  dc_dispatch vecnum, vecname
        .org    (\vecnum << 8)
 intvec_\vecname:
-       j       hv_downcall_dispatch
+       j       _hv_downcall_dispatch
        ENDPROC(intvec_\vecname)
        .endm
 
@@ -626,14 +821,36 @@ STD_ENTRY(interrupt_return)
         PTREGS_PTR(r29, PTREGS_OFFSET_EX1)
        }
        ld      r29, r29
-       andi    r29, r29, SPR_EX_CONTEXT_1_1__PL_MASK  /* mask off ICS */
+       IS_KERNEL_EX1(r29, r29)
        {
         beqzt  r29, .Lresume_userspace
-        PTREGS_PTR(r29, PTREGS_OFFSET_PC)
+        move   r29, sp
+       }
+
+#ifdef CONFIG_PREEMPT
+       /* Returning to kernel space. Check if we need preemption. */
+       EXTRACT_THREAD_INFO(r29)
+       addli   r28, r29, THREAD_INFO_FLAGS_OFFSET
+       {
+        ld     r28, r28
+        addli  r29, r29, THREAD_INFO_PREEMPT_COUNT_OFFSET
+       }
+       {
+        andi   r28, r28, _TIF_NEED_RESCHED
+        ld4s   r29, r29
        }
+       beqzt   r28, 1f
+       bnez    r29, 1f
+       jal     preempt_schedule_irq
+       FEEDBACK_REENTER(interrupt_return)
+1:
+#endif
 
        /* If we're resuming to _cpu_idle_nap, bump PC forward by 8. */
-       moveli  r27, hw2_last(_cpu_idle_nap)
+       {
+        moveli r27, hw2_last(_cpu_idle_nap)
+        PTREGS_PTR(r29, PTREGS_OFFSET_PC)
+       }
        {
         ld     r28, r29
         shl16insli r27, r27, hw1(_cpu_idle_nap)
@@ -728,7 +945,7 @@ STD_ENTRY(interrupt_return)
         PTREGS_PTR(r32, PTREGS_OFFSET_FLAGS)
        }
        {
-        andi   r0, r0, SPR_EX_CONTEXT_1_1__PL_MASK
+        IS_KERNEL_EX1(r0, r0)
         ld     r32, r32
        }
        bnez    r0, 1f
@@ -799,7 +1016,7 @@ STD_ENTRY(interrupt_return)
        pop_reg r21, sp, PTREGS_OFFSET_REG(31) - PTREGS_OFFSET_PC
        {
         mtspr  SPR_EX_CONTEXT_K_1, lr
-        andi   lr, lr, SPR_EX_CONTEXT_1_1__PL_MASK  /* mask off ICS */
+        IS_KERNEL_EX1(lr, lr)
        }
        {
         mtspr  SPR_EX_CONTEXT_K_0, r21
@@ -1223,10 +1440,31 @@ STD_ENTRY(_sys_clone)
        j       sys_clone
        STD_ENDPROC(_sys_clone)
 
-/* The single-step support may need to read all the registers. */
+       /*
+        * Recover r3, r2, r1 and r0 here saved by unalign fast vector.
+        * The vector area limit is 32 bundles, so we handle the reload here.
+        * r0, r1, r2 are in thread_info from low to high memory in order.
+        * r3 points to location the original r3 was saved.
+        * We put this code in the __HEAD section so it can be reached
+        * via a conditional branch from the fast path.
+        */
+       __HEAD
+hand_unalign_slow:
+       andi    sp, sp, ~1
+hand_unalign_slow_badsp:
+       addi    r3, r3, -(3 * 8)
+       ld_add  r0, r3, 8
+       ld_add  r1, r3, 8
+       ld      r2, r3
+hand_unalign_slow_nonuser:
+       mfspr   r3, SPR_SYSTEM_SAVE_K_1
+       __int_hand     INT_UNALIGN_DATA, UNALIGN_DATA_SLOW, int_unalign
+
+/* The unaligned data support needs to read all the registers. */
 int_unalign:
        push_extra_callee_saves r0
-       j       do_trap
+       j       do_unaligned
+ENDPROC(hand_unalign_slow)
 
 /* Fill the return address stack with nonzero entries. */
 STD_ENTRY(fill_ra_stack)
@@ -1240,8 +1478,15 @@ STD_ENTRY(fill_ra_stack)
 4:     jrp     r0
        STD_ENDPROC(fill_ra_stack)
 
-/* Include .intrpt1 array of interrupt vectors */
-       .section ".intrpt1", "ax"
+       .macro int_hand  vecnum, vecname, c_routine, processing=handle_interrupt
+       .org   (\vecnum << 8)
+               __int_hand   \vecnum, \vecname, \c_routine, \processing
+       .endm
+
+/* Include .intrpt array of interrupt vectors */
+       .section ".intrpt", "ax"
+       .global intrpt_start
+intrpt_start:
 
 #define op_handle_perf_interrupt bad_intr
 #define op_handle_aux_perf_interrupt bad_intr
@@ -1272,7 +1517,7 @@ STD_ENTRY(fill_ra_stack)
        int_hand     INT_SWINT_1, SWINT_1, SYSCALL, handle_syscall
        int_hand     INT_SWINT_0, SWINT_0, do_trap
        int_hand     INT_ILL_TRANS, ILL_TRANS, do_trap
-       int_hand     INT_UNALIGN_DATA, UNALIGN_DATA, int_unalign
+       int_hand_unalign_fast INT_UNALIGN_DATA, UNALIGN_DATA
        int_hand     INT_DTLB_MISS, DTLB_MISS, do_page_fault
        int_hand     INT_DTLB_ACCESS, DTLB_ACCESS, do_page_fault
        int_hand     INT_IDN_FIREWALL, IDN_FIREWALL, do_hardwall_trap
index 3ccf2cd..0586fdb 100644 (file)
@@ -55,7 +55,8 @@ static DEFINE_PER_CPU(int, irq_depth);
 
 /* State for allocating IRQs on Gx. */
 #if CHIP_HAS_IPI()
-static unsigned long available_irqs = ~(1UL << IRQ_RESCHEDULE);
+static unsigned long available_irqs = ((1UL << NR_IRQS) - 1) &
+                                     (~(1UL << IRQ_RESCHEDULE));
 static DEFINE_SPINLOCK(available_irqs_lock);
 #endif
 
@@ -73,7 +74,8 @@ static DEFINE_SPINLOCK(available_irqs_lock);
 
 /*
  * The interrupt handling path, implemented in terms of HV interrupt
- * emulation on TILE64 and TILEPro, and IPI hardware on TILE-Gx.
+ * emulation on TILEPro, and IPI hardware on TILE-Gx.
+ * Entered with interrupts disabled.
  */
 void tile_dev_intr(struct pt_regs *regs, int intnum)
 {
@@ -233,7 +235,7 @@ void tile_irq_activate(unsigned int irq, int tile_irq_type)
 {
        /*
         * We use handle_level_irq() by default because the pending
-        * interrupt vector (whether modeled by the HV on TILE64 and
+        * interrupt vector (whether modeled by the HV on
         * TILEPro or implemented in hardware on TILE-Gx) has
         * level-style semantics for each bit.  An interrupt fires
         * whenever a bit is high, not just at edges.
diff --git a/arch/tile/kernel/kgdb.c b/arch/tile/kernel/kgdb.c
new file mode 100644 (file)
index 0000000..4cd8838
--- /dev/null
@@ -0,0 +1,499 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ *
+ * TILE-Gx KGDB support.
+ */
+
+#include <linux/ptrace.h>
+#include <linux/kgdb.h>
+#include <linux/kdebug.h>
+#include <linux/uaccess.h>
+#include <linux/module.h>
+#include <asm/cacheflush.h>
+
+static tile_bundle_bits singlestep_insn = TILEGX_BPT_BUNDLE | DIE_SSTEPBP;
+static unsigned long stepped_addr;
+static tile_bundle_bits stepped_instr;
+
+struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = {
+       { "r0", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[0])},
+       { "r1", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[1])},
+       { "r2", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[2])},
+       { "r3", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[3])},
+       { "r4", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[4])},
+       { "r5", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[5])},
+       { "r6", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[6])},
+       { "r7", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[7])},
+       { "r8", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[8])},
+       { "r9", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[9])},
+       { "r10", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[10])},
+       { "r11", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[11])},
+       { "r12", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[12])},
+       { "r13", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[13])},
+       { "r14", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[14])},
+       { "r15", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[15])},
+       { "r16", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[16])},
+       { "r17", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[17])},
+       { "r18", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[18])},
+       { "r19", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[19])},
+       { "r20", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[20])},
+       { "r21", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[21])},
+       { "r22", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[22])},
+       { "r23", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[23])},
+       { "r24", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[24])},
+       { "r25", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[25])},
+       { "r26", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[26])},
+       { "r27", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[27])},
+       { "r28", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[28])},
+       { "r29", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[29])},
+       { "r30", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[30])},
+       { "r31", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[31])},
+       { "r32", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[32])},
+       { "r33", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[33])},
+       { "r34", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[34])},
+       { "r35", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[35])},
+       { "r36", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[36])},
+       { "r37", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[37])},
+       { "r38", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[38])},
+       { "r39", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[39])},
+       { "r40", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[40])},
+       { "r41", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[41])},
+       { "r42", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[42])},
+       { "r43", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[43])},
+       { "r44", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[44])},
+       { "r45", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[45])},
+       { "r46", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[46])},
+       { "r47", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[47])},
+       { "r48", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[48])},
+       { "r49", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[49])},
+       { "r50", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[50])},
+       { "r51", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[51])},
+       { "r52", GDB_SIZEOF_REG, offsetof(struct pt_regs, regs[52])},
+       { "tp", GDB_SIZEOF_REG, offsetof(struct pt_regs, tp)},
+       { "sp", GDB_SIZEOF_REG, offsetof(struct pt_regs, sp)},
+       { "lr", GDB_SIZEOF_REG, offsetof(struct pt_regs, lr)},
+       { "sn", GDB_SIZEOF_REG, -1},
+       { "idn0", GDB_SIZEOF_REG, -1},
+       { "idn1", GDB_SIZEOF_REG, -1},
+       { "udn0", GDB_SIZEOF_REG, -1},
+       { "udn1", GDB_SIZEOF_REG, -1},
+       { "udn2", GDB_SIZEOF_REG, -1},
+       { "udn3", GDB_SIZEOF_REG, -1},
+       { "zero", GDB_SIZEOF_REG, -1},
+       { "pc", GDB_SIZEOF_REG, offsetof(struct pt_regs, pc)},
+       { "faultnum", GDB_SIZEOF_REG, offsetof(struct pt_regs, faultnum)},
+};
+
+char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs)
+{
+       if (regno >= DBG_MAX_REG_NUM || regno < 0)
+               return NULL;
+
+       if (dbg_reg_def[regno].offset != -1)
+               memcpy(mem, (void *)regs + dbg_reg_def[regno].offset,
+                      dbg_reg_def[regno].size);
+       else
+               memset(mem, 0, dbg_reg_def[regno].size);
+       return dbg_reg_def[regno].name;
+}
+
+int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)
+{
+       if (regno >= DBG_MAX_REG_NUM || regno < 0)
+               return -EINVAL;
+
+       if (dbg_reg_def[regno].offset != -1)
+               memcpy((void *)regs + dbg_reg_def[regno].offset, mem,
+                      dbg_reg_def[regno].size);
+       return 0;
+}
+
+/*
+ * Similar to pt_regs_to_gdb_regs() except that process is sleeping and so
+ * we may not be able to get all the info.
+ */
+void
+sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
+{
+       int reg;
+       struct pt_regs *thread_regs;
+       unsigned long *ptr = gdb_regs;
+
+       if (task == NULL)
+               return;
+
+       /* Initialize to zero. */
+       memset(gdb_regs, 0, NUMREGBYTES);
+
+       thread_regs = task_pt_regs(task);
+       for (reg = 0; reg <= TREG_LAST_GPR; reg++)
+               *(ptr++) = thread_regs->regs[reg];
+
+       gdb_regs[TILEGX_PC_REGNUM] = thread_regs->pc;
+       gdb_regs[TILEGX_FAULTNUM_REGNUM] = thread_regs->faultnum;
+}
+
+void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc)
+{
+       regs->pc = pc;
+}
+
+static void kgdb_call_nmi_hook(void *ignored)
+{
+       kgdb_nmicallback(raw_smp_processor_id(), NULL);
+}
+
+void kgdb_roundup_cpus(unsigned long flags)
+{
+       local_irq_enable();
+       smp_call_function(kgdb_call_nmi_hook, NULL, 0);
+       local_irq_disable();
+}
+
+/*
+ * Convert a kernel address to the writable kernel text mapping.
+ */
+static unsigned long writable_address(unsigned long addr)
+{
+       unsigned long ret = 0;
+
+       if (core_kernel_text(addr))
+               ret = addr - MEM_SV_START + PAGE_OFFSET;
+       else if (is_module_text_address(addr))
+               ret = addr;
+       else
+               pr_err("Unknown virtual address 0x%lx\n", addr);
+
+       return ret;
+}
+
+/*
+ * Calculate the new address for after a step.
+ */
+static unsigned long get_step_address(struct pt_regs *regs)
+{
+       int src_reg;
+       int jump_off;
+       int br_off;
+       unsigned long addr;
+       unsigned int opcode;
+       tile_bundle_bits bundle;
+
+       /* Move to the next instruction by default. */
+       addr = regs->pc + TILEGX_BUNDLE_SIZE_IN_BYTES;
+       bundle = *(unsigned long *)instruction_pointer(regs);
+
+       /* 0: X mode, Otherwise: Y mode. */
+       if (bundle & TILEGX_BUNDLE_MODE_MASK) {
+               if (get_Opcode_Y1(bundle) == RRR_1_OPCODE_Y1 &&
+                   get_RRROpcodeExtension_Y1(bundle) ==
+                   UNARY_RRR_1_OPCODE_Y1) {
+                       opcode = get_UnaryOpcodeExtension_Y1(bundle);
+
+                       switch (opcode) {
+                       case JALR_UNARY_OPCODE_Y1:
+                       case JALRP_UNARY_OPCODE_Y1:
+                       case JR_UNARY_OPCODE_Y1:
+                       case JRP_UNARY_OPCODE_Y1:
+                               src_reg = get_SrcA_Y1(bundle);
+                               dbg_get_reg(src_reg, &addr, regs);
+                               break;
+                       }
+               }
+       } else if (get_Opcode_X1(bundle) == RRR_0_OPCODE_X1) {
+               if (get_RRROpcodeExtension_X1(bundle) ==
+                   UNARY_RRR_0_OPCODE_X1) {
+                       opcode = get_UnaryOpcodeExtension_X1(bundle);
+
+                       switch (opcode) {
+                       case JALR_UNARY_OPCODE_X1:
+                       case JALRP_UNARY_OPCODE_X1:
+                       case JR_UNARY_OPCODE_X1:
+                       case JRP_UNARY_OPCODE_X1:
+                               src_reg = get_SrcA_X1(bundle);
+                               dbg_get_reg(src_reg, &addr, regs);
+                               break;
+                       }
+               }
+       } else if (get_Opcode_X1(bundle) == JUMP_OPCODE_X1) {
+               opcode = get_JumpOpcodeExtension_X1(bundle);
+
+               switch (opcode) {
+               case JAL_JUMP_OPCODE_X1:
+               case J_JUMP_OPCODE_X1:
+                       jump_off = sign_extend(get_JumpOff_X1(bundle), 27);
+                       addr = regs->pc +
+                               (jump_off << TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES);
+                       break;
+               }
+       } else if (get_Opcode_X1(bundle) == BRANCH_OPCODE_X1) {
+               br_off = 0;
+               opcode = get_BrType_X1(bundle);
+
+               switch (opcode) {
+               case BEQZT_BRANCH_OPCODE_X1:
+               case BEQZ_BRANCH_OPCODE_X1:
+                       if (get_SrcA_X1(bundle) == 0)
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               case BGEZT_BRANCH_OPCODE_X1:
+               case BGEZ_BRANCH_OPCODE_X1:
+                       if (get_SrcA_X1(bundle) >= 0)
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               case BGTZT_BRANCH_OPCODE_X1:
+               case BGTZ_BRANCH_OPCODE_X1:
+                       if (get_SrcA_X1(bundle) > 0)
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               case BLBCT_BRANCH_OPCODE_X1:
+               case BLBC_BRANCH_OPCODE_X1:
+                       if (!(get_SrcA_X1(bundle) & 1))
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               case BLBST_BRANCH_OPCODE_X1:
+               case BLBS_BRANCH_OPCODE_X1:
+                       if (get_SrcA_X1(bundle) & 1)
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               case BLEZT_BRANCH_OPCODE_X1:
+               case BLEZ_BRANCH_OPCODE_X1:
+                       if (get_SrcA_X1(bundle) <= 0)
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               case BLTZT_BRANCH_OPCODE_X1:
+               case BLTZ_BRANCH_OPCODE_X1:
+                       if (get_SrcA_X1(bundle) < 0)
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               case BNEZT_BRANCH_OPCODE_X1:
+               case BNEZ_BRANCH_OPCODE_X1:
+                       if (get_SrcA_X1(bundle) != 0)
+                               br_off = get_BrOff_X1(bundle);
+                       break;
+               }
+
+               if (br_off != 0) {
+                       br_off = sign_extend(br_off, 17);
+                       addr = regs->pc +
+                               (br_off << TILEGX_LOG2_BUNDLE_SIZE_IN_BYTES);
+               }
+       }
+
+       return addr;
+}
+
+/*
+ * Replace the next instruction after the current instruction with a
+ * breakpoint instruction.
+ */
+static void do_single_step(struct pt_regs *regs)
+{
+       unsigned long addr_wr;
+
+       /* Determine where the target instruction will send us to. */
+       stepped_addr = get_step_address(regs);
+       probe_kernel_read((char *)&stepped_instr, (char *)stepped_addr,
+                         BREAK_INSTR_SIZE);
+
+       addr_wr = writable_address(stepped_addr);
+       probe_kernel_write((char *)addr_wr, (char *)&singlestep_insn,
+                          BREAK_INSTR_SIZE);
+       smp_wmb();
+       flush_icache_range(stepped_addr, stepped_addr + BREAK_INSTR_SIZE);
+}
+
+static void undo_single_step(struct pt_regs *regs)
+{
+       unsigned long addr_wr;
+
+       if (stepped_instr == 0)
+               return;
+
+       addr_wr = writable_address(stepped_addr);
+       probe_kernel_write((char *)addr_wr, (char *)&stepped_instr,
+                          BREAK_INSTR_SIZE);
+       stepped_instr = 0;
+       smp_wmb();
+       flush_icache_range(stepped_addr, stepped_addr + BREAK_INSTR_SIZE);
+}
+
+/*
+ * Calls linux_debug_hook before the kernel dies. If KGDB is enabled,
+ * then try to fall into the debugger.
+ */
+static int
+kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr)
+{
+       int ret;
+       unsigned long flags;
+       struct die_args *args = (struct die_args *)ptr;
+       struct pt_regs *regs = args->regs;
+
+#ifdef CONFIG_KPROBES
+       /*
+        * Return immediately if the kprobes fault notifier has set
+        * DIE_PAGE_FAULT.
+        */
+       if (cmd == DIE_PAGE_FAULT)
+               return NOTIFY_DONE;
+#endif /* CONFIG_KPROBES */
+
+       switch (cmd) {
+       case DIE_BREAK:
+       case DIE_COMPILED_BPT:
+               break;
+       case DIE_SSTEPBP:
+               local_irq_save(flags);
+               kgdb_handle_exception(0, SIGTRAP, 0, regs);
+               local_irq_restore(flags);
+               return NOTIFY_STOP;
+       default:
+               /* Userspace events, ignore. */
+               if (user_mode(regs))
+                       return NOTIFY_DONE;
+       }
+
+       local_irq_save(flags);
+       ret = kgdb_handle_exception(args->trapnr, args->signr, args->err, regs);
+       local_irq_restore(flags);
+       if (ret)
+               return NOTIFY_DONE;
+
+       return NOTIFY_STOP;
+}
+
+static struct notifier_block kgdb_notifier = {
+       .notifier_call = kgdb_notify,
+};
+
+/*
+ * kgdb_arch_handle_exception - Handle architecture specific GDB packets.
+ * @vector: The error vector of the exception that happened.
+ * @signo: The signal number of the exception that happened.
+ * @err_code: The error code of the exception that happened.
+ * @remcom_in_buffer: The buffer of the packet we have read.
+ * @remcom_out_buffer: The buffer of %BUFMAX bytes to write a packet into.
+ * @regs: The &struct pt_regs of the current process.
+ *
+ * This function MUST handle the 'c' and 's' command packets,
+ * as well packets to set / remove a hardware breakpoint, if used.
+ * If there are additional packets which the hardware needs to handle,
+ * they are handled here. The code should return -1 if it wants to
+ * process more packets, and a %0 or %1 if it wants to exit from the
+ * kgdb callback.
+ */
+int kgdb_arch_handle_exception(int vector, int signo, int err_code,
+                              char *remcom_in_buffer, char *remcom_out_buffer,
+                              struct pt_regs *regs)
+{
+       char *ptr;
+       unsigned long address;
+
+       /* Undo any stepping we may have done. */
+       undo_single_step(regs);
+
+       switch (remcom_in_buffer[0]) {
+       case 'c':
+       case 's':
+       case 'D':
+       case 'k':
+               /*
+                * Try to read optional parameter, pc unchanged if no parm.
+                * If this was a compiled-in breakpoint, we need to move
+                * to the next instruction or we will just breakpoint
+                * over and over again.
+                */
+               ptr = &remcom_in_buffer[1];
+               if (kgdb_hex2long(&ptr, &address))
+                       regs->pc = address;
+               else if (*(unsigned long *)regs->pc == compiled_bpt)
+                       regs->pc += BREAK_INSTR_SIZE;
+
+               if (remcom_in_buffer[0] == 's') {
+                       do_single_step(regs);
+                       kgdb_single_step = 1;
+                       atomic_set(&kgdb_cpu_doing_single_step,
+                                  raw_smp_processor_id());
+               } else
+                       atomic_set(&kgdb_cpu_doing_single_step, -1);
+
+               return 0;
+       }
+
+       return -1; /* this means that we do not want to exit from the handler */
+}
+
+struct kgdb_arch arch_kgdb_ops;
+
+/*
+ * kgdb_arch_init - Perform any architecture specific initalization.
+ *
+ * This function will handle the initalization of any architecture
+ * specific callbacks.
+ */
+int kgdb_arch_init(void)
+{
+       tile_bundle_bits bundle = TILEGX_BPT_BUNDLE;
+
+       memcpy(arch_kgdb_ops.gdb_bpt_instr, &bundle, BREAK_INSTR_SIZE);
+       return register_die_notifier(&kgdb_notifier);
+}
+
+/*
+ * kgdb_arch_exit - Perform any architecture specific uninitalization.
+ *
+ * This function will handle the uninitalization of any architecture
+ * specific callbacks, for dynamic registration and unregistration.
+ */
+void kgdb_arch_exit(void)
+{
+       unregister_die_notifier(&kgdb_notifier);
+}
+
+int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
+{
+       int err;
+       unsigned long addr_wr = writable_address(bpt->bpt_addr);
+
+       if (addr_wr == 0)
+               return -1;
+
+       err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
+                               BREAK_INSTR_SIZE);
+       if (err)
+               return err;
+
+       err = probe_kernel_write((char *)addr_wr, arch_kgdb_ops.gdb_bpt_instr,
+                                BREAK_INSTR_SIZE);
+       smp_wmb();
+       flush_icache_range((unsigned long)bpt->bpt_addr,
+                          (unsigned long)bpt->bpt_addr + BREAK_INSTR_SIZE);
+       return err;
+}
+
+int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
+{
+       int err;
+       unsigned long addr_wr = writable_address(bpt->bpt_addr);
+
+       if (addr_wr == 0)
+               return -1;
+
+       err = probe_kernel_write((char *)addr_wr, (char *)bpt->saved_instr,
+                                BREAK_INSTR_SIZE);
+       smp_wmb();
+       flush_icache_range((unsigned long)bpt->bpt_addr,
+                          (unsigned long)bpt->bpt_addr + BREAK_INSTR_SIZE);
+       return err;
+}
diff --git a/arch/tile/kernel/kprobes.c b/arch/tile/kernel/kprobes.c
new file mode 100644 (file)
index 0000000..27cdcac
--- /dev/null
@@ -0,0 +1,528 @@
+/*
+ * arch/tile/kernel/kprobes.c
+ * Kprobes on TILE-Gx
+ *
+ * Some portions copied from the MIPS version.
+ *
+ * Copyright (C) IBM Corporation, 2002, 2004
+ * Copyright 2006 Sony Corp.
+ * Copyright 2010 Cavium Networks
+ *
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#include <linux/kprobes.h>
+#include <linux/kdebug.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include <asm/cacheflush.h>
+
+#include <arch/opcode.h>
+
+DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
+DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
+
+tile_bundle_bits breakpoint_insn = TILEGX_BPT_BUNDLE;
+tile_bundle_bits breakpoint2_insn = TILEGX_BPT_BUNDLE | DIE_SSTEPBP;
+
+/*
+ * Check whether instruction is branch or jump, or if executing it
+ * has different results depending on where it is executed (e.g. lnk).
+ */
+static int __kprobes insn_has_control(kprobe_opcode_t insn)
+{
+       if (get_Mode(insn) != 0) {   /* Y-format bundle */
+               if (get_Opcode_Y1(insn) != RRR_1_OPCODE_Y1 ||
+                   get_RRROpcodeExtension_Y1(insn) != UNARY_RRR_1_OPCODE_Y1)
+                       return 0;
+
+               switch (get_UnaryOpcodeExtension_Y1(insn)) {
+               case JALRP_UNARY_OPCODE_Y1:
+               case JALR_UNARY_OPCODE_Y1:
+               case JRP_UNARY_OPCODE_Y1:
+               case JR_UNARY_OPCODE_Y1:
+               case LNK_UNARY_OPCODE_Y1:
+                       return 1;
+               default:
+                       return 0;
+               }
+       }
+
+       switch (get_Opcode_X1(insn)) {
+       case BRANCH_OPCODE_X1:  /* branch instructions */
+       case JUMP_OPCODE_X1:    /* jump instructions: j and jal */
+               return 1;
+
+       case RRR_0_OPCODE_X1:   /* other jump instructions */
+               if (get_RRROpcodeExtension_X1(insn) != UNARY_RRR_0_OPCODE_X1)
+                       return 0;
+               switch (get_UnaryOpcodeExtension_X1(insn)) {
+               case JALRP_UNARY_OPCODE_X1:
+               case JALR_UNARY_OPCODE_X1:
+               case JRP_UNARY_OPCODE_X1:
+               case JR_UNARY_OPCODE_X1:
+               case LNK_UNARY_OPCODE_X1:
+                       return 1;
+               default:
+                       return 0;
+               }
+       default:
+               return 0;
+       }
+}
+
+int __kprobes arch_prepare_kprobe(struct kprobe *p)
+{
+       unsigned long addr = (unsigned long)p->addr;
+
+       if (addr & (sizeof(kprobe_opcode_t) - 1))
+               return -EINVAL;
+
+       if (insn_has_control(*p->addr)) {
+               pr_notice("Kprobes for control instructions are not "
+                         "supported\n");
+               return -EINVAL;
+       }
+
+       /* insn: must be on special executable page on tile. */
+       p->ainsn.insn = get_insn_slot();
+       if (!p->ainsn.insn)
+               return -ENOMEM;
+
+       /*
+        * In the kprobe->ainsn.insn[] array we store the original
+        * instruction at index zero and a break trap instruction at
+        * index one.
+        */
+       memcpy(&p->ainsn.insn[0], p->addr, sizeof(kprobe_opcode_t));
+       p->ainsn.insn[1] = breakpoint2_insn;
+       p->opcode = *p->addr;
+
+       return 0;
+}
+
+void __kprobes arch_arm_kprobe(struct kprobe *p)
+{
+       unsigned long addr_wr;
+
+       /* Operate on writable kernel text mapping. */
+       addr_wr = (unsigned long)p->addr - MEM_SV_START + PAGE_OFFSET;
+
+       if (probe_kernel_write((void *)addr_wr, &breakpoint_insn,
+               sizeof(breakpoint_insn)))
+               pr_err("%s: failed to enable kprobe\n", __func__);
+
+       smp_wmb();
+       flush_insn_slot(p);
+}
+
+void __kprobes arch_disarm_kprobe(struct kprobe *kp)
+{
+       unsigned long addr_wr;
+
+       /* Operate on writable kernel text mapping. */
+       addr_wr = (unsigned long)kp->addr - MEM_SV_START + PAGE_OFFSET;
+
+       if (probe_kernel_write((void *)addr_wr, &kp->opcode,
+               sizeof(kp->opcode)))
+               pr_err("%s: failed to enable kprobe\n", __func__);
+
+       smp_wmb();
+       flush_insn_slot(kp);
+}
+
+void __kprobes arch_remove_kprobe(struct kprobe *p)
+{
+       if (p->ainsn.insn) {
+               free_insn_slot(p->ainsn.insn, 0);
+               p->ainsn.insn = NULL;
+       }
+}
+
+static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
+{
+       kcb->prev_kprobe.kp = kprobe_running();
+       kcb->prev_kprobe.status = kcb->kprobe_status;
+       kcb->prev_kprobe.saved_pc = kcb->kprobe_saved_pc;
+}
+
+static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
+{
+       __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp);
+       kcb->kprobe_status = kcb->prev_kprobe.status;
+       kcb->kprobe_saved_pc = kcb->prev_kprobe.saved_pc;
+}
+
+static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
+                       struct kprobe_ctlblk *kcb)
+{
+       __this_cpu_write(current_kprobe, p);
+       kcb->kprobe_saved_pc = regs->pc;
+}
+
+static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
+{
+       /* Single step inline if the instruction is a break. */
+       if (p->opcode == breakpoint_insn ||
+           p->opcode == breakpoint2_insn)
+               regs->pc = (unsigned long)p->addr;
+       else
+               regs->pc = (unsigned long)&p->ainsn.insn[0];
+}
+
+static int __kprobes kprobe_handler(struct pt_regs *regs)
+{
+       struct kprobe *p;
+       int ret = 0;
+       kprobe_opcode_t *addr;
+       struct kprobe_ctlblk *kcb;
+
+       addr = (kprobe_opcode_t *)regs->pc;
+
+       /*
+        * We don't want to be preempted for the entire
+        * duration of kprobe processing.
+        */
+       preempt_disable();
+       kcb = get_kprobe_ctlblk();
+
+       /* Check we're not actually recursing. */
+       if (kprobe_running()) {
+               p = get_kprobe(addr);
+               if (p) {
+                       if (kcb->kprobe_status == KPROBE_HIT_SS &&
+                           p->ainsn.insn[0] == breakpoint_insn) {
+                               goto no_kprobe;
+                       }
+                       /*
+                        * We have reentered the kprobe_handler(), since
+                        * another probe was hit while within the handler.
+                        * We here save the original kprobes variables and
+                        * just single step on the instruction of the new probe
+                        * without calling any user handlers.
+                        */
+                       save_previous_kprobe(kcb);
+                       set_current_kprobe(p, regs, kcb);
+                       kprobes_inc_nmissed_count(p);
+                       prepare_singlestep(p, regs);
+                       kcb->kprobe_status = KPROBE_REENTER;
+                       return 1;
+               } else {
+                       if (*addr != breakpoint_insn) {
+                               /*
+                                * The breakpoint instruction was removed by
+                                * another cpu right after we hit, no further
+                                * handling of this interrupt is appropriate.
+                                */
+                               ret = 1;
+                               goto no_kprobe;
+                       }
+                       p = __this_cpu_read(current_kprobe);
+                       if (p->break_handler && p->break_handler(p, regs))
+                               goto ss_probe;
+               }
+               goto no_kprobe;
+       }
+
+       p = get_kprobe(addr);
+       if (!p) {
+               if (*addr != breakpoint_insn) {
+                       /*
+                        * The breakpoint instruction was removed right
+                        * after we hit it.  Another cpu has removed
+                        * either a probepoint or a debugger breakpoint
+                        * at this address.  In either case, no further
+                        * handling of this interrupt is appropriate.
+                        */
+                       ret = 1;
+               }
+               /* Not one of ours: let kernel handle it. */
+               goto no_kprobe;
+       }
+
+       set_current_kprobe(p, regs, kcb);
+       kcb->kprobe_status = KPROBE_HIT_ACTIVE;
+
+       if (p->pre_handler && p->pre_handler(p, regs)) {
+               /* Handler has already set things up, so skip ss setup. */
+               return 1;
+       }
+
+ss_probe:
+       prepare_singlestep(p, regs);
+       kcb->kprobe_status = KPROBE_HIT_SS;
+       return 1;
+
+no_kprobe:
+       preempt_enable_no_resched();
+       return ret;
+}
+
+/*
+ * Called after single-stepping.  p->addr is the address of the
+ * instruction that has been replaced by the breakpoint. To avoid the
+ * SMP problems that can occur when we temporarily put back the
+ * original opcode to single-step, we single-stepped a copy of the
+ * instruction.  The address of this copy is p->ainsn.insn.
+ *
+ * This function prepares to return from the post-single-step
+ * breakpoint trap.
+ */
+static void __kprobes resume_execution(struct kprobe *p,
+                                      struct pt_regs *regs,
+                                      struct kprobe_ctlblk *kcb)
+{
+       unsigned long orig_pc = kcb->kprobe_saved_pc;
+       regs->pc = orig_pc + 8;
+}
+
+static inline int post_kprobe_handler(struct pt_regs *regs)
+{
+       struct kprobe *cur = kprobe_running();
+       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
+
+       if (!cur)
+               return 0;
+
+       if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
+               kcb->kprobe_status = KPROBE_HIT_SSDONE;
+               cur->post_handler(cur, regs, 0);
+       }
+
+       resume_execution(cur, regs, kcb);
+
+       /* Restore back the original saved kprobes variables and continue. */
+       if (kcb->kprobe_status == KPROBE_REENTER) {
+               restore_previous_kprobe(kcb);
+               goto out;
+       }
+       reset_current_kprobe();
+out:
+       preempt_enable_no_resched();
+
+       return 1;
+}
+
+static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
+{
+       struct kprobe *cur = kprobe_running();
+       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
+
+       if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr))
+               return 1;
+
+       if (kcb->kprobe_status & KPROBE_HIT_SS) {
+               /*
+                * We are here because the instruction being single
+                * stepped caused a page fault. We reset the current
+                * kprobe and the ip points back to the probe address
+                * and allow the page fault handler to continue as a
+                * normal page fault.
+                */
+               resume_execution(cur, regs, kcb);
+               reset_current_kprobe();
+               preempt_enable_no_resched();
+       }
+       return 0;
+}
+
+/*
+ * Wrapper routine for handling exceptions.
+ */
+int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
+                                      unsigned long val, void *data)
+{
+       struct die_args *args = (struct die_args *)data;
+       int ret = NOTIFY_DONE;
+
+       switch (val) {
+       case DIE_BREAK:
+               if (kprobe_handler(args->regs))
+                       ret = NOTIFY_STOP;
+               break;
+       case DIE_SSTEPBP:
+               if (post_kprobe_handler(args->regs))
+                       ret = NOTIFY_STOP;
+               break;
+       case DIE_PAGE_FAULT:
+               /* kprobe_running() needs smp_processor_id(). */
+               preempt_disable();
+
+               if (kprobe_running()
+                   && kprobe_fault_handler(args->regs, args->trapnr))
+                       ret = NOTIFY_STOP;
+               preempt_enable();
+               break;
+       default:
+               break;
+       }
+       return ret;
+}
+
+int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
+{
+       struct jprobe *jp = container_of(p, struct jprobe, kp);
+       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
+
+       kcb->jprobe_saved_regs = *regs;
+       kcb->jprobe_saved_sp = regs->sp;
+
+       memcpy(kcb->jprobes_stack, (void *)kcb->jprobe_saved_sp,
+              MIN_JPROBES_STACK_SIZE(kcb->jprobe_saved_sp));
+
+       regs->pc = (unsigned long)(jp->entry);
+
+       return 1;
+}
+
+/* Defined in the inline asm below. */
+void jprobe_return_end(void);
+
+void __kprobes jprobe_return(void)
+{
+       asm volatile(
+               "bpt\n\t"
+               ".globl jprobe_return_end\n"
+               "jprobe_return_end:\n");
+}
+
+int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
+{
+       struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
+
+       if (regs->pc >= (unsigned long)jprobe_return &&
+           regs->pc <= (unsigned long)jprobe_return_end) {
+               *regs = kcb->jprobe_saved_regs;
+               memcpy((void *)kcb->jprobe_saved_sp, kcb->jprobes_stack,
+                      MIN_JPROBES_STACK_SIZE(kcb->jprobe_saved_sp));
+               preempt_enable_no_resched();
+
+               return 1;
+       }
+       return 0;
+}
+
+/*
+ * Function return probe trampoline:
+ * - init_kprobes() establishes a probepoint here
+ * - When the probed function returns, this probe causes the
+ *   handlers to fire
+ */
+static void __used kretprobe_trampoline_holder(void)
+{
+       asm volatile(
+               "nop\n\t"
+               ".global kretprobe_trampoline\n"
+               "kretprobe_trampoline:\n\t"
+               "nop\n\t"
+               : : : "memory");
+}
+
+void kretprobe_trampoline(void);
+
+void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
+                                     struct pt_regs *regs)
+{
+       ri->ret_addr = (kprobe_opcode_t *) regs->lr;
+
+       /* Replace the return addr with trampoline addr */
+       regs->lr = (unsigned long)kretprobe_trampoline;
+}
+
+/*
+ * Called when the probe at kretprobe trampoline is hit.
+ */
+static int __kprobes trampoline_probe_handler(struct kprobe *p,
+                                               struct pt_regs *regs)
+{
+       struct kretprobe_instance *ri = NULL;
+       struct hlist_head *head, empty_rp;
+       struct hlist_node *tmp;
+       unsigned long flags, orig_ret_address = 0;
+       unsigned long trampoline_address = (unsigned long)kretprobe_trampoline;
+
+       INIT_HLIST_HEAD(&empty_rp);
+       kretprobe_hash_lock(current, &head, &flags);
+
+       /*
+        * It is possible to have multiple instances associated with a given
+        * task either because multiple functions in the call path have
+        * a return probe installed on them, and/or more than one return
+        * return probe was registered for a target function.
+        *
+        * We can handle this because:
+        *     - instances are always inserted at the head of the list
+        *     - when multiple return probes are registered for the same
+        *       function, the first instance's ret_addr will point to the
+        *       real return address, and all the rest will point to
+        *       kretprobe_trampoline
+        */
+       hlist_for_each_entry_safe(ri, tmp, head, hlist) {
+               if (ri->task != current)
+                       /* another task is sharing our hash bucket */
+                       continue;
+
+               if (ri->rp && ri->rp->handler)
+                       ri->rp->handler(ri, regs);
+
+               orig_ret_address = (unsigned long)ri->ret_addr;
+               recycle_rp_inst(ri, &empty_rp);
+
+               if (orig_ret_address != trampoline_address) {
+                       /*
+                        * This is the real return address. Any other
+                        * instances associated with this task are for
+                        * other calls deeper on the call stack
+                        */
+                       break;
+               }
+       }
+
+       kretprobe_assert(ri, orig_ret_address, trampoline_address);
+       instruction_pointer(regs) = orig_ret_address;
+
+       reset_current_kprobe();
+       kretprobe_hash_unlock(current, &flags);
+       preempt_enable_no_resched();
+
+       hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
+               hlist_del(&ri->hlist);
+               kfree(ri);
+       }
+       /*
+        * By returning a non-zero value, we are telling
+        * kprobe_handler() that we don't want the post_handler
+        * to run (and have re-enabled preemption)
+        */
+       return 1;
+}
+
+int __kprobes arch_trampoline_kprobe(struct kprobe *p)
+{
+       if (p->addr == (kprobe_opcode_t *)kretprobe_trampoline)
+               return 1;
+
+       return 0;
+}
+
+static struct kprobe trampoline_p = {
+       .addr = (kprobe_opcode_t *)kretprobe_trampoline,
+       .pre_handler = trampoline_probe_handler
+};
+
+int __init arch_init_kprobes(void)
+{
+       register_kprobe(&trampoline_p);
+       return 0;
+}
diff --git a/arch/tile/kernel/mcount_64.S b/arch/tile/kernel/mcount_64.S
new file mode 100644 (file)
index 0000000..70d7bb0
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ *
+ * TILE-Gx specific __mcount support
+ */
+
+#include <linux/linkage.h>
+#include <asm/ftrace.h>
+
+#define REGSIZE 8
+
+       .text
+       .global __mcount
+
+       .macro  MCOUNT_SAVE_REGS
+       addli   sp, sp, -REGSIZE
+       {
+        st     sp, lr
+        addli  r29, sp, - (12 * REGSIZE)
+       }
+       {
+        addli  sp, sp, - (13 * REGSIZE)
+        st     r29, sp
+       }
+       addli   r29, r29, REGSIZE
+       { st    r29, r0; addli  r29, r29, REGSIZE }
+       { st    r29, r1; addli  r29, r29, REGSIZE }
+       { st    r29, r2; addli  r29, r29, REGSIZE }
+       { st    r29, r3; addli  r29, r29, REGSIZE }
+       { st    r29, r4; addli  r29, r29, REGSIZE }
+       { st    r29, r5; addli  r29, r29, REGSIZE }
+       { st    r29, r6; addli  r29, r29, REGSIZE }
+       { st    r29, r7; addli  r29, r29, REGSIZE }
+       { st    r29, r8; addli  r29, r29, REGSIZE }
+       { st    r29, r9; addli  r29, r29, REGSIZE }
+       { st    r29, r10; addli r29, r29, REGSIZE }
+       .endm
+
+       .macro  MCOUNT_RESTORE_REGS
+       addli   r29, sp, (2 * REGSIZE)
+       { ld    r0, r29; addli  r29, r29, REGSIZE }
+       { ld    r1, r29; addli  r29, r29, REGSIZE }
+       { ld    r2, r29; addli  r29, r29, REGSIZE }
+       { ld    r3, r29; addli  r29, r29, REGSIZE }
+       { ld    r4, r29; addli  r29, r29, REGSIZE }
+       { ld    r5, r29; addli  r29, r29, REGSIZE }
+       { ld    r6, r29; addli  r29, r29, REGSIZE }
+       { ld    r7, r29; addli  r29, r29, REGSIZE }
+       { ld    r8, r29; addli  r29, r29, REGSIZE }
+       { ld    r9, r29; addli  r29, r29, REGSIZE }
+       { ld    r10, r29; addli lr, sp, (13 * REGSIZE) }
+       { ld    lr, lr;  addli  sp, sp, (14 * REGSIZE) }
+       .endm
+
+       .macro  RETURN_BACK
+       { move  r12, lr; move   lr, r10 }
+       jrp     r12
+       .endm
+
+#ifdef CONFIG_DYNAMIC_FTRACE
+
+       .align  64
+STD_ENTRY(__mcount)
+__mcount:
+       j       ftrace_stub
+STD_ENDPROC(__mcount)
+
+       .align  64
+STD_ENTRY(ftrace_caller)
+       moveli  r11, hw2_last(function_trace_stop)
+       { shl16insli    r11, r11, hw1(function_trace_stop); move r12, lr }
+       { shl16insli    r11, r11, hw0(function_trace_stop); move lr, r10 }
+       ld      r11, r11
+       beqz    r11, 1f
+       jrp     r12
+
+1:
+       { move  r10, lr; move   lr, r12 }
+       MCOUNT_SAVE_REGS
+
+       /* arg1: self return address */
+       /* arg2: parent's return address */
+       { move  r0, lr; move    r1, r10 }
+
+       .global ftrace_call
+ftrace_call:
+       /*
+        * a placeholder for the call to a real tracing function, i.e.
+        * ftrace_trace_function()
+        */
+       nop
+
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+       .global ftrace_graph_call
+ftrace_graph_call:
+       /*
+        * a placeholder for the call to a real tracing function, i.e.
+        * ftrace_graph_caller()
+        */
+       nop
+#endif
+       MCOUNT_RESTORE_REGS
+       .global ftrace_stub
+ftrace_stub:
+       RETURN_BACK
+STD_ENDPROC(ftrace_caller)
+
+#else /* ! CONFIG_DYNAMIC_FTRACE */
+
+       .align  64
+STD_ENTRY(__mcount)
+       moveli  r11, hw2_last(function_trace_stop)
+       { shl16insli    r11, r11, hw1(function_trace_stop); move r12, lr }
+       { shl16insli    r11, r11, hw0(function_trace_stop); move lr, r10 }
+       ld      r11, r11
+       beqz    r11, 1f
+       jrp     r12
+
+1:
+       { move  r10, lr; move   lr, r12 }
+       {
+        moveli r11, hw2_last(ftrace_trace_function)
+        moveli r13, hw2_last(ftrace_stub)
+       }
+       {
+        shl16insli     r11, r11, hw1(ftrace_trace_function)
+        shl16insli     r13, r13, hw1(ftrace_stub)
+       }
+       {
+        shl16insli     r11, r11, hw0(ftrace_trace_function)
+        shl16insli     r13, r13, hw0(ftrace_stub)
+       }
+
+       ld      r11, r11
+       sub     r14, r13, r11
+       bnez    r14, static_trace
+
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+       moveli  r15, hw2_last(ftrace_graph_return)
+       shl16insli      r15, r15, hw1(ftrace_graph_return)
+       shl16insli      r15, r15, hw0(ftrace_graph_return)
+       ld      r15, r15
+       sub     r15, r15, r13
+       bnez    r15, ftrace_graph_caller
+
+       {
+        moveli r16, hw2_last(ftrace_graph_entry)
+        moveli r17, hw2_last(ftrace_graph_entry_stub)
+       }
+       {
+        shl16insli     r16, r16, hw1(ftrace_graph_entry)
+        shl16insli     r17, r17, hw1(ftrace_graph_entry_stub)
+       }
+       {
+        shl16insli     r16, r16, hw0(ftrace_graph_entry)
+        shl16insli     r17, r17, hw0(ftrace_graph_entry_stub)
+       }
+       ld      r16, r16
+       sub     r17, r16, r17
+       bnez    r17, ftrace_graph_caller
+
+#endif
+       RETURN_BACK
+
+static_trace:
+       MCOUNT_SAVE_REGS
+
+       /* arg1: self return address */
+       /* arg2: parent's return address */
+       { move  r0, lr; move    r1, r10 }
+
+       /* call ftrace_trace_function() */
+       jalr    r11
+
+       MCOUNT_RESTORE_REGS
+
+       .global ftrace_stub
+ftrace_stub:
+       RETURN_BACK
+STD_ENDPROC(__mcount)
+
+#endif /* ! CONFIG_DYNAMIC_FTRACE */
+
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+
+STD_ENTRY(ftrace_graph_caller)
+ftrace_graph_caller:
+#ifndef CONFIG_DYNAMIC_FTRACE
+       MCOUNT_SAVE_REGS
+#endif
+
+       /* arg1: Get the location of the parent's return address */
+       addi    r0, sp, 12 * REGSIZE
+       /* arg2: Get self return address */
+       move    r1, lr
+
+       jal prepare_ftrace_return
+
+       MCOUNT_RESTORE_REGS
+       RETURN_BACK
+STD_ENDPROC(ftrace_graph_caller)
+
+       .global return_to_handler
+return_to_handler:
+       MCOUNT_SAVE_REGS
+
+       jal     ftrace_return_to_handler
+       /* restore the real parent address */
+       move    r11, r0
+
+       MCOUNT_RESTORE_REGS
+       jr      r11
+
+#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
index b9fe80e..09b5870 100644 (file)
@@ -36,8 +36,9 @@ static void *tile_dma_alloc_coherent(struct device *dev, size_t size,
                                     dma_addr_t *dma_handle, gfp_t gfp,
                                     struct dma_attrs *attrs)
 {
-       u64 dma_mask = dev->coherent_dma_mask ?: DMA_BIT_MASK(32);
-       int node = dev_to_node(dev);
+       u64 dma_mask = (dev && dev->coherent_dma_mask) ?
+               dev->coherent_dma_mask : DMA_BIT_MASK(32);
+       int node = dev ? dev_to_node(dev) : 0;
        int order = get_order(size);
        struct page *pg;
        dma_addr_t addr;
@@ -256,7 +257,7 @@ static void tile_dma_unmap_page(struct device *dev, dma_addr_t dma_address,
        BUG_ON(!valid_dma_direction(direction));
 
        __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)),
-                           dma_address & PAGE_OFFSET, size, direction);
+                           dma_address & (PAGE_SIZE - 1), size, direction);
 }
 
 static void tile_dma_sync_single_for_cpu(struct device *dev,
@@ -357,7 +358,7 @@ static void *tile_pci_dma_alloc_coherent(struct device *dev, size_t size,
 
        addr = page_to_phys(pg);
 
-       *dma_handle = phys_to_dma(dev, addr);
+       *dma_handle = addr + get_dma_offset(dev);
 
        return page_address(pg);
 }
@@ -387,7 +388,7 @@ static int tile_pci_dma_map_sg(struct device *dev, struct scatterlist *sglist,
                sg->dma_address = sg_phys(sg);
                __dma_prep_pa_range(sg->dma_address, sg->length, direction);
 
-               sg->dma_address = phys_to_dma(dev, sg->dma_address);
+               sg->dma_address = sg->dma_address + get_dma_offset(dev);
 #ifdef CONFIG_NEED_SG_DMA_LENGTH
                sg->dma_length = sg->length;
 #endif
@@ -422,7 +423,7 @@ static dma_addr_t tile_pci_dma_map_page(struct device *dev, struct page *page,
        BUG_ON(offset + size > PAGE_SIZE);
        __dma_prep_page(page, offset, size, direction);
 
-       return phys_to_dma(dev, page_to_pa(page) + offset);
+       return page_to_pa(page) + offset + get_dma_offset(dev);
 }
 
 static void tile_pci_dma_unmap_page(struct device *dev, dma_addr_t dma_address,
@@ -432,10 +433,10 @@ static void tile_pci_dma_unmap_page(struct device *dev, dma_addr_t dma_address,
 {
        BUG_ON(!valid_dma_direction(direction));
 
-       dma_address = dma_to_phys(dev, dma_address);
+       dma_address -= get_dma_offset(dev);
 
        __dma_complete_page(pfn_to_page(PFN_DOWN(dma_address)),
-                           dma_address & PAGE_OFFSET, size, direction);
+                           dma_address & (PAGE_SIZE - 1), size, direction);
 }
 
 static void tile_pci_dma_sync_single_for_cpu(struct device *dev,
@@ -445,7 +446,7 @@ static void tile_pci_dma_sync_single_for_cpu(struct device *dev,
 {
        BUG_ON(!valid_dma_direction(direction));
 
-       dma_handle = dma_to_phys(dev, dma_handle);
+       dma_handle -= get_dma_offset(dev);
 
        __dma_complete_pa_range(dma_handle, size, direction);
 }
@@ -456,7 +457,7 @@ static void tile_pci_dma_sync_single_for_device(struct device *dev,
                                                enum dma_data_direction
                                                direction)
 {
-       dma_handle = dma_to_phys(dev, dma_handle);
+       dma_handle -= get_dma_offset(dev);
 
        __dma_prep_pa_range(dma_handle, size, direction);
 }
@@ -558,22 +559,47 @@ static struct dma_map_ops pci_swiotlb_dma_ops = {
        .mapping_error = swiotlb_dma_mapping_error,
 };
 
+static struct dma_map_ops pci_hybrid_dma_ops = {
+       .alloc = tile_swiotlb_alloc_coherent,
+       .free = tile_swiotlb_free_coherent,
+       .map_page = tile_pci_dma_map_page,
+       .unmap_page = tile_pci_dma_unmap_page,
+       .map_sg = tile_pci_dma_map_sg,
+       .unmap_sg = tile_pci_dma_unmap_sg,
+       .sync_single_for_cpu = tile_pci_dma_sync_single_for_cpu,
+       .sync_single_for_device = tile_pci_dma_sync_single_for_device,
+       .sync_sg_for_cpu = tile_pci_dma_sync_sg_for_cpu,
+       .sync_sg_for_device = tile_pci_dma_sync_sg_for_device,
+       .mapping_error = tile_pci_dma_mapping_error,
+       .dma_supported = tile_pci_dma_supported
+};
+
 struct dma_map_ops *gx_legacy_pci_dma_map_ops = &pci_swiotlb_dma_ops;
+struct dma_map_ops *gx_hybrid_pci_dma_map_ops = &pci_hybrid_dma_ops;
 #else
 struct dma_map_ops *gx_legacy_pci_dma_map_ops;
+struct dma_map_ops *gx_hybrid_pci_dma_map_ops;
 #endif
 EXPORT_SYMBOL(gx_legacy_pci_dma_map_ops);
+EXPORT_SYMBOL(gx_hybrid_pci_dma_map_ops);
 
 #ifdef CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK
 int dma_set_coherent_mask(struct device *dev, u64 mask)
 {
        struct dma_map_ops *dma_ops = get_dma_ops(dev);
 
-       /* Handle legacy PCI devices with limited memory addressability. */
-       if (((dma_ops == gx_pci_dma_map_ops) ||
-           (dma_ops == gx_legacy_pci_dma_map_ops)) &&
-           (mask <= DMA_BIT_MASK(32))) {
-               if (mask > dev->archdata.max_direct_dma_addr)
+       /*
+        * For PCI devices with 64-bit DMA addressing capability, promote
+        * the dma_ops to full capability for both streams and consistent
+        * memory access. For 32-bit capable devices, limit the consistent 
+        * memory DMA range to max_direct_dma_addr.
+        */
+       if (dma_ops == gx_pci_dma_map_ops ||
+           dma_ops == gx_hybrid_pci_dma_map_ops ||
+           dma_ops == gx_legacy_pci_dma_map_ops) {
+               if (mask == DMA_BIT_MASK(64))
+                       set_dma_ops(dev, gx_pci_dma_map_ops);
+               else if (mask > dev->archdata.max_direct_dma_addr)
                        mask = dev->archdata.max_direct_dma_addr;
        }
 
@@ -584,3 +610,21 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
 }
 EXPORT_SYMBOL(dma_set_coherent_mask);
 #endif
+
+#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
+/*
+ * The generic dma_get_required_mask() uses the highest physical address
+ * (max_pfn) to provide the hint to the PCI drivers regarding 32-bit or
+ * 64-bit DMA configuration. Since TILEGx has I/O TLB/MMU, allowing the
+ * DMAs to use the full 64-bit PCI address space and not limited by
+ * the physical memory space, we always let the PCI devices use
+ * 64-bit DMA if they have that capability, by returning the 64-bit
+ * DMA mask here. The device driver has the option to use 32-bit DMA if
+ * the device is not capable of 64-bit DMA.
+ */
+u64 dma_get_required_mask(struct device *dev)
+{
+       return DMA_BIT_MASK(64);
+}
+EXPORT_SYMBOL_GPL(dma_get_required_mask);
+#endif
index 67237d3..b7180e6 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/capability.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
-#include <linux/bootmem.h>
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
@@ -52,6 +51,8 @@
  *
  */
 
+static int pci_probe = 1;
+
 /*
  * This flag tells if the platform is TILEmpower that needs
  * special configuration for the PLX switch chip.
@@ -144,6 +145,11 @@ int __init tile_pci_init(void)
 {
        int i;
 
+       if (!pci_probe) {
+               pr_info("PCI: disabled by boot argument\n");
+               return 0;
+       }
+
        pr_info("PCI: Searching for controllers...\n");
 
        /* Re-init number of PCIe controllers to support hot-plug feature. */
@@ -192,7 +198,6 @@ int __init tile_pci_init(void)
                        controller->hv_cfg_fd[0] = hv_cfg_fd0;
                        controller->hv_cfg_fd[1] = hv_cfg_fd1;
                        controller->hv_mem_fd = hv_mem_fd;
-                       controller->first_busno = 0;
                        controller->last_busno = 0xff;
                        controller->ops = &tile_cfg_ops;
 
@@ -283,7 +288,7 @@ int __init pcibios_init(void)
         * known to require at least 20ms here, but we use a more
         * conservative value.
         */
-       mdelay(250);
+       msleep(250);
 
        /* Scan all of the recorded PCI controllers.  */
        for (i = 0; i < TILE_NUM_PCIE; i++) {
@@ -304,18 +309,10 @@ int __init pcibios_init(void)
 
                        pr_info("PCI: initializing controller #%d\n", i);
 
-                       /*
-                        * This comes from the generic Linux PCI driver.
-                        *
-                        * It reads the PCI tree for this bus into the Linux
-                        * data structures.
-                        *
-                        * This is inlined in linux/pci.h and calls into
-                        * pci_scan_bus_parented() in probe.c.
-                        */
                        pci_add_resource(&resources, &ioport_resource);
                        pci_add_resource(&resources, &iomem_resource);
-                       bus = pci_scan_root_bus(NULL, 0, controller->ops, controller, &resources);
+                       bus = pci_scan_root_bus(NULL, 0, controller->ops,
+                                               controller, &resources);
                        controller->root_bus = bus;
                        controller->last_busno = bus->busn_res.end;
                }
@@ -388,6 +385,16 @@ void pcibios_set_master(struct pci_dev *dev)
        /* No special bus mastering setup handling. */
 }
 
+/* Process any "pci=" kernel boot arguments. */
+char *__init pcibios_setup(char *str)
+{
+       if (!strcmp(str, "off")) {
+               pci_probe = 0;
+               return NULL;
+       }
+       return str;
+}
+
 /*
  * Enable memory and/or address decoding, as appropriate, for the
  * device described by the 'dev' struct.
index 6640e7b..a97a645 100644 (file)
@@ -69,19 +69,32 @@ static int pcie_rc[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];
  * a HW PCIe link-training bug. The exact delay is specified with
  * a kernel boot argument in the form of "pcie_rc_delay=T,P,S",
  * where T is the TRIO instance number, P is the port number and S is
- * the delay in seconds. If the delay is not provided, the value
- * will be DEFAULT_RC_DELAY.
+ * the delay in seconds. If the argument is specified, but the delay is
+ * not provided, the value will be DEFAULT_RC_DELAY.
  */
 static int rc_delay[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];
 
 /* Default number of seconds that the PCIe RC port probe can be delayed. */
 #define DEFAULT_RC_DELAY       10
 
-/* Max number of seconds that the PCIe RC port probe can be delayed. */
-#define MAX_RC_DELAY           20
+/* The PCI I/O space size in each PCI domain. */
+#define IO_SPACE_SIZE          0x10000
+
+/* Provide shorter versions of some very long constant names. */
+#define AUTO_CONFIG_RC \
+       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_RC
+#define AUTO_CONFIG_RC_G1      \
+       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_RC_G1
+#define AUTO_CONFIG_EP \
+       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_ENDPOINT
+#define AUTO_CONFIG_EP_G1      \
+       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_ENDPOINT_G1
 
 /* Array of the PCIe ports configuration info obtained from the BIB. */
-struct pcie_port_property pcie_ports[TILEGX_NUM_TRIO][TILEGX_TRIO_PCIES];
+struct pcie_trio_ports_property pcie_ports[TILEGX_NUM_TRIO];
+
+/* Number of configured TRIO instances. */
+int num_trio_shims;
 
 /* All drivers share the TRIO contexts defined here. */
 gxio_trio_context_t trio_contexts[TILEGX_NUM_TRIO];
@@ -89,24 +102,21 @@ gxio_trio_context_t trio_contexts[TILEGX_NUM_TRIO];
 /* Pointer to an array of PCIe RC controllers. */
 struct pci_controller pci_controllers[TILEGX_NUM_TRIO * TILEGX_TRIO_PCIES];
 int num_rc_controllers;
-static int num_ep_controllers;
 
 static struct pci_ops tile_cfg_ops;
 
 /* Mask of CPUs that should receive PCIe interrupts. */
 static struct cpumask intr_cpus_map;
 
-/*
- * We don't need to worry about the alignment of resources.
- */
+/* We don't need to worry about the alignment of resources. */
 resource_size_t pcibios_align_resource(void *data, const struct resource *res,
-                               resource_size_t size, resource_size_t align)
+                                      resource_size_t size,
+                                      resource_size_t align)
 {
        return res->start;
 }
 EXPORT_SYMBOL(pcibios_align_resource);
 
-
 /*
  * Pick a CPU to receive and handle the PCIe interrupts, based on the IRQ #.
  * For now, we simply send interrupts to non-dataplane CPUs.
@@ -134,24 +144,19 @@ static int tile_irq_cpu(int irq)
        return cpu;
 }
 
-/*
- * Open a file descriptor to the TRIO shim.
- */
+/* Open a file descriptor to the TRIO shim. */
 static int tile_pcie_open(int trio_index)
 {
        gxio_trio_context_t *context = &trio_contexts[trio_index];
        int ret;
+       int mac;
 
-       /*
-        * This opens a file descriptor to the TRIO shim.
-        */
+       /* This opens a file descriptor to the TRIO shim. */
        ret = gxio_trio_init(context, trio_index);
        if (ret < 0)
-               return ret;
+               goto gxio_trio_init_failure;
 
-       /*
-        * Allocate an ASID for the kernel.
-        */
+       /* Allocate an ASID for the kernel. */
        ret = gxio_trio_alloc_asids(context, 1, 0, 0);
        if (ret < 0) {
                pr_err("PCI: ASID alloc failure on TRIO %d, give up\n",
@@ -189,31 +194,97 @@ static int tile_pcie_open(int trio_index)
        }
 #endif
 
+       /* Get the properties of the PCIe ports on this TRIO instance. */
+       ret = gxio_trio_get_port_property(context, &pcie_ports[trio_index]);
+       if (ret < 0) {
+               pr_err("PCI: PCIE_GET_PORT_PROPERTY failure, error %d,"
+                      " on TRIO %d\n", ret, trio_index);
+               goto get_port_property_failure;
+       }
+
+       context->mmio_base_mac =
+               iorpc_ioremap(context->fd, 0, HV_TRIO_CONFIG_IOREMAP_SIZE);
+       if (context->mmio_base_mac == NULL) {
+               pr_err("PCI: TRIO config space mapping failure, error %d,"
+                      " on TRIO %d\n", ret, trio_index);
+               ret = -ENOMEM;
+
+               goto trio_mmio_mapping_failure;
+       }
+
+       /* Check the port strap state which will override the BIB setting. */
+       for (mac = 0; mac < TILEGX_TRIO_PCIES; mac++) {
+               TRIO_PCIE_INTFC_PORT_CONFIG_t port_config;
+               unsigned int reg_offset;
+
+               /* Ignore ports that are not specified in the BIB. */
+               if (!pcie_ports[trio_index].ports[mac].allow_rc &&
+                   !pcie_ports[trio_index].ports[mac].allow_ep)
+                       continue;
+
+               reg_offset =
+                       (TRIO_PCIE_INTFC_PORT_CONFIG <<
+                               TRIO_CFG_REGION_ADDR__REG_SHIFT) |
+                       (TRIO_CFG_REGION_ADDR__INTFC_VAL_MAC_INTERFACE <<
+                               TRIO_CFG_REGION_ADDR__INTFC_SHIFT) |
+                       (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
+
+               port_config.word =
+                       __gxio_mmio_read(context->mmio_base_mac + reg_offset);
+
+               if (port_config.strap_state != AUTO_CONFIG_RC &&
+                   port_config.strap_state != AUTO_CONFIG_RC_G1) {
+                       /*
+                        * If this is really intended to be an EP port, record
+                        * it so that the endpoint driver will know about it.
+                        */
+                       if (port_config.strap_state == AUTO_CONFIG_EP ||
+                           port_config.strap_state == AUTO_CONFIG_EP_G1)
+                               pcie_ports[trio_index].ports[mac].allow_ep = 1;
+               }
+       }
+
        return ret;
 
+trio_mmio_mapping_failure:
+get_port_property_failure:
 asid_alloc_failure:
 #ifdef USE_SHARED_PCIE_CONFIG_REGION
 pio_alloc_failure:
 #endif
        hv_dev_close(context->fd);
+gxio_trio_init_failure:
+       context->fd = -1;
 
        return ret;
 }
 
-static void
-tilegx_legacy_irq_ack(struct irq_data *d)
+static int __init tile_trio_init(void)
+{
+       int i;
+
+       /* We loop over all the TRIO shims. */
+       for (i = 0; i < TILEGX_NUM_TRIO; i++) {
+               if (tile_pcie_open(i) < 0)
+                       continue;
+               num_trio_shims++;
+       }
+
+       return 0;
+}
+postcore_initcall(tile_trio_init);
+
+static void tilegx_legacy_irq_ack(struct irq_data *d)
 {
        __insn_mtspr(SPR_IPI_EVENT_RESET_K, 1UL << d->irq);
 }
 
-static void
-tilegx_legacy_irq_mask(struct irq_data *d)
+static void tilegx_legacy_irq_mask(struct irq_data *d)
 {
        __insn_mtspr(SPR_IPI_MASK_SET_K, 1UL << d->irq);
 }
 
-static void
-tilegx_legacy_irq_unmask(struct irq_data *d)
+static void tilegx_legacy_irq_unmask(struct irq_data *d)
 {
        __insn_mtspr(SPR_IPI_MASK_RESET_K, 1UL << d->irq);
 }
@@ -234,8 +305,7 @@ static struct irq_chip tilegx_legacy_irq_chip = {
  * to Linux which just calls handle_level_irq() after clearing the
  * MAC INTx Assert status bit associated with this interrupt.
  */
-static void
-trio_handle_level_irq(unsigned int irq, struct irq_desc *desc)
+static void trio_handle_level_irq(unsigned int irq, struct irq_desc *desc)
 {
        struct pci_controller *controller = irq_desc_get_handler_data(desc);
        gxio_trio_context_t *trio_context = controller->trio;
@@ -301,9 +371,7 @@ static int tile_init_irqs(struct pci_controller *controller)
                        goto free_irqs;
                }
 
-               /*
-                * Register the IRQ handler with the kernel.
-                */
+               /* Register the IRQ handler with the kernel. */
                irq_set_chip_and_handler(irq, &tilegx_legacy_irq_chip,
                                        trio_handle_level_irq);
                irq_set_chip_data(irq, (void *)(uint64_t)i);
@@ -320,14 +388,39 @@ free_irqs:
 }
 
 /*
+ * Return 1 if the port is strapped to operate in RC mode.
+ */
+static int
+strapped_for_rc(gxio_trio_context_t *trio_context, int mac)
+{
+       TRIO_PCIE_INTFC_PORT_CONFIG_t port_config;
+       unsigned int reg_offset;
+
+       /* Check the port configuration. */
+       reg_offset =
+               (TRIO_PCIE_INTFC_PORT_CONFIG <<
+                       TRIO_CFG_REGION_ADDR__REG_SHIFT) |
+               (TRIO_CFG_REGION_ADDR__INTFC_VAL_MAC_INTERFACE <<
+                       TRIO_CFG_REGION_ADDR__INTFC_SHIFT) |
+               (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
+       port_config.word =
+               __gxio_mmio_read(trio_context->mmio_base_mac + reg_offset);
+
+       if (port_config.strap_state == AUTO_CONFIG_RC ||
+           port_config.strap_state == AUTO_CONFIG_RC_G1)
+               return 1;
+       else
+               return 0;
+}
+
+/*
  * Find valid controllers and fill in pci_controller structs for each
  * of them.
  *
- * Returns the number of controllers discovered.
+ * Return the number of controllers discovered.
  */
 int __init tile_pci_init(void)
 {
-       int num_trio_shims = 0;
        int ctl_index = 0;
        int i, j;
 
@@ -338,64 +431,62 @@ int __init tile_pci_init(void)
 
        pr_info("PCI: Searching for controllers...\n");
 
-       /*
-        * We loop over all the TRIO shims.
-        */
-       for (i = 0; i < TILEGX_NUM_TRIO; i++) {
-               int ret;
-
-               ret = tile_pcie_open(i);
-               if (ret < 0)
-                       continue;
-
-               num_trio_shims++;
-       }
-
        if (num_trio_shims == 0 || sim_is_simulator())
                return 0;
 
        /*
-        * Now determine which PCIe ports are configured to operate in RC mode.
-        * We look at the Board Information Block first and then see if there
-        * are any overriding configuration by the HW strapping pin.
+        * Now determine which PCIe ports are configured to operate in RC
+        * mode. There is a differece in the port configuration capability
+        * between the Gx36 and Gx72 devices.
+        *
+        * The Gx36 has configuration capability for each of the 3 PCIe
+        * interfaces (disable, auto endpoint, auto RC, etc.).
+        * On the Gx72, you can only select one of the 3 PCIe interfaces per
+        * TRIO to train automatically. Further, the allowable training modes
+        * are reduced to four options (auto endpoint, auto RC, stream x1,
+        * stream x4).
+        *
+        * For Gx36 ports, it must be allowed to be in RC mode by the
+        * Board Information Block, and the hardware strapping pins must be
+        * set to RC mode.
+        *
+        * For Gx72 ports, the port will operate in RC mode if either of the
+        * following is true:
+        * 1. It is allowed to be in RC mode by the Board Information Block,
+        *    and the BIB doesn't allow the EP mode.
+        * 2. It is allowed to be in either the RC or the EP mode by the BIB,
+        *    and the hardware strapping pin is set to RC mode.
         */
        for (i = 0; i < TILEGX_NUM_TRIO; i++) {
                gxio_trio_context_t *context = &trio_contexts[i];
-               int ret;
 
                if (context->fd < 0)
                        continue;
 
-               ret = hv_dev_pread(context->fd, 0,
-                       (HV_VirtAddr)&pcie_ports[i][0],
-                       sizeof(struct pcie_port_property) * TILEGX_TRIO_PCIES,
-                       GXIO_TRIO_OP_GET_PORT_PROPERTY);
-               if (ret < 0) {
-                       pr_err("PCI: PCIE_GET_PORT_PROPERTY failure, error %d,"
-                               " on TRIO %d\n", ret, i);
-                       continue;
-               }
-
                for (j = 0; j < TILEGX_TRIO_PCIES; j++) {
-                       if (pcie_ports[i][j].allow_rc) {
+                       int is_rc = 0;
+
+                       if (pcie_ports[i].is_gx72 &&
+                           pcie_ports[i].ports[j].allow_rc) {
+                               if (!pcie_ports[i].ports[j].allow_ep ||
+                                   strapped_for_rc(context, j))
+                                       is_rc = 1;
+                       } else if (pcie_ports[i].ports[j].allow_rc &&
+                                  strapped_for_rc(context, j)) {
+                               is_rc = 1;
+                       }
+                       if (is_rc) {
                                pcie_rc[i][j] = 1;
                                num_rc_controllers++;
                        }
-                       else if (pcie_ports[i][j].allow_ep) {
-                               num_ep_controllers++;
-                       }
                }
        }
 
-       /*
-        * Return if no PCIe ports are configured to operate in RC mode.
-        */
+       /* Return if no PCIe ports are configured to operate in RC mode. */
        if (num_rc_controllers == 0)
                return 0;
 
-       /*
-        * Set the TRIO pointer and MAC index for each PCIe RC port.
-        */
+       /* Set the TRIO pointer and MAC index for each PCIe RC port. */
        for (i = 0; i < TILEGX_NUM_TRIO; i++) {
                for (j = 0; j < TILEGX_TRIO_PCIES; j++) {
                        if (pcie_rc[i][j]) {
@@ -411,26 +502,32 @@ int __init tile_pci_init(void)
        }
 
 out:
-       /*
-        * Configure each PCIe RC port.
-        */
+       /* Configure each PCIe RC port. */
        for (i = 0; i < num_rc_controllers; i++) {
-               /*
-                * Configure the PCIe MAC to run in RC mode.
-                */
 
+               /* Configure the PCIe MAC to run in RC mode. */
                struct pci_controller *controller = &pci_controllers[i];
 
                controller->index = i;
                controller->ops = &tile_cfg_ops;
 
+               controller->io_space.start = PCIBIOS_MIN_IO +
+                       (i * IO_SPACE_SIZE);
+               controller->io_space.end = controller->io_space.start +
+                       IO_SPACE_SIZE - 1;
+               BUG_ON(controller->io_space.end > IO_SPACE_LIMIT);
+               controller->io_space.flags = IORESOURCE_IO;
+               snprintf(controller->io_space_name,
+                        sizeof(controller->io_space_name),
+                        "PCI I/O domain %d", i);
+               controller->io_space.name = controller->io_space_name;
+
                /*
                 * The PCI memory resource is located above the PA space.
                 * For every host bridge, the BAR window or the MMIO aperture
                 * is in range [3GB, 4GB - 1] of a 4GB space beyond the
                 * PA space.
                 */
-
                controller->mem_offset = TILE_PCI_MEM_START +
                        (i * TILE_PCI_BAR_WINDOW_TOP);
                controller->mem_space.start = controller->mem_offset +
@@ -458,7 +555,6 @@ static int tile_map_irq(const struct pci_dev *dev, u8 device, u8 pin)
        return controller->irq_intx_table[pin - 1];
 }
 
-
 static void fixup_read_and_payload_sizes(struct pci_controller *controller)
 {
        gxio_trio_context_t *trio_context = controller->trio;
@@ -472,9 +568,7 @@ static void fixup_read_and_payload_sizes(struct pci_controller *controller)
 
        mac = controller->mac;
 
-       /*
-        * Set our max read request size to be 4KB.
-        */
+       /* Set our max read request size to be 4KB. */
        reg_offset =
                (TRIO_PCIE_RC_DEVICE_CONTROL <<
                        TRIO_CFG_REGION_ADDR__REG_SHIFT) |
@@ -483,10 +577,10 @@ static void fixup_read_and_payload_sizes(struct pci_controller *controller)
                (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
 
        dev_control.word = __gxio_mmio_read32(trio_context->mmio_base_mac +
-                                               reg_offset);
+                                             reg_offset);
        dev_control.max_read_req_sz = 5;
        __gxio_mmio_write32(trio_context->mmio_base_mac + reg_offset,
-                                               dev_control.word);
+                           dev_control.word);
 
        /*
         * Set the max payload size supported by this Gx PCIe MAC.
@@ -502,10 +596,10 @@ static void fixup_read_and_payload_sizes(struct pci_controller *controller)
                (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
 
        rc_dev_cap.word = __gxio_mmio_read32(trio_context->mmio_base_mac +
-                                               reg_offset);
+                                            reg_offset);
        rc_dev_cap.mps_sup = 1;
        __gxio_mmio_write32(trio_context->mmio_base_mac + reg_offset,
-                                               rc_dev_cap.word);
+                           rc_dev_cap.word);
 
        /* Configure PCI Express MPS setting. */
        list_for_each_entry(child, &root_bus->children, node)
@@ -528,7 +622,7 @@ static void fixup_read_and_payload_sizes(struct pci_controller *controller)
                                    dev_control.max_payload_size,
                                    dev_control.max_read_req_sz,
                                    mac);
-        if (err < 0) {
+       if (err < 0) {
                pr_err("PCI: PCIE_CONFIGURE_MAC_MPS_MRS failure, "
                        "MAC %d on TRIO %d\n",
                        mac, controller->trio_index);
@@ -565,21 +659,14 @@ static int setup_pcie_rc_delay(char *str)
                if (!isdigit(*str))
                        return -EINVAL;
                delay = simple_strtoul(str, (char **)&str, 10);
-               if (delay > MAX_RC_DELAY)
-                       return -EINVAL;
        }
 
        rc_delay[trio_index][mac] = delay ? : DEFAULT_RC_DELAY;
-       pr_info("Delaying PCIe RC link training for %u sec"
-               " on MAC %lu on TRIO %lu\n", rc_delay[trio_index][mac],
-               mac, trio_index);
        return 0;
 }
 early_param("pcie_rc_delay", setup_pcie_rc_delay);
 
-/*
- * PCI initialization entry point, called by subsys_initcall.
- */
+/* PCI initialization entry point, called by subsys_initcall. */
 int __init pcibios_init(void)
 {
        resource_size_t offset;
@@ -589,35 +676,10 @@ int __init pcibios_init(void)
 
        tile_pci_init();
 
-       if (num_rc_controllers == 0 && num_ep_controllers == 0)
+       if (num_rc_controllers == 0)
                return 0;
 
        /*
-        * We loop over all the TRIO shims and set up the MMIO mappings.
-        */
-       for (i = 0; i < TILEGX_NUM_TRIO; i++) {
-               gxio_trio_context_t *context = &trio_contexts[i];
-
-               if (context->fd < 0)
-                       continue;
-
-               /*
-                * Map in the MMIO space for the MAC.
-                */
-               offset = 0;
-               context->mmio_base_mac =
-                       iorpc_ioremap(context->fd, offset,
-                                     HV_TRIO_CONFIG_IOREMAP_SIZE);
-               if (context->mmio_base_mac == NULL) {
-                       pr_err("PCI: MAC map failure on TRIO %d\n", i);
-
-                       hv_dev_close(context->fd);
-                       context->fd = -1;
-                       continue;
-               }
-       }
-
-       /*
         * Delay a bit in case devices aren't ready.  Some devices are
         * known to require at least 20ms here, but we use a more
         * conservative value.
@@ -628,7 +690,6 @@ int __init pcibios_init(void)
        for (next_busno = 0, i = 0; i < num_rc_controllers; i++) {
                struct pci_controller *controller = &pci_controllers[i];
                gxio_trio_context_t *trio_context = controller->trio;
-               TRIO_PCIE_INTFC_PORT_CONFIG_t port_config;
                TRIO_PCIE_INTFC_PORT_STATUS_t port_status;
                TRIO_PCIE_INTFC_TX_FIFO_CTL_t tx_fifo_ctl;
                struct pci_bus *bus;
@@ -645,75 +706,64 @@ int __init pcibios_init(void)
                mac = controller->mac;
 
                /*
-                * Check the port strap state which will override the BIB
-                * setting.
+                * Check for PCIe link-up status to decide if we need
+                * to force the link to come up.
                 */
-
                reg_offset =
-                       (TRIO_PCIE_INTFC_PORT_CONFIG <<
+                       (TRIO_PCIE_INTFC_PORT_STATUS <<
                                TRIO_CFG_REGION_ADDR__REG_SHIFT) |
                        (TRIO_CFG_REGION_ADDR__INTFC_VAL_MAC_INTERFACE <<
-                               TRIO_CFG_REGION_ADDR__INTFC_SHIFT ) |
+                               TRIO_CFG_REGION_ADDR__INTFC_SHIFT) |
                        (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
 
-               port_config.word =
+               port_status.word =
                        __gxio_mmio_read(trio_context->mmio_base_mac +
                                         reg_offset);
-
-               if ((port_config.strap_state !=
-                       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_RC) &&
-                       (port_config.strap_state !=
-                       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_RC_G1)) {
-                       /*
-                        * If this is really intended to be an EP port,
-                        * record it so that the endpoint driver will know about it.
-                        */
-                       if (port_config.strap_state ==
-                       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_ENDPOINT ||
-                       port_config.strap_state ==
-                       TRIO_PCIE_INTFC_PORT_CONFIG__STRAP_STATE_VAL_AUTO_CONFIG_ENDPOINT_G1)
-                               pcie_ports[trio_index][mac].allow_ep = 1;
-
-                       continue;
+               if (!port_status.dl_up) {
+                       if (rc_delay[trio_index][mac]) {
+                               pr_info("Delaying PCIe RC TRIO init %d sec"
+                                       " on MAC %d on TRIO %d\n",
+                                       rc_delay[trio_index][mac], mac,
+                                       trio_index);
+                               msleep(rc_delay[trio_index][mac] * 1000);
+                       }
+                       ret = gxio_trio_force_rc_link_up(trio_context, mac);
+                       if (ret < 0)
+                               pr_err("PCI: PCIE_FORCE_LINK_UP failure, "
+                                       "MAC %d on TRIO %d\n", mac, trio_index);
                }
 
-               /*
-                * Delay the RC link training if needed.
-                */
-               if (rc_delay[trio_index][mac])
-                       msleep(rc_delay[trio_index][mac] * 1000);
-
-               ret = gxio_trio_force_rc_link_up(trio_context, mac);
-               if (ret < 0)
-                       pr_err("PCI: PCIE_FORCE_LINK_UP failure, "
-                               "MAC %d on TRIO %d\n", mac, trio_index);
-
                pr_info("PCI: Found PCI controller #%d on TRIO %d MAC %d\n", i,
                        trio_index, controller->mac);
 
-               /*
-                * Wait a bit here because some EP devices take longer
-                * to come up.
-                */
-               msleep(1000);
-
-               /*
-                * Check for PCIe link-up status.
-                */
-
-               reg_offset =
-                       (TRIO_PCIE_INTFC_PORT_STATUS <<
-                               TRIO_CFG_REGION_ADDR__REG_SHIFT) |
-                       (TRIO_CFG_REGION_ADDR__INTFC_VAL_MAC_INTERFACE <<
-                               TRIO_CFG_REGION_ADDR__INTFC_SHIFT ) |
-                       (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
+               /* Delay the bus probe if needed. */
+               if (rc_delay[trio_index][mac]) {
+                       pr_info("Delaying PCIe RC bus enumerating %d sec"
+                               " on MAC %d on TRIO %d\n",
+                               rc_delay[trio_index][mac], mac,
+                               trio_index);
+                       msleep(rc_delay[trio_index][mac] * 1000);
+               } else {
+                       /*
+                        * Wait a bit here because some EP devices
+                        * take longer to come up.
+                        */
+                       msleep(1000);
+               }
 
+               /* Check for PCIe link-up status again. */
                port_status.word =
                        __gxio_mmio_read(trio_context->mmio_base_mac +
                                         reg_offset);
                if (!port_status.dl_up) {
-                       pr_err("PCI: link is down, MAC %d on TRIO %d\n",
-                               mac, trio_index);
+                       if (pcie_ports[trio_index].ports[mac].removable) {
+                               pr_info("PCI: link is down, MAC %d on TRIO %d\n",
+                                       mac, trio_index);
+                               pr_info("This is expected if no PCIe card"
+                                       " is connected to this link\n");
+                       } else
+                               pr_err("PCI: link is down, MAC %d on TRIO %d\n",
+                                       mac, trio_index);
                        continue;
                }
 
@@ -739,7 +789,6 @@ int __init pcibios_init(void)
                 * Change the device ID so that Linux bus crawl doesn't confuse
                 * the internal bridge with any Tilera endpoints.
                 */
-
                reg_offset =
                        (TRIO_PCIE_RC_DEVICE_ID_VEN_ID <<
                                TRIO_CFG_REGION_ADDR__REG_SHIFT) |
@@ -752,10 +801,7 @@ int __init pcibios_init(void)
                                    TRIO_PCIE_RC_DEVICE_ID_VEN_ID__DEV_ID_SHIFT) |
                                    TILERA_VENDOR_ID);
 
-               /*
-                * Set the internal P2P bridge class code.
-                */
-
+               /* Set the internal P2P bridge class code. */
                reg_offset =
                        (TRIO_PCIE_RC_REVISION_ID <<
                                TRIO_CFG_REGION_ADDR__REG_SHIFT) |
@@ -766,26 +812,22 @@ int __init pcibios_init(void)
                class_code_revision =
                        __gxio_mmio_read32(trio_context->mmio_base_mac +
                                           reg_offset);
-               class_code_revision = (class_code_revision & 0xff ) |
-                                       (PCI_CLASS_BRIDGE_PCI << 16);
+               class_code_revision = (class_code_revision & 0xff) |
+                       (PCI_CLASS_BRIDGE_PCI << 16);
 
                __gxio_mmio_write32(trio_context->mmio_base_mac +
                                    reg_offset, class_code_revision);
 
 #ifdef USE_SHARED_PCIE_CONFIG_REGION
 
-               /*
-                * Map in the MMIO space for the PIO region.
-                */
+               /* Map in the MMIO space for the PIO region. */
                offset = HV_TRIO_PIO_OFFSET(trio_context->pio_cfg_index) |
                        (((unsigned long long)mac) <<
                        TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT);
 
 #else
 
-               /*
-                * Alloc a PIO region for PCI config access per MAC.
-                */
+               /* Alloc a PIO region for PCI config access per MAC. */
                ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0);
                if (ret < 0) {
                        pr_err("PCI: PCI CFG PIO alloc failure for mac %d "
@@ -796,9 +838,7 @@ int __init pcibios_init(void)
 
                trio_context->pio_cfg_index[mac] = ret;
 
-               /*
-                * For PIO CFG, the bus_address_hi parameter is 0.
-                */
+               /* For PIO CFG, the bus_address_hi parameter is 0. */
                ret = gxio_trio_init_pio_region_aux(trio_context,
                        trio_context->pio_cfg_index[mac],
                        mac, 0, HV_TRIO_PIO_FLAG_CONFIG_SPACE);
@@ -815,9 +855,15 @@ int __init pcibios_init(void)
 
 #endif
 
+               /*
+                * To save VMALLOC space, we take advantage of the fact that
+                * bit 29 in the PIO CFG address format is reserved 0. With
+                * TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT being 30,
+                * this cuts VMALLOC space usage from 1GB to 512MB per mac.
+                */
                trio_context->mmio_base_pio_cfg[mac] =
-                       iorpc_ioremap(trio_context->fd, offset,
-                       (1 << TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT));
+                       iorpc_ioremap(trio_context->fd, offset, (1UL <<
+                       (TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT - 1)));
                if (trio_context->mmio_base_pio_cfg[mac] == NULL) {
                        pr_err("PCI: PIO map failure for mac %d on TRIO %d\n",
                                mac, trio_index);
@@ -825,9 +871,7 @@ int __init pcibios_init(void)
                        continue;
                }
 
-               /*
-                * Initialize the PCIe interrupts.
-                */
+               /* Initialize the PCIe interrupts. */
                if (tile_init_irqs(controller)) {
                        pr_err("PCI: IRQs init failure for mac %d on TRIO %d\n",
                                mac, trio_index);
@@ -838,17 +882,16 @@ int __init pcibios_init(void)
                /*
                 * The PCI memory resource is located above the PA space.
                 * The memory range for the PCI root bus should not overlap
-                * with the physical RAM
+                * with the physical RAM.
                 */
                pci_add_resource_offset(&resources, &controller->mem_space,
                                        controller->mem_offset);
-
+               pci_add_resource(&resources, &controller->io_space);
                controller->first_busno = next_busno;
                bus = pci_scan_root_bus(NULL, next_busno, controller->ops,
                                        controller, &resources);
                controller->root_bus = bus;
                next_busno = bus->busn_res.end + 1;
-
        }
 
        /* Do machine dependent PCI interrupt routing */
@@ -860,7 +903,6 @@ int __init pcibios_init(void)
         * It allocates all of the resources (I/O memory, etc)
         * associated with the devices read in above.
         */
-
        pci_assign_unassigned_resources();
 
        /* Record the I/O resources in the PCI controller structure. */
@@ -868,9 +910,6 @@ int __init pcibios_init(void)
                struct pci_controller *controller = &pci_controllers[i];
                gxio_trio_context_t *trio_context = controller->trio;
                struct pci_bus *root_bus = pci_controllers[i].root_bus;
-               struct pci_bus *next_bus;
-               uint32_t bus_address_hi;
-               struct pci_dev *dev;
                int ret;
                int j;
 
@@ -884,43 +923,12 @@ int __init pcibios_init(void)
                /* Configure the max_payload_size values for this domain. */
                fixup_read_and_payload_sizes(controller);
 
-               list_for_each_entry(dev, &root_bus->devices, bus_list) {
-                       /* Find the PCI host controller, ie. the 1st bridge. */
-                       if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
-                               (PCI_SLOT(dev->devfn) == 0)) {
-                               next_bus = dev->subordinate;
-                               pci_controllers[i].mem_resources[0] =
-                                       *next_bus->resource[0];
-                               pci_controllers[i].mem_resources[1] =
-                                        *next_bus->resource[1];
-                               pci_controllers[i].mem_resources[2] =
-                                        *next_bus->resource[2];
-
-                               break;
-                       }
-               }
-
-               if (pci_controllers[i].mem_resources[1].flags & IORESOURCE_MEM)
-                       bus_address_hi =
-                               pci_controllers[i].mem_resources[1].start >> 32;
-               else if (pci_controllers[i].mem_resources[2].flags & IORESOURCE_PREFETCH)
-                       bus_address_hi =
-                               pci_controllers[i].mem_resources[2].start >> 32;
-               else {
-                       /* This is unlikely. */
-                       pr_err("PCI: no memory resources on TRIO %d mac %d\n",
-                               controller->trio_index, controller->mac);
-                       continue;
-               }
-
-               /*
-                * Alloc a PIO region for PCI memory access for each RC port.
-                */
+               /* Alloc a PIO region for PCI memory access for each RC port. */
                ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0);
                if (ret < 0) {
                        pr_err("PCI: MEM PIO alloc failure on TRIO %d mac %d, "
-                               "give up\n", controller->trio_index,
-                               controller->mac);
+                              "give up\n", controller->trio_index,
+                              controller->mac);
 
                        continue;
                }
@@ -938,12 +946,45 @@ int __init pcibios_init(void)
                                                    0);
                if (ret < 0) {
                        pr_err("PCI: MEM PIO init failure on TRIO %d mac %d, "
-                               "give up\n", controller->trio_index,
-                               controller->mac);
+                              "give up\n", controller->trio_index,
+                              controller->mac);
 
                        continue;
                }
 
+#ifdef CONFIG_TILE_PCI_IO
+               /*
+                * Alloc a PIO region for PCI I/O space access for each RC port.
+                */
+               ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0);
+               if (ret < 0) {
+                       pr_err("PCI: I/O PIO alloc failure on TRIO %d mac %d, "
+                              "give up\n", controller->trio_index,
+                              controller->mac);
+
+                       continue;
+               }
+
+               controller->pio_io_index = ret;
+
+               /*
+                * For PIO IO, the bus_address_hi parameter is hard-coded 0
+                * because PCI I/O address space is 32-bit.
+                */
+               ret = gxio_trio_init_pio_region_aux(trio_context,
+                                                   controller->pio_io_index,
+                                                   controller->mac,
+                                                   0,
+                                                   HV_TRIO_PIO_FLAG_IO_SPACE);
+               if (ret < 0) {
+                       pr_err("PCI: I/O PIO init failure on TRIO %d mac %d, "
+                              "give up\n", controller->trio_index,
+                              controller->mac);
+
+                       continue;
+               }
+#endif
+
                /*
                 * Configure a Mem-Map region for each memory controller so
                 * that Linux can map all of its PA space to the PCI bus.
@@ -958,9 +999,9 @@ int __init pcibios_init(void)
                                                          0);
                        if (ret < 0) {
                                pr_err("PCI: Mem-Map alloc failure on TRIO %d "
-                                       "mac %d for MC %d, give up\n",
-                                       controller->trio_index,
-                                       controller->mac, j);
+                                      "mac %d for MC %d, give up\n",
+                                      controller->trio_index,
+                                      controller->mac, j);
 
                                goto alloc_mem_map_failed;
                        }
@@ -991,9 +1032,9 @@ int __init pcibios_init(void)
                                GXIO_TRIO_ORDER_MODE_UNORDERED);
                        if (ret < 0) {
                                pr_err("PCI: Mem-Map init failure on TRIO %d "
-                                       "mac %d for MC %d, give up\n",
-                                       controller->trio_index,
-                                       controller->mac, j);
+                                      "mac %d for MC %d, give up\n",
+                                      controller->trio_index,
+                                      controller->mac, j);
 
                                goto alloc_mem_map_failed;
                        }
@@ -1002,23 +1043,19 @@ int __init pcibios_init(void)
 alloc_mem_map_failed:
                        break;
                }
-
        }
 
        return 0;
 }
 subsys_initcall(pcibios_init);
 
-/* Note: to be deleted after Linux 3.6 merge. */
+/* No bus fixups needed. */
 void pcibios_fixup_bus(struct pci_bus *bus)
 {
 }
 
-/*
- * This can be called from the generic PCI layer, but doesn't need to
- * do anything.
- */
-char *pcibios_setup(char *str)
+/* Process any "pci=" kernel boot arguments. */
+char *__init pcibios_setup(char *str)
 {
        if (!strcmp(str, "off")) {
                pci_probe = 0;
@@ -1029,8 +1066,7 @@ char *pcibios_setup(char *str)
 
 /*
  * Enable memory address decoding, as appropriate, for the
- * device described by the 'dev' struct. The I/O decoding
- * is disabled, though the TILE-Gx supports I/O addressing.
+ * device described by the 'dev' struct.
  *
  * This is called from the generic PCI layer, and can be called
  * for bridges or endpoints.
@@ -1040,13 +1076,24 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
        return pci_enable_resources(dev, mask);
 }
 
-/* Called for each device after PCI setup is done. */
+/*
+ * Called for each device after PCI setup is done.
+ * We initialize the PCI device capabilities conservatively, assuming that
+ * all devices can only address the 32-bit DMA space. The exception here is
+ * that the device dma_offset is set to the value that matches the 64-bit
+ * capable devices. This is OK because dma_offset is not used by legacy
+ * dma_ops, nor by the hybrid dma_ops's streaming DMAs, which are 64-bit ops.
+ * This implementation matches the kernel design of setting PCI devices'
+ * coherent_dma_mask to 0xffffffffull by default, allowing the device drivers
+ * to skip calling pci_set_consistent_dma_mask(DMA_BIT_MASK(32)).
+ */
 static void pcibios_fixup_final(struct pci_dev *pdev)
 {
-       set_dma_ops(&pdev->dev, gx_pci_dma_map_ops);
+       set_dma_ops(&pdev->dev, gx_legacy_pci_dma_map_ops);
        set_dma_offset(&pdev->dev, TILE_PCI_MEM_MAP_BASE_OFFSET);
        pdev->dev.archdata.max_direct_dma_addr =
                TILE_PCI_MAX_DIRECT_DMA_ADDRESS;
+       pdev->dev.coherent_dma_mask = TILE_PCI_MAX_DIRECT_DMA_ADDRESS;
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);
 
@@ -1060,19 +1107,15 @@ void __iomem *ioremap(resource_size_t phys_addr, unsigned long size)
        resource_size_t start;
        resource_size_t end;
        int trio_fd;
-       int i, j;
+       int i;
 
        start = phys_addr;
        end = phys_addr + size - 1;
 
        /*
-        * In the following, each PCI controller's mem_resources[1]
-        * represents its (non-prefetchable) PCI memory resource and
-        * mem_resources[2] refers to its prefetchable PCI memory resource.
-        * By searching phys_addr in each controller's mem_resources[], we can
+        * By searching phys_addr in each controller's mem_space, we can
         * determine the controller that should accept the PCI memory access.
         */
-
        for (i = 0; i < num_rc_controllers; i++) {
                /*
                 * Skip controllers that are not properly initialized or
@@ -1081,25 +1124,18 @@ void __iomem *ioremap(resource_size_t phys_addr, unsigned long size)
                if (pci_controllers[i].root_bus == NULL)
                        continue;
 
-               for (j = 1; j < 3; j++) {
-                       bar_start =
-                               pci_controllers[i].mem_resources[j].start;
-                       bar_end =
-                               pci_controllers[i].mem_resources[j].end;
-
-                       if ((start >= bar_start) && (end <= bar_end)) {
+               bar_start = pci_controllers[i].mem_space.start;
+               bar_end = pci_controllers[i].mem_space.end;
 
-                               controller = &pci_controllers[i];
-
-                               goto got_it;
-                       }
+               if ((start >= bar_start) && (end <= bar_end)) {
+                       controller = &pci_controllers[i];
+                       break;
                }
        }
 
        if (controller == NULL)
                return NULL;
 
-got_it:
        trio_fd = controller->trio->fd;
 
        /* Convert the resource start to the bus address offset. */
@@ -1107,14 +1143,71 @@ got_it:
 
        offset = HV_TRIO_PIO_OFFSET(controller->pio_mem_index) + start;
 
-       /*
-        * We need to keep the PCI bus address's in-page offset in the VA.
-        */
+       /* We need to keep the PCI bus address's in-page offset in the VA. */
        return iorpc_ioremap(trio_fd, offset, size) +
-               (phys_addr & (PAGE_SIZE - 1));
+               (start & (PAGE_SIZE - 1));
 }
 EXPORT_SYMBOL(ioremap);
 
+#ifdef CONFIG_TILE_PCI_IO
+/* Map a PCI I/O address into VA space. */
+void __iomem *ioport_map(unsigned long port, unsigned int size)
+{
+       struct pci_controller *controller = NULL;
+       resource_size_t bar_start;
+       resource_size_t bar_end;
+       resource_size_t offset;
+       resource_size_t start;
+       resource_size_t end;
+       int trio_fd;
+       int i;
+
+       start = port;
+       end = port + size - 1;
+
+       /*
+        * By searching the port in each controller's io_space, we can
+        * determine the controller that should accept the PCI I/O access.
+        */
+       for (i = 0; i < num_rc_controllers; i++) {
+               /*
+                * Skip controllers that are not properly initialized or
+                * have down links.
+                */
+               if (pci_controllers[i].root_bus == NULL)
+                       continue;
+
+               bar_start = pci_controllers[i].io_space.start;
+               bar_end = pci_controllers[i].io_space.end;
+
+               if ((start >= bar_start) && (end <= bar_end)) {
+                       controller = &pci_controllers[i];
+                       break;
+               }
+       }
+
+       if (controller == NULL)
+               return NULL;
+
+       trio_fd = controller->trio->fd;
+
+       /* Convert the resource start to the bus address offset. */
+       port -= controller->io_space.start;
+
+       offset = HV_TRIO_PIO_OFFSET(controller->pio_io_index) + port;
+
+       /* We need to keep the PCI bus address's in-page offset in the VA. */
+       return iorpc_ioremap(trio_fd, offset, size) + (port & (PAGE_SIZE - 1));
+}
+EXPORT_SYMBOL(ioport_map);
+
+void ioport_unmap(void __iomem *addr)
+{
+       iounmap(addr);
+}
+EXPORT_SYMBOL(ioport_unmap);
+#endif
+
 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 {
        iounmap(addr);
@@ -1136,7 +1229,6 @@ EXPORT_SYMBOL(pci_iounmap);
  * offset is in bytes, from the start of config space for the
  * specified bus & device.
  */
-
 static int tile_cfg_read(struct pci_bus *bus, unsigned int devfn, int offset,
                         int size, u32 *val)
 {
@@ -1186,7 +1278,6 @@ static int tile_cfg_read(struct pci_bus *bus, unsigned int devfn, int offset,
         * Accesses to the directly attached device have to be
         * sent as type-0 configs.
         */
-
        if (busnum == (controller->first_busno + 1)) {
                /*
                 * There is only one device off of our built-in P2P bridge.
@@ -1208,9 +1299,8 @@ static int tile_cfg_read(struct pci_bus *bus, unsigned int devfn, int offset,
         * Note that we don't set the mac field in cfg_addr because the
         * mapping is per port.
         */
-
        mmio_addr = trio_context->mmio_base_pio_cfg[controller->mac] +
-                       cfg_addr.word;
+               cfg_addr.word;
 
 valid_device:
 
@@ -1314,7 +1404,6 @@ static int tile_cfg_write(struct pci_bus *bus, unsigned int devfn, int offset,
         * Accesses to the directly attached device have to be
         * sent as type-0 configs.
         */
-
        if (busnum == (controller->first_busno + 1)) {
                /*
                 * There is only one device off of our built-in P2P bridge.
@@ -1336,7 +1425,6 @@ static int tile_cfg_write(struct pci_bus *bus, unsigned int devfn, int offset,
         * Note that we don't set the mac field in cfg_addr because the
         * mapping is per port.
         */
-
        mmio_addr = trio_context->mmio_base_pio_cfg[controller->mac] +
                        cfg_addr.word;
 
@@ -1374,11 +1462,8 @@ static struct pci_ops tile_cfg_ops = {
 };
 
 
-/*
- * MSI support starts here.
- */
-static unsigned int
-tilegx_msi_startup(struct irq_data *d)
+/* MSI support starts here. */
+static unsigned int tilegx_msi_startup(struct irq_data *d)
 {
        if (d->msi_desc)
                unmask_msi_irq(d);
@@ -1386,21 +1471,18 @@ tilegx_msi_startup(struct irq_data *d)
        return 0;
 }
 
-static void
-tilegx_msi_ack(struct irq_data *d)
+static void tilegx_msi_ack(struct irq_data *d)
 {
        __insn_mtspr(SPR_IPI_EVENT_RESET_K, 1UL << d->irq);
 }
 
-static void
-tilegx_msi_mask(struct irq_data *d)
+static void tilegx_msi_mask(struct irq_data *d)
 {
        mask_msi_irq(d);
        __insn_mtspr(SPR_IPI_MASK_SET_K, 1UL << d->irq);
 }
 
-static void
-tilegx_msi_unmask(struct irq_data *d)
+static void tilegx_msi_unmask(struct irq_data *d)
 {
        __insn_mtspr(SPR_IPI_MASK_RESET_K, 1UL << d->irq);
        unmask_msi_irq(d);
@@ -1457,32 +1539,55 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
        trio_context = controller->trio;
 
        /*
-        * Allocate the Mem-Map that will accept the MSI write and
-        * trigger the TILE-side interrupts.
+        * Allocate a scatter-queue that will accept the MSI write and
+        * trigger the TILE-side interrupts. We use the scatter-queue regions
+        * before the mem map regions, because the latter are needed by more
+        * applications.
         */
-       mem_map = gxio_trio_alloc_memory_maps(trio_context, 1, 0, 0);
-       if (mem_map < 0) {
-               dev_printk(KERN_INFO, &pdev->dev,
-                       "%s Mem-Map alloc failure. "
-                       "Failed to initialize MSI interrupts. "
-                       "Falling back to legacy interrupts.\n",
-                       desc->msi_attrib.is_msix ? "MSI-X" : "MSI");
+       mem_map = gxio_trio_alloc_scatter_queues(trio_context, 1, 0, 0);
+       if (mem_map >= 0) {
+               TRIO_MAP_SQ_DOORBELL_FMT_t doorbell_template = {{
+                       .pop = 0,
+                       .doorbell = 1,
+               }};
+
+               mem_map += TRIO_NUM_MAP_MEM_REGIONS;
+               mem_map_base = MEM_MAP_INTR_REGIONS_BASE +
+                       mem_map * MEM_MAP_INTR_REGION_SIZE;
+               mem_map_limit = mem_map_base + MEM_MAP_INTR_REGION_SIZE - 1;
+
+               msi_addr = mem_map_base + MEM_MAP_INTR_REGION_SIZE - 8;
+               msg.data = (unsigned int)doorbell_template.word;
+       } else {
+               /* SQ regions are out, allocate from map mem regions. */
+               mem_map = gxio_trio_alloc_memory_maps(trio_context, 1, 0, 0);
+               if (mem_map < 0) {
+                       dev_printk(KERN_INFO, &pdev->dev,
+                               "%s Mem-Map alloc failure. "
+                               "Failed to initialize MSI interrupts. "
+                               "Falling back to legacy interrupts.\n",
+                               desc->msi_attrib.is_msix ? "MSI-X" : "MSI");
+                       ret = -ENOMEM;
+                       goto msi_mem_map_alloc_failure;
+               }
 
-               ret = -ENOMEM;
-               goto msi_mem_map_alloc_failure;
+               mem_map_base = MEM_MAP_INTR_REGIONS_BASE +
+                       mem_map * MEM_MAP_INTR_REGION_SIZE;
+               mem_map_limit = mem_map_base + MEM_MAP_INTR_REGION_SIZE - 1;
+
+               msi_addr = mem_map_base + TRIO_MAP_MEM_REG_INT3 -
+                       TRIO_MAP_MEM_REG_INT0;
+
+               msg.data = mem_map;
        }
 
        /* We try to distribute different IRQs to different tiles. */
        cpu = tile_irq_cpu(irq);
 
        /*
-        * Now call up to the HV to configure the Mem-Map interrupt and
+        * Now call up to the HV to configure the MSI interrupt and
         * set up the IPI binding.
         */
-       mem_map_base = MEM_MAP_INTR_REGIONS_BASE +
-               mem_map * MEM_MAP_INTR_REGION_SIZE;
-       mem_map_limit = mem_map_base + MEM_MAP_INTR_REGION_SIZE - 1;
-
        ret = gxio_trio_config_msi_intr(trio_context, cpu_x(cpu), cpu_y(cpu),
                                        KERNEL_PL, irq, controller->mac,
                                        mem_map, mem_map_base, mem_map_limit,
@@ -1495,13 +1600,9 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
 
        irq_set_msi_desc(irq, desc);
 
-       msi_addr = mem_map_base + TRIO_MAP_MEM_REG_INT3 - TRIO_MAP_MEM_REG_INT0;
-
        msg.address_hi = msi_addr >> 32;
        msg.address_lo = msi_addr & 0xffffffff;
 
-       msg.data = mem_map;
-
        write_msi_msg(irq, &msg);
        irq_set_chip_and_handler(irq, &tilegx_msi_chip, handle_level_irq);
        irq_set_handler_data(irq, controller);
index dafc447..681100c 100644 (file)
@@ -113,7 +113,6 @@ arch_initcall(proc_tile_init);
  * Support /proc/sys/tile directory
  */
 
-#ifndef __tilegx__  /* FIXME: GX: no support for unaligned access yet */
 static ctl_table unaligned_subtable[] = {
        {
                .procname       = "enabled",
@@ -160,4 +159,3 @@ static int __init proc_sys_tile_init(void)
 }
 
 arch_initcall(proc_sys_tile_init);
-#endif
index 8ac3044..16ed589 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/syscalls.h>
 #include <asm/traps.h>
 #include <asm/setup.h>
+#include <asm/uaccess.h>
 #ifdef CONFIG_HARDWALL
 #include <asm/hardwall.h>
 #endif
@@ -74,19 +75,6 @@ void arch_release_thread_info(struct thread_info *info)
 {
        struct single_step_state *step_state = info->step_state;
 
-#ifdef CONFIG_HARDWALL
-       /*
-        * We free a thread_info from the context of the task that has
-        * been scheduled next, so the original task is already dead.
-        * Calling deactivate here just frees up the data structures.
-        * If the task we're freeing held the last reference to a
-        * hardwall fd, it would have been released prior to this point
-        * anyway via exit_files(), and the hardwall_task.info pointers
-        * would be NULL by now.
-        */
-       hardwall_deactivate_all(info->task);
-#endif
-
        if (step_state) {
 
                /*
@@ -160,6 +148,14 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
         */
        task_thread_info(p)->step_state = NULL;
 
+#ifdef __tilegx__
+       /*
+        * Do not clone unalign jit fixup from the parent; each thread
+        * must allocate its own on demand.
+        */
+       task_thread_info(p)->unalign_jit_base = NULL;
+#endif
+
        /*
         * Copy the registers onto the kernel stack so the
         * return-from-interrupt code will reload it into registers.
@@ -191,16 +187,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
        memset(&p->thread.dma_async_tlb, 0, sizeof(struct async_tlb));
 #endif
 
-#if CHIP_HAS_SN_PROC()
-       /* Likewise, the new thread is not running static processor code. */
-       p->thread.sn_proc_running = 0;
-       memset(&p->thread.sn_async_tlb, 0, sizeof(struct async_tlb));
-#endif
-
-#if CHIP_HAS_PROC_STATUS_SPR()
        /* New thread has its miscellaneous processor state bits clear. */
        p->thread.proc_status = 0;
-#endif
 
 #ifdef CONFIG_HARDWALL
        /* New thread does not own any networks. */
@@ -218,19 +206,32 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
        return 0;
 }
 
+int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
+{
+       task_thread_info(tsk)->align_ctl = val;
+       return 0;
+}
+
+int get_unalign_ctl(struct task_struct *tsk, unsigned long adr)
+{
+       return put_user(task_thread_info(tsk)->align_ctl,
+                       (unsigned int __user *)adr);
+}
+
+static struct task_struct corrupt_current = { .comm = "<corrupt>" };
+
 /*
  * Return "current" if it looks plausible, or else a pointer to a dummy.
  * This can be helpful if we are just trying to emit a clean panic.
  */
 struct task_struct *validate_current(void)
 {
-       static struct task_struct corrupt = { .comm = "<corrupt>" };
        struct task_struct *tsk = current;
        if (unlikely((unsigned long)tsk < PAGE_OFFSET ||
                     (high_memory && (void *)tsk > high_memory) ||
                     ((unsigned long)tsk & (__alignof__(*tsk) - 1)) != 0)) {
                pr_err("Corrupt 'current' %p (sp %#lx)\n", tsk, stack_pointer);
-               tsk = &corrupt;
+               tsk = &corrupt_current;
        }
        return tsk;
 }
@@ -369,15 +370,11 @@ static void save_arch_state(struct thread_struct *t)
        t->system_save[2] = __insn_mfspr(SPR_SYSTEM_SAVE_0_2);
        t->system_save[3] = __insn_mfspr(SPR_SYSTEM_SAVE_0_3);
        t->intctrl_0 = __insn_mfspr(SPR_INTCTRL_0_STATUS);
-#if CHIP_HAS_PROC_STATUS_SPR()
        t->proc_status = __insn_mfspr(SPR_PROC_STATUS);
-#endif
 #if !CHIP_HAS_FIXED_INTVEC_BASE()
        t->interrupt_vector_base = __insn_mfspr(SPR_INTERRUPT_VECTOR_BASE_0);
 #endif
-#if CHIP_HAS_TILE_RTF_HWM()
        t->tile_rtf_hwm = __insn_mfspr(SPR_TILE_RTF_HWM);
-#endif
 #if CHIP_HAS_DSTREAM_PF()
        t->dstream_pf = __insn_mfspr(SPR_DSTREAM_PF);
 #endif
@@ -398,15 +395,11 @@ static void restore_arch_state(const struct thread_struct *t)
        __insn_mtspr(SPR_SYSTEM_SAVE_0_2, t->system_save[2]);
        __insn_mtspr(SPR_SYSTEM_SAVE_0_3, t->system_save[3]);
        __insn_mtspr(SPR_INTCTRL_0_STATUS, t->intctrl_0);
-#if CHIP_HAS_PROC_STATUS_SPR()
        __insn_mtspr(SPR_PROC_STATUS, t->proc_status);
-#endif
 #if !CHIP_HAS_FIXED_INTVEC_BASE()
        __insn_mtspr(SPR_INTERRUPT_VECTOR_BASE_0, t->interrupt_vector_base);
 #endif
-#if CHIP_HAS_TILE_RTF_HWM()
        __insn_mtspr(SPR_TILE_RTF_HWM, t->tile_rtf_hwm);
-#endif
 #if CHIP_HAS_DSTREAM_PF()
        __insn_mtspr(SPR_DSTREAM_PF, t->dstream_pf);
 #endif
@@ -415,26 +408,11 @@ static void restore_arch_state(const struct thread_struct *t)
 
 void _prepare_arch_switch(struct task_struct *next)
 {
-#if CHIP_HAS_SN_PROC()
-       int snctl;
-#endif
 #if CHIP_HAS_TILE_DMA()
        struct tile_dma_state *dma = &current->thread.tile_dma_state;
        if (dma->enabled)
                save_tile_dma_state(dma);
 #endif
-#if CHIP_HAS_SN_PROC()
-       /*
-        * Suspend the static network processor if it was running.
-        * We do not suspend the fabric itself, just like we don't
-        * try to suspend the UDN.
-        */
-       snctl = __insn_mfspr(SPR_SNCTL);
-       current->thread.sn_proc_running =
-               (snctl & SPR_SNCTL__FRZPROC_MASK) == 0;
-       if (current->thread.sn_proc_running)
-               __insn_mtspr(SPR_SNCTL, snctl | SPR_SNCTL__FRZPROC_MASK);
-#endif
 }
 
 
@@ -462,17 +440,6 @@ struct task_struct *__sched _switch_to(struct task_struct *prev,
        /* Restore other arch state. */
        restore_arch_state(&next->thread);
 
-#if CHIP_HAS_SN_PROC()
-       /*
-        * Restart static network processor in the new process
-        * if it was running before.
-        */
-       if (next->thread.sn_proc_running) {
-               int snctl = __insn_mfspr(SPR_SNCTL);
-               __insn_mtspr(SPR_SNCTL, snctl & ~SPR_SNCTL__FRZPROC_MASK);
-       }
-#endif
-
 #ifdef CONFIG_HARDWALL
        /* Enable or disable access to the network registers appropriately. */
        hardwall_switch_tasks(prev, next);
@@ -514,7 +481,7 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
                schedule();
                return 1;
        }
-#if CHIP_HAS_TILE_DMA() || CHIP_HAS_SN_PROC()
+#if CHIP_HAS_TILE_DMA()
        if (thread_info_flags & _TIF_ASYNC_TLB) {
                do_async_page_fault(regs);
                return 1;
@@ -564,7 +531,15 @@ void flush_thread(void)
  */
 void exit_thread(void)
 {
-       /* Nothing */
+#ifdef CONFIG_HARDWALL
+       /*
+        * Remove the task from the list of tasks that are associated
+        * with any live hardwalls.  (If the task that is exiting held
+        * the last reference to a hardwall fd, it would already have
+        * been released and deactivated at this point.)
+        */
+       hardwall_deactivate_all(current);
+#endif
 }
 
 void show_regs(struct pt_regs *regs)
@@ -573,23 +548,24 @@ void show_regs(struct pt_regs *regs)
        int i;
 
        pr_err("\n");
-       show_regs_print_info(KERN_ERR);
+       if (tsk != &corrupt_current)
+               show_regs_print_info(KERN_ERR);
 #ifdef __tilegx__
-       for (i = 0; i < 51; i += 3)
+       for (i = 0; i < 17; i++)
                pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT" r%-2d: "REGFMT"\n",
-                      i, regs->regs[i], i+1, regs->regs[i+1],
-                      i+2, regs->regs[i+2]);
-       pr_err(" r51: "REGFMT" r52: "REGFMT" tp : "REGFMT"\n",
-              regs->regs[51], regs->regs[52], regs->tp);
+                      i, regs->regs[i], i+18, regs->regs[i+18],
+                      i+36, regs->regs[i+36]);
+       pr_err(" r17: "REGFMT" r35: "REGFMT" tp : "REGFMT"\n",
+              regs->regs[17], regs->regs[35], regs->tp);
        pr_err(" sp : "REGFMT" lr : "REGFMT"\n", regs->sp, regs->lr);
 #else
-       for (i = 0; i < 52; i += 4)
+       for (i = 0; i < 13; i++)
                pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT
                       " r%-2d: "REGFMT" r%-2d: "REGFMT"\n",
-                      i, regs->regs[i], i+1, regs->regs[i+1],
-                      i+2, regs->regs[i+2], i+3, regs->regs[i+3]);
-       pr_err(" r52: "REGFMT" tp : "REGFMT" sp : "REGFMT" lr : "REGFMT"\n",
-              regs->regs[52], regs->tp, regs->sp, regs->lr);
+                      i, regs->regs[i], i+14, regs->regs[i+14],
+                      i+27, regs->regs[i+27], i+40, regs->regs[i+40]);
+       pr_err(" r13: "REGFMT" tp : "REGFMT" sp : "REGFMT" lr : "REGFMT"\n",
+              regs->regs[13], regs->tp, regs->sp, regs->lr);
 #endif
        pr_err(" pc : "REGFMT" ex1: %ld     faultnum: %ld\n",
               regs->pc, regs->ex1, regs->faultnum);
index 0f83ed4..de98c6d 100644 (file)
@@ -265,6 +265,21 @@ int do_syscall_trace_enter(struct pt_regs *regs)
 
 void do_syscall_trace_exit(struct pt_regs *regs)
 {
+       long errno;
+
+       /*
+        * The standard tile calling convention returns the value (or negative
+        * errno) in r0, and zero (or positive errno) in r1.
+        * It saves a couple of cycles on the hot path to do this work in
+        * registers only as we return, rather than updating the in-memory
+        * struct ptregs.
+        */
+       errno = (long) regs->regs[0];
+       if (errno < 0 && errno > -4096)
+               regs->regs[1] = -errno;
+       else
+               regs->regs[1] = 0;
+
        if (test_thread_flag(TIF_SYSCALL_TRACE))
                tracehook_report_syscall_exit(regs, 0);
 
@@ -272,7 +287,7 @@ void do_syscall_trace_exit(struct pt_regs *regs)
                trace_sys_exit(regs, regs->regs[0]);
 }
 
-void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code)
+void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs)
 {
        struct siginfo info;
 
@@ -288,5 +303,5 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code)
 /* Handle synthetic interrupt delivered only by the simulator. */
 void __kprobes do_breakpoint(struct pt_regs* regs, int fault_num)
 {
-       send_sigtrap(current, regs, fault_num);
+       send_sigtrap(current, regs);
 }
index d1b5c91..6c5d2c0 100644 (file)
@@ -27,7 +27,6 @@
 
 void machine_halt(void)
 {
-       warn_early_printk();
        arch_local_irq_disable_all();
        smp_send_stop();
        hv_halt();
@@ -35,7 +34,6 @@ void machine_halt(void)
 
 void machine_power_off(void)
 {
-       warn_early_printk();
        arch_local_irq_disable_all();
        smp_send_stop();
        hv_power_off();
index c12280c..542cae1 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/switch_to.h>
 
 /*
- * See <asm/system.h>; called with prev and next task_struct pointers.
+ * See <asm/switch_to.h>; called with prev and next task_struct pointers.
  * "prev" is returned in r0 for _switch_to and also for ret_from_fork.
  *
  * We want to save pc/sp in "prev", and get the new pc/sp from "next".
@@ -39,7 +39,7 @@
  */
 
 #if CALLEE_SAVED_REGS_COUNT != 24
-# error Mismatch between <asm/system.h> and kernel/entry.S
+# error Mismatch between <asm/switch_to.h> and kernel/entry.S
 #endif
 #define FRAME_SIZE ((2 + CALLEE_SAVED_REGS_COUNT) * 4)
 
index 0829fd0..bbffcc6 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/switch_to.h>
 
 /*
- * See <asm/system.h>; called with prev and next task_struct pointers.
+ * See <asm/switch_to.h>; called with prev and next task_struct pointers.
  * "prev" is returned in r0 for _switch_to and also for ret_from_fork.
  *
  * We want to save pc/sp in "prev", and get the new pc/sp from "next".
@@ -39,7 +39,7 @@
  */
 
 #if CALLEE_SAVED_REGS_COUNT != 24
-# error Mismatch between <asm/system.h> and kernel/entry.S
+# error Mismatch between <asm/switch_to.h> and kernel/entry.S
 #endif
 #define FRAME_SIZE ((2 + CALLEE_SAVED_REGS_COUNT) * 8)
 
index 010b418..e44fbcf 100644 (file)
 #include <asm/page.h>
 #include <hv/hypervisor.h>
 
-#define ___hvb MEM_SV_INTRPT + HV_GLUE_START_CPA
-
-#define ___hv_dispatch(f) (___hvb + (HV_DISPATCH_ENTRY_SIZE * f))
-
-#define ___hv_console_putc ___hv_dispatch(HV_DISPATCH_CONSOLE_PUTC)
-#define ___hv_halt         ___hv_dispatch(HV_DISPATCH_HALT)
-#define ___hv_reexec       ___hv_dispatch(HV_DISPATCH_REEXEC)
-#define ___hv_flush_remote ___hv_dispatch(HV_DISPATCH_FLUSH_REMOTE)
-
 #undef RELOCATE_NEW_KERNEL_VERBOSE
 
 STD_ENTRY(relocate_new_kernel)
@@ -43,8 +34,8 @@ STD_ENTRY(relocate_new_kernel)
        addi    sp, sp, -8
        /* we now have a stack (whether we need one or not) */
 
-       moveli  r40, lo16(___hv_console_putc)
-       auli    r40, r40, ha16(___hv_console_putc)
+       moveli  r40, lo16(hv_console_putc)
+       auli    r40, r40, ha16(hv_console_putc)
 
 #ifdef RELOCATE_NEW_KERNEL_VERBOSE
        moveli  r0, 'r'
@@ -86,7 +77,6 @@ STD_ENTRY(relocate_new_kernel)
        move    r30, sp
        addi    sp, sp, -8
 
-#if CHIP_HAS_CBOX_HOME_MAP()
        /*
         * On TILEPro, we need to flush all tiles' caches, since we may
         * have been doing hash-for-home caching there.  Note that we
@@ -114,15 +104,14 @@ STD_ENTRY(relocate_new_kernel)
        }
        {
         move   r8, zero         /* asids */
-        moveli r20, lo16(___hv_flush_remote)
+        moveli r20, lo16(hv_flush_remote)
        }
        {
         move   r9, zero         /* asidcount */
-        auli   r20, r20, ha16(___hv_flush_remote)
+        auli   r20, r20, ha16(hv_flush_remote)
        }
 
        jalr    r20
-#endif
 
        /* r33 is destination pointer, default to zero */
 
@@ -175,8 +164,8 @@ STD_ENTRY(relocate_new_kernel)
        move    r0, r32
        moveli  r1, 0           /* arg to hv_reexec is 64 bits */
 
-       moveli  r41, lo16(___hv_reexec)
-       auli    r41, r41, ha16(___hv_reexec)
+       moveli  r41, lo16(hv_reexec)
+       auli    r41, r41, ha16(hv_reexec)
 
        jalr    r41
 
@@ -267,8 +256,8 @@ STD_ENTRY(relocate_new_kernel)
        moveli  r0, '\n'
        jalr    r40
 .Lhalt:
-       moveli  r41, lo16(___hv_halt)
-       auli    r41, r41, ha16(___hv_halt)
+       moveli  r41, lo16(hv_halt)
+       auli    r41, r41, ha16(hv_halt)
 
        jalr    r41
        STD_ENDPROC(relocate_new_kernel)
index 1c09a4f..d9d8cf6 100644 (file)
@@ -34,11 +34,11 @@ STD_ENTRY(relocate_new_kernel)
        addi    sp, sp, -8
        /* we now have a stack (whether we need one or not) */
 
+#ifdef RELOCATE_NEW_KERNEL_VERBOSE
        moveli  r40, hw2_last(hv_console_putc)
        shl16insli r40, r40, hw1(hv_console_putc)
        shl16insli r40, r40, hw0(hv_console_putc)
 
-#ifdef RELOCATE_NEW_KERNEL_VERBOSE
        moveli  r0, 'r'
        jalr    r40
 
@@ -78,7 +78,6 @@ STD_ENTRY(relocate_new_kernel)
        move    r30, sp
        addi    sp, sp, -16
 
-#if CHIP_HAS_CBOX_HOME_MAP()
        /*
         * On TILE-GX, we need to flush all tiles' caches, since we may
         * have been doing hash-for-home caching there.  Note that we
@@ -116,7 +115,6 @@ STD_ENTRY(relocate_new_kernel)
        shl16insli      r20, r20, hw0(hv_flush_remote)
 
        jalr    r20
-#endif
 
        /* r33 is destination pointer, default to zero */
 
@@ -176,10 +174,12 @@ STD_ENTRY(relocate_new_kernel)
 
        /* we should not get here */
 
+#ifdef RELOCATE_NEW_KERNEL_VERBOSE
        moveli  r0, '?'
        jalr    r40
        moveli  r0, '\n'
        jalr    r40
+#endif
 
        j       .Lhalt
 
@@ -237,7 +237,9 @@ STD_ENTRY(relocate_new_kernel)
        j       .Lloop
 
 
-.Lerr: moveli  r0, 'e'
+.Lerr:
+#ifdef RELOCATE_NEW_KERNEL_VERBOSE
+       moveli  r0, 'e'
        jalr    r40
        moveli  r0, 'r'
        jalr    r40
@@ -245,6 +247,7 @@ STD_ENTRY(relocate_new_kernel)
        jalr    r40
        moveli  r0, '\n'
        jalr    r40
+#endif
 .Lhalt:
        moveli r41, hw2_last(hv_halt)
        shl16insli r41, r41, hw1(hv_halt)
index eceb834..4c34cae 100644 (file)
@@ -154,6 +154,65 @@ static int __init setup_maxnodemem(char *str)
 }
 early_param("maxnodemem", setup_maxnodemem);
 
+struct memmap_entry {
+       u64 addr;       /* start of memory segment */
+       u64 size;       /* size of memory segment */
+};
+static struct memmap_entry memmap_map[64];
+static int memmap_nr;
+
+static void add_memmap_region(u64 addr, u64 size)
+{
+       if (memmap_nr >= ARRAY_SIZE(memmap_map)) {
+               pr_err("Ooops! Too many entries in the memory map!\n");
+               return;
+       }
+       memmap_map[memmap_nr].addr = addr;
+       memmap_map[memmap_nr].size = size;
+       memmap_nr++;
+}
+
+static int __init setup_memmap(char *p)
+{
+       char *oldp;
+       u64 start_at, mem_size;
+
+       if (!p)
+               return -EINVAL;
+
+       if (!strncmp(p, "exactmap", 8)) {
+               pr_err("\"memmap=exactmap\" not valid on tile\n");
+               return 0;
+       }
+
+       oldp = p;
+       mem_size = memparse(p, &p);
+       if (p == oldp)
+               return -EINVAL;
+
+       if (*p == '@') {
+               pr_err("\"memmap=nn@ss\" (force RAM) invalid on tile\n");
+       } else if (*p == '#') {
+               pr_err("\"memmap=nn#ss\" (force ACPI data) invalid on tile\n");
+       } else if (*p == '$') {
+               start_at = memparse(p+1, &p);
+               add_memmap_region(start_at, mem_size);
+       } else {
+               if (mem_size == 0)
+                       return -EINVAL;
+               maxmem_pfn = (mem_size >> HPAGE_SHIFT) <<
+                       (HPAGE_SHIFT - PAGE_SHIFT);
+       }
+       return *p == '\0' ? 0 : -EINVAL;
+}
+early_param("memmap", setup_memmap);
+
+static int __init setup_mem(char *str)
+{
+       return setup_maxmem(str);
+}
+early_param("mem", setup_mem);  /* compatibility with x86 */
+
 static int __init setup_isolnodes(char *str)
 {
        char buf[MAX_NUMNODES * 5];
@@ -209,7 +268,7 @@ early_param("vmalloc", parse_vmalloc);
 /*
  * Determine for each controller where its lowmem is mapped and how much of
  * it is mapped there.  On controller zero, the first few megabytes are
- * already mapped in as code at MEM_SV_INTRPT, so in principle we could
+ * already mapped in as code at MEM_SV_START, so in principle we could
  * start our data mappings higher up, but for now we don't bother, to avoid
  * additional confusion.
  *
@@ -614,11 +673,12 @@ static void __init setup_bootmem_allocator_node(int i)
        /*
         * Throw away any memory aliased by the PCI region.
         */
-       if (pci_reserve_start_pfn < end && pci_reserve_end_pfn > start)
-               reserve_bootmem(PFN_PHYS(pci_reserve_start_pfn),
-                               PFN_PHYS(pci_reserve_end_pfn -
-                                        pci_reserve_start_pfn),
+       if (pci_reserve_start_pfn < end && pci_reserve_end_pfn > start) {
+               start = max(pci_reserve_start_pfn, start);
+               end = min(pci_reserve_end_pfn, end);
+               reserve_bootmem(PFN_PHYS(start), PFN_PHYS(end - start),
                                BOOTMEM_EXCLUSIVE);
+       }
 #endif
 }
 
@@ -628,6 +688,31 @@ static void __init setup_bootmem_allocator(void)
        for (i = 0; i < MAX_NUMNODES; ++i)
                setup_bootmem_allocator_node(i);
 
+       /* Reserve any memory excluded by "memmap" arguments. */
+       for (i = 0; i < memmap_nr; ++i) {
+               struct memmap_entry *m = &memmap_map[i];
+               reserve_bootmem(m->addr, m->size, 0);
+       }
+
+#ifdef CONFIG_BLK_DEV_INITRD
+       if (initrd_start) {
+               /* Make sure the initrd memory region is not modified. */
+               if (reserve_bootmem(initrd_start, initrd_end - initrd_start,
+                                   BOOTMEM_EXCLUSIVE)) {
+                       pr_crit("The initrd memory region has been polluted. Disabling it.\n");
+                       initrd_start = 0;
+                       initrd_end = 0;
+               } else {
+                       /*
+                        * Translate initrd_start & initrd_end from PA to VA for
+                        * future access.
+                        */
+                       initrd_start += PAGE_OFFSET;
+                       initrd_end += PAGE_OFFSET;
+               }
+       }
+#endif
+
 #ifdef CONFIG_KEXEC
        if (crashk_res.start != crashk_res.end)
                reserve_bootmem(crashk_res.start, resource_size(&crashk_res), 0);
@@ -961,9 +1046,6 @@ void setup_cpu(int boot)
        arch_local_irq_unmask(INT_DMATLB_MISS);
        arch_local_irq_unmask(INT_DMATLB_ACCESS);
 #endif
-#if CHIP_HAS_SN_PROC()
-       arch_local_irq_unmask(INT_SNITLB_MISS);
-#endif
 #ifdef __tilegx__
        arch_local_irq_unmask(INT_SINGLE_STEP_K);
 #endif
@@ -978,10 +1060,6 @@ void setup_cpu(int boot)
        /* Static network is not restricted. */
        __insn_mtspr(SPR_MPL_SN_ACCESS_SET_0, 1);
 #endif
-#if CHIP_HAS_SN_PROC()
-       __insn_mtspr(SPR_MPL_SN_NOTIFY_SET_0, 1);
-       __insn_mtspr(SPR_MPL_SN_CPL_SET_0, 1);
-#endif
 
        /*
         * Set the MPL for interrupt control 0 & 1 to the corresponding
@@ -1029,6 +1107,10 @@ static void __init load_hv_initrd(void)
        int fd, rc;
        void *initrd;
 
+       /* If initrd has already been set, skip initramfs file in hvfs. */
+       if (initrd_start)
+               return;
+
        fd = hv_fs_findfile((HV_VirtAddr) initramfs_file);
        if (fd == HV_ENOENT) {
                if (set_initramfs_file) {
@@ -1067,6 +1149,25 @@ void __init free_initrd_mem(unsigned long begin, unsigned long end)
        free_bootmem(__pa(begin), end - begin);
 }
 
+static int __init setup_initrd(char *str)
+{
+       char *endp;
+       unsigned long initrd_size;
+
+       initrd_size = str ? simple_strtoul(str, &endp, 0) : 0;
+       if (initrd_size == 0 || *endp != '@')
+               return -EINVAL;
+
+       initrd_start = simple_strtoul(endp+1, &endp, 0);
+       if (initrd_start == 0)
+               return -EINVAL;
+
+       initrd_end = initrd_start + initrd_size;
+
+       return 0;
+}
+early_param("initrd", setup_initrd);
+
 #else
 static inline void load_hv_initrd(void) {}
 #endif /* CONFIG_BLK_DEV_INITRD */
@@ -1134,7 +1235,7 @@ static void __init validate_va(void)
 #ifndef __tilegx__   /* FIXME: GX: probably some validation relevant here */
        /*
         * Similarly, make sure we're only using allowed VAs.
-        * We assume we can contiguously use MEM_USER_INTRPT .. MEM_HV_INTRPT,
+        * We assume we can contiguously use MEM_USER_INTRPT .. MEM_HV_START,
         * and 0 .. KERNEL_HIGH_VADDR.
         * In addition, make sure we CAN'T use the end of memory, since
         * we use the last chunk of each pgd for the pgd_list.
@@ -1149,7 +1250,7 @@ static void __init validate_va(void)
                if (range.size == 0)
                        break;
                if (range.start <= MEM_USER_INTRPT &&
-                   range.start + range.size >= MEM_HV_INTRPT)
+                   range.start + range.size >= MEM_HV_START)
                        user_kernel_ok = 1;
                if (range.start == 0)
                        max_va = range.size;
@@ -1183,7 +1284,6 @@ static void __init validate_va(void)
 struct cpumask __write_once cpu_lotar_map;
 EXPORT_SYMBOL(cpu_lotar_map);
 
-#if CHIP_HAS_CBOX_HOME_MAP()
 /*
  * hash_for_home_map lists all the tiles that hash-for-home data
  * will be cached on.  Note that this may includes tiles that are not
@@ -1193,7 +1293,6 @@ EXPORT_SYMBOL(cpu_lotar_map);
  */
 struct cpumask hash_for_home_map;
 EXPORT_SYMBOL(hash_for_home_map);
-#endif
 
 /*
  * cpu_cacheable_map lists all the cpus whose caches the hypervisor can
@@ -1286,7 +1385,6 @@ static void __init setup_cpu_maps(void)
                cpu_lotar_map = *cpu_possible_mask;
        }
 
-#if CHIP_HAS_CBOX_HOME_MAP()
        /* Retrieve set of CPUs used for hash-for-home caching */
        rc = hv_inquire_tiles(HV_INQ_TILES_HFH_CACHE,
                              (HV_VirtAddr) hash_for_home_map.bits,
@@ -1294,9 +1392,6 @@ static void __init setup_cpu_maps(void)
        if (rc < 0)
                early_panic("hv_inquire_tiles(HFH_CACHE) failed: rc %d\n", rc);
        cpumask_or(&cpu_cacheable_map, cpu_possible_mask, &hash_for_home_map);
-#else
-       cpu_cacheable_map = *cpu_possible_mask;
-#endif
 }
 
 
@@ -1492,7 +1587,7 @@ void __init setup_per_cpu_areas(void)
 
                        /* Update the vmalloc mapping and page home. */
                        unsigned long addr = (unsigned long)ptr + i;
-                       pte_t *ptep = virt_to_pte(NULL, addr);
+                       pte_t *ptep = virt_to_kpte(addr);
                        pte_t pte = *ptep;
                        BUG_ON(pfn != pte_pfn(pte));
                        pte = hv_pte_set_mode(pte, HV_PTE_MODE_CACHE_TILE_L3);
@@ -1501,12 +1596,12 @@ void __init setup_per_cpu_areas(void)
 
                        /* Update the lowmem mapping for consistency. */
                        lowmem_va = (unsigned long)pfn_to_kaddr(pfn);
-                       ptep = virt_to_pte(NULL, lowmem_va);
+                       ptep = virt_to_kpte(lowmem_va);
                        if (pte_huge(*ptep)) {
                                printk(KERN_DEBUG "early shatter of huge page"
                                       " at %#lx\n", lowmem_va);
                                shatter_pmd((pmd_t *)ptep);
-                               ptep = virt_to_pte(NULL, lowmem_va);
+                               ptep = virt_to_kpte(lowmem_va);
                                BUG_ON(pte_huge(*ptep));
                        }
                        BUG_ON(pfn != pte_pfn(*ptep));
@@ -1548,6 +1643,8 @@ insert_non_bus_resource(void)
 {
        struct resource *res =
                kzalloc(sizeof(struct resource), GFP_ATOMIC);
+       if (!res)
+               return NULL;
        res->name = "Non-Bus Physical Address Space";
        res->start = (1ULL << 32);
        res->end = -1LL;
@@ -1561,11 +1658,13 @@ insert_non_bus_resource(void)
 #endif
 
 static struct resource* __init
-insert_ram_resource(u64 start_pfn, u64 end_pfn)
+insert_ram_resource(u64 start_pfn, u64 end_pfn, bool reserved)
 {
        struct resource *res =
                kzalloc(sizeof(struct resource), GFP_ATOMIC);
-       res->name = "System RAM";
+       if (!res)
+               return NULL;
+       res->name = reserved ? "Reserved" : "System RAM";
        res->start = start_pfn << PAGE_SHIFT;
        res->end = (end_pfn << PAGE_SHIFT) - 1;
        res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
@@ -1585,7 +1684,7 @@ insert_ram_resource(u64 start_pfn, u64 end_pfn)
 static int __init request_standard_resources(void)
 {
        int i;
-       enum { CODE_DELTA = MEM_SV_INTRPT - PAGE_OFFSET };
+       enum { CODE_DELTA = MEM_SV_START - PAGE_OFFSET };
 
 #if defined(CONFIG_PCI) && !defined(__tilegx__)
        insert_non_bus_resource();
@@ -1600,11 +1699,11 @@ static int __init request_standard_resources(void)
                    end_pfn > pci_reserve_start_pfn) {
                        if (end_pfn > pci_reserve_end_pfn)
                                insert_ram_resource(pci_reserve_end_pfn,
-                                                    end_pfn);
+                                                   end_pfn, 0);
                        end_pfn = pci_reserve_start_pfn;
                }
 #endif
-               insert_ram_resource(start_pfn, end_pfn);
+               insert_ram_resource(start_pfn, end_pfn, 0);
        }
 
        code_resource.start = __pa(_text - CODE_DELTA);
@@ -1615,6 +1714,13 @@ static int __init request_standard_resources(void)
        insert_resource(&iomem_resource, &code_resource);
        insert_resource(&iomem_resource, &data_resource);
 
+       /* Mark any "memmap" regions busy for the resource manager. */
+       for (i = 0; i < memmap_nr; ++i) {
+               struct memmap_entry *m = &memmap_map[i];
+               insert_ram_resource(PFN_DOWN(m->addr),
+                                   PFN_UP(m->addr + m->size - 1), 1);
+       }
+
 #ifdef CONFIG_KEXEC
        insert_resource(&iomem_resource, &crashk_res);
 #endif
index 9531845..2d1dbf3 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/ucontext.h>
 #include <asm/sigframe.h>
 #include <asm/syscalls.h>
+#include <asm/vdso.h>
 #include <arch/interrupts.h>
 
 #define DEBUG_SIG 0
@@ -190,7 +191,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        if (err)
                goto give_sigsegv;
 
-       restorer = VDSO_BASE;
+       restorer = VDSO_SYM(&__vdso_rt_sigreturn);
        if (ka->sa.sa_flags & SA_RESTORER)
                restorer = (unsigned long) ka->sa.sa_restorer;
 
index 27742e8..de07fa7 100644 (file)
  *   more details.
  *
  * A code-rewriter that enables instruction single-stepping.
- * Derived from iLib's single-stepping code.
  */
 
-#ifndef __tilegx__   /* Hardware support for single step unavailable. */
-
-/* These functions are only used on the TILE platform */
+#include <linux/smp.h>
+#include <linux/ptrace.h>
 #include <linux/slab.h>
 #include <linux/thread_info.h>
 #include <linux/uaccess.h>
 #include <linux/mman.h>
 #include <linux/types.h>
 #include <linux/err.h>
+#include <linux/prctl.h>
 #include <asm/cacheflush.h>
+#include <asm/traps.h>
+#include <asm/uaccess.h>
 #include <asm/unaligned.h>
 #include <arch/abi.h>
+#include <arch/spr_def.h>
 #include <arch/opcode.h>
 
-#define signExtend17(val) sign_extend((val), 17)
-#define TILE_X1_MASK (0xffffffffULL << 31)
-
-int unaligned_printk;
 
-static int __init setup_unaligned_printk(char *str)
-{
-       long val;
-       if (strict_strtol(str, 0, &val) != 0)
-               return 0;
-       unaligned_printk = val;
-       pr_info("Printk for each unaligned data accesses is %s\n",
-               unaligned_printk ? "enabled" : "disabled");
-       return 1;
-}
-__setup("unaligned_printk=", setup_unaligned_printk);
+#ifndef __tilegx__   /* Hardware support for single step unavailable. */
 
-unsigned int unaligned_fixup_count;
+#define signExtend17(val) sign_extend((val), 17)
+#define TILE_X1_MASK (0xffffffffULL << 31)
 
 enum mem_op {
        MEMOP_NONE,
@@ -56,12 +45,13 @@ enum mem_op {
        MEMOP_STORE_POSTINCR
 };
 
-static inline tile_bundle_bits set_BrOff_X1(tile_bundle_bits n, s32 offset)
+static inline tilepro_bundle_bits set_BrOff_X1(tilepro_bundle_bits n,
+       s32 offset)
 {
-       tile_bundle_bits result;
+       tilepro_bundle_bits result;
 
        /* mask out the old offset */
-       tile_bundle_bits mask = create_BrOff_X1(-1);
+       tilepro_bundle_bits mask = create_BrOff_X1(-1);
        result = n & (~mask);
 
        /* or in the new offset */
@@ -70,10 +60,11 @@ static inline tile_bundle_bits set_BrOff_X1(tile_bundle_bits n, s32 offset)
        return result;
 }
 
-static inline tile_bundle_bits move_X1(tile_bundle_bits n, int dest, int src)
+static inline tilepro_bundle_bits move_X1(tilepro_bundle_bits n, int dest,
+       int src)
 {
-       tile_bundle_bits result;
-       tile_bundle_bits op;
+       tilepro_bundle_bits result;
+       tilepro_bundle_bits op;
 
        result = n & (~TILE_X1_MASK);
 
@@ -87,13 +78,13 @@ static inline tile_bundle_bits move_X1(tile_bundle_bits n, int dest, int src)
        return result;
 }
 
-static inline tile_bundle_bits nop_X1(tile_bundle_bits n)
+static inline tilepro_bundle_bits nop_X1(tilepro_bundle_bits n)
 {
        return move_X1(n, TREG_ZERO, TREG_ZERO);
 }
 
-static inline tile_bundle_bits addi_X1(
-       tile_bundle_bits n, int dest, int src, int imm)
+static inline tilepro_bundle_bits addi_X1(
+       tilepro_bundle_bits n, int dest, int src, int imm)
 {
        n &= ~TILE_X1_MASK;
 
@@ -107,15 +98,26 @@ static inline tile_bundle_bits addi_X1(
        return n;
 }
 
-static tile_bundle_bits rewrite_load_store_unaligned(
+static tilepro_bundle_bits rewrite_load_store_unaligned(
        struct single_step_state *state,
-       tile_bundle_bits bundle,
+       tilepro_bundle_bits bundle,
        struct pt_regs *regs,
        enum mem_op mem_op,
        int size, int sign_ext)
 {
        unsigned char __user *addr;
        int val_reg, addr_reg, err, val;
+       int align_ctl;
+
+       align_ctl = unaligned_fixup;
+       switch (task_thread_info(current)->align_ctl) {
+       case PR_UNALIGN_NOPRINT:
+               align_ctl = 1;
+               break;
+       case PR_UNALIGN_SIGBUS:
+               align_ctl = 0;
+               break;
+       }
 
        /* Get address and value registers */
        if (bundle & TILEPRO_BUNDLE_Y_ENCODING_MASK) {
@@ -160,7 +162,7 @@ static tile_bundle_bits rewrite_load_store_unaligned(
         * tilepro hardware would be doing, if it could provide us with the
         * actual bad address in an SPR, which it doesn't.
         */
-       if (unaligned_fixup == 0) {
+       if (align_ctl == 0) {
                siginfo_t info = {
                        .si_signo = SIGBUS,
                        .si_code = BUS_ADRALN,
@@ -209,14 +211,14 @@ static tile_bundle_bits rewrite_load_store_unaligned(
 
        if (err) {
                siginfo_t info = {
-                       .si_signo = SIGSEGV,
-                       .si_code = SEGV_MAPERR,
+                       .si_signo = SIGBUS,
+                       .si_code = BUS_ADRALN,
                        .si_addr = addr
                };
-               trace_unhandled_signal("segfault", regs,
-                                      (unsigned long)addr, SIGSEGV);
+               trace_unhandled_signal("bad address for unaligned fixup", regs,
+                                      (unsigned long)addr, SIGBUS);
                force_sig_info(info.si_signo, &info, current);
-               return (tile_bundle_bits) 0;
+               return (tilepro_bundle_bits) 0;
        }
 
        if (unaligned_printk || unaligned_fixup_count == 0) {
@@ -285,7 +287,7 @@ void single_step_execve(void)
        ti->step_state = NULL;
 }
 
-/**
+/*
  * single_step_once() - entry point when single stepping has been triggered.
  * @regs: The machine register state
  *
@@ -304,20 +306,31 @@ void single_step_execve(void)
  */
 void single_step_once(struct pt_regs *regs)
 {
-       extern tile_bundle_bits __single_step_ill_insn;
-       extern tile_bundle_bits __single_step_j_insn;
-       extern tile_bundle_bits __single_step_addli_insn;
-       extern tile_bundle_bits __single_step_auli_insn;
+       extern tilepro_bundle_bits __single_step_ill_insn;
+       extern tilepro_bundle_bits __single_step_j_insn;
+       extern tilepro_bundle_bits __single_step_addli_insn;
+       extern tilepro_bundle_bits __single_step_auli_insn;
        struct thread_info *info = (void *)current_thread_info();
        struct single_step_state *state = info->step_state;
        int is_single_step = test_ti_thread_flag(info, TIF_SINGLESTEP);
-       tile_bundle_bits __user *buffer, *pc;
-       tile_bundle_bits bundle;
+       tilepro_bundle_bits __user *buffer, *pc;
+       tilepro_bundle_bits bundle;
        int temp_reg;
        int target_reg = TREG_LR;
        int err;
        enum mem_op mem_op = MEMOP_NONE;
        int size = 0, sign_ext = 0;  /* happy compiler */
+       int align_ctl;
+
+       align_ctl = unaligned_fixup;
+       switch (task_thread_info(current)->align_ctl) {
+       case PR_UNALIGN_NOPRINT:
+               align_ctl = 1;
+               break;
+       case PR_UNALIGN_SIGBUS:
+               align_ctl = 0;
+               break;
+       }
 
        asm(
 "    .pushsection .rodata.single_step\n"
@@ -390,7 +403,7 @@ void single_step_once(struct pt_regs *regs)
        if (regs->faultnum == INT_SWINT_1)
                regs->pc -= 8;
 
-       pc = (tile_bundle_bits __user *)(regs->pc);
+       pc = (tilepro_bundle_bits __user *)(regs->pc);
        if (get_user(bundle, pc) != 0) {
                pr_err("Couldn't read instruction at %p trying to step\n", pc);
                return;
@@ -533,7 +546,6 @@ void single_step_once(struct pt_regs *regs)
                        }
                        break;
 
-#if CHIP_HAS_WH64()
                /* postincrement operations */
                case IMM_0_OPCODE_X1:
                        switch (get_ImmOpcodeExtension_X1(bundle)) {
@@ -568,7 +580,6 @@ void single_step_once(struct pt_regs *regs)
                                break;
                        }
                        break;
-#endif /* CHIP_HAS_WH64() */
                }
 
                if (state->update) {
@@ -627,9 +638,9 @@ void single_step_once(struct pt_regs *regs)
 
        /*
         * Check if we need to rewrite an unaligned load/store.
-        * Returning zero is a special value meaning we need to SIGSEGV.
+        * Returning zero is a special value meaning we generated a signal.
         */
-       if (mem_op != MEMOP_NONE && unaligned_fixup >= 0) {
+       if (mem_op != MEMOP_NONE && align_ctl >= 0) {
                bundle = rewrite_load_store_unaligned(state, bundle, regs,
                                                      mem_op, size, sign_ext);
                if (bundle == 0)
@@ -668,9 +679,9 @@ void single_step_once(struct pt_regs *regs)
                }
 
                /* End with a jump back to the next instruction */
-               delta = ((regs->pc + TILE_BUNDLE_SIZE_IN_BYTES) -
+               delta = ((regs->pc + TILEPRO_BUNDLE_SIZE_IN_BYTES) -
                        (unsigned long)buffer) >>
-                       TILE_LOG2_BUNDLE_ALIGNMENT_IN_BYTES;
+                       TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES;
                bundle = __single_step_j_insn;
                bundle |= create_JOffLong_X1(delta);
                err |= __put_user(bundle, buffer++);
@@ -698,9 +709,6 @@ void single_step_once(struct pt_regs *regs)
 }
 
 #else
-#include <linux/smp.h>
-#include <linux/ptrace.h>
-#include <arch/spr_def.h>
 
 static DEFINE_PER_CPU(unsigned long, ss_saved_pc);
 
@@ -743,10 +751,10 @@ void gx_singlestep_handle(struct pt_regs *regs, int fault_num)
        } else if ((*ss_pc != regs->pc) ||
                   (!(control & SPR_SINGLE_STEP_CONTROL_1__CANCELED_MASK))) {
 
-               ptrace_notify(SIGTRAP);
                control |= SPR_SINGLE_STEP_CONTROL_1__CANCELED_MASK;
                control |= SPR_SINGLE_STEP_CONTROL_1__INHIBIT_MASK;
                __insn_mtspr(SPR_SINGLE_STEP_CONTROL_K, control);
+               send_sigtrap(current, regs);
        }
 }
 
index cbc73a8..01e8ab2 100644 (file)
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <asm/cacheflush.h>
+#include <asm/homecache.h>
 
-HV_Topology smp_topology __write_once;
+/*
+ * We write to width and height with a single store in head_NN.S,
+ * so make the variable aligned to "long".
+ */
+HV_Topology smp_topology __write_once __aligned(sizeof(long));
 EXPORT_SYMBOL(smp_topology);
 
 #if CHIP_HAS_IPI()
@@ -100,8 +105,8 @@ static void smp_start_cpu_interrupt(void)
 /* Handler to stop the current cpu. */
 static void smp_stop_cpu_interrupt(void)
 {
-       set_cpu_online(smp_processor_id(), 0);
        arch_local_irq_disable_all();
+       set_cpu_online(smp_processor_id(), 0);
        for (;;)
                asm("nap; nop");
 }
@@ -167,9 +172,16 @@ static void ipi_flush_icache_range(void *info)
 void flush_icache_range(unsigned long start, unsigned long end)
 {
        struct ipi_flush flush = { start, end };
-       preempt_disable();
-       on_each_cpu(ipi_flush_icache_range, &flush, 1);
-       preempt_enable();
+
+       /* If invoked with irqs disabled, we can not issue IPIs. */
+       if (irqs_disabled())
+               flush_remote(0, HV_FLUSH_EVICT_L1I, NULL, 0, 0, 0,
+                       NULL, NULL, 0);
+       else {
+               preempt_disable();
+               on_each_cpu(ipi_flush_icache_range, &flush, 1);
+               preempt_enable();
+       }
 }
 
 
index a535655..732e9d1 100644 (file)
@@ -142,13 +142,15 @@ static struct cpumask cpu_started;
  */
 static void start_secondary(void)
 {
-       int cpuid = smp_processor_id();
+       int cpuid;
+
+       preempt_disable();
+
+       cpuid = smp_processor_id();
 
        /* Set our thread pointer appropriately. */
        set_my_cpu_offset(__per_cpu_offset[cpuid]);
 
-       preempt_disable();
-
        /*
         * In large machines even this will slow us down, since we
         * will be contending for for the printk spinlock.
index af8dfc9..362284a 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/switch_to.h>
 #include <asm/sigframe.h>
 #include <asm/stack.h>
+#include <asm/vdso.h>
 #include <arch/abi.h>
 #include <arch/interrupts.h>
 
@@ -102,9 +103,8 @@ static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt)
            p->sp >= sp) {
                if (kbt->verbose)
                        pr_err("  <%s while in kernel mode>\n", fault);
-       } else if (EX1_PL(p->ex1) == USER_PL &&
-           p->pc < PAGE_OFFSET &&
-           p->sp < PAGE_OFFSET) {
+       } else if (user_mode(p) &&
+                  p->sp < PAGE_OFFSET && p->sp != 0) {
                if (kbt->verbose)
                        pr_err("  <%s while in user mode>\n", fault);
        } else if (kbt->verbose) {
@@ -120,7 +120,7 @@ static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt)
 /* Is the pc pointing to a sigreturn trampoline? */
 static int is_sigreturn(unsigned long pc)
 {
-       return (pc == VDSO_BASE);
+       return current->mm && (pc == VDSO_SYM(&__vdso_rt_sigreturn));
 }
 
 /* Return a pt_regs pointer for a valid signal handler frame */
@@ -129,7 +129,7 @@ static struct pt_regs *valid_sigframe(struct KBacktraceIterator* kbt,
 {
        BacktraceIterator *b = &kbt->it;
 
-       if (b->pc == VDSO_BASE && b->sp < PAGE_OFFSET &&
+       if (is_sigreturn(b->pc) && b->sp < PAGE_OFFSET &&
            b->sp % sizeof(long) == 0) {
                int retval;
                pagefault_disable();
@@ -195,21 +195,21 @@ static int KBacktraceIterator_next_item_inclusive(
  */
 static void validate_stack(struct pt_regs *regs)
 {
-       int cpu = smp_processor_id();
+       int cpu = raw_smp_processor_id();
        unsigned long ksp0 = get_current_ksp0();
-       unsigned long ksp0_base = ksp0 THREAD_SIZE;
+       unsigned long ksp0_base = ksp0 & -THREAD_SIZE;
        unsigned long sp = stack_pointer;
 
        if (EX1_PL(regs->ex1) == KERNEL_PL && regs->sp >= ksp0) {
-               pr_err("WARNING: cpu %d: kernel stack page %#lx underrun!\n"
+               pr_err("WARNING: cpu %d: kernel stack %#lx..%#lx underrun!\n"
                       "  sp %#lx (%#lx in caller), caller pc %#lx, lr %#lx\n",
-                      cpu, ksp0_base, sp, regs->sp, regs->pc, regs->lr);
+                      cpu, ksp0_base, ksp0, sp, regs->sp, regs->pc, regs->lr);
        }
 
        else if (sp < ksp0_base + sizeof(struct thread_info)) {
-               pr_err("WARNING: cpu %d: kernel stack page %#lx overrun!\n"
+               pr_err("WARNING: cpu %d: kernel stack %#lx..%#lx overrun!\n"
                       "  sp %#lx (%#lx in caller), caller pc %#lx, lr %#lx\n",
-                      cpu, ksp0_base, sp, regs->sp, regs->pc, regs->lr);
+                      cpu, ksp0_base, ksp0, sp, regs->sp, regs->pc, regs->lr);
        }
 }
 
@@ -352,6 +352,26 @@ static void describe_addr(struct KBacktraceIterator *kbt,
 }
 
 /*
+ * Avoid possible crash recursion during backtrace.  If it happens, it
+ * makes it easy to lose the actual root cause of the failure, so we
+ * put a simple guard on all the backtrace loops.
+ */
+static bool start_backtrace(void)
+{
+       if (current->thread.in_backtrace) {
+               pr_err("Backtrace requested while in backtrace!\n");
+               return false;
+       }
+       current->thread.in_backtrace = true;
+       return true;
+}
+
+static void end_backtrace(void)
+{
+       current->thread.in_backtrace = false;
+}
+
+/*
  * This method wraps the backtracer's more generic support.
  * It is only invoked from the architecture-specific code; show_stack()
  * and dump_stack() (in entry.S) are architecture-independent entry points.
@@ -361,6 +381,8 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers)
        int i;
        int have_mmap_sem = 0;
 
+       if (!start_backtrace())
+               return;
        if (headers) {
                /*
                 * Add a blank line since if we are called from panic(),
@@ -371,7 +393,7 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers)
                pr_err("Starting stack dump of tid %d, pid %d (%s)"
                       " on cpu %d at cycle %lld\n",
                       kbt->task->pid, kbt->task->tgid, kbt->task->comm,
-                      smp_processor_id(), get_cycles());
+                      raw_smp_processor_id(), get_cycles());
        }
        kbt->verbose = 1;
        i = 0;
@@ -402,6 +424,7 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers)
                pr_err("Stack dump complete\n");
        if (have_mmap_sem)
                up_read(&kbt->task->mm->mmap_sem);
+       end_backtrace();
 }
 EXPORT_SYMBOL(tile_show_stack);
 
@@ -463,6 +486,8 @@ void save_stack_trace_tsk(struct task_struct *task, struct stack_trace *trace)
        int skip = trace->skip;
        int i = 0;
 
+       if (!start_backtrace())
+               goto done;
        if (task == NULL || task == current)
                KBacktraceIterator_init_current(&kbt);
        else
@@ -476,6 +501,8 @@ void save_stack_trace_tsk(struct task_struct *task, struct stack_trace *trace)
                        break;
                trace->entries[i++] = kbt.it.pc;
        }
+       end_backtrace();
+done:
        trace->nr_entries = i;
 }
 EXPORT_SYMBOL(save_stack_trace_tsk);
index b881a7b..38debe7 100644 (file)
 SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len,
                unsigned long, flags)
 {
+       /* DCACHE is not particularly effective if not bound to one cpu. */
        if (flags & DCACHE)
-               homecache_evict(cpumask_of(smp_processor_id()));
+               homecache_evict(cpumask_of(raw_smp_processor_id()));
+
        if (flags & ICACHE)
                flush_remote(0, HV_FLUSH_EVICT_L1I, mm_cpumask(current->mm),
                             0, 0, 0, NULL, NULL, 0);
index e25b0a8..a3ed12f 100644 (file)
@@ -157,6 +157,67 @@ hvconfig_bin_read(struct file *filp, struct kobject *kobj,
        return count;
 }
 
+static ssize_t hv_stats_show(struct device *dev,
+                            struct device_attribute *attr,
+                            char *page)
+{
+       int cpu = dev->id;
+       long lotar = HV_XY_TO_LOTAR(cpu_x(cpu), cpu_y(cpu));
+
+       ssize_t n = hv_confstr(HV_CONFSTR_HV_STATS,
+                              (unsigned long)page, PAGE_SIZE - 1,
+                              lotar, 0);
+       n = n < 0 ? 0 : min(n, (ssize_t)PAGE_SIZE - 1);
+       page[n] = '\0';
+       return n;
+}
+
+static ssize_t hv_stats_store(struct device *dev,
+                             struct device_attribute *attr,
+                             const char *page,
+                             size_t count)
+{
+       int cpu = dev->id;
+       long lotar = HV_XY_TO_LOTAR(cpu_x(cpu), cpu_y(cpu));
+
+       ssize_t n = hv_confstr(HV_CONFSTR_HV_STATS, 0, 0, lotar, 1);
+       return n < 0 ? n : count;
+}
+
+static DEVICE_ATTR(hv_stats, 0644, hv_stats_show, hv_stats_store);
+
+static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif)
+{
+       int err, cpu = dev->id;
+
+       if (!cpu_online(cpu))
+               return 0;
+
+       err = sysfs_create_file(&dev->kobj, &dev_attr_hv_stats.attr);
+
+       return err;
+}
+
+static int hv_stats_device_remove(struct device *dev,
+                                 struct subsys_interface *sif)
+{
+       int cpu = dev->id;
+
+       if (!cpu_online(cpu))
+               return 0;
+
+       sysfs_remove_file(&dev->kobj, &dev_attr_hv_stats.attr);
+       return 0;
+}
+
+
+static struct subsys_interface hv_stats_interface = {
+       .name                   = "hv_stats",
+       .subsys                 = &cpu_subsys,
+       .add_dev                = hv_stats_device_add,
+       .remove_dev             = hv_stats_device_remove,
+};
+
 static int __init create_sysfs_entries(void)
 {
        int err = 0;
@@ -188,6 +249,21 @@ static int __init create_sysfs_entries(void)
                err = sysfs_create_bin_file(hypervisor_kobj, &hvconfig_bin);
        }
 
+       if (!err) {
+               /*
+                * Don't bother adding the hv_stats files on each CPU if
+                * our hypervisor doesn't supply statistics.
+                */
+               int cpu = raw_smp_processor_id();
+               long lotar = HV_XY_TO_LOTAR(cpu_x(cpu), cpu_y(cpu));
+               char dummy;
+               ssize_t n = hv_confstr(HV_CONFSTR_HV_STATS,
+                                      (unsigned long) &dummy, 1,
+                                      lotar, 0);
+               if (n >= 0)
+                       err = subsys_interface_register(&hv_stats_interface);
+       }
+
        return err;
 }
 subsys_initcall(create_sysfs_entries);
index 7c353d8..5d10642 100644 (file)
 #include <linux/smp.h>
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/timekeeper_internal.h>
 #include <asm/irq_regs.h>
 #include <asm/traps.h>
+#include <asm/vdso.h>
 #include <hv/hypervisor.h>
 #include <arch/interrupts.h>
 #include <arch/spr_def.h>
@@ -110,7 +112,6 @@ void __init time_init(void)
        setup_tile_timer();
 }
 
-
 /*
  * Define the tile timer clock event device.  The timer is driven by
  * the TILE_TIMER_CONTROL register, which consists of a 31-bit down
@@ -237,3 +238,37 @@ cycles_t ns2cycles(unsigned long nsecs)
        struct clock_event_device *dev = &__raw_get_cpu_var(tile_timer);
        return ((u64)nsecs * dev->mult) >> dev->shift;
 }
+
+void update_vsyscall_tz(void)
+{
+       /* Userspace gettimeofday will spin while this value is odd. */
+       ++vdso_data->tz_update_count;
+       smp_wmb();
+       vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
+       vdso_data->tz_dsttime = sys_tz.tz_dsttime;
+       smp_wmb();
+       ++vdso_data->tz_update_count;
+}
+
+void update_vsyscall(struct timekeeper *tk)
+{
+       struct timespec wall_time = tk_xtime(tk);
+       struct timespec *wtm = &tk->wall_to_monotonic;
+       struct clocksource *clock = tk->clock;
+
+       if (clock != &cycle_counter_cs)
+               return;
+
+       /* Userspace gettimeofday will spin while this value is odd. */
+       ++vdso_data->tb_update_count;
+       smp_wmb();
+       vdso_data->xtime_tod_stamp = clock->cycle_last;
+       vdso_data->xtime_clock_sec = wall_time.tv_sec;
+       vdso_data->xtime_clock_nsec = wall_time.tv_nsec;
+       vdso_data->wtom_clock_sec = wtm->tv_sec;
+       vdso_data->wtom_clock_nsec = wtm->tv_nsec;
+       vdso_data->mult = clock->mult;
+       vdso_data->shift = clock->shift;
+       smp_wmb();
+       ++vdso_data->tb_update_count;
+}
index 3fd54d5..f23b535 100644 (file)
@@ -91,8 +91,14 @@ void flush_tlb_all(void)
        }
 }
 
+/*
+ * Callers need to flush the L1I themselves if necessary, e.g. for
+ * kernel module unload.  Otherwise we assume callers are not using
+ * executable pgprot_t's.  Using EVICT_L1I means that dataplane cpus
+ * will get an unnecessary interrupt otherwise.
+ */
 void flush_tlb_kernel_range(unsigned long start, unsigned long end)
 {
-       flush_remote(0, HV_FLUSH_EVICT_L1I, cpu_online_mask,
+       flush_remote(0, 0, NULL,
                     start, end - start, PAGE_SIZE, cpu_online_mask, NULL, 0);
 }
index 5b19a23..6b603d5 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/kprobes.h>
+#include <linux/kdebug.h>
 #include <linux/module.h>
 #include <linux/reboot.h>
 #include <linux/uaccess.h>
@@ -29,7 +30,7 @@
 
 void __init trap_init(void)
 {
-       /* Nothing needed here since we link code at .intrpt1 */
+       /* Nothing needed here since we link code at .intrpt */
 }
 
 int unaligned_fixup = 1;
@@ -100,13 +101,7 @@ static int retry_gpv(unsigned int gpv_reason)
 
 #endif /* CHIP_HAS_TILE_DMA() */
 
-#ifdef __tilegx__
-#define bundle_bits tilegx_bundle_bits
-#else
-#define bundle_bits tile_bundle_bits
-#endif
-
-extern bundle_bits bpt_code;
+extern tile_bundle_bits bpt_code;
 
 asm(".pushsection .rodata.bpt_code,\"a\";"
     ".align 8;"
@@ -114,7 +109,7 @@ asm(".pushsection .rodata.bpt_code,\"a\";"
     ".size bpt_code,.-bpt_code;"
     ".popsection");
 
-static int special_ill(bundle_bits bundle, int *sigp, int *codep)
+static int special_ill(tile_bundle_bits bundle, int *sigp, int *codep)
 {
        int sig, code, maxcode;
 
@@ -214,24 +209,73 @@ static const char *const int_name[] = {
 #endif
 };
 
+static int do_bpt(struct pt_regs *regs)
+{
+       unsigned long bundle, bcode, bpt;
+
+       bundle = *(unsigned long *)instruction_pointer(regs);
+
+       /*
+        * bpt shoule be { bpt; nop }, which is 0x286a44ae51485000ULL.
+        * we encode the unused least significant bits for other purpose.
+        */
+       bpt = bundle & ~((1ULL << 12) - 1);
+       if (bpt != TILE_BPT_BUNDLE)
+               return 0;
+
+       bcode = bundle & ((1ULL << 12) - 1);
+       /*
+        * notify the kprobe handlers, if instruction is likely to
+        * pertain to them.
+        */
+       switch (bcode) {
+       /* breakpoint_insn */
+       case 0:
+               notify_die(DIE_BREAK, "debug", regs, bundle,
+                       INT_ILL, SIGTRAP);
+               break;
+       /* compiled_bpt */
+       case DIE_COMPILED_BPT:
+               notify_die(DIE_COMPILED_BPT, "debug", regs, bundle,
+                       INT_ILL, SIGTRAP);
+               break;
+       /* breakpoint2_insn */
+       case DIE_SSTEPBP:
+               notify_die(DIE_SSTEPBP, "single_step", regs, bundle,
+                       INT_ILL, SIGTRAP);
+               break;
+       default:
+               return 0;
+       }
+
+       return 1;
+}
+
 void __kprobes do_trap(struct pt_regs *regs, int fault_num,
                       unsigned long reason)
 {
        siginfo_t info = { 0 };
        int signo, code;
        unsigned long address = 0;
-       bundle_bits instr;
+       tile_bundle_bits instr;
+       int is_kernel = !user_mode(regs);
+
+       /* Handle breakpoints, etc. */
+       if (is_kernel && fault_num == INT_ILL && do_bpt(regs))
+               return;
 
-       /* Re-enable interrupts. */
-       local_irq_enable();
+       /* Re-enable interrupts, if they were previously enabled. */
+       if (!(regs->flags & PT_FLAGS_DISABLE_IRQ))
+               local_irq_enable();
 
        /*
         * If it hits in kernel mode and we can't fix it up, just exit the
         * current process and hope for the best.
         */
-       if (!user_mode(regs)) {
+       if (is_kernel) {
                const char *name;
-               if (fixup_exception(regs))  /* only UNALIGN_DATA in practice */
+               char buf[100];
+               if (fixup_exception(regs))  /* ILL_TRANS or UNALIGN_DATA */
                        return;
                if (fault_num >= 0 &&
                    fault_num < sizeof(int_name)/sizeof(int_name[0]) &&
@@ -239,10 +283,16 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
                        name = int_name[fault_num];
                else
                        name = "Unknown interrupt";
-               pr_alert("Kernel took bad trap %d (%s) at PC %#lx\n",
-                        fault_num, name, regs->pc);
                if (fault_num == INT_GPV)
-                       pr_alert("GPV_REASON is %#lx\n", reason);
+                       snprintf(buf, sizeof(buf), "; GPV_REASON %#lx", reason);
+#ifdef __tilegx__
+               else if (fault_num == INT_ILL_TRANS)
+                       snprintf(buf, sizeof(buf), "; address %#lx", reason);
+#endif
+               else
+                       buf[0] = '\0';
+               pr_alert("Kernel took bad trap %d (%s) at PC %#lx%s\n",
+                        fault_num, name, regs->pc, buf);
                show_regs(regs);
                do_exit(SIGKILL);  /* FIXME: implement i386 die() */
                return;
@@ -324,11 +374,8 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
                fill_ra_stack();
 
                signo = SIGSEGV;
+               address = reason;
                code = SEGV_MAPERR;
-               if (reason & SPR_ILL_TRANS_REASON__I_STREAM_VA_RMASK)
-                       address = regs->pc;
-               else
-                       address = 0;  /* FIXME: GX: single-step for address */
                break;
        }
 #endif
diff --git a/arch/tile/kernel/unaligned.c b/arch/tile/kernel/unaligned.c
new file mode 100644 (file)
index 0000000..b425fb6
--- /dev/null
@@ -0,0 +1,1609 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ *
+ * A code-rewriter that handles unaligned exception.
+ */
+
+#include <linux/smp.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/thread_info.h>
+#include <linux/uaccess.h>
+#include <linux/mman.h>
+#include <linux/types.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/compat.h>
+#include <linux/prctl.h>
+#include <asm/cacheflush.h>
+#include <asm/traps.h>
+#include <asm/uaccess.h>
+#include <asm/unaligned.h>
+#include <arch/abi.h>
+#include <arch/spr_def.h>
+#include <arch/opcode.h>
+
+
+/*
+ * This file handles unaligned exception for tile-Gx. The tilepro's unaligned
+ * exception is supported out of single_step.c
+ */
+
+int unaligned_printk;
+
+static int __init setup_unaligned_printk(char *str)
+{
+       long val;
+       if (kstrtol(str, 0, &val) != 0)
+               return 0;
+       unaligned_printk = val;
+       pr_info("Printk for each unaligned data accesses is %s\n",
+               unaligned_printk ? "enabled" : "disabled");
+       return 1;
+}
+__setup("unaligned_printk=", setup_unaligned_printk);
+
+unsigned int unaligned_fixup_count;
+
+#ifdef __tilegx__
+
+/*
+ * Unalign data jit fixup code fragement. Reserved space is 128 bytes.
+ * The 1st 64-bit word saves fault PC address, 2nd word is the fault
+ * instruction bundle followed by 14 JIT bundles.
+ */
+
+struct unaligned_jit_fragment {
+       unsigned long       pc;
+       tilegx_bundle_bits  bundle;
+       tilegx_bundle_bits  insn[14];
+};
+
+/*
+ * Check if a nop or fnop at bundle's pipeline X0.
+ */
+
+static bool is_bundle_x0_nop(tilegx_bundle_bits bundle)
+{
+       return (((get_UnaryOpcodeExtension_X0(bundle) ==
+                 NOP_UNARY_OPCODE_X0) &&
+                (get_RRROpcodeExtension_X0(bundle) ==
+                 UNARY_RRR_0_OPCODE_X0) &&
+                (get_Opcode_X0(bundle) ==
+                 RRR_0_OPCODE_X0)) ||
+               ((get_UnaryOpcodeExtension_X0(bundle) ==
+                 FNOP_UNARY_OPCODE_X0) &&
+                (get_RRROpcodeExtension_X0(bundle) ==
+                 UNARY_RRR_0_OPCODE_X0) &&
+                (get_Opcode_X0(bundle) ==
+                 RRR_0_OPCODE_X0)));
+}
+
+/*
+ * Check if nop or fnop at bundle's pipeline X1.
+ */
+
+static bool is_bundle_x1_nop(tilegx_bundle_bits bundle)
+{
+       return (((get_UnaryOpcodeExtension_X1(bundle) ==
+                 NOP_UNARY_OPCODE_X1) &&
+                (get_RRROpcodeExtension_X1(bundle) ==
+                 UNARY_RRR_0_OPCODE_X1) &&
+                (get_Opcode_X1(bundle) ==
+                 RRR_0_OPCODE_X1)) ||
+               ((get_UnaryOpcodeExtension_X1(bundle) ==
+                 FNOP_UNARY_OPCODE_X1) &&
+                (get_RRROpcodeExtension_X1(bundle) ==
+                 UNARY_RRR_0_OPCODE_X1) &&
+                (get_Opcode_X1(bundle) ==
+                 RRR_0_OPCODE_X1)));
+}
+
+/*
+ * Check if nop or fnop at bundle's Y0 pipeline.
+ */
+
+static bool is_bundle_y0_nop(tilegx_bundle_bits bundle)
+{
+       return (((get_UnaryOpcodeExtension_Y0(bundle) ==
+                 NOP_UNARY_OPCODE_Y0) &&
+                (get_RRROpcodeExtension_Y0(bundle) ==
+                 UNARY_RRR_1_OPCODE_Y0) &&
+                (get_Opcode_Y0(bundle) ==
+                 RRR_1_OPCODE_Y0)) ||
+               ((get_UnaryOpcodeExtension_Y0(bundle) ==
+                 FNOP_UNARY_OPCODE_Y0) &&
+                (get_RRROpcodeExtension_Y0(bundle) ==
+                 UNARY_RRR_1_OPCODE_Y0) &&
+                (get_Opcode_Y0(bundle) ==
+                 RRR_1_OPCODE_Y0)));
+}
+
+/*
+ * Check if nop or fnop at bundle's pipeline Y1.
+ */
+
+static bool is_bundle_y1_nop(tilegx_bundle_bits bundle)
+{
+       return (((get_UnaryOpcodeExtension_Y1(bundle) ==
+                 NOP_UNARY_OPCODE_Y1) &&
+                (get_RRROpcodeExtension_Y1(bundle) ==
+                 UNARY_RRR_1_OPCODE_Y1) &&
+                (get_Opcode_Y1(bundle) ==
+                 RRR_1_OPCODE_Y1)) ||
+               ((get_UnaryOpcodeExtension_Y1(bundle) ==
+                 FNOP_UNARY_OPCODE_Y1) &&
+                (get_RRROpcodeExtension_Y1(bundle) ==
+                 UNARY_RRR_1_OPCODE_Y1) &&
+                (get_Opcode_Y1(bundle) ==
+                 RRR_1_OPCODE_Y1)));
+}
+
+/*
+ * Test if a bundle's y0 and y1 pipelines are both nop or fnop.
+ */
+
+static bool is_y0_y1_nop(tilegx_bundle_bits bundle)
+{
+       return is_bundle_y0_nop(bundle) && is_bundle_y1_nop(bundle);
+}
+
+/*
+ * Test if a bundle's x0 and x1 pipelines are both nop or fnop.
+ */
+
+static bool is_x0_x1_nop(tilegx_bundle_bits bundle)
+{
+       return is_bundle_x0_nop(bundle) && is_bundle_x1_nop(bundle);
+}
+
+/*
+ * Find the destination, source registers of fault unalign access instruction
+ * at X1 or Y2. Also, allocate up to 3 scratch registers clob1, clob2 and
+ * clob3, which are guaranteed different from any register used in the fault
+ * bundle. r_alias is used to return if the other instructions other than the
+ * unalign load/store shares same register with ra, rb and rd.
+ */
+
+static void find_regs(tilegx_bundle_bits bundle, uint64_t *rd, uint64_t *ra,
+                     uint64_t *rb, uint64_t *clob1, uint64_t *clob2,
+                     uint64_t *clob3, bool *r_alias)
+{
+       int i;
+       uint64_t reg;
+       uint64_t reg_map = 0, alias_reg_map = 0, map;
+       bool alias;
+
+       *ra = -1;
+       *rb = -1;
+
+       if (rd)
+               *rd = -1;
+
+       *clob1 = -1;
+       *clob2 = -1;
+       *clob3 = -1;
+       alias = false;
+
+       /*
+        * Parse fault bundle, find potential used registers and mark
+        * corresponding bits in reg_map and alias_map. These 2 bit maps
+        * are used to find the scratch registers and determine if there
+        * is register alais.
+        */
+       if (bundle & TILEGX_BUNDLE_MODE_MASK) {  /* Y Mode Bundle. */
+
+               reg = get_SrcA_Y2(bundle);
+               reg_map |= 1ULL << reg;
+               *ra = reg;
+               reg = get_SrcBDest_Y2(bundle);
+               reg_map |= 1ULL << reg;
+
+               if (rd) {
+                       /* Load. */
+                       *rd = reg;
+                       alias_reg_map = (1ULL << *rd) | (1ULL << *ra);
+               } else {
+                       /* Store. */
+                       *rb = reg;
+                       alias_reg_map = (1ULL << *ra) | (1ULL << *rb);
+               }
+
+               if (!is_bundle_y1_nop(bundle)) {
+                       reg = get_SrcA_Y1(bundle);
+                       reg_map |= (1ULL << reg);
+                       map = (1ULL << reg);
+
+                       reg = get_SrcB_Y1(bundle);
+                       reg_map |= (1ULL << reg);
+                       map |= (1ULL << reg);
+
+                       reg = get_Dest_Y1(bundle);
+                       reg_map |= (1ULL << reg);
+                       map |= (1ULL << reg);
+
+                       if (map & alias_reg_map)
+                               alias = true;
+               }
+
+               if (!is_bundle_y0_nop(bundle)) {
+                       reg = get_SrcA_Y0(bundle);
+                       reg_map |= (1ULL << reg);
+                       map = (1ULL << reg);
+
+                       reg = get_SrcB_Y0(bundle);
+                       reg_map |= (1ULL << reg);
+                       map |= (1ULL << reg);
+
+                       reg = get_Dest_Y0(bundle);
+                       reg_map |= (1ULL << reg);
+                       map |= (1ULL << reg);
+
+                       if (map & alias_reg_map)
+                               alias = true;
+               }
+       } else  { /* X Mode Bundle. */
+
+               reg = get_SrcA_X1(bundle);
+               reg_map |= (1ULL << reg);
+               *ra = reg;
+               if (rd) {
+                       /* Load. */
+                       reg = get_Dest_X1(bundle);
+                       reg_map |= (1ULL << reg);
+                       *rd = reg;
+                       alias_reg_map = (1ULL << *rd) | (1ULL << *ra);
+               } else {
+                       /* Store. */
+                       reg = get_SrcB_X1(bundle);
+                       reg_map |= (1ULL << reg);
+                       *rb = reg;
+                       alias_reg_map = (1ULL << *ra) | (1ULL << *rb);
+               }
+
+               if (!is_bundle_x0_nop(bundle)) {
+                       reg = get_SrcA_X0(bundle);
+                       reg_map |= (1ULL << reg);
+                       map = (1ULL << reg);
+
+                       reg = get_SrcB_X0(bundle);
+                       reg_map |= (1ULL << reg);
+                       map |= (1ULL << reg);
+
+                       reg = get_Dest_X0(bundle);
+                       reg_map |= (1ULL << reg);
+                       map |= (1ULL << reg);
+
+                       if (map & alias_reg_map)
+                               alias = true;
+               }
+       }
+
+       /*
+        * "alias" indicates if the unalign access registers have collision
+        * with others in the same bundle. We jsut simply test all register
+        * operands case (RRR), ignored the case with immidate. If a bundle
+        * has no register alias, we may do fixup in a simple or fast manner.
+        * So if an immidata field happens to hit with a register, we may end
+        * up fall back to the generic handling.
+        */
+
+       *r_alias = alias;
+
+       /* Flip bits on reg_map. */
+       reg_map ^= -1ULL;
+
+       /* Scan reg_map lower 54(TREG_SP) bits to find 3 set bits. */
+       for (i = 0; i < TREG_SP; i++) {
+               if (reg_map & (0x1ULL << i)) {
+                       if (*clob1 == -1) {
+                               *clob1 = i;
+                       } else if (*clob2 == -1) {
+                               *clob2 = i;
+                       } else if (*clob3 == -1) {
+                               *clob3 = i;
+                               return;
+                       }
+               }
+       }
+}
+
+/*
+ * Sanity check for register ra, rb, rd, clob1/2/3. Return true if any of them
+ * is unexpected.
+ */
+
+static bool check_regs(uint64_t rd, uint64_t ra, uint64_t rb,
+                      uint64_t clob1, uint64_t clob2,  uint64_t clob3)
+{
+       bool unexpected = false;
+       if ((ra >= 56) && (ra != TREG_ZERO))
+               unexpected = true;
+
+       if ((clob1 >= 56) || (clob2 >= 56) || (clob3 >= 56))
+               unexpected = true;
+
+       if (rd != -1) {
+               if ((rd >= 56) && (rd != TREG_ZERO))
+                       unexpected = true;
+       } else {
+               if ((rb >= 56) && (rb != TREG_ZERO))
+                       unexpected = true;
+       }
+       return unexpected;
+}
+
+
+#define  GX_INSN_X0_MASK   ((1ULL << 31) - 1)
+#define  GX_INSN_X1_MASK   (((1ULL << 31) - 1) << 31)
+#define  GX_INSN_Y0_MASK   ((0xFULL << 27) | (0xFFFFFULL))
+#define  GX_INSN_Y1_MASK   (GX_INSN_Y0_MASK << 31)
+#define  GX_INSN_Y2_MASK   ((0x7FULL << 51) | (0x7FULL << 20))
+
+#ifdef __LITTLE_ENDIAN
+#define  GX_INSN_BSWAP(_bundle_)    (_bundle_)
+#else
+#define  GX_INSN_BSWAP(_bundle_)    swab64(_bundle_)
+#endif /* __LITTLE_ENDIAN */
+
+/*
+ * __JIT_CODE(.) creates template bundles in .rodata.unalign_data section.
+ * The corresponding static function jix_x#_###(.) generates partial or
+ * whole bundle based on the template and given arguments.
+ */
+
+#define __JIT_CODE(_X_)                                                \
+       asm (".pushsection .rodata.unalign_data, \"a\"\n"       \
+            _X_"\n"                                            \
+            ".popsection\n")
+
+__JIT_CODE("__unalign_jit_x1_mtspr:   {mtspr 0,  r0}");
+static tilegx_bundle_bits jit_x1_mtspr(int spr, int reg)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_mtspr;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_mtspr) & GX_INSN_X1_MASK) |
+               create_MT_Imm14_X1(spr) | create_SrcA_X1(reg);
+}
+
+__JIT_CODE("__unalign_jit_x1_mfspr:   {mfspr r0, 0}");
+static tilegx_bundle_bits  jit_x1_mfspr(int reg, int spr)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_mfspr;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_mfspr) & GX_INSN_X1_MASK) |
+               create_MF_Imm14_X1(spr) | create_Dest_X1(reg);
+}
+
+__JIT_CODE("__unalign_jit_x0_addi:   {addi  r0, r0, 0; iret}");
+static tilegx_bundle_bits  jit_x0_addi(int rd, int ra, int imm8)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x0_addi;
+       return (GX_INSN_BSWAP(__unalign_jit_x0_addi) & GX_INSN_X0_MASK) |
+               create_Dest_X0(rd) | create_SrcA_X0(ra) |
+               create_Imm8_X0(imm8);
+}
+
+__JIT_CODE("__unalign_jit_x1_ldna:   {ldna  r0, r0}");
+static tilegx_bundle_bits  jit_x1_ldna(int rd, int ra)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_ldna;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_ldna) &  GX_INSN_X1_MASK) |
+               create_Dest_X1(rd) | create_SrcA_X1(ra);
+}
+
+__JIT_CODE("__unalign_jit_x0_dblalign:   {dblalign r0, r0 ,r0}");
+static tilegx_bundle_bits  jit_x0_dblalign(int rd, int ra, int rb)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x0_dblalign;
+       return (GX_INSN_BSWAP(__unalign_jit_x0_dblalign) & GX_INSN_X0_MASK) |
+               create_Dest_X0(rd) | create_SrcA_X0(ra) |
+               create_SrcB_X0(rb);
+}
+
+__JIT_CODE("__unalign_jit_x1_iret:   {iret}");
+static tilegx_bundle_bits  jit_x1_iret(void)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_iret;
+       return GX_INSN_BSWAP(__unalign_jit_x1_iret) & GX_INSN_X1_MASK;
+}
+
+__JIT_CODE("__unalign_jit_x01_fnop:   {fnop;fnop}");
+static tilegx_bundle_bits  jit_x0_fnop(void)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x01_fnop;
+       return GX_INSN_BSWAP(__unalign_jit_x01_fnop) & GX_INSN_X0_MASK;
+}
+
+static tilegx_bundle_bits  jit_x1_fnop(void)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x01_fnop;
+       return GX_INSN_BSWAP(__unalign_jit_x01_fnop) & GX_INSN_X1_MASK;
+}
+
+__JIT_CODE("__unalign_jit_y2_dummy:   {fnop; fnop; ld zero, sp}");
+static tilegx_bundle_bits  jit_y2_dummy(void)
+{
+       extern  tilegx_bundle_bits __unalign_jit_y2_dummy;
+       return GX_INSN_BSWAP(__unalign_jit_y2_dummy) & GX_INSN_Y2_MASK;
+}
+
+static tilegx_bundle_bits  jit_y1_fnop(void)
+{
+       extern  tilegx_bundle_bits __unalign_jit_y2_dummy;
+       return GX_INSN_BSWAP(__unalign_jit_y2_dummy) & GX_INSN_Y1_MASK;
+}
+
+__JIT_CODE("__unalign_jit_x1_st1_add:  {st1_add r1, r0, 0}");
+static tilegx_bundle_bits  jit_x1_st1_add(int ra, int rb, int imm8)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_st1_add;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_st1_add) &
+               (~create_SrcA_X1(-1)) &
+               GX_INSN_X1_MASK) | create_SrcA_X1(ra) |
+               create_SrcB_X1(rb) | create_Dest_Imm8_X1(imm8);
+}
+
+__JIT_CODE("__unalign_jit_x1_st:  {crc32_8 r1, r0, r0; st  r0, r0}");
+static tilegx_bundle_bits  jit_x1_st(int ra, int rb)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_st;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_st) & GX_INSN_X1_MASK) |
+               create_SrcA_X1(ra) | create_SrcB_X1(rb);
+}
+
+__JIT_CODE("__unalign_jit_x1_st_add:  {st_add  r1, r0, 0}");
+static tilegx_bundle_bits  jit_x1_st_add(int ra, int rb, int imm8)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_st_add;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_st_add) &
+               (~create_SrcA_X1(-1)) &
+               GX_INSN_X1_MASK) | create_SrcA_X1(ra) |
+               create_SrcB_X1(rb) | create_Dest_Imm8_X1(imm8);
+}
+
+__JIT_CODE("__unalign_jit_x1_ld:  {crc32_8 r1, r0, r0; ld  r0, r0}");
+static tilegx_bundle_bits  jit_x1_ld(int rd, int ra)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_ld;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_ld) & GX_INSN_X1_MASK) |
+               create_Dest_X1(rd) | create_SrcA_X1(ra);
+}
+
+__JIT_CODE("__unalign_jit_x1_ld_add:  {ld_add  r1, r0, 0}");
+static tilegx_bundle_bits  jit_x1_ld_add(int rd, int ra, int imm8)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_ld_add;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_ld_add) &
+               (~create_Dest_X1(-1)) &
+               GX_INSN_X1_MASK) | create_Dest_X1(rd) |
+               create_SrcA_X1(ra) | create_Imm8_X1(imm8);
+}
+
+__JIT_CODE("__unalign_jit_x0_bfexts:  {bfexts r0, r0, 0, 0}");
+static tilegx_bundle_bits  jit_x0_bfexts(int rd, int ra, int bfs, int bfe)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x0_bfexts;
+       return (GX_INSN_BSWAP(__unalign_jit_x0_bfexts) &
+               GX_INSN_X0_MASK) |
+               create_Dest_X0(rd) | create_SrcA_X0(ra) |
+               create_BFStart_X0(bfs) | create_BFEnd_X0(bfe);
+}
+
+__JIT_CODE("__unalign_jit_x0_bfextu:  {bfextu r0, r0, 0, 0}");
+static tilegx_bundle_bits  jit_x0_bfextu(int rd, int ra, int bfs, int bfe)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x0_bfextu;
+       return (GX_INSN_BSWAP(__unalign_jit_x0_bfextu) &
+               GX_INSN_X0_MASK) |
+               create_Dest_X0(rd) | create_SrcA_X0(ra) |
+               create_BFStart_X0(bfs) | create_BFEnd_X0(bfe);
+}
+
+__JIT_CODE("__unalign_jit_x1_addi:  {bfextu r1, r1, 0, 0; addi r0, r0, 0}");
+static tilegx_bundle_bits  jit_x1_addi(int rd, int ra, int imm8)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_addi;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_addi) & GX_INSN_X1_MASK) |
+               create_Dest_X1(rd) | create_SrcA_X1(ra) |
+               create_Imm8_X1(imm8);
+}
+
+__JIT_CODE("__unalign_jit_x0_shrui:  {shrui r0, r0, 0; iret}");
+static tilegx_bundle_bits  jit_x0_shrui(int rd, int ra, int imm6)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x0_shrui;
+       return (GX_INSN_BSWAP(__unalign_jit_x0_shrui) &
+               GX_INSN_X0_MASK) |
+               create_Dest_X0(rd) | create_SrcA_X0(ra) |
+               create_ShAmt_X0(imm6);
+}
+
+__JIT_CODE("__unalign_jit_x0_rotli:  {rotli r0, r0, 0; iret}");
+static tilegx_bundle_bits  jit_x0_rotli(int rd, int ra, int imm6)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x0_rotli;
+       return (GX_INSN_BSWAP(__unalign_jit_x0_rotli) &
+               GX_INSN_X0_MASK) |
+               create_Dest_X0(rd) | create_SrcA_X0(ra) |
+               create_ShAmt_X0(imm6);
+}
+
+__JIT_CODE("__unalign_jit_x1_bnezt:  {bnezt r0, __unalign_jit_x1_bnezt}");
+static tilegx_bundle_bits  jit_x1_bnezt(int ra, int broff)
+{
+       extern  tilegx_bundle_bits __unalign_jit_x1_bnezt;
+       return (GX_INSN_BSWAP(__unalign_jit_x1_bnezt) &
+               GX_INSN_X1_MASK) |
+               create_SrcA_X1(ra) | create_BrOff_X1(broff);
+}
+
+#undef __JIT_CODE
+
+/*
+ * This function generates unalign fixup JIT.
+ *
+ * We fist find unalign load/store instruction's destination, source
+ * reguisters: ra, rb and rd. and 3 scratch registers by calling
+ * find_regs(...). 3 scratch clobbers should not alias with any register
+ * used in the fault bundle. Then analyze the fault bundle to determine
+ * if it's a load or store, operand width, branch or address increment etc.
+ * At last generated JIT is copied into JIT code area in user space.
+ */
+
+static
+void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle,
+                   int align_ctl)
+{
+       struct thread_info *info = current_thread_info();
+       struct unaligned_jit_fragment frag;
+       struct unaligned_jit_fragment *jit_code_area;
+       tilegx_bundle_bits bundle_2 = 0;
+       /* If bundle_2_enable = false, bundle_2 is fnop/nop operation. */
+       bool     bundle_2_enable = true;
+       uint64_t ra, rb, rd = -1, clob1, clob2, clob3;
+       /*
+        * Indicate if the unalign access
+        * instruction's registers hit with
+        * others in the same bundle.
+        */
+       bool     alias = false;
+       bool     load_n_store = true;
+       bool     load_store_signed = false;
+       unsigned int  load_store_size = 8;
+       bool     y1_br = false;  /* True, for a branch in same bundle at Y1.*/
+       int      y1_br_reg = 0;
+       /* True for link operation. i.e. jalr or lnk at Y1 */
+       bool     y1_lr = false;
+       int      y1_lr_reg = 0;
+       bool     x1_add = false;/* True, for load/store ADD instruction at X1*/
+       int      x1_add_imm8 = 0;
+       bool     unexpected = false;
+       int      n = 0, k;
+
+       jit_code_area =
+               (struct unaligned_jit_fragment *)(info->unalign_jit_base);
+
+       memset((void *)&frag, 0, sizeof(frag));
+
+       /* 0: X mode, Otherwise: Y mode. */
+       if (bundle & TILEGX_BUNDLE_MODE_MASK) {
+               unsigned int mod, opcode;
+
+               if (get_Opcode_Y1(bundle) == RRR_1_OPCODE_Y1 &&
+                   get_RRROpcodeExtension_Y1(bundle) ==
+                   UNARY_RRR_1_OPCODE_Y1) {
+
+                       opcode = get_UnaryOpcodeExtension_Y1(bundle);
+
+                       /*
+                        * Test "jalr", "jalrp", "jr", "jrp" instruction at Y1
+                        * pipeline.
+                        */
+                       switch (opcode) {
+                       case JALR_UNARY_OPCODE_Y1:
+                       case JALRP_UNARY_OPCODE_Y1:
+                               y1_lr = true;
+                               y1_lr_reg = 55; /* Link register. */
+                               /* FALLTHROUGH */
+                       case JR_UNARY_OPCODE_Y1:
+                       case JRP_UNARY_OPCODE_Y1:
+                               y1_br = true;
+                               y1_br_reg = get_SrcA_Y1(bundle);
+                               break;
+                       case LNK_UNARY_OPCODE_Y1:
+                               /* "lnk" at Y1 pipeline. */
+                               y1_lr = true;
+                               y1_lr_reg = get_Dest_Y1(bundle);
+                               break;
+                       }
+               }
+
+               opcode = get_Opcode_Y2(bundle);
+               mod = get_Mode(bundle);
+
+               /*
+                *  bundle_2 is bundle after making Y2 as a dummy operation
+                *  - ld zero, sp
+                */
+               bundle_2 = (bundle & (~GX_INSN_Y2_MASK)) | jit_y2_dummy();
+
+               /* Make Y1 as fnop if Y1 is a branch or lnk operation. */
+               if (y1_br || y1_lr) {
+                       bundle_2 &= ~(GX_INSN_Y1_MASK);
+                       bundle_2 |= jit_y1_fnop();
+               }
+
+               if (is_y0_y1_nop(bundle_2))
+                       bundle_2_enable = false;
+
+               if (mod == MODE_OPCODE_YC2) {
+                       /* Store. */
+                       load_n_store = false;
+                       load_store_size = 1 << opcode;
+                       load_store_signed = false;
+                       find_regs(bundle, 0, &ra, &rb, &clob1, &clob2,
+                                 &clob3, &alias);
+                       if (load_store_size > 8)
+                               unexpected = true;
+               } else {
+                       /* Load. */
+                       load_n_store = true;
+                       if (mod == MODE_OPCODE_YB2) {
+                               switch (opcode) {
+                               case LD_OPCODE_Y2:
+                                       load_store_signed = false;
+                                       load_store_size = 8;
+                                       break;
+                               case LD4S_OPCODE_Y2:
+                                       load_store_signed = true;
+                                       load_store_size = 4;
+                                       break;
+                               case LD4U_OPCODE_Y2:
+                                       load_store_signed = false;
+                                       load_store_size = 4;
+                                       break;
+                               default:
+                                       unexpected = true;
+                               }
+                       } else if (mod == MODE_OPCODE_YA2) {
+                               if (opcode == LD2S_OPCODE_Y2) {
+                                       load_store_signed = true;
+                                       load_store_size = 2;
+                               } else if (opcode == LD2U_OPCODE_Y2) {
+                                       load_store_signed = false;
+                                       load_store_size = 2;
+                               } else
+                                       unexpected = true;
+                       } else
+                               unexpected = true;
+                       find_regs(bundle, &rd, &ra, &rb, &clob1, &clob2,
+                                 &clob3, &alias);
+               }
+       } else {
+               unsigned int opcode;
+
+               /* bundle_2 is bundle after making X1 as "fnop". */
+               bundle_2 = (bundle & (~GX_INSN_X1_MASK)) | jit_x1_fnop();
+
+               if (is_x0_x1_nop(bundle_2))
+                       bundle_2_enable = false;
+
+               if (get_Opcode_X1(bundle) == RRR_0_OPCODE_X1) {
+                       opcode = get_UnaryOpcodeExtension_X1(bundle);
+
+                       if (get_RRROpcodeExtension_X1(bundle) ==
+                           UNARY_RRR_0_OPCODE_X1) {
+                               load_n_store = true;
+                               find_regs(bundle, &rd, &ra, &rb, &clob1,
+                                         &clob2, &clob3, &alias);
+
+                               switch (opcode) {
+                               case LD_UNARY_OPCODE_X1:
+                                       load_store_signed = false;
+                                       load_store_size = 8;
+                                       break;
+                               case LD4S_UNARY_OPCODE_X1:
+                                       load_store_signed = true;
+                                       /* FALLTHROUGH */
+                               case LD4U_UNARY_OPCODE_X1:
+                                       load_store_size = 4;
+                                       break;
+
+                               case LD2S_UNARY_OPCODE_X1:
+                                       load_store_signed = true;
+                                       /* FALLTHROUGH */
+                               case LD2U_UNARY_OPCODE_X1:
+                                       load_store_size = 2;
+                                       break;
+                               default:
+                                       unexpected = true;
+                               }
+                       } else {
+                               load_n_store = false;
+                               load_store_signed = false;
+                               find_regs(bundle, 0, &ra, &rb,
+                                         &clob1, &clob2, &clob3,
+                                         &alias);
+
+                               opcode = get_RRROpcodeExtension_X1(bundle);
+                               switch (opcode) {
+                               case ST_RRR_0_OPCODE_X1:
+                                       load_store_size = 8;
+                                       break;
+                               case ST4_RRR_0_OPCODE_X1:
+                                       load_store_size = 4;
+                                       break;
+                               case ST2_RRR_0_OPCODE_X1:
+                                       load_store_size = 2;
+                                       break;
+                               default:
+                                       unexpected = true;
+                               }
+                       }
+               } else if (get_Opcode_X1(bundle) == IMM8_OPCODE_X1) {
+                       load_n_store = true;
+                       opcode = get_Imm8OpcodeExtension_X1(bundle);
+                       switch (opcode) {
+                       case LD_ADD_IMM8_OPCODE_X1:
+                               load_store_size = 8;
+                               break;
+
+                       case LD4S_ADD_IMM8_OPCODE_X1:
+                               load_store_signed = true;
+                               /* FALLTHROUGH */
+                       case LD4U_ADD_IMM8_OPCODE_X1:
+                               load_store_size = 4;
+                               break;
+
+                       case LD2S_ADD_IMM8_OPCODE_X1:
+                               load_store_signed = true;
+                               /* FALLTHROUGH */
+                       case LD2U_ADD_IMM8_OPCODE_X1:
+                               load_store_size = 2;
+                               break;
+
+                       case ST_ADD_IMM8_OPCODE_X1:
+                               load_n_store = false;
+                               load_store_size = 8;
+                               break;
+                       case ST4_ADD_IMM8_OPCODE_X1:
+                               load_n_store = false;
+                               load_store_size = 4;
+                               break;
+                       case ST2_ADD_IMM8_OPCODE_X1:
+                               load_n_store = false;
+                               load_store_size = 2;
+                               break;
+                       default:
+                               unexpected = true;
+                       }
+
+                       if (!unexpected) {
+                               x1_add = true;
+                               if (load_n_store)
+                                       x1_add_imm8 = get_Imm8_X1(bundle);
+                               else
+                                       x1_add_imm8 = get_Dest_Imm8_X1(bundle);
+                       }
+
+                       find_regs(bundle, load_n_store ? (&rd) : NULL,
+                                 &ra, &rb, &clob1, &clob2, &clob3, &alias);
+               } else
+                       unexpected = true;
+       }
+
+       /*
+        * Some sanity check for register numbers extracted from fault bundle.
+        */
+       if (check_regs(rd, ra, rb, clob1, clob2, clob3) == true)
+               unexpected = true;
+
+       /* Give warning if register ra has an aligned address. */
+       if (!unexpected)
+               WARN_ON(!((load_store_size - 1) & (regs->regs[ra])));
+
+
+       /*
+        * Fault came from kernel space, here we only need take care of
+        * unaligned "get_user/put_user" macros defined in "uaccess.h".
+        * Basically, we will handle bundle like this:
+        * {ld/2u/4s rd, ra; movei rx, 0} or {st/2/4 ra, rb; movei rx, 0}
+        * (Refer to file "arch/tile/include/asm/uaccess.h" for details).
+        * For either load or store, byte-wise operation is performed by calling
+        * get_user() or put_user(). If the macro returns non-zero value,
+        * set the value to rx, otherwise set zero to rx. Finally make pc point
+        * to next bundle and return.
+        */
+
+       if (EX1_PL(regs->ex1) != USER_PL) {
+
+               unsigned long rx = 0;
+               unsigned long x = 0, ret = 0;
+
+               if (y1_br || y1_lr || x1_add ||
+                   (load_store_signed !=
+                    (load_n_store && load_store_size == 4))) {
+                       /* No branch, link, wrong sign-ext or load/store add. */
+                       unexpected = true;
+               } else if (!unexpected) {
+                       if (bundle & TILEGX_BUNDLE_MODE_MASK) {
+                               /*
+                                * Fault bundle is Y mode.
+                                * Check if the Y1 and Y0 is the form of
+                                * { movei rx, 0; nop/fnop }, if yes,
+                                * find the rx.
+                                */
+
+                               if ((get_Opcode_Y1(bundle) == ADDI_OPCODE_Y1)
+                                   && (get_SrcA_Y1(bundle) == TREG_ZERO) &&
+                                   (get_Imm8_Y1(bundle) == 0) &&
+                                   is_bundle_y0_nop(bundle)) {
+                                       rx = get_Dest_Y1(bundle);
+                               } else if ((get_Opcode_Y0(bundle) ==
+                                           ADDI_OPCODE_Y0) &&
+                                          (get_SrcA_Y0(bundle) == TREG_ZERO) &&
+                                          (get_Imm8_Y0(bundle) == 0) &&
+                                          is_bundle_y1_nop(bundle)) {
+                                       rx = get_Dest_Y0(bundle);
+                               } else {
+                                       unexpected = true;
+                               }
+                       } else {
+                               /*
+                                * Fault bundle is X mode.
+                                * Check if the X0 is 'movei rx, 0',
+                                * if yes, find the rx.
+                                */
+
+                               if ((get_Opcode_X0(bundle) == IMM8_OPCODE_X0)
+                                   && (get_Imm8OpcodeExtension_X0(bundle) ==
+                                       ADDI_IMM8_OPCODE_X0) &&
+                                   (get_SrcA_X0(bundle) == TREG_ZERO) &&
+                                   (get_Imm8_X0(bundle) == 0)) {
+                                       rx = get_Dest_X0(bundle);
+                               } else {
+                                       unexpected = true;
+                               }
+                       }
+
+                       /* rx should be less than 56. */
+                       if (!unexpected && (rx >= 56))
+                               unexpected = true;
+               }
+
+               if (!search_exception_tables(regs->pc)) {
+                       /* No fixup in the exception tables for the pc. */
+                       unexpected = true;
+               }
+
+               if (unexpected) {
+                       /* Unexpected unalign kernel fault. */
+                       struct task_struct *tsk = validate_current();
+
+                       bust_spinlocks(1);
+
+                       show_regs(regs);
+
+                       if (unlikely(tsk->pid < 2)) {
+                               panic("Kernel unalign fault running %s!",
+                                     tsk->pid ? "init" : "the idle task");
+                       }
+#ifdef SUPPORT_DIE
+                       die("Oops", regs);
+#endif
+                       bust_spinlocks(1);
+
+                       do_group_exit(SIGKILL);
+
+               } else {
+                       unsigned long i, b = 0;
+                       unsigned char *ptr =
+                               (unsigned char *)regs->regs[ra];
+                       if (load_n_store) {
+                               /* handle get_user(x, ptr) */
+                               for (i = 0; i < load_store_size; i++) {
+                                       ret = get_user(b, ptr++);
+                                       if (!ret) {
+                                               /* Success! update x. */
+#ifdef __LITTLE_ENDIAN
+                                               x |= (b << (8 * i));
+#else
+                                               x <<= 8;
+                                               x |= b;
+#endif /* __LITTLE_ENDIAN */
+                                       } else {
+                                               x = 0;
+                                               break;
+                                       }
+                               }
+
+                               /* Sign-extend 4-byte loads. */
+                               if (load_store_size == 4)
+                                       x = (long)(int)x;
+
+                               /* Set register rd. */
+                               regs->regs[rd] = x;
+
+                               /* Set register rx. */
+                               regs->regs[rx] = ret;
+
+                               /* Bump pc. */
+                               regs->pc += 8;
+
+                       } else {
+                               /* Handle put_user(x, ptr) */
+                               x = regs->regs[rb];
+#ifdef __LITTLE_ENDIAN
+                               b = x;
+#else
+                               /*
+                                * Swap x in order to store x from low
+                                * to high memory same as the
+                                * little-endian case.
+                                */
+                               switch (load_store_size) {
+                               case 8:
+                                       b = swab64(x);
+                                       break;
+                               case 4:
+                                       b = swab32(x);
+                                       break;
+                               case 2:
+                                       b = swab16(x);
+                                       break;
+                               }
+#endif /* __LITTLE_ENDIAN */
+                               for (i = 0; i < load_store_size; i++) {
+                                       ret = put_user(b, ptr++);
+                                       if (ret)
+                                               break;
+                                       /* Success! shift 1 byte. */
+                                       b >>= 8;
+                               }
+                               /* Set register rx. */
+                               regs->regs[rx] = ret;
+
+                               /* Bump pc. */
+                               regs->pc += 8;
+                       }
+               }
+
+               unaligned_fixup_count++;
+
+               if (unaligned_printk) {
+                       pr_info("%s/%d. Unalign fixup for kernel access "
+                               "to userspace %lx.",
+                               current->comm, current->pid, regs->regs[ra]);
+               }
+
+               /* Done! Return to the exception handler. */
+               return;
+       }
+
+       if ((align_ctl == 0) || unexpected) {
+               siginfo_t info = {
+                       .si_signo = SIGBUS,
+                       .si_code = BUS_ADRALN,
+                       .si_addr = (unsigned char __user *)0
+               };
+               if (unaligned_printk)
+                       pr_info("Unalign bundle: unexp @%llx, %llx",
+                               (unsigned long long)regs->pc,
+                               (unsigned long long)bundle);
+
+               if (ra < 56) {
+                       unsigned long uaa = (unsigned long)regs->regs[ra];
+                       /* Set bus Address. */
+                       info.si_addr = (unsigned char __user *)uaa;
+               }
+
+               unaligned_fixup_count++;
+
+               trace_unhandled_signal("unaligned fixup trap", regs,
+                                      (unsigned long)info.si_addr, SIGBUS);
+               force_sig_info(info.si_signo, &info, current);
+               return;
+       }
+
+#ifdef __LITTLE_ENDIAN
+#define UA_FIXUP_ADDR_DELTA          1
+#define UA_FIXUP_BFEXT_START(_B_)    0
+#define UA_FIXUP_BFEXT_END(_B_)     (8 * (_B_) - 1)
+#else /* __BIG_ENDIAN */
+#define UA_FIXUP_ADDR_DELTA          -1
+#define UA_FIXUP_BFEXT_START(_B_)   (64 - 8 * (_B_))
+#define UA_FIXUP_BFEXT_END(_B_)      63
+#endif /* __LITTLE_ENDIAN */
+
+
+
+       if ((ra != rb) && (rd != TREG_SP) && !alias &&
+           !y1_br && !y1_lr && !x1_add) {
+               /*
+                * Simple case: ra != rb and no register alias found,
+                * and no branch or link. This will be the majority.
+                * We can do a little better for simplae case than the
+                * generic scheme below.
+                */
+               if (!load_n_store) {
+                       /*
+                        * Simple store: ra != rb, no need for scratch register.
+                        * Just store and rotate to right bytewise.
+                        */
+#ifdef __BIG_ENDIAN
+                       frag.insn[n++] =
+                               jit_x0_addi(ra, ra, load_store_size - 1) |
+                               jit_x1_fnop();
+#endif /* __BIG_ENDIAN */
+                       for (k = 0; k < load_store_size; k++) {
+                               /* Store a byte. */
+                               frag.insn[n++] =
+                                       jit_x0_rotli(rb, rb, 56) |
+                                       jit_x1_st1_add(ra, rb,
+                                                      UA_FIXUP_ADDR_DELTA);
+                       }
+#ifdef __BIG_ENDIAN
+                       frag.insn[n] = jit_x1_addi(ra, ra, 1);
+#else
+                       frag.insn[n] = jit_x1_addi(ra, ra,
+                                                  -1 * load_store_size);
+#endif /* __LITTLE_ENDIAN */
+
+                       if (load_store_size == 8) {
+                               frag.insn[n] |= jit_x0_fnop();
+                       } else if (load_store_size == 4) {
+                               frag.insn[n] |= jit_x0_rotli(rb, rb, 32);
+                       } else { /* = 2 */
+                               frag.insn[n] |= jit_x0_rotli(rb, rb, 16);
+                       }
+                       n++;
+                       if (bundle_2_enable)
+                               frag.insn[n++] = bundle_2;
+                       frag.insn[n++] = jit_x0_fnop() | jit_x1_iret();
+               } else {
+                       if (rd == ra) {
+                               /* Use two clobber registers: clob1/2. */
+                               frag.insn[n++] =
+                                       jit_x0_addi(TREG_SP, TREG_SP, -16) |
+                                       jit_x1_fnop();
+                               frag.insn[n++] =
+                                       jit_x0_addi(clob1, ra, 7) |
+                                       jit_x1_st_add(TREG_SP, clob1, -8);
+                               frag.insn[n++] =
+                                       jit_x0_addi(clob2, ra, 0) |
+                                       jit_x1_st(TREG_SP, clob2);
+                               frag.insn[n++] =
+                                       jit_x0_fnop() |
+                                       jit_x1_ldna(rd, ra);
+                               frag.insn[n++] =
+                                       jit_x0_fnop() |
+                                       jit_x1_ldna(clob1, clob1);
+                               /*
+                                * Note: we must make sure that rd must not
+                                * be sp. Recover clob1/2 from stack.
+                                */
+                               frag.insn[n++] =
+                                       jit_x0_dblalign(rd, clob1, clob2) |
+                                       jit_x1_ld_add(clob2, TREG_SP, 8);
+                               frag.insn[n++] =
+                                       jit_x0_fnop() |
+                                       jit_x1_ld_add(clob1, TREG_SP, 16);
+                       } else {
+                               /* Use one clobber register: clob1 only. */
+                               frag.insn[n++] =
+                                       jit_x0_addi(TREG_SP, TREG_SP, -16) |
+                                       jit_x1_fnop();
+                               frag.insn[n++] =
+                                       jit_x0_addi(clob1, ra, 7) |
+                                       jit_x1_st(TREG_SP, clob1);
+                               frag.insn[n++] =
+                                       jit_x0_fnop() |
+                                       jit_x1_ldna(rd, ra);
+                               frag.insn[n++] =
+                                       jit_x0_fnop() |
+                                       jit_x1_ldna(clob1, clob1);
+                               /*
+                                * Note: we must make sure that rd must not
+                                * be sp. Recover clob1 from stack.
+                                */
+                               frag.insn[n++] =
+                                       jit_x0_dblalign(rd, clob1, ra) |
+                                       jit_x1_ld_add(clob1, TREG_SP, 16);
+                       }
+
+                       if (bundle_2_enable)
+                               frag.insn[n++] = bundle_2;
+                       /*
+                        * For non 8-byte load, extract corresponding bytes and
+                        * signed extension.
+                        */
+                       if (load_store_size == 4) {
+                               if (load_store_signed)
+                                       frag.insn[n++] =
+                                               jit_x0_bfexts(
+                                                       rd, rd,
+                                                       UA_FIXUP_BFEXT_START(4),
+                                                       UA_FIXUP_BFEXT_END(4)) |
+                                               jit_x1_fnop();
+                               else
+                                       frag.insn[n++] =
+                                               jit_x0_bfextu(
+                                                       rd, rd,
+                                                       UA_FIXUP_BFEXT_START(4),
+                                                       UA_FIXUP_BFEXT_END(4)) |
+                                               jit_x1_fnop();
+                       } else if (load_store_size == 2) {
+                               if (load_store_signed)
+                                       frag.insn[n++] =
+                                               jit_x0_bfexts(
+                                                       rd, rd,
+                                                       UA_FIXUP_BFEXT_START(2),
+                                                       UA_FIXUP_BFEXT_END(2)) |
+                                               jit_x1_fnop();
+                               else
+                                       frag.insn[n++] =
+                                               jit_x0_bfextu(
+                                                       rd, rd,
+                                                       UA_FIXUP_BFEXT_START(2),
+                                                       UA_FIXUP_BFEXT_END(2)) |
+                                               jit_x1_fnop();
+                       }
+
+                       frag.insn[n++] =
+                               jit_x0_fnop()  |
+                               jit_x1_iret();
+               }
+       } else if (!load_n_store) {
+
+               /*
+                * Generic memory store cases: use 3 clobber registers.
+                *
+                * Alloc space for saveing clob2,1,3 on user's stack.
+                * register clob3 points to where clob2 saved, followed by
+                * clob1 and 3 from high to low memory.
+                */
+               frag.insn[n++] =
+                       jit_x0_addi(TREG_SP, TREG_SP, -32)    |
+                       jit_x1_fnop();
+               frag.insn[n++] =
+                       jit_x0_addi(clob3, TREG_SP, 16)  |
+                       jit_x1_st_add(TREG_SP, clob3, 8);
+#ifdef __LITTLE_ENDIAN
+               frag.insn[n++] =
+                       jit_x0_addi(clob1, ra, 0)   |
+                       jit_x1_st_add(TREG_SP, clob1, 8);
+#else
+               frag.insn[n++] =
+                       jit_x0_addi(clob1, ra, load_store_size - 1)   |
+                       jit_x1_st_add(TREG_SP, clob1, 8);
+#endif
+               if (load_store_size == 8) {
+                       /*
+                        * We save one byte a time, not for fast, but compact
+                        * code. After each store, data source register shift
+                        * right one byte. unchanged after 8 stores.
+                        */
+                       frag.insn[n++] =
+                               jit_x0_addi(clob2, TREG_ZERO, 7)     |
+                               jit_x1_st_add(TREG_SP, clob2, 16);
+                       frag.insn[n++] =
+                               jit_x0_rotli(rb, rb, 56)      |
+                               jit_x1_st1_add(clob1, rb, UA_FIXUP_ADDR_DELTA);
+                       frag.insn[n++] =
+                               jit_x0_addi(clob2, clob2, -1) |
+                               jit_x1_bnezt(clob2, -1);
+                       frag.insn[n++] =
+                               jit_x0_fnop()                 |
+                               jit_x1_addi(clob2, y1_br_reg, 0);
+               } else if (load_store_size == 4) {
+                       frag.insn[n++] =
+                               jit_x0_addi(clob2, TREG_ZERO, 3)     |
+                               jit_x1_st_add(TREG_SP, clob2, 16);
+                       frag.insn[n++] =
+                               jit_x0_rotli(rb, rb, 56)      |
+                               jit_x1_st1_add(clob1, rb, UA_FIXUP_ADDR_DELTA);
+                       frag.insn[n++] =
+                               jit_x0_addi(clob2, clob2, -1) |
+                               jit_x1_bnezt(clob2, -1);
+                       /*
+                        * same as 8-byte case, but need shift another 4
+                        * byte to recover rb for 4-byte store.
+                        */
+                       frag.insn[n++] = jit_x0_rotli(rb, rb, 32)      |
+                               jit_x1_addi(clob2, y1_br_reg, 0);
+               } else { /* =2 */
+                       frag.insn[n++] =
+                               jit_x0_addi(clob2, rb, 0)     |
+                               jit_x1_st_add(TREG_SP, clob2, 16);
+                       for (k = 0; k < 2; k++) {
+                               frag.insn[n++] =
+                                       jit_x0_shrui(rb, rb, 8)  |
+                                       jit_x1_st1_add(clob1, rb,
+                                                      UA_FIXUP_ADDR_DELTA);
+                       }
+                       frag.insn[n++] =
+                               jit_x0_addi(rb, clob2, 0)       |
+                               jit_x1_addi(clob2, y1_br_reg, 0);
+               }
+
+               if (bundle_2_enable)
+                       frag.insn[n++] = bundle_2;
+
+               if (y1_lr) {
+                       frag.insn[n++] =
+                               jit_x0_fnop()                    |
+                               jit_x1_mfspr(y1_lr_reg,
+                                            SPR_EX_CONTEXT_0_0);
+               }
+               if (y1_br) {
+                       frag.insn[n++] =
+                               jit_x0_fnop()                    |
+                               jit_x1_mtspr(SPR_EX_CONTEXT_0_0,
+                                            clob2);
+               }
+               if (x1_add) {
+                       frag.insn[n++] =
+                               jit_x0_addi(ra, ra, x1_add_imm8) |
+                               jit_x1_ld_add(clob2, clob3, -8);
+               } else {
+                       frag.insn[n++] =
+                               jit_x0_fnop()                    |
+                               jit_x1_ld_add(clob2, clob3, -8);
+               }
+               frag.insn[n++] =
+                       jit_x0_fnop()   |
+                       jit_x1_ld_add(clob1, clob3, -8);
+               frag.insn[n++] = jit_x0_fnop()   | jit_x1_ld(clob3, clob3);
+               frag.insn[n++] = jit_x0_fnop()   | jit_x1_iret();
+
+       } else {
+               /*
+                * Generic memory load cases.
+                *
+                * Alloc space for saveing clob1,2,3 on user's stack.
+                * register clob3 points to where clob1 saved, followed
+                * by clob2 and 3 from high to low memory.
+                */
+
+               frag.insn[n++] =
+                       jit_x0_addi(TREG_SP, TREG_SP, -32) |
+                       jit_x1_fnop();
+               frag.insn[n++] =
+                       jit_x0_addi(clob3, TREG_SP, 16) |
+                       jit_x1_st_add(TREG_SP, clob3, 8);
+               frag.insn[n++] =
+                       jit_x0_addi(clob2, ra, 0) |
+                       jit_x1_st_add(TREG_SP, clob2, 8);
+
+               if (y1_br) {
+                       frag.insn[n++] =
+                               jit_x0_addi(clob1, y1_br_reg, 0) |
+                               jit_x1_st_add(TREG_SP, clob1, 16);
+               } else {
+                       frag.insn[n++] =
+                               jit_x0_fnop() |
+                               jit_x1_st_add(TREG_SP, clob1, 16);
+               }
+
+               if (bundle_2_enable)
+                       frag.insn[n++] = bundle_2;
+
+               if (y1_lr) {
+                       frag.insn[n++] =
+                               jit_x0_fnop()  |
+                               jit_x1_mfspr(y1_lr_reg,
+                                            SPR_EX_CONTEXT_0_0);
+               }
+
+               if (y1_br) {
+                       frag.insn[n++] =
+                               jit_x0_fnop() |
+                               jit_x1_mtspr(SPR_EX_CONTEXT_0_0,
+                                            clob1);
+               }
+
+               frag.insn[n++] =
+                       jit_x0_addi(clob1, clob2, 7)      |
+                       jit_x1_ldna(rd, clob2);
+               frag.insn[n++] =
+                       jit_x0_fnop()                     |
+                       jit_x1_ldna(clob1, clob1);
+               frag.insn[n++] =
+                       jit_x0_dblalign(rd, clob1, clob2) |
+                       jit_x1_ld_add(clob1, clob3, -8);
+               if (x1_add) {
+                       frag.insn[n++] =
+                               jit_x0_addi(ra, ra, x1_add_imm8) |
+                               jit_x1_ld_add(clob2, clob3, -8);
+               } else {
+                       frag.insn[n++] =
+                               jit_x0_fnop()  |
+                               jit_x1_ld_add(clob2, clob3, -8);
+               }
+
+               frag.insn[n++] =
+                       jit_x0_fnop() |
+                       jit_x1_ld(clob3, clob3);
+
+               if (load_store_size == 4) {
+                       if (load_store_signed)
+                               frag.insn[n++] =
+                                       jit_x0_bfexts(
+                                               rd, rd,
+                                               UA_FIXUP_BFEXT_START(4),
+                                               UA_FIXUP_BFEXT_END(4)) |
+                                       jit_x1_fnop();
+                       else
+                               frag.insn[n++] =
+                                       jit_x0_bfextu(
+                                               rd, rd,
+                                               UA_FIXUP_BFEXT_START(4),
+                                               UA_FIXUP_BFEXT_END(4)) |
+                                       jit_x1_fnop();
+               } else if (load_store_size == 2) {
+                       if (load_store_signed)
+                               frag.insn[n++] =
+                                       jit_x0_bfexts(
+                                               rd, rd,
+                                               UA_FIXUP_BFEXT_START(2),
+                                               UA_FIXUP_BFEXT_END(2)) |
+                                       jit_x1_fnop();
+                       else
+                               frag.insn[n++] =
+                                       jit_x0_bfextu(
+                                               rd, rd,
+                                               UA_FIXUP_BFEXT_START(2),
+                                               UA_FIXUP_BFEXT_END(2)) |
+                                       jit_x1_fnop();
+               }
+
+               frag.insn[n++] = jit_x0_fnop() | jit_x1_iret();
+       }
+
+       /* Max JIT bundle count is 14. */
+       WARN_ON(n > 14);
+
+       if (!unexpected) {
+               int status = 0;
+               int idx = (regs->pc >> 3) &
+                       ((1ULL << (PAGE_SHIFT - UNALIGN_JIT_SHIFT)) - 1);
+
+               frag.pc = regs->pc;
+               frag.bundle = bundle;
+
+               if (unaligned_printk) {
+                       pr_info("%s/%d, Unalign fixup: pc=%lx "
+                               "bundle=%lx %d %d %d %d %d %d %d %d.",
+                               current->comm, current->pid,
+                               (unsigned long)frag.pc,
+                               (unsigned long)frag.bundle,
+                               (int)alias, (int)rd, (int)ra,
+                               (int)rb, (int)bundle_2_enable,
+                               (int)y1_lr, (int)y1_br, (int)x1_add);
+
+                       for (k = 0; k < n; k += 2)
+                               pr_info("[%d] %016llx %016llx", k,
+                                       (unsigned long long)frag.insn[k],
+                                       (unsigned long long)frag.insn[k+1]);
+               }
+
+               /* Swap bundle byte order for big endian sys. */
+#ifdef __BIG_ENDIAN
+               frag.bundle = GX_INSN_BSWAP(frag.bundle);
+               for (k = 0; k < n; k++)
+                       frag.insn[k] = GX_INSN_BSWAP(frag.insn[k]);
+#endif /* __BIG_ENDIAN */
+
+               status = copy_to_user((void __user *)&jit_code_area[idx],
+                                     &frag, sizeof(frag));
+               if (status) {
+                       /* Fail to copy JIT into user land. send SIGSEGV. */
+                       siginfo_t info = {
+                               .si_signo = SIGSEGV,
+                               .si_code = SEGV_MAPERR,
+                               .si_addr = (void __user *)&jit_code_area[idx]
+                       };
+
+                       pr_warn("Unalign fixup: pid=%d %s jit_code_area=%llx",
+                               current->pid, current->comm,
+                               (unsigned long long)&jit_code_area[idx]);
+
+                       trace_unhandled_signal("segfault in unalign fixup",
+                                              regs,
+                                              (unsigned long)info.si_addr,
+                                              SIGSEGV);
+                       force_sig_info(info.si_signo, &info, current);
+                       return;
+               }
+
+
+               /* Do a cheaper increment, not accurate. */
+               unaligned_fixup_count++;
+               __flush_icache_range((unsigned long)&jit_code_area[idx],
+                                    (unsigned long)&jit_code_area[idx] +
+                                    sizeof(frag));
+
+               /* Setup SPR_EX_CONTEXT_0_0/1 for returning to user program.*/
+               __insn_mtspr(SPR_EX_CONTEXT_0_0, regs->pc + 8);
+               __insn_mtspr(SPR_EX_CONTEXT_0_1, PL_ICS_EX1(USER_PL, 0));
+
+               /* Modify pc at the start of new JIT. */
+               regs->pc = (unsigned long)&jit_code_area[idx].insn[0];
+               /* Set ICS in SPR_EX_CONTEXT_K_1. */
+               regs->ex1 = PL_ICS_EX1(USER_PL, 1);
+       }
+}
+
+
+/*
+ * C function to generate unalign data JIT. Called from unalign data
+ * interrupt handler.
+ *
+ * First check if unalign fix is disabled or exception did not not come from
+ * user space or sp register points to unalign address, if true, generate a
+ * SIGBUS. Then map a page into user space as JIT area if it is not mapped
+ * yet. Genenerate JIT code by calling jit_bundle_gen(). After that return
+ * back to exception handler.
+ *
+ * The exception handler will "iret" to new generated JIT code after
+ * restoring caller saved registers. In theory, the JIT code will perform
+ * another "iret" to resume user's program.
+ */
+
+void do_unaligned(struct pt_regs *regs, int vecnum)
+{
+       tilegx_bundle_bits __user  *pc;
+       tilegx_bundle_bits bundle;
+       struct thread_info *info = current_thread_info();
+       int align_ctl;
+
+       /* Checks the per-process unaligned JIT flags */
+       align_ctl = unaligned_fixup;
+       switch (task_thread_info(current)->align_ctl) {
+       case PR_UNALIGN_NOPRINT:
+               align_ctl = 1;
+               break;
+       case PR_UNALIGN_SIGBUS:
+               align_ctl = 0;
+               break;
+       }
+
+       /* Enable iterrupt in order to access user land. */
+       local_irq_enable();
+
+       /*
+        * The fault came from kernel space. Two choices:
+        * (a) unaligned_fixup < 1, we will first call get/put_user fixup
+        *     to return -EFAULT. If no fixup, simply panic the kernel.
+        * (b) unaligned_fixup >=1, we will try to fix the unaligned access
+        *     if it was triggered by get_user/put_user() macros. Panic the
+        *     kernel if it is not fixable.
+        */
+
+       if (EX1_PL(regs->ex1) != USER_PL) {
+
+               if (align_ctl < 1) {
+                       unaligned_fixup_count++;
+                       /* If exception came from kernel, try fix it up. */
+                       if (fixup_exception(regs)) {
+                               if (unaligned_printk)
+                                       pr_info("Unalign fixup: %d %llx @%llx",
+                                               (int)unaligned_fixup,
+                                               (unsigned long long)regs->ex1,
+                                               (unsigned long long)regs->pc);
+                               return;
+                       }
+                       /* Not fixable. Go panic. */
+                       panic("Unalign exception in Kernel. pc=%lx",
+                             regs->pc);
+                       return;
+               } else {
+                       /*
+                        * Try to fix the exception. If we can't, panic the
+                        * kernel.
+                        */
+                       bundle = GX_INSN_BSWAP(
+                               *((tilegx_bundle_bits *)(regs->pc)));
+                       jit_bundle_gen(regs, bundle, align_ctl);
+                       return;
+               }
+       }
+
+       /*
+        * Fault came from user with ICS or stack is not aligned.
+        * If so, we will trigger SIGBUS.
+        */
+       if ((regs->sp & 0x7) || (regs->ex1) || (align_ctl < 0)) {
+               siginfo_t info = {
+                       .si_signo = SIGBUS,
+                       .si_code = BUS_ADRALN,
+                       .si_addr = (unsigned char __user *)0
+               };
+
+               if (unaligned_printk)
+                       pr_info("Unalign fixup: %d %llx @%llx",
+                               (int)unaligned_fixup,
+                               (unsigned long long)regs->ex1,
+                               (unsigned long long)regs->pc);
+
+               unaligned_fixup_count++;
+
+               trace_unhandled_signal("unaligned fixup trap", regs, 0, SIGBUS);
+               force_sig_info(info.si_signo, &info, current);
+               return;
+       }
+
+
+       /* Read the bundle casued the exception! */
+       pc = (tilegx_bundle_bits __user *)(regs->pc);
+       if (get_user(bundle, pc) != 0) {
+               /* Probably never be here since pc is valid user address.*/
+               siginfo_t info = {
+                       .si_signo = SIGSEGV,
+                       .si_code = SEGV_MAPERR,
+                       .si_addr = (void __user *)pc
+               };
+               pr_err("Couldn't read instruction at %p trying to step\n", pc);
+               trace_unhandled_signal("segfault in unalign fixup", regs,
+                                      (unsigned long)info.si_addr, SIGSEGV);
+               force_sig_info(info.si_signo, &info, current);
+               return;
+       }
+
+       if (!info->unalign_jit_base) {
+               void __user *user_page;
+
+               /*
+                * Allocate a page in userland.
+                * For 64-bit processes we try to place the mapping far
+                * from anything else that might be going on (specifically
+                * 64 GB below the top of the user address space).  If it
+                * happens not to be possible to put it there, it's OK;
+                * the kernel will choose another location and we'll
+                * remember it for later.
+                */
+               if (is_compat_task())
+                       user_page = NULL;
+               else
+                       user_page = (void __user *)(TASK_SIZE - (1UL << 36)) +
+                               (current->pid << PAGE_SHIFT);
+
+               user_page = (void __user *) vm_mmap(NULL,
+                                                   (unsigned long)user_page,
+                                                   PAGE_SIZE,
+                                                   PROT_EXEC | PROT_READ |
+                                                   PROT_WRITE,
+#ifdef CONFIG_HOMECACHE
+                                                   MAP_CACHE_HOME_TASK |
+#endif
+                                                   MAP_PRIVATE |
+                                                   MAP_ANONYMOUS,
+                                                   0);
+
+               if (IS_ERR((void __force *)user_page)) {
+                       pr_err("Out of kernel pages trying do_mmap.\n");
+                       return;
+               }
+
+               /* Save the address in the thread_info struct */
+               info->unalign_jit_base = user_page;
+               if (unaligned_printk)
+                       pr_info("Unalign bundle: %d:%d, allocate page @%llx",
+                               raw_smp_processor_id(), current->pid,
+                               (unsigned long long)user_page);
+       }
+
+       /* Generate unalign JIT */
+       jit_bundle_gen(regs, GX_INSN_BSWAP(bundle), align_ctl);
+}
+
+#endif /* __tilegx__ */
diff --git a/arch/tile/kernel/vdso.c b/arch/tile/kernel/vdso.c
new file mode 100644 (file)
index 0000000..1533af2
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#include <linux/binfmts.h>
+#include <linux/compat.h>
+#include <linux/elf.h>
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+
+#include <asm/vdso.h>
+#include <asm/mman.h>
+#include <asm/sections.h>
+
+#include <arch/sim.h>
+
+/* The alignment of the vDSO. */
+#define VDSO_ALIGNMENT  PAGE_SIZE
+
+
+static unsigned int vdso_pages;
+static struct page **vdso_pagelist;
+
+#ifdef CONFIG_COMPAT
+static unsigned int vdso32_pages;
+static struct page **vdso32_pagelist;
+#endif
+static int vdso_ready;
+
+/*
+ * The vdso data page.
+ */
+static union {
+       struct vdso_data        data;
+       u8                      page[PAGE_SIZE];
+} vdso_data_store __page_aligned_data;
+
+struct vdso_data *vdso_data = &vdso_data_store.data;
+
+static unsigned int __read_mostly vdso_enabled = 1;
+
+static struct page **vdso_setup(void *vdso_kbase, unsigned int pages)
+{
+       int i;
+       struct page **pagelist;
+
+       pagelist = kzalloc(sizeof(struct page *) * (pages + 1), GFP_KERNEL);
+       BUG_ON(pagelist == NULL);
+       for (i = 0; i < pages - 1; i++) {
+               struct page *pg = virt_to_page(vdso_kbase + i*PAGE_SIZE);
+               ClearPageReserved(pg);
+               pagelist[i] = pg;
+       }
+       pagelist[pages - 1] = virt_to_page(vdso_data);
+       pagelist[pages] = NULL;
+
+       return pagelist;
+}
+
+static int __init vdso_init(void)
+{
+       int data_pages = sizeof(vdso_data_store) >> PAGE_SHIFT;
+
+       /*
+        * We can disable vDSO support generally, but we need to retain
+        * one page to support the two-bundle (16-byte) rt_sigreturn path.
+        */
+       if (!vdso_enabled) {
+               size_t offset = (unsigned long)&__vdso_rt_sigreturn;
+               static struct page *sigret_page;
+               sigret_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+               BUG_ON(sigret_page == NULL);
+               vdso_pagelist = &sigret_page;
+               vdso_pages = 1;
+               BUG_ON(offset >= PAGE_SIZE);
+               memcpy(page_address(sigret_page) + offset,
+                      vdso_start + offset, 16);
+#ifdef CONFIG_COMPAT
+               vdso32_pages = vdso_pages;
+               vdso32_pagelist = vdso_pagelist;
+#endif
+               vdso_ready = 1;
+               return 0;
+       }
+
+       vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
+       vdso_pages += data_pages;
+       vdso_pagelist = vdso_setup(vdso_start, vdso_pages);
+
+#ifdef CONFIG_COMPAT
+       vdso32_pages = (vdso32_end - vdso32_start) >> PAGE_SHIFT;
+       vdso32_pages += data_pages;
+       vdso32_pagelist = vdso_setup(vdso32_start, vdso32_pages);
+#endif
+
+       smp_wmb();
+       vdso_ready = 1;
+
+       return 0;
+}
+arch_initcall(vdso_init);
+
+const char *arch_vma_name(struct vm_area_struct *vma)
+{
+       if (vma->vm_mm && vma->vm_start == VDSO_BASE)
+               return "[vdso]";
+#ifndef __tilegx__
+       if (vma->vm_start == MEM_USER_INTRPT)
+               return "[intrpt]";
+#endif
+       return NULL;
+}
+
+struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
+{
+       return NULL;
+}
+
+int in_gate_area(struct mm_struct *mm, unsigned long address)
+{
+       return 0;
+}
+
+int in_gate_area_no_mm(unsigned long address)
+{
+       return 0;
+}
+
+int setup_vdso_pages(void)
+{
+       struct page **pagelist;
+       unsigned long pages;
+       struct mm_struct *mm = current->mm;
+       unsigned long vdso_base = 0;
+       int retval = 0;
+
+       if (!vdso_ready)
+               return 0;
+
+       mm->context.vdso_base = 0;
+
+       pagelist = vdso_pagelist;
+       pages = vdso_pages;
+#ifdef CONFIG_COMPAT
+       if (is_compat_task()) {
+               pagelist = vdso32_pagelist;
+               pages = vdso32_pages;
+       }
+#endif
+
+       /*
+        * vDSO has a problem and was disabled, just don't "enable" it for the
+        * process.
+        */
+       if (pages == 0)
+               return 0;
+
+       vdso_base = get_unmapped_area(NULL, vdso_base,
+                                     (pages << PAGE_SHIFT) +
+                                     ((VDSO_ALIGNMENT - 1) & PAGE_MASK),
+                                     0, 0);
+       if (IS_ERR_VALUE(vdso_base)) {
+               retval = vdso_base;
+               return retval;
+       }
+
+       /* Add required alignment. */
+       vdso_base = ALIGN(vdso_base, VDSO_ALIGNMENT);
+
+       /*
+        * Put vDSO base into mm struct. We need to do this before calling
+        * install_special_mapping or the perf counter mmap tracking code
+        * will fail to recognise it as a vDSO (since arch_vma_name fails).
+        */
+       mm->context.vdso_base = vdso_base;
+
+       /*
+        * our vma flags don't have VM_WRITE so by default, the process isn't
+        * allowed to write those pages.
+        * gdb can break that with ptrace interface, and thus trigger COW on
+        * those pages but it's then your responsibility to never do that on
+        * the "data" page of the vDSO or you'll stop getting kernel updates
+        * and your nice userland gettimeofday will be totally dead.
+        * It's fine to use that for setting breakpoints in the vDSO code
+        * pages though
+        */
+       retval = install_special_mapping(mm, vdso_base,
+                                        pages << PAGE_SHIFT,
+                                        VM_READ|VM_EXEC |
+                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC,
+                                        pagelist);
+       if (retval)
+               mm->context.vdso_base = 0;
+
+       return retval;
+}
+
+static __init int vdso_func(char *s)
+{
+       return kstrtouint(s, 0, &vdso_enabled);
+}
+__setup("vdso=", vdso_func);
diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
new file mode 100644 (file)
index 0000000..e2b7a2f
--- /dev/null
@@ -0,0 +1,118 @@
+# Symbols present in the vdso
+vdso-syms = rt_sigreturn gettimeofday
+
+# Files to link into the vdso
+obj-vdso = $(patsubst %, v%.o, $(vdso-syms))
+
+# Build rules
+targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds
+obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
+
+# vdso32 is only for tilegx -m32 compat task.
+VDSO32-$(CONFIG_COMPAT) := y
+
+obj-y += vdso.o
+obj-$(VDSO32-y) += vdso32.o
+extra-y += vdso.lds
+CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
+
+# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
+CFLAGS_REMOVE_vdso.o = -pg
+CFLAGS_REMOVE_vdso32.o = -pg
+CFLAGS_REMOVE_vrt_sigreturn.o = -pg
+CFLAGS_REMOVE_vrt_sigreturn32.o = -pg
+CFLAGS_REMOVE_vgettimeofday.o = -pg
+CFLAGS_REMOVE_vgettimeofday32.o = -pg
+
+ifdef CONFIG_FEEDBACK_COLLECT
+# vDSO code runs in userspace, not collecting feedback data.
+CFLAGS_REMOVE_vdso.o = -ffeedback-generate
+CFLAGS_REMOVE_vdso32.o = -ffeedback-generate
+CFLAGS_REMOVE_vrt_sigreturn.o = -ffeedback-generate
+CFLAGS_REMOVE_vrt_sigreturn32.o = -ffeedback-generate
+CFLAGS_REMOVE_vgettimeofday.o = -ffeedback-generate
+CFLAGS_REMOVE_vgettimeofday32.o = -ffeedback-generate
+endif
+
+# Disable gcov profiling for VDSO code
+GCOV_PROFILE := n
+
+# Force dependency
+$(obj)/vdso.o: $(obj)/vdso.so
+
+# link rule for the .so file, .lds has to be first
+SYSCFLAGS_vdso.so.dbg = $(c_flags)
+$(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso)
+       $(call if_changed,vdsold)
+
+
+# We also create a special relocatable object that should mirror the symbol
+# table and layout of the linked DSO.  With ld -R we can then refer to
+# these symbols in the kernel code rather than hand-coded addresses.
+extra-y += vdso-syms.o
+$(obj)/built-in.o: $(obj)/vdso-syms.o
+$(obj)/built-in.o: ld_flags += -R $(obj)/vdso-syms.o
+
+SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \
+                            $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
+SYSCFLAGS_vdso_syms.o = -r
+$(obj)/vdso-syms.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
+       $(call if_changed,vdsold)
+
+
+# strip rule for the .so file
+$(obj)/%.so: OBJCOPYFLAGS := -S
+$(obj)/%.so: $(obj)/%.so.dbg FORCE
+       $(call if_changed,objcopy)
+
+# actual build commands
+# The DSO images are built using a special linker script
+# Add -lgcc so tilepro gets static muldi3 and lshrdi3 definitions.
+# Make sure only to export the intended __vdso_xxx symbol offsets.
+quiet_cmd_vdsold = VDSOLD  $@
+      cmd_vdsold = $(CC) $(KCFLAGS) -nostdlib $(SYSCFLAGS_$(@F)) \
+                           -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp -lgcc && \
+                   $(CROSS_COMPILE)objcopy \
+                           $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@
+
+# install commands for the unstripped file
+quiet_cmd_vdso_install = INSTALL $@
+      cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
+
+vdso.so: $(obj)/vdso.so.dbg
+       @mkdir -p $(MODLIB)/vdso
+       $(call cmd,vdso_install)
+
+vdso32.so: $(obj)/vdso32.so.dbg
+       $(call cmd,vdso_install)
+
+vdso_install: vdso.so
+vdso32_install: vdso32.so
+
+
+KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS))
+KBUILD_AFLAGS_32 += -m32 -s
+KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
+KBUILD_CFLAGS_32 += -m32 -fPIC -shared
+
+obj-vdso32 = $(patsubst %, v%32.o, $(vdso-syms))
+obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
+
+targets += $(obj-vdso32) vdso32.so vdso32.so.dbg
+
+$(obj-vdso32:%=%): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
+$(obj-vdso32:%=%): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
+
+$(obj)/vgettimeofday32.o: $(obj)/vgettimeofday.c
+       $(call if_changed,cc_o_c)
+
+$(obj)/vrt_sigreturn32.o: $(obj)/vrt_sigreturn.S
+       $(call if_changed,as_o_S)
+
+# Force dependency
+$(obj)/vdso32.o: $(obj)/vdso32.so
+
+SYSCFLAGS_vdso32.so.dbg = -m32 -shared -s -Wl,-soname=linux-vdso32.so.1 \
+                           $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
+$(obj)/vdso32.so.dbg: $(src)/vdso.lds $(obj-vdso32)
+       $(call if_changed,vdsold)
diff --git a/arch/tile/kernel/vdso/vdso.S b/arch/tile/kernel/vdso/vdso.S
new file mode 100644 (file)
index 0000000..3467adb
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#include <linux/init.h>
+#include <linux/linkage.h>
+#include <asm/page.h>
+
+       __PAGE_ALIGNED_DATA
+
+       .global vdso_start, vdso_end
+       .align PAGE_SIZE
+vdso_start:
+       .incbin "arch/tile/kernel/vdso/vdso.so"
+       .align PAGE_SIZE
+vdso_end:
+
+       .previous
diff --git a/arch/tile/kernel/vdso/vdso.lds.S b/arch/tile/kernel/vdso/vdso.lds.S
new file mode 100644 (file)
index 0000000..041cd6c
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#define VDSO_VERSION_STRING    LINUX_2.6
+
+
+OUTPUT_ARCH(tile)
+
+/* The ELF entry point can be used to set the AT_SYSINFO value. */
+ENTRY(__vdso_rt_sigreturn);
+
+
+SECTIONS
+{
+       . = SIZEOF_HEADERS;
+
+       .hash           : { *(.hash) }                  :text
+       .gnu.hash       : { *(.gnu.hash) }
+       .dynsym         : { *(.dynsym) }
+       .dynstr         : { *(.dynstr) }
+       .gnu.version    : { *(.gnu.version) }
+       .gnu.version_d  : { *(.gnu.version_d) }
+       .gnu.version_r  : { *(.gnu.version_r) }
+
+       .note           : { *(.note.*) }                :text   :note
+       .dynamic        : { *(.dynamic) }               :text   :dynamic
+
+       .eh_frame_hdr   : { *(.eh_frame_hdr) }          :text   :eh_frame_hdr
+       .eh_frame       : { KEEP (*(.eh_frame)) }       :text
+
+       .rodata  : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+
+       /*
+        * This linker script is used both with -r and with -shared.
+        * For the layouts to match, we need to skip more than enough
+        * space for the dynamic symbol table et al. If this amount
+        * is insufficient, ld -shared will barf. Just increase it here.
+        */
+       . = 0x1000;
+       .text           : { *(.text .text.*) }          :text
+
+       .data           : {
+               *(.got.plt) *(.got)
+               *(.data .data.* .gnu.linkonce.d.*)
+               *(.dynbss)
+               *(.bss .bss.* .gnu.linkonce.b.*)
+       }
+}
+
+
+/*
+ * We must supply the ELF program headers explicitly to get just one
+ * PT_LOAD segment, and set the flags explicitly to make segments read-only.
+ */
+PHDRS
+{
+       text            PT_LOAD         FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
+       dynamic         PT_DYNAMIC      FLAGS(4);               /* PF_R */
+       note            PT_NOTE         FLAGS(4);               /* PF_R */
+       eh_frame_hdr    PT_GNU_EH_FRAME;
+}
+
+
+/*
+ * This controls what userland symbols we export from the vDSO.
+ */
+VERSION
+{
+       VDSO_VERSION_STRING {
+       global:
+               __vdso_rt_sigreturn;
+               __vdso_gettimeofday;
+               gettimeofday;
+       local:*;
+       };
+}
diff --git a/arch/tile/kernel/vdso/vdso32.S b/arch/tile/kernel/vdso/vdso32.S
new file mode 100644 (file)
index 0000000..1d1ac32
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#include <linux/init.h>
+#include <linux/linkage.h>
+#include <asm/page.h>
+
+       __PAGE_ALIGNED_DATA
+
+       .global vdso32_start, vdso32_end
+       .align PAGE_SIZE
+vdso32_start:
+       .incbin "arch/tile/kernel/vdso/vdso32.so"
+       .align PAGE_SIZE
+vdso32_end:
+
+       .previous
diff --git a/arch/tile/kernel/vdso/vgettimeofday.c b/arch/tile/kernel/vdso/vgettimeofday.c
new file mode 100644 (file)
index 0000000..51ec8e4
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#define VDSO_BUILD  /* avoid some shift warnings for -m32 in <asm/page.h> */
+#include <linux/time.h>
+#include <asm/timex.h>
+#include <asm/vdso.h>
+
+#if CHIP_HAS_SPLIT_CYCLE()
+static inline cycles_t get_cycles_inline(void)
+{
+       unsigned int high = __insn_mfspr(SPR_CYCLE_HIGH);
+       unsigned int low = __insn_mfspr(SPR_CYCLE_LOW);
+       unsigned int high2 = __insn_mfspr(SPR_CYCLE_HIGH);
+
+       while (unlikely(high != high2)) {
+               low = __insn_mfspr(SPR_CYCLE_LOW);
+               high = high2;
+               high2 = __insn_mfspr(SPR_CYCLE_HIGH);
+       }
+
+       return (((cycles_t)high) << 32) | low;
+}
+#define get_cycles get_cycles_inline
+#endif
+
+/*
+ * Find out the vDSO data page address in the process address space.
+ */
+inline unsigned long get_datapage(void)
+{
+       unsigned long ret;
+
+       /* vdso data page located in the 2nd vDSO page. */
+       asm volatile ("lnk %0" : "=r"(ret));
+       ret &= ~(PAGE_SIZE - 1);
+       ret += PAGE_SIZE;
+
+       return ret;
+}
+
+int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+       cycles_t cycles;
+       unsigned long count, sec, ns;
+       volatile struct vdso_data *vdso_data;
+
+       vdso_data = (struct vdso_data *)get_datapage();
+       /* The use of the timezone is obsolete, normally tz is NULL. */
+       if (unlikely(tz != NULL)) {
+               while (1) {
+                       /* Spin until the update finish. */
+                       count = vdso_data->tz_update_count;
+                       if (count & 1)
+                               continue;
+
+                       tz->tz_minuteswest = vdso_data->tz_minuteswest;
+                       tz->tz_dsttime = vdso_data->tz_dsttime;
+
+                       /* Check whether updated, read again if so. */
+                       if (count == vdso_data->tz_update_count)
+                               break;
+               }
+       }
+
+       if (unlikely(tv == NULL))
+               return 0;
+
+       while (1) {
+               /* Spin until the update finish. */
+               count = vdso_data->tb_update_count;
+               if (count & 1)
+                       continue;
+
+               cycles = (get_cycles() - vdso_data->xtime_tod_stamp);
+               ns = (cycles * vdso_data->mult) >> vdso_data->shift;
+               sec = vdso_data->xtime_clock_sec;
+               ns += vdso_data->xtime_clock_nsec;
+               if (ns >= NSEC_PER_SEC) {
+                       ns -= NSEC_PER_SEC;
+                       sec += 1;
+               }
+
+               /* Check whether updated, read again if so. */
+               if (count == vdso_data->tb_update_count)
+                       break;
+       }
+
+       tv->tv_sec = sec;
+       tv->tv_usec = ns / 1000;
+
+       return 0;
+}
+
+int gettimeofday(struct timeval *tv, struct timezone *tz)
+       __attribute__((weak, alias("__vdso_gettimeofday")));
diff --git a/arch/tile/kernel/vdso/vrt_sigreturn.S b/arch/tile/kernel/vdso/vrt_sigreturn.S
new file mode 100644 (file)
index 0000000..6326caf
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2012 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#include <linux/linkage.h>
+#include <arch/abi.h>
+#include <asm/unistd.h>
+
+/*
+ * Note that libc has a copy of this function that it uses to compare
+ * against the PC when a stack backtrace ends, so if this code is
+ * changed, the libc implementation(s) should also be updated.
+ */
+ENTRY(__vdso_rt_sigreturn)
+       moveli TREG_SYSCALL_NR_NAME, __NR_rt_sigreturn
+       swint1
+       /* We don't use ENDPROC to avoid tagging this symbol as FUNC,
+        * which confuses the perf tool.
+        */
+       END(__vdso_rt_sigreturn)
index a13ed90..f181942 100644 (file)
@@ -5,7 +5,7 @@
 #include <hv/hypervisor.h>
 
 /* Text loads starting from the supervisor interrupt vector address. */
-#define TEXT_OFFSET MEM_SV_INTRPT
+#define TEXT_OFFSET MEM_SV_START
 
 OUTPUT_ARCH(tile)
 ENTRY(_start)
@@ -13,7 +13,7 @@ jiffies = jiffies_64;
 
 PHDRS
 {
-  intrpt1 PT_LOAD ;
+  intrpt PT_LOAD ;
   text PT_LOAD ;
   data PT_LOAD ;
 }
@@ -24,14 +24,17 @@ SECTIONS
   #define LOAD_OFFSET TEXT_OFFSET
 
   /* Interrupt vectors */
-  .intrpt1 (LOAD_OFFSET) : AT ( 0 )   /* put at the start of physical memory */
+  .intrpt (LOAD_OFFSET) : AT ( 0 )   /* put at the start of physical memory */
   {
     _text = .;
-    *(.intrpt1)
-  } :intrpt1 =0
+    *(.intrpt)
+  } :intrpt =0
 
   /* Hypervisor call vectors */
-  #include "hvglue.lds"
+  . = ALIGN(0x10000);
+  .hvglue : AT (ADDR(.hvglue) - LOAD_OFFSET) {
+    *(.hvglue)
+  } :NONE
 
   /* Now the real code */
   . = ALIGN(0x20000);
@@ -40,7 +43,11 @@ SECTIONS
     HEAD_TEXT
     SCHED_TEXT
     LOCK_TEXT
+    KPROBES_TEXT
+    IRQENTRY_TEXT
     __fix_text_end = .;   /* tile-cpack won't rearrange before this */
+    ALIGN_FUNCTION();
+    *(.hottext*)
     TEXT_TEXT
     *(.text.*)
     *(.coldtext*)
@@ -67,20 +74,8 @@ SECTIONS
   __init_end = .;
 
   _sdata = .;                   /* Start of data section */
-
   RO_DATA_SECTION(PAGE_SIZE)
-
-  /* initially writeable, then read-only */
-  . = ALIGN(PAGE_SIZE);
-  __w1data_begin = .;
-  .w1data : AT(ADDR(.w1data) - LOAD_OFFSET) {
-    VMLINUX_SYMBOL(__w1data_begin) = .;
-    *(.w1data)
-    VMLINUX_SYMBOL(__w1data_end) = .;
-  }
-
   RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
-
   _edata = .;
 
   EXCEPTION_TABLE(L2_CACHE_BYTES)
index 985f598..c4211cb 100644 (file)
@@ -4,15 +4,15 @@
 
 lib-y = cacheflush.o checksum.o cpumask.o delay.o uaccess.o \
        memmove.o memcpy_$(BITS).o memchr_$(BITS).o memset_$(BITS).o \
-       strchr_$(BITS).o strlen_$(BITS).o
-
-ifeq ($(CONFIG_TILEGX),y)
-CFLAGS_REMOVE_memcpy_user_64.o = -fno-omit-frame-pointer
-lib-y += memcpy_user_64.o
-else
-lib-y += atomic_32.o atomic_asm_32.o memcpy_tile64.o
-endif
+       strchr_$(BITS).o strlen_$(BITS).o strnlen_$(BITS).o
 
+lib-$(CONFIG_TILEGX) += memcpy_user_64.o
+lib-$(CONFIG_TILEPRO) += atomic_32.o atomic_asm_32.o
 lib-$(CONFIG_SMP) += spinlock_$(BITS).o usercopy_$(BITS).o
 
 obj-$(CONFIG_MODULES) += exports.o
+
+# The finv_buffer_remote() and copy_{to,from}_user() routines can't
+# have -pg added, since they both rely on being leaf functions.
+CFLAGS_REMOVE_cacheflush.o = -pg
+CFLAGS_REMOVE_memcpy_user_64.o = -pg
index f5cada7..759efa3 100644 (file)
 #include <linux/atomic.h>
 #include <arch/chip.h>
 
-/* See <asm/atomic_32.h> */
-#if ATOMIC_LOCKS_FOUND_VIA_TABLE()
-
-/*
- * A block of memory containing locks for atomic ops. Each instance of this
- * struct will be homed on a different CPU.
- */
-struct atomic_locks_on_cpu {
-       int lock[ATOMIC_HASH_L2_SIZE];
-} __attribute__((aligned(ATOMIC_HASH_L2_SIZE * 4)));
-
-static DEFINE_PER_CPU(struct atomic_locks_on_cpu, atomic_lock_pool);
-
-/* The locks we'll use until __init_atomic_per_cpu is called. */
-static struct atomic_locks_on_cpu __initdata initial_atomic_locks;
-
-/* Hash into this vector to get a pointer to lock for the given atomic. */
-struct atomic_locks_on_cpu *atomic_lock_ptr[ATOMIC_HASH_L1_SIZE]
-       __write_once = {
-       [0 ... ATOMIC_HASH_L1_SIZE-1] (&initial_atomic_locks)
-};
-
-#else /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
-
 /* This page is remapped on startup to be hash-for-home. */
 int atomic_locks[PAGE_SIZE / sizeof(int)] __page_aligned_bss;
 
-#endif /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
-
 int *__atomic_hashed_lock(volatile void *v)
 {
        /* NOTE: this code must match "sys_cmpxchg" in kernel/intvec_32.S */
-#if ATOMIC_LOCKS_FOUND_VIA_TABLE()
-       unsigned long i =
-               (unsigned long) v & ((PAGE_SIZE-1) & -sizeof(long long));
-       unsigned long n = __insn_crc32_32(0, i);
-
-       /* Grab high bits for L1 index. */
-       unsigned long l1_index = n >> ((sizeof(n) * 8) - ATOMIC_HASH_L1_SHIFT);
-       /* Grab low bits for L2 index. */
-       unsigned long l2_index = n & (ATOMIC_HASH_L2_SIZE - 1);
-
-       return &atomic_lock_ptr[l1_index]->lock[l2_index];
-#else
        /*
         * Use bits [3, 3 + ATOMIC_HASH_SHIFT) as the lock index.
         * Using mm works here because atomic_locks is page aligned.
@@ -72,26 +34,13 @@ int *__atomic_hashed_lock(volatile void *v)
                                      (unsigned long)atomic_locks,
                                      2, (ATOMIC_HASH_SHIFT + 2) - 1);
        return (int *)ptr;
-#endif
 }
 
 #ifdef CONFIG_SMP
 /* Return whether the passed pointer is a valid atomic lock pointer. */
 static int is_atomic_lock(int *p)
 {
-#if ATOMIC_LOCKS_FOUND_VIA_TABLE()
-       int i;
-       for (i = 0; i < ATOMIC_HASH_L1_SIZE; ++i) {
-
-               if (p >= &atomic_lock_ptr[i]->lock[0] &&
-                   p < &atomic_lock_ptr[i]->lock[ATOMIC_HASH_L2_SIZE]) {
-                       return 1;
-               }
-       }
-       return 0;
-#else
        return p >= &atomic_locks[0] && p < &atomic_locks[ATOMIC_HASH_SIZE];
-#endif
 }
 
 void __atomic_fault_unlock(int *irqlock_word)
@@ -110,33 +59,32 @@ static inline int *__atomic_setup(volatile void *v)
        return __atomic_hashed_lock(v);
 }
 
-int _atomic_xchg(atomic_t *v, int n)
+int _atomic_xchg(int *v, int n)
 {
-       return __atomic_xchg(&v->counter, __atomic_setup(v), n).val;
+       return __atomic_xchg(v, __atomic_setup(v), n).val;
 }
 EXPORT_SYMBOL(_atomic_xchg);
 
-int _atomic_xchg_add(atomic_t *v, int i)
+int _atomic_xchg_add(int *v, int i)
 {
-       return __atomic_xchg_add(&v->counter, __atomic_setup(v), i).val;
+       return __atomic_xchg_add(v, __atomic_setup(v), i).val;
 }
 EXPORT_SYMBOL(_atomic_xchg_add);
 
-int _atomic_xchg_add_unless(atomic_t *v, int a, int u)
+int _atomic_xchg_add_unless(int *v, int a, int u)
 {
        /*
         * Note: argument order is switched here since it is easier
         * to use the first argument consistently as the "old value"
         * in the assembly, as is done for _atomic_cmpxchg().
         */
-       return __atomic_xchg_add_unless(&v->counter, __atomic_setup(v), u, a)
-               .val;
+       return __atomic_xchg_add_unless(v, __atomic_setup(v), u, a).val;
 }
 EXPORT_SYMBOL(_atomic_xchg_add_unless);
 
-int _atomic_cmpxchg(atomic_t *v, int o, int n)
+int _atomic_cmpxchg(int *v, int o, int n)
 {
-       return __atomic_cmpxchg(&v->counter, __atomic_setup(v), o, n).val;
+       return __atomic_cmpxchg(v, __atomic_setup(v), o, n).val;
 }
 EXPORT_SYMBOL(_atomic_cmpxchg);
 
@@ -159,33 +107,32 @@ unsigned long _atomic_xor(volatile unsigned long *p, unsigned long mask)
 EXPORT_SYMBOL(_atomic_xor);
 
 
-u64 _atomic64_xchg(atomic64_t *v, u64 n)
+u64 _atomic64_xchg(u64 *v, u64 n)
 {
-       return __atomic64_xchg(&v->counter, __atomic_setup(v), n);
+       return __atomic64_xchg(v, __atomic_setup(v), n);
 }
 EXPORT_SYMBOL(_atomic64_xchg);
 
-u64 _atomic64_xchg_add(atomic64_t *v, u64 i)
+u64 _atomic64_xchg_add(u64 *v, u64 i)
 {
-       return __atomic64_xchg_add(&v->counter, __atomic_setup(v), i);
+       return __atomic64_xchg_add(v, __atomic_setup(v), i);
 }
 EXPORT_SYMBOL(_atomic64_xchg_add);
 
-u64 _atomic64_xchg_add_unless(atomic64_t *v, u64 a, u64 u)
+u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u)
 {
        /*
         * Note: argument order is switched here since it is easier
         * to use the first argument consistently as the "old value"
         * in the assembly, as is done for _atomic_cmpxchg().
         */
-       return __atomic64_xchg_add_unless(&v->counter, __atomic_setup(v),
-                                         u, a);
+       return __atomic64_xchg_add_unless(v, __atomic_setup(v), u, a);
 }
 EXPORT_SYMBOL(_atomic64_xchg_add_unless);
 
-u64 _atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n)
+u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n)
 {
-       return __atomic64_cmpxchg(&v->counter, __atomic_setup(v), o, n);
+       return __atomic64_cmpxchg(v, __atomic_setup(v), o, n);
 }
 EXPORT_SYMBOL(_atomic64_cmpxchg);
 
@@ -208,54 +155,8 @@ struct __get_user __atomic_bad_address(int __user *addr)
 }
 
 
-#if CHIP_HAS_CBOX_HOME_MAP()
-static int __init noatomichash(char *str)
-{
-       pr_warning("noatomichash is deprecated.\n");
-       return 1;
-}
-__setup("noatomichash", noatomichash);
-#endif
-
 void __init __init_atomic_per_cpu(void)
 {
-#if ATOMIC_LOCKS_FOUND_VIA_TABLE()
-
-       unsigned int i;
-       int actual_cpu;
-
-       /*
-        * Before this is called from setup, we just have one lock for
-        * all atomic objects/operations.  Here we replace the
-        * elements of atomic_lock_ptr so that they point at per_cpu
-        * integers.  This seemingly over-complex approach stems from
-        * the fact that DEFINE_PER_CPU defines an entry for each cpu
-        * in the grid, not each cpu from 0..ATOMIC_HASH_SIZE-1.  But
-        * for efficient hashing of atomics to their locks we want a
-        * compile time constant power of 2 for the size of this
-        * table, so we use ATOMIC_HASH_SIZE.
-        *
-        * Here we populate atomic_lock_ptr from the per cpu
-        * atomic_lock_pool, interspersing by actual cpu so that
-        * subsequent elements are homed on consecutive cpus.
-        */
-
-       actual_cpu = cpumask_first(cpu_possible_mask);
-
-       for (i = 0; i < ATOMIC_HASH_L1_SIZE; ++i) {
-               /*
-                * Preincrement to slightly bias against using cpu 0,
-                * which has plenty of stuff homed on it already.
-                */
-               actual_cpu = cpumask_next(actual_cpu, cpu_possible_mask);
-               if (actual_cpu >= nr_cpu_ids)
-                       actual_cpu = cpumask_first(cpu_possible_mask);
-
-               atomic_lock_ptr[i] = &per_cpu(atomic_lock_pool, actual_cpu);
-       }
-
-#else /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
-
        /* Validate power-of-two and "bigger than cpus" assumption */
        BUILD_BUG_ON(ATOMIC_HASH_SIZE & (ATOMIC_HASH_SIZE-1));
        BUG_ON(ATOMIC_HASH_SIZE < nr_cpu_ids);
@@ -279,6 +180,4 @@ void __init __init_atomic_per_cpu(void)
         * That should not produce more indices than ATOMIC_HASH_SIZE.
         */
        BUILD_BUG_ON((PAGE_SIZE >> 3) > ATOMIC_HASH_SIZE);
-
-#endif /* ATOMIC_LOCKS_FOUND_VIA_TABLE() */
 }
index 3063804..6bda313 100644 (file)
@@ -164,6 +164,7 @@ STD_ENTRY_SECTION(__atomic\name, .text.atomic)
        STD_ENDPROC(__atomic\name)
        .ifc \bitwidth,32
        .pushsection __ex_table,"a"
+       .align  4
        .word   1b, __atomic\name
        .word   2b, __atomic\name
        .word   __atomic\name, __atomic_bad_address
index 8f8ad81..9c0ec22 100644 (file)
@@ -36,7 +36,8 @@ static inline void force_load(char *p)
  * core (if "!hfh") or homed via hash-for-home (if "hfh"), waiting
  * until the memory controller holds the flushed values.
  */
-void finv_buffer_remote(void *buffer, size_t size, int hfh)
+void __attribute__((optimize("omit-frame-pointer")))
+finv_buffer_remote(void *buffer, size_t size, int hfh)
 {
        char *p, *base;
        size_t step_size, load_count;
@@ -147,18 +148,21 @@ void finv_buffer_remote(void *buffer, size_t size, int hfh)
                force_load(p);
 
        /*
-        * Repeat, but with inv's instead of loads, to get rid of the
+        * Repeat, but with finv's instead of loads, to get rid of the
         * data we just loaded into our own cache and the old home L3.
-        * No need to unroll since inv's don't target a register.
+        * No need to unroll since finv's don't target a register.
+        * The finv's are guaranteed not to actually flush the data in
+        * the buffer back to their home, since we just read it, so the
+        * lines are clean in cache; we will only invalidate those lines.
         */
        p = (char *)buffer + size - 1;
-       __insn_inv(p);
+       __insn_finv(p);
        p -= step_size;
        p = (char *)((unsigned long)p | (step_size - 1));
        for (; p >= base; p -= step_size)
-               __insn_inv(p);
+               __insn_finv(p);
 
-       /* Wait for the load+inv's (and thus finvs) to have completed. */
+       /* Wait for these finv's (and thus the first finvs) to be done. */
        __insn_mf();
 
 #ifdef __tilegx__
index a93b02a..82733c8 100644 (file)
@@ -22,7 +22,6 @@ EXPORT_SYMBOL(strnlen_user_asm);
 EXPORT_SYMBOL(strncpy_from_user_asm);
 EXPORT_SYMBOL(clear_user_asm);
 EXPORT_SYMBOL(flush_user_asm);
-EXPORT_SYMBOL(inv_user_asm);
 EXPORT_SYMBOL(finv_user_asm);
 
 /* arch/tile/kernel/entry.S */
@@ -34,6 +33,12 @@ EXPORT_SYMBOL(dump_stack);
 /* arch/tile/kernel/head.S */
 EXPORT_SYMBOL(empty_zero_page);
 
+#ifdef CONFIG_FUNCTION_TRACER
+/* arch/tile/kernel/mcount_64.S */
+#include <asm/ftrace.h>
+EXPORT_SYMBOL(__mcount);
+#endif /* CONFIG_FUNCTION_TRACER */
+
 /* arch/tile/lib/, various memcpy files */
 EXPORT_SYMBOL(memcpy);
 EXPORT_SYMBOL(__copy_to_user_inatomic);
index 6f867db..f8196b3 100644 (file)
@@ -36,7 +36,7 @@ void *memchr(const void *s, int c, size_t n)
        p = (const uint64_t *)(s_int & -8);
 
        /* Create eight copies of the byte for which we are looking. */
-       goal = 0x0101010101010101ULL * (uint8_t) c;
+       goal = copy_byte(c);
 
        /* Read the first word, but munge it so that bytes before the array
         * will not match goal.
index 2a419a6..a2771ae 100644 (file)
 
 #include <linux/linkage.h>
 
-/* On TILE64, we wrap these functions via arch/tile/lib/memcpy_tile64.c */
-#if !CHIP_HAS_COHERENT_LOCAL_CACHE()
-#define memcpy __memcpy_asm
-#define __copy_to_user_inatomic __copy_to_user_inatomic_asm
-#define __copy_from_user_inatomic __copy_from_user_inatomic_asm
-#define __copy_from_user_zeroing __copy_from_user_zeroing_asm
-#endif
-
 #define IS_MEMCPY        0
 #define IS_COPY_FROM_USER  1
 #define IS_COPY_FROM_USER_ZEROING  2
@@ -44,6 +36,7 @@
  */
 #define EX \
        .pushsection __ex_table, "a"; \
+       .align 4; \
        .word 9f, memcpy_common_fixup; \
        .popsection; \
        9
@@ -158,12 +151,9 @@ EX:        { sw r0, r3; addi r0, r0, 4; addi r2, r2, -4 }
 
        { addi r3, r1, 60; andi r9, r9, -64 }
 
-#if CHIP_HAS_WH64()
        /* No need to prefetch dst, we'll just do the wh64
         * right before we copy a line.
         */
-#endif
-
 EX:    { lw r5, r3; addi r3, r3, 64; movei r4, 1 }
        /* Intentionally stall for a few cycles to leave L2 cache alone. */
        { bnzt zero, .; move r27, lr }
@@ -171,21 +161,6 @@ EX:        { lw r6, r3; addi r3, r3, 64 }
        /* Intentionally stall for a few cycles to leave L2 cache alone. */
        { bnzt zero, . }
 EX:    { lw r7, r3; addi r3, r3, 64 }
-#if !CHIP_HAS_WH64()
-       /* Prefetch the dest */
-       /* Intentionally stall for a few cycles to leave L2 cache alone. */
-       { bnzt zero, . }
-       /* Use a real load to cause a TLB miss if necessary.  We aren't using
-        * r28, so this should be fine.
-        */
-EX:    { lw r28, r9; addi r9, r9, 64 }
-       /* Intentionally stall for a few cycles to leave L2 cache alone. */
-       { bnzt zero, . }
-       { prefetch r9; addi r9, r9, 64 }
-       /* Intentionally stall for a few cycles to leave L2 cache alone. */
-       { bnzt zero, . }
-       { prefetch r9; addi r9, r9, 64 }
-#endif
        /* Intentionally stall for a few cycles to leave L2 cache alone. */
        { bz zero, .Lbig_loop2 }
 
@@ -286,13 +261,8 @@ EX:        { lw r7, r3; addi r3, r3, 64 }
        /* Fill second L1D line. */
 EX:    { lw r17, r17; addi r1, r1, 48; mvz r3, r13, r1 } /* r17 = WORD_4 */
 
-#if CHIP_HAS_WH64()
        /* Prepare destination line for writing. */
 EX:    { wh64 r9; addi r9, r9, 64 }
-#else
-       /* Prefetch dest line */
-       { prefetch r9; addi r9, r9, 64 }
-#endif
        /* Load seven words that are L1D hits to cover wh64 L2 usage. */
 
        /* Load the three remaining words from the last L1D line, which
@@ -330,16 +300,7 @@ EX:        { lw r18, r1; addi r1, r1, 4 }                  /* r18 = WORD_8 */
 EX:    { sw r0, r16; addi r0, r0, 4; add r16, r0, r2 } /* store(WORD_0) */
 EX:    { sw r0, r13; addi r0, r0, 4; andi r16, r16, -64 } /* store(WORD_1) */
 EX:    { sw r0, r14; addi r0, r0, 4; slt_u r16, r9, r16 } /* store(WORD_2) */
-#if CHIP_HAS_WH64()
 EX:    { sw r0, r15; addi r0, r0, 4; addi r13, sp, -64 } /* store(WORD_3) */
-#else
-       /* Back up the r9 to a cache line we are already storing to
-        * if it gets past the end of the dest vector.  Strictly speaking,
-        * we don't need to back up to the start of a cache line, but it's free
-        * and tidy, so why not?
-        */
-EX:    { sw r0, r15; addi r0, r0, 4; andi r13, r0, -64 } /* store(WORD_3) */
-#endif
        /* Store second L1D line. */
 EX:    { sw r0, r17; addi r0, r0, 4; mvz r9, r16, r13 }/* store(WORD_4) */
 EX:    { sw r0, r19; addi r0, r0, 4 }                  /* store(WORD_5) */
@@ -403,7 +364,6 @@ EX: { sb r0, r3;   addi r0, r0, 1; addi r2, r2, -1 }
 
 .Ldest_is_word_aligned:
 
-#if CHIP_HAS_DWORD_ALIGN()
 EX:    { andi r8, r0, 63; lwadd_na r6, r1, 4}
        { slti_u r9, r2, 64; bz r8, .Ldest_is_L2_line_aligned }
 
@@ -511,26 +471,6 @@ EX:        { swadd r0, r13, 4; addi r2, r2, -32 }
        /* Move r1 back to the point where it corresponds to r0. */
        { addi r1, r1, -4 }
 
-#else /* !CHIP_HAS_DWORD_ALIGN() */
-
-       /* Compute right/left shift counts and load initial source words. */
-       { andi r5, r1, -4; andi r3, r1, 3 }
-EX:    { lw r6, r5; addi r5, r5, 4; shli r3, r3, 3 }
-EX:    { lw r7, r5; addi r5, r5, 4; sub r4, zero, r3 }
-
-       /* Load and store one word at a time, using shifts and ORs
-        * to correct for the misaligned src.
-        */
-.Lcopy_unaligned_src_loop:
-       { shr r6, r6, r3; shl r8, r7, r4 }
-EX:    { lw r7, r5; or r8, r8, r6; move r6, r7 }
-EX:    { sw r0, r8; addi r0, r0, 4; addi r2, r2, -4 }
-       { addi r5, r5, 4; slti_u r8, r2, 8 }
-       { bzt r8, .Lcopy_unaligned_src_loop; addi r1, r1, 4 }
-
-       { bz r2, .Lcopy_unaligned_done }
-#endif /* !CHIP_HAS_DWORD_ALIGN() */
-
        /* Fall through */
 
 /*
@@ -614,5 +554,6 @@ memcpy_fixup_loop:
        .size memcpy_common_fixup, . - memcpy_common_fixup
 
        .section __ex_table,"a"
+       .align 4
        .word .Lcfu, .Lcopy_from_user_fixup_zero_remainder
        .word .Lctu, .Lcopy_to_user_fixup_done
index c79b8e7..4815354 100644 (file)
 /* EXPORT_SYMBOL() is in arch/tile/lib/exports.c since this should be asm. */
 
 /* Must be 8 bytes in size. */
-#define word_t uint64_t
+#define op_t uint64_t
 
-#if CHIP_L2_LINE_SIZE() != 64 && CHIP_L2_LINE_SIZE() != 128
-#error "Assumes 64 or 128 byte line size"
+/* Threshold value for when to enter the unrolled loops. */
+#define        OP_T_THRES      16
+
+#if CHIP_L2_LINE_SIZE() != 64
+#error "Assumes 64 byte line size"
 #endif
 
 /* How many cache lines ahead should we prefetch? */
-#define PREFETCH_LINES_AHEAD 3
+#define PREFETCH_LINES_AHEAD 4
 
 /*
  * Provide "base versions" of load and store for the normal code path.
@@ -51,15 +54,16 @@ void *memcpy(void *__restrict dstv, const void *__restrict srcv, size_t n)
  * macros to return a count of uncopied bytes due to mm fault.
  */
 #define RETVAL 0
-int USERCOPY_FUNC(void *__restrict dstv, const void *__restrict srcv, size_t n)
+int __attribute__((optimize("omit-frame-pointer")))
+USERCOPY_FUNC(void *__restrict dstv, const void *__restrict srcv, size_t n)
 #endif
 {
        char *__restrict dst1 = (char *)dstv;
        const char *__restrict src1 = (const char *)srcv;
        const char *__restrict src1_end;
        const char *__restrict prefetch;
-       word_t *__restrict dst8;    /* 8-byte pointer to destination memory. */
-       word_t final; /* Final bytes to write to trailing word, if any */
+       op_t *__restrict dst8;    /* 8-byte pointer to destination memory. */
+       op_t final; /* Final bytes to write to trailing word, if any */
        long i;
 
        if (n < 16) {
@@ -79,104 +83,228 @@ int USERCOPY_FUNC(void *__restrict dstv, const void *__restrict srcv, size_t n)
        for (i = 0; i < PREFETCH_LINES_AHEAD; i++) {
                __insn_prefetch(prefetch);
                prefetch += CHIP_L2_LINE_SIZE();
-               prefetch = (prefetch > src1_end) ? prefetch : src1;
+               prefetch = (prefetch < src1_end) ? prefetch : src1;
        }
 
        /* Copy bytes until dst is word-aligned. */
-       for (; (uintptr_t)dst1 & (sizeof(word_t) - 1); n--)
+       for (; (uintptr_t)dst1 & (sizeof(op_t) - 1); n--)
                ST1(dst1++, LD1(src1++));
 
        /* 8-byte pointer to destination memory. */
-       dst8 = (word_t *)dst1;
-
-       if (__builtin_expect((uintptr_t)src1 & (sizeof(word_t) - 1), 0)) {
-               /*
-                * Misaligned copy.  Copy 8 bytes at a time, but don't
-                * bother with other fanciness.
-                *
-                * TODO: Consider prefetching and using wh64 as well.
-                */
-
-               /* Create an aligned src8. */
-               const word_t *__restrict src8 =
-                       (const word_t *)((uintptr_t)src1 & -sizeof(word_t));
-               word_t b;
-
-               word_t a = LD8(src8++);
-               for (; n >= sizeof(word_t); n -= sizeof(word_t)) {
-                       b = LD8(src8++);
-                       a = __insn_dblalign(a, b, src1);
-                       ST8(dst8++, a);
-                       a = b;
+       dst8 = (op_t *)dst1;
+
+       if (__builtin_expect((uintptr_t)src1 & (sizeof(op_t) - 1), 0)) {
+               /* Unaligned copy. */
+
+               op_t  tmp0 = 0, tmp1 = 0, tmp2, tmp3;
+               const op_t *src8 = (const op_t *) ((uintptr_t)src1 &
+                                                  -sizeof(op_t));
+               const void *srci = (void *)src1;
+               int m;
+
+               m = (CHIP_L2_LINE_SIZE() << 2) -
+                       (((uintptr_t)dst8) & ((CHIP_L2_LINE_SIZE() << 2) - 1));
+               m = (n < m) ? n : m;
+               m /= sizeof(op_t);
+
+               /* Copy until 'dst' is cache-line-aligned. */
+               n -= (sizeof(op_t) * m);
+
+               switch (m % 4) {
+               case 0:
+                       if (__builtin_expect(!m, 0))
+                               goto _M0;
+                       tmp1 = LD8(src8++);
+                       tmp2 = LD8(src8++);
+                       goto _8B3;
+               case 2:
+                       m += 2;
+                       tmp3 = LD8(src8++);
+                       tmp0 = LD8(src8++);
+                       goto _8B1;
+               case 3:
+                       m += 1;
+                       tmp2 = LD8(src8++);
+                       tmp3 = LD8(src8++);
+                       goto _8B2;
+               case 1:
+                       m--;
+                       tmp0 = LD8(src8++);
+                       tmp1 = LD8(src8++);
+                       if (__builtin_expect(!m, 0))
+                               goto _8B0;
+               }
+
+               do {
+                       tmp2 = LD8(src8++);
+                       tmp0 =  __insn_dblalign(tmp0, tmp1, srci);
+                       ST8(dst8++, tmp0);
+_8B3:
+                       tmp3 = LD8(src8++);
+                       tmp1 = __insn_dblalign(tmp1, tmp2, srci);
+                       ST8(dst8++, tmp1);
+_8B2:
+                       tmp0 = LD8(src8++);
+                       tmp2 = __insn_dblalign(tmp2, tmp3, srci);
+                       ST8(dst8++, tmp2);
+_8B1:
+                       tmp1 = LD8(src8++);
+                       tmp3 = __insn_dblalign(tmp3, tmp0, srci);
+                       ST8(dst8++, tmp3);
+                       m -= 4;
+               } while (m);
+
+_8B0:
+               tmp0 = __insn_dblalign(tmp0, tmp1, srci);
+               ST8(dst8++, tmp0);
+               src8--;
+
+_M0:
+               if (__builtin_expect(n >= CHIP_L2_LINE_SIZE(), 0)) {
+                       op_t tmp4, tmp5, tmp6, tmp7, tmp8;
+
+                       prefetch = ((const char *)src8) +
+                               CHIP_L2_LINE_SIZE() * PREFETCH_LINES_AHEAD;
+
+                       for (tmp0 = LD8(src8++); n >= CHIP_L2_LINE_SIZE();
+                            n -= CHIP_L2_LINE_SIZE()) {
+                               /* Prefetch and advance to next line to
+                                  prefetch, but don't go past the end.  */
+                               __insn_prefetch(prefetch);
+
+                               /* Make sure prefetch got scheduled
+                                  earlier.  */
+                               __asm__ ("" : : : "memory");
+
+                               prefetch += CHIP_L2_LINE_SIZE();
+                               prefetch = (prefetch < src1_end) ? prefetch :
+                                       (const char *) src8;
+
+                               tmp1 = LD8(src8++);
+                               tmp2 = LD8(src8++);
+                               tmp3 = LD8(src8++);
+                               tmp4 = LD8(src8++);
+                               tmp5 = LD8(src8++);
+                               tmp6 = LD8(src8++);
+                               tmp7 = LD8(src8++);
+                               tmp8 = LD8(src8++);
+
+                               tmp0 = __insn_dblalign(tmp0, tmp1, srci);
+                               tmp1 = __insn_dblalign(tmp1, tmp2, srci);
+                               tmp2 = __insn_dblalign(tmp2, tmp3, srci);
+                               tmp3 = __insn_dblalign(tmp3, tmp4, srci);
+                               tmp4 = __insn_dblalign(tmp4, tmp5, srci);
+                               tmp5 = __insn_dblalign(tmp5, tmp6, srci);
+                               tmp6 = __insn_dblalign(tmp6, tmp7, srci);
+                               tmp7 = __insn_dblalign(tmp7, tmp8, srci);
+
+                               __insn_wh64(dst8);
+
+                               ST8(dst8++, tmp0);
+                               ST8(dst8++, tmp1);
+                               ST8(dst8++, tmp2);
+                               ST8(dst8++, tmp3);
+                               ST8(dst8++, tmp4);
+                               ST8(dst8++, tmp5);
+                               ST8(dst8++, tmp6);
+                               ST8(dst8++, tmp7);
+
+                               tmp0 = tmp8;
+                       }
+                       src8--;
+               }
+
+               /* Copy the rest 8-byte chunks. */
+               if (n >= sizeof(op_t)) {
+                       tmp0 = LD8(src8++);
+                       for (; n >= sizeof(op_t); n -= sizeof(op_t)) {
+                               tmp1 = LD8(src8++);
+                               tmp0 = __insn_dblalign(tmp0, tmp1, srci);
+                               ST8(dst8++, tmp0);
+                               tmp0 = tmp1;
+                       }
+                       src8--;
                }
 
                if (n == 0)
                        return RETVAL;
 
-               b = ((const char *)src8 <= src1_end) ? *src8 : 0;
+               tmp0 = LD8(src8++);
+               tmp1 = ((const char *)src8 <= src1_end)
+                       ? LD8((op_t *)src8) : 0;
+               final = __insn_dblalign(tmp0, tmp1, srci);
 
-               /*
-                * Final source bytes to write to trailing partial
-                * word, if any.
-                */
-               final = __insn_dblalign(a, b, src1);
        } else {
                /* Aligned copy. */
 
-               const word_t* __restrict src8 = (const word_t *)src1;
+               const op_t *__restrict src8 = (const op_t *)src1;
 
                /* src8 and dst8 are both word-aligned. */
                if (n >= CHIP_L2_LINE_SIZE()) {
                        /* Copy until 'dst' is cache-line-aligned. */
                        for (; (uintptr_t)dst8 & (CHIP_L2_LINE_SIZE() - 1);
-                            n -= sizeof(word_t))
+                            n -= sizeof(op_t))
                                ST8(dst8++, LD8(src8++));
 
                        for (; n >= CHIP_L2_LINE_SIZE(); ) {
-                               __insn_wh64(dst8);
+                               op_t tmp0, tmp1, tmp2, tmp3;
+                               op_t tmp4, tmp5, tmp6, tmp7;
 
                                /*
                                 * Prefetch and advance to next line
-                                * to prefetch, but don't go past the end
+                                * to prefetch, but don't go past the
+                                * end.
                                 */
                                __insn_prefetch(prefetch);
+
+                               /* Make sure prefetch got scheduled
+                                  earlier.  */
+                               __asm__ ("" : : : "memory");
+
                                prefetch += CHIP_L2_LINE_SIZE();
-                               prefetch = (prefetch > src1_end) ? prefetch :
+                               prefetch = (prefetch < src1_end) ? prefetch :
                                        (const char *)src8;
 
                                /*
-                                * Copy an entire cache line.  Manually
-                                * unrolled to avoid idiosyncracies of
-                                * compiler unrolling.
+                                * Do all the loads before wh64.  This
+                                * is necessary if [src8, src8+7] and
+                                * [dst8, dst8+7] share the same cache
+                                * line and dst8 <= src8, as can be
+                                * the case when called from memmove,
+                                * or with code tested on x86 whose
+                                * memcpy always works with forward
+                                * copies.
                                 */
-#define COPY_WORD(offset) ({ ST8(dst8+offset, LD8(src8+offset)); n -= 8; })
-                               COPY_WORD(0);
-                               COPY_WORD(1);
-                               COPY_WORD(2);
-                               COPY_WORD(3);
-                               COPY_WORD(4);
-                               COPY_WORD(5);
-                               COPY_WORD(6);
-                               COPY_WORD(7);
-#if CHIP_L2_LINE_SIZE() == 128
-                               COPY_WORD(8);
-                               COPY_WORD(9);
-                               COPY_WORD(10);
-                               COPY_WORD(11);
-                               COPY_WORD(12);
-                               COPY_WORD(13);
-                               COPY_WORD(14);
-                               COPY_WORD(15);
-#elif CHIP_L2_LINE_SIZE() != 64
-# error Fix code that assumes particular L2 cache line sizes
-#endif
+                               tmp0 = LD8(src8++);
+                               tmp1 = LD8(src8++);
+                               tmp2 = LD8(src8++);
+                               tmp3 = LD8(src8++);
+                               tmp4 = LD8(src8++);
+                               tmp5 = LD8(src8++);
+                               tmp6 = LD8(src8++);
+                               tmp7 = LD8(src8++);
+
+                               /* wh64 and wait for tmp7 load completion. */
+                               __asm__ ("move %0, %0; wh64 %1\n"
+                                        : : "r"(tmp7), "r"(dst8));
 
-                               dst8 += CHIP_L2_LINE_SIZE() / sizeof(word_t);
-                               src8 += CHIP_L2_LINE_SIZE() / sizeof(word_t);
+                               ST8(dst8++, tmp0);
+                               ST8(dst8++, tmp1);
+                               ST8(dst8++, tmp2);
+                               ST8(dst8++, tmp3);
+                               ST8(dst8++, tmp4);
+                               ST8(dst8++, tmp5);
+                               ST8(dst8++, tmp6);
+                               ST8(dst8++, tmp7);
+
+                               n -= CHIP_L2_LINE_SIZE();
                        }
+#if CHIP_L2_LINE_SIZE() != 64
+# error "Fix code that assumes particular L2 cache line size."
+#endif
                }
 
-               for (; n >= sizeof(word_t); n -= sizeof(word_t))
+               for (; n >= sizeof(op_t); n -= sizeof(op_t))
                        ST8(dst8++, LD8(src8++));
 
                if (__builtin_expect(n == 0, 1))
diff --git a/arch/tile/lib/memcpy_tile64.c b/arch/tile/lib/memcpy_tile64.c
deleted file mode 100644 (file)
index 3bc4b4e..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Copyright 2010 Tilera 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
- *   as published by the Free Software Foundation, version 2.
- *
- *   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, GOOD TITLE or
- *   NON INFRINGEMENT.  See the GNU General Public License for
- *   more details.
- */
-
-#include <linux/string.h>
-#include <linux/smp.h>
-#include <linux/module.h>
-#include <linux/uaccess.h>
-#include <asm/fixmap.h>
-#include <asm/kmap_types.h>
-#include <asm/tlbflush.h>
-#include <hv/hypervisor.h>
-#include <arch/chip.h>
-
-
-#if !CHIP_HAS_COHERENT_LOCAL_CACHE()
-
-/* Defined in memcpy.S */
-extern unsigned long __memcpy_asm(void *to, const void *from, unsigned long n);
-extern unsigned long __copy_to_user_inatomic_asm(
-       void __user *to, const void *from, unsigned long n);
-extern unsigned long __copy_from_user_inatomic_asm(
-       void *to, const void __user *from, unsigned long n);
-extern unsigned long __copy_from_user_zeroing_asm(
-       void *to, const void __user *from, unsigned long n);
-
-typedef unsigned long (*memcpy_t)(void *, const void *, unsigned long);
-
-/* Size above which to consider TLB games for performance */
-#define LARGE_COPY_CUTOFF 2048
-
-/* Communicate to the simulator what we are trying to do. */
-#define sim_allow_multiple_caching(b) \
-  __insn_mtspr(SPR_SIM_CONTROL, \
-   SIM_CONTROL_ALLOW_MULTIPLE_CACHING | ((b) << _SIM_CONTROL_OPERATOR_BITS))
-
-/*
- * Copy memory by briefly enabling incoherent cacheline-at-a-time mode.
- *
- * We set up our own source and destination PTEs that we fully control.
- * This is the only way to guarantee that we don't race with another
- * thread that is modifying the PTE; we can't afford to try the
- * copy_{to,from}_user() technique of catching the interrupt, since
- * we must run with interrupts disabled to avoid the risk of some
- * other code seeing the incoherent data in our cache.  (Recall that
- * our cache is indexed by PA, so even if the other code doesn't use
- * our kmap_atomic virtual addresses, they'll still hit in cache using
- * the normal VAs that aren't supposed to hit in cache.)
- */
-static void memcpy_multicache(void *dest, const void *source,
-                             pte_t dst_pte, pte_t src_pte, int len)
-{
-       int idx;
-       unsigned long flags, newsrc, newdst;
-       pmd_t *pmdp;
-       pte_t *ptep;
-       int type0, type1;
-       int cpu = get_cpu();
-
-       /*
-        * Disable interrupts so that we don't recurse into memcpy()
-        * in an interrupt handler, nor accidentally reference
-        * the PA of the source from an interrupt routine.  Also
-        * notify the simulator that we're playing games so we don't
-        * generate spurious coherency warnings.
-        */
-       local_irq_save(flags);
-       sim_allow_multiple_caching(1);
-
-       /* Set up the new dest mapping */
-       type0 = kmap_atomic_idx_push();
-       idx = FIX_KMAP_BEGIN + (KM_TYPE_NR * cpu) + type0;
-       newdst = __fix_to_virt(idx) + ((unsigned long)dest & (PAGE_SIZE-1));
-       pmdp = pmd_offset(pud_offset(pgd_offset_k(newdst), newdst), newdst);
-       ptep = pte_offset_kernel(pmdp, newdst);
-       if (pte_val(*ptep) != pte_val(dst_pte)) {
-               set_pte(ptep, dst_pte);
-               local_flush_tlb_page(NULL, newdst, PAGE_SIZE);
-       }
-
-       /* Set up the new source mapping */
-       type1 = kmap_atomic_idx_push();
-       idx += (type0 - type1);
-       src_pte = hv_pte_set_nc(src_pte);
-       src_pte = hv_pte_clear_writable(src_pte);  /* be paranoid */
-       newsrc = __fix_to_virt(idx) + ((unsigned long)source & (PAGE_SIZE-1));
-       pmdp = pmd_offset(pud_offset(pgd_offset_k(newsrc), newsrc), newsrc);
-       ptep = pte_offset_kernel(pmdp, newsrc);
-       __set_pte(ptep, src_pte);   /* set_pte() would be confused by this */
-       local_flush_tlb_page(NULL, newsrc, PAGE_SIZE);
-
-       /* Actually move the data. */
-       __memcpy_asm((void *)newdst, (const void *)newsrc, len);
-
-       /*
-        * Remap the source as locally-cached and not OLOC'ed so that
-        * we can inval without also invaling the remote cpu's cache.
-        * This also avoids known errata with inv'ing cacheable oloc data.
-        */
-       src_pte = hv_pte_set_mode(src_pte, HV_PTE_MODE_CACHE_NO_L3);
-       src_pte = hv_pte_set_writable(src_pte); /* need write access for inv */
-       __set_pte(ptep, src_pte);   /* set_pte() would be confused by this */
-       local_flush_tlb_page(NULL, newsrc, PAGE_SIZE);
-
-       /*
-        * Do the actual invalidation, covering the full L2 cache line
-        * at the end since __memcpy_asm() is somewhat aggressive.
-        */
-       __inv_buffer((void *)newsrc, len);
-
-       /*
-        * We're done: notify the simulator that all is back to normal,
-        * and re-enable interrupts and pre-emption.
-        */
-       kmap_atomic_idx_pop();
-       kmap_atomic_idx_pop();
-       sim_allow_multiple_caching(0);
-       local_irq_restore(flags);
-       put_cpu();
-}
-
-/*
- * Identify large copies from remotely-cached memory, and copy them
- * via memcpy_multicache() if they look good, otherwise fall back
- * to the particular kind of copying passed as the memcpy_t function.
- */
-static unsigned long fast_copy(void *dest, const void *source, int len,
-                              memcpy_t func)
-{
-       /*
-        * Check if it's big enough to bother with.  We may end up doing a
-        * small copy via TLB manipulation if we're near a page boundary,
-        * but presumably we'll make it up when we hit the second page.
-        */
-       while (len >= LARGE_COPY_CUTOFF) {
-               int copy_size, bytes_left_on_page;
-               pte_t *src_ptep, *dst_ptep;
-               pte_t src_pte, dst_pte;
-               struct page *src_page, *dst_page;
-
-               /* Is the source page oloc'ed to a remote cpu? */
-retry_source:
-               src_ptep = virt_to_pte(current->mm, (unsigned long)source);
-               if (src_ptep == NULL)
-                       break;
-               src_pte = *src_ptep;
-               if (!hv_pte_get_present(src_pte) ||
-                   !hv_pte_get_readable(src_pte) ||
-                   hv_pte_get_mode(src_pte) != HV_PTE_MODE_CACHE_TILE_L3)
-                       break;
-               if (get_remote_cache_cpu(src_pte) == smp_processor_id())
-                       break;
-               src_page = pfn_to_page(pte_pfn(src_pte));
-               get_page(src_page);
-               if (pte_val(src_pte) != pte_val(*src_ptep)) {
-                       put_page(src_page);
-                       goto retry_source;
-               }
-               if (pte_huge(src_pte)) {
-                       /* Adjust the PTE to correspond to a small page */
-                       int pfn = pte_pfn(src_pte);
-                       pfn += (((unsigned long)source & (HPAGE_SIZE-1))
-                               >> PAGE_SHIFT);
-                       src_pte = pfn_pte(pfn, src_pte);
-                       src_pte = pte_mksmall(src_pte);
-               }
-
-               /* Is the destination page writable? */
-retry_dest:
-               dst_ptep = virt_to_pte(current->mm, (unsigned long)dest);
-               if (dst_ptep == NULL) {
-                       put_page(src_page);
-                       break;
-               }
-               dst_pte = *dst_ptep;
-               if (!hv_pte_get_present(dst_pte) ||
-                   !hv_pte_get_writable(dst_pte)) {
-                       put_page(src_page);
-                       break;
-               }
-               dst_page = pfn_to_page(pte_pfn(dst_pte));
-               if (dst_page == src_page) {
-                       /*
-                        * Source and dest are on the same page; this
-                        * potentially exposes us to incoherence if any
-                        * part of src and dest overlap on a cache line.
-                        * Just give up rather than trying to be precise.
-                        */
-                       put_page(src_page);
-                       break;
-               }
-               get_page(dst_page);
-               if (pte_val(dst_pte) != pte_val(*dst_ptep)) {
-                       put_page(dst_page);
-                       goto retry_dest;
-               }
-               if (pte_huge(dst_pte)) {
-                       /* Adjust the PTE to correspond to a small page */
-                       int pfn = pte_pfn(dst_pte);
-                       pfn += (((unsigned long)dest & (HPAGE_SIZE-1))
-                               >> PAGE_SHIFT);
-                       dst_pte = pfn_pte(pfn, dst_pte);
-                       dst_pte = pte_mksmall(dst_pte);
-               }
-
-               /* All looks good: create a cachable PTE and copy from it */
-               copy_size = len;
-               bytes_left_on_page =
-                       PAGE_SIZE - (((int)source) & (PAGE_SIZE-1));
-               if (copy_size > bytes_left_on_page)
-                       copy_size = bytes_left_on_page;
-               bytes_left_on_page =
-                       PAGE_SIZE - (((int)dest) & (PAGE_SIZE-1));
-               if (copy_size > bytes_left_on_page)
-                       copy_size = bytes_left_on_page;
-               memcpy_multicache(dest, source, dst_pte, src_pte, copy_size);
-
-               /* Release the pages */
-               put_page(dst_page);
-               put_page(src_page);
-
-               /* Continue on the next page */
-               dest += copy_size;
-               source += copy_size;
-               len -= copy_size;
-       }
-
-       return func(dest, source, len);
-}
-
-void *memcpy(void *to, const void *from, __kernel_size_t n)
-{
-       if (n < LARGE_COPY_CUTOFF)
-               return (void *)__memcpy_asm(to, from, n);
-       else
-               return (void *)fast_copy(to, from, n, __memcpy_asm);
-}
-
-unsigned long __copy_to_user_inatomic(void __user *to, const void *from,
-                                     unsigned long n)
-{
-       if (n < LARGE_COPY_CUTOFF)
-               return __copy_to_user_inatomic_asm(to, from, n);
-       else
-               return fast_copy(to, from, n, __copy_to_user_inatomic_asm);
-}
-
-unsigned long __copy_from_user_inatomic(void *to, const void __user *from,
-                                       unsigned long n)
-{
-       if (n < LARGE_COPY_CUTOFF)
-               return __copy_from_user_inatomic_asm(to, from, n);
-       else
-               return fast_copy(to, from, n, __copy_from_user_inatomic_asm);
-}
-
-unsigned long __copy_from_user_zeroing(void *to, const void __user *from,
-                                      unsigned long n)
-{
-       if (n < LARGE_COPY_CUTOFF)
-               return __copy_from_user_zeroing_asm(to, from, n);
-       else
-               return fast_copy(to, from, n, __copy_from_user_zeroing_asm);
-}
-
-#endif /* !CHIP_HAS_COHERENT_LOCAL_CACHE() */
index 37440ca..88c7016 100644 (file)
@@ -31,6 +31,7 @@
                    ".pushsection .coldtext.memcpy,\"ax\";"     \
                    "2: { move r0, %2; jrp lr };"               \
                    ".section __ex_table,\"a\";"                \
+                   ".align 8;"                                 \
                    ".quad 1b, 2b;"                             \
                    ".popsection"                               \
                    : "=m" (*(p)) : "r" (v), "r" (n));          \
@@ -43,6 +44,7 @@
                    ".pushsection .coldtext.memcpy,\"ax\";"     \
                    "2: { move r0, %2; jrp lr };"               \
                    ".section __ex_table,\"a\";"                \
+                   ".align 8;"                                 \
                    ".quad 1b, 2b;"                             \
                    ".popsection"                               \
                    : "=r" (__v) : "m" (*(p)), "r" (n));        \
index 57dbb3a..2042bfe 100644 (file)
  *   more details.
  */
 
-#include <arch/chip.h>
-
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/module.h>
-
-#undef memset
+#include <arch/chip.h>
 
 void *memset(void *s, int c, size_t n)
 {
@@ -26,11 +23,7 @@ void *memset(void *s, int c, size_t n)
        int n32;
        uint32_t v16, v32;
        uint8_t *out8 = s;
-#if !CHIP_HAS_WH64()
-       int ahead32;
-#else
        int to_align32;
-#endif
 
        /* Experimentation shows that a trivial tight loop is a win up until
         * around a size of 20, where writing a word at a time starts to win.
@@ -61,21 +54,6 @@ void *memset(void *s, int c, size_t n)
                return s;
        }
 
-#if !CHIP_HAS_WH64()
-       /* Use a spare issue slot to start prefetching the first cache
-        * line early. This instruction is free as the store can be buried
-        * in otherwise idle issue slots doing ALU ops.
-        */
-       __insn_prefetch(out8);
-
-       /* We prefetch the end so that a short memset that spans two cache
-        * lines gets some prefetching benefit. Again we believe this is free
-        * to issue.
-        */
-       __insn_prefetch(&out8[n - 1]);
-#endif /* !CHIP_HAS_WH64() */
-
-
        /* Align 'out8'. We know n >= 3 so this won't write past the end. */
        while (((uintptr_t) out8 & 3) != 0) {
                *out8++ = c;
@@ -96,90 +74,6 @@ void *memset(void *s, int c, size_t n)
        /* This must be at least 8 or the following loop doesn't work. */
 #define CACHE_LINE_SIZE_IN_WORDS (CHIP_L2_LINE_SIZE() / 4)
 
-#if !CHIP_HAS_WH64()
-
-       ahead32 = CACHE_LINE_SIZE_IN_WORDS;
-
-       /* We already prefetched the first and last cache lines, so
-        * we only need to do more prefetching if we are storing
-        * to more than two cache lines.
-        */
-       if (n32 > CACHE_LINE_SIZE_IN_WORDS * 2) {
-               int i;
-
-               /* Prefetch the next several cache lines.
-                * This is the setup code for the software-pipelined
-                * loop below.
-                */
-#define MAX_PREFETCH 5
-               ahead32 = n32 & -CACHE_LINE_SIZE_IN_WORDS;
-               if (ahead32 > MAX_PREFETCH * CACHE_LINE_SIZE_IN_WORDS)
-                       ahead32 = MAX_PREFETCH * CACHE_LINE_SIZE_IN_WORDS;
-
-               for (i = CACHE_LINE_SIZE_IN_WORDS;
-                    i < ahead32; i += CACHE_LINE_SIZE_IN_WORDS)
-                       __insn_prefetch(&out32[i]);
-       }
-
-       if (n32 > ahead32) {
-               while (1) {
-                       int j;
-
-                       /* Prefetch by reading one word several cache lines
-                        * ahead.  Since loads are non-blocking this will
-                        * cause the full cache line to be read while we are
-                        * finishing earlier cache lines.  Using a store
-                        * here causes microarchitectural performance
-                        * problems where a victimizing store miss goes to
-                        * the head of the retry FIFO and locks the pipe for
-                        * a few cycles.  So a few subsequent stores in this
-                        * loop go into the retry FIFO, and then later
-                        * stores see other stores to the same cache line
-                        * are already in the retry FIFO and themselves go
-                        * into the retry FIFO, filling it up and grinding
-                        * to a halt waiting for the original miss to be
-                        * satisfied.
-                        */
-                       __insn_prefetch(&out32[ahead32]);
-
-#if CACHE_LINE_SIZE_IN_WORDS % 4 != 0
-#error "Unhandled CACHE_LINE_SIZE_IN_WORDS"
-#endif
-
-                       n32 -= CACHE_LINE_SIZE_IN_WORDS;
-
-                       /* Save icache space by only partially unrolling
-                        * this loop.
-                        */
-                       for (j = CACHE_LINE_SIZE_IN_WORDS / 4; j > 0; j--) {
-                               *out32++ = v32;
-                               *out32++ = v32;
-                               *out32++ = v32;
-                               *out32++ = v32;
-                       }
-
-                       /* To save compiled code size, reuse this loop even
-                        * when we run out of prefetching to do by dropping
-                        * ahead32 down.
-                        */
-                       if (n32 <= ahead32) {
-                               /* Not even a full cache line left,
-                                * so stop now.
-                                */
-                               if (n32 < CACHE_LINE_SIZE_IN_WORDS)
-                                       break;
-
-                               /* Choose a small enough value that we don't
-                                * prefetch past the end.  There's no sense
-                                * in touching cache lines we don't have to.
-                                */
-                               ahead32 = CACHE_LINE_SIZE_IN_WORDS - 1;
-                       }
-               }
-       }
-
-#else /* CHIP_HAS_WH64() */
-
        /* Determine how many words we need to emit before the 'out32'
         * pointer becomes aligned modulo the cache line size.
         */
@@ -236,8 +130,6 @@ void *memset(void *s, int c, size_t n)
                n32 &= CACHE_LINE_SIZE_IN_WORDS - 1;
        }
 
-#endif /* CHIP_HAS_WH64() */
-
        /* Now handle any leftover values. */
        if (n32 != 0) {
                do {
index 3873085..03ef69c 100644 (file)
  *   more details.
  */
 
-#include <arch/chip.h>
-
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/module.h>
-
-#undef memset
+#include <arch/chip.h>
+#include "string-endian.h"
 
 void *memset(void *s, int c, size_t n)
 {
@@ -70,8 +68,7 @@ void *memset(void *s, int c, size_t n)
        n64 = n >> 3;
 
        /* Tile input byte out to 64 bits. */
-       /* KLUDGE */
-       v64 = 0x0101010101010101ULL * (uint8_t)c;
+       v64 = copy_byte(c);
 
        /* This must be at least 8 or the following loop doesn't work. */
 #define CACHE_LINE_SIZE_IN_DOUBLEWORDS (CHIP_L2_LINE_SIZE() / 8)
index c94e6f7..841fe69 100644 (file)
@@ -16,8 +16,6 @@
 #include <linux/string.h>
 #include <linux/module.h>
 
-#undef strchr
-
 char *strchr(const char *s, int c)
 {
        int z, g;
index f39f9dc..fe6e31c 100644 (file)
@@ -26,7 +26,7 @@ char *strchr(const char *s, int c)
        const uint64_t *p = (const uint64_t *)(s_int & -8);
 
        /* Create eight copies of the byte for which we are looking. */
-       const uint64_t goal = 0x0101010101010101ULL * (uint8_t) c;
+       const uint64_t goal = copy_byte(c);
 
        /* Read the first aligned word, but force bytes before the string to
         * match neither zero nor goal (we make sure the high bit of each
index c0eed7c..2e49cbf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 Tilera Corporation. All Rights Reserved.
+ * Copyright 2013 Tilera 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
 #define CFZ(x) __insn_clz(x)
 #define REVCZ(x) __insn_ctz(x)
 #endif
+
+/*
+ * Create eight copies of the byte in a uint64_t.  Byte Shuffle uses
+ * the bytes of srcB as the index into the dest vector to select a
+ * byte.  With all indices of zero, the first byte is copied into all
+ * the other bytes.
+ */
+static inline uint64_t copy_byte(uint8_t byte)
+{
+       return __insn_shufflebytes(byte, 0, 0);
+}
index 4974292..f26f88e 100644 (file)
@@ -16,8 +16,6 @@
 #include <linux/string.h>
 #include <linux/module.h>
 
-#undef strlen
-
 size_t strlen(const char *s)
 {
        /* Get an aligned pointer. */
diff --git a/arch/tile/lib/strnlen_32.c b/arch/tile/lib/strnlen_32.c
new file mode 100644 (file)
index 0000000..1434141
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/module.h>
+
+size_t strnlen(const char *s, size_t count)
+{
+       /* Get an aligned pointer. */
+       const uintptr_t s_int = (uintptr_t) s;
+       const uint32_t *p = (const uint32_t *)(s_int & -4);
+       size_t bytes_read = sizeof(*p) - (s_int & (sizeof(*p) - 1));
+       size_t len;
+       uint32_t v, bits;
+
+       /* Avoid page fault risk by not reading any bytes when count is 0. */
+       if (count == 0)
+               return 0;
+
+       /* Read first word, but force bytes before the string to be nonzero. */
+       v = *p | ((1 << ((s_int << 3) & 31)) - 1);
+
+       while ((bits = __insn_seqb(v, 0)) == 0) {
+               if (bytes_read >= count) {
+                       /* Read COUNT bytes and didn't find the terminator. */
+                       return count;
+               }
+               v = *++p;
+               bytes_read += sizeof(v);
+       }
+
+       len = ((const char *) p) + (__insn_ctz(bits) >> 3) - s;
+       return (len < count ? len : count);
+}
+EXPORT_SYMBOL(strnlen);
diff --git a/arch/tile/lib/strnlen_64.c b/arch/tile/lib/strnlen_64.c
new file mode 100644 (file)
index 0000000..2e8de6a
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ */
+
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/module.h>
+#include "string-endian.h"
+
+size_t strnlen(const char *s, size_t count)
+{
+       /* Get an aligned pointer. */
+       const uintptr_t s_int = (uintptr_t) s;
+       const uint64_t *p = (const uint64_t *)(s_int & -8);
+       size_t bytes_read = sizeof(*p) - (s_int & (sizeof(*p) - 1));
+       size_t len;
+       uint64_t v, bits;
+
+       /* Avoid page fault risk by not reading any bytes when count is 0. */
+       if (count == 0)
+               return 0;
+
+       /* Read and MASK the first word. */
+       v = *p | MASK(s_int);
+
+       while ((bits = __insn_v1cmpeqi(v, 0)) == 0) {
+               if (bytes_read >= count) {
+                       /* Read COUNT bytes and didn't find the terminator. */
+                       return count;
+               }
+               v = *++p;
+               bytes_read += sizeof(v);
+       }
+
+       len = ((const char *) p) + (CFZ(bits) >> 3) - s;
+       return (len < count ? len : count);
+}
+EXPORT_SYMBOL(strnlen);
index b62d002..1bc1622 100644 (file)
@@ -36,6 +36,7 @@ strnlen_user_fault:
        { move r0, zero; jrp lr }
        ENDPROC(strnlen_user_fault)
        .section __ex_table,"a"
+       .align 4
        .word 1b, strnlen_user_fault
        .popsection
 
@@ -47,18 +48,20 @@ strnlen_user_fault:
  */
 STD_ENTRY(strncpy_from_user_asm)
        { bz r2, 2f; move r3, r0 }
-1:      { lb_u r4, r1; addi r1, r1, 1; addi r2, r2, -1 }
+1:     { lb_u r4, r1; addi r1, r1, 1; addi r2, r2, -1 }
        { sb r0, r4; addi r0, r0, 1 }
-       bz r2, 2f
-       bnzt r4, 1b
-       addi r0, r0, -1   /* don't count the trailing NUL */
-2:      { sub r0, r0, r3; jrp lr }
+       bz r4, 2f
+       bnzt r2, 1b
+       { sub r0, r0, r3; jrp lr }
+2:     addi r0, r0, -1   /* don't count the trailing NUL */
+       { sub r0, r0, r3; jrp lr }
        STD_ENDPROC(strncpy_from_user_asm)
        .pushsection .fixup,"ax"
 strncpy_from_user_fault:
        { movei r0, -EFAULT; jrp lr }
        ENDPROC(strncpy_from_user_fault)
        .section __ex_table,"a"
+       .align 4
        .word 1b, strncpy_from_user_fault
        .popsection
 
@@ -77,6 +80,7 @@ STD_ENTRY(clear_user_asm)
        bnzt r1, 1b
 2:      { move r0, r1; jrp lr }
        .pushsection __ex_table,"a"
+       .align 4
        .word 1b, 2b
        .popsection
 
@@ -86,6 +90,7 @@ STD_ENTRY(clear_user_asm)
 2:      { move r0, r1; jrp lr }
        STD_ENDPROC(clear_user_asm)
        .pushsection __ex_table,"a"
+       .align 4
        .word 1b, 2b
        .popsection
 
@@ -105,25 +110,7 @@ STD_ENTRY(flush_user_asm)
 2:      { move r0, r1; jrp lr }
        STD_ENDPROC(flush_user_asm)
        .pushsection __ex_table,"a"
-       .word 1b, 2b
-       .popsection
-
-/*
- * inv_user_asm takes the user target address in r0 and the
- * number of bytes to invalidate in r1.
- * It returns the number of not inv'able bytes (hopefully zero) in r0.
- */
-STD_ENTRY(inv_user_asm)
-       bz r1, 2f
-       { movei r2, L2_CACHE_BYTES; add r1, r0, r1 }
-       { sub r2, zero, r2; addi r1, r1, L2_CACHE_BYTES-1 }
-       { and r0, r0, r2; and r1, r1, r2 }
-       { sub r1, r1, r0 }
-1:      { inv r0; addi r1, r1, -CHIP_INV_STRIDE() }
-       { addi r0, r0, CHIP_INV_STRIDE(); bnzt r1, 1b }
-2:      { move r0, r1; jrp lr }
-       STD_ENDPROC(inv_user_asm)
-       .pushsection __ex_table,"a"
+       .align 4
        .word 1b, 2b
        .popsection
 
@@ -143,5 +130,6 @@ STD_ENTRY(finv_user_asm)
 2:      { move r0, r1; jrp lr }
        STD_ENDPROC(finv_user_asm)
        .pushsection __ex_table,"a"
+       .align 4
        .word 1b, 2b
        .popsection
index adb2dbb..b3b31a3 100644 (file)
@@ -36,6 +36,7 @@ strnlen_user_fault:
        { move r0, zero; jrp lr }
        ENDPROC(strnlen_user_fault)
        .section __ex_table,"a"
+       .align 8
        .quad 1b, strnlen_user_fault
        .popsection
 
@@ -47,18 +48,20 @@ strnlen_user_fault:
  */
 STD_ENTRY(strncpy_from_user_asm)
        { beqz r2, 2f; move r3, r0 }
-1:      { ld1u r4, r1; addi r1, r1, 1; addi r2, r2, -1 }
+1:     { ld1u r4, r1; addi r1, r1, 1; addi r2, r2, -1 }
        { st1 r0, r4; addi r0, r0, 1 }
-       beqz r2, 2f
-       bnezt r4, 1b
-       addi r0, r0, -1   /* don't count the trailing NUL */
-2:      { sub r0, r0, r3; jrp lr }
+       beqz r4, 2f
+       bnezt r2, 1b
+       { sub r0, r0, r3; jrp lr }
+2:     addi r0, r0, -1   /* don't count the trailing NUL */
+       { sub r0, r0, r3; jrp lr }
        STD_ENDPROC(strncpy_from_user_asm)
        .pushsection .fixup,"ax"
 strncpy_from_user_fault:
        { movei r0, -EFAULT; jrp lr }
        ENDPROC(strncpy_from_user_fault)
        .section __ex_table,"a"
+       .align 8
        .quad 1b, strncpy_from_user_fault
        .popsection
 
@@ -77,6 +80,7 @@ STD_ENTRY(clear_user_asm)
        bnezt r1, 1b
 2:      { move r0, r1; jrp lr }
        .pushsection __ex_table,"a"
+       .align 8
        .quad 1b, 2b
        .popsection
 
@@ -86,6 +90,7 @@ STD_ENTRY(clear_user_asm)
 2:      { move r0, r1; jrp lr }
        STD_ENDPROC(clear_user_asm)
        .pushsection __ex_table,"a"
+       .align 8
        .quad 1b, 2b
        .popsection
 
@@ -105,25 +110,7 @@ STD_ENTRY(flush_user_asm)
 2:      { move r0, r1; jrp lr }
        STD_ENDPROC(flush_user_asm)
        .pushsection __ex_table,"a"
-       .quad 1b, 2b
-       .popsection
-
-/*
- * inv_user_asm takes the user target address in r0 and the
- * number of bytes to invalidate in r1.
- * It returns the number of not inv'able bytes (hopefully zero) in r0.
- */
-STD_ENTRY(inv_user_asm)
-       beqz r1, 2f
-       { movei r2, L2_CACHE_BYTES; add r1, r0, r1 }
-       { sub r2, zero, r2; addi r1, r1, L2_CACHE_BYTES-1 }
-       { and r0, r0, r2; and r1, r1, r2 }
-       { sub r1, r1, r0 }
-1:      { inv r0; addi r1, r1, -CHIP_INV_STRIDE() }
-       { addi r0, r0, CHIP_INV_STRIDE(); bnezt r1, 1b }
-2:      { move r0, r1; jrp lr }
-       STD_ENDPROC(inv_user_asm)
-       .pushsection __ex_table,"a"
+       .align 8
        .quad 1b, 2b
        .popsection
 
@@ -143,5 +130,6 @@ STD_ENTRY(finv_user_asm)
 2:      { move r0, r1; jrp lr }
        STD_ENDPROC(finv_user_asm)
        .pushsection __ex_table,"a"
+       .align 8
        .quad 1b, 2b
        .popsection
index 743c951..23f044e 100644 (file)
@@ -21,7 +21,8 @@
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/sections.h>
-#include <arch/sim_def.h>
+#include <asm/vdso.h>
+#include <arch/sim.h>
 
 /* Notify a running simulator, if any, that an exec just occurred. */
 static void sim_notify_exec(const char *binary_name)
@@ -38,21 +39,55 @@ static void sim_notify_exec(const char *binary_name)
 
 static int notify_exec(struct mm_struct *mm)
 {
-       int retval = 0;  /* failure */
-
-       if (mm->exe_file) {
-               char *buf = (char *) __get_free_page(GFP_KERNEL);
-               if (buf) {
-                       char *path = d_path(&mm->exe_file->f_path,
-                                           buf, PAGE_SIZE);
-                       if (!IS_ERR(path)) {
-                               sim_notify_exec(path);
-                               retval = 1;
-                       }
-                       free_page((unsigned long)buf);
+       char *buf, *path;
+       struct vm_area_struct *vma;
+
+       if (!sim_is_simulator())
+               return 1;
+
+       if (mm->exe_file == NULL)
+               return 0;
+
+       for (vma = current->mm->mmap; ; vma = vma->vm_next) {
+               if (vma == NULL)
+                       return 0;
+               if (vma->vm_file == mm->exe_file)
+                       break;
+       }
+
+       buf = (char *) __get_free_page(GFP_KERNEL);
+       if (buf == NULL)
+               return 0;
+
+       path = d_path(&mm->exe_file->f_path, buf, PAGE_SIZE);
+       if (IS_ERR(path)) {
+               free_page((unsigned long)buf);
+               return 0;
+       }
+
+       /*
+        * Notify simulator of an ET_DYN object so we know the load address.
+        * The somewhat cryptic overuse of SIM_CONTROL_DLOPEN allows us
+        * to be backward-compatible with older simulator releases.
+        */
+       if (vma->vm_start == (ELF_ET_DYN_BASE & PAGE_MASK)) {
+               char buf[64];
+               int i;
+
+               snprintf(buf, sizeof(buf), "0x%lx:@", vma->vm_start);
+               for (i = 0; ; ++i) {
+                       char c = buf[i];
+                       __insn_mtspr(SPR_SIM_CONTROL,
+                                    (SIM_CONTROL_DLOPEN
+                                     | (c << _SIM_CONTROL_OPERATOR_BITS)));
+                       if (c == '\0')
+                               break;
                }
        }
-       return retval;
+
+       sim_notify_exec(path);
+       free_page((unsigned long)buf);
+       return 1;
 }
 
 /* Notify a running simulator, if any, that we loaded an interpreter. */
@@ -68,37 +103,10 @@ static void sim_notify_interp(unsigned long load_addr)
 }
 
 
-/* Kernel address of page used to map read-only kernel data into userspace. */
-static void *vdso_page;
-
-/* One-entry array used for install_special_mapping. */
-static struct page *vdso_pages[1];
-
-static int __init vdso_setup(void)
-{
-       vdso_page = (void *)get_zeroed_page(GFP_ATOMIC);
-       memcpy(vdso_page, __rt_sigreturn, __rt_sigreturn_end - __rt_sigreturn);
-       vdso_pages[0] = virt_to_page(vdso_page);
-       return 0;
-}
-device_initcall(vdso_setup);
-
-const char *arch_vma_name(struct vm_area_struct *vma)
-{
-       if (vma->vm_private_data == vdso_pages)
-               return "[vdso]";
-#ifndef __tilegx__
-       if (vma->vm_start == MEM_USER_INTRPT)
-               return "[intrpt]";
-#endif
-       return NULL;
-}
-
 int arch_setup_additional_pages(struct linux_binprm *bprm,
                                int executable_stack)
 {
        struct mm_struct *mm = current->mm;
-       unsigned long vdso_base;
        int retval = 0;
 
        down_write(&mm->mmap_sem);
@@ -111,14 +119,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
        if (!notify_exec(mm))
                sim_notify_exec(bprm->filename);
 
-       /*
-        * MAYWRITE to allow gdb to COW and set breakpoints
-        */
-       vdso_base = VDSO_BASE;
-       retval = install_special_mapping(mm, vdso_base, PAGE_SIZE,
-                                        VM_READ|VM_EXEC|
-                                        VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
-                                        vdso_pages);
+       retval = setup_vdso_pages();
 
 #ifndef __tilegx__
        /*
index f7f99f9..111d5a9 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/hugetlb.h>
 #include <linux/syscalls.h>
 #include <linux/uaccess.h>
+#include <linux/kdebug.h>
 
 #include <asm/pgalloc.h>
 #include <asm/sections.h>
@@ -122,10 +123,9 @@ static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
        pmd_k = pmd_offset(pud_k, address);
        if (!pmd_present(*pmd_k))
                return NULL;
-       if (!pmd_present(*pmd)) {
+       if (!pmd_present(*pmd))
                set_pmd(pmd, *pmd_k);
-               arch_flush_lazy_mmu_mode();
-       } else
+       else
                BUG_ON(pmd_ptfn(*pmd) != pmd_ptfn(*pmd_k));
        return pmd_k;
 }
@@ -283,7 +283,7 @@ static int handle_page_fault(struct pt_regs *regs,
        flags = (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
                 (write ? FAULT_FLAG_WRITE : 0));
 
-       is_kernel_mode = (EX1_PL(regs->ex1) != USER_PL);
+       is_kernel_mode = !user_mode(regs);
 
        tsk = validate_current();
 
@@ -466,28 +466,15 @@ good_area:
                }
        }
 
-#if CHIP_HAS_TILE_DMA() || CHIP_HAS_SN_PROC()
-       /*
-        * If this was an asynchronous fault,
-        * restart the appropriate engine.
-        */
-       switch (fault_num) {
 #if CHIP_HAS_TILE_DMA()
+       /* If this was a DMA TLB fault, restart the DMA engine. */
+       switch (fault_num) {
        case INT_DMATLB_MISS:
        case INT_DMATLB_MISS_DWNCL:
        case INT_DMATLB_ACCESS:
        case INT_DMATLB_ACCESS_DWNCL:
                __insn_mtspr(SPR_DMA_CTR, SPR_DMA_CTR__REQUEST_MASK);
                break;
-#endif
-#if CHIP_HAS_SN_PROC()
-       case INT_SNITLB_MISS:
-       case INT_SNITLB_MISS_DWNCL:
-               __insn_mtspr(SPR_SNCTL,
-                            __insn_mfspr(SPR_SNCTL) &
-                            ~SPR_SNCTL__FRZPROC_MASK);
-               break;
-#endif
        }
 #endif
 
@@ -722,8 +709,60 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
 {
        int is_page_fault;
 
+#ifdef CONFIG_KPROBES
+       /*
+        * This is to notify the fault handler of the kprobes.  The
+        * exception code is redundant as it is also carried in REGS,
+        * but we pass it anyhow.
+        */
+       if (notify_die(DIE_PAGE_FAULT, "page fault", regs, -1,
+                      regs->faultnum, SIGSEGV) == NOTIFY_STOP)
+               return;
+#endif
+
+#ifdef __tilegx__
+       /*
+        * We don't need early do_page_fault_ics() support, since unlike
+        * Pro we don't need to worry about unlocking the atomic locks.
+        * There is only one current case in GX where we touch any memory
+        * under ICS other than our own kernel stack, and we handle that
+        * here.  (If we crash due to trying to touch our own stack,
+        * we're in too much trouble for C code to help out anyway.)
+        */
+       if (write & ~1) {
+               unsigned long pc = write & ~1;
+               if (pc >= (unsigned long) __start_unalign_asm_code &&
+                   pc < (unsigned long) __end_unalign_asm_code) {
+                       struct thread_info *ti = current_thread_info();
+                       /*
+                        * Our EX_CONTEXT is still what it was from the
+                        * initial unalign exception, but now we've faulted
+                        * on the JIT page.  We would like to complete the
+                        * page fault however is appropriate, and then retry
+                        * the instruction that caused the unalign exception.
+                        * Our state has been "corrupted" by setting the low
+                        * bit in "sp", and stashing r0..r3 in the
+                        * thread_info area, so we revert all of that, then
+                        * continue as if this were a normal page fault.
+                        */
+                       regs->sp &= ~1UL;
+                       regs->regs[0] = ti->unalign_jit_tmp[0];
+                       regs->regs[1] = ti->unalign_jit_tmp[1];
+                       regs->regs[2] = ti->unalign_jit_tmp[2];
+                       regs->regs[3] = ti->unalign_jit_tmp[3];
+                       write &= 1;
+               } else {
+                       pr_alert("%s/%d: ICS set at page fault at %#lx: %#lx\n",
+                                current->comm, current->pid, pc, address);
+                       show_regs(regs);
+                       do_group_exit(SIGKILL);
+                       return;
+               }
+       }
+#else
        /* This case should have been handled by do_page_fault_ics(). */
        BUG_ON(write & ~1);
+#endif
 
 #if CHIP_HAS_TILE_DMA()
        /*
@@ -752,10 +791,6 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
        case INT_DMATLB_MISS:
        case INT_DMATLB_MISS_DWNCL:
 #endif
-#if CHIP_HAS_SN_PROC()
-       case INT_SNITLB_MISS:
-       case INT_SNITLB_MISS_DWNCL:
-#endif
                is_page_fault = 1;
                break;
 
@@ -771,8 +806,8 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
                panic("Bad fault number %d in do_page_fault", fault_num);
        }
 
-#if CHIP_HAS_TILE_DMA() || CHIP_HAS_SN_PROC()
-       if (EX1_PL(regs->ex1) != USER_PL) {
+#if CHIP_HAS_TILE_DMA()
+       if (!user_mode(regs)) {
                struct async_tlb *async;
                switch (fault_num) {
 #if CHIP_HAS_TILE_DMA()
@@ -783,12 +818,6 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
                        async = &current->thread.dma_async_tlb;
                        break;
 #endif
-#if CHIP_HAS_SN_PROC()
-               case INT_SNITLB_MISS:
-               case INT_SNITLB_MISS_DWNCL:
-                       async = &current->thread.sn_async_tlb;
-                       break;
-#endif
                default:
                        async = NULL;
                }
@@ -821,14 +850,22 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
 }
 
 
-#if CHIP_HAS_TILE_DMA() || CHIP_HAS_SN_PROC()
+#if CHIP_HAS_TILE_DMA()
 /*
- * Check an async_tlb structure to see if a deferred fault is waiting,
- * and if so pass it to the page-fault code.
+ * This routine effectively re-issues asynchronous page faults
+ * when we are returning to user space.
  */
-static void handle_async_page_fault(struct pt_regs *regs,
-                                   struct async_tlb *async)
+void do_async_page_fault(struct pt_regs *regs)
 {
+       struct async_tlb *async = &current->thread.dma_async_tlb;
+
+       /*
+        * Clear thread flag early.  If we re-interrupt while processing
+        * code here, we will reset it and recall this routine before
+        * returning to user space.
+        */
+       clear_thread_flag(TIF_ASYNC_TLB);
+
        if (async->fault_num) {
                /*
                 * Clear async->fault_num before calling the page-fault
@@ -842,35 +879,15 @@ static void handle_async_page_fault(struct pt_regs *regs,
                                  async->address, async->is_write);
        }
 }
-
-/*
- * This routine effectively re-issues asynchronous page faults
- * when we are returning to user space.
- */
-void do_async_page_fault(struct pt_regs *regs)
-{
-       /*
-        * Clear thread flag early.  If we re-interrupt while processing
-        * code here, we will reset it and recall this routine before
-        * returning to user space.
-        */
-       clear_thread_flag(TIF_ASYNC_TLB);
-
-#if CHIP_HAS_TILE_DMA()
-       handle_async_page_fault(regs, &current->thread.dma_async_tlb);
-#endif
-#if CHIP_HAS_SN_PROC()
-       handle_async_page_fault(regs, &current->thread.sn_async_tlb);
-#endif
-}
-#endif /* CHIP_HAS_TILE_DMA() || CHIP_HAS_SN_PROC() */
+#endif /* CHIP_HAS_TILE_DMA() */
 
 
 void vmalloc_sync_all(void)
 {
 #ifdef __tilegx__
        /* Currently all L1 kernel pmd's are static and shared. */
-       BUG_ON(pgd_index(VMALLOC_END) != pgd_index(VMALLOC_START));
+       BUILD_BUG_ON(pgd_index(VMALLOC_END - PAGE_SIZE) !=
+                    pgd_index(VMALLOC_START));
 #else
        /*
         * Note that races in the updates of insync and start aren't
index 347d123..0dc2182 100644 (file)
@@ -114,7 +114,6 @@ static void kmap_atomic_register(struct page *page, int type,
 
        list_add(&amp->list, &amp_list);
        set_pte(ptep, pteval);
-       arch_flush_lazy_mmu_mode();
 
        spin_unlock(&amp_lock);
        homecache_kpte_unlock(flags);
@@ -259,7 +258,6 @@ void __kunmap_atomic(void *kvaddr)
                BUG_ON(vaddr >= (unsigned long)high_memory);
        }
 
-       arch_flush_lazy_mmu_mode();
        pagefault_enable();
 }
 EXPORT_SYMBOL(__kunmap_atomic);
index 1ae9119..004ba56 100644 (file)
 #include "migrate.h"
 
 
-#if CHIP_HAS_COHERENT_LOCAL_CACHE()
-
 /*
  * The noallocl2 option suppresses all use of the L2 cache to cache
- * locally from a remote home.  There's no point in using it if we
- * don't have coherent local caching, though.
+ * locally from a remote home.
  */
 static int __write_once noallocl2;
 static int __init set_noallocl2(char *str)
@@ -58,12 +55,6 @@ static int __init set_noallocl2(char *str)
 }
 early_param("noallocl2", set_noallocl2);
 
-#else
-
-#define noallocl2 0
-
-#endif
-
 
 /*
  * Update the irq_stat for cpus that we are going to interrupt
@@ -172,7 +163,8 @@ void flush_remote(unsigned long cache_pfn, unsigned long cache_control,
 
 static void homecache_finv_page_va(void* va, int home)
 {
-       if (home == smp_processor_id()) {
+       int cpu = get_cpu();
+       if (home == cpu) {
                finv_buffer_local(va, PAGE_SIZE);
        } else if (home == PAGE_HOME_HASH) {
                finv_buffer_remote(va, PAGE_SIZE, 1);
@@ -180,6 +172,7 @@ static void homecache_finv_page_va(void* va, int home)
                BUG_ON(home < 0 || home >= NR_CPUS);
                finv_buffer_remote(va, PAGE_SIZE, 0);
        }
+       put_cpu();
 }
 
 void homecache_finv_map_page(struct page *page, int home)
@@ -198,7 +191,7 @@ void homecache_finv_map_page(struct page *page, int home)
 #else
        va = __fix_to_virt(FIX_HOMECACHE_BEGIN + smp_processor_id());
 #endif
-       ptep = virt_to_pte(NULL, (unsigned long)va);
+       ptep = virt_to_kpte(va);
        pte = pfn_pte(page_to_pfn(page), PAGE_KERNEL);
        __set_pte(ptep, pte_set_home(pte, home));
        homecache_finv_page_va((void *)va, home);
@@ -263,10 +256,8 @@ static int pte_to_home(pte_t pte)
                return PAGE_HOME_INCOHERENT;
        case HV_PTE_MODE_UNCACHED:
                return PAGE_HOME_UNCACHED;
-#if CHIP_HAS_CBOX_HOME_MAP()
        case HV_PTE_MODE_CACHE_HASH_L3:
                return PAGE_HOME_HASH;
-#endif
        }
        panic("Bad PTE %#llx\n", pte.val);
 }
@@ -323,20 +314,16 @@ pte_t pte_set_home(pte_t pte, int home)
                                                      HV_PTE_MODE_CACHE_NO_L3);
                        }
                } else
-#if CHIP_HAS_CBOX_HOME_MAP()
                if (hash_default)
                        pte = hv_pte_set_mode(pte, HV_PTE_MODE_CACHE_HASH_L3);
                else
-#endif
                        pte = hv_pte_set_mode(pte, HV_PTE_MODE_CACHE_NO_L3);
                pte = hv_pte_set_nc(pte);
                break;
 
-#if CHIP_HAS_CBOX_HOME_MAP()
        case PAGE_HOME_HASH:
                pte = hv_pte_set_mode(pte, HV_PTE_MODE_CACHE_HASH_L3);
                break;
-#endif
 
        default:
                BUG_ON(home < 0 || home >= NR_CPUS ||
@@ -346,7 +333,6 @@ pte_t pte_set_home(pte_t pte, int home)
                break;
        }
 
-#if CHIP_HAS_NC_AND_NOALLOC_BITS()
        if (noallocl2)
                pte = hv_pte_set_no_alloc_l2(pte);
 
@@ -355,7 +341,6 @@ pte_t pte_set_home(pte_t pte, int home)
            hv_pte_get_mode(pte) == HV_PTE_MODE_CACHE_NO_L3) {
                pte = hv_pte_set_mode(pte, HV_PTE_MODE_UNCACHED);
        }
-#endif
 
        /* Checking this case here gives a better panic than from the hv. */
        BUG_ON(hv_pte_get_mode(pte) == 0);
@@ -371,19 +356,13 @@ EXPORT_SYMBOL(pte_set_home);
  * so they're not suitable for anything but infrequent use.
  */
 
-#if CHIP_HAS_CBOX_HOME_MAP()
-static inline int initial_page_home(void) { return PAGE_HOME_HASH; }
-#else
-static inline int initial_page_home(void) { return 0; }
-#endif
-
 int page_home(struct page *page)
 {
        if (PageHighMem(page)) {
-               return initial_page_home();
+               return PAGE_HOME_HASH;
        } else {
                unsigned long kva = (unsigned long)page_address(page);
-               return pte_to_home(*virt_to_pte(NULL, kva));
+               return pte_to_home(*virt_to_kpte(kva));
        }
 }
 EXPORT_SYMBOL(page_home);
@@ -402,7 +381,7 @@ void homecache_change_page_home(struct page *page, int order, int home)
                     NULL, 0);
 
        for (i = 0; i < pages; ++i, kva += PAGE_SIZE) {
-               pte_t *ptep = virt_to_pte(NULL, kva);
+               pte_t *ptep = virt_to_kpte(kva);
                pte_t pteval = *ptep;
                BUG_ON(!pte_present(pteval) || pte_huge(pteval));
                __set_pte(ptep, pte_set_home(pteval, home));
@@ -436,7 +415,7 @@ struct page *homecache_alloc_pages_node(int nid, gfp_t gfp_mask,
 void __homecache_free_pages(struct page *page, unsigned int order)
 {
        if (put_page_testzero(page)) {
-               homecache_change_page_home(page, order, initial_page_home());
+               homecache_change_page_home(page, order, PAGE_HOME_HASH);
                if (order == 0) {
                        free_hot_cold_page(page, 0);
                } else {
index 650ccff..e514899 100644 (file)
@@ -49,38 +49,6 @@ int huge_shift[HUGE_SHIFT_ENTRIES] = {
 #endif
 };
 
-/*
- * This routine is a hybrid of pte_alloc_map() and pte_alloc_kernel().
- * It assumes that L2 PTEs are never in HIGHMEM (we don't support that).
- * It locks the user pagetable, and bumps up the mm->nr_ptes field,
- * but otherwise allocate the page table using the kernel versions.
- */
-static pte_t *pte_alloc_hugetlb(struct mm_struct *mm, pmd_t *pmd,
-                               unsigned long address)
-{
-       pte_t *new;
-
-       if (pmd_none(*pmd)) {
-               new = pte_alloc_one_kernel(mm, address);
-               if (!new)
-                       return NULL;
-
-               smp_wmb(); /* See comment in __pte_alloc */
-
-               spin_lock(&mm->page_table_lock);
-               if (likely(pmd_none(*pmd))) {  /* Has another populated it ? */
-                       mm->nr_ptes++;
-                       pmd_populate_kernel(mm, pmd, new);
-                       new = NULL;
-               } else
-                       VM_BUG_ON(pmd_trans_splitting(*pmd));
-               spin_unlock(&mm->page_table_lock);
-               if (new)
-                       pte_free_kernel(mm, new);
-       }
-
-       return pte_offset_kernel(pmd, address);
-}
 #endif
 
 pte_t *huge_pte_alloc(struct mm_struct *mm,
@@ -109,7 +77,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
                else {
                        if (sz != PAGE_SIZE << huge_shift[HUGE_SHIFT_PAGE])
                                panic("Unexpected page size %#lx\n", sz);
-                       return pte_alloc_hugetlb(mm, pmd, addr);
+                       return pte_alloc_map(mm, NULL, pmd, addr);
                }
        }
 #else
@@ -144,14 +112,14 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
 
        /* Get the top-level page table entry. */
        pgd = (pgd_t *)get_pte((pte_t *)mm->pgd, pgd_index(addr), 0);
-       if (!pgd_present(*pgd))
-               return NULL;
 
        /* We don't have four levels. */
        pud = pud_offset(pgd, addr);
 #ifndef __PAGETABLE_PUD_FOLDED
 # error support fourth page table level
 #endif
+       if (!pud_present(*pud))
+               return NULL;
 
        /* Check for an L0 huge PTE, if we have three levels. */
 #ifndef __PAGETABLE_PMD_FOLDED
index e182958..4e316de 100644 (file)
@@ -106,10 +106,8 @@ pte_t *get_prealloc_pte(unsigned long pfn)
  */
 static int initial_heap_home(void)
 {
-#if CHIP_HAS_CBOX_HOME_MAP()
        if (hash_default)
                return PAGE_HOME_HASH;
-#endif
        return smp_processor_id();
 }
 
@@ -190,14 +188,11 @@ static void __init page_table_range_init(unsigned long start,
 }
 
 
-#if CHIP_HAS_CBOX_HOME_MAP()
-
 static int __initdata ktext_hash = 1;  /* .text pages */
 static int __initdata kdata_hash = 1;  /* .data and .bss pages */
 int __write_once hash_default = 1;     /* kernel allocator pages */
 EXPORT_SYMBOL(hash_default);
 int __write_once kstack_hash = 1;      /* if no homecaching, use h4h */
-#endif /* CHIP_HAS_CBOX_HOME_MAP */
 
 /*
  * CPUs to use to for striping the pages of kernel data.  If hash-for-home
@@ -215,14 +210,12 @@ int __write_once kdata_huge;       /* if no homecaching, small pages */
 static pgprot_t __init construct_pgprot(pgprot_t prot, int home)
 {
        prot = pte_set_home(prot, home);
-#if CHIP_HAS_CBOX_HOME_MAP()
        if (home == PAGE_HOME_IMMUTABLE) {
                if (ktext_hash)
                        prot = hv_pte_set_mode(prot, HV_PTE_MODE_CACHE_HASH_L3);
                else
                        prot = hv_pte_set_mode(prot, HV_PTE_MODE_CACHE_NO_L3);
        }
-#endif
        return prot;
 }
 
@@ -234,22 +227,17 @@ static pgprot_t __init init_pgprot(ulong address)
 {
        int cpu;
        unsigned long page;
-       enum { CODE_DELTA = MEM_SV_INTRPT - PAGE_OFFSET };
+       enum { CODE_DELTA = MEM_SV_START - PAGE_OFFSET };
 
-#if CHIP_HAS_CBOX_HOME_MAP()
        /* For kdata=huge, everything is just hash-for-home. */
        if (kdata_huge)
                return construct_pgprot(PAGE_KERNEL, PAGE_HOME_HASH);
-#endif
 
        /* We map the aliased pages of permanent text inaccessible. */
        if (address < (ulong) _sinittext - CODE_DELTA)
                return PAGE_NONE;
 
-       /*
-        * We map read-only data non-coherent for performance.  We could
-        * use neighborhood caching on TILE64, but it's not clear it's a win.
-        */
+       /* We map read-only data non-coherent for performance. */
        if ((address >= (ulong) __start_rodata &&
             address < (ulong) __end_rodata) ||
            address == (ulong) empty_zero_page) {
@@ -257,12 +245,10 @@ static pgprot_t __init init_pgprot(ulong address)
        }
 
 #ifndef __tilegx__
-#if !ATOMIC_LOCKS_FOUND_VIA_TABLE()
        /* Force the atomic_locks[] array page to be hash-for-home. */
        if (address == (ulong) atomic_locks)
                return construct_pgprot(PAGE_KERNEL, PAGE_HOME_HASH);
 #endif
-#endif
 
        /*
         * Everything else that isn't data or bss is heap, so mark it
@@ -280,19 +266,9 @@ static pgprot_t __init init_pgprot(ulong address)
        if (address >= (ulong) _end || address < (ulong) _einitdata)
                return construct_pgprot(PAGE_KERNEL, initial_heap_home());
 
-#if CHIP_HAS_CBOX_HOME_MAP()
        /* Use hash-for-home if requested for data/bss. */
        if (kdata_hash)
                return construct_pgprot(PAGE_KERNEL, PAGE_HOME_HASH);
-#endif
-
-       /*
-        * Make the w1data homed like heap to start with, to avoid
-        * making it part of the page-striped data area when we're just
-        * going to convert it to read-only soon anyway.
-        */
-       if (address >= (ulong)__w1data_begin && address < (ulong)__w1data_end)
-               return construct_pgprot(PAGE_KERNEL, initial_heap_home());
 
        /*
         * Otherwise we just hand out consecutive cpus.  To avoid
@@ -301,7 +277,7 @@ static pgprot_t __init init_pgprot(ulong address)
         * the requested address, while walking cpu home around kdata_mask.
         * This is typically no more than a dozen or so iterations.
         */
-       page = (((ulong)__w1data_end) + PAGE_SIZE - 1) & PAGE_MASK;
+       page = (((ulong)__end_rodata) + PAGE_SIZE - 1) & PAGE_MASK;
        BUG_ON(address < page || address >= (ulong)_end);
        cpu = cpumask_first(&kdata_mask);
        for (; page < address; page += PAGE_SIZE) {
@@ -311,11 +287,9 @@ static pgprot_t __init init_pgprot(ulong address)
                if (page == (ulong)empty_zero_page)
                        continue;
 #ifndef __tilegx__
-#if !ATOMIC_LOCKS_FOUND_VIA_TABLE()
                if (page == (ulong)atomic_locks)
                        continue;
 #endif
-#endif
                cpu = cpumask_next(cpu, &kdata_mask);
                if (cpu == NR_CPUS)
                        cpu = cpumask_first(&kdata_mask);
@@ -358,7 +332,7 @@ static int __init setup_ktext(char *str)
 
        ktext_arg_seen = 1;
 
-       /* Default setting on Tile64: use a huge page */
+       /* Default setting: use a huge page */
        if (strcmp(str, "huge") == 0)
                pr_info("ktext: using one huge locally cached page\n");
 
@@ -404,10 +378,8 @@ static inline pgprot_t ktext_set_nocache(pgprot_t prot)
 {
        if (!ktext_nocache)
                prot = hv_pte_set_nc(prot);
-#if CHIP_HAS_NC_AND_NOALLOC_BITS()
        else
                prot = hv_pte_set_no_alloc_l2(prot);
-#endif
        return prot;
 }
 
@@ -440,7 +412,6 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
        struct cpumask kstripe_mask;
        int rc, i;
 
-#if CHIP_HAS_CBOX_HOME_MAP()
        if (ktext_arg_seen && ktext_hash) {
                pr_warning("warning: \"ktext\" boot argument ignored"
                           " if \"kcache_hash\" sets up text hash-for-home\n");
@@ -457,7 +428,6 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
                          " kcache_hash=all or =allbutstack\n");
                kdata_huge = 0;
        }
-#endif
 
        /*
         * Set up a mask for cpus to use for kernel striping.
@@ -538,7 +508,7 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
                }
        }
 
-       address = MEM_SV_INTRPT;
+       address = MEM_SV_START;
        pmd = get_pmd(pgtables, address);
        pfn = 0;  /* code starts at PA 0 */
        if (ktext_small) {
@@ -585,13 +555,11 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
        } else {
                pte_t pteval = pfn_pte(0, PAGE_KERNEL_EXEC);
                pteval = pte_mkhuge(pteval);
-#if CHIP_HAS_CBOX_HOME_MAP()
                if (ktext_hash) {
                        pteval = hv_pte_set_mode(pteval,
                                                 HV_PTE_MODE_CACHE_HASH_L3);
                        pteval = ktext_set_nocache(pteval);
                } else
-#endif /* CHIP_HAS_CBOX_HOME_MAP() */
                if (cpumask_weight(&ktext_mask) == 1) {
                        pteval = set_remote_cache_cpu(pteval,
                                              cpumask_first(&ktext_mask));
@@ -777,10 +745,7 @@ void __init paging_init(void)
 
        kernel_physical_mapping_init(pgd_base);
 
-       /*
-        * Fixed mappings, only the page table structure has to be
-        * created - mappings will be set by set_fixmap():
-        */
+       /* Fixed mappings, only the page table structure has to be created. */
        page_table_range_init(fix_to_virt(__end_of_fixed_addresses - 1),
                              FIXADDR_TOP, pgd_base);
 
@@ -941,26 +906,6 @@ void __init pgtable_cache_init(void)
                panic("pgtable_cache_init(): Cannot create pgd cache");
 }
 
-#if !CHIP_HAS_COHERENT_LOCAL_CACHE()
-/*
- * The __w1data area holds data that is only written during initialization,
- * and is read-only and thus freely cacheable thereafter.  Fix the page
- * table entries that cover that region accordingly.
- */
-static void mark_w1data_ro(void)
-{
-       /* Loop over page table entries */
-       unsigned long addr = (unsigned long)__w1data_begin;
-       BUG_ON((addr & (PAGE_SIZE-1)) != 0);
-       for (; addr <= (unsigned long)__w1data_end - 1; addr += PAGE_SIZE) {
-               unsigned long pfn = kaddr_to_pfn((void *)addr);
-               pte_t *ptep = virt_to_pte(NULL, addr);
-               BUG_ON(pte_huge(*ptep));   /* not relevant for kdata_huge */
-               set_pte_at(&init_mm, addr, ptep, pfn_pte(pfn, PAGE_KERNEL_RO));
-       }
-}
-#endif
-
 #ifdef CONFIG_DEBUG_PAGEALLOC
 static long __write_once initfree;
 #else
@@ -1000,7 +945,7 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end)
                 */
                int pfn = kaddr_to_pfn((void *)addr);
                struct page *page = pfn_to_page(pfn);
-               pte_t *ptep = virt_to_pte(NULL, addr);
+               pte_t *ptep = virt_to_kpte(addr);
                if (!initfree) {
                        /*
                         * If debugging page accesses then do not free
@@ -1024,15 +969,11 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end)
 
 void free_initmem(void)
 {
-       const unsigned long text_delta = MEM_SV_INTRPT - PAGE_OFFSET;
+       const unsigned long text_delta = MEM_SV_START - PAGE_OFFSET;
 
        /*
-        * Evict the dirty initdata on the boot cpu, evict the w1data
-        * wherever it's homed, and evict all the init code everywhere.
-        * We are guaranteed that no one will touch the init pages any
-        * more, and although other cpus may be touching the w1data,
-        * we only actually change the caching on tile64, which won't
-        * be keeping local copies in the other tiles' caches anyway.
+        * Evict the cache on all cores to avoid incoherence.
+        * We are guaranteed that no one will touch the init pages any more.
         */
        homecache_evict(&cpu_cacheable_map);
 
@@ -1043,26 +984,11 @@ void free_initmem(void)
 
        /*
         * Free the pages mapped from 0xc0000000 that correspond to code
-        * pages from MEM_SV_INTRPT that we won't use again after init.
+        * pages from MEM_SV_START that we won't use again after init.
         */
        free_init_pages("unused kernel text",
                        (unsigned long)_sinittext - text_delta,
                        (unsigned long)_einittext - text_delta);
-
-#if !CHIP_HAS_COHERENT_LOCAL_CACHE()
-       /*
-        * Upgrade the .w1data section to globally cached.
-        * We don't do this on tilepro, since the cache architecture
-        * pretty much makes it irrelevant, and in any case we end
-        * up having racing issues with other tiles that may touch
-        * the data after we flush the cache but before we update
-        * the PTEs and flush the TLBs, causing sharer shootdowns
-        * later.  Even though this is to clean data, it seems like
-        * an unnecessary complication.
-        */
-       mark_w1data_ro();
-#endif
-
        /* Do a global TLB flush so everyone sees the changes. */
        flush_tlb_all();
 }
index 5305814..7720854 100644 (file)
@@ -136,7 +136,7 @@ STD_ENTRY(flush_and_install_context)
         move r8, zero  /* asids */
         move r9, zero  /* asidcount */
        }
-       jal hv_flush_remote
+       jal _hv_flush_remote
        bnz r0, .Ldone
 
        /* Now install the new page table. */
@@ -152,7 +152,7 @@ STD_ENTRY(flush_and_install_context)
         move r4, r_asid
         moveli r5, HV_CTX_DIRECTIO | CTX_PAGE_FLAG
        }
-       jal hv_install_context
+       jal _hv_install_context
        bnz r0, .Ldone
 
        /* Finally, flush the TLB. */
index 1d15b10..a49eee3 100644 (file)
@@ -123,7 +123,7 @@ STD_ENTRY(flush_and_install_context)
        }
        {
         move r8, zero  /* asidcount */
-        jal hv_flush_remote
+        jal _hv_flush_remote
        }
        bnez r0, 1f
 
@@ -136,7 +136,7 @@ STD_ENTRY(flush_and_install_context)
         move r2, r_asid
         moveli r3, HV_CTX_DIRECTIO | CTX_PAGE_FLAG
        }
-       jal hv_install_context
+       jal _hv_install_context
        bnez r0, 1f
 
        /* Finally, flush the TLB. */
index d67d91e..851a94e 100644 (file)
@@ -58,16 +58,36 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
 #else
        int is_32bit = 0;
 #endif
+       unsigned long random_factor = 0UL;
+
+       /*
+        *  8 bits of randomness in 32bit mmaps, 24 address space bits
+        * 12 bits of randomness in 64bit mmaps, 28 address space bits
+        */
+       if (current->flags & PF_RANDOMIZE) {
+               if (is_32bit)
+                       random_factor = get_random_int() % (1<<8);
+               else
+                       random_factor = get_random_int() % (1<<12);
+
+               random_factor <<= PAGE_SHIFT;
+       }
 
        /*
         * Use standard layout if the expected stack growth is unlimited
         * or we are running native 64 bits.
         */
-       if (!is_32bit || rlimit(RLIMIT_STACK) == RLIM_INFINITY) {
-               mm->mmap_base = TASK_UNMAPPED_BASE;
+       if (rlimit(RLIMIT_STACK) == RLIM_INFINITY) {
+               mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
                mm->get_unmapped_area = arch_get_unmapped_area;
        } else {
                mm->mmap_base = mmap_base(mm);
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
        }
 }
+
+unsigned long arch_randomize_brk(struct mm_struct *mm)
+{
+       unsigned long range_end = mm->brk + 0x02000000;
+       return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
+}
index dfd63ce..2deaddf 100644 (file)
@@ -83,55 +83,6 @@ void show_mem(unsigned int filter)
        }
 }
 
-/*
- * Associate a virtual page frame with a given physical page frame
- * and protection flags for that frame.
- */
-static void set_pte_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags)
-{
-       pgd_t *pgd;
-       pud_t *pud;
-       pmd_t *pmd;
-       pte_t *pte;
-
-       pgd = swapper_pg_dir + pgd_index(vaddr);
-       if (pgd_none(*pgd)) {
-               BUG();
-               return;
-       }
-       pud = pud_offset(pgd, vaddr);
-       if (pud_none(*pud)) {
-               BUG();
-               return;
-       }
-       pmd = pmd_offset(pud, vaddr);
-       if (pmd_none(*pmd)) {
-               BUG();
-               return;
-       }
-       pte = pte_offset_kernel(pmd, vaddr);
-       /* <pfn,flags> stored as-is, to permit clearing entries */
-       set_pte(pte, pfn_pte(pfn, flags));
-
-       /*
-        * It's enough to flush this one mapping.
-        * This appears conservative since it is only called
-        * from __set_fixmap.
-        */
-       local_flush_tlb_page(NULL, vaddr, PAGE_SIZE);
-}
-
-void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
-{
-       unsigned long address = __fix_to_virt(idx);
-
-       if (idx >= __end_of_fixed_addresses) {
-               BUG();
-               return;
-       }
-       set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
-}
-
 /**
  * shatter_huge_page() - ensure a given address is mapped by a small page.
  *
@@ -374,6 +325,17 @@ void ptep_set_wrprotect(struct mm_struct *mm,
 
 #endif
 
+/*
+ * Return a pointer to the PTE that corresponds to the given
+ * address in the given page table.  A NULL page table just uses
+ * the standard kernel page table; the preferred API in this case
+ * is virt_to_kpte().
+ *
+ * The returned pointer can point to a huge page in other levels
+ * of the page table than the bottom, if the huge page is present
+ * in the page table.  For bottom-level PTEs, the returned pointer
+ * can point to a PTE that is either present or not.
+ */
 pte_t *virt_to_pte(struct mm_struct* mm, unsigned long addr)
 {
        pgd_t *pgd;
@@ -387,13 +349,23 @@ pte_t *virt_to_pte(struct mm_struct* mm, unsigned long addr)
        pud = pud_offset(pgd, addr);
        if (!pud_present(*pud))
                return NULL;
+       if (pud_huge_page(*pud))
+               return (pte_t *)pud;
        pmd = pmd_offset(pud, addr);
-       if (pmd_huge_page(*pmd))
-               return (pte_t *)pmd;
        if (!pmd_present(*pmd))
                return NULL;
+       if (pmd_huge_page(*pmd))
+               return (pte_t *)pmd;
        return pte_offset_kernel(pmd, addr);
 }
+EXPORT_SYMBOL(virt_to_pte);
+
+pte_t *virt_to_kpte(unsigned long kaddr)
+{
+       BUG_ON(kaddr < PAGE_OFFSET);
+       return virt_to_pte(NULL, kaddr);
+}
+EXPORT_SYMBOL(virt_to_kpte);
 
 pgprot_t set_remote_cache_cpu(pgprot_t prot, int cpu)
 {
@@ -568,7 +540,7 @@ void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
        addr = area->addr;
        if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
                               phys_addr, pgprot)) {
-               remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr));
+               free_vm_area(area);
                return NULL;
        }
        return (__force void __iomem *) (offset + (char *)addr);
index 5c0ed72..30c40f0 100644 (file)
@@ -2032,7 +2032,6 @@ menu "Bus options (PCI etc.)"
 config PCI
        bool "PCI support"
        default y
-       select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
        ---help---
          Find out whether you have a PCI motherboard. PCI is the name of a
          bus system, i.e. the way the CPU talks to the other stuff inside
index d9e9e6c..7d74432 100644 (file)
@@ -100,29 +100,6 @@ static inline void early_quirks(void) { }
 extern void pci_iommu_alloc(void);
 
 #ifdef CONFIG_PCI_MSI
-/* MSI arch specific hooks */
-static inline int x86_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
-{
-       return x86_msi.setup_msi_irqs(dev, nvec, type);
-}
-
-static inline void x86_teardown_msi_irqs(struct pci_dev *dev)
-{
-       x86_msi.teardown_msi_irqs(dev);
-}
-
-static inline void x86_teardown_msi_irq(unsigned int irq)
-{
-       x86_msi.teardown_msi_irq(irq);
-}
-static inline void x86_restore_msi_irqs(struct pci_dev *dev, int irq)
-{
-       x86_msi.restore_msi_irqs(dev, irq);
-}
-#define arch_setup_msi_irqs x86_setup_msi_irqs
-#define arch_teardown_msi_irqs x86_teardown_msi_irqs
-#define arch_teardown_msi_irq x86_teardown_msi_irq
-#define arch_restore_msi_irqs x86_restore_msi_irqs
 /* implemented in arch/x86/kernel/apic/io_apic. */
 struct msi_desc;
 int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
@@ -130,16 +107,9 @@ void native_teardown_msi_irq(unsigned int irq);
 void native_restore_msi_irqs(struct pci_dev *dev, int irq);
 int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
                  unsigned int irq_base, unsigned int irq_offset);
-/* default to the implementation in drivers/lib/msi.c */
-#define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
-#define HAVE_DEFAULT_MSI_RESTORE_IRQS
-void default_teardown_msi_irqs(struct pci_dev *dev);
-void default_restore_msi_irqs(struct pci_dev *dev, int irq);
 #else
 #define native_setup_msi_irqs          NULL
 #define native_teardown_msi_irq                NULL
-#define default_teardown_msi_irqs      NULL
-#define default_restore_msi_irqs       NULL
 #endif
 
 #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
index 5f24c71..8ce0072 100644 (file)
@@ -107,6 +107,8 @@ struct x86_platform_ops x86_platform = {
 };
 
 EXPORT_SYMBOL_GPL(x86_platform);
+
+#if defined(CONFIG_PCI_MSI)
 struct x86_msi_ops x86_msi = {
        .setup_msi_irqs         = native_setup_msi_irqs,
        .compose_msi_msg        = native_compose_msi_msg,
@@ -116,6 +118,28 @@ struct x86_msi_ops x86_msi = {
        .setup_hpet_msi         = default_setup_hpet_msi,
 };
 
+/* MSI arch specific hooks */
+int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+{
+       return x86_msi.setup_msi_irqs(dev, nvec, type);
+}
+
+void arch_teardown_msi_irqs(struct pci_dev *dev)
+{
+       x86_msi.teardown_msi_irqs(dev);
+}
+
+void arch_teardown_msi_irq(unsigned int irq)
+{
+       x86_msi.teardown_msi_irq(irq);
+}
+
+void arch_restore_msi_irqs(struct pci_dev *dev, int irq)
+{
+       x86_msi.restore_msi_irqs(dev, irq);
+}
+#endif
+
 struct x86_io_apic_ops x86_io_apic_ops = {
        .init                   = native_io_apic_init_mappings,
        .read                   = native_io_apic_read,
index 47fe66f..3ca5957 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/intel_pmic_gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/platform_device.h>
index 3b61803..320ea4d 100644 (file)
@@ -391,7 +391,7 @@ EXPORT_SYMBOL_GPL(__crypto_alloc_tfm);
  *     @mask: Mask for type comparison
  *
  *     This function should not be used by new algorithm types.
- *     Plesae use crypto_alloc_tfm instead.
+ *     Please use crypto_alloc_tfm instead.
  *
  *     crypto_alloc_base() will first attempt to locate an already loaded
  *     algorithm.  If that fails and the kernel supports dynamically loadable
index 64fbb83..b12c11e 100644 (file)
@@ -393,7 +393,7 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
         * we must not block on IO to ourselves.
         * Context is receiver thread or dmsetup. */
        bytes = sizeof(struct page *)*want;
-       new_pages = kzalloc(bytes, GFP_NOIO);
+       new_pages = kzalloc(bytes, GFP_NOIO | __GFP_NOWARN);
        if (!new_pages) {
                new_pages = __vmalloc(bytes,
                                GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO,
index 1f70e84..552373c 100644 (file)
@@ -8,10 +8,9 @@ config IMX_WEIM
        bool "Freescale EIM DRIVER"
        depends on ARCH_MXC
        help
-         Driver for i.MX6 WEIM controller.
+         Driver for i.MX WEIM controller.
          The WEIM(Wireless External Interface Module) works like a bus.
          You can attach many different devices on it, such as NOR, onenand.
-         But now, we only support the Parallel NOR.
 
 config MVEBU_MBUS
        bool
index 349f14e..3ef58c8 100644 (file)
 #include <linux/io.h>
 #include <linux/of_device.h>
 
-struct imx_weim {
-       void __iomem *base;
-       struct clk *clk;
+struct imx_weim_devtype {
+       unsigned int    cs_count;
+       unsigned int    cs_regs_count;
+       unsigned int    cs_stride;
+};
+
+static const struct imx_weim_devtype imx1_weim_devtype = {
+       .cs_count       = 6,
+       .cs_regs_count  = 2,
+       .cs_stride      = 0x08,
+};
+
+static const struct imx_weim_devtype imx27_weim_devtype = {
+       .cs_count       = 6,
+       .cs_regs_count  = 3,
+       .cs_stride      = 0x10,
+};
+
+static const struct imx_weim_devtype imx50_weim_devtype = {
+       .cs_count       = 4,
+       .cs_regs_count  = 6,
+       .cs_stride      = 0x18,
+};
+
+static const struct imx_weim_devtype imx51_weim_devtype = {
+       .cs_count       = 6,
+       .cs_regs_count  = 6,
+       .cs_stride      = 0x18,
 };
 
 static const struct of_device_id weim_id_table[] = {
-       { .compatible = "fsl,imx6q-weim", },
-       {}
+       /* i.MX1/21 */
+       { .compatible = "fsl,imx1-weim", .data = &imx1_weim_devtype, },
+       /* i.MX25/27/31/35 */
+       { .compatible = "fsl,imx27-weim", .data = &imx27_weim_devtype, },
+       /* i.MX50/53/6Q */
+       { .compatible = "fsl,imx50-weim", .data = &imx50_weim_devtype, },
+       { .compatible = "fsl,imx6q-weim", .data = &imx50_weim_devtype, },
+       /* i.MX51 */
+       { .compatible = "fsl,imx51-weim", .data = &imx51_weim_devtype, },
+       { }
 };
 MODULE_DEVICE_TABLE(of, weim_id_table);
 
-#define CS_TIMING_LEN 6
-#define CS_REG_RANGE  0x18
-
 /* Parse and set the timing for this device. */
-static int
-weim_timing_setup(struct platform_device *pdev, struct device_node *np)
+static int __init weim_timing_setup(struct device_node *np, void __iomem *base,
+                                   const struct imx_weim_devtype *devtype)
 {
-       struct imx_weim *weim = platform_get_drvdata(pdev);
-       u32 value[CS_TIMING_LEN];
-       u32 cs_idx;
-       int ret;
-       int i;
+       u32 cs_idx, value[devtype->cs_regs_count];
+       int i, ret;
 
        /* get the CS index from this child node's "reg" property. */
        ret = of_property_read_u32(np, "reg", &cs_idx);
        if (ret)
                return ret;
 
-       /* The weim has four chip selects. */
-       if (cs_idx > 3)
+       if (cs_idx >= devtype->cs_count)
                return -EINVAL;
 
        ret = of_property_read_u32_array(np, "fsl,weim-cs-timing",
-                                       value, CS_TIMING_LEN);
+                                        value, devtype->cs_regs_count);
        if (ret)
                return ret;
 
        /* set the timing for WEIM */
-       for (i = 0; i < CS_TIMING_LEN; i++)
-               writel(value[i], weim->base + cs_idx * CS_REG_RANGE + i * 4);
+       for (i = 0; i < devtype->cs_regs_count; i++)
+               writel(value[i], base + cs_idx * devtype->cs_stride + i * 4);
+
        return 0;
 }
 
-static int weim_parse_dt(struct platform_device *pdev)
+static int __init weim_parse_dt(struct platform_device *pdev,
+                               void __iomem *base)
 {
+       const struct of_device_id *of_id = of_match_device(weim_id_table,
+                                                          &pdev->dev);
+       const struct imx_weim_devtype *devtype = of_id->data;
        struct device_node *child;
        int ret;
 
@@ -65,7 +96,7 @@ static int weim_parse_dt(struct platform_device *pdev)
                if (!child->name)
                        continue;
 
-               ret = weim_timing_setup(pdev, child);
+               ret = weim_timing_setup(child, base, devtype);
                if (ret) {
                        dev_err(&pdev->dev, "%s set timing failed.\n",
                                child->full_name);
@@ -80,59 +111,47 @@ static int weim_parse_dt(struct platform_device *pdev)
        return ret;
 }
 
-static int weim_probe(struct platform_device *pdev)
+static int __init weim_probe(struct platform_device *pdev)
 {
-       struct imx_weim *weim;
        struct resource *res;
-       int ret = -EINVAL;
-
-       weim = devm_kzalloc(&pdev->dev, sizeof(*weim), GFP_KERNEL);
-       if (!weim) {
-               ret = -ENOMEM;
-               goto weim_err;
-       }
-       platform_set_drvdata(pdev, weim);
+       struct clk *clk;
+       void __iomem *base;
+       int ret;
 
        /* get the resource */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       weim->base = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(weim->base)) {
-               ret = PTR_ERR(weim->base);
-               goto weim_err;
-       }
+       base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(base))
+               return PTR_ERR(base);
 
        /* get the clock */
-       weim->clk = devm_clk_get(&pdev->dev, NULL);
-       if (IS_ERR(weim->clk))
-               goto weim_err;
+       clk = devm_clk_get(&pdev->dev, NULL);
+       if (IS_ERR(clk))
+               return PTR_ERR(clk);
 
-       ret = clk_prepare_enable(weim->clk);
+       ret = clk_prepare_enable(clk);
        if (ret)
-               goto weim_err;
+               return ret;
 
        /* parse the device node */
-       ret = weim_parse_dt(pdev);
-       if (ret) {
-               clk_disable_unprepare(weim->clk);
-               goto weim_err;
-       }
-
-       dev_info(&pdev->dev, "WEIM driver registered.\n");
-       return 0;
+       ret = weim_parse_dt(pdev, base);
+       if (ret)
+               clk_disable_unprepare(clk);
+       else
+               dev_info(&pdev->dev, "Driver registered.\n");
 
-weim_err:
        return ret;
 }
 
 static struct platform_driver weim_driver = {
        .driver = {
-               .name = "imx-weim",
-               .of_match_table = weim_id_table,
+               .name           = "imx-weim",
+               .owner          = THIS_MODULE,
+               .of_match_table = weim_id_table,
        },
-       .probe   = weim_probe,
 };
+module_platform_driver_probe(weim_driver, weim_probe);
 
-module_platform_driver(weim_driver);
 MODULE_AUTHOR("Freescale Semiconductor Inc.");
 MODULE_DESCRIPTION("i.MX EIM Controller Driver");
 MODULE_LICENSE("GPL");
index 33c6947..19ab6ff 100644 (file)
  *
  * - Provides an API for platform code or device drivers to
  *   dynamically add or remove address decoding windows for the CPU ->
- *   device accesses. This API is mvebu_mbus_add_window(),
- *   mvebu_mbus_add_window_remap_flags() and
- *   mvebu_mbus_del_window(). Since the (target, attribute) values
- *   differ from one SoC family to another, the API uses a 'const char
- *   *' string to identify devices, and this driver is responsible for
- *   knowing the mapping between the name of a device and its
- *   corresponding (target, attribute) in the current SoC family.
+ *   device accesses. This API is mvebu_mbus_add_window_by_id(),
+ *   mvebu_mbus_add_window_remap_by_id() and
+ *   mvebu_mbus_del_window().
  *
  * - Provides a debugfs interface in /sys/kernel/debug/mvebu-mbus/ to
  *   see the list of CPU -> SDRAM windows and their configuration
 
 #define DOVE_DDR_BASE_CS_OFF(n) ((n) << 4)
 
-struct mvebu_mbus_mapping {
-       const char *name;
-       u8 target;
-       u8 attr;
-       u8 attrmask;
-};
-
-/*
- * Masks used for the 'attrmask' field of mvebu_mbus_mapping. They
- * allow to get the real attribute value, discarding the special bits
- * used to select a PCI MEM region or a PCI WA region. This allows the
- * debugfs code to reverse-match the name of a device from its
- * target/attr values.
- *
- * For all devices except PCI, all bits of 'attr' must be
- * considered. For most SoCs, only bit 3 should be ignored (it allows
- * to select between PCI MEM and PCI I/O). On Orion5x however, there
- * is the special bit 5 to select a PCI WA region.
- */
-#define MAPDEF_NOMASK       0xff
-#define MAPDEF_PCIMASK      0xf7
-#define MAPDEF_ORIONPCIMASK 0xd7
-
-/* Macro used to define one mvebu_mbus_mapping entry */
-#define MAPDEF(__n, __t, __a, __m) \
-       { .name = __n, .target = __t, .attr = __a, .attrmask = __m }
-
 struct mvebu_mbus_state;
 
 struct mvebu_mbus_soc_data {
@@ -133,7 +102,6 @@ struct mvebu_mbus_soc_data {
        void (*setup_cpu_target)(struct mvebu_mbus_state *s);
        int (*show_cpu_target)(struct mvebu_mbus_state *s,
                               struct seq_file *seq, void *v);
-       const struct mvebu_mbus_mapping *map;
 };
 
 struct mvebu_mbus_state {
@@ -142,6 +110,8 @@ struct mvebu_mbus_state {
        struct dentry *debugfs_root;
        struct dentry *debugfs_sdram;
        struct dentry *debugfs_devs;
+       struct resource pcie_mem_aperture;
+       struct resource pcie_io_aperture;
        const struct mvebu_mbus_soc_data *soc;
        int hw_io_coherency;
 };
@@ -428,8 +398,7 @@ static int mvebu_devs_debug_show(struct seq_file *seq, void *v)
                u64 wbase, wremap;
                u32 wsize;
                u8 wtarget, wattr;
-               int enabled, i;
-               const char *name;
+               int enabled;
 
                mvebu_mbus_read_window(mbus, win,
                                       &enabled, &wbase, &wsize,
@@ -440,18 +409,9 @@ static int mvebu_devs_debug_show(struct seq_file *seq, void *v)
                        continue;
                }
 
-
-               for (i = 0; mbus->soc->map[i].name; i++)
-                       if (mbus->soc->map[i].target == wtarget &&
-                           mbus->soc->map[i].attr ==
-                           (wattr & mbus->soc->map[i].attrmask))
-                               break;
-
-               name = mbus->soc->map[i].name ?: "unknown";
-
-               seq_printf(seq, "[%02d] %016llx - %016llx : %s",
+               seq_printf(seq, "[%02d] %016llx - %016llx : %04x:%04x",
                           win, (unsigned long long)wbase,
-                          (unsigned long long)(wbase + wsize), name);
+                          (unsigned long long)(wbase + wsize), wtarget, wattr);
 
                if (win < mbus->soc->num_remappable_wins) {
                        seq_printf(seq, " (remap %016llx)\n",
@@ -576,62 +536,12 @@ mvebu_mbus_dove_setup_cpu_target(struct mvebu_mbus_state *mbus)
        mvebu_mbus_dram_info.num_cs = cs;
 }
 
-static const struct mvebu_mbus_mapping armada_370_map[] = {
-       MAPDEF("bootrom",     1, 0xe0, MAPDEF_NOMASK),
-       MAPDEF("devbus-boot", 1, 0x2f, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs0",  1, 0x3e, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs1",  1, 0x3d, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs2",  1, 0x3b, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs3",  1, 0x37, MAPDEF_NOMASK),
-       MAPDEF("pcie0.0",     4, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.0",     8, 0xe0, MAPDEF_PCIMASK),
-       {},
-};
-
-static const struct mvebu_mbus_soc_data armada_370_mbus_data = {
+static const struct mvebu_mbus_soc_data armada_370_xp_mbus_data = {
        .num_wins            = 20,
        .num_remappable_wins = 8,
        .win_cfg_offset      = armada_370_xp_mbus_win_offset,
        .setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
        .show_cpu_target     = mvebu_sdram_debug_show_orion,
-       .map                 = armada_370_map,
-};
-
-static const struct mvebu_mbus_mapping armada_xp_map[] = {
-       MAPDEF("bootrom",     1, 0x1d, MAPDEF_NOMASK),
-       MAPDEF("devbus-boot", 1, 0x2f, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs0",  1, 0x3e, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs1",  1, 0x3d, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs2",  1, 0x3b, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs3",  1, 0x37, MAPDEF_NOMASK),
-       MAPDEF("pcie0.0",     4, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("pcie0.1",     4, 0xd0, MAPDEF_PCIMASK),
-       MAPDEF("pcie0.2",     4, 0xb0, MAPDEF_PCIMASK),
-       MAPDEF("pcie0.3",     4, 0x70, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.0",     8, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.1",     8, 0xd0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.2",     8, 0xb0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.3",     8, 0x70, MAPDEF_PCIMASK),
-       MAPDEF("pcie2.0",     4, 0xf0, MAPDEF_PCIMASK),
-       MAPDEF("pcie3.0",     8, 0xf0, MAPDEF_PCIMASK),
-       {},
-};
-
-static const struct mvebu_mbus_soc_data armada_xp_mbus_data = {
-       .num_wins            = 20,
-       .num_remappable_wins = 8,
-       .win_cfg_offset      = armada_370_xp_mbus_win_offset,
-       .setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
-       .show_cpu_target     = mvebu_sdram_debug_show_orion,
-       .map                 = armada_xp_map,
-};
-
-static const struct mvebu_mbus_mapping kirkwood_map[] = {
-       MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.0", 4, 0xd0, MAPDEF_PCIMASK),
-       MAPDEF("sram",    3, 0x01, MAPDEF_NOMASK),
-       MAPDEF("nand",    1, 0x2f, MAPDEF_NOMASK),
-       {},
 };
 
 static const struct mvebu_mbus_soc_data kirkwood_mbus_data = {
@@ -640,16 +550,6 @@ static const struct mvebu_mbus_soc_data kirkwood_mbus_data = {
        .win_cfg_offset      = orion_mbus_win_offset,
        .setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
        .show_cpu_target     = mvebu_sdram_debug_show_orion,
-       .map                 = kirkwood_map,
-};
-
-static const struct mvebu_mbus_mapping dove_map[] = {
-       MAPDEF("pcie0.0",    0x4, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.0",    0x8, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("cesa",       0x3, 0x01, MAPDEF_NOMASK),
-       MAPDEF("bootrom",    0x1, 0xfd, MAPDEF_NOMASK),
-       MAPDEF("scratchpad", 0xd, 0x0, MAPDEF_NOMASK),
-       {},
 };
 
 static const struct mvebu_mbus_soc_data dove_mbus_data = {
@@ -658,18 +558,6 @@ static const struct mvebu_mbus_soc_data dove_mbus_data = {
        .win_cfg_offset      = orion_mbus_win_offset,
        .setup_cpu_target    = mvebu_mbus_dove_setup_cpu_target,
        .show_cpu_target     = mvebu_sdram_debug_show_dove,
-       .map                 = dove_map,
-};
-
-static const struct mvebu_mbus_mapping orion5x_map[] = {
-       MAPDEF("pcie0.0",     4, 0x51, MAPDEF_ORIONPCIMASK),
-       MAPDEF("pci0.0",      3, 0x51, MAPDEF_ORIONPCIMASK),
-       MAPDEF("devbus-boot", 1, 0x0f, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs0",  1, 0x1e, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs1",  1, 0x1d, MAPDEF_NOMASK),
-       MAPDEF("devbus-cs2",  1, 0x1b, MAPDEF_NOMASK),
-       MAPDEF("sram",        0, 0x00, MAPDEF_NOMASK),
-       {},
 };
 
 /*
@@ -682,7 +570,6 @@ static const struct mvebu_mbus_soc_data orion5x_4win_mbus_data = {
        .win_cfg_offset      = orion_mbus_win_offset,
        .setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
        .show_cpu_target     = mvebu_sdram_debug_show_orion,
-       .map                 = orion5x_map,
 };
 
 static const struct mvebu_mbus_soc_data orion5x_2win_mbus_data = {
@@ -691,21 +578,6 @@ static const struct mvebu_mbus_soc_data orion5x_2win_mbus_data = {
        .win_cfg_offset      = orion_mbus_win_offset,
        .setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
        .show_cpu_target     = mvebu_sdram_debug_show_orion,
-       .map                 = orion5x_map,
-};
-
-static const struct mvebu_mbus_mapping mv78xx0_map[] = {
-       MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("pcie0.1", 4, 0xd0, MAPDEF_PCIMASK),
-       MAPDEF("pcie0.2", 4, 0xb0, MAPDEF_PCIMASK),
-       MAPDEF("pcie0.3", 4, 0x70, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.0", 8, 0xe0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.1", 8, 0xd0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.2", 8, 0xb0, MAPDEF_PCIMASK),
-       MAPDEF("pcie1.3", 8, 0x70, MAPDEF_PCIMASK),
-       MAPDEF("pcie2.0", 4, 0xf0, MAPDEF_PCIMASK),
-       MAPDEF("pcie3.0", 8, 0xf0, MAPDEF_PCIMASK),
-       {},
 };
 
 static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
@@ -714,7 +586,6 @@ static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
        .win_cfg_offset      = mv78xx0_mbus_win_offset,
        .setup_cpu_target    = mvebu_mbus_default_setup_cpu_target,
        .show_cpu_target     = mvebu_sdram_debug_show_orion,
-       .map                 = mv78xx0_map,
 };
 
 /*
@@ -725,9 +596,9 @@ static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
  */
 static const struct of_device_id of_mvebu_mbus_ids[] = {
        { .compatible = "marvell,armada370-mbus",
-         .data = &armada_370_mbus_data, },
+         .data = &armada_370_xp_mbus_data, },
        { .compatible = "marvell,armadaxp-mbus",
-         .data = &armada_xp_mbus_data, },
+         .data = &armada_370_xp_mbus_data, },
        { .compatible = "marvell,kirkwood-mbus",
          .data = &kirkwood_mbus_data, },
        { .compatible = "marvell,dove-mbus",
@@ -748,48 +619,27 @@ static const struct of_device_id of_mvebu_mbus_ids[] = {
 /*
  * Public API of the driver
  */
-int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base,
-                                     size_t size, phys_addr_t remap,
-                                     unsigned int flags)
+int mvebu_mbus_add_window_remap_by_id(unsigned int target,
+                                     unsigned int attribute,
+                                     phys_addr_t base, size_t size,
+                                     phys_addr_t remap)
 {
        struct mvebu_mbus_state *s = &mbus_state;
-       u8 target, attr;
-       int i;
-
-       if (!s->soc->map)
-               return -ENODEV;
-
-       for (i = 0; s->soc->map[i].name; i++)
-               if (!strcmp(s->soc->map[i].name, devname))
-                       break;
-
-       if (!s->soc->map[i].name) {
-               pr_err("unknown device '%s'\n", devname);
-               return -ENODEV;
-       }
-
-       target = s->soc->map[i].target;
-       attr   = s->soc->map[i].attr;
-
-       if (flags == MVEBU_MBUS_PCI_MEM)
-               attr |= 0x8;
-       else if (flags == MVEBU_MBUS_PCI_WA)
-               attr |= 0x28;
 
-       if (!mvebu_mbus_window_conflicts(s, base, size, target, attr)) {
-               pr_err("cannot add window '%s', conflicts with another window\n",
-                      devname);
+       if (!mvebu_mbus_window_conflicts(s, base, size, target, attribute)) {
+               pr_err("cannot add window '%x:%x', conflicts with another window\n",
+                      target, attribute);
                return -EINVAL;
        }
 
-       return mvebu_mbus_alloc_window(s, base, size, remap, target, attr);
-
+       return mvebu_mbus_alloc_window(s, base, size, remap, target, attribute);
 }
 
-int mvebu_mbus_add_window(const char *devname, phys_addr_t base, size_t size)
+int mvebu_mbus_add_window_by_id(unsigned int target, unsigned int attribute,
+                               phys_addr_t base, size_t size)
 {
-       return mvebu_mbus_add_window_remap_flags(devname, base, size,
-                                                MVEBU_MBUS_NO_REMAP, 0);
+       return mvebu_mbus_add_window_remap_by_id(target, attribute, base,
+                                                size, MVEBU_MBUS_NO_REMAP);
 }
 
 int mvebu_mbus_del_window(phys_addr_t base, size_t size)
@@ -804,6 +654,20 @@ int mvebu_mbus_del_window(phys_addr_t base, size_t size)
        return 0;
 }
 
+void mvebu_mbus_get_pcie_mem_aperture(struct resource *res)
+{
+       if (!res)
+               return;
+       *res = mbus_state.pcie_mem_aperture;
+}
+
+void mvebu_mbus_get_pcie_io_aperture(struct resource *res)
+{
+       if (!res)
+               return;
+       *res = mbus_state.pcie_io_aperture;
+}
+
 static __init int mvebu_mbus_debugfs_init(void)
 {
        struct mvebu_mbus_state *s = &mbus_state;
@@ -830,14 +694,41 @@ static __init int mvebu_mbus_debugfs_init(void)
 }
 fs_initcall(mvebu_mbus_debugfs_init);
 
+static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
+                                        phys_addr_t mbuswins_phys_base,
+                                        size_t mbuswins_size,
+                                        phys_addr_t sdramwins_phys_base,
+                                        size_t sdramwins_size)
+{
+       int win;
+
+       mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
+       if (!mbus->mbuswins_base)
+               return -ENOMEM;
+
+       mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size);
+       if (!mbus->sdramwins_base) {
+               iounmap(mbus_state.mbuswins_base);
+               return -ENOMEM;
+       }
+
+       if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"))
+               mbus->hw_io_coherency = 1;
+
+       for (win = 0; win < mbus->soc->num_wins; win++)
+               mvebu_mbus_disable_window(mbus, win);
+
+       mbus->soc->setup_cpu_target(mbus);
+
+       return 0;
+}
+
 int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base,
                           size_t mbuswins_size,
                           phys_addr_t sdramwins_phys_base,
                           size_t sdramwins_size)
 {
-       struct mvebu_mbus_state *mbus = &mbus_state;
        const struct of_device_id *of_id;
-       int win;
 
        for (of_id = of_mvebu_mbus_ids; of_id->compatible; of_id++)
                if (!strcmp(of_id->compatible, soc))
@@ -848,25 +739,201 @@ int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base,
                return -ENODEV;
        }
 
-       mbus->soc = of_id->data;
+       mbus_state.soc = of_id->data;
 
-       mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
-       if (!mbus->mbuswins_base)
-               return -ENOMEM;
+       return mvebu_mbus_common_init(&mbus_state,
+                       mbuswins_phys_base,
+                       mbuswins_size,
+                       sdramwins_phys_base,
+                       sdramwins_size);
+}
 
-       mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size);
-       if (!mbus->sdramwins_base) {
-               iounmap(mbus_state.mbuswins_base);
+#ifdef CONFIG_OF
+/*
+ * The window IDs in the ranges DT property have the following format:
+ *  - bits 28 to 31: MBus custom field
+ *  - bits 24 to 27: window target ID
+ *  - bits 16 to 23: window attribute ID
+ *  - bits  0 to 15: unused
+ */
+#define CUSTOM(id) (((id) & 0xF0000000) >> 24)
+#define TARGET(id) (((id) & 0x0F000000) >> 24)
+#define ATTR(id)   (((id) & 0x00FF0000) >> 16)
+
+static int __init mbus_dt_setup_win(struct mvebu_mbus_state *mbus,
+                                   u32 base, u32 size,
+                                   u8 target, u8 attr)
+{
+       if (!mvebu_mbus_window_conflicts(mbus, base, size, target, attr)) {
+               pr_err("cannot add window '%04x:%04x', conflicts with another window\n",
+                      target, attr);
+               return -EBUSY;
+       }
+
+       if (mvebu_mbus_alloc_window(mbus, base, size, MVEBU_MBUS_NO_REMAP,
+                                   target, attr)) {
+               pr_err("cannot add window '%04x:%04x', too many windows\n",
+                      target, attr);
                return -ENOMEM;
        }
+       return 0;
+}
 
-       if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"))
-               mbus->hw_io_coherency = 1;
+static int __init
+mbus_parse_ranges(struct device_node *node,
+                 int *addr_cells, int *c_addr_cells, int *c_size_cells,
+                 int *cell_count, const __be32 **ranges_start,
+                 const __be32 **ranges_end)
+{
+       const __be32 *prop;
+       int ranges_len, tuple_len;
+
+       /* Allow a node with no 'ranges' property */
+       *ranges_start = of_get_property(node, "ranges", &ranges_len);
+       if (*ranges_start == NULL) {
+               *addr_cells = *c_addr_cells = *c_size_cells = *cell_count = 0;
+               *ranges_start = *ranges_end = NULL;
+               return 0;
+       }
+       *ranges_end = *ranges_start + ranges_len / sizeof(__be32);
 
-       for (win = 0; win < mbus->soc->num_wins; win++)
-               mvebu_mbus_disable_window(mbus, win);
+       *addr_cells = of_n_addr_cells(node);
 
-       mbus->soc->setup_cpu_target(mbus);
+       prop = of_get_property(node, "#address-cells", NULL);
+       *c_addr_cells = be32_to_cpup(prop);
+
+       prop = of_get_property(node, "#size-cells", NULL);
+       *c_size_cells = be32_to_cpup(prop);
+
+       *cell_count = *addr_cells + *c_addr_cells + *c_size_cells;
+       tuple_len = (*cell_count) * sizeof(__be32);
+
+       if (ranges_len % tuple_len) {
+               pr_warn("malformed ranges entry '%s'\n", node->name);
+               return -EINVAL;
+       }
+       return 0;
+}
+
+static int __init mbus_dt_setup(struct mvebu_mbus_state *mbus,
+                               struct device_node *np)
+{
+       int addr_cells, c_addr_cells, c_size_cells;
+       int i, ret, cell_count;
+       const __be32 *r, *ranges_start, *ranges_end;
+
+       ret = mbus_parse_ranges(np, &addr_cells, &c_addr_cells,
+                               &c_size_cells, &cell_count,
+                               &ranges_start, &ranges_end);
+       if (ret < 0)
+               return ret;
+
+       for (i = 0, r = ranges_start; r < ranges_end; r += cell_count, i++) {
+               u32 windowid, base, size;
+               u8 target, attr;
+
+               /*
+                * An entry with a non-zero custom field do not
+                * correspond to a static window, so skip it.
+                */
+               windowid = of_read_number(r, 1);
+               if (CUSTOM(windowid))
+                       continue;
+
+               target = TARGET(windowid);
+               attr = ATTR(windowid);
 
+               base = of_read_number(r + c_addr_cells, addr_cells);
+               size = of_read_number(r + c_addr_cells + addr_cells,
+                                     c_size_cells);
+               ret = mbus_dt_setup_win(mbus, base, size, target, attr);
+               if (ret < 0)
+                       return ret;
+       }
        return 0;
 }
+
+static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
+                                                struct resource *mem,
+                                                struct resource *io)
+{
+       u32 reg[2];
+       int ret;
+
+       /*
+        * These are optional, so we clear them and they'll
+        * be zero if they are missing from the DT.
+        */
+       memset(mem, 0, sizeof(struct resource));
+       memset(io, 0, sizeof(struct resource));
+
+       ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
+       if (!ret) {
+               mem->start = reg[0];
+               mem->end = mem->start + reg[1];
+               mem->flags = IORESOURCE_MEM;
+       }
+
+       ret = of_property_read_u32_array(np, "pcie-io-aperture", reg, ARRAY_SIZE(reg));
+       if (!ret) {
+               io->start = reg[0];
+               io->end = io->start + reg[1];
+               io->flags = IORESOURCE_IO;
+       }
+}
+
+int __init mvebu_mbus_dt_init(void)
+{
+       struct resource mbuswins_res, sdramwins_res;
+       struct device_node *np, *controller;
+       const struct of_device_id *of_id;
+       const __be32 *prop;
+       int ret;
+
+       np = of_find_matching_node(NULL, of_mvebu_mbus_ids);
+       if (!np) {
+               pr_err("could not find a matching SoC family\n");
+               return -ENODEV;
+       }
+
+       of_id = of_match_node(of_mvebu_mbus_ids, np);
+       mbus_state.soc = of_id->data;
+
+       prop = of_get_property(np, "controller", NULL);
+       if (!prop) {
+               pr_err("required 'controller' property missing\n");
+               return -EINVAL;
+       }
+
+       controller = of_find_node_by_phandle(be32_to_cpup(prop));
+       if (!controller) {
+               pr_err("could not find an 'mbus-controller' node\n");
+               return -ENODEV;
+       }
+
+       if (of_address_to_resource(controller, 0, &mbuswins_res)) {
+               pr_err("cannot get MBUS register address\n");
+               return -EINVAL;
+       }
+
+       if (of_address_to_resource(controller, 1, &sdramwins_res)) {
+               pr_err("cannot get SDRAM register address\n");
+               return -EINVAL;
+       }
+
+       /* Get optional pcie-{mem,io}-aperture properties */
+       mvebu_mbus_get_pcie_resources(np, &mbus_state.pcie_mem_aperture,
+                                         &mbus_state.pcie_io_aperture);
+
+       ret = mvebu_mbus_common_init(&mbus_state,
+                                    mbuswins_res.start,
+                                    resource_size(&mbuswins_res),
+                                    sdramwins_res.start,
+                                    resource_size(&sdramwins_res));
+       if (ret)
+               return ret;
+
+       /* Setup statically declared windows in the DT */
+       return mbus_dt_setup(&mbus_state, np);
+}
+#endif
index b6015cb..806d803 100644 (file)
 /* Tegra CPU clock and reset control regs */
 #define CLK_RST_CONTROLLER_CPU_CMPLX_STATUS    0x470
 
+#ifdef CONFIG_PM_SLEEP
+static struct cpu_clk_suspend_context {
+       u32 clk_csite_src;
+       u32 cclkg_burst;
+       u32 cclkg_divider;
+} tegra114_cpu_clk_sctx;
+#endif
+
 static int periph_clk_enb_refcnt[CLK_OUT_ENB_NUM * 32];
 
 static void __iomem *clk_base;
@@ -2142,9 +2150,39 @@ static void tegra114_disable_cpu_clock(u32 cpu)
        /* flow controller would take care in the power sequence. */
 }
 
+#ifdef CONFIG_PM_SLEEP
+static void tegra114_cpu_clock_suspend(void)
+{
+       /* switch coresite to clk_m, save off original source */
+       tegra114_cpu_clk_sctx.clk_csite_src =
+                               readl(clk_base + CLK_SOURCE_CSITE);
+       writel(3 << 30, clk_base + CLK_SOURCE_CSITE);
+
+       tegra114_cpu_clk_sctx.cclkg_burst =
+                               readl(clk_base + CCLKG_BURST_POLICY);
+       tegra114_cpu_clk_sctx.cclkg_divider =
+                               readl(clk_base + CCLKG_BURST_POLICY + 4);
+}
+
+static void tegra114_cpu_clock_resume(void)
+{
+       writel(tegra114_cpu_clk_sctx.clk_csite_src,
+                                       clk_base + CLK_SOURCE_CSITE);
+
+       writel(tegra114_cpu_clk_sctx.cclkg_burst,
+                                       clk_base + CCLKG_BURST_POLICY);
+       writel(tegra114_cpu_clk_sctx.cclkg_divider,
+                                       clk_base + CCLKG_BURST_POLICY + 4);
+}
+#endif
+
 static struct tegra_cpu_car_ops tegra114_cpu_car_ops = {
        .wait_for_reset = tegra114_wait_cpu_in_reset,
        .disable_clock  = tegra114_disable_cpu_clock,
+#ifdef CONFIG_PM_SLEEP
+       .suspend        = tegra114_cpu_clock_suspend,
+       .resume         = tegra114_cpu_clock_resume,
+#endif
 };
 
 static const struct of_device_id pmc_match[] __initconst = {
index b7b9b04..41c6946 100644 (file)
@@ -99,7 +99,6 @@ config CLKSRC_EXYNOS_MCT
 
 config CLKSRC_SAMSUNG_PWM
        bool
-       select CLKSRC_MMIO
        help
          This is a new clocksource driver for the PWM timer found in
          Samsung S3C, S5P and Exynos SoCs, replacing an earlier driver
index 6efe4d1..6eab889 100644 (file)
@@ -200,14 +200,14 @@ static int __init init_acpi_pm_clocksource(void)
                        if ((value2 < value1) && ((value2) < 0xFFF))
                                break;
                        printk(KERN_INFO "PM-Timer had inconsistent results:"
-                              " 0x%#llx, 0x%#llx - aborting.\n",
+                              " %#llx, %#llx - aborting.\n",
                               value1, value2);
                        pmtmr_ioport = 0;
                        return -EINVAL;
                }
                if (i == ACPI_PM_READ_CHECKS) {
                        printk(KERN_INFO "PM-Timer failed consistency check "
-                              " (0x%#llx) - aborting.\n", value1);
+                              " (%#llx) - aborting.\n", value1);
                        pmtmr_ioport = 0;
                        return -ENODEV;
                }
index ba3d859..0d7d8c3 100644 (file)
@@ -99,7 +99,8 @@ kona_timer_get_counter(void *timer_base, uint32_t *msw, uint32_t *lsw)
 }
 
 static const struct of_device_id bcm_timer_ids[] __initconst = {
-       {.compatible = "bcm,kona-timer"},
+       {.compatible = "brcm,kona-timer"},
+       {.compatible = "bcm,kona-timer"}, /* deprecated name */
        {},
 };
 
@@ -201,4 +202,9 @@ static void __init kona_timer_init(struct device_node *node)
        kona_timer_set_next_event((arch_timer_rate / HZ), NULL);
 }
 
+CLOCKSOURCE_OF_DECLARE(brcm_kona, "brcm,kona-timer", kona_timer_init);
+/*
+ * bcm,kona-timer is deprecated by brcm,kona-timer
+ * being kept here for driver compatibility
+ */
 CLOCKSOURCE_OF_DECLARE(bcm_kona, "bcm,kona-timer", kona_timer_init);
index b2bbc41..5b34768 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/clockchips.h>
+#include <linux/cpu.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/percpu.h>
@@ -24,7 +25,6 @@
 #include <linux/of_address.h>
 #include <linux/clocksource.h>
 
-#include <asm/localtimer.h>
 #include <asm/mach/time.h>
 
 #define EXYNOS4_MCTREG(x)              (x)
@@ -80,7 +80,7 @@ static unsigned int mct_int_type;
 static int mct_irqs[MCT_NR_IRQS];
 
 struct mct_clock_event_device {
-       struct clock_event_device *evt;
+       struct clock_event_device evt;
        unsigned long base;
        char name[10];
 };
@@ -295,8 +295,6 @@ static void exynos4_clockevent_init(void)
        setup_irq(mct_irqs[MCT_G0_IRQ], &mct_comp_event_irq);
 }
 
-#ifdef CONFIG_LOCAL_TIMERS
-
 static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick);
 
 /* Clock event handling */
@@ -369,7 +367,7 @@ static inline void exynos4_tick_set_mode(enum clock_event_mode mode,
 
 static int exynos4_mct_tick_clear(struct mct_clock_event_device *mevt)
 {
-       struct clock_event_device *evt = mevt->evt;
+       struct clock_event_device *evt = &mevt->evt;
 
        /*
         * This is for supporting oneshot mode.
@@ -391,7 +389,7 @@ static int exynos4_mct_tick_clear(struct mct_clock_event_device *mevt)
 static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id)
 {
        struct mct_clock_event_device *mevt = dev_id;
-       struct clock_event_device *evt = mevt->evt;
+       struct clock_event_device *evt = &mevt->evt;
 
        exynos4_mct_tick_clear(mevt);
 
@@ -405,8 +403,7 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
        struct mct_clock_event_device *mevt;
        unsigned int cpu = smp_processor_id();
 
-       mevt = this_cpu_ptr(&percpu_mct_tick);
-       mevt->evt = evt;
+       mevt = container_of(evt, struct mct_clock_event_device, evt);
 
        mevt->base = EXYNOS4_MCT_L_BASE(cpu);
        sprintf(mevt->name, "mct_tick%d", cpu);
@@ -448,14 +445,37 @@ static void exynos4_local_timer_stop(struct clock_event_device *evt)
                disable_percpu_irq(mct_irqs[MCT_L0_IRQ]);
 }
 
-static struct local_timer_ops exynos4_mct_tick_ops = {
-       .setup  = exynos4_local_timer_setup,
-       .stop   = exynos4_local_timer_stop,
+static int exynos4_mct_cpu_notify(struct notifier_block *self,
+                                          unsigned long action, void *hcpu)
+{
+       struct mct_clock_event_device *mevt;
+
+       /*
+        * Grab cpu pointer in each case to avoid spurious
+        * preemptible warnings
+        */
+       switch (action & ~CPU_TASKS_FROZEN) {
+       case CPU_STARTING:
+               mevt = this_cpu_ptr(&percpu_mct_tick);
+               exynos4_local_timer_setup(&mevt->evt);
+               break;
+       case CPU_DYING:
+               mevt = this_cpu_ptr(&percpu_mct_tick);
+               exynos4_local_timer_stop(&mevt->evt);
+               break;
+       }
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block exynos4_mct_cpu_nb = {
+       .notifier_call = exynos4_mct_cpu_notify,
 };
-#endif /* CONFIG_LOCAL_TIMERS */
 
 static void __init exynos4_timer_resources(struct device_node *np, void __iomem *base)
 {
+       int err;
+       struct mct_clock_event_device *mevt = this_cpu_ptr(&percpu_mct_tick);
        struct clk *mct_clk, *tick_clk;
 
        tick_clk = np ? of_clk_get_by_name(np, "fin_pll") :
@@ -473,9 +493,7 @@ static void __init exynos4_timer_resources(struct device_node *np, void __iomem
        if (!reg_base)
                panic("%s: unable to ioremap mct address space\n", __func__);
 
-#ifdef CONFIG_LOCAL_TIMERS
        if (mct_int_type == MCT_INT_PPI) {
-               int err;
 
                err = request_percpu_irq(mct_irqs[MCT_L0_IRQ],
                                         exynos4_mct_tick_isr, "MCT",
@@ -484,8 +502,16 @@ static void __init exynos4_timer_resources(struct device_node *np, void __iomem
                     mct_irqs[MCT_L0_IRQ], err);
        }
 
-       local_timer_register(&exynos4_mct_tick_ops);
-#endif /* CONFIG_LOCAL_TIMERS */
+       err = register_cpu_notifier(&exynos4_mct_cpu_nb);
+       if (err)
+               goto out_irq;
+
+       /* Immediately configure the timer on the boot CPU */
+       exynos4_local_timer_setup(&mevt->evt);
+       return;
+
+out_irq:
+       free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick);
 }
 
 void __init mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1)
index 584b547..ac60f8b 100644 (file)
 #define TCFG1_SHIFT(x)                 ((x) * 4)
 #define TCFG1_MUX_MASK                 0xf
 
+/*
+ * Each channel occupies 4 bits in TCON register, but there is a gap of 4
+ * bits (one channel) after channel 0, so channels have different numbering
+ * when accessing TCON register.
+ *
+ * In addition, the location of autoreload bit for channel 4 (TCON channel 5)
+ * in its set of bits is 2 as opposed to 3 for other channels.
+ */
 #define TCON_START(chan)               (1 << (4 * (chan) + 0))
 #define TCON_MANUALUPDATE(chan)                (1 << (4 * (chan) + 1))
 #define TCON_INVERT(chan)              (1 << (4 * (chan) + 2))
-#define TCON_AUTORELOAD(chan)          (1 << (4 * (chan) + 3))
+#define _TCON_AUTORELOAD(chan)         (1 << (4 * (chan) + 3))
+#define _TCON_AUTORELOAD4(chan)                (1 << (4 * (chan) + 2))
+#define TCON_AUTORELOAD(chan)          \
+       ((chan < 5) ? _TCON_AUTORELOAD(chan) : _TCON_AUTORELOAD4(chan))
 
 DEFINE_SPINLOCK(samsung_pwm_lock);
 EXPORT_SYMBOL(samsung_pwm_lock);
 
 struct samsung_pwm_clocksource {
        void __iomem *base;
+       void __iomem *source_reg;
        unsigned int irq[SAMSUNG_PWM_NUM];
        struct samsung_pwm_variant variant;
 
@@ -195,17 +207,6 @@ static int samsung_set_next_event(unsigned long cycles,
        return 0;
 }
 
-static void samsung_timer_resume(void)
-{
-       /* event timer restart */
-       samsung_time_setup(pwm.event_id, pwm.clock_count_per_tick - 1);
-       samsung_time_start(pwm.event_id, true);
-
-       /* source timer restart */
-       samsung_time_setup(pwm.source_id, pwm.tcnt_max);
-       samsung_time_start(pwm.source_id, true);
-}
-
 static void samsung_set_mode(enum clock_event_mode mode,
                                struct clock_event_device *evt)
 {
@@ -222,20 +223,29 @@ static void samsung_set_mode(enum clock_event_mode mode,
 
        case CLOCK_EVT_MODE_UNUSED:
        case CLOCK_EVT_MODE_SHUTDOWN:
-               break;
-
        case CLOCK_EVT_MODE_RESUME:
-               samsung_timer_resume();
                break;
        }
 }
 
+static void samsung_clockevent_resume(struct clock_event_device *cev)
+{
+       samsung_timer_set_prescale(pwm.event_id, pwm.tscaler_div);
+       samsung_timer_set_divisor(pwm.event_id, pwm.tdiv);
+
+       if (pwm.variant.has_tint_cstat) {
+               u32 mask = (1 << pwm.event_id);
+               writel(mask | (mask << 5), pwm.base + REG_TINT_CSTAT);
+       }
+}
+
 static struct clock_event_device time_event_device = {
        .name           = "samsung_event_timer",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .rating         = 200,
        .set_next_event = samsung_set_next_event,
        .set_mode       = samsung_set_mode,
+       .resume         = samsung_clockevent_resume,
 };
 
 static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id)
@@ -286,23 +296,34 @@ static void __init samsung_clockevent_init(void)
        }
 }
 
-static void __iomem *samsung_timer_reg(void)
+static void samsung_clocksource_suspend(struct clocksource *cs)
 {
-       switch (pwm.source_id) {
-       case 0:
-       case 1:
-       case 2:
-       case 3:
-               return pwm.base + pwm.source_id * 0x0c + 0x14;
-
-       case 4:
-               return pwm.base + 0x40;
-
-       default:
-               BUG();
-       }
+       samsung_time_stop(pwm.source_id);
 }
 
+static void samsung_clocksource_resume(struct clocksource *cs)
+{
+       samsung_timer_set_prescale(pwm.source_id, pwm.tscaler_div);
+       samsung_timer_set_divisor(pwm.source_id, pwm.tdiv);
+
+       samsung_time_setup(pwm.source_id, pwm.tcnt_max);
+       samsung_time_start(pwm.source_id, true);
+}
+
+static cycle_t samsung_clocksource_read(struct clocksource *c)
+{
+       return ~readl_relaxed(pwm.source_reg);
+}
+
+static struct clocksource samsung_clocksource = {
+       .name           = "samsung_clocksource_timer",
+       .rating         = 250,
+       .read           = samsung_clocksource_read,
+       .suspend        = samsung_clocksource_suspend,
+       .resume         = samsung_clocksource_resume,
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
 /*
  * Override the global weak sched_clock symbol with this
  * local implementation which uses the clocksource to get some
@@ -312,17 +333,11 @@ static void __iomem *samsung_timer_reg(void)
  */
 static u32 notrace samsung_read_sched_clock(void)
 {
-       void __iomem *reg = samsung_timer_reg();
-
-       if (!reg)
-               return 0;
-
-       return ~__raw_readl(reg);
+       return samsung_clocksource_read(NULL);
 }
 
 static void __init samsung_clocksource_init(void)
 {
-       void __iomem *reg = samsung_timer_reg();
        unsigned long pclk;
        unsigned long clock_rate;
        int ret;
@@ -337,12 +352,16 @@ static void __init samsung_clocksource_init(void)
        samsung_time_setup(pwm.source_id, pwm.tcnt_max);
        samsung_time_start(pwm.source_id, true);
 
+       if (pwm.source_id == 4)
+               pwm.source_reg = pwm.base + 0x40;
+       else
+               pwm.source_reg = pwm.base + pwm.source_id * 0x0c + 0x14;
+
        setup_sched_clock(samsung_read_sched_clock,
                                                pwm.variant.bits, clock_rate);
 
-       ret = clocksource_mmio_init(reg, "samsung_clocksource_timer",
-                                       clock_rate, 250, pwm.variant.bits,
-                                       clocksource_mmio_readl_down);
+       samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
+       ret = clocksource_register_hz(&samsung_clocksource, clock_rate);
        if (ret)
                panic("samsung_clocksource_timer: can't register clocksource\n");
 }
@@ -404,7 +423,6 @@ void __init samsung_pwm_clocksource_init(void __iomem *base,
 static void __init samsung_pwm_alloc(struct device_node *np,
                                     const struct samsung_pwm_variant *variant)
 {
-       struct resource res;
        struct property *prop;
        const __be32 *cur;
        u32 val;
@@ -423,17 +441,9 @@ static void __init samsung_pwm_alloc(struct device_node *np,
                pwm.variant.output_mask |= 1 << val;
        }
 
-       of_address_to_resource(np, 0, &res);
-       if (!request_mem_region(res.start,
-                               resource_size(&res), "samsung-pwm")) {
-               pr_err("%s: failed to request IO mem region\n", __func__);
-               return;
-       }
-
-       pwm.base = ioremap(res.start, resource_size(&res));
+       pwm.base = of_iomap(np, 0);
        if (!pwm.base) {
                pr_err("%s: failed to map PWM registers\n", __func__);
-               release_mem_region(res.start, resource_size(&res));
                return;
        }
 
index 1b04b7e..847cab6 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/platform_device.h>
 #include <linux/kernel.h>
 #include <linux/clk.h>
+#include <linux/cpu.h>
 #include <linux/timer.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
@@ -28,9 +29,9 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/sched_clock.h>
-
-#include <asm/localtimer.h>
 #include <linux/percpu.h>
+#include <linux/time-armada-370-xp.h>
+
 /*
  * Timer block registers.
  */
@@ -69,7 +70,7 @@ static bool timer25Mhz = true;
  */
 static u32 ticks_per_jiffy;
 
-static struct clock_event_device __percpu **percpu_armada_370_xp_evt;
+static struct clock_event_device __percpu *armada_370_xp_evt;
 
 static u32 notrace armada_370_xp_read_sched_clock(void)
 {
@@ -142,21 +143,14 @@ armada_370_xp_clkevt_mode(enum clock_event_mode mode,
        }
 }
 
-static struct clock_event_device armada_370_xp_clkevt = {
-       .name           = "armada_370_xp_per_cpu_tick",
-       .features       = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
-       .shift          = 32,
-       .rating         = 300,
-       .set_next_event = armada_370_xp_clkevt_next_event,
-       .set_mode       = armada_370_xp_clkevt_mode,
-};
+static int armada_370_xp_clkevt_irq;
 
 static irqreturn_t armada_370_xp_timer_interrupt(int irq, void *dev_id)
 {
        /*
         * ACK timer interrupt and call event handler.
         */
-       struct clock_event_device *evt = *(struct clock_event_device **)dev_id;
+       struct clock_event_device *evt = dev_id;
 
        writel(TIMER0_CLR_MASK, local_base + LCL_TIMER_EVENTS_STATUS);
        evt->event_handler(evt);
@@ -172,42 +166,55 @@ static int armada_370_xp_timer_setup(struct clock_event_device *evt)
        u32 u;
        int cpu = smp_processor_id();
 
-       /* Use existing clock_event for cpu 0 */
-       if (!smp_processor_id())
-               return 0;
-
        u = readl(local_base + TIMER_CTRL_OFF);
        if (timer25Mhz)
                writel(u | TIMER0_25MHZ, local_base + TIMER_CTRL_OFF);
        else
                writel(u & ~TIMER0_25MHZ, local_base + TIMER_CTRL_OFF);
 
-       evt->name               = armada_370_xp_clkevt.name;
-       evt->irq                = armada_370_xp_clkevt.irq;
-       evt->features           = armada_370_xp_clkevt.features;
-       evt->shift              = armada_370_xp_clkevt.shift;
-       evt->rating             = armada_370_xp_clkevt.rating,
+       evt->name               = "armada_370_xp_per_cpu_tick",
+       evt->features           = CLOCK_EVT_FEAT_ONESHOT |
+                                 CLOCK_EVT_FEAT_PERIODIC;
+       evt->shift              = 32,
+       evt->rating             = 300,
        evt->set_next_event     = armada_370_xp_clkevt_next_event,
        evt->set_mode           = armada_370_xp_clkevt_mode,
+       evt->irq                = armada_370_xp_clkevt_irq;
        evt->cpumask            = cpumask_of(cpu);
 
-       *__this_cpu_ptr(percpu_armada_370_xp_evt) = evt;
-
        clockevents_config_and_register(evt, timer_clk, 1, 0xfffffffe);
        enable_percpu_irq(evt->irq, 0);
 
        return 0;
 }
 
-static void  armada_370_xp_timer_stop(struct clock_event_device *evt)
+static void armada_370_xp_timer_stop(struct clock_event_device *evt)
 {
        evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
        disable_percpu_irq(evt->irq);
 }
 
-static struct local_timer_ops armada_370_xp_local_timer_ops = {
-       .setup  = armada_370_xp_timer_setup,
-       .stop   =  armada_370_xp_timer_stop,
+static int armada_370_xp_timer_cpu_notify(struct notifier_block *self,
+                                          unsigned long action, void *hcpu)
+{
+       /*
+        * Grab cpu pointer in each case to avoid spurious
+        * preemptible warnings
+        */
+       switch (action & ~CPU_TASKS_FROZEN) {
+       case CPU_STARTING:
+               armada_370_xp_timer_setup(this_cpu_ptr(armada_370_xp_evt));
+               break;
+       case CPU_DYING:
+               armada_370_xp_timer_stop(this_cpu_ptr(armada_370_xp_evt));
+               break;
+       }
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block armada_370_xp_timer_cpu_nb = {
+       .notifier_call = armada_370_xp_timer_cpu_notify,
 };
 
 void __init armada_370_xp_timer_init(void)
@@ -223,9 +230,6 @@ void __init armada_370_xp_timer_init(void)
 
        if (of_find_property(np, "marvell,timer-25Mhz", NULL)) {
                /* The fixed 25MHz timer is available so let's use it */
-               u = readl(local_base + TIMER_CTRL_OFF);
-               writel(u | TIMER0_25MHZ,
-                      local_base + TIMER_CTRL_OFF);
                u = readl(timer_base + TIMER_CTRL_OFF);
                writel(u | TIMER0_25MHZ,
                       timer_base + TIMER_CTRL_OFF);
@@ -235,9 +239,6 @@ void __init armada_370_xp_timer_init(void)
                struct clk *clk = of_clk_get(np, 0);
                WARN_ON(IS_ERR(clk));
                rate =  clk_get_rate(clk);
-               u = readl(local_base + TIMER_CTRL_OFF);
-               writel(u & ~(TIMER0_25MHZ),
-                      local_base + TIMER_CTRL_OFF);
 
                u = readl(timer_base + TIMER_CTRL_OFF);
                writel(u & ~(TIMER0_25MHZ),
@@ -251,7 +252,7 @@ void __init armada_370_xp_timer_init(void)
         * We use timer 0 as clocksource, and private(local) timer 0
         * for clockevents
         */
-       armada_370_xp_clkevt.irq = irq_of_parse_and_map(np, 4);
+       armada_370_xp_clkevt_irq = irq_of_parse_and_map(np, 4);
 
        ticks_per_jiffy = (timer_clk + HZ / 2) / HZ;
 
@@ -276,26 +277,19 @@ void __init armada_370_xp_timer_init(void)
                              "armada_370_xp_clocksource",
                              timer_clk, 300, 32, clocksource_mmio_readl_down);
 
-       /* Register the clockevent on the private timer of CPU 0 */
-       armada_370_xp_clkevt.cpumask = cpumask_of(0);
-       clockevents_config_and_register(&armada_370_xp_clkevt,
-                                       timer_clk, 1, 0xfffffffe);
+       register_cpu_notifier(&armada_370_xp_timer_cpu_nb);
 
-       percpu_armada_370_xp_evt = alloc_percpu(struct clock_event_device *);
+       armada_370_xp_evt = alloc_percpu(struct clock_event_device);
 
 
        /*
         * Setup clockevent timer (interrupt-driven).
         */
-       *__this_cpu_ptr(percpu_armada_370_xp_evt) = &armada_370_xp_clkevt;
-       res = request_percpu_irq(armada_370_xp_clkevt.irq,
+       res = request_percpu_irq(armada_370_xp_clkevt_irq,
                                armada_370_xp_timer_interrupt,
-                               armada_370_xp_clkevt.name,
-                               percpu_armada_370_xp_evt);
-       if (!res) {
-               enable_percpu_irq(armada_370_xp_clkevt.irq, 0);
-#ifdef CONFIG_LOCAL_TIMERS
-               local_timer_register(&armada_370_xp_local_timer_ops);
-#endif
-       }
+                               "armada_370_xp_per_cpu_tick",
+                               armada_370_xp_evt);
+       /* Immediately configure the timer on the boot CPU */
+       if (!res)
+               armada_370_xp_timer_setup(this_cpu_ptr(armada_370_xp_evt));
 }
index 62876ba..09a17d9 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/interrupt.h>
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <linux/cpu.h>
 #include <linux/bitops.h>
 #include <linux/irq.h>
 #include <linux/clk.h>
@@ -18,7 +19,6 @@
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
 #include <linux/sched_clock.h>
-#include <asm/localtimer.h>
 #include <asm/mach/time.h>
 
 #define SIRFSOC_TIMER_32COUNTER_0_CTRL                 0x0000
@@ -151,13 +151,7 @@ static void sirfsoc_clocksource_resume(struct clocksource *cs)
                BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
 }
 
-static struct clock_event_device sirfsoc_clockevent = {
-       .name = "sirfsoc_clockevent",
-       .rating = 200,
-       .features = CLOCK_EVT_FEAT_ONESHOT,
-       .set_mode = sirfsoc_timer_set_mode,
-       .set_next_event = sirfsoc_timer_set_next_event,
-};
+static struct clock_event_device __percpu *sirfsoc_clockevent;
 
 static struct clocksource sirfsoc_clocksource = {
        .name = "sirfsoc_clocksource",
@@ -173,11 +167,8 @@ static struct irqaction sirfsoc_timer_irq = {
        .name = "sirfsoc_timer0",
        .flags = IRQF_TIMER | IRQF_NOBALANCING,
        .handler = sirfsoc_timer_interrupt,
-       .dev_id = &sirfsoc_clockevent,
 };
 
-#ifdef CONFIG_LOCAL_TIMERS
-
 static struct irqaction sirfsoc_timer1_irq = {
        .name = "sirfsoc_timer1",
        .flags = IRQF_TIMER | IRQF_NOBALANCING,
@@ -186,24 +177,28 @@ static struct irqaction sirfsoc_timer1_irq = {
 
 static int sirfsoc_local_timer_setup(struct clock_event_device *ce)
 {
-       /* Use existing clock_event for cpu 0 */
-       if (!smp_processor_id())
-               return 0;
+       int cpu = smp_processor_id();
+       struct irqaction *action;
+
+       if (cpu == 0)
+               action = &sirfsoc_timer_irq;
+       else
+               action = &sirfsoc_timer1_irq;
 
-       ce->irq = sirfsoc_timer1_irq.irq;
+       ce->irq = action->irq;
        ce->name = "local_timer";
-       ce->features = sirfsoc_clockevent.features;
-       ce->rating = sirfsoc_clockevent.rating;
+       ce->features = CLOCK_EVT_FEAT_ONESHOT;
+       ce->rating = 200;
        ce->set_mode = sirfsoc_timer_set_mode;
        ce->set_next_event = sirfsoc_timer_set_next_event;
-       ce->shift = sirfsoc_clockevent.shift;
-       ce->mult = sirfsoc_clockevent.mult;
-       ce->max_delta_ns = sirfsoc_clockevent.max_delta_ns;
-       ce->min_delta_ns = sirfsoc_clockevent.min_delta_ns;
+       clockevents_calc_mult_shift(ce, CLOCK_TICK_RATE, 60);
+       ce->max_delta_ns = clockevent_delta2ns(-2, ce);
+       ce->min_delta_ns = clockevent_delta2ns(2, ce);
+       ce->cpumask = cpumask_of(cpu);
 
-       sirfsoc_timer1_irq.dev_id = ce;
-       BUG_ON(setup_irq(ce->irq, &sirfsoc_timer1_irq));
-       irq_set_affinity(sirfsoc_timer1_irq.irq, cpumask_of(1));
+       action->dev_id = ce;
+       BUG_ON(setup_irq(ce->irq, action));
+       irq_set_affinity(action->irq, cpumask_of(cpu));
 
        clockevents_register_device(ce);
        return 0;
@@ -211,31 +206,48 @@ static int sirfsoc_local_timer_setup(struct clock_event_device *ce)
 
 static void sirfsoc_local_timer_stop(struct clock_event_device *ce)
 {
+       int cpu = smp_processor_id();
+
        sirfsoc_timer_count_disable(1);
 
-       remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq);
+       if (cpu == 0)
+               remove_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq);
+       else
+               remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq);
 }
 
-static struct local_timer_ops sirfsoc_local_timer_ops = {
-       .setup  = sirfsoc_local_timer_setup,
-       .stop   = sirfsoc_local_timer_stop,
+static int sirfsoc_cpu_notify(struct notifier_block *self,
+                             unsigned long action, void *hcpu)
+{
+       /*
+        * Grab cpu pointer in each case to avoid spurious
+        * preemptible warnings
+        */
+       switch (action & ~CPU_TASKS_FROZEN) {
+       case CPU_STARTING:
+               sirfsoc_local_timer_setup(this_cpu_ptr(sirfsoc_clockevent));
+               break;
+       case CPU_DYING:
+               sirfsoc_local_timer_stop(this_cpu_ptr(sirfsoc_clockevent));
+               break;
+       }
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block sirfsoc_cpu_nb = {
+       .notifier_call = sirfsoc_cpu_notify,
 };
-#endif /* CONFIG_LOCAL_TIMERS */
 
 static void __init sirfsoc_clockevent_init(void)
 {
-       clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60);
-
-       sirfsoc_clockevent.max_delta_ns =
-               clockevent_delta2ns(-2, &sirfsoc_clockevent);
-       sirfsoc_clockevent.min_delta_ns =
-               clockevent_delta2ns(2, &sirfsoc_clockevent);
-
-       sirfsoc_clockevent.cpumask = cpumask_of(0);
-       clockevents_register_device(&sirfsoc_clockevent);
-#ifdef CONFIG_LOCAL_TIMERS
-       local_timer_register(&sirfsoc_local_timer_ops);
-#endif
+       sirfsoc_clockevent = alloc_percpu(struct clock_event_device);
+       BUG_ON(!sirfsoc_clockevent);
+
+       BUG_ON(register_cpu_notifier(&sirfsoc_cpu_nb));
+
+       /* Immediately configure the timer on the boot CPU */
+       sirfsoc_local_timer_setup(this_cpu_ptr(sirfsoc_clockevent));
 }
 
 /* initialize the kernel jiffy timer source */
@@ -273,8 +285,6 @@ static void __init sirfsoc_marco_timer_init(void)
 
        BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
 
-       BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq));
-
        sirfsoc_clockevent_init();
 }
 
@@ -288,11 +298,9 @@ static void __init sirfsoc_of_timer_init(struct device_node *np)
        if (!sirfsoc_timer_irq.irq)
                panic("No irq passed for timer0 via DT\n");
 
-#ifdef CONFIG_LOCAL_TIMERS
        sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1);
        if (!sirfsoc_timer1_irq.irq)
                panic("No irq passed for timer1 via DT\n");
-#endif
 
        sirfsoc_marco_timer_init();
 }
index 496ae6a..33693d9 100644 (file)
@@ -282,7 +282,7 @@ static int get_empty_message_digest(
                        }
                } else {
                        dev_dbg(device_data->dev, "[%s] Continue hash "
-                                       "calculation, since hmac key avalable",
+                                       "calculation, since hmac key available",
                                        __func__);
                }
        }
index a082053..578f915 100644 (file)
@@ -257,7 +257,6 @@ static void __exit tile_edac_exit(void)
                if (!pdev)
                        continue;
 
-               platform_set_drvdata(pdev, NULL);
                platform_device_unregister(pdev);
        }
        platform_driver_unregister(&tile_edac_mc_driver);
index b2450ba..349b161 100644 (file)
@@ -146,6 +146,16 @@ config GPIO_MM_LANTIQ
          (EBU) found on Lantiq SoCs. The gpios are output only as they are
          created by attaching a 16bit latch to the bus.
 
+config GPIO_F7188X
+       tristate "F71882FG and F71889F GPIO support"
+       depends on X86
+       help
+         This option enables support for GPIOs found on Fintek Super-I/O
+         chips F71882FG and F71889F.
+
+         To compile this driver as a module, choose M here: the module will
+         be called f7188x-gpio.
+
 config GPIO_MPC5200
        def_bool y
        depends on PPC_MPC52xx
@@ -242,6 +252,21 @@ config GPIO_TS5500
          blocks of the TS-5500: DIO1, DIO2 and the LCD port, and the TS-5600
          LCD port.
 
+config GPIO_TZ1090
+       bool "Toumaz Xenif TZ1090 GPIO support"
+       depends on SOC_TZ1090
+       select GENERIC_IRQ_CHIP
+       default y
+       help
+         Say yes here to support Toumaz Xenif TZ1090 GPIOs.
+
+config GPIO_TZ1090_PDC
+       bool "Toumaz Xenif TZ1090 PDC GPIO support"
+       depends on SOC_TZ1090
+       default y
+       help
+         Say yes here to support Toumaz Xenif TZ1090 PDC GPIOs.
+
 config GPIO_XILINX
        bool "Xilinx GPIO support"
        depends on PPC_OF || MICROBLAZE || ARCH_ZYNQ
@@ -676,6 +701,18 @@ config GPIO_UCB1400
          This enables support for the Philips UCB1400 GPIO pins.
          The UCB1400 is an AC97 audio codec.
 
+comment "LPC GPIO expanders:"
+
+config GPIO_KEMPLD
+       tristate "Kontron ETX / COMexpress GPIO"
+       depends on MFD_KEMPLD
+       help
+         This enables support for the PLD GPIO interface on some Kontron ETX
+         and COMexpress (ETXexpress) modules.
+
+         This driver can also be built as a module. If so, the module will be
+         called gpio-kempld.
+
 comment "MODULbus GPIO expanders:"
 
 config GPIO_JANZ_TTL
index ef3e983..97438bf 100644 (file)
@@ -24,11 +24,13 @@ obj-$(CONFIG_GPIO_DA9055)   += gpio-da9055.o
 obj-$(CONFIG_ARCH_DAVINCI)     += gpio-davinci.o
 obj-$(CONFIG_GPIO_EM)          += gpio-em.o
 obj-$(CONFIG_GPIO_EP93XX)      += gpio-ep93xx.o
+obj-$(CONFIG_GPIO_F7188X)      += gpio-f7188x.o
 obj-$(CONFIG_GPIO_GE_FPGA)     += gpio-ge.o
 obj-$(CONFIG_GPIO_GRGPIO)      += gpio-grgpio.o
 obj-$(CONFIG_GPIO_ICH)         += gpio-ich.o
 obj-$(CONFIG_GPIO_IT8761E)     += gpio-it8761e.o
 obj-$(CONFIG_GPIO_JANZ_TTL)    += gpio-janz-ttl.o
+obj-$(CONFIG_GPIO_KEMPLD)      += gpio-kempld.o
 obj-$(CONFIG_ARCH_KS8695)      += gpio-ks8695.o
 obj-$(CONFIG_GPIO_LANGWELL)    += gpio-langwell.o
 obj-$(CONFIG_ARCH_LPC32XX)     += gpio-lpc32xx.o
@@ -79,6 +81,8 @@ obj-$(CONFIG_GPIO_TPS65912)   += gpio-tps65912.o
 obj-$(CONFIG_GPIO_TS5500)      += gpio-ts5500.o
 obj-$(CONFIG_GPIO_TWL4030)     += gpio-twl4030.o
 obj-$(CONFIG_GPIO_TWL6040)     += gpio-twl6040.o
+obj-$(CONFIG_GPIO_TZ1090)      += gpio-tz1090.o
+obj-$(CONFIG_GPIO_TZ1090_PDC)  += gpio-tz1090-pdc.o
 obj-$(CONFIG_GPIO_UCB1400)     += gpio-ucb1400.o
 obj-$(CONFIG_GPIO_VIPERBOARD)  += gpio-viperboard.o
 obj-$(CONFIG_GPIO_VR41XX)      += gpio-vr41xx.o
index 7216079..5d518d5 100644 (file)
@@ -129,7 +129,7 @@ static int gen_74x164_probe(struct spi_device *spi)
        if (!chip)
                return -ENOMEM;
 
-       pdata = spi->dev.platform_data;
+       pdata = dev_get_platdata(&spi->dev);
        if (pdata && pdata->base)
                chip->gpio_chip.base = pdata->base;
        else
index e60567f..c0f3fc4 100644 (file)
@@ -490,15 +490,11 @@ static int adnp_irq_setup(struct adnp *adnp)
        if (err != 0) {
                dev_err(chip->dev, "can't request IRQ#%d: %d\n",
                        adnp->client->irq, err);
-               goto error;
+               return err;
        }
 
        chip->to_irq = adnp_gpio_to_irq;
        return 0;
-
-error:
-       irq_domain_remove(adnp->domain);
-       return err;
 }
 
 static void adnp_irq_teardown(struct adnp *adnp)
index f33f78d..084337d 100644 (file)
@@ -89,7 +89,7 @@ static int adp5520_gpio_direction_output(struct gpio_chip *chip,
 
 static int adp5520_gpio_probe(struct platform_device *pdev)
 {
-       struct adp5520_gpio_platform_data *pdata = pdev->dev.platform_data;
+       struct adp5520_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct adp5520_gpio *dev;
        struct gpio_chip *gc;
        int ret, i, gpios;
index 2ba5698..90fc4c9 100644 (file)
@@ -276,7 +276,8 @@ static irqreturn_t adp5588_irq_handler(int irq, void *devid)
 static int adp5588_irq_setup(struct adp5588_gpio *dev)
 {
        struct i2c_client *client = dev->client;
-       struct adp5588_gpio_platform_data *pdata = client->dev.platform_data;
+       struct adp5588_gpio_platform_data *pdata =
+                       dev_get_platdata(&client->dev);
        unsigned gpio;
        int ret;
 
@@ -349,7 +350,8 @@ static void adp5588_irq_teardown(struct adp5588_gpio *dev)
 static int adp5588_gpio_probe(struct i2c_client *client,
                                        const struct i2c_device_id *id)
 {
-       struct adp5588_gpio_platform_data *pdata = client->dev.platform_data;
+       struct adp5588_gpio_platform_data *pdata =
+                       dev_get_platdata(&client->dev);
        struct adp5588_gpio *dev;
        struct gpio_chip *gc;
        int ret, i, revid;
@@ -440,7 +442,8 @@ err:
 
 static int adp5588_gpio_remove(struct i2c_client *client)
 {
-       struct adp5588_gpio_platform_data *pdata = client->dev.platform_data;
+       struct adp5588_gpio_platform_data *pdata =
+                       dev_get_platdata(&client->dev);
        struct adp5588_gpio *dev = i2c_get_clientdata(client);
        int ret;
 
index 0ea853f..fa8b6a7 100644 (file)
@@ -97,7 +97,7 @@ static struct gpio_chip template_chip = {
 static int arizona_gpio_probe(struct platform_device *pdev)
 {
        struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
-       struct arizona_pdata *pdata = arizona->dev->platform_data;
+       struct arizona_pdata *pdata = dev_get_platdata(arizona->dev);
        struct arizona_gpio *arizona_gpio;
        int ret;
 
index 29b11e9..9b77dc0 100644 (file)
@@ -216,7 +216,7 @@ static int da9052_gpio_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        gpio->da9052 = dev_get_drvdata(pdev->dev.parent);
-       pdata = gpio->da9052->dev->platform_data;
+       pdata = dev_get_platdata(gpio->da9052->dev);
 
        gpio->gp = reference_gp;
        if (pdata && pdata->gpio_base)
index fd6dfe3..7ef0820 100644 (file)
@@ -150,7 +150,7 @@ static int da9055_gpio_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        gpio->da9055 = dev_get_drvdata(pdev->dev.parent);
-       pdata = gpio->da9055->dev->platform_data;
+       pdata = dev_get_platdata(gpio->da9055->dev);
 
        gpio->gp = reference_gp;
        if (pdata && pdata->gpio_base)
index 5cba855..c6e1f08 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/gpio.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_data/gpio-em.h>
 
 struct em_gio_priv {
@@ -216,6 +217,21 @@ static int em_gio_to_irq(struct gpio_chip *chip, unsigned offset)
        return irq_create_mapping(gpio_to_priv(chip)->irq_domain, offset);
 }
 
+static int em_gio_request(struct gpio_chip *chip, unsigned offset)
+{
+       return pinctrl_request_gpio(chip->base + offset);
+}
+
+static void em_gio_free(struct gpio_chip *chip, unsigned offset)
+{
+       pinctrl_free_gpio(chip->base + offset);
+
+       /* Set the GPIO as an input to ensure that the next GPIO request won't
+       * drive the GPIO pin as an output.
+       */
+       em_gio_direction_input(chip, offset);
+}
+
 static int em_gio_irq_domain_map(struct irq_domain *h, unsigned int virq,
                                 irq_hw_number_t hw)
 {
@@ -237,7 +253,7 @@ static struct irq_domain_ops em_gio_irq_domain_ops = {
 static int em_gio_probe(struct platform_device *pdev)
 {
        struct gpio_em_config pdata_dt;
-       struct gpio_em_config *pdata = pdev->dev.platform_data;
+       struct gpio_em_config *pdata = dev_get_platdata(&pdev->dev);
        struct em_gio_priv *p;
        struct resource *io[2], *irq[2];
        struct gpio_chip *gpio_chip;
@@ -308,6 +324,8 @@ static int em_gio_probe(struct platform_device *pdev)
        gpio_chip->direction_output = em_gio_direction_output;
        gpio_chip->set = em_gio_set;
        gpio_chip->to_irq = em_gio_to_irq;
+       gpio_chip->request = em_gio_request;
+       gpio_chip->free = em_gio_free;
        gpio_chip->label = name;
        gpio_chip->owner = THIS_MODULE;
        gpio_chip->base = pdata->gpio_base;
@@ -351,6 +369,13 @@ static int em_gio_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "failed to add GPIO controller\n");
                goto err1;
        }
+
+       if (pdata->pctl_name) {
+               ret = gpiochip_add_pin_range(gpio_chip, pdata->pctl_name, 0,
+                                            gpio_chip->base, gpio_chip->ngpio);
+               if (ret < 0)
+                       dev_warn(&pdev->dev, "failed to add pin range\n");
+       }
        return 0;
 
 err1:
diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c
new file mode 100644 (file)
index 0000000..9cb8320
--- /dev/null
@@ -0,0 +1,469 @@
+/*
+ * GPIO driver for Fintek Super-I/O F71882 and F71889
+ *
+ * Copyright (C) 2010-2013 LaCie
+ *
+ * Author: Simon Guinot <simon.guinot@sequanux.org>
+ *
+ * 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/module.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/gpio.h>
+
+#define DRVNAME "gpio-f7188x"
+
+/*
+ * Super-I/O registers
+ */
+#define SIO_LDSEL              0x07    /* Logical device select */
+#define SIO_DEVID              0x20    /* Device ID (2 bytes) */
+#define SIO_DEVREV             0x22    /* Device revision */
+#define SIO_MANID              0x23    /* Fintek ID (2 bytes) */
+
+#define SIO_LD_GPIO            0x06    /* GPIO logical device */
+#define SIO_UNLOCK_KEY         0x87    /* Key to enable Super-I/O */
+#define SIO_LOCK_KEY           0xAA    /* Key to disable Super-I/O */
+
+#define SIO_FINTEK_ID          0x1934  /* Manufacturer ID */
+#define SIO_F71882_ID          0x0541  /* F71882 chipset ID */
+#define SIO_F71889_ID          0x0909  /* F71889 chipset ID */
+
+enum chips { f71882fg, f71889f };
+
+static const char * const f7188x_names[] = {
+       "f71882fg",
+       "f71889f",
+};
+
+struct f7188x_sio {
+       int addr;
+       enum chips type;
+};
+
+struct f7188x_gpio_bank {
+       struct gpio_chip chip;
+       unsigned int regbase;
+       struct f7188x_gpio_data *data;
+};
+
+struct f7188x_gpio_data {
+       struct f7188x_sio *sio;
+       int nr_bank;
+       struct f7188x_gpio_bank *bank;
+};
+
+/*
+ * Super-I/O functions.
+ */
+
+static inline int superio_inb(int base, int reg)
+{
+       outb(reg, base);
+       return inb(base + 1);
+}
+
+static int superio_inw(int base, int reg)
+{
+       int val;
+
+       outb(reg++, base);
+       val = inb(base + 1) << 8;
+       outb(reg, base);
+       val |= inb(base + 1);
+
+       return val;
+}
+
+static inline void superio_outb(int base, int reg, int val)
+{
+       outb(reg, base);
+       outb(val, base + 1);
+}
+
+static inline int superio_enter(int base)
+{
+       /* Don't step on other drivers' I/O space by accident. */
+       if (!request_muxed_region(base, 2, DRVNAME)) {
+               pr_err(DRVNAME "I/O address 0x%04x already in use\n", base);
+               return -EBUSY;
+       }
+
+       /* According to the datasheet the key must be send twice. */
+       outb(SIO_UNLOCK_KEY, base);
+       outb(SIO_UNLOCK_KEY, base);
+
+       return 0;
+}
+
+static inline void superio_select(int base, int ld)
+{
+       outb(SIO_LDSEL, base);
+       outb(ld, base + 1);
+}
+
+static inline void superio_exit(int base)
+{
+       outb(SIO_LOCK_KEY, base);
+       release_region(base, 2);
+}
+
+/*
+ * GPIO chip.
+ */
+
+static int f7188x_gpio_direction_in(struct gpio_chip *chip, unsigned offset);
+static int f7188x_gpio_get(struct gpio_chip *chip, unsigned offset);
+static int f7188x_gpio_direction_out(struct gpio_chip *chip,
+                                    unsigned offset, int value);
+static void f7188x_gpio_set(struct gpio_chip *chip, unsigned offset, int value);
+
+#define F7188X_GPIO_BANK(_base, _ngpio, _regbase)                      \
+       {                                                               \
+               .chip = {                                               \
+                       .label            = DRVNAME,                    \
+                       .owner            = THIS_MODULE,                \
+                       .direction_input  = f7188x_gpio_direction_in,   \
+                       .get              = f7188x_gpio_get,            \
+                       .direction_output = f7188x_gpio_direction_out,  \
+                       .set              = f7188x_gpio_set,            \
+                       .base             = _base,                      \
+                       .ngpio            = _ngpio,                     \
+               },                                                      \
+               .regbase = _regbase,                                    \
+       }
+
+#define gpio_dir(base) (base + 0)
+#define gpio_data_out(base) (base + 1)
+#define gpio_data_in(base) (base + 2)
+/* Output mode register (0:open drain 1:push-pull). */
+#define gpio_out_mode(base) (base + 3)
+
+static struct f7188x_gpio_bank f71882_gpio_bank[] = {
+       F7188X_GPIO_BANK(0 , 8, 0xF0),
+       F7188X_GPIO_BANK(10, 8, 0xE0),
+       F7188X_GPIO_BANK(20, 8, 0xD0),
+       F7188X_GPIO_BANK(30, 4, 0xC0),
+       F7188X_GPIO_BANK(40, 4, 0xB0),
+};
+
+static struct f7188x_gpio_bank f71889_gpio_bank[] = {
+       F7188X_GPIO_BANK(0 , 7, 0xF0),
+       F7188X_GPIO_BANK(10, 7, 0xE0),
+       F7188X_GPIO_BANK(20, 8, 0xD0),
+       F7188X_GPIO_BANK(30, 8, 0xC0),
+       F7188X_GPIO_BANK(40, 8, 0xB0),
+       F7188X_GPIO_BANK(50, 5, 0xA0),
+       F7188X_GPIO_BANK(60, 8, 0x90),
+       F7188X_GPIO_BANK(70, 8, 0x80),
+};
+
+static int f7188x_gpio_direction_in(struct gpio_chip *chip, unsigned offset)
+{
+       int err;
+       struct f7188x_gpio_bank *bank =
+               container_of(chip, struct f7188x_gpio_bank, chip);
+       struct f7188x_sio *sio = bank->data->sio;
+       u8 dir;
+
+       err = superio_enter(sio->addr);
+       if (err)
+               return err;
+       superio_select(sio->addr, SIO_LD_GPIO);
+
+       dir = superio_inb(sio->addr, gpio_dir(bank->regbase));
+       dir &= ~(1 << offset);
+       superio_outb(sio->addr, gpio_dir(bank->regbase), dir);
+
+       superio_exit(sio->addr);
+
+       return 0;
+}
+
+static int f7188x_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       int err;
+       struct f7188x_gpio_bank *bank =
+               container_of(chip, struct f7188x_gpio_bank, chip);
+       struct f7188x_sio *sio = bank->data->sio;
+       u8 dir, data;
+
+       err = superio_enter(sio->addr);
+       if (err)
+               return err;
+       superio_select(sio->addr, SIO_LD_GPIO);
+
+       dir = superio_inb(sio->addr, gpio_dir(bank->regbase));
+       dir = !!(dir & (1 << offset));
+       if (dir)
+               data = superio_inb(sio->addr, gpio_data_out(bank->regbase));
+       else
+               data = superio_inb(sio->addr, gpio_data_in(bank->regbase));
+
+       superio_exit(sio->addr);
+
+       return !!(data & 1 << offset);
+}
+
+static int f7188x_gpio_direction_out(struct gpio_chip *chip,
+                                    unsigned offset, int value)
+{
+       int err;
+       struct f7188x_gpio_bank *bank =
+               container_of(chip, struct f7188x_gpio_bank, chip);
+       struct f7188x_sio *sio = bank->data->sio;
+       u8 dir, data_out;
+
+       err = superio_enter(sio->addr);
+       if (err)
+               return err;
+       superio_select(sio->addr, SIO_LD_GPIO);
+
+       data_out = superio_inb(sio->addr, gpio_data_out(bank->regbase));
+       if (value)
+               data_out |= (1 << offset);
+       else
+               data_out &= ~(1 << offset);
+       superio_outb(sio->addr, gpio_data_out(bank->regbase), data_out);
+
+       dir = superio_inb(sio->addr, gpio_dir(bank->regbase));
+       dir |= (1 << offset);
+       superio_outb(sio->addr, gpio_dir(bank->regbase), dir);
+
+       superio_exit(sio->addr);
+
+       return 0;
+}
+
+static void f7188x_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       int err;
+       struct f7188x_gpio_bank *bank =
+               container_of(chip, struct f7188x_gpio_bank, chip);
+       struct f7188x_sio *sio = bank->data->sio;
+       u8 data_out;
+
+       err = superio_enter(sio->addr);
+       if (err)
+               return;
+       superio_select(sio->addr, SIO_LD_GPIO);
+
+       data_out = superio_inb(sio->addr, gpio_data_out(bank->regbase));
+       if (value)
+               data_out |= (1 << offset);
+       else
+               data_out &= ~(1 << offset);
+       superio_outb(sio->addr, gpio_data_out(bank->regbase), data_out);
+
+       superio_exit(sio->addr);
+}
+
+/*
+ * Platform device and driver.
+ */
+
+static int f7188x_gpio_probe(struct platform_device *pdev)
+{
+       int err;
+       int i;
+       struct f7188x_sio *sio = pdev->dev.platform_data;
+       struct f7188x_gpio_data *data;
+
+       data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+
+       switch (sio->type) {
+       case f71882fg:
+               data->nr_bank = ARRAY_SIZE(f71882_gpio_bank);
+               data->bank = f71882_gpio_bank;
+               break;
+       case f71889f:
+               data->nr_bank = ARRAY_SIZE(f71889_gpio_bank);
+               data->bank = f71889_gpio_bank;
+               break;
+       default:
+               return -ENODEV;
+       }
+       data->sio = sio;
+
+       platform_set_drvdata(pdev, data);
+
+       /* For each GPIO bank, register a GPIO chip. */
+       for (i = 0; i < data->nr_bank; i++) {
+               struct f7188x_gpio_bank *bank = &data->bank[i];
+
+               bank->chip.dev = &pdev->dev;
+               bank->data = data;
+
+               err = gpiochip_add(&bank->chip);
+               if (err) {
+                       dev_err(&pdev->dev,
+                               "Failed to register gpiochip %d: %d\n",
+                               i, err);
+                       goto err_gpiochip;
+               }
+       }
+
+       return 0;
+
+err_gpiochip:
+       for (i = i - 1; i >= 0; i--) {
+               struct f7188x_gpio_bank *bank = &data->bank[i];
+               int tmp;
+
+               tmp = gpiochip_remove(&bank->chip);
+               if (tmp < 0)
+                       dev_err(&pdev->dev,
+                               "Failed to remove gpiochip %d: %d\n",
+                               i, tmp);
+       }
+
+       return err;
+}
+
+static int f7188x_gpio_remove(struct platform_device *pdev)
+{
+       int err;
+       int i;
+       struct f7188x_gpio_data *data = platform_get_drvdata(pdev);
+
+       for (i = 0; i < data->nr_bank; i++) {
+               struct f7188x_gpio_bank *bank = &data->bank[i];
+
+               err = gpiochip_remove(&bank->chip);
+               if (err) {
+                       dev_err(&pdev->dev,
+                               "Failed to remove GPIO gpiochip %d: %d\n",
+                               i, err);
+                       return err;
+               }
+       }
+
+       return 0;
+}
+
+static int __init f7188x_find(int addr, struct f7188x_sio *sio)
+{
+       int err;
+       u16 devid;
+
+       err = superio_enter(addr);
+       if (err)
+               return err;
+
+       err = -ENODEV;
+       devid = superio_inw(addr, SIO_MANID);
+       if (devid != SIO_FINTEK_ID) {
+               pr_debug(DRVNAME ": Not a Fintek device at 0x%08x\n", addr);
+               goto err;
+       }
+
+       devid = superio_inw(addr, SIO_DEVID);
+       switch (devid) {
+       case SIO_F71882_ID:
+               sio->type = f71882fg;
+               break;
+       case SIO_F71889_ID:
+               sio->type = f71889f;
+               break;
+       default:
+               pr_info(DRVNAME ": Unsupported Fintek device 0x%04x\n", devid);
+               goto err;
+       }
+       sio->addr = addr;
+       err = 0;
+
+       pr_info(DRVNAME ": Found %s at %#x, revision %d\n",
+               f7188x_names[sio->type],
+               (unsigned int) addr,
+               (int) superio_inb(addr, SIO_DEVREV));
+
+err:
+       superio_exit(addr);
+       return err;
+}
+
+static struct platform_device *f7188x_gpio_pdev;
+
+static int __init
+f7188x_gpio_device_add(const struct f7188x_sio *sio)
+{
+       int err;
+
+       f7188x_gpio_pdev = platform_device_alloc(DRVNAME, -1);
+       if (!f7188x_gpio_pdev)
+               return -ENOMEM;
+
+       err = platform_device_add_data(f7188x_gpio_pdev,
+                                      sio, sizeof(*sio));
+       if (err) {
+               pr_err(DRVNAME "Platform data allocation failed\n");
+               goto err;
+       }
+
+       err = platform_device_add(f7188x_gpio_pdev);
+       if (err) {
+               pr_err(DRVNAME "Device addition failed\n");
+               goto err;
+       }
+
+       return 0;
+
+err:
+       platform_device_put(f7188x_gpio_pdev);
+
+       return err;
+}
+
+/*
+ * Try to match a supported Fintech device by reading the (hard-wired)
+ * configuration I/O ports. If available, then register both the platform
+ * device and driver to support the GPIOs.
+ */
+
+static struct platform_driver f7188x_gpio_driver = {
+       .driver = {
+               .owner  = THIS_MODULE,
+               .name   = DRVNAME,
+       },
+       .probe          = f7188x_gpio_probe,
+       .remove         = f7188x_gpio_remove,
+};
+
+static int __init f7188x_gpio_init(void)
+{
+       int err;
+       struct f7188x_sio sio;
+
+       if (f7188x_find(0x2e, &sio) &&
+           f7188x_find(0x4e, &sio))
+               return -ENODEV;
+
+       err = platform_driver_register(&f7188x_gpio_driver);
+       if (!err) {
+               err = f7188x_gpio_device_add(&sio);
+               if (err)
+                       platform_driver_unregister(&f7188x_gpio_driver);
+       }
+
+       return err;
+}
+subsys_initcall(f7188x_gpio_init);
+
+static void __exit f7188x_gpio_exit(void)
+{
+       platform_device_unregister(f7188x_gpio_pdev);
+       platform_driver_unregister(&f7188x_gpio_driver);
+}
+module_exit(f7188x_gpio_exit);
+
+MODULE_DESCRIPTION("GPIO driver for Super-I/O chips F71882FG and F71889F");
+MODULE_AUTHOR("Simon Guinot <simon.guinot@sequanux.org>");
+MODULE_LICENSE("GPL");
index 2729e3d..814addb 100644 (file)
@@ -354,7 +354,7 @@ static int ichx_gpio_probe(struct platform_device *pdev)
 {
        struct resource *res_base, *res_pm;
        int err;
-       struct lpc_ich_info *ich_info = pdev->dev.platform_data;
+       struct lpc_ich_info *ich_info = dev_get_platdata(&pdev->dev);
 
        if (!ich_info)
                return -ENODEV;
index 7d0a041..2ecd3a0 100644 (file)
@@ -149,7 +149,7 @@ static int ttl_probe(struct platform_device *pdev)
        struct resource *res;
        int ret;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                dev_err(dev, "no platform data\n");
                ret = -ENXIO;
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
new file mode 100644 (file)
index 0000000..efdc392
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * Kontron PLD GPIO driver
+ *
+ * Copyright (c) 2010-2013 Kontron Europe GmbH
+ * Author: Michael Brunner <michael.brunner@kontron.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License 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/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/bitops.h>
+#include <linux/errno.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/mfd/kempld.h>
+
+#define KEMPLD_GPIO_MAX_NUM            16
+#define KEMPLD_GPIO_MASK(x)            (1 << ((x) % 8))
+#define KEMPLD_GPIO_DIR_NUM(x)         (0x40 + (x) / 8)
+#define KEMPLD_GPIO_LVL_NUM(x)         (0x42 + (x) / 8)
+#define KEMPLD_GPIO_EVT_LVL_EDGE       0x46
+#define KEMPLD_GPIO_IEN                        0x4A
+
+struct kempld_gpio_data {
+       struct gpio_chip                chip;
+       struct kempld_device_data       *pld;
+};
+
+/*
+ * Set or clear GPIO bit
+ * kempld_get_mutex must be called prior to calling this function.
+ */
+static void kempld_gpio_bitop(struct kempld_device_data *pld,
+                             u8 reg, u8 bit, u8 val)
+{
+       u8 status;
+
+       status = kempld_read8(pld, reg);
+       if (val)
+               status |= KEMPLD_GPIO_MASK(bit);
+       else
+               status &= ~KEMPLD_GPIO_MASK(bit);
+       kempld_write8(pld, reg, status);
+}
+
+static int kempld_gpio_get_bit(struct kempld_device_data *pld, u8 reg, u8 bit)
+{
+       u8 status;
+
+       kempld_get_mutex(pld);
+       status = kempld_read8(pld, reg);
+       kempld_release_mutex(pld);
+
+       return !!(status & KEMPLD_GPIO_MASK(bit));
+}
+
+static int kempld_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       struct kempld_gpio_data *gpio
+               = container_of(chip, struct kempld_gpio_data, chip);
+       struct kempld_device_data *pld = gpio->pld;
+
+       return kempld_gpio_get_bit(pld, KEMPLD_GPIO_LVL_NUM(offset), offset);
+}
+
+static void kempld_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       struct kempld_gpio_data *gpio
+               = container_of(chip, struct kempld_gpio_data, chip);
+       struct kempld_device_data *pld = gpio->pld;
+
+       kempld_get_mutex(pld);
+       kempld_gpio_bitop(pld, KEMPLD_GPIO_LVL_NUM(offset), offset, value);
+       kempld_release_mutex(pld);
+}
+
+static int kempld_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
+{
+       struct kempld_gpio_data *gpio
+               = container_of(chip, struct kempld_gpio_data, chip);
+       struct kempld_device_data *pld = gpio->pld;
+
+       kempld_get_mutex(pld);
+       kempld_gpio_bitop(pld, KEMPLD_GPIO_DIR_NUM(offset), offset, 0);
+       kempld_release_mutex(pld);
+
+       return 0;
+}
+
+static int kempld_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
+                                       int value)
+{
+       struct kempld_gpio_data *gpio
+               = container_of(chip, struct kempld_gpio_data, chip);
+       struct kempld_device_data *pld = gpio->pld;
+
+       kempld_get_mutex(pld);
+       kempld_gpio_bitop(pld, KEMPLD_GPIO_LVL_NUM(offset), offset, value);
+       kempld_gpio_bitop(pld, KEMPLD_GPIO_DIR_NUM(offset), offset, 1);
+       kempld_release_mutex(pld);
+
+       return 0;
+}
+
+static int kempld_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
+{
+       struct kempld_gpio_data *gpio
+               = container_of(chip, struct kempld_gpio_data, chip);
+       struct kempld_device_data *pld = gpio->pld;
+
+       return kempld_gpio_get_bit(pld, KEMPLD_GPIO_DIR_NUM(offset), offset);
+}
+
+static int kempld_gpio_pincount(struct kempld_device_data *pld)
+{
+       u16 evt, evt_back;
+
+       kempld_get_mutex(pld);
+
+       /* Backup event register as it might be already initialized */
+       evt_back = kempld_read16(pld, KEMPLD_GPIO_EVT_LVL_EDGE);
+       /* Clear event register */
+       kempld_write16(pld, KEMPLD_GPIO_EVT_LVL_EDGE, 0x0000);
+       /* Read back event register */
+       evt = kempld_read16(pld, KEMPLD_GPIO_EVT_LVL_EDGE);
+       /* Restore event register */
+       kempld_write16(pld, KEMPLD_GPIO_EVT_LVL_EDGE, evt_back);
+
+       kempld_release_mutex(pld);
+
+       return evt ? __ffs(evt) : 16;
+}
+
+static int kempld_gpio_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct kempld_device_data *pld = dev_get_drvdata(dev->parent);
+       struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
+       struct kempld_gpio_data *gpio;
+       struct gpio_chip *chip;
+       int ret;
+
+       if (pld->info.spec_major < 2) {
+               dev_err(dev,
+                       "Driver only supports GPIO devices compatible to PLD spec. rev. 2.0 or higher\n");
+               return -ENODEV;
+       }
+
+       gpio = devm_kzalloc(dev, sizeof(*gpio), GFP_KERNEL);
+       if (gpio == NULL)
+               return -ENOMEM;
+
+       gpio->pld = pld;
+
+       platform_set_drvdata(pdev, gpio);
+
+       chip = &gpio->chip;
+       chip->label = "gpio-kempld";
+       chip->owner = THIS_MODULE;
+       chip->dev = dev;
+       chip->can_sleep = 1;
+       if (pdata && pdata->gpio_base)
+               chip->base = pdata->gpio_base;
+       else
+               chip->base = -1;
+       chip->direction_input = kempld_gpio_direction_input;
+       chip->direction_output = kempld_gpio_direction_output;
+       chip->get_direction = kempld_gpio_get_direction;
+       chip->get = kempld_gpio_get;
+       chip->set = kempld_gpio_set;
+       chip->ngpio = kempld_gpio_pincount(pld);
+       if (chip->ngpio == 0) {
+               dev_err(dev, "No GPIO pins detected\n");
+               return -ENODEV;
+       }
+
+       ret = gpiochip_add(chip);
+       if (ret) {
+               dev_err(dev, "Could not register GPIO chip\n");
+               return ret;
+       }
+
+       dev_info(dev, "GPIO functionality initialized with %d pins\n",
+                chip->ngpio);
+
+       return 0;
+}
+
+static int kempld_gpio_remove(struct platform_device *pdev)
+{
+       struct kempld_gpio_data *gpio = platform_get_drvdata(pdev);
+
+       return gpiochip_remove(&gpio->chip);
+}
+
+static struct platform_driver kempld_gpio_driver = {
+       .driver = {
+               .name = "kempld-gpio",
+               .owner = THIS_MODULE,
+       },
+       .probe          = kempld_gpio_probe,
+       .remove         = kempld_gpio_remove,
+};
+
+module_platform_driver(kempld_gpio_driver);
+
+MODULE_DESCRIPTION("KEM PLD GPIO Driver");
+MODULE_AUTHOR("Michael Brunner <michael.brunner@kontron.com>");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:gpio-kempld");
index 761c470..2d9ca60 100644 (file)
@@ -444,6 +444,7 @@ static int lp_gpio_remove(struct platform_device *pdev)
 {
        struct lp_gpio *lg = platform_get_drvdata(pdev);
        int err;
+       pm_runtime_disable(&pdev->dev);
        err = gpiochip_remove(&lg->chip);
        if (err)
                dev_warn(&pdev->dev, "failed to remove gpio_chip.\n");
index 3b16ab7..6e1c984 100644 (file)
@@ -56,8 +56,7 @@ static int max7301_probe(struct spi_device *spi)
        int ret;
 
        /* bits_per_word cannot be configured in platform data */
-       if (spi->dev.platform_data)
-               spi->bits_per_word = 16;
+       spi->bits_per_word = 16;
        ret = spi_setup(spi);
        if (ret < 0)
                return ret;
index 0009234..f4f4ed1 100644 (file)
@@ -166,7 +166,7 @@ int __max730x_probe(struct max7301 *ts)
        struct max7301_platform_data *pdata;
        int i, ret;
 
-       pdata = dev->platform_data;
+       pdata = dev_get_platdata(dev);
 
        mutex_init(&ts->lock);
        dev_set_drvdata(dev, ts);
index d4b51b1..91ad74d 100644 (file)
@@ -453,7 +453,7 @@ static int max732x_irq_setup(struct max732x_chip *chip,
                             const struct i2c_device_id *id)
 {
        struct i2c_client *client = chip->client;
-       struct max732x_platform_data *pdata = client->dev.platform_data;
+       struct max732x_platform_data *pdata = dev_get_platdata(&client->dev);
        int has_irq = max732x_features[id->driver_data] >> 32;
        int ret;
 
@@ -512,7 +512,7 @@ static int max732x_irq_setup(struct max732x_chip *chip,
                             const struct i2c_device_id *id)
 {
        struct i2c_client *client = chip->client;
-       struct max732x_platform_data *pdata = client->dev.platform_data;
+       struct max732x_platform_data *pdata = dev_get_platdata(&client->dev);
        int has_irq = max732x_features[id->driver_data] >> 32;
 
        if (pdata->irq_base && has_irq != INT_NONE)
@@ -583,7 +583,7 @@ static int max732x_probe(struct i2c_client *client,
        uint16_t addr_a, addr_b;
        int ret, nr_port;
 
-       pdata = client->dev.platform_data;
+       pdata = dev_get_platdata(&client->dev);
        if (pdata == NULL) {
                dev_dbg(&client->dev, "no platform data\n");
                return -EINVAL;
@@ -653,7 +653,7 @@ out_failed:
 
 static int max732x_remove(struct i2c_client *client)
 {
-       struct max732x_platform_data *pdata = client->dev.platform_data;
+       struct max732x_platform_data *pdata = dev_get_platdata(&client->dev);
        struct max732x_chip *chip = i2c_get_clientdata(client);
        int ret;
 
index 63a7a1b..3fd2caa 100644 (file)
@@ -86,7 +86,7 @@ static int mc33880_probe(struct spi_device *spi)
        struct mc33880_platform_data *pdata;
        int ret;
 
-       pdata = spi->dev.platform_data;
+       pdata = dev_get_platdata(&spi->dev);
        if (!pdata || !pdata->base) {
                dev_dbg(&spi->dev, "incorrect or missing platform data\n");
                return -EINVAL;
index 6a4470b..2deb0c5 100644 (file)
@@ -483,10 +483,21 @@ fail:
 #ifdef CONFIG_SPI_MASTER
 static struct of_device_id mcp23s08_spi_of_match[] = {
        {
-               .compatible = "mcp,mcp23s08", .data = (void *) MCP_TYPE_S08,
+               .compatible = "microchip,mcp23s08",
+               .data = (void *) MCP_TYPE_S08,
        },
        {
-               .compatible = "mcp,mcp23s17", .data = (void *) MCP_TYPE_S17,
+               .compatible = "microchip,mcp23s17",
+               .data = (void *) MCP_TYPE_S17,
+       },
+/* NOTE: The use of the mcp prefix is deprecated and will be removed. */
+       {
+               .compatible = "mcp,mcp23s08",
+               .data = (void *) MCP_TYPE_S08,
+       },
+       {
+               .compatible = "mcp,mcp23s17",
+               .data = (void *) MCP_TYPE_S17,
        },
        { },
 };
@@ -496,10 +507,21 @@ MODULE_DEVICE_TABLE(of, mcp23s08_spi_of_match);
 #if IS_ENABLED(CONFIG_I2C)
 static struct of_device_id mcp23s08_i2c_of_match[] = {
        {
-               .compatible = "mcp,mcp23008", .data = (void *) MCP_TYPE_008,
+               .compatible = "microchip,mcp23008",
+               .data = (void *) MCP_TYPE_008,
+       },
+       {
+               .compatible = "microchip,mcp23017",
+               .data = (void *) MCP_TYPE_017,
+       },
+/* NOTE: The use of the mcp prefix is deprecated and will be removed. */
+       {
+               .compatible = "mcp,mcp23008",
+               .data = (void *) MCP_TYPE_008,
        },
        {
-               .compatible = "mcp,mcp23017", .data = (void *) MCP_TYPE_017,
+               .compatible = "mcp,mcp23017",
+               .data = (void *) MCP_TYPE_017,
        },
        { },
 };
@@ -520,14 +542,13 @@ static int mcp230xx_probe(struct i2c_client *client,
 
        match = of_match_device(of_match_ptr(mcp23s08_i2c_of_match),
                                        &client->dev);
-       if (match) {
+       pdata = dev_get_platdata(&client->dev);
+       if (match || !pdata) {
                base = -1;
                pullups = 0;
        } else {
-               pdata = client->dev.platform_data;
-               if (!pdata || !gpio_is_valid(pdata->base)) {
-                       dev_dbg(&client->dev,
-                                       "invalid or missing platform data\n");
+               if (!gpio_is_valid(pdata->base)) {
+                       dev_dbg(&client->dev, "invalid platform data\n");
                        return -EINVAL;
                }
                base = pdata->base;
@@ -621,10 +642,15 @@ static int mcp23s08_probe(struct spi_device *spi)
        if (match) {
                type = (int)match->data;
                status = of_property_read_u32(spi->dev.of_node,
-                               "mcp,spi-present-mask", &spi_present_mask);
+                           "microchip,spi-present-mask", &spi_present_mask);
                if (status) {
-                       dev_err(&spi->dev, "DT has no spi-present-mask\n");
-                       return -ENODEV;
+                       status = of_property_read_u32(spi->dev.of_node,
+                                   "mcp,spi-present-mask", &spi_present_mask);
+                       if (status) {
+                               dev_err(&spi->dev,
+                                       "DT has no spi-present-mask\n");
+                               return -ENODEV;
+                       }
                }
                if ((spi_present_mask <= 0) || (spi_present_mask >= 256)) {
                        dev_err(&spi->dev, "invalid spi-present-mask\n");
@@ -635,7 +661,7 @@ static int mcp23s08_probe(struct spi_device *spi)
                        pullups[addr] = 0;
        } else {
                type = spi_get_device_id(spi)->driver_data;
-               pdata = spi->dev.platform_data;
+               pdata = dev_get_platdata(&spi->dev);
                if (!pdata || !gpio_is_valid(pdata->base)) {
                        dev_dbg(&spi->dev,
                                        "invalid or missing platform data\n");
index 27ea7b9..d75eaa3 100644 (file)
@@ -259,7 +259,7 @@ static void msic_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
 static int platform_msic_gpio_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct intel_msic_gpio_pdata *pdata = dev->platform_data;
+       struct intel_msic_gpio_pdata *pdata = dev_get_platdata(dev);
        struct msic_gpio *mg;
        int irq = platform_get_irq(pdev, 0);
        int retval;
index c2fa770..f7a0cc4 100644 (file)
@@ -106,7 +106,7 @@ struct msm_gpio_dev {
        void __iomem *msm_tlmm_base;
 };
 
-struct msm_gpio_dev msm_gpio;
+static struct msm_gpio_dev msm_gpio;
 
 #define GPIO_INTR_CFG_SU(gpio)    (msm_gpio.msm_tlmm_base + 0x0400 + \
                                                                (0x04 * (gpio)))
index 80ad35e..3c3321f 100644 (file)
@@ -566,12 +566,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
        else
                soc_variant = MVEBU_GPIO_SOC_VARIANT_ORION;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "Cannot get memory resource\n");
-               return -ENODEV;
-       }
-
        mvchip = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_gpio_chip), GFP_KERNEL);
        if (!mvchip) {
                dev_err(&pdev->dev, "Cannot allocate memory\n");
@@ -611,6 +605,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
        mvchip->chip.dbg_show = mvebu_gpio_dbg_show;
 
        spin_lock_init(&mvchip->lock);
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        mvchip->membase = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(mvchip->membase))
                return PTR_ERR(mvchip->membase);
index 7176743..3307f6d 100644 (file)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+#include <linux/err.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
@@ -291,6 +292,9 @@ static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
 {
        u32 irq_msk, irq_stat;
        struct mxc_gpio_port *port;
+       struct irq_chip *chip = irq_get_chip(irq);
+
+       chained_irq_enter(chip, desc);
 
        /* walk through all interrupt status registers */
        list_for_each_entry(port, &mxc_gpio_ports, node) {
@@ -302,6 +306,7 @@ static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
                if (irq_stat)
                        mxc_gpio_irq_handler(port, irq_stat);
        }
+       chained_irq_exit(chip, desc);
 }
 
 /*
@@ -405,34 +410,19 @@ static int mxc_gpio_probe(struct platform_device *pdev)
 
        mxc_gpio_get_hw(pdev);
 
-       port = kzalloc(sizeof(struct mxc_gpio_port), GFP_KERNEL);
+       port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL);
        if (!port)
                return -ENOMEM;
 
        iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!iores) {
-               err = -ENODEV;
-               goto out_kfree;
-       }
-
-       if (!request_mem_region(iores->start, resource_size(iores),
-                               pdev->name)) {
-               err = -EBUSY;
-               goto out_kfree;
-       }
-
-       port->base = ioremap(iores->start, resource_size(iores));
-       if (!port->base) {
-               err = -ENOMEM;
-               goto out_release_mem;
-       }
+       port->base = devm_ioremap_resource(&pdev->dev, iores);
+       if (IS_ERR(port->base))
+               return PTR_ERR(port->base);
 
        port->irq_high = platform_get_irq(pdev, 1);
        port->irq = platform_get_irq(pdev, 0);
-       if (port->irq < 0) {
-               err = -EINVAL;
-               goto out_iounmap;
-       }
+       if (port->irq < 0)
+               return -EINVAL;
 
        /* disable the interrupt and clear the status */
        writel(0, port->base + GPIO_IMR);
@@ -462,7 +452,7 @@ static int mxc_gpio_probe(struct platform_device *pdev)
                         port->base + GPIO_DR, NULL,
                         port->base + GPIO_GDIR, NULL, 0);
        if (err)
-               goto out_iounmap;
+               goto out_bgio;
 
        port->bgc.gc.to_irq = mxc_gpio_to_irq;
        port->bgc.gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
@@ -498,12 +488,7 @@ out_gpiochip_remove:
        WARN_ON(gpiochip_remove(&port->bgc.gc) < 0);
 out_bgpio_remove:
        bgpio_remove(&port->bgc);
-out_iounmap:
-       iounmap(port->base);
-out_release_mem:
-       release_mem_region(iores->start, resource_size(iores));
-out_kfree:
-       kfree(port);
+out_bgio:
        dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
        return err;
 }
index dfeb3a3..0ff4355 100644 (file)
@@ -1030,7 +1030,7 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
        ct->chip.irq_set_type = gpio_irq_type;
 
        if (bank->regs->wkup_en)
-               ct->chip.irq_set_wake = gpio_wake_enable,
+               ct->chip.irq_set_wake = gpio_wake_enable;
 
        ct->regs.mask = OMAP_MPUIO_GPIO_INT / bank->stride;
        irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
@@ -1100,7 +1100,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
 
        match = of_match_device(of_match_ptr(omap_gpio_match), dev);
 
-       pdata = match ? match->data : dev->platform_data;
+       pdata = match ? match->data : dev_get_platdata(dev);
        if (!pdata)
                return -EINVAL;
 
index e3a4e56..8588af0 100644 (file)
@@ -43,9 +43,22 @@ static int palmas_gpio_get(struct gpio_chip *gc, unsigned offset)
        unsigned int val;
        int ret;
 
-       ret = palmas_read(palmas, PALMAS_GPIO_BASE, PALMAS_GPIO_DATA_IN, &val);
+       ret = palmas_read(palmas, PALMAS_GPIO_BASE, PALMAS_GPIO_DATA_DIR, &val);
        if (ret < 0) {
-               dev_err(gc->dev, "GPIO_DATA_IN read failed, err = %d\n", ret);
+               dev_err(gc->dev, "GPIO_DATA_DIR read failed, err = %d\n", ret);
+               return ret;
+       }
+
+       if (val & (1 << offset)) {
+               ret = palmas_read(palmas, PALMAS_GPIO_BASE,
+                                 PALMAS_GPIO_DATA_OUT, &val);
+       } else {
+               ret = palmas_read(palmas, PALMAS_GPIO_BASE,
+                                 PALMAS_GPIO_DATA_IN, &val);
+       }
+       if (ret < 0) {
+               dev_err(gc->dev, "GPIO_DATA_IN/OUT read failed, err = %d\n",
+                       ret);
                return ret;
        }
        return !!(val & BIT(offset));
@@ -134,7 +147,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
        palmas_gpio->gpio_chip.get      = palmas_gpio_get;
        palmas_gpio->gpio_chip.dev = &pdev->dev;
 #ifdef CONFIG_OF_GPIO
-       palmas_gpio->gpio_chip.of_node = palmas->dev->of_node;
+       palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
 #endif
        palmas_pdata = dev_get_platdata(palmas->dev);
        if (palmas_pdata && palmas_pdata->gpio_base)
@@ -159,9 +172,19 @@ static int palmas_gpio_remove(struct platform_device *pdev)
        return gpiochip_remove(&palmas_gpio->gpio_chip);
 }
 
+static struct of_device_id of_palmas_gpio_match[] = {
+       { .compatible = "ti,palmas-gpio"},
+       { .compatible = "ti,tps65913-gpio"},
+       { .compatible = "ti,tps65914-gpio"},
+       { .compatible = "ti,tps80036-gpio"},
+       { },
+};
+MODULE_DEVICE_TABLE(of, of_palmas_gpio_match);
+
 static struct platform_driver palmas_gpio_driver = {
        .driver.name    = "palmas-gpio",
        .driver.owner   = THIS_MODULE,
+       .driver.of_match_table = of_palmas_gpio_match,
        .probe          = palmas_gpio_probe,
        .remove         = palmas_gpio_remove,
 };
index 426c51d..cdd1aa1 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/i2c.h>
-#include <linux/i2c/pca953x.h>
+#include <linux/platform_data/pca953x.h>
 #include <linux/slab.h>
 #ifdef CONFIG_OF_GPIO
 #include <linux/of_platform.h>
@@ -308,7 +308,7 @@ static int pca953x_gpio_get_value(struct gpio_chip *gc, unsigned off)
                return 0;
        }
 
-       return (reg_val & (1u << off)) ? 1 : 0;
+       return (reg_val & (1u << (off % BANK_SZ))) ? 1 : 0;
 }
 
 static void pca953x_gpio_set_value(struct gpio_chip *gc, unsigned off, int val)
@@ -731,7 +731,7 @@ static int pca953x_probe(struct i2c_client *client,
        if (chip == NULL)
                return -ENOMEM;
 
-       pdata = client->dev.platform_data;
+       pdata = dev_get_platdata(&client->dev);
        if (pdata) {
                irq_base = pdata->irq_base;
                chip->gpio_start = pdata->gpio_base;
@@ -785,7 +785,7 @@ static int pca953x_probe(struct i2c_client *client,
 
 static int pca953x_remove(struct i2c_client *client)
 {
-       struct pca953x_platform_data *pdata = client->dev.platform_data;
+       struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev);
        struct pca953x_chip *chip = i2c_get_clientdata(client);
        int ret = 0;
 
index e8faf53..9e61bb0 100644 (file)
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/kernel.h>
-#include <linux/slab.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pcf857x.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
 
@@ -223,7 +223,6 @@ static void pcf857x_irq_domain_cleanup(struct pcf857x *gpio)
 }
 
 static int pcf857x_irq_domain_init(struct pcf857x *gpio,
-                                  struct pcf857x_platform_data *pdata,
                                   struct i2c_client *client)
 {
        int status;
@@ -262,7 +261,7 @@ static int pcf857x_probe(struct i2c_client *client,
        struct pcf857x                  *gpio;
        int                             status;
 
-       pdata = client->dev.platform_data;
+       pdata = dev_get_platdata(&client->dev);
        if (!pdata) {
                dev_dbg(&client->dev, "no platform data\n");
        }
@@ -286,8 +285,8 @@ static int pcf857x_probe(struct i2c_client *client,
        gpio->chip.ngpio                = id->driver_data;
 
        /* enable gpio_to_irq() if platform has settings */
-       if (pdata && client->irq) {
-               status = pcf857x_irq_domain_init(gpio, pdata, client);
+       if (client->irq) {
+               status = pcf857x_irq_domain_init(gpio, client);
                if (status < 0) {
                        dev_err(&client->dev, "irq_domain init failed\n");
                        goto fail;
@@ -388,7 +387,7 @@ fail:
        dev_dbg(&client->dev, "probe error %d for '%s'\n",
                        status, client->name);
 
-       if (pdata && client->irq)
+       if (client->irq)
                pcf857x_irq_domain_cleanup(gpio);
 
        return status;
@@ -396,7 +395,7 @@ fail:
 
 static int pcf857x_remove(struct i2c_client *client)
 {
-       struct pcf857x_platform_data    *pdata = client->dev.platform_data;
+       struct pcf857x_platform_data    *pdata = dev_get_platdata(&client->dev);
        struct pcf857x                  *gpio = i2c_get_clientdata(client);
        int                             status = 0;
 
@@ -411,7 +410,7 @@ static int pcf857x_remove(struct i2c_client *client)
                }
        }
 
-       if (pdata && client->irq)
+       if (client->irq)
                pcf857x_irq_domain_cleanup(gpio);
 
        status = gpiochip_remove(&gpio->chip);
index 6a4bd0d..4274e2e 100644 (file)
@@ -259,7 +259,7 @@ static const struct irq_domain_ops pl061_domain_ops = {
 static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
 {
        struct device *dev = &adev->dev;
-       struct pl061_platform_data *pdata = dev->platform_data;
+       struct pl061_platform_data *pdata = dev_get_platdata(dev);
        struct pl061_gpio *chip;
        int ret, irq, i, irq_base;
 
index df2199d..cc13d1b 100644 (file)
@@ -524,8 +524,8 @@ const struct irq_domain_ops pxa_irq_domain_ops = {
 
 static int pxa_gpio_probe_dt(struct platform_device *pdev)
 {
-       int ret, nr_gpios;
-       struct device_node *prev, *next, *np = pdev->dev.of_node;
+       int ret = 0, nr_gpios;
+       struct device_node *np = pdev->dev.of_node;
        const struct of_device_id *of_id =
                                of_match_device(pxa_gpio_dt_ids, &pdev->dev);
        const struct pxa_gpio_id *gpio_id;
@@ -537,20 +537,13 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev)
        gpio_id = of_id->data;
        gpio_type = gpio_id->type;
 
-       next = of_get_next_child(np, NULL);
-       prev = next;
-       if (!next) {
-               dev_err(&pdev->dev, "Failed to find child gpio node\n");
-               ret = -EINVAL;
-               goto err;
-       }
-       of_node_put(prev);
        nr_gpios = gpio_id->gpio_nums;
        pxa_last_gpio = nr_gpios - 1;
 
        irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0);
        if (irq_base < 0) {
                dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
+               ret = irq_base;
                goto err;
        }
        domain = irq_domain_add_legacy(np, nr_gpios, irq_base, 0,
index e8198dd..e3745eb 100644 (file)
@@ -285,7 +285,7 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = {
 
 static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
 {
-       struct gpio_rcar_config *pdata = p->pdev->dev.platform_data;
+       struct gpio_rcar_config *pdata = dev_get_platdata(&p->pdev->dev);
        struct device_node *np = p->pdev->dev.of_node;
        struct of_phandle_args args;
        int ret;
index 368c3c0..88577c3 100644 (file)
@@ -135,7 +135,7 @@ static int rdc321x_gpio_probe(struct platform_device *pdev)
        struct rdc321x_gpio *rdc321x_gpio_dev;
        struct rdc321x_gpio_pdata *pdata;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                dev_err(&pdev->dev, "no platform data supplied\n");
                return -ENODEV;
index a1392f4..358a21c 100644 (file)
@@ -161,28 +161,6 @@ int s3c24xx_gpio_setpull_1down(struct samsung_gpio_chip *chip,
        return s3c24xx_gpio_setpull_1(chip, off, pull, S3C_GPIO_PULL_DOWN);
 }
 
-static int exynos_gpio_setpull(struct samsung_gpio_chip *chip,
-                               unsigned int off, samsung_gpio_pull_t pull)
-{
-       if (pull == S3C_GPIO_PULL_UP)
-               pull = 3;
-
-       return samsung_gpio_setpull_updown(chip, off, pull);
-}
-
-static samsung_gpio_pull_t exynos_gpio_getpull(struct samsung_gpio_chip *chip,
-                                               unsigned int off)
-{
-       samsung_gpio_pull_t pull;
-
-       pull = samsung_gpio_getpull_updown(chip, off);
-
-       if (pull == 3)
-               pull = S3C_GPIO_PULL_UP;
-
-       return pull;
-}
-
 /*
  * samsung_gpio_setcfg_2bit - Samsung 2bit style GPIO configuration.
  * @chip: The gpio chip that is being configured.
@@ -444,15 +422,6 @@ static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = {
 };
 #endif
 
-#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_SOC_EXYNOS5250)
-static struct samsung_gpio_cfg exynos_gpio_cfg = {
-       .set_pull       = exynos_gpio_setpull,
-       .get_pull       = exynos_gpio_getpull,
-       .set_config     = samsung_gpio_setcfg_4bit,
-       .get_config     = samsung_gpio_getcfg_4bit,
-};
-#endif
-
 #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450)
 static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = {
        .cfg_eint       = 0x3,
@@ -495,15 +464,6 @@ static struct samsung_gpio_cfg samsung_gpio_cfgs[] = {
                .set_config     = samsung_gpio_setcfg_2bit,
                .get_config     = samsung_gpio_getcfg_2bit,
        },
-       [8] = {
-               .set_pull       = exynos_gpio_setpull,
-               .get_pull       = exynos_gpio_getpull,
-       },
-       [9] = {
-               .cfg_eint       = 0x3,
-               .set_pull       = exynos_gpio_setpull,
-               .get_pull       = exynos_gpio_getpull,
-       }
 };
 
 /*
@@ -2115,833 +2075,6 @@ static struct samsung_gpio_chip s5pv210_gpios_4bit[] = {
 #endif
 };
 
-/*
- * Followings are the gpio banks in EXYNOS SoCs
- *
- * The 'config' member when left to NULL, is initialized to the default
- * structure exynos_gpio_cfg in the init function below.
- *
- * The 'base' member is also initialized in the init function below.
- * Note: The initialization of 'base' member of samsung_gpio_chip structure
- * uses the above macro and depends on the banks being listed in order here.
- */
-
-#ifdef CONFIG_ARCH_EXYNOS4
-static struct samsung_gpio_chip exynos4_gpios_1[] = {
-       {
-               .chip   = {
-                       .base   = EXYNOS4_GPA0(0),
-                       .ngpio  = EXYNOS4_GPIO_A0_NR,
-                       .label  = "GPA0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPA1(0),
-                       .ngpio  = EXYNOS4_GPIO_A1_NR,
-                       .label  = "GPA1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPB(0),
-                       .ngpio  = EXYNOS4_GPIO_B_NR,
-                       .label  = "GPB",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPC0(0),
-                       .ngpio  = EXYNOS4_GPIO_C0_NR,
-                       .label  = "GPC0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPC1(0),
-                       .ngpio  = EXYNOS4_GPIO_C1_NR,
-                       .label  = "GPC1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPD0(0),
-                       .ngpio  = EXYNOS4_GPIO_D0_NR,
-                       .label  = "GPD0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPD1(0),
-                       .ngpio  = EXYNOS4_GPIO_D1_NR,
-                       .label  = "GPD1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPE0(0),
-                       .ngpio  = EXYNOS4_GPIO_E0_NR,
-                       .label  = "GPE0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPE1(0),
-                       .ngpio  = EXYNOS4_GPIO_E1_NR,
-                       .label  = "GPE1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPE2(0),
-                       .ngpio  = EXYNOS4_GPIO_E2_NR,
-                       .label  = "GPE2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPE3(0),
-                       .ngpio  = EXYNOS4_GPIO_E3_NR,
-                       .label  = "GPE3",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPE4(0),
-                       .ngpio  = EXYNOS4_GPIO_E4_NR,
-                       .label  = "GPE4",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPF0(0),
-                       .ngpio  = EXYNOS4_GPIO_F0_NR,
-                       .label  = "GPF0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPF1(0),
-                       .ngpio  = EXYNOS4_GPIO_F1_NR,
-                       .label  = "GPF1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPF2(0),
-                       .ngpio  = EXYNOS4_GPIO_F2_NR,
-                       .label  = "GPF2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPF3(0),
-                       .ngpio  = EXYNOS4_GPIO_F3_NR,
-                       .label  = "GPF3",
-               },
-       },
-};
-#endif
-
-#ifdef CONFIG_ARCH_EXYNOS4
-static struct samsung_gpio_chip exynos4_gpios_2[] = {
-       {
-               .chip   = {
-                       .base   = EXYNOS4_GPJ0(0),
-                       .ngpio  = EXYNOS4_GPIO_J0_NR,
-                       .label  = "GPJ0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPJ1(0),
-                       .ngpio  = EXYNOS4_GPIO_J1_NR,
-                       .label  = "GPJ1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPK0(0),
-                       .ngpio  = EXYNOS4_GPIO_K0_NR,
-                       .label  = "GPK0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPK1(0),
-                       .ngpio  = EXYNOS4_GPIO_K1_NR,
-                       .label  = "GPK1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPK2(0),
-                       .ngpio  = EXYNOS4_GPIO_K2_NR,
-                       .label  = "GPK2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPK3(0),
-                       .ngpio  = EXYNOS4_GPIO_K3_NR,
-                       .label  = "GPK3",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPL0(0),
-                       .ngpio  = EXYNOS4_GPIO_L0_NR,
-                       .label  = "GPL0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPL1(0),
-                       .ngpio  = EXYNOS4_GPIO_L1_NR,
-                       .label  = "GPL1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS4_GPL2(0),
-                       .ngpio  = EXYNOS4_GPIO_L2_NR,
-                       .label  = "GPL2",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[8],
-               .chip   = {
-                       .base   = EXYNOS4_GPY0(0),
-                       .ngpio  = EXYNOS4_GPIO_Y0_NR,
-                       .label  = "GPY0",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[8],
-               .chip   = {
-                       .base   = EXYNOS4_GPY1(0),
-                       .ngpio  = EXYNOS4_GPIO_Y1_NR,
-                       .label  = "GPY1",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[8],
-               .chip   = {
-                       .base   = EXYNOS4_GPY2(0),
-                       .ngpio  = EXYNOS4_GPIO_Y2_NR,
-                       .label  = "GPY2",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[8],
-               .chip   = {
-                       .base   = EXYNOS4_GPY3(0),
-                       .ngpio  = EXYNOS4_GPIO_Y3_NR,
-                       .label  = "GPY3",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[8],
-               .chip   = {
-                       .base   = EXYNOS4_GPY4(0),
-                       .ngpio  = EXYNOS4_GPIO_Y4_NR,
-                       .label  = "GPY4",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[8],
-               .chip   = {
-                       .base   = EXYNOS4_GPY5(0),
-                       .ngpio  = EXYNOS4_GPIO_Y5_NR,
-                       .label  = "GPY5",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[8],
-               .chip   = {
-                       .base   = EXYNOS4_GPY6(0),
-                       .ngpio  = EXYNOS4_GPIO_Y6_NR,
-                       .label  = "GPY6",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(0),
-               .chip   = {
-                       .base   = EXYNOS4_GPX0(0),
-                       .ngpio  = EXYNOS4_GPIO_X0_NR,
-                       .label  = "GPX0",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(8),
-               .chip   = {
-                       .base   = EXYNOS4_GPX1(0),
-                       .ngpio  = EXYNOS4_GPIO_X1_NR,
-                       .label  = "GPX1",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(16),
-               .chip   = {
-                       .base   = EXYNOS4_GPX2(0),
-                       .ngpio  = EXYNOS4_GPIO_X2_NR,
-                       .label  = "GPX2",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(24),
-               .chip   = {
-                       .base   = EXYNOS4_GPX3(0),
-                       .ngpio  = EXYNOS4_GPIO_X3_NR,
-                       .label  = "GPX3",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       },
-};
-#endif
-
-#ifdef CONFIG_ARCH_EXYNOS4
-static struct samsung_gpio_chip exynos4_gpios_3[] = {
-       {
-               .chip   = {
-                       .base   = EXYNOS4_GPZ(0),
-                       .ngpio  = EXYNOS4_GPIO_Z_NR,
-                       .label  = "GPZ",
-               },
-       },
-};
-#endif
-
-#ifdef CONFIG_SOC_EXYNOS5250
-static struct samsung_gpio_chip exynos5_gpios_1[] = {
-       {
-               .chip   = {
-                       .base   = EXYNOS5_GPA0(0),
-                       .ngpio  = EXYNOS5_GPIO_A0_NR,
-                       .label  = "GPA0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPA1(0),
-                       .ngpio  = EXYNOS5_GPIO_A1_NR,
-                       .label  = "GPA1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPA2(0),
-                       .ngpio  = EXYNOS5_GPIO_A2_NR,
-                       .label  = "GPA2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPB0(0),
-                       .ngpio  = EXYNOS5_GPIO_B0_NR,
-                       .label  = "GPB0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPB1(0),
-                       .ngpio  = EXYNOS5_GPIO_B1_NR,
-                       .label  = "GPB1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPB2(0),
-                       .ngpio  = EXYNOS5_GPIO_B2_NR,
-                       .label  = "GPB2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPB3(0),
-                       .ngpio  = EXYNOS5_GPIO_B3_NR,
-                       .label  = "GPB3",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPC0(0),
-                       .ngpio  = EXYNOS5_GPIO_C0_NR,
-                       .label  = "GPC0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPC1(0),
-                       .ngpio  = EXYNOS5_GPIO_C1_NR,
-                       .label  = "GPC1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPC2(0),
-                       .ngpio  = EXYNOS5_GPIO_C2_NR,
-                       .label  = "GPC2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPC3(0),
-                       .ngpio  = EXYNOS5_GPIO_C3_NR,
-                       .label  = "GPC3",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPD0(0),
-                       .ngpio  = EXYNOS5_GPIO_D0_NR,
-                       .label  = "GPD0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPD1(0),
-                       .ngpio  = EXYNOS5_GPIO_D1_NR,
-                       .label  = "GPD1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPY0(0),
-                       .ngpio  = EXYNOS5_GPIO_Y0_NR,
-                       .label  = "GPY0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPY1(0),
-                       .ngpio  = EXYNOS5_GPIO_Y1_NR,
-                       .label  = "GPY1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPY2(0),
-                       .ngpio  = EXYNOS5_GPIO_Y2_NR,
-                       .label  = "GPY2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPY3(0),
-                       .ngpio  = EXYNOS5_GPIO_Y3_NR,
-                       .label  = "GPY3",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPY4(0),
-                       .ngpio  = EXYNOS5_GPIO_Y4_NR,
-                       .label  = "GPY4",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPY5(0),
-                       .ngpio  = EXYNOS5_GPIO_Y5_NR,
-                       .label  = "GPY5",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPY6(0),
-                       .ngpio  = EXYNOS5_GPIO_Y6_NR,
-                       .label  = "GPY6",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPC4(0),
-                       .ngpio  = EXYNOS5_GPIO_C4_NR,
-                       .label  = "GPC4",
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(0),
-               .chip   = {
-                       .base   = EXYNOS5_GPX0(0),
-                       .ngpio  = EXYNOS5_GPIO_X0_NR,
-                       .label  = "GPX0",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(8),
-               .chip   = {
-                       .base   = EXYNOS5_GPX1(0),
-                       .ngpio  = EXYNOS5_GPIO_X1_NR,
-                       .label  = "GPX1",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(16),
-               .chip   = {
-                       .base   = EXYNOS5_GPX2(0),
-                       .ngpio  = EXYNOS5_GPIO_X2_NR,
-                       .label  = "GPX2",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       }, {
-               .config = &samsung_gpio_cfgs[9],
-               .irq_base = IRQ_EINT(24),
-               .chip   = {
-                       .base   = EXYNOS5_GPX3(0),
-                       .ngpio  = EXYNOS5_GPIO_X3_NR,
-                       .label  = "GPX3",
-                       .to_irq = samsung_gpiolib_to_irq,
-               },
-       },
-};
-#endif
-
-#ifdef CONFIG_SOC_EXYNOS5250
-static struct samsung_gpio_chip exynos5_gpios_2[] = {
-       {
-               .chip   = {
-                       .base   = EXYNOS5_GPE0(0),
-                       .ngpio  = EXYNOS5_GPIO_E0_NR,
-                       .label  = "GPE0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPE1(0),
-                       .ngpio  = EXYNOS5_GPIO_E1_NR,
-                       .label  = "GPE1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPF0(0),
-                       .ngpio  = EXYNOS5_GPIO_F0_NR,
-                       .label  = "GPF0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPF1(0),
-                       .ngpio  = EXYNOS5_GPIO_F1_NR,
-                       .label  = "GPF1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPG0(0),
-                       .ngpio  = EXYNOS5_GPIO_G0_NR,
-                       .label  = "GPG0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPG1(0),
-                       .ngpio  = EXYNOS5_GPIO_G1_NR,
-                       .label  = "GPG1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPG2(0),
-                       .ngpio  = EXYNOS5_GPIO_G2_NR,
-                       .label  = "GPG2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPH0(0),
-                       .ngpio  = EXYNOS5_GPIO_H0_NR,
-                       .label  = "GPH0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPH1(0),
-                       .ngpio  = EXYNOS5_GPIO_H1_NR,
-                       .label  = "GPH1",
-
-               },
-       },
-};
-#endif
-
-#ifdef CONFIG_SOC_EXYNOS5250
-static struct samsung_gpio_chip exynos5_gpios_3[] = {
-       {
-               .chip   = {
-                       .base   = EXYNOS5_GPV0(0),
-                       .ngpio  = EXYNOS5_GPIO_V0_NR,
-                       .label  = "GPV0",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPV1(0),
-                       .ngpio  = EXYNOS5_GPIO_V1_NR,
-                       .label  = "GPV1",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPV2(0),
-                       .ngpio  = EXYNOS5_GPIO_V2_NR,
-                       .label  = "GPV2",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPV3(0),
-                       .ngpio  = EXYNOS5_GPIO_V3_NR,
-                       .label  = "GPV3",
-               },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPV4(0),
-                       .ngpio  = EXYNOS5_GPIO_V4_NR,
-                       .label  = "GPV4",
-               },
-       },
-};
-#endif
-
-#ifdef CONFIG_SOC_EXYNOS5250
-static struct samsung_gpio_chip exynos5_gpios_4[] = {
-       {
-               .chip   = {
-                       .base   = EXYNOS5_GPZ(0),
-                       .ngpio  = EXYNOS5_GPIO_Z_NR,
-                       .label  = "GPZ",
-               },
-       },
-};
-#endif
-
-
-#if defined(CONFIG_ARCH_EXYNOS) && defined(CONFIG_OF)
-static int exynos_gpio_xlate(struct gpio_chip *gc,
-                       const struct of_phandle_args *gpiospec, u32 *flags)
-{
-       unsigned int pin;
-
-       if (WARN_ON(gc->of_gpio_n_cells < 4))
-               return -EINVAL;
-
-       if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
-               return -EINVAL;
-
-       if (gpiospec->args[0] > gc->ngpio)
-               return -EINVAL;
-
-       pin = gc->base + gpiospec->args[0];
-
-       if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(gpiospec->args[1])))
-               pr_warn("gpio_xlate: failed to set pin function\n");
-       if (s3c_gpio_setpull(pin, gpiospec->args[2] & 0xffff))
-               pr_warn("gpio_xlate: failed to set pin pull up/down\n");
-       if (s5p_gpio_set_drvstr(pin, gpiospec->args[3]))
-               pr_warn("gpio_xlate: failed to set pin drive strength\n");
-
-       if (flags)
-               *flags = gpiospec->args[2] >> 16;
-
-       return gpiospec->args[0];
-}
-
-static const struct of_device_id exynos_gpio_dt_match[] __initdata = {
-       { .compatible = "samsung,exynos4-gpio", },
-       {}
-};
-
-static __init void exynos_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip,
-                                               u64 base, u64 offset)
-{
-       struct gpio_chip *gc =  &chip->chip;
-       u64 address;
-
-       if (!of_have_populated_dt())
-               return;
-
-       address = chip->base ? base + ((u32)chip->base & 0xfff) : base + offset;
-       gc->of_node = of_find_matching_node_by_address(NULL,
-                       exynos_gpio_dt_match, address);
-       if (!gc->of_node) {
-               pr_info("gpio: device tree node not found for gpio controller"
-                       " with base address %08llx\n", address);
-               return;
-       }
-       gc->of_gpio_n_cells = 4;
-       gc->of_xlate = exynos_gpio_xlate;
-}
-#elif defined(CONFIG_ARCH_EXYNOS)
-static __init void exynos_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip,
-                                               u64 base, u64 offset)
-{
-       return;
-}
-#endif /* defined(CONFIG_ARCH_EXYNOS) && defined(CONFIG_OF) */
-
-static __init void exynos4_gpiolib_init(void)
-{
-#ifdef CONFIG_CPU_EXYNOS4210
-       struct samsung_gpio_chip *chip;
-       int i, nr_chips;
-       void __iomem *gpio_base1, *gpio_base2, *gpio_base3;
-       int group = 0;
-       void __iomem *gpx_base;
-
-       /* gpio part1 */
-       gpio_base1 = ioremap(EXYNOS4_PA_GPIO1, SZ_4K);
-       if (gpio_base1 == NULL) {
-               pr_err("unable to ioremap for gpio_base1\n");
-               goto err_ioremap1;
-       }
-
-       chip = exynos4_gpios_1;
-       nr_chips = ARRAY_SIZE(exynos4_gpios_1);
-
-       for (i = 0; i < nr_chips; i++, chip++) {
-               if (!chip->config) {
-                       chip->config = &exynos_gpio_cfg;
-                       chip->group = group++;
-               }
-               exynos_gpiolib_attach_ofnode(chip,
-                               EXYNOS4_PA_GPIO1, i * 0x20);
-       }
-       samsung_gpiolib_add_4bit_chips(exynos4_gpios_1,
-                                      nr_chips, gpio_base1);
-
-       /* gpio part2 */
-       gpio_base2 = ioremap(EXYNOS4_PA_GPIO2, SZ_4K);
-       if (gpio_base2 == NULL) {
-               pr_err("unable to ioremap for gpio_base2\n");
-               goto err_ioremap2;
-       }
-
-       /* need to set base address for gpx */
-       chip = &exynos4_gpios_2[16];
-       gpx_base = gpio_base2 + 0xC00;
-       for (i = 0; i < 4; i++, chip++, gpx_base += 0x20)
-               chip->base = gpx_base;
-
-       chip = exynos4_gpios_2;
-       nr_chips = ARRAY_SIZE(exynos4_gpios_2);
-
-       for (i = 0; i < nr_chips; i++, chip++) {
-               if (!chip->config) {
-                       chip->config = &exynos_gpio_cfg;
-                       chip->group = group++;
-               }
-               exynos_gpiolib_attach_ofnode(chip,
-                               EXYNOS4_PA_GPIO2, i * 0x20);
-       }
-       samsung_gpiolib_add_4bit_chips(exynos4_gpios_2,
-                                      nr_chips, gpio_base2);
-
-       /* gpio part3 */
-       gpio_base3 = ioremap(EXYNOS4_PA_GPIO3, SZ_256);
-       if (gpio_base3 == NULL) {
-               pr_err("unable to ioremap for gpio_base3\n");
-               goto err_ioremap3;
-       }
-
-       chip = exynos4_gpios_3;
-       nr_chips = ARRAY_SIZE(exynos4_gpios_3);
-
-       for (i = 0; i < nr_chips; i++, chip++) {
-               if (!chip->config) {
-                       chip->config = &exynos_gpio_cfg;
-                       chip->group = group++;
-               }
-               exynos_gpiolib_attach_ofnode(chip,
-                               EXYNOS4_PA_GPIO3, i * 0x20);
-       }
-       samsung_gpiolib_add_4bit_chips(exynos4_gpios_3,
-                                      nr_chips, gpio_base3);
-
-#if defined(CONFIG_CPU_EXYNOS4210) && defined(CONFIG_S5P_GPIO_INT)
-       s5p_register_gpioint_bank(IRQ_GPIO_XA, 0, IRQ_GPIO1_NR_GROUPS);
-       s5p_register_gpioint_bank(IRQ_GPIO_XB, IRQ_GPIO1_NR_GROUPS, IRQ_GPIO2_NR_GROUPS);
-#endif
-
-       return;
-
-err_ioremap3:
-       iounmap(gpio_base2);
-err_ioremap2:
-       iounmap(gpio_base1);
-err_ioremap1:
-       return;
-#endif /* CONFIG_CPU_EXYNOS4210 */
-}
-
-static __init void exynos5_gpiolib_init(void)
-{
-#ifdef CONFIG_SOC_EXYNOS5250
-       struct samsung_gpio_chip *chip;
-       int i, nr_chips;
-       void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4;
-       int group = 0;
-       void __iomem *gpx_base;
-
-       /* gpio part1 */
-       gpio_base1 = ioremap(EXYNOS5_PA_GPIO1, SZ_4K);
-       if (gpio_base1 == NULL) {
-               pr_err("unable to ioremap for gpio_base1\n");
-               goto err_ioremap1;
-       }
-
-       /* need to set base address for gpc4 */
-       exynos5_gpios_1[20].base = gpio_base1 + 0x2E0;
-
-       /* need to set base address for gpx */
-       chip = &exynos5_gpios_1[21];
-       gpx_base = gpio_base1 + 0xC00;
-       for (i = 0; i < 4; i++, chip++, gpx_base += 0x20)
-               chip->base = gpx_base;
-
-       chip = exynos5_gpios_1;
-       nr_chips = ARRAY_SIZE(exynos5_gpios_1);
-
-       for (i = 0; i < nr_chips; i++, chip++) {
-               if (!chip->config) {
-                       chip->config = &exynos_gpio_cfg;
-                       chip->group = group++;
-               }
-               exynos_gpiolib_attach_ofnode(chip,
-                               EXYNOS5_PA_GPIO1, i * 0x20);
-       }
-       samsung_gpiolib_add_4bit_chips(exynos5_gpios_1,
-                                      nr_chips, gpio_base1);
-
-       /* gpio part2 */
-       gpio_base2 = ioremap(EXYNOS5_PA_GPIO2, SZ_4K);
-       if (gpio_base2 == NULL) {
-               pr_err("unable to ioremap for gpio_base2\n");
-               goto err_ioremap2;
-       }
-
-       chip = exynos5_gpios_2;
-       nr_chips = ARRAY_SIZE(exynos5_gpios_2);
-
-       for (i = 0; i < nr_chips; i++, chip++) {
-               if (!chip->config) {
-                       chip->config = &exynos_gpio_cfg;
-                       chip->group = group++;
-               }
-               exynos_gpiolib_attach_ofnode(chip,
-                               EXYNOS5_PA_GPIO2, i * 0x20);
-       }
-       samsung_gpiolib_add_4bit_chips(exynos5_gpios_2,
-                                      nr_chips, gpio_base2);
-
-       /* gpio part3 */
-       gpio_base3 = ioremap(EXYNOS5_PA_GPIO3, SZ_4K);
-       if (gpio_base3 == NULL) {
-               pr_err("unable to ioremap for gpio_base3\n");
-               goto err_ioremap3;
-       }
-
-       /* need to set base address for gpv */
-       exynos5_gpios_3[0].base = gpio_base3;
-       exynos5_gpios_3[1].base = gpio_base3 + 0x20;
-       exynos5_gpios_3[2].base = gpio_base3 + 0x60;
-       exynos5_gpios_3[3].base = gpio_base3 + 0x80;
-       exynos5_gpios_3[4].base = gpio_base3 + 0xC0;
-
-       chip = exynos5_gpios_3;
-       nr_chips = ARRAY_SIZE(exynos5_gpios_3);
-
-       for (i = 0; i < nr_chips; i++, chip++) {
-               if (!chip->config) {
-                       chip->config = &exynos_gpio_cfg;
-                       chip->group = group++;
-               }
-               exynos_gpiolib_attach_ofnode(chip,
-                               EXYNOS5_PA_GPIO3, i * 0x20);
-       }
-       samsung_gpiolib_add_4bit_chips(exynos5_gpios_3,
-                                      nr_chips, gpio_base3);
-
-       /* gpio part4 */
-       gpio_base4 = ioremap(EXYNOS5_PA_GPIO4, SZ_4K);
-       if (gpio_base4 == NULL) {
-               pr_err("unable to ioremap for gpio_base4\n");
-               goto err_ioremap4;
-       }
-
-       chip = exynos5_gpios_4;
-       nr_chips = ARRAY_SIZE(exynos5_gpios_4);
-
-       for (i = 0; i < nr_chips; i++, chip++) {
-               if (!chip->config) {
-                       chip->config = &exynos_gpio_cfg;
-                       chip->group = group++;
-               }
-               exynos_gpiolib_attach_ofnode(chip,
-                               EXYNOS5_PA_GPIO4, i * 0x20);
-       }
-       samsung_gpiolib_add_4bit_chips(exynos5_gpios_4,
-                                      nr_chips, gpio_base4);
-       return;
-
-err_ioremap4:
-       iounmap(gpio_base3);
-err_ioremap3:
-       iounmap(gpio_base2);
-err_ioremap2:
-       iounmap(gpio_base1);
-err_ioremap1:
-       return;
-
-#endif /* CONFIG_SOC_EXYNOS5250 */
-}
-
 /* TODO: cleanup soc_is_* */
 static __init int samsung_gpiolib_init(void)
 {
@@ -3040,10 +2173,6 @@ static __init int samsung_gpiolib_init(void)
 #if defined(CONFIG_CPU_S5PV210) && defined(CONFIG_S5P_GPIO_INT)
                s5p_register_gpioint_bank(IRQ_GPIOINT, 0, S5P_GPIOINT_GROUP_MAXNR);
 #endif
-       } else if (soc_is_exynos4210()) {
-               exynos4_gpiolib_init();
-       } else if (soc_is_exynos5250()) {
-               exynos5_gpiolib_init();
        } else {
                WARN(1, "Unknown SoC in gpio-samsung, no GPIOs added\n");
                return -ENODEV;
index 7a4bf7c..e9a0415 100644 (file)
@@ -128,18 +128,13 @@ static int spics_gpio_probe(struct platform_device *pdev)
        struct resource *res;
        int ret;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "invalid IORESOURCE_MEM\n");
-               return -EBUSY;
-       }
-
        spics = devm_kzalloc(&pdev->dev, sizeof(*spics), GFP_KERNEL);
        if (!spics) {
                dev_err(&pdev->dev, "memory allocation fail\n");
                return -ENOMEM;
        }
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        spics->base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(spics->base))
                return PTR_ERR(spics->base);
index f43ab6a..f2fb12c 100644 (file)
@@ -361,7 +361,7 @@ static int gsta_probe(struct platform_device *dev)
        struct gsta_gpio *chip;
        struct resource *res;
 
-       pdev = *(struct pci_dev **)(dev->dev.platform_data);
+       pdev = *(struct pci_dev **)dev_get_platdata(&dev->dev);
        gpio_pdata = dev_get_platdata(&pdev->dev);
 
        if (gpio_pdata == NULL)
index f371732..d2983e9 100644 (file)
@@ -583,7 +583,7 @@ static int sx150x_probe(struct i2c_client *client,
        struct sx150x_chip *chip;
        int rc;
 
-       pdata = client->dev.platform_data;
+       pdata = dev_get_platdata(&client->dev);
        if (!pdata)
                return -EINVAL;
 
index 4c65f88..7a0e956 100644 (file)
@@ -227,7 +227,7 @@ static int timbgpio_probe(struct platform_device *pdev)
        struct gpio_chip *gc;
        struct timbgpio *tgpio;
        struct resource *iomem;
-       struct timbgpio_platform_data *pdata = pdev->dev.platform_data;
+       struct timbgpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
        int irq = platform_get_irq(pdev, 0);
 
        if (!pdata || pdata->nr_pins > 32) {
@@ -318,7 +318,7 @@ err_mem:
 static int timbgpio_remove(struct platform_device *pdev)
 {
        int err;
-       struct timbgpio_platform_data *pdata = pdev->dev.platform_data;
+       struct timbgpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct timbgpio *tgpio = platform_get_drvdata(pdev);
        struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        int irq = platform_get_irq(pdev, 0);
index 30a5844..276a422 100644 (file)
@@ -87,7 +87,7 @@ static struct gpio_chip template_chip = {
 static int tps65912_gpio_probe(struct platform_device *pdev)
 {
        struct tps65912 *tps65912 = dev_get_drvdata(pdev->dev.parent);
-       struct tps65912_board *pdata = tps65912->dev->platform_data;
+       struct tps65912_board *pdata = dev_get_platdata(tps65912->dev);
        struct tps65912_gpio_data *tps65912_gpio;
        int ret;
 
index cc53cab..3df3ebd 100644 (file)
@@ -322,7 +322,7 @@ static void ts5500_disable_irq(struct ts5500_priv *priv)
 static int ts5500_dio_probe(struct platform_device *pdev)
 {
        enum ts5500_blocks block = platform_get_device_id(pdev)->driver_data;
-       struct ts5500_dio_platform_data *pdata = pdev->dev.platform_data;
+       struct ts5500_dio_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct device *dev = &pdev->dev;
        const char *name = dev_name(dev);
        struct ts5500_priv *priv;
index 4d330e3..d8e4f6e 100644 (file)
@@ -256,7 +256,7 @@ static int twl_request(struct gpio_chip *chip, unsigned offset)
                /* optionally have the first two GPIOs switch vMMC1
                 * and vMMC2 power supplies based on card presence.
                 */
-               pdata = chip->dev->platform_data;
+               pdata = dev_get_platdata(chip->dev);
                if (pdata)
                        value |= pdata->mmc_cd & 0x03;
 
@@ -460,7 +460,7 @@ static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev)
 
 static int gpio_twl4030_probe(struct platform_device *pdev)
 {
-       struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data;
+       struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct device_node *node = pdev->dev.of_node;
        struct gpio_twl4030_priv *priv;
        int ret, irq_base;
@@ -556,7 +556,7 @@ out:
 /* Cannot use as gpio_twl4030_probe() calls us */
 static int gpio_twl4030_remove(struct platform_device *pdev)
 {
-       struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data;
+       struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct gpio_twl4030_priv *priv = platform_get_drvdata(pdev);
        int status;
 
index 0be82c6..d420d30 100644 (file)
@@ -84,15 +84,11 @@ static struct gpio_chip twl6040gpo_chip = {
 
 static int gpo_twl6040_probe(struct platform_device *pdev)
 {
-       struct twl6040_gpo_data *pdata = pdev->dev.platform_data;
        struct device *twl6040_core_dev = pdev->dev.parent;
        struct twl6040 *twl6040 = dev_get_drvdata(twl6040_core_dev);
        int ret;
 
-       if (pdata)
-               twl6040gpo_chip.base = pdata->gpio_base;
-       else
-               twl6040gpo_chip.base = -1;
+       twl6040gpo_chip.base = -1;
 
        if (twl6040_get_revid(twl6040) < TWL6041_REV_ES2_0)
                twl6040gpo_chip.ngpio = 3; /* twl6040 have 3 GPO */
diff --git a/drivers/gpio/gpio-tz1090-pdc.c b/drivers/gpio/gpio-tz1090-pdc.c
new file mode 100644 (file)
index 0000000..f512da2
--- /dev/null
@@ -0,0 +1,243 @@
+/*
+ * Toumaz Xenif TZ1090 PDC GPIO handling.
+ *
+ * Copyright (C) 2012-2013 Imagination Technologies 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/bitops.h>
+#include <linux/gpio.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of_irq.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/syscore_ops.h>
+#include <asm/global_lock.h>
+
+/* Register offsets from SOC_GPIO_CONTROL0 */
+#define REG_SOC_GPIO_CONTROL0  0x00
+#define REG_SOC_GPIO_CONTROL1  0x04
+#define REG_SOC_GPIO_CONTROL2  0x08
+#define REG_SOC_GPIO_CONTROL3  0x0c
+#define REG_SOC_GPIO_STATUS    0x80
+
+/* PDC GPIOs go after normal GPIOs */
+#define GPIO_PDC_BASE          90
+#define GPIO_PDC_NGPIO         7
+
+/* Out of PDC gpios, only syswakes have irqs */
+#define GPIO_PDC_IRQ_FIRST     2
+#define GPIO_PDC_NIRQ          3
+
+/**
+ * struct tz1090_pdc_gpio - GPIO bank private data
+ * @chip:      Generic GPIO chip for GPIO bank
+ * @reg:       Base of registers, offset for this GPIO bank
+ * @irq:       IRQ numbers for Syswake GPIOs
+ *
+ * This is the main private data for the PDC GPIO driver. It encapsulates a
+ * gpio_chip, and the callbacks for the gpio_chip can access the private data
+ * with the to_pdc() macro below.
+ */
+struct tz1090_pdc_gpio {
+       struct gpio_chip chip;
+       void __iomem *reg;
+       int irq[GPIO_PDC_NIRQ];
+};
+#define to_pdc(c)      container_of(c, struct tz1090_pdc_gpio, chip)
+
+/* Register accesses into the PDC MMIO area */
+
+static inline void pdc_write(struct tz1090_pdc_gpio *priv, unsigned int reg_offs,
+                     unsigned int data)
+{
+       writel(data, priv->reg + reg_offs);
+}
+
+static inline unsigned int pdc_read(struct tz1090_pdc_gpio *priv,
+                            unsigned int reg_offs)
+{
+       return readl(priv->reg + reg_offs);
+}
+
+/* Generic GPIO interface */
+
+static int tz1090_pdc_gpio_direction_input(struct gpio_chip *chip,
+                                          unsigned int offset)
+{
+       struct tz1090_pdc_gpio *priv = to_pdc(chip);
+       u32 value;
+       int lstat;
+
+       __global_lock2(lstat);
+       value = pdc_read(priv, REG_SOC_GPIO_CONTROL1);
+       value |= BIT(offset);
+       pdc_write(priv, REG_SOC_GPIO_CONTROL1, value);
+       __global_unlock2(lstat);
+
+       return 0;
+}
+
+static int tz1090_pdc_gpio_direction_output(struct gpio_chip *chip,
+                                           unsigned int offset,
+                                           int output_value)
+{
+       struct tz1090_pdc_gpio *priv = to_pdc(chip);
+       u32 value;
+       int lstat;
+
+       __global_lock2(lstat);
+       /* EXT_POWER doesn't seem to have an output value bit */
+       if (offset < 6) {
+               value = pdc_read(priv, REG_SOC_GPIO_CONTROL0);
+               if (output_value)
+                       value |= BIT(offset);
+               else
+                       value &= ~BIT(offset);
+               pdc_write(priv, REG_SOC_GPIO_CONTROL0, value);
+       }
+
+       value = pdc_read(priv, REG_SOC_GPIO_CONTROL1);
+       value &= ~BIT(offset);
+       pdc_write(priv, REG_SOC_GPIO_CONTROL1, value);
+       __global_unlock2(lstat);
+
+       return 0;
+}
+
+static int tz1090_pdc_gpio_get(struct gpio_chip *chip, unsigned int offset)
+{
+       struct tz1090_pdc_gpio *priv = to_pdc(chip);
+       return pdc_read(priv, REG_SOC_GPIO_STATUS) & BIT(offset);
+}
+
+static void tz1090_pdc_gpio_set(struct gpio_chip *chip, unsigned int offset,
+                               int output_value)
+{
+       struct tz1090_pdc_gpio *priv = to_pdc(chip);
+       u32 value;
+       int lstat;
+
+       /* EXT_POWER doesn't seem to have an output value bit */
+       if (offset >= 6)
+               return;
+
+       __global_lock2(lstat);
+       value = pdc_read(priv, REG_SOC_GPIO_CONTROL0);
+       if (output_value)
+               value |= BIT(offset);
+       else
+               value &= ~BIT(offset);
+       pdc_write(priv, REG_SOC_GPIO_CONTROL0, value);
+       __global_unlock2(lstat);
+}
+
+static int tz1090_pdc_gpio_request(struct gpio_chip *chip, unsigned int offset)
+{
+       return pinctrl_request_gpio(chip->base + offset);
+}
+
+static void tz1090_pdc_gpio_free(struct gpio_chip *chip, unsigned int offset)
+{
+       pinctrl_free_gpio(chip->base + offset);
+}
+
+static int tz1090_pdc_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
+{
+       struct tz1090_pdc_gpio *priv = to_pdc(chip);
+       unsigned int syswake = offset - GPIO_PDC_IRQ_FIRST;
+       int irq;
+
+       /* only syswakes have irqs */
+       if (syswake >= GPIO_PDC_NIRQ)
+               return -EINVAL;
+
+       irq = priv->irq[syswake];
+       if (!irq)
+               return -EINVAL;
+
+       return irq;
+}
+
+static int tz1090_pdc_gpio_probe(struct platform_device *pdev)
+{
+       struct device_node *np = pdev->dev.of_node;
+       struct resource *res_regs;
+       struct tz1090_pdc_gpio *priv;
+       unsigned int i;
+
+       if (!np) {
+               dev_err(&pdev->dev, "must be instantiated via devicetree\n");
+               return -ENOENT;
+       }
+
+       res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res_regs) {
+               dev_err(&pdev->dev, "cannot find registers resource\n");
+               return -ENOENT;
+       }
+
+       priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv) {
+               dev_err(&pdev->dev, "unable to allocate driver data\n");
+               return -ENOMEM;
+       }
+
+       /* Ioremap the registers */
+       priv->reg = devm_ioremap(&pdev->dev, res_regs->start,
+                                res_regs->end - res_regs->start);
+       if (!priv->reg) {
+               dev_err(&pdev->dev, "unable to ioremap registers\n");
+               return -ENOMEM;
+       }
+
+       /* Set up GPIO chip */
+       priv->chip.label                = "tz1090-pdc-gpio";
+       priv->chip.dev                  = &pdev->dev;
+       priv->chip.direction_input      = tz1090_pdc_gpio_direction_input;
+       priv->chip.direction_output     = tz1090_pdc_gpio_direction_output;
+       priv->chip.get                  = tz1090_pdc_gpio_get;
+       priv->chip.set                  = tz1090_pdc_gpio_set;
+       priv->chip.free                 = tz1090_pdc_gpio_free;
+       priv->chip.request              = tz1090_pdc_gpio_request;
+       priv->chip.to_irq               = tz1090_pdc_gpio_to_irq;
+       priv->chip.of_node              = np;
+
+       /* GPIO numbering */
+       priv->chip.base                 = GPIO_PDC_BASE;
+       priv->chip.ngpio                = GPIO_PDC_NGPIO;
+
+       /* Map the syswake irqs */
+       for (i = 0; i < GPIO_PDC_NIRQ; ++i)
+               priv->irq[i] = irq_of_parse_and_map(np, i);
+
+       /* Add the GPIO bank */
+       gpiochip_add(&priv->chip);
+
+       return 0;
+}
+
+static struct of_device_id tz1090_pdc_gpio_of_match[] = {
+       { .compatible = "img,tz1090-pdc-gpio" },
+       { },
+};
+
+static struct platform_driver tz1090_pdc_gpio_driver = {
+       .driver = {
+               .name           = "tz1090-pdc-gpio",
+               .owner          = THIS_MODULE,
+               .of_match_table = tz1090_pdc_gpio_of_match,
+       },
+       .probe          = tz1090_pdc_gpio_probe,
+};
+
+static int __init tz1090_pdc_gpio_init(void)
+{
+       return platform_driver_register(&tz1090_pdc_gpio_driver);
+}
+subsys_initcall(tz1090_pdc_gpio_init);
diff --git a/drivers/gpio/gpio-tz1090.c b/drivers/gpio/gpio-tz1090.c
new file mode 100644 (file)
index 0000000..23e0613
--- /dev/null
@@ -0,0 +1,606 @@
+/*
+ * Toumaz Xenif TZ1090 GPIO handling.
+ *
+ * Copyright (C) 2008-2013 Imagination Technologies Ltd.
+ *
+ *  Based on ARM PXA code and others.
+ *
+ * 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/bitops.h>
+#include <linux/export.h>
+#include <linux/gpio.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/irqdomain.h>
+#include <linux/kernel.h>
+#include <linux/of_irq.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/syscore_ops.h>
+#include <asm/global_lock.h>
+
+/* Register offsets from bank base address */
+#define REG_GPIO_DIR           0x00
+#define REG_GPIO_IRQ_PLRT      0x20
+#define REG_GPIO_IRQ_TYPE      0x30
+#define REG_GPIO_IRQ_EN                0x40
+#define REG_GPIO_IRQ_STS       0x50
+#define REG_GPIO_BIT_EN                0x60
+#define REG_GPIO_DIN           0x70
+#define REG_GPIO_DOUT          0x80
+
+/* REG_GPIO_IRQ_PLRT */
+#define REG_GPIO_IRQ_PLRT_LOW  0
+#define REG_GPIO_IRQ_PLRT_HIGH 1
+
+/* REG_GPIO_IRQ_TYPE */
+#define REG_GPIO_IRQ_TYPE_LEVEL        0
+#define REG_GPIO_IRQ_TYPE_EDGE 1
+
+/**
+ * struct tz1090_gpio_bank - GPIO bank private data
+ * @chip:      Generic GPIO chip for GPIO bank
+ * @domain:    IRQ domain for GPIO bank (may be NULL)
+ * @reg:       Base of registers, offset for this GPIO bank
+ * @irq:       IRQ number for GPIO bank
+ * @label:     Debug GPIO bank label, used for storage of chip->label
+ *
+ * This is the main private data for a GPIO bank. It encapsulates a gpio_chip,
+ * and the callbacks for the gpio_chip can access the private data with the
+ * to_bank() macro below.
+ */
+struct tz1090_gpio_bank {
+       struct gpio_chip chip;
+       struct irq_domain *domain;
+       void __iomem *reg;
+       int irq;
+       char label[16];
+};
+#define to_bank(c)     container_of(c, struct tz1090_gpio_bank, chip)
+
+/**
+ * struct tz1090_gpio - Overall GPIO device private data
+ * @dev:       Device (from platform device)
+ * @reg:       Base of GPIO registers
+ *
+ * Represents the overall GPIO device. This structure is actually only
+ * temporary, and used during init.
+ */
+struct tz1090_gpio {
+       struct device *dev;
+       void __iomem *reg;
+};
+
+/**
+ * struct tz1090_gpio_bank_info - Temporary registration info for GPIO bank
+ * @priv:      Overall GPIO device private data
+ * @node:      Device tree node specific to this GPIO bank
+ * @index:     Index of bank in range 0-2
+ */
+struct tz1090_gpio_bank_info {
+       struct tz1090_gpio *priv;
+       struct device_node *node;
+       unsigned int index;
+};
+
+/* Convenience register accessors */
+static inline void tz1090_gpio_write(struct tz1090_gpio_bank *bank,
+                             unsigned int reg_offs, u32 data)
+{
+       iowrite32(data, bank->reg + reg_offs);
+}
+
+static inline u32 tz1090_gpio_read(struct tz1090_gpio_bank *bank,
+                           unsigned int reg_offs)
+{
+       return ioread32(bank->reg + reg_offs);
+}
+
+/* caller must hold LOCK2 */
+static inline void _tz1090_gpio_clear_bit(struct tz1090_gpio_bank *bank,
+                                         unsigned int reg_offs,
+                                         unsigned int offset)
+{
+       u32 value;
+
+       value = tz1090_gpio_read(bank, reg_offs);
+       value &= ~BIT(offset);
+       tz1090_gpio_write(bank, reg_offs, value);
+}
+
+static void tz1090_gpio_clear_bit(struct tz1090_gpio_bank *bank,
+                                 unsigned int reg_offs,
+                                 unsigned int offset)
+{
+       int lstat;
+
+       __global_lock2(lstat);
+       _tz1090_gpio_clear_bit(bank, reg_offs, offset);
+       __global_unlock2(lstat);
+}
+
+/* caller must hold LOCK2 */
+static inline void _tz1090_gpio_set_bit(struct tz1090_gpio_bank *bank,
+                                       unsigned int reg_offs,
+                                       unsigned int offset)
+{
+       u32 value;
+
+       value = tz1090_gpio_read(bank, reg_offs);
+       value |= BIT(offset);
+       tz1090_gpio_write(bank, reg_offs, value);
+}
+
+static void tz1090_gpio_set_bit(struct tz1090_gpio_bank *bank,
+                               unsigned int reg_offs,
+                               unsigned int offset)
+{
+       int lstat;
+
+       __global_lock2(lstat);
+       _tz1090_gpio_set_bit(bank, reg_offs, offset);
+       __global_unlock2(lstat);
+}
+
+/* caller must hold LOCK2 */
+static inline void _tz1090_gpio_mod_bit(struct tz1090_gpio_bank *bank,
+                                       unsigned int reg_offs,
+                                       unsigned int offset,
+                                       bool val)
+{
+       u32 value;
+
+       value = tz1090_gpio_read(bank, reg_offs);
+       value &= ~BIT(offset);
+       if (val)
+               value |= BIT(offset);
+       tz1090_gpio_write(bank, reg_offs, value);
+}
+
+static void tz1090_gpio_mod_bit(struct tz1090_gpio_bank *bank,
+                               unsigned int reg_offs,
+                               unsigned int offset,
+                               bool val)
+{
+       int lstat;
+
+       __global_lock2(lstat);
+       _tz1090_gpio_mod_bit(bank, reg_offs, offset, val);
+       __global_unlock2(lstat);
+}
+
+static inline int tz1090_gpio_read_bit(struct tz1090_gpio_bank *bank,
+                                      unsigned int reg_offs,
+                                      unsigned int offset)
+{
+       return tz1090_gpio_read(bank, reg_offs) & BIT(offset);
+}
+
+/* GPIO chip callbacks */
+
+static int tz1090_gpio_direction_input(struct gpio_chip *chip,
+                                      unsigned int offset)
+{
+       struct tz1090_gpio_bank *bank = to_bank(chip);
+       tz1090_gpio_set_bit(bank, REG_GPIO_DIR, offset);
+
+       return 0;
+}
+
+static int tz1090_gpio_direction_output(struct gpio_chip *chip,
+                                       unsigned int offset, int output_value)
+{
+       struct tz1090_gpio_bank *bank = to_bank(chip);
+       int lstat;
+
+       __global_lock2(lstat);
+       _tz1090_gpio_mod_bit(bank, REG_GPIO_DOUT, offset, output_value);
+       _tz1090_gpio_clear_bit(bank, REG_GPIO_DIR, offset);
+       __global_unlock2(lstat);
+
+       return 0;
+}
+
+/*
+ * Return GPIO level
+ */
+static int tz1090_gpio_get(struct gpio_chip *chip, unsigned int offset)
+{
+       struct tz1090_gpio_bank *bank = to_bank(chip);
+
+       return tz1090_gpio_read_bit(bank, REG_GPIO_DIN, offset);
+}
+
+/*
+ * Set output GPIO level
+ */
+static void tz1090_gpio_set(struct gpio_chip *chip, unsigned int offset,
+                           int output_value)
+{
+       struct tz1090_gpio_bank *bank = to_bank(chip);
+
+       tz1090_gpio_mod_bit(bank, REG_GPIO_DOUT, offset, output_value);
+}
+
+static int tz1090_gpio_request(struct gpio_chip *chip, unsigned int offset)
+{
+       struct tz1090_gpio_bank *bank = to_bank(chip);
+       int ret;
+
+       ret = pinctrl_request_gpio(chip->base + offset);
+       if (ret)
+               return ret;
+
+       tz1090_gpio_set_bit(bank, REG_GPIO_DIR, offset);
+       tz1090_gpio_set_bit(bank, REG_GPIO_BIT_EN, offset);
+
+       return 0;
+}
+
+static void tz1090_gpio_free(struct gpio_chip *chip, unsigned int offset)
+{
+       struct tz1090_gpio_bank *bank = to_bank(chip);
+
+       pinctrl_free_gpio(chip->base + offset);
+
+       tz1090_gpio_clear_bit(bank, REG_GPIO_BIT_EN, offset);
+}
+
+static int tz1090_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
+{
+       struct tz1090_gpio_bank *bank = to_bank(chip);
+
+       if (!bank->domain)
+               return -EINVAL;
+
+       return irq_create_mapping(bank->domain, offset);
+}
+
+/* IRQ chip handlers */
+
+/* Get TZ1090 GPIO chip from irq data provided to generic IRQ callbacks */
+static inline struct tz1090_gpio_bank *irqd_to_gpio_bank(struct irq_data *data)
+{
+       return (struct tz1090_gpio_bank *)data->domain->host_data;
+}
+
+static void tz1090_gpio_irq_polarity(struct tz1090_gpio_bank *bank,
+                                    unsigned int offset, unsigned int polarity)
+{
+       tz1090_gpio_mod_bit(bank, REG_GPIO_IRQ_PLRT, offset, polarity);
+}
+
+static void tz1090_gpio_irq_type(struct tz1090_gpio_bank *bank,
+                                unsigned int offset, unsigned int type)
+{
+       tz1090_gpio_mod_bit(bank, REG_GPIO_IRQ_TYPE, offset, type);
+}
+
+/* set polarity to trigger on next edge, whether rising or falling */
+static void tz1090_gpio_irq_next_edge(struct tz1090_gpio_bank *bank,
+                                     unsigned int offset)
+{
+       unsigned int value_p, value_i;
+       int lstat;
+
+       /*
+        * Set the GPIO's interrupt polarity to the opposite of the current
+        * input value so that the next edge triggers an interrupt.
+        */
+       __global_lock2(lstat);
+       value_i = ~tz1090_gpio_read(bank, REG_GPIO_DIN);
+       value_p = tz1090_gpio_read(bank, REG_GPIO_IRQ_PLRT);
+       value_p &= ~BIT(offset);
+       value_p |= value_i & BIT(offset);
+       tz1090_gpio_write(bank, REG_GPIO_IRQ_PLRT, value_p);
+       __global_unlock2(lstat);
+}
+
+static unsigned int gpio_startup_irq(struct irq_data *data)
+{
+       /*
+        * This warning indicates that the type of the irq hasn't been set
+        * before enabling the irq. This would normally be done by passing some
+        * trigger flags to request_irq().
+        */
+       WARN(irqd_get_trigger_type(data) == IRQ_TYPE_NONE,
+               "irq type not set before enabling gpio irq %d", data->irq);
+
+       irq_gc_ack_clr_bit(data);
+       irq_gc_mask_set_bit(data);
+       return 0;
+}
+
+static int gpio_set_irq_type(struct irq_data *data, unsigned int flow_type)
+{
+       struct tz1090_gpio_bank *bank = irqd_to_gpio_bank(data);
+       unsigned int type;
+       unsigned int polarity;
+
+       switch (flow_type) {
+       case IRQ_TYPE_EDGE_BOTH:
+               type = REG_GPIO_IRQ_TYPE_EDGE;
+               polarity = REG_GPIO_IRQ_PLRT_LOW;
+               break;
+       case IRQ_TYPE_EDGE_RISING:
+               type = REG_GPIO_IRQ_TYPE_EDGE;
+               polarity = REG_GPIO_IRQ_PLRT_HIGH;
+               break;
+       case IRQ_TYPE_EDGE_FALLING:
+               type = REG_GPIO_IRQ_TYPE_EDGE;
+               polarity = REG_GPIO_IRQ_PLRT_LOW;
+               break;
+       case IRQ_TYPE_LEVEL_HIGH:
+               type = REG_GPIO_IRQ_TYPE_LEVEL;
+               polarity = REG_GPIO_IRQ_PLRT_HIGH;
+               break;
+       case IRQ_TYPE_LEVEL_LOW:
+               type = REG_GPIO_IRQ_TYPE_LEVEL;
+               polarity = REG_GPIO_IRQ_PLRT_LOW;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       tz1090_gpio_irq_type(bank, data->hwirq, type);
+       irq_setup_alt_chip(data, flow_type);
+
+       if (flow_type == IRQ_TYPE_EDGE_BOTH)
+               tz1090_gpio_irq_next_edge(bank, data->hwirq);
+       else
+               tz1090_gpio_irq_polarity(bank, data->hwirq, polarity);
+
+       return 0;
+}
+
+#ifdef CONFIG_SUSPEND
+static int gpio_set_irq_wake(struct irq_data *data, unsigned int on)
+{
+       struct tz1090_gpio_bank *bank = irqd_to_gpio_bank(data);
+
+#ifdef CONFIG_PM_DEBUG
+       pr_info("irq_wake irq%d state:%d\n", data->irq, on);
+#endif
+
+       /* wake on gpio block interrupt */
+       return irq_set_irq_wake(bank->irq, on);
+}
+#else
+#define gpio_set_irq_wake NULL
+#endif
+
+static void tz1090_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+{
+       irq_hw_number_t hw;
+       unsigned int irq_stat, irq_no;
+       struct tz1090_gpio_bank *bank;
+       struct irq_desc *child_desc;
+
+       bank = (struct tz1090_gpio_bank *)irq_desc_get_handler_data(desc);
+       irq_stat = tz1090_gpio_read(bank, REG_GPIO_DIR) &
+                  tz1090_gpio_read(bank, REG_GPIO_IRQ_STS) &
+                  tz1090_gpio_read(bank, REG_GPIO_IRQ_EN) &
+                  0x3FFFFFFF; /* 30 bits only */
+
+       for (hw = 0; irq_stat; irq_stat >>= 1, ++hw) {
+               if (!(irq_stat & 1))
+                       continue;
+
+               irq_no = irq_linear_revmap(bank->domain, hw);
+               child_desc = irq_to_desc(irq_no);
+
+               /* Toggle edge for pin with both edges triggering enabled */
+               if (irqd_get_trigger_type(&child_desc->irq_data)
+                               == IRQ_TYPE_EDGE_BOTH)
+                       tz1090_gpio_irq_next_edge(bank, hw);
+
+               generic_handle_irq_desc(irq_no, child_desc);
+       }
+}
+
+static int tz1090_gpio_bank_probe(struct tz1090_gpio_bank_info *info)
+{
+       struct device_node *np = info->node;
+       struct device *dev = info->priv->dev;
+       struct tz1090_gpio_bank *bank;
+       struct irq_chip_generic *gc;
+       int err;
+
+       bank = devm_kzalloc(dev, sizeof(*bank), GFP_KERNEL);
+       if (!bank) {
+               dev_err(dev, "unable to allocate driver data\n");
+               return -ENOMEM;
+       }
+
+       /* Offset the main registers to the first register in this bank */
+       bank->reg = info->priv->reg + info->index * 4;
+
+       /* Set up GPIO chip */
+       snprintf(bank->label, sizeof(bank->label), "tz1090-gpio-%u",
+                info->index);
+       bank->chip.label                = bank->label;
+       bank->chip.dev                  = dev;
+       bank->chip.direction_input      = tz1090_gpio_direction_input;
+       bank->chip.direction_output     = tz1090_gpio_direction_output;
+       bank->chip.get                  = tz1090_gpio_get;
+       bank->chip.set                  = tz1090_gpio_set;
+       bank->chip.free                 = tz1090_gpio_free;
+       bank->chip.request              = tz1090_gpio_request;
+       bank->chip.to_irq               = tz1090_gpio_to_irq;
+       bank->chip.of_node              = np;
+
+       /* GPIO numbering from 0 */
+       bank->chip.base                 = info->index * 30;
+       bank->chip.ngpio                = 30;
+
+       /* Add the GPIO bank */
+       gpiochip_add(&bank->chip);
+
+       /* Get the GPIO bank IRQ if provided */
+       bank->irq = irq_of_parse_and_map(np, 0);
+
+       /* The interrupt is optional (it may be used by another core on chip) */
+       if (bank->irq < 0) {
+               dev_info(dev, "IRQ not provided for bank %u, IRQs disabled\n",
+                        info->index);
+               return 0;
+       }
+
+       dev_info(dev, "Setting up IRQs for GPIO bank %u\n",
+                info->index);
+
+       /*
+        * Initialise all interrupts to disabled so we don't get
+        * spurious ones on a dirty boot and hit the BUG_ON in the
+        * handler.
+        */
+       tz1090_gpio_write(bank, REG_GPIO_IRQ_EN, 0);
+
+       /* Add a virtual IRQ for each GPIO */
+       bank->domain = irq_domain_add_linear(np,
+                                            bank->chip.ngpio,
+                                            &irq_generic_chip_ops,
+                                            bank);
+
+       /* Set up a generic irq chip with 2 chip types (level and edge) */
+       err = irq_alloc_domain_generic_chips(bank->domain, bank->chip.ngpio, 2,
+                                            bank->label, handle_bad_irq, 0, 0,
+                                            IRQ_GC_INIT_NESTED_LOCK);
+       if (err) {
+               dev_info(dev,
+                        "irq_alloc_domain_generic_chips failed for bank %u, IRQs disabled\n",
+                        info->index);
+               irq_domain_remove(bank->domain);
+               return 0;
+       }
+
+       gc = irq_get_domain_generic_chip(bank->domain, 0);
+       gc->reg_base    = bank->reg;
+
+       /* level chip type */
+       gc->chip_types[0].type                  = IRQ_TYPE_LEVEL_MASK;
+       gc->chip_types[0].handler               = handle_level_irq;
+       gc->chip_types[0].regs.ack              = REG_GPIO_IRQ_STS;
+       gc->chip_types[0].regs.mask             = REG_GPIO_IRQ_EN;
+       gc->chip_types[0].chip.irq_startup      = gpio_startup_irq,
+       gc->chip_types[0].chip.irq_ack          = irq_gc_ack_clr_bit,
+       gc->chip_types[0].chip.irq_mask         = irq_gc_mask_clr_bit,
+       gc->chip_types[0].chip.irq_unmask       = irq_gc_mask_set_bit,
+       gc->chip_types[0].chip.irq_set_type     = gpio_set_irq_type,
+       gc->chip_types[0].chip.irq_set_wake     = gpio_set_irq_wake,
+       gc->chip_types[0].chip.flags            = IRQCHIP_MASK_ON_SUSPEND,
+
+       /* edge chip type */
+       gc->chip_types[1].type                  = IRQ_TYPE_EDGE_BOTH;
+       gc->chip_types[1].handler               = handle_edge_irq;
+       gc->chip_types[1].regs.ack              = REG_GPIO_IRQ_STS;
+       gc->chip_types[1].regs.mask             = REG_GPIO_IRQ_EN;
+       gc->chip_types[1].chip.irq_startup      = gpio_startup_irq,
+       gc->chip_types[1].chip.irq_ack          = irq_gc_ack_clr_bit,
+       gc->chip_types[1].chip.irq_mask         = irq_gc_mask_clr_bit,
+       gc->chip_types[1].chip.irq_unmask       = irq_gc_mask_set_bit,
+       gc->chip_types[1].chip.irq_set_type     = gpio_set_irq_type,
+       gc->chip_types[1].chip.irq_set_wake     = gpio_set_irq_wake,
+       gc->chip_types[1].chip.flags            = IRQCHIP_MASK_ON_SUSPEND,
+
+       /* Setup chained handler for this GPIO bank */
+       irq_set_handler_data(bank->irq, bank);
+       irq_set_chained_handler(bank->irq, tz1090_gpio_irq_handler);
+
+       return 0;
+}
+
+static void tz1090_gpio_register_banks(struct tz1090_gpio *priv)
+{
+       struct device_node *np = priv->dev->of_node;
+       struct device_node *node;
+
+       for_each_available_child_of_node(np, node) {
+               struct tz1090_gpio_bank_info info;
+               u32 addr;
+               int ret;
+
+               ret = of_property_read_u32(node, "reg", &addr);
+               if (ret) {
+                       dev_err(priv->dev, "invalid reg on %s\n",
+                               node->full_name);
+                       continue;
+               }
+               if (addr >= 3) {
+                       dev_err(priv->dev, "index %u in %s out of range\n",
+                               addr, node->full_name);
+                       continue;
+               }
+
+               info.index = addr;
+               info.node = of_node_get(node);
+               info.priv = priv;
+
+               ret = tz1090_gpio_bank_probe(&info);
+               if (ret) {
+                       dev_err(priv->dev, "failure registering %s\n",
+                               node->full_name);
+                       of_node_put(node);
+                       continue;
+               }
+       }
+}
+
+static int tz1090_gpio_probe(struct platform_device *pdev)
+{
+       struct device_node *np = pdev->dev.of_node;
+       struct resource *res_regs;
+       struct tz1090_gpio priv;
+
+       if (!np) {
+               dev_err(&pdev->dev, "must be instantiated via devicetree\n");
+               return -ENOENT;
+       }
+
+       res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res_regs) {
+               dev_err(&pdev->dev, "cannot find registers resource\n");
+               return -ENOENT;
+       }
+
+       priv.dev = &pdev->dev;
+
+       /* Ioremap the registers */
+       priv.reg = devm_ioremap(&pdev->dev, res_regs->start,
+                                res_regs->end - res_regs->start);
+       if (!priv.reg) {
+               dev_err(&pdev->dev, "unable to ioremap registers\n");
+               return -ENOMEM;
+       }
+
+       /* Look for banks */
+       tz1090_gpio_register_banks(&priv);
+
+       return 0;
+}
+
+static struct of_device_id tz1090_gpio_of_match[] = {
+       { .compatible = "img,tz1090-gpio" },
+       { },
+};
+
+static struct platform_driver tz1090_gpio_driver = {
+       .driver = {
+               .name           = "tz1090-gpio",
+               .owner          = THIS_MODULE,
+               .of_match_table = tz1090_gpio_of_match,
+       },
+       .probe          = tz1090_gpio_probe,
+};
+
+static int __init tz1090_gpio_init(void)
+{
+       return platform_driver_register(&tz1090_gpio_driver);
+}
+subsys_initcall(tz1090_gpio_init);
index 6d0feb2..1a605f2 100644 (file)
@@ -45,7 +45,7 @@ static void ucb1400_gpio_set(struct gpio_chip *gc, unsigned off, int val)
 
 static int ucb1400_gpio_probe(struct platform_device *dev)
 {
-       struct ucb1400_gpio *ucb = dev->dev.platform_data;
+       struct ucb1400_gpio *ucb = dev_get_platdata(&dev->dev);
        int err = 0;
 
        if (!(ucb && ucb->gpio_offset)) {
index 2a743e1..456000c 100644 (file)
@@ -246,7 +246,7 @@ static struct gpio_chip template_chip = {
 static int wm831x_gpio_probe(struct platform_device *pdev)
 {
        struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
-       struct wm831x_pdata *pdata = wm831x->dev->platform_data;
+       struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
        struct wm831x_gpio *wm831x_gpio;
        int ret;
 
index 0b598cf..fc49154 100644 (file)
@@ -112,7 +112,7 @@ static struct gpio_chip template_chip = {
 static int wm8350_gpio_probe(struct platform_device *pdev)
 {
        struct wm8350 *wm8350 = dev_get_drvdata(pdev->dev.parent);
-       struct wm8350_platform_data *pdata = wm8350->dev->platform_data;
+       struct wm8350_platform_data *pdata = dev_get_platdata(wm8350->dev);
        struct wm8350_gpio_data *wm8350_gpio;
        int ret;
 
index ae409fd..a53dbde 100644 (file)
@@ -248,7 +248,7 @@ static struct gpio_chip template_chip = {
 static int wm8994_gpio_probe(struct platform_device *pdev)
 {
        struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent);
-       struct wm8994_pdata *pdata = wm8994->dev->platform_data;
+       struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev);
        struct wm8994_gpio *wm8994_gpio;
        int ret;
 
index 665f953..ba9876f 100644 (file)
@@ -76,7 +76,8 @@ int of_get_named_gpio_flags(struct device_node *np, const char *propname,
        ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index,
                                         &gg_data.gpiospec);
        if (ret) {
-               pr_debug("%s: can't parse gpios property\n", __func__);
+               pr_debug("%s: can't parse gpios property of node '%s[%d]'\n",
+                       __func__, np->full_name, index);
                return ret;
        }
 
index ff0fd65..86ef346 100644 (file)
@@ -349,7 +349,7 @@ static ssize_t gpio_value_store(struct device *dev,
        else {
                long            value;
 
-               status = strict_strtol(buf, 0, &value);
+               status = kstrtol(buf, 0, &value);
                if (status == 0) {
                        if (test_bit(FLAG_ACTIVE_LOW, &desc->flags))
                                value = !value;
@@ -570,7 +570,7 @@ static ssize_t gpio_active_low_store(struct device *dev,
        } else {
                long            value;
 
-               status = strict_strtol(buf, 0, &value);
+               status = kstrtol(buf, 0, &value);
                if (status == 0)
                        status = sysfs_set_active_low(desc, dev, value != 0);
        }
@@ -652,7 +652,7 @@ static ssize_t export_store(struct class *class,
        struct gpio_desc        *desc;
        int                     status;
 
-       status = strict_strtol(buf, 0, &gpio);
+       status = kstrtol(buf, 0, &gpio);
        if (status < 0)
                goto done;
 
@@ -694,7 +694,7 @@ static ssize_t unexport_store(struct class *class,
        struct gpio_desc        *desc;
        int                     status;
 
-       status = strict_strtol(buf, 0, &gpio);
+       status = kstrtol(buf, 0, &gpio);
        if (status < 0)
                goto done;
 
@@ -1398,7 +1398,7 @@ static int gpiod_request(struct gpio_desc *desc, const char *label)
        int                     status = -EPROBE_DEFER;
        unsigned long           flags;
 
-       if (!desc) {
+       if (!desc || !desc->chip) {
                pr_warn("%s: invalid GPIO\n", __func__);
                return -EINVAL;
        }
@@ -1406,8 +1406,6 @@ static int gpiod_request(struct gpio_desc *desc, const char *label)
        spin_lock_irqsave(&gpio_lock, flags);
 
        chip = desc->chip;
-       if (chip == NULL)
-               goto done;
 
        if (!try_module_get(chip->owner))
                goto done;
@@ -1630,16 +1628,20 @@ static int gpiod_direction_input(struct gpio_desc *desc)
        int                     status = -EINVAL;
        int                     offset;
 
-       if (!desc) {
+       if (!desc || !desc->chip) {
                pr_warn("%s: invalid GPIO\n", __func__);
                return -EINVAL;
        }
 
+       chip = desc->chip;
+       if (!chip->get || !chip->direction_input) {
+               pr_warn("%s: missing get() or direction_input() operations\n",
+                       __func__);
+               return -EIO;
+       }
+
        spin_lock_irqsave(&gpio_lock, flags);
 
-       chip = desc->chip;
-       if (!chip || !chip->get || !chip->direction_input)
-               goto fail;
        status = gpio_ensure_requested(desc);
        if (status < 0)
                goto fail;
@@ -1691,7 +1693,7 @@ static int gpiod_direction_output(struct gpio_desc *desc, int value)
        int                     status = -EINVAL;
        int offset;
 
-       if (!desc) {
+       if (!desc || !desc->chip) {
                pr_warn("%s: invalid GPIO\n", __func__);
                return -EINVAL;
        }
@@ -1704,11 +1706,15 @@ static int gpiod_direction_output(struct gpio_desc *desc, int value)
        if (!value && test_bit(FLAG_OPEN_SOURCE,  &desc->flags))
                return gpiod_direction_input(desc);
 
+       chip = desc->chip;
+       if (!chip->set || !chip->direction_output) {
+               pr_warn("%s: missing set() or direction_output() operations\n",
+                       __func__);
+               return -EIO;
+       }
+
        spin_lock_irqsave(&gpio_lock, flags);
 
-       chip = desc->chip;
-       if (!chip || !chip->set || !chip->direction_output)
-               goto fail;
        status = gpio_ensure_requested(desc);
        if (status < 0)
                goto fail;
@@ -1757,6 +1763,9 @@ EXPORT_SYMBOL_GPL(gpio_direction_output);
  * gpio_set_debounce - sets @debounce time for a @gpio
  * @gpio: the gpio to set debounce time
  * @debounce: debounce time is microseconds
+ *
+ * returns -ENOTSUPP if the controller does not support setting
+ * debounce.
  */
 static int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
 {
@@ -1765,16 +1774,19 @@ static int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
        int                     status = -EINVAL;
        int                     offset;
 
-       if (!desc) {
+       if (!desc || !desc->chip) {
                pr_warn("%s: invalid GPIO\n", __func__);
                return -EINVAL;
        }
 
-       spin_lock_irqsave(&gpio_lock, flags);
-
        chip = desc->chip;
-       if (!chip || !chip->set || !chip->set_debounce)
-               goto fail;
+       if (!chip->set || !chip->set_debounce) {
+               pr_debug("%s: missing set() or set_debounce() operations\n",
+                       __func__);
+               return -ENOTSUPP;
+       }
+
+       spin_lock_irqsave(&gpio_lock, flags);
 
        status = gpio_ensure_requested(desc);
        if (status < 0)
index b9b776f..d8dd269 100644 (file)
@@ -1541,7 +1541,7 @@ int r300_init(struct radeon_device *rdev)
        rdev->accel_working = true;
        r = r300_startup(rdev);
        if (r) {
-               /* Somethings want wront with the accel init stop accel */
+               /* Something went wrong with the accel init, so stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
index 14ef6ab..3d7c9f6 100644 (file)
@@ -743,6 +743,14 @@ config HID_WIIMOTE
        To compile this driver as a module, choose M here: the
        module will be called hid-wiimote.
 
+config HID_XINMO
+       tristate "Xin-Mo non-fully compliant devices"
+       depends on HID
+       ---help---
+       Support for Xin-Mo devices that are not fully compliant with the HID
+       standard. Currently only supports the Xin-Mo Dual Arcade. Say Y here
+       if you have a Xin-Mo Dual Arcade controller.
+
 config HID_ZEROPLUS
        tristate "Zeroplus based game controller support"
        depends on HID
index 6f68728..a959f4a 100644 (file)
@@ -110,6 +110,7 @@ obj-$(CONFIG_HID_TIVO)              += hid-tivo.o
 obj-$(CONFIG_HID_TOPSEED)      += hid-topseed.o
 obj-$(CONFIG_HID_TWINHAN)      += hid-twinhan.o
 obj-$(CONFIG_HID_UCLOGIC)      += hid-uclogic.o
+obj-$(CONFIG_HID_XINMO)                += hid-xinmo.o
 obj-$(CONFIG_HID_ZEROPLUS)     += hid-zpff.o
 obj-$(CONFIG_HID_ZYDACRON)     += hid-zydacron.o
 obj-$(CONFIG_HID_WACOM)                += hid-wacom.o
index 7c5507e..9428ea7 100644 (file)
@@ -90,11 +90,10 @@ static int a4_probe(struct hid_device *hdev, const struct hid_device_id *id)
        struct a4tech_sc *a4;
        int ret;
 
-       a4 = kzalloc(sizeof(*a4), GFP_KERNEL);
+       a4 = devm_kzalloc(&hdev->dev, sizeof(*a4), GFP_KERNEL);
        if (a4 == NULL) {
                hid_err(hdev, "can't alloc device descriptor\n");
-               ret = -ENOMEM;
-               goto err_free;
+               return -ENOMEM;
        }
 
        a4->quirks = id->driver_data;
@@ -104,27 +103,16 @@ static int a4_probe(struct hid_device *hdev, const struct hid_device_id *id)
        ret = hid_parse(hdev);
        if (ret) {
                hid_err(hdev, "parse failed\n");
-               goto err_free;
+               return ret;
        }
 
        ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
        if (ret) {
                hid_err(hdev, "hw start failed\n");
-               goto err_free;
+               return ret;
        }
 
        return 0;
-err_free:
-       kfree(a4);
-       return ret;
-}
-
-static void a4_remove(struct hid_device *hdev)
-{
-       struct a4tech_sc *a4 = hid_get_drvdata(hdev);
-
-       hid_hw_stop(hdev);
-       kfree(a4);
 }
 
 static const struct hid_device_id a4_devices[] = {
@@ -144,7 +132,6 @@ static struct hid_driver a4_driver = {
        .input_mapped = a4_input_mapped,
        .event = a4_event,
        .probe = a4_probe,
-       .remove = a4_remove,
 };
 module_hid_driver(a4_driver);
 
index c7710b5..881cf7b 100644 (file)
@@ -349,7 +349,7 @@ static int apple_probe(struct hid_device *hdev,
        unsigned int connect_mask = HID_CONNECT_DEFAULT;
        int ret;
 
-       asc = kzalloc(sizeof(*asc), GFP_KERNEL);
+       asc = devm_kzalloc(&hdev->dev, sizeof(*asc), GFP_KERNEL);
        if (asc == NULL) {
                hid_err(hdev, "can't alloc apple descriptor\n");
                return -ENOMEM;
@@ -362,7 +362,7 @@ static int apple_probe(struct hid_device *hdev,
        ret = hid_parse(hdev);
        if (ret) {
                hid_err(hdev, "parse failed\n");
-               goto err_free;
+               return ret;
        }
 
        if (quirks & APPLE_HIDDEV)
@@ -373,19 +373,10 @@ static int apple_probe(struct hid_device *hdev,
        ret = hid_hw_start(hdev, connect_mask);
        if (ret) {
                hid_err(hdev, "hw start failed\n");
-               goto err_free;
+               return ret;
        }
 
        return 0;
-err_free:
-       kfree(asc);
-       return ret;
-}
-
-static void apple_remove(struct hid_device *hdev)
-{
-       hid_hw_stop(hdev);
-       kfree(hid_get_drvdata(hdev));
 }
 
 static const struct hid_device_id apple_devices[] = {
@@ -551,7 +542,6 @@ static struct hid_driver apple_driver = {
        .id_table = apple_devices,
        .report_fixup = apple_report_fixup,
        .probe = apple_probe,
-       .remove = apple_remove,
        .event = apple_event,
        .input_mapping = apple_input_mapping,
        .input_mapped = apple_input_mapped,
index b8f1c77..ae88a97 100644 (file)
@@ -63,6 +63,8 @@ struct hid_report *hid_register_report(struct hid_device *device, unsigned type,
        struct hid_report_enum *report_enum = device->report_enum + type;
        struct hid_report *report;
 
+       if (id >= HID_MAX_IDS)
+               return NULL;
        if (report_enum->report_id_hash[id])
                return report_enum->report_id_hash[id];
 
@@ -404,8 +406,10 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
 
        case HID_GLOBAL_ITEM_TAG_REPORT_ID:
                parser->global.report_id = item_udata(item);
-               if (parser->global.report_id == 0) {
-                       hid_err(parser->device, "report_id 0 is invalid\n");
+               if (parser->global.report_id == 0 ||
+                   parser->global.report_id >= HID_MAX_IDS) {
+                       hid_err(parser->device, "report_id %u is invalid\n",
+                               parser->global.report_id);
                        return -1;
                }
                return 0;
@@ -450,7 +454,7 @@ static int hid_parser_local(struct hid_parser *parser, struct hid_item *item)
                        }
                        parser->local.delimiter_depth--;
                }
-               return 1;
+               return 0;
 
        case HID_LOCAL_ITEM_TAG_USAGE:
 
@@ -575,7 +579,7 @@ static void hid_close_report(struct hid_device *device)
        for (i = 0; i < HID_REPORT_TYPES; i++) {
                struct hid_report_enum *report_enum = device->report_enum + i;
 
-               for (j = 0; j < 256; j++) {
+               for (j = 0; j < HID_MAX_IDS; j++) {
                        struct hid_report *report = report_enum->report_id_hash[j];
                        if (report)
                                hid_free_report(report);
@@ -677,12 +681,61 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
        return NULL;
 }
 
-static void hid_scan_usage(struct hid_device *hid, u32 usage)
+static void hid_scan_input_usage(struct hid_parser *parser, u32 usage)
 {
+       struct hid_device *hid = parser->device;
+
        if (usage == HID_DG_CONTACTID)
                hid->group = HID_GROUP_MULTITOUCH;
 }
 
+static void hid_scan_feature_usage(struct hid_parser *parser, u32 usage)
+{
+       if (usage == 0xff0000c5 && parser->global.report_count == 256 &&
+           parser->global.report_size == 8)
+               parser->scan_flags |= HID_SCAN_FLAG_MT_WIN_8;
+}
+
+static void hid_scan_collection(struct hid_parser *parser, unsigned type)
+{
+       struct hid_device *hid = parser->device;
+
+       if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
+           type == HID_COLLECTION_PHYSICAL)
+               hid->group = HID_GROUP_SENSOR_HUB;
+}
+
+static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
+{
+       __u32 data;
+       int i;
+
+       data = item_udata(item);
+
+       switch (item->tag) {
+       case HID_MAIN_ITEM_TAG_BEGIN_COLLECTION:
+               hid_scan_collection(parser, data & 0xff);
+               break;
+       case HID_MAIN_ITEM_TAG_END_COLLECTION:
+               break;
+       case HID_MAIN_ITEM_TAG_INPUT:
+               for (i = 0; i < parser->local.usage_index; i++)
+                       hid_scan_input_usage(parser, parser->local.usage[i]);
+               break;
+       case HID_MAIN_ITEM_TAG_OUTPUT:
+               break;
+       case HID_MAIN_ITEM_TAG_FEATURE:
+               for (i = 0; i < parser->local.usage_index; i++)
+                       hid_scan_feature_usage(parser, parser->local.usage[i]);
+               break;
+       }
+
+       /* Reset the local parser environment */
+       memset(&parser->local, 0, sizeof(parser->local));
+
+       return 0;
+}
+
 /*
  * Scan a report descriptor before the device is added to the bus.
  * Sets device groups and other properties that determine what driver
@@ -690,48 +743,41 @@ static void hid_scan_usage(struct hid_device *hid, u32 usage)
  */
 static int hid_scan_report(struct hid_device *hid)
 {
-       unsigned int page = 0, delim = 0;
+       struct hid_parser *parser;
+       struct hid_item item;
        __u8 *start = hid->dev_rdesc;
        __u8 *end = start + hid->dev_rsize;
-       unsigned int u, u_min = 0, u_max = 0;
-       struct hid_item item;
+       static int (*dispatch_type[])(struct hid_parser *parser,
+                                     struct hid_item *item) = {
+               hid_scan_main,
+               hid_parser_global,
+               hid_parser_local,
+               hid_parser_reserved
+       };
+
+       parser = vzalloc(sizeof(struct hid_parser));
+       if (!parser)
+               return -ENOMEM;
 
+       parser->device = hid;
        hid->group = HID_GROUP_GENERIC;
-       while ((start = fetch_item(start, end, &item)) != NULL) {
-               if (item.format != HID_ITEM_FORMAT_SHORT)
-                       return -EINVAL;
-               if (item.type == HID_ITEM_TYPE_GLOBAL) {
-                       if (item.tag == HID_GLOBAL_ITEM_TAG_USAGE_PAGE)
-                               page = item_udata(&item) << 16;
-               } else if (item.type == HID_ITEM_TYPE_LOCAL) {
-                       if (delim > 1)
-                               break;
-                       u = item_udata(&item);
-                       if (item.size <= 2)
-                               u += page;
-                       switch (item.tag) {
-                       case HID_LOCAL_ITEM_TAG_DELIMITER:
-                               delim += !!u;
-                               break;
-                       case HID_LOCAL_ITEM_TAG_USAGE:
-                               hid_scan_usage(hid, u);
-                               break;
-                       case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM:
-                               u_min = u;
-                               break;
-                       case HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM:
-                               u_max = u;
-                               for (u = u_min; u <= u_max; u++)
-                                       hid_scan_usage(hid, u);
-                               break;
-                       }
-               } else if (page == HID_UP_SENSOR &&
-                       item.type == HID_ITEM_TYPE_MAIN &&
-                       item.tag == HID_MAIN_ITEM_TAG_BEGIN_COLLECTION &&
-                       (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL)
-                       hid->group = HID_GROUP_SENSOR_HUB;
-       }
 
+       /*
+        * The parsing is simpler than the one in hid_open_report() as we should
+        * be robust against hid errors. Those errors will be raised by
+        * hid_open_report() anyway.
+        */
+       while ((start = fetch_item(start, end, &item)) != NULL)
+               dispatch_type[item.type](parser, &item);
+
+       /*
+        * Handle special flags set during scanning.
+        */
+       if ((parser->scan_flags & HID_SCAN_FLAG_MT_WIN_8) &&
+           (hid->group == HID_GROUP_MULTITOUCH))
+               hid->group = HID_GROUP_MULTITOUCH_WIN_8;
+
+       vfree(parser);
        return 0;
 }
 
@@ -1128,7 +1174,8 @@ static void hid_output_field(const struct hid_device *hid,
 }
 
 /*
- * Create a report.
+ * Create a report. 'data' has to be allocated using
+ * hid_alloc_report_buf() so that it has proper size.
  */
 
 void hid_output_report(struct hid_report *report, __u8 *data)
@@ -1145,6 +1192,22 @@ void hid_output_report(struct hid_report *report, __u8 *data)
 EXPORT_SYMBOL_GPL(hid_output_report);
 
 /*
+ * Allocator for buffer that is going to be passed to hid_output_report()
+ */
+u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags)
+{
+       /*
+        * 7 extra bytes are necessary to achieve proper functionality
+        * of implement() working on 8 byte chunks
+        */
+
+       int len = ((report->size - 1) >> 3) + 1 + (report->id > 0) + 7;
+
+       return kmalloc(len, flags);
+}
+EXPORT_SYMBOL_GPL(hid_alloc_report_buf);
+
+/*
  * Set a field value. The report this field belongs to has to be
  * created and transferred to the device, to set this value in the
  * device.
@@ -1152,7 +1215,12 @@ EXPORT_SYMBOL_GPL(hid_output_report);
 
 int hid_set_field(struct hid_field *field, unsigned offset, __s32 value)
 {
-       unsigned size = field->report_size;
+       unsigned size;
+
+       if (!field)
+               return -1;
+
+       size = field->report_size;
 
        hid_dump_input(field->report->device, field->usage + offset, value);
 
@@ -1597,6 +1665,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
@@ -1679,6 +1748,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPLUS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_LUA) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
@@ -1736,6 +1806,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET) },
        { HID_USB_DEVICE(USB_VENDOR_ID_X_TENSIONS, USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ZYDACRON, USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL) },
index 9a8f051..9325545 100644 (file)
@@ -98,7 +98,7 @@ static void holtekff_send(struct holtekff_device *holtekff,
                holtekff->field->value[i] = data[i];
        }
 
-       dbg_hid("sending %*ph\n", 7, data);
+       dbg_hid("sending %7ph\n", data);
 
        hid_hw_request(hid, holtekff->field->report, HID_REQ_SET_REPORT);
 }
index ffe4c7a..e60e8d5 100644 (file)
 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS   0x023b
 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI  0x0255
 #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO   0x0256
-#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI   0x0291
-#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO    0x0292
-#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS    0x0293
+#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI   0x0290
+#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO    0x0291
+#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS    0x0292
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY   0x030a
 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY    0x030b
 #define USB_DEVICE_ID_APPLE_IRCONTROL  0x8240
 #define USB_VENDOR_ID_KYE              0x0458
 #define USB_DEVICE_ID_KYE_ERGO_525V    0x0087
 #define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138
+#define USB_DEVICE_ID_GENIUS_GX_IMPERATOR      0x4018
 #define USB_DEVICE_ID_KYE_GPEN_560     0x5003
 #define USB_DEVICE_ID_KYE_EASYPEN_I405X        0x5010
 #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X       0x5011
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16   0x0012
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17   0x0013
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18   0x0014
+#define USB_DEVICE_ID_NTRIG_DUOSENSE 0x1500
 
 #define USB_VENDOR_ID_ONTRAK           0x0a07
 #define USB_DEVICE_ID_ONTRAK_ADU100    0x0064
 #define USB_DEVICE_ID_ROCCAT_KONE      0x2ced
 #define USB_DEVICE_ID_ROCCAT_KONEPLUS  0x2d51
 #define USB_DEVICE_ID_ROCCAT_KONEPURE  0x2dbe
+#define USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL  0x2db4
 #define USB_DEVICE_ID_ROCCAT_KONEXTD   0x2e22
 #define USB_DEVICE_ID_ROCCAT_KOVAPLUS  0x2d50
 #define USB_DEVICE_ID_ROCCAT_LUA       0x2c2e
 #define USB_VENDOR_ID_XAT      0x2505
 #define USB_DEVICE_ID_XAT_CSR  0x0220
 
+#define USB_VENDOR_ID_XIN_MO                   0x16c0
+#define USB_DEVICE_ID_XIN_MO_DUAL_ARCADE       0x05e1
+
 #define USB_VENDOR_ID_XIROKU           0x1477
 #define USB_DEVICE_ID_XIROKU_SPX       0x1006
 #define USB_DEVICE_ID_XIROKU_MPX       0x1007
index 7480799..b420f4a 100644 (file)
@@ -340,7 +340,7 @@ static int hidinput_get_battery_property(struct power_supply *psy,
 {
        struct hid_device *dev = container_of(psy, struct hid_device, battery);
        int ret = 0;
-       __u8 buf[2] = {};
+       __u8 *buf;
 
        switch (prop) {
        case POWER_SUPPLY_PROP_PRESENT:
@@ -349,12 +349,19 @@ static int hidinput_get_battery_property(struct power_supply *psy,
                break;
 
        case POWER_SUPPLY_PROP_CAPACITY:
+
+               buf = kmalloc(2 * sizeof(__u8), GFP_KERNEL);
+               if (!buf) {
+                       ret = -ENOMEM;
+                       break;
+               }
                ret = dev->hid_get_raw_report(dev, dev->battery_report_id,
-                                             buf, sizeof(buf),
+                                             buf, 2,
                                              dev->battery_report_type);
 
                if (ret != 2) {
                        ret = -ENODATA;
+                       kfree(buf);
                        break;
                }
                ret = 0;
@@ -364,6 +371,7 @@ static int hidinput_get_battery_property(struct power_supply *psy,
                    buf[1] <= dev->battery_max)
                        val->intval = (100 * (buf[1] - dev->battery_min)) /
                                (dev->battery_max - dev->battery_min);
+               kfree(buf);
                break;
 
        case POWER_SUPPLY_PROP_MODEL_NAME:
@@ -1137,6 +1145,74 @@ unsigned int hidinput_count_leds(struct hid_device *hid)
 }
 EXPORT_SYMBOL_GPL(hidinput_count_leds);
 
+static void hidinput_led_worker(struct work_struct *work)
+{
+       struct hid_device *hid = container_of(work, struct hid_device,
+                                             led_work);
+       struct hid_field *field;
+       struct hid_report *report;
+       int len;
+       __u8 *buf;
+
+       field = hidinput_get_led_field(hid);
+       if (!field)
+               return;
+
+       /*
+        * field->report is accessed unlocked regarding HID core. So there might
+        * be another incoming SET-LED request from user-space, which changes
+        * the LED state while we assemble our outgoing buffer. However, this
+        * doesn't matter as hid_output_report() correctly converts it into a
+        * boolean value no matter what information is currently set on the LED
+        * field (even garbage). So the remote device will always get a valid
+        * request.
+        * And in case we send a wrong value, a next led worker is spawned
+        * for every SET-LED request so the following worker will send the
+        * correct value, guaranteed!
+        */
+
+       report = field->report;
+
+       /* use custom SET_REPORT request if possible (asynchronous) */
+       if (hid->ll_driver->request)
+               return hid->ll_driver->request(hid, report, HID_REQ_SET_REPORT);
+
+       /* fall back to generic raw-output-report */
+       len = ((report->size - 1) >> 3) + 1 + (report->id > 0);
+       buf = kmalloc(len, GFP_KERNEL);
+       if (!buf)
+               return;
+
+       hid_output_report(report, buf);
+       /* synchronous output report */
+       hid->hid_output_raw_report(hid, buf, len, HID_OUTPUT_REPORT);
+       kfree(buf);
+}
+
+static int hidinput_input_event(struct input_dev *dev, unsigned int type,
+                               unsigned int code, int value)
+{
+       struct hid_device *hid = input_get_drvdata(dev);
+       struct hid_field *field;
+       int offset;
+
+       if (type == EV_FF)
+               return input_ff_event(dev, type, code, value);
+
+       if (type != EV_LED)
+               return -1;
+
+       if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) {
+               hid_warn(dev, "event field not found\n");
+               return -1;
+       }
+
+       hid_set_field(field, offset, value);
+
+       schedule_work(&hid->led_work);
+       return 0;
+}
+
 static int hidinput_open(struct input_dev *dev)
 {
        struct hid_device *hid = input_get_drvdata(dev);
@@ -1183,7 +1259,10 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)
        }
 
        input_set_drvdata(input_dev, hid);
-       input_dev->event = hid->ll_driver->hidinput_input_event;
+       if (hid->ll_driver->hidinput_input_event)
+               input_dev->event = hid->ll_driver->hidinput_input_event;
+       else if (hid->ll_driver->request || hid->hid_output_raw_report)
+               input_dev->event = hidinput_input_event;
        input_dev->open = hidinput_open;
        input_dev->close = hidinput_close;
        input_dev->setkeycode = hidinput_setkeycode;
@@ -1278,6 +1357,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
        int i, j, k;
 
        INIT_LIST_HEAD(&hid->inputs);
+       INIT_WORK(&hid->led_work, hidinput_led_worker);
 
        if (!force) {
                for (i = 0; i < hid->maxcollection; i++) {
@@ -1379,6 +1459,12 @@ void hidinput_disconnect(struct hid_device *hid)
                input_unregister_device(hidinput->input);
                kfree(hidinput);
        }
+
+       /* led_work is spawned by input_dev callbacks, but doesn't access the
+        * parent input_dev at all. Once all input devices are removed, we
+        * know that led_work will never get restarted, so we can cancel it
+        * synchronously and are safe. */
+       cancel_work_sync(&hid->led_work);
 }
 EXPORT_SYMBOL_GPL(hidinput_disconnect);
 
index 1e2ee2a..7384512 100644 (file)
@@ -268,6 +268,26 @@ static __u8 easypen_m610x_rdesc_fixed[] = {
        0xC0                          /*  End Collection                  */
 };
 
+static __u8 *kye_consumer_control_fixup(struct hid_device *hdev, __u8 *rdesc,
+               unsigned int *rsize, int offset, const char *device_name) {
+       /*
+        * the fixup that need to be done:
+        *   - change Usage Maximum in the Comsumer Control
+        *     (report ID 3) to a reasonable value
+        */
+       if (*rsize >= offset + 31 &&
+           /* Usage Page (Consumer Devices) */
+           rdesc[offset] == 0x05 && rdesc[offset + 1] == 0x0c &&
+           /* Usage (Consumer Control) */
+           rdesc[offset + 2] == 0x09 && rdesc[offset + 3] == 0x01 &&
+           /*   Usage Maximum > 12287 */
+           rdesc[offset + 10] == 0x2a && rdesc[offset + 12] > 0x2f) {
+               hid_info(hdev, "fixing up %s report descriptor\n", device_name);
+               rdesc[offset + 12] = 0x2f;
+       }
+       return rdesc;
+}
+
 static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
                unsigned int *rsize)
 {
@@ -315,23 +335,12 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
                }
                break;
        case USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE:
-               /*
-                * the fixup that need to be done:
-                *   - change Usage Maximum in the Comsumer Control
-                *     (report ID 3) to a reasonable value
-                */
-               if (*rsize >= 135 &&
-                       /* Usage Page (Consumer Devices) */
-                       rdesc[104] == 0x05 && rdesc[105] == 0x0c &&
-                       /* Usage (Consumer Control) */
-                       rdesc[106] == 0x09 && rdesc[107] == 0x01 &&
-                       /*   Usage Maximum > 12287 */
-                       rdesc[114] == 0x2a && rdesc[116] > 0x2f) {
-                       hid_info(hdev,
-                                "fixing up Genius Gila Gaming Mouse "
-                                "report descriptor\n");
-                       rdesc[116] = 0x2f;
-               }
+               rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,
+                                       "Genius Gila Gaming Mouse");
+               break;
+       case USB_DEVICE_ID_GENIUS_GX_IMPERATOR:
+               rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83,
+                                       "Genius Gx Imperator Keyboard");
                break;
        }
        return rdesc;
@@ -428,6 +437,8 @@ static const struct hid_device_id kye_devices[] = {
                                USB_DEVICE_ID_KYE_EASYPEN_M610X) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
                                USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
+                               USB_DEVICE_ID_GENIUS_GX_IMPERATOR) },
        { }
 };
 MODULE_DEVICE_TABLE(hid, kye_devices);
index cd33084..7800b14 100644 (file)
@@ -619,7 +619,7 @@ static int logi_dj_ll_input_event(struct input_dev *dev, unsigned int type,
 
        struct hid_field *field;
        struct hid_report *report;
-       unsigned char data[8];
+       unsigned char *data;
        int offset;
 
        dbg_hid("%s: %s, type:%d | code:%d | value:%d\n",
@@ -635,6 +635,13 @@ static int logi_dj_ll_input_event(struct input_dev *dev, unsigned int type,
                return -1;
        }
        hid_set_field(field, offset, value);
+
+       data = hid_alloc_report_buf(field->report, GFP_ATOMIC);
+       if (!data) {
+               dev_warn(&dev->dev, "failed to allocate report buf memory\n");
+               return -1;
+       }
+
        hid_output_report(field->report, &data[0]);
 
        output_report_enum = &dj_rcv_hiddev->report_enum[HID_OUTPUT_REPORT];
@@ -645,8 +652,9 @@ static int logi_dj_ll_input_event(struct input_dev *dev, unsigned int type,
 
        hid_hw_request(dj_rcv_hiddev, report, HID_REQ_SET_REPORT);
 
-       return 0;
+       kfree(data);
 
+       return 0;
 }
 
 static int logi_dj_ll_start(struct hid_device *hid)
@@ -801,10 +809,10 @@ static int logi_dj_probe(struct hid_device *hdev,
        }
 
        /* This is enabling the polling urb on the IN endpoint */
-       retval = hdev->ll_driver->open(hdev);
+       retval = hid_hw_open(hdev);
        if (retval < 0) {
-               dev_err(&hdev->dev, "%s:hdev->ll_driver->open returned "
-                       "error:%d\n", __func__, retval);
+               dev_err(&hdev->dev, "%s:hid_hw_open returned error:%d\n",
+                       __func__, retval);
                goto llopen_failed;
        }
 
@@ -821,7 +829,7 @@ static int logi_dj_probe(struct hid_device *hdev,
        return retval;
 
 logi_dj_recv_query_paired_devices_failed:
-       hdev->ll_driver->close(hdev);
+       hid_hw_close(hdev);
 
 llopen_failed:
 switch_to_dj_mode_fail:
@@ -863,7 +871,7 @@ static void logi_dj_remove(struct hid_device *hdev)
 
        cancel_work_sync(&djrcv_dev->work);
 
-       hdev->ll_driver->close(hdev);
+       hid_hw_close(hdev);
        hid_hw_stop(hdev);
 
        /* I suppose that at this point the only context that can access
index 5bc3734..3b43d1c 100644 (file)
@@ -36,7 +36,7 @@ MODULE_PARM_DESC(emulate_scroll_wheel, "Emulate a scroll wheel");
 static unsigned int scroll_speed = 32;
 static int param_set_scroll_speed(const char *val, struct kernel_param *kp) {
        unsigned long speed;
-       if (!val || strict_strtoul(val, 0, &speed) || speed > 63)
+       if (!val || kstrtoul(val, 0, &speed) || speed > 63)
                return -EINVAL;
        scroll_speed = speed;
        return 0;
@@ -484,7 +484,7 @@ static int magicmouse_probe(struct hid_device *hdev,
        struct hid_report *report;
        int ret;
 
-       msc = kzalloc(sizeof(*msc), GFP_KERNEL);
+       msc = devm_kzalloc(&hdev->dev, sizeof(*msc), GFP_KERNEL);
        if (msc == NULL) {
                hid_err(hdev, "can't alloc magicmouse descriptor\n");
                return -ENOMEM;
@@ -498,13 +498,13 @@ static int magicmouse_probe(struct hid_device *hdev,
        ret = hid_parse(hdev);
        if (ret) {
                hid_err(hdev, "magicmouse hid parse failed\n");
-               goto err_free;
+               return ret;
        }
 
        ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
        if (ret) {
                hid_err(hdev, "magicmouse hw start failed\n");
-               goto err_free;
+               return ret;
        }
 
        if (!msc->input) {
@@ -548,19 +548,9 @@ static int magicmouse_probe(struct hid_device *hdev,
        return 0;
 err_stop_hw:
        hid_hw_stop(hdev);
-err_free:
-       kfree(msc);
        return ret;
 }
 
-static void magicmouse_remove(struct hid_device *hdev)
-{
-       struct magicmouse_sc *msc = hid_get_drvdata(hdev);
-
-       hid_hw_stop(hdev);
-       kfree(msc);
-}
-
 static const struct hid_device_id magic_mice[] = {
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
                USB_DEVICE_ID_APPLE_MAGICMOUSE), .driver_data = 0 },
@@ -574,7 +564,6 @@ static struct hid_driver magicmouse_driver = {
        .name = "magicmouse",
        .id_table = magic_mice,
        .probe = magicmouse_probe,
-       .remove = magicmouse_remove,
        .raw_event = magicmouse_raw_event,
        .input_mapping = magicmouse_input_mapping,
        .input_configured = magicmouse_input_configured,
index cb0e361..ac28f08 100644 (file)
@@ -133,6 +133,7 @@ static void mt_post_parse(struct mt_device *td);
 #define MT_CLS_NSMU                            0x000a
 #define MT_CLS_DUAL_CONTACT_NUMBER             0x0010
 #define MT_CLS_DUAL_CONTACT_ID                 0x0011
+#define MT_CLS_WIN_8                           0x0012
 
 /* vendor specific classes */
 #define MT_CLS_3M                              0x0101
@@ -205,6 +206,11 @@ static struct mt_class mt_classes[] = {
                        MT_QUIRK_CONTACT_CNT_ACCURATE |
                        MT_QUIRK_SLOT_IS_CONTACTID,
                .maxcontacts = 2 },
+       { .name = MT_CLS_WIN_8,
+               .quirks = MT_QUIRK_ALWAYS_VALID |
+                       MT_QUIRK_IGNORE_DUPLICATES |
+                       MT_QUIRK_HOVERING |
+                       MT_QUIRK_CONTACT_CNT_ACCURATE },
 
        /*
         * vendor specific classes
@@ -261,17 +267,6 @@ static struct mt_class mt_classes[] = {
        { }
 };
 
-static void mt_free_input_name(struct hid_input *hi)
-{
-       struct hid_device *hdev = hi->report->device;
-       const char *name = hi->input->name;
-
-       if (name != hdev->name) {
-               hi->input->name = hdev->name;
-               kfree(name);
-       }
-}
-
 static ssize_t mt_show_quirks(struct device *dev,
                           struct device_attribute *attr,
                           char *buf)
@@ -343,19 +338,6 @@ static void mt_feature_mapping(struct hid_device *hdev,
                        td->maxcontacts = td->mtclass.maxcontacts;
 
                break;
-       case 0xff0000c5:
-               if (field->report_count == 256 && field->report_size == 8) {
-                       /* Win 8 devices need special quirks */
-                       __s32 *quirks = &td->mtclass.quirks;
-                       *quirks |= MT_QUIRK_ALWAYS_VALID;
-                       *quirks |= MT_QUIRK_IGNORE_DUPLICATES;
-                       *quirks |= MT_QUIRK_HOVERING;
-                       *quirks |= MT_QUIRK_CONTACT_CNT_ACCURATE;
-                       *quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP;
-                       *quirks &= ~MT_QUIRK_VALID_IS_INRANGE;
-                       *quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE;
-               }
-               break;
        }
 }
 
@@ -415,13 +397,6 @@ static void mt_pen_report(struct hid_device *hid, struct hid_report *report)
 static void mt_pen_input_configured(struct hid_device *hdev,
                                        struct hid_input *hi)
 {
-       char *name = kzalloc(strlen(hi->input->name) + 5, GFP_KERNEL);
-       if (name) {
-               sprintf(name, "%s Pen", hi->input->name);
-               mt_free_input_name(hi);
-               hi->input->name = name;
-       }
-
        /* force BTN_STYLUS to allow tablet matching in udev */
        __set_bit(BTN_STYLUS, hi->input->keybit);
 }
@@ -928,16 +903,26 @@ static void mt_post_parse(struct mt_device *td)
 static void mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
 {
        struct mt_device *td = hid_get_drvdata(hdev);
-       char *name = kstrdup(hdev->name, GFP_KERNEL);
-
-       if (name)
-               hi->input->name = name;
+       char *name;
+       const char *suffix = NULL;
 
        if (hi->report->id == td->mt_report_id)
                mt_touch_input_configured(hdev, hi);
 
-       if (hi->report->id == td->pen_report_id)
+       if (hi->report->field[0]->physical == HID_DG_STYLUS) {
+               suffix = "Pen";
                mt_pen_input_configured(hdev, hi);
+       }
+
+       if (suffix) {
+               name = devm_kzalloc(&hi->input->dev,
+                                   strlen(hdev->name) + strlen(suffix) + 2,
+                                   GFP_KERNEL);
+               if (name) {
+                       sprintf(name, "%s %s", hdev->name, suffix);
+                       hi->input->name = name;
+               }
+       }
 }
 
 static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
@@ -945,7 +930,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
        int ret, i;
        struct mt_device *td;
        struct mt_class *mtclass = mt_classes; /* MT_CLS_DEFAULT */
-       struct hid_input *hi;
 
        for (i = 0; mt_classes[i].name ; i++) {
                if (id->driver_data == mt_classes[i].name) {
@@ -967,7 +951,19 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
        hdev->quirks |= HID_QUIRK_MULTI_INPUT;
        hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
 
-       td = kzalloc(sizeof(struct mt_device), GFP_KERNEL);
+       /*
+        * Handle special quirks for Windows 8 certified devices.
+        */
+       if (id->group == HID_GROUP_MULTITOUCH_WIN_8)
+               /*
+                * Some multitouch screens do not like to be polled for input
+                * reports. Fortunately, the Win8 spec says that all touches
+                * should be sent during each report, making the initialization
+                * of input reports unnecessary.
+                */
+               hdev->quirks |= HID_QUIRK_NO_INIT_INPUT_REPORTS;
+
+       td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL);
        if (!td) {
                dev_err(&hdev->dev, "cannot allocate multitouch data\n");
                return -ENOMEM;
@@ -980,11 +976,11 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
        td->pen_report_id = -1;
        hid_set_drvdata(hdev, td);
 
-       td->fields = kzalloc(sizeof(struct mt_fields), GFP_KERNEL);
+       td->fields = devm_kzalloc(&hdev->dev, sizeof(struct mt_fields),
+                                 GFP_KERNEL);
        if (!td->fields) {
                dev_err(&hdev->dev, "cannot allocate multitouch fields data\n");
-               ret = -ENOMEM;
-               goto fail;
+               return -ENOMEM;
        }
 
        if (id->vendor == HID_ANY_ID && id->product == HID_ANY_ID)
@@ -992,29 +988,22 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
 
        ret = hid_parse(hdev);
        if (ret != 0)
-               goto fail;
+               return ret;
 
        ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
        if (ret)
-               goto hid_fail;
+               return ret;
 
        ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group);
 
        mt_set_maxcontacts(hdev);
        mt_set_input_mode(hdev);
 
-       kfree(td->fields);
+       /* release .fields memory as it is not used anymore */
+       devm_kfree(&hdev->dev, td->fields);
        td->fields = NULL;
 
        return 0;
-
-hid_fail:
-       list_for_each_entry(hi, &hdev->inputs, list)
-               mt_free_input_name(hi);
-fail:
-       kfree(td->fields);
-       kfree(td);
-       return ret;
 }
 
 #ifdef CONFIG_PM
@@ -1039,17 +1028,8 @@ static int mt_resume(struct hid_device *hdev)
 
 static void mt_remove(struct hid_device *hdev)
 {
-       struct mt_device *td = hid_get_drvdata(hdev);
-       struct hid_input *hi;
-
        sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group);
-       list_for_each_entry(hi, &hdev->inputs, list)
-               mt_free_input_name(hi);
-
        hid_hw_stop(hdev);
-
-       kfree(td);
-       hid_set_drvdata(hdev, NULL);
 }
 
 static const struct hid_device_id mt_devices[] = {
@@ -1371,6 +1351,11 @@ static const struct hid_device_id mt_devices[] = {
 
        /* Generic MT device */
        { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) },
+
+       /* Generic Win 8 certified MT device */
+       {  .driver_data = MT_CLS_WIN_8,
+               HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH_WIN_8,
+                       HID_ANY_ID, HID_ANY_ID) },
        { }
 };
 MODULE_DEVICE_TABLE(hid, mt_devices);
index ef95102..600f207 100644 (file)
@@ -115,7 +115,8 @@ static inline int ntrig_get_mode(struct hid_device *hdev)
        struct hid_report *report = hdev->report_enum[HID_FEATURE_REPORT].
                                    report_id_hash[0x0d];
 
-       if (!report)
+       if (!report || report->maxfield < 1 ||
+           report->field[0]->report_count < 1)
                return -EINVAL;
 
        hid_hw_request(hdev, report, HID_REQ_GET_REPORT);
@@ -237,7 +238,7 @@ static ssize_t set_min_width(struct device *dev,
 
        unsigned long val;
 
-       if (strict_strtoul(buf, 0, &val))
+       if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
        if (val > nd->sensor_physical_width)
@@ -272,7 +273,7 @@ static ssize_t set_min_height(struct device *dev,
 
        unsigned long val;
 
-       if (strict_strtoul(buf, 0, &val))
+       if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
        if (val > nd->sensor_physical_height)
@@ -306,7 +307,7 @@ static ssize_t set_activate_slack(struct device *dev,
 
        unsigned long val;
 
-       if (strict_strtoul(buf, 0, &val))
+       if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
        if (val > 0x7f)
@@ -341,7 +342,7 @@ static ssize_t set_activation_width(struct device *dev,
 
        unsigned long val;
 
-       if (strict_strtoul(buf, 0, &val))
+       if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
        if (val > nd->sensor_physical_width)
@@ -377,7 +378,7 @@ static ssize_t set_activation_height(struct device *dev,
 
        unsigned long val;
 
-       if (strict_strtoul(buf, 0, &val))
+       if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
        if (val > nd->sensor_physical_height)
@@ -411,7 +412,7 @@ static ssize_t set_deactivate_slack(struct device *dev,
 
        unsigned long val;
 
-       if (strict_strtoul(buf, 0, &val))
+       if (kstrtoul(buf, 0, &val))
                return -EINVAL;
 
        /*
index e346038..59d5eb1 100644 (file)
@@ -145,6 +145,7 @@ void picolcd_exit_cir(struct picolcd_data *data)
        struct rc_dev *rdev = data->rc_dev;
 
        data->rc_dev = NULL;
-       rc_unregister_device(rdev);
+       if (rdev)
+               rc_unregister_device(rdev);
 }
 
index b48092d..acbb021 100644 (file)
@@ -290,7 +290,7 @@ static ssize_t picolcd_operation_mode_store(struct device *dev,
                buf += 10;
                cnt -= 10;
        }
-       if (!report)
+       if (!report || report->maxfield != 1)
                return -EINVAL;
 
        while (cnt > 0 && (buf[cnt-1] == '\n' || buf[cnt-1] == '\r'))
index 59ab8e1..024cdf3 100644 (file)
@@ -394,7 +394,7 @@ static void dump_buff_as_hex(char *dst, size_t dst_sz, const u8 *data,
 void picolcd_debug_out_report(struct picolcd_data *data,
                struct hid_device *hdev, struct hid_report *report)
 {
-       u8 raw_data[70];
+       u8 *raw_data;
        int raw_size = (report->size >> 3) + 1;
        char *buff;
 #define BUFF_SZ 256
@@ -407,20 +407,20 @@ void picolcd_debug_out_report(struct picolcd_data *data,
        if (!buff)
                return;
 
-       snprintf(buff, BUFF_SZ, "\nout report %d (size %d) =  ",
-                       report->id, raw_size);
-       hid_debug_event(hdev, buff);
-       if (raw_size + 5 > sizeof(raw_data)) {
+       raw_data = hid_alloc_report_buf(report, GFP_ATOMIC);
+       if (!raw_data) {
                kfree(buff);
-               hid_debug_event(hdev, " TOO BIG\n");
                return;
-       } else {
-               raw_data[0] = report->id;
-               hid_output_report(report, raw_data);
-               dump_buff_as_hex(buff, BUFF_SZ, raw_data, raw_size);
-               hid_debug_event(hdev, buff);
        }
 
+       snprintf(buff, BUFF_SZ, "\nout report %d (size %d) =  ",
+                       report->id, raw_size);
+       hid_debug_event(hdev, buff);
+       raw_data[0] = report->id;
+       hid_output_report(report, raw_data);
+       dump_buff_as_hex(buff, BUFF_SZ, raw_data, raw_size);
+       hid_debug_event(hdev, buff);
+
        switch (report->id) {
        case REPORT_LED_STATE:
                /* 1 data byte with GPO state */
@@ -644,6 +644,7 @@ void picolcd_debug_out_report(struct picolcd_data *data,
                break;
        }
        wake_up_interruptible(&hdev->debug_wait);
+       kfree(raw_data);
        kfree(buff);
 }
 
index 591f6b2..c930ab8 100644 (file)
@@ -593,10 +593,14 @@ err_nomem:
 void picolcd_exit_framebuffer(struct picolcd_data *data)
 {
        struct fb_info *info = data->fb_info;
-       struct picolcd_fb_data *fbdata = info->par;
+       struct picolcd_fb_data *fbdata;
        unsigned long flags;
 
+       if (!info)
+               return;
+
        device_remove_file(&data->hdev->dev, &dev_attr_fb_update_rate);
+       fbdata = info->par;
 
        /* disconnect framebuffer from HID dev */
        spin_lock_irqsave(&fbdata->lock, flags);
index d29112f..2dcd7d9 100644 (file)
@@ -132,8 +132,14 @@ static int plff_init(struct hid_device *hid)
                        strong = &report->field[0]->value[2];
                        weak = &report->field[0]->value[3];
                        debug("detected single-field device");
-               } else if (report->maxfield >= 4 && report->field[0]->maxusage == 1 &&
-                               report->field[0]->usage[0].hid == (HID_UP_LED | 0x43)) {
+               } else if (report->field[0]->maxusage == 1 &&
+                          report->field[0]->usage[0].hid ==
+                               (HID_UP_LED | 0x43) &&
+                          report->maxfield >= 4 &&
+                          report->field[0]->report_count >= 1 &&
+                          report->field[1]->report_count >= 1 &&
+                          report->field[2]->report_count >= 1 &&
+                          report->field[3]->report_count >= 1) {
                        report->field[0]->value[0] = 0x00;
                        report->field[1]->value[0] = 0x00;
                        strong = &report->field[2]->value[0];
index eed7f52..1948208 100644 (file)
@@ -59,7 +59,7 @@ static ssize_t arvo_sysfs_set_mode_key(struct device *dev,
        unsigned long state;
        int retval;
 
-       retval = strict_strtoul(buf, 10, &state);
+       retval = kstrtoul(buf, 10, &state);
        if (retval)
                return retval;
 
@@ -109,7 +109,7 @@ static ssize_t arvo_sysfs_set_key_mask(struct device *dev,
        unsigned long key_mask;
        int retval;
 
-       retval = strict_strtoul(buf, 10, &key_mask);
+       retval = kstrtoul(buf, 10, &key_mask);
        if (retval)
                return retval;
 
@@ -163,7 +163,7 @@ static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,
        unsigned long profile;
        int retval;
 
-       retval = strict_strtoul(buf, 10, &profile);
+       retval = kstrtoul(buf, 10, &profile);
        if (retval)
                return retval;
 
index b7a4e10..bc62ed9 100644 (file)
@@ -82,7 +82,7 @@ static ssize_t isku_sysfs_set_actual_profile(struct device *dev,
        isku = hid_get_drvdata(dev_get_drvdata(dev));
        usb_dev = interface_to_usbdev(to_usb_interface(dev));
 
-       retval = strict_strtoul(buf, 10, &profile);
+       retval = kstrtoul(buf, 10, &profile);
        if (retval)
                return retval;
 
index 6e614a8..602c188 100644 (file)
@@ -476,7 +476,7 @@ static ssize_t kone_sysfs_set_tcu(struct device *dev,
        kone = hid_get_drvdata(dev_get_drvdata(dev));
        usb_dev = interface_to_usbdev(to_usb_interface(dev));
 
-       retval = strict_strtoul(buf, 10, &state);
+       retval = kstrtoul(buf, 10, &state);
        if (retval)
                return retval;
 
@@ -566,7 +566,7 @@ static ssize_t kone_sysfs_set_startup_profile(struct device *dev,
        kone = hid_get_drvdata(dev_get_drvdata(dev));
        usb_dev = interface_to_usbdev(to_usb_interface(dev));
 
-       retval = strict_strtoul(buf, 10, &new_startup_profile);
+       retval = kstrtoul(buf, 10, &new_startup_profile);
        if (retval)
                return retval;
 
index db4d8b6..5ddf605 100644 (file)
@@ -267,7 +267,7 @@ static ssize_t koneplus_sysfs_set_actual_profile(struct device *dev,
        koneplus = hid_get_drvdata(dev_get_drvdata(dev));
        usb_dev = interface_to_usbdev(to_usb_interface(dev));
 
-       retval = strict_strtoul(buf, 10, &profile);
+       retval = kstrtoul(buf, 10, &profile);
        if (retval)
                return retval;
 
index fa02b1f..99a605e 100644 (file)
@@ -275,6 +275,7 @@ static int konepure_raw_event(struct hid_device *hdev,
 
 static const struct hid_device_id konepure_devices[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL) },
        { }
 };
 
@@ -313,5 +314,5 @@ module_init(konepure_init);
 module_exit(konepure_exit);
 
 MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat KonePure driver");
+MODULE_DESCRIPTION("USB Roccat KonePure/Optical driver");
 MODULE_LICENSE("GPL v2");
index 8a0f299..515bc03 100644 (file)
@@ -295,7 +295,7 @@ static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,
        kovaplus = hid_get_drvdata(dev_get_drvdata(dev));
        usb_dev = interface_to_usbdev(to_usb_interface(dev));
 
-       retval = strict_strtoul(buf, 10, &profile);
+       retval = kstrtoul(buf, 10, &profile);
        if (retval)
                return retval;
 
index ca74981..10e1581 100644 (file)
@@ -103,8 +103,7 @@ static int sensor_hub_get_physical_device_count(
 
        list_for_each_entry(report, &report_enum->report_list, list) {
                field = report->field[0];
-               if (report->maxfield && field &&
-                                       field->physical)
+               if (report->maxfield && field && field->physical)
                        cnt++;
        }
 
@@ -192,12 +191,12 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
                                u32 field_index, s32 value)
 {
        struct hid_report *report;
-       struct sensor_hub_data *data =  hid_get_drvdata(hsdev->hdev);
+       struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
        int ret = 0;
 
        mutex_lock(&data->mutex);
        report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
-       if (!report || (field_index >=  report->maxfield)) {
+       if (!report || (field_index >= report->maxfield)) {
                ret = -EINVAL;
                goto done_proc;
        }
@@ -216,12 +215,13 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
                                u32 field_index, s32 *value)
 {
        struct hid_report *report;
-       struct sensor_hub_data *data =  hid_get_drvdata(hsdev->hdev);
+       struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
        int ret = 0;
 
        mutex_lock(&data->mutex);
        report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
-       if (!report || (field_index >=  report->maxfield)) {
+       if (!report || (field_index >= report->maxfield) ||
+           report->field[field_index]->report_count < 1) {
                ret = -EINVAL;
                goto done_proc;
        }
@@ -241,7 +241,7 @@ int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
                                        u32 usage_id,
                                        u32 attr_usage_id, u32 report_id)
 {
-       struct sensor_hub_data *data =  hid_get_drvdata(hsdev->hdev);
+       struct sensor_hub_data *data = hid_get_drvdata(hsdev->hdev);
        unsigned long flags;
        struct hid_report *report;
        int ret_val = 0;
@@ -302,7 +302,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
 
        /* Initialize with defaults */
        info->usage_id = usage_id;
-       info->attrib_id =  attr_usage_id;
+       info->attrib_id = attr_usage_id;
        info->report_id = -1;
        info->index = -1;
        info->units = -1;
@@ -333,7 +333,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
                                        if (field->usage[j].hid ==
                                        attr_usage_id &&
                                        field->usage[j].collection_index ==
-                                       collection_index)  {
+                                       collection_index) {
                                                sensor_hub_fill_attr_info(info,
                                                        i, report->id,
                                                        field->unit,
@@ -357,7 +357,7 @@ EXPORT_SYMBOL_GPL(sensor_hub_input_get_attribute_info);
 #ifdef CONFIG_PM
 static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
 {
-       struct sensor_hub_data *pdata =  hid_get_drvdata(hdev);
+       struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
        struct hid_sensor_hub_callbacks_list *callback;
 
        hid_dbg(hdev, " sensor_hub_suspend\n");
@@ -374,7 +374,7 @@ static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
 
 static int sensor_hub_resume(struct hid_device *hdev)
 {
-       struct sensor_hub_data *pdata =  hid_get_drvdata(hdev);
+       struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
        struct hid_sensor_hub_callbacks_list *callback;
 
        hid_dbg(hdev, " sensor_hub_resume\n");
@@ -394,6 +394,7 @@ static int sensor_hub_reset_resume(struct hid_device *hdev)
        return 0;
 }
 #endif
+
 /*
  * Handle raw report as sent by device
  */
@@ -416,12 +417,11 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
                return 1;
 
        ptr = raw_data;
-       ptr++; /*Skip report id*/
+       ptr++; /* Skip report id */
 
        spin_lock_irqsave(&pdata->lock, flags);
 
        for (i = 0; i < report->maxfield; ++i) {
-
                hid_dbg(hdev, "%d collection_index:%x hid:%x sz:%x\n",
                                i, report->field[i]->usage->collection_index,
                                report->field[i]->usage->hid,
@@ -431,11 +431,10 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
                if (pdata->pending.status && pdata->pending.attr_usage_id ==
                                report->field[i]->usage->hid) {
                        hid_dbg(hdev, "data was pending ...\n");
-                       pdata->pending.raw_data = kmalloc(sz, GFP_ATOMIC);
-                       if (pdata->pending.raw_data) {
-                               memcpy(pdata->pending.raw_data, ptr, sz);
-                               pdata->pending.raw_size  = sz;
-                       } else
+                       pdata->pending.raw_data = kmemdup(ptr, sz, GFP_ATOMIC);
+                       if (pdata->pending.raw_data)
+                               pdata->pending.raw_size = sz;
+                       else
                                pdata->pending.raw_size = 0;
                        complete(&pdata->pending.ready);
                }
@@ -478,16 +477,15 @@ static int sensor_hub_probe(struct hid_device *hdev,
        struct hid_field *field;
        int dev_cnt;
 
-       sd = kzalloc(sizeof(struct sensor_hub_data), GFP_KERNEL);
+       sd = devm_kzalloc(&hdev->dev, sizeof(*sd), GFP_KERNEL);
        if (!sd) {
                hid_err(hdev, "cannot allocate Sensor data\n");
                return -ENOMEM;
        }
-       sd->hsdev = kzalloc(sizeof(struct hid_sensor_hub_device), GFP_KERNEL);
+       sd->hsdev = devm_kzalloc(&hdev->dev, sizeof(*sd->hsdev), GFP_KERNEL);
        if (!sd->hsdev) {
                hid_err(hdev, "cannot allocate hid_sensor_hub_device\n");
-               ret = -ENOMEM;
-               goto err_free_hub;
+               return -ENOMEM;
        }
        hid_set_drvdata(hdev, sd);
        sd->hsdev->hdev = hdev;
@@ -499,14 +497,14 @@ static int sensor_hub_probe(struct hid_device *hdev,
        ret = hid_parse(hdev);
        if (ret) {
                hid_err(hdev, "parse failed\n");
-               goto err_free;
+               return ret;
        }
        INIT_LIST_HEAD(&hdev->inputs);
 
        ret = hid_hw_start(hdev, 0);
        if (ret) {
                hid_err(hdev, "hw start failed\n");
-               goto err_free;
+               return ret;
        }
        ret = hid_hw_open(hdev);
        if (ret) {
@@ -539,7 +537,7 @@ static int sensor_hub_probe(struct hid_device *hdev,
                                        field->physical) {
                        name = kasprintf(GFP_KERNEL, "HID-SENSOR-%x",
                                                field->physical);
-                       if (name  == NULL) {
+                       if (name == NULL) {
                                hid_err(hdev, "Failed MFD device name\n");
                                        ret = -ENOMEM;
                                        goto err_free_names;
@@ -571,10 +569,6 @@ err_close:
        hid_hw_close(hdev);
 err_stop_hw:
        hid_hw_stop(hdev);
-err_free:
-       kfree(sd->hsdev);
-err_free_hub:
-       kfree(sd);
 
        return ret;
 }
@@ -598,8 +592,6 @@ static void sensor_hub_remove(struct hid_device *hdev)
        kfree(data->hid_sensor_hub_client_devs);
        hid_set_drvdata(hdev, NULL);
        mutex_destroy(&data->mutex);
-       kfree(data->hsdev);
-       kfree(data);
 }
 
 static const struct hid_device_id sensor_hub_devices[] = {
@@ -617,8 +609,8 @@ static struct hid_driver sensor_hub_driver = {
        .raw_event = sensor_hub_raw_event,
 #ifdef CONFIG_PM
        .suspend = sensor_hub_suspend,
-       .resume =  sensor_hub_resume,
-       .reset_resume =  sensor_hub_reset_resume,
+       .resume = sensor_hub_resume,
+       .reset_resume = sensor_hub_reset_resume,
 #endif
 };
 module_hid_driver(sensor_hub_driver);
index 87fbe29..30dbb6b 100644 (file)
@@ -624,7 +624,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
        struct sony_sc *sc;
        unsigned int connect_mask = HID_CONNECT_DEFAULT;
 
-       sc = kzalloc(sizeof(*sc), GFP_KERNEL);
+       sc = devm_kzalloc(&hdev->dev, sizeof(*sc), GFP_KERNEL);
        if (sc == NULL) {
                hid_err(hdev, "can't alloc sony descriptor\n");
                return -ENOMEM;
@@ -636,7 +636,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
        ret = hid_parse(hdev);
        if (ret) {
                hid_err(hdev, "parse failed\n");
-               goto err_free;
+               return ret;
        }
 
        if (sc->quirks & VAIO_RDESC_CONSTANT)
@@ -649,7 +649,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
        ret = hid_hw_start(hdev, connect_mask);
        if (ret) {
                hid_err(hdev, "hw start failed\n");
-               goto err_free;
+               return ret;
        }
 
        if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
@@ -669,8 +669,6 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
        return 0;
 err_stop:
        hid_hw_stop(hdev);
-err_free:
-       kfree(sc);
        return ret;
 }
 
@@ -682,7 +680,6 @@ static void sony_remove(struct hid_device *hdev)
                buzz_remove(hdev);
 
        hid_hw_stop(hdev);
-       kfree(sc);
 }
 
 static const struct hid_device_id sony_devices[] = {
index a2f587d..7112f3e 100644 (file)
@@ -3,7 +3,7 @@
  *  Fixes "jumpy" cursor and removes nonexistent keyboard LEDS from
  *  the HID descriptor.
  *
- *  Copyright (c) 2011 Stefan Kriwanek <mail@stefankriwanek.de>
+ *  Copyright (c) 2011, 2013 Stefan Kriwanek <dev@stefankriwanek.de>
  */
 
 /*
@@ -46,8 +46,13 @@ static int speedlink_event(struct hid_device *hdev, struct hid_field *field,
                struct hid_usage *usage, __s32 value)
 {
        /* No other conditions due to usage_table. */
-       /* Fix "jumpy" cursor (invalid events sent by device). */
-       if (value == 256)
+
+       /* This fixes the "jumpy" cursor occuring due to invalid events sent
+        * by the device. Some devices only send them with value==+256, others
+        * don't. However, catching abs(value)>=256 is restrictive enough not
+        * to interfere with devices that were bug-free (has been tested).
+        */
+       if (abs(value) >= 256)
                return 1;
        /* Drop useless distance 0 events (on button clicks etc.) as well */
        if (value == 0)
index 0c06054..abb20db 100644 (file)
@@ -212,10 +212,12 @@ static __u8 select_drm(struct wiimote_data *wdata)
 
        if (ir == WIIPROTO_FLAG_IR_BASIC) {
                if (wdata->state.flags & WIIPROTO_FLAG_ACCEL) {
-                       if (ext)
-                               return WIIPROTO_REQ_DRM_KAIE;
-                       else
-                               return WIIPROTO_REQ_DRM_KAI;
+                       /* GEN10 and ealier devices bind IR formats to DRMs.
+                        * Hence, we cannot use DRM_KAI here as it might be
+                        * bound to IR_EXT. Use DRM_KAIE unconditionally so we
+                        * work with all devices and our parsers can use the
+                        * fixed formats, too. */
+                       return WIIPROTO_REQ_DRM_KAIE;
                } else {
                        return WIIPROTO_REQ_DRM_KIE;
                }
@@ -439,8 +441,7 @@ static __u8 wiimote_cmd_read_ext(struct wiimote_data *wdata, __u8 *rmem)
        if (ret != 6)
                return WIIMOTE_EXT_NONE;
 
-       hid_dbg(wdata->hdev, "extension ID: %02x:%02x %02x:%02x %02x:%02x\n",
-               rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
+       hid_dbg(wdata->hdev, "extension ID: %6phC\n", rmem);
 
        if (rmem[0] == 0xff && rmem[1] == 0xff && rmem[2] == 0xff &&
            rmem[3] == 0xff && rmem[4] == 0xff && rmem[5] == 0xff)
@@ -510,14 +511,12 @@ static bool wiimote_cmd_read_mp(struct wiimote_data *wdata, __u8 *rmem)
        if (ret != 6)
                return false;
 
-       hid_dbg(wdata->hdev, "motion plus ID: %02x:%02x %02x:%02x %02x:%02x\n",
-               rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
+       hid_dbg(wdata->hdev, "motion plus ID: %6phC\n", rmem);
 
        if (rmem[5] == 0x05)
                return true;
 
-       hid_info(wdata->hdev, "unknown motion plus ID: %02x:%02x %02x:%02x %02x:%02x\n",
-                rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
+       hid_info(wdata->hdev, "unknown motion plus ID: %6phC\n", rmem);
 
        return false;
 }
@@ -533,8 +532,7 @@ static __u8 wiimote_cmd_read_mp_mapped(struct wiimote_data *wdata)
        if (ret != 6)
                return WIIMOTE_MP_NONE;
 
-       hid_dbg(wdata->hdev, "mapped motion plus ID: %02x:%02x %02x:%02x %02x:%02x\n",
-               rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
+       hid_dbg(wdata->hdev, "mapped motion plus ID: %6phC\n", rmem);
 
        if (rmem[0] == 0xff && rmem[1] == 0xff && rmem[2] == 0xff &&
            rmem[3] == 0xff && rmem[4] == 0xff && rmem[5] == 0xff)
@@ -1126,9 +1124,8 @@ static void wiimote_init_hotplug(struct wiimote_data *wdata)
                wiimote_ext_unload(wdata);
 
                if (exttype == WIIMOTE_EXT_UNKNOWN) {
-                       hid_info(wdata->hdev, "cannot detect extension; %02x:%02x %02x:%02x %02x:%02x\n",
-                                extdata[0], extdata[1], extdata[2],
-                                extdata[3], extdata[4], extdata[5]);
+                       hid_info(wdata->hdev, "cannot detect extension; %6phC\n",
+                                extdata);
                } else if (exttype == WIIMOTE_EXT_NONE) {
                        spin_lock_irq(&wdata->state.lock);
                        wdata->state.exttype = WIIMOTE_EXT_NONE;
diff --git a/drivers/hid/hid-xinmo.c b/drivers/hid/hid-xinmo.c
new file mode 100644 (file)
index 0000000..7df5227
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ *  HID driver for Xin-Mo devices, currently only the Dual Arcade controller.
+ *  Fixes the negative axis event values (the devices sends -2) to match the
+ *  logical axis minimum of the HID report descriptor (the report announces
+ *  -1). It is needed because hid-input discards out of bounds values.
+ *  (This module is based on "hid-saitek" and "hid-lg".)
+ *
+ *  Copyright (c) 2013 Olivier Scherler
+ */
+
+/*
+ * 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/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+#include "hid-ids.h"
+
+/*
+ * Fix negative events that are out of bounds.
+ */
+static int xinmo_event(struct hid_device *hdev, struct hid_field *field,
+               struct hid_usage *usage, __s32 value)
+{
+       switch (usage->code) {
+       case ABS_X:
+       case ABS_Y:
+       case ABS_Z:
+       case ABS_RX:
+               if (value < -1) {
+                       input_event(field->hidinput->input, usage->type,
+                               usage->code, -1);
+                       return 1;
+               }
+               break;
+       }
+
+       return 0;
+}
+
+static const struct hid_device_id xinmo_devices[] = {
+       { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE) },
+       { }
+};
+
+MODULE_DEVICE_TABLE(hid, xinmo_devices);
+
+static struct hid_driver xinmo_driver = {
+       .name = "xinmo",
+       .id_table = xinmo_devices,
+       .event = xinmo_event
+};
+
+module_hid_driver(xinmo_driver);
+MODULE_LICENSE("GPL");
index e4cddec..1a660bd 100644 (file)
@@ -169,7 +169,7 @@ static int zc_probe(struct hid_device *hdev, const struct hid_device_id *id)
        int ret;
        struct zc_device *zc;
 
-       zc = kzalloc(sizeof(*zc), GFP_KERNEL);
+       zc = devm_kzalloc(&hdev->dev, sizeof(*zc), GFP_KERNEL);
        if (zc == NULL) {
                hid_err(hdev, "can't alloc descriptor\n");
                return -ENOMEM;
@@ -180,28 +180,16 @@ static int zc_probe(struct hid_device *hdev, const struct hid_device_id *id)
        ret = hid_parse(hdev);
        if (ret) {
                hid_err(hdev, "parse failed\n");
-               goto err_free;
+               return ret;
        }
 
        ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
        if (ret) {
                hid_err(hdev, "hw start failed\n");
-               goto err_free;
+               return ret;
        }
 
        return 0;
-err_free:
-       kfree(zc);
-
-       return ret;
-}
-
-static void zc_remove(struct hid_device *hdev)
-{
-       struct zc_device *zc = hid_get_drvdata(hdev);
-
-       hid_hw_stop(hdev);
-       kfree(zc);
 }
 
 static const struct hid_device_id zc_devices[] = {
@@ -217,7 +205,6 @@ static struct hid_driver zc_driver = {
        .input_mapping = zc_input_mapping,
        .raw_event = zc_raw_event,
        .probe = zc_probe,
-       .remove = zc_remove,
 };
 module_hid_driver(zc_driver);
 
index 6f1feb2..8918dd1 100644 (file)
@@ -113,7 +113,7 @@ static ssize_t hidraw_send_report(struct file *file, const char __user *buffer,
        __u8 *buf;
        int ret = 0;
 
-       if (!hidraw_table[minor]) {
+       if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
                ret = -ENODEV;
                goto out;
        }
@@ -253,6 +253,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
        unsigned int minor = iminor(inode);
        struct hidraw *dev;
        struct hidraw_list *list;
+       unsigned long flags;
        int err = 0;
 
        if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) {
@@ -261,16 +262,11 @@ static int hidraw_open(struct inode *inode, struct file *file)
        }
 
        mutex_lock(&minors_lock);
-       if (!hidraw_table[minor]) {
+       if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
                err = -ENODEV;
                goto out_unlock;
        }
 
-       list->hidraw = hidraw_table[minor];
-       mutex_init(&list->read_mutex);
-       list_add_tail(&list->node, &hidraw_table[minor]->list);
-       file->private_data = list;
-
        dev = hidraw_table[minor];
        if (!dev->open++) {
                err = hid_hw_power(dev->hid, PM_HINT_FULLON);
@@ -283,9 +279,16 @@ static int hidraw_open(struct inode *inode, struct file *file)
                if (err < 0) {
                        hid_hw_power(dev->hid, PM_HINT_NORMAL);
                        dev->open--;
+                       goto out_unlock;
                }
        }
 
+       list->hidraw = hidraw_table[minor];
+       mutex_init(&list->read_mutex);
+       spin_lock_irqsave(&hidraw_table[minor]->list_lock, flags);
+       list_add_tail(&list->node, &hidraw_table[minor]->list);
+       spin_unlock_irqrestore(&hidraw_table[minor]->list_lock, flags);
+       file->private_data = list;
 out_unlock:
        mutex_unlock(&minors_lock);
 out:
@@ -302,39 +305,41 @@ static int hidraw_fasync(int fd, struct file *file, int on)
        return fasync_helper(fd, file, on, &list->fasync);
 }
 
+static void drop_ref(struct hidraw *hidraw, int exists_bit)
+{
+       if (exists_bit) {
+               hid_hw_close(hidraw->hid);
+               hidraw->exist = 0;
+               if (hidraw->open)
+                       wake_up_interruptible(&hidraw->wait);
+       } else {
+               --hidraw->open;
+       }
+
+       if (!hidraw->open && !hidraw->exist) {
+               device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
+               hidraw_table[hidraw->minor] = NULL;
+               kfree(hidraw);
+       }
+}
+
 static int hidraw_release(struct inode * inode, struct file * file)
 {
        unsigned int minor = iminor(inode);
-       struct hidraw *dev;
        struct hidraw_list *list = file->private_data;
-       int ret;
-       int i;
+       unsigned long flags;
 
        mutex_lock(&minors_lock);
-       if (!hidraw_table[minor]) {
-               ret = -ENODEV;
-               goto unlock;
-       }
 
+       spin_lock_irqsave(&hidraw_table[minor]->list_lock, flags);
        list_del(&list->node);
-       dev = hidraw_table[minor];
-       if (!--dev->open) {
-               if (list->hidraw->exist) {
-                       hid_hw_power(dev->hid, PM_HINT_NORMAL);
-                       hid_hw_close(dev->hid);
-               } else {
-                       kfree(list->hidraw);
-               }
-       }
-
-       for (i = 0; i < HIDRAW_BUFFER_SIZE; ++i)
-               kfree(list->buffer[i].value);
+       spin_unlock_irqrestore(&hidraw_table[minor]->list_lock, flags);
        kfree(list);
-       ret = 0;
-unlock:
-       mutex_unlock(&minors_lock);
 
-       return ret;
+       drop_ref(hidraw_table[minor], 0);
+
+       mutex_unlock(&minors_lock);
+       return 0;
 }
 
 static long hidraw_ioctl(struct file *file, unsigned int cmd,
@@ -457,7 +462,9 @@ int hidraw_report_event(struct hid_device *hid, u8 *data, int len)
        struct hidraw *dev = hid->hidraw;
        struct hidraw_list *list;
        int ret = 0;
+       unsigned long flags;
 
+       spin_lock_irqsave(&dev->list_lock, flags);
        list_for_each_entry(list, &dev->list, node) {
                int new_head = (list->head + 1) & (HIDRAW_BUFFER_SIZE - 1);
 
@@ -472,6 +479,7 @@ int hidraw_report_event(struct hid_device *hid, u8 *data, int len)
                list->head = new_head;
                kill_fasync(&list->fasync, SIGIO, POLL_IN);
        }
+       spin_unlock_irqrestore(&dev->list_lock, flags);
 
        wake_up_interruptible(&dev->wait);
        return ret;
@@ -519,6 +527,7 @@ int hidraw_connect(struct hid_device *hid)
        }
 
        init_waitqueue_head(&dev->wait);
+       spin_lock_init(&dev->list_lock);
        INIT_LIST_HEAD(&dev->list);
 
        dev->hid = hid;
@@ -539,18 +548,9 @@ void hidraw_disconnect(struct hid_device *hid)
        struct hidraw *hidraw = hid->hidraw;
 
        mutex_lock(&minors_lock);
-       hidraw->exist = 0;
 
-       device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
+       drop_ref(hidraw, 1);
 
-       hidraw_table[hidraw->minor] = NULL;
-
-       if (hidraw->open) {
-               hid_hw_close(hid);
-               wake_up_interruptible(&hidraw->wait);
-       } else {
-               kfree(hidraw);
-       }
        mutex_unlock(&minors_lock);
 }
 EXPORT_SYMBOL_GPL(hidraw_disconnect);
index 879b0ed..c133619 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/hid.h>
 #include <linux/mutex.h>
 #include <linux/acpi.h>
+#include <linux/of.h>
 
 #include <linux/i2c/i2c-hid.h>
 
@@ -756,29 +757,6 @@ static int i2c_hid_power(struct hid_device *hid, int lvl)
        return ret;
 }
 
-static int i2c_hid_hidinput_input_event(struct input_dev *dev,
-               unsigned int type, unsigned int code, int value)
-{
-       struct hid_device *hid = input_get_drvdata(dev);
-       struct hid_field *field;
-       int offset;
-
-       if (type == EV_FF)
-               return input_ff_event(dev, type, code, value);
-
-       if (type != EV_LED)
-               return -1;
-
-       offset = hidinput_find_field(hid, type, code, &field);
-
-       if (offset == -1) {
-               hid_warn(dev, "event field not found\n");
-               return -1;
-       }
-
-       return hid_set_field(field, offset, value);
-}
-
 static struct hid_ll_driver i2c_hid_ll_driver = {
        .parse = i2c_hid_parse,
        .start = i2c_hid_start,
@@ -787,7 +765,6 @@ static struct hid_ll_driver i2c_hid_ll_driver = {
        .close = i2c_hid_close,
        .power = i2c_hid_power,
        .request = i2c_hid_request,
-       .hidinput_input_event = i2c_hid_hidinput_input_event,
 };
 
 static int i2c_hid_init_irq(struct i2c_client *client)
@@ -824,8 +801,8 @@ static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
         * bytes 2-3 -> bcdVersion (has to be 1.00) */
        ret = i2c_hid_command(client, &hid_descr_cmd, ihid->hdesc_buffer, 4);
 
-       i2c_hid_dbg(ihid, "%s, ihid->hdesc_buffer: %*ph\n",
-                       __func__, 4, ihid->hdesc_buffer);
+       i2c_hid_dbg(ihid, "%s, ihid->hdesc_buffer: %4ph\n", __func__,
+                       ihid->hdesc_buffer);
 
        if (ret) {
                dev_err(&client->dev,
@@ -897,8 +874,9 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
        params[1].integer.value = 1;
        params[2].type = ACPI_TYPE_INTEGER;
        params[2].integer.value = 1; /* HID function */
-       params[3].type = ACPI_TYPE_INTEGER;
-       params[3].integer.value = 0;
+       params[3].type = ACPI_TYPE_PACKAGE;
+       params[3].package.count = 0;
+       params[3].package.elements = NULL;
 
        if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DSM", &input, &buf))) {
                dev_err(&client->dev, "device _DSM execution failed\n");
@@ -933,6 +911,42 @@ static inline int i2c_hid_acpi_pdata(struct i2c_client *client,
 }
 #endif
 
+#ifdef CONFIG_OF
+static int i2c_hid_of_probe(struct i2c_client *client,
+               struct i2c_hid_platform_data *pdata)
+{
+       struct device *dev = &client->dev;
+       u32 val;
+       int ret;
+
+       ret = of_property_read_u32(dev->of_node, "hid-descr-addr", &val);
+       if (ret) {
+               dev_err(&client->dev, "HID register address not provided\n");
+               return -ENODEV;
+       }
+       if (val >> 16) {
+               dev_err(&client->dev, "Bad HID register address: 0x%08x\n",
+                       val);
+               return -EINVAL;
+       }
+       pdata->hid_descriptor_address = val;
+
+       return 0;
+}
+
+static const struct of_device_id i2c_hid_of_match[] = {
+       { .compatible = "hid-over-i2c" },
+       {},
+};
+MODULE_DEVICE_TABLE(of, i2c_hid_of_match);
+#else
+static inline int i2c_hid_of_probe(struct i2c_client *client,
+               struct i2c_hid_platform_data *pdata)
+{
+       return -ENODEV;
+}
+#endif
+
 static int i2c_hid_probe(struct i2c_client *client,
                         const struct i2c_device_id *dev_id)
 {
@@ -954,7 +968,11 @@ static int i2c_hid_probe(struct i2c_client *client,
        if (!ihid)
                return -ENOMEM;
 
-       if (!platform_data) {
+       if (client->dev.of_node) {
+               ret = i2c_hid_of_probe(client, &ihid->pdata);
+               if (ret)
+                       goto err;
+       } else if (!platform_data) {
                ret = i2c_hid_acpi_pdata(client, &ihid->pdata);
                if (ret) {
                        dev_err(&client->dev,
@@ -1095,6 +1113,7 @@ static struct i2c_driver i2c_hid_driver = {
                .owner  = THIS_MODULE,
                .pm     = &i2c_hid_pm,
                .acpi_match_table = ACPI_PTR(i2c_hid_acpi_match),
+               .of_match_table = of_match_ptr(i2c_hid_of_match),
        },
 
        .probe          = i2c_hid_probe,
index fc307e0..5bf2fb7 100644 (file)
@@ -116,30 +116,6 @@ static void uhid_hid_close(struct hid_device *hid)
        uhid_queue_event(uhid, UHID_CLOSE);
 }
 
-static int uhid_hid_input(struct input_dev *input, unsigned int type,
-                         unsigned int code, int value)
-{
-       struct hid_device *hid = input_get_drvdata(input);
-       struct uhid_device *uhid = hid->driver_data;
-       unsigned long flags;
-       struct uhid_event *ev;
-
-       ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
-       if (!ev)
-               return -ENOMEM;
-
-       ev->type = UHID_OUTPUT_EV;
-       ev->u.output_ev.type = type;
-       ev->u.output_ev.code = code;
-       ev->u.output_ev.value = value;
-
-       spin_lock_irqsave(&uhid->qlock, flags);
-       uhid_queue(uhid, ev);
-       spin_unlock_irqrestore(&uhid->qlock, flags);
-
-       return 0;
-}
-
 static int uhid_hid_parse(struct hid_device *hid)
 {
        struct uhid_device *uhid = hid->driver_data;
@@ -273,7 +249,6 @@ static struct hid_ll_driver uhid_hid_driver = {
        .stop = uhid_hid_stop,
        .open = uhid_hid_open,
        .close = uhid_hid_close,
-       .hidinput_input_event = uhid_hid_input,
        .parse = uhid_hid_parse,
 };
 
@@ -659,3 +634,4 @@ module_exit(uhid_exit);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("David Herrmann <dh.herrmann@gmail.com>");
 MODULE_DESCRIPTION("User-space I/O driver support for HID subsystem");
+MODULE_ALIAS("devname:" UHID_NAME);
index 9941828..44df131 100644 (file)
@@ -535,7 +535,6 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
 {
        int head;
        struct usbhid_device *usbhid = hid->driver_data;
-       int len = ((report->size - 1) >> 3) + 1 + (report->id > 0);
 
        if ((hid->quirks & HID_QUIRK_NOGET) && dir == USB_DIR_IN)
                return;
@@ -546,7 +545,7 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
                        return;
                }
 
-               usbhid->out[usbhid->outhead].raw_report = kmalloc(len, GFP_ATOMIC);
+               usbhid->out[usbhid->outhead].raw_report = hid_alloc_report_buf(report, GFP_ATOMIC);
                if (!usbhid->out[usbhid->outhead].raw_report) {
                        hid_warn(hid, "output queueing failed\n");
                        return;
@@ -595,7 +594,7 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
        }
 
        if (dir == USB_DIR_OUT) {
-               usbhid->ctrl[usbhid->ctrlhead].raw_report = kmalloc(len, GFP_ATOMIC);
+               usbhid->ctrl[usbhid->ctrlhead].raw_report = hid_alloc_report_buf(report, GFP_ATOMIC);
                if (!usbhid->ctrl[usbhid->ctrlhead].raw_report) {
                        hid_warn(hid, "control queueing failed\n");
                        return;
@@ -649,62 +648,6 @@ static void usbhid_submit_report(struct hid_device *hid, struct hid_report *repo
        spin_unlock_irqrestore(&usbhid->lock, flags);
 }
 
-/* Workqueue routine to send requests to change LEDs */
-static void hid_led(struct work_struct *work)
-{
-       struct usbhid_device *usbhid =
-               container_of(work, struct usbhid_device, led_work);
-       struct hid_device *hid = usbhid->hid;
-       struct hid_field *field;
-       unsigned long flags;
-
-       field = hidinput_get_led_field(hid);
-       if (!field) {
-               hid_warn(hid, "LED event field not found\n");
-               return;
-       }
-
-       spin_lock_irqsave(&usbhid->lock, flags);
-       if (!test_bit(HID_DISCONNECTED, &usbhid->iofl)) {
-               usbhid->ledcount = hidinput_count_leds(hid);
-               hid_dbg(usbhid->hid, "New ledcount = %u\n", usbhid->ledcount);
-               __usbhid_submit_report(hid, field->report, USB_DIR_OUT);
-       }
-       spin_unlock_irqrestore(&usbhid->lock, flags);
-}
-
-static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
-{
-       struct hid_device *hid = input_get_drvdata(dev);
-       struct usbhid_device *usbhid = hid->driver_data;
-       struct hid_field *field;
-       unsigned long flags;
-       int offset;
-
-       if (type == EV_FF)
-               return input_ff_event(dev, type, code, value);
-
-       if (type != EV_LED)
-               return -1;
-
-       if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) {
-               hid_warn(dev, "event field not found\n");
-               return -1;
-       }
-
-       spin_lock_irqsave(&usbhid->lock, flags);
-       hid_set_field(field, offset, value);
-       spin_unlock_irqrestore(&usbhid->lock, flags);
-
-       /*
-        * Defer performing requested LED action.
-        * This is more likely gather all LED changes into a single URB.
-        */
-       schedule_work(&usbhid->led_work);
-
-       return 0;
-}
-
 static int usbhid_wait_io(struct hid_device *hid)
 {
        struct usbhid_device *usbhid = hid->driver_data;
@@ -807,12 +750,17 @@ void usbhid_init_reports(struct hid_device *hid)
 {
        struct hid_report *report;
        struct usbhid_device *usbhid = hid->driver_data;
+       struct hid_report_enum *report_enum;
        int err, ret;
 
-       list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list)
-               usbhid_submit_report(hid, report, USB_DIR_IN);
+       if (!(hid->quirks & HID_QUIRK_NO_INIT_INPUT_REPORTS)) {
+               report_enum = &hid->report_enum[HID_INPUT_REPORT];
+               list_for_each_entry(report, &report_enum->report_list, list)
+                       usbhid_submit_report(hid, report, USB_DIR_IN);
+       }
 
-       list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list)
+       report_enum = &hid->report_enum[HID_FEATURE_REPORT];
+       list_for_each_entry(report, &report_enum->report_list, list)
                usbhid_submit_report(hid, report, USB_DIR_IN);
 
        err = 0;
@@ -857,7 +805,7 @@ static int hid_find_field_early(struct hid_device *hid, unsigned int page,
        return -1;
 }
 
-void usbhid_set_leds(struct hid_device *hid)
+static void usbhid_set_leds(struct hid_device *hid)
 {
        struct hid_field *field;
        int offset;
@@ -867,7 +815,6 @@ void usbhid_set_leds(struct hid_device *hid)
                usbhid_submit_report(hid, field->report, USB_DIR_OUT);
        }
 }
-EXPORT_SYMBOL_GPL(usbhid_set_leds);
 
 /*
  * Traverse the supplied list of reports and find the longest
@@ -1274,7 +1221,6 @@ static struct hid_ll_driver usb_hid_driver = {
        .open = usbhid_open,
        .close = usbhid_close,
        .power = usbhid_power,
-       .hidinput_input_event = usb_hidinput_input_event,
        .request = usbhid_request,
        .wait = usbhid_wait_io,
        .idle = usbhid_idle,
@@ -1368,8 +1314,6 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
        setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
        spin_lock_init(&usbhid->lock);
 
-       INIT_WORK(&usbhid->led_work, hid_led);
-
        ret = hid_add_device(hid);
        if (ret) {
                if (ret != -ENODEV)
@@ -1402,7 +1346,6 @@ static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
 {
        del_timer_sync(&usbhid->io_retry);
        cancel_work_sync(&usbhid->reset_work);
-       cancel_work_sync(&usbhid->led_work);
 }
 
 static void hid_cease_io(struct usbhid_device *usbhid)
@@ -1522,15 +1465,17 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message)
        struct usbhid_device *usbhid = hid->driver_data;
        int status = 0;
        bool driver_suspended = false;
+       unsigned int ledcount;
 
        if (PMSG_IS_AUTO(message)) {
+               ledcount = hidinput_count_leds(hid);
                spin_lock_irq(&usbhid->lock);   /* Sync with error handler */
                if (!test_bit(HID_RESET_PENDING, &usbhid->iofl)
                    && !test_bit(HID_CLEAR_HALT, &usbhid->iofl)
                    && !test_bit(HID_OUT_RUNNING, &usbhid->iofl)
                    && !test_bit(HID_CTRL_RUNNING, &usbhid->iofl)
                    && !test_bit(HID_KEYS_PRESSED, &usbhid->iofl)
-                   && (!usbhid->ledcount || ignoreled))
+                   && (!ledcount || ignoreled))
                {
                        set_bit(HID_SUSPENDED, &usbhid->iofl);
                        spin_unlock_irq(&usbhid->lock);
index 19b8360..0734552 100644 (file)
@@ -109,6 +109,8 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS },
        { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
        { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
+       { USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS },
+
        { 0, 0 }
 };
 
index dbb6af6..f633c24 100644 (file)
@@ -92,9 +92,6 @@ struct usbhid_device {
        unsigned int retry_delay;                                       /* Delay length in ms */
        struct work_struct reset_work;                                  /* Task context for resets */
        wait_queue_head_t wait;                                         /* For sleeping */
-       int ledcount;                                                   /* counting the number of active leds */
-
-       struct work_struct led_work;                                    /* Task context for setting LEDs */
 };
 
 #define        hid_to_usb_dev(hid_dev) \
index 936898f..82e661e 100644 (file)
@@ -49,7 +49,7 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 #define EMC6W201_REG_TEMP_HIGH(nr)     (0x57 + (nr) * 2)
 #define EMC6W201_REG_FAN_MIN(nr)       (0x62 + (nr) * 2)
 
-enum { input, min, max } subfeature;
+enum subfeature { input, min, max };
 
 /*
  * Per-device data
index 0b80489..5febb43 100644 (file)
@@ -2,7 +2,7 @@
  * w83792d.c - Part of lm_sensors, Linux kernel modules for hardware
  *            monitoring
  * Copyright (C) 2004, 2005 Winbond Electronics Corp.
- *                         Chunhao Huang <DZShen@Winbond.com.tw>,
+ *                         Shane Huang,
  *                         Rudolf Marek <r.marek@assembler.cz>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -1665,6 +1665,6 @@ static void w83792d_print_debug(struct w83792d_data *data, struct device *dev)
 
 module_i2c_driver(w83792d_driver);
 
-MODULE_AUTHOR("Chunhao Huang @ Winbond <DZShen@Winbond.com.tw>");
+MODULE_AUTHOR("Shane Huang (Winbond)");
 MODULE_DESCRIPTION("W83792AD/D driver for linux-2.6");
 MODULE_LICENSE("GPL");
index 62c71fa..8d59451 100644 (file)
@@ -222,7 +222,8 @@ int ipz_queue_ctor(struct ehca_pd *pd, struct ipz_queue *queue,
        queue->small_page = NULL;
 
        /* allocate queue page pointers */
-       queue->queue_pages = kzalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
+       queue->queue_pages = kzalloc(nr_of_pages * sizeof(void *),
+                                    GFP_KERNEL | __GFP_NOWARN);
        if (!queue->queue_pages) {
                queue->queue_pages = vzalloc(nr_of_pages * sizeof(void *));
                if (!queue->queue_pages) {
index 121cd63..005d852 100644 (file)
@@ -234,7 +234,7 @@ static int as5011_probe(struct i2c_client *client,
        int irq;
        int error;
 
-       plat_data = client->dev.platform_data;
+       plat_data = dev_get_platdata(&client->dev);
        if (!plat_data)
                return -EINVAL;
 
@@ -288,6 +288,7 @@ static int as5011_probe(struct i2c_client *client,
        if (irq < 0) {
                dev_err(&client->dev,
                        "Failed to get irq number for button gpio\n");
+               error = irq;
                goto err_free_button_gpio;
        }
 
index 59c10ec..8aa6e4c 100644 (file)
@@ -61,7 +61,7 @@ static void dc_pad_callback(struct mapleq *mq)
 
 static int dc_pad_open(struct input_dev *dev)
 {
-       struct dc_pad *pad = dev->dev.platform_data;
+       struct dc_pad *pad = dev_get_platdata(&dev->dev);
 
        maple_getcond_callback(pad->mdev, dc_pad_callback, HZ/20,
                MAPLE_FUNC_CONTROLLER);
@@ -71,7 +71,7 @@ static int dc_pad_open(struct input_dev *dev)
 
 static void dc_pad_close(struct input_dev *dev)
 {
-       struct dc_pad *pad = dev->dev.platform_data;
+       struct dc_pad *pad = dev_get_platdata(&dev->dev);
 
        maple_getcond_callback(pad->mdev, dc_pad_callback, 0,
                MAPLE_FUNC_CONTROLLER);
index 03c8cc5..328cfc1 100644 (file)
@@ -442,12 +442,6 @@ static int imx_keypad_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (res == NULL) {
-               dev_err(&pdev->dev, "no I/O memory defined in platform data\n");
-               return -EINVAL;
-       }
-
        input_dev = devm_input_allocate_device(&pdev->dev);
        if (!input_dev) {
                dev_err(&pdev->dev, "failed to allocate the input device\n");
@@ -468,6 +462,7 @@ static int imx_keypad_probe(struct platform_device *pdev)
        setup_timer(&keypad->check_matrix_timer,
                    imx_keypad_check_for_events, (unsigned long) keypad);
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(keypad->mmio_base))
                return PTR_ERR(keypad->mmio_base);
index 7c7af2b..bc2cdaf 100644 (file)
@@ -271,7 +271,7 @@ static int max7359_remove(struct i2c_client *client)
        return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int max7359_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
index 20d872d..b3e3eda 100644 (file)
@@ -171,12 +171,6 @@ static int nspire_keypad_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "missing platform resources\n");
-               return -EINVAL;
-       }
-
        keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad),
                              GFP_KERNEL);
        if (!keypad) {
@@ -208,6 +202,7 @@ static int nspire_keypad_probe(struct platform_device *pdev)
                return PTR_ERR(keypad->clk);
        }
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        keypad->reg_base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(keypad->reg_base))
                return PTR_ERR(keypad->reg_base);
index f4aa53a..30acfd4 100644 (file)
 #define OMAP4_KBD_FULLCODE63_32                0x48
 
 /* OMAP4 bit definitions */
-#define OMAP4_DEF_IRQENABLE_EVENTEN    (1 << 0)
-#define OMAP4_DEF_IRQENABLE_LONGKEY    (1 << 1)
-#define OMAP4_DEF_IRQENABLE_TIMEOUTEN  (1 << 2)
-#define OMAP4_DEF_WUP_EVENT_ENA                (1 << 0)
-#define OMAP4_DEF_WUP_LONG_KEY_ENA     (1 << 1)
-#define OMAP4_DEF_CTRL_NOSOFTMODE      (1 << 1)
-#define OMAP4_DEF_CTRLPTVVALUE         (1 << 2)
-#define OMAP4_DEF_CTRLPTV              (1 << 1)
+#define OMAP4_DEF_IRQENABLE_EVENTEN    BIT(0)
+#define OMAP4_DEF_IRQENABLE_LONGKEY    BIT(1)
+#define OMAP4_DEF_WUP_EVENT_ENA                BIT(0)
+#define OMAP4_DEF_WUP_LONG_KEY_ENA     BIT(1)
+#define OMAP4_DEF_CTRL_NOSOFTMODE      BIT(1)
+#define OMAP4_DEF_CTRL_PTV_SHIFT       2
 
 /* OMAP4 values */
-#define OMAP4_VAL_IRQDISABLE           0x00
-#define OMAP4_VAL_DEBOUNCINGTIME       0x07
-#define OMAP4_VAL_FUNCTIONALCFG                0x1E
-
-#define OMAP4_MASK_IRQSTATUSDISABLE    0xFFFF
+#define OMAP4_VAL_IRQDISABLE           0x0
+#define OMAP4_VAL_DEBOUNCINGTIME       0x7
+#define OMAP4_VAL_PVT                  0x7
 
 enum {
        KBD_REVISION_OMAP4 = 0,
@@ -78,6 +74,7 @@ struct omap4_keypad {
        struct input_dev *input;
 
        void __iomem *base;
+       bool irq_wake_enabled;
        unsigned int irq;
 
        unsigned int rows;
@@ -116,8 +113,22 @@ static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
 }
 
 
-/* Interrupt handler */
-static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
+/* Interrupt handlers */
+static irqreturn_t omap4_keypad_irq_handler(int irq, void *dev_id)
+{
+       struct omap4_keypad *keypad_data = dev_id;
+
+       if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS)) {
+               /* Disable interrupts */
+               kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
+                                OMAP4_VAL_IRQDISABLE);
+               return IRQ_WAKE_THREAD;
+       }
+
+       return IRQ_NONE;
+}
+
+static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id)
 {
        struct omap4_keypad *keypad_data = dev_id;
        struct input_dev *input_dev = keypad_data->input;
@@ -125,10 +136,6 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
        unsigned int col, row, code, changed;
        u32 *new_state = (u32 *) key_state;
 
-       /* Disable interrupts */
-       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
-                        OMAP4_VAL_IRQDISABLE);
-
        *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
        *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
 
@@ -175,11 +182,13 @@ static int omap4_keypad_open(struct input_dev *input)
        disable_irq(keypad_data->irq);
 
        kbd_writel(keypad_data, OMAP4_KBD_CTRL,
-                       OMAP4_VAL_FUNCTIONALCFG);
+                       OMAP4_DEF_CTRL_NOSOFTMODE |
+                       (OMAP4_VAL_PVT << OMAP4_DEF_CTRL_PTV_SHIFT));
        kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
                        OMAP4_VAL_DEBOUNCINGTIME);
+       /* clear pending interrupts */
        kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
-                       OMAP4_VAL_IRQDISABLE);
+                        kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
        kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
                        OMAP4_DEF_IRQENABLE_EVENTEN |
                                OMAP4_DEF_IRQENABLE_LONGKEY);
@@ -363,14 +372,15 @@ static int omap4_keypad_probe(struct platform_device *pdev)
                goto err_free_keymap;
        }
 
-       error = request_irq(keypad_data->irq, omap4_keypad_interrupt,
-                            IRQF_TRIGGER_RISING,
-                            "omap4-keypad", keypad_data);
+       error = request_threaded_irq(keypad_data->irq, omap4_keypad_irq_handler,
+                                    omap4_keypad_irq_thread_fn, 0,
+                                    "omap4-keypad", keypad_data);
        if (error) {
                dev_err(&pdev->dev, "failed to register interrupt\n");
                goto err_free_input;
        }
 
+       device_init_wakeup(&pdev->dev, true);
        pm_runtime_put_sync(&pdev->dev);
 
        error = input_register_device(keypad_data->input);
@@ -384,6 +394,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 
 err_pm_disable:
        pm_runtime_disable(&pdev->dev);
+       device_init_wakeup(&pdev->dev, false);
        free_irq(keypad_data->irq, keypad_data);
 err_free_keymap:
        kfree(keypad_data->keymap);
@@ -409,6 +420,8 @@ static int omap4_keypad_remove(struct platform_device *pdev)
 
        pm_runtime_disable(&pdev->dev);
 
+       device_init_wakeup(&pdev->dev, false);
+
        input_unregister_device(keypad_data->input);
 
        iounmap(keypad_data->base);
@@ -430,12 +443,46 @@ static const struct of_device_id omap_keypad_dt_match[] = {
 MODULE_DEVICE_TABLE(of, omap_keypad_dt_match);
 #endif
 
+#ifdef CONFIG_PM_SLEEP
+static int omap4_keypad_suspend(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
+       int error;
+
+       if (device_may_wakeup(&pdev->dev)) {
+               error = enable_irq_wake(keypad_data->irq);
+               if (!error)
+                       keypad_data->irq_wake_enabled = true;
+       }
+
+       return 0;
+}
+
+static int omap4_keypad_resume(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
+
+       if (device_may_wakeup(&pdev->dev) && keypad_data->irq_wake_enabled) {
+               disable_irq_wake(keypad_data->irq);
+               keypad_data->irq_wake_enabled = false;
+       }
+
+       return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(omap4_keypad_pm_ops,
+                        omap4_keypad_suspend, omap4_keypad_resume);
+
 static struct platform_driver omap4_keypad_driver = {
        .probe          = omap4_keypad_probe,
        .remove         = omap4_keypad_remove,
        .driver         = {
                .name   = "omap4-keypad",
                .owner  = THIS_MODULE,
+               .pm     = &omap4_keypad_pm_ops,
                .of_match_table = of_match_ptr(omap_keypad_dt_match),
        },
 };
index 42b773b..6c561ec 100644 (file)
@@ -243,6 +243,32 @@ static int qt1070_remove(struct i2c_client *client)
        return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int qt1070_suspend(struct device *dev)
+{
+       struct i2c_client *client = to_i2c_client(dev);
+       struct qt1070_data *data = i2c_get_clientdata(client);
+
+       if (device_may_wakeup(dev))
+               enable_irq_wake(data->irq);
+
+       return 0;
+}
+
+static int qt1070_resume(struct device *dev)
+{
+       struct i2c_client *client = to_i2c_client(dev);
+       struct qt1070_data *data = i2c_get_clientdata(client);
+
+       if (device_may_wakeup(dev))
+               disable_irq_wake(data->irq);
+
+       return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
+
 static const struct i2c_device_id qt1070_id[] = {
        { "qt1070", 0 },
        { },
@@ -253,6 +279,7 @@ static struct i2c_driver qt1070_driver = {
        .driver = {
                .name   = "qt1070",
                .owner  = THIS_MODULE,
+               .pm     = &qt1070_pm_ops,
        },
        .id_table       = qt1070_id,
        .probe          = qt1070_probe,
index 7111124..85ff530 100644 (file)
@@ -191,12 +191,6 @@ static int spear_kbd_probe(struct platform_device *pdev)
        int irq;
        int error;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "no keyboard resource defined\n");
-               return -EBUSY;
-       }
-
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
                dev_err(&pdev->dev, "not able to get irq for the device\n");
@@ -228,6 +222,7 @@ static int spear_kbd_probe(struct platform_device *pdev)
                kbd->suspended_rate = pdata->suspended_rate;
        }
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        kbd->io_base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(kbd->io_base))
                return PTR_ERR(kbd->io_base);
index b46142f..9cd20e6 100644 (file)
@@ -638,12 +638,6 @@ static int tegra_kbc_probe(struct platform_device *pdev)
        if (!tegra_kbc_check_pin_cfg(kbc, &num_rows))
                return -EINVAL;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "failed to get I/O memory\n");
-               return -ENXIO;
-       }
-
        kbc->irq = platform_get_irq(pdev, 0);
        if (kbc->irq < 0) {
                dev_err(&pdev->dev, "failed to get keyboard IRQ\n");
@@ -658,6 +652,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
 
        setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc);
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        kbc->mmio = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(kbc->mmio))
                return PTR_ERR(kbc->mmio);
index 0b541cd..aa51baa 100644 (file)
@@ -647,4 +647,14 @@ config INPUT_SIRFSOC_ONKEY
 
          If unsure, say N.
 
+config INPUT_IDEAPAD_SLIDEBAR
+       tristate "IdeaPad Laptop Slidebar"
+       depends on INPUT
+       depends on SERIO_I8042
+       help
+         Say Y here if you have an IdeaPad laptop with a slidebar.
+
+         To compile this driver as a module, choose M here: the
+         module will be called ideapad_slidebar.
+
 endif
index 829de43..0ebfb6d 100644 (file)
@@ -61,3 +61,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS)      += wistron_btns.o
 obj-$(CONFIG_INPUT_WM831X_ON)          += wm831x-on.o
 obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND)        += xen-kbdfront.o
 obj-$(CONFIG_INPUT_YEALINK)            += yealink.o
+obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR)   += ideapad_slidebar.o
diff --git a/drivers/input/misc/ideapad_slidebar.c b/drivers/input/misc/ideapad_slidebar.c
new file mode 100644 (file)
index 0000000..edfd623
--- /dev/null
@@ -0,0 +1,358 @@
+/*
+ * Input driver for slidebars on some Lenovo IdeaPad laptops
+ *
+ * Copyright (C) 2013 Andrey Moiseev <o2g.org.ru@gmail.com>
+ *
+ * Reverse-engineered from Lenovo SlideNav software (SBarHook.dll).
+ *
+ * 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.
+ *
+ * Trademarks are the property of their respective owners.
+ */
+
+/*
+ * Currently tested and works on:
+ *     Lenovo IdeaPad Y550
+ *     Lenovo IdeaPad Y550P
+ *
+ * Other models can be added easily. To test,
+ * load with 'force' parameter set 'true'.
+ *
+ * LEDs blinking and input mode are managed via sysfs,
+ * (hex, unsigned byte value):
+ * /sys/devices/platform/ideapad_slidebar/slidebar_mode
+ *
+ * The value is in byte range, however, I only figured out
+ * how bits 0b10011001 work. Some other bits, probably,
+ * are meaningfull too.
+ *
+ * Possible states:
+ *
+ * STD_INT, ONMOV_INT, OFF_INT, LAST_POLL, OFF_POLL
+ *
+ * Meaning:
+ *           released      touched
+ * STD       'heartbeat'   lights follow the finger
+ * ONMOV     no lights     lights follow the finger
+ * LAST      at last pos   lights follow the finger
+ * OFF       no lights     no lights
+ *
+ * INT       all input events are generated, interrupts are used
+ * POLL      no input events by default, to get them,
+ *          send 0b10000000 (read below)
+ *
+ * Commands: write
+ *
+ * All      |  0b01001 -> STD_INT
+ * possible |  0b10001 -> ONMOV_INT
+ * states   |  0b01000 -> OFF_INT
+ *
+ *                      |  0b0 -> LAST_POLL
+ * STD_INT or ONMOV_INT |
+ *                      |  0b1 -> STD_INT
+ *
+ *                      |  0b0 -> OFF_POLL
+ * OFF_INT or OFF_POLL  |
+ *                      |  0b1 -> OFF_INT
+ *
+ * Any state |   0b10000000 ->  if the slidebar has updated data,
+ *                             produce one input event (last position),
+ *                             switch to respective POLL mode
+ *                             (like 0x0), if not in POLL mode yet.
+ *
+ * Get current state: read
+ *
+ * masked by 0x11 read value means:
+ *
+ * 0x00   LAST
+ * 0x01   STD
+ * 0x10   OFF
+ * 0x11   ONMOV
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/dmi.h>
+#include <linux/spinlock.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/i8042.h>
+#include <linux/serio.h>
+
+#define IDEAPAD_BASE   0xff29
+
+static bool force;
+module_param(force, bool, 0);
+MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+
+static DEFINE_SPINLOCK(io_lock);
+
+static struct input_dev *slidebar_input_dev;
+static struct platform_device *slidebar_platform_dev;
+
+static u8 slidebar_pos_get(void)
+{
+       u8 res;
+       unsigned long flags;
+
+       spin_lock_irqsave(&io_lock, flags);
+       outb(0xf4, 0xff29);
+       outb(0xbf, 0xff2a);
+       res = inb(0xff2b);
+       spin_unlock_irqrestore(&io_lock, flags);
+
+       return res;
+}
+
+static u8 slidebar_mode_get(void)
+{
+       u8 res;
+       unsigned long flags;
+
+       spin_lock_irqsave(&io_lock, flags);
+       outb(0xf7, 0xff29);
+       outb(0x8b, 0xff2a);
+       res = inb(0xff2b);
+       spin_unlock_irqrestore(&io_lock, flags);
+
+       return res;
+}
+
+static void slidebar_mode_set(u8 mode)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&io_lock, flags);
+       outb(0xf7, 0xff29);
+       outb(0x8b, 0xff2a);
+       outb(mode, 0xff2b);
+       spin_unlock_irqrestore(&io_lock, flags);
+}
+
+static bool slidebar_i8042_filter(unsigned char data, unsigned char str,
+                                 struct serio *port)
+{
+       static bool extended = false;
+
+       /* We are only interested in data coming form KBC port */
+       if (str & I8042_STR_AUXDATA)
+               return false;
+
+       /* Scancodes: e03b on move, e0bb on release. */
+       if (data == 0xe0) {
+               extended = true;
+               return true;
+       }
+
+       if (!extended)
+               return false;
+
+       extended = false;
+
+       if (likely((data & 0x7f) != 0x3b)) {
+               serio_interrupt(port, 0xe0, 0);
+               return false;
+       }
+
+       if (data & 0x80) {
+               input_report_key(slidebar_input_dev, BTN_TOUCH, 0);
+       } else {
+               input_report_key(slidebar_input_dev, BTN_TOUCH, 1);
+               input_report_abs(slidebar_input_dev, ABS_X, slidebar_pos_get());
+       }
+       input_sync(slidebar_input_dev);
+
+       return true;
+}
+
+static ssize_t show_slidebar_mode(struct device *dev,
+                                 struct device_attribute *attr,
+                                 char *buf)
+{
+       return sprintf(buf, "%x\n", slidebar_mode_get());
+}
+
+static ssize_t store_slidebar_mode(struct device *dev,
+                                  struct device_attribute *attr,
+                                  const char *buf, size_t count)
+{
+       u8 mode;
+       int error;
+
+       error = kstrtou8(buf, 0, &mode);
+       if (error)
+               return error;
+
+       slidebar_mode_set(mode);
+
+       return count;
+}
+
+static DEVICE_ATTR(slidebar_mode, S_IWUSR | S_IRUGO,
+                  show_slidebar_mode, store_slidebar_mode);
+
+static struct attribute *ideapad_attrs[] = {
+       &dev_attr_slidebar_mode.attr,
+       NULL
+};
+
+static struct attribute_group ideapad_attr_group = {
+       .attrs = ideapad_attrs
+};
+
+static const struct attribute_group *ideapad_attr_groups[] = {
+       &ideapad_attr_group,
+       NULL
+};
+
+static int __init ideapad_probe(struct platform_device* pdev)
+{
+       int err;
+
+       if (!request_region(IDEAPAD_BASE, 3, "ideapad_slidebar")) {
+               dev_err(&pdev->dev, "IO ports are busy\n");
+               return -EBUSY;
+       }
+
+       slidebar_input_dev = input_allocate_device();
+       if (!slidebar_input_dev) {
+               dev_err(&pdev->dev, "Failed to allocate input device\n");
+               err = -ENOMEM;
+               goto err_release_ports;
+       }
+
+       slidebar_input_dev->name = "IdeaPad Slidebar";
+       slidebar_input_dev->id.bustype = BUS_HOST;
+       slidebar_input_dev->dev.parent = &pdev->dev;
+       input_set_capability(slidebar_input_dev, EV_KEY, BTN_TOUCH);
+       input_set_capability(slidebar_input_dev, EV_ABS, ABS_X);
+       input_set_abs_params(slidebar_input_dev, ABS_X, 0, 0xff, 0, 0);
+
+       err = i8042_install_filter(slidebar_i8042_filter);
+       if (err) {
+               dev_err(&pdev->dev,
+                       "Failed to install i8042 filter: %d\n", err);
+               goto err_free_dev;
+       }
+
+       err = input_register_device(slidebar_input_dev);
+       if (err) {
+               dev_err(&pdev->dev,
+                       "Failed to register input device: %d\n", err);
+               goto err_remove_filter;
+       }
+
+       return 0;
+
+err_remove_filter:
+       i8042_remove_filter(slidebar_i8042_filter);
+err_free_dev:
+       input_free_device(slidebar_input_dev);
+err_release_ports:
+       release_region(IDEAPAD_BASE, 3);
+       return err;
+}
+
+static int ideapad_remove(struct platform_device *pdev)
+{
+       i8042_remove_filter(slidebar_i8042_filter);
+       input_unregister_device(slidebar_input_dev);
+       release_region(IDEAPAD_BASE, 3);
+
+       return 0;
+}
+
+static struct platform_driver slidebar_drv = {
+       .driver = {
+               .name = "ideapad_slidebar",
+               .owner = THIS_MODULE,
+       },
+       .remove = ideapad_remove,
+};
+
+static int __init ideapad_dmi_check(const struct dmi_system_id *id)
+{
+       pr_info("Laptop model '%s'\n", id->ident);
+       return 1;
+}
+
+static const struct dmi_system_id ideapad_dmi[] __initconst = {
+       {
+               .ident = "Lenovo IdeaPad Y550",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "20017"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Y550")
+               },
+               .callback = ideapad_dmi_check
+       },
+       {
+               .ident = "Lenovo IdeaPad Y550P",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "20035"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Y550P")
+               },
+               .callback = ideapad_dmi_check
+       },
+       { NULL, }
+};
+MODULE_DEVICE_TABLE(dmi, ideapad_dmi);
+
+static int __init slidebar_init(void)
+{
+       int err;
+
+       if (!force && !dmi_check_system(ideapad_dmi)) {
+               pr_err("DMI does not match\n");
+               return -ENODEV;
+       }
+
+       slidebar_platform_dev = platform_device_alloc("ideapad_slidebar", -1);
+       if (!slidebar_platform_dev) {
+               pr_err("Not enough memory\n");
+               return -ENOMEM;
+       }
+
+       slidebar_platform_dev->dev.groups = ideapad_attr_groups;
+
+       err = platform_device_add(slidebar_platform_dev);
+       if (err) {
+               pr_err("Failed to register platform device\n");
+               goto err_free_dev;
+       }
+
+       err = platform_driver_probe(&slidebar_drv, ideapad_probe);
+       if (err) {
+               pr_err("Failed to register platform driver\n");
+               goto err_delete_dev;
+       }
+
+       return 0;
+
+err_delete_dev:
+       platform_device_del(slidebar_platform_dev);
+err_free_dev:
+       platform_device_put(slidebar_platform_dev);
+       return err;
+}
+
+static void __exit slidebar_exit(void)
+{
+       platform_device_unregister(slidebar_platform_dev);
+       platform_driver_unregister(&slidebar_drv);
+}
+
+module_init(slidebar_init);
+module_exit(slidebar_exit);
+
+MODULE_AUTHOR("Andrey Moiseev <o2g.org.ru@gmail.com>");
+MODULE_DESCRIPTION("Slidebar input support for some Lenovo IdeaPad laptops");
+MODULE_LICENSE("GPL");
index a37f0c9..2ff4d1c 100644 (file)
@@ -143,7 +143,7 @@ static int pwm_beeper_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int pwm_beeper_suspend(struct device *dev)
 {
        struct pwm_beeper *beeper = dev_get_drvdata(dev);
index 0c2dfc8..7864b0c 100644 (file)
@@ -257,7 +257,6 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);
 
 static int twl6040_vibra_probe(struct platform_device *pdev)
 {
-       struct twl6040_vibra_data *pdata = pdev->dev.platform_data;
        struct device *twl6040_core_dev = pdev->dev.parent;
        struct device_node *twl6040_core_node = NULL;
        struct vibra_info *info;
@@ -270,8 +269,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
                                                 "vibra");
 #endif
 
-       if (!pdata && !twl6040_core_node) {
-               dev_err(&pdev->dev, "platform_data not available\n");
+       if (!twl6040_core_node) {
+               dev_err(&pdev->dev, "parent of node is missing?\n");
                return -EINVAL;
        }
 
@@ -284,27 +283,17 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
        info->dev = &pdev->dev;
 
        info->twl6040 = dev_get_drvdata(pdev->dev.parent);
-       if (pdata) {
-               info->vibldrv_res = pdata->vibldrv_res;
-               info->vibrdrv_res = pdata->vibrdrv_res;
-               info->viblmotor_res = pdata->viblmotor_res;
-               info->vibrmotor_res = pdata->vibrmotor_res;
-               vddvibl_uV = pdata->vddvibl_uV;
-               vddvibr_uV = pdata->vddvibr_uV;
-       } else {
-               of_property_read_u32(twl6040_core_node, "ti,vibldrv-res",
-                                    &info->vibldrv_res);
-               of_property_read_u32(twl6040_core_node, "ti,vibrdrv-res",
-                                    &info->vibrdrv_res);
-               of_property_read_u32(twl6040_core_node, "ti,viblmotor-res",
-                                    &info->viblmotor_res);
-               of_property_read_u32(twl6040_core_node, "ti,vibrmotor-res",
-                                    &info->vibrmotor_res);
-               of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV",
-                                    &vddvibl_uV);
-               of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV",
-                                    &vddvibr_uV);
-       }
+
+       of_property_read_u32(twl6040_core_node, "ti,vibldrv-res",
+                            &info->vibldrv_res);
+       of_property_read_u32(twl6040_core_node, "ti,vibrdrv-res",
+                            &info->vibrdrv_res);
+       of_property_read_u32(twl6040_core_node, "ti,viblmotor-res",
+                            &info->viblmotor_res);
+       of_property_read_u32(twl6040_core_node, "ti,vibrmotor-res",
+                            &info->vibrmotor_res);
+       of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV", &vddvibl_uV);
+       of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV", &vddvibr_uV);
 
        if ((!info->vibldrv_res && !info->viblmotor_res) ||
            (!info->vibrdrv_res && !info->vibrmotor_res)) {
@@ -334,8 +323,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
         * When booted with Device tree the regulators are attached to the
         * parent device (twl6040 MFD core)
         */
-       ret = regulator_bulk_get(pdata ? info->dev : twl6040_core_dev,
-                                ARRAY_SIZE(info->supplies), info->supplies);
+       ret = regulator_bulk_get(twl6040_core_dev, ARRAY_SIZE(info->supplies),
+                                info->supplies);
        if (ret) {
                dev_err(info->dev, "couldn't get regulators %d\n", ret);
                return ret;
index 56536f4..b650545 100644 (file)
@@ -46,7 +46,6 @@
 MODULE_AUTHOR("Miloslav Trmac <mitr@volny.cz>");
 MODULE_DESCRIPTION("Wistron laptop button driver");
 MODULE_LICENSE("GPL v2");
-MODULE_VERSION("0.3");
 
 static bool force; /* = 0; */
 module_param(force, bool, 0);
@@ -563,7 +562,7 @@ static struct key_entry keymap_wistron_md96500[] __initdata = {
        { KE_KEY, 0x36, {KEY_WWW} },
        { KE_WIFI, 0x30 },
        { KE_BLUETOOTH, 0x44 },
-       { KE_END, FE_UNTESTED }
+       { KE_END, 0 }
 };
 
 static struct key_entry keymap_wistron_generic[] __initdata = {
@@ -635,7 +634,7 @@ static struct key_entry keymap_prestigio[] __initdata = {
  * a list of buttons and their key codes (reported when loading this module
  * with force=1) and the output of dmidecode to $MODULE_AUTHOR.
  */
-static const struct dmi_system_id __initconst dmi_ids[] = {
+static const struct dmi_system_id dmi_ids[] __initconst = {
        {
                /* Fujitsu-Siemens Amilo Pro V2000 */
                .callback = dmi_matched,
@@ -972,6 +971,7 @@ static const struct dmi_system_id __initconst dmi_ids[] = {
        },
        { NULL, }
 };
+MODULE_DEVICE_TABLE(dmi, dmi_ids);
 
 /* Copy the good keymap, as the original ones are free'd */
 static int __init copy_keymap(void)
index 4ef4d5e..a73f961 100644 (file)
@@ -89,9 +89,9 @@
 #define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO   0x025a
 #define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS   0x025b
 /* MacbookAir6,2 (unibody, June 2013) */
-#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI   0x0291
-#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO    0x0292
-#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS    0x0293
+#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI   0x0290
+#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO    0x0291
+#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS    0x0292
 
 #define BCM5974_DEVICE(prod) {                                 \
        .match_flags = (USB_DEVICE_ID_MATCH_DEVICE |            \
index 2c4db63..23222dd 100644 (file)
@@ -44,7 +44,7 @@ static int lifebook_set_6byte_proto(const struct dmi_system_id *d)
        return 1;
 }
 
-static const struct dmi_system_id __initconst lifebook_dmi_table[] = {
+static const struct dmi_system_id lifebook_dmi_table[] __initconst = {
        {
                /* FLORA-ie 55mi */
                .matches = {
index b2420ae..26386f9 100644 (file)
@@ -1433,7 +1433,7 @@ static int synaptics_reconnect(struct psmouse *psmouse)
 
 static bool impaired_toshiba_kbc;
 
-static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
+static const struct dmi_system_id toshiba_dmi_table[] __initconst = {
 #if defined(CONFIG_DMI) && defined(CONFIG_X86)
        {
                /* Toshiba Satellite */
@@ -1472,7 +1472,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 
 static bool broken_olpc_ec;
 
-static const struct dmi_system_id __initconst olpc_dmi_table[] = {
+static const struct dmi_system_id olpc_dmi_table[] __initconst = {
 #if defined(CONFIG_DMI) && defined(CONFIG_OLPC)
        {
                /* OLPC XO-1 or XO-1.5 */
index a0a2657..4777a73 100644 (file)
@@ -176,6 +176,7 @@ static int altera_ps2_remove(struct platform_device *pdev)
 #ifdef CONFIG_OF
 static const struct of_device_id altera_ps2_match[] = {
        { .compatible = "ALTR,ps2-1.0", },
+       { .compatible = "altr,ps2-1.0", },
        {},
 };
 MODULE_DEVICE_TABLE(of, altera_ps2_match);
index 3fb7727..8024a6d 100644 (file)
@@ -189,12 +189,6 @@ static int arc_ps2_probe(struct platform_device *pdev)
        int irq;
        int error, id, i;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "no IO memory defined\n");
-               return -EINVAL;
-       }
-
        irq = platform_get_irq_byname(pdev, "arc_ps2_irq");
        if (irq < 0) {
                dev_err(&pdev->dev, "no IRQ defined\n");
@@ -208,6 +202,7 @@ static int arc_ps2_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        arc_ps2->addr = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(arc_ps2->addr))
                return PTR_ERR(arc_ps2->addr);
index 3452708..fc080be 100644 (file)
 #define I8042_CTL_TIMEOUT      10000
 
 /*
- * Status register bits.
- */
-
-#define I8042_STR_PARITY       0x80
-#define I8042_STR_TIMEOUT      0x40
-#define I8042_STR_AUXDATA      0x20
-#define I8042_STR_KEYLOCK      0x10
-#define I8042_STR_CMDDAT       0x08
-#define I8042_STR_MUXERR       0x04
-#define I8042_STR_IBF          0x02
-#define        I8042_STR_OBF           0x01
-
-/*
- * Control register bits.
- */
-
-#define I8042_CTR_KBDINT       0x01
-#define I8042_CTR_AUXINT       0x02
-#define I8042_CTR_IGNKEYLOCK   0x08
-#define I8042_CTR_KBDDIS       0x10
-#define I8042_CTR_AUXDIS       0x20
-#define I8042_CTR_XLATE                0x40
-
-/*
  * Return codes.
  */
 
index 818aa46..51b1d40 100644 (file)
@@ -183,9 +183,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
 
        np = pdev->dev.of_node;
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -ENOENT;
-
        priv->base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(priv->base)) {
                dev_err(&pdev->dev, "Failed to map WTM registers\n");
index aaf23ae..79b69ea 100644 (file)
@@ -221,39 +221,6 @@ static int wacom_calc_hid_res(int logical_extents, int physical_extents,
        return logical_extents / physical_extents;
 }
 
-/*
- * The physical dimension specified by the HID descriptor is likely not in
- * the "100th of a mm" units expected by wacom_calculate_touch_res. This
- * function adjusts the value of [xy]_phy based on the unit and exponent
- * provided by the HID descriptor. If an error occurs durring conversion
- * (e.g. from the unit being left unspecified) [xy]_phy is not modified.
- */
-static void wacom_fix_phy_from_hid(struct wacom_features *features)
-{
-       int xres = wacom_calc_hid_res(features->x_max, features->x_phy,
-                                       features->unit, features->unitExpo);
-       int yres = wacom_calc_hid_res(features->y_max, features->y_phy,
-                                       features->unit, features->unitExpo);
-
-       if (xres > 0 && yres > 0) {
-               features->x_phy = (100 * features->x_max) / xres;
-               features->y_phy = (100 * features->y_max) / yres;
-       }
-}
-
-/*
- * Static values for max X/Y and resolution of Pen interface is stored in
- * features. This mean physical size of active area can be computed.
- * This is useful to do when Pen and Touch have same active area of tablet.
- * This means for Touch device, we only need to find max X/Y value and we
- * have enough information to compute resolution of touch.
- */
-static void wacom_set_phy_from_res(struct wacom_features *features)
-{
-       features->x_phy = (features->x_max * 100) / features->x_resolution;
-       features->y_phy = (features->y_max * 100) / features->y_resolution;
-}
-
 static int wacom_parse_logical_collection(unsigned char *report,
                                          struct wacom_features *features)
 {
@@ -265,8 +232,6 @@ static int wacom_parse_logical_collection(unsigned char *report,
                features->pktlen = WACOM_PKGLEN_BBTOUCH3;
                features->device_type = BTN_TOOL_FINGER;
 
-               wacom_set_phy_from_res(features);
-
                features->x_max = features->y_max =
                        get_unaligned_le16(&report[10]);
 
@@ -640,9 +605,6 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
                }
        }
        error = wacom_parse_hid(intf, hid_desc, features);
-       if (error)
-               goto out;
-       wacom_fix_phy_from_hid(features);
 
  out:
        return error;
@@ -1228,7 +1190,6 @@ static void wacom_wireless_work(struct work_struct *work)
                        *((struct wacom_features *)id->driver_info);
                wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3;
                wacom_wac2->features.device_type = BTN_TOOL_FINGER;
-               wacom_set_phy_from_res(&wacom_wac2->features);
                wacom_wac2->features.x_max = wacom_wac2->features.y_max = 4096;
                error = wacom_register_input(wacom2);
                if (error)
@@ -1251,6 +1212,33 @@ fail1:
        return;
 }
 
+/*
+ * Not all devices report physical dimensions from HID.
+ * Compute the default from hardcoded logical dimension
+ * and resolution before driver overwrites them.
+ */
+static void wacom_set_default_phy(struct wacom_features *features)
+{
+       if (features->x_resolution) {
+               features->x_phy = (features->x_max * 100) /
+                                       features->x_resolution;
+               features->y_phy = (features->y_max * 100) /
+                                       features->y_resolution;
+       }
+}
+
+static void wacom_calculate_res(struct wacom_features *features)
+{
+       features->x_resolution = wacom_calc_hid_res(features->x_max,
+                                                   features->x_phy,
+                                                   features->unit,
+                                                   features->unitExpo);
+       features->y_resolution = wacom_calc_hid_res(features->y_max,
+                                                   features->y_phy,
+                                                   features->unit,
+                                                   features->unitExpo);
+}
+
 static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
        struct usb_device *dev = interface_to_usbdev(intf);
@@ -1297,6 +1285,9 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 
        endpoint = &intf->cur_altsetting->endpoint[0].desc;
 
+       /* set the default size in case we do not get them from hid */
+       wacom_set_default_phy(features);
+
        /* Retrieve the physical and logical size for touch devices */
        error = wacom_retrieve_hid_descriptor(intf, features);
        if (error)
@@ -1312,8 +1303,6 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
                        features->device_type = BTN_TOOL_FINGER;
                        features->pktlen = WACOM_PKGLEN_BBTOUCH3;
 
-                       wacom_set_phy_from_res(features);
-
                        features->x_max = 4096;
                        features->y_max = 4096;
                } else {
@@ -1323,6 +1312,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 
        wacom_setup_device_quirks(features);
 
+       /* set unit to "100th of a mm" for devices not reported by HID */
+       if (!features->unit) {
+               features->unit = 0x11;
+               features->unitExpo = 16 - 3;
+       }
+       wacom_calculate_res(features);
+
        strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
 
        if (features->quirks & WACOM_QUIRK_MULTI_INPUT) {
@@ -1334,7 +1330,6 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
                                " Pen" : " Finger",
                        sizeof(wacom_wac->name));
 
-
                other_dev = wacom_get_sibling(dev, features->oVid, features->oPid);
                if (other_dev == NULL || wacom_get_usbdev_data(other_dev) == NULL)
                        other_dev = dev;
@@ -1366,8 +1361,10 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
        usb_set_intfdata(intf, wacom);
 
        if (features->quirks & WACOM_QUIRK_MONITOR) {
-               if (usb_submit_urb(wacom->irq, GFP_KERNEL))
+               if (usb_submit_urb(wacom->irq, GFP_KERNEL)) {
+                       error = -EIO;
                        goto fail5;
+               }
        }
 
        return 0;
@@ -1422,8 +1419,8 @@ static int wacom_resume(struct usb_interface *intf)
        wacom_query_tablet_data(intf, features);
        wacom_led_control(wacom);
 
-       if ((wacom->open || features->quirks & WACOM_QUIRK_MONITOR)
-            && usb_submit_urb(wacom->irq, GFP_NOIO) < 0)
+       if ((wacom->open || (features->quirks & WACOM_QUIRK_MONITOR)) &&
+           usb_submit_urb(wacom->irq, GFP_NOIO) < 0)
                rv = -EIO;
 
        mutex_unlock(&wacom->lock);
index f3e91f0..b2aa503 100644 (file)
@@ -1445,13 +1445,6 @@ void wacom_setup_device_quirks(struct wacom_features *features)
        }
 }
 
-static unsigned int wacom_calculate_touch_res(unsigned int logical_max,
-                                             unsigned int physical_max)
-{
-       /* Touch physical dimensions are in 100th of mm */
-       return (logical_max * 100) / physical_max;
-}
-
 static void wacom_abs_set_axis(struct input_dev *input_dev,
                               struct wacom_wac *wacom_wac)
 {
@@ -1475,11 +1468,9 @@ static void wacom_abs_set_axis(struct input_dev *input_dev,
                        input_set_abs_params(input_dev, ABS_Y, 0,
                                features->y_max, features->y_fuzz, 0);
                        input_abs_set_res(input_dev, ABS_X,
-                               wacom_calculate_touch_res(features->x_max,
-                                                       features->x_phy));
+                                         features->x_resolution);
                        input_abs_set_res(input_dev, ABS_Y,
-                               wacom_calculate_touch_res(features->y_max,
-                                                       features->y_phy));
+                                         features->y_resolution);
                }
 
                if (features->touch_max > 1) {
@@ -1488,11 +1479,9 @@ static void wacom_abs_set_axis(struct input_dev *input_dev,
                        input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0,
                                features->y_max, features->y_fuzz, 0);
                        input_abs_set_res(input_dev, ABS_MT_POSITION_X,
-                               wacom_calculate_touch_res(features->x_max,
-                                                       features->x_phy));
+                                         features->x_resolution);
                        input_abs_set_res(input_dev, ABS_MT_POSITION_Y,
-                               wacom_calculate_touch_res(features->y_max,
-                                                       features->y_phy));
+                                         features->y_resolution);
                }
        }
 }
index 96e0eed..8c65198 100644 (file)
@@ -291,7 +291,7 @@ err_free_mem:
        return err;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int cy8ctmg110_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -319,9 +319,9 @@ static int cy8ctmg110_resume(struct device *dev)
        }
        return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume);
-#endif
 
 static int cy8ctmg110_remove(struct i2c_client *client)
 {
@@ -351,9 +351,7 @@ static struct i2c_driver cy8ctmg110_driver = {
        .driver         = {
                .owner  = THIS_MODULE,
                .name   = CY8CTMG110_DRIVER_NAME,
-#ifdef CONFIG_PM
                .pm     = &cy8ctmg110_pm,
-#endif
        },
        .id_table       = cy8ctmg110_idtable,
        .probe          = cy8ctmg110_probe,
index edcf799..d038575 100644 (file)
@@ -1246,9 +1246,6 @@ static void cyttsp4_watchdog_timer(unsigned long handle)
 
        dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__);
 
-       if (!cd)
-               return;
-
        if (!work_pending(&cd->watchdog_work))
                schedule_work(&cd->watchdog_work);
 
@@ -1552,106 +1549,6 @@ exit:
        return rc;
 }
 
-static int cyttsp4_core_sleep(struct cyttsp4 *cd)
-{
-       int rc;
-
-       rc = cyttsp4_request_exclusive(cd, cd->dev,
-                       CY_CORE_SLEEP_REQUEST_EXCLUSIVE_TIMEOUT);
-       if (rc < 0) {
-               dev_err(cd->dev, "%s: fail get exclusive ex=%p own=%p\n",
-                               __func__, cd->exclusive_dev, cd->dev);
-               return 0;
-       }
-
-       rc = cyttsp4_core_sleep_(cd);
-
-       if (cyttsp4_release_exclusive(cd, cd->dev) < 0)
-               dev_err(cd->dev, "%s: fail to release exclusive\n", __func__);
-       else
-               dev_vdbg(cd->dev, "%s: pass release exclusive\n", __func__);
-
-       return rc;
-}
-
-static int cyttsp4_core_wake_(struct cyttsp4 *cd)
-{
-       struct device *dev = cd->dev;
-       int rc;
-       u8 mode;
-       int t;
-
-       /* Already woken? */
-       mutex_lock(&cd->system_lock);
-       if (cd->sleep_state == SS_SLEEP_OFF) {
-               mutex_unlock(&cd->system_lock);
-               return 0;
-       }
-       cd->int_status &= ~CY_INT_IGNORE;
-       cd->int_status |= CY_INT_AWAKE;
-       cd->sleep_state = SS_WAKING;
-
-       if (cd->cpdata->power) {
-               dev_dbg(dev, "%s: Power up HW\n", __func__);
-               rc = cd->cpdata->power(cd->cpdata, 1, dev, &cd->ignore_irq);
-       } else {
-               dev_dbg(dev, "%s: No power function\n", __func__);
-               rc = -ENOSYS;
-       }
-       if (rc < 0) {
-               dev_err(dev, "%s: HW Power up fails r=%d\n",
-                               __func__, rc);
-
-               /* Initiate a read transaction to wake up */
-               cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), &mode);
-       } else
-               dev_vdbg(cd->dev, "%s: HW power up succeeds\n",
-                       __func__);
-       mutex_unlock(&cd->system_lock);
-
-       t = wait_event_timeout(cd->wait_q,
-                       (cd->int_status & CY_INT_AWAKE) == 0,
-                       msecs_to_jiffies(CY_CORE_WAKEUP_TIMEOUT));
-       if (IS_TMO(t)) {
-               dev_err(dev, "%s: TMO waiting for wakeup\n", __func__);
-               mutex_lock(&cd->system_lock);
-               cd->int_status &= ~CY_INT_AWAKE;
-               /* Try starting up */
-               cyttsp4_queue_startup_(cd);
-               mutex_unlock(&cd->system_lock);
-       }
-
-       mutex_lock(&cd->system_lock);
-       cd->sleep_state = SS_SLEEP_OFF;
-       mutex_unlock(&cd->system_lock);
-
-       cyttsp4_start_wd_timer(cd);
-
-       return 0;
-}
-
-static int cyttsp4_core_wake(struct cyttsp4 *cd)
-{
-       int rc;
-
-       rc = cyttsp4_request_exclusive(cd, cd->dev,
-                       CY_CORE_REQUEST_EXCLUSIVE_TIMEOUT);
-       if (rc < 0) {
-               dev_err(cd->dev, "%s: fail get exclusive ex=%p own=%p\n",
-                               __func__, cd->exclusive_dev, cd->dev);
-               return 0;
-       }
-
-       rc = cyttsp4_core_wake_(cd);
-
-       if (cyttsp4_release_exclusive(cd, cd->dev) < 0)
-               dev_err(cd->dev, "%s: fail to release exclusive\n", __func__);
-       else
-               dev_vdbg(cd->dev, "%s: pass release exclusive\n", __func__);
-
-       return rc;
-}
-
 static int cyttsp4_startup_(struct cyttsp4 *cd)
 {
        int retry = CY_CORE_STARTUP_RETRY_COUNT;
@@ -1821,6 +1718,106 @@ static void cyttsp4_free_si_ptrs(struct cyttsp4 *cd)
 }
 
 #if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
+static int cyttsp4_core_sleep(struct cyttsp4 *cd)
+{
+       int rc;
+
+       rc = cyttsp4_request_exclusive(cd, cd->dev,
+                       CY_CORE_SLEEP_REQUEST_EXCLUSIVE_TIMEOUT);
+       if (rc < 0) {
+               dev_err(cd->dev, "%s: fail get exclusive ex=%p own=%p\n",
+                               __func__, cd->exclusive_dev, cd->dev);
+               return 0;
+       }
+
+       rc = cyttsp4_core_sleep_(cd);
+
+       if (cyttsp4_release_exclusive(cd, cd->dev) < 0)
+               dev_err(cd->dev, "%s: fail to release exclusive\n", __func__);
+       else
+               dev_vdbg(cd->dev, "%s: pass release exclusive\n", __func__);
+
+       return rc;
+}
+
+static int cyttsp4_core_wake_(struct cyttsp4 *cd)
+{
+       struct device *dev = cd->dev;
+       int rc;
+       u8 mode;
+       int t;
+
+       /* Already woken? */
+       mutex_lock(&cd->system_lock);
+       if (cd->sleep_state == SS_SLEEP_OFF) {
+               mutex_unlock(&cd->system_lock);
+               return 0;
+       }
+       cd->int_status &= ~CY_INT_IGNORE;
+       cd->int_status |= CY_INT_AWAKE;
+       cd->sleep_state = SS_WAKING;
+
+       if (cd->cpdata->power) {
+               dev_dbg(dev, "%s: Power up HW\n", __func__);
+               rc = cd->cpdata->power(cd->cpdata, 1, dev, &cd->ignore_irq);
+       } else {
+               dev_dbg(dev, "%s: No power function\n", __func__);
+               rc = -ENOSYS;
+       }
+       if (rc < 0) {
+               dev_err(dev, "%s: HW Power up fails r=%d\n",
+                               __func__, rc);
+
+               /* Initiate a read transaction to wake up */
+               cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), &mode);
+       } else
+               dev_vdbg(cd->dev, "%s: HW power up succeeds\n",
+                       __func__);
+       mutex_unlock(&cd->system_lock);
+
+       t = wait_event_timeout(cd->wait_q,
+                       (cd->int_status & CY_INT_AWAKE) == 0,
+                       msecs_to_jiffies(CY_CORE_WAKEUP_TIMEOUT));
+       if (IS_TMO(t)) {
+               dev_err(dev, "%s: TMO waiting for wakeup\n", __func__);
+               mutex_lock(&cd->system_lock);
+               cd->int_status &= ~CY_INT_AWAKE;
+               /* Try starting up */
+               cyttsp4_queue_startup_(cd);
+               mutex_unlock(&cd->system_lock);
+       }
+
+       mutex_lock(&cd->system_lock);
+       cd->sleep_state = SS_SLEEP_OFF;
+       mutex_unlock(&cd->system_lock);
+
+       cyttsp4_start_wd_timer(cd);
+
+       return 0;
+}
+
+static int cyttsp4_core_wake(struct cyttsp4 *cd)
+{
+       int rc;
+
+       rc = cyttsp4_request_exclusive(cd, cd->dev,
+                       CY_CORE_REQUEST_EXCLUSIVE_TIMEOUT);
+       if (rc < 0) {
+               dev_err(cd->dev, "%s: fail get exclusive ex=%p own=%p\n",
+                               __func__, cd->exclusive_dev, cd->dev);
+               return 0;
+       }
+
+       rc = cyttsp4_core_wake_(cd);
+
+       if (cyttsp4_release_exclusive(cd, cd->dev) < 0)
+               dev_err(cd->dev, "%s: fail to release exclusive\n", __func__);
+       else
+               dev_vdbg(cd->dev, "%s: pass release exclusive\n", __func__);
+
+       return rc;
+}
+
 static int cyttsp4_core_suspend(struct device *dev)
 {
        struct cyttsp4 *cd = dev_get_drvdata(dev);
index 8fe5086..1ce3d29 100644 (file)
@@ -264,7 +264,7 @@ static int eeti_ts_remove(struct i2c_client *client)
        return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int eeti_ts_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
@@ -302,9 +302,9 @@ static int eeti_ts_resume(struct device *dev)
 
        return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume);
-#endif
 
 static const struct i2c_device_id eeti_ts_id[] = {
        { "eeti_ts", 0 },
@@ -315,9 +315,7 @@ MODULE_DEVICE_TABLE(i2c, eeti_ts_id);
 static struct i2c_driver eeti_ts_driver = {
        .driver = {
                .name = "eeti_ts",
-#ifdef CONFIG_PM
                .pm = &eeti_ts_pm,
-#endif
        },
        .probe = eeti_ts_probe,
        .remove = eeti_ts_remove,
index 6c4fb84..6650085 100644 (file)
@@ -221,7 +221,7 @@ static struct isa_driver htcpen_isa_driver = {
        }
 };
 
-static struct dmi_system_id __initdata htcshift_dmi_table[] = {
+static struct dmi_system_id htcshift_dmi_table[] __initdata = {
        {
                .ident = "Shift",
                .matches = {
index 00bc6ca..9f84fcd 100644 (file)
@@ -181,12 +181,11 @@ static int max11801_ts_probe(struct i2c_client *client,
        struct input_dev *input_dev;
        int error;
 
-       data = kzalloc(sizeof(struct max11801_data), GFP_KERNEL);
-       input_dev = input_allocate_device();
+       data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
+       input_dev = devm_input_allocate_device(&client->dev);
        if (!data || !input_dev) {
                dev_err(&client->dev, "Failed to allocate memory\n");
-               error = -ENOMEM;
-               goto err_free_mem;
+               return -ENOMEM;
        }
 
        data->client = client;
@@ -205,38 +204,21 @@ static int max11801_ts_probe(struct i2c_client *client,
 
        max11801_ts_phy_init(data);
 
-       error = request_threaded_irq(client->irq, NULL, max11801_ts_interrupt,
-                                    IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-                                    "max11801_ts", data);
+       error = devm_request_threaded_irq(&client->dev, client->irq, NULL,
+                                         max11801_ts_interrupt,
+                                         IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+                                         "max11801_ts", data);
        if (error) {
                dev_err(&client->dev, "Failed to register interrupt\n");
-               goto err_free_mem;
+               return error;
        }
 
        error = input_register_device(data->input_dev);
        if (error)
-               goto err_free_irq;
+               return error;
 
        i2c_set_clientdata(client, data);
        return 0;
-
-err_free_irq:
-       free_irq(client->irq, data);
-err_free_mem:
-       input_free_device(input_dev);
-       kfree(data);
-       return error;
-}
-
-static int max11801_ts_remove(struct i2c_client *client)
-{
-       struct max11801_data *data = i2c_get_clientdata(client);
-
-       free_irq(client->irq, data);
-       input_unregister_device(data->input_dev);
-       kfree(data);
-
-       return 0;
 }
 
 static const struct i2c_device_id max11801_ts_id[] = {
@@ -252,7 +234,6 @@ static struct i2c_driver max11801_ts_driver = {
        },
        .id_table       = max11801_ts_id,
        .probe          = max11801_ts_probe,
-       .remove         = max11801_ts_remove,
 };
 
 module_i2c_driver(max11801_ts_driver);
index 8ab4f41..f5ff657 100644 (file)
@@ -31,8 +31,8 @@
 #include <asm/cacheflush.h>
 #include <asm/sizes.h>
 
-#include <mach/iommu_hw-8xxx.h>
-#include <mach/iommu.h>
+#include "msm_iommu_hw-8xxx.h"
+#include "msm_iommu.h"
 
 #define MRC(reg, processor, op1, crn, crm, op2)                                \
 __asm__ __volatile__ (                                                 \
index 6ba3514..0a1c962 100644 (file)
@@ -27,8 +27,8 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 
-#include <mach/iommu_hw-8xxx.h>
-#include <mach/iommu.h>
+#include "msm_iommu_hw-8xxx.h"
+#include "msm_iommu.h"
 
 struct iommu_ctx_iter_data {
        /* input */
index f6f120e..e066560 100644 (file)
@@ -1177,8 +1177,6 @@ static int tegra_smmu_probe(struct platform_device *pdev)
                struct resource *res;
 
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
-               if (!res)
-                       return -ENODEV;
                smmu->regs[i] = devm_ioremap_resource(&pdev->dev, res);
                if (IS_ERR(smmu->regs[i]))
                        return PTR_ERR(smmu->regs[i]);
index 4c68265..868ed40 100644 (file)
 #include <linux/of_irq.h>
 #include <asm/mach/irq.h>
 
-#ifdef CONFIG_EXYNOS_ATAGS
-#include <plat/cpu.h>
-#endif
-
 #include "irqchip.h"
 
 #define COMBINER_ENABLE_SET    0x0
@@ -138,7 +134,6 @@ static void __init combiner_init_one(struct combiner_chip_data *combiner_data,
        __raw_writel(combiner_data->irq_mask, base + COMBINER_ENABLE_CLEAR);
 }
 
-#ifdef CONFIG_OF
 static int combiner_irq_domain_xlate(struct irq_domain *d,
                                     struct device_node *controller,
                                     const u32 *intspec, unsigned int intsize,
@@ -156,16 +151,6 @@ static int combiner_irq_domain_xlate(struct irq_domain *d,
 
        return 0;
 }
-#else
-static int combiner_irq_domain_xlate(struct irq_domain *d,
-                                    struct device_node *controller,
-                                    const u32 *intspec, unsigned int intsize,
-                                    unsigned long *out_hwirq,
-                                    unsigned int *out_type)
-{
-       return -EINVAL;
-}
-#endif
 
 static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,
                                   irq_hw_number_t hw)
@@ -184,26 +169,6 @@ static struct irq_domain_ops combiner_irq_domain_ops = {
        .map    = combiner_irq_domain_map,
 };
 
-static unsigned int combiner_lookup_irq(int group)
-{
-#ifdef CONFIG_EXYNOS_ATAGS
-       if (group < EXYNOS4210_MAX_COMBINER_NR || soc_is_exynos5250())
-               return IRQ_SPI(group);
-
-       switch (group) {
-       case 16:
-               return IRQ_SPI(107);
-       case 17:
-               return IRQ_SPI(108);
-       case 18:
-               return IRQ_SPI(48);
-       case 19:
-               return IRQ_SPI(42);
-       }
-#endif
-       return 0;
-}
-
 static void __init combiner_init(void __iomem *combiner_base,
                                 struct device_node *np,
                                 unsigned int max_nr,
@@ -229,12 +194,7 @@ static void __init combiner_init(void __iomem *combiner_base,
        }
 
        for (i = 0; i < max_nr; i++) {
-#ifdef CONFIG_OF
-               if (np)
-                       irq = irq_of_parse_and_map(np, i);
-               else
-#endif
-                       irq = combiner_lookup_irq(i);
+               irq = irq_of_parse_and_map(np, i);
 
                combiner_init_one(&combiner_data[i], i,
                                  combiner_base + (i >> 2) * 0x10, irq);
@@ -242,7 +202,6 @@ static void __init combiner_init(void __iomem *combiner_base,
        }
 }
 
-#ifdef CONFIG_OF
 static int __init combiner_of_init(struct device_node *np,
                                   struct device_node *parent)
 {
@@ -275,4 +234,3 @@ static int __init combiner_of_init(struct device_node *np,
 }
 IRQCHIP_DECLARE(exynos4210_combiner, "samsung,exynos4210-combiner",
                combiner_of_init);
-#endif
index e43402d..074bcb3 100644 (file)
@@ -429,18 +429,6 @@ config LEDS_ASIC3
          cannot be used. This driver supports hardware blinking with an on+off
          period from 62ms to 125s. Say Y to enable LEDs on the HP iPAQ hx4700.
 
-config LEDS_RENESAS_TPU
-       bool "LED support for Renesas TPU"
-       depends on LEDS_CLASS=y && HAVE_CLK && GPIOLIB
-       help
-         This option enables build of the LED TPU platform driver,
-         suitable to drive any TPU channel on newer Renesas SoCs.
-         The driver controls the GPIO pin connected to the LED via
-         the GPIO framework and expects the LED to be connected to
-         a pin that can be driven in both GPIO mode and using TPU
-         pin function. The latter to support brightness control.
-         Brightness control is supported but hardware blinking is not.
-
 config LEDS_TCA6507
        tristate "LED Support for TCA6507 I2C chip"
        depends on LEDS_CLASS && I2C
index ac28977..ae4b613 100644 (file)
@@ -49,7 +49,6 @@ obj-$(CONFIG_LEDS_MC13783)            += leds-mc13783.o
 obj-$(CONFIG_LEDS_NS2)                 += leds-ns2.o
 obj-$(CONFIG_LEDS_NETXBIG)             += leds-netxbig.o
 obj-$(CONFIG_LEDS_ASIC3)               += leds-asic3.o
-obj-$(CONFIG_LEDS_RENESAS_TPU)         += leds-renesas-tpu.o
 obj-$(CONFIG_LEDS_MAX8997)             += leds-max8997.o
 obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
 obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
diff --git a/drivers/leds/leds-renesas-tpu.c b/drivers/leds/leds-renesas-tpu.c
deleted file mode 100644 (file)
index adebf49..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * LED control using Renesas TPU
- *
- *  Copyright (C) 2011 Magnus Damm
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * 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/module.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/spinlock.h>
-#include <linux/printk.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/leds.h>
-#include <linux/platform_data/leds-renesas-tpu.h>
-#include <linux/gpio.h>
-#include <linux/err.h>
-#include <linux/slab.h>
-#include <linux/pm_runtime.h>
-#include <linux/workqueue.h>
-
-enum r_tpu_pin { R_TPU_PIN_UNUSED, R_TPU_PIN_GPIO, R_TPU_PIN_GPIO_FN };
-enum r_tpu_timer { R_TPU_TIMER_UNUSED, R_TPU_TIMER_ON };
-
-struct r_tpu_priv {
-       struct led_classdev ldev;
-       void __iomem *mapbase;
-       struct clk *clk;
-       struct platform_device *pdev;
-       enum r_tpu_pin pin_state;
-       enum r_tpu_timer timer_state;
-       unsigned long min_rate;
-       unsigned int refresh_rate;
-       struct work_struct work;
-       enum led_brightness new_brightness;
-};
-
-static DEFINE_SPINLOCK(r_tpu_lock);
-
-#define TSTR -1 /* Timer start register (shared register) */
-#define TCR  0 /* Timer control register (+0x00) */
-#define TMDR 1 /* Timer mode register (+0x04) */
-#define TIOR 2 /* Timer I/O control register (+0x08) */
-#define TIER 3 /* Timer interrupt enable register (+0x0c) */
-#define TSR  4 /* Timer status register (+0x10) */
-#define TCNT 5 /* Timer counter (+0x14) */
-#define TGRA 6 /* Timer general register A (+0x18) */
-#define TGRB 7 /* Timer general register B (+0x1c) */
-#define TGRC 8 /* Timer general register C (+0x20) */
-#define TGRD 9 /* Timer general register D (+0x24) */
-
-static inline u16 r_tpu_read(struct r_tpu_priv *p, int reg_nr)
-{
-       struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
-       void __iomem *base = p->mapbase;
-       unsigned long offs = reg_nr << 2;
-
-       if (reg_nr == TSTR)
-               return ioread16(base - cfg->channel_offset);
-
-       return ioread16(base + offs);
-}
-
-static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr, u16 value)
-{
-       struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
-       void __iomem *base = p->mapbase;
-       unsigned long offs = reg_nr << 2;
-
-       if (reg_nr == TSTR) {
-               iowrite16(value, base - cfg->channel_offset);
-               return;
-       }
-
-       iowrite16(value, base + offs);
-}
-
-static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start)
-{
-       struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
-       unsigned long flags;
-       u16 value;
-
-       /* start stop register shared by multiple timer channels */
-       spin_lock_irqsave(&r_tpu_lock, flags);
-       value = r_tpu_read(p, TSTR);
-
-       if (start)
-               value |= 1 << cfg->timer_bit;
-       else
-               value &= ~(1 << cfg->timer_bit);
-
-       r_tpu_write(p, TSTR, value);
-       spin_unlock_irqrestore(&r_tpu_lock, flags);
-}
-
-static int r_tpu_enable(struct r_tpu_priv *p, enum led_brightness brightness)
-{
-       struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
-       int prescaler[] = { 1, 4, 16, 64 };
-       int k, ret;
-       unsigned long rate, tmp;
-
-       if (p->timer_state == R_TPU_TIMER_ON)
-               return 0;
-
-       /* wake up device and enable clock */
-       pm_runtime_get_sync(&p->pdev->dev);
-       ret = clk_enable(p->clk);
-       if (ret) {
-               dev_err(&p->pdev->dev, "cannot enable clock\n");
-               return ret;
-       }
-
-       /* make sure channel is disabled */
-       r_tpu_start_stop_ch(p, 0);
-
-       /* get clock rate after enabling it */
-       rate = clk_get_rate(p->clk);
-
-       /* pick the lowest acceptable rate */
-       for (k = ARRAY_SIZE(prescaler) - 1; k >= 0; k--)
-               if ((rate / prescaler[k]) >= p->min_rate)
-                       break;
-
-       if (k < 0) {
-               dev_err(&p->pdev->dev, "clock rate mismatch\n");
-               goto err0;
-       }
-       dev_dbg(&p->pdev->dev, "rate = %lu, prescaler %u\n",
-               rate, prescaler[k]);
-
-       /* clear TCNT on TGRB match, count on rising edge, set prescaler */
-       r_tpu_write(p, TCR, 0x0040 | k);
-
-       /* output 0 until TGRA, output 1 until TGRB */
-       r_tpu_write(p, TIOR, 0x0002);
-
-       rate /= prescaler[k] * p->refresh_rate;
-       r_tpu_write(p, TGRB, rate);
-       dev_dbg(&p->pdev->dev, "TRGB = 0x%04lx\n", rate);
-
-       tmp = (cfg->max_brightness - brightness) * rate;
-       r_tpu_write(p, TGRA, tmp / cfg->max_brightness);
-       dev_dbg(&p->pdev->dev, "TRGA = 0x%04lx\n", tmp / cfg->max_brightness);
-
-       /* PWM mode */
-       r_tpu_write(p, TMDR, 0x0002);
-
-       /* enable channel */
-       r_tpu_start_stop_ch(p, 1);
-
-       p->timer_state = R_TPU_TIMER_ON;
-       return 0;
- err0:
-       clk_disable(p->clk);
-       pm_runtime_put_sync(&p->pdev->dev);
-       return -ENOTSUPP;
-}
-
-static void r_tpu_disable(struct r_tpu_priv *p)
-{
-       if (p->timer_state == R_TPU_TIMER_UNUSED)
-               return;
-
-       /* disable channel */
-       r_tpu_start_stop_ch(p, 0);
-
-       /* stop clock and mark device as idle */
-       clk_disable(p->clk);
-       pm_runtime_put_sync(&p->pdev->dev);
-
-       p->timer_state = R_TPU_TIMER_UNUSED;
-}
-
-static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state,
-                         enum led_brightness brightness)
-{
-       struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
-
-       if (p->pin_state == new_state) {
-               if (p->pin_state == R_TPU_PIN_GPIO)
-                       gpio_set_value(cfg->pin_gpio, brightness);
-               return;
-       }
-
-       if (p->pin_state == R_TPU_PIN_GPIO)
-               gpio_free(cfg->pin_gpio);
-
-       if (p->pin_state == R_TPU_PIN_GPIO_FN)
-               gpio_free(cfg->pin_gpio_fn);
-
-       if (new_state == R_TPU_PIN_GPIO)
-               gpio_request_one(cfg->pin_gpio, !!brightness ?
-                               GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
-                               cfg->name);
-
-       if (new_state == R_TPU_PIN_GPIO_FN)
-               gpio_request(cfg->pin_gpio_fn, cfg->name);
-
-       p->pin_state = new_state;
-}
-
-static void r_tpu_work(struct work_struct *work)
-{
-       struct r_tpu_priv *p = container_of(work, struct r_tpu_priv, work);
-       enum led_brightness brightness = p->new_brightness;
-
-       r_tpu_disable(p);
-
-       /* off and maximum are handled as GPIO pins, in between PWM */
-       if ((brightness == 0) || (brightness == p->ldev.max_brightness))
-               r_tpu_set_pin(p, R_TPU_PIN_GPIO, brightness);
-       else {
-               r_tpu_set_pin(p, R_TPU_PIN_GPIO_FN, 0);
-               r_tpu_enable(p, brightness);
-       }
-}
-
-static void r_tpu_set_brightness(struct led_classdev *ldev,
-                                enum led_brightness brightness)
-{
-       struct r_tpu_priv *p = container_of(ldev, struct r_tpu_priv, ldev);
-       p->new_brightness = brightness;
-       schedule_work(&p->work);
-}
-
-static int r_tpu_probe(struct platform_device *pdev)
-{
-       struct led_renesas_tpu_config *cfg = pdev->dev.platform_data;
-       struct r_tpu_priv *p;
-       struct resource *res;
-       int ret;
-
-       if (!cfg) {
-               dev_err(&pdev->dev, "missing platform data\n");
-               return -ENODEV;
-       }
-
-       p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-       if (p == NULL) {
-               dev_err(&pdev->dev, "failed to allocate driver data\n");
-               return -ENOMEM;
-       }
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "failed to get I/O memory\n");
-               return -ENXIO;
-       }
-
-       /* map memory, let mapbase point to our channel */
-       p->mapbase = devm_ioremap_nocache(&pdev->dev, res->start,
-                                       resource_size(res));
-       if (p->mapbase == NULL) {
-               dev_err(&pdev->dev, "failed to remap I/O memory\n");
-               return -ENXIO;
-       }
-
-       /* get hold of clock */
-       p->clk = devm_clk_get(&pdev->dev, NULL);
-       if (IS_ERR(p->clk)) {
-               dev_err(&pdev->dev, "cannot get clock\n");
-               return PTR_ERR(p->clk);
-       }
-
-       p->pdev = pdev;
-       p->pin_state = R_TPU_PIN_UNUSED;
-       p->timer_state = R_TPU_TIMER_UNUSED;
-       p->refresh_rate = cfg->refresh_rate ? cfg->refresh_rate : 100;
-       r_tpu_set_pin(p, R_TPU_PIN_GPIO, LED_OFF);
-       platform_set_drvdata(pdev, p);
-
-       INIT_WORK(&p->work, r_tpu_work);
-
-       p->ldev.name = cfg->name;
-       p->ldev.brightness = LED_OFF;
-       p->ldev.max_brightness = cfg->max_brightness;
-       p->ldev.brightness_set = r_tpu_set_brightness;
-       p->ldev.flags |= LED_CORE_SUSPENDRESUME;
-       ret = led_classdev_register(&pdev->dev, &p->ldev);
-       if (ret < 0)
-               goto err0;
-
-       /* max_brightness may be updated by the LED core code */
-       p->min_rate = p->ldev.max_brightness * p->refresh_rate;
-
-       pm_runtime_enable(&pdev->dev);
-       return 0;
-
- err0:
-       r_tpu_set_pin(p, R_TPU_PIN_UNUSED, LED_OFF);
-       return ret;
-}
-
-static int r_tpu_remove(struct platform_device *pdev)
-{
-       struct r_tpu_priv *p = platform_get_drvdata(pdev);
-
-       r_tpu_set_brightness(&p->ldev, LED_OFF);
-       led_classdev_unregister(&p->ldev);
-       cancel_work_sync(&p->work);
-       r_tpu_disable(p);
-       r_tpu_set_pin(p, R_TPU_PIN_UNUSED, LED_OFF);
-
-       pm_runtime_disable(&pdev->dev);
-
-       return 0;
-}
-
-static struct platform_driver r_tpu_device_driver = {
-       .probe          = r_tpu_probe,
-       .remove         = r_tpu_remove,
-       .driver         = {
-               .name   = "leds-renesas-tpu",
-       }
-};
-
-module_platform_driver(r_tpu_device_driver);
-
-MODULE_AUTHOR("Magnus Damm");
-MODULE_DESCRIPTION("Renesas TPU LED Driver");
-MODULE_LICENSE("GPL v2");
index b27e530..2edae7d 100644 (file)
@@ -118,8 +118,12 @@ static ssize_t ams_input_store_joystick(struct device *dev,
 {
        unsigned long enable;
        int error = 0;
+       int ret;
 
-       if (strict_strtoul(buf, 0, &enable) || enable > 1)
+       ret = kstrtoul(buf, 0, &enable);
+       if (ret)
+               return ret;
+       if (enable > 1)
                return -EINVAL;
 
        mutex_lock(&ams_input_mutex);
index 221ec42..fe9898c 100644 (file)
@@ -1485,6 +1485,7 @@ static int viu_of_probe(struct platform_device *op)
        struct viu_reg __iomem *viu_regs;
        struct i2c_adapter *ad;
        int ret, viu_irq;
+       struct clk *clk;
 
        ret = of_address_to_resource(op->dev.of_node, 0, &r);
        if (ret) {
@@ -1577,14 +1578,18 @@ static int viu_of_probe(struct platform_device *op)
        }
 
        /* enable VIU clock */
-       viu_dev->clk = clk_get(&op->dev, "viu_clk");
-       if (IS_ERR(viu_dev->clk)) {
-               dev_err(&op->dev, "failed to find the clock module!\n");
-               ret = -ENODEV;
+       clk = devm_clk_get(&op->dev, "viu_clk");
+       if (IS_ERR(clk)) {
+               dev_err(&op->dev, "failed to lookup the clock!\n");
+               ret = PTR_ERR(clk);
+               goto err_clk;
+       }
+       ret = clk_prepare_enable(clk);
+       if (ret) {
+               dev_err(&op->dev, "failed to enable the clock!\n");
                goto err_clk;
-       } else {
-               clk_enable(viu_dev->clk);
        }
+       viu_dev->clk = clk;
 
        /* reset VIU module */
        viu_reset(viu_dev->vr);
@@ -1602,8 +1607,7 @@ static int viu_of_probe(struct platform_device *op)
        return ret;
 
 err_irq:
-       clk_disable(viu_dev->clk);
-       clk_put(viu_dev->clk);
+       clk_disable_unprepare(viu_dev->clk);
 err_clk:
        video_unregister_device(viu_dev->vdev);
 err_vdev:
@@ -1626,8 +1630,7 @@ static int viu_of_remove(struct platform_device *op)
        free_irq(dev->irq, (void *)dev);
        irq_dispose_mapping(dev->irq);
 
-       clk_disable(dev->clk);
-       clk_put(dev->clk);
+       clk_disable_unprepare(dev->clk);
 
        video_unregister_device(dev->vdev);
        i2c_put_adapter(client->adapter);
index d6890bc..a2275cf 100644 (file)
@@ -6,7 +6,7 @@
  * Based on the usbvideo vicam driver, which is:
  *
  * Copyright (c) 2002 Joe Burks (jburks@wavicle.org),
- *                    Christopher L Cheney (ccheney@cheney.cx),
+ *                    Chris Cheney (chris.cheney@gmail.com),
  *                    Pavel Machek (pavel@ucw.cz),
  *                    John Tyner (jtyner@cs.ucr.edu),
  *                    Monroe Williams (monroe@pobox.com)
index 978e8e3..110c036 100644 (file)
 #define READ_PARAM_OFFSET      0x0
 #define WRITE_PARAM_OFFSET     0x4
 
-static const char * const devbus_wins[] = {
-       "devbus-boot",
-       "devbus-cs0",
-       "devbus-cs1",
-       "devbus-cs2",
-       "devbus-cs3",
-};
-
 struct devbus_read_params {
        u32 bus_width;
        u32 badr_skew;
@@ -208,16 +200,11 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *node = pdev->dev.of_node;
-       struct device_node *parent;
        struct devbus *devbus;
        struct resource *res;
        struct clk *clk;
        unsigned long rate;
-       const __be32 *ranges;
-       int err, cs;
-       int addr_cells, p_addr_cells, size_cells;
-       int ranges_len, tuple_len;
-       u32 base, size;
+       int err;
 
        devbus = devm_kzalloc(&pdev->dev, sizeof(struct devbus), GFP_KERNEL);
        if (!devbus)
@@ -248,68 +235,13 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
                return err;
 
        /*
-        * Allocate an address window for this device.
-        * If the device probing fails, then we won't be able to
-        * remove the allocated address decoding window.
-        *
-        * FIXME: This is only a temporary hack! We need to do this here
-        * because we still don't have device tree bindings for mbus.
-        * Once that support is added, we will declare these address windows
-        * statically in the device tree, and remove the window configuration
-        * from here.
-        */
-
-       /*
-        * Get the CS to choose the window string.
-        * This is a bit hacky, but it will be removed once the
-        * address windows are declared in the device tree.
-        */
-       cs = (((unsigned long)devbus->base) % 0x400) / 8;
-
-       /*
-        * Parse 'ranges' property to obtain a (base,size) window tuple.
-        * This will be removed once the address windows
-        * are declared in the device tree.
-        */
-       parent = of_get_parent(node);
-       if (!parent)
-               return -EINVAL;
-
-       p_addr_cells = of_n_addr_cells(parent);
-       of_node_put(parent);
-
-       addr_cells = of_n_addr_cells(node);
-       size_cells = of_n_size_cells(node);
-       tuple_len = (p_addr_cells + addr_cells + size_cells) * sizeof(__be32);
-
-       ranges = of_get_property(node, "ranges", &ranges_len);
-       if (ranges == NULL || ranges_len != tuple_len)
-               return -EINVAL;
-
-       base = of_translate_address(node, ranges + addr_cells);
-       if (base == OF_BAD_ADDR)
-               return -EINVAL;
-       size = of_read_number(ranges + addr_cells + p_addr_cells, size_cells);
-
-       /*
-        * Create an mbus address windows.
-        * FIXME: Remove this, together with the above code, once the
-        * address windows are declared in the device tree.
-        */
-       err = mvebu_mbus_add_window(devbus_wins[cs], base, size);
-       if (err < 0)
-               return err;
-
-       /*
         * We need to create a child device explicitly from here to
         * guarantee that the child will be probed after the timing
         * parameters for the bus are written.
         */
        err = of_platform_populate(node, NULL, NULL, dev);
-       if (err < 0) {
-               mvebu_mbus_del_window(base, size);
+       if (err < 0)
                return err;
-       }
 
        return 0;
 }
index 0548eea..7cd82b8 100644 (file)
@@ -218,8 +218,6 @@ static int tegra20_mc_probe(struct platform_device *pdev)
                struct resource *res;
 
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
-               if (!res)
-                       return -ENODEV;
                mc->regs[i] = devm_ioremap_resource(&pdev->dev, res);
                if (IS_ERR(mc->regs[i]))
                        return PTR_ERR(mc->regs[i]);
index 58d2979..ef79345 100644 (file)
@@ -340,8 +340,6 @@ static int tegra30_mc_probe(struct platform_device *pdev)
                struct resource *res;
 
                res = platform_get_resource(pdev, IORESOURCE_MEM, i);
-               if (!res)
-                       return -ENODEV;
                mc->regs[i] = devm_ioremap_resource(&pdev->dev, res);
                if (IS_ERR(mc->regs[i]))
                        return PTR_ERR(mc->regs[i]);
index 1a31512..962a6e1 100644 (file)
@@ -159,9 +159,6 @@ static int syscon_probe(struct platform_device *pdev)
 
 static const struct platform_device_id syscon_ids[] = {
        { "syscon", },
-#ifdef CONFIG_ARCH_CLPS711X
-       { "clps711x-syscon", },
-#endif
        { }
 };
 
index 87175f9..85472d3 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
-#include <linux/version.h>
 #include <linux/mmc/slot-gpio.h>
 
 #include "sdhci-pltfm.h"
@@ -162,7 +161,7 @@ static int sdhci_bcm_kona_sd_card_emulate(struct sdhci_host *host, int insert)
 /*
  * SD card interrupt event callback
  */
-void sdhci_bcm_kona_card_event(struct sdhci_host *host)
+static void sdhci_bcm_kona_card_event(struct sdhci_host *host)
 {
        if (mmc_gpio_get_cd(host->mmc) > 0) {
                dev_dbg(mmc_dev(host->mmc),
@@ -221,13 +220,14 @@ static struct sdhci_pltfm_data sdhci_pltfm_data_kona = {
                SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
 };
 
-static const struct of_device_id sdhci_bcm_kona_of_match[] __initdata = {
-       { .compatible = "bcm,kona-sdhci"},
+static struct __initconst of_device_id sdhci_bcm_kona_of_match[] = {
+       { .compatible = "brcm,kona-sdhci"},
+       { .compatible = "bcm,kona-sdhci"}, /* deprecated name */
        {}
 };
 MODULE_DEVICE_TABLE(of, sdhci_bcm_kona_of_match);
 
-static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
+static int sdhci_bcm_kona_probe(struct platform_device *pdev)
 {
        struct sdhci_bcm_kona_dev *kona_dev = NULL;
        struct sdhci_pltfm_host *pltfm_priv;
@@ -263,7 +263,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
                (mmc_gpio_get_cd(host->mmc) != -ENOSYS) ? 'Y' : 'N',
                (mmc_gpio_get_ro(host->mmc) != -ENOSYS) ? 'Y' : 'N');
 
-       if (host->mmc->caps | MMC_CAP_NONREMOVABLE)
+       if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
                host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
 
        dev_dbg(dev, "is_8bit=%c\n",
@@ -282,7 +282,7 @@ static int __init sdhci_bcm_kona_probe(struct platform_device *pdev)
        }
 
        /* if device is eMMC, emulate card insert right here */
-       if (host->mmc->caps | MMC_CAP_NONREMOVABLE) {
+       if (host->mmc->caps & MMC_CAP_NONREMOVABLE) {
                ret = sdhci_bcm_kona_sd_card_emulate(host, 1);
                if (ret) {
                        dev_err(dev,
@@ -336,10 +336,10 @@ static struct platform_driver sdhci_bcm_kona_driver = {
                .name   = "sdhci-kona",
                .owner  = THIS_MODULE,
                .pm     = SDHCI_PLTFM_PMOPS,
-               .of_match_table = of_match_ptr(sdhci_bcm_kona_of_match),
+               .of_match_table = sdhci_bcm_kona_of_match,
        },
        .probe          = sdhci_bcm_kona_probe,
-       .remove         = __exit_p(sdhci_bcm_kona_remove),
+       .remove         = sdhci_bcm_kona_remove,
 };
 module_platform_driver(sdhci_bcm_kona_driver);
 
index 3c9cdcb..3c60a00 100644 (file)
@@ -617,10 +617,8 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
        struct nand_chip *chip = mtd->priv;
        struct mpc5121_nfc_prv *prv = chip->priv;
 
-       if (prv->clk) {
-               clk_disable(prv->clk);
-               clk_put(prv->clk);
-       }
+       if (prv->clk)
+               clk_disable_unprepare(prv->clk);
 
        if (prv->csreg)
                iounmap(prv->csreg);
@@ -629,6 +627,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
 static int mpc5121_nfc_probe(struct platform_device *op)
 {
        struct device_node *rootnode, *dn = op->dev.of_node;
+       struct clk *clk;
        struct device *dev = &op->dev;
        struct mpc5121_nfc_prv *prv;
        struct resource res;
@@ -730,14 +729,18 @@ static int mpc5121_nfc_probe(struct platform_device *op)
        of_node_put(rootnode);
 
        /* Enable NFC clock */
-       prv->clk = clk_get(dev, "nfc_clk");
-       if (IS_ERR(prv->clk)) {
+       clk = devm_clk_get(dev, "nfc_clk");
+       if (IS_ERR(clk)) {
                dev_err(dev, "Unable to acquire NFC clock!\n");
-               retval = PTR_ERR(prv->clk);
+               retval = PTR_ERR(clk);
                goto error;
        }
-
-       clk_enable(prv->clk);
+       retval = clk_prepare_enable(clk);
+       if (retval) {
+               dev_err(dev, "Unable to enable NFC clock!\n");
+               goto error;
+       }
+       prv->clk = clk;
 
        /* Reset NAND Flash controller */
        nfc_set(mtd, NFC_CONFIG1, NFC_RESET);
index 4058b85..76ae099 100644 (file)
@@ -1157,7 +1157,7 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new,
  */
 void *cxgb_alloc_mem(unsigned long size)
 {
-       void *p = kzalloc(size, GFP_KERNEL);
+       void *p = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
 
        if (!p)
                p = vzalloc(size);
index 79ac77c..0d0665c 100644 (file)
@@ -1142,7 +1142,7 @@ out:      release_firmware(fw);
  */
 void *t4_alloc_mem(size_t size)
 {
-       void *p = kzalloc(size, GFP_KERNEL);
+       void *p = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
 
        if (!p)
                p = vzalloc(size);
index a1818da..3ca00e0 100644 (file)
@@ -3148,7 +3148,7 @@ int qlcnic_83xx_set_settings(struct qlcnic_adapter *adapter,
        status = qlcnic_83xx_set_port_config(adapter);
        if (status) {
                dev_info(&adapter->pdev->dev,
-                        "Faild to Set Link Speed and autoneg.\n");
+                        "Failed to Set Link Speed and autoneg.\n");
                adapter->ahw->port_config = config;
        }
        return status;
index b7b245b..11b4bb8 100644 (file)
@@ -1781,7 +1781,7 @@ static int qlcnic_83xx_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring,
                        break;
                default:
                        dev_info(&adapter->pdev->dev,
-                                "Unkonwn opcode: 0x%x\n", opcode);
+                                "Unknown opcode: 0x%x\n", opcode);
                        goto skip;
                }
 
index b7a3930..975dc2d 100644 (file)
@@ -1709,7 +1709,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
 
        if(netif_msg_intr(sis_priv))
                printk(KERN_DEBUG "%s: exiting interrupt, "
-                      "interrupt status = 0x%#8.8x.\n",
+                      "interrupt status = %#8.8x\n",
                       net_dev->name, sr32(isr));
 
        spin_unlock (&sis_priv->lock);
index cbb74d7..9e0ca30 100644 (file)
@@ -1199,7 +1199,7 @@ bool wsm_flush_tx(struct cw1200_common *priv)
 
        if (priv->bh_error) {
                /* In case of failure do not wait for magic. */
-               pr_err("[WSM] Fatal error occured, will not flush TX.\n");
+               pr_err("[WSM] Fatal error occurred, will not flush TX.\n");
                return false;
        } else {
                /* Get a timestamp of "oldest" frame */
index c17b74c..76a3c17 100644 (file)
@@ -199,7 +199,7 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
                 * and know the dtim period.
                 */
                iwl_mvm_te_check_disconnect(mvm, te_data->vif,
-                       "No assocation and the time event is over already...");
+                       "No association and the time event is over already...");
                iwl_mvm_te_clear_data(mvm, te_data);
        } else if (le32_to_cpu(notif->action) & TE_V2_NOTIF_HOST_EVENT_START) {
                te_data->running = true;
index 57e4cc5..557bc5b 100644 (file)
@@ -341,7 +341,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw *hw,
                        wait_h2c_limit--;
                        if (wait_h2c_limit == 0) {
                                RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
-                                        "Wating too long for FW read "
+                                        "Waiting too long for FW read "
                                         "clear HMEBox(%d)!\n", boxnum);
                                break;
                        }
@@ -351,7 +351,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw *hw,
                        isfw_read = _rtl88e_check_fw_read_last_h2c(hw, boxnum);
                        u1b_tmp = rtl_read_byte(rtlpriv, 0x130);
                        RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
-                                "Wating for FW read clear HMEBox(%d)!!! "
+                                "Waiting for FW read clear HMEBox(%d)!!! "
                                 "0x130 = %2x\n", boxnum, u1b_tmp);
                }
 
index 47875ba..f700f7a 100644 (file)
@@ -416,7 +416,7 @@ static void rtl92d_dm_dig(struct ieee80211_hw *hw)
 
        /* because we will send data pkt when scanning
         * this will cause some ap like gear-3700 wep TP
-        * lower if we retrun here, this is the diff of
+        * lower if we return here, this is the diff of
         * mac80211 driver vs ieee80211 driver */
        /* if (rtlpriv->mac80211.act_scanning)
         *      return; */
index dedfa1e..ba1502b 100644 (file)
@@ -330,7 +330,7 @@ static void _rtl8723ae_fill_h2c_command(struct ieee80211_hw *hw,
                        wait_h2c_limmit--;
                        if (wait_h2c_limmit == 0) {
                                RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
-                                        "Wating too long for FW read clear HMEBox(%d)!\n",
+                                        "Waiting too long for FW read clear HMEBox(%d)!\n",
                                         boxnum);
                                break;
                        }
@@ -340,7 +340,7 @@ static void _rtl8723ae_fill_h2c_command(struct ieee80211_hw *hw,
                        isfw_rd = rtl8723ae_check_fw_read_last_h2c(hw, boxnum);
                        u1tmp = rtl_read_byte(rtlpriv, 0x1BF);
                        RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
-                                "Wating for FW read clear HMEBox(%d)!!! "
+                                "Waiting for FW read clear HMEBox(%d)!!! "
                                 "0x1BF = %2x\n", boxnum, u1tmp);
                }
 
index 42c687a..e5ca008 100644 (file)
@@ -89,3 +89,48 @@ int of_pci_parse_bus_range(struct device_node *node, struct resource *res)
        return 0;
 }
 EXPORT_SYMBOL_GPL(of_pci_parse_bus_range);
+
+#ifdef CONFIG_PCI_MSI
+
+static LIST_HEAD(of_pci_msi_chip_list);
+static DEFINE_MUTEX(of_pci_msi_chip_mutex);
+
+int of_pci_msi_chip_add(struct msi_chip *chip)
+{
+       if (!of_property_read_bool(chip->of_node, "msi-controller"))
+               return -EINVAL;
+
+       mutex_lock(&of_pci_msi_chip_mutex);
+       list_add(&chip->list, &of_pci_msi_chip_list);
+       mutex_unlock(&of_pci_msi_chip_mutex);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(of_pci_msi_chip_add);
+
+void of_pci_msi_chip_remove(struct msi_chip *chip)
+{
+       mutex_lock(&of_pci_msi_chip_mutex);
+       list_del(&chip->list);
+       mutex_unlock(&of_pci_msi_chip_mutex);
+}
+EXPORT_SYMBOL_GPL(of_pci_msi_chip_remove);
+
+struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node)
+{
+       struct msi_chip *c;
+
+       mutex_lock(&of_pci_msi_chip_mutex);
+       list_for_each_entry(c, &of_pci_msi_chip_list, list) {
+               if (c->of_node == of_node) {
+                       mutex_unlock(&of_pci_msi_chip_mutex);
+                       return c;
+               }
+       }
+       mutex_unlock(&of_pci_msi_chip_mutex);
+
+       return NULL;
+}
+EXPORT_SYMBOL_GPL(of_pci_find_msi_chip_by_node);
+
+#endif /* CONFIG_PCI_MSI */
index 81944fb..b6a99f7 100644 (file)
@@ -1,13 +1,9 @@
 #
 # PCI configuration
 #
-config ARCH_SUPPORTS_MSI
-       bool
-
 config PCI_MSI
        bool "Message Signaled Interrupts (MSI and MSI-X)"
        depends on PCI
-       depends on ARCH_SUPPORTS_MSI
        help
           This allows device drivers to enable MSI (Message Signaled
           Interrupts).  Message Signaled Interrupts enable a device to
index e5ba4eb..3d95048 100644 (file)
@@ -15,4 +15,8 @@ config PCI_EXYNOS
        select PCIEPORTBUS
        select PCIE_DW
 
+config PCI_TEGRA
+       bool "NVIDIA Tegra PCIe controller"
+       depends on ARCH_TEGRA
+
 endmenu
index ab79ccb..c9a997b 100644 (file)
@@ -1,3 +1,4 @@
 obj-$(CONFIG_PCIE_DW) += pcie-designware.o
 obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
 obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
+obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
index ce1543a..729d5a1 100644 (file)
@@ -119,6 +119,10 @@ struct mvebu_pcie_port {
        u32 port;
        u32 lane;
        int devfn;
+       unsigned int mem_target;
+       unsigned int mem_attr;
+       unsigned int io_target;
+       unsigned int io_attr;
        struct clk *clk;
        struct mvebu_sw_pci_bridge bridge;
        struct device_node *dn;
@@ -303,10 +307,9 @@ static void mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
                            (port->bridge.iolimitupper << 16)) -
                            iobase);
 
-       mvebu_mbus_add_window_remap_flags(port->name, port->iowin_base,
-                                         port->iowin_size,
-                                         iobase,
-                                         MVEBU_MBUS_PCI_IO);
+       mvebu_mbus_add_window_remap_by_id(port->io_target, port->io_attr,
+                                         port->iowin_base, port->iowin_size,
+                                         iobase);
 
        pci_ioremap_io(iobase, port->iowin_base);
 }
@@ -338,10 +341,8 @@ static void mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
                (((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) -
                port->memwin_base;
 
-       mvebu_mbus_add_window_remap_flags(port->name, port->memwin_base,
-                                         port->memwin_size,
-                                         MVEBU_MBUS_NO_REMAP,
-                                         MVEBU_MBUS_PCI_MEM);
+       mvebu_mbus_add_window_by_id(port->mem_target, port->mem_attr,
+                                   port->memwin_base, port->memwin_size);
 }
 
 /*
@@ -636,6 +637,8 @@ static int __init mvebu_pcie_setup(int nr, struct pci_sys_data *sys)
 
        for (i = 0; i < pcie->nports; i++) {
                struct mvebu_pcie_port *port = &pcie->ports[i];
+               if (!port->base)
+                       continue;
                mvebu_pcie_setup_hw(port);
        }
 
@@ -730,12 +733,54 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
        return devm_ioremap_resource(&pdev->dev, &regs);
 }
 
+#define DT_FLAGS_TO_TYPE(flags)       (((flags) >> 24) & 0x03)
+#define    DT_TYPE_IO                 0x1
+#define    DT_TYPE_MEM32              0x2
+#define DT_CPUADDR_TO_TARGET(cpuaddr) (((cpuaddr) >> 56) & 0xFF)
+#define DT_CPUADDR_TO_ATTR(cpuaddr)   (((cpuaddr) >> 48) & 0xFF)
+
+static int mvebu_get_tgt_attr(struct device_node *np, int devfn,
+                             unsigned long type, int *tgt, int *attr)
+{
+       const int na = 3, ns = 2;
+       const __be32 *range;
+       int rlen, nranges, rangesz, pna, i;
+
+       range = of_get_property(np, "ranges", &rlen);
+       if (!range)
+               return -EINVAL;
+
+       pna = of_n_addr_cells(np);
+       rangesz = pna + na + ns;
+       nranges = rlen / sizeof(__be32) / rangesz;
+
+       for (i = 0; i < nranges; i++) {
+               u32 flags = of_read_number(range, 1);
+               u32 slot = of_read_number(range, 2);
+               u64 cpuaddr = of_read_number(range + na, pna);
+               unsigned long rtype;
+
+               if (DT_FLAGS_TO_TYPE(flags) == DT_TYPE_IO)
+                       rtype = IORESOURCE_IO;
+               else if (DT_FLAGS_TO_TYPE(flags) == DT_TYPE_MEM32)
+                       rtype = IORESOURCE_MEM;
+
+               if (slot == PCI_SLOT(devfn) && type == rtype) {
+                       *tgt = DT_CPUADDR_TO_TARGET(cpuaddr);
+                       *attr = DT_CPUADDR_TO_ATTR(cpuaddr);
+                       return 0;
+               }
+
+               range += rangesz;
+       }
+
+       return -ENOENT;
+}
+
 static int __init mvebu_pcie_probe(struct platform_device *pdev)
 {
        struct mvebu_pcie *pcie;
        struct device_node *np = pdev->dev.of_node;
-       struct of_pci_range range;
-       struct of_pci_range_parser parser;
        struct device_node *child;
        int i, ret;
 
@@ -746,29 +791,25 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
 
        pcie->pdev = pdev;
 
-       if (of_pci_range_parser_init(&parser, np))
+       /* Get the PCIe memory and I/O aperture */
+       mvebu_mbus_get_pcie_mem_aperture(&pcie->mem);
+       if (resource_size(&pcie->mem) == 0) {
+               dev_err(&pdev->dev, "invalid memory aperture size\n");
                return -EINVAL;
+       }
 
-       /* Get the I/O and memory ranges from DT */
-       for_each_of_pci_range(&parser, &range) {
-               unsigned long restype = range.flags & IORESOURCE_TYPE_BITS;
-               if (restype == IORESOURCE_IO) {
-                       of_pci_range_to_resource(&range, np, &pcie->io);
-                       of_pci_range_to_resource(&range, np, &pcie->realio);
-                       pcie->io.name = "I/O";
-                       pcie->realio.start = max_t(resource_size_t,
-                                                  PCIBIOS_MIN_IO,
-                                                  range.pci_addr);
-                       pcie->realio.end = min_t(resource_size_t,
-                                                IO_SPACE_LIMIT,
-                                                range.pci_addr + range.size);
-               }
-               if (restype == IORESOURCE_MEM) {
-                       of_pci_range_to_resource(&range, np, &pcie->mem);
-                       pcie->mem.name = "MEM";
-               }
+       mvebu_mbus_get_pcie_io_aperture(&pcie->io);
+       if (resource_size(&pcie->io) == 0) {
+               dev_err(&pdev->dev, "invalid I/O aperture size\n");
+               return -EINVAL;
        }
 
+       pcie->realio.flags = pcie->io.flags;
+       pcie->realio.start = PCIBIOS_MIN_IO;
+       pcie->realio.end = min_t(resource_size_t,
+                                 IO_SPACE_LIMIT,
+                                 resource_size(&pcie->io));
+
        /* Get the bus range */
        ret = of_pci_parse_bus_range(np, &pcie->busn);
        if (ret) {
@@ -816,6 +857,22 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
                if (port->devfn < 0)
                        continue;
 
+               ret = mvebu_get_tgt_attr(np, port->devfn, IORESOURCE_MEM,
+                                        &port->mem_target, &port->mem_attr);
+               if (ret < 0) {
+                       dev_err(&pdev->dev, "PCIe%d.%d: cannot get tgt/attr for mem window\n",
+                               port->port, port->lane);
+                       continue;
+               }
+
+               ret = mvebu_get_tgt_attr(np, port->devfn, IORESOURCE_IO,
+                                        &port->io_target, &port->io_attr);
+               if (ret < 0) {
+                       dev_err(&pdev->dev, "PCIe%d.%d: cannot get tgt/attr for io window\n",
+                               port->port, port->lane);
+                       continue;
+               }
+
                port->base = mvebu_pcie_map_registers(pdev, child, port);
                if (IS_ERR(port->base)) {
                        dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
new file mode 100644 (file)
index 0000000..2e9888a
--- /dev/null
@@ -0,0 +1,1691 @@
+/*
+ * PCIe host controller driver for Tegra SoCs
+ *
+ * Copyright (c) 2010, CompuLab, Ltd.
+ * Author: Mike Rapoport <mike@compulab.co.il>
+ *
+ * Based on NVIDIA PCIe driver
+ * Copyright (c) 2008-2009, NVIDIA Corporation.
+ *
+ * Bits taken from arch/arm/mach-dove/pcie.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; 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/clk.h>
+#include <linux/clk/tegra.h>
+#include <linux/delay.h>
+#include <linux/export.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/irqdomain.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/msi.h>
+#include <linux/of_address.h>
+#include <linux/of_pci.h>
+#include <linux/of_platform.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
+#include <linux/sizes.h>
+#include <linux/slab.h>
+#include <linux/tegra-cpuidle.h>
+#include <linux/tegra-powergate.h>
+#include <linux/vmalloc.h>
+#include <linux/regulator/consumer.h>
+
+#include <asm/mach/irq.h>
+#include <asm/mach/map.h>
+#include <asm/mach/pci.h>
+
+#define INT_PCI_MSI_NR (8 * 32)
+
+/* register definitions */
+
+#define AFI_AXI_BAR0_SZ        0x00
+#define AFI_AXI_BAR1_SZ        0x04
+#define AFI_AXI_BAR2_SZ        0x08
+#define AFI_AXI_BAR3_SZ        0x0c
+#define AFI_AXI_BAR4_SZ        0x10
+#define AFI_AXI_BAR5_SZ        0x14
+
+#define AFI_AXI_BAR0_START     0x18
+#define AFI_AXI_BAR1_START     0x1c
+#define AFI_AXI_BAR2_START     0x20
+#define AFI_AXI_BAR3_START     0x24
+#define AFI_AXI_BAR4_START     0x28
+#define AFI_AXI_BAR5_START     0x2c
+
+#define AFI_FPCI_BAR0  0x30
+#define AFI_FPCI_BAR1  0x34
+#define AFI_FPCI_BAR2  0x38
+#define AFI_FPCI_BAR3  0x3c
+#define AFI_FPCI_BAR4  0x40
+#define AFI_FPCI_BAR5  0x44
+
+#define AFI_CACHE_BAR0_SZ      0x48
+#define AFI_CACHE_BAR0_ST      0x4c
+#define AFI_CACHE_BAR1_SZ      0x50
+#define AFI_CACHE_BAR1_ST      0x54
+
+#define AFI_MSI_BAR_SZ         0x60
+#define AFI_MSI_FPCI_BAR_ST    0x64
+#define AFI_MSI_AXI_BAR_ST     0x68
+
+#define AFI_MSI_VEC0           0x6c
+#define AFI_MSI_VEC1           0x70
+#define AFI_MSI_VEC2           0x74
+#define AFI_MSI_VEC3           0x78
+#define AFI_MSI_VEC4           0x7c
+#define AFI_MSI_VEC5           0x80
+#define AFI_MSI_VEC6           0x84
+#define AFI_MSI_VEC7           0x88
+
+#define AFI_MSI_EN_VEC0                0x8c
+#define AFI_MSI_EN_VEC1                0x90
+#define AFI_MSI_EN_VEC2                0x94
+#define AFI_MSI_EN_VEC3                0x98
+#define AFI_MSI_EN_VEC4                0x9c
+#define AFI_MSI_EN_VEC5                0xa0
+#define AFI_MSI_EN_VEC6                0xa4
+#define AFI_MSI_EN_VEC7                0xa8
+
+#define AFI_CONFIGURATION              0xac
+#define  AFI_CONFIGURATION_EN_FPCI     (1 << 0)
+
+#define AFI_FPCI_ERROR_MASKS   0xb0
+
+#define AFI_INTR_MASK          0xb4
+#define  AFI_INTR_MASK_INT_MASK        (1 << 0)
+#define  AFI_INTR_MASK_MSI_MASK        (1 << 8)
+
+#define AFI_INTR_CODE                  0xb8
+#define  AFI_INTR_CODE_MASK            0xf
+#define  AFI_INTR_AXI_SLAVE_ERROR      1
+#define  AFI_INTR_AXI_DECODE_ERROR     2
+#define  AFI_INTR_TARGET_ABORT         3
+#define  AFI_INTR_MASTER_ABORT         4
+#define  AFI_INTR_INVALID_WRITE                5
+#define  AFI_INTR_LEGACY               6
+#define  AFI_INTR_FPCI_DECODE_ERROR    7
+
+#define AFI_INTR_SIGNATURE     0xbc
+#define AFI_UPPER_FPCI_ADDRESS 0xc0
+#define AFI_SM_INTR_ENABLE     0xc4
+#define  AFI_SM_INTR_INTA_ASSERT       (1 << 0)
+#define  AFI_SM_INTR_INTB_ASSERT       (1 << 1)
+#define  AFI_SM_INTR_INTC_ASSERT       (1 << 2)
+#define  AFI_SM_INTR_INTD_ASSERT       (1 << 3)
+#define  AFI_SM_INTR_INTA_DEASSERT     (1 << 4)
+#define  AFI_SM_INTR_INTB_DEASSERT     (1 << 5)
+#define  AFI_SM_INTR_INTC_DEASSERT     (1 << 6)
+#define  AFI_SM_INTR_INTD_DEASSERT     (1 << 7)
+
+#define AFI_AFI_INTR_ENABLE            0xc8
+#define  AFI_INTR_EN_INI_SLVERR                (1 << 0)
+#define  AFI_INTR_EN_INI_DECERR                (1 << 1)
+#define  AFI_INTR_EN_TGT_SLVERR                (1 << 2)
+#define  AFI_INTR_EN_TGT_DECERR                (1 << 3)
+#define  AFI_INTR_EN_TGT_WRERR         (1 << 4)
+#define  AFI_INTR_EN_DFPCI_DECERR      (1 << 5)
+#define  AFI_INTR_EN_AXI_DECERR                (1 << 6)
+#define  AFI_INTR_EN_FPCI_TIMEOUT      (1 << 7)
+#define  AFI_INTR_EN_PRSNT_SENSE       (1 << 8)
+
+#define AFI_PCIE_CONFIG                                        0x0f8
+#define  AFI_PCIE_CONFIG_PCIE_DISABLE(x)               (1 << ((x) + 1))
+#define  AFI_PCIE_CONFIG_PCIE_DISABLE_ALL              0xe
+#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_MASK      (0xf << 20)
+#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_SINGLE    (0x0 << 20)
+#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_420       (0x0 << 20)
+#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_DUAL      (0x1 << 20)
+#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_222       (0x1 << 20)
+#define  AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_411       (0x2 << 20)
+
+#define AFI_FUSE                       0x104
+#define  AFI_FUSE_PCIE_T0_GEN2_DIS     (1 << 2)
+
+#define AFI_PEX0_CTRL                  0x110
+#define AFI_PEX1_CTRL                  0x118
+#define AFI_PEX2_CTRL                  0x128
+#define  AFI_PEX_CTRL_RST              (1 << 0)
+#define  AFI_PEX_CTRL_CLKREQ_EN                (1 << 1)
+#define  AFI_PEX_CTRL_REFCLK_EN                (1 << 3)
+
+#define AFI_PEXBIAS_CTRL_0             0x168
+
+#define RP_VEND_XP     0x00000F00
+#define  RP_VEND_XP_DL_UP      (1 << 30)
+
+#define RP_LINK_CONTROL_STATUS                 0x00000090
+#define  RP_LINK_CONTROL_STATUS_DL_LINK_ACTIVE 0x20000000
+#define  RP_LINK_CONTROL_STATUS_LINKSTAT_MASK  0x3fff0000
+
+#define PADS_CTL_SEL           0x0000009C
+
+#define PADS_CTL               0x000000A0
+#define  PADS_CTL_IDDQ_1L      (1 << 0)
+#define  PADS_CTL_TX_DATA_EN_1L        (1 << 6)
+#define  PADS_CTL_RX_DATA_EN_1L        (1 << 10)
+
+#define PADS_PLL_CTL_TEGRA20                   0x000000B8
+#define PADS_PLL_CTL_TEGRA30                   0x000000B4
+#define  PADS_PLL_CTL_RST_B4SM                 (1 << 1)
+#define  PADS_PLL_CTL_LOCKDET                  (1 << 8)
+#define  PADS_PLL_CTL_REFCLK_MASK              (0x3 << 16)
+#define  PADS_PLL_CTL_REFCLK_INTERNAL_CML      (0 << 16)
+#define  PADS_PLL_CTL_REFCLK_INTERNAL_CMOS     (1 << 16)
+#define  PADS_PLL_CTL_REFCLK_EXTERNAL          (2 << 16)
+#define  PADS_PLL_CTL_TXCLKREF_MASK            (0x1 << 20)
+#define  PADS_PLL_CTL_TXCLKREF_DIV10           (0 << 20)
+#define  PADS_PLL_CTL_TXCLKREF_DIV5            (1 << 20)
+#define  PADS_PLL_CTL_TXCLKREF_BUF_EN          (1 << 22)
+
+#define PADS_REFCLK_CFG0                       0x000000C8
+#define PADS_REFCLK_CFG1                       0x000000CC
+
+/*
+ * Fields in PADS_REFCLK_CFG*. Those registers form an array of 16-bit
+ * entries, one entry per PCIe port. These field definitions and desired
+ * values aren't in the TRM, but do come from NVIDIA.
+ */
+#define PADS_REFCLK_CFG_TERM_SHIFT             2  /* 6:2 */
+#define PADS_REFCLK_CFG_E_TERM_SHIFT           7
+#define PADS_REFCLK_CFG_PREDI_SHIFT            8  /* 11:8 */
+#define PADS_REFCLK_CFG_DRVI_SHIFT             12 /* 15:12 */
+
+/* Default value provided by HW engineering is 0xfa5c */
+#define PADS_REFCLK_CFG_VALUE \
+       ( \
+               (0x17 << PADS_REFCLK_CFG_TERM_SHIFT)   | \
+               (0    << PADS_REFCLK_CFG_E_TERM_SHIFT) | \
+               (0xa  << PADS_REFCLK_CFG_PREDI_SHIFT)  | \
+               (0xf  << PADS_REFCLK_CFG_DRVI_SHIFT)     \
+       )
+
+struct tegra_msi {
+       struct msi_chip chip;
+       DECLARE_BITMAP(used, INT_PCI_MSI_NR);
+       struct irq_domain *domain;
+       unsigned long pages;
+       struct mutex lock;
+       int irq;
+};
+
+/* used to differentiate between Tegra SoC generations */
+struct tegra_pcie_soc_data {
+       unsigned int num_ports;
+       unsigned int msi_base_shift;
+       u32 pads_pll_ctl;
+       u32 tx_ref_sel;
+       bool has_pex_clkreq_en;
+       bool has_pex_bias_ctrl;
+       bool has_intr_prsnt_sense;
+       bool has_avdd_supply;
+       bool has_cml_clk;
+};
+
+static inline struct tegra_msi *to_tegra_msi(struct msi_chip *chip)
+{
+       return container_of(chip, struct tegra_msi, chip);
+}
+
+struct tegra_pcie {
+       struct device *dev;
+
+       void __iomem *pads;
+       void __iomem *afi;
+       int irq;
+
+       struct list_head busses;
+       struct resource *cs;
+
+       struct resource io;
+       struct resource mem;
+       struct resource prefetch;
+       struct resource busn;
+
+       struct clk *pex_clk;
+       struct clk *afi_clk;
+       struct clk *pcie_xclk;
+       struct clk *pll_e;
+       struct clk *cml_clk;
+
+       struct tegra_msi msi;
+
+       struct list_head ports;
+       unsigned int num_ports;
+       u32 xbar_config;
+
+       struct regulator *pex_clk_supply;
+       struct regulator *vdd_supply;
+       struct regulator *avdd_supply;
+
+       const struct tegra_pcie_soc_data *soc_data;
+};
+
+struct tegra_pcie_port {
+       struct tegra_pcie *pcie;
+       struct list_head list;
+       struct resource regs;
+       void __iomem *base;
+       unsigned int index;
+       unsigned int lanes;
+};
+
+struct tegra_pcie_bus {
+       struct vm_struct *area;
+       struct list_head list;
+       unsigned int nr;
+};
+
+static inline struct tegra_pcie *sys_to_pcie(struct pci_sys_data *sys)
+{
+       return sys->private_data;
+}
+
+static inline void afi_writel(struct tegra_pcie *pcie, u32 value,
+                             unsigned long offset)
+{
+       writel(value, pcie->afi + offset);
+}
+
+static inline u32 afi_readl(struct tegra_pcie *pcie, unsigned long offset)
+{
+       return readl(pcie->afi + offset);
+}
+
+static inline void pads_writel(struct tegra_pcie *pcie, u32 value,
+                              unsigned long offset)
+{
+       writel(value, pcie->pads + offset);
+}
+
+static inline u32 pads_readl(struct tegra_pcie *pcie, unsigned long offset)
+{
+       return readl(pcie->pads + offset);
+}
+
+/*
+ * The configuration space mapping on Tegra is somewhat similar to the ECAM
+ * defined by PCIe. However it deviates a bit in how the 4 bits for extended
+ * register accesses are mapped:
+ *
+ *    [27:24] extended register number
+ *    [23:16] bus number
+ *    [15:11] device number
+ *    [10: 8] function number
+ *    [ 7: 0] register number
+ *
+ * Mapping the whole extended configuration space would require 256 MiB of
+ * virtual address space, only a small part of which will actually be used.
+ * To work around this, a 1 MiB of virtual addresses are allocated per bus
+ * when the bus is first accessed. When the physical range is mapped, the
+ * the bus number bits are hidden so that the extended register number bits
+ * appear as bits [19:16]. Therefore the virtual mapping looks like this:
+ *
+ *    [19:16] extended register number
+ *    [15:11] device number
+ *    [10: 8] function number
+ *    [ 7: 0] register number
+ *
+ * This is achieved by stitching together 16 chunks of 64 KiB of physical
+ * address space via the MMU.
+ */
+static unsigned long tegra_pcie_conf_offset(unsigned int devfn, int where)
+{
+       return ((where & 0xf00) << 8) | (PCI_SLOT(devfn) << 11) |
+              (PCI_FUNC(devfn) << 8) | (where & 0xfc);
+}
+
+static struct tegra_pcie_bus *tegra_pcie_bus_alloc(struct tegra_pcie *pcie,
+                                                  unsigned int busnr)
+{
+       pgprot_t prot = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_XN |
+                       L_PTE_MT_DEV_SHARED | L_PTE_SHARED;
+       phys_addr_t cs = pcie->cs->start;
+       struct tegra_pcie_bus *bus;
+       unsigned int i;
+       int err;
+
+       bus = kzalloc(sizeof(*bus), GFP_KERNEL);
+       if (!bus)
+               return ERR_PTR(-ENOMEM);
+
+       INIT_LIST_HEAD(&bus->list);
+       bus->nr = busnr;
+
+       /* allocate 1 MiB of virtual addresses */
+       bus->area = get_vm_area(SZ_1M, VM_IOREMAP);
+       if (!bus->area) {
+               err = -ENOMEM;
+               goto free;
+       }
+
+       /* map each of the 16 chunks of 64 KiB each */
+       for (i = 0; i < 16; i++) {
+               unsigned long virt = (unsigned long)bus->area->addr +
+                                    i * SZ_64K;
+               phys_addr_t phys = cs + i * SZ_1M + busnr * SZ_64K;
+
+               err = ioremap_page_range(virt, virt + SZ_64K, phys, prot);
+               if (err < 0) {
+                       dev_err(pcie->dev, "ioremap_page_range() failed: %d\n",
+                               err);
+                       goto unmap;
+               }
+       }
+
+       return bus;
+
+unmap:
+       vunmap(bus->area->addr);
+free:
+       kfree(bus);
+       return ERR_PTR(err);
+}
+
+/*
+ * Look up a virtual address mapping for the specified bus number. If no such
+ * mapping existis, try to create one.
+ */
+static void __iomem *tegra_pcie_bus_map(struct tegra_pcie *pcie,
+                                       unsigned int busnr)
+{
+       struct tegra_pcie_bus *bus;
+
+       list_for_each_entry(bus, &pcie->busses, list)
+               if (bus->nr == busnr)
+                       return bus->area->addr;
+
+       bus = tegra_pcie_bus_alloc(pcie, busnr);
+       if (IS_ERR(bus))
+               return NULL;
+
+       list_add_tail(&bus->list, &pcie->busses);
+
+       return bus->area->addr;
+}
+
+static void __iomem *tegra_pcie_conf_address(struct pci_bus *bus,
+                                            unsigned int devfn,
+                                            int where)
+{
+       struct tegra_pcie *pcie = sys_to_pcie(bus->sysdata);
+       void __iomem *addr = NULL;
+
+       if (bus->number == 0) {
+               unsigned int slot = PCI_SLOT(devfn);
+               struct tegra_pcie_port *port;
+
+               list_for_each_entry(port, &pcie->ports, list) {
+                       if (port->index + 1 == slot) {
+                               addr = port->base + (where & ~3);
+                               break;
+                       }
+               }
+       } else {
+               addr = tegra_pcie_bus_map(pcie, bus->number);
+               if (!addr) {
+                       dev_err(pcie->dev,
+                               "failed to map cfg. space for bus %u\n",
+                               bus->number);
+                       return NULL;
+               }
+
+               addr += tegra_pcie_conf_offset(devfn, where);
+       }
+
+       return addr;
+}
+
+static int tegra_pcie_read_conf(struct pci_bus *bus, unsigned int devfn,
+                               int where, int size, u32 *value)
+{
+       void __iomem *addr;
+
+       addr = tegra_pcie_conf_address(bus, devfn, where);
+       if (!addr) {
+               *value = 0xffffffff;
+               return PCIBIOS_DEVICE_NOT_FOUND;
+       }
+
+       *value = readl(addr);
+
+       if (size == 1)
+               *value = (*value >> (8 * (where & 3))) & 0xff;
+       else if (size == 2)
+               *value = (*value >> (8 * (where & 3))) & 0xffff;
+
+       return PCIBIOS_SUCCESSFUL;
+}
+
+static int tegra_pcie_write_conf(struct pci_bus *bus, unsigned int devfn,
+                                int where, int size, u32 value)
+{
+       void __iomem *addr;
+       u32 mask, tmp;
+
+       addr = tegra_pcie_conf_address(bus, devfn, where);
+       if (!addr)
+               return PCIBIOS_DEVICE_NOT_FOUND;
+
+       if (size == 4) {
+               writel(value, addr);
+               return PCIBIOS_SUCCESSFUL;
+       }
+
+       if (size == 2)
+               mask = ~(0xffff << ((where & 0x3) * 8));
+       else if (size == 1)
+               mask = ~(0xff << ((where & 0x3) * 8));
+       else
+               return PCIBIOS_BAD_REGISTER_NUMBER;
+
+       tmp = readl(addr) & mask;
+       tmp |= value << ((where & 0x3) * 8);
+       writel(tmp, addr);
+
+       return PCIBIOS_SUCCESSFUL;
+}
+
+static struct pci_ops tegra_pcie_ops = {
+       .read = tegra_pcie_read_conf,
+       .write = tegra_pcie_write_conf,
+};
+
+static unsigned long tegra_pcie_port_get_pex_ctrl(struct tegra_pcie_port *port)
+{
+       unsigned long ret = 0;
+
+       switch (port->index) {
+       case 0:
+               ret = AFI_PEX0_CTRL;
+               break;
+
+       case 1:
+               ret = AFI_PEX1_CTRL;
+               break;
+
+       case 2:
+               ret = AFI_PEX2_CTRL;
+               break;
+       }
+
+       return ret;
+}
+
+static void tegra_pcie_port_reset(struct tegra_pcie_port *port)
+{
+       unsigned long ctrl = tegra_pcie_port_get_pex_ctrl(port);
+       unsigned long value;
+
+       /* pulse reset signal */
+       value = afi_readl(port->pcie, ctrl);
+       value &= ~AFI_PEX_CTRL_RST;
+       afi_writel(port->pcie, value, ctrl);
+
+       usleep_range(1000, 2000);
+
+       value = afi_readl(port->pcie, ctrl);
+       value |= AFI_PEX_CTRL_RST;
+       afi_writel(port->pcie, value, ctrl);
+}
+
+static void tegra_pcie_port_enable(struct tegra_pcie_port *port)
+{
+       const struct tegra_pcie_soc_data *soc = port->pcie->soc_data;
+       unsigned long ctrl = tegra_pcie_port_get_pex_ctrl(port);
+       unsigned long value;
+
+       /* enable reference clock */
+       value = afi_readl(port->pcie, ctrl);
+       value |= AFI_PEX_CTRL_REFCLK_EN;
+
+       if (soc->has_pex_clkreq_en)
+               value |= AFI_PEX_CTRL_CLKREQ_EN;
+
+       afi_writel(port->pcie, value, ctrl);
+
+       tegra_pcie_port_reset(port);
+}
+
+static void tegra_pcie_port_disable(struct tegra_pcie_port *port)
+{
+       unsigned long ctrl = tegra_pcie_port_get_pex_ctrl(port);
+       unsigned long value;
+
+       /* assert port reset */
+       value = afi_readl(port->pcie, ctrl);
+       value &= ~AFI_PEX_CTRL_RST;
+       afi_writel(port->pcie, value, ctrl);
+
+       /* disable reference clock */
+       value = afi_readl(port->pcie, ctrl);
+       value &= ~AFI_PEX_CTRL_REFCLK_EN;
+       afi_writel(port->pcie, value, ctrl);
+}
+
+static void tegra_pcie_port_free(struct tegra_pcie_port *port)
+{
+       struct tegra_pcie *pcie = port->pcie;
+
+       devm_iounmap(pcie->dev, port->base);
+       devm_release_mem_region(pcie->dev, port->regs.start,
+                               resource_size(&port->regs));
+       list_del(&port->list);
+       devm_kfree(pcie->dev, port);
+}
+
+static void tegra_pcie_fixup_bridge(struct pci_dev *dev)
+{
+       u16 reg;
+
+       if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE) {
+               pci_read_config_word(dev, PCI_COMMAND, &reg);
+               reg |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
+                       PCI_COMMAND_MASTER | PCI_COMMAND_SERR);
+               pci_write_config_word(dev, PCI_COMMAND, reg);
+       }
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_fixup_bridge);
+
+/* Tegra PCIE root complex wrongly reports device class */
+static void tegra_pcie_fixup_class(struct pci_dev *dev)
+{
+       dev->class = PCI_CLASS_BRIDGE_PCI << 8;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf0, tegra_pcie_fixup_class);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e1c, tegra_pcie_fixup_class);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e1d, tegra_pcie_fixup_class);
+
+/* Tegra PCIE requires relaxed ordering */
+static void tegra_pcie_relax_enable(struct pci_dev *dev)
+{
+       pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable);
+
+static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
+{
+       struct tegra_pcie *pcie = sys_to_pcie(sys);
+
+       pci_add_resource_offset(&sys->resources, &pcie->mem, sys->mem_offset);
+       pci_add_resource_offset(&sys->resources, &pcie->prefetch,
+                               sys->mem_offset);
+       pci_add_resource(&sys->resources, &pcie->busn);
+
+       pci_ioremap_io(nr * SZ_64K, pcie->io.start);
+
+       return 1;
+}
+
+static int tegra_pcie_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
+{
+       struct tegra_pcie *pcie = sys_to_pcie(pdev->bus->sysdata);
+
+       tegra_cpuidle_pcie_irqs_in_use();
+
+       return pcie->irq;
+}
+
+static void tegra_pcie_add_bus(struct pci_bus *bus)
+{
+       if (IS_ENABLED(CONFIG_PCI_MSI)) {
+               struct tegra_pcie *pcie = sys_to_pcie(bus->sysdata);
+
+               bus->msi = &pcie->msi.chip;
+       }
+}
+
+static struct pci_bus *tegra_pcie_scan_bus(int nr, struct pci_sys_data *sys)
+{
+       struct tegra_pcie *pcie = sys_to_pcie(sys);
+       struct pci_bus *bus;
+
+       bus = pci_create_root_bus(pcie->dev, sys->busnr, &tegra_pcie_ops, sys,
+                                 &sys->resources);
+       if (!bus)
+               return NULL;
+
+       pci_scan_child_bus(bus);
+
+       return bus;
+}
+
+static irqreturn_t tegra_pcie_isr(int irq, void *arg)
+{
+       const char *err_msg[] = {
+               "Unknown",
+               "AXI slave error",
+               "AXI decode error",
+               "Target abort",
+               "Master abort",
+               "Invalid write",
+               "Response decoding error",
+               "AXI response decoding error",
+               "Transaction timeout",
+       };
+       struct tegra_pcie *pcie = arg;
+       u32 code, signature;
+
+       code = afi_readl(pcie, AFI_INTR_CODE) & AFI_INTR_CODE_MASK;
+       signature = afi_readl(pcie, AFI_INTR_SIGNATURE);
+       afi_writel(pcie, 0, AFI_INTR_CODE);
+
+       if (code == AFI_INTR_LEGACY)
+               return IRQ_NONE;
+
+       if (code >= ARRAY_SIZE(err_msg))
+               code = 0;
+
+       /*
+        * do not pollute kernel log with master abort reports since they
+        * happen a lot during enumeration
+        */
+       if (code == AFI_INTR_MASTER_ABORT)
+               dev_dbg(pcie->dev, "%s, signature: %08x\n", err_msg[code],
+                       signature);
+       else
+               dev_err(pcie->dev, "%s, signature: %08x\n", err_msg[code],
+                       signature);
+
+       if (code == AFI_INTR_TARGET_ABORT || code == AFI_INTR_MASTER_ABORT ||
+           code == AFI_INTR_FPCI_DECODE_ERROR) {
+               u32 fpci = afi_readl(pcie, AFI_UPPER_FPCI_ADDRESS) & 0xff;
+               u64 address = (u64)fpci << 32 | (signature & 0xfffffffc);
+
+               if (code == AFI_INTR_MASTER_ABORT)
+                       dev_dbg(pcie->dev, "  FPCI address: %10llx\n", address);
+               else
+                       dev_err(pcie->dev, "  FPCI address: %10llx\n", address);
+       }
+
+       return IRQ_HANDLED;
+}
+
+/*
+ * FPCI map is as follows:
+ * - 0xfdfc000000: I/O space
+ * - 0xfdfe000000: type 0 configuration space
+ * - 0xfdff000000: type 1 configuration space
+ * - 0xfe00000000: type 0 extended configuration space
+ * - 0xfe10000000: type 1 extended configuration space
+ */
+static void tegra_pcie_setup_translations(struct tegra_pcie *pcie)
+{
+       u32 fpci_bar, size, axi_address;
+
+       /* Bar 0: type 1 extended configuration space */
+       fpci_bar = 0xfe100000;
+       size = resource_size(pcie->cs);
+       axi_address = pcie->cs->start;
+       afi_writel(pcie, axi_address, AFI_AXI_BAR0_START);
+       afi_writel(pcie, size >> 12, AFI_AXI_BAR0_SZ);
+       afi_writel(pcie, fpci_bar, AFI_FPCI_BAR0);
+
+       /* Bar 1: downstream IO bar */
+       fpci_bar = 0xfdfc0000;
+       size = resource_size(&pcie->io);
+       axi_address = pcie->io.start;
+       afi_writel(pcie, axi_address, AFI_AXI_BAR1_START);
+       afi_writel(pcie, size >> 12, AFI_AXI_BAR1_SZ);
+       afi_writel(pcie, fpci_bar, AFI_FPCI_BAR1);
+
+       /* Bar 2: prefetchable memory BAR */
+       fpci_bar = (((pcie->prefetch.start >> 12) & 0x0fffffff) << 4) | 0x1;
+       size = resource_size(&pcie->prefetch);
+       axi_address = pcie->prefetch.start;
+       afi_writel(pcie, axi_address, AFI_AXI_BAR2_START);
+       afi_writel(pcie, size >> 12, AFI_AXI_BAR2_SZ);
+       afi_writel(pcie, fpci_bar, AFI_FPCI_BAR2);
+
+       /* Bar 3: non prefetchable memory BAR */
+       fpci_bar = (((pcie->mem.start >> 12) & 0x0fffffff) << 4) | 0x1;
+       size = resource_size(&pcie->mem);
+       axi_address = pcie->mem.start;
+       afi_writel(pcie, axi_address, AFI_AXI_BAR3_START);
+       afi_writel(pcie, size >> 12, AFI_AXI_BAR3_SZ);
+       afi_writel(pcie, fpci_bar, AFI_FPCI_BAR3);
+
+       /* NULL out the remaining BARs as they are not used */
+       afi_writel(pcie, 0, AFI_AXI_BAR4_START);
+       afi_writel(pcie, 0, AFI_AXI_BAR4_SZ);
+       afi_writel(pcie, 0, AFI_FPCI_BAR4);
+
+       afi_writel(pcie, 0, AFI_AXI_BAR5_START);
+       afi_writel(pcie, 0, AFI_AXI_BAR5_SZ);
+       afi_writel(pcie, 0, AFI_FPCI_BAR5);
+
+       /* map all upstream transactions as uncached */
+       afi_writel(pcie, PHYS_OFFSET, AFI_CACHE_BAR0_ST);
+       afi_writel(pcie, 0, AFI_CACHE_BAR0_SZ);
+       afi_writel(pcie, 0, AFI_CACHE_BAR1_ST);
+       afi_writel(pcie, 0, AFI_CACHE_BAR1_SZ);
+
+       /* MSI translations are setup only when needed */
+       afi_writel(pcie, 0, AFI_MSI_FPCI_BAR_ST);
+       afi_writel(pcie, 0, AFI_MSI_BAR_SZ);
+       afi_writel(pcie, 0, AFI_MSI_AXI_BAR_ST);
+       afi_writel(pcie, 0, AFI_MSI_BAR_SZ);
+}
+
+static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
+{
+       const struct tegra_pcie_soc_data *soc = pcie->soc_data;
+       struct tegra_pcie_port *port;
+       unsigned int timeout;
+       unsigned long value;
+
+       /* power down PCIe slot clock bias pad */
+       if (soc->has_pex_bias_ctrl)
+               afi_writel(pcie, 0, AFI_PEXBIAS_CTRL_0);
+
+       /* configure mode and disable all ports */
+       value = afi_readl(pcie, AFI_PCIE_CONFIG);
+       value &= ~AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_MASK;
+       value |= AFI_PCIE_CONFIG_PCIE_DISABLE_ALL | pcie->xbar_config;
+
+       list_for_each_entry(port, &pcie->ports, list)
+               value &= ~AFI_PCIE_CONFIG_PCIE_DISABLE(port->index);
+
+       afi_writel(pcie, value, AFI_PCIE_CONFIG);
+
+       value = afi_readl(pcie, AFI_FUSE);
+       value &= ~AFI_FUSE_PCIE_T0_GEN2_DIS;
+       afi_writel(pcie, value, AFI_FUSE);
+
+       /* initialze internal PHY, enable up to 16 PCIE lanes */
+       pads_writel(pcie, 0x0, PADS_CTL_SEL);
+
+       /* override IDDQ to 1 on all 4 lanes */
+       value = pads_readl(pcie, PADS_CTL);
+       value |= PADS_CTL_IDDQ_1L;
+       pads_writel(pcie, value, PADS_CTL);
+
+       /*
+        * Set up PHY PLL inputs select PLLE output as refclock,
+        * set TX ref sel to div10 (not div5).
+        */
+       value = pads_readl(pcie, soc->pads_pll_ctl);
+       value &= ~(PADS_PLL_CTL_REFCLK_MASK | PADS_PLL_CTL_TXCLKREF_MASK);
+       value |= PADS_PLL_CTL_REFCLK_INTERNAL_CML | soc->tx_ref_sel;
+       pads_writel(pcie, value, soc->pads_pll_ctl);
+
+       /* take PLL out of reset  */
+       value = pads_readl(pcie, soc->pads_pll_ctl);
+       value |= PADS_PLL_CTL_RST_B4SM;
+       pads_writel(pcie, value, soc->pads_pll_ctl);
+
+       /* Configure the reference clock driver */
+       value = PADS_REFCLK_CFG_VALUE | (PADS_REFCLK_CFG_VALUE << 16);
+       pads_writel(pcie, value, PADS_REFCLK_CFG0);
+       if (soc->num_ports > 2)
+               pads_writel(pcie, PADS_REFCLK_CFG_VALUE, PADS_REFCLK_CFG1);
+
+       /* wait for the PLL to lock */
+       timeout = 300;
+       do {
+               value = pads_readl(pcie, soc->pads_pll_ctl);
+               usleep_range(1000, 2000);
+               if (--timeout == 0) {
+                       pr_err("Tegra PCIe error: timeout waiting for PLL\n");
+                       return -EBUSY;
+               }
+       } while (!(value & PADS_PLL_CTL_LOCKDET));
+
+       /* turn off IDDQ override */
+       value = pads_readl(pcie, PADS_CTL);
+       value &= ~PADS_CTL_IDDQ_1L;
+       pads_writel(pcie, value, PADS_CTL);
+
+       /* enable TX/RX data */
+       value = pads_readl(pcie, PADS_CTL);
+       value |= PADS_CTL_TX_DATA_EN_1L | PADS_CTL_RX_DATA_EN_1L;
+       pads_writel(pcie, value, PADS_CTL);
+
+       /* take the PCIe interface module out of reset */
+       tegra_periph_reset_deassert(pcie->pcie_xclk);
+
+       /* finally enable PCIe */
+       value = afi_readl(pcie, AFI_CONFIGURATION);
+       value |= AFI_CONFIGURATION_EN_FPCI;
+       afi_writel(pcie, value, AFI_CONFIGURATION);
+
+       value = AFI_INTR_EN_INI_SLVERR | AFI_INTR_EN_INI_DECERR |
+               AFI_INTR_EN_TGT_SLVERR | AFI_INTR_EN_TGT_DECERR |
+               AFI_INTR_EN_TGT_WRERR | AFI_INTR_EN_DFPCI_DECERR;
+
+       if (soc->has_intr_prsnt_sense)
+               value |= AFI_INTR_EN_PRSNT_SENSE;
+
+       afi_writel(pcie, value, AFI_AFI_INTR_ENABLE);
+       afi_writel(pcie, 0xffffffff, AFI_SM_INTR_ENABLE);
+
+       /* don't enable MSI for now, only when needed */
+       afi_writel(pcie, AFI_INTR_MASK_INT_MASK, AFI_INTR_MASK);
+
+       /* disable all exceptions */
+       afi_writel(pcie, 0, AFI_FPCI_ERROR_MASKS);
+
+       return 0;
+}
+
+static void tegra_pcie_power_off(struct tegra_pcie *pcie)
+{
+       const struct tegra_pcie_soc_data *soc = pcie->soc_data;
+       int err;
+
+       /* TODO: disable and unprepare clocks? */
+
+       tegra_periph_reset_assert(pcie->pcie_xclk);
+       tegra_periph_reset_assert(pcie->afi_clk);
+       tegra_periph_reset_assert(pcie->pex_clk);
+
+       tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
+
+       if (soc->has_avdd_supply) {
+               err = regulator_disable(pcie->avdd_supply);
+               if (err < 0)
+                       dev_warn(pcie->dev,
+                                "failed to disable AVDD regulator: %d\n",
+                                err);
+       }
+
+       err = regulator_disable(pcie->pex_clk_supply);
+       if (err < 0)
+               dev_warn(pcie->dev, "failed to disable pex-clk regulator: %d\n",
+                        err);
+
+       err = regulator_disable(pcie->vdd_supply);
+       if (err < 0)
+               dev_warn(pcie->dev, "failed to disable VDD regulator: %d\n",
+                        err);
+}
+
+static int tegra_pcie_power_on(struct tegra_pcie *pcie)
+{
+       const struct tegra_pcie_soc_data *soc = pcie->soc_data;
+       int err;
+
+       tegra_periph_reset_assert(pcie->pcie_xclk);
+       tegra_periph_reset_assert(pcie->afi_clk);
+       tegra_periph_reset_assert(pcie->pex_clk);
+
+       tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
+
+       /* enable regulators */
+       err = regulator_enable(pcie->vdd_supply);
+       if (err < 0) {
+               dev_err(pcie->dev, "failed to enable VDD regulator: %d\n", err);
+               return err;
+       }
+
+       err = regulator_enable(pcie->pex_clk_supply);
+       if (err < 0) {
+               dev_err(pcie->dev, "failed to enable pex-clk regulator: %d\n",
+                       err);
+               return err;
+       }
+
+       if (soc->has_avdd_supply) {
+               err = regulator_enable(pcie->avdd_supply);
+               if (err < 0) {
+                       dev_err(pcie->dev,
+                               "failed to enable AVDD regulator: %d\n",
+                               err);
+                       return err;
+               }
+       }
+
+       err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
+                                               pcie->pex_clk);
+       if (err) {
+               dev_err(pcie->dev, "powerup sequence failed: %d\n", err);
+               return err;
+       }
+
+       tegra_periph_reset_deassert(pcie->afi_clk);
+
+       err = clk_prepare_enable(pcie->afi_clk);
+       if (err < 0) {
+               dev_err(pcie->dev, "failed to enable AFI clock: %d\n", err);
+               return err;
+       }
+
+       if (soc->has_cml_clk) {
+               err = clk_prepare_enable(pcie->cml_clk);
+               if (err < 0) {
+                       dev_err(pcie->dev, "failed to enable CML clock: %d\n",
+                               err);
+                       return err;
+               }
+       }
+
+       err = clk_prepare_enable(pcie->pll_e);
+       if (err < 0) {
+               dev_err(pcie->dev, "failed to enable PLLE clock: %d\n", err);
+               return err;
+       }
+
+       return 0;
+}
+
+static int tegra_pcie_clocks_get(struct tegra_pcie *pcie)
+{
+       const struct tegra_pcie_soc_data *soc = pcie->soc_data;
+
+       pcie->pex_clk = devm_clk_get(pcie->dev, "pex");
+       if (IS_ERR(pcie->pex_clk))
+               return PTR_ERR(pcie->pex_clk);
+
+       pcie->afi_clk = devm_clk_get(pcie->dev, "afi");
+       if (IS_ERR(pcie->afi_clk))
+               return PTR_ERR(pcie->afi_clk);
+
+       pcie->pcie_xclk = devm_clk_get(pcie->dev, "pcie_xclk");
+       if (IS_ERR(pcie->pcie_xclk))
+               return PTR_ERR(pcie->pcie_xclk);
+
+       pcie->pll_e = devm_clk_get(pcie->dev, "pll_e");
+       if (IS_ERR(pcie->pll_e))
+               return PTR_ERR(pcie->pll_e);
+
+       if (soc->has_cml_clk) {
+               pcie->cml_clk = devm_clk_get(pcie->dev, "cml");
+               if (IS_ERR(pcie->cml_clk))
+                       return PTR_ERR(pcie->cml_clk);
+       }
+
+       return 0;
+}
+
+static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
+{
+       struct platform_device *pdev = to_platform_device(pcie->dev);
+       struct resource *pads, *afi, *res;
+       int err;
+
+       err = tegra_pcie_clocks_get(pcie);
+       if (err) {
+               dev_err(&pdev->dev, "failed to get clocks: %d\n", err);
+               return err;
+       }
+
+       err = tegra_pcie_power_on(pcie);
+       if (err) {
+               dev_err(&pdev->dev, "failed to power up: %d\n", err);
+               return err;
+       }
+
+       pads = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pads");
+       pcie->pads = devm_ioremap_resource(&pdev->dev, pads);
+       if (IS_ERR(pcie->pads)) {
+               err = PTR_ERR(pcie->pads);
+               goto poweroff;
+       }
+
+       afi = platform_get_resource_byname(pdev, IORESOURCE_MEM, "afi");
+       pcie->afi = devm_ioremap_resource(&pdev->dev, afi);
+       if (IS_ERR(pcie->afi)) {
+               err = PTR_ERR(pcie->afi);
+               goto poweroff;
+       }
+
+       /* request configuration space, but remap later, on demand */
+       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cs");
+       if (!res) {
+               err = -EADDRNOTAVAIL;
+               goto poweroff;
+       }
+
+       pcie->cs = devm_request_mem_region(pcie->dev, res->start,
+                                          resource_size(res), res->name);
+       if (!pcie->cs) {
+               err = -EADDRNOTAVAIL;
+               goto poweroff;
+       }
+
+       /* request interrupt */
+       err = platform_get_irq_byname(pdev, "intr");
+       if (err < 0) {
+               dev_err(&pdev->dev, "failed to get IRQ: %d\n", err);
+               goto poweroff;
+       }
+
+       pcie->irq = err;
+
+       err = request_irq(pcie->irq, tegra_pcie_isr, IRQF_SHARED, "PCIE", pcie);
+       if (err) {
+               dev_err(&pdev->dev, "failed to register IRQ: %d\n", err);
+               goto poweroff;
+       }
+
+       return 0;
+
+poweroff:
+       tegra_pcie_power_off(pcie);
+       return err;
+}
+
+static int tegra_pcie_put_resources(struct tegra_pcie *pcie)
+{
+       if (pcie->irq > 0)
+               free_irq(pcie->irq, pcie);
+
+       tegra_pcie_power_off(pcie);
+       return 0;
+}
+
+static int tegra_msi_alloc(struct tegra_msi *chip)
+{
+       int msi;
+
+       mutex_lock(&chip->lock);
+
+       msi = find_first_zero_bit(chip->used, INT_PCI_MSI_NR);
+       if (msi < INT_PCI_MSI_NR)
+               set_bit(msi, chip->used);
+       else
+               msi = -ENOSPC;
+
+       mutex_unlock(&chip->lock);
+
+       return msi;
+}
+
+static void tegra_msi_free(struct tegra_msi *chip, unsigned long irq)
+{
+       struct device *dev = chip->chip.dev;
+
+       mutex_lock(&chip->lock);
+
+       if (!test_bit(irq, chip->used))
+               dev_err(dev, "trying to free unused MSI#%lu\n", irq);
+       else
+               clear_bit(irq, chip->used);
+
+       mutex_unlock(&chip->lock);
+}
+
+static irqreturn_t tegra_pcie_msi_irq(int irq, void *data)
+{
+       struct tegra_pcie *pcie = data;
+       struct tegra_msi *msi = &pcie->msi;
+       unsigned int i, processed = 0;
+
+       for (i = 0; i < 8; i++) {
+               unsigned long reg = afi_readl(pcie, AFI_MSI_VEC0 + i * 4);
+
+               while (reg) {
+                       unsigned int offset = find_first_bit(&reg, 32);
+                       unsigned int index = i * 32 + offset;
+                       unsigned int irq;
+
+                       /* clear the interrupt */
+                       afi_writel(pcie, 1 << offset, AFI_MSI_VEC0 + i * 4);
+
+                       irq = irq_find_mapping(msi->domain, index);
+                       if (irq) {
+                               if (test_bit(index, msi->used))
+                                       generic_handle_irq(irq);
+                               else
+                                       dev_info(pcie->dev, "unhandled MSI\n");
+                       } else {
+                               /*
+                                * that's weird who triggered this?
+                                * just clear it
+                                */
+                               dev_info(pcie->dev, "unexpected MSI\n");
+                       }
+
+                       /* see if there's any more pending in this vector */
+                       reg = afi_readl(pcie, AFI_MSI_VEC0 + i * 4);
+
+                       processed++;
+               }
+       }
+
+       return processed > 0 ? IRQ_HANDLED : IRQ_NONE;
+}
+
+static int tegra_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
+                              struct msi_desc *desc)
+{
+       struct tegra_msi *msi = to_tegra_msi(chip);
+       struct msi_msg msg;
+       unsigned int irq;
+       int hwirq;
+
+       hwirq = tegra_msi_alloc(msi);
+       if (hwirq < 0)
+               return hwirq;
+
+       irq = irq_create_mapping(msi->domain, hwirq);
+       if (!irq)
+               return -EINVAL;
+
+       irq_set_msi_desc(irq, desc);
+
+       msg.address_lo = virt_to_phys((void *)msi->pages);
+       /* 32 bit address only */
+       msg.address_hi = 0;
+       msg.data = hwirq;
+
+       write_msi_msg(irq, &msg);
+
+       return 0;
+}
+
+static void tegra_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
+{
+       struct tegra_msi *msi = to_tegra_msi(chip);
+       struct irq_data *d = irq_get_irq_data(irq);
+
+       tegra_msi_free(msi, d->hwirq);
+}
+
+static struct irq_chip tegra_msi_irq_chip = {
+       .name = "Tegra PCIe MSI",
+       .irq_enable = unmask_msi_irq,
+       .irq_disable = mask_msi_irq,
+       .irq_mask = mask_msi_irq,
+       .irq_unmask = unmask_msi_irq,
+};
+
+static int tegra_msi_map(struct irq_domain *domain, unsigned int irq,
+                        irq_hw_number_t hwirq)
+{
+       irq_set_chip_and_handler(irq, &tegra_msi_irq_chip, handle_simple_irq);
+       irq_set_chip_data(irq, domain->host_data);
+       set_irq_flags(irq, IRQF_VALID);
+
+       tegra_cpuidle_pcie_irqs_in_use();
+
+       return 0;
+}
+
+static const struct irq_domain_ops msi_domain_ops = {
+       .map = tegra_msi_map,
+};
+
+static int tegra_pcie_enable_msi(struct tegra_pcie *pcie)
+{
+       struct platform_device *pdev = to_platform_device(pcie->dev);
+       const struct tegra_pcie_soc_data *soc = pcie->soc_data;
+       struct tegra_msi *msi = &pcie->msi;
+       unsigned long base;
+       int err;
+       u32 reg;
+
+       mutex_init(&msi->lock);
+
+       msi->chip.dev = pcie->dev;
+       msi->chip.setup_irq = tegra_msi_setup_irq;
+       msi->chip.teardown_irq = tegra_msi_teardown_irq;
+
+       msi->domain = irq_domain_add_linear(pcie->dev->of_node, INT_PCI_MSI_NR,
+                                           &msi_domain_ops, &msi->chip);
+       if (!msi->domain) {
+               dev_err(&pdev->dev, "failed to create IRQ domain\n");
+               return -ENOMEM;
+       }
+
+       err = platform_get_irq_byname(pdev, "msi");
+       if (err < 0) {
+               dev_err(&pdev->dev, "failed to get IRQ: %d\n", err);
+               goto err;
+       }
+
+       msi->irq = err;
+
+       err = request_irq(msi->irq, tegra_pcie_msi_irq, 0,
+                         tegra_msi_irq_chip.name, pcie);
+       if (err < 0) {
+               dev_err(&pdev->dev, "failed to request IRQ: %d\n", err);
+               goto err;
+       }
+
+       /* setup AFI/FPCI range */
+       msi->pages = __get_free_pages(GFP_KERNEL, 0);
+       base = virt_to_phys((void *)msi->pages);
+
+       afi_writel(pcie, base >> soc->msi_base_shift, AFI_MSI_FPCI_BAR_ST);
+       afi_writel(pcie, base, AFI_MSI_AXI_BAR_ST);
+       /* this register is in 4K increments */
+       afi_writel(pcie, 1, AFI_MSI_BAR_SZ);
+
+       /* enable all MSI vectors */
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC0);
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC1);
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC2);
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC3);
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC4);
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC5);
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC6);
+       afi_writel(pcie, 0xffffffff, AFI_MSI_EN_VEC7);
+
+       /* and unmask the MSI interrupt */
+       reg = afi_readl(pcie, AFI_INTR_MASK);
+       reg |= AFI_INTR_MASK_MSI_MASK;
+       afi_writel(pcie, reg, AFI_INTR_MASK);
+
+       return 0;
+
+err:
+       irq_domain_remove(msi->domain);
+       return err;
+}
+
+static int tegra_pcie_disable_msi(struct tegra_pcie *pcie)
+{
+       struct tegra_msi *msi = &pcie->msi;
+       unsigned int i, irq;
+       u32 value;
+
+       /* mask the MSI interrupt */
+       value = afi_readl(pcie, AFI_INTR_MASK);
+       value &= ~AFI_INTR_MASK_MSI_MASK;
+       afi_writel(pcie, value, AFI_INTR_MASK);
+
+       /* disable all MSI vectors */
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC0);
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC1);
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC2);
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC3);
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC4);
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC5);
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC6);
+       afi_writel(pcie, 0, AFI_MSI_EN_VEC7);
+
+       free_pages(msi->pages, 0);
+
+       if (msi->irq > 0)
+               free_irq(msi->irq, pcie);
+
+       for (i = 0; i < INT_PCI_MSI_NR; i++) {
+               irq = irq_find_mapping(msi->domain, i);
+               if (irq > 0)
+                       irq_dispose_mapping(irq);
+       }
+
+       irq_domain_remove(msi->domain);
+
+       return 0;
+}
+
+static int tegra_pcie_get_xbar_config(struct tegra_pcie *pcie, u32 lanes,
+                                     u32 *xbar)
+{
+       struct device_node *np = pcie->dev->of_node;
+
+       if (of_device_is_compatible(np, "nvidia,tegra30-pcie")) {
+               switch (lanes) {
+               case 0x00000204:
+                       dev_info(pcie->dev, "4x1, 2x1 configuration\n");
+                       *xbar = AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_420;
+                       return 0;
+
+               case 0x00020202:
+                       dev_info(pcie->dev, "2x3 configuration\n");
+                       *xbar = AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_222;
+                       return 0;
+
+               case 0x00010104:
+                       dev_info(pcie->dev, "4x1, 1x2 configuration\n");
+                       *xbar = AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_411;
+                       return 0;
+               }
+       } else if (of_device_is_compatible(np, "nvidia,tegra20-pcie")) {
+               switch (lanes) {
+               case 0x00000004:
+                       dev_info(pcie->dev, "single-mode configuration\n");
+                       *xbar = AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_SINGLE;
+                       return 0;
+
+               case 0x00000202:
+                       dev_info(pcie->dev, "dual-mode configuration\n");
+                       *xbar = AFI_PCIE_CONFIG_SM2TMS0_XBAR_CONFIG_DUAL;
+                       return 0;
+               }
+       }
+
+       return -EINVAL;
+}
+
+static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
+{
+       const struct tegra_pcie_soc_data *soc = pcie->soc_data;
+       struct device_node *np = pcie->dev->of_node, *port;
+       struct of_pci_range_parser parser;
+       struct of_pci_range range;
+       struct resource res;
+       u32 lanes = 0;
+       int err;
+
+       if (of_pci_range_parser_init(&parser, np)) {
+               dev_err(pcie->dev, "missing \"ranges\" property\n");
+               return -EINVAL;
+       }
+
+       pcie->vdd_supply = devm_regulator_get(pcie->dev, "vdd");
+       if (IS_ERR(pcie->vdd_supply))
+               return PTR_ERR(pcie->vdd_supply);
+
+       pcie->pex_clk_supply = devm_regulator_get(pcie->dev, "pex-clk");
+       if (IS_ERR(pcie->pex_clk_supply))
+               return PTR_ERR(pcie->pex_clk_supply);
+
+       if (soc->has_avdd_supply) {
+               pcie->avdd_supply = devm_regulator_get(pcie->dev, "avdd");
+               if (IS_ERR(pcie->avdd_supply))
+                       return PTR_ERR(pcie->avdd_supply);
+       }
+
+       for_each_of_pci_range(&parser, &range) {
+               of_pci_range_to_resource(&range, np, &res);
+
+               switch (res.flags & IORESOURCE_TYPE_BITS) {
+               case IORESOURCE_IO:
+                       memcpy(&pcie->io, &res, sizeof(res));
+                       pcie->io.name = "I/O";
+                       break;
+
+               case IORESOURCE_MEM:
+                       if (res.flags & IORESOURCE_PREFETCH) {
+                               memcpy(&pcie->prefetch, &res, sizeof(res));
+                               pcie->prefetch.name = "PREFETCH";
+                       } else {
+                               memcpy(&pcie->mem, &res, sizeof(res));
+                               pcie->mem.name = "MEM";
+                       }
+                       break;
+               }
+       }
+
+       err = of_pci_parse_bus_range(np, &pcie->busn);
+       if (err < 0) {
+               dev_err(pcie->dev, "failed to parse ranges property: %d\n",
+                       err);
+               pcie->busn.name = np->name;
+               pcie->busn.start = 0;
+               pcie->busn.end = 0xff;
+               pcie->busn.flags = IORESOURCE_BUS;
+       }
+
+       /* parse root ports */
+       for_each_child_of_node(np, port) {
+               struct tegra_pcie_port *rp;
+               unsigned int index;
+               u32 value;
+
+               err = of_pci_get_devfn(port);
+               if (err < 0) {
+                       dev_err(pcie->dev, "failed to parse address: %d\n",
+                               err);
+                       return err;
+               }
+
+               index = PCI_SLOT(err);
+
+               if (index < 1 || index > soc->num_ports) {
+                       dev_err(pcie->dev, "invalid port number: %d\n", index);
+                       return -EINVAL;
+               }
+
+               index--;
+
+               err = of_property_read_u32(port, "nvidia,num-lanes", &value);
+               if (err < 0) {
+                       dev_err(pcie->dev, "failed to parse # of lanes: %d\n",
+                               err);
+                       return err;
+               }
+
+               if (value > 16) {
+                       dev_err(pcie->dev, "invalid # of lanes: %u\n", value);
+                       return -EINVAL;
+               }
+
+               lanes |= value << (index << 3);
+
+               if (!of_device_is_available(port))
+                       continue;
+
+               rp = devm_kzalloc(pcie->dev, sizeof(*rp), GFP_KERNEL);
+               if (!rp)
+                       return -ENOMEM;
+
+               err = of_address_to_resource(port, 0, &rp->regs);
+               if (err < 0) {
+                       dev_err(pcie->dev, "failed to parse address: %d\n",
+                               err);
+                       return err;
+               }
+
+               INIT_LIST_HEAD(&rp->list);
+               rp->index = index;
+               rp->lanes = value;
+               rp->pcie = pcie;
+
+               rp->base = devm_ioremap_resource(pcie->dev, &rp->regs);
+               if (IS_ERR(rp->base))
+                       return PTR_ERR(rp->base);
+
+               list_add_tail(&rp->list, &pcie->ports);
+       }
+
+       err = tegra_pcie_get_xbar_config(pcie, lanes, &pcie->xbar_config);
+       if (err < 0) {
+               dev_err(pcie->dev, "invalid lane configuration\n");
+               return err;
+       }
+
+       return 0;
+}
+
+/*
+ * FIXME: If there are no PCIe cards attached, then calling this function
+ * can result in the increase of the bootup time as there are big timeout
+ * loops.
+ */
+#define TEGRA_PCIE_LINKUP_TIMEOUT      200     /* up to 1.2 seconds */
+static bool tegra_pcie_port_check_link(struct tegra_pcie_port *port)
+{
+       unsigned int retries = 3;
+       unsigned long value;
+
+       do {
+               unsigned int timeout = TEGRA_PCIE_LINKUP_TIMEOUT;
+
+               do {
+                       value = readl(port->base + RP_VEND_XP);
+
+                       if (value & RP_VEND_XP_DL_UP)
+                               break;
+
+                       usleep_range(1000, 2000);
+               } while (--timeout);
+
+               if (!timeout) {
+                       dev_err(port->pcie->dev, "link %u down, retrying\n",
+                               port->index);
+                       goto retry;
+               }
+
+               timeout = TEGRA_PCIE_LINKUP_TIMEOUT;
+
+               do {
+                       value = readl(port->base + RP_LINK_CONTROL_STATUS);
+
+                       if (value & RP_LINK_CONTROL_STATUS_DL_LINK_ACTIVE)
+                               return true;
+
+                       usleep_range(1000, 2000);
+               } while (--timeout);
+
+retry:
+               tegra_pcie_port_reset(port);
+       } while (--retries);
+
+       return false;
+}
+
+static int tegra_pcie_enable(struct tegra_pcie *pcie)
+{
+       struct tegra_pcie_port *port, *tmp;
+       struct hw_pci hw;
+
+       list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
+               dev_info(pcie->dev, "probing port %u, using %u lanes\n",
+                        port->index, port->lanes);
+
+               tegra_pcie_port_enable(port);
+
+               if (tegra_pcie_port_check_link(port))
+                       continue;
+
+               dev_info(pcie->dev, "link %u down, ignoring\n", port->index);
+
+               tegra_pcie_port_disable(port);
+               tegra_pcie_port_free(port);
+       }
+
+       memset(&hw, 0, sizeof(hw));
+
+       hw.nr_controllers = 1;
+       hw.private_data = (void **)&pcie;
+       hw.setup = tegra_pcie_setup;
+       hw.map_irq = tegra_pcie_map_irq;
+       hw.add_bus = tegra_pcie_add_bus;
+       hw.scan = tegra_pcie_scan_bus;
+       hw.ops = &tegra_pcie_ops;
+
+       pci_common_init_dev(pcie->dev, &hw);
+
+       return 0;
+}
+
+static const struct tegra_pcie_soc_data tegra20_pcie_data = {
+       .num_ports = 2,
+       .msi_base_shift = 0,
+       .pads_pll_ctl = PADS_PLL_CTL_TEGRA20,
+       .tx_ref_sel = PADS_PLL_CTL_TXCLKREF_DIV10,
+       .has_pex_clkreq_en = false,
+       .has_pex_bias_ctrl = false,
+       .has_intr_prsnt_sense = false,
+       .has_avdd_supply = false,
+       .has_cml_clk = false,
+};
+
+static const struct tegra_pcie_soc_data tegra30_pcie_data = {
+       .num_ports = 3,
+       .msi_base_shift = 8,
+       .pads_pll_ctl = PADS_PLL_CTL_TEGRA30,
+       .tx_ref_sel = PADS_PLL_CTL_TXCLKREF_BUF_EN,
+       .has_pex_clkreq_en = true,
+       .has_pex_bias_ctrl = true,
+       .has_intr_prsnt_sense = true,
+       .has_avdd_supply = true,
+       .has_cml_clk = true,
+};
+
+static const struct of_device_id tegra_pcie_of_match[] = {
+       { .compatible = "nvidia,tegra30-pcie", .data = &tegra30_pcie_data },
+       { .compatible = "nvidia,tegra20-pcie", .data = &tegra20_pcie_data },
+       { },
+};
+MODULE_DEVICE_TABLE(of, tegra_pcie_of_match);
+
+static int tegra_pcie_probe(struct platform_device *pdev)
+{
+       const struct of_device_id *match;
+       struct tegra_pcie *pcie;
+       int err;
+
+       match = of_match_device(tegra_pcie_of_match, &pdev->dev);
+       if (!match)
+               return -ENODEV;
+
+       pcie = devm_kzalloc(&pdev->dev, sizeof(*pcie), GFP_KERNEL);
+       if (!pcie)
+               return -ENOMEM;
+
+       INIT_LIST_HEAD(&pcie->busses);
+       INIT_LIST_HEAD(&pcie->ports);
+       pcie->soc_data = match->data;
+       pcie->dev = &pdev->dev;
+
+       err = tegra_pcie_parse_dt(pcie);
+       if (err < 0)
+               return err;
+
+       pcibios_min_mem = 0;
+
+       err = tegra_pcie_get_resources(pcie);
+       if (err < 0) {
+               dev_err(&pdev->dev, "failed to request resources: %d\n", err);
+               return err;
+       }
+
+       err = tegra_pcie_enable_controller(pcie);
+       if (err)
+               goto put_resources;
+
+       /* setup the AFI address translations */
+       tegra_pcie_setup_translations(pcie);
+
+       if (IS_ENABLED(CONFIG_PCI_MSI)) {
+               err = tegra_pcie_enable_msi(pcie);
+               if (err < 0) {
+                       dev_err(&pdev->dev,
+                               "failed to enable MSI support: %d\n",
+                               err);
+                       goto put_resources;
+               }
+       }
+
+       err = tegra_pcie_enable(pcie);
+       if (err < 0) {
+               dev_err(&pdev->dev, "failed to enable PCIe ports: %d\n", err);
+               goto disable_msi;
+       }
+
+       platform_set_drvdata(pdev, pcie);
+       return 0;
+
+disable_msi:
+       if (IS_ENABLED(CONFIG_PCI_MSI))
+               tegra_pcie_disable_msi(pcie);
+put_resources:
+       tegra_pcie_put_resources(pcie);
+       return err;
+}
+
+static struct platform_driver tegra_pcie_driver = {
+       .driver = {
+               .name = "tegra-pcie",
+               .owner = THIS_MODULE,
+               .of_match_table = tegra_pcie_of_match,
+               .suppress_bind_attrs = true,
+       },
+       .probe = tegra_pcie_probe,
+};
+module_platform_driver(tegra_pcie_driver);
+
+MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
+MODULE_DESCRIPTION("NVIDIA Tegra PCIe driver");
+MODULE_LICENSE("GPLv2");
index aca7578..b35f93c 100644 (file)
@@ -30,20 +30,60 @@ static int pci_msi_enable = 1;
 
 /* Arch hooks */
 
-#ifndef arch_msi_check_device
-int arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
+#if defined(CONFIG_GENERIC_HARDIRQS)
+int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
+       struct msi_chip *chip = dev->bus->msi;
+       int err;
+
+       if (!chip || !chip->setup_irq)
+               return -EINVAL;
+
+       err = chip->setup_irq(chip, dev, desc);
+       if (err < 0)
+               return err;
+
+       irq_set_chip_data(desc->irq, chip);
+
        return 0;
 }
-#endif
 
-#ifndef arch_setup_msi_irqs
-# define arch_setup_msi_irqs default_setup_msi_irqs
-# define HAVE_DEFAULT_MSI_SETUP_IRQS
-#endif
+void __weak arch_teardown_msi_irq(unsigned int irq)
+{
+       struct msi_chip *chip = irq_get_chip_data(irq);
 
-#ifdef HAVE_DEFAULT_MSI_SETUP_IRQS
-int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+       if (!chip || !chip->teardown_irq)
+               return;
+
+       chip->teardown_irq(chip, irq);
+}
+
+int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
+{
+       struct msi_chip *chip = dev->bus->msi;
+
+       if (!chip || !chip->check_device)
+               return 0;
+
+       return chip->check_device(chip, dev, nvec, type);
+}
+#else
+int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
+{
+       return -ENOSYS;
+}
+
+void __weak arch_teardown_msi_irq(unsigned int irq)
+{
+}
+
+int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
+{
+       return 0;
+}
+#endif /* CONFIG_GENERIC_HARDIRQS */
+
+int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
        struct msi_desc *entry;
        int ret;
@@ -65,14 +105,11 @@ int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 
        return 0;
 }
-#endif
-
-#ifndef arch_teardown_msi_irqs
-# define arch_teardown_msi_irqs default_teardown_msi_irqs
-# define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
-#endif
 
-#ifdef HAVE_DEFAULT_MSI_TEARDOWN_IRQS
+/*
+ * We have a default implementation available as a separate non-weak
+ * function, as it is used by the Xen x86 PCI code
+ */
 void default_teardown_msi_irqs(struct pci_dev *dev)
 {
        struct msi_desc *entry;
@@ -89,14 +126,12 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
                        arch_teardown_msi_irq(entry->irq + i);
        }
 }
-#endif
 
-#ifndef arch_restore_msi_irqs
-# define arch_restore_msi_irqs default_restore_msi_irqs
-# define HAVE_DEFAULT_MSI_RESTORE_IRQS
-#endif
+void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
+{
+       return default_teardown_msi_irqs(dev);
+}
 
-#ifdef HAVE_DEFAULT_MSI_RESTORE_IRQS
 void default_restore_msi_irqs(struct pci_dev *dev, int irq)
 {
        struct msi_desc *entry;
@@ -114,7 +149,11 @@ void default_restore_msi_irqs(struct pci_dev *dev, int irq)
        if (entry)
                write_msi_msg(irq, &entry->msg);
 }
-#endif
+
+void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq)
+{
+       return default_restore_msi_irqs(dev, irq);
+}
 
 static void msi_set_enable(struct pci_dev *dev, int enable)
 {
index 4f9cc93..7ef0f86 100644 (file)
@@ -671,6 +671,7 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
 
        child->parent = parent;
        child->ops = parent->ops;
+       child->msi = parent->msi;
        child->sysdata = parent->sysdata;
        child->bus_flags = parent->bus_flags;
 
index ffff66b..de029bb 100644 (file)
@@ -554,7 +554,7 @@ static irqreturn_t pm860x_vchg_handler(int irq, void *data)
                                        OVTEMP_AUTORECOVER,
                                        OVTEMP_AUTORECOVER);
                        dev_dbg(info->dev,
-                               "%s, pm8606 over-temp occure\n", __func__);
+                               "%s, pm8606 over-temp occurred\n", __func__);
                }
        }
 
@@ -562,7 +562,7 @@ static irqreturn_t pm860x_vchg_handler(int irq, void *data)
                set_vchg_threshold(info, VCHG_OVP_LOW, 0);
                info->allowed = 0;
                dev_dbg(info->dev,
-                       "%s,pm8607 over-vchg occure,vchg = %dmv\n",
+                       "%s,pm8607 over-vchg occurred,vchg = %dmv\n",
                        __func__, vchg);
        } else if (vchg < VCHG_OVP_LOW) {
                set_vchg_threshold(info, VCHG_NORMAL_LOW,
index 1c0bfcb..ffa10ed 100644 (file)
@@ -386,7 +386,7 @@ static int pm2_int_reg2(void *pm2_data, int val)
        if (val & (PM2XXX_INT3_ITCHPRECHARGEWD |
                                PM2XXX_INT3_ITCHCCWD | PM2XXX_INT3_ITCHCVWD)) {
                dev_dbg(pm2->dev,
-                       "Watchdog occured for precharge, CC and CV charge\n");
+                       "Watchdog occurred for precharge, CC and CV charge\n");
        }
 
        return ret;
index a0ece50..fcc8b9a 100644 (file)
-/* drivers/pwm/pwm-samsung.c
- *
+/*
  * Copyright (c) 2007 Ben Dooks
  * Copyright (c) 2008 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
+ *     Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
+ * Copyright (c) 2013 Tomasz Figa <tomasz.figa@gmail.com>
  *
- * S3C series PWM device core
+ * PWM driver for Samsung SoCs
  *
  * 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.
-*/
-
-#define pr_fmt(fmt) "pwm-samsung: " fmt
+ */
 
+#include <linux/bitops.h>
+#include <linux/clk.h>
 #include <linux/export.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
 #include <linux/err.h>
-#include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 #include <linux/pwm.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/time.h>
 
-#include <mach/map.h>
+/* For struct samsung_timer_variant and samsung_pwm_lock. */
+#include <clocksource/samsung_pwm.h>
 
-#include <plat/regs-timer.h>
+#define REG_TCFG0                      0x00
+#define REG_TCFG1                      0x04
+#define REG_TCON                       0x08
 
-struct s3c_chip {
-       struct platform_device  *pdev;
+#define REG_TCNTB(chan)                        (0x0c + ((chan) * 0xc))
+#define REG_TCMPB(chan)                        (0x10 + ((chan) * 0xc))
 
-       struct clk              *clk_div;
-       struct clk              *clk;
-       const char              *label;
+#define TCFG0_PRESCALER_MASK           0xff
+#define TCFG0_PRESCALER1_SHIFT         8
 
-       unsigned int             period_ns;
-       unsigned int             duty_ns;
+#define TCFG1_MUX_MASK                 0xf
+#define TCFG1_SHIFT(chan)              (4 * (chan))
 
-       unsigned char            tcon_base;
-       unsigned char            pwm_id;
-       struct pwm_chip          chip;
+/*
+ * Each channel occupies 4 bits in TCON register, but there is a gap of 4
+ * bits (one channel) after channel 0, so channels have different numbering
+ * when accessing TCON register. See to_tcon_channel() function.
+ *
+ * In addition, the location of autoreload bit for channel 4 (TCON channel 5)
+ * in its set of bits is 2 as opposed to 3 for other channels.
+ */
+#define TCON_START(chan)               BIT(4 * (chan) + 0)
+#define TCON_MANUALUPDATE(chan)                BIT(4 * (chan) + 1)
+#define TCON_INVERT(chan)              BIT(4 * (chan) + 2)
+#define _TCON_AUTORELOAD(chan)         BIT(4 * (chan) + 3)
+#define _TCON_AUTORELOAD4(chan)                BIT(4 * (chan) + 2)
+#define TCON_AUTORELOAD(chan)          \
+       ((chan < 5) ? _TCON_AUTORELOAD(chan) : _TCON_AUTORELOAD4(chan))
+
+/**
+ * struct samsung_pwm_channel - private data of PWM channel
+ * @period_ns: current period in nanoseconds programmed to the hardware
+ * @duty_ns:   current duty time in nanoseconds programmed to the hardware
+ * @tin_ns:    time of one timer tick in nanoseconds with current timer rate
+ */
+struct samsung_pwm_channel {
+       u32 period_ns;
+       u32 duty_ns;
+       u32 tin_ns;
 };
 
-#define to_s3c_chip(chip)      container_of(chip, struct s3c_chip, chip)
-
-#define pwm_dbg(_pwm, msg...) dev_dbg(&(_pwm)->pdev->dev, msg)
+/**
+ * struct samsung_pwm_chip - private data of PWM chip
+ * @chip:              generic PWM chip
+ * @variant:           local copy of hardware variant data
+ * @inverter_mask:     inverter status for all channels - one bit per channel
+ * @base:              base address of mapped PWM registers
+ * @base_clk:          base clock used to drive the timers
+ * @tclk0:             external clock 0 (can be ERR_PTR if not present)
+ * @tclk1:             external clock 1 (can be ERR_PTR if not present)
+ */
+struct samsung_pwm_chip {
+       struct pwm_chip chip;
+       struct samsung_pwm_variant variant;
+       u8 inverter_mask;
+
+       void __iomem *base;
+       struct clk *base_clk;
+       struct clk *tclk0;
+       struct clk *tclk1;
+};
 
-static struct clk *clk_scaler[2];
+#ifndef CONFIG_CLKSRC_SAMSUNG_PWM
+/*
+ * PWM block is shared between pwm-samsung and samsung_pwm_timer drivers
+ * and some registers need access synchronization. If both drivers are
+ * compiled in, the spinlock is defined in the clocksource driver,
+ * otherwise following definition is used.
+ *
+ * Currently we do not need any more complex synchronization method
+ * because all the supported SoCs contain only one instance of the PWM
+ * IP. Should this change, both drivers will need to be modified to
+ * properly synchronize accesses to particular instances.
+ */
+static DEFINE_SPINLOCK(samsung_pwm_lock);
+#endif
 
-static inline int pwm_is_tdiv(struct s3c_chip *chip)
+static inline
+struct samsung_pwm_chip *to_samsung_pwm_chip(struct pwm_chip *chip)
 {
-       return clk_get_parent(chip->clk) == chip->clk_div;
+       return container_of(chip, struct samsung_pwm_chip, chip);
 }
 
-#define pwm_tcon_start(pwm) (1 << (pwm->tcon_base + 0))
-#define pwm_tcon_invert(pwm) (1 << (pwm->tcon_base + 2))
-#define pwm_tcon_autoreload(pwm) (1 << (pwm->tcon_base + 3))
-#define pwm_tcon_manulupdate(pwm) (1 << (pwm->tcon_base + 1))
+static inline unsigned int to_tcon_channel(unsigned int channel)
+{
+       /* TCON register has a gap of 4 bits (1 channel) after channel 0 */
+       return (channel == 0) ? 0 : (channel + 1);
+}
 
-static int s3c_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
+static void pwm_samsung_set_divisor(struct samsung_pwm_chip *pwm,
+                                   unsigned int channel, u8 divisor)
 {
-       struct s3c_chip *s3c = to_s3c_chip(chip);
+       u8 shift = TCFG1_SHIFT(channel);
        unsigned long flags;
-       unsigned long tcon;
+       u32 reg;
+       u8 bits;
 
-       local_irq_save(flags);
+       bits = (fls(divisor) - 1) - pwm->variant.div_base;
 
-       tcon = __raw_readl(S3C2410_TCON);
-       tcon |= pwm_tcon_start(s3c);
-       __raw_writel(tcon, S3C2410_TCON);
+       spin_lock_irqsave(&samsung_pwm_lock, flags);
 
-       local_irq_restore(flags);
+       reg = readl(pwm->base + REG_TCFG1);
+       reg &= ~(TCFG1_MUX_MASK << shift);
+       reg |= bits << shift;
+       writel(reg, pwm->base + REG_TCFG1);
 
-       return 0;
+       spin_unlock_irqrestore(&samsung_pwm_lock, flags);
 }
 
-static void s3c_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
+static int pwm_samsung_is_tdiv(struct samsung_pwm_chip *chip, unsigned int chan)
 {
-       struct s3c_chip *s3c = to_s3c_chip(chip);
-       unsigned long flags;
-       unsigned long tcon;
+       struct samsung_pwm_variant *variant = &chip->variant;
+       u32 reg;
+
+       reg = readl(chip->base + REG_TCFG1);
+       reg >>= TCFG1_SHIFT(chan);
+       reg &= TCFG1_MUX_MASK;
+
+       return (BIT(reg) & variant->tclk_mask) == 0;
+}
+
+static unsigned long pwm_samsung_get_tin_rate(struct samsung_pwm_chip *chip,
+                                             unsigned int chan)
+{
+       unsigned long rate;
+       u32 reg;
 
-       local_irq_save(flags);
+       rate = clk_get_rate(chip->base_clk);
 
-       tcon = __raw_readl(S3C2410_TCON);
-       tcon &= ~pwm_tcon_start(s3c);
-       __raw_writel(tcon, S3C2410_TCON);
+       reg = readl(chip->base + REG_TCFG0);
+       if (chan >= 2)
+               reg >>= TCFG0_PRESCALER1_SHIFT;
+       reg &= TCFG0_PRESCALER_MASK;
 
-       local_irq_restore(flags);
+       return rate / (reg + 1);
 }
 
-static unsigned long pwm_calc_tin(struct s3c_chip *s3c, unsigned long freq)
+static unsigned long pwm_samsung_calc_tin(struct samsung_pwm_chip *chip,
+                                         unsigned int chan, unsigned long freq)
 {
-       unsigned long tin_parent_rate;
-       unsigned int div;
+       struct samsung_pwm_variant *variant = &chip->variant;
+       unsigned long rate;
+       struct clk *clk;
+       u8 div;
+
+       if (!pwm_samsung_is_tdiv(chip, chan)) {
+               clk = (chan < 2) ? chip->tclk0 : chip->tclk1;
+               if (!IS_ERR(clk)) {
+                       rate = clk_get_rate(clk);
+                       if (rate)
+                               return rate;
+               }
+
+               dev_warn(chip->chip.dev,
+                       "tclk of PWM %d is inoperational, using tdiv\n", chan);
+       }
+
+       rate = pwm_samsung_get_tin_rate(chip, chan);
+       dev_dbg(chip->chip.dev, "tin parent at %lu\n", rate);
+
+       /*
+        * Compare minimum PWM frequency that can be achieved with possible
+        * divider settings and choose the lowest divisor that can generate
+        * frequencies lower than requested.
+        */
+       for (div = variant->div_base; div < 4; ++div)
+               if ((rate >> (variant->bits + div)) < freq)
+                       break;
 
-       tin_parent_rate = clk_get_rate(clk_get_parent(s3c->clk_div));
-       pwm_dbg(s3c, "tin parent at %lu\n", tin_parent_rate);
+       pwm_samsung_set_divisor(chip, chan, BIT(div));
 
-       for (div = 2; div <= 16; div *= 2) {
-               if ((tin_parent_rate / (div << 16)) < freq)
-                       return tin_parent_rate / div;
+       return rate >> div;
+}
+
+static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm)
+{
+       struct samsung_pwm_chip *our_chip = to_samsung_pwm_chip(chip);
+       struct samsung_pwm_channel *our_chan;
+
+       if (!(our_chip->variant.output_mask & BIT(pwm->hwpwm))) {
+               dev_warn(chip->dev,
+                       "tried to request PWM channel %d without output\n",
+                       pwm->hwpwm);
+               return -EINVAL;
        }
 
-       return tin_parent_rate / 16;
+       our_chan = devm_kzalloc(chip->dev, sizeof(*our_chan), GFP_KERNEL);
+       if (!our_chan)
+               return -ENOMEM;
+
+       pwm_set_chip_data(pwm, our_chan);
+
+       return 0;
 }
 
-#define NS_IN_HZ (1000000000UL)
+static void pwm_samsung_free(struct pwm_chip *chip, struct pwm_device *pwm)
+{
+       pwm_set_chip_data(pwm, NULL);
+       devm_kfree(chip->dev, pwm_get_chip_data(pwm));
+}
 
-static int s3c_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
-               int duty_ns, int period_ns)
+static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm)
 {
-       struct s3c_chip *s3c = to_s3c_chip(chip);
-       unsigned long tin_rate;
-       unsigned long tin_ns;
-       unsigned long period;
+       struct samsung_pwm_chip *our_chip = to_samsung_pwm_chip(chip);
+       unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm);
        unsigned long flags;
-       unsigned long tcon;
-       unsigned long tcnt;
-       long tcmp;
+       u32 tcon;
 
-       /* We currently avoid using 64bit arithmetic by using the
-        * fact that anything faster than 1Hz is easily representable
-        * by 32bits. */
+       spin_lock_irqsave(&samsung_pwm_lock, flags);
+
+       tcon = readl(our_chip->base + REG_TCON);
+
+       tcon &= ~TCON_START(tcon_chan);
+       tcon |= TCON_MANUALUPDATE(tcon_chan);
+       writel(tcon, our_chip->base + REG_TCON);
+
+       tcon &= ~TCON_MANUALUPDATE(tcon_chan);
+       tcon |= TCON_START(tcon_chan) | TCON_AUTORELOAD(tcon_chan);
+       writel(tcon, our_chip->base + REG_TCON);
+
+       spin_unlock_irqrestore(&samsung_pwm_lock, flags);
+
+       return 0;
+}
+
+static void pwm_samsung_disable(struct pwm_chip *chip, struct pwm_device *pwm)
+{
+       struct samsung_pwm_chip *our_chip = to_samsung_pwm_chip(chip);
+       unsigned int tcon_chan = to_tcon_channel(pwm->hwpwm);
+       unsigned long flags;
+       u32 tcon;
+
+       spin_lock_irqsave(&samsung_pwm_lock, flags);
+
+       tcon = readl(our_chip->base + REG_TCON);
+       tcon &= ~TCON_AUTORELOAD(tcon_chan);
+       writel(tcon, our_chip->base + REG_TCON);
+
+       spin_unlock_irqrestore(&samsung_pwm_lock, flags);
+}
 
-       if (period_ns > NS_IN_HZ || duty_ns > NS_IN_HZ)
+static int pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm,
+                             int duty_ns, int period_ns)
+{
+       struct samsung_pwm_chip *our_chip = to_samsung_pwm_chip(chip);
+       struct samsung_pwm_channel *chan = pwm_get_chip_data(pwm);
+       u32 tin_ns = chan->tin_ns, tcnt, tcmp;
+
+       /*
+        * We currently avoid using 64bit arithmetic by using the
+        * fact that anything faster than 1Hz is easily representable
+        * by 32bits.
+        */
+       if (period_ns > NSEC_PER_SEC)
                return -ERANGE;
 
-       if (period_ns == s3c->period_ns &&
-           duty_ns == s3c->duty_ns)
+       if (period_ns == chan->period_ns && duty_ns == chan->duty_ns)
                return 0;
 
-       /* The TCMP and TCNT can be read without a lock, they're not
-        * shared between the timers. */
+       tcnt = readl(our_chip->base + REG_TCNTB(pwm->hwpwm));
 
-       tcmp = __raw_readl(S3C2410_TCMPB(s3c->pwm_id));
-       tcnt = __raw_readl(S3C2410_TCNTB(s3c->pwm_id));
+       /* We need tick count for calculation, not last tick. */
+       ++tcnt;
 
-       period = NS_IN_HZ / period_ns;
+       /* Check to see if we are changing the clock rate of the PWM. */
+       if (chan->period_ns != period_ns) {
+               unsigned long tin_rate;
+               u32 period;
 
-       pwm_dbg(s3c, "duty_ns=%d, period_ns=%d (%lu)\n",
-               duty_ns, period_ns, period);
+               period = NSEC_PER_SEC / period_ns;
 
-       /* Check to see if we are changing the clock rate of the PWM */
+               dev_dbg(our_chip->chip.dev, "duty_ns=%d, period_ns=%d (%u)\n",
+                                               duty_ns, period_ns, period);
 
-       if (s3c->period_ns != period_ns) {
-               if (pwm_is_tdiv(s3c)) {
-                       tin_rate = pwm_calc_tin(s3c, period);
-                       clk_set_rate(s3c->clk_div, tin_rate);
-               } else
-                       tin_rate = clk_get_rate(s3c->clk);
+               tin_rate = pwm_samsung_calc_tin(our_chip, pwm->hwpwm, period);
 
-               s3c->period_ns = period_ns;
+               dev_dbg(our_chip->chip.dev, "tin_rate=%lu\n", tin_rate);
 
-               pwm_dbg(s3c, "tin_rate=%lu\n", tin_rate);
-
-               tin_ns = NS_IN_HZ / tin_rate;
+               tin_ns = NSEC_PER_SEC / tin_rate;
                tcnt = period_ns / tin_ns;
-       } else
-               tin_ns = NS_IN_HZ / clk_get_rate(s3c->clk);
+       }
 
-       /* Note, counters count down */
+       /* Period is too short. */
+       if (tcnt <= 1)
+               return -ERANGE;
 
+       /* Note that counters count down. */
        tcmp = duty_ns / tin_ns;
+
+       /* 0% duty is not available */
+       if (!tcmp)
+               ++tcmp;
+
        tcmp = tcnt - tcmp;
-       /* the pwm hw only checks the compare register after a decrement,
-          so the pin never toggles if tcmp = tcnt */
-       if (tcmp == tcnt)
-               tcmp--;
 
-       pwm_dbg(s3c, "tin_ns=%lu, tcmp=%ld/%lu\n", tin_ns, tcmp, tcnt);
+       /* Decrement to get tick numbers, instead of tick counts. */
+       --tcnt;
+       /* -1UL will give 100% duty. */
+       --tcmp;
+
+       dev_dbg(our_chip->chip.dev,
+                               "tin_ns=%u, tcmp=%u/%u\n", tin_ns, tcmp, tcnt);
+
+       /* Update PWM registers. */
+       writel(tcnt, our_chip->base + REG_TCNTB(pwm->hwpwm));
+       writel(tcmp, our_chip->base + REG_TCMPB(pwm->hwpwm));
 
-       if (tcmp < 0)
-               tcmp = 0;
+       if (test_bit(PWMF_ENABLED, &pwm->flags))
+               pwm_samsung_enable(chip, pwm);
 
-       /* Update the PWM register block. */
+       chan->period_ns = period_ns;
+       chan->tin_ns = tin_ns;
+       chan->duty_ns = duty_ns;
 
-       local_irq_save(flags);
+       return 0;
+}
 
-       __raw_writel(tcmp, S3C2410_TCMPB(s3c->pwm_id));
-       __raw_writel(tcnt, S3C2410_TCNTB(s3c->pwm_id));
+static void pwm_samsung_set_invert(struct samsung_pwm_chip *chip,
+                                  unsigned int channel, bool invert)
+{
+       unsigned int tcon_chan = to_tcon_channel(channel);
+       unsigned long flags;
+       u32 tcon;
 
-       tcon = __raw_readl(S3C2410_TCON);
-       tcon |= pwm_tcon_manulupdate(s3c);
-       tcon |= pwm_tcon_autoreload(s3c);
-       __raw_writel(tcon, S3C2410_TCON);
+       spin_lock_irqsave(&samsung_pwm_lock, flags);
 
-       tcon &= ~pwm_tcon_manulupdate(s3c);
-       __raw_writel(tcon, S3C2410_TCON);
+       tcon = readl(chip->base + REG_TCON);
+
+       if (invert) {
+               chip->inverter_mask |= BIT(channel);
+               tcon |= TCON_INVERT(tcon_chan);
+       } else {
+               chip->inverter_mask &= ~BIT(channel);
+               tcon &= ~TCON_INVERT(tcon_chan);
+       }
+
+       writel(tcon, chip->base + REG_TCON);
+
+       spin_unlock_irqrestore(&samsung_pwm_lock, flags);
+}
+
+static int pwm_samsung_set_polarity(struct pwm_chip *chip,
+                                   struct pwm_device *pwm,
+                                   enum pwm_polarity polarity)
+{
+       struct samsung_pwm_chip *our_chip = to_samsung_pwm_chip(chip);
+       bool invert = (polarity == PWM_POLARITY_NORMAL);
 
-       local_irq_restore(flags);
+       /* Inverted means normal in the hardware. */
+       pwm_samsung_set_invert(our_chip, pwm->hwpwm, invert);
 
        return 0;
 }
 
-static struct pwm_ops s3c_pwm_ops = {
-       .enable = s3c_pwm_enable,
-       .disable = s3c_pwm_disable,
-       .config = s3c_pwm_config,
-       .owner = THIS_MODULE,
+static const struct pwm_ops pwm_samsung_ops = {
+       .request        = pwm_samsung_request,
+       .free           = pwm_samsung_free,
+       .enable         = pwm_samsung_enable,
+       .disable        = pwm_samsung_disable,
+       .config         = pwm_samsung_config,
+       .set_polarity   = pwm_samsung_set_polarity,
+       .owner          = THIS_MODULE,
 };
 
-static int s3c_pwm_probe(struct platform_device *pdev)
+#ifdef CONFIG_OF
+static const struct samsung_pwm_variant s3c24xx_variant = {
+       .bits           = 16,
+       .div_base       = 1,
+       .has_tint_cstat = false,
+       .tclk_mask      = BIT(4),
+};
+
+static const struct samsung_pwm_variant s3c64xx_variant = {
+       .bits           = 32,
+       .div_base       = 0,
+       .has_tint_cstat = true,
+       .tclk_mask      = BIT(7) | BIT(6) | BIT(5),
+};
+
+static const struct samsung_pwm_variant s5p64x0_variant = {
+       .bits           = 32,
+       .div_base       = 0,
+       .has_tint_cstat = true,
+       .tclk_mask      = 0,
+};
+
+static const struct samsung_pwm_variant s5pc100_variant = {
+       .bits           = 32,
+       .div_base       = 0,
+       .has_tint_cstat = true,
+       .tclk_mask      = BIT(5),
+};
+
+static const struct of_device_id samsung_pwm_matches[] = {
+       { .compatible = "samsung,s3c2410-pwm", .data = &s3c24xx_variant },
+       { .compatible = "samsung,s3c6400-pwm", .data = &s3c64xx_variant },
+       { .compatible = "samsung,s5p6440-pwm", .data = &s5p64x0_variant },
+       { .compatible = "samsung,s5pc100-pwm", .data = &s5pc100_variant },
+       { .compatible = "samsung,exynos4210-pwm", .data = &s5p64x0_variant },
+       {},
+};
+
+static int pwm_samsung_parse_dt(struct samsung_pwm_chip *chip)
+{
+       struct device_node *np = chip->chip.dev->of_node;
+       const struct of_device_id *match;
+       struct property *prop;
+       const __be32 *cur;
+       u32 val;
+
+       match = of_match_node(samsung_pwm_matches, np);
+       if (!match)
+               return -ENODEV;
+
+       memcpy(&chip->variant, match->data, sizeof(chip->variant));
+
+       of_property_for_each_u32(np, "samsung,pwm-outputs", prop, cur, val) {
+               if (val >= SAMSUNG_PWM_NUM) {
+                       dev_err(chip->chip.dev,
+                               "%s: invalid channel index in samsung,pwm-outputs property\n",
+                                                               __func__);
+                       continue;
+               }
+               chip->variant.output_mask |= BIT(val);
+       }
+
+       return 0;
+}
+#else
+static int pwm_samsung_parse_dt(struct samsung_pwm_chip *chip)
+{
+       return -ENODEV;
+}
+#endif
+
+static int pwm_samsung_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct s3c_chip *s3c;
-       unsigned long flags;
-       unsigned long tcon;
-       unsigned int id = pdev->id;
+       struct samsung_pwm_chip *chip;
+       struct resource *res;
+       unsigned int chan;
        int ret;
 
-       if (id == 4) {
-               dev_err(dev, "TIMER4 is currently not supported\n");
-               return -ENXIO;
-       }
-
-       s3c = devm_kzalloc(&pdev->dev, sizeof(*s3c), GFP_KERNEL);
-       if (s3c == NULL) {
-               dev_err(dev, "failed to allocate pwm_device\n");
+       chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
+       if (chip == NULL)
                return -ENOMEM;
-       }
 
-       /* calculate base of control bits in TCON */
-       s3c->tcon_base = id == 0 ? 0 : (id * 4) + 4;
-       s3c->pwm_id = id;
-       s3c->chip.dev = &pdev->dev;
-       s3c->chip.ops = &s3c_pwm_ops;
-       s3c->chip.base = -1;
-       s3c->chip.npwm = 1;
-
-       s3c->clk = devm_clk_get(dev, "pwm-tin");
-       if (IS_ERR(s3c->clk)) {
-               dev_err(dev, "failed to get pwm tin clk\n");
-               return PTR_ERR(s3c->clk);
+       chip->chip.dev = &pdev->dev;
+       chip->chip.ops = &pwm_samsung_ops;
+       chip->chip.base = -1;
+       chip->chip.npwm = SAMSUNG_PWM_NUM;
+       chip->inverter_mask = BIT(SAMSUNG_PWM_NUM) - 1;
+
+       if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) {
+               ret = pwm_samsung_parse_dt(chip);
+               if (ret)
+                       return ret;
+
+               chip->chip.of_xlate = of_pwm_xlate_with_flags;
+               chip->chip.of_pwm_n_cells = 3;
+       } else {
+               if (!pdev->dev.platform_data) {
+                       dev_err(&pdev->dev, "no platform data specified\n");
+                       return -EINVAL;
+               }
+
+               memcpy(&chip->variant, pdev->dev.platform_data,
+                                                       sizeof(chip->variant));
        }
 
-       s3c->clk_div = devm_clk_get(dev, "pwm-tdiv");
-       if (IS_ERR(s3c->clk_div)) {
-               dev_err(dev, "failed to get pwm tdiv clk\n");
-               return PTR_ERR(s3c->clk_div);
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       chip->base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(chip->base))
+               return PTR_ERR(chip->base);
+
+       chip->base_clk = devm_clk_get(&pdev->dev, "timers");
+       if (IS_ERR(chip->base_clk)) {
+               dev_err(dev, "failed to get timer base clk\n");
+               return PTR_ERR(chip->base_clk);
        }
 
-       clk_enable(s3c->clk);
-       clk_enable(s3c->clk_div);
+       ret = clk_prepare_enable(chip->base_clk);
+       if (ret < 0) {
+               dev_err(dev, "failed to enable base clock\n");
+               return ret;
+       }
 
-       local_irq_save(flags);
+       for (chan = 0; chan < SAMSUNG_PWM_NUM; ++chan)
+               if (chip->variant.output_mask & BIT(chan))
+                       pwm_samsung_set_invert(chip, chan, true);
 
-       tcon = __raw_readl(S3C2410_TCON);
-       tcon |= pwm_tcon_invert(s3c);
-       __raw_writel(tcon, S3C2410_TCON);
+       /* Following clocks are optional. */
+       chip->tclk0 = devm_clk_get(&pdev->dev, "pwm-tclk0");
+       chip->tclk1 = devm_clk_get(&pdev->dev, "pwm-tclk1");
 
-       local_irq_restore(flags);
+       platform_set_drvdata(pdev, chip);
 
-       ret = pwmchip_add(&s3c->chip);
+       ret = pwmchip_add(&chip->chip);
        if (ret < 0) {
-               dev_err(dev, "failed to register pwm\n");
-               goto err_clk_tdiv;
+               dev_err(dev, "failed to register PWM chip\n");
+               clk_disable_unprepare(chip->base_clk);
+               return ret;
        }
 
-       pwm_dbg(s3c, "config bits %02x\n",
-               (__raw_readl(S3C2410_TCON) >> s3c->tcon_base) & 0x0f);
-
-       dev_info(dev, "tin at %lu, tdiv at %lu, tin=%sclk, base %d\n",
-                clk_get_rate(s3c->clk),
-                clk_get_rate(s3c->clk_div),
-                pwm_is_tdiv(s3c) ? "div" : "ext", s3c->tcon_base);
+       dev_dbg(dev, "base_clk at %lu, tclk0 at %lu, tclk1 at %lu\n",
+               clk_get_rate(chip->base_clk),
+               !IS_ERR(chip->tclk0) ? clk_get_rate(chip->tclk0) : 0,
+               !IS_ERR(chip->tclk1) ? clk_get_rate(chip->tclk1) : 0);
 
-       platform_set_drvdata(pdev, s3c);
        return 0;
-
- err_clk_tdiv:
-       clk_disable(s3c->clk_div);
-       clk_disable(s3c->clk);
-       return ret;
 }
 
-static int s3c_pwm_remove(struct platform_device *pdev)
+static int pwm_samsung_remove(struct platform_device *pdev)
 {
-       struct s3c_chip *s3c = platform_get_drvdata(pdev);
-       int err;
+       struct samsung_pwm_chip *chip = platform_get_drvdata(pdev);
+       int ret;
 
-       err = pwmchip_remove(&s3c->chip);
-       if (err < 0)
-               return err;
+       ret = pwmchip_remove(&chip->chip);
+       if (ret < 0)
+               return ret;
 
-       clk_disable(s3c->clk_div);
-       clk_disable(s3c->clk);
+       clk_disable_unprepare(chip->base_clk);
 
        return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int s3c_pwm_suspend(struct device *dev)
+static int pwm_samsung_suspend(struct device *dev)
 {
-       struct s3c_chip *s3c = dev_get_drvdata(dev);
+       struct samsung_pwm_chip *chip = dev_get_drvdata(dev);
+       unsigned int i;
 
-       /* No one preserve these values during suspend so reset them
-        * Otherwise driver leaves PWM unconfigured if same values
-        * passed to pwm_config
+       /*
+        * No one preserves these values during suspend so reset them.
+        * Otherwise driver leaves PWM unconfigured if same values are
+        * passed to pwm_config() next time.
         */
-       s3c->period_ns = 0;
-       s3c->duty_ns = 0;
+       for (i = 0; i < SAMSUNG_PWM_NUM; ++i) {
+               struct pwm_device *pwm = &chip->chip.pwms[i];
+               struct samsung_pwm_channel *chan = pwm_get_chip_data(pwm);
+
+               if (!chan)
+                       continue;
+
+               chan->period_ns = 0;
+               chan->duty_ns = 0;
+       }
 
        return 0;
 }
 
-static int s3c_pwm_resume(struct device *dev)
+static int pwm_samsung_resume(struct device *dev)
 {
-       struct s3c_chip *s3c = dev_get_drvdata(dev);
-       unsigned long tcon;
+       struct samsung_pwm_chip *chip = dev_get_drvdata(dev);
+       unsigned int chan;
 
-       /* Restore invertion */
-       tcon = __raw_readl(S3C2410_TCON);
-       tcon |= pwm_tcon_invert(s3c);
-       __raw_writel(tcon, S3C2410_TCON);
+       /*
+        * Inverter setting must be preserved across suspend/resume
+        * as nobody really seems to configure it more than once.
+        */
+       for (chan = 0; chan < SAMSUNG_PWM_NUM; ++chan) {
+               if (chip->variant.output_mask & BIT(chan))
+                       pwm_samsung_set_invert(chip, chan,
+                                       chip->inverter_mask & BIT(chan));
+       }
 
        return 0;
 }
 #endif
 
-static SIMPLE_DEV_PM_OPS(s3c_pwm_pm_ops, s3c_pwm_suspend,
-                       s3c_pwm_resume);
+static const struct dev_pm_ops pwm_samsung_pm_ops = {
+       SET_SYSTEM_SLEEP_PM_OPS(pwm_samsung_suspend, pwm_samsung_resume)
+};
 
-static struct platform_driver s3c_pwm_driver = {
+static struct platform_driver pwm_samsung_driver = {
        .driver         = {
-               .name   = "s3c24xx-pwm",
+               .name   = "samsung-pwm",
                .owner  = THIS_MODULE,
-               .pm     = &s3c_pwm_pm_ops,
+               .pm     = &pwm_samsung_pm_ops,
+               .of_match_table = of_match_ptr(samsung_pwm_matches),
        },
-       .probe          = s3c_pwm_probe,
-       .remove         = s3c_pwm_remove,
+       .probe          = pwm_samsung_probe,
+       .remove         = pwm_samsung_remove,
 };
+module_platform_driver(pwm_samsung_driver);
 
-static int __init pwm_init(void)
-{
-       int ret;
-
-       clk_scaler[0] = clk_get(NULL, "pwm-scaler0");
-       clk_scaler[1] = clk_get(NULL, "pwm-scaler1");
-
-       if (IS_ERR(clk_scaler[0]) || IS_ERR(clk_scaler[1])) {
-               pr_err("failed to get scaler clocks\n");
-               return -EINVAL;
-       }
-
-       ret = platform_driver_register(&s3c_pwm_driver);
-       if (ret)
-               pr_err("failed to add pwm driver\n");
-
-       return ret;
-}
-
-arch_initcall(pwm_init);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Tomasz Figa <tomasz.figa@gmail.com>");
+MODULE_ALIAS("platform:samsung-pwm");
index 9796284..9967f9c 100644 (file)
@@ -206,7 +206,7 @@ bfad_im_abort_handler(struct scsi_cmnd *cmnd)
        spin_lock_irqsave(&bfad->bfad_lock, flags);
        hal_io = (struct bfa_ioim_s *) cmnd->host_scribble;
        if (!hal_io) {
-               /* IO has been completed, retrun success */
+               /* IO has been completed, return success */
                rc = SUCCESS;
                goto out;
        }
index 80fa99b..8135f04 100644 (file)
@@ -658,11 +658,11 @@ static inline u32 cxgbi_tag_nonrsvd_bits(struct cxgbi_tag_format *tformat,
 static inline void *cxgbi_alloc_big_mem(unsigned int size,
                                        gfp_t gfp)
 {
-       void *p = kmalloc(size, gfp);
+       void *p = kzalloc(size, gfp | __GFP_NOWARN);
+
        if (!p)
-               p = vmalloc(size);
-       if (p)
-               memset(p, 0, size);
+               p = vzalloc(size);
+
        return p;
 }
 
index b766f5a..fac8cf5 100644 (file)
@@ -1054,7 +1054,7 @@ free_and_out:
 }
 
 /*
- * Lookup bus/target/lun and retrun corresponding struct hpsa_scsi_dev_t *
+ * Lookup bus/target/lun and return corresponding struct hpsa_scsi_dev_t *
  * Assume's h->devlock is held.
  */
 static struct hpsa_scsi_dev_t *lookup_hpsa_scsi_dev(struct ctlr_info *h,
index 22f42f8..16498e0 100644 (file)
@@ -816,7 +816,7 @@ lpfc_issue_reset(struct device *dev, struct device_attribute *attr,
  * the readyness after performing a firmware reset.
  *
  * Returns:
- * zero for success, -EPERM when port does not have privilage to perform the
+ * zero for success, -EPERM when port does not have privilege to perform the
  * reset, -EIO when port timeout from recovering from the reset.
  *
  * Note:
@@ -833,7 +833,7 @@ lpfc_sli4_pdev_status_reg_wait(struct lpfc_hba *phba)
        lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr,
                   &portstat_reg.word0);
 
-       /* verify if privilaged for the request operation */
+       /* verify if privileged for the request operation */
        if (!bf_get(lpfc_sliport_status_rn, &portstat_reg) &&
            !bf_get(lpfc_sliport_status_err, &portstat_reg))
                return -EPERM;
@@ -925,9 +925,9 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
        rc = lpfc_sli4_pdev_status_reg_wait(phba);
 
        if (rc == -EPERM) {
-               /* no privilage for reset */
+               /* no privilege for reset */
                lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
-                               "3150 No privilage to perform the requested "
+                               "3150 No privilege to perform the requested "
                                "access: x%x\n", reg_val);
        } else if (rc == -EIO) {
                /* reset failed, there is nothing more we can do */
index bc27063..79c13c3 100644 (file)
@@ -2628,7 +2628,7 @@ err_get_xri_exit:
  * @phba: Pointer to HBA context object
  *
  * This function allocates BSG_MBOX_SIZE (4KB) page size dma buffer and.
- * retruns the pointer to the buffer.
+ * returns the pointer to the buffer.
  **/
 static struct lpfc_dmabuf *
 lpfc_bsg_dma_page_alloc(struct lpfc_hba *phba)
index e6a1e0b..515c962 100644 (file)
@@ -549,7 +549,7 @@ out_probe_one:
 
 /**
  * megaraid_detach_one - release framework resources and call LLD release routine
- * @pdev       : handle for our PCI cofiguration space
+ * @pdev       : handle for our PCI configuration space
  *
  * This routine is called during driver unload. We free all the allocated
  * resources and call the corresponding LLD so that it can also release all
@@ -979,7 +979,7 @@ megaraid_fini_mbox(adapter_t *adapter)
  * @adapter            : soft state of the raid controller
  *
  * Allocate and align the shared mailbox. This maibox is used to issue
- * all the commands. For IO based controllers, the mailbox is also regsitered
+ * all the commands. For IO based controllers, the mailbox is also registered
  * with the FW. Allocate memory for all commands as well.
  * This is our big allocator.
  */
@@ -2027,7 +2027,7 @@ megaraid_mbox_prepare_pthru(adapter_t *adapter, scb_t *scb,
  * @scb                : scsi control block
  * @scp                : scsi command from the mid-layer
  *
- * Prepare a command for the scsi physical devices. This rountine prepares
+ * Prepare a command for the scsi physical devices. This routine prepares
  * commands for devices which can take extended CDBs (>10 bytes).
  */
 static void
@@ -2586,7 +2586,7 @@ megaraid_abort_handler(struct scsi_cmnd *scp)
 }
 
 /**
- * megaraid_reset_handler - device reset hadler for mailbox based driver
+ * megaraid_reset_handler - device reset handler for mailbox based driver
  * @scp                : reference command
  *
  * Reset handler for the mailbox based controller. First try to find out if
@@ -3446,7 +3446,7 @@ megaraid_mbox_display_scb(adapter_t *adapter, scb_t *scb)
  * megaraid_mbox_setup_device_map - manage device ids
  * @adapter    : Driver's soft state
  *
- * Manange the device ids to have an appropriate mapping between the kernel
+ * Manage the device ids to have an appropriate mapping between the kernel
  * scsi addresses and megaraid scsi and logical drive addresses. We export
  * scsi devices on their actual addresses, whereas the logical drives are
  * exported on a virtual scsi channel.
index 25506c7..dfffd0f 100644 (file)
@@ -896,7 +896,7 @@ hinfo_to_cinfo(mraid_hba_info_t *hinfo, mcontroller_t *cinfo)
 
 /**
  * mraid_mm_register_adp - Registration routine for low level drivers
- * @lld_adp    : Adapter objejct
+ * @lld_adp    : Adapter object
  */
 int
 mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
index 12ff01c..4eb8401 100644 (file)
@@ -88,7 +88,7 @@ enum MR_RAID_FLAGS_IO_SUB_TYPE {
 #define MEGASAS_FUSION_IN_RESET 0
 
 /*
- * Raid Context structure which describes MegaRAID specific IO Paramenters
+ * Raid Context structure which describes MegaRAID specific IO Parameters
  * This resides at offset 0x60 where the SGL normally starts in MPT IO Frames
  */
 
index b989add..aa57bf0 100644 (file)
@@ -1895,7 +1895,7 @@ done:
        bsg_job->reply->reply_payload_rcv_len = 0;
        bsg_job->reply->result = (DID_OK) << 16;
        bsg_job->job_done(bsg_job);
-       /* Always retrun success, vendor rsp carries correct status */
+       /* Always return success, vendor rsp carries correct status */
        return 0;
 }
 
index 2482975..62ee713 100644 (file)
@@ -1865,7 +1865,7 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type)
                p_sysid = utsname();
                if (!p_sysid) {
                        ql_log(ql_log_warn, vha, 0x303c,
-                           "Not able to get the system informtion\n");
+                           "Not able to get the system information\n");
                        goto done_free_sp;
                }
                break;
index f38855f..9a64c3f 100644 (file)
@@ -276,6 +276,7 @@ static int altera_spi_remove(struct platform_device *dev)
 #ifdef CONFIG_OF
 static const struct of_device_id altera_spi_match[] = {
        { .compatible = "ALTR,spi-1.0", },
+       { .compatible = "altr,spi-1.0", },
        {},
 };
 MODULE_DEVICE_TABLE(of, altera_spi_match);
index e3946e4..8c11355 100644 (file)
@@ -40,7 +40,7 @@
  * to glue code.  These bitbang setup() and cleanup() routines are always
  * used, though maybe they're called from controller-aware code.
  *
- * chipselect() and friends may use use spi_device->controller_data and
+ * chipselect() and friends may use spi_device->controller_data and
  * controller registers as appropriate.
  *
  *
index 7a84a05..af8cdaa 100644 (file)
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
 #include <linux/moduleparam.h>
+#include <linux/platform_device.h>
 #include <linux/types.h>
 
+#include <asm/setup.h>
+#include <arch/sim_def.h>
+
 #include <hv/hypervisor.h>
 
 #include "hvc_console.h"
 
+static int use_sim_console;
+static int __init sim_console(char *str)
+{
+       use_sim_console = 1;
+       return 0;
+}
+early_param("sim_console", sim_console);
+
+int tile_console_write(const char *buf, int count)
+{
+       if (unlikely(use_sim_console)) {
+               int i;
+               for (i = 0; i < count; ++i)
+                       __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_PUTC |
+                                    (buf[i] << _SIM_CONTROL_OPERATOR_BITS));
+               __insn_mtspr(SPR_SIM_CONTROL, SIM_CONTROL_PUTC |
+                            (SIM_PUTC_FLUSH_BINARY <<
+                             _SIM_CONTROL_OPERATOR_BITS));
+               return 0;
+       } else {
+               return hv_console_write((HV_VirtAddr)buf, count);
+       }
+}
+
 static int hvc_tile_put_chars(uint32_t vt, const char *buf, int count)
 {
-       return hv_console_write((HV_VirtAddr)buf, count);
+       return tile_console_write(buf, count);
 }
 
 static int hvc_tile_get_chars(uint32_t vt, char *buf, int count)
@@ -44,25 +74,132 @@ static int hvc_tile_get_chars(uint32_t vt, char *buf, int count)
        return i;
 }
 
+#ifdef __tilegx__
+/*
+ * IRQ based callbacks.
+ */
+static int hvc_tile_notifier_add_irq(struct hvc_struct *hp, int irq)
+{
+       int rc;
+       int cpu = raw_smp_processor_id();  /* Choose an arbitrary cpu */
+       HV_Coord coord = { .x = cpu_x(cpu), .y = cpu_y(cpu) };
+
+       rc = notifier_add_irq(hp, irq);
+       if (rc)
+               return rc;
+
+       /*
+        * Request that the hypervisor start sending us interrupts.
+        * If the hypervisor returns an error, we still return 0, so that
+        * we can fall back to polling.
+        */
+       if (hv_console_set_ipi(KERNEL_PL, irq, coord) < 0)
+               notifier_del_irq(hp, irq);
+
+       return 0;
+}
+
+static void hvc_tile_notifier_del_irq(struct hvc_struct *hp, int irq)
+{
+       HV_Coord coord = { 0, 0 };
+
+       /* Tell the hypervisor to stop sending us interrupts. */
+       hv_console_set_ipi(KERNEL_PL, -1, coord);
+
+       notifier_del_irq(hp, irq);
+}
+
+static void hvc_tile_notifier_hangup_irq(struct hvc_struct *hp, int irq)
+{
+       hvc_tile_notifier_del_irq(hp, irq);
+}
+#endif
+
 static const struct hv_ops hvc_tile_get_put_ops = {
        .get_chars = hvc_tile_get_chars,
        .put_chars = hvc_tile_put_chars,
+#ifdef __tilegx__
+       .notifier_add = hvc_tile_notifier_add_irq,
+       .notifier_del = hvc_tile_notifier_del_irq,
+       .notifier_hangup = hvc_tile_notifier_hangup_irq,
+#endif
+};
+
+
+#ifdef __tilegx__
+static int hvc_tile_probe(struct platform_device *pdev)
+{
+       struct hvc_struct *hp;
+       int tile_hvc_irq;
+
+       /* Create our IRQ and register it. */
+       tile_hvc_irq = create_irq();
+       if (tile_hvc_irq < 0)
+               return -ENXIO;
+
+       tile_irq_activate(tile_hvc_irq, TILE_IRQ_PERCPU);
+       hp = hvc_alloc(0, tile_hvc_irq, &hvc_tile_get_put_ops, 128);
+       if (IS_ERR(hp)) {
+               destroy_irq(tile_hvc_irq);
+               return PTR_ERR(hp);
+       }
+       dev_set_drvdata(&pdev->dev, hp);
+
+       return 0;
+}
+
+static int hvc_tile_remove(struct platform_device *pdev)
+{
+       int rc;
+       struct hvc_struct *hp = dev_get_drvdata(&pdev->dev);
+
+       rc = hvc_remove(hp);
+       if (rc == 0)
+               destroy_irq(hp->data);
+
+       return rc;
+}
+
+static void hvc_tile_shutdown(struct platform_device *pdev)
+{
+       struct hvc_struct *hp = dev_get_drvdata(&pdev->dev);
+
+       hvc_tile_notifier_del_irq(hp, hp->data);
+}
+
+static struct platform_device hvc_tile_pdev = {
+       .name           = "hvc-tile",
+       .id             = 0,
+};
+
+static struct platform_driver hvc_tile_driver = {
+       .probe          = hvc_tile_probe,
+       .remove         = hvc_tile_remove,
+       .shutdown       = hvc_tile_shutdown,
+       .driver         = {
+               .name   = "hvc-tile",
+               .owner  = THIS_MODULE,
+       }
 };
+#endif
 
 static int __init hvc_tile_console_init(void)
 {
-       extern void disable_early_printk(void);
        hvc_instantiate(0, 0, &hvc_tile_get_put_ops);
        add_preferred_console("hvc", 0, NULL);
-       disable_early_printk();
        return 0;
 }
 console_initcall(hvc_tile_console_init);
 
 static int __init hvc_tile_init(void)
 {
-       struct hvc_struct *s;
-       s = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
-       return IS_ERR(s) ? PTR_ERR(s) : 0;
+#ifndef __tilegx__
+       struct hvc_struct *hp;
+       hp = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
+       return IS_ERR(hp) ? PTR_ERR(hp) : 0;
+#else
+       platform_device_register(&hvc_tile_pdev);
+       return platform_driver_register(&hvc_tile_driver);
+#endif
 }
 device_initcall(hvc_tile_init);
index 0c62980..c791b18 100644 (file)
@@ -404,7 +404,7 @@ module_exit(hvc_vio_exit);
 void __init hvc_vio_init_early(void)
 {
        struct device_node *stdout_node;
-       const u32 *termno;
+       const __be32 *termno;
        const char *name;
        const struct hv_ops *ops;
 
@@ -429,7 +429,7 @@ void __init hvc_vio_init_early(void)
        termno = of_get_property(stdout_node, "reg", NULL);
        if (termno == NULL)
                goto out;
-       hvterm_priv0.termno = *termno;
+       hvterm_priv0.termno = of_read_number(termno, 1);
        spin_lock_init(&hvterm_priv0.buf_lock);
        hvterm_privs[0] = &hvterm_priv0;
 
index cc4c868..47c6e7b 100644 (file)
@@ -1439,6 +1439,15 @@ config SERIAL_EFM32_UART_CONSOLE
        depends on SERIAL_EFM32_UART=y
        select SERIAL_CORE_CONSOLE
 
+config SERIAL_TILEGX
+       tristate "TILE-Gx on-chip serial port support"
+       depends on TILEGX
+       select TILE_GXIO_UART
+       select SERIAL_CORE
+       ---help---
+         This device provides access to the on-chip UARTs on the TILE-Gx
+         processor.
+
 config SERIAL_ARC
        tristate "ARC UART driver support"
        select SERIAL_CORE
index 47b679c..3068c77 100644 (file)
@@ -66,6 +66,7 @@ obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
 obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o
 obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
 obj-$(CONFIG_SERIAL_ST_ASC) += st-asc.o
+obj-$(CONFIG_SERIAL_TILEGX) += tilegx.o
 obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
 obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
 obj-$(CONFIG_SERIAL_TIMBERDALE)        += timbuart.o
index 18e038f..59b3da9 100644 (file)
@@ -473,6 +473,7 @@ static int altera_jtaguart_remove(struct platform_device *pdev)
 #ifdef CONFIG_OF
 static struct of_device_id altera_jtaguart_match[] = {
        { .compatible = "ALTR,juart-1.0", },
+       { .compatible = "altr,juart-1.0", },
        {},
 };
 MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
index 6431472..501667e 100644 (file)
@@ -615,6 +615,7 @@ static int altera_uart_remove(struct platform_device *pdev)
 #ifdef CONFIG_OF
 static struct of_device_id altera_uart_match[] = {
        { .compatible = "ALTR,uart-1.0", },
+       { .compatible = "altr,uart-1.0", },
        {},
 };
 MODULE_DEVICE_TABLE(of, altera_uart_match);
index 1002054..a260cde 100644 (file)
@@ -45,7 +45,7 @@ static int kgdboc_reset_connect(struct input_handler *handler,
 {
        input_reset_device(dev);
 
-       /* Retrun an error - we do not want to bind, just to reset */
+       /* Return an error - we do not want to bind, just to reset */
        return -ENODEV;
 }
 
index e1280a2..5be1df3 100644 (file)
@@ -107,6 +107,8 @@ struct psc_ops {
        unsigned int    (*set_baudrate)(struct uart_port *port,
                                        struct ktermios *new,
                                        struct ktermios *old);
+       int             (*clock_alloc)(struct uart_port *port);
+       void            (*clock_relse)(struct uart_port *port);
        int             (*clock)(struct uart_port *port, int enable);
        int             (*fifoc_init)(void);
        void            (*fifoc_uninit)(void);
@@ -616,31 +618,73 @@ static irqreturn_t mpc512x_psc_handle_irq(struct uart_port *port)
        return IRQ_NONE;
 }
 
-static int mpc512x_psc_clock(struct uart_port *port, int enable)
+static struct clk *psc_mclk_clk[MPC52xx_PSC_MAXNUM];
+
+/* called from within the .request_port() callback (allocation) */
+static int mpc512x_psc_alloc_clock(struct uart_port *port)
 {
-       struct clk *psc_clk;
        int psc_num;
-       char clk_name[10];
+       char clk_name[16];
+       struct clk *clk;
+       int err;
+
+       psc_num = (port->mapbase & 0xf00) >> 8;
+       snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num);
+       clk = devm_clk_get(port->dev, clk_name);
+       if (IS_ERR(clk)) {
+               dev_err(port->dev, "Failed to get MCLK!\n");
+               return PTR_ERR(clk);
+       }
+       err = clk_prepare_enable(clk);
+       if (err) {
+               dev_err(port->dev, "Failed to enable MCLK!\n");
+               return err;
+       }
+       psc_mclk_clk[psc_num] = clk;
+       return 0;
+}
+
+/* called from within the .release_port() callback (release) */
+static void mpc512x_psc_relse_clock(struct uart_port *port)
+{
+       int psc_num;
+       struct clk *clk;
+
+       psc_num = (port->mapbase & 0xf00) >> 8;
+       clk = psc_mclk_clk[psc_num];
+       if (clk) {
+               clk_disable_unprepare(clk);
+               psc_mclk_clk[psc_num] = NULL;
+       }
+}
+
+/* implementation of the .clock() callback (enable/disable) */
+static int mpc512x_psc_endis_clock(struct uart_port *port, int enable)
+{
+       int psc_num;
+       struct clk *psc_clk;
+       int ret;
 
        if (uart_console(port))
                return 0;
 
        psc_num = (port->mapbase & 0xf00) >> 8;
-       snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num);
-       psc_clk = clk_get(port->dev, clk_name);
-       if (IS_ERR(psc_clk)) {
+       psc_clk = psc_mclk_clk[psc_num];
+       if (!psc_clk) {
                dev_err(port->dev, "Failed to get PSC clock entry!\n");
                return -ENODEV;
        }
 
-       dev_dbg(port->dev, "%s %sable\n", clk_name, enable ? "en" : "dis");
-
-       if (enable)
-               clk_enable(psc_clk);
-       else
+       dev_dbg(port->dev, "mclk %sable\n", enable ? "en" : "dis");
+       if (enable) {
+               ret = clk_enable(psc_clk);
+               if (ret)
+                       dev_err(port->dev, "Failed to enable MCLK!\n");
+               return ret;
+       } else {
                clk_disable(psc_clk);
-
-       return 0;
+               return 0;
+       }
 }
 
 static void mpc512x_psc_get_irq(struct uart_port *port, struct device_node *np)
@@ -873,7 +917,9 @@ static struct psc_ops mpc5125_psc_ops = {
        .cw_disable_ints = mpc5125_psc_cw_disable_ints,
        .cw_restore_ints = mpc5125_psc_cw_restore_ints,
        .set_baudrate = mpc5125_psc_set_baudrate,
-       .clock = mpc512x_psc_clock,
+       .clock_alloc = mpc512x_psc_alloc_clock,
+       .clock_relse = mpc512x_psc_relse_clock,
+       .clock = mpc512x_psc_endis_clock,
        .fifoc_init = mpc512x_psc_fifoc_init,
        .fifoc_uninit = mpc512x_psc_fifoc_uninit,
        .get_irq = mpc512x_psc_get_irq,
@@ -906,7 +952,9 @@ static struct psc_ops mpc512x_psc_ops = {
        .cw_disable_ints = mpc512x_psc_cw_disable_ints,
        .cw_restore_ints = mpc512x_psc_cw_restore_ints,
        .set_baudrate = mpc512x_psc_set_baudrate,
-       .clock = mpc512x_psc_clock,
+       .clock_alloc = mpc512x_psc_alloc_clock,
+       .clock_relse = mpc512x_psc_relse_clock,
+       .clock = mpc512x_psc_endis_clock,
        .fifoc_init = mpc512x_psc_fifoc_init,
        .fifoc_uninit = mpc512x_psc_fifoc_uninit,
        .get_irq = mpc512x_psc_get_irq,
@@ -1166,6 +1214,9 @@ mpc52xx_uart_type(struct uart_port *port)
 static void
 mpc52xx_uart_release_port(struct uart_port *port)
 {
+       if (psc_ops->clock_relse)
+               psc_ops->clock_relse(port);
+
        /* remapped by us ? */
        if (port->flags & UPF_IOREMAP) {
                iounmap(port->membase);
@@ -1190,11 +1241,24 @@ mpc52xx_uart_request_port(struct uart_port *port)
        err = request_mem_region(port->mapbase, sizeof(struct mpc52xx_psc),
                        "mpc52xx_psc_uart") != NULL ? 0 : -EBUSY;
 
-       if (err && (port->flags & UPF_IOREMAP)) {
+       if (err)
+               goto out_membase;
+
+       if (psc_ops->clock_alloc) {
+               err = psc_ops->clock_alloc(port);
+               if (err)
+                       goto out_mapregion;
+       }
+
+       return 0;
+
+out_mapregion:
+       release_mem_region(port->mapbase, sizeof(struct mpc52xx_psc));
+out_membase:
+       if (port->flags & UPF_IOREMAP) {
                iounmap(port->membase);
                port->membase = NULL;
        }
-
        return err;
 }
 
diff --git a/drivers/tty/serial/tilegx.c b/drivers/tty/serial/tilegx.c
new file mode 100644 (file)
index 0000000..f92d7e6
--- /dev/null
@@ -0,0 +1,708 @@
+/*
+ * Copyright 2013 Tilera 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
+ *   as published by the Free Software Foundation, version 2.
+ *
+ *   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, GOOD TITLE or
+ *   NON INFRINGEMENT.  See the GNU General Public License for
+ *   more details.
+ *
+ * TILEGx UART driver.
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/module.h>
+#include <linux/serial_core.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
+
+#include <gxio/common.h>
+#include <gxio/iorpc_globals.h>
+#include <gxio/iorpc_uart.h>
+#include <gxio/kiorpc.h>
+
+#include <hv/drv_uart_intf.h>
+
+/*
+ * Use device name ttyS, major 4, minor 64-65.
+ * This is the usual serial port name, 8250 conventional range.
+ */
+#define TILEGX_UART_MAJOR      TTY_MAJOR
+#define TILEGX_UART_MINOR      64
+#define TILEGX_UART_NAME       "ttyS"
+#define DRIVER_NAME_STRING     "TILEGx_Serial"
+#define TILEGX_UART_REF_CLK    125000000; /* REF_CLK is always 125 MHz. */
+
+struct tile_uart_port {
+       /* UART port. */
+       struct uart_port        uart;
+
+       /* GXIO device context. */
+       gxio_uart_context_t     context;
+
+       /* UART access mutex. */
+       struct mutex            mutex;
+
+       /* CPU receiving interrupts. */
+       int                     irq_cpu;
+};
+
+static struct tile_uart_port tile_uart_ports[TILEGX_UART_NR];
+static struct uart_driver tilegx_uart_driver;
+
+
+/*
+ * Read UART rx fifo, and insert the chars into tty buffer.
+ */
+static void receive_chars(struct tile_uart_port *tile_uart,
+                         struct tty_struct *tty)
+{
+       int i;
+       char c;
+       UART_FIFO_COUNT_t count;
+       gxio_uart_context_t *context = &tile_uart->context;
+       struct tty_port *port = tty->port;
+
+       count.word = gxio_uart_read(context, UART_FIFO_COUNT);
+       for (i = 0; i < count.rfifo_count; i++) {
+               c = (char)gxio_uart_read(context, UART_RECEIVE_DATA);
+               tty_insert_flip_char(port, c, TTY_NORMAL);
+       }
+}
+
+
+/*
+ * Drain the Rx FIFO, called by interrupt handler.
+ */
+static void handle_receive(struct tile_uart_port *tile_uart)
+{
+       struct tty_port *port = &tile_uart->uart.state->port;
+       struct tty_struct *tty = tty_port_tty_get(port);
+       gxio_uart_context_t *context = &tile_uart->context;
+
+       if (!tty)
+               return;
+
+       /* First read UART rx fifo. */
+       receive_chars(tile_uart, tty);
+
+       /* Reset RFIFO_WE interrupt. */
+       gxio_uart_write(context, UART_INTERRUPT_STATUS,
+                       UART_INTERRUPT_MASK__RFIFO_WE_MASK);
+
+       /* Final read, if any chars comes between the first read and
+        * the interrupt reset.
+        */
+       receive_chars(tile_uart, tty);
+
+       spin_unlock(&tile_uart->uart.lock);
+       tty_flip_buffer_push(port);
+       spin_lock(&tile_uart->uart.lock);
+       tty_kref_put(tty);
+}
+
+
+/*
+ * Push one char to UART Write FIFO.
+ * Return 0 on success, -1 if write filo is full.
+ */
+static int tilegx_putchar(gxio_uart_context_t *context, char c)
+{
+       UART_FLAG_t flag;
+       flag.word = gxio_uart_read(context, UART_FLAG);
+       if (flag.wfifo_full)
+               return -1;
+
+       gxio_uart_write(context, UART_TRANSMIT_DATA, (unsigned long)c);
+       return 0;
+}
+
+
+/*
+ * Send chars to UART Write FIFO; called by interrupt handler.
+ */
+static void handle_transmit(struct tile_uart_port *tile_uart)
+{
+       unsigned char ch;
+       struct uart_port *port;
+       struct circ_buf *xmit;
+       gxio_uart_context_t *context = &tile_uart->context;
+
+       /* First reset WFIFO_RE interrupt. */
+       gxio_uart_write(context, UART_INTERRUPT_STATUS,
+                       UART_INTERRUPT_MASK__WFIFO_RE_MASK);
+
+       port = &tile_uart->uart;
+       xmit = &port->state->xmit;
+       if (port->x_char) {
+               if (tilegx_putchar(context, port->x_char))
+                       return;
+               port->x_char = 0;
+               port->icount.tx++;
+       }
+
+       if (uart_circ_empty(xmit) || uart_tx_stopped(port))
+               return;
+
+       while (!uart_circ_empty(xmit)) {
+               ch = xmit->buf[xmit->tail];
+               if (tilegx_putchar(context, ch))
+                       break;
+               xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
+               port->icount.tx++;
+       }
+
+       /* Reset WFIFO_RE interrupt. */
+       gxio_uart_write(context, UART_INTERRUPT_STATUS,
+                       UART_INTERRUPT_MASK__WFIFO_RE_MASK);
+
+       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+               uart_write_wakeup(port);
+}
+
+
+/*
+ * UART Interrupt handler.
+ */
+static irqreturn_t tilegx_interrupt(int irq, void *dev_id)
+{
+       unsigned long flags;
+       UART_INTERRUPT_STATUS_t intr_stat;
+       struct tile_uart_port *tile_uart;
+       gxio_uart_context_t *context;
+       struct uart_port *port = dev_id;
+       irqreturn_t ret = IRQ_NONE;
+
+       spin_lock_irqsave(&port->lock, flags);
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       context = &tile_uart->context;
+       intr_stat.word = gxio_uart_read(context, UART_INTERRUPT_STATUS);
+
+       if (intr_stat.rfifo_we) {
+               handle_receive(tile_uart);
+               ret = IRQ_HANDLED;
+       }
+       if (intr_stat.wfifo_re) {
+               handle_transmit(tile_uart);
+               ret = IRQ_HANDLED;
+       }
+
+       spin_unlock_irqrestore(&port->lock, flags);
+       return ret;
+}
+
+
+/*
+ * Return TIOCSER_TEMT when transmitter FIFO is empty.
+ */
+static u_int tilegx_tx_empty(struct uart_port *port)
+{
+       int ret;
+       UART_FLAG_t flag;
+       struct tile_uart_port *tile_uart;
+       gxio_uart_context_t *context;
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       if (!mutex_trylock(&tile_uart->mutex))
+               return 0;
+       context = &tile_uart->context;
+
+       flag.word = gxio_uart_read(context, UART_FLAG);
+       ret = (flag.wfifo_empty) ? TIOCSER_TEMT : 0;
+       mutex_unlock(&tile_uart->mutex);
+
+       return ret;
+}
+
+
+/*
+ * Set state of the modem control output lines.
+ */
+static void tilegx_set_mctrl(struct uart_port *port, u_int mctrl)
+{
+       /* N/A */
+}
+
+
+/*
+ * Get state of the modem control input lines.
+ */
+static u_int tilegx_get_mctrl(struct uart_port *port)
+{
+       return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
+}
+
+
+/*
+ * Stop transmitting.
+ */
+static void tilegx_stop_tx(struct uart_port *port)
+{
+       /* N/A */
+}
+
+
+/*
+ * Start transmitting.
+ */
+static void tilegx_start_tx(struct uart_port *port)
+{
+       unsigned char ch;
+       struct circ_buf *xmit;
+       struct tile_uart_port *tile_uart;
+       gxio_uart_context_t *context;
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       if (!mutex_trylock(&tile_uart->mutex))
+               return;
+       context = &tile_uart->context;
+       xmit = &port->state->xmit;
+       if (port->x_char) {
+               if (tilegx_putchar(context, port->x_char))
+                       return;
+               port->x_char = 0;
+               port->icount.tx++;
+       }
+
+       if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
+               mutex_unlock(&tile_uart->mutex);
+               return;
+       }
+
+       while (!uart_circ_empty(xmit)) {
+               ch = xmit->buf[xmit->tail];
+               if (tilegx_putchar(context, ch))
+                       break;
+               xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
+               port->icount.tx++;
+       }
+
+       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+               uart_write_wakeup(port);
+
+       mutex_unlock(&tile_uart->mutex);
+}
+
+
+/*
+ * Stop receiving - port is in process of being closed.
+ */
+static void tilegx_stop_rx(struct uart_port *port)
+{
+       int err;
+       struct tile_uart_port *tile_uart;
+       gxio_uart_context_t *context;
+       int cpu;
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       if (!mutex_trylock(&tile_uart->mutex))
+               return;
+
+       context = &tile_uart->context;
+       cpu = tile_uart->irq_cpu;
+       err = gxio_uart_cfg_interrupt(context, cpu_x(cpu), cpu_y(cpu),
+                                     KERNEL_PL, -1);
+       mutex_unlock(&tile_uart->mutex);
+}
+
+
+/*
+ * Enable modem status interrupts.
+ */
+static void tilegx_enable_ms(struct uart_port *port)
+{
+       /* N/A */
+}
+
+/*
+ * Control the transmission of a break signal.
+ */
+static void tilegx_break_ctl(struct uart_port *port, int break_state)
+{
+       /* N/A */
+}
+
+
+/*
+ * Perform initialization and enable port for reception.
+ */
+static int tilegx_startup(struct uart_port *port)
+{
+       struct tile_uart_port *tile_uart;
+       gxio_uart_context_t *context;
+       int ret = 0;
+       int cpu = raw_smp_processor_id();  /* pick an arbitrary cpu */
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       if (mutex_lock_interruptible(&tile_uart->mutex))
+               return -EBUSY;
+       context = &tile_uart->context;
+
+       /* Now open the hypervisor device if we haven't already. */
+       if (context->fd < 0) {
+               UART_INTERRUPT_MASK_t intr_mask;
+
+               /* Initialize UART device. */
+               ret = gxio_uart_init(context, port->line);
+               if (ret) {
+                       ret = -ENXIO;
+                       goto err;
+               }
+
+               /* Create our IRQs. */
+               port->irq = create_irq();
+               if (port->irq < 0)
+                       goto err_uart_dest;
+               tile_irq_activate(port->irq, TILE_IRQ_PERCPU);
+
+               /* Register our IRQs. */
+               ret = request_irq(port->irq, tilegx_interrupt, 0,
+                                 tilegx_uart_driver.driver_name, port);
+               if (ret)
+                       goto err_dest_irq;
+
+               /* Request that the hardware start sending us interrupts. */
+               tile_uart->irq_cpu = cpu;
+               ret = gxio_uart_cfg_interrupt(context, cpu_x(cpu), cpu_y(cpu),
+                                             KERNEL_PL, port->irq);
+               if (ret)
+                       goto err_free_irq;
+
+               /* Enable UART Tx/Rx Interrupt. */
+               intr_mask.word = gxio_uart_read(context, UART_INTERRUPT_MASK);
+               intr_mask.wfifo_re = 0;
+               intr_mask.rfifo_we = 0;
+               gxio_uart_write(context, UART_INTERRUPT_MASK, intr_mask.word);
+
+               /* Reset the Tx/Rx interrupt in case it's set. */
+               gxio_uart_write(context, UART_INTERRUPT_STATUS,
+                               UART_INTERRUPT_MASK__WFIFO_RE_MASK |
+                               UART_INTERRUPT_MASK__RFIFO_WE_MASK);
+       }
+
+       mutex_unlock(&tile_uart->mutex);
+       return ret;
+
+err_free_irq:
+       free_irq(port->irq, port);
+err_dest_irq:
+       destroy_irq(port->irq);
+err_uart_dest:
+       gxio_uart_destroy(context);
+       ret = -ENXIO;
+err:
+       mutex_unlock(&tile_uart->mutex);
+       return ret;
+}
+
+
+/*
+ * Release kernel resources if it is the last close, disable the port,
+ * free IRQ and close the port.
+ */
+static void tilegx_shutdown(struct uart_port *port)
+{
+       int err;
+       UART_INTERRUPT_MASK_t intr_mask;
+       struct tile_uart_port *tile_uart;
+       gxio_uart_context_t *context;
+       int cpu;
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       if (mutex_lock_interruptible(&tile_uart->mutex))
+               return;
+       context = &tile_uart->context;
+
+       /* Disable UART Tx/Rx Interrupt. */
+       intr_mask.word = gxio_uart_read(context, UART_INTERRUPT_MASK);
+       intr_mask.wfifo_re = 1;
+       intr_mask.rfifo_we = 1;
+       gxio_uart_write(context, UART_INTERRUPT_MASK, intr_mask.word);
+
+       /* Request that the hardware stop sending us interrupts. */
+       cpu = tile_uart->irq_cpu;
+       err = gxio_uart_cfg_interrupt(context, cpu_x(cpu), cpu_y(cpu),
+                                     KERNEL_PL, -1);
+
+       if (port->irq > 0) {
+               free_irq(port->irq, port);
+               destroy_irq(port->irq);
+               port->irq = 0;
+       }
+
+       gxio_uart_destroy(context);
+
+       mutex_unlock(&tile_uart->mutex);
+}
+
+
+/*
+ * Flush the buffer.
+ */
+static void tilegx_flush_buffer(struct uart_port *port)
+{
+       /* N/A */
+}
+
+
+/*
+ * Change the port parameters.
+ */
+static void tilegx_set_termios(struct uart_port *port,
+                              struct ktermios *termios, struct ktermios *old)
+{
+       int err;
+       UART_DIVISOR_t divisor;
+       UART_TYPE_t type;
+       unsigned int baud;
+       struct tile_uart_port *tile_uart;
+       gxio_uart_context_t *context;
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       if (!mutex_trylock(&tile_uart->mutex))
+               return;
+       context = &tile_uart->context;
+
+       /* Open the hypervisor device if we haven't already. */
+       if (context->fd < 0) {
+               err = gxio_uart_init(context, port->line);
+               if (err) {
+                       mutex_unlock(&tile_uart->mutex);
+                       return;
+               }
+       }
+
+       divisor.word = gxio_uart_read(context, UART_DIVISOR);
+       type.word = gxio_uart_read(context, UART_TYPE);
+
+       /* Divisor. */
+       baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
+       divisor.divisor = uart_get_divisor(port, baud);
+
+       /* Byte size. */
+       if ((termios->c_cflag & CSIZE) == CS7)
+               type.dbits = UART_TYPE__DBITS_VAL_SEVEN_DBITS;
+       else
+               type.dbits = UART_TYPE__DBITS_VAL_EIGHT_DBITS;
+
+       /* Parity. */
+       if (termios->c_cflag & PARENB) {
+               /* Mark or Space parity. */
+               if (termios->c_cflag & CMSPAR)
+                       if (termios->c_cflag & PARODD)
+                               type.ptype = UART_TYPE__PTYPE_VAL_MARK;
+                       else
+                               type.ptype = UART_TYPE__PTYPE_VAL_SPACE;
+               else if (termios->c_cflag & PARODD)
+                       type.ptype = UART_TYPE__PTYPE_VAL_ODD;
+               else
+                       type.ptype = UART_TYPE__PTYPE_VAL_EVEN;
+       } else
+               type.ptype = UART_TYPE__PTYPE_VAL_NONE;
+
+       /* Stop bits. */
+       if (termios->c_cflag & CSTOPB)
+               type.sbits = UART_TYPE__SBITS_VAL_TWO_SBITS;
+       else
+               type.sbits = UART_TYPE__SBITS_VAL_ONE_SBITS;
+
+       /* Set the uart paramters. */
+       gxio_uart_write(context, UART_DIVISOR, divisor.word);
+       gxio_uart_write(context, UART_TYPE, type.word);
+
+       mutex_unlock(&tile_uart->mutex);
+}
+
+
+/*
+ * Return string describing the specified port.
+ */
+static const char *tilegx_type(struct uart_port *port)
+{
+       return port->type == PORT_TILEGX ? DRIVER_NAME_STRING : NULL;
+}
+
+
+/*
+ * Release the resources being used by 'port'.
+ */
+static void tilegx_release_port(struct uart_port *port)
+{
+       /* Nothing to release. */
+}
+
+
+/*
+ * Request the resources being used by 'port'.
+ */
+static int tilegx_request_port(struct uart_port *port)
+{
+       /* Always present. */
+       return 0;
+}
+
+
+/*
+ * Configure/autoconfigure the port.
+ */
+static void tilegx_config_port(struct uart_port *port, int flags)
+{
+       if (flags & UART_CONFIG_TYPE)
+               port->type = PORT_TILEGX;
+}
+
+
+/*
+ * Verify the new serial_struct (for TIOCSSERIAL).
+ */
+static int tilegx_verify_port(struct uart_port *port,
+                             struct serial_struct *ser)
+{
+       if ((ser->type != PORT_UNKNOWN) && (ser->type != PORT_TILEGX))
+               return -EINVAL;
+
+       return 0;
+}
+
+#ifdef CONFIG_CONSOLE_POLL
+
+/*
+ * Console polling routines for writing and reading from the uart while
+ * in an interrupt or debug context.
+ */
+
+static int tilegx_poll_get_char(struct uart_port *port)
+{
+       UART_FIFO_COUNT_t count;
+       gxio_uart_context_t *context;
+       struct tile_uart_port *tile_uart;
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       context = &tile_uart->context;
+       count.word = gxio_uart_read(context, UART_FIFO_COUNT);
+       if (count.rfifo_count == 0)
+               return NO_POLL_CHAR;
+       return (char)gxio_uart_read(context, UART_RECEIVE_DATA);
+}
+
+static void tilegx_poll_put_char(struct uart_port *port, unsigned char c)
+{
+       gxio_uart_context_t *context;
+       struct tile_uart_port *tile_uart;
+
+       tile_uart = container_of(port, struct tile_uart_port, uart);
+       context = &tile_uart->context;
+       gxio_uart_write(context, UART_TRANSMIT_DATA, (unsigned long)c);
+}
+
+#endif /* CONFIG_CONSOLE_POLL */
+
+
+static const struct uart_ops tilegx_ops = {
+       .tx_empty       = tilegx_tx_empty,
+       .set_mctrl      = tilegx_set_mctrl,
+       .get_mctrl      = tilegx_get_mctrl,
+       .stop_tx        = tilegx_stop_tx,
+       .start_tx       = tilegx_start_tx,
+       .stop_rx        = tilegx_stop_rx,
+       .enable_ms      = tilegx_enable_ms,
+       .break_ctl      = tilegx_break_ctl,
+       .startup        = tilegx_startup,
+       .shutdown       = tilegx_shutdown,
+       .flush_buffer   = tilegx_flush_buffer,
+       .set_termios    = tilegx_set_termios,
+       .type           = tilegx_type,
+       .release_port   = tilegx_release_port,
+       .request_port   = tilegx_request_port,
+       .config_port    = tilegx_config_port,
+       .verify_port    = tilegx_verify_port,
+#ifdef CONFIG_CONSOLE_POLL
+       .poll_get_char  = tilegx_poll_get_char,
+       .poll_put_char  = tilegx_poll_put_char,
+#endif
+};
+
+
+static void tilegx_init_ports(void)
+{
+       int i;
+       struct uart_port *port;
+
+       for (i = 0; i < TILEGX_UART_NR; i++) {
+               port = &tile_uart_ports[i].uart;
+               port->ops = &tilegx_ops;
+               port->line = i;
+               port->type = PORT_TILEGX;
+               port->uartclk = TILEGX_UART_REF_CLK;
+               port->flags = UPF_BOOT_AUTOCONF;
+
+               tile_uart_ports[i].context.fd = -1;
+               mutex_init(&tile_uart_ports[i].mutex);
+       }
+}
+
+
+static struct uart_driver tilegx_uart_driver = {
+       .owner          = THIS_MODULE,
+       .driver_name    = DRIVER_NAME_STRING,
+       .dev_name       = TILEGX_UART_NAME,
+       .major          = TILEGX_UART_MAJOR,
+       .minor          = TILEGX_UART_MINOR,
+       .nr             = TILEGX_UART_NR,
+};
+
+
+static int __init tilegx_init(void)
+{
+       int i;
+       int ret;
+       struct tty_driver *tty_drv;
+
+       ret = uart_register_driver(&tilegx_uart_driver);
+       if (ret)
+               return ret;
+       tty_drv = tilegx_uart_driver.tty_driver;
+       tty_drv->init_termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
+       tty_drv->init_termios.c_ispeed = 115200;
+       tty_drv->init_termios.c_ospeed = 115200;
+
+       tilegx_init_ports();
+
+       for (i = 0; i < TILEGX_UART_NR; i++) {
+               struct uart_port *port = &tile_uart_ports[i].uart;
+               ret = uart_add_one_port(&tilegx_uart_driver, port);
+       }
+
+       return 0;
+}
+
+
+static void __exit tilegx_exit(void)
+{
+       int i;
+       struct uart_port *port;
+
+       for (i = 0; i < TILEGX_UART_NR; i++) {
+               port = &tile_uart_ports[i].uart;
+               uart_remove_one_port(&tilegx_uart_driver, port);
+       }
+
+       uart_unregister_driver(&tilegx_uart_driver);
+}
+
+
+module_init(tilegx_init);
+module_exit(tilegx_exit);
+
+MODULE_AUTHOR("Tilera Corporation");
+MODULE_DESCRIPTION("TILEGx serial port driver");
+MODULE_LICENSE("GPL");
index d5cc3ac..40a9fe9 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/moduleparam.h>
 #include <linux/jiffies.h>
 #include <linux/syscalls.h>
+#include <linux/of.h>
 
 #include <asm/ptrace.h>
 #include <asm/irq_regs.h>
@@ -681,6 +682,40 @@ static void sysrq_detect_reset_sequence(struct sysrq_state *state,
        }
 }
 
+#ifdef CONFIG_OF
+static void sysrq_of_get_keyreset_config(void)
+{
+       u32 key;
+       struct device_node *np;
+       struct property *prop;
+       const __be32 *p;
+
+       np = of_find_node_by_path("/chosen/linux,sysrq-reset-seq");
+       if (!np) {
+               pr_debug("No sysrq node found");
+               return;
+       }
+
+       /* Reset in case a __weak definition was present */
+       sysrq_reset_seq_len = 0;
+
+       of_property_for_each_u32(np, "keyset", prop, p, key) {
+               if (key == KEY_RESERVED || key > KEY_MAX ||
+                   sysrq_reset_seq_len == SYSRQ_KEY_RESET_MAX)
+                       break;
+
+               sysrq_reset_seq[sysrq_reset_seq_len++] = (unsigned short)key;
+       }
+
+       /* Get reset timeout if any. */
+       of_property_read_u32(np, "timeout-ms", &sysrq_reset_downtime_ms);
+}
+#else
+static void sysrq_of_get_keyreset_config(void)
+{
+}
+#endif
+
 static void sysrq_reinject_alt_sysrq(struct work_struct *work)
 {
        struct sysrq_state *sysrq =
@@ -914,6 +949,7 @@ static inline void sysrq_register_handler(void)
        int error;
        int i;
 
+       /* First check if a __weak interface was instantiated. */
        for (i = 0; i < ARRAY_SIZE(sysrq_reset_seq); i++) {
                key = platform_sysrq_reset_seq[i];
                if (key == KEY_RESERVED || key > KEY_MAX)
@@ -922,6 +958,12 @@ static inline void sysrq_register_handler(void)
                sysrq_reset_seq[sysrq_reset_seq_len++] = key;
        }
 
+       /*
+        * DT configuration takes precedence over anything that would
+        * have been defined via the __weak interface.
+        */
+       sysrq_of_get_keyreset_config();
+
        error = input_register_handler(&sysrq_handler);
        if (error)
                pr_err("Failed to register input handler, error %d", error);
index cfbff71..9e0020d 100644 (file)
@@ -260,6 +260,7 @@ int fsl_usb2_mpc5121_init(struct platform_device *pdev)
 {
        struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct clk *clk;
+       int err;
        char clk_name[10];
        int base, clk_num;
 
@@ -272,13 +273,16 @@ int fsl_usb2_mpc5121_init(struct platform_device *pdev)
                return -ENODEV;
 
        snprintf(clk_name, sizeof(clk_name), "usb%d_clk", clk_num);
-       clk = clk_get(&pdev->dev, clk_name);
+       clk = devm_clk_get(pdev->dev.parent, clk_name);
        if (IS_ERR(clk)) {
                dev_err(&pdev->dev, "failed to get clk\n");
                return PTR_ERR(clk);
        }
-
-       clk_enable(clk);
+       err = clk_prepare_enable(clk);
+       if (err) {
+               dev_err(&pdev->dev, "failed to enable clk\n");
+               return err;
+       }
        pdata->clk = clk;
 
        if (pdata->phy_mode == FSL_USB2_PHY_UTMI_WIDE) {
@@ -302,10 +306,8 @@ static void fsl_usb2_mpc5121_exit(struct platform_device *pdev)
 
        pdata->regs = NULL;
 
-       if (pdata->clk) {
-               clk_disable(pdata->clk);
-               clk_put(pdata->clk);
-       }
+       if (pdata->clk)
+               clk_disable_unprepare(pdata->clk);
 }
 
 static struct fsl_usb2_platform_data fsl_usb2_mpc5121_pd = {
index d5ab658..d4a7a35 100644 (file)
@@ -425,6 +425,25 @@ config BACKLIGHT_AS3711
          If you have an Austrian Microsystems AS3711 say Y to enable the
          backlight driver.
 
+config BACKLIGHT_GPIO
+       tristate "Generic GPIO based Backlight Driver"
+       depends on GPIOLIB
+       help
+         If you have a LCD backlight adjustable by GPIO, say Y to enable
+         this driver.
+
+config BACKLIGHT_LV5207LP
+       tristate "Sanyo LV5207LP Backlight"
+       depends on I2C
+       help
+         If you have a Sanyo LV5207LP say Y to enable the backlight driver.
+
+config BACKLIGHT_BD6107
+       tristate "Rohm BD6107 Backlight"
+       depends on I2C
+       help
+         If you have a Rohm BD6107 say Y to enable the backlight driver.
+
 endif # BACKLIGHT_CLASS_DEVICE
 
 endif # BACKLIGHT_LCD_SUPPORT
index 92711fe..38e1bab 100644 (file)
@@ -26,12 +26,14 @@ obj-$(CONFIG_BACKLIGHT_ADP8870)             += adp8870_bl.o
 obj-$(CONFIG_BACKLIGHT_APPLE)          += apple_bl.o
 obj-$(CONFIG_BACKLIGHT_AS3711)         += as3711_bl.o
 obj-$(CONFIG_BACKLIGHT_ATMEL_PWM)      += atmel-pwm-bl.o
+obj-$(CONFIG_BACKLIGHT_BD6107)         += bd6107.o
 obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH)  += cr_bllcd.o
 obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE)   += backlight.o
 obj-$(CONFIG_BACKLIGHT_DA903X)         += da903x_bl.o
 obj-$(CONFIG_BACKLIGHT_DA9052)         += da9052_bl.o
 obj-$(CONFIG_BACKLIGHT_EP93XX)         += ep93xx_bl.o
 obj-$(CONFIG_BACKLIGHT_GENERIC)                += generic_bl.o
+obj-$(CONFIG_BACKLIGHT_GPIO)           += gpio_backlight.o
 obj-$(CONFIG_BACKLIGHT_HP680)          += hp680_bl.o
 obj-$(CONFIG_BACKLIGHT_HP700)          += jornada720_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3533)         += lm3533_bl.o
@@ -40,6 +42,7 @@ obj-$(CONFIG_BACKLIGHT_LM3639)                += lm3639_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO)         += locomolcd.o
 obj-$(CONFIG_BACKLIGHT_LP855X)         += lp855x_bl.o
 obj-$(CONFIG_BACKLIGHT_LP8788)         += lp8788_bl.o
+obj-$(CONFIG_BACKLIGHT_LV5207LP)       += lv5207lp.o
 obj-$(CONFIG_BACKLIGHT_MAX8925)                += max8925_bl.o
 obj-$(CONFIG_BACKLIGHT_OMAP1)          += omap1_bl.o
 obj-$(CONFIG_BACKLIGHT_OT200)          += ot200_bl.o
diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c
new file mode 100644 (file)
index 0000000..15e3294
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ * ROHM Semiconductor BD6107 LED Driver
+ *
+ * Copyright (C) 2013 Ideas on board SPRL
+ *
+ * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.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/backlight.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/gpio.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/platform_data/bd6107.h>
+#include <linux/slab.h>
+
+#define BD6107_PSCNT1                          0x00
+#define BD6107_PSCNT1_PSCNTREG2                        (1 << 2)
+#define BD6107_PSCNT1_PSCNTREG1                        (1 << 0)
+#define BD6107_REGVSET                         0x02
+#define BD6107_REGVSET_REG1VSET_2_85V          (1 << 2)
+#define BD6107_REGVSET_REG1VSET_2_80V          (0 << 2)
+#define BD6107_LEDCNT1                         0x03
+#define BD6107_LEDCNT1_LEDONOFF2               (1 << 1)
+#define BD6107_LEDCNT1_LEDONOFF1               (1 << 0)
+#define BD6107_PORTSEL                         0x04
+#define BD6107_PORTSEL_LEDM(n)                 (1 << (n))
+#define BD6107_RGB1CNT1                                0x05
+#define BD6107_RGB1CNT2                                0x06
+#define BD6107_RGB1CNT3                                0x07
+#define BD6107_RGB1CNT4                                0x08
+#define BD6107_RGB1CNT5                                0x09
+#define BD6107_RGB1FLM                         0x0a
+#define BD6107_RGB2CNT1                                0x0b
+#define BD6107_RGB2CNT2                                0x0c
+#define BD6107_RGB2CNT3                                0x0d
+#define BD6107_RGB2CNT4                                0x0e
+#define BD6107_RGB2CNT5                                0x0f
+#define BD6107_RGB2FLM                         0x10
+#define BD6107_PSCONT3                         0x11
+#define BD6107_SMMONCNT                                0x12
+#define BD6107_DCDCCNT                         0x13
+#define BD6107_IOSEL                           0x14
+#define BD6107_OUT1                            0x15
+#define BD6107_OUT2                            0x16
+#define BD6107_MASK1                           0x17
+#define BD6107_MASK2                           0x18
+#define BD6107_FACTOR1                         0x19
+#define BD6107_FACTOR2                         0x1a
+#define BD6107_CLRFACT1                                0x1b
+#define BD6107_CLRFACT2                                0x1c
+#define BD6107_STATE1                          0x1d
+#define BD6107_LSIVER                          0x1e
+#define BD6107_GRPSEL                          0x1f
+#define BD6107_LEDCNT2                         0x20
+#define BD6107_LEDCNT3                         0x21
+#define BD6107_MCURRENT                                0x22
+#define BD6107_MAINCNT1                                0x23
+#define BD6107_MAINCNT2                                0x24
+#define BD6107_SLOPECNT                                0x25
+#define BD6107_MSLOPE                          0x26
+#define BD6107_RGBSLOPE                                0x27
+#define BD6107_TEST                            0x29
+#define BD6107_SFTRST                          0x2a
+#define BD6107_SFTRSTGD                                0x2b
+
+struct bd6107 {
+       struct i2c_client *client;
+       struct backlight_device *backlight;
+       struct bd6107_platform_data *pdata;
+};
+
+static int bd6107_write(struct bd6107 *bd, u8 reg, u8 data)
+{
+       return i2c_smbus_write_byte_data(bd->client, reg, data);
+}
+
+static int bd6107_backlight_update_status(struct backlight_device *backlight)
+{
+       struct bd6107 *bd = bl_get_data(backlight);
+       int brightness = backlight->props.brightness;
+
+       if (backlight->props.power != FB_BLANK_UNBLANK ||
+           backlight->props.fb_blank != FB_BLANK_UNBLANK ||
+           backlight->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
+               brightness = 0;
+
+       if (brightness) {
+               bd6107_write(bd, BD6107_PORTSEL, BD6107_PORTSEL_LEDM(2) |
+                            BD6107_PORTSEL_LEDM(1) | BD6107_PORTSEL_LEDM(0));
+               bd6107_write(bd, BD6107_MAINCNT1, brightness);
+               bd6107_write(bd, BD6107_LEDCNT1, BD6107_LEDCNT1_LEDONOFF1);
+       } else {
+               gpio_set_value(bd->pdata->reset, 0);
+               msleep(24);
+               gpio_set_value(bd->pdata->reset, 1);
+       }
+
+       return 0;
+}
+
+static int bd6107_backlight_get_brightness(struct backlight_device *backlight)
+{
+       return backlight->props.brightness;
+}
+
+static int bd6107_backlight_check_fb(struct backlight_device *backlight,
+                                      struct fb_info *info)
+{
+       struct bd6107 *bd = bl_get_data(backlight);
+
+       return bd->pdata->fbdev == NULL || bd->pdata->fbdev == info->dev;
+}
+
+static const struct backlight_ops bd6107_backlight_ops = {
+       .options        = BL_CORE_SUSPENDRESUME,
+       .update_status  = bd6107_backlight_update_status,
+       .get_brightness = bd6107_backlight_get_brightness,
+       .check_fb       = bd6107_backlight_check_fb,
+};
+
+static int bd6107_probe(struct i2c_client *client,
+                         const struct i2c_device_id *id)
+{
+       struct bd6107_platform_data *pdata = client->dev.platform_data;
+       struct backlight_device *backlight;
+       struct backlight_properties props;
+       struct bd6107 *bd;
+       int ret;
+
+       if (pdata == NULL || !pdata->reset) {
+               dev_err(&client->dev, "No reset GPIO in platform data\n");
+               return -EINVAL;
+       }
+
+       if (!i2c_check_functionality(client->adapter,
+                                    I2C_FUNC_SMBUS_BYTE_DATA)) {
+               dev_warn(&client->dev,
+                        "I2C adapter doesn't support I2C_FUNC_SMBUS_BYTE\n");
+               return -EIO;
+       }
+
+       bd = devm_kzalloc(&client->dev, sizeof(*bd), GFP_KERNEL);
+       if (!bd)
+               return -ENOMEM;
+
+       bd->client = client;
+       bd->pdata = pdata;
+
+       ret = devm_gpio_request_one(&client->dev, pdata->reset,
+                                   GPIOF_DIR_OUT | GPIOF_INIT_LOW, "reset");
+       if (ret < 0) {
+               dev_err(&client->dev, "unable to request reset GPIO\n");
+               return ret;
+       }
+
+       memset(&props, 0, sizeof(props));
+       props.type = BACKLIGHT_RAW;
+       props.max_brightness = 128;
+       props.brightness = clamp_t(unsigned int, pdata->def_value, 0,
+                                  props.max_brightness);
+
+       backlight = backlight_device_register(dev_name(&client->dev),
+                                             &bd->client->dev, bd,
+                                             &bd6107_backlight_ops, &props);
+       if (IS_ERR(backlight)) {
+               dev_err(&client->dev, "failed to register backlight\n");
+               return PTR_ERR(backlight);
+       }
+
+       backlight_update_status(backlight);
+       i2c_set_clientdata(client, backlight);
+
+       return 0;
+}
+
+static int bd6107_remove(struct i2c_client *client)
+{
+       struct backlight_device *backlight = i2c_get_clientdata(client);
+
+       backlight->props.brightness = 0;
+       backlight_update_status(backlight);
+       backlight_device_unregister(backlight);
+
+       return 0;
+}
+
+static const struct i2c_device_id bd6107_ids[] = {
+       { "bd6107", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, bd6107_ids);
+
+static struct i2c_driver bd6107_driver = {
+       .driver = {
+               .name = "bd6107",
+       },
+       .probe = bd6107_probe,
+       .remove = bd6107_remove,
+       .id_table = bd6107_ids,
+};
+
+module_i2c_driver(bd6107_driver);
+
+MODULE_DESCRIPTION("Rohm BD6107 Backlight Driver");
+MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
new file mode 100644 (file)
index 0000000..5fa217f
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * gpio_backlight.c - Simple GPIO-controlled backlight
+ *
+ * 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/backlight.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/gpio.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_data/gpio_backlight.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+struct gpio_backlight {
+       struct device *dev;
+       struct device *fbdev;
+
+       int gpio;
+       int active;
+};
+
+static int gpio_backlight_update_status(struct backlight_device *bl)
+{
+       struct gpio_backlight *gbl = bl_get_data(bl);
+       int brightness = bl->props.brightness;
+
+       if (bl->props.power != FB_BLANK_UNBLANK ||
+           bl->props.fb_blank != FB_BLANK_UNBLANK ||
+           bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
+               brightness = 0;
+
+       gpio_set_value(gbl->gpio, brightness ? gbl->active : !gbl->active);
+
+       return 0;
+}
+
+static int gpio_backlight_get_brightness(struct backlight_device *bl)
+{
+       return bl->props.brightness;
+}
+
+static int gpio_backlight_check_fb(struct backlight_device *bl,
+                                  struct fb_info *info)
+{
+       struct gpio_backlight *gbl = bl_get_data(bl);
+
+       return gbl->fbdev == NULL || gbl->fbdev == info->dev;
+}
+
+static const struct backlight_ops gpio_backlight_ops = {
+       .options        = BL_CORE_SUSPENDRESUME,
+       .update_status  = gpio_backlight_update_status,
+       .get_brightness = gpio_backlight_get_brightness,
+       .check_fb       = gpio_backlight_check_fb,
+};
+
+static int gpio_backlight_probe(struct platform_device *pdev)
+{
+       struct gpio_backlight_platform_data *pdata = pdev->dev.platform_data;
+       struct backlight_properties props;
+       struct backlight_device *bl;
+       struct gpio_backlight *gbl;
+       int ret;
+
+       if (!pdata) {
+               dev_err(&pdev->dev, "failed to find platform data\n");
+               return -ENODEV;
+       }
+
+       gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
+       if (gbl == NULL)
+               return -ENOMEM;
+
+       gbl->dev = &pdev->dev;
+       gbl->fbdev = pdata->fbdev;
+       gbl->gpio = pdata->gpio;
+       gbl->active = pdata->active_low ? 0 : 1;
+
+       ret = devm_gpio_request_one(gbl->dev, gbl->gpio, GPIOF_DIR_OUT |
+                                   (gbl->active ? GPIOF_INIT_LOW
+                                                : GPIOF_INIT_HIGH),
+                                   pdata->name);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "unable to request GPIO\n");
+               return ret;
+       }
+
+       memset(&props, 0, sizeof(props));
+       props.type = BACKLIGHT_RAW;
+       props.max_brightness = 1;
+       bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, gbl,
+                                      &gpio_backlight_ops, &props);
+       if (IS_ERR(bl)) {
+               dev_err(&pdev->dev, "failed to register backlight\n");
+               return PTR_ERR(bl);
+       }
+
+       bl->props.brightness = pdata->def_value;
+       backlight_update_status(bl);
+
+       platform_set_drvdata(pdev, bl);
+       return 0;
+}
+
+static int gpio_backlight_remove(struct platform_device *pdev)
+{
+       struct backlight_device *bl = platform_get_drvdata(pdev);
+
+       backlight_device_unregister(bl);
+       return 0;
+}
+
+static struct platform_driver gpio_backlight_driver = {
+       .driver         = {
+               .name           = "gpio-backlight",
+               .owner          = THIS_MODULE,
+       },
+       .probe          = gpio_backlight_probe,
+       .remove         = gpio_backlight_remove,
+};
+
+module_platform_driver(gpio_backlight_driver);
+
+MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
+MODULE_DESCRIPTION("GPIO-based Backlight Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:gpio-backlight");
diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c
new file mode 100644 (file)
index 0000000..498fd73
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Sanyo LV5207LP LED Driver
+ *
+ * Copyright (C) 2013 Ideas on board SPRL
+ *
+ * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.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/backlight.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/platform_data/lv5207lp.h>
+#include <linux/slab.h>
+
+#define LV5207LP_CTRL1                 0x00
+#define LV5207LP_CPSW                  (1 << 7)
+#define LV5207LP_SCTEN                 (1 << 6)
+#define LV5207LP_C10                   (1 << 5)
+#define LV5207LP_CKSW                  (1 << 4)
+#define LV5207LP_RSW                   (1 << 3)
+#define LV5207LP_GSW                   (1 << 2)
+#define LV5207LP_BSW                   (1 << 1)
+#define LV5207LP_CTRL2                 0x01
+#define LV5207LP_MSW                   (1 << 7)
+#define LV5207LP_MLED4                 (1 << 6)
+#define LV5207LP_RED                   0x02
+#define LV5207LP_GREEN                 0x03
+#define LV5207LP_BLUE                  0x04
+
+#define LV5207LP_MAX_BRIGHTNESS                32
+
+struct lv5207lp {
+       struct i2c_client *client;
+       struct backlight_device *backlight;
+       struct lv5207lp_platform_data *pdata;
+};
+
+static int lv5207lp_write(struct lv5207lp *lv, u8 reg, u8 data)
+{
+       return i2c_smbus_write_byte_data(lv->client, reg, data);
+}
+
+static int lv5207lp_backlight_update_status(struct backlight_device *backlight)
+{
+       struct lv5207lp *lv = bl_get_data(backlight);
+       int brightness = backlight->props.brightness;
+
+       if (backlight->props.power != FB_BLANK_UNBLANK ||
+           backlight->props.fb_blank != FB_BLANK_UNBLANK ||
+           backlight->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
+               brightness = 0;
+
+       if (brightness) {
+               lv5207lp_write(lv, LV5207LP_CTRL1,
+                              LV5207LP_CPSW | LV5207LP_C10 | LV5207LP_CKSW);
+               lv5207lp_write(lv, LV5207LP_CTRL2,
+                              LV5207LP_MSW | LV5207LP_MLED4 |
+                              (brightness - 1));
+       } else {
+               lv5207lp_write(lv, LV5207LP_CTRL1, 0);
+               lv5207lp_write(lv, LV5207LP_CTRL2, 0);
+       }
+
+       return 0;
+}
+
+static int lv5207lp_backlight_get_brightness(struct backlight_device *backlight)
+{
+       return backlight->props.brightness;
+}
+
+static int lv5207lp_backlight_check_fb(struct backlight_device *backlight,
+                                      struct fb_info *info)
+{
+       struct lv5207lp *lv = bl_get_data(backlight);
+
+       return lv->pdata->fbdev == NULL || lv->pdata->fbdev == info->dev;
+}
+
+static const struct backlight_ops lv5207lp_backlight_ops = {
+       .options        = BL_CORE_SUSPENDRESUME,
+       .update_status  = lv5207lp_backlight_update_status,
+       .get_brightness = lv5207lp_backlight_get_brightness,
+       .check_fb       = lv5207lp_backlight_check_fb,
+};
+
+static int lv5207lp_probe(struct i2c_client *client,
+                         const struct i2c_device_id *id)
+{
+       struct lv5207lp_platform_data *pdata = client->dev.platform_data;
+       struct backlight_device *backlight;
+       struct backlight_properties props;
+       struct lv5207lp *lv;
+
+       if (pdata == NULL) {
+               dev_err(&client->dev, "No platform data supplied\n");
+               return -EINVAL;
+       }
+
+       if (!i2c_check_functionality(client->adapter,
+                                    I2C_FUNC_SMBUS_BYTE_DATA)) {
+               dev_warn(&client->dev,
+                        "I2C adapter doesn't support I2C_FUNC_SMBUS_BYTE\n");
+               return -EIO;
+       }
+
+       lv = devm_kzalloc(&client->dev, sizeof(*lv), GFP_KERNEL);
+       if (!lv)
+               return -ENOMEM;
+
+       lv->client = client;
+       lv->pdata = pdata;
+
+       memset(&props, 0, sizeof(props));
+       props.type = BACKLIGHT_RAW;
+       props.max_brightness = min_t(unsigned int, pdata->max_value,
+                                    LV5207LP_MAX_BRIGHTNESS);
+       props.brightness = clamp_t(unsigned int, pdata->def_value, 0,
+                                  props.max_brightness);
+
+       backlight = backlight_device_register(dev_name(&client->dev),
+                                             &lv->client->dev, lv,
+                                             &lv5207lp_backlight_ops, &props);
+       if (IS_ERR(backlight)) {
+               dev_err(&client->dev, "failed to register backlight\n");
+               return PTR_ERR(backlight);
+       }
+
+       backlight_update_status(backlight);
+       i2c_set_clientdata(client, backlight);
+
+       return 0;
+}
+
+static int lv5207lp_remove(struct i2c_client *client)
+{
+       struct backlight_device *backlight = i2c_get_clientdata(client);
+
+       backlight->props.brightness = 0;
+       backlight_update_status(backlight);
+       backlight_device_unregister(backlight);
+
+       return 0;
+}
+
+static const struct i2c_device_id lv5207lp_ids[] = {
+       { "lv5207lp", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, lv5207lp_ids);
+
+static struct i2c_driver lv5207lp_driver = {
+       .driver = {
+               .name = "lv5207lp",
+       },
+       .probe = lv5207lp_probe,
+       .remove = lv5207lp_remove,
+       .id_table = lv5207lp_ids,
+};
+
+module_i2c_driver(lv5207lp_driver);
+
+MODULE_DESCRIPTION("Sanyo LV5207LP Backlight Driver");
+MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
+MODULE_LICENSE("GPL");
index ec08a9e..1374803 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/io.h>
 #include <linux/uaccess.h>
 #include <linux/platform_data/video-msm_fb.h>
-#include <mach/board.h>
 #include <linux/workqueue.h>
 #include <linux/clk.h>
 #include <linux/debugfs.h>
index d3f3b43..2e14fd8 100644 (file)
@@ -219,7 +219,7 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)
        len = PAGE_ALIGN(len);
 
        if (p->buf == p->inline_buf) {
-               tmp_buf = kmalloc(len, GFP_NOFS);
+               tmp_buf = kmalloc(len, GFP_NOFS | __GFP_NOWARN);
                if (!tmp_buf) {
                        tmp_buf = vmalloc(len);
                        if (!tmp_buf)
index c47f147..c50c761 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/seq_file.h>
 #include <linux/log2.h>
 #include <linux/cleancache.h>
+#include <linux/namei.h>
 
 #include <asm/uaccess.h>
 
@@ -819,6 +820,7 @@ enum {
        Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl,
        Opt_reservation, Opt_noreservation, Opt_noload, Opt_nobh, Opt_bh,
        Opt_commit, Opt_journal_update, Opt_journal_inum, Opt_journal_dev,
+       Opt_journal_path,
        Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback,
        Opt_data_err_abort, Opt_data_err_ignore,
        Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
@@ -860,6 +862,7 @@ static const match_table_t tokens = {
        {Opt_journal_update, "journal=update"},
        {Opt_journal_inum, "journal=%u"},
        {Opt_journal_dev, "journal_dev=%u"},
+       {Opt_journal_path, "journal_path=%s"},
        {Opt_abort, "abort"},
        {Opt_data_journal, "data=journal"},
        {Opt_data_ordered, "data=ordered"},
@@ -975,6 +978,11 @@ static int parse_options (char *options, struct super_block *sb,
        int option;
        kuid_t uid;
        kgid_t gid;
+       char *journal_path;
+       struct inode *journal_inode;
+       struct path path;
+       int error;
+
 #ifdef CONFIG_QUOTA
        int qfmt;
 #endif
@@ -1129,6 +1137,41 @@ static int parse_options (char *options, struct super_block *sb,
                                return 0;
                        *journal_devnum = option;
                        break;
+               case Opt_journal_path:
+                       if (is_remount) {
+                               ext3_msg(sb, KERN_ERR, "error: cannot specify "
+                                      "journal on remount");
+                               return 0;
+                       }
+
+                       journal_path = match_strdup(&args[0]);
+                       if (!journal_path) {
+                               ext3_msg(sb, KERN_ERR, "error: could not dup "
+                                       "journal device string");
+                               return 0;
+                       }
+
+                       error = kern_path(journal_path, LOOKUP_FOLLOW, &path);
+                       if (error) {
+                               ext3_msg(sb, KERN_ERR, "error: could not find "
+                                       "journal device path: error %d", error);
+                               kfree(journal_path);
+                               return 0;
+                       }
+
+                       journal_inode = path.dentry->d_inode;
+                       if (!S_ISBLK(journal_inode->i_mode)) {
+                               ext3_msg(sb, KERN_ERR, "error: journal path %s "
+                                       "is not a block device", journal_path);
+                               path_put(&path);
+                               kfree(journal_path);
+                               return 0;
+                       }
+
+                       *journal_devnum = new_encode_dev(journal_inode->i_rdev);
+                       path_put(&path);
+                       kfree(journal_path);
+                       break;
                case Opt_noload:
                        set_opt (sbi->s_mount_opt, NOLOAD);
                        break;
index 049c8a8..2c2e6cb 100644 (file)
@@ -162,7 +162,7 @@ void *ext4_kvmalloc(size_t size, gfp_t flags)
 {
        void *ret;
 
-       ret = kmalloc(size, flags);
+       ret = kmalloc(size, flags | __GFP_NOWARN);
        if (!ret)
                ret = __vmalloc(size, flags, PAGE_KERNEL);
        return ret;
@@ -172,7 +172,7 @@ void *ext4_kvzalloc(size_t size, gfp_t flags)
 {
        void *ret;
 
-       ret = kzalloc(size, flags);
+       ret = kzalloc(size, flags | __GFP_NOWARN);
        if (!ret)
                ret = __vmalloc(size, flags | __GFP_ZERO, PAGE_KERNEL);
        return ret;
index 66a6b85..bb31220 100644 (file)
@@ -182,7 +182,7 @@ const struct address_space_operations f2fs_meta_aops = {
        .set_page_dirty = f2fs_set_meta_page_dirty,
 };
 
-int check_orphan_space(struct f2fs_sb_info *sbi)
+int acquire_orphan_inode(struct f2fs_sb_info *sbi)
 {
        unsigned int max_orphans;
        int err = 0;
@@ -197,10 +197,19 @@ int check_orphan_space(struct f2fs_sb_info *sbi)
        mutex_lock(&sbi->orphan_inode_mutex);
        if (sbi->n_orphans >= max_orphans)
                err = -ENOSPC;
+       else
+               sbi->n_orphans++;
        mutex_unlock(&sbi->orphan_inode_mutex);
        return err;
 }
 
+void release_orphan_inode(struct f2fs_sb_info *sbi)
+{
+       mutex_lock(&sbi->orphan_inode_mutex);
+       sbi->n_orphans--;
+       mutex_unlock(&sbi->orphan_inode_mutex);
+}
+
 void add_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
 {
        struct list_head *head, *this;
@@ -229,21 +238,18 @@ retry:
                list_add(&new->list, this->prev);
        else
                list_add_tail(&new->list, head);
-
-       sbi->n_orphans++;
 out:
        mutex_unlock(&sbi->orphan_inode_mutex);
 }
 
 void remove_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
 {
-       struct list_head *this, *next, *head;
+       struct list_head *head;
        struct orphan_inode_entry *orphan;
 
        mutex_lock(&sbi->orphan_inode_mutex);
        head = &sbi->orphan_inode_list;
-       list_for_each_safe(this, next, head) {
-               orphan = list_entry(this, struct orphan_inode_entry, list);
+       list_for_each_entry(orphan, head, list) {
                if (orphan->ino == ino) {
                        list_del(&orphan->list);
                        kmem_cache_free(orphan_entry_slab, orphan);
@@ -373,7 +379,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
        if (!f2fs_crc_valid(crc, cp_block, crc_offset))
                goto invalid_cp1;
 
-       pre_version = le64_to_cpu(cp_block->checkpoint_ver);
+       pre_version = cur_cp_version(cp_block);
 
        /* Read the 2nd cp block in this CP pack */
        cp_addr += le32_to_cpu(cp_block->cp_pack_total_block_count) - 1;
@@ -388,7 +394,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
        if (!f2fs_crc_valid(crc, cp_block, crc_offset))
                goto invalid_cp2;
 
-       cur_version = le64_to_cpu(cp_block->checkpoint_ver);
+       cur_version = cur_cp_version(cp_block);
 
        if (cur_version == pre_version) {
                *version = cur_version;
@@ -793,7 +799,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
         * Increase the version number so that
         * SIT entries and seg summaries are written at correct place
         */
-       ckpt_ver = le64_to_cpu(ckpt->checkpoint_ver);
+       ckpt_ver = cur_cp_version(ckpt);
        ckpt->checkpoint_ver = cpu_to_le64(++ckpt_ver);
 
        /* write cached NAT/SIT entries to NAT/SIT area */
index 035f9a3..941f9b9 100644 (file)
@@ -37,9 +37,9 @@ static void __set_data_blkaddr(struct dnode_of_data *dn, block_t new_addr)
        struct page *node_page = dn->node_page;
        unsigned int ofs_in_node = dn->ofs_in_node;
 
-       wait_on_page_writeback(node_page);
+       f2fs_wait_on_page_writeback(node_page, NODE, false);
 
-       rn = (struct f2fs_node *)page_address(node_page);
+       rn = F2FS_NODE(node_page);
 
        /* Get physical address of data block */
        addr_array = blkaddr_in_node(rn);
@@ -117,7 +117,8 @@ void update_extent_cache(block_t blk_addr, struct dnode_of_data *dn)
        block_t start_blkaddr, end_blkaddr;
 
        BUG_ON(blk_addr == NEW_ADDR);
-       fofs = start_bidx_of_node(ofs_of_node(dn->node_page)) + dn->ofs_in_node;
+       fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
+                                                       dn->ofs_in_node;
 
        /* Update the page address in the parent node */
        __set_data_blkaddr(dn, blk_addr);
@@ -176,7 +177,6 @@ void update_extent_cache(block_t blk_addr, struct dnode_of_data *dn)
 end_update:
        write_unlock(&fi->ext.ext_lock);
        sync_inode_page(dn);
-       return;
 }
 
 struct page *find_data_page(struct inode *inode, pgoff_t index, bool sync)
@@ -260,8 +260,17 @@ repeat:
        if (PageUptodate(page))
                return page;
 
-       BUG_ON(dn.data_blkaddr == NEW_ADDR);
-       BUG_ON(dn.data_blkaddr == NULL_ADDR);
+       /*
+        * A new dentry page is allocated but not able to be written, since its
+        * new inode page couldn't be allocated due to -ENOSPC.
+        * In such the case, its blkaddr can be remained as NEW_ADDR.
+        * see, f2fs_add_link -> get_new_data_page -> init_inode_metadata.
+        */
+       if (dn.data_blkaddr == NEW_ADDR) {
+               zero_user_segment(page, 0, PAGE_CACHE_SIZE);
+               SetPageUptodate(page);
+               return page;
+       }
 
        err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
        if (err)
@@ -365,7 +374,6 @@ static void read_end_io(struct bio *bio, int err)
                }
                unlock_page(page);
        } while (bvec >= bio->bi_io_vec);
-       kfree(bio->bi_private);
        bio_put(bio);
 }
 
@@ -391,7 +399,6 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page,
        bio->bi_end_io = read_end_io;
 
        if (bio_add_page(bio, page, PAGE_CACHE_SIZE, 0) < PAGE_CACHE_SIZE) {
-               kfree(bio->bi_private);
                bio_put(bio);
                up_read(&sbi->bio_sem);
                f2fs_put_page(page, 1);
@@ -442,7 +449,7 @@ static int get_data_block_ro(struct inode *inode, sector_t iblock,
                unsigned int end_offset;
 
                end_offset = IS_INODE(dn.node_page) ?
-                               ADDRS_PER_INODE :
+                               ADDRS_PER_INODE(F2FS_I(inode)) :
                                ADDRS_PER_BLOCK;
 
                clear_buffer_new(bh_result);
@@ -636,9 +643,6 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
        int err = 0;
        int ilock;
 
-       /* for nobh_write_end */
-       *fsdata = NULL;
-
        f2fs_balance_fs(sbi);
 repeat:
        page = grab_cache_page_write_begin(mapping, index, flags);
index 0d6c6aa..a84b0a8 100644 (file)
@@ -29,7 +29,7 @@ static DEFINE_MUTEX(f2fs_stat_mutex);
 
 static void update_general_status(struct f2fs_sb_info *sbi)
 {
-       struct f2fs_stat_info *si = sbi->stat_info;
+       struct f2fs_stat_info *si = F2FS_STAT(sbi);
        int i;
 
        /* valid check of the segment numbers */
@@ -83,7 +83,7 @@ static void update_general_status(struct f2fs_sb_info *sbi)
  */
 static void update_sit_info(struct f2fs_sb_info *sbi)
 {
-       struct f2fs_stat_info *si = sbi->stat_info;
+       struct f2fs_stat_info *si = F2FS_STAT(sbi);
        unsigned int blks_per_sec, hblks_per_sec, total_vblocks, bimodal, dist;
        struct sit_info *sit_i = SIT_I(sbi);
        unsigned int segno, vblocks;
@@ -118,7 +118,7 @@ static void update_sit_info(struct f2fs_sb_info *sbi)
  */
 static void update_mem_info(struct f2fs_sb_info *sbi)
 {
-       struct f2fs_stat_info *si = sbi->stat_info;
+       struct f2fs_stat_info *si = F2FS_STAT(sbi);
        unsigned npages;
 
        if (si->base_mem)
@@ -253,21 +253,21 @@ static int stat_show(struct seq_file *s, void *v)
                           si->nats, NM_WOUT_THRESHOLD);
                seq_printf(s, "  - SITs: %5d\n  - free_nids: %5d\n",
                           si->sits, si->fnids);
-               seq_printf(s, "\nDistribution of User Blocks:");
-               seq_printf(s, " [ valid | invalid | free ]\n");
-               seq_printf(s, "  [");
+               seq_puts(s, "\nDistribution of User Blocks:");
+               seq_puts(s, " [ valid | invalid | free ]\n");
+               seq_puts(s, "  [");
 
                for (j = 0; j < si->util_valid; j++)
-                       seq_printf(s, "-");
-               seq_printf(s, "|");
+                       seq_putc(s, '-');
+               seq_putc(s, '|');
 
                for (j = 0; j < si->util_invalid; j++)
-                       seq_printf(s, "-");
-               seq_printf(s, "|");
+                       seq_putc(s, '-');
+               seq_putc(s, '|');
 
                for (j = 0; j < si->util_free; j++)
-                       seq_printf(s, "-");
-               seq_printf(s, "]\n\n");
+                       seq_putc(s, '-');
+               seq_puts(s, "]\n\n");
                seq_printf(s, "SSR: %u blocks in %u segments\n",
                           si->block_count[SSR], si->segment_count[SSR]);
                seq_printf(s, "LFS: %u blocks in %u segments\n",
@@ -305,11 +305,10 @@ int f2fs_build_stats(struct f2fs_sb_info *sbi)
        struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi);
        struct f2fs_stat_info *si;
 
-       sbi->stat_info = kzalloc(sizeof(struct f2fs_stat_info), GFP_KERNEL);
-       if (!sbi->stat_info)
+       si = kzalloc(sizeof(struct f2fs_stat_info), GFP_KERNEL);
+       if (!si)
                return -ENOMEM;
 
-       si = sbi->stat_info;
        si->all_area_segs = le32_to_cpu(raw_super->segment_count);
        si->sit_area_segs = le32_to_cpu(raw_super->segment_count_sit);
        si->nat_area_segs = le32_to_cpu(raw_super->segment_count_nat);
@@ -319,6 +318,7 @@ int f2fs_build_stats(struct f2fs_sb_info *sbi)
        si->main_area_zones = si->main_area_sections /
                                le32_to_cpu(raw_super->secs_per_zone);
        si->sbi = sbi;
+       sbi->stat_info = si;
 
        mutex_lock(&f2fs_stat_mutex);
        list_add_tail(&si->stat_list, &f2fs_stat_list);
@@ -329,13 +329,13 @@ int f2fs_build_stats(struct f2fs_sb_info *sbi)
 
 void f2fs_destroy_stats(struct f2fs_sb_info *sbi)
 {
-       struct f2fs_stat_info *si = sbi->stat_info;
+       struct f2fs_stat_info *si = F2FS_STAT(sbi);
 
        mutex_lock(&f2fs_stat_mutex);
        list_del(&si->stat_list);
        mutex_unlock(&f2fs_stat_mutex);
 
-       kfree(sbi->stat_info);
+       kfree(si);
 }
 
 void __init f2fs_create_root_stats(void)
index 62f0d59..384c6da 100644 (file)
@@ -270,12 +270,27 @@ static void init_dent_inode(const struct qstr *name, struct page *ipage)
        struct f2fs_node *rn;
 
        /* copy name info. to this inode page */
-       rn = (struct f2fs_node *)page_address(ipage);
+       rn = F2FS_NODE(ipage);
        rn->i.i_namelen = cpu_to_le32(name->len);
        memcpy(rn->i.i_name, name->name, name->len);
        set_page_dirty(ipage);
 }
 
+int update_dent_inode(struct inode *inode, const struct qstr *name)
+{
+       struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
+       struct page *page;
+
+       page = get_node_page(sbi, inode->i_ino);
+       if (IS_ERR(page))
+               return PTR_ERR(page);
+
+       init_dent_inode(name, page);
+       f2fs_put_page(page, 1);
+
+       return 0;
+}
+
 static int make_empty_dir(struct inode *inode,
                struct inode *parent, struct page *page)
 {
@@ -557,6 +572,8 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
 
                if (inode->i_nlink == 0)
                        add_orphan_inode(sbi, inode->i_ino);
+               else
+                       release_orphan_inode(sbi);
        }
 
        if (bit_pos == NR_DENTRY_IN_BLOCK) {
index 467d42d..608f0df 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/slab.h>
 #include <linux/crc32.h>
 #include <linux/magic.h>
+#include <linux/kobject.h>
 
 /*
  * For mount options
@@ -28,6 +29,7 @@
 #define F2FS_MOUNT_XATTR_USER          0x00000010
 #define F2FS_MOUNT_POSIX_ACL           0x00000020
 #define F2FS_MOUNT_DISABLE_EXT_IDENTIFY        0x00000040
+#define F2FS_MOUNT_INLINE_XATTR                0x00000080
 
 #define clear_opt(sbi, option) (sbi->mount_opt.opt &= ~F2FS_MOUNT_##option)
 #define set_opt(sbi, option)   (sbi->mount_opt.opt |= F2FS_MOUNT_##option)
@@ -134,11 +136,13 @@ static inline int update_sits_in_cursum(struct f2fs_summary_block *rs, int i)
 /*
  * For INODE and NODE manager
  */
-#define XATTR_NODE_OFFSET      (-1)    /*
-                                        * store xattrs to one node block per
-                                        * file keeping -1 as its node offset to
-                                        * distinguish from index node blocks.
-                                        */
+/*
+ * XATTR_NODE_OFFSET stores xattrs to one node block per file keeping -1
+ * as its node offset to distinguish from index node blocks.
+ * But some bits are used to mark the node block.
+ */
+#define XATTR_NODE_OFFSET      ((((unsigned int)-1) << OFFSET_BIT_SHIFT) \
+                               >> OFFSET_BIT_SHIFT)
 enum {
        ALLOC_NODE,                     /* allocate a new node page if needed */
        LOOKUP_NODE,                    /* look up a node without readahead */
@@ -178,6 +182,7 @@ struct f2fs_inode_info {
        f2fs_hash_t chash;              /* hash value of given file name */
        unsigned int clevel;            /* maximum level of given file name */
        nid_t i_xattr_nid;              /* node id that contains xattrs */
+       unsigned long long xattr_ver;   /* cp version of xattr modification */
        struct extent_info ext;         /* in-memory extent cache entry */
 };
 
@@ -296,15 +301,6 @@ struct f2fs_sm_info {
 };
 
 /*
- * For directory operation
- */
-#define        NODE_DIR1_BLOCK         (ADDRS_PER_INODE + 1)
-#define        NODE_DIR2_BLOCK         (ADDRS_PER_INODE + 2)
-#define        NODE_IND1_BLOCK         (ADDRS_PER_INODE + 3)
-#define        NODE_IND2_BLOCK         (ADDRS_PER_INODE + 4)
-#define        NODE_DIND_BLOCK         (ADDRS_PER_INODE + 5)
-
-/*
  * For superblock
  */
 /*
@@ -350,6 +346,7 @@ enum page_type {
 
 struct f2fs_sb_info {
        struct super_block *sb;                 /* pointer to VFS super block */
+       struct proc_dir_entry *s_proc;          /* proc entry */
        struct buffer_head *raw_super_buf;      /* buffer head of raw sb */
        struct f2fs_super_block *raw_super;     /* raw super block pointer */
        int s_dirty;                            /* dirty flag for checkpoint */
@@ -429,6 +426,10 @@ struct f2fs_sb_info {
 #endif
        unsigned int last_victim[2];            /* last victim segment # */
        spinlock_t stat_lock;                   /* lock for stat operations */
+
+       /* For sysfs suppport */
+       struct kobject s_kobj;
+       struct completion s_kobj_unregister;
 };
 
 /*
@@ -454,6 +455,11 @@ static inline struct f2fs_checkpoint *F2FS_CKPT(struct f2fs_sb_info *sbi)
        return (struct f2fs_checkpoint *)(sbi->ckpt);
 }
 
+static inline struct f2fs_node *F2FS_NODE(struct page *page)
+{
+       return (struct f2fs_node *)page_address(page);
+}
+
 static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi)
 {
        return (struct f2fs_nm_info *)(sbi->nm_info);
@@ -489,6 +495,11 @@ static inline void F2FS_RESET_SB_DIRT(struct f2fs_sb_info *sbi)
        sbi->s_dirty = 0;
 }
 
+static inline unsigned long long cur_cp_version(struct f2fs_checkpoint *cp)
+{
+       return le64_to_cpu(cp->checkpoint_ver);
+}
+
 static inline bool is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
 {
        unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
@@ -677,7 +688,7 @@ static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
 {
        block_t start_addr;
        struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
-       unsigned long long ckpt_version = le64_to_cpu(ckpt->checkpoint_ver);
+       unsigned long long ckpt_version = cur_cp_version(ckpt);
 
        start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr);
 
@@ -812,7 +823,7 @@ static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name,
 
 static inline bool IS_INODE(struct page *page)
 {
-       struct f2fs_node *p = (struct f2fs_node *)page_address(page);
+       struct f2fs_node *p = F2FS_NODE(page);
        return RAW_IS_INODE(p);
 }
 
@@ -826,7 +837,7 @@ static inline block_t datablock_addr(struct page *node_page,
 {
        struct f2fs_node *raw_node;
        __le32 *addr_array;
-       raw_node = (struct f2fs_node *)page_address(node_page);
+       raw_node = F2FS_NODE(node_page);
        addr_array = blkaddr_in_node(raw_node);
        return le32_to_cpu(addr_array[offset]);
 }
@@ -873,6 +884,7 @@ enum {
        FI_NO_ALLOC,            /* should not allocate any blocks */
        FI_UPDATE_DIR,          /* should update inode block for consistency */
        FI_DELAY_IPUT,          /* used for the recovery */
+       FI_INLINE_XATTR,        /* used for inline xattr */
 };
 
 static inline void set_inode_flag(struct f2fs_inode_info *fi, int flag)
@@ -905,6 +917,45 @@ static inline int cond_clear_inode_flag(struct f2fs_inode_info *fi, int flag)
        return 0;
 }
 
+static inline void get_inline_info(struct f2fs_inode_info *fi,
+                                       struct f2fs_inode *ri)
+{
+       if (ri->i_inline & F2FS_INLINE_XATTR)
+               set_inode_flag(fi, FI_INLINE_XATTR);
+}
+
+static inline void set_raw_inline(struct f2fs_inode_info *fi,
+                                       struct f2fs_inode *ri)
+{
+       ri->i_inline = 0;
+
+       if (is_inode_flag_set(fi, FI_INLINE_XATTR))
+               ri->i_inline |= F2FS_INLINE_XATTR;
+}
+
+static inline unsigned int addrs_per_inode(struct f2fs_inode_info *fi)
+{
+       if (is_inode_flag_set(fi, FI_INLINE_XATTR))
+               return DEF_ADDRS_PER_INODE - F2FS_INLINE_XATTR_ADDRS;
+       return DEF_ADDRS_PER_INODE;
+}
+
+static inline void *inline_xattr_addr(struct page *page)
+{
+       struct f2fs_inode *ri;
+       ri = (struct f2fs_inode *)page_address(page);
+       return (void *)&(ri->i_addr[DEF_ADDRS_PER_INODE -
+                                       F2FS_INLINE_XATTR_ADDRS]);
+}
+
+static inline int inline_xattr_size(struct inode *inode)
+{
+       if (is_inode_flag_set(F2FS_I(inode), FI_INLINE_XATTR))
+               return F2FS_INLINE_XATTR_ADDRS << 2;
+       else
+               return 0;
+}
+
 static inline int f2fs_readonly(struct super_block *sb)
 {
        return sb->s_flags & MS_RDONLY;
@@ -947,6 +998,7 @@ struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **);
 ino_t f2fs_inode_by_name(struct inode *, struct qstr *);
 void f2fs_set_link(struct inode *, struct f2fs_dir_entry *,
                                struct page *, struct inode *);
+int update_dent_inode(struct inode *, const struct qstr *);
 int __f2fs_add_link(struct inode *, const struct qstr *, struct inode *);
 void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *);
 int f2fs_make_empty(struct inode *, struct inode *);
@@ -980,6 +1032,7 @@ int is_checkpointed_node(struct f2fs_sb_info *, nid_t);
 void get_node_info(struct f2fs_sb_info *, nid_t, struct node_info *);
 int get_dnode_of_data(struct dnode_of_data *, pgoff_t, int);
 int truncate_inode_blocks(struct inode *, pgoff_t);
+int truncate_xattr_node(struct inode *, struct page *);
 int remove_inode_page(struct inode *);
 struct page *new_inode_page(struct inode *, const struct qstr *);
 struct page *new_node_page(struct dnode_of_data *, unsigned int, struct page *);
@@ -1012,7 +1065,8 @@ int npages_for_summary_flush(struct f2fs_sb_info *);
 void allocate_new_segments(struct f2fs_sb_info *);
 struct page *get_sum_page(struct f2fs_sb_info *, unsigned int);
 struct bio *f2fs_bio_alloc(struct block_device *, int);
-void f2fs_submit_bio(struct f2fs_sb_info *, enum page_type, bool sync);
+void f2fs_submit_bio(struct f2fs_sb_info *, enum page_type, bool);
+void f2fs_wait_on_page_writeback(struct page *, enum page_type, bool);
 void write_meta_page(struct f2fs_sb_info *, struct page *);
 void write_node_page(struct f2fs_sb_info *, struct page *, unsigned int,
                                        block_t, block_t *);
@@ -1037,7 +1091,8 @@ void destroy_segment_manager(struct f2fs_sb_info *);
 struct page *grab_meta_page(struct f2fs_sb_info *, pgoff_t);
 struct page *get_meta_page(struct f2fs_sb_info *, pgoff_t);
 long sync_meta_pages(struct f2fs_sb_info *, enum page_type, long);
-int check_orphan_space(struct f2fs_sb_info *);
+int acquire_orphan_inode(struct f2fs_sb_info *);
+void release_orphan_inode(struct f2fs_sb_info *);
 void add_orphan_inode(struct f2fs_sb_info *, nid_t);
 void remove_orphan_inode(struct f2fs_sb_info *, nid_t);
 int recover_orphan_inodes(struct f2fs_sb_info *);
@@ -1068,7 +1123,7 @@ int do_write_data_page(struct page *);
  */
 int start_gc_thread(struct f2fs_sb_info *);
 void stop_gc_thread(struct f2fs_sb_info *);
-block_t start_bidx_of_node(unsigned int);
+block_t start_bidx_of_node(unsigned int, struct f2fs_inode_info *);
 int f2fs_gc(struct f2fs_sb_info *);
 void build_gc_manager(struct f2fs_sb_info *);
 int __init create_gc_caches(void);
@@ -1112,11 +1167,16 @@ struct f2fs_stat_info {
        unsigned base_mem, cache_mem;
 };
 
+static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
+{
+       return (struct f2fs_stat_info*)sbi->stat_info;
+}
+
 #define stat_inc_call_count(si)        ((si)->call_count++)
 
 #define stat_inc_seg_count(sbi, type)                                  \
        do {                                                            \
-               struct f2fs_stat_info *si = sbi->stat_info;             \
+               struct f2fs_stat_info *si = F2FS_STAT(sbi);             \
                (si)->tot_segs++;                                       \
                if (type == SUM_TYPE_DATA)                              \
                        si->data_segs++;                                \
@@ -1129,14 +1189,14 @@ struct f2fs_stat_info {
 
 #define stat_inc_data_blk_count(sbi, blks)                             \
        do {                                                            \
-               struct f2fs_stat_info *si = sbi->stat_info;             \
+               struct f2fs_stat_info *si = F2FS_STAT(sbi);             \
                stat_inc_tot_blk_count(si, blks);                       \
                si->data_blks += (blks);                                \
        } while (0)
 
 #define stat_inc_node_blk_count(sbi, blks)                             \
        do {                                                            \
-               struct f2fs_stat_info *si = sbi->stat_info;             \
+               struct f2fs_stat_info *si = F2FS_STAT(sbi);             \
                stat_inc_tot_blk_count(si, blks);                       \
                si->node_blks += (blks);                                \
        } while (0)
index d2d2b7d..02c9069 100644 (file)
@@ -112,11 +112,13 @@ static int get_parent_ino(struct inode *inode, nid_t *pino)
        if (!dentry)
                return 0;
 
-       inode = igrab(dentry->d_parent->d_inode);
-       dput(dentry);
+       if (update_dent_inode(inode, &dentry->d_name)) {
+               dput(dentry);
+               return 0;
+       }
 
-       *pino = inode->i_ino;
-       iput(inode);
+       *pino = parent_ino(dentry);
+       dput(dentry);
        return 1;
 }
 
@@ -147,9 +149,10 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
 
        mutex_lock(&inode->i_mutex);
 
-       if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
-               goto out;
-
+       /*
+        * Both of fdatasync() and fsync() are able to be recovered from
+        * sudden-power-off.
+        */
        if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1)
                need_cp = true;
        else if (file_wrong_pino(inode))
@@ -158,10 +161,14 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
                need_cp = true;
        else if (!is_checkpointed_node(sbi, F2FS_I(inode)->i_pino))
                need_cp = true;
+       else if (F2FS_I(inode)->xattr_ver == cur_cp_version(F2FS_CKPT(sbi)))
+               need_cp = true;
 
        if (need_cp) {
                nid_t pino;
 
+               F2FS_I(inode)->xattr_ver = 0;
+
                /* all the dirty node pages should be flushed for POR */
                ret = f2fs_sync_fs(inode->i_sb, 1);
                if (file_wrong_pino(inode) && inode->i_nlink == 1 &&
@@ -205,7 +212,7 @@ int truncate_data_blocks_range(struct dnode_of_data *dn, int count)
        struct f2fs_node *raw_node;
        __le32 *addr;
 
-       raw_node = page_address(dn->node_page);
+       raw_node = F2FS_NODE(dn->node_page);
        addr = blkaddr_in_node(raw_node) + ofs;
 
        for ( ; count > 0; count--, addr++, dn->ofs_in_node++) {
@@ -283,7 +290,7 @@ static int truncate_blocks(struct inode *inode, u64 from)
        }
 
        if (IS_INODE(dn.node_page))
-               count = ADDRS_PER_INODE;
+               count = ADDRS_PER_INODE(F2FS_I(inode));
        else
                count = ADDRS_PER_BLOCK;
 
index 35f9b1a..2f157e8 100644 (file)
@@ -29,10 +29,11 @@ static struct kmem_cache *winode_slab;
 static int gc_thread_func(void *data)
 {
        struct f2fs_sb_info *sbi = data;
+       struct f2fs_gc_kthread *gc_th = sbi->gc_thread;
        wait_queue_head_t *wq = &sbi->gc_thread->gc_wait_queue_head;
        long wait_ms;
 
-       wait_ms = GC_THREAD_MIN_SLEEP_TIME;
+       wait_ms = gc_th->min_sleep_time;
 
        do {
                if (try_to_freeze())
@@ -45,7 +46,7 @@ static int gc_thread_func(void *data)
                        break;
 
                if (sbi->sb->s_writers.frozen >= SB_FREEZE_WRITE) {
-                       wait_ms = GC_THREAD_MAX_SLEEP_TIME;
+                       wait_ms = increase_sleep_time(gc_th, wait_ms);
                        continue;
                }
 
@@ -66,15 +67,15 @@ static int gc_thread_func(void *data)
                        continue;
 
                if (!is_idle(sbi)) {
-                       wait_ms = increase_sleep_time(wait_ms);
+                       wait_ms = increase_sleep_time(gc_th, wait_ms);
                        mutex_unlock(&sbi->gc_mutex);
                        continue;
                }
 
                if (has_enough_invalid_blocks(sbi))
-                       wait_ms = decrease_sleep_time(wait_ms);
+                       wait_ms = decrease_sleep_time(gc_th, wait_ms);
                else
-                       wait_ms = increase_sleep_time(wait_ms);
+                       wait_ms = increase_sleep_time(gc_th, wait_ms);
 
 #ifdef CONFIG_F2FS_STAT_FS
                sbi->bg_gc++;
@@ -82,7 +83,7 @@ static int gc_thread_func(void *data)
 
                /* if return value is not zero, no victim was selected */
                if (f2fs_gc(sbi))
-                       wait_ms = GC_THREAD_NOGC_SLEEP_TIME;
+                       wait_ms = gc_th->no_gc_sleep_time;
        } while (!kthread_should_stop());
        return 0;
 }
@@ -101,6 +102,12 @@ int start_gc_thread(struct f2fs_sb_info *sbi)
                goto out;
        }
 
+       gc_th->min_sleep_time = DEF_GC_THREAD_MIN_SLEEP_TIME;
+       gc_th->max_sleep_time = DEF_GC_THREAD_MAX_SLEEP_TIME;
+       gc_th->no_gc_sleep_time = DEF_GC_THREAD_NOGC_SLEEP_TIME;
+
+       gc_th->gc_idle = 0;
+
        sbi->gc_thread = gc_th;
        init_waitqueue_head(&sbi->gc_thread->gc_wait_queue_head);
        sbi->gc_thread->f2fs_gc_task = kthread_run(gc_thread_func, sbi,
@@ -125,9 +132,17 @@ void stop_gc_thread(struct f2fs_sb_info *sbi)
        sbi->gc_thread = NULL;
 }
 
-static int select_gc_type(int gc_type)
+static int select_gc_type(struct f2fs_gc_kthread *gc_th, int gc_type)
 {
-       return (gc_type == BG_GC) ? GC_CB : GC_GREEDY;
+       int gc_mode = (gc_type == BG_GC) ? GC_CB : GC_GREEDY;
+
+       if (gc_th && gc_th->gc_idle) {
+               if (gc_th->gc_idle == 1)
+                       gc_mode = GC_CB;
+               else if (gc_th->gc_idle == 2)
+                       gc_mode = GC_GREEDY;
+       }
+       return gc_mode;
 }
 
 static void select_policy(struct f2fs_sb_info *sbi, int gc_type,
@@ -138,12 +153,18 @@ static void select_policy(struct f2fs_sb_info *sbi, int gc_type,
        if (p->alloc_mode == SSR) {
                p->gc_mode = GC_GREEDY;
                p->dirty_segmap = dirty_i->dirty_segmap[type];
+               p->max_search = dirty_i->nr_dirty[type];
                p->ofs_unit = 1;
        } else {
-               p->gc_mode = select_gc_type(gc_type);
+               p->gc_mode = select_gc_type(sbi->gc_thread, gc_type);
                p->dirty_segmap = dirty_i->dirty_segmap[DIRTY];
+               p->max_search = dirty_i->nr_dirty[DIRTY];
                p->ofs_unit = sbi->segs_per_sec;
        }
+
+       if (p->max_search > MAX_VICTIM_SEARCH)
+               p->max_search = MAX_VICTIM_SEARCH;
+
        p->offset = sbi->last_victim[p->gc_mode];
 }
 
@@ -290,7 +311,7 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
                if (cost == max_cost)
                        continue;
 
-               if (nsearched++ >= MAX_VICTIM_SEARCH) {
+               if (nsearched++ >= p.max_search) {
                        sbi->last_victim[p.gc_mode] = segno;
                        break;
                }
@@ -407,8 +428,7 @@ next_step:
 
                /* set page dirty and write it */
                if (gc_type == FG_GC) {
-                       f2fs_submit_bio(sbi, NODE, true);
-                       wait_on_page_writeback(node_page);
+                       f2fs_wait_on_page_writeback(node_page, NODE, true);
                        set_page_dirty(node_page);
                } else {
                        if (!PageWriteback(node_page))
@@ -447,7 +467,7 @@ next_step:
  * as indirect or double indirect node blocks, are given, it must be a caller's
  * bug.
  */
-block_t start_bidx_of_node(unsigned int node_ofs)
+block_t start_bidx_of_node(unsigned int node_ofs, struct f2fs_inode_info *fi)
 {
        unsigned int indirect_blks = 2 * NIDS_PER_BLOCK + 4;
        unsigned int bidx;
@@ -464,7 +484,7 @@ block_t start_bidx_of_node(unsigned int node_ofs)
                int dec = (node_ofs - indirect_blks - 3) / (NIDS_PER_BLOCK + 1);
                bidx = node_ofs - 5 - dec;
        }
-       return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE;
+       return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE(fi);
 }
 
 static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
@@ -508,10 +528,7 @@ static void move_data_page(struct inode *inode, struct page *page, int gc_type)
        } else {
                struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
 
-               if (PageWriteback(page)) {
-                       f2fs_submit_bio(sbi, DATA, true);
-                       wait_on_page_writeback(page);
-               }
+               f2fs_wait_on_page_writeback(page, DATA, true);
 
                if (clear_page_dirty_for_io(page) &&
                        S_ISDIR(inode->i_mode)) {
@@ -575,7 +592,6 @@ next_step:
                        continue;
                }
 
-               start_bidx = start_bidx_of_node(nofs);
                ofs_in_node = le16_to_cpu(entry->ofs_in_node);
 
                if (phase == 2) {
@@ -583,6 +599,8 @@ next_step:
                        if (IS_ERR(inode))
                                continue;
 
+                       start_bidx = start_bidx_of_node(nofs, F2FS_I(inode));
+
                        data_page = find_data_page(inode,
                                        start_bidx + ofs_in_node, false);
                        if (IS_ERR(data_page))
@@ -593,6 +611,8 @@ next_step:
                } else {
                        inode = find_gc_inode(dni.ino, ilist);
                        if (inode) {
+                               start_bidx = start_bidx_of_node(nofs,
+                                                               F2FS_I(inode));
                                data_page = get_lock_data_page(inode,
                                                start_bidx + ofs_in_node);
                                if (IS_ERR(data_page))
index 2c6a6bd..507056d 100644 (file)
                                                 * whether IO subsystem is idle
                                                 * or not
                                                 */
-#define GC_THREAD_MIN_SLEEP_TIME       30000   /* milliseconds */
-#define GC_THREAD_MAX_SLEEP_TIME       60000
-#define GC_THREAD_NOGC_SLEEP_TIME      300000  /* wait 5 min */
+#define DEF_GC_THREAD_MIN_SLEEP_TIME   30000   /* milliseconds */
+#define DEF_GC_THREAD_MAX_SLEEP_TIME   60000
+#define DEF_GC_THREAD_NOGC_SLEEP_TIME  300000  /* wait 5 min */
 #define LIMIT_INVALID_BLOCK    40 /* percentage over total user space */
 #define LIMIT_FREE_BLOCK       40 /* percentage over invalid + free space */
 
 /* Search max. number of dirty segments to select a victim segment */
-#define MAX_VICTIM_SEARCH      20
+#define MAX_VICTIM_SEARCH 4096 /* covers 8GB */
 
 struct f2fs_gc_kthread {
        struct task_struct *f2fs_gc_task;
        wait_queue_head_t gc_wait_queue_head;
+
+       /* for gc sleep time */
+       unsigned int min_sleep_time;
+       unsigned int max_sleep_time;
+       unsigned int no_gc_sleep_time;
+
+       /* for changing gc mode */
+       unsigned int gc_idle;
 };
 
 struct inode_entry {
@@ -56,25 +64,25 @@ static inline block_t limit_free_user_blocks(struct f2fs_sb_info *sbi)
        return (long)(reclaimable_user_blocks * LIMIT_FREE_BLOCK) / 100;
 }
 
-static inline long increase_sleep_time(long wait)
+static inline long increase_sleep_time(struct f2fs_gc_kthread *gc_th, long wait)
 {
-       if (wait == GC_THREAD_NOGC_SLEEP_TIME)
+       if (wait == gc_th->no_gc_sleep_time)
                return wait;
 
-       wait += GC_THREAD_MIN_SLEEP_TIME;
-       if (wait > GC_THREAD_MAX_SLEEP_TIME)
-               wait = GC_THREAD_MAX_SLEEP_TIME;
+       wait += gc_th->min_sleep_time;
+       if (wait > gc_th->max_sleep_time)
+               wait = gc_th->max_sleep_time;
        return wait;
 }
 
-static inline long decrease_sleep_time(long wait)
+static inline long decrease_sleep_time(struct f2fs_gc_kthread *gc_th, long wait)
 {
-       if (wait == GC_THREAD_NOGC_SLEEP_TIME)
-               wait = GC_THREAD_MAX_SLEEP_TIME;
+       if (wait == gc_th->no_gc_sleep_time)
+               wait = gc_th->max_sleep_time;
 
-       wait -= GC_THREAD_MIN_SLEEP_TIME;
-       if (wait <= GC_THREAD_MIN_SLEEP_TIME)
-               wait = GC_THREAD_MIN_SLEEP_TIME;
+       wait -= gc_th->min_sleep_time;
+       if (wait <= gc_th->min_sleep_time)
+               wait = gc_th->min_sleep_time;
        return wait;
 }
 
index 2b2d45d..9339cd2 100644 (file)
@@ -56,7 +56,7 @@ static int do_read_inode(struct inode *inode)
        if (IS_ERR(node_page))
                return PTR_ERR(node_page);
 
-       rn = page_address(node_page);
+       rn = F2FS_NODE(node_page);
        ri = &(rn->i);
 
        inode->i_mode = le16_to_cpu(ri->i_mode);
@@ -85,6 +85,7 @@ static int do_read_inode(struct inode *inode)
        fi->i_advise = ri->i_advise;
        fi->i_pino = le32_to_cpu(ri->i_pino);
        get_extent_info(&fi->ext, ri->i_ext);
+       get_inline_info(fi, ri);
        f2fs_put_page(node_page, 1);
        return 0;
 }
@@ -151,9 +152,9 @@ void update_inode(struct inode *inode, struct page *node_page)
        struct f2fs_node *rn;
        struct f2fs_inode *ri;
 
-       wait_on_page_writeback(node_page);
+       f2fs_wait_on_page_writeback(node_page, NODE, false);
 
-       rn = page_address(node_page);
+       rn = F2FS_NODE(node_page);
        ri = &(rn->i);
 
        ri->i_mode = cpu_to_le16(inode->i_mode);
@@ -164,6 +165,7 @@ void update_inode(struct inode *inode, struct page *node_page)
        ri->i_size = cpu_to_le64(i_size_read(inode));
        ri->i_blocks = cpu_to_le64(inode->i_blocks);
        set_raw_extent(&F2FS_I(inode)->ext, &ri->i_ext);
+       set_raw_inline(F2FS_I(inode), ri);
 
        ri->i_atime = cpu_to_le64(inode->i_atime.tv_sec);
        ri->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
@@ -221,9 +223,6 @@ int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc)
        if (!is_inode_flag_set(F2FS_I(inode), FI_DIRTY_INODE))
                return 0;
 
-       if (wbc)
-               f2fs_balance_fs(sbi);
-
        /*
         * We need to lock here to prevent from producing dirty node pages
         * during the urgent cleaning time when runing out of free sections.
@@ -231,6 +230,10 @@ int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc)
        ilock = mutex_lock_op(sbi);
        ret = update_inode_page(inode);
        mutex_unlock_op(sbi, ilock);
+
+       if (wbc)
+               f2fs_balance_fs(sbi);
+
        return ret;
 }
 
index 64c0716..2a5359c 100644 (file)
@@ -83,21 +83,11 @@ static int is_multimedia_file(const unsigned char *s, const char *sub)
 {
        size_t slen = strlen(s);
        size_t sublen = strlen(sub);
-       int ret;
 
        if (sublen > slen)
                return 0;
 
-       ret = memcmp(s + slen - sublen, sub, sublen);
-       if (ret) {      /* compare upper case */
-               int i;
-               char upper_sub[8];
-               for (i = 0; i < sublen && i < sizeof(upper_sub); i++)
-                       upper_sub[i] = toupper(sub[i]);
-               return !memcmp(s + slen - sublen, upper_sub, sublen);
-       }
-
-       return !ret;
+       return !strncasecmp(s + slen - sublen, sub, sublen);
 }
 
 /*
@@ -239,7 +229,7 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry)
        if (!de)
                goto fail;
 
-       err = check_orphan_space(sbi);
+       err = acquire_orphan_inode(sbi);
        if (err) {
                kunmap(page);
                f2fs_put_page(page, 0);
@@ -393,7 +383,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
        struct inode *old_inode = old_dentry->d_inode;
        struct inode *new_inode = new_dentry->d_inode;
        struct page *old_dir_page;
-       struct page *old_page;
+       struct page *old_page, *new_page;
        struct f2fs_dir_entry *old_dir_entry = NULL;
        struct f2fs_dir_entry *old_entry;
        struct f2fs_dir_entry *new_entry;
@@ -415,7 +405,6 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
        ilock = mutex_lock_op(sbi);
 
        if (new_inode) {
-               struct page *new_page;
 
                err = -ENOTEMPTY;
                if (old_dir_entry && !f2fs_empty_dir(new_inode))
@@ -427,14 +416,28 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
                if (!new_entry)
                        goto out_dir;
 
+               err = acquire_orphan_inode(sbi);
+               if (err)
+                       goto put_out_dir;
+
+               if (update_dent_inode(old_inode, &new_dentry->d_name)) {
+                       release_orphan_inode(sbi);
+                       goto put_out_dir;
+               }
+
                f2fs_set_link(new_dir, new_entry, new_page, old_inode);
 
                new_inode->i_ctime = CURRENT_TIME;
                if (old_dir_entry)
                        drop_nlink(new_inode);
                drop_nlink(new_inode);
+
                if (!new_inode->i_nlink)
                        add_orphan_inode(sbi, new_inode->i_ino);
+               else
+                       release_orphan_inode(sbi);
+
+               update_inode_page(old_inode);
                update_inode_page(new_inode);
        } else {
                err = f2fs_add_link(new_dentry, old_inode);
@@ -467,6 +470,8 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
        mutex_unlock_op(sbi, ilock);
        return 0;
 
+put_out_dir:
+       f2fs_put_page(new_page, 1);
 out_dir:
        if (old_dir_entry) {
                kunmap(old_dir_page);
index b418aee..51ef278 100644 (file)
@@ -315,9 +315,10 @@ cache:
  * The maximum depth is four.
  * Offset[0] will have raw inode offset.
  */
-static int get_node_path(long block, int offset[4], unsigned int noffset[4])
+static int get_node_path(struct f2fs_inode_info *fi, long block,
+                               int offset[4], unsigned int noffset[4])
 {
-       const long direct_index = ADDRS_PER_INODE;
+       const long direct_index = ADDRS_PER_INODE(fi);
        const long direct_blks = ADDRS_PER_BLOCK;
        const long dptrs_per_blk = NIDS_PER_BLOCK;
        const long indirect_blks = ADDRS_PER_BLOCK * NIDS_PER_BLOCK;
@@ -405,7 +406,7 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
        int level, i;
        int err = 0;
 
-       level = get_node_path(index, offset, noffset);
+       level = get_node_path(F2FS_I(dn->inode), index, offset, noffset);
 
        nids[0] = dn->inode->i_ino;
        npage[0] = dn->inode_page;
@@ -565,7 +566,7 @@ static int truncate_nodes(struct dnode_of_data *dn, unsigned int nofs,
                return PTR_ERR(page);
        }
 
-       rn = (struct f2fs_node *)page_address(page);
+       rn = F2FS_NODE(page);
        if (depth < 3) {
                for (i = ofs; i < NIDS_PER_BLOCK; i++, freed++) {
                        child_nid = le32_to_cpu(rn->in.nid[i]);
@@ -687,7 +688,7 @@ int truncate_inode_blocks(struct inode *inode, pgoff_t from)
 
        trace_f2fs_truncate_inode_blocks_enter(inode, from);
 
-       level = get_node_path(from, offset, noffset);
+       level = get_node_path(F2FS_I(inode), from, offset, noffset);
 restart:
        page = get_node_page(sbi, inode->i_ino);
        if (IS_ERR(page)) {
@@ -698,7 +699,7 @@ restart:
        set_new_dnode(&dn, inode, page, NULL, 0);
        unlock_page(page);
 
-       rn = page_address(page);
+       rn = F2FS_NODE(page);
        switch (level) {
        case 0:
        case 1:
@@ -771,6 +772,33 @@ fail:
        return err > 0 ? 0 : err;
 }
 
+int truncate_xattr_node(struct inode *inode, struct page *page)
+{
+       struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
+       nid_t nid = F2FS_I(inode)->i_xattr_nid;
+       struct dnode_of_data dn;
+       struct page *npage;
+
+       if (!nid)
+               return 0;
+
+       npage = get_node_page(sbi, nid);
+       if (IS_ERR(npage))
+               return PTR_ERR(npage);
+
+       F2FS_I(inode)->i_xattr_nid = 0;
+
+       /* need to do checkpoint during fsync */
+       F2FS_I(inode)->xattr_ver = cur_cp_version(F2FS_CKPT(sbi));
+
+       set_new_dnode(&dn, inode, page, npage, nid);
+
+       if (page)
+               dn.inode_page_locked = 1;
+       truncate_node(&dn);
+       return 0;
+}
+
 /*
  * Caller should grab and release a mutex by calling mutex_lock_op() and
  * mutex_unlock_op().
@@ -781,22 +809,16 @@ int remove_inode_page(struct inode *inode)
        struct page *page;
        nid_t ino = inode->i_ino;
        struct dnode_of_data dn;
+       int err;
 
        page = get_node_page(sbi, ino);
        if (IS_ERR(page))
                return PTR_ERR(page);
 
-       if (F2FS_I(inode)->i_xattr_nid) {
-               nid_t nid = F2FS_I(inode)->i_xattr_nid;
-               struct page *npage = get_node_page(sbi, nid);
-
-               if (IS_ERR(npage))
-                       return PTR_ERR(npage);
-
-               F2FS_I(inode)->i_xattr_nid = 0;
-               set_new_dnode(&dn, inode, page, npage, nid);
-               dn.inode_page_locked = 1;
-               truncate_node(&dn);
+       err = truncate_xattr_node(inode, page);
+       if (err) {
+               f2fs_put_page(page, 1);
+               return err;
        }
 
        /* 0 is possible, after f2fs_new_inode() is failed */
@@ -833,29 +855,32 @@ struct page *new_node_page(struct dnode_of_data *dn,
        if (!page)
                return ERR_PTR(-ENOMEM);
 
-       get_node_info(sbi, dn->nid, &old_ni);
+       if (!inc_valid_node_count(sbi, dn->inode, 1)) {
+               err = -ENOSPC;
+               goto fail;
+       }
 
-       SetPageUptodate(page);
-       fill_node_footer(page, dn->nid, dn->inode->i_ino, ofs, true);
+       get_node_info(sbi, dn->nid, &old_ni);
 
        /* Reinitialize old_ni with new node page */
        BUG_ON(old_ni.blk_addr != NULL_ADDR);
        new_ni = old_ni;
        new_ni.ino = dn->inode->i_ino;
-
-       if (!inc_valid_node_count(sbi, dn->inode, 1)) {
-               err = -ENOSPC;
-               goto fail;
-       }
        set_node_addr(sbi, &new_ni, NEW_ADDR);
+
+       fill_node_footer(page, dn->nid, dn->inode->i_ino, ofs, true);
        set_cold_node(dn->inode, page);
+       SetPageUptodate(page);
+       set_page_dirty(page);
+
+       if (ofs == XATTR_NODE_OFFSET)
+               F2FS_I(dn->inode)->i_xattr_nid = dn->nid;
 
        dn->node_page = page;
        if (ipage)
                update_inode(dn->inode, ipage);
        else
                sync_inode_page(dn);
-       set_page_dirty(page);
        if (ofs == 0)
                inc_valid_inode_count(sbi);
 
@@ -916,7 +941,6 @@ void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
                f2fs_put_page(apage, 0);
        else if (err == LOCKED_PAGE)
                f2fs_put_page(apage, 1);
-       return;
 }
 
 struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
@@ -1167,9 +1191,9 @@ static int f2fs_write_node_page(struct page *page,
 /*
  * It is very important to gather dirty pages and write at once, so that we can
  * submit a big bio without interfering other data writes.
- * Be default, 512 pages (2MB), a segment size, is quite reasonable.
+ * Be default, 512 pages (2MB) * 3 node types, is more reasonable.
  */
-#define COLLECT_DIRTY_NODES    512
+#define COLLECT_DIRTY_NODES    1536
 static int f2fs_write_node_pages(struct address_space *mapping,
                            struct writeback_control *wbc)
 {
@@ -1187,9 +1211,10 @@ static int f2fs_write_node_pages(struct address_space *mapping,
                return 0;
 
        /* if mounting is failed, skip writing node pages */
-       wbc->nr_to_write = max_hw_blocks(sbi);
+       wbc->nr_to_write = 3 * max_hw_blocks(sbi);
        sync_node_pages(sbi, 0, wbc);
-       wbc->nr_to_write = nr_to_write - (max_hw_blocks(sbi) - wbc->nr_to_write);
+       wbc->nr_to_write = nr_to_write - (3 * max_hw_blocks(sbi) -
+                                               wbc->nr_to_write);
        return 0;
 }
 
@@ -1444,6 +1469,9 @@ void alloc_nid_failed(struct f2fs_sb_info *sbi, nid_t nid)
        struct f2fs_nm_info *nm_i = NM_I(sbi);
        struct free_nid *i;
 
+       if (!nid)
+               return;
+
        spin_lock(&nm_i->free_nid_list_lock);
        i = __lookup_free_nid_list(nid, &nm_i->free_nid_list);
        BUG_ON(!i || i->state != NID_ALLOC);
@@ -1484,8 +1512,8 @@ int recover_inode_page(struct f2fs_sb_info *sbi, struct page *page)
        SetPageUptodate(ipage);
        fill_node_footer(ipage, ino, ino, 0, true);
 
-       src = (struct f2fs_node *)page_address(page);
-       dst = (struct f2fs_node *)page_address(ipage);
+       src = F2FS_NODE(page);
+       dst = F2FS_NODE(ipage);
 
        memcpy(dst, src, (unsigned long)&src->i.i_ext - (unsigned long)&src->i);
        dst->i.i_size = 0;
@@ -1515,8 +1543,8 @@ int restore_node_summary(struct f2fs_sb_info *sbi,
 
        /* alloc temporal page for read node */
        page = alloc_page(GFP_NOFS | __GFP_ZERO);
-       if (IS_ERR(page))
-               return PTR_ERR(page);
+       if (!page)
+               return -ENOMEM;
        lock_page(page);
 
        /* scan the node segment */
@@ -1535,7 +1563,7 @@ int restore_node_summary(struct f2fs_sb_info *sbi,
                        goto out;
 
                lock_page(page);
-               rn = (struct f2fs_node *)page_address(page);
+               rn = F2FS_NODE(page);
                sum_entry->nid = rn->footer.nid;
                sum_entry->version = 0;
                sum_entry->ofs_in_node = 0;
index c65fb4f..3496bb3 100644 (file)
@@ -155,8 +155,7 @@ static inline void set_to_next_nat(struct f2fs_nm_info *nm_i, nid_t start_nid)
 static inline void fill_node_footer(struct page *page, nid_t nid,
                                nid_t ino, unsigned int ofs, bool reset)
 {
-       void *kaddr = page_address(page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(page);
        if (reset)
                memset(rn, 0, sizeof(*rn));
        rn->footer.nid = cpu_to_le32(nid);
@@ -166,10 +165,8 @@ static inline void fill_node_footer(struct page *page, nid_t nid,
 
 static inline void copy_node_footer(struct page *dst, struct page *src)
 {
-       void *src_addr = page_address(src);
-       void *dst_addr = page_address(dst);
-       struct f2fs_node *src_rn = (struct f2fs_node *)src_addr;
-       struct f2fs_node *dst_rn = (struct f2fs_node *)dst_addr;
+       struct f2fs_node *src_rn = F2FS_NODE(src);
+       struct f2fs_node *dst_rn = F2FS_NODE(dst);
        memcpy(&dst_rn->footer, &src_rn->footer, sizeof(struct node_footer));
 }
 
@@ -177,45 +174,40 @@ static inline void fill_node_footer_blkaddr(struct page *page, block_t blkaddr)
 {
        struct f2fs_sb_info *sbi = F2FS_SB(page->mapping->host->i_sb);
        struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
-       void *kaddr = page_address(page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(page);
+
        rn->footer.cp_ver = ckpt->checkpoint_ver;
        rn->footer.next_blkaddr = cpu_to_le32(blkaddr);
 }
 
 static inline nid_t ino_of_node(struct page *node_page)
 {
-       void *kaddr = page_address(node_page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(node_page);
        return le32_to_cpu(rn->footer.ino);
 }
 
 static inline nid_t nid_of_node(struct page *node_page)
 {
-       void *kaddr = page_address(node_page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(node_page);
        return le32_to_cpu(rn->footer.nid);
 }
 
 static inline unsigned int ofs_of_node(struct page *node_page)
 {
-       void *kaddr = page_address(node_page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(node_page);
        unsigned flag = le32_to_cpu(rn->footer.flag);
        return flag >> OFFSET_BIT_SHIFT;
 }
 
 static inline unsigned long long cpver_of_node(struct page *node_page)
 {
-       void *kaddr = page_address(node_page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(node_page);
        return le64_to_cpu(rn->footer.cp_ver);
 }
 
 static inline block_t next_blkaddr_of_node(struct page *node_page)
 {
-       void *kaddr = page_address(node_page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(node_page);
        return le32_to_cpu(rn->footer.next_blkaddr);
 }
 
@@ -237,6 +229,10 @@ static inline block_t next_blkaddr_of_node(struct page *node_page)
 static inline bool IS_DNODE(struct page *node_page)
 {
        unsigned int ofs = ofs_of_node(node_page);
+
+       if (ofs == XATTR_NODE_OFFSET)
+               return false;
+
        if (ofs == 3 || ofs == 4 + NIDS_PER_BLOCK ||
                        ofs == 5 + 2 * NIDS_PER_BLOCK)
                return false;
@@ -250,7 +246,7 @@ static inline bool IS_DNODE(struct page *node_page)
 
 static inline void set_nid(struct page *p, int off, nid_t nid, bool i)
 {
-       struct f2fs_node *rn = (struct f2fs_node *)page_address(p);
+       struct f2fs_node *rn = F2FS_NODE(p);
 
        wait_on_page_writeback(p);
 
@@ -263,7 +259,8 @@ static inline void set_nid(struct page *p, int off, nid_t nid, bool i)
 
 static inline nid_t get_nid(struct page *p, int off, bool i)
 {
-       struct f2fs_node *rn = (struct f2fs_node *)page_address(p);
+       struct f2fs_node *rn = F2FS_NODE(p);
+
        if (i)
                return le32_to_cpu(rn->i.i_nid[off - NODE_DIR1_BLOCK]);
        return le32_to_cpu(rn->in.nid[off]);
@@ -314,8 +311,7 @@ static inline void clear_cold_data(struct page *page)
 
 static inline int is_node(struct page *page, int type)
 {
-       void *kaddr = page_address(page);
-       struct f2fs_node *rn = (struct f2fs_node *)kaddr;
+       struct f2fs_node *rn = F2FS_NODE(page);
        return le32_to_cpu(rn->footer.flag) & (1 << type);
 }
 
@@ -325,7 +321,7 @@ static inline int is_node(struct page *page, int type)
 
 static inline void set_cold_node(struct inode *inode, struct page *page)
 {
-       struct f2fs_node *rn = (struct f2fs_node *)page_address(page);
+       struct f2fs_node *rn = F2FS_NODE(page);
        unsigned int flag = le32_to_cpu(rn->footer.flag);
 
        if (S_ISDIR(inode->i_mode))
@@ -337,7 +333,7 @@ static inline void set_cold_node(struct inode *inode, struct page *page)
 
 static inline void set_mark(struct page *page, int mark, int type)
 {
-       struct f2fs_node *rn = (struct f2fs_node *)page_address(page);
+       struct f2fs_node *rn = F2FS_NODE(page);
        unsigned int flag = le32_to_cpu(rn->footer.flag);
        if (mark)
                flag |= (0x1 << type);
index d56d951..51ef5ee 100644 (file)
@@ -40,8 +40,7 @@ static struct fsync_inode_entry *get_fsync_inode(struct list_head *head,
 
 static int recover_dentry(struct page *ipage, struct inode *inode)
 {
-       void *kaddr = page_address(ipage);
-       struct f2fs_node *raw_node = (struct f2fs_node *)kaddr;
+       struct f2fs_node *raw_node = F2FS_NODE(ipage);
        struct f2fs_inode *raw_inode = &(raw_node->i);
        nid_t pino = le32_to_cpu(raw_inode->i_pino);
        struct f2fs_dir_entry *de;
@@ -93,8 +92,7 @@ out:
 
 static int recover_inode(struct inode *inode, struct page *node_page)
 {
-       void *kaddr = page_address(node_page);
-       struct f2fs_node *raw_node = (struct f2fs_node *)kaddr;
+       struct f2fs_node *raw_node = F2FS_NODE(node_page);
        struct f2fs_inode *raw_inode = &(raw_node->i);
 
        if (!IS_INODE(node_page))
@@ -119,7 +117,7 @@ static int recover_inode(struct inode *inode, struct page *node_page)
 
 static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
 {
-       unsigned long long cp_ver = le64_to_cpu(sbi->ckpt->checkpoint_ver);
+       unsigned long long cp_ver = cur_cp_version(F2FS_CKPT(sbi));
        struct curseg_info *curseg;
        struct page *page;
        block_t blkaddr;
@@ -131,8 +129,8 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
 
        /* read node page */
        page = alloc_page(GFP_F2FS_ZERO);
-       if (IS_ERR(page))
-               return PTR_ERR(page);
+       if (!page)
+               return -ENOMEM;
        lock_page(page);
 
        while (1) {
@@ -215,6 +213,7 @@ static int check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
        void *kaddr;
        struct inode *inode;
        struct page *node_page;
+       unsigned int offset;
        block_t bidx;
        int i;
 
@@ -259,8 +258,8 @@ static int check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
        node_page = get_node_page(sbi, nid);
        if (IS_ERR(node_page))
                return PTR_ERR(node_page);
-       bidx = start_bidx_of_node(ofs_of_node(node_page)) +
-                                       le16_to_cpu(sum.ofs_in_node);
+
+       offset = ofs_of_node(node_page);
        ino = ino_of_node(node_page);
        f2fs_put_page(node_page, 1);
 
@@ -269,6 +268,9 @@ static int check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
        if (IS_ERR(inode))
                return PTR_ERR(inode);
 
+       bidx = start_bidx_of_node(offset, F2FS_I(inode)) +
+                                       le16_to_cpu(sum.ofs_in_node);
+
        truncate_hole(inode, bidx, bidx + 1);
        iput(inode);
        return 0;
@@ -277,6 +279,7 @@ static int check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
 static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
                                        struct page *page, block_t blkaddr)
 {
+       struct f2fs_inode_info *fi = F2FS_I(inode);
        unsigned int start, end;
        struct dnode_of_data dn;
        struct f2fs_summary sum;
@@ -284,9 +287,9 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
        int err = 0, recovered = 0;
        int ilock;
 
-       start = start_bidx_of_node(ofs_of_node(page));
+       start = start_bidx_of_node(ofs_of_node(page), fi);
        if (IS_INODE(page))
-               end = start + ADDRS_PER_INODE;
+               end = start + ADDRS_PER_INODE(fi);
        else
                end = start + ADDRS_PER_BLOCK;
 
@@ -357,7 +360,7 @@ err:
 static int recover_data(struct f2fs_sb_info *sbi,
                                struct list_head *head, int type)
 {
-       unsigned long long cp_ver = le64_to_cpu(sbi->ckpt->checkpoint_ver);
+       unsigned long long cp_ver = cur_cp_version(F2FS_CKPT(sbi));
        struct curseg_info *curseg;
        struct page *page;
        int err = 0;
@@ -369,7 +372,7 @@ static int recover_data(struct f2fs_sb_info *sbi,
 
        /* read node page */
        page = alloc_page(GFP_NOFS | __GFP_ZERO);
-       if (IS_ERR(page))
+       if (!page)
                return -ENOMEM;
 
        lock_page(page);
index a86d125..09af9c7 100644 (file)
@@ -117,7 +117,6 @@ static void locate_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno)
        }
 
        mutex_unlock(&dirty_i->seglist_lock);
-       return;
 }
 
 /*
@@ -261,7 +260,6 @@ static void __add_sum_entry(struct f2fs_sb_info *sbi, int type,
        void *addr = curseg->sum_blk;
        addr += curseg->next_blkoff * sizeof(struct f2fs_summary);
        memcpy(addr, sum, sizeof(struct f2fs_summary));
-       return;
 }
 
 /*
@@ -542,12 +540,9 @@ static void allocate_segment_by_default(struct f2fs_sb_info *sbi,
 {
        struct curseg_info *curseg = CURSEG_I(sbi, type);
 
-       if (force) {
+       if (force)
                new_curseg(sbi, type, true);
-               goto out;
-       }
-
-       if (type == CURSEG_WARM_NODE)
+       else if (type == CURSEG_WARM_NODE)
                new_curseg(sbi, type, false);
        else if (curseg->alloc_type == LFS && is_next_segment_free(sbi, type))
                new_curseg(sbi, type, false);
@@ -555,11 +550,9 @@ static void allocate_segment_by_default(struct f2fs_sb_info *sbi,
                change_curseg(sbi, type, true);
        else
                new_curseg(sbi, type, false);
-out:
 #ifdef CONFIG_F2FS_STAT_FS
        sbi->segment_count[curseg->alloc_type]++;
 #endif
-       return;
 }
 
 void allocate_new_segments(struct f2fs_sb_info *sbi)
@@ -611,18 +604,12 @@ static void f2fs_end_io_write(struct bio *bio, int err)
 struct bio *f2fs_bio_alloc(struct block_device *bdev, int npages)
 {
        struct bio *bio;
-       struct bio_private *priv;
-retry:
-       priv = kmalloc(sizeof(struct bio_private), GFP_NOFS);
-       if (!priv) {
-               cond_resched();
-               goto retry;
-       }
 
        /* No failure on bio allocation */
        bio = bio_alloc(GFP_NOIO, npages);
        bio->bi_bdev = bdev;
-       bio->bi_private = priv;
+       bio->bi_private = NULL;
+
        return bio;
 }
 
@@ -681,8 +668,17 @@ static void submit_write_page(struct f2fs_sb_info *sbi, struct page *page,
                do_submit_bio(sbi, type, false);
 alloc_new:
        if (sbi->bio[type] == NULL) {
+               struct bio_private *priv;
+retry:
+               priv = kmalloc(sizeof(struct bio_private), GFP_NOFS);
+               if (!priv) {
+                       cond_resched();
+                       goto retry;
+               }
+
                sbi->bio[type] = f2fs_bio_alloc(bdev, max_hw_blocks(sbi));
                sbi->bio[type]->bi_sector = SECTOR_FROM_BLOCK(sbi, blk_addr);
+               sbi->bio[type]->bi_private = priv;
                /*
                 * The end_io will be assigned at the sumbission phase.
                 * Until then, let bio_add_page() merge consecutive IOs as much
@@ -702,6 +698,16 @@ alloc_new:
        trace_f2fs_submit_write_page(page, blk_addr, type);
 }
 
+void f2fs_wait_on_page_writeback(struct page *page,
+                               enum page_type type, bool sync)
+{
+       struct f2fs_sb_info *sbi = F2FS_SB(page->mapping->host->i_sb);
+       if (PageWriteback(page)) {
+               f2fs_submit_bio(sbi, type, sync);
+               wait_on_page_writeback(page);
+       }
+}
+
 static bool __has_curseg_space(struct f2fs_sb_info *sbi, int type)
 {
        struct curseg_info *curseg = CURSEG_I(sbi, type);
@@ -1179,7 +1185,6 @@ void write_node_summaries(struct f2fs_sb_info *sbi, block_t start_blk)
 {
        if (is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG))
                write_normal_summaries(sbi, start_blk, CURSEG_HOT_NODE);
-       return;
 }
 
 int lookup_journal_in_cursum(struct f2fs_summary_block *sum, int type,
index 062424a..bdd10ea 100644 (file)
@@ -142,6 +142,7 @@ struct victim_sel_policy {
        int alloc_mode;                 /* LFS or SSR */
        int gc_mode;                    /* GC_CB or GC_GREEDY */
        unsigned long *dirty_segmap;    /* dirty segment bitmap */
+       unsigned int max_search;        /* maximum # of segments to search */
        unsigned int offset;            /* last scanned bitmap offset */
        unsigned int ofs_unit;          /* bitmap search unit */
        unsigned int min_cost;          /* minimum cost */
@@ -453,7 +454,8 @@ static inline int reserved_sections(struct f2fs_sb_info *sbi)
 
 static inline bool need_SSR(struct f2fs_sb_info *sbi)
 {
-       return (free_sections(sbi) < overprovision_sections(sbi));
+       return ((prefree_segments(sbi) / sbi->segs_per_sec)
+                       + free_sections(sbi) < overprovision_sections(sbi));
 }
 
 static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed)
@@ -470,7 +472,7 @@ static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed)
 
 static inline int utilization(struct f2fs_sb_info *sbi)
 {
-       return div_u64(valid_user_blocks(sbi) * 100, sbi->user_block_count);
+       return div_u64((u64)valid_user_blocks(sbi) * 100, sbi->user_block_count);
 }
 
 /*
index 75c7dc3..13d0a0f 100644 (file)
 #include <linux/parser.h>
 #include <linux/mount.h>
 #include <linux/seq_file.h>
+#include <linux/proc_fs.h>
 #include <linux/random.h>
 #include <linux/exportfs.h>
 #include <linux/blkdev.h>
 #include <linux/f2fs_fs.h>
+#include <linux/sysfs.h>
 
 #include "f2fs.h"
 #include "node.h"
 #include "segment.h"
 #include "xattr.h"
+#include "gc.h"
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/f2fs.h>
 
+static struct proc_dir_entry *f2fs_proc_root;
 static struct kmem_cache *f2fs_inode_cachep;
+static struct kset *f2fs_kset;
 
 enum {
        Opt_gc_background,
@@ -42,6 +47,7 @@ enum {
        Opt_noacl,
        Opt_active_logs,
        Opt_disable_ext_identify,
+       Opt_inline_xattr,
        Opt_err,
 };
 
@@ -54,9 +60,117 @@ static match_table_t f2fs_tokens = {
        {Opt_noacl, "noacl"},
        {Opt_active_logs, "active_logs=%u"},
        {Opt_disable_ext_identify, "disable_ext_identify"},
+       {Opt_inline_xattr, "inline_xattr"},
        {Opt_err, NULL},
 };
 
+/* Sysfs support for f2fs */
+struct f2fs_attr {
+       struct attribute attr;
+       ssize_t (*show)(struct f2fs_attr *, struct f2fs_sb_info *, char *);
+       ssize_t (*store)(struct f2fs_attr *, struct f2fs_sb_info *,
+                        const char *, size_t);
+       int offset;
+};
+
+static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
+                       struct f2fs_sb_info *sbi, char *buf)
+{
+       struct f2fs_gc_kthread *gc_kth = sbi->gc_thread;
+       unsigned int *ui;
+
+       if (!gc_kth)
+               return -EINVAL;
+
+       ui = (unsigned int *)(((char *)gc_kth) + a->offset);
+
+       return snprintf(buf, PAGE_SIZE, "%u\n", *ui);
+}
+
+static ssize_t f2fs_sbi_store(struct f2fs_attr *a,
+                       struct f2fs_sb_info *sbi,
+                       const char *buf, size_t count)
+{
+       struct f2fs_gc_kthread *gc_kth = sbi->gc_thread;
+       unsigned long t;
+       unsigned int *ui;
+       ssize_t ret;
+
+       if (!gc_kth)
+               return -EINVAL;
+
+       ui = (unsigned int *)(((char *)gc_kth) + a->offset);
+
+       ret = kstrtoul(skip_spaces(buf), 0, &t);
+       if (ret < 0)
+               return ret;
+       *ui = t;
+       return count;
+}
+
+static ssize_t f2fs_attr_show(struct kobject *kobj,
+                               struct attribute *attr, char *buf)
+{
+       struct f2fs_sb_info *sbi = container_of(kobj, struct f2fs_sb_info,
+                                                               s_kobj);
+       struct f2fs_attr *a = container_of(attr, struct f2fs_attr, attr);
+
+       return a->show ? a->show(a, sbi, buf) : 0;
+}
+
+static ssize_t f2fs_attr_store(struct kobject *kobj, struct attribute *attr,
+                                               const char *buf, size_t len)
+{
+       struct f2fs_sb_info *sbi = container_of(kobj, struct f2fs_sb_info,
+                                                                       s_kobj);
+       struct f2fs_attr *a = container_of(attr, struct f2fs_attr, attr);
+
+       return a->store ? a->store(a, sbi, buf, len) : 0;
+}
+
+static void f2fs_sb_release(struct kobject *kobj)
+{
+       struct f2fs_sb_info *sbi = container_of(kobj, struct f2fs_sb_info,
+                                                               s_kobj);
+       complete(&sbi->s_kobj_unregister);
+}
+
+#define F2FS_ATTR_OFFSET(_name, _mode, _show, _store, _elname) \
+static struct f2fs_attr f2fs_attr_##_name = {                  \
+       .attr = {.name = __stringify(_name), .mode = _mode },   \
+       .show   = _show,                                        \
+       .store  = _store,                                       \
+       .offset = offsetof(struct f2fs_gc_kthread, _elname),    \
+}
+
+#define F2FS_RW_ATTR(name, elname)     \
+       F2FS_ATTR_OFFSET(name, 0644, f2fs_sbi_show, f2fs_sbi_store, elname)
+
+F2FS_RW_ATTR(gc_min_sleep_time, min_sleep_time);
+F2FS_RW_ATTR(gc_max_sleep_time, max_sleep_time);
+F2FS_RW_ATTR(gc_no_gc_sleep_time, no_gc_sleep_time);
+F2FS_RW_ATTR(gc_idle, gc_idle);
+
+#define ATTR_LIST(name) (&f2fs_attr_##name.attr)
+static struct attribute *f2fs_attrs[] = {
+       ATTR_LIST(gc_min_sleep_time),
+       ATTR_LIST(gc_max_sleep_time),
+       ATTR_LIST(gc_no_gc_sleep_time),
+       ATTR_LIST(gc_idle),
+       NULL,
+};
+
+static const struct sysfs_ops f2fs_attr_ops = {
+       .show   = f2fs_attr_show,
+       .store  = f2fs_attr_store,
+};
+
+static struct kobj_type f2fs_ktype = {
+       .default_attrs  = f2fs_attrs,
+       .sysfs_ops      = &f2fs_attr_ops,
+       .release        = f2fs_sb_release,
+};
+
 void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...)
 {
        struct va_format vaf;
@@ -126,11 +240,18 @@ static int parse_options(struct super_block *sb, char *options)
                case Opt_nouser_xattr:
                        clear_opt(sbi, XATTR_USER);
                        break;
+               case Opt_inline_xattr:
+                       set_opt(sbi, INLINE_XATTR);
+                       break;
 #else
                case Opt_nouser_xattr:
                        f2fs_msg(sb, KERN_INFO,
                                "nouser_xattr options not supported");
                        break;
+               case Opt_inline_xattr:
+                       f2fs_msg(sb, KERN_INFO,
+                               "inline_xattr options not supported");
+                       break;
 #endif
 #ifdef CONFIG_F2FS_FS_POSIX_ACL
                case Opt_noacl:
@@ -180,6 +301,9 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
 
        set_inode_flag(fi, FI_NEW_INODE);
 
+       if (test_opt(F2FS_SB(sb), INLINE_XATTR))
+               set_inode_flag(fi, FI_INLINE_XATTR);
+
        return &fi->vfs_inode;
 }
 
@@ -205,7 +329,6 @@ static int f2fs_drop_inode(struct inode *inode)
 static void f2fs_dirty_inode(struct inode *inode, int flags)
 {
        set_inode_flag(F2FS_I(inode), FI_DIRTY_INODE);
-       return;
 }
 
 static void f2fs_i_callback(struct rcu_head *head)
@@ -223,6 +346,12 @@ static void f2fs_put_super(struct super_block *sb)
 {
        struct f2fs_sb_info *sbi = F2FS_SB(sb);
 
+       if (sbi->s_proc) {
+               remove_proc_entry("segment_info", sbi->s_proc);
+               remove_proc_entry(sb->s_id, f2fs_proc_root);
+       }
+       kobject_del(&sbi->s_kobj);
+
        f2fs_destroy_stats(sbi);
        stop_gc_thread(sbi);
 
@@ -236,6 +365,8 @@ static void f2fs_put_super(struct super_block *sb)
        destroy_segment_manager(sbi);
 
        kfree(sbi->ckpt);
+       kobject_put(&sbi->s_kobj);
+       wait_for_completion(&sbi->s_kobj_unregister);
 
        sb->s_fs_info = NULL;
        brelse(sbi->raw_super_buf);
@@ -325,6 +456,8 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
                seq_puts(seq, ",user_xattr");
        else
                seq_puts(seq, ",nouser_xattr");
+       if (test_opt(sbi, INLINE_XATTR))
+               seq_puts(seq, ",inline_xattr");
 #endif
 #ifdef CONFIG_F2FS_FS_POSIX_ACL
        if (test_opt(sbi, POSIX_ACL))
@@ -340,6 +473,36 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
        return 0;
 }
 
+static int segment_info_seq_show(struct seq_file *seq, void *offset)
+{
+       struct super_block *sb = seq->private;
+       struct f2fs_sb_info *sbi = F2FS_SB(sb);
+       unsigned int total_segs = le32_to_cpu(sbi->raw_super->segment_count_main);
+       int i;
+
+       for (i = 0; i < total_segs; i++) {
+               seq_printf(seq, "%u", get_valid_blocks(sbi, i, 1));
+               if (i != 0 && (i % 10) == 0)
+                       seq_puts(seq, "\n");
+               else
+                       seq_puts(seq, " ");
+       }
+       return 0;
+}
+
+static int segment_info_open_fs(struct inode *inode, struct file *file)
+{
+       return single_open(file, segment_info_seq_show, PDE_DATA(inode));
+}
+
+static const struct file_operations f2fs_seq_segment_info_fops = {
+       .owner = THIS_MODULE,
+       .open = segment_info_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
 static int f2fs_remount(struct super_block *sb, int *flags, char *data)
 {
        struct f2fs_sb_info *sbi = F2FS_SB(sb);
@@ -455,7 +618,7 @@ static const struct export_operations f2fs_export_ops = {
 
 static loff_t max_file_size(unsigned bits)
 {
-       loff_t result = ADDRS_PER_INODE;
+       loff_t result = (DEF_ADDRS_PER_INODE - F2FS_INLINE_XATTR_ADDRS);
        loff_t leaf_count = ADDRS_PER_BLOCK;
 
        /* two direct node blocks */
@@ -766,6 +929,13 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
        if (err)
                goto fail;
 
+       if (f2fs_proc_root)
+               sbi->s_proc = proc_mkdir(sb->s_id, f2fs_proc_root);
+
+       if (sbi->s_proc)
+               proc_create_data("segment_info", S_IRUGO, sbi->s_proc,
+                                &f2fs_seq_segment_info_fops, sb);
+
        if (test_opt(sbi, DISCARD)) {
                struct request_queue *q = bdev_get_queue(sb->s_bdev);
                if (!blk_queue_discard(q))
@@ -774,6 +944,13 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
                                        "the device does not support discard");
        }
 
+       sbi->s_kobj.kset = f2fs_kset;
+       init_completion(&sbi->s_kobj_unregister);
+       err = kobject_init_and_add(&sbi->s_kobj, &f2fs_ktype, NULL,
+                                                       "%s", sb->s_id);
+       if (err)
+               goto fail;
+
        return 0;
 fail:
        stop_gc_thread(sbi);
@@ -841,29 +1018,49 @@ static int __init init_f2fs_fs(void)
                goto fail;
        err = create_node_manager_caches();
        if (err)
-               goto fail;
+               goto free_inodecache;
        err = create_gc_caches();
        if (err)
-               goto fail;
+               goto free_node_manager_caches;
        err = create_checkpoint_caches();
        if (err)
-               goto fail;
+               goto free_gc_caches;
+       f2fs_kset = kset_create_and_add("f2fs", NULL, fs_kobj);
+       if (!f2fs_kset) {
+               err = -ENOMEM;
+               goto free_checkpoint_caches;
+       }
        err = register_filesystem(&f2fs_fs_type);
        if (err)
-               goto fail;
+               goto free_kset;
        f2fs_create_root_stats();
+       f2fs_proc_root = proc_mkdir("fs/f2fs", NULL);
+       return 0;
+
+free_kset:
+       kset_unregister(f2fs_kset);
+free_checkpoint_caches:
+       destroy_checkpoint_caches();
+free_gc_caches:
+       destroy_gc_caches();
+free_node_manager_caches:
+       destroy_node_manager_caches();
+free_inodecache:
+       destroy_inodecache();
 fail:
        return err;
 }
 
 static void __exit exit_f2fs_fs(void)
 {
+       remove_proc_entry("fs/f2fs", NULL);
        f2fs_destroy_root_stats();
        unregister_filesystem(&f2fs_fs_type);
        destroy_checkpoint_caches();
        destroy_gc_caches();
        destroy_node_manager_caches();
        destroy_inodecache();
+       kset_unregister(f2fs_kset);
 }
 
 module_init(init_f2fs_fs)
index 3ab07ec..1ac8a5f 100644 (file)
@@ -246,40 +246,170 @@ static inline const struct xattr_handler *f2fs_xattr_handler(int name_index)
        return handler;
 }
 
+static struct f2fs_xattr_entry *__find_xattr(void *base_addr, int name_index,
+                                       size_t name_len, const char *name)
+{
+       struct f2fs_xattr_entry *entry;
+
+       list_for_each_xattr(entry, base_addr) {
+               if (entry->e_name_index != name_index)
+                       continue;
+               if (entry->e_name_len != name_len)
+                       continue;
+               if (!memcmp(entry->e_name, name, name_len))
+                       break;
+       }
+       return entry;
+}
+
+static void *read_all_xattrs(struct inode *inode, struct page *ipage)
+{
+       struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
+       struct f2fs_xattr_header *header;
+       size_t size = PAGE_SIZE, inline_size = 0;
+       void *txattr_addr;
+
+       inline_size = inline_xattr_size(inode);
+
+       txattr_addr = kzalloc(inline_size + size, GFP_KERNEL);
+       if (!txattr_addr)
+               return NULL;
+
+       /* read from inline xattr */
+       if (inline_size) {
+               struct page *page = NULL;
+               void *inline_addr;
+
+               if (ipage) {
+                       inline_addr = inline_xattr_addr(ipage);
+               } else {
+                       page = get_node_page(sbi, inode->i_ino);
+                       if (IS_ERR(page))
+                               goto fail;
+                       inline_addr = inline_xattr_addr(page);
+               }
+               memcpy(txattr_addr, inline_addr, inline_size);
+               f2fs_put_page(page, 1);
+       }
+
+       /* read from xattr node block */
+       if (F2FS_I(inode)->i_xattr_nid) {
+               struct page *xpage;
+               void *xattr_addr;
+
+               /* The inode already has an extended attribute block. */
+               xpage = get_node_page(sbi, F2FS_I(inode)->i_xattr_nid);
+               if (IS_ERR(xpage))
+                       goto fail;
+
+               xattr_addr = page_address(xpage);
+               memcpy(txattr_addr + inline_size, xattr_addr, PAGE_SIZE);
+               f2fs_put_page(xpage, 1);
+       }
+
+       header = XATTR_HDR(txattr_addr);
+
+       /* never been allocated xattrs */
+       if (le32_to_cpu(header->h_magic) != F2FS_XATTR_MAGIC) {
+               header->h_magic = cpu_to_le32(F2FS_XATTR_MAGIC);
+               header->h_refcount = cpu_to_le32(1);
+       }
+       return txattr_addr;
+fail:
+       kzfree(txattr_addr);
+       return NULL;
+}
+
+static inline int write_all_xattrs(struct inode *inode, __u32 hsize,
+                               void *txattr_addr, struct page *ipage)
+{
+       struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
+       size_t inline_size = 0;
+       void *xattr_addr;
+       struct page *xpage;
+       nid_t new_nid = 0;
+       int err;
+
+       inline_size = inline_xattr_size(inode);
+
+       if (hsize > inline_size && !F2FS_I(inode)->i_xattr_nid)
+               if (!alloc_nid(sbi, &new_nid))
+                       return -ENOSPC;
+
+       /* write to inline xattr */
+       if (inline_size) {
+               struct page *page = NULL;
+               void *inline_addr;
+
+               if (ipage) {
+                       inline_addr = inline_xattr_addr(ipage);
+               } else {
+                       page = get_node_page(sbi, inode->i_ino);
+                       if (IS_ERR(page)) {
+                               alloc_nid_failed(sbi, new_nid);
+                               return PTR_ERR(page);
+                       }
+                       inline_addr = inline_xattr_addr(page);
+               }
+               memcpy(inline_addr, txattr_addr, inline_size);
+               f2fs_put_page(page, 1);
+
+               /* no need to use xattr node block */
+               if (hsize <= inline_size) {
+                       err = truncate_xattr_node(inode, ipage);
+                       alloc_nid_failed(sbi, new_nid);
+                       return err;
+               }
+       }
+
+       /* write to xattr node block */
+       if (F2FS_I(inode)->i_xattr_nid) {
+               xpage = get_node_page(sbi, F2FS_I(inode)->i_xattr_nid);
+               if (IS_ERR(xpage)) {
+                       alloc_nid_failed(sbi, new_nid);
+                       return PTR_ERR(xpage);
+               }
+               BUG_ON(new_nid);
+       } else {
+               struct dnode_of_data dn;
+               set_new_dnode(&dn, inode, NULL, NULL, new_nid);
+               xpage = new_node_page(&dn, XATTR_NODE_OFFSET, ipage);
+               if (IS_ERR(xpage)) {
+                       alloc_nid_failed(sbi, new_nid);
+                       return PTR_ERR(xpage);
+               }
+               alloc_nid_done(sbi, new_nid);
+       }
+
+       xattr_addr = page_address(xpage);
+       memcpy(xattr_addr, txattr_addr + inline_size, PAGE_SIZE -
+                                               sizeof(struct node_footer));
+       set_page_dirty(xpage);
+       f2fs_put_page(xpage, 1);
+
+       /* need to checkpoint during fsync */
+       F2FS_I(inode)->xattr_ver = cur_cp_version(F2FS_CKPT(sbi));
+       return 0;
+}
+
 int f2fs_getxattr(struct inode *inode, int name_index, const char *name,
                void *buffer, size_t buffer_size)
 {
-       struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
-       struct f2fs_inode_info *fi = F2FS_I(inode);
        struct f2fs_xattr_entry *entry;
-       struct page *page;
        void *base_addr;
-       int error = 0, found = 0;
+       int error = 0;
        size_t value_len, name_len;
 
        if (name == NULL)
                return -EINVAL;
        name_len = strlen(name);
 
-       if (!fi->i_xattr_nid)
-               return -ENODATA;
+       base_addr = read_all_xattrs(inode, NULL);
+       if (!base_addr)
+               return -ENOMEM;
 
-       page = get_node_page(sbi, fi->i_xattr_nid);
-       if (IS_ERR(page))
-               return PTR_ERR(page);
-       base_addr = page_address(page);
-
-       list_for_each_xattr(entry, base_addr) {
-               if (entry->e_name_index != name_index)
-                       continue;
-               if (entry->e_name_len != name_len)
-                       continue;
-               if (!memcmp(entry->e_name, name, name_len)) {
-                       found = 1;
-                       break;
-               }
-       }
-       if (!found) {
+       entry = __find_xattr(base_addr, name_index, name_len, name);
+       if (IS_XATTR_LAST_ENTRY(entry)) {
                error = -ENODATA;
                goto cleanup;
        }
@@ -298,28 +428,21 @@ int f2fs_getxattr(struct inode *inode, int name_index, const char *name,
        error = value_len;
 
 cleanup:
-       f2fs_put_page(page, 1);
+       kzfree(base_addr);
        return error;
 }
 
 ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
 {
        struct inode *inode = dentry->d_inode;
-       struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
-       struct f2fs_inode_info *fi = F2FS_I(inode);
        struct f2fs_xattr_entry *entry;
-       struct page *page;
        void *base_addr;
        int error = 0;
        size_t rest = buffer_size;
 
-       if (!fi->i_xattr_nid)
-               return 0;
-
-       page = get_node_page(sbi, fi->i_xattr_nid);
-       if (IS_ERR(page))
-               return PTR_ERR(page);
-       base_addr = page_address(page);
+       base_addr = read_all_xattrs(inode, NULL);
+       if (!base_addr)
+               return -ENOMEM;
 
        list_for_each_xattr(entry, base_addr) {
                const struct xattr_handler *handler =
@@ -342,7 +465,7 @@ ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
        }
        error = buffer_size - rest;
 cleanup:
-       f2fs_put_page(page, 1);
+       kzfree(base_addr);
        return error;
 }
 
@@ -351,14 +474,13 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
 {
        struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
        struct f2fs_inode_info *fi = F2FS_I(inode);
-       struct f2fs_xattr_header *header = NULL;
        struct f2fs_xattr_entry *here, *last;
-       struct page *page;
        void *base_addr;
-       int error, found, free, newsize;
+       int found, newsize;
        size_t name_len;
-       char *pval;
        int ilock;
+       __u32 new_hsize;
+       int error = -ENOMEM;
 
        if (name == NULL)
                return -EINVAL;
@@ -368,67 +490,21 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
 
        name_len = strlen(name);
 
-       if (name_len > F2FS_NAME_LEN || value_len > MAX_VALUE_LEN)
+       if (name_len > F2FS_NAME_LEN || value_len > MAX_VALUE_LEN(inode))
                return -ERANGE;
 
        f2fs_balance_fs(sbi);
 
        ilock = mutex_lock_op(sbi);
 
-       if (!fi->i_xattr_nid) {
-               /* Allocate new attribute block */
-               struct dnode_of_data dn;
-
-               if (!alloc_nid(sbi, &fi->i_xattr_nid)) {
-                       error = -ENOSPC;
-                       goto exit;
-               }
-               set_new_dnode(&dn, inode, NULL, NULL, fi->i_xattr_nid);
-               mark_inode_dirty(inode);
-
-               page = new_node_page(&dn, XATTR_NODE_OFFSET, ipage);
-               if (IS_ERR(page)) {
-                       alloc_nid_failed(sbi, fi->i_xattr_nid);
-                       fi->i_xattr_nid = 0;
-                       error = PTR_ERR(page);
-                       goto exit;
-               }
-
-               alloc_nid_done(sbi, fi->i_xattr_nid);
-               base_addr = page_address(page);
-               header = XATTR_HDR(base_addr);
-               header->h_magic = cpu_to_le32(F2FS_XATTR_MAGIC);
-               header->h_refcount = cpu_to_le32(1);
-       } else {
-               /* The inode already has an extended attribute block. */
-               page = get_node_page(sbi, fi->i_xattr_nid);
-               if (IS_ERR(page)) {
-                       error = PTR_ERR(page);
-                       goto exit;
-               }
-
-               base_addr = page_address(page);
-               header = XATTR_HDR(base_addr);
-       }
-
-       if (le32_to_cpu(header->h_magic) != F2FS_XATTR_MAGIC) {
-               error = -EIO;
-               goto cleanup;
-       }
+       base_addr = read_all_xattrs(inode, ipage);
+       if (!base_addr)
+               goto exit;
 
        /* find entry with wanted name. */
-       found = 0;
-       list_for_each_xattr(here, base_addr) {
-               if (here->e_name_index != name_index)
-                       continue;
-               if (here->e_name_len != name_len)
-                       continue;
-               if (!memcmp(here->e_name, name, name_len)) {
-                       found = 1;
-                       break;
-               }
-       }
+       here = __find_xattr(base_addr, name_index, name_len, name);
 
+       found = IS_XATTR_LAST_ENTRY(here) ? 0 : 1;
        last = here;
 
        while (!IS_XATTR_LAST_ENTRY(last))
@@ -439,22 +515,25 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
 
        /* 1. Check space */
        if (value) {
-               /* If value is NULL, it is remove operation.
+               int free;
+               /*
+                * If value is NULL, it is remove operation.
                 * In case of update operation, we caculate free.
                 */
-               free = MIN_OFFSET - ((char *)last - (char *)header);
+               free = MIN_OFFSET(inode) - ((char *)last - (char *)base_addr);
                if (found)
                        free = free - ENTRY_SIZE(here);
 
                if (free < newsize) {
                        error = -ENOSPC;
-                       goto cleanup;
+                       goto exit;
                }
        }
 
        /* 2. Remove old entry */
        if (found) {
-               /* If entry is found, remove old entry.
+               /*
+                * If entry is found, remove old entry.
                 * If not found, remove operation is not needed.
                 */
                struct f2fs_xattr_entry *next = XATTR_NEXT_ENTRY(here);
@@ -465,10 +544,15 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
                memset(last, 0, oldsize);
        }
 
+       new_hsize = (char *)last - (char *)base_addr;
+
        /* 3. Write new entry */
        if (value) {
-               /* Before we come here, old entry is removed.
-                * We just write new entry. */
+               char *pval;
+               /*
+                * Before we come here, old entry is removed.
+                * We just write new entry.
+                */
                memset(last, 0, newsize);
                last->e_name_index = name_index;
                last->e_name_len = name_len;
@@ -476,26 +560,25 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name,
                pval = last->e_name + name_len;
                memcpy(pval, value, value_len);
                last->e_value_size = cpu_to_le16(value_len);
+               new_hsize += newsize;
        }
 
-       set_page_dirty(page);
-       f2fs_put_page(page, 1);
+       error = write_all_xattrs(inode, new_hsize, base_addr, ipage);
+       if (error)
+               goto exit;
 
        if (is_inode_flag_set(fi, FI_ACL_MODE)) {
                inode->i_mode = fi->i_acl_mode;
                inode->i_ctime = CURRENT_TIME;
                clear_inode_flag(fi, FI_ACL_MODE);
        }
+
        if (ipage)
                update_inode(inode, ipage);
        else
                update_inode_page(inode);
-       mutex_unlock_op(sbi, ilock);
-
-       return 0;
-cleanup:
-       f2fs_put_page(page, 1);
 exit:
        mutex_unlock_op(sbi, ilock);
+       kzfree(base_addr);
        return error;
 }
index 3c0817b..02a08fb 100644 (file)
@@ -51,7 +51,7 @@ struct f2fs_xattr_entry {
 
 #define XATTR_HDR(ptr)         ((struct f2fs_xattr_header *)(ptr))
 #define XATTR_ENTRY(ptr)       ((struct f2fs_xattr_entry *)(ptr))
-#define XATTR_FIRST_ENTRY(ptr) (XATTR_ENTRY(XATTR_HDR(ptr)+1))
+#define XATTR_FIRST_ENTRY(ptr) (XATTR_ENTRY(XATTR_HDR(ptr) + 1))
 #define XATTR_ROUND            (3)
 
 #define XATTR_ALIGN(size)      ((size + XATTR_ROUND) & ~XATTR_ROUND)
@@ -69,17 +69,16 @@ struct f2fs_xattr_entry {
                                !IS_XATTR_LAST_ENTRY(entry);\
                                entry = XATTR_NEXT_ENTRY(entry))
 
+#define MIN_OFFSET(i)  XATTR_ALIGN(inline_xattr_size(i) + PAGE_SIZE -  \
+                               sizeof(struct node_footer) - sizeof(__u32))
 
-#define MIN_OFFSET     XATTR_ALIGN(PAGE_SIZE - \
-                       sizeof(struct node_footer) - \
-                       sizeof(__u32))
-
-#define MAX_VALUE_LEN  (MIN_OFFSET - sizeof(struct f2fs_xattr_header) - \
-                       sizeof(struct f2fs_xattr_entry))
+#define MAX_VALUE_LEN(i)       (MIN_OFFSET(i) -                        \
+                               sizeof(struct f2fs_xattr_header) -      \
+                               sizeof(struct f2fs_xattr_entry))
 
 /*
  * On-disk structure of f2fs_xattr
- * We use only 1 block for xattr.
+ * We use inline xattrs space + 1 block for xattr.
  *
  * +--------------------+
  * | f2fs_xattr_header  |
index 0cb4c15..2e5fc26 100644 (file)
@@ -1859,7 +1859,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
 
        memset(&rlist, 0, sizeof(struct gfs2_rgrp_list));
 
-       ht = kzalloc(size, GFP_NOFS);
+       ht = kzalloc(size, GFP_NOFS | __GFP_NOWARN);
        if (ht == NULL)
                ht = vzalloc(size);
        if (!ht)
index c348d6d..e5d408a 100644 (file)
@@ -117,8 +117,8 @@ static void destroy_inodecache(void)
 
 static int isofs_remount(struct super_block *sb, int *flags, char *data)
 {
-       /* we probably want a lot more here */
-       *flags |= MS_RDONLY;
+       if (!(*flags & MS_RDONLY))
+               return -EROFS;
        return 0;
 }
 
@@ -763,15 +763,6 @@ root_found:
         */
        s->s_maxbytes = 0x80000000000LL;
 
-       /*
-        * The CDROM is read-only, has no nodes (devices) on it, and since
-        * all of the files appear to be owned by root, we really do not want
-        * to allow suid.  (suid or devices will not show up unless we have
-        * Rock Ridge extensions)
-        */
-
-       s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */;
-
        /* Set this for reference. Its not currently used except on write
           which we don't have .. */
 
@@ -1530,6 +1521,9 @@ struct inode *isofs_iget(struct super_block *sb,
 static struct dentry *isofs_mount(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data)
 {
+       /* We don't support read-write mounts */
+       if (!(flags & MS_RDONLY))
+               return ERR_PTR(-EACCES);
        return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
 }
 
index 11bb11f..bb217dc 100644 (file)
@@ -340,13 +340,13 @@ void journal_commit_transaction(journal_t *journal)
        J_ASSERT(journal->j_committing_transaction == NULL);
 
        commit_transaction = journal->j_running_transaction;
-       J_ASSERT(commit_transaction->t_state == T_RUNNING);
 
        trace_jbd_start_commit(journal, commit_transaction);
        jbd_debug(1, "JBD: starting commit of transaction %d\n",
                        commit_transaction->t_tid);
 
        spin_lock(&journal->j_state_lock);
+       J_ASSERT(commit_transaction->t_state == T_RUNNING);
        commit_transaction->t_state = T_LOCKED;
 
        trace_jbd_commit_locking(journal, commit_transaction);
index 6510d63..2d04f9a 100644 (file)
@@ -90,6 +90,24 @@ static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
 static void __journal_abort_soft (journal_t *journal, int errno);
 static const char *journal_dev_name(journal_t *journal, char *buffer);
 
+#ifdef CONFIG_JBD_DEBUG
+void __jbd_debug(int level, const char *file, const char *func,
+                unsigned int line, const char *fmt, ...)
+{
+       struct va_format vaf;
+       va_list args;
+
+       if (level > journal_enable_debug)
+               return;
+       va_start(args, fmt);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+       printk(KERN_DEBUG "%s: (%s, %u): %pV\n", file, func, line, &vaf);
+       va_end(args);
+}
+EXPORT_SYMBOL(__jbd_debug);
+#endif
+
 /*
  * Helper function used to manage commit timeouts
  */
index a98b774..dc9a682 100644 (file)
@@ -423,8 +423,11 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
        set_sb_free_blocks(rs, sb_free_blocks(rs) + 1);
 
        journal_mark_dirty(th, s, sbh);
-       if (for_unformatted)
+       if (for_unformatted) {
+               int depth = reiserfs_write_unlock_nested(s);
                dquot_free_block_nodirty(inode, 1);
+               reiserfs_write_lock_nested(s, depth);
+       }
 }
 
 void reiserfs_free_block(struct reiserfs_transaction_handle *th,
@@ -1128,6 +1131,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
        b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1;
        int passno = 0;
        int nr_allocated = 0;
+       int depth;
 
        determine_prealloc_size(hint);
        if (!hint->formatted_node) {
@@ -1137,10 +1141,13 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
                               "reiserquota: allocating %d blocks id=%u",
                               amount_needed, hint->inode->i_uid);
 #endif
+               depth = reiserfs_write_unlock_nested(s);
                quota_ret =
                    dquot_alloc_block_nodirty(hint->inode, amount_needed);
-               if (quota_ret)  /* Quota exceeded? */
+               if (quota_ret) {        /* Quota exceeded? */
+                       reiserfs_write_lock_nested(s, depth);
                        return QUOTA_EXCEEDED;
+               }
                if (hint->preallocate && hint->prealloc_size) {
 #ifdef REISERQUOTA_DEBUG
                        reiserfs_debug(s, REISERFS_DEBUG_CODE,
@@ -1153,6 +1160,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
                                hint->preallocate = hint->prealloc_size = 0;
                }
                /* for unformatted nodes, force large allocations */
+               reiserfs_write_lock_nested(s, depth);
        }
 
        do {
@@ -1181,9 +1189,11 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
                                               hint->inode->i_uid);
 #endif
                                /* Free not allocated blocks */
+                               depth = reiserfs_write_unlock_nested(s);
                                dquot_free_block_nodirty(hint->inode,
                                        amount_needed + hint->prealloc_size -
                                        nr_allocated);
+                               reiserfs_write_lock_nested(s, depth);
                        }
                        while (nr_allocated--)
                                reiserfs_free_block(hint->th, hint->inode,
@@ -1214,10 +1224,13 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
                               REISERFS_I(hint->inode)->i_prealloc_count,
                               hint->inode->i_uid);
 #endif
+
+               depth = reiserfs_write_unlock_nested(s);
                dquot_free_block_nodirty(hint->inode, amount_needed +
                                         hint->prealloc_size - nr_allocated -
                                         REISERFS_I(hint->inode)->
                                         i_prealloc_count);
+               reiserfs_write_lock_nested(s, depth);
        }
 
        return CARRY_ON;
@@ -1340,10 +1353,11 @@ struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb,
                                 "reading failed", __func__, block);
        else {
                if (buffer_locked(bh)) {
+                       int depth;
                        PROC_INFO_INC(sb, scan_bitmap.wait);
-                       reiserfs_write_unlock(sb);
+                       depth = reiserfs_write_unlock_nested(sb);
                        __wait_on_buffer(bh);
-                       reiserfs_write_lock(sb);
+                       reiserfs_write_lock_nested(sb, depth);
                }
                BUG_ON(!buffer_uptodate(bh));
                BUG_ON(atomic_read(&bh->b_count) == 0);
index 03e4ca5..1fd2051 100644 (file)
@@ -71,6 +71,7 @@ int reiserfs_readdir_inode(struct inode *inode, struct dir_context *ctx)
        char small_buf[32];     /* avoid kmalloc if we can */
        struct reiserfs_dir_entry de;
        int ret = 0;
+       int depth;
 
        reiserfs_write_lock(inode->i_sb);
 
@@ -181,17 +182,17 @@ int reiserfs_readdir_inode(struct inode *inode, struct dir_context *ctx)
                                 * Since filldir might sleep, we can release
                                 * the write lock here for other waiters
                                 */
-                               reiserfs_write_unlock(inode->i_sb);
+                               depth = reiserfs_write_unlock_nested(inode->i_sb);
                                if (!dir_emit
                                    (ctx, local_buf, d_reclen, d_ino,
                                     DT_UNKNOWN)) {
-                                       reiserfs_write_lock(inode->i_sb);
+                                       reiserfs_write_lock_nested(inode->i_sb, depth);
                                        if (local_buf != small_buf) {
                                                kfree(local_buf);
                                        }
                                        goto end;
                                }
-                               reiserfs_write_lock(inode->i_sb);
+                               reiserfs_write_lock_nested(inode->i_sb, depth);
                                if (local_buf != small_buf) {
                                        kfree(local_buf);
                                }
index 430e065..dc4d415 100644 (file)
@@ -1022,9 +1022,9 @@ static int get_far_parent(struct tree_balance *tb,
        if (buffer_locked(*pcom_father)) {
 
                /* Release the write lock while the buffer is busy */
-               reiserfs_write_unlock(tb->tb_sb);
+               int depth = reiserfs_write_unlock_nested(tb->tb_sb);
                __wait_on_buffer(*pcom_father);
-               reiserfs_write_lock(tb->tb_sb);
+               reiserfs_write_lock_nested(tb->tb_sb, depth);
                if (FILESYSTEM_CHANGED_TB(tb)) {
                        brelse(*pcom_father);
                        return REPEAT_SEARCH;
@@ -1929,9 +1929,9 @@ static int get_direct_parent(struct tree_balance *tb, int h)
                return REPEAT_SEARCH;
 
        if (buffer_locked(bh)) {
-               reiserfs_write_unlock(tb->tb_sb);
+               int depth = reiserfs_write_unlock_nested(tb->tb_sb);
                __wait_on_buffer(bh);
-               reiserfs_write_lock(tb->tb_sb);
+               reiserfs_write_lock_nested(tb->tb_sb, depth);
                if (FILESYSTEM_CHANGED_TB(tb))
                        return REPEAT_SEARCH;
        }
@@ -1952,6 +1952,7 @@ static int get_neighbors(struct tree_balance *tb, int h)
        unsigned long son_number;
        struct super_block *sb = tb->tb_sb;
        struct buffer_head *bh;
+       int depth;
 
        PROC_INFO_INC(sb, get_neighbors[h]);
 
@@ -1969,9 +1970,9 @@ static int get_neighbors(struct tree_balance *tb, int h)
                     tb->FL[h]) ? tb->lkey[h] : B_NR_ITEMS(tb->
                                                                       FL[h]);
                son_number = B_N_CHILD_NUM(tb->FL[h], child_position);
-               reiserfs_write_unlock(sb);
+               depth = reiserfs_write_unlock_nested(tb->tb_sb);
                bh = sb_bread(sb, son_number);
-               reiserfs_write_lock(sb);
+               reiserfs_write_lock_nested(tb->tb_sb, depth);
                if (!bh)
                        return IO_ERROR;
                if (FILESYSTEM_CHANGED_TB(tb)) {
@@ -2009,9 +2010,9 @@ static int get_neighbors(struct tree_balance *tb, int h)
                child_position =
                    (bh == tb->FR[h]) ? tb->rkey[h] + 1 : 0;
                son_number = B_N_CHILD_NUM(tb->FR[h], child_position);
-               reiserfs_write_unlock(sb);
+               depth = reiserfs_write_unlock_nested(tb->tb_sb);
                bh = sb_bread(sb, son_number);
-               reiserfs_write_lock(sb);
+               reiserfs_write_lock_nested(tb->tb_sb, depth);
                if (!bh)
                        return IO_ERROR;
                if (FILESYSTEM_CHANGED_TB(tb)) {
@@ -2272,6 +2273,7 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *tb)
                }
 
                if (locked) {
+                       int depth;
 #ifdef CONFIG_REISERFS_CHECK
                        repeat_counter++;
                        if ((repeat_counter % 10000) == 0) {
@@ -2286,9 +2288,9 @@ static int wait_tb_buffers_until_unlocked(struct tree_balance *tb)
                                    REPEAT_SEARCH : CARRY_ON;
                        }
 #endif
-                       reiserfs_write_unlock(tb->tb_sb);
+                       depth = reiserfs_write_unlock_nested(tb->tb_sb);
                        __wait_on_buffer(locked);
-                       reiserfs_write_lock(tb->tb_sb);
+                       reiserfs_write_lock_nested(tb->tb_sb, depth);
                        if (FILESYSTEM_CHANGED_TB(tb))
                                return REPEAT_SEARCH;
                }
@@ -2359,9 +2361,9 @@ int fix_nodes(int op_mode, struct tree_balance *tb,
 
        /* if it possible in indirect_to_direct conversion */
        if (buffer_locked(tbS0)) {
-               reiserfs_write_unlock(tb->tb_sb);
+               int depth = reiserfs_write_unlock_nested(tb->tb_sb);
                __wait_on_buffer(tbS0);
-               reiserfs_write_lock(tb->tb_sb);
+               reiserfs_write_lock_nested(tb->tb_sb, depth);
                if (FILESYSTEM_CHANGED_TB(tb))
                        return REPEAT_SEARCH;
        }
index 0048cc1..ad62bdb 100644 (file)
@@ -30,7 +30,6 @@ void reiserfs_evict_inode(struct inode *inode)
            JOURNAL_PER_BALANCE_CNT * 2 +
            2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb);
        struct reiserfs_transaction_handle th;
-       int depth;
        int err;
 
        if (!inode->i_nlink && !is_bad_inode(inode))
@@ -40,12 +39,13 @@ void reiserfs_evict_inode(struct inode *inode)
        if (inode->i_nlink)
                goto no_delete;
 
-       depth = reiserfs_write_lock_once(inode->i_sb);
-
        /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
        if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) {  /* also handles bad_inode case */
+
                reiserfs_delete_xattrs(inode);
 
+               reiserfs_write_lock(inode->i_sb);
+
                if (journal_begin(&th, inode->i_sb, jbegin_count))
                        goto out;
                reiserfs_update_inode_transaction(inode);
@@ -57,8 +57,11 @@ void reiserfs_evict_inode(struct inode *inode)
                /* Do quota update inside a transaction for journaled quotas. We must do that
                 * after delete_object so that quota updates go into the same transaction as
                 * stat data deletion */
-               if (!err) 
+               if (!err) {
+                       int depth = reiserfs_write_unlock_nested(inode->i_sb);
                        dquot_free_inode(inode);
+                       reiserfs_write_lock_nested(inode->i_sb, depth);
+               }
 
                if (journal_end(&th, inode->i_sb, jbegin_count))
                        goto out;
@@ -72,12 +75,12 @@ void reiserfs_evict_inode(struct inode *inode)
                /* all items of file are deleted, so we can remove "save" link */
                remove_save_link(inode, 0 /* not truncate */ ); /* we can't do anything
                                                                 * about an error here */
+out:
+               reiserfs_write_unlock(inode->i_sb);
        } else {
                /* no object items are in the tree */
                ;
        }
-      out:
-       reiserfs_write_unlock_once(inode->i_sb, depth);
        clear_inode(inode);     /* note this must go after the journal_end to prevent deadlock */
        dquot_drop(inode);
        inode->i_blocks = 0;
@@ -610,7 +613,6 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
        __le32 *item;
        int done;
        int fs_gen;
-       int lock_depth;
        struct reiserfs_transaction_handle *th = NULL;
        /* space reserved in transaction batch:
           . 3 balancings in direct->indirect conversion
@@ -626,11 +628,11 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
        loff_t new_offset =
            (((loff_t) block) << inode->i_sb->s_blocksize_bits) + 1;
 
-       lock_depth = reiserfs_write_lock_once(inode->i_sb);
+       reiserfs_write_lock(inode->i_sb);
        version = get_inode_item_key_version(inode);
 
        if (!file_capable(inode, block)) {
-               reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+               reiserfs_write_unlock(inode->i_sb);
                return -EFBIG;
        }
 
@@ -642,7 +644,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
                /* find number of block-th logical block of the file */
                ret = _get_block_create_0(inode, block, bh_result,
                                          create | GET_BLOCK_READ_DIRECT);
-               reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+               reiserfs_write_unlock(inode->i_sb);
                return ret;
        }
        /*
@@ -760,7 +762,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
                if (!dangle && th)
                        retval = reiserfs_end_persistent_transaction(th);
 
-               reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+               reiserfs_write_unlock(inode->i_sb);
 
                /* the item was found, so new blocks were not added to the file
                 ** there is no need to make sure the inode is updated with this
@@ -1011,11 +1013,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
                 * long time.  reschedule if needed and also release the write
                 * lock for others.
                 */
-               if (need_resched()) {
-                       reiserfs_write_unlock_once(inode->i_sb, lock_depth);
-                       schedule();
-                       lock_depth = reiserfs_write_lock_once(inode->i_sb);
-               }
+               reiserfs_cond_resched(inode->i_sb);
 
                retval = search_for_position_by_key(inode->i_sb, &key, &path);
                if (retval == IO_ERROR) {
@@ -1050,7 +1048,7 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
                        retval = err;
        }
 
-       reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+       reiserfs_write_unlock(inode->i_sb);
        reiserfs_check_path(&path);
        return retval;
 }
@@ -1509,14 +1507,15 @@ struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key)
 {
        struct inode *inode;
        struct reiserfs_iget_args args;
+       int depth;
 
        args.objectid = key->on_disk_key.k_objectid;
        args.dirid = key->on_disk_key.k_dir_id;
-       reiserfs_write_unlock(s);
+       depth = reiserfs_write_unlock_nested(s);
        inode = iget5_locked(s, key->on_disk_key.k_objectid,
                             reiserfs_find_actor, reiserfs_init_locked_inode,
                             (void *)(&args));
-       reiserfs_write_lock(s);
+       reiserfs_write_lock_nested(s, depth);
        if (!inode)
                return ERR_PTR(-ENOMEM);
 
@@ -1772,7 +1771,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
                       struct inode *inode,
                       struct reiserfs_security_handle *security)
 {
-       struct super_block *sb;
+       struct super_block *sb = dir->i_sb;
        struct reiserfs_iget_args args;
        INITIALIZE_PATH(path_to_key);
        struct cpu_key key;
@@ -1780,12 +1779,13 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
        struct stat_data sd;
        int retval;
        int err;
+       int depth;
 
        BUG_ON(!th->t_trans_id);
 
-       reiserfs_write_unlock(inode->i_sb);
+       depth = reiserfs_write_unlock_nested(sb);
        err = dquot_alloc_inode(inode);
-       reiserfs_write_lock(inode->i_sb);
+       reiserfs_write_lock_nested(sb, depth);
        if (err)
                goto out_end_trans;
        if (!dir->i_nlink) {
@@ -1793,8 +1793,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
                goto out_bad_inode;
        }
 
-       sb = dir->i_sb;
-
        /* item head of new item */
        ih.ih_key.k_dir_id = reiserfs_choose_packing(dir);
        ih.ih_key.k_objectid = cpu_to_le32(reiserfs_get_unused_objectid(th));
@@ -1812,10 +1810,10 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
        memcpy(INODE_PKEY(inode), &(ih.ih_key), KEY_SIZE);
        args.dirid = le32_to_cpu(ih.ih_key.k_dir_id);
 
-       reiserfs_write_unlock(inode->i_sb);
+       depth = reiserfs_write_unlock_nested(inode->i_sb);
        err = insert_inode_locked4(inode, args.objectid,
                             reiserfs_find_actor, &args);
-       reiserfs_write_lock(inode->i_sb);
+       reiserfs_write_lock_nested(inode->i_sb, depth);
        if (err) {
                err = -EINVAL;
                goto out_bad_inode;
@@ -1941,7 +1939,9 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
        }
 
        if (reiserfs_posixacl(inode->i_sb)) {
+               reiserfs_write_unlock(inode->i_sb);
                retval = reiserfs_inherit_default_acl(th, dir, dentry, inode);
+               reiserfs_write_lock(inode->i_sb);
                if (retval) {
                        err = retval;
                        reiserfs_check_path(&path_to_key);
@@ -1956,7 +1956,9 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
                inode->i_flags |= S_PRIVATE;
 
        if (security->name) {
+               reiserfs_write_unlock(inode->i_sb);
                retval = reiserfs_security_write(th, inode, security);
+               reiserfs_write_lock(inode->i_sb);
                if (retval) {
                        err = retval;
                        reiserfs_check_path(&path_to_key);
@@ -1982,14 +1984,16 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
        INODE_PKEY(inode)->k_objectid = 0;
 
        /* Quota change must be inside a transaction for journaling */
+       depth = reiserfs_write_unlock_nested(inode->i_sb);
        dquot_free_inode(inode);
+       reiserfs_write_lock_nested(inode->i_sb, depth);
 
       out_end_trans:
        journal_end(th, th->t_super, th->t_blocks_allocated);
-       reiserfs_write_unlock(inode->i_sb);
        /* Drop can be outside and it needs more credits so it's better to have it outside */
+       depth = reiserfs_write_unlock_nested(inode->i_sb);
        dquot_drop(inode);
-       reiserfs_write_lock(inode->i_sb);
+       reiserfs_write_lock_nested(inode->i_sb, depth);
        inode->i_flags |= S_NOQUOTA;
        make_bad_inode(inode);
 
@@ -2103,9 +2107,8 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps)
        int error;
        struct buffer_head *bh = NULL;
        int err2;
-       int lock_depth;
 
-       lock_depth = reiserfs_write_lock_once(inode->i_sb);
+       reiserfs_write_lock(inode->i_sb);
 
        if (inode->i_size > 0) {
                error = grab_tail_page(inode, &page, &bh);
@@ -2174,7 +2177,7 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps)
                page_cache_release(page);
        }
 
-       reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+       reiserfs_write_unlock(inode->i_sb);
 
        return 0;
       out:
@@ -2183,7 +2186,7 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps)
                page_cache_release(page);
        }
 
-       reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+       reiserfs_write_unlock(inode->i_sb);
 
        return error;
 }
@@ -2648,10 +2651,11 @@ int __reiserfs_write_begin(struct page *page, unsigned from, unsigned len)
        struct inode *inode = page->mapping->host;
        int ret;
        int old_ref = 0;
+       int depth;
 
-       reiserfs_write_unlock(inode->i_sb);
+       depth = reiserfs_write_unlock_nested(inode->i_sb);
        reiserfs_wait_on_write_block(inode->i_sb);
-       reiserfs_write_lock(inode->i_sb);
+       reiserfs_write_lock_nested(inode->i_sb, depth);
 
        fix_tail_page_for_writing(page);
        if (reiserfs_transaction_running(inode->i_sb)) {
@@ -2708,7 +2712,6 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
        int update_sd = 0;
        struct reiserfs_transaction_handle *th;
        unsigned start;
-       int lock_depth = 0;
        bool locked = false;
 
        if ((unsigned long)fsdata & AOP_FLAG_CONT_EXPAND)
@@ -2737,7 +2740,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
         */
        if (pos + copied > inode->i_size) {
                struct reiserfs_transaction_handle myth;
-               lock_depth = reiserfs_write_lock_once(inode->i_sb);
+               reiserfs_write_lock(inode->i_sb);
                locked = true;
                /* If the file have grown beyond the border where it
                   can have a tail, unmark it as needing a tail
@@ -2768,7 +2771,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
        }
        if (th) {
                if (!locked) {
-                       lock_depth = reiserfs_write_lock_once(inode->i_sb);
+                       reiserfs_write_lock(inode->i_sb);
                        locked = true;
                }
                if (!update_sd)
@@ -2780,7 +2783,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
 
       out:
        if (locked)
-               reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+               reiserfs_write_unlock(inode->i_sb);
        unlock_page(page);
        page_cache_release(page);
 
@@ -2790,7 +2793,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
        return ret == 0 ? copied : ret;
 
       journal_error:
-       reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+       reiserfs_write_unlock(inode->i_sb);
        locked = false;
        if (th) {
                if (!update_sd)
@@ -2808,10 +2811,11 @@ int reiserfs_commit_write(struct file *f, struct page *page,
        int ret = 0;
        int update_sd = 0;
        struct reiserfs_transaction_handle *th = NULL;
+       int depth;
 
-       reiserfs_write_unlock(inode->i_sb);
+       depth = reiserfs_write_unlock_nested(inode->i_sb);
        reiserfs_wait_on_write_block(inode->i_sb);
-       reiserfs_write_lock(inode->i_sb);
+       reiserfs_write_lock_nested(inode->i_sb, depth);
 
        if (reiserfs_transaction_running(inode->i_sb)) {
                th = current->journal_info;
@@ -3110,7 +3114,6 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
 {
        struct inode *inode = dentry->d_inode;
        unsigned int ia_valid;
-       int depth;
        int error;
 
        error = inode_change_ok(inode, attr);
@@ -3122,13 +3125,14 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
 
        if (is_quota_modification(inode, attr))
                dquot_initialize(inode);
-       depth = reiserfs_write_lock_once(inode->i_sb);
+       reiserfs_write_lock(inode->i_sb);
        if (attr->ia_valid & ATTR_SIZE) {
                /* version 2 items will be caught by the s_maxbytes check
                 ** done for us in vmtruncate
                 */
                if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5 &&
                    attr->ia_size > MAX_NON_LFS) {
+                       reiserfs_write_unlock(inode->i_sb);
                        error = -EFBIG;
                        goto out;
                }
@@ -3150,8 +3154,10 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
                                if (err)
                                        error = err;
                        }
-                       if (error)
+                       if (error) {
+                               reiserfs_write_unlock(inode->i_sb);
                                goto out;
+                       }
                        /*
                         * file size is changed, ctime and mtime are
                         * to be updated
@@ -3159,6 +3165,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
                        attr->ia_valid |= (ATTR_MTIME | ATTR_CTIME);
                }
        }
+       reiserfs_write_unlock(inode->i_sb);
 
        if ((((attr->ia_valid & ATTR_UID) && (from_kuid(&init_user_ns, attr->ia_uid) & ~0xffff)) ||
             ((attr->ia_valid & ATTR_GID) && (from_kgid(&init_user_ns, attr->ia_gid) & ~0xffff))) &&
@@ -3183,14 +3190,16 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
                        return error;
 
                /* (user+group)*(old+new) structure - we count quota info and , inode write (sb, inode) */
+               reiserfs_write_lock(inode->i_sb);
                error = journal_begin(&th, inode->i_sb, jbegin_count);
+               reiserfs_write_unlock(inode->i_sb);
                if (error)
                        goto out;
-               reiserfs_write_unlock_once(inode->i_sb, depth);
                error = dquot_transfer(inode, attr);
-               depth = reiserfs_write_lock_once(inode->i_sb);
+               reiserfs_write_lock(inode->i_sb);
                if (error) {
                        journal_end(&th, inode->i_sb, jbegin_count);
+                       reiserfs_write_unlock(inode->i_sb);
                        goto out;
                }
 
@@ -3202,17 +3211,11 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
                        inode->i_gid = attr->ia_gid;
                mark_inode_dirty(inode);
                error = journal_end(&th, inode->i_sb, jbegin_count);
+               reiserfs_write_unlock(inode->i_sb);
                if (error)
                        goto out;
        }
 
-       /*
-        * Relax the lock here, as it might truncate the
-        * inode pages and wait for inode pages locks.
-        * To release such page lock, the owner needs the
-        * reiserfs lock
-        */
-       reiserfs_write_unlock_once(inode->i_sb, depth);
        if ((attr->ia_valid & ATTR_SIZE) &&
            attr->ia_size != i_size_read(inode)) {
                error = inode_newsize_ok(inode, attr->ia_size);
@@ -3226,16 +3229,13 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
                setattr_copy(inode, attr);
                mark_inode_dirty(inode);
        }
-       depth = reiserfs_write_lock_once(inode->i_sb);
 
        if (!error && reiserfs_posixacl(inode->i_sb)) {
                if (attr->ia_valid & ATTR_MODE)
                        error = reiserfs_acl_chmod(inode);
        }
 
-      out:
-       reiserfs_write_unlock_once(inode->i_sb, depth);
-
+out:
        return error;
 }
 
index 15cb5fe..946ccbf 100644 (file)
@@ -167,7 +167,6 @@ int reiserfs_commit_write(struct file *f, struct page *page,
 int reiserfs_unpack(struct inode *inode, struct file *filp)
 {
        int retval = 0;
-       int depth;
        int index;
        struct page *page;
        struct address_space *mapping;
@@ -183,11 +182,11 @@ int reiserfs_unpack(struct inode *inode, struct file *filp)
                return 0;
        }
 
-       depth = reiserfs_write_lock_once(inode->i_sb);
-
        /* we need to make sure nobody is changing the file size beneath us */
        reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb);
 
+       reiserfs_write_lock(inode->i_sb);
+
        write_from = inode->i_size & (blocksize - 1);
        /* if we are on a block boundary, we are already unpacked.  */
        if (write_from == 0) {
@@ -221,6 +220,6 @@ int reiserfs_unpack(struct inode *inode, struct file *filp)
 
       out:
        mutex_unlock(&inode->i_mutex);
-       reiserfs_write_unlock_once(inode->i_sb, depth);
+       reiserfs_write_unlock(inode->i_sb);
        return retval;
 }
index 742fdd4..73feacc 100644 (file)
@@ -947,9 +947,11 @@ static int reiserfs_async_progress_wait(struct super_block *s)
        struct reiserfs_journal *j = SB_JOURNAL(s);
 
        if (atomic_read(&j->j_async_throttle)) {
-               reiserfs_write_unlock(s);
+               int depth;
+
+               depth = reiserfs_write_unlock_nested(s);
                congestion_wait(BLK_RW_ASYNC, HZ / 10);
-               reiserfs_write_lock(s);
+               reiserfs_write_lock_nested(s, depth);
        }
 
        return 0;
@@ -972,6 +974,7 @@ static int flush_commit_list(struct super_block *s,
        struct reiserfs_journal *journal = SB_JOURNAL(s);
        int retval = 0;
        int write_len;
+       int depth;
 
        reiserfs_check_lock_depth(s, "flush_commit_list");
 
@@ -1018,12 +1021,12 @@ static int flush_commit_list(struct super_block *s,
                 * We might sleep in numerous places inside
                 * write_ordered_buffers. Relax the write lock.
                 */
-               reiserfs_write_unlock(s);
+               depth = reiserfs_write_unlock_nested(s);
                ret = write_ordered_buffers(&journal->j_dirty_buffers_lock,
                                            journal, jl, &jl->j_bh_list);
                if (ret < 0 && retval == 0)
                        retval = ret;
-               reiserfs_write_lock(s);
+               reiserfs_write_lock_nested(s, depth);
        }
        BUG_ON(!list_empty(&jl->j_bh_list));
        /*
@@ -1043,9 +1046,9 @@ static int flush_commit_list(struct super_block *s,
                tbh = journal_find_get_block(s, bn);
                if (tbh) {
                        if (buffer_dirty(tbh)) {
-                           reiserfs_write_unlock(s);
+                           depth = reiserfs_write_unlock_nested(s);
                            ll_rw_block(WRITE, 1, &tbh);
-                           reiserfs_write_lock(s);
+                           reiserfs_write_lock_nested(s, depth);
                        }
                        put_bh(tbh) ;
                }
@@ -1057,17 +1060,17 @@ static int flush_commit_list(struct super_block *s,
                    (jl->j_start + i) % SB_ONDISK_JOURNAL_SIZE(s);
                tbh = journal_find_get_block(s, bn);
 
-               reiserfs_write_unlock(s);
-               wait_on_buffer(tbh);
-               reiserfs_write_lock(s);
+               depth = reiserfs_write_unlock_nested(s);
+               __wait_on_buffer(tbh);
+               reiserfs_write_lock_nested(s, depth);
                // since we're using ll_rw_blk above, it might have skipped over
                // a locked buffer.  Double check here
                //
                /* redundant, sync_dirty_buffer() checks */
                if (buffer_dirty(tbh)) {
-                       reiserfs_write_unlock(s);
+                       depth = reiserfs_write_unlock_nested(s);
                        sync_dirty_buffer(tbh);
-                       reiserfs_write_lock(s);
+                       reiserfs_write_lock_nested(s, depth);
                }
                if (unlikely(!buffer_uptodate(tbh))) {
 #ifdef CONFIG_REISERFS_CHECK
@@ -1091,12 +1094,12 @@ static int flush_commit_list(struct super_block *s,
                if (buffer_dirty(jl->j_commit_bh))
                        BUG();
                mark_buffer_dirty(jl->j_commit_bh) ;
-               reiserfs_write_unlock(s);
+               depth = reiserfs_write_unlock_nested(s);
                if (reiserfs_barrier_flush(s))
                        __sync_dirty_buffer(jl->j_commit_bh, WRITE_FLUSH_FUA);
                else
                        sync_dirty_buffer(jl->j_commit_bh);
-               reiserfs_write_lock(s);
+               reiserfs_write_lock_nested(s, depth);
        }
 
        /* If there was a write error in the journal - we can't commit this
@@ -1228,15 +1231,16 @@ static int _update_journal_header_block(struct super_block *sb,
 {
        struct reiserfs_journal_header *jh;
        struct reiserfs_journal *journal = SB_JOURNAL(sb);
+       int depth;
 
        if (reiserfs_is_journal_aborted(journal))
                return -EIO;
 
        if (trans_id >= journal->j_last_flush_trans_id) {
                if (buffer_locked((journal->j_header_bh))) {
-                       reiserfs_write_unlock(sb);
-                       wait_on_buffer((journal->j_header_bh));
-                       reiserfs_write_lock(sb);
+                       depth = reiserfs_write_unlock_nested(sb);
+                       __wait_on_buffer(journal->j_header_bh);
+                       reiserfs_write_lock_nested(sb, depth);
                        if (unlikely(!buffer_uptodate(journal->j_header_bh))) {
 #ifdef CONFIG_REISERFS_CHECK
                                reiserfs_warning(sb, "journal-699",
@@ -1254,14 +1258,14 @@ static int _update_journal_header_block(struct super_block *sb,
                jh->j_mount_id = cpu_to_le32(journal->j_mount_id);
 
                set_buffer_dirty(journal->j_header_bh);
-               reiserfs_write_unlock(sb);
+               depth = reiserfs_write_unlock_nested(sb);
 
                if (reiserfs_barrier_flush(sb))
                        __sync_dirty_buffer(journal->j_header_bh, WRITE_FLUSH_FUA);
                else
                        sync_dirty_buffer(journal->j_header_bh);
 
-               reiserfs_write_lock(sb);
+               reiserfs_write_lock_nested(sb, depth);
                if (!buffer_uptodate(journal->j_header_bh)) {
                        reiserfs_warning(sb, "journal-837",
                                         "IO error during journal replay");
@@ -1341,6 +1345,7 @@ static int flush_journal_list(struct super_block *s,
        unsigned long j_len_saved = jl->j_len;
        struct reiserfs_journal *journal = SB_JOURNAL(s);
        int err = 0;
+       int depth;
 
        BUG_ON(j_len_saved <= 0);
 
@@ -1495,9 +1500,9 @@ static int flush_journal_list(struct super_block *s,
                                                       "cn->bh is NULL");
                                }
 
-                               reiserfs_write_unlock(s);
-                               wait_on_buffer(cn->bh);
-                               reiserfs_write_lock(s);
+                               depth = reiserfs_write_unlock_nested(s);
+                               __wait_on_buffer(cn->bh);
+                               reiserfs_write_lock_nested(s, depth);
 
                                if (!cn->bh) {
                                        reiserfs_panic(s, "journal-1012",
@@ -1974,6 +1979,7 @@ static int journal_compare_desc_commit(struct super_block *sb,
 /* returns 0 if it did not find a description block
 ** returns -1 if it found a corrupt commit block
 ** returns 1 if both desc and commit were valid
+** NOTE: only called during fs mount
 */
 static int journal_transaction_is_valid(struct super_block *sb,
                                        struct buffer_head *d_bh,
@@ -2073,8 +2079,9 @@ static void brelse_array(struct buffer_head **heads, int num)
 
 /*
 ** given the start, and values for the oldest acceptable transactions,
-** this either reads in a replays a transaction, or returns because the transaction
-** is invalid, or too old.
+** this either reads in a replays a transaction, or returns because the
+** transaction is invalid, or too old.
+** NOTE: only called during fs mount
 */
 static int journal_read_transaction(struct super_block *sb,
                                    unsigned long cur_dblock,
@@ -2208,10 +2215,7 @@ static int journal_read_transaction(struct super_block *sb,
        ll_rw_block(READ, get_desc_trans_len(desc), log_blocks);
        for (i = 0; i < get_desc_trans_len(desc); i++) {
 
-               reiserfs_write_unlock(sb);
                wait_on_buffer(log_blocks[i]);
-               reiserfs_write_lock(sb);
-
                if (!buffer_uptodate(log_blocks[i])) {
                        reiserfs_warning(sb, "journal-1212",
                                         "REPLAY FAILURE fsck required! "
@@ -2318,12 +2322,13 @@ static struct buffer_head *reiserfs_breada(struct block_device *dev,
 
 /*
 ** read and replay the log
-** on a clean unmount, the journal header's next unflushed pointer will be to an invalid
-** transaction.  This tests that before finding all the transactions in the log, which makes normal mount times fast.
-**
-** After a crash, this starts with the next unflushed transaction, and replays until it finds one too old, or invalid.
-**
+** on a clean unmount, the journal header's next unflushed pointer will
+** be to an invalid transaction.  This tests that before finding all the
+** transactions in the log, which makes normal mount times fast.
+** After a crash, this starts with the next unflushed transaction, and
+** replays until it finds one too old, or invalid.
 ** On exit, it sets things up so the first transaction will work correctly.
+** NOTE: only called during fs mount
 */
 static int journal_read(struct super_block *sb)
 {
@@ -2501,14 +2506,18 @@ static int journal_read(struct super_block *sb)
                              "replayed %d transactions in %lu seconds\n",
                              replay_count, get_seconds() - start);
        }
+       /* needed to satisfy the locking in _update_journal_header_block */
+       reiserfs_write_lock(sb);
        if (!bdev_read_only(sb->s_bdev) &&
            _update_journal_header_block(sb, journal->j_start,
                                         journal->j_last_flush_trans_id)) {
+               reiserfs_write_unlock(sb);
                /* replay failed, caller must call free_journal_ram and abort
                 ** the mount
                 */
                return -1;
        }
+       reiserfs_write_unlock(sb);
        return 0;
 }
 
@@ -2828,13 +2837,7 @@ int journal_init(struct super_block *sb, const char *j_dev_name,
                goto free_and_return;
        }
 
-       /*
-        * Journal_read needs to be inspected in order to push down
-        * the lock further inside (or even remove it).
-        */
-       reiserfs_write_lock(sb);
        ret = journal_read(sb);
-       reiserfs_write_unlock(sb);
        if (ret < 0) {
                reiserfs_warning(sb, "reiserfs-2006",
                                 "Replay Failure, unable to mount");
@@ -2923,9 +2926,9 @@ static void queue_log_writer(struct super_block *s)
        add_wait_queue(&journal->j_join_wait, &wait);
        set_current_state(TASK_UNINTERRUPTIBLE);
        if (test_bit(J_WRITERS_QUEUED, &journal->j_state)) {
-               reiserfs_write_unlock(s);
+               int depth = reiserfs_write_unlock_nested(s);
                schedule();
-               reiserfs_write_lock(s);
+               reiserfs_write_lock_nested(s, depth);
        }
        __set_current_state(TASK_RUNNING);
        remove_wait_queue(&journal->j_join_wait, &wait);
@@ -2943,9 +2946,12 @@ static void let_transaction_grow(struct super_block *sb, unsigned int trans_id)
        struct reiserfs_journal *journal = SB_JOURNAL(sb);
        unsigned long bcount = journal->j_bcount;
        while (1) {
-               reiserfs_write_unlock(sb);
+               int depth;
+
+               depth = reiserfs_write_unlock_nested(sb);
                schedule_timeout_uninterruptible(1);
-               reiserfs_write_lock(sb);
+               reiserfs_write_lock_nested(sb, depth);
+
                journal->j_current_jl->j_state |= LIST_COMMIT_PENDING;
                while ((atomic_read(&journal->j_wcount) > 0 ||
                        atomic_read(&journal->j_jlock)) &&
@@ -2976,6 +2982,7 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
        struct reiserfs_transaction_handle myth;
        int sched_count = 0;
        int retval;
+       int depth;
 
        reiserfs_check_lock_depth(sb, "journal_begin");
        BUG_ON(nblocks > journal->j_trans_max);
@@ -2996,9 +3003,9 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
 
        if (test_bit(J_WRITERS_BLOCKED, &journal->j_state)) {
                unlock_journal(sb);
-               reiserfs_write_unlock(sb);
+               depth = reiserfs_write_unlock_nested(sb);
                reiserfs_wait_on_write_block(sb);
-               reiserfs_write_lock(sb);
+               reiserfs_write_lock_nested(sb, depth);
                PROC_INFO_INC(sb, journal.journal_relock_writers);
                goto relock;
        }
@@ -3821,6 +3828,7 @@ void reiserfs_restore_prepared_buffer(struct super_block *sb,
        if (test_clear_buffer_journal_restore_dirty(bh) &&
            buffer_journal_dirty(bh)) {
                struct reiserfs_journal_cnode *cn;
+               reiserfs_write_lock(sb);
                cn = get_journal_hash_dev(sb,
                                          journal->j_list_hash_table,
                                          bh->b_blocknr);
@@ -3828,6 +3836,7 @@ void reiserfs_restore_prepared_buffer(struct super_block *sb,
                        set_buffer_journal_test(bh);
                        mark_buffer_dirty(bh);
                }
+               reiserfs_write_unlock(sb);
        }
        clear_buffer_journal_prepared(bh);
 }
@@ -3911,6 +3920,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
        unsigned long jindex;
        unsigned int commit_trans_id;
        int trans_half;
+       int depth;
 
        BUG_ON(th->t_refcount > 1);
        BUG_ON(!th->t_trans_id);
@@ -4116,9 +4126,7 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
                next = cn->next;
                free_cnode(sb, cn);
                cn = next;
-               reiserfs_write_unlock(sb);
-               cond_resched();
-               reiserfs_write_lock(sb);
+               reiserfs_cond_resched(sb);
        }
 
        /* we are done  with both the c_bh and d_bh, but
@@ -4165,10 +4173,10 @@ static int do_journal_end(struct reiserfs_transaction_handle *th,
         * is lost.
         */
        if (!list_empty(&jl->j_tail_bh_list)) {
-               reiserfs_write_unlock(sb);
+               depth = reiserfs_write_unlock_nested(sb);
                write_ordered_buffers(&journal->j_dirty_buffers_lock,
                                      journal, jl, &jl->j_tail_bh_list);
-               reiserfs_write_lock(sb);
+               reiserfs_write_lock_nested(sb, depth);
        }
        BUG_ON(!list_empty(&jl->j_tail_bh_list));
        mutex_unlock(&jl->j_commit_mutex);
index d735bc8..045b83e 100644 (file)
@@ -48,30 +48,35 @@ void reiserfs_write_unlock(struct super_block *s)
        }
 }
 
-/*
- * If we already own the lock, just exit and don't increase the depth.
- * Useful when we don't want to lock more than once.
- *
- * We always return the lock_depth we had before calling
- * this function.
- */
-int reiserfs_write_lock_once(struct super_block *s)
+int __must_check reiserfs_write_unlock_nested(struct super_block *s)
 {
        struct reiserfs_sb_info *sb_i = REISERFS_SB(s);
+       int depth;
 
-       if (sb_i->lock_owner != current) {
-               mutex_lock(&sb_i->lock);
-               sb_i->lock_owner = current;
-               return sb_i->lock_depth++;
-       }
+       /* this can happen when the lock isn't always held */
+       if (sb_i->lock_owner != current)
+               return -1;
+
+       depth = sb_i->lock_depth;
+
+       sb_i->lock_depth = -1;
+       sb_i->lock_owner = NULL;
+       mutex_unlock(&sb_i->lock);
 
-       return sb_i->lock_depth;
+       return depth;
 }
 
-void reiserfs_write_unlock_once(struct super_block *s, int lock_depth)
+void reiserfs_write_lock_nested(struct super_block *s, int depth)
 {
-       if (lock_depth == -1)
-               reiserfs_write_unlock(s);
+       struct reiserfs_sb_info *sb_i = REISERFS_SB(s);
+
+       /* this can happen when the lock isn't always held */
+       if (depth == -1)
+               return;
+
+       mutex_lock(&sb_i->lock);
+       sb_i->lock_owner = current;
+       sb_i->lock_depth = depth;
 }
 
 /*
@@ -82,9 +87,7 @@ void reiserfs_check_lock_depth(struct super_block *sb, char *caller)
 {
        struct reiserfs_sb_info *sb_i = REISERFS_SB(sb);
 
-       if (sb_i->lock_depth < 0)
-               reiserfs_panic(sb, "%s called without kernel lock held %d",
-                              caller);
+       WARN_ON(sb_i->lock_depth < 0);
 }
 
 #ifdef CONFIG_REISERFS_CHECK
index 8567fb8..dc5236f 100644 (file)
@@ -325,7 +325,6 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
                                      unsigned int flags)
 {
        int retval;
-       int lock_depth;
        struct inode *inode = NULL;
        struct reiserfs_dir_entry de;
        INITIALIZE_PATH(path_to_entry);
@@ -333,12 +332,7 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
        if (REISERFS_MAX_NAME(dir->i_sb->s_blocksize) < dentry->d_name.len)
                return ERR_PTR(-ENAMETOOLONG);
 
-       /*
-        * Might be called with or without the write lock, must be careful
-        * to not recursively hold it in case we want to release the lock
-        * before rescheduling.
-        */
-       lock_depth = reiserfs_write_lock_once(dir->i_sb);
+       reiserfs_write_lock(dir->i_sb);
 
        de.de_gen_number_bit_string = NULL;
        retval =
@@ -349,7 +343,7 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
                inode = reiserfs_iget(dir->i_sb,
                                      (struct cpu_key *)&(de.de_dir_id));
                if (!inode || IS_ERR(inode)) {
-                       reiserfs_write_unlock_once(dir->i_sb, lock_depth);
+                       reiserfs_write_unlock(dir->i_sb);
                        return ERR_PTR(-EACCES);
                }
 
@@ -358,7 +352,7 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
                if (IS_PRIVATE(dir))
                        inode->i_flags |= S_PRIVATE;
        }
-       reiserfs_write_unlock_once(dir->i_sb, lock_depth);
+       reiserfs_write_unlock(dir->i_sb);
        if (retval == IO_ERROR) {
                return ERR_PTR(-EIO);
        }
@@ -727,7 +721,6 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
        struct inode *inode;
        struct reiserfs_transaction_handle th;
        struct reiserfs_security_handle security;
-       int lock_depth;
        /* We need blocks for transaction + (user+group)*(quotas for new inode + update of quota for directory owner) */
        int jbegin_count =
            JOURNAL_PER_BALANCE_CNT * 3 +
@@ -753,7 +746,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
                return retval;
        }
        jbegin_count += retval;
-       lock_depth = reiserfs_write_lock_once(dir->i_sb);
+       reiserfs_write_lock(dir->i_sb);
 
        retval = journal_begin(&th, dir->i_sb, jbegin_count);
        if (retval) {
@@ -804,7 +797,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
        d_instantiate(dentry, inode);
        retval = journal_end(&th, dir->i_sb, jbegin_count);
 out_failed:
-       reiserfs_write_unlock_once(dir->i_sb, lock_depth);
+       reiserfs_write_unlock(dir->i_sb);
        return retval;
 }
 
@@ -920,7 +913,6 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
        struct reiserfs_transaction_handle th;
        int jbegin_count;
        unsigned long savelink;
-       int depth;
 
        dquot_initialize(dir);
 
@@ -934,7 +926,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
            JOURNAL_PER_BALANCE_CNT * 2 + 2 +
            4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb);
 
-       depth = reiserfs_write_lock_once(dir->i_sb);
+       reiserfs_write_lock(dir->i_sb);
        retval = journal_begin(&th, dir->i_sb, jbegin_count);
        if (retval)
                goto out_unlink;
@@ -995,7 +987,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
 
        retval = journal_end(&th, dir->i_sb, jbegin_count);
        reiserfs_check_path(&path);
-       reiserfs_write_unlock_once(dir->i_sb, depth);
+       reiserfs_write_unlock(dir->i_sb);
        return retval;
 
       end_unlink:
@@ -1005,7 +997,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
        if (err)
                retval = err;
       out_unlink:
-       reiserfs_write_unlock_once(dir->i_sb, depth);
+       reiserfs_write_unlock(dir->i_sb);
        return retval;
 }
 
index c0b1112..54944d5 100644 (file)
@@ -358,12 +358,13 @@ void __reiserfs_panic(struct super_block *sb, const char *id,
        dump_stack();
 #endif
        if (sb)
-               panic(KERN_WARNING "REISERFS panic (device %s): %s%s%s: %s\n",
+               printk(KERN_WARNING "REISERFS panic (device %s): %s%s%s: %s\n",
                      sb->s_id, id ? id : "", id ? " " : "",
                      function, error_buf);
        else
-               panic(KERN_WARNING "REISERFS panic: %s%s%s: %s\n",
+               printk(KERN_WARNING "REISERFS panic: %s%s%s: %s\n",
                      id ? id : "", id ? " " : "", function, error_buf);
+       BUG();
 }
 
 void __reiserfs_error(struct super_block *sb, const char *id,
index 3df5ce6..f8adaee 100644 (file)
@@ -630,8 +630,8 @@ static inline int __reiserfs_is_journal_aborted(struct reiserfs_journal
  */
 void reiserfs_write_lock(struct super_block *s);
 void reiserfs_write_unlock(struct super_block *s);
-int reiserfs_write_lock_once(struct super_block *s);
-void reiserfs_write_unlock_once(struct super_block *s, int lock_depth);
+int __must_check reiserfs_write_unlock_nested(struct super_block *s);
+void reiserfs_write_lock_nested(struct super_block *s, int depth);
 
 #ifdef CONFIG_REISERFS_CHECK
 void reiserfs_lock_check_recursive(struct super_block *s);
@@ -667,31 +667,33 @@ static inline void reiserfs_lock_check_recursive(struct super_block *s) { }
  * - The inode mutex
  */
 static inline void reiserfs_mutex_lock_safe(struct mutex *m,
-                              struct super_block *s)
+                                           struct super_block *s)
 {
-       reiserfs_lock_check_recursive(s);
-       reiserfs_write_unlock(s);
+       int depth;
+
+       depth = reiserfs_write_unlock_nested(s);
        mutex_lock(m);
-       reiserfs_write_lock(s);
+       reiserfs_write_lock_nested(s, depth);
 }
 
 static inline void
 reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass,
-                              struct super_block *s)
+                               struct super_block *s)
 {
-       reiserfs_lock_check_recursive(s);
-       reiserfs_write_unlock(s);
+       int depth;
+
+       depth = reiserfs_write_unlock_nested(s);
        mutex_lock_nested(m, subclass);
-       reiserfs_write_lock(s);
+       reiserfs_write_lock_nested(s, depth);
 }
 
 static inline void
 reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s)
 {
-       reiserfs_lock_check_recursive(s);
-       reiserfs_write_unlock(s);
-       down_read(sem);
-       reiserfs_write_lock(s);
+       int depth;
+       depth = reiserfs_write_unlock_nested(s);
+       down_read(sem);
+       reiserfs_write_lock_nested(s, depth);
 }
 
 /*
@@ -701,9 +703,11 @@ reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s)
 static inline void reiserfs_cond_resched(struct super_block *s)
 {
        if (need_resched()) {
-               reiserfs_write_unlock(s);
+               int depth;
+
+               depth = reiserfs_write_unlock_nested(s);
                schedule();
-               reiserfs_write_lock(s);
+               reiserfs_write_lock_nested(s, depth);
        }
 }
 
index 3ce02cf..a4ef5cd 100644 (file)
@@ -34,6 +34,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
        unsigned long int block_count, free_blocks;
        int i;
        int copy_size;
+       int depth;
 
        sb = SB_DISK_SUPER_BLOCK(s);
 
@@ -43,7 +44,9 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
        }
 
        /* check the device size */
+       depth = reiserfs_write_unlock_nested(s);
        bh = sb_bread(s, block_count_new - 1);
+       reiserfs_write_lock_nested(s, depth);
        if (!bh) {
                printk("reiserfs_resize: can\'t read last block\n");
                return -EINVAL;
@@ -125,9 +128,12 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
                 * transaction begins, and the new bitmaps don't matter if the
                 * transaction fails. */
                for (i = bmap_nr; i < bmap_nr_new; i++) {
+                       int depth;
                        /* don't use read_bitmap_block since it will cache
                         * the uninitialized bitmap */
+                       depth = reiserfs_write_unlock_nested(s);
                        bh = sb_bread(s, i * s->s_blocksize * 8);
+                       reiserfs_write_lock_nested(s, depth);
                        if (!bh) {
                                vfree(bitmap);
                                return -EIO;
@@ -138,9 +144,9 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
 
                        set_buffer_uptodate(bh);
                        mark_buffer_dirty(bh);
-                       reiserfs_write_unlock(s);
+                       depth = reiserfs_write_unlock_nested(s);
                        sync_dirty_buffer(bh);
-                       reiserfs_write_lock(s);
+                       reiserfs_write_lock_nested(s, depth);
                        // update bitmap_info stuff
                        bitmap[i].free_count = sb_blocksize(sb) * 8 - 1;
                        brelse(bh);
index 2f40a4c..b14706a 100644 (file)
@@ -524,14 +524,14 @@ static int is_tree_node(struct buffer_head *bh, int level)
  * the caller (search_by_key) will perform other schedule-unsafe
  * operations just after calling this function.
  *
- * @return true if we have unlocked
+ * @return depth of lock to be restored after read completes
  */
-static bool search_by_key_reada(struct super_block *s,
+static int search_by_key_reada(struct super_block *s,
                                struct buffer_head **bh,
                                b_blocknr_t *b, int num)
 {
        int i, j;
-       bool unlocked = false;
+       int depth = -1;
 
        for (i = 0; i < num; i++) {
                bh[i] = sb_getblk(s, b[i]);
@@ -549,15 +549,13 @@ static bool search_by_key_reada(struct super_block *s,
                 * you have to make sure the prepared bit isn't set on this buffer
                 */
                if (!buffer_uptodate(bh[j])) {
-                       if (!unlocked) {
-                               reiserfs_write_unlock(s);
-                               unlocked = true;
-                       }
+                       if (depth == -1)
+                               depth = reiserfs_write_unlock_nested(s);
                        ll_rw_block(READA, 1, bh + j);
                }
                brelse(bh[j]);
        }
-       return unlocked;
+       return depth;
 }
 
 /**************************************************************************
@@ -645,26 +643,26 @@ int search_by_key(struct super_block *sb, const struct cpu_key *key,      /* Key to s
                   have a pointer to it. */
                if ((bh = last_element->pe_buffer =
                     sb_getblk(sb, block_number))) {
-                       bool unlocked = false;
 
-                       if (!buffer_uptodate(bh) && reada_count > 1)
-                               /* may unlock the write lock */
-                               unlocked = search_by_key_reada(sb, reada_bh,
-                                                   reada_blocks, reada_count);
                        /*
-                        * If we haven't already unlocked the write lock,
-                        * then we need to do that here before reading
-                        * the current block
+                        * We'll need to drop the lock if we encounter any
+                        * buffers that need to be read. If all of them are
+                        * already up to date, we don't need to drop the lock.
                         */
-                       if (!buffer_uptodate(bh) && !unlocked) {
-                               reiserfs_write_unlock(sb);
-                               unlocked = true;
-                       }
+                       int depth = -1;
+
+                       if (!buffer_uptodate(bh) && reada_count > 1)
+                               depth = search_by_key_reada(sb, reada_bh,
+                                                   reada_blocks, reada_count);
+
+                       if (!buffer_uptodate(bh) && depth == -1)
+                               depth = reiserfs_write_unlock_nested(sb);
+
                        ll_rw_block(READ, 1, &bh);
                        wait_on_buffer(bh);
 
-                       if (unlocked)
-                               reiserfs_write_lock(sb);
+                       if (depth != -1)
+                               reiserfs_write_lock_nested(sb, depth);
                        if (!buffer_uptodate(bh))
                                goto io_error;
                } else {
@@ -1059,9 +1057,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st
                        reiserfs_free_block(th, inode, block, 1);
                    }
 
-                   reiserfs_write_unlock(sb);
-                   cond_resched();
-                   reiserfs_write_lock(sb);
+                   reiserfs_cond_resched(sb);
 
                    if (item_moved (&s_ih, path))  {
                        need_re_search = 1;
@@ -1190,6 +1186,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
        struct item_head *q_ih;
        int quota_cut_bytes;
        int ret_value, del_size, removed;
+       int depth;
 
 #ifdef CONFIG_REISERFS_CHECK
        char mode;
@@ -1299,7 +1296,9 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
                       "reiserquota delete_item(): freeing %u, id=%u type=%c",
                       quota_cut_bytes, inode->i_uid, head2type(&s_ih));
 #endif
+       depth = reiserfs_write_unlock_nested(inode->i_sb);
        dquot_free_space_nodirty(inode, quota_cut_bytes);
+       reiserfs_write_lock_nested(inode->i_sb, depth);
 
        /* Return deleted body length */
        return ret_value;
@@ -1325,6 +1324,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
 void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
                                struct inode *inode, struct reiserfs_key *key)
 {
+       struct super_block *sb = th->t_super;
        struct tree_balance tb;
        INITIALIZE_PATH(path);
        int item_len = 0;
@@ -1377,14 +1377,17 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
                if (retval == CARRY_ON) {
                        do_balance(&tb, NULL, NULL, M_DELETE);
                        if (inode) {    /* Should we count quota for item? (we don't count quotas for save-links) */
+                               int depth;
 #ifdef REISERQUOTA_DEBUG
                                reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE,
                                               "reiserquota delete_solid_item(): freeing %u id=%u type=%c",
                                               quota_cut_bytes, inode->i_uid,
                                               key2type(key));
 #endif
+                               depth = reiserfs_write_unlock_nested(sb);
                                dquot_free_space_nodirty(inode,
                                                         quota_cut_bytes);
+                               reiserfs_write_lock_nested(sb, depth);
                        }
                        break;
                }
@@ -1561,6 +1564,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
        int retval2 = -1;
        int quota_cut_bytes;
        loff_t tail_pos = 0;
+       int depth;
 
        BUG_ON(!th->t_trans_id);
 
@@ -1733,7 +1737,9 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
                       "reiserquota cut_from_item(): freeing %u id=%u type=%c",
                       quota_cut_bytes, inode->i_uid, '?');
 #endif
+       depth = reiserfs_write_unlock_nested(sb);
        dquot_free_space_nodirty(inode, quota_cut_bytes);
+       reiserfs_write_lock_nested(sb, depth);
        return ret_value;
 }
 
@@ -1953,9 +1959,11 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
                             const char *body,  /* Pointer to the bytes to paste.    */
                             int pasted_size)
 {                              /* Size of pasted bytes.             */
+       struct super_block *sb = inode->i_sb;
        struct tree_balance s_paste_balance;
        int retval;
        int fs_gen;
+       int depth;
 
        BUG_ON(!th->t_trans_id);
 
@@ -1968,9 +1976,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
                       key2type(&(key->on_disk_key)));
 #endif
 
-       reiserfs_write_unlock(inode->i_sb);
+       depth = reiserfs_write_unlock_nested(sb);
        retval = dquot_alloc_space_nodirty(inode, pasted_size);
-       reiserfs_write_lock(inode->i_sb);
+       reiserfs_write_lock_nested(sb, depth);
        if (retval) {
                pathrelse(search_path);
                return retval;
@@ -2027,7 +2035,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
                       pasted_size, inode->i_uid,
                       key2type(&(key->on_disk_key)));
 #endif
+       depth = reiserfs_write_unlock_nested(sb);
        dquot_free_space_nodirty(inode, pasted_size);
+       reiserfs_write_lock_nested(sb, depth);
        return retval;
 }
 
@@ -2050,6 +2060,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
        BUG_ON(!th->t_trans_id);
 
        if (inode) {            /* Do we count quotas for item? */
+               int depth;
                fs_gen = get_generation(inode->i_sb);
                quota_bytes = ih_item_len(ih);
 
@@ -2063,11 +2074,11 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
                               "reiserquota insert_item(): allocating %u id=%u type=%c",
                               quota_bytes, inode->i_uid, head2type(ih));
 #endif
-               reiserfs_write_unlock(inode->i_sb);
                /* We can't dirty inode here. It would be immediately written but
                 * appropriate stat item isn't inserted yet... */
+               depth = reiserfs_write_unlock_nested(inode->i_sb);
                retval = dquot_alloc_space_nodirty(inode, quota_bytes);
-               reiserfs_write_lock(inode->i_sb);
+               reiserfs_write_lock_nested(inode->i_sb, depth);
                if (retval) {
                        pathrelse(path);
                        return retval;
@@ -2118,7 +2129,10 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
                       "reiserquota insert_item(): freeing %u id=%u type=%c",
                       quota_bytes, inode->i_uid, head2type(ih));
 #endif
-       if (inode)
+       if (inode) {
+               int depth = reiserfs_write_unlock_nested(inode->i_sb);
                dquot_free_space_nodirty(inode, quota_bytes);
+               reiserfs_write_lock_nested(inode->i_sb, depth);
+       }
        return retval;
 }
index e2e202a..3ead145 100644 (file)
@@ -243,6 +243,7 @@ static int finish_unfinished(struct super_block *s)
        done = 0;
        REISERFS_SB(s)->s_is_unlinked_ok = 1;
        while (!retval) {
+               int depth;
                retval = search_item(s, &max_cpu_key, &path);
                if (retval != ITEM_NOT_FOUND) {
                        reiserfs_error(s, "vs-2140",
@@ -298,9 +299,9 @@ static int finish_unfinished(struct super_block *s)
                        retval = remove_save_link_only(s, &save_link_key, 0);
                        continue;
                }
-               reiserfs_write_unlock(s);
+               depth = reiserfs_write_unlock_nested(inode->i_sb);
                dquot_initialize(inode);
-               reiserfs_write_lock(s);
+               reiserfs_write_lock_nested(inode->i_sb, depth);
 
                if (truncate && S_ISDIR(inode->i_mode)) {
                        /* We got a truncate request for a dir which is impossible.
@@ -356,10 +357,12 @@ static int finish_unfinished(struct super_block *s)
 
 #ifdef CONFIG_QUOTA
        /* Turn quotas off */
+       reiserfs_write_unlock(s);
        for (i = 0; i < MAXQUOTAS; i++) {
                if (sb_dqopt(s)->files[i] && quota_enabled[i])
                        dquot_quota_off(s, i);
        }
+       reiserfs_write_lock(s);
        if (ms_active_set)
                /* Restore the flag back */
                s->s_flags &= ~MS_ACTIVE;
@@ -623,7 +626,6 @@ static void reiserfs_dirty_inode(struct inode *inode, int flags)
        struct reiserfs_transaction_handle th;
 
        int err = 0;
-       int lock_depth;
 
        if (inode->i_sb->s_flags & MS_RDONLY) {
                reiserfs_warning(inode->i_sb, "clm-6006",
@@ -631,7 +633,7 @@ static void reiserfs_dirty_inode(struct inode *inode, int flags)
                                 inode->i_ino);
                return;
        }
-       lock_depth = reiserfs_write_lock_once(inode->i_sb);
+       reiserfs_write_lock(inode->i_sb);
 
        /* this is really only used for atime updates, so they don't have
         ** to be included in O_SYNC or fsync
@@ -644,7 +646,7 @@ static void reiserfs_dirty_inode(struct inode *inode, int flags)
        journal_end(&th, inode->i_sb, 1);
 
 out:
-       reiserfs_write_unlock_once(inode->i_sb, lock_depth);
+       reiserfs_write_unlock(inode->i_sb);
 }
 
 static int reiserfs_show_options(struct seq_file *seq, struct dentry *root)
@@ -1334,7 +1336,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
                                kfree(qf_names[i]);
 #endif
                err = -EINVAL;
-               goto out_unlock;
+               goto out_err_unlock;
        }
 #ifdef CONFIG_QUOTA
        handle_quota_files(s, qf_names, &qfmt);
@@ -1378,35 +1380,32 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
        if (blocks) {
                err = reiserfs_resize(s, blocks);
                if (err != 0)
-                       goto out_unlock;
+                       goto out_err_unlock;
        }
 
        if (*mount_flags & MS_RDONLY) {
+               reiserfs_write_unlock(s);
                reiserfs_xattr_init(s, *mount_flags);
                /* remount read-only */
                if (s->s_flags & MS_RDONLY)
                        /* it is read-only already */
-                       goto out_ok;
+                       goto out_ok_unlocked;
 
-               /*
-                * Drop write lock. Quota will retake it when needed and lock
-                * ordering requires calling dquot_suspend() without it.
-                */
-               reiserfs_write_unlock(s);
                err = dquot_suspend(s, -1);
                if (err < 0)
                        goto out_err;
-               reiserfs_write_lock(s);
 
                /* try to remount file system with read-only permissions */
                if (sb_umount_state(rs) == REISERFS_VALID_FS
                    || REISERFS_SB(s)->s_mount_state != REISERFS_VALID_FS) {
-                       goto out_ok;
+                       goto out_ok_unlocked;
                }
 
+               reiserfs_write_lock(s);
+
                err = journal_begin(&th, s, 10);
                if (err)
-                       goto out_unlock;
+                       goto out_err_unlock;
 
                /* Mounting a rw partition read-only. */
                reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1);
@@ -1415,13 +1414,14 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
        } else {
                /* remount read-write */
                if (!(s->s_flags & MS_RDONLY)) {
+                       reiserfs_write_unlock(s);
                        reiserfs_xattr_init(s, *mount_flags);
-                       goto out_ok   /* We are read-write already */
+                       goto out_ok_unlocked;   /* We are read-write already */
                }
 
                if (reiserfs_is_journal_aborted(journal)) {
                        err = journal->j_errno;
-                       goto out_unlock;
+                       goto out_err_unlock;
                }
 
                handle_data_mode(s, mount_options);
@@ -1430,7 +1430,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
                s->s_flags &= ~MS_RDONLY;       /* now it is safe to call journal_begin */
                err = journal_begin(&th, s, 10);
                if (err)
-                       goto out_unlock;
+                       goto out_err_unlock;
 
                /* Mount a partition which is read-only, read-write */
                reiserfs_prepare_for_journal(s, SB_BUFFER_WITH_SB(s), 1);
@@ -1447,26 +1447,22 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
        SB_JOURNAL(s)->j_must_wait = 1;
        err = journal_end(&th, s, 10);
        if (err)
-               goto out_unlock;
+               goto out_err_unlock;
 
+       reiserfs_write_unlock(s);
        if (!(*mount_flags & MS_RDONLY)) {
-               /*
-                * Drop write lock. Quota will retake it when needed and lock
-                * ordering requires calling dquot_resume() without it.
-                */
-               reiserfs_write_unlock(s);
                dquot_resume(s, -1);
                reiserfs_write_lock(s);
                finish_unfinished(s);
+               reiserfs_write_unlock(s);
                reiserfs_xattr_init(s, *mount_flags);
        }
 
-out_ok:
+out_ok_unlocked:
        replace_mount_options(s, new_opts);
-       reiserfs_write_unlock(s);
        return 0;
 
-out_unlock:
+out_err_unlock:
        reiserfs_write_unlock(s);
 out_err:
        kfree(new_opts);
@@ -2013,12 +2009,14 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
                        goto error;
                }
 
+               reiserfs_write_unlock(s);
                if ((errval = reiserfs_lookup_privroot(s)) ||
                    (errval = reiserfs_xattr_init(s, s->s_flags))) {
                        dput(s->s_root);
                        s->s_root = NULL;
-                       goto error;
+                       goto error_unlocked;
                }
+               reiserfs_write_lock(s);
 
                /* look for files which were to be removed in previous session */
                finish_unfinished(s);
@@ -2027,12 +2025,14 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
                        reiserfs_info(s, "using 3.5.x disk format\n");
                }
 
+               reiserfs_write_unlock(s);
                if ((errval = reiserfs_lookup_privroot(s)) ||
                    (errval = reiserfs_xattr_init(s, s->s_flags))) {
                        dput(s->s_root);
                        s->s_root = NULL;
-                       goto error;
+                       goto error_unlocked;
                }
+               reiserfs_write_lock(s);
        }
        // mark hash in super block: it could be unset. overwrite should be ok
        set_sb_hash_function_code(rs, function2code(sbi->s_hash_function));
@@ -2100,6 +2100,7 @@ static int reiserfs_write_dquot(struct dquot *dquot)
 {
        struct reiserfs_transaction_handle th;
        int ret, err;
+       int depth;
 
        reiserfs_write_lock(dquot->dq_sb);
        ret =
@@ -2107,9 +2108,9 @@ static int reiserfs_write_dquot(struct dquot *dquot)
                          REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
        if (ret)
                goto out;
-       reiserfs_write_unlock(dquot->dq_sb);
+       depth = reiserfs_write_unlock_nested(dquot->dq_sb);
        ret = dquot_commit(dquot);
-       reiserfs_write_lock(dquot->dq_sb);
+       reiserfs_write_lock_nested(dquot->dq_sb, depth);
        err =
            journal_end(&th, dquot->dq_sb,
                        REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
@@ -2124,6 +2125,7 @@ static int reiserfs_acquire_dquot(struct dquot *dquot)
 {
        struct reiserfs_transaction_handle th;
        int ret, err;
+       int depth;
 
        reiserfs_write_lock(dquot->dq_sb);
        ret =
@@ -2131,9 +2133,9 @@ static int reiserfs_acquire_dquot(struct dquot *dquot)
                          REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb));
        if (ret)
                goto out;
-       reiserfs_write_unlock(dquot->dq_sb);
+       depth = reiserfs_write_unlock_nested(dquot->dq_sb);
        ret = dquot_acquire(dquot);
-       reiserfs_write_lock(dquot->dq_sb);
+       reiserfs_write_lock_nested(dquot->dq_sb, depth);
        err =
            journal_end(&th, dquot->dq_sb,
                        REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb));
@@ -2186,15 +2188,16 @@ static int reiserfs_write_info(struct super_block *sb, int type)
 {
        struct reiserfs_transaction_handle th;
        int ret, err;
+       int depth;
 
        /* Data block + inode block */
        reiserfs_write_lock(sb);
        ret = journal_begin(&th, sb, 2);
        if (ret)
                goto out;
-       reiserfs_write_unlock(sb);
+       depth = reiserfs_write_unlock_nested(sb);
        ret = dquot_commit_info(sb, type);
-       reiserfs_write_lock(sb);
+       reiserfs_write_lock_nested(sb, depth);
        err = journal_end(&th, sb, 2);
        if (!ret && err)
                ret = err;
index c69cdd7..8a9e2dc 100644 (file)
@@ -81,8 +81,7 @@ static int xattr_unlink(struct inode *dir, struct dentry *dentry)
        int error;
        BUG_ON(!mutex_is_locked(&dir->i_mutex));
 
-       reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex,
-                                       I_MUTEX_CHILD, dir->i_sb);
+       mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
        error = dir->i_op->unlink(dir, dentry);
        mutex_unlock(&dentry->d_inode->i_mutex);
 
@@ -96,8 +95,7 @@ static int xattr_rmdir(struct inode *dir, struct dentry *dentry)
        int error;
        BUG_ON(!mutex_is_locked(&dir->i_mutex));
 
-       reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex,
-                                       I_MUTEX_CHILD, dir->i_sb);
+       mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
        error = dir->i_op->rmdir(dir, dentry);
        if (!error)
                dentry->d_inode->i_flags |= S_DEAD;
@@ -232,22 +230,17 @@ static int reiserfs_for_each_xattr(struct inode *inode,
        if (IS_PRIVATE(inode) || get_inode_sd_version(inode) == STAT_DATA_V1)
                return 0;
 
-       reiserfs_write_unlock(inode->i_sb);
        dir = open_xa_dir(inode, XATTR_REPLACE);
        if (IS_ERR(dir)) {
                err = PTR_ERR(dir);
-               reiserfs_write_lock(inode->i_sb);
                goto out;
        } else if (!dir->d_inode) {
                err = 0;
-               reiserfs_write_lock(inode->i_sb);
                goto out_dir;
        }
 
        mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_XATTR);
 
-       reiserfs_write_lock(inode->i_sb);
-
        buf.xadir = dir;
        while (1) {
                err = reiserfs_readdir_inode(dir->d_inode, &buf.ctx);
@@ -281,14 +274,17 @@ static int reiserfs_for_each_xattr(struct inode *inode,
                int blocks = JOURNAL_PER_BALANCE_CNT * 2 + 2 +
                             4 * REISERFS_QUOTA_TRANS_BLOCKS(inode->i_sb);
                struct reiserfs_transaction_handle th;
+               reiserfs_write_lock(inode->i_sb);
                err = journal_begin(&th, inode->i_sb, blocks);
+               reiserfs_write_unlock(inode->i_sb);
                if (!err) {
                        int jerror;
-                       reiserfs_mutex_lock_nested_safe(
-                                         &dir->d_parent->d_inode->i_mutex,
-                                         I_MUTEX_XATTR, inode->i_sb);
+                       mutex_lock_nested(&dir->d_parent->d_inode->i_mutex,
+                                         I_MUTEX_XATTR);
                        err = action(dir, data);
+                       reiserfs_write_lock(inode->i_sb);
                        jerror = journal_end(&th, inode->i_sb, blocks);
+                       reiserfs_write_unlock(inode->i_sb);
                        mutex_unlock(&dir->d_parent->d_inode->i_mutex);
                        err = jerror ?: err;
                }
@@ -455,9 +451,7 @@ static int lookup_and_delete_xattr(struct inode *inode, const char *name)
        }
 
        if (dentry->d_inode) {
-               reiserfs_write_lock(inode->i_sb);
                err = xattr_unlink(xadir->d_inode, dentry);
-               reiserfs_write_unlock(inode->i_sb);
                update_ctime(inode);
        }
 
@@ -491,24 +485,17 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th,
        if (get_inode_sd_version(inode) == STAT_DATA_V1)
                return -EOPNOTSUPP;
 
-       reiserfs_write_unlock(inode->i_sb);
-
        if (!buffer) {
                err = lookup_and_delete_xattr(inode, name);
-               reiserfs_write_lock(inode->i_sb);
                return err;
        }
 
        dentry = xattr_lookup(inode, name, flags);
-       if (IS_ERR(dentry)) {
-               reiserfs_write_lock(inode->i_sb);
+       if (IS_ERR(dentry))
                return PTR_ERR(dentry);
-       }
 
        down_write(&REISERFS_I(inode)->i_xattr_sem);
 
-       reiserfs_write_lock(inode->i_sb);
-
        xahash = xattr_hash(buffer, buffer_size);
        while (buffer_pos < buffer_size || buffer_pos == 0) {
                size_t chunk;
@@ -538,6 +525,7 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th,
                        rxh->h_hash = cpu_to_le32(xahash);
                }
 
+               reiserfs_write_lock(inode->i_sb);
                err = __reiserfs_write_begin(page, page_offset, chunk + skip);
                if (!err) {
                        if (buffer)
@@ -546,6 +534,7 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th,
                                                    page_offset + chunk +
                                                    skip);
                }
+               reiserfs_write_unlock(inode->i_sb);
                unlock_page(page);
                reiserfs_put_page(page);
                buffer_pos += chunk;
@@ -563,10 +552,8 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th,
                        .ia_valid = ATTR_SIZE | ATTR_CTIME,
                };
 
-               reiserfs_write_unlock(inode->i_sb);
                mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_XATTR);
                inode_dio_wait(dentry->d_inode);
-               reiserfs_write_lock(inode->i_sb);
 
                err = reiserfs_setattr(dentry, &newattrs);
                mutex_unlock(&dentry->d_inode->i_mutex);
@@ -592,18 +579,19 @@ int reiserfs_xattr_set(struct inode *inode, const char *name,
 
        reiserfs_write_lock(inode->i_sb);
        error = journal_begin(&th, inode->i_sb, jbegin_count);
+       reiserfs_write_unlock(inode->i_sb);
        if (error) {
-               reiserfs_write_unlock(inode->i_sb);
                return error;
        }
 
        error = reiserfs_xattr_set_handle(&th, inode, name,
                                          buffer, buffer_size, flags);
 
+       reiserfs_write_lock(inode->i_sb);
        error2 = journal_end(&th, inode->i_sb, jbegin_count);
+       reiserfs_write_unlock(inode->i_sb);
        if (error == 0)
                error = error2;
-       reiserfs_write_unlock(inode->i_sb);
 
        return error;
 }
@@ -968,7 +956,7 @@ int reiserfs_lookup_privroot(struct super_block *s)
        int err = 0;
 
        /* If we don't have the privroot located yet - go find it */
-       reiserfs_mutex_lock_safe(&s->s_root->d_inode->i_mutex, s);
+       mutex_lock(&s->s_root->d_inode->i_mutex);
        dentry = lookup_one_len(PRIVROOT_NAME, s->s_root,
                                strlen(PRIVROOT_NAME));
        if (!IS_ERR(dentry)) {
@@ -996,14 +984,14 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
                goto error;
 
        if (!privroot->d_inode && !(mount_flags & MS_RDONLY)) {
-               reiserfs_mutex_lock_safe(&s->s_root->d_inode->i_mutex, s);
+               mutex_lock(&s->s_root->d_inode->i_mutex);
                err = create_privroot(REISERFS_SB(s)->priv_root);
                mutex_unlock(&s->s_root->d_inode->i_mutex);
        }
 
        if (privroot->d_inode) {
                s->s_xattr = reiserfs_xattr_handlers;
-               reiserfs_mutex_lock_safe(&privroot->d_inode->i_mutex, s);
+               mutex_lock(&privroot->d_inode->i_mutex);
                if (!REISERFS_SB(s)->xattr_root) {
                        struct dentry *dentry;
                        dentry = lookup_one_len(XAROOT_NAME, privroot,
index 6c8767f..06c04f7 100644 (file)
@@ -49,13 +49,15 @@ posix_acl_set(struct dentry *dentry, const char *name, const void *value,
 
        reiserfs_write_lock(inode->i_sb);
        error = journal_begin(&th, inode->i_sb, jcreate_blocks);
+       reiserfs_write_unlock(inode->i_sb);
        if (error == 0) {
                error = reiserfs_set_acl(&th, inode, type, acl);
+               reiserfs_write_lock(inode->i_sb);
                error2 = journal_end(&th, inode->i_sb, jcreate_blocks);
+               reiserfs_write_unlock(inode->i_sb);
                if (error2)
                        error = error2;
        }
-       reiserfs_write_unlock(inode->i_sb);
 
       release_and_out:
        posix_acl_release(acl);
@@ -435,12 +437,14 @@ int reiserfs_cache_default_acl(struct inode *inode)
        return nblocks;
 }
 
+/*
+ * Called under i_mutex
+ */
 int reiserfs_acl_chmod(struct inode *inode)
 {
        struct reiserfs_transaction_handle th;
        struct posix_acl *acl;
        size_t size;
-       int depth;
        int error;
 
        if (IS_PRIVATE(inode))
@@ -454,9 +458,7 @@ int reiserfs_acl_chmod(struct inode *inode)
                return 0;
        }
 
-       reiserfs_write_unlock(inode->i_sb);
        acl = reiserfs_get_acl(inode, ACL_TYPE_ACCESS);
-       reiserfs_write_lock(inode->i_sb);
        if (!acl)
                return 0;
        if (IS_ERR(acl))
@@ -466,16 +468,18 @@ int reiserfs_acl_chmod(struct inode *inode)
                return error;
 
        size = reiserfs_xattr_nblocks(inode, reiserfs_acl_size(acl->a_count));
-       depth = reiserfs_write_lock_once(inode->i_sb);
+       reiserfs_write_lock(inode->i_sb);
        error = journal_begin(&th, inode->i_sb, size * 2);
+       reiserfs_write_unlock(inode->i_sb);
        if (!error) {
                int error2;
                error = reiserfs_set_acl(&th, inode, ACL_TYPE_ACCESS, acl);
+               reiserfs_write_lock(inode->i_sb);
                error2 = journal_end(&th, inode->i_sb, size * 2);
+               reiserfs_write_unlock(inode->i_sb);
                if (error2)
                        error = error2;
        }
-       reiserfs_write_unlock_once(inode->i_sb, depth);
        posix_acl_release(acl);
        return error;
 }
index 9ac4057..839a2ba 100644 (file)
@@ -630,6 +630,12 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options)
        struct udf_sb_info *sbi = UDF_SB(sb);
        int error = 0;
 
+       if (sbi->s_lvid_bh) {
+               int write_rev = le16_to_cpu(udf_sb_lvidiu(sbi)->minUDFWriteRev);
+               if (write_rev > UDF_MAX_WRITE_VERSION && !(*flags & MS_RDONLY))
+                       return -EACCES;
+       }
+
        uopt.flags = sbi->s_flags;
        uopt.uid   = sbi->s_uid;
        uopt.gid   = sbi->s_gid;
@@ -649,12 +655,6 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options)
        sbi->s_dmode = uopt.dmode;
        write_unlock(&sbi->s_cred_lock);
 
-       if (sbi->s_lvid_bh) {
-               int write_rev = le16_to_cpu(udf_sb_lvidiu(sbi)->minUDFWriteRev);
-               if (write_rev > UDF_MAX_WRITE_VERSION)
-                       *flags |= MS_RDONLY;
-       }
-
        if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
                goto out_unlock;
 
@@ -843,27 +843,38 @@ static int udf_find_fileset(struct super_block *sb,
        return 1;
 }
 
+/*
+ * Load primary Volume Descriptor Sequence
+ *
+ * Return <0 on error, 0 on success. -EAGAIN is special meaning next sequence
+ * should be tried.
+ */
 static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
 {
        struct primaryVolDesc *pvoldesc;
        struct ustr *instr, *outstr;
        struct buffer_head *bh;
        uint16_t ident;
-       int ret = 1;
+       int ret = -ENOMEM;
 
        instr = kmalloc(sizeof(struct ustr), GFP_NOFS);
        if (!instr)
-               return 1;
+               return -ENOMEM;
 
        outstr = kmalloc(sizeof(struct ustr), GFP_NOFS);
        if (!outstr)
                goto out1;
 
        bh = udf_read_tagged(sb, block, block, &ident);
-       if (!bh)
+       if (!bh) {
+               ret = -EAGAIN;
                goto out2;
+       }
 
-       BUG_ON(ident != TAG_IDENT_PVD);
+       if (ident != TAG_IDENT_PVD) {
+               ret = -EIO;
+               goto out_bh;
+       }
 
        pvoldesc = (struct primaryVolDesc *)bh->b_data;
 
@@ -889,8 +900,9 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
                if (udf_CS0toUTF8(outstr, instr))
                        udf_debug("volSetIdent[] = '%s'\n", outstr->u_name);
 
-       brelse(bh);
        ret = 0;
+out_bh:
+       brelse(bh);
 out2:
        kfree(outstr);
 out1:
@@ -947,7 +959,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
 
                if (mdata->s_mirror_fe == NULL) {
                        udf_err(sb, "Both metadata and mirror metadata inode efe can not found\n");
-                       goto error_exit;
+                       return -EIO;
                }
        }
 
@@ -964,23 +976,18 @@ static int udf_load_metadata_files(struct super_block *sb, int partition)
                          addr.logicalBlockNum, addr.partitionReferenceNum);
 
                mdata->s_bitmap_fe = udf_iget(sb, &addr);
-
                if (mdata->s_bitmap_fe == NULL) {
                        if (sb->s_flags & MS_RDONLY)
                                udf_warn(sb, "bitmap inode efe not found but it's ok since the disc is mounted read-only\n");
                        else {
                                udf_err(sb, "bitmap inode efe not found and attempted read-write mount\n");
-                               goto error_exit;
+                               return -EIO;
                        }
                }
        }
 
        udf_debug("udf_load_metadata_files Ok\n");
-
        return 0;
-
-error_exit:
-       return 1;
 }
 
 static void udf_load_fileset(struct super_block *sb, struct buffer_head *bh,
@@ -1069,7 +1076,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
                if (!map->s_uspace.s_table) {
                        udf_debug("cannot load unallocSpaceTable (part %d)\n",
                                  p_index);
-                       return 1;
+                       return -EIO;
                }
                map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE;
                udf_debug("unallocSpaceTable (part %d) @ %ld\n",
@@ -1079,7 +1086,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
        if (phd->unallocSpaceBitmap.extLength) {
                struct udf_bitmap *bitmap = udf_sb_alloc_bitmap(sb, p_index);
                if (!bitmap)
-                       return 1;
+                       return -ENOMEM;
                map->s_uspace.s_bitmap = bitmap;
                bitmap->s_extPosition = le32_to_cpu(
                                phd->unallocSpaceBitmap.extPosition);
@@ -1102,7 +1109,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
                if (!map->s_fspace.s_table) {
                        udf_debug("cannot load freedSpaceTable (part %d)\n",
                                  p_index);
-                       return 1;
+                       return -EIO;
                }
 
                map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE;
@@ -1113,7 +1120,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
        if (phd->freedSpaceBitmap.extLength) {
                struct udf_bitmap *bitmap = udf_sb_alloc_bitmap(sb, p_index);
                if (!bitmap)
-                       return 1;
+                       return -ENOMEM;
                map->s_fspace.s_bitmap = bitmap;
                bitmap->s_extPosition = le32_to_cpu(
                                phd->freedSpaceBitmap.extPosition);
@@ -1165,7 +1172,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
                udf_find_vat_block(sb, p_index, type1_index, blocks - 1);
        }
        if (!sbi->s_vat_inode)
-               return 1;
+               return -EIO;
 
        if (map->s_partition_type == UDF_VIRTUAL_MAP15) {
                map->s_type_specific.s_virtual.s_start_offset = 0;
@@ -1177,7 +1184,7 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
                        pos = udf_block_map(sbi->s_vat_inode, 0);
                        bh = sb_bread(sb, pos);
                        if (!bh)
-                               return 1;
+                               return -EIO;
                        vat20 = (struct virtualAllocationTable20 *)bh->b_data;
                } else {
                        vat20 = (struct virtualAllocationTable20 *)
@@ -1195,6 +1202,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
        return 0;
 }
 
+/*
+ * Load partition descriptor block
+ *
+ * Returns <0 on error, 0 on success, -EAGAIN is special - try next descriptor
+ * sequence.
+ */
 static int udf_load_partdesc(struct super_block *sb, sector_t block)
 {
        struct buffer_head *bh;
@@ -1204,13 +1217,15 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
        int i, type1_idx;
        uint16_t partitionNumber;
        uint16_t ident;
-       int ret = 0;
+       int ret;
 
        bh = udf_read_tagged(sb, block, block, &ident);
        if (!bh)
-               return 1;
-       if (ident != TAG_IDENT_PD)
+               return -EAGAIN;
+       if (ident != TAG_IDENT_PD) {
+               ret = 0;
                goto out_bh;
+       }
 
        p = (struct partitionDesc *)bh->b_data;
        partitionNumber = le16_to_cpu(p->partitionNumber);
@@ -1229,10 +1244,13 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
        if (i >= sbi->s_partitions) {
                udf_debug("Partition (%d) not found in partition map\n",
                          partitionNumber);
+               ret = 0;
                goto out_bh;
        }
 
        ret = udf_fill_partdesc_info(sb, p, i);
+       if (ret < 0)
+               goto out_bh;
 
        /*
         * Now rescan for VIRTUAL or METADATA partitions when SPARABLE and
@@ -1249,32 +1267,37 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block)
                        break;
        }
 
-       if (i >= sbi->s_partitions)
+       if (i >= sbi->s_partitions) {
+               ret = 0;
                goto out_bh;
+       }
 
        ret = udf_fill_partdesc_info(sb, p, i);
-       if (ret)
+       if (ret < 0)
                goto out_bh;
 
        if (map->s_partition_type == UDF_METADATA_MAP25) {
                ret = udf_load_metadata_files(sb, i);
-               if (ret) {
+               if (ret < 0) {
                        udf_err(sb, "error loading MetaData partition map %d\n",
                                i);
                        goto out_bh;
                }
        } else {
-               ret = udf_load_vat(sb, i, type1_idx);
-               if (ret)
-                       goto out_bh;
                /*
-                * Mark filesystem read-only if we have a partition with
-                * virtual map since we don't handle writing to it (we
-                * overwrite blocks instead of relocating them).
+                * If we have a partition with virtual map, we don't handle
+                * writing to it (we overwrite blocks instead of relocating
+                * them).
                 */
-               sb->s_flags |= MS_RDONLY;
-               pr_notice("Filesystem marked read-only because writing to pseudooverwrite partition is not implemented\n");
+               if (!(sb->s_flags & MS_RDONLY)) {
+                       ret = -EACCES;
+                       goto out_bh;
+               }
+               ret = udf_load_vat(sb, i, type1_idx);
+               if (ret < 0)
+                       goto out_bh;
        }
+       ret = 0;
 out_bh:
        /* In case loading failed, we handle cleanup in udf_fill_super */
        brelse(bh);
@@ -1340,11 +1363,11 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
        uint16_t ident;
        struct buffer_head *bh;
        unsigned int table_len;
-       int ret = 0;
+       int ret;
 
        bh = udf_read_tagged(sb, block, block, &ident);
        if (!bh)
-               return 1;
+               return -EAGAIN;
        BUG_ON(ident != TAG_IDENT_LVD);
        lvd = (struct logicalVolDesc *)bh->b_data;
        table_len = le32_to_cpu(lvd->mapTableLength);
@@ -1352,7 +1375,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
                udf_err(sb, "error loading logical volume descriptor: "
                        "Partition table too long (%u > %lu)\n", table_len,
                        sb->s_blocksize - sizeof(*lvd));
-               ret = 1;
+               ret = -EIO;
                goto out_bh;
        }
 
@@ -1396,11 +1419,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
                        } else if (!strncmp(upm2->partIdent.ident,
                                                UDF_ID_SPARABLE,
                                                strlen(UDF_ID_SPARABLE))) {
-                               if (udf_load_sparable_map(sb, map,
-                                   (struct sparablePartitionMap *)gpm) < 0) {
-                                       ret = 1;
+                               ret = udf_load_sparable_map(sb, map,
+                                       (struct sparablePartitionMap *)gpm);
+                               if (ret < 0)
                                        goto out_bh;
-                               }
                        } else if (!strncmp(upm2->partIdent.ident,
                                                UDF_ID_METADATA,
                                                strlen(UDF_ID_METADATA))) {
@@ -1465,7 +1487,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
        }
        if (lvd->integritySeqExt.extLength)
                udf_load_logicalvolint(sb, leea_to_cpu(lvd->integritySeqExt));
-
+       ret = 0;
 out_bh:
        brelse(bh);
        return ret;
@@ -1503,22 +1525,18 @@ static void udf_load_logicalvolint(struct super_block *sb, struct kernel_extent_
 }
 
 /*
- * udf_process_sequence
- *
- * PURPOSE
- *     Process a main/reserve volume descriptor sequence.
- *
- * PRE-CONDITIONS
- *     sb                      Pointer to _locked_ superblock.
- *     block                   First block of first extent of the sequence.
- *     lastblock               Lastblock of first extent of the sequence.
+ * Process a main/reserve volume descriptor sequence.
+ *   @block            First block of first extent of the sequence.
+ *   @lastblock                Lastblock of first extent of the sequence.
+ *   @fileset          There we store extent containing root fileset
  *
- * HISTORY
- *     July 1, 1997 - Andrew E. Mileski
- *     Written, tested, and released.
+ * Returns <0 on error, 0 on success. -EAGAIN is special - try next descriptor
+ * sequence
  */
-static noinline int udf_process_sequence(struct super_block *sb, long block,
-                               long lastblock, struct kernel_lb_addr *fileset)
+static noinline int udf_process_sequence(
+               struct super_block *sb,
+               sector_t block, sector_t lastblock,
+               struct kernel_lb_addr *fileset)
 {
        struct buffer_head *bh = NULL;
        struct udf_vds_record vds[VDS_POS_LENGTH];
@@ -1529,6 +1547,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
        uint32_t vdsn;
        uint16_t ident;
        long next_s = 0, next_e = 0;
+       int ret;
 
        memset(vds, 0, sizeof(struct udf_vds_record) * VDS_POS_LENGTH);
 
@@ -1543,7 +1562,7 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
                        udf_err(sb,
                                "Block %llu of volume descriptor sequence is corrupted or we could not read it\n",
                                (unsigned long long)block);
-                       return 1;
+                       return -EAGAIN;
                }
 
                /* Process each descriptor (ISO 13346 3/8.3-8.4) */
@@ -1616,14 +1635,19 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
         */
        if (!vds[VDS_POS_PRIMARY_VOL_DESC].block) {
                udf_err(sb, "Primary Volume Descriptor not found!\n");
-               return 1;
+               return -EAGAIN;
+       }
+       ret = udf_load_pvoldesc(sb, vds[VDS_POS_PRIMARY_VOL_DESC].block);
+       if (ret < 0)
+               return ret;
+
+       if (vds[VDS_POS_LOGICAL_VOL_DESC].block) {
+               ret = udf_load_logicalvol(sb,
+                                         vds[VDS_POS_LOGICAL_VOL_DESC].block,
+                                         fileset);
+               if (ret < 0)
+                       return ret;
        }
-       if (udf_load_pvoldesc(sb, vds[VDS_POS_PRIMARY_VOL_DESC].block))
-               return 1;
-
-       if (vds[VDS_POS_LOGICAL_VOL_DESC].block && udf_load_logicalvol(sb,
-           vds[VDS_POS_LOGICAL_VOL_DESC].block, fileset))
-               return 1;
 
        if (vds[VDS_POS_PARTITION_DESC].block) {
                /*
@@ -1632,19 +1656,27 @@ static noinline int udf_process_sequence(struct super_block *sb, long block,
                 */
                for (block = vds[VDS_POS_PARTITION_DESC].block;
                     block < vds[VDS_POS_TERMINATING_DESC].block;
-                    block++)
-                       if (udf_load_partdesc(sb, block))
-                               return 1;
+                    block++) {
+                       ret = udf_load_partdesc(sb, block);
+                       if (ret < 0)
+                               return ret;
+               }
        }
 
        return 0;
 }
 
+/*
+ * Load Volume Descriptor Sequence described by anchor in bh
+ *
+ * Returns <0 on error, 0 on success
+ */
 static int udf_load_sequence(struct super_block *sb, struct buffer_head *bh,
                             struct kernel_lb_addr *fileset)
 {
        struct anchorVolDescPtr *anchor;
-       long main_s, main_e, reserve_s, reserve_e;
+       sector_t main_s, main_e, reserve_s, reserve_e;
+       int ret;
 
        anchor = (struct anchorVolDescPtr *)bh->b_data;
 
@@ -1662,18 +1694,26 @@ static int udf_load_sequence(struct super_block *sb, struct buffer_head *bh,
 
        /* Process the main & reserve sequences */
        /* responsible for finding the PartitionDesc(s) */
-       if (!udf_process_sequence(sb, main_s, main_e, fileset))
-               return 1;
-       udf_sb_free_partitions(sb);
-       if (!udf_process_sequence(sb, reserve_s, reserve_e, fileset))
-               return 1;
+       ret = udf_process_sequence(sb, main_s, main_e, fileset);
+       if (ret != -EAGAIN)
+               return ret;
        udf_sb_free_partitions(sb);
-       return 0;
+       ret = udf_process_sequence(sb, reserve_s, reserve_e, fileset);
+       if (ret < 0) {
+               udf_sb_free_partitions(sb);
+               /* No sequence was OK, return -EIO */
+               if (ret == -EAGAIN)
+                       ret = -EIO;
+       }
+       return ret;
 }
 
 /*
  * Check whether there is an anchor block in the given block and
  * load Volume Descriptor Sequence if so.
+ *
+ * Returns <0 on error, 0 on success, -EAGAIN is special - try next anchor
+ * block
  */
 static int udf_check_anchor_block(struct super_block *sb, sector_t block,
                                  struct kernel_lb_addr *fileset)
@@ -1685,33 +1725,40 @@ static int udf_check_anchor_block(struct super_block *sb, sector_t block,
        if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV) &&
            udf_fixed_to_variable(block) >=
            sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits)
-               return 0;
+               return -EAGAIN;
 
        bh = udf_read_tagged(sb, block, block, &ident);
        if (!bh)
-               return 0;
+               return -EAGAIN;
        if (ident != TAG_IDENT_AVDP) {
                brelse(bh);
-               return 0;
+               return -EAGAIN;
        }
        ret = udf_load_sequence(sb, bh, fileset);
        brelse(bh);
        return ret;
 }
 
-/* Search for an anchor volume descriptor pointer */
-static sector_t udf_scan_anchors(struct super_block *sb, sector_t lastblock,
-                                struct kernel_lb_addr *fileset)
+/*
+ * Search for an anchor volume descriptor pointer.
+ *
+ * Returns < 0 on error, 0 on success. -EAGAIN is special - try next set
+ * of anchors.
+ */
+static int udf_scan_anchors(struct super_block *sb, sector_t *lastblock,
+                           struct kernel_lb_addr *fileset)
 {
        sector_t last[6];
        int i;
        struct udf_sb_info *sbi = UDF_SB(sb);
        int last_count = 0;
+       int ret;
 
        /* First try user provided anchor */
        if (sbi->s_anchor) {
-               if (udf_check_anchor_block(sb, sbi->s_anchor, fileset))
-                       return lastblock;
+               ret = udf_check_anchor_block(sb, sbi->s_anchor, fileset);
+               if (ret != -EAGAIN)
+                       return ret;
        }
        /*
         * according to spec, anchor is in either:
@@ -1720,39 +1767,46 @@ static sector_t udf_scan_anchors(struct super_block *sb, sector_t lastblock,
         *     lastblock
         *  however, if the disc isn't closed, it could be 512.
         */
-       if (udf_check_anchor_block(sb, sbi->s_session + 256, fileset))
-               return lastblock;
+       ret = udf_check_anchor_block(sb, sbi->s_session + 256, fileset);
+       if (ret != -EAGAIN)
+               return ret;
        /*
         * The trouble is which block is the last one. Drives often misreport
         * this so we try various possibilities.
         */
-       last[last_count++] = lastblock;
-       if (lastblock >= 1)
-               last[last_count++] = lastblock - 1;
-       last[last_count++] = lastblock + 1;
-       if (lastblock >= 2)
-               last[last_count++] = lastblock - 2;
-       if (lastblock >= 150)
-               last[last_count++] = lastblock - 150;
-       if (lastblock >= 152)
-               last[last_count++] = lastblock - 152;
+       last[last_count++] = *lastblock;
+       if (*lastblock >= 1)
+               last[last_count++] = *lastblock - 1;
+       last[last_count++] = *lastblock + 1;
+       if (*lastblock >= 2)
+               last[last_count++] = *lastblock - 2;
+       if (*lastblock >= 150)
+               last[last_count++] = *lastblock - 150;
+       if (*lastblock >= 152)
+               last[last_count++] = *lastblock - 152;
 
        for (i = 0; i < last_count; i++) {
                if (last[i] >= sb->s_bdev->bd_inode->i_size >>
                                sb->s_blocksize_bits)
                        continue;
-               if (udf_check_anchor_block(sb, last[i], fileset))
-                       return last[i];
+               ret = udf_check_anchor_block(sb, last[i], fileset);
+               if (ret != -EAGAIN) {
+                       if (!ret)
+                               *lastblock = last[i];
+                       return ret;
+               }
                if (last[i] < 256)
                        continue;
-               if (udf_check_anchor_block(sb, last[i] - 256, fileset))
-                       return last[i];
+               ret = udf_check_anchor_block(sb, last[i] - 256, fileset);
+               if (ret != -EAGAIN) {
+                       if (!ret)
+                               *lastblock = last[i];
+                       return ret;
+               }
        }
 
        /* Finally try block 512 in case media is open */
-       if (udf_check_anchor_block(sb, sbi->s_session + 512, fileset))
-               return last[0];
-       return 0;
+       return udf_check_anchor_block(sb, sbi->s_session + 512, fileset);
 }
 
 /*
@@ -1760,54 +1814,59 @@ static sector_t udf_scan_anchors(struct super_block *sb, sector_t lastblock,
  * area specified by it. The function expects sbi->s_lastblock to be the last
  * block on the media.
  *
- * Return 1 if ok, 0 if not found.
- *
+ * Return <0 on error, 0 if anchor found. -EAGAIN is special meaning anchor
+ * was not found.
  */
 static int udf_find_anchor(struct super_block *sb,
                           struct kernel_lb_addr *fileset)
 {
-       sector_t lastblock;
        struct udf_sb_info *sbi = UDF_SB(sb);
+       sector_t lastblock = sbi->s_last_block;
+       int ret;
 
-       lastblock = udf_scan_anchors(sb, sbi->s_last_block, fileset);
-       if (lastblock)
+       ret = udf_scan_anchors(sb, &lastblock, fileset);
+       if (ret != -EAGAIN)
                goto out;
 
        /* No anchor found? Try VARCONV conversion of block numbers */
        UDF_SET_FLAG(sb, UDF_FLAG_VARCONV);
+       lastblock = udf_variable_to_fixed(sbi->s_last_block);
        /* Firstly, we try to not convert number of the last block */
-       lastblock = udf_scan_anchors(sb,
-                               udf_variable_to_fixed(sbi->s_last_block),
-                               fileset);
-       if (lastblock)
+       ret = udf_scan_anchors(sb, &lastblock, fileset);
+       if (ret != -EAGAIN)
                goto out;
 
+       lastblock = sbi->s_last_block;
        /* Secondly, we try with converted number of the last block */
-       lastblock = udf_scan_anchors(sb, sbi->s_last_block, fileset);
-       if (!lastblock) {
+       ret = udf_scan_anchors(sb, &lastblock, fileset);
+       if (ret < 0) {
                /* VARCONV didn't help. Clear it. */
                UDF_CLEAR_FLAG(sb, UDF_FLAG_VARCONV);
-               return 0;
        }
 out:
-       sbi->s_last_block = lastblock;
-       return 1;
+       if (ret == 0)
+               sbi->s_last_block = lastblock;
+       return ret;
 }
 
 /*
  * Check Volume Structure Descriptor, find Anchor block and load Volume
- * Descriptor Sequence
+ * Descriptor Sequence.
+ *
+ * Returns < 0 on error, 0 on success. -EAGAIN is special meaning anchor
+ * block was not found.
  */
 static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
                        int silent, struct kernel_lb_addr *fileset)
 {
        struct udf_sb_info *sbi = UDF_SB(sb);
        loff_t nsr_off;
+       int ret;
 
        if (!sb_set_blocksize(sb, uopt->blocksize)) {
                if (!silent)
                        udf_warn(sb, "Bad block size\n");
-               return 0;
+               return -EINVAL;
        }
        sbi->s_last_block = uopt->lastblock;
        if (!uopt->novrs) {
@@ -1828,12 +1887,13 @@ static int udf_load_vrs(struct super_block *sb, struct udf_options *uopt,
 
        /* Look for anchor block and load Volume Descriptor Sequence */
        sbi->s_anchor = uopt->anchor;
-       if (!udf_find_anchor(sb, fileset)) {
-               if (!silent)
+       ret = udf_find_anchor(sb, fileset);
+       if (ret < 0) {
+               if (!silent && ret == -EAGAIN)
                        udf_warn(sb, "No anchor found\n");
-               return 0;
+               return ret;
        }
-       return 1;
+       return 0;
 }
 
 static void udf_open_lvid(struct super_block *sb)
@@ -1939,7 +1999,7 @@ u64 lvid_get_unique_id(struct super_block *sb)
 
 static int udf_fill_super(struct super_block *sb, void *options, int silent)
 {
-       int ret;
+       int ret = -EINVAL;
        struct inode *inode = NULL;
        struct udf_options uopt;
        struct kernel_lb_addr rootdir, fileset;
@@ -2011,7 +2071,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        } else {
                uopt.blocksize = bdev_logical_block_size(sb->s_bdev);
                ret = udf_load_vrs(sb, &uopt, silent, &fileset);
-               if (!ret && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) {
+               if (ret == -EAGAIN && uopt.blocksize != UDF_DEFAULT_BLOCKSIZE) {
                        if (!silent)
                                pr_notice("Rescanning with blocksize %d\n",
                                          UDF_DEFAULT_BLOCKSIZE);
@@ -2021,8 +2081,11 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
                        ret = udf_load_vrs(sb, &uopt, silent, &fileset);
                }
        }
-       if (!ret) {
-               udf_warn(sb, "No partition found (1)\n");
+       if (ret < 0) {
+               if (ret == -EAGAIN) {
+                       udf_warn(sb, "No partition found (1)\n");
+                       ret = -EINVAL;
+               }
                goto error_out;
        }
 
@@ -2040,9 +2103,13 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
                        udf_err(sb, "minUDFReadRev=%x (max is %x)\n",
                                le16_to_cpu(lvidiu->minUDFReadRev),
                                UDF_MAX_READ_VERSION);
+                       ret = -EINVAL;
+                       goto error_out;
+               } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION &&
+                          !(sb->s_flags & MS_RDONLY)) {
+                       ret = -EACCES;
                        goto error_out;
-               } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION)
-                       sb->s_flags |= MS_RDONLY;
+               }
 
                sbi->s_udfrev = minUDFWriteRev;
 
@@ -2054,17 +2121,20 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
 
        if (!sbi->s_partitions) {
                udf_warn(sb, "No partition found (2)\n");
+               ret = -EINVAL;
                goto error_out;
        }
 
        if (sbi->s_partmaps[sbi->s_partition].s_partition_flags &
-                       UDF_PART_FLAG_READ_ONLY) {
-               pr_notice("Partition marked readonly; forcing readonly mount\n");
-               sb->s_flags |= MS_RDONLY;
+                       UDF_PART_FLAG_READ_ONLY &&
+           !(sb->s_flags & MS_RDONLY)) {
+               ret = -EACCES;
+               goto error_out;
        }
 
        if (udf_find_fileset(sb, &fileset, &rootdir)) {
                udf_warn(sb, "No fileset found\n");
+               ret = -EINVAL;
                goto error_out;
        }
 
@@ -2086,6 +2156,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        if (!inode) {
                udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n",
                       rootdir.logicalBlockNum, rootdir.partitionReferenceNum);
+               ret = -EIO;
                goto error_out;
        }
 
@@ -2093,6 +2164,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
        sb->s_root = d_make_root(inode);
        if (!sb->s_root) {
                udf_err(sb, "Couldn't allocate root dentry\n");
+               ret = -ENOMEM;
                goto error_out;
        }
        sb->s_maxbytes = MAX_LFS_FILESIZE;
@@ -2113,7 +2185,7 @@ error_out:
        kfree(sbi);
        sb->s_fs_info = NULL;
 
-       return -EINVAL;
+       return ret;
 }
 
 void _udf_err(struct super_block *sb, const char *function,
index 5c449c8..0c7d48b 100644 (file)
 
 #define SAMSUNG_PWM_NUM                5
 
+/*
+ * Following declaration must be in an ifdef due to this symbol being static
+ * in pwm-samsung driver if the clocksource driver is not compiled in and the
+ * spinlock is not shared between both drivers.
+ */
+#ifdef CONFIG_CLKSRC_SAMSUNG_PWM
 extern spinlock_t samsung_pwm_lock;
+#endif
 
 struct samsung_pwm_variant {
        u8 bits;
diff --git a/include/dt-bindings/pinctrl/nomadik.h b/include/dt-bindings/pinctrl/nomadik.h
new file mode 100644 (file)
index 0000000..638fb32
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * nomadik.h
+ *
+ * Copyright (C) ST-Ericsson SA 2013
+ * Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#define INPUT_NOPULL           0
+#define INPUT_PULLUP           1
+#define INPUT_PULLDOWN         2
+
+#define OUTPUT_LOW             0
+#define OUTPUT_HIGH            1
+#define DIR_OUTPUT             2
+
+#define SLPM_DISABLED          0
+#define SLPM_ENABLED           1
+
+#define SLPM_INPUT_NOPULL      0
+#define SLPM_INPUT_PULLUP      1
+#define SLPM_INPUT_PULLDOWN    2
+#define SLPM_DIR_INPUT         3
+
+#define SLPM_OUTPUT_LOW                0
+#define SLPM_OUTPUT_HIGH       1
+#define SLPM_DIR_OUTPUT                2
+
+#define SLPM_WAKEUP_DISABLE    0
+#define SLPM_WAKEUP_ENABLE     1
+
+#define GPIOMODE_DISABLED      0
+#define GPIOMODE_ENABLED       1
+
+#define SLPM_PDIS_DISABLED     0
+#define SLPM_PDIS_ENABLED      1
index cff544f..d30209b 100644 (file)
@@ -60,7 +60,6 @@ Mellon the rights to redistribute these changes without encumbrance.
 
 #if defined(__linux__)
 typedef unsigned long long u_quad_t;
-#else
 #endif
 #include <uapi/linux/coda.h>
 #endif 
index 383d5e3..bb942f6 100644 (file)
@@ -140,14 +140,24 @@ struct f2fs_extent {
 } __packed;
 
 #define F2FS_NAME_LEN          255
-#define ADDRS_PER_INODE         923    /* Address Pointers in an Inode */
-#define ADDRS_PER_BLOCK         1018   /* Address Pointers in a Direct Block */
-#define NIDS_PER_BLOCK          1018   /* Node IDs in an Indirect Block */
+#define F2FS_INLINE_XATTR_ADDRS        50      /* 200 bytes for inline xattrs */
+#define DEF_ADDRS_PER_INODE    923     /* Address Pointers in an Inode */
+#define ADDRS_PER_INODE(fi)    addrs_per_inode(fi)
+#define ADDRS_PER_BLOCK                1018    /* Address Pointers in a Direct Block */
+#define NIDS_PER_BLOCK         1018    /* Node IDs in an Indirect Block */
+
+#define        NODE_DIR1_BLOCK         (DEF_ADDRS_PER_INODE + 1)
+#define        NODE_DIR2_BLOCK         (DEF_ADDRS_PER_INODE + 2)
+#define        NODE_IND1_BLOCK         (DEF_ADDRS_PER_INODE + 3)
+#define        NODE_IND2_BLOCK         (DEF_ADDRS_PER_INODE + 4)
+#define        NODE_DIND_BLOCK         (DEF_ADDRS_PER_INODE + 5)
+
+#define F2FS_INLINE_XATTR      0x01    /* file inline xattr flag */
 
 struct f2fs_inode {
        __le16 i_mode;                  /* file mode */
        __u8 i_advise;                  /* file hints */
-       __u8 i_reserved;                /* reserved */
+       __u8 i_inline;                  /* file inline flags */
        __le32 i_uid;                   /* user ID */
        __le32 i_gid;                   /* group ID */
        __le32 i_links;                 /* links count */
@@ -170,7 +180,7 @@ struct f2fs_inode {
 
        struct f2fs_extent i_ext;       /* caching a largest extent */
 
-       __le32 i_addr[ADDRS_PER_INODE]; /* Pointers to data blocks */
+       __le32 i_addr[DEF_ADDRS_PER_INODE];     /* Pointers to data blocks */
 
        __le32 i_nid[5];                /* direct(2), indirect(2),
                                                double_indirect(1) node id */
index ecefb73..32ba451 100644 (file)
@@ -172,7 +172,7 @@ struct hid_sensor_common {
        struct hid_sensor_hub_attribute_info sensitivity;
 };
 
-/*Convert from hid unit expo to regular exponent*/
+/* Convert from hid unit expo to regular exponent */
 static inline int hid_sensor_convert_exponent(int unit_expo)
 {
        if (unit_expo < 0x08)
index 6f24446..4f945d3 100644 (file)
@@ -37,7 +37,7 @@
 #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS                  0x200458
 #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS                  0x200459
 
-/*ORIENTATION: Compass 3D: (200083) */
+/* ORIENTATION: Compass 3D: (200083) */
 #define HID_USAGE_SENSOR_COMPASS_3D                            0x200083
 #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING                   0x200471
 #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X                 0x200472
index 0c48991..ee1ffc5 100644 (file)
@@ -252,6 +252,8 @@ struct hid_item {
 #define HID_OUTPUT_REPORT      1
 #define HID_FEATURE_REPORT     2
 
+#define HID_REPORT_TYPES       3
+
 /*
  * HID connect requests
  */
@@ -283,6 +285,7 @@ struct hid_item {
 #define HID_QUIRK_MULTI_INPUT                  0x00000040
 #define HID_QUIRK_HIDINPUT_FORCE               0x00000080
 #define HID_QUIRK_NO_EMPTY_INPUT               0x00000100
+#define HID_QUIRK_NO_INIT_INPUT_REPORTS                0x00000200
 #define HID_QUIRK_SKIP_OUTPUT_REPORTS          0x00010000
 #define HID_QUIRK_FULLSPEED_INTERVAL           0x10000000
 #define HID_QUIRK_NO_INIT_REPORTS              0x20000000
@@ -295,6 +298,7 @@ struct hid_item {
 #define HID_GROUP_GENERIC                      0x0001
 #define HID_GROUP_MULTITOUCH                   0x0002
 #define HID_GROUP_SENSOR_HUB                   0x0003
+#define HID_GROUP_MULTITOUCH_WIN_8             0x0004
 
 /*
  * This is the global environment of the parser. This information is
@@ -393,14 +397,14 @@ struct hid_report {
        struct hid_device *device;                      /* associated device */
 };
 
+#define HID_MAX_IDS 256
+
 struct hid_report_enum {
        unsigned numbered;
        struct list_head report_list;
-       struct hid_report *report_id_hash[256];
+       struct hid_report *report_id_hash[HID_MAX_IDS];
 };
 
-#define HID_REPORT_TYPES 3
-
 #define HID_MIN_BUFFER_SIZE    64              /* make sure there is at least a packet size of space */
 #define HID_MAX_BUFFER_SIZE    4096            /* 4kb */
 #define HID_CONTROL_FIFO_SIZE  256             /* to init devices with >100 reports */
@@ -456,6 +460,7 @@ struct hid_device {                                                 /* device report descriptor */
        enum hid_type type;                                             /* device type (mouse, kbd, ...) */
        unsigned country;                                               /* HID country */
        struct hid_report_enum report_enum[HID_REPORT_TYPES];
+       struct work_struct led_work;                                    /* delayed LED worker */
 
        struct semaphore driver_lock;                                   /* protects the current driver, except during input */
        struct semaphore driver_input_lock;                             /* protects the current driver */
@@ -532,6 +537,8 @@ static inline void hid_set_drvdata(struct hid_device *hdev, void *data)
 #define HID_GLOBAL_STACK_SIZE 4
 #define HID_COLLECTION_STACK_SIZE 4
 
+#define HID_SCAN_FLAG_MT_WIN_8                 0x00000001
+
 struct hid_parser {
        struct hid_global     global;
        struct hid_global     global_stack[HID_GLOBAL_STACK_SIZE];
@@ -540,6 +547,7 @@ struct hid_parser {
        unsigned              collection_stack[HID_COLLECTION_STACK_SIZE];
        unsigned              collection_stack_ptr;
        struct hid_device    *device;
+       unsigned              scan_flags;
 };
 
 struct hid_class_descriptor {
@@ -744,6 +752,7 @@ struct hid_field *hidinput_get_led_field(struct hid_device *hid);
 unsigned int hidinput_count_leds(struct hid_device *hid);
 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
 void hid_output_report(struct hid_report *report, __u8 *data);
+u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags);
 struct hid_device *hid_allocate_device(void);
 struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
@@ -989,7 +998,6 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
 u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
 int usbhid_quirks_init(char **quirks_param);
 void usbhid_quirks_exit(void);
-void usbhid_set_leds(struct hid_device *hid);
 
 #ifdef CONFIG_HID_PID
 int hid_pidff_init(struct hid_device *hid);
index 2451662..ddf5261 100644 (file)
@@ -23,6 +23,7 @@ struct hidraw {
        wait_queue_head_t wait;
        struct hid_device *hid;
        struct device *dev;
+       spinlock_t list_lock;
        struct list_head list;
 };
 
index 60e411d..7aa901d 100644 (file)
@@ -19,7 +19,8 @@
  * @hid_descriptor_address: i2c register where the HID descriptor is stored.
  *
  * Note that it is the responsibility of the platform driver (or the acpi 5.0
- * driver) to setup the irq related to the gpio in the struct i2c_board_info.
+ * driver, or the flattened device tree) to setup the irq related to the gpio in
+ * the struct i2c_board_info.
  * The platform driver should also setup the gpio according to the device:
  *
  * A typical example is the following:
index a986ff5..0f9bafa 100644 (file)
 #define I8042_CMD_MUX_PFX      0x0090
 #define I8042_CMD_MUX_SEND     0x1090
 
+/*
+ * Status register bits.
+ */
+
+#define I8042_STR_PARITY       0x80
+#define I8042_STR_TIMEOUT      0x40
+#define I8042_STR_AUXDATA      0x20
+#define I8042_STR_KEYLOCK      0x10
+#define I8042_STR_CMDDAT       0x08
+#define I8042_STR_MUXERR       0x04
+#define I8042_STR_IBF          0x02
+#define I8042_STR_OBF          0x01
+
+/*
+ * Control register bits.
+ */
+
+#define I8042_CTR_KBDINT       0x01
+#define I8042_CTR_AUXINT       0x02
+#define I8042_CTR_IGNKEYLOCK   0x08
+#define I8042_CTR_KBDDIS       0x10
+#define I8042_CTR_AUXDIS       0x20
+#define I8042_CTR_XLATE                0x40
+
 struct serio;
 
 #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
index 8685d1b..31229e0 100644 (file)
 #define JBD_EXPENSIVE_CHECKING
 extern u8 journal_enable_debug;
 
-#define jbd_debug(n, f, a...)                                          \
-       do {                                                            \
-               if ((n) <= journal_enable_debug) {                      \
-                       printk (KERN_DEBUG "(%s, %d): %s: ",            \
-                               __FILE__, __LINE__, __func__);  \
-                       printk (f, ## a);                               \
-               }                                                       \
-       } while (0)
+void __jbd_debug(int level, const char *file, const char *func,
+                unsigned int line, const char *fmt, ...);
+
+#define jbd_debug(n, fmt, a...) \
+       __jbd_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
 #else
-#define jbd_debug(f, a...)     /**/
+#define jbd_debug(n, fmt, a...)    /**/
 #endif
 
 static inline void *jbd_alloc(size_t size, gfp_t flags)
@@ -77,7 +74,7 @@ static inline void *jbd_alloc(size_t size, gfp_t flags)
 static inline void jbd_free(void *ptr, size_t size)
 {
        free_pages((unsigned long)ptr, get_order(size));
-};
+}
 
 #define JFS_MIN_JOURNAL_BLOCKS 1024
 
index debf208..31c0cd1 100644 (file)
@@ -69,7 +69,7 @@ typedef union ktime ktime_t;          /* Kill this */
  * @secs:      seconds to set
  * @nsecs:     nanoseconds to set
  *
- * Return the ktime_t representation of the value
+ * Return: The ktime_t representation of the value.
  */
 static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
 {
@@ -151,7 +151,7 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
  * @lhs:       minuend
  * @rhs:       subtrahend
  *
- * Returns the remainder of the subtraction
+ * Return: The remainder of the subtraction.
  */
 static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
 {
@@ -169,7 +169,7 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
  * @add1:      addend1
  * @add2:      addend2
  *
- * Returns the sum of @add1 and @add2.
+ * Return: The sum of @add1 and @add2.
  */
 static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
 {
@@ -195,7 +195,7 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
  * @kt:                addend
  * @nsec:      the scalar nsec value to add
  *
- * Returns the sum of @kt and @nsec in ktime_t format
+ * Return: The sum of @kt and @nsec in ktime_t format.
  */
 extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
 
@@ -204,7 +204,7 @@ extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
  * @kt:                minuend
  * @nsec:      the scalar nsec value to subtract
  *
- * Returns the subtraction of @nsec from @kt in ktime_t format
+ * Return: The subtraction of @nsec from @kt in ktime_t format.
  */
 extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec);
 
@@ -212,7 +212,7 @@ extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec);
  * timespec_to_ktime - convert a timespec to ktime_t format
  * @ts:                the timespec variable to convert
  *
- * Returns a ktime_t variable with the converted timespec value
+ * Return: A ktime_t variable with the converted timespec value.
  */
 static inline ktime_t timespec_to_ktime(const struct timespec ts)
 {
@@ -224,7 +224,7 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts)
  * timeval_to_ktime - convert a timeval to ktime_t format
  * @tv:                the timeval variable to convert
  *
- * Returns a ktime_t variable with the converted timeval value
+ * Return: A ktime_t variable with the converted timeval value.
  */
 static inline ktime_t timeval_to_ktime(const struct timeval tv)
 {
@@ -237,7 +237,7 @@ static inline ktime_t timeval_to_ktime(const struct timeval tv)
  * ktime_to_timespec - convert a ktime_t variable to timespec format
  * @kt:                the ktime_t variable to convert
  *
- * Returns the timespec representation of the ktime value
+ * Return: The timespec representation of the ktime value.
  */
 static inline struct timespec ktime_to_timespec(const ktime_t kt)
 {
@@ -249,7 +249,7 @@ static inline struct timespec ktime_to_timespec(const ktime_t kt)
  * ktime_to_timeval - convert a ktime_t variable to timeval format
  * @kt:                the ktime_t variable to convert
  *
- * Returns the timeval representation of the ktime value
+ * Return: The timeval representation of the ktime value.
  */
 static inline struct timeval ktime_to_timeval(const ktime_t kt)
 {
@@ -262,7 +262,7 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt)
  * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds
  * @kt:                the ktime_t variable to convert
  *
- * Returns the scalar nanoseconds representation of @kt
+ * Return: The scalar nanoseconds representation of @kt.
  */
 static inline s64 ktime_to_ns(const ktime_t kt)
 {
@@ -276,7 +276,9 @@ static inline s64 ktime_to_ns(const ktime_t kt)
  * @cmp1:      comparable1
  * @cmp2:      comparable2
  *
- * Compare two ktime_t variables, returns 1 if equal
+ * Compare two ktime_t variables.
+ *
+ * Return: 1 if equal.
  */
 static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
 {
@@ -288,7 +290,7 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
  * @cmp1:      comparable1
  * @cmp2:      comparable2
  *
- * Returns ...
+ * Return: ...
  *   cmp1  < cmp2: return <0
  *   cmp1 == cmp2: return 0
  *   cmp1  > cmp2: return >0
@@ -342,7 +344,7 @@ extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
  * @kt:                the ktime_t variable to convert
  * @ts:                the timespec variable to store the result in
  *
- * Returns true if there was a successful conversion, false if kt was 0.
+ * Return: %true if there was a successful conversion, %false if kt was 0.
  */
 static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt,
                                                       struct timespec *ts)
index dba482e..345b8c5 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef __LINUX_MBUS_H
 #define __LINUX_MBUS_H
 
+struct resource;
+
 struct mbus_dram_target_info
 {
        /*
@@ -59,14 +61,18 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
 }
 #endif
 
-int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base,
-                                     size_t size, phys_addr_t remap,
-                                     unsigned int flags);
-int mvebu_mbus_add_window(const char *devname, phys_addr_t base,
-                         size_t size);
+void mvebu_mbus_get_pcie_mem_aperture(struct resource *res);
+void mvebu_mbus_get_pcie_io_aperture(struct resource *res);
+int mvebu_mbus_add_window_remap_by_id(unsigned int target,
+                                     unsigned int attribute,
+                                     phys_addr_t base, size_t size,
+                                     phys_addr_t remap);
+int mvebu_mbus_add_window_by_id(unsigned int target, unsigned int attribute,
+                               phys_addr_t base, size_t size);
 int mvebu_mbus_del_window(phys_addr_t base, size_t size);
 int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base,
                    size_t mbus_size, phys_addr_t sdram_phys_base,
                    size_t sdram_size);
+int mvebu_mbus_dt_init(void);
 
 #endif /* __LINUX_MBUS_H */
index 8752dbb..ad05ce6 100644 (file)
@@ -17,6 +17,7 @@
 
 #define PHY_ID_KSZ8873MLL      0x000e7237
 #define PHY_ID_KSZ9021         0x00221610
+#define PHY_ID_KSZ9021RLRN     0x00221611
 #define PHY_ID_KS8737          0x00221720
 #define PHY_ID_KSZ8021         0x00221555
 #define PHY_ID_KSZ8031         0x00221556
@@ -35,4 +36,9 @@
 /* struct phy_device dev_flags definitions */
 #define MICREL_PHY_50MHZ_CLK   0x00000001
 
+#define MICREL_KSZ9021_EXTREG_CTRL     0xB
+#define MICREL_KSZ9021_EXTREG_DATA_WRITE       0xC
+#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW 0x104
+#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW  0x105
+
 #endif /* _MICREL_PHY_H */
index ee66f3a..b17ead8 100644 (file)
@@ -51,12 +51,31 @@ struct msi_desc {
 };
 
 /*
- * The arch hook for setup up msi irqs
+ * The arch hooks to setup up msi irqs. Those functions are
+ * implemented as weak symbols so that they /can/ be overriden by
+ * architecture specific code if needed.
  */
 int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
 void arch_teardown_msi_irq(unsigned int irq);
 int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
 void arch_teardown_msi_irqs(struct pci_dev *dev);
 int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
+void arch_restore_msi_irqs(struct pci_dev *dev, int irq);
+
+void default_teardown_msi_irqs(struct pci_dev *dev);
+void default_restore_msi_irqs(struct pci_dev *dev, int irq);
+
+struct msi_chip {
+       struct module *owner;
+       struct device *dev;
+       struct device_node *of_node;
+       struct list_head list;
+
+       int (*setup_irq)(struct msi_chip *chip, struct pci_dev *dev,
+                        struct msi_desc *desc);
+       void (*teardown_irq)(struct msi_chip *chip, unsigned int irq);
+       int (*check_device)(struct msi_chip *chip, struct pci_dev *dev,
+                           int nvec, int type);
+};
 
 #endif /* LINUX_MSI_H */
index 7a04826..fd9c408 100644 (file)
@@ -2,6 +2,7 @@
 #define __OF_PCI_H
 
 #include <linux/pci.h>
+#include <linux/msi.h>
 
 struct pci_dev;
 struct of_irq;
@@ -13,4 +14,15 @@ struct device_node *of_pci_find_child_device(struct device_node *parent,
 int of_pci_get_devfn(struct device_node *np);
 int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
 
+#if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI)
+int of_pci_msi_chip_add(struct msi_chip *chip);
+void of_pci_msi_chip_remove(struct msi_chip *chip);
+struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node);
+#else
+static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; }
+static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { }
+static inline struct msi_chip *
+of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; }
+#endif
+
 #endif
index 2088858..da172f9 100644 (file)
@@ -446,6 +446,7 @@ struct pci_bus {
        struct resource busn_res;       /* bus numbers routed to this bus */
 
        struct pci_ops  *ops;           /* configuration access functions */
+       struct msi_chip *msi;           /* MSI controller */
        void            *sysdata;       /* hook for sys-specific extension */
        struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */
 
diff --git a/include/linux/platform_data/bd6107.h b/include/linux/platform_data/bd6107.h
new file mode 100644 (file)
index 0000000..671d650
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * bd6107.h - Rohm BD6107 LEDs Driver
+ *
+ * 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 __BD6107_H__
+#define __BD6107_H__
+
+struct device;
+
+struct bd6107_platform_data {
+       struct device *fbdev;
+       int reset;                      /* Reset GPIO */
+       unsigned int def_value;
+};
+
+#endif
index 573edfb..7c5a519 100644 (file)
@@ -5,6 +5,7 @@ struct gpio_em_config {
        unsigned int gpio_base;
        unsigned int irq_base;
        unsigned int number_of_pins;
+       const char *pctl_name;
 };
 
 #endif /* __GPIO_EM_H__ */
diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h
new file mode 100644 (file)
index 0000000..5ae0d9c
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * gpio_backlight.h - Simple GPIO-controlled backlight
+ *
+ * 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 __GPIO_BACKLIGHT_H__
+#define __GPIO_BACKLIGHT_H__
+
+struct device;
+
+struct gpio_backlight_platform_data {
+       struct device *fbdev;
+       int gpio;
+       int def_value;
+       bool active_low;
+       const char *name;
+};
+
+#endif
diff --git a/include/linux/platform_data/leds-renesas-tpu.h b/include/linux/platform_data/leds-renesas-tpu.h
deleted file mode 100644 (file)
index 0553870..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __LEDS_RENESAS_TPU_H__
-#define __LEDS_RENESAS_TPU_H__
-
-struct led_renesas_tpu_config {
-       char *name;
-       unsigned pin_gpio_fn;
-       unsigned pin_gpio;
-       unsigned int channel_offset;
-       unsigned int timer_bit;
-       unsigned int max_brightness;
-       unsigned int refresh_rate;
-};
-
-#endif /* __LEDS_RENESAS_TPU_H__ */
diff --git a/include/linux/platform_data/lv5207lp.h b/include/linux/platform_data/lv5207lp.h
new file mode 100644 (file)
index 0000000..7dc4d9a
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * lv5207lp.h - Sanyo LV5207LP LEDs Driver
+ *
+ * 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 __LV5207LP_H__
+#define __LV5207LP_H__
+
+struct device;
+
+struct lv5207lp_platform_data {
+       struct device *fbdev;
+       unsigned int max_value;
+       unsigned int def_value;
+};
+
+#endif
diff --git a/include/linux/tegra-cpuidle.h b/include/linux/tegra-cpuidle.h
new file mode 100644 (file)
index 0000000..9c6286b
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2013, NVIDIA 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.
+ */
+
+#ifndef __LINUX_TEGRA_CPUIDLE_H__
+#define __LINUX_TEGRA_CPUIDLE_H__
+
+#ifdef CONFIG_CPU_IDLE
+void tegra_cpuidle_pcie_irqs_in_use(void);
+#else
+static inline void tegra_cpuidle_pcie_irqs_in_use(void)
+{
+}
+#endif
+
+#endif
index dfdfdc0..6fb0856 100644 (file)
@@ -11,8 +11,6 @@
 #ifndef __TIME_ARMADA_370_XPPRCMU_H
 #define __TIME_ARMADA_370_XPPRCMU_H
 
-#include <linux/init.h>
-
-void __init armada_370_xp_timer_init(void);
+void armada_370_xp_timer_init(void);
 
 #endif
index 8e2b7ba..59c17a2 100644 (file)
@@ -22,6 +22,7 @@
 #define EM_PPC         20      /* PowerPC */
 #define EM_PPC64       21       /* PowerPC64 */
 #define EM_SPU         23      /* Cell BE SPU */
+#define EM_ARM         40      /* ARM 32 bit */
 #define EM_SH          42      /* SuperH */
 #define EM_SPARCV9     43      /* SPARC v9 64-bit */
 #define EM_IA_64       50      /* HP/Intel IA-64 */
@@ -34,6 +35,7 @@
 #define EM_MN10300     89      /* Panasonic/MEI MN10300, AM33 */
 #define EM_BLACKFIN     106     /* ADI Blackfin Processor */
 #define EM_TI_C6000    140     /* TI C6X DSPs */
+#define EM_AARCH64     183     /* ARM 64 bit */
 #define EM_FRV         0x5441  /* Fujitsu FR-V */
 #define EM_AVR32       0x18ad  /* Atmel AVR32 */
 
index d584047..d08abf9 100644 (file)
@@ -194,6 +194,8 @@ struct input_keymap_entry {
 #define SYN_CONFIG             1
 #define SYN_MT_REPORT          2
 #define SYN_DROPPED            3
+#define SYN_MAX                        0xf
+#define SYN_CNT                        (SYN_MAX+1)
 
 /*
  * Keys and buttons
index e40ebe1..b47dba2 100644 (file)
 /* ST ASC type numbers */
 #define PORT_ASC       105
 
+/* Tilera TILE-Gx UART */
+#define PORT_TILEGX    106
+
 #endif /* _UAPILINUX_SERIAL_CORE_H */
index e9ed951..414b74b 100644 (file)
@@ -30,7 +30,7 @@ enum uhid_event_type {
        UHID_OPEN,
        UHID_CLOSE,
        UHID_OUTPUT,
-       UHID_OUTPUT_EV,
+       UHID_OUTPUT_EV,                 /* obsolete! */
        UHID_INPUT,
        UHID_FEATURE,
        UHID_FEATURE_ANSWER,
@@ -69,6 +69,8 @@ struct uhid_output_req {
        __u8 rtype;
 } __attribute__((__packed__));
 
+/* Obsolete! Newer kernels will no longer send these events but instead convert
+ * it into raw output reports via UHID_OUTPUT. */
 struct uhid_output_ev_req {
        __u16 type;
        __u16 code;
index 29b7985..987293d 100644 (file)
@@ -541,6 +541,8 @@ static int worker_pool_assign_id(struct worker_pool *pool)
  * This must be called either with pwq_lock held or sched RCU read locked.
  * If the pwq needs to be used beyond the locking in effect, the caller is
  * responsible for guaranteeing that the pwq stays online.
+ *
+ * Return: The unbound pool_workqueue for @node.
  */
 static struct pool_workqueue *unbound_pwq_by_node(struct workqueue_struct *wq,
                                                  int node)
@@ -639,8 +641,6 @@ static struct pool_workqueue *get_work_pwq(struct work_struct *work)
  * get_work_pool - return the worker_pool a given work was associated with
  * @work: the work item of interest
  *
- * Return the worker_pool @work was last associated with.  %NULL if none.
- *
  * Pools are created and destroyed under wq_pool_mutex, and allows read
  * access under sched-RCU read lock.  As such, this function should be
  * called under wq_pool_mutex or with preemption disabled.
@@ -649,6 +649,8 @@ static struct pool_workqueue *get_work_pwq(struct work_struct *work)
  * mentioned locking is in effect.  If the returned pool needs to be used
  * beyond the critical section, the caller is responsible for ensuring the
  * returned pool is and stays online.
+ *
+ * Return: The worker_pool @work was last associated with.  %NULL if none.
  */
 static struct worker_pool *get_work_pool(struct work_struct *work)
 {
@@ -672,7 +674,7 @@ static struct worker_pool *get_work_pool(struct work_struct *work)
  * get_work_pool_id - return the worker pool ID a given work is associated with
  * @work: the work item of interest
  *
- * Return the worker_pool ID @work was last associated with.
+ * Return: The worker_pool ID @work was last associated with.
  * %WORK_OFFQ_POOL_NONE if none.
  */
 static int get_work_pool_id(struct work_struct *work)
@@ -831,7 +833,7 @@ void wq_worker_waking_up(struct task_struct *task, int cpu)
  * CONTEXT:
  * spin_lock_irq(rq->lock)
  *
- * RETURNS:
+ * Return:
  * Worker task on @cpu to wake up, %NULL if none.
  */
 struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu)
@@ -966,8 +968,8 @@ static inline void worker_clr_flags(struct worker *worker, unsigned int flags)
  * CONTEXT:
  * spin_lock_irq(pool->lock).
  *
- * RETURNS:
- * Pointer to worker which is executing @work if found, NULL
+ * Return:
+ * Pointer to worker which is executing @work if found, %NULL
  * otherwise.
  */
 static struct worker *find_worker_executing_work(struct worker_pool *pool,
@@ -1155,14 +1157,16 @@ out_put:
  * @flags: place to store irq state
  *
  * Try to grab PENDING bit of @work.  This function can handle @work in any
- * stable state - idle, on timer or on worklist.  Return values are
+ * stable state - idle, on timer or on worklist.
  *
+ * Return:
  *  1          if @work was pending and we successfully stole PENDING
  *  0          if @work was idle and we claimed PENDING
  *  -EAGAIN    if PENDING couldn't be grabbed at the moment, safe to busy-retry
  *  -ENOENT    if someone else is canceling @work, this state may persist
  *             for arbitrarily long
  *
+ * Note:
  * On >= 0 return, the caller owns @work's PENDING bit.  To avoid getting
  * interrupted while holding PENDING and @work off queue, irq must be
  * disabled on entry.  This, combined with delayed_work->timer being
@@ -1404,10 +1408,10 @@ retry:
  * @wq: workqueue to use
  * @work: work to queue
  *
- * Returns %false if @work was already on a queue, %true otherwise.
- *
  * We queue the work to a specific CPU, the caller must ensure it
  * can't go away.
+ *
+ * Return: %false if @work was already on a queue, %true otherwise.
  */
 bool queue_work_on(int cpu, struct workqueue_struct *wq,
                   struct work_struct *work)
@@ -1477,7 +1481,7 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
  * @dwork: work to queue
  * @delay: number of jiffies to wait before queueing
  *
- * Returns %false if @work was already on a queue, %true otherwise.  If
+ * Return: %false if @work was already on a queue, %true otherwise.  If
  * @delay is zero and @dwork is idle, it will be scheduled for immediate
  * execution.
  */
@@ -1513,7 +1517,7 @@ EXPORT_SYMBOL(queue_delayed_work_on);
  * zero, @work is guaranteed to be scheduled immediately regardless of its
  * current state.
  *
- * Returns %false if @dwork was idle and queued, %true if @dwork was
+ * Return: %false if @dwork was idle and queued, %true if @dwork was
  * pending and its timer was modified.
  *
  * This function is safe to call from any context including IRQ handler.
@@ -1628,7 +1632,7 @@ static void worker_leave_idle(struct worker *worker)
  * Might sleep.  Called without any lock but returns with pool->lock
  * held.
  *
- * RETURNS:
+ * Return:
  * %true if the associated pool is online (@worker is successfully
  * bound), %false if offline.
  */
@@ -1689,7 +1693,7 @@ static struct worker *alloc_worker(void)
  * CONTEXT:
  * Might sleep.  Does GFP_KERNEL allocations.
  *
- * RETURNS:
+ * Return:
  * Pointer to the newly created worker.
  */
 static struct worker *create_worker(struct worker_pool *pool)
@@ -1789,6 +1793,8 @@ static void start_worker(struct worker *worker)
  * @pool: the target pool
  *
  * Grab the managership of @pool and create and start a new worker for it.
+ *
+ * Return: 0 on success. A negative error code otherwise.
  */
 static int create_and_start_worker(struct worker_pool *pool)
 {
@@ -1933,7 +1939,7 @@ static void pool_mayday_timeout(unsigned long __pool)
  * multiple times.  Does GFP_KERNEL allocations.  Called only from
  * manager.
  *
- * RETURNS:
+ * Return:
  * %false if no action was taken and pool->lock stayed locked, %true
  * otherwise.
  */
@@ -1990,7 +1996,7 @@ restart:
  * spin_lock_irq(pool->lock) which may be released and regrabbed
  * multiple times.  Called only from manager.
  *
- * RETURNS:
+ * Return:
  * %false if no action was taken and pool->lock stayed locked, %true
  * otherwise.
  */
@@ -2033,7 +2039,7 @@ static bool maybe_destroy_workers(struct worker_pool *pool)
  * spin_lock_irq(pool->lock) which may be released and regrabbed
  * multiple times.  Does GFP_KERNEL allocations.
  *
- * RETURNS:
+ * Return:
  * %false if the pool don't need management and the caller can safely start
  * processing works, %true indicates that the function released pool->lock
  * and reacquired it to perform some management function and that the
@@ -2259,6 +2265,8 @@ static void process_scheduled_works(struct worker *worker)
  * work items regardless of their specific target workqueue.  The only
  * exception is work items which belong to workqueues with a rescuer which
  * will be explained in rescuer_thread().
+ *
+ * Return: 0
  */
 static int worker_thread(void *__worker)
 {
@@ -2357,6 +2365,8 @@ sleep:
  * those works so that forward progress can be guaranteed.
  *
  * This should happen rarely.
+ *
+ * Return: 0
  */
 static int rescuer_thread(void *__rescuer)
 {
@@ -2529,7 +2539,7 @@ static void insert_wq_barrier(struct pool_workqueue *pwq,
  * CONTEXT:
  * mutex_lock(wq->mutex).
  *
- * RETURNS:
+ * Return:
  * %true if @flush_color >= 0 and there's something to flush.  %false
  * otherwise.
  */
@@ -2850,7 +2860,7 @@ static bool __flush_work(struct work_struct *work)
  * Wait until @work has finished execution.  @work is guaranteed to be idle
  * on return if it hasn't been requeued since flush started.
  *
- * RETURNS:
+ * Return:
  * %true if flush_work() waited for the work to finish execution,
  * %false if it was already idle.
  */
@@ -2902,7 +2912,7 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork)
  * The caller must ensure that the workqueue on which @work was last
  * queued can't be destroyed before this function returns.
  *
- * RETURNS:
+ * Return:
  * %true if @work was pending, %false otherwise.
  */
 bool cancel_work_sync(struct work_struct *work)
@@ -2919,7 +2929,7 @@ EXPORT_SYMBOL_GPL(cancel_work_sync);
  * immediate execution.  Like flush_work(), this function only
  * considers the last queueing instance of @dwork.
  *
- * RETURNS:
+ * Return:
  * %true if flush_work() waited for the work to finish execution,
  * %false if it was already idle.
  */
@@ -2937,11 +2947,15 @@ EXPORT_SYMBOL(flush_delayed_work);
  * cancel_delayed_work - cancel a delayed work
  * @dwork: delayed_work to cancel
  *
- * Kill off a pending delayed_work.  Returns %true if @dwork was pending
- * and canceled; %false if wasn't pending.  Note that the work callback
- * function may still be running on return, unless it returns %true and the
- * work doesn't re-arm itself.  Explicitly flush or use
- * cancel_delayed_work_sync() to wait on it.
+ * Kill off a pending delayed_work.
+ *
+ * Return: %true if @dwork was pending and canceled; %false if it wasn't
+ * pending.
+ *
+ * Note:
+ * The work callback function may still be running on return, unless
+ * it returns %true and the work doesn't re-arm itself.  Explicitly flush or
+ * use cancel_delayed_work_sync() to wait on it.
  *
  * This function is safe to call from any context including IRQ handler.
  */
@@ -2970,7 +2984,7 @@ EXPORT_SYMBOL(cancel_delayed_work);
  *
  * This is cancel_work_sync() for delayed works.
  *
- * RETURNS:
+ * Return:
  * %true if @dwork was pending, %false otherwise.
  */
 bool cancel_delayed_work_sync(struct delayed_work *dwork)
@@ -2987,7 +3001,7 @@ EXPORT_SYMBOL(cancel_delayed_work_sync);
  * system workqueue and blocks until all CPUs have completed.
  * schedule_on_each_cpu() is very slow.
  *
- * RETURNS:
+ * Return:
  * 0 on success, -errno on failure.
  */
 int schedule_on_each_cpu(work_func_t func)
@@ -3055,7 +3069,7 @@ EXPORT_SYMBOL(flush_scheduled_work);
  * Executes the function immediately if process context is available,
  * otherwise schedules the function for delayed execution.
  *
- * Returns:    0 - function was executed
+ * Return    0 - function was executed
  *             1 - function was scheduled for execution
  */
 int execute_in_process_context(work_func_t fn, struct execute_work *ew)
@@ -3315,7 +3329,7 @@ static void wq_device_release(struct device *dev)
  * apply_workqueue_attrs() may race against userland updating the
  * attributes.
  *
- * Returns 0 on success, -errno on failure.
+ * Return: 0 on success, -errno on failure.
  */
 int workqueue_sysfs_register(struct workqueue_struct *wq)
 {
@@ -3408,7 +3422,9 @@ void free_workqueue_attrs(struct workqueue_attrs *attrs)
  * @gfp_mask: allocation mask to use
  *
  * Allocate a new workqueue_attrs, initialize with default settings and
- * return it.  Returns NULL on failure.
+ * return it.
+ *
+ * Return: The allocated new workqueue_attr on success. %NULL on failure.
  */
 struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask)
 {
@@ -3467,7 +3483,8 @@ static bool wqattrs_equal(const struct workqueue_attrs *a,
  * @pool: worker_pool to initialize
  *
  * Initiailize a newly zalloc'd @pool.  It also allocates @pool->attrs.
- * Returns 0 on success, -errno on failure.  Even on failure, all fields
+ *
+ * Return: 0 on success, -errno on failure.  Even on failure, all fields
  * inside @pool proper are initialized and put_unbound_pool() can be called
  * on @pool safely to release it.
  */
@@ -3574,9 +3591,12 @@ static void put_unbound_pool(struct worker_pool *pool)
  * Obtain a worker_pool which has the same attributes as @attrs, bump the
  * reference count and return it.  If there already is a matching
  * worker_pool, it will be used; otherwise, this function attempts to
- * create a new one.  On failure, returns NULL.
+ * create a new one.
  *
  * Should be called with wq_pool_mutex held.
+ *
+ * Return: On success, a worker_pool with the same attributes as @attrs.
+ * On failure, %NULL.
  */
 static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs)
 {
@@ -3812,9 +3832,7 @@ static void free_unbound_pwq(struct pool_workqueue *pwq)
  *
  * Calculate the cpumask a workqueue with @attrs should use on @node.  If
  * @cpu_going_down is >= 0, that cpu is considered offline during
- * calculation.  The result is stored in @cpumask.  This function returns
- * %true if the resulting @cpumask is different from @attrs->cpumask,
- * %false if equal.
+ * calculation.  The result is stored in @cpumask.
  *
  * If NUMA affinity is not enabled, @attrs->cpumask is always used.  If
  * enabled and @node has online CPUs requested by @attrs, the returned
@@ -3823,6 +3841,9 @@ static void free_unbound_pwq(struct pool_workqueue *pwq)
  *
  * The caller is responsible for ensuring that the cpumask of @node stays
  * stable.
+ *
+ * Return: %true if the resulting @cpumask is different from @attrs->cpumask,
+ * %false if equal.
  */
 static bool wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node,
                                 int cpu_going_down, cpumask_t *cpumask)
@@ -3876,8 +3897,9 @@ static struct pool_workqueue *numa_pwq_tbl_install(struct workqueue_struct *wq,
  * items finish.  Note that a work item which repeatedly requeues itself
  * back-to-back will stay on its current pwq.
  *
- * Performs GFP_KERNEL allocations.  Returns 0 on success and -errno on
- * failure.
+ * Performs GFP_KERNEL allocations.
+ *
+ * Return: 0 on success and -errno on failure.
  */
 int apply_workqueue_attrs(struct workqueue_struct *wq,
                          const struct workqueue_attrs *attrs)
@@ -4345,6 +4367,8 @@ EXPORT_SYMBOL_GPL(workqueue_set_max_active);
  *
  * Determine whether %current is a workqueue rescuer.  Can be used from
  * work functions to determine whether it's being run off the rescuer task.
+ *
+ * Return: %true if %current is a workqueue rescuer. %false otherwise.
  */
 bool current_is_workqueue_rescuer(void)
 {
@@ -4368,7 +4392,7 @@ bool current_is_workqueue_rescuer(void)
  * workqueue being congested on one CPU doesn't mean the workqueue is also
  * contested on other CPUs / NUMA nodes.
  *
- * RETURNS:
+ * Return:
  * %true if congested, %false otherwise.
  */
 bool workqueue_congested(int cpu, struct workqueue_struct *wq)
@@ -4401,7 +4425,7 @@ EXPORT_SYMBOL_GPL(workqueue_congested);
  * synchronization around this function and the test result is
  * unreliable and only useful as advisory hints or for debugging.
  *
- * RETURNS:
+ * Return:
  * OR'd bitmask of WORK_BUSY_* bits.
  */
 unsigned int work_busy(struct work_struct *work)
@@ -4779,9 +4803,10 @@ static void work_for_cpu_fn(struct work_struct *work)
  * @fn: the function to run
  * @arg: the function arg
  *
- * This will return the value @fn returns.
  * It is up to the caller to ensure that the cpu doesn't go offline.
  * The caller must not hold any locks which would prevent @fn from completing.
+ *
+ * Return: The value @fn returns.
  */
 long work_on_cpu(int cpu, long (*fn)(void *), void *arg)
 {
@@ -4853,7 +4878,7 @@ void freeze_workqueues_begin(void)
  * CONTEXT:
  * Grabs and releases wq_pool_mutex.
  *
- * RETURNS:
+ * Return:
  * %true if some freezable workqueues are still busy.  %false if freezing
  * is complete.
  */
index 55d7c80..d84c5e5 100644 (file)
@@ -1265,7 +1265,7 @@ void memory_failure_queue(unsigned long pfn, int trapno, int flags)
        if (kfifo_put(&mf_cpu->fifo, &entry))
                schedule_work_on(smp_processor_id(), &mf_cpu->work);
        else
-               pr_err("Memory failure: buffer overflow when queuing memory failure at 0x%#lx\n",
+               pr_err("Memory failure: buffer overflow when queuing memory failure at %#lx\n",
                       pfn);
        spin_unlock_irqrestore(&mf_cpu->lock, proc_flags);
        put_cpu_var(memory_failure_cpu);
index b100255..c2b59db 100644 (file)
@@ -768,7 +768,7 @@ void __init __free_pages_bootmem(struct page *page, unsigned int order)
 }
 
 #ifdef CONFIG_CMA
-/* Free whole pageblock and set it's migration type to MIGRATE_CMA. */
+/* Free whole pageblock and set its migration type to MIGRATE_CMA. */
 void __init init_cma_reserved_pageblock(struct page *page)
 {
        unsigned i = pageblock_nr_pages;
index 383bdbb..0cee10f 100644 (file)
@@ -226,9 +226,9 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
        int ret;
 
        /*
-        * Note: pageblock_nr_page != MAX_ORDER. Then, chunks of free page
-        * is not aligned to pageblock_nr_pages.
-        * Then we just check pagetype fist.
+        * Note: pageblock_nr_pages != MAX_ORDER. Then, chunks of free pages
+        * are not aligned to pageblock_nr_pages.
+        * Then we just check migratetype first.
         */
        for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
                page = __first_valid_page(pfn, pageblock_nr_pages);
@@ -238,7 +238,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
        page = __first_valid_page(start_pfn, end_pfn - start_pfn);
        if ((pfn < end_pfn) || !page)
                return -EBUSY;
-       /* Check all pages are free or Marked as ISOLATED */
+       /* Check all pages are free or marked as ISOLATED */
        zone = page_zone(page);
        spin_lock_irqsave(&zone->lock, flags);
        ret = __test_page_isolated_in_pageblock(start_pfn, end_pfn,
index 13863de..bdc35a7 100644 (file)
@@ -225,17 +225,22 @@ static void hidp_input_report(struct hidp_session *session, struct sk_buff *skb)
 
 static int hidp_send_report(struct hidp_session *session, struct hid_report *report)
 {
-       unsigned char buf[32], hdr;
-       int rsize;
+       unsigned char hdr;
+       u8 *buf;
+       int rsize, ret;
 
-       rsize = ((report->size - 1) >> 3) + 1 + (report->id > 0);
-       if (rsize > sizeof(buf))
+       buf = hid_alloc_report_buf(report, GFP_ATOMIC);
+       if (!buf)
                return -EIO;
 
        hid_output_report(report, buf);
        hdr = HIDP_TRANS_DATA | HIDP_DATA_RTYPE_OUPUT;
 
-       return hidp_send_intr_message(session, hdr, buf, rsize);
+       rsize = ((report->size - 1) >> 3) + 1 + (report->id > 0);
+       ret = hidp_send_intr_message(session, hdr, buf, rsize);
+
+       kfree(buf);
+       return ret;
 }
 
 static int hidp_hidinput_event(struct input_dev *dev, unsigned int type,
index ef53ab8..ddd73cb 100644 (file)
@@ -438,7 +438,8 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
        if (mask != q->tab_mask) {
                struct sk_buff **ntab;
 
-               ntab = kcalloc(mask + 1, sizeof(struct sk_buff *), GFP_KERNEL);
+               ntab = kcalloc(mask + 1, sizeof(struct sk_buff *),
+                              GFP_KERNEL | __GFP_NOWARN);
                if (!ntab)
                        ntab = vzalloc((mask + 1) * sizeof(struct sk_buff *));
                if (!ntab)
diff --git a/samples/hidraw/.gitignore b/samples/hidraw/.gitignore
new file mode 100644 (file)
index 0000000..05e51a6
--- /dev/null
@@ -0,0 +1 @@
+hid-example
index ebf5e0c..366db1a 100644 (file)
@@ -37,6 +37,11 @@ static int handler_pre(struct kprobe *p, struct pt_regs *regs)
                        " status = 0x%lx\n",
                p->addr, regs->cp0_epc, regs->cp0_status);
 #endif
+#ifdef CONFIG_TILEGX
+       printk(KERN_INFO "pre_handler: p->addr = 0x%p, pc = 0x%lx,"
+                       " ex1 = 0x%lx\n",
+               p->addr, regs->pc, regs->ex1);
+#endif
 
        /* A dump_stack() here will give a stack backtrace */
        return 0;
@@ -58,6 +63,10 @@ static void handler_post(struct kprobe *p, struct pt_regs *regs,
        printk(KERN_INFO "post_handler: p->addr = 0x%p, status = 0x%lx\n",
                p->addr, regs->cp0_status);
 #endif
+#ifdef CONFIG_TILEGX
+       printk(KERN_INFO "post_handler: p->addr = 0x%p, ex1 = 0x%lx\n",
+               p->addr, regs->ex1);
+#endif
 }
 
 /*
index 03ce3c0..7d58a4b 100644 (file)
@@ -1,14 +1,15 @@
 /*
  * UHID Example
  *
- * Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
+ * Copyright (c) 2012-2013 David Herrmann <dh.herrmann@gmail.com>
  *
  * The code may be used by anyone for any purpose,
  * and can serve as a starting point for developing
  * applications using uhid.
  */
 
-/* UHID Example
+/*
+ * UHID Example
  * This example emulates a basic 3 buttons mouse with wheel over UHID. Run this
  * program as root and then use the following keys to control the mouse:
  *   q: Quit the application
  *   r: Move wheel up
  *   f: Move wheel down
  *
+ * Additionally to 3 button mouse, 3 keyboard LEDs are also supported (LED_NUML,
+ * LED_CAPSL and LED_SCROLLL). The device doesn't generate any related keyboard
+ * events, though. You need to manually write the EV_LED/LED_XY/1 activation
+ * input event to the evdev device to see it being sent to this device.
+ *
  * If uhid is not available as /dev/uhid, then you can pass a different path as
  * first argument.
  * If <linux/uhid.h> is not installed in /usr, then compile this with:
 #include <unistd.h>
 #include <linux/uhid.h>
 
-/* HID Report Desciptor
- * We emulate a basic 3 button mouse with wheel. This is the report-descriptor
- * as the kernel will parse it:
+/*
+ * HID Report Desciptor
+ * We emulate a basic 3 button mouse with wheel and 3 keyboard LEDs. This is
+ * the report-descriptor as the kernel will parse it:
  *
- * INPUT[INPUT]
+ * INPUT(1)[INPUT]
  *   Field(0)
  *     Physical(GenericDesktop.Pointer)
  *     Application(GenericDesktop.Mouse)
  *     Report Count(3)
  *     Report Offset(8)
  *     Flags( Variable Relative )
+ * OUTPUT(2)[OUTPUT]
+ *   Field(0)
+ *     Application(GenericDesktop.Keyboard)
+ *     Usage(3)
+ *       LED.NumLock
+ *       LED.CapsLock
+ *       LED.ScrollLock
+ *     Logical Minimum(0)
+ *     Logical Maximum(1)
+ *     Report Size(1)
+ *     Report Count(3)
+ *     Report Offset(0)
+ *     Flags( Variable Absolute )
  *
  * This is the mapping that we expect:
  *   Button.0001 ---> Key.LeftBtn
  *   GenericDesktop.X ---> Relative.X
  *   GenericDesktop.Y ---> Relative.Y
  *   GenericDesktop.Wheel ---> Relative.Wheel
+ *   LED.NumLock ---> LED.NumLock
+ *   LED.CapsLock ---> LED.CapsLock
+ *   LED.ScrollLock ---> LED.ScrollLock
  *
  * This information can be verified by reading /sys/kernel/debug/hid/<dev>/rdesc
  * This file should print the same information as showed above.
  */
 
 static unsigned char rdesc[] = {
-       0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x01,
-       0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03,
-       0x15, 0x00, 0x25, 0x01, 0x95, 0x03, 0x75, 0x01,
-       0x81, 0x02, 0x95, 0x01, 0x75, 0x05, 0x81, 0x01,
-       0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x09, 0x38,
-       0x15, 0x80, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x03,
-       0x81, 0x06, 0xc0, 0xc0,
+       0x05, 0x01,     /* USAGE_PAGE (Generic Desktop) */
+       0x09, 0x02,     /* USAGE (Mouse) */
+       0xa1, 0x01,     /* COLLECTION (Application) */
+       0x09, 0x01,             /* USAGE (Pointer) */
+       0xa1, 0x00,             /* COLLECTION (Physical) */
+       0x85, 0x01,                     /* REPORT_ID (1) */
+       0x05, 0x09,                     /* USAGE_PAGE (Button) */
+       0x19, 0x01,                     /* USAGE_MINIMUM (Button 1) */
+       0x29, 0x03,                     /* USAGE_MAXIMUM (Button 3) */
+       0x15, 0x00,                     /* LOGICAL_MINIMUM (0) */
+       0x25, 0x01,                     /* LOGICAL_MAXIMUM (1) */
+       0x95, 0x03,                     /* REPORT_COUNT (3) */
+       0x75, 0x01,                     /* REPORT_SIZE (1) */
+       0x81, 0x02,                     /* INPUT (Data,Var,Abs) */
+       0x95, 0x01,                     /* REPORT_COUNT (1) */
+       0x75, 0x05,                     /* REPORT_SIZE (5) */
+       0x81, 0x01,                     /* INPUT (Cnst,Var,Abs) */
+       0x05, 0x01,                     /* USAGE_PAGE (Generic Desktop) */
+       0x09, 0x30,                     /* USAGE (X) */
+       0x09, 0x31,                     /* USAGE (Y) */
+       0x09, 0x38,                     /* USAGE (WHEEL) */
+       0x15, 0x81,                     /* LOGICAL_MINIMUM (-127) */
+       0x25, 0x7f,                     /* LOGICAL_MAXIMUM (127) */
+       0x75, 0x08,                     /* REPORT_SIZE (8) */
+       0x95, 0x03,                     /* REPORT_COUNT (3) */
+       0x81, 0x06,                     /* INPUT (Data,Var,Rel) */
+       0xc0,                   /* END_COLLECTION */
+       0xc0,           /* END_COLLECTION */
+       0x05, 0x01,     /* USAGE_PAGE (Generic Desktop) */
+       0x09, 0x06,     /* USAGE (Keyboard) */
+       0xa1, 0x01,     /* COLLECTION (Application) */
+       0x85, 0x02,             /* REPORT_ID (2) */
+       0x05, 0x08,             /* USAGE_PAGE (Led) */
+       0x19, 0x01,             /* USAGE_MINIMUM (1) */
+       0x29, 0x03,             /* USAGE_MAXIMUM (3) */
+       0x15, 0x00,             /* LOGICAL_MINIMUM (0) */
+       0x25, 0x01,             /* LOGICAL_MAXIMUM (1) */
+       0x95, 0x03,             /* REPORT_COUNT (3) */
+       0x75, 0x01,             /* REPORT_SIZE (1) */
+       0x91, 0x02,             /* Output (Data,Var,Abs) */
+       0x95, 0x01,             /* REPORT_COUNT (1) */
+       0x75, 0x05,             /* REPORT_SIZE (5) */
+       0x91, 0x01,             /* Output (Cnst,Var,Abs) */
+       0xc0,           /* END_COLLECTION */
 };
 
 static int uhid_write(int fd, const struct uhid_event *ev)
@@ -140,6 +200,27 @@ static void destroy(int fd)
        uhid_write(fd, &ev);
 }
 
+/* This parses raw output reports sent by the kernel to the device. A normal
+ * uhid program shouldn't do this but instead just forward the raw report.
+ * However, for ducomentational purposes, we try to detect LED events here and
+ * print debug messages for it. */
+static void handle_output(struct uhid_event *ev)
+{
+       /* LED messages are adverised via OUTPUT reports; ignore the rest */
+       if (ev->u.output.rtype != UHID_OUTPUT_REPORT)
+               return;
+       /* LED reports have length 2 bytes */
+       if (ev->u.output.size != 2)
+               return;
+       /* first byte is report-id which is 0x02 for LEDs in our rdesc */
+       if (ev->u.output.data[0] != 0x2)
+               return;
+
+       /* print flags payload */
+       fprintf(stderr, "LED output report received with flags %x\n",
+               ev->u.output.data[1]);
+}
+
 static int event(int fd)
 {
        struct uhid_event ev;
@@ -174,6 +255,7 @@ static int event(int fd)
                break;
        case UHID_OUTPUT:
                fprintf(stderr, "UHID_OUTPUT from uhid-dev\n");
+               handle_output(&ev);
                break;
        case UHID_OUTPUT_EV:
                fprintf(stderr, "UHID_OUTPUT_EV from uhid-dev\n");
@@ -198,18 +280,19 @@ static int send_event(int fd)
 
        memset(&ev, 0, sizeof(ev));
        ev.type = UHID_INPUT;
-       ev.u.input.size = 4;
+       ev.u.input.size = 5;
 
+       ev.u.input.data[0] = 0x1;
        if (btn1_down)
-               ev.u.input.data[0] |= 0x1;
+               ev.u.input.data[1] |= 0x1;
        if (btn2_down)
-               ev.u.input.data[0] |= 0x2;
+               ev.u.input.data[1] |= 0x2;
        if (btn3_down)
-               ev.u.input.data[0] |= 0x4;
+               ev.u.input.data[1] |= 0x4;
 
-       ev.u.input.data[1] = abs_hor;
-       ev.u.input.data[2] = abs_ver;
-       ev.u.input.data[3] = wheel;
+       ev.u.input.data[2] = abs_hor;
+       ev.u.input.data[3] = abs_ver;
+       ev.u.input.data[4] = wheel;
 
        return uhid_write(fd, &ev);
 }
index 858966a..a674fd5 100755 (executable)
@@ -364,6 +364,10 @@ if ($arch eq "x86_64") {
 } elsif ($arch eq "blackfin") {
     $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$";
     $mcount_adjust = -4;
+} elsif ($arch eq "tilegx") {
+    $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$";
+    $type = ".quad";
+    $alignment = 8;
 } else {
     die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
 }
index ca8929b..61262f3 100644 (file)
@@ -1842,7 +1842,7 @@ static int snd_ensoniq_create_gameport(struct ensoniq *ensoniq, int dev)
 
        default:
                if (!request_region(io_port, 8, "ens137x: gameport")) {
-                       printk(KERN_WARNING "ens137x: gameport io port 0x%#x in use\n",
+                       printk(KERN_WARNING "ens137x: gameport io port %#x in use\n",
                               io_port);
                        return -EBUSY;
                }
index 3c511d0..5ae6f04 100644 (file)
@@ -1940,7 +1940,7 @@ static int snd_via686_create_gameport(struct via82xx *chip, unsigned char *legac
 
        r = request_region(JOYSTICK_ADDR, 8, "VIA686 gameport");
        if (!r) {
-               printk(KERN_WARNING "via82xx: cannot reserve joystick port 0x%#x\n",
+               printk(KERN_WARNING "via82xx: cannot reserve joystick port %#x\n",
                       JOYSTICK_ADDR);
                return -EBUSY;
        }
index 4cb14ca..9f3eae2 100644 (file)
@@ -8,6 +8,7 @@ TARGETS += net
 TARGETS += ptrace
 TARGETS += timers
 TARGETS += vm
+TARGETS += powerpc
 
 all:
        for TARGET in $(TARGETS); do \
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
new file mode 100644 (file)
index 0000000..bd24ae5
--- /dev/null
@@ -0,0 +1,39 @@
+# Makefile for powerpc selftests
+
+# ARCH can be overridden by the user for cross compiling
+ARCH ?= $(shell uname -m)
+ARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/)
+
+ifeq ($(ARCH),powerpc)
+
+GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown")
+
+CC := $(CROSS_COMPILE)$(CC)
+CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS)
+
+export CC CFLAGS
+
+TARGETS = pmu
+
+endif
+
+all:
+       @for TARGET in $(TARGETS); do \
+               $(MAKE) -C $$TARGET all; \
+       done;
+
+run_tests: all
+       @for TARGET in $(TARGETS); do \
+               $(MAKE) -C $$TARGET run_tests; \
+       done;
+
+clean:
+       @for TARGET in $(TARGETS); do \
+               $(MAKE) -C $$TARGET clean; \
+       done;
+       rm -f tags
+
+tags:
+       find . -name '*.c' -o -name '*.h' | xargs ctags
+
+.PHONY: all run_tests clean tags
diff --git a/tools/testing/selftests/powerpc/harness.c b/tools/testing/selftests/powerpc/harness.c
new file mode 100644 (file)
index 0000000..e80c42a
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+#include <errno.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include "subunit.h"
+#include "utils.h"
+
+#define TIMEOUT                120
+#define KILL_TIMEOUT   5
+
+
+int run_test(int (test_function)(void), char *name)
+{
+       bool terminated;
+       int rc, status;
+       pid_t pid;
+
+       /* Make sure output is flushed before forking */
+       fflush(stdout);
+
+       pid = fork();
+       if (pid == 0) {
+               exit(test_function());
+       } else if (pid == -1) {
+               perror("fork");
+               return 1;
+       }
+
+       /* Wake us up in timeout seconds */
+       alarm(TIMEOUT);
+       terminated = false;
+
+wait:
+       rc = waitpid(pid, &status, 0);
+       if (rc == -1) {
+               if (errno != EINTR) {
+                       printf("unknown error from waitpid\n");
+                       return 1;
+               }
+
+               if (terminated) {
+                       printf("!! force killing %s\n", name);
+                       kill(pid, SIGKILL);
+                       return 1;
+               } else {
+                       printf("!! killing %s\n", name);
+                       kill(pid, SIGTERM);
+                       terminated = true;
+                       alarm(KILL_TIMEOUT);
+                       goto wait;
+               }
+       }
+
+       if (WIFEXITED(status))
+               status = WEXITSTATUS(status);
+       else {
+               if (WIFSIGNALED(status))
+                       printf("!! child died by signal %d\n", WTERMSIG(status));
+               else
+                       printf("!! child died by unknown cause\n");
+
+               status = 1; /* Signal or other */
+       }
+
+       return status;
+}
+
+static void alarm_handler(int signum)
+{
+       /* Jut wake us up from waitpid */
+}
+
+static struct sigaction alarm_action = {
+       .sa_handler = alarm_handler,
+};
+
+int test_harness(int (test_function)(void), char *name)
+{
+       int rc;
+
+       test_start(name);
+       test_set_git_version(GIT_VERSION);
+
+       if (sigaction(SIGALRM, &alarm_action, NULL)) {
+               perror("sigaction");
+               test_error(name);
+               return 1;
+       }
+
+       rc = run_test(test_function, name);
+
+       test_finish(name, rc);
+
+       return rc;
+}
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
new file mode 100644 (file)
index 0000000..7216f00
--- /dev/null
@@ -0,0 +1,23 @@
+noarg:
+       $(MAKE) -C ../
+
+PROGS := count_instructions
+EXTRA_SOURCES := ../harness.c event.c
+
+all: $(PROGS)
+
+$(PROGS): $(EXTRA_SOURCES)
+
+# loop.S can only be built 64-bit
+count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
+       $(CC) $(CFLAGS) -m64 -o $@ $^
+
+run_tests: all
+       @-for PROG in $(PROGS); do \
+               ./$$PROG; \
+       done;
+
+clean:
+       rm -f $(PROGS) loop.o
+
+.PHONY: all run_tests clean
diff --git a/tools/testing/selftests/powerpc/pmu/count_instructions.c b/tools/testing/selftests/powerpc/pmu/count_instructions.c
new file mode 100644 (file)
index 0000000..312b4f0
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/prctl.h>
+
+#include "event.h"
+#include "utils.h"
+
+extern void thirty_two_instruction_loop(u64 loops);
+
+static void setup_event(struct event *e, u64 config, char *name)
+{
+       event_init_opts(e, config, PERF_TYPE_HARDWARE, name);
+
+       e->attr.disabled = 1;
+       e->attr.exclude_kernel = 1;
+       e->attr.exclude_hv = 1;
+       e->attr.exclude_idle = 1;
+}
+
+static int do_count_loop(struct event *events, u64 instructions,
+                        u64 overhead, bool report)
+{
+       s64 difference, expected;
+       double percentage;
+
+       prctl(PR_TASK_PERF_EVENTS_ENABLE);
+
+       /* Run for 1M instructions */
+       thirty_two_instruction_loop(instructions >> 5);
+
+       prctl(PR_TASK_PERF_EVENTS_DISABLE);
+
+       event_read(&events[0]);
+       event_read(&events[1]);
+
+       expected = instructions + overhead;
+       difference = events[0].result.value - expected;
+       percentage = (double)difference / events[0].result.value * 100;
+
+       if (report) {
+               event_report(&events[0]);
+               event_report(&events[1]);
+
+               printf("Looped for %llu instructions, overhead %llu\n", instructions, overhead);
+               printf("Expected %llu\n", expected);
+               printf("Actual   %llu\n", events[0].result.value);
+               printf("Delta    %lld, %f%%\n", difference, percentage);
+       }
+
+       event_reset(&events[0]);
+       event_reset(&events[1]);
+
+       if (difference < 0)
+               difference = -difference;
+
+       /* Tolerate a difference below 0.0001 % */
+       difference *= 10000 * 100;
+       if (difference / events[0].result.value)
+               return -1;
+
+       return 0;
+}
+
+/* Count how many instructions it takes to do a null loop */
+static u64 determine_overhead(struct event *events)
+{
+       u64 current, overhead;
+       int i;
+
+       do_count_loop(events, 0, 0, false);
+       overhead = events[0].result.value;
+
+       for (i = 0; i < 100; i++) {
+               do_count_loop(events, 0, 0, false);
+               current = events[0].result.value;
+               if (current < overhead) {
+                       printf("Replacing overhead %llu with %llu\n", overhead, current);
+                       overhead = current;
+               }
+       }
+
+       return overhead;
+}
+
+static int count_instructions(void)
+{
+       struct event events[2];
+       u64 overhead;
+
+       setup_event(&events[0], PERF_COUNT_HW_INSTRUCTIONS, "instructions");
+       setup_event(&events[1], PERF_COUNT_HW_CPU_CYCLES, "cycles");
+
+       if (event_open(&events[0])) {
+               perror("perf_event_open");
+               return -1;
+       }
+
+       if (event_open_with_group(&events[1], events[0].fd)) {
+               perror("perf_event_open");
+               return -1;
+       }
+
+       overhead = determine_overhead(events);
+       printf("Overhead of null loop: %llu instructions\n", overhead);
+
+       /* Run for 1M instructions */
+       FAIL_IF(do_count_loop(events, 0x100000, overhead, true));
+
+       /* Run for 10M instructions */
+       FAIL_IF(do_count_loop(events, 0xa00000, overhead, true));
+
+       /* Run for 100M instructions */
+       FAIL_IF(do_count_loop(events, 0x6400000, overhead, true));
+
+       /* Run for 1G instructions */
+       FAIL_IF(do_count_loop(events, 0x40000000, overhead, true));
+
+       event_close(&events[0]);
+       event_close(&events[1]);
+
+       return 0;
+}
+
+int main(void)
+{
+       return test_harness(count_instructions, "count_instructions");
+}
diff --git a/tools/testing/selftests/powerpc/pmu/event.c b/tools/testing/selftests/powerpc/pmu/event.c
new file mode 100644 (file)
index 0000000..2b2d11d
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+
+#include "event.h"
+
+
+int perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu,
+               int group_fd, unsigned long flags)
+{
+       return syscall(__NR_perf_event_open, attr, pid, cpu,
+                          group_fd, flags);
+}
+
+void event_init_opts(struct event *e, u64 config, int type, char *name)
+{
+       memset(e, 0, sizeof(*e));
+
+       e->name = name;
+
+       e->attr.type = type;
+       e->attr.config = config;
+       e->attr.size = sizeof(e->attr);
+       /* This has to match the structure layout in the header */
+       e->attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | \
+                                 PERF_FORMAT_TOTAL_TIME_RUNNING;
+}
+
+void event_init_named(struct event *e, u64 config, char *name)
+{
+       event_init_opts(e, config, PERF_TYPE_RAW, name);
+}
+
+#define PERF_CURRENT_PID       0
+#define PERF_NO_CPU            -1
+#define PERF_NO_GROUP          -1
+
+int event_open_with_options(struct event *e, pid_t pid, int cpu, int group_fd)
+{
+       e->fd = perf_event_open(&e->attr, pid, cpu, group_fd, 0);
+       if (e->fd == -1) {
+               perror("perf_event_open");
+               return -1;
+       }
+
+       return 0;
+}
+
+int event_open_with_group(struct event *e, int group_fd)
+{
+       return event_open_with_options(e, PERF_CURRENT_PID, PERF_NO_CPU, group_fd);
+}
+
+int event_open(struct event *e)
+{
+       return event_open_with_options(e, PERF_CURRENT_PID, PERF_NO_CPU, PERF_NO_GROUP);
+}
+
+void event_close(struct event *e)
+{
+       close(e->fd);
+}
+
+int event_reset(struct event *e)
+{
+       return ioctl(e->fd, PERF_EVENT_IOC_RESET);
+}
+
+int event_read(struct event *e)
+{
+       int rc;
+
+       rc = read(e->fd, &e->result, sizeof(e->result));
+       if (rc != sizeof(e->result)) {
+               fprintf(stderr, "read error on event %p!\n", e);
+               return -1;
+       }
+
+       return 0;
+}
+
+void event_report_justified(struct event *e, int name_width, int result_width)
+{
+       printf("%*s: result %*llu ", name_width, e->name, result_width,
+              e->result.value);
+
+       if (e->result.running == e->result.enabled)
+               printf("running/enabled %llu\n", e->result.running);
+       else
+               printf("running %llu enabled %llu\n", e->result.running,
+                       e->result.enabled);
+}
+
+void event_report(struct event *e)
+{
+       event_report_justified(e, 0, 0);
+}
diff --git a/tools/testing/selftests/powerpc/pmu/event.h b/tools/testing/selftests/powerpc/pmu/event.h
new file mode 100644 (file)
index 0000000..e699319
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+#ifndef _SELFTESTS_POWERPC_PMU_EVENT_H
+#define _SELFTESTS_POWERPC_PMU_EVENT_H
+
+#include <unistd.h>
+#include <linux/perf_event.h>
+
+#include "utils.h"
+
+
+struct event {
+       struct perf_event_attr attr;
+       char *name;
+       int fd;
+       /* This must match the read_format we use */
+       struct {
+               u64 value;
+               u64 running;
+               u64 enabled;
+       } result;
+};
+
+void event_init(struct event *e, u64 config);
+void event_init_named(struct event *e, u64 config, char *name);
+void event_init_opts(struct event *e, u64 config, int type, char *name);
+int event_open_with_options(struct event *e, pid_t pid, int cpu, int group_fd);
+int event_open_with_group(struct event *e, int group_fd);
+int event_open(struct event *e);
+void event_close(struct event *e);
+int event_reset(struct event *e);
+int event_read(struct event *e);
+void event_report_justified(struct event *e, int name_width, int result_width);
+void event_report(struct event *e);
+
+#endif /* _SELFTESTS_POWERPC_PMU_EVENT_H */
diff --git a/tools/testing/selftests/powerpc/pmu/loop.S b/tools/testing/selftests/powerpc/pmu/loop.S
new file mode 100644 (file)
index 0000000..8820e3d
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+       .text
+
+       .global thirty_two_instruction_loop
+       .type .thirty_two_instruction_loop,@function
+       .section ".opd","aw",@progbits
+thirty_two_instruction_loop:
+       .quad .thirty_two_instruction_loop, .TOC.@tocbase, 0
+       .previous
+.thirty_two_instruction_loop:
+       cmpwi   %r3,0
+       beqlr
+       addi    %r4,%r3,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1
+       addi    %r4,%r4,1       # 28 addi's
+       subi    %r3,%r3,1
+       b       .thirty_two_instruction_loop
diff --git a/tools/testing/selftests/powerpc/subunit.h b/tools/testing/selftests/powerpc/subunit.h
new file mode 100644 (file)
index 0000000..98a2292
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+#ifndef _SELFTESTS_POWERPC_SUBUNIT_H
+#define _SELFTESTS_POWERPC_SUBUNIT_H
+
+static inline void test_start(char *name)
+{
+       printf("test: %s\n", name);
+}
+
+static inline void test_failure_detail(char *name, char *detail)
+{
+       printf("failure: %s [%s]\n", name, detail);
+}
+
+static inline void test_failure(char *name)
+{
+       printf("failure: %s\n", name);
+}
+
+static inline void test_error(char *name)
+{
+       printf("error: %s\n", name);
+}
+
+static inline void test_success(char *name)
+{
+       printf("success: %s\n", name);
+}
+
+static inline void test_finish(char *name, int status)
+{
+       if (status)
+               test_failure(name);
+       else
+               test_success(name);
+}
+
+static inline void test_set_git_version(char *value)
+{
+       printf("tags: git_version:%s\n", value);
+}
+
+#endif /* _SELFTESTS_POWERPC_SUBUNIT_H */
diff --git a/tools/testing/selftests/powerpc/utils.h b/tools/testing/selftests/powerpc/utils.h
new file mode 100644 (file)
index 0000000..5851c4b
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+#ifndef _SELFTESTS_POWERPC_UTILS_H
+#define _SELFTESTS_POWERPC_UTILS_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+/* Avoid headaches with PRI?64 - just use %ll? always */
+typedef unsigned long long u64;
+typedef   signed long long s64;
+
+/* Just for familiarity */
+typedef uint32_t u32;
+typedef uint8_t u8;
+
+
+int test_harness(int (test_function)(void), char *name);
+
+
+/* Yes, this is evil */
+#define FAIL_IF(x)                                             \
+do {                                                           \
+       if ((x)) {                                              \
+               fprintf(stderr,                                 \
+               "[FAIL] Test FAILED on line %d\n", __LINE__);   \
+               return 1;                                       \
+       }                                                       \
+} while (0)
+
+#endif /* _SELFTESTS_POWERPC_UTILS_H */