summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-16 18:48:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-16 18:48:14 -0400
commit2b97c39514a6130f38b14227a36d9cd37e650a9d (patch)
treedfc6ae0eb6c7acd46d170bd4d2c34e2d90bcf264
parentd0a16fe934383ecdb605ab9312d700fb9099f75e (diff)
parent0366977480c43a221e4309f242d1144e85a368c3 (diff)
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull ARM SoC platform updates from Arnd Bergmann: "The main change this time around is a cleanup of some of the oldest platforms based on the XScale and ARM9 CPU cores, which are between 10 and 20 years old. The Kendin/Micrel/Microchip KS8695, Winbond/Nuvoton W90x900 and Intel IOP33x/IOP13xx platforms are removed after we determined that nobody is using them any more. The TI Davinci and NXP LPC32xx platforms on the other hand are still in active use and are converted to the ARCH_MULTIPLATFORM build, meaning that we can compile a kernel that works on these along with most other ARMv5 platforms. Changes toward that goal are also merged for IOP32x, but additional work is needed to complete this. Patches for the remaining ARMv5 platforms have started but need more work and some testing. Support for the new ASpeed AST2600 gets added, this is based on the Cortex-A7 ARMv7 core, and is a newer version of the existing ARMv5 and ARMv6 chips in the same family. Other changes include a cleanup of the ST-Ericsson ux500 platform and the move of the TI Davinci platform to a new clocksource driver" [ The changes had marked INTEL_IOP_ADMA and USB_LPC32XX as being buildable on other platforms through COMPILE_TEST, but that causes new warnings that I most definitely do not want to see during the merge window as that could hide other issues. So the COMPILE_TEST option got disabled for them again - Linus ] * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (61 commits) ARM: multi_v5_defconfig: make DaVinci part of the ARM v5 multiplatform build ARM: davinci: support multiplatform build for ARM v5 arm64: exynos: Enable exynos-chipid driver ARM: OMAP2+: Delete an unnecessary kfree() call in omap_hsmmc_pdata_init() ARM: OMAP2+: move platform-specific asm-offset.h to arch/arm/mach-omap2 ARM: davinci: dm646x: Fix a typo in the comment ARM: davinci: dm646x: switch to using the clocksource driver ARM: davinci: dm644x: switch to using the clocksource driver ARM: aspeed: Enable SMP boot ARM: aspeed: Add ASPEED AST2600 architecture ARM: aspeed: Select timer in each SoC dt-bindings: arm: cpus: Add ASPEED SMP ARM: imx: stop adjusting ar8031 phy tx delay mailmap: map old company name to new one @microchip.com MAINTAINERS: at91: remove the TC entry MAINTAINERS: at91: Collect all pinctrl/gpio drivers in same entry ARM: at91: move platform-specific asm-offset.h to arch/arm/mach-at91 MAINTAINERS: Extend patterns for Samsung SoC, Security Subsystem and clock drivers ARM: s3c64xx: squash samsung_usb_phy.h into setup-usb-phy.c ARM: debug-ll: Add support for r7s9210 ...
-rw-r--r--.mailmap1
-rw-r--r--Documentation/devicetree/bindings/arm/cpus.yaml1
-rw-r--r--MAINTAINERS55
-rw-r--r--arch/arm/Kconfig98
-rw-r--r--arch/arm/Kconfig.debug41
-rw-r--r--arch/arm/Makefile6
-rw-r--r--arch/arm/configs/acs5k_defconfig77
-rw-r--r--arch/arm/configs/acs5k_tiny_defconfig69
-rw-r--r--arch/arm/configs/davinci_all_defconfig5
-rw-r--r--arch/arm/configs/iop13xx_defconfig118
-rw-r--r--arch/arm/configs/iop33x_defconfig85
-rw-r--r--arch/arm/configs/ks8695_defconfig67
-rw-r--r--arch/arm/configs/lpc32xx_defconfig1
-rw-r--r--arch/arm/configs/multi_v5_defconfig12
-rw-r--r--arch/arm/configs/nuc910_defconfig51
-rw-r--r--arch/arm/configs/nuc950_defconfig67
-rw-r--r--arch/arm/configs/nuc960_defconfig57
-rw-r--r--arch/arm/include/debug/ks8695.S37
-rw-r--r--arch/arm/include/debug/renesas-scif.S6
-rw-r--r--arch/arm/include/debug/ux500.S9
-rw-r--r--arch/arm/mach-aspeed/Kconfig17
-rw-r--r--arch/arm/mach-aspeed/Makefile5
-rw-r--r--arch/arm/mach-aspeed/platsmp.c61
-rw-r--r--arch/arm/mach-at91/.gitignore1
-rw-r--r--arch/arm/mach-at91/Makefile5
-rw-r--r--arch/arm/mach-at91/pm_suspend.S2
-rw-r--r--arch/arm/mach-davinci/Kconfig17
-rw-r--r--arch/arm/mach-davinci/Makefile2
-rw-r--r--arch/arm/mach-davinci/da830.c45
-rw-r--r--arch/arm/mach-davinci/da850.c50
-rw-r--r--arch/arm/mach-davinci/davinci.h3
-rw-r--r--arch/arm/mach-davinci/dm355.c28
-rw-r--r--arch/arm/mach-davinci/dm365.c4
-rw-r--r--arch/arm/mach-davinci/dm644x.c28
-rw-r--r--arch/arm/mach-davinci/dm646x.c30
-rw-r--r--arch/arm/mach-davinci/include/mach/time.h2
-rw-r--r--arch/arm/mach-davinci/time.c14
-rw-r--r--arch/arm/mach-dove/bridge-regs.h (renamed from arch/arm/mach-dove/include/mach/bridge-regs.h)4
-rw-r--r--arch/arm/mach-dove/cm-a510.c3
-rw-r--r--arch/arm/mach-dove/common.c4
-rw-r--r--arch/arm/mach-dove/dove-db-setup.c2
-rw-r--r--arch/arm/mach-dove/dove.h (renamed from arch/arm/mach-dove/include/mach/dove.h)14
-rw-r--r--arch/arm/mach-dove/include/mach/hardware.h19
-rw-r--r--arch/arm/mach-dove/include/mach/uncompress.h8
-rw-r--r--arch/arm/mach-dove/irq.c5
-rw-r--r--arch/arm/mach-dove/irqs.h (renamed from arch/arm/mach-dove/include/mach/irqs.h)2
-rw-r--r--arch/arm/mach-dove/mpp.c2
-rw-r--r--arch/arm/mach-dove/pcie.c4
-rw-r--r--arch/arm/mach-dove/pm.h (renamed from arch/arm/mach-dove/include/mach/pm.h)4
-rw-r--r--arch/arm/mach-exynos/Kconfig1
-rw-r--r--arch/arm/mach-imx/mach-imx7d.c6
-rw-r--r--arch/arm/mach-iop13xx/Kconfig21
-rw-r--r--arch/arm/mach-iop13xx/Makefile9
-rw-r--r--arch/arm/mach-iop13xx/Makefile.boot4
-rw-r--r--arch/arm/mach-iop13xx/include/mach/adma.h608
-rw-r--r--arch/arm/mach-iop13xx/include/mach/entry-macro.S29
-rw-r--r--arch/arm/mach-iop13xx/include/mach/hardware.h22
-rw-r--r--arch/arm/mach-iop13xx/include/mach/iop13xx.h508
-rw-r--r--arch/arm/mach-iop13xx/include/mach/iq81340.h29
-rw-r--r--arch/arm/mach-iop13xx/include/mach/irqs.h195
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h68
-rw-r--r--arch/arm/mach-iop13xx/include/mach/time.h127
-rw-r--r--arch/arm/mach-iop13xx/include/mach/uncompress.h23
-rw-r--r--arch/arm/mach-iop13xx/io.c77
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c84
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c86
-rw-r--r--arch/arm/mach-iop13xx/irq.c227
-rw-r--r--arch/arm/mach-iop13xx/msi.c152
-rw-r--r--arch/arm/mach-iop13xx/msi.h12
-rw-r--r--arch/arm/mach-iop13xx/pci.c1115
-rw-r--r--arch/arm/mach-iop13xx/pci.h66
-rw-r--r--arch/arm/mach-iop13xx/setup.c595
-rw-r--r--arch/arm/mach-iop13xx/tpmi.c244
-rw-r--r--arch/arm/mach-iop32x/Makefile10
-rw-r--r--arch/arm/mach-iop32x/adma.c (renamed from arch/arm/plat-iop/adma.c)39
-rw-r--r--arch/arm/mach-iop32x/cp6.c (renamed from arch/arm/plat-iop/cp6.c)0
-rw-r--r--arch/arm/mach-iop32x/em7210.c5
-rw-r--r--arch/arm/mach-iop32x/glantank.c5
-rw-r--r--arch/arm/mach-iop32x/glantank.h (renamed from arch/arm/mach-iop32x/include/mach/glantank.h)2
-rw-r--r--arch/arm/mach-iop32x/hardware.h (renamed from arch/arm/mach-iop32x/include/mach/hardware.h)6
-rw-r--r--arch/arm/mach-iop32x/i2c.c (renamed from arch/arm/plat-iop/i2c.c)21
-rw-r--r--arch/arm/mach-iop32x/include/mach/adma.h6
-rw-r--r--arch/arm/mach-iop32x/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-iop32x/include/mach/iop32x.h31
-rw-r--r--arch/arm/mach-iop32x/include/mach/irqs.h33
-rw-r--r--arch/arm/mach-iop32x/include/mach/time.h5
-rw-r--r--arch/arm/mach-iop32x/include/mach/uncompress.h18
-rw-r--r--arch/arm/mach-iop32x/iop3xx.h (renamed from arch/arm/include/asm/hardware/iop3xx.h)18
-rw-r--r--arch/arm/mach-iop32x/iq31244.c5
-rw-r--r--arch/arm/mach-iop32x/iq31244.h (renamed from arch/arm/mach-iop32x/include/mach/iq31244.h)2
-rw-r--r--arch/arm/mach-iop32x/iq80321.c5
-rw-r--r--arch/arm/mach-iop32x/iq80321.h (renamed from arch/arm/mach-iop32x/include/mach/iq80321.h)2
-rw-r--r--arch/arm/mach-iop32x/irq.c3
-rw-r--r--arch/arm/mach-iop32x/irqs.h42
-rw-r--r--arch/arm/mach-iop32x/n2100.c5
-rw-r--r--arch/arm/mach-iop32x/n2100.h (renamed from arch/arm/mach-iop32x/include/mach/n2100.h)2
-rw-r--r--arch/arm/mach-iop32x/pci.c (renamed from arch/arm/plat-iop/pci.c)4
-rw-r--r--arch/arm/mach-iop32x/pmu.c (renamed from arch/arm/plat-iop/pmu.c)8
-rw-r--r--arch/arm/mach-iop32x/restart.c (renamed from arch/arm/plat-iop/restart.c)4
-rw-r--r--arch/arm/mach-iop32x/setup.c (renamed from arch/arm/plat-iop/setup.c)2
-rw-r--r--arch/arm/mach-iop32x/time.c (renamed from arch/arm/plat-iop/time.c)7
-rw-r--r--arch/arm/mach-iop33x/Kconfig22
-rw-r--r--arch/arm/mach-iop33x/Makefile9
-rw-r--r--arch/arm/mach-iop33x/Makefile.boot4
-rw-r--r--arch/arm/mach-iop33x/include/mach/adma.h6
-rw-r--r--arch/arm/mach-iop33x/include/mach/entry-macro.S34
-rw-r--r--arch/arm/mach-iop33x/include/mach/hardware.h44
-rw-r--r--arch/arm/mach-iop33x/include/mach/iop33x.h37
-rw-r--r--arch/arm/mach-iop33x/include/mach/iq80331.h17
-rw-r--r--arch/arm/mach-iop33x/include/mach/iq80332.h17
-rw-r--r--arch/arm/mach-iop33x/include/mach/irqs.h57
-rw-r--r--arch/arm/mach-iop33x/include/mach/time.h5
-rw-r--r--arch/arm/mach-iop33x/include/mach/uncompress.h37
-rw-r--r--arch/arm/mach-iop33x/iq80331.c148
-rw-r--r--arch/arm/mach-iop33x/iq80332.c148
-rw-r--r--arch/arm/mach-iop33x/irq.c115
-rw-r--r--arch/arm/mach-iop33x/uart.c100
-rw-r--r--arch/arm/mach-ks8695/Kconfig88
-rw-r--r--arch/arm/mach-ks8695/Makefile23
-rw-r--r--arch/arm/mach-ks8695/Makefile.boot9
-rw-r--r--arch/arm/mach-ks8695/board-acs5k.c238
-rw-r--r--arch/arm/mach-ks8695/board-dsm320.c127
-rw-r--r--arch/arm/mach-ks8695/board-micrel.c59
-rw-r--r--arch/arm/mach-ks8695/board-og.c197
-rw-r--r--arch/arm/mach-ks8695/board-sg.c118
-rw-r--r--arch/arm/mach-ks8695/cpu.c60
-rw-r--r--arch/arm/mach-ks8695/devices.c197
-rw-r--r--arch/arm/mach-ks8695/devices.h29
-rw-r--r--arch/arm/mach-ks8695/generic.h12
-rw-r--r--arch/arm/mach-ks8695/include/mach/entry-macro.S47
-rw-r--r--arch/arm/mach-ks8695/include/mach/gpio-ks8695.h36
-rw-r--r--arch/arm/mach-ks8695/include/mach/hardware.h42
-rw-r--r--arch/arm/mach-ks8695/include/mach/irqs.h51
-rw-r--r--arch/arm/mach-ks8695/include/mach/memory.h51
-rw-r--r--arch/arm/mach-ks8695/include/mach/regs-gpio.h55
-rw-r--r--arch/arm/mach-ks8695/include/mach/regs-irq.h41
-rw-r--r--arch/arm/mach-ks8695/include/mach/regs-misc.h97
-rw-r--r--arch/arm/mach-ks8695/include/mach/regs-switch.h66
-rw-r--r--arch/arm/mach-ks8695/include/mach/regs-uart.h89
-rw-r--r--arch/arm/mach-ks8695/include/mach/uncompress.h33
-rw-r--r--arch/arm/mach-ks8695/irq.c164
-rw-r--r--arch/arm/mach-ks8695/pci.c247
-rw-r--r--arch/arm/mach-ks8695/regs-hpna.h25
-rw-r--r--arch/arm/mach-ks8695/regs-lan.h65
-rw-r--r--arch/arm/mach-ks8695/regs-mem.h89
-rw-r--r--arch/arm/mach-ks8695/regs-pci.h53
-rw-r--r--arch/arm/mach-ks8695/regs-sys.h34
-rw-r--r--arch/arm/mach-ks8695/regs-wan.h65
-rw-r--r--arch/arm/mach-ks8695/time.c159
-rw-r--r--arch/arm/mach-lpc32xx/Kconfig11
-rw-r--r--arch/arm/mach-lpc32xx/common.c24
-rw-r--r--arch/arm/mach-lpc32xx/common.h1
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/board.h15
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/entry-macro.S28
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/hardware.h25
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/uncompress.h50
-rw-r--r--arch/arm/mach-lpc32xx/lpc32xx.h (renamed from arch/arm/mach-lpc32xx/include/mach/platform.h)18
-rw-r--r--arch/arm/mach-lpc32xx/pm.c3
-rw-r--r--arch/arm/mach-lpc32xx/serial.c33
-rw-r--r--arch/arm/mach-lpc32xx/suspend.S3
-rw-r--r--arch/arm/mach-mv78xx0/mv78xx0.h4
-rw-r--r--arch/arm/mach-nspire/Makefile1
-rw-r--r--arch/arm/mach-nspire/clcd.c114
-rw-r--r--arch/arm/mach-nspire/clcd.h10
-rw-r--r--arch/arm/mach-nspire/nspire.c25
-rw-r--r--arch/arm/mach-omap2/.gitignore1
-rw-r--r--arch/arm/mach-omap2/Makefile5
-rw-r--r--arch/arm/mach-omap2/hsmmc.c4
-rw-r--r--arch/arm/mach-omap2/sleep33xx.S2
-rw-r--r--arch/arm/mach-omap2/sleep43xx.S2
-rw-r--r--arch/arm/mach-orion5x/orion5x.h4
-rw-r--r--arch/arm/mach-s3c64xx/setup-usb-phy.c5
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c1
-rw-r--r--arch/arm/mach-vexpress/spc.c4
-rw-r--r--arch/arm/mach-w90x900/Kconfig50
-rw-r--r--arch/arm/mach-w90x900/Makefile20
-rw-r--r--arch/arm/mach-w90x900/Makefile.boot4
-rw-r--r--arch/arm/mach-w90x900/clksel.c88
-rw-r--r--arch/arm/mach-w90x900/clock.c121
-rw-r--r--arch/arm/mach-w90x900/clock.h40
-rw-r--r--arch/arm/mach-w90x900/cpu.c238
-rw-r--r--arch/arm/mach-w90x900/cpu.h56
-rw-r--r--arch/arm/mach-w90x900/dev.c537
-rw-r--r--arch/arm/mach-w90x900/gpio.c150
-rw-r--r--arch/arm/mach-w90x900/include/mach/entry-macro.S26
-rw-r--r--arch/arm/mach-w90x900/include/mach/hardware.h19
-rw-r--r--arch/arm/mach-w90x900/include/mach/irqs.h82
-rw-r--r--arch/arm/mach-w90x900/include/mach/map.h153
-rw-r--r--arch/arm/mach-w90x900/include/mach/mfp.h21
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-clock.h49
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-irq.h46
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-ldm.h248
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-serial.h54
-rw-r--r--arch/arm/mach-w90x900/include/mach/uncompress.h43
-rw-r--r--arch/arm/mach-w90x900/irq.c212
-rw-r--r--arch/arm/mach-w90x900/mach-nuc910evb.c38
-rw-r--r--arch/arm/mach-w90x900/mach-nuc950evb.c42
-rw-r--r--arch/arm/mach-w90x900/mach-nuc960evb.c38
-rw-r--r--arch/arm/mach-w90x900/mfp.c197
-rw-r--r--arch/arm/mach-w90x900/nuc910.c58
-rw-r--r--arch/arm/mach-w90x900/nuc910.h17
-rw-r--r--arch/arm/mach-w90x900/nuc950.c52
-rw-r--r--arch/arm/mach-w90x900/nuc950.h17
-rw-r--r--arch/arm/mach-w90x900/nuc960.c50
-rw-r--r--arch/arm/mach-w90x900/nuc960.h17
-rw-r--r--arch/arm/mach-w90x900/nuc9xx.h22
-rw-r--r--arch/arm/mach-w90x900/regs-ebi.h29
-rw-r--r--arch/arm/mach-w90x900/regs-gcr.h34
-rw-r--r--arch/arm/mach-w90x900/regs-timer.h37
-rw-r--r--arch/arm/mach-w90x900/regs-usb.h31
-rw-r--r--arch/arm/mach-w90x900/time.c168
-rw-r--r--arch/arm/mach-zynq/headsmp.S2
-rw-r--r--arch/arm/mach-zynq/platsmp.c4
-rw-r--r--arch/arm/mm/Kconfig2
-rw-r--r--arch/arm/mm/copypage-xscale.c6
-rw-r--r--arch/arm/plat-iop/Makefile28
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-core.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/usb-phy.h2
-rw-r--r--arch/arm64/Kconfig.platforms2
-rw-r--r--drivers/dma/Kconfig4
-rw-r--r--drivers/dma/iop-adma.c22
-rw-r--r--drivers/dma/iop-adma.h (renamed from arch/arm/include/asm/hardware/iop3xx-adma.h)7
-rw-r--r--drivers/gpio/Kconfig2
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/net/ethernet/nxp/Kconfig2
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c45
-rw-r--r--drivers/soc/ux500/ux500-soc-id.c5
-rw-r--r--drivers/tty/serial/Kconfig3
-rw-r--r--drivers/tty/serial/lpc32xx_hs.c37
-rw-r--r--drivers/usb/gadget/udc/Kconfig3
-rw-r--r--drivers/usb/gadget/udc/lpc32xx_udc.c3
-rw-r--r--drivers/usb/host/Kconfig3
-rw-r--r--drivers/usb/host/ohci-nxp.c25
-rw-r--r--drivers/watchdog/Kconfig2
-rw-r--r--drivers/watchdog/pnx4008_wdt.c1
-rw-r--r--include/linux/platform_data/dma-iop32x.h (renamed from arch/arm/include/asm/hardware/iop_adma.h)4
-rw-r--r--include/linux/soc/nxp/lpc32xx-misc.h33
-rw-r--r--include/linux/usb/samsung_usb_phy.h17
238 files changed, 602 insertions, 12476 deletions
diff --git a/.mailmap b/.mailmap
index afaad605284a..1ad4fd655619 100644
--- a/.mailmap
+++ b/.mailmap
@@ -178,6 +178,7 @@ Morten Welinder <welinder@darter.rentec.com>
178Morten Welinder <welinder@troll.com> 178Morten Welinder <welinder@troll.com>
179Mythri P K <mythripk@ti.com> 179Mythri P K <mythripk@ti.com>
180Nguyen Anh Quynh <aquynh@gmail.com> 180Nguyen Anh Quynh <aquynh@gmail.com>
181Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com>
181Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org> 182Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org>
182Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> 183Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org>
183Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> 184Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml
index aa40b074b864..727e0ffc702b 100644
--- a/Documentation/devicetree/bindings/arm/cpus.yaml
+++ b/Documentation/devicetree/bindings/arm/cpus.yaml
@@ -175,6 +175,7 @@ properties:
175 - amlogic,meson8-smp 175 - amlogic,meson8-smp
176 - amlogic,meson8b-smp 176 - amlogic,meson8b-smp
177 - arm,realview-smp 177 - arm,realview-smp
178 - aspeed,ast2600-smp
178 - brcm,bcm11351-cpu-method 179 - brcm,bcm11351-cpu-method
179 - brcm,bcm23550 180 - brcm,bcm23550
180 - brcm,bcm2836-smp 181 - brcm,bcm2836-smp
diff --git a/MAINTAINERS b/MAINTAINERS
index 0e814418da0a..1dc49553238c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1740,20 +1740,11 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1740S: Maintained 1740S: Maintained
1741F: arch/arm/mach-pxa/colibri-pxa270-income.c 1741F: arch/arm/mach-pxa/colibri-pxa270-income.c
1742 1742
1743ARM/INTEL IOP13XX ARM ARCHITECTURE
1744M: Lennert Buytenhek <kernel@wantstofly.org>
1745L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1746S: Maintained
1747
1748ARM/INTEL IOP32X ARM ARCHITECTURE 1743ARM/INTEL IOP32X ARM ARCHITECTURE
1749M: Lennert Buytenhek <kernel@wantstofly.org> 1744M: Lennert Buytenhek <kernel@wantstofly.org>
1750L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1745L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1751S: Maintained 1746S: Maintained
1752 1747
1753ARM/INTEL IOP33X ARM ARCHITECTURE
1754L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1755S: Orphan
1756
1757ARM/INTEL IQ81342EX MACHINE SUPPORT 1748ARM/INTEL IQ81342EX MACHINE SUPPORT
1758M: Lennert Buytenhek <kernel@wantstofly.org> 1749M: Lennert Buytenhek <kernel@wantstofly.org>
1759L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1750L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1912,12 +1903,6 @@ S: Maintained
1912F: drivers/phy/mediatek/ 1903F: drivers/phy/mediatek/
1913F: Documentation/devicetree/bindings/phy/phy-mtk-* 1904F: Documentation/devicetree/bindings/phy/phy-mtk-*
1914 1905
1915ARM/MICREL KS8695 ARCHITECTURE
1916M: Greg Ungerer <gerg@uclinux.org>
1917L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1918F: arch/arm/mach-ks8695/
1919S: Odd Fixes
1920
1921ARM/Microchip (AT91) SoC support 1906ARM/Microchip (AT91) SoC support
1922M: Nicolas Ferre <nicolas.ferre@microchip.com> 1907M: Nicolas Ferre <nicolas.ferre@microchip.com>
1923M: Alexandre Belloni <alexandre.belloni@bootlin.com> 1908M: Alexandre Belloni <alexandre.belloni@bootlin.com>
@@ -1959,6 +1944,7 @@ F: Documentation/devicetree/bindings/i2c/i2c-stu300.txt
1959F: arch/arm/mach-nomadik/ 1944F: arch/arm/mach-nomadik/
1960F: arch/arm/mach-u300/ 1945F: arch/arm/mach-u300/
1961F: arch/arm/mach-ux500/ 1946F: arch/arm/mach-ux500/
1947F: drivers/soc/ux500/
1962F: arch/arm/boot/dts/ste-* 1948F: arch/arm/boot/dts/ste-*
1963F: drivers/clk/clk-nomadik.c 1949F: drivers/clk/clk-nomadik.c
1964F: drivers/clk/clk-u300.c 1950F: drivers/clk/clk-u300.c
@@ -2002,22 +1988,6 @@ F: drivers/*/*npcm*
2002F: Documentation/devicetree/bindings/*/*npcm* 1988F: Documentation/devicetree/bindings/*/*npcm*
2003F: Documentation/devicetree/bindings/*/*/*npcm* 1989F: Documentation/devicetree/bindings/*/*/*npcm*
2004 1990
2005ARM/NUVOTON W90X900 ARM ARCHITECTURE
2006M: Wan ZongShun <mcuos.com@gmail.com>
2007L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2008W: http://www.mcuos.com
2009S: Maintained
2010F: arch/arm/mach-w90x900/
2011F: drivers/input/keyboard/w90p910_keypad.c
2012F: drivers/input/touchscreen/w90p910_ts.c
2013F: drivers/watchdog/nuc900_wdt.c
2014F: drivers/net/ethernet/nuvoton/w90p910_ether.c
2015F: drivers/mtd/nand/raw/nuc900_nand.c
2016F: drivers/rtc/rtc-nuc900.c
2017F: drivers/spi/spi-nuc900.c
2018F: drivers/usb/host/ehci-w90x900.c
2019F: drivers/video/fbdev/nuc900fb.c
2020
2021ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT 1991ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
2022L: openmoko-kernel@lists.openmoko.org (subscribers-only) 1992L: openmoko-kernel@lists.openmoko.org (subscribers-only)
2023W: http://wiki.openmoko.org/wiki/Neo_FreeRunner 1993W: http://wiki.openmoko.org/wiki/Neo_FreeRunner
@@ -2210,8 +2180,9 @@ F: drivers/*/*s3c24*
2210F: drivers/*/*/*s3c24* 2180F: drivers/*/*/*s3c24*
2211F: drivers/*/*s3c64xx* 2181F: drivers/*/*s3c64xx*
2212F: drivers/*/*s5pv210* 2182F: drivers/*/*s5pv210*
2213F: drivers/memory/samsung/* 2183F: drivers/memory/samsung/
2214F: drivers/soc/samsung/* 2184F: drivers/soc/samsung/
2185F: include/linux/soc/samsung/
2215F: Documentation/arm/samsung/ 2186F: Documentation/arm/samsung/
2216F: Documentation/devicetree/bindings/arm/samsung/ 2187F: Documentation/devicetree/bindings/arm/samsung/
2217F: Documentation/devicetree/bindings/sram/samsung-sram.txt 2188F: Documentation/devicetree/bindings/sram/samsung-sram.txt
@@ -10628,12 +10599,6 @@ M: Nicolas Ferre <nicolas.ferre@microchip.com>
10628S: Supported 10599S: Supported
10629F: drivers/power/reset/at91-sama5d2_shdwc.c 10600F: drivers/power/reset/at91-sama5d2_shdwc.c
10630 10601
10631MICROCHIP SAMA5D2-COMPATIBLE PIOBU GPIO
10632M: Andrei Stefanescu <andrei.stefanescu@microchip.com>
10633L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
10634L: linux-gpio@vger.kernel.org
10635F: drivers/gpio/gpio-sama5d2-piobu.c
10636
10637MICROCHIP SPI DRIVER 10602MICROCHIP SPI DRIVER
10638M: Nicolas Ferre <nicolas.ferre@microchip.com> 10603M: Nicolas Ferre <nicolas.ferre@microchip.com>
10639S: Supported 10604S: Supported
@@ -10646,13 +10611,6 @@ S: Supported
10646F: drivers/misc/atmel-ssc.c 10611F: drivers/misc/atmel-ssc.c
10647F: include/linux/atmel-ssc.h 10612F: include/linux/atmel-ssc.h
10648 10613
10649MICROCHIP TIMER COUNTER (TC) AND CLOCKSOURCE DRIVERS
10650M: Nicolas Ferre <nicolas.ferre@microchip.com>
10651L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
10652S: Supported
10653F: drivers/misc/atmel_tclib.c
10654F: drivers/clocksource/tcb_clksrc.c
10655
10656MICROCHIP USBA UDC DRIVER 10614MICROCHIP USBA UDC DRIVER
10657M: Cristian Birsan <cristian.birsan@microchip.com> 10615M: Cristian Birsan <cristian.birsan@microchip.com>
10658L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 10616L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -12694,6 +12652,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
12694L: linux-gpio@vger.kernel.org 12652L: linux-gpio@vger.kernel.org
12695S: Supported 12653S: Supported
12696F: drivers/pinctrl/pinctrl-at91* 12654F: drivers/pinctrl/pinctrl-at91*
12655F: drivers/gpio/gpio-sama5d2-piobu.c
12697 12656
12698PIN CONTROLLER - FREESCALE 12657PIN CONTROLLER - FREESCALE
12699M: Dong Aisheng <aisheng.dong@nxp.com> 12658M: Dong Aisheng <aisheng.dong@nxp.com>
@@ -14127,6 +14086,8 @@ M: Kamil Konieczny <k.konieczny@partner.samsung.com>
14127L: linux-crypto@vger.kernel.org 14086L: linux-crypto@vger.kernel.org
14128L: linux-samsung-soc@vger.kernel.org 14087L: linux-samsung-soc@vger.kernel.org
14129S: Maintained 14088S: Maintained
14089F: Documentation/devicetree/bindings/crypto/samsung-slimsss.txt
14090F: Documentation/devicetree/bindings/crypto/samsung-sss.txt
14130F: drivers/crypto/s5p-sss.c 14091F: drivers/crypto/s5p-sss.c
14131 14092
14132SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS 14093SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
@@ -14147,6 +14108,8 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk.git
14147F: drivers/clk/samsung/ 14108F: drivers/clk/samsung/
14148F: include/dt-bindings/clock/exynos*.h 14109F: include/dt-bindings/clock/exynos*.h
14149F: Documentation/devicetree/bindings/clock/exynos*.txt 14110F: Documentation/devicetree/bindings/clock/exynos*.txt
14111F: Documentation/devicetree/bindings/clock/samsung,s3c*
14112F: Documentation/devicetree/bindings/clock/samsung,s5p*
14150 14113
14151SAMSUNG SPI DRIVERS 14114SAMSUNG SPI DRIVERS
14152M: Kukjin Kim <kgene@kernel.org> 14115M: Kukjin Kim <kgene@kernel.org>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 24360211534a..2ae7f8adcac4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -267,8 +267,6 @@ config PHYS_OFFSET
267 default 0x00000000 if ARCH_EBSA110 || \ 267 default 0x00000000 if ARCH_EBSA110 || \
268 ARCH_FOOTBRIDGE || \ 268 ARCH_FOOTBRIDGE || \
269 ARCH_INTEGRATOR || \ 269 ARCH_INTEGRATOR || \
270 ARCH_IOP13XX || \
271 ARCH_KS8695 || \
272 ARCH_REALVIEW 270 ARCH_REALVIEW
273 default 0x10000000 if ARCH_OMAP1 || ARCH_RPC 271 default 0x10000000 if ARCH_OMAP1 || ARCH_RPC
274 default 0x20000000 if ARCH_S5PV210 272 default 0x20000000 if ARCH_S5PV210
@@ -381,19 +379,6 @@ config ARCH_FOOTBRIDGE
381 Support for systems based on the DC21285 companion chip 379 Support for systems based on the DC21285 companion chip
382 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. 380 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
383 381
384config ARCH_IOP13XX
385 bool "IOP13xx-based"
386 depends on MMU
387 select CPU_XSC3
388 select NEED_MACH_MEMORY_H
389 select NEED_RET_TO_USER
390 select FORCE_PCI
391 select PLAT_IOP
392 select VMSPLIT_1G
393 select SPARSE_IRQ
394 help
395 Support for Intel's IOP13XX (XScale) family of processors.
396
397config ARCH_IOP32X 382config ARCH_IOP32X
398 bool "IOP32x-based" 383 bool "IOP32x-based"
399 depends on MMU 384 depends on MMU
@@ -407,18 +392,6 @@ config ARCH_IOP32X
407 Support for Intel's 80219 and IOP32X (XScale) family of 392 Support for Intel's 80219 and IOP32X (XScale) family of
408 processors. 393 processors.
409 394
410config ARCH_IOP33X
411 bool "IOP33x-based"
412 depends on MMU
413 select CPU_XSCALE
414 select GPIO_IOP
415 select GPIOLIB
416 select NEED_RET_TO_USER
417 select FORCE_PCI
418 select PLAT_IOP
419 help
420 Support for Intel's IOP33X (XScale) family of processors.
421
422config ARCH_IXP4XX 395config ARCH_IXP4XX
423 bool "IXP4xx-based" 396 bool "IXP4xx-based"
424 depends on MMU 397 depends on MMU
@@ -455,48 +428,6 @@ config ARCH_DOVE
455 help 428 help
456 Support for the Marvell Dove SoC 88AP510 429 Support for the Marvell Dove SoC 88AP510
457 430
458config ARCH_KS8695
459 bool "Micrel/Kendin KS8695"
460 select CLKSRC_MMIO
461 select CPU_ARM922T
462 select GENERIC_CLOCKEVENTS
463 select GPIOLIB
464 select NEED_MACH_MEMORY_H
465 help
466 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
467 System-on-Chip devices.
468
469config ARCH_W90X900
470 bool "Nuvoton W90X900 CPU"
471 select CLKDEV_LOOKUP
472 select CLKSRC_MMIO
473 select CPU_ARM926T
474 select GENERIC_CLOCKEVENTS
475 select GPIOLIB
476 help
477 Support for Nuvoton (Winbond logic dept.) ARM9 processor,
478 At present, the w90x900 has been renamed nuc900, regarding
479 the ARM series product line, you can login the following
480 link address to know more.
481
482 <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
483 ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
484
485config ARCH_LPC32XX
486 bool "NXP LPC32XX"
487 select ARM_AMBA
488 select CLKDEV_LOOKUP
489 select CLKSRC_LPC32XX
490 select COMMON_CLK
491 select CPU_ARM926T
492 select GENERIC_CLOCKEVENTS
493 select GENERIC_IRQ_MULTI_HANDLER
494 select GPIOLIB
495 select SPARSE_IRQ
496 select USE_OF
497 help
498 Support for the NXP LPC32XX family of processors
499
500config ARCH_PXA 431config ARCH_PXA
501 bool "PXA2xx/PXA3xx-based" 432 bool "PXA2xx/PXA3xx-based"
502 depends on MMU 433 depends on MMU
@@ -582,27 +513,6 @@ config ARCH_S3C24XX
582 (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or the 513 (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or the
583 Samsung SMDK2410 development board (and derivatives). 514 Samsung SMDK2410 development board (and derivatives).
584 515
585config ARCH_DAVINCI
586 bool "TI DaVinci"
587 select ARCH_HAS_HOLES_MEMORYMODEL
588 select COMMON_CLK
589 select CPU_ARM926T
590 select GENERIC_ALLOCATOR
591 select GENERIC_CLOCKEVENTS
592 select GENERIC_IRQ_CHIP
593 select GENERIC_IRQ_MULTI_HANDLER
594 select GPIOLIB
595 select HAVE_IDE
596 select PM_GENERIC_DOMAINS if PM
597 select PM_GENERIC_DOMAINS_OF if PM && OF
598 select REGMAP_MMIO
599 select RESET_CONTROLLER
600 select SPARSE_IRQ
601 select USE_OF
602 select ZONE_DMA
603 help
604 Support for TI's DaVinci platform.
605
606config ARCH_OMAP1 516config ARCH_OMAP1
607 bool "TI OMAP1" 517 bool "TI OMAP1"
608 depends on MMU 518 depends on MMU
@@ -738,17 +648,13 @@ source "arch/arm/mach-imx/Kconfig"
738 648
739source "arch/arm/mach-integrator/Kconfig" 649source "arch/arm/mach-integrator/Kconfig"
740 650
741source "arch/arm/mach-iop13xx/Kconfig"
742
743source "arch/arm/mach-iop32x/Kconfig" 651source "arch/arm/mach-iop32x/Kconfig"
744 652
745source "arch/arm/mach-iop33x/Kconfig"
746
747source "arch/arm/mach-ixp4xx/Kconfig" 653source "arch/arm/mach-ixp4xx/Kconfig"
748 654
749source "arch/arm/mach-keystone/Kconfig" 655source "arch/arm/mach-keystone/Kconfig"
750 656
751source "arch/arm/mach-ks8695/Kconfig" 657source "arch/arm/mach-lpc32xx/Kconfig"
752 658
753source "arch/arm/mach-mediatek/Kconfig" 659source "arch/arm/mach-mediatek/Kconfig"
754 660
@@ -834,8 +740,6 @@ source "arch/arm/plat-versatile/Kconfig"
834 740
835source "arch/arm/mach-vt8500/Kconfig" 741source "arch/arm/mach-vt8500/Kconfig"
836 742
837source "arch/arm/mach-w90x900/Kconfig"
838
839source "arch/arm/mach-zx/Kconfig" 743source "arch/arm/mach-zx/Kconfig"
840 744
841source "arch/arm/mach-zynq/Kconfig" 745source "arch/arm/mach-zynq/Kconfig"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 85710e078afb..fe7e9b583e63 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -509,13 +509,6 @@ choice
509 Say Y here if you want the debug print routines to direct 509 Say Y here if you want the debug print routines to direct
510 their output to UART1 serial port on KEYSTONE2 devices. 510 their output to UART1 serial port on KEYSTONE2 devices.
511 511
512 config DEBUG_KS8695_UART
513 bool "KS8695 Debug UART"
514 depends on ARCH_KS8695
515 help
516 Say Y here if you want kernel low-level debugging support
517 on KS8695.
518
519 config DEBUG_LPC18XX_UART0 512 config DEBUG_LPC18XX_UART0
520 bool "Kernel low-level debugging via LPC18xx/43xx UART0" 513 bool "Kernel low-level debugging via LPC18xx/43xx UART0"
521 depends on ARCH_LPC18XX 514 depends on ARCH_LPC18XX
@@ -924,6 +917,20 @@ choice
924 Say Y here if you want kernel low-level debugging support 917 Say Y here if you want kernel low-level debugging support
925 via SCIF2 on Renesas RZ/A1H (R7S72100). 918 via SCIF2 on Renesas RZ/A1H (R7S72100).
926 919
920 config DEBUG_R7S9210_SCIF2
921 bool "Kernel low-level debugging messages via SCIF2 on R7S9210"
922 depends on ARCH_R7S9210
923 help
924 Say Y here if you want kernel low-level debugging support
925 via SCIF2 on Renesas RZ/A2M (R7S9210).
926
927 config DEBUG_R7S9210_SCIF4
928 bool "Kernel low-level debugging messages via SCIF4 on R7S9210"
929 depends on ARCH_R7S9210
930 help
931 Say Y here if you want kernel low-level debugging support
932 via SCIF4 on Renesas RZ/A2M (R7S9210).
933
927 config DEBUG_RCAR_GEN1_SCIF0 934 config DEBUG_RCAR_GEN1_SCIF0
928 bool "Kernel low-level debugging messages via SCIF0 on R8A7778" 935 bool "Kernel low-level debugging messages via SCIF0 on R8A7778"
929 depends on ARCH_R8A7778 936 depends on ARCH_R8A7778
@@ -1533,10 +1540,11 @@ config DEBUG_LL_INCLUDE
1533 DEBUG_IMX6SX_UART || \ 1540 DEBUG_IMX6SX_UART || \
1534 DEBUG_IMX6UL_UART || \ 1541 DEBUG_IMX6UL_UART || \
1535 DEBUG_IMX7D_UART 1542 DEBUG_IMX7D_UART
1536 default "debug/ks8695.S" if DEBUG_KS8695_UART
1537 default "debug/msm.S" if DEBUG_QCOM_UARTDM 1543 default "debug/msm.S" if DEBUG_QCOM_UARTDM
1538 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART 1544 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
1539 default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2 1545 default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2
1546 default "debug/renesas-scif.S" if DEBUG_R7S9210_SCIF2
1547 default "debug/renesas-scif.S" if DEBUG_R7S9210_SCIF4
1540 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF0 1548 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF0
1541 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF2 1549 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF2
1542 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF0 1550 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF0
@@ -1568,9 +1576,7 @@ config DEBUG_UART_PL01X
1568 1576
1569# Compatibility options for 8250 1577# Compatibility options for 8250
1570config DEBUG_UART_8250 1578config DEBUG_UART_8250
1571 def_bool ARCH_EBSA110 || \ 1579 def_bool ARCH_EBSA110 || ARCH_IOP32X || ARCH_IXP4XX || ARCH_RPC
1572 ARCH_IOP13XX || ARCH_IOP32X || ARCH_IOP33X || ARCH_IXP4XX || \
1573 ARCH_RPC
1574 1580
1575config DEBUG_UART_PHYS 1581config DEBUG_UART_PHYS
1576 hex "Physical base address of debug UART" 1582 hex "Physical base address of debug UART"
@@ -1666,7 +1672,8 @@ config DEBUG_UART_PHYS
1666 default 0xe6e60000 if DEBUG_RCAR_GEN2_SCIF0 1672 default 0xe6e60000 if DEBUG_RCAR_GEN2_SCIF0
1667 default 0xe6e68000 if DEBUG_RCAR_GEN2_SCIF1 1673 default 0xe6e68000 if DEBUG_RCAR_GEN2_SCIF1
1668 default 0xe6ee0000 if DEBUG_RCAR_GEN2_SCIF4 1674 default 0xe6ee0000 if DEBUG_RCAR_GEN2_SCIF4
1669 default 0xe8008000 if DEBUG_R7S72100_SCIF2 1675 default 0xe8008000 if DEBUG_R7S72100_SCIF2 || DEBUG_R7S9210_SCIF2
1676 default 0xe8009000 if DEBUG_R7S9210_SCIF4
1670 default 0xf0000000 if DEBUG_DIGICOLOR_UA0 1677 default 0xf0000000 if DEBUG_DIGICOLOR_UA0
1671 default 0xf0000be0 if ARCH_EBSA110 1678 default 0xf0000be0 if ARCH_EBSA110
1672 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE 1679 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE
@@ -1683,7 +1690,6 @@ config DEBUG_UART_PHYS
1683 default 0xffc02000 if DEBUG_SOCFPGA_UART0 1690 default 0xffc02000 if DEBUG_SOCFPGA_UART0
1684 default 0xffc02100 if DEBUG_SOCFPGA_ARRIA10_UART1 1691 default 0xffc02100 if DEBUG_SOCFPGA_ARRIA10_UART1
1685 default 0xffc03000 if DEBUG_SOCFPGA_CYCLONE5_UART1 1692 default 0xffc03000 if DEBUG_SOCFPGA_CYCLONE5_UART1
1686 default 0xffd82340 if ARCH_IOP13XX
1687 default 0xffe40000 if DEBUG_RCAR_GEN1_SCIF0 1693 default 0xffe40000 if DEBUG_RCAR_GEN1_SCIF0
1688 default 0xffe42000 if DEBUG_RCAR_GEN1_SCIF2 1694 default 0xffe42000 if DEBUG_RCAR_GEN1_SCIF2
1689 default 0xfff36000 if DEBUG_HIGHBANK_UART 1695 default 0xfff36000 if DEBUG_HIGHBANK_UART
@@ -1693,12 +1699,12 @@ config DEBUG_UART_PHYS
1693 default 0xfffe8600 if DEBUG_BCM63XX_UART 1699 default 0xfffe8600 if DEBUG_BCM63XX_UART
1694 default 0xffffee00 if DEBUG_AT91_SAM9263_DBGU 1700 default 0xffffee00 if DEBUG_AT91_SAM9263_DBGU
1695 default 0xfffff200 if DEBUG_AT91_RM9200_DBGU 1701 default 0xfffff200 if DEBUG_AT91_RM9200_DBGU
1696 default 0xfffff700 if ARCH_IOP33X
1697 depends on ARCH_EP93XX || \ 1702 depends on ARCH_EP93XX || \
1698 DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ 1703 DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
1699 DEBUG_LL_UART_EFM32 || \ 1704 DEBUG_LL_UART_EFM32 || \
1700 DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ 1705 DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
1701 DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \ 1706 DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \
1707 DEBUG_R7S9210_SCIF2 || DEBUG_R7S9210_SCIF4 || \
1702 DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \ 1708 DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \
1703 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF1 || \ 1709 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF1 || \
1704 DEBUG_RCAR_GEN2_SCIF2 || DEBUG_RCAR_GEN2_SCIF4 || \ 1710 DEBUG_RCAR_GEN2_SCIF2 || DEBUG_RCAR_GEN2_SCIF4 || \
@@ -1772,10 +1778,7 @@ config DEBUG_UART_VIRT
1772 default 0xfc705000 if DEBUG_ZTE_ZX 1778 default 0xfc705000 if DEBUG_ZTE_ZX
1773 default 0xfcfe8600 if DEBUG_BCM63XX_UART 1779 default 0xfcfe8600 if DEBUG_BCM63XX_UART
1774 default 0xfd000000 if DEBUG_SPEAR3XX || DEBUG_SPEAR13XX 1780 default 0xfd000000 if DEBUG_SPEAR3XX || DEBUG_SPEAR13XX
1775 default 0xfd012000 if DEBUG_MVEBU_UART0_ALTERNATE && ARCH_MV78XX0
1776 default 0xfd883000 if DEBUG_ALPINE_UART0 1781 default 0xfd883000 if DEBUG_ALPINE_UART0
1777 default 0xfde12000 if DEBUG_MVEBU_UART0_ALTERNATE && ARCH_DOVE
1778 default 0xfe012000 if DEBUG_MVEBU_UART0_ALTERNATE && ARCH_ORION5X
1779 default 0xfe017000 if DEBUG_MMP_UART2 1782 default 0xfe017000 if DEBUG_MMP_UART2
1780 default 0xfe018000 if DEBUG_MMP_UART3 1783 default 0xfe018000 if DEBUG_MMP_UART3
1781 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART 1784 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART
@@ -1790,7 +1793,7 @@ config DEBUG_UART_VIRT
1790 default 0xfec02000 if DEBUG_SOCFPGA_UART0 1793 default 0xfec02000 if DEBUG_SOCFPGA_UART0
1791 default 0xfec02100 if DEBUG_SOCFPGA_ARRIA10_UART1 1794 default 0xfec02100 if DEBUG_SOCFPGA_ARRIA10_UART1
1792 default 0xfec03000 if DEBUG_SOCFPGA_CYCLONE5_UART1 1795 default 0xfec03000 if DEBUG_SOCFPGA_CYCLONE5_UART1
1793 default 0xfec12000 if (DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE) && ARCH_MVEBU 1796 default 0xfec12000 if DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE
1794 default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE 1797 default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE
1795 default 0xfec10000 if DEBUG_SIRFATLAS7_UART0 1798 default 0xfec10000 if DEBUG_SIRFATLAS7_UART0
1796 default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0 1799 default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0
@@ -1805,14 +1808,12 @@ config DEBUG_UART_VIRT
1805 default 0xfedc0000 if DEBUG_EP93XX 1808 default 0xfedc0000 if DEBUG_EP93XX
1806 default 0xfee003f8 if DEBUG_FOOTBRIDGE_COM1 1809 default 0xfee003f8 if DEBUG_FOOTBRIDGE_COM1
1807 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART 1810 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
1808 default 0xfee82340 if ARCH_IOP13XX
1809 default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1811 default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
1810 default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1812 default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
1811 default 0xfef36000 if DEBUG_HIGHBANK_UART 1813 default 0xfef36000 if DEBUG_HIGHBANK_UART
1812 default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1 1814 default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1
1813 default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2 1815 default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
1814 default 0xfefb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3 1816 default 0xfefb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3
1815 default 0xfefff700 if ARCH_IOP33X
1816 default 0xff003000 if DEBUG_U300_UART 1817 default 0xff003000 if DEBUG_U300_UART
1817 default 0xffd01000 if DEBUG_HIP01_UART 1818 default 0xffd01000 if DEBUG_HIP01_UART
1818 default DEBUG_UART_PHYS if !MMU 1819 default DEBUG_UART_PHYS if !MMU
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c3624ca6c0bc..f9002e44f18f 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -155,6 +155,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
155machine-$(CONFIG_ARCH_ACTIONS) += actions 155machine-$(CONFIG_ARCH_ACTIONS) += actions
156machine-$(CONFIG_ARCH_ALPINE) += alpine 156machine-$(CONFIG_ARCH_ALPINE) += alpine
157machine-$(CONFIG_ARCH_ARTPEC) += artpec 157machine-$(CONFIG_ARCH_ARTPEC) += artpec
158machine-$(CONFIG_ARCH_ASPEED) += aspeed
158machine-$(CONFIG_ARCH_AT91) += at91 159machine-$(CONFIG_ARCH_AT91) += at91
159machine-$(CONFIG_ARCH_AXXIA) += axxia 160machine-$(CONFIG_ARCH_AXXIA) += axxia
160machine-$(CONFIG_ARCH_BCM) += bcm 161machine-$(CONFIG_ARCH_BCM) += bcm
@@ -173,12 +174,9 @@ machine-$(CONFIG_ARCH_GEMINI) += gemini
173machine-$(CONFIG_ARCH_HIGHBANK) += highbank 174machine-$(CONFIG_ARCH_HIGHBANK) += highbank
174machine-$(CONFIG_ARCH_HISI) += hisi 175machine-$(CONFIG_ARCH_HISI) += hisi
175machine-$(CONFIG_ARCH_INTEGRATOR) += integrator 176machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
176machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
177machine-$(CONFIG_ARCH_IOP32X) += iop32x 177machine-$(CONFIG_ARCH_IOP32X) += iop32x
178machine-$(CONFIG_ARCH_IOP33X) += iop33x
179machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx 178machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
180machine-$(CONFIG_ARCH_KEYSTONE) += keystone 179machine-$(CONFIG_ARCH_KEYSTONE) += keystone
181machine-$(CONFIG_ARCH_KS8695) += ks8695
182machine-$(CONFIG_ARCH_LPC18XX) += lpc18xx 180machine-$(CONFIG_ARCH_LPC18XX) += lpc18xx
183machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx 181machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
184machine-$(CONFIG_ARCH_MESON) += meson 182machine-$(CONFIG_ARCH_MESON) += meson
@@ -222,7 +220,6 @@ machine-$(CONFIG_ARCH_U8500) += ux500
222machine-$(CONFIG_ARCH_VERSATILE) += versatile 220machine-$(CONFIG_ARCH_VERSATILE) += versatile
223machine-$(CONFIG_ARCH_VEXPRESS) += vexpress 221machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
224machine-$(CONFIG_ARCH_VT8500) += vt8500 222machine-$(CONFIG_ARCH_VT8500) += vt8500
225machine-$(CONFIG_ARCH_W90X900) += w90x900
226machine-$(CONFIG_ARCH_ZX) += zx 223machine-$(CONFIG_ARCH_ZX) += zx
227machine-$(CONFIG_ARCH_ZYNQ) += zynq 224machine-$(CONFIG_ARCH_ZYNQ) += zynq
228machine-$(CONFIG_PLAT_SPEAR) += spear 225machine-$(CONFIG_PLAT_SPEAR) += spear
@@ -233,7 +230,6 @@ plat-$(CONFIG_ARCH_EXYNOS) += samsung
233plat-$(CONFIG_ARCH_OMAP) += omap 230plat-$(CONFIG_ARCH_OMAP) += omap
234plat-$(CONFIG_ARCH_S3C64XX) += samsung 231plat-$(CONFIG_ARCH_S3C64XX) += samsung
235plat-$(CONFIG_ARCH_S5PV210) += samsung 232plat-$(CONFIG_ARCH_S5PV210) += samsung
236plat-$(CONFIG_PLAT_IOP) += iop
237plat-$(CONFIG_PLAT_ORION) += orion 233plat-$(CONFIG_PLAT_ORION) += orion
238plat-$(CONFIG_PLAT_PXA) += pxa 234plat-$(CONFIG_PLAT_PXA) += pxa
239plat-$(CONFIG_PLAT_S3C24XX) += samsung 235plat-$(CONFIG_PLAT_S3C24XX) += samsung
diff --git a/arch/arm/configs/acs5k_defconfig b/arch/arm/configs/acs5k_defconfig
deleted file mode 100644
index bcb8bda09158..000000000000
--- a/arch/arm/configs/acs5k_defconfig
+++ /dev/null
@@ -1,77 +0,0 @@
1# CONFIG_SWAP is not set
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_SYSFS_DEPRECATED_V2=y
6CONFIG_BLK_DEV_INITRD=y
7CONFIG_SLAB=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11# CONFIG_IOSCHED_DEADLINE is not set
12# CONFIG_IOSCHED_CFQ is not set
13CONFIG_ARCH_KS8695=y
14CONFIG_MACH_KS8695=y
15CONFIG_MACH_DSM320=y
16CONFIG_MACH_ACS5K=y
17# CONFIG_ARM_THUMB is not set
18CONFIG_PCI=y
19CONFIG_PCI_DEBUG=y
20CONFIG_PCCARD=y
21CONFIG_YENTA=y
22CONFIG_AEABI=y
23CONFIG_ZBOOT_ROM_TEXT=0x0
24CONFIG_ZBOOT_ROM_BSS=0x0
25CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
26CONFIG_NET=y
27CONFIG_PACKET=y
28CONFIG_UNIX=y
29CONFIG_INET=y
30CONFIG_IP_PNP=y
31CONFIG_IP_PNP_DHCP=y
32# CONFIG_IPV6 is not set
33CONFIG_MTD=y
34CONFIG_MTD_BLOCK=y
35CONFIG_MTD_CFI=y
36CONFIG_MTD_JEDECPROBE=y
37CONFIG_MTD_CFI_ADV_OPTIONS=y
38CONFIG_MTD_CFI_INTELEXT=y
39CONFIG_MTD_CFI_AMDSTD=y
40CONFIG_MTD_PHYSMAP=y
41CONFIG_BLK_DEV_RAM=y
42CONFIG_BLK_DEV_RAM_SIZE=8192
43CONFIG_NETDEVICES=y
44CONFIG_NET_ETHERNET=y
45CONFIG_ARM_KS8695_ETHER=y
46CONFIG_PRISM54=m
47# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
48# CONFIG_INPUT_KEYBOARD is not set
49# CONFIG_INPUT_MOUSE is not set
50# CONFIG_SERIO is not set
51CONFIG_SERIAL_KS8695=y
52CONFIG_SERIAL_KS8695_CONSOLE=y
53CONFIG_I2C=y
54CONFIG_I2C_CHARDEV=y
55CONFIG_I2C_GPIO=y
56CONFIG_GPIO_SYSFS=y
57CONFIG_GPIO_PCA953X=y
58CONFIG_WATCHDOG=y
59CONFIG_KS8695_WATCHDOG=y
60# CONFIG_VGA_CONSOLE is not set
61CONFIG_RTC_CLASS=y
62CONFIG_RTC_DRV_PCF8563=y
63CONFIG_EXT2_FS=y
64CONFIG_TMPFS=y
65CONFIG_JFFS2_FS=y
66CONFIG_JFFS2_SUMMARY=y
67CONFIG_JFFS2_COMPRESSION_OPTIONS=y
68CONFIG_JFFS2_RUBIN=y
69CONFIG_CRAMFS=y
70CONFIG_NFS_FS=y
71CONFIG_NFS_V3=y
72CONFIG_ROOT_NFS=y
73CONFIG_DEBUG_KERNEL=y
74CONFIG_DEBUG_MUTEXES=y
75# CONFIG_FTRACE is not set
76CONFIG_DEBUG_USER=y
77CONFIG_DEBUG_LL=y
diff --git a/arch/arm/configs/acs5k_tiny_defconfig b/arch/arm/configs/acs5k_tiny_defconfig
deleted file mode 100644
index e802cdebfd0b..000000000000
--- a/arch/arm/configs/acs5k_tiny_defconfig
+++ /dev/null
@@ -1,69 +0,0 @@
1# CONFIG_SWAP is not set
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_SYSFS_DEPRECATED_V2=y
6CONFIG_SLAB=y
7CONFIG_MODULES=y
8CONFIG_MODULE_UNLOAD=y
9# CONFIG_BLK_DEV_BSG is not set
10# CONFIG_IOSCHED_DEADLINE is not set
11# CONFIG_IOSCHED_CFQ is not set
12CONFIG_ARCH_KS8695=y
13CONFIG_MACH_ACS5K=y
14# CONFIG_ARM_THUMB is not set
15CONFIG_AEABI=y
16CONFIG_ZBOOT_ROM_TEXT=0x0
17CONFIG_ZBOOT_ROM_BSS=0x0
18CONFIG_CMDLINE="console=ttyAM0,115200 init=/bin/sh"
19CONFIG_FPE_NWFPE=y
20CONFIG_NET=y
21CONFIG_PACKET=y
22CONFIG_UNIX=y
23CONFIG_INET=y
24# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25# CONFIG_INET_XFRM_MODE_TUNNEL is not set
26# CONFIG_INET_XFRM_MODE_BEET is not set
27# CONFIG_IPV6 is not set
28CONFIG_MTD=y
29CONFIG_MTD_BLOCK=y
30CONFIG_MTD_CFI=y
31CONFIG_MTD_JEDECPROBE=y
32CONFIG_MTD_CFI_ADV_OPTIONS=y
33CONFIG_MTD_CFI_INTELEXT=y
34CONFIG_MTD_CFI_AMDSTD=y
35CONFIG_MTD_PHYSMAP=y
36# CONFIG_BLK_DEV is not set
37CONFIG_NETDEVICES=y
38CONFIG_NET_ETHERNET=y
39CONFIG_ARM_KS8695_ETHER=y
40# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
41# CONFIG_INPUT_KEYBOARD is not set
42# CONFIG_INPUT_MOUSE is not set
43# CONFIG_SERIO is not set
44CONFIG_SERIAL_KS8695=y
45CONFIG_SERIAL_KS8695_CONSOLE=y
46# CONFIG_HW_RANDOM is not set
47CONFIG_I2C=y
48CONFIG_I2C_CHARDEV=y
49CONFIG_I2C_GPIO=y
50CONFIG_GPIO_SYSFS=y
51CONFIG_GPIO_PCA953X=y
52# CONFIG_HWMON is not set
53CONFIG_WATCHDOG=y
54CONFIG_KS8695_WATCHDOG=y
55# CONFIG_VGA_CONSOLE is not set
56# CONFIG_USB_SUPPORT is not set
57CONFIG_RTC_CLASS=y
58CONFIG_RTC_DRV_PCF8563=y
59CONFIG_TMPFS=y
60CONFIG_JFFS2_FS=y
61CONFIG_JFFS2_SUMMARY=y
62CONFIG_JFFS2_COMPRESSION_OPTIONS=y
63CONFIG_JFFS2_RUBIN=y
64CONFIG_SQUASHFS=y
65# CONFIG_NETWORK_FILESYSTEMS is not set
66CONFIG_DEBUG_KERNEL=y
67CONFIG_DEBUG_MUTEXES=y
68# CONFIG_FTRACE is not set
69CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 9a32a8c0f873..b34970ce6b31 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -17,6 +17,9 @@ CONFIG_MODVERSIONS=y
17CONFIG_PARTITION_ADVANCED=y 17CONFIG_PARTITION_ADVANCED=y
18# CONFIG_IOSCHED_DEADLINE is not set 18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set 19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_MULTIPLATFORM=y
21CONFIG_ARCH_MULTI_V7=n
22CONFIG_ARCH_MULTI_V5=y
20CONFIG_ARCH_DAVINCI=y 23CONFIG_ARCH_DAVINCI=y
21CONFIG_ARCH_DAVINCI_DM644x=y 24CONFIG_ARCH_DAVINCI_DM644x=y
22CONFIG_ARCH_DAVINCI_DM355=y 25CONFIG_ARCH_DAVINCI_DM355=y
@@ -129,9 +132,11 @@ CONFIG_SPI=y
129CONFIG_SPI_DAVINCI=m 132CONFIG_SPI_DAVINCI=m
130CONFIG_PINCTRL_DA850_PUPD=m 133CONFIG_PINCTRL_DA850_PUPD=m
131CONFIG_PINCTRL_SINGLE=y 134CONFIG_PINCTRL_SINGLE=y
135CONFIG_GPIOLIB=y
132CONFIG_GPIO_SYSFS=y 136CONFIG_GPIO_SYSFS=y
133CONFIG_GPIO_PCA953X=y 137CONFIG_GPIO_PCA953X=y
134CONFIG_GPIO_PCA953X_IRQ=y 138CONFIG_GPIO_PCA953X_IRQ=y
139CONFIG_RESET_CONTROLLER=y
135CONFIG_POWER_RESET=y 140CONFIG_POWER_RESET=y
136CONFIG_POWER_RESET_GPIO=y 141CONFIG_POWER_RESET_GPIO=y
137CONFIG_SYSCON_REBOOT_MODE=m 142CONFIG_SYSCON_REBOOT_MODE=m
diff --git a/arch/arm/configs/iop13xx_defconfig b/arch/arm/configs/iop13xx_defconfig
deleted file mode 100644
index 30cdb287e1b4..000000000000
--- a/arch/arm/configs/iop13xx_defconfig
+++ /dev/null
@@ -1,118 +0,0 @@
1# CONFIG_LOCALVERSION_AUTO is not set
2CONFIG_SYSVIPC=y
3CONFIG_POSIX_MQUEUE=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_IKCONFIG=y
6CONFIG_IKCONFIG_PROC=y
7CONFIG_LOG_BUF_SHIFT=14
8CONFIG_BLK_DEV_INITRD=y
9# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
10CONFIG_SLAB=y
11CONFIG_MODULES=y
12CONFIG_MODULE_UNLOAD=y
13CONFIG_MODVERSIONS=y
14# CONFIG_BLK_DEV_BSG is not set
15# CONFIG_IOSCHED_CFQ is not set
16CONFIG_ARCH_IOP13XX=y
17CONFIG_MACH_IQ81340SC=y
18CONFIG_MACH_IQ81340MC=y
19CONFIG_ZBOOT_ROM_TEXT=0x0
20CONFIG_ZBOOT_ROM_BSS=0x0
21CONFIG_CMDLINE="ip=bootp root=nfs console=ttyS0,115200 nfsroot=,tcp,v3,wsize=8192,rsize=8192"
22CONFIG_FPE_NWFPE=y
23CONFIG_BINFMT_AOUT=y
24CONFIG_NET=y
25CONFIG_PACKET=y
26CONFIG_UNIX=y
27CONFIG_NET_KEY=y
28CONFIG_INET=y
29CONFIG_IP_MULTICAST=y
30CONFIG_IP_PNP=y
31CONFIG_IP_PNP_BOOTP=y
32CONFIG_IPV6=y
33# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
34# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
35# CONFIG_INET6_XFRM_MODE_BEET is not set
36# CONFIG_IPV6_SIT is not set
37CONFIG_MTD=y
38CONFIG_MTD_REDBOOT_PARTS=y
39CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
40CONFIG_MTD_REDBOOT_PARTS_READONLY=y
41CONFIG_MTD_BLOCK=y
42CONFIG_MTD_CFI=y
43CONFIG_MTD_CFI_ADV_OPTIONS=y
44CONFIG_MTD_CFI_INTELEXT=y
45CONFIG_MTD_PHYSMAP=y
46CONFIG_BLK_DEV_RAM=y
47CONFIG_BLK_DEV_RAM_COUNT=2
48CONFIG_BLK_DEV_RAM_SIZE=8192
49CONFIG_SCSI=y
50CONFIG_BLK_DEV_SD=y
51CONFIG_CHR_DEV_SG=y
52CONFIG_SCSI_CONSTANTS=y
53CONFIG_SCSI_ISCSI_ATTRS=y
54CONFIG_MD=y
55CONFIG_BLK_DEV_MD=y
56CONFIG_MD_RAID0=y
57CONFIG_MD_RAID1=y
58CONFIG_MD_RAID10=y
59CONFIG_MD_RAID456=y
60CONFIG_BLK_DEV_DM=y
61CONFIG_NETDEVICES=y
62CONFIG_E1000=y
63# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
64# CONFIG_INPUT_KEYBOARD is not set
65# CONFIG_INPUT_MOUSE is not set
66# CONFIG_SERIO is not set
67CONFIG_SERIAL_8250=y
68CONFIG_SERIAL_8250_CONSOLE=y
69CONFIG_SERIAL_8250_NR_UARTS=2
70CONFIG_HW_RANDOM=y
71CONFIG_I2C=y
72CONFIG_I2C_IOP3XX=y
73# CONFIG_VGA_CONSOLE is not set
74CONFIG_DMADEVICES=y
75CONFIG_INTEL_IOP_ADMA=y
76CONFIG_EXT2_FS=y
77CONFIG_EXT3_FS=y
78CONFIG_TMPFS=y
79CONFIG_ECRYPT_FS=y
80CONFIG_JFFS2_FS=y
81CONFIG_CRAMFS=y
82CONFIG_NFS_FS=y
83CONFIG_NFS_V3=y
84CONFIG_ROOT_NFS=y
85CONFIG_NFSD=y
86CONFIG_NFSD_V3=y
87CONFIG_SMB_FS=m
88CONFIG_CIFS=m
89CONFIG_PARTITION_ADVANCED=y
90CONFIG_NLS=y
91CONFIG_DEBUG_USER=y
92CONFIG_KEYS=y
93CONFIG_CRYPTO_NULL=y
94CONFIG_CRYPTO_LRW=y
95CONFIG_CRYPTO_PCBC=m
96CONFIG_CRYPTO_HMAC=y
97CONFIG_CRYPTO_XCBC=y
98CONFIG_CRYPTO_MD4=y
99CONFIG_CRYPTO_MICHAEL_MIC=y
100CONFIG_CRYPTO_SHA1=y
101CONFIG_CRYPTO_SHA256=y
102CONFIG_CRYPTO_SHA512=y
103CONFIG_CRYPTO_TGR192=y
104CONFIG_CRYPTO_WP512=y
105CONFIG_CRYPTO_AES=y
106CONFIG_CRYPTO_ANUBIS=y
107CONFIG_CRYPTO_ARC4=y
108CONFIG_CRYPTO_BLOWFISH=y
109CONFIG_CRYPTO_CAST5=y
110CONFIG_CRYPTO_CAST6=y
111CONFIG_CRYPTO_DES=y
112CONFIG_CRYPTO_KHAZAD=y
113CONFIG_CRYPTO_SERPENT=y
114CONFIG_CRYPTO_TEA=y
115CONFIG_CRYPTO_TWOFISH=y
116CONFIG_CRYPTO_DEFLATE=y
117CONFIG_CRC_CCITT=y
118CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/iop33x_defconfig b/arch/arm/configs/iop33x_defconfig
deleted file mode 100644
index 089eca43214a..000000000000
--- a/arch/arm/configs/iop33x_defconfig
+++ /dev/null
@@ -1,85 +0,0 @@
1CONFIG_SYSVIPC=y
2CONFIG_BSD_PROCESS_ACCT=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_KALLSYMS_ALL=y
6CONFIG_SLAB=y
7CONFIG_MODULES=y
8CONFIG_MODULE_UNLOAD=y
9# CONFIG_BLK_DEV_BSG is not set
10CONFIG_ARCH_IOP33X=y
11CONFIG_ARCH_IQ80331=y
12CONFIG_MACH_IQ80332=y
13# CONFIG_ARM_THUMB is not set
14CONFIG_ZBOOT_ROM_TEXT=0x0
15CONFIG_ZBOOT_ROM_BSS=0x0
16CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp cachepolicy=writealloc iop3xx_init_atu=y"
17CONFIG_FPE_NWFPE=y
18CONFIG_BINFMT_AOUT=y
19CONFIG_NET=y
20CONFIG_PACKET=y
21CONFIG_UNIX=y
22CONFIG_INET=y
23CONFIG_IP_MULTICAST=y
24CONFIG_IP_PNP=y
25CONFIG_IP_PNP_BOOTP=y
26CONFIG_IPV6=y
27# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
28# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
29# CONFIG_INET6_XFRM_MODE_BEET is not set
30# CONFIG_IPV6_SIT is not set
31CONFIG_MTD=y
32CONFIG_MTD_REDBOOT_PARTS=y
33CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
34CONFIG_MTD_REDBOOT_PARTS_READONLY=y
35CONFIG_MTD_BLOCK=y
36CONFIG_MTD_CFI=y
37CONFIG_MTD_CFI_ADV_OPTIONS=y
38CONFIG_MTD_CFI_INTELEXT=y
39CONFIG_MTD_PHYSMAP=y
40CONFIG_BLK_DEV_NBD=y
41CONFIG_BLK_DEV_RAM=y
42CONFIG_BLK_DEV_RAM_SIZE=8192
43CONFIG_SCSI=y
44CONFIG_BLK_DEV_SD=y
45CONFIG_CHR_DEV_SG=y
46CONFIG_MD=y
47CONFIG_BLK_DEV_MD=y
48CONFIG_MD_LINEAR=y
49CONFIG_MD_RAID0=y
50CONFIG_MD_RAID1=y
51CONFIG_MD_RAID456=y
52CONFIG_BLK_DEV_DM=y
53CONFIG_NETDEVICES=y
54CONFIG_E1000=y
55# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
56# CONFIG_INPUT_KEYBOARD is not set
57# CONFIG_INPUT_MOUSE is not set
58# CONFIG_SERIO is not set
59CONFIG_SERIAL_8250=y
60CONFIG_SERIAL_8250_CONSOLE=y
61CONFIG_HW_RANDOM=y
62CONFIG_I2C=y
63CONFIG_I2C_CHARDEV=y
64CONFIG_I2C_IOP3XX=y
65# CONFIG_VGA_CONSOLE is not set
66CONFIG_DMADEVICES=y
67CONFIG_INTEL_IOP_ADMA=y
68CONFIG_NET_DMA=y
69CONFIG_EXT2_FS=y
70CONFIG_EXT3_FS=y
71CONFIG_TMPFS=y
72CONFIG_CRAMFS=y
73CONFIG_NFS_FS=y
74CONFIG_NFS_V3=y
75CONFIG_ROOT_NFS=y
76CONFIG_NFSD=y
77CONFIG_NFSD_V3=y
78CONFIG_PARTITION_ADVANCED=y
79CONFIG_MAGIC_SYSRQ=y
80CONFIG_DEBUG_KERNEL=y
81CONFIG_DEBUG_USER=y
82CONFIG_DEBUG_LL=y
83CONFIG_DEBUG_LL_UART_8250=y
84# CONFIG_CRYPTO_ANSI_CPRNG is not set
85# CONFIG_CRC32 is not set
diff --git a/arch/arm/configs/ks8695_defconfig b/arch/arm/configs/ks8695_defconfig
deleted file mode 100644
index df62d4dfbbb7..000000000000
--- a/arch/arm/configs/ks8695_defconfig
+++ /dev/null
@@ -1,67 +0,0 @@
1# CONFIG_SWAP is not set
2CONFIG_SYSVIPC=y
3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_SYSFS_DEPRECATED_V2=y
5CONFIG_BLK_DEV_INITRD=y
6CONFIG_SLAB=y
7CONFIG_MODULES=y
8CONFIG_MODULE_UNLOAD=y
9# CONFIG_BLK_DEV_BSG is not set
10# CONFIG_IOSCHED_DEADLINE is not set
11# CONFIG_IOSCHED_CFQ is not set
12CONFIG_ARCH_KS8695=y
13CONFIG_MACH_KS8695=y
14CONFIG_MACH_DSM320=y
15# CONFIG_ARM_THUMB is not set
16CONFIG_PCI=y
17CONFIG_PCI_DEBUG=y
18CONFIG_PCCARD=y
19CONFIG_YENTA=y
20CONFIG_AEABI=y
21CONFIG_ZBOOT_ROM_TEXT=0x0
22CONFIG_ZBOOT_ROM_BSS=0x0
23CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
24CONFIG_NET=y
25CONFIG_PACKET=y
26CONFIG_UNIX=y
27CONFIG_INET=y
28CONFIG_IP_PNP=y
29CONFIG_IP_PNP_DHCP=y
30# CONFIG_IPV6 is not set
31CONFIG_MTD=y
32CONFIG_MTD_REDBOOT_PARTS=y
33CONFIG_MTD_CMDLINE_PARTS=y
34CONFIG_MTD_BLOCK=y
35CONFIG_MTD_CFI=y
36CONFIG_MTD_JEDECPROBE=y
37CONFIG_MTD_CFI_INTELEXT=y
38CONFIG_MTD_PHYSMAP=y
39CONFIG_BLK_DEV_RAM=y
40CONFIG_BLK_DEV_RAM_SIZE=8192
41CONFIG_NETDEVICES=y
42CONFIG_NET_ETHERNET=y
43CONFIG_MII=y
44CONFIG_PRISM54=m
45# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
46# CONFIG_INPUT_KEYBOARD is not set
47# CONFIG_INPUT_MOUSE is not set
48# CONFIG_SERIO is not set
49CONFIG_SERIAL_KS8695=y
50CONFIG_SERIAL_KS8695_CONSOLE=y
51# CONFIG_HWMON is not set
52# CONFIG_VGA_CONSOLE is not set
53CONFIG_EXT2_FS=y
54CONFIG_TMPFS=y
55CONFIG_JFFS2_FS=y
56CONFIG_JFFS2_SUMMARY=y
57CONFIG_JFFS2_COMPRESSION_OPTIONS=y
58CONFIG_JFFS2_RUBIN=y
59CONFIG_CRAMFS=y
60CONFIG_NFS_FS=y
61CONFIG_NFS_V3=y
62CONFIG_ROOT_NFS=y
63CONFIG_DEBUG_KERNEL=y
64CONFIG_DEBUG_MUTEXES=y
65# CONFIG_FTRACE is not set
66CONFIG_DEBUG_USER=y
67CONFIG_DEBUG_LL=y
diff --git a/arch/arm/configs/lpc32xx_defconfig b/arch/arm/configs/lpc32xx_defconfig
index 3772d5a8975a..09deb57db942 100644
--- a/arch/arm/configs/lpc32xx_defconfig
+++ b/arch/arm/configs/lpc32xx_defconfig
@@ -12,6 +12,7 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
12CONFIG_SYSCTL_SYSCALL=y 12CONFIG_SYSCTL_SYSCALL=y
13CONFIG_EMBEDDED=y 13CONFIG_EMBEDDED=y
14CONFIG_SLAB=y 14CONFIG_SLAB=y
15# CONFIG_ARCH_MULTI_V7 is not set
15CONFIG_ARCH_LPC32XX=y 16CONFIG_ARCH_LPC32XX=y
16CONFIG_AEABI=y 17CONFIG_AEABI=y
17CONFIG_ZBOOT_ROM_TEXT=0x0 18CONFIG_ZBOOT_ROM_TEXT=0x0
diff --git a/arch/arm/configs/multi_v5_defconfig b/arch/arm/configs/multi_v5_defconfig
index 201237002c65..bd018873e47a 100644
--- a/arch/arm/configs/multi_v5_defconfig
+++ b/arch/arm/configs/multi_v5_defconfig
@@ -14,6 +14,18 @@ CONFIG_ARCH_ASPEED=y
14CONFIG_MACH_ASPEED_G4=y 14CONFIG_MACH_ASPEED_G4=y
15CONFIG_ARCH_AT91=y 15CONFIG_ARCH_AT91=y
16CONFIG_SOC_AT91SAM9=y 16CONFIG_SOC_AT91SAM9=y
17CONFIG_ARCH_DAVINCI=y
18CONFIG_ARCH_DAVINCI_DM644x=y
19CONFIG_ARCH_DAVINCI_DM355=y
20CONFIG_ARCH_DAVINCI_DM646x=y
21CONFIG_ARCH_DAVINCI_DA830=y
22CONFIG_ARCH_DAVINCI_DA850=y
23CONFIG_ARCH_DAVINCI_DM365=y
24CONFIG_MACH_SFFSDR=y
25CONFIG_MACH_NEUROS_OSD2=y
26CONFIG_MACH_DM355_LEOPARD=y
27CONFIG_MACH_MITYOMAPL138=y
28CONFIG_MACH_OMAPL138_HAWKBOARD=y
17CONFIG_ARCH_MXC=y 29CONFIG_ARCH_MXC=y
18CONFIG_MACH_MX21ADS=y 30CONFIG_MACH_MX21ADS=y
19CONFIG_MACH_MX27ADS=y 31CONFIG_MACH_MX27ADS=y
diff --git a/arch/arm/configs/nuc910_defconfig b/arch/arm/configs/nuc910_defconfig
deleted file mode 100644
index 63dba62c3326..000000000000
--- a/arch/arm/configs/nuc910_defconfig
+++ /dev/null
@@ -1,51 +0,0 @@
1# CONFIG_LOCALVERSION_AUTO is not set
2CONFIG_SYSVIPC=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_SYSFS_DEPRECATED_V2=y
5CONFIG_RELAY=y
6CONFIG_USER_NS=y
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_KALLSYMS_EXTRA_PASS=y
9CONFIG_SLAB=y
10CONFIG_ARCH_W90X900=y
11CONFIG_PREEMPT=y
12CONFIG_AEABI=y
13CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
14CONFIG_KEXEC=y
15CONFIG_FPE_NWFPE=y
16CONFIG_MTD=y
17CONFIG_MTD_BLOCK=y
18CONFIG_MTD_CFI=y
19CONFIG_MTD_CFI_AMDSTD=y
20CONFIG_MTD_PHYSMAP=y
21CONFIG_BLK_DEV_RAM=y
22CONFIG_BLK_DEV_RAM_SIZE=16384
23CONFIG_SCSI=y
24# CONFIG_SCSI_PROC_FS is not set
25CONFIG_BLK_DEV_SD=y
26# CONFIG_SCSI_LOWLEVEL is not set
27# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
28# CONFIG_INPUT_KEYBOARD is not set
29# CONFIG_INPUT_MOUSE is not set
30# CONFIG_SERIO is not set
31# CONFIG_DEVKMEM is not set
32CONFIG_SERIAL_8250=y
33CONFIG_SERIAL_8250_CONSOLE=y
34CONFIG_SERIAL_8250_NR_UARTS=1
35# CONFIG_LEGACY_PTYS is not set
36# CONFIG_HW_RANDOM is not set
37# CONFIG_HWMON is not set
38# CONFIG_VGA_CONSOLE is not set
39CONFIG_USB=y
40CONFIG_USB_MON=y
41CONFIG_USB_STORAGE=y
42# CONFIG_DNOTIFY is not set
43CONFIG_TMPFS=y
44CONFIG_TMPFS_POSIX_ACL=y
45CONFIG_ROMFS_FS=y
46CONFIG_PARTITION_ADVANCED=y
47CONFIG_NLS_CODEPAGE_437=y
48CONFIG_NLS_ISO8859_1=y
49# CONFIG_ENABLE_MUST_CHECK is not set
50CONFIG_DEBUG_FS=y
51# CONFIG_CRC32 is not set
diff --git a/arch/arm/configs/nuc950_defconfig b/arch/arm/configs/nuc950_defconfig
deleted file mode 100644
index cb5a8788ebe8..000000000000
--- a/arch/arm/configs/nuc950_defconfig
+++ /dev/null
@@ -1,67 +0,0 @@
1# CONFIG_LOCALVERSION_AUTO is not set
2CONFIG_SYSVIPC=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_SYSFS_DEPRECATED_V2=y
5CONFIG_RELAY=y
6CONFIG_USER_NS=y
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_KALLSYMS_EXTRA_PASS=y
9CONFIG_SLAB=y
10CONFIG_ARCH_W90X900=y
11# CONFIG_MACH_W90P910EVB is not set
12CONFIG_MACH_W90P950EVB=y
13CONFIG_NO_HZ=y
14CONFIG_HIGH_RES_TIMERS=y
15CONFIG_PREEMPT=y
16CONFIG_AEABI=y
17CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
18CONFIG_KEXEC=y
19CONFIG_FPE_NWFPE=y
20CONFIG_BINFMT_AOUT=y
21CONFIG_BINFMT_MISC=y
22CONFIG_MTD=y
23CONFIG_MTD_BLOCK=y
24CONFIG_MTD_CFI=y
25CONFIG_MTD_CFI_AMDSTD=y
26CONFIG_MTD_PHYSMAP=y
27CONFIG_BLK_DEV_RAM=y
28CONFIG_BLK_DEV_RAM_SIZE=16384
29CONFIG_SCSI=y
30# CONFIG_SCSI_PROC_FS is not set
31CONFIG_BLK_DEV_SD=y
32# CONFIG_SCSI_LOWLEVEL is not set
33# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
34# CONFIG_INPUT_KEYBOARD is not set
35# CONFIG_INPUT_MOUSE is not set
36# CONFIG_SERIO is not set
37# CONFIG_DEVKMEM is not set
38CONFIG_SERIAL_8250=y
39CONFIG_SERIAL_8250_CONSOLE=y
40CONFIG_SERIAL_8250_NR_UARTS=1
41# CONFIG_LEGACY_PTYS is not set
42# CONFIG_HW_RANDOM is not set
43# CONFIG_HWMON is not set
44CONFIG_FB=y
45CONFIG_FB_NUC900=y
46CONFIG_GPM1040A0_320X240=y
47CONFIG_FB_NUC900_DEBUG=y
48# CONFIG_VGA_CONSOLE is not set
49CONFIG_FRAMEBUFFER_CONSOLE=y
50CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
51CONFIG_FONTS=y
52CONFIG_FONT_8x16=y
53CONFIG_LOGO=y
54# CONFIG_LOGO_LINUX_MONO is not set
55# CONFIG_LOGO_LINUX_VGA16 is not set
56CONFIG_USB=y
57CONFIG_USB_MON=y
58CONFIG_USB_STORAGE=y
59# CONFIG_DNOTIFY is not set
60CONFIG_TMPFS=y
61CONFIG_TMPFS_POSIX_ACL=y
62CONFIG_ROMFS_FS=y
63CONFIG_PARTITION_ADVANCED=y
64CONFIG_NLS_CODEPAGE_437=y
65CONFIG_NLS_ISO8859_1=y
66# CONFIG_ENABLE_MUST_CHECK is not set
67CONFIG_DEBUG_FS=y
diff --git a/arch/arm/configs/nuc960_defconfig b/arch/arm/configs/nuc960_defconfig
deleted file mode 100644
index f7af84e23a05..000000000000
--- a/arch/arm/configs/nuc960_defconfig
+++ /dev/null
@@ -1,57 +0,0 @@
1# CONFIG_LOCALVERSION_AUTO is not set
2CONFIG_SYSVIPC=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_SYSFS_DEPRECATED_V2=y
5CONFIG_RELAY=y
6CONFIG_USER_NS=y
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_KALLSYMS_EXTRA_PASS=y
9CONFIG_SLAB=y
10CONFIG_ARCH_W90X900=y
11# CONFIG_MACH_W90P910EVB is not set
12CONFIG_MACH_W90N960EVB=y
13CONFIG_NO_HZ=y
14CONFIG_HIGH_RES_TIMERS=y
15CONFIG_PREEMPT=y
16CONFIG_AEABI=y
17CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
18CONFIG_KEXEC=y
19CONFIG_FPE_NWFPE=y
20CONFIG_BINFMT_AOUT=y
21CONFIG_BINFMT_MISC=y
22CONFIG_MTD=y
23CONFIG_MTD_BLOCK=y
24CONFIG_MTD_CFI=y
25CONFIG_MTD_CFI_AMDSTD=y
26CONFIG_MTD_PHYSMAP=y
27CONFIG_BLK_DEV_RAM=y
28CONFIG_BLK_DEV_RAM_SIZE=16384
29CONFIG_SCSI=y
30# CONFIG_SCSI_PROC_FS is not set
31CONFIG_BLK_DEV_SD=y
32# CONFIG_SCSI_LOWLEVEL is not set
33# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
34# CONFIG_INPUT_KEYBOARD is not set
35# CONFIG_INPUT_MOUSE is not set
36# CONFIG_SERIO is not set
37# CONFIG_DEVKMEM is not set
38CONFIG_SERIAL_8250=y
39CONFIG_SERIAL_8250_CONSOLE=y
40CONFIG_SERIAL_8250_NR_UARTS=1
41# CONFIG_LEGACY_PTYS is not set
42# CONFIG_HW_RANDOM is not set
43# CONFIG_HWMON is not set
44# CONFIG_VGA_CONSOLE is not set
45CONFIG_USB=y
46CONFIG_USB_MON=y
47CONFIG_USB_STORAGE=y
48# CONFIG_DNOTIFY is not set
49CONFIG_TMPFS=y
50CONFIG_TMPFS_POSIX_ACL=y
51CONFIG_ROMFS_FS=y
52CONFIG_PARTITION_ADVANCED=y
53CONFIG_NLS_CODEPAGE_437=y
54CONFIG_NLS_ISO8859_1=y
55# CONFIG_ENABLE_MUST_CHECK is not set
56CONFIG_DEBUG_FS=y
57# CONFIG_CRC32 is not set
diff --git a/arch/arm/include/debug/ks8695.S b/arch/arm/include/debug/ks8695.S
deleted file mode 100644
index eb4d371b5eea..000000000000
--- a/arch/arm/include/debug/ks8695.S
+++ /dev/null
@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/include/debug/ks8695.S
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7 *
8 * KS8695 - Debug macros
9 */
10
11#define KS8695_UART_PA 0x03ffe000
12#define KS8695_UART_VA 0xf00fe000
13#define KS8695_URTH (0x04)
14#define KS8695_URLS (0x14)
15#define URLS_URTE (1 << 6)
16#define URLS_URTHRE (1 << 5)
17
18 .macro addruart, rp, rv, tmp
19 ldr \rp, =KS8695_UART_PA @ physical base address
20 ldr \rv, =KS8695_UART_VA @ virtual base address
21 .endm
22
23 .macro senduart, rd, rx
24 str \rd, [\rx, #KS8695_URTH] @ Write to Transmit Holding Register
25 .endm
26
27 .macro busyuart, rd, rx
281001: ldr \rd, [\rx, #KS8695_URLS] @ Read Line Status Register
29 tst \rd, #URLS_URTE @ Holding & Shift registers empty?
30 beq 1001b
31 .endm
32
33 .macro waituart, rd, rx
341001: ldr \rd, [\rx, #KS8695_URLS] @ Read Line Status Register
35 tst \rd, #URLS_URTHRE @ Holding Register empty?
36 beq 1001b
37 .endm
diff --git a/arch/arm/include/debug/renesas-scif.S b/arch/arm/include/debug/renesas-scif.S
index 1c5f795587fc..25f06663a9a4 100644
--- a/arch/arm/include/debug/renesas-scif.S
+++ b/arch/arm/include/debug/renesas-scif.S
@@ -11,7 +11,11 @@
11#define SCIF_PHYS CONFIG_DEBUG_UART_PHYS 11#define SCIF_PHYS CONFIG_DEBUG_UART_PHYS
12#define SCIF_VIRT ((SCIF_PHYS & 0x00ffffff) | 0xfd000000) 12#define SCIF_VIRT ((SCIF_PHYS & 0x00ffffff) | 0xfd000000)
13 13
14#if CONFIG_DEBUG_UART_PHYS < 0xe6e00000 14#if defined(CONFIG_DEBUG_R7S9210_SCIF2) || defined(CONFIG_DEBUG_R7S9210_SCIF4)
15/* RZ/A2 SCIFA */
16#define FTDR 0x06
17#define FSR 0x08
18#elif CONFIG_DEBUG_UART_PHYS < 0xe6e00000
15/* SCIFA */ 19/* SCIFA */
16#define FTDR 0x20 20#define FTDR 0x20
17#define FSR 0x14 21#define FSR 0x14
diff --git a/arch/arm/include/debug/ux500.S b/arch/arm/include/debug/ux500.S
index c626f89b3e4a..c516900947bb 100644
--- a/arch/arm/include/debug/ux500.S
+++ b/arch/arm/include/debug/ux500.S
@@ -20,21 +20,16 @@
20#define U8500_UART0_PHYS_BASE (0x80120000) 20#define U8500_UART0_PHYS_BASE (0x80120000)
21#define U8500_UART1_PHYS_BASE (0x80121000) 21#define U8500_UART1_PHYS_BASE (0x80121000)
22#define U8500_UART2_PHYS_BASE (0x80007000) 22#define U8500_UART2_PHYS_BASE (0x80007000)
23#define U8500_UART0_VIRT_BASE (0xf8120000)
24#define U8500_UART1_VIRT_BASE (0xf8121000)
25#define U8500_UART2_VIRT_BASE (0xf8007000)
26#define __UX500_PHYS_UART(n) U8500_UART##n##_PHYS_BASE 23#define __UX500_PHYS_UART(n) U8500_UART##n##_PHYS_BASE
27#define __UX500_VIRT_UART(n) U8500_UART##n##_VIRT_BASE
28#endif 24#endif
29 25
30#if !defined(__UX500_PHYS_UART) || !defined(__UX500_VIRT_UART) 26#if !defined(__UX500_PHYS_UART)
31#error Unknown SOC 27#error Unknown SOC
32#endif 28#endif
33 29
34#define UX500_PHYS_UART(n) __UX500_PHYS_UART(n) 30#define UX500_PHYS_UART(n) __UX500_PHYS_UART(n)
35#define UX500_VIRT_UART(n) __UX500_VIRT_UART(n)
36#define UART_PHYS_BASE UX500_PHYS_UART(CONFIG_UX500_DEBUG_UART) 31#define UART_PHYS_BASE UX500_PHYS_UART(CONFIG_UX500_DEBUG_UART)
37#define UART_VIRT_BASE UX500_VIRT_UART(CONFIG_UX500_DEBUG_UART) 32#define UART_VIRT_BASE (0xfff07000)
38 33
39 .macro addruart, rp, rv, tmp 34 .macro addruart, rp, rv, tmp
40 ldr \rp, =UART_PHYS_BASE @ no, physical address 35 ldr \rp, =UART_PHYS_BASE @ no, physical address
diff --git a/arch/arm/mach-aspeed/Kconfig b/arch/arm/mach-aspeed/Kconfig
index a15c3a291386..56007b0b6120 100644
--- a/arch/arm/mach-aspeed/Kconfig
+++ b/arch/arm/mach-aspeed/Kconfig
@@ -1,11 +1,10 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: GPL-2.0-only
2menuconfig ARCH_ASPEED 2menuconfig ARCH_ASPEED
3 bool "Aspeed BMC architectures" 3 bool "Aspeed BMC architectures"
4 depends on ARCH_MULTI_V5 || ARCH_MULTI_V6 4 depends on ARCH_MULTI_V5 || ARCH_MULTI_V6 || ARCH_MULTI_V7
5 select SRAM 5 select SRAM
6 select WATCHDOG 6 select WATCHDOG
7 select ASPEED_WATCHDOG 7 select ASPEED_WATCHDOG
8 select FTTMR010_TIMER
9 select MFD_SYSCON 8 select MFD_SYSCON
10 select PINCTRL 9 select PINCTRL
11 help 10 help
@@ -18,6 +17,7 @@ config MACH_ASPEED_G4
18 depends on ARCH_MULTI_V5 17 depends on ARCH_MULTI_V5
19 select CPU_ARM926T 18 select CPU_ARM926T
20 select PINCTRL_ASPEED_G4 19 select PINCTRL_ASPEED_G4
20 select FTTMR010_TIMER
21 help 21 help
22 Say yes if you intend to run on an Aspeed ast2400 or similar 22 Say yes if you intend to run on an Aspeed ast2400 or similar
23 fourth generation BMCs, such as those used by OpenPower Power8 23 fourth generation BMCs, such as those used by OpenPower Power8
@@ -28,8 +28,21 @@ config MACH_ASPEED_G5
28 depends on ARCH_MULTI_V6 28 depends on ARCH_MULTI_V6
29 select CPU_V6 29 select CPU_V6
30 select PINCTRL_ASPEED_G5 30 select PINCTRL_ASPEED_G5
31 select FTTMR010_TIMER
31 help 32 help
32 Say yes if you intend to run on an Aspeed ast2500 or similar 33 Say yes if you intend to run on an Aspeed ast2500 or similar
33 fifth generation Aspeed BMCs. 34 fifth generation Aspeed BMCs.
34 35
36config MACH_ASPEED_G6
37 bool "Aspeed SoC 6th Generation"
38 depends on ARCH_MULTI_V7
39 select CPU_V7
40 select PINCTRL_ASPEED_G6
41 select ARM_GIC
42 select HAVE_ARM_ARCH_TIMER
43 select HAVE_SMP
44 help
45 Say yes if you intend to run on an Aspeed ast2600 or similar
46 sixth generation Aspeed BMCs.
47
35endif 48endif
diff --git a/arch/arm/mach-aspeed/Makefile b/arch/arm/mach-aspeed/Makefile
new file mode 100644
index 000000000000..1951b3317a76
--- /dev/null
+++ b/arch/arm/mach-aspeed/Makefile
@@ -0,0 +1,5 @@
1# SPDX-License-Identifier: GPL-2.0-or-later
2# Copyright (C) ASPEED Technology Inc.
3# Copyright IBM Corp.
4
5obj-$(CONFIG_SMP) += platsmp.o
diff --git a/arch/arm/mach-aspeed/platsmp.c b/arch/arm/mach-aspeed/platsmp.c
new file mode 100644
index 000000000000..2324becf7991
--- /dev/null
+++ b/arch/arm/mach-aspeed/platsmp.c
@@ -0,0 +1,61 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2// Copyright (C) ASPEED Technology Inc.
3// Copyright IBM Corp.
4
5#include <linux/of_address.h>
6#include <linux/io.h>
7#include <linux/of.h>
8#include <linux/smp.h>
9
10#define BOOT_ADDR 0x00
11#define BOOT_SIG 0x04
12
13static struct device_node *secboot_node;
14
15static int aspeed_g6_boot_secondary(unsigned int cpu, struct task_struct *idle)
16{
17 void __iomem *base;
18
19 base = of_iomap(secboot_node, 0);
20 if (!base) {
21 pr_err("could not map the secondary boot base!");
22 return -ENODEV;
23 }
24
25 writel_relaxed(0, base + BOOT_ADDR);
26 writel_relaxed(__pa_symbol(secondary_startup_arm), base + BOOT_ADDR);
27 writel_relaxed((0xABBAAB00 | (cpu & 0xff)), base + BOOT_SIG);
28
29 dsb_sev();
30
31 iounmap(base);
32
33 return 0;
34}
35
36static void __init aspeed_g6_smp_prepare_cpus(unsigned int max_cpus)
37{
38 void __iomem *base;
39
40 secboot_node = of_find_compatible_node(NULL, NULL, "aspeed,ast2600-smpmem");
41 if (!secboot_node) {
42 pr_err("secboot device node found!!\n");
43 return;
44 }
45
46 base = of_iomap(secboot_node, 0);
47 if (!base) {
48 pr_err("could not map the secondary boot base!");
49 return;
50 }
51 __raw_writel(0xBADABABA, base + BOOT_SIG);
52
53 iounmap(base);
54}
55
56static const struct smp_operations aspeed_smp_ops __initconst = {
57 .smp_prepare_cpus = aspeed_g6_smp_prepare_cpus,
58 .smp_boot_secondary = aspeed_g6_boot_secondary,
59};
60
61CPU_METHOD_OF_DECLARE(aspeed_smp, "aspeed,ast2600-smp", &aspeed_smp_ops);
diff --git a/arch/arm/mach-at91/.gitignore b/arch/arm/mach-at91/.gitignore
new file mode 100644
index 000000000000..2ecd6f51c8a9
--- /dev/null
+++ b/arch/arm/mach-at91/.gitignore
@@ -0,0 +1 @@
pm_data-offsets.h
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 31b61f0e1c07..de64301dcff2 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -19,9 +19,10 @@ ifeq ($(CONFIG_PM_DEBUG),y)
19CFLAGS_pm.o += -DDEBUG 19CFLAGS_pm.o += -DDEBUG
20endif 20endif
21 21
22include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE 22$(obj)/pm_data-offsets.h: $(obj)/pm_data-offsets.s FORCE
23 $(call filechk,offsets,__PM_DATA_OFFSETS_H__) 23 $(call filechk,offsets,__PM_DATA_OFFSETS_H__)
24 24
25arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h 25$(obj)/pm_suspend.o: $(obj)/pm_data-offsets.h
26 26
27targets += pm_data-offsets.s 27targets += pm_data-offsets.s
28clean-files += pm_data-offsets.h
diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
index c751f047b116..ed57c879d4e1 100644
--- a/arch/arm/mach-at91/pm_suspend.S
+++ b/arch/arm/mach-at91/pm_suspend.S
@@ -10,7 +10,7 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <linux/clk/at91_pmc.h> 11#include <linux/clk/at91_pmc.h>
12#include "pm.h" 12#include "pm.h"
13#include "generated/at91_pm_data-offsets.h" 13#include "pm_data-offsets.h"
14 14
15#define SRAMC_SELF_FRESH_ACTIVE 0x01 15#define SRAMC_SELF_FRESH_ACTIVE 0x01
16#define SRAMC_SELF_FRESH_EXIT 0x00 16#define SRAMC_SELF_FRESH_EXIT 0x00
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 5a59cebc7d0a..dd427bd2768c 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -1,11 +1,22 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2
3menuconfig ARCH_DAVINCI
4 bool "TI DaVinci"
5 depends on ARCH_MULTI_V5
6 select DAVINCI_TIMER
7 select ZONE_DMA
8 select ARCH_HAS_HOLES_MEMORYMODEL
9 select PM_GENERIC_DOMAINS if PM
10 select PM_GENERIC_DOMAINS_OF if PM && OF
11 select REGMAP_MMIO
12 select HAVE_IDE
13 select PINCTRL_SINGLE
14
2if ARCH_DAVINCI 15if ARCH_DAVINCI
3 16
4config ARCH_DAVINCI_DMx 17config ARCH_DAVINCI_DMx
5 bool 18 bool
6 19
7menu "TI DaVinci Implementations"
8
9comment "DaVinci Core Type" 20comment "DaVinci Core Type"
10 21
11config ARCH_DAVINCI_DM644x 22config ARCH_DAVINCI_DM644x
@@ -225,6 +236,4 @@ config DAVINCI_MUX_WARNINGS
225 to change the pin multiplexing setup. When there are no warnings 236 to change the pin multiplexing setup. When there are no warnings
226 printed, it's safe to deselect DAVINCI_MUX for your product. 237 printed, it's safe to deselect DAVINCI_MUX for your product.
227 238
228endmenu
229
230endif 239endif
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index f76a8482784f..a03d8443ef08 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -4,6 +4,8 @@
4# 4#
5# 5#
6 6
7ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
8
7# Common objects 9# Common objects
8obj-y := time.o serial.o usb.o \ 10obj-y := time.o serial.o usb.o \
9 common.o sram.o 11 common.o sram.o
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index e6b8ffd934a1..018ab4b549f1 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -21,7 +21,8 @@
21#include <mach/common.h> 21#include <mach/common.h>
22#include <mach/cputype.h> 22#include <mach/cputype.h>
23#include <mach/da8xx.h> 23#include <mach/da8xx.h>
24#include <mach/time.h> 24
25#include <clocksource/timer-davinci.h>
25 26
26#include "irqs.h" 27#include "irqs.h"
27#include "mux.h" 28#include "mux.h"
@@ -676,32 +677,17 @@ int __init da830_register_gpio(void)
676 return da8xx_register_gpio(&da830_gpio_platform_data); 677 return da8xx_register_gpio(&da830_gpio_platform_data);
677} 678}
678 679
679static struct davinci_timer_instance da830_timer_instance[2] = {
680 {
681 .base = DA8XX_TIMER64P0_BASE,
682 .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0),
683 .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_0),
684 .cmp_off = DA830_CMP12_0,
685 .cmp_irq = DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_0),
686 },
687 {
688 .base = DA8XX_TIMER64P1_BASE,
689 .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_1),
690 .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_1),
691 .cmp_off = DA830_CMP12_0,
692 .cmp_irq = DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_1),
693 },
694};
695
696/* 680/*
697 * T0_BOT: Timer 0, bottom : Used for clock_event & clocksource 681 * Bottom half of timer0 is used both for clock even and clocksource.
698 * T0_TOP: Timer 0, top : Used by DSP 682 * Top half is used by DSP.
699 * T1_BOT, T1_TOP: Timer 1, bottom & top: Used for watchdog timer
700 */ 683 */
701static struct davinci_timer_info da830_timer_info = { 684static const struct davinci_timer_cfg da830_timer_cfg = {
702 .timers = da830_timer_instance, 685 .reg = DEFINE_RES_IO(DA8XX_TIMER64P0_BASE, SZ_4K),
703 .clockevent_id = T0_BOT, 686 .irq = {
704 .clocksource_id = T0_BOT, 687 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_0)),
688 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0)),
689 },
690 .cmp_off = DA830_CMP12_0,
705}; 691};
706 692
707static const struct davinci_soc_info davinci_soc_info_da830 = { 693static const struct davinci_soc_info davinci_soc_info_da830 = {
@@ -713,7 +699,6 @@ static const struct davinci_soc_info davinci_soc_info_da830 = {
713 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120, 699 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120,
714 .pinmux_pins = da830_pins, 700 .pinmux_pins = da830_pins,
715 .pinmux_pins_num = ARRAY_SIZE(da830_pins), 701 .pinmux_pins_num = ARRAY_SIZE(da830_pins),
716 .timer_info = &da830_timer_info,
717 .emac_pdata = &da8xx_emac_pdata, 702 .emac_pdata = &da8xx_emac_pdata,
718}; 703};
719 704
@@ -743,6 +728,7 @@ void __init da830_init_time(void)
743{ 728{
744 void __iomem *pll; 729 void __iomem *pll;
745 struct clk *clk; 730 struct clk *clk;
731 int rv;
746 732
747 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA830_REF_FREQ); 733 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA830_REF_FREQ);
748 734
@@ -751,8 +737,13 @@ void __init da830_init_time(void)
751 da830_pll_init(NULL, pll, NULL); 737 da830_pll_init(NULL, pll, NULL);
752 738
753 clk = clk_get(NULL, "timer0"); 739 clk = clk_get(NULL, "timer0");
740 if (WARN_ON(IS_ERR(clk))) {
741 pr_err("Unable to get the timer clock\n");
742 return;
743 }
754 744
755 davinci_timer_init(clk); 745 rv = davinci_timer_register(clk, &da830_timer_cfg);
746 WARN(rv, "Unable to register the timer: %d\n", rv);
756} 747}
757 748
758static struct resource da830_psc0_resources[] = { 749static struct resource da830_psc0_resources[] = {
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 77bc64d6e39b..73b7cc53f966 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -35,7 +35,8 @@
35#include <mach/cputype.h> 35#include <mach/cputype.h>
36#include <mach/da8xx.h> 36#include <mach/da8xx.h>
37#include <mach/pm.h> 37#include <mach/pm.h>
38#include <mach/time.h> 38
39#include <clocksource/timer-davinci.h>
39 40
40#include "irqs.h" 41#include "irqs.h"
41#include "mux.h" 42#include "mux.h"
@@ -333,38 +334,16 @@ static struct davinci_id da850_ids[] = {
333 }, 334 },
334}; 335};
335 336
336static struct davinci_timer_instance da850_timer_instance[4] = {
337 {
338 .base = DA8XX_TIMER64P0_BASE,
339 .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0),
340 .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_0),
341 },
342 {
343 .base = DA8XX_TIMER64P1_BASE,
344 .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_1),
345 .top_irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_1),
346 },
347 {
348 .base = DA850_TIMER64P2_BASE,
349 .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT12_2),
350 .top_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT34_2),
351 },
352 {
353 .base = DA850_TIMER64P3_BASE,
354 .bottom_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT12_3),
355 .top_irq = DAVINCI_INTC_IRQ(IRQ_DA850_TINT34_3),
356 },
357};
358
359/* 337/*
360 * T0_BOT: Timer 0, bottom : Used for clock_event 338 * Bottom half of timer 0 is used for clock_event, top half for
361 * T0_TOP: Timer 0, top : Used for clocksource 339 * clocksource.
362 * T1_BOT, T1_TOP: Timer 1, bottom & top: Used for watchdog timer
363 */ 340 */
364static struct davinci_timer_info da850_timer_info = { 341static const struct davinci_timer_cfg da850_timer_cfg = {
365 .timers = da850_timer_instance, 342 .reg = DEFINE_RES_IO(DA8XX_TIMER64P0_BASE, SZ_4K),
366 .clockevent_id = T0_BOT, 343 .irq = {
367 .clocksource_id = T0_TOP, 344 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0)),
345 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_0)),
346 },
368}; 347};
369 348
370#ifdef CONFIG_CPU_FREQ 349#ifdef CONFIG_CPU_FREQ
@@ -635,7 +614,6 @@ static const struct davinci_soc_info davinci_soc_info_da850 = {
635 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120, 614 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120,
636 .pinmux_pins = da850_pins, 615 .pinmux_pins = da850_pins,
637 .pinmux_pins_num = ARRAY_SIZE(da850_pins), 616 .pinmux_pins_num = ARRAY_SIZE(da850_pins),
638 .timer_info = &da850_timer_info,
639 .emac_pdata = &da8xx_emac_pdata, 617 .emac_pdata = &da8xx_emac_pdata,
640 .sram_dma = DA8XX_SHARED_RAM_BASE, 618 .sram_dma = DA8XX_SHARED_RAM_BASE,
641 .sram_len = SZ_128K, 619 .sram_len = SZ_128K,
@@ -672,6 +650,7 @@ void __init da850_init_time(void)
672 void __iomem *pll0; 650 void __iomem *pll0;
673 struct regmap *cfgchip; 651 struct regmap *cfgchip;
674 struct clk *clk; 652 struct clk *clk;
653 int rv;
675 654
676 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA850_REF_FREQ); 655 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA850_REF_FREQ);
677 656
@@ -681,8 +660,13 @@ void __init da850_init_time(void)
681 da850_pll0_init(NULL, pll0, cfgchip); 660 da850_pll0_init(NULL, pll0, cfgchip);
682 661
683 clk = clk_get(NULL, "timer0"); 662 clk = clk_get(NULL, "timer0");
663 if (WARN_ON(IS_ERR(clk))) {
664 pr_err("Unable to get the timer clock\n");
665 return;
666 }
684 667
685 davinci_timer_init(clk); 668 rv = davinci_timer_register(clk, &da850_timer_cfg);
669 WARN(rv, "Unable to register the timer: %d\n", rv);
686} 670}
687 671
688static struct resource da850_pll1_resources[] = { 672static struct resource da850_pll1_resources[] = {
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 56c1835c42e5..208d7a4d3597 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -60,6 +60,9 @@ void davinci_map_sysmod(void);
60#define DAVINCI_GPIO_BASE 0x01C67000 60#define DAVINCI_GPIO_BASE 0x01C67000
61int davinci_gpio_register(struct resource *res, int size, void *pdata); 61int davinci_gpio_register(struct resource *res, int size, void *pdata);
62 62
63#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
64#define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00)
65
63/* DM355 base addresses */ 66/* DM355 base addresses */
64#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000 67#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000
65#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 68#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index c6073326be2e..5de72d2fa8f0 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -30,7 +30,8 @@
30#include <mach/cputype.h> 30#include <mach/cputype.h>
31#include <mach/mux.h> 31#include <mach/mux.h>
32#include <mach/serial.h> 32#include <mach/serial.h>
33#include <mach/time.h> 33
34#include <clocksource/timer-davinci.h>
34 35
35#include "asp.h" 36#include "asp.h"
36#include "davinci.h" 37#include "davinci.h"
@@ -620,15 +621,15 @@ static struct davinci_id dm355_ids[] = {
620}; 621};
621 622
622/* 623/*
623 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers 624 * Bottom half of timer0 is used for clockevent, top half is used for
624 * T0_TOP: Timer 0, top : clocksource for generic timekeeping 625 * clocksource.
625 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
626 * T1_TOP: Timer 1, top : <unused>
627 */ 626 */
628static struct davinci_timer_info dm355_timer_info = { 627static const struct davinci_timer_cfg dm355_timer_cfg = {
629 .timers = davinci_timer_instance, 628 .reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_4K),
630 .clockevent_id = T0_BOT, 629 .irq = {
631 .clocksource_id = T0_TOP, 630 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
631 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
632 },
632}; 633};
633 634
634static struct plat_serial8250_port dm355_serial0_platform_data[] = { 635static struct plat_serial8250_port dm355_serial0_platform_data[] = {
@@ -706,7 +707,6 @@ static const struct davinci_soc_info davinci_soc_info_dm355 = {
706 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, 707 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
707 .pinmux_pins = dm355_pins, 708 .pinmux_pins = dm355_pins,
708 .pinmux_pins_num = ARRAY_SIZE(dm355_pins), 709 .pinmux_pins_num = ARRAY_SIZE(dm355_pins),
709 .timer_info = &dm355_timer_info,
710 .sram_dma = 0x00010000, 710 .sram_dma = 0x00010000,
711 .sram_len = SZ_32K, 711 .sram_len = SZ_32K,
712}; 712};
@@ -733,6 +733,7 @@ void __init dm355_init_time(void)
733{ 733{
734 void __iomem *pll1, *psc; 734 void __iomem *pll1, *psc;
735 struct clk *clk; 735 struct clk *clk;
736 int rv;
736 737
737 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM355_REF_FREQ); 738 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM355_REF_FREQ);
738 739
@@ -743,8 +744,13 @@ void __init dm355_init_time(void)
743 dm355_psc_init(NULL, psc); 744 dm355_psc_init(NULL, psc);
744 745
745 clk = clk_get(NULL, "timer0"); 746 clk = clk_get(NULL, "timer0");
747 if (WARN_ON(IS_ERR(clk))) {
748 pr_err("Unable to get the timer clock\n");
749 return;
750 }
746 751
747 davinci_timer_init(clk); 752 rv = davinci_timer_register(clk, &dm355_timer_cfg);
753 WARN(rv, "Unable to register the timer: %d\n", rv);
748} 754}
749 755
750static struct resource dm355_pll2_resources[] = { 756static struct resource dm355_pll2_resources[] = {
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 2f9ae6431bf5..8062412be70f 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -784,6 +784,10 @@ void __init dm365_init_time(void)
784 dm365_psc_init(NULL, psc); 784 dm365_psc_init(NULL, psc);
785 785
786 clk = clk_get(NULL, "timer0"); 786 clk = clk_get(NULL, "timer0");
787 if (WARN_ON(IS_ERR(clk))) {
788 pr_err("Unable to get the timer clock\n");
789 return;
790 }
787 791
788 davinci_timer_init(clk); 792 davinci_timer_init(clk);
789} 793}
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 1b9e9a6192ef..24988939ae46 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -27,7 +27,8 @@
27#include <mach/cputype.h> 27#include <mach/cputype.h>
28#include <mach/mux.h> 28#include <mach/mux.h>
29#include <mach/serial.h> 29#include <mach/serial.h>
30#include <mach/time.h> 30
31#include <clocksource/timer-davinci.h>
31 32
32#include "asp.h" 33#include "asp.h"
33#include "davinci.h" 34#include "davinci.h"
@@ -561,15 +562,15 @@ static struct davinci_id dm644x_ids[] = {
561}; 562};
562 563
563/* 564/*
564 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers 565 * Bottom half of timer0 is used for clockevent, top half is used for
565 * T0_TOP: Timer 0, top : clocksource for generic timekeeping 566 * clocksource.
566 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
567 * T1_TOP: Timer 1, top : <unused>
568 */ 567 */
569static struct davinci_timer_info dm644x_timer_info = { 568static const struct davinci_timer_cfg dm644x_timer_cfg = {
570 .timers = davinci_timer_instance, 569 .reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_4K),
571 .clockevent_id = T0_BOT, 570 .irq = {
572 .clocksource_id = T0_TOP, 571 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
572 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
573 },
573}; 574};
574 575
575static struct plat_serial8250_port dm644x_serial0_platform_data[] = { 576static struct plat_serial8250_port dm644x_serial0_platform_data[] = {
@@ -647,7 +648,6 @@ static const struct davinci_soc_info davinci_soc_info_dm644x = {
647 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, 648 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
648 .pinmux_pins = dm644x_pins, 649 .pinmux_pins = dm644x_pins,
649 .pinmux_pins_num = ARRAY_SIZE(dm644x_pins), 650 .pinmux_pins_num = ARRAY_SIZE(dm644x_pins),
650 .timer_info = &dm644x_timer_info,
651 .emac_pdata = &dm644x_emac_pdata, 651 .emac_pdata = &dm644x_emac_pdata,
652 .sram_dma = 0x00008000, 652 .sram_dma = 0x00008000,
653 .sram_len = SZ_16K, 653 .sram_len = SZ_16K,
@@ -669,6 +669,7 @@ void __init dm644x_init_time(void)
669{ 669{
670 void __iomem *pll1, *psc; 670 void __iomem *pll1, *psc;
671 struct clk *clk; 671 struct clk *clk;
672 int rv;
672 673
673 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM644X_REF_FREQ); 674 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM644X_REF_FREQ);
674 675
@@ -679,8 +680,13 @@ void __init dm644x_init_time(void)
679 dm644x_psc_init(NULL, psc); 680 dm644x_psc_init(NULL, psc);
680 681
681 clk = clk_get(NULL, "timer0"); 682 clk = clk_get(NULL, "timer0");
683 if (WARN_ON(IS_ERR(clk))) {
684 pr_err("Unable to get the timer clock\n");
685 return;
686 }
682 687
683 davinci_timer_init(clk); 688 rv = davinci_timer_register(clk, &dm644x_timer_cfg);
689 WARN(rv, "Unable to register the timer: %d\n", rv);
684} 690}
685 691
686static struct resource dm644x_pll2_resources[] = { 692static struct resource dm644x_pll2_resources[] = {
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 62ca952fe161..4ffd028ed997 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * TI DaVinci DM644x chip specific setup 2 * TI DaVinci DM646x chip specific setup
3 * 3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC 4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 * 5 *
@@ -28,7 +28,8 @@
28#include <mach/cputype.h> 28#include <mach/cputype.h>
29#include <mach/mux.h> 29#include <mach/mux.h>
30#include <mach/serial.h> 30#include <mach/serial.h>
31#include <mach/time.h> 31
32#include <clocksource/timer-davinci.h>
32 33
33#include "asp.h" 34#include "asp.h"
34#include "davinci.h" 35#include "davinci.h"
@@ -501,15 +502,15 @@ static struct davinci_id dm646x_ids[] = {
501}; 502};
502 503
503/* 504/*
504 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers 505 * Bottom half of timer0 is used for clockevent, top half is used for
505 * T0_TOP: Timer 0, top : clocksource for generic timekeeping 506 * clocksource.
506 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
507 * T1_TOP: Timer 1, top : <unused>
508 */ 507 */
509static struct davinci_timer_info dm646x_timer_info = { 508static const struct davinci_timer_cfg dm646x_timer_cfg = {
510 .timers = davinci_timer_instance, 509 .reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_4K),
511 .clockevent_id = T0_BOT, 510 .irq = {
512 .clocksource_id = T0_TOP, 511 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
512 DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
513 },
513}; 514};
514 515
515static struct plat_serial8250_port dm646x_serial0_platform_data[] = { 516static struct plat_serial8250_port dm646x_serial0_platform_data[] = {
@@ -587,7 +588,6 @@ static const struct davinci_soc_info davinci_soc_info_dm646x = {
587 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, 588 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
588 .pinmux_pins = dm646x_pins, 589 .pinmux_pins = dm646x_pins,
589 .pinmux_pins_num = ARRAY_SIZE(dm646x_pins), 590 .pinmux_pins_num = ARRAY_SIZE(dm646x_pins),
590 .timer_info = &dm646x_timer_info,
591 .emac_pdata = &dm646x_emac_pdata, 591 .emac_pdata = &dm646x_emac_pdata,
592 .sram_dma = 0x10010000, 592 .sram_dma = 0x10010000,
593 .sram_len = SZ_32K, 593 .sram_len = SZ_32K,
@@ -652,6 +652,7 @@ void __init dm646x_init_time(unsigned long ref_clk_rate,
652{ 652{
653 void __iomem *pll1, *psc; 653 void __iomem *pll1, *psc;
654 struct clk *clk; 654 struct clk *clk;
655 int rv;
655 656
656 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, ref_clk_rate); 657 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, ref_clk_rate);
657 clk_register_fixed_rate(NULL, "aux_clkin", NULL, 0, aux_clkin_rate); 658 clk_register_fixed_rate(NULL, "aux_clkin", NULL, 0, aux_clkin_rate);
@@ -663,8 +664,13 @@ void __init dm646x_init_time(unsigned long ref_clk_rate,
663 dm646x_psc_init(NULL, psc); 664 dm646x_psc_init(NULL, psc);
664 665
665 clk = clk_get(NULL, "timer0"); 666 clk = clk_get(NULL, "timer0");
667 if (WARN_ON(IS_ERR(clk))) {
668 pr_err("Unable to get the timer clock\n");
669 return;
670 }
666 671
667 davinci_timer_init(clk); 672 rv = davinci_timer_register(clk, &dm646x_timer_cfg);
673 WARN(rv, "Unable to register the timer: %d\n", rv);
668} 674}
669 675
670static struct resource dm646x_pll2_resources[] = { 676static struct resource dm646x_pll2_resources[] = {
diff --git a/arch/arm/mach-davinci/include/mach/time.h b/arch/arm/mach-davinci/include/mach/time.h
index 1c971d8d8ba8..ba913736990f 100644
--- a/arch/arm/mach-davinci/include/mach/time.h
+++ b/arch/arm/mach-davinci/include/mach/time.h
@@ -11,9 +11,7 @@
11#ifndef __ARCH_ARM_MACH_DAVINCI_TIME_H 11#ifndef __ARCH_ARM_MACH_DAVINCI_TIME_H
12#define __ARCH_ARM_MACH_DAVINCI_TIME_H 12#define __ARCH_ARM_MACH_DAVINCI_TIME_H
13 13
14#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
15#define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800) 14#define DAVINCI_TIMER1_BASE (IO_PHYS + 0x21800)
16#define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00)
17 15
18enum { 16enum {
19 T0_BOT, 17 T0_BOT,
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 5a6de5368ab0..740410a3bb6a 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -398,17 +398,3 @@ void __init davinci_timer_init(struct clk *timer_clk)
398 for (i=0; i< ARRAY_SIZE(timers); i++) 398 for (i=0; i< ARRAY_SIZE(timers); i++)
399 timer32_config(&timers[i]); 399 timer32_config(&timers[i]);
400} 400}
401
402static int __init of_davinci_timer_init(struct device_node *np)
403{
404 struct clk *clk;
405
406 clk = of_clk_get(np, 0);
407 if (IS_ERR(clk))
408 return PTR_ERR(clk);
409
410 davinci_timer_init(clk);
411
412 return 0;
413}
414TIMER_OF_DECLARE(davinci_timer, "ti,da830-timer", of_davinci_timer_init);
diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/bridge-regs.h
index f4a5b34489b7..ace0b0bfbf11 100644
--- a/arch/arm/mach-dove/include/mach/bridge-regs.h
+++ b/arch/arm/mach-dove/bridge-regs.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-dove/include/mach/bridge-regs.h
3 *
4 * Mbus-L to Mbus Bridge Registers 2 * Mbus-L to Mbus Bridge Registers
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
@@ -11,7 +9,7 @@
11#ifndef __ASM_ARCH_BRIDGE_REGS_H 9#ifndef __ASM_ARCH_BRIDGE_REGS_H
12#define __ASM_ARCH_BRIDGE_REGS_H 10#define __ASM_ARCH_BRIDGE_REGS_H
13 11
14#include <mach/dove.h> 12#include "dove.h"
15 13
16#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0000) 14#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0000)
17 15
diff --git a/arch/arm/mach-dove/cm-a510.c b/arch/arm/mach-dove/cm-a510.c
index b9a7c33db29a..9f25c993d863 100644
--- a/arch/arm/mach-dove/cm-a510.c
+++ b/arch/arm/mach-dove/cm-a510.c
@@ -22,8 +22,7 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24 24
25#include <mach/dove.h> 25#include "dove.h"
26
27#include "common.h" 26#include "common.h"
28 27
29static struct mv643xx_eth_platform_data cm_a510_ge00_data = { 28static struct mv643xx_eth_platform_data cm_a510_ge00_data = {
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index d7b826d2695c..01b830afcea9 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -22,11 +22,11 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24#include <asm/mach/time.h> 24#include <asm/mach/time.h>
25#include <mach/bridge-regs.h>
26#include <mach/pm.h>
27#include <plat/common.h> 25#include <plat/common.h>
28#include <plat/irq.h> 26#include <plat/irq.h>
29#include <plat/time.h> 27#include <plat/time.h>
28#include "bridge-regs.h"
29#include "pm.h"
30#include "common.h" 30#include "common.h"
31 31
32/* These can go away once Dove uses the mvebu-mbus DT binding */ 32/* These can go away once Dove uses the mvebu-mbus DT binding */
diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c
index 8971c3c0f0fe..418ab21b9d9b 100644
--- a/arch/arm/mach-dove/dove-db-setup.c
+++ b/arch/arm/mach-dove/dove-db-setup.c
@@ -24,7 +24,7 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include <mach/dove.h> 27#include "dove.h"
28#include "common.h" 28#include "common.h"
29 29
30static struct mv643xx_eth_platform_data dove_db_ge00_data = { 30static struct mv643xx_eth_platform_data dove_db_ge00_data = {
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/dove.h
index 00f45458b3ec..320ed1696abd 100644
--- a/arch/arm/mach-dove/include/mach/dove.h
+++ b/arch/arm/mach-dove/dove.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-dove/include/mach/dove.h
3 *
4 * Generic definitions for Marvell Dove 88AP510 SoC 2 * Generic definitions for Marvell Dove 88AP510 SoC
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
@@ -11,7 +9,7 @@
11#ifndef __ASM_ARCH_DOVE_H 9#ifndef __ASM_ARCH_DOVE_H
12#define __ASM_ARCH_DOVE_H 10#define __ASM_ARCH_DOVE_H
13 11
14#include <mach/irqs.h> 12#include "irqs.h"
15 13
16/* 14/*
17 * Marvell Dove address maps. 15 * Marvell Dove address maps.
@@ -20,8 +18,8 @@
20 * c8000000 fdb00000 1M Cryptographic SRAM 18 * c8000000 fdb00000 1M Cryptographic SRAM
21 * e0000000 @runtime 128M PCIe-0 Memory space 19 * e0000000 @runtime 128M PCIe-0 Memory space
22 * e8000000 @runtime 128M PCIe-1 Memory space 20 * e8000000 @runtime 128M PCIe-1 Memory space
23 * f1000000 fde00000 8M on-chip south-bridge registers 21 * f1000000 fec00000 1M on-chip south-bridge registers
24 * f1800000 fe600000 8M on-chip north-bridge registers 22 * f1800000 fe400000 8M on-chip north-bridge registers
25 * f2000000 fee00000 1M PCIe-0 I/O space 23 * f2000000 fee00000 1M PCIe-0 I/O space
26 * f2100000 fef00000 1M PCIe-1 I/O space 24 * f2100000 fef00000 1M PCIe-1 I/O space
27 */ 25 */
@@ -44,11 +42,11 @@
44#define DOVE_SCRATCHPAD_SIZE SZ_1M 42#define DOVE_SCRATCHPAD_SIZE SZ_1M
45 43
46#define DOVE_SB_REGS_PHYS_BASE 0xf1000000 44#define DOVE_SB_REGS_PHYS_BASE 0xf1000000
47#define DOVE_SB_REGS_VIRT_BASE IOMEM(0xfde00000) 45#define DOVE_SB_REGS_VIRT_BASE IOMEM(0xfec00000)
48#define DOVE_SB_REGS_SIZE SZ_8M 46#define DOVE_SB_REGS_SIZE SZ_1M
49 47
50#define DOVE_NB_REGS_PHYS_BASE 0xf1800000 48#define DOVE_NB_REGS_PHYS_BASE 0xf1800000
51#define DOVE_NB_REGS_VIRT_BASE IOMEM(0xfe600000) 49#define DOVE_NB_REGS_VIRT_BASE IOMEM(0xfe400000)
52#define DOVE_NB_REGS_SIZE SZ_8M 50#define DOVE_NB_REGS_SIZE SZ_8M
53 51
54#define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000 52#define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000
diff --git a/arch/arm/mach-dove/include/mach/hardware.h b/arch/arm/mach-dove/include/mach/hardware.h
deleted file mode 100644
index f1368b9a8ece..000000000000
--- a/arch/arm/mach-dove/include/mach/hardware.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-dove/include/mach/hardware.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_HARDWARE_H
10#define __ASM_ARCH_HARDWARE_H
11
12#include "dove.h"
13
14/* Macros below are required for compatibility with PXA AC'97 driver. */
15#define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \
16 DOVE_SB_REGS_VIRT_BASE)))
17#define __PREG(x) (((u32)&(x)) - DOVE_SB_REGS_VIRT_BASE + \
18 DOVE_SB_REGS_PHYS_BASE)
19#endif
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
index 5c8ae9b9d39a..7a4bd8838036 100644
--- a/arch/arm/mach-dove/include/mach/uncompress.h
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -1,15 +1,13 @@
1/* 1/*
2 * arch/arm/mach-dove/include/mach/uncompress.h
3 *
4 * This file is licensed under the terms of the GNU General Public 2 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 3 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 4 * warranty of any kind, whether express or implied.
7 */ 5 */
8 6
9#include <mach/dove.h> 7#define UART0_PHYS_BASE (0xf1000000 + 0x12000)
10 8
11#define UART_THR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x0)) 9#define UART_THR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0))
12#define UART_LSR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x14)) 10#define UART_LSR ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14))
13 11
14#define LSR_THRE 0x20 12#define LSR_THRE 0x20
15 13
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
index d6627c1f7f30..31ccbcee2627 100644
--- a/arch/arm/mach-dove/irq.c
+++ b/arch/arm/mach-dove/irq.c
@@ -11,9 +11,12 @@
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <asm/exception.h> 13#include <asm/exception.h>
14
14#include <plat/irq.h> 15#include <plat/irq.h>
15#include <mach/bridge-regs.h>
16#include <plat/orion-gpio.h> 16#include <plat/orion-gpio.h>
17
18#include "pm.h"
19#include "bridge-regs.h"
17#include "common.h" 20#include "common.h"
18 21
19static int __initdata gpio0_irqs[4] = { 22static int __initdata gpio0_irqs[4] = {
diff --git a/arch/arm/mach-dove/include/mach/irqs.h b/arch/arm/mach-dove/irqs.h
index 8ff0fa8b4fcd..a0742179faff 100644
--- a/arch/arm/mach-dove/include/mach/irqs.h
+++ b/arch/arm/mach-dove/irqs.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-dove/include/mach/irqs.h
3 *
4 * IRQ definitions for Marvell Dove 88AP510 SoC 2 * IRQ definitions for Marvell Dove 88AP510 SoC
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
diff --git a/arch/arm/mach-dove/mpp.c b/arch/arm/mach-dove/mpp.c
index 8a433a51289c..6acd8488bb05 100644
--- a/arch/arm/mach-dove/mpp.c
+++ b/arch/arm/mach-dove/mpp.c
@@ -12,8 +12,8 @@
12#include <linux/gpio.h> 12#include <linux/gpio.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <plat/mpp.h> 14#include <plat/mpp.h>
15#include <mach/dove.h>
16#include <plat/orion-gpio.h> 15#include <plat/orion-gpio.h>
16#include "dove.h"
17#include "mpp.h" 17#include "mpp.h"
18 18
19struct dove_mpp_grp { 19struct dove_mpp_grp {
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c
index dfb62f3f5dcf..ee91ac6b5ebf 100644
--- a/arch/arm/mach-dove/pcie.c
+++ b/arch/arm/mach-dove/pcie.c
@@ -17,9 +17,9 @@
17#include <asm/setup.h> 17#include <asm/setup.h>
18#include <asm/delay.h> 18#include <asm/delay.h>
19#include <plat/pcie.h> 19#include <plat/pcie.h>
20#include <mach/irqs.h>
21#include <mach/bridge-regs.h>
22#include <plat/addr-map.h> 20#include <plat/addr-map.h>
21#include "irqs.h"
22#include "bridge-regs.h"
23#include "common.h" 23#include "common.h"
24 24
25struct pcie_port { 25struct pcie_port {
diff --git a/arch/arm/mach-dove/include/mach/pm.h b/arch/arm/mach-dove/pm.h
index d22b9b174007..01267746d707 100644
--- a/arch/arm/mach-dove/include/mach/pm.h
+++ b/arch/arm/mach-dove/pm.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-dove/include/mach/pm.h
3 *
4 * This file is licensed under the terms of the GNU General Public 2 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 3 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 4 * warranty of any kind, whether express or implied.
@@ -10,7 +8,7 @@
10#define __ASM_ARCH_PM_H 8#define __ASM_ARCH_PM_H
11 9
12#include <asm/errno.h> 10#include <asm/errno.h>
13#include <mach/irqs.h> 11#include "irqs.h"
14 12
15#define CLOCK_GATING_CONTROL (DOVE_PMU_VIRT_BASE + 0x38) 13#define CLOCK_GATING_CONTROL (DOVE_PMU_VIRT_BASE + 0x38)
16#define CLOCK_GATING_BIT_USB0 0 14#define CLOCK_GATING_BIT_USB0 0
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index d7422233a130..f83786640f94 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -13,6 +13,7 @@ menuconfig ARCH_EXYNOS
13 select ARM_AMBA 13 select ARM_AMBA
14 select ARM_GIC 14 select ARM_GIC
15 select COMMON_CLK_SAMSUNG 15 select COMMON_CLK_SAMSUNG
16 select EXYNOS_CHIPID
16 select EXYNOS_THERMAL 17 select EXYNOS_THERMAL
17 select EXYNOS_PMU 18 select EXYNOS_PMU
18 select EXYNOS_SROM 19 select EXYNOS_SROM
diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
index 95713450591a..ebb27592a9f7 100644
--- a/arch/arm/mach-imx/mach-imx7d.c
+++ b/arch/arm/mach-imx/mach-imx7d.c
@@ -30,12 +30,6 @@ static int ar8031_phy_fixup(struct phy_device *dev)
30 val &= ~(0x1 << 8); 30 val &= ~(0x1 << 8);
31 phy_write(dev, 0xe, val); 31 phy_write(dev, 0xe, val);
32 32
33 /* introduce tx clock delay */
34 phy_write(dev, 0x1d, 0x5);
35 val = phy_read(dev, 0x1e);
36 val |= 0x0100;
37 phy_write(dev, 0x1e, val);
38
39 return 0; 33 return 0;
40} 34}
41 35
diff --git a/arch/arm/mach-iop13xx/Kconfig b/arch/arm/mach-iop13xx/Kconfig
deleted file mode 100644
index c4f04070b4c1..000000000000
--- a/arch/arm/mach-iop13xx/Kconfig
+++ /dev/null
@@ -1,21 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2if ARCH_IOP13XX
3
4menu "IOP13XX Implementation Options"
5
6comment "IOP13XX Platform Support"
7
8config MACH_IQ81340SC
9 bool "Enable IQ81340SC Hardware Support"
10 help
11 Say Y here if you want to support running on the Intel IQ81340SC
12 evaluation kit.
13
14config MACH_IQ81340MC
15 bool "Enable IQ81340MC Hardware Support"
16 help
17 Say Y here if you want to support running on the Intel IQ81340MC
18 evaluation kit.
19
20endmenu
21endif
diff --git a/arch/arm/mach-iop13xx/Makefile b/arch/arm/mach-iop13xx/Makefile
deleted file mode 100644
index 5757c8f6e371..000000000000
--- a/arch/arm/mach-iop13xx/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2obj-$(CONFIG_ARCH_IOP13XX) += setup.o
3obj-$(CONFIG_ARCH_IOP13XX) += irq.o
4obj-$(CONFIG_ARCH_IOP13XX) += pci.o
5obj-$(CONFIG_ARCH_IOP13XX) += io.o
6obj-$(CONFIG_ARCH_IOP13XX) += tpmi.o
7obj-$(CONFIG_MACH_IQ81340SC) += iq81340sc.o
8obj-$(CONFIG_MACH_IQ81340MC) += iq81340mc.o
9obj-$(CONFIG_PCI_MSI) += msi.o
diff --git a/arch/arm/mach-iop13xx/Makefile.boot b/arch/arm/mach-iop13xx/Makefile.boot
deleted file mode 100644
index 4f29554c8401..000000000000
--- a/arch/arm/mach-iop13xx/Makefile.boot
+++ /dev/null
@@ -1,4 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2 zreladdr-y += 0x00008000
3params_phys-y := 0x00000100
4initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-iop13xx/include/mach/adma.h b/arch/arm/mach-iop13xx/include/mach/adma.h
deleted file mode 100644
index 51d206f5b093..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/adma.h
+++ /dev/null
@@ -1,608 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright(c) 2006, Intel Corporation.
4 */
5#ifndef _ADMA_H
6#define _ADMA_H
7#include <linux/types.h>
8#include <linux/io.h>
9#include <mach/hardware.h>
10#include <asm/hardware/iop_adma.h>
11
12#define ADMA_ACCR(chan) (chan->mmr_base + 0x0)
13#define ADMA_ACSR(chan) (chan->mmr_base + 0x4)
14#define ADMA_ADAR(chan) (chan->mmr_base + 0x8)
15#define ADMA_IIPCR(chan) (chan->mmr_base + 0x18)
16#define ADMA_IIPAR(chan) (chan->mmr_base + 0x1c)
17#define ADMA_IIPUAR(chan) (chan->mmr_base + 0x20)
18#define ADMA_ANDAR(chan) (chan->mmr_base + 0x24)
19#define ADMA_ADCR(chan) (chan->mmr_base + 0x28)
20#define ADMA_CARMD(chan) (chan->mmr_base + 0x2c)
21#define ADMA_ABCR(chan) (chan->mmr_base + 0x30)
22#define ADMA_DLADR(chan) (chan->mmr_base + 0x34)
23#define ADMA_DUADR(chan) (chan->mmr_base + 0x38)
24#define ADMA_SLAR(src, chan) (chan->mmr_base + (0x3c + (src << 3)))
25#define ADMA_SUAR(src, chan) (chan->mmr_base + (0x40 + (src << 3)))
26
27struct iop13xx_adma_src {
28 u32 src_addr;
29 union {
30 u32 upper_src_addr;
31 struct {
32 unsigned int pq_upper_src_addr:24;
33 unsigned int pq_dmlt:8;
34 };
35 };
36};
37
38struct iop13xx_adma_desc_ctrl {
39 unsigned int int_en:1;
40 unsigned int xfer_dir:2;
41 unsigned int src_select:4;
42 unsigned int zero_result:1;
43 unsigned int block_fill_en:1;
44 unsigned int crc_gen_en:1;
45 unsigned int crc_xfer_dis:1;
46 unsigned int crc_seed_fetch_dis:1;
47 unsigned int status_write_back_en:1;
48 unsigned int endian_swap_en:1;
49 unsigned int reserved0:2;
50 unsigned int pq_update_xfer_en:1;
51 unsigned int dual_xor_en:1;
52 unsigned int pq_xfer_en:1;
53 unsigned int p_xfer_dis:1;
54 unsigned int reserved1:10;
55 unsigned int relax_order_en:1;
56 unsigned int no_snoop_en:1;
57};
58
59struct iop13xx_adma_byte_count {
60 unsigned int byte_count:24;
61 unsigned int host_if:3;
62 unsigned int reserved:2;
63 unsigned int zero_result_err_q:1;
64 unsigned int zero_result_err:1;
65 unsigned int tx_complete:1;
66};
67
68struct iop13xx_adma_desc_hw {
69 u32 next_desc;
70 union {
71 u32 desc_ctrl;
72 struct iop13xx_adma_desc_ctrl desc_ctrl_field;
73 };
74 union {
75 u32 crc_addr;
76 u32 block_fill_data;
77 u32 q_dest_addr;
78 };
79 union {
80 u32 byte_count;
81 struct iop13xx_adma_byte_count byte_count_field;
82 };
83 union {
84 u32 dest_addr;
85 u32 p_dest_addr;
86 };
87 union {
88 u32 upper_dest_addr;
89 u32 pq_upper_dest_addr;
90 };
91 struct iop13xx_adma_src src[1];
92};
93
94struct iop13xx_adma_desc_dual_xor {
95 u32 next_desc;
96 u32 desc_ctrl;
97 u32 reserved;
98 u32 byte_count;
99 u32 h_dest_addr;
100 u32 h_upper_dest_addr;
101 u32 src0_addr;
102 u32 upper_src0_addr;
103 u32 src1_addr;
104 u32 upper_src1_addr;
105 u32 h_src_addr;
106 u32 h_upper_src_addr;
107 u32 d_src_addr;
108 u32 d_upper_src_addr;
109 u32 d_dest_addr;
110 u32 d_upper_dest_addr;
111};
112
113struct iop13xx_adma_desc_pq_update {
114 u32 next_desc;
115 u32 desc_ctrl;
116 u32 reserved;
117 u32 byte_count;
118 u32 p_dest_addr;
119 u32 p_upper_dest_addr;
120 u32 src0_addr;
121 u32 upper_src0_addr;
122 u32 src1_addr;
123 u32 upper_src1_addr;
124 u32 p_src_addr;
125 u32 p_upper_src_addr;
126 u32 q_src_addr;
127 struct {
128 unsigned int q_upper_src_addr:24;
129 unsigned int q_dmlt:8;
130 };
131 u32 q_dest_addr;
132 u32 q_upper_dest_addr;
133};
134
135static inline int iop_adma_get_max_xor(void)
136{
137 return 16;
138}
139
140#define iop_adma_get_max_pq iop_adma_get_max_xor
141
142static inline u32 iop_chan_get_current_descriptor(struct iop_adma_chan *chan)
143{
144 return __raw_readl(ADMA_ADAR(chan));
145}
146
147static inline void iop_chan_set_next_descriptor(struct iop_adma_chan *chan,
148 u32 next_desc_addr)
149{
150 __raw_writel(next_desc_addr, ADMA_ANDAR(chan));
151}
152
153#define ADMA_STATUS_BUSY (1 << 13)
154
155static inline char iop_chan_is_busy(struct iop_adma_chan *chan)
156{
157 if (__raw_readl(ADMA_ACSR(chan)) &
158 ADMA_STATUS_BUSY)
159 return 1;
160 else
161 return 0;
162}
163
164static inline int
165iop_chan_get_desc_align(struct iop_adma_chan *chan, int num_slots)
166{
167 return 1;
168}
169#define iop_desc_is_aligned(x, y) 1
170
171static inline int
172iop_chan_memcpy_slot_count(size_t len, int *slots_per_op)
173{
174 *slots_per_op = 1;
175 return 1;
176}
177
178#define iop_chan_interrupt_slot_count(s, c) iop_chan_memcpy_slot_count(0, s)
179
180static inline int
181iop_chan_memset_slot_count(size_t len, int *slots_per_op)
182{
183 *slots_per_op = 1;
184 return 1;
185}
186
187static inline int
188iop_chan_xor_slot_count(size_t len, int src_cnt, int *slots_per_op)
189{
190 static const char slot_count_table[] = { 1, 2, 2, 2,
191 2, 3, 3, 3,
192 3, 4, 4, 4,
193 4, 5, 5, 5,
194 };
195 *slots_per_op = slot_count_table[src_cnt - 1];
196 return *slots_per_op;
197}
198
199#define ADMA_MAX_BYTE_COUNT (16 * 1024 * 1024)
200#define IOP_ADMA_MAX_BYTE_COUNT ADMA_MAX_BYTE_COUNT
201#define IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT ADMA_MAX_BYTE_COUNT
202#define IOP_ADMA_XOR_MAX_BYTE_COUNT ADMA_MAX_BYTE_COUNT
203#define IOP_ADMA_PQ_MAX_BYTE_COUNT ADMA_MAX_BYTE_COUNT
204#define iop_chan_zero_sum_slot_count(l, s, o) iop_chan_xor_slot_count(l, s, o)
205#define iop_chan_pq_slot_count iop_chan_xor_slot_count
206#define iop_chan_pq_zero_sum_slot_count iop_chan_xor_slot_count
207
208static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
209 struct iop_adma_chan *chan)
210{
211 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
212 return hw_desc->byte_count_field.byte_count;
213}
214
215static inline u32 iop_desc_get_src_addr(struct iop_adma_desc_slot *desc,
216 struct iop_adma_chan *chan,
217 int src_idx)
218{
219 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
220 return hw_desc->src[src_idx].src_addr;
221}
222
223static inline u32 iop_desc_get_src_count(struct iop_adma_desc_slot *desc,
224 struct iop_adma_chan *chan)
225{
226 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
227 return hw_desc->desc_ctrl_field.src_select + 1;
228}
229
230static inline void
231iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, unsigned long flags)
232{
233 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
234 union {
235 u32 value;
236 struct iop13xx_adma_desc_ctrl field;
237 } u_desc_ctrl;
238
239 u_desc_ctrl.value = 0;
240 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
241 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
242 hw_desc->desc_ctrl = u_desc_ctrl.value;
243 hw_desc->crc_addr = 0;
244}
245
246static inline void
247iop_desc_init_memset(struct iop_adma_desc_slot *desc, unsigned long flags)
248{
249 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
250 union {
251 u32 value;
252 struct iop13xx_adma_desc_ctrl field;
253 } u_desc_ctrl;
254
255 u_desc_ctrl.value = 0;
256 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
257 u_desc_ctrl.field.block_fill_en = 1;
258 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
259 hw_desc->desc_ctrl = u_desc_ctrl.value;
260 hw_desc->crc_addr = 0;
261}
262
263/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */
264static inline void
265iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt,
266 unsigned long flags)
267{
268 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
269 union {
270 u32 value;
271 struct iop13xx_adma_desc_ctrl field;
272 } u_desc_ctrl;
273
274 u_desc_ctrl.value = 0;
275 u_desc_ctrl.field.src_select = src_cnt - 1;
276 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
277 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
278 hw_desc->desc_ctrl = u_desc_ctrl.value;
279 hw_desc->crc_addr = 0;
280
281}
282#define iop_desc_init_null_xor(d, s, i) iop_desc_init_xor(d, s, i)
283
284/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */
285static inline int
286iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
287 unsigned long flags)
288{
289 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
290 union {
291 u32 value;
292 struct iop13xx_adma_desc_ctrl field;
293 } u_desc_ctrl;
294
295 u_desc_ctrl.value = 0;
296 u_desc_ctrl.field.src_select = src_cnt - 1;
297 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
298 u_desc_ctrl.field.zero_result = 1;
299 u_desc_ctrl.field.status_write_back_en = 1;
300 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
301 hw_desc->desc_ctrl = u_desc_ctrl.value;
302 hw_desc->crc_addr = 0;
303
304 return 1;
305}
306
307static inline void
308iop_desc_init_pq(struct iop_adma_desc_slot *desc, int src_cnt,
309 unsigned long flags)
310{
311 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
312 union {
313 u32 value;
314 struct iop13xx_adma_desc_ctrl field;
315 } u_desc_ctrl;
316
317 u_desc_ctrl.value = 0;
318 u_desc_ctrl.field.src_select = src_cnt - 1;
319 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
320 u_desc_ctrl.field.pq_xfer_en = 1;
321 u_desc_ctrl.field.p_xfer_dis = !!(flags & DMA_PREP_PQ_DISABLE_P);
322 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
323 hw_desc->desc_ctrl = u_desc_ctrl.value;
324}
325
326static inline void
327iop_desc_init_pq_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
328 unsigned long flags)
329{
330 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
331 union {
332 u32 value;
333 struct iop13xx_adma_desc_ctrl field;
334 } u_desc_ctrl;
335
336 u_desc_ctrl.value = 0;
337 u_desc_ctrl.field.src_select = src_cnt - 1;
338 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
339 u_desc_ctrl.field.zero_result = 1;
340 u_desc_ctrl.field.status_write_back_en = 1;
341 u_desc_ctrl.field.pq_xfer_en = 1;
342 u_desc_ctrl.field.p_xfer_dis = !!(flags & DMA_PREP_PQ_DISABLE_P);
343 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
344 hw_desc->desc_ctrl = u_desc_ctrl.value;
345}
346
347static inline void iop_desc_set_byte_count(struct iop_adma_desc_slot *desc,
348 struct iop_adma_chan *chan,
349 u32 byte_count)
350{
351 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
352 hw_desc->byte_count = byte_count;
353}
354
355static inline void
356iop_desc_set_zero_sum_byte_count(struct iop_adma_desc_slot *desc, u32 len)
357{
358 int slots_per_op = desc->slots_per_op;
359 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc, *iter;
360 int i = 0;
361
362 if (len <= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT) {
363 hw_desc->byte_count = len;
364 } else {
365 do {
366 iter = iop_hw_desc_slot_idx(hw_desc, i);
367 iter->byte_count = IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
368 len -= IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT;
369 i += slots_per_op;
370 } while (len > IOP_ADMA_ZERO_SUM_MAX_BYTE_COUNT);
371
372 if (len) {
373 iter = iop_hw_desc_slot_idx(hw_desc, i);
374 iter->byte_count = len;
375 }
376 }
377}
378
379#define iop_desc_set_pq_zero_sum_byte_count iop_desc_set_zero_sum_byte_count
380
381static inline void iop_desc_set_dest_addr(struct iop_adma_desc_slot *desc,
382 struct iop_adma_chan *chan,
383 dma_addr_t addr)
384{
385 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
386 hw_desc->dest_addr = addr;
387 hw_desc->upper_dest_addr = 0;
388}
389
390static inline void
391iop_desc_set_pq_addr(struct iop_adma_desc_slot *desc, dma_addr_t *addr)
392{
393 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
394
395 hw_desc->dest_addr = addr[0];
396 hw_desc->q_dest_addr = addr[1];
397 hw_desc->upper_dest_addr = 0;
398}
399
400static inline void iop_desc_set_memcpy_src_addr(struct iop_adma_desc_slot *desc,
401 dma_addr_t addr)
402{
403 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
404 hw_desc->src[0].src_addr = addr;
405 hw_desc->src[0].upper_src_addr = 0;
406}
407
408static inline void iop_desc_set_xor_src_addr(struct iop_adma_desc_slot *desc,
409 int src_idx, dma_addr_t addr)
410{
411 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
412 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc, *iter;
413 int i = 0;
414
415 do {
416 iter = iop_hw_desc_slot_idx(hw_desc, i);
417 iter->src[src_idx].src_addr = addr;
418 iter->src[src_idx].upper_src_addr = 0;
419 slot_cnt -= slots_per_op;
420 if (slot_cnt) {
421 i += slots_per_op;
422 addr += IOP_ADMA_XOR_MAX_BYTE_COUNT;
423 }
424 } while (slot_cnt);
425}
426
427static inline void
428iop_desc_set_pq_src_addr(struct iop_adma_desc_slot *desc, int src_idx,
429 dma_addr_t addr, unsigned char coef)
430{
431 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
432 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc, *iter;
433 struct iop13xx_adma_src *src;
434 int i = 0;
435
436 do {
437 iter = iop_hw_desc_slot_idx(hw_desc, i);
438 src = &iter->src[src_idx];
439 src->src_addr = addr;
440 src->pq_upper_src_addr = 0;
441 src->pq_dmlt = coef;
442 slot_cnt -= slots_per_op;
443 if (slot_cnt) {
444 i += slots_per_op;
445 addr += IOP_ADMA_PQ_MAX_BYTE_COUNT;
446 }
447 } while (slot_cnt);
448}
449
450static inline void
451iop_desc_init_interrupt(struct iop_adma_desc_slot *desc,
452 struct iop_adma_chan *chan)
453{
454 iop_desc_init_memcpy(desc, 1);
455 iop_desc_set_byte_count(desc, chan, 0);
456 iop_desc_set_dest_addr(desc, chan, 0);
457 iop_desc_set_memcpy_src_addr(desc, 0);
458}
459
460#define iop_desc_set_zero_sum_src_addr iop_desc_set_xor_src_addr
461#define iop_desc_set_pq_zero_sum_src_addr iop_desc_set_pq_src_addr
462
463static inline void
464iop_desc_set_pq_zero_sum_addr(struct iop_adma_desc_slot *desc, int pq_idx,
465 dma_addr_t *src)
466{
467 iop_desc_set_xor_src_addr(desc, pq_idx, src[pq_idx]);
468 iop_desc_set_xor_src_addr(desc, pq_idx+1, src[pq_idx+1]);
469}
470
471static inline void iop_desc_set_next_desc(struct iop_adma_desc_slot *desc,
472 u32 next_desc_addr)
473{
474 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
475
476 iop_paranoia(hw_desc->next_desc);
477 hw_desc->next_desc = next_desc_addr;
478}
479
480static inline u32 iop_desc_get_next_desc(struct iop_adma_desc_slot *desc)
481{
482 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
483 return hw_desc->next_desc;
484}
485
486static inline void iop_desc_clear_next_desc(struct iop_adma_desc_slot *desc)
487{
488 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
489 hw_desc->next_desc = 0;
490}
491
492static inline void iop_desc_set_block_fill_val(struct iop_adma_desc_slot *desc,
493 u32 val)
494{
495 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
496 hw_desc->block_fill_data = val;
497}
498
499static inline enum sum_check_flags
500iop_desc_get_zero_result(struct iop_adma_desc_slot *desc)
501{
502 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
503 struct iop13xx_adma_desc_ctrl desc_ctrl = hw_desc->desc_ctrl_field;
504 struct iop13xx_adma_byte_count byte_count = hw_desc->byte_count_field;
505 enum sum_check_flags flags;
506
507 BUG_ON(!(byte_count.tx_complete && desc_ctrl.zero_result));
508
509 flags = byte_count.zero_result_err_q << SUM_CHECK_Q;
510 flags |= byte_count.zero_result_err << SUM_CHECK_P;
511
512 return flags;
513}
514
515static inline void iop_chan_append(struct iop_adma_chan *chan)
516{
517 u32 adma_accr;
518
519 adma_accr = __raw_readl(ADMA_ACCR(chan));
520 adma_accr |= 0x2;
521 __raw_writel(adma_accr, ADMA_ACCR(chan));
522}
523
524static inline u32 iop_chan_get_status(struct iop_adma_chan *chan)
525{
526 return __raw_readl(ADMA_ACSR(chan));
527}
528
529static inline void iop_chan_disable(struct iop_adma_chan *chan)
530{
531 u32 adma_chan_ctrl = __raw_readl(ADMA_ACCR(chan));
532 adma_chan_ctrl &= ~0x1;
533 __raw_writel(adma_chan_ctrl, ADMA_ACCR(chan));
534}
535
536static inline void iop_chan_enable(struct iop_adma_chan *chan)
537{
538 u32 adma_chan_ctrl;
539
540 adma_chan_ctrl = __raw_readl(ADMA_ACCR(chan));
541 adma_chan_ctrl |= 0x1;
542 __raw_writel(adma_chan_ctrl, ADMA_ACCR(chan));
543}
544
545static inline void iop_adma_device_clear_eot_status(struct iop_adma_chan *chan)
546{
547 u32 status = __raw_readl(ADMA_ACSR(chan));
548 status &= (1 << 12);
549 __raw_writel(status, ADMA_ACSR(chan));
550}
551
552static inline void iop_adma_device_clear_eoc_status(struct iop_adma_chan *chan)
553{
554 u32 status = __raw_readl(ADMA_ACSR(chan));
555 status &= (1 << 11);
556 __raw_writel(status, ADMA_ACSR(chan));
557}
558
559static inline void iop_adma_device_clear_err_status(struct iop_adma_chan *chan)
560{
561 u32 status = __raw_readl(ADMA_ACSR(chan));
562 status &= (1 << 9) | (1 << 5) | (1 << 4) | (1 << 3);
563 __raw_writel(status, ADMA_ACSR(chan));
564}
565
566static inline int
567iop_is_err_int_parity(unsigned long status, struct iop_adma_chan *chan)
568{
569 return test_bit(9, &status);
570}
571
572static inline int
573iop_is_err_mcu_abort(unsigned long status, struct iop_adma_chan *chan)
574{
575 return test_bit(5, &status);
576}
577
578static inline int
579iop_is_err_int_tabort(unsigned long status, struct iop_adma_chan *chan)
580{
581 return test_bit(4, &status);
582}
583
584static inline int
585iop_is_err_int_mabort(unsigned long status, struct iop_adma_chan *chan)
586{
587 return test_bit(3, &status);
588}
589
590static inline int
591iop_is_err_pci_tabort(unsigned long status, struct iop_adma_chan *chan)
592{
593 return 0;
594}
595
596static inline int
597iop_is_err_pci_mabort(unsigned long status, struct iop_adma_chan *chan)
598{
599 return 0;
600}
601
602static inline int
603iop_is_err_split_tx(unsigned long status, struct iop_adma_chan *chan)
604{
605 return 0;
606}
607
608#endif /* _ADMA_H */
diff --git a/arch/arm/mach-iop13xx/include/mach/entry-macro.S b/arch/arm/mach-iop13xx/include/mach/entry-macro.S
deleted file mode 100644
index 9f4ecb8861bd..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/entry-macro.S
+++ /dev/null
@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * iop13xx low level irq macros
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6 .macro get_irqnr_preamble, base, tmp
7 mrc p15, 0, \tmp, c15, c1, 0
8 orr \tmp, \tmp, #(1 << 6)
9 mcr p15, 0, \tmp, c15, c1, 0 @ Enable cp6 access
10 .endm
11
12 /*
13 * Note: a 1-cycle window exists where iintvec will return the value
14 * of iintbase, so we explicitly check for "bad zeros"
15 */
16 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
17 mrc p6, 0, \irqnr, c3, c2, 0 @ Read IINTVEC
18 cmp \irqnr, #0
19 mrceq p6, 0, \irqnr, c3, c2, 0 @ Re-read on potentially bad zero
20 adds \irqstat, \irqnr, #1 @ Check for 0xffffffff
21 movne \irqnr, \irqnr, lsr #2 @ Convert to irqnr
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2
25 mrc p15, 0, \tmp1, c15, c1, 0
26 ands \tmp2, \tmp1, #(1 << 6)
27 bicne \tmp1, \tmp1, #(1 << 6)
28 mcrne p15, 0, \tmp1, c15, c1, 0 @ Disable cp6 access
29 .endm
diff --git a/arch/arm/mach-iop13xx/include/mach/hardware.h b/arch/arm/mach-iop13xx/include/mach/hardware.h
deleted file mode 100644
index 8c943fa6bbd7..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/hardware.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ASM_ARCH_HARDWARE_H
3#define __ASM_ARCH_HARDWARE_H
4#include <asm/types.h>
5
6#ifndef __ASSEMBLY__
7extern u16 iop13xx_dev_id(void);
8extern void iop13xx_set_atu_mmr_bases(void);
9#endif
10
11/*
12 * Generic chipset bits
13 *
14 */
15#include "iop13xx.h"
16
17/*
18 * Board specific bits
19 */
20#include "iq81340.h"
21
22#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-iop13xx/include/mach/iop13xx.h b/arch/arm/mach-iop13xx/include/mach/iop13xx.h
deleted file mode 100644
index 04bb6aca12c5..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/iop13xx.h
+++ /dev/null
@@ -1,508 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IOP13XX_HW_H_
3#define _IOP13XX_HW_H_
4
5#ifndef __ASSEMBLY__
6
7enum reboot_mode;
8
9/* The ATU offsets can change based on the strapping */
10extern u32 iop13xx_atux_pmmr_offset;
11extern u32 iop13xx_atue_pmmr_offset;
12void iop13xx_init_early(void);
13void iop13xx_init_irq(void);
14void iop13xx_map_io(void);
15void iop13xx_platform_init(void);
16void iop13xx_add_tpmi_devices(void);
17void iop13xx_init_irq(void);
18void iop13xx_restart(enum reboot_mode, const char *);
19
20/* CPUID CP6 R0 Page 0 */
21static inline int iop13xx_cpu_id(void)
22{
23 int id;
24 asm volatile("mrc p6, 0, %0, c0, c0, 0":"=r" (id));
25 return id;
26}
27
28/* WDTCR CP6 R7 Page 9 */
29static inline u32 read_wdtcr(void)
30{
31 u32 val;
32 asm volatile("mrc p6, 0, %0, c7, c9, 0":"=r" (val));
33 return val;
34}
35static inline void write_wdtcr(u32 val)
36{
37 asm volatile("mcr p6, 0, %0, c7, c9, 0"::"r" (val));
38}
39
40/* WDTSR CP6 R8 Page 9 */
41static inline u32 read_wdtsr(void)
42{
43 u32 val;
44 asm volatile("mrc p6, 0, %0, c8, c9, 0":"=r" (val));
45 return val;
46}
47static inline void write_wdtsr(u32 val)
48{
49 asm volatile("mcr p6, 0, %0, c8, c9, 0"::"r" (val));
50}
51
52/* RCSR - Reset Cause Status Register */
53static inline u32 read_rcsr(void)
54{
55 u32 val;
56 asm volatile("mrc p6, 0, %0, c0, c1, 0":"=r" (val));
57 return val;
58}
59
60extern unsigned long get_iop_tick_rate(void);
61#endif
62
63/*
64 * IOP13XX I/O and Mem space regions for PCI autoconfiguration
65 */
66#define IOP13XX_MAX_RAM_SIZE 0x80000000UL /* 2GB */
67#define IOP13XX_PCI_OFFSET IOP13XX_MAX_RAM_SIZE
68
69/* PCI MAP
70 * bus range cpu phys cpu virt note
71 * 0x0000.0000 + 2GB (n/a) (n/a) inbound, 1:1 mapping with Physical RAM
72 * 0x8000.0000 + 928M 0x1.8000.0000 (ioremap) PCIX outbound memory window
73 * 0x8000.0000 + 928M 0x2.8000.0000 (ioremap) PCIE outbound memory window
74 *
75 * IO MAP
76 * 0x00000 + 64K 0x0.fffb.0000 0xfee0.0000 PCIX outbound i/o window
77 * 0x10000 + 64K 0x0.fffd.0000 0xfee1.0000 PCIE outbound i/o window
78 */
79#define IOP13XX_PCIX_LOWER_IO_PA 0xfffb0000UL
80#define IOP13XX_PCIX_LOWER_IO_BA 0x0UL /* OIOTVR */
81
82#define IOP13XX_PCIX_MEM_PHYS_OFFSET 0x100000000ULL
83#define IOP13XX_PCIX_MEM_WINDOW_SIZE 0x3a000000UL
84#define IOP13XX_PCIX_LOWER_MEM_BA (PHYS_OFFSET + IOP13XX_PCI_OFFSET)
85#define IOP13XX_PCIX_LOWER_MEM_PA (IOP13XX_PCIX_MEM_PHYS_OFFSET +\
86 IOP13XX_PCIX_LOWER_MEM_BA)
87#define IOP13XX_PCIX_UPPER_MEM_PA (IOP13XX_PCIX_LOWER_MEM_PA +\
88 IOP13XX_PCIX_MEM_WINDOW_SIZE - 1)
89#define IOP13XX_PCIX_UPPER_MEM_BA (IOP13XX_PCIX_LOWER_MEM_BA +\
90 IOP13XX_PCIX_MEM_WINDOW_SIZE - 1)
91
92#define IOP13XX_PCIX_MEM_COOKIE 0x80000000UL
93#define IOP13XX_PCIX_LOWER_MEM_RA IOP13XX_PCIX_MEM_COOKIE
94#define IOP13XX_PCIX_UPPER_MEM_RA (IOP13XX_PCIX_LOWER_MEM_RA +\
95 IOP13XX_PCIX_MEM_WINDOW_SIZE - 1)
96#define IOP13XX_PCIX_MEM_OFFSET (IOP13XX_PCIX_MEM_COOKIE -\
97 IOP13XX_PCIX_LOWER_MEM_BA)
98
99/* PCI-E ranges */
100#define IOP13XX_PCIE_LOWER_IO_PA 0xfffd0000UL
101#define IOP13XX_PCIE_LOWER_IO_BA 0x10000UL /* OIOTVR */
102
103#define IOP13XX_PCIE_MEM_PHYS_OFFSET 0x200000000ULL
104#define IOP13XX_PCIE_MEM_WINDOW_SIZE 0x3a000000UL
105#define IOP13XX_PCIE_LOWER_MEM_BA (PHYS_OFFSET + IOP13XX_PCI_OFFSET)
106#define IOP13XX_PCIE_LOWER_MEM_PA (IOP13XX_PCIE_MEM_PHYS_OFFSET +\
107 IOP13XX_PCIE_LOWER_MEM_BA)
108#define IOP13XX_PCIE_UPPER_MEM_PA (IOP13XX_PCIE_LOWER_MEM_PA +\
109 IOP13XX_PCIE_MEM_WINDOW_SIZE - 1)
110#define IOP13XX_PCIE_UPPER_MEM_BA (IOP13XX_PCIE_LOWER_MEM_BA +\
111 IOP13XX_PCIE_MEM_WINDOW_SIZE - 1)
112
113/* All 0xc000.0000 - 0xfdff.ffff addresses belong to PCIe */
114#define IOP13XX_PCIE_MEM_COOKIE 0xc0000000UL
115#define IOP13XX_PCIE_LOWER_MEM_RA IOP13XX_PCIE_MEM_COOKIE
116#define IOP13XX_PCIE_UPPER_MEM_RA (IOP13XX_PCIE_LOWER_MEM_RA +\
117 IOP13XX_PCIE_MEM_WINDOW_SIZE - 1)
118#define IOP13XX_PCIE_MEM_OFFSET (IOP13XX_PCIE_MEM_COOKIE -\
119 IOP13XX_PCIE_LOWER_MEM_BA)
120
121/* PBI Ranges */
122#define IOP13XX_PBI_LOWER_MEM_PA 0xf0000000UL
123#define IOP13XX_PBI_MEM_WINDOW_SIZE 0x04000000UL
124#define IOP13XX_PBI_MEM_COOKIE 0xfa000000UL
125#define IOP13XX_PBI_LOWER_MEM_RA IOP13XX_PBI_MEM_COOKIE
126#define IOP13XX_PBI_UPPER_MEM_RA (IOP13XX_PBI_LOWER_MEM_RA +\
127 IOP13XX_PBI_MEM_WINDOW_SIZE - 1)
128
129/*
130 * IOP13XX chipset registers
131 */
132#define IOP13XX_PMMR_PHYS_MEM_BASE 0xffd80000UL /* PMMR phys. address */
133#define IOP13XX_PMMR_VIRT_MEM_BASE (void __iomem *)(0xfee80000UL) /* PMMR phys. address */
134#define IOP13XX_PMMR_MEM_WINDOW_SIZE 0x80000
135#define IOP13XX_PMMR_UPPER_MEM_VA (IOP13XX_PMMR_VIRT_MEM_BASE +\
136 IOP13XX_PMMR_MEM_WINDOW_SIZE - 1)
137#define IOP13XX_PMMR_UPPER_MEM_PA (IOP13XX_PMMR_PHYS_MEM_BASE +\
138 IOP13XX_PMMR_MEM_WINDOW_SIZE - 1)
139#define IOP13XX_PMMR_VIRT_TO_PHYS(addr) (((addr) - IOP13XX_PMMR_VIRT_MEM_BASE)\
140 + IOP13XX_PMMR_PHYS_MEM_BASE)
141#define IOP13XX_PMMR_PHYS_TO_VIRT(addr) (((addr) - IOP13XX_PMMR_PHYS_MEM_BASE)\
142 + IOP13XX_PMMR_VIRT_MEM_BASE)
143#define IOP13XX_REG_ADDR32(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg))
144#define IOP13XX_REG_ADDR16(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg))
145#define IOP13XX_REG_ADDR8(reg) (IOP13XX_PMMR_VIRT_MEM_BASE + (reg))
146#define IOP13XX_REG_ADDR32_PHYS(reg) (IOP13XX_PMMR_PHYS_MEM_BASE + (reg))
147#define IOP13XX_REG_ADDR16_PHYS(reg) (IOP13XX_PMMR_PHYS_MEM_BASE + (reg))
148#define IOP13XX_REG_ADDR8_PHYS(reg) (IOP13XX_PMMR_PHYS_MEM_BASE + (reg))
149#define IOP13XX_PMMR_SIZE 0x00080000
150
151/*=================== Defines for Platform Devices =====================*/
152#define IOP13XX_UART0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002300)
153#define IOP13XX_UART1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE + 0x00002340)
154#define IOP13XX_UART0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002300)
155#define IOP13XX_UART1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x00002340)
156
157#define IOP13XX_I2C0_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002500)
158#define IOP13XX_I2C1_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002520)
159#define IOP13XX_I2C2_PHYS (IOP13XX_PMMR_PHYS_MEM_BASE | 0x00002540)
160#define IOP13XX_I2C0_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002500)
161#define IOP13XX_I2C1_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002520)
162#define IOP13XX_I2C2_VIRT (IOP13XX_PMMR_VIRT_MEM_BASE | 0x00002540)
163
164/* ATU selection flags */
165/* IOP13XX_INIT_ATU_DEFAULT = Rely on CONFIG_IOP13XX_ATU* */
166#define IOP13XX_INIT_ATU_DEFAULT (0)
167#define IOP13XX_INIT_ATU_ATUX (1 << 0)
168#define IOP13XX_INIT_ATU_ATUE (1 << 1)
169#define IOP13XX_INIT_ATU_NONE (1 << 2)
170
171/* UART selection flags */
172/* IOP13XX_INIT_UART_DEFAULT = Rely on CONFIG_IOP13XX_UART* */
173#define IOP13XX_INIT_UART_DEFAULT (0)
174#define IOP13XX_INIT_UART_0 (1 << 0)
175#define IOP13XX_INIT_UART_1 (1 << 1)
176
177/* I2C selection flags */
178/* IOP13XX_INIT_I2C_DEFAULT = Rely on CONFIG_IOP13XX_I2C* */
179#define IOP13XX_INIT_I2C_DEFAULT (0)
180#define IOP13XX_INIT_I2C_0 (1 << 0)
181#define IOP13XX_INIT_I2C_1 (1 << 1)
182#define IOP13XX_INIT_I2C_2 (1 << 2)
183
184/* ADMA selection flags */
185/* INIT_ADMA_DEFAULT = Rely on CONFIG_IOP13XX_ADMA* */
186#define IOP13XX_INIT_ADMA_DEFAULT (0)
187#define IOP13XX_INIT_ADMA_0 (1 << 0)
188#define IOP13XX_INIT_ADMA_1 (1 << 1)
189#define IOP13XX_INIT_ADMA_2 (1 << 2)
190
191/* Platform devices */
192#define IQ81340_NUM_UART 2
193#define IQ81340_NUM_I2C 3
194#define IQ81340_NUM_PHYS_MAP_FLASH 1
195#define IQ81340_NUM_ADMA 3
196#define IQ81340_MAX_PLAT_DEVICES (IQ81340_NUM_UART + \
197 IQ81340_NUM_I2C + \
198 IQ81340_NUM_PHYS_MAP_FLASH + \
199 IQ81340_NUM_ADMA)
200
201/*========================== PMMR offsets for key registers ============*/
202#define IOP13XX_ATU0_PMMR_OFFSET 0x00048000
203#define IOP13XX_ATU1_PMMR_OFFSET 0x0004c000
204#define IOP13XX_ATU2_PMMR_OFFSET 0x0004d000
205#define IOP13XX_ADMA0_PMMR_OFFSET 0x00000000
206#define IOP13XX_ADMA1_PMMR_OFFSET 0x00000200
207#define IOP13XX_ADMA2_PMMR_OFFSET 0x00000400
208#define IOP13XX_PBI_PMMR_OFFSET 0x00001580
209#define IOP13XX_MU_PMMR_OFFSET 0x00004000
210#define IOP13XX_ESSR0_PMMR_OFFSET 0x00002188
211#define IOP13XX_ESSR0 IOP13XX_REG_ADDR32(0x00002188)
212
213#define IOP13XX_ESSR0_IFACE_MASK 0x00004000 /* Interface PCI-X / PCI-E */
214#define IOP13XX_CONTROLLER_ONLY (1 << 14)
215#define IOP13XX_INTERFACE_SEL_PCIX (1 << 15)
216
217#define IOP13XX_PMON_PMMR_OFFSET 0x0001A000
218#define IOP13XX_PMON_BASE (IOP13XX_PMMR_VIRT_MEM_BASE +\
219 IOP13XX_PMON_PMMR_OFFSET)
220#define IOP13XX_PMON_PHYSBASE (IOP13XX_PMMR_PHYS_MEM_BASE +\
221 IOP13XX_PMON_PMMR_OFFSET)
222
223#define IOP13XX_PMON_CMD0 (IOP13XX_PMON_BASE + 0x0)
224#define IOP13XX_PMON_EVR0 (IOP13XX_PMON_BASE + 0x4)
225#define IOP13XX_PMON_STS0 (IOP13XX_PMON_BASE + 0x8)
226#define IOP13XX_PMON_DATA0 (IOP13XX_PMON_BASE + 0xC)
227
228#define IOP13XX_PMON_CMD3 (IOP13XX_PMON_BASE + 0x30)
229#define IOP13XX_PMON_EVR3 (IOP13XX_PMON_BASE + 0x34)
230#define IOP13XX_PMON_STS3 (IOP13XX_PMON_BASE + 0x38)
231#define IOP13XX_PMON_DATA3 (IOP13XX_PMON_BASE + 0x3C)
232
233#define IOP13XX_PMON_CMD7 (IOP13XX_PMON_BASE + 0x70)
234#define IOP13XX_PMON_EVR7 (IOP13XX_PMON_BASE + 0x74)
235#define IOP13XX_PMON_STS7 (IOP13XX_PMON_BASE + 0x78)
236#define IOP13XX_PMON_DATA7 (IOP13XX_PMON_BASE + 0x7C)
237
238#define IOP13XX_PMONEN (IOP13XX_PMMR_VIRT_MEM_BASE + 0x4E040)
239#define IOP13XX_PMONSTAT (IOP13XX_PMMR_VIRT_MEM_BASE + 0x4E044)
240
241/*================================ATU===================================*/
242#define IOP13XX_ATUX_OFFSET(ofs) IOP13XX_REG_ADDR32(\
243 iop13xx_atux_pmmr_offset + (ofs))
244
245#define IOP13XX_ATUX_DID IOP13XX_REG_ADDR16(\
246 iop13xx_atux_pmmr_offset + 0x2)
247
248#define IOP13XX_ATUX_ATUCMD IOP13XX_REG_ADDR16(\
249 iop13xx_atux_pmmr_offset + 0x4)
250#define IOP13XX_ATUX_ATUSR IOP13XX_REG_ADDR16(\
251 iop13xx_atux_pmmr_offset + 0x6)
252
253#define IOP13XX_ATUX_IABAR0 IOP13XX_ATUX_OFFSET(0x10)
254#define IOP13XX_ATUX_IAUBAR0 IOP13XX_ATUX_OFFSET(0x14)
255#define IOP13XX_ATUX_IABAR1 IOP13XX_ATUX_OFFSET(0x18)
256#define IOP13XX_ATUX_IAUBAR1 IOP13XX_ATUX_OFFSET(0x1c)
257#define IOP13XX_ATUX_IABAR2 IOP13XX_ATUX_OFFSET(0x20)
258#define IOP13XX_ATUX_IAUBAR2 IOP13XX_ATUX_OFFSET(0x24)
259#define IOP13XX_ATUX_IALR0 IOP13XX_ATUX_OFFSET(0x40)
260#define IOP13XX_ATUX_IATVR0 IOP13XX_ATUX_OFFSET(0x44)
261#define IOP13XX_ATUX_IAUTVR0 IOP13XX_ATUX_OFFSET(0x48)
262#define IOP13XX_ATUX_IALR1 IOP13XX_ATUX_OFFSET(0x4c)
263#define IOP13XX_ATUX_IATVR1 IOP13XX_ATUX_OFFSET(0x50)
264#define IOP13XX_ATUX_IAUTVR1 IOP13XX_ATUX_OFFSET(0x54)
265#define IOP13XX_ATUX_IALR2 IOP13XX_ATUX_OFFSET(0x58)
266#define IOP13XX_ATUX_IATVR2 IOP13XX_ATUX_OFFSET(0x5c)
267#define IOP13XX_ATUX_IAUTVR2 IOP13XX_ATUX_OFFSET(0x60)
268#define IOP13XX_ATUX_ATUCR IOP13XX_ATUX_OFFSET(0x70)
269#define IOP13XX_ATUX_PCSR IOP13XX_ATUX_OFFSET(0x74)
270#define IOP13XX_ATUX_ATUISR IOP13XX_ATUX_OFFSET(0x78)
271#define IOP13XX_ATUX_PCIXSR IOP13XX_ATUX_OFFSET(0xD4)
272#define IOP13XX_ATUX_IABAR3 IOP13XX_ATUX_OFFSET(0x200)
273#define IOP13XX_ATUX_IAUBAR3 IOP13XX_ATUX_OFFSET(0x204)
274#define IOP13XX_ATUX_IALR3 IOP13XX_ATUX_OFFSET(0x208)
275#define IOP13XX_ATUX_IATVR3 IOP13XX_ATUX_OFFSET(0x20c)
276#define IOP13XX_ATUX_IAUTVR3 IOP13XX_ATUX_OFFSET(0x210)
277
278#define IOP13XX_ATUX_OIOBAR IOP13XX_ATUX_OFFSET(0x300)
279#define IOP13XX_ATUX_OIOWTVR IOP13XX_ATUX_OFFSET(0x304)
280#define IOP13XX_ATUX_OUMBAR0 IOP13XX_ATUX_OFFSET(0x308)
281#define IOP13XX_ATUX_OUMWTVR0 IOP13XX_ATUX_OFFSET(0x30c)
282#define IOP13XX_ATUX_OUMBAR1 IOP13XX_ATUX_OFFSET(0x310)
283#define IOP13XX_ATUX_OUMWTVR1 IOP13XX_ATUX_OFFSET(0x314)
284#define IOP13XX_ATUX_OUMBAR2 IOP13XX_ATUX_OFFSET(0x318)
285#define IOP13XX_ATUX_OUMWTVR2 IOP13XX_ATUX_OFFSET(0x31c)
286#define IOP13XX_ATUX_OUMBAR3 IOP13XX_ATUX_OFFSET(0x320)
287#define IOP13XX_ATUX_OUMWTVR3 IOP13XX_ATUX_OFFSET(0x324)
288#define IOP13XX_ATUX_OUDMABAR IOP13XX_ATUX_OFFSET(0x328)
289#define IOP13XX_ATUX_OUMSIBAR IOP13XX_ATUX_OFFSET(0x32c)
290#define IOP13XX_ATUX_OCCAR IOP13XX_ATUX_OFFSET(0x330)
291#define IOP13XX_ATUX_OCCDR IOP13XX_ATUX_OFFSET(0x334)
292
293#define IOP13XX_ATUX_ATUCR_OUT_EN (1 << 1)
294#define IOP13XX_ATUX_PCSR_CENTRAL_RES (1 << 25)
295#define IOP13XX_ATUX_PCSR_P_RSTOUT (1 << 21)
296#define IOP13XX_ATUX_PCSR_OUT_Q_BUSY (1 << 15)
297#define IOP13XX_ATUX_PCSR_IN_Q_BUSY (1 << 14)
298#define IOP13XX_ATUX_PCSR_FREQ_OFFSET (16)
299
300#define IOP13XX_ATUX_STAT_PCI_IFACE_ERR (1 << 18)
301#define IOP13XX_ATUX_STAT_VPD_ADDR (1 << 17)
302#define IOP13XX_ATUX_STAT_INT_PAR_ERR (1 << 16)
303#define IOP13XX_ATUX_STAT_CFG_WRITE (1 << 15)
304#define IOP13XX_ATUX_STAT_ERR_COR (1 << 14)
305#define IOP13XX_ATUX_STAT_TX_SCEM (1 << 13)
306#define IOP13XX_ATUX_STAT_REC_SCEM (1 << 12)
307#define IOP13XX_ATUX_STAT_POWER_TRAN (1 << 11)
308#define IOP13XX_ATUX_STAT_TX_SERR (1 << 10)
309#define IOP13XX_ATUX_STAT_DET_PAR_ERR (1 << 9 )
310#define IOP13XX_ATUX_STAT_BIST (1 << 8 )
311#define IOP13XX_ATUX_STAT_INT_REC_MABORT (1 << 7 )
312#define IOP13XX_ATUX_STAT_REC_SERR (1 << 4 )
313#define IOP13XX_ATUX_STAT_EXT_REC_MABORT (1 << 3 )
314#define IOP13XX_ATUX_STAT_EXT_REC_TABORT (1 << 2 )
315#define IOP13XX_ATUX_STAT_EXT_SIG_TABORT (1 << 1 )
316#define IOP13XX_ATUX_STAT_MASTER_DATA_PAR (1 << 0 )
317
318#define IOP13XX_ATUX_PCIXSR_BUS_NUM (8)
319#define IOP13XX_ATUX_PCIXSR_DEV_NUM (3)
320#define IOP13XX_ATUX_PCIXSR_FUNC_NUM (0)
321
322#define IOP13XX_ATUX_IALR_DISABLE 0x00000001
323#define IOP13XX_ATUX_OUMBAR_ENABLE 0x80000000
324
325#define IOP13XX_ATUE_OFFSET(ofs) IOP13XX_REG_ADDR32(\
326 iop13xx_atue_pmmr_offset + (ofs))
327
328#define IOP13XX_ATUE_DID IOP13XX_REG_ADDR16(\
329 iop13xx_atue_pmmr_offset + 0x2)
330#define IOP13XX_ATUE_ATUCMD IOP13XX_REG_ADDR16(\
331 iop13xx_atue_pmmr_offset + 0x4)
332#define IOP13XX_ATUE_ATUSR IOP13XX_REG_ADDR16(\
333 iop13xx_atue_pmmr_offset + 0x6)
334
335#define IOP13XX_ATUE_IABAR0 IOP13XX_ATUE_OFFSET(0x10)
336#define IOP13XX_ATUE_IAUBAR0 IOP13XX_ATUE_OFFSET(0x14)
337#define IOP13XX_ATUE_IABAR1 IOP13XX_ATUE_OFFSET(0x18)
338#define IOP13XX_ATUE_IAUBAR1 IOP13XX_ATUE_OFFSET(0x1c)
339#define IOP13XX_ATUE_IABAR2 IOP13XX_ATUE_OFFSET(0x20)
340#define IOP13XX_ATUE_IAUBAR2 IOP13XX_ATUE_OFFSET(0x24)
341#define IOP13XX_ATUE_IALR0 IOP13XX_ATUE_OFFSET(0x40)
342#define IOP13XX_ATUE_IATVR0 IOP13XX_ATUE_OFFSET(0x44)
343#define IOP13XX_ATUE_IAUTVR0 IOP13XX_ATUE_OFFSET(0x48)
344#define IOP13XX_ATUE_IALR1 IOP13XX_ATUE_OFFSET(0x4c)
345#define IOP13XX_ATUE_IATVR1 IOP13XX_ATUE_OFFSET(0x50)
346#define IOP13XX_ATUE_IAUTVR1 IOP13XX_ATUE_OFFSET(0x54)
347#define IOP13XX_ATUE_IALR2 IOP13XX_ATUE_OFFSET(0x58)
348#define IOP13XX_ATUE_IATVR2 IOP13XX_ATUE_OFFSET(0x5c)
349#define IOP13XX_ATUE_IAUTVR2 IOP13XX_ATUE_OFFSET(0x60)
350#define IOP13XX_ATUE_PE_LSTS IOP13XX_REG_ADDR16(\
351 iop13xx_atue_pmmr_offset + 0xe2)
352#define IOP13XX_ATUE_OIOWTVR IOP13XX_ATUE_OFFSET(0x304)
353#define IOP13XX_ATUE_OUMBAR0 IOP13XX_ATUE_OFFSET(0x308)
354#define IOP13XX_ATUE_OUMWTVR0 IOP13XX_ATUE_OFFSET(0x30c)
355#define IOP13XX_ATUE_OUMBAR1 IOP13XX_ATUE_OFFSET(0x310)
356#define IOP13XX_ATUE_OUMWTVR1 IOP13XX_ATUE_OFFSET(0x314)
357#define IOP13XX_ATUE_OUMBAR2 IOP13XX_ATUE_OFFSET(0x318)
358#define IOP13XX_ATUE_OUMWTVR2 IOP13XX_ATUE_OFFSET(0x31c)
359#define IOP13XX_ATUE_OUMBAR3 IOP13XX_ATUE_OFFSET(0x320)
360#define IOP13XX_ATUE_OUMWTVR3 IOP13XX_ATUE_OFFSET(0x324)
361
362#define IOP13XX_ATUE_ATUCR IOP13XX_ATUE_OFFSET(0x70)
363#define IOP13XX_ATUE_PCSR IOP13XX_ATUE_OFFSET(0x74)
364#define IOP13XX_ATUE_ATUISR IOP13XX_ATUE_OFFSET(0x78)
365#define IOP13XX_ATUE_OIOBAR IOP13XX_ATUE_OFFSET(0x300)
366#define IOP13XX_ATUE_OCCAR IOP13XX_ATUE_OFFSET(0x32c)
367#define IOP13XX_ATUE_OCCDR IOP13XX_ATUE_OFFSET(0x330)
368
369#define IOP13XX_ATUE_PIE_STS IOP13XX_ATUE_OFFSET(0x384)
370#define IOP13XX_ATUE_PIE_MSK IOP13XX_ATUE_OFFSET(0x388)
371
372#define IOP13XX_ATUE_ATUCR_IVM (1 << 6)
373#define IOP13XX_ATUE_ATUCR_OUT_EN (1 << 1)
374#define IOP13XX_ATUE_OCCAR_BUS_NUM (24)
375#define IOP13XX_ATUE_OCCAR_DEV_NUM (19)
376#define IOP13XX_ATUE_OCCAR_FUNC_NUM (16)
377#define IOP13XX_ATUE_OCCAR_EXT_REG (8)
378#define IOP13XX_ATUE_OCCAR_REG (2)
379
380#define IOP13XX_ATUE_PCSR_BUS_NUM (24)
381#define IOP13XX_ATUE_PCSR_DEV_NUM (19)
382#define IOP13XX_ATUE_PCSR_FUNC_NUM (16)
383#define IOP13XX_ATUE_PCSR_OUT_Q_BUSY (1 << 15)
384#define IOP13XX_ATUE_PCSR_IN_Q_BUSY (1 << 14)
385#define IOP13XX_ATUE_PCSR_END_POINT (1 << 13)
386#define IOP13XX_ATUE_PCSR_LLRB_BUSY (1 << 12)
387
388#define IOP13XX_ATUE_PCSR_BUS_NUM_MASK (0xff)
389#define IOP13XX_ATUE_PCSR_DEV_NUM_MASK (0x1f)
390#define IOP13XX_ATUE_PCSR_FUNC_NUM_MASK (0x7)
391
392#define IOP13XX_ATUE_PCSR_CORE_RESET (8)
393#define IOP13XX_ATUE_PCSR_FUNC_NUM (16)
394
395#define IOP13XX_ATUE_LSTS_TRAINING (1 << 11)
396#define IOP13XX_ATUE_STAT_SLOT_PWR_MSG (1 << 28)
397#define IOP13XX_ATUE_STAT_PME (1 << 27)
398#define IOP13XX_ATUE_STAT_HOT_PLUG_MSG (1 << 26)
399#define IOP13XX_ATUE_STAT_IVM (1 << 25)
400#define IOP13XX_ATUE_STAT_BIST (1 << 24)
401#define IOP13XX_ATUE_STAT_CFG_WRITE (1 << 18)
402#define IOP13XX_ATUE_STAT_VPD_ADDR (1 << 17)
403#define IOP13XX_ATUE_STAT_POWER_TRAN (1 << 16)
404#define IOP13XX_ATUE_STAT_HALT_ON_ERROR (1 << 13)
405#define IOP13XX_ATUE_STAT_ROOT_SYS_ERR (1 << 12)
406#define IOP13XX_ATUE_STAT_ROOT_ERR_MSG (1 << 11)
407#define IOP13XX_ATUE_STAT_PCI_IFACE_ERR (1 << 10)
408#define IOP13XX_ATUE_STAT_ERR_COR (1 << 9 )
409#define IOP13XX_ATUE_STAT_ERR_UNCOR (1 << 8 )
410#define IOP13XX_ATUE_STAT_CRS (1 << 7 )
411#define IOP13XX_ATUE_STAT_LNK_DWN (1 << 6 )
412#define IOP13XX_ATUE_STAT_INT_REC_MABORT (1 << 5 )
413#define IOP13XX_ATUE_STAT_DET_PAR_ERR (1 << 4 )
414#define IOP13XX_ATUE_STAT_EXT_REC_MABORT (1 << 3 )
415#define IOP13XX_ATUE_STAT_SIG_TABORT (1 << 2 )
416#define IOP13XX_ATUE_STAT_EXT_REC_TABORT (1 << 1 )
417#define IOP13XX_ATUE_STAT_MASTER_DATA_PAR (1 << 0 )
418
419#define IOP13XX_ATUE_ESTAT_REC_UNSUPPORTED_COMP_REQ (1 << 31)
420#define IOP13XX_ATUE_ESTAT_REC_COMPLETER_ABORT (1 << 30)
421#define IOP13XX_ATUE_ESTAT_TX_POISONED_TLP (1 << 29)
422#define IOP13XX_ATUE_ESTAT_TX_PAR_ERR (1 << 28)
423#define IOP13XX_ATUE_ESTAT_REC_UNSUPPORTED_REQ (1 << 20)
424#define IOP13XX_ATUE_ESTAT_REC_ECRC_ERR (1 << 19)
425#define IOP13XX_ATUE_ESTAT_REC_MALFORMED_TLP (1 << 18)
426#define IOP13XX_ATUE_ESTAT_TX_RECEIVER_OVERFLOW (1 << 17)
427#define IOP13XX_ATUE_ESTAT_REC_UNEXPECTED_COMP (1 << 16)
428#define IOP13XX_ATUE_ESTAT_INT_COMP_ABORT (1 << 15)
429#define IOP13XX_ATUE_ESTAT_COMP_TIMEOUT (1 << 14)
430#define IOP13XX_ATUE_ESTAT_FLOW_CONTROL_ERR (1 << 13)
431#define IOP13XX_ATUE_ESTAT_REC_POISONED_TLP (1 << 12)
432#define IOP13XX_ATUE_ESTAT_DATA_LNK_ERR (1 << 4 )
433#define IOP13XX_ATUE_ESTAT_TRAINING_ERR (1 << 0 )
434
435#define IOP13XX_ATUE_IALR_DISABLE (0x00000001)
436#define IOP13XX_ATUE_OUMBAR_ENABLE (0x80000000)
437#define IOP13XX_ATU_OUMBAR_FUNC_NUM (28)
438#define IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK (0x7)
439/*=======================================================================*/
440
441/*============================MESSAGING UNIT=============================*/
442#define IOP13XX_MU_OFFSET(ofs) IOP13XX_REG_ADDR32(IOP13XX_MU_PMMR_OFFSET +\
443 (ofs))
444
445#define IOP13XX_MU_IMR0 IOP13XX_MU_OFFSET(0x10)
446#define IOP13XX_MU_IMR1 IOP13XX_MU_OFFSET(0x14)
447#define IOP13XX_MU_OMR0 IOP13XX_MU_OFFSET(0x18)
448#define IOP13XX_MU_OMR1 IOP13XX_MU_OFFSET(0x1C)
449#define IOP13XX_MU_IDR IOP13XX_MU_OFFSET(0x20)
450#define IOP13XX_MU_IISR IOP13XX_MU_OFFSET(0x24)
451#define IOP13XX_MU_IIMR IOP13XX_MU_OFFSET(0x28)
452#define IOP13XX_MU_ODR IOP13XX_MU_OFFSET(0x2C)
453#define IOP13XX_MU_OISR IOP13XX_MU_OFFSET(0x30)
454#define IOP13XX_MU_OIMR IOP13XX_MU_OFFSET(0x34)
455#define IOP13XX_MU_IRCSR IOP13XX_MU_OFFSET(0x38)
456#define IOP13XX_MU_ORCSR IOP13XX_MU_OFFSET(0x3C)
457#define IOP13XX_MU_MIMR IOP13XX_MU_OFFSET(0x48)
458#define IOP13XX_MU_MUCR IOP13XX_MU_OFFSET(0x50)
459#define IOP13XX_MU_QBAR IOP13XX_MU_OFFSET(0x54)
460#define IOP13XX_MU_MUBAR IOP13XX_MU_OFFSET(0x84)
461
462#define IOP13XX_MU_WINDOW_SIZE (8 * 1024)
463#define IOP13XX_MU_BASE_PHYS (0xff000000)
464#define IOP13XX_MU_BASE_PCI (0xff000000)
465#define IOP13XX_MU_MIMR_PCI (IOP13XX_MU_BASE_PCI + 0x48)
466#define IOP13XX_MU_MIMR_CORE_SELECT (15)
467/*=======================================================================*/
468
469/*==============================ADMA UNITS===============================*/
470#define IOP13XX_ADMA_PHYS_BASE(chan) IOP13XX_REG_ADDR32_PHYS((chan << 9))
471#define IOP13XX_ADMA_UPPER_PA(chan) (IOP13XX_ADMA_PHYS_BASE(chan) + 0xc0)
472
473/*==============================XSI BRIDGE===============================*/
474#define IOP13XX_XBG_BECSR IOP13XX_REG_ADDR32(0x178c)
475#define IOP13XX_XBG_BERAR IOP13XX_REG_ADDR32(0x1790)
476#define IOP13XX_XBG_BERUAR IOP13XX_REG_ADDR32(0x1794)
477#define is_atue_occdr_error(x) ((__raw_readl(IOP13XX_XBG_BERAR) == \
478 IOP13XX_PMMR_VIRT_TO_PHYS(\
479 IOP13XX_ATUE_OCCDR))\
480 && (__raw_readl(IOP13XX_XBG_BECSR) & 1))
481#define is_atux_occdr_error(x) ((__raw_readl(IOP13XX_XBG_BERAR) == \
482 IOP13XX_PMMR_VIRT_TO_PHYS(\
483 IOP13XX_ATUX_OCCDR))\
484 && (__raw_readl(IOP13XX_XBG_BECSR) & 1))
485/*=======================================================================*/
486
487#define IOP13XX_PBI_OFFSET(ofs) IOP13XX_REG_ADDR32(IOP13XX_PBI_PMMR_OFFSET +\
488 (ofs))
489
490#define IOP13XX_PBI_CR IOP13XX_PBI_OFFSET(0x0)
491#define IOP13XX_PBI_SR IOP13XX_PBI_OFFSET(0x4)
492#define IOP13XX_PBI_BAR0 IOP13XX_PBI_OFFSET(0x8)
493#define IOP13XX_PBI_LR0 IOP13XX_PBI_OFFSET(0xc)
494#define IOP13XX_PBI_BAR1 IOP13XX_PBI_OFFSET(0x10)
495#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14)
496
497#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180)
498
499/* Watchdog timer definitions */
500#define IOP_WDTCR_EN_ARM 0x1e1e1e1e
501#define IOP_WDTCR_EN 0xe1e1e1e1
502#define IOP_WDTCR_DIS_ARM 0x1f1f1f1f
503#define IOP_WDTCR_DIS 0xf1f1f1f1
504#define IOP_RCSR_WDT (1 << 5) /* reset caused by watchdog timer */
505#define IOP13XX_WDTSR_WRITE_EN (1 << 31) /* used to speed up reset requests */
506#define IOP13XX_WDTCR_IB_RESET (1 << 0)
507
508#endif /* _IOP13XX_HW_H_ */
diff --git a/arch/arm/mach-iop13xx/include/mach/iq81340.h b/arch/arm/mach-iop13xx/include/mach/iq81340.h
deleted file mode 100644
index d7ad27a95558..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/iq81340.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IQ81340_H_
3#define _IQ81340_H_
4
5#define IQ81340_PCE_BAR0 IOP13XX_PBI_LOWER_MEM_RA
6#define IQ81340_PCE_BAR1 (IQ81340_PCE_BAR0 + 0x02000000)
7
8#define IQ81340_FLASHBASE IQ81340_PCE_BAR0 /* Flash */
9
10#define IQ81340_PCE_BAR1_OFFSET(a) (IQ81340_PCE_BAR1 + (a))
11
12#define IQ81340_PRD_CODE IQ81340_PCE_BAR1_OFFSET(0)
13#define IQ81340_BRD_STEP IQ81340_PCE_BAR1_OFFSET(0x10000)
14#define IQ81340_CPLD_REV IQ81340_PCE_BAR1_OFFSET(0x20000)
15#define IQ81340_LED IQ81340_PCE_BAR1_OFFSET(0x30000)
16#define IQ81340_LHEX IQ81340_PCE_BAR1_OFFSET(0x40000)
17#define IQ81340_RHEX IQ81340_PCE_BAR1_OFFSET(0x50000)
18#define IQ81340_BUZZER IQ81340_PCE_BAR1_OFFSET(0x60000)
19#define IQ81340_32K_NVRAM IQ81340_PCE_BAR1_OFFSET(0x70000)
20#define IQ81340_256K_NVRAM IQ81340_PCE_BAR1_OFFSET(0x80000)
21#define IQ81340_ROTARY_SW IQ81340_PCE_BAR1_OFFSET(0xd0000)
22#define IQ81340_BATT_STAT IQ81340_PCE_BAR1_OFFSET(0xf0000)
23#define IQ81340_CMP_FLSH IQ81340_PCE_BAR1_OFFSET(0x1000000) /* 16MB */
24
25#define PBI_CF_IDE_BASE (IQ81340_CMP_FLSH)
26#define PBI_CF_BAR_ADDR (IOP13XX_PBI_BAR1)
27
28
29#endif /* _IQ81340_H_ */
diff --git a/arch/arm/mach-iop13xx/include/mach/irqs.h b/arch/arm/mach-iop13xx/include/mach/irqs.h
deleted file mode 100644
index cd6b6375c050..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/irqs.h
+++ /dev/null
@@ -1,195 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IOP13XX_IRQS_H_
3#define _IOP13XX_IRQS_H_
4
5#ifndef __ASSEMBLER__
6#include <linux/types.h>
7
8/* INTPND0 CP6 R0 Page 3
9 */
10static inline u32 read_intpnd_0(void)
11{
12 u32 val;
13 asm volatile("mrc p6, 0, %0, c0, c3, 0":"=r" (val));
14 return val;
15}
16
17/* INTPND1 CP6 R1 Page 3
18 */
19static inline u32 read_intpnd_1(void)
20{
21 u32 val;
22 asm volatile("mrc p6, 0, %0, c1, c3, 0":"=r" (val));
23 return val;
24}
25
26/* INTPND2 CP6 R2 Page 3
27 */
28static inline u32 read_intpnd_2(void)
29{
30 u32 val;
31 asm volatile("mrc p6, 0, %0, c2, c3, 0":"=r" (val));
32 return val;
33}
34
35/* INTPND3 CP6 R3 Page 3
36 */
37static inline u32 read_intpnd_3(void)
38{
39 u32 val;
40 asm volatile("mrc p6, 0, %0, c3, c3, 0":"=r" (val));
41 return val;
42}
43#endif
44
45#define INTBASE 0
46#define INTSIZE_4 1
47
48/*
49 * iop34x chipset interrupts
50 */
51#define IOP13XX_IRQ(x) (IOP13XX_IRQ_OFS + (x))
52
53/*
54 * On IRQ or FIQ register
55 */
56#define IRQ_IOP13XX_ADMA0_EOT (0)
57#define IRQ_IOP13XX_ADMA0_EOC (1)
58#define IRQ_IOP13XX_ADMA1_EOT (2)
59#define IRQ_IOP13XX_ADMA1_EOC (3)
60#define IRQ_IOP13XX_ADMA2_EOT (4)
61#define IRQ_IOP13XX_ADMA2_EOC (5)
62#define IRQ_IOP134_WATCHDOG (6)
63#define IRQ_IOP13XX_RSVD_7 (7)
64#define IRQ_IOP13XX_TIMER0 (8)
65#define IRQ_IOP13XX_TIMER1 (9)
66#define IRQ_IOP13XX_I2C_0 (10)
67#define IRQ_IOP13XX_I2C_1 (11)
68#define IRQ_IOP13XX_MSG (12)
69#define IRQ_IOP13XX_MSGIBQ (13)
70#define IRQ_IOP13XX_ATU_IM (14)
71#define IRQ_IOP13XX_ATU_BIST (15)
72#define IRQ_IOP13XX_PPMU (16)
73#define IRQ_IOP13XX_COREPMU (17)
74#define IRQ_IOP13XX_CORECACHE (18)
75#define IRQ_IOP13XX_RSVD_19 (19)
76#define IRQ_IOP13XX_RSVD_20 (20)
77#define IRQ_IOP13XX_RSVD_21 (21)
78#define IRQ_IOP13XX_RSVD_22 (22)
79#define IRQ_IOP13XX_RSVD_23 (23)
80#define IRQ_IOP13XX_XINT0 (24)
81#define IRQ_IOP13XX_XINT1 (25)
82#define IRQ_IOP13XX_XINT2 (26)
83#define IRQ_IOP13XX_XINT3 (27)
84#define IRQ_IOP13XX_XINT4 (28)
85#define IRQ_IOP13XX_XINT5 (29)
86#define IRQ_IOP13XX_XINT6 (30)
87#define IRQ_IOP13XX_XINT7 (31)
88 /* IINTSRC1 bit */
89#define IRQ_IOP13XX_XINT8 (32) /* 0 */
90#define IRQ_IOP13XX_XINT9 (33) /* 1 */
91#define IRQ_IOP13XX_XINT10 (34) /* 2 */
92#define IRQ_IOP13XX_XINT11 (35) /* 3 */
93#define IRQ_IOP13XX_XINT12 (36) /* 4 */
94#define IRQ_IOP13XX_XINT13 (37) /* 5 */
95#define IRQ_IOP13XX_XINT14 (38) /* 6 */
96#define IRQ_IOP13XX_XINT15 (39) /* 7 */
97#define IRQ_IOP13XX_RSVD_40 (40) /* 8 */
98#define IRQ_IOP13XX_RSVD_41 (41) /* 9 */
99#define IRQ_IOP13XX_RSVD_42 (42) /* 10 */
100#define IRQ_IOP13XX_RSVD_43 (43) /* 11 */
101#define IRQ_IOP13XX_RSVD_44 (44) /* 12 */
102#define IRQ_IOP13XX_RSVD_45 (45) /* 13 */
103#define IRQ_IOP13XX_RSVD_46 (46) /* 14 */
104#define IRQ_IOP13XX_RSVD_47 (47) /* 15 */
105#define IRQ_IOP13XX_RSVD_48 (48) /* 16 */
106#define IRQ_IOP13XX_RSVD_49 (49) /* 17 */
107#define IRQ_IOP13XX_RSVD_50 (50) /* 18 */
108#define IRQ_IOP13XX_UART0 (51) /* 19 */
109#define IRQ_IOP13XX_UART1 (52) /* 20 */
110#define IRQ_IOP13XX_PBIE (53) /* 21 */
111#define IRQ_IOP13XX_ATU_CRW (54) /* 22 */
112#define IRQ_IOP13XX_ATU_ERR (55) /* 23 */
113#define IRQ_IOP13XX_MCU_ERR (56) /* 24 */
114#define IRQ_IOP13XX_ADMA0_ERR (57) /* 25 */
115#define IRQ_IOP13XX_ADMA1_ERR (58) /* 26 */
116#define IRQ_IOP13XX_ADMA2_ERR (59) /* 27 */
117#define IRQ_IOP13XX_RSVD_60 (60) /* 28 */
118#define IRQ_IOP13XX_RSVD_61 (61) /* 29 */
119#define IRQ_IOP13XX_MSG_ERR (62) /* 30 */
120#define IRQ_IOP13XX_RSVD_63 (63) /* 31 */
121 /* IINTSRC2 bit */
122#define IRQ_IOP13XX_INTERPROC (64) /* 0 */
123#define IRQ_IOP13XX_RSVD_65 (65) /* 1 */
124#define IRQ_IOP13XX_RSVD_66 (66) /* 2 */
125#define IRQ_IOP13XX_RSVD_67 (67) /* 3 */
126#define IRQ_IOP13XX_RSVD_68 (68) /* 4 */
127#define IRQ_IOP13XX_RSVD_69 (69) /* 5 */
128#define IRQ_IOP13XX_RSVD_70 (70) /* 6 */
129#define IRQ_IOP13XX_RSVD_71 (71) /* 7 */
130#define IRQ_IOP13XX_RSVD_72 (72) /* 8 */
131#define IRQ_IOP13XX_RSVD_73 (73) /* 9 */
132#define IRQ_IOP13XX_RSVD_74 (74) /* 10 */
133#define IRQ_IOP13XX_RSVD_75 (75) /* 11 */
134#define IRQ_IOP13XX_RSVD_76 (76) /* 12 */
135#define IRQ_IOP13XX_RSVD_77 (77) /* 13 */
136#define IRQ_IOP13XX_RSVD_78 (78) /* 14 */
137#define IRQ_IOP13XX_RSVD_79 (79) /* 15 */
138#define IRQ_IOP13XX_RSVD_80 (80) /* 16 */
139#define IRQ_IOP13XX_RSVD_81 (81) /* 17 */
140#define IRQ_IOP13XX_RSVD_82 (82) /* 18 */
141#define IRQ_IOP13XX_RSVD_83 (83) /* 19 */
142#define IRQ_IOP13XX_RSVD_84 (84) /* 20 */
143#define IRQ_IOP13XX_RSVD_85 (85) /* 21 */
144#define IRQ_IOP13XX_RSVD_86 (86) /* 22 */
145#define IRQ_IOP13XX_RSVD_87 (87) /* 23 */
146#define IRQ_IOP13XX_RSVD_88 (88) /* 24 */
147#define IRQ_IOP13XX_RSVD_89 (89) /* 25 */
148#define IRQ_IOP13XX_RSVD_90 (90) /* 26 */
149#define IRQ_IOP13XX_RSVD_91 (91) /* 27 */
150#define IRQ_IOP13XX_RSVD_92 (92) /* 28 */
151#define IRQ_IOP13XX_RSVD_93 (93) /* 29 */
152#define IRQ_IOP13XX_SIB_ERR (94) /* 30 */
153#define IRQ_IOP13XX_SRAM_ERR (95) /* 31 */
154 /* IINTSRC3 bit */
155#define IRQ_IOP13XX_I2C_2 (96) /* 0 */
156#define IRQ_IOP13XX_ATUE_BIST (97) /* 1 */
157#define IRQ_IOP13XX_ATUE_CRW (98) /* 2 */
158#define IRQ_IOP13XX_ATUE_ERR (99) /* 3 */
159#define IRQ_IOP13XX_IMU (100) /* 4 */
160#define IRQ_IOP13XX_RSVD_101 (101) /* 5 */
161#define IRQ_IOP13XX_RSVD_102 (102) /* 6 */
162#define IRQ_IOP13XX_TPMI0_OUT (103) /* 7 */
163#define IRQ_IOP13XX_TPMI1_OUT (104) /* 8 */
164#define IRQ_IOP13XX_TPMI2_OUT (105) /* 9 */
165#define IRQ_IOP13XX_TPMI3_OUT (106) /* 10 */
166#define IRQ_IOP13XX_ATUE_IMA (107) /* 11 */
167#define IRQ_IOP13XX_ATUE_IMB (108) /* 12 */
168#define IRQ_IOP13XX_ATUE_IMC (109) /* 13 */
169#define IRQ_IOP13XX_ATUE_IMD (110) /* 14 */
170#define IRQ_IOP13XX_MU_MSI_TB (111) /* 15 */
171#define IRQ_IOP13XX_RSVD_112 (112) /* 16 */
172#define IRQ_IOP13XX_INBD_MSI (113) /* 17 */
173#define IRQ_IOP13XX_RSVD_114 (114) /* 18 */
174#define IRQ_IOP13XX_RSVD_115 (115) /* 19 */
175#define IRQ_IOP13XX_RSVD_116 (116) /* 20 */
176#define IRQ_IOP13XX_RSVD_117 (117) /* 21 */
177#define IRQ_IOP13XX_RSVD_118 (118) /* 22 */
178#define IRQ_IOP13XX_RSVD_119 (119) /* 23 */
179#define IRQ_IOP13XX_RSVD_120 (120) /* 24 */
180#define IRQ_IOP13XX_RSVD_121 (121) /* 25 */
181#define IRQ_IOP13XX_RSVD_122 (122) /* 26 */
182#define IRQ_IOP13XX_RSVD_123 (123) /* 27 */
183#define IRQ_IOP13XX_RSVD_124 (124) /* 28 */
184#define IRQ_IOP13XX_RSVD_125 (125) /* 29 */
185#define IRQ_IOP13XX_RSVD_126 (126) /* 30 */
186#define IRQ_IOP13XX_HPI (127) /* 31 */
187
188#ifdef CONFIG_PCI_MSI
189#define IRQ_IOP13XX_MSI_0 (IRQ_IOP13XX_HPI + 1)
190#define NR_IOP13XX_IRQS (IRQ_IOP13XX_MSI_0 + 128)
191#else
192#define NR_IOP13XX_IRQS (IRQ_IOP13XX_HPI + 1)
193#endif
194
195#endif /* _IOP13XX_IRQ_H_ */
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
deleted file mode 100644
index 32da0e09c6a3..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __ASM_ARCH_MEMORY_H
3#define __ASM_ARCH_MEMORY_H
4
5#include <mach/hardware.h>
6
7#ifndef __ASSEMBLY__
8
9#if defined(CONFIG_ARCH_IOP13XX)
10#define IOP13XX_PMMR_V_START (IOP13XX_PMMR_VIRT_MEM_BASE)
11#define IOP13XX_PMMR_V_END (IOP13XX_PMMR_VIRT_MEM_BASE + IOP13XX_PMMR_SIZE)
12#define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE)
13#define IOP13XX_PMMR_P_END (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE)
14
15static inline dma_addr_t __virt_to_lbus(void __iomem *x)
16{
17 return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE;
18}
19
20static inline void __iomem *__lbus_to_virt(dma_addr_t x)
21{
22 return x + IOP13XX_PMMR_VIRT_MEM_BASE - IOP13XX_PMMR_PHYS_MEM_BASE;
23}
24
25#define __is_lbus_dma(a) \
26 ((a) >= IOP13XX_PMMR_P_START && (a) < IOP13XX_PMMR_P_END)
27
28#define __is_lbus_virt(a) \
29 ((a) >= IOP13XX_PMMR_V_START && (a) < IOP13XX_PMMR_V_END)
30
31/* Device is an lbus device if it is on the platform bus of the IOP13XX */
32#define is_lbus_device(dev) \
33 (dev && strncmp(dev->bus->name, "platform", 8) == 0)
34
35#define __arch_dma_to_virt(dev, addr) \
36 ({ \
37 void * __virt; \
38 dma_addr_t __dma = addr; \
39 if (is_lbus_device(dev) && __is_lbus_dma(__dma)) \
40 __virt = __lbus_to_virt(__dma); \
41 else \
42 __virt = (void *)__phys_to_virt(__dma); \
43 __virt; \
44 })
45
46#define __arch_virt_to_dma(dev, addr) \
47 ({ \
48 void * __virt = addr; \
49 dma_addr_t __dma; \
50 if (is_lbus_device(dev) && __is_lbus_virt(__virt)) \
51 __dma = __virt_to_lbus(__virt); \
52 else \
53 __dma = __virt_to_phys((unsigned long)__virt); \
54 __dma; \
55 })
56
57#define __arch_pfn_to_dma(dev, pfn) \
58 ({ \
59 /* __is_lbus_virt() can never be true for RAM pages */ \
60 (dma_addr_t)__pfn_to_phys(pfn); \
61 })
62
63#define __arch_dma_to_pfn(dev, addr) __phys_to_pfn(addr)
64
65#endif /* CONFIG_ARCH_IOP13XX */
66#endif /* !ASSEMBLY */
67
68#endif
diff --git a/arch/arm/mach-iop13xx/include/mach/time.h b/arch/arm/mach-iop13xx/include/mach/time.h
deleted file mode 100644
index 2c2d7532d5c3..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/time.h
+++ /dev/null
@@ -1,127 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IOP13XX_TIME_H_
3#define _IOP13XX_TIME_H_
4
5#include <mach/irqs.h>
6
7#define IRQ_IOP_TIMER0 IRQ_IOP13XX_TIMER0
8
9#define IOP_TMR_EN 0x02
10#define IOP_TMR_RELOAD 0x04
11#define IOP_TMR_PRIVILEGED 0x08
12#define IOP_TMR_RATIO_1_1 0x00
13
14#define IOP13XX_XSI_FREQ_RATIO_MASK (3 << 19)
15#define IOP13XX_XSI_FREQ_RATIO_2 (0 << 19)
16#define IOP13XX_XSI_FREQ_RATIO_3 (1 << 19)
17#define IOP13XX_XSI_FREQ_RATIO_4 (2 << 19)
18#define IOP13XX_CORE_FREQ_MASK (7 << 16)
19#define IOP13XX_CORE_FREQ_600 (0 << 16)
20#define IOP13XX_CORE_FREQ_667 (1 << 16)
21#define IOP13XX_CORE_FREQ_800 (2 << 16)
22#define IOP13XX_CORE_FREQ_933 (3 << 16)
23#define IOP13XX_CORE_FREQ_1000 (4 << 16)
24#define IOP13XX_CORE_FREQ_1200 (5 << 16)
25
26void iop_init_time(unsigned long tickrate);
27
28static inline unsigned long iop13xx_core_freq(void)
29{
30 unsigned long freq = __raw_readl(IOP13XX_PROCESSOR_FREQ);
31 freq &= IOP13XX_CORE_FREQ_MASK;
32 switch (freq) {
33 case IOP13XX_CORE_FREQ_600:
34 return 600000000;
35 case IOP13XX_CORE_FREQ_667:
36 return 667000000;
37 case IOP13XX_CORE_FREQ_800:
38 return 800000000;
39 case IOP13XX_CORE_FREQ_933:
40 return 933000000;
41 case IOP13XX_CORE_FREQ_1000:
42 return 1000000000;
43 case IOP13XX_CORE_FREQ_1200:
44 return 1200000000;
45 default:
46 printk("%s: warning unknown frequency, defaulting to 800MHz\n",
47 __func__);
48 }
49
50 return 800000000;
51}
52
53static inline unsigned long iop13xx_xsi_bus_ratio(void)
54{
55 unsigned long ratio = __raw_readl(IOP13XX_PROCESSOR_FREQ);
56 ratio &= IOP13XX_XSI_FREQ_RATIO_MASK;
57 switch (ratio) {
58 case IOP13XX_XSI_FREQ_RATIO_2:
59 return 2;
60 case IOP13XX_XSI_FREQ_RATIO_3:
61 return 3;
62 case IOP13XX_XSI_FREQ_RATIO_4:
63 return 4;
64 default:
65 printk("%s: warning unknown ratio, defaulting to 2\n",
66 __func__);
67 }
68
69 return 2;
70}
71
72static inline u32 read_tmr0(void)
73{
74 u32 val;
75 asm volatile("mrc p6, 0, %0, c0, c9, 0" : "=r" (val));
76 return val;
77}
78
79static inline void write_tmr0(u32 val)
80{
81 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val));
82}
83
84static inline void write_tmr1(u32 val)
85{
86 asm volatile("mcr p6, 0, %0, c1, c9, 0" : : "r" (val));
87}
88
89static inline u32 read_tcr0(void)
90{
91 u32 val;
92 asm volatile("mrc p6, 0, %0, c2, c9, 0" : "=r" (val));
93 return val;
94}
95
96static inline void write_tcr0(u32 val)
97{
98 asm volatile("mcr p6, 0, %0, c2, c9, 0" : : "r" (val));
99}
100
101static inline u32 read_tcr1(void)
102{
103 u32 val;
104 asm volatile("mrc p6, 0, %0, c3, c9, 0" : "=r" (val));
105 return val;
106}
107
108static inline void write_tcr1(u32 val)
109{
110 asm volatile("mcr p6, 0, %0, c3, c9, 0" : : "r" (val));
111}
112
113static inline void write_trr0(u32 val)
114{
115 asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val));
116}
117
118static inline void write_trr1(u32 val)
119{
120 asm volatile("mcr p6, 0, %0, c5, c9, 0" : : "r" (val));
121}
122
123static inline void write_tisr(u32 val)
124{
125 asm volatile("mcr p6, 0, %0, c6, c9, 0" : : "r" (val));
126}
127#endif
diff --git a/arch/arm/mach-iop13xx/include/mach/uncompress.h b/arch/arm/mach-iop13xx/include/mach/uncompress.h
deleted file mode 100644
index c62903041d11..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/uncompress.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#include <asm/types.h>
3#include <linux/serial_reg.h>
4#include <mach/hardware.h>
5
6#define UART_BASE ((volatile u32 *)IOP13XX_UART1_PHYS)
7#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
8
9static inline void putc(char c)
10{
11 while ((UART_BASE[UART_LSR] & TX_DONE) != TX_DONE)
12 barrier();
13 UART_BASE[UART_TX] = c;
14}
15
16static inline void flush(void)
17{
18}
19
20/*
21 * nothing to do
22 */
23#define arch_decomp_setup()
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
deleted file mode 100644
index 253d446b1f3f..000000000000
--- a/arch/arm/mach-iop13xx/io.c
+++ /dev/null
@@ -1,77 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * iop13xx custom ioremap implementation
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6#include <linux/kernel.h>
7#include <linux/module.h>
8#include <linux/io.h>
9#include <mach/hardware.h>
10
11#include "pci.h"
12
13static void __iomem *__iop13xx_ioremap_caller(phys_addr_t cookie,
14 size_t size, unsigned int mtype, void *caller)
15{
16 void __iomem * retval;
17
18 switch (cookie) {
19 case IOP13XX_PCIX_LOWER_MEM_RA ... IOP13XX_PCIX_UPPER_MEM_RA:
20 if (unlikely(!iop13xx_atux_mem_base))
21 retval = NULL;
22 else
23 retval = (iop13xx_atux_mem_base +
24 (cookie - IOP13XX_PCIX_LOWER_MEM_RA));
25 break;
26 case IOP13XX_PCIE_LOWER_MEM_RA ... IOP13XX_PCIE_UPPER_MEM_RA:
27 if (unlikely(!iop13xx_atue_mem_base))
28 retval = NULL;
29 else
30 retval = (iop13xx_atue_mem_base +
31 (cookie - IOP13XX_PCIE_LOWER_MEM_RA));
32 break;
33 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA:
34 retval = __arm_ioremap_caller(IOP13XX_PBI_LOWER_MEM_PA +
35 (cookie - IOP13XX_PBI_LOWER_MEM_RA),
36 size, mtype, __builtin_return_address(0));
37 break;
38 case IOP13XX_PMMR_PHYS_MEM_BASE ... IOP13XX_PMMR_UPPER_MEM_PA:
39 retval = IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
40 break;
41 default:
42 retval = __arm_ioremap_caller(cookie, size, mtype,
43 caller);
44 }
45
46 return retval;
47}
48
49static void __iop13xx_iounmap(volatile void __iomem *addr)
50{
51 if (iop13xx_atue_mem_base)
52 if (addr >= (void __iomem *) iop13xx_atue_mem_base &&
53 addr < (void __iomem *) (iop13xx_atue_mem_base +
54 iop13xx_atue_mem_size))
55 goto skip;
56
57 if (iop13xx_atux_mem_base)
58 if (addr >= (void __iomem *) iop13xx_atux_mem_base &&
59 addr < (void __iomem *) (iop13xx_atux_mem_base +
60 iop13xx_atux_mem_size))
61 goto skip;
62
63 switch ((u32) addr) {
64 case (u32)IOP13XX_PMMR_VIRT_MEM_BASE ... (u32)IOP13XX_PMMR_UPPER_MEM_VA:
65 goto skip;
66 }
67 __iounmap(addr);
68
69skip:
70 return;
71}
72
73void __init iop13xx_init_early(void)
74{
75 arch_ioremap_caller = __iop13xx_ioremap_caller;
76 arch_iounmap = __iop13xx_iounmap;
77}
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
deleted file mode 100644
index b3ce5cb228cc..000000000000
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ /dev/null
@@ -1,84 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * iq81340mc board support
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6#include <linux/pci.h>
7
8#include <mach/hardware.h>
9#include <asm/irq.h>
10#include <asm/mach/pci.h>
11#include <asm/mach-types.h>
12#include <asm/mach/arch.h>
13#include "pci.h"
14#include <asm/mach/time.h>
15#include <mach/time.h>
16
17extern int init_atu; /* Flag to select which ATU(s) to initialize / disable */
18
19static int __init
20iq81340mc_pcix_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
21{
22 switch (idsel) {
23 case 1:
24 switch (pin) {
25 case 1: return ATUX_INTB;
26 case 2: return ATUX_INTC;
27 case 3: return ATUX_INTD;
28 case 4: return ATUX_INTA;
29 default: return -1;
30 }
31 case 2:
32 switch (pin) {
33 case 1: return ATUX_INTC;
34 case 2: return ATUX_INTD;
35 case 3: return ATUX_INTC;
36 case 4: return ATUX_INTD;
37 default: return -1;
38 }
39 default: return -1;
40 }
41}
42
43static struct hw_pci iq81340mc_pci __initdata = {
44 .nr_controllers = 0,
45 .setup = iop13xx_pci_setup,
46 .map_irq = iq81340mc_pcix_map_irq,
47 .scan = iop13xx_scan_bus,
48 .preinit = iop13xx_pci_init,
49};
50
51static int __init iq81340mc_pci_init(void)
52{
53 iop13xx_atu_select(&iq81340mc_pci);
54 pci_common_init(&iq81340mc_pci);
55 iop13xx_map_pci_memory();
56
57 return 0;
58}
59
60static void __init iq81340mc_init(void)
61{
62 iop13xx_platform_init();
63 iq81340mc_pci_init();
64 iop13xx_add_tpmi_devices();
65}
66
67static void __init iq81340mc_timer_init(void)
68{
69 unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
70 printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);
71 iop_init_time(bus_freq);
72}
73
74MACHINE_START(IQ81340MC, "Intel IQ81340MC")
75 /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
76 .atag_offset = 0x100,
77 .init_early = iop13xx_init_early,
78 .map_io = iop13xx_map_io,
79 .init_irq = iop13xx_init_irq,
80 .init_time = iq81340mc_timer_init,
81 .init_machine = iq81340mc_init,
82 .restart = iop13xx_restart,
83 .nr_irqs = NR_IOP13XX_IRQS,
84MACHINE_END
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
deleted file mode 100644
index 123845dcf2d3..000000000000
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ /dev/null
@@ -1,86 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * iq81340sc board support
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6#include <linux/pci.h>
7
8#include <mach/hardware.h>
9#include <asm/irq.h>
10#include <asm/mach/pci.h>
11#include <asm/mach-types.h>
12#include <asm/mach/arch.h>
13#include "pci.h"
14#include <asm/mach/time.h>
15#include <mach/time.h>
16
17extern int init_atu;
18
19static int __init
20iq81340sc_atux_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
21{
22 WARN_ON(idsel < 1 || idsel > 2);
23
24 switch (idsel) {
25 case 1:
26 switch (pin) {
27 case 1: return ATUX_INTB;
28 case 2: return ATUX_INTC;
29 case 3: return ATUX_INTD;
30 case 4: return ATUX_INTA;
31 default: return -1;
32 }
33 case 2:
34 switch (pin) {
35 case 1: return ATUX_INTC;
36 case 2: return ATUX_INTC;
37 case 3: return ATUX_INTC;
38 case 4: return ATUX_INTC;
39 default: return -1;
40 }
41 default: return -1;
42 }
43}
44
45static struct hw_pci iq81340sc_pci __initdata = {
46 .nr_controllers = 0,
47 .setup = iop13xx_pci_setup,
48 .scan = iop13xx_scan_bus,
49 .map_irq = iq81340sc_atux_map_irq,
50 .preinit = iop13xx_pci_init
51};
52
53static int __init iq81340sc_pci_init(void)
54{
55 iop13xx_atu_select(&iq81340sc_pci);
56 pci_common_init(&iq81340sc_pci);
57 iop13xx_map_pci_memory();
58
59 return 0;
60}
61
62static void __init iq81340sc_init(void)
63{
64 iop13xx_platform_init();
65 iq81340sc_pci_init();
66 iop13xx_add_tpmi_devices();
67}
68
69static void __init iq81340sc_timer_init(void)
70{
71 unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
72 printk(KERN_DEBUG "%s: bus frequency: %lu\n", __func__, bus_freq);
73 iop_init_time(bus_freq);
74}
75
76MACHINE_START(IQ81340SC, "Intel IQ81340SC")
77 /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
78 .atag_offset = 0x100,
79 .init_early = iop13xx_init_early,
80 .map_io = iop13xx_map_io,
81 .init_irq = iop13xx_init_irq,
82 .init_time = iq81340sc_timer_init,
83 .init_machine = iq81340sc_init,
84 .restart = iop13xx_restart,
85 .nr_irqs = NR_IOP13XX_IRQS,
86MACHINE_END
diff --git a/arch/arm/mach-iop13xx/irq.c b/arch/arm/mach-iop13xx/irq.c
deleted file mode 100644
index 0e24ba7a1309..000000000000
--- a/arch/arm/mach-iop13xx/irq.c
+++ /dev/null
@@ -1,227 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * iop13xx IRQ handling / support functions
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6#include <linux/init.h>
7#include <linux/interrupt.h>
8#include <linux/list.h>
9#include <linux/sysctl.h>
10#include <linux/uaccess.h>
11#include <asm/mach/irq.h>
12#include <asm/irq.h>
13#include <mach/hardware.h>
14#include <mach/irqs.h>
15#include "msi.h"
16
17/* INTCTL0 CP6 R0 Page 4
18 */
19static u32 read_intctl_0(void)
20{
21 u32 val;
22 asm volatile("mrc p6, 0, %0, c0, c4, 0":"=r" (val));
23 return val;
24}
25static void write_intctl_0(u32 val)
26{
27 asm volatile("mcr p6, 0, %0, c0, c4, 0"::"r" (val));
28}
29
30/* INTCTL1 CP6 R1 Page 4
31 */
32static u32 read_intctl_1(void)
33{
34 u32 val;
35 asm volatile("mrc p6, 0, %0, c1, c4, 0":"=r" (val));
36 return val;
37}
38static void write_intctl_1(u32 val)
39{
40 asm volatile("mcr p6, 0, %0, c1, c4, 0"::"r" (val));
41}
42
43/* INTCTL2 CP6 R2 Page 4
44 */
45static u32 read_intctl_2(void)
46{
47 u32 val;
48 asm volatile("mrc p6, 0, %0, c2, c4, 0":"=r" (val));
49 return val;
50}
51static void write_intctl_2(u32 val)
52{
53 asm volatile("mcr p6, 0, %0, c2, c4, 0"::"r" (val));
54}
55
56/* INTCTL3 CP6 R3 Page 4
57 */
58static u32 read_intctl_3(void)
59{
60 u32 val;
61 asm volatile("mrc p6, 0, %0, c3, c4, 0":"=r" (val));
62 return val;
63}
64static void write_intctl_3(u32 val)
65{
66 asm volatile("mcr p6, 0, %0, c3, c4, 0"::"r" (val));
67}
68
69/* INTSTR0 CP6 R0 Page 5
70 */
71static void write_intstr_0(u32 val)
72{
73 asm volatile("mcr p6, 0, %0, c0, c5, 0"::"r" (val));
74}
75
76/* INTSTR1 CP6 R1 Page 5
77 */
78static void write_intstr_1(u32 val)
79{
80 asm volatile("mcr p6, 0, %0, c1, c5, 0"::"r" (val));
81}
82
83/* INTSTR2 CP6 R2 Page 5
84 */
85static void write_intstr_2(u32 val)
86{
87 asm volatile("mcr p6, 0, %0, c2, c5, 0"::"r" (val));
88}
89
90/* INTSTR3 CP6 R3 Page 5
91 */
92static void write_intstr_3(u32 val)
93{
94 asm volatile("mcr p6, 0, %0, c3, c5, 0"::"r" (val));
95}
96
97/* INTBASE CP6 R0 Page 2
98 */
99static void write_intbase(u32 val)
100{
101 asm volatile("mcr p6, 0, %0, c0, c2, 0"::"r" (val));
102}
103
104/* INTSIZE CP6 R2 Page 2
105 */
106static void write_intsize(u32 val)
107{
108 asm volatile("mcr p6, 0, %0, c2, c2, 0"::"r" (val));
109}
110
111/* 0 = Interrupt Masked and 1 = Interrupt not masked */
112static void
113iop13xx_irq_mask0 (struct irq_data *d)
114{
115 write_intctl_0(read_intctl_0() & ~(1 << (d->irq - 0)));
116}
117
118static void
119iop13xx_irq_mask1 (struct irq_data *d)
120{
121 write_intctl_1(read_intctl_1() & ~(1 << (d->irq - 32)));
122}
123
124static void
125iop13xx_irq_mask2 (struct irq_data *d)
126{
127 write_intctl_2(read_intctl_2() & ~(1 << (d->irq - 64)));
128}
129
130static void
131iop13xx_irq_mask3 (struct irq_data *d)
132{
133 write_intctl_3(read_intctl_3() & ~(1 << (d->irq - 96)));
134}
135
136static void
137iop13xx_irq_unmask0(struct irq_data *d)
138{
139 write_intctl_0(read_intctl_0() | (1 << (d->irq - 0)));
140}
141
142static void
143iop13xx_irq_unmask1(struct irq_data *d)
144{
145 write_intctl_1(read_intctl_1() | (1 << (d->irq - 32)));
146}
147
148static void
149iop13xx_irq_unmask2(struct irq_data *d)
150{
151 write_intctl_2(read_intctl_2() | (1 << (d->irq - 64)));
152}
153
154static void
155iop13xx_irq_unmask3(struct irq_data *d)
156{
157 write_intctl_3(read_intctl_3() | (1 << (d->irq - 96)));
158}
159
160static struct irq_chip iop13xx_irqchip1 = {
161 .name = "IOP13xx-1",
162 .irq_ack = iop13xx_irq_mask0,
163 .irq_mask = iop13xx_irq_mask0,
164 .irq_unmask = iop13xx_irq_unmask0,
165};
166
167static struct irq_chip iop13xx_irqchip2 = {
168 .name = "IOP13xx-2",
169 .irq_ack = iop13xx_irq_mask1,
170 .irq_mask = iop13xx_irq_mask1,
171 .irq_unmask = iop13xx_irq_unmask1,
172};
173
174static struct irq_chip iop13xx_irqchip3 = {
175 .name = "IOP13xx-3",
176 .irq_ack = iop13xx_irq_mask2,
177 .irq_mask = iop13xx_irq_mask2,
178 .irq_unmask = iop13xx_irq_unmask2,
179};
180
181static struct irq_chip iop13xx_irqchip4 = {
182 .name = "IOP13xx-4",
183 .irq_ack = iop13xx_irq_mask3,
184 .irq_mask = iop13xx_irq_mask3,
185 .irq_unmask = iop13xx_irq_unmask3,
186};
187
188extern void iop_init_cp6_handler(void);
189
190void __init iop13xx_init_irq(void)
191{
192 unsigned int i;
193
194 iop_init_cp6_handler();
195
196 /* disable all interrupts */
197 write_intctl_0(0);
198 write_intctl_1(0);
199 write_intctl_2(0);
200 write_intctl_3(0);
201
202 /* treat all as IRQ */
203 write_intstr_0(0);
204 write_intstr_1(0);
205 write_intstr_2(0);
206 write_intstr_3(0);
207
208 /* initialize the interrupt vector generator */
209 write_intbase(INTBASE);
210 write_intsize(INTSIZE_4);
211
212 for(i = 0; i <= IRQ_IOP13XX_HPI; i++) {
213 if (i < 32)
214 irq_set_chip(i, &iop13xx_irqchip1);
215 else if (i < 64)
216 irq_set_chip(i, &iop13xx_irqchip2);
217 else if (i < 96)
218 irq_set_chip(i, &iop13xx_irqchip3);
219 else
220 irq_set_chip(i, &iop13xx_irqchip4);
221
222 irq_set_handler(i, handle_level_irq);
223 irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
224 }
225
226 iop13xx_msi_init();
227}
diff --git a/arch/arm/mach-iop13xx/msi.c b/arch/arm/mach-iop13xx/msi.c
deleted file mode 100644
index f4d70cba1dd1..000000000000
--- a/arch/arm/mach-iop13xx/msi.c
+++ /dev/null
@@ -1,152 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * arch/arm/mach-iop13xx/msi.c
4 *
5 * PCI MSI support for the iop13xx processor
6 *
7 * Copyright (c) 2006, Intel Corporation.
8 */
9#include <linux/pci.h>
10#include <linux/msi.h>
11#include <asm/mach/irq.h>
12#include <asm/irq.h>
13#include <mach/irqs.h>
14
15/* IMIPR0 CP6 R8 Page 1
16 */
17static u32 read_imipr_0(void)
18{
19 u32 val;
20 asm volatile("mrc p6, 0, %0, c8, c1, 0":"=r" (val));
21 return val;
22}
23static void write_imipr_0(u32 val)
24{
25 asm volatile("mcr p6, 0, %0, c8, c1, 0"::"r" (val));
26}
27
28/* IMIPR1 CP6 R9 Page 1
29 */
30static u32 read_imipr_1(void)
31{
32 u32 val;
33 asm volatile("mrc p6, 0, %0, c9, c1, 0":"=r" (val));
34 return val;
35}
36static void write_imipr_1(u32 val)
37{
38 asm volatile("mcr p6, 0, %0, c9, c1, 0"::"r" (val));
39}
40
41/* IMIPR2 CP6 R10 Page 1
42 */
43static u32 read_imipr_2(void)
44{
45 u32 val;
46 asm volatile("mrc p6, 0, %0, c10, c1, 0":"=r" (val));
47 return val;
48}
49static void write_imipr_2(u32 val)
50{
51 asm volatile("mcr p6, 0, %0, c10, c1, 0"::"r" (val));
52}
53
54/* IMIPR3 CP6 R11 Page 1
55 */
56static u32 read_imipr_3(void)
57{
58 u32 val;
59 asm volatile("mrc p6, 0, %0, c11, c1, 0":"=r" (val));
60 return val;
61}
62static void write_imipr_3(u32 val)
63{
64 asm volatile("mcr p6, 0, %0, c11, c1, 0"::"r" (val));
65}
66
67static u32 (*read_imipr[])(void) = {
68 read_imipr_0,
69 read_imipr_1,
70 read_imipr_2,
71 read_imipr_3,
72};
73
74static void (*write_imipr[])(u32) = {
75 write_imipr_0,
76 write_imipr_1,
77 write_imipr_2,
78 write_imipr_3,
79};
80
81static void iop13xx_msi_handler(struct irq_desc *desc)
82{
83 int i, j;
84 unsigned long status;
85
86 /* read IMIPR registers and find any active interrupts,
87 * then call ISR for each active interrupt
88 */
89 for (i = 0; i < ARRAY_SIZE(read_imipr); i++) {
90 status = (read_imipr[i])();
91 if (!status)
92 continue;
93
94 do {
95 j = find_first_bit(&status, 32);
96 (write_imipr[i])(1 << j); /* write back to clear bit */
97 generic_handle_irq(IRQ_IOP13XX_MSI_0 + j + (32*i));
98 status = (read_imipr[i])();
99 } while (status);
100 }
101}
102
103void __init iop13xx_msi_init(void)
104{
105 irq_set_chained_handler(IRQ_IOP13XX_INBD_MSI, iop13xx_msi_handler);
106}
107
108static void iop13xx_msi_nop(struct irq_data *d)
109{
110 return;
111}
112
113static struct irq_chip iop13xx_msi_chip = {
114 .name = "PCI-MSI",
115 .irq_ack = iop13xx_msi_nop,
116 .irq_enable = pci_msi_unmask_irq,
117 .irq_disable = pci_msi_mask_irq,
118 .irq_mask = pci_msi_mask_irq,
119 .irq_unmask = pci_msi_unmask_irq,
120};
121
122int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
123{
124 int id, irq = irq_alloc_desc_from(IRQ_IOP13XX_MSI_0, -1);
125 struct msi_msg msg;
126
127 if (irq < 0)
128 return irq;
129
130 if (irq >= NR_IOP13XX_IRQS) {
131 irq_free_desc(irq);
132 return -ENOSPC;
133 }
134
135 irq_set_msi_desc(irq, desc);
136
137 msg.address_hi = 0x0;
138 msg.address_lo = IOP13XX_MU_MIMR_PCI;
139
140 id = iop13xx_cpu_id();
141 msg.data = (id << IOP13XX_MU_MIMR_CORE_SELECT) | (irq & 0x7f);
142
143 pci_write_msi_msg(irq, &msg);
144 irq_set_chip_and_handler(irq, &iop13xx_msi_chip, handle_simple_irq);
145
146 return 0;
147}
148
149void arch_teardown_msi_irq(unsigned int irq)
150{
151 irq_free_desc(irq);
152}
diff --git a/arch/arm/mach-iop13xx/msi.h b/arch/arm/mach-iop13xx/msi.h
deleted file mode 100644
index 766dcfaaa353..000000000000
--- a/arch/arm/mach-iop13xx/msi.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IOP13XX_MSI_H_
3#define _IOP13XX_MSI_H_
4#ifdef CONFIG_PCI_MSI
5void iop13xx_msi_init(void);
6#else
7static inline void iop13xx_msi_init(void)
8{
9 return;
10}
11#endif
12#endif
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
deleted file mode 100644
index 46ea06e906cc..000000000000
--- a/arch/arm/mach-iop13xx/pci.c
+++ /dev/null
@@ -1,1115 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * iop13xx PCI support
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6
7#include <linux/pci.h>
8#include <linux/slab.h>
9#include <linux/delay.h>
10#include <linux/jiffies.h>
11#include <linux/export.h>
12#include <asm/irq.h>
13#include <mach/hardware.h>
14#include <linux/sizes.h>
15#include <asm/signal.h>
16#include <asm/mach/pci.h>
17#include "pci.h"
18
19#define IOP13XX_PCI_DEBUG 0
20#define PRINTK(x...) ((void)(IOP13XX_PCI_DEBUG && printk(x)))
21
22u32 iop13xx_atux_pmmr_offset; /* This offset can change based on strapping */
23u32 iop13xx_atue_pmmr_offset; /* This offset can change based on strapping */
24static struct pci_bus *pci_bus_atux = 0;
25static struct pci_bus *pci_bus_atue = 0;
26void __iomem *iop13xx_atue_mem_base;
27void __iomem *iop13xx_atux_mem_base;
28size_t iop13xx_atue_mem_size;
29size_t iop13xx_atux_mem_size;
30
31EXPORT_SYMBOL(iop13xx_atue_mem_base);
32EXPORT_SYMBOL(iop13xx_atux_mem_base);
33EXPORT_SYMBOL(iop13xx_atue_mem_size);
34EXPORT_SYMBOL(iop13xx_atux_mem_size);
35
36int init_atu = 0; /* Flag to select which ATU(s) to initialize / disable */
37static unsigned long atux_trhfa_timeout = 0; /* Trhfa = RST# high to first
38 access */
39
40/* Scan the initialized busses and ioremap the requested memory range
41 */
42void iop13xx_map_pci_memory(void)
43{
44 int atu;
45 struct pci_bus *bus;
46 struct pci_dev *dev;
47 resource_size_t end = 0;
48
49 for (atu = 0; atu < 2; atu++) {
50 bus = atu ? pci_bus_atue : pci_bus_atux;
51 if (bus) {
52 list_for_each_entry(dev, &bus->devices, bus_list) {
53 int i;
54 int max = 7;
55
56 if (dev->subordinate)
57 max = DEVICE_COUNT_RESOURCE;
58
59 for (i = 0; i < max; i++) {
60 struct resource *res = &dev->resource[i];
61 if (res->flags & IORESOURCE_MEM)
62 end = max(res->end, end);
63 }
64 }
65
66 switch(atu) {
67 case 0:
68 iop13xx_atux_mem_size =
69 (end - IOP13XX_PCIX_LOWER_MEM_RA) + 1;
70
71 /* 16MB align the request */
72 if (iop13xx_atux_mem_size & (SZ_16M - 1)) {
73 iop13xx_atux_mem_size &= ~(SZ_16M - 1);
74 iop13xx_atux_mem_size += SZ_16M;
75 }
76
77 if (end) {
78 iop13xx_atux_mem_base = __arm_ioremap_pfn(
79 __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA)
80 , 0, iop13xx_atux_mem_size, MT_DEVICE);
81 if (!iop13xx_atux_mem_base) {
82 printk("%s: atux allocation "
83 "failed\n", __func__);
84 BUG();
85 }
86 } else
87 iop13xx_atux_mem_size = 0;
88 PRINTK("%s: atu: %d bus_size: %d mem_base: %p\n",
89 __func__, atu, iop13xx_atux_mem_size,
90 iop13xx_atux_mem_base);
91 break;
92 case 1:
93 iop13xx_atue_mem_size =
94 (end - IOP13XX_PCIE_LOWER_MEM_RA) + 1;
95
96 /* 16MB align the request */
97 if (iop13xx_atue_mem_size & (SZ_16M - 1)) {
98 iop13xx_atue_mem_size &= ~(SZ_16M - 1);
99 iop13xx_atue_mem_size += SZ_16M;
100 }
101
102 if (end) {
103 iop13xx_atue_mem_base = __arm_ioremap_pfn(
104 __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA)
105 , 0, iop13xx_atue_mem_size, MT_DEVICE);
106 if (!iop13xx_atue_mem_base) {
107 printk("%s: atue allocation "
108 "failed\n", __func__);
109 BUG();
110 }
111 } else
112 iop13xx_atue_mem_size = 0;
113 PRINTK("%s: atu: %d bus_size: %d mem_base: %p\n",
114 __func__, atu, iop13xx_atue_mem_size,
115 iop13xx_atue_mem_base);
116 break;
117 }
118
119 printk("%s: Initialized (%uM @ resource/virtual: %08lx/%p)\n",
120 atu ? "ATUE" : "ATUX",
121 (atu ? iop13xx_atue_mem_size : iop13xx_atux_mem_size) /
122 SZ_1M,
123 atu ? IOP13XX_PCIE_LOWER_MEM_RA :
124 IOP13XX_PCIX_LOWER_MEM_RA,
125 atu ? iop13xx_atue_mem_base :
126 iop13xx_atux_mem_base);
127 end = 0;
128 }
129
130 }
131}
132
133static int iop13xx_atu_function(int atu)
134{
135 int func = 0;
136 /* the function number depends on the value of the
137 * IOP13XX_INTERFACE_SEL_PCIX reset strap
138 * see C-Spec section 3.17
139 */
140 switch(atu) {
141 case IOP13XX_INIT_ATU_ATUX:
142 if (__raw_readl(IOP13XX_ESSR0) & IOP13XX_INTERFACE_SEL_PCIX)
143 func = 5;
144 else
145 func = 0;
146 break;
147 case IOP13XX_INIT_ATU_ATUE:
148 if (__raw_readl(IOP13XX_ESSR0) & IOP13XX_INTERFACE_SEL_PCIX)
149 func = 0;
150 else
151 func = 5;
152 break;
153 default:
154 BUG();
155 }
156
157 return func;
158}
159
160/* iop13xx_atux_cfg_address - format a configuration address for atux
161 * @bus: Target bus to access
162 * @devfn: Combined device number and function number
163 * @where: Desired register's address offset
164 *
165 * Convert the parameters to a configuration address formatted
166 * according the PCI-X 2.0 specification
167 */
168static u32 iop13xx_atux_cfg_address(struct pci_bus *bus, int devfn, int where)
169{
170 struct pci_sys_data *sys = bus->sysdata;
171 u32 addr;
172
173 if (sys->busnr == bus->number)
174 addr = 1 << (PCI_SLOT(devfn) + 16) | (PCI_SLOT(devfn) << 11);
175 else
176 addr = bus->number << 16 | PCI_SLOT(devfn) << 11 | 1;
177
178 addr |= PCI_FUNC(devfn) << 8 | ((where & 0xff) & ~3);
179 addr |= ((where & 0xf00) >> 8) << 24; /* upper register number */
180
181 return addr;
182}
183
184/* iop13xx_atue_cfg_address - format a configuration address for atue
185 * @bus: Target bus to access
186 * @devfn: Combined device number and function number
187 * @where: Desired register's address offset
188 *
189 * Convert the parameters to an address usable by the ATUE_OCCAR
190 */
191static u32 iop13xx_atue_cfg_address(struct pci_bus *bus, int devfn, int where)
192{
193 struct pci_sys_data *sys = bus->sysdata;
194 u32 addr;
195
196 PRINTK("iop13xx_atue_cfg_address: bus: %d dev: %d func: %d",
197 bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
198 addr = ((u32) bus->number) << IOP13XX_ATUE_OCCAR_BUS_NUM |
199 ((u32) PCI_SLOT(devfn)) << IOP13XX_ATUE_OCCAR_DEV_NUM |
200 ((u32) PCI_FUNC(devfn)) << IOP13XX_ATUE_OCCAR_FUNC_NUM |
201 (where & ~0x3);
202
203 if (sys->busnr != bus->number)
204 addr |= 1; /* type 1 access */
205
206 return addr;
207}
208
209/* This routine checks the status of the last configuration cycle. If an error
210 * was detected it returns >0, else it returns a 0. The errors being checked
211 * are parity, master abort, target abort (master and target). These types of
212 * errors occur during a config cycle where there is no device, like during
213 * the discovery stage.
214 */
215static int iop13xx_atux_pci_status(int clear)
216{
217 unsigned int status;
218 int err = 0;
219
220 /*
221 * Check the status registers.
222 */
223 status = __raw_readw(IOP13XX_ATUX_ATUSR);
224 if (status & IOP_PCI_STATUS_ERROR)
225 {
226 PRINTK("\t\t\tPCI error: ATUSR %#08x", status);
227 if(clear)
228 __raw_writew(status & IOP_PCI_STATUS_ERROR,
229 IOP13XX_ATUX_ATUSR);
230 err = 1;
231 }
232 status = __raw_readl(IOP13XX_ATUX_ATUISR);
233 if (status & IOP13XX_ATUX_ATUISR_ERROR)
234 {
235 PRINTK("\t\t\tPCI error interrupt: ATUISR %#08x", status);
236 if(clear)
237 __raw_writel(status & IOP13XX_ATUX_ATUISR_ERROR,
238 IOP13XX_ATUX_ATUISR);
239 err = 1;
240 }
241 return err;
242}
243
244/* Simply write the address register and read the configuration
245 * data. Note that the data dependency on %0 encourages an abort
246 * to be detected before we return.
247 */
248static u32 iop13xx_atux_read(unsigned long addr)
249{
250 u32 val;
251
252 __asm__ __volatile__(
253 "str %1, [%2]\n\t"
254 "ldr %0, [%3]\n\t"
255 "mov %0, %0\n\t"
256 : "=r" (val)
257 : "r" (addr), "r" (IOP13XX_ATUX_OCCAR), "r" (IOP13XX_ATUX_OCCDR));
258
259 return val;
260}
261
262/* The read routines must check the error status of the last configuration
263 * cycle. If there was an error, the routine returns all hex f's.
264 */
265static int
266iop13xx_atux_read_config(struct pci_bus *bus, unsigned int devfn, int where,
267 int size, u32 *value)
268{
269 unsigned long addr = iop13xx_atux_cfg_address(bus, devfn, where);
270 u32 val = iop13xx_atux_read(addr) >> ((where & 3) * 8);
271
272 if (iop13xx_atux_pci_status(1) || is_atux_occdr_error()) {
273 __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3,
274 IOP13XX_XBG_BECSR);
275 val = 0xffffffff;
276 }
277
278 *value = val;
279
280 return PCIBIOS_SUCCESSFUL;
281}
282
283static int
284iop13xx_atux_write_config(struct pci_bus *bus, unsigned int devfn, int where,
285 int size, u32 value)
286{
287 unsigned long addr = iop13xx_atux_cfg_address(bus, devfn, where);
288 u32 val;
289
290 if (size != 4) {
291 val = iop13xx_atux_read(addr);
292 if (!iop13xx_atux_pci_status(1) == 0)
293 return PCIBIOS_SUCCESSFUL;
294
295 where = (where & 3) * 8;
296
297 if (size == 1)
298 val &= ~(0xff << where);
299 else
300 val &= ~(0xffff << where);
301
302 __raw_writel(val | value << where, IOP13XX_ATUX_OCCDR);
303 } else {
304 __raw_writel(addr, IOP13XX_ATUX_OCCAR);
305 __raw_writel(value, IOP13XX_ATUX_OCCDR);
306 }
307
308 return PCIBIOS_SUCCESSFUL;
309}
310
311static struct pci_ops iop13xx_atux_ops = {
312 .read = iop13xx_atux_read_config,
313 .write = iop13xx_atux_write_config,
314};
315
316/* This routine checks the status of the last configuration cycle. If an error
317 * was detected it returns >0, else it returns a 0. The errors being checked
318 * are parity, master abort, target abort (master and target). These types of
319 * errors occur during a config cycle where there is no device, like during
320 * the discovery stage.
321 */
322static int iop13xx_atue_pci_status(int clear)
323{
324 unsigned int status;
325 int err = 0;
326
327 /*
328 * Check the status registers.
329 */
330
331 /* standard pci status register */
332 status = __raw_readw(IOP13XX_ATUE_ATUSR);
333 if (status & IOP_PCI_STATUS_ERROR) {
334 PRINTK("\t\t\tPCI error: ATUSR %#08x", status);
335 if(clear)
336 __raw_writew(status & IOP_PCI_STATUS_ERROR,
337 IOP13XX_ATUE_ATUSR);
338 err++;
339 }
340
341 /* check the normal status bits in the ATUISR */
342 status = __raw_readl(IOP13XX_ATUE_ATUISR);
343 if (status & IOP13XX_ATUE_ATUISR_ERROR) {
344 PRINTK("\t\t\tPCI error: ATUISR %#08x", status);
345 if (clear)
346 __raw_writew(status & IOP13XX_ATUE_ATUISR_ERROR,
347 IOP13XX_ATUE_ATUISR);
348 err++;
349
350 /* check the PCI-E status if the ATUISR reports an interface error */
351 if (status & IOP13XX_ATUE_STAT_PCI_IFACE_ERR) {
352 /* get the unmasked errors */
353 status = __raw_readl(IOP13XX_ATUE_PIE_STS) &
354 ~(__raw_readl(IOP13XX_ATUE_PIE_MSK));
355
356 if (status) {
357 PRINTK("\t\t\tPCI-E error: ATUE_PIE_STS %#08x",
358 __raw_readl(IOP13XX_ATUE_PIE_STS));
359 err++;
360 } else {
361 PRINTK("\t\t\tPCI-E error: ATUE_PIE_STS %#08x",
362 __raw_readl(IOP13XX_ATUE_PIE_STS));
363 PRINTK("\t\t\tPCI-E error: ATUE_PIE_MSK %#08x",
364 __raw_readl(IOP13XX_ATUE_PIE_MSK));
365 BUG();
366 }
367
368 if(clear)
369 __raw_writel(status, IOP13XX_ATUE_PIE_STS);
370 }
371 }
372
373 return err;
374}
375
376static int
377iop13xx_pcie_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
378{
379 WARN_ON(idsel != 0);
380
381 switch (pin) {
382 case 1: return ATUE_INTA;
383 case 2: return ATUE_INTB;
384 case 3: return ATUE_INTC;
385 case 4: return ATUE_INTD;
386 default: return -1;
387 }
388}
389
390static u32 iop13xx_atue_read(unsigned long addr)
391{
392 u32 val;
393
394 __raw_writel(addr, IOP13XX_ATUE_OCCAR);
395 val = __raw_readl(IOP13XX_ATUE_OCCDR);
396
397 rmb();
398
399 return val;
400}
401
402/* The read routines must check the error status of the last configuration
403 * cycle. If there was an error, the routine returns all hex f's.
404 */
405static int
406iop13xx_atue_read_config(struct pci_bus *bus, unsigned int devfn, int where,
407 int size, u32 *value)
408{
409 u32 val;
410 unsigned long addr = iop13xx_atue_cfg_address(bus, devfn, where);
411
412 /* Hide device numbers > 0 on the local PCI-E bus (Type 0 access) */
413 if (!PCI_SLOT(devfn) || (addr & 1)) {
414 val = iop13xx_atue_read(addr) >> ((where & 3) * 8);
415 if( iop13xx_atue_pci_status(1) || is_atue_occdr_error() ) {
416 __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3,
417 IOP13XX_XBG_BECSR);
418 val = 0xffffffff;
419 }
420
421 PRINTK("addr=%#0lx, val=%#010x", addr, val);
422 } else
423 val = 0xffffffff;
424
425 *value = val;
426
427 return PCIBIOS_SUCCESSFUL;
428}
429
430static int
431iop13xx_atue_write_config(struct pci_bus *bus, unsigned int devfn, int where,
432 int size, u32 value)
433{
434 unsigned long addr = iop13xx_atue_cfg_address(bus, devfn, where);
435 u32 val;
436
437 if (size != 4) {
438 val = iop13xx_atue_read(addr);
439 if (!iop13xx_atue_pci_status(1) == 0)
440 return PCIBIOS_SUCCESSFUL;
441
442 where = (where & 3) * 8;
443
444 if (size == 1)
445 val &= ~(0xff << where);
446 else
447 val &= ~(0xffff << where);
448
449 __raw_writel(val | value << where, IOP13XX_ATUE_OCCDR);
450 } else {
451 __raw_writel(addr, IOP13XX_ATUE_OCCAR);
452 __raw_writel(value, IOP13XX_ATUE_OCCDR);
453 }
454
455 return PCIBIOS_SUCCESSFUL;
456}
457
458static struct pci_ops iop13xx_atue_ops = {
459 .read = iop13xx_atue_read_config,
460 .write = iop13xx_atue_write_config,
461};
462
463/* When a PCI device does not exist during config cycles, the XScale gets a
464 * bus error instead of returning 0xffffffff. We can't rely on the ATU status
465 * bits to tell us that it was indeed a configuration cycle that caused this
466 * error especially in the case when the ATUE link is down. Instead we rely
467 * on data from the south XSI bridge to validate the abort
468 */
469int
470iop13xx_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
471{
472 PRINTK("Data abort: address = 0x%08lx "
473 "fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx",
474 addr, fsr, regs->ARM_pc, regs->ARM_lr);
475
476 PRINTK("IOP13XX_XBG_BECSR: %#10x", __raw_readl(IOP13XX_XBG_BECSR));
477 PRINTK("IOP13XX_XBG_BERAR: %#10x", __raw_readl(IOP13XX_XBG_BERAR));
478 PRINTK("IOP13XX_XBG_BERUAR: %#10x", __raw_readl(IOP13XX_XBG_BERUAR));
479
480 /* If it was an imprecise abort, then we need to correct the
481 * return address to be _after_ the instruction.
482 */
483 if (fsr & (1 << 10))
484 regs->ARM_pc += 4;
485
486 if (is_atue_occdr_error() || is_atux_occdr_error())
487 return 0;
488 else
489 return 1;
490}
491
492/* Scan an IOP13XX PCI bus. nr selects which ATU we use.
493 */
494int iop13xx_scan_bus(int nr, struct pci_host_bridge *bridge)
495{
496 int which_atu, ret;
497 struct pci_sys_data *sys = pci_host_bridge_priv(bridge);
498
499 switch (init_atu) {
500 case IOP13XX_INIT_ATU_ATUX:
501 which_atu = nr ? 0 : IOP13XX_INIT_ATU_ATUX;
502 break;
503 case IOP13XX_INIT_ATU_ATUE:
504 which_atu = nr ? 0 : IOP13XX_INIT_ATU_ATUE;
505 break;
506 case (IOP13XX_INIT_ATU_ATUX | IOP13XX_INIT_ATU_ATUE):
507 which_atu = nr ? IOP13XX_INIT_ATU_ATUE : IOP13XX_INIT_ATU_ATUX;
508 break;
509 default:
510 which_atu = 0;
511 }
512
513 if (!which_atu) {
514 BUG();
515 return -ENODEV;
516 }
517
518 list_splice_init(&sys->resources, &bridge->windows);
519 bridge->dev.parent = NULL;
520 bridge->sysdata = sys;
521 bridge->busnr = sys->busnr;
522
523 switch (which_atu) {
524 case IOP13XX_INIT_ATU_ATUX:
525 if (time_after_eq(jiffies + msecs_to_jiffies(1000),
526 atux_trhfa_timeout)) /* ensure not wrap */
527 while(time_before(jiffies, atux_trhfa_timeout))
528 udelay(100);
529
530 bridge->ops = &iop13xx_atux_ops;
531 ret = pci_scan_root_bus_bridge(bridge);
532 if (!ret)
533 pci_bus_atux = bridge->bus;
534 break;
535 case IOP13XX_INIT_ATU_ATUE:
536 bridge->ops = &iop13xx_atue_ops;
537 ret = pci_scan_root_bus_bridge(bridge);
538 if (!ret)
539 pci_bus_atue = bridge->bus;
540 break;
541 default:
542 ret = -EINVAL;
543 }
544
545 return ret;
546}
547
548/* This function is called from iop13xx_pci_init() after assigning valid
549 * values to iop13xx_atue_pmmr_offset. This is the location for common
550 * setup of ATUE for all IOP13XX implementations.
551 */
552void __init iop13xx_atue_setup(void)
553{
554 int func = iop13xx_atu_function(IOP13XX_INIT_ATU_ATUE);
555 u32 reg_val;
556
557#ifdef CONFIG_PCI_MSI
558 /* BAR 0 (inbound msi window) */
559 __raw_writel(IOP13XX_MU_BASE_PHYS, IOP13XX_MU_MUBAR);
560 __raw_writel(~(IOP13XX_MU_WINDOW_SIZE - 1), IOP13XX_ATUE_IALR0);
561 __raw_writel(IOP13XX_MU_BASE_PHYS, IOP13XX_ATUE_IATVR0);
562 __raw_writel(IOP13XX_MU_BASE_PCI, IOP13XX_ATUE_IABAR0);
563#endif
564
565 /* BAR 1 (1:1 mapping with Physical RAM) */
566 /* Set limit and enable */
567 __raw_writel(~(IOP13XX_MAX_RAM_SIZE - PHYS_OFFSET - 1) & ~0x1,
568 IOP13XX_ATUE_IALR1);
569 __raw_writel(0x0, IOP13XX_ATUE_IAUBAR1);
570
571 /* Set base at the top of the reserved address space */
572 __raw_writel(PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_TYPE_64 |
573 PCI_BASE_ADDRESS_MEM_PREFETCH, IOP13XX_ATUE_IABAR1);
574
575 /* 1:1 mapping with physical ram
576 * (leave big endian byte swap disabled)
577 */
578 __raw_writel(0x0, IOP13XX_ATUE_IAUTVR1);
579 __raw_writel(PHYS_OFFSET, IOP13XX_ATUE_IATVR1);
580
581 /* Outbound window 1 (PCIX/PCIE memory window) */
582 /* 32 bit Address Space */
583 __raw_writel(0x0, IOP13XX_ATUE_OUMWTVR1);
584 /* PA[35:32] */
585 __raw_writel(IOP13XX_ATUE_OUMBAR_ENABLE |
586 (IOP13XX_PCIE_MEM_PHYS_OFFSET >> 32),
587 IOP13XX_ATUE_OUMBAR1);
588
589 /* Setup the I/O Bar
590 * A[35-16] in 31-12
591 */
592 __raw_writel(((IOP13XX_PCIE_LOWER_IO_PA >> 0x4) & 0xfffff000),
593 IOP13XX_ATUE_OIOBAR);
594 __raw_writel(IOP13XX_PCIE_LOWER_IO_BA, IOP13XX_ATUE_OIOWTVR);
595
596 /* clear startup errors */
597 iop13xx_atue_pci_status(1);
598
599 /* OIOBAR function number
600 */
601 reg_val = __raw_readl(IOP13XX_ATUE_OIOBAR);
602 reg_val &= ~0x7;
603 reg_val |= func;
604 __raw_writel(reg_val, IOP13XX_ATUE_OIOBAR);
605
606 /* OUMBAR function numbers
607 */
608 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR0);
609 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
610 IOP13XX_ATU_OUMBAR_FUNC_NUM);
611 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
612 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR0);
613
614 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR1);
615 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
616 IOP13XX_ATU_OUMBAR_FUNC_NUM);
617 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
618 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR1);
619
620 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR2);
621 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
622 IOP13XX_ATU_OUMBAR_FUNC_NUM);
623 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
624 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR2);
625
626 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR3);
627 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
628 IOP13XX_ATU_OUMBAR_FUNC_NUM);
629 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
630 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR3);
631
632 /* Enable inbound and outbound cycles
633 */
634 reg_val = __raw_readw(IOP13XX_ATUE_ATUCMD);
635 reg_val |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
636 PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
637 __raw_writew(reg_val, IOP13XX_ATUE_ATUCMD);
638
639 reg_val = __raw_readl(IOP13XX_ATUE_ATUCR);
640 reg_val |= IOP13XX_ATUE_ATUCR_OUT_EN |
641 IOP13XX_ATUE_ATUCR_IVM;
642 __raw_writel(reg_val, IOP13XX_ATUE_ATUCR);
643}
644
645void __init iop13xx_atue_disable(void)
646{
647 u32 reg_val;
648
649 __raw_writew(0x0, IOP13XX_ATUE_ATUCMD);
650 __raw_writel(IOP13XX_ATUE_ATUCR_IVM, IOP13XX_ATUE_ATUCR);
651
652 /* wait for cycles to quiesce */
653 while (__raw_readl(IOP13XX_ATUE_PCSR) & (IOP13XX_ATUE_PCSR_OUT_Q_BUSY |
654 IOP13XX_ATUE_PCSR_IN_Q_BUSY |
655 IOP13XX_ATUE_PCSR_LLRB_BUSY))
656 cpu_relax();
657
658 /* BAR 0 ( Disabled ) */
659 __raw_writel(0x0, IOP13XX_ATUE_IAUBAR0);
660 __raw_writel(0x0, IOP13XX_ATUE_IABAR0);
661 __raw_writel(0x0, IOP13XX_ATUE_IAUTVR0);
662 __raw_writel(0x0, IOP13XX_ATUE_IATVR0);
663 __raw_writel(0x0, IOP13XX_ATUE_IALR0);
664 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR0);
665 reg_val &= ~IOP13XX_ATUE_OUMBAR_ENABLE;
666 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR0);
667
668 /* BAR 1 ( Disabled ) */
669 __raw_writel(0x0, IOP13XX_ATUE_IAUBAR1);
670 __raw_writel(0x0, IOP13XX_ATUE_IABAR1);
671 __raw_writel(0x0, IOP13XX_ATUE_IAUTVR1);
672 __raw_writel(0x0, IOP13XX_ATUE_IATVR1);
673 __raw_writel(0x0, IOP13XX_ATUE_IALR1);
674 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR1);
675 reg_val &= ~IOP13XX_ATUE_OUMBAR_ENABLE;
676 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR1);
677
678 /* BAR 2 ( Disabled ) */
679 __raw_writel(0x0, IOP13XX_ATUE_IAUBAR2);
680 __raw_writel(0x0, IOP13XX_ATUE_IABAR2);
681 __raw_writel(0x0, IOP13XX_ATUE_IAUTVR2);
682 __raw_writel(0x0, IOP13XX_ATUE_IATVR2);
683 __raw_writel(0x0, IOP13XX_ATUE_IALR2);
684 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR2);
685 reg_val &= ~IOP13XX_ATUE_OUMBAR_ENABLE;
686 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR2);
687
688 /* BAR 3 ( Disabled ) */
689 reg_val = __raw_readl(IOP13XX_ATUE_OUMBAR3);
690 reg_val &= ~IOP13XX_ATUE_OUMBAR_ENABLE;
691 __raw_writel(reg_val, IOP13XX_ATUE_OUMBAR3);
692
693 /* Setup the I/O Bar
694 * A[35-16] in 31-12
695 */
696 __raw_writel((IOP13XX_PCIE_LOWER_IO_PA >> 0x4) & 0xfffff000,
697 IOP13XX_ATUE_OIOBAR);
698 __raw_writel(IOP13XX_PCIE_LOWER_IO_BA, IOP13XX_ATUE_OIOWTVR);
699}
700
701/* This function is called from iop13xx_pci_init() after assigning valid
702 * values to iop13xx_atux_pmmr_offset. This is the location for common
703 * setup of ATUX for all IOP13XX implementations.
704 */
705void __init iop13xx_atux_setup(void)
706{
707 u32 reg_val;
708 int func = iop13xx_atu_function(IOP13XX_INIT_ATU_ATUX);
709
710 /* Take PCI-X bus out of reset if bootloader hasn't already.
711 * According to spec, we should wait for 2^25 PCI clocks to meet
712 * the PCI timing parameter Trhfa (RST# high to first access).
713 * This is rarely necessary and often ignored.
714 */
715 reg_val = __raw_readl(IOP13XX_ATUX_PCSR);
716 if (reg_val & IOP13XX_ATUX_PCSR_P_RSTOUT) {
717 int msec = (reg_val >> IOP13XX_ATUX_PCSR_FREQ_OFFSET) & 0x7;
718 msec = 1000 / (8-msec); /* bits 100=133MHz, 111=>33MHz */
719 __raw_writel(reg_val & ~IOP13XX_ATUX_PCSR_P_RSTOUT,
720 IOP13XX_ATUX_PCSR);
721 atux_trhfa_timeout = jiffies + msecs_to_jiffies(msec);
722 }
723 else
724 atux_trhfa_timeout = jiffies;
725
726#ifdef CONFIG_PCI_MSI
727 /* BAR 0 (inbound msi window) */
728 __raw_writel(IOP13XX_MU_BASE_PHYS, IOP13XX_MU_MUBAR);
729 __raw_writel(~(IOP13XX_MU_WINDOW_SIZE - 1), IOP13XX_ATUX_IALR0);
730 __raw_writel(IOP13XX_MU_BASE_PHYS, IOP13XX_ATUX_IATVR0);
731 __raw_writel(IOP13XX_MU_BASE_PCI, IOP13XX_ATUX_IABAR0);
732#endif
733
734 /* BAR 1 (1:1 mapping with Physical RAM) */
735 /* Set limit and enable */
736 __raw_writel(~(IOP13XX_MAX_RAM_SIZE - PHYS_OFFSET - 1) & ~0x1,
737 IOP13XX_ATUX_IALR1);
738 __raw_writel(0x0, IOP13XX_ATUX_IAUBAR1);
739
740 /* Set base at the top of the reserved address space */
741 __raw_writel(PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_TYPE_64 |
742 PCI_BASE_ADDRESS_MEM_PREFETCH, IOP13XX_ATUX_IABAR1);
743
744 /* 1:1 mapping with physical ram
745 * (leave big endian byte swap disabled)
746 */
747 __raw_writel(0x0, IOP13XX_ATUX_IAUTVR1);
748 __raw_writel(PHYS_OFFSET, IOP13XX_ATUX_IATVR1);
749
750 /* Outbound window 1 (PCIX/PCIE memory window) */
751 /* 32 bit Address Space */
752 __raw_writel(0x0, IOP13XX_ATUX_OUMWTVR1);
753 /* PA[35:32] */
754 __raw_writel(IOP13XX_ATUX_OUMBAR_ENABLE |
755 IOP13XX_PCIX_MEM_PHYS_OFFSET >> 32,
756 IOP13XX_ATUX_OUMBAR1);
757
758 /* Setup the I/O Bar
759 * A[35-16] in 31-12
760 */
761 __raw_writel((IOP13XX_PCIX_LOWER_IO_PA >> 0x4) & 0xfffff000,
762 IOP13XX_ATUX_OIOBAR);
763 __raw_writel(IOP13XX_PCIX_LOWER_IO_BA, IOP13XX_ATUX_OIOWTVR);
764
765 /* clear startup errors */
766 iop13xx_atux_pci_status(1);
767
768 /* OIOBAR function number
769 */
770 reg_val = __raw_readl(IOP13XX_ATUX_OIOBAR);
771 reg_val &= ~0x7;
772 reg_val |= func;
773 __raw_writel(reg_val, IOP13XX_ATUX_OIOBAR);
774
775 /* OUMBAR function numbers
776 */
777 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR0);
778 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
779 IOP13XX_ATU_OUMBAR_FUNC_NUM);
780 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
781 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR0);
782
783 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR1);
784 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
785 IOP13XX_ATU_OUMBAR_FUNC_NUM);
786 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
787 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR1);
788
789 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR2);
790 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
791 IOP13XX_ATU_OUMBAR_FUNC_NUM);
792 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
793 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR2);
794
795 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR3);
796 reg_val &= ~(IOP13XX_ATU_OUMBAR_FUNC_NUM_MASK <<
797 IOP13XX_ATU_OUMBAR_FUNC_NUM);
798 reg_val |= func << IOP13XX_ATU_OUMBAR_FUNC_NUM;
799 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR3);
800
801 /* Enable inbound and outbound cycles
802 */
803 reg_val = __raw_readw(IOP13XX_ATUX_ATUCMD);
804 reg_val |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
805 PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
806 __raw_writew(reg_val, IOP13XX_ATUX_ATUCMD);
807
808 reg_val = __raw_readl(IOP13XX_ATUX_ATUCR);
809 reg_val |= IOP13XX_ATUX_ATUCR_OUT_EN;
810 __raw_writel(reg_val, IOP13XX_ATUX_ATUCR);
811}
812
813void __init iop13xx_atux_disable(void)
814{
815 u32 reg_val;
816
817 __raw_writew(0x0, IOP13XX_ATUX_ATUCMD);
818 __raw_writel(0x0, IOP13XX_ATUX_ATUCR);
819
820 /* wait for cycles to quiesce */
821 while (__raw_readl(IOP13XX_ATUX_PCSR) & (IOP13XX_ATUX_PCSR_OUT_Q_BUSY |
822 IOP13XX_ATUX_PCSR_IN_Q_BUSY))
823 cpu_relax();
824
825 /* BAR 0 ( Disabled ) */
826 __raw_writel(0x0, IOP13XX_ATUX_IAUBAR0);
827 __raw_writel(0x0, IOP13XX_ATUX_IABAR0);
828 __raw_writel(0x0, IOP13XX_ATUX_IAUTVR0);
829 __raw_writel(0x0, IOP13XX_ATUX_IATVR0);
830 __raw_writel(0x0, IOP13XX_ATUX_IALR0);
831 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR0);
832 reg_val &= ~IOP13XX_ATUX_OUMBAR_ENABLE;
833 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR0);
834
835 /* BAR 1 ( Disabled ) */
836 __raw_writel(0x0, IOP13XX_ATUX_IAUBAR1);
837 __raw_writel(0x0, IOP13XX_ATUX_IABAR1);
838 __raw_writel(0x0, IOP13XX_ATUX_IAUTVR1);
839 __raw_writel(0x0, IOP13XX_ATUX_IATVR1);
840 __raw_writel(0x0, IOP13XX_ATUX_IALR1);
841 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR1);
842 reg_val &= ~IOP13XX_ATUX_OUMBAR_ENABLE;
843 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR1);
844
845 /* BAR 2 ( Disabled ) */
846 __raw_writel(0x0, IOP13XX_ATUX_IAUBAR2);
847 __raw_writel(0x0, IOP13XX_ATUX_IABAR2);
848 __raw_writel(0x0, IOP13XX_ATUX_IAUTVR2);
849 __raw_writel(0x0, IOP13XX_ATUX_IATVR2);
850 __raw_writel(0x0, IOP13XX_ATUX_IALR2);
851 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR2);
852 reg_val &= ~IOP13XX_ATUX_OUMBAR_ENABLE;
853 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR2);
854
855 /* BAR 3 ( Disabled ) */
856 __raw_writel(0x0, IOP13XX_ATUX_IAUBAR3);
857 __raw_writel(0x0, IOP13XX_ATUX_IABAR3);
858 __raw_writel(0x0, IOP13XX_ATUX_IAUTVR3);
859 __raw_writel(0x0, IOP13XX_ATUX_IATVR3);
860 __raw_writel(0x0, IOP13XX_ATUX_IALR3);
861 reg_val = __raw_readl(IOP13XX_ATUX_OUMBAR3);
862 reg_val &= ~IOP13XX_ATUX_OUMBAR_ENABLE;
863 __raw_writel(reg_val, IOP13XX_ATUX_OUMBAR3);
864
865 /* Setup the I/O Bar
866 * A[35-16] in 31-12
867 */
868 __raw_writel((IOP13XX_PCIX_LOWER_IO_PA >> 0x4) & 0xfffff000,
869 IOP13XX_ATUX_OIOBAR);
870 __raw_writel(IOP13XX_PCIX_LOWER_IO_BA, IOP13XX_ATUX_OIOWTVR);
871}
872
873void __init iop13xx_set_atu_mmr_bases(void)
874{
875 /* Based on ESSR0, determine the ATU X/E offsets */
876 switch(__raw_readl(IOP13XX_ESSR0) &
877 (IOP13XX_CONTROLLER_ONLY | IOP13XX_INTERFACE_SEL_PCIX)) {
878 /* both asserted */
879 case 0:
880 iop13xx_atux_pmmr_offset = IOP13XX_ATU1_PMMR_OFFSET;
881 iop13xx_atue_pmmr_offset = IOP13XX_ATU2_PMMR_OFFSET;
882 break;
883 /* IOP13XX_CONTROLLER_ONLY = deasserted
884 * IOP13XX_INTERFACE_SEL_PCIX = asserted
885 */
886 case IOP13XX_CONTROLLER_ONLY:
887 iop13xx_atux_pmmr_offset = IOP13XX_ATU0_PMMR_OFFSET;
888 iop13xx_atue_pmmr_offset = IOP13XX_ATU2_PMMR_OFFSET;
889 break;
890 /* IOP13XX_CONTROLLER_ONLY = asserted
891 * IOP13XX_INTERFACE_SEL_PCIX = deasserted
892 */
893 case IOP13XX_INTERFACE_SEL_PCIX:
894 iop13xx_atux_pmmr_offset = IOP13XX_ATU1_PMMR_OFFSET;
895 iop13xx_atue_pmmr_offset = IOP13XX_ATU2_PMMR_OFFSET;
896 break;
897 /* both deasserted */
898 case IOP13XX_CONTROLLER_ONLY | IOP13XX_INTERFACE_SEL_PCIX:
899 iop13xx_atux_pmmr_offset = IOP13XX_ATU2_PMMR_OFFSET;
900 iop13xx_atue_pmmr_offset = IOP13XX_ATU0_PMMR_OFFSET;
901 break;
902 default:
903 BUG();
904 }
905}
906
907void __init iop13xx_atu_select(struct hw_pci *plat_pci)
908{
909 int i;
910
911 /* set system defaults
912 * note: if "iop13xx_init_atu=" is specified this autodetect
913 * sequence will be bypassed
914 */
915 if (init_atu == IOP13XX_INIT_ATU_DEFAULT) {
916 /* check for single/dual interface */
917 if (__raw_readl(IOP13XX_ESSR0) & IOP13XX_INTERFACE_SEL_PCIX) {
918 /* ATUE must be present check the device id
919 * to see if ATUX is present.
920 */
921 init_atu |= IOP13XX_INIT_ATU_ATUE;
922 switch (__raw_readw(IOP13XX_ATUE_DID) & 0xf0) {
923 case 0x70:
924 case 0x80:
925 case 0xc0:
926 init_atu |= IOP13XX_INIT_ATU_ATUX;
927 break;
928 }
929 } else {
930 /* ATUX must be present check the device id
931 * to see if ATUE is present.
932 */
933 init_atu |= IOP13XX_INIT_ATU_ATUX;
934 switch (__raw_readw(IOP13XX_ATUX_DID) & 0xf0) {
935 case 0x70:
936 case 0x80:
937 case 0xc0:
938 init_atu |= IOP13XX_INIT_ATU_ATUE;
939 break;
940 }
941 }
942
943 /* check central resource and root complex capability */
944 if (init_atu & IOP13XX_INIT_ATU_ATUX)
945 if (!(__raw_readl(IOP13XX_ATUX_PCSR) &
946 IOP13XX_ATUX_PCSR_CENTRAL_RES))
947 init_atu &= ~IOP13XX_INIT_ATU_ATUX;
948
949 if (init_atu & IOP13XX_INIT_ATU_ATUE)
950 if (__raw_readl(IOP13XX_ATUE_PCSR) &
951 IOP13XX_ATUE_PCSR_END_POINT)
952 init_atu &= ~IOP13XX_INIT_ATU_ATUE;
953 }
954
955 for (i = 0; i < 2; i++) {
956 if((init_atu & (1 << i)) == (1 << i))
957 plat_pci->nr_controllers++;
958 }
959}
960
961void __init iop13xx_pci_init(void)
962{
963 /* clear pre-existing south bridge errors */
964 __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3, IOP13XX_XBG_BECSR);
965
966 /* Setup the Min Address for PCI memory... */
967 pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA;
968
969 /* if Linux is given control of an ATU
970 * clear out its prior configuration,
971 * otherwise do not touch the registers
972 */
973 if (init_atu & IOP13XX_INIT_ATU_ATUE) {
974 iop13xx_atue_disable();
975 iop13xx_atue_setup();
976 }
977
978 if (init_atu & IOP13XX_INIT_ATU_ATUX) {
979 iop13xx_atux_disable();
980 iop13xx_atux_setup();
981 }
982
983 hook_fault_code(16+6, iop13xx_pci_abort, SIGBUS, 0,
984 "imprecise external abort");
985}
986
987/* initialize the pci memory space. handle any combination of
988 * atue and atux enabled/disabled
989 */
990int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
991{
992 struct resource *res;
993 int which_atu;
994 u32 pcixsr, pcsr;
995
996 if (nr > 1)
997 return 0;
998
999 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
1000 if (!res)
1001 panic("PCI: unable to alloc resources");
1002
1003
1004 /* 'nr' assumptions:
1005 * ATUX is always 0
1006 * ATUE is 1 when ATUX is also enabled
1007 * ATUE is 0 when ATUX is disabled
1008 */
1009 switch(init_atu) {
1010 case IOP13XX_INIT_ATU_ATUX:
1011 which_atu = nr ? 0 : IOP13XX_INIT_ATU_ATUX;
1012 break;
1013 case IOP13XX_INIT_ATU_ATUE:
1014 which_atu = nr ? 0 : IOP13XX_INIT_ATU_ATUE;
1015 break;
1016 case (IOP13XX_INIT_ATU_ATUX | IOP13XX_INIT_ATU_ATUE):
1017 which_atu = nr ? IOP13XX_INIT_ATU_ATUE : IOP13XX_INIT_ATU_ATUX;
1018 break;
1019 default:
1020 which_atu = 0;
1021 }
1022
1023 if (!which_atu) {
1024 kfree(res);
1025 return 0;
1026 }
1027
1028 switch(which_atu) {
1029 case IOP13XX_INIT_ATU_ATUX:
1030 pcixsr = __raw_readl(IOP13XX_ATUX_PCIXSR);
1031 pcixsr &= ~0xffff;
1032 pcixsr |= sys->busnr << IOP13XX_ATUX_PCIXSR_BUS_NUM |
1033 0 << IOP13XX_ATUX_PCIXSR_DEV_NUM |
1034 iop13xx_atu_function(IOP13XX_INIT_ATU_ATUX)
1035 << IOP13XX_ATUX_PCIXSR_FUNC_NUM;
1036 __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR);
1037
1038 pci_ioremap_io(0, IOP13XX_PCIX_LOWER_IO_PA);
1039
1040 res->start = IOP13XX_PCIX_LOWER_MEM_RA;
1041 res->end = IOP13XX_PCIX_UPPER_MEM_RA;
1042 res->name = "IQ81340 ATUX PCI Memory Space";
1043 res->flags = IORESOURCE_MEM;
1044 sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET;
1045 break;
1046 case IOP13XX_INIT_ATU_ATUE:
1047 /* Note: the function number field in the PCSR is ro */
1048 pcsr = __raw_readl(IOP13XX_ATUE_PCSR);
1049 pcsr &= ~(0xfff8 << 16);
1050 pcsr |= sys->busnr << IOP13XX_ATUE_PCSR_BUS_NUM |
1051 0 << IOP13XX_ATUE_PCSR_DEV_NUM;
1052
1053 __raw_writel(pcsr, IOP13XX_ATUE_PCSR);
1054
1055 pci_ioremap_io(SZ_64K, IOP13XX_PCIE_LOWER_IO_PA);
1056
1057 res->start = IOP13XX_PCIE_LOWER_MEM_RA;
1058 res->end = IOP13XX_PCIE_UPPER_MEM_RA;
1059 res->name = "IQ81340 ATUE PCI Memory Space";
1060 res->flags = IORESOURCE_MEM;
1061 sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET;
1062 sys->map_irq = iop13xx_pcie_map_irq;
1063 break;
1064 default:
1065 kfree(res);
1066 return 0;
1067 }
1068
1069 request_resource(&iomem_resource, res);
1070
1071 pci_add_resource_offset(&sys->resources, res, sys->mem_offset);
1072
1073 return 1;
1074}
1075
1076u16 iop13xx_dev_id(void)
1077{
1078 if (__raw_readl(IOP13XX_ESSR0) & IOP13XX_INTERFACE_SEL_PCIX)
1079 return __raw_readw(IOP13XX_ATUE_DID);
1080 else
1081 return __raw_readw(IOP13XX_ATUX_DID);
1082}
1083
1084static int __init iop13xx_init_atu_setup(char *str)
1085{
1086 init_atu = IOP13XX_INIT_ATU_NONE;
1087 if (str) {
1088 while (*str != '\0') {
1089 switch (*str) {
1090 case 'x':
1091 case 'X':
1092 init_atu |= IOP13XX_INIT_ATU_ATUX;
1093 init_atu &= ~IOP13XX_INIT_ATU_NONE;
1094 break;
1095 case 'e':
1096 case 'E':
1097 init_atu |= IOP13XX_INIT_ATU_ATUE;
1098 init_atu &= ~IOP13XX_INIT_ATU_NONE;
1099 break;
1100 case ',':
1101 case '=':
1102 break;
1103 default:
1104 PRINTK("\"iop13xx_init_atu\" malformed at "
1105 "character: \'%c\'", *str);
1106 *(str + 1) = '\0';
1107 init_atu = IOP13XX_INIT_ATU_DEFAULT;
1108 }
1109 str++;
1110 }
1111 }
1112 return 1;
1113}
1114
1115__setup("iop13xx_init_atu", iop13xx_init_atu_setup);
diff --git a/arch/arm/mach-iop13xx/pci.h b/arch/arm/mach-iop13xx/pci.h
deleted file mode 100644
index 736168d8c7ac..000000000000
--- a/arch/arm/mach-iop13xx/pci.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IOP13XX_PCI_H_
3#define _IOP13XX_PCI_H_
4#include <linux/io.h>
5#include <mach/irqs.h>
6
7#include <linux/types.h>
8
9extern void __iomem *iop13xx_atue_mem_base;
10extern void __iomem *iop13xx_atux_mem_base;
11extern size_t iop13xx_atue_mem_size;
12extern size_t iop13xx_atux_mem_size;
13
14struct pci_sys_data;
15struct pci_host_bridge;
16struct hw_pci;
17int iop13xx_pci_setup(int nr, struct pci_sys_data *sys);
18int iop13xx_scan_bus(int nr, struct pci_host_bridge *bridge);
19void iop13xx_atu_select(struct hw_pci *plat_pci);
20void iop13xx_pci_init(void);
21void iop13xx_map_pci_memory(void);
22
23#define IOP_PCI_STATUS_ERROR (PCI_STATUS_PARITY | \
24 PCI_STATUS_SIG_TARGET_ABORT | \
25 PCI_STATUS_REC_TARGET_ABORT | \
26 PCI_STATUS_REC_TARGET_ABORT | \
27 PCI_STATUS_REC_MASTER_ABORT | \
28 PCI_STATUS_SIG_SYSTEM_ERROR | \
29 PCI_STATUS_DETECTED_PARITY)
30
31#define IOP13XX_ATUE_ATUISR_ERROR (IOP13XX_ATUE_STAT_HALT_ON_ERROR | \
32 IOP13XX_ATUE_STAT_ROOT_SYS_ERR | \
33 IOP13XX_ATUE_STAT_PCI_IFACE_ERR | \
34 IOP13XX_ATUE_STAT_ERR_COR | \
35 IOP13XX_ATUE_STAT_ERR_UNCOR | \
36 IOP13XX_ATUE_STAT_CRS | \
37 IOP13XX_ATUE_STAT_DET_PAR_ERR | \
38 IOP13XX_ATUE_STAT_EXT_REC_MABORT | \
39 IOP13XX_ATUE_STAT_SIG_TABORT | \
40 IOP13XX_ATUE_STAT_EXT_REC_TABORT | \
41 IOP13XX_ATUE_STAT_MASTER_DATA_PAR)
42
43#define IOP13XX_ATUX_ATUISR_ERROR (IOP13XX_ATUX_STAT_TX_SCEM | \
44 IOP13XX_ATUX_STAT_REC_SCEM | \
45 IOP13XX_ATUX_STAT_TX_SERR | \
46 IOP13XX_ATUX_STAT_DET_PAR_ERR | \
47 IOP13XX_ATUX_STAT_INT_REC_MABORT | \
48 IOP13XX_ATUX_STAT_REC_SERR | \
49 IOP13XX_ATUX_STAT_EXT_REC_MABORT | \
50 IOP13XX_ATUX_STAT_EXT_REC_TABORT | \
51 IOP13XX_ATUX_STAT_EXT_SIG_TABORT | \
52 IOP13XX_ATUX_STAT_MASTER_DATA_PAR)
53
54/* PCI interrupts
55 */
56#define ATUX_INTA IRQ_IOP13XX_XINT0
57#define ATUX_INTB IRQ_IOP13XX_XINT1
58#define ATUX_INTC IRQ_IOP13XX_XINT2
59#define ATUX_INTD IRQ_IOP13XX_XINT3
60
61#define ATUE_INTA IRQ_IOP13XX_ATUE_IMA
62#define ATUE_INTB IRQ_IOP13XX_ATUE_IMB
63#define ATUE_INTC IRQ_IOP13XX_ATUE_IMC
64#define ATUE_INTD IRQ_IOP13XX_ATUE_IMD
65
66#endif /* _IOP13XX_PCI_H_ */
diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
deleted file mode 100644
index c5c84c9ec9ee..000000000000
--- a/arch/arm/mach-iop13xx/setup.c
+++ /dev/null
@@ -1,595 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * iop13xx platform Initialization
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6
7#include <linux/dma-mapping.h>
8#include <linux/serial_8250.h>
9#include <linux/io.h>
10#include <linux/reboot.h>
11#ifdef CONFIG_MTD_PHYSMAP
12#include <linux/mtd/physmap.h>
13#endif
14#include <asm/mach/map.h>
15#include <mach/hardware.h>
16#include <asm/irq.h>
17#include <asm/hardware/iop_adma.h>
18#include <mach/irqs.h>
19
20#define IOP13XX_UART_XTAL 33334000
21#define IOP13XX_SETUP_DEBUG 0
22#define PRINTK(x...) ((void)(IOP13XX_SETUP_DEBUG && printk(x)))
23
24/* Standard IO mapping for all IOP13XX based systems
25 */
26static struct map_desc iop13xx_std_desc[] __initdata = {
27 { /* mem mapped registers */
28 .virtual = (unsigned long)IOP13XX_PMMR_VIRT_MEM_BASE,
29 .pfn = __phys_to_pfn(IOP13XX_PMMR_PHYS_MEM_BASE),
30 .length = IOP13XX_PMMR_SIZE,
31 .type = MT_DEVICE,
32 },
33};
34
35static struct resource iop13xx_uart0_resources[] = {
36 [0] = {
37 .start = IOP13XX_UART0_PHYS,
38 .end = IOP13XX_UART0_PHYS + 0x3f,
39 .flags = IORESOURCE_MEM,
40 },
41 [1] = {
42 .start = IRQ_IOP13XX_UART0,
43 .end = IRQ_IOP13XX_UART0,
44 .flags = IORESOURCE_IRQ
45 }
46};
47
48static struct resource iop13xx_uart1_resources[] = {
49 [0] = {
50 .start = IOP13XX_UART1_PHYS,
51 .end = IOP13XX_UART1_PHYS + 0x3f,
52 .flags = IORESOURCE_MEM,
53 },
54 [1] = {
55 .start = IRQ_IOP13XX_UART1,
56 .end = IRQ_IOP13XX_UART1,
57 .flags = IORESOURCE_IRQ
58 }
59};
60
61static struct plat_serial8250_port iop13xx_uart0_data[] = {
62 {
63 .membase = IOP13XX_UART0_VIRT,
64 .mapbase = IOP13XX_UART0_PHYS,
65 .irq = IRQ_IOP13XX_UART0,
66 .uartclk = IOP13XX_UART_XTAL,
67 .regshift = 2,
68 .iotype = UPIO_MEM,
69 .flags = UPF_SKIP_TEST,
70 },
71 { },
72};
73
74static struct plat_serial8250_port iop13xx_uart1_data[] = {
75 {
76 .membase = IOP13XX_UART1_VIRT,
77 .mapbase = IOP13XX_UART1_PHYS,
78 .irq = IRQ_IOP13XX_UART1,
79 .uartclk = IOP13XX_UART_XTAL,
80 .regshift = 2,
81 .iotype = UPIO_MEM,
82 .flags = UPF_SKIP_TEST,
83 },
84 { },
85};
86
87/* The ids are fixed up later in iop13xx_platform_init */
88static struct platform_device iop13xx_uart0 = {
89 .name = "serial8250",
90 .id = 0,
91 .dev.platform_data = iop13xx_uart0_data,
92 .num_resources = 2,
93 .resource = iop13xx_uart0_resources,
94};
95
96static struct platform_device iop13xx_uart1 = {
97 .name = "serial8250",
98 .id = 0,
99 .dev.platform_data = iop13xx_uart1_data,
100 .num_resources = 2,
101 .resource = iop13xx_uart1_resources
102};
103
104static struct resource iop13xx_i2c_0_resources[] = {
105 [0] = {
106 .start = IOP13XX_I2C0_PHYS,
107 .end = IOP13XX_I2C0_PHYS + 0x18,
108 .flags = IORESOURCE_MEM,
109 },
110 [1] = {
111 .start = IRQ_IOP13XX_I2C_0,
112 .end = IRQ_IOP13XX_I2C_0,
113 .flags = IORESOURCE_IRQ
114 }
115};
116
117static struct resource iop13xx_i2c_1_resources[] = {
118 [0] = {
119 .start = IOP13XX_I2C1_PHYS,
120 .end = IOP13XX_I2C1_PHYS + 0x18,
121 .flags = IORESOURCE_MEM,
122 },
123 [1] = {
124 .start = IRQ_IOP13XX_I2C_1,
125 .end = IRQ_IOP13XX_I2C_1,
126 .flags = IORESOURCE_IRQ
127 }
128};
129
130static struct resource iop13xx_i2c_2_resources[] = {
131 [0] = {
132 .start = IOP13XX_I2C2_PHYS,
133 .end = IOP13XX_I2C2_PHYS + 0x18,
134 .flags = IORESOURCE_MEM,
135 },
136 [1] = {
137 .start = IRQ_IOP13XX_I2C_2,
138 .end = IRQ_IOP13XX_I2C_2,
139 .flags = IORESOURCE_IRQ
140 }
141};
142
143/* I2C controllers. The IOP13XX uses the same block as the IOP3xx, so
144 * we just use the same device name.
145 */
146
147/* The ids are fixed up later in iop13xx_platform_init */
148static struct platform_device iop13xx_i2c_0_controller = {
149 .name = "IOP3xx-I2C",
150 .id = 0,
151 .num_resources = 2,
152 .resource = iop13xx_i2c_0_resources
153};
154
155static struct platform_device iop13xx_i2c_1_controller = {
156 .name = "IOP3xx-I2C",
157 .id = 0,
158 .num_resources = 2,
159 .resource = iop13xx_i2c_1_resources
160};
161
162static struct platform_device iop13xx_i2c_2_controller = {
163 .name = "IOP3xx-I2C",
164 .id = 0,
165 .num_resources = 2,
166 .resource = iop13xx_i2c_2_resources
167};
168
169#ifdef CONFIG_MTD_PHYSMAP
170/* PBI Flash Device
171 */
172static struct physmap_flash_data iq8134x_flash_data = {
173 .width = 2,
174};
175
176static struct resource iq8134x_flash_resource = {
177 .start = IQ81340_FLASHBASE,
178 .end = 0,
179 .flags = IORESOURCE_MEM,
180};
181
182static struct platform_device iq8134x_flash = {
183 .name = "physmap-flash",
184 .id = 0,
185 .dev = { .platform_data = &iq8134x_flash_data, },
186 .num_resources = 1,
187 .resource = &iq8134x_flash_resource,
188};
189
190static unsigned long iq8134x_probe_flash_size(void)
191{
192 uint8_t __iomem *flash_addr = ioremap(IQ81340_FLASHBASE, PAGE_SIZE);
193 int i;
194 char query[3];
195 unsigned long size = 0;
196 int width = iq8134x_flash_data.width;
197
198 if (flash_addr) {
199 /* send CFI 'query' command */
200 writew(0x98, flash_addr);
201
202 /* check for CFI compliance */
203 for (i = 0; i < 3 * width; i += width)
204 query[i / width] = readb(flash_addr + (0x10 * width) + i);
205
206 /* read the size */
207 if (memcmp(query, "QRY", 3) == 0)
208 size = 1 << readb(flash_addr + (0x27 * width));
209
210 /* send CFI 'read array' command */
211 writew(0xff, flash_addr);
212
213 iounmap(flash_addr);
214 }
215
216 return size;
217}
218#endif
219
220/* ADMA Channels */
221static struct resource iop13xx_adma_0_resources[] = {
222 [0] = {
223 .start = IOP13XX_ADMA_PHYS_BASE(0),
224 .end = IOP13XX_ADMA_UPPER_PA(0),
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = IRQ_IOP13XX_ADMA0_EOT,
229 .end = IRQ_IOP13XX_ADMA0_EOT,
230 .flags = IORESOURCE_IRQ
231 },
232 [2] = {
233 .start = IRQ_IOP13XX_ADMA0_EOC,
234 .end = IRQ_IOP13XX_ADMA0_EOC,
235 .flags = IORESOURCE_IRQ
236 },
237 [3] = {
238 .start = IRQ_IOP13XX_ADMA0_ERR,
239 .end = IRQ_IOP13XX_ADMA0_ERR,
240 .flags = IORESOURCE_IRQ
241 }
242};
243
244static struct resource iop13xx_adma_1_resources[] = {
245 [0] = {
246 .start = IOP13XX_ADMA_PHYS_BASE(1),
247 .end = IOP13XX_ADMA_UPPER_PA(1),
248 .flags = IORESOURCE_MEM,
249 },
250 [1] = {
251 .start = IRQ_IOP13XX_ADMA1_EOT,
252 .end = IRQ_IOP13XX_ADMA1_EOT,
253 .flags = IORESOURCE_IRQ
254 },
255 [2] = {
256 .start = IRQ_IOP13XX_ADMA1_EOC,
257 .end = IRQ_IOP13XX_ADMA1_EOC,
258 .flags = IORESOURCE_IRQ
259 },
260 [3] = {
261 .start = IRQ_IOP13XX_ADMA1_ERR,
262 .end = IRQ_IOP13XX_ADMA1_ERR,
263 .flags = IORESOURCE_IRQ
264 }
265};
266
267static struct resource iop13xx_adma_2_resources[] = {
268 [0] = {
269 .start = IOP13XX_ADMA_PHYS_BASE(2),
270 .end = IOP13XX_ADMA_UPPER_PA(2),
271 .flags = IORESOURCE_MEM,
272 },
273 [1] = {
274 .start = IRQ_IOP13XX_ADMA2_EOT,
275 .end = IRQ_IOP13XX_ADMA2_EOT,
276 .flags = IORESOURCE_IRQ
277 },
278 [2] = {
279 .start = IRQ_IOP13XX_ADMA2_EOC,
280 .end = IRQ_IOP13XX_ADMA2_EOC,
281 .flags = IORESOURCE_IRQ
282 },
283 [3] = {
284 .start = IRQ_IOP13XX_ADMA2_ERR,
285 .end = IRQ_IOP13XX_ADMA2_ERR,
286 .flags = IORESOURCE_IRQ
287 }
288};
289
290static u64 iop13xx_adma_dmamask = DMA_BIT_MASK(32);
291static struct iop_adma_platform_data iop13xx_adma_0_data = {
292 .hw_id = 0,
293 .pool_size = PAGE_SIZE,
294};
295
296static struct iop_adma_platform_data iop13xx_adma_1_data = {
297 .hw_id = 1,
298 .pool_size = PAGE_SIZE,
299};
300
301static struct iop_adma_platform_data iop13xx_adma_2_data = {
302 .hw_id = 2,
303 .pool_size = PAGE_SIZE,
304};
305
306/* The ids are fixed up later in iop13xx_platform_init */
307static struct platform_device iop13xx_adma_0_channel = {
308 .name = "iop-adma",
309 .id = 0,
310 .num_resources = 4,
311 .resource = iop13xx_adma_0_resources,
312 .dev = {
313 .dma_mask = &iop13xx_adma_dmamask,
314 .coherent_dma_mask = DMA_BIT_MASK(32),
315 .platform_data = (void *) &iop13xx_adma_0_data,
316 },
317};
318
319static struct platform_device iop13xx_adma_1_channel = {
320 .name = "iop-adma",
321 .id = 0,
322 .num_resources = 4,
323 .resource = iop13xx_adma_1_resources,
324 .dev = {
325 .dma_mask = &iop13xx_adma_dmamask,
326 .coherent_dma_mask = DMA_BIT_MASK(32),
327 .platform_data = (void *) &iop13xx_adma_1_data,
328 },
329};
330
331static struct platform_device iop13xx_adma_2_channel = {
332 .name = "iop-adma",
333 .id = 0,
334 .num_resources = 4,
335 .resource = iop13xx_adma_2_resources,
336 .dev = {
337 .dma_mask = &iop13xx_adma_dmamask,
338 .coherent_dma_mask = DMA_BIT_MASK(32),
339 .platform_data = (void *) &iop13xx_adma_2_data,
340 },
341};
342
343void __init iop13xx_map_io(void)
344{
345 /* Initialize the Static Page Table maps */
346 iotable_init(iop13xx_std_desc, ARRAY_SIZE(iop13xx_std_desc));
347}
348
349static int init_uart;
350static int init_i2c;
351static int init_adma;
352
353void __init iop13xx_platform_init(void)
354{
355 int i;
356 u32 uart_idx, i2c_idx, adma_idx, plat_idx;
357 struct platform_device *iop13xx_devices[IQ81340_MAX_PLAT_DEVICES];
358
359 /* set the bases so we can read the device id */
360 iop13xx_set_atu_mmr_bases();
361
362 memset(iop13xx_devices, 0, sizeof(iop13xx_devices));
363
364 if (init_uart == IOP13XX_INIT_UART_DEFAULT) {
365 switch (iop13xx_dev_id()) {
366 /* enable both uarts on iop341 */
367 case 0x3380:
368 case 0x3384:
369 case 0x3388:
370 case 0x338c:
371 init_uart |= IOP13XX_INIT_UART_0;
372 init_uart |= IOP13XX_INIT_UART_1;
373 break;
374 /* only enable uart 1 */
375 default:
376 init_uart |= IOP13XX_INIT_UART_1;
377 }
378 }
379
380 if (init_i2c == IOP13XX_INIT_I2C_DEFAULT) {
381 switch (iop13xx_dev_id()) {
382 /* enable all i2c units on iop341 and iop342 */
383 case 0x3380:
384 case 0x3384:
385 case 0x3388:
386 case 0x338c:
387 case 0x3382:
388 case 0x3386:
389 case 0x338a:
390 case 0x338e:
391 init_i2c |= IOP13XX_INIT_I2C_0;
392 init_i2c |= IOP13XX_INIT_I2C_1;
393 init_i2c |= IOP13XX_INIT_I2C_2;
394 break;
395 /* only enable i2c 1 and 2 */
396 default:
397 init_i2c |= IOP13XX_INIT_I2C_1;
398 init_i2c |= IOP13XX_INIT_I2C_2;
399 }
400 }
401
402 if (init_adma == IOP13XX_INIT_ADMA_DEFAULT) {
403 init_adma |= IOP13XX_INIT_ADMA_0;
404 init_adma |= IOP13XX_INIT_ADMA_1;
405 init_adma |= IOP13XX_INIT_ADMA_2;
406 }
407
408 plat_idx = 0;
409 uart_idx = 0;
410 i2c_idx = 0;
411
412 /* uart 1 (if enabled) is ttyS0 */
413 if (init_uart & IOP13XX_INIT_UART_1) {
414 PRINTK("Adding uart1 to platform device list\n");
415 iop13xx_uart1.id = uart_idx++;
416 iop13xx_devices[plat_idx++] = &iop13xx_uart1;
417 }
418 if (init_uart & IOP13XX_INIT_UART_0) {
419 PRINTK("Adding uart0 to platform device list\n");
420 iop13xx_uart0.id = uart_idx++;
421 iop13xx_devices[plat_idx++] = &iop13xx_uart0;
422 }
423
424 for(i = 0; i < IQ81340_NUM_I2C; i++) {
425 if ((init_i2c & (1 << i)) && IOP13XX_SETUP_DEBUG)
426 printk("Adding i2c%d to platform device list\n", i);
427 switch(init_i2c & (1 << i)) {
428 case IOP13XX_INIT_I2C_0:
429 iop13xx_i2c_0_controller.id = i2c_idx++;
430 iop13xx_devices[plat_idx++] =
431 &iop13xx_i2c_0_controller;
432 break;
433 case IOP13XX_INIT_I2C_1:
434 iop13xx_i2c_1_controller.id = i2c_idx++;
435 iop13xx_devices[plat_idx++] =
436 &iop13xx_i2c_1_controller;
437 break;
438 case IOP13XX_INIT_I2C_2:
439 iop13xx_i2c_2_controller.id = i2c_idx++;
440 iop13xx_devices[plat_idx++] =
441 &iop13xx_i2c_2_controller;
442 break;
443 }
444 }
445
446 /* initialize adma channel ids and capabilities */
447 adma_idx = 0;
448 for (i = 0; i < IQ81340_NUM_ADMA; i++) {
449 struct iop_adma_platform_data *plat_data;
450 if ((init_adma & (1 << i)) && IOP13XX_SETUP_DEBUG)
451 printk(KERN_INFO
452 "Adding adma%d to platform device list\n", i);
453 switch (init_adma & (1 << i)) {
454 case IOP13XX_INIT_ADMA_0:
455 iop13xx_adma_0_channel.id = adma_idx++;
456 iop13xx_devices[plat_idx++] = &iop13xx_adma_0_channel;
457 plat_data = &iop13xx_adma_0_data;
458 dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
459 dma_cap_set(DMA_XOR, plat_data->cap_mask);
460 dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
461 dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
462 break;
463 case IOP13XX_INIT_ADMA_1:
464 iop13xx_adma_1_channel.id = adma_idx++;
465 iop13xx_devices[plat_idx++] = &iop13xx_adma_1_channel;
466 plat_data = &iop13xx_adma_1_data;
467 dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
468 dma_cap_set(DMA_XOR, plat_data->cap_mask);
469 dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
470 dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
471 break;
472 case IOP13XX_INIT_ADMA_2:
473 iop13xx_adma_2_channel.id = adma_idx++;
474 iop13xx_devices[plat_idx++] = &iop13xx_adma_2_channel;
475 plat_data = &iop13xx_adma_2_data;
476 dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
477 dma_cap_set(DMA_XOR, plat_data->cap_mask);
478 dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
479 dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
480 dma_cap_set(DMA_PQ, plat_data->cap_mask);
481 dma_cap_set(DMA_PQ_VAL, plat_data->cap_mask);
482 break;
483 }
484 }
485
486#ifdef CONFIG_MTD_PHYSMAP
487 iq8134x_flash_resource.end = iq8134x_flash_resource.start +
488 iq8134x_probe_flash_size() - 1;
489 if (iq8134x_flash_resource.end > iq8134x_flash_resource.start)
490 iop13xx_devices[plat_idx++] = &iq8134x_flash;
491 else
492 printk(KERN_ERR "%s: Failed to probe flash size\n", __func__);
493#endif
494
495 platform_add_devices(iop13xx_devices, plat_idx);
496}
497
498static int __init iop13xx_init_uart_setup(char *str)
499{
500 if (str) {
501 while (*str != '\0') {
502 switch(*str) {
503 case '0':
504 init_uart |= IOP13XX_INIT_UART_0;
505 break;
506 case '1':
507 init_uart |= IOP13XX_INIT_UART_1;
508 break;
509 case ',':
510 case '=':
511 break;
512 default:
513 PRINTK("\"iop13xx_init_uart\" malformed"
514 " at character: \'%c\'", *str);
515 *(str + 1) = '\0';
516 init_uart = IOP13XX_INIT_UART_DEFAULT;
517 }
518 str++;
519 }
520 }
521 return 1;
522}
523
524static int __init iop13xx_init_i2c_setup(char *str)
525{
526 if (str) {
527 while (*str != '\0') {
528 switch(*str) {
529 case '0':
530 init_i2c |= IOP13XX_INIT_I2C_0;
531 break;
532 case '1':
533 init_i2c |= IOP13XX_INIT_I2C_1;
534 break;
535 case '2':
536 init_i2c |= IOP13XX_INIT_I2C_2;
537 break;
538 case ',':
539 case '=':
540 break;
541 default:
542 PRINTK("\"iop13xx_init_i2c\" malformed"
543 " at character: \'%c\'", *str);
544 *(str + 1) = '\0';
545 init_i2c = IOP13XX_INIT_I2C_DEFAULT;
546 }
547 str++;
548 }
549 }
550 return 1;
551}
552
553static int __init iop13xx_init_adma_setup(char *str)
554{
555 if (str) {
556 while (*str != '\0') {
557 switch (*str) {
558 case '0':
559 init_adma |= IOP13XX_INIT_ADMA_0;
560 break;
561 case '1':
562 init_adma |= IOP13XX_INIT_ADMA_1;
563 break;
564 case '2':
565 init_adma |= IOP13XX_INIT_ADMA_2;
566 break;
567 case ',':
568 case '=':
569 break;
570 default:
571 PRINTK("\"iop13xx_init_adma\" malformed"
572 " at character: \'%c\'", *str);
573 *(str + 1) = '\0';
574 init_adma = IOP13XX_INIT_ADMA_DEFAULT;
575 }
576 str++;
577 }
578 }
579 return 1;
580}
581
582__setup("iop13xx_init_adma", iop13xx_init_adma_setup);
583__setup("iop13xx_init_uart", iop13xx_init_uart_setup);
584__setup("iop13xx_init_i2c", iop13xx_init_i2c_setup);
585
586void iop13xx_restart(enum reboot_mode mode, const char *cmd)
587{
588 /*
589 * Reset the internal bus (warning both cores are reset)
590 */
591 write_wdtcr(IOP_WDTCR_EN_ARM);
592 write_wdtcr(IOP_WDTCR_EN);
593 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
594 write_wdtcr(0x1000);
595}
diff --git a/arch/arm/mach-iop13xx/tpmi.c b/arch/arm/mach-iop13xx/tpmi.c
deleted file mode 100644
index 4f916549e381..000000000000
--- a/arch/arm/mach-iop13xx/tpmi.c
+++ /dev/null
@@ -1,244 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * iop13xx tpmi device resources
4 * Copyright (c) 2005-2006, Intel Corporation.
5 */
6
7#include <linux/kernel.h>
8#include <linux/init.h>
9#include <linux/platform_device.h>
10#include <linux/dma-mapping.h>
11#include <linux/io.h>
12#include <asm/irq.h>
13#include <linux/sizes.h>
14#include <mach/irqs.h>
15
16/* assumes CONTROLLER_ONLY# is never asserted in the ESSR register */
17#define IOP13XX_TPMI_MMR(dev) IOP13XX_REG_ADDR32_PHYS(0x48000 + (dev << 12))
18#define IOP13XX_TPMI_MEM(dev) IOP13XX_REG_ADDR32_PHYS(0x60000 + (dev << 13))
19#define IOP13XX_TPMI_CTRL(dev) IOP13XX_REG_ADDR32_PHYS(0x50000 + (dev << 10))
20#define IOP13XX_TPMI_IOP_CTRL(dev) (IOP13XX_TPMI_CTRL(dev) + 0x2000)
21#define IOP13XX_TPMI_MMR_SIZE (SZ_4K - 1)
22#define IOP13XX_TPMI_MEM_SIZE (255)
23#define IOP13XX_TPMI_MEM_CTRL (SZ_1K - 1)
24#define IOP13XX_TPMI_RESOURCE_MMR 0
25#define IOP13XX_TPMI_RESOURCE_MEM 1
26#define IOP13XX_TPMI_RESOURCE_CTRL 2
27#define IOP13XX_TPMI_RESOURCE_IOP_CTRL 3
28#define IOP13XX_TPMI_RESOURCE_IRQ 4
29
30static struct resource iop13xx_tpmi_0_resources[] = {
31 [IOP13XX_TPMI_RESOURCE_MMR] = {
32 .start = IOP13XX_TPMI_MMR(4), /* tpmi0 starts at dev == 4 */
33 .end = IOP13XX_TPMI_MMR(4) + IOP13XX_TPMI_MMR_SIZE,
34 .flags = IORESOURCE_MEM,
35 },
36 [IOP13XX_TPMI_RESOURCE_MEM] = {
37 .start = IOP13XX_TPMI_MEM(0),
38 .end = IOP13XX_TPMI_MEM(0) + IOP13XX_TPMI_MEM_SIZE,
39 .flags = IORESOURCE_MEM,
40 },
41 [IOP13XX_TPMI_RESOURCE_CTRL] = {
42 .start = IOP13XX_TPMI_CTRL(0),
43 .end = IOP13XX_TPMI_CTRL(0) + IOP13XX_TPMI_MEM_CTRL,
44 .flags = IORESOURCE_MEM,
45 },
46 [IOP13XX_TPMI_RESOURCE_IOP_CTRL] = {
47 .start = IOP13XX_TPMI_IOP_CTRL(0),
48 .end = IOP13XX_TPMI_IOP_CTRL(0) + IOP13XX_TPMI_MEM_CTRL,
49 .flags = IORESOURCE_MEM,
50 },
51 [IOP13XX_TPMI_RESOURCE_IRQ] = {
52 .start = IRQ_IOP13XX_TPMI0_OUT,
53 .end = IRQ_IOP13XX_TPMI0_OUT,
54 .flags = IORESOURCE_IRQ
55 }
56};
57
58static struct resource iop13xx_tpmi_1_resources[] = {
59 [IOP13XX_TPMI_RESOURCE_MMR] = {
60 .start = IOP13XX_TPMI_MMR(1),
61 .end = IOP13XX_TPMI_MMR(1) + IOP13XX_TPMI_MMR_SIZE,
62 .flags = IORESOURCE_MEM,
63 },
64 [IOP13XX_TPMI_RESOURCE_MEM] = {
65 .start = IOP13XX_TPMI_MEM(1),
66 .end = IOP13XX_TPMI_MEM(1) + IOP13XX_TPMI_MEM_SIZE,
67 .flags = IORESOURCE_MEM,
68 },
69 [IOP13XX_TPMI_RESOURCE_CTRL] = {
70 .start = IOP13XX_TPMI_CTRL(1),
71 .end = IOP13XX_TPMI_CTRL(1) + IOP13XX_TPMI_MEM_CTRL,
72 .flags = IORESOURCE_MEM,
73 },
74 [IOP13XX_TPMI_RESOURCE_IOP_CTRL] = {
75 .start = IOP13XX_TPMI_IOP_CTRL(1),
76 .end = IOP13XX_TPMI_IOP_CTRL(1) + IOP13XX_TPMI_MEM_CTRL,
77 .flags = IORESOURCE_MEM,
78 },
79 [IOP13XX_TPMI_RESOURCE_IRQ] = {
80 .start = IRQ_IOP13XX_TPMI1_OUT,
81 .end = IRQ_IOP13XX_TPMI1_OUT,
82 .flags = IORESOURCE_IRQ
83 }
84};
85
86static struct resource iop13xx_tpmi_2_resources[] = {
87 [IOP13XX_TPMI_RESOURCE_MMR] = {
88 .start = IOP13XX_TPMI_MMR(2),
89 .end = IOP13XX_TPMI_MMR(2) + IOP13XX_TPMI_MMR_SIZE,
90 .flags = IORESOURCE_MEM,
91 },
92 [IOP13XX_TPMI_RESOURCE_MEM] = {
93 .start = IOP13XX_TPMI_MEM(2),
94 .end = IOP13XX_TPMI_MEM(2) + IOP13XX_TPMI_MEM_SIZE,
95 .flags = IORESOURCE_MEM,
96 },
97 [IOP13XX_TPMI_RESOURCE_CTRL] = {
98 .start = IOP13XX_TPMI_CTRL(2),
99 .end = IOP13XX_TPMI_CTRL(2) + IOP13XX_TPMI_MEM_CTRL,
100 .flags = IORESOURCE_MEM,
101 },
102 [IOP13XX_TPMI_RESOURCE_IOP_CTRL] = {
103 .start = IOP13XX_TPMI_IOP_CTRL(2),
104 .end = IOP13XX_TPMI_IOP_CTRL(2) + IOP13XX_TPMI_MEM_CTRL,
105 .flags = IORESOURCE_MEM,
106 },
107 [IOP13XX_TPMI_RESOURCE_IRQ] = {
108 .start = IRQ_IOP13XX_TPMI2_OUT,
109 .end = IRQ_IOP13XX_TPMI2_OUT,
110 .flags = IORESOURCE_IRQ
111 }
112};
113
114static struct resource iop13xx_tpmi_3_resources[] = {
115 [IOP13XX_TPMI_RESOURCE_MMR] = {
116 .start = IOP13XX_TPMI_MMR(3),
117 .end = IOP13XX_TPMI_MMR(3) + IOP13XX_TPMI_MMR_SIZE,
118 .flags = IORESOURCE_MEM,
119 },
120 [IOP13XX_TPMI_RESOURCE_MEM] = {
121 .start = IOP13XX_TPMI_MEM(3),
122 .end = IOP13XX_TPMI_MEM(3) + IOP13XX_TPMI_MEM_SIZE,
123 .flags = IORESOURCE_MEM,
124 },
125 [IOP13XX_TPMI_RESOURCE_CTRL] = {
126 .start = IOP13XX_TPMI_CTRL(3),
127 .end = IOP13XX_TPMI_CTRL(3) + IOP13XX_TPMI_MEM_CTRL,
128 .flags = IORESOURCE_MEM,
129 },
130 [IOP13XX_TPMI_RESOURCE_IOP_CTRL] = {
131 .start = IOP13XX_TPMI_IOP_CTRL(3),
132 .end = IOP13XX_TPMI_IOP_CTRL(3) + IOP13XX_TPMI_MEM_CTRL,
133 .flags = IORESOURCE_MEM,
134 },
135 [IOP13XX_TPMI_RESOURCE_IRQ] = {
136 .start = IRQ_IOP13XX_TPMI3_OUT,
137 .end = IRQ_IOP13XX_TPMI3_OUT,
138 .flags = IORESOURCE_IRQ
139 }
140};
141
142u64 iop13xx_tpmi_mask = DMA_BIT_MASK(32);
143static struct platform_device iop13xx_tpmi_0_device = {
144 .name = "iop-tpmi",
145 .id = 0,
146 .num_resources = ARRAY_SIZE(iop13xx_tpmi_0_resources),
147 .resource = iop13xx_tpmi_0_resources,
148 .dev = {
149 .dma_mask = &iop13xx_tpmi_mask,
150 .coherent_dma_mask = DMA_BIT_MASK(32),
151 },
152};
153
154static struct platform_device iop13xx_tpmi_1_device = {
155 .name = "iop-tpmi",
156 .id = 1,
157 .num_resources = ARRAY_SIZE(iop13xx_tpmi_1_resources),
158 .resource = iop13xx_tpmi_1_resources,
159 .dev = {
160 .dma_mask = &iop13xx_tpmi_mask,
161 .coherent_dma_mask = DMA_BIT_MASK(32),
162 },
163};
164
165static struct platform_device iop13xx_tpmi_2_device = {
166 .name = "iop-tpmi",
167 .id = 2,
168 .num_resources = ARRAY_SIZE(iop13xx_tpmi_2_resources),
169 .resource = iop13xx_tpmi_2_resources,
170 .dev = {
171 .dma_mask = &iop13xx_tpmi_mask,
172 .coherent_dma_mask = DMA_BIT_MASK(32),
173 },
174};
175
176static struct platform_device iop13xx_tpmi_3_device = {
177 .name = "iop-tpmi",
178 .id = 3,
179 .num_resources = ARRAY_SIZE(iop13xx_tpmi_3_resources),
180 .resource = iop13xx_tpmi_3_resources,
181 .dev = {
182 .dma_mask = &iop13xx_tpmi_mask,
183 .coherent_dma_mask = DMA_BIT_MASK(32),
184 },
185};
186
187__init void iop13xx_add_tpmi_devices(void)
188{
189 unsigned short device_id;
190
191 /* tpmi's not present on iop341 or iop342 */
192 if (__raw_readl(IOP13XX_ESSR0) & IOP13XX_INTERFACE_SEL_PCIX)
193 /* ATUE must be present */
194 device_id = __raw_readw(IOP13XX_ATUE_DID);
195 else
196 /* ATUX must be present */
197 device_id = __raw_readw(IOP13XX_ATUX_DID);
198
199 switch (device_id) {
200 /* iop34[1|2] 0-tpmi */
201 case 0x3380:
202 case 0x3384:
203 case 0x3388:
204 case 0x338c:
205 case 0x3382:
206 case 0x3386:
207 case 0x338a:
208 case 0x338e:
209 return;
210 /* iop348 1-tpmi */
211 case 0x3310:
212 case 0x3312:
213 case 0x3314:
214 case 0x3318:
215 case 0x331a:
216 case 0x331c:
217 case 0x33c0:
218 case 0x33c2:
219 case 0x33c4:
220 case 0x33c8:
221 case 0x33ca:
222 case 0x33cc:
223 case 0x33b0:
224 case 0x33b2:
225 case 0x33b4:
226 case 0x33b8:
227 case 0x33ba:
228 case 0x33bc:
229 case 0x3320:
230 case 0x3322:
231 case 0x3324:
232 case 0x3328:
233 case 0x332a:
234 case 0x332c:
235 platform_device_register(&iop13xx_tpmi_0_device);
236 return;
237 default:
238 platform_device_register(&iop13xx_tpmi_0_device);
239 platform_device_register(&iop13xx_tpmi_1_device);
240 platform_device_register(&iop13xx_tpmi_2_device);
241 platform_device_register(&iop13xx_tpmi_3_device);
242 return;
243 }
244}
diff --git a/arch/arm/mach-iop32x/Makefile b/arch/arm/mach-iop32x/Makefile
index 71d62447d4d5..c8018ef5c6a9 100644
--- a/arch/arm/mach-iop32x/Makefile
+++ b/arch/arm/mach-iop32x/Makefile
@@ -3,7 +3,15 @@
3# Makefile for the linux kernel. 3# Makefile for the linux kernel.
4# 4#
5 5
6obj-y := irq.o 6obj-$(CONFIG_ARCH_IOP32X) += irq.o
7obj-$(CONFIG_ARCH_IOP32X) += i2c.o
8obj-$(CONFIG_ARCH_IOP32X) += pci.o
9obj-$(CONFIG_ARCH_IOP32X) += setup.o
10obj-$(CONFIG_ARCH_IOP32X) += time.o
11obj-$(CONFIG_ARCH_IOP32X) += cp6.o
12obj-$(CONFIG_ARCH_IOP32X) += adma.o
13obj-$(CONFIG_ARCH_IOP32X) += pmu.o
14obj-$(CONFIG_ARCH_IOP32X) += restart.o
7 15
8obj-$(CONFIG_MACH_GLANTANK) += glantank.o 16obj-$(CONFIG_MACH_GLANTANK) += glantank.o
9obj-$(CONFIG_ARCH_IQ80321) += iq80321.o 17obj-$(CONFIG_ARCH_IQ80321) += iq80321.o
diff --git a/arch/arm/plat-iop/adma.c b/arch/arm/mach-iop32x/adma.c
index b8e360299293..764bcbff98df 100644
--- a/arch/arm/plat-iop/adma.c
+++ b/arch/arm/mach-iop32x/adma.c
@@ -4,12 +4,12 @@
4 * Copyright © 2006, Intel Corporation. 4 * Copyright © 2006, Intel Corporation.
5 */ 5 */
6#include <linux/platform_device.h> 6#include <linux/platform_device.h>
7#include <asm/hardware/iop3xx.h>
8#include <linux/dma-mapping.h> 7#include <linux/dma-mapping.h>
9#include <mach/adma.h> 8#include <linux/platform_data/dma-iop32x.h>
10#include <asm/hardware/iop_adma.h> 9
10#include "iop3xx.h"
11#include "irqs.h"
11 12
12#ifdef CONFIG_ARCH_IOP32X
13#define IRQ_DMA0_EOT IRQ_IOP32X_DMA0_EOT 13#define IRQ_DMA0_EOT IRQ_IOP32X_DMA0_EOT
14#define IRQ_DMA0_EOC IRQ_IOP32X_DMA0_EOC 14#define IRQ_DMA0_EOC IRQ_IOP32X_DMA0_EOC
15#define IRQ_DMA0_ERR IRQ_IOP32X_DMA0_ERR 15#define IRQ_DMA0_ERR IRQ_IOP32X_DMA0_ERR
@@ -21,20 +21,7 @@
21#define IRQ_AA_EOT IRQ_IOP32X_AA_EOT 21#define IRQ_AA_EOT IRQ_IOP32X_AA_EOT
22#define IRQ_AA_EOC IRQ_IOP32X_AA_EOC 22#define IRQ_AA_EOC IRQ_IOP32X_AA_EOC
23#define IRQ_AA_ERR IRQ_IOP32X_AA_ERR 23#define IRQ_AA_ERR IRQ_IOP32X_AA_ERR
24#endif 24
25#ifdef CONFIG_ARCH_IOP33X
26#define IRQ_DMA0_EOT IRQ_IOP33X_DMA0_EOT
27#define IRQ_DMA0_EOC IRQ_IOP33X_DMA0_EOC
28#define IRQ_DMA0_ERR IRQ_IOP33X_DMA0_ERR
29
30#define IRQ_DMA1_EOT IRQ_IOP33X_DMA1_EOT
31#define IRQ_DMA1_EOC IRQ_IOP33X_DMA1_EOC
32#define IRQ_DMA1_ERR IRQ_IOP33X_DMA1_ERR
33
34#define IRQ_AA_EOT IRQ_IOP33X_AA_EOT
35#define IRQ_AA_EOC IRQ_IOP33X_AA_EOC
36#define IRQ_AA_ERR IRQ_IOP33X_AA_ERR
37#endif
38/* AAU and DMA Channels */ 25/* AAU and DMA Channels */
39static struct resource iop3xx_dma_0_resources[] = { 26static struct resource iop3xx_dma_0_resources[] = {
40 [0] = { 27 [0] = {
@@ -161,30 +148,14 @@ struct platform_device iop3xx_aau_channel = {
161 148
162static int __init iop3xx_adma_cap_init(void) 149static int __init iop3xx_adma_cap_init(void)
163{ 150{
164 #ifdef CONFIG_ARCH_IOP32X /* the 32x DMA does not perform CRC32C */
165 dma_cap_set(DMA_MEMCPY, iop3xx_dma_0_data.cap_mask);
166 dma_cap_set(DMA_INTERRUPT, iop3xx_dma_0_data.cap_mask);
167 #else
168 dma_cap_set(DMA_MEMCPY, iop3xx_dma_0_data.cap_mask); 151 dma_cap_set(DMA_MEMCPY, iop3xx_dma_0_data.cap_mask);
169 dma_cap_set(DMA_INTERRUPT, iop3xx_dma_0_data.cap_mask); 152 dma_cap_set(DMA_INTERRUPT, iop3xx_dma_0_data.cap_mask);
170 #endif
171 153
172 #ifdef CONFIG_ARCH_IOP32X /* the 32x DMA does not perform CRC32C */
173 dma_cap_set(DMA_MEMCPY, iop3xx_dma_1_data.cap_mask); 154 dma_cap_set(DMA_MEMCPY, iop3xx_dma_1_data.cap_mask);
174 dma_cap_set(DMA_INTERRUPT, iop3xx_dma_1_data.cap_mask); 155 dma_cap_set(DMA_INTERRUPT, iop3xx_dma_1_data.cap_mask);
175 #else
176 dma_cap_set(DMA_MEMCPY, iop3xx_dma_1_data.cap_mask);
177 dma_cap_set(DMA_INTERRUPT, iop3xx_dma_1_data.cap_mask);
178 #endif
179 156
180 #ifdef CONFIG_ARCH_IOP32X /* the 32x AAU does not perform zero sum */
181 dma_cap_set(DMA_XOR, iop3xx_aau_data.cap_mask);
182 dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
183 #else
184 dma_cap_set(DMA_XOR, iop3xx_aau_data.cap_mask); 157 dma_cap_set(DMA_XOR, iop3xx_aau_data.cap_mask);
185 dma_cap_set(DMA_XOR_VAL, iop3xx_aau_data.cap_mask);
186 dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask); 158 dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
187 #endif
188 159
189 return 0; 160 return 0;
190} 161}
diff --git a/arch/arm/plat-iop/cp6.c b/arch/arm/mach-iop32x/cp6.c
index ec74b07fb7e3..ec74b07fb7e3 100644
--- a/arch/arm/plat-iop/cp6.c
+++ b/arch/arm/mach-iop32x/cp6.c
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
index 61a1e593f9ec..d43ced3cd4e7 100644
--- a/arch/arm/mach-iop32x/em7210.c
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -21,7 +21,6 @@
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/gpio/machine.h> 23#include <linux/gpio/machine.h>
24#include <mach/hardware.h>
25#include <linux/io.h> 24#include <linux/io.h>
26#include <linux/irq.h> 25#include <linux/irq.h>
27#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
@@ -29,8 +28,10 @@
29#include <asm/mach/pci.h> 28#include <asm/mach/pci.h>
30#include <asm/mach/time.h> 29#include <asm/mach/time.h>
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32#include <mach/time.h> 31
32#include "hardware.h"
33#include "gpio-iop32x.h" 33#include "gpio-iop32x.h"
34#include "irqs.h"
34 35
35static void __init em7210_timer_init(void) 36static void __init em7210_timer_init(void)
36{ 37{
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index 5a45d616d9ac..2fe0f77d1f1d 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -22,7 +22,6 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/gpio/machine.h> 24#include <linux/gpio/machine.h>
25#include <mach/hardware.h>
26#include <asm/irq.h> 25#include <asm/irq.h>
27#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 27#include <asm/mach/map.h>
@@ -30,8 +29,10 @@
30#include <asm/mach/time.h> 29#include <asm/mach/time.h>
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
32#include <asm/page.h> 31#include <asm/page.h>
33#include <mach/time.h> 32
33#include "hardware.h"
34#include "gpio-iop32x.h" 34#include "gpio-iop32x.h"
35#include "irqs.h"
35 36
36/* 37/*
37 * GLAN Tank timer tick configuration. 38 * GLAN Tank timer tick configuration.
diff --git a/arch/arm/mach-iop32x/include/mach/glantank.h b/arch/arm/mach-iop32x/glantank.h
index b9df2e4614cf..f38e86b82c3d 100644
--- a/arch/arm/mach-iop32x/include/mach/glantank.h
+++ b/arch/arm/mach-iop32x/glantank.h
@@ -1,7 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2/* 2/*
3 * arch/arm/mach-iop32x/include/mach/glantank.h
4 *
5 * IO-Data GLAN Tank board registers 3 * IO-Data GLAN Tank board registers
6 */ 4 */
7 5
diff --git a/arch/arm/mach-iop32x/include/mach/hardware.h b/arch/arm/mach-iop32x/hardware.h
index 6e5303e60226..43ab4fb8f9b0 100644
--- a/arch/arm/mach-iop32x/include/mach/hardware.h
+++ b/arch/arm/mach-iop32x/hardware.h
@@ -1,8 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * arch/arm/mach-iop32x/include/mach/hardware.h
4 */
5
6#ifndef __HARDWARE_H 2#ifndef __HARDWARE_H
7#define __HARDWARE_H 3#define __HARDWARE_H
8 4
@@ -28,7 +24,7 @@ void iop32x_init_irq(void);
28/* 24/*
29 * Generic chipset bits 25 * Generic chipset bits
30 */ 26 */
31#include "iop32x.h" 27#include "iop3xx.h"
32 28
33/* 29/*
34 * Board specific bits 30 * Board specific bits
diff --git a/arch/arm/plat-iop/i2c.c b/arch/arm/mach-iop32x/i2c.c
index dfbd7c332866..dc9f6a14ab1b 100644
--- a/arch/arm/plat-iop/i2c.c
+++ b/arch/arm/mach-iop32x/i2c.c
@@ -22,18 +22,11 @@
22#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/memory.h> 24#include <asm/memory.h>
25#include <mach/hardware.h>
26#include <asm/hardware/iop3xx.h>
27#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
28 26
29#ifdef CONFIG_ARCH_IOP32X 27#include "hardware.h"
30#define IRQ_IOP3XX_I2C_0 IRQ_IOP32X_I2C_0 28#include "iop3xx.h"
31#define IRQ_IOP3XX_I2C_1 IRQ_IOP32X_I2C_1 29#include "irqs.h"
32#endif
33#ifdef CONFIG_ARCH_IOP33X
34#define IRQ_IOP3XX_I2C_0 IRQ_IOP33X_I2C_0
35#define IRQ_IOP3XX_I2C_1 IRQ_IOP33X_I2C_1
36#endif
37 30
38/* 31/*
39 * Each of the I2C busses have corresponding GPIO lines, and the driver 32 * Each of the I2C busses have corresponding GPIO lines, and the driver
@@ -65,8 +58,8 @@ static struct resource iop3xx_i2c0_resources[] = {
65 .flags = IORESOURCE_MEM, 58 .flags = IORESOURCE_MEM,
66 }, 59 },
67 [1] = { 60 [1] = {
68 .start = IRQ_IOP3XX_I2C_0, 61 .start = IRQ_IOP32X_I2C_0,
69 .end = IRQ_IOP3XX_I2C_0, 62 .end = IRQ_IOP32X_I2C_0,
70 .flags = IORESOURCE_IRQ, 63 .flags = IORESOURCE_IRQ,
71 }, 64 },
72}; 65};
@@ -86,8 +79,8 @@ static struct resource iop3xx_i2c1_resources[] = {
86 .flags = IORESOURCE_MEM, 79 .flags = IORESOURCE_MEM,
87 }, 80 },
88 [1] = { 81 [1] = {
89 .start = IRQ_IOP3XX_I2C_1, 82 .start = IRQ_IOP32X_I2C_1,
90 .end = IRQ_IOP3XX_I2C_1, 83 .end = IRQ_IOP32X_I2C_1,
91 .flags = IORESOURCE_IRQ, 84 .flags = IORESOURCE_IRQ,
92 } 85 }
93}; 86};
diff --git a/arch/arm/mach-iop32x/include/mach/adma.h b/arch/arm/mach-iop32x/include/mach/adma.h
deleted file mode 100644
index 2b20063123ad..000000000000
--- a/arch/arm/mach-iop32x/include/mach/adma.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef IOP32X_ADMA_H
3#define IOP32X_ADMA_H
4#include <asm/hardware/iop3xx-adma.h>
5#endif
6
diff --git a/arch/arm/mach-iop32x/include/mach/entry-macro.S b/arch/arm/mach-iop32x/include/mach/entry-macro.S
index ea13ae02d9b1..8e6766d4621e 100644
--- a/arch/arm/mach-iop32x/include/mach/entry-macro.S
+++ b/arch/arm/mach-iop32x/include/mach/entry-macro.S
@@ -7,8 +7,6 @@
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <mach/iop32x.h>
11
12 .macro get_irqnr_preamble, base, tmp 10 .macro get_irqnr_preamble, base, tmp
13 mrc p15, 0, \tmp, c15, c1, 0 11 mrc p15, 0, \tmp, c15, c1, 0
14 orr \tmp, \tmp, #(1 << 6) 12 orr \tmp, \tmp, #(1 << 6)
diff --git a/arch/arm/mach-iop32x/include/mach/iop32x.h b/arch/arm/mach-iop32x/include/mach/iop32x.h
deleted file mode 100644
index 84223f86552f..000000000000
--- a/arch/arm/mach-iop32x/include/mach/iop32x.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-iop32x/include/mach/iop32x.h
4 *
5 * Intel IOP32X Chip definitions
6 *
7 * Author: Rory Bolt <rorybolt@pacbell.net>
8 * Copyright (C) 2002 Rory Bolt
9 * Copyright (C) 2004 Intel Corp.
10 */
11
12#ifndef __IOP32X_H
13#define __IOP32X_H
14
15/*
16 * Peripherals that are shared between the iop32x and iop33x but
17 * located at different addresses.
18 */
19#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg))
20
21#include <asm/hardware/iop3xx.h>
22
23/* ATU Parameters
24 * set up a 1:1 bus to physical ram relationship
25 * w/ physical ram on top of pci in the memory map
26 */
27#define IOP32X_MAX_RAM_SIZE 0x40000000UL
28#define IOP3XX_MAX_RAM_SIZE IOP32X_MAX_RAM_SIZE
29#define IOP3XX_PCI_LOWER_MEM_BA 0x80000000
30
31#endif
diff --git a/arch/arm/mach-iop32x/include/mach/irqs.h b/arch/arm/mach-iop32x/include/mach/irqs.h
index 82b11743e91c..c4e78df428e8 100644
--- a/arch/arm/mach-iop32x/include/mach/irqs.h
+++ b/arch/arm/mach-iop32x/include/mach/irqs.h
@@ -9,39 +9,6 @@
9#ifndef __IRQS_H 9#ifndef __IRQS_H
10#define __IRQS_H 10#define __IRQS_H
11 11
12/*
13 * IOP80321 chipset interrupts
14 */
15#define IRQ_IOP32X_DMA0_EOT 0
16#define IRQ_IOP32X_DMA0_EOC 1
17#define IRQ_IOP32X_DMA1_EOT 2
18#define IRQ_IOP32X_DMA1_EOC 3
19#define IRQ_IOP32X_AA_EOT 6
20#define IRQ_IOP32X_AA_EOC 7
21#define IRQ_IOP32X_CORE_PMON 8
22#define IRQ_IOP32X_TIMER0 9
23#define IRQ_IOP32X_TIMER1 10
24#define IRQ_IOP32X_I2C_0 11
25#define IRQ_IOP32X_I2C_1 12
26#define IRQ_IOP32X_MESSAGING 13
27#define IRQ_IOP32X_ATU_BIST 14
28#define IRQ_IOP32X_PERFMON 15
29#define IRQ_IOP32X_CORE_PMU 16
30#define IRQ_IOP32X_BIU_ERR 17
31#define IRQ_IOP32X_ATU_ERR 18
32#define IRQ_IOP32X_MCU_ERR 19
33#define IRQ_IOP32X_DMA0_ERR 20
34#define IRQ_IOP32X_DMA1_ERR 21
35#define IRQ_IOP32X_AA_ERR 23
36#define IRQ_IOP32X_MSG_ERR 24
37#define IRQ_IOP32X_SSP 25
38#define IRQ_IOP32X_XINT0 27
39#define IRQ_IOP32X_XINT1 28
40#define IRQ_IOP32X_XINT2 29
41#define IRQ_IOP32X_XINT3 30
42#define IRQ_IOP32X_HPI 31
43
44#define NR_IRQS 32 12#define NR_IRQS 32
45 13
46
47#endif 14#endif
diff --git a/arch/arm/mach-iop32x/include/mach/time.h b/arch/arm/mach-iop32x/include/mach/time.h
deleted file mode 100644
index d08950ccebc4..000000000000
--- a/arch/arm/mach-iop32x/include/mach/time.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IOP32X_TIME_H_
3#define _IOP32X_TIME_H_
4#define IRQ_IOP_TIMER0 IRQ_IOP32X_TIMER0
5#endif
diff --git a/arch/arm/mach-iop32x/include/mach/uncompress.h b/arch/arm/mach-iop32x/include/mach/uncompress.h
index ed4ac3e28fa1..c8548875d942 100644
--- a/arch/arm/mach-iop32x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop32x/include/mach/uncompress.h
@@ -6,9 +6,8 @@
6#include <asm/types.h> 6#include <asm/types.h>
7#include <asm/mach-types.h> 7#include <asm/mach-types.h>
8#include <linux/serial_reg.h> 8#include <linux/serial_reg.h>
9#include <mach/hardware.h>
10 9
11volatile u8 *uart_base; 10#define uart_base ((volatile u8 *)0xfe800000)
12 11
13#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) 12#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
14 13
@@ -23,17 +22,4 @@ static inline void flush(void)
23{ 22{
24} 23}
25 24
26static __inline__ void __arch_decomp_setup(unsigned long arch_id) 25#define arch_decomp_setup() do { } while (0)
27{
28 if (machine_is_iq80321())
29 uart_base = (volatile u8 *)IQ80321_UART;
30 else if (machine_is_iq31244() || machine_is_em7210())
31 uart_base = (volatile u8 *)IQ31244_UART;
32 else
33 uart_base = (volatile u8 *)0xfe800000;
34}
35
36/*
37 * nothing to do
38 */
39#define arch_decomp_setup() __arch_decomp_setup(arch_id)
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/mach-iop32x/iop3xx.h
index 3cb6f22f510b..46b4b34a4ad2 100644
--- a/arch/arm/include/asm/hardware/iop3xx.h
+++ b/arch/arm/mach-iop32x/iop3xx.h
@@ -1,7 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0-only */ 1/* SPDX-License-Identifier: GPL-2.0-only */
2/* 2/*
3 * arch/arm/include/asm/hardware/iop3xx.h
4 *
5 * Intel IOP32X and IOP33X register definitions 3 * Intel IOP32X and IOP33X register definitions
6 * 4 *
7 * Author: Rory Bolt <rorybolt@pacbell.net> 5 * Author: Rory Bolt <rorybolt@pacbell.net>
@@ -13,6 +11,22 @@
13#define __IOP3XX_H 11#define __IOP3XX_H
14 12
15/* 13/*
14 * Peripherals that are shared between the iop32x and iop33x but
15 * located at different addresses.
16 */
17#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg))
18
19#include "iop3xx.h"
20
21/* ATU Parameters
22 * set up a 1:1 bus to physical ram relationship
23 * w/ physical ram on top of pci in the memory map
24 */
25#define IOP32X_MAX_RAM_SIZE 0x40000000UL
26#define IOP3XX_MAX_RAM_SIZE IOP32X_MAX_RAM_SIZE
27#define IOP3XX_PCI_LOWER_MEM_BA 0x80000000
28
29/*
16 * IOP3XX GPIO handling 30 * IOP3XX GPIO handling
17 */ 31 */
18#define IOP3XX_GPIO_LINE(x) (x) 32#define IOP3XX_GPIO_LINE(x) (x)
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index 8755aa87e591..04a7d389d365 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -23,7 +23,6 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/gpio/machine.h> 25#include <linux/gpio/machine.h>
26#include <mach/hardware.h>
27#include <asm/cputype.h> 26#include <asm/cputype.h>
28#include <asm/irq.h> 27#include <asm/irq.h>
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -33,7 +32,9 @@
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34#include <asm/page.h> 33#include <asm/page.h>
35#include <asm/pgtable.h> 34#include <asm/pgtable.h>
36#include <mach/time.h> 35
36#include "hardware.h"
37#include "irqs.h"
37#include "gpio-iop32x.h" 38#include "gpio-iop32x.h"
38 39
39/* 40/*
diff --git a/arch/arm/mach-iop32x/include/mach/iq31244.h b/arch/arm/mach-iop32x/iq31244.h
index e62da5da6ed4..a7ac691e48d3 100644
--- a/arch/arm/mach-iop32x/include/mach/iq31244.h
+++ b/arch/arm/mach-iop32x/iq31244.h
@@ -1,7 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2/* 2/*
3 * arch/arm/mach-iop32x/include/mach/iq31244.h
4 *
5 * Intel IQ31244 evaluation board registers 3 * Intel IQ31244 evaluation board registers
6 */ 4 */
7 5
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index e12699d1c540..4bd596d6c9c1 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -20,7 +20,6 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/gpio/machine.h> 22#include <linux/gpio/machine.h>
23#include <mach/hardware.h>
24#include <asm/irq.h> 23#include <asm/irq.h>
25#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 25#include <asm/mach/map.h>
@@ -29,7 +28,9 @@
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30#include <asm/page.h> 29#include <asm/page.h>
31#include <asm/pgtable.h> 30#include <asm/pgtable.h>
32#include <mach/time.h> 31
32#include "hardware.h"
33#include "irqs.h"
33#include "gpio-iop32x.h" 34#include "gpio-iop32x.h"
34 35
35/* 36/*
diff --git a/arch/arm/mach-iop32x/include/mach/iq80321.h b/arch/arm/mach-iop32x/iq80321.h
index faf62c26f6f8..3a5d10626ea6 100644
--- a/arch/arm/mach-iop32x/include/mach/iq80321.h
+++ b/arch/arm/mach-iop32x/iq80321.h
@@ -1,7 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2/* 2/*
3 * arch/arm/mach-iop32x/include/mach/iq80321.h
4 *
5 * Intel IQ80321 evaluation board registers 3 * Intel IQ80321 evaluation board registers
6 */ 4 */
7 5
diff --git a/arch/arm/mach-iop32x/irq.c b/arch/arm/mach-iop32x/irq.c
index 2f5d4ec94f9c..2d48bf1398c1 100644
--- a/arch/arm/mach-iop32x/irq.c
+++ b/arch/arm/mach-iop32x/irq.c
@@ -13,9 +13,10 @@
13#include <linux/list.h> 13#include <linux/list.h>
14#include <asm/mach/irq.h> 14#include <asm/mach/irq.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <mach/hardware.h>
17#include <asm/mach-types.h> 16#include <asm/mach-types.h>
18 17
18#include "hardware.h"
19
19static u32 iop32x_mask; 20static u32 iop32x_mask;
20 21
21static void intctl_write(u32 val) 22static void intctl_write(u32 val)
diff --git a/arch/arm/mach-iop32x/irqs.h b/arch/arm/mach-iop32x/irqs.h
new file mode 100644
index 000000000000..69858e4e905d
--- /dev/null
+++ b/arch/arm/mach-iop32x/irqs.h
@@ -0,0 +1,42 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Author: Rory Bolt <rorybolt@pacbell.net>
4 * Copyright: (C) 2002 Rory Bolt
5 */
6
7#ifndef __IOP32X_IRQS_H
8#define __IOP32X_IRQS_H
9
10/*
11 * IOP80321 chipset interrupts
12 */
13#define IRQ_IOP32X_DMA0_EOT 0
14#define IRQ_IOP32X_DMA0_EOC 1
15#define IRQ_IOP32X_DMA1_EOT 2
16#define IRQ_IOP32X_DMA1_EOC 3
17#define IRQ_IOP32X_AA_EOT 6
18#define IRQ_IOP32X_AA_EOC 7
19#define IRQ_IOP32X_CORE_PMON 8
20#define IRQ_IOP32X_TIMER0 9
21#define IRQ_IOP32X_TIMER1 10
22#define IRQ_IOP32X_I2C_0 11
23#define IRQ_IOP32X_I2C_1 12
24#define IRQ_IOP32X_MESSAGING 13
25#define IRQ_IOP32X_ATU_BIST 14
26#define IRQ_IOP32X_PERFMON 15
27#define IRQ_IOP32X_CORE_PMU 16
28#define IRQ_IOP32X_BIU_ERR 17
29#define IRQ_IOP32X_ATU_ERR 18
30#define IRQ_IOP32X_MCU_ERR 19
31#define IRQ_IOP32X_DMA0_ERR 20
32#define IRQ_IOP32X_DMA1_ERR 21
33#define IRQ_IOP32X_AA_ERR 23
34#define IRQ_IOP32X_MSG_ERR 24
35#define IRQ_IOP32X_SSP 25
36#define IRQ_IOP32X_XINT0 27
37#define IRQ_IOP32X_XINT1 28
38#define IRQ_IOP32X_XINT2 29
39#define IRQ_IOP32X_XINT3 30
40#define IRQ_IOP32X_HPI 31
41
42#endif
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index 26d76b377e79..5382a93ad0f8 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -28,7 +28,6 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/gpio/machine.h> 30#include <linux/gpio/machine.h>
31#include <mach/hardware.h>
32#include <asm/irq.h> 31#include <asm/irq.h>
33#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
@@ -37,7 +36,9 @@
37#include <asm/mach-types.h> 36#include <asm/mach-types.h>
38#include <asm/page.h> 37#include <asm/page.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40#include <mach/time.h> 39
40#include "hardware.h"
41#include "irqs.h"
41#include "gpio-iop32x.h" 42#include "gpio-iop32x.h"
42 43
43/* 44/*
diff --git a/arch/arm/mach-iop32x/include/mach/n2100.h b/arch/arm/mach-iop32x/n2100.h
index 70bb660b643a..0b97b940d3e7 100644
--- a/arch/arm/mach-iop32x/include/mach/n2100.h
+++ b/arch/arm/mach-iop32x/n2100.h
@@ -1,7 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2/* 2/*
3 * arch/arm/mach-iop32x/include/mach/n2100.h
4 *
5 * Thecus N2100 board registers 3 * Thecus N2100 board registers
6 */ 4 */
7 5
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/mach-iop32x/pci.c
index 4c42c95e4bf5..ab0010dc3145 100644
--- a/arch/arm/plat-iop/pci.c
+++ b/arch/arm/mach-iop32x/pci.c
@@ -17,9 +17,9 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <asm/irq.h> 18#include <asm/irq.h>
19#include <asm/signal.h> 19#include <asm/signal.h>
20#include <mach/hardware.h>
21#include <asm/mach/pci.h> 20#include <asm/mach/pci.h>
22#include <asm/hardware/iop3xx.h> 21#include "hardware.h"
22#include "iop3xx.h"
23 23
24// #define DEBUG 24// #define DEBUG
25 25
diff --git a/arch/arm/plat-iop/pmu.c b/arch/arm/mach-iop32x/pmu.c
index 04c44a809b32..bdbc7a3cb8a3 100644
--- a/arch/arm/plat-iop/pmu.c
+++ b/arch/arm/mach-iop32x/pmu.c
@@ -5,17 +5,11 @@
5 */ 5 */
6 6
7#include <linux/platform_device.h> 7#include <linux/platform_device.h>
8#include <mach/irqs.h> 8#include "irqs.h"
9 9
10static struct resource pmu_resource = { 10static struct resource pmu_resource = {
11#ifdef CONFIG_ARCH_IOP32X
12 .start = IRQ_IOP32X_CORE_PMU, 11 .start = IRQ_IOP32X_CORE_PMU,
13 .end = IRQ_IOP32X_CORE_PMU, 12 .end = IRQ_IOP32X_CORE_PMU,
14#endif
15#ifdef CONFIG_ARCH_IOP33X
16 .start = IRQ_IOP33X_CORE_PMU,
17 .end = IRQ_IOP33X_CORE_PMU,
18#endif
19 .flags = IORESOURCE_IRQ, 13 .flags = IORESOURCE_IRQ,
20}; 14};
21 15
diff --git a/arch/arm/plat-iop/restart.c b/arch/arm/mach-iop32x/restart.c
index cf6d3d9a2112..3dfa54d3a7a8 100644
--- a/arch/arm/plat-iop/restart.c
+++ b/arch/arm/mach-iop32x/restart.c
@@ -4,9 +4,9 @@
4 * 4 *
5 * Copyright (C) 2001 MontaVista Software, Inc. 5 * Copyright (C) 2001 MontaVista Software, Inc.
6 */ 6 */
7#include <asm/hardware/iop3xx.h>
8#include <asm/system_misc.h> 7#include <asm/system_misc.h>
9#include <mach/hardware.h> 8#include "hardware.h"
9#include "iop3xx.h"
10 10
11void iop3xx_restart(enum reboot_mode mode, const char *cmd) 11void iop3xx_restart(enum reboot_mode mode, const char *cmd)
12{ 12{
diff --git a/arch/arm/plat-iop/setup.c b/arch/arm/mach-iop32x/setup.c
index d10e0102d82c..a0a81c28a632 100644
--- a/arch/arm/plat-iop/setup.c
+++ b/arch/arm/mach-iop32x/setup.c
@@ -10,7 +10,7 @@
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <asm/mach/map.h> 12#include <asm/mach/map.h>
13#include <asm/hardware/iop3xx.h> 13#include "iop3xx.h"
14 14
15/* 15/*
16 * Standard IO mapping for all IOP3xx based systems. Note that 16 * Standard IO mapping for all IOP3xx based systems. Note that
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/mach-iop32x/time.c
index f9dd1f50cfe5..18a4df5c1baa 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/mach-iop32x/time.c
@@ -19,12 +19,13 @@
19#include <linux/clockchips.h> 19#include <linux/clockchips.h>
20#include <linux/export.h> 20#include <linux/export.h>
21#include <linux/sched_clock.h> 21#include <linux/sched_clock.h>
22#include <mach/hardware.h>
23#include <asm/irq.h> 22#include <asm/irq.h>
24#include <linux/uaccess.h> 23#include <linux/uaccess.h>
25#include <asm/mach/irq.h> 24#include <asm/mach/irq.h>
26#include <asm/mach/time.h> 25#include <asm/mach/time.h>
27#include <mach/time.h> 26
27#include "hardware.h"
28#include "irqs.h"
28 29
29/* 30/*
30 * Minimum clocksource/clockevent timer range in seconds 31 * Minimum clocksource/clockevent timer range in seconds
@@ -167,7 +168,7 @@ void __init iop_init_time(unsigned long tick_rate)
167 */ 168 */
168 write_tmr0(timer_ctl & ~IOP_TMR_EN); 169 write_tmr0(timer_ctl & ~IOP_TMR_EN);
169 write_tisr(1); 170 write_tisr(1);
170 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); 171 setup_irq(IRQ_IOP32X_TIMER0, &iop_timer_irq);
171 iop_clockevent.cpumask = cpumask_of(0); 172 iop_clockevent.cpumask = cpumask_of(0);
172 clockevents_config_and_register(&iop_clockevent, tick_rate, 173 clockevents_config_and_register(&iop_clockevent, tick_rate,
173 0xf, 0xfffffffe); 174 0xf, 0xfffffffe);
diff --git a/arch/arm/mach-iop33x/Kconfig b/arch/arm/mach-iop33x/Kconfig
deleted file mode 100644
index cd6069c7c568..000000000000
--- a/arch/arm/mach-iop33x/Kconfig
+++ /dev/null
@@ -1,22 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2if ARCH_IOP33X
3
4menu "IOP33x Implementation Options"
5
6comment "IOP33x Platform Types"
7
8config ARCH_IQ80331
9 bool "Enable support for IQ80331"
10 help
11 Say Y here if you want to run your kernel on the Intel IQ80331
12 evaluation kit for the IOP331 chipset.
13
14config MACH_IQ80332
15 bool "Enable support for IQ80332"
16 help
17 Say Y here if you want to run your kernel on the Intel IQ80332
18 evaluation kit for the IOP332 chipset.
19
20endmenu
21
22endif
diff --git a/arch/arm/mach-iop33x/Makefile b/arch/arm/mach-iop33x/Makefile
deleted file mode 100644
index 320ecde1f907..000000000000
--- a/arch/arm/mach-iop33x/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2#
3# Makefile for the linux kernel.
4#
5
6obj-y := irq.o uart.o
7
8obj-$(CONFIG_ARCH_IQ80331) += iq80331.o
9obj-$(CONFIG_MACH_IQ80332) += iq80332.o
diff --git a/arch/arm/mach-iop33x/Makefile.boot b/arch/arm/mach-iop33x/Makefile.boot
deleted file mode 100644
index e4dd1d26038f..000000000000
--- a/arch/arm/mach-iop33x/Makefile.boot
+++ /dev/null
@@ -1,4 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2 zreladdr-y += 0x00008000
3params_phys-y := 0x00000100
4initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-iop33x/include/mach/adma.h b/arch/arm/mach-iop33x/include/mach/adma.h
deleted file mode 100644
index 8aa7159ab6d8..000000000000
--- a/arch/arm/mach-iop33x/include/mach/adma.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef IOP33X_ADMA_H
3#define IOP33X_ADMA_H
4#include <asm/hardware/iop3xx-adma.h>
5#endif
6
diff --git a/arch/arm/mach-iop33x/include/mach/entry-macro.S b/arch/arm/mach-iop33x/include/mach/entry-macro.S
deleted file mode 100644
index 0a398fe1fba4..000000000000
--- a/arch/arm/mach-iop33x/include/mach/entry-macro.S
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * arch/arm/mach-iop33x/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IOP33x-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <mach/iop33x.h>
11
12 .macro get_irqnr_preamble, base, tmp
13 mrc p15, 0, \tmp, c15, c1, 0
14 orr \tmp, \tmp, #(1 << 6)
15 mcr p15, 0, \tmp, c15, c1, 0 @ Enable cp6 access
16 mrc p15, 0, \tmp, c15, c1, 0
17 mov \tmp, \tmp
18 sub pc, pc, #4 @ cp_wait
19 .endm
20
21 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
22 mrc p6, 0, \irqstat, c14, c0, 0 @ Read IINTVEC
23 cmp \irqstat, #0
24 mrceq p6, 0, \irqstat, c14, c0, 0 @ erratum 63 workaround
25 adds \irqnr, \irqstat, #1
26 movne \irqnr, \irqstat, lsr #2
27 .endm
28
29 .macro arch_ret_to_user, tmp1, tmp2
30 mrc p15, 0, \tmp1, c15, c1, 0
31 ands \tmp2, \tmp1, #(1 << 6)
32 bicne \tmp1, \tmp1, #(1 << 6)
33 mcrne p15, 0, \tmp1, c15, c1, 0 @ Disable cp6 access
34 .endm
diff --git a/arch/arm/mach-iop33x/include/mach/hardware.h b/arch/arm/mach-iop33x/include/mach/hardware.h
deleted file mode 100644
index 020bafbc36a5..000000000000
--- a/arch/arm/mach-iop33x/include/mach/hardware.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * arch/arm/mach-iop33x/include/mach/hardware.h
4 */
5
6#ifndef __HARDWARE_H
7#define __HARDWARE_H
8
9#include <asm/types.h>
10
11/*
12 * Note about PCI IO space mappings
13 *
14 * To make IO space accesses efficient, we store virtual addresses in
15 * the IO resources.
16 *
17 * The PCI IO space is located at virtual 0xfe000000 from physical
18 * 0x90000000. The PCI BARs must be programmed with physical addresses,
19 * but when we read them, we convert them to virtual addresses. See
20 * arch/arm/mach-iop3xx/iop3xx-pci.c
21 */
22
23#ifndef __ASSEMBLY__
24void iop33x_init_irq(void);
25
26extern struct platform_device iop33x_uart0_device;
27extern struct platform_device iop33x_uart1_device;
28#endif
29
30
31/*
32 * Generic chipset bits
33 *
34 */
35#include "iop33x.h"
36
37/*
38 * Board specific bits
39 */
40#include "iq80331.h"
41#include "iq80332.h"
42
43
44#endif
diff --git a/arch/arm/mach-iop33x/include/mach/iop33x.h b/arch/arm/mach-iop33x/include/mach/iop33x.h
deleted file mode 100644
index 0c7041ed7a60..000000000000
--- a/arch/arm/mach-iop33x/include/mach/iop33x.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-iop33x/include/mach/iop33x.h
4 *
5 * Intel IOP33X Chip definitions
6 *
7 * Author: Dave Jiang (dave.jiang@intel.com)
8 * Copyright (C) 2003, 2004 Intel Corp.
9 */
10
11#ifndef __IOP33X_H
12#define __IOP33X_H
13
14/*
15 * Peripherals that are shared between the iop32x and iop33x but
16 * located at different addresses.
17 */
18#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07d0 + (reg))
19
20#include <asm/hardware/iop3xx.h>
21
22/* UARTs */
23#define IOP33X_UART0_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1700)
24#define IOP33X_UART0_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1700)
25#define IOP33X_UART1_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1740)
26#define IOP33X_UART1_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1740)
27
28/* ATU Parameters
29 * set up a 1:1 bus to physical ram relationship
30 * w/ pci on top of physical ram in memory map
31 */
32#define IOP33X_MAX_RAM_SIZE 0x80000000UL
33#define IOP3XX_MAX_RAM_SIZE IOP33X_MAX_RAM_SIZE
34#define IOP3XX_PCI_LOWER_MEM_BA (PHYS_OFFSET + IOP33X_MAX_RAM_SIZE)
35
36
37#endif
diff --git a/arch/arm/mach-iop33x/include/mach/iq80331.h b/arch/arm/mach-iop33x/include/mach/iq80331.h
deleted file mode 100644
index c7e68d863e44..000000000000
--- a/arch/arm/mach-iop33x/include/mach/iq80331.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * arch/arm/mach-iop33x/include/mach/iq80331.h
4 *
5 * Intel IQ80331 evaluation board registers
6 */
7
8#ifndef __IQ80331_H
9#define __IQ80331_H
10
11#define IQ80331_7SEG_1 0xce840000 /* 7-Segment MSB */
12#define IQ80331_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */
13#define IQ80331_ROTARY_SW 0xce8d0000 /* Rotary Switch */
14#define IQ80331_BATT_STAT 0xce8f0000 /* Battery Status */
15
16
17#endif
diff --git a/arch/arm/mach-iop33x/include/mach/iq80332.h b/arch/arm/mach-iop33x/include/mach/iq80332.h
deleted file mode 100644
index 749b44bf7f62..000000000000
--- a/arch/arm/mach-iop33x/include/mach/iq80332.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * arch/arm/mach-iop33x/include/mach/iq80332.h
4 *
5 * Intel IQ80332 evaluation board registers
6 */
7
8#ifndef __IQ80332_H
9#define __IQ80332_H
10
11#define IQ80332_7SEG_1 0xce840000 /* 7-Segment MSB */
12#define IQ80332_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */
13#define IQ80332_ROTARY_SW 0xce8d0000 /* Rotary Switch */
14#define IQ80332_BATT_STAT 0xce8f0000 /* Battery Status */
15
16
17#endif
diff --git a/arch/arm/mach-iop33x/include/mach/irqs.h b/arch/arm/mach-iop33x/include/mach/irqs.h
deleted file mode 100644
index cc3dce0ad4a1..000000000000
--- a/arch/arm/mach-iop33x/include/mach/irqs.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-iop33x/include/mach/irqs.h
4 *
5 * Author: Dave Jiang (dave.jiang@intel.com)
6 * Copyright: (C) 2003 Intel Corp.
7 */
8
9#ifndef __IRQS_H
10#define __IRQS_H
11
12/*
13 * IOP80331 chipset interrupts
14 */
15#define IRQ_IOP33X_DMA0_EOT 0
16#define IRQ_IOP33X_DMA0_EOC 1
17#define IRQ_IOP33X_DMA1_EOT 2
18#define IRQ_IOP33X_DMA1_EOC 3
19#define IRQ_IOP33X_AA_EOT 6
20#define IRQ_IOP33X_AA_EOC 7
21#define IRQ_IOP33X_TIMER0 8
22#define IRQ_IOP33X_TIMER1 9
23#define IRQ_IOP33X_I2C_0 10
24#define IRQ_IOP33X_I2C_1 11
25#define IRQ_IOP33X_MSG 12
26#define IRQ_IOP33X_MSGIBQ 13
27#define IRQ_IOP33X_ATU_BIST 14
28#define IRQ_IOP33X_PERFMON 15
29#define IRQ_IOP33X_CORE_PMU 16
30#define IRQ_IOP33X_XINT0 24
31#define IRQ_IOP33X_XINT1 25
32#define IRQ_IOP33X_XINT2 26
33#define IRQ_IOP33X_XINT3 27
34#define IRQ_IOP33X_XINT8 32
35#define IRQ_IOP33X_XINT9 33
36#define IRQ_IOP33X_XINT10 34
37#define IRQ_IOP33X_XINT11 35
38#define IRQ_IOP33X_XINT12 36
39#define IRQ_IOP33X_XINT13 37
40#define IRQ_IOP33X_XINT14 38
41#define IRQ_IOP33X_XINT15 39
42#define IRQ_IOP33X_UART0 51
43#define IRQ_IOP33X_UART1 52
44#define IRQ_IOP33X_PBIE 53
45#define IRQ_IOP33X_ATU_CRW 54
46#define IRQ_IOP33X_ATU_ERR 55
47#define IRQ_IOP33X_MCU_ERR 56
48#define IRQ_IOP33X_DMA0_ERR 57
49#define IRQ_IOP33X_DMA1_ERR 58
50#define IRQ_IOP33X_AA_ERR 60
51#define IRQ_IOP33X_MSG_ERR 62
52#define IRQ_IOP33X_HPI 63
53
54#define NR_IRQS 64
55
56
57#endif
diff --git a/arch/arm/mach-iop33x/include/mach/time.h b/arch/arm/mach-iop33x/include/mach/time.h
deleted file mode 100644
index 801f8fd644ad..000000000000
--- a/arch/arm/mach-iop33x/include/mach/time.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IOP33X_TIME_H_
3#define _IOP33X_TIME_H_
4#define IRQ_IOP_TIMER0 IRQ_IOP33X_TIMER0
5#endif
diff --git a/arch/arm/mach-iop33x/include/mach/uncompress.h b/arch/arm/mach-iop33x/include/mach/uncompress.h
deleted file mode 100644
index 62b71cde1f79..000000000000
--- a/arch/arm/mach-iop33x/include/mach/uncompress.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * arch/arm/mach-iop33x/include/mach/uncompress.h
4 */
5
6#include <asm/types.h>
7#include <asm/mach-types.h>
8#include <linux/serial_reg.h>
9#include <mach/hardware.h>
10
11volatile u32 *uart_base;
12
13#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
14
15static inline void putc(char c)
16{
17 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
18 barrier();
19 uart_base[UART_TX] = c;
20}
21
22static inline void flush(void)
23{
24}
25
26static __inline__ void __arch_decomp_setup(unsigned long arch_id)
27{
28 if (machine_is_iq80331() || machine_is_iq80332())
29 uart_base = (volatile u32 *)IOP33X_UART0_PHYS;
30 else
31 uart_base = (volatile u32 *)0xfe800000;
32}
33
34/*
35 * nothing to do
36 */
37#define arch_decomp_setup() __arch_decomp_setup(arch_id)
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
deleted file mode 100644
index ab74fbabc749..000000000000
--- a/arch/arm/mach-iop33x/iq80331.c
+++ /dev/null
@@ -1,148 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * arch/arm/mach-iop33x/iq80331.c
4 *
5 * Board support code for the Intel IQ80331 platform.
6 *
7 * Author: Dave Jiang <dave.jiang@intel.com>
8 * Copyright (C) 2003 Intel Corp.
9 */
10
11#include <linux/mm.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/string.h>
16#include <linux/serial_core.h>
17#include <linux/serial_8250.h>
18#include <linux/mtd/physmap.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <mach/hardware.h>
22#include <asm/irq.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/mach/pci.h>
26#include <asm/mach/time.h>
27#include <asm/mach-types.h>
28#include <asm/page.h>
29#include <asm/pgtable.h>
30#include <mach/time.h>
31
32/*
33 * IQ80331 timer tick configuration.
34 */
35static void __init iq80331_timer_init(void)
36{
37 /* D-Step parts run at a higher internal bus frequency */
38 if (*IOP3XX_ATURID >= 0xa)
39 iop_init_time(333000000);
40 else
41 iop_init_time(266000000);
42}
43
44
45/*
46 * IQ80331 PCI.
47 */
48static int __init
49iq80331_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
50{
51 int irq;
52
53 if (slot == 1 && pin == 1) {
54 /* PCI-X Slot INTA */
55 irq = IRQ_IOP33X_XINT1;
56 } else if (slot == 1 && pin == 2) {
57 /* PCI-X Slot INTB */
58 irq = IRQ_IOP33X_XINT2;
59 } else if (slot == 1 && pin == 3) {
60 /* PCI-X Slot INTC */
61 irq = IRQ_IOP33X_XINT3;
62 } else if (slot == 1 && pin == 4) {
63 /* PCI-X Slot INTD */
64 irq = IRQ_IOP33X_XINT0;
65 } else if (slot == 2) {
66 /* GigE */
67 irq = IRQ_IOP33X_XINT2;
68 } else {
69 printk(KERN_ERR "iq80331_pci_map_irq() called for unknown "
70 "device PCI:%d:%d:%d\n", dev->bus->number,
71 PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
72 irq = -1;
73 }
74
75 return irq;
76}
77
78static struct hw_pci iq80331_pci __initdata = {
79 .nr_controllers = 1,
80 .ops = &iop3xx_ops,
81 .setup = iop3xx_pci_setup,
82 .preinit = iop3xx_pci_preinit_cond,
83 .map_irq = iq80331_pci_map_irq,
84};
85
86static int __init iq80331_pci_init(void)
87{
88 if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
89 machine_is_iq80331())
90 pci_common_init(&iq80331_pci);
91
92 return 0;
93}
94
95subsys_initcall(iq80331_pci_init);
96
97
98/*
99 * IQ80331 machine initialisation.
100 */
101static struct physmap_flash_data iq80331_flash_data = {
102 .width = 1,
103};
104
105static struct resource iq80331_flash_resource = {
106 .start = 0xc0000000,
107 .end = 0xc07fffff,
108 .flags = IORESOURCE_MEM,
109};
110
111static struct platform_device iq80331_flash_device = {
112 .name = "physmap-flash",
113 .id = 0,
114 .dev = {
115 .platform_data = &iq80331_flash_data,
116 },
117 .num_resources = 1,
118 .resource = &iq80331_flash_resource,
119};
120
121static struct resource iq80331_gpio_res[] = {
122 DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10),
123};
124
125static void __init iq80331_init_machine(void)
126{
127 platform_device_register_simple("gpio-iop", 0,
128 iq80331_gpio_res,
129 ARRAY_SIZE(iq80331_gpio_res));
130 platform_device_register(&iop3xx_i2c0_device);
131 platform_device_register(&iop3xx_i2c1_device);
132 platform_device_register(&iop33x_uart0_device);
133 platform_device_register(&iop33x_uart1_device);
134 platform_device_register(&iq80331_flash_device);
135 platform_device_register(&iop3xx_dma_0_channel);
136 platform_device_register(&iop3xx_dma_1_channel);
137 platform_device_register(&iop3xx_aau_channel);
138}
139
140MACHINE_START(IQ80331, "Intel IQ80331")
141 /* Maintainer: Intel Corp. */
142 .atag_offset = 0x100,
143 .map_io = iop3xx_map_io,
144 .init_irq = iop33x_init_irq,
145 .init_time = iq80331_timer_init,
146 .init_machine = iq80331_init_machine,
147 .restart = iop3xx_restart,
148MACHINE_END
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
deleted file mode 100644
index 2e309b197aa4..000000000000
--- a/arch/arm/mach-iop33x/iq80332.c
+++ /dev/null
@@ -1,148 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * arch/arm/mach-iop33x/iq80332.c
4 *
5 * Board support code for the Intel IQ80332 platform.
6 *
7 * Author: Dave Jiang <dave.jiang@intel.com>
8 * Copyright (C) 2004 Intel Corp.
9 */
10
11#include <linux/mm.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/string.h>
16#include <linux/serial_core.h>
17#include <linux/serial_8250.h>
18#include <linux/mtd/physmap.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <mach/hardware.h>
22#include <asm/irq.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/mach/pci.h>
26#include <asm/mach/time.h>
27#include <asm/mach-types.h>
28#include <asm/page.h>
29#include <asm/pgtable.h>
30#include <mach/time.h>
31
32/*
33 * IQ80332 timer tick configuration.
34 */
35static void __init iq80332_timer_init(void)
36{
37 /* D-Step parts and the iop333 run at a higher internal bus frequency */
38 if (*IOP3XX_ATURID >= 0xa || *IOP3XX_ATUDID == 0x374)
39 iop_init_time(333000000);
40 else
41 iop_init_time(266000000);
42}
43
44
45/*
46 * IQ80332 PCI.
47 */
48static int __init
49iq80332_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
50{
51 int irq;
52
53 if (slot == 4 && pin == 1) {
54 /* PCI-X Slot INTA */
55 irq = IRQ_IOP33X_XINT0;
56 } else if (slot == 4 && pin == 2) {
57 /* PCI-X Slot INTB */
58 irq = IRQ_IOP33X_XINT1;
59 } else if (slot == 4 && pin == 3) {
60 /* PCI-X Slot INTC */
61 irq = IRQ_IOP33X_XINT2;
62 } else if (slot == 4 && pin == 4) {
63 /* PCI-X Slot INTD */
64 irq = IRQ_IOP33X_XINT3;
65 } else if (slot == 6) {
66 /* GigE */
67 irq = IRQ_IOP33X_XINT2;
68 } else {
69 printk(KERN_ERR "iq80332_pci_map_irq() called for unknown "
70 "device PCI:%d:%d:%d\n", dev->bus->number,
71 PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
72 irq = -1;
73 }
74
75 return irq;
76}
77
78static struct hw_pci iq80332_pci __initdata = {
79 .nr_controllers = 1,
80 .ops = &iop3xx_ops,
81 .setup = iop3xx_pci_setup,
82 .preinit = iop3xx_pci_preinit_cond,
83 .map_irq = iq80332_pci_map_irq,
84};
85
86static int __init iq80332_pci_init(void)
87{
88 if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
89 machine_is_iq80332())
90 pci_common_init(&iq80332_pci);
91
92 return 0;
93}
94
95subsys_initcall(iq80332_pci_init);
96
97
98/*
99 * IQ80332 machine initialisation.
100 */
101static struct physmap_flash_data iq80332_flash_data = {
102 .width = 1,
103};
104
105static struct resource iq80332_flash_resource = {
106 .start = 0xc0000000,
107 .end = 0xc07fffff,
108 .flags = IORESOURCE_MEM,
109};
110
111static struct platform_device iq80332_flash_device = {
112 .name = "physmap-flash",
113 .id = 0,
114 .dev = {
115 .platform_data = &iq80332_flash_data,
116 },
117 .num_resources = 1,
118 .resource = &iq80332_flash_resource,
119};
120
121static struct resource iq80332_gpio_res[] = {
122 DEFINE_RES_MEM((IOP3XX_PERIPHERAL_PHYS_BASE + 0x1780), 0x10),
123};
124
125static void __init iq80332_init_machine(void)
126{
127 platform_device_register_simple("gpio-iop", 0,
128 iq80332_gpio_res,
129 ARRAY_SIZE(iq80332_gpio_res));
130 platform_device_register(&iop3xx_i2c0_device);
131 platform_device_register(&iop3xx_i2c1_device);
132 platform_device_register(&iop33x_uart0_device);
133 platform_device_register(&iop33x_uart1_device);
134 platform_device_register(&iq80332_flash_device);
135 platform_device_register(&iop3xx_dma_0_channel);
136 platform_device_register(&iop3xx_dma_1_channel);
137 platform_device_register(&iop3xx_aau_channel);
138}
139
140MACHINE_START(IQ80332, "Intel IQ80332")
141 /* Maintainer: Intel Corp. */
142 .atag_offset = 0x100,
143 .map_io = iop3xx_map_io,
144 .init_irq = iop33x_init_irq,
145 .init_time = iq80332_timer_init,
146 .init_machine = iq80332_init_machine,
147 .restart = iop3xx_restart,
148MACHINE_END
diff --git a/arch/arm/mach-iop33x/irq.c b/arch/arm/mach-iop33x/irq.c
deleted file mode 100644
index 03ad7d3a8f49..000000000000
--- a/arch/arm/mach-iop33x/irq.c
+++ /dev/null
@@ -1,115 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * arch/arm/mach-iop33x/irq.c
4 *
5 * Generic IOP331 IRQ handling functionality
6 *
7 * Author: Dave Jiang <dave.jiang@intel.com>
8 * Copyright (C) 2003 Intel Corp.
9 */
10
11#include <linux/init.h>
12#include <linux/interrupt.h>
13#include <linux/list.h>
14#include <asm/mach/irq.h>
15#include <asm/irq.h>
16#include <mach/hardware.h>
17#include <asm/mach-types.h>
18
19static u32 iop33x_mask0;
20static u32 iop33x_mask1;
21
22static void intctl0_write(u32 val)
23{
24 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val));
25}
26
27static void intctl1_write(u32 val)
28{
29 asm volatile("mcr p6, 0, %0, c1, c0, 0" : : "r" (val));
30}
31
32static void intstr0_write(u32 val)
33{
34 asm volatile("mcr p6, 0, %0, c2, c0, 0" : : "r" (val));
35}
36
37static void intstr1_write(u32 val)
38{
39 asm volatile("mcr p6, 0, %0, c3, c0, 0" : : "r" (val));
40}
41
42static void intbase_write(u32 val)
43{
44 asm volatile("mcr p6, 0, %0, c12, c0, 0" : : "r" (val));
45}
46
47static void intsize_write(u32 val)
48{
49 asm volatile("mcr p6, 0, %0, c13, c0, 0" : : "r" (val));
50}
51
52static void
53iop33x_irq_mask1 (struct irq_data *d)
54{
55 iop33x_mask0 &= ~(1 << d->irq);
56 intctl0_write(iop33x_mask0);
57}
58
59static void
60iop33x_irq_mask2 (struct irq_data *d)
61{
62 iop33x_mask1 &= ~(1 << (d->irq - 32));
63 intctl1_write(iop33x_mask1);
64}
65
66static void
67iop33x_irq_unmask1(struct irq_data *d)
68{
69 iop33x_mask0 |= 1 << d->irq;
70 intctl0_write(iop33x_mask0);
71}
72
73static void
74iop33x_irq_unmask2(struct irq_data *d)
75{
76 iop33x_mask1 |= (1 << (d->irq - 32));
77 intctl1_write(iop33x_mask1);
78}
79
80struct irq_chip iop33x_irqchip1 = {
81 .name = "IOP33x-1",
82 .irq_ack = iop33x_irq_mask1,
83 .irq_mask = iop33x_irq_mask1,
84 .irq_unmask = iop33x_irq_unmask1,
85};
86
87struct irq_chip iop33x_irqchip2 = {
88 .name = "IOP33x-2",
89 .irq_ack = iop33x_irq_mask2,
90 .irq_mask = iop33x_irq_mask2,
91 .irq_unmask = iop33x_irq_unmask2,
92};
93
94void __init iop33x_init_irq(void)
95{
96 int i;
97
98 iop_init_cp6_handler();
99
100 intctl0_write(0);
101 intctl1_write(0);
102 intstr0_write(0);
103 intstr1_write(0);
104 intbase_write(0);
105 intsize_write(1);
106 if (machine_is_iq80331())
107 *IOP3XX_PCIIRSR = 0x0f;
108
109 for (i = 0; i < NR_IRQS; i++) {
110 irq_set_chip_and_handler(i,
111 (i < 32) ? &iop33x_irqchip1 : &iop33x_irqchip2,
112 handle_level_irq);
113 irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE);
114 }
115}
diff --git a/arch/arm/mach-iop33x/uart.c b/arch/arm/mach-iop33x/uart.c
deleted file mode 100644
index 8fa079d2e3c3..000000000000
--- a/arch/arm/mach-iop33x/uart.c
+++ /dev/null
@@ -1,100 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * arch/arm/mach-iop33x/uart.c
4 *
5 * Author: Dave Jiang (dave.jiang@intel.com)
6 * Copyright (C) 2004 Intel Corporation.
7 */
8
9#include <linux/mm.h>
10#include <linux/init.h>
11#include <linux/major.h>
12#include <linux/fs.h>
13#include <linux/platform_device.h>
14#include <linux/serial.h>
15#include <linux/tty.h>
16#include <linux/serial_8250.h>
17#include <linux/io.h>
18#include <asm/pgtable.h>
19#include <asm/page.h>
20#include <asm/mach/map.h>
21#include <asm/setup.h>
22#include <asm/memory.h>
23#include <mach/hardware.h>
24#include <asm/hardware/iop3xx.h>
25#include <asm/mach/arch.h>
26
27#define IOP33X_UART_XTAL 33334000
28
29static struct plat_serial8250_port iop33x_uart0_data[] = {
30 {
31 .membase = (char *)IOP33X_UART0_VIRT,
32 .mapbase = IOP33X_UART0_PHYS,
33 .irq = IRQ_IOP33X_UART0,
34 .uartclk = IOP33X_UART_XTAL,
35 .regshift = 2,
36 .iotype = UPIO_MEM,
37 .flags = UPF_SKIP_TEST,
38 },
39 { },
40};
41
42static struct resource iop33x_uart0_resources[] = {
43 [0] = {
44 .start = IOP33X_UART0_PHYS,
45 .end = IOP33X_UART0_PHYS + 0x3f,
46 .flags = IORESOURCE_MEM,
47 },
48 [1] = {
49 .start = IRQ_IOP33X_UART0,
50 .end = IRQ_IOP33X_UART0,
51 .flags = IORESOURCE_IRQ,
52 },
53};
54
55struct platform_device iop33x_uart0_device = {
56 .name = "serial8250",
57 .id = PLAT8250_DEV_PLATFORM,
58 .dev = {
59 .platform_data = iop33x_uart0_data,
60 },
61 .num_resources = 2,
62 .resource = iop33x_uart0_resources,
63};
64
65
66static struct resource iop33x_uart1_resources[] = {
67 [0] = {
68 .start = IOP33X_UART1_PHYS,
69 .end = IOP33X_UART1_PHYS + 0x3f,
70 .flags = IORESOURCE_MEM,
71 },
72 [1] = {
73 .start = IRQ_IOP33X_UART1,
74 .end = IRQ_IOP33X_UART1,
75 .flags = IORESOURCE_IRQ,
76 },
77};
78
79static struct plat_serial8250_port iop33x_uart1_data[] = {
80 {
81 .membase = (char *)IOP33X_UART1_VIRT,
82 .mapbase = IOP33X_UART1_PHYS,
83 .irq = IRQ_IOP33X_UART1,
84 .uartclk = IOP33X_UART_XTAL,
85 .regshift = 2,
86 .iotype = UPIO_MEM,
87 .flags = UPF_SKIP_TEST,
88 },
89 { },
90};
91
92struct platform_device iop33x_uart1_device = {
93 .name = "serial8250",
94 .id = PLAT8250_DEV_PLATFORM1,
95 .dev = {
96 .platform_data = iop33x_uart1_data,
97 },
98 .num_resources = 2,
99 .resource = iop33x_uart1_resources,
100};
diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
deleted file mode 100644
index 724d7d039f74..000000000000
--- a/arch/arm/mach-ks8695/Kconfig
+++ /dev/null
@@ -1,88 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2if ARCH_KS8695
3
4menu "Kendin/Micrel KS8695 Implementations"
5
6config MACH_KS8695
7 bool "KS8695 development board"
8 select HAVE_PCI
9 help
10 Say 'Y' here if you want your kernel to run on the original
11 Kendin-Micrel KS8695 development board.
12
13config MACH_DSM320
14 bool "DSM-320 Wireless Media Player"
15 help
16 Say 'Y' here if you want your kernel to run on the D-Link
17 DSM-320 Wireless Media Player.
18
19config MACH_ACS5K
20 bool "Brivo Systems LLC, ACS-5000 Master board"
21 help
22 say 'Y' here if you want your kernel to run on the Brivo
23 Systems LLC, ACS-5000 Master board.
24
25config MACH_LITE300
26 bool "SecureComputing SG300"
27 help
28 Say 'Y' here if you want your kernel to support the
29 SecureComputing / SnapGear SG300 VPN Internet Router.
30 See http://www.securecomputing.com for more details.
31
32config MACH_SG310
33 bool "McAfee SG310"
34 help
35 Say 'Y' here if you want your kernel to support the
36 McAfee / SnapGear SG310 VPN Internet Router.
37 See http://www.mcafee.com for more details.
38
39config MACH_SE4200
40 bool "SecureComputing SE4200"
41 help
42 Say 'Y' here if you want your kernel to support the
43 SecureComputing / SnapGear SE4200 Secure Wireless VPN
44 Internet Router.
45 See http://www.securecomputing.com for more details.
46
47config MACH_CM4002
48 bool "OpenGear CM4002"
49 help
50 Say 'Y' here if you want your kernel to support the OpenGear
51 CM4002 Secure Access Server. See http://www.opengear.com for
52 more details.
53
54config MACH_CM4008
55 bool "OpenGear CM4008"
56 select HAVE_PCI
57 help
58 Say 'Y' here if you want your kernel to support the OpenGear
59 CM4008 Console Server. See http://www.opengear.com for more
60 details.
61
62config MACH_CM41xx
63 bool "OpenGear CM41xx"
64 select HAVE_PCI
65 help
66 Say 'Y' here if you want your kernel to support the OpenGear
67 CM4016 or CM4048 Console Servers. See http://www.opengear.com for
68 more details.
69
70config MACH_IM4004
71 bool "OpenGear IM4004"
72 select HAVE_PCI
73 help
74 Say 'Y' here if you want your kernel to support the OpenGear
75 IM4004 Secure Access Server. See http://www.opengear.com for
76 more details.
77
78config MACH_IM42xx
79 bool "OpenGear IM42xx"
80 select HAVE_PCI
81 help
82 Say 'Y' here if you want your kernel to support the OpenGear
83 IM4216 or IM4248 Console Servers. See http://www.opengear.com for
84 more details.
85
86endmenu
87
88endif
diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile
deleted file mode 100644
index 439b22255a32..000000000000
--- a/arch/arm/mach-ks8695/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# arch/arm/mach-ks8695/Makefile
3#
4# Makefile for KS8695 architecture support
5#
6
7obj-y := cpu.o irq.o time.o devices.o
8
9# PCI support is optional
10obj-$(CONFIG_PCI) += pci.o
11
12# Board-specific support
13obj-$(CONFIG_MACH_KS8695) += board-micrel.o
14obj-$(CONFIG_MACH_DSM320) += board-dsm320.o
15obj-$(CONFIG_MACH_ACS5K) += board-acs5k.o
16obj-$(CONFIG_MACH_LITE300) += board-sg.o
17obj-$(CONFIG_MACH_SG310) += board-sg.o
18obj-$(CONFIG_MACH_SE4200) += board-sg.o
19obj-$(CONFIG_MACH_CM4002) += board-og.o
20obj-$(CONFIG_MACH_CM4008) += board-og.o
21obj-$(CONFIG_MACH_CM41xx) += board-og.o
22obj-$(CONFIG_MACH_IM4004) += board-og.o
23obj-$(CONFIG_MACH_IM42xx) += board-og.o
diff --git a/arch/arm/mach-ks8695/Makefile.boot b/arch/arm/mach-ks8695/Makefile.boot
deleted file mode 100644
index cf32eb605bd8..000000000000
--- a/arch/arm/mach-ks8695/Makefile.boot
+++ /dev/null
@@ -1,9 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2# Note: the following conditions must always be true:
3# ZRELADDR == virt_to_phys(TEXTADDR)
4# PARAMS_PHYS must be within 4MB of ZRELADDR
5# INITRD_PHYS must be in RAM
6
7 zreladdr-y += 0x00008000
8params_phys-y := 0x00000100
9initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c
deleted file mode 100644
index f319258d1226..000000000000
--- a/arch/arm/mach-ks8695/board-acs5k.c
+++ /dev/null
@@ -1,238 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * arch/arm/mach-ks8695/board-acs5k.c
4 *
5 * Brivo Systems LLC, ACS-5000 Master Board
6 *
7 * Copyright 2008 Simtec Electronics
8 * Daniel Silverstone <dsilvers@simtec.co.uk>
9 */
10#include <linux/gpio.h>
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/gpio/machine.h>
17#include <linux/i2c.h>
18#include <linux/i2c-algo-bit.h>
19#include <linux/platform_data/i2c-gpio.h>
20#include <linux/platform_data/pca953x.h>
21
22#include <linux/mtd/mtd.h>
23#include <linux/mtd/map.h>
24#include <linux/mtd/physmap.h>
25#include <linux/mtd/partitions.h>
26
27#include <asm/mach-types.h>
28
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31#include <asm/mach/irq.h>
32
33#include "devices.h"
34#include <mach/gpio-ks8695.h>
35
36#include "generic.h"
37
38static struct gpiod_lookup_table acs5k_i2c_gpiod_table = {
39 .dev_id = "i2c-gpio",
40 .table = {
41 GPIO_LOOKUP_IDX("KS8695", 4, NULL, 0,
42 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
43 GPIO_LOOKUP_IDX("KS8695", 5, NULL, 1,
44 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
45 },
46};
47
48static struct i2c_gpio_platform_data acs5k_i2c_device_platdata = {
49 .udelay = 10,
50};
51
52static struct platform_device acs5k_i2c_device = {
53 .name = "i2c-gpio",
54 .id = -1,
55 .num_resources = 0,
56 .resource = NULL,
57 .dev = {
58 .platform_data = &acs5k_i2c_device_platdata,
59 },
60};
61
62static int acs5k_pca9555_setup(struct i2c_client *client,
63 unsigned gpio_base, unsigned ngpio,
64 void *context)
65{
66 static int acs5k_gpio_value[] = {
67 -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, 0, 1, 0, -1, -1
68 };
69 int n;
70
71 for (n = 0; n < ARRAY_SIZE(acs5k_gpio_value); ++n) {
72 gpio_request(gpio_base + n, "ACS-5000 GPIO Expander");
73 if (acs5k_gpio_value[n] < 0)
74 gpio_direction_input(gpio_base + n);
75 else
76 gpio_direction_output(gpio_base + n,
77 acs5k_gpio_value[n]);
78 gpio_export(gpio_base + n, 0); /* Export, direction locked down */
79 }
80
81 return 0;
82}
83
84static struct pca953x_platform_data acs5k_i2c_pca9555_platdata = {
85 .gpio_base = 16, /* Start directly after the CPU's GPIO */
86 .invert = 0, /* Do not invert */
87 .setup = acs5k_pca9555_setup,
88};
89
90static struct i2c_board_info acs5k_i2c_devs[] __initdata = {
91 {
92 I2C_BOARD_INFO("pcf8563", 0x51),
93 },
94 {
95 I2C_BOARD_INFO("pca9555", 0x20),
96 .platform_data = &acs5k_i2c_pca9555_platdata,
97 },
98};
99
100static void __init acs5k_i2c_init(void)
101{
102 /* The gpio interface */
103 gpiod_add_lookup_table(&acs5k_i2c_gpiod_table);
104 platform_device_register(&acs5k_i2c_device);
105 /* I2C devices */
106 i2c_register_board_info(0, acs5k_i2c_devs,
107 ARRAY_SIZE(acs5k_i2c_devs));
108}
109
110static struct mtd_partition acs5k_nor_partitions[] = {
111 [0] = {
112 .name = "Boot Agent and config",
113 .size = SZ_256K,
114 .offset = 0,
115 .mask_flags = MTD_WRITEABLE,
116 },
117 [1] = {
118 .name = "Kernel",
119 .size = SZ_1M,
120 .offset = SZ_256K,
121 },
122 [2] = {
123 .name = "SquashFS1",
124 .size = SZ_2M,
125 .offset = SZ_256K + SZ_1M,
126 },
127 [3] = {
128 .name = "SquashFS2",
129 .size = SZ_4M + SZ_2M,
130 .offset = SZ_256K + SZ_1M + SZ_2M,
131 },
132 [4] = {
133 .name = "Data",
134 .size = SZ_16M + SZ_4M + SZ_2M + SZ_512K, /* 22.5 MB */
135 .offset = SZ_256K + SZ_8M + SZ_1M,
136 }
137};
138
139static struct physmap_flash_data acs5k_nor_pdata = {
140 .width = 4,
141 .nr_parts = ARRAY_SIZE(acs5k_nor_partitions),
142 .parts = acs5k_nor_partitions,
143};
144
145static struct resource acs5k_nor_resource[] = {
146 [0] = {
147 .start = SZ_32M, /* We expect the bootloader to map
148 * the flash here.
149 */
150 .end = SZ_32M + SZ_16M - 1,
151 .flags = IORESOURCE_MEM,
152 },
153 [1] = {
154 .start = SZ_32M + SZ_16M,
155 .end = SZ_32M + SZ_32M - SZ_256K - 1,
156 .flags = IORESOURCE_MEM,
157 }
158};
159
160static struct platform_device acs5k_device_nor = {
161 .name = "physmap-flash",
162 .id = -1,
163 .num_resources = ARRAY_SIZE(acs5k_nor_resource),
164 .resource = acs5k_nor_resource,
165 .dev = {
166 .platform_data = &acs5k_nor_pdata,
167 },
168};
169
170static void __init acs5k_register_nor(void)
171{
172 int ret;
173
174 if (acs5k_nor_partitions[0].mask_flags == 0)
175 printk(KERN_WARNING "Warning: Unprotecting bootloader and configuration partition\n");
176
177 ret = platform_device_register(&acs5k_device_nor);
178 if (ret < 0)
179 printk(KERN_ERR "failed to register physmap-flash device\n");
180}
181
182static int __init acs5k_protection_setup(char *s)
183{
184 /* We can't allocate anything here but we should be able
185 * to trivially parse s and decide if we can protect the
186 * bootloader partition or not
187 */
188 if (strcmp(s, "no") == 0)
189 acs5k_nor_partitions[0].mask_flags = 0;
190
191 return 1;
192}
193
194__setup("protect_bootloader=", acs5k_protection_setup);
195
196static void __init acs5k_init_gpio(void)
197{
198 int i;
199
200 ks8695_register_gpios();
201 for (i = 0; i < 4; ++i)
202 gpio_request(i, "ACS5K IRQ");
203 gpio_request(7, "ACS5K KS_FRDY");
204 for (i = 8; i < 16; ++i)
205 gpio_request(i, "ACS5K Unused");
206
207 gpio_request(3, "ACS5K CAN Control");
208 gpio_request(6, "ACS5K Heartbeat");
209 gpio_direction_output(3, 1); /* Default CAN_RESET high */
210 gpio_direction_output(6, 0); /* Default KS8695_ACTIVE low */
211 gpio_export(3, 0); /* export CAN_RESET as output only */
212 gpio_export(6, 0); /* export KS8695_ACTIVE as output only */
213}
214
215static void __init acs5k_init(void)
216{
217 acs5k_init_gpio();
218
219 /* Network device */
220 ks8695_add_device_lan(); /* eth0 = LAN */
221 ks8695_add_device_wan(); /* ethX = WAN */
222
223 /* NOR devices */
224 acs5k_register_nor();
225
226 /* I2C bus */
227 acs5k_i2c_init();
228}
229
230MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
231 /* Maintainer: Simtec Electronics. */
232 .atag_offset = 0x100,
233 .map_io = ks8695_map_io,
234 .init_irq = ks8695_init_irq,
235 .init_machine = acs5k_init,
236 .init_time = ks8695_timer_init,
237 .restart = ks8695_restart,
238MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-dsm320.c b/arch/arm/mach-ks8695/board-dsm320.c
deleted file mode 100644
index d5f435cae6e0..000000000000
--- a/arch/arm/mach-ks8695/board-dsm320.c
+++ /dev/null
@@ -1,127 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * arch/arm/mach-ks8695/board-dsm320.c
4 *
5 * DSM-320 D-Link Wireless Media Player, board support.
6 *
7 * Copyright 2008 Simtec Electronics
8 * Daniel Silverstone <dsilvers@simtec.co.uk>
9 */
10#include <linux/gpio.h>
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16
17#include <linux/mtd/mtd.h>
18#include <linux/mtd/map.h>
19#include <linux/mtd/physmap.h>
20#include <linux/mtd/partitions.h>
21
22#include <asm/mach-types.h>
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26#include <asm/mach/irq.h>
27
28#include "devices.h"
29#include <mach/gpio-ks8695.h>
30
31#include "generic.h"
32
33#ifdef CONFIG_PCI
34static int dsm320_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
35{
36 switch (slot) {
37 case 0:
38 /* PCI-AHB bridge? */
39 return KS8695_IRQ_EXTERN0;
40 case 18:
41 /* Mini PCI slot */
42 return KS8695_IRQ_EXTERN2;
43 case 20:
44 /* RealMAGIC chip */
45 return KS8695_IRQ_EXTERN0;
46 }
47 BUG();
48}
49
50static struct ks8695_pci_cfg __initdata dsm320_pci = {
51 .mode = KS8695_MODE_MINIPCI,
52 .map_irq = dsm320_pci_map_irq,
53};
54
55static void __init dsm320_register_pci(void)
56{
57 /* Initialise the GPIO lines for interrupt mode */
58 /* RealMAGIC */
59 ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
60 /* MiniPCI Slot */
61 ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW);
62
63 ks8695_init_pci(&dsm320_pci);
64}
65
66#else
67static inline void __init dsm320_register_pci(void) { }
68#endif
69
70static struct physmap_flash_data dsm320_nor_pdata = {
71 .width = 4,
72 .nr_parts = 0,
73};
74
75static struct resource dsm320_nor_resource[] = {
76 [0] = {
77 .start = SZ_32M, /* We expect the bootloader to map
78 * the flash here.
79 */
80 .end = SZ_32M + SZ_4M - 1,
81 .flags = IORESOURCE_MEM,
82 }
83};
84
85static struct platform_device dsm320_device_nor = {
86 .name = "physmap-flash",
87 .id = -1,
88 .num_resources = ARRAY_SIZE(dsm320_nor_resource),
89 .resource = dsm320_nor_resource,
90 .dev = {
91 .platform_data = &dsm320_nor_pdata,
92 },
93};
94
95void __init dsm320_register_nor(void)
96{
97 int ret;
98
99 ret = platform_device_register(&dsm320_device_nor);
100 if (ret < 0)
101 printk(KERN_ERR "failed to register physmap-flash device\n");
102}
103
104static void __init dsm320_init(void)
105{
106 /* GPIO registration */
107 ks8695_register_gpios();
108
109 /* PCI registration */
110 dsm320_register_pci();
111
112 /* Network device */
113 ks8695_add_device_lan(); /* eth0 = LAN */
114
115 /* NOR devices */
116 dsm320_register_nor();
117}
118
119MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
120 /* Maintainer: Simtec Electronics. */
121 .atag_offset = 0x100,
122 .map_io = ks8695_map_io,
123 .init_irq = ks8695_init_irq,
124 .init_machine = dsm320_init,
125 .init_time = ks8695_timer_init,
126 .restart = ks8695_restart,
127MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-micrel.c b/arch/arm/mach-ks8695/board-micrel.c
deleted file mode 100644
index bf8856ce3fbb..000000000000
--- a/arch/arm/mach-ks8695/board-micrel.c
+++ /dev/null
@@ -1,59 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * arch/arm/mach-ks8695/board-micrel.c
4 */
5#include <linux/gpio.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/interrupt.h>
9#include <linux/init.h>
10#include <linux/platform_device.h>
11
12#include <asm/mach-types.h>
13
14#include <asm/mach/arch.h>
15#include <asm/mach/map.h>
16#include <asm/mach/irq.h>
17
18#include <mach/gpio-ks8695.h>
19#include "devices.h"
20
21#include "generic.h"
22
23#ifdef CONFIG_PCI
24static int micrel_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
25{
26 return KS8695_IRQ_EXTERN0;
27}
28
29static struct ks8695_pci_cfg __initdata micrel_pci = {
30 .mode = KS8695_MODE_MINIPCI,
31 .map_irq = micrel_pci_map_irq,
32};
33#endif
34
35
36static void __init micrel_init(void)
37{
38 printk(KERN_INFO "Micrel KS8695 Development Board initializing\n");
39
40 ks8695_register_gpios();
41
42#ifdef CONFIG_PCI
43 ks8695_init_pci(&micrel_pci);
44#endif
45
46 /* Add devices */
47 ks8695_add_device_wan(); /* eth0 = WAN */
48 ks8695_add_device_lan(); /* eth1 = LAN */
49}
50
51MACHINE_START(KS8695, "KS8695 Centaur Development Board")
52 /* Maintainer: Micrel Semiconductor Inc. */
53 .atag_offset = 0x100,
54 .map_io = ks8695_map_io,
55 .init_irq = ks8695_init_irq,
56 .init_machine = micrel_init,
57 .init_time = ks8695_timer_init,
58 .restart = ks8695_restart,
59MACHINE_END
diff --git a/arch/arm/mach-ks8695/board-og.c b/arch/arm/mach-ks8695/board-og.c
deleted file mode 100644
index 12ffe9227f9c..000000000000
--- a/arch/arm/mach-ks8695/board-og.c
+++ /dev/null
@@ -1,197 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * board-og.c -- support for the OpenGear KS8695 based boards.
4 */
5
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/interrupt.h>
9#include <linux/init.h>
10#include <linux/delay.h>
11#include <linux/platform_device.h>
12#include <linux/serial_8250.h>
13#include <linux/gpio.h>
14#include <linux/irq.h>
15#include <asm/mach-types.h>
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include "devices.h"
19#include <mach/regs-gpio.h>
20#include <mach/gpio-ks8695.h>
21#include "generic.h"
22
23static int og_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
24{
25 if (machine_is_im4004() && (slot == 8))
26 return KS8695_IRQ_EXTERN1;
27 return KS8695_IRQ_EXTERN0;
28}
29
30static struct ks8695_pci_cfg __initdata og_pci = {
31 .mode = KS8695_MODE_PCI,
32 .map_irq = og_pci_map_irq,
33};
34
35static void __init og_register_pci(void)
36{
37 /* Initialize the GPIO lines for interrupt mode */
38 ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
39
40 /* Cardbus Slot */
41 if (machine_is_im4004())
42 ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW);
43
44 if (IS_ENABLED(CONFIG_PCI))
45 ks8695_init_pci(&og_pci);
46}
47
48/*
49 * The PCI bus reset is driven by a dedicated GPIO line. Toggle it here
50 * and bring the PCI bus out of reset.
51 */
52static void __init og_pci_bus_reset(void)
53{
54 unsigned int rstline = 1;
55
56 /* Some boards use a different GPIO as the PCI reset line */
57 if (machine_is_im4004())
58 rstline = 2;
59 else if (machine_is_im42xx())
60 rstline = 0;
61
62 gpio_request(rstline, "PCI reset");
63 gpio_direction_output(rstline, 0);
64
65 /* Drive a reset on the PCI reset line */
66 gpio_set_value(rstline, 1);
67 gpio_set_value(rstline, 0);
68 mdelay(100);
69 gpio_set_value(rstline, 1);
70 mdelay(100);
71}
72
73/*
74 * Direct connect serial ports (non-PCI that is).
75 */
76#define S8250_PHYS 0x03800000
77#define S8250_VIRT 0xf4000000
78#define S8250_SIZE 0x00100000
79
80static struct map_desc og_io_desc[] __initdata = {
81 {
82 .virtual = S8250_VIRT,
83 .pfn = __phys_to_pfn(S8250_PHYS),
84 .length = S8250_SIZE,
85 .type = MT_DEVICE,
86 }
87};
88
89static struct resource og_uart_resources[] = {
90 {
91 .start = S8250_VIRT,
92 .end = S8250_VIRT + S8250_SIZE,
93 .flags = IORESOURCE_MEM
94 },
95};
96
97static struct plat_serial8250_port og_uart_data[] = {
98 {
99 .mapbase = S8250_VIRT,
100 .membase = (char *) S8250_VIRT,
101 .irq = 3,
102 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
103 .iotype = UPIO_MEM,
104 .regshift = 2,
105 .uartclk = 115200 * 16,
106 },
107 { },
108};
109
110static struct platform_device og_uart = {
111 .name = "serial8250",
112 .id = 0,
113 .dev.platform_data = og_uart_data,
114 .num_resources = 1,
115 .resource = og_uart_resources
116};
117
118static struct platform_device *og_devices[] __initdata = {
119 &og_uart
120};
121
122static void __init og_init(void)
123{
124 ks8695_register_gpios();
125
126 if (machine_is_cm4002()) {
127 ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_HIGH);
128 iotable_init(og_io_desc, ARRAY_SIZE(og_io_desc));
129 platform_add_devices(og_devices, ARRAY_SIZE(og_devices));
130 } else {
131 og_pci_bus_reset();
132 og_register_pci();
133 }
134
135 ks8695_add_device_lan();
136 ks8695_add_device_wan();
137}
138
139#ifdef CONFIG_MACH_CM4002
140MACHINE_START(CM4002, "OpenGear/CM4002")
141 /* OpenGear Inc. */
142 .atag_offset = 0x100,
143 .map_io = ks8695_map_io,
144 .init_irq = ks8695_init_irq,
145 .init_machine = og_init,
146 .init_time = ks8695_timer_init,
147 .restart = ks8695_restart,
148MACHINE_END
149#endif
150
151#ifdef CONFIG_MACH_CM4008
152MACHINE_START(CM4008, "OpenGear/CM4008")
153 /* OpenGear Inc. */
154 .atag_offset = 0x100,
155 .map_io = ks8695_map_io,
156 .init_irq = ks8695_init_irq,
157 .init_machine = og_init,
158 .init_time = ks8695_timer_init,
159 .restart = ks8695_restart,
160MACHINE_END
161#endif
162
163#ifdef CONFIG_MACH_CM41xx
164MACHINE_START(CM41XX, "OpenGear/CM41xx")
165 /* OpenGear Inc. */
166 .atag_offset = 0x100,
167 .map_io = ks8695_map_io,
168 .init_irq = ks8695_init_irq,
169 .init_machine = og_init,
170 .init_time = ks8695_timer_init,
171 .restart = ks8695_restart,
172MACHINE_END
173#endif
174
175#ifdef CONFIG_MACH_IM4004
176MACHINE_START(IM4004, "OpenGear/IM4004")
177 /* OpenGear Inc. */
178 .atag_offset = 0x100,
179 .map_io = ks8695_map_io,
180 .init_irq = ks8695_init_irq,
181 .init_machine = og_init,
182 .init_time = ks8695_timer_init,
183 .restart = ks8695_restart,
184MACHINE_END
185#endif
186
187#ifdef CONFIG_MACH_IM42xx
188MACHINE_START(IM42XX, "OpenGear/IM42xx")
189 /* OpenGear Inc. */
190 .atag_offset = 0x100,
191 .map_io = ks8695_map_io,
192 .init_irq = ks8695_init_irq,
193 .init_machine = og_init,
194 .init_time = ks8695_timer_init,
195 .restart = ks8695_restart,
196MACHINE_END
197#endif
diff --git a/arch/arm/mach-ks8695/board-sg.c b/arch/arm/mach-ks8695/board-sg.c
deleted file mode 100644
index d5ec85a56375..000000000000
--- a/arch/arm/mach-ks8695/board-sg.c
+++ /dev/null
@@ -1,118 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * board-sg.c -- support for the SnapGear KS8695 based boards
4 */
5
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
9#include <linux/platform_device.h>
10#include <linux/mtd/mtd.h>
11#include <linux/mtd/map.h>
12#include <linux/mtd/physmap.h>
13#include <linux/mtd/partitions.h>
14#include <asm/mach-types.h>
15#include <asm/mach/arch.h>
16#include "devices.h"
17#include "generic.h"
18
19/*
20 * The SG310 machine type is fitted with a conventional 8MB Strataflash
21 * device. Define its partitioning.
22 */
23#define FL_BASE 0x02000000
24#define FL_SIZE SZ_8M
25
26static struct mtd_partition sg_mtd_partitions[] = {
27 [0] = {
28 .name = "SnapGear Boot Loader",
29 .size = SZ_128K,
30 },
31 [1] = {
32 .name = "SnapGear non-volatile configuration",
33 .size = SZ_512K,
34 .offset = SZ_256K,
35 },
36 [2] = {
37 .name = "SnapGear image",
38 .offset = SZ_512K + SZ_256K,
39 },
40 [3] = {
41 .name = "SnapGear StrataFlash",
42 },
43 [4] = {
44 .name = "SnapGear Boot Tags",
45 .size = SZ_128K,
46 .offset = SZ_128K,
47 },
48};
49
50static struct physmap_flash_data sg_mtd_pdata = {
51 .width = 1,
52 .nr_parts = ARRAY_SIZE(sg_mtd_partitions),
53 .parts = sg_mtd_partitions,
54};
55
56
57static struct resource sg_mtd_resource[] = {
58 [0] = {
59 .start = FL_BASE,
60 .end = FL_BASE + FL_SIZE - 1,
61 .flags = IORESOURCE_MEM,
62 },
63};
64
65static struct platform_device sg_mtd_device = {
66 .name = "physmap-flash",
67 .id = 0,
68 .num_resources = ARRAY_SIZE(sg_mtd_resource),
69 .resource = sg_mtd_resource,
70 .dev = {
71 .platform_data = &sg_mtd_pdata,
72 },
73};
74
75static void __init sg_init(void)
76{
77 ks8695_add_device_lan();
78 ks8695_add_device_wan();
79
80 if (machine_is_sg310())
81 platform_device_register(&sg_mtd_device);
82}
83
84#ifdef CONFIG_MACH_LITE300
85MACHINE_START(LITE300, "SecureComputing/SG300")
86 /* SnapGear */
87 .atag_offset = 0x100,
88 .map_io = ks8695_map_io,
89 .init_irq = ks8695_init_irq,
90 .init_machine = sg_init,
91 .init_time = ks8695_timer_init,
92 .restart = ks8695_restart,
93MACHINE_END
94#endif
95
96#ifdef CONFIG_MACH_SG310
97MACHINE_START(SG310, "McAfee/SG310")
98 /* SnapGear */
99 .atag_offset = 0x100,
100 .map_io = ks8695_map_io,
101 .init_irq = ks8695_init_irq,
102 .init_machine = sg_init,
103 .init_time = ks8695_timer_init,
104 .restart = ks8695_restart,
105MACHINE_END
106#endif
107
108#ifdef CONFIG_MACH_SE4200
109MACHINE_START(SE4200, "SecureComputing/SE4200")
110 /* SnapGear */
111 .atag_offset = 0x100,
112 .map_io = ks8695_map_io,
113 .init_irq = ks8695_init_irq,
114 .init_machine = sg_init,
115 .init_time = ks8695_timer_init,
116 .restart = ks8695_restart,
117MACHINE_END
118#endif
diff --git a/arch/arm/mach-ks8695/cpu.c b/arch/arm/mach-ks8695/cpu.c
deleted file mode 100644
index aa6bb0c93aa8..000000000000
--- a/arch/arm/mach-ks8695/cpu.c
+++ /dev/null
@@ -1,60 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * arch/arm/mach-ks8695/cpu.c
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7 *
8 * KS8695 CPU support
9 */
10
11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/io.h>
15
16#include <mach/hardware.h>
17#include <asm/mach/arch.h>
18#include <asm/mach/map.h>
19
20#include "regs-sys.h"
21#include <mach/regs-misc.h>
22
23
24static struct map_desc ks8695_io_desc[] __initdata = {
25 {
26 .virtual = (unsigned long)KS8695_IO_VA,
27 .pfn = __phys_to_pfn(KS8695_IO_PA),
28 .length = KS8695_IO_SIZE,
29 .type = MT_DEVICE,
30 }
31};
32
33static void __init ks8695_processor_info(void)
34{
35 unsigned long id, rev;
36
37 id = __raw_readl(KS8695_MISC_VA + KS8695_DID);
38 rev = __raw_readl(KS8695_MISC_VA + KS8695_RID);
39
40 printk("KS8695 ID=%04lx SubID=%02lx Revision=%02lx\n", (id & DID_ID), (rev & RID_SUBID), (rev & RID_REVISION));
41}
42
43static unsigned int sysclk[8] = { 125000000, 100000000, 62500000, 50000000, 41700000, 33300000, 31300000, 25000000 };
44static unsigned int cpuclk[8] = { 166000000, 166000000, 83000000, 83000000, 55300000, 55300000, 41500000, 41500000 };
45
46static void __init ks8695_clock_info(void)
47{
48 unsigned int scdc = __raw_readl(KS8695_SYS_VA + KS8695_CLKCON) & CLKCON_SCDC;
49
50 printk("Clocks: System %u MHz, CPU %u MHz\n",
51 sysclk[scdc] / 1000000, cpuclk[scdc] / 1000000);
52}
53
54void __init ks8695_map_io(void)
55{
56 iotable_init(ks8695_io_desc, ARRAY_SIZE(ks8695_io_desc));
57
58 ks8695_processor_info();
59 ks8695_clock_info();
60}
diff --git a/arch/arm/mach-ks8695/devices.c b/arch/arm/mach-ks8695/devices.c
deleted file mode 100644
index 61cf20beb45f..000000000000
--- a/arch/arm/mach-ks8695/devices.c
+++ /dev/null
@@ -1,197 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/devices.c
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22
23#include <linux/gpio.h>
24#include <linux/platform_device.h>
25
26#include <mach/irqs.h>
27#include "regs-wan.h"
28#include "regs-lan.h"
29#include "regs-hpna.h"
30#include <mach/regs-switch.h>
31#include <mach/regs-misc.h>
32
33
34/* --------------------------------------------------------------------
35 * Ethernet
36 * -------------------------------------------------------------------- */
37
38static u64 eth_dmamask = 0xffffffffUL;
39
40static struct resource ks8695_wan_resources[] = {
41 [0] = {
42 .start = KS8695_WAN_PA,
43 .end = KS8695_WAN_PA + 0x00ff,
44 .flags = IORESOURCE_MEM,
45 },
46 [1] = {
47 .name = "WAN RX",
48 .start = KS8695_IRQ_WAN_RX_STATUS,
49 .end = KS8695_IRQ_WAN_RX_STATUS,
50 .flags = IORESOURCE_IRQ,
51 },
52 [2] = {
53 .name = "WAN TX",
54 .start = KS8695_IRQ_WAN_TX_STATUS,
55 .end = KS8695_IRQ_WAN_TX_STATUS,
56 .flags = IORESOURCE_IRQ,
57 },
58 [3] = {
59 .name = "WAN Link",
60 .start = KS8695_IRQ_WAN_LINK,
61 .end = KS8695_IRQ_WAN_LINK,
62 .flags = IORESOURCE_IRQ,
63 },
64 [4] = {
65 .name = "WAN PHY",
66 .start = KS8695_MISC_PA,
67 .end = KS8695_MISC_PA + 0x1f,
68 .flags = IORESOURCE_MEM,
69 },
70};
71
72static struct platform_device ks8695_wan_device = {
73 .name = "ks8695_ether",
74 .id = 0,
75 .dev = {
76 .dma_mask = &eth_dmamask,
77 .coherent_dma_mask = 0xffffffff,
78 },
79 .resource = ks8695_wan_resources,
80 .num_resources = ARRAY_SIZE(ks8695_wan_resources),
81};
82
83
84static struct resource ks8695_lan_resources[] = {
85 [0] = {
86 .start = KS8695_LAN_PA,
87 .end = KS8695_LAN_PA + 0x00ff,
88 .flags = IORESOURCE_MEM,
89 },
90 [1] = {
91 .name = "LAN RX",
92 .start = KS8695_IRQ_LAN_RX_STATUS,
93 .end = KS8695_IRQ_LAN_RX_STATUS,
94 .flags = IORESOURCE_IRQ,
95 },
96 [2] = {
97 .name = "LAN TX",
98 .start = KS8695_IRQ_LAN_TX_STATUS,
99 .end = KS8695_IRQ_LAN_TX_STATUS,
100 .flags = IORESOURCE_IRQ,
101 },
102 [3] = {
103 .name = "LAN SWITCH",
104 .start = KS8695_SWITCH_PA,
105 .end = KS8695_SWITCH_PA + 0x4f,
106 .flags = IORESOURCE_MEM,
107 },
108};
109
110static struct platform_device ks8695_lan_device = {
111 .name = "ks8695_ether",
112 .id = 1,
113 .dev = {
114 .dma_mask = &eth_dmamask,
115 .coherent_dma_mask = 0xffffffff,
116 },
117 .resource = ks8695_lan_resources,
118 .num_resources = ARRAY_SIZE(ks8695_lan_resources),
119};
120
121
122static struct resource ks8695_hpna_resources[] = {
123 [0] = {
124 .start = KS8695_HPNA_PA,
125 .end = KS8695_HPNA_PA + 0x00ff,
126 .flags = IORESOURCE_MEM,
127 },
128 [1] = {
129 .name = "HPNA RX",
130 .start = KS8695_IRQ_HPNA_RX_STATUS,
131 .end = KS8695_IRQ_HPNA_RX_STATUS,
132 .flags = IORESOURCE_IRQ,
133 },
134 [2] = {
135 .name = "HPNA TX",
136 .start = KS8695_IRQ_HPNA_TX_STATUS,
137 .end = KS8695_IRQ_HPNA_TX_STATUS,
138 .flags = IORESOURCE_IRQ,
139 },
140};
141
142static struct platform_device ks8695_hpna_device = {
143 .name = "ks8695_ether",
144 .id = 2,
145 .dev = {
146 .dma_mask = &eth_dmamask,
147 .coherent_dma_mask = 0xffffffff,
148 },
149 .resource = ks8695_hpna_resources,
150 .num_resources = ARRAY_SIZE(ks8695_hpna_resources),
151};
152
153void __init ks8695_add_device_wan(void)
154{
155 platform_device_register(&ks8695_wan_device);
156}
157
158void __init ks8695_add_device_lan(void)
159{
160 platform_device_register(&ks8695_lan_device);
161}
162
163void __init ks8696_add_device_hpna(void)
164{
165 platform_device_register(&ks8695_hpna_device);
166}
167
168
169/* --------------------------------------------------------------------
170 * Watchdog
171 * -------------------------------------------------------------------- */
172
173static struct platform_device ks8695_wdt_device = {
174 .name = "ks8695_wdt",
175 .id = -1,
176 .num_resources = 0,
177};
178
179static void __init ks8695_add_device_watchdog(void)
180{
181 platform_device_register(&ks8695_wdt_device);
182}
183
184
185/* -------------------------------------------------------------------- */
186
187/*
188 * These devices are always present and don't need any board-specific
189 * setup.
190 */
191static int __init ks8695_add_standard_devices(void)
192{
193 ks8695_add_device_watchdog();
194 return 0;
195}
196
197arch_initcall(ks8695_add_standard_devices);
diff --git a/arch/arm/mach-ks8695/devices.h b/arch/arm/mach-ks8695/devices.h
deleted file mode 100644
index cc23ee3820ea..000000000000
--- a/arch/arm/mach-ks8695/devices.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-ks8695/include/mach/devices.h
4 *
5 * Copyright (C) 2006 Andrew Victor
6 */
7
8#ifndef __ASM_ARCH_DEVICES_H
9#define __ASM_ARCH_DEVICES_H
10
11#include <linux/pci.h>
12
13 /* Ethernet */
14extern void __init ks8695_add_device_wan(void);
15extern void __init ks8695_add_device_lan(void);
16extern void __init ks8695_add_device_hpna(void);
17
18 /* PCI */
19#define KS8695_MODE_PCI 0
20#define KS8695_MODE_MINIPCI 1
21#define KS8695_MODE_CARDBUS 2
22
23struct ks8695_pci_cfg {
24 short mode;
25 int (*map_irq)(const struct pci_dev *, u8, u8);
26};
27extern __init void ks8695_init_pci(struct ks8695_pci_cfg *);
28
29#endif
diff --git a/arch/arm/mach-ks8695/generic.h b/arch/arm/mach-ks8695/generic.h
deleted file mode 100644
index 9e9cbdd436a9..000000000000
--- a/arch/arm/mach-ks8695/generic.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-ks8695/generic.h
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7*/
8
9extern __init void ks8695_map_io(void);
10extern __init void ks8695_init_irq(void);
11extern void ks8695_restart(enum reboot_mode, const char *);
12extern void ks8695_timer_init(void);
diff --git a/arch/arm/mach-ks8695/include/mach/entry-macro.S b/arch/arm/mach-ks8695/include/mach/entry-macro.S
deleted file mode 100644
index 7ff812cb010b..000000000000
--- a/arch/arm/mach-ks8695/include/mach/entry-macro.S
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/entry-macro.S
3 *
4 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5 * Copyright (C) 2006 Simtec Electronics
6 *
7 * Low-level IRQ helper macros for KS8695
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12*/
13
14#include <mach/hardware.h>
15#include <mach/regs-irq.h>
16
17 .macro get_irqnr_preamble, base, tmp
18 ldr \base, =KS8695_IRQ_VA @ Base address of interrupt controller
19 .endm
20
21 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
22 ldr \irqstat, [\base, #KS8695_INTMS] @ Mask Status register
23
24 teq \irqstat, #0
25 beq 1001f
26
27 mov \irqnr, #0
28
29 tst \irqstat, #0xff
30 moveq \irqstat, \irqstat, lsr #8
31 addeq \irqnr, \irqnr, #8
32 tsteq \irqstat, #0xff
33 moveq \irqstat, \irqstat, lsr #8
34 addeq \irqnr, \irqnr, #8
35 tsteq \irqstat, #0xff
36 moveq \irqstat, \irqstat, lsr #8
37 addeq \irqnr, \irqnr, #8
38 tst \irqstat, #0x0f
39 moveq \irqstat, \irqstat, lsr #4
40 addeq \irqnr, \irqnr, #4
41 tst \irqstat, #0x03
42 moveq \irqstat, \irqstat, lsr #2
43 addeq \irqnr, \irqnr, #2
44 tst \irqstat, #0x01
45 addseq \irqnr, \irqnr, #1
461001:
47 .endm
diff --git a/arch/arm/mach-ks8695/include/mach/gpio-ks8695.h b/arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
deleted file mode 100644
index 600115f48fb3..000000000000
--- a/arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2006 Andrew Victor
4 */
5
6#ifndef __MACH_KS8659_GPIO_H
7#define __MACH_KS8659_GPIO_H
8
9#include <linux/kernel.h>
10
11#define KS8695_GPIO_0 0
12#define KS8695_GPIO_1 1
13#define KS8695_GPIO_2 2
14#define KS8695_GPIO_3 3
15#define KS8695_GPIO_4 4
16#define KS8695_GPIO_5 5
17#define KS8695_GPIO_6 6
18#define KS8695_GPIO_7 7
19#define KS8695_GPIO_8 8
20#define KS8695_GPIO_9 9
21#define KS8695_GPIO_10 10
22#define KS8695_GPIO_11 11
23#define KS8695_GPIO_12 12
24#define KS8695_GPIO_13 13
25#define KS8695_GPIO_14 14
26#define KS8695_GPIO_15 15
27
28/*
29 * Configure GPIO pin as external interrupt source.
30 */
31extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
32
33/* Register the GPIOs */
34extern void ks8695_register_gpios(void);
35
36#endif /* __MACH_KS8659_GPIO_H */
diff --git a/arch/arm/mach-ks8695/include/mach/hardware.h b/arch/arm/mach-ks8695/include/mach/hardware.h
deleted file mode 100644
index 0fb889be8112..000000000000
--- a/arch/arm/mach-ks8695/include/mach/hardware.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-ks8695/include/mach/hardware.h
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7 *
8 * KS8695 - Memory Map definitions
9*/
10
11#ifndef __ASM_ARCH_HARDWARE_H
12#define __ASM_ARCH_HARDWARE_H
13
14#include <linux/sizes.h>
15
16/*
17 * Clocks are derived from MCLK, which is 25MHz
18 */
19#define KS8695_CLOCK_RATE 25000000
20
21/*
22 * Physical RAM address.
23 */
24#define KS8695_SDRAM_PA 0x00000000
25
26
27/*
28 * We map an entire MiB with the System Configuration Registers in even
29 * though only 64KiB is needed. This makes it easier for use with the
30 * head debug code as the initial MMU setup only deals in L1 sections.
31 */
32#define KS8695_IO_PA 0x03F00000
33#define KS8695_IO_VA IOMEM(0xF0000000)
34#define KS8695_IO_SIZE SZ_1M
35
36#define KS8695_PCIMEM_PA 0x60000000
37#define KS8695_PCIMEM_SIZE SZ_512M
38
39#define KS8695_PCIIO_PA 0x80000000
40#define KS8695_PCIIO_SIZE SZ_64K
41
42#endif
diff --git a/arch/arm/mach-ks8695/include/mach/irqs.h b/arch/arm/mach-ks8695/include/mach/irqs.h
deleted file mode 100644
index 0cbb30672427..000000000000
--- a/arch/arm/mach-ks8695/include/mach/irqs.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-ks8695/include/mach/irqs.h
4 *
5 * Copyright (C) 2006 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 */
8
9#ifndef __ASM_ARCH_IRQS_H
10#define __ASM_ARCH_IRQS_H
11
12
13#define NR_IRQS 32
14
15/*
16 * IRQ definitions
17 */
18#define KS8695_IRQ_COMM_RX 0
19#define KS8695_IRQ_COMM_TX 1
20#define KS8695_IRQ_EXTERN0 2
21#define KS8695_IRQ_EXTERN1 3
22#define KS8695_IRQ_EXTERN2 4
23#define KS8695_IRQ_EXTERN3 5
24#define KS8695_IRQ_TIMER0 6
25#define KS8695_IRQ_TIMER1 7
26#define KS8695_IRQ_UART_TX 8
27#define KS8695_IRQ_UART_RX 9
28#define KS8695_IRQ_UART_LINE_STATUS 10
29#define KS8695_IRQ_UART_MODEM_STATUS 11
30#define KS8695_IRQ_LAN_RX_STOP 12
31#define KS8695_IRQ_LAN_TX_STOP 13
32#define KS8695_IRQ_LAN_RX_BUF 14
33#define KS8695_IRQ_LAN_TX_BUF 15
34#define KS8695_IRQ_LAN_RX_STATUS 16
35#define KS8695_IRQ_LAN_TX_STATUS 17
36#define KS8695_IRQ_HPNA_RX_STOP 18
37#define KS8695_IRQ_HPNA_TX_STOP 19
38#define KS8695_IRQ_HPNA_RX_BUF 20
39#define KS8695_IRQ_HPNA_TX_BUF 21
40#define KS8695_IRQ_HPNA_RX_STATUS 22
41#define KS8695_IRQ_HPNA_TX_STATUS 23
42#define KS8695_IRQ_BUS_ERROR 24
43#define KS8695_IRQ_WAN_RX_STOP 25
44#define KS8695_IRQ_WAN_TX_STOP 26
45#define KS8695_IRQ_WAN_RX_BUF 27
46#define KS8695_IRQ_WAN_TX_BUF 28
47#define KS8695_IRQ_WAN_RX_STATUS 29
48#define KS8695_IRQ_WAN_TX_STATUS 30
49#define KS8695_IRQ_WAN_LINK 31
50
51#endif
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h
deleted file mode 100644
index ab0d27fa8969..000000000000
--- a/arch/arm/mach-ks8695/include/mach/memory.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/memory.h
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * KS8695 Memory definitions
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H
15
16#include <mach/hardware.h>
17
18#ifndef __ASSEMBLY__
19
20#ifdef CONFIG_PCI
21
22/* PCI mappings */
23#define __virt_to_bus(x) ((x) - PAGE_OFFSET + KS8695_PCIMEM_PA)
24#define __bus_to_virt(x) ((x) - KS8695_PCIMEM_PA + PAGE_OFFSET)
25
26/* Platform-bus mapping */
27extern struct bus_type platform_bus_type;
28#define is_lbus_device(dev) (dev && dev->bus == &platform_bus_type)
29#define __arch_dma_to_virt(dev, x) ({ (void *) (is_lbus_device(dev) ? \
30 __phys_to_virt(x) : __bus_to_virt(x)); })
31#define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \
32 (dma_addr_t)__virt_to_phys((unsigned long)x) \
33 : (dma_addr_t)__virt_to_bus(x); })
34#define __arch_pfn_to_dma(dev, pfn) \
35 ({ dma_addr_t __dma = __pfn_to_phys(pfn); \
36 if (!is_lbus_device(dev)) \
37 __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
38 __dma; })
39
40#define __arch_dma_to_pfn(dev, x) \
41 ({ dma_addr_t __dma = x; \
42 if (!is_lbus_device(dev)) \
43 __dma += PHYS_OFFSET - KS8695_PCIMEM_PA; \
44 __phys_to_pfn(__dma); \
45 })
46
47#endif
48
49#endif
50
51#endif
diff --git a/arch/arm/mach-ks8695/include/mach/regs-gpio.h b/arch/arm/mach-ks8695/include/mach/regs-gpio.h
deleted file mode 100644
index 90614a7d0548..000000000000
--- a/arch/arm/mach-ks8695/include/mach/regs-gpio.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-gpio.h
3 *
4 * Copyright (C) 2007 Andrew Victor
5 *
6 * KS8695 - GPIO control registers and bit definitions.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef KS8695_GPIO_H
14#define KS8695_GPIO_H
15
16#define KS8695_GPIO_OFFSET (0xF0000 + 0xE600)
17#define KS8695_GPIO_VA (KS8695_IO_VA + KS8695_GPIO_OFFSET)
18#define KS8695_GPIO_PA (KS8695_IO_PA + KS8695_GPIO_OFFSET)
19
20
21#define KS8695_IOPM (0x00) /* I/O Port Mode Register */
22#define KS8695_IOPC (0x04) /* I/O Port Control Register */
23#define KS8695_IOPD (0x08) /* I/O Port Data Register */
24
25
26/* Port Mode Register */
27#define IOPM(x) (1 << (x)) /* Mode for GPIO Pin x */
28
29/* Port Control Register */
30#define IOPC_IOTIM1EN (1 << 17) /* GPIO Pin for Timer1 Enable */
31#define IOPC_IOTIM0EN (1 << 16) /* GPIO Pin for Timer0 Enable */
32#define IOPC_IOEINT3EN (1 << 15) /* GPIO Pin for External/Soft Interrupt 3 Enable */
33#define IOPC_IOEINT3TM (7 << 12) /* GPIO Pin for External/Soft Interrupt 3 Trigger Mode */
34#define IOPC_IOEINT3_MODE(x) ((x) << 12)
35#define IOPC_IOEINT2EN (1 << 11) /* GPIO Pin for External/Soft Interrupt 2 Enable */
36#define IOPC_IOEINT2TM (7 << 8) /* GPIO Pin for External/Soft Interrupt 2 Trigger Mode */
37#define IOPC_IOEINT2_MODE(x) ((x) << 8)
38#define IOPC_IOEINT1EN (1 << 7) /* GPIO Pin for External/Soft Interrupt 1 Enable */
39#define IOPC_IOEINT1TM (7 << 4) /* GPIO Pin for External/Soft Interrupt 1 Trigger Mode */
40#define IOPC_IOEINT1_MODE(x) ((x) << 4)
41#define IOPC_IOEINT0EN (1 << 3) /* GPIO Pin for External/Soft Interrupt 0 Enable */
42#define IOPC_IOEINT0TM (7 << 0) /* GPIO Pin for External/Soft Interrupt 0 Trigger Mode */
43#define IOPC_IOEINT0_MODE(x) ((x) << 0)
44
45 /* Trigger Modes */
46#define IOPC_TM_LOW (0) /* Level Detection (Active Low) */
47#define IOPC_TM_HIGH (1) /* Level Detection (Active High) */
48#define IOPC_TM_RISING (2) /* Rising Edge Detection */
49#define IOPC_TM_FALLING (4) /* Falling Edge Detection */
50#define IOPC_TM_EDGE (6) /* Both Edge Detection */
51
52/* Port Data Register */
53#define IOPD(x) (1 << (x)) /* Signal Level of GPIO Pin x */
54
55#endif
diff --git a/arch/arm/mach-ks8695/include/mach/regs-irq.h b/arch/arm/mach-ks8695/include/mach/regs-irq.h
deleted file mode 100644
index 352b7e8704d5..000000000000
--- a/arch/arm/mach-ks8695/include/mach/regs-irq.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-irq.h
3 *
4 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5 * Copyright (C) 2006 Simtec Electronics
6 *
7 * KS8695 - IRQ registers and bit definitions
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef KS8695_IRQ_H
15#define KS8695_IRQ_H
16
17#define KS8695_IRQ_OFFSET (0xF0000 + 0xE200)
18#define KS8695_IRQ_VA (KS8695_IO_VA + KS8695_IRQ_OFFSET)
19#define KS8695_IRQ_PA (KS8695_IO_PA + KS8695_IRQ_OFFSET)
20
21
22/*
23 * Interrupt Controller registers
24 */
25#define KS8695_INTMC (0x00) /* Mode Control Register */
26#define KS8695_INTEN (0x04) /* Interrupt Enable Register */
27#define KS8695_INTST (0x08) /* Interrupt Status Register */
28#define KS8695_INTPW (0x0c) /* Interrupt Priority (WAN MAC) */
29#define KS8695_INTPH (0x10) /* Interrupt Priority (HPNA) [KS8695 only] */
30#define KS8695_INTPL (0x14) /* Interrupt Priority (LAN MAC) */
31#define KS8695_INTPT (0x18) /* Interrupt Priority (Timer) */
32#define KS8695_INTPU (0x1c) /* Interrupt Priority (UART) */
33#define KS8695_INTPE (0x20) /* Interrupt Priority (External Interrupt) */
34#define KS8695_INTPC (0x24) /* Interrupt Priority (Communications Channel) */
35#define KS8695_INTPBE (0x28) /* Interrupt Priority (Bus Error Response) */
36#define KS8695_INTMS (0x2c) /* Interrupt Mask Status Register */
37#define KS8695_INTHPF (0x30) /* Interrupt Pending Highest Priority (FIQ) */
38#define KS8695_INTHPI (0x34) /* Interrupt Pending Highest Priority (IRQ) */
39
40
41#endif
diff --git a/arch/arm/mach-ks8695/include/mach/regs-misc.h b/arch/arm/mach-ks8695/include/mach/regs-misc.h
deleted file mode 100644
index 2740c52494a0..000000000000
--- a/arch/arm/mach-ks8695/include/mach/regs-misc.h
+++ /dev/null
@@ -1,97 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-misc.h
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * KS8695 - Miscellaneous Registers
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef KS8695_MISC_H
14#define KS8695_MISC_H
15
16#define KS8695_MISC_OFFSET (0xF0000 + 0xEA00)
17#define KS8695_MISC_VA (KS8695_IO_VA + KS8695_MISC_OFFSET)
18#define KS8695_MISC_PA (KS8695_IO_PA + KS8695_MISC_OFFSET)
19
20
21/*
22 * Miscellaneous registers
23 */
24#define KS8695_DID (0x00) /* Device ID */
25#define KS8695_RID (0x04) /* Revision ID */
26#define KS8695_HMC (0x08) /* HPNA Miscellaneous Control [KS8695 only] */
27#define KS8695_WMC (0x0c) /* WAN Miscellaneous Control */
28#define KS8695_WPPM (0x10) /* WAN PHY Power Management */
29#define KS8695_PPS (0x1c) /* PHY PowerSave */
30
31/* Device ID Register */
32#define DID_ID (0xffff << 0) /* Device ID */
33
34/* Revision ID Register */
35#define RID_SUBID (0xf << 4) /* Sub-Device ID */
36#define RID_REVISION (0xf << 0) /* Revision ID */
37
38/* HPNA Miscellaneous Control Register */
39#define HMC_HSS (1 << 1) /* Speed */
40#define HMC_HDS (1 << 0) /* Duplex */
41
42/* WAN Miscellaneous Control Register */
43#define WMC_WANC (1 << 30) /* Auto-negotiation complete */
44#define WMC_WANR (1 << 29) /* Auto-negotiation restart */
45#define WMC_WANAP (1 << 28) /* Advertise Pause */
46#define WMC_WANA100F (1 << 27) /* Advertise 100 FDX */
47#define WMC_WANA100H (1 << 26) /* Advertise 100 HDX */
48#define WMC_WANA10F (1 << 25) /* Advertise 10 FDX */
49#define WMC_WANA10H (1 << 24) /* Advertise 10 HDX */
50#define WMC_WLS (1 << 23) /* Link status */
51#define WMC_WDS (1 << 22) /* Duplex status */
52#define WMC_WSS (1 << 21) /* Speed status */
53#define WMC_WLPP (1 << 20) /* Link Partner Pause */
54#define WMC_WLP100F (1 << 19) /* Link Partner 100 FDX */
55#define WMC_WLP100H (1 << 18) /* Link Partner 100 HDX */
56#define WMC_WLP10F (1 << 17) /* Link Partner 10 FDX */
57#define WMC_WLP10H (1 << 16) /* Link Partner 10 HDX */
58#define WMC_WAND (1 << 15) /* Auto-negotiation disable */
59#define WMC_WANF100 (1 << 14) /* Force 100 */
60#define WMC_WANFF (1 << 13) /* Force FDX */
61#define WMC_WLED1S (7 << 4) /* LED1 Select */
62#define WLED1S_SPEED (0 << 4)
63#define WLED1S_LINK (1 << 4)
64#define WLED1S_DUPLEX (2 << 4)
65#define WLED1S_COLLISION (3 << 4)
66#define WLED1S_ACTIVITY (4 << 4)
67#define WLED1S_FDX_COLLISION (5 << 4)
68#define WLED1S_LINK_ACTIVITY (6 << 4)
69#define WMC_WLED0S (7 << 0) /* LED0 Select */
70#define WLED0S_SPEED (0 << 0)
71#define WLED0S_LINK (1 << 0)
72#define WLED0S_DUPLEX (2 << 0)
73#define WLED0S_COLLISION (3 << 0)
74#define WLED0S_ACTIVITY (4 << 0)
75#define WLED0S_FDX_COLLISION (5 << 0)
76#define WLED0S_LINK_ACTIVITY (6 << 0)
77
78/* WAN PHY Power Management Register */
79#define WPPM_WLPBK (1 << 14) /* Local Loopback */
80#define WPPM_WRLPKB (1 << 13) /* Remove Loopback */
81#define WPPM_WPI (1 << 12) /* PHY isolate */
82#define WPPM_WFL (1 << 10) /* Force link */
83#define WPPM_MDIXS (1 << 9) /* MDIX Status */
84#define WPPM_FEF (1 << 8) /* Far End Fault */
85#define WPPM_AMDIXP (1 << 7) /* Auto MDIX Parameter */
86#define WPPM_TXDIS (1 << 6) /* Disable transmitter */
87#define WPPM_DFEF (1 << 5) /* Disable Far End Fault */
88#define WPPM_PD (1 << 4) /* Power Down */
89#define WPPM_DMDX (1 << 3) /* Disable Auto MDI/MDIX */
90#define WPPM_FMDX (1 << 2) /* Force MDIX */
91#define WPPM_LPBK (1 << 1) /* MAX Loopback */
92
93/* PHY Power Save Register */
94#define PPS_PPSM (1 << 0) /* PHY Power Save Mode */
95
96
97#endif
diff --git a/arch/arm/mach-ks8695/include/mach/regs-switch.h b/arch/arm/mach-ks8695/include/mach/regs-switch.h
deleted file mode 100644
index 97e8acb1cf6c..000000000000
--- a/arch/arm/mach-ks8695/include/mach/regs-switch.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-switch.h
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * KS8695 - Switch Registers and bit definitions.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef KS8695_SWITCH_H
14#define KS8695_SWITCH_H
15
16#define KS8695_SWITCH_OFFSET (0xF0000 + 0xe800)
17#define KS8695_SWITCH_VA (KS8695_IO_VA + KS8695_SWITCH_OFFSET)
18#define KS8695_SWITCH_PA (KS8695_IO_PA + KS8695_SWITCH_OFFSET)
19
20
21/*
22 * Switch registers
23 */
24#define KS8695_SEC0 (0x00) /* Switch Engine Control 0 */
25#define KS8695_SEC1 (0x04) /* Switch Engine Control 1 */
26#define KS8695_SEC2 (0x08) /* Switch Engine Control 2 */
27
28#define KS8695_SEPXCZ(x,z) (0x0c + (((x)-1)*3 + ((z)-1))*4) /* Port Configuration Registers */
29
30#define KS8695_SEP12AN (0x48) /* Port 1 & 2 Auto-Negotiation */
31#define KS8695_SEP34AN (0x4c) /* Port 3 & 4 Auto-Negotiation */
32#define KS8695_SEIAC (0x50) /* Indirect Access Control */
33#define KS8695_SEIADH2 (0x54) /* Indirect Access Data High 2 */
34#define KS8695_SEIADH1 (0x58) /* Indirect Access Data High 1 */
35#define KS8695_SEIADL (0x5c) /* Indirect Access Data Low */
36#define KS8695_SEAFC (0x60) /* Advance Feature Control */
37#define KS8695_SEDSCPH (0x64) /* TOS Priority High */
38#define KS8695_SEDSCPL (0x68) /* TOS Priority Low */
39#define KS8695_SEMAH (0x6c) /* Switch Engine MAC Address High */
40#define KS8695_SEMAL (0x70) /* Switch Engine MAC Address Low */
41#define KS8695_LPPM12 (0x74) /* Port 1 & 2 PHY Power Management */
42#define KS8695_LPPM34 (0x78) /* Port 3 & 4 PHY Power Management */
43
44
45/* Switch Engine Control 0 */
46#define SEC0_LLED1S (7 << 25) /* LED1 Select */
47#define LLED1S_SPEED (0 << 25)
48#define LLED1S_LINK (1 << 25)
49#define LLED1S_DUPLEX (2 << 25)
50#define LLED1S_COLLISION (3 << 25)
51#define LLED1S_ACTIVITY (4 << 25)
52#define LLED1S_FDX_COLLISION (5 << 25)
53#define LLED1S_LINK_ACTIVITY (6 << 25)
54#define SEC0_LLED0S (7 << 22) /* LED0 Select */
55#define LLED0S_SPEED (0 << 22)
56#define LLED0S_LINK (1 << 22)
57#define LLED0S_DUPLEX (2 << 22)
58#define LLED0S_COLLISION (3 << 22)
59#define LLED0S_ACTIVITY (4 << 22)
60#define LLED0S_FDX_COLLISION (5 << 22)
61#define LLED0S_LINK_ACTIVITY (6 << 22)
62#define SEC0_ENABLE (1 << 0) /* Enable Switch */
63
64
65
66#endif
diff --git a/arch/arm/mach-ks8695/include/mach/regs-uart.h b/arch/arm/mach-ks8695/include/mach/regs-uart.h
deleted file mode 100644
index 941a542c5f23..000000000000
--- a/arch/arm/mach-ks8695/include/mach/regs-uart.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-ks8695/include/mach/regs-uart.h
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7 *
8 * KS8695 - UART register and bit definitions.
9 */
10
11#ifndef KS8695_UART_H
12#define KS8695_UART_H
13
14#define KS8695_UART_OFFSET (0xF0000 + 0xE000)
15#define KS8695_UART_VA (KS8695_IO_VA + KS8695_UART_OFFSET)
16#define KS8695_UART_PA (KS8695_IO_PA + KS8695_UART_OFFSET)
17
18
19/*
20 * UART registers
21 */
22#define KS8695_URRB (0x00) /* Receive Buffer Register */
23#define KS8695_URTH (0x04) /* Transmit Holding Register */
24#define KS8695_URFC (0x08) /* FIFO Control Register */
25#define KS8695_URLC (0x0C) /* Line Control Register */
26#define KS8695_URMC (0x10) /* Modem Control Register */
27#define KS8695_URLS (0x14) /* Line Status Register */
28#define KS8695_URMS (0x18) /* Modem Status Register */
29#define KS8695_URBD (0x1C) /* Baud Rate Divisor Register */
30#define KS8695_USR (0x20) /* Status Register */
31
32
33/* FIFO Control Register */
34#define URFC_URFRT (3 << 6) /* Receive FIFO Trigger Level */
35#define URFC_URFRT_1 (0 << 6)
36#define URFC_URFRT_4 (1 << 6)
37#define URFC_URFRT_8 (2 << 6)
38#define URFC_URFRT_14 (3 << 6)
39#define URFC_URTFR (1 << 2) /* Transmit FIFO Reset */
40#define URFC_URRFR (1 << 1) /* Receive FIFO Reset */
41#define URFC_URFE (1 << 0) /* FIFO Enable */
42
43/* Line Control Register */
44#define URLC_URSBC (1 << 6) /* Set Break Condition */
45#define URLC_PARITY (7 << 3) /* Parity */
46#define URPE_NONE (0 << 3)
47#define URPE_ODD (1 << 3)
48#define URPE_EVEN (3 << 3)
49#define URPE_MARK (5 << 3)
50#define URPE_SPACE (7 << 3)
51#define URLC_URSB (1 << 2) /* Stop Bits */
52#define URLC_URCL (3 << 0) /* Character Length */
53#define URCL_5 (0 << 0)
54#define URCL_6 (1 << 0)
55#define URCL_7 (2 << 0)
56#define URCL_8 (3 << 0)
57
58/* Modem Control Register */
59#define URMC_URLB (1 << 4) /* Loop-back mode */
60#define URMC_UROUT2 (1 << 3) /* OUT2 signal */
61#define URMC_UROUT1 (1 << 2) /* OUT1 signal */
62#define URMC_URRTS (1 << 1) /* Request to Send */
63#define URMC_URDTR (1 << 0) /* Data Terminal Ready */
64
65/* Line Status Register */
66#define URLS_URRFE (1 << 7) /* Receive FIFO Error */
67#define URLS_URTE (1 << 6) /* Transmit Empty */
68#define URLS_URTHRE (1 << 5) /* Transmit Holding Register Empty */
69#define URLS_URBI (1 << 4) /* Break Interrupt */
70#define URLS_URFE (1 << 3) /* Framing Error */
71#define URLS_URPE (1 << 2) /* Parity Error */
72#define URLS_URROE (1 << 1) /* Receive Overrun Error */
73#define URLS_URDR (1 << 0) /* Receive Data Ready */
74
75/* Modem Status Register */
76#define URMS_URDCD (1 << 7) /* Data Carrier Detect */
77#define URMS_URRI (1 << 6) /* Ring Indicator */
78#define URMS_URDSR (1 << 5) /* Data Set Ready */
79#define URMS_URCTS (1 << 4) /* Clear to Send */
80#define URMS_URDDCD (1 << 3) /* Delta Data Carrier Detect */
81#define URMS_URTERI (1 << 2) /* Trailing Edge Ring Indicator */
82#define URMS_URDDST (1 << 1) /* Delta Data Set Ready */
83#define URMS_URDCTS (1 << 0) /* Delta Clear to Send */
84
85/* Status Register */
86#define USR_UTI (1 << 0) /* Timeout Indication */
87
88
89#endif
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
deleted file mode 100644
index dc78a29759b5..000000000000
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-ks8695/include/mach/uncompress.h
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7 *
8 * KS8695 - Kernel uncompressor
9 */
10
11#ifndef __ASM_ARCH_UNCOMPRESS_H
12#define __ASM_ARCH_UNCOMPRESS_H
13
14#include <linux/io.h>
15#include <mach/regs-uart.h>
16
17static inline void putc(char c)
18{
19 while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE))
20 barrier();
21
22 __raw_writel(c, (void __iomem*)KS8695_UART_PA + KS8695_URTH);
23}
24
25static inline void flush(void)
26{
27 while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTE))
28 barrier();
29}
30
31#define arch_decomp_setup()
32
33#endif
diff --git a/arch/arm/mach-ks8695/irq.c b/arch/arm/mach-ks8695/irq.c
deleted file mode 100644
index 4b7ec8d9300c..000000000000
--- a/arch/arm/mach-ks8695/irq.c
+++ /dev/null
@@ -1,164 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * arch/arm/mach-ks8695/irq.c
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7 */
8
9#include <linux/init.h>
10#include <linux/module.h>
11#include <linux/interrupt.h>
12#include <linux/ioport.h>
13#include <linux/device.h>
14#include <linux/io.h>
15
16#include <mach/hardware.h>
17#include <asm/irq.h>
18
19#include <asm/mach/irq.h>
20
21#include <mach/regs-irq.h>
22#include <mach/regs-gpio.h>
23
24static void ks8695_irq_mask(struct irq_data *d)
25{
26 unsigned long inten;
27
28 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
29 inten &= ~(1 << d->irq);
30
31 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
32}
33
34static void ks8695_irq_unmask(struct irq_data *d)
35{
36 unsigned long inten;
37
38 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
39 inten |= (1 << d->irq);
40
41 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
42}
43
44static void ks8695_irq_ack(struct irq_data *d)
45{
46 __raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST);
47}
48
49
50static struct irq_chip ks8695_irq_level_chip;
51static struct irq_chip ks8695_irq_edge_chip;
52
53
54static int ks8695_irq_set_type(struct irq_data *d, unsigned int type)
55{
56 unsigned long ctrl, mode;
57 unsigned short level_triggered = 0;
58
59 ctrl = __raw_readl(KS8695_GPIO_VA + KS8695_IOPC);
60
61 switch (type) {
62 case IRQ_TYPE_LEVEL_HIGH:
63 mode = IOPC_TM_HIGH;
64 level_triggered = 1;
65 break;
66 case IRQ_TYPE_LEVEL_LOW:
67 mode = IOPC_TM_LOW;
68 level_triggered = 1;
69 break;
70 case IRQ_TYPE_EDGE_RISING:
71 mode = IOPC_TM_RISING;
72 break;
73 case IRQ_TYPE_EDGE_FALLING:
74 mode = IOPC_TM_FALLING;
75 break;
76 case IRQ_TYPE_EDGE_BOTH:
77 mode = IOPC_TM_EDGE;
78 break;
79 default:
80 return -EINVAL;
81 }
82
83 switch (d->irq) {
84 case KS8695_IRQ_EXTERN0:
85 ctrl &= ~IOPC_IOEINT0TM;
86 ctrl |= IOPC_IOEINT0_MODE(mode);
87 break;
88 case KS8695_IRQ_EXTERN1:
89 ctrl &= ~IOPC_IOEINT1TM;
90 ctrl |= IOPC_IOEINT1_MODE(mode);
91 break;
92 case KS8695_IRQ_EXTERN2:
93 ctrl &= ~IOPC_IOEINT2TM;
94 ctrl |= IOPC_IOEINT2_MODE(mode);
95 break;
96 case KS8695_IRQ_EXTERN3:
97 ctrl &= ~IOPC_IOEINT3TM;
98 ctrl |= IOPC_IOEINT3_MODE(mode);
99 break;
100 default:
101 return -EINVAL;
102 }
103
104 if (level_triggered) {
105 irq_set_chip_and_handler(d->irq, &ks8695_irq_level_chip,
106 handle_level_irq);
107 }
108 else {
109 irq_set_chip_and_handler(d->irq, &ks8695_irq_edge_chip,
110 handle_edge_irq);
111 }
112
113 __raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC);
114 return 0;
115}
116
117static struct irq_chip ks8695_irq_level_chip = {
118 .irq_ack = ks8695_irq_mask,
119 .irq_mask = ks8695_irq_mask,
120 .irq_unmask = ks8695_irq_unmask,
121 .irq_set_type = ks8695_irq_set_type,
122};
123
124static struct irq_chip ks8695_irq_edge_chip = {
125 .irq_ack = ks8695_irq_ack,
126 .irq_mask = ks8695_irq_mask,
127 .irq_unmask = ks8695_irq_unmask,
128 .irq_set_type = ks8695_irq_set_type,
129};
130
131void __init ks8695_init_irq(void)
132{
133 unsigned int irq;
134
135 /* Disable all interrupts initially */
136 __raw_writel(0, KS8695_IRQ_VA + KS8695_INTMC);
137 __raw_writel(0, KS8695_IRQ_VA + KS8695_INTEN);
138
139 for (irq = 0; irq < NR_IRQS; irq++) {
140 switch (irq) {
141 /* Level-triggered interrupts */
142 case KS8695_IRQ_BUS_ERROR:
143 case KS8695_IRQ_UART_MODEM_STATUS:
144 case KS8695_IRQ_UART_LINE_STATUS:
145 case KS8695_IRQ_UART_RX:
146 case KS8695_IRQ_COMM_TX:
147 case KS8695_IRQ_COMM_RX:
148 irq_set_chip_and_handler(irq,
149 &ks8695_irq_level_chip,
150 handle_level_irq);
151 break;
152
153 /* Edge-triggered interrupts */
154 default:
155 /* clear pending bit */
156 ks8695_irq_ack(irq_get_irq_data(irq));
157 irq_set_chip_and_handler(irq,
158 &ks8695_irq_edge_chip,
159 handle_edge_irq);
160 }
161
162 irq_clear_status_flags(irq, IRQ_NOREQUEST);
163 }
164}
diff --git a/arch/arm/mach-ks8695/pci.c b/arch/arm/mach-ks8695/pci.c
deleted file mode 100644
index 83f330bf07dd..000000000000
--- a/arch/arm/mach-ks8695/pci.c
+++ /dev/null
@@ -1,247 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * arch/arm/mach-ks8695/pci.c
4 *
5 * Copyright (C) 2003, Micrel Semiconductors
6 * Copyright (C) 2006, Greg Ungerer <gerg@snapgear.com>
7 * Copyright (C) 2006, Ben Dooks
8 * Copyright (C) 2007, Andrew Victor
9 */
10
11#include <linux/kernel.h>
12#include <linux/pci.h>
13#include <linux/mm.h>
14#include <linux/init.h>
15#include <linux/irq.h>
16#include <linux/delay.h>
17#include <linux/io.h>
18
19#include <asm/signal.h>
20#include <asm/mach/pci.h>
21#include <mach/hardware.h>
22
23#include "devices.h"
24#include "regs-pci.h"
25
26
27static int pci_dbg;
28
29static void ks8695_pci_setupconfig(unsigned int bus_nr, unsigned int devfn, unsigned int where)
30{
31 unsigned long pbca;
32
33 pbca = PBCA_ENABLE | (where & ~3);
34 pbca |= PCI_SLOT(devfn) << 11 ;
35 pbca |= PCI_FUNC(devfn) << 8;
36 pbca |= bus_nr << 16;
37
38 if (bus_nr == 0) {
39 /* use Type-0 transaction */
40 __raw_writel(pbca, KS8695_PCI_VA + KS8695_PBCA);
41 } else {
42 /* use Type-1 transaction */
43 __raw_writel(pbca | PBCA_TYPE1, KS8695_PCI_VA + KS8695_PBCA);
44 }
45}
46
47static void __iomem *ks8695_pci_map_bus(struct pci_bus *bus, unsigned int devfn,
48 int where)
49{
50 ks8695_pci_setupconfig(bus->number, devfn, where);
51 return KS8695_PCI_VA + KS8695_PBCD;
52}
53
54static void ks8695_local_writeconfig(int where, u32 value)
55{
56 ks8695_pci_setupconfig(0, 0, where);
57 __raw_writel(value, KS8695_PCI_VA + KS8695_PBCD);
58}
59
60static struct pci_ops ks8695_pci_ops = {
61 .map_bus = ks8695_pci_map_bus,
62 .read = pci_generic_config_read32,
63 .write = pci_generic_config_write32,
64};
65
66static struct resource pci_mem = {
67 .name = "PCI Memory space",
68 .start = KS8695_PCIMEM_PA,
69 .end = KS8695_PCIMEM_PA + (KS8695_PCIMEM_SIZE - 1),
70 .flags = IORESOURCE_MEM,
71};
72
73static struct resource pci_io = {
74 .name = "PCI IO space",
75 .start = KS8695_PCIIO_PA,
76 .end = KS8695_PCIIO_PA + (KS8695_PCIIO_SIZE - 1),
77 .flags = IORESOURCE_IO,
78};
79
80static int __init ks8695_pci_setup(int nr, struct pci_sys_data *sys)
81{
82 if (nr > 0)
83 return 0;
84
85 request_resource(&iomem_resource, &pci_mem);
86 request_resource(&ioport_resource, &pci_io);
87
88 pci_add_resource_offset(&sys->resources, &pci_io, sys->io_offset);
89 pci_add_resource_offset(&sys->resources, &pci_mem, sys->mem_offset);
90
91 /* Assign and enable processor bridge */
92 ks8695_local_writeconfig(PCI_BASE_ADDRESS_0, KS8695_PCIMEM_PA);
93
94 /* Enable bus-master & Memory Space access */
95 ks8695_local_writeconfig(PCI_COMMAND, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
96
97 /* Set cache-line size & latency. */
98 ks8695_local_writeconfig(PCI_CACHE_LINE_SIZE, (32 << 8) | (L1_CACHE_BYTES / sizeof(u32)));
99
100 /* Reserve PCI memory space for PCI-AHB resources */
101 if (!request_mem_region(KS8695_PCIMEM_PA, SZ_64M, "PCI-AHB Bridge")) {
102 printk(KERN_ERR "Cannot allocate PCI-AHB Bridge memory.\n");
103 return -EBUSY;
104 }
105
106 return 1;
107}
108
109static inline unsigned int size_mask(unsigned long size)
110{
111 return (~size) + 1;
112}
113
114static int ks8695_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
115{
116 unsigned long pc = instruction_pointer(regs);
117 unsigned long instr = *(unsigned long *)pc;
118 unsigned long cmdstat;
119
120 cmdstat = __raw_readl(KS8695_PCI_VA + KS8695_CRCFCS);
121
122 printk(KERN_ERR "PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx [%s%s%s%s%s]\n",
123 addr, fsr, regs->ARM_pc, regs->ARM_lr,
124 cmdstat & (PCI_STATUS_SIG_TARGET_ABORT << 16) ? "GenTarget" : " ",
125 cmdstat & (PCI_STATUS_REC_TARGET_ABORT << 16) ? "RecvTarget" : " ",
126 cmdstat & (PCI_STATUS_REC_MASTER_ABORT << 16) ? "MasterAbort" : " ",
127 cmdstat & (PCI_STATUS_SIG_SYSTEM_ERROR << 16) ? "SysError" : " ",
128 cmdstat & (PCI_STATUS_DETECTED_PARITY << 16) ? "Parity" : " "
129 );
130
131 __raw_writel(cmdstat, KS8695_PCI_VA + KS8695_CRCFCS);
132
133 /*
134 * If the instruction being executed was a read,
135 * make it look like it read all-ones.
136 */
137 if ((instr & 0x0c100000) == 0x04100000) {
138 int reg = (instr >> 12) & 15;
139 unsigned long val;
140
141 if (instr & 0x00400000)
142 val = 255;
143 else
144 val = -1;
145
146 regs->uregs[reg] = val;
147 regs->ARM_pc += 4;
148 return 0;
149 }
150
151 if ((instr & 0x0e100090) == 0x00100090) {
152 int reg = (instr >> 12) & 15;
153
154 regs->uregs[reg] = -1;
155 regs->ARM_pc += 4;
156 return 0;
157 }
158
159 return 1;
160}
161
162static void __init ks8695_pci_preinit(void)
163{
164 /* make software reset to avoid freeze if PCI bus was messed up */
165 __raw_writel(0x80000000, KS8695_PCI_VA + KS8695_PBCS);
166
167 /* stage 1 initialization, subid, subdevice = 0x0001 */
168 __raw_writel(0x00010001, KS8695_PCI_VA + KS8695_CRCSID);
169
170 /* stage 2 initialization */
171 /* prefetch limits with 16 words, retry enable */
172 __raw_writel(0x40000000, KS8695_PCI_VA + KS8695_PBCS);
173
174 /* configure memory mapping */
175 __raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBA);
176 __raw_writel(size_mask(KS8695_PCIMEM_SIZE), KS8695_PCI_VA + KS8695_PMBAM);
177 __raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBAT);
178 __raw_writel(0, KS8695_PCI_VA + KS8695_PMBAC);
179
180 /* configure IO mapping */
181 __raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBA);
182 __raw_writel(size_mask(KS8695_PCIIO_SIZE), KS8695_PCI_VA + KS8695_PIOBAM);
183 __raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBAT);
184 __raw_writel(0, KS8695_PCI_VA + KS8695_PIOBAC);
185
186 /* hook in fault handlers */
187 hook_fault_code(8, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
188 hook_fault_code(10, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
189}
190
191static void ks8695_show_pciregs(void)
192{
193 if (!pci_dbg)
194 return;
195
196 printk(KERN_INFO "PCI: CRCFID = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFID));
197 printk(KERN_INFO "PCI: CRCFCS = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFCS));
198 printk(KERN_INFO "PCI: CRCFRV = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFRV));
199 printk(KERN_INFO "PCI: CRCFLT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFLT));
200 printk(KERN_INFO "PCI: CRCBMA = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCBMA));
201 printk(KERN_INFO "PCI: CRCSID = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCSID));
202 printk(KERN_INFO "PCI: CRCFIT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFIT));
203
204 printk(KERN_INFO "PCI: PBM = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PBM));
205 printk(KERN_INFO "PCI: PBCS = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PBCS));
206
207 printk(KERN_INFO "PCI: PMBA = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBA));
208 printk(KERN_INFO "PCI: PMBAC = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAC));
209 printk(KERN_INFO "PCI: PMBAM = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAM));
210 printk(KERN_INFO "PCI: PMBAT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAT));
211
212 printk(KERN_INFO "PCI: PIOBA = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBA));
213 printk(KERN_INFO "PCI: PIOBAC = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAC));
214 printk(KERN_INFO "PCI: PIOBAM = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAM));
215 printk(KERN_INFO "PCI: PIOBAT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAT));
216}
217
218
219static struct hw_pci ks8695_pci __initdata = {
220 .nr_controllers = 1,
221 .ops = &ks8695_pci_ops,
222 .preinit = ks8695_pci_preinit,
223 .setup = ks8695_pci_setup,
224 .postinit = NULL,
225 .map_irq = NULL,
226};
227
228void __init ks8695_init_pci(struct ks8695_pci_cfg *cfg)
229{
230 if (__raw_readl(KS8695_PCI_VA + KS8695_CRCFRV) & CFRV_GUEST) {
231 printk("PCI: KS8695 in guest mode, not initialising\n");
232 return;
233 }
234
235 pcibios_min_io = 0;
236 pcibios_min_mem = 0;
237
238 printk(KERN_INFO "PCI: Initialising\n");
239 ks8695_show_pciregs();
240
241 /* set Mode */
242 __raw_writel(cfg->mode << 29, KS8695_PCI_VA + KS8695_PBM);
243
244 ks8695_pci.map_irq = cfg->map_irq; /* board-specific map_irq method */
245
246 pci_common_init(&ks8695_pci);
247}
diff --git a/arch/arm/mach-ks8695/regs-hpna.h b/arch/arm/mach-ks8695/regs-hpna.h
deleted file mode 100644
index 815ce5c2e3b9..000000000000
--- a/arch/arm/mach-ks8695/regs-hpna.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-wan.h
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * KS8695 - HPNA Registers and bit definitions.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef KS8695_HPNA_H
14#define KS8695_HPNA_H
15
16#define KS8695_HPNA_OFFSET (0xF0000 + 0xA000)
17#define KS8695_HPNA_VA (KS8695_IO_VA + KS8695_HPNA_OFFSET)
18#define KS8695_HPNA_PA (KS8695_IO_PA + KS8695_HPNA_OFFSET)
19
20
21/*
22 * HPNA registers
23 */
24
25#endif
diff --git a/arch/arm/mach-ks8695/regs-lan.h b/arch/arm/mach-ks8695/regs-lan.h
deleted file mode 100644
index 82c5f3791afb..000000000000
--- a/arch/arm/mach-ks8695/regs-lan.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-lan.h
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * KS8695 - LAN Registers and bit definitions.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef KS8695_LAN_H
14#define KS8695_LAN_H
15
16#define KS8695_LAN_OFFSET (0xF0000 + 0x8000)
17#define KS8695_LAN_VA (KS8695_IO_VA + KS8695_LAN_OFFSET)
18#define KS8695_LAN_PA (KS8695_IO_PA + KS8695_LAN_OFFSET)
19
20
21/*
22 * LAN registers
23 */
24#define KS8695_LMDTXC (0x00) /* DMA Transmit Control */
25#define KS8695_LMDRXC (0x04) /* DMA Receive Control */
26#define KS8695_LMDTSC (0x08) /* DMA Transmit Start Command */
27#define KS8695_LMDRSC (0x0c) /* DMA Receive Start Command */
28#define KS8695_LTDLB (0x10) /* Transmit Descriptor List Base Address */
29#define KS8695_LRDLB (0x14) /* Receive Descriptor List Base Address */
30#define KS8695_LMAL (0x18) /* MAC Station Address Low */
31#define KS8695_LMAH (0x1c) /* MAC Station Address High */
32#define KS8695_LMAAL(n) (0x80 + ((n)*8)) /* MAC Additional Station Address (0..15) Low */
33#define KS8695_LMAAH(n) (0x84 + ((n)*8)) /* MAC Additional Station Address (0..15) High */
34
35
36/* DMA Transmit Control Register */
37#define LMDTXC_LMTRST (1 << 31) /* Soft Reset */
38#define LMDTXC_LMTBS (0x3f << 24) /* Transmit Burst Size */
39#define LMDTXC_LMTUCG (1 << 18) /* Transmit UDP Checksum Generate */
40#define LMDTXC_LMTTCG (1 << 17) /* Transmit TCP Checksum Generate */
41#define LMDTXC_LMTICG (1 << 16) /* Transmit IP Checksum Generate */
42#define LMDTXC_LMTFCE (1 << 9) /* Transmit Flow Control Enable */
43#define LMDTXC_LMTLB (1 << 8) /* Loopback mode */
44#define LMDTXC_LMTEP (1 << 2) /* Transmit Enable Padding */
45#define LMDTXC_LMTAC (1 << 1) /* Transmit Add CRC */
46#define LMDTXC_LMTE (1 << 0) /* TX Enable */
47
48/* DMA Receive Control Register */
49#define LMDRXC_LMRBS (0x3f << 24) /* Receive Burst Size */
50#define LMDRXC_LMRUCC (1 << 18) /* Receive UDP Checksum check */
51#define LMDRXC_LMRTCG (1 << 17) /* Receive TCP Checksum check */
52#define LMDRXC_LMRICG (1 << 16) /* Receive IP Checksum check */
53#define LMDRXC_LMRFCE (1 << 9) /* Receive Flow Control Enable */
54#define LMDRXC_LMRB (1 << 6) /* Receive Broadcast */
55#define LMDRXC_LMRM (1 << 5) /* Receive Multicast */
56#define LMDRXC_LMRU (1 << 4) /* Receive Unicast */
57#define LMDRXC_LMRERR (1 << 3) /* Receive Error Frame */
58#define LMDRXC_LMRA (1 << 2) /* Receive All */
59#define LMDRXC_LMRE (1 << 1) /* RX Enable */
60
61/* Additional Station Address High */
62#define LMAAH_E (1 << 31) /* Address Enabled */
63
64
65#endif
diff --git a/arch/arm/mach-ks8695/regs-mem.h b/arch/arm/mach-ks8695/regs-mem.h
deleted file mode 100644
index 55806bc68ce3..000000000000
--- a/arch/arm/mach-ks8695/regs-mem.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-mem.h
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * KS8695 - Memory Controller registers and bit definitions
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef KS8695_MEM_H
14#define KS8695_MEM_H
15
16#define KS8695_MEM_OFFSET (0xF0000 + 0x4000)
17#define KS8695_MEM_VA (KS8695_IO_VA + KS8695_MEM_OFFSET)
18#define KS8695_MEM_PA (KS8695_IO_PA + KS8695_MEM_OFFSET)
19
20
21/*
22 * Memory Controller Registers
23 */
24#define KS8695_EXTACON0 (0x00) /* External I/O 0 Access Control */
25#define KS8695_EXTACON1 (0x04) /* External I/O 1 Access Control */
26#define KS8695_EXTACON2 (0x08) /* External I/O 2 Access Control */
27#define KS8695_ROMCON0 (0x10) /* ROM/SRAM/Flash 1 Control Register */
28#define KS8695_ROMCON1 (0x14) /* ROM/SRAM/Flash 2 Control Register */
29#define KS8695_ERGCON (0x20) /* External I/O and ROM/SRAM/Flash General Register */
30#define KS8695_SDCON0 (0x30) /* SDRAM Control Register 0 */
31#define KS8695_SDCON1 (0x34) /* SDRAM Control Register 1 */
32#define KS8695_SDGCON (0x38) /* SDRAM General Control */
33#define KS8695_SDBCON (0x3c) /* SDRAM Buffer Control */
34#define KS8695_REFTIM (0x40) /* SDRAM Refresh Timer */
35
36
37/* External I/O Access Control Registers */
38#define EXTACON_EBNPTR (0x3ff << 22) /* Last Address Pointer */
39#define EXTACON_EBBPTR (0x3ff << 12) /* Base Pointer */
40#define EXTACON_EBTACT (7 << 9) /* Write Enable/Output Enable Active Time */
41#define EXTACON_EBTCOH (7 << 6) /* Chip Select Hold Time */
42#define EXTACON_EBTACS (7 << 3) /* Address Setup Time before ECSN */
43#define EXTACON_EBTCOS (7 << 0) /* Chip Select Time before OEN */
44
45/* ROM/SRAM/Flash Control Register */
46#define ROMCON_RBNPTR (0x3ff << 22) /* Next Pointer */
47#define ROMCON_RBBPTR (0x3ff << 12) /* Base Pointer */
48#define ROMCON_RBTACC (7 << 4) /* Access Cycle Time */
49#define ROMCON_RBTPA (3 << 2) /* Page Address Access Time */
50#define ROMCON_PMC (3 << 0) /* Page Mode Configuration */
51#define PMC_NORMAL (0 << 0)
52#define PMC_4WORD (1 << 0)
53#define PMC_8WORD (2 << 0)
54#define PMC_16WORD (3 << 0)
55
56/* External I/O and ROM/SRAM/Flash General Register */
57#define ERGCON_TMULT (3 << 28) /* Time Multiplier */
58#define ERGCON_DSX2 (3 << 20) /* Data Width (External I/O Bank 2) */
59#define ERGCON_DSX1 (3 << 18) /* Data Width (External I/O Bank 1) */
60#define ERGCON_DSX0 (3 << 16) /* Data Width (External I/O Bank 0) */
61#define ERGCON_DSR1 (3 << 2) /* Data Width (ROM/SRAM/Flash Bank 1) */
62#define ERGCON_DSR0 (3 << 0) /* Data Width (ROM/SRAM/Flash Bank 0) */
63
64/* SDRAM Control Register */
65#define SDCON_DBNPTR (0x3ff << 22) /* Last Address Pointer */
66#define SDCON_DBBPTR (0x3ff << 12) /* Base Pointer */
67#define SDCON_DBCAB (3 << 8) /* Column Address Bits */
68#define SDCON_DBBNUM (1 << 3) /* Number of Banks */
69#define SDCON_DBDBW (3 << 1) /* Data Bus Width */
70
71/* SDRAM General Control Register */
72#define SDGCON_SDTRC (3 << 2) /* RAS to CAS latency */
73#define SDGCON_SDCAS (3 << 0) /* CAS latency */
74
75/* SDRAM Buffer Control Register */
76#define SDBCON_SDESTA (1 << 31) /* SDRAM Engine Status */
77#define SDBCON_RBUFBDIS (1 << 24) /* Read Buffer Burst Enable */
78#define SDBCON_WFIFOEN (1 << 23) /* Write FIFO Enable */
79#define SDBCON_RBUFEN (1 << 22) /* Read Buffer Enable */
80#define SDBCON_FLUSHWFIFO (1 << 21) /* Flush Write FIFO */
81#define SDBCON_RBUFINV (1 << 20) /* Read Buffer Invalidate */
82#define SDBCON_SDINI (3 << 16) /* SDRAM Initialization Control */
83#define SDBCON_SDMODE (0x3fff << 0) /* SDRAM Mode Register Value Program */
84
85/* SDRAM Refresh Timer Register */
86#define REFTIM_REFTIM (0xffff << 0) /* Refresh Timer Value */
87
88
89#endif
diff --git a/arch/arm/mach-ks8695/regs-pci.h b/arch/arm/mach-ks8695/regs-pci.h
deleted file mode 100644
index 75a9db6edbd9..000000000000
--- a/arch/arm/mach-ks8695/regs-pci.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-pci.h
3 *
4 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5 * Copyright (C) 2006 Simtec Electronics
6 *
7 * KS8695 - PCI bridge registers and bit definitions.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#define KS8695_PCI_OFFSET (0xF0000 + 0x2000)
15#define KS8695_PCI_VA (KS8695_IO_VA + KS8695_PCI_OFFSET)
16#define KS8695_PCI_PA (KS8695_IO_PA + KS8695_PCI_OFFSET)
17
18
19#define KS8695_CRCFID (0x000) /* Configuration: Identification */
20#define KS8695_CRCFCS (0x004) /* Configuration: Command and Status */
21#define KS8695_CRCFRV (0x008) /* Configuration: Revision */
22#define KS8695_CRCFLT (0x00C) /* Configuration: Latency Timer */
23#define KS8695_CRCBMA (0x010) /* Configuration: Base Memory Address */
24#define KS8695_CRCSID (0x02C) /* Configuration: Subsystem ID */
25#define KS8695_CRCFIT (0x03C) /* Configuration: Interrupt */
26#define KS8695_PBCA (0x100) /* Bridge Configuration Address */
27#define KS8695_PBCD (0x104) /* Bridge Configuration Data */
28#define KS8695_PBM (0x200) /* Bridge Mode */
29#define KS8695_PBCS (0x204) /* Bridge Control and Status */
30#define KS8695_PMBA (0x208) /* Bridge Memory Base Address */
31#define KS8695_PMBAC (0x20C) /* Bridge Memory Base Address Control */
32#define KS8695_PMBAM (0x210) /* Bridge Memory Base Address Mask */
33#define KS8695_PMBAT (0x214) /* Bridge Memory Base Address Translation */
34#define KS8695_PIOBA (0x218) /* Bridge I/O Base Address */
35#define KS8695_PIOBAC (0x21C) /* Bridge I/O Base Address Control */
36#define KS8695_PIOBAM (0x220) /* Bridge I/O Base Address Mask */
37#define KS8695_PIOBAT (0x224) /* Bridge I/O Base Address Translation */
38
39
40/* Configuration: Identification */
41
42/* Configuration: Command and Status */
43
44/* Configuration: Revision */
45
46
47
48#define CFRV_GUEST (1 << 23)
49
50#define PBCA_TYPE1 (1)
51#define PBCA_ENABLE (1 << 31)
52
53
diff --git a/arch/arm/mach-ks8695/regs-sys.h b/arch/arm/mach-ks8695/regs-sys.h
deleted file mode 100644
index 57c20be0c129..000000000000
--- a/arch/arm/mach-ks8695/regs-sys.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-sys.h
3 *
4 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5 * Copyright (C) 2006 Simtec Electronics
6 *
7 * KS8695 - System control registers and bit definitions
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef KS8695_SYS_H
15#define KS8695_SYS_H
16
17#define KS8695_SYS_OFFSET (0xF0000 + 0x0000)
18#define KS8695_SYS_VA (KS8695_IO_VA + KS8695_SYS_OFFSET)
19#define KS8695_SYS_PA (KS8695_IO_PA + KS8695_SYS_OFFSET)
20
21
22#define KS8695_SYSCFG (0x00) /* System Configuration Register */
23#define KS8695_CLKCON (0x04) /* System Clock and Bus Control Register */
24
25
26/* System Configuration Register */
27#define SYSCFG_SPRBP (0x3ff << 16) /* Register Bank Base Pointer */
28
29/* System Clock and Bus Control Register */
30#define CLKCON_SFMODE (1 << 8) /* System Fast Mode for Simulation */
31#define CLKCON_SCDC (7 << 0) /* System Clock Divider Select */
32
33
34#endif
diff --git a/arch/arm/mach-ks8695/regs-wan.h b/arch/arm/mach-ks8695/regs-wan.h
deleted file mode 100644
index c475bed22b8e..000000000000
--- a/arch/arm/mach-ks8695/regs-wan.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/regs-wan.h
3 *
4 * Copyright (C) 2006 Andrew Victor
5 *
6 * KS8695 - WAN Registers and bit definitions.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef KS8695_WAN_H
14#define KS8695_WAN_H
15
16#define KS8695_WAN_OFFSET (0xF0000 + 0x6000)
17#define KS8695_WAN_VA (KS8695_IO_VA + KS8695_WAN_OFFSET)
18#define KS8695_WAN_PA (KS8695_IO_PA + KS8695_WAN_OFFSET)
19
20
21/*
22 * WAN registers
23 */
24#define KS8695_WMDTXC (0x00) /* DMA Transmit Control */
25#define KS8695_WMDRXC (0x04) /* DMA Receive Control */
26#define KS8695_WMDTSC (0x08) /* DMA Transmit Start Command */
27#define KS8695_WMDRSC (0x0c) /* DMA Receive Start Command */
28#define KS8695_WTDLB (0x10) /* Transmit Descriptor List Base Address */
29#define KS8695_WRDLB (0x14) /* Receive Descriptor List Base Address */
30#define KS8695_WMAL (0x18) /* MAC Station Address Low */
31#define KS8695_WMAH (0x1c) /* MAC Station Address High */
32#define KS8695_WMAAL(n) (0x80 + ((n)*8)) /* MAC Additional Station Address (0..15) Low */
33#define KS8695_WMAAH(n) (0x84 + ((n)*8)) /* MAC Additional Station Address (0..15) High */
34
35
36/* DMA Transmit Control Register */
37#define WMDTXC_WMTRST (1 << 31) /* Soft Reset */
38#define WMDTXC_WMTBS (0x3f << 24) /* Transmit Burst Size */
39#define WMDTXC_WMTUCG (1 << 18) /* Transmit UDP Checksum Generate */
40#define WMDTXC_WMTTCG (1 << 17) /* Transmit TCP Checksum Generate */
41#define WMDTXC_WMTICG (1 << 16) /* Transmit IP Checksum Generate */
42#define WMDTXC_WMTFCE (1 << 9) /* Transmit Flow Control Enable */
43#define WMDTXC_WMTLB (1 << 8) /* Loopback mode */
44#define WMDTXC_WMTEP (1 << 2) /* Transmit Enable Padding */
45#define WMDTXC_WMTAC (1 << 1) /* Transmit Add CRC */
46#define WMDTXC_WMTE (1 << 0) /* TX Enable */
47
48/* DMA Receive Control Register */
49#define WMDRXC_WMRBS (0x3f << 24) /* Receive Burst Size */
50#define WMDRXC_WMRUCC (1 << 18) /* Receive UDP Checksum check */
51#define WMDRXC_WMRTCG (1 << 17) /* Receive TCP Checksum check */
52#define WMDRXC_WMRICG (1 << 16) /* Receive IP Checksum check */
53#define WMDRXC_WMRFCE (1 << 9) /* Receive Flow Control Enable */
54#define WMDRXC_WMRB (1 << 6) /* Receive Broadcast */
55#define WMDRXC_WMRM (1 << 5) /* Receive Multicast */
56#define WMDRXC_WMRU (1 << 4) /* Receive Unicast */
57#define WMDRXC_WMRERR (1 << 3) /* Receive Error Frame */
58#define WMDRXC_WMRA (1 << 2) /* Receive All */
59#define WMDRXC_WMRE (1 << 0) /* RX Enable */
60
61/* Additional Station Address High */
62#define WMAAH_E (1 << 31) /* Address Enabled */
63
64
65#endif
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c
deleted file mode 100644
index 50561eec0c32..000000000000
--- a/arch/arm/mach-ks8695/time.c
+++ /dev/null
@@ -1,159 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * arch/arm/mach-ks8695/time.c
4 *
5 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
6 * Copyright (C) 2006 Simtec Electronics
7 */
8
9#include <linux/init.h>
10#include <linux/interrupt.h>
11#include <linux/irq.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/io.h>
15#include <linux/clockchips.h>
16
17#include <asm/mach/time.h>
18#include <asm/system_misc.h>
19
20#include <mach/regs-irq.h>
21
22#include "generic.h"
23
24#define KS8695_TMR_OFFSET (0xF0000 + 0xE400)
25#define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET)
26#define KS8695_TMR_PA (KS8695_IO_PA + KS8695_TMR_OFFSET)
27
28/*
29 * Timer registers
30 */
31#define KS8695_TMCON (0x00) /* Timer Control Register */
32#define KS8695_T1TC (0x04) /* Timer 1 Timeout Count Register */
33#define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */
34#define KS8695_T1PD (0x0C) /* Timer 1 Pulse Count Register */
35#define KS8695_T0PD (0x10) /* Timer 0 Pulse Count Register */
36
37/* Timer Control Register */
38#define TMCON_T1EN (1 << 1) /* Timer 1 Enable */
39#define TMCON_T0EN (1 << 0) /* Timer 0 Enable */
40
41/* Timer0 Timeout Counter Register */
42#define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */
43
44static int ks8695_set_periodic(struct clock_event_device *evt)
45{
46 u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ);
47 u32 half = DIV_ROUND_CLOSEST(rate, 2);
48 u32 tmcon;
49
50 /* Disable timer 1 */
51 tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
52 tmcon &= ~TMCON_T1EN;
53 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
54
55 /* Both registers need to count down */
56 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
57 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
58
59 /* Re-enable timer1 */
60 tmcon |= TMCON_T1EN;
61 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
62 return 0;
63}
64
65static int ks8695_set_next_event(unsigned long cycles,
66 struct clock_event_device *evt)
67
68{
69 u32 half = DIV_ROUND_CLOSEST(cycles, 2);
70 u32 tmcon;
71
72 /* Disable timer 1 */
73 tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
74 tmcon &= ~TMCON_T1EN;
75 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
76
77 /* Both registers need to count down */
78 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
79 writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
80
81 /* Re-enable timer1 */
82 tmcon |= TMCON_T1EN;
83 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
84
85 return 0;
86}
87
88static struct clock_event_device clockevent_ks8695 = {
89 .name = "ks8695_t1tc",
90 /* Reasonably fast and accurate clock event */
91 .rating = 300,
92 .features = CLOCK_EVT_FEAT_ONESHOT |
93 CLOCK_EVT_FEAT_PERIODIC,
94 .set_next_event = ks8695_set_next_event,
95 .set_state_periodic = ks8695_set_periodic,
96};
97
98/*
99 * IRQ handler for the timer.
100 */
101static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id)
102{
103 struct clock_event_device *evt = &clockevent_ks8695;
104
105 evt->event_handler(evt);
106 return IRQ_HANDLED;
107}
108
109static struct irqaction ks8695_timer_irq = {
110 .name = "ks8695_tick",
111 .flags = IRQF_TIMER,
112 .handler = ks8695_timer_interrupt,
113};
114
115static void ks8695_timer_setup(void)
116{
117 unsigned long tmcon;
118
119 /* Disable timer 0 and 1 */
120 tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
121 tmcon &= ~TMCON_T0EN;
122 tmcon &= ~TMCON_T1EN;
123 writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
124
125 /*
126 * Use timer 1 to fire IRQs on the timeline, minimum 2 cycles
127 * (one on each counter) maximum 2*2^32, but the API will only
128 * accept up to a 32bit full word (0xFFFFFFFFU).
129 */
130 clockevents_config_and_register(&clockevent_ks8695,
131 KS8695_CLOCK_RATE, 2,
132 0xFFFFFFFFU);
133}
134
135void __init ks8695_timer_init(void)
136{
137 ks8695_timer_setup();
138
139 /* Enable timer interrupts */
140 setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq);
141}
142
143void ks8695_restart(enum reboot_mode reboot_mode, const char *cmd)
144{
145 unsigned int reg;
146
147 if (reboot_mode == REBOOT_SOFT)
148 soft_restart(0);
149
150 /* disable timer0 */
151 reg = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
152 writel_relaxed(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
153
154 /* enable watchdog mode */
155 writel_relaxed((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
156
157 /* re-enable timer0 */
158 writel_relaxed(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
159}
diff --git a/arch/arm/mach-lpc32xx/Kconfig b/arch/arm/mach-lpc32xx/Kconfig
new file mode 100644
index 000000000000..ec87c65f4536
--- /dev/null
+++ b/arch/arm/mach-lpc32xx/Kconfig
@@ -0,0 +1,11 @@
1# SPDX-License-Identifier: GPL-2.0-only
2
3config ARCH_LPC32XX
4 bool "NXP LPC32XX"
5 depends on ARCH_MULTI_V5
6 select ARM_AMBA
7 select CLKSRC_LPC32XX
8 select CPU_ARM926T
9 select GPIOLIB
10 help
11 Support for the NXP LPC32XX family of processors
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index 5b71b4fab2cd..304ea61a0716 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -8,12 +8,12 @@
8 */ 8 */
9 9
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/soc/nxp/lpc32xx-misc.h>
11 12
12#include <asm/mach/map.h> 13#include <asm/mach/map.h>
13#include <asm/system_info.h> 14#include <asm/system_info.h>
14 15
15#include <mach/hardware.h> 16#include "lpc32xx.h"
16#include <mach/platform.h>
17#include "common.h" 17#include "common.h"
18 18
19/* 19/*
@@ -32,7 +32,7 @@ void lpc32xx_get_uid(u32 devid[4])
32 */ 32 */
33#define LPC32XX_IRAM_BANK_SIZE SZ_128K 33#define LPC32XX_IRAM_BANK_SIZE SZ_128K
34static u32 iram_size; 34static u32 iram_size;
35u32 lpc32xx_return_iram_size(void) 35u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr)
36{ 36{
37 if (iram_size == 0) { 37 if (iram_size == 0) {
38 u32 savedval1, savedval2; 38 u32 savedval1, savedval2;
@@ -53,10 +53,26 @@ u32 lpc32xx_return_iram_size(void)
53 } else 53 } else
54 iram_size = LPC32XX_IRAM_BANK_SIZE * 2; 54 iram_size = LPC32XX_IRAM_BANK_SIZE * 2;
55 } 55 }
56 if (dmaaddr)
57 *dmaaddr = LPC32XX_IRAM_BASE;
58 if (mapbase)
59 *mapbase = io_p2v(LPC32XX_IRAM_BASE);
56 60
57 return iram_size; 61 return iram_size;
58} 62}
59EXPORT_SYMBOL_GPL(lpc32xx_return_iram_size); 63EXPORT_SYMBOL_GPL(lpc32xx_return_iram);
64
65void lpc32xx_set_phy_interface_mode(phy_interface_t mode)
66{
67 u32 tmp = __raw_readl(LPC32XX_CLKPWR_MACCLK_CTRL);
68 tmp &= ~LPC32XX_CLKPWR_MACCTRL_PINS_MSK;
69 if (mode == PHY_INTERFACE_MODE_MII)
70 tmp |= LPC32XX_CLKPWR_MACCTRL_USE_MII_PINS;
71 else
72 tmp |= LPC32XX_CLKPWR_MACCTRL_USE_RMII_PINS;
73 __raw_writel(tmp, LPC32XX_CLKPWR_MACCLK_CTRL);
74}
75EXPORT_SYMBOL_GPL(lpc32xx_set_phy_interface_mode);
60 76
61static struct map_desc lpc32xx_io_desc[] __initdata = { 77static struct map_desc lpc32xx_io_desc[] __initdata = {
62 { 78 {
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index 8e597ce48a73..32f0ad217807 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -23,7 +23,6 @@ extern void __init lpc32xx_serial_init(void);
23 */ 23 */
24extern void lpc32xx_get_uid(u32 devid[4]); 24extern void lpc32xx_get_uid(u32 devid[4]);
25 25
26extern u32 lpc32xx_return_iram_size(void);
27/* 26/*
28 * Pointers used for sizing and copying suspend function data 27 * Pointers used for sizing and copying suspend function data
29 */ 28 */
diff --git a/arch/arm/mach-lpc32xx/include/mach/board.h b/arch/arm/mach-lpc32xx/include/mach/board.h
deleted file mode 100644
index 476513d970a4..000000000000
--- a/arch/arm/mach-lpc32xx/include/mach/board.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arm/arch/mach-lpc32xx/include/mach/board.h
4 *
5 * Author: Kevin Wells <kevin.wells@nxp.com>
6 *
7 * Copyright (C) 2010 NXP Semiconductors
8 */
9
10#ifndef __ASM_ARCH_BOARD_H
11#define __ASM_ARCH_BOARD_H
12
13extern u32 lpc32xx_return_iram_size(void);
14
15#endif /* __ASM_ARCH_BOARD_H */
diff --git a/arch/arm/mach-lpc32xx/include/mach/entry-macro.S b/arch/arm/mach-lpc32xx/include/mach/entry-macro.S
deleted file mode 100644
index eec0f5f7e722..000000000000
--- a/arch/arm/mach-lpc32xx/include/mach/entry-macro.S
+++ /dev/null
@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-lpc32xx/include/mach/entry-macro.S
4 *
5 * Author: Kevin Wells <kevin.wells@nxp.com>
6 *
7 * Copyright (C) 2010 NXP Semiconductors
8 */
9
10#include <mach/hardware.h>
11#include <mach/platform.h>
12
13#define LPC32XX_INTC_MASKED_STATUS_OFS 0x8
14
15 .macro get_irqnr_preamble, base, tmp
16 ldr \base, =IO_ADDRESS(LPC32XX_MIC_BASE)
17 .endm
18
19/*
20 * Return IRQ number in irqnr. Also return processor Z flag status in CPSR
21 * as set if an interrupt is pending.
22 */
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 ldr \irqstat, [\base, #LPC32XX_INTC_MASKED_STATUS_OFS]
25 clz \irqnr, \irqstat
26 rsb \irqnr, \irqnr, #31
27 teq \irqstat, #0
28 .endm
diff --git a/arch/arm/mach-lpc32xx/include/mach/hardware.h b/arch/arm/mach-lpc32xx/include/mach/hardware.h
deleted file mode 100644
index 4866f096ffce..000000000000
--- a/arch/arm/mach-lpc32xx/include/mach/hardware.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-lpc32xx/include/mach/hardware.h
4 *
5 * Copyright (c) 2005 MontaVista Software, Inc. <source@mvista.com>
6 */
7
8#ifndef __ASM_ARCH_HARDWARE_H
9#define __ASM_ARCH_HARDWARE_H
10
11/*
12 * Start of virtual addresses for IO devices
13 */
14#define IO_BASE 0xF0000000
15
16/*
17 * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0
18 */
19#define IO_ADDRESS(x) IOMEM(((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\
20 IO_BASE)
21
22#define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x))
23#define io_v2p(x) ((((x) & 0x0ff00000) << 4) | ((x) & 0x000fffff))
24
25#endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
deleted file mode 100644
index a568812a0b91..000000000000
--- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-lpc32xx/include/mach/uncompress.h
4 *
5 * Author: Kevin Wells <kevin.wells@nxp.com>
6 *
7 * Copyright (C) 2010 NXP Semiconductors
8 */
9
10#ifndef __ASM_ARM_ARCH_UNCOMPRESS_H
11#define __ASM_ARM_ARCH_UNCOMPRESS_H
12
13#include <linux/io.h>
14
15#include <mach/hardware.h>
16#include <mach/platform.h>
17
18/*
19 * Uncompress output is hardcoded to standard UART 5
20 */
21
22#define UART_FIFO_CTL_TX_RESET (1 << 2)
23#define UART_STATUS_TX_MT (1 << 6)
24
25#define _UARTREG(x) (void __iomem *)(LPC32XX_UART5_BASE + (x))
26
27#define LPC32XX_UART_DLLFIFO_O 0x00
28#define LPC32XX_UART_IIRFCR_O 0x08
29#define LPC32XX_UART_LSR_O 0x14
30
31static inline void putc(int ch)
32{
33 /* Wait for transmit FIFO to empty */
34 while ((__raw_readl(_UARTREG(LPC32XX_UART_LSR_O)) &
35 UART_STATUS_TX_MT) == 0)
36 ;
37
38 __raw_writel((u32) ch, _UARTREG(LPC32XX_UART_DLLFIFO_O));
39}
40
41static inline void flush(void)
42{
43 __raw_writel(__raw_readl(_UARTREG(LPC32XX_UART_IIRFCR_O)) |
44 UART_FIFO_CTL_TX_RESET, _UARTREG(LPC32XX_UART_IIRFCR_O));
45}
46
47/* NULL functions; we don't presently need them */
48#define arch_decomp_setup()
49
50#endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/platform.h b/arch/arm/mach-lpc32xx/lpc32xx.h
index 1c53790444fc..5eeb884a1993 100644
--- a/arch/arm/mach-lpc32xx/include/mach/platform.h
+++ b/arch/arm/mach-lpc32xx/lpc32xx.h
@@ -7,8 +7,8 @@
7 * Copyright (C) 2010 NXP Semiconductors 7 * Copyright (C) 2010 NXP Semiconductors
8 */ 8 */
9 9
10#ifndef __ASM_ARCH_PLATFORM_H 10#ifndef __ARM_LPC32XX_H
11#define __ASM_ARCH_PLATFORM_H 11#define __ARM_LPC32XX_H
12 12
13#define _SBF(f, v) ((v) << (f)) 13#define _SBF(f, v) ((v) << (f))
14#define _BIT(n) _SBF(n, 1) 14#define _BIT(n) _SBF(n, 1)
@@ -700,4 +700,18 @@
700#define LPC32XX_USB_OTG_DEV_CLOCK_ON _BIT(1) 700#define LPC32XX_USB_OTG_DEV_CLOCK_ON _BIT(1)
701#define LPC32XX_USB_OTG_HOST_CLOCK_ON _BIT(0) 701#define LPC32XX_USB_OTG_HOST_CLOCK_ON _BIT(0)
702 702
703/*
704 * Start of virtual addresses for IO devices
705 */
706#define IO_BASE 0xF0000000
707
708/*
709 * This macro relies on fact that for all HW i/o addresses bits 20-23 are 0
710 */
711#define IO_ADDRESS(x) IOMEM(((((x) & 0xff000000) >> 4) | ((x) & 0xfffff)) |\
712 IO_BASE)
713
714#define io_p2v(x) ((void __iomem *) (unsigned long) IO_ADDRESS(x))
715#define io_v2p(x) ((((x) & 0x0ff00000) << 4) | ((x) & 0x000fffff))
716
703#endif 717#endif
diff --git a/arch/arm/mach-lpc32xx/pm.c b/arch/arm/mach-lpc32xx/pm.c
index 32bca351a73b..b27fa1b9f56c 100644
--- a/arch/arm/mach-lpc32xx/pm.c
+++ b/arch/arm/mach-lpc32xx/pm.c
@@ -70,8 +70,7 @@
70 70
71#include <asm/cacheflush.h> 71#include <asm/cacheflush.h>
72 72
73#include <mach/hardware.h> 73#include "lpc32xx.h"
74#include <mach/platform.h>
75#include "common.h" 74#include "common.h"
76 75
77#define TEMP_IRAM_AREA IO_ADDRESS(LPC32XX_IRAM_BASE) 76#define TEMP_IRAM_AREA IO_ADDRESS(LPC32XX_IRAM_BASE)
diff --git a/arch/arm/mach-lpc32xx/serial.c b/arch/arm/mach-lpc32xx/serial.c
index 3f9b30df9f0e..3e765c4bf986 100644
--- a/arch/arm/mach-lpc32xx/serial.c
+++ b/arch/arm/mach-lpc32xx/serial.c
@@ -16,8 +16,7 @@
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/hardware.h> 19#include "lpc32xx.h"
20#include <mach/platform.h>
21#include "common.h" 20#include "common.h"
22 21
23#define LPC32XX_SUART_FIFO_SIZE 64 22#define LPC32XX_SUART_FIFO_SIZE 64
@@ -60,6 +59,36 @@ static struct uartinit uartinit_data[] __initdata = {
60 }, 59 },
61}; 60};
62 61
62/* LPC3250 Errata HSUART.1: Hang workaround via loopback mode on inactivity */
63void lpc32xx_loopback_set(resource_size_t mapbase, int state)
64{
65 int bit;
66 u32 tmp;
67
68 switch (mapbase) {
69 case LPC32XX_HS_UART1_BASE:
70 bit = 0;
71 break;
72 case LPC32XX_HS_UART2_BASE:
73 bit = 1;
74 break;
75 case LPC32XX_HS_UART7_BASE:
76 bit = 6;
77 break;
78 default:
79 WARN(1, "lpc32xx_hs: Warning: Unknown port at %08x\n", mapbase);
80 return;
81 }
82
83 tmp = readl(LPC32XX_UARTCTL_CLOOP);
84 if (state)
85 tmp |= (1 << bit);
86 else
87 tmp &= ~(1 << bit);
88 writel(tmp, LPC32XX_UARTCTL_CLOOP);
89}
90EXPORT_SYMBOL_GPL(lpc32xx_loopback_set);
91
63void __init lpc32xx_serial_init(void) 92void __init lpc32xx_serial_init(void)
64{ 93{
65 u32 tmp, clkmodes = 0; 94 u32 tmp, clkmodes = 0;
diff --git a/arch/arm/mach-lpc32xx/suspend.S b/arch/arm/mach-lpc32xx/suspend.S
index 374f9f07fe48..3f0a8282ef6f 100644
--- a/arch/arm/mach-lpc32xx/suspend.S
+++ b/arch/arm/mach-lpc32xx/suspend.S
@@ -11,8 +11,7 @@
11 */ 11 */
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <mach/platform.h> 14#include "lpc32xx.h"
15#include <mach/hardware.h>
16 15
17/* Using named register defines makes the code easier to follow */ 16/* Using named register defines makes the code easier to follow */
18#define WORK1_REG r0 17#define WORK1_REG r0
diff --git a/arch/arm/mach-mv78xx0/mv78xx0.h b/arch/arm/mach-mv78xx0/mv78xx0.h
index 2db1265ec121..c1a9a1d1b295 100644
--- a/arch/arm/mach-mv78xx0/mv78xx0.h
+++ b/arch/arm/mach-mv78xx0/mv78xx0.h
@@ -37,7 +37,7 @@
37 * fee50000 f0d00000 64K PCIe #5 I/O space 37 * fee50000 f0d00000 64K PCIe #5 I/O space
38 * fee60000 f0e00000 64K PCIe #6 I/O space 38 * fee60000 f0e00000 64K PCIe #6 I/O space
39 * fee70000 f0f00000 64K PCIe #7 I/O space 39 * fee70000 f0f00000 64K PCIe #7 I/O space
40 * fd000000 f1000000 1M on-chip peripheral registers 40 * fec00000 f1000000 1M on-chip peripheral registers
41 */ 41 */
42#define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000 42#define MV78XX0_CORE0_REGS_PHYS_BASE 0xf1020000
43#define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000 43#define MV78XX0_CORE1_REGS_PHYS_BASE 0xf1024000
@@ -49,7 +49,7 @@
49#define MV78XX0_PCIE_IO_SIZE SZ_1M 49#define MV78XX0_PCIE_IO_SIZE SZ_1M
50 50
51#define MV78XX0_REGS_PHYS_BASE 0xf1000000 51#define MV78XX0_REGS_PHYS_BASE 0xf1000000
52#define MV78XX0_REGS_VIRT_BASE IOMEM(0xfd000000) 52#define MV78XX0_REGS_VIRT_BASE IOMEM(0xfec00000)
53#define MV78XX0_REGS_SIZE SZ_1M 53#define MV78XX0_REGS_SIZE SZ_1M
54 54
55#define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000 55#define MV78XX0_PCIE_MEM_PHYS_BASE 0xc0000000
diff --git a/arch/arm/mach-nspire/Makefile b/arch/arm/mach-nspire/Makefile
index 1d568c600452..4716b9b9aa7b 100644
--- a/arch/arm/mach-nspire/Makefile
+++ b/arch/arm/mach-nspire/Makefile
@@ -1,3 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: GPL-2.0-only
2obj-y += nspire.o 2obj-y += nspire.o
3obj-y += clcd.o
diff --git a/arch/arm/mach-nspire/clcd.c b/arch/arm/mach-nspire/clcd.c
deleted file mode 100644
index 44738dcb391d..000000000000
--- a/arch/arm/mach-nspire/clcd.c
+++ /dev/null
@@ -1,114 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-nspire/clcd.c
4 *
5 * Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
6 */
7
8#include <linux/init.h>
9#include <linux/of.h>
10#include <linux/amba/bus.h>
11#include <linux/amba/clcd.h>
12#include <linux/dma-mapping.h>
13
14static struct clcd_panel nspire_cx_lcd_panel = {
15 .mode = {
16 .name = "Color LCD",
17 .refresh = 60,
18 .xres = 320,
19 .yres = 240,
20 .sync = 0,
21 .vmode = FB_VMODE_NONINTERLACED,
22 .pixclock = 1,
23 .hsync_len = 6,
24 .vsync_len = 1,
25 .right_margin = 50,
26 .left_margin = 38,
27 .lower_margin = 3,
28 .upper_margin = 17,
29 },
30 .width = 65, /* ~6.50 cm */
31 .height = 49, /* ~4.87 cm */
32 .tim2 = TIM2_IPC,
33 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
34 .bpp = 16,
35 .caps = CLCD_CAP_565,
36};
37
38static struct clcd_panel nspire_classic_lcd_panel = {
39 .mode = {
40 .name = "Grayscale LCD",
41 .refresh = 60,
42 .xres = 320,
43 .yres = 240,
44 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
45 .vmode = FB_VMODE_NONINTERLACED,
46 .pixclock = 1,
47 .hsync_len = 6,
48 .vsync_len = 1,
49 .right_margin = 6,
50 .left_margin = 6,
51 },
52 .width = 71, /* 7.11cm */
53 .height = 53, /* 5.33cm */
54 .tim2 = 0x80007d0,
55 .cntl = CNTL_LCDMONO8,
56 .bpp = 8,
57 .grayscale = 1,
58 .caps = CLCD_CAP_5551,
59};
60
61int nspire_clcd_setup(struct clcd_fb *fb)
62{
63 struct clcd_panel *panel;
64 size_t panel_size;
65 const char *type;
66 dma_addr_t dma;
67 int err;
68
69 BUG_ON(!fb->dev->dev.of_node);
70
71 err = of_property_read_string(fb->dev->dev.of_node, "lcd-type", &type);
72 if (err) {
73 pr_err("CLCD: Could not find lcd-type property\n");
74 return err;
75 }
76
77 if (!strcmp(type, "cx")) {
78 panel = &nspire_cx_lcd_panel;
79 } else if (!strcmp(type, "classic")) {
80 panel = &nspire_classic_lcd_panel;
81 } else {
82 pr_err("CLCD: Unknown lcd-type %s\n", type);
83 return -EINVAL;
84 }
85
86 panel_size = ((panel->mode.xres * panel->mode.yres) * panel->bpp) / 8;
87 panel_size = ALIGN(panel_size, PAGE_SIZE);
88
89 fb->fb.screen_base = dma_alloc_wc(&fb->dev->dev, panel_size, &dma,
90 GFP_KERNEL);
91
92 if (!fb->fb.screen_base) {
93 pr_err("CLCD: unable to map framebuffer\n");
94 return -ENOMEM;
95 }
96
97 fb->fb.fix.smem_start = dma;
98 fb->fb.fix.smem_len = panel_size;
99 fb->panel = panel;
100
101 return 0;
102}
103
104int nspire_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
105{
106 return dma_mmap_wc(&fb->dev->dev, vma, fb->fb.screen_base,
107 fb->fb.fix.smem_start, fb->fb.fix.smem_len);
108}
109
110void nspire_clcd_remove(struct clcd_fb *fb)
111{
112 dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base,
113 fb->fb.fix.smem_start);
114}
diff --git a/arch/arm/mach-nspire/clcd.h b/arch/arm/mach-nspire/clcd.h
deleted file mode 100644
index 7f36bd8511c5..000000000000
--- a/arch/arm/mach-nspire/clcd.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * linux/arch/arm/mach-nspire/clcd.h
4 *
5 * Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
6 */
7
8int nspire_clcd_setup(struct clcd_fb *fb);
9int nspire_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma);
10void nspire_clcd_remove(struct clcd_fb *fb);
diff --git a/arch/arm/mach-nspire/nspire.c b/arch/arm/mach-nspire/nspire.c
index 957bd0c0fbd5..2d4abb0288b9 100644
--- a/arch/arm/mach-nspire/nspire.c
+++ b/arch/arm/mach-nspire/nspire.c
@@ -12,14 +12,12 @@
12#include <linux/irqchip/arm-vic.h> 12#include <linux/irqchip/arm-vic.h>
13#include <linux/clkdev.h> 13#include <linux/clkdev.h>
14#include <linux/amba/bus.h> 14#include <linux/amba/bus.h>
15#include <linux/amba/clcd.h>
16 15
17#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
18#include <asm/mach-types.h> 17#include <asm/mach-types.h>
19#include <asm/mach/map.h> 18#include <asm/mach/map.h>
20 19
21#include "mmio.h" 20#include "mmio.h"
22#include "clcd.h"
23 21
24static const char *const nspire_dt_match[] __initconst = { 22static const char *const nspire_dt_match[] __initconst = {
25 "ti,nspire", 23 "ti,nspire",
@@ -29,28 +27,6 @@ static const char *const nspire_dt_match[] __initconst = {
29 NULL, 27 NULL,
30}; 28};
31 29
32static struct clcd_board nspire_clcd_data = {
33 .name = "LCD",
34 .caps = CLCD_CAP_5551 | CLCD_CAP_565,
35 .check = clcdfb_check,
36 .decode = clcdfb_decode,
37 .setup = nspire_clcd_setup,
38 .mmap = nspire_clcd_mmap,
39 .remove = nspire_clcd_remove,
40};
41
42
43static struct of_dev_auxdata nspire_auxdata[] __initdata = {
44 OF_DEV_AUXDATA("arm,pl111", NSPIRE_LCD_PHYS_BASE,
45 NULL, &nspire_clcd_data),
46 { }
47};
48
49static void __init nspire_init(void)
50{
51 of_platform_default_populate(NULL, nspire_auxdata, NULL);
52}
53
54static void nspire_restart(enum reboot_mode mode, const char *cmd) 30static void nspire_restart(enum reboot_mode mode, const char *cmd)
55{ 31{
56 void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K); 32 void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K);
@@ -62,6 +38,5 @@ static void nspire_restart(enum reboot_mode mode, const char *cmd)
62 38
63DT_MACHINE_START(NSPIRE, "TI-NSPIRE") 39DT_MACHINE_START(NSPIRE, "TI-NSPIRE")
64 .dt_compat = nspire_dt_match, 40 .dt_compat = nspire_dt_match,
65 .init_machine = nspire_init,
66 .restart = nspire_restart, 41 .restart = nspire_restart,
67MACHINE_END 42MACHINE_END
diff --git a/arch/arm/mach-omap2/.gitignore b/arch/arm/mach-omap2/.gitignore
new file mode 100644
index 000000000000..79a8d6ea7152
--- /dev/null
+++ b/arch/arm/mach-omap2/.gitignore
@@ -0,0 +1 @@
pm-asm-offsets.h
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index d4f11c5070ae..8f208197988f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -223,11 +223,12 @@ obj-y += omap_phy_internal.o
223 223
224obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o 224obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o
225 225
226include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE 226$(obj)/pm-asm-offsets.h: $(obj)/pm-asm-offsets.s FORCE
227 $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__) 227 $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__)
228 228
229$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-asm-offsets.h 229$(obj)/sleep33xx.o $(obj)/sleep43xx.o: $(obj)/pm-asm-offsets.h
230 230
231targets += pm-asm-offsets.s 231targets += pm-asm-offsets.s
232clean-files += pm-asm-offsets.h
232 233
233obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o 234obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 14b9c13c1fa0..63423ea6a240 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -32,10 +32,8 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
32 char *hc_name; 32 char *hc_name;
33 33
34 hc_name = kzalloc(HSMMC_NAME_LEN + 1, GFP_KERNEL); 34 hc_name = kzalloc(HSMMC_NAME_LEN + 1, GFP_KERNEL);
35 if (!hc_name) { 35 if (!hc_name)
36 kfree(hc_name);
37 return -ENOMEM; 36 return -ENOMEM;
38 }
39 37
40 snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", c->mmc, 1); 38 snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", c->mmc, 1);
41 mmc->name = hc_name; 39 mmc->name = hc_name;
diff --git a/arch/arm/mach-omap2/sleep33xx.S b/arch/arm/mach-omap2/sleep33xx.S
index 68fee339d3f1..dc221249bc22 100644
--- a/arch/arm/mach-omap2/sleep33xx.S
+++ b/arch/arm/mach-omap2/sleep33xx.S
@@ -6,7 +6,6 @@
6 * Dave Gerlach, Vaibhav Bedia 6 * Dave Gerlach, Vaibhav Bedia
7 */ 7 */
8 8
9#include <generated/ti-pm-asm-offsets.h>
10#include <linux/linkage.h> 9#include <linux/linkage.h>
11#include <linux/platform_data/pm33xx.h> 10#include <linux/platform_data/pm33xx.h>
12#include <linux/ti-emif-sram.h> 11#include <linux/ti-emif-sram.h>
@@ -15,6 +14,7 @@
15 14
16#include "iomap.h" 15#include "iomap.h"
17#include "cm33xx.h" 16#include "cm33xx.h"
17#include "pm-asm-offsets.h"
18 18
19#define AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED 0x00030000 19#define AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED 0x00030000
20#define AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 0x0003 20#define AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 0x0003
diff --git a/arch/arm/mach-omap2/sleep43xx.S b/arch/arm/mach-omap2/sleep43xx.S
index c1f4e4852644..90d2907a2eb2 100644
--- a/arch/arm/mach-omap2/sleep43xx.S
+++ b/arch/arm/mach-omap2/sleep43xx.S
@@ -6,7 +6,6 @@
6 * Dave Gerlach, Vaibhav Bedia 6 * Dave Gerlach, Vaibhav Bedia
7 */ 7 */
8 8
9#include <generated/ti-pm-asm-offsets.h>
10#include <linux/linkage.h> 9#include <linux/linkage.h>
11#include <linux/ti-emif-sram.h> 10#include <linux/ti-emif-sram.h>
12#include <linux/platform_data/pm33xx.h> 11#include <linux/platform_data/pm33xx.h>
@@ -19,6 +18,7 @@
19#include "iomap.h" 18#include "iomap.h"
20#include "omap-secure.h" 19#include "omap-secure.h"
21#include "omap44xx.h" 20#include "omap44xx.h"
21#include "pm-asm-offsets.h"
22#include "prm33xx.h" 22#include "prm33xx.h"
23#include "prcm43xx.h" 23#include "prcm43xx.h"
24 24
diff --git a/arch/arm/mach-orion5x/orion5x.h b/arch/arm/mach-orion5x/orion5x.h
index 3364df331f01..2b66120fba86 100644
--- a/arch/arm/mach-orion5x/orion5x.h
+++ b/arch/arm/mach-orion5x/orion5x.h
@@ -31,13 +31,13 @@
31 * fc000000 device bus mappings (cs0/cs1) 31 * fc000000 device bus mappings (cs0/cs1)
32 * 32 *
33 * virt phys size 33 * virt phys size
34 * fe000000 f1000000 1M on-chip peripheral registers 34 * fec00000 f1000000 1M on-chip peripheral registers
35 * fee00000 f2000000 64K PCIe I/O space 35 * fee00000 f2000000 64K PCIe I/O space
36 * fee10000 f2100000 64K PCI I/O space 36 * fee10000 f2100000 64K PCI I/O space
37 * fd000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only) 37 * fd000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only)
38 ****************************************************************************/ 38 ****************************************************************************/
39#define ORION5X_REGS_PHYS_BASE 0xf1000000 39#define ORION5X_REGS_PHYS_BASE 0xf1000000
40#define ORION5X_REGS_VIRT_BASE IOMEM(0xfe000000) 40#define ORION5X_REGS_VIRT_BASE IOMEM(0xfec00000)
41#define ORION5X_REGS_SIZE SZ_1M 41#define ORION5X_REGS_SIZE SZ_1M
42 42
43#define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000 43#define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000
diff --git a/arch/arm/mach-s3c64xx/setup-usb-phy.c b/arch/arm/mach-s3c64xx/setup-usb-phy.c
index 46a9e955607f..6aaaa1d8e8b9 100644
--- a/arch/arm/mach-s3c64xx/setup-usb-phy.c
+++ b/arch/arm/mach-s3c64xx/setup-usb-phy.c
@@ -15,6 +15,11 @@
15#include "regs-sys.h" 15#include "regs-sys.h"
16#include "regs-usb-hsotg-phy.h" 16#include "regs-usb-hsotg-phy.h"
17 17
18enum samsung_usb_phy_type {
19 USB_PHY_TYPE_DEVICE,
20 USB_PHY_TYPE_HOST,
21};
22
18static int s3c_usb_otgphy_init(struct platform_device *pdev) 23static int s3c_usb_otgphy_init(struct platform_device *pdev)
19{ 24{
20 struct clk *xusbxti; 25 struct clk *xusbxti;
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 9580525102da..3875027ef8fc 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -110,7 +110,6 @@ static void ux500_restart(enum reboot_mode mode, const char *cmd)
110static const struct of_device_id u8500_local_bus_nodes[] = { 110static const struct of_device_id u8500_local_bus_nodes[] = {
111 /* only create devices below soc node */ 111 /* only create devices below soc node */
112 { .compatible = "stericsson,db8500", }, 112 { .compatible = "stericsson,db8500", },
113 { .compatible = "stericsson,db8500-prcmu", },
114 { .compatible = "simple-bus"}, 113 { .compatible = "simple-bus"},
115 { }, 114 { },
116}; 115};
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c
index 0f5381d13494..354e0e7025ae 100644
--- a/arch/arm/mach-vexpress/spc.c
+++ b/arch/arm/mach-vexpress/spc.c
@@ -69,7 +69,7 @@
69#define A7_PERFVAL_BASE 0xC30 69#define A7_PERFVAL_BASE 0xC30
70 70
71/* Config interface control bits */ 71/* Config interface control bits */
72#define SYSCFG_START (1 << 31) 72#define SYSCFG_START BIT(31)
73#define SYSCFG_SCC (6 << 20) 73#define SYSCFG_SCC (6 << 20)
74#define SYSCFG_STAT (14 << 20) 74#define SYSCFG_STAT (14 << 20)
75 75
@@ -162,7 +162,7 @@ void ve_spc_cpu_wakeup_irq(u32 cluster, u32 cpu, bool set)
162 if (cluster >= MAX_CLUSTERS) 162 if (cluster >= MAX_CLUSTERS)
163 return; 163 return;
164 164
165 mask = 1 << cpu; 165 mask = BIT(cpu);
166 166
167 if (!cluster_is_a15(cluster)) 167 if (!cluster_is_a15(cluster))
168 mask <<= 4; 168 mask <<= 4;
diff --git a/arch/arm/mach-w90x900/Kconfig b/arch/arm/mach-w90x900/Kconfig
deleted file mode 100644
index b16ffc03bbe5..000000000000
--- a/arch/arm/mach-w90x900/Kconfig
+++ /dev/null
@@ -1,50 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2if ARCH_W90X900
3
4config CPU_W90P910
5 bool
6 help
7 Support for W90P910 of Nuvoton W90X900 CPUs.
8
9config CPU_NUC950
10 bool
11 help
12 Support for NUCP950 of Nuvoton NUC900 CPUs.
13
14config CPU_NUC960
15 bool
16 help
17 Support for NUCP960 of Nuvoton NUC900 CPUs.
18
19menu "W90P910 Machines"
20
21config MACH_W90P910EVB
22 bool "Nuvoton W90P910 Evaluation Board"
23 default y
24 select CPU_W90P910
25 help
26 Say Y here if you are using the Nuvoton W90P910EVB
27
28endmenu
29
30menu "NUC950 Machines"
31
32config MACH_W90P950EVB
33 bool "Nuvoton NUC950 Evaluation Board"
34 select CPU_NUC950
35 help
36 Say Y here if you are using the Nuvoton NUC950EVB
37
38endmenu
39
40menu "NUC960 Machines"
41
42config MACH_W90N960EVB
43 bool "Nuvoton NUC960 Evaluation Board"
44 select CPU_NUC960
45 help
46 Say Y here if you are using the Nuvoton NUC960EVB
47
48endmenu
49
50endif
diff --git a/arch/arm/mach-w90x900/Makefile b/arch/arm/mach-w90x900/Makefile
deleted file mode 100644
index 33b5bf53990f..000000000000
--- a/arch/arm/mach-w90x900/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for the linux kernel.
4#
5
6# Object file lists.
7
8obj-y := irq.o time.o mfp.o gpio.o clock.o
9obj-y += clksel.o dev.o cpu.o
10# W90X900 CPU support files
11
12obj-$(CONFIG_CPU_W90P910) += nuc910.o
13obj-$(CONFIG_CPU_NUC950) += nuc950.o
14obj-$(CONFIG_CPU_NUC960) += nuc960.o
15
16# machine support
17
18obj-$(CONFIG_MACH_W90P910EVB) += mach-nuc910evb.o
19obj-$(CONFIG_MACH_W90P950EVB) += mach-nuc950evb.o
20obj-$(CONFIG_MACH_W90N960EVB) += mach-nuc960evb.o
diff --git a/arch/arm/mach-w90x900/Makefile.boot b/arch/arm/mach-w90x900/Makefile.boot
deleted file mode 100644
index 07d1b3b23ac0..000000000000
--- a/arch/arm/mach-w90x900/Makefile.boot
+++ /dev/null
@@ -1,4 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0-only
2zreladdr-y += 0x00008000
3params_phys-y := 0x00000100
4
diff --git a/arch/arm/mach-w90x900/clksel.c b/arch/arm/mach-w90x900/clksel.c
deleted file mode 100644
index b50577a5a840..000000000000
--- a/arch/arm/mach-w90x900/clksel.c
+++ /dev/null
@@ -1,88 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/clksel.c
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/device.h>
13#include <linux/list.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/string.h>
17#include <linux/clk.h>
18#include <linux/mutex.h>
19#include <linux/io.h>
20
21#include <mach/hardware.h>
22#include <mach/regs-clock.h>
23
24#define PLL0 0x00
25#define PLL1 0x01
26#define OTHER 0x02
27#define EXT 0x03
28#define MSOFFSET 0x0C
29#define ATAOFFSET 0x0a
30#define LCDOFFSET 0x06
31#define AUDOFFSET 0x04
32#define CPUOFFSET 0x00
33
34static DEFINE_MUTEX(clksel_sem);
35
36static void clock_source_select(const char *dev_id, unsigned int clkval)
37{
38 unsigned int clksel, offset;
39
40 clksel = __raw_readl(REG_CLKSEL);
41
42 if (strcmp(dev_id, "nuc900-ms") == 0)
43 offset = MSOFFSET;
44 else if (strcmp(dev_id, "nuc900-atapi") == 0)
45 offset = ATAOFFSET;
46 else if (strcmp(dev_id, "nuc900-lcd") == 0)
47 offset = LCDOFFSET;
48 else if (strcmp(dev_id, "nuc900-ac97") == 0)
49 offset = AUDOFFSET;
50 else
51 offset = CPUOFFSET;
52
53 clksel &= ~(0x03 << offset);
54 clksel |= (clkval << offset);
55
56 __raw_writel(clksel, REG_CLKSEL);
57}
58
59void nuc900_clock_source(struct device *dev, unsigned char *src)
60{
61 unsigned int clkval;
62 const char *dev_id;
63
64 BUG_ON(!src);
65 clkval = 0;
66
67 mutex_lock(&clksel_sem);
68
69 if (dev)
70 dev_id = dev_name(dev);
71 else
72 dev_id = "cpufreq";
73
74 if (strcmp(src, "pll0") == 0)
75 clkval = PLL0;
76 else if (strcmp(src, "pll1") == 0)
77 clkval = PLL1;
78 else if (strcmp(src, "ext") == 0)
79 clkval = EXT;
80 else if (strcmp(src, "oth") == 0)
81 clkval = OTHER;
82
83 clock_source_select(dev_id, clkval);
84
85 mutex_unlock(&clksel_sem);
86}
87EXPORT_SYMBOL(nuc900_clock_source);
88
diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c
deleted file mode 100644
index df55aa8ce5ff..000000000000
--- a/arch/arm/mach-w90x900/clock.c
+++ /dev/null
@@ -1,121 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/clock.c
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/list.h>
13#include <linux/errno.h>
14#include <linux/err.h>
15#include <linux/string.h>
16#include <linux/clk.h>
17#include <linux/spinlock.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20
21#include <mach/hardware.h>
22
23#include "clock.h"
24
25#define SUBCLK 0x24
26
27static DEFINE_SPINLOCK(clocks_lock);
28
29int clk_enable(struct clk *clk)
30{
31 unsigned long flags;
32
33 spin_lock_irqsave(&clocks_lock, flags);
34 if (clk->enabled++ == 0)
35 (clk->enable)(clk, 1);
36 spin_unlock_irqrestore(&clocks_lock, flags);
37
38 return 0;
39}
40EXPORT_SYMBOL(clk_enable);
41
42void clk_disable(struct clk *clk)
43{
44 unsigned long flags;
45
46 if (!clk)
47 return;
48
49 WARN_ON(clk->enabled == 0);
50
51 spin_lock_irqsave(&clocks_lock, flags);
52 if (--clk->enabled == 0)
53 (clk->enable)(clk, 0);
54 spin_unlock_irqrestore(&clocks_lock, flags);
55}
56EXPORT_SYMBOL(clk_disable);
57
58unsigned long clk_get_rate(struct clk *clk)
59{
60 return 15000000;
61}
62EXPORT_SYMBOL(clk_get_rate);
63
64void nuc900_clk_enable(struct clk *clk, int enable)
65{
66 unsigned int clocks = clk->cken;
67 unsigned long clken;
68
69 clken = __raw_readl(W90X900_VA_CLKPWR);
70
71 if (enable)
72 clken |= clocks;
73 else
74 clken &= ~clocks;
75
76 __raw_writel(clken, W90X900_VA_CLKPWR);
77}
78
79void nuc900_subclk_enable(struct clk *clk, int enable)
80{
81 unsigned int clocks = clk->cken;
82 unsigned long clken;
83
84 clken = __raw_readl(W90X900_VA_CLKPWR + SUBCLK);
85
86 if (enable)
87 clken |= clocks;
88 else
89 clken &= ~clocks;
90
91 __raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK);
92}
93
94/* dummy functions, should not be called */
95long clk_round_rate(struct clk *clk, unsigned long rate)
96{
97 WARN_ON(clk);
98 return 0;
99}
100EXPORT_SYMBOL(clk_round_rate);
101
102int clk_set_rate(struct clk *clk, unsigned long rate)
103{
104 WARN_ON(clk);
105 return 0;
106}
107EXPORT_SYMBOL(clk_set_rate);
108
109int clk_set_parent(struct clk *clk, struct clk *parent)
110{
111 WARN_ON(clk);
112 return 0;
113}
114EXPORT_SYMBOL(clk_set_parent);
115
116struct clk *clk_get_parent(struct clk *clk)
117{
118 WARN_ON(clk);
119 return NULL;
120}
121EXPORT_SYMBOL(clk_get_parent);
diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h
deleted file mode 100644
index e81c369430b3..000000000000
--- a/arch/arm/mach-w90x900/clock.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * linux/arch/arm/mach-w90x900/clock.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#include <linux/clkdev.h>
11
12void nuc900_clk_enable(struct clk *clk, int enable);
13void nuc900_subclk_enable(struct clk *clk, int enable);
14
15struct clk {
16 unsigned long cken;
17 unsigned int enabled;
18 void (*enable)(struct clk *, int enable);
19};
20
21#define DEFINE_CLK(_name, _ctrlbit) \
22struct clk clk_##_name = { \
23 .enable = nuc900_clk_enable, \
24 .cken = (1 << _ctrlbit), \
25 }
26
27#define DEFINE_SUBCLK(_name, _ctrlbit) \
28struct clk clk_##_name = { \
29 .enable = nuc900_subclk_enable, \
30 .cken = (1 << _ctrlbit), \
31 }
32
33
34#define DEF_CLKLOOK(_clk, _devname, _conname) \
35 { \
36 .clk = _clk, \
37 .dev_id = _devname, \
38 .con_id = _conname, \
39 }
40
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c
deleted file mode 100644
index aeaafc2ebb01..000000000000
--- a/arch/arm/mach-w90x900/cpu.c
+++ /dev/null
@@ -1,238 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/cpu.c
4 *
5 * Copyright (c) 2009 Nuvoton corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * NUC900 series cpu common support
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20#include <linux/serial_8250.h>
21#include <linux/delay.h>
22
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/mach/irq.h>
26#include <asm/irq.h>
27#include <asm/system_misc.h>
28
29#include <mach/hardware.h>
30#include <mach/regs-serial.h>
31#include <mach/regs-clock.h>
32#include "regs-ebi.h"
33#include "regs-timer.h"
34
35#include "cpu.h"
36#include "clock.h"
37#include "nuc9xx.h"
38
39/* Initial IO mappings */
40
41static struct map_desc nuc900_iodesc[] __initdata = {
42 IODESC_ENT(IRQ),
43 IODESC_ENT(GCR),
44 IODESC_ENT(UART),
45 IODESC_ENT(TIMER),
46 IODESC_ENT(EBI),
47 IODESC_ENT(GPIO),
48};
49
50/* Initial clock declarations. */
51static DEFINE_CLK(lcd, 0);
52static DEFINE_CLK(audio, 1);
53static DEFINE_CLK(fmi, 4);
54static DEFINE_SUBCLK(ms, 0);
55static DEFINE_SUBCLK(sd, 1);
56static DEFINE_CLK(dmac, 5);
57static DEFINE_CLK(atapi, 6);
58static DEFINE_CLK(emc, 7);
59static DEFINE_SUBCLK(rmii, 2);
60static DEFINE_CLK(usbd, 8);
61static DEFINE_CLK(usbh, 9);
62static DEFINE_CLK(g2d, 10);
63static DEFINE_CLK(pwm, 18);
64static DEFINE_CLK(ps2, 24);
65static DEFINE_CLK(kpi, 25);
66static DEFINE_CLK(wdt, 26);
67static DEFINE_CLK(gdma, 27);
68static DEFINE_CLK(adc, 28);
69static DEFINE_CLK(usi, 29);
70static DEFINE_CLK(ext, 0);
71static DEFINE_CLK(timer0, 19);
72static DEFINE_CLK(timer1, 20);
73static DEFINE_CLK(timer2, 21);
74static DEFINE_CLK(timer3, 22);
75static DEFINE_CLK(timer4, 23);
76
77static struct clk_lookup nuc900_clkregs[] = {
78 DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL),
79 DEF_CLKLOOK(&clk_audio, "nuc900-ac97", NULL),
80 DEF_CLKLOOK(&clk_fmi, "nuc900-fmi", NULL),
81 DEF_CLKLOOK(&clk_ms, "nuc900-fmi", "MS"),
82 DEF_CLKLOOK(&clk_sd, "nuc900-fmi", "SD"),
83 DEF_CLKLOOK(&clk_dmac, "nuc900-dmac", NULL),
84 DEF_CLKLOOK(&clk_atapi, "nuc900-atapi", NULL),
85 DEF_CLKLOOK(&clk_emc, "nuc900-emc", NULL),
86 DEF_CLKLOOK(&clk_rmii, "nuc900-emc", "RMII"),
87 DEF_CLKLOOK(&clk_usbd, "nuc900-usbd", NULL),
88 DEF_CLKLOOK(&clk_usbh, "nuc900-usbh", NULL),
89 DEF_CLKLOOK(&clk_g2d, "nuc900-g2d", NULL),
90 DEF_CLKLOOK(&clk_pwm, "nuc900-pwm", NULL),
91 DEF_CLKLOOK(&clk_ps2, "nuc900-ps2", NULL),
92 DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL),
93 DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL),
94 DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL),
95 DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL),
96 DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL),
97 DEF_CLKLOOK(&clk_ext, NULL, "ext"),
98 DEF_CLKLOOK(&clk_timer0, NULL, "timer0"),
99 DEF_CLKLOOK(&clk_timer1, NULL, "timer1"),
100 DEF_CLKLOOK(&clk_timer2, NULL, "timer2"),
101 DEF_CLKLOOK(&clk_timer3, NULL, "timer3"),
102 DEF_CLKLOOK(&clk_timer4, NULL, "timer4"),
103};
104
105/* Initial serial platform data */
106
107struct plat_serial8250_port nuc900_uart_data[] = {
108 NUC900_8250PORT(UART0),
109 {},
110};
111
112struct platform_device nuc900_serial_device = {
113 .name = "serial8250",
114 .id = PLAT8250_DEV_PLATFORM,
115 .dev = {
116 .platform_data = nuc900_uart_data,
117 },
118};
119
120/*Set NUC900 series cpu frequence*/
121static int __init nuc900_set_clkval(unsigned int cpufreq)
122{
123 unsigned int pllclk, ahbclk, apbclk, val;
124
125 pllclk = 0;
126 ahbclk = 0;
127 apbclk = 0;
128
129 switch (cpufreq) {
130 case 66:
131 pllclk = PLL_66MHZ;
132 ahbclk = AHB_CPUCLK_1_1;
133 apbclk = APB_AHB_1_2;
134 break;
135
136 case 100:
137 pllclk = PLL_100MHZ;
138 ahbclk = AHB_CPUCLK_1_1;
139 apbclk = APB_AHB_1_2;
140 break;
141
142 case 120:
143 pllclk = PLL_120MHZ;
144 ahbclk = AHB_CPUCLK_1_2;
145 apbclk = APB_AHB_1_2;
146 break;
147
148 case 166:
149 pllclk = PLL_166MHZ;
150 ahbclk = AHB_CPUCLK_1_2;
151 apbclk = APB_AHB_1_2;
152 break;
153
154 case 200:
155 pllclk = PLL_200MHZ;
156 ahbclk = AHB_CPUCLK_1_2;
157 apbclk = APB_AHB_1_2;
158 break;
159 }
160
161 __raw_writel(pllclk, REG_PLLCON0);
162
163 val = __raw_readl(REG_CLKDIV);
164 val &= ~(0x03 << 24 | 0x03 << 26);
165 val |= (ahbclk << 24 | apbclk << 26);
166 __raw_writel(val, REG_CLKDIV);
167
168 return 0;
169}
170static int __init nuc900_set_cpufreq(char *str)
171{
172 unsigned long cpufreq, val;
173
174 if (!*str)
175 return 0;
176
177 if (kstrtoul(str, 0, &cpufreq))
178 return 0;
179
180 nuc900_clock_source(NULL, "ext");
181
182 nuc900_set_clkval(cpufreq);
183
184 mdelay(1);
185
186 val = __raw_readl(REG_CKSKEW);
187 val &= ~0xff;
188 val |= DEFAULTSKEW;
189 __raw_writel(val, REG_CKSKEW);
190
191 nuc900_clock_source(NULL, "pll0");
192
193 return 1;
194}
195
196__setup("cpufreq=", nuc900_set_cpufreq);
197
198/*Init NUC900 evb io*/
199
200void __init nuc900_map_io(struct map_desc *mach_desc, int mach_size)
201{
202 unsigned long idcode = 0x0;
203
204 iotable_init(mach_desc, mach_size);
205 iotable_init(nuc900_iodesc, ARRAY_SIZE(nuc900_iodesc));
206
207 idcode = __raw_readl(NUC900PDID);
208 if (idcode == NUC910_CPUID)
209 printk(KERN_INFO "CPU type 0x%08lx is NUC910\n", idcode);
210 else if (idcode == NUC920_CPUID)
211 printk(KERN_INFO "CPU type 0x%08lx is NUC920\n", idcode);
212 else if (idcode == NUC950_CPUID)
213 printk(KERN_INFO "CPU type 0x%08lx is NUC950\n", idcode);
214 else if (idcode == NUC960_CPUID)
215 printk(KERN_INFO "CPU type 0x%08lx is NUC960\n", idcode);
216}
217
218/*Init NUC900 clock*/
219
220void __init nuc900_init_clocks(void)
221{
222 clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
223}
224
225#define WTCR (TMR_BA + 0x1C)
226#define WTCLK (1 << 10)
227#define WTE (1 << 7)
228#define WTRE (1 << 1)
229
230void nuc9xx_restart(enum reboot_mode mode, const char *cmd)
231{
232 if (mode == REBOOT_SOFT) {
233 /* Jump into ROM at address 0 */
234 soft_restart(0);
235 } else {
236 __raw_writel(WTE | WTRE | WTCLK, WTCR);
237 }
238}
diff --git a/arch/arm/mach-w90x900/cpu.h b/arch/arm/mach-w90x900/cpu.h
deleted file mode 100644
index a56f36d04bac..000000000000
--- a/arch/arm/mach-w90x900/cpu.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/cpu.h
4 *
5 * Based on linux/include/asm-arm/plat-s3c24xx/cpu.h by Ben Dooks
6 *
7 * Copyright (c) 2008 Nuvoton technology corporation
8 * All rights reserved.
9 *
10 * Header file for NUC900 CPU support
11 *
12 * Wan ZongShun <mcuos.com@gmail.com>
13 */
14
15#define IODESC_ENT(y) \
16{ \
17 .virtual = (unsigned long)W90X900_VA_##y, \
18 .pfn = __phys_to_pfn(W90X900_PA_##y), \
19 .length = W90X900_SZ_##y, \
20 .type = MT_DEVICE, \
21}
22
23#define NUC900_8250PORT(name) \
24{ \
25 .membase = name##_BA, \
26 .mapbase = name##_PA, \
27 .irq = IRQ_##name, \
28 .uartclk = 11313600, \
29 .regshift = 2, \
30 .iotype = UPIO_MEM, \
31 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
32}
33
34/*Cpu identifier register*/
35
36#define NUC900PDID W90X900_VA_GCR
37#define NUC910_CPUID 0x02900910
38#define NUC920_CPUID 0x02900920
39#define NUC950_CPUID 0x02900950
40#define NUC960_CPUID 0x02900960
41
42/* extern file from cpu.c */
43
44extern void nuc900_clock_source(struct device *dev, unsigned char *src);
45extern void nuc900_init_clocks(void);
46extern void nuc900_map_io(struct map_desc *mach_desc, int mach_size);
47extern void nuc900_board_init(struct platform_device **device, int size);
48
49/* for either public between 910 and 920, or between 920 and 950 */
50
51extern struct platform_device nuc900_serial_device;
52extern struct platform_device nuc900_device_fmi;
53extern struct platform_device nuc900_device_kpi;
54extern struct platform_device nuc900_device_rtc;
55extern struct platform_device nuc900_device_ts;
56extern struct platform_device nuc900_device_lcd;
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
deleted file mode 100644
index ce5fe400cb99..000000000000
--- a/arch/arm/mach-w90x900/dev.c
+++ /dev/null
@@ -1,537 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/dev.c
4 *
5 * Copyright (C) 2009 Nuvoton corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#include <linux/kernel.h>
11#include <linux/types.h>
12#include <linux/interrupt.h>
13#include <linux/list.h>
14#include <linux/timer.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/slab.h>
18#include <linux/cpu.h>
19
20#include <linux/mtd/physmap.h>
21#include <linux/mtd/mtd.h>
22#include <linux/mtd/partitions.h>
23
24#include <linux/spi/spi.h>
25#include <linux/spi/flash.h>
26
27#include <asm/system_misc.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <asm/mach/irq.h>
31#include <asm/mach-types.h>
32
33#include <mach/regs-serial.h>
34#include <linux/platform_data/spi-nuc900.h>
35#include <mach/map.h>
36#include <linux/platform_data/video-nuc900fb.h>
37#include <mach/regs-ldm.h>
38#include <linux/platform_data/keypad-w90p910.h>
39
40#include "cpu.h"
41
42/*NUC900 evb norflash driver data */
43
44#define NUC900_FLASH_BASE 0xA0000000
45#define NUC900_FLASH_SIZE 0x400000
46#define SPIOFFSET 0x200
47#define SPIOREG_SIZE 0x100
48
49static struct mtd_partition nuc900_flash_partitions[] = {
50 {
51 .name = "NOR Partition 1 for kernel (960K)",
52 .size = 0xF0000,
53 .offset = 0x10000,
54 },
55 {
56 .name = "NOR Partition 2 for image (1M)",
57 .size = 0x100000,
58 .offset = 0x100000,
59 },
60 {
61 .name = "NOR Partition 3 for user (2M)",
62 .size = 0x200000,
63 .offset = 0x00200000,
64 }
65};
66
67static struct physmap_flash_data nuc900_flash_data = {
68 .width = 2,
69 .parts = nuc900_flash_partitions,
70 .nr_parts = ARRAY_SIZE(nuc900_flash_partitions),
71};
72
73static struct resource nuc900_flash_resources[] = {
74 {
75 .start = NUC900_FLASH_BASE,
76 .end = NUC900_FLASH_BASE + NUC900_FLASH_SIZE - 1,
77 .flags = IORESOURCE_MEM,
78 }
79};
80
81static struct platform_device nuc900_flash_device = {
82 .name = "physmap-flash",
83 .id = 0,
84 .dev = {
85 .platform_data = &nuc900_flash_data,
86 },
87 .resource = nuc900_flash_resources,
88 .num_resources = ARRAY_SIZE(nuc900_flash_resources),
89};
90
91/* USB EHCI Host Controller */
92
93static struct resource nuc900_usb_ehci_resource[] = {
94 [0] = {
95 .start = W90X900_PA_USBEHCIHOST,
96 .end = W90X900_PA_USBEHCIHOST + W90X900_SZ_USBEHCIHOST - 1,
97 .flags = IORESOURCE_MEM,
98 },
99 [1] = {
100 .start = IRQ_USBH,
101 .end = IRQ_USBH,
102 .flags = IORESOURCE_IRQ,
103 }
104};
105
106static u64 nuc900_device_usb_ehci_dmamask = 0xffffffffUL;
107
108static struct platform_device nuc900_device_usb_ehci = {
109 .name = "nuc900-ehci",
110 .id = -1,
111 .num_resources = ARRAY_SIZE(nuc900_usb_ehci_resource),
112 .resource = nuc900_usb_ehci_resource,
113 .dev = {
114 .dma_mask = &nuc900_device_usb_ehci_dmamask,
115 .coherent_dma_mask = 0xffffffffUL
116 }
117};
118
119/* USB OHCI Host Controller */
120
121static struct resource nuc900_usb_ohci_resource[] = {
122 [0] = {
123 .start = W90X900_PA_USBOHCIHOST,
124 .end = W90X900_PA_USBOHCIHOST + W90X900_SZ_USBOHCIHOST - 1,
125 .flags = IORESOURCE_MEM,
126 },
127 [1] = {
128 .start = IRQ_USBH,
129 .end = IRQ_USBH,
130 .flags = IORESOURCE_IRQ,
131 }
132};
133
134static u64 nuc900_device_usb_ohci_dmamask = 0xffffffffUL;
135static struct platform_device nuc900_device_usb_ohci = {
136 .name = "nuc900-ohci",
137 .id = -1,
138 .num_resources = ARRAY_SIZE(nuc900_usb_ohci_resource),
139 .resource = nuc900_usb_ohci_resource,
140 .dev = {
141 .dma_mask = &nuc900_device_usb_ohci_dmamask,
142 .coherent_dma_mask = 0xffffffffUL
143 }
144};
145
146/* USB Device (Gadget)*/
147
148static struct resource nuc900_usbgadget_resource[] = {
149 [0] = {
150 .start = W90X900_PA_USBDEV,
151 .end = W90X900_PA_USBDEV + W90X900_SZ_USBDEV - 1,
152 .flags = IORESOURCE_MEM,
153 },
154 [1] = {
155 .start = IRQ_USBD,
156 .end = IRQ_USBD,
157 .flags = IORESOURCE_IRQ,
158 }
159};
160
161static struct platform_device nuc900_device_usbgadget = {
162 .name = "nuc900-usbgadget",
163 .id = -1,
164 .num_resources = ARRAY_SIZE(nuc900_usbgadget_resource),
165 .resource = nuc900_usbgadget_resource,
166};
167
168/* MAC device */
169
170static struct resource nuc900_emc_resource[] = {
171 [0] = {
172 .start = W90X900_PA_EMC,
173 .end = W90X900_PA_EMC + W90X900_SZ_EMC - 1,
174 .flags = IORESOURCE_MEM,
175 },
176 [1] = {
177 .start = IRQ_EMCTX,
178 .end = IRQ_EMCTX,
179 .flags = IORESOURCE_IRQ,
180 },
181 [2] = {
182 .start = IRQ_EMCRX,
183 .end = IRQ_EMCRX,
184 .flags = IORESOURCE_IRQ,
185 }
186};
187
188static u64 nuc900_device_emc_dmamask = 0xffffffffUL;
189static struct platform_device nuc900_device_emc = {
190 .name = "nuc900-emc",
191 .id = -1,
192 .num_resources = ARRAY_SIZE(nuc900_emc_resource),
193 .resource = nuc900_emc_resource,
194 .dev = {
195 .dma_mask = &nuc900_device_emc_dmamask,
196 .coherent_dma_mask = 0xffffffffUL
197 }
198};
199
200/* SPI device */
201
202static struct nuc900_spi_info nuc900_spiflash_data = {
203 .num_cs = 1,
204 .lsb = 0,
205 .txneg = 1,
206 .rxneg = 0,
207 .divider = 24,
208 .sleep = 0,
209 .txnum = 0,
210 .txbitlen = 8,
211 .bus_num = 0,
212};
213
214static struct resource nuc900_spi_resource[] = {
215 [0] = {
216 .start = W90X900_PA_I2C + SPIOFFSET,
217 .end = W90X900_PA_I2C + SPIOFFSET + SPIOREG_SIZE - 1,
218 .flags = IORESOURCE_MEM,
219 },
220 [1] = {
221 .start = IRQ_SSP,
222 .end = IRQ_SSP,
223 .flags = IORESOURCE_IRQ,
224 }
225};
226
227static struct platform_device nuc900_device_spi = {
228 .name = "nuc900-spi",
229 .id = -1,
230 .num_resources = ARRAY_SIZE(nuc900_spi_resource),
231 .resource = nuc900_spi_resource,
232 .dev = {
233 .platform_data = &nuc900_spiflash_data,
234 }
235};
236
237/* spi device, spi flash info */
238
239static struct mtd_partition nuc900_spi_flash_partitions[] = {
240 {
241 .name = "bootloader(spi)",
242 .size = 0x0100000,
243 .offset = 0,
244 },
245};
246
247static struct flash_platform_data nuc900_spi_flash_data = {
248 .name = "m25p80",
249 .parts = nuc900_spi_flash_partitions,
250 .nr_parts = ARRAY_SIZE(nuc900_spi_flash_partitions),
251 .type = "w25x16",
252};
253
254static struct spi_board_info nuc900_spi_board_info[] __initdata = {
255 {
256 .modalias = "m25p80",
257 .max_speed_hz = 20000000,
258 .bus_num = 0,
259 .chip_select = 0,
260 .platform_data = &nuc900_spi_flash_data,
261 .mode = SPI_MODE_0,
262 },
263};
264
265/* WDT Device */
266
267static struct resource nuc900_wdt_resource[] = {
268 [0] = {
269 .start = W90X900_PA_TIMER,
270 .end = W90X900_PA_TIMER + W90X900_SZ_TIMER - 1,
271 .flags = IORESOURCE_MEM,
272 },
273 [1] = {
274 .start = IRQ_WDT,
275 .end = IRQ_WDT,
276 .flags = IORESOURCE_IRQ,
277 }
278};
279
280static struct platform_device nuc900_device_wdt = {
281 .name = "nuc900-wdt",
282 .id = -1,
283 .num_resources = ARRAY_SIZE(nuc900_wdt_resource),
284 .resource = nuc900_wdt_resource,
285};
286
287/*
288 * public device definition between 910 and 920, or 910
289 * and 950 or 950 and 960...,their dev platform register
290 * should be in specific file such as nuc950, nuc960 c
291 * files rather than the public dev.c file here. so the
292 * corresponding platform_device definition should not be
293 * static.
294*/
295
296/* RTC controller*/
297
298static struct resource nuc900_rtc_resource[] = {
299 [0] = {
300 .start = W90X900_PA_RTC,
301 .end = W90X900_PA_RTC + 0xff,
302 .flags = IORESOURCE_MEM,
303 },
304 [1] = {
305 .start = IRQ_RTC,
306 .end = IRQ_RTC,
307 .flags = IORESOURCE_IRQ,
308 },
309};
310
311struct platform_device nuc900_device_rtc = {
312 .name = "nuc900-rtc",
313 .id = -1,
314 .num_resources = ARRAY_SIZE(nuc900_rtc_resource),
315 .resource = nuc900_rtc_resource,
316};
317
318/*TouchScreen controller*/
319
320static struct resource nuc900_ts_resource[] = {
321 [0] = {
322 .start = W90X900_PA_ADC,
323 .end = W90X900_PA_ADC + W90X900_SZ_ADC-1,
324 .flags = IORESOURCE_MEM,
325 },
326 [1] = {
327 .start = IRQ_ADC,
328 .end = IRQ_ADC,
329 .flags = IORESOURCE_IRQ,
330 },
331};
332
333struct platform_device nuc900_device_ts = {
334 .name = "nuc900-ts",
335 .id = -1,
336 .resource = nuc900_ts_resource,
337 .num_resources = ARRAY_SIZE(nuc900_ts_resource),
338};
339
340/* FMI Device */
341
342static struct resource nuc900_fmi_resource[] = {
343 [0] = {
344 .start = W90X900_PA_FMI,
345 .end = W90X900_PA_FMI + W90X900_SZ_FMI - 1,
346 .flags = IORESOURCE_MEM,
347 },
348 [1] = {
349 .start = IRQ_FMI,
350 .end = IRQ_FMI,
351 .flags = IORESOURCE_IRQ,
352 }
353};
354
355struct platform_device nuc900_device_fmi = {
356 .name = "nuc900-fmi",
357 .id = -1,
358 .num_resources = ARRAY_SIZE(nuc900_fmi_resource),
359 .resource = nuc900_fmi_resource,
360};
361
362/* KPI controller*/
363
364static int nuc900_keymap[] = {
365 KEY(0, 0, KEY_A),
366 KEY(0, 1, KEY_B),
367 KEY(0, 2, KEY_C),
368 KEY(0, 3, KEY_D),
369
370 KEY(1, 0, KEY_E),
371 KEY(1, 1, KEY_F),
372 KEY(1, 2, KEY_G),
373 KEY(1, 3, KEY_H),
374
375 KEY(2, 0, KEY_I),
376 KEY(2, 1, KEY_J),
377 KEY(2, 2, KEY_K),
378 KEY(2, 3, KEY_L),
379
380 KEY(3, 0, KEY_M),
381 KEY(3, 1, KEY_N),
382 KEY(3, 2, KEY_O),
383 KEY(3, 3, KEY_P),
384};
385
386static struct matrix_keymap_data nuc900_map_data = {
387 .keymap = nuc900_keymap,
388 .keymap_size = ARRAY_SIZE(nuc900_keymap),
389};
390
391struct w90p910_keypad_platform_data nuc900_keypad_info = {
392 .keymap_data = &nuc900_map_data,
393 .prescale = 0xfa,
394 .debounce = 0x50,
395};
396
397static struct resource nuc900_kpi_resource[] = {
398 [0] = {
399 .start = W90X900_PA_KPI,
400 .end = W90X900_PA_KPI + W90X900_SZ_KPI - 1,
401 .flags = IORESOURCE_MEM,
402 },
403 [1] = {
404 .start = IRQ_KPI,
405 .end = IRQ_KPI,
406 .flags = IORESOURCE_IRQ,
407 }
408
409};
410
411struct platform_device nuc900_device_kpi = {
412 .name = "nuc900-kpi",
413 .id = -1,
414 .num_resources = ARRAY_SIZE(nuc900_kpi_resource),
415 .resource = nuc900_kpi_resource,
416 .dev = {
417 .platform_data = &nuc900_keypad_info,
418 }
419};
420
421/* LCD controller*/
422
423static struct nuc900fb_display nuc900_lcd_info[] = {
424 /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
425 [0] = {
426 .type = LCM_DCCS_VA_SRC_RGB565,
427 .width = 320,
428 .height = 240,
429 .xres = 320,
430 .yres = 240,
431 .bpp = 16,
432 .pixclock = 200000,
433 .left_margin = 34,
434 .right_margin = 54,
435 .hsync_len = 10,
436 .upper_margin = 18,
437 .lower_margin = 4,
438 .vsync_len = 1,
439 .dccs = 0x8e00041a,
440 .devctl = 0x060800c0,
441 .fbctrl = 0x00a000a0,
442 .scale = 0x04000400,
443 },
444};
445
446static struct nuc900fb_mach_info nuc900_fb_info = {
447#if defined(CONFIG_GPM1040A0_320X240)
448 .displays = &nuc900_lcd_info[0],
449#else
450 .displays = nuc900_lcd_info,
451#endif
452 .num_displays = ARRAY_SIZE(nuc900_lcd_info),
453 .default_display = 0,
454 .gpio_dir = 0x00000004,
455 .gpio_dir_mask = 0xFFFFFFFD,
456 .gpio_data = 0x00000004,
457 .gpio_data_mask = 0xFFFFFFFD,
458};
459
460static struct resource nuc900_lcd_resource[] = {
461 [0] = {
462 .start = W90X900_PA_LCD,
463 .end = W90X900_PA_LCD + W90X900_SZ_LCD - 1,
464 .flags = IORESOURCE_MEM,
465 },
466 [1] = {
467 .start = IRQ_LCD,
468 .end = IRQ_LCD,
469 .flags = IORESOURCE_IRQ,
470 }
471};
472
473static u64 nuc900_device_lcd_dmamask = -1;
474struct platform_device nuc900_device_lcd = {
475 .name = "nuc900-lcd",
476 .id = -1,
477 .num_resources = ARRAY_SIZE(nuc900_lcd_resource),
478 .resource = nuc900_lcd_resource,
479 .dev = {
480 .dma_mask = &nuc900_device_lcd_dmamask,
481 .coherent_dma_mask = -1,
482 .platform_data = &nuc900_fb_info,
483 }
484};
485
486/* AUDIO controller*/
487static u64 nuc900_device_audio_dmamask = -1;
488static struct resource nuc900_ac97_resource[] = {
489 [0] = {
490 .start = W90X900_PA_ACTL,
491 .end = W90X900_PA_ACTL + W90X900_SZ_ACTL - 1,
492 .flags = IORESOURCE_MEM,
493 },
494 [1] = {
495 .start = IRQ_ACTL,
496 .end = IRQ_ACTL,
497 .flags = IORESOURCE_IRQ,
498 }
499
500};
501
502struct platform_device nuc900_device_ac97 = {
503 .name = "nuc900-ac97",
504 .id = -1,
505 .num_resources = ARRAY_SIZE(nuc900_ac97_resource),
506 .resource = nuc900_ac97_resource,
507 .dev = {
508 .dma_mask = &nuc900_device_audio_dmamask,
509 .coherent_dma_mask = -1,
510 }
511};
512
513/*Here should be your evb resourse,such as LCD*/
514
515static struct platform_device *nuc900_public_dev[] __initdata = {
516 &nuc900_serial_device,
517 &nuc900_flash_device,
518 &nuc900_device_usb_ehci,
519 &nuc900_device_usb_ohci,
520 &nuc900_device_usbgadget,
521 &nuc900_device_emc,
522 &nuc900_device_spi,
523 &nuc900_device_wdt,
524 &nuc900_device_ac97,
525};
526
527/* Provide adding specific CPU platform devices API */
528
529void __init nuc900_board_init(struct platform_device **device, int size)
530{
531 cpu_idle_poll_ctrl(true);
532 platform_add_devices(device, size);
533 platform_add_devices(nuc900_public_dev, ARRAY_SIZE(nuc900_public_dev));
534 spi_register_board_info(nuc900_spi_board_info,
535 ARRAY_SIZE(nuc900_spi_board_info));
536}
537
diff --git a/arch/arm/mach-w90x900/gpio.c b/arch/arm/mach-w90x900/gpio.c
deleted file mode 100644
index cb5df211f1ed..000000000000
--- a/arch/arm/mach-w90x900/gpio.c
+++ /dev/null
@@ -1,150 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/gpio.c
4 *
5 * Generic nuc900 GPIO handling
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#include <linux/clk.h>
11#include <linux/errno.h>
12#include <linux/interrupt.h>
13#include <linux/irq.h>
14#include <linux/debugfs.h>
15#include <linux/seq_file.h>
16#include <linux/kernel.h>
17#include <linux/list.h>
18#include <linux/module.h>
19#include <linux/io.h>
20#include <linux/gpio/driver.h>
21
22#include <mach/hardware.h>
23
24#define GPIO_BASE (W90X900_VA_GPIO)
25#define GPIO_DIR (0x04)
26#define GPIO_OUT (0x08)
27#define GPIO_IN (0x0C)
28#define GROUPINERV (0x10)
29#define GPIO_GPIO(Nb) (0x00000001 << (Nb))
30
31#define NUC900_GPIO_CHIP(name, base_gpio, nr_gpio) \
32 { \
33 .chip = { \
34 .label = name, \
35 .direction_input = nuc900_dir_input, \
36 .direction_output = nuc900_dir_output, \
37 .get = nuc900_gpio_get, \
38 .set = nuc900_gpio_set, \
39 .base = base_gpio, \
40 .ngpio = nr_gpio, \
41 } \
42 }
43
44struct nuc900_gpio_chip {
45 struct gpio_chip chip;
46 void __iomem *regbase; /* Base of group register*/
47 spinlock_t gpio_lock;
48};
49
50static int nuc900_gpio_get(struct gpio_chip *chip, unsigned offset)
51{
52 struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
53 void __iomem *pio = nuc900_gpio->regbase + GPIO_IN;
54 unsigned int regval;
55
56 regval = __raw_readl(pio);
57 regval &= GPIO_GPIO(offset);
58
59 return (regval != 0);
60}
61
62static void nuc900_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
63{
64 struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
65 void __iomem *pio = nuc900_gpio->regbase + GPIO_OUT;
66 unsigned int regval;
67 unsigned long flags;
68
69 spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
70
71 regval = __raw_readl(pio);
72
73 if (val)
74 regval |= GPIO_GPIO(offset);
75 else
76 regval &= ~GPIO_GPIO(offset);
77
78 __raw_writel(regval, pio);
79
80 spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
81}
82
83static int nuc900_dir_input(struct gpio_chip *chip, unsigned offset)
84{
85 struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
86 void __iomem *pio = nuc900_gpio->regbase + GPIO_DIR;
87 unsigned int regval;
88 unsigned long flags;
89
90 spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
91
92 regval = __raw_readl(pio);
93 regval &= ~GPIO_GPIO(offset);
94 __raw_writel(regval, pio);
95
96 spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
97
98 return 0;
99}
100
101static int nuc900_dir_output(struct gpio_chip *chip, unsigned offset, int val)
102{
103 struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
104 void __iomem *outreg = nuc900_gpio->regbase + GPIO_OUT;
105 void __iomem *pio = nuc900_gpio->regbase + GPIO_DIR;
106 unsigned int regval;
107 unsigned long flags;
108
109 spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
110
111 regval = __raw_readl(pio);
112 regval |= GPIO_GPIO(offset);
113 __raw_writel(regval, pio);
114
115 regval = __raw_readl(outreg);
116
117 if (val)
118 regval |= GPIO_GPIO(offset);
119 else
120 regval &= ~GPIO_GPIO(offset);
121
122 __raw_writel(regval, outreg);
123
124 spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
125
126 return 0;
127}
128
129static struct nuc900_gpio_chip nuc900_gpio[] = {
130 NUC900_GPIO_CHIP("GROUPC", 0, 16),
131 NUC900_GPIO_CHIP("GROUPD", 16, 10),
132 NUC900_GPIO_CHIP("GROUPE", 26, 14),
133 NUC900_GPIO_CHIP("GROUPF", 40, 10),
134 NUC900_GPIO_CHIP("GROUPG", 50, 17),
135 NUC900_GPIO_CHIP("GROUPH", 67, 8),
136 NUC900_GPIO_CHIP("GROUPI", 75, 17),
137};
138
139void __init nuc900_init_gpio(int nr_group)
140{
141 unsigned i;
142 struct nuc900_gpio_chip *gpio_chip;
143
144 for (i = 0; i < nr_group; i++) {
145 gpio_chip = &nuc900_gpio[i];
146 spin_lock_init(&gpio_chip->gpio_lock);
147 gpio_chip->regbase = GPIO_BASE + i * GROUPINERV;
148 gpiochip_add_data(&gpio_chip->chip, gpio_chip);
149 }
150}
diff --git a/arch/arm/mach-w90x900/include/mach/entry-macro.S b/arch/arm/mach-w90x900/include/mach/entry-macro.S
deleted file mode 100644
index 0ff612ac95ba..000000000000
--- a/arch/arm/mach-w90x900/include/mach/entry-macro.S
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for W90P910-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 *
10 */
11
12#include <mach/hardware.h>
13#include <mach/regs-irq.h>
14
15 .macro get_irqnr_preamble, base, tmp
16 .endm
17
18 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
19
20 mov \base, #AIC_BA
21
22 ldr \irqnr, [\base, #AIC_IPER]
23 ldr \irqnr, [\base, #AIC_ISNR]
24 cmp \irqnr, #0
25
26 .endm
diff --git a/arch/arm/mach-w90x900/include/mach/hardware.h b/arch/arm/mach-w90x900/include/mach/hardware.h
deleted file mode 100644
index 137403960483..000000000000
--- a/arch/arm/mach-w90x900/include/mach/hardware.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-w90x900/include/mach/hardware.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 * All rights reserved.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * Based on arch/arm/mach-s3c2410/include/mach/hardware.h
11 */
12
13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H
15
16#include <linux/sizes.h>
17#include <mach/map.h>
18
19#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-w90x900/include/mach/irqs.h b/arch/arm/mach-w90x900/include/mach/irqs.h
deleted file mode 100644
index 23ea01d97a02..000000000000
--- a/arch/arm/mach-w90x900/include/mach/irqs.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/include/mach/irqs.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/irqs.h
10 */
11
12#ifndef __ASM_ARCH_IRQS_H
13#define __ASM_ARCH_IRQS_H
14
15/*
16 * we keep the first set of CPU IRQs out of the range of
17 * the ISA space, so that the PC104 has them to itself
18 * and we don't end up having to do horrible things to the
19 * standard ISA drivers....
20 *
21 */
22
23#define W90X900_IRQ(x) (x)
24
25/* Main cpu interrupts */
26
27#define IRQ_WDT W90X900_IRQ(1)
28#define IRQ_GROUP0 W90X900_IRQ(2)
29#define IRQ_GROUP1 W90X900_IRQ(3)
30#define IRQ_ACTL W90X900_IRQ(4)
31#define IRQ_LCD W90X900_IRQ(5)
32#define IRQ_RTC W90X900_IRQ(6)
33#define IRQ_UART0 W90X900_IRQ(7)
34#define IRQ_UART1 W90X900_IRQ(8)
35#define IRQ_UART2 W90X900_IRQ(9)
36#define IRQ_UART3 W90X900_IRQ(10)
37#define IRQ_UART4 W90X900_IRQ(11)
38#define IRQ_TIMER0 W90X900_IRQ(12)
39#define IRQ_TIMER1 W90X900_IRQ(13)
40#define IRQ_T_INT_GROUP W90X900_IRQ(14)
41#define IRQ_USBH W90X900_IRQ(15)
42#define IRQ_EMCTX W90X900_IRQ(16)
43#define IRQ_EMCRX W90X900_IRQ(17)
44#define IRQ_GDMAGROUP W90X900_IRQ(18)
45#define IRQ_DMAC W90X900_IRQ(19)
46#define IRQ_FMI W90X900_IRQ(20)
47#define IRQ_USBD W90X900_IRQ(21)
48#define IRQ_ATAPI W90X900_IRQ(22)
49#define IRQ_G2D W90X900_IRQ(23)
50#define IRQ_PCI W90X900_IRQ(24)
51#define IRQ_SCGROUP W90X900_IRQ(25)
52#define IRQ_I2CGROUP W90X900_IRQ(26)
53#define IRQ_SSP W90X900_IRQ(27)
54#define IRQ_PWM W90X900_IRQ(28)
55#define IRQ_KPI W90X900_IRQ(29)
56#define IRQ_P2SGROUP W90X900_IRQ(30)
57#define IRQ_ADC W90X900_IRQ(31)
58#define NR_IRQS (IRQ_ADC+1)
59
60/*for irq group*/
61
62#define IRQ_PS2_PORT0 0x10000000
63#define IRQ_PS2_PORT1 0x20000000
64#define IRQ_I2C_LINE0 0x04000000
65#define IRQ_I2C_LINE1 0x08000000
66#define IRQ_SC_CARD0 0x01000000
67#define IRQ_SC_CARD1 0x02000000
68#define IRQ_GDMA_CH0 0x00100000
69#define IRQ_GDMA_CH1 0x00200000
70#define IRQ_TIMER2 0x00010000
71#define IRQ_TIMER3 0x00020000
72#define IRQ_TIMER4 0x00040000
73#define IRQ_GROUP0_IRQ0 0x00000001
74#define IRQ_GROUP0_IRQ1 0x00000002
75#define IRQ_GROUP0_IRQ2 0x00000004
76#define IRQ_GROUP0_IRQ3 0x00000008
77#define IRQ_GROUP1_IRQ4 0x00000010
78#define IRQ_GROUP1_IRQ5 0x00000020
79#define IRQ_GROUP1_IRQ6 0x00000040
80#define IRQ_GROUP1_IRQ7 0x00000080
81
82#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-w90x900/include/mach/map.h b/arch/arm/mach-w90x900/include/mach/map.h
deleted file mode 100644
index 570a74e04b1c..000000000000
--- a/arch/arm/mach-w90x900/include/mach/map.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/include/mach/map.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/map.h
10 */
11
12#ifndef __ASM_ARCH_MAP_H
13#define __ASM_ARCH_MAP_H
14
15#ifndef __ASSEMBLY__
16#define W90X900_ADDR(x) ((void __iomem *)(0xF0000000 + (x)))
17#else
18#define W90X900_ADDR(x) (0xF0000000 + (x))
19#endif
20
21#define AHB_IO_BASE 0xB0000000
22#define APB_IO_BASE 0xB8000000
23#define CLOCKPW_BASE (APB_IO_BASE+0x200)
24#define AIC_IO_BASE (APB_IO_BASE+0x2000)
25#define TIMER_IO_BASE (APB_IO_BASE+0x1000)
26
27/*
28 * interrupt controller is the first thing we put in, to make
29 * the assembly code for the irq detection easier
30 */
31#define W90X900_VA_IRQ W90X900_ADDR(0x00000000)
32#define W90X900_PA_IRQ (0xB8002000)
33#define W90X900_SZ_IRQ SZ_4K
34
35#define W90X900_VA_GCR W90X900_ADDR(0x08002000)
36#define W90X900_PA_GCR (0xB0000000)
37#define W90X900_SZ_GCR SZ_4K
38
39/* Clock and Power management */
40#define W90X900_VA_CLKPWR (W90X900_VA_GCR+0x200)
41#define W90X900_PA_CLKPWR (0xB0000200)
42#define W90X900_SZ_CLKPWR SZ_4K
43
44/* EBI management */
45#define W90X900_VA_EBI W90X900_ADDR(0x00001000)
46#define W90X900_PA_EBI (0xB0001000)
47#define W90X900_SZ_EBI SZ_4K
48
49/* UARTs */
50#define W90X900_VA_UART W90X900_ADDR(0x08000000)
51#define W90X900_PA_UART (0xB8000000)
52#define W90X900_SZ_UART SZ_4K
53
54/* Timers */
55#define W90X900_VA_TIMER W90X900_ADDR(0x08001000)
56#define W90X900_PA_TIMER (0xB8001000)
57#define W90X900_SZ_TIMER SZ_4K
58
59/* GPIO ports */
60#define W90X900_VA_GPIO W90X900_ADDR(0x08003000)
61#define W90X900_PA_GPIO (0xB8003000)
62#define W90X900_SZ_GPIO SZ_4K
63
64/* GDMA control */
65#define W90X900_VA_GDMA W90X900_ADDR(0x00004000)
66#define W90X900_PA_GDMA (0xB0004000)
67#define W90X900_SZ_GDMA SZ_4K
68
69/* USB host controller*/
70#define W90X900_VA_USBEHCIHOST W90X900_ADDR(0x00005000)
71#define W90X900_PA_USBEHCIHOST (0xB0005000)
72#define W90X900_SZ_USBEHCIHOST SZ_4K
73
74#define W90X900_VA_USBOHCIHOST W90X900_ADDR(0x00007000)
75#define W90X900_PA_USBOHCIHOST (0xB0007000)
76#define W90X900_SZ_USBOHCIHOST SZ_4K
77
78/* I2C hardware controller */
79#define W90X900_VA_I2C W90X900_ADDR(0x08006000)
80#define W90X900_PA_I2C (0xB8006000)
81#define W90X900_SZ_I2C SZ_4K
82
83/* Keypad Interface*/
84#define W90X900_VA_KPI W90X900_ADDR(0x08008000)
85#define W90X900_PA_KPI (0xB8008000)
86#define W90X900_SZ_KPI SZ_4K
87
88/* Smart card host*/
89#define W90X900_VA_SC W90X900_ADDR(0x08005000)
90#define W90X900_PA_SC (0xB8005000)
91#define W90X900_SZ_SC SZ_4K
92
93/* LCD controller*/
94#define W90X900_VA_LCD W90X900_ADDR(0x00008000)
95#define W90X900_PA_LCD (0xB0008000)
96#define W90X900_SZ_LCD SZ_4K
97
98/* 2D controller*/
99#define W90X900_VA_GE W90X900_ADDR(0x0000B000)
100#define W90X900_PA_GE (0xB000B000)
101#define W90X900_SZ_GE SZ_4K
102
103/* ATAPI */
104#define W90X900_VA_ATAPI W90X900_ADDR(0x0000A000)
105#define W90X900_PA_ATAPI (0xB000A000)
106#define W90X900_SZ_ATAPI SZ_4K
107
108/* ADC */
109#define W90X900_VA_ADC W90X900_ADDR(0x0800A000)
110#define W90X900_PA_ADC (0xB800A000)
111#define W90X900_SZ_ADC SZ_4K
112
113/* PS2 Interface*/
114#define W90X900_VA_PS2 W90X900_ADDR(0x08009000)
115#define W90X900_PA_PS2 (0xB8009000)
116#define W90X900_SZ_PS2 SZ_4K
117
118/* RTC */
119#define W90X900_VA_RTC W90X900_ADDR(0x08004000)
120#define W90X900_PA_RTC (0xB8004000)
121#define W90X900_SZ_RTC SZ_4K
122
123/* Pulse Width Modulation(PWM) Registers */
124#define W90X900_VA_PWM W90X900_ADDR(0x08007000)
125#define W90X900_PA_PWM (0xB8007000)
126#define W90X900_SZ_PWM SZ_4K
127
128/* Audio Controller controller */
129#define W90X900_VA_ACTL W90X900_ADDR(0x00009000)
130#define W90X900_PA_ACTL (0xB0009000)
131#define W90X900_SZ_ACTL SZ_4K
132
133/* DMA controller */
134#define W90X900_VA_DMA W90X900_ADDR(0x0000c000)
135#define W90X900_PA_DMA (0xB000c000)
136#define W90X900_SZ_DMA SZ_4K
137
138/* FMI controller */
139#define W90X900_VA_FMI W90X900_ADDR(0x0000d000)
140#define W90X900_PA_FMI (0xB000d000)
141#define W90X900_SZ_FMI SZ_4K
142
143/* USB Device port */
144#define W90X900_VA_USBDEV W90X900_ADDR(0x00006000)
145#define W90X900_PA_USBDEV (0xB0006000)
146#define W90X900_SZ_USBDEV SZ_4K
147
148/* External MAC control*/
149#define W90X900_VA_EMC W90X900_ADDR(0x00003000)
150#define W90X900_PA_EMC (0xB0003000)
151#define W90X900_SZ_EMC SZ_4K
152
153#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-w90x900/include/mach/mfp.h b/arch/arm/mach-w90x900/include/mach/mfp.h
deleted file mode 100644
index be5485efab0a..000000000000
--- a/arch/arm/mach-w90x900/include/mach/mfp.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/include/mach/mfp.h
4 *
5 * Copyright (c) 2010 Nuvoton technology corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/map.h
10 */
11
12#ifndef __ASM_ARCH_MFP_H
13#define __ASM_ARCH_MFP_H
14
15extern void mfp_set_groupf(struct device *dev);
16extern void mfp_set_groupc(struct device *dev);
17extern void mfp_set_groupi(struct device *dev);
18extern void mfp_set_groupg(struct device *dev, const char *subname);
19extern void mfp_set_groupd(struct device *dev, const char *subname);
20
21#endif /* __ASM_ARCH_MFP_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-clock.h b/arch/arm/mach-w90x900/include/mach/regs-clock.h
deleted file mode 100644
index f06245d26bd7..000000000000
--- a/arch/arm/mach-w90x900/include/mach/regs-clock.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-clock.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#ifndef __ASM_ARCH_REGS_CLOCK_H
11#define __ASM_ARCH_REGS_CLOCK_H
12
13/* Clock Control Registers */
14#define CLK_BA W90X900_VA_CLKPWR
15#define REG_CLKEN (CLK_BA + 0x00)
16#define REG_CLKSEL (CLK_BA + 0x04)
17#define REG_CLKDIV (CLK_BA + 0x08)
18#define REG_PLLCON0 (CLK_BA + 0x0C)
19#define REG_PLLCON1 (CLK_BA + 0x10)
20#define REG_PMCON (CLK_BA + 0x14)
21#define REG_IRQWAKECON (CLK_BA + 0x18)
22#define REG_IRQWAKEFLAG (CLK_BA + 0x1C)
23#define REG_IPSRST (CLK_BA + 0x20)
24#define REG_CLKEN1 (CLK_BA + 0x24)
25#define REG_CLKDIV1 (CLK_BA + 0x28)
26
27/* Define PLL freq setting */
28#define PLL_DISABLE 0x12B63
29#define PLL_66MHZ 0x2B63
30#define PLL_100MHZ 0x4F64
31#define PLL_120MHZ 0x4F63
32#define PLL_166MHZ 0x4124
33#define PLL_200MHZ 0x4F24
34
35/* Define AHB:CPUFREQ ratio */
36#define AHB_CPUCLK_1_1 0x00
37#define AHB_CPUCLK_1_2 0x01
38#define AHB_CPUCLK_1_4 0x02
39#define AHB_CPUCLK_1_8 0x03
40
41/* Define APB:AHB ratio */
42#define APB_AHB_1_2 0x01
43#define APB_AHB_1_4 0x02
44#define APB_AHB_1_8 0x03
45
46/* Define clock skew */
47#define DEFAULTSKEW 0x48
48
49#endif /* __ASM_ARCH_REGS_CLOCK_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-irq.h b/arch/arm/mach-w90x900/include/mach/regs-irq.h
deleted file mode 100644
index 89fcbc60b60a..000000000000
--- a/arch/arm/mach-w90x900/include/mach/regs-irq.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-irq.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 * All rights reserved.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * Based on arch/arm/mach-s3c2410/include/mach/regs-irq.h
11 */
12
13#ifndef ___ASM_ARCH_REGS_IRQ_H
14#define ___ASM_ARCH_REGS_IRQ_H
15
16/* Advance Interrupt Controller (AIC) Registers */
17
18#define AIC_BA W90X900_VA_IRQ
19
20#define REG_AIC_IRQSC (AIC_BA+0x80)
21#define REG_AIC_GEN (AIC_BA+0x84)
22#define REG_AIC_GASR (AIC_BA+0x88)
23#define REG_AIC_GSCR (AIC_BA+0x8C)
24#define REG_AIC_IRSR (AIC_BA+0x100)
25#define REG_AIC_IASR (AIC_BA+0x104)
26#define REG_AIC_ISR (AIC_BA+0x108)
27#define REG_AIC_IPER (AIC_BA+0x10C)
28#define REG_AIC_ISNR (AIC_BA+0x110)
29#define REG_AIC_IMR (AIC_BA+0x114)
30#define REG_AIC_OISR (AIC_BA+0x118)
31#define REG_AIC_MECR (AIC_BA+0x120)
32#define REG_AIC_MDCR (AIC_BA+0x124)
33#define REG_AIC_SSCR (AIC_BA+0x128)
34#define REG_AIC_SCCR (AIC_BA+0x12C)
35#define REG_AIC_EOSCR (AIC_BA+0x130)
36#define AIC_IPER (0x10C)
37#define AIC_ISNR (0x110)
38
39/*16-18 bits of REG_AIC_GEN define irq(2-4) group*/
40
41#define TIMER2_IRQ (1 << 16)
42#define TIMER3_IRQ (1 << 17)
43#define TIMER4_IRQ (1 << 18)
44#define TIME_GROUP_IRQ (TIMER2_IRQ|TIMER3_IRQ|TIMER4_IRQ)
45
46#endif /* ___ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-ldm.h b/arch/arm/mach-w90x900/include/mach/regs-ldm.h
deleted file mode 100644
index ffe7e67c99de..000000000000
--- a/arch/arm/mach-w90x900/include/mach/regs-ldm.h
+++ /dev/null
@@ -1,248 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-serial.h
4 *
5 * Copyright (c) 2009 Nuvoton technology corporation
6 * All rights reserved.
7 *
8 * Description:
9 * Nuvoton Display, LCM Register list
10 * Author: Wang Qiang (rurality.linux@gmail.com) 2009/12/11
11 */
12
13
14#ifndef __ASM_ARM_W90X900_REGS_LDM_H
15#define __ASM_ARM_W90X900_REGS_LDM_H
16
17#include <mach/map.h>
18
19/* Display Controller Control/Status Register */
20#define REG_LCM_DCCS (0x00)
21
22#define LCM_DCCS_ENG_RST (1 << 0)
23#define LCM_DCCS_VA_EN (1 << 1)
24#define LCM_DCCS_OSD_EN (1 << 2)
25#define LCM_DCCS_DISP_OUT_EN (1 << 3)
26#define LCM_DCCS_DISP_INT_EN (1 << 4)
27#define LCM_DCCS_CMD_ON (1 << 5)
28#define LCM_DCCS_FIELD_INTR (1 << 6)
29#define LCM_DCCS_SINGLE (1 << 7)
30
31enum LCM_DCCS_VA_SRC {
32 LCM_DCCS_VA_SRC_YUV422 = (0 << 8),
33 LCM_DCCS_VA_SRC_YCBCR422 = (1 << 8),
34 LCM_DCCS_VA_SRC_RGB888 = (2 << 8),
35 LCM_DCCS_VA_SRC_RGB666 = (3 << 8),
36 LCM_DCCS_VA_SRC_RGB565 = (4 << 8),
37 LCM_DCCS_VA_SRC_RGB444LOW = (5 << 8),
38 LCM_DCCS_VA_SRC_RGB444HIGH = (7 << 8)
39};
40
41
42/* Display Device Control Register */
43#define REG_LCM_DEV_CTRL (0x04)
44
45enum LCM_DEV_CTRL_SWAP_YCbCr {
46 LCM_DEV_CTRL_SWAP_UYVY = (0 << 1),
47 LCM_DEV_CTRL_SWAP_YUYV = (1 << 1),
48 LCM_DEV_CTRL_SWAP_VYUY = (2 << 1),
49 LCM_DEV_CTRL_SWAP_YVYU = (3 << 1)
50};
51
52enum LCM_DEV_CTRL_RGB_SHIFT {
53 LCM_DEV_CTRL_RGB_SHIFT_NOT = (0 << 3),
54 LCM_DEV_CTRL_RGB_SHIFT_ONECYCLE = (1 << 3),
55 LCM_DEV_CTRL_RGB_SHIFT_TWOCYCLE = (2 << 3),
56 LCM_DEV_CTRL_RGB_SHIFT_NOT_DEF = (3 << 3)
57};
58
59enum LCM_DEV_CTRL_DEVICE {
60 LCM_DEV_CTRL_DEVICE_YUV422 = (0 << 5),
61 LCM_DEV_CTRL_DEVICE_YUV444 = (1 << 5),
62 LCM_DEV_CTRL_DEVICE_UNIPAC = (4 << 5),
63 LCM_DEV_CTRL_DEVICE_SEIKO_EPSON = (5 << 5),
64 LCM_DEV_CTRL_DEVICE_HIGH_COLOR = (6 << 5),
65 LCM_DEV_CTRL_DEVICE_MPU = (7 << 5)
66};
67
68#define LCM_DEV_CTRL_LCD_DDA (8)
69#define LCM_DEV_CTRL_YUV2CCIR (16)
70
71enum LCM_DEV_CTRL_LCD_SEL {
72 LCM_DEV_CTRL_LCD_SEL_RGB_GBR = (0 << 17),
73 LCM_DEV_CTRL_LCD_SEL_BGR_RBG = (1 << 17),
74 LCM_DEV_CTRL_LCD_SEL_GBR_RGB = (2 << 17),
75 LCM_DEV_CTRL_LCD_SEL_RBG_BGR = (3 << 17)
76};
77
78enum LCM_DEV_CTRL_FAL_D {
79 LCM_DEV_CTRL_FAL_D_FALLING = (0 << 19),
80 LCM_DEV_CTRL_FAL_D_RISING = (1 << 19),
81};
82
83enum LCM_DEV_CTRL_H_POL {
84 LCM_DEV_CTRL_H_POL_LOW = (0 << 20),
85 LCM_DEV_CTRL_H_POL_HIGH = (1 << 20),
86};
87
88enum LCM_DEV_CTRL_V_POL {
89 LCM_DEV_CTRL_V_POL_LOW = (0 << 21),
90 LCM_DEV_CTRL_V_POL_HIGH = (1 << 21),
91};
92
93enum LCM_DEV_CTRL_VR_LACE {
94 LCM_DEV_CTRL_VR_LACE_NINTERLACE = (0 << 22),
95 LCM_DEV_CTRL_VR_LACE_INTERLACE = (1 << 22),
96};
97
98enum LCM_DEV_CTRL_LACE {
99 LCM_DEV_CTRL_LACE_NINTERLACE = (0 << 23),
100 LCM_DEV_CTRL_LACE_INTERLACE = (1 << 23),
101};
102
103enum LCM_DEV_CTRL_RGB_SCALE {
104 LCM_DEV_CTRL_RGB_SCALE_4096 = (0 << 24),
105 LCM_DEV_CTRL_RGB_SCALE_65536 = (1 << 24),
106 LCM_DEV_CTRL_RGB_SCALE_262144 = (2 << 24),
107 LCM_DEV_CTRL_RGB_SCALE_16777216 = (3 << 24),
108};
109
110enum LCM_DEV_CTRL_DBWORD {
111 LCM_DEV_CTRL_DBWORD_HALFWORD = (0 << 26),
112 LCM_DEV_CTRL_DBWORD_FULLWORD = (1 << 26),
113};
114
115enum LCM_DEV_CTRL_MPU68 {
116 LCM_DEV_CTRL_MPU68_80_SERIES = (0 << 27),
117 LCM_DEV_CTRL_MPU68_68_SERIES = (1 << 27),
118};
119
120enum LCM_DEV_CTRL_DE_POL {
121 LCM_DEV_CTRL_DE_POL_HIGH = (0 << 28),
122 LCM_DEV_CTRL_DE_POL_LOW = (1 << 28),
123};
124
125#define LCM_DEV_CTRL_CMD16 (29)
126#define LCM_DEV_CTRL_CM16t18 (30)
127#define LCM_DEV_CTRL_CMD_LOW (31)
128
129/* MPU-Interface LCD Write Command */
130#define REG_LCM_MPU_CMD (0x08)
131
132/* Interrupt Control/Status Register */
133#define REG_LCM_INT_CS (0x0c)
134#define LCM_INT_CS_DISP_F_EN (1 << 0)
135#define LCM_INT_CS_UNDERRUN_EN (1 << 1)
136#define LCM_INT_CS_BUS_ERROR_INT (1 << 28)
137#define LCM_INT_CS_UNDERRUN_INT (1 << 29)
138#define LCM_INT_CS_DISP_F_STATUS (1 << 30)
139#define LCM_INT_CS_DISP_F_INT (1 << 31)
140
141/* CRTC Display Size Control Register */
142#define REG_LCM_CRTC_SIZE (0x10)
143#define LCM_CRTC_SIZE_VTTVAL(x) ((x) << 16)
144#define LCM_CRTC_SIZE_HTTVAL(x) ((x) << 0)
145
146/* CRTC Display Enable End */
147#define REG_LCM_CRTC_DEND (0x14)
148#define LCM_CRTC_DEND_VDENDVAL(x) ((x) << 16)
149#define LCM_CRTC_DEND_HDENDVAL(x) ((x) << 0)
150
151/* CRTC Internal Horizontal Retrace Control Register */
152#define REG_LCM_CRTC_HR (0x18)
153#define LCM_CRTC_HR_EVAL(x) ((x) << 16)
154#define LCM_CRTC_HR_SVAL(x) ((x) << 0)
155
156/* CRTC Horizontal Sync Control Register */
157#define REG_LCM_CRTC_HSYNC (0x1C)
158#define LCM_CRTC_HSYNC_SHIFTVAL(x) ((x) << 30)
159#define LCM_CRTC_HSYNC_EVAL(x) ((x) << 16)
160#define LCM_CRTC_HSYNC_SVAL(x) ((x) << 0)
161
162/* CRTC Internal Vertical Retrace Control Register */
163#define REG_LCM_CRTC_VR (0x20)
164#define LCM_CRTC_VR_EVAL(x) ((x) << 16)
165#define LCM_CRTC_VR_SVAL(x) ((x) << 0)
166
167/* Video Stream Frame Buffer-0 Starting Address */
168#define REG_LCM_VA_BADDR0 (0x24)
169
170/* Video Stream Frame Buffer-1 Starting Address */
171#define REG_LCM_VA_BADDR1 (0x28)
172
173/* Video Stream Frame Buffer Control Register */
174#define REG_LCM_VA_FBCTRL (0x2C)
175#define LCM_VA_FBCTRL_IO_REGION_HALF (1 << 28)
176#define LCM_VA_FBCTRL_FIELD_DUAL (1 << 29)
177#define LCM_VA_FBCTRL_START_BUF (1 << 30)
178#define LCM_VA_FBCTRL_DB_EN (1 << 31)
179
180/* Video Stream Scaling Control Register */
181#define REG_LCM_VA_SCALE (0x30)
182#define LCM_VA_SCALE_XCOPY_INTERPOLATION (0 << 15)
183#define LCM_VA_SCALE_XCOPY_DUPLICATION (1 << 15)
184
185/* Image Stream Active Window Coordinates */
186#define REG_LCM_VA_WIN (0x38)
187
188/* Image Stream Stuff Pixel */
189#define REG_LCM_VA_STUFF (0x3C)
190
191/* OSD Window Starting Coordinates */
192#define REG_LCM_OSD_WINS (0x40)
193
194/* OSD Window Ending Coordinates */
195#define REG_LCM_OSD_WINE (0x44)
196
197/* OSD Stream Frame Buffer Starting Address */
198#define REG_LCM_OSD_BADDR (0x48)
199
200/* OSD Stream Frame Buffer Control Register */
201#define REG_LCM_OSD_FBCTRL (0x4c)
202
203/* OSD Overlay Control Register */
204#define REG_LCM_OSD_OVERLAY (0x50)
205
206/* OSD Overlay Color-Key Pattern Register */
207#define REG_LCM_OSD_CKEY (0x54)
208
209/* OSD Overlay Color-Key Mask Register */
210#define REG_LCM_OSD_CMASK (0x58)
211
212/* OSD Window Skip1 Register */
213#define REG_LCM_OSD_SKIP1 (0x5C)
214
215/* OSD Window Skip2 Register */
216#define REG_LCM_OSD_SKIP2 (0x60)
217
218/* OSD horizontal up scaling control register */
219#define REG_LCM_OSD_SCALE (0x64)
220
221/* MPU Vsync control register */
222#define REG_LCM_MPU_VSYNC (0x68)
223
224/* Hardware cursor control Register */
225#define REG_LCM_HC_CTRL (0x6C)
226
227/* Hardware cursot tip point potison on va picture */
228#define REG_LCM_HC_POS (0x70)
229
230/* Hardware Cursor Window Buffer Control Register */
231#define REG_LCM_HC_WBCTRL (0x74)
232
233/* Hardware cursor memory base address register */
234#define REG_LCM_HC_BADDR (0x78)
235
236/* Hardware cursor color ram register mapped to bpp = 0 */
237#define REG_LCM_HC_COLOR0 (0x7C)
238
239/* Hardware cursor color ram register mapped to bpp = 1 */
240#define REG_LCM_HC_COLOR1 (0x80)
241
242/* Hardware cursor color ram register mapped to bpp = 2 */
243#define REG_LCM_HC_COLOR2 (0x84)
244
245/* Hardware cursor color ram register mapped to bpp = 3 */
246#define REG_LCM_HC_COLOR3 (0x88)
247
248#endif /* __ASM_ARM_W90X900_REGS_LDM_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-serial.h b/arch/arm/mach-w90x900/include/mach/regs-serial.h
deleted file mode 100644
index 797c9727a157..000000000000
--- a/arch/arm/mach-w90x900/include/mach/regs-serial.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-serial.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 * All rights reserved.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * Based on arch/arm/mach-s3c2410/include/mach/regs-serial.h
11 */
12
13#ifndef __ASM_ARM_REGS_SERIAL_H
14#define __ASM_ARM_REGS_SERIAL_H
15
16#define UART0_BA W90X900_VA_UART
17#define UART1_BA (W90X900_VA_UART+0x100)
18#define UART2_BA (W90X900_VA_UART+0x200)
19#define UART3_BA (W90X900_VA_UART+0x300)
20#define UART4_BA (W90X900_VA_UART+0x400)
21
22#define UART0_PA W90X900_PA_UART
23#define UART1_PA (W90X900_PA_UART+0x100)
24#define UART2_PA (W90X900_PA_UART+0x200)
25#define UART3_PA (W90X900_PA_UART+0x300)
26#define UART4_PA (W90X900_PA_UART+0x400)
27
28#ifndef __ASSEMBLY__
29
30struct w90x900_uart_clksrc {
31 const char *name;
32 unsigned int divisor;
33 unsigned int min_baud;
34 unsigned int max_baud;
35};
36
37struct w90x900_uartcfg {
38 unsigned char hwport;
39 unsigned char unused;
40 unsigned short flags;
41 unsigned long uart_flags;
42
43 unsigned long ucon;
44 unsigned long ulcon;
45 unsigned long ufcon;
46
47 struct w90x900_uart_clksrc *clocks;
48 unsigned int clocks_size;
49};
50
51#endif /* __ASSEMBLY__ */
52
53#endif /* __ASM_ARM_REGS_SERIAL_H */
54
diff --git a/arch/arm/mach-w90x900/include/mach/uncompress.h b/arch/arm/mach-w90x900/include/mach/uncompress.h
deleted file mode 100644
index 32e92a77ccae..000000000000
--- a/arch/arm/mach-w90x900/include/mach/uncompress.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-w90x900/include/mach/uncompress.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 * All rights reserved.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * Based on arch/arm/mach-s3c2410/include/mach/uncompress.h
11 */
12
13#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H
15
16/* Defines for UART registers */
17
18#include <mach/regs-serial.h>
19#include <mach/map.h>
20#include <linux/serial_reg.h>
21
22#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
23static volatile u32 * const uart_base = (u32 *)UART0_PA;
24
25static inline void putc(int ch)
26{
27 /* Check THRE and TEMT bits before we transmit the character.
28 */
29 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
30 barrier();
31
32 *uart_base = ch;
33}
34
35static inline void flush(void)
36{
37}
38
39static void arch_decomp_setup(void)
40{
41}
42
43#endif/* __ASM_W90X900_UNCOMPRESS_H */
diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c
deleted file mode 100644
index 081b0f65477a..000000000000
--- a/arch/arm/mach-w90x900/irq.c
+++ /dev/null
@@ -1,212 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/irq.c
4 *
5 * based on linux/arch/arm/plat-s3c24xx/irq.c by Ben Dooks
6 *
7 * Copyright (c) 2008 Nuvoton technology corporation
8 * All rights reserved.
9 *
10 * Wan ZongShun <mcuos.com@gmail.com>
11 */
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <linux/ptrace.h>
18#include <linux/device.h>
19#include <linux/io.h>
20
21#include <asm/irq.h>
22#include <asm/mach/irq.h>
23
24#include <mach/hardware.h>
25#include <mach/regs-irq.h>
26
27#include "nuc9xx.h"
28
29struct group_irq {
30 unsigned long gpen;
31 unsigned int enabled;
32 void (*enable)(struct group_irq *, int enable);
33};
34
35static DEFINE_SPINLOCK(groupirq_lock);
36
37#define DEFINE_GROUP(_name, _ctrlbit, _num) \
38struct group_irq group_##_name = { \
39 .enable = nuc900_group_enable, \
40 .gpen = ((1 << _num) - 1) << _ctrlbit, \
41 }
42
43static void nuc900_group_enable(struct group_irq *gpirq, int enable);
44
45static DEFINE_GROUP(nirq0, 0, 4);
46static DEFINE_GROUP(nirq1, 4, 4);
47static DEFINE_GROUP(usbh, 8, 2);
48static DEFINE_GROUP(ottimer, 16, 3);
49static DEFINE_GROUP(gdma, 20, 2);
50static DEFINE_GROUP(sc, 24, 2);
51static DEFINE_GROUP(i2c, 26, 2);
52static DEFINE_GROUP(ps2, 28, 2);
53
54static int group_irq_enable(struct group_irq *group_irq)
55{
56 unsigned long flags;
57
58 spin_lock_irqsave(&groupirq_lock, flags);
59 if (group_irq->enabled++ == 0)
60 (group_irq->enable)(group_irq, 1);
61 spin_unlock_irqrestore(&groupirq_lock, flags);
62
63 return 0;
64}
65
66static void group_irq_disable(struct group_irq *group_irq)
67{
68 unsigned long flags;
69
70 WARN_ON(group_irq->enabled == 0);
71
72 spin_lock_irqsave(&groupirq_lock, flags);
73 if (--group_irq->enabled == 0)
74 (group_irq->enable)(group_irq, 0);
75 spin_unlock_irqrestore(&groupirq_lock, flags);
76}
77
78static void nuc900_group_enable(struct group_irq *gpirq, int enable)
79{
80 unsigned int groupen = gpirq->gpen;
81 unsigned long regval;
82
83 regval = __raw_readl(REG_AIC_GEN);
84
85 if (enable)
86 regval |= groupen;
87 else
88 regval &= ~groupen;
89
90 __raw_writel(regval, REG_AIC_GEN);
91}
92
93static void nuc900_irq_mask(struct irq_data *d)
94{
95 struct group_irq *group_irq;
96
97 group_irq = NULL;
98
99 __raw_writel(1 << d->irq, REG_AIC_MDCR);
100
101 switch (d->irq) {
102 case IRQ_GROUP0:
103 group_irq = &group_nirq0;
104 break;
105
106 case IRQ_GROUP1:
107 group_irq = &group_nirq1;
108 break;
109
110 case IRQ_USBH:
111 group_irq = &group_usbh;
112 break;
113
114 case IRQ_T_INT_GROUP:
115 group_irq = &group_ottimer;
116 break;
117
118 case IRQ_GDMAGROUP:
119 group_irq = &group_gdma;
120 break;
121
122 case IRQ_SCGROUP:
123 group_irq = &group_sc;
124 break;
125
126 case IRQ_I2CGROUP:
127 group_irq = &group_i2c;
128 break;
129
130 case IRQ_P2SGROUP:
131 group_irq = &group_ps2;
132 break;
133 }
134
135 if (group_irq)
136 group_irq_disable(group_irq);
137}
138
139/*
140 * By the w90p910 spec,any irq,only write 1
141 * to REG_AIC_EOSCR for ACK
142 */
143
144static void nuc900_irq_ack(struct irq_data *d)
145{
146 __raw_writel(0x01, REG_AIC_EOSCR);
147}
148
149static void nuc900_irq_unmask(struct irq_data *d)
150{
151 struct group_irq *group_irq;
152
153 group_irq = NULL;
154
155 __raw_writel(1 << d->irq, REG_AIC_MECR);
156
157 switch (d->irq) {
158 case IRQ_GROUP0:
159 group_irq = &group_nirq0;
160 break;
161
162 case IRQ_GROUP1:
163 group_irq = &group_nirq1;
164 break;
165
166 case IRQ_USBH:
167 group_irq = &group_usbh;
168 break;
169
170 case IRQ_T_INT_GROUP:
171 group_irq = &group_ottimer;
172 break;
173
174 case IRQ_GDMAGROUP:
175 group_irq = &group_gdma;
176 break;
177
178 case IRQ_SCGROUP:
179 group_irq = &group_sc;
180 break;
181
182 case IRQ_I2CGROUP:
183 group_irq = &group_i2c;
184 break;
185
186 case IRQ_P2SGROUP:
187 group_irq = &group_ps2;
188 break;
189 }
190
191 if (group_irq)
192 group_irq_enable(group_irq);
193}
194
195static struct irq_chip nuc900_irq_chip = {
196 .irq_ack = nuc900_irq_ack,
197 .irq_mask = nuc900_irq_mask,
198 .irq_unmask = nuc900_irq_unmask,
199};
200
201void __init nuc900_init_irq(void)
202{
203 int irqno;
204
205 __raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
206
207 for (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) {
208 irq_set_chip_and_handler(irqno, &nuc900_irq_chip,
209 handle_level_irq);
210 irq_clear_status_flags(irqno, IRQ_NOREQUEST);
211 }
212}
diff --git a/arch/arm/mach-w90x900/mach-nuc910evb.c b/arch/arm/mach-w90x900/mach-nuc910evb.c
deleted file mode 100644
index e6d30af3e35a..000000000000
--- a/arch/arm/mach-w90x900/mach-nuc910evb.c
+++ /dev/null
@@ -1,38 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/mach-nuc910evb.c
4 *
5 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
6 *
7 * Copyright (C) 2008 Nuvoton technology corporation.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 */
11
12#include <linux/platform_device.h>
13#include <asm/mach/arch.h>
14#include <asm/mach/map.h>
15#include <asm/mach-types.h>
16#include <mach/map.h>
17
18#include "nuc910.h"
19
20static void __init nuc910evb_map_io(void)
21{
22 nuc910_map_io();
23 nuc910_init_clocks();
24}
25
26static void __init nuc910evb_init(void)
27{
28 nuc910_board_init();
29}
30
31MACHINE_START(W90P910EVB, "W90P910EVB")
32 /* Maintainer: Wan ZongShun */
33 .map_io = nuc910evb_map_io,
34 .init_irq = nuc900_init_irq,
35 .init_machine = nuc910evb_init,
36 .init_time = nuc900_timer_init,
37 .restart = nuc9xx_restart,
38MACHINE_END
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
deleted file mode 100644
index 62547308c344..000000000000
--- a/arch/arm/mach-w90x900/mach-nuc950evb.c
+++ /dev/null
@@ -1,42 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/mach-nuc950evb.c
4 *
5 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
6 *
7 * Copyright (C) 2008 Nuvoton technology corporation.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 *
11 * history:
12 * Wang Qiang (rurality.linux@gmail.com) add LCD support
13 */
14
15#include <linux/platform_device.h>
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <asm/mach-types.h>
19#include <mach/map.h>
20#include <linux/platform_data/video-nuc900fb.h>
21
22#include "nuc950.h"
23
24static void __init nuc950evb_map_io(void)
25{
26 nuc950_map_io();
27 nuc950_init_clocks();
28}
29
30static void __init nuc950evb_init(void)
31{
32 nuc950_board_init();
33}
34
35MACHINE_START(W90P950EVB, "W90P950EVB")
36 /* Maintainer: Wan ZongShun */
37 .map_io = nuc950evb_map_io,
38 .init_irq = nuc900_init_irq,
39 .init_machine = nuc950evb_init,
40 .init_time = nuc900_timer_init,
41 .restart = nuc9xx_restart,
42MACHINE_END
diff --git a/arch/arm/mach-w90x900/mach-nuc960evb.c b/arch/arm/mach-w90x900/mach-nuc960evb.c
deleted file mode 100644
index 35a53459d0d2..000000000000
--- a/arch/arm/mach-w90x900/mach-nuc960evb.c
+++ /dev/null
@@ -1,38 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/mach-nuc960evb.c
4 *
5 * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
6 *
7 * Copyright (C) 2008 Nuvoton technology corporation.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 */
11
12#include <linux/platform_device.h>
13#include <asm/mach/arch.h>
14#include <asm/mach/map.h>
15#include <asm/mach-types.h>
16#include <mach/map.h>
17
18#include "nuc960.h"
19
20static void __init nuc960evb_map_io(void)
21{
22 nuc960_map_io();
23 nuc960_init_clocks();
24}
25
26static void __init nuc960evb_init(void)
27{
28 nuc960_board_init();
29}
30
31MACHINE_START(W90N960EVB, "W90N960EVB")
32 /* Maintainer: Wan ZongShun */
33 .map_io = nuc960evb_map_io,
34 .init_irq = nuc900_init_irq,
35 .init_machine = nuc960evb_init,
36 .init_time = nuc900_timer_init,
37 .restart = nuc9xx_restart,
38MACHINE_END
diff --git a/arch/arm/mach-w90x900/mfp.c b/arch/arm/mach-w90x900/mfp.c
deleted file mode 100644
index 05f3779a3618..000000000000
--- a/arch/arm/mach-w90x900/mfp.c
+++ /dev/null
@@ -1,197 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/mfp.c
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/device.h>
13#include <linux/list.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/string.h>
17#include <linux/clk.h>
18#include <linux/mutex.h>
19#include <linux/io.h>
20
21#include <mach/hardware.h>
22
23#define REG_MFSEL (W90X900_VA_GCR + 0xC)
24
25#define GPSELF (0x01 << 1)
26#define GPSELC (0x03 << 2)
27#define GPSELD (0x0f << 4)
28
29#define GPSELEI0 (0x01 << 26)
30#define GPSELEI1 (0x01 << 27)
31
32#define GPIOG0TO1 (0x03 << 14)
33#define GPIOG2TO3 (0x03 << 16)
34#define GPIOG22TO23 (0x03 << 22)
35#define GPIOG18TO20 (0x07 << 18)
36
37#define ENSPI (0x0a << 14)
38#define ENI2C0 (0x01 << 14)
39#define ENI2C1 (0x01 << 16)
40#define ENAC97 (0x02 << 22)
41#define ENSD1 (0x02 << 18)
42#define ENSD0 (0x0a << 4)
43#define ENKPI (0x02 << 2)
44#define ENNAND (0x01 << 2)
45
46static DEFINE_MUTEX(mfp_mutex);
47
48void mfp_set_groupf(struct device *dev)
49{
50 unsigned long mfpen;
51 const char *dev_id;
52
53 BUG_ON(!dev);
54
55 mutex_lock(&mfp_mutex);
56
57 dev_id = dev_name(dev);
58
59 mfpen = __raw_readl(REG_MFSEL);
60
61 if (strcmp(dev_id, "nuc900-emc") == 0)
62 mfpen |= GPSELF;/*enable mac*/
63 else
64 mfpen &= ~GPSELF;/*GPIOF[9:0]*/
65
66 __raw_writel(mfpen, REG_MFSEL);
67
68 mutex_unlock(&mfp_mutex);
69}
70EXPORT_SYMBOL(mfp_set_groupf);
71
72void mfp_set_groupc(struct device *dev)
73{
74 unsigned long mfpen;
75 const char *dev_id;
76
77 BUG_ON(!dev);
78
79 mutex_lock(&mfp_mutex);
80
81 dev_id = dev_name(dev);
82
83 mfpen = __raw_readl(REG_MFSEL);
84
85 if (strcmp(dev_id, "nuc900-lcd") == 0)
86 mfpen |= GPSELC;/*enable lcd*/
87 else if (strcmp(dev_id, "nuc900-kpi") == 0) {
88 mfpen &= (~GPSELC);/*enable kpi*/
89 mfpen |= ENKPI;
90 } else if (strcmp(dev_id, "nuc900-nand") == 0) {
91 mfpen &= (~GPSELC);/*enable nand*/
92 mfpen |= ENNAND;
93 } else
94 mfpen &= (~GPSELC);/*GPIOC[14:0]*/
95
96 __raw_writel(mfpen, REG_MFSEL);
97
98 mutex_unlock(&mfp_mutex);
99}
100EXPORT_SYMBOL(mfp_set_groupc);
101
102void mfp_set_groupi(struct device *dev)
103{
104 unsigned long mfpen;
105 const char *dev_id;
106
107 BUG_ON(!dev);
108
109 mutex_lock(&mfp_mutex);
110
111 dev_id = dev_name(dev);
112
113 mfpen = __raw_readl(REG_MFSEL);
114
115 mfpen &= ~GPSELEI1;/*default gpio16*/
116
117 if (strcmp(dev_id, "nuc900-wdog") == 0)
118 mfpen |= GPSELEI1;/*enable wdog*/
119 else if (strcmp(dev_id, "nuc900-atapi") == 0)
120 mfpen |= GPSELEI0;/*enable atapi*/
121 else if (strcmp(dev_id, "nuc900-keypad") == 0)
122 mfpen &= ~GPSELEI0;/*enable keypad*/
123
124 __raw_writel(mfpen, REG_MFSEL);
125
126 mutex_unlock(&mfp_mutex);
127}
128EXPORT_SYMBOL(mfp_set_groupi);
129
130void mfp_set_groupg(struct device *dev, const char *subname)
131{
132 unsigned long mfpen;
133 const char *dev_id;
134
135 BUG_ON((!dev) && (!subname));
136
137 mutex_lock(&mfp_mutex);
138
139 if (subname != NULL)
140 dev_id = subname;
141 else
142 dev_id = dev_name(dev);
143
144 mfpen = __raw_readl(REG_MFSEL);
145
146 if (strcmp(dev_id, "nuc900-spi") == 0) {
147 mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);
148 mfpen |= ENSPI;/*enable spi*/
149 } else if (strcmp(dev_id, "nuc900-i2c0") == 0) {
150 mfpen &= ~(GPIOG0TO1);
151 mfpen |= ENI2C0;/*enable i2c0*/
152 } else if (strcmp(dev_id, "nuc900-i2c1") == 0) {
153 mfpen &= ~(GPIOG2TO3);
154 mfpen |= ENI2C1;/*enable i2c1*/
155 } else if (strcmp(dev_id, "nuc900-ac97") == 0) {
156 mfpen &= ~(GPIOG22TO23);
157 mfpen |= ENAC97;/*enable AC97*/
158 } else if (strcmp(dev_id, "nuc900-mmc-port1") == 0) {
159 mfpen &= ~(GPIOG18TO20);
160 mfpen |= (ENSD1 | 0x01);/*enable sd1*/
161 } else {
162 mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/
163 }
164
165 __raw_writel(mfpen, REG_MFSEL);
166
167 mutex_unlock(&mfp_mutex);
168}
169EXPORT_SYMBOL(mfp_set_groupg);
170
171void mfp_set_groupd(struct device *dev, const char *subname)
172{
173 unsigned long mfpen;
174 const char *dev_id;
175
176 BUG_ON((!dev) && (!subname));
177
178 mutex_lock(&mfp_mutex);
179
180 if (subname != NULL)
181 dev_id = subname;
182 else
183 dev_id = dev_name(dev);
184
185 mfpen = __raw_readl(REG_MFSEL);
186
187 if (strcmp(dev_id, "nuc900-mmc-port0") == 0) {
188 mfpen &= ~GPSELD;/*enable sd0*/
189 mfpen |= ENSD0;
190 } else
191 mfpen &= (~GPSELD);
192
193 __raw_writel(mfpen, REG_MFSEL);
194
195 mutex_unlock(&mfp_mutex);
196}
197EXPORT_SYMBOL(mfp_set_groupd);
diff --git a/arch/arm/mach-w90x900/nuc910.c b/arch/arm/mach-w90x900/nuc910.c
deleted file mode 100644
index 45ae8285bfc9..000000000000
--- a/arch/arm/mach-w90x900/nuc910.c
+++ /dev/null
@@ -1,58 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/nuc910.c
4 *
5 * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
6 *
7 * Copyright (c) 2009 Nuvoton corporation.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 *
11 * NUC910 cpu support
12 */
13
14#include <linux/platform_device.h>
15#include <asm/mach/map.h>
16#include <mach/hardware.h>
17#include "cpu.h"
18#include "clock.h"
19
20/* define specific CPU platform device */
21
22static struct platform_device *nuc910_dev[] __initdata = {
23 &nuc900_device_ts,
24 &nuc900_device_rtc,
25 &nuc900_device_lcd,
26 &nuc900_device_kpi,
27};
28
29/* define specific CPU platform io map */
30
31static struct map_desc nuc910evb_iodesc[] __initdata = {
32 IODESC_ENT(USBEHCIHOST),
33 IODESC_ENT(USBOHCIHOST),
34 IODESC_ENT(KPI),
35 IODESC_ENT(USBDEV),
36 IODESC_ENT(ADC),
37};
38
39/*Init NUC910 evb io*/
40
41void __init nuc910_map_io(void)
42{
43 nuc900_map_io(nuc910evb_iodesc, ARRAY_SIZE(nuc910evb_iodesc));
44}
45
46/*Init NUC910 clock*/
47
48void __init nuc910_init_clocks(void)
49{
50 nuc900_init_clocks();
51}
52
53/*Init NUC910 board info*/
54
55void __init nuc910_board_init(void)
56{
57 nuc900_board_init(nuc910_dev, ARRAY_SIZE(nuc910_dev));
58}
diff --git a/arch/arm/mach-w90x900/nuc910.h b/arch/arm/mach-w90x900/nuc910.h
deleted file mode 100644
index 53be3323736f..000000000000
--- a/arch/arm/mach-w90x900/nuc910.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/nuc910.h
4 *
5 * Copyright (c) 2008 Nuvoton corporation
6 *
7 * Header file for NUC900 CPU support
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 */
11#include "nuc9xx.h"
12
13/* extern file from nuc910.c */
14
15extern void nuc910_board_init(void);
16extern void nuc910_init_clocks(void);
17extern void nuc910_map_io(void);
diff --git a/arch/arm/mach-w90x900/nuc950.c b/arch/arm/mach-w90x900/nuc950.c
deleted file mode 100644
index 3be114249cd8..000000000000
--- a/arch/arm/mach-w90x900/nuc950.c
+++ /dev/null
@@ -1,52 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/nuc950.c
4 *
5 * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
6 *
7 * Copyright (c) 2008 Nuvoton technology corporation.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 *
11 * NUC950 cpu support
12 */
13
14#include <linux/platform_device.h>
15#include <asm/mach/map.h>
16#include <mach/hardware.h>
17
18#include "cpu.h"
19
20/* define specific CPU platform device */
21
22static struct platform_device *nuc950_dev[] __initdata = {
23 &nuc900_device_kpi,
24 &nuc900_device_fmi,
25 &nuc900_device_lcd,
26};
27
28/* define specific CPU platform io map */
29
30static struct map_desc nuc950evb_iodesc[] __initdata = {
31};
32
33/*Init NUC950 evb io*/
34
35void __init nuc950_map_io(void)
36{
37 nuc900_map_io(nuc950evb_iodesc, ARRAY_SIZE(nuc950evb_iodesc));
38}
39
40/*Init NUC950 clock*/
41
42void __init nuc950_init_clocks(void)
43{
44 nuc900_init_clocks();
45}
46
47/*Init NUC950 board info*/
48
49void __init nuc950_board_init(void)
50{
51 nuc900_board_init(nuc950_dev, ARRAY_SIZE(nuc950_dev));
52}
diff --git a/arch/arm/mach-w90x900/nuc950.h b/arch/arm/mach-w90x900/nuc950.h
deleted file mode 100644
index 23cff81ea630..000000000000
--- a/arch/arm/mach-w90x900/nuc950.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/nuc950.h
4 *
5 * Copyright (c) 2008 Nuvoton corporation
6 *
7 * Header file for NUC900 CPU support
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 */
11#include "nuc9xx.h"
12
13/* extern file from nuc950.c */
14
15extern void nuc950_board_init(void);
16extern void nuc950_init_clocks(void);
17extern void nuc950_map_io(void);
diff --git a/arch/arm/mach-w90x900/nuc960.c b/arch/arm/mach-w90x900/nuc960.c
deleted file mode 100644
index 8a27d74b975e..000000000000
--- a/arch/arm/mach-w90x900/nuc960.c
+++ /dev/null
@@ -1,50 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/arch/arm/mach-w90x900/nuc960.c
4 *
5 * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
6 *
7 * Copyright (c) 2008 Nuvoton technology corporation.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 *
11 * NUC960 cpu support
12 */
13
14#include <linux/platform_device.h>
15#include <asm/mach/map.h>
16#include <mach/hardware.h>
17#include "cpu.h"
18
19/* define specific CPU platform device */
20
21static struct platform_device *nuc960_dev[] __initdata = {
22 &nuc900_device_kpi,
23 &nuc900_device_fmi,
24};
25
26/* define specific CPU platform io map */
27
28static struct map_desc nuc960evb_iodesc[] __initdata = {
29};
30
31/*Init NUC960 evb io*/
32
33void __init nuc960_map_io(void)
34{
35 nuc900_map_io(nuc960evb_iodesc, ARRAY_SIZE(nuc960evb_iodesc));
36}
37
38/*Init NUC960 clock*/
39
40void __init nuc960_init_clocks(void)
41{
42 nuc900_init_clocks();
43}
44
45/*Init NUC960 board info*/
46
47void __init nuc960_board_init(void)
48{
49 nuc900_board_init(nuc960_dev, ARRAY_SIZE(nuc960_dev));
50}
diff --git a/arch/arm/mach-w90x900/nuc960.h b/arch/arm/mach-w90x900/nuc960.h
deleted file mode 100644
index 88bb13c971dc..000000000000
--- a/arch/arm/mach-w90x900/nuc960.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/nuc960.h
4 *
5 * Copyright (c) 2008 Nuvoton corporation
6 *
7 * Header file for NUC900 CPU support
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 */
11#include "nuc9xx.h"
12
13/* extern file from nuc960.c */
14
15extern void nuc960_board_init(void);
16extern void nuc960_init_clocks(void);
17extern void nuc960_map_io(void);
diff --git a/arch/arm/mach-w90x900/nuc9xx.h b/arch/arm/mach-w90x900/nuc9xx.h
deleted file mode 100644
index 21f6f9c304e8..000000000000
--- a/arch/arm/mach-w90x900/nuc9xx.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/nuc9xx.h
4 *
5 * Copied from nuc910.h, which had:
6 *
7 * Copyright (c) 2008 Nuvoton corporation
8 *
9 * Header file for NUC900 CPU support
10 *
11 * Wan ZongShun <mcuos.com@gmail.com>
12 */
13
14#include <linux/reboot.h>
15
16struct map_desc;
17
18/* core initialisation functions */
19
20extern void nuc900_init_irq(void);
21extern void nuc900_timer_init(void);
22extern void nuc9xx_restart(enum reboot_mode, const char *);
diff --git a/arch/arm/mach-w90x900/regs-ebi.h b/arch/arm/mach-w90x900/regs-ebi.h
deleted file mode 100644
index 3fb22702cfc0..000000000000
--- a/arch/arm/mach-w90x900/regs-ebi.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-ebi.h
4 *
5 * Copyright (c) 2009 Nuvoton technology corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#ifndef __ASM_ARCH_REGS_EBI_H
11#define __ASM_ARCH_REGS_EBI_H
12
13/* EBI Control Registers */
14
15#define EBI_BA W90X900_VA_EBI
16#define REG_EBICON (EBI_BA + 0x00)
17#define REG_ROMCON (EBI_BA + 0x04)
18#define REG_SDCONF0 (EBI_BA + 0x08)
19#define REG_SDCONF1 (EBI_BA + 0x0C)
20#define REG_SDTIME0 (EBI_BA + 0x10)
21#define REG_SDTIME1 (EBI_BA + 0x14)
22#define REG_EXT0CON (EBI_BA + 0x18)
23#define REG_EXT1CON (EBI_BA + 0x1C)
24#define REG_EXT2CON (EBI_BA + 0x20)
25#define REG_EXT3CON (EBI_BA + 0x24)
26#define REG_EXT4CON (EBI_BA + 0x28)
27#define REG_CKSKEW (EBI_BA + 0x2C)
28
29#endif /* __ASM_ARCH_REGS_EBI_H */
diff --git a/arch/arm/mach-w90x900/regs-gcr.h b/arch/arm/mach-w90x900/regs-gcr.h
deleted file mode 100644
index caf1090ecad8..000000000000
--- a/arch/arm/mach-w90x900/regs-gcr.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-gcr.h
4 *
5 * Copyright (c) 2010 Nuvoton technology corporation
6 * All rights reserved.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 */
10
11#ifndef __ASM_ARCH_REGS_GCR_H
12#define __ASM_ARCH_REGS_GCR_H
13
14/* Global control registers */
15
16#define GCR_BA W90X900_VA_GCR
17#define REG_PDID (GCR_BA+0x000)
18#define REG_PWRON (GCR_BA+0x004)
19#define REG_ARBCON (GCR_BA+0x008)
20#define REG_MFSEL (GCR_BA+0x00C)
21#define REG_EBIDPE (GCR_BA+0x010)
22#define REG_LCDDPE (GCR_BA+0x014)
23#define REG_GPIOCPE (GCR_BA+0x018)
24#define REG_GPIODPE (GCR_BA+0x01C)
25#define REG_GPIOEPE (GCR_BA+0x020)
26#define REG_GPIOFPE (GCR_BA+0x024)
27#define REG_GPIOGPE (GCR_BA+0x028)
28#define REG_GPIOHPE (GCR_BA+0x02C)
29#define REG_GPIOIPE (GCR_BA+0x030)
30#define REG_GTMP1 (GCR_BA+0x034)
31#define REG_GTMP2 (GCR_BA+0x038)
32#define REG_GTMP3 (GCR_BA+0x03C)
33
34#endif /* __ASM_ARCH_REGS_GCR_H */
diff --git a/arch/arm/mach-w90x900/regs-timer.h b/arch/arm/mach-w90x900/regs-timer.h
deleted file mode 100644
index d12807fd1e3e..000000000000
--- a/arch/arm/mach-w90x900/regs-timer.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-timer.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation
6 * All rights reserved.
7 *
8 * Wan ZongShun <mcuos.com@gmail.com>
9 *
10 * Based on arch/arm/mach-s3c2410/include/mach/regs-timer.h
11 */
12
13#ifndef __ASM_ARCH_REGS_TIMER_H
14#define __ASM_ARCH_REGS_TIMER_H
15
16/* Timer Registers */
17
18#define TMR_BA W90X900_VA_TIMER
19#define REG_TCSR0 (TMR_BA+0x00)
20#define REG_TCSR1 (TMR_BA+0x04)
21#define REG_TICR0 (TMR_BA+0x08)
22#define REG_TICR1 (TMR_BA+0x0C)
23#define REG_TDR0 (TMR_BA+0x10)
24#define REG_TDR1 (TMR_BA+0x14)
25#define REG_TISR (TMR_BA+0x18)
26#define REG_WTCR (TMR_BA+0x1C)
27#define REG_TCSR2 (TMR_BA+0x20)
28#define REG_TCSR3 (TMR_BA+0x24)
29#define REG_TICR2 (TMR_BA+0x28)
30#define REG_TICR3 (TMR_BA+0x2C)
31#define REG_TDR2 (TMR_BA+0x30)
32#define REG_TDR3 (TMR_BA+0x34)
33#define REG_TCSR4 (TMR_BA+0x40)
34#define REG_TICR4 (TMR_BA+0x48)
35#define REG_TDR4 (TMR_BA+0x50)
36
37#endif /* __ASM_ARCH_REGS_TIMER_H */
diff --git a/arch/arm/mach-w90x900/regs-usb.h b/arch/arm/mach-w90x900/regs-usb.h
deleted file mode 100644
index 98046c811bf7..000000000000
--- a/arch/arm/mach-w90x900/regs-usb.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * arch/arm/mach-w90x900/include/mach/regs-usb.h
4 *
5 * Copyright (c) 2008 Nuvoton technology corporation.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 */
9
10#ifndef __ASM_ARCH_REGS_USB_H
11#define __ASM_ARCH_REGS_USB_H
12
13/* usb Control Registers */
14#define USBH_BA W90X900_VA_USBEHCIHOST
15#define USBD_BA W90X900_VA_USBDEV
16#define USBO_BA W90X900_VA_USBOHCIHOST
17
18/* USB Host Control Registers */
19#define REG_UPSCR0 (USBH_BA+0x064)
20#define REG_UPSCR1 (USBH_BA+0x068)
21#define REG_USBPCR0 (USBH_BA+0x0C4)
22#define REG_USBPCR1 (USBH_BA+0x0C8)
23
24/* USBH OHCI Control Registers */
25#define REG_OpModEn (USBO_BA+0x204)
26/*This bit controls the polarity of over
27*current flag from external power IC.
28*/
29#define OCALow 0x08
30
31#endif /* __ASM_ARCH_REGS_USB_H */
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
deleted file mode 100644
index dd20fab9a960..000000000000
--- a/arch/arm/mach-w90x900/time.c
+++ /dev/null
@@ -1,168 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * linux/arch/arm/mach-w90x900/time.c
4 *
5 * Based on linux/arch/arm/plat-s3c24xx/time.c by Ben Dooks
6 *
7 * Copyright (c) 2009 Nuvoton technology corporation
8 * All rights reserved.
9 *
10 * Wan ZongShun <mcuos.com@gmail.com>
11 */
12
13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/init.h>
16#include <linux/interrupt.h>
17#include <linux/err.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20#include <linux/leds.h>
21#include <linux/clocksource.h>
22#include <linux/clockchips.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/irq.h>
26#include <asm/mach/time.h>
27
28#include <mach/map.h>
29#include "regs-timer.h"
30
31#include "nuc9xx.h"
32
33#define RESETINT 0x1f
34#define PERIOD (0x01 << 27)
35#define ONESHOT (0x00 << 27)
36#define COUNTEN (0x01 << 30)
37#define INTEN (0x01 << 29)
38
39#define TICKS_PER_SEC 100
40#define PRESCALE 0x63 /* Divider = prescale + 1 */
41
42#define TDR_SHIFT 24
43
44static unsigned int timer0_load;
45
46static int nuc900_clockevent_shutdown(struct clock_event_device *evt)
47{
48 unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
49
50 __raw_writel(val, REG_TCSR0);
51 return 0;
52}
53
54static int nuc900_clockevent_set_oneshot(struct clock_event_device *evt)
55{
56 unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
57
58 val |= (ONESHOT | COUNTEN | INTEN | PRESCALE);
59
60 __raw_writel(val, REG_TCSR0);
61 return 0;
62}
63
64static int nuc900_clockevent_set_periodic(struct clock_event_device *evt)
65{
66 unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
67
68 __raw_writel(timer0_load, REG_TICR0);
69 val |= (PERIOD | COUNTEN | INTEN | PRESCALE);
70 __raw_writel(val, REG_TCSR0);
71 return 0;
72}
73
74static int nuc900_clockevent_setnextevent(unsigned long evt,
75 struct clock_event_device *clk)
76{
77 unsigned int val;
78
79 __raw_writel(evt, REG_TICR0);
80
81 val = __raw_readl(REG_TCSR0);
82 val |= (COUNTEN | INTEN | PRESCALE);
83 __raw_writel(val, REG_TCSR0);
84
85 return 0;
86}
87
88static struct clock_event_device nuc900_clockevent_device = {
89 .name = "nuc900-timer0",
90 .features = CLOCK_EVT_FEAT_PERIODIC |
91 CLOCK_EVT_FEAT_ONESHOT,
92 .set_state_shutdown = nuc900_clockevent_shutdown,
93 .set_state_periodic = nuc900_clockevent_set_periodic,
94 .set_state_oneshot = nuc900_clockevent_set_oneshot,
95 .tick_resume = nuc900_clockevent_shutdown,
96 .set_next_event = nuc900_clockevent_setnextevent,
97 .rating = 300,
98};
99
100/*IRQ handler for the timer*/
101
102static irqreturn_t nuc900_timer0_interrupt(int irq, void *dev_id)
103{
104 struct clock_event_device *evt = &nuc900_clockevent_device;
105
106 __raw_writel(0x01, REG_TISR); /* clear TIF0 */
107
108 evt->event_handler(evt);
109 return IRQ_HANDLED;
110}
111
112static struct irqaction nuc900_timer0_irq = {
113 .name = "nuc900-timer0",
114 .flags = IRQF_TIMER | IRQF_IRQPOLL,
115 .handler = nuc900_timer0_interrupt,
116};
117
118static void __init nuc900_clockevents_init(void)
119{
120 unsigned int rate;
121 struct clk *clk = clk_get(NULL, "timer0");
122
123 BUG_ON(IS_ERR(clk));
124
125 __raw_writel(0x00, REG_TCSR0);
126
127 clk_enable(clk);
128 rate = clk_get_rate(clk) / (PRESCALE + 1);
129
130 timer0_load = (rate / TICKS_PER_SEC);
131
132 __raw_writel(RESETINT, REG_TISR);
133 setup_irq(IRQ_TIMER0, &nuc900_timer0_irq);
134
135 nuc900_clockevent_device.cpumask = cpumask_of(0);
136
137 clockevents_config_and_register(&nuc900_clockevent_device, rate,
138 0xf, 0xffffffff);
139}
140
141static void __init nuc900_clocksource_init(void)
142{
143 unsigned int val;
144 unsigned int rate;
145 struct clk *clk = clk_get(NULL, "timer1");
146
147 BUG_ON(IS_ERR(clk));
148
149 __raw_writel(0x00, REG_TCSR1);
150
151 clk_enable(clk);
152 rate = clk_get_rate(clk) / (PRESCALE + 1);
153
154 __raw_writel(0xffffffff, REG_TICR1);
155
156 val = __raw_readl(REG_TCSR1);
157 val |= (COUNTEN | PERIOD | PRESCALE);
158 __raw_writel(val, REG_TCSR1);
159
160 clocksource_mmio_init(REG_TDR1, "nuc900-timer1", rate, 200,
161 TDR_SHIFT, clocksource_mmio_readl_down);
162}
163
164void __init nuc900_timer_init(void)
165{
166 nuc900_clocksource_init();
167 nuc900_clockevents_init();
168}
diff --git a/arch/arm/mach-zynq/headsmp.S b/arch/arm/mach-zynq/headsmp.S
index ab85003cf9ad..3449e0d1f990 100644
--- a/arch/arm/mach-zynq/headsmp.S
+++ b/arch/arm/mach-zynq/headsmp.S
@@ -7,6 +7,8 @@
7#include <linux/init.h> 7#include <linux/init.h>
8#include <asm/assembler.h> 8#include <asm/assembler.h>
9 9
10 .arm
11
10ENTRY(zynq_secondary_trampoline) 12ENTRY(zynq_secondary_trampoline)
11ARM_BE8(setend be) @ ensure we are in BE8 mode 13ARM_BE8(setend be) @ ensure we are in BE8 mode
12 ldr r0, zynq_secondary_trampoline_jump 14 ldr r0, zynq_secondary_trampoline_jump
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index a7cfe07156f4..a10085be9073 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -57,7 +57,7 @@ int zynq_cpun_start(u32 address, int cpu)
57 * 0x4: Jump by mov instruction 57 * 0x4: Jump by mov instruction
58 * 0x8: Jumping address 58 * 0x8: Jumping address
59 */ 59 */
60 memcpy((__force void *)zero, &zynq_secondary_trampoline, 60 memcpy_toio(zero, &zynq_secondary_trampoline,
61 trampoline_size); 61 trampoline_size);
62 writel(address, zero + trampoline_size); 62 writel(address, zero + trampoline_size);
63 63
@@ -81,7 +81,7 @@ EXPORT_SYMBOL(zynq_cpun_start);
81 81
82static int zynq_boot_secondary(unsigned int cpu, struct task_struct *idle) 82static int zynq_boot_secondary(unsigned int cpu, struct task_struct *idle)
83{ 83{
84 return zynq_cpun_start(__pa_symbol(secondary_startup), cpu); 84 return zynq_cpun_start(__pa_symbol(secondary_startup_arm), cpu);
85} 85}
86 86
87/* 87/*
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index c1222c0e9fd3..0ab3a86b1f52 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -106,7 +106,7 @@ config CPU_ARM922T
106 help 106 help
107 The ARM922T is a version of the ARM920T, but with smaller 107 The ARM922T is a version of the ARM920T, but with smaller
108 instruction and data caches. It is used in Altera's 108 instruction and data caches. It is used in Altera's
109 Excalibur XA device family and Micrel's KS8695 Centaur. 109 Excalibur XA device family and the ARM Integrator.
110 110
111 Say Y if you want support for the ARM922T processor. 111 Say Y if you want support for the ARM922T processor.
112 Otherwise, say N. 112 Otherwise, say N.
diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c
index 61d834157bc0..382e1c2855e8 100644
--- a/arch/arm/mm/copypage-xscale.c
+++ b/arch/arm/mm/copypage-xscale.c
@@ -42,6 +42,7 @@ static void mc_copy_user_page(void *from, void *to)
42 * when prefetching destination as well. (NP) 42 * when prefetching destination as well. (NP)
43 */ 43 */
44 asm volatile ("\ 44 asm volatile ("\
45.arch xscale \n\
45 pld [%0, #0] \n\ 46 pld [%0, #0] \n\
46 pld [%0, #32] \n\ 47 pld [%0, #32] \n\
47 pld [%1, #0] \n\ 48 pld [%1, #0] \n\
@@ -106,8 +107,9 @@ void
106xscale_mc_clear_user_highpage(struct page *page, unsigned long vaddr) 107xscale_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
107{ 108{
108 void *ptr, *kaddr = kmap_atomic(page); 109 void *ptr, *kaddr = kmap_atomic(page);
109 asm volatile( 110 asm volatile("\
110 "mov r1, %2 \n\ 111.arch xscale \n\
112 mov r1, %2 \n\
111 mov r2, #0 \n\ 113 mov r2, #0 \n\
112 mov r3, #0 \n\ 114 mov r3, #0 \n\
1131: mov ip, %0 \n\ 1151: mov ip, %0 \n\
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile
deleted file mode 100644
index 4d839a3cf284..000000000000
--- a/arch/arm/plat-iop/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for the linux kernel.
4#
5
6# IOP32X
7obj-$(CONFIG_ARCH_IOP32X) += i2c.o
8obj-$(CONFIG_ARCH_IOP32X) += pci.o
9obj-$(CONFIG_ARCH_IOP32X) += setup.o
10obj-$(CONFIG_ARCH_IOP32X) += time.o
11obj-$(CONFIG_ARCH_IOP32X) += cp6.o
12obj-$(CONFIG_ARCH_IOP32X) += adma.o
13obj-$(CONFIG_ARCH_IOP32X) += pmu.o
14obj-$(CONFIG_ARCH_IOP32X) += restart.o
15
16# IOP33X
17obj-$(CONFIG_ARCH_IOP33X) += i2c.o
18obj-$(CONFIG_ARCH_IOP33X) += pci.o
19obj-$(CONFIG_ARCH_IOP33X) += setup.o
20obj-$(CONFIG_ARCH_IOP33X) += time.o
21obj-$(CONFIG_ARCH_IOP33X) += cp6.o
22obj-$(CONFIG_ARCH_IOP33X) += adma.o
23obj-$(CONFIG_ARCH_IOP33X) += pmu.o
24obj-$(CONFIG_ARCH_IOP33X) += restart.o
25
26# IOP13XX
27obj-$(CONFIG_ARCH_IOP13XX) += cp6.o
28obj-$(CONFIG_ARCH_IOP13XX) += time.o
diff --git a/arch/arm/plat-samsung/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h
index 51e721f5e491..c0bfceb88340 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-core.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-core.h
@@ -12,6 +12,7 @@
12 12
13/* Bring in machine-local definitions, especially S3C_GPIO_END */ 13/* Bring in machine-local definitions, especially S3C_GPIO_END */
14#include <mach/gpio-samsung.h> 14#include <mach/gpio-samsung.h>
15#include <linux/gpio/driver.h>
15 16
16#define GPIOCON_OFF (0x00) 17#define GPIOCON_OFF (0x00)
17#define GPIODAT_OFF (0x04) 18#define GPIODAT_OFF (0x04)
diff --git a/arch/arm/plat-samsung/include/plat/usb-phy.h b/arch/arm/plat-samsung/include/plat/usb-phy.h
index 6d0c788beb9d..94da89ecbd3b 100644
--- a/arch/arm/plat-samsung/include/plat/usb-phy.h
+++ b/arch/arm/plat-samsung/include/plat/usb-phy.h
@@ -7,8 +7,6 @@
7#ifndef __PLAT_SAMSUNG_USB_PHY_H 7#ifndef __PLAT_SAMSUNG_USB_PHY_H
8#define __PLAT_SAMSUNG_USB_PHY_H __FILE__ 8#define __PLAT_SAMSUNG_USB_PHY_H __FILE__
9 9
10#include <linux/usb/samsung_usb_phy.h>
11
12extern int s5p_usb_phy_init(struct platform_device *pdev, int type); 10extern int s5p_usb_phy_init(struct platform_device *pdev, int type);
13extern int s5p_usb_phy_exit(struct platform_device *pdev, int type); 11extern int s5p_usb_phy_exit(struct platform_device *pdev, int type);
14 12
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 4778c775de1b..16d761475a86 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -77,6 +77,7 @@ config ARCH_BRCMSTB
77config ARCH_EXYNOS 77config ARCH_EXYNOS
78 bool "ARMv8 based Samsung Exynos SoC family" 78 bool "ARMv8 based Samsung Exynos SoC family"
79 select COMMON_CLK_SAMSUNG 79 select COMMON_CLK_SAMSUNG
80 select EXYNOS_CHIPID
80 select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS 81 select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
81 select EXYNOS_PMU 82 select EXYNOS_PMU
82 select HAVE_S3C2410_WATCHDOG if WATCHDOG 83 select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@ -173,6 +174,7 @@ config ARCH_MXC
173 select PM 174 select PM
174 select PM_GENERIC_DOMAINS 175 select PM_GENERIC_DOMAINS
175 select SOC_BUS 176 select SOC_BUS
177 select TIMER_IMX_SYS_CTR
176 help 178 help
177 This enables support for the ARMv8 based SoCs in the 179 This enables support for the ARMv8 based SoCs in the
178 NXP i.MX family. 180 NXP i.MX family.
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 03fa0c58cef3..413efef5fbb6 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -294,8 +294,8 @@ config INTEL_IOATDMA
294 If unsure, say N. 294 If unsure, say N.
295 295
296config INTEL_IOP_ADMA 296config INTEL_IOP_ADMA
297 tristate "Intel IOP ADMA support" 297 tristate "Intel IOP32x ADMA support"
298 depends on ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX 298 depends on ARCH_IOP32X
299 select DMA_ENGINE 299 select DMA_ENGINE
300 select ASYNC_TX_ENABLE_CHANNEL_SWITCH 300 select ASYNC_TX_ENABLE_CHANNEL_SWITCH
301 help 301 help
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index c6c0143670d9..03f4a588cf7f 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -16,13 +16,13 @@
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/prefetch.h>
19#include <linux/memory.h> 20#include <linux/memory.h>
20#include <linux/ioport.h> 21#include <linux/ioport.h>
21#include <linux/raid/pq.h> 22#include <linux/raid/pq.h>
22#include <linux/slab.h> 23#include <linux/slab.h>
23 24
24#include <mach/adma.h> 25#include "iop-adma.h"
25
26#include "dmaengine.h" 26#include "dmaengine.h"
27 27
28#define to_iop_adma_chan(chan) container_of(chan, struct iop_adma_chan, common) 28#define to_iop_adma_chan(chan) container_of(chan, struct iop_adma_chan, common)
@@ -116,9 +116,9 @@ static void __iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan)
116 list_for_each_entry_safe(iter, _iter, &iop_chan->chain, 116 list_for_each_entry_safe(iter, _iter, &iop_chan->chain,
117 chain_node) { 117 chain_node) {
118 pr_debug("\tcookie: %d slot: %d busy: %d " 118 pr_debug("\tcookie: %d slot: %d busy: %d "
119 "this_desc: %#x next_desc: %#x ack: %d\n", 119 "this_desc: %#x next_desc: %#llx ack: %d\n",
120 iter->async_tx.cookie, iter->idx, busy, 120 iter->async_tx.cookie, iter->idx, busy,
121 iter->async_tx.phys, iop_desc_get_next_desc(iter), 121 iter->async_tx.phys, (u64)iop_desc_get_next_desc(iter),
122 async_tx_test_ack(&iter->async_tx)); 122 async_tx_test_ack(&iter->async_tx));
123 prefetch(_iter); 123 prefetch(_iter);
124 prefetch(&_iter->async_tx); 124 prefetch(&_iter->async_tx);
@@ -306,9 +306,9 @@ retry:
306 int i; 306 int i;
307 dev_dbg(iop_chan->device->common.dev, 307 dev_dbg(iop_chan->device->common.dev,
308 "allocated slot: %d " 308 "allocated slot: %d "
309 "(desc %p phys: %#x) slots_per_op %d\n", 309 "(desc %p phys: %#llx) slots_per_op %d\n",
310 iter->idx, iter->hw_desc, 310 iter->idx, iter->hw_desc,
311 iter->async_tx.phys, slots_per_op); 311 (u64)iter->async_tx.phys, slots_per_op);
312 312
313 /* pre-ack all but the last descriptor */ 313 /* pre-ack all but the last descriptor */
314 if (num_slots != slots_per_op) 314 if (num_slots != slots_per_op)
@@ -516,7 +516,7 @@ iop_adma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dma_dest,
516 return NULL; 516 return NULL;
517 BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT); 517 BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT);
518 518
519 dev_dbg(iop_chan->device->common.dev, "%s len: %u\n", 519 dev_dbg(iop_chan->device->common.dev, "%s len: %zu\n",
520 __func__, len); 520 __func__, len);
521 521
522 spin_lock_bh(&iop_chan->lock); 522 spin_lock_bh(&iop_chan->lock);
@@ -549,7 +549,7 @@ iop_adma_prep_dma_xor(struct dma_chan *chan, dma_addr_t dma_dest,
549 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); 549 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT);
550 550
551 dev_dbg(iop_chan->device->common.dev, 551 dev_dbg(iop_chan->device->common.dev,
552 "%s src_cnt: %d len: %u flags: %lx\n", 552 "%s src_cnt: %d len: %zu flags: %lx\n",
553 __func__, src_cnt, len, flags); 553 __func__, src_cnt, len, flags);
554 554
555 spin_lock_bh(&iop_chan->lock); 555 spin_lock_bh(&iop_chan->lock);
@@ -582,7 +582,7 @@ iop_adma_prep_dma_xor_val(struct dma_chan *chan, dma_addr_t *dma_src,
582 if (unlikely(!len)) 582 if (unlikely(!len))
583 return NULL; 583 return NULL;
584 584
585 dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", 585 dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n",
586 __func__, src_cnt, len); 586 __func__, src_cnt, len);
587 587
588 spin_lock_bh(&iop_chan->lock); 588 spin_lock_bh(&iop_chan->lock);
@@ -620,7 +620,7 @@ iop_adma_prep_dma_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
620 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); 620 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT);
621 621
622 dev_dbg(iop_chan->device->common.dev, 622 dev_dbg(iop_chan->device->common.dev,
623 "%s src_cnt: %d len: %u flags: %lx\n", 623 "%s src_cnt: %d len: %zu flags: %lx\n",
624 __func__, src_cnt, len, flags); 624 __func__, src_cnt, len, flags);
625 625
626 if (dmaf_p_disabled_continue(flags)) 626 if (dmaf_p_disabled_continue(flags))
@@ -683,7 +683,7 @@ iop_adma_prep_dma_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
683 return NULL; 683 return NULL;
684 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); 684 BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT);
685 685
686 dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", 686 dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n",
687 __func__, src_cnt, len); 687 __func__, src_cnt, len);
688 688
689 spin_lock_bh(&iop_chan->lock); 689 spin_lock_bh(&iop_chan->lock);
diff --git a/arch/arm/include/asm/hardware/iop3xx-adma.h b/drivers/dma/iop-adma.h
index 6d998df17efd..c499c9578f00 100644
--- a/arch/arm/include/asm/hardware/iop3xx-adma.h
+++ b/drivers/dma/iop-adma.h
@@ -6,8 +6,7 @@
6#define _ADMA_H 6#define _ADMA_H
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/io.h> 8#include <linux/io.h>
9#include <mach/hardware.h> 9#include <linux/platform_data/dma-iop32x.h>
10#include <asm/hardware/iop_adma.h>
11 10
12/* Memory copy units */ 11/* Memory copy units */
13#define DMA_CCR(chan) (chan->mmr_base + 0x0) 12#define DMA_CCR(chan) (chan->mmr_base + 0x0)
@@ -34,10 +33,6 @@
34#define AAU_EDCR1_IDX 17 33#define AAU_EDCR1_IDX 17
35#define AAU_EDCR2_IDX 26 34#define AAU_EDCR2_IDX 26
36 35
37#define DMA0_ID 0
38#define DMA1_ID 1
39#define AAU_ID 2
40
41struct iop3xx_aau_desc_ctrl { 36struct iop3xx_aau_desc_ctrl {
42 unsigned int int_en:1; 37 unsigned int int_en:1;
43 unsigned int blk1_cmd_ctrl:3; 38 unsigned int blk1_cmd_ctrl:3;
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index e193c76948c4..305b47ed4532 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -275,7 +275,7 @@ config GPIO_ICH
275 275
276config GPIO_IOP 276config GPIO_IOP
277 tristate "Intel IOP GPIO" 277 tristate "Intel IOP GPIO"
278 depends on ARCH_IOP32X || ARCH_IOP33X || COMPILE_TEST 278 depends on ARCH_IOP32X || COMPILE_TEST
279 select GPIO_GENERIC 279 select GPIO_GENERIC
280 help 280 help
281 Say yes here to support the GPIO functionality of a number of Intel 281 Say yes here to support the GPIO functionality of a number of Intel
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 09367fc014c3..f8c77edf70d0 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -684,7 +684,7 @@ config I2C_IMX_LPI2C
684 684
685config I2C_IOP3XX 685config I2C_IOP3XX
686 tristate "Intel IOPx3xx and IXP4xx on-chip I2C interface" 686 tristate "Intel IOPx3xx and IXP4xx on-chip I2C interface"
687 depends on ARCH_IOP32X || ARCH_IOP33X || ARCH_IXP4XX || ARCH_IOP13XX 687 depends on ARCH_IOP32X || ARCH_IXP4XX
688 help 688 help
689 Say Y here if you want to use the IIC bus controller on 689 Say Y here if you want to use the IIC bus controller on
690 the Intel IOPx3xx I/O Processors or IXP4xx Network Processors. 690 the Intel IOPx3xx I/O Processors or IXP4xx Network Processors.
diff --git a/drivers/net/ethernet/nxp/Kconfig b/drivers/net/ethernet/nxp/Kconfig
index 261f107e2be0..418afb84c84b 100644
--- a/drivers/net/ethernet/nxp/Kconfig
+++ b/drivers/net/ethernet/nxp/Kconfig
@@ -1,7 +1,7 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: GPL-2.0-only
2config LPC_ENET 2config LPC_ENET
3 tristate "NXP ethernet MAC on LPC devices" 3 tristate "NXP ethernet MAC on LPC devices"
4 depends on ARCH_LPC32XX 4 depends on ARCH_LPC32XX || COMPILE_TEST
5 select PHYLIB 5 select PHYLIB
6 help 6 help
7 Say Y or M here if you want to use the NXP ethernet MAC included on 7 Say Y or M here if you want to use the NXP ethernet MAC included on
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index f7e11f1b0426..141571e2ec11 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -14,14 +14,12 @@
14#include <linux/crc32.h> 14#include <linux/crc32.h>
15#include <linux/etherdevice.h> 15#include <linux/etherdevice.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/of.h>
17#include <linux/of_net.h> 18#include <linux/of_net.h>
18#include <linux/phy.h> 19#include <linux/phy.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/spinlock.h> 21#include <linux/spinlock.h>
21 22#include <linux/soc/nxp/lpc32xx-misc.h>
22#include <mach/board.h>
23#include <mach/hardware.h>
24#include <mach/platform.h>
25 23
26#define MODNAME "lpc-eth" 24#define MODNAME "lpc-eth"
27#define DRV_VERSION "1.00" 25#define DRV_VERSION "1.00"
@@ -1237,16 +1235,9 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
1237 dma_addr_t dma_handle; 1235 dma_addr_t dma_handle;
1238 struct resource *res; 1236 struct resource *res;
1239 int irq, ret; 1237 int irq, ret;
1240 u32 tmp;
1241 1238
1242 /* Setup network interface for RMII or MII mode */ 1239 /* Setup network interface for RMII or MII mode */
1243 tmp = __raw_readl(LPC32XX_CLKPWR_MACCLK_CTRL); 1240 lpc32xx_set_phy_interface_mode(lpc_phy_interface_mode(dev));
1244 tmp &= ~LPC32XX_CLKPWR_MACCTRL_PINS_MSK;
1245 if (lpc_phy_interface_mode(dev) == PHY_INTERFACE_MODE_MII)
1246 tmp |= LPC32XX_CLKPWR_MACCTRL_USE_MII_PINS;
1247 else
1248 tmp |= LPC32XX_CLKPWR_MACCTRL_USE_RMII_PINS;
1249 __raw_writel(tmp, LPC32XX_CLKPWR_MACCLK_CTRL);
1250 1241
1251 /* Get platform resources */ 1242 /* Get platform resources */
1252 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1243 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1311,19 +1302,18 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
1311 /* Get size of DMA buffers/descriptors region */ 1302 /* Get size of DMA buffers/descriptors region */
1312 pldat->dma_buff_size = (ENET_TX_DESC + ENET_RX_DESC) * (ENET_MAXF_SIZE + 1303 pldat->dma_buff_size = (ENET_TX_DESC + ENET_RX_DESC) * (ENET_MAXF_SIZE +
1313 sizeof(struct txrx_desc_t) + sizeof(struct rx_status_t)); 1304 sizeof(struct txrx_desc_t) + sizeof(struct rx_status_t));
1314 pldat->dma_buff_base_v = 0;
1315 1305
1316 if (use_iram_for_net(dev)) { 1306 if (use_iram_for_net(dev)) {
1317 dma_handle = LPC32XX_IRAM_BASE; 1307 if (pldat->dma_buff_size >
1318 if (pldat->dma_buff_size <= lpc32xx_return_iram_size()) 1308 lpc32xx_return_iram(&pldat->dma_buff_base_v, &dma_handle)) {
1319 pldat->dma_buff_base_v = 1309 pldat->dma_buff_base_v = NULL;
1320 io_p2v(LPC32XX_IRAM_BASE); 1310 pldat->dma_buff_size = 0;
1321 else
1322 netdev_err(ndev, 1311 netdev_err(ndev,
1323 "IRAM not big enough for net buffers, using SDRAM instead.\n"); 1312 "IRAM not big enough for net buffers, using SDRAM instead.\n");
1313 }
1324 } 1314 }
1325 1315
1326 if (pldat->dma_buff_base_v == 0) { 1316 if (pldat->dma_buff_base_v == NULL) {
1327 ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); 1317 ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
1328 if (ret) 1318 if (ret)
1329 goto err_out_free_irq; 1319 goto err_out_free_irq;
@@ -1344,13 +1334,14 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
1344 pldat->dma_buff_base_p = dma_handle; 1334 pldat->dma_buff_base_p = dma_handle;
1345 1335
1346 netdev_dbg(ndev, "IO address space :%pR\n", res); 1336 netdev_dbg(ndev, "IO address space :%pR\n", res);
1347 netdev_dbg(ndev, "IO address size :%d\n", resource_size(res)); 1337 netdev_dbg(ndev, "IO address size :%zd\n",
1338 (size_t)resource_size(res));
1348 netdev_dbg(ndev, "IO address (mapped) :0x%p\n", 1339 netdev_dbg(ndev, "IO address (mapped) :0x%p\n",
1349 pldat->net_base); 1340 pldat->net_base);
1350 netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq); 1341 netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq);
1351 netdev_dbg(ndev, "DMA buffer size :%d\n", pldat->dma_buff_size); 1342 netdev_dbg(ndev, "DMA buffer size :%zd\n", pldat->dma_buff_size);
1352 netdev_dbg(ndev, "DMA buffer P address :0x%08x\n", 1343 netdev_dbg(ndev, "DMA buffer P address :%pad\n",
1353 pldat->dma_buff_base_p); 1344 &pldat->dma_buff_base_p);
1354 netdev_dbg(ndev, "DMA buffer V address :0x%p\n", 1345 netdev_dbg(ndev, "DMA buffer V address :0x%p\n",
1355 pldat->dma_buff_base_v); 1346 pldat->dma_buff_base_v);
1356 1347
@@ -1397,8 +1388,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
1397 if (ret) 1388 if (ret)
1398 goto err_out_unregister_netdev; 1389 goto err_out_unregister_netdev;
1399 1390
1400 netdev_info(ndev, "LPC mac at 0x%08x irq %d\n", 1391 netdev_info(ndev, "LPC mac at 0x%08lx irq %d\n",
1401 res->start, ndev->irq); 1392 (unsigned long)res->start, ndev->irq);
1402 1393
1403 device_init_wakeup(dev, 1); 1394 device_init_wakeup(dev, 1);
1404 device_set_wakeup_enable(dev, 0); 1395 device_set_wakeup_enable(dev, 0);
@@ -1409,7 +1400,7 @@ err_out_unregister_netdev:
1409 unregister_netdev(ndev); 1400 unregister_netdev(ndev);
1410err_out_dma_unmap: 1401err_out_dma_unmap:
1411 if (!use_iram_for_net(dev) || 1402 if (!use_iram_for_net(dev) ||
1412 pldat->dma_buff_size > lpc32xx_return_iram_size()) 1403 pldat->dma_buff_size > lpc32xx_return_iram(NULL, NULL))
1413 dma_free_coherent(dev, pldat->dma_buff_size, 1404 dma_free_coherent(dev, pldat->dma_buff_size,
1414 pldat->dma_buff_base_v, 1405 pldat->dma_buff_base_v,
1415 pldat->dma_buff_base_p); 1406 pldat->dma_buff_base_p);
@@ -1436,7 +1427,7 @@ static int lpc_eth_drv_remove(struct platform_device *pdev)
1436 unregister_netdev(ndev); 1427 unregister_netdev(ndev);
1437 1428
1438 if (!use_iram_for_net(&pldat->pdev->dev) || 1429 if (!use_iram_for_net(&pldat->pdev->dev) ||
1439 pldat->dma_buff_size > lpc32xx_return_iram_size()) 1430 pldat->dma_buff_size > lpc32xx_return_iram(NULL, NULL))
1440 dma_free_coherent(&pldat->pdev->dev, pldat->dma_buff_size, 1431 dma_free_coherent(&pldat->pdev->dev, pldat->dma_buff_size,
1441 pldat->dma_buff_base_v, 1432 pldat->dma_buff_base_v,
1442 pldat->dma_buff_base_p); 1433 pldat->dma_buff_base_p);
diff --git a/drivers/soc/ux500/ux500-soc-id.c b/drivers/soc/ux500/ux500-soc-id.c
index ea5fd2e5e340..d64feeb51a40 100644
--- a/drivers/soc/ux500/ux500-soc-id.c
+++ b/drivers/soc/ux500/ux500-soc-id.c
@@ -203,10 +203,13 @@ static int __init ux500_soc_device_init(void)
203 ux500_setup_id(); 203 ux500_setup_id();
204 204
205 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); 205 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
206 if (!soc_dev_attr) 206 if (!soc_dev_attr) {
207 of_node_put(backupram);
207 return -ENOMEM; 208 return -ENOMEM;
209 }
208 210
209 soc_info_populate(soc_dev_attr, backupram); 211 soc_info_populate(soc_dev_attr, backupram);
212 of_node_put(backupram);
210 213
211 soc_dev = soc_device_register(soc_dev_attr); 214 soc_dev = soc_device_register(soc_dev_attr);
212 if (IS_ERR(soc_dev)) { 215 if (IS_ERR(soc_dev)) {
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2f631501c75f..514169eb1859 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -739,7 +739,8 @@ config SERIAL_PNX8XXX_CONSOLE
739 739
740config SERIAL_HS_LPC32XX 740config SERIAL_HS_LPC32XX
741 tristate "LPC32XX high speed serial port support" 741 tristate "LPC32XX high speed serial port support"
742 depends on ARCH_LPC32XX && OF 742 depends on ARCH_LPC32XX || COMPILE_TEST
743 depends on OF
743 select SERIAL_CORE 744 select SERIAL_CORE
744 help 745 help
745 Support for the LPC32XX high speed serial ports (up to 900kbps). 746 Support for the LPC32XX high speed serial ports (up to 900kbps).
diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index f4e27d0ad947..d3843f722182 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -25,8 +25,8 @@
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/of.h> 27#include <linux/of.h>
28#include <mach/platform.h> 28#include <linux/sizes.h>
29#include <mach/hardware.h> 29#include <linux/soc/nxp/lpc32xx-misc.h>
30 30
31/* 31/*
32 * High Speed UART register offsets 32 * High Speed UART register offsets
@@ -81,6 +81,8 @@
81#define LPC32XX_HSU_TX_TL8B (0x2 << 0) 81#define LPC32XX_HSU_TX_TL8B (0x2 << 0)
82#define LPC32XX_HSU_TX_TL16B (0x3 << 0) 82#define LPC32XX_HSU_TX_TL16B (0x3 << 0)
83 83
84#define LPC32XX_MAIN_OSC_FREQ 13000000
85
84#define MODNAME "lpc32xx_hsuart" 86#define MODNAME "lpc32xx_hsuart"
85 87
86struct lpc32xx_hsuart_port { 88struct lpc32xx_hsuart_port {
@@ -151,8 +153,6 @@ static void lpc32xx_hsuart_console_write(struct console *co, const char *s,
151 local_irq_restore(flags); 153 local_irq_restore(flags);
152} 154}
153 155
154static void lpc32xx_loopback_set(resource_size_t mapbase, int state);
155
156static int __init lpc32xx_hsuart_console_setup(struct console *co, 156static int __init lpc32xx_hsuart_console_setup(struct console *co,
157 char *options) 157 char *options)
158{ 158{
@@ -439,35 +439,6 @@ static void serial_lpc32xx_break_ctl(struct uart_port *port,
439 spin_unlock_irqrestore(&port->lock, flags); 439 spin_unlock_irqrestore(&port->lock, flags);
440} 440}
441 441
442/* LPC3250 Errata HSUART.1: Hang workaround via loopback mode on inactivity */
443static void lpc32xx_loopback_set(resource_size_t mapbase, int state)
444{
445 int bit;
446 u32 tmp;
447
448 switch (mapbase) {
449 case LPC32XX_HS_UART1_BASE:
450 bit = 0;
451 break;
452 case LPC32XX_HS_UART2_BASE:
453 bit = 1;
454 break;
455 case LPC32XX_HS_UART7_BASE:
456 bit = 6;
457 break;
458 default:
459 WARN(1, "lpc32xx_hs: Warning: Unknown port at %08x\n", mapbase);
460 return;
461 }
462
463 tmp = readl(LPC32XX_UARTCTL_CLOOP);
464 if (state)
465 tmp |= (1 << bit);
466 else
467 tmp &= ~(1 << bit);
468 writel(tmp, LPC32XX_UARTCTL_CLOOP);
469}
470
471/* port->lock is not held. */ 442/* port->lock is not held. */
472static int serial_lpc32xx_startup(struct uart_port *port) 443static int serial_lpc32xx_startup(struct uart_port *port)
473{ 444{
diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
index ef0259a950ba..d7e611645533 100644
--- a/drivers/usb/gadget/udc/Kconfig
+++ b/drivers/usb/gadget/udc/Kconfig
@@ -45,7 +45,8 @@ config USB_AT91
45 45
46config USB_LPC32XX 46config USB_LPC32XX
47 tristate "LPC32XX USB Peripheral Controller" 47 tristate "LPC32XX USB Peripheral Controller"
48 depends on ARCH_LPC32XX && I2C 48 depends on ARCH_LPC32XX
49 depends on I2C
49 select USB_ISP1301 50 select USB_ISP1301
50 help 51 help
51 This option selects the USB device controller in the LPC32xx SoC. 52 This option selects the USB device controller in the LPC32xx SoC.
diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c
index bb6af6b5ac97..c65aed3e84c7 100644
--- a/drivers/usb/gadget/udc/lpc32xx_udc.c
+++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
@@ -24,6 +24,7 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/of.h> 25#include <linux/of.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/prefetch.h>
27#include <linux/proc_fs.h> 28#include <linux/proc_fs.h>
28#include <linux/slab.h> 29#include <linux/slab.h>
29#include <linux/usb/ch9.h> 30#include <linux/usb/ch9.h>
@@ -35,8 +36,6 @@
35#include <linux/seq_file.h> 36#include <linux/seq_file.h>
36#endif 37#endif
37 38
38#include <mach/hardware.h>
39
40/* 39/*
41 * USB device configuration structure 40 * USB device configuration structure
42 */ 41 */
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 40b5de597112..73d233d3bf4d 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -441,7 +441,8 @@ config USB_OHCI_HCD_S3C2410
441 441
442config USB_OHCI_HCD_LPC32XX 442config USB_OHCI_HCD_LPC32XX
443 tristate "Support for LPC on-chip OHCI USB controller" 443 tristate "Support for LPC on-chip OHCI USB controller"
444 depends on USB_OHCI_HCD && ARCH_LPC32XX 444 depends on USB_OHCI_HCD
445 depends on ARCH_LPC32XX || COMPILE_TEST
445 depends on USB_ISP1301 446 depends on USB_ISP1301
446 default y 447 default y
447 ---help--- 448 ---help---
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
index f5f532601092..c561881d0e79 100644
--- a/drivers/usb/host/ohci-nxp.c
+++ b/drivers/usb/host/ohci-nxp.c
@@ -29,10 +29,7 @@
29 29
30#include "ohci.h" 30#include "ohci.h"
31 31
32#include <mach/hardware.h>
33
34#define USB_CONFIG_BASE 0x31020000 32#define USB_CONFIG_BASE 0x31020000
35#define USB_OTG_STAT_CONTROL IO_ADDRESS(USB_CONFIG_BASE + 0x110)
36 33
37/* USB_OTG_STAT_CONTROL bit defines */ 34/* USB_OTG_STAT_CONTROL bit defines */
38#define TRANSPARENT_I2C_EN (1 << 7) 35#define TRANSPARENT_I2C_EN (1 << 7)
@@ -122,19 +119,33 @@ static inline void isp1301_vbus_off(void)
122 119
123static void ohci_nxp_start_hc(void) 120static void ohci_nxp_start_hc(void)
124{ 121{
125 unsigned long tmp = __raw_readl(USB_OTG_STAT_CONTROL) | HOST_EN; 122 void __iomem *usb_otg_stat_control = ioremap(USB_CONFIG_BASE + 0x110, 4);
123 unsigned long tmp;
124
125 if (WARN_ON(!usb_otg_stat_control))
126 return;
127
128 tmp = __raw_readl(usb_otg_stat_control) | HOST_EN;
126 129
127 __raw_writel(tmp, USB_OTG_STAT_CONTROL); 130 __raw_writel(tmp, usb_otg_stat_control);
128 isp1301_vbus_on(); 131 isp1301_vbus_on();
132
133 iounmap(usb_otg_stat_control);
129} 134}
130 135
131static void ohci_nxp_stop_hc(void) 136static void ohci_nxp_stop_hc(void)
132{ 137{
138 void __iomem *usb_otg_stat_control = ioremap(USB_CONFIG_BASE + 0x110, 4);
133 unsigned long tmp; 139 unsigned long tmp;
134 140
141 if (WARN_ON(!usb_otg_stat_control))
142 return;
143
135 isp1301_vbus_off(); 144 isp1301_vbus_off();
136 tmp = __raw_readl(USB_OTG_STAT_CONTROL) & ~HOST_EN; 145 tmp = __raw_readl(usb_otg_stat_control) & ~HOST_EN;
137 __raw_writel(tmp, USB_OTG_STAT_CONTROL); 146 __raw_writel(tmp, usb_otg_stat_control);
147
148 iounmap(usb_otg_stat_control);
138} 149}
139 150
140static int ohci_hcd_nxp_probe(struct platform_device *pdev) 151static int ohci_hcd_nxp_probe(struct platform_device *pdev)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 8188963a405b..a45f9e3e442b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -551,7 +551,7 @@ config OMAP_WATCHDOG
551 551
552config PNX4008_WATCHDOG 552config PNX4008_WATCHDOG
553 tristate "LPC32XX Watchdog" 553 tristate "LPC32XX Watchdog"
554 depends on ARCH_LPC32XX 554 depends on ARCH_LPC32XX || COMPILE_TEST
555 select WATCHDOG_CORE 555 select WATCHDOG_CORE
556 help 556 help
557 Say Y here if to include support for the watchdog timer 557 Say Y here if to include support for the watchdog timer
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index 7b446b696f2b..e0ea133c1690 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -30,7 +30,6 @@
30#include <linux/of.h> 30#include <linux/of.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/reboot.h> 32#include <linux/reboot.h>
33#include <mach/hardware.h>
34 33
35/* WatchDog Timer - Chapter 23 Page 207 */ 34/* WatchDog Timer - Chapter 23 Page 207 */
36 35
diff --git a/arch/arm/include/asm/hardware/iop_adma.h b/include/linux/platform_data/dma-iop32x.h
index bcedbab90ac0..ac83cff89549 100644
--- a/arch/arm/include/asm/hardware/iop_adma.h
+++ b/include/linux/platform_data/dma-iop32x.h
@@ -17,6 +17,10 @@
17#endif 17#endif
18#define iop_paranoia(x) BUG_ON(IOP_PARANOIA && (x)) 18#define iop_paranoia(x) BUG_ON(IOP_PARANOIA && (x))
19 19
20#define DMA0_ID 0
21#define DMA1_ID 1
22#define AAU_ID 2
23
20/** 24/**
21 * struct iop_adma_device - internal representation of an ADMA device 25 * struct iop_adma_device - internal representation of an ADMA device
22 * @pdev: Platform device 26 * @pdev: Platform device
diff --git a/include/linux/soc/nxp/lpc32xx-misc.h b/include/linux/soc/nxp/lpc32xx-misc.h
new file mode 100644
index 000000000000..699c6f1e3aab
--- /dev/null
+++ b/include/linux/soc/nxp/lpc32xx-misc.h
@@ -0,0 +1,33 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Author: Kevin Wells <kevin.wells@nxp.com>
4 *
5 * Copyright (C) 2010 NXP Semiconductors
6 */
7
8#ifndef __SOC_LPC32XX_MISC_H
9#define __SOC_LPC32XX_MISC_H
10
11#include <linux/types.h>
12#include <linux/phy.h>
13
14#ifdef CONFIG_ARCH_LPC32XX
15extern u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr);
16extern void lpc32xx_set_phy_interface_mode(phy_interface_t mode);
17extern void lpc32xx_loopback_set(resource_size_t mapbase, int state);
18#else
19static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr)
20{
21 *mapbase = NULL;
22 *dmaaddr = 0;
23 return 0;
24}
25static inline void lpc32xx_set_phy_interface_mode(phy_interface_t mode)
26{
27}
28static inline void lpc32xx_loopback_set(resource_size_t mapbase, int state)
29{
30}
31#endif
32
33#endif /* __SOC_LPC32XX_MISC_H */
diff --git a/include/linux/usb/samsung_usb_phy.h b/include/linux/usb/samsung_usb_phy.h
deleted file mode 100644
index dc0071741695..000000000000
--- a/include/linux/usb/samsung_usb_phy.h
+++ /dev/null
@@ -1,17 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2012 Samsung Electronics Co.Ltd
4 * http://www.samsung.com/
5 *
6 * Defines phy types for samsung usb phy controllers - HOST or DEIVCE.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14enum samsung_usb_phy_type {
15 USB_PHY_TYPE_DEVICE,
16 USB_PHY_TYPE_HOST,
17};