linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms
@ 2019-08-09 20:27 Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 01/16] ARM: remove ks8695 platform Arnd Bergmann
                   ` (16 more replies)
  0 siblings, 17 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Wanzongshun (Vincent),
	Greg Ungerer, Greg Kroah-Hartman, linux-serial, Dmitry Torokhov,
	linux-input, Linus Walleij, linux-gpio, David S. Miller, netdev,
	Guenter Roeck, Mark Brown, alsa-devel, linux-spi,
	Bartlomiej Zolnierkiewicz, linux-fbdev, Miquel Raynal, linux-mtd,
	linux-arm-kernel, linux-kernel

As discussed previously, these two ARM platforms have no
known remaining users, let's remove them completely.

Subsystem maintainers: feel free to take the driver removals
through your respective trees, they are all independent of
one another. We can merge any remaining patches through the
soc tree.

      Arnd

Arnd Bergmann (16):
  ARM: remove ks8695 platform
  serial: remove ks8695 driver
  gpio: remove ks8695 driver
  watchdog: remove ks8695 driver
  net: remove ks8695 driver
  watchdog: remove w90x900 driver
  spi: remove w90x900 driver
  ASoC: remove w90x900/nuc900 platform drivers
  fbdev: remove w90x900/nuc900 platform drivers
  Input: remove w90x900 keyboard driver
  Input: remove w90x900 touchscreen driver
  mtd: rawnand: remove w90x900 driver
  net: remove w90p910-ether driver
  rtc: remove w90x900/nuc900 driver
  usb: remove ehci-w90x900 driver
  ARM: remove w90x900 platform

Cc: "Wanzongshun (Vincent)" <wanzongshun@huawei.com>
Cc: Greg Ungerer <gerg@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Cc: linux-spi@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-fbdev@vger.kernel.org
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: linux-mtd@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

 .../watchdog/watchdog-parameters.rst          |   19 -
 MAINTAINERS                                   |   22 -
 arch/arm/Kconfig                              |   34 +-
 arch/arm/Kconfig.debug                        |    8 -
 arch/arm/Makefile                             |    2 -
 arch/arm/configs/acs5k_defconfig              |   77 -
 arch/arm/configs/acs5k_tiny_defconfig         |   69 -
 arch/arm/configs/ks8695_defconfig             |   67 -
 arch/arm/configs/nuc910_defconfig             |   51 -
 arch/arm/configs/nuc950_defconfig             |   67 -
 arch/arm/configs/nuc960_defconfig             |   57 -
 arch/arm/include/debug/ks8695.S               |   37 -
 arch/arm/mach-ks8695/Kconfig                  |   88 -
 arch/arm/mach-ks8695/Makefile                 |   23 -
 arch/arm/mach-ks8695/Makefile.boot            |    9 -
 arch/arm/mach-ks8695/board-acs5k.c            |  238 ---
 arch/arm/mach-ks8695/board-dsm320.c           |  127 --
 arch/arm/mach-ks8695/board-micrel.c           |   59 -
 arch/arm/mach-ks8695/board-og.c               |  197 --
 arch/arm/mach-ks8695/board-sg.c               |  118 --
 arch/arm/mach-ks8695/cpu.c                    |   60 -
 arch/arm/mach-ks8695/devices.c                |  197 --
 arch/arm/mach-ks8695/devices.h                |   29 -
 arch/arm/mach-ks8695/generic.h                |   12 -
 .../mach-ks8695/include/mach/entry-macro.S    |   47 -
 .../mach-ks8695/include/mach/gpio-ks8695.h    |   36 -
 arch/arm/mach-ks8695/include/mach/hardware.h  |   42 -
 arch/arm/mach-ks8695/include/mach/irqs.h      |   51 -
 arch/arm/mach-ks8695/include/mach/memory.h    |   51 -
 arch/arm/mach-ks8695/include/mach/regs-gpio.h |   55 -
 arch/arm/mach-ks8695/include/mach/regs-irq.h  |   41 -
 arch/arm/mach-ks8695/include/mach/regs-misc.h |   97 -
 .../mach-ks8695/include/mach/regs-switch.h    |   66 -
 arch/arm/mach-ks8695/include/mach/regs-uart.h |   89 -
 .../arm/mach-ks8695/include/mach/uncompress.h |   33 -
 arch/arm/mach-ks8695/irq.c                    |  164 --
 arch/arm/mach-ks8695/pci.c                    |  247 ---
 arch/arm/mach-ks8695/regs-hpna.h              |   25 -
 arch/arm/mach-ks8695/regs-lan.h               |   65 -
 arch/arm/mach-ks8695/regs-mem.h               |   89 -
 arch/arm/mach-ks8695/regs-pci.h               |   53 -
 arch/arm/mach-ks8695/regs-sys.h               |   34 -
 arch/arm/mach-ks8695/regs-wan.h               |   65 -
 arch/arm/mach-ks8695/time.c                   |  159 --
 arch/arm/mach-w90x900/Kconfig                 |   50 -
 arch/arm/mach-w90x900/Makefile                |   20 -
 arch/arm/mach-w90x900/Makefile.boot           |    4 -
 arch/arm/mach-w90x900/clksel.c                |   88 -
 arch/arm/mach-w90x900/clock.c                 |  121 --
 arch/arm/mach-w90x900/clock.h                 |   40 -
 arch/arm/mach-w90x900/cpu.c                   |  238 ---
 arch/arm/mach-w90x900/cpu.h                   |   56 -
 arch/arm/mach-w90x900/dev.c                   |  537 ------
 arch/arm/mach-w90x900/gpio.c                  |  150 --
 .../mach-w90x900/include/mach/entry-macro.S   |   26 -
 arch/arm/mach-w90x900/include/mach/hardware.h |   19 -
 arch/arm/mach-w90x900/include/mach/irqs.h     |   82 -
 arch/arm/mach-w90x900/include/mach/map.h      |  153 --
 arch/arm/mach-w90x900/include/mach/mfp.h      |   21 -
 .../mach-w90x900/include/mach/regs-clock.h    |   49 -
 arch/arm/mach-w90x900/include/mach/regs-irq.h |   46 -
 arch/arm/mach-w90x900/include/mach/regs-ldm.h |  248 ---
 .../mach-w90x900/include/mach/regs-serial.h   |   54 -
 .../mach-w90x900/include/mach/uncompress.h    |   43 -
 arch/arm/mach-w90x900/irq.c                   |  212 ---
 arch/arm/mach-w90x900/mach-nuc910evb.c        |   38 -
 arch/arm/mach-w90x900/mach-nuc950evb.c        |   42 -
 arch/arm/mach-w90x900/mach-nuc960evb.c        |   38 -
 arch/arm/mach-w90x900/mfp.c                   |  197 --
 arch/arm/mach-w90x900/nuc910.c                |   58 -
 arch/arm/mach-w90x900/nuc910.h                |   17 -
 arch/arm/mach-w90x900/nuc950.c                |   52 -
 arch/arm/mach-w90x900/nuc950.h                |   17 -
 arch/arm/mach-w90x900/nuc960.c                |   50 -
 arch/arm/mach-w90x900/nuc960.h                |   17 -
 arch/arm/mach-w90x900/nuc9xx.h                |   22 -
 arch/arm/mach-w90x900/regs-ebi.h              |   29 -
 arch/arm/mach-w90x900/regs-gcr.h              |   34 -
 arch/arm/mach-w90x900/regs-timer.h            |   37 -
 arch/arm/mach-w90x900/regs-usb.h              |   31 -
 arch/arm/mach-w90x900/time.c                  |  168 --
 arch/arm/mm/Kconfig                           |    2 +-
 drivers/gpio/Makefile                         |    1 -
 drivers/gpio/gpio-ks8695.c                    |  284 ---
 drivers/input/keyboard/Kconfig                |   11 -
 drivers/input/keyboard/Makefile               |    1 -
 drivers/input/keyboard/w90p910_keypad.c       |  264 ---
 drivers/input/touchscreen/Kconfig             |    9 -
 drivers/input/touchscreen/Makefile            |    1 -
 drivers/input/touchscreen/w90p910_ts.c        |  331 ----
 drivers/mtd/nand/raw/Kconfig                  |    8 -
 drivers/mtd/nand/raw/Makefile                 |    1 -
 drivers/mtd/nand/raw/nuc900_nand.c            |  304 ---
 drivers/net/ethernet/Kconfig                  |    1 -
 drivers/net/ethernet/Makefile                 |    1 -
 drivers/net/ethernet/micrel/Kconfig           |   11 +-
 drivers/net/ethernet/micrel/Makefile          |    1 -
 drivers/net/ethernet/micrel/ks8695net.c       | 1632 -----------------
 drivers/net/ethernet/micrel/ks8695net.h       |  108 --
 drivers/net/ethernet/nuvoton/Kconfig          |   29 -
 drivers/net/ethernet/nuvoton/Makefile         |    6 -
 drivers/net/ethernet/nuvoton/w90p910_ether.c  | 1082 -----------
 drivers/rtc/Kconfig                           |    7 -
 drivers/rtc/Makefile                          |    1 -
 drivers/rtc/rtc-nuc900.c                      |  271 ---
 drivers/spi/Kconfig                           |    7 -
 drivers/spi/Makefile                          |    1 -
 drivers/spi/spi-nuc900.c                      |  429 -----
 drivers/tty/serial/Kconfig                    |   17 -
 drivers/tty/serial/Makefile                   |    1 -
 drivers/tty/serial/serial_ks8695.c            |  698 -------
 drivers/usb/host/Kconfig                      |    6 -
 drivers/usb/host/Makefile                     |    1 -
 drivers/usb/host/ehci-w90x900.c               |  130 --
 drivers/video/fbdev/Kconfig                   |   14 -
 drivers/video/fbdev/Makefile                  |    1 -
 drivers/video/fbdev/nuc900fb.c                |  760 --------
 drivers/video/fbdev/nuc900fb.h                |   51 -
 drivers/watchdog/Kconfig                      |   16 -
 drivers/watchdog/Makefile                     |    2 -
 drivers/watchdog/ks8695_wdt.c                 |  319 ----
 drivers/watchdog/nuc900_wdt.c                 |  302 ---
 include/Kbuild                                |    2 -
 include/linux/platform_data/keypad-w90p910.h  |   16 -
 include/linux/platform_data/spi-nuc900.h      |   29 -
 include/linux/platform_data/video-nuc900fb.h  |   79 -
 include/uapi/linux/serial_core.h              |    3 -
 sound/soc/Kconfig                             |    1 -
 sound/soc/Makefile                            |    1 -
 sound/soc/nuc900/Kconfig                      |   29 -
 sound/soc/nuc900/Makefile                     |   12 -
 sound/soc/nuc900/nuc900-ac97.c                |  391 ----
 sound/soc/nuc900/nuc900-audio.c               |   73 -
 sound/soc/nuc900/nuc900-audio.h               |  108 --
 sound/soc/nuc900/nuc900-pcm.c                 |  321 ----
 135 files changed, 6 insertions(+), 14461 deletions(-)
 delete mode 100644 arch/arm/configs/acs5k_defconfig
 delete mode 100644 arch/arm/configs/acs5k_tiny_defconfig
 delete mode 100644 arch/arm/configs/ks8695_defconfig
 delete mode 100644 arch/arm/configs/nuc910_defconfig
 delete mode 100644 arch/arm/configs/nuc950_defconfig
 delete mode 100644 arch/arm/configs/nuc960_defconfig
 delete mode 100644 arch/arm/include/debug/ks8695.S
 delete mode 100644 arch/arm/mach-ks8695/Kconfig
 delete mode 100644 arch/arm/mach-ks8695/Makefile
 delete mode 100644 arch/arm/mach-ks8695/Makefile.boot
 delete mode 100644 arch/arm/mach-ks8695/board-acs5k.c
 delete mode 100644 arch/arm/mach-ks8695/board-dsm320.c
 delete mode 100644 arch/arm/mach-ks8695/board-micrel.c
 delete mode 100644 arch/arm/mach-ks8695/board-og.c
 delete mode 100644 arch/arm/mach-ks8695/board-sg.c
 delete mode 100644 arch/arm/mach-ks8695/cpu.c
 delete mode 100644 arch/arm/mach-ks8695/devices.c
 delete mode 100644 arch/arm/mach-ks8695/devices.h
 delete mode 100644 arch/arm/mach-ks8695/generic.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/entry-macro.S
 delete mode 100644 arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/hardware.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/memory.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-gpio.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-irq.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-misc.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-switch.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-uart.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/uncompress.h
 delete mode 100644 arch/arm/mach-ks8695/irq.c
 delete mode 100644 arch/arm/mach-ks8695/pci.c
 delete mode 100644 arch/arm/mach-ks8695/regs-hpna.h
 delete mode 100644 arch/arm/mach-ks8695/regs-lan.h
 delete mode 100644 arch/arm/mach-ks8695/regs-mem.h
 delete mode 100644 arch/arm/mach-ks8695/regs-pci.h
 delete mode 100644 arch/arm/mach-ks8695/regs-sys.h
 delete mode 100644 arch/arm/mach-ks8695/regs-wan.h
 delete mode 100644 arch/arm/mach-ks8695/time.c
 delete mode 100644 arch/arm/mach-w90x900/Kconfig
 delete mode 100644 arch/arm/mach-w90x900/Makefile
 delete mode 100644 arch/arm/mach-w90x900/Makefile.boot
 delete mode 100644 arch/arm/mach-w90x900/clksel.c
 delete mode 100644 arch/arm/mach-w90x900/clock.c
 delete mode 100644 arch/arm/mach-w90x900/clock.h
 delete mode 100644 arch/arm/mach-w90x900/cpu.c
 delete mode 100644 arch/arm/mach-w90x900/cpu.h
 delete mode 100644 arch/arm/mach-w90x900/dev.c
 delete mode 100644 arch/arm/mach-w90x900/gpio.c
 delete mode 100644 arch/arm/mach-w90x900/include/mach/entry-macro.S
 delete mode 100644 arch/arm/mach-w90x900/include/mach/hardware.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/map.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/mfp.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-clock.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-irq.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-ldm.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-serial.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/uncompress.h
 delete mode 100644 arch/arm/mach-w90x900/irq.c
 delete mode 100644 arch/arm/mach-w90x900/mach-nuc910evb.c
 delete mode 100644 arch/arm/mach-w90x900/mach-nuc950evb.c
 delete mode 100644 arch/arm/mach-w90x900/mach-nuc960evb.c
 delete mode 100644 arch/arm/mach-w90x900/mfp.c
 delete mode 100644 arch/arm/mach-w90x900/nuc910.c
 delete mode 100644 arch/arm/mach-w90x900/nuc910.h
 delete mode 100644 arch/arm/mach-w90x900/nuc950.c
 delete mode 100644 arch/arm/mach-w90x900/nuc950.h
 delete mode 100644 arch/arm/mach-w90x900/nuc960.c
 delete mode 100644 arch/arm/mach-w90x900/nuc960.h
 delete mode 100644 arch/arm/mach-w90x900/nuc9xx.h
 delete mode 100644 arch/arm/mach-w90x900/regs-ebi.h
 delete mode 100644 arch/arm/mach-w90x900/regs-gcr.h
 delete mode 100644 arch/arm/mach-w90x900/regs-timer.h
 delete mode 100644 arch/arm/mach-w90x900/regs-usb.h
 delete mode 100644 arch/arm/mach-w90x900/time.c
 delete mode 100644 drivers/gpio/gpio-ks8695.c
 delete mode 100644 drivers/input/keyboard/w90p910_keypad.c
 delete mode 100644 drivers/input/touchscreen/w90p910_ts.c
 delete mode 100644 drivers/mtd/nand/raw/nuc900_nand.c
 delete mode 100644 drivers/net/ethernet/micrel/ks8695net.c
 delete mode 100644 drivers/net/ethernet/micrel/ks8695net.h
 delete mode 100644 drivers/net/ethernet/nuvoton/Kconfig
 delete mode 100644 drivers/net/ethernet/nuvoton/Makefile
 delete mode 100644 drivers/net/ethernet/nuvoton/w90p910_ether.c
 delete mode 100644 drivers/rtc/rtc-nuc900.c
 delete mode 100644 drivers/spi/spi-nuc900.c
 delete mode 100644 drivers/tty/serial/serial_ks8695.c
 delete mode 100644 drivers/usb/host/ehci-w90x900.c
 delete mode 100644 drivers/video/fbdev/nuc900fb.c
 delete mode 100644 drivers/video/fbdev/nuc900fb.h
 delete mode 100644 drivers/watchdog/ks8695_wdt.c
 delete mode 100644 drivers/watchdog/nuc900_wdt.c
 delete mode 100644 include/linux/platform_data/keypad-w90p910.h
 delete mode 100644 include/linux/platform_data/spi-nuc900.h
 delete mode 100644 include/linux/platform_data/video-nuc900fb.h
 delete mode 100644 sound/soc/nuc900/Kconfig
 delete mode 100644 sound/soc/nuc900/Makefile
 delete mode 100644 sound/soc/nuc900/nuc900-ac97.c
 delete mode 100644 sound/soc/nuc900/nuc900-audio.c
 delete mode 100644 sound/soc/nuc900/nuc900-audio.h
 delete mode 100644 sound/soc/nuc900/nuc900-pcm.c

-- 
2.20.0


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH 01/16] ARM: remove ks8695 platform
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-11  9:18   ` Ben Dooks
                     ` (2 more replies)
  2019-08-09 20:27 ` [PATCH 02/16] serial: remove ks8695 driver Arnd Bergmann
                   ` (15 subsequent siblings)
  16 siblings, 3 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Greg Ungerer, Andrew Victor, Ben Dooks,
	linux-kernel, linux-arm-kernel

ks8695 is an older SoC originally made by Kendin, which was later acquired
by Micrel, and subsequently by Microchip.

The platform port was originally contributed by Andrew Victor and Ben
Dooks, and later maintained by Greg Ungerer.

When I recently submitted cleanups, but Greg noted that the platform no
longer boots and nobody is using it any more, we decided to remove it.

Cc: Greg Ungerer <gerg@kernel.org>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Ben Dooks <ben.dooks@codethink.co.uk>
Link: https://wikidevi.com/wiki/Micrel
Link: https://lore.kernel.org/linux-arm-kernel/2bc41895-d4f9-896c-0726-0b2862fcbf25@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 MAINTAINERS                                   |   6 -
 arch/arm/Kconfig                              |  16 +-
 arch/arm/Kconfig.debug                        |   8 -
 arch/arm/Makefile                             |   1 -
 arch/arm/configs/acs5k_defconfig              |  77 ------
 arch/arm/configs/acs5k_tiny_defconfig         |  69 -----
 arch/arm/configs/ks8695_defconfig             |  67 -----
 arch/arm/include/debug/ks8695.S               |  37 ---
 arch/arm/mach-ks8695/Kconfig                  |  88 -------
 arch/arm/mach-ks8695/Makefile                 |  23 --
 arch/arm/mach-ks8695/Makefile.boot            |   9 -
 arch/arm/mach-ks8695/board-acs5k.c            | 238 -----------------
 arch/arm/mach-ks8695/board-dsm320.c           | 127 ---------
 arch/arm/mach-ks8695/board-micrel.c           |  59 -----
 arch/arm/mach-ks8695/board-og.c               | 197 --------------
 arch/arm/mach-ks8695/board-sg.c               | 118 ---------
 arch/arm/mach-ks8695/cpu.c                    |  60 -----
 arch/arm/mach-ks8695/devices.c                | 197 --------------
 arch/arm/mach-ks8695/devices.h                |  29 --
 arch/arm/mach-ks8695/generic.h                |  12 -
 .../mach-ks8695/include/mach/entry-macro.S    |  47 ----
 .../mach-ks8695/include/mach/gpio-ks8695.h    |  36 ---
 arch/arm/mach-ks8695/include/mach/hardware.h  |  42 ---
 arch/arm/mach-ks8695/include/mach/irqs.h      |  51 ----
 arch/arm/mach-ks8695/include/mach/memory.h    |  51 ----
 arch/arm/mach-ks8695/include/mach/regs-gpio.h |  55 ----
 arch/arm/mach-ks8695/include/mach/regs-irq.h  |  41 ---
 arch/arm/mach-ks8695/include/mach/regs-misc.h |  97 -------
 .../mach-ks8695/include/mach/regs-switch.h    |  66 -----
 arch/arm/mach-ks8695/include/mach/regs-uart.h |  89 -------
 .../arm/mach-ks8695/include/mach/uncompress.h |  33 ---
 arch/arm/mach-ks8695/irq.c                    | 164 ------------
 arch/arm/mach-ks8695/pci.c                    | 247 ------------------
 arch/arm/mach-ks8695/regs-hpna.h              |  25 --
 arch/arm/mach-ks8695/regs-lan.h               |  65 -----
 arch/arm/mach-ks8695/regs-mem.h               |  89 -------
 arch/arm/mach-ks8695/regs-pci.h               |  53 ----
 arch/arm/mach-ks8695/regs-sys.h               |  34 ---
 arch/arm/mach-ks8695/regs-wan.h               |  65 -----
 arch/arm/mach-ks8695/time.c                   | 159 -----------
 arch/arm/mm/Kconfig                           |   2 +-
 41 files changed, 5 insertions(+), 2944 deletions(-)
 delete mode 100644 arch/arm/configs/acs5k_defconfig
 delete mode 100644 arch/arm/configs/acs5k_tiny_defconfig
 delete mode 100644 arch/arm/configs/ks8695_defconfig
 delete mode 100644 arch/arm/include/debug/ks8695.S
 delete mode 100644 arch/arm/mach-ks8695/Kconfig
 delete mode 100644 arch/arm/mach-ks8695/Makefile
 delete mode 100644 arch/arm/mach-ks8695/Makefile.boot
 delete mode 100644 arch/arm/mach-ks8695/board-acs5k.c
 delete mode 100644 arch/arm/mach-ks8695/board-dsm320.c
 delete mode 100644 arch/arm/mach-ks8695/board-micrel.c
 delete mode 100644 arch/arm/mach-ks8695/board-og.c
 delete mode 100644 arch/arm/mach-ks8695/board-sg.c
 delete mode 100644 arch/arm/mach-ks8695/cpu.c
 delete mode 100644 arch/arm/mach-ks8695/devices.c
 delete mode 100644 arch/arm/mach-ks8695/devices.h
 delete mode 100644 arch/arm/mach-ks8695/generic.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/entry-macro.S
 delete mode 100644 arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/hardware.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/memory.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-gpio.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-irq.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-misc.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-switch.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-uart.h
 delete mode 100644 arch/arm/mach-ks8695/include/mach/uncompress.h
 delete mode 100644 arch/arm/mach-ks8695/irq.c
 delete mode 100644 arch/arm/mach-ks8695/pci.c
 delete mode 100644 arch/arm/mach-ks8695/regs-hpna.h
 delete mode 100644 arch/arm/mach-ks8695/regs-lan.h
 delete mode 100644 arch/arm/mach-ks8695/regs-mem.h
 delete mode 100644 arch/arm/mach-ks8695/regs-pci.h
 delete mode 100644 arch/arm/mach-ks8695/regs-sys.h
 delete mode 100644 arch/arm/mach-ks8695/regs-wan.h
 delete mode 100644 arch/arm/mach-ks8695/time.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 6426db5198f0..9ac40a896ee6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1921,12 +1921,6 @@ S:	Maintained
 F:	drivers/phy/mediatek/
 F:	Documentation/devicetree/bindings/phy/phy-mtk-*
 
-ARM/MICREL KS8695 ARCHITECTURE
-M:	Greg Ungerer <gerg@uclinux.org>
-L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-F:	arch/arm/mach-ks8695/
-S:	Odd Fixes
-
 ARM/Microchip (AT91) SoC support
 M:	Nicolas Ferre <nicolas.ferre@microchip.com>
 M:	Alexandre Belloni <alexandre.belloni@bootlin.com>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 33b00579beff..61deacf68e13 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -264,7 +264,6 @@ config PHYS_OFFSET
 			ARCH_FOOTBRIDGE || \
 			ARCH_INTEGRATOR || \
 			ARCH_IOP13XX || \
-			ARCH_KS8695 || \
 			ARCH_REALVIEW
 	default 0x10000000 if ARCH_OMAP1 || ARCH_RPC
 	default 0x20000000 if ARCH_S5PV210
@@ -451,17 +450,6 @@ config ARCH_DOVE
 	help
 	  Support for the Marvell Dove SoC 88AP510
 
-config ARCH_KS8695
-	bool "Micrel/Kendin KS8695"
-	select CLKSRC_MMIO
-	select CPU_ARM922T
-	select GENERIC_CLOCKEVENTS
-	select GPIOLIB
-	select NEED_MACH_MEMORY_H
-	help
-	  Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
-	  System-on-Chip devices.
-
 config ARCH_W90X900
 	bool "Nuvoton W90X900 CPU"
 	select CLKDEV_LOOKUP
@@ -744,7 +732,11 @@ source "arch/arm/mach-ixp4xx/Kconfig"
 
 source "arch/arm/mach-keystone/Kconfig"
 
+<<<<<<< HEAD
 source "arch/arm/mach-ks8695/Kconfig"
+=======
+source "arch/arm/mach-lpc32xx/Kconfig"
+>>>>>>> ARM: remove ks8695 platform
 
 source "arch/arm/mach-mediatek/Kconfig"
 
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 85710e078afb..2496f1c89b88 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -509,13 +509,6 @@ choice
 		  Say Y here if you want the debug print routines to direct
 		  their output to UART1 serial port on KEYSTONE2 devices.
 
-	config DEBUG_KS8695_UART
-		bool "KS8695 Debug UART"
-		depends on ARCH_KS8695
-		help
-		  Say Y here if you want kernel low-level debugging support
-		  on KS8695.
-
 	config DEBUG_LPC18XX_UART0
 		bool "Kernel low-level debugging via LPC18xx/43xx UART0"
 		depends on ARCH_LPC18XX
@@ -1533,7 +1526,6 @@ config DEBUG_LL_INCLUDE
 				 DEBUG_IMX6SX_UART || \
 				 DEBUG_IMX6UL_UART || \
 				 DEBUG_IMX7D_UART
-	default "debug/ks8695.S" if DEBUG_KS8695_UART
 	default "debug/msm.S" if DEBUG_QCOM_UARTDM
 	default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
 	default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c3624ca6c0bc..c9daa4adc6fd 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -178,7 +178,6 @@ machine-$(CONFIG_ARCH_IOP32X)		+= iop32x
 machine-$(CONFIG_ARCH_IOP33X)		+= iop33x
 machine-$(CONFIG_ARCH_IXP4XX)		+= ixp4xx
 machine-$(CONFIG_ARCH_KEYSTONE)		+= keystone
-machine-$(CONFIG_ARCH_KS8695)		+= ks8695
 machine-$(CONFIG_ARCH_LPC18XX)		+= lpc18xx
 machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
 machine-$(CONFIG_ARCH_MESON)		+= meson
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 @@
-# CONFIG_SWAP is not set
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_KS8695=y
-CONFIG_MACH_KS8695=y
-CONFIG_MACH_DSM320=y
-CONFIG_MACH_ACS5K=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_PCI=y
-CONFIG_PCI_DEBUG=y
-CONFIG_PCCARD=y
-CONFIG_YENTA=y
-CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_IPV6 is not set
-CONFIG_MTD=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
-CONFIG_ARM_KS8695_ETHER=y
-CONFIG_PRISM54=m
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_SERIAL_KS8695=y
-CONFIG_SERIAL_KS8695_CONSOLE=y
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_GPIO=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_PCA953X=y
-CONFIG_WATCHDOG=y
-CONFIG_KS8695_WATCHDOG=y
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_PCF8563=y
-CONFIG_EXT2_FS=y
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_CRAMFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_ROOT_NFS=y
-CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_MUTEXES=y
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_USER=y
-CONFIG_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 @@
-# CONFIG_SWAP is not set
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_KS8695=y
-CONFIG_MACH_ACS5K=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="console=ttyAM0,115200 init=/bin/sh"
-CONFIG_FPE_NWFPE=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_IPV6 is not set
-CONFIG_MTD=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-# CONFIG_BLK_DEV is not set
-CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
-CONFIG_ARM_KS8695_ETHER=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_SERIAL_KS8695=y
-CONFIG_SERIAL_KS8695_CONSOLE=y
-# CONFIG_HW_RANDOM is not set
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_GPIO=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_PCA953X=y
-# CONFIG_HWMON is not set
-CONFIG_WATCHDOG=y
-CONFIG_KS8695_WATCHDOG=y
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_USB_SUPPORT is not set
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_PCF8563=y
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_SQUASHFS=y
-# CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_MUTEXES=y
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_USER=y
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 @@
-# CONFIG_SWAP is not set
-CONFIG_SYSVIPC=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_KS8695=y
-CONFIG_MACH_KS8695=y
-CONFIG_MACH_DSM320=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_PCI=y
-CONFIG_PCI_DEBUG=y
-CONFIG_PCCARD=y
-CONFIG_YENTA=y
-CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_IPV6 is not set
-CONFIG_MTD=y
-CONFIG_MTD_REDBOOT_PARTS=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-CONFIG_PRISM54=m
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_SERIAL_KS8695=y
-CONFIG_SERIAL_KS8695_CONSOLE=y
-# CONFIG_HWMON is not set
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_EXT2_FS=y
-CONFIG_TMPFS=y
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_SUMMARY=y
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_RUBIN=y
-CONFIG_CRAMFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_ROOT_NFS=y
-CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_MUTEXES=y
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_LL=y
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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/include/debug/ks8695.S
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - Debug macros
- */
-
-#define KS8695_UART_PA	0x03ffe000
-#define KS8695_UART_VA	0xf00fe000
-#define KS8695_URTH	(0x04)
-#define KS8695_URLS	(0x14)
-#define URLS_URTE	(1 << 6)
-#define URLS_URTHRE	(1 << 5)
-
-	.macro	addruart, rp, rv, tmp
-		ldr	\rp, =KS8695_UART_PA		@ physical base address
-		ldr	\rv, =KS8695_UART_VA		@ virtual base address
-	.endm
-
-	.macro	senduart, rd, rx
-		str	\rd, [\rx, #KS8695_URTH]	@ Write to Transmit Holding Register
-	.endm
-
-	.macro	busyuart, rd, rx
-1001:		ldr	\rd, [\rx, #KS8695_URLS]	@ Read Line Status Register
-		tst	\rd, #URLS_URTE			@ Holding & Shift registers empty?
-		beq	1001b
-	.endm
-
-	.macro	waituart, rd, rx
-1001:		ldr	\rd, [\rx, #KS8695_URLS]	@ Read Line Status Register
-		tst	\rd, #URLS_URTHRE		@ Holding Register empty?
-		beq	1001b
-	.endm
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 @@
-# SPDX-License-Identifier: GPL-2.0-only
-if ARCH_KS8695
-
-menu "Kendin/Micrel KS8695 Implementations"
-
-config MACH_KS8695
-	bool "KS8695 development board"
-	select HAVE_PCI
-	help
-	  Say 'Y' here if you want your kernel to run on the original
-	  Kendin-Micrel KS8695 development board.
-
-config MACH_DSM320
-	bool "DSM-320 Wireless Media Player"
-	help
-	  Say 'Y' here if you want your kernel to run on the D-Link
-	  DSM-320 Wireless Media Player.
-
-config MACH_ACS5K
-	bool "Brivo Systems LLC, ACS-5000 Master board"
-	help
-	  say 'Y' here if you want your kernel to run on the Brivo
-	  Systems LLC, ACS-5000 Master board.
-
-config MACH_LITE300
-	bool "SecureComputing SG300"
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  SecureComputing / SnapGear SG300 VPN Internet Router.
-	  See http://www.securecomputing.com for more details.
-
-config MACH_SG310
-	bool "McAfee SG310"
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  McAfee / SnapGear SG310 VPN Internet Router.
-	  See http://www.mcafee.com for more details.
-
-config MACH_SE4200
-	bool "SecureComputing SE4200"
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  SecureComputing / SnapGear SE4200 Secure Wireless VPN
-	  Internet Router.
-	  See http://www.securecomputing.com for more details.
-
-config MACH_CM4002
-	bool "OpenGear CM4002"
-	help
-	  Say 'Y' here if you want your kernel to support the OpenGear
-	  CM4002 Secure Access Server. See http://www.opengear.com for
-	  more details.
-
-config MACH_CM4008
-	bool "OpenGear CM4008"
-	select HAVE_PCI
-	help
-	  Say 'Y' here if you want your kernel to support the OpenGear
-	  CM4008 Console Server. See http://www.opengear.com for more
-	  details.
-
-config MACH_CM41xx
-	bool "OpenGear CM41xx"
-	select HAVE_PCI
-	help
-	  Say 'Y' here if you want your kernel to support the OpenGear
-	  CM4016 or CM4048 Console Servers. See http://www.opengear.com for
-	  more details.
-
-config MACH_IM4004
-	bool "OpenGear IM4004"
-	select HAVE_PCI
-	help
-	  Say 'Y' here if you want your kernel to support the OpenGear
-	  IM4004 Secure Access Server. See http://www.opengear.com for
-	  more details.
-
-config MACH_IM42xx
-	bool "OpenGear IM42xx"
-	select HAVE_PCI
-	help
-	  Say 'Y' here if you want your kernel to support the OpenGear
-	  IM4216 or IM4248 Console Servers. See http://www.opengear.com for
-	  more details.
-
-endmenu
-
-endif
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 @@
-# SPDX-License-Identifier: GPL-2.0
-# arch/arm/mach-ks8695/Makefile
-#
-# Makefile for KS8695 architecture support
-#
-
-obj-y				:= cpu.o irq.o time.o devices.o
-
-# PCI support is optional
-obj-$(CONFIG_PCI)		+= pci.o
-
-# Board-specific support
-obj-$(CONFIG_MACH_KS8695)	+= board-micrel.o
-obj-$(CONFIG_MACH_DSM320)	+= board-dsm320.o
-obj-$(CONFIG_MACH_ACS5K)	+= board-acs5k.o
-obj-$(CONFIG_MACH_LITE300)	+= board-sg.o
-obj-$(CONFIG_MACH_SG310)	+= board-sg.o
-obj-$(CONFIG_MACH_SE4200)	+= board-sg.o
-obj-$(CONFIG_MACH_CM4002)	+= board-og.o
-obj-$(CONFIG_MACH_CM4008)	+= board-og.o
-obj-$(CONFIG_MACH_CM41xx)	+= board-og.o
-obj-$(CONFIG_MACH_IM4004)	+= board-og.o
-obj-$(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 @@
-# SPDX-License-Identifier: GPL-2.0-only
-# Note: the following conditions must always be true:
-#   ZRELADDR == virt_to_phys(TEXTADDR)
-#   PARAMS_PHYS must be within 4MB of ZRELADDR
-#   INITRD_PHYS must be in RAM
-
-   zreladdr-y	+= 0x00008000
-params_phys-y	:= 0x00000100
-initrd_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * arch/arm/mach-ks8695/board-acs5k.c
- *
- * Brivo Systems LLC, ACS-5000 Master Board
- *
- * Copyright 2008 Simtec Electronics
- *		  Daniel Silverstone <dsilvers@simtec.co.uk>
- */
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/gpio/machine.h>
-#include <linux/i2c.h>
-#include <linux/i2c-algo-bit.h>
-#include <linux/platform_data/i2c-gpio.h>
-#include <linux/platform_data/pca953x.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/mach-types.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include "devices.h"
-#include <mach/gpio-ks8695.h>
-
-#include "generic.h"
-
-static struct gpiod_lookup_table acs5k_i2c_gpiod_table = {
-	.dev_id		= "i2c-gpio",
-	.table		= {
-		GPIO_LOOKUP_IDX("KS8695", 4, NULL, 0,
-				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
-		GPIO_LOOKUP_IDX("KS8695", 5, NULL, 1,
-				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
-	},
-};
-
-static struct i2c_gpio_platform_data acs5k_i2c_device_platdata = {
-	.udelay		= 10,
-};
-
-static struct platform_device acs5k_i2c_device = {
-	.name		= "i2c-gpio",
-	.id		= -1,
-	.num_resources	= 0,
-	.resource	= NULL,
-	.dev		= {
-		.platform_data	= &acs5k_i2c_device_platdata,
-	},
-};
-
-static int acs5k_pca9555_setup(struct i2c_client *client,
-			       unsigned gpio_base, unsigned ngpio,
-			       void *context)
-{
-	static int acs5k_gpio_value[] = {
-		-1, -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, 0, 1, 0, -1, -1
-	};
-	int n;
-
-	for (n = 0; n < ARRAY_SIZE(acs5k_gpio_value); ++n) {
-		gpio_request(gpio_base + n, "ACS-5000 GPIO Expander");
-		if (acs5k_gpio_value[n] < 0)
-			gpio_direction_input(gpio_base + n);
-		else
-			gpio_direction_output(gpio_base + n,
-					      acs5k_gpio_value[n]);
-		gpio_export(gpio_base + n, 0); /* Export, direction locked down */
-	}
-
-	return 0;
-}
-
-static struct pca953x_platform_data acs5k_i2c_pca9555_platdata = {
-	.gpio_base	= 16, /* Start directly after the CPU's GPIO */
-	.invert		= 0, /* Do not invert */
-	.setup		= acs5k_pca9555_setup,
-};
-
-static struct i2c_board_info acs5k_i2c_devs[] __initdata = {
-	{
-		I2C_BOARD_INFO("pcf8563", 0x51),
-	},
-	{
-		I2C_BOARD_INFO("pca9555", 0x20),
-		.platform_data = &acs5k_i2c_pca9555_platdata,
-	},
-};
-
-static void __init acs5k_i2c_init(void)
-{
-	/* The gpio interface */
-	gpiod_add_lookup_table(&acs5k_i2c_gpiod_table);
-	platform_device_register(&acs5k_i2c_device);
-	/* I2C devices */
-	i2c_register_board_info(0, acs5k_i2c_devs,
-				ARRAY_SIZE(acs5k_i2c_devs));
-}
-
-static struct mtd_partition acs5k_nor_partitions[] = {
-	[0] = {
-		.name	= "Boot Agent and config",
-		.size	= SZ_256K,
-		.offset	= 0,
-		.mask_flags = MTD_WRITEABLE,
-	},
-	[1] = {
-		.name	= "Kernel",
-		.size	= SZ_1M,
-		.offset	= SZ_256K,
-	},
-	[2] = {
-		.name	= "SquashFS1",
-		.size	= SZ_2M,
-		.offset	= SZ_256K + SZ_1M,
-	},
-	[3] = {
-		.name	= "SquashFS2",
-		.size	= SZ_4M + SZ_2M,
-		.offset	= SZ_256K + SZ_1M + SZ_2M,
-	},
-	[4] = {
-		.name	= "Data",
-		.size	= SZ_16M + SZ_4M + SZ_2M + SZ_512K, /* 22.5 MB */
-		.offset	= SZ_256K + SZ_8M + SZ_1M,
-	}
-};
-
-static struct physmap_flash_data acs5k_nor_pdata = {
-	.width		= 4,
-	.nr_parts	= ARRAY_SIZE(acs5k_nor_partitions),
-	.parts		= acs5k_nor_partitions,
-};
-
-static struct resource acs5k_nor_resource[] = {
-	[0] = {
-		.start = SZ_32M, /* We expect the bootloader to map
-				  * the flash here.
-				  */
-		.end   = SZ_32M + SZ_16M - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = SZ_32M + SZ_16M,
-		.end   = SZ_32M + SZ_32M - SZ_256K - 1,
-		.flags = IORESOURCE_MEM,
-	}
-};
-
-static struct platform_device acs5k_device_nor = {
-	.name		= "physmap-flash",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(acs5k_nor_resource),
-	.resource	= acs5k_nor_resource,
-	.dev		= {
-		.platform_data = &acs5k_nor_pdata,
-	},
-};
-
-static void __init acs5k_register_nor(void)
-{
-	int ret;
-
-	if (acs5k_nor_partitions[0].mask_flags == 0)
-		printk(KERN_WARNING "Warning: Unprotecting bootloader and configuration partition\n");
-
-	ret = platform_device_register(&acs5k_device_nor);
-	if (ret < 0)
-		printk(KERN_ERR "failed to register physmap-flash device\n");
-}
-
-static int __init acs5k_protection_setup(char *s)
-{
-	/* We can't allocate anything here but we should be able
-	 * to trivially parse s and decide if we can protect the
-	 * bootloader partition or not
-	 */
-	if (strcmp(s, "no") == 0)
-		acs5k_nor_partitions[0].mask_flags = 0;
-
-	return 1;
-}
-
-__setup("protect_bootloader=", acs5k_protection_setup);
-
-static void __init acs5k_init_gpio(void)
-{
-	int i;
-
-	ks8695_register_gpios();
-	for (i = 0; i < 4; ++i)
-		gpio_request(i, "ACS5K IRQ");
-	gpio_request(7, "ACS5K KS_FRDY");
-	for (i = 8; i < 16; ++i)
-		gpio_request(i, "ACS5K Unused");
-
-	gpio_request(3, "ACS5K CAN Control");
-	gpio_request(6, "ACS5K Heartbeat");
-	gpio_direction_output(3, 1); /* Default CAN_RESET high */
-	gpio_direction_output(6, 0); /* Default KS8695_ACTIVE low */
-	gpio_export(3, 0); /* export CAN_RESET as output only */
-	gpio_export(6, 0); /* export KS8695_ACTIVE as output only */
-}
-
-static void __init acs5k_init(void)
-{
-	acs5k_init_gpio();
-
-	/* Network device */
-	ks8695_add_device_lan();	/* eth0 = LAN */
-	ks8695_add_device_wan();	/* ethX = WAN */
-
-	/* NOR devices */
-	acs5k_register_nor();
-
-	/* I2C bus */
-	acs5k_i2c_init();
-}
-
-MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
-	/* Maintainer: Simtec Electronics. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= acs5k_init,
-	.init_time	= ks8695_timer_init,
-	.restart	= ks8695_restart,
-MACHINE_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * arch/arm/mach-ks8695/board-dsm320.c
- *
- * DSM-320 D-Link Wireless Media Player, board support.
- *
- * Copyright 2008 Simtec Electronics
- *		  Daniel Silverstone <dsilvers@simtec.co.uk>
- */
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/mach-types.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include "devices.h"
-#include <mach/gpio-ks8695.h>
-
-#include "generic.h"
-
-#ifdef CONFIG_PCI
-static int dsm320_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
-{
-	switch (slot) {
-	case 0:
-		/* PCI-AHB bridge? */
-		return KS8695_IRQ_EXTERN0;
-	case 18:
-		/* Mini PCI slot */
-		return KS8695_IRQ_EXTERN2;
-	case 20:
-		/* RealMAGIC chip */
-		return KS8695_IRQ_EXTERN0;
-	}
-	BUG();
-}
-
-static struct ks8695_pci_cfg __initdata dsm320_pci = {
-	.mode		= KS8695_MODE_MINIPCI,
-	.map_irq	= dsm320_pci_map_irq,
-};
-
-static void __init dsm320_register_pci(void)
-{
-	/* Initialise the GPIO lines for interrupt mode */
-	/* RealMAGIC */
-	ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
-	/* MiniPCI Slot */
-	ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW);
-
-	ks8695_init_pci(&dsm320_pci);
-}
-
-#else
-static inline void __init dsm320_register_pci(void) { }
-#endif
-
-static struct physmap_flash_data dsm320_nor_pdata = {
-	.width		= 4,
-	.nr_parts	= 0,
-};
-
-static struct resource dsm320_nor_resource[] = {
-	[0] = {
-		.start = SZ_32M, /* We expect the bootloader to map
-				  * the flash here.
-				  */
-		.end   = SZ_32M + SZ_4M - 1,
-		.flags = IORESOURCE_MEM,
-	}
-};
-
-static struct platform_device dsm320_device_nor = {
-	.name		= "physmap-flash",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(dsm320_nor_resource),
-	.resource	= dsm320_nor_resource,
-	.dev		= {
-		.platform_data = &dsm320_nor_pdata,
-	},
-};
-
-void __init dsm320_register_nor(void)
-{
-	int ret;
-
-	ret = platform_device_register(&dsm320_device_nor);
-	if (ret < 0)
-		printk(KERN_ERR "failed to register physmap-flash device\n");
-}
-
-static void __init dsm320_init(void)
-{
-	/* GPIO registration */
-	ks8695_register_gpios();
-
-	/* PCI registration */
-	dsm320_register_pci();
-
-	/* Network device */
-	ks8695_add_device_lan();	/* eth0 = LAN */
-
-	/* NOR devices */
-	dsm320_register_nor();
-}
-
-MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
-	/* Maintainer: Simtec Electronics. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= dsm320_init,
-	.init_time	= ks8695_timer_init,
-	.restart	= ks8695_restart,
-MACHINE_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * arch/arm/mach-ks8695/board-micrel.c
- */
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-
-#include <asm/mach-types.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include <mach/gpio-ks8695.h>
-#include "devices.h"
-
-#include "generic.h"
-
-#ifdef CONFIG_PCI
-static int micrel_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
-{
-	return KS8695_IRQ_EXTERN0;
-}
-
-static struct ks8695_pci_cfg __initdata micrel_pci = {
-	.mode		= KS8695_MODE_MINIPCI,
-	.map_irq	= micrel_pci_map_irq,
-};
-#endif
-
-
-static void __init micrel_init(void)
-{
-	printk(KERN_INFO "Micrel KS8695 Development Board initializing\n");
-
-	ks8695_register_gpios();
-
-#ifdef CONFIG_PCI
-	ks8695_init_pci(&micrel_pci);
-#endif
-
-	/* Add devices */
-	ks8695_add_device_wan();	/* eth0 = WAN */
-	ks8695_add_device_lan();	/* eth1 = LAN */
-}
-
-MACHINE_START(KS8695, "KS8695 Centaur Development Board")
-	/* Maintainer: Micrel Semiconductor Inc. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= micrel_init,
-	.init_time	= ks8695_timer_init,
-	.restart	= ks8695_restart,
-MACHINE_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * board-og.c -- support for the OpenGear KS8695 based boards.
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/platform_device.h>
-#include <linux/serial_8250.h>
-#include <linux/gpio.h>
-#include <linux/irq.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include "devices.h"
-#include <mach/regs-gpio.h>
-#include <mach/gpio-ks8695.h>
-#include "generic.h"
-
-static int og_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
-{
-	if (machine_is_im4004() && (slot == 8))
-		return KS8695_IRQ_EXTERN1;
-	return KS8695_IRQ_EXTERN0;
-}
-
-static struct ks8695_pci_cfg __initdata og_pci = {
-	.mode		= KS8695_MODE_PCI,
-	.map_irq	= og_pci_map_irq,
-};
-
-static void __init og_register_pci(void)
-{
-	/* Initialize the GPIO lines for interrupt mode */
-	ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
-
-	/* Cardbus Slot */
-	if (machine_is_im4004())
-		ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW);
-
-	if (IS_ENABLED(CONFIG_PCI))
-		ks8695_init_pci(&og_pci);
-}
-
-/*
- * The PCI bus reset is driven by a dedicated GPIO line. Toggle it here
- * and bring the PCI bus out of reset.
- */
-static void __init og_pci_bus_reset(void)
-{
-	unsigned int rstline = 1;
-
-	/* Some boards use a different GPIO as the PCI reset line */
-	if (machine_is_im4004())
-		rstline = 2;
-	else if (machine_is_im42xx())
-		rstline = 0;
-
-	gpio_request(rstline, "PCI reset");
-	gpio_direction_output(rstline, 0);
-
-	/* Drive a reset on the PCI reset line */
-	gpio_set_value(rstline, 1);
-	gpio_set_value(rstline, 0);
-	mdelay(100);
-	gpio_set_value(rstline, 1);
-	mdelay(100);
-}
-
-/*
- * Direct connect serial ports (non-PCI that is).
- */
-#define	S8250_PHYS	0x03800000
-#define	S8250_VIRT	0xf4000000
-#define	S8250_SIZE	0x00100000
-
-static struct map_desc og_io_desc[] __initdata = {
-	{
-		.virtual	= S8250_VIRT,
-		.pfn		= __phys_to_pfn(S8250_PHYS),
-		.length		= S8250_SIZE,
-		.type		= MT_DEVICE,
-	}
-};
-
-static struct resource og_uart_resources[] = {
-	{
-		.start		= S8250_VIRT,
-		.end		= S8250_VIRT + S8250_SIZE,
-		.flags		= IORESOURCE_MEM
-	},
-};
-
-static struct plat_serial8250_port og_uart_data[] = {
-	{
-		.mapbase	= S8250_VIRT,
-		.membase	= (char *) S8250_VIRT,
-		.irq		= 3,
-		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
-		.iotype		= UPIO_MEM,
-		.regshift	= 2,
-		.uartclk	= 115200 * 16,
-	},
-	{ },
-};
-
-static struct platform_device og_uart = {
-	.name			= "serial8250",
-	.id			= 0,
-	.dev.platform_data	= og_uart_data,
-	.num_resources		= 1,
-	.resource		= og_uart_resources
-};
-
-static struct platform_device *og_devices[] __initdata = {
-	&og_uart
-};
-
-static void __init og_init(void)
-{
-	ks8695_register_gpios();
-
-	if (machine_is_cm4002()) {
-		ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_HIGH);
-		iotable_init(og_io_desc, ARRAY_SIZE(og_io_desc));
-		platform_add_devices(og_devices, ARRAY_SIZE(og_devices));
-	} else {
-		og_pci_bus_reset();
-		og_register_pci();
-	}
-
-	ks8695_add_device_lan();
-	ks8695_add_device_wan();
-}
-
-#ifdef CONFIG_MACH_CM4002
-MACHINE_START(CM4002, "OpenGear/CM4002")
-	/* OpenGear Inc. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= og_init,
-	.init_time	= ks8695_timer_init,
-	.restart        = ks8695_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_CM4008
-MACHINE_START(CM4008, "OpenGear/CM4008")
-	/* OpenGear Inc. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= og_init,
-	.init_time	= ks8695_timer_init,
-	.restart        = ks8695_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_CM41xx
-MACHINE_START(CM41XX, "OpenGear/CM41xx")
-	/* OpenGear Inc. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= og_init,
-	.init_time	= ks8695_timer_init,
-	.restart        = ks8695_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_IM4004
-MACHINE_START(IM4004, "OpenGear/IM4004")
-	/* OpenGear Inc. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= og_init,
-	.init_time	= ks8695_timer_init,
-	.restart        = ks8695_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_IM42xx
-MACHINE_START(IM42XX, "OpenGear/IM42xx")
-	/* OpenGear Inc. */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= og_init,
-	.init_time	= ks8695_timer_init,
-	.restart        = ks8695_restart,
-MACHINE_END
-#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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * board-sg.c -- support for the SnapGear KS8695 based boards
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/partitions.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include "devices.h"
-#include "generic.h"
-
-/*
- * The SG310 machine type is fitted with a conventional 8MB Strataflash
- * device. Define its partitioning.
- */
-#define	FL_BASE		0x02000000
-#define	FL_SIZE		SZ_8M
-
-static struct mtd_partition sg_mtd_partitions[] = {
-	[0] = {
-		.name	= "SnapGear Boot Loader",
-		.size	= SZ_128K,
-	},
-	[1] = {
-		.name	= "SnapGear non-volatile configuration",
-		.size	= SZ_512K,
-		.offset	= SZ_256K,
-	},
-	[2] = {
-		.name	= "SnapGear image",
-		.offset	= SZ_512K + SZ_256K,
-	},
-	[3] = {
-		.name	= "SnapGear StrataFlash",
-	},
-	[4] = {
-		.name	= "SnapGear Boot Tags",
-		.size	= SZ_128K,
-		.offset	= SZ_128K,
-	},
-};
-
-static struct physmap_flash_data sg_mtd_pdata = {
-	.width		= 1,
-	.nr_parts	= ARRAY_SIZE(sg_mtd_partitions),
-	.parts		= sg_mtd_partitions,
-};
-
-
-static struct resource sg_mtd_resource[] = {
-	[0] = {
-		.start = FL_BASE,
-		.end   = FL_BASE + FL_SIZE - 1,
-		.flags = IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device sg_mtd_device = {
-	.name		= "physmap-flash",
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(sg_mtd_resource),
-	.resource	= sg_mtd_resource,
-	.dev		= {
-		.platform_data = &sg_mtd_pdata,
-	},
-};
-
-static void __init sg_init(void)
-{
-	ks8695_add_device_lan();
-	ks8695_add_device_wan();
-
-	if (machine_is_sg310())
-		platform_device_register(&sg_mtd_device);
-}
-
-#ifdef CONFIG_MACH_LITE300
-MACHINE_START(LITE300, "SecureComputing/SG300")
-	/* SnapGear */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= sg_init,
-	.init_time	= ks8695_timer_init,
-	.restart	= ks8695_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_SG310
-MACHINE_START(SG310, "McAfee/SG310")
-	/* SnapGear */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= sg_init,
-	.init_time	= ks8695_timer_init,
-	.restart	= ks8695_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_SE4200
-MACHINE_START(SE4200, "SecureComputing/SE4200")
-	/* SnapGear */
-	.atag_offset	= 0x100,
-	.map_io		= ks8695_map_io,
-	.init_irq	= ks8695_init_irq,
-	.init_machine	= sg_init,
-	.init_time	= ks8695_timer_init,
-	.restart	= ks8695_restart,
-MACHINE_END
-#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 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * arch/arm/mach-ks8695/cpu.c
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 CPU support
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include "regs-sys.h"
-#include <mach/regs-misc.h>
-
-
-static struct map_desc ks8695_io_desc[] __initdata = {
-	{
-		.virtual	= (unsigned long)KS8695_IO_VA,
-		.pfn		= __phys_to_pfn(KS8695_IO_PA),
-		.length		= KS8695_IO_SIZE,
-		.type		= MT_DEVICE,
-	}
-};
-
-static void __init ks8695_processor_info(void)
-{
-	unsigned long id, rev;
-
-	id = __raw_readl(KS8695_MISC_VA + KS8695_DID);
-	rev = __raw_readl(KS8695_MISC_VA + KS8695_RID);
-
-	printk("KS8695 ID=%04lx  SubID=%02lx  Revision=%02lx\n", (id & DID_ID), (rev & RID_SUBID), (rev & RID_REVISION));
-}
-
-static unsigned int sysclk[8] = { 125000000, 100000000, 62500000, 50000000, 41700000, 33300000, 31300000, 25000000 };
-static unsigned int cpuclk[8] = { 166000000, 166000000, 83000000, 83000000, 55300000, 55300000, 41500000, 41500000 };
-
-static void __init ks8695_clock_info(void)
-{
-	unsigned int scdc = __raw_readl(KS8695_SYS_VA + KS8695_CLKCON) & CLKCON_SCDC;
-
-	printk("Clocks: System %u MHz, CPU %u MHz\n",
-			sysclk[scdc] / 1000000, cpuclk[scdc] / 1000000);
-}
-
-void __init ks8695_map_io(void)
-{
-	iotable_init(ks8695_io_desc, ARRAY_SIZE(ks8695_io_desc));
-
-	ks8695_processor_info();
-	ks8695_clock_info();
-}
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 @@
-/*
- * arch/arm/mach-ks8695/devices.c
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <linux/gpio.h>
-#include <linux/platform_device.h>
-
-#include <mach/irqs.h>
-#include "regs-wan.h"
-#include "regs-lan.h"
-#include "regs-hpna.h"
-#include <mach/regs-switch.h>
-#include <mach/regs-misc.h>
-
-
-/* --------------------------------------------------------------------
- *  Ethernet
- * -------------------------------------------------------------------- */
-
-static u64 eth_dmamask = 0xffffffffUL;
-
-static struct resource ks8695_wan_resources[] = {
-	[0] = {
-		.start	= KS8695_WAN_PA,
-		.end	= KS8695_WAN_PA + 0x00ff,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.name	= "WAN RX",
-		.start	= KS8695_IRQ_WAN_RX_STATUS,
-		.end	= KS8695_IRQ_WAN_RX_STATUS,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.name	= "WAN TX",
-		.start	= KS8695_IRQ_WAN_TX_STATUS,
-		.end	= KS8695_IRQ_WAN_TX_STATUS,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
-		.name	= "WAN Link",
-		.start	= KS8695_IRQ_WAN_LINK,
-		.end	= KS8695_IRQ_WAN_LINK,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[4] = {
-		.name	= "WAN PHY",
-		.start	= KS8695_MISC_PA,
-		.end	= KS8695_MISC_PA + 0x1f,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device ks8695_wan_device = {
-	.name		= "ks8695_ether",
-	.id		= 0,
-	.dev		= {
-				.dma_mask		= &eth_dmamask,
-				.coherent_dma_mask	= 0xffffffff,
-	},
-	.resource	= ks8695_wan_resources,
-	.num_resources	= ARRAY_SIZE(ks8695_wan_resources),
-};
-
-
-static struct resource ks8695_lan_resources[] = {
-	[0] = {
-		.start	= KS8695_LAN_PA,
-		.end	= KS8695_LAN_PA + 0x00ff,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.name	= "LAN RX",
-		.start	= KS8695_IRQ_LAN_RX_STATUS,
-		.end	= KS8695_IRQ_LAN_RX_STATUS,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.name	= "LAN TX",
-		.start	= KS8695_IRQ_LAN_TX_STATUS,
-		.end	= KS8695_IRQ_LAN_TX_STATUS,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
-		.name	= "LAN SWITCH",
-		.start	= KS8695_SWITCH_PA,
-		.end	= KS8695_SWITCH_PA + 0x4f,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device ks8695_lan_device = {
-	.name		= "ks8695_ether",
-	.id		= 1,
-	.dev		= {
-				.dma_mask		= &eth_dmamask,
-				.coherent_dma_mask	= 0xffffffff,
-	},
-	.resource	= ks8695_lan_resources,
-	.num_resources	= ARRAY_SIZE(ks8695_lan_resources),
-};
-
-
-static struct resource ks8695_hpna_resources[] = {
-	[0] = {
-		.start	= KS8695_HPNA_PA,
-		.end	= KS8695_HPNA_PA + 0x00ff,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.name	= "HPNA RX",
-		.start	= KS8695_IRQ_HPNA_RX_STATUS,
-		.end	= KS8695_IRQ_HPNA_RX_STATUS,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.name	= "HPNA TX",
-		.start	= KS8695_IRQ_HPNA_TX_STATUS,
-		.end	= KS8695_IRQ_HPNA_TX_STATUS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct platform_device ks8695_hpna_device = {
-	.name		= "ks8695_ether",
-	.id		= 2,
-	.dev		= {
-				.dma_mask		= &eth_dmamask,
-				.coherent_dma_mask	= 0xffffffff,
-	},
-	.resource	= ks8695_hpna_resources,
-	.num_resources	= ARRAY_SIZE(ks8695_hpna_resources),
-};
-
-void __init ks8695_add_device_wan(void)
-{
-	platform_device_register(&ks8695_wan_device);
-}
-
-void __init ks8695_add_device_lan(void)
-{
-	platform_device_register(&ks8695_lan_device);
-}
-
-void __init ks8696_add_device_hpna(void)
-{
-	platform_device_register(&ks8695_hpna_device);
-}
-
-
-/* --------------------------------------------------------------------
- *  Watchdog
- * -------------------------------------------------------------------- */
-
-static struct platform_device ks8695_wdt_device = {
-	.name		= "ks8695_wdt",
-	.id		= -1,
-	.num_resources	= 0,
-};
-
-static void __init ks8695_add_device_watchdog(void)
-{
-	platform_device_register(&ks8695_wdt_device);
-}
-
-
-/* -------------------------------------------------------------------- */
-
-/*
- * These devices are always present and don't need any board-specific
- * setup.
- */
-static int __init ks8695_add_standard_devices(void)
-{
-	ks8695_add_device_watchdog();
-	return 0;
-}
-
-arch_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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-ks8695/include/mach/devices.h
- *
- * Copyright (C) 2006 Andrew Victor
- */
-
-#ifndef __ASM_ARCH_DEVICES_H
-#define __ASM_ARCH_DEVICES_H
-
-#include <linux/pci.h>
-
- /* Ethernet */
-extern void __init ks8695_add_device_wan(void);
-extern void __init ks8695_add_device_lan(void);
-extern void __init ks8695_add_device_hpna(void);
-
- /* PCI */
-#define KS8695_MODE_PCI		0
-#define KS8695_MODE_MINIPCI	1
-#define KS8695_MODE_CARDBUS	2
-
-struct ks8695_pci_cfg {
-	short mode;
-	int (*map_irq)(const struct pci_dev *, u8, u8);
-};
-extern __init void ks8695_init_pci(struct ks8695_pci_cfg *);
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-ks8695/generic.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
-*/
-
-extern __init void ks8695_map_io(void);
-extern __init void ks8695_init_irq(void);
-extern void ks8695_restart(enum reboot_mode, const char *);
-extern 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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/entry-macro.S
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * Low-level IRQ helper macros for KS8695
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
-*/
-
-#include <mach/hardware.h>
-#include <mach/regs-irq.h>
-
-	.macro  get_irqnr_preamble, base, tmp
-		ldr	\base, =KS8695_IRQ_VA			@ Base address of interrupt controller
-	.endm
-
-	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
-		ldr	\irqstat, [\base, #KS8695_INTMS]	@ Mask Status register
-
-		teq	\irqstat, #0
-		beq	1001f
-
-		mov	\irqnr, #0
-
-		tst	\irqstat, #0xff
-		moveq	\irqstat, \irqstat, lsr #8
-		addeq	\irqnr, \irqnr, #8
-		tsteq	\irqstat, #0xff
-		moveq	\irqstat, \irqstat, lsr #8
-		addeq	\irqnr, \irqnr, #8
-		tsteq	\irqstat, #0xff
-		moveq	\irqstat, \irqstat, lsr #8
-		addeq	\irqnr, \irqnr, #8
-		tst	\irqstat, #0x0f
-		moveq	\irqstat, \irqstat, lsr #4
-		addeq	\irqnr, \irqnr, #4
-		tst	\irqstat, #0x03
-		moveq	\irqstat, \irqstat, lsr #2
-		addeq	\irqnr, \irqnr, #2
-		tst	\irqstat, #0x01
-		addseq	\irqnr, \irqnr, #1
-1001:
-	.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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (C) 2006 Andrew Victor
- */
-
-#ifndef __MACH_KS8659_GPIO_H
-#define __MACH_KS8659_GPIO_H
-
-#include <linux/kernel.h>
-
-#define KS8695_GPIO_0		0
-#define KS8695_GPIO_1		1
-#define KS8695_GPIO_2		2
-#define KS8695_GPIO_3		3
-#define KS8695_GPIO_4		4
-#define KS8695_GPIO_5		5
-#define KS8695_GPIO_6		6
-#define KS8695_GPIO_7		7
-#define KS8695_GPIO_8		8
-#define KS8695_GPIO_9		9
-#define KS8695_GPIO_10		10
-#define KS8695_GPIO_11		11
-#define KS8695_GPIO_12		12
-#define KS8695_GPIO_13		13
-#define KS8695_GPIO_14		14
-#define KS8695_GPIO_15		15
-
-/*
- * Configure GPIO pin as external interrupt source.
- */
-extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
-
-/* Register the GPIOs */
-extern void ks8695_register_gpios(void);
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-ks8695/include/mach/hardware.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - Memory Map definitions
-*/
-
-#ifndef __ASM_ARCH_HARDWARE_H
-#define __ASM_ARCH_HARDWARE_H
-
-#include <linux/sizes.h>
-
-/*
- * Clocks are derived from MCLK, which is 25MHz
- */
-#define KS8695_CLOCK_RATE	25000000
-
-/*
- * Physical RAM address.
- */
-#define KS8695_SDRAM_PA		0x00000000
-
-
-/*
- * We map an entire MiB with the System Configuration Registers in even
- * though only 64KiB is needed. This makes it easier for use with the
- * head debug code as the initial MMU setup only deals in L1 sections.
- */
-#define KS8695_IO_PA		0x03F00000
-#define KS8695_IO_VA		IOMEM(0xF0000000)
-#define KS8695_IO_SIZE		SZ_1M
-
-#define KS8695_PCIMEM_PA	0x60000000
-#define KS8695_PCIMEM_SIZE	SZ_512M
-
-#define KS8695_PCIIO_PA		0x80000000
-#define KS8695_PCIIO_SIZE	SZ_64K
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-ks8695/include/mach/irqs.h
- *
- * Copyright (C) 2006 Simtec Electronics
- *   Ben Dooks <ben@simtec.co.uk>
- */
-
-#ifndef __ASM_ARCH_IRQS_H
-#define __ASM_ARCH_IRQS_H
-
-
-#define NR_IRQS				32
-
-/*
- * IRQ definitions
- */
-#define KS8695_IRQ_COMM_RX		0
-#define KS8695_IRQ_COMM_TX		1
-#define KS8695_IRQ_EXTERN0		2
-#define KS8695_IRQ_EXTERN1		3
-#define KS8695_IRQ_EXTERN2		4
-#define KS8695_IRQ_EXTERN3		5
-#define KS8695_IRQ_TIMER0		6
-#define KS8695_IRQ_TIMER1		7
-#define KS8695_IRQ_UART_TX		8
-#define KS8695_IRQ_UART_RX		9
-#define KS8695_IRQ_UART_LINE_STATUS	10
-#define KS8695_IRQ_UART_MODEM_STATUS	11
-#define KS8695_IRQ_LAN_RX_STOP		12
-#define KS8695_IRQ_LAN_TX_STOP		13
-#define KS8695_IRQ_LAN_RX_BUF		14
-#define KS8695_IRQ_LAN_TX_BUF		15
-#define KS8695_IRQ_LAN_RX_STATUS	16
-#define KS8695_IRQ_LAN_TX_STATUS	17
-#define KS8695_IRQ_HPNA_RX_STOP		18
-#define KS8695_IRQ_HPNA_TX_STOP		19
-#define KS8695_IRQ_HPNA_RX_BUF		20
-#define KS8695_IRQ_HPNA_TX_BUF		21
-#define KS8695_IRQ_HPNA_RX_STATUS	22
-#define KS8695_IRQ_HPNA_TX_STATUS	23
-#define KS8695_IRQ_BUS_ERROR		24
-#define KS8695_IRQ_WAN_RX_STOP		25
-#define KS8695_IRQ_WAN_TX_STOP		26
-#define KS8695_IRQ_WAN_RX_BUF		27
-#define KS8695_IRQ_WAN_TX_BUF		28
-#define KS8695_IRQ_WAN_RX_STATUS	29
-#define KS8695_IRQ_WAN_TX_STATUS	30
-#define KS8695_IRQ_WAN_LINK		31
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/memory.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * KS8695 Memory definitions
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_ARCH_MEMORY_H
-#define __ASM_ARCH_MEMORY_H
-
-#include <mach/hardware.h>
-
-#ifndef __ASSEMBLY__
-
-#ifdef CONFIG_PCI
-
-/* PCI mappings */
-#define __virt_to_bus(x)	((x) - PAGE_OFFSET + KS8695_PCIMEM_PA)
-#define __bus_to_virt(x)	((x) - KS8695_PCIMEM_PA + PAGE_OFFSET)
-
-/* Platform-bus mapping */
-extern struct bus_type platform_bus_type;
-#define is_lbus_device(dev)		(dev && dev->bus == &platform_bus_type)
-#define __arch_dma_to_virt(dev, x)	({ (void *) (is_lbus_device(dev) ? \
-					__phys_to_virt(x) : __bus_to_virt(x)); })
-#define __arch_virt_to_dma(dev, x)	({ is_lbus_device(dev) ? \
-					(dma_addr_t)__virt_to_phys((unsigned long)x) \
-					: (dma_addr_t)__virt_to_bus(x); })
-#define __arch_pfn_to_dma(dev, pfn)	\
-	({ dma_addr_t __dma = __pfn_to_phys(pfn); \
-	   if (!is_lbus_device(dev)) \
-		__dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
-	   __dma; })
-
-#define __arch_dma_to_pfn(dev, x)	\
-	({ dma_addr_t __dma = x;				\
-	   if (!is_lbus_device(dev))				\
-		__dma += PHYS_OFFSET - KS8695_PCIMEM_PA;	\
-	   __phys_to_pfn(__dma);				\
-	})
-
-#endif
-
-#endif
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-gpio.h
- *
- * Copyright (C) 2007 Andrew Victor
- *
- * KS8695 - GPIO control registers and bit definitions.
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_GPIO_H
-#define KS8695_GPIO_H
-
-#define KS8695_GPIO_OFFSET	(0xF0000 + 0xE600)
-#define KS8695_GPIO_VA		(KS8695_IO_VA + KS8695_GPIO_OFFSET)
-#define KS8695_GPIO_PA		(KS8695_IO_PA + KS8695_GPIO_OFFSET)
-
-
-#define KS8695_IOPM		(0x00)		/* I/O Port Mode Register */
-#define KS8695_IOPC		(0x04)		/* I/O Port Control Register */
-#define KS8695_IOPD		(0x08)		/* I/O Port Data Register */
-
-
-/* Port Mode Register */
-#define IOPM(x)			(1 << (x))	/* Mode for GPIO Pin x */
-
-/* Port Control Register */
-#define IOPC_IOTIM1EN		(1 << 17)	/* GPIO Pin for Timer1 Enable */
-#define IOPC_IOTIM0EN		(1 << 16)	/* GPIO Pin for Timer0 Enable */
-#define IOPC_IOEINT3EN		(1 << 15)	/* GPIO Pin for External/Soft Interrupt 3 Enable */
-#define IOPC_IOEINT3TM		(7 << 12)	/* GPIO Pin for External/Soft Interrupt 3 Trigger Mode */
-#define IOPC_IOEINT3_MODE(x)	((x) << 12)
-#define IOPC_IOEINT2EN		(1 << 11)	/* GPIO Pin for External/Soft Interrupt 2 Enable */
-#define IOPC_IOEINT2TM		(7 << 8)	/* GPIO Pin for External/Soft Interrupt 2 Trigger Mode */
-#define IOPC_IOEINT2_MODE(x)	((x) << 8)
-#define IOPC_IOEINT1EN		(1 << 7)	/* GPIO Pin for External/Soft Interrupt 1 Enable */
-#define IOPC_IOEINT1TM		(7 << 4)	/* GPIO Pin for External/Soft Interrupt 1 Trigger Mode */
-#define IOPC_IOEINT1_MODE(x)	((x) << 4)
-#define IOPC_IOEINT0EN		(1 << 3)	/* GPIO Pin for External/Soft Interrupt 0 Enable */
-#define IOPC_IOEINT0TM		(7 << 0)	/* GPIO Pin for External/Soft Interrupt 0 Trigger Mode */
-#define IOPC_IOEINT0_MODE(x)	((x) << 0)
-
- /* Trigger Modes */
-#define IOPC_TM_LOW		(0)		/* Level Detection (Active Low) */
-#define IOPC_TM_HIGH		(1)		/* Level Detection (Active High) */
-#define IOPC_TM_RISING		(2)		/* Rising Edge Detection */
-#define IOPC_TM_FALLING		(4)		/* Falling Edge Detection */
-#define IOPC_TM_EDGE		(6)		/* Both Edge Detection */
-
-/* Port Data Register */
-#define IOPD(x)			(1 << (x))	/* Signal Level of GPIO Pin x */
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-irq.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - IRQ registers and bit definitions
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_IRQ_H
-#define KS8695_IRQ_H
-
-#define KS8695_IRQ_OFFSET	(0xF0000 + 0xE200)
-#define KS8695_IRQ_VA		(KS8695_IO_VA + KS8695_IRQ_OFFSET)
-#define KS8695_IRQ_PA		(KS8695_IO_PA + KS8695_IRQ_OFFSET)
-
-
-/*
- * Interrupt Controller registers
- */
-#define KS8695_INTMC		(0x00)		/* Mode Control Register */
-#define KS8695_INTEN		(0x04)		/* Interrupt Enable Register */
-#define KS8695_INTST		(0x08)		/* Interrupt Status Register */
-#define KS8695_INTPW		(0x0c)		/* Interrupt Priority (WAN MAC) */
-#define KS8695_INTPH		(0x10)		/* Interrupt Priority (HPNA) [KS8695 only] */
-#define KS8695_INTPL		(0x14)		/* Interrupt Priority (LAN MAC) */
-#define KS8695_INTPT		(0x18)		/* Interrupt Priority (Timer) */
-#define KS8695_INTPU		(0x1c)		/* Interrupt Priority (UART) */
-#define KS8695_INTPE		(0x20)		/* Interrupt Priority (External Interrupt) */
-#define KS8695_INTPC		(0x24)		/* Interrupt Priority (Communications Channel) */
-#define KS8695_INTPBE		(0x28)		/* Interrupt Priority (Bus Error Response) */
-#define KS8695_INTMS		(0x2c)		/* Interrupt Mask Status Register */
-#define KS8695_INTHPF		(0x30)		/* Interrupt Pending Highest Priority (FIQ) */
-#define KS8695_INTHPI		(0x34)		/* Interrupt Pending Highest Priority (IRQ) */
-
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-misc.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * KS8695 - Miscellaneous Registers
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_MISC_H
-#define KS8695_MISC_H
-
-#define KS8695_MISC_OFFSET	(0xF0000 + 0xEA00)
-#define KS8695_MISC_VA		(KS8695_IO_VA + KS8695_MISC_OFFSET)
-#define KS8695_MISC_PA		(KS8695_IO_PA + KS8695_MISC_OFFSET)
-
-
-/*
- * Miscellaneous registers
- */
-#define KS8695_DID		(0x00)		/* Device ID */
-#define KS8695_RID		(0x04)		/* Revision ID */
-#define KS8695_HMC		(0x08)		/* HPNA Miscellaneous Control [KS8695 only] */
-#define KS8695_WMC		(0x0c)		/* WAN Miscellaneous Control */
-#define KS8695_WPPM		(0x10)		/* WAN PHY Power Management */
-#define KS8695_PPS		(0x1c)		/* PHY PowerSave */
-
-/* Device ID Register */
-#define DID_ID			(0xffff << 0)	/* Device ID */
-
-/* Revision ID Register */
-#define RID_SUBID		(0xf << 4)	/* Sub-Device ID */
-#define RID_REVISION		(0xf << 0)	/* Revision ID */
-
-/* HPNA Miscellaneous Control Register */
-#define HMC_HSS			(1 << 1)	/* Speed */
-#define HMC_HDS			(1 << 0)	/* Duplex */
-
-/* WAN Miscellaneous Control Register */
-#define WMC_WANC		(1 << 30)	/* Auto-negotiation complete */
-#define WMC_WANR		(1 << 29)	/* Auto-negotiation restart */
-#define WMC_WANAP		(1 << 28)	/* Advertise Pause */
-#define WMC_WANA100F		(1 << 27)	/* Advertise 100 FDX */
-#define WMC_WANA100H		(1 << 26)	/* Advertise 100 HDX */
-#define WMC_WANA10F		(1 << 25)	/* Advertise 10 FDX */
-#define WMC_WANA10H		(1 << 24)	/* Advertise 10 HDX */
-#define WMC_WLS			(1 << 23)	/* Link status */
-#define WMC_WDS			(1 << 22)	/* Duplex status */
-#define WMC_WSS			(1 << 21)	/* Speed status */
-#define WMC_WLPP		(1 << 20)	/* Link Partner Pause */
-#define WMC_WLP100F		(1 << 19)	/* Link Partner 100 FDX */
-#define WMC_WLP100H		(1 << 18)	/* Link Partner 100 HDX */
-#define WMC_WLP10F		(1 << 17)	/* Link Partner 10 FDX */
-#define WMC_WLP10H		(1 << 16)	/* Link Partner 10 HDX */
-#define WMC_WAND		(1 << 15)	/* Auto-negotiation disable */
-#define WMC_WANF100		(1 << 14)	/* Force 100 */
-#define WMC_WANFF		(1 << 13)	/* Force FDX */
-#define WMC_WLED1S		(7 <<  4)	/* LED1 Select */
-#define		WLED1S_SPEED		(0 << 4)
-#define		WLED1S_LINK		(1 << 4)
-#define		WLED1S_DUPLEX		(2 << 4)
-#define		WLED1S_COLLISION	(3 << 4)
-#define		WLED1S_ACTIVITY		(4 << 4)
-#define		WLED1S_FDX_COLLISION	(5 << 4)
-#define		WLED1S_LINK_ACTIVITY	(6 << 4)
-#define WMC_WLED0S		(7 << 0)	/* LED0 Select */
-#define		WLED0S_SPEED		(0 << 0)
-#define		WLED0S_LINK		(1 << 0)
-#define		WLED0S_DUPLEX		(2 << 0)
-#define		WLED0S_COLLISION	(3 << 0)
-#define		WLED0S_ACTIVITY		(4 << 0)
-#define		WLED0S_FDX_COLLISION	(5 << 0)
-#define		WLED0S_LINK_ACTIVITY	(6 << 0)
-
-/* WAN PHY Power Management Register */
-#define WPPM_WLPBK		(1 << 14)	/* Local Loopback */
-#define WPPM_WRLPKB		(1 << 13)	/* Remove Loopback */
-#define WPPM_WPI		(1 << 12)	/* PHY isolate */
-#define WPPM_WFL		(1 << 10)	/* Force link */
-#define WPPM_MDIXS		(1 << 9)	/* MDIX Status */
-#define WPPM_FEF		(1 << 8)	/* Far End Fault */
-#define WPPM_AMDIXP		(1 << 7)	/* Auto MDIX Parameter */
-#define WPPM_TXDIS		(1 << 6)	/* Disable transmitter */
-#define WPPM_DFEF		(1 << 5)	/* Disable Far End Fault */
-#define WPPM_PD			(1 << 4)	/* Power Down */
-#define WPPM_DMDX		(1 << 3)	/* Disable Auto MDI/MDIX */
-#define WPPM_FMDX		(1 << 2)	/* Force MDIX */
-#define WPPM_LPBK		(1 << 1)	/* MAX Loopback */
-
-/* PHY Power Save Register */
-#define PPS_PPSM		(1 << 0)	/* PHY Power Save Mode */
-
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-switch.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * KS8695 - Switch Registers and bit definitions.
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_SWITCH_H
-#define KS8695_SWITCH_H
-
-#define KS8695_SWITCH_OFFSET	(0xF0000 + 0xe800)
-#define KS8695_SWITCH_VA	(KS8695_IO_VA + KS8695_SWITCH_OFFSET)
-#define KS8695_SWITCH_PA	(KS8695_IO_PA + KS8695_SWITCH_OFFSET)
-
-
-/*
- * Switch registers
- */
-#define KS8695_SEC0		(0x00)		/* Switch Engine Control 0 */
-#define KS8695_SEC1		(0x04)		/* Switch Engine Control 1 */
-#define KS8695_SEC2		(0x08)		/* Switch Engine Control 2 */
-
-#define KS8695_SEPXCZ(x,z)	(0x0c + (((x)-1)*3 + ((z)-1))*4)	/* Port Configuration Registers */
-
-#define KS8695_SEP12AN		(0x48)		/* Port 1 & 2 Auto-Negotiation */
-#define KS8695_SEP34AN		(0x4c)		/* Port 3 & 4 Auto-Negotiation */
-#define KS8695_SEIAC		(0x50)		/* Indirect Access Control */
-#define KS8695_SEIADH2		(0x54)		/* Indirect Access Data High 2 */
-#define KS8695_SEIADH1		(0x58)		/* Indirect Access Data High 1 */
-#define KS8695_SEIADL		(0x5c)		/* Indirect Access Data Low */
-#define KS8695_SEAFC		(0x60)		/* Advance Feature Control */
-#define KS8695_SEDSCPH		(0x64)		/* TOS Priority High */
-#define KS8695_SEDSCPL		(0x68)		/* TOS Priority Low */
-#define KS8695_SEMAH		(0x6c)		/* Switch Engine MAC Address High */
-#define KS8695_SEMAL		(0x70)		/* Switch Engine MAC Address Low */
-#define KS8695_LPPM12		(0x74)		/* Port 1 & 2 PHY Power Management */
-#define KS8695_LPPM34		(0x78)		/* Port 3 & 4 PHY Power Management */
-
-
-/* Switch Engine Control 0 */
-#define SEC0_LLED1S		(7 << 25)	/* LED1 Select */
-#define		LLED1S_SPEED		(0 << 25)
-#define		LLED1S_LINK		(1 << 25)
-#define		LLED1S_DUPLEX		(2 << 25)
-#define		LLED1S_COLLISION	(3 << 25)
-#define		LLED1S_ACTIVITY		(4 << 25)
-#define		LLED1S_FDX_COLLISION	(5 << 25)
-#define		LLED1S_LINK_ACTIVITY	(6 << 25)
-#define SEC0_LLED0S		(7 << 22)	/* LED0 Select */
-#define		LLED0S_SPEED		(0 << 22)
-#define		LLED0S_LINK		(1 << 22)
-#define		LLED0S_DUPLEX		(2 << 22)
-#define		LLED0S_COLLISION	(3 << 22)
-#define		LLED0S_ACTIVITY		(4 << 22)
-#define		LLED0S_FDX_COLLISION	(5 << 22)
-#define		LLED0S_LINK_ACTIVITY	(6 << 22)
-#define SEC0_ENABLE		(1 << 0)	/* Enable Switch */
-
-
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-ks8695/include/mach/regs-uart.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - UART register and bit definitions.
- */
-
-#ifndef KS8695_UART_H
-#define KS8695_UART_H
-
-#define KS8695_UART_OFFSET	(0xF0000 + 0xE000)
-#define KS8695_UART_VA		(KS8695_IO_VA + KS8695_UART_OFFSET)
-#define KS8695_UART_PA		(KS8695_IO_PA + KS8695_UART_OFFSET)
-
-
-/*
- * UART registers
- */
-#define KS8695_URRB	(0x00)		/* Receive Buffer Register */
-#define KS8695_URTH	(0x04)		/* Transmit Holding Register */
-#define KS8695_URFC	(0x08)		/* FIFO Control Register */
-#define KS8695_URLC	(0x0C)		/* Line Control Register */
-#define KS8695_URMC	(0x10)		/* Modem Control Register */
-#define KS8695_URLS	(0x14)		/* Line Status Register */
-#define KS8695_URMS	(0x18)		/* Modem Status Register */
-#define KS8695_URBD	(0x1C)		/* Baud Rate Divisor Register */
-#define KS8695_USR	(0x20)		/* Status Register */
-
-
-/* FIFO Control Register */
-#define URFC_URFRT	(3 << 6)	/* Receive FIFO Trigger Level */
-#define		URFC_URFRT_1	(0 << 6)
-#define		URFC_URFRT_4	(1 << 6)
-#define		URFC_URFRT_8	(2 << 6)
-#define		URFC_URFRT_14	(3 << 6)
-#define URFC_URTFR	(1 << 2)	/* Transmit FIFO Reset */
-#define URFC_URRFR	(1 << 1)	/* Receive FIFO Reset */
-#define URFC_URFE	(1 << 0)	/* FIFO Enable */
-
-/* Line Control Register */
-#define URLC_URSBC	(1 << 6)	/* Set Break Condition */
-#define URLC_PARITY	(7 << 3)	/* Parity */
-#define		URPE_NONE	(0 << 3)
-#define		URPE_ODD	(1 << 3)
-#define		URPE_EVEN	(3 << 3)
-#define		URPE_MARK	(5 << 3)
-#define		URPE_SPACE	(7 << 3)
-#define URLC_URSB	(1 << 2)	/* Stop Bits */
-#define URLC_URCL	(3 << 0)	/* Character Length */
-#define		URCL_5		(0 << 0)
-#define		URCL_6		(1 << 0)
-#define		URCL_7		(2 << 0)
-#define		URCL_8		(3 << 0)
-
-/* Modem Control Register */
-#define URMC_URLB	(1 << 4)	/* Loop-back mode */
-#define URMC_UROUT2	(1 << 3)	/* OUT2 signal */
-#define URMC_UROUT1	(1 << 2)	/* OUT1 signal */
-#define URMC_URRTS	(1 << 1)	/* Request to Send */
-#define URMC_URDTR	(1 << 0)	/* Data Terminal Ready */
-
-/* Line Status Register */
-#define URLS_URRFE	(1 << 7)	/* Receive FIFO Error */
-#define URLS_URTE	(1 << 6)	/* Transmit Empty */
-#define URLS_URTHRE	(1 << 5)	/* Transmit Holding Register Empty */
-#define URLS_URBI	(1 << 4)	/* Break Interrupt */
-#define URLS_URFE	(1 << 3)	/* Framing Error */
-#define URLS_URPE	(1 << 2)	/* Parity Error */
-#define URLS_URROE	(1 << 1)	/* Receive Overrun Error */
-#define URLS_URDR	(1 << 0)	/* Receive Data Ready */
-
-/* Modem Status Register */
-#define URMS_URDCD	(1 << 7)	/* Data Carrier Detect */
-#define URMS_URRI	(1 << 6)	/* Ring Indicator */
-#define URMS_URDSR	(1 << 5)	/* Data Set Ready */
-#define URMS_URCTS	(1 << 4)	/* Clear to Send */
-#define URMS_URDDCD	(1 << 3)	/* Delta Data Carrier Detect */
-#define URMS_URTERI	(1 << 2)	/* Trailing Edge Ring Indicator */
-#define URMS_URDDST	(1 << 1)	/* Delta Data Set Ready */
-#define URMS_URDCTS	(1 << 0)	/* Delta Clear to Send */
-
-/* Status Register */
-#define USR_UTI		(1 << 0)	/* Timeout Indication */
-
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-ks8695/include/mach/uncompress.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - Kernel uncompressor
- */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
-#include <linux/io.h>
-#include <mach/regs-uart.h>
-
-static inline void putc(char c)
-{
-	while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE))
-		barrier();
-
-	__raw_writel(c, (void __iomem*)KS8695_UART_PA + KS8695_URTH);
-}
-
-static inline void flush(void)
-{
-	while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTE))
-		barrier();
-}
-
-#define arch_decomp_setup()
-
-#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 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * arch/arm/mach-ks8695/irq.c
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/device.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-#include <asm/irq.h>
-
-#include <asm/mach/irq.h>
-
-#include <mach/regs-irq.h>
-#include <mach/regs-gpio.h>
-
-static void ks8695_irq_mask(struct irq_data *d)
-{
-	unsigned long inten;
-
-	inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
-	inten &= ~(1 << d->irq);
-
-	__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
-}
-
-static void ks8695_irq_unmask(struct irq_data *d)
-{
-	unsigned long inten;
-
-	inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
-	inten |= (1 << d->irq);
-
-	__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
-}
-
-static void ks8695_irq_ack(struct irq_data *d)
-{
-	__raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST);
-}
-
-
-static struct irq_chip ks8695_irq_level_chip;
-static struct irq_chip ks8695_irq_edge_chip;
-
-
-static int ks8695_irq_set_type(struct irq_data *d, unsigned int type)
-{
-	unsigned long ctrl, mode;
-	unsigned short level_triggered = 0;
-
-	ctrl = __raw_readl(KS8695_GPIO_VA + KS8695_IOPC);
-
-	switch (type) {
-		case IRQ_TYPE_LEVEL_HIGH:
-			mode = IOPC_TM_HIGH;
-			level_triggered = 1;
-			break;
-		case IRQ_TYPE_LEVEL_LOW:
-			mode = IOPC_TM_LOW;
-			level_triggered = 1;
-			break;
-		case IRQ_TYPE_EDGE_RISING:
-			mode = IOPC_TM_RISING;
-			break;
-		case IRQ_TYPE_EDGE_FALLING:
-			mode = IOPC_TM_FALLING;
-			break;
-		case IRQ_TYPE_EDGE_BOTH:
-			mode = IOPC_TM_EDGE;
-			break;
-		default:
-			return -EINVAL;
-	}
-
-	switch (d->irq) {
-		case KS8695_IRQ_EXTERN0:
-			ctrl &= ~IOPC_IOEINT0TM;
-			ctrl |= IOPC_IOEINT0_MODE(mode);
-			break;
-		case KS8695_IRQ_EXTERN1:
-			ctrl &= ~IOPC_IOEINT1TM;
-			ctrl |= IOPC_IOEINT1_MODE(mode);
-			break;
-		case KS8695_IRQ_EXTERN2:
-			ctrl &= ~IOPC_IOEINT2TM;
-			ctrl |= IOPC_IOEINT2_MODE(mode);
-			break;
-		case KS8695_IRQ_EXTERN3:
-			ctrl &= ~IOPC_IOEINT3TM;
-			ctrl |= IOPC_IOEINT3_MODE(mode);
-			break;
-		default:
-			return -EINVAL;
-	}
-
-	if (level_triggered) {
-		irq_set_chip_and_handler(d->irq, &ks8695_irq_level_chip,
-					 handle_level_irq);
-	}
-	else {
-		irq_set_chip_and_handler(d->irq, &ks8695_irq_edge_chip,
-					 handle_edge_irq);
-	}
-
-	__raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC);
-	return 0;
-}
-
-static struct irq_chip ks8695_irq_level_chip = {
-	.irq_ack	= ks8695_irq_mask,
-	.irq_mask	= ks8695_irq_mask,
-	.irq_unmask	= ks8695_irq_unmask,
-	.irq_set_type	= ks8695_irq_set_type,
-};
-
-static struct irq_chip ks8695_irq_edge_chip = {
-	.irq_ack	= ks8695_irq_ack,
-	.irq_mask	= ks8695_irq_mask,
-	.irq_unmask	= ks8695_irq_unmask,
-	.irq_set_type	= ks8695_irq_set_type,
-};
-
-void __init ks8695_init_irq(void)
-{
-	unsigned int irq;
-
-	/* Disable all interrupts initially */
-	__raw_writel(0, KS8695_IRQ_VA + KS8695_INTMC);
-	__raw_writel(0, KS8695_IRQ_VA + KS8695_INTEN);
-
-	for (irq = 0; irq < NR_IRQS; irq++) {
-		switch (irq) {
-			/* Level-triggered interrupts */
-			case KS8695_IRQ_BUS_ERROR:
-			case KS8695_IRQ_UART_MODEM_STATUS:
-			case KS8695_IRQ_UART_LINE_STATUS:
-			case KS8695_IRQ_UART_RX:
-			case KS8695_IRQ_COMM_TX:
-			case KS8695_IRQ_COMM_RX:
-				irq_set_chip_and_handler(irq,
-							 &ks8695_irq_level_chip,
-							 handle_level_irq);
-				break;
-
-			/* Edge-triggered interrupts */
-			default:
-				/* clear pending bit */
-				ks8695_irq_ack(irq_get_irq_data(irq));
-				irq_set_chip_and_handler(irq,
-							 &ks8695_irq_edge_chip,
-							 handle_edge_irq);
-		}
-
-		irq_clear_status_flags(irq, IRQ_NOREQUEST);
-	}
-}
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 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * arch/arm/mach-ks8695/pci.c
- *
- *  Copyright (C) 2003, Micrel Semiconductors
- *  Copyright (C) 2006, Greg Ungerer <gerg@snapgear.com>
- *  Copyright (C) 2006, Ben Dooks
- *  Copyright (C) 2007, Andrew Victor
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/mm.h>
-#include <linux/init.h>
-#include <linux/irq.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-
-#include <asm/signal.h>
-#include <asm/mach/pci.h>
-#include <mach/hardware.h>
-
-#include "devices.h"
-#include "regs-pci.h"
-
-
-static int pci_dbg;
-
-static void ks8695_pci_setupconfig(unsigned int bus_nr, unsigned int devfn, unsigned int where)
-{
-	unsigned long pbca;
-
-	pbca = PBCA_ENABLE | (where & ~3);
-	pbca |= PCI_SLOT(devfn) << 11 ;
-	pbca |= PCI_FUNC(devfn) << 8;
-	pbca |= bus_nr << 16;
-
-	if (bus_nr == 0) {
-		/* use Type-0 transaction */
-		__raw_writel(pbca, KS8695_PCI_VA + KS8695_PBCA);
-	} else {
-		/* use Type-1 transaction */
-		__raw_writel(pbca | PBCA_TYPE1, KS8695_PCI_VA + KS8695_PBCA);
-	}
-}
-
-static void __iomem *ks8695_pci_map_bus(struct pci_bus *bus, unsigned int devfn,
-					int where)
-{
-	ks8695_pci_setupconfig(bus->number, devfn, where);
-	return KS8695_PCI_VA +  KS8695_PBCD;
-}
-
-static void ks8695_local_writeconfig(int where, u32 value)
-{
-	ks8695_pci_setupconfig(0, 0, where);
-	__raw_writel(value, KS8695_PCI_VA + KS8695_PBCD);
-}
-
-static struct pci_ops ks8695_pci_ops = {
-	.map_bus = ks8695_pci_map_bus,
-	.read	= pci_generic_config_read32,
-	.write	= pci_generic_config_write32,
-};
-
-static struct resource pci_mem = {
-	.name	= "PCI Memory space",
-	.start	= KS8695_PCIMEM_PA,
-	.end	= KS8695_PCIMEM_PA + (KS8695_PCIMEM_SIZE - 1),
-	.flags	= IORESOURCE_MEM,
-};
-
-static struct resource pci_io = {
-	.name	= "PCI IO space",
-	.start	= KS8695_PCIIO_PA,
-	.end	= KS8695_PCIIO_PA + (KS8695_PCIIO_SIZE - 1),
-	.flags	= IORESOURCE_IO,
-};
-
-static int __init ks8695_pci_setup(int nr, struct pci_sys_data *sys)
-{
-	if (nr > 0)
-		return 0;
-
-	request_resource(&iomem_resource, &pci_mem);
-	request_resource(&ioport_resource, &pci_io);
-
-	pci_add_resource_offset(&sys->resources, &pci_io, sys->io_offset);
-	pci_add_resource_offset(&sys->resources, &pci_mem, sys->mem_offset);
-
-	/* Assign and enable processor bridge */
-	ks8695_local_writeconfig(PCI_BASE_ADDRESS_0, KS8695_PCIMEM_PA);
-
-	/* Enable bus-master & Memory Space access */
-	ks8695_local_writeconfig(PCI_COMMAND, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
-
-	/* Set cache-line size & latency. */
-	ks8695_local_writeconfig(PCI_CACHE_LINE_SIZE, (32 << 8) | (L1_CACHE_BYTES / sizeof(u32)));
-
-	/* Reserve PCI memory space for PCI-AHB resources */
-	if (!request_mem_region(KS8695_PCIMEM_PA, SZ_64M, "PCI-AHB Bridge")) {
-		printk(KERN_ERR "Cannot allocate PCI-AHB Bridge memory.\n");
-		return -EBUSY;
-	}
-
-	return 1;
-}
-
-static inline unsigned int size_mask(unsigned long size)
-{
-	return (~size) + 1;
-}
-
-static int ks8695_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
-{
-	unsigned long pc = instruction_pointer(regs);
-	unsigned long instr = *(unsigned long *)pc;
-	unsigned long cmdstat;
-
-	cmdstat = __raw_readl(KS8695_PCI_VA + KS8695_CRCFCS);
-
-	printk(KERN_ERR "PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx [%s%s%s%s%s]\n",
-		addr, fsr, regs->ARM_pc, regs->ARM_lr,
-		cmdstat & (PCI_STATUS_SIG_TARGET_ABORT << 16) ? "GenTarget" : " ",
-		cmdstat & (PCI_STATUS_REC_TARGET_ABORT << 16) ? "RecvTarget" : " ",
-		cmdstat & (PCI_STATUS_REC_MASTER_ABORT << 16) ? "MasterAbort" : " ",
-		cmdstat & (PCI_STATUS_SIG_SYSTEM_ERROR << 16) ? "SysError" : " ",
-		cmdstat & (PCI_STATUS_DETECTED_PARITY << 16)  ? "Parity" : " "
-	);
-
-	__raw_writel(cmdstat, KS8695_PCI_VA + KS8695_CRCFCS);
-
-	/*
-	 * If the instruction being executed was a read,
-	 * make it look like it read all-ones.
-	 */
-	if ((instr & 0x0c100000) == 0x04100000) {
-		int reg = (instr >> 12) & 15;
-		unsigned long val;
-
-		if (instr & 0x00400000)
-			val = 255;
-		else
-			val = -1;
-
-		regs->uregs[reg] = val;
-		regs->ARM_pc += 4;
-		return 0;
-	}
-
-	if ((instr & 0x0e100090) == 0x00100090) {
-		int reg = (instr >> 12) & 15;
-
-		regs->uregs[reg] = -1;
-		regs->ARM_pc += 4;
-		return 0;
-	}
-
-	return 1;
-}
-
-static void __init ks8695_pci_preinit(void)
-{
-	/* make software reset to avoid freeze if PCI bus was messed up */
-	__raw_writel(0x80000000, KS8695_PCI_VA + KS8695_PBCS);
-
-	/* stage 1 initialization, subid, subdevice = 0x0001 */
-	__raw_writel(0x00010001, KS8695_PCI_VA + KS8695_CRCSID);
-
-	/* stage 2 initialization */
-	/* prefetch limits with 16 words, retry enable */
-	__raw_writel(0x40000000, KS8695_PCI_VA + KS8695_PBCS);
-
-	/* configure memory mapping */
-	__raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBA);
-	__raw_writel(size_mask(KS8695_PCIMEM_SIZE), KS8695_PCI_VA + KS8695_PMBAM);
-	__raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBAT);
-	__raw_writel(0, KS8695_PCI_VA + KS8695_PMBAC);
-
-	/* configure IO mapping */
-	__raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBA);
-	__raw_writel(size_mask(KS8695_PCIIO_SIZE), KS8695_PCI_VA + KS8695_PIOBAM);
-	__raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBAT);
-	__raw_writel(0, KS8695_PCI_VA + KS8695_PIOBAC);
-
-	/* hook in fault handlers */
-	hook_fault_code(8, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
-	hook_fault_code(10, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
-}
-
-static void ks8695_show_pciregs(void)
-{
-	if (!pci_dbg)
-		return;
-
-	printk(KERN_INFO "PCI: CRCFID = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFID));
-	printk(KERN_INFO "PCI: CRCFCS = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFCS));
-	printk(KERN_INFO "PCI: CRCFRV = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFRV));
-	printk(KERN_INFO "PCI: CRCFLT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFLT));
-	printk(KERN_INFO "PCI: CRCBMA = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCBMA));
-	printk(KERN_INFO "PCI: CRCSID = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCSID));
-	printk(KERN_INFO "PCI: CRCFIT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFIT));
-
-	printk(KERN_INFO "PCI: PBM    = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PBM));
-	printk(KERN_INFO "PCI: PBCS   = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PBCS));
-
-	printk(KERN_INFO "PCI: PMBA   = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBA));
-	printk(KERN_INFO "PCI: PMBAC  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAC));
-	printk(KERN_INFO "PCI: PMBAM  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAM));
-	printk(KERN_INFO "PCI: PMBAT  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAT));
-
-	printk(KERN_INFO "PCI: PIOBA  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBA));
-	printk(KERN_INFO "PCI: PIOBAC = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAC));
-	printk(KERN_INFO "PCI: PIOBAM = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAM));
-	printk(KERN_INFO "PCI: PIOBAT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAT));
-}
-
-
-static struct hw_pci ks8695_pci __initdata = {
-	.nr_controllers	= 1,
-	.ops		= &ks8695_pci_ops,
-	.preinit	= ks8695_pci_preinit,
-	.setup		= ks8695_pci_setup,
-	.postinit	= NULL,
-	.map_irq	= NULL,
-};
-
-void __init ks8695_init_pci(struct ks8695_pci_cfg *cfg)
-{
-	if (__raw_readl(KS8695_PCI_VA + KS8695_CRCFRV) & CFRV_GUEST) {
-		printk("PCI: KS8695 in guest mode, not initialising\n");
-		return;
-	}
-
-	pcibios_min_io = 0;
-	pcibios_min_mem = 0;
-
-	printk(KERN_INFO "PCI: Initialising\n");
-	ks8695_show_pciregs();
-
-	/* set Mode */
-	__raw_writel(cfg->mode << 29, KS8695_PCI_VA + KS8695_PBM);
-
-	ks8695_pci.map_irq = cfg->map_irq;	/* board-specific map_irq method */
-
-	pci_common_init(&ks8695_pci);
-}
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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-wan.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * KS8695 - HPNA Registers and bit definitions.
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_HPNA_H
-#define KS8695_HPNA_H
-
-#define KS8695_HPNA_OFFSET	(0xF0000 + 0xA000)
-#define KS8695_HPNA_VA		(KS8695_IO_VA + KS8695_HPNA_OFFSET)
-#define KS8695_HPNA_PA		(KS8695_IO_PA + KS8695_HPNA_OFFSET)
-
-
-/*
- * HPNA registers
- */
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-lan.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * KS8695 - LAN Registers and bit definitions.
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_LAN_H
-#define KS8695_LAN_H
-
-#define KS8695_LAN_OFFSET	(0xF0000 + 0x8000)
-#define KS8695_LAN_VA		(KS8695_IO_VA + KS8695_LAN_OFFSET)
-#define KS8695_LAN_PA		(KS8695_IO_PA + KS8695_LAN_OFFSET)
-
-
-/*
- * LAN registers
- */
-#define KS8695_LMDTXC		(0x00)		/* DMA Transmit Control */
-#define KS8695_LMDRXC		(0x04)		/* DMA Receive Control */
-#define KS8695_LMDTSC		(0x08)		/* DMA Transmit Start Command */
-#define KS8695_LMDRSC		(0x0c)		/* DMA Receive Start Command */
-#define KS8695_LTDLB		(0x10)		/* Transmit Descriptor List Base Address */
-#define KS8695_LRDLB		(0x14)		/* Receive Descriptor List Base Address */
-#define KS8695_LMAL		(0x18)		/* MAC Station Address Low */
-#define KS8695_LMAH		(0x1c)		/* MAC Station Address High */
-#define KS8695_LMAAL(n)		(0x80 + ((n)*8))	/* MAC Additional Station Address (0..15) Low */
-#define KS8695_LMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station Address (0..15) High */
-
-
-/* DMA Transmit Control Register */
-#define LMDTXC_LMTRST		(1    << 31)	/* Soft Reset */
-#define LMDTXC_LMTBS		(0x3f << 24)	/* Transmit Burst Size */
-#define LMDTXC_LMTUCG		(1    << 18)	/* Transmit UDP Checksum Generate */
-#define LMDTXC_LMTTCG		(1    << 17)	/* Transmit TCP Checksum Generate */
-#define LMDTXC_LMTICG		(1    << 16)	/* Transmit IP Checksum Generate */
-#define LMDTXC_LMTFCE		(1    <<  9)	/* Transmit Flow Control Enable */
-#define LMDTXC_LMTLB		(1    <<  8)	/* Loopback mode */
-#define LMDTXC_LMTEP		(1    <<  2)	/* Transmit Enable Padding */
-#define LMDTXC_LMTAC		(1    <<  1)	/* Transmit Add CRC */
-#define LMDTXC_LMTE		(1    <<  0)	/* TX Enable */
-
-/* DMA Receive Control Register */
-#define LMDRXC_LMRBS		(0x3f << 24)	/* Receive Burst Size */
-#define LMDRXC_LMRUCC		(1    << 18)	/* Receive UDP Checksum check */
-#define LMDRXC_LMRTCG		(1    << 17)	/* Receive TCP Checksum check */
-#define LMDRXC_LMRICG		(1    << 16)	/* Receive IP Checksum check */
-#define LMDRXC_LMRFCE		(1    <<  9)	/* Receive Flow Control Enable */
-#define LMDRXC_LMRB		(1    <<  6)	/* Receive Broadcast */
-#define LMDRXC_LMRM		(1    <<  5)	/* Receive Multicast */
-#define LMDRXC_LMRU		(1    <<  4)	/* Receive Unicast */
-#define LMDRXC_LMRERR		(1    <<  3)	/* Receive Error Frame */
-#define LMDRXC_LMRA		(1    <<  2)	/* Receive All */
-#define LMDRXC_LMRE		(1    <<  1)	/* RX Enable */
-
-/* Additional Station Address High */
-#define LMAAH_E			(1    << 31)	/* Address Enabled */
-
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-mem.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * KS8695 - Memory Controller registers and bit definitions
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_MEM_H
-#define KS8695_MEM_H
-
-#define KS8695_MEM_OFFSET	(0xF0000 + 0x4000)
-#define KS8695_MEM_VA		(KS8695_IO_VA + KS8695_MEM_OFFSET)
-#define KS8695_MEM_PA		(KS8695_IO_PA + KS8695_MEM_OFFSET)
-
-
-/*
- * Memory Controller Registers
- */
-#define KS8695_EXTACON0		(0x00)		/* External I/O 0 Access Control */
-#define KS8695_EXTACON1		(0x04)		/* External I/O 1 Access Control */
-#define KS8695_EXTACON2		(0x08)		/* External I/O 2 Access Control */
-#define KS8695_ROMCON0		(0x10)		/* ROM/SRAM/Flash 1 Control Register */
-#define KS8695_ROMCON1		(0x14)		/* ROM/SRAM/Flash 2 Control Register */
-#define KS8695_ERGCON		(0x20)		/* External I/O and ROM/SRAM/Flash General Register */
-#define KS8695_SDCON0		(0x30)		/* SDRAM Control Register 0 */
-#define KS8695_SDCON1		(0x34)		/* SDRAM Control Register 1 */
-#define KS8695_SDGCON		(0x38)		/* SDRAM General Control */
-#define KS8695_SDBCON		(0x3c)		/* SDRAM Buffer Control */
-#define KS8695_REFTIM		(0x40)		/* SDRAM Refresh Timer */
-
-
-/* External I/O Access Control Registers */
-#define EXTACON_EBNPTR		(0x3ff << 22)		/* Last Address Pointer */
-#define EXTACON_EBBPTR		(0x3ff << 12)		/* Base Pointer */
-#define EXTACON_EBTACT		(7     <<  9)		/* Write Enable/Output Enable Active Time */
-#define EXTACON_EBTCOH		(7     <<  6)		/* Chip Select Hold Time */
-#define EXTACON_EBTACS		(7     <<  3)		/* Address Setup Time before ECSN */
-#define EXTACON_EBTCOS		(7     <<  0)		/* Chip Select Time before OEN */
-
-/* ROM/SRAM/Flash Control Register */
-#define ROMCON_RBNPTR		(0x3ff << 22)		/* Next Pointer */
-#define ROMCON_RBBPTR		(0x3ff << 12)		/* Base Pointer */
-#define ROMCON_RBTACC		(7     <<  4)		/* Access Cycle Time */
-#define ROMCON_RBTPA		(3     <<  2)		/* Page Address Access Time */
-#define ROMCON_PMC		(3     <<  0)		/* Page Mode Configuration */
-#define		PMC_NORMAL		(0 << 0)
-#define		PMC_4WORD		(1 << 0)
-#define		PMC_8WORD		(2 << 0)
-#define		PMC_16WORD		(3 << 0)
-
-/* External I/O and ROM/SRAM/Flash General Register */
-#define ERGCON_TMULT		(3 << 28)		/* Time Multiplier */
-#define ERGCON_DSX2		(3 << 20)		/* Data Width (External I/O Bank 2) */
-#define ERGCON_DSX1		(3 << 18)		/* Data Width (External I/O Bank 1) */
-#define ERGCON_DSX0		(3 << 16)		/* Data Width (External I/O Bank 0) */
-#define ERGCON_DSR1		(3 <<  2)		/* Data Width (ROM/SRAM/Flash Bank 1) */
-#define ERGCON_DSR0		(3 <<  0)		/* Data Width (ROM/SRAM/Flash Bank 0) */
-
-/* SDRAM Control Register */
-#define SDCON_DBNPTR		(0x3ff << 22)		/* Last Address Pointer */
-#define SDCON_DBBPTR		(0x3ff << 12)		/* Base Pointer */
-#define SDCON_DBCAB		(3     <<  8)		/* Column Address Bits */
-#define SDCON_DBBNUM		(1     <<  3)		/* Number of Banks */
-#define SDCON_DBDBW		(3     <<  1)		/* Data Bus Width */
-
-/* SDRAM General Control Register */
-#define SDGCON_SDTRC		(3 << 2)		/* RAS to CAS latency */
-#define SDGCON_SDCAS		(3 << 0)		/* CAS latency */
-
-/* SDRAM Buffer Control Register */
-#define SDBCON_SDESTA		(1 << 31)		/* SDRAM Engine Status */
-#define SDBCON_RBUFBDIS		(1 << 24)		/* Read Buffer Burst Enable */
-#define SDBCON_WFIFOEN		(1 << 23)		/* Write FIFO Enable */
-#define SDBCON_RBUFEN		(1 << 22)		/* Read Buffer Enable */
-#define SDBCON_FLUSHWFIFO	(1 << 21)		/* Flush Write FIFO */
-#define SDBCON_RBUFINV		(1 << 20)		/* Read Buffer Invalidate */
-#define SDBCON_SDINI		(3 << 16)		/* SDRAM Initialization Control */
-#define SDBCON_SDMODE		(0x3fff << 0)		/* SDRAM Mode Register Value Program */
-
-/* SDRAM Refresh Timer Register */
-#define REFTIM_REFTIM		(0xffff << 0)		/* Refresh Timer Value */
-
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-pci.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - PCI bridge registers and bit definitions.
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#define KS8695_PCI_OFFSET	(0xF0000 + 0x2000)
-#define KS8695_PCI_VA		(KS8695_IO_VA + KS8695_PCI_OFFSET)
-#define KS8695_PCI_PA		(KS8695_IO_PA + KS8695_PCI_OFFSET)
-
-
-#define KS8695_CRCFID		(0x000)		/* Configuration: Identification */
-#define KS8695_CRCFCS		(0x004)		/* Configuration: Command and Status */
-#define KS8695_CRCFRV		(0x008)		/* Configuration: Revision */
-#define KS8695_CRCFLT		(0x00C)		/* Configuration: Latency Timer */
-#define KS8695_CRCBMA		(0x010)		/* Configuration: Base Memory Address */
-#define KS8695_CRCSID		(0x02C)		/* Configuration: Subsystem ID */
-#define KS8695_CRCFIT		(0x03C)		/* Configuration: Interrupt */
-#define KS8695_PBCA		(0x100)		/* Bridge Configuration Address */
-#define KS8695_PBCD		(0x104)		/* Bridge Configuration Data */
-#define KS8695_PBM		(0x200)		/* Bridge Mode */
-#define KS8695_PBCS		(0x204)		/* Bridge Control and Status */
-#define KS8695_PMBA		(0x208)		/* Bridge Memory Base Address */
-#define KS8695_PMBAC		(0x20C)		/* Bridge Memory Base Address Control */
-#define KS8695_PMBAM		(0x210)		/* Bridge Memory Base Address Mask */
-#define KS8695_PMBAT		(0x214)		/* Bridge Memory Base Address Translation */
-#define KS8695_PIOBA		(0x218)		/* Bridge I/O Base Address */
-#define KS8695_PIOBAC		(0x21C)		/* Bridge I/O Base Address Control */
-#define KS8695_PIOBAM		(0x220)		/* Bridge I/O Base Address Mask */
-#define KS8695_PIOBAT		(0x224)		/* Bridge I/O Base Address Translation */
-
-
-/* Configuration: Identification */
-
-/* Configuration: Command and Status */
-
-/* Configuration: Revision */
-
-
-
-#define CFRV_GUEST		(1 << 23)
-
-#define PBCA_TYPE1		(1)
-#define PBCA_ENABLE		(1 << 31)
-
-
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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-sys.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - System control registers and bit definitions
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_SYS_H
-#define KS8695_SYS_H
-
-#define KS8695_SYS_OFFSET	(0xF0000 + 0x0000)
-#define KS8695_SYS_VA		(KS8695_IO_VA + KS8695_SYS_OFFSET)
-#define KS8695_SYS_PA		(KS8695_IO_PA + KS8695_SYS_OFFSET)
-
-
-#define KS8695_SYSCFG		(0x00)		/* System Configuration Register */
-#define KS8695_CLKCON		(0x04)		/* System Clock and Bus Control Register */
-
-
-/* System Configuration Register */
-#define SYSCFG_SPRBP		(0x3ff << 16)	/* Register Bank Base Pointer */
-
-/* System Clock and Bus Control Register */
-#define CLKCON_SFMODE		(1 << 8)	/* System Fast Mode for Simulation */
-#define CLKCON_SCDC		(7 << 0)	/* System Clock Divider Select */
-
-
-#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 @@
-/*
- * arch/arm/mach-ks8695/include/mach/regs-wan.h
- *
- * Copyright (C) 2006 Andrew Victor
- *
- * KS8695 - WAN Registers and bit definitions.
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef KS8695_WAN_H
-#define KS8695_WAN_H
-
-#define KS8695_WAN_OFFSET	(0xF0000 + 0x6000)
-#define KS8695_WAN_VA		(KS8695_IO_VA + KS8695_WAN_OFFSET)
-#define KS8695_WAN_PA		(KS8695_IO_PA + KS8695_WAN_OFFSET)
-
-
-/*
- * WAN registers
- */
-#define KS8695_WMDTXC		(0x00)		/* DMA Transmit Control */
-#define KS8695_WMDRXC		(0x04)		/* DMA Receive Control */
-#define KS8695_WMDTSC		(0x08)		/* DMA Transmit Start Command */
-#define KS8695_WMDRSC		(0x0c)		/* DMA Receive Start Command */
-#define KS8695_WTDLB		(0x10)		/* Transmit Descriptor List Base Address */
-#define KS8695_WRDLB		(0x14)		/* Receive Descriptor List Base Address */
-#define KS8695_WMAL		(0x18)		/* MAC Station Address Low */
-#define KS8695_WMAH		(0x1c)		/* MAC Station Address High */
-#define KS8695_WMAAL(n)		(0x80 + ((n)*8))	/* MAC Additional Station Address (0..15) Low */
-#define KS8695_WMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station Address (0..15) High */
-
-
-/* DMA Transmit Control Register */
-#define WMDTXC_WMTRST		(1    << 31)	/* Soft Reset */
-#define WMDTXC_WMTBS		(0x3f << 24)	/* Transmit Burst Size */
-#define WMDTXC_WMTUCG		(1    << 18)	/* Transmit UDP Checksum Generate */
-#define WMDTXC_WMTTCG		(1    << 17)	/* Transmit TCP Checksum Generate */
-#define WMDTXC_WMTICG		(1    << 16)	/* Transmit IP Checksum Generate */
-#define WMDTXC_WMTFCE		(1    <<  9)	/* Transmit Flow Control Enable */
-#define WMDTXC_WMTLB		(1    <<  8)	/* Loopback mode */
-#define WMDTXC_WMTEP		(1    <<  2)	/* Transmit Enable Padding */
-#define WMDTXC_WMTAC		(1    <<  1)	/* Transmit Add CRC */
-#define WMDTXC_WMTE		(1    <<  0)	/* TX Enable */
-
-/* DMA Receive Control Register */
-#define WMDRXC_WMRBS		(0x3f << 24)	/* Receive Burst Size */
-#define WMDRXC_WMRUCC		(1    << 18)	/* Receive UDP Checksum check */
-#define WMDRXC_WMRTCG		(1    << 17)	/* Receive TCP Checksum check */
-#define WMDRXC_WMRICG		(1    << 16)	/* Receive IP Checksum check */
-#define WMDRXC_WMRFCE		(1    <<  9)	/* Receive Flow Control Enable */
-#define WMDRXC_WMRB		(1    <<  6)	/* Receive Broadcast */
-#define WMDRXC_WMRM		(1    <<  5)	/* Receive Multicast */
-#define WMDRXC_WMRU		(1    <<  4)	/* Receive Unicast */
-#define WMDRXC_WMRERR		(1    <<  3)	/* Receive Error Frame */
-#define WMDRXC_WMRA		(1    <<  2)	/* Receive All */
-#define WMDRXC_WMRE		(1    <<  0)	/* RX Enable */
-
-/* Additional Station Address High */
-#define WMAAH_E			(1    << 31)	/* Address Enabled */
-
-
-#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 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * arch/arm/mach-ks8695/time.c
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/io.h>
-#include <linux/clockchips.h>
-
-#include <asm/mach/time.h>
-#include <asm/system_misc.h>
-
-#include <mach/regs-irq.h>
-
-#include "generic.h"
-
-#define KS8695_TMR_OFFSET	(0xF0000 + 0xE400)
-#define KS8695_TMR_VA		(KS8695_IO_VA + KS8695_TMR_OFFSET)
-#define KS8695_TMR_PA		(KS8695_IO_PA + KS8695_TMR_OFFSET)
-
-/*
- * Timer registers
- */
-#define KS8695_TMCON		(0x00)		/* Timer Control Register */
-#define KS8695_T1TC		(0x04)		/* Timer 1 Timeout Count Register */
-#define KS8695_T0TC		(0x08)		/* Timer 0 Timeout Count Register */
-#define KS8695_T1PD		(0x0C)		/* Timer 1 Pulse Count Register */
-#define KS8695_T0PD		(0x10)		/* Timer 0 Pulse Count Register */
-
-/* Timer Control Register */
-#define TMCON_T1EN		(1 << 1)	/* Timer 1 Enable */
-#define TMCON_T0EN		(1 << 0)	/* Timer 0 Enable */
-
-/* Timer0 Timeout Counter Register */
-#define T0TC_WATCHDOG		(0xff)		/* Enable watchdog mode */
-
-static int ks8695_set_periodic(struct clock_event_device *evt)
-{
-	u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ);
-	u32 half = DIV_ROUND_CLOSEST(rate, 2);
-	u32 tmcon;
-
-	/* Disable timer 1 */
-	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
-	tmcon &= ~TMCON_T1EN;
-	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
-
-	/* Both registers need to count down */
-	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
-	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
-
-	/* Re-enable timer1 */
-	tmcon |= TMCON_T1EN;
-	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
-	return 0;
-}
-
-static int ks8695_set_next_event(unsigned long cycles,
-				 struct clock_event_device *evt)
-
-{
-	u32 half = DIV_ROUND_CLOSEST(cycles, 2);
-	u32 tmcon;
-
-	/* Disable timer 1 */
-	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
-	tmcon &= ~TMCON_T1EN;
-	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
-
-	/* Both registers need to count down */
-	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
-	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
-
-	/* Re-enable timer1 */
-	tmcon |= TMCON_T1EN;
-	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
-
-	return 0;
-}
-
-static struct clock_event_device clockevent_ks8695 = {
-	.name			= "ks8695_t1tc",
-	/* Reasonably fast and accurate clock event */
-	.rating			= 300,
-	.features		= CLOCK_EVT_FEAT_ONESHOT |
-				  CLOCK_EVT_FEAT_PERIODIC,
-	.set_next_event		= ks8695_set_next_event,
-	.set_state_periodic	= ks8695_set_periodic,
-};
-
-/*
- * IRQ handler for the timer.
- */
-static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id)
-{
-	struct clock_event_device *evt = &clockevent_ks8695;
-
-	evt->event_handler(evt);
-	return IRQ_HANDLED;
-}
-
-static struct irqaction ks8695_timer_irq = {
-	.name		= "ks8695_tick",
-	.flags		= IRQF_TIMER,
-	.handler	= ks8695_timer_interrupt,
-};
-
-static void ks8695_timer_setup(void)
-{
-	unsigned long tmcon;
-
-	/* Disable timer 0 and 1 */
-	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
-	tmcon &= ~TMCON_T0EN;
-	tmcon &= ~TMCON_T1EN;
-	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
-
-	/*
-	 * Use timer 1 to fire IRQs on the timeline, minimum 2 cycles
-	 * (one on each counter) maximum 2*2^32, but the API will only
-	 * accept up to a 32bit full word (0xFFFFFFFFU).
-	 */
-	clockevents_config_and_register(&clockevent_ks8695,
-					KS8695_CLOCK_RATE, 2,
-					0xFFFFFFFFU);
-}
-
-void __init ks8695_timer_init(void)
-{
-	ks8695_timer_setup();
-
-	/* Enable timer interrupts */
-	setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq);
-}
-
-void ks8695_restart(enum reboot_mode reboot_mode, const char *cmd)
-{
-	unsigned int reg;
-
-	if (reboot_mode == REBOOT_SOFT)
-		soft_restart(0);
-
-	/* disable timer0 */
-	reg = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
-	writel_relaxed(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-
-	/* enable watchdog mode */
-	writel_relaxed((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
-
-	/* re-enable timer0 */
-	writel_relaxed(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-}
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 820b60a50125..05143ec47d94 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -106,7 +106,7 @@ config CPU_ARM922T
 	help
 	  The ARM922T is a version of the ARM920T, but with smaller
 	  instruction and data caches. It is used in Altera's
-	  Excalibur XA device family and Micrel's KS8695 Centaur.
+	  Excalibur XA device family and the ARM Integrator.
 
 	  Say Y if you want support for the ARM922T processor.
 	  Otherwise, say N.
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 02/16] serial: remove ks8695 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 01/16] ARM: remove ks8695 platform Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 03/16] gpio: " Arnd Bergmann
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
	linux-serial

The platform is getting removed, so there are no more users
of this driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/tty/serial/Kconfig         |  17 -
 drivers/tty/serial/Makefile        |   1 -
 drivers/tty/serial/serial_ks8695.c | 698 -----------------------------
 include/uapi/linux/serial_core.h   |   3 -
 4 files changed, 719 deletions(-)
 delete mode 100644 drivers/tty/serial/serial_ks8695.c

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 3083dbae35f7..7041107ea78d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -197,23 +197,6 @@ config SERIAL_KGDB_NMI
 
 	  If unsure, say N.
 
-config SERIAL_KS8695
-	bool "Micrel KS8695 (Centaur) serial port support"
-	depends on ARCH_KS8695
-	select SERIAL_CORE
-	help
-	  This selects the Micrel Centaur KS8695 UART.  Say Y here.
-
-config SERIAL_KS8695_CONSOLE
-	bool "Support for console on KS8695 (Centaur) serial port"
-	depends on SERIAL_KS8695=y
-	select SERIAL_CORE_CONSOLE
-	help
-	  Say Y here if you wish to use a KS8695 (Centaur) UART as the
-	  system console (the system console is the device which
-	  receives all kernel messages and warnings and which allows
-	  logins in single user mode).
-
 config SERIAL_MESON
 	tristate "Meson serial port support"
 	depends on ARCH_MESON
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 15a0fccadf7e..7f744136489e 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -59,7 +59,6 @@ obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
 obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
 obj-$(CONFIG_SERIAL_MSM) += msm_serial.o
 obj-$(CONFIG_SERIAL_QCOM_GENI) += qcom_geni_serial.o
-obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
 obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o
 obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
 obj-$(CONFIG_SERIAL_ST_ASC) += st-asc.o
diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c
deleted file mode 100644
index b461d791188c..000000000000
--- a/drivers/tty/serial/serial_ks8695.c
+++ /dev/null
@@ -1,698 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- *  Driver for KS8695 serial ports
- *
- *  Based on drivers/serial/serial_amba.c, by Kam Lee.
- *
- *  Copyright 2002-2005 Micrel Inc.
- */
-#include <linux/module.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/ioport.h>
-#include <linux/init.h>
-#include <linux/serial.h>
-#include <linux/console.h>
-#include <linux/sysrq.h>
-#include <linux/device.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/mach/irq.h>
-
-#include <mach/regs-uart.h>
-#include <mach/regs-irq.h>
-
-#if defined(CONFIG_SERIAL_KS8695_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
-#define SUPPORT_SYSRQ
-#endif
-
-#include <linux/serial_core.h>
-
-
-#define SERIAL_KS8695_MAJOR	204
-#define SERIAL_KS8695_MINOR	16
-#define SERIAL_KS8695_DEVNAME	"ttyAM"
-
-#define SERIAL_KS8695_NR	1
-
-/*
- * Access macros for the KS8695 UART
- */
-#define UART_GET_CHAR(p)	(__raw_readl((p)->membase + KS8695_URRB) & 0xFF)
-#define UART_PUT_CHAR(p, c)	__raw_writel((c), (p)->membase + KS8695_URTH)
-#define UART_GET_FCR(p)		__raw_readl((p)->membase + KS8695_URFC)
-#define UART_PUT_FCR(p, c)	__raw_writel((c), (p)->membase + KS8695_URFC)
-#define UART_GET_MSR(p)		__raw_readl((p)->membase + KS8695_URMS)
-#define UART_GET_LSR(p)		__raw_readl((p)->membase + KS8695_URLS)
-#define UART_GET_LCR(p)		__raw_readl((p)->membase + KS8695_URLC)
-#define UART_PUT_LCR(p, c)	__raw_writel((c), (p)->membase + KS8695_URLC)
-#define UART_GET_MCR(p)		__raw_readl((p)->membase + KS8695_URMC)
-#define UART_PUT_MCR(p, c)	__raw_writel((c), (p)->membase + KS8695_URMC)
-#define UART_GET_BRDR(p)	__raw_readl((p)->membase + KS8695_URBD)
-#define UART_PUT_BRDR(p, c)	__raw_writel((c), (p)->membase + KS8695_URBD)
-
-#define KS8695_CLR_TX_INT()	__raw_writel(1 << KS8695_IRQ_UART_TX, KS8695_IRQ_VA + KS8695_INTST)
-
-#define UART_DUMMY_LSR_RX	0x100
-#define UART_PORT_SIZE		(KS8695_USR - KS8695_URRB + 4)
-
-static inline int tx_enabled(struct uart_port *port)
-{
-	return port->unused[0] & 1;
-}
-
-static inline int rx_enabled(struct uart_port *port)
-{
-	return port->unused[0] & 2;
-}
-
-static inline int ms_enabled(struct uart_port *port)
-{
-	return port->unused[0] & 4;
-}
-
-static inline void ms_enable(struct uart_port *port, int enabled)
-{
-	if(enabled)
-		port->unused[0] |= 4;
-	else
-		port->unused[0] &= ~4;
-}
-
-static inline void rx_enable(struct uart_port *port, int enabled)
-{
-	if(enabled)
-		port->unused[0] |= 2;
-	else
-		port->unused[0] &= ~2;
-}
-
-static inline void tx_enable(struct uart_port *port, int enabled)
-{
-	if(enabled)
-		port->unused[0] |= 1;
-	else
-		port->unused[0] &= ~1;
-}
-
-
-#ifdef SUPPORT_SYSRQ
-static struct console ks8695_console;
-#endif
-
-static void ks8695uart_stop_tx(struct uart_port *port)
-{
-	if (tx_enabled(port)) {
-		/* use disable_irq_nosync() and not disable_irq() to avoid self
-		 * imposed deadlock by not waiting for irq handler to end,
-		 * since this ks8695uart_stop_tx() is called from interrupt context.
-		 */
-		disable_irq_nosync(KS8695_IRQ_UART_TX);
-		tx_enable(port, 0);
-	}
-}
-
-static void ks8695uart_start_tx(struct uart_port *port)
-{
-	if (!tx_enabled(port)) {
-		enable_irq(KS8695_IRQ_UART_TX);
-		tx_enable(port, 1);
-	}
-}
-
-static void ks8695uart_stop_rx(struct uart_port *port)
-{
-	if (rx_enabled(port)) {
-		disable_irq(KS8695_IRQ_UART_RX);
-		rx_enable(port, 0);
-	}
-}
-
-static void ks8695uart_enable_ms(struct uart_port *port)
-{
-	if (!ms_enabled(port)) {
-		enable_irq(KS8695_IRQ_UART_MODEM_STATUS);
-		ms_enable(port,1);
-	}
-}
-
-static void ks8695uart_disable_ms(struct uart_port *port)
-{
-	if (ms_enabled(port)) {
-		disable_irq(KS8695_IRQ_UART_MODEM_STATUS);
-		ms_enable(port,0);
-	}
-}
-
-static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id)
-{
-	struct uart_port *port = dev_id;
-	unsigned int status, ch, lsr, flg, max_count = 256;
-
-	status = UART_GET_LSR(port);		/* clears pending LSR interrupts */
-	while ((status & URLS_URDR) && max_count--) {
-		ch = UART_GET_CHAR(port);
-		flg = TTY_NORMAL;
-
-		port->icount.rx++;
-
-		/*
-		 * Note that the error handling code is
-		 * out of the main execution path
-		 */
-		lsr = UART_GET_LSR(port) | UART_DUMMY_LSR_RX;
-		if (unlikely(lsr & (URLS_URBI | URLS_URPE | URLS_URFE | URLS_URROE))) {
-			if (lsr & URLS_URBI) {
-				lsr &= ~(URLS_URFE | URLS_URPE);
-				port->icount.brk++;
-				if (uart_handle_break(port))
-					goto ignore_char;
-			}
-			if (lsr & URLS_URPE)
-				port->icount.parity++;
-			if (lsr & URLS_URFE)
-				port->icount.frame++;
-			if (lsr & URLS_URROE)
-				port->icount.overrun++;
-
-			lsr &= port->read_status_mask;
-
-			if (lsr & URLS_URBI)
-				flg = TTY_BREAK;
-			else if (lsr & URLS_URPE)
-				flg = TTY_PARITY;
-			else if (lsr & URLS_URFE)
-				flg = TTY_FRAME;
-		}
-
-		if (uart_handle_sysrq_char(port, ch))
-			goto ignore_char;
-
-		uart_insert_char(port, lsr, URLS_URROE, ch, flg);
-
-ignore_char:
-		status = UART_GET_LSR(port);
-	}
-	tty_flip_buffer_push(&port->state->port);
-
-	return IRQ_HANDLED;
-}
-
-
-static irqreturn_t ks8695uart_tx_chars(int irq, void *dev_id)
-{
-	struct uart_port *port = dev_id;
-	struct circ_buf *xmit = &port->state->xmit;
-	unsigned int count;
-
-	if (port->x_char) {
-		KS8695_CLR_TX_INT();
-		UART_PUT_CHAR(port, port->x_char);
-		port->icount.tx++;
-		port->x_char = 0;
-		return IRQ_HANDLED;
-	}
-
-	if (uart_tx_stopped(port) || uart_circ_empty(xmit)) {
-		ks8695uart_stop_tx(port);
-		return IRQ_HANDLED;
-	}
-
-	count = 16;	/* fifo size */
-	while (!uart_circ_empty(xmit) && (count-- > 0)) {
-		KS8695_CLR_TX_INT();
-		UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
-
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
-	}
-
-	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
-		uart_write_wakeup(port);
-
-	if (uart_circ_empty(xmit))
-		ks8695uart_stop_tx(port);
-
-	return IRQ_HANDLED;
-}
-
-static irqreturn_t ks8695uart_modem_status(int irq, void *dev_id)
-{
-	struct uart_port *port = dev_id;
-	unsigned int status;
-
-	/*
-	 * clear modem interrupt by reading MSR
-	 */
-	status = UART_GET_MSR(port);
-
-	if (status & URMS_URDDCD)
-		uart_handle_dcd_change(port, status & URMS_URDDCD);
-
-	if (status & URMS_URDDST)
-		port->icount.dsr++;
-
-	if (status & URMS_URDCTS)
-		uart_handle_cts_change(port, status & URMS_URDCTS);
-
-	if (status & URMS_URTERI)
-		port->icount.rng++;
-
-	wake_up_interruptible(&port->state->port.delta_msr_wait);
-
-	return IRQ_HANDLED;
-}
-
-static unsigned int ks8695uart_tx_empty(struct uart_port *port)
-{
-	return (UART_GET_LSR(port) & URLS_URTE) ? TIOCSER_TEMT : 0;
-}
-
-static unsigned int ks8695uart_get_mctrl(struct uart_port *port)
-{
-	unsigned int result = 0;
-	unsigned int status;
-
-	status = UART_GET_MSR(port);
-	if (status & URMS_URDCD)
-		result |= TIOCM_CAR;
-	if (status & URMS_URDSR)
-		result |= TIOCM_DSR;
-	if (status & URMS_URCTS)
-		result |= TIOCM_CTS;
-	if (status & URMS_URRI)
-		result |= TIOCM_RI;
-
-	return result;
-}
-
-static void ks8695uart_set_mctrl(struct uart_port *port, u_int mctrl)
-{
-	unsigned int mcr;
-
-	mcr = UART_GET_MCR(port);
-	if (mctrl & TIOCM_RTS)
-		mcr |= URMC_URRTS;
-	else
-		mcr &= ~URMC_URRTS;
-
-	if (mctrl & TIOCM_DTR)
-		mcr |= URMC_URDTR;
-	else
-		mcr &= ~URMC_URDTR;
-
-	UART_PUT_MCR(port, mcr);
-}
-
-static void ks8695uart_break_ctl(struct uart_port *port, int break_state)
-{
-	unsigned int lcr;
-
-	lcr = UART_GET_LCR(port);
-
-	if (break_state == -1)
-		lcr |= URLC_URSBC;
-	else
-		lcr &= ~URLC_URSBC;
-
-	UART_PUT_LCR(port, lcr);
-}
-
-static int ks8695uart_startup(struct uart_port *port)
-{
-	int retval;
-
-	irq_modify_status(KS8695_IRQ_UART_TX, IRQ_NOREQUEST, IRQ_NOAUTOEN);
-	tx_enable(port, 0);
-	rx_enable(port, 1);
-	ms_enable(port, 1);
-
-	/*
-	 * Allocate the IRQ
-	 */
-	retval = request_irq(KS8695_IRQ_UART_TX, ks8695uart_tx_chars, 0, "UART TX", port);
-	if (retval)
-		goto err_tx;
-
-	retval = request_irq(KS8695_IRQ_UART_RX, ks8695uart_rx_chars, 0, "UART RX", port);
-	if (retval)
-		goto err_rx;
-
-	retval = request_irq(KS8695_IRQ_UART_LINE_STATUS, ks8695uart_rx_chars, 0, "UART LineStatus", port);
-	if (retval)
-		goto err_ls;
-
-	retval = request_irq(KS8695_IRQ_UART_MODEM_STATUS, ks8695uart_modem_status, 0, "UART ModemStatus", port);
-	if (retval)
-		goto err_ms;
-
-	return 0;
-
-err_ms:
-	free_irq(KS8695_IRQ_UART_LINE_STATUS, port);
-err_ls:
-	free_irq(KS8695_IRQ_UART_RX, port);
-err_rx:
-	free_irq(KS8695_IRQ_UART_TX, port);
-err_tx:
-	return retval;
-}
-
-static void ks8695uart_shutdown(struct uart_port *port)
-{
-	/*
-	 * Free the interrupt
-	 */
-	free_irq(KS8695_IRQ_UART_RX, port);
-	free_irq(KS8695_IRQ_UART_TX, port);
-	free_irq(KS8695_IRQ_UART_MODEM_STATUS, port);
-	free_irq(KS8695_IRQ_UART_LINE_STATUS, port);
-
-	/* disable break condition and fifos */
-	UART_PUT_LCR(port, UART_GET_LCR(port) & ~URLC_URSBC);
-	UART_PUT_FCR(port, UART_GET_FCR(port) & ~URFC_URFE);
-}
-
-static void ks8695uart_set_termios(struct uart_port *port, struct ktermios *termios, struct ktermios *old)
-{
-	unsigned int lcr, fcr = 0;
-	unsigned long flags;
-	unsigned int baud, quot;
-
-	/*
-	 * Ask the core to calculate the divisor for us.
-	 */
-	baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
-	quot = uart_get_divisor(port, baud);
-
-	switch (termios->c_cflag & CSIZE) {
-	case CS5:
-		lcr = URCL_5;
-		break;
-	case CS6:
-		lcr = URCL_6;
-		break;
-	case CS7:
-		lcr = URCL_7;
-		break;
-	default:
-		lcr = URCL_8;
-		break;
-	}
-
-	/* stop bits */
-	if (termios->c_cflag & CSTOPB)
-		lcr |= URLC_URSB;
-
-	/* parity */
-	if (termios->c_cflag & PARENB) {
-		if (termios->c_cflag & CMSPAR) {	/* Mark or Space parity */
-			if (termios->c_cflag & PARODD)
-				lcr |= URPE_MARK;
-			else
-				lcr |= URPE_SPACE;
-		}
-		else if (termios->c_cflag & PARODD)
-			lcr |= URPE_ODD;
-		else
-			lcr |= URPE_EVEN;
-	}
-
-	if (port->fifosize > 1)
-		fcr = URFC_URFRT_8 | URFC_URTFR | URFC_URRFR | URFC_URFE;
-
-	spin_lock_irqsave(&port->lock, flags);
-
-	/*
-	 * Update the per-port timeout.
-	 */
-	uart_update_timeout(port, termios->c_cflag, baud);
-
-	port->read_status_mask = URLS_URROE;
-	if (termios->c_iflag & INPCK)
-		port->read_status_mask |= (URLS_URFE | URLS_URPE);
-	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
-		port->read_status_mask |= URLS_URBI;
-
-	/*
-	 * Characters to ignore
-	 */
-	port->ignore_status_mask = 0;
-	if (termios->c_iflag & IGNPAR)
-		port->ignore_status_mask |= (URLS_URFE | URLS_URPE);
-	if (termios->c_iflag & IGNBRK) {
-		port->ignore_status_mask |= URLS_URBI;
-		/*
-		 * If we're ignoring parity and break indicators,
-		 * ignore overruns too (for real raw support).
-		 */
-		if (termios->c_iflag & IGNPAR)
-			port->ignore_status_mask |= URLS_URROE;
-	}
-
-	/*
-	 * Ignore all characters if CREAD is not set.
-	 */
-	if ((termios->c_cflag & CREAD) == 0)
-		port->ignore_status_mask |= UART_DUMMY_LSR_RX;
-
-	/* first, disable everything */
-	if (UART_ENABLE_MS(port, termios->c_cflag))
-		ks8695uart_enable_ms(port);
-	else
-		ks8695uart_disable_ms(port);
-
-	/* Set baud rate */
-	UART_PUT_BRDR(port, quot);
-
-	UART_PUT_LCR(port, lcr);
-	UART_PUT_FCR(port, fcr);
-
-	spin_unlock_irqrestore(&port->lock, flags);
-}
-
-static const char *ks8695uart_type(struct uart_port *port)
-{
-	return port->type == PORT_KS8695 ? "KS8695" : NULL;
-}
-
-/*
- * Release the memory region(s) being used by 'port'
- */
-static void ks8695uart_release_port(struct uart_port *port)
-{
-	release_mem_region(port->mapbase, UART_PORT_SIZE);
-}
-
-/*
- * Request the memory region(s) being used by 'port'
- */
-static int ks8695uart_request_port(struct uart_port *port)
-{
-	return request_mem_region(port->mapbase, UART_PORT_SIZE,
-			"serial_ks8695") != NULL ? 0 : -EBUSY;
-}
-
-/*
- * Configure/autoconfigure the port.
- */
-static void ks8695uart_config_port(struct uart_port *port, int flags)
-{
-	if (flags & UART_CONFIG_TYPE) {
-		port->type = PORT_KS8695;
-		ks8695uart_request_port(port);
-	}
-}
-
-/*
- * verify the new serial_struct (for TIOCSSERIAL).
- */
-static int ks8695uart_verify_port(struct uart_port *port, struct serial_struct *ser)
-{
-	int ret = 0;
-
-	if (ser->type != PORT_UNKNOWN && ser->type != PORT_KS8695)
-		ret = -EINVAL;
-	if (ser->irq != port->irq)
-		ret = -EINVAL;
-	if (ser->baud_base < 9600)
-		ret = -EINVAL;
-	return ret;
-}
-
-static struct uart_ops ks8695uart_pops = {
-	.tx_empty	= ks8695uart_tx_empty,
-	.set_mctrl	= ks8695uart_set_mctrl,
-	.get_mctrl	= ks8695uart_get_mctrl,
-	.stop_tx	= ks8695uart_stop_tx,
-	.start_tx	= ks8695uart_start_tx,
-	.stop_rx	= ks8695uart_stop_rx,
-	.enable_ms	= ks8695uart_enable_ms,
-	.break_ctl	= ks8695uart_break_ctl,
-	.startup	= ks8695uart_startup,
-	.shutdown	= ks8695uart_shutdown,
-	.set_termios	= ks8695uart_set_termios,
-	.type		= ks8695uart_type,
-	.release_port	= ks8695uart_release_port,
-	.request_port	= ks8695uart_request_port,
-	.config_port	= ks8695uart_config_port,
-	.verify_port	= ks8695uart_verify_port,
-};
-
-static struct uart_port ks8695uart_ports[SERIAL_KS8695_NR] = {
-	{
-		.membase	= KS8695_UART_VA,
-		.mapbase	= KS8695_UART_PA,
-		.iotype		= SERIAL_IO_MEM,
-		.irq		= KS8695_IRQ_UART_TX,
-		.uartclk	= KS8695_CLOCK_RATE * 16,
-		.fifosize	= 16,
-		.ops		= &ks8695uart_pops,
-		.flags		= UPF_BOOT_AUTOCONF,
-		.line		= 0,
-	}
-};
-
-#ifdef CONFIG_SERIAL_KS8695_CONSOLE
-static void ks8695_console_putchar(struct uart_port *port, int ch)
-{
-	while (!(UART_GET_LSR(port) & URLS_URTHRE))
-		barrier();
-
-	UART_PUT_CHAR(port, ch);
-}
-
-static void ks8695_console_write(struct console *co, const char *s, u_int count)
-{
-	struct uart_port *port = ks8695uart_ports + co->index;
-
-	uart_console_write(port, s, count, ks8695_console_putchar);
-}
-
-static void __init ks8695_console_get_options(struct uart_port *port, int *baud, int *parity, int *bits)
-{
-	unsigned int lcr;
-
-	lcr = UART_GET_LCR(port);
-
-	switch (lcr & URLC_PARITY) {
-		case URPE_ODD:
-			*parity = 'o';
-			break;
-		case URPE_EVEN:
-			*parity = 'e';
-			break;
-		default:
-			*parity = 'n';
-	}
-
-	switch (lcr & URLC_URCL) {
-		case URCL_5:
-			*bits = 5;
-			break;
-		case URCL_6:
-			*bits = 6;
-			break;
-		case URCL_7:
-			*bits = 7;
-			break;
-		default:
-			*bits = 8;
-	}
-
-	*baud = port->uartclk / (UART_GET_BRDR(port) & 0x0FFF);
-	*baud /= 16;
-	*baud &= 0xFFFFFFF0;
-}
-
-static int __init ks8695_console_setup(struct console *co, char *options)
-{
-	struct uart_port *port;
-	int baud = 115200;
-	int bits = 8;
-	int parity = 'n';
-	int flow = 'n';
-
-	/*
-	 * Check whether an invalid uart number has been specified, and
-	 * if so, search for the first available port that does have
-	 * console support.
-	 */
-	port = uart_get_console(ks8695uart_ports, SERIAL_KS8695_NR, co);
-
-	if (options)
-		uart_parse_options(options, &baud, &parity, &bits, &flow);
-	else
-		ks8695_console_get_options(port, &baud, &parity, &bits);
-
-	return uart_set_options(port, co, baud, parity, bits, flow);
-}
-
-static struct uart_driver ks8695_reg;
-
-static struct console ks8695_console = {
-	.name		= SERIAL_KS8695_DEVNAME,
-	.write		= ks8695_console_write,
-	.device		= uart_console_device,
-	.setup		= ks8695_console_setup,
-	.flags		= CON_PRINTBUFFER,
-	.index		= -1,
-	.data		= &ks8695_reg,
-};
-
-static int __init ks8695_console_init(void)
-{
-	add_preferred_console(SERIAL_KS8695_DEVNAME, 0, NULL);
-	register_console(&ks8695_console);
-	return 0;
-}
-
-console_initcall(ks8695_console_init);
-
-#define KS8695_CONSOLE	&ks8695_console
-#else
-#define KS8695_CONSOLE	NULL
-#endif
-
-static struct uart_driver ks8695_reg = {
-	.owner			= THIS_MODULE,
-	.driver_name		= "serial_ks8695",
-	.dev_name		= SERIAL_KS8695_DEVNAME,
-	.major			= SERIAL_KS8695_MAJOR,
-	.minor			= SERIAL_KS8695_MINOR,
-	.nr			= SERIAL_KS8695_NR,
-	.cons			= KS8695_CONSOLE,
-};
-
-static int __init ks8695uart_init(void)
-{
-	int i, ret;
-
-	printk(KERN_INFO "Serial: Micrel KS8695 UART driver\n");
-
-	ret = uart_register_driver(&ks8695_reg);
-	if (ret)
-		return ret;
-
-	for (i = 0; i < SERIAL_KS8695_NR; i++)
-		uart_add_one_port(&ks8695_reg, &ks8695uart_ports[0]);
-
-	return 0;
-}
-
-static void __exit ks8695uart_exit(void)
-{
-	int i;
-
-	for (i = 0; i < SERIAL_KS8695_NR; i++)
-		uart_remove_one_port(&ks8695_reg, &ks8695uart_ports[0]);
-	uart_unregister_driver(&ks8695_reg);
-}
-
-module_init(ks8695uart_init);
-module_exit(ks8695uart_exit);
-
-MODULE_DESCRIPTION("KS8695 serial port driver");
-MODULE_AUTHOR("Micrel Inc.");
-MODULE_LICENSE("GPL");
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
index 3cc3af1c2ee1..e8dc1787c3c6 100644
--- a/include/uapi/linux/serial_core.h
+++ b/include/uapi/linux/serial_core.h
@@ -161,9 +161,6 @@
 /* Blackfin bf5xx */
 #define PORT_BFIN	75
 
-/* Micrel KS8695 */
-#define PORT_KS8695	76
-
 /* Broadcom SB1250, etc. SOC */
 #define PORT_SB1250_DUART	77
 
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 03/16] gpio: remove ks8695 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 01/16] ARM: remove ks8695 platform Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 02/16] serial: remove ks8695 driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-10  9:03   ` Linus Walleij
  2019-08-09 20:27 ` [PATCH 04/16] watchdog: " Arnd Bergmann
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Linus Walleij, Bartosz Golaszewski, linux-kernel,
	linux-gpio

The platform is getting removed, so there are no remaining
users of this driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpio/Makefile      |   1 -
 drivers/gpio/gpio-ks8695.c | 284 -------------------------------------
 2 files changed, 285 deletions(-)
 delete mode 100644 drivers/gpio/gpio-ks8695.c

diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index a4e91175c708..65d74084c9b2 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -67,7 +67,6 @@ obj-$(CONFIG_GPIO_IT87)			+= gpio-it87.o
 obj-$(CONFIG_GPIO_IXP4XX)		+= gpio-ixp4xx.o
 obj-$(CONFIG_GPIO_JANZ_TTL)		+= gpio-janz-ttl.o
 obj-$(CONFIG_GPIO_KEMPLD)		+= gpio-kempld.o
-obj-$(CONFIG_ARCH_KS8695)		+= gpio-ks8695.o
 obj-$(CONFIG_GPIO_LOONGSON1)		+= gpio-loongson1.o
 obj-$(CONFIG_GPIO_LOONGSON)		+= gpio-loongson.o
 obj-$(CONFIG_GPIO_LP3943)		+= gpio-lp3943.o
diff --git a/drivers/gpio/gpio-ks8695.c b/drivers/gpio/gpio-ks8695.c
deleted file mode 100644
index a0f87c124894..000000000000
--- a/drivers/gpio/gpio-ks8695.c
+++ /dev/null
@@ -1,284 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * arch/arm/mach-ks8695/gpio.c
- *
- * Copyright (C) 2006 Andrew Victor
- * Updated to GPIOLIB, Copyright 2008 Simtec Electronics
- *                     Daniel Silverstone <dsilvers@simtec.co.uk>
- */
-#include <linux/gpio/driver.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/init.h>
-#include <linux/debugfs.h>
-#include <linux/seq_file.h>
-#include <linux/module.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-#include <asm/mach/irq.h>
-
-#include <mach/regs-gpio.h>
-#include <mach/gpio-ks8695.h>
-
-/*
- * Configure a GPIO line for either GPIO function, or its internal
- * function (Interrupt, Timer, etc).
- */
-static void ks8695_gpio_mode(unsigned int pin, short gpio)
-{
-	unsigned int enable[] = { IOPC_IOEINT0EN, IOPC_IOEINT1EN, IOPC_IOEINT2EN, IOPC_IOEINT3EN, IOPC_IOTIM0EN, IOPC_IOTIM1EN };
-	unsigned long x, flags;
-
-	if (pin > KS8695_GPIO_5)	/* only GPIO 0..5 have internal functions */
-		return;
-
-	local_irq_save(flags);
-
-	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPC);
-	if (gpio)			/* GPIO: set bit to 0 */
-		x &= ~enable[pin];
-	else				/* Internal function: set bit to 1 */
-		x |= enable[pin];
-	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPC);
-
-	local_irq_restore(flags);
-}
-
-
-static unsigned short gpio_irq[] = { KS8695_IRQ_EXTERN0, KS8695_IRQ_EXTERN1, KS8695_IRQ_EXTERN2, KS8695_IRQ_EXTERN3 };
-
-/*
- * Configure GPIO pin as external interrupt source.
- */
-int ks8695_gpio_interrupt(unsigned int pin, unsigned int type)
-{
-	unsigned long x, flags;
-
-	if (pin > KS8695_GPIO_3)	/* only GPIO 0..3 can generate IRQ */
-		return -EINVAL;
-
-	local_irq_save(flags);
-
-	/* set pin as input */
-	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
-	x &= ~IOPM(pin);
-	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
-
-	local_irq_restore(flags);
-
-	/* Set IRQ triggering type */
-	irq_set_irq_type(gpio_irq[pin], type);
-
-	/* enable interrupt mode */
-	ks8695_gpio_mode(pin, 0);
-
-	return 0;
-}
-EXPORT_SYMBOL(ks8695_gpio_interrupt);
-
-
-
-/* .... Generic GPIO interface .............................................. */
-
-/*
- * Configure the GPIO line as an input.
- */
-static int ks8695_gpio_direction_input(struct gpio_chip *gc, unsigned int pin)
-{
-	unsigned long x, flags;
-
-	if (pin > KS8695_GPIO_15)
-		return -EINVAL;
-
-	/* set pin to GPIO mode */
-	ks8695_gpio_mode(pin, 1);
-
-	local_irq_save(flags);
-
-	/* set pin as input */
-	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
-	x &= ~IOPM(pin);
-	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
-
-	local_irq_restore(flags);
-
-	return 0;
-}
-
-
-/*
- * Configure the GPIO line as an output, with default state.
- */
-static int ks8695_gpio_direction_output(struct gpio_chip *gc,
-					unsigned int pin, int state)
-{
-	unsigned long x, flags;
-
-	if (pin > KS8695_GPIO_15)
-		return -EINVAL;
-
-	/* set pin to GPIO mode */
-	ks8695_gpio_mode(pin, 1);
-
-	local_irq_save(flags);
-
-	/* set line state */
-	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
-	if (state)
-		x |= IOPD(pin);
-	else
-		x &= ~IOPD(pin);
-	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
-
-	/* set pin as output */
-	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
-	x |= IOPM(pin);
-	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
-
-	local_irq_restore(flags);
-
-	return 0;
-}
-
-
-/*
- * Set the state of an output GPIO line.
- */
-static void ks8695_gpio_set_value(struct gpio_chip *gc,
-				  unsigned int pin, int state)
-{
-	unsigned long x, flags;
-
-	if (pin > KS8695_GPIO_15)
-		return;
-
-	local_irq_save(flags);
-
-	/* set output line state */
-	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
-	if (state)
-		x |= IOPD(pin);
-	else
-		x &= ~IOPD(pin);
-	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
-
-	local_irq_restore(flags);
-}
-
-
-/*
- * Read the state of a GPIO line.
- */
-static int ks8695_gpio_get_value(struct gpio_chip *gc, unsigned int pin)
-{
-	unsigned long x;
-
-	if (pin > KS8695_GPIO_15)
-		return -EINVAL;
-
-	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
-	return (x & IOPD(pin)) != 0;
-}
-
-
-/*
- * Map GPIO line to IRQ number.
- */
-static int ks8695_gpio_to_irq(struct gpio_chip *gc, unsigned int pin)
-{
-	if (pin > KS8695_GPIO_3)	/* only GPIO 0..3 can generate IRQ */
-		return -EINVAL;
-
-	return gpio_irq[pin];
-}
-
-/* GPIOLIB interface */
-
-static struct gpio_chip ks8695_gpio_chip = {
-	.label			= "KS8695",
-	.direction_input	= ks8695_gpio_direction_input,
-	.direction_output	= ks8695_gpio_direction_output,
-	.get			= ks8695_gpio_get_value,
-	.set			= ks8695_gpio_set_value,
-	.to_irq			= ks8695_gpio_to_irq,
-	.base			= 0,
-	.ngpio			= 16,
-	.can_sleep		= false,
-};
-
-/* Register the GPIOs */
-void ks8695_register_gpios(void)
-{
-	if (gpiochip_add_data(&ks8695_gpio_chip, NULL))
-		printk(KERN_ERR "Unable to register core GPIOs\n");
-}
-
-/* .... Debug interface ..................................................... */
-
-#ifdef CONFIG_DEBUG_FS
-
-static int ks8695_gpio_show(struct seq_file *s, void *unused)
-{
-	unsigned int enable[] = { IOPC_IOEINT0EN, IOPC_IOEINT1EN, IOPC_IOEINT2EN, IOPC_IOEINT3EN, IOPC_IOTIM0EN, IOPC_IOTIM1EN };
-	unsigned int intmask[] = { IOPC_IOEINT0TM, IOPC_IOEINT1TM, IOPC_IOEINT2TM, IOPC_IOEINT3TM };
-	unsigned long mode, ctrl, data;
-	int i;
-
-	mode = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
-	ctrl = __raw_readl(KS8695_GPIO_VA + KS8695_IOPC);
-	data = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
-
-	seq_printf(s, "Pin\tI/O\tFunction\tState\n\n");
-
-	for (i = KS8695_GPIO_0; i <= KS8695_GPIO_15 ; i++) {
-		seq_printf(s, "%i:\t", i);
-
-		seq_printf(s, "%s\t", (mode & IOPM(i)) ? "Output" : "Input");
-
-		if (i <= KS8695_GPIO_3) {
-			if (ctrl & enable[i]) {
-				seq_printf(s, "EXT%i ", i);
-
-				switch ((ctrl & intmask[i]) >> (4 * i)) {
-				case IOPC_TM_LOW:
-					seq_printf(s, "(Low)");		break;
-				case IOPC_TM_HIGH:
-					seq_printf(s, "(High)");	break;
-				case IOPC_TM_RISING:
-					seq_printf(s, "(Rising)");	break;
-				case IOPC_TM_FALLING:
-					seq_printf(s, "(Falling)");	break;
-				case IOPC_TM_EDGE:
-					seq_printf(s, "(Edges)");	break;
-				}
-			} else
-				seq_printf(s, "GPIO\t");
-		} else if (i <= KS8695_GPIO_5) {
-			if (ctrl & enable[i])
-				seq_printf(s, "TOUT%i\t", i - KS8695_GPIO_4);
-			else
-				seq_printf(s, "GPIO\t");
-		} else {
-			seq_printf(s, "GPIO\t");
-		}
-
-		seq_printf(s, "\t");
-
-		seq_printf(s, "%i\n", (data & IOPD(i)) ? 1 : 0);
-	}
-	return 0;
-}
-
-DEFINE_SHOW_ATTRIBUTE(ks8695_gpio);
-
-static int __init ks8695_gpio_debugfs_init(void)
-{
-	/* /sys/kernel/debug/ks8695_gpio */
-	debugfs_create_file("ks8695_gpio", S_IFREG | S_IRUGO, NULL, NULL,
-				&ks8695_gpio_fops);
-	return 0;
-}
-postcore_initcall(ks8695_gpio_debugfs_init);
-
-#endif
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 04/16] watchdog: remove ks8695 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (2 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 03/16] gpio: " Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 20:42   ` Guenter Roeck
  2019-08-09 20:27 ` [PATCH 05/16] net: " Arnd Bergmann
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Wim Van Sebroeck, Guenter Roeck, Jonathan Corbet,
	linux-watchdog, linux-doc, linux-kernel

The platform is getting removed, so there are no remaining
users of this driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../watchdog/watchdog-parameters.rst          |   9 -
 drivers/watchdog/Kconfig                      |   7 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/ks8695_wdt.c                 | 319 ------------------
 4 files changed, 336 deletions(-)
 delete mode 100644 drivers/watchdog/ks8695_wdt.c

diff --git a/Documentation/watchdog/watchdog-parameters.rst b/Documentation/watchdog/watchdog-parameters.rst
index a3985cc5aeda..226aba56f704 100644
--- a/Documentation/watchdog/watchdog-parameters.rst
+++ b/Documentation/watchdog/watchdog-parameters.rst
@@ -301,15 +301,6 @@ ixp4xx_wdt:
 
 -------------------------------------------------
 
-ks8695_wdt:
-    wdt_time:
-	Watchdog time in seconds. (default=5)
-    nowayout:
-	Watchdog cannot be stopped once started
-	(default=kernel config parameter)
-
--------------------------------------------------
-
 machzwd:
     nowayout:
 	Watchdog cannot be stopped once started
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 8188963a405b..e631f1ae303a 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -477,13 +477,6 @@ config IXP4XX_WATCHDOG
 
 	  Say N if you are unsure.
 
-config KS8695_WATCHDOG
-	tristate "KS8695 watchdog"
-	depends on ARCH_KS8695
-	help
-	  Watchdog timer embedded into KS8695 processor. This will reboot your
-	  system when the timeout is reached.
-
 config HAVE_S3C2410_WATCHDOG
 	bool
 	help
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 7caa920e7e60..85f55ec76f8d 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -49,7 +49,6 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
 obj-$(CONFIG_977_WATCHDOG) += wdt977.o
 obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
 obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
-obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
 obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
 obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
 obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c
deleted file mode 100644
index 1550ce3c5702..000000000000
--- a/drivers/watchdog/ks8695_wdt.c
+++ /dev/null
@@ -1,319 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Watchdog driver for Kendin/Micrel KS8695.
- *
- * (C) 2007 Andrew Victor
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/bitops.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/platform_device.h>
-#include <linux/types.h>
-#include <linux/watchdog.h>
-#include <linux/io.h>
-#include <linux/uaccess.h>
-#include <mach/hardware.h>
-
-#define KS8695_TMR_OFFSET	(0xF0000 + 0xE400)
-#define KS8695_TMR_VA		(KS8695_IO_VA + KS8695_TMR_OFFSET)
-
-/*
- * Timer registers
- */
-#define KS8695_TMCON		(0x00)		/* Timer Control Register */
-#define KS8695_T0TC		(0x08)		/* Timer 0 Timeout Count Register */
-#define TMCON_T0EN		(1 << 0)	/* Timer 0 Enable */
-
-/* Timer0 Timeout Counter Register */
-#define T0TC_WATCHDOG		(0xff)		/* Enable watchdog mode */
-
-#define WDT_DEFAULT_TIME	5	/* seconds */
-#define WDT_MAX_TIME		171	/* seconds */
-
-static int wdt_time = WDT_DEFAULT_TIME;
-static bool nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(wdt_time, int, 0);
-MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="
-					__MODULE_STRING(WDT_DEFAULT_TIME) ")");
-
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-module_param(nowayout, bool, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-#endif
-
-
-static unsigned long ks8695wdt_busy;
-static DEFINE_SPINLOCK(ks8695_lock);
-
-/* ......................................................................... */
-
-/*
- * Disable the watchdog.
- */
-static inline void ks8695_wdt_stop(void)
-{
-	unsigned long tmcon;
-
-	spin_lock(&ks8695_lock);
-	/* disable timer0 */
-	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-	__raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-	spin_unlock(&ks8695_lock);
-}
-
-/*
- * Enable and reset the watchdog.
- */
-static inline void ks8695_wdt_start(void)
-{
-	unsigned long tmcon;
-	unsigned long tval = wdt_time * KS8695_CLOCK_RATE;
-
-	spin_lock(&ks8695_lock);
-	/* disable timer0 */
-	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-	__raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-
-	/* program timer0 */
-	__raw_writel(tval | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
-
-	/* re-enable timer0 */
-	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-	__raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-	spin_unlock(&ks8695_lock);
-}
-
-/*
- * Reload the watchdog timer.  (ie, pat the watchdog)
- */
-static inline void ks8695_wdt_reload(void)
-{
-	unsigned long tmcon;
-
-	spin_lock(&ks8695_lock);
-	/* disable, then re-enable timer0 */
-	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-	__raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-	__raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-	spin_unlock(&ks8695_lock);
-}
-
-/*
- * Change the watchdog time interval.
- */
-static int ks8695_wdt_settimeout(int new_time)
-{
-	/*
-	 * All counting occurs at KS8695_CLOCK_RATE / 128 = 0.256 Hz
-	 *
-	 * Since WDV is a 16-bit counter, the maximum period is
-	 * 65536 / 0.256 = 256 seconds.
-	 */
-	if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
-		return -EINVAL;
-
-	/* Set new watchdog time. It will be used when
-	   ks8695_wdt_start() is called. */
-	wdt_time = new_time;
-	return 0;
-}
-
-/* ......................................................................... */
-
-/*
- * Watchdog device is opened, and watchdog starts running.
- */
-static int ks8695_wdt_open(struct inode *inode, struct file *file)
-{
-	if (test_and_set_bit(0, &ks8695wdt_busy))
-		return -EBUSY;
-
-	ks8695_wdt_start();
-	return stream_open(inode, file);
-}
-
-/*
- * Close the watchdog device.
- * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also
- *  disabled.
- */
-static int ks8695_wdt_close(struct inode *inode, struct file *file)
-{
-	/* Disable the watchdog when file is closed */
-	if (!nowayout)
-		ks8695_wdt_stop();
-	clear_bit(0, &ks8695wdt_busy);
-	return 0;
-}
-
-static const struct watchdog_info ks8695_wdt_info = {
-	.identity	= "ks8695 watchdog",
-	.options	= WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-};
-
-/*
- * Handle commands from user-space.
- */
-static long ks8695_wdt_ioctl(struct file *file, unsigned int cmd,
-							unsigned long arg)
-{
-	void __user *argp = (void __user *)arg;
-	int __user *p = argp;
-	int new_value;
-
-	switch (cmd) {
-	case WDIOC_GETSUPPORT:
-		return copy_to_user(argp, &ks8695_wdt_info,
-					sizeof(ks8695_wdt_info)) ? -EFAULT : 0;
-	case WDIOC_GETSTATUS:
-	case WDIOC_GETBOOTSTATUS:
-		return put_user(0, p);
-	case WDIOC_SETOPTIONS:
-		if (get_user(new_value, p))
-			return -EFAULT;
-		if (new_value & WDIOS_DISABLECARD)
-			ks8695_wdt_stop();
-		if (new_value & WDIOS_ENABLECARD)
-			ks8695_wdt_start();
-		return 0;
-	case WDIOC_KEEPALIVE:
-		ks8695_wdt_reload();	/* pat the watchdog */
-		return 0;
-	case WDIOC_SETTIMEOUT:
-		if (get_user(new_value, p))
-			return -EFAULT;
-		if (ks8695_wdt_settimeout(new_value))
-			return -EINVAL;
-		/* Enable new time value */
-		ks8695_wdt_start();
-		/* Return current value */
-		return put_user(wdt_time, p);
-	case WDIOC_GETTIMEOUT:
-		return put_user(wdt_time, p);
-	default:
-		return -ENOTTY;
-	}
-}
-
-/*
- * Pat the watchdog whenever device is written to.
- */
-static ssize_t ks8695_wdt_write(struct file *file, const char *data,
-						size_t len, loff_t *ppos)
-{
-	ks8695_wdt_reload();		/* pat the watchdog */
-	return len;
-}
-
-/* ......................................................................... */
-
-static const struct file_operations ks8695wdt_fops = {
-	.owner		= THIS_MODULE,
-	.llseek		= no_llseek,
-	.unlocked_ioctl	= ks8695_wdt_ioctl,
-	.open		= ks8695_wdt_open,
-	.release	= ks8695_wdt_close,
-	.write		= ks8695_wdt_write,
-};
-
-static struct miscdevice ks8695wdt_miscdev = {
-	.minor		= WATCHDOG_MINOR,
-	.name		= "watchdog",
-	.fops		= &ks8695wdt_fops,
-};
-
-static int ks8695wdt_probe(struct platform_device *pdev)
-{
-	int res;
-
-	if (ks8695wdt_miscdev.parent)
-		return -EBUSY;
-	ks8695wdt_miscdev.parent = &pdev->dev;
-
-	res = misc_register(&ks8695wdt_miscdev);
-	if (res)
-		return res;
-
-	pr_info("KS8695 Watchdog Timer enabled (%d seconds%s)\n",
-		wdt_time, nowayout ? ", nowayout" : "");
-	return 0;
-}
-
-static int ks8695wdt_remove(struct platform_device *pdev)
-{
-	misc_deregister(&ks8695wdt_miscdev);
-	ks8695wdt_miscdev.parent = NULL;
-
-	return 0;
-}
-
-static void ks8695wdt_shutdown(struct platform_device *pdev)
-{
-	ks8695_wdt_stop();
-}
-
-#ifdef CONFIG_PM
-
-static int ks8695wdt_suspend(struct platform_device *pdev, pm_message_t message)
-{
-	ks8695_wdt_stop();
-	return 0;
-}
-
-static int ks8695wdt_resume(struct platform_device *pdev)
-{
-	if (ks8695wdt_busy)
-		ks8695_wdt_start();
-	return 0;
-}
-
-#else
-#define ks8695wdt_suspend NULL
-#define ks8695wdt_resume	NULL
-#endif
-
-static struct platform_driver ks8695wdt_driver = {
-	.probe		= ks8695wdt_probe,
-	.remove		= ks8695wdt_remove,
-	.shutdown	= ks8695wdt_shutdown,
-	.suspend	= ks8695wdt_suspend,
-	.resume		= ks8695wdt_resume,
-	.driver		= {
-		.name	= "ks8695_wdt",
-	},
-};
-
-static int __init ks8695_wdt_init(void)
-{
-	/* Check that the heartbeat value is within range;
-	   if not reset to the default */
-	if (ks8695_wdt_settimeout(wdt_time)) {
-		ks8695_wdt_settimeout(WDT_DEFAULT_TIME);
-		pr_info("ks8695_wdt: wdt_time value must be 1 <= wdt_time <= %i"
-					", using %d\n", wdt_time, WDT_MAX_TIME);
-	}
-	return platform_driver_register(&ks8695wdt_driver);
-}
-
-static void __exit ks8695_wdt_exit(void)
-{
-	platform_driver_unregister(&ks8695wdt_driver);
-}
-
-module_init(ks8695_wdt_init);
-module_exit(ks8695_wdt_exit);
-
-MODULE_AUTHOR("Andrew Victor");
-MODULE_DESCRIPTION("Watchdog driver for KS8695");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:ks8695_wdt");
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 05/16] net: remove ks8695 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (3 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 04/16] watchdog: " Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 06/16] watchdog: remove w90x900 driver Arnd Bergmann
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc; +Cc: Arnd Bergmann, David S. Miller, linux-kernel, netdev

The platform is getting removed, so there are no remaining
users of this driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/micrel/Kconfig     |   11 +-
 drivers/net/ethernet/micrel/Makefile    |    1 -
 drivers/net/ethernet/micrel/ks8695net.c | 1632 -----------------------
 drivers/net/ethernet/micrel/ks8695net.h |  108 --
 4 files changed, 1 insertion(+), 1751 deletions(-)
 delete mode 100644 drivers/net/ethernet/micrel/ks8695net.c
 delete mode 100644 drivers/net/ethernet/micrel/ks8695net.h

diff --git a/drivers/net/ethernet/micrel/Kconfig b/drivers/net/ethernet/micrel/Kconfig
index 90a8c6bead56..b9c4d48e28e4 100644
--- a/drivers/net/ethernet/micrel/Kconfig
+++ b/drivers/net/ethernet/micrel/Kconfig
@@ -6,8 +6,7 @@
 config NET_VENDOR_MICREL
 	bool "Micrel devices"
 	default y
-	depends on (HAS_IOMEM && DMA_ENGINE) || SPI || PCI || HAS_IOMEM || \
-		   (ARM && ARCH_KS8695)
+	depends on (HAS_IOMEM && DMA_ENGINE) || SPI || PCI || HAS_IOMEM
 	---help---
 	  If you have a network (Ethernet) card belonging to this class, say Y.
 
@@ -18,14 +17,6 @@ config NET_VENDOR_MICREL
 
 if NET_VENDOR_MICREL
 
-config ARM_KS8695_ETHER
-	tristate "KS8695 Ethernet support"
-	depends on ARM && ARCH_KS8695
-	select MII
-	---help---
-	  If you wish to compile a kernel for the KS8695 and want to
-	  use the internal ethernet then you should answer Y to this.
-
 config KS8842
 	tristate "Micrel KSZ8841/42 with generic bus interface"
 	depends on HAS_IOMEM && DMA_ENGINE
diff --git a/drivers/net/ethernet/micrel/Makefile b/drivers/net/ethernet/micrel/Makefile
index 848fc1c5a5dc..6d8ac5527aef 100644
--- a/drivers/net/ethernet/micrel/Makefile
+++ b/drivers/net/ethernet/micrel/Makefile
@@ -3,7 +3,6 @@
 # Makefile for the Micrel network device drivers.
 #
 
-obj-$(CONFIG_ARM_KS8695_ETHER) += ks8695net.o
 obj-$(CONFIG_KS8842) += ks8842.o
 obj-$(CONFIG_KS8851) += ks8851.o
 obj-$(CONFIG_KS8851_MLL) += ks8851_mll.o
diff --git a/drivers/net/ethernet/micrel/ks8695net.c b/drivers/net/ethernet/micrel/ks8695net.c
deleted file mode 100644
index 1390ef5323a2..000000000000
--- a/drivers/net/ethernet/micrel/ks8695net.c
+++ /dev/null
@@ -1,1632 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Micrel KS8695 (Centaur) Ethernet.
- *
- * Copyright 2008 Simtec Electronics
- *		  Daniel Silverstone <dsilvers@simtec.co.uk>
- *		  Vincent Sanders <vince@simtec.co.uk>
- */
-
-#include <linux/dma-mapping.h>
-#include <linux/module.h>
-#include <linux/ioport.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/interrupt.h>
-#include <linux/skbuff.h>
-#include <linux/spinlock.h>
-#include <linux/crc32.h>
-#include <linux/mii.h>
-#include <linux/ethtool.h>
-#include <linux/delay.h>
-#include <linux/platform_device.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-
-#include <asm/irq.h>
-
-#include <mach/regs-switch.h>
-#include <mach/regs-misc.h>
-#include <asm/mach/irq.h>
-#include <mach/regs-irq.h>
-
-#include "ks8695net.h"
-
-#define MODULENAME	"ks8695_ether"
-#define MODULEVERSION	"1.02"
-
-/*
- * Transmit and device reset timeout, default 5 seconds.
- */
-static int watchdog = 5000;
-
-/* Hardware structures */
-
-/**
- *	struct rx_ring_desc - Receive descriptor ring element
- *	@status: The status of the descriptor element (E.g. who owns it)
- *	@length: The number of bytes in the block pointed to by data_ptr
- *	@data_ptr: The physical address of the data block to receive into
- *	@next_desc: The physical address of the next descriptor element.
- */
-struct rx_ring_desc {
-	__le32	status;
-	__le32	length;
-	__le32	data_ptr;
-	__le32	next_desc;
-};
-
-/**
- *	struct tx_ring_desc - Transmit descriptor ring element
- *	@owner: Who owns the descriptor
- *	@status: The number of bytes in the block pointed to by data_ptr
- *	@data_ptr: The physical address of the data block to receive into
- *	@next_desc: The physical address of the next descriptor element.
- */
-struct tx_ring_desc {
-	__le32	owner;
-	__le32	status;
-	__le32	data_ptr;
-	__le32	next_desc;
-};
-
-/**
- *	struct ks8695_skbuff - sk_buff wrapper for rx/tx rings.
- *	@skb: The buffer in the ring
- *	@dma_ptr: The mapped DMA pointer of the buffer
- *	@length: The number of bytes mapped to dma_ptr
- */
-struct ks8695_skbuff {
-	struct sk_buff	*skb;
-	dma_addr_t	dma_ptr;
-	u32		length;
-};
-
-/* Private device structure */
-
-#define MAX_TX_DESC 8
-#define MAX_TX_DESC_MASK 0x7
-#define MAX_RX_DESC 16
-#define MAX_RX_DESC_MASK 0xf
-
-/*napi_weight have better more than rx DMA buffers*/
-#define NAPI_WEIGHT   64
-
-#define MAX_RXBUF_SIZE 0x700
-
-#define TX_RING_DMA_SIZE (sizeof(struct tx_ring_desc) * MAX_TX_DESC)
-#define RX_RING_DMA_SIZE (sizeof(struct rx_ring_desc) * MAX_RX_DESC)
-#define RING_DMA_SIZE (TX_RING_DMA_SIZE + RX_RING_DMA_SIZE)
-
-/**
- *	enum ks8695_dtype - Device type
- *	@KS8695_DTYPE_WAN: This device is a WAN interface
- *	@KS8695_DTYPE_LAN: This device is a LAN interface
- *	@KS8695_DTYPE_HPNA: This device is an HPNA interface
- */
-enum ks8695_dtype {
-	KS8695_DTYPE_WAN,
-	KS8695_DTYPE_LAN,
-	KS8695_DTYPE_HPNA,
-};
-
-/**
- *	struct ks8695_priv - Private data for the KS8695 Ethernet
- *	@in_suspend: Flag to indicate if we're suspending/resuming
- *	@ndev: The net_device for this interface
- *	@dev: The platform device object for this interface
- *	@dtype: The type of this device
- *	@io_regs: The ioremapped registers for this interface
- *      @napi : Add support NAPI for Rx
- *	@rx_irq_name: The textual name of the RX IRQ from the platform data
- *	@tx_irq_name: The textual name of the TX IRQ from the platform data
- *	@link_irq_name: The textual name of the link IRQ from the
- *			platform data if available
- *	@rx_irq: The IRQ number for the RX IRQ
- *	@tx_irq: The IRQ number for the TX IRQ
- *	@link_irq: The IRQ number for the link IRQ if available
- *	@regs_req: The resource request for the registers region
- *	@phyiface_req: The resource request for the phy/switch region
- *		       if available
- *	@phyiface_regs: The ioremapped registers for the phy/switch if available
- *	@ring_base: The base pointer of the dma coherent memory for the rings
- *	@ring_base_dma: The DMA mapped equivalent of ring_base
- *	@tx_ring: The pointer in ring_base of the TX ring
- *	@tx_ring_used: The number of slots in the TX ring which are occupied
- *	@tx_ring_next_slot: The next slot to fill in the TX ring
- *	@tx_ring_dma: The DMA mapped equivalent of tx_ring
- *	@tx_buffers: The sk_buff mappings for the TX ring
- *	@txq_lock: A lock to protect the tx_buffers tx_ring_used etc variables
- *	@rx_ring: The pointer in ring_base of the RX ring
- *	@rx_ring_dma: The DMA mapped equivalent of rx_ring
- *	@rx_buffers: The sk_buff mappings for the RX ring
- *	@next_rx_desc_read: The next RX descriptor to read from on IRQ
- *      @rx_lock: A lock to protect Rx irq function
- *	@msg_enable: The flags for which messages to emit
- */
-struct ks8695_priv {
-	int in_suspend;
-	struct net_device *ndev;
-	struct device *dev;
-	enum ks8695_dtype dtype;
-	void __iomem *io_regs;
-
-	struct napi_struct	napi;
-
-	const char *rx_irq_name, *tx_irq_name, *link_irq_name;
-	int rx_irq, tx_irq, link_irq;
-
-	struct resource *regs_req, *phyiface_req;
-	void __iomem *phyiface_regs;
-
-	void *ring_base;
-	dma_addr_t ring_base_dma;
-
-	struct tx_ring_desc *tx_ring;
-	int tx_ring_used;
-	int tx_ring_next_slot;
-	dma_addr_t tx_ring_dma;
-	struct ks8695_skbuff tx_buffers[MAX_TX_DESC];
-	spinlock_t txq_lock;
-
-	struct rx_ring_desc *rx_ring;
-	dma_addr_t rx_ring_dma;
-	struct ks8695_skbuff rx_buffers[MAX_RX_DESC];
-	int next_rx_desc_read;
-	spinlock_t rx_lock;
-
-	int msg_enable;
-};
-
-/* Register access */
-
-/**
- *	ks8695_readreg - Read from a KS8695 ethernet register
- *	@ksp: The device to read from
- *	@reg: The register to read
- */
-static inline u32
-ks8695_readreg(struct ks8695_priv *ksp, int reg)
-{
-	return readl(ksp->io_regs + reg);
-}
-
-/**
- *	ks8695_writereg - Write to a KS8695 ethernet register
- *	@ksp: The device to write to
- *	@reg: The register to write
- *	@value: The value to write to the register
- */
-static inline void
-ks8695_writereg(struct ks8695_priv *ksp, int reg, u32 value)
-{
-	writel(value, ksp->io_regs + reg);
-}
-
-/* Utility functions */
-
-/**
- *	ks8695_port_type - Retrieve port-type as user-friendly string
- *	@ksp: The device to return the type for
- *
- *	Returns a string indicating which of the WAN, LAN or HPNA
- *	ports this device is likely to represent.
- */
-static const char *
-ks8695_port_type(struct ks8695_priv *ksp)
-{
-	switch (ksp->dtype) {
-	case KS8695_DTYPE_LAN:
-		return "LAN";
-	case KS8695_DTYPE_WAN:
-		return "WAN";
-	case KS8695_DTYPE_HPNA:
-		return "HPNA";
-	}
-
-	return "UNKNOWN";
-}
-
-/**
- *	ks8695_update_mac - Update the MAC registers in the device
- *	@ksp: The device to update
- *
- *	Updates the MAC registers in the KS8695 device from the address in the
- *	net_device structure associated with this interface.
- */
-static void
-ks8695_update_mac(struct ks8695_priv *ksp)
-{
-	/* Update the HW with the MAC from the net_device */
-	struct net_device *ndev = ksp->ndev;
-	u32 machigh, maclow;
-
-	maclow	= ((ndev->dev_addr[2] << 24) | (ndev->dev_addr[3] << 16) |
-		   (ndev->dev_addr[4] <<  8) | (ndev->dev_addr[5] <<  0));
-	machigh = ((ndev->dev_addr[0] <<  8) | (ndev->dev_addr[1] <<  0));
-
-	ks8695_writereg(ksp, KS8695_MAL, maclow);
-	ks8695_writereg(ksp, KS8695_MAH, machigh);
-
-}
-
-/**
- *	ks8695_refill_rxbuffers - Re-fill the RX buffer ring
- *	@ksp: The device to refill
- *
- *	Iterates the RX ring of the device looking for empty slots.
- *	For each empty slot, we allocate and map a new SKB and give it
- *	to the hardware.
- *	This can be called from interrupt context safely.
- */
-static void
-ks8695_refill_rxbuffers(struct ks8695_priv *ksp)
-{
-	/* Run around the RX ring, filling in any missing sk_buff's */
-	int buff_n;
-
-	for (buff_n = 0; buff_n < MAX_RX_DESC; ++buff_n) {
-		if (!ksp->rx_buffers[buff_n].skb) {
-			struct sk_buff *skb =
-				netdev_alloc_skb(ksp->ndev, MAX_RXBUF_SIZE);
-			dma_addr_t mapping;
-
-			ksp->rx_buffers[buff_n].skb = skb;
-			if (skb == NULL) {
-				/* Failed to allocate one, perhaps
-				 * we'll try again later.
-				 */
-				break;
-			}
-
-			mapping = dma_map_single(ksp->dev, skb->data,
-						 MAX_RXBUF_SIZE,
-						 DMA_FROM_DEVICE);
-			if (unlikely(dma_mapping_error(ksp->dev, mapping))) {
-				/* Failed to DMA map this SKB, try later */
-				dev_kfree_skb_irq(skb);
-				ksp->rx_buffers[buff_n].skb = NULL;
-				break;
-			}
-			ksp->rx_buffers[buff_n].dma_ptr = mapping;
-			ksp->rx_buffers[buff_n].length = MAX_RXBUF_SIZE;
-
-			/* Record this into the DMA ring */
-			ksp->rx_ring[buff_n].data_ptr = cpu_to_le32(mapping);
-			ksp->rx_ring[buff_n].length =
-				cpu_to_le32(MAX_RXBUF_SIZE);
-
-			wmb();
-
-			/* And give ownership over to the hardware */
-			ksp->rx_ring[buff_n].status = cpu_to_le32(RDES_OWN);
-		}
-	}
-}
-
-/* Maximum number of multicast addresses which the KS8695 HW supports */
-#define KS8695_NR_ADDRESSES	16
-
-/**
- *	ks8695_init_partial_multicast - Init the mcast addr registers
- *	@ksp: The device to initialise
- *	@addr: The multicast address list to use
- *	@nr_addr: The number of addresses in the list
- *
- *	This routine is a helper for ks8695_set_multicast - it writes
- *	the additional-address registers in the KS8695 ethernet device
- *	and cleans up any others left behind.
- */
-static void
-ks8695_init_partial_multicast(struct ks8695_priv *ksp,
-			      struct net_device *ndev)
-{
-	u32 low, high;
-	int i;
-	struct netdev_hw_addr *ha;
-
-	i = 0;
-	netdev_for_each_mc_addr(ha, ndev) {
-		/* Ran out of space in chip? */
-		BUG_ON(i == KS8695_NR_ADDRESSES);
-
-		low = (ha->addr[2] << 24) | (ha->addr[3] << 16) |
-		      (ha->addr[4] << 8) | (ha->addr[5]);
-		high = (ha->addr[0] << 8) | (ha->addr[1]);
-
-		ks8695_writereg(ksp, KS8695_AAL_(i), low);
-		ks8695_writereg(ksp, KS8695_AAH_(i), AAH_E | high);
-		i++;
-	}
-
-	/* Clear the remaining Additional Station Addresses */
-	for (; i < KS8695_NR_ADDRESSES; i++) {
-		ks8695_writereg(ksp, KS8695_AAL_(i), 0);
-		ks8695_writereg(ksp, KS8695_AAH_(i), 0);
-	}
-}
-
-/* Interrupt handling */
-
-/**
- *	ks8695_tx_irq - Transmit IRQ handler
- *	@irq: The IRQ which went off (ignored)
- *	@dev_id: The net_device for the interrupt
- *
- *	Process the TX ring, clearing out any transmitted slots.
- *	Allows the net_device to pass us new packets once slots are
- *	freed.
- */
-static irqreturn_t
-ks8695_tx_irq(int irq, void *dev_id)
-{
-	struct net_device *ndev = (struct net_device *)dev_id;
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	int buff_n;
-
-	for (buff_n = 0; buff_n < MAX_TX_DESC; ++buff_n) {
-		if (ksp->tx_buffers[buff_n].skb &&
-		    !(ksp->tx_ring[buff_n].owner & cpu_to_le32(TDES_OWN))) {
-			rmb();
-			/* An SKB which is not owned by HW is present */
-			/* Update the stats for the net_device */
-			ndev->stats.tx_packets++;
-			ndev->stats.tx_bytes += ksp->tx_buffers[buff_n].length;
-
-			/* Free the packet from the ring */
-			ksp->tx_ring[buff_n].data_ptr = 0;
-
-			/* Free the sk_buff */
-			dma_unmap_single(ksp->dev,
-					 ksp->tx_buffers[buff_n].dma_ptr,
-					 ksp->tx_buffers[buff_n].length,
-					 DMA_TO_DEVICE);
-			dev_consume_skb_irq(ksp->tx_buffers[buff_n].skb);
-			ksp->tx_buffers[buff_n].skb = NULL;
-			ksp->tx_ring_used--;
-		}
-	}
-
-	netif_wake_queue(ndev);
-
-	return IRQ_HANDLED;
-}
-
-/**
- *	ks8695_get_rx_enable_bit - Get rx interrupt enable/status bit
- *	@ksp: Private data for the KS8695 Ethernet
- *
- *    For KS8695 document:
- *    Interrupt Enable Register (offset 0xE204)
- *        Bit29 : WAN MAC Receive Interrupt Enable
- *        Bit16 : LAN MAC Receive Interrupt Enable
- *    Interrupt Status Register (Offset 0xF208)
- *        Bit29: WAN MAC Receive Status
- *        Bit16: LAN MAC Receive Status
- *    So, this Rx interrupt enable/status bit number is equal
- *    as Rx IRQ number.
- */
-static inline u32 ks8695_get_rx_enable_bit(struct ks8695_priv *ksp)
-{
-	return ksp->rx_irq;
-}
-
-/**
- *	ks8695_rx_irq - Receive IRQ handler
- *	@irq: The IRQ which went off (ignored)
- *	@dev_id: The net_device for the interrupt
- *
- *	Inform NAPI that packet reception needs to be scheduled
- */
-
-static irqreturn_t
-ks8695_rx_irq(int irq, void *dev_id)
-{
-	struct net_device *ndev = (struct net_device *)dev_id;
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	spin_lock(&ksp->rx_lock);
-
-	if (napi_schedule_prep(&ksp->napi)) {
-		unsigned long status = readl(KS8695_IRQ_VA + KS8695_INTEN);
-		unsigned long mask_bit = 1 << ks8695_get_rx_enable_bit(ksp);
-		/*disable rx interrupt*/
-		status &= ~mask_bit;
-		writel(status , KS8695_IRQ_VA + KS8695_INTEN);
-		__napi_schedule(&ksp->napi);
-	}
-
-	spin_unlock(&ksp->rx_lock);
-	return IRQ_HANDLED;
-}
-
-/**
- *	ks8695_rx - Receive packets called by NAPI poll method
- *	@ksp: Private data for the KS8695 Ethernet
- *	@budget: Number of packets allowed to process
- */
-static int ks8695_rx(struct ks8695_priv *ksp, int budget)
-{
-	struct net_device *ndev = ksp->ndev;
-	struct sk_buff *skb;
-	int buff_n;
-	u32 flags;
-	int pktlen;
-	int received = 0;
-
-	buff_n = ksp->next_rx_desc_read;
-	while (received < budget
-			&& ksp->rx_buffers[buff_n].skb
-			&& (!(ksp->rx_ring[buff_n].status &
-					cpu_to_le32(RDES_OWN)))) {
-			rmb();
-			flags = le32_to_cpu(ksp->rx_ring[buff_n].status);
-
-			/* Found an SKB which we own, this means we
-			 * received a packet
-			 */
-			if ((flags & (RDES_FS | RDES_LS)) !=
-			    (RDES_FS | RDES_LS)) {
-				/* This packet is not the first and
-				 * the last segment.  Therefore it is
-				 * a "spanning" packet and we can't
-				 * handle it
-				 */
-				goto rx_failure;
-			}
-
-			if (flags & (RDES_ES | RDES_RE)) {
-				/* It's an error packet */
-				ndev->stats.rx_errors++;
-				if (flags & RDES_TL)
-					ndev->stats.rx_length_errors++;
-				if (flags & RDES_RF)
-					ndev->stats.rx_length_errors++;
-				if (flags & RDES_CE)
-					ndev->stats.rx_crc_errors++;
-				if (flags & RDES_RE)
-					ndev->stats.rx_missed_errors++;
-
-				goto rx_failure;
-			}
-
-			pktlen = flags & RDES_FLEN;
-			pktlen -= 4; /* Drop the CRC */
-
-			/* Retrieve the sk_buff */
-			skb = ksp->rx_buffers[buff_n].skb;
-
-			/* Clear it from the ring */
-			ksp->rx_buffers[buff_n].skb = NULL;
-			ksp->rx_ring[buff_n].data_ptr = 0;
-
-			/* Unmap the SKB */
-			dma_unmap_single(ksp->dev,
-					 ksp->rx_buffers[buff_n].dma_ptr,
-					 ksp->rx_buffers[buff_n].length,
-					 DMA_FROM_DEVICE);
-
-			/* Relinquish the SKB to the network layer */
-			skb_put(skb, pktlen);
-			skb->protocol = eth_type_trans(skb, ndev);
-			napi_gro_receive(&ksp->napi, skb);
-
-			/* Record stats */
-			ndev->stats.rx_packets++;
-			ndev->stats.rx_bytes += pktlen;
-			goto rx_finished;
-
-rx_failure:
-			/* This ring entry is an error, but we can
-			 * re-use the skb
-			 */
-			/* Give the ring entry back to the hardware */
-			ksp->rx_ring[buff_n].status = cpu_to_le32(RDES_OWN);
-rx_finished:
-			received++;
-			buff_n = (buff_n + 1) & MAX_RX_DESC_MASK;
-	}
-
-	/* And note which RX descriptor we last did */
-	ksp->next_rx_desc_read = buff_n;
-
-	/* And refill the buffers */
-	ks8695_refill_rxbuffers(ksp);
-
-	/* Kick the RX DMA engine, in case it became suspended */
-	ks8695_writereg(ksp, KS8695_DRSC, 0);
-
-	return received;
-}
-
-
-/**
- *	ks8695_poll - Receive packet by NAPI poll method
- *	@ksp: Private data for the KS8695 Ethernet
- *	@budget: The remaining number packets for network subsystem
- *
- *     Invoked by the network core when it requests for new
- *     packets from the driver
- */
-static int ks8695_poll(struct napi_struct *napi, int budget)
-{
-	struct ks8695_priv *ksp = container_of(napi, struct ks8695_priv, napi);
-	unsigned long isr = readl(KS8695_IRQ_VA + KS8695_INTEN);
-	unsigned long mask_bit = 1 << ks8695_get_rx_enable_bit(ksp);
-	int work_done;
-
-	work_done = ks8695_rx(ksp, budget);
-
-	if (work_done < budget && napi_complete_done(napi, work_done)) {
-		unsigned long flags;
-
-		spin_lock_irqsave(&ksp->rx_lock, flags);
-		/* enable rx interrupt */
-		writel(isr | mask_bit, KS8695_IRQ_VA + KS8695_INTEN);
-		spin_unlock_irqrestore(&ksp->rx_lock, flags);
-	}
-	return work_done;
-}
-
-/**
- *	ks8695_link_irq - Link change IRQ handler
- *	@irq: The IRQ which went off (ignored)
- *	@dev_id: The net_device for the interrupt
- *
- *	The WAN interface can generate an IRQ when the link changes,
- *	report this to the net layer and the user.
- */
-static irqreturn_t
-ks8695_link_irq(int irq, void *dev_id)
-{
-	struct net_device *ndev = (struct net_device *)dev_id;
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	u32 ctrl;
-
-	ctrl = readl(ksp->phyiface_regs + KS8695_WMC);
-	if (ctrl & WMC_WLS) {
-		netif_carrier_on(ndev);
-		if (netif_msg_link(ksp))
-			dev_info(ksp->dev,
-				 "%s: Link is now up (10%sMbps/%s-duplex)\n",
-				 ndev->name,
-				 (ctrl & WMC_WSS) ? "0" : "",
-				 (ctrl & WMC_WDS) ? "Full" : "Half");
-	} else {
-		netif_carrier_off(ndev);
-		if (netif_msg_link(ksp))
-			dev_info(ksp->dev, "%s: Link is now down.\n",
-				 ndev->name);
-	}
-
-	return IRQ_HANDLED;
-}
-
-
-/* KS8695 Device functions */
-
-/**
- *	ks8695_reset - Reset a KS8695 ethernet interface
- *	@ksp: The interface to reset
- *
- *	Perform an engine reset of the interface and re-program it
- *	with sensible defaults.
- */
-static void
-ks8695_reset(struct ks8695_priv *ksp)
-{
-	int reset_timeout = watchdog;
-	/* Issue the reset via the TX DMA control register */
-	ks8695_writereg(ksp, KS8695_DTXC, DTXC_TRST);
-	while (reset_timeout--) {
-		if (!(ks8695_readreg(ksp, KS8695_DTXC) & DTXC_TRST))
-			break;
-		msleep(1);
-	}
-
-	if (reset_timeout < 0) {
-		dev_crit(ksp->dev,
-			 "Timeout waiting for DMA engines to reset\n");
-		/* And blithely carry on */
-	}
-
-	/* Definitely wait long enough before attempting to program
-	 * the engines
-	 */
-	msleep(10);
-
-	/* RX: unicast and broadcast */
-	ks8695_writereg(ksp, KS8695_DRXC, DRXC_RU | DRXC_RB);
-	/* TX: pad and add CRC */
-	ks8695_writereg(ksp, KS8695_DTXC, DTXC_TEP | DTXC_TAC);
-}
-
-/**
- *	ks8695_shutdown - Shut down a KS8695 ethernet interface
- *	@ksp: The interface to shut down
- *
- *	This disables packet RX/TX, cleans up IRQs, drains the rings,
- *	and basically places the interface into a clean shutdown
- *	state.
- */
-static void
-ks8695_shutdown(struct ks8695_priv *ksp)
-{
-	u32 ctrl;
-	int buff_n;
-
-	/* Disable packet transmission */
-	ctrl = ks8695_readreg(ksp, KS8695_DTXC);
-	ks8695_writereg(ksp, KS8695_DTXC, ctrl & ~DTXC_TE);
-
-	/* Disable packet reception */
-	ctrl = ks8695_readreg(ksp, KS8695_DRXC);
-	ks8695_writereg(ksp, KS8695_DRXC, ctrl & ~DRXC_RE);
-
-	/* Release the IRQs */
-	free_irq(ksp->rx_irq, ksp->ndev);
-	free_irq(ksp->tx_irq, ksp->ndev);
-	if (ksp->link_irq != -1)
-		free_irq(ksp->link_irq, ksp->ndev);
-
-	/* Throw away any pending TX packets */
-	for (buff_n = 0; buff_n < MAX_TX_DESC; ++buff_n) {
-		if (ksp->tx_buffers[buff_n].skb) {
-			/* Remove this SKB from the TX ring */
-			ksp->tx_ring[buff_n].owner = 0;
-			ksp->tx_ring[buff_n].status = 0;
-			ksp->tx_ring[buff_n].data_ptr = 0;
-
-			/* Unmap and bin this SKB */
-			dma_unmap_single(ksp->dev,
-					 ksp->tx_buffers[buff_n].dma_ptr,
-					 ksp->tx_buffers[buff_n].length,
-					 DMA_TO_DEVICE);
-			dev_kfree_skb_irq(ksp->tx_buffers[buff_n].skb);
-			ksp->tx_buffers[buff_n].skb = NULL;
-		}
-	}
-
-	/* Purge the RX buffers */
-	for (buff_n = 0; buff_n < MAX_RX_DESC; ++buff_n) {
-		if (ksp->rx_buffers[buff_n].skb) {
-			/* Remove the SKB from the RX ring */
-			ksp->rx_ring[buff_n].status = 0;
-			ksp->rx_ring[buff_n].data_ptr = 0;
-
-			/* Unmap and bin the SKB */
-			dma_unmap_single(ksp->dev,
-					 ksp->rx_buffers[buff_n].dma_ptr,
-					 ksp->rx_buffers[buff_n].length,
-					 DMA_FROM_DEVICE);
-			dev_kfree_skb_irq(ksp->rx_buffers[buff_n].skb);
-			ksp->rx_buffers[buff_n].skb = NULL;
-		}
-	}
-}
-
-
-/**
- *	ks8695_setup_irq - IRQ setup helper function
- *	@irq: The IRQ number to claim
- *	@irq_name: The name to give the IRQ claimant
- *	@handler: The function to call to handle the IRQ
- *	@ndev: The net_device to pass in as the dev_id argument to the handler
- *
- *	Return 0 on success.
- */
-static int
-ks8695_setup_irq(int irq, const char *irq_name,
-		 irq_handler_t handler, struct net_device *ndev)
-{
-	int ret;
-
-	ret = request_irq(irq, handler, IRQF_SHARED, irq_name, ndev);
-
-	if (ret) {
-		dev_err(&ndev->dev, "failure to request IRQ %d\n", irq);
-		return ret;
-	}
-
-	return 0;
-}
-
-/**
- *	ks8695_init_net - Initialise a KS8695 ethernet interface
- *	@ksp: The interface to initialise
- *
- *	This routine fills the RX ring, initialises the DMA engines,
- *	allocates the IRQs and then starts the packet TX and RX
- *	engines.
- */
-static int
-ks8695_init_net(struct ks8695_priv *ksp)
-{
-	int ret;
-	u32 ctrl;
-
-	ks8695_refill_rxbuffers(ksp);
-
-	/* Initialise the DMA engines */
-	ks8695_writereg(ksp, KS8695_RDLB, (u32) ksp->rx_ring_dma);
-	ks8695_writereg(ksp, KS8695_TDLB, (u32) ksp->tx_ring_dma);
-
-	/* Request the IRQs */
-	ret = ks8695_setup_irq(ksp->rx_irq, ksp->rx_irq_name,
-			       ks8695_rx_irq, ksp->ndev);
-	if (ret)
-		return ret;
-	ret = ks8695_setup_irq(ksp->tx_irq, ksp->tx_irq_name,
-			       ks8695_tx_irq, ksp->ndev);
-	if (ret)
-		return ret;
-	if (ksp->link_irq != -1) {
-		ret = ks8695_setup_irq(ksp->link_irq, ksp->link_irq_name,
-				       ks8695_link_irq, ksp->ndev);
-		if (ret)
-			return ret;
-	}
-
-	/* Set up the ring indices */
-	ksp->next_rx_desc_read = 0;
-	ksp->tx_ring_next_slot = 0;
-	ksp->tx_ring_used = 0;
-
-	/* Bring up transmission */
-	ctrl = ks8695_readreg(ksp, KS8695_DTXC);
-	/* Enable packet transmission */
-	ks8695_writereg(ksp, KS8695_DTXC, ctrl | DTXC_TE);
-
-	/* Bring up the reception */
-	ctrl = ks8695_readreg(ksp, KS8695_DRXC);
-	/* Enable packet reception */
-	ks8695_writereg(ksp, KS8695_DRXC, ctrl | DRXC_RE);
-	/* And start the DMA engine */
-	ks8695_writereg(ksp, KS8695_DRSC, 0);
-
-	/* All done */
-	return 0;
-}
-
-/**
- *	ks8695_release_device - HW resource release for KS8695 e-net
- *	@ksp: The device to be freed
- *
- *	This unallocates io memory regions, dma-coherent regions etc
- *	which were allocated in ks8695_probe.
- */
-static void
-ks8695_release_device(struct ks8695_priv *ksp)
-{
-	/* Unmap the registers */
-	iounmap(ksp->io_regs);
-	if (ksp->phyiface_regs)
-		iounmap(ksp->phyiface_regs);
-
-	/* And release the request */
-	release_resource(ksp->regs_req);
-	kfree(ksp->regs_req);
-	if (ksp->phyiface_req) {
-		release_resource(ksp->phyiface_req);
-		kfree(ksp->phyiface_req);
-	}
-
-	/* Free the ring buffers */
-	dma_free_coherent(ksp->dev, RING_DMA_SIZE,
-			  ksp->ring_base, ksp->ring_base_dma);
-}
-
-/* Ethtool support */
-
-/**
- *	ks8695_get_msglevel - Get the messages enabled for emission
- *	@ndev: The network device to read from
- */
-static u32
-ks8695_get_msglevel(struct net_device *ndev)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	return ksp->msg_enable;
-}
-
-/**
- *	ks8695_set_msglevel - Set the messages enabled for emission
- *	@ndev: The network device to configure
- *	@value: The messages to set for emission
- */
-static void
-ks8695_set_msglevel(struct net_device *ndev, u32 value)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	ksp->msg_enable = value;
-}
-
-/**
- *	ks8695_wan_get_link_ksettings - Get device-specific settings.
- *	@ndev: The network device to read settings from
- *	@cmd: The ethtool structure to read into
- */
-static int
-ks8695_wan_get_link_ksettings(struct net_device *ndev,
-			      struct ethtool_link_ksettings *cmd)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	u32 ctrl;
-	u32 supported, advertising;
-
-	/* All ports on the KS8695 support these... */
-	supported = (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
-			  SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
-			  SUPPORTED_TP | SUPPORTED_MII);
-
-	advertising = ADVERTISED_TP | ADVERTISED_MII;
-	cmd->base.port = PORT_MII;
-	supported |= (SUPPORTED_Autoneg | SUPPORTED_Pause);
-	cmd->base.phy_address = 0;
-
-	ctrl = readl(ksp->phyiface_regs + KS8695_WMC);
-	if ((ctrl & WMC_WAND) == 0) {
-		/* auto-negotiation is enabled */
-		advertising |= ADVERTISED_Autoneg;
-		if (ctrl & WMC_WANA100F)
-			advertising |= ADVERTISED_100baseT_Full;
-		if (ctrl & WMC_WANA100H)
-			advertising |= ADVERTISED_100baseT_Half;
-		if (ctrl & WMC_WANA10F)
-			advertising |= ADVERTISED_10baseT_Full;
-		if (ctrl & WMC_WANA10H)
-			advertising |= ADVERTISED_10baseT_Half;
-		if (ctrl & WMC_WANAP)
-			advertising |= ADVERTISED_Pause;
-		cmd->base.autoneg = AUTONEG_ENABLE;
-
-		cmd->base.speed = (ctrl & WMC_WSS) ? SPEED_100 : SPEED_10;
-		cmd->base.duplex = (ctrl & WMC_WDS) ?
-			DUPLEX_FULL : DUPLEX_HALF;
-	} else {
-		/* auto-negotiation is disabled */
-		cmd->base.autoneg = AUTONEG_DISABLE;
-
-		cmd->base.speed = (ctrl & WMC_WANF100) ?
-					    SPEED_100 : SPEED_10;
-		cmd->base.duplex = (ctrl & WMC_WANFF) ?
-			DUPLEX_FULL : DUPLEX_HALF;
-	}
-
-	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
-						supported);
-	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
-						advertising);
-
-	return 0;
-}
-
-/**
- *	ks8695_wan_set_link_ksettings - Set device-specific settings.
- *	@ndev: The network device to configure
- *	@cmd: The settings to configure
- */
-static int
-ks8695_wan_set_link_ksettings(struct net_device *ndev,
-			      const struct ethtool_link_ksettings *cmd)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	u32 ctrl;
-	u32 advertising;
-
-	ethtool_convert_link_mode_to_legacy_u32(&advertising,
-						cmd->link_modes.advertising);
-
-	if ((cmd->base.speed != SPEED_10) && (cmd->base.speed != SPEED_100))
-		return -EINVAL;
-	if ((cmd->base.duplex != DUPLEX_HALF) &&
-	    (cmd->base.duplex != DUPLEX_FULL))
-		return -EINVAL;
-	if (cmd->base.port != PORT_MII)
-		return -EINVAL;
-	if ((cmd->base.autoneg != AUTONEG_DISABLE) &&
-	    (cmd->base.autoneg != AUTONEG_ENABLE))
-		return -EINVAL;
-
-	if (cmd->base.autoneg == AUTONEG_ENABLE) {
-		if ((advertising & (ADVERTISED_10baseT_Half |
-				ADVERTISED_10baseT_Full |
-				ADVERTISED_100baseT_Half |
-				ADVERTISED_100baseT_Full)) == 0)
-			return -EINVAL;
-
-		ctrl = readl(ksp->phyiface_regs + KS8695_WMC);
-
-		ctrl &= ~(WMC_WAND | WMC_WANA100F | WMC_WANA100H |
-			  WMC_WANA10F | WMC_WANA10H);
-		if (advertising & ADVERTISED_100baseT_Full)
-			ctrl |= WMC_WANA100F;
-		if (advertising & ADVERTISED_100baseT_Half)
-			ctrl |= WMC_WANA100H;
-		if (advertising & ADVERTISED_10baseT_Full)
-			ctrl |= WMC_WANA10F;
-		if (advertising & ADVERTISED_10baseT_Half)
-			ctrl |= WMC_WANA10H;
-
-		/* force a re-negotiation */
-		ctrl |= WMC_WANR;
-		writel(ctrl, ksp->phyiface_regs + KS8695_WMC);
-	} else {
-		ctrl = readl(ksp->phyiface_regs + KS8695_WMC);
-
-		/* disable auto-negotiation */
-		ctrl |= WMC_WAND;
-		ctrl &= ~(WMC_WANF100 | WMC_WANFF);
-
-		if (cmd->base.speed == SPEED_100)
-			ctrl |= WMC_WANF100;
-		if (cmd->base.duplex == DUPLEX_FULL)
-			ctrl |= WMC_WANFF;
-
-		writel(ctrl, ksp->phyiface_regs + KS8695_WMC);
-	}
-
-	return 0;
-}
-
-/**
- *	ks8695_wan_nwayreset - Restart the autonegotiation on the port.
- *	@ndev: The network device to restart autoneotiation on
- */
-static int
-ks8695_wan_nwayreset(struct net_device *ndev)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	u32 ctrl;
-
-	ctrl = readl(ksp->phyiface_regs + KS8695_WMC);
-
-	if ((ctrl & WMC_WAND) == 0)
-		writel(ctrl | WMC_WANR,
-		       ksp->phyiface_regs + KS8695_WMC);
-	else
-		/* auto-negotiation not enabled */
-		return -EINVAL;
-
-	return 0;
-}
-
-/**
- *	ks8695_wan_get_pause - Retrieve network pause/flow-control advertising
- *	@ndev: The device to retrieve settings from
- *	@param: The structure to fill out with the information
- */
-static void
-ks8695_wan_get_pause(struct net_device *ndev, struct ethtool_pauseparam *param)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	u32 ctrl;
-
-	ctrl = readl(ksp->phyiface_regs + KS8695_WMC);
-
-	/* advertise Pause */
-	param->autoneg = (ctrl & WMC_WANAP);
-
-	/* current Rx Flow-control */
-	ctrl = ks8695_readreg(ksp, KS8695_DRXC);
-	param->rx_pause = (ctrl & DRXC_RFCE);
-
-	/* current Tx Flow-control */
-	ctrl = ks8695_readreg(ksp, KS8695_DTXC);
-	param->tx_pause = (ctrl & DTXC_TFCE);
-}
-
-/**
- *	ks8695_get_drvinfo - Retrieve driver information
- *	@ndev: The network device to retrieve info about
- *	@info: The info structure to fill out.
- */
-static void
-ks8695_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *info)
-{
-	strlcpy(info->driver, MODULENAME, sizeof(info->driver));
-	strlcpy(info->version, MODULEVERSION, sizeof(info->version));
-	strlcpy(info->bus_info, dev_name(ndev->dev.parent),
-		sizeof(info->bus_info));
-}
-
-static const struct ethtool_ops ks8695_ethtool_ops = {
-	.get_msglevel	= ks8695_get_msglevel,
-	.set_msglevel	= ks8695_set_msglevel,
-	.get_drvinfo	= ks8695_get_drvinfo,
-};
-
-static const struct ethtool_ops ks8695_wan_ethtool_ops = {
-	.get_msglevel	= ks8695_get_msglevel,
-	.set_msglevel	= ks8695_set_msglevel,
-	.nway_reset	= ks8695_wan_nwayreset,
-	.get_link	= ethtool_op_get_link,
-	.get_pauseparam = ks8695_wan_get_pause,
-	.get_drvinfo	= ks8695_get_drvinfo,
-	.get_link_ksettings = ks8695_wan_get_link_ksettings,
-	.set_link_ksettings = ks8695_wan_set_link_ksettings,
-};
-
-/* Network device interface functions */
-
-/**
- *	ks8695_set_mac - Update MAC in net dev and HW
- *	@ndev: The network device to update
- *	@addr: The new MAC address to set
- */
-static int
-ks8695_set_mac(struct net_device *ndev, void *addr)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	struct sockaddr *address = addr;
-
-	if (!is_valid_ether_addr(address->sa_data))
-		return -EADDRNOTAVAIL;
-
-	memcpy(ndev->dev_addr, address->sa_data, ndev->addr_len);
-
-	ks8695_update_mac(ksp);
-
-	dev_dbg(ksp->dev, "%s: Updated MAC address to %pM\n",
-		ndev->name, ndev->dev_addr);
-
-	return 0;
-}
-
-/**
- *	ks8695_set_multicast - Set up the multicast behaviour of the interface
- *	@ndev: The net_device to configure
- *
- *	This routine, called by the net layer, configures promiscuity
- *	and multicast reception behaviour for the interface.
- */
-static void
-ks8695_set_multicast(struct net_device *ndev)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	u32 ctrl;
-
-	ctrl = ks8695_readreg(ksp, KS8695_DRXC);
-
-	if (ndev->flags & IFF_PROMISC) {
-		/* enable promiscuous mode */
-		ctrl |= DRXC_RA;
-	} else if (ndev->flags & ~IFF_PROMISC) {
-		/* disable promiscuous mode */
-		ctrl &= ~DRXC_RA;
-	}
-
-	if (ndev->flags & IFF_ALLMULTI) {
-		/* enable all multicast mode */
-		ctrl |= DRXC_RM;
-	} else if (netdev_mc_count(ndev) > KS8695_NR_ADDRESSES) {
-		/* more specific multicast addresses than can be
-		 * handled in hardware
-		 */
-		ctrl |= DRXC_RM;
-	} else {
-		/* enable specific multicasts */
-		ctrl &= ~DRXC_RM;
-		ks8695_init_partial_multicast(ksp, ndev);
-	}
-
-	ks8695_writereg(ksp, KS8695_DRXC, ctrl);
-}
-
-/**
- *	ks8695_timeout - Handle a network tx/rx timeout.
- *	@ndev: The net_device which timed out.
- *
- *	A network transaction timed out, reset the device.
- */
-static void
-ks8695_timeout(struct net_device *ndev)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	netif_stop_queue(ndev);
-	ks8695_shutdown(ksp);
-
-	ks8695_reset(ksp);
-
-	ks8695_update_mac(ksp);
-
-	/* We ignore the return from this since it managed to init
-	 * before it probably will be okay to init again.
-	 */
-	ks8695_init_net(ksp);
-
-	/* Reconfigure promiscuity etc */
-	ks8695_set_multicast(ndev);
-
-	/* And start the TX queue once more */
-	netif_start_queue(ndev);
-}
-
-/**
- *	ks8695_start_xmit - Start a packet transmission
- *	@skb: The packet to transmit
- *	@ndev: The network device to send the packet on
- *
- *	This routine, called by the net layer, takes ownership of the
- *	sk_buff and adds it to the TX ring. It then kicks the TX DMA
- *	engine to ensure transmission begins.
- */
-static netdev_tx_t
-ks8695_start_xmit(struct sk_buff *skb, struct net_device *ndev)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	int buff_n;
-	dma_addr_t dmap;
-
-	spin_lock_irq(&ksp->txq_lock);
-
-	if (ksp->tx_ring_used == MAX_TX_DESC) {
-		/* Somehow we got entered when we have no room */
-		spin_unlock_irq(&ksp->txq_lock);
-		return NETDEV_TX_BUSY;
-	}
-
-	buff_n = ksp->tx_ring_next_slot;
-
-	BUG_ON(ksp->tx_buffers[buff_n].skb);
-
-	dmap = dma_map_single(ksp->dev, skb->data, skb->len, DMA_TO_DEVICE);
-	if (unlikely(dma_mapping_error(ksp->dev, dmap))) {
-		/* Failed to DMA map this SKB, give it back for now */
-		spin_unlock_irq(&ksp->txq_lock);
-		dev_dbg(ksp->dev, "%s: Could not map DMA memory for "\
-			"transmission, trying later\n", ndev->name);
-		return NETDEV_TX_BUSY;
-	}
-
-	ksp->tx_buffers[buff_n].dma_ptr = dmap;
-	/* Mapped okay, store the buffer pointer and length for later */
-	ksp->tx_buffers[buff_n].skb = skb;
-	ksp->tx_buffers[buff_n].length = skb->len;
-
-	/* Fill out the TX descriptor */
-	ksp->tx_ring[buff_n].data_ptr =
-		cpu_to_le32(ksp->tx_buffers[buff_n].dma_ptr);
-	ksp->tx_ring[buff_n].status =
-		cpu_to_le32(TDES_IC | TDES_FS | TDES_LS |
-			    (skb->len & TDES_TBS));
-
-	wmb();
-
-	/* Hand it over to the hardware */
-	ksp->tx_ring[buff_n].owner = cpu_to_le32(TDES_OWN);
-
-	if (++ksp->tx_ring_used == MAX_TX_DESC)
-		netif_stop_queue(ndev);
-
-	/* Kick the TX DMA in case it decided to go IDLE */
-	ks8695_writereg(ksp, KS8695_DTSC, 0);
-
-	/* And update the next ring slot */
-	ksp->tx_ring_next_slot = (buff_n + 1) & MAX_TX_DESC_MASK;
-
-	spin_unlock_irq(&ksp->txq_lock);
-	return NETDEV_TX_OK;
-}
-
-/**
- *	ks8695_stop - Stop (shutdown) a KS8695 ethernet interface
- *	@ndev: The net_device to stop
- *
- *	This disables the TX queue and cleans up a KS8695 ethernet
- *	device.
- */
-static int
-ks8695_stop(struct net_device *ndev)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	netif_stop_queue(ndev);
-	napi_disable(&ksp->napi);
-
-	ks8695_shutdown(ksp);
-
-	return 0;
-}
-
-/**
- *	ks8695_open - Open (bring up) a KS8695 ethernet interface
- *	@ndev: The net_device to open
- *
- *	This resets, configures the MAC, initialises the RX ring and
- *	DMA engines and starts the TX queue for a KS8695 ethernet
- *	device.
- */
-static int
-ks8695_open(struct net_device *ndev)
-{
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-	int ret;
-
-	ks8695_reset(ksp);
-
-	ks8695_update_mac(ksp);
-
-	ret = ks8695_init_net(ksp);
-	if (ret) {
-		ks8695_shutdown(ksp);
-		return ret;
-	}
-
-	napi_enable(&ksp->napi);
-	netif_start_queue(ndev);
-
-	return 0;
-}
-
-/* Platform device driver */
-
-/**
- *	ks8695_init_switch - Init LAN switch to known good defaults.
- *	@ksp: The device to initialise
- *
- *	This initialises the LAN switch in the KS8695 to a known-good
- *	set of defaults.
- */
-static void
-ks8695_init_switch(struct ks8695_priv *ksp)
-{
-	u32 ctrl;
-
-	/* Default value for SEC0 according to datasheet */
-	ctrl = 0x40819e00;
-
-	/* LED0 = Speed	 LED1 = Link/Activity */
-	ctrl &= ~(SEC0_LLED1S | SEC0_LLED0S);
-	ctrl |= (LLED0S_LINK | LLED1S_LINK_ACTIVITY);
-
-	/* Enable Switch */
-	ctrl |= SEC0_ENABLE;
-
-	writel(ctrl, ksp->phyiface_regs + KS8695_SEC0);
-
-	/* Defaults for SEC1 */
-	writel(0x9400100, ksp->phyiface_regs + KS8695_SEC1);
-}
-
-/**
- *	ks8695_init_wan_phy - Initialise the WAN PHY to sensible defaults
- *	@ksp: The device to initialise
- *
- *	This initialises a KS8695's WAN phy to sensible values for
- *	autonegotiation etc.
- */
-static void
-ks8695_init_wan_phy(struct ks8695_priv *ksp)
-{
-	u32 ctrl;
-
-	/* Support auto-negotiation */
-	ctrl = (WMC_WANAP | WMC_WANA100F | WMC_WANA100H |
-		WMC_WANA10F | WMC_WANA10H);
-
-	/* LED0 = Activity , LED1 = Link */
-	ctrl |= (WLED0S_ACTIVITY | WLED1S_LINK);
-
-	/* Restart Auto-negotiation */
-	ctrl |= WMC_WANR;
-
-	writel(ctrl, ksp->phyiface_regs + KS8695_WMC);
-
-	writel(0, ksp->phyiface_regs + KS8695_WPPM);
-	writel(0, ksp->phyiface_regs + KS8695_PPS);
-}
-
-static const struct net_device_ops ks8695_netdev_ops = {
-	.ndo_open		= ks8695_open,
-	.ndo_stop		= ks8695_stop,
-	.ndo_start_xmit		= ks8695_start_xmit,
-	.ndo_tx_timeout		= ks8695_timeout,
-	.ndo_set_mac_address	= ks8695_set_mac,
-	.ndo_validate_addr	= eth_validate_addr,
-	.ndo_set_rx_mode	= ks8695_set_multicast,
-};
-
-/**
- *	ks8695_probe - Probe and initialise a KS8695 ethernet interface
- *	@pdev: The platform device to probe
- *
- *	Initialise a KS8695 ethernet device from platform data.
- *
- *	This driver requires at least one IORESOURCE_MEM for the
- *	registers and two IORESOURCE_IRQ for the RX and TX IRQs
- *	respectively. It can optionally take an additional
- *	IORESOURCE_MEM for the switch or phy in the case of the lan or
- *	wan ports, and an IORESOURCE_IRQ for the link IRQ for the wan
- *	port.
- */
-static int
-ks8695_probe(struct platform_device *pdev)
-{
-	struct ks8695_priv *ksp;
-	struct net_device *ndev;
-	struct resource *regs_res, *phyiface_res;
-	struct resource *rxirq_res, *txirq_res, *linkirq_res;
-	int ret = 0;
-	int buff_n;
-	bool inv_mac_addr = false;
-	u32 machigh, maclow;
-
-	/* Initialise a net_device */
-	ndev = alloc_etherdev(sizeof(struct ks8695_priv));
-	if (!ndev)
-		return -ENOMEM;
-
-	SET_NETDEV_DEV(ndev, &pdev->dev);
-
-	dev_dbg(&pdev->dev, "ks8695_probe() called\n");
-
-	/* Configure our private structure a little */
-	ksp = netdev_priv(ndev);
-
-	ksp->dev = &pdev->dev;
-	ksp->ndev = ndev;
-	ksp->msg_enable = NETIF_MSG_LINK;
-
-	/* Retrieve resources */
-	regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	phyiface_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-
-	rxirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	txirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
-	linkirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
-
-	if (!(regs_res && rxirq_res && txirq_res)) {
-		dev_err(ksp->dev, "insufficient resources\n");
-		ret = -ENOENT;
-		goto failure;
-	}
-
-	ksp->regs_req = request_mem_region(regs_res->start,
-					   resource_size(regs_res),
-					   pdev->name);
-
-	if (!ksp->regs_req) {
-		dev_err(ksp->dev, "cannot claim register space\n");
-		ret = -EIO;
-		goto failure;
-	}
-
-	ksp->io_regs = ioremap(regs_res->start, resource_size(regs_res));
-
-	if (!ksp->io_regs) {
-		dev_err(ksp->dev, "failed to ioremap registers\n");
-		ret = -EINVAL;
-		goto failure;
-	}
-
-	if (phyiface_res) {
-		ksp->phyiface_req =
-			request_mem_region(phyiface_res->start,
-					   resource_size(phyiface_res),
-					   phyiface_res->name);
-
-		if (!ksp->phyiface_req) {
-			dev_err(ksp->dev,
-				"cannot claim switch register space\n");
-			ret = -EIO;
-			goto failure;
-		}
-
-		ksp->phyiface_regs = ioremap(phyiface_res->start,
-					     resource_size(phyiface_res));
-
-		if (!ksp->phyiface_regs) {
-			dev_err(ksp->dev,
-				"failed to ioremap switch registers\n");
-			ret = -EINVAL;
-			goto failure;
-		}
-	}
-
-	ksp->rx_irq = rxirq_res->start;
-	ksp->rx_irq_name = rxirq_res->name ? rxirq_res->name : "Ethernet RX";
-	ksp->tx_irq = txirq_res->start;
-	ksp->tx_irq_name = txirq_res->name ? txirq_res->name : "Ethernet TX";
-	ksp->link_irq = (linkirq_res ? linkirq_res->start : -1);
-	ksp->link_irq_name = (linkirq_res && linkirq_res->name) ?
-		linkirq_res->name : "Ethernet Link";
-
-	/* driver system setup */
-	ndev->netdev_ops = &ks8695_netdev_ops;
-	ndev->watchdog_timeo	 = msecs_to_jiffies(watchdog);
-
-	netif_napi_add(ndev, &ksp->napi, ks8695_poll, NAPI_WEIGHT);
-
-	/* Retrieve the default MAC addr from the chip. */
-	/* The bootloader should have left it in there for us. */
-
-	machigh = ks8695_readreg(ksp, KS8695_MAH);
-	maclow = ks8695_readreg(ksp, KS8695_MAL);
-
-	ndev->dev_addr[0] = (machigh >> 8) & 0xFF;
-	ndev->dev_addr[1] = machigh & 0xFF;
-	ndev->dev_addr[2] = (maclow >> 24) & 0xFF;
-	ndev->dev_addr[3] = (maclow >> 16) & 0xFF;
-	ndev->dev_addr[4] = (maclow >> 8) & 0xFF;
-	ndev->dev_addr[5] = maclow & 0xFF;
-
-	if (!is_valid_ether_addr(ndev->dev_addr))
-		inv_mac_addr = true;
-
-	/* In order to be efficient memory-wise, we allocate both
-	 * rings in one go.
-	 */
-	ksp->ring_base = dma_alloc_coherent(&pdev->dev, RING_DMA_SIZE,
-					    &ksp->ring_base_dma, GFP_KERNEL);
-	if (!ksp->ring_base) {
-		ret = -ENOMEM;
-		goto failure;
-	}
-
-	/* Specify the TX DMA ring buffer */
-	ksp->tx_ring = ksp->ring_base;
-	ksp->tx_ring_dma = ksp->ring_base_dma;
-
-	/* And initialise the queue's lock */
-	spin_lock_init(&ksp->txq_lock);
-	spin_lock_init(&ksp->rx_lock);
-
-	/* Specify the RX DMA ring buffer */
-	ksp->rx_ring = ksp->ring_base + TX_RING_DMA_SIZE;
-	ksp->rx_ring_dma = ksp->ring_base_dma + TX_RING_DMA_SIZE;
-
-	/* Zero the descriptor rings */
-	memset(ksp->tx_ring, 0, TX_RING_DMA_SIZE);
-	memset(ksp->rx_ring, 0, RX_RING_DMA_SIZE);
-
-	/* Build the rings */
-	for (buff_n = 0; buff_n < MAX_TX_DESC; ++buff_n) {
-		ksp->tx_ring[buff_n].next_desc =
-			cpu_to_le32(ksp->tx_ring_dma +
-				    (sizeof(struct tx_ring_desc) *
-				     ((buff_n + 1) & MAX_TX_DESC_MASK)));
-	}
-
-	for (buff_n = 0; buff_n < MAX_RX_DESC; ++buff_n) {
-		ksp->rx_ring[buff_n].next_desc =
-			cpu_to_le32(ksp->rx_ring_dma +
-				    (sizeof(struct rx_ring_desc) *
-				     ((buff_n + 1) & MAX_RX_DESC_MASK)));
-	}
-
-	/* Initialise the port (physically) */
-	if (ksp->phyiface_regs && ksp->link_irq == -1) {
-		ks8695_init_switch(ksp);
-		ksp->dtype = KS8695_DTYPE_LAN;
-		ndev->ethtool_ops = &ks8695_ethtool_ops;
-	} else if (ksp->phyiface_regs && ksp->link_irq != -1) {
-		ks8695_init_wan_phy(ksp);
-		ksp->dtype = KS8695_DTYPE_WAN;
-		ndev->ethtool_ops = &ks8695_wan_ethtool_ops;
-	} else {
-		/* No initialisation since HPNA does not have a PHY */
-		ksp->dtype = KS8695_DTYPE_HPNA;
-		ndev->ethtool_ops = &ks8695_ethtool_ops;
-	}
-
-	/* And bring up the net_device with the net core */
-	platform_set_drvdata(pdev, ndev);
-	ret = register_netdev(ndev);
-
-	if (ret == 0) {
-		if (inv_mac_addr)
-			dev_warn(ksp->dev, "%s: Invalid ethernet MAC address. Please set using ip\n",
-				 ndev->name);
-		dev_info(ksp->dev, "ks8695 ethernet (%s) MAC: %pM\n",
-			 ks8695_port_type(ksp), ndev->dev_addr);
-	} else {
-		/* Report the failure to register the net_device */
-		dev_err(ksp->dev, "ks8695net: failed to register netdev.\n");
-		goto failure;
-	}
-
-	/* All is well */
-	return 0;
-
-	/* Error exit path */
-failure:
-	ks8695_release_device(ksp);
-	free_netdev(ndev);
-
-	return ret;
-}
-
-/**
- *	ks8695_drv_suspend - Suspend a KS8695 ethernet platform device.
- *	@pdev: The device to suspend
- *	@state: The suspend state
- *
- *	This routine detaches and shuts down a KS8695 ethernet device.
- */
-static int
-ks8695_drv_suspend(struct platform_device *pdev, pm_message_t state)
-{
-	struct net_device *ndev = platform_get_drvdata(pdev);
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	ksp->in_suspend = 1;
-
-	if (netif_running(ndev)) {
-		netif_device_detach(ndev);
-		ks8695_shutdown(ksp);
-	}
-
-	return 0;
-}
-
-/**
- *	ks8695_drv_resume - Resume a KS8695 ethernet platform device.
- *	@pdev: The device to resume
- *
- *	This routine re-initialises and re-attaches a KS8695 ethernet
- *	device.
- */
-static int
-ks8695_drv_resume(struct platform_device *pdev)
-{
-	struct net_device *ndev = platform_get_drvdata(pdev);
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	if (netif_running(ndev)) {
-		ks8695_reset(ksp);
-		ks8695_init_net(ksp);
-		ks8695_set_multicast(ndev);
-		netif_device_attach(ndev);
-	}
-
-	ksp->in_suspend = 0;
-
-	return 0;
-}
-
-/**
- *	ks8695_drv_remove - Remove a KS8695 net device on driver unload.
- *	@pdev: The platform device to remove
- *
- *	This unregisters and releases a KS8695 ethernet device.
- */
-static int
-ks8695_drv_remove(struct platform_device *pdev)
-{
-	struct net_device *ndev = platform_get_drvdata(pdev);
-	struct ks8695_priv *ksp = netdev_priv(ndev);
-
-	netif_napi_del(&ksp->napi);
-
-	unregister_netdev(ndev);
-	ks8695_release_device(ksp);
-	free_netdev(ndev);
-
-	dev_dbg(&pdev->dev, "released and freed device\n");
-	return 0;
-}
-
-static struct platform_driver ks8695_driver = {
-	.driver = {
-		.name	= MODULENAME,
-	},
-	.probe		= ks8695_probe,
-	.remove		= ks8695_drv_remove,
-	.suspend	= ks8695_drv_suspend,
-	.resume		= ks8695_drv_resume,
-};
-
-module_platform_driver(ks8695_driver);
-
-MODULE_AUTHOR("Simtec Electronics");
-MODULE_DESCRIPTION("Micrel KS8695 (Centaur) Ethernet driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" MODULENAME);
-
-module_param(watchdog, int, 0400);
-MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
diff --git a/drivers/net/ethernet/micrel/ks8695net.h b/drivers/net/ethernet/micrel/ks8695net.h
deleted file mode 100644
index b18fad4ad5fd..000000000000
--- a/drivers/net/ethernet/micrel/ks8695net.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Micrel KS8695 (Centaur) Ethernet.
- *
- * Copyright 2008 Simtec Electronics
- *		  Daniel Silverstone <dsilvers@simtec.co.uk>
- *		  Vincent Sanders <vince@simtec.co.uk>
- */
-
-#ifndef KS8695NET_H
-#define KS8695NET_H
-
-/* Receive descriptor flags */
-#define RDES_OWN	(1 << 31)	/* Ownership */
-#define RDES_FS		(1 << 30)	/* First Descriptor */
-#define RDES_LS		(1 << 29)	/* Last Descriptor */
-#define RDES_IPE	(1 << 28)	/* IP Checksum error */
-#define RDES_TCPE	(1 << 27)	/* TCP Checksum error */
-#define RDES_UDPE	(1 << 26)	/* UDP Checksum error */
-#define RDES_ES		(1 << 25)	/* Error summary */
-#define RDES_MF		(1 << 24)	/* Multicast Frame */
-#define RDES_RE		(1 << 19)	/* MII Error reported */
-#define RDES_TL		(1 << 18)	/* Frame too Long */
-#define RDES_RF		(1 << 17)	/* Runt Frame */
-#define RDES_CE		(1 << 16)	/* CRC error */
-#define RDES_FT		(1 << 15)	/* Frame Type */
-#define RDES_FLEN	(0x7ff)		/* Frame Length */
-
-#define RDES_RER	(1 << 25)	/* Receive End of Ring */
-#define RDES_RBS	(0x7ff)		/* Receive Buffer Size */
-
-/* Transmit descriptor flags */
-
-#define TDES_OWN	(1 << 31)	/* Ownership */
-
-#define TDES_IC		(1 << 31)	/* Interrupt on Completion */
-#define TDES_FS		(1 << 30)	/* First Segment */
-#define TDES_LS		(1 << 29)	/* Last Segment */
-#define TDES_IPCKG	(1 << 28)	/* IP Checksum generate */
-#define TDES_TCPCKG	(1 << 27)	/* TCP Checksum generate */
-#define TDES_UDPCKG	(1 << 26)	/* UDP Checksum generate */
-#define TDES_TER	(1 << 25)	/* Transmit End of Ring */
-#define TDES_TBS	(0x7ff)		/* Transmit Buffer Size */
-
-/*
- * Network controller register offsets
- */
-#define KS8695_DTXC		(0x00)		/* DMA Transmit Control */
-#define KS8695_DRXC		(0x04)		/* DMA Receive Control */
-#define KS8695_DTSC		(0x08)		/* DMA Transmit Start Command */
-#define KS8695_DRSC		(0x0c)		/* DMA Receive Start Command */
-#define KS8695_TDLB		(0x10)		/* Transmit Descriptor List
-						 * Base Address
-						 */
-#define KS8695_RDLB		(0x14)		/* Receive Descriptor List
-						 * Base Address
-						 */
-#define KS8695_MAL		(0x18)		/* MAC Station Address Low */
-#define KS8695_MAH		(0x1c)		/* MAC Station Address High */
-#define KS8695_AAL_(n)		(0x80 + ((n)*8))	/* MAC Additional
-							 * Station Address
-							 * (0..15) Low
-							 */
-#define KS8695_AAH_(n)		(0x84 + ((n)*8))	/* MAC Additional
-							 * Station Address
-							 * (0..15) High
-							 */
-
-
-/* DMA Transmit Control Register */
-#define DTXC_TRST		(1    << 31)	/* Soft Reset */
-#define DTXC_TBS		(0x3f << 24)	/* Transmit Burst Size */
-#define DTXC_TUCG		(1    << 18)	/* Transmit UDP
-						 * Checksum Generate
-						 */
-#define DTXC_TTCG		(1    << 17)	/* Transmit TCP
-						 * Checksum Generate
-						 */
-#define DTXC_TICG		(1    << 16)	/* Transmit IP
-						 * Checksum Generate
-						 */
-#define DTXC_TFCE		(1    <<  9)	/* Transmit Flow
-						 * Control Enable
-						 */
-#define DTXC_TLB		(1    <<  8)	/* Loopback mode */
-#define DTXC_TEP		(1    <<  2)	/* Transmit Enable Padding */
-#define DTXC_TAC		(1    <<  1)	/* Transmit Add CRC */
-#define DTXC_TE			(1    <<  0)	/* TX Enable */
-
-/* DMA Receive Control Register */
-#define DRXC_RBS		(0x3f << 24)	/* Receive Burst Size */
-#define DRXC_RUCC		(1    << 18)	/* Receive UDP Checksum check */
-#define DRXC_RTCG		(1    << 17)	/* Receive TCP Checksum check */
-#define DRXC_RICG		(1    << 16)	/* Receive IP Checksum check */
-#define DRXC_RFCE		(1    <<  9)	/* Receive Flow Control
-						 * Enable
-						 */
-#define DRXC_RB			(1    <<  6)	/* Receive Broadcast */
-#define DRXC_RM			(1    <<  5)	/* Receive Multicast */
-#define DRXC_RU			(1    <<  4)	/* Receive Unicast */
-#define DRXC_RERR		(1    <<  3)	/* Receive Error Frame */
-#define DRXC_RA			(1    <<  2)	/* Receive All */
-#define DRXC_RE			(1    <<  0)	/* RX Enable */
-
-/* Additional Station Address High */
-#define AAH_E			(1    << 31)	/* Address Enabled */
-
-#endif /* KS8695NET_H */
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 06/16] watchdog: remove w90x900 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (4 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 05/16] net: " Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 20:42   ` Guenter Roeck
  2019-08-09 20:27 ` [PATCH 07/16] spi: " Arnd Bergmann
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Wim Van Sebroeck, Guenter Roeck, Jonathan Corbet,
	linux-watchdog, linux-doc, linux-kernel

The ARM w90x900 platform is getting removed, so this driver is obsolete

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../watchdog/watchdog-parameters.rst          |  10 -
 drivers/watchdog/Kconfig                      |   9 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/nuc900_wdt.c                 | 302 ------------------
 4 files changed, 322 deletions(-)
 delete mode 100644 drivers/watchdog/nuc900_wdt.c

diff --git a/Documentation/watchdog/watchdog-parameters.rst b/Documentation/watchdog/watchdog-parameters.rst
index 226aba56f704..223c99361a30 100644
--- a/Documentation/watchdog/watchdog-parameters.rst
+++ b/Documentation/watchdog/watchdog-parameters.rst
@@ -366,16 +366,6 @@ nic7018_wdt:
 
 -------------------------------------------------
 
-nuc900_wdt:
-    heartbeat:
-	Watchdog heartbeats in seconds.
-	(default = 15)
-    nowayout:
-	Watchdog cannot be stopped once started
-	(default=kernel config parameter)
-
--------------------------------------------------
-
 omap_wdt:
     timer_margin:
 	initial watchdog timeout (in seconds)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index e631f1ae303a..0e64f501ef30 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -655,15 +655,6 @@ config STMP3XXX_RTC_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called stmp3xxx_rtc_wdt.
 
-config NUC900_WATCHDOG
-	tristate "Nuvoton NUC900 watchdog"
-	depends on ARCH_W90X900 || COMPILE_TEST
-	help
-	  Say Y here if to include support for the watchdog timer
-	  for the Nuvoton NUC900 series SoCs.
-	  To compile this driver as a module, choose M here: the
-	  module will be called nuc900_wdt.
-
 config TS4800_WATCHDOG
 	tristate "TS-4800 Watchdog"
 	depends on HAS_IOMEM && OF
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 85f55ec76f8d..b5a0aed537af 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -63,7 +63,6 @@ obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
 obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_NPCM7XX_WATCHDOG) += npcm_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
-obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
 obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
 obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
diff --git a/drivers/watchdog/nuc900_wdt.c b/drivers/watchdog/nuc900_wdt.c
deleted file mode 100644
index db124cebe838..000000000000
--- a/drivers/watchdog/nuc900_wdt.c
+++ /dev/null
@@ -1,302 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2009 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/bitops.h>
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/types.h>
-#include <linux/watchdog.h>
-#include <linux/uaccess.h>
-
-#define REG_WTCR		0x1c
-#define WTCLK			(0x01 << 10)
-#define WTE			(0x01 << 7)	/*wdt enable*/
-#define WTIS			(0x03 << 4)
-#define WTIF			(0x01 << 3)
-#define WTRF			(0x01 << 2)
-#define WTRE			(0x01 << 1)
-#define WTR			(0x01 << 0)
-/*
- * The watchdog time interval can be calculated via following formula:
- * WTIS		real time interval (formula)
- * 0x00		((2^ 14 ) * ((external crystal freq) / 256))seconds
- * 0x01		((2^ 16 ) * ((external crystal freq) / 256))seconds
- * 0x02		((2^ 18 ) * ((external crystal freq) / 256))seconds
- * 0x03		((2^ 20 ) * ((external crystal freq) / 256))seconds
- *
- * The external crystal freq is 15Mhz in the nuc900 evaluation board.
- * So 0x00 = +-0.28 seconds, 0x01 = +-1.12 seconds, 0x02 = +-4.48 seconds,
- * 0x03 = +- 16.92 seconds..
- */
-#define WDT_HW_TIMEOUT		0x02
-#define WDT_TIMEOUT		(HZ/2)
-#define WDT_HEARTBEAT		15
-
-static int heartbeat = WDT_HEARTBEAT;
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. "
-	"(default = " __MODULE_STRING(WDT_HEARTBEAT) ")");
-
-static bool nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, bool, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
-	"(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-struct nuc900_wdt {
-	struct clk	 *wdt_clock;
-	struct platform_device *pdev;
-	void __iomem	 *wdt_base;
-	char		 expect_close;
-	struct timer_list timer;
-	spinlock_t       wdt_lock;
-	unsigned long next_heartbeat;
-};
-
-static unsigned long nuc900wdt_busy;
-static struct nuc900_wdt *nuc900_wdt;
-
-static inline void nuc900_wdt_keepalive(void)
-{
-	unsigned int val;
-
-	spin_lock(&nuc900_wdt->wdt_lock);
-
-	val = __raw_readl(nuc900_wdt->wdt_base + REG_WTCR);
-	val |= (WTR | WTIF);
-	__raw_writel(val, nuc900_wdt->wdt_base + REG_WTCR);
-
-	spin_unlock(&nuc900_wdt->wdt_lock);
-}
-
-static inline void nuc900_wdt_start(void)
-{
-	unsigned int val;
-
-	spin_lock(&nuc900_wdt->wdt_lock);
-
-	val = __raw_readl(nuc900_wdt->wdt_base + REG_WTCR);
-	val |= (WTRE | WTE | WTR | WTCLK | WTIF);
-	val &= ~WTIS;
-	val |= (WDT_HW_TIMEOUT << 0x04);
-	__raw_writel(val, nuc900_wdt->wdt_base + REG_WTCR);
-
-	spin_unlock(&nuc900_wdt->wdt_lock);
-
-	nuc900_wdt->next_heartbeat = jiffies + heartbeat * HZ;
-	mod_timer(&nuc900_wdt->timer, jiffies + WDT_TIMEOUT);
-}
-
-static inline void nuc900_wdt_stop(void)
-{
-	unsigned int val;
-
-	del_timer(&nuc900_wdt->timer);
-
-	spin_lock(&nuc900_wdt->wdt_lock);
-
-	val = __raw_readl(nuc900_wdt->wdt_base + REG_WTCR);
-	val &= ~WTE;
-	__raw_writel(val, nuc900_wdt->wdt_base + REG_WTCR);
-
-	spin_unlock(&nuc900_wdt->wdt_lock);
-}
-
-static inline void nuc900_wdt_ping(void)
-{
-	nuc900_wdt->next_heartbeat = jiffies + heartbeat * HZ;
-}
-
-static int nuc900_wdt_open(struct inode *inode, struct file *file)
-{
-
-	if (test_and_set_bit(0, &nuc900wdt_busy))
-		return -EBUSY;
-
-	nuc900_wdt_start();
-
-	return stream_open(inode, file);
-}
-
-static int nuc900_wdt_close(struct inode *inode, struct file *file)
-{
-	if (nuc900_wdt->expect_close == 42)
-		nuc900_wdt_stop();
-	else {
-		dev_crit(&nuc900_wdt->pdev->dev,
-			"Unexpected close, not stopping watchdog!\n");
-		nuc900_wdt_ping();
-	}
-
-	nuc900_wdt->expect_close = 0;
-	clear_bit(0, &nuc900wdt_busy);
-	return 0;
-}
-
-static const struct watchdog_info nuc900_wdt_info = {
-	.identity	= "nuc900 watchdog",
-	.options	= WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
-						WDIOF_MAGICCLOSE,
-};
-
-static long nuc900_wdt_ioctl(struct file *file,
-					unsigned int cmd, unsigned long arg)
-{
-	void __user *argp = (void __user *)arg;
-	int __user *p = argp;
-	int new_value;
-
-	switch (cmd) {
-	case WDIOC_GETSUPPORT:
-		return copy_to_user(argp, &nuc900_wdt_info,
-				sizeof(nuc900_wdt_info)) ? -EFAULT : 0;
-	case WDIOC_GETSTATUS:
-	case WDIOC_GETBOOTSTATUS:
-		return put_user(0, p);
-
-	case WDIOC_KEEPALIVE:
-		nuc900_wdt_ping();
-		return 0;
-
-	case WDIOC_SETTIMEOUT:
-		if (get_user(new_value, p))
-			return -EFAULT;
-
-		heartbeat = new_value;
-		nuc900_wdt_ping();
-
-		return put_user(new_value, p);
-	case WDIOC_GETTIMEOUT:
-		return put_user(heartbeat, p);
-	default:
-		return -ENOTTY;
-	}
-}
-
-static ssize_t nuc900_wdt_write(struct file *file, const char __user *data,
-						size_t len, loff_t *ppos)
-{
-	if (!len)
-		return 0;
-
-	/* Scan for magic character */
-	if (!nowayout) {
-		size_t i;
-
-		nuc900_wdt->expect_close = 0;
-
-		for (i = 0; i < len; i++) {
-			char c;
-			if (get_user(c, data + i))
-				return -EFAULT;
-			if (c == 'V') {
-				nuc900_wdt->expect_close = 42;
-				break;
-			}
-		}
-	}
-
-	nuc900_wdt_ping();
-	return len;
-}
-
-static void nuc900_wdt_timer_ping(struct timer_list *unused)
-{
-	if (time_before(jiffies, nuc900_wdt->next_heartbeat)) {
-		nuc900_wdt_keepalive();
-		mod_timer(&nuc900_wdt->timer, jiffies + WDT_TIMEOUT);
-	} else
-		dev_warn(&nuc900_wdt->pdev->dev, "Will reset the machine !\n");
-}
-
-static const struct file_operations nuc900wdt_fops = {
-	.owner		= THIS_MODULE,
-	.llseek		= no_llseek,
-	.unlocked_ioctl	= nuc900_wdt_ioctl,
-	.open		= nuc900_wdt_open,
-	.release	= nuc900_wdt_close,
-	.write		= nuc900_wdt_write,
-};
-
-static struct miscdevice nuc900wdt_miscdev = {
-	.minor		= WATCHDOG_MINOR,
-	.name		= "watchdog",
-	.fops		= &nuc900wdt_fops,
-};
-
-static int nuc900wdt_probe(struct platform_device *pdev)
-{
-	int ret = 0;
-
-	nuc900_wdt = devm_kzalloc(&pdev->dev, sizeof(*nuc900_wdt),
-				GFP_KERNEL);
-	if (!nuc900_wdt)
-		return -ENOMEM;
-
-	nuc900_wdt->pdev = pdev;
-
-	spin_lock_init(&nuc900_wdt->wdt_lock);
-
-	nuc900_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(nuc900_wdt->wdt_base))
-		return PTR_ERR(nuc900_wdt->wdt_base);
-
-	nuc900_wdt->wdt_clock = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(nuc900_wdt->wdt_clock)) {
-		dev_err(&pdev->dev, "failed to find watchdog clock source\n");
-		return PTR_ERR(nuc900_wdt->wdt_clock);
-	}
-
-	clk_enable(nuc900_wdt->wdt_clock);
-
-	timer_setup(&nuc900_wdt->timer, nuc900_wdt_timer_ping, 0);
-
-	ret = misc_register(&nuc900wdt_miscdev);
-	if (ret) {
-		dev_err(&pdev->dev, "err register miscdev on minor=%d (%d)\n",
-			WATCHDOG_MINOR, ret);
-		goto err_clk;
-	}
-
-	return 0;
-
-err_clk:
-	clk_disable(nuc900_wdt->wdt_clock);
-	return ret;
-}
-
-static int nuc900wdt_remove(struct platform_device *pdev)
-{
-	misc_deregister(&nuc900wdt_miscdev);
-
-	clk_disable(nuc900_wdt->wdt_clock);
-
-	return 0;
-}
-
-static struct platform_driver nuc900wdt_driver = {
-	.probe		= nuc900wdt_probe,
-	.remove		= nuc900wdt_remove,
-	.driver		= {
-		.name	= "nuc900-wdt",
-	},
-};
-
-module_platform_driver(nuc900wdt_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("Watchdog driver for NUC900");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-wdt");
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 07/16] spi: remove w90x900 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (5 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 06/16] watchdog: remove w90x900 driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-12 10:36   ` Mark Brown
  2019-08-12 13:06   ` Mark Brown
  2019-08-09 20:27 ` [PATCH 08/16] ASoC: remove w90x900/nuc900 platform drivers Arnd Bergmann
                   ` (9 subsequent siblings)
  16 siblings, 2 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc; +Cc: Arnd Bergmann, Mark Brown, linux-kernel, linux-spi

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/spi/Kconfig                      |   7 -
 drivers/spi/Makefile                     |   1 -
 drivers/spi/spi-nuc900.c                 | 429 -----------------------
 include/Kbuild                           |   1 -
 include/linux/platform_data/spi-nuc900.h |  29 --
 5 files changed, 467 deletions(-)
 delete mode 100644 drivers/spi/spi-nuc900.c
 delete mode 100644 include/linux/platform_data/spi-nuc900.h

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 3a1d8f1170de..949b18ed9d6b 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -440,13 +440,6 @@ config SPI_NPCM_PSPI
 	  This driver provides support for Nuvoton NPCM BMC
 	  Peripheral SPI controller in master mode.
 
-config SPI_NUC900
-	tristate "Nuvoton NUC900 series SPI"
-	depends on ARCH_W90X900
-	select SPI_BITBANG
-	help
-	  SPI driver for Nuvoton NUC900 series ARM SoCs
-
 config SPI_LANTIQ_SSC
 	tristate "Lantiq SSC SPI controller"
 	depends on LANTIQ || COMPILE_TEST
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index 63dcab552bcb..b1131809a294 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -64,7 +64,6 @@ obj-$(CONFIG_SPI_MT7621)		+= spi-mt7621.o
 obj-$(CONFIG_SPI_MXIC)			+= spi-mxic.o
 obj-$(CONFIG_SPI_MXS)			+= spi-mxs.o
 obj-$(CONFIG_SPI_NPCM_PSPI)		+= spi-npcm-pspi.o
-obj-$(CONFIG_SPI_NUC900)		+= spi-nuc900.o
 obj-$(CONFIG_SPI_NXP_FLEXSPI)		+= spi-nxp-fspi.o
 obj-$(CONFIG_SPI_OC_TINY)		+= spi-oc-tiny.o
 spi-octeon-objs				:= spi-cavium.o spi-cavium-octeon.o
diff --git a/drivers/spi/spi-nuc900.c b/drivers/spi/spi-nuc900.c
deleted file mode 100644
index 37e2034ad4d5..000000000000
--- a/drivers/spi/spi-nuc900.c
+++ /dev/null
@@ -1,429 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2009 Nuvoton technology.
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-#include <linux/delay.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/clk.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-
-#include <linux/spi/spi.h>
-#include <linux/spi/spi_bitbang.h>
-
-#include <linux/platform_data/spi-nuc900.h>
-
-/* usi registers offset */
-#define USI_CNT		0x00
-#define USI_DIV		0x04
-#define USI_SSR		0x08
-#define USI_RX0		0x10
-#define USI_TX0		0x10
-
-/* usi register bit */
-#define ENINT		(0x01 << 17)
-#define ENFLG		(0x01 << 16)
-#define SLEEP		(0x0f << 12)
-#define TXNUM		(0x03 << 8)
-#define TXBITLEN	(0x1f << 3)
-#define TXNEG		(0x01 << 2)
-#define RXNEG		(0x01 << 1)
-#define LSB		(0x01 << 10)
-#define SELECTLEV	(0x01 << 2)
-#define SELECTPOL	(0x01 << 31)
-#define SELECTSLAVE	0x01
-#define GOBUSY		0x01
-
-struct nuc900_spi {
-	struct spi_bitbang	 bitbang;
-	struct completion	 done;
-	void __iomem		*regs;
-	int			 irq;
-	int			 len;
-	int			 count;
-	const unsigned char	*tx;
-	unsigned char		*rx;
-	struct clk		*clk;
-	struct spi_master	*master;
-	struct nuc900_spi_info *pdata;
-	spinlock_t		lock;
-};
-
-static inline struct nuc900_spi *to_hw(struct spi_device *sdev)
-{
-	return spi_master_get_devdata(sdev->master);
-}
-
-static void nuc900_slave_select(struct spi_device *spi, unsigned int ssr)
-{
-	struct nuc900_spi *hw = to_hw(spi);
-	unsigned int val;
-	unsigned int cs = spi->mode & SPI_CS_HIGH ? 1 : 0;
-	unsigned int cpol = spi->mode & SPI_CPOL ? 1 : 0;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_SSR);
-
-	if (!cs)
-		val &= ~SELECTLEV;
-	else
-		val |= SELECTLEV;
-
-	if (!ssr)
-		val &= ~SELECTSLAVE;
-	else
-		val |= SELECTSLAVE;
-
-	__raw_writel(val, hw->regs + USI_SSR);
-
-	val = __raw_readl(hw->regs + USI_CNT);
-
-	if (!cpol)
-		val &= ~SELECTPOL;
-	else
-		val |= SELECTPOL;
-
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static void nuc900_spi_chipsel(struct spi_device *spi, int value)
-{
-	switch (value) {
-	case BITBANG_CS_INACTIVE:
-		nuc900_slave_select(spi, 0);
-		break;
-
-	case BITBANG_CS_ACTIVE:
-		nuc900_slave_select(spi, 1);
-		break;
-	}
-}
-
-static void nuc900_spi_setup_txnum(struct nuc900_spi *hw, unsigned int txnum)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT) & ~TXNUM;
-
-	if (txnum)
-		val |= txnum << 0x08;
-
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-
-}
-
-static void nuc900_spi_setup_txbitlen(struct nuc900_spi *hw,
-							unsigned int txbitlen)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT) & ~TXBITLEN;
-
-	val |= (txbitlen << 0x03);
-
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static void nuc900_spi_gobusy(struct nuc900_spi *hw)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT);
-
-	val |= GOBUSY;
-
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static inline unsigned int hw_txbyte(struct nuc900_spi *hw, int count)
-{
-	return hw->tx ? hw->tx[count] : 0;
-}
-
-static int nuc900_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
-{
-	struct nuc900_spi *hw = to_hw(spi);
-
-	hw->tx = t->tx_buf;
-	hw->rx = t->rx_buf;
-	hw->len = t->len;
-	hw->count = 0;
-
-	__raw_writel(hw_txbyte(hw, 0x0), hw->regs + USI_TX0);
-
-	nuc900_spi_gobusy(hw);
-
-	wait_for_completion(&hw->done);
-
-	return hw->count;
-}
-
-static irqreturn_t nuc900_spi_irq(int irq, void *dev)
-{
-	struct nuc900_spi *hw = dev;
-	unsigned int status;
-	unsigned int count = hw->count;
-
-	status = __raw_readl(hw->regs + USI_CNT);
-	__raw_writel(status, hw->regs + USI_CNT);
-
-	if (status & ENFLG) {
-		hw->count++;
-
-		if (hw->rx)
-			hw->rx[count] = __raw_readl(hw->regs + USI_RX0);
-		count++;
-
-		if (count < hw->len) {
-			__raw_writel(hw_txbyte(hw, count), hw->regs + USI_TX0);
-			nuc900_spi_gobusy(hw);
-		} else {
-			complete(&hw->done);
-		}
-
-		return IRQ_HANDLED;
-	}
-
-	complete(&hw->done);
-	return IRQ_HANDLED;
-}
-
-static void nuc900_tx_edge(struct nuc900_spi *hw, unsigned int edge)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT);
-
-	if (edge)
-		val |= TXNEG;
-	else
-		val &= ~TXNEG;
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static void nuc900_rx_edge(struct nuc900_spi *hw, unsigned int edge)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT);
-
-	if (edge)
-		val |= RXNEG;
-	else
-		val &= ~RXNEG;
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static void nuc900_send_first(struct nuc900_spi *hw, unsigned int lsb)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT);
-
-	if (lsb)
-		val |= LSB;
-	else
-		val &= ~LSB;
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static void nuc900_set_sleep(struct nuc900_spi *hw, unsigned int sleep)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT) & ~SLEEP;
-
-	if (sleep)
-		val |= (sleep << 12);
-
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static void nuc900_enable_int(struct nuc900_spi *hw)
-{
-	unsigned int val;
-	unsigned long flags;
-
-	spin_lock_irqsave(&hw->lock, flags);
-
-	val = __raw_readl(hw->regs + USI_CNT);
-
-	val |= ENINT;
-
-	__raw_writel(val, hw->regs + USI_CNT);
-
-	spin_unlock_irqrestore(&hw->lock, flags);
-}
-
-static void nuc900_set_divider(struct nuc900_spi *hw)
-{
-	__raw_writel(hw->pdata->divider, hw->regs + USI_DIV);
-}
-
-static void nuc900_init_spi(struct nuc900_spi *hw)
-{
-	clk_enable(hw->clk);
-	spin_lock_init(&hw->lock);
-
-	nuc900_tx_edge(hw, hw->pdata->txneg);
-	nuc900_rx_edge(hw, hw->pdata->rxneg);
-	nuc900_send_first(hw, hw->pdata->lsb);
-	nuc900_set_sleep(hw, hw->pdata->sleep);
-	nuc900_spi_setup_txbitlen(hw, hw->pdata->txbitlen);
-	nuc900_spi_setup_txnum(hw, hw->pdata->txnum);
-	nuc900_set_divider(hw);
-	nuc900_enable_int(hw);
-}
-
-static int nuc900_spi_probe(struct platform_device *pdev)
-{
-	struct nuc900_spi *hw;
-	struct spi_master *master;
-	struct resource *res;
-	int err = 0;
-
-	master = spi_alloc_master(&pdev->dev, sizeof(struct nuc900_spi));
-	if (master == NULL) {
-		dev_err(&pdev->dev, "No memory for spi_master\n");
-		return -ENOMEM;
-	}
-
-	hw = spi_master_get_devdata(master);
-	hw->master = master;
-	hw->pdata  = dev_get_platdata(&pdev->dev);
-
-	if (hw->pdata == NULL) {
-		dev_err(&pdev->dev, "No platform data supplied\n");
-		err = -ENOENT;
-		goto err_pdata;
-	}
-
-	platform_set_drvdata(pdev, hw);
-	init_completion(&hw->done);
-
-	master->mode_bits          = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
-	if (hw->pdata->lsb)
-		master->mode_bits |= SPI_LSB_FIRST;
-	master->num_chipselect     = hw->pdata->num_cs;
-	master->bus_num            = hw->pdata->bus_num;
-	hw->bitbang.master         = hw->master;
-	hw->bitbang.chipselect     = nuc900_spi_chipsel;
-	hw->bitbang.txrx_bufs      = nuc900_spi_txrx;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hw->regs = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(hw->regs)) {
-		err = PTR_ERR(hw->regs);
-		goto err_pdata;
-	}
-
-	hw->irq = platform_get_irq(pdev, 0);
-	if (hw->irq < 0) {
-		dev_err(&pdev->dev, "No IRQ specified\n");
-		err = -ENOENT;
-		goto err_pdata;
-	}
-
-	err = devm_request_irq(&pdev->dev, hw->irq, nuc900_spi_irq, 0,
-				pdev->name, hw);
-	if (err) {
-		dev_err(&pdev->dev, "Cannot claim IRQ\n");
-		goto err_pdata;
-	}
-
-	hw->clk = devm_clk_get(&pdev->dev, "spi");
-	if (IS_ERR(hw->clk)) {
-		dev_err(&pdev->dev, "No clock for device\n");
-		err = PTR_ERR(hw->clk);
-		goto err_pdata;
-	}
-
-	mfp_set_groupg(&pdev->dev, NULL);
-	nuc900_init_spi(hw);
-
-	err = spi_bitbang_start(&hw->bitbang);
-	if (err) {
-		dev_err(&pdev->dev, "Failed to register SPI master\n");
-		goto err_register;
-	}
-
-	return 0;
-
-err_register:
-	clk_disable(hw->clk);
-err_pdata:
-	spi_master_put(hw->master);
-	return err;
-}
-
-static int nuc900_spi_remove(struct platform_device *dev)
-{
-	struct nuc900_spi *hw = platform_get_drvdata(dev);
-
-	spi_bitbang_stop(&hw->bitbang);
-	clk_disable(hw->clk);
-	spi_master_put(hw->master);
-	return 0;
-}
-
-static struct platform_driver nuc900_spi_driver = {
-	.probe		= nuc900_spi_probe,
-	.remove		= nuc900_spi_remove,
-	.driver		= {
-		.name	= "nuc900-spi",
-	},
-};
-module_platform_driver(nuc900_spi_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("nuc900 spi driver!");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-spi");
diff --git a/include/Kbuild b/include/Kbuild
index c38f0d46b267..5e0642d79dce 100644
--- a/include/Kbuild
+++ b/include/Kbuild
@@ -550,7 +550,6 @@ header-test-			+= linux/platform_data/sky81452-backlight.h
 header-test-			+= linux/platform_data/spi-davinci.h
 header-test-			+= linux/platform_data/spi-ep93xx.h
 header-test-			+= linux/platform_data/spi-mt65xx.h
-header-test-			+= linux/platform_data/spi-nuc900.h
 header-test-			+= linux/platform_data/st_sensors_pdata.h
 header-test-			+= linux/platform_data/ti-sysc.h
 header-test-			+= linux/platform_data/timer-ixp4xx.h
diff --git a/include/linux/platform_data/spi-nuc900.h b/include/linux/platform_data/spi-nuc900.h
deleted file mode 100644
index ca3510877000..000000000000
--- a/include/linux/platform_data/spi-nuc900.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (c) 2009 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#ifndef __SPI_NUC900_H
-#define __SPI_NUC900_H
-
-extern void mfp_set_groupg(struct device *dev, const char *subname);
-
-struct nuc900_spi_info {
-	unsigned int num_cs;
-	unsigned int lsb;
-	unsigned int txneg;
-	unsigned int rxneg;
-	unsigned int divider;
-	unsigned int sleep;
-	unsigned int txnum;
-	unsigned int txbitlen;
-	int bus_num;
-};
-
-struct nuc900_spi_chip {
-	unsigned char bits_per_word;
-};
-
-#endif /* __SPI_NUC900_H */
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 08/16] ASoC: remove w90x900/nuc900 platform drivers
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (6 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 07/16] spi: " Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-12 10:36   ` Mark Brown
  2019-08-12 13:09   ` Applied "ASoC: remove w90x900/nuc900 platform drivers" to the asoc tree Mark Brown
  2019-08-09 20:27 ` [PATCH 09/16] fbdev: remove w90x900/nuc900 platform drivers Arnd Bergmann
                   ` (8 subsequent siblings)
  16 siblings, 2 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc; +Cc: Arnd Bergmann, Liam Girdwood, Mark Brown, linux-kernel, alsa-devel

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/Kconfig               |   1 -
 sound/soc/Makefile              |   1 -
 sound/soc/nuc900/Kconfig        |  29 ---
 sound/soc/nuc900/Makefile       |  12 -
 sound/soc/nuc900/nuc900-ac97.c  | 391 --------------------------------
 sound/soc/nuc900/nuc900-audio.c |  73 ------
 sound/soc/nuc900/nuc900-audio.h | 108 ---------
 sound/soc/nuc900/nuc900-pcm.c   | 321 --------------------------
 8 files changed, 936 deletions(-)
 delete mode 100644 sound/soc/nuc900/Kconfig
 delete mode 100644 sound/soc/nuc900/Makefile
 delete mode 100644 sound/soc/nuc900/nuc900-ac97.c
 delete mode 100644 sound/soc/nuc900/nuc900-audio.c
 delete mode 100644 sound/soc/nuc900/nuc900-audio.h
 delete mode 100644 sound/soc/nuc900/nuc900-pcm.c

diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index dc86e4073001..bdc305cece6e 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -51,7 +51,6 @@ source "sound/soc/dwc/Kconfig"
 source "sound/soc/fsl/Kconfig"
 source "sound/soc/hisilicon/Kconfig"
 source "sound/soc/jz4740/Kconfig"
-source "sound/soc/nuc900/Kconfig"
 source "sound/soc/kirkwood/Kconfig"
 source "sound/soc/img/Kconfig"
 source "sound/soc/intel/Kconfig"
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
index d90ce8a32887..3fe3e7f3b7d5 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -39,7 +39,6 @@ obj-$(CONFIG_SND_SOC)	+= intel/
 obj-$(CONFIG_SND_SOC)	+= mediatek/
 obj-$(CONFIG_SND_SOC)	+= meson/
 obj-$(CONFIG_SND_SOC)	+= mxs/
-obj-$(CONFIG_SND_SOC)	+= nuc900/
 obj-$(CONFIG_SND_SOC)	+= kirkwood/
 obj-$(CONFIG_SND_SOC)	+= pxa/
 obj-$(CONFIG_SND_SOC)	+= qcom/
diff --git a/sound/soc/nuc900/Kconfig b/sound/soc/nuc900/Kconfig
deleted file mode 100644
index e1b22fbcb159..000000000000
--- a/sound/soc/nuc900/Kconfig
+++ /dev/null
@@ -1,29 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-##
-## NUC900 series AC97 API
-##
-config SND_SOC_NUC900
-	tristate "SoC Audio for NUC900 series"
-	depends on ARCH_W90X900
-	select SND_SOC_NUC900_AC97
-	help
-	  This option enables support for AC97 mode on the NUC900 SoC.
-
-config SND_SOC_NUC900_AC97
-	tristate
-	select AC97_BUS
-	select SND_AC97_CODEC
-	select SND_SOC_AC97_BUS
-
-
-##
-## Boards
-##
-config SND_SOC_NUC900EVB
-	tristate "NUC900 AC97 support for demo board"
-	depends on SND_SOC_NUC900
-	select SND_SOC_NUC900_AC97
-	select SND_SOC_AC97_CODEC
-	help
-	  Select this option to enable audio (AC97) on the
-	  NUC900 demoboard.
diff --git a/sound/soc/nuc900/Makefile b/sound/soc/nuc900/Makefile
deleted file mode 100644
index c7ba2b9549d2..000000000000
--- a/sound/soc/nuc900/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-# NUC900 series audio
-snd-soc-nuc900-pcm-objs := nuc900-pcm.o
-snd-soc-nuc900-ac97-objs := nuc900-ac97.o
-
-obj-$(CONFIG_SND_SOC_NUC900) += snd-soc-nuc900-pcm.o
-obj-$(CONFIG_SND_SOC_NUC900_AC97) += snd-soc-nuc900-ac97.o
-
-# Boards
-snd-soc-nuc900-audio-objs := nuc900-audio.o
-
-obj-$(CONFIG_SND_SOC_NUC900EVB) += snd-soc-nuc900-audio.o
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c
deleted file mode 100644
index 5f2e5c069377..000000000000
--- a/sound/soc/nuc900/nuc900-ac97.c
+++ /dev/null
@@ -1,391 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2009-2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/mutex.h>
-#include <linux/suspend.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-#include <linux/clk.h>
-
-#include <mach/mfp.h>
-
-#include "nuc900-audio.h"
-
-static DEFINE_MUTEX(ac97_mutex);
-struct nuc900_audio *nuc900_ac97_data;
-EXPORT_SYMBOL_GPL(nuc900_ac97_data);
-
-static int nuc900_checkready(void)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-
-	if (!(AUDIO_READ(nuc900_audio->mmio + ACTL_ACIS0) & CODEC_READY))
-		return -EPERM;
-
-	return 0;
-}
-
-/* AC97 controller reads codec register */
-static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97,
-					unsigned short reg)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long timeout = 0x10000, val;
-
-	mutex_lock(&ac97_mutex);
-
-	val = nuc900_checkready();
-	if (val) {
-		dev_err(nuc900_audio->dev, "AC97 codec is not ready\n");
-		goto out;
-	}
-
-	/* set the R_WB bit and write register index */
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS1, R_WB | reg);
-
-	/* set the valid frame bit and valid slots */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-	val |= (VALID_FRAME | SLOT1_VALID);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, val);
-
-	udelay(100);
-
-	/* polling the AC_R_FINISH */
-	while (!(AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_R_FINISH)
-								&& --timeout)
-		mdelay(1);
-
-	if (!timeout) {
-		dev_err(nuc900_audio->dev, "AC97 read register time out !\n");
-		val = -EPERM;
-		goto out;
-	}
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0) ;
-	val &= ~SLOT1_VALID;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, val);
-
-	if (AUDIO_READ(nuc900_audio->mmio + ACTL_ACIS1) >> 2 != reg) {
-		dev_err(nuc900_audio->dev,
-				"R_INDEX of REG_ACTL_ACIS1 not match!\n");
-	}
-
-	udelay(100);
-	val = (AUDIO_READ(nuc900_audio->mmio + ACTL_ACIS2) & 0xFFFF);
-
-out:
-	mutex_unlock(&ac97_mutex);
-	return val;
-}
-
-/* AC97 controller writes to codec register */
-static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
-				unsigned short val)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long tmp, timeout = 0x10000;
-
-	mutex_lock(&ac97_mutex);
-
-	tmp = nuc900_checkready();
-	if (tmp)
-		dev_err(nuc900_audio->dev, "AC97 codec is not ready\n");
-
-	/* clear the R_WB bit and write register index */
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS1, reg);
-
-	/* write register value */
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS2, val);
-
-	/* set the valid frame bit and valid slots */
-	tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-	tmp |= SLOT1_VALID | SLOT2_VALID | VALID_FRAME;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-	udelay(100);
-
-	/* polling the AC_W_FINISH */
-	while ((AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_W_FINISH)
-								&& --timeout)
-		mdelay(1);
-
-	if (!timeout)
-		dev_err(nuc900_audio->dev, "AC97 write register time out !\n");
-
-	tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-	tmp &= ~(SLOT1_VALID | SLOT2_VALID);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-	mutex_unlock(&ac97_mutex);
-
-}
-
-static void nuc900_ac97_warm_reset(struct snd_ac97 *ac97)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long val;
-
-	mutex_lock(&ac97_mutex);
-
-	/* warm reset AC 97 */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
-	val |= AC_W_RES;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACCON, val);
-
-	udelay(100);
-
-	val = nuc900_checkready();
-	if (val)
-		dev_err(nuc900_audio->dev, "AC97 codec is not ready\n");
-
-	mutex_unlock(&ac97_mutex);
-}
-
-static void nuc900_ac97_cold_reset(struct snd_ac97 *ac97)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long val;
-
-	mutex_lock(&ac97_mutex);
-
-	/* reset Audio Controller */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val |= ACTL_RESET_BIT;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val &= (~ACTL_RESET_BIT);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	/* reset AC-link interface */
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val |= AC_RESET;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val &= ~AC_RESET;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	/* cold reset AC 97 */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
-	val |= AC_C_RES;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACCON, val);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
-	val &= (~AC_C_RES);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACCON, val);
-
-	udelay(100);
-
-	mutex_unlock(&ac97_mutex);
-
-}
-
-/* AC97 controller operations */
-static struct snd_ac97_bus_ops nuc900_ac97_ops = {
-	.read		= nuc900_ac97_read,
-	.write		= nuc900_ac97_write,
-	.reset		= nuc900_ac97_cold_reset,
-	.warm_reset	= nuc900_ac97_warm_reset,
-};
-
-static int nuc900_ac97_trigger(struct snd_pcm_substream *substream,
-				int cmd, struct snd_soc_dai *dai)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	int ret;
-	unsigned long val, tmp;
-
-	ret = 0;
-
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-			tmp |= (SLOT3_VALID | SLOT4_VALID | VALID_FRAME);
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_PSR);
-			tmp |= (P_DMA_END_IRQ | P_DMA_MIDDLE_IRQ);
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, tmp);
-			val |= AC_PLAY;
-		} else {
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_RSR);
-			tmp |= (R_DMA_END_IRQ | R_DMA_MIDDLE_IRQ);
-
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, tmp);
-			val |= AC_RECORD;
-		}
-
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-		break;
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-			tmp &= ~(SLOT3_VALID | SLOT4_VALID);
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, RESET_PRSR);
-			val &= ~AC_PLAY;
-		} else {
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, RESET_PRSR);
-			val &= ~AC_RECORD;
-		}
-
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-		break;
-	default:
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-static int nuc900_ac97_probe(struct snd_soc_dai *dai)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long val;
-
-	mutex_lock(&ac97_mutex);
-
-	/* enable unit clock */
-	clk_enable(nuc900_audio->clk);
-
-	/* enable audio controller and AC-link interface */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-	val |= (IIS_AC_PIN_SEL | ACLINK_EN);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val);
-
-	mutex_unlock(&ac97_mutex);
-
-	return 0;
-}
-
-static int nuc900_ac97_remove(struct snd_soc_dai *dai)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-
-	clk_disable(nuc900_audio->clk);
-	return 0;
-}
-
-static const struct snd_soc_dai_ops nuc900_ac97_dai_ops = {
-	.trigger	= nuc900_ac97_trigger,
-};
-
-static struct snd_soc_dai_driver nuc900_ac97_dai = {
-	.probe			= nuc900_ac97_probe,
-	.remove			= nuc900_ac97_remove,
-	.bus_control		= true,
-	.playback = {
-		.rates		= SNDRV_PCM_RATE_8000_48000,
-		.formats	= SNDRV_PCM_FMTBIT_S16_LE,
-		.channels_min	= 1,
-		.channels_max	= 2,
-	},
-	.capture = {
-		.rates		= SNDRV_PCM_RATE_8000_48000,
-		.formats	= SNDRV_PCM_FMTBIT_S16_LE,
-		.channels_min	= 1,
-		.channels_max	= 2,
-	},
-	.ops = &nuc900_ac97_dai_ops,
-};
-
-static const struct snd_soc_component_driver nuc900_ac97_component = {
-	.name		= "nuc900-ac97",
-};
-
-static int nuc900_ac97_drvprobe(struct platform_device *pdev)
-{
-	struct nuc900_audio *nuc900_audio;
-	int ret;
-
-	if (nuc900_ac97_data)
-		return -EBUSY;
-
-	nuc900_audio = devm_kzalloc(&pdev->dev, sizeof(struct nuc900_audio),
-				    GFP_KERNEL);
-	if (!nuc900_audio)
-		return -ENOMEM;
-
-	spin_lock_init(&nuc900_audio->lock);
-
-	nuc900_audio->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	nuc900_audio->mmio = devm_ioremap_resource(&pdev->dev,
-						   nuc900_audio->res);
-	if (IS_ERR(nuc900_audio->mmio))
-		return PTR_ERR(nuc900_audio->mmio);
-
-	nuc900_audio->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(nuc900_audio->clk)) {
-		ret = PTR_ERR(nuc900_audio->clk);
-		goto out;
-	}
-
-	ret = platform_get_irq(pdev, 0);
-	if (ret < 0)
-		goto out;
-	nuc900_audio->irq_num = ret;
-
-	nuc900_ac97_data = nuc900_audio;
-
-	ret = snd_soc_set_ac97_ops(&nuc900_ac97_ops);
-	if (ret)
-		goto out;
-
-	ret = devm_snd_soc_register_component(&pdev->dev, &nuc900_ac97_component,
-					 &nuc900_ac97_dai, 1);
-	if (ret)
-		goto out;
-
-	/* enbale ac97 multifunction pin */
-	mfp_set_groupg(nuc900_audio->dev, NULL);
-
-	return 0;
-
-out:
-	snd_soc_set_ac97_ops(NULL);
-	return ret;
-}
-
-static int nuc900_ac97_drvremove(struct platform_device *pdev)
-{
-	nuc900_ac97_data = NULL;
-	snd_soc_set_ac97_ops(NULL);
-
-	return 0;
-}
-
-static struct platform_driver nuc900_ac97_driver = {
-	.driver	= {
-		.name	= "nuc900-ac97",
-	},
-	.probe		= nuc900_ac97_drvprobe,
-	.remove		= nuc900_ac97_drvremove,
-};
-
-module_platform_driver(nuc900_ac97_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("NUC900 AC97 SoC driver!");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-ac97");
diff --git a/sound/soc/nuc900/nuc900-audio.c b/sound/soc/nuc900/nuc900-audio.c
deleted file mode 100644
index 19146690d514..000000000000
--- a/sound/soc/nuc900/nuc900-audio.c
+++ /dev/null
@@ -1,73 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include "nuc900-audio.h"
-
-SND_SOC_DAILINK_DEFS(ac97,
-	DAILINK_COMP_ARRAY(COMP_CPU("nuc900-ac97")),
-	DAILINK_COMP_ARRAY(COMP_CODEC("ac97-codec", "ac97-hifi")),
-	DAILINK_COMP_ARRAY(COMP_PLATFORM("nuc900-pcm-audio")));
-
-static struct snd_soc_dai_link nuc900evb_ac97_dai = {
-	.name		= "AC97",
-	.stream_name	= "AC97 HiFi",
-	SND_SOC_DAILINK_REG(ac97),
-};
-
-static struct snd_soc_card nuc900evb_audio_machine = {
-	.name		= "NUC900EVB_AC97",
-	.owner		= THIS_MODULE,
-	.dai_link	= &nuc900evb_ac97_dai,
-	.num_links	= 1,
-};
-
-static struct platform_device *nuc900evb_asoc_dev;
-
-static int __init nuc900evb_audio_init(void)
-{
-	int ret;
-
-	ret = -ENOMEM;
-	nuc900evb_asoc_dev = platform_device_alloc("soc-audio", -1);
-	if (!nuc900evb_asoc_dev)
-		goto out;
-
-	/* nuc900 board audio device */
-	platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_audio_machine);
-
-	ret = platform_device_add(nuc900evb_asoc_dev);
-
-	if (ret) {
-		platform_device_put(nuc900evb_asoc_dev);
-		nuc900evb_asoc_dev = NULL;
-	}
-
-out:
-	return ret;
-}
-
-static void __exit nuc900evb_audio_exit(void)
-{
-	platform_device_unregister(nuc900evb_asoc_dev);
-}
-
-module_init(nuc900evb_audio_init);
-module_exit(nuc900evb_audio_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("NUC900 Series ASoC audio support");
-MODULE_AUTHOR("Wan ZongShun");
diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h
deleted file mode 100644
index 90ffa7bbce01..000000000000
--- a/sound/soc/nuc900/nuc900-audio.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (c) 2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#ifndef _NUC900_AUDIO_H
-#define _NUC900_AUDIO_H
-
-#include <linux/io.h>
-
-/* Audio Control Registers */
-#define ACTL_CON		0x00
-#define ACTL_RESET		0x04
-#define ACTL_RDSTB		0x08
-#define ACTL_RDST_LENGTH	0x0C
-#define ACTL_RDSTC		0x10
-#define ACTL_RSR		0x14
-#define ACTL_PDSTB		0x18
-#define ACTL_PDST_LENGTH	0x1C
-#define ACTL_PDSTC		0x20
-#define ACTL_PSR		0x24
-#define ACTL_IISCON		0x28
-#define ACTL_ACCON		0x2C
-#define ACTL_ACOS0		0x30
-#define ACTL_ACOS1		0x34
-#define ACTL_ACOS2		0x38
-#define ACTL_ACIS0		0x3C
-#define ACTL_ACIS1		0x40
-#define ACTL_ACIS2		0x44
-#define ACTL_COUNTER		0x48
-
-/* bit definition of REG_ACTL_CON register */
-#define R_DMA_IRQ		0x1000
-#define T_DMA_IRQ		0x0800
-#define IIS_AC_PIN_SEL		0x0100
-#define FIFO_TH			0x0080
-#define ADC_EN			0x0010
-#define M80_EN			0x0008
-#define ACLINK_EN		0x0004
-#define IIS_EN			0x0002
-
-/* bit definition of REG_ACTL_RESET register */
-#define W5691_PLAY		0x20000
-#define ACTL_RESET_BIT		0x10000
-#define RECORD_RIGHT_CHNNEL	0x08000
-#define RECORD_LEFT_CHNNEL	0x04000
-#define PLAY_RIGHT_CHNNEL	0x02000
-#define PLAY_LEFT_CHNNEL	0x01000
-#define DAC_PLAY		0x00800
-#define ADC_RECORD		0x00400
-#define M80_PLAY		0x00200
-#define AC_RECORD		0x00100
-#define AC_PLAY			0x00080
-#define IIS_RECORD		0x00040
-#define IIS_PLAY		0x00020
-#define DAC_RESET		0x00010
-#define ADC_RESET		0x00008
-#define M80_RESET		0x00004
-#define AC_RESET		0x00002
-#define IIS_RESET		0x00001
-
-/* bit definition of REG_ACTL_ACCON register */
-#define AC_BCLK_PU_EN		0x20
-#define AC_R_FINISH		0x10
-#define AC_W_FINISH		0x08
-#define AC_W_RES		0x04
-#define AC_C_RES		0x02
-
-/* bit definition of ACTL_RSR register */
-#define R_FIFO_EMPTY		0x04
-#define R_DMA_END_IRQ		0x02
-#define R_DMA_MIDDLE_IRQ	0x01
-
-/* bit definition of ACTL_PSR register */
-#define P_FIFO_EMPTY		0x04
-#define P_DMA_END_IRQ		0x02
-#define P_DMA_MIDDLE_IRQ	0x01
-
-/* bit definition of ACTL_ACOS0 register */
-#define SLOT1_VALID		0x01
-#define SLOT2_VALID		0x02
-#define SLOT3_VALID		0x04
-#define SLOT4_VALID		0x08
-#define VALID_FRAME		0x10
-
-/* bit definition of ACTL_ACOS1 register */
-#define R_WB			0x80
-
-#define CODEC_READY		0x10
-#define RESET_PRSR		0x00
-#define AUDIO_WRITE(addr, val)	__raw_writel(val, addr)
-#define AUDIO_READ(addr)	__raw_readl(addr)
-
-struct nuc900_audio {
-	void __iomem *mmio;
-	spinlock_t lock;
-	unsigned long irq_num;
-	struct resource *res;
-	struct clk *clk;
-	struct device *dev;
-
-};
-
-extern struct nuc900_audio *nuc900_ac97_data;
-
-#endif /*end _NUC900_AUDIO_H */
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c
deleted file mode 100644
index 4442a26e9502..000000000000
--- a/sound/soc/nuc900/nuc900-pcm.c
+++ /dev/null
@@ -1,321 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/dma-mapping.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-
-#include <mach/hardware.h>
-
-#include "nuc900-audio.h"
-
-static const struct snd_pcm_hardware nuc900_pcm_hardware = {
-	.info			= SNDRV_PCM_INFO_INTERLEAVED |
-					SNDRV_PCM_INFO_BLOCK_TRANSFER |
-					SNDRV_PCM_INFO_MMAP |
-					SNDRV_PCM_INFO_MMAP_VALID |
-					SNDRV_PCM_INFO_PAUSE |
-					SNDRV_PCM_INFO_RESUME,
-	.buffer_bytes_max	= 4*1024,
-	.period_bytes_min	= 1*1024,
-	.period_bytes_max	= 4*1024,
-	.periods_min		= 1,
-	.periods_max		= 1024,
-};
-
-static int nuc900_dma_hw_params(struct snd_pcm_substream *substream,
-	struct snd_pcm_hw_params *params)
-{
-	return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
-}
-
-static void nuc900_update_dma_register(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	void __iomem *mmio_addr, *mmio_len;
-
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		mmio_addr = nuc900_audio->mmio + ACTL_PDSTB;
-		mmio_len = nuc900_audio->mmio + ACTL_PDST_LENGTH;
-	} else {
-		mmio_addr = nuc900_audio->mmio + ACTL_RDSTB;
-		mmio_len = nuc900_audio->mmio + ACTL_RDST_LENGTH;
-	}
-
-	AUDIO_WRITE(mmio_addr, runtime->dma_addr);
-	AUDIO_WRITE(mmio_len, runtime->dma_bytes);
-}
-
-static void nuc900_dma_start(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	unsigned long val;
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-	val |= (T_DMA_IRQ | R_DMA_IRQ);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val);
-}
-
-static void nuc900_dma_stop(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	unsigned long val;
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-	val &= ~(T_DMA_IRQ | R_DMA_IRQ);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val);
-}
-
-static irqreturn_t nuc900_dma_interrupt(int irq, void *dev_id)
-{
-	struct snd_pcm_substream *substream = dev_id;
-	struct nuc900_audio *nuc900_audio = substream->runtime->private_data;
-	unsigned long val;
-
-	spin_lock(&nuc900_audio->lock);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-
-	if (val & R_DMA_IRQ) {
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val | R_DMA_IRQ);
-
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_RSR);
-
-		if (val & R_DMA_MIDDLE_IRQ) {
-			val |= R_DMA_MIDDLE_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, val);
-		}
-
-		if (val & R_DMA_END_IRQ) {
-			val |= R_DMA_END_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, val);
-		}
-	} else if (val & T_DMA_IRQ) {
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val | T_DMA_IRQ);
-
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_PSR);
-
-		if (val & P_DMA_MIDDLE_IRQ) {
-			val |= P_DMA_MIDDLE_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, val);
-		}
-
-		if (val & P_DMA_END_IRQ) {
-			val |= P_DMA_END_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, val);
-		}
-	} else {
-		dev_err(nuc900_audio->dev, "Wrong DMA interrupt status!\n");
-		spin_unlock(&nuc900_audio->lock);
-		return IRQ_HANDLED;
-	}
-
-	spin_unlock(&nuc900_audio->lock);
-
-	snd_pcm_period_elapsed(substream);
-
-	return IRQ_HANDLED;
-}
-
-static int nuc900_dma_hw_free(struct snd_pcm_substream *substream)
-{
-	snd_pcm_lib_free_pages(substream);
-	return 0;
-}
-
-static int nuc900_dma_prepare(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	unsigned long flags, val;
-	int ret = 0;
-
-	spin_lock_irqsave(&nuc900_audio->lock, flags);
-
-	nuc900_update_dma_register(substream);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-
-	switch (runtime->channels) {
-	case 1:
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			val &= ~(PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL);
-			val |= PLAY_RIGHT_CHNNEL;
-		} else {
-			val &= ~(RECORD_LEFT_CHNNEL | RECORD_RIGHT_CHNNEL);
-			val |= RECORD_RIGHT_CHNNEL;
-		}
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-		break;
-	case 2:
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-			val |= (PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL);
-		else
-			val |= (RECORD_LEFT_CHNNEL | RECORD_RIGHT_CHNNEL);
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-		break;
-	default:
-		ret = -EINVAL;
-	}
-	spin_unlock_irqrestore(&nuc900_audio->lock, flags);
-	return ret;
-}
-
-static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd)
-{
-	int ret = 0;
-
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-		nuc900_dma_start(substream);
-		break;
-
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-		nuc900_dma_stop(substream);
-		break;
-
-	default:
-		ret = -EINVAL;
-		break;
-	}
-
-	return ret;
-}
-
-static int nuc900_dma_getposition(struct snd_pcm_substream *substream,
-					dma_addr_t *src, dma_addr_t *dst)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-
-	if (src != NULL)
-		*src = AUDIO_READ(nuc900_audio->mmio + ACTL_PDSTC);
-
-	if (dst != NULL)
-		*dst = AUDIO_READ(nuc900_audio->mmio + ACTL_RDSTC);
-
-	return 0;
-}
-
-static snd_pcm_uframes_t nuc900_dma_pointer(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	dma_addr_t src, dst;
-	unsigned long res;
-
-	nuc900_dma_getposition(substream, &src, &dst);
-
-	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
-		res = dst - runtime->dma_addr;
-	else
-		res = src - runtime->dma_addr;
-
-	return bytes_to_frames(substream->runtime, res);
-}
-
-static int nuc900_dma_open(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio;
-
-	snd_soc_set_runtime_hwparams(substream, &nuc900_pcm_hardware);
-
-	nuc900_audio = nuc900_ac97_data;
-
-	if (request_irq(nuc900_audio->irq_num, nuc900_dma_interrupt,
-			0, "nuc900-dma", substream))
-		return -EBUSY;
-
-	runtime->private_data = nuc900_audio;
-
-	return 0;
-}
-
-static int nuc900_dma_close(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-
-	free_irq(nuc900_audio->irq_num, substream);
-
-	return 0;
-}
-
-static int nuc900_dma_mmap(struct snd_pcm_substream *substream,
-	struct vm_area_struct *vma)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-
-	return dma_mmap_wc(substream->pcm->card->dev, vma, runtime->dma_area,
-			   runtime->dma_addr, runtime->dma_bytes);
-}
-
-static const struct snd_pcm_ops nuc900_dma_ops = {
-	.open		= nuc900_dma_open,
-	.close		= nuc900_dma_close,
-	.ioctl		= snd_pcm_lib_ioctl,
-	.hw_params	= nuc900_dma_hw_params,
-	.hw_free	= nuc900_dma_hw_free,
-	.prepare	= nuc900_dma_prepare,
-	.trigger	= nuc900_dma_trigger,
-	.pointer	= nuc900_dma_pointer,
-	.mmap		= nuc900_dma_mmap,
-};
-
-static int nuc900_dma_new(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_card *card = rtd->card->snd_card;
-	struct snd_pcm *pcm = rtd->pcm;
-	int ret;
-
-	ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
-	if (ret)
-		return ret;
-
-	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-		card->dev, 4 * 1024, (4 * 1024) - 1);
-
-	return 0;
-}
-
-static const struct snd_soc_component_driver nuc900_soc_component = {
-	.ops		= &nuc900_dma_ops,
-	.pcm_new	= nuc900_dma_new,
-};
-
-static int nuc900_soc_platform_probe(struct platform_device *pdev)
-{
-	return devm_snd_soc_register_component(&pdev->dev, &nuc900_soc_component,
-					       NULL, 0);
-}
-
-static struct platform_driver nuc900_pcm_driver = {
-	.driver = {
-			.name = "nuc900-pcm-audio",
-	},
-
-	.probe = nuc900_soc_platform_probe,
-};
-
-module_platform_driver(nuc900_pcm_driver);
-
-MODULE_AUTHOR("Wan ZongShun, <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("nuc900 Audio DMA module");
-MODULE_LICENSE("GPL");
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 09/16] fbdev: remove w90x900/nuc900 platform drivers
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (7 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 08/16] ASoC: remove w90x900/nuc900 platform drivers Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-13 13:30   ` Bartlomiej Zolnierkiewicz
  2019-08-09 20:27 ` [PATCH 10/16] Input: remove w90x900 keyboard driver Arnd Bergmann
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Bartlomiej Zolnierkiewicz, linux-kernel,
	dri-devel, linux-fbdev

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/video/fbdev/Kconfig                  |  14 -
 drivers/video/fbdev/Makefile                 |   1 -
 drivers/video/fbdev/nuc900fb.c               | 760 -------------------
 drivers/video/fbdev/nuc900fb.h               |  51 --
 include/Kbuild                               |   1 -
 include/linux/platform_data/video-nuc900fb.h |  79 --
 6 files changed, 906 deletions(-)
 delete mode 100644 drivers/video/fbdev/nuc900fb.c
 delete mode 100644 drivers/video/fbdev/nuc900fb.h
 delete mode 100644 include/linux/platform_data/video-nuc900fb.h

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 6b2de93bd302..5f83cd715387 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1924,20 +1924,6 @@ config FB_S3C2410_DEBUG
 	  Turn on debugging messages. Note that you can set/unset at run time
 	  through sysfs
 
-config FB_NUC900
-	tristate "NUC900 LCD framebuffer support"
-	depends on FB && ARCH_W90X900
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
-	---help---
-	  Frame buffer driver for the built-in LCD controller in the Nuvoton
-	  NUC900 processor
-
-config GPM1040A0_320X240
-	bool "Giantplus Technology GPM1040A0 320x240 Color TFT LCD"
-	depends on FB_NUC900
-
 config FB_SM501
 	tristate "Silicon Motion SM501 framebuffer support"
 	depends on FB && MFD_SM501
diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
index 7dc4861a93e6..aab7155884ea 100644
--- a/drivers/video/fbdev/Makefile
+++ b/drivers/video/fbdev/Makefile
@@ -116,7 +116,6 @@ obj-y                             += omap2/
 obj-$(CONFIG_XEN_FBDEV_FRONTEND)  += xen-fbfront.o
 obj-$(CONFIG_FB_CARMINE)          += carminefb.o
 obj-$(CONFIG_FB_MB862XX)	  += mb862xx/
-obj-$(CONFIG_FB_NUC900)           += nuc900fb.o
 obj-$(CONFIG_FB_JZ4740)		  += jz4740_fb.o
 obj-$(CONFIG_FB_PUV3_UNIGFX)      += fb-puv3.o
 obj-$(CONFIG_FB_HYPERV)		  += hyperv_fb.o
diff --git a/drivers/video/fbdev/nuc900fb.c b/drivers/video/fbdev/nuc900fb.c
deleted file mode 100644
index 4fd851598584..000000000000
--- a/drivers/video/fbdev/nuc900fb.c
+++ /dev/null
@@ -1,760 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- *
- * Copyright (c) 2009 Nuvoton technology corporation
- * All rights reserved.
- *
- *  Description:
- *    Nuvoton LCD Controller Driver
- *  Author:
- *    Wang Qiang (rurality.linux@gmail.com) 2009/12/11
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/err.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/tty.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
-#include <linux/fb.h>
-#include <linux/init.h>
-#include <linux/dma-mapping.h>
-#include <linux/interrupt.h>
-#include <linux/workqueue.h>
-#include <linux/wait.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/cpufreq.h>
-#include <linux/io.h>
-#include <linux/pm.h>
-#include <linux/device.h>
-
-#include <mach/map.h>
-#include <mach/regs-clock.h>
-#include <mach/regs-ldm.h>
-#include <linux/platform_data/video-nuc900fb.h>
-
-#include "nuc900fb.h"
-
-
-/*
- *  Initialize the nuc900 video (dual) buffer address
- */
-static void nuc900fb_set_lcdaddr(struct fb_info *info)
-{
-	struct nuc900fb_info *fbi = info->par;
-	void __iomem *regs = fbi->io;
-	unsigned long vbaddr1, vbaddr2;
-
-	vbaddr1  = info->fix.smem_start;
-	vbaddr2  = info->fix.smem_start;
-	vbaddr2 += info->fix.line_length * info->var.yres;
-
-	/* set frambuffer start phy addr*/
-	writel(vbaddr1, regs + REG_LCM_VA_BADDR0);
-	writel(vbaddr2, regs + REG_LCM_VA_BADDR1);
-
-	writel(fbi->regs.lcd_va_fbctrl, regs + REG_LCM_VA_FBCTRL);
-	writel(fbi->regs.lcd_va_scale, regs + REG_LCM_VA_SCALE);
-}
-
-/*
- *	calculate divider for lcd div
- */
-static unsigned int nuc900fb_calc_pixclk(struct nuc900fb_info *fbi,
-					 unsigned long pixclk)
-{
-	unsigned long clk = fbi->clk_rate;
-	unsigned long long div;
-
-	/* pixclk is in picseconds. our clock is in Hz*/
-	/* div = (clk * pixclk)/10^12 */
-	div = (unsigned long long)clk * pixclk;
-	div >>= 12;
-	do_div(div, 625 * 625UL * 625);
-
-	dev_dbg(fbi->dev, "pixclk %ld, divisor is %lld\n", pixclk, div);
-
-	return div;
-}
-
-/*
- *	Check the video params of 'var'.
- */
-static int nuc900fb_check_var(struct fb_var_screeninfo *var,
-			       struct fb_info *info)
-{
-	struct nuc900fb_info *fbi = info->par;
-	struct nuc900fb_mach_info *mach_info = dev_get_platdata(fbi->dev);
-	struct nuc900fb_display *display = NULL;
-	struct nuc900fb_display *default_display = mach_info->displays +
-						   mach_info->default_display;
-	int i;
-
-	dev_dbg(fbi->dev, "check_var(var=%p, info=%p)\n", var, info);
-
-	/* validate x/y resolution */
-	/* choose default mode if possible */
-	if (var->xres == default_display->xres &&
-	    var->yres == default_display->yres &&
-	    var->bits_per_pixel == default_display->bpp)
-		display = default_display;
-	else
-		for (i = 0; i < mach_info->num_displays; i++)
-			if (var->xres == mach_info->displays[i].xres &&
-			    var->yres == mach_info->displays[i].yres &&
-			    var->bits_per_pixel == mach_info->displays[i].bpp) {
-				display = mach_info->displays + i;
-				break;
-			}
-
-	if (display == NULL) {
-		printk(KERN_ERR "wrong resolution or depth %dx%d at %d bit per pixel\n",
-			var->xres, var->yres, var->bits_per_pixel);
-		return -EINVAL;
-	}
-
-	/* it should be the same size as the display */
-	var->xres_virtual	= display->xres;
-	var->yres_virtual	= display->yres;
-	var->height		= display->height;
-	var->width		= display->width;
-
-	/* copy lcd settings */
-	var->pixclock		= display->pixclock;
-	var->left_margin	= display->left_margin;
-	var->right_margin	= display->right_margin;
-	var->upper_margin	= display->upper_margin;
-	var->lower_margin	= display->lower_margin;
-	var->vsync_len		= display->vsync_len;
-	var->hsync_len		= display->hsync_len;
-
-	var->transp.offset	= 0;
-	var->transp.length	= 0;
-
-	fbi->regs.lcd_dccs = display->dccs;
-	fbi->regs.lcd_device_ctrl = display->devctl;
-	fbi->regs.lcd_va_fbctrl = display->fbctrl;
-	fbi->regs.lcd_va_scale = display->scale;
-
-	/* set R/G/B possions */
-	switch (var->bits_per_pixel) {
-	case 1:
-	case 2:
-	case 4:
-	case 8:
-	default:
-		var->red.offset 	= 0;
-		var->red.length 	= var->bits_per_pixel;
-		var->green 		= var->red;
-		var->blue		= var->red;
-		break;
-	case 12:
-		var->red.length		= 4;
-		var->green.length	= 4;
-		var->blue.length	= 4;
-		var->red.offset		= 8;
-		var->green.offset	= 4;
-		var->blue.offset	= 0;
-		break;
-	case 16:
-		var->red.length		= 5;
-		var->green.length	= 6;
-		var->blue.length	= 5;
-		var->red.offset		= 11;
-		var->green.offset	= 5;
-		var->blue.offset	= 0;
-		break;
-	case 18:
-		var->red.length		= 6;
-		var->green.length	= 6;
-		var->blue.length	= 6;
-		var->red.offset		= 12;
-		var->green.offset	= 6;
-		var->blue.offset	= 0;
-		break;
-	case 32:
-		var->red.length		= 8;
-		var->green.length	= 8;
-		var->blue.length	= 8;
-		var->red.offset		= 16;
-		var->green.offset	= 8;
-		var->blue.offset	= 0;
-		break;
-	}
-
-	return 0;
-}
-
-/*
- *	Calculate lcd register values from var setting & save into hw
- */
-static void nuc900fb_calculate_lcd_regs(const struct fb_info *info,
-					struct nuc900fb_hw *regs)
-{
-	const struct fb_var_screeninfo *var = &info->var;
-	int vtt = var->height + var->upper_margin + var->lower_margin;
-	int htt = var->width + var->left_margin + var->right_margin;
-	int hsync = var->width + var->right_margin;
-	int vsync = var->height + var->lower_margin;
-
-	regs->lcd_crtc_size = LCM_CRTC_SIZE_VTTVAL(vtt) |
-			      LCM_CRTC_SIZE_HTTVAL(htt);
-	regs->lcd_crtc_dend = LCM_CRTC_DEND_VDENDVAL(var->height) |
-			      LCM_CRTC_DEND_HDENDVAL(var->width);
-	regs->lcd_crtc_hr = LCM_CRTC_HR_EVAL(var->width + 5) |
-			    LCM_CRTC_HR_SVAL(var->width + 1);
-	regs->lcd_crtc_hsync = LCM_CRTC_HSYNC_EVAL(hsync + var->hsync_len) |
-			       LCM_CRTC_HSYNC_SVAL(hsync);
-	regs->lcd_crtc_vr = LCM_CRTC_VR_EVAL(vsync + var->vsync_len) |
-			    LCM_CRTC_VR_SVAL(vsync);
-
-}
-
-/*
- *	Activate (set) the controller from the given framebuffer
- *	information
- */
-static void nuc900fb_activate_var(struct fb_info *info)
-{
-	struct nuc900fb_info *fbi = info->par;
-	void __iomem *regs = fbi->io;
-	struct fb_var_screeninfo *var = &info->var;
-	int clkdiv;
-
-	clkdiv = nuc900fb_calc_pixclk(fbi, var->pixclock) - 1;
-	if (clkdiv < 0)
-		clkdiv = 0;
-
-	nuc900fb_calculate_lcd_regs(info, &fbi->regs);
-
-	/* set the new lcd registers*/
-
-	dev_dbg(fbi->dev, "new lcd register set:\n");
-	dev_dbg(fbi->dev, "dccs       = 0x%08x\n", fbi->regs.lcd_dccs);
-	dev_dbg(fbi->dev, "dev_ctl    = 0x%08x\n", fbi->regs.lcd_device_ctrl);
-	dev_dbg(fbi->dev, "crtc_size  = 0x%08x\n", fbi->regs.lcd_crtc_size);
-	dev_dbg(fbi->dev, "crtc_dend  = 0x%08x\n", fbi->regs.lcd_crtc_dend);
-	dev_dbg(fbi->dev, "crtc_hr    = 0x%08x\n", fbi->regs.lcd_crtc_hr);
-	dev_dbg(fbi->dev, "crtc_hsync = 0x%08x\n", fbi->regs.lcd_crtc_hsync);
-	dev_dbg(fbi->dev, "crtc_vr    = 0x%08x\n", fbi->regs.lcd_crtc_vr);
-
-	writel(fbi->regs.lcd_device_ctrl, regs + REG_LCM_DEV_CTRL);
-	writel(fbi->regs.lcd_crtc_size, regs + REG_LCM_CRTC_SIZE);
-	writel(fbi->regs.lcd_crtc_dend, regs + REG_LCM_CRTC_DEND);
-	writel(fbi->regs.lcd_crtc_hr, regs + REG_LCM_CRTC_HR);
-	writel(fbi->regs.lcd_crtc_hsync, regs + REG_LCM_CRTC_HSYNC);
-	writel(fbi->regs.lcd_crtc_vr, regs + REG_LCM_CRTC_VR);
-
-	/* set lcd address pointers */
-	nuc900fb_set_lcdaddr(info);
-
-	writel(fbi->regs.lcd_dccs, regs + REG_LCM_DCCS);
-}
-
-/*
- *      Alters the hardware state.
- *
- */
-static int nuc900fb_set_par(struct fb_info *info)
-{
-	struct fb_var_screeninfo *var = &info->var;
-
-	switch (var->bits_per_pixel) {
-	case 32:
-	case 24:
-	case 18:
-	case 16:
-	case 12:
-		info->fix.visual = FB_VISUAL_TRUECOLOR;
-		break;
-	case 1:
-		info->fix.visual = FB_VISUAL_MONO01;
-		break;
-	default:
-		info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
-		break;
-	}
-
-	info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8;
-
-	/* activate this new configuration */
-	nuc900fb_activate_var(info);
-	return 0;
-}
-
-static inline unsigned int chan_to_field(unsigned int chan,
-					 struct fb_bitfield *bf)
-{
-	chan &= 0xffff;
-	chan >>= 16 - bf->length;
-	return chan << bf->offset;
-}
-
-static int nuc900fb_setcolreg(unsigned regno,
-			       unsigned red, unsigned green, unsigned blue,
-			       unsigned transp, struct fb_info *info)
-{
-	unsigned int val;
-
-	switch (info->fix.visual) {
-	case FB_VISUAL_TRUECOLOR:
-		/* true-colour, use pseuo-palette */
-		if (regno < 16) {
-			u32 *pal = info->pseudo_palette;
-
-			val  = chan_to_field(red, &info->var.red);
-			val |= chan_to_field(green, &info->var.green);
-			val |= chan_to_field(blue, &info->var.blue);
-			pal[regno] = val;
-		}
-		break;
-
-	default:
-		return 1;   /* unknown type */
-	}
-	return 0;
-}
-
-/**
- *      nuc900fb_blank
- *
- */
-static int nuc900fb_blank(int blank_mode, struct fb_info *info)
-{
-
-	return 0;
-}
-
-static struct fb_ops nuc900fb_ops = {
-	.owner			= THIS_MODULE,
-	.fb_check_var		= nuc900fb_check_var,
-	.fb_set_par		= nuc900fb_set_par,
-	.fb_blank		= nuc900fb_blank,
-	.fb_setcolreg		= nuc900fb_setcolreg,
-	.fb_fillrect		= cfb_fillrect,
-	.fb_copyarea		= cfb_copyarea,
-	.fb_imageblit		= cfb_imageblit,
-};
-
-
-static inline void modify_gpio(void __iomem *reg,
-			       unsigned long set, unsigned long mask)
-{
-	unsigned long tmp;
-	tmp = readl(reg) & ~mask;
-	writel(tmp | set, reg);
-}
-
-/*
- * Initialise LCD-related registers
- */
-static int nuc900fb_init_registers(struct fb_info *info)
-{
-	struct nuc900fb_info *fbi = info->par;
-	struct nuc900fb_mach_info *mach_info = dev_get_platdata(fbi->dev);
-	void __iomem *regs = fbi->io;
-
-	/*reset the display engine*/
-	writel(0, regs + REG_LCM_DCCS);
-	writel(readl(regs + REG_LCM_DCCS) | LCM_DCCS_ENG_RST,
-	       regs + REG_LCM_DCCS);
-	ndelay(100);
-	writel(readl(regs + REG_LCM_DCCS) & (~LCM_DCCS_ENG_RST),
-	       regs + REG_LCM_DCCS);
-	ndelay(100);
-
-	writel(0, regs + REG_LCM_DEV_CTRL);
-
-	/* config gpio output */
-	modify_gpio(W90X900_VA_GPIO + 0x54, mach_info->gpio_dir,
-		    mach_info->gpio_dir_mask);
-	modify_gpio(W90X900_VA_GPIO + 0x58, mach_info->gpio_data,
-		    mach_info->gpio_data_mask);
-
-	return 0;
-}
-
-
-/*
- *    Alloc the SDRAM region of NUC900 for the frame buffer.
- *    The buffer should be a non-cached, non-buffered, memory region
- *    to allow palette and pixel writes without flushing the cache.
- */
-static int nuc900fb_map_video_memory(struct fb_info *info)
-{
-	struct nuc900fb_info *fbi = info->par;
-	dma_addr_t map_dma;
-	unsigned long map_size = PAGE_ALIGN(info->fix.smem_len);
-
-	dev_dbg(fbi->dev, "nuc900fb_map_video_memory(fbi=%p) map_size %lu\n",
-		fbi, map_size);
-
-	info->screen_base = dma_alloc_wc(fbi->dev, map_size, &map_dma,
-					 GFP_KERNEL);
-
-	if (!info->screen_base)
-		return -ENOMEM;
-
-	memset(info->screen_base, 0x00, map_size);
-	info->fix.smem_start = map_dma;
-
-	return 0;
-}
-
-static inline void nuc900fb_unmap_video_memory(struct fb_info *info)
-{
-	struct nuc900fb_info *fbi = info->par;
-	dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
-		    info->screen_base, info->fix.smem_start);
-}
-
-static irqreturn_t nuc900fb_irqhandler(int irq, void *dev_id)
-{
-	struct nuc900fb_info *fbi = dev_id;
-	void __iomem *regs = fbi->io;
-	void __iomem *irq_base = fbi->irq_base;
-	unsigned long lcdirq = readl(regs + REG_LCM_INT_CS);
-
-	if (lcdirq & LCM_INT_CS_DISP_F_STATUS) {
-		writel(readl(irq_base) | 1<<30, irq_base);
-
-		/* wait VA_EN low */
-		if ((readl(regs + REG_LCM_DCCS) &
-		    LCM_DCCS_SINGLE) == LCM_DCCS_SINGLE)
-			while ((readl(regs + REG_LCM_DCCS) &
-			       LCM_DCCS_VA_EN) == LCM_DCCS_VA_EN)
-				;
-		/* display_out-enable */
-		writel(readl(regs + REG_LCM_DCCS) | LCM_DCCS_DISP_OUT_EN,
-			regs + REG_LCM_DCCS);
-		/* va-enable*/
-		writel(readl(regs + REG_LCM_DCCS) | LCM_DCCS_VA_EN,
-			regs + REG_LCM_DCCS);
-	} else if (lcdirq & LCM_INT_CS_UNDERRUN_INT) {
-		writel(readl(irq_base) | LCM_INT_CS_UNDERRUN_INT, irq_base);
-	} else if (lcdirq & LCM_INT_CS_BUS_ERROR_INT) {
-		writel(readl(irq_base) | LCM_INT_CS_BUS_ERROR_INT, irq_base);
-	}
-
-	return IRQ_HANDLED;
-}
-
-#ifdef CONFIG_CPU_FREQ
-
-static int nuc900fb_cpufreq_transition(struct notifier_block *nb,
-				       unsigned long val, void *data)
-{
-	struct nuc900fb_info *info;
-	struct fb_info *fbinfo;
-	long delta_f;
-	info = container_of(nb, struct nuc900fb_info, freq_transition);
-	fbinfo = dev_get_drvdata(info->dev);
-
-	delta_f = info->clk_rate - clk_get_rate(info->clk);
-
-	if ((val == CPUFREQ_POSTCHANGE && delta_f > 0) ||
-	   (val == CPUFREQ_PRECHANGE && delta_f < 0)) {
-		info->clk_rate = clk_get_rate(info->clk);
-		nuc900fb_activate_var(fbinfo);
-	}
-
-	return 0;
-}
-
-static inline int nuc900fb_cpufreq_register(struct nuc900fb_info *fbi)
-{
-	fbi->freq_transition.notifier_call = nuc900fb_cpufreq_transition;
-	return cpufreq_register_notifier(&fbi->freq_transition,
-				  CPUFREQ_TRANSITION_NOTIFIER);
-}
-
-static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *fbi)
-{
-	cpufreq_unregister_notifier(&fbi->freq_transition,
-				    CPUFREQ_TRANSITION_NOTIFIER);
-}
-#else
-static inline int nuc900fb_cpufreq_transition(struct notifier_block *nb,
-				       unsigned long val, void *data)
-{
-	return 0;
-}
-
-static inline int nuc900fb_cpufreq_register(struct nuc900fb_info *fbi)
-{
-	return 0;
-}
-
-static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *info)
-{
-}
-#endif
-
-static char driver_name[] = "nuc900fb";
-
-static int nuc900fb_probe(struct platform_device *pdev)
-{
-	struct nuc900fb_info *fbi;
-	struct nuc900fb_display *display;
-	struct fb_info	   *fbinfo;
-	struct nuc900fb_mach_info *mach_info;
-	struct resource *res;
-	int ret;
-	int irq;
-	int i;
-	int size;
-
-	dev_dbg(&pdev->dev, "devinit\n");
-	mach_info = dev_get_platdata(&pdev->dev);
-	if (mach_info == NULL) {
-		dev_err(&pdev->dev,
-			"no platform data for lcd, cannot attach\n");
-		return -EINVAL;
-	}
-
-	if (mach_info->default_display > mach_info->num_displays) {
-		dev_err(&pdev->dev,
-			"default display No. is %d but only %d displays \n",
-			mach_info->default_display, mach_info->num_displays);
-		return -EINVAL;
-	}
-
-
-	display = mach_info->displays + mach_info->default_display;
-
-	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "no irq for device\n");
-		return -ENOENT;
-	}
-
-	fbinfo = framebuffer_alloc(sizeof(struct nuc900fb_info), &pdev->dev);
-	if (!fbinfo)
-		return -ENOMEM;
-
-	platform_set_drvdata(pdev, fbinfo);
-
-	fbi = fbinfo->par;
-	fbi->dev = &pdev->dev;
-
-#ifdef CONFIG_CPU_NUC950
-	fbi->drv_type = LCDDRV_NUC950;
-#endif
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	size = resource_size(res);
-	fbi->mem = request_mem_region(res->start, size, pdev->name);
-	if (fbi->mem == NULL) {
-		dev_err(&pdev->dev, "failed to alloc memory region\n");
-		ret = -ENOENT;
-		goto free_fb;
-	}
-
-	fbi->io = ioremap(res->start, size);
-	if (fbi->io == NULL) {
-		dev_err(&pdev->dev, "ioremap() of lcd registers failed\n");
-		ret = -ENXIO;
-		goto release_mem_region;
-	}
-
-	fbi->irq_base = fbi->io + REG_LCM_INT_CS;
-
-
-	/* Stop the LCD */
-	writel(0, fbi->io + REG_LCM_DCCS);
-
-	/* fill the fbinfo*/
-	strcpy(fbinfo->fix.id, driver_name);
-	fbinfo->fix.type		= FB_TYPE_PACKED_PIXELS;
-	fbinfo->fix.type_aux		= 0;
-	fbinfo->fix.xpanstep		= 0;
-	fbinfo->fix.ypanstep		= 0;
-	fbinfo->fix.ywrapstep		= 0;
-	fbinfo->fix.accel		= FB_ACCEL_NONE;
-	fbinfo->var.nonstd		= 0;
-	fbinfo->var.activate		= FB_ACTIVATE_NOW;
-	fbinfo->var.accel_flags		= 0;
-	fbinfo->var.vmode		= FB_VMODE_NONINTERLACED;
-	fbinfo->fbops			= &nuc900fb_ops;
-	fbinfo->flags			= FBINFO_FLAG_DEFAULT;
-	fbinfo->pseudo_palette		= &fbi->pseudo_pal;
-
-	ret = request_irq(irq, nuc900fb_irqhandler, 0, pdev->name, fbi);
-	if (ret) {
-		dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n",
-			irq, ret);
-		ret = -EBUSY;
-		goto release_regs;
-	}
-
-	fbi->clk = clk_get(&pdev->dev, NULL);
-	if (IS_ERR(fbi->clk)) {
-		printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n");
-		ret = PTR_ERR(fbi->clk);
-		goto release_irq;
-	}
-
-	clk_enable(fbi->clk);
-	dev_dbg(&pdev->dev, "got and enabled clock\n");
-
-	fbi->clk_rate = clk_get_rate(fbi->clk);
-
-	/* calutate the video buffer size */
-	for (i = 0; i < mach_info->num_displays; i++) {
-		unsigned long smem_len = mach_info->displays[i].xres;
-		smem_len *= mach_info->displays[i].yres;
-		smem_len *= mach_info->displays[i].bpp;
-		smem_len >>= 3;
-		if (fbinfo->fix.smem_len < smem_len)
-			fbinfo->fix.smem_len = smem_len;
-	}
-
-	/* Initialize Video Memory */
-	ret = nuc900fb_map_video_memory(fbinfo);
-	if (ret) {
-		printk(KERN_ERR "Failed to allocate video RAM: %x\n", ret);
-		goto release_clock;
-	}
-
-	dev_dbg(&pdev->dev, "got video memory\n");
-
-	fbinfo->var.xres = display->xres;
-	fbinfo->var.yres = display->yres;
-	fbinfo->var.bits_per_pixel = display->bpp;
-
-	nuc900fb_init_registers(fbinfo);
-
-	nuc900fb_check_var(&fbinfo->var, fbinfo);
-
-	ret = nuc900fb_cpufreq_register(fbi);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "Failed to register cpufreq\n");
-		goto free_video_memory;
-	}
-
-	ret = register_framebuffer(fbinfo);
-	if (ret) {
-		printk(KERN_ERR "failed to register framebuffer device: %d\n",
-			ret);
-		goto free_cpufreq;
-	}
-
-	fb_info(fbinfo, "%s frame buffer device\n", fbinfo->fix.id);
-
-	return 0;
-
-free_cpufreq:
-	nuc900fb_cpufreq_deregister(fbi);
-free_video_memory:
-	nuc900fb_unmap_video_memory(fbinfo);
-release_clock:
-	clk_disable(fbi->clk);
-	clk_put(fbi->clk);
-release_irq:
-	free_irq(irq, fbi);
-release_regs:
-	iounmap(fbi->io);
-release_mem_region:
-	release_mem_region(res->start, size);
-free_fb:
-	framebuffer_release(fbinfo);
-	return ret;
-}
-
-/*
- * shutdown the lcd controller
- */
-static void nuc900fb_stop_lcd(struct fb_info *info)
-{
-	struct nuc900fb_info *fbi = info->par;
-	void __iomem *regs = fbi->io;
-
-	writel((~LCM_DCCS_DISP_INT_EN) | (~LCM_DCCS_VA_EN) | (~LCM_DCCS_OSD_EN),
-		regs + REG_LCM_DCCS);
-}
-
-/*
- *  Cleanup
- */
-static int nuc900fb_remove(struct platform_device *pdev)
-{
-	struct fb_info *fbinfo = platform_get_drvdata(pdev);
-	struct nuc900fb_info *fbi = fbinfo->par;
-	int irq;
-
-	nuc900fb_stop_lcd(fbinfo);
-	msleep(1);
-
-	unregister_framebuffer(fbinfo);
-	nuc900fb_cpufreq_deregister(fbi);
-	nuc900fb_unmap_video_memory(fbinfo);
-
-	iounmap(fbi->io);
-
-	irq = platform_get_irq(pdev, 0);
-	free_irq(irq, fbi);
-
-	release_resource(fbi->mem);
-	kfree(fbi->mem);
-
-	framebuffer_release(fbinfo);
-
-	return 0;
-}
-
-#ifdef CONFIG_PM
-
-/*
- *	suspend and resume support for the lcd controller
- */
-
-static int nuc900fb_suspend(struct platform_device *dev, pm_message_t state)
-{
-	struct fb_info	   *fbinfo = platform_get_drvdata(dev);
-	struct nuc900fb_info *info = fbinfo->par;
-
-	nuc900fb_stop_lcd(fbinfo);
-	msleep(1);
-	clk_disable(info->clk);
-	return 0;
-}
-
-static int nuc900fb_resume(struct platform_device *dev)
-{
-	struct fb_info	   *fbinfo = platform_get_drvdata(dev);
-	struct nuc900fb_info *fbi = fbinfo->par;
-
-	printk(KERN_INFO "nuc900fb resume\n");
-
-	clk_enable(fbi->clk);
-	msleep(1);
-
-	nuc900fb_init_registers(fbinfo);
-	nuc900fb_activate_var(fbinfo);
-
-	return 0;
-}
-
-#else
-#define nuc900fb_suspend NULL
-#define nuc900fb_resume  NULL
-#endif
-
-static struct platform_driver nuc900fb_driver = {
-	.probe		= nuc900fb_probe,
-	.remove		= nuc900fb_remove,
-	.suspend	= nuc900fb_suspend,
-	.resume		= nuc900fb_resume,
-	.driver		= {
-		.name	= "nuc900-lcd",
-	},
-};
-
-module_platform_driver(nuc900fb_driver);
-
-MODULE_DESCRIPTION("Framebuffer driver for the NUC900");
-MODULE_LICENSE("GPL");
diff --git a/drivers/video/fbdev/nuc900fb.h b/drivers/video/fbdev/nuc900fb.h
deleted file mode 100644
index 055ae9297931..000000000000
--- a/drivers/video/fbdev/nuc900fb.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- *
- * Copyright (c) 2009 Nuvoton technology corporation
- * All rights reserved.
- *
- *   Author:
- *        Wang Qiang(rurality.linux@gmail.com)  2009/12/16
- */
-
-#ifndef __NUC900FB_H
-#define __NUC900FB_H
-
-#include <mach/map.h>
-#include <linux/platform_data/video-nuc900fb.h>
-
-enum nuc900_lcddrv_type {
-	LCDDRV_NUC910,
-	LCDDRV_NUC930,
-	LCDDRV_NUC932,
-	LCDDRV_NUC950,
-	LCDDRV_NUC960,
-};
-
-
-#define PALETTE_BUFFER_SIZE	256
-#define PALETTE_BUFF_CLEAR 	(0x80000000) /* entry is clear/invalid */
-
-struct nuc900fb_info {
-	struct device		*dev;
-	struct clk		*clk;
-
-	struct resource		*mem;
-	void __iomem		*io;
-	void __iomem		*irq_base;
-	int 			drv_type;
-	struct nuc900fb_hw	regs;
-	unsigned long		clk_rate;
-
-#ifdef CONFIG_CPU_FREQ
-	struct notifier_block	freq_transition;
-#endif
-
-	/* keep these registers in case we need to re-write palette */
-	u32			palette_buffer[PALETTE_BUFFER_SIZE];
-	u32			pseudo_pal[16];
-};
-
-int nuc900fb_init(void);
-
-#endif /* __NUC900FB_H */
diff --git a/include/Kbuild b/include/Kbuild
index 5e0642d79dce..4d5a03a81fb5 100644
--- a/include/Kbuild
+++ b/include/Kbuild
@@ -568,7 +568,6 @@ header-test-			+= linux/platform_data/usb3503.h
 header-test-			+= linux/platform_data/ux500_wdt.h
 header-test-			+= linux/platform_data/video-clcd-versatile.h
 header-test-			+= linux/platform_data/video-imxfb.h
-header-test-			+= linux/platform_data/video-nuc900fb.h
 header-test-			+= linux/platform_data/video-pxafb.h
 header-test-			+= linux/platform_data/video_s3c.h
 header-test-			+= linux/platform_data/voltage-omap.h
diff --git a/include/linux/platform_data/video-nuc900fb.h b/include/linux/platform_data/video-nuc900fb.h
deleted file mode 100644
index 3da504460c91..000000000000
--- a/include/linux/platform_data/video-nuc900fb.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/* linux/include/asm/arch-nuc900/fb.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Changelog:
- *
- *   2008/08/26     vincen.zswan modify this file for LCD.
- */
-
-#ifndef __ASM_ARM_FB_H
-#define __ASM_ARM_FB_H
-
-
-
-/* LCD Controller Hardware Desc */
-struct nuc900fb_hw {
-	unsigned int lcd_dccs;
-	unsigned int lcd_device_ctrl;
-	unsigned int lcd_mpulcd_cmd;
-	unsigned int lcd_int_cs;
-	unsigned int lcd_crtc_size;
-	unsigned int lcd_crtc_dend;
-	unsigned int lcd_crtc_hr;
-	unsigned int lcd_crtc_hsync;
-	unsigned int lcd_crtc_vr;
-	unsigned int lcd_va_baddr0;
-	unsigned int lcd_va_baddr1;
-	unsigned int lcd_va_fbctrl;
-	unsigned int lcd_va_scale;
-	unsigned int lcd_va_test;
-	unsigned int lcd_va_win;
-	unsigned int lcd_va_stuff;
-};
-
-/* LCD Display Description */
-struct nuc900fb_display {
-	/* LCD Image type */
-	unsigned type;
-
-	/* LCD Screen Size */
-	unsigned short width;
-	unsigned short height;
-
-	/* LCD Screen Info */
-	unsigned short xres;
-	unsigned short yres;
-	unsigned short bpp;
-
-	unsigned long pixclock;
-	unsigned short left_margin;
-	unsigned short right_margin;
-	unsigned short hsync_len;
-	unsigned short upper_margin;
-	unsigned short lower_margin;
-	unsigned short vsync_len;
-
-	/* hardware special register value */
-	unsigned int dccs;
-	unsigned int devctl;
-	unsigned int fbctrl;
-	unsigned int scale;
-};
-
-struct nuc900fb_mach_info {
-	struct nuc900fb_display *displays;
-	unsigned num_displays;
-	unsigned default_display;
-	/* GPIO Setting  Info */
-	unsigned gpio_dir;
-	unsigned gpio_dir_mask;
-	unsigned gpio_data;
-	unsigned gpio_data_mask;
-};
-
-extern void __init nuc900_fb_set_platdata(struct nuc900fb_mach_info *);
-
-#endif /* __ASM_ARM_FB_H */
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 10/16] Input: remove w90x900 keyboard driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (8 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 09/16] fbdev: remove w90x900/nuc900 platform drivers Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 21:56   ` Dmitry Torokhov
  2019-08-09 20:27 ` [PATCH 11/16] Input: remove w90x900 touchscreen driver Arnd Bergmann
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc; +Cc: Arnd Bergmann, Dmitry Torokhov, linux-kernel, linux-input

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/input/keyboard/Kconfig               |  11 -
 drivers/input/keyboard/Makefile              |   1 -
 drivers/input/keyboard/w90p910_keypad.c      | 264 -------------------
 include/linux/platform_data/keypad-w90p910.h |  16 --
 4 files changed, 292 deletions(-)
 delete mode 100644 drivers/input/keyboard/w90p910_keypad.c
 delete mode 100644 include/linux/platform_data/keypad-w90p910.h

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 8e9c3ea9d5e7..c1da129a4eb5 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -731,17 +731,6 @@ config KEYBOARD_XTKBD
 	  To compile this driver as a module, choose M here: the
 	  module will be called xtkbd.
 
-config KEYBOARD_W90P910
-	tristate "W90P910 Matrix Keypad support"
-	depends on ARCH_W90X900
-	select INPUT_MATRIXKMAP
-	help
-	  Say Y here to enable the matrix keypad on evaluation board
-	  based on W90P910.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called w90p910_keypad.
-
 config KEYBOARD_CROS_EC
 	tristate "ChromeOS EC keyboard"
 	select INPUT_MATRIXKMAP
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 06a0af6efeae..9510325c0c5d 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -68,4 +68,3 @@ obj-$(CONFIG_KEYBOARD_TEGRA)		+= tegra-kbc.o
 obj-$(CONFIG_KEYBOARD_TM2_TOUCHKEY)	+= tm2-touchkey.o
 obj-$(CONFIG_KEYBOARD_TWL4030)		+= twl4030_keypad.o
 obj-$(CONFIG_KEYBOARD_XTKBD)		+= xtkbd.o
-obj-$(CONFIG_KEYBOARD_W90P910)		+= w90p910_keypad.o
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c
deleted file mode 100644
index c88d05d6108a..000000000000
--- a/drivers/input/keyboard/w90p910_keypad.c
+++ /dev/null
@@ -1,264 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2008-2009 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-
-#include <linux/platform_data/keypad-w90p910.h>
-
-/* Keypad Interface Control Registers */
-#define KPI_CONF		0x00
-#define KPI_3KCONF		0x04
-#define KPI_LPCONF		0x08
-#define KPI_STATUS		0x0C
-
-#define IS1KEY			(0x01 << 16)
-#define INTTR			(0x01 << 21)
-#define KEY0R			(0x0f << 3)
-#define KEY0C			0x07
-#define DEBOUNCE_BIT		0x08
-#define KSIZE0			(0x01 << 16)
-#define KSIZE1			(0x01 << 17)
-#define KPSEL			(0x01 << 19)
-#define ENKP			(0x01 << 18)
-
-#define KGET_RAW(n)		(((n) & KEY0R) >> 3)
-#define KGET_COLUMN(n)		((n) & KEY0C)
-
-#define W90P910_NUM_ROWS	8
-#define W90P910_NUM_COLS	8
-#define W90P910_ROW_SHIFT	3
-
-struct w90p910_keypad {
-	const struct w90p910_keypad_platform_data *pdata;
-	struct clk *clk;
-	struct input_dev *input_dev;
-	void __iomem *mmio_base;
-	int irq;
-	unsigned short keymap[W90P910_NUM_ROWS * W90P910_NUM_COLS];
-};
-
-static void w90p910_keypad_scan_matrix(struct w90p910_keypad *keypad,
-							unsigned int status)
-{
-	struct input_dev *input_dev = keypad->input_dev;
-	unsigned int row = KGET_RAW(status);
-	unsigned int col = KGET_COLUMN(status);
-	unsigned int code = MATRIX_SCAN_CODE(row, col, W90P910_ROW_SHIFT);
-	unsigned int key = keypad->keymap[code];
-
-	input_event(input_dev, EV_MSC, MSC_SCAN, code);
-	input_report_key(input_dev, key, 1);
-	input_sync(input_dev);
-
-	input_event(input_dev, EV_MSC, MSC_SCAN, code);
-	input_report_key(input_dev, key, 0);
-	input_sync(input_dev);
-}
-
-static irqreturn_t w90p910_keypad_irq_handler(int irq, void *dev_id)
-{
-	struct w90p910_keypad *keypad = dev_id;
-	unsigned int  kstatus, val;
-
-	kstatus = __raw_readl(keypad->mmio_base + KPI_STATUS);
-
-	val = INTTR | IS1KEY;
-
-	if (kstatus & val)
-		w90p910_keypad_scan_matrix(keypad, kstatus);
-
-	return IRQ_HANDLED;
-}
-
-static int w90p910_keypad_open(struct input_dev *dev)
-{
-	struct w90p910_keypad *keypad = input_get_drvdata(dev);
-	const struct w90p910_keypad_platform_data *pdata = keypad->pdata;
-	unsigned int val, config;
-
-	/* Enable unit clock */
-	clk_enable(keypad->clk);
-
-	val = __raw_readl(keypad->mmio_base + KPI_CONF);
-	val |= (KPSEL | ENKP);
-	val &= ~(KSIZE0 | KSIZE1);
-
-	config = pdata->prescale | (pdata->debounce << DEBOUNCE_BIT);
-
-	val |= config;
-
-	__raw_writel(val, keypad->mmio_base + KPI_CONF);
-
-	return 0;
-}
-
-static void w90p910_keypad_close(struct input_dev *dev)
-{
-	struct w90p910_keypad *keypad = input_get_drvdata(dev);
-
-	/* Disable clock unit */
-	clk_disable(keypad->clk);
-}
-
-static int w90p910_keypad_probe(struct platform_device *pdev)
-{
-	const struct w90p910_keypad_platform_data *pdata =
-						dev_get_platdata(&pdev->dev);
-	const struct matrix_keymap_data *keymap_data;
-	struct w90p910_keypad *keypad;
-	struct input_dev *input_dev;
-	struct resource *res;
-	int irq;
-	int error;
-
-	if (!pdata) {
-		dev_err(&pdev->dev, "no platform data defined\n");
-		return -EINVAL;
-	}
-
-	keymap_data = pdata->keymap_data;
-
-	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(&pdev->dev, "failed to get keypad irq\n");
-		return -ENXIO;
-	}
-
-	keypad = kzalloc(sizeof(struct w90p910_keypad), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!keypad || !input_dev) {
-		dev_err(&pdev->dev, "failed to allocate driver data\n");
-		error = -ENOMEM;
-		goto failed_free;
-	}
-
-	keypad->pdata = pdata;
-	keypad->input_dev = input_dev;
-	keypad->irq = irq;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res == NULL) {
-		dev_err(&pdev->dev, "failed to get I/O memory\n");
-		error = -ENXIO;
-		goto failed_free;
-	}
-
-	res = request_mem_region(res->start, resource_size(res), pdev->name);
-	if (res == NULL) {
-		dev_err(&pdev->dev, "failed to request I/O memory\n");
-		error = -EBUSY;
-		goto failed_free;
-	}
-
-	keypad->mmio_base = ioremap(res->start, resource_size(res));
-	if (keypad->mmio_base == NULL) {
-		dev_err(&pdev->dev, "failed to remap I/O memory\n");
-		error = -ENXIO;
-		goto failed_free_res;
-	}
-
-	keypad->clk = clk_get(&pdev->dev, NULL);
-	if (IS_ERR(keypad->clk)) {
-		dev_err(&pdev->dev, "failed to get keypad clock\n");
-		error = PTR_ERR(keypad->clk);
-		goto failed_free_io;
-	}
-
-	/* set multi-function pin for w90p910 kpi. */
-	mfp_set_groupi(&pdev->dev);
-
-	input_dev->name = pdev->name;
-	input_dev->id.bustype = BUS_HOST;
-	input_dev->open = w90p910_keypad_open;
-	input_dev->close = w90p910_keypad_close;
-	input_dev->dev.parent = &pdev->dev;
-
-	error = matrix_keypad_build_keymap(keymap_data, NULL,
-					   W90P910_NUM_ROWS, W90P910_NUM_COLS,
-					   keypad->keymap, input_dev);
-	if (error) {
-		dev_err(&pdev->dev, "failed to build keymap\n");
-		goto failed_put_clk;
-	}
-
-	error = request_irq(keypad->irq, w90p910_keypad_irq_handler,
-			    0, pdev->name, keypad);
-	if (error) {
-		dev_err(&pdev->dev, "failed to request IRQ\n");
-		goto failed_put_clk;
-	}
-
-	__set_bit(EV_REP, input_dev->evbit);
-	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
-	input_set_drvdata(input_dev, keypad);
-
-	/* Register the input device */
-	error = input_register_device(input_dev);
-	if (error) {
-		dev_err(&pdev->dev, "failed to register input device\n");
-		goto failed_free_irq;
-	}
-
-	platform_set_drvdata(pdev, keypad);
-	return 0;
-
-failed_free_irq:
-	free_irq(irq, keypad);
-failed_put_clk:
-	clk_put(keypad->clk);
-failed_free_io:
-	iounmap(keypad->mmio_base);
-failed_free_res:
-	release_mem_region(res->start, resource_size(res));
-failed_free:
-	input_free_device(input_dev);
-	kfree(keypad);
-	return error;
-}
-
-static int w90p910_keypad_remove(struct platform_device *pdev)
-{
-	struct w90p910_keypad *keypad = platform_get_drvdata(pdev);
-	struct resource *res;
-
-	free_irq(keypad->irq, keypad);
-
-	clk_put(keypad->clk);
-
-	input_unregister_device(keypad->input_dev);
-
-	iounmap(keypad->mmio_base);
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	release_mem_region(res->start, resource_size(res));
-
-	kfree(keypad);
-
-	return 0;
-}
-
-static struct platform_driver w90p910_keypad_driver = {
-	.probe		= w90p910_keypad_probe,
-	.remove		= w90p910_keypad_remove,
-	.driver		= {
-		.name	= "nuc900-kpi",
-	},
-};
-module_platform_driver(w90p910_keypad_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("w90p910 keypad driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-keypad");
diff --git a/include/linux/platform_data/keypad-w90p910.h b/include/linux/platform_data/keypad-w90p910.h
deleted file mode 100644
index 206ca4ecd93f..000000000000
--- a/include/linux/platform_data/keypad-w90p910.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __ASM_ARCH_W90P910_KEYPAD_H
-#define __ASM_ARCH_W90P910_KEYPAD_H
-
-#include <linux/input/matrix_keypad.h>
-
-extern void mfp_set_groupi(struct device *dev);
-
-struct w90p910_keypad_platform_data {
-	const struct matrix_keymap_data *keymap_data;
-
-	unsigned int	prescale;
-	unsigned int	debounce;
-};
-
-#endif /* __ASM_ARCH_W90P910_KEYPAD_H */
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 11/16] Input: remove w90x900 touchscreen driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (9 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 10/16] Input: remove w90x900 keyboard driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 21:56   ` Dmitry Torokhov
  2019-08-09 20:27 ` [PATCH 12/16] mtd: rawnand: remove w90x900 driver Arnd Bergmann
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc; +Cc: Arnd Bergmann, Dmitry Torokhov, linux-kernel, linux-input

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/input/touchscreen/Kconfig      |   9 -
 drivers/input/touchscreen/Makefile     |   1 -
 drivers/input/touchscreen/w90p910_ts.c | 331 -------------------------
 3 files changed, 341 deletions(-)
 delete mode 100644 drivers/input/touchscreen/w90p910_ts.c

diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index fb91f2d4049e..46ad9090493b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -1112,15 +1112,6 @@ config TOUCHSCREEN_TSC2007_IIO
 	  or ambient light monitoring), temperature and raw input
 	  values.
 
-config TOUCHSCREEN_W90X900
-	tristate "W90P910 touchscreen driver"
-	depends on ARCH_W90X900
-	help
-	  Say Y here if you have a W90P910 based touchscreen.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called w90p910_ts.
-
 config TOUCHSCREEN_PCAP
 	tristate "Motorola PCAP touchscreen"
 	depends on EZX_PCAP
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 084a596a0c8b..94c6162409b3 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -102,7 +102,6 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712)	+= wm9712.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713)	+= wm9713.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)	+= mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)	+= zylonite-wm97xx.o
-obj-$(CONFIG_TOUCHSCREEN_W90X900)	+= w90p910_ts.o
 obj-$(CONFIG_TOUCHSCREEN_SX8654)	+= sx8654.o
 obj-$(CONFIG_TOUCHSCREEN_TPS6507X)	+= tps6507x-ts.o
 obj-$(CONFIG_TOUCHSCREEN_ZET6223)	+= zet6223.o
diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c
deleted file mode 100644
index 7893d7fa398c..000000000000
--- a/drivers/input/touchscreen/w90p910_ts.c
+++ /dev/null
@@ -1,331 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/delay.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/input.h>
-#include <linux/interrupt.h>
-#include <linux/slab.h>
-
-/* ADC controller bit defines */
-#define ADC_DELAY	0xf00
-#define ADC_DOWN	0x01
-#define ADC_TSC_Y	(0x01 << 8)
-#define ADC_TSC_X	(0x00 << 8)
-#define TSC_FOURWIRE	(~(0x03 << 1))
-#define ADC_CLK_EN	(0x01 << 28)	/* ADC clock enable */
-#define ADC_READ_CON	(0x01 << 12)
-#define ADC_CONV	(0x01 << 13)
-#define ADC_SEMIAUTO	(0x01 << 14)
-#define ADC_WAITTRIG	(0x03 << 14)
-#define ADC_RST1	(0x01 << 16)
-#define ADC_RST0	(0x00 << 16)
-#define ADC_EN		(0x01 << 17)
-#define ADC_INT		(0x01 << 18)
-#define WT_INT		(0x01 << 20)
-#define ADC_INT_EN	(0x01 << 21)
-#define LVD_INT_EN	(0x01 << 22)
-#define WT_INT_EN	(0x01 << 23)
-#define ADC_DIV		(0x04 << 1)	/* div = 6 */
-
-enum ts_state {
-	TS_WAIT_NEW_PACKET,	/* We are waiting next touch report */
-	TS_WAIT_X_COORD,	/* We are waiting for ADC to report X coord */
-	TS_WAIT_Y_COORD,	/* We are waiting for ADC to report Y coord */
-	TS_IDLE,		/* Input device is closed, don't do anything */
-};
-
-struct w90p910_ts {
-	struct input_dev *input;
-	struct timer_list timer;
-	struct clk *clk;
-	int irq_num;
-	void __iomem *ts_reg;
-	spinlock_t lock;
-	enum ts_state state;
-};
-
-static void w90p910_report_event(struct w90p910_ts *w90p910_ts, bool down)
-{
-	struct input_dev *dev = w90p910_ts->input;
-
-	if (down) {
-		input_report_abs(dev, ABS_X,
-				 __raw_readl(w90p910_ts->ts_reg + 0x0c));
-		input_report_abs(dev, ABS_Y,
-				 __raw_readl(w90p910_ts->ts_reg + 0x10));
-	}
-
-	input_report_key(dev, BTN_TOUCH, down);
-	input_sync(dev);
-}
-
-static void w90p910_prepare_x_reading(struct w90p910_ts *w90p910_ts)
-{
-	unsigned long ctlreg;
-
-	__raw_writel(ADC_TSC_X, w90p910_ts->ts_reg + 0x04);
-	ctlreg = __raw_readl(w90p910_ts->ts_reg);
-	ctlreg &= ~(ADC_WAITTRIG | WT_INT | WT_INT_EN);
-	ctlreg |= ADC_SEMIAUTO | ADC_INT_EN | ADC_CONV;
-	__raw_writel(ctlreg, w90p910_ts->ts_reg);
-
-	w90p910_ts->state = TS_WAIT_X_COORD;
-}
-
-static void w90p910_prepare_y_reading(struct w90p910_ts *w90p910_ts)
-{
-	unsigned long ctlreg;
-
-	__raw_writel(ADC_TSC_Y, w90p910_ts->ts_reg + 0x04);
-	ctlreg = __raw_readl(w90p910_ts->ts_reg);
-	ctlreg &= ~(ADC_WAITTRIG | ADC_INT | WT_INT_EN);
-	ctlreg |= ADC_SEMIAUTO | ADC_INT_EN | ADC_CONV;
-	__raw_writel(ctlreg, w90p910_ts->ts_reg);
-
-	w90p910_ts->state = TS_WAIT_Y_COORD;
-}
-
-static void w90p910_prepare_next_packet(struct w90p910_ts *w90p910_ts)
-{
-	unsigned long ctlreg;
-
-	ctlreg = __raw_readl(w90p910_ts->ts_reg);
-	ctlreg &= ~(ADC_INT | ADC_INT_EN | ADC_SEMIAUTO | ADC_CONV);
-	ctlreg |= ADC_WAITTRIG | WT_INT_EN;
-	__raw_writel(ctlreg, w90p910_ts->ts_reg);
-
-	w90p910_ts->state = TS_WAIT_NEW_PACKET;
-}
-
-static irqreturn_t w90p910_ts_interrupt(int irq, void *dev_id)
-{
-	struct w90p910_ts *w90p910_ts = dev_id;
-	unsigned long flags;
-
-	spin_lock_irqsave(&w90p910_ts->lock, flags);
-
-	switch (w90p910_ts->state) {
-	case TS_WAIT_NEW_PACKET:
-		/*
-		 * The controller only generates interrupts when pen
-		 * is down.
-		 */
-		del_timer(&w90p910_ts->timer);
-		w90p910_prepare_x_reading(w90p910_ts);
-		break;
-
-
-	case TS_WAIT_X_COORD:
-		w90p910_prepare_y_reading(w90p910_ts);
-		break;
-
-	case TS_WAIT_Y_COORD:
-		w90p910_report_event(w90p910_ts, true);
-		w90p910_prepare_next_packet(w90p910_ts);
-		mod_timer(&w90p910_ts->timer, jiffies + msecs_to_jiffies(100));
-		break;
-
-	case TS_IDLE:
-		break;
-	}
-
-	spin_unlock_irqrestore(&w90p910_ts->lock, flags);
-
-	return IRQ_HANDLED;
-}
-
-static void w90p910_check_pen_up(struct timer_list *t)
-{
-	struct w90p910_ts *w90p910_ts = from_timer(w90p910_ts, t, timer);
-	unsigned long flags;
-
-	spin_lock_irqsave(&w90p910_ts->lock, flags);
-
-	if (w90p910_ts->state == TS_WAIT_NEW_PACKET &&
-	    !(__raw_readl(w90p910_ts->ts_reg + 0x04) & ADC_DOWN)) {
-
-		w90p910_report_event(w90p910_ts, false);
-	}
-
-	spin_unlock_irqrestore(&w90p910_ts->lock, flags);
-}
-
-static int w90p910_open(struct input_dev *dev)
-{
-	struct w90p910_ts *w90p910_ts = input_get_drvdata(dev);
-	unsigned long val;
-
-	/* enable the ADC clock */
-	clk_enable(w90p910_ts->clk);
-
-	__raw_writel(ADC_RST1, w90p910_ts->ts_reg);
-	msleep(1);
-	__raw_writel(ADC_RST0, w90p910_ts->ts_reg);
-	msleep(1);
-
-	/* set delay and screen type */
-	val = __raw_readl(w90p910_ts->ts_reg + 0x04);
-	__raw_writel(val & TSC_FOURWIRE, w90p910_ts->ts_reg + 0x04);
-	__raw_writel(ADC_DELAY, w90p910_ts->ts_reg + 0x08);
-
-	w90p910_ts->state = TS_WAIT_NEW_PACKET;
-	wmb();
-
-	/* set trigger mode */
-	val = __raw_readl(w90p910_ts->ts_reg);
-	val |= ADC_WAITTRIG | ADC_DIV | ADC_EN | WT_INT_EN;
-	__raw_writel(val, w90p910_ts->ts_reg);
-
-	return 0;
-}
-
-static void w90p910_close(struct input_dev *dev)
-{
-	struct w90p910_ts *w90p910_ts = input_get_drvdata(dev);
-	unsigned long val;
-
-	/* disable trigger mode */
-
-	spin_lock_irq(&w90p910_ts->lock);
-
-	w90p910_ts->state = TS_IDLE;
-
-	val = __raw_readl(w90p910_ts->ts_reg);
-	val &= ~(ADC_WAITTRIG | ADC_DIV | ADC_EN | WT_INT_EN | ADC_INT_EN);
-	__raw_writel(val, w90p910_ts->ts_reg);
-
-	spin_unlock_irq(&w90p910_ts->lock);
-
-	/* Now that interrupts are shut off we can safely delete timer */
-	del_timer_sync(&w90p910_ts->timer);
-
-	/* stop the ADC clock */
-	clk_disable(w90p910_ts->clk);
-}
-
-static int w90x900ts_probe(struct platform_device *pdev)
-{
-	struct w90p910_ts *w90p910_ts;
-	struct input_dev *input_dev;
-	struct resource *res;
-	int err;
-
-	w90p910_ts = kzalloc(sizeof(struct w90p910_ts), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!w90p910_ts || !input_dev) {
-		err = -ENOMEM;
-		goto fail1;
-	}
-
-	w90p910_ts->input = input_dev;
-	w90p910_ts->state = TS_IDLE;
-	spin_lock_init(&w90p910_ts->lock);
-	timer_setup(&w90p910_ts->timer, w90p910_check_pen_up, 0);
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		err = -ENXIO;
-		goto fail1;
-	}
-
-	if (!request_mem_region(res->start, resource_size(res),
-				pdev->name)) {
-		err = -EBUSY;
-		goto fail1;
-	}
-
-	w90p910_ts->ts_reg = ioremap(res->start, resource_size(res));
-	if (!w90p910_ts->ts_reg) {
-		err = -ENOMEM;
-		goto fail2;
-	}
-
-	w90p910_ts->clk = clk_get(&pdev->dev, NULL);
-	if (IS_ERR(w90p910_ts->clk)) {
-		err = PTR_ERR(w90p910_ts->clk);
-		goto fail3;
-	}
-
-	input_dev->name = "W90P910 TouchScreen";
-	input_dev->phys = "w90p910ts/event0";
-	input_dev->id.bustype = BUS_HOST;
-	input_dev->id.vendor  = 0x0005;
-	input_dev->id.product = 0x0001;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &pdev->dev;
-	input_dev->open = w90p910_open;
-	input_dev->close = w90p910_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-	input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
-
-	input_set_abs_params(input_dev, ABS_X, 0, 0x400, 0, 0);
-	input_set_abs_params(input_dev, ABS_Y, 0, 0x400, 0, 0);
-
-	input_set_drvdata(input_dev, w90p910_ts);
-
-	w90p910_ts->irq_num = platform_get_irq(pdev, 0);
-	if (request_irq(w90p910_ts->irq_num, w90p910_ts_interrupt,
-			0, "w90p910ts", w90p910_ts)) {
-		err = -EBUSY;
-		goto fail4;
-	}
-
-	err = input_register_device(w90p910_ts->input);
-	if (err)
-		goto fail5;
-
-	platform_set_drvdata(pdev, w90p910_ts);
-
-	return 0;
-
-fail5:	free_irq(w90p910_ts->irq_num, w90p910_ts);
-fail4:	clk_put(w90p910_ts->clk);
-fail3:	iounmap(w90p910_ts->ts_reg);
-fail2:	release_mem_region(res->start, resource_size(res));
-fail1:	input_free_device(input_dev);
-	kfree(w90p910_ts);
-	return err;
-}
-
-static int w90x900ts_remove(struct platform_device *pdev)
-{
-	struct w90p910_ts *w90p910_ts = platform_get_drvdata(pdev);
-	struct resource *res;
-
-	free_irq(w90p910_ts->irq_num, w90p910_ts);
-	del_timer_sync(&w90p910_ts->timer);
-	iounmap(w90p910_ts->ts_reg);
-
-	clk_put(w90p910_ts->clk);
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	release_mem_region(res->start, resource_size(res));
-
-	input_unregister_device(w90p910_ts->input);
-	kfree(w90p910_ts);
-
-	return 0;
-}
-
-static struct platform_driver w90x900ts_driver = {
-	.probe		= w90x900ts_probe,
-	.remove		= w90x900ts_remove,
-	.driver		= {
-		.name	= "nuc900-ts",
-	},
-};
-module_platform_driver(w90x900ts_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("w90p910 touch screen driver!");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-ts");
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 12/16] mtd: rawnand: remove w90x900 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (10 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 11/16] Input: remove w90x900 touchscreen driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-10  8:21   ` Boris Brezillon
  2019-08-26 12:58   ` Miquel Raynal
  2019-08-09 20:27 ` [PATCH 13/16] net: remove w90p910-ether driver Arnd Bergmann
                   ` (4 subsequent siblings)
  16 siblings, 2 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Miquel Raynal, Richard Weinberger,
	David Woodhouse, Brian Norris, Marek Vasut, Vignesh Raghavendra,
	linux-kernel, linux-mtd

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mtd/nand/raw/Kconfig       |   8 -
 drivers/mtd/nand/raw/Makefile      |   1 -
 drivers/mtd/nand/raw/nuc900_nand.c | 304 -----------------------------
 3 files changed, 313 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/nuc900_nand.c

diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 5a711d8beaca..0e5c5e02ee6f 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -351,14 +351,6 @@ config MTD_NAND_SOCRATES
 	help
 	  Enables support for NAND Flash chips wired onto Socrates board.
 
-config MTD_NAND_NUC900
-	tristate "Nuvoton NUC9xx/w90p910 NAND controller"
-	depends on ARCH_W90X900 || COMPILE_TEST
-	depends on HAS_IOMEM
-	help
-	  This enables the driver for the NAND Flash on evaluation board based
-	  on w90p910 / NUC9xx.
-
 source "drivers/mtd/nand/raw/ingenic/Kconfig"
 
 config MTD_NAND_FSMC
diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index efaf5cd25edc..d7f6c237e37c 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -41,7 +41,6 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL)		+= sh_flctl.o
 obj-$(CONFIG_MTD_NAND_MXC)		+= mxc_nand.o
 obj-$(CONFIG_MTD_NAND_SOCRATES)		+= socrates_nand.o
 obj-$(CONFIG_MTD_NAND_TXX9NDFMC)	+= txx9ndfmc.o
-obj-$(CONFIG_MTD_NAND_NUC900)		+= nuc900_nand.o
 obj-$(CONFIG_MTD_NAND_MPC5121_NFC)	+= mpc5121_nfc.o
 obj-$(CONFIG_MTD_NAND_VF610_NFC)	+= vf610_nfc.o
 obj-$(CONFIG_MTD_NAND_RICOH)		+= r852.o
diff --git a/drivers/mtd/nand/raw/nuc900_nand.c b/drivers/mtd/nand/raw/nuc900_nand.c
deleted file mode 100644
index 13bf7b2894d3..000000000000
--- a/drivers/mtd/nand/raw/nuc900_nand.c
+++ /dev/null
@@ -1,304 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright © 2009 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/rawnand.h>
-#include <linux/mtd/partitions.h>
-
-#define REG_FMICSR   	0x00
-#define REG_SMCSR    	0xa0
-#define REG_SMISR    	0xac
-#define REG_SMCMD    	0xb0
-#define REG_SMADDR   	0xb4
-#define REG_SMDATA   	0xb8
-
-#define RESET_FMI	0x01
-#define NAND_EN		0x08
-#define READYBUSY	(0x01 << 18)
-
-#define SWRST		0x01
-#define PSIZE		(0x01 << 3)
-#define DMARWEN		(0x03 << 1)
-#define BUSWID		(0x01 << 4)
-#define ECC4EN		(0x01 << 5)
-#define WP		(0x01 << 24)
-#define NANDCS		(0x01 << 25)
-#define ENDADDR		(0x01 << 31)
-
-#define read_data_reg(dev)		\
-	__raw_readl((dev)->reg + REG_SMDATA)
-
-#define write_data_reg(dev, val)	\
-	__raw_writel((val), (dev)->reg + REG_SMDATA)
-
-#define write_cmd_reg(dev, val)		\
-	__raw_writel((val), (dev)->reg + REG_SMCMD)
-
-#define write_addr_reg(dev, val)	\
-	__raw_writel((val), (dev)->reg + REG_SMADDR)
-
-struct nuc900_nand {
-	struct nand_chip chip;
-	void __iomem *reg;
-	struct clk *clk;
-	spinlock_t lock;
-};
-
-static inline struct nuc900_nand *mtd_to_nuc900(struct mtd_info *mtd)
-{
-	return container_of(mtd_to_nand(mtd), struct nuc900_nand, chip);
-}
-
-static const struct mtd_partition partitions[] = {
-	{
-	 .name = "NAND FS 0",
-	 .offset = 0,
-	 .size = 8 * 1024 * 1024
-	},
-	{
-	 .name = "NAND FS 1",
-	 .offset = MTDPART_OFS_APPEND,
-	 .size = MTDPART_SIZ_FULL
-	}
-};
-
-static unsigned char nuc900_nand_read_byte(struct nand_chip *chip)
-{
-	unsigned char ret;
-	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-
-	ret = (unsigned char)read_data_reg(nand);
-
-	return ret;
-}
-
-static void nuc900_nand_read_buf(struct nand_chip *chip,
-				 unsigned char *buf, int len)
-{
-	int i;
-	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-
-	for (i = 0; i < len; i++)
-		buf[i] = (unsigned char)read_data_reg(nand);
-}
-
-static void nuc900_nand_write_buf(struct nand_chip *chip,
-				  const unsigned char *buf, int len)
-{
-	int i;
-	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-
-	for (i = 0; i < len; i++)
-		write_data_reg(nand, buf[i]);
-}
-
-static int nuc900_check_rb(struct nuc900_nand *nand)
-{
-	unsigned int val;
-	spin_lock(&nand->lock);
-	val = __raw_readl(nand->reg + REG_SMISR);
-	val &= READYBUSY;
-	spin_unlock(&nand->lock);
-
-	return val;
-}
-
-static int nuc900_nand_devready(struct nand_chip *chip)
-{
-	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
-	int ready;
-
-	ready = (nuc900_check_rb(nand)) ? 1 : 0;
-	return ready;
-}
-
-static void nuc900_nand_command_lp(struct nand_chip *chip,
-				   unsigned int command,
-				   int column, int page_addr)
-{
-	struct mtd_info *mtd = nand_to_mtd(chip);
-	struct nuc900_nand *nand = mtd_to_nuc900(mtd);
-
-	if (command == NAND_CMD_READOOB) {
-		column += mtd->writesize;
-		command = NAND_CMD_READ0;
-	}
-
-	write_cmd_reg(nand, command & 0xff);
-
-	if (column != -1 || page_addr != -1) {
-
-		if (column != -1) {
-			if (chip->options & NAND_BUSWIDTH_16 &&
-					!nand_opcode_8bits(command))
-				column >>= 1;
-			write_addr_reg(nand, column);
-			write_addr_reg(nand, column >> 8 | ENDADDR);
-		}
-		if (page_addr != -1) {
-			write_addr_reg(nand, page_addr);
-
-			if (chip->options & NAND_ROW_ADDR_3) {
-				write_addr_reg(nand, page_addr >> 8);
-				write_addr_reg(nand, page_addr >> 16 | ENDADDR);
-			} else {
-				write_addr_reg(nand, page_addr >> 8 | ENDADDR);
-			}
-		}
-	}
-
-	switch (command) {
-	case NAND_CMD_CACHEDPROG:
-	case NAND_CMD_PAGEPROG:
-	case NAND_CMD_ERASE1:
-	case NAND_CMD_ERASE2:
-	case NAND_CMD_SEQIN:
-	case NAND_CMD_RNDIN:
-	case NAND_CMD_STATUS:
-		return;
-
-	case NAND_CMD_RESET:
-		if (chip->legacy.dev_ready)
-			break;
-		udelay(chip->legacy.chip_delay);
-
-		write_cmd_reg(nand, NAND_CMD_STATUS);
-		write_cmd_reg(nand, command);
-
-		while (!nuc900_check_rb(nand))
-			;
-
-		return;
-
-	case NAND_CMD_RNDOUT:
-		write_cmd_reg(nand, NAND_CMD_RNDOUTSTART);
-		return;
-
-	case NAND_CMD_READ0:
-		write_cmd_reg(nand, NAND_CMD_READSTART);
-		/* fall through */
-
-	default:
-
-		if (!chip->legacy.dev_ready) {
-			udelay(chip->legacy.chip_delay);
-			return;
-		}
-	}
-
-	/* Apply this short delay always to ensure that we do wait tWB in
-	 * any case on any machine. */
-	ndelay(100);
-
-	while (!chip->legacy.dev_ready(chip))
-		;
-}
-
-
-static void nuc900_nand_enable(struct nuc900_nand *nand)
-{
-	unsigned int val;
-	spin_lock(&nand->lock);
-	__raw_writel(RESET_FMI, (nand->reg + REG_FMICSR));
-
-	val = __raw_readl(nand->reg + REG_FMICSR);
-
-	if (!(val & NAND_EN))
-		__raw_writel(val | NAND_EN, nand->reg + REG_FMICSR);
-
-	val = __raw_readl(nand->reg + REG_SMCSR);
-
-	val &= ~(SWRST|PSIZE|DMARWEN|BUSWID|ECC4EN|NANDCS);
-	val |= WP;
-
-	__raw_writel(val, nand->reg + REG_SMCSR);
-
-	spin_unlock(&nand->lock);
-}
-
-static int nuc900_nand_probe(struct platform_device *pdev)
-{
-	struct nuc900_nand *nuc900_nand;
-	struct nand_chip *chip;
-	struct mtd_info *mtd;
-	struct resource *res;
-
-	nuc900_nand = devm_kzalloc(&pdev->dev, sizeof(struct nuc900_nand),
-				   GFP_KERNEL);
-	if (!nuc900_nand)
-		return -ENOMEM;
-	chip = &(nuc900_nand->chip);
-	mtd = nand_to_mtd(chip);
-
-	mtd->dev.parent		= &pdev->dev;
-	spin_lock_init(&nuc900_nand->lock);
-
-	nuc900_nand->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(nuc900_nand->clk))
-		return -ENOENT;
-	clk_enable(nuc900_nand->clk);
-
-	chip->legacy.cmdfunc	= nuc900_nand_command_lp;
-	chip->legacy.dev_ready	= nuc900_nand_devready;
-	chip->legacy.read_byte	= nuc900_nand_read_byte;
-	chip->legacy.write_buf	= nuc900_nand_write_buf;
-	chip->legacy.read_buf	= nuc900_nand_read_buf;
-	chip->legacy.chip_delay	= 50;
-	chip->options		= 0;
-	chip->ecc.mode		= NAND_ECC_SOFT;
-	chip->ecc.algo		= NAND_ECC_HAMMING;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	nuc900_nand->reg = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(nuc900_nand->reg))
-		return PTR_ERR(nuc900_nand->reg);
-
-	nuc900_nand_enable(nuc900_nand);
-
-	if (nand_scan(chip, 1))
-		return -ENXIO;
-
-	mtd_device_register(mtd, partitions, ARRAY_SIZE(partitions));
-
-	platform_set_drvdata(pdev, nuc900_nand);
-
-	return 0;
-}
-
-static int nuc900_nand_remove(struct platform_device *pdev)
-{
-	struct nuc900_nand *nuc900_nand = platform_get_drvdata(pdev);
-
-	nand_release(&nuc900_nand->chip);
-	clk_disable(nuc900_nand->clk);
-
-	return 0;
-}
-
-static struct platform_driver nuc900_nand_driver = {
-	.probe		= nuc900_nand_probe,
-	.remove		= nuc900_nand_remove,
-	.driver		= {
-		.name	= "nuc900-fmi",
-	},
-};
-
-module_platform_driver(nuc900_nand_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("w90p910/NUC9xx nand driver!");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-fmi");
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 13/16] net: remove w90p910-ether driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (11 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 12/16] mtd: rawnand: remove w90x900 driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 14/16] rtc: remove w90x900/nuc900 driver Arnd Bergmann
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc; +Cc: Arnd Bergmann, David S. Miller, linux-kernel, netdev

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/Kconfig                 |    1 -
 drivers/net/ethernet/Makefile                |    1 -
 drivers/net/ethernet/nuvoton/Kconfig         |   29 -
 drivers/net/ethernet/nuvoton/Makefile        |    6 -
 drivers/net/ethernet/nuvoton/w90p910_ether.c | 1082 ------------------
 5 files changed, 1119 deletions(-)
 delete mode 100644 drivers/net/ethernet/nuvoton/Kconfig
 delete mode 100644 drivers/net/ethernet/nuvoton/Makefile
 delete mode 100644 drivers/net/ethernet/nuvoton/w90p910_ether.c

diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
index 93a2d4deb27c..dc9dee55976b 100644
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
@@ -151,7 +151,6 @@ config NET_NETX
 	  To compile this driver as a module, choose M here. The module
 	  will be called netx-eth.
 
-source "drivers/net/ethernet/nuvoton/Kconfig"
 source "drivers/net/ethernet/nvidia/Kconfig"
 source "drivers/net/ethernet/nxp/Kconfig"
 source "drivers/net/ethernet/oki-semi/Kconfig"
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index fb9155cffcff..4bc3c95562bf 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -65,7 +65,6 @@ obj-$(CONFIG_NET_VENDOR_NETERION) += neterion/
 obj-$(CONFIG_NET_VENDOR_NETRONOME) += netronome/
 obj-$(CONFIG_NET_VENDOR_NI) += ni/
 obj-$(CONFIG_NET_NETX) += netx-eth.o
-obj-$(CONFIG_NET_VENDOR_NUVOTON) += nuvoton/
 obj-$(CONFIG_NET_VENDOR_NVIDIA) += nvidia/
 obj-$(CONFIG_LPC_ENET) += nxp/
 obj-$(CONFIG_NET_VENDOR_OKI) += oki-semi/
diff --git a/drivers/net/ethernet/nuvoton/Kconfig b/drivers/net/ethernet/nuvoton/Kconfig
deleted file mode 100644
index 325e26c549f8..000000000000
--- a/drivers/net/ethernet/nuvoton/Kconfig
+++ /dev/null
@@ -1,29 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Nuvoton network device configuration
-#
-
-config NET_VENDOR_NUVOTON
-	bool "Nuvoton devices"
-	default y
-	depends on ARM && ARCH_W90X900
-	---help---
-	  If you have a network (Ethernet) card belonging to this class, say Y.
-
-	  Note that the answer to this question doesn't directly affect the
-	  kernel: saying N will just cause the configurator to skip all
-	  the questions about Nuvoton cards. If you say Y, you will be asked
-	  for your specific card in the following questions.
-
-if NET_VENDOR_NUVOTON
-
-config W90P910_ETH
-	tristate "Nuvoton w90p910 Ethernet support"
-	depends on ARM && ARCH_W90X900
-	select PHYLIB
-	select MII
-	---help---
-	  Say Y here if you want to use built-in Ethernet ports
-	  on w90p910 processor.
-
-endif # NET_VENDOR_NUVOTON
diff --git a/drivers/net/ethernet/nuvoton/Makefile b/drivers/net/ethernet/nuvoton/Makefile
deleted file mode 100644
index 66f6e728d54b..000000000000
--- a/drivers/net/ethernet/nuvoton/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Makefile for the Nuvoton network device drivers.
-#
-
-obj-$(CONFIG_W90P910_ETH) += w90p910_ether.o
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
deleted file mode 100644
index 3d73970b3a2e..000000000000
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ /dev/null
@@ -1,1082 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2008-2009 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/mii.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <linux/ethtool.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/gfp.h>
-
-#define DRV_MODULE_NAME		"w90p910-emc"
-#define DRV_MODULE_VERSION	"0.1"
-
-/* Ethernet MAC Registers */
-#define REG_CAMCMR		0x00
-#define REG_CAMEN		0x04
-#define REG_CAMM_BASE		0x08
-#define REG_CAML_BASE		0x0c
-#define REG_TXDLSA		0x88
-#define REG_RXDLSA		0x8C
-#define REG_MCMDR		0x90
-#define REG_MIID		0x94
-#define REG_MIIDA		0x98
-#define REG_FFTCR		0x9C
-#define REG_TSDR		0xa0
-#define REG_RSDR		0xa4
-#define REG_DMARFC		0xa8
-#define REG_MIEN		0xac
-#define REG_MISTA		0xb0
-#define REG_CTXDSA		0xcc
-#define REG_CTXBSA		0xd0
-#define REG_CRXDSA		0xd4
-#define REG_CRXBSA		0xd8
-
-/* mac controller bit */
-#define MCMDR_RXON		0x01
-#define MCMDR_ACP		(0x01 << 3)
-#define MCMDR_SPCRC		(0x01 << 5)
-#define MCMDR_TXON		(0x01 << 8)
-#define MCMDR_FDUP		(0x01 << 18)
-#define MCMDR_ENMDC		(0x01 << 19)
-#define MCMDR_OPMOD		(0x01 << 20)
-#define SWR			(0x01 << 24)
-
-/* cam command regiser */
-#define CAMCMR_AUP		0x01
-#define CAMCMR_AMP		(0x01 << 1)
-#define CAMCMR_ABP		(0x01 << 2)
-#define CAMCMR_CCAM		(0x01 << 3)
-#define CAMCMR_ECMP		(0x01 << 4)
-#define CAM0EN			0x01
-
-/* mac mii controller bit */
-#define MDCCR			(0x0a << 20)
-#define PHYAD			(0x01 << 8)
-#define PHYWR			(0x01 << 16)
-#define PHYBUSY			(0x01 << 17)
-#define PHYPRESP		(0x01 << 18)
-#define CAM_ENTRY_SIZE		0x08
-
-/* rx and tx status */
-#define TXDS_TXCP		(0x01 << 19)
-#define RXDS_CRCE		(0x01 << 17)
-#define RXDS_PTLE		(0x01 << 19)
-#define RXDS_RXGD		(0x01 << 20)
-#define RXDS_ALIE		(0x01 << 21)
-#define RXDS_RP			(0x01 << 22)
-
-/* mac interrupt status*/
-#define MISTA_EXDEF		(0x01 << 19)
-#define MISTA_TXBERR		(0x01 << 24)
-#define MISTA_TDU		(0x01 << 23)
-#define MISTA_RDU		(0x01 << 10)
-#define MISTA_RXBERR		(0x01 << 11)
-
-#define ENSTART			0x01
-#define ENRXINTR		0x01
-#define ENRXGD			(0x01 << 4)
-#define ENRXBERR		(0x01 << 11)
-#define ENTXINTR		(0x01 << 16)
-#define ENTXCP			(0x01 << 18)
-#define ENTXABT			(0x01 << 21)
-#define ENTXBERR		(0x01 << 24)
-#define ENMDC			(0x01 << 19)
-#define PHYBUSY			(0x01 << 17)
-#define MDCCR_VAL		0xa00000
-
-/* rx and tx owner bit */
-#define RX_OWEN_DMA		(0x01 << 31)
-#define RX_OWEN_CPU		(~(0x03 << 30))
-#define TX_OWEN_DMA		(0x01 << 31)
-#define TX_OWEN_CPU		(~(0x01 << 31))
-
-/* tx frame desc controller bit */
-#define MACTXINTEN		0x04
-#define CRCMODE			0x02
-#define PADDINGMODE		0x01
-
-/* fftcr controller bit */
-#define TXTHD 			(0x03 << 8)
-#define BLENGTH			(0x01 << 20)
-
-/* global setting for driver */
-#define RX_DESC_SIZE		50
-#define TX_DESC_SIZE		10
-#define MAX_RBUFF_SZ		0x600
-#define MAX_TBUFF_SZ		0x600
-#define TX_TIMEOUT		(HZ/2)
-#define DELAY			1000
-#define CAM0			0x0
-
-static int w90p910_mdio_read(struct net_device *dev, int phy_id, int reg);
-
-struct w90p910_rxbd {
-	unsigned int sl;
-	unsigned int buffer;
-	unsigned int reserved;
-	unsigned int next;
-};
-
-struct w90p910_txbd {
-	unsigned int mode;
-	unsigned int buffer;
-	unsigned int sl;
-	unsigned int next;
-};
-
-struct recv_pdesc {
-	struct w90p910_rxbd desclist[RX_DESC_SIZE];
-	char recv_buf[RX_DESC_SIZE][MAX_RBUFF_SZ];
-};
-
-struct tran_pdesc {
-	struct w90p910_txbd desclist[TX_DESC_SIZE];
-	char tran_buf[TX_DESC_SIZE][MAX_TBUFF_SZ];
-};
-
-struct  w90p910_ether {
-	struct recv_pdesc *rdesc;
-	struct tran_pdesc *tdesc;
-	dma_addr_t rdesc_phys;
-	dma_addr_t tdesc_phys;
-	struct platform_device *pdev;
-	struct resource *res;
-	struct sk_buff *skb;
-	struct clk *clk;
-	struct clk *rmiiclk;
-	struct mii_if_info mii;
-	struct timer_list check_timer;
-	void __iomem *reg;
-	int rxirq;
-	int txirq;
-	unsigned int cur_tx;
-	unsigned int cur_rx;
-	unsigned int finish_tx;
-	unsigned int rx_packets;
-	unsigned int rx_bytes;
-	unsigned int start_tx_ptr;
-	unsigned int start_rx_ptr;
-	unsigned int linkflag;
-};
-
-static void update_linkspeed_register(struct net_device *dev,
-				unsigned int speed, unsigned int duplex)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = __raw_readl(ether->reg + REG_MCMDR);
-
-	if (speed == SPEED_100) {
-		/* 100 full/half duplex */
-		if (duplex == DUPLEX_FULL) {
-			val |= (MCMDR_OPMOD | MCMDR_FDUP);
-		} else {
-			val |= MCMDR_OPMOD;
-			val &= ~MCMDR_FDUP;
-		}
-	} else {
-		/* 10 full/half duplex */
-		if (duplex == DUPLEX_FULL) {
-			val |= MCMDR_FDUP;
-			val &= ~MCMDR_OPMOD;
-		} else {
-			val &= ~(MCMDR_FDUP | MCMDR_OPMOD);
-		}
-	}
-
-	__raw_writel(val, ether->reg + REG_MCMDR);
-}
-
-static void update_linkspeed(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	struct platform_device *pdev;
-	unsigned int bmsr, bmcr, lpa, speed, duplex;
-
-	pdev = ether->pdev;
-
-	if (!mii_link_ok(&ether->mii)) {
-		ether->linkflag = 0x0;
-		netif_carrier_off(dev);
-		dev_warn(&pdev->dev, "%s: Link down.\n", dev->name);
-		return;
-	}
-
-	if (ether->linkflag == 1)
-		return;
-
-	bmsr = w90p910_mdio_read(dev, ether->mii.phy_id, MII_BMSR);
-	bmcr = w90p910_mdio_read(dev, ether->mii.phy_id, MII_BMCR);
-
-	if (bmcr & BMCR_ANENABLE) {
-		if (!(bmsr & BMSR_ANEGCOMPLETE))
-			return;
-
-		lpa = w90p910_mdio_read(dev, ether->mii.phy_id, MII_LPA);
-
-		if ((lpa & LPA_100FULL) || (lpa & LPA_100HALF))
-			speed = SPEED_100;
-		else
-			speed = SPEED_10;
-
-		if ((lpa & LPA_100FULL) || (lpa & LPA_10FULL))
-			duplex = DUPLEX_FULL;
-		else
-			duplex = DUPLEX_HALF;
-
-	} else {
-		speed = (bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10;
-		duplex = (bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF;
-	}
-
-	update_linkspeed_register(dev, speed, duplex);
-
-	dev_info(&pdev->dev, "%s: Link now %i-%s\n", dev->name, speed,
-			(duplex == DUPLEX_FULL) ? "FullDuplex" : "HalfDuplex");
-	ether->linkflag = 0x01;
-
-	netif_carrier_on(dev);
-}
-
-static void w90p910_check_link(struct timer_list *t)
-{
-	struct w90p910_ether *ether = from_timer(ether, t, check_timer);
-	struct net_device *dev = ether->mii.dev;
-
-	update_linkspeed(dev);
-	mod_timer(&ether->check_timer, jiffies + msecs_to_jiffies(1000));
-}
-
-static void w90p910_write_cam(struct net_device *dev,
-				unsigned int x, unsigned char *pval)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int msw, lsw;
-
-	msw = (pval[0] << 24) | (pval[1] << 16) | (pval[2] << 8) | pval[3];
-
-	lsw = (pval[4] << 24) | (pval[5] << 16);
-
-	__raw_writel(lsw, ether->reg + REG_CAML_BASE + x * CAM_ENTRY_SIZE);
-	__raw_writel(msw, ether->reg + REG_CAMM_BASE + x * CAM_ENTRY_SIZE);
-}
-
-static int w90p910_init_desc(struct net_device *dev)
-{
-	struct w90p910_ether *ether;
-	struct w90p910_txbd  *tdesc;
-	struct w90p910_rxbd  *rdesc;
-	struct platform_device *pdev;
-	unsigned int i;
-
-	ether = netdev_priv(dev);
-	pdev = ether->pdev;
-
-	ether->tdesc = dma_alloc_coherent(&pdev->dev, sizeof(struct tran_pdesc),
-					  &ether->tdesc_phys, GFP_KERNEL);
-	if (!ether->tdesc)
-		return -ENOMEM;
-
-	ether->rdesc = dma_alloc_coherent(&pdev->dev, sizeof(struct recv_pdesc),
-					  &ether->rdesc_phys, GFP_KERNEL);
-	if (!ether->rdesc) {
-		dma_free_coherent(&pdev->dev, sizeof(struct tran_pdesc),
-				  ether->tdesc, ether->tdesc_phys);
-		return -ENOMEM;
-	}
-
-	for (i = 0; i < TX_DESC_SIZE; i++) {
-		unsigned int offset;
-
-		tdesc = &(ether->tdesc->desclist[i]);
-
-		if (i == TX_DESC_SIZE - 1)
-			offset = offsetof(struct tran_pdesc, desclist[0]);
-		else
-			offset = offsetof(struct tran_pdesc, desclist[i + 1]);
-
-		tdesc->next = ether->tdesc_phys + offset;
-		tdesc->buffer = ether->tdesc_phys +
-			offsetof(struct tran_pdesc, tran_buf[i]);
-		tdesc->sl = 0;
-		tdesc->mode = 0;
-	}
-
-	ether->start_tx_ptr = ether->tdesc_phys;
-
-	for (i = 0; i < RX_DESC_SIZE; i++) {
-		unsigned int offset;
-
-		rdesc = &(ether->rdesc->desclist[i]);
-
-		if (i == RX_DESC_SIZE - 1)
-			offset = offsetof(struct recv_pdesc, desclist[0]);
-		else
-			offset = offsetof(struct recv_pdesc, desclist[i + 1]);
-
-		rdesc->next = ether->rdesc_phys + offset;
-		rdesc->sl = RX_OWEN_DMA;
-		rdesc->buffer = ether->rdesc_phys +
-			offsetof(struct recv_pdesc, recv_buf[i]);
-	  }
-
-	ether->start_rx_ptr = ether->rdesc_phys;
-
-	return 0;
-}
-
-static void w90p910_set_fifo_threshold(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = TXTHD | BLENGTH;
-	__raw_writel(val, ether->reg + REG_FFTCR);
-}
-
-static void w90p910_return_default_idle(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = __raw_readl(ether->reg + REG_MCMDR);
-	val |= SWR;
-	__raw_writel(val, ether->reg + REG_MCMDR);
-}
-
-static void w90p910_trigger_rx(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	__raw_writel(ENSTART, ether->reg + REG_RSDR);
-}
-
-static void w90p910_trigger_tx(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	__raw_writel(ENSTART, ether->reg + REG_TSDR);
-}
-
-static void w90p910_enable_mac_interrupt(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = ENTXINTR | ENRXINTR | ENRXGD | ENTXCP;
-	val |= ENTXBERR | ENRXBERR | ENTXABT;
-
-	__raw_writel(val, ether->reg + REG_MIEN);
-}
-
-static void w90p910_get_and_clear_int(struct net_device *dev,
-							unsigned int *val)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	*val = __raw_readl(ether->reg + REG_MISTA);
-	__raw_writel(*val, ether->reg + REG_MISTA);
-}
-
-static void w90p910_set_global_maccmd(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = __raw_readl(ether->reg + REG_MCMDR);
-	val |= MCMDR_SPCRC | MCMDR_ENMDC | MCMDR_ACP | ENMDC;
-	__raw_writel(val, ether->reg + REG_MCMDR);
-}
-
-static void w90p910_enable_cam(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	w90p910_write_cam(dev, CAM0, dev->dev_addr);
-
-	val = __raw_readl(ether->reg + REG_CAMEN);
-	val |= CAM0EN;
-	__raw_writel(val, ether->reg + REG_CAMEN);
-}
-
-static void w90p910_enable_cam_command(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = CAMCMR_ECMP | CAMCMR_ABP | CAMCMR_AMP;
-	__raw_writel(val, ether->reg + REG_CAMCMR);
-}
-
-static void w90p910_enable_tx(struct net_device *dev, unsigned int enable)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = __raw_readl(ether->reg + REG_MCMDR);
-
-	if (enable)
-		val |= MCMDR_TXON;
-	else
-		val &= ~MCMDR_TXON;
-
-	__raw_writel(val, ether->reg + REG_MCMDR);
-}
-
-static void w90p910_enable_rx(struct net_device *dev, unsigned int enable)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	unsigned int val;
-
-	val = __raw_readl(ether->reg + REG_MCMDR);
-
-	if (enable)
-		val |= MCMDR_RXON;
-	else
-		val &= ~MCMDR_RXON;
-
-	__raw_writel(val, ether->reg + REG_MCMDR);
-}
-
-static void w90p910_set_curdest(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	__raw_writel(ether->start_rx_ptr, ether->reg + REG_RXDLSA);
-	__raw_writel(ether->start_tx_ptr, ether->reg + REG_TXDLSA);
-}
-
-static void w90p910_reset_mac(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	w90p910_enable_tx(dev, 0);
-	w90p910_enable_rx(dev, 0);
-	w90p910_set_fifo_threshold(dev);
-	w90p910_return_default_idle(dev);
-
-	if (!netif_queue_stopped(dev))
-		netif_stop_queue(dev);
-
-	w90p910_init_desc(dev);
-
-	netif_trans_update(dev); /* prevent tx timeout */
-	ether->cur_tx = 0x0;
-	ether->finish_tx = 0x0;
-	ether->cur_rx = 0x0;
-
-	w90p910_set_curdest(dev);
-	w90p910_enable_cam(dev);
-	w90p910_enable_cam_command(dev);
-	w90p910_enable_mac_interrupt(dev);
-	w90p910_enable_tx(dev, 1);
-	w90p910_enable_rx(dev, 1);
-	w90p910_trigger_tx(dev);
-	w90p910_trigger_rx(dev);
-
-	netif_trans_update(dev); /* prevent tx timeout */
-
-	if (netif_queue_stopped(dev))
-		netif_wake_queue(dev);
-}
-
-static void w90p910_mdio_write(struct net_device *dev,
-					int phy_id, int reg, int data)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	struct platform_device *pdev;
-	unsigned int val, i;
-
-	pdev = ether->pdev;
-
-	__raw_writel(data, ether->reg + REG_MIID);
-
-	val = (phy_id << 0x08) | reg;
-	val |= PHYBUSY | PHYWR | MDCCR_VAL;
-	__raw_writel(val, ether->reg + REG_MIIDA);
-
-	for (i = 0; i < DELAY; i++) {
-		if ((__raw_readl(ether->reg + REG_MIIDA) & PHYBUSY) == 0)
-			break;
-	}
-
-	if (i == DELAY)
-		dev_warn(&pdev->dev, "mdio write timed out\n");
-}
-
-static int w90p910_mdio_read(struct net_device *dev, int phy_id, int reg)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	struct platform_device *pdev;
-	unsigned int val, i, data;
-
-	pdev = ether->pdev;
-
-	val = (phy_id << 0x08) | reg;
-	val |= PHYBUSY | MDCCR_VAL;
-	__raw_writel(val, ether->reg + REG_MIIDA);
-
-	for (i = 0; i < DELAY; i++) {
-		if ((__raw_readl(ether->reg + REG_MIIDA) & PHYBUSY) == 0)
-			break;
-	}
-
-	if (i == DELAY) {
-		dev_warn(&pdev->dev, "mdio read timed out\n");
-		data = 0xffff;
-	} else {
-		data = __raw_readl(ether->reg + REG_MIID);
-	}
-
-	return data;
-}
-
-static int w90p910_set_mac_address(struct net_device *dev, void *addr)
-{
-	struct sockaddr *address = addr;
-
-	if (!is_valid_ether_addr(address->sa_data))
-		return -EADDRNOTAVAIL;
-
-	memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
-	w90p910_write_cam(dev, CAM0, dev->dev_addr);
-
-	return 0;
-}
-
-static int w90p910_ether_close(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	struct platform_device *pdev;
-
-	pdev = ether->pdev;
-
-	dma_free_coherent(&pdev->dev, sizeof(struct recv_pdesc),
-					ether->rdesc, ether->rdesc_phys);
-	dma_free_coherent(&pdev->dev, sizeof(struct tran_pdesc),
-					ether->tdesc, ether->tdesc_phys);
-
-	netif_stop_queue(dev);
-
-	del_timer_sync(&ether->check_timer);
-	clk_disable(ether->rmiiclk);
-	clk_disable(ether->clk);
-
-	free_irq(ether->txirq, dev);
-	free_irq(ether->rxirq, dev);
-
-	return 0;
-}
-
-static int w90p910_send_frame(struct net_device *dev,
-					unsigned char *data, int length)
-{
-	struct w90p910_ether *ether;
-	struct w90p910_txbd *txbd;
-	struct platform_device *pdev;
-	unsigned char *buffer;
-
-	ether = netdev_priv(dev);
-	pdev = ether->pdev;
-
-	txbd = &ether->tdesc->desclist[ether->cur_tx];
-	buffer = ether->tdesc->tran_buf[ether->cur_tx];
-
-	if (length > 1514) {
-		dev_err(&pdev->dev, "send data %d bytes, check it\n", length);
-		length = 1514;
-	}
-
-	txbd->sl = length & 0xFFFF;
-
-	memcpy(buffer, data, length);
-
-	txbd->mode = TX_OWEN_DMA | PADDINGMODE | CRCMODE | MACTXINTEN;
-
-	w90p910_enable_tx(dev, 1);
-
-	w90p910_trigger_tx(dev);
-
-	if (++ether->cur_tx >= TX_DESC_SIZE)
-		ether->cur_tx = 0;
-
-	txbd = &ether->tdesc->desclist[ether->cur_tx];
-
-	if (txbd->mode & TX_OWEN_DMA)
-		netif_stop_queue(dev);
-
-	return 0;
-}
-
-static int w90p910_ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	if (!(w90p910_send_frame(dev, skb->data, skb->len))) {
-		ether->skb = skb;
-		dev_consume_skb_irq(skb);
-		return 0;
-	}
-	return -EAGAIN;
-}
-
-static irqreturn_t w90p910_tx_interrupt(int irq, void *dev_id)
-{
-	struct w90p910_ether *ether;
-	struct w90p910_txbd  *txbd;
-	struct platform_device *pdev;
-	struct net_device *dev;
-	unsigned int cur_entry, entry, status;
-
-	dev = dev_id;
-	ether = netdev_priv(dev);
-	pdev = ether->pdev;
-
-	w90p910_get_and_clear_int(dev, &status);
-
-	cur_entry = __raw_readl(ether->reg + REG_CTXDSA);
-
-	entry = ether->tdesc_phys +
-		offsetof(struct tran_pdesc, desclist[ether->finish_tx]);
-
-	while (entry != cur_entry) {
-		txbd = &ether->tdesc->desclist[ether->finish_tx];
-
-		if (++ether->finish_tx >= TX_DESC_SIZE)
-			ether->finish_tx = 0;
-
-		if (txbd->sl & TXDS_TXCP) {
-			dev->stats.tx_packets++;
-			dev->stats.tx_bytes += txbd->sl & 0xFFFF;
-		} else {
-			dev->stats.tx_errors++;
-		}
-
-		txbd->sl = 0x0;
-		txbd->mode = 0x0;
-
-		if (netif_queue_stopped(dev))
-			netif_wake_queue(dev);
-
-		entry = ether->tdesc_phys +
-			offsetof(struct tran_pdesc, desclist[ether->finish_tx]);
-	}
-
-	if (status & MISTA_EXDEF) {
-		dev_err(&pdev->dev, "emc defer exceed interrupt\n");
-	} else if (status & MISTA_TXBERR) {
-		dev_err(&pdev->dev, "emc bus error interrupt\n");
-		w90p910_reset_mac(dev);
-	} else if (status & MISTA_TDU) {
-		if (netif_queue_stopped(dev))
-			netif_wake_queue(dev);
-	}
-
-	return IRQ_HANDLED;
-}
-
-static void netdev_rx(struct net_device *dev)
-{
-	struct w90p910_ether *ether;
-	struct w90p910_rxbd *rxbd;
-	struct platform_device *pdev;
-	struct sk_buff *skb;
-	unsigned char *data;
-	unsigned int length, status, val, entry;
-
-	ether = netdev_priv(dev);
-	pdev = ether->pdev;
-
-	rxbd = &ether->rdesc->desclist[ether->cur_rx];
-
-	do {
-		val = __raw_readl(ether->reg + REG_CRXDSA);
-
-		entry = ether->rdesc_phys +
-			offsetof(struct recv_pdesc, desclist[ether->cur_rx]);
-
-		if (val == entry)
-			break;
-
-		status = rxbd->sl;
-		length = status & 0xFFFF;
-
-		if (status & RXDS_RXGD) {
-			data = ether->rdesc->recv_buf[ether->cur_rx];
-			skb = netdev_alloc_skb(dev, length + 2);
-			if (!skb) {
-				dev->stats.rx_dropped++;
-				return;
-			}
-
-			skb_reserve(skb, 2);
-			skb_put(skb, length);
-			skb_copy_to_linear_data(skb, data, length);
-			skb->protocol = eth_type_trans(skb, dev);
-			dev->stats.rx_packets++;
-			dev->stats.rx_bytes += length;
-			netif_rx(skb);
-		} else {
-			dev->stats.rx_errors++;
-
-			if (status & RXDS_RP) {
-				dev_err(&pdev->dev, "rx runt err\n");
-				dev->stats.rx_length_errors++;
-			} else if (status & RXDS_CRCE) {
-				dev_err(&pdev->dev, "rx crc err\n");
-				dev->stats.rx_crc_errors++;
-			} else if (status & RXDS_ALIE) {
-				dev_err(&pdev->dev, "rx alignment err\n");
-				dev->stats.rx_frame_errors++;
-			} else if (status & RXDS_PTLE) {
-				dev_err(&pdev->dev, "rx longer err\n");
-				dev->stats.rx_over_errors++;
-			}
-		}
-
-		rxbd->sl = RX_OWEN_DMA;
-		rxbd->reserved = 0x0;
-
-		if (++ether->cur_rx >= RX_DESC_SIZE)
-			ether->cur_rx = 0;
-
-		rxbd = &ether->rdesc->desclist[ether->cur_rx];
-
-	} while (1);
-}
-
-static irqreturn_t w90p910_rx_interrupt(int irq, void *dev_id)
-{
-	struct net_device *dev;
-	struct w90p910_ether  *ether;
-	struct platform_device *pdev;
-	unsigned int status;
-
-	dev = dev_id;
-	ether = netdev_priv(dev);
-	pdev = ether->pdev;
-
-	w90p910_get_and_clear_int(dev, &status);
-
-	if (status & MISTA_RDU) {
-		netdev_rx(dev);
-		w90p910_trigger_rx(dev);
-
-		return IRQ_HANDLED;
-	} else if (status & MISTA_RXBERR) {
-		dev_err(&pdev->dev, "emc rx bus error\n");
-		w90p910_reset_mac(dev);
-	}
-
-	netdev_rx(dev);
-	return IRQ_HANDLED;
-}
-
-static int w90p910_ether_open(struct net_device *dev)
-{
-	struct w90p910_ether *ether;
-	struct platform_device *pdev;
-
-	ether = netdev_priv(dev);
-	pdev = ether->pdev;
-
-	w90p910_reset_mac(dev);
-	w90p910_set_fifo_threshold(dev);
-	w90p910_set_curdest(dev);
-	w90p910_enable_cam(dev);
-	w90p910_enable_cam_command(dev);
-	w90p910_enable_mac_interrupt(dev);
-	w90p910_set_global_maccmd(dev);
-	w90p910_enable_rx(dev, 1);
-
-	clk_enable(ether->rmiiclk);
-	clk_enable(ether->clk);
-
-	ether->rx_packets = 0x0;
-	ether->rx_bytes = 0x0;
-
-	if (request_irq(ether->txirq, w90p910_tx_interrupt,
-						0x0, pdev->name, dev)) {
-		dev_err(&pdev->dev, "register irq tx failed\n");
-		return -EAGAIN;
-	}
-
-	if (request_irq(ether->rxirq, w90p910_rx_interrupt,
-						0x0, pdev->name, dev)) {
-		dev_err(&pdev->dev, "register irq rx failed\n");
-		free_irq(ether->txirq, dev);
-		return -EAGAIN;
-	}
-
-	mod_timer(&ether->check_timer, jiffies + msecs_to_jiffies(1000));
-	netif_start_queue(dev);
-	w90p910_trigger_rx(dev);
-
-	dev_info(&pdev->dev, "%s is OPENED\n", dev->name);
-
-	return 0;
-}
-
-static void w90p910_ether_set_multicast_list(struct net_device *dev)
-{
-	struct w90p910_ether *ether;
-	unsigned int rx_mode;
-
-	ether = netdev_priv(dev);
-
-	if (dev->flags & IFF_PROMISC)
-		rx_mode = CAMCMR_AUP | CAMCMR_AMP | CAMCMR_ABP | CAMCMR_ECMP;
-	else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev))
-		rx_mode = CAMCMR_AMP | CAMCMR_ABP | CAMCMR_ECMP;
-	else
-		rx_mode = CAMCMR_ECMP | CAMCMR_ABP;
-	__raw_writel(rx_mode, ether->reg + REG_CAMCMR);
-}
-
-static int w90p910_ether_ioctl(struct net_device *dev,
-						struct ifreq *ifr, int cmd)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	struct mii_ioctl_data *data = if_mii(ifr);
-
-	return generic_mii_ioctl(&ether->mii, data, cmd, NULL);
-}
-
-static void w90p910_get_drvinfo(struct net_device *dev,
-					struct ethtool_drvinfo *info)
-{
-	strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
-}
-
-static int w90p910_get_link_ksettings(struct net_device *dev,
-				      struct ethtool_link_ksettings *cmd)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	mii_ethtool_get_link_ksettings(&ether->mii, cmd);
-
-	return 0;
-}
-
-static int w90p910_set_link_ksettings(struct net_device *dev,
-				      const struct ethtool_link_ksettings *cmd)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	return mii_ethtool_set_link_ksettings(&ether->mii, cmd);
-}
-
-static int w90p910_nway_reset(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	return mii_nway_restart(&ether->mii);
-}
-
-static u32 w90p910_get_link(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	return mii_link_ok(&ether->mii);
-}
-
-static const struct ethtool_ops w90p910_ether_ethtool_ops = {
-	.get_drvinfo	= w90p910_get_drvinfo,
-	.nway_reset	= w90p910_nway_reset,
-	.get_link	= w90p910_get_link,
-	.get_link_ksettings = w90p910_get_link_ksettings,
-	.set_link_ksettings = w90p910_set_link_ksettings,
-};
-
-static const struct net_device_ops w90p910_ether_netdev_ops = {
-	.ndo_open		= w90p910_ether_open,
-	.ndo_stop		= w90p910_ether_close,
-	.ndo_start_xmit		= w90p910_ether_start_xmit,
-	.ndo_set_rx_mode	= w90p910_ether_set_multicast_list,
-	.ndo_set_mac_address	= w90p910_set_mac_address,
-	.ndo_do_ioctl		= w90p910_ether_ioctl,
-	.ndo_validate_addr	= eth_validate_addr,
-};
-
-static void get_mac_address(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-	struct platform_device *pdev;
-	char addr[ETH_ALEN];
-
-	pdev = ether->pdev;
-
-	addr[0] = 0x00;
-	addr[1] = 0x02;
-	addr[2] = 0xac;
-	addr[3] = 0x55;
-	addr[4] = 0x88;
-	addr[5] = 0xa8;
-
-	if (is_valid_ether_addr(addr))
-		memcpy(dev->dev_addr, &addr, ETH_ALEN);
-	else
-		dev_err(&pdev->dev, "invalid mac address\n");
-}
-
-static int w90p910_ether_setup(struct net_device *dev)
-{
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	dev->netdev_ops = &w90p910_ether_netdev_ops;
-	dev->ethtool_ops = &w90p910_ether_ethtool_ops;
-
-	dev->tx_queue_len = 16;
-	dev->dma = 0x0;
-	dev->watchdog_timeo = TX_TIMEOUT;
-
-	get_mac_address(dev);
-
-	ether->cur_tx = 0x0;
-	ether->cur_rx = 0x0;
-	ether->finish_tx = 0x0;
-	ether->linkflag = 0x0;
-	ether->mii.phy_id = 0x01;
-	ether->mii.phy_id_mask = 0x1f;
-	ether->mii.reg_num_mask = 0x1f;
-	ether->mii.dev = dev;
-	ether->mii.mdio_read = w90p910_mdio_read;
-	ether->mii.mdio_write = w90p910_mdio_write;
-
-	timer_setup(&ether->check_timer, w90p910_check_link, 0);
-
-	return 0;
-}
-
-static int w90p910_ether_probe(struct platform_device *pdev)
-{
-	struct w90p910_ether *ether;
-	struct net_device *dev;
-	int error;
-
-	dev = alloc_etherdev(sizeof(struct w90p910_ether));
-	if (!dev)
-		return -ENOMEM;
-
-	ether = netdev_priv(dev);
-
-	ether->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (ether->res == NULL) {
-		dev_err(&pdev->dev, "failed to get I/O memory\n");
-		error = -ENXIO;
-		goto failed_free;
-	}
-
-	if (!request_mem_region(ether->res->start,
-				resource_size(ether->res), pdev->name)) {
-		dev_err(&pdev->dev, "failed to request I/O memory\n");
-		error = -EBUSY;
-		goto failed_free;
-	}
-
-	ether->reg = ioremap(ether->res->start, resource_size(ether->res));
-	if (ether->reg == NULL) {
-		dev_err(&pdev->dev, "failed to remap I/O memory\n");
-		error = -ENXIO;
-		goto failed_free_mem;
-	}
-
-	ether->txirq = platform_get_irq(pdev, 0);
-	if (ether->txirq < 0) {
-		dev_err(&pdev->dev, "failed to get ether tx irq\n");
-		error = -ENXIO;
-		goto failed_free_io;
-	}
-
-	ether->rxirq = platform_get_irq(pdev, 1);
-	if (ether->rxirq < 0) {
-		dev_err(&pdev->dev, "failed to get ether rx irq\n");
-		error = -ENXIO;
-		goto failed_free_io;
-	}
-
-	platform_set_drvdata(pdev, dev);
-
-	ether->clk = clk_get(&pdev->dev, NULL);
-	if (IS_ERR(ether->clk)) {
-		dev_err(&pdev->dev, "failed to get ether clock\n");
-		error = PTR_ERR(ether->clk);
-		goto failed_free_io;
-	}
-
-	ether->rmiiclk = clk_get(&pdev->dev, "RMII");
-	if (IS_ERR(ether->rmiiclk)) {
-		dev_err(&pdev->dev, "failed to get ether clock\n");
-		error = PTR_ERR(ether->rmiiclk);
-		goto failed_put_clk;
-	}
-
-	ether->pdev = pdev;
-
-	w90p910_ether_setup(dev);
-
-	error = register_netdev(dev);
-	if (error != 0) {
-		dev_err(&pdev->dev, "Register EMC w90p910 FAILED\n");
-		error = -ENODEV;
-		goto failed_put_rmiiclk;
-	}
-
-	return 0;
-failed_put_rmiiclk:
-	clk_put(ether->rmiiclk);
-failed_put_clk:
-	clk_put(ether->clk);
-failed_free_io:
-	iounmap(ether->reg);
-failed_free_mem:
-	release_mem_region(ether->res->start, resource_size(ether->res));
-failed_free:
-	free_netdev(dev);
-	return error;
-}
-
-static int w90p910_ether_remove(struct platform_device *pdev)
-{
-	struct net_device *dev = platform_get_drvdata(pdev);
-	struct w90p910_ether *ether = netdev_priv(dev);
-
-	unregister_netdev(dev);
-
-	clk_put(ether->rmiiclk);
-	clk_put(ether->clk);
-
-	iounmap(ether->reg);
-	release_mem_region(ether->res->start, resource_size(ether->res));
-
-	del_timer_sync(&ether->check_timer);
-
-	free_netdev(dev);
-	return 0;
-}
-
-static struct platform_driver w90p910_ether_driver = {
-	.probe		= w90p910_ether_probe,
-	.remove		= w90p910_ether_remove,
-	.driver		= {
-		.name	= "nuc900-emc",
-	},
-};
-
-module_platform_driver(w90p910_ether_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("w90p910 MAC driver!");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-emc");
-
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 14/16] rtc: remove w90x900/nuc900 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (12 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 13/16] net: remove w90p910-ether driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-12 20:57   ` Alexandre Belloni
  2019-08-09 20:27 ` [PATCH 15/16] usb: remove ehci-w90x900 driver Arnd Bergmann
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Alessandro Zummo, Alexandre Belloni, linux-kernel,
	linux-rtc

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/rtc/Kconfig      |   7 -
 drivers/rtc/Makefile     |   1 -
 drivers/rtc/rtc-nuc900.c | 271 ---------------------------------------
 3 files changed, 279 deletions(-)
 delete mode 100644 drivers/rtc/rtc-nuc900.c

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index e72f65b61176..2805cbb32ade 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1247,13 +1247,6 @@ config RTC_DRV_AB8500
 	  Select this to enable the ST-Ericsson AB8500 power management IC RTC
 	  support. This chip contains a battery- and capacitor-backed RTC.
 
-config RTC_DRV_NUC900
-	tristate "NUC910/NUC920 RTC driver"
-	depends on ARCH_W90X900 || COMPILE_TEST
-	help
-	  If you say yes here you get support for the RTC subsystem of the
-	  NUC910/NUC920 used in embedded systems.
-
 config RTC_DRV_OPAL
 	tristate "IBM OPAL RTC driver"
 	depends on PPC_POWERNV
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 6b09c21dc1b6..9fe0e938272c 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -113,7 +113,6 @@ obj-$(CONFIG_RTC_DRV_MT7622)	+= rtc-mt7622.o
 obj-$(CONFIG_RTC_DRV_MV)	+= rtc-mv.o
 obj-$(CONFIG_RTC_DRV_MXC)	+= rtc-mxc.o
 obj-$(CONFIG_RTC_DRV_MXC_V2)	+= rtc-mxc_v2.o
-obj-$(CONFIG_RTC_DRV_NUC900)	+= rtc-nuc900.o
 obj-$(CONFIG_RTC_DRV_OMAP)	+= rtc-omap.o
 obj-$(CONFIG_RTC_DRV_OPAL)	+= rtc-opal.o
 obj-$(CONFIG_RTC_DRV_PALMAS)	+= rtc-palmas.o
diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c
deleted file mode 100644
index 49cc4058614d..000000000000
--- a/drivers/rtc/rtc-nuc900.c
+++ /dev/null
@@ -1,271 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2008-2009 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/rtc.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/bcd.h>
-
-/* RTC Control Registers */
-#define REG_RTC_INIR		0x00
-#define REG_RTC_AER		0x04
-#define REG_RTC_FCR		0x08
-#define REG_RTC_TLR		0x0C
-#define REG_RTC_CLR		0x10
-#define REG_RTC_TSSR		0x14
-#define REG_RTC_DWR		0x18
-#define REG_RTC_TAR		0x1C
-#define REG_RTC_CAR		0x20
-#define REG_RTC_LIR		0x24
-#define REG_RTC_RIER		0x28
-#define REG_RTC_RIIR		0x2C
-#define REG_RTC_TTR		0x30
-
-#define RTCSET			0x01
-#define AERRWENB		0x10000
-#define INIRRESET		0xa5eb1357
-#define AERPOWERON		0xA965
-#define AERPOWEROFF		0x0000
-#define LEAPYEAR		0x0001
-#define TICKENB			0x80
-#define TICKINTENB		0x0002
-#define ALARMINTENB		0x0001
-#define MODE24			0x0001
-
-struct nuc900_rtc {
-	int			irq_num;
-	void __iomem		*rtc_reg;
-	struct rtc_device	*rtcdev;
-};
-
-struct nuc900_bcd_time {
-	int bcd_sec;
-	int bcd_min;
-	int bcd_hour;
-	int bcd_mday;
-	int bcd_mon;
-	int bcd_year;
-};
-
-static irqreturn_t nuc900_rtc_interrupt(int irq, void *_rtc)
-{
-	struct nuc900_rtc *rtc = _rtc;
-	unsigned long events = 0, rtc_irq;
-
-	rtc_irq = __raw_readl(rtc->rtc_reg + REG_RTC_RIIR);
-
-	if (rtc_irq & ALARMINTENB) {
-		rtc_irq &= ~ALARMINTENB;
-		__raw_writel(rtc_irq, rtc->rtc_reg + REG_RTC_RIIR);
-		events |= RTC_AF | RTC_IRQF;
-	}
-
-	if (rtc_irq & TICKINTENB) {
-		rtc_irq &= ~TICKINTENB;
-		__raw_writel(rtc_irq, rtc->rtc_reg + REG_RTC_RIIR);
-		events |= RTC_UF | RTC_IRQF;
-	}
-
-	rtc_update_irq(rtc->rtcdev, 1, events);
-
-	return IRQ_HANDLED;
-}
-
-static int *check_rtc_access_enable(struct nuc900_rtc *nuc900_rtc)
-{
-	unsigned int timeout = 0x1000;
-	__raw_writel(INIRRESET, nuc900_rtc->rtc_reg + REG_RTC_INIR);
-
-	mdelay(10);
-
-	__raw_writel(AERPOWERON, nuc900_rtc->rtc_reg + REG_RTC_AER);
-
-	while (!(__raw_readl(nuc900_rtc->rtc_reg + REG_RTC_AER) & AERRWENB)
-								&& --timeout)
-		mdelay(1);
-
-	if (!timeout)
-		return ERR_PTR(-EPERM);
-
-	return NULL;
-}
-
-static void nuc900_rtc_bcd2bin(unsigned int timereg,
-			       unsigned int calreg, struct rtc_time *tm)
-{
-	tm->tm_mday	= bcd2bin(calreg >> 0);
-	tm->tm_mon	= bcd2bin(calreg >> 8);
-	tm->tm_year	= bcd2bin(calreg >> 16) + 100;
-
-	tm->tm_sec	= bcd2bin(timereg >> 0);
-	tm->tm_min	= bcd2bin(timereg >> 8);
-	tm->tm_hour	= bcd2bin(timereg >> 16);
-}
-
-static void nuc900_rtc_bin2bcd(struct device *dev, struct rtc_time *settm,
-						struct nuc900_bcd_time *gettm)
-{
-	gettm->bcd_mday = bin2bcd(settm->tm_mday) << 0;
-	gettm->bcd_mon  = bin2bcd(settm->tm_mon) << 8;
-
-	if (settm->tm_year < 100) {
-		dev_warn(dev, "The year will be between 1970-1999, right?\n");
-		gettm->bcd_year = bin2bcd(settm->tm_year) << 16;
-	} else {
-		gettm->bcd_year = bin2bcd(settm->tm_year - 100) << 16;
-	}
-
-	gettm->bcd_sec  = bin2bcd(settm->tm_sec) << 0;
-	gettm->bcd_min  = bin2bcd(settm->tm_min) << 8;
-	gettm->bcd_hour = bin2bcd(settm->tm_hour) << 16;
-}
-
-static int nuc900_alarm_irq_enable(struct device *dev, unsigned int enabled)
-{
-	struct nuc900_rtc *rtc = dev_get_drvdata(dev);
-
-	if (enabled)
-		__raw_writel(__raw_readl(rtc->rtc_reg + REG_RTC_RIER)|
-				(ALARMINTENB), rtc->rtc_reg + REG_RTC_RIER);
-	else
-		__raw_writel(__raw_readl(rtc->rtc_reg + REG_RTC_RIER)&
-				(~ALARMINTENB), rtc->rtc_reg + REG_RTC_RIER);
-
-	return 0;
-}
-
-static int nuc900_rtc_read_time(struct device *dev, struct rtc_time *tm)
-{
-	struct nuc900_rtc *rtc = dev_get_drvdata(dev);
-	unsigned int timeval, clrval;
-
-	timeval = __raw_readl(rtc->rtc_reg + REG_RTC_TLR);
-	clrval	= __raw_readl(rtc->rtc_reg + REG_RTC_CLR);
-
-	nuc900_rtc_bcd2bin(timeval, clrval, tm);
-
-	return 0;
-}
-
-static int nuc900_rtc_set_time(struct device *dev, struct rtc_time *tm)
-{
-	struct nuc900_rtc *rtc = dev_get_drvdata(dev);
-	struct nuc900_bcd_time gettm;
-	unsigned long val;
-	int *err;
-
-	nuc900_rtc_bin2bcd(dev, tm, &gettm);
-
-	err = check_rtc_access_enable(rtc);
-	if (IS_ERR(err))
-		return PTR_ERR(err);
-
-	val = gettm.bcd_mday | gettm.bcd_mon | gettm.bcd_year;
-	__raw_writel(val, rtc->rtc_reg + REG_RTC_CLR);
-
-	val = gettm.bcd_sec | gettm.bcd_min | gettm.bcd_hour;
-	__raw_writel(val, rtc->rtc_reg + REG_RTC_TLR);
-
-	return 0;
-}
-
-static int nuc900_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
-{
-	struct nuc900_rtc *rtc = dev_get_drvdata(dev);
-	unsigned int timeval, carval;
-
-	timeval = __raw_readl(rtc->rtc_reg + REG_RTC_TAR);
-	carval	= __raw_readl(rtc->rtc_reg + REG_RTC_CAR);
-
-	nuc900_rtc_bcd2bin(timeval, carval, &alrm->time);
-
-	return rtc_valid_tm(&alrm->time);
-}
-
-static int nuc900_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
-{
-	struct nuc900_rtc *rtc = dev_get_drvdata(dev);
-	struct nuc900_bcd_time tm;
-	unsigned long val;
-	int *err;
-
-	nuc900_rtc_bin2bcd(dev, &alrm->time, &tm);
-
-	err = check_rtc_access_enable(rtc);
-	if (IS_ERR(err))
-		return PTR_ERR(err);
-
-	val = tm.bcd_mday | tm.bcd_mon | tm.bcd_year;
-	__raw_writel(val, rtc->rtc_reg + REG_RTC_CAR);
-
-	val = tm.bcd_sec | tm.bcd_min | tm.bcd_hour;
-	__raw_writel(val, rtc->rtc_reg + REG_RTC_TAR);
-
-	return 0;
-}
-
-static const struct rtc_class_ops nuc900_rtc_ops = {
-	.read_time = nuc900_rtc_read_time,
-	.set_time = nuc900_rtc_set_time,
-	.read_alarm = nuc900_rtc_read_alarm,
-	.set_alarm = nuc900_rtc_set_alarm,
-	.alarm_irq_enable = nuc900_alarm_irq_enable,
-};
-
-static int __init nuc900_rtc_probe(struct platform_device *pdev)
-{
-	struct resource *res;
-	struct nuc900_rtc *nuc900_rtc;
-
-	nuc900_rtc = devm_kzalloc(&pdev->dev, sizeof(struct nuc900_rtc),
-				GFP_KERNEL);
-	if (!nuc900_rtc)
-		return -ENOMEM;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	nuc900_rtc->rtc_reg = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(nuc900_rtc->rtc_reg))
-		return PTR_ERR(nuc900_rtc->rtc_reg);
-
-	platform_set_drvdata(pdev, nuc900_rtc);
-
-	nuc900_rtc->rtcdev = devm_rtc_device_register(&pdev->dev, pdev->name,
-						&nuc900_rtc_ops, THIS_MODULE);
-	if (IS_ERR(nuc900_rtc->rtcdev)) {
-		dev_err(&pdev->dev, "rtc device register failed\n");
-		return PTR_ERR(nuc900_rtc->rtcdev);
-	}
-
-	__raw_writel(__raw_readl(nuc900_rtc->rtc_reg + REG_RTC_TSSR) | MODE24,
-					nuc900_rtc->rtc_reg + REG_RTC_TSSR);
-
-	nuc900_rtc->irq_num = platform_get_irq(pdev, 0);
-	if (devm_request_irq(&pdev->dev, nuc900_rtc->irq_num,
-			nuc900_rtc_interrupt, 0, "nuc900rtc", nuc900_rtc)) {
-		dev_err(&pdev->dev, "NUC900 RTC request irq failed\n");
-		return -EBUSY;
-	}
-
-	return 0;
-}
-
-static struct platform_driver nuc900_rtc_driver = {
-	.driver		= {
-		.name	= "nuc900-rtc",
-	},
-};
-
-module_platform_driver_probe(nuc900_rtc_driver, nuc900_rtc_probe);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("nuc910/nuc920 RTC driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-rtc");
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 15/16] usb: remove ehci-w90x900 driver
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (13 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 14/16] rtc: remove w90x900/nuc900 driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-09 20:27 ` [PATCH 16/16] ARM: remove w90x900 platform Arnd Bergmann
  2019-08-10  7:29 ` [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Greg Kroah-Hartman
  16 siblings, 0 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Alan Stern, linux-kernel, linux-usb

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/usb/host/Kconfig        |   6 --
 drivers/usb/host/Makefile       |   1 -
 drivers/usb/host/ehci-w90x900.c | 130 --------------------------------
 3 files changed, 137 deletions(-)
 delete mode 100644 drivers/usb/host/ehci-w90x900.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 40b5de597112..782ead054a90 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -287,12 +287,6 @@ config USB_EHCI_MV
 	  Dova, Armada 370 and Armada XP. See "Support for Marvell EBU
 	  on-chip EHCI USB controller" for those.
 
-config USB_W90X900_EHCI
-	tristate "W90X900(W90P910) EHCI support"
-	depends on ARCH_W90X900
-	---help---
-		Enables support for the W90X900 USB controller
-
 config USB_CNS3XXX_EHCI
 	bool "Cavium CNS3XXX EHCI Module (DEPRECATED)"
 	depends on ARCH_CNS3XXX
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 84514f71ae44..0bba93de7654 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -51,7 +51,6 @@ obj-$(CONFIG_USB_EHCI_HCD_STI)	+= ehci-st.o
 obj-$(CONFIG_USB_EHCI_EXYNOS)	+= ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_TEGRA)	+= ehci-tegra.o
-obj-$(CONFIG_USB_W90X900_EHCI)	+= ehci-w90x900.o
 
 obj-$(CONFIG_USB_OXU210HP_HCD)	+= oxu210hp-hcd.o
 obj-$(CONFIG_USB_ISP116X_HCD)	+= isp116x-hcd.o
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
deleted file mode 100644
index 6d77ace1697b..000000000000
--- a/drivers/usb/host/ehci-w90x900.c
+++ /dev/null
@@ -1,130 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/driver/usb/host/ehci-w90x900.c
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/dma-mapping.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/usb.h>
-#include <linux/usb/hcd.h>
-
-#include "ehci.h"
-
-/* enable phy0 and phy1 for w90p910 */
-#define	ENPHY		(0x01<<8)
-#define PHY0_CTR	(0xA4)
-#define PHY1_CTR	(0xA8)
-
-#define DRIVER_DESC "EHCI w90x900 driver"
-
-static const char hcd_name[] = "ehci-w90x900 ";
-
-static struct hc_driver __read_mostly ehci_w90x900_hc_driver;
-
-static int ehci_w90x900_probe(struct platform_device *pdev)
-{
-	struct usb_hcd *hcd;
-	struct ehci_hcd *ehci;
-	struct resource *res;
-	int retval = 0, irq;
-	unsigned long val;
-
-	hcd = usb_create_hcd(&ehci_w90x900_hc_driver,
-			&pdev->dev, "w90x900 EHCI");
-	if (!hcd) {
-		retval = -ENOMEM;
-		goto err1;
-	}
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hcd->regs = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(hcd->regs)) {
-		retval = PTR_ERR(hcd->regs);
-		goto err2;
-	}
-	hcd->rsrc_start = res->start;
-	hcd->rsrc_len = resource_size(res);
-
-	ehci = hcd_to_ehci(hcd);
-	ehci->caps = hcd->regs;
-	ehci->regs = hcd->regs +
-		HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
-
-	/* enable PHY 0,1,the regs only apply to w90p910
-	 *  0xA4,0xA8 were offsets of PHY0 and PHY1 controller of
-	 *  w90p910 IC relative to ehci->regs.
-	 */
-	val = __raw_readl(ehci->regs+PHY0_CTR);
-	val |= ENPHY;
-	__raw_writel(val, ehci->regs+PHY0_CTR);
-
-	val = __raw_readl(ehci->regs+PHY1_CTR);
-	val |= ENPHY;
-	__raw_writel(val, ehci->regs+PHY1_CTR);
-
-	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		retval = irq;
-		goto err2;
-	}
-
-	retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
-	if (retval != 0)
-		goto err2;
-
-	device_wakeup_enable(hcd->self.controller);
-	return retval;
-err2:
-	usb_put_hcd(hcd);
-err1:
-	return retval;
-}
-
-static int ehci_w90x900_remove(struct platform_device *pdev)
-{
-	struct usb_hcd *hcd = platform_get_drvdata(pdev);
-
-	usb_remove_hcd(hcd);
-	usb_put_hcd(hcd);
-
-	return 0;
-}
-
-static struct platform_driver ehci_hcd_w90x900_driver = {
-	.probe  = ehci_w90x900_probe,
-	.remove = ehci_w90x900_remove,
-	.driver = {
-		.name = "w90x900-ehci",
-	},
-};
-
-static int __init ehci_w90X900_init(void)
-{
-	if (usb_disabled())
-		return -ENODEV;
-
-	pr_info("%s: " DRIVER_DESC "\n", hcd_name);
-
-	ehci_init_driver(&ehci_w90x900_hc_driver, NULL);
-	return platform_driver_register(&ehci_hcd_w90x900_driver);
-}
-module_init(ehci_w90X900_init);
-
-static void __exit ehci_w90X900_cleanup(void)
-{
-	platform_driver_unregister(&ehci_hcd_w90x900_driver);
-}
-module_exit(ehci_w90X900_cleanup);
-
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_ALIAS("platform:w90p910-ehci");
-MODULE_LICENSE("GPL v2");
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 16/16] ARM: remove w90x900 platform
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (14 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 15/16] usb: remove ehci-w90x900 driver Arnd Bergmann
@ 2019-08-09 20:27 ` Arnd Bergmann
  2019-08-10  7:29 ` [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Greg Kroah-Hartman
  16 siblings, 0 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-09 20:27 UTC (permalink / raw)
  To: soc
  Cc: Arnd Bergmann, Wanzongshun (Vincent),
	Russell King, linux-kernel, linux-arm-kernel

This removes the old Winbond w90x900 platform, also known
as Nuvoton NUC900. Wan Zongshun originally contributed
the port and maintained it since then.

From all I can tell, this platform is no longer being used
with modern kernels, based on various indications:

- The supported chips (nuc910/950/960) are no longer marketed
  by the manufacturer

- Newer chips from the same family (nuc97x, nuc980, n329x)
  that are still marketed have Linux BSPs but those were never
  submitted for upstream inclusion.

- The last patch from the platform maintainer was in 2011.

- All patches to w90x900 platform specific files afterwards
  are cleanups that were apparently done without access to
  test hardware.

- Both the website and the email address listed in the
  MAINTAINERS have become unreachable.

Cc: "Wanzongshun (Vincent)" <wanzongshun@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 MAINTAINERS                                   |  16 -
 arch/arm/Kconfig                              |  18 -
 arch/arm/Makefile                             |   1 -
 arch/arm/configs/nuc910_defconfig             |  51 --
 arch/arm/configs/nuc950_defconfig             |  67 ---
 arch/arm/configs/nuc960_defconfig             |  57 --
 arch/arm/mach-w90x900/Kconfig                 |  50 --
 arch/arm/mach-w90x900/Makefile                |  20 -
 arch/arm/mach-w90x900/Makefile.boot           |   4 -
 arch/arm/mach-w90x900/clksel.c                |  88 ---
 arch/arm/mach-w90x900/clock.c                 | 121 ----
 arch/arm/mach-w90x900/clock.h                 |  40 --
 arch/arm/mach-w90x900/cpu.c                   | 238 --------
 arch/arm/mach-w90x900/cpu.h                   |  56 --
 arch/arm/mach-w90x900/dev.c                   | 537 ------------------
 arch/arm/mach-w90x900/gpio.c                  | 150 -----
 .../mach-w90x900/include/mach/entry-macro.S   |  26 -
 arch/arm/mach-w90x900/include/mach/hardware.h |  19 -
 arch/arm/mach-w90x900/include/mach/irqs.h     |  82 ---
 arch/arm/mach-w90x900/include/mach/map.h      | 153 -----
 arch/arm/mach-w90x900/include/mach/mfp.h      |  21 -
 .../mach-w90x900/include/mach/regs-clock.h    |  49 --
 arch/arm/mach-w90x900/include/mach/regs-irq.h |  46 --
 arch/arm/mach-w90x900/include/mach/regs-ldm.h | 248 --------
 .../mach-w90x900/include/mach/regs-serial.h   |  54 --
 .../mach-w90x900/include/mach/uncompress.h    |  43 --
 arch/arm/mach-w90x900/irq.c                   | 212 -------
 arch/arm/mach-w90x900/mach-nuc910evb.c        |  38 --
 arch/arm/mach-w90x900/mach-nuc950evb.c        |  42 --
 arch/arm/mach-w90x900/mach-nuc960evb.c        |  38 --
 arch/arm/mach-w90x900/mfp.c                   | 197 -------
 arch/arm/mach-w90x900/nuc910.c                |  58 --
 arch/arm/mach-w90x900/nuc910.h                |  17 -
 arch/arm/mach-w90x900/nuc950.c                |  52 --
 arch/arm/mach-w90x900/nuc950.h                |  17 -
 arch/arm/mach-w90x900/nuc960.c                |  50 --
 arch/arm/mach-w90x900/nuc960.h                |  17 -
 arch/arm/mach-w90x900/nuc9xx.h                |  22 -
 arch/arm/mach-w90x900/regs-ebi.h              |  29 -
 arch/arm/mach-w90x900/regs-gcr.h              |  34 --
 arch/arm/mach-w90x900/regs-timer.h            |  37 --
 arch/arm/mach-w90x900/regs-usb.h              |  31 -
 arch/arm/mach-w90x900/time.c                  | 168 ------
 43 files changed, 3314 deletions(-)
 delete mode 100644 arch/arm/configs/nuc910_defconfig
 delete mode 100644 arch/arm/configs/nuc950_defconfig
 delete mode 100644 arch/arm/configs/nuc960_defconfig
 delete mode 100644 arch/arm/mach-w90x900/Kconfig
 delete mode 100644 arch/arm/mach-w90x900/Makefile
 delete mode 100644 arch/arm/mach-w90x900/Makefile.boot
 delete mode 100644 arch/arm/mach-w90x900/clksel.c
 delete mode 100644 arch/arm/mach-w90x900/clock.c
 delete mode 100644 arch/arm/mach-w90x900/clock.h
 delete mode 100644 arch/arm/mach-w90x900/cpu.c
 delete mode 100644 arch/arm/mach-w90x900/cpu.h
 delete mode 100644 arch/arm/mach-w90x900/dev.c
 delete mode 100644 arch/arm/mach-w90x900/gpio.c
 delete mode 100644 arch/arm/mach-w90x900/include/mach/entry-macro.S
 delete mode 100644 arch/arm/mach-w90x900/include/mach/hardware.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/map.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/mfp.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-clock.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-irq.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-ldm.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/regs-serial.h
 delete mode 100644 arch/arm/mach-w90x900/include/mach/uncompress.h
 delete mode 100644 arch/arm/mach-w90x900/irq.c
 delete mode 100644 arch/arm/mach-w90x900/mach-nuc910evb.c
 delete mode 100644 arch/arm/mach-w90x900/mach-nuc950evb.c
 delete mode 100644 arch/arm/mach-w90x900/mach-nuc960evb.c
 delete mode 100644 arch/arm/mach-w90x900/mfp.c
 delete mode 100644 arch/arm/mach-w90x900/nuc910.c
 delete mode 100644 arch/arm/mach-w90x900/nuc910.h
 delete mode 100644 arch/arm/mach-w90x900/nuc950.c
 delete mode 100644 arch/arm/mach-w90x900/nuc950.h
 delete mode 100644 arch/arm/mach-w90x900/nuc960.c
 delete mode 100644 arch/arm/mach-w90x900/nuc960.h
 delete mode 100644 arch/arm/mach-w90x900/nuc9xx.h
 delete mode 100644 arch/arm/mach-w90x900/regs-ebi.h
 delete mode 100644 arch/arm/mach-w90x900/regs-gcr.h
 delete mode 100644 arch/arm/mach-w90x900/regs-timer.h
 delete mode 100644 arch/arm/mach-w90x900/regs-usb.h
 delete mode 100644 arch/arm/mach-w90x900/time.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 9ac40a896ee6..38de7f04c39f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2005,22 +2005,6 @@ F:	drivers/*/*npcm*
 F:	Documentation/devicetree/bindings/*/*npcm*
 F:	Documentation/devicetree/bindings/*/*/*npcm*
 
-ARM/NUVOTON W90X900 ARM ARCHITECTURE
-M:	Wan ZongShun <mcuos.com@gmail.com>
-L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-W:	http://www.mcuos.com
-S:	Maintained
-F:	arch/arm/mach-w90x900/
-F:	drivers/input/keyboard/w90p910_keypad.c
-F:	drivers/input/touchscreen/w90p910_ts.c
-F:	drivers/watchdog/nuc900_wdt.c
-F:	drivers/net/ethernet/nuvoton/w90p910_ether.c
-F:	drivers/mtd/nand/raw/nuc900_nand.c
-F:	drivers/rtc/rtc-nuc900.c
-F:	drivers/spi/spi-nuc900.c
-F:	drivers/usb/host/ehci-w90x900.c
-F:	drivers/video/fbdev/nuc900fb.c
-
 ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
 L:	openmoko-kernel@lists.openmoko.org (subscribers-only)
 W:	http://wiki.openmoko.org/wiki/Neo_FreeRunner
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 61deacf68e13..1597c542dc4f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -450,22 +450,6 @@ config ARCH_DOVE
 	help
 	  Support for the Marvell Dove SoC 88AP510
 
-config ARCH_W90X900
-	bool "Nuvoton W90X900 CPU"
-	select CLKDEV_LOOKUP
-	select CLKSRC_MMIO
-	select CPU_ARM926T
-	select GENERIC_CLOCKEVENTS
-	select GPIOLIB
-	help
-	  Support for Nuvoton (Winbond logic dept.) ARM9 processor,
-	  At present, the w90x900 has been renamed nuc900, regarding
-	  the ARM series product line, you can login the following
-	  link address to know more.
-
-	  <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
-		ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
-
 config ARCH_LPC32XX
 	bool "NXP LPC32XX"
 	select ARM_AMBA
@@ -822,8 +806,6 @@ source "arch/arm/plat-versatile/Kconfig"
 
 source "arch/arm/mach-vt8500/Kconfig"
 
-source "arch/arm/mach-w90x900/Kconfig"
-
 source "arch/arm/mach-zx/Kconfig"
 
 source "arch/arm/mach-zynq/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c9daa4adc6fd..04e3f2f5a6b4 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -221,7 +221,6 @@ machine-$(CONFIG_ARCH_U8500)		+= ux500
 machine-$(CONFIG_ARCH_VERSATILE)	+= versatile
 machine-$(CONFIG_ARCH_VEXPRESS)		+= vexpress
 machine-$(CONFIG_ARCH_VT8500)		+= vt8500
-machine-$(CONFIG_ARCH_W90X900)		+= w90x900
 machine-$(CONFIG_ARCH_ZX)		+= zx
 machine-$(CONFIG_ARCH_ZYNQ)		+= zynq
 machine-$(CONFIG_PLAT_SPEAR)		+= spear
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 @@
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_RELAY=y
-CONFIG_USER_NS=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_SLAB=y
-CONFIG_ARCH_W90X900=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
-CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
-CONFIG_KEXEC=y
-CONFIG_FPE_NWFPE=y
-CONFIG_MTD=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=16384
-CONFIG_SCSI=y
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_BLK_DEV_SD=y
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-# CONFIG_DEVKMEM is not set
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=1
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-# CONFIG_HWMON is not set
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_USB=y
-CONFIG_USB_MON=y
-CONFIG_USB_STORAGE=y
-# CONFIG_DNOTIFY is not set
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-CONFIG_ROMFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_DEBUG_FS=y
-# 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 @@
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_RELAY=y
-CONFIG_USER_NS=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_SLAB=y
-CONFIG_ARCH_W90X900=y
-# CONFIG_MACH_W90P910EVB is not set
-CONFIG_MACH_W90P950EVB=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
-CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
-CONFIG_KEXEC=y
-CONFIG_FPE_NWFPE=y
-CONFIG_BINFMT_AOUT=y
-CONFIG_BINFMT_MISC=y
-CONFIG_MTD=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=16384
-CONFIG_SCSI=y
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_BLK_DEV_SD=y
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-# CONFIG_DEVKMEM is not set
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=1
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-# CONFIG_HWMON is not set
-CONFIG_FB=y
-CONFIG_FB_NUC900=y
-CONFIG_GPM1040A0_320X240=y
-CONFIG_FB_NUC900_DEBUG=y
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x16=y
-CONFIG_LOGO=y
-# CONFIG_LOGO_LINUX_MONO is not set
-# CONFIG_LOGO_LINUX_VGA16 is not set
-CONFIG_USB=y
-CONFIG_USB_MON=y
-CONFIG_USB_STORAGE=y
-# CONFIG_DNOTIFY is not set
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-CONFIG_ROMFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_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 @@
-# CONFIG_LOCALVERSION_AUTO is not set
-CONFIG_SYSVIPC=y
-CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_RELAY=y
-CONFIG_USER_NS=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_SLAB=y
-CONFIG_ARCH_W90X900=y
-# CONFIG_MACH_W90P910EVB is not set
-CONFIG_MACH_W90N960EVB=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
-CONFIG_CMDLINE="root=/dev/ram0 console=ttyS0,115200n8 rdinit=/sbin/init mem=64M"
-CONFIG_KEXEC=y
-CONFIG_FPE_NWFPE=y
-CONFIG_BINFMT_AOUT=y
-CONFIG_BINFMT_MISC=y
-CONFIG_MTD=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=16384
-CONFIG_SCSI=y
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_BLK_DEV_SD=y
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-# CONFIG_DEVKMEM is not set
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=1
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-# CONFIG_HWMON is not set
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_USB=y
-CONFIG_USB_MON=y
-CONFIG_USB_STORAGE=y
-# CONFIG_DNOTIFY is not set
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-CONFIG_ROMFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_DEBUG_FS=y
-# CONFIG_CRC32 is not set
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 @@
-# SPDX-License-Identifier: GPL-2.0
-if ARCH_W90X900
-
-config CPU_W90P910
-	bool
-	help
-	  Support for W90P910 of Nuvoton W90X900 CPUs.
-
-config CPU_NUC950
-	bool
-	help
-	  Support for NUCP950 of Nuvoton NUC900 CPUs.
-
-config CPU_NUC960
-	bool
-	help
-	  Support for NUCP960 of Nuvoton NUC900 CPUs.
-
-menu "W90P910 Machines"
-
-config MACH_W90P910EVB
-	bool "Nuvoton W90P910 Evaluation Board"
-	default y
-	select CPU_W90P910
-	help
-	   Say Y here if you are using the Nuvoton W90P910EVB
-
-endmenu
-
-menu "NUC950 Machines"
-
-config MACH_W90P950EVB
-	bool "Nuvoton NUC950 Evaluation Board"
-	select CPU_NUC950
-	help
-	   Say Y here if you are using the Nuvoton NUC950EVB
-
-endmenu
-
-menu "NUC960 Machines"
-
-config MACH_W90N960EVB
-	bool "Nuvoton NUC960 Evaluation Board"
-	select CPU_NUC960
-	help
-	   Say Y here if you are using the Nuvoton NUC960EVB
-
-endmenu
-
-endif
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 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Makefile for the linux kernel.
-#
-
-# Object file lists.
-
-obj-y				:= irq.o time.o mfp.o gpio.o clock.o
-obj-y				+= clksel.o dev.o cpu.o
-# W90X900 CPU support files
-
-obj-$(CONFIG_CPU_W90P910)	+= nuc910.o
-obj-$(CONFIG_CPU_NUC950)	+= nuc950.o
-obj-$(CONFIG_CPU_NUC960)	+= nuc960.o
-
-# machine support
-
-obj-$(CONFIG_MACH_W90P910EVB)	+= mach-nuc910evb.o
-obj-$(CONFIG_MACH_W90P950EVB)	+= mach-nuc950evb.o
-obj-$(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 @@
-# SPDX-License-Identifier: GPL-2.0-only
-zreladdr-y	+= 0x00008000
-params_phys-y	:= 0x00000100
-
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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/clksel.c
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/device.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-#include <mach/regs-clock.h>
-
-#define PLL0		0x00
-#define PLL1		0x01
-#define OTHER		0x02
-#define EXT		0x03
-#define MSOFFSET	0x0C
-#define ATAOFFSET	0x0a
-#define LCDOFFSET	0x06
-#define AUDOFFSET	0x04
-#define CPUOFFSET	0x00
-
-static DEFINE_MUTEX(clksel_sem);
-
-static void clock_source_select(const char *dev_id, unsigned int clkval)
-{
-	unsigned int clksel, offset;
-
-	clksel = __raw_readl(REG_CLKSEL);
-
-	if (strcmp(dev_id, "nuc900-ms") == 0)
-		offset = MSOFFSET;
-	else if (strcmp(dev_id, "nuc900-atapi") == 0)
-		offset = ATAOFFSET;
-	else if (strcmp(dev_id, "nuc900-lcd") == 0)
-		offset = LCDOFFSET;
-	else if (strcmp(dev_id, "nuc900-ac97") == 0)
-		offset = AUDOFFSET;
-	else
-		offset = CPUOFFSET;
-
-	clksel &= ~(0x03 << offset);
-	clksel |= (clkval << offset);
-
-	__raw_writel(clksel, REG_CLKSEL);
-}
-
-void nuc900_clock_source(struct device *dev, unsigned char *src)
-{
-	unsigned int clkval;
-	const char *dev_id;
-
-	BUG_ON(!src);
-	clkval = 0;
-
-	mutex_lock(&clksel_sem);
-
-	if (dev)
-		dev_id = dev_name(dev);
-	else
-		dev_id = "cpufreq";
-
-	if (strcmp(src, "pll0") == 0)
-		clkval = PLL0;
-	else if (strcmp(src, "pll1") == 0)
-		clkval = PLL1;
-	else if (strcmp(src, "ext") == 0)
-		clkval = EXT;
-	else if (strcmp(src, "oth") == 0)
-		clkval = OTHER;
-
-	clock_source_select(dev_id, clkval);
-
-	mutex_unlock(&clksel_sem);
-}
-EXPORT_SYMBOL(nuc900_clock_source);
-
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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/clock.c
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/spinlock.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-
-#include "clock.h"
-
-#define SUBCLK 0x24
-
-static DEFINE_SPINLOCK(clocks_lock);
-
-int clk_enable(struct clk *clk)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&clocks_lock, flags);
-	if (clk->enabled++ == 0)
-		(clk->enable)(clk, 1);
-	spin_unlock_irqrestore(&clocks_lock, flags);
-
-	return 0;
-}
-EXPORT_SYMBOL(clk_enable);
-
-void clk_disable(struct clk *clk)
-{
-	unsigned long flags;
-
-	if (!clk)
-		return;
-
-	WARN_ON(clk->enabled == 0);
-
-	spin_lock_irqsave(&clocks_lock, flags);
-	if (--clk->enabled == 0)
-		(clk->enable)(clk, 0);
-	spin_unlock_irqrestore(&clocks_lock, flags);
-}
-EXPORT_SYMBOL(clk_disable);
-
-unsigned long clk_get_rate(struct clk *clk)
-{
-	return 15000000;
-}
-EXPORT_SYMBOL(clk_get_rate);
-
-void nuc900_clk_enable(struct clk *clk, int enable)
-{
-	unsigned int clocks = clk->cken;
-	unsigned long clken;
-
-	clken = __raw_readl(W90X900_VA_CLKPWR);
-
-	if (enable)
-		clken |= clocks;
-	else
-		clken &= ~clocks;
-
-	__raw_writel(clken, W90X900_VA_CLKPWR);
-}
-
-void nuc900_subclk_enable(struct clk *clk, int enable)
-{
-	unsigned int clocks = clk->cken;
-	unsigned long clken;
-
-	clken = __raw_readl(W90X900_VA_CLKPWR + SUBCLK);
-
-	if (enable)
-		clken |= clocks;
-	else
-		clken &= ~clocks;
-
-	__raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK);
-}
-
-/* dummy functions, should not be called */
-long clk_round_rate(struct clk *clk, unsigned long rate)
-{
-	WARN_ON(clk);
-	return 0;
-}
-EXPORT_SYMBOL(clk_round_rate);
-
-int clk_set_rate(struct clk *clk, unsigned long rate)
-{
-	WARN_ON(clk);
-	return 0;
-}
-EXPORT_SYMBOL(clk_set_rate);
-
-int clk_set_parent(struct clk *clk, struct clk *parent)
-{
-	WARN_ON(clk);
-	return 0;
-}
-EXPORT_SYMBOL(clk_set_parent);
-
-struct clk *clk_get_parent(struct clk *clk)
-{
-	WARN_ON(clk);
-	return NULL;
-}
-EXPORT_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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * linux/arch/arm/mach-w90x900/clock.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/clkdev.h>
-
-void nuc900_clk_enable(struct clk *clk, int enable);
-void nuc900_subclk_enable(struct clk *clk, int enable);
-
-struct clk {
-	unsigned long		cken;
-	unsigned int		enabled;
-	void			(*enable)(struct clk *, int enable);
-};
-
-#define DEFINE_CLK(_name, _ctrlbit)			\
-struct clk clk_##_name = {				\
-		.enable	= nuc900_clk_enable,		\
-		.cken	= (1 << _ctrlbit),		\
-	}
-
-#define DEFINE_SUBCLK(_name, _ctrlbit)			\
-struct clk clk_##_name = {				\
-		.enable	= nuc900_subclk_enable,	\
-		.cken	= (1 << _ctrlbit),		\
-	}
-
-
-#define DEF_CLKLOOK(_clk, _devname, _conname)		\
-	{						\
-		.clk		= _clk,			\
-		.dev_id		= _devname,		\
-		.con_id		= _conname,		\
-	}
-
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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/cpu.c
- *
- * Copyright (c) 2009 Nuvoton corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * NUC900 series cpu common support
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/list.h>
-#include <linux/timer.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/serial_8250.h>
-#include <linux/delay.h>
-
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-#include <asm/irq.h>
-#include <asm/system_misc.h>
-
-#include <mach/hardware.h>
-#include <mach/regs-serial.h>
-#include <mach/regs-clock.h>
-#include "regs-ebi.h"
-#include "regs-timer.h"
-
-#include "cpu.h"
-#include "clock.h"
-#include "nuc9xx.h"
-
-/* Initial IO mappings */
-
-static struct map_desc nuc900_iodesc[] __initdata = {
-	IODESC_ENT(IRQ),
-	IODESC_ENT(GCR),
-	IODESC_ENT(UART),
-	IODESC_ENT(TIMER),
-	IODESC_ENT(EBI),
-	IODESC_ENT(GPIO),
-};
-
-/* Initial clock declarations. */
-static DEFINE_CLK(lcd, 0);
-static DEFINE_CLK(audio, 1);
-static DEFINE_CLK(fmi, 4);
-static DEFINE_SUBCLK(ms, 0);
-static DEFINE_SUBCLK(sd, 1);
-static DEFINE_CLK(dmac, 5);
-static DEFINE_CLK(atapi, 6);
-static DEFINE_CLK(emc, 7);
-static DEFINE_SUBCLK(rmii, 2);
-static DEFINE_CLK(usbd, 8);
-static DEFINE_CLK(usbh, 9);
-static DEFINE_CLK(g2d, 10);
-static DEFINE_CLK(pwm, 18);
-static DEFINE_CLK(ps2, 24);
-static DEFINE_CLK(kpi, 25);
-static DEFINE_CLK(wdt, 26);
-static DEFINE_CLK(gdma, 27);
-static DEFINE_CLK(adc, 28);
-static DEFINE_CLK(usi, 29);
-static DEFINE_CLK(ext, 0);
-static DEFINE_CLK(timer0, 19);
-static DEFINE_CLK(timer1, 20);
-static DEFINE_CLK(timer2, 21);
-static DEFINE_CLK(timer3, 22);
-static DEFINE_CLK(timer4, 23);
-
-static struct clk_lookup nuc900_clkregs[] = {
-	DEF_CLKLOOK(&clk_lcd, "nuc900-lcd", NULL),
-	DEF_CLKLOOK(&clk_audio, "nuc900-ac97", NULL),
-	DEF_CLKLOOK(&clk_fmi, "nuc900-fmi", NULL),
-	DEF_CLKLOOK(&clk_ms, "nuc900-fmi", "MS"),
-	DEF_CLKLOOK(&clk_sd, "nuc900-fmi", "SD"),
-	DEF_CLKLOOK(&clk_dmac, "nuc900-dmac", NULL),
-	DEF_CLKLOOK(&clk_atapi, "nuc900-atapi", NULL),
-	DEF_CLKLOOK(&clk_emc, "nuc900-emc", NULL),
-	DEF_CLKLOOK(&clk_rmii, "nuc900-emc", "RMII"),
-	DEF_CLKLOOK(&clk_usbd, "nuc900-usbd", NULL),
-	DEF_CLKLOOK(&clk_usbh, "nuc900-usbh", NULL),
-	DEF_CLKLOOK(&clk_g2d, "nuc900-g2d", NULL),
-	DEF_CLKLOOK(&clk_pwm, "nuc900-pwm", NULL),
-	DEF_CLKLOOK(&clk_ps2, "nuc900-ps2", NULL),
-	DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL),
-	DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL),
-	DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL),
-	DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL),
-	DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL),
-	DEF_CLKLOOK(&clk_ext, NULL, "ext"),
-	DEF_CLKLOOK(&clk_timer0, NULL, "timer0"),
-	DEF_CLKLOOK(&clk_timer1, NULL, "timer1"),
-	DEF_CLKLOOK(&clk_timer2, NULL, "timer2"),
-	DEF_CLKLOOK(&clk_timer3, NULL, "timer3"),
-	DEF_CLKLOOK(&clk_timer4, NULL, "timer4"),
-};
-
-/* Initial serial platform data */
-
-struct plat_serial8250_port nuc900_uart_data[] = {
-	NUC900_8250PORT(UART0),
-	{},
-};
-
-struct platform_device nuc900_serial_device = {
-	.name			= "serial8250",
-	.id			= PLAT8250_DEV_PLATFORM,
-	.dev			= {
-		.platform_data	= nuc900_uart_data,
-	},
-};
-
-/*Set NUC900 series cpu frequence*/
-static int __init nuc900_set_clkval(unsigned int cpufreq)
-{
-	unsigned int pllclk, ahbclk, apbclk, val;
-
-	pllclk = 0;
-	ahbclk = 0;
-	apbclk = 0;
-
-	switch (cpufreq) {
-	case 66:
-		pllclk = PLL_66MHZ;
-		ahbclk = AHB_CPUCLK_1_1;
-		apbclk = APB_AHB_1_2;
-		break;
-
-	case 100:
-		pllclk = PLL_100MHZ;
-		ahbclk = AHB_CPUCLK_1_1;
-		apbclk = APB_AHB_1_2;
-		break;
-
-	case 120:
-		pllclk = PLL_120MHZ;
-		ahbclk = AHB_CPUCLK_1_2;
-		apbclk = APB_AHB_1_2;
-		break;
-
-	case 166:
-		pllclk = PLL_166MHZ;
-		ahbclk = AHB_CPUCLK_1_2;
-		apbclk = APB_AHB_1_2;
-		break;
-
-	case 200:
-		pllclk = PLL_200MHZ;
-		ahbclk = AHB_CPUCLK_1_2;
-		apbclk = APB_AHB_1_2;
-		break;
-	}
-
-	__raw_writel(pllclk, REG_PLLCON0);
-
-	val = __raw_readl(REG_CLKDIV);
-	val &= ~(0x03 << 24 | 0x03 << 26);
-	val |= (ahbclk << 24 | apbclk << 26);
-	__raw_writel(val, REG_CLKDIV);
-
-	return 	0;
-}
-static int __init nuc900_set_cpufreq(char *str)
-{
-	unsigned long cpufreq, val;
-
-	if (!*str)
-		return 0;
-
-	if (kstrtoul(str, 0, &cpufreq))
-		return 0;
-
-	nuc900_clock_source(NULL, "ext");
-
-	nuc900_set_clkval(cpufreq);
-
-	mdelay(1);
-
-	val = __raw_readl(REG_CKSKEW);
-	val &= ~0xff;
-	val |= DEFAULTSKEW;
-	__raw_writel(val, REG_CKSKEW);
-
-	nuc900_clock_source(NULL, "pll0");
-
-	return 1;
-}
-
-__setup("cpufreq=", nuc900_set_cpufreq);
-
-/*Init NUC900 evb io*/
-
-void __init nuc900_map_io(struct map_desc *mach_desc, int mach_size)
-{
-	unsigned long idcode = 0x0;
-
-	iotable_init(mach_desc, mach_size);
-	iotable_init(nuc900_iodesc, ARRAY_SIZE(nuc900_iodesc));
-
-	idcode = __raw_readl(NUC900PDID);
-	if (idcode == NUC910_CPUID)
-		printk(KERN_INFO "CPU type 0x%08lx is NUC910\n", idcode);
-	else if (idcode == NUC920_CPUID)
-		printk(KERN_INFO "CPU type 0x%08lx is NUC920\n", idcode);
-	else if (idcode == NUC950_CPUID)
-		printk(KERN_INFO "CPU type 0x%08lx is NUC950\n", idcode);
-	else if (idcode == NUC960_CPUID)
-		printk(KERN_INFO "CPU type 0x%08lx is NUC960\n", idcode);
-}
-
-/*Init NUC900 clock*/
-
-void __init nuc900_init_clocks(void)
-{
-	clkdev_add_table(nuc900_clkregs, ARRAY_SIZE(nuc900_clkregs));
-}
-
-#define	WTCR	(TMR_BA + 0x1C)
-#define	WTCLK	(1 << 10)
-#define	WTE	(1 << 7)
-#define	WTRE	(1 << 1)
-
-void nuc9xx_restart(enum reboot_mode mode, const char *cmd)
-{
-	if (mode == REBOOT_SOFT) {
-		/* Jump into ROM at address 0 */
-		soft_restart(0);
-	} else {
-		__raw_writel(WTE | WTRE | WTCLK, WTCR);
-	}
-}
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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/cpu.h
- *
- * Based on linux/include/asm-arm/plat-s3c24xx/cpu.h by Ben Dooks
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Header file for NUC900 CPU support
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#define IODESC_ENT(y)                                  \
-{                                                      \
-       .virtual = (unsigned long)W90X900_VA_##y,       \
-       .pfn     = __phys_to_pfn(W90X900_PA_##y),       \
-       .length  = W90X900_SZ_##y,                      \
-       .type    = MT_DEVICE,                           \
-}
-
-#define NUC900_8250PORT(name)					\
-{								\
-	.membase	= name##_BA,				\
-	.mapbase	= name##_PA,				\
-	.irq		= IRQ_##name,				\
-	.uartclk	= 11313600,				\
-	.regshift	= 2,					\
-	.iotype		= UPIO_MEM,				\
-	.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,	\
-}
-
-/*Cpu identifier register*/
-
-#define NUC900PDID	W90X900_VA_GCR
-#define NUC910_CPUID	0x02900910
-#define NUC920_CPUID	0x02900920
-#define NUC950_CPUID	0x02900950
-#define NUC960_CPUID	0x02900960
-
-/* extern file from cpu.c */
-
-extern void nuc900_clock_source(struct device *dev, unsigned char *src);
-extern void nuc900_init_clocks(void);
-extern void nuc900_map_io(struct map_desc *mach_desc, int mach_size);
-extern void nuc900_board_init(struct platform_device **device, int size);
-
-/* for either public between 910 and 920, or between 920 and 950 */
-
-extern struct platform_device nuc900_serial_device;
-extern struct platform_device nuc900_device_fmi;
-extern struct platform_device nuc900_device_kpi;
-extern struct platform_device nuc900_device_rtc;
-extern struct platform_device nuc900_device_ts;
-extern 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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/dev.c
- *
- * Copyright (C) 2009 Nuvoton corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/list.h>
-#include <linux/timer.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/cpu.h>
-
-#include <linux/mtd/physmap.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-
-#include <linux/spi/spi.h>
-#include <linux/spi/flash.h>
-
-#include <asm/system_misc.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-#include <asm/mach-types.h>
-
-#include <mach/regs-serial.h>
-#include <linux/platform_data/spi-nuc900.h>
-#include <mach/map.h>
-#include <linux/platform_data/video-nuc900fb.h>
-#include <mach/regs-ldm.h>
-#include <linux/platform_data/keypad-w90p910.h>
-
-#include "cpu.h"
-
-/*NUC900 evb norflash driver data */
-
-#define NUC900_FLASH_BASE	0xA0000000
-#define NUC900_FLASH_SIZE	0x400000
-#define SPIOFFSET		0x200
-#define SPIOREG_SIZE		0x100
-
-static struct mtd_partition nuc900_flash_partitions[] = {
-	{
-		.name	=	"NOR Partition 1 for kernel (960K)",
-		.size	=	0xF0000,
-		.offset	=	0x10000,
-	},
-	{
-		.name	=	"NOR Partition 2 for image (1M)",
-		.size	=	0x100000,
-		.offset	=	0x100000,
-	},
-	{
-		.name	=	"NOR Partition 3 for user (2M)",
-		.size	=	0x200000,
-		.offset	=	0x00200000,
-	}
-};
-
-static struct physmap_flash_data nuc900_flash_data = {
-	.width		=	2,
-	.parts		=	nuc900_flash_partitions,
-	.nr_parts	=	ARRAY_SIZE(nuc900_flash_partitions),
-};
-
-static struct resource nuc900_flash_resources[] = {
-	{
-		.start	=	NUC900_FLASH_BASE,
-		.end	=	NUC900_FLASH_BASE + NUC900_FLASH_SIZE - 1,
-		.flags	=	IORESOURCE_MEM,
-	}
-};
-
-static struct platform_device nuc900_flash_device = {
-	.name		=	"physmap-flash",
-	.id		=	0,
-	.dev		= {
-				.platform_data = &nuc900_flash_data,
-			},
-	.resource	=	nuc900_flash_resources,
-	.num_resources	=	ARRAY_SIZE(nuc900_flash_resources),
-};
-
-/* USB EHCI Host Controller */
-
-static struct resource nuc900_usb_ehci_resource[] = {
-	[0] = {
-		.start = W90X900_PA_USBEHCIHOST,
-		.end   = W90X900_PA_USBEHCIHOST + W90X900_SZ_USBEHCIHOST - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_USBH,
-		.end   = IRQ_USBH,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-static u64 nuc900_device_usb_ehci_dmamask = 0xffffffffUL;
-
-static struct platform_device nuc900_device_usb_ehci = {
-	.name		  = "nuc900-ehci",
-	.id		  = -1,
-	.num_resources	  = ARRAY_SIZE(nuc900_usb_ehci_resource),
-	.resource	  = nuc900_usb_ehci_resource,
-	.dev              = {
-		.dma_mask = &nuc900_device_usb_ehci_dmamask,
-		.coherent_dma_mask = 0xffffffffUL
-	}
-};
-
-/* USB OHCI Host Controller */
-
-static struct resource nuc900_usb_ohci_resource[] = {
-	[0] = {
-		.start = W90X900_PA_USBOHCIHOST,
-		.end   = W90X900_PA_USBOHCIHOST + W90X900_SZ_USBOHCIHOST - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_USBH,
-		.end   = IRQ_USBH,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-static u64 nuc900_device_usb_ohci_dmamask = 0xffffffffUL;
-static struct platform_device nuc900_device_usb_ohci = {
-	.name		  = "nuc900-ohci",
-	.id		  = -1,
-	.num_resources	  = ARRAY_SIZE(nuc900_usb_ohci_resource),
-	.resource	  = nuc900_usb_ohci_resource,
-	.dev              = {
-		.dma_mask = &nuc900_device_usb_ohci_dmamask,
-		.coherent_dma_mask = 0xffffffffUL
-	}
-};
-
-/* USB Device (Gadget)*/
-
-static struct resource nuc900_usbgadget_resource[] = {
-	[0] = {
-		.start = W90X900_PA_USBDEV,
-		.end   = W90X900_PA_USBDEV + W90X900_SZ_USBDEV - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_USBD,
-		.end   = IRQ_USBD,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-static struct platform_device nuc900_device_usbgadget = {
-	.name		= "nuc900-usbgadget",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_usbgadget_resource),
-	.resource	= nuc900_usbgadget_resource,
-};
-
-/* MAC device */
-
-static struct resource nuc900_emc_resource[] = {
-	[0] = {
-		.start = W90X900_PA_EMC,
-		.end   = W90X900_PA_EMC + W90X900_SZ_EMC - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_EMCTX,
-		.end   = IRQ_EMCTX,
-		.flags = IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start = IRQ_EMCRX,
-		.end   = IRQ_EMCRX,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-static u64 nuc900_device_emc_dmamask = 0xffffffffUL;
-static struct platform_device nuc900_device_emc = {
-	.name		= "nuc900-emc",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_emc_resource),
-	.resource	= nuc900_emc_resource,
-	.dev              = {
-		.dma_mask = &nuc900_device_emc_dmamask,
-		.coherent_dma_mask = 0xffffffffUL
-	}
-};
-
-/* SPI device */
-
-static struct nuc900_spi_info nuc900_spiflash_data = {
-	.num_cs		= 1,
-	.lsb		= 0,
-	.txneg		= 1,
-	.rxneg		= 0,
-	.divider	= 24,
-	.sleep		= 0,
-	.txnum		= 0,
-	.txbitlen	= 8,
-	.bus_num	= 0,
-};
-
-static struct resource nuc900_spi_resource[] = {
-	[0] = {
-		.start = W90X900_PA_I2C + SPIOFFSET,
-		.end   = W90X900_PA_I2C + SPIOFFSET + SPIOREG_SIZE - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_SSP,
-		.end   = IRQ_SSP,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-static struct platform_device nuc900_device_spi = {
-	.name		= "nuc900-spi",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_spi_resource),
-	.resource	= nuc900_spi_resource,
-	.dev		= {
-				.platform_data = &nuc900_spiflash_data,
-			}
-};
-
-/* spi device, spi flash info */
-
-static struct mtd_partition nuc900_spi_flash_partitions[] = {
-	{
-		.name = "bootloader(spi)",
-		.size = 0x0100000,
-		.offset = 0,
-	},
-};
-
-static struct flash_platform_data nuc900_spi_flash_data = {
-	.name = "m25p80",
-	.parts =  nuc900_spi_flash_partitions,
-	.nr_parts = ARRAY_SIZE(nuc900_spi_flash_partitions),
-	.type = "w25x16",
-};
-
-static struct spi_board_info nuc900_spi_board_info[] __initdata = {
-	{
-		.modalias = "m25p80",
-		.max_speed_hz = 20000000,
-		.bus_num = 0,
-		.chip_select = 0,
-		.platform_data = &nuc900_spi_flash_data,
-		.mode = SPI_MODE_0,
-	},
-};
-
-/* WDT Device */
-
-static struct resource nuc900_wdt_resource[] = {
-	[0] = {
-		.start = W90X900_PA_TIMER,
-		.end   = W90X900_PA_TIMER + W90X900_SZ_TIMER - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_WDT,
-		.end   = IRQ_WDT,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-static struct platform_device nuc900_device_wdt = {
-	.name		= "nuc900-wdt",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_wdt_resource),
-	.resource	= nuc900_wdt_resource,
-};
-
-/*
- * public device definition between 910 and 920, or 910
- * and 950 or 950 and 960...,their dev platform register
- * should be in specific file such as nuc950, nuc960 c
- * files rather than the public dev.c file here. so the
- * corresponding platform_device definition should not be
- * static.
-*/
-
-/* RTC controller*/
-
-static struct resource nuc900_rtc_resource[] = {
-	[0] = {
-		.start = W90X900_PA_RTC,
-		.end   = W90X900_PA_RTC + 0xff,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_RTC,
-		.end   = IRQ_RTC,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device nuc900_device_rtc = {
-	.name		= "nuc900-rtc",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_rtc_resource),
-	.resource	= nuc900_rtc_resource,
-};
-
-/*TouchScreen controller*/
-
-static struct resource nuc900_ts_resource[] = {
-	[0] = {
-		.start = W90X900_PA_ADC,
-		.end   = W90X900_PA_ADC + W90X900_SZ_ADC-1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_ADC,
-		.end   = IRQ_ADC,
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device nuc900_device_ts = {
-	.name		= "nuc900-ts",
-	.id		= -1,
-	.resource	= nuc900_ts_resource,
-	.num_resources	= ARRAY_SIZE(nuc900_ts_resource),
-};
-
-/* FMI Device */
-
-static struct resource nuc900_fmi_resource[] = {
-	[0] = {
-		.start = W90X900_PA_FMI,
-		.end   = W90X900_PA_FMI + W90X900_SZ_FMI - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_FMI,
-		.end   = IRQ_FMI,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-struct platform_device nuc900_device_fmi = {
-	.name		= "nuc900-fmi",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_fmi_resource),
-	.resource	= nuc900_fmi_resource,
-};
-
-/* KPI controller*/
-
-static int nuc900_keymap[] = {
-	KEY(0, 0, KEY_A),
-	KEY(0, 1, KEY_B),
-	KEY(0, 2, KEY_C),
-	KEY(0, 3, KEY_D),
-
-	KEY(1, 0, KEY_E),
-	KEY(1, 1, KEY_F),
-	KEY(1, 2, KEY_G),
-	KEY(1, 3, KEY_H),
-
-	KEY(2, 0, KEY_I),
-	KEY(2, 1, KEY_J),
-	KEY(2, 2, KEY_K),
-	KEY(2, 3, KEY_L),
-
-	KEY(3, 0, KEY_M),
-	KEY(3, 1, KEY_N),
-	KEY(3, 2, KEY_O),
-	KEY(3, 3, KEY_P),
-};
-
-static struct matrix_keymap_data nuc900_map_data = {
-	.keymap			= nuc900_keymap,
-	.keymap_size		= ARRAY_SIZE(nuc900_keymap),
-};
-
-struct w90p910_keypad_platform_data nuc900_keypad_info = {
-	.keymap_data	= &nuc900_map_data,
-	.prescale	= 0xfa,
-	.debounce	= 0x50,
-};
-
-static struct resource nuc900_kpi_resource[] = {
-	[0] = {
-		.start = W90X900_PA_KPI,
-		.end   = W90X900_PA_KPI + W90X900_SZ_KPI - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_KPI,
-		.end   = IRQ_KPI,
-		.flags = IORESOURCE_IRQ,
-	}
-
-};
-
-struct platform_device nuc900_device_kpi = {
-	.name		= "nuc900-kpi",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_kpi_resource),
-	.resource	= nuc900_kpi_resource,
-	.dev		= {
-				.platform_data = &nuc900_keypad_info,
-			}
-};
-
-/* LCD controller*/
-
-static struct nuc900fb_display nuc900_lcd_info[] = {
-	/* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
-	[0] = {
-		.type		= LCM_DCCS_VA_SRC_RGB565,
-		.width		= 320,
-		.height		= 240,
-		.xres		= 320,
-		.yres		= 240,
-		.bpp		= 16,
-		.pixclock	= 200000,
-		.left_margin	= 34,
-		.right_margin   = 54,
-		.hsync_len	= 10,
-		.upper_margin	= 18,
-		.lower_margin	= 4,
-		.vsync_len	= 1,
-		.dccs		= 0x8e00041a,
-		.devctl		= 0x060800c0,
-		.fbctrl		= 0x00a000a0,
-		.scale		= 0x04000400,
-	},
-};
-
-static struct nuc900fb_mach_info nuc900_fb_info = {
-#if defined(CONFIG_GPM1040A0_320X240)
-	.displays		= &nuc900_lcd_info[0],
-#else
-	.displays		= nuc900_lcd_info,
-#endif
-	.num_displays		= ARRAY_SIZE(nuc900_lcd_info),
-	.default_display	= 0,
-	.gpio_dir		= 0x00000004,
-	.gpio_dir_mask		= 0xFFFFFFFD,
-	.gpio_data		= 0x00000004,
-	.gpio_data_mask		= 0xFFFFFFFD,
-};
-
-static struct resource nuc900_lcd_resource[] = {
-	[0] = {
-		.start = W90X900_PA_LCD,
-		.end   = W90X900_PA_LCD + W90X900_SZ_LCD - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_LCD,
-		.end   = IRQ_LCD,
-		.flags = IORESOURCE_IRQ,
-	}
-};
-
-static u64 nuc900_device_lcd_dmamask = -1;
-struct platform_device nuc900_device_lcd = {
-	.name             = "nuc900-lcd",
-	.id               = -1,
-	.num_resources    = ARRAY_SIZE(nuc900_lcd_resource),
-	.resource         = nuc900_lcd_resource,
-	.dev              = {
-		.dma_mask               = &nuc900_device_lcd_dmamask,
-		.coherent_dma_mask      = -1,
-		.platform_data = &nuc900_fb_info,
-	}
-};
-
-/* AUDIO controller*/
-static u64 nuc900_device_audio_dmamask = -1;
-static struct resource nuc900_ac97_resource[] = {
-	[0] = {
-		.start = W90X900_PA_ACTL,
-		.end   = W90X900_PA_ACTL + W90X900_SZ_ACTL - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.start = IRQ_ACTL,
-		.end   = IRQ_ACTL,
-		.flags = IORESOURCE_IRQ,
-	}
-
-};
-
-struct platform_device nuc900_device_ac97 = {
-	.name		= "nuc900-ac97",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(nuc900_ac97_resource),
-	.resource	= nuc900_ac97_resource,
-	.dev              = {
-		.dma_mask               = &nuc900_device_audio_dmamask,
-		.coherent_dma_mask      = -1,
-	}
-};
-
-/*Here should be your evb resourse,such as LCD*/
-
-static struct platform_device *nuc900_public_dev[] __initdata = {
-	&nuc900_serial_device,
-	&nuc900_flash_device,
-	&nuc900_device_usb_ehci,
-	&nuc900_device_usb_ohci,
-	&nuc900_device_usbgadget,
-	&nuc900_device_emc,
-	&nuc900_device_spi,
-	&nuc900_device_wdt,
-	&nuc900_device_ac97,
-};
-
-/* Provide adding specific CPU platform devices API */
-
-void __init nuc900_board_init(struct platform_device **device, int size)
-{
-	cpu_idle_poll_ctrl(true);
-	platform_add_devices(device, size);
-	platform_add_devices(nuc900_public_dev, ARRAY_SIZE(nuc900_public_dev));
-	spi_register_board_info(nuc900_spi_board_info,
-					ARRAY_SIZE(nuc900_spi_board_info));
-}
-
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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/gpio.c
- *
- * Generic nuc900 GPIO handling
- *
- *  Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/clk.h>
-#include <linux/errno.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/debugfs.h>
-#include <linux/seq_file.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
-#include <linux/module.h>
-#include <linux/io.h>
-#include <linux/gpio/driver.h>
-
-#include <mach/hardware.h>
-
-#define GPIO_BASE 		(W90X900_VA_GPIO)
-#define GPIO_DIR		(0x04)
-#define GPIO_OUT		(0x08)
-#define GPIO_IN			(0x0C)
-#define GROUPINERV		(0x10)
-#define GPIO_GPIO(Nb)		(0x00000001 << (Nb))
-
-#define NUC900_GPIO_CHIP(name, base_gpio, nr_gpio)			\
-	{								\
-		.chip = {						\
-			.label		  = name,			\
-			.direction_input  = nuc900_dir_input,		\
-			.direction_output = nuc900_dir_output,		\
-			.get		  = nuc900_gpio_get,		\
-			.set		  = nuc900_gpio_set,		\
-			.base		  = base_gpio,			\
-			.ngpio		  = nr_gpio,			\
-		}							\
-	}
-
-struct nuc900_gpio_chip {
-	struct gpio_chip	chip;
-	void __iomem		*regbase;	/* Base of group register*/
-	spinlock_t 		gpio_lock;
-};
-
-static int nuc900_gpio_get(struct gpio_chip *chip, unsigned offset)
-{
-	struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
-	void __iomem *pio = nuc900_gpio->regbase + GPIO_IN;
-	unsigned int regval;
-
-	regval = __raw_readl(pio);
-	regval &= GPIO_GPIO(offset);
-
-	return (regval != 0);
-}
-
-static void nuc900_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
-{
-	struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
-	void __iomem *pio = nuc900_gpio->regbase + GPIO_OUT;
-	unsigned int regval;
-	unsigned long flags;
-
-	spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
-
-	regval = __raw_readl(pio);
-
-	if (val)
-		regval |= GPIO_GPIO(offset);
-	else
-		regval &= ~GPIO_GPIO(offset);
-
-	__raw_writel(regval, pio);
-
-	spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
-}
-
-static int nuc900_dir_input(struct gpio_chip *chip, unsigned offset)
-{
-	struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
-	void __iomem *pio = nuc900_gpio->regbase + GPIO_DIR;
-	unsigned int regval;
-	unsigned long flags;
-
-	spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
-
-	regval = __raw_readl(pio);
-	regval &= ~GPIO_GPIO(offset);
-	__raw_writel(regval, pio);
-
-	spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
-
-	return 0;
-}
-
-static int nuc900_dir_output(struct gpio_chip *chip, unsigned offset, int val)
-{
-	struct nuc900_gpio_chip *nuc900_gpio = gpiochip_get_data(chip);
-	void __iomem *outreg = nuc900_gpio->regbase + GPIO_OUT;
-	void __iomem *pio = nuc900_gpio->regbase + GPIO_DIR;
-	unsigned int regval;
-	unsigned long flags;
-
-	spin_lock_irqsave(&nuc900_gpio->gpio_lock, flags);
-
-	regval = __raw_readl(pio);
-	regval |= GPIO_GPIO(offset);
-	__raw_writel(regval, pio);
-
-	regval = __raw_readl(outreg);
-
-	if (val)
-		regval |= GPIO_GPIO(offset);
-	else
-		regval &= ~GPIO_GPIO(offset);
-
-	__raw_writel(regval, outreg);
-
-	spin_unlock_irqrestore(&nuc900_gpio->gpio_lock, flags);
-
-	return 0;
-}
-
-static struct nuc900_gpio_chip nuc900_gpio[] = {
-	NUC900_GPIO_CHIP("GROUPC", 0, 16),
-	NUC900_GPIO_CHIP("GROUPD", 16, 10),
-	NUC900_GPIO_CHIP("GROUPE", 26, 14),
-	NUC900_GPIO_CHIP("GROUPF", 40, 10),
-	NUC900_GPIO_CHIP("GROUPG", 50, 17),
-	NUC900_GPIO_CHIP("GROUPH", 67, 8),
-	NUC900_GPIO_CHIP("GROUPI", 75, 17),
-};
-
-void __init nuc900_init_gpio(int nr_group)
-{
-	unsigned	i;
-	struct nuc900_gpio_chip *gpio_chip;
-
-	for (i = 0; i < nr_group; i++) {
-		gpio_chip = &nuc900_gpio[i];
-		spin_lock_init(&gpio_chip->gpio_lock);
-		gpio_chip->regbase = GPIO_BASE + i * GROUPINERV;
-		gpiochip_add_data(&gpio_chip->chip, gpio_chip);
-	}
-}
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 @@
-/*
- * arch/arm/mach-w90x900/include/mach/entry-macro.S
- *
- * Low-level IRQ helper macros for W90P910-based platforms
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- *
- */
-
-#include <mach/hardware.h>
-#include <mach/regs-irq.h>
-
-	.macro  get_irqnr_preamble, base, tmp
-	.endm
-
-	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
-
-		mov	\base, #AIC_BA
-
-		ldr	\irqnr, [\base, #AIC_IPER]
-		ldr	\irqnr, [\base, #AIC_ISNR]
-		cmp	\irqnr, #0
-
-	.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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-w90x900/include/mach/hardware.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/hardware.h
- */
-
-#ifndef __ASM_ARCH_HARDWARE_H
-#define __ASM_ARCH_HARDWARE_H
-
-#include <linux/sizes.h>
-#include <mach/map.h>
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/include/mach/irqs.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/irqs.h
- */
-
-#ifndef __ASM_ARCH_IRQS_H
-#define __ASM_ARCH_IRQS_H
-
-/*
- * we keep the first set of CPU IRQs out of the range of
- * the ISA space, so that the PC104 has them to itself
- * and we don't end up having to do horrible things to the
- * standard ISA drivers....
- *
- */
-
-#define W90X900_IRQ(x)	(x)
-
-/* Main cpu interrupts */
-
-#define IRQ_WDT		W90X900_IRQ(1)
-#define IRQ_GROUP0	W90X900_IRQ(2)
-#define IRQ_GROUP1	W90X900_IRQ(3)
-#define IRQ_ACTL	W90X900_IRQ(4)
-#define IRQ_LCD		W90X900_IRQ(5)
-#define IRQ_RTC		W90X900_IRQ(6)
-#define IRQ_UART0	W90X900_IRQ(7)
-#define IRQ_UART1	W90X900_IRQ(8)
-#define IRQ_UART2	W90X900_IRQ(9)
-#define IRQ_UART3	W90X900_IRQ(10)
-#define IRQ_UART4	W90X900_IRQ(11)
-#define IRQ_TIMER0	W90X900_IRQ(12)
-#define IRQ_TIMER1	W90X900_IRQ(13)
-#define IRQ_T_INT_GROUP	W90X900_IRQ(14)
-#define IRQ_USBH	W90X900_IRQ(15)
-#define IRQ_EMCTX	W90X900_IRQ(16)
-#define IRQ_EMCRX	W90X900_IRQ(17)
-#define IRQ_GDMAGROUP	W90X900_IRQ(18)
-#define IRQ_DMAC	W90X900_IRQ(19)
-#define IRQ_FMI		W90X900_IRQ(20)
-#define IRQ_USBD	W90X900_IRQ(21)
-#define IRQ_ATAPI	W90X900_IRQ(22)
-#define IRQ_G2D		W90X900_IRQ(23)
-#define IRQ_PCI		W90X900_IRQ(24)
-#define IRQ_SCGROUP	W90X900_IRQ(25)
-#define IRQ_I2CGROUP	W90X900_IRQ(26)
-#define IRQ_SSP		W90X900_IRQ(27)
-#define IRQ_PWM		W90X900_IRQ(28)
-#define IRQ_KPI		W90X900_IRQ(29)
-#define IRQ_P2SGROUP	W90X900_IRQ(30)
-#define IRQ_ADC		W90X900_IRQ(31)
-#define NR_IRQS		(IRQ_ADC+1)
-
-/*for irq group*/
-
-#define	IRQ_PS2_PORT0	0x10000000
-#define	IRQ_PS2_PORT1	0x20000000
-#define	IRQ_I2C_LINE0	0x04000000
-#define	IRQ_I2C_LINE1	0x08000000
-#define	IRQ_SC_CARD0	0x01000000
-#define	IRQ_SC_CARD1	0x02000000
-#define	IRQ_GDMA_CH0	0x00100000
-#define	IRQ_GDMA_CH1	0x00200000
-#define	IRQ_TIMER2	0x00010000
-#define	IRQ_TIMER3	0x00020000
-#define	IRQ_TIMER4	0x00040000
-#define	IRQ_GROUP0_IRQ0	0x00000001
-#define	IRQ_GROUP0_IRQ1	0x00000002
-#define	IRQ_GROUP0_IRQ2	0x00000004
-#define	IRQ_GROUP0_IRQ3	0x00000008
-#define	IRQ_GROUP1_IRQ4	0x00000010
-#define	IRQ_GROUP1_IRQ5	0x00000020
-#define	IRQ_GROUP1_IRQ6	0x00000040
-#define	IRQ_GROUP1_IRQ7	0x00000080
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/include/mach/map.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/map.h
- */
-
-#ifndef __ASM_ARCH_MAP_H
-#define __ASM_ARCH_MAP_H
-
-#ifndef __ASSEMBLY__
-#define W90X900_ADDR(x)		((void __iomem *)(0xF0000000 + (x)))
-#else
-#define W90X900_ADDR(x)		(0xF0000000 + (x))
-#endif
-
-#define AHB_IO_BASE		0xB0000000
-#define APB_IO_BASE		0xB8000000
-#define CLOCKPW_BASE		(APB_IO_BASE+0x200)
-#define AIC_IO_BASE		(APB_IO_BASE+0x2000)
-#define TIMER_IO_BASE		(APB_IO_BASE+0x1000)
-
-/*
- * interrupt controller is the first thing we put in, to make
- * the assembly code for the irq detection easier
- */
-#define W90X900_VA_IRQ		W90X900_ADDR(0x00000000)
-#define W90X900_PA_IRQ		(0xB8002000)
-#define W90X900_SZ_IRQ		SZ_4K
-
-#define W90X900_VA_GCR		W90X900_ADDR(0x08002000)
-#define W90X900_PA_GCR		(0xB0000000)
-#define W90X900_SZ_GCR		SZ_4K
-
-/* Clock and Power management */
-#define W90X900_VA_CLKPWR	(W90X900_VA_GCR+0x200)
-#define W90X900_PA_CLKPWR	(0xB0000200)
-#define W90X900_SZ_CLKPWR	SZ_4K
-
-/* EBI management */
-#define W90X900_VA_EBI		W90X900_ADDR(0x00001000)
-#define W90X900_PA_EBI		(0xB0001000)
-#define W90X900_SZ_EBI		SZ_4K
-
-/* UARTs */
-#define W90X900_VA_UART		W90X900_ADDR(0x08000000)
-#define W90X900_PA_UART		(0xB8000000)
-#define W90X900_SZ_UART		SZ_4K
-
-/* Timers */
-#define W90X900_VA_TIMER	W90X900_ADDR(0x08001000)
-#define W90X900_PA_TIMER	(0xB8001000)
-#define W90X900_SZ_TIMER	SZ_4K
-
-/* GPIO ports */
-#define W90X900_VA_GPIO		W90X900_ADDR(0x08003000)
-#define W90X900_PA_GPIO		(0xB8003000)
-#define W90X900_SZ_GPIO		SZ_4K
-
-/* GDMA control */
-#define W90X900_VA_GDMA		W90X900_ADDR(0x00004000)
-#define W90X900_PA_GDMA		(0xB0004000)
-#define W90X900_SZ_GDMA		SZ_4K
-
-/* USB host controller*/
-#define W90X900_VA_USBEHCIHOST	W90X900_ADDR(0x00005000)
-#define W90X900_PA_USBEHCIHOST	(0xB0005000)
-#define W90X900_SZ_USBEHCIHOST	SZ_4K
-
-#define W90X900_VA_USBOHCIHOST	W90X900_ADDR(0x00007000)
-#define W90X900_PA_USBOHCIHOST	(0xB0007000)
-#define W90X900_SZ_USBOHCIHOST	SZ_4K
-
-/* I2C hardware controller */
-#define W90X900_VA_I2C		W90X900_ADDR(0x08006000)
-#define W90X900_PA_I2C		(0xB8006000)
-#define W90X900_SZ_I2C		SZ_4K
-
-/* Keypad Interface*/
-#define W90X900_VA_KPI		W90X900_ADDR(0x08008000)
-#define W90X900_PA_KPI		(0xB8008000)
-#define W90X900_SZ_KPI		SZ_4K
-
-/* Smart card host*/
-#define W90X900_VA_SC		W90X900_ADDR(0x08005000)
-#define W90X900_PA_SC		(0xB8005000)
-#define W90X900_SZ_SC		SZ_4K
-
-/* LCD controller*/
-#define W90X900_VA_LCD		W90X900_ADDR(0x00008000)
-#define W90X900_PA_LCD		(0xB0008000)
-#define W90X900_SZ_LCD		SZ_4K
-
-/* 2D controller*/
-#define W90X900_VA_GE		W90X900_ADDR(0x0000B000)
-#define W90X900_PA_GE		(0xB000B000)
-#define W90X900_SZ_GE		SZ_4K
-
-/* ATAPI */
-#define W90X900_VA_ATAPI	W90X900_ADDR(0x0000A000)
-#define W90X900_PA_ATAPI	(0xB000A000)
-#define W90X900_SZ_ATAPI	SZ_4K
-
-/* ADC */
-#define W90X900_VA_ADC		W90X900_ADDR(0x0800A000)
-#define W90X900_PA_ADC		(0xB800A000)
-#define W90X900_SZ_ADC		SZ_4K
-
-/* PS2 Interface*/
-#define W90X900_VA_PS2		W90X900_ADDR(0x08009000)
-#define W90X900_PA_PS2		(0xB8009000)
-#define W90X900_SZ_PS2		SZ_4K
-
-/* RTC */
-#define W90X900_VA_RTC		W90X900_ADDR(0x08004000)
-#define W90X900_PA_RTC		(0xB8004000)
-#define W90X900_SZ_RTC		SZ_4K
-
-/* Pulse Width Modulation(PWM) Registers */
-#define W90X900_VA_PWM		W90X900_ADDR(0x08007000)
-#define W90X900_PA_PWM		(0xB8007000)
-#define W90X900_SZ_PWM		SZ_4K
-
-/* Audio Controller controller */
-#define W90X900_VA_ACTL		W90X900_ADDR(0x00009000)
-#define W90X900_PA_ACTL		(0xB0009000)
-#define W90X900_SZ_ACTL		SZ_4K
-
-/* DMA controller */
-#define W90X900_VA_DMA		W90X900_ADDR(0x0000c000)
-#define W90X900_PA_DMA		(0xB000c000)
-#define W90X900_SZ_DMA		SZ_4K
-
-/* FMI controller */
-#define W90X900_VA_FMI		W90X900_ADDR(0x0000d000)
-#define W90X900_PA_FMI		(0xB000d000)
-#define W90X900_SZ_FMI		SZ_4K
-
-/* USB Device port */
-#define W90X900_VA_USBDEV	W90X900_ADDR(0x00006000)
-#define W90X900_PA_USBDEV	(0xB0006000)
-#define W90X900_SZ_USBDEV	SZ_4K
-
-/* External MAC control*/
-#define W90X900_VA_EMC		W90X900_ADDR(0x00003000)
-#define W90X900_PA_EMC		(0xB0003000)
-#define W90X900_SZ_EMC		SZ_4K
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/include/mach/mfp.h
- *
- * Copyright (c) 2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/map.h
- */
-
-#ifndef __ASM_ARCH_MFP_H
-#define __ASM_ARCH_MFP_H
-
-extern void mfp_set_groupf(struct device *dev);
-extern void mfp_set_groupc(struct device *dev);
-extern void mfp_set_groupi(struct device *dev);
-extern void mfp_set_groupg(struct device *dev, const char *subname);
-extern void mfp_set_groupd(struct device *dev, const char *subname);
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-clock.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#ifndef __ASM_ARCH_REGS_CLOCK_H
-#define __ASM_ARCH_REGS_CLOCK_H
-
-/* Clock Control Registers  */
-#define CLK_BA		W90X900_VA_CLKPWR
-#define REG_CLKEN	(CLK_BA + 0x00)
-#define REG_CLKSEL	(CLK_BA + 0x04)
-#define REG_CLKDIV	(CLK_BA + 0x08)
-#define REG_PLLCON0	(CLK_BA + 0x0C)
-#define REG_PLLCON1	(CLK_BA + 0x10)
-#define REG_PMCON	(CLK_BA + 0x14)
-#define REG_IRQWAKECON	(CLK_BA + 0x18)
-#define REG_IRQWAKEFLAG	(CLK_BA + 0x1C)
-#define REG_IPSRST	(CLK_BA + 0x20)
-#define REG_CLKEN1	(CLK_BA + 0x24)
-#define REG_CLKDIV1	(CLK_BA + 0x28)
-
-/* Define PLL freq setting */
-#define PLL_DISABLE		0x12B63
-#define	PLL_66MHZ		0x2B63
-#define	PLL_100MHZ		0x4F64
-#define PLL_120MHZ		0x4F63
-#define	PLL_166MHZ		0x4124
-#define	PLL_200MHZ		0x4F24
-
-/* Define AHB:CPUFREQ ratio */
-#define	AHB_CPUCLK_1_1		0x00
-#define	AHB_CPUCLK_1_2		0x01
-#define	AHB_CPUCLK_1_4		0x02
-#define	AHB_CPUCLK_1_8		0x03
-
-/* Define APB:AHB ratio */
-#define APB_AHB_1_2		0x01
-#define APB_AHB_1_4		0x02
-#define APB_AHB_1_8		0x03
-
-/* Define clock skew */
-#define DEFAULTSKEW		0x48
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-irq.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/regs-irq.h
- */
-
-#ifndef ___ASM_ARCH_REGS_IRQ_H
-#define ___ASM_ARCH_REGS_IRQ_H
-
-/* Advance Interrupt Controller (AIC) Registers */
-
-#define AIC_BA    		W90X900_VA_IRQ
-
-#define REG_AIC_IRQSC		(AIC_BA+0x80)
-#define REG_AIC_GEN		(AIC_BA+0x84)
-#define REG_AIC_GASR		(AIC_BA+0x88)
-#define REG_AIC_GSCR		(AIC_BA+0x8C)
-#define REG_AIC_IRSR		(AIC_BA+0x100)
-#define REG_AIC_IASR		(AIC_BA+0x104)
-#define REG_AIC_ISR		(AIC_BA+0x108)
-#define REG_AIC_IPER		(AIC_BA+0x10C)
-#define REG_AIC_ISNR		(AIC_BA+0x110)
-#define REG_AIC_IMR		(AIC_BA+0x114)
-#define REG_AIC_OISR		(AIC_BA+0x118)
-#define REG_AIC_MECR		(AIC_BA+0x120)
-#define REG_AIC_MDCR		(AIC_BA+0x124)
-#define REG_AIC_SSCR		(AIC_BA+0x128)
-#define REG_AIC_SCCR		(AIC_BA+0x12C)
-#define REG_AIC_EOSCR		(AIC_BA+0x130)
-#define AIC_IPER		(0x10C)
-#define AIC_ISNR		(0x110)
-
-/*16-18 bits of REG_AIC_GEN define irq(2-4) group*/
-
-#define TIMER2_IRQ		(1 << 16)
-#define TIMER3_IRQ		(1 << 17)
-#define TIMER4_IRQ		(1 << 18)
-#define TIME_GROUP_IRQ		(TIMER2_IRQ|TIMER3_IRQ|TIMER4_IRQ)
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-serial.h
- *
- * Copyright (c) 2009 Nuvoton technology corporation
- * All rights reserved.
- *
- *  Description:
- *     Nuvoton Display, LCM Register list
- *  Author:  Wang Qiang (rurality.linux@gmail.com) 2009/12/11
- */
-
-
-#ifndef __ASM_ARM_W90X900_REGS_LDM_H
-#define __ASM_ARM_W90X900_REGS_LDM_H
-
-#include <mach/map.h>
-
-/* Display Controller Control/Status Register */
-#define REG_LCM_DCCS			(0x00)
-
-#define LCM_DCCS_ENG_RST		(1 << 0)
-#define LCM_DCCS_VA_EN			(1 << 1)
-#define LCM_DCCS_OSD_EN			(1 << 2)
-#define LCM_DCCS_DISP_OUT_EN		(1 << 3)
-#define LCM_DCCS_DISP_INT_EN		(1 << 4)
-#define LCM_DCCS_CMD_ON			(1 << 5)
-#define LCM_DCCS_FIELD_INTR		(1 << 6)
-#define LCM_DCCS_SINGLE			(1 << 7)
-
-enum LCM_DCCS_VA_SRC {
-	LCM_DCCS_VA_SRC_YUV422		= (0 << 8),
-	LCM_DCCS_VA_SRC_YCBCR422	= (1 << 8),
-	LCM_DCCS_VA_SRC_RGB888		= (2 << 8),
-	LCM_DCCS_VA_SRC_RGB666		= (3 << 8),
-	LCM_DCCS_VA_SRC_RGB565		= (4 << 8),
-	LCM_DCCS_VA_SRC_RGB444LOW	= (5 << 8),
-	LCM_DCCS_VA_SRC_RGB444HIGH 	= (7 << 8)
-};
-
-
-/* Display Device Control Register */
-#define REG_LCM_DEV_CTRL		(0x04)
-
-enum LCM_DEV_CTRL_SWAP_YCbCr {
-	LCM_DEV_CTRL_SWAP_UYVY		= (0 << 1),
-	LCM_DEV_CTRL_SWAP_YUYV		= (1 << 1),
-	LCM_DEV_CTRL_SWAP_VYUY		= (2 << 1),
-	LCM_DEV_CTRL_SWAP_YVYU		= (3 << 1)
-};
-
-enum LCM_DEV_CTRL_RGB_SHIFT {
-	LCM_DEV_CTRL_RGB_SHIFT_NOT 	= (0 << 3),
-	LCM_DEV_CTRL_RGB_SHIFT_ONECYCLE = (1 << 3),
-	LCM_DEV_CTRL_RGB_SHIFT_TWOCYCLE = (2 << 3),
-	LCM_DEV_CTRL_RGB_SHIFT_NOT_DEF	= (3 << 3)
-};
-
-enum LCM_DEV_CTRL_DEVICE {
-	LCM_DEV_CTRL_DEVICE_YUV422	= (0 << 5),
-	LCM_DEV_CTRL_DEVICE_YUV444	= (1 << 5),
-	LCM_DEV_CTRL_DEVICE_UNIPAC	= (4 << 5),
-	LCM_DEV_CTRL_DEVICE_SEIKO_EPSON	= (5 << 5),
-	LCM_DEV_CTRL_DEVICE_HIGH_COLOR	= (6 << 5),
-	LCM_DEV_CTRL_DEVICE_MPU		= (7 << 5)
-};
-
-#define LCM_DEV_CTRL_LCD_DDA		(8)
-#define LCM_DEV_CTRL_YUV2CCIR		(16)
-
-enum LCM_DEV_CTRL_LCD_SEL {
-	LCM_DEV_CTRL_LCD_SEL_RGB_GBR	= (0 << 17),
-	LCM_DEV_CTRL_LCD_SEL_BGR_RBG	= (1 << 17),
-	LCM_DEV_CTRL_LCD_SEL_GBR_RGB	= (2 << 17),
-	LCM_DEV_CTRL_LCD_SEL_RBG_BGR	= (3 << 17)
-};
-
-enum LCM_DEV_CTRL_FAL_D {
-	LCM_DEV_CTRL_FAL_D_FALLING	= (0 << 19),
-	LCM_DEV_CTRL_FAL_D_RISING	= (1 << 19),
-};
-
-enum LCM_DEV_CTRL_H_POL {
-	LCM_DEV_CTRL_H_POL_LOW		= (0 << 20),
-	LCM_DEV_CTRL_H_POL_HIGH		= (1 << 20),
-};
-
-enum LCM_DEV_CTRL_V_POL {
-	LCM_DEV_CTRL_V_POL_LOW		= (0 << 21),
-	LCM_DEV_CTRL_V_POL_HIGH		= (1 << 21),
-};
-
-enum LCM_DEV_CTRL_VR_LACE {
-	LCM_DEV_CTRL_VR_LACE_NINTERLACE	= (0 << 22),
-	LCM_DEV_CTRL_VR_LACE_INTERLACE	= (1 << 22),
-};
-
-enum LCM_DEV_CTRL_LACE {
-	LCM_DEV_CTRL_LACE_NINTERLACE	= (0 << 23),
-	LCM_DEV_CTRL_LACE_INTERLACE	= (1 << 23),
-};
-
-enum LCM_DEV_CTRL_RGB_SCALE {
-	LCM_DEV_CTRL_RGB_SCALE_4096 	= (0 << 24),
-	LCM_DEV_CTRL_RGB_SCALE_65536 	= (1 << 24),
-	LCM_DEV_CTRL_RGB_SCALE_262144 	= (2 << 24),
-	LCM_DEV_CTRL_RGB_SCALE_16777216 = (3 << 24),
-};
-
-enum LCM_DEV_CTRL_DBWORD {
-	LCM_DEV_CTRL_DBWORD_HALFWORD	= (0 << 26),
-	LCM_DEV_CTRL_DBWORD_FULLWORD	= (1 << 26),
-};
-
-enum LCM_DEV_CTRL_MPU68 {
-	LCM_DEV_CTRL_MPU68_80_SERIES	= (0 << 27),
-	LCM_DEV_CTRL_MPU68_68_SERIES	= (1 << 27),
-};
-
-enum LCM_DEV_CTRL_DE_POL {
-	LCM_DEV_CTRL_DE_POL_HIGH	= (0 << 28),
-	LCM_DEV_CTRL_DE_POL_LOW		= (1 << 28),
-};
-
-#define LCM_DEV_CTRL_CMD16		(29)
-#define LCM_DEV_CTRL_CM16t18		(30)
-#define LCM_DEV_CTRL_CMD_LOW		(31)
-
-/* MPU-Interface LCD Write Command */
-#define REG_LCM_MPU_CMD			(0x08)
-
-/* Interrupt Control/Status Register */
-#define REG_LCM_INT_CS			(0x0c)
-#define LCM_INT_CS_DISP_F_EN		(1 << 0)
-#define LCM_INT_CS_UNDERRUN_EN   	(1 << 1)
-#define LCM_INT_CS_BUS_ERROR_INT 	(1 << 28)
-#define LCM_INT_CS_UNDERRUN_INT  	(1 << 29)
-#define LCM_INT_CS_DISP_F_STATUS 	(1 << 30)
-#define LCM_INT_CS_DISP_F_INT		(1 << 31)
-
-/* CRTC Display Size Control Register */
-#define REG_LCM_CRTC_SIZE		(0x10)
-#define LCM_CRTC_SIZE_VTTVAL(x)		((x) << 16)
-#define LCM_CRTC_SIZE_HTTVAL(x)		((x) << 0)
-
-/* CRTC Display Enable End */
-#define REG_LCM_CRTC_DEND		(0x14)
-#define LCM_CRTC_DEND_VDENDVAL(x)	((x) << 16)
-#define LCM_CRTC_DEND_HDENDVAL(x)	((x) << 0)
-
-/* CRTC Internal Horizontal Retrace Control Register */
-#define REG_LCM_CRTC_HR			(0x18)
-#define LCM_CRTC_HR_EVAL(x)		((x) << 16)
-#define LCM_CRTC_HR_SVAL(x)		((x) << 0)
-
-/* CRTC Horizontal Sync Control Register */
-#define REG_LCM_CRTC_HSYNC		(0x1C)
-#define LCM_CRTC_HSYNC_SHIFTVAL(x)	((x) << 30)
-#define LCM_CRTC_HSYNC_EVAL(x)		((x) << 16)
-#define LCM_CRTC_HSYNC_SVAL(x)		((x) << 0)
-
-/* CRTC Internal Vertical Retrace Control Register */
-#define REG_LCM_CRTC_VR			(0x20)
-#define LCM_CRTC_VR_EVAL(x)		((x) << 16)
-#define LCM_CRTC_VR_SVAL(x)		((x) << 0)
-
-/* Video Stream Frame Buffer-0 Starting Address */
-#define REG_LCM_VA_BADDR0		(0x24)
-
-/* Video Stream Frame Buffer-1 Starting Address */
-#define REG_LCM_VA_BADDR1		(0x28)
-
-/* Video Stream Frame Buffer Control Register */
-#define REG_LCM_VA_FBCTRL		(0x2C)
-#define LCM_VA_FBCTRL_IO_REGION_HALF	(1 << 28)
-#define LCM_VA_FBCTRL_FIELD_DUAL  	(1 << 29)
-#define LCM_VA_FBCTRL_START_BUF 	(1 << 30)
-#define LCM_VA_FBCTRL_DB_EN		(1 << 31)
-
-/* Video Stream Scaling Control Register */
-#define REG_LCM_VA_SCALE		(0x30)
-#define LCM_VA_SCALE_XCOPY_INTERPOLATION (0 << 15)
-#define LCM_VA_SCALE_XCOPY_DUPLICATION	 (1 << 15)
-
-/* Image Stream Active Window Coordinates */
-#define REG_LCM_VA_WIN			(0x38)
-
-/* Image Stream Stuff Pixel */
-#define REG_LCM_VA_STUFF		(0x3C)
-
-/* OSD Window Starting Coordinates */
-#define REG_LCM_OSD_WINS		(0x40)
-
-/* OSD Window Ending Coordinates */
-#define REG_LCM_OSD_WINE		(0x44)
-
-/* OSD Stream Frame Buffer Starting Address */
-#define REG_LCM_OSD_BADDR		(0x48)
-
-/* OSD Stream Frame Buffer Control Register */
-#define REG_LCM_OSD_FBCTRL		(0x4c)
-
-/* OSD Overlay Control Register */
-#define REG_LCM_OSD_OVERLAY		(0x50)
-
-/* OSD Overlay Color-Key Pattern Register */
-#define REG_LCM_OSD_CKEY		(0x54)
-
-/* OSD Overlay Color-Key Mask Register */
-#define REG_LCM_OSD_CMASK		(0x58)
-
-/* OSD Window Skip1 Register */
-#define REG_LCM_OSD_SKIP1		(0x5C)
-
-/* OSD Window Skip2 Register */
-#define REG_LCM_OSD_SKIP2		(0x60)
-
-/* OSD horizontal up scaling control register */
-#define REG_LCM_OSD_SCALE		(0x64)
-
-/* MPU Vsync control register */
-#define REG_LCM_MPU_VSYNC		(0x68)
-
-/* Hardware cursor control Register */
-#define REG_LCM_HC_CTRL			(0x6C)
-
-/* Hardware cursot tip point potison on va picture */
-#define REG_LCM_HC_POS			(0x70)
-
-/* Hardware Cursor Window Buffer Control Register */
-#define REG_LCM_HC_WBCTRL		(0x74)
-
-/* Hardware cursor memory base address register */
-#define REG_LCM_HC_BADDR		(0x78)
-
-/* Hardware cursor color ram register mapped to bpp = 0 */
-#define REG_LCM_HC_COLOR0		(0x7C)
-
-/* Hardware cursor color ram register mapped to bpp = 1 */
-#define REG_LCM_HC_COLOR1		(0x80)
-
-/* Hardware cursor color ram register mapped to bpp = 2 */
-#define REG_LCM_HC_COLOR2		(0x84)
-
-/* Hardware cursor color ram register mapped to bpp = 3 */
-#define REG_LCM_HC_COLOR3		(0x88)
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-serial.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/regs-serial.h
- */
-
-#ifndef __ASM_ARM_REGS_SERIAL_H
-#define __ASM_ARM_REGS_SERIAL_H
-
-#define UART0_BA	W90X900_VA_UART
-#define UART1_BA	(W90X900_VA_UART+0x100)
-#define UART2_BA	(W90X900_VA_UART+0x200)
-#define UART3_BA	(W90X900_VA_UART+0x300)
-#define UART4_BA	(W90X900_VA_UART+0x400)
-
-#define UART0_PA	W90X900_PA_UART
-#define UART1_PA	(W90X900_PA_UART+0x100)
-#define UART2_PA	(W90X900_PA_UART+0x200)
-#define UART3_PA	(W90X900_PA_UART+0x300)
-#define UART4_PA	(W90X900_PA_UART+0x400)
-
-#ifndef __ASSEMBLY__
-
-struct w90x900_uart_clksrc {
-	const char	*name;
-	unsigned int	divisor;
-	unsigned int	min_baud;
-	unsigned int	max_baud;
-};
-
-struct w90x900_uartcfg {
-	unsigned char	hwport;
-	unsigned char	unused;
-	unsigned short	flags;
-	unsigned long	uart_flags;
-
-	unsigned long	ucon;
-	unsigned long	ulcon;
-	unsigned long	ufcon;
-
-	struct w90x900_uart_clksrc *clocks;
-	unsigned int	clocks_size;
-};
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_ARM_REGS_SERIAL_H */
-
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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-w90x900/include/mach/uncompress.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/uncompress.h
- */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
-/* Defines for UART registers */
-
-#include <mach/regs-serial.h>
-#include <mach/map.h>
-#include <linux/serial_reg.h>
-
-#define TX_DONE	(UART_LSR_TEMT | UART_LSR_THRE)
-static volatile u32 * const uart_base = (u32 *)UART0_PA;
-
-static inline void putc(int ch)
-{
-	/* Check THRE and TEMT bits before we transmit the character.
-	 */
-	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
-		barrier();
-
-	*uart_base = ch;
-}
-
-static inline void flush(void)
-{
-}
-
-static void arch_decomp_setup(void)
-{
-}
-
-#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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/irq.c
- *
- * based on linux/arch/arm/plat-s3c24xx/irq.c by Ben Dooks
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/ptrace.h>
-#include <linux/device.h>
-#include <linux/io.h>
-
-#include <asm/irq.h>
-#include <asm/mach/irq.h>
-
-#include <mach/hardware.h>
-#include <mach/regs-irq.h>
-
-#include "nuc9xx.h"
-
-struct group_irq {
-	unsigned long		gpen;
-	unsigned int		enabled;
-	void			(*enable)(struct group_irq *, int enable);
-};
-
-static DEFINE_SPINLOCK(groupirq_lock);
-
-#define DEFINE_GROUP(_name, _ctrlbit, _num)				\
-struct group_irq group_##_name = {					\
-		.enable		= nuc900_group_enable,			\
-		.gpen		= ((1 << _num) - 1) << _ctrlbit,	\
-	}
-
-static void nuc900_group_enable(struct group_irq *gpirq, int enable);
-
-static DEFINE_GROUP(nirq0, 0, 4);
-static DEFINE_GROUP(nirq1, 4, 4);
-static DEFINE_GROUP(usbh, 8, 2);
-static DEFINE_GROUP(ottimer, 16, 3);
-static DEFINE_GROUP(gdma, 20, 2);
-static DEFINE_GROUP(sc, 24, 2);
-static DEFINE_GROUP(i2c, 26, 2);
-static DEFINE_GROUP(ps2, 28, 2);
-
-static int group_irq_enable(struct group_irq *group_irq)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&groupirq_lock, flags);
-	if (group_irq->enabled++ == 0)
-		(group_irq->enable)(group_irq, 1);
-	spin_unlock_irqrestore(&groupirq_lock, flags);
-
-	return 0;
-}
-
-static void group_irq_disable(struct group_irq *group_irq)
-{
-	unsigned long flags;
-
-	WARN_ON(group_irq->enabled == 0);
-
-	spin_lock_irqsave(&groupirq_lock, flags);
-	if (--group_irq->enabled == 0)
-		(group_irq->enable)(group_irq, 0);
-	spin_unlock_irqrestore(&groupirq_lock, flags);
-}
-
-static void nuc900_group_enable(struct group_irq *gpirq, int enable)
-{
-	unsigned int groupen = gpirq->gpen;
-	unsigned long regval;
-
-	regval = __raw_readl(REG_AIC_GEN);
-
-	if (enable)
-		regval |= groupen;
-	else
-		regval &= ~groupen;
-
-	__raw_writel(regval, REG_AIC_GEN);
-}
-
-static void nuc900_irq_mask(struct irq_data *d)
-{
-	struct group_irq *group_irq;
-
-	group_irq = NULL;
-
-	__raw_writel(1 << d->irq, REG_AIC_MDCR);
-
-	switch (d->irq) {
-	case IRQ_GROUP0:
-		group_irq = &group_nirq0;
-		break;
-
-	case IRQ_GROUP1:
-		group_irq = &group_nirq1;
-		break;
-
-	case IRQ_USBH:
-		group_irq = &group_usbh;
-		break;
-
-	case IRQ_T_INT_GROUP:
-		group_irq = &group_ottimer;
-		break;
-
-	case IRQ_GDMAGROUP:
-		group_irq = &group_gdma;
-		break;
-
-	case IRQ_SCGROUP:
-		group_irq = &group_sc;
-		break;
-
-	case IRQ_I2CGROUP:
-		group_irq = &group_i2c;
-		break;
-
-	case IRQ_P2SGROUP:
-		group_irq = &group_ps2;
-		break;
-	}
-
-	if (group_irq)
-		group_irq_disable(group_irq);
-}
-
-/*
- * By the w90p910 spec,any irq,only write 1
- * to REG_AIC_EOSCR for ACK
- */
-
-static void nuc900_irq_ack(struct irq_data *d)
-{
-	__raw_writel(0x01, REG_AIC_EOSCR);
-}
-
-static void nuc900_irq_unmask(struct irq_data *d)
-{
-	struct group_irq *group_irq;
-
-	group_irq = NULL;
-
-	__raw_writel(1 << d->irq, REG_AIC_MECR);
-
-	switch (d->irq) {
-	case IRQ_GROUP0:
-		group_irq = &group_nirq0;
-		break;
-
-	case IRQ_GROUP1:
-		group_irq = &group_nirq1;
-		break;
-
-	case IRQ_USBH:
-		group_irq = &group_usbh;
-		break;
-
-	case IRQ_T_INT_GROUP:
-		group_irq = &group_ottimer;
-		break;
-
-	case IRQ_GDMAGROUP:
-		group_irq = &group_gdma;
-		break;
-
-	case IRQ_SCGROUP:
-		group_irq = &group_sc;
-		break;
-
-	case IRQ_I2CGROUP:
-		group_irq = &group_i2c;
-		break;
-
-	case IRQ_P2SGROUP:
-		group_irq = &group_ps2;
-		break;
-	}
-
-	if (group_irq)
-		group_irq_enable(group_irq);
-}
-
-static struct irq_chip nuc900_irq_chip = {
-	.irq_ack	= nuc900_irq_ack,
-	.irq_mask	= nuc900_irq_mask,
-	.irq_unmask	= nuc900_irq_unmask,
-};
-
-void __init nuc900_init_irq(void)
-{
-	int irqno;
-
-	__raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
-
-	for (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) {
-		irq_set_chip_and_handler(irqno, &nuc900_irq_chip,
-					 handle_level_irq);
-		irq_clear_status_flags(irqno, IRQ_NOREQUEST);
-	}
-}
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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/mach-nuc910evb.c
- *
- * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
- *
- * Copyright (C) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/platform_device.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach-types.h>
-#include <mach/map.h>
-
-#include "nuc910.h"
-
-static void __init nuc910evb_map_io(void)
-{
-	nuc910_map_io();
-	nuc910_init_clocks();
-}
-
-static void __init nuc910evb_init(void)
-{
-	nuc910_board_init();
-}
-
-MACHINE_START(W90P910EVB, "W90P910EVB")
-	/* Maintainer: Wan ZongShun */
-	.map_io		= nuc910evb_map_io,
-	.init_irq	= nuc900_init_irq,
-	.init_machine	= nuc910evb_init,
-	.init_time	= nuc900_timer_init,
-	.restart	= nuc9xx_restart,
-MACHINE_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/mach-nuc950evb.c
- *
- * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
- *
- * Copyright (C) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- *   history:
- *     Wang Qiang (rurality.linux@gmail.com) add LCD support
- */
-
-#include <linux/platform_device.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach-types.h>
-#include <mach/map.h>
-#include <linux/platform_data/video-nuc900fb.h>
-
-#include "nuc950.h"
-
-static void __init nuc950evb_map_io(void)
-{
-	nuc950_map_io();
-	nuc950_init_clocks();
-}
-
-static void __init nuc950evb_init(void)
-{
-	nuc950_board_init();
-}
-
-MACHINE_START(W90P950EVB, "W90P950EVB")
-	/* Maintainer: Wan ZongShun */
-	.map_io		= nuc950evb_map_io,
-	.init_irq	= nuc900_init_irq,
-	.init_machine	= nuc950evb_init,
-	.init_time	= nuc900_timer_init,
-	.restart	= nuc9xx_restart,
-MACHINE_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/mach-nuc960evb.c
- *
- * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
- *
- * Copyright (C) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/platform_device.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach-types.h>
-#include <mach/map.h>
-
-#include "nuc960.h"
-
-static void __init nuc960evb_map_io(void)
-{
-	nuc960_map_io();
-	nuc960_init_clocks();
-}
-
-static void __init nuc960evb_init(void)
-{
-	nuc960_board_init();
-}
-
-MACHINE_START(W90N960EVB, "W90N960EVB")
-	/* Maintainer: Wan ZongShun */
-	.map_io		= nuc960evb_map_io,
-	.init_irq	= nuc900_init_irq,
-	.init_machine	= nuc960evb_init,
-	.init_time	= nuc900_timer_init,
-	.restart	= nuc9xx_restart,
-MACHINE_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/mfp.c
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/device.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/string.h>
-#include <linux/clk.h>
-#include <linux/mutex.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-
-#define REG_MFSEL	(W90X900_VA_GCR + 0xC)
-
-#define GPSELF		(0x01 << 1)
-#define GPSELC		(0x03 << 2)
-#define GPSELD		(0x0f << 4)
-
-#define GPSELEI0	(0x01 << 26)
-#define GPSELEI1	(0x01 << 27)
-
-#define GPIOG0TO1	(0x03 << 14)
-#define GPIOG2TO3	(0x03 << 16)
-#define GPIOG22TO23	(0x03 << 22)
-#define GPIOG18TO20	(0x07 << 18)
-
-#define ENSPI		(0x0a << 14)
-#define ENI2C0		(0x01 << 14)
-#define ENI2C1		(0x01 << 16)
-#define ENAC97		(0x02 << 22)
-#define ENSD1		(0x02 << 18)
-#define ENSD0		(0x0a << 4)
-#define ENKPI		(0x02 << 2)
-#define ENNAND		(0x01 << 2)
-
-static DEFINE_MUTEX(mfp_mutex);
-
-void mfp_set_groupf(struct device *dev)
-{
-	unsigned long mfpen;
-	const char *dev_id;
-
-	BUG_ON(!dev);
-
-	mutex_lock(&mfp_mutex);
-
-	dev_id = dev_name(dev);
-
-	mfpen = __raw_readl(REG_MFSEL);
-
-	if (strcmp(dev_id, "nuc900-emc") == 0)
-		mfpen |= GPSELF;/*enable mac*/
-	else
-		mfpen &= ~GPSELF;/*GPIOF[9:0]*/
-
-	__raw_writel(mfpen, REG_MFSEL);
-
-	mutex_unlock(&mfp_mutex);
-}
-EXPORT_SYMBOL(mfp_set_groupf);
-
-void mfp_set_groupc(struct device *dev)
-{
-	unsigned long mfpen;
-	const char *dev_id;
-
-	BUG_ON(!dev);
-
-	mutex_lock(&mfp_mutex);
-
-	dev_id = dev_name(dev);
-
-	mfpen = __raw_readl(REG_MFSEL);
-
-	if (strcmp(dev_id, "nuc900-lcd") == 0)
-		mfpen |= GPSELC;/*enable lcd*/
-	else if (strcmp(dev_id, "nuc900-kpi") == 0) {
-		mfpen &= (~GPSELC);/*enable kpi*/
-		mfpen |= ENKPI;
-	} else if (strcmp(dev_id, "nuc900-nand") == 0) {
-		mfpen &= (~GPSELC);/*enable nand*/
-		mfpen |= ENNAND;
-	} else
-		mfpen &= (~GPSELC);/*GPIOC[14:0]*/
-
-	__raw_writel(mfpen, REG_MFSEL);
-
-	mutex_unlock(&mfp_mutex);
-}
-EXPORT_SYMBOL(mfp_set_groupc);
-
-void mfp_set_groupi(struct device *dev)
-{
-	unsigned long mfpen;
-	const char *dev_id;
-
-	BUG_ON(!dev);
-
-	mutex_lock(&mfp_mutex);
-
-	dev_id = dev_name(dev);
-
-	mfpen = __raw_readl(REG_MFSEL);
-
-	mfpen &= ~GPSELEI1;/*default gpio16*/
-
-	if (strcmp(dev_id, "nuc900-wdog") == 0)
-		mfpen |= GPSELEI1;/*enable wdog*/
-	else if (strcmp(dev_id, "nuc900-atapi") == 0)
-		mfpen |= GPSELEI0;/*enable atapi*/
-	else if (strcmp(dev_id, "nuc900-keypad") == 0)
-		mfpen &= ~GPSELEI0;/*enable keypad*/
-
-	__raw_writel(mfpen, REG_MFSEL);
-
-	mutex_unlock(&mfp_mutex);
-}
-EXPORT_SYMBOL(mfp_set_groupi);
-
-void mfp_set_groupg(struct device *dev, const char *subname)
-{
-	unsigned long mfpen;
-	const char *dev_id;
-
-	BUG_ON((!dev) && (!subname));
-
-	mutex_lock(&mfp_mutex);
-
-	if (subname != NULL)
-		dev_id = subname;
-	else
-		dev_id = dev_name(dev);
-
-	mfpen = __raw_readl(REG_MFSEL);
-
-	if (strcmp(dev_id, "nuc900-spi") == 0) {
-		mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);
-		mfpen |= ENSPI;/*enable spi*/
-	} else if (strcmp(dev_id, "nuc900-i2c0") == 0) {
-		mfpen &= ~(GPIOG0TO1);
-		mfpen |= ENI2C0;/*enable i2c0*/
-	} else if (strcmp(dev_id, "nuc900-i2c1") == 0) {
-		mfpen &= ~(GPIOG2TO3);
-		mfpen |= ENI2C1;/*enable i2c1*/
-	} else if (strcmp(dev_id, "nuc900-ac97") == 0) {
-		mfpen &= ~(GPIOG22TO23);
-		mfpen |= ENAC97;/*enable AC97*/
-	} else if (strcmp(dev_id, "nuc900-mmc-port1") == 0) {
-		mfpen &= ~(GPIOG18TO20);
-		mfpen |= (ENSD1 | 0x01);/*enable sd1*/
-	} else {
-		mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/
-	}
-
-	__raw_writel(mfpen, REG_MFSEL);
-
-	mutex_unlock(&mfp_mutex);
-}
-EXPORT_SYMBOL(mfp_set_groupg);
-
-void mfp_set_groupd(struct device *dev, const char *subname)
-{
-	unsigned long mfpen;
-	const char *dev_id;
-
-	BUG_ON((!dev) && (!subname));
-
-	mutex_lock(&mfp_mutex);
-
-	if (subname != NULL)
-		dev_id = subname;
-	else
-		dev_id = dev_name(dev);
-
-	mfpen = __raw_readl(REG_MFSEL);
-
-	if (strcmp(dev_id, "nuc900-mmc-port0") == 0) {
-		mfpen &= ~GPSELD;/*enable sd0*/
-		mfpen |= ENSD0;
-	} else
-		mfpen &= (~GPSELD);
-
-	__raw_writel(mfpen, REG_MFSEL);
-
-	mutex_unlock(&mfp_mutex);
-}
-EXPORT_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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/nuc910.c
- *
- * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
- *
- * Copyright (c) 2009 Nuvoton corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * NUC910 cpu support
- */
-
-#include <linux/platform_device.h>
-#include <asm/mach/map.h>
-#include <mach/hardware.h>
-#include "cpu.h"
-#include "clock.h"
-
-/* define specific CPU platform device */
-
-static struct platform_device *nuc910_dev[] __initdata = {
-	&nuc900_device_ts,
-	&nuc900_device_rtc,
-	&nuc900_device_lcd,
-	&nuc900_device_kpi,
-};
-
-/* define specific CPU platform io map */
-
-static struct map_desc nuc910evb_iodesc[] __initdata = {
-	IODESC_ENT(USBEHCIHOST),
-	IODESC_ENT(USBOHCIHOST),
-	IODESC_ENT(KPI),
-	IODESC_ENT(USBDEV),
-	IODESC_ENT(ADC),
-};
-
-/*Init NUC910 evb io*/
-
-void __init nuc910_map_io(void)
-{
-	nuc900_map_io(nuc910evb_iodesc, ARRAY_SIZE(nuc910evb_iodesc));
-}
-
-/*Init NUC910 clock*/
-
-void __init nuc910_init_clocks(void)
-{
-	nuc900_init_clocks();
-}
-
-/*Init NUC910 board info*/
-
-void __init nuc910_board_init(void)
-{
-	nuc900_board_init(nuc910_dev, ARRAY_SIZE(nuc910_dev));
-}
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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/nuc910.h
- *
- * Copyright (c) 2008 Nuvoton corporation
- *
- * Header file for NUC900 CPU support
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-#include "nuc9xx.h"
-
-/* extern file from nuc910.c */
-
-extern void nuc910_board_init(void);
-extern void nuc910_init_clocks(void);
-extern 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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/nuc950.c
- *
- * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * NUC950 cpu support
- */
-
-#include <linux/platform_device.h>
-#include <asm/mach/map.h>
-#include <mach/hardware.h>
-
-#include "cpu.h"
-
-/* define specific CPU platform device */
-
-static struct platform_device *nuc950_dev[] __initdata = {
-	&nuc900_device_kpi,
-	&nuc900_device_fmi,
-	&nuc900_device_lcd,
-};
-
-/* define specific CPU platform io map */
-
-static struct map_desc nuc950evb_iodesc[] __initdata = {
-};
-
-/*Init NUC950 evb io*/
-
-void __init nuc950_map_io(void)
-{
-	nuc900_map_io(nuc950evb_iodesc, ARRAY_SIZE(nuc950evb_iodesc));
-}
-
-/*Init NUC950 clock*/
-
-void __init nuc950_init_clocks(void)
-{
-	nuc900_init_clocks();
-}
-
-/*Init NUC950 board info*/
-
-void __init nuc950_board_init(void)
-{
-	nuc900_board_init(nuc950_dev, ARRAY_SIZE(nuc950_dev));
-}
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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/nuc950.h
- *
- * Copyright (c) 2008 Nuvoton corporation
- *
- * Header file for NUC900 CPU support
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-#include "nuc9xx.h"
-
-/* extern file from nuc950.c */
-
-extern void nuc950_board_init(void);
-extern void nuc950_init_clocks(void);
-extern 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 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * linux/arch/arm/mach-w90x900/nuc960.c
- *
- * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * NUC960 cpu support
- */
-
-#include <linux/platform_device.h>
-#include <asm/mach/map.h>
-#include <mach/hardware.h>
-#include "cpu.h"
-
-/* define specific CPU platform device */
-
-static struct platform_device *nuc960_dev[] __initdata = {
-	&nuc900_device_kpi,
-	&nuc900_device_fmi,
-};
-
-/* define specific CPU platform io map */
-
-static struct map_desc nuc960evb_iodesc[] __initdata = {
-};
-
-/*Init NUC960 evb io*/
-
-void __init nuc960_map_io(void)
-{
-	nuc900_map_io(nuc960evb_iodesc, ARRAY_SIZE(nuc960evb_iodesc));
-}
-
-/*Init NUC960 clock*/
-
-void __init nuc960_init_clocks(void)
-{
-	nuc900_init_clocks();
-}
-
-/*Init NUC960 board info*/
-
-void __init nuc960_board_init(void)
-{
-	nuc900_board_init(nuc960_dev, ARRAY_SIZE(nuc960_dev));
-}
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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/nuc960.h
- *
- * Copyright (c) 2008 Nuvoton corporation
- *
- * Header file for NUC900 CPU support
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-#include "nuc9xx.h"
-
-/* extern file from nuc960.c */
-
-extern void nuc960_board_init(void);
-extern void nuc960_init_clocks(void);
-extern 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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/nuc9xx.h
- *
- * Copied from nuc910.h, which had:
- *
- * Copyright (c) 2008 Nuvoton corporation
- *
- * Header file for NUC900 CPU support
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/reboot.h>
-
-struct map_desc;
-
-/* core initialisation functions */
-
-extern void nuc900_init_irq(void);
-extern void nuc900_timer_init(void);
-extern 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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-ebi.h
- *
- * Copyright (c) 2009 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#ifndef __ASM_ARCH_REGS_EBI_H
-#define __ASM_ARCH_REGS_EBI_H
-
-/* EBI Control Registers */
-
-#define EBI_BA		W90X900_VA_EBI
-#define REG_EBICON	(EBI_BA + 0x00)
-#define REG_ROMCON	(EBI_BA + 0x04)
-#define REG_SDCONF0	(EBI_BA + 0x08)
-#define REG_SDCONF1	(EBI_BA + 0x0C)
-#define REG_SDTIME0	(EBI_BA + 0x10)
-#define REG_SDTIME1	(EBI_BA + 0x14)
-#define REG_EXT0CON	(EBI_BA + 0x18)
-#define REG_EXT1CON	(EBI_BA + 0x1C)
-#define REG_EXT2CON	(EBI_BA + 0x20)
-#define REG_EXT3CON	(EBI_BA + 0x24)
-#define REG_EXT4CON	(EBI_BA + 0x28)
-#define REG_CKSKEW	(EBI_BA + 0x2C)
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-gcr.h
- *
- * Copyright (c) 2010 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#ifndef __ASM_ARCH_REGS_GCR_H
-#define __ASM_ARCH_REGS_GCR_H
-
-/* Global control registers */
-
-#define GCR_BA		W90X900_VA_GCR
-#define REG_PDID	(GCR_BA+0x000)
-#define REG_PWRON	(GCR_BA+0x004)
-#define REG_ARBCON	(GCR_BA+0x008)
-#define REG_MFSEL	(GCR_BA+0x00C)
-#define REG_EBIDPE	(GCR_BA+0x010)
-#define REG_LCDDPE	(GCR_BA+0x014)
-#define REG_GPIOCPE	(GCR_BA+0x018)
-#define REG_GPIODPE	(GCR_BA+0x01C)
-#define REG_GPIOEPE	(GCR_BA+0x020)
-#define REG_GPIOFPE	(GCR_BA+0x024)
-#define REG_GPIOGPE	(GCR_BA+0x028)
-#define REG_GPIOHPE	(GCR_BA+0x02C)
-#define REG_GPIOIPE	(GCR_BA+0x030)
-#define REG_GTMP1	(GCR_BA+0x034)
-#define REG_GTMP2	(GCR_BA+0x038)
-#define REG_GTMP3	(GCR_BA+0x03C)
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-timer.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/regs-timer.h
- */
-
-#ifndef __ASM_ARCH_REGS_TIMER_H
-#define __ASM_ARCH_REGS_TIMER_H
-
-/* Timer Registers */
-
-#define TMR_BA			W90X900_VA_TIMER
-#define REG_TCSR0		(TMR_BA+0x00)
-#define REG_TCSR1		(TMR_BA+0x04)
-#define REG_TICR0		(TMR_BA+0x08)
-#define REG_TICR1		(TMR_BA+0x0C)
-#define REG_TDR0		(TMR_BA+0x10)
-#define REG_TDR1		(TMR_BA+0x14)
-#define REG_TISR		(TMR_BA+0x18)
-#define REG_WTCR		(TMR_BA+0x1C)
-#define REG_TCSR2		(TMR_BA+0x20)
-#define REG_TCSR3		(TMR_BA+0x24)
-#define REG_TICR2		(TMR_BA+0x28)
-#define REG_TICR3		(TMR_BA+0x2C)
-#define REG_TDR2		(TMR_BA+0x30)
-#define REG_TDR3		(TMR_BA+0x34)
-#define REG_TCSR4		(TMR_BA+0x40)
-#define REG_TICR4		(TMR_BA+0x48)
-#define REG_TDR4		(TMR_BA+0x50)
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * arch/arm/mach-w90x900/include/mach/regs-usb.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#ifndef __ASM_ARCH_REGS_USB_H
-#define __ASM_ARCH_REGS_USB_H
-
-/* usb Control Registers  */
-#define USBH_BA		W90X900_VA_USBEHCIHOST
-#define USBD_BA		W90X900_VA_USBDEV
-#define USBO_BA		W90X900_VA_USBOHCIHOST
-
-/* USB Host Control Registers */
-#define REG_UPSCR0	(USBH_BA+0x064)
-#define REG_UPSCR1	(USBH_BA+0x068)
-#define REG_USBPCR0	(USBH_BA+0x0C4)
-#define REG_USBPCR1	(USBH_BA+0x0C8)
-
-/* USBH OHCI Control Registers */
-#define REG_OpModEn	(USBO_BA+0x204)
-/*This bit controls the polarity of over
-*current flag from external power IC.
-*/
-#define OCALow		0x08
-
-#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 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * linux/arch/arm/mach-w90x900/time.c
- *
- * Based on linux/arch/arm/plat-s3c24xx/time.c by Ben Dooks
- *
- * Copyright (c) 2009 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/err.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/leds.h>
-#include <linux/clocksource.h>
-#include <linux/clockchips.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/irq.h>
-#include <asm/mach/time.h>
-
-#include <mach/map.h>
-#include "regs-timer.h"
-
-#include "nuc9xx.h"
-
-#define RESETINT	0x1f
-#define PERIOD		(0x01 << 27)
-#define ONESHOT		(0x00 << 27)
-#define COUNTEN		(0x01 << 30)
-#define INTEN		(0x01 << 29)
-
-#define TICKS_PER_SEC	100
-#define PRESCALE	0x63 /* Divider = prescale + 1 */
-
-#define	TDR_SHIFT	24
-
-static unsigned int timer0_load;
-
-static int nuc900_clockevent_shutdown(struct clock_event_device *evt)
-{
-	unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
-
-	__raw_writel(val, REG_TCSR0);
-	return 0;
-}
-
-static int nuc900_clockevent_set_oneshot(struct clock_event_device *evt)
-{
-	unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
-
-	val |= (ONESHOT | COUNTEN | INTEN | PRESCALE);
-
-	__raw_writel(val, REG_TCSR0);
-	return 0;
-}
-
-static int nuc900_clockevent_set_periodic(struct clock_event_device *evt)
-{
-	unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
-
-	__raw_writel(timer0_load, REG_TICR0);
-	val |= (PERIOD | COUNTEN | INTEN | PRESCALE);
-	__raw_writel(val, REG_TCSR0);
-	return 0;
-}
-
-static int nuc900_clockevent_setnextevent(unsigned long evt,
-		struct clock_event_device *clk)
-{
-	unsigned int val;
-
-	__raw_writel(evt, REG_TICR0);
-
-	val = __raw_readl(REG_TCSR0);
-	val |= (COUNTEN | INTEN | PRESCALE);
-	__raw_writel(val, REG_TCSR0);
-
-	return 0;
-}
-
-static struct clock_event_device nuc900_clockevent_device = {
-	.name			= "nuc900-timer0",
-	.features		= CLOCK_EVT_FEAT_PERIODIC |
-				  CLOCK_EVT_FEAT_ONESHOT,
-	.set_state_shutdown	= nuc900_clockevent_shutdown,
-	.set_state_periodic	= nuc900_clockevent_set_periodic,
-	.set_state_oneshot	= nuc900_clockevent_set_oneshot,
-	.tick_resume		= nuc900_clockevent_shutdown,
-	.set_next_event		= nuc900_clockevent_setnextevent,
-	.rating			= 300,
-};
-
-/*IRQ handler for the timer*/
-
-static irqreturn_t nuc900_timer0_interrupt(int irq, void *dev_id)
-{
-	struct clock_event_device *evt = &nuc900_clockevent_device;
-
-	__raw_writel(0x01, REG_TISR); /* clear TIF0 */
-
-	evt->event_handler(evt);
-	return IRQ_HANDLED;
-}
-
-static struct irqaction nuc900_timer0_irq = {
-	.name		= "nuc900-timer0",
-	.flags		= IRQF_TIMER | IRQF_IRQPOLL,
-	.handler	= nuc900_timer0_interrupt,
-};
-
-static void __init nuc900_clockevents_init(void)
-{
-	unsigned int rate;
-	struct clk *clk = clk_get(NULL, "timer0");
-
-	BUG_ON(IS_ERR(clk));
-
-	__raw_writel(0x00, REG_TCSR0);
-
-	clk_enable(clk);
-	rate = clk_get_rate(clk) / (PRESCALE + 1);
-
-	timer0_load = (rate / TICKS_PER_SEC);
-
-	__raw_writel(RESETINT, REG_TISR);
-	setup_irq(IRQ_TIMER0, &nuc900_timer0_irq);
-
-	nuc900_clockevent_device.cpumask = cpumask_of(0);
-
-	clockevents_config_and_register(&nuc900_clockevent_device, rate,
-					0xf, 0xffffffff);
-}
-
-static void __init nuc900_clocksource_init(void)
-{
-	unsigned int val;
-	unsigned int rate;
-	struct clk *clk = clk_get(NULL, "timer1");
-
-	BUG_ON(IS_ERR(clk));
-
-	__raw_writel(0x00, REG_TCSR1);
-
-	clk_enable(clk);
-	rate = clk_get_rate(clk) / (PRESCALE + 1);
-
-	__raw_writel(0xffffffff, REG_TICR1);
-
-	val = __raw_readl(REG_TCSR1);
-	val |= (COUNTEN | PERIOD | PRESCALE);
-	__raw_writel(val, REG_TCSR1);
-
-	clocksource_mmio_init(REG_TDR1, "nuc900-timer1", rate, 200,
-		TDR_SHIFT, clocksource_mmio_readl_down);
-}
-
-void __init nuc900_timer_init(void)
-{
-	nuc900_clocksource_init();
-	nuc900_clockevents_init();
-}
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH 04/16] watchdog: remove ks8695 driver
  2019-08-09 20:27 ` [PATCH 04/16] watchdog: " Arnd Bergmann
@ 2019-08-09 20:42   ` Guenter Roeck
  2019-08-10  8:37     ` Arnd Bergmann
  0 siblings, 1 reply; 37+ messages in thread
From: Guenter Roeck @ 2019-08-09 20:42 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: soc, Wim Van Sebroeck, Jonathan Corbet, linux-watchdog,
	linux-doc, linux-kernel

On Fri, Aug 09, 2019 at 10:27:32PM +0200, Arnd Bergmann wrote:
> The platform is getting removed, so there are no remaining
> users of this driver.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Guenter Roeck <linux@roeck-us.net>

Please let me know if this should be applied through the watchdog tree.
For now I'll assume it will be applied together with the rest of the
series.

> ---
>  .../watchdog/watchdog-parameters.rst          |   9 -
>  drivers/watchdog/Kconfig                      |   7 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/ks8695_wdt.c                 | 319 ------------------
>  4 files changed, 336 deletions(-)
>  delete mode 100644 drivers/watchdog/ks8695_wdt.c
> 
> diff --git a/Documentation/watchdog/watchdog-parameters.rst b/Documentation/watchdog/watchdog-parameters.rst
> index a3985cc5aeda..226aba56f704 100644
> --- a/Documentation/watchdog/watchdog-parameters.rst
> +++ b/Documentation/watchdog/watchdog-parameters.rst
> @@ -301,15 +301,6 @@ ixp4xx_wdt:
>  
>  -------------------------------------------------
>  
> -ks8695_wdt:
> -    wdt_time:
> -	Watchdog time in seconds. (default=5)
> -    nowayout:
> -	Watchdog cannot be stopped once started
> -	(default=kernel config parameter)
> -
> --------------------------------------------------
> -
>  machzwd:
>      nowayout:
>  	Watchdog cannot be stopped once started
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 8188963a405b..e631f1ae303a 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -477,13 +477,6 @@ config IXP4XX_WATCHDOG
>  
>  	  Say N if you are unsure.
>  
> -config KS8695_WATCHDOG
> -	tristate "KS8695 watchdog"
> -	depends on ARCH_KS8695
> -	help
> -	  Watchdog timer embedded into KS8695 processor. This will reboot your
> -	  system when the timeout is reached.
> -
>  config HAVE_S3C2410_WATCHDOG
>  	bool
>  	help
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 7caa920e7e60..85f55ec76f8d 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -49,7 +49,6 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
>  obj-$(CONFIG_977_WATCHDOG) += wdt977.o
>  obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o
>  obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
> -obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
>  obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
>  obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
>  obj-$(CONFIG_SAMA5D4_WATCHDOG) += sama5d4_wdt.o
> diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c
> deleted file mode 100644
> index 1550ce3c5702..000000000000
> --- a/drivers/watchdog/ks8695_wdt.c
> +++ /dev/null
> @@ -1,319 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Watchdog driver for Kendin/Micrel KS8695.
> - *
> - * (C) 2007 Andrew Victor
> - */
> -
> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> -
> -#include <linux/bitops.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
> -#include <linux/init.h>
> -#include <linux/kernel.h>
> -#include <linux/miscdevice.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/platform_device.h>
> -#include <linux/types.h>
> -#include <linux/watchdog.h>
> -#include <linux/io.h>
> -#include <linux/uaccess.h>
> -#include <mach/hardware.h>
> -
> -#define KS8695_TMR_OFFSET	(0xF0000 + 0xE400)
> -#define KS8695_TMR_VA		(KS8695_IO_VA + KS8695_TMR_OFFSET)
> -
> -/*
> - * Timer registers
> - */
> -#define KS8695_TMCON		(0x00)		/* Timer Control Register */
> -#define KS8695_T0TC		(0x08)		/* Timer 0 Timeout Count Register */
> -#define TMCON_T0EN		(1 << 0)	/* Timer 0 Enable */
> -
> -/* Timer0 Timeout Counter Register */
> -#define T0TC_WATCHDOG		(0xff)		/* Enable watchdog mode */
> -
> -#define WDT_DEFAULT_TIME	5	/* seconds */
> -#define WDT_MAX_TIME		171	/* seconds */
> -
> -static int wdt_time = WDT_DEFAULT_TIME;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(wdt_time, int, 0);
> -MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="
> -					__MODULE_STRING(WDT_DEFAULT_TIME) ")");
> -
> -#ifdef CONFIG_WATCHDOG_NOWAYOUT
> -module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -#endif
> -
> -
> -static unsigned long ks8695wdt_busy;
> -static DEFINE_SPINLOCK(ks8695_lock);
> -
> -/* ......................................................................... */
> -
> -/*
> - * Disable the watchdog.
> - */
> -static inline void ks8695_wdt_stop(void)
> -{
> -	unsigned long tmcon;
> -
> -	spin_lock(&ks8695_lock);
> -	/* disable timer0 */
> -	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
> -	__raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -	spin_unlock(&ks8695_lock);
> -}
> -
> -/*
> - * Enable and reset the watchdog.
> - */
> -static inline void ks8695_wdt_start(void)
> -{
> -	unsigned long tmcon;
> -	unsigned long tval = wdt_time * KS8695_CLOCK_RATE;
> -
> -	spin_lock(&ks8695_lock);
> -	/* disable timer0 */
> -	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
> -	__raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/* program timer0 */
> -	__raw_writel(tval | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
> -
> -	/* re-enable timer0 */
> -	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
> -	__raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -	spin_unlock(&ks8695_lock);
> -}
> -
> -/*
> - * Reload the watchdog timer.  (ie, pat the watchdog)
> - */
> -static inline void ks8695_wdt_reload(void)
> -{
> -	unsigned long tmcon;
> -
> -	spin_lock(&ks8695_lock);
> -	/* disable, then re-enable timer0 */
> -	tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
> -	__raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -	__raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -	spin_unlock(&ks8695_lock);
> -}
> -
> -/*
> - * Change the watchdog time interval.
> - */
> -static int ks8695_wdt_settimeout(int new_time)
> -{
> -	/*
> -	 * All counting occurs at KS8695_CLOCK_RATE / 128 = 0.256 Hz
> -	 *
> -	 * Since WDV is a 16-bit counter, the maximum period is
> -	 * 65536 / 0.256 = 256 seconds.
> -	 */
> -	if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
> -		return -EINVAL;
> -
> -	/* Set new watchdog time. It will be used when
> -	   ks8695_wdt_start() is called. */
> -	wdt_time = new_time;
> -	return 0;
> -}
> -
> -/* ......................................................................... */
> -
> -/*
> - * Watchdog device is opened, and watchdog starts running.
> - */
> -static int ks8695_wdt_open(struct inode *inode, struct file *file)
> -{
> -	if (test_and_set_bit(0, &ks8695wdt_busy))
> -		return -EBUSY;
> -
> -	ks8695_wdt_start();
> -	return stream_open(inode, file);
> -}
> -
> -/*
> - * Close the watchdog device.
> - * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also
> - *  disabled.
> - */
> -static int ks8695_wdt_close(struct inode *inode, struct file *file)
> -{
> -	/* Disable the watchdog when file is closed */
> -	if (!nowayout)
> -		ks8695_wdt_stop();
> -	clear_bit(0, &ks8695wdt_busy);
> -	return 0;
> -}
> -
> -static const struct watchdog_info ks8695_wdt_info = {
> -	.identity	= "ks8695 watchdog",
> -	.options	= WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
> -};
> -
> -/*
> - * Handle commands from user-space.
> - */
> -static long ks8695_wdt_ioctl(struct file *file, unsigned int cmd,
> -							unsigned long arg)
> -{
> -	void __user *argp = (void __user *)arg;
> -	int __user *p = argp;
> -	int new_value;
> -
> -	switch (cmd) {
> -	case WDIOC_GETSUPPORT:
> -		return copy_to_user(argp, &ks8695_wdt_info,
> -					sizeof(ks8695_wdt_info)) ? -EFAULT : 0;
> -	case WDIOC_GETSTATUS:
> -	case WDIOC_GETBOOTSTATUS:
> -		return put_user(0, p);
> -	case WDIOC_SETOPTIONS:
> -		if (get_user(new_value, p))
> -			return -EFAULT;
> -		if (new_value & WDIOS_DISABLECARD)
> -			ks8695_wdt_stop();
> -		if (new_value & WDIOS_ENABLECARD)
> -			ks8695_wdt_start();
> -		return 0;
> -	case WDIOC_KEEPALIVE:
> -		ks8695_wdt_reload();	/* pat the watchdog */
> -		return 0;
> -	case WDIOC_SETTIMEOUT:
> -		if (get_user(new_value, p))
> -			return -EFAULT;
> -		if (ks8695_wdt_settimeout(new_value))
> -			return -EINVAL;
> -		/* Enable new time value */
> -		ks8695_wdt_start();
> -		/* Return current value */
> -		return put_user(wdt_time, p);
> -	case WDIOC_GETTIMEOUT:
> -		return put_user(wdt_time, p);
> -	default:
> -		return -ENOTTY;
> -	}
> -}
> -
> -/*
> - * Pat the watchdog whenever device is written to.
> - */
> -static ssize_t ks8695_wdt_write(struct file *file, const char *data,
> -						size_t len, loff_t *ppos)
> -{
> -	ks8695_wdt_reload();		/* pat the watchdog */
> -	return len;
> -}
> -
> -/* ......................................................................... */
> -
> -static const struct file_operations ks8695wdt_fops = {
> -	.owner		= THIS_MODULE,
> -	.llseek		= no_llseek,
> -	.unlocked_ioctl	= ks8695_wdt_ioctl,
> -	.open		= ks8695_wdt_open,
> -	.release	= ks8695_wdt_close,
> -	.write		= ks8695_wdt_write,
> -};
> -
> -static struct miscdevice ks8695wdt_miscdev = {
> -	.minor		= WATCHDOG_MINOR,
> -	.name		= "watchdog",
> -	.fops		= &ks8695wdt_fops,
> -};
> -
> -static int ks8695wdt_probe(struct platform_device *pdev)
> -{
> -	int res;
> -
> -	if (ks8695wdt_miscdev.parent)
> -		return -EBUSY;
> -	ks8695wdt_miscdev.parent = &pdev->dev;
> -
> -	res = misc_register(&ks8695wdt_miscdev);
> -	if (res)
> -		return res;
> -
> -	pr_info("KS8695 Watchdog Timer enabled (%d seconds%s)\n",
> -		wdt_time, nowayout ? ", nowayout" : "");
> -	return 0;
> -}
> -
> -static int ks8695wdt_remove(struct platform_device *pdev)
> -{
> -	misc_deregister(&ks8695wdt_miscdev);
> -	ks8695wdt_miscdev.parent = NULL;
> -
> -	return 0;
> -}
> -
> -static void ks8695wdt_shutdown(struct platform_device *pdev)
> -{
> -	ks8695_wdt_stop();
> -}
> -
> -#ifdef CONFIG_PM
> -
> -static int ks8695wdt_suspend(struct platform_device *pdev, pm_message_t message)
> -{
> -	ks8695_wdt_stop();
> -	return 0;
> -}
> -
> -static int ks8695wdt_resume(struct platform_device *pdev)
> -{
> -	if (ks8695wdt_busy)
> -		ks8695_wdt_start();
> -	return 0;
> -}
> -
> -#else
> -#define ks8695wdt_suspend NULL
> -#define ks8695wdt_resume	NULL
> -#endif
> -
> -static struct platform_driver ks8695wdt_driver = {
> -	.probe		= ks8695wdt_probe,
> -	.remove		= ks8695wdt_remove,
> -	.shutdown	= ks8695wdt_shutdown,
> -	.suspend	= ks8695wdt_suspend,
> -	.resume		= ks8695wdt_resume,
> -	.driver		= {
> -		.name	= "ks8695_wdt",
> -	},
> -};
> -
> -static int __init ks8695_wdt_init(void)
> -{
> -	/* Check that the heartbeat value is within range;
> -	   if not reset to the default */
> -	if (ks8695_wdt_settimeout(wdt_time)) {
> -		ks8695_wdt_settimeout(WDT_DEFAULT_TIME);
> -		pr_info("ks8695_wdt: wdt_time value must be 1 <= wdt_time <= %i"
> -					", using %d\n", wdt_time, WDT_MAX_TIME);
> -	}
> -	return platform_driver_register(&ks8695wdt_driver);
> -}
> -
> -static void __exit ks8695_wdt_exit(void)
> -{
> -	platform_driver_unregister(&ks8695wdt_driver);
> -}
> -
> -module_init(ks8695_wdt_init);
> -module_exit(ks8695_wdt_exit);
> -
> -MODULE_AUTHOR("Andrew Victor");
> -MODULE_DESCRIPTION("Watchdog driver for KS8695");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:ks8695_wdt");
> -- 
> 2.20.0
> 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 06/16] watchdog: remove w90x900 driver
  2019-08-09 20:27 ` [PATCH 06/16] watchdog: remove w90x900 driver Arnd Bergmann
@ 2019-08-09 20:42   ` Guenter Roeck
  0 siblings, 0 replies; 37+ messages in thread
From: Guenter Roeck @ 2019-08-09 20:42 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: soc, Wim Van Sebroeck, Jonathan Corbet, linux-watchdog,
	linux-doc, linux-kernel

On Fri, Aug 09, 2019 at 10:27:34PM +0200, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../watchdog/watchdog-parameters.rst          |  10 -
>  drivers/watchdog/Kconfig                      |   9 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/nuc900_wdt.c                 | 302 ------------------
>  4 files changed, 322 deletions(-)
>  delete mode 100644 drivers/watchdog/nuc900_wdt.c
> 
> diff --git a/Documentation/watchdog/watchdog-parameters.rst b/Documentation/watchdog/watchdog-parameters.rst
> index 226aba56f704..223c99361a30 100644
> --- a/Documentation/watchdog/watchdog-parameters.rst
> +++ b/Documentation/watchdog/watchdog-parameters.rst
> @@ -366,16 +366,6 @@ nic7018_wdt:
>  
>  -------------------------------------------------
>  
> -nuc900_wdt:
> -    heartbeat:
> -	Watchdog heartbeats in seconds.
> -	(default = 15)
> -    nowayout:
> -	Watchdog cannot be stopped once started
> -	(default=kernel config parameter)
> -
> --------------------------------------------------
> -
>  omap_wdt:
>      timer_margin:
>  	initial watchdog timeout (in seconds)
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index e631f1ae303a..0e64f501ef30 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -655,15 +655,6 @@ config STMP3XXX_RTC_WATCHDOG
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called stmp3xxx_rtc_wdt.
>  
> -config NUC900_WATCHDOG
> -	tristate "Nuvoton NUC900 watchdog"
> -	depends on ARCH_W90X900 || COMPILE_TEST
> -	help
> -	  Say Y here if to include support for the watchdog timer
> -	  for the Nuvoton NUC900 series SoCs.
> -	  To compile this driver as a module, choose M here: the
> -	  module will be called nuc900_wdt.
> -
>  config TS4800_WATCHDOG
>  	tristate "TS-4800 Watchdog"
>  	depends on HAS_IOMEM && OF
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 85f55ec76f8d..b5a0aed537af 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -63,7 +63,6 @@ obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
>  obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
>  obj-$(CONFIG_NPCM7XX_WATCHDOG) += npcm_wdt.o
>  obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
> -obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
>  obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
>  obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
>  obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
> diff --git a/drivers/watchdog/nuc900_wdt.c b/drivers/watchdog/nuc900_wdt.c
> deleted file mode 100644
> index db124cebe838..000000000000
> --- a/drivers/watchdog/nuc900_wdt.c
> +++ /dev/null
> @@ -1,302 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Copyright (c) 2009 Nuvoton technology corporation.
> - *
> - * Wan ZongShun <mcuos.com@gmail.com>
> - */
> -
> -#include <linux/bitops.h>
> -#include <linux/errno.h>
> -#include <linux/fs.h>
> -#include <linux/io.h>
> -#include <linux/clk.h>
> -#include <linux/kernel.h>
> -#include <linux/miscdevice.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/platform_device.h>
> -#include <linux/slab.h>
> -#include <linux/interrupt.h>
> -#include <linux/types.h>
> -#include <linux/watchdog.h>
> -#include <linux/uaccess.h>
> -
> -#define REG_WTCR		0x1c
> -#define WTCLK			(0x01 << 10)
> -#define WTE			(0x01 << 7)	/*wdt enable*/
> -#define WTIS			(0x03 << 4)
> -#define WTIF			(0x01 << 3)
> -#define WTRF			(0x01 << 2)
> -#define WTRE			(0x01 << 1)
> -#define WTR			(0x01 << 0)
> -/*
> - * The watchdog time interval can be calculated via following formula:
> - * WTIS		real time interval (formula)
> - * 0x00		((2^ 14 ) * ((external crystal freq) / 256))seconds
> - * 0x01		((2^ 16 ) * ((external crystal freq) / 256))seconds
> - * 0x02		((2^ 18 ) * ((external crystal freq) / 256))seconds
> - * 0x03		((2^ 20 ) * ((external crystal freq) / 256))seconds
> - *
> - * The external crystal freq is 15Mhz in the nuc900 evaluation board.
> - * So 0x00 = +-0.28 seconds, 0x01 = +-1.12 seconds, 0x02 = +-4.48 seconds,
> - * 0x03 = +- 16.92 seconds..
> - */
> -#define WDT_HW_TIMEOUT		0x02
> -#define WDT_TIMEOUT		(HZ/2)
> -#define WDT_HEARTBEAT		15
> -
> -static int heartbeat = WDT_HEARTBEAT;
> -module_param(heartbeat, int, 0);
> -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. "
> -	"(default = " __MODULE_STRING(WDT_HEARTBEAT) ")");
> -
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
> -	"(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -struct nuc900_wdt {
> -	struct clk	 *wdt_clock;
> -	struct platform_device *pdev;
> -	void __iomem	 *wdt_base;
> -	char		 expect_close;
> -	struct timer_list timer;
> -	spinlock_t       wdt_lock;
> -	unsigned long next_heartbeat;
> -};
> -
> -static unsigned long nuc900wdt_busy;
> -static struct nuc900_wdt *nuc900_wdt;
> -
> -static inline void nuc900_wdt_keepalive(void)
> -{
> -	unsigned int val;
> -
> -	spin_lock(&nuc900_wdt->wdt_lock);
> -
> -	val = __raw_readl(nuc900_wdt->wdt_base + REG_WTCR);
> -	val |= (WTR | WTIF);
> -	__raw_writel(val, nuc900_wdt->wdt_base + REG_WTCR);
> -
> -	spin_unlock(&nuc900_wdt->wdt_lock);
> -}
> -
> -static inline void nuc900_wdt_start(void)
> -{
> -	unsigned int val;
> -
> -	spin_lock(&nuc900_wdt->wdt_lock);
> -
> -	val = __raw_readl(nuc900_wdt->wdt_base + REG_WTCR);
> -	val |= (WTRE | WTE | WTR | WTCLK | WTIF);
> -	val &= ~WTIS;
> -	val |= (WDT_HW_TIMEOUT << 0x04);
> -	__raw_writel(val, nuc900_wdt->wdt_base + REG_WTCR);
> -
> -	spin_unlock(&nuc900_wdt->wdt_lock);
> -
> -	nuc900_wdt->next_heartbeat = jiffies + heartbeat * HZ;
> -	mod_timer(&nuc900_wdt->timer, jiffies + WDT_TIMEOUT);
> -}
> -
> -static inline void nuc900_wdt_stop(void)
> -{
> -	unsigned int val;
> -
> -	del_timer(&nuc900_wdt->timer);
> -
> -	spin_lock(&nuc900_wdt->wdt_lock);
> -
> -	val = __raw_readl(nuc900_wdt->wdt_base + REG_WTCR);
> -	val &= ~WTE;
> -	__raw_writel(val, nuc900_wdt->wdt_base + REG_WTCR);
> -
> -	spin_unlock(&nuc900_wdt->wdt_lock);
> -}
> -
> -static inline void nuc900_wdt_ping(void)
> -{
> -	nuc900_wdt->next_heartbeat = jiffies + heartbeat * HZ;
> -}
> -
> -static int nuc900_wdt_open(struct inode *inode, struct file *file)
> -{
> -
> -	if (test_and_set_bit(0, &nuc900wdt_busy))
> -		return -EBUSY;
> -
> -	nuc900_wdt_start();
> -
> -	return stream_open(inode, file);
> -}
> -
> -static int nuc900_wdt_close(struct inode *inode, struct file *file)
> -{
> -	if (nuc900_wdt->expect_close == 42)
> -		nuc900_wdt_stop();
> -	else {
> -		dev_crit(&nuc900_wdt->pdev->dev,
> -			"Unexpected close, not stopping watchdog!\n");
> -		nuc900_wdt_ping();
> -	}
> -
> -	nuc900_wdt->expect_close = 0;
> -	clear_bit(0, &nuc900wdt_busy);
> -	return 0;
> -}
> -
> -static const struct watchdog_info nuc900_wdt_info = {
> -	.identity	= "nuc900 watchdog",
> -	.options	= WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
> -						WDIOF_MAGICCLOSE,
> -};
> -
> -static long nuc900_wdt_ioctl(struct file *file,
> -					unsigned int cmd, unsigned long arg)
> -{
> -	void __user *argp = (void __user *)arg;
> -	int __user *p = argp;
> -	int new_value;
> -
> -	switch (cmd) {
> -	case WDIOC_GETSUPPORT:
> -		return copy_to_user(argp, &nuc900_wdt_info,
> -				sizeof(nuc900_wdt_info)) ? -EFAULT : 0;
> -	case WDIOC_GETSTATUS:
> -	case WDIOC_GETBOOTSTATUS:
> -		return put_user(0, p);
> -
> -	case WDIOC_KEEPALIVE:
> -		nuc900_wdt_ping();
> -		return 0;
> -
> -	case WDIOC_SETTIMEOUT:
> -		if (get_user(new_value, p))
> -			return -EFAULT;
> -
> -		heartbeat = new_value;
> -		nuc900_wdt_ping();
> -
> -		return put_user(new_value, p);
> -	case WDIOC_GETTIMEOUT:
> -		return put_user(heartbeat, p);
> -	default:
> -		return -ENOTTY;
> -	}
> -}
> -
> -static ssize_t nuc900_wdt_write(struct file *file, const char __user *data,
> -						size_t len, loff_t *ppos)
> -{
> -	if (!len)
> -		return 0;
> -
> -	/* Scan for magic character */
> -	if (!nowayout) {
> -		size_t i;
> -
> -		nuc900_wdt->expect_close = 0;
> -
> -		for (i = 0; i < len; i++) {
> -			char c;
> -			if (get_user(c, data + i))
> -				return -EFAULT;
> -			if (c == 'V') {
> -				nuc900_wdt->expect_close = 42;
> -				break;
> -			}
> -		}
> -	}
> -
> -	nuc900_wdt_ping();
> -	return len;
> -}
> -
> -static void nuc900_wdt_timer_ping(struct timer_list *unused)
> -{
> -	if (time_before(jiffies, nuc900_wdt->next_heartbeat)) {
> -		nuc900_wdt_keepalive();
> -		mod_timer(&nuc900_wdt->timer, jiffies + WDT_TIMEOUT);
> -	} else
> -		dev_warn(&nuc900_wdt->pdev->dev, "Will reset the machine !\n");
> -}
> -
> -static const struct file_operations nuc900wdt_fops = {
> -	.owner		= THIS_MODULE,
> -	.llseek		= no_llseek,
> -	.unlocked_ioctl	= nuc900_wdt_ioctl,
> -	.open		= nuc900_wdt_open,
> -	.release	= nuc900_wdt_close,
> -	.write		= nuc900_wdt_write,
> -};
> -
> -static struct miscdevice nuc900wdt_miscdev = {
> -	.minor		= WATCHDOG_MINOR,
> -	.name		= "watchdog",
> -	.fops		= &nuc900wdt_fops,
> -};
> -
> -static int nuc900wdt_probe(struct platform_device *pdev)
> -{
> -	int ret = 0;
> -
> -	nuc900_wdt = devm_kzalloc(&pdev->dev, sizeof(*nuc900_wdt),
> -				GFP_KERNEL);
> -	if (!nuc900_wdt)
> -		return -ENOMEM;
> -
> -	nuc900_wdt->pdev = pdev;
> -
> -	spin_lock_init(&nuc900_wdt->wdt_lock);
> -
> -	nuc900_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(nuc900_wdt->wdt_base))
> -		return PTR_ERR(nuc900_wdt->wdt_base);
> -
> -	nuc900_wdt->wdt_clock = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(nuc900_wdt->wdt_clock)) {
> -		dev_err(&pdev->dev, "failed to find watchdog clock source\n");
> -		return PTR_ERR(nuc900_wdt->wdt_clock);
> -	}
> -
> -	clk_enable(nuc900_wdt->wdt_clock);
> -
> -	timer_setup(&nuc900_wdt->timer, nuc900_wdt_timer_ping, 0);
> -
> -	ret = misc_register(&nuc900wdt_miscdev);
> -	if (ret) {
> -		dev_err(&pdev->dev, "err register miscdev on minor=%d (%d)\n",
> -			WATCHDOG_MINOR, ret);
> -		goto err_clk;
> -	}
> -
> -	return 0;
> -
> -err_clk:
> -	clk_disable(nuc900_wdt->wdt_clock);
> -	return ret;
> -}
> -
> -static int nuc900wdt_remove(struct platform_device *pdev)
> -{
> -	misc_deregister(&nuc900wdt_miscdev);
> -
> -	clk_disable(nuc900_wdt->wdt_clock);
> -
> -	return 0;
> -}
> -
> -static struct platform_driver nuc900wdt_driver = {
> -	.probe		= nuc900wdt_probe,
> -	.remove		= nuc900wdt_remove,
> -	.driver		= {
> -		.name	= "nuc900-wdt",
> -	},
> -};
> -
> -module_platform_driver(nuc900wdt_driver);
> -
> -MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
> -MODULE_DESCRIPTION("Watchdog driver for NUC900");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:nuc900-wdt");
> -- 
> 2.20.0
> 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 10/16] Input: remove w90x900 keyboard driver
  2019-08-09 20:27 ` [PATCH 10/16] Input: remove w90x900 keyboard driver Arnd Bergmann
@ 2019-08-09 21:56   ` Dmitry Torokhov
  0 siblings, 0 replies; 37+ messages in thread
From: Dmitry Torokhov @ 2019-08-09 21:56 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: soc, linux-kernel, linux-input

On Fri, Aug 09, 2019 at 10:27:38PM +0200, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thank you.

> ---
>  drivers/input/keyboard/Kconfig               |  11 -
>  drivers/input/keyboard/Makefile              |   1 -
>  drivers/input/keyboard/w90p910_keypad.c      | 264 -------------------
>  include/linux/platform_data/keypad-w90p910.h |  16 --
>  4 files changed, 292 deletions(-)
>  delete mode 100644 drivers/input/keyboard/w90p910_keypad.c
>  delete mode 100644 include/linux/platform_data/keypad-w90p910.h
> 
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index 8e9c3ea9d5e7..c1da129a4eb5 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -731,17 +731,6 @@ config KEYBOARD_XTKBD
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called xtkbd.
>  
> -config KEYBOARD_W90P910
> -	tristate "W90P910 Matrix Keypad support"
> -	depends on ARCH_W90X900
> -	select INPUT_MATRIXKMAP
> -	help
> -	  Say Y here to enable the matrix keypad on evaluation board
> -	  based on W90P910.
> -
> -	  To compile this driver as a module, choose M here: the
> -	  module will be called w90p910_keypad.
> -
>  config KEYBOARD_CROS_EC
>  	tristate "ChromeOS EC keyboard"
>  	select INPUT_MATRIXKMAP
> diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
> index 06a0af6efeae..9510325c0c5d 100644
> --- a/drivers/input/keyboard/Makefile
> +++ b/drivers/input/keyboard/Makefile
> @@ -68,4 +68,3 @@ obj-$(CONFIG_KEYBOARD_TEGRA)		+= tegra-kbc.o
>  obj-$(CONFIG_KEYBOARD_TM2_TOUCHKEY)	+= tm2-touchkey.o
>  obj-$(CONFIG_KEYBOARD_TWL4030)		+= twl4030_keypad.o
>  obj-$(CONFIG_KEYBOARD_XTKBD)		+= xtkbd.o
> -obj-$(CONFIG_KEYBOARD_W90P910)		+= w90p910_keypad.o
> diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c
> deleted file mode 100644
> index c88d05d6108a..000000000000
> --- a/drivers/input/keyboard/w90p910_keypad.c
> +++ /dev/null
> @@ -1,264 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Copyright (c) 2008-2009 Nuvoton technology corporation.
> - *
> - * Wan ZongShun <mcuos.com@gmail.com>
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/interrupt.h>
> -#include <linux/input.h>
> -#include <linux/device.h>
> -#include <linux/platform_device.h>
> -#include <linux/clk.h>
> -#include <linux/err.h>
> -#include <linux/io.h>
> -#include <linux/slab.h>
> -
> -#include <linux/platform_data/keypad-w90p910.h>
> -
> -/* Keypad Interface Control Registers */
> -#define KPI_CONF		0x00
> -#define KPI_3KCONF		0x04
> -#define KPI_LPCONF		0x08
> -#define KPI_STATUS		0x0C
> -
> -#define IS1KEY			(0x01 << 16)
> -#define INTTR			(0x01 << 21)
> -#define KEY0R			(0x0f << 3)
> -#define KEY0C			0x07
> -#define DEBOUNCE_BIT		0x08
> -#define KSIZE0			(0x01 << 16)
> -#define KSIZE1			(0x01 << 17)
> -#define KPSEL			(0x01 << 19)
> -#define ENKP			(0x01 << 18)
> -
> -#define KGET_RAW(n)		(((n) & KEY0R) >> 3)
> -#define KGET_COLUMN(n)		((n) & KEY0C)
> -
> -#define W90P910_NUM_ROWS	8
> -#define W90P910_NUM_COLS	8
> -#define W90P910_ROW_SHIFT	3
> -
> -struct w90p910_keypad {
> -	const struct w90p910_keypad_platform_data *pdata;
> -	struct clk *clk;
> -	struct input_dev *input_dev;
> -	void __iomem *mmio_base;
> -	int irq;
> -	unsigned short keymap[W90P910_NUM_ROWS * W90P910_NUM_COLS];
> -};
> -
> -static void w90p910_keypad_scan_matrix(struct w90p910_keypad *keypad,
> -							unsigned int status)
> -{
> -	struct input_dev *input_dev = keypad->input_dev;
> -	unsigned int row = KGET_RAW(status);
> -	unsigned int col = KGET_COLUMN(status);
> -	unsigned int code = MATRIX_SCAN_CODE(row, col, W90P910_ROW_SHIFT);
> -	unsigned int key = keypad->keymap[code];
> -
> -	input_event(input_dev, EV_MSC, MSC_SCAN, code);
> -	input_report_key(input_dev, key, 1);
> -	input_sync(input_dev);
> -
> -	input_event(input_dev, EV_MSC, MSC_SCAN, code);
> -	input_report_key(input_dev, key, 0);
> -	input_sync(input_dev);
> -}
> -
> -static irqreturn_t w90p910_keypad_irq_handler(int irq, void *dev_id)
> -{
> -	struct w90p910_keypad *keypad = dev_id;
> -	unsigned int  kstatus, val;
> -
> -	kstatus = __raw_readl(keypad->mmio_base + KPI_STATUS);
> -
> -	val = INTTR | IS1KEY;
> -
> -	if (kstatus & val)
> -		w90p910_keypad_scan_matrix(keypad, kstatus);
> -
> -	return IRQ_HANDLED;
> -}
> -
> -static int w90p910_keypad_open(struct input_dev *dev)
> -{
> -	struct w90p910_keypad *keypad = input_get_drvdata(dev);
> -	const struct w90p910_keypad_platform_data *pdata = keypad->pdata;
> -	unsigned int val, config;
> -
> -	/* Enable unit clock */
> -	clk_enable(keypad->clk);
> -
> -	val = __raw_readl(keypad->mmio_base + KPI_CONF);
> -	val |= (KPSEL | ENKP);
> -	val &= ~(KSIZE0 | KSIZE1);
> -
> -	config = pdata->prescale | (pdata->debounce << DEBOUNCE_BIT);
> -
> -	val |= config;
> -
> -	__raw_writel(val, keypad->mmio_base + KPI_CONF);
> -
> -	return 0;
> -}
> -
> -static void w90p910_keypad_close(struct input_dev *dev)
> -{
> -	struct w90p910_keypad *keypad = input_get_drvdata(dev);
> -
> -	/* Disable clock unit */
> -	clk_disable(keypad->clk);
> -}
> -
> -static int w90p910_keypad_probe(struct platform_device *pdev)
> -{
> -	const struct w90p910_keypad_platform_data *pdata =
> -						dev_get_platdata(&pdev->dev);
> -	const struct matrix_keymap_data *keymap_data;
> -	struct w90p910_keypad *keypad;
> -	struct input_dev *input_dev;
> -	struct resource *res;
> -	int irq;
> -	int error;
> -
> -	if (!pdata) {
> -		dev_err(&pdev->dev, "no platform data defined\n");
> -		return -EINVAL;
> -	}
> -
> -	keymap_data = pdata->keymap_data;
> -
> -	irq = platform_get_irq(pdev, 0);
> -	if (irq < 0) {
> -		dev_err(&pdev->dev, "failed to get keypad irq\n");
> -		return -ENXIO;
> -	}
> -
> -	keypad = kzalloc(sizeof(struct w90p910_keypad), GFP_KERNEL);
> -	input_dev = input_allocate_device();
> -	if (!keypad || !input_dev) {
> -		dev_err(&pdev->dev, "failed to allocate driver data\n");
> -		error = -ENOMEM;
> -		goto failed_free;
> -	}
> -
> -	keypad->pdata = pdata;
> -	keypad->input_dev = input_dev;
> -	keypad->irq = irq;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (res == NULL) {
> -		dev_err(&pdev->dev, "failed to get I/O memory\n");
> -		error = -ENXIO;
> -		goto failed_free;
> -	}
> -
> -	res = request_mem_region(res->start, resource_size(res), pdev->name);
> -	if (res == NULL) {
> -		dev_err(&pdev->dev, "failed to request I/O memory\n");
> -		error = -EBUSY;
> -		goto failed_free;
> -	}
> -
> -	keypad->mmio_base = ioremap(res->start, resource_size(res));
> -	if (keypad->mmio_base == NULL) {
> -		dev_err(&pdev->dev, "failed to remap I/O memory\n");
> -		error = -ENXIO;
> -		goto failed_free_res;
> -	}
> -
> -	keypad->clk = clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(keypad->clk)) {
> -		dev_err(&pdev->dev, "failed to get keypad clock\n");
> -		error = PTR_ERR(keypad->clk);
> -		goto failed_free_io;
> -	}
> -
> -	/* set multi-function pin for w90p910 kpi. */
> -	mfp_set_groupi(&pdev->dev);
> -
> -	input_dev->name = pdev->name;
> -	input_dev->id.bustype = BUS_HOST;
> -	input_dev->open = w90p910_keypad_open;
> -	input_dev->close = w90p910_keypad_close;
> -	input_dev->dev.parent = &pdev->dev;
> -
> -	error = matrix_keypad_build_keymap(keymap_data, NULL,
> -					   W90P910_NUM_ROWS, W90P910_NUM_COLS,
> -					   keypad->keymap, input_dev);
> -	if (error) {
> -		dev_err(&pdev->dev, "failed to build keymap\n");
> -		goto failed_put_clk;
> -	}
> -
> -	error = request_irq(keypad->irq, w90p910_keypad_irq_handler,
> -			    0, pdev->name, keypad);
> -	if (error) {
> -		dev_err(&pdev->dev, "failed to request IRQ\n");
> -		goto failed_put_clk;
> -	}
> -
> -	__set_bit(EV_REP, input_dev->evbit);
> -	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
> -	input_set_drvdata(input_dev, keypad);
> -
> -	/* Register the input device */
> -	error = input_register_device(input_dev);
> -	if (error) {
> -		dev_err(&pdev->dev, "failed to register input device\n");
> -		goto failed_free_irq;
> -	}
> -
> -	platform_set_drvdata(pdev, keypad);
> -	return 0;
> -
> -failed_free_irq:
> -	free_irq(irq, keypad);
> -failed_put_clk:
> -	clk_put(keypad->clk);
> -failed_free_io:
> -	iounmap(keypad->mmio_base);
> -failed_free_res:
> -	release_mem_region(res->start, resource_size(res));
> -failed_free:
> -	input_free_device(input_dev);
> -	kfree(keypad);
> -	return error;
> -}
> -
> -static int w90p910_keypad_remove(struct platform_device *pdev)
> -{
> -	struct w90p910_keypad *keypad = platform_get_drvdata(pdev);
> -	struct resource *res;
> -
> -	free_irq(keypad->irq, keypad);
> -
> -	clk_put(keypad->clk);
> -
> -	input_unregister_device(keypad->input_dev);
> -
> -	iounmap(keypad->mmio_base);
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	release_mem_region(res->start, resource_size(res));
> -
> -	kfree(keypad);
> -
> -	return 0;
> -}
> -
> -static struct platform_driver w90p910_keypad_driver = {
> -	.probe		= w90p910_keypad_probe,
> -	.remove		= w90p910_keypad_remove,
> -	.driver		= {
> -		.name	= "nuc900-kpi",
> -	},
> -};
> -module_platform_driver(w90p910_keypad_driver);
> -
> -MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
> -MODULE_DESCRIPTION("w90p910 keypad driver");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:nuc900-keypad");
> diff --git a/include/linux/platform_data/keypad-w90p910.h b/include/linux/platform_data/keypad-w90p910.h
> deleted file mode 100644
> index 206ca4ecd93f..000000000000
> --- a/include/linux/platform_data/keypad-w90p910.h
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef __ASM_ARCH_W90P910_KEYPAD_H
> -#define __ASM_ARCH_W90P910_KEYPAD_H
> -
> -#include <linux/input/matrix_keypad.h>
> -
> -extern void mfp_set_groupi(struct device *dev);
> -
> -struct w90p910_keypad_platform_data {
> -	const struct matrix_keymap_data *keymap_data;
> -
> -	unsigned int	prescale;
> -	unsigned int	debounce;
> -};
> -
> -#endif /* __ASM_ARCH_W90P910_KEYPAD_H */
> -- 
> 2.20.0
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 11/16] Input: remove w90x900 touchscreen driver
  2019-08-09 20:27 ` [PATCH 11/16] Input: remove w90x900 touchscreen driver Arnd Bergmann
@ 2019-08-09 21:56   ` Dmitry Torokhov
  0 siblings, 0 replies; 37+ messages in thread
From: Dmitry Torokhov @ 2019-08-09 21:56 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: soc, linux-kernel, linux-input

On Fri, Aug 09, 2019 at 10:27:39PM +0200, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thank you.

> ---
>  drivers/input/touchscreen/Kconfig      |   9 -
>  drivers/input/touchscreen/Makefile     |   1 -
>  drivers/input/touchscreen/w90p910_ts.c | 331 -------------------------
>  3 files changed, 341 deletions(-)
>  delete mode 100644 drivers/input/touchscreen/w90p910_ts.c
> 
> diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
> index fb91f2d4049e..46ad9090493b 100644
> --- a/drivers/input/touchscreen/Kconfig
> +++ b/drivers/input/touchscreen/Kconfig
> @@ -1112,15 +1112,6 @@ config TOUCHSCREEN_TSC2007_IIO
>  	  or ambient light monitoring), temperature and raw input
>  	  values.
>  
> -config TOUCHSCREEN_W90X900
> -	tristate "W90P910 touchscreen driver"
> -	depends on ARCH_W90X900
> -	help
> -	  Say Y here if you have a W90P910 based touchscreen.
> -
> -	  To compile this driver as a module, choose M here: the
> -	  module will be called w90p910_ts.
> -
>  config TOUCHSCREEN_PCAP
>  	tristate "Motorola PCAP touchscreen"
>  	depends on EZX_PCAP
> diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
> index 084a596a0c8b..94c6162409b3 100644
> --- a/drivers/input/touchscreen/Makefile
> +++ b/drivers/input/touchscreen/Makefile
> @@ -102,7 +102,6 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712)	+= wm9712.o
>  wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713)	+= wm9713.o
>  obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)	+= mainstone-wm97xx.o
>  obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)	+= zylonite-wm97xx.o
> -obj-$(CONFIG_TOUCHSCREEN_W90X900)	+= w90p910_ts.o
>  obj-$(CONFIG_TOUCHSCREEN_SX8654)	+= sx8654.o
>  obj-$(CONFIG_TOUCHSCREEN_TPS6507X)	+= tps6507x-ts.o
>  obj-$(CONFIG_TOUCHSCREEN_ZET6223)	+= zet6223.o
> diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c
> deleted file mode 100644
> index 7893d7fa398c..000000000000
> --- a/drivers/input/touchscreen/w90p910_ts.c
> +++ /dev/null
> @@ -1,331 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Copyright (c) 2008 Nuvoton technology corporation.
> - *
> - * Wan ZongShun <mcuos.com@gmail.com>
> - */
> -
> -#include <linux/delay.h>
> -#include <linux/module.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -#include <linux/clk.h>
> -#include <linux/input.h>
> -#include <linux/interrupt.h>
> -#include <linux/slab.h>
> -
> -/* ADC controller bit defines */
> -#define ADC_DELAY	0xf00
> -#define ADC_DOWN	0x01
> -#define ADC_TSC_Y	(0x01 << 8)
> -#define ADC_TSC_X	(0x00 << 8)
> -#define TSC_FOURWIRE	(~(0x03 << 1))
> -#define ADC_CLK_EN	(0x01 << 28)	/* ADC clock enable */
> -#define ADC_READ_CON	(0x01 << 12)
> -#define ADC_CONV	(0x01 << 13)
> -#define ADC_SEMIAUTO	(0x01 << 14)
> -#define ADC_WAITTRIG	(0x03 << 14)
> -#define ADC_RST1	(0x01 << 16)
> -#define ADC_RST0	(0x00 << 16)
> -#define ADC_EN		(0x01 << 17)
> -#define ADC_INT		(0x01 << 18)
> -#define WT_INT		(0x01 << 20)
> -#define ADC_INT_EN	(0x01 << 21)
> -#define LVD_INT_EN	(0x01 << 22)
> -#define WT_INT_EN	(0x01 << 23)
> -#define ADC_DIV		(0x04 << 1)	/* div = 6 */
> -
> -enum ts_state {
> -	TS_WAIT_NEW_PACKET,	/* We are waiting next touch report */
> -	TS_WAIT_X_COORD,	/* We are waiting for ADC to report X coord */
> -	TS_WAIT_Y_COORD,	/* We are waiting for ADC to report Y coord */
> -	TS_IDLE,		/* Input device is closed, don't do anything */
> -};
> -
> -struct w90p910_ts {
> -	struct input_dev *input;
> -	struct timer_list timer;
> -	struct clk *clk;
> -	int irq_num;
> -	void __iomem *ts_reg;
> -	spinlock_t lock;
> -	enum ts_state state;
> -};
> -
> -static void w90p910_report_event(struct w90p910_ts *w90p910_ts, bool down)
> -{
> -	struct input_dev *dev = w90p910_ts->input;
> -
> -	if (down) {
> -		input_report_abs(dev, ABS_X,
> -				 __raw_readl(w90p910_ts->ts_reg + 0x0c));
> -		input_report_abs(dev, ABS_Y,
> -				 __raw_readl(w90p910_ts->ts_reg + 0x10));
> -	}
> -
> -	input_report_key(dev, BTN_TOUCH, down);
> -	input_sync(dev);
> -}
> -
> -static void w90p910_prepare_x_reading(struct w90p910_ts *w90p910_ts)
> -{
> -	unsigned long ctlreg;
> -
> -	__raw_writel(ADC_TSC_X, w90p910_ts->ts_reg + 0x04);
> -	ctlreg = __raw_readl(w90p910_ts->ts_reg);
> -	ctlreg &= ~(ADC_WAITTRIG | WT_INT | WT_INT_EN);
> -	ctlreg |= ADC_SEMIAUTO | ADC_INT_EN | ADC_CONV;
> -	__raw_writel(ctlreg, w90p910_ts->ts_reg);
> -
> -	w90p910_ts->state = TS_WAIT_X_COORD;
> -}
> -
> -static void w90p910_prepare_y_reading(struct w90p910_ts *w90p910_ts)
> -{
> -	unsigned long ctlreg;
> -
> -	__raw_writel(ADC_TSC_Y, w90p910_ts->ts_reg + 0x04);
> -	ctlreg = __raw_readl(w90p910_ts->ts_reg);
> -	ctlreg &= ~(ADC_WAITTRIG | ADC_INT | WT_INT_EN);
> -	ctlreg |= ADC_SEMIAUTO | ADC_INT_EN | ADC_CONV;
> -	__raw_writel(ctlreg, w90p910_ts->ts_reg);
> -
> -	w90p910_ts->state = TS_WAIT_Y_COORD;
> -}
> -
> -static void w90p910_prepare_next_packet(struct w90p910_ts *w90p910_ts)
> -{
> -	unsigned long ctlreg;
> -
> -	ctlreg = __raw_readl(w90p910_ts->ts_reg);
> -	ctlreg &= ~(ADC_INT | ADC_INT_EN | ADC_SEMIAUTO | ADC_CONV);
> -	ctlreg |= ADC_WAITTRIG | WT_INT_EN;
> -	__raw_writel(ctlreg, w90p910_ts->ts_reg);
> -
> -	w90p910_ts->state = TS_WAIT_NEW_PACKET;
> -}
> -
> -static irqreturn_t w90p910_ts_interrupt(int irq, void *dev_id)
> -{
> -	struct w90p910_ts *w90p910_ts = dev_id;
> -	unsigned long flags;
> -
> -	spin_lock_irqsave(&w90p910_ts->lock, flags);
> -
> -	switch (w90p910_ts->state) {
> -	case TS_WAIT_NEW_PACKET:
> -		/*
> -		 * The controller only generates interrupts when pen
> -		 * is down.
> -		 */
> -		del_timer(&w90p910_ts->timer);
> -		w90p910_prepare_x_reading(w90p910_ts);
> -		break;
> -
> -
> -	case TS_WAIT_X_COORD:
> -		w90p910_prepare_y_reading(w90p910_ts);
> -		break;
> -
> -	case TS_WAIT_Y_COORD:
> -		w90p910_report_event(w90p910_ts, true);
> -		w90p910_prepare_next_packet(w90p910_ts);
> -		mod_timer(&w90p910_ts->timer, jiffies + msecs_to_jiffies(100));
> -		break;
> -
> -	case TS_IDLE:
> -		break;
> -	}
> -
> -	spin_unlock_irqrestore(&w90p910_ts->lock, flags);
> -
> -	return IRQ_HANDLED;
> -}
> -
> -static void w90p910_check_pen_up(struct timer_list *t)
> -{
> -	struct w90p910_ts *w90p910_ts = from_timer(w90p910_ts, t, timer);
> -	unsigned long flags;
> -
> -	spin_lock_irqsave(&w90p910_ts->lock, flags);
> -
> -	if (w90p910_ts->state == TS_WAIT_NEW_PACKET &&
> -	    !(__raw_readl(w90p910_ts->ts_reg + 0x04) & ADC_DOWN)) {
> -
> -		w90p910_report_event(w90p910_ts, false);
> -	}
> -
> -	spin_unlock_irqrestore(&w90p910_ts->lock, flags);
> -}
> -
> -static int w90p910_open(struct input_dev *dev)
> -{
> -	struct w90p910_ts *w90p910_ts = input_get_drvdata(dev);
> -	unsigned long val;
> -
> -	/* enable the ADC clock */
> -	clk_enable(w90p910_ts->clk);
> -
> -	__raw_writel(ADC_RST1, w90p910_ts->ts_reg);
> -	msleep(1);
> -	__raw_writel(ADC_RST0, w90p910_ts->ts_reg);
> -	msleep(1);
> -
> -	/* set delay and screen type */
> -	val = __raw_readl(w90p910_ts->ts_reg + 0x04);
> -	__raw_writel(val & TSC_FOURWIRE, w90p910_ts->ts_reg + 0x04);
> -	__raw_writel(ADC_DELAY, w90p910_ts->ts_reg + 0x08);
> -
> -	w90p910_ts->state = TS_WAIT_NEW_PACKET;
> -	wmb();
> -
> -	/* set trigger mode */
> -	val = __raw_readl(w90p910_ts->ts_reg);
> -	val |= ADC_WAITTRIG | ADC_DIV | ADC_EN | WT_INT_EN;
> -	__raw_writel(val, w90p910_ts->ts_reg);
> -
> -	return 0;
> -}
> -
> -static void w90p910_close(struct input_dev *dev)
> -{
> -	struct w90p910_ts *w90p910_ts = input_get_drvdata(dev);
> -	unsigned long val;
> -
> -	/* disable trigger mode */
> -
> -	spin_lock_irq(&w90p910_ts->lock);
> -
> -	w90p910_ts->state = TS_IDLE;
> -
> -	val = __raw_readl(w90p910_ts->ts_reg);
> -	val &= ~(ADC_WAITTRIG | ADC_DIV | ADC_EN | WT_INT_EN | ADC_INT_EN);
> -	__raw_writel(val, w90p910_ts->ts_reg);
> -
> -	spin_unlock_irq(&w90p910_ts->lock);
> -
> -	/* Now that interrupts are shut off we can safely delete timer */
> -	del_timer_sync(&w90p910_ts->timer);
> -
> -	/* stop the ADC clock */
> -	clk_disable(w90p910_ts->clk);
> -}
> -
> -static int w90x900ts_probe(struct platform_device *pdev)
> -{
> -	struct w90p910_ts *w90p910_ts;
> -	struct input_dev *input_dev;
> -	struct resource *res;
> -	int err;
> -
> -	w90p910_ts = kzalloc(sizeof(struct w90p910_ts), GFP_KERNEL);
> -	input_dev = input_allocate_device();
> -	if (!w90p910_ts || !input_dev) {
> -		err = -ENOMEM;
> -		goto fail1;
> -	}
> -
> -	w90p910_ts->input = input_dev;
> -	w90p910_ts->state = TS_IDLE;
> -	spin_lock_init(&w90p910_ts->lock);
> -	timer_setup(&w90p910_ts->timer, w90p910_check_pen_up, 0);
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		err = -ENXIO;
> -		goto fail1;
> -	}
> -
> -	if (!request_mem_region(res->start, resource_size(res),
> -				pdev->name)) {
> -		err = -EBUSY;
> -		goto fail1;
> -	}
> -
> -	w90p910_ts->ts_reg = ioremap(res->start, resource_size(res));
> -	if (!w90p910_ts->ts_reg) {
> -		err = -ENOMEM;
> -		goto fail2;
> -	}
> -
> -	w90p910_ts->clk = clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(w90p910_ts->clk)) {
> -		err = PTR_ERR(w90p910_ts->clk);
> -		goto fail3;
> -	}
> -
> -	input_dev->name = "W90P910 TouchScreen";
> -	input_dev->phys = "w90p910ts/event0";
> -	input_dev->id.bustype = BUS_HOST;
> -	input_dev->id.vendor  = 0x0005;
> -	input_dev->id.product = 0x0001;
> -	input_dev->id.version = 0x0100;
> -	input_dev->dev.parent = &pdev->dev;
> -	input_dev->open = w90p910_open;
> -	input_dev->close = w90p910_close;
> -
> -	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
> -	input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
> -
> -	input_set_abs_params(input_dev, ABS_X, 0, 0x400, 0, 0);
> -	input_set_abs_params(input_dev, ABS_Y, 0, 0x400, 0, 0);
> -
> -	input_set_drvdata(input_dev, w90p910_ts);
> -
> -	w90p910_ts->irq_num = platform_get_irq(pdev, 0);
> -	if (request_irq(w90p910_ts->irq_num, w90p910_ts_interrupt,
> -			0, "w90p910ts", w90p910_ts)) {
> -		err = -EBUSY;
> -		goto fail4;
> -	}
> -
> -	err = input_register_device(w90p910_ts->input);
> -	if (err)
> -		goto fail5;
> -
> -	platform_set_drvdata(pdev, w90p910_ts);
> -
> -	return 0;
> -
> -fail5:	free_irq(w90p910_ts->irq_num, w90p910_ts);
> -fail4:	clk_put(w90p910_ts->clk);
> -fail3:	iounmap(w90p910_ts->ts_reg);
> -fail2:	release_mem_region(res->start, resource_size(res));
> -fail1:	input_free_device(input_dev);
> -	kfree(w90p910_ts);
> -	return err;
> -}
> -
> -static int w90x900ts_remove(struct platform_device *pdev)
> -{
> -	struct w90p910_ts *w90p910_ts = platform_get_drvdata(pdev);
> -	struct resource *res;
> -
> -	free_irq(w90p910_ts->irq_num, w90p910_ts);
> -	del_timer_sync(&w90p910_ts->timer);
> -	iounmap(w90p910_ts->ts_reg);
> -
> -	clk_put(w90p910_ts->clk);
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	release_mem_region(res->start, resource_size(res));
> -
> -	input_unregister_device(w90p910_ts->input);
> -	kfree(w90p910_ts);
> -
> -	return 0;
> -}
> -
> -static struct platform_driver w90x900ts_driver = {
> -	.probe		= w90x900ts_probe,
> -	.remove		= w90x900ts_remove,
> -	.driver		= {
> -		.name	= "nuc900-ts",
> -	},
> -};
> -module_platform_driver(w90x900ts_driver);
> -
> -MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
> -MODULE_DESCRIPTION("w90p910 touch screen driver!");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:nuc900-ts");
> -- 
> 2.20.0
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms
  2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
                   ` (15 preceding siblings ...)
  2019-08-09 20:27 ` [PATCH 16/16] ARM: remove w90x900 platform Arnd Bergmann
@ 2019-08-10  7:29 ` Greg Kroah-Hartman
  16 siblings, 0 replies; 37+ messages in thread
From: Greg Kroah-Hartman @ 2019-08-10  7:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: soc, Wanzongshun (Vincent),
	Greg Ungerer, linux-serial, Dmitry Torokhov, linux-input,
	Linus Walleij, linux-gpio, David S. Miller, netdev,
	Guenter Roeck, Mark Brown, alsa-devel, linux-spi,
	Bartlomiej Zolnierkiewicz, linux-fbdev, Miquel Raynal, linux-mtd,
	linux-arm-kernel, linux-kernel

On Fri, Aug 09, 2019 at 10:27:28PM +0200, Arnd Bergmann wrote:
> As discussed previously, these two ARM platforms have no
> known remaining users, let's remove them completely.
> 
> Subsystem maintainers: feel free to take the driver removals
> through your respective trees, they are all independent of
> one another. We can merge any remaining patches through the
> soc tree.

Serial and USB host controller driver patches applied, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 12/16] mtd: rawnand: remove w90x900 driver
  2019-08-09 20:27 ` [PATCH 12/16] mtd: rawnand: remove w90x900 driver Arnd Bergmann
@ 2019-08-10  8:21   ` Boris Brezillon
  2019-08-26 12:58   ` Miquel Raynal
  1 sibling, 0 replies; 37+ messages in thread
From: Boris Brezillon @ 2019-08-10  8:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: soc, Vignesh Raghavendra, Richard Weinberger, linux-kernel,
	Marek Vasut, linux-mtd, Miquel Raynal, Brian Norris,
	David Woodhouse

On Fri,  9 Aug 2019 22:27:40 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

One less driver to convert to ->exec_op(), Yay! 

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/mtd/nand/raw/Kconfig       |   8 -
>  drivers/mtd/nand/raw/Makefile      |   1 -
>  drivers/mtd/nand/raw/nuc900_nand.c | 304 -----------------------------
>  3 files changed, 313 deletions(-)
>  delete mode 100644 drivers/mtd/nand/raw/nuc900_nand.c
> 
> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
> index 5a711d8beaca..0e5c5e02ee6f 100644
> --- a/drivers/mtd/nand/raw/Kconfig
> +++ b/drivers/mtd/nand/raw/Kconfig
> @@ -351,14 +351,6 @@ config MTD_NAND_SOCRATES
>  	help
>  	  Enables support for NAND Flash chips wired onto Socrates board.
>  
> -config MTD_NAND_NUC900
> -	tristate "Nuvoton NUC9xx/w90p910 NAND controller"
> -	depends on ARCH_W90X900 || COMPILE_TEST
> -	depends on HAS_IOMEM
> -	help
> -	  This enables the driver for the NAND Flash on evaluation board based
> -	  on w90p910 / NUC9xx.
> -
>  source "drivers/mtd/nand/raw/ingenic/Kconfig"
>  
>  config MTD_NAND_FSMC
> diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
> index efaf5cd25edc..d7f6c237e37c 100644
> --- a/drivers/mtd/nand/raw/Makefile
> +++ b/drivers/mtd/nand/raw/Makefile
> @@ -41,7 +41,6 @@ obj-$(CONFIG_MTD_NAND_SH_FLCTL)		+= sh_flctl.o
>  obj-$(CONFIG_MTD_NAND_MXC)		+= mxc_nand.o
>  obj-$(CONFIG_MTD_NAND_SOCRATES)		+= socrates_nand.o
>  obj-$(CONFIG_MTD_NAND_TXX9NDFMC)	+= txx9ndfmc.o
> -obj-$(CONFIG_MTD_NAND_NUC900)		+= nuc900_nand.o
>  obj-$(CONFIG_MTD_NAND_MPC5121_NFC)	+= mpc5121_nfc.o
>  obj-$(CONFIG_MTD_NAND_VF610_NFC)	+= vf610_nfc.o
>  obj-$(CONFIG_MTD_NAND_RICOH)		+= r852.o
> diff --git a/drivers/mtd/nand/raw/nuc900_nand.c b/drivers/mtd/nand/raw/nuc900_nand.c
> deleted file mode 100644
> index 13bf7b2894d3..000000000000
> --- a/drivers/mtd/nand/raw/nuc900_nand.c
> +++ /dev/null
> @@ -1,304 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Copyright © 2009 Nuvoton technology corporation.
> - *
> - * Wan ZongShun <mcuos.com@gmail.com>
> - */
> -
> -#include <linux/slab.h>
> -#include <linux/module.h>
> -#include <linux/interrupt.h>
> -#include <linux/io.h>
> -#include <linux/platform_device.h>
> -#include <linux/delay.h>
> -#include <linux/clk.h>
> -#include <linux/err.h>
> -
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/rawnand.h>
> -#include <linux/mtd/partitions.h>
> -
> -#define REG_FMICSR   	0x00
> -#define REG_SMCSR    	0xa0
> -#define REG_SMISR    	0xac
> -#define REG_SMCMD    	0xb0
> -#define REG_SMADDR   	0xb4
> -#define REG_SMDATA   	0xb8
> -
> -#define RESET_FMI	0x01
> -#define NAND_EN		0x08
> -#define READYBUSY	(0x01 << 18)
> -
> -#define SWRST		0x01
> -#define PSIZE		(0x01 << 3)
> -#define DMARWEN		(0x03 << 1)
> -#define BUSWID		(0x01 << 4)
> -#define ECC4EN		(0x01 << 5)
> -#define WP		(0x01 << 24)
> -#define NANDCS		(0x01 << 25)
> -#define ENDADDR		(0x01 << 31)
> -
> -#define read_data_reg(dev)		\
> -	__raw_readl((dev)->reg + REG_SMDATA)
> -
> -#define write_data_reg(dev, val)	\
> -	__raw_writel((val), (dev)->reg + REG_SMDATA)
> -
> -#define write_cmd_reg(dev, val)		\
> -	__raw_writel((val), (dev)->reg + REG_SMCMD)
> -
> -#define write_addr_reg(dev, val)	\
> -	__raw_writel((val), (dev)->reg + REG_SMADDR)
> -
> -struct nuc900_nand {
> -	struct nand_chip chip;
> -	void __iomem *reg;
> -	struct clk *clk;
> -	spinlock_t lock;
> -};
> -
> -static inline struct nuc900_nand *mtd_to_nuc900(struct mtd_info *mtd)
> -{
> -	return container_of(mtd_to_nand(mtd), struct nuc900_nand, chip);
> -}
> -
> -static const struct mtd_partition partitions[] = {
> -	{
> -	 .name = "NAND FS 0",
> -	 .offset = 0,
> -	 .size = 8 * 1024 * 1024
> -	},
> -	{
> -	 .name = "NAND FS 1",
> -	 .offset = MTDPART_OFS_APPEND,
> -	 .size = MTDPART_SIZ_FULL
> -	}
> -};
> -
> -static unsigned char nuc900_nand_read_byte(struct nand_chip *chip)
> -{
> -	unsigned char ret;
> -	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
> -
> -	ret = (unsigned char)read_data_reg(nand);
> -
> -	return ret;
> -}
> -
> -static void nuc900_nand_read_buf(struct nand_chip *chip,
> -				 unsigned char *buf, int len)
> -{
> -	int i;
> -	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
> -
> -	for (i = 0; i < len; i++)
> -		buf[i] = (unsigned char)read_data_reg(nand);
> -}
> -
> -static void nuc900_nand_write_buf(struct nand_chip *chip,
> -				  const unsigned char *buf, int len)
> -{
> -	int i;
> -	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
> -
> -	for (i = 0; i < len; i++)
> -		write_data_reg(nand, buf[i]);
> -}
> -
> -static int nuc900_check_rb(struct nuc900_nand *nand)
> -{
> -	unsigned int val;
> -	spin_lock(&nand->lock);
> -	val = __raw_readl(nand->reg + REG_SMISR);
> -	val &= READYBUSY;
> -	spin_unlock(&nand->lock);
> -
> -	return val;
> -}
> -
> -static int nuc900_nand_devready(struct nand_chip *chip)
> -{
> -	struct nuc900_nand *nand = mtd_to_nuc900(nand_to_mtd(chip));
> -	int ready;
> -
> -	ready = (nuc900_check_rb(nand)) ? 1 : 0;
> -	return ready;
> -}
> -
> -static void nuc900_nand_command_lp(struct nand_chip *chip,
> -				   unsigned int command,
> -				   int column, int page_addr)
> -{
> -	struct mtd_info *mtd = nand_to_mtd(chip);
> -	struct nuc900_nand *nand = mtd_to_nuc900(mtd);
> -
> -	if (command == NAND_CMD_READOOB) {
> -		column += mtd->writesize;
> -		command = NAND_CMD_READ0;
> -	}
> -
> -	write_cmd_reg(nand, command & 0xff);
> -
> -	if (column != -1 || page_addr != -1) {
> -
> -		if (column != -1) {
> -			if (chip->options & NAND_BUSWIDTH_16 &&
> -					!nand_opcode_8bits(command))
> -				column >>= 1;
> -			write_addr_reg(nand, column);
> -			write_addr_reg(nand, column >> 8 | ENDADDR);
> -		}
> -		if (page_addr != -1) {
> -			write_addr_reg(nand, page_addr);
> -
> -			if (chip->options & NAND_ROW_ADDR_3) {
> -				write_addr_reg(nand, page_addr >> 8);
> -				write_addr_reg(nand, page_addr >> 16 | ENDADDR);
> -			} else {
> -				write_addr_reg(nand, page_addr >> 8 | ENDADDR);
> -			}
> -		}
> -	}
> -
> -	switch (command) {
> -	case NAND_CMD_CACHEDPROG:
> -	case NAND_CMD_PAGEPROG:
> -	case NAND_CMD_ERASE1:
> -	case NAND_CMD_ERASE2:
> -	case NAND_CMD_SEQIN:
> -	case NAND_CMD_RNDIN:
> -	case NAND_CMD_STATUS:
> -		return;
> -
> -	case NAND_CMD_RESET:
> -		if (chip->legacy.dev_ready)
> -			break;
> -		udelay(chip->legacy.chip_delay);
> -
> -		write_cmd_reg(nand, NAND_CMD_STATUS);
> -		write_cmd_reg(nand, command);
> -
> -		while (!nuc900_check_rb(nand))
> -			;
> -
> -		return;
> -
> -	case NAND_CMD_RNDOUT:
> -		write_cmd_reg(nand, NAND_CMD_RNDOUTSTART);
> -		return;
> -
> -	case NAND_CMD_READ0:
> -		write_cmd_reg(nand, NAND_CMD_READSTART);
> -		/* fall through */
> -
> -	default:
> -
> -		if (!chip->legacy.dev_ready) {
> -			udelay(chip->legacy.chip_delay);
> -			return;
> -		}
> -	}
> -
> -	/* Apply this short delay always to ensure that we do wait tWB in
> -	 * any case on any machine. */
> -	ndelay(100);
> -
> -	while (!chip->legacy.dev_ready(chip))
> -		;
> -}
> -
> -
> -static void nuc900_nand_enable(struct nuc900_nand *nand)
> -{
> -	unsigned int val;
> -	spin_lock(&nand->lock);
> -	__raw_writel(RESET_FMI, (nand->reg + REG_FMICSR));
> -
> -	val = __raw_readl(nand->reg + REG_FMICSR);
> -
> -	if (!(val & NAND_EN))
> -		__raw_writel(val | NAND_EN, nand->reg + REG_FMICSR);
> -
> -	val = __raw_readl(nand->reg + REG_SMCSR);
> -
> -	val &= ~(SWRST|PSIZE|DMARWEN|BUSWID|ECC4EN|NANDCS);
> -	val |= WP;
> -
> -	__raw_writel(val, nand->reg + REG_SMCSR);
> -
> -	spin_unlock(&nand->lock);
> -}
> -
> -static int nuc900_nand_probe(struct platform_device *pdev)
> -{
> -	struct nuc900_nand *nuc900_nand;
> -	struct nand_chip *chip;
> -	struct mtd_info *mtd;
> -	struct resource *res;
> -
> -	nuc900_nand = devm_kzalloc(&pdev->dev, sizeof(struct nuc900_nand),
> -				   GFP_KERNEL);
> -	if (!nuc900_nand)
> -		return -ENOMEM;
> -	chip = &(nuc900_nand->chip);
> -	mtd = nand_to_mtd(chip);
> -
> -	mtd->dev.parent		= &pdev->dev;
> -	spin_lock_init(&nuc900_nand->lock);
> -
> -	nuc900_nand->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(nuc900_nand->clk))
> -		return -ENOENT;
> -	clk_enable(nuc900_nand->clk);
> -
> -	chip->legacy.cmdfunc	= nuc900_nand_command_lp;
> -	chip->legacy.dev_ready	= nuc900_nand_devready;
> -	chip->legacy.read_byte	= nuc900_nand_read_byte;
> -	chip->legacy.write_buf	= nuc900_nand_write_buf;
> -	chip->legacy.read_buf	= nuc900_nand_read_buf;
> -	chip->legacy.chip_delay	= 50;
> -	chip->options		= 0;
> -	chip->ecc.mode		= NAND_ECC_SOFT;
> -	chip->ecc.algo		= NAND_ECC_HAMMING;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	nuc900_nand->reg = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(nuc900_nand->reg))
> -		return PTR_ERR(nuc900_nand->reg);
> -
> -	nuc900_nand_enable(nuc900_nand);
> -
> -	if (nand_scan(chip, 1))
> -		return -ENXIO;
> -
> -	mtd_device_register(mtd, partitions, ARRAY_SIZE(partitions));
> -
> -	platform_set_drvdata(pdev, nuc900_nand);
> -
> -	return 0;
> -}
> -
> -static int nuc900_nand_remove(struct platform_device *pdev)
> -{
> -	struct nuc900_nand *nuc900_nand = platform_get_drvdata(pdev);
> -
> -	nand_release(&nuc900_nand->chip);
> -	clk_disable(nuc900_nand->clk);
> -
> -	return 0;
> -}
> -
> -static struct platform_driver nuc900_nand_driver = {
> -	.probe		= nuc900_nand_probe,
> -	.remove		= nuc900_nand_remove,
> -	.driver		= {
> -		.name	= "nuc900-fmi",
> -	},
> -};
> -
> -module_platform_driver(nuc900_nand_driver);
> -
> -MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
> -MODULE_DESCRIPTION("w90p910/NUC9xx nand driver!");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS("platform:nuc900-fmi");


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 04/16] watchdog: remove ks8695 driver
  2019-08-09 20:42   ` Guenter Roeck
@ 2019-08-10  8:37     ` Arnd Bergmann
  2019-08-10 12:56       ` Guenter Roeck
  0 siblings, 1 reply; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-10  8:37 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: soc, Wim Van Sebroeck, Jonathan Corbet, LINUXWATCHDOG,
	open list:DOCUMENTATION, Linux Kernel Mailing List

On Fri, Aug 9, 2019 at 10:42 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Fri, Aug 09, 2019 at 10:27:32PM +0200, Arnd Bergmann wrote:
> > The platform is getting removed, so there are no remaining
> > users of this driver.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Guenter Roeck <linux@roeck-us.net>
>
> Please let me know if this should be applied through the watchdog tree.
> For now I'll assume it will be applied together with the rest of the
> series.

For this series, my preference is that you apply the patches through
the subsystem tree as there are no dependencies.

Thanks,

     Arnd

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 03/16] gpio: remove ks8695 driver
  2019-08-09 20:27 ` [PATCH 03/16] gpio: " Arnd Bergmann
@ 2019-08-10  9:03   ` Linus Walleij
  0 siblings, 0 replies; 37+ messages in thread
From: Linus Walleij @ 2019-08-10  9:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: soc, Bartosz Golaszewski, linux-kernel, open list:GPIO SUBSYSTEM

On Fri, Aug 9, 2019 at 10:28 PM Arnd Bergmann <arnd@arndb.de> wrote:

> The platform is getting removed, so there are no remaining
> users of this driver.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied. Thanks for cleaning out this old cruft.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 04/16] watchdog: remove ks8695 driver
  2019-08-10  8:37     ` Arnd Bergmann
@ 2019-08-10 12:56       ` Guenter Roeck
  0 siblings, 0 replies; 37+ messages in thread
From: Guenter Roeck @ 2019-08-10 12:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: soc, Wim Van Sebroeck, Jonathan Corbet, LINUXWATCHDOG,
	open list:DOCUMENTATION, Linux Kernel Mailing List

On Sat, Aug 10, 2019 at 10:37:14AM +0200, Arnd Bergmann wrote:
> On Fri, Aug 9, 2019 at 10:42 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Fri, Aug 09, 2019 at 10:27:32PM +0200, Arnd Bergmann wrote:
> > > The platform is getting removed, so there are no remaining
> > > users of this driver.
> > >
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > Acked-by: Guenter Roeck <linux@roeck-us.net>
> >
> > Please let me know if this should be applied through the watchdog tree.
> > For now I'll assume it will be applied together with the rest of the
> > series.
> 
> For this series, my preference is that you apply the patches through
> the subsystem tree as there are no dependencies.
> 
Ok, I added both patches to my tree.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 01/16] ARM: remove ks8695 platform
  2019-08-09 20:27 ` [PATCH 01/16] ARM: remove ks8695 platform Arnd Bergmann
@ 2019-08-11  9:18   ` Ben Dooks
  2019-08-12  3:59   ` Greg Ungerer
  2019-08-13 15:27   ` Ben Dooks
  2 siblings, 0 replies; 37+ messages in thread
From: Ben Dooks @ 2019-08-11  9:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: soc, Greg Ungerer, Andrew Victor, linux-kernel, linux-arm-kernel



On 2019-08-09 21:27, Arnd Bergmann wrote:
> ks8695 is an older SoC originally made by Kendin, which was later 
> acquired
> by Micrel, and subsequently by Microchip.
> 
> The platform port was originally contributed by Andrew Victor and Ben
> Dooks, and later maintained by Greg Ungerer.
> 
> When I recently submitted cleanups, but Greg noted that the platform no
> longer boots and nobody is using it any more, we decided to remove it.

I'm not going to object to this.

> Cc: Greg Ungerer <gerg@kernel.org>
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Ben Dooks <ben.dooks@codethink.co.uk>

Really, this address should only be used for /work/ stuff.

> Link: https://wikidevi.com/wiki/Micrel
> Link:
> https://lore.kernel.org/linux-arm-kernel/2bc41895-d4f9-896c-0726-0b2862fcbf25@kernel.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  MAINTAINERS                                   |   6 -
>  arch/arm/Kconfig                              |  16 +-
>  arch/arm/Kconfig.debug                        |   8 -
>  arch/arm/Makefile                             |   1 -
>  arch/arm/configs/acs5k_defconfig              |  77 ------
>  arch/arm/configs/acs5k_tiny_defconfig         |  69 -----
>  arch/arm/configs/ks8695_defconfig             |  67 -----
>  arch/arm/include/debug/ks8695.S               |  37 ---
>  arch/arm/mach-ks8695/Kconfig                  |  88 -------
>  arch/arm/mach-ks8695/Makefile                 |  23 --
>  arch/arm/mach-ks8695/Makefile.boot            |   9 -
>  arch/arm/mach-ks8695/board-acs5k.c            | 238 -----------------
>  arch/arm/mach-ks8695/board-dsm320.c           | 127 ---------
>  arch/arm/mach-ks8695/board-micrel.c           |  59 -----
>  arch/arm/mach-ks8695/board-og.c               | 197 --------------
>  arch/arm/mach-ks8695/board-sg.c               | 118 ---------
>  arch/arm/mach-ks8695/cpu.c                    |  60 -----
>  arch/arm/mach-ks8695/devices.c                | 197 --------------
>  arch/arm/mach-ks8695/devices.h                |  29 --
>  arch/arm/mach-ks8695/generic.h                |  12 -
>  .../mach-ks8695/include/mach/entry-macro.S    |  47 ----
>  .../mach-ks8695/include/mach/gpio-ks8695.h    |  36 ---
>  arch/arm/mach-ks8695/include/mach/hardware.h  |  42 ---
>  arch/arm/mach-ks8695/include/mach/irqs.h      |  51 ----
>  arch/arm/mach-ks8695/include/mach/memory.h    |  51 ----
>  arch/arm/mach-ks8695/include/mach/regs-gpio.h |  55 ----
>  arch/arm/mach-ks8695/include/mach/regs-irq.h  |  41 ---
>  arch/arm/mach-ks8695/include/mach/regs-misc.h |  97 -------
>  .../mach-ks8695/include/mach/regs-switch.h    |  66 -----
>  arch/arm/mach-ks8695/include/mach/regs-uart.h |  89 -------
>  .../arm/mach-ks8695/include/mach/uncompress.h |  33 ---
>  arch/arm/mach-ks8695/irq.c                    | 164 ------------
>  arch/arm/mach-ks8695/pci.c                    | 247 ------------------
>  arch/arm/mach-ks8695/regs-hpna.h              |  25 --
>  arch/arm/mach-ks8695/regs-lan.h               |  65 -----
>  arch/arm/mach-ks8695/regs-mem.h               |  89 -------
>  arch/arm/mach-ks8695/regs-pci.h               |  53 ----
>  arch/arm/mach-ks8695/regs-sys.h               |  34 ---
>  arch/arm/mach-ks8695/regs-wan.h               |  65 -----
>  arch/arm/mach-ks8695/time.c                   | 159 -----------
>  arch/arm/mm/Kconfig                           |   2 +-
>  41 files changed, 5 insertions(+), 2944 deletions(-)
>  delete mode 100644 arch/arm/configs/acs5k_defconfig
>  delete mode 100644 arch/arm/configs/acs5k_tiny_defconfig
>  delete mode 100644 arch/arm/configs/ks8695_defconfig
>  delete mode 100644 arch/arm/include/debug/ks8695.S
>  delete mode 100644 arch/arm/mach-ks8695/Kconfig
>  delete mode 100644 arch/arm/mach-ks8695/Makefile
>  delete mode 100644 arch/arm/mach-ks8695/Makefile.boot
>  delete mode 100644 arch/arm/mach-ks8695/board-acs5k.c
>  delete mode 100644 arch/arm/mach-ks8695/board-dsm320.c
>  delete mode 100644 arch/arm/mach-ks8695/board-micrel.c
>  delete mode 100644 arch/arm/mach-ks8695/board-og.c
>  delete mode 100644 arch/arm/mach-ks8695/board-sg.c
>  delete mode 100644 arch/arm/mach-ks8695/cpu.c
>  delete mode 100644 arch/arm/mach-ks8695/devices.c
>  delete mode 100644 arch/arm/mach-ks8695/devices.h
>  delete mode 100644 arch/arm/mach-ks8695/generic.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/entry-macro.S
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/hardware.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/irqs.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/memory.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-gpio.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-irq.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-misc.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-switch.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-uart.h
>  delete mode 100644 arch/arm/mach-ks8695/include/mach/uncompress.h
>  delete mode 100644 arch/arm/mach-ks8695/irq.c
>  delete mode 100644 arch/arm/mach-ks8695/pci.c
>  delete mode 100644 arch/arm/mach-ks8695/regs-hpna.h
>  delete mode 100644 arch/arm/mach-ks8695/regs-lan.h
>  delete mode 100644 arch/arm/mach-ks8695/regs-mem.h
>  delete mode 100644 arch/arm/mach-ks8695/regs-pci.h
>  delete mode 100644 arch/arm/mach-ks8695/regs-sys.h
>  delete mode 100644 arch/arm/mach-ks8695/regs-wan.h
>  delete mode 100644 arch/arm/mach-ks8695/time.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 6426db5198f0..9ac40a896ee6 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1921,12 +1921,6 @@ S:	Maintained
>  F:	drivers/phy/mediatek/
>  F:	Documentation/devicetree/bindings/phy/phy-mtk-*
> 
> -ARM/MICREL KS8695 ARCHITECTURE
> -M:	Greg Ungerer <gerg@uclinux.org>
> -L:	linux-arm-kernel@lists.infradead.org (moderated for 
> non-subscribers)
> -F:	arch/arm/mach-ks8695/
> -S:	Odd Fixes
> -
>  ARM/Microchip (AT91) SoC support
>  M:	Nicolas Ferre <nicolas.ferre@microchip.com>
>  M:	Alexandre Belloni <alexandre.belloni@bootlin.com>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 33b00579beff..61deacf68e13 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -264,7 +264,6 @@ config PHYS_OFFSET
>  			ARCH_FOOTBRIDGE || \
>  			ARCH_INTEGRATOR || \
>  			ARCH_IOP13XX || \
> -			ARCH_KS8695 || \
>  			ARCH_REALVIEW
>  	default 0x10000000 if ARCH_OMAP1 || ARCH_RPC
>  	default 0x20000000 if ARCH_S5PV210
> @@ -451,17 +450,6 @@ config ARCH_DOVE
>  	help
>  	  Support for the Marvell Dove SoC 88AP510
> 
> -config ARCH_KS8695
> -	bool "Micrel/Kendin KS8695"
> -	select CLKSRC_MMIO
> -	select CPU_ARM922T
> -	select GENERIC_CLOCKEVENTS
> -	select GPIOLIB
> -	select NEED_MACH_MEMORY_H
> -	help
> -	  Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
> -	  System-on-Chip devices.
> -
>  config ARCH_W90X900
>  	bool "Nuvoton W90X900 CPU"
>  	select CLKDEV_LOOKUP
> @@ -744,7 +732,11 @@ source "arch/arm/mach-ixp4xx/Kconfig"
> 
>  source "arch/arm/mach-keystone/Kconfig"
> 
> +<<<<<<< HEAD
>  source "arch/arm/mach-ks8695/Kconfig"
> +=======
> +source "arch/arm/mach-lpc32xx/Kconfig"
> +>>>>>>> ARM: remove ks8695 platform
> 
>  source "arch/arm/mach-mediatek/Kconfig"
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 85710e078afb..2496f1c89b88 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -509,13 +509,6 @@ choice
>  		  Say Y here if you want the debug print routines to direct
>  		  their output to UART1 serial port on KEYSTONE2 devices.
> 
> -	config DEBUG_KS8695_UART
> -		bool "KS8695 Debug UART"
> -		depends on ARCH_KS8695
> -		help
> -		  Say Y here if you want kernel low-level debugging support
> -		  on KS8695.
> -
>  	config DEBUG_LPC18XX_UART0
>  		bool "Kernel low-level debugging via LPC18xx/43xx UART0"
>  		depends on ARCH_LPC18XX
> @@ -1533,7 +1526,6 @@ config DEBUG_LL_INCLUDE
>  				 DEBUG_IMX6SX_UART || \
>  				 DEBUG_IMX6UL_UART || \
>  				 DEBUG_IMX7D_UART
> -	default "debug/ks8695.S" if DEBUG_KS8695_UART
>  	default "debug/msm.S" if DEBUG_QCOM_UARTDM
>  	default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
>  	default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index c3624ca6c0bc..c9daa4adc6fd 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -178,7 +178,6 @@ machine-$(CONFIG_ARCH_IOP32X)		+= iop32x
>  machine-$(CONFIG_ARCH_IOP33X)		+= iop33x
>  machine-$(CONFIG_ARCH_IXP4XX)		+= ixp4xx
>  machine-$(CONFIG_ARCH_KEYSTONE)		+= keystone
> -machine-$(CONFIG_ARCH_KS8695)		+= ks8695
>  machine-$(CONFIG_ARCH_LPC18XX)		+= lpc18xx
>  machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
>  machine-$(CONFIG_ARCH_MESON)		+= meson
> 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 @@
> -# CONFIG_SWAP is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_POSIX_MQUEUE=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_SYSFS_DEPRECATED_V2=y
> -CONFIG_BLK_DEV_INITRD=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_IOSCHED_DEADLINE is not set
> -# CONFIG_IOSCHED_CFQ is not set
> -CONFIG_ARCH_KS8695=y
> -CONFIG_MACH_KS8695=y
> -CONFIG_MACH_DSM320=y
> -CONFIG_MACH_ACS5K=y
> -# CONFIG_ARM_THUMB is not set
> -CONFIG_PCI=y
> -CONFIG_PCI_DEBUG=y
> -CONFIG_PCCARD=y
> -CONFIG_YENTA=y
> -CONFIG_AEABI=y
> -CONFIG_ZBOOT_ROM_TEXT=0x0
> -CONFIG_ZBOOT_ROM_BSS=0x0
> -CONFIG_CMDLINE="mem=32M console=ttyS0,115200
> initrd=0x20410000,3145728 root=/dev/ram0 rw"
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -CONFIG_IP_PNP=y
> -CONFIG_IP_PNP_DHCP=y
> -# CONFIG_IPV6 is not set
> -CONFIG_MTD=y
> -CONFIG_MTD_BLOCK=y
> -CONFIG_MTD_CFI=y
> -CONFIG_MTD_JEDECPROBE=y
> -CONFIG_MTD_CFI_ADV_OPTIONS=y
> -CONFIG_MTD_CFI_INTELEXT=y
> -CONFIG_MTD_CFI_AMDSTD=y
> -CONFIG_MTD_PHYSMAP=y
> -CONFIG_BLK_DEV_RAM=y
> -CONFIG_BLK_DEV_RAM_SIZE=8192
> -CONFIG_NETDEVICES=y
> -CONFIG_NET_ETHERNET=y
> -CONFIG_ARM_KS8695_ETHER=y
> -CONFIG_PRISM54=m
> -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> -# CONFIG_INPUT_KEYBOARD is not set
> -# CONFIG_INPUT_MOUSE is not set
> -# CONFIG_SERIO is not set
> -CONFIG_SERIAL_KS8695=y
> -CONFIG_SERIAL_KS8695_CONSOLE=y
> -CONFIG_I2C=y
> -CONFIG_I2C_CHARDEV=y
> -CONFIG_I2C_GPIO=y
> -CONFIG_GPIO_SYSFS=y
> -CONFIG_GPIO_PCA953X=y
> -CONFIG_WATCHDOG=y
> -CONFIG_KS8695_WATCHDOG=y
> -# CONFIG_VGA_CONSOLE is not set
> -CONFIG_RTC_CLASS=y
> -CONFIG_RTC_DRV_PCF8563=y
> -CONFIG_EXT2_FS=y
> -CONFIG_TMPFS=y
> -CONFIG_JFFS2_FS=y
> -CONFIG_JFFS2_SUMMARY=y
> -CONFIG_JFFS2_COMPRESSION_OPTIONS=y
> -CONFIG_JFFS2_RUBIN=y
> -CONFIG_CRAMFS=y
> -CONFIG_NFS_FS=y
> -CONFIG_NFS_V3=y
> -CONFIG_ROOT_NFS=y
> -CONFIG_DEBUG_KERNEL=y
> -CONFIG_DEBUG_MUTEXES=y
> -# CONFIG_FTRACE is not set
> -CONFIG_DEBUG_USER=y
> -CONFIG_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 @@
> -# CONFIG_SWAP is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_POSIX_MQUEUE=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_SYSFS_DEPRECATED_V2=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_IOSCHED_DEADLINE is not set
> -# CONFIG_IOSCHED_CFQ is not set
> -CONFIG_ARCH_KS8695=y
> -CONFIG_MACH_ACS5K=y
> -# CONFIG_ARM_THUMB is not set
> -CONFIG_AEABI=y
> -CONFIG_ZBOOT_ROM_TEXT=0x0
> -CONFIG_ZBOOT_ROM_BSS=0x0
> -CONFIG_CMDLINE="console=ttyAM0,115200 init=/bin/sh"
> -CONFIG_FPE_NWFPE=y
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
> -# CONFIG_INET_XFRM_MODE_TUNNEL is not set
> -# CONFIG_INET_XFRM_MODE_BEET is not set
> -# CONFIG_IPV6 is not set
> -CONFIG_MTD=y
> -CONFIG_MTD_BLOCK=y
> -CONFIG_MTD_CFI=y
> -CONFIG_MTD_JEDECPROBE=y
> -CONFIG_MTD_CFI_ADV_OPTIONS=y
> -CONFIG_MTD_CFI_INTELEXT=y
> -CONFIG_MTD_CFI_AMDSTD=y
> -CONFIG_MTD_PHYSMAP=y
> -# CONFIG_BLK_DEV is not set
> -CONFIG_NETDEVICES=y
> -CONFIG_NET_ETHERNET=y
> -CONFIG_ARM_KS8695_ETHER=y
> -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> -# CONFIG_INPUT_KEYBOARD is not set
> -# CONFIG_INPUT_MOUSE is not set
> -# CONFIG_SERIO is not set
> -CONFIG_SERIAL_KS8695=y
> -CONFIG_SERIAL_KS8695_CONSOLE=y
> -# CONFIG_HW_RANDOM is not set
> -CONFIG_I2C=y
> -CONFIG_I2C_CHARDEV=y
> -CONFIG_I2C_GPIO=y
> -CONFIG_GPIO_SYSFS=y
> -CONFIG_GPIO_PCA953X=y
> -# CONFIG_HWMON is not set
> -CONFIG_WATCHDOG=y
> -CONFIG_KS8695_WATCHDOG=y
> -# CONFIG_VGA_CONSOLE is not set
> -# CONFIG_USB_SUPPORT is not set
> -CONFIG_RTC_CLASS=y
> -CONFIG_RTC_DRV_PCF8563=y
> -CONFIG_TMPFS=y
> -CONFIG_JFFS2_FS=y
> -CONFIG_JFFS2_SUMMARY=y
> -CONFIG_JFFS2_COMPRESSION_OPTIONS=y
> -CONFIG_JFFS2_RUBIN=y
> -CONFIG_SQUASHFS=y
> -# CONFIG_NETWORK_FILESYSTEMS is not set
> -CONFIG_DEBUG_KERNEL=y
> -CONFIG_DEBUG_MUTEXES=y
> -# CONFIG_FTRACE is not set
> -CONFIG_DEBUG_USER=y
> 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 @@
> -# CONFIG_SWAP is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_SYSFS_DEPRECATED_V2=y
> -CONFIG_BLK_DEV_INITRD=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_IOSCHED_DEADLINE is not set
> -# CONFIG_IOSCHED_CFQ is not set
> -CONFIG_ARCH_KS8695=y
> -CONFIG_MACH_KS8695=y
> -CONFIG_MACH_DSM320=y
> -# CONFIG_ARM_THUMB is not set
> -CONFIG_PCI=y
> -CONFIG_PCI_DEBUG=y
> -CONFIG_PCCARD=y
> -CONFIG_YENTA=y
> -CONFIG_AEABI=y
> -CONFIG_ZBOOT_ROM_TEXT=0x0
> -CONFIG_ZBOOT_ROM_BSS=0x0
> -CONFIG_CMDLINE="mem=32M console=ttyS0,115200
> initrd=0x20410000,3145728 root=/dev/ram0 rw"
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -CONFIG_IP_PNP=y
> -CONFIG_IP_PNP_DHCP=y
> -# CONFIG_IPV6 is not set
> -CONFIG_MTD=y
> -CONFIG_MTD_REDBOOT_PARTS=y
> -CONFIG_MTD_CMDLINE_PARTS=y
> -CONFIG_MTD_BLOCK=y
> -CONFIG_MTD_CFI=y
> -CONFIG_MTD_JEDECPROBE=y
> -CONFIG_MTD_CFI_INTELEXT=y
> -CONFIG_MTD_PHYSMAP=y
> -CONFIG_BLK_DEV_RAM=y
> -CONFIG_BLK_DEV_RAM_SIZE=8192
> -CONFIG_NETDEVICES=y
> -CONFIG_NET_ETHERNET=y
> -CONFIG_MII=y
> -CONFIG_PRISM54=m
> -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> -# CONFIG_INPUT_KEYBOARD is not set
> -# CONFIG_INPUT_MOUSE is not set
> -# CONFIG_SERIO is not set
> -CONFIG_SERIAL_KS8695=y
> -CONFIG_SERIAL_KS8695_CONSOLE=y
> -# CONFIG_HWMON is not set
> -# CONFIG_VGA_CONSOLE is not set
> -CONFIG_EXT2_FS=y
> -CONFIG_TMPFS=y
> -CONFIG_JFFS2_FS=y
> -CONFIG_JFFS2_SUMMARY=y
> -CONFIG_JFFS2_COMPRESSION_OPTIONS=y
> -CONFIG_JFFS2_RUBIN=y
> -CONFIG_CRAMFS=y
> -CONFIG_NFS_FS=y
> -CONFIG_NFS_V3=y
> -CONFIG_ROOT_NFS=y
> -CONFIG_DEBUG_KERNEL=y
> -CONFIG_DEBUG_MUTEXES=y
> -# CONFIG_FTRACE is not set
> -CONFIG_DEBUG_USER=y
> -CONFIG_DEBUG_LL=y
> 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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/include/debug/ks8695.S
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - Debug macros
> - */
> -
> -#define KS8695_UART_PA	0x03ffe000
> -#define KS8695_UART_VA	0xf00fe000
> -#define KS8695_URTH	(0x04)
> -#define KS8695_URLS	(0x14)
> -#define URLS_URTE	(1 << 6)
> -#define URLS_URTHRE	(1 << 5)
> -
> -	.macro	addruart, rp, rv, tmp
> -		ldr	\rp, =KS8695_UART_PA		@ physical base address
> -		ldr	\rv, =KS8695_UART_VA		@ virtual base address
> -	.endm
> -
> -	.macro	senduart, rd, rx
> -		str	\rd, [\rx, #KS8695_URTH]	@ Write to Transmit Holding Register
> -	.endm
> -
> -	.macro	busyuart, rd, rx
> -1001:		ldr	\rd, [\rx, #KS8695_URLS]	@ Read Line Status Register
> -		tst	\rd, #URLS_URTE			@ Holding & Shift registers empty?
> -		beq	1001b
> -	.endm
> -
> -	.macro	waituart, rd, rx
> -1001:		ldr	\rd, [\rx, #KS8695_URLS]	@ Read Line Status Register
> -		tst	\rd, #URLS_URTHRE		@ Holding Register empty?
> -		beq	1001b
> -	.endm
> 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 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -if ARCH_KS8695
> -
> -menu "Kendin/Micrel KS8695 Implementations"
> -
> -config MACH_KS8695
> -	bool "KS8695 development board"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to run on the original
> -	  Kendin-Micrel KS8695 development board.
> -
> -config MACH_DSM320
> -	bool "DSM-320 Wireless Media Player"
> -	help
> -	  Say 'Y' here if you want your kernel to run on the D-Link
> -	  DSM-320 Wireless Media Player.
> -
> -config MACH_ACS5K
> -	bool "Brivo Systems LLC, ACS-5000 Master board"
> -	help
> -	  say 'Y' here if you want your kernel to run on the Brivo
> -	  Systems LLC, ACS-5000 Master board.
> -
> -config MACH_LITE300
> -	bool "SecureComputing SG300"
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  SecureComputing / SnapGear SG300 VPN Internet Router.
> -	  See http://www.securecomputing.com for more details.
> -
> -config MACH_SG310
> -	bool "McAfee SG310"
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  McAfee / SnapGear SG310 VPN Internet Router.
> -	  See http://www.mcafee.com for more details.
> -
> -config MACH_SE4200
> -	bool "SecureComputing SE4200"
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  SecureComputing / SnapGear SE4200 Secure Wireless VPN
> -	  Internet Router.
> -	  See http://www.securecomputing.com for more details.
> -
> -config MACH_CM4002
> -	bool "OpenGear CM4002"
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  CM4002 Secure Access Server. See http://www.opengear.com for
> -	  more details.
> -
> -config MACH_CM4008
> -	bool "OpenGear CM4008"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  CM4008 Console Server. See http://www.opengear.com for more
> -	  details.
> -
> -config MACH_CM41xx
> -	bool "OpenGear CM41xx"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  CM4016 or CM4048 Console Servers. See http://www.opengear.com for
> -	  more details.
> -
> -config MACH_IM4004
> -	bool "OpenGear IM4004"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  IM4004 Secure Access Server. See http://www.opengear.com for
> -	  more details.
> -
> -config MACH_IM42xx
> -	bool "OpenGear IM42xx"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  IM4216 or IM4248 Console Servers. See http://www.opengear.com for
> -	  more details.
> -
> -endmenu
> -
> -endif
> 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 @@
> -# SPDX-License-Identifier: GPL-2.0
> -# arch/arm/mach-ks8695/Makefile
> -#
> -# Makefile for KS8695 architecture support
> -#
> -
> -obj-y				:= cpu.o irq.o time.o devices.o
> -
> -# PCI support is optional
> -obj-$(CONFIG_PCI)		+= pci.o
> -
> -# Board-specific support
> -obj-$(CONFIG_MACH_KS8695)	+= board-micrel.o
> -obj-$(CONFIG_MACH_DSM320)	+= board-dsm320.o
> -obj-$(CONFIG_MACH_ACS5K)	+= board-acs5k.o
> -obj-$(CONFIG_MACH_LITE300)	+= board-sg.o
> -obj-$(CONFIG_MACH_SG310)	+= board-sg.o
> -obj-$(CONFIG_MACH_SE4200)	+= board-sg.o
> -obj-$(CONFIG_MACH_CM4002)	+= board-og.o
> -obj-$(CONFIG_MACH_CM4008)	+= board-og.o
> -obj-$(CONFIG_MACH_CM41xx)	+= board-og.o
> -obj-$(CONFIG_MACH_IM4004)	+= board-og.o
> -obj-$(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 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -# Note: the following conditions must always be true:
> -#   ZRELADDR == virt_to_phys(TEXTADDR)
> -#   PARAMS_PHYS must be within 4MB of ZRELADDR
> -#   INITRD_PHYS must be in RAM
> -
> -   zreladdr-y	+= 0x00008000
> -params_phys-y	:= 0x00000100
> -initrd_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * arch/arm/mach-ks8695/board-acs5k.c
> - *
> - * Brivo Systems LLC, ACS-5000 Master Board
> - *
> - * Copyright 2008 Simtec Electronics
> - *		  Daniel Silverstone <dsilvers@simtec.co.uk>
> - */
> -#include <linux/gpio.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/gpio/machine.h>
> -#include <linux/i2c.h>
> -#include <linux/i2c-algo-bit.h>
> -#include <linux/platform_data/i2c-gpio.h>
> -#include <linux/platform_data/pca953x.h>
> -
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/map.h>
> -#include <linux/mtd/physmap.h>
> -#include <linux/mtd/partitions.h>
> -
> -#include <asm/mach-types.h>
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include <asm/mach/irq.h>
> -
> -#include "devices.h"
> -#include <mach/gpio-ks8695.h>
> -
> -#include "generic.h"
> -
> -static struct gpiod_lookup_table acs5k_i2c_gpiod_table = {
> -	.dev_id		= "i2c-gpio",
> -	.table		= {
> -		GPIO_LOOKUP_IDX("KS8695", 4, NULL, 0,
> -				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
> -		GPIO_LOOKUP_IDX("KS8695", 5, NULL, 1,
> -				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
> -	},
> -};
> -
> -static struct i2c_gpio_platform_data acs5k_i2c_device_platdata = {
> -	.udelay		= 10,
> -};
> -
> -static struct platform_device acs5k_i2c_device = {
> -	.name		= "i2c-gpio",
> -	.id		= -1,
> -	.num_resources	= 0,
> -	.resource	= NULL,
> -	.dev		= {
> -		.platform_data	= &acs5k_i2c_device_platdata,
> -	},
> -};
> -
> -static int acs5k_pca9555_setup(struct i2c_client *client,
> -			       unsigned gpio_base, unsigned ngpio,
> -			       void *context)
> -{
> -	static int acs5k_gpio_value[] = {
> -		-1, -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, 0, 1, 0, -1, -1
> -	};
> -	int n;
> -
> -	for (n = 0; n < ARRAY_SIZE(acs5k_gpio_value); ++n) {
> -		gpio_request(gpio_base + n, "ACS-5000 GPIO Expander");
> -		if (acs5k_gpio_value[n] < 0)
> -			gpio_direction_input(gpio_base + n);
> -		else
> -			gpio_direction_output(gpio_base + n,
> -					      acs5k_gpio_value[n]);
> -		gpio_export(gpio_base + n, 0); /* Export, direction locked down */
> -	}
> -
> -	return 0;
> -}
> -
> -static struct pca953x_platform_data acs5k_i2c_pca9555_platdata = {
> -	.gpio_base	= 16, /* Start directly after the CPU's GPIO */
> -	.invert		= 0, /* Do not invert */
> -	.setup		= acs5k_pca9555_setup,
> -};
> -
> -static struct i2c_board_info acs5k_i2c_devs[] __initdata = {
> -	{
> -		I2C_BOARD_INFO("pcf8563", 0x51),
> -	},
> -	{
> -		I2C_BOARD_INFO("pca9555", 0x20),
> -		.platform_data = &acs5k_i2c_pca9555_platdata,
> -	},
> -};
> -
> -static void __init acs5k_i2c_init(void)
> -{
> -	/* The gpio interface */
> -	gpiod_add_lookup_table(&acs5k_i2c_gpiod_table);
> -	platform_device_register(&acs5k_i2c_device);
> -	/* I2C devices */
> -	i2c_register_board_info(0, acs5k_i2c_devs,
> -				ARRAY_SIZE(acs5k_i2c_devs));
> -}
> -
> -static struct mtd_partition acs5k_nor_partitions[] = {
> -	[0] = {
> -		.name	= "Boot Agent and config",
> -		.size	= SZ_256K,
> -		.offset	= 0,
> -		.mask_flags = MTD_WRITEABLE,
> -	},
> -	[1] = {
> -		.name	= "Kernel",
> -		.size	= SZ_1M,
> -		.offset	= SZ_256K,
> -	},
> -	[2] = {
> -		.name	= "SquashFS1",
> -		.size	= SZ_2M,
> -		.offset	= SZ_256K + SZ_1M,
> -	},
> -	[3] = {
> -		.name	= "SquashFS2",
> -		.size	= SZ_4M + SZ_2M,
> -		.offset	= SZ_256K + SZ_1M + SZ_2M,
> -	},
> -	[4] = {
> -		.name	= "Data",
> -		.size	= SZ_16M + SZ_4M + SZ_2M + SZ_512K, /* 22.5 MB */
> -		.offset	= SZ_256K + SZ_8M + SZ_1M,
> -	}
> -};
> -
> -static struct physmap_flash_data acs5k_nor_pdata = {
> -	.width		= 4,
> -	.nr_parts	= ARRAY_SIZE(acs5k_nor_partitions),
> -	.parts		= acs5k_nor_partitions,
> -};
> -
> -static struct resource acs5k_nor_resource[] = {
> -	[0] = {
> -		.start = SZ_32M, /* We expect the bootloader to map
> -				  * the flash here.
> -				  */
> -		.end   = SZ_32M + SZ_16M - 1,
> -		.flags = IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.start = SZ_32M + SZ_16M,
> -		.end   = SZ_32M + SZ_32M - SZ_256K - 1,
> -		.flags = IORESOURCE_MEM,
> -	}
> -};
> -
> -static struct platform_device acs5k_device_nor = {
> -	.name		= "physmap-flash",
> -	.id		= -1,
> -	.num_resources	= ARRAY_SIZE(acs5k_nor_resource),
> -	.resource	= acs5k_nor_resource,
> -	.dev		= {
> -		.platform_data = &acs5k_nor_pdata,
> -	},
> -};
> -
> -static void __init acs5k_register_nor(void)
> -{
> -	int ret;
> -
> -	if (acs5k_nor_partitions[0].mask_flags == 0)
> -		printk(KERN_WARNING "Warning: Unprotecting bootloader and
> configuration partition\n");
> -
> -	ret = platform_device_register(&acs5k_device_nor);
> -	if (ret < 0)
> -		printk(KERN_ERR "failed to register physmap-flash device\n");
> -}
> -
> -static int __init acs5k_protection_setup(char *s)
> -{
> -	/* We can't allocate anything here but we should be able
> -	 * to trivially parse s and decide if we can protect the
> -	 * bootloader partition or not
> -	 */
> -	if (strcmp(s, "no") == 0)
> -		acs5k_nor_partitions[0].mask_flags = 0;
> -
> -	return 1;
> -}
> -
> -__setup("protect_bootloader=", acs5k_protection_setup);
> -
> -static void __init acs5k_init_gpio(void)
> -{
> -	int i;
> -
> -	ks8695_register_gpios();
> -	for (i = 0; i < 4; ++i)
> -		gpio_request(i, "ACS5K IRQ");
> -	gpio_request(7, "ACS5K KS_FRDY");
> -	for (i = 8; i < 16; ++i)
> -		gpio_request(i, "ACS5K Unused");
> -
> -	gpio_request(3, "ACS5K CAN Control");
> -	gpio_request(6, "ACS5K Heartbeat");
> -	gpio_direction_output(3, 1); /* Default CAN_RESET high */
> -	gpio_direction_output(6, 0); /* Default KS8695_ACTIVE low */
> -	gpio_export(3, 0); /* export CAN_RESET as output only */
> -	gpio_export(6, 0); /* export KS8695_ACTIVE as output only */
> -}
> -
> -static void __init acs5k_init(void)
> -{
> -	acs5k_init_gpio();
> -
> -	/* Network device */
> -	ks8695_add_device_lan();	/* eth0 = LAN */
> -	ks8695_add_device_wan();	/* ethX = WAN */
> -
> -	/* NOR devices */
> -	acs5k_register_nor();
> -
> -	/* I2C bus */
> -	acs5k_i2c_init();
> -}
> -
> -MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
> -	/* Maintainer: Simtec Electronics. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= acs5k_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * arch/arm/mach-ks8695/board-dsm320.c
> - *
> - * DSM-320 D-Link Wireless Media Player, board support.
> - *
> - * Copyright 2008 Simtec Electronics
> - *		  Daniel Silverstone <dsilvers@simtec.co.uk>
> - */
> -#include <linux/gpio.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/map.h>
> -#include <linux/mtd/physmap.h>
> -#include <linux/mtd/partitions.h>
> -
> -#include <asm/mach-types.h>
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include <asm/mach/irq.h>
> -
> -#include "devices.h"
> -#include <mach/gpio-ks8695.h>
> -
> -#include "generic.h"
> -
> -#ifdef CONFIG_PCI
> -static int dsm320_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 
> pin)
> -{
> -	switch (slot) {
> -	case 0:
> -		/* PCI-AHB bridge? */
> -		return KS8695_IRQ_EXTERN0;
> -	case 18:
> -		/* Mini PCI slot */
> -		return KS8695_IRQ_EXTERN2;
> -	case 20:
> -		/* RealMAGIC chip */
> -		return KS8695_IRQ_EXTERN0;
> -	}
> -	BUG();
> -}
> -
> -static struct ks8695_pci_cfg __initdata dsm320_pci = {
> -	.mode		= KS8695_MODE_MINIPCI,
> -	.map_irq	= dsm320_pci_map_irq,
> -};
> -
> -static void __init dsm320_register_pci(void)
> -{
> -	/* Initialise the GPIO lines for interrupt mode */
> -	/* RealMAGIC */
> -	ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
> -	/* MiniPCI Slot */
> -	ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW);
> -
> -	ks8695_init_pci(&dsm320_pci);
> -}
> -
> -#else
> -static inline void __init dsm320_register_pci(void) { }
> -#endif
> -
> -static struct physmap_flash_data dsm320_nor_pdata = {
> -	.width		= 4,
> -	.nr_parts	= 0,
> -};
> -
> -static struct resource dsm320_nor_resource[] = {
> -	[0] = {
> -		.start = SZ_32M, /* We expect the bootloader to map
> -				  * the flash here.
> -				  */
> -		.end   = SZ_32M + SZ_4M - 1,
> -		.flags = IORESOURCE_MEM,
> -	}
> -};
> -
> -static struct platform_device dsm320_device_nor = {
> -	.name		= "physmap-flash",
> -	.id		= -1,
> -	.num_resources	= ARRAY_SIZE(dsm320_nor_resource),
> -	.resource	= dsm320_nor_resource,
> -	.dev		= {
> -		.platform_data = &dsm320_nor_pdata,
> -	},
> -};
> -
> -void __init dsm320_register_nor(void)
> -{
> -	int ret;
> -
> -	ret = platform_device_register(&dsm320_device_nor);
> -	if (ret < 0)
> -		printk(KERN_ERR "failed to register physmap-flash device\n");
> -}
> -
> -static void __init dsm320_init(void)
> -{
> -	/* GPIO registration */
> -	ks8695_register_gpios();
> -
> -	/* PCI registration */
> -	dsm320_register_pci();
> -
> -	/* Network device */
> -	ks8695_add_device_lan();	/* eth0 = LAN */
> -
> -	/* NOR devices */
> -	dsm320_register_nor();
> -}
> -
> -MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
> -	/* Maintainer: Simtec Electronics. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= dsm320_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * arch/arm/mach-ks8695/board-micrel.c
> - */
> -#include <linux/gpio.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -
> -#include <asm/mach-types.h>
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include <asm/mach/irq.h>
> -
> -#include <mach/gpio-ks8695.h>
> -#include "devices.h"
> -
> -#include "generic.h"
> -
> -#ifdef CONFIG_PCI
> -static int micrel_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 
> pin)
> -{
> -	return KS8695_IRQ_EXTERN0;
> -}
> -
> -static struct ks8695_pci_cfg __initdata micrel_pci = {
> -	.mode		= KS8695_MODE_MINIPCI,
> -	.map_irq	= micrel_pci_map_irq,
> -};
> -#endif
> -
> -
> -static void __init micrel_init(void)
> -{
> -	printk(KERN_INFO "Micrel KS8695 Development Board initializing\n");
> -
> -	ks8695_register_gpios();
> -
> -#ifdef CONFIG_PCI
> -	ks8695_init_pci(&micrel_pci);
> -#endif
> -
> -	/* Add devices */
> -	ks8695_add_device_wan();	/* eth0 = WAN */
> -	ks8695_add_device_lan();	/* eth1 = LAN */
> -}
> -
> -MACHINE_START(KS8695, "KS8695 Centaur Development Board")
> -	/* Maintainer: Micrel Semiconductor Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= micrel_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * board-og.c -- support for the OpenGear KS8695 based boards.
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/delay.h>
> -#include <linux/platform_device.h>
> -#include <linux/serial_8250.h>
> -#include <linux/gpio.h>
> -#include <linux/irq.h>
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include "devices.h"
> -#include <mach/regs-gpio.h>
> -#include <mach/gpio-ks8695.h>
> -#include "generic.h"
> -
> -static int og_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> -{
> -	if (machine_is_im4004() && (slot == 8))
> -		return KS8695_IRQ_EXTERN1;
> -	return KS8695_IRQ_EXTERN0;
> -}
> -
> -static struct ks8695_pci_cfg __initdata og_pci = {
> -	.mode		= KS8695_MODE_PCI,
> -	.map_irq	= og_pci_map_irq,
> -};
> -
> -static void __init og_register_pci(void)
> -{
> -	/* Initialize the GPIO lines for interrupt mode */
> -	ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
> -
> -	/* Cardbus Slot */
> -	if (machine_is_im4004())
> -		ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW);
> -
> -	if (IS_ENABLED(CONFIG_PCI))
> -		ks8695_init_pci(&og_pci);
> -}
> -
> -/*
> - * The PCI bus reset is driven by a dedicated GPIO line. Toggle it 
> here
> - * and bring the PCI bus out of reset.
> - */
> -static void __init og_pci_bus_reset(void)
> -{
> -	unsigned int rstline = 1;
> -
> -	/* Some boards use a different GPIO as the PCI reset line */
> -	if (machine_is_im4004())
> -		rstline = 2;
> -	else if (machine_is_im42xx())
> -		rstline = 0;
> -
> -	gpio_request(rstline, "PCI reset");
> -	gpio_direction_output(rstline, 0);
> -
> -	/* Drive a reset on the PCI reset line */
> -	gpio_set_value(rstline, 1);
> -	gpio_set_value(rstline, 0);
> -	mdelay(100);
> -	gpio_set_value(rstline, 1);
> -	mdelay(100);
> -}
> -
> -/*
> - * Direct connect serial ports (non-PCI that is).
> - */
> -#define	S8250_PHYS	0x03800000
> -#define	S8250_VIRT	0xf4000000
> -#define	S8250_SIZE	0x00100000
> -
> -static struct map_desc og_io_desc[] __initdata = {
> -	{
> -		.virtual	= S8250_VIRT,
> -		.pfn		= __phys_to_pfn(S8250_PHYS),
> -		.length		= S8250_SIZE,
> -		.type		= MT_DEVICE,
> -	}
> -};
> -
> -static struct resource og_uart_resources[] = {
> -	{
> -		.start		= S8250_VIRT,
> -		.end		= S8250_VIRT + S8250_SIZE,
> -		.flags		= IORESOURCE_MEM
> -	},
> -};
> -
> -static struct plat_serial8250_port og_uart_data[] = {
> -	{
> -		.mapbase	= S8250_VIRT,
> -		.membase	= (char *) S8250_VIRT,
> -		.irq		= 3,
> -		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
> -		.iotype		= UPIO_MEM,
> -		.regshift	= 2,
> -		.uartclk	= 115200 * 16,
> -	},
> -	{ },
> -};
> -
> -static struct platform_device og_uart = {
> -	.name			= "serial8250",
> -	.id			= 0,
> -	.dev.platform_data	= og_uart_data,
> -	.num_resources		= 1,
> -	.resource		= og_uart_resources
> -};
> -
> -static struct platform_device *og_devices[] __initdata = {
> -	&og_uart
> -};
> -
> -static void __init og_init(void)
> -{
> -	ks8695_register_gpios();
> -
> -	if (machine_is_cm4002()) {
> -		ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_HIGH);
> -		iotable_init(og_io_desc, ARRAY_SIZE(og_io_desc));
> -		platform_add_devices(og_devices, ARRAY_SIZE(og_devices));
> -	} else {
> -		og_pci_bus_reset();
> -		og_register_pci();
> -	}
> -
> -	ks8695_add_device_lan();
> -	ks8695_add_device_wan();
> -}
> -
> -#ifdef CONFIG_MACH_CM4002
> -MACHINE_START(CM4002, "OpenGear/CM4002")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_CM4008
> -MACHINE_START(CM4008, "OpenGear/CM4008")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_CM41xx
> -MACHINE_START(CM41XX, "OpenGear/CM41xx")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_IM4004
> -MACHINE_START(IM4004, "OpenGear/IM4004")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_IM42xx
> -MACHINE_START(IM42XX, "OpenGear/IM42xx")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * board-sg.c -- support for the SnapGear KS8695 based boards
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/map.h>
> -#include <linux/mtd/physmap.h>
> -#include <linux/mtd/partitions.h>
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
> -#include "devices.h"
> -#include "generic.h"
> -
> -/*
> - * The SG310 machine type is fitted with a conventional 8MB 
> Strataflash
> - * device. Define its partitioning.
> - */
> -#define	FL_BASE		0x02000000
> -#define	FL_SIZE		SZ_8M
> -
> -static struct mtd_partition sg_mtd_partitions[] = {
> -	[0] = {
> -		.name	= "SnapGear Boot Loader",
> -		.size	= SZ_128K,
> -	},
> -	[1] = {
> -		.name	= "SnapGear non-volatile configuration",
> -		.size	= SZ_512K,
> -		.offset	= SZ_256K,
> -	},
> -	[2] = {
> -		.name	= "SnapGear image",
> -		.offset	= SZ_512K + SZ_256K,
> -	},
> -	[3] = {
> -		.name	= "SnapGear StrataFlash",
> -	},
> -	[4] = {
> -		.name	= "SnapGear Boot Tags",
> -		.size	= SZ_128K,
> -		.offset	= SZ_128K,
> -	},
> -};
> -
> -static struct physmap_flash_data sg_mtd_pdata = {
> -	.width		= 1,
> -	.nr_parts	= ARRAY_SIZE(sg_mtd_partitions),
> -	.parts		= sg_mtd_partitions,
> -};
> -
> -
> -static struct resource sg_mtd_resource[] = {
> -	[0] = {
> -		.start = FL_BASE,
> -		.end   = FL_BASE + FL_SIZE - 1,
> -		.flags = IORESOURCE_MEM,
> -	},
> -};
> -
> -static struct platform_device sg_mtd_device = {
> -	.name		= "physmap-flash",
> -	.id		= 0,
> -	.num_resources	= ARRAY_SIZE(sg_mtd_resource),
> -	.resource	= sg_mtd_resource,
> -	.dev		= {
> -		.platform_data = &sg_mtd_pdata,
> -	},
> -};
> -
> -static void __init sg_init(void)
> -{
> -	ks8695_add_device_lan();
> -	ks8695_add_device_wan();
> -
> -	if (machine_is_sg310())
> -		platform_device_register(&sg_mtd_device);
> -}
> -
> -#ifdef CONFIG_MACH_LITE300
> -MACHINE_START(LITE300, "SecureComputing/SG300")
> -	/* SnapGear */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= sg_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_SG310
> -MACHINE_START(SG310, "McAfee/SG310")
> -	/* SnapGear */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= sg_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_SE4200
> -MACHINE_START(SE4200, "SecureComputing/SE4200")
> -	/* SnapGear */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= sg_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_END
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/cpu.c
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 CPU support
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/init.h>
> -#include <linux/io.h>
> -
> -#include <mach/hardware.h>
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -
> -#include "regs-sys.h"
> -#include <mach/regs-misc.h>
> -
> -
> -static struct map_desc ks8695_io_desc[] __initdata = {
> -	{
> -		.virtual	= (unsigned long)KS8695_IO_VA,
> -		.pfn		= __phys_to_pfn(KS8695_IO_PA),
> -		.length		= KS8695_IO_SIZE,
> -		.type		= MT_DEVICE,
> -	}
> -};
> -
> -static void __init ks8695_processor_info(void)
> -{
> -	unsigned long id, rev;
> -
> -	id = __raw_readl(KS8695_MISC_VA + KS8695_DID);
> -	rev = __raw_readl(KS8695_MISC_VA + KS8695_RID);
> -
> -	printk("KS8695 ID=%04lx  SubID=%02lx  Revision=%02lx\n", (id &
> DID_ID), (rev & RID_SUBID), (rev & RID_REVISION));
> -}
> -
> -static unsigned int sysclk[8] = { 125000000, 100000000, 62500000,
> 50000000, 41700000, 33300000, 31300000, 25000000 };
> -static unsigned int cpuclk[8] = { 166000000, 166000000, 83000000,
> 83000000, 55300000, 55300000, 41500000, 41500000 };
> -
> -static void __init ks8695_clock_info(void)
> -{
> -	unsigned int scdc = __raw_readl(KS8695_SYS_VA + KS8695_CLKCON) & 
> CLKCON_SCDC;
> -
> -	printk("Clocks: System %u MHz, CPU %u MHz\n",
> -			sysclk[scdc] / 1000000, cpuclk[scdc] / 1000000);
> -}
> -
> -void __init ks8695_map_io(void)
> -{
> -	iotable_init(ks8695_io_desc, ARRAY_SIZE(ks8695_io_desc));
> -
> -	ks8695_processor_info();
> -	ks8695_clock_info();
> -}
> 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 @@
> -/*
> - * arch/arm/mach-ks8695/devices.c
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * This program is free software; you can redistribute it and/or 
> modify
> - * it under the terms of the GNU General Public License as published 
> by
> - * the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  
> 02111-1307  USA
> - */
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -
> -#include <linux/gpio.h>
> -#include <linux/platform_device.h>
> -
> -#include <mach/irqs.h>
> -#include "regs-wan.h"
> -#include "regs-lan.h"
> -#include "regs-hpna.h"
> -#include <mach/regs-switch.h>
> -#include <mach/regs-misc.h>
> -
> -
> -/* 
> --------------------------------------------------------------------
> - *  Ethernet
> - * 
> -------------------------------------------------------------------- */
> -
> -static u64 eth_dmamask = 0xffffffffUL;
> -
> -static struct resource ks8695_wan_resources[] = {
> -	[0] = {
> -		.start	= KS8695_WAN_PA,
> -		.end	= KS8695_WAN_PA + 0x00ff,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.name	= "WAN RX",
> -		.start	= KS8695_IRQ_WAN_RX_STATUS,
> -		.end	= KS8695_IRQ_WAN_RX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[2] = {
> -		.name	= "WAN TX",
> -		.start	= KS8695_IRQ_WAN_TX_STATUS,
> -		.end	= KS8695_IRQ_WAN_TX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[3] = {
> -		.name	= "WAN Link",
> -		.start	= KS8695_IRQ_WAN_LINK,
> -		.end	= KS8695_IRQ_WAN_LINK,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[4] = {
> -		.name	= "WAN PHY",
> -		.start	= KS8695_MISC_PA,
> -		.end	= KS8695_MISC_PA + 0x1f,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -};
> -
> -static struct platform_device ks8695_wan_device = {
> -	.name		= "ks8695_ether",
> -	.id		= 0,
> -	.dev		= {
> -				.dma_mask		= &eth_dmamask,
> -				.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.resource	= ks8695_wan_resources,
> -	.num_resources	= ARRAY_SIZE(ks8695_wan_resources),
> -};
> -
> -
> -static struct resource ks8695_lan_resources[] = {
> -	[0] = {
> -		.start	= KS8695_LAN_PA,
> -		.end	= KS8695_LAN_PA + 0x00ff,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.name	= "LAN RX",
> -		.start	= KS8695_IRQ_LAN_RX_STATUS,
> -		.end	= KS8695_IRQ_LAN_RX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[2] = {
> -		.name	= "LAN TX",
> -		.start	= KS8695_IRQ_LAN_TX_STATUS,
> -		.end	= KS8695_IRQ_LAN_TX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[3] = {
> -		.name	= "LAN SWITCH",
> -		.start	= KS8695_SWITCH_PA,
> -		.end	= KS8695_SWITCH_PA + 0x4f,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -};
> -
> -static struct platform_device ks8695_lan_device = {
> -	.name		= "ks8695_ether",
> -	.id		= 1,
> -	.dev		= {
> -				.dma_mask		= &eth_dmamask,
> -				.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.resource	= ks8695_lan_resources,
> -	.num_resources	= ARRAY_SIZE(ks8695_lan_resources),
> -};
> -
> -
> -static struct resource ks8695_hpna_resources[] = {
> -	[0] = {
> -		.start	= KS8695_HPNA_PA,
> -		.end	= KS8695_HPNA_PA + 0x00ff,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.name	= "HPNA RX",
> -		.start	= KS8695_IRQ_HPNA_RX_STATUS,
> -		.end	= KS8695_IRQ_HPNA_RX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[2] = {
> -		.name	= "HPNA TX",
> -		.start	= KS8695_IRQ_HPNA_TX_STATUS,
> -		.end	= KS8695_IRQ_HPNA_TX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -};
> -
> -static struct platform_device ks8695_hpna_device = {
> -	.name		= "ks8695_ether",
> -	.id		= 2,
> -	.dev		= {
> -				.dma_mask		= &eth_dmamask,
> -				.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.resource	= ks8695_hpna_resources,
> -	.num_resources	= ARRAY_SIZE(ks8695_hpna_resources),
> -};
> -
> -void __init ks8695_add_device_wan(void)
> -{
> -	platform_device_register(&ks8695_wan_device);
> -}
> -
> -void __init ks8695_add_device_lan(void)
> -{
> -	platform_device_register(&ks8695_lan_device);
> -}
> -
> -void __init ks8696_add_device_hpna(void)
> -{
> -	platform_device_register(&ks8695_hpna_device);
> -}
> -
> -
> -/* 
> --------------------------------------------------------------------
> - *  Watchdog
> - * 
> -------------------------------------------------------------------- */
> -
> -static struct platform_device ks8695_wdt_device = {
> -	.name		= "ks8695_wdt",
> -	.id		= -1,
> -	.num_resources	= 0,
> -};
> -
> -static void __init ks8695_add_device_watchdog(void)
> -{
> -	platform_device_register(&ks8695_wdt_device);
> -}
> -
> -
> -/* 
> -------------------------------------------------------------------- */
> -
> -/*
> - * These devices are always present and don't need any board-specific
> - * setup.
> - */
> -static int __init ks8695_add_standard_devices(void)
> -{
> -	ks8695_add_device_watchdog();
> -	return 0;
> -}
> -
> -arch_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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/devices.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - */
> -
> -#ifndef __ASM_ARCH_DEVICES_H
> -#define __ASM_ARCH_DEVICES_H
> -
> -#include <linux/pci.h>
> -
> - /* Ethernet */
> -extern void __init ks8695_add_device_wan(void);
> -extern void __init ks8695_add_device_lan(void);
> -extern void __init ks8695_add_device_hpna(void);
> -
> - /* PCI */
> -#define KS8695_MODE_PCI		0
> -#define KS8695_MODE_MINIPCI	1
> -#define KS8695_MODE_CARDBUS	2
> -
> -struct ks8695_pci_cfg {
> -	short mode;
> -	int (*map_irq)(const struct pci_dev *, u8, u8);
> -};
> -extern __init void ks8695_init_pci(struct ks8695_pci_cfg *);
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> -/*
> - * arch/arm/mach-ks8695/generic.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> -*/
> -
> -extern __init void ks8695_map_io(void);
> -extern __init void ks8695_init_irq(void);
> -extern void ks8695_restart(enum reboot_mode, const char *);
> -extern 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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/entry-macro.S
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * Low-level IRQ helper macros for KS8695
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> -*/
> -
> -#include <mach/hardware.h>
> -#include <mach/regs-irq.h>
> -
> -	.macro  get_irqnr_preamble, base, tmp
> -		ldr	\base, =KS8695_IRQ_VA			@ Base address of interrupt controller
> -	.endm
> -
> -	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> -		ldr	\irqstat, [\base, #KS8695_INTMS]	@ Mask Status register
> -
> -		teq	\irqstat, #0
> -		beq	1001f
> -
> -		mov	\irqnr, #0
> -
> -		tst	\irqstat, #0xff
> -		moveq	\irqstat, \irqstat, lsr #8
> -		addeq	\irqnr, \irqnr, #8
> -		tsteq	\irqstat, #0xff
> -		moveq	\irqstat, \irqstat, lsr #8
> -		addeq	\irqnr, \irqnr, #8
> -		tsteq	\irqstat, #0xff
> -		moveq	\irqstat, \irqstat, lsr #8
> -		addeq	\irqnr, \irqnr, #8
> -		tst	\irqstat, #0x0f
> -		moveq	\irqstat, \irqstat, lsr #4
> -		addeq	\irqnr, \irqnr, #4
> -		tst	\irqstat, #0x03
> -		moveq	\irqstat, \irqstat, lsr #2
> -		addeq	\irqnr, \irqnr, #2
> -		tst	\irqstat, #0x01
> -		addseq	\irqnr, \irqnr, #1
> -1001:
> -	.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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * Copyright (C) 2006 Andrew Victor
> - */
> -
> -#ifndef __MACH_KS8659_GPIO_H
> -#define __MACH_KS8659_GPIO_H
> -
> -#include <linux/kernel.h>
> -
> -#define KS8695_GPIO_0		0
> -#define KS8695_GPIO_1		1
> -#define KS8695_GPIO_2		2
> -#define KS8695_GPIO_3		3
> -#define KS8695_GPIO_4		4
> -#define KS8695_GPIO_5		5
> -#define KS8695_GPIO_6		6
> -#define KS8695_GPIO_7		7
> -#define KS8695_GPIO_8		8
> -#define KS8695_GPIO_9		9
> -#define KS8695_GPIO_10		10
> -#define KS8695_GPIO_11		11
> -#define KS8695_GPIO_12		12
> -#define KS8695_GPIO_13		13
> -#define KS8695_GPIO_14		14
> -#define KS8695_GPIO_15		15
> -
> -/*
> - * Configure GPIO pin as external interrupt source.
> - */
> -extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
> -
> -/* Register the GPIOs */
> -extern void ks8695_register_gpios(void);
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/hardware.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - Memory Map definitions
> -*/
> -
> -#ifndef __ASM_ARCH_HARDWARE_H
> -#define __ASM_ARCH_HARDWARE_H
> -
> -#include <linux/sizes.h>
> -
> -/*
> - * Clocks are derived from MCLK, which is 25MHz
> - */
> -#define KS8695_CLOCK_RATE	25000000
> -
> -/*
> - * Physical RAM address.
> - */
> -#define KS8695_SDRAM_PA		0x00000000
> -
> -
> -/*
> - * We map an entire MiB with the System Configuration Registers in 
> even
> - * though only 64KiB is needed. This makes it easier for use with the
> - * head debug code as the initial MMU setup only deals in L1 sections.
> - */
> -#define KS8695_IO_PA		0x03F00000
> -#define KS8695_IO_VA		IOMEM(0xF0000000)
> -#define KS8695_IO_SIZE		SZ_1M
> -
> -#define KS8695_PCIMEM_PA	0x60000000
> -#define KS8695_PCIMEM_SIZE	SZ_512M
> -
> -#define KS8695_PCIIO_PA		0x80000000
> -#define KS8695_PCIIO_SIZE	SZ_64K
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/irqs.h
> - *
> - * Copyright (C) 2006 Simtec Electronics
> - *   Ben Dooks <ben@simtec.co.uk>
> - */
> -
> -#ifndef __ASM_ARCH_IRQS_H
> -#define __ASM_ARCH_IRQS_H
> -
> -
> -#define NR_IRQS				32
> -
> -/*
> - * IRQ definitions
> - */
> -#define KS8695_IRQ_COMM_RX		0
> -#define KS8695_IRQ_COMM_TX		1
> -#define KS8695_IRQ_EXTERN0		2
> -#define KS8695_IRQ_EXTERN1		3
> -#define KS8695_IRQ_EXTERN2		4
> -#define KS8695_IRQ_EXTERN3		5
> -#define KS8695_IRQ_TIMER0		6
> -#define KS8695_IRQ_TIMER1		7
> -#define KS8695_IRQ_UART_TX		8
> -#define KS8695_IRQ_UART_RX		9
> -#define KS8695_IRQ_UART_LINE_STATUS	10
> -#define KS8695_IRQ_UART_MODEM_STATUS	11
> -#define KS8695_IRQ_LAN_RX_STOP		12
> -#define KS8695_IRQ_LAN_TX_STOP		13
> -#define KS8695_IRQ_LAN_RX_BUF		14
> -#define KS8695_IRQ_LAN_TX_BUF		15
> -#define KS8695_IRQ_LAN_RX_STATUS	16
> -#define KS8695_IRQ_LAN_TX_STATUS	17
> -#define KS8695_IRQ_HPNA_RX_STOP		18
> -#define KS8695_IRQ_HPNA_TX_STOP		19
> -#define KS8695_IRQ_HPNA_RX_BUF		20
> -#define KS8695_IRQ_HPNA_TX_BUF		21
> -#define KS8695_IRQ_HPNA_RX_STATUS	22
> -#define KS8695_IRQ_HPNA_TX_STATUS	23
> -#define KS8695_IRQ_BUS_ERROR		24
> -#define KS8695_IRQ_WAN_RX_STOP		25
> -#define KS8695_IRQ_WAN_TX_STOP		26
> -#define KS8695_IRQ_WAN_RX_BUF		27
> -#define KS8695_IRQ_WAN_TX_BUF		28
> -#define KS8695_IRQ_WAN_RX_STATUS	29
> -#define KS8695_IRQ_WAN_TX_STATUS	30
> -#define KS8695_IRQ_WAN_LINK		31
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/memory.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 Memory definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef __ASM_ARCH_MEMORY_H
> -#define __ASM_ARCH_MEMORY_H
> -
> -#include <mach/hardware.h>
> -
> -#ifndef __ASSEMBLY__
> -
> -#ifdef CONFIG_PCI
> -
> -/* PCI mappings */
> -#define __virt_to_bus(x)	((x) - PAGE_OFFSET + KS8695_PCIMEM_PA)
> -#define __bus_to_virt(x)	((x) - KS8695_PCIMEM_PA + PAGE_OFFSET)
> -
> -/* Platform-bus mapping */
> -extern struct bus_type platform_bus_type;
> -#define is_lbus_device(dev)		(dev && dev->bus == &platform_bus_type)
> -#define __arch_dma_to_virt(dev, x)	({ (void *) (is_lbus_device(dev) ? 
> \
> -					__phys_to_virt(x) : __bus_to_virt(x)); })
> -#define __arch_virt_to_dma(dev, x)	({ is_lbus_device(dev) ? \
> -					(dma_addr_t)__virt_to_phys((unsigned long)x) \
> -					: (dma_addr_t)__virt_to_bus(x); })
> -#define __arch_pfn_to_dma(dev, pfn)	\
> -	({ dma_addr_t __dma = __pfn_to_phys(pfn); \
> -	   if (!is_lbus_device(dev)) \
> -		__dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
> -	   __dma; })
> -
> -#define __arch_dma_to_pfn(dev, x)	\
> -	({ dma_addr_t __dma = x;				\
> -	   if (!is_lbus_device(dev))				\
> -		__dma += PHYS_OFFSET - KS8695_PCIMEM_PA;	\
> -	   __phys_to_pfn(__dma);				\
> -	})
> -
> -#endif
> -
> -#endif
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-gpio.h
> - *
> - * Copyright (C) 2007 Andrew Victor
> - *
> - * KS8695 - GPIO control registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_GPIO_H
> -#define KS8695_GPIO_H
> -
> -#define KS8695_GPIO_OFFSET	(0xF0000 + 0xE600)
> -#define KS8695_GPIO_VA		(KS8695_IO_VA + KS8695_GPIO_OFFSET)
> -#define KS8695_GPIO_PA		(KS8695_IO_PA + KS8695_GPIO_OFFSET)
> -
> -
> -#define KS8695_IOPM		(0x00)		/* I/O Port Mode Register */
> -#define KS8695_IOPC		(0x04)		/* I/O Port Control Register */
> -#define KS8695_IOPD		(0x08)		/* I/O Port Data Register */
> -
> -
> -/* Port Mode Register */
> -#define IOPM(x)			(1 << (x))	/* Mode for GPIO Pin x */
> -
> -/* Port Control Register */
> -#define IOPC_IOTIM1EN		(1 << 17)	/* GPIO Pin for Timer1 Enable */
> -#define IOPC_IOTIM0EN		(1 << 16)	/* GPIO Pin for Timer0 Enable */
> -#define IOPC_IOEINT3EN		(1 << 15)	/* GPIO Pin for External/Soft
> Interrupt 3 Enable */
> -#define IOPC_IOEINT3TM		(7 << 12)	/* GPIO Pin for External/Soft
> Interrupt 3 Trigger Mode */
> -#define IOPC_IOEINT3_MODE(x)	((x) << 12)
> -#define IOPC_IOEINT2EN		(1 << 11)	/* GPIO Pin for External/Soft
> Interrupt 2 Enable */
> -#define IOPC_IOEINT2TM		(7 << 8)	/* GPIO Pin for External/Soft
> Interrupt 2 Trigger Mode */
> -#define IOPC_IOEINT2_MODE(x)	((x) << 8)
> -#define IOPC_IOEINT1EN		(1 << 7)	/* GPIO Pin for External/Soft
> Interrupt 1 Enable */
> -#define IOPC_IOEINT1TM		(7 << 4)	/* GPIO Pin for External/Soft
> Interrupt 1 Trigger Mode */
> -#define IOPC_IOEINT1_MODE(x)	((x) << 4)
> -#define IOPC_IOEINT0EN		(1 << 3)	/* GPIO Pin for External/Soft
> Interrupt 0 Enable */
> -#define IOPC_IOEINT0TM		(7 << 0)	/* GPIO Pin for External/Soft
> Interrupt 0 Trigger Mode */
> -#define IOPC_IOEINT0_MODE(x)	((x) << 0)
> -
> - /* Trigger Modes */
> -#define IOPC_TM_LOW		(0)		/* Level Detection (Active Low) */
> -#define IOPC_TM_HIGH		(1)		/* Level Detection (Active High) */
> -#define IOPC_TM_RISING		(2)		/* Rising Edge Detection */
> -#define IOPC_TM_FALLING		(4)		/* Falling Edge Detection */
> -#define IOPC_TM_EDGE		(6)		/* Both Edge Detection */
> -
> -/* Port Data Register */
> -#define IOPD(x)			(1 << (x))	/* Signal Level of GPIO Pin x */
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-irq.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - IRQ registers and bit definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_IRQ_H
> -#define KS8695_IRQ_H
> -
> -#define KS8695_IRQ_OFFSET	(0xF0000 + 0xE200)
> -#define KS8695_IRQ_VA		(KS8695_IO_VA + KS8695_IRQ_OFFSET)
> -#define KS8695_IRQ_PA		(KS8695_IO_PA + KS8695_IRQ_OFFSET)
> -
> -
> -/*
> - * Interrupt Controller registers
> - */
> -#define KS8695_INTMC		(0x00)		/* Mode Control Register */
> -#define KS8695_INTEN		(0x04)		/* Interrupt Enable Register */
> -#define KS8695_INTST		(0x08)		/* Interrupt Status Register */
> -#define KS8695_INTPW		(0x0c)		/* Interrupt Priority (WAN MAC) */
> -#define KS8695_INTPH		(0x10)		/* Interrupt Priority (HPNA) [KS8695 
> only] */
> -#define KS8695_INTPL		(0x14)		/* Interrupt Priority (LAN MAC) */
> -#define KS8695_INTPT		(0x18)		/* Interrupt Priority (Timer) */
> -#define KS8695_INTPU		(0x1c)		/* Interrupt Priority (UART) */
> -#define KS8695_INTPE		(0x20)		/* Interrupt Priority (External 
> Interrupt) */
> -#define KS8695_INTPC		(0x24)		/* Interrupt Priority (Communications 
> Channel) */
> -#define KS8695_INTPBE		(0x28)		/* Interrupt Priority (Bus Error 
> Response) */
> -#define KS8695_INTMS		(0x2c)		/* Interrupt Mask Status Register */
> -#define KS8695_INTHPF		(0x30)		/* Interrupt Pending Highest Priority 
> (FIQ) */
> -#define KS8695_INTHPI		(0x34)		/* Interrupt Pending Highest Priority 
> (IRQ) */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-misc.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - Miscellaneous Registers
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_MISC_H
> -#define KS8695_MISC_H
> -
> -#define KS8695_MISC_OFFSET	(0xF0000 + 0xEA00)
> -#define KS8695_MISC_VA		(KS8695_IO_VA + KS8695_MISC_OFFSET)
> -#define KS8695_MISC_PA		(KS8695_IO_PA + KS8695_MISC_OFFSET)
> -
> -
> -/*
> - * Miscellaneous registers
> - */
> -#define KS8695_DID		(0x00)		/* Device ID */
> -#define KS8695_RID		(0x04)		/* Revision ID */
> -#define KS8695_HMC		(0x08)		/* HPNA Miscellaneous Control [KS8695 
> only] */
> -#define KS8695_WMC		(0x0c)		/* WAN Miscellaneous Control */
> -#define KS8695_WPPM		(0x10)		/* WAN PHY Power Management */
> -#define KS8695_PPS		(0x1c)		/* PHY PowerSave */
> -
> -/* Device ID Register */
> -#define DID_ID			(0xffff << 0)	/* Device ID */
> -
> -/* Revision ID Register */
> -#define RID_SUBID		(0xf << 4)	/* Sub-Device ID */
> -#define RID_REVISION		(0xf << 0)	/* Revision ID */
> -
> -/* HPNA Miscellaneous Control Register */
> -#define HMC_HSS			(1 << 1)	/* Speed */
> -#define HMC_HDS			(1 << 0)	/* Duplex */
> -
> -/* WAN Miscellaneous Control Register */
> -#define WMC_WANC		(1 << 30)	/* Auto-negotiation complete */
> -#define WMC_WANR		(1 << 29)	/* Auto-negotiation restart */
> -#define WMC_WANAP		(1 << 28)	/* Advertise Pause */
> -#define WMC_WANA100F		(1 << 27)	/* Advertise 100 FDX */
> -#define WMC_WANA100H		(1 << 26)	/* Advertise 100 HDX */
> -#define WMC_WANA10F		(1 << 25)	/* Advertise 10 FDX */
> -#define WMC_WANA10H		(1 << 24)	/* Advertise 10 HDX */
> -#define WMC_WLS			(1 << 23)	/* Link status */
> -#define WMC_WDS			(1 << 22)	/* Duplex status */
> -#define WMC_WSS			(1 << 21)	/* Speed status */
> -#define WMC_WLPP		(1 << 20)	/* Link Partner Pause */
> -#define WMC_WLP100F		(1 << 19)	/* Link Partner 100 FDX */
> -#define WMC_WLP100H		(1 << 18)	/* Link Partner 100 HDX */
> -#define WMC_WLP10F		(1 << 17)	/* Link Partner 10 FDX */
> -#define WMC_WLP10H		(1 << 16)	/* Link Partner 10 HDX */
> -#define WMC_WAND		(1 << 15)	/* Auto-negotiation disable */
> -#define WMC_WANF100		(1 << 14)	/* Force 100 */
> -#define WMC_WANFF		(1 << 13)	/* Force FDX */
> -#define WMC_WLED1S		(7 <<  4)	/* LED1 Select */
> -#define		WLED1S_SPEED		(0 << 4)
> -#define		WLED1S_LINK		(1 << 4)
> -#define		WLED1S_DUPLEX		(2 << 4)
> -#define		WLED1S_COLLISION	(3 << 4)
> -#define		WLED1S_ACTIVITY		(4 << 4)
> -#define		WLED1S_FDX_COLLISION	(5 << 4)
> -#define		WLED1S_LINK_ACTIVITY	(6 << 4)
> -#define WMC_WLED0S		(7 << 0)	/* LED0 Select */
> -#define		WLED0S_SPEED		(0 << 0)
> -#define		WLED0S_LINK		(1 << 0)
> -#define		WLED0S_DUPLEX		(2 << 0)
> -#define		WLED0S_COLLISION	(3 << 0)
> -#define		WLED0S_ACTIVITY		(4 << 0)
> -#define		WLED0S_FDX_COLLISION	(5 << 0)
> -#define		WLED0S_LINK_ACTIVITY	(6 << 0)
> -
> -/* WAN PHY Power Management Register */
> -#define WPPM_WLPBK		(1 << 14)	/* Local Loopback */
> -#define WPPM_WRLPKB		(1 << 13)	/* Remove Loopback */
> -#define WPPM_WPI		(1 << 12)	/* PHY isolate */
> -#define WPPM_WFL		(1 << 10)	/* Force link */
> -#define WPPM_MDIXS		(1 << 9)	/* MDIX Status */
> -#define WPPM_FEF		(1 << 8)	/* Far End Fault */
> -#define WPPM_AMDIXP		(1 << 7)	/* Auto MDIX Parameter */
> -#define WPPM_TXDIS		(1 << 6)	/* Disable transmitter */
> -#define WPPM_DFEF		(1 << 5)	/* Disable Far End Fault */
> -#define WPPM_PD			(1 << 4)	/* Power Down */
> -#define WPPM_DMDX		(1 << 3)	/* Disable Auto MDI/MDIX */
> -#define WPPM_FMDX		(1 << 2)	/* Force MDIX */
> -#define WPPM_LPBK		(1 << 1)	/* MAX Loopback */
> -
> -/* PHY Power Save Register */
> -#define PPS_PPSM		(1 << 0)	/* PHY Power Save Mode */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-switch.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - Switch Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_SWITCH_H
> -#define KS8695_SWITCH_H
> -
> -#define KS8695_SWITCH_OFFSET	(0xF0000 + 0xe800)
> -#define KS8695_SWITCH_VA	(KS8695_IO_VA + KS8695_SWITCH_OFFSET)
> -#define KS8695_SWITCH_PA	(KS8695_IO_PA + KS8695_SWITCH_OFFSET)
> -
> -
> -/*
> - * Switch registers
> - */
> -#define KS8695_SEC0		(0x00)		/* Switch Engine Control 0 */
> -#define KS8695_SEC1		(0x04)		/* Switch Engine Control 1 */
> -#define KS8695_SEC2		(0x08)		/* Switch Engine Control 2 */
> -
> -#define KS8695_SEPXCZ(x,z)	(0x0c + (((x)-1)*3 + ((z)-1))*4)	/* Port
> Configuration Registers */
> -
> -#define KS8695_SEP12AN		(0x48)		/* Port 1 & 2 Auto-Negotiation */
> -#define KS8695_SEP34AN		(0x4c)		/* Port 3 & 4 Auto-Negotiation */
> -#define KS8695_SEIAC		(0x50)		/* Indirect Access Control */
> -#define KS8695_SEIADH2		(0x54)		/* Indirect Access Data High 2 */
> -#define KS8695_SEIADH1		(0x58)		/* Indirect Access Data High 1 */
> -#define KS8695_SEIADL		(0x5c)		/* Indirect Access Data Low */
> -#define KS8695_SEAFC		(0x60)		/* Advance Feature Control */
> -#define KS8695_SEDSCPH		(0x64)		/* TOS Priority High */
> -#define KS8695_SEDSCPL		(0x68)		/* TOS Priority Low */
> -#define KS8695_SEMAH		(0x6c)		/* Switch Engine MAC Address High */
> -#define KS8695_SEMAL		(0x70)		/* Switch Engine MAC Address Low */
> -#define KS8695_LPPM12		(0x74)		/* Port 1 & 2 PHY Power Management */
> -#define KS8695_LPPM34		(0x78)		/* Port 3 & 4 PHY Power Management */
> -
> -
> -/* Switch Engine Control 0 */
> -#define SEC0_LLED1S		(7 << 25)	/* LED1 Select */
> -#define		LLED1S_SPEED		(0 << 25)
> -#define		LLED1S_LINK		(1 << 25)
> -#define		LLED1S_DUPLEX		(2 << 25)
> -#define		LLED1S_COLLISION	(3 << 25)
> -#define		LLED1S_ACTIVITY		(4 << 25)
> -#define		LLED1S_FDX_COLLISION	(5 << 25)
> -#define		LLED1S_LINK_ACTIVITY	(6 << 25)
> -#define SEC0_LLED0S		(7 << 22)	/* LED0 Select */
> -#define		LLED0S_SPEED		(0 << 22)
> -#define		LLED0S_LINK		(1 << 22)
> -#define		LLED0S_DUPLEX		(2 << 22)
> -#define		LLED0S_COLLISION	(3 << 22)
> -#define		LLED0S_ACTIVITY		(4 << 22)
> -#define		LLED0S_FDX_COLLISION	(5 << 22)
> -#define		LLED0S_LINK_ACTIVITY	(6 << 22)
> -#define SEC0_ENABLE		(1 << 0)	/* Enable Switch */
> -
> -
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-uart.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - UART register and bit definitions.
> - */
> -
> -#ifndef KS8695_UART_H
> -#define KS8695_UART_H
> -
> -#define KS8695_UART_OFFSET	(0xF0000 + 0xE000)
> -#define KS8695_UART_VA		(KS8695_IO_VA + KS8695_UART_OFFSET)
> -#define KS8695_UART_PA		(KS8695_IO_PA + KS8695_UART_OFFSET)
> -
> -
> -/*
> - * UART registers
> - */
> -#define KS8695_URRB	(0x00)		/* Receive Buffer Register */
> -#define KS8695_URTH	(0x04)		/* Transmit Holding Register */
> -#define KS8695_URFC	(0x08)		/* FIFO Control Register */
> -#define KS8695_URLC	(0x0C)		/* Line Control Register */
> -#define KS8695_URMC	(0x10)		/* Modem Control Register */
> -#define KS8695_URLS	(0x14)		/* Line Status Register */
> -#define KS8695_URMS	(0x18)		/* Modem Status Register */
> -#define KS8695_URBD	(0x1C)		/* Baud Rate Divisor Register */
> -#define KS8695_USR	(0x20)		/* Status Register */
> -
> -
> -/* FIFO Control Register */
> -#define URFC_URFRT	(3 << 6)	/* Receive FIFO Trigger Level */
> -#define		URFC_URFRT_1	(0 << 6)
> -#define		URFC_URFRT_4	(1 << 6)
> -#define		URFC_URFRT_8	(2 << 6)
> -#define		URFC_URFRT_14	(3 << 6)
> -#define URFC_URTFR	(1 << 2)	/* Transmit FIFO Reset */
> -#define URFC_URRFR	(1 << 1)	/* Receive FIFO Reset */
> -#define URFC_URFE	(1 << 0)	/* FIFO Enable */
> -
> -/* Line Control Register */
> -#define URLC_URSBC	(1 << 6)	/* Set Break Condition */
> -#define URLC_PARITY	(7 << 3)	/* Parity */
> -#define		URPE_NONE	(0 << 3)
> -#define		URPE_ODD	(1 << 3)
> -#define		URPE_EVEN	(3 << 3)
> -#define		URPE_MARK	(5 << 3)
> -#define		URPE_SPACE	(7 << 3)
> -#define URLC_URSB	(1 << 2)	/* Stop Bits */
> -#define URLC_URCL	(3 << 0)	/* Character Length */
> -#define		URCL_5		(0 << 0)
> -#define		URCL_6		(1 << 0)
> -#define		URCL_7		(2 << 0)
> -#define		URCL_8		(3 << 0)
> -
> -/* Modem Control Register */
> -#define URMC_URLB	(1 << 4)	/* Loop-back mode */
> -#define URMC_UROUT2	(1 << 3)	/* OUT2 signal */
> -#define URMC_UROUT1	(1 << 2)	/* OUT1 signal */
> -#define URMC_URRTS	(1 << 1)	/* Request to Send */
> -#define URMC_URDTR	(1 << 0)	/* Data Terminal Ready */
> -
> -/* Line Status Register */
> -#define URLS_URRFE	(1 << 7)	/* Receive FIFO Error */
> -#define URLS_URTE	(1 << 6)	/* Transmit Empty */
> -#define URLS_URTHRE	(1 << 5)	/* Transmit Holding Register Empty */
> -#define URLS_URBI	(1 << 4)	/* Break Interrupt */
> -#define URLS_URFE	(1 << 3)	/* Framing Error */
> -#define URLS_URPE	(1 << 2)	/* Parity Error */
> -#define URLS_URROE	(1 << 1)	/* Receive Overrun Error */
> -#define URLS_URDR	(1 << 0)	/* Receive Data Ready */
> -
> -/* Modem Status Register */
> -#define URMS_URDCD	(1 << 7)	/* Data Carrier Detect */
> -#define URMS_URRI	(1 << 6)	/* Ring Indicator */
> -#define URMS_URDSR	(1 << 5)	/* Data Set Ready */
> -#define URMS_URCTS	(1 << 4)	/* Clear to Send */
> -#define URMS_URDDCD	(1 << 3)	/* Delta Data Carrier Detect */
> -#define URMS_URTERI	(1 << 2)	/* Trailing Edge Ring Indicator */
> -#define URMS_URDDST	(1 << 1)	/* Delta Data Set Ready */
> -#define URMS_URDCTS	(1 << 0)	/* Delta Clear to Send */
> -
> -/* Status Register */
> -#define USR_UTI		(1 << 0)	/* Timeout Indication */
> -
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/uncompress.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - Kernel uncompressor
> - */
> -
> -#ifndef __ASM_ARCH_UNCOMPRESS_H
> -#define __ASM_ARCH_UNCOMPRESS_H
> -
> -#include <linux/io.h>
> -#include <mach/regs-uart.h>
> -
> -static inline void putc(char c)
> -{
> -	while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) &
> URLS_URTHRE))
> -		barrier();
> -
> -	__raw_writel(c, (void __iomem*)KS8695_UART_PA + KS8695_URTH);
> -}
> -
> -static inline void flush(void)
> -{
> -	while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) &
> URLS_URTE))
> -		barrier();
> -}
> -
> -#define arch_decomp_setup()
> -
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/irq.c
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - */
> -
> -#include <linux/init.h>
> -#include <linux/module.h>
> -#include <linux/interrupt.h>
> -#include <linux/ioport.h>
> -#include <linux/device.h>
> -#include <linux/io.h>
> -
> -#include <mach/hardware.h>
> -#include <asm/irq.h>
> -
> -#include <asm/mach/irq.h>
> -
> -#include <mach/regs-irq.h>
> -#include <mach/regs-gpio.h>
> -
> -static void ks8695_irq_mask(struct irq_data *d)
> -{
> -	unsigned long inten;
> -
> -	inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
> -	inten &= ~(1 << d->irq);
> -
> -	__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
> -}
> -
> -static void ks8695_irq_unmask(struct irq_data *d)
> -{
> -	unsigned long inten;
> -
> -	inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
> -	inten |= (1 << d->irq);
> -
> -	__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
> -}
> -
> -static void ks8695_irq_ack(struct irq_data *d)
> -{
> -	__raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST);
> -}
> -
> -
> -static struct irq_chip ks8695_irq_level_chip;
> -static struct irq_chip ks8695_irq_edge_chip;
> -
> -
> -static int ks8695_irq_set_type(struct irq_data *d, unsigned int type)
> -{
> -	unsigned long ctrl, mode;
> -	unsigned short level_triggered = 0;
> -
> -	ctrl = __raw_readl(KS8695_GPIO_VA + KS8695_IOPC);
> -
> -	switch (type) {
> -		case IRQ_TYPE_LEVEL_HIGH:
> -			mode = IOPC_TM_HIGH;
> -			level_triggered = 1;
> -			break;
> -		case IRQ_TYPE_LEVEL_LOW:
> -			mode = IOPC_TM_LOW;
> -			level_triggered = 1;
> -			break;
> -		case IRQ_TYPE_EDGE_RISING:
> -			mode = IOPC_TM_RISING;
> -			break;
> -		case IRQ_TYPE_EDGE_FALLING:
> -			mode = IOPC_TM_FALLING;
> -			break;
> -		case IRQ_TYPE_EDGE_BOTH:
> -			mode = IOPC_TM_EDGE;
> -			break;
> -		default:
> -			return -EINVAL;
> -	}
> -
> -	switch (d->irq) {
> -		case KS8695_IRQ_EXTERN0:
> -			ctrl &= ~IOPC_IOEINT0TM;
> -			ctrl |= IOPC_IOEINT0_MODE(mode);
> -			break;
> -		case KS8695_IRQ_EXTERN1:
> -			ctrl &= ~IOPC_IOEINT1TM;
> -			ctrl |= IOPC_IOEINT1_MODE(mode);
> -			break;
> -		case KS8695_IRQ_EXTERN2:
> -			ctrl &= ~IOPC_IOEINT2TM;
> -			ctrl |= IOPC_IOEINT2_MODE(mode);
> -			break;
> -		case KS8695_IRQ_EXTERN3:
> -			ctrl &= ~IOPC_IOEINT3TM;
> -			ctrl |= IOPC_IOEINT3_MODE(mode);
> -			break;
> -		default:
> -			return -EINVAL;
> -	}
> -
> -	if (level_triggered) {
> -		irq_set_chip_and_handler(d->irq, &ks8695_irq_level_chip,
> -					 handle_level_irq);
> -	}
> -	else {
> -		irq_set_chip_and_handler(d->irq, &ks8695_irq_edge_chip,
> -					 handle_edge_irq);
> -	}
> -
> -	__raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC);
> -	return 0;
> -}
> -
> -static struct irq_chip ks8695_irq_level_chip = {
> -	.irq_ack	= ks8695_irq_mask,
> -	.irq_mask	= ks8695_irq_mask,
> -	.irq_unmask	= ks8695_irq_unmask,
> -	.irq_set_type	= ks8695_irq_set_type,
> -};
> -
> -static struct irq_chip ks8695_irq_edge_chip = {
> -	.irq_ack	= ks8695_irq_ack,
> -	.irq_mask	= ks8695_irq_mask,
> -	.irq_unmask	= ks8695_irq_unmask,
> -	.irq_set_type	= ks8695_irq_set_type,
> -};
> -
> -void __init ks8695_init_irq(void)
> -{
> -	unsigned int irq;
> -
> -	/* Disable all interrupts initially */
> -	__raw_writel(0, KS8695_IRQ_VA + KS8695_INTMC);
> -	__raw_writel(0, KS8695_IRQ_VA + KS8695_INTEN);
> -
> -	for (irq = 0; irq < NR_IRQS; irq++) {
> -		switch (irq) {
> -			/* Level-triggered interrupts */
> -			case KS8695_IRQ_BUS_ERROR:
> -			case KS8695_IRQ_UART_MODEM_STATUS:
> -			case KS8695_IRQ_UART_LINE_STATUS:
> -			case KS8695_IRQ_UART_RX:
> -			case KS8695_IRQ_COMM_TX:
> -			case KS8695_IRQ_COMM_RX:
> -				irq_set_chip_and_handler(irq,
> -							 &ks8695_irq_level_chip,
> -							 handle_level_irq);
> -				break;
> -
> -			/* Edge-triggered interrupts */
> -			default:
> -				/* clear pending bit */
> -				ks8695_irq_ack(irq_get_irq_data(irq));
> -				irq_set_chip_and_handler(irq,
> -							 &ks8695_irq_edge_chip,
> -							 handle_edge_irq);
> -		}
> -
> -		irq_clear_status_flags(irq, IRQ_NOREQUEST);
> -	}
> -}
> 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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/pci.c
> - *
> - *  Copyright (C) 2003, Micrel Semiconductors
> - *  Copyright (C) 2006, Greg Ungerer <gerg@snapgear.com>
> - *  Copyright (C) 2006, Ben Dooks
> - *  Copyright (C) 2007, Andrew Victor
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/pci.h>
> -#include <linux/mm.h>
> -#include <linux/init.h>
> -#include <linux/irq.h>
> -#include <linux/delay.h>
> -#include <linux/io.h>
> -
> -#include <asm/signal.h>
> -#include <asm/mach/pci.h>
> -#include <mach/hardware.h>
> -
> -#include "devices.h"
> -#include "regs-pci.h"
> -
> -
> -static int pci_dbg;
> -
> -static void ks8695_pci_setupconfig(unsigned int bus_nr, unsigned int
> devfn, unsigned int where)
> -{
> -	unsigned long pbca;
> -
> -	pbca = PBCA_ENABLE | (where & ~3);
> -	pbca |= PCI_SLOT(devfn) << 11 ;
> -	pbca |= PCI_FUNC(devfn) << 8;
> -	pbca |= bus_nr << 16;
> -
> -	if (bus_nr == 0) {
> -		/* use Type-0 transaction */
> -		__raw_writel(pbca, KS8695_PCI_VA + KS8695_PBCA);
> -	} else {
> -		/* use Type-1 transaction */
> -		__raw_writel(pbca | PBCA_TYPE1, KS8695_PCI_VA + KS8695_PBCA);
> -	}
> -}
> -
> -static void __iomem *ks8695_pci_map_bus(struct pci_bus *bus, unsigned
> int devfn,
> -					int where)
> -{
> -	ks8695_pci_setupconfig(bus->number, devfn, where);
> -	return KS8695_PCI_VA +  KS8695_PBCD;
> -}
> -
> -static void ks8695_local_writeconfig(int where, u32 value)
> -{
> -	ks8695_pci_setupconfig(0, 0, where);
> -	__raw_writel(value, KS8695_PCI_VA + KS8695_PBCD);
> -}
> -
> -static struct pci_ops ks8695_pci_ops = {
> -	.map_bus = ks8695_pci_map_bus,
> -	.read	= pci_generic_config_read32,
> -	.write	= pci_generic_config_write32,
> -};
> -
> -static struct resource pci_mem = {
> -	.name	= "PCI Memory space",
> -	.start	= KS8695_PCIMEM_PA,
> -	.end	= KS8695_PCIMEM_PA + (KS8695_PCIMEM_SIZE - 1),
> -	.flags	= IORESOURCE_MEM,
> -};
> -
> -static struct resource pci_io = {
> -	.name	= "PCI IO space",
> -	.start	= KS8695_PCIIO_PA,
> -	.end	= KS8695_PCIIO_PA + (KS8695_PCIIO_SIZE - 1),
> -	.flags	= IORESOURCE_IO,
> -};
> -
> -static int __init ks8695_pci_setup(int nr, struct pci_sys_data *sys)
> -{
> -	if (nr > 0)
> -		return 0;
> -
> -	request_resource(&iomem_resource, &pci_mem);
> -	request_resource(&ioport_resource, &pci_io);
> -
> -	pci_add_resource_offset(&sys->resources, &pci_io, sys->io_offset);
> -	pci_add_resource_offset(&sys->resources, &pci_mem, sys->mem_offset);
> -
> -	/* Assign and enable processor bridge */
> -	ks8695_local_writeconfig(PCI_BASE_ADDRESS_0, KS8695_PCIMEM_PA);
> -
> -	/* Enable bus-master & Memory Space access */
> -	ks8695_local_writeconfig(PCI_COMMAND, PCI_COMMAND_MASTER |
> PCI_COMMAND_MEMORY);
> -
> -	/* Set cache-line size & latency. */
> -	ks8695_local_writeconfig(PCI_CACHE_LINE_SIZE, (32 << 8) |
> (L1_CACHE_BYTES / sizeof(u32)));
> -
> -	/* Reserve PCI memory space for PCI-AHB resources */
> -	if (!request_mem_region(KS8695_PCIMEM_PA, SZ_64M, "PCI-AHB Bridge")) 
> {
> -		printk(KERN_ERR "Cannot allocate PCI-AHB Bridge memory.\n");
> -		return -EBUSY;
> -	}
> -
> -	return 1;
> -}
> -
> -static inline unsigned int size_mask(unsigned long size)
> -{
> -	return (~size) + 1;
> -}
> -
> -static int ks8695_pci_fault(unsigned long addr, unsigned int fsr,
> struct pt_regs *regs)
> -{
> -	unsigned long pc = instruction_pointer(regs);
> -	unsigned long instr = *(unsigned long *)pc;
> -	unsigned long cmdstat;
> -
> -	cmdstat = __raw_readl(KS8695_PCI_VA + KS8695_CRCFCS);
> -
> -	printk(KERN_ERR "PCI abort: address = 0x%08lx fsr = 0x%03x PC =
> 0x%08lx LR = 0x%08lx [%s%s%s%s%s]\n",
> -		addr, fsr, regs->ARM_pc, regs->ARM_lr,
> -		cmdstat & (PCI_STATUS_SIG_TARGET_ABORT << 16) ? "GenTarget" : " ",
> -		cmdstat & (PCI_STATUS_REC_TARGET_ABORT << 16) ? "RecvTarget" : " ",
> -		cmdstat & (PCI_STATUS_REC_MASTER_ABORT << 16) ? "MasterAbort" : " ",
> -		cmdstat & (PCI_STATUS_SIG_SYSTEM_ERROR << 16) ? "SysError" : " ",
> -		cmdstat & (PCI_STATUS_DETECTED_PARITY << 16)  ? "Parity" : " "
> -	);
> -
> -	__raw_writel(cmdstat, KS8695_PCI_VA + KS8695_CRCFCS);
> -
> -	/*
> -	 * If the instruction being executed was a read,
> -	 * make it look like it read all-ones.
> -	 */
> -	if ((instr & 0x0c100000) == 0x04100000) {
> -		int reg = (instr >> 12) & 15;
> -		unsigned long val;
> -
> -		if (instr & 0x00400000)
> -			val = 255;
> -		else
> -			val = -1;
> -
> -		regs->uregs[reg] = val;
> -		regs->ARM_pc += 4;
> -		return 0;
> -	}
> -
> -	if ((instr & 0x0e100090) == 0x00100090) {
> -		int reg = (instr >> 12) & 15;
> -
> -		regs->uregs[reg] = -1;
> -		regs->ARM_pc += 4;
> -		return 0;
> -	}
> -
> -	return 1;
> -}
> -
> -static void __init ks8695_pci_preinit(void)
> -{
> -	/* make software reset to avoid freeze if PCI bus was messed up */
> -	__raw_writel(0x80000000, KS8695_PCI_VA + KS8695_PBCS);
> -
> -	/* stage 1 initialization, subid, subdevice = 0x0001 */
> -	__raw_writel(0x00010001, KS8695_PCI_VA + KS8695_CRCSID);
> -
> -	/* stage 2 initialization */
> -	/* prefetch limits with 16 words, retry enable */
> -	__raw_writel(0x40000000, KS8695_PCI_VA + KS8695_PBCS);
> -
> -	/* configure memory mapping */
> -	__raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBA);
> -	__raw_writel(size_mask(KS8695_PCIMEM_SIZE), KS8695_PCI_VA + 
> KS8695_PMBAM);
> -	__raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBAT);
> -	__raw_writel(0, KS8695_PCI_VA + KS8695_PMBAC);
> -
> -	/* configure IO mapping */
> -	__raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBA);
> -	__raw_writel(size_mask(KS8695_PCIIO_SIZE), KS8695_PCI_VA + 
> KS8695_PIOBAM);
> -	__raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBAT);
> -	__raw_writel(0, KS8695_PCI_VA + KS8695_PIOBAC);
> -
> -	/* hook in fault handlers */
> -	hook_fault_code(8, ks8695_pci_fault, SIGBUS, 0, "external abort on
> non-linefetch");
> -	hook_fault_code(10, ks8695_pci_fault, SIGBUS, 0, "external abort on
> non-linefetch");
> -}
> -
> -static void ks8695_show_pciregs(void)
> -{
> -	if (!pci_dbg)
> -		return;
> -
> -	printk(KERN_INFO "PCI: CRCFID = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_CRCFID));
> -	printk(KERN_INFO "PCI: CRCFCS = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_CRCFCS));
> -	printk(KERN_INFO "PCI: CRCFRV = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_CRCFRV));
> -	printk(KERN_INFO "PCI: CRCFLT = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_CRCFLT));
> -	printk(KERN_INFO "PCI: CRCBMA = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_CRCBMA));
> -	printk(KERN_INFO "PCI: CRCSID = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_CRCSID));
> -	printk(KERN_INFO "PCI: CRCFIT = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_CRCFIT));
> -
> -	printk(KERN_INFO "PCI: PBM    = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PBM));
> -	printk(KERN_INFO "PCI: PBCS   = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PBCS));
> -
> -	printk(KERN_INFO "PCI: PMBA   = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PMBA));
> -	printk(KERN_INFO "PCI: PMBAC  = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PMBAC));
> -	printk(KERN_INFO "PCI: PMBAM  = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PMBAM));
> -	printk(KERN_INFO "PCI: PMBAT  = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PMBAT));
> -
> -	printk(KERN_INFO "PCI: PIOBA  = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PIOBA));
> -	printk(KERN_INFO "PCI: PIOBAC = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PIOBAC));
> -	printk(KERN_INFO "PCI: PIOBAM = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PIOBAM));
> -	printk(KERN_INFO "PCI: PIOBAT = %08x\n", __raw_readl(KS8695_PCI_VA +
> KS8695_PIOBAT));
> -}
> -
> -
> -static struct hw_pci ks8695_pci __initdata = {
> -	.nr_controllers	= 1,
> -	.ops		= &ks8695_pci_ops,
> -	.preinit	= ks8695_pci_preinit,
> -	.setup		= ks8695_pci_setup,
> -	.postinit	= NULL,
> -	.map_irq	= NULL,
> -};
> -
> -void __init ks8695_init_pci(struct ks8695_pci_cfg *cfg)
> -{
> -	if (__raw_readl(KS8695_PCI_VA + KS8695_CRCFRV) & CFRV_GUEST) {
> -		printk("PCI: KS8695 in guest mode, not initialising\n");
> -		return;
> -	}
> -
> -	pcibios_min_io = 0;
> -	pcibios_min_mem = 0;
> -
> -	printk(KERN_INFO "PCI: Initialising\n");
> -	ks8695_show_pciregs();
> -
> -	/* set Mode */
> -	__raw_writel(cfg->mode << 29, KS8695_PCI_VA + KS8695_PBM);
> -
> -	ks8695_pci.map_irq = cfg->map_irq;	/* board-specific map_irq method 
> */
> -
> -	pci_common_init(&ks8695_pci);
> -}
> 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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-wan.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - HPNA Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_HPNA_H
> -#define KS8695_HPNA_H
> -
> -#define KS8695_HPNA_OFFSET	(0xF0000 + 0xA000)
> -#define KS8695_HPNA_VA		(KS8695_IO_VA + KS8695_HPNA_OFFSET)
> -#define KS8695_HPNA_PA		(KS8695_IO_PA + KS8695_HPNA_OFFSET)
> -
> -
> -/*
> - * HPNA registers
> - */
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-lan.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - LAN Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_LAN_H
> -#define KS8695_LAN_H
> -
> -#define KS8695_LAN_OFFSET	(0xF0000 + 0x8000)
> -#define KS8695_LAN_VA		(KS8695_IO_VA + KS8695_LAN_OFFSET)
> -#define KS8695_LAN_PA		(KS8695_IO_PA + KS8695_LAN_OFFSET)
> -
> -
> -/*
> - * LAN registers
> - */
> -#define KS8695_LMDTXC		(0x00)		/* DMA Transmit Control */
> -#define KS8695_LMDRXC		(0x04)		/* DMA Receive Control */
> -#define KS8695_LMDTSC		(0x08)		/* DMA Transmit Start Command */
> -#define KS8695_LMDRSC		(0x0c)		/* DMA Receive Start Command */
> -#define KS8695_LTDLB		(0x10)		/* Transmit Descriptor List Base Address 
> */
> -#define KS8695_LRDLB		(0x14)		/* Receive Descriptor List Base Address 
> */
> -#define KS8695_LMAL		(0x18)		/* MAC Station Address Low */
> -#define KS8695_LMAH		(0x1c)		/* MAC Station Address High */
> -#define KS8695_LMAAL(n)		(0x80 + ((n)*8))	/* MAC Additional Station
> Address (0..15) Low */
> -#define KS8695_LMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station
> Address (0..15) High */
> -
> -
> -/* DMA Transmit Control Register */
> -#define LMDTXC_LMTRST		(1    << 31)	/* Soft Reset */
> -#define LMDTXC_LMTBS		(0x3f << 24)	/* Transmit Burst Size */
> -#define LMDTXC_LMTUCG		(1    << 18)	/* Transmit UDP Checksum Generate 
> */
> -#define LMDTXC_LMTTCG		(1    << 17)	/* Transmit TCP Checksum Generate 
> */
> -#define LMDTXC_LMTICG		(1    << 16)	/* Transmit IP Checksum Generate 
> */
> -#define LMDTXC_LMTFCE		(1    <<  9)	/* Transmit Flow Control Enable */
> -#define LMDTXC_LMTLB		(1    <<  8)	/* Loopback mode */
> -#define LMDTXC_LMTEP		(1    <<  2)	/* Transmit Enable Padding */
> -#define LMDTXC_LMTAC		(1    <<  1)	/* Transmit Add CRC */
> -#define LMDTXC_LMTE		(1    <<  0)	/* TX Enable */
> -
> -/* DMA Receive Control Register */
> -#define LMDRXC_LMRBS		(0x3f << 24)	/* Receive Burst Size */
> -#define LMDRXC_LMRUCC		(1    << 18)	/* Receive UDP Checksum check */
> -#define LMDRXC_LMRTCG		(1    << 17)	/* Receive TCP Checksum check */
> -#define LMDRXC_LMRICG		(1    << 16)	/* Receive IP Checksum check */
> -#define LMDRXC_LMRFCE		(1    <<  9)	/* Receive Flow Control Enable */
> -#define LMDRXC_LMRB		(1    <<  6)	/* Receive Broadcast */
> -#define LMDRXC_LMRM		(1    <<  5)	/* Receive Multicast */
> -#define LMDRXC_LMRU		(1    <<  4)	/* Receive Unicast */
> -#define LMDRXC_LMRERR		(1    <<  3)	/* Receive Error Frame */
> -#define LMDRXC_LMRA		(1    <<  2)	/* Receive All */
> -#define LMDRXC_LMRE		(1    <<  1)	/* RX Enable */
> -
> -/* Additional Station Address High */
> -#define LMAAH_E			(1    << 31)	/* Address Enabled */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-mem.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - Memory Controller registers and bit definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_MEM_H
> -#define KS8695_MEM_H
> -
> -#define KS8695_MEM_OFFSET	(0xF0000 + 0x4000)
> -#define KS8695_MEM_VA		(KS8695_IO_VA + KS8695_MEM_OFFSET)
> -#define KS8695_MEM_PA		(KS8695_IO_PA + KS8695_MEM_OFFSET)
> -
> -
> -/*
> - * Memory Controller Registers
> - */
> -#define KS8695_EXTACON0		(0x00)		/* External I/O 0 Access Control */
> -#define KS8695_EXTACON1		(0x04)		/* External I/O 1 Access Control */
> -#define KS8695_EXTACON2		(0x08)		/* External I/O 2 Access Control */
> -#define KS8695_ROMCON0		(0x10)		/* ROM/SRAM/Flash 1 Control Register 
> */
> -#define KS8695_ROMCON1		(0x14)		/* ROM/SRAM/Flash 2 Control Register 
> */
> -#define KS8695_ERGCON		(0x20)		/* External I/O and ROM/SRAM/Flash
> General Register */
> -#define KS8695_SDCON0		(0x30)		/* SDRAM Control Register 0 */
> -#define KS8695_SDCON1		(0x34)		/* SDRAM Control Register 1 */
> -#define KS8695_SDGCON		(0x38)		/* SDRAM General Control */
> -#define KS8695_SDBCON		(0x3c)		/* SDRAM Buffer Control */
> -#define KS8695_REFTIM		(0x40)		/* SDRAM Refresh Timer */
> -
> -
> -/* External I/O Access Control Registers */
> -#define EXTACON_EBNPTR		(0x3ff << 22)		/* Last Address Pointer */
> -#define EXTACON_EBBPTR		(0x3ff << 12)		/* Base Pointer */
> -#define EXTACON_EBTACT		(7     <<  9)		/* Write Enable/Output Enable
> Active Time */
> -#define EXTACON_EBTCOH		(7     <<  6)		/* Chip Select Hold Time */
> -#define EXTACON_EBTACS		(7     <<  3)		/* Address Setup Time before 
> ECSN */
> -#define EXTACON_EBTCOS		(7     <<  0)		/* Chip Select Time before OEN 
> */
> -
> -/* ROM/SRAM/Flash Control Register */
> -#define ROMCON_RBNPTR		(0x3ff << 22)		/* Next Pointer */
> -#define ROMCON_RBBPTR		(0x3ff << 12)		/* Base Pointer */
> -#define ROMCON_RBTACC		(7     <<  4)		/* Access Cycle Time */
> -#define ROMCON_RBTPA		(3     <<  2)		/* Page Address Access Time */
> -#define ROMCON_PMC		(3     <<  0)		/* Page Mode Configuration */
> -#define		PMC_NORMAL		(0 << 0)
> -#define		PMC_4WORD		(1 << 0)
> -#define		PMC_8WORD		(2 << 0)
> -#define		PMC_16WORD		(3 << 0)
> -
> -/* External I/O and ROM/SRAM/Flash General Register */
> -#define ERGCON_TMULT		(3 << 28)		/* Time Multiplier */
> -#define ERGCON_DSX2		(3 << 20)		/* Data Width (External I/O Bank 2) */
> -#define ERGCON_DSX1		(3 << 18)		/* Data Width (External I/O Bank 1) */
> -#define ERGCON_DSX0		(3 << 16)		/* Data Width (External I/O Bank 0) */
> -#define ERGCON_DSR1		(3 <<  2)		/* Data Width (ROM/SRAM/Flash Bank 1) 
> */
> -#define ERGCON_DSR0		(3 <<  0)		/* Data Width (ROM/SRAM/Flash Bank 0) 
> */
> -
> -/* SDRAM Control Register */
> -#define SDCON_DBNPTR		(0x3ff << 22)		/* Last Address Pointer */
> -#define SDCON_DBBPTR		(0x3ff << 12)		/* Base Pointer */
> -#define SDCON_DBCAB		(3     <<  8)		/* Column Address Bits */
> -#define SDCON_DBBNUM		(1     <<  3)		/* Number of Banks */
> -#define SDCON_DBDBW		(3     <<  1)		/* Data Bus Width */
> -
> -/* SDRAM General Control Register */
> -#define SDGCON_SDTRC		(3 << 2)		/* RAS to CAS latency */
> -#define SDGCON_SDCAS		(3 << 0)		/* CAS latency */
> -
> -/* SDRAM Buffer Control Register */
> -#define SDBCON_SDESTA		(1 << 31)		/* SDRAM Engine Status */
> -#define SDBCON_RBUFBDIS		(1 << 24)		/* Read Buffer Burst Enable */
> -#define SDBCON_WFIFOEN		(1 << 23)		/* Write FIFO Enable */
> -#define SDBCON_RBUFEN		(1 << 22)		/* Read Buffer Enable */
> -#define SDBCON_FLUSHWFIFO	(1 << 21)		/* Flush Write FIFO */
> -#define SDBCON_RBUFINV		(1 << 20)		/* Read Buffer Invalidate */
> -#define SDBCON_SDINI		(3 << 16)		/* SDRAM Initialization Control */
> -#define SDBCON_SDMODE		(0x3fff << 0)		/* SDRAM Mode Register Value 
> Program */
> -
> -/* SDRAM Refresh Timer Register */
> -#define REFTIM_REFTIM		(0xffff << 0)		/* Refresh Timer Value */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-pci.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - PCI bridge registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#define KS8695_PCI_OFFSET	(0xF0000 + 0x2000)
> -#define KS8695_PCI_VA		(KS8695_IO_VA + KS8695_PCI_OFFSET)
> -#define KS8695_PCI_PA		(KS8695_IO_PA + KS8695_PCI_OFFSET)
> -
> -
> -#define KS8695_CRCFID		(0x000)		/* Configuration: Identification */
> -#define KS8695_CRCFCS		(0x004)		/* Configuration: Command and Status 
> */
> -#define KS8695_CRCFRV		(0x008)		/* Configuration: Revision */
> -#define KS8695_CRCFLT		(0x00C)		/* Configuration: Latency Timer */
> -#define KS8695_CRCBMA		(0x010)		/* Configuration: Base Memory Address 
> */
> -#define KS8695_CRCSID		(0x02C)		/* Configuration: Subsystem ID */
> -#define KS8695_CRCFIT		(0x03C)		/* Configuration: Interrupt */
> -#define KS8695_PBCA		(0x100)		/* Bridge Configuration Address */
> -#define KS8695_PBCD		(0x104)		/* Bridge Configuration Data */
> -#define KS8695_PBM		(0x200)		/* Bridge Mode */
> -#define KS8695_PBCS		(0x204)		/* Bridge Control and Status */
> -#define KS8695_PMBA		(0x208)		/* Bridge Memory Base Address */
> -#define KS8695_PMBAC		(0x20C)		/* Bridge Memory Base Address Control 
> */
> -#define KS8695_PMBAM		(0x210)		/* Bridge Memory Base Address Mask */
> -#define KS8695_PMBAT		(0x214)		/* Bridge Memory Base Address 
> Translation */
> -#define KS8695_PIOBA		(0x218)		/* Bridge I/O Base Address */
> -#define KS8695_PIOBAC		(0x21C)		/* Bridge I/O Base Address Control */
> -#define KS8695_PIOBAM		(0x220)		/* Bridge I/O Base Address Mask */
> -#define KS8695_PIOBAT		(0x224)		/* Bridge I/O Base Address Translation 
> */
> -
> -
> -/* Configuration: Identification */
> -
> -/* Configuration: Command and Status */
> -
> -/* Configuration: Revision */
> -
> -
> -
> -#define CFRV_GUEST		(1 << 23)
> -
> -#define PBCA_TYPE1		(1)
> -#define PBCA_ENABLE		(1 << 31)
> -
> -
> 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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-sys.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - System control registers and bit definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_SYS_H
> -#define KS8695_SYS_H
> -
> -#define KS8695_SYS_OFFSET	(0xF0000 + 0x0000)
> -#define KS8695_SYS_VA		(KS8695_IO_VA + KS8695_SYS_OFFSET)
> -#define KS8695_SYS_PA		(KS8695_IO_PA + KS8695_SYS_OFFSET)
> -
> -
> -#define KS8695_SYSCFG		(0x00)		/* System Configuration Register */
> -#define KS8695_CLKCON		(0x04)		/* System Clock and Bus Control 
> Register */
> -
> -
> -/* System Configuration Register */
> -#define SYSCFG_SPRBP		(0x3ff << 16)	/* Register Bank Base Pointer */
> -
> -/* System Clock and Bus Control Register */
> -#define CLKCON_SFMODE		(1 << 8)	/* System Fast Mode for Simulation */
> -#define CLKCON_SCDC		(7 << 0)	/* System Clock Divider Select */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-wan.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - WAN Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_WAN_H
> -#define KS8695_WAN_H
> -
> -#define KS8695_WAN_OFFSET	(0xF0000 + 0x6000)
> -#define KS8695_WAN_VA		(KS8695_IO_VA + KS8695_WAN_OFFSET)
> -#define KS8695_WAN_PA		(KS8695_IO_PA + KS8695_WAN_OFFSET)
> -
> -
> -/*
> - * WAN registers
> - */
> -#define KS8695_WMDTXC		(0x00)		/* DMA Transmit Control */
> -#define KS8695_WMDRXC		(0x04)		/* DMA Receive Control */
> -#define KS8695_WMDTSC		(0x08)		/* DMA Transmit Start Command */
> -#define KS8695_WMDRSC		(0x0c)		/* DMA Receive Start Command */
> -#define KS8695_WTDLB		(0x10)		/* Transmit Descriptor List Base Address 
> */
> -#define KS8695_WRDLB		(0x14)		/* Receive Descriptor List Base Address 
> */
> -#define KS8695_WMAL		(0x18)		/* MAC Station Address Low */
> -#define KS8695_WMAH		(0x1c)		/* MAC Station Address High */
> -#define KS8695_WMAAL(n)		(0x80 + ((n)*8))	/* MAC Additional Station
> Address (0..15) Low */
> -#define KS8695_WMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station
> Address (0..15) High */
> -
> -
> -/* DMA Transmit Control Register */
> -#define WMDTXC_WMTRST		(1    << 31)	/* Soft Reset */
> -#define WMDTXC_WMTBS		(0x3f << 24)	/* Transmit Burst Size */
> -#define WMDTXC_WMTUCG		(1    << 18)	/* Transmit UDP Checksum Generate 
> */
> -#define WMDTXC_WMTTCG		(1    << 17)	/* Transmit TCP Checksum Generate 
> */
> -#define WMDTXC_WMTICG		(1    << 16)	/* Transmit IP Checksum Generate 
> */
> -#define WMDTXC_WMTFCE		(1    <<  9)	/* Transmit Flow Control Enable */
> -#define WMDTXC_WMTLB		(1    <<  8)	/* Loopback mode */
> -#define WMDTXC_WMTEP		(1    <<  2)	/* Transmit Enable Padding */
> -#define WMDTXC_WMTAC		(1    <<  1)	/* Transmit Add CRC */
> -#define WMDTXC_WMTE		(1    <<  0)	/* TX Enable */
> -
> -/* DMA Receive Control Register */
> -#define WMDRXC_WMRBS		(0x3f << 24)	/* Receive Burst Size */
> -#define WMDRXC_WMRUCC		(1    << 18)	/* Receive UDP Checksum check */
> -#define WMDRXC_WMRTCG		(1    << 17)	/* Receive TCP Checksum check */
> -#define WMDRXC_WMRICG		(1    << 16)	/* Receive IP Checksum check */
> -#define WMDRXC_WMRFCE		(1    <<  9)	/* Receive Flow Control Enable */
> -#define WMDRXC_WMRB		(1    <<  6)	/* Receive Broadcast */
> -#define WMDRXC_WMRM		(1    <<  5)	/* Receive Multicast */
> -#define WMDRXC_WMRU		(1    <<  4)	/* Receive Unicast */
> -#define WMDRXC_WMRERR		(1    <<  3)	/* Receive Error Frame */
> -#define WMDRXC_WMRA		(1    <<  2)	/* Receive All */
> -#define WMDRXC_WMRE		(1    <<  0)	/* RX Enable */
> -
> -/* Additional Station Address High */
> -#define WMAAH_E			(1    << 31)	/* Address Enabled */
> -
> -
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/time.c
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - */
> -
> -#include <linux/init.h>
> -#include <linux/interrupt.h>
> -#include <linux/irq.h>
> -#include <linux/kernel.h>
> -#include <linux/sched.h>
> -#include <linux/io.h>
> -#include <linux/clockchips.h>
> -
> -#include <asm/mach/time.h>
> -#include <asm/system_misc.h>
> -
> -#include <mach/regs-irq.h>
> -
> -#include "generic.h"
> -
> -#define KS8695_TMR_OFFSET	(0xF0000 + 0xE400)
> -#define KS8695_TMR_VA		(KS8695_IO_VA + KS8695_TMR_OFFSET)
> -#define KS8695_TMR_PA		(KS8695_IO_PA + KS8695_TMR_OFFSET)
> -
> -/*
> - * Timer registers
> - */
> -#define KS8695_TMCON		(0x00)		/* Timer Control Register */
> -#define KS8695_T1TC		(0x04)		/* Timer 1 Timeout Count Register */
> -#define KS8695_T0TC		(0x08)		/* Timer 0 Timeout Count Register */
> -#define KS8695_T1PD		(0x0C)		/* Timer 1 Pulse Count Register */
> -#define KS8695_T0PD		(0x10)		/* Timer 0 Pulse Count Register */
> -
> -/* Timer Control Register */
> -#define TMCON_T1EN		(1 << 1)	/* Timer 1 Enable */
> -#define TMCON_T0EN		(1 << 0)	/* Timer 0 Enable */
> -
> -/* Timer0 Timeout Counter Register */
> -#define T0TC_WATCHDOG		(0xff)		/* Enable watchdog mode */
> -
> -static int ks8695_set_periodic(struct clock_event_device *evt)
> -{
> -	u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ);
> -	u32 half = DIV_ROUND_CLOSEST(rate, 2);
> -	u32 tmcon;
> -
> -	/* Disable timer 1 */
> -	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	tmcon &= ~TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/* Both registers need to count down */
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
> -
> -	/* Re-enable timer1 */
> -	tmcon |= TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -	return 0;
> -}
> -
> -static int ks8695_set_next_event(unsigned long cycles,
> -				 struct clock_event_device *evt)
> -
> -{
> -	u32 half = DIV_ROUND_CLOSEST(cycles, 2);
> -	u32 tmcon;
> -
> -	/* Disable timer 1 */
> -	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	tmcon &= ~TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/* Both registers need to count down */
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
> -
> -	/* Re-enable timer1 */
> -	tmcon |= TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	return 0;
> -}
> -
> -static struct clock_event_device clockevent_ks8695 = {
> -	.name			= "ks8695_t1tc",
> -	/* Reasonably fast and accurate clock event */
> -	.rating			= 300,
> -	.features		= CLOCK_EVT_FEAT_ONESHOT |
> -				  CLOCK_EVT_FEAT_PERIODIC,
> -	.set_next_event		= ks8695_set_next_event,
> -	.set_state_periodic	= ks8695_set_periodic,
> -};
> -
> -/*
> - * IRQ handler for the timer.
> - */
> -static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id)
> -{
> -	struct clock_event_device *evt = &clockevent_ks8695;
> -
> -	evt->event_handler(evt);
> -	return IRQ_HANDLED;
> -}
> -
> -static struct irqaction ks8695_timer_irq = {
> -	.name		= "ks8695_tick",
> -	.flags		= IRQF_TIMER,
> -	.handler	= ks8695_timer_interrupt,
> -};
> -
> -static void ks8695_timer_setup(void)
> -{
> -	unsigned long tmcon;
> -
> -	/* Disable timer 0 and 1 */
> -	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	tmcon &= ~TMCON_T0EN;
> -	tmcon &= ~TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/*
> -	 * Use timer 1 to fire IRQs on the timeline, minimum 2 cycles
> -	 * (one on each counter) maximum 2*2^32, but the API will only
> -	 * accept up to a 32bit full word (0xFFFFFFFFU).
> -	 */
> -	clockevents_config_and_register(&clockevent_ks8695,
> -					KS8695_CLOCK_RATE, 2,
> -					0xFFFFFFFFU);
> -}
> -
> -void __init ks8695_timer_init(void)
> -{
> -	ks8695_timer_setup();
> -
> -	/* Enable timer interrupts */
> -	setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq);
> -}
> -
> -void ks8695_restart(enum reboot_mode reboot_mode, const char *cmd)
> -{
> -	unsigned int reg;
> -
> -	if (reboot_mode == REBOOT_SOFT)
> -		soft_restart(0);
> -
> -	/* disable timer0 */
> -	reg = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	writel_relaxed(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/* enable watchdog mode */
> -	writel_relaxed((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + 
> KS8695_T0TC);
> -
> -	/* re-enable timer0 */
> -	writel_relaxed(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -}
> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index 820b60a50125..05143ec47d94 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -106,7 +106,7 @@ config CPU_ARM922T
>  	help
>  	  The ARM922T is a version of the ARM920T, but with smaller
>  	  instruction and data caches. It is used in Altera's
> -	  Excalibur XA device family and Micrel's KS8695 Centaur.
> +	  Excalibur XA device family and the ARM Integrator.
> 
>  	  Say Y if you want support for the ARM922T processor.
>  	  Otherwise, say N.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 01/16] ARM: remove ks8695 platform
  2019-08-09 20:27 ` [PATCH 01/16] ARM: remove ks8695 platform Arnd Bergmann
  2019-08-11  9:18   ` Ben Dooks
@ 2019-08-12  3:59   ` Greg Ungerer
  2019-08-13 15:27   ` Ben Dooks
  2 siblings, 0 replies; 37+ messages in thread
From: Greg Ungerer @ 2019-08-12  3:59 UTC (permalink / raw)
  To: Arnd Bergmann, soc
  Cc: Andrew Victor, Ben Dooks, linux-kernel, linux-arm-kernel

Hi Arnd,

On 10/8/19 6:27 am, Arnd Bergmann wrote:
> ks8695 is an older SoC originally made by Kendin, which was later acquired
> by Micrel, and subsequently by Microchip.
> 
> The platform port was originally contributed by Andrew Victor and Ben
> Dooks, and later maintained by Greg Ungerer.
> 
> When I recently submitted cleanups, but Greg noted that the platform no
> longer boots and nobody is using it any more, we decided to remove it.
> 
> Cc: Greg Ungerer <gerg@kernel.org>

Acked-by: Greg Ungerer <gerg@kernel.org>

Thanks for taking care of this.

Regards
Greg



> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Ben Dooks <ben.dooks@codethink.co.uk>
> Link: https://wikidevi.com/wiki/Micrel
> Link: https://lore.kernel.org/linux-arm-kernel/2bc41895-d4f9-896c-0726-0b2862fcbf25@kernel.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   MAINTAINERS                                   |   6 -
>   arch/arm/Kconfig                              |  16 +-
>   arch/arm/Kconfig.debug                        |   8 -
>   arch/arm/Makefile                             |   1 -
>   arch/arm/configs/acs5k_defconfig              |  77 ------
>   arch/arm/configs/acs5k_tiny_defconfig         |  69 -----
>   arch/arm/configs/ks8695_defconfig             |  67 -----
>   arch/arm/include/debug/ks8695.S               |  37 ---
>   arch/arm/mach-ks8695/Kconfig                  |  88 -------
>   arch/arm/mach-ks8695/Makefile                 |  23 --
>   arch/arm/mach-ks8695/Makefile.boot            |   9 -
>   arch/arm/mach-ks8695/board-acs5k.c            | 238 -----------------
>   arch/arm/mach-ks8695/board-dsm320.c           | 127 ---------
>   arch/arm/mach-ks8695/board-micrel.c           |  59 -----
>   arch/arm/mach-ks8695/board-og.c               | 197 --------------
>   arch/arm/mach-ks8695/board-sg.c               | 118 ---------
>   arch/arm/mach-ks8695/cpu.c                    |  60 -----
>   arch/arm/mach-ks8695/devices.c                | 197 --------------
>   arch/arm/mach-ks8695/devices.h                |  29 --
>   arch/arm/mach-ks8695/generic.h                |  12 -
>   .../mach-ks8695/include/mach/entry-macro.S    |  47 ----
>   .../mach-ks8695/include/mach/gpio-ks8695.h    |  36 ---
>   arch/arm/mach-ks8695/include/mach/hardware.h  |  42 ---
>   arch/arm/mach-ks8695/include/mach/irqs.h      |  51 ----
>   arch/arm/mach-ks8695/include/mach/memory.h    |  51 ----
>   arch/arm/mach-ks8695/include/mach/regs-gpio.h |  55 ----
>   arch/arm/mach-ks8695/include/mach/regs-irq.h  |  41 ---
>   arch/arm/mach-ks8695/include/mach/regs-misc.h |  97 -------
>   .../mach-ks8695/include/mach/regs-switch.h    |  66 -----
>   arch/arm/mach-ks8695/include/mach/regs-uart.h |  89 -------
>   .../arm/mach-ks8695/include/mach/uncompress.h |  33 ---
>   arch/arm/mach-ks8695/irq.c                    | 164 ------------
>   arch/arm/mach-ks8695/pci.c                    | 247 ------------------
>   arch/arm/mach-ks8695/regs-hpna.h              |  25 --
>   arch/arm/mach-ks8695/regs-lan.h               |  65 -----
>   arch/arm/mach-ks8695/regs-mem.h               |  89 -------
>   arch/arm/mach-ks8695/regs-pci.h               |  53 ----
>   arch/arm/mach-ks8695/regs-sys.h               |  34 ---
>   arch/arm/mach-ks8695/regs-wan.h               |  65 -----
>   arch/arm/mach-ks8695/time.c                   | 159 -----------
>   arch/arm/mm/Kconfig                           |   2 +-
>   41 files changed, 5 insertions(+), 2944 deletions(-)
>   delete mode 100644 arch/arm/configs/acs5k_defconfig
>   delete mode 100644 arch/arm/configs/acs5k_tiny_defconfig
>   delete mode 100644 arch/arm/configs/ks8695_defconfig
>   delete mode 100644 arch/arm/include/debug/ks8695.S
>   delete mode 100644 arch/arm/mach-ks8695/Kconfig
>   delete mode 100644 arch/arm/mach-ks8695/Makefile
>   delete mode 100644 arch/arm/mach-ks8695/Makefile.boot
>   delete mode 100644 arch/arm/mach-ks8695/board-acs5k.c
>   delete mode 100644 arch/arm/mach-ks8695/board-dsm320.c
>   delete mode 100644 arch/arm/mach-ks8695/board-micrel.c
>   delete mode 100644 arch/arm/mach-ks8695/board-og.c
>   delete mode 100644 arch/arm/mach-ks8695/board-sg.c
>   delete mode 100644 arch/arm/mach-ks8695/cpu.c
>   delete mode 100644 arch/arm/mach-ks8695/devices.c
>   delete mode 100644 arch/arm/mach-ks8695/devices.h
>   delete mode 100644 arch/arm/mach-ks8695/generic.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/entry-macro.S
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/gpio-ks8695.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/hardware.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/irqs.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/memory.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-gpio.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-irq.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-misc.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-switch.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/regs-uart.h
>   delete mode 100644 arch/arm/mach-ks8695/include/mach/uncompress.h
>   delete mode 100644 arch/arm/mach-ks8695/irq.c
>   delete mode 100644 arch/arm/mach-ks8695/pci.c
>   delete mode 100644 arch/arm/mach-ks8695/regs-hpna.h
>   delete mode 100644 arch/arm/mach-ks8695/regs-lan.h
>   delete mode 100644 arch/arm/mach-ks8695/regs-mem.h
>   delete mode 100644 arch/arm/mach-ks8695/regs-pci.h
>   delete mode 100644 arch/arm/mach-ks8695/regs-sys.h
>   delete mode 100644 arch/arm/mach-ks8695/regs-wan.h
>   delete mode 100644 arch/arm/mach-ks8695/time.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 6426db5198f0..9ac40a896ee6 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1921,12 +1921,6 @@ S:	Maintained
>   F:	drivers/phy/mediatek/
>   F:	Documentation/devicetree/bindings/phy/phy-mtk-*
>   
> -ARM/MICREL KS8695 ARCHITECTURE
> -M:	Greg Ungerer <gerg@uclinux.org>
> -L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
> -F:	arch/arm/mach-ks8695/
> -S:	Odd Fixes
> -
>   ARM/Microchip (AT91) SoC support
>   M:	Nicolas Ferre <nicolas.ferre@microchip.com>
>   M:	Alexandre Belloni <alexandre.belloni@bootlin.com>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 33b00579beff..61deacf68e13 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -264,7 +264,6 @@ config PHYS_OFFSET
>   			ARCH_FOOTBRIDGE || \
>   			ARCH_INTEGRATOR || \
>   			ARCH_IOP13XX || \
> -			ARCH_KS8695 || \
>   			ARCH_REALVIEW
>   	default 0x10000000 if ARCH_OMAP1 || ARCH_RPC
>   	default 0x20000000 if ARCH_S5PV210
> @@ -451,17 +450,6 @@ config ARCH_DOVE
>   	help
>   	  Support for the Marvell Dove SoC 88AP510
>   
> -config ARCH_KS8695
> -	bool "Micrel/Kendin KS8695"
> -	select CLKSRC_MMIO
> -	select CPU_ARM922T
> -	select GENERIC_CLOCKEVENTS
> -	select GPIOLIB
> -	select NEED_MACH_MEMORY_H
> -	help
> -	  Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
> -	  System-on-Chip devices.
> -
>   config ARCH_W90X900
>   	bool "Nuvoton W90X900 CPU"
>   	select CLKDEV_LOOKUP
> @@ -744,7 +732,11 @@ source "arch/arm/mach-ixp4xx/Kconfig"
>   
>   source "arch/arm/mach-keystone/Kconfig"
>   
> +<<<<<<< HEAD
>   source "arch/arm/mach-ks8695/Kconfig"
> +=======
> +source "arch/arm/mach-lpc32xx/Kconfig"
> +>>>>>>> ARM: remove ks8695 platform
>   
>   source "arch/arm/mach-mediatek/Kconfig"
>   
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 85710e078afb..2496f1c89b88 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -509,13 +509,6 @@ choice
>   		  Say Y here if you want the debug print routines to direct
>   		  their output to UART1 serial port on KEYSTONE2 devices.
>   
> -	config DEBUG_KS8695_UART
> -		bool "KS8695 Debug UART"
> -		depends on ARCH_KS8695
> -		help
> -		  Say Y here if you want kernel low-level debugging support
> -		  on KS8695.
> -
>   	config DEBUG_LPC18XX_UART0
>   		bool "Kernel low-level debugging via LPC18xx/43xx UART0"
>   		depends on ARCH_LPC18XX
> @@ -1533,7 +1526,6 @@ config DEBUG_LL_INCLUDE
>   				 DEBUG_IMX6SX_UART || \
>   				 DEBUG_IMX6UL_UART || \
>   				 DEBUG_IMX7D_UART
> -	default "debug/ks8695.S" if DEBUG_KS8695_UART
>   	default "debug/msm.S" if DEBUG_QCOM_UARTDM
>   	default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
>   	default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index c3624ca6c0bc..c9daa4adc6fd 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -178,7 +178,6 @@ machine-$(CONFIG_ARCH_IOP32X)		+= iop32x
>   machine-$(CONFIG_ARCH_IOP33X)		+= iop33x
>   machine-$(CONFIG_ARCH_IXP4XX)		+= ixp4xx
>   machine-$(CONFIG_ARCH_KEYSTONE)		+= keystone
> -machine-$(CONFIG_ARCH_KS8695)		+= ks8695
>   machine-$(CONFIG_ARCH_LPC18XX)		+= lpc18xx
>   machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
>   machine-$(CONFIG_ARCH_MESON)		+= meson
> 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 @@
> -# CONFIG_SWAP is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_POSIX_MQUEUE=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_SYSFS_DEPRECATED_V2=y
> -CONFIG_BLK_DEV_INITRD=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_IOSCHED_DEADLINE is not set
> -# CONFIG_IOSCHED_CFQ is not set
> -CONFIG_ARCH_KS8695=y
> -CONFIG_MACH_KS8695=y
> -CONFIG_MACH_DSM320=y
> -CONFIG_MACH_ACS5K=y
> -# CONFIG_ARM_THUMB is not set
> -CONFIG_PCI=y
> -CONFIG_PCI_DEBUG=y
> -CONFIG_PCCARD=y
> -CONFIG_YENTA=y
> -CONFIG_AEABI=y
> -CONFIG_ZBOOT_ROM_TEXT=0x0
> -CONFIG_ZBOOT_ROM_BSS=0x0
> -CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -CONFIG_IP_PNP=y
> -CONFIG_IP_PNP_DHCP=y
> -# CONFIG_IPV6 is not set
> -CONFIG_MTD=y
> -CONFIG_MTD_BLOCK=y
> -CONFIG_MTD_CFI=y
> -CONFIG_MTD_JEDECPROBE=y
> -CONFIG_MTD_CFI_ADV_OPTIONS=y
> -CONFIG_MTD_CFI_INTELEXT=y
> -CONFIG_MTD_CFI_AMDSTD=y
> -CONFIG_MTD_PHYSMAP=y
> -CONFIG_BLK_DEV_RAM=y
> -CONFIG_BLK_DEV_RAM_SIZE=8192
> -CONFIG_NETDEVICES=y
> -CONFIG_NET_ETHERNET=y
> -CONFIG_ARM_KS8695_ETHER=y
> -CONFIG_PRISM54=m
> -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> -# CONFIG_INPUT_KEYBOARD is not set
> -# CONFIG_INPUT_MOUSE is not set
> -# CONFIG_SERIO is not set
> -CONFIG_SERIAL_KS8695=y
> -CONFIG_SERIAL_KS8695_CONSOLE=y
> -CONFIG_I2C=y
> -CONFIG_I2C_CHARDEV=y
> -CONFIG_I2C_GPIO=y
> -CONFIG_GPIO_SYSFS=y
> -CONFIG_GPIO_PCA953X=y
> -CONFIG_WATCHDOG=y
> -CONFIG_KS8695_WATCHDOG=y
> -# CONFIG_VGA_CONSOLE is not set
> -CONFIG_RTC_CLASS=y
> -CONFIG_RTC_DRV_PCF8563=y
> -CONFIG_EXT2_FS=y
> -CONFIG_TMPFS=y
> -CONFIG_JFFS2_FS=y
> -CONFIG_JFFS2_SUMMARY=y
> -CONFIG_JFFS2_COMPRESSION_OPTIONS=y
> -CONFIG_JFFS2_RUBIN=y
> -CONFIG_CRAMFS=y
> -CONFIG_NFS_FS=y
> -CONFIG_NFS_V3=y
> -CONFIG_ROOT_NFS=y
> -CONFIG_DEBUG_KERNEL=y
> -CONFIG_DEBUG_MUTEXES=y
> -# CONFIG_FTRACE is not set
> -CONFIG_DEBUG_USER=y
> -CONFIG_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 @@
> -# CONFIG_SWAP is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_POSIX_MQUEUE=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_SYSFS_DEPRECATED_V2=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_IOSCHED_DEADLINE is not set
> -# CONFIG_IOSCHED_CFQ is not set
> -CONFIG_ARCH_KS8695=y
> -CONFIG_MACH_ACS5K=y
> -# CONFIG_ARM_THUMB is not set
> -CONFIG_AEABI=y
> -CONFIG_ZBOOT_ROM_TEXT=0x0
> -CONFIG_ZBOOT_ROM_BSS=0x0
> -CONFIG_CMDLINE="console=ttyAM0,115200 init=/bin/sh"
> -CONFIG_FPE_NWFPE=y
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
> -# CONFIG_INET_XFRM_MODE_TUNNEL is not set
> -# CONFIG_INET_XFRM_MODE_BEET is not set
> -# CONFIG_IPV6 is not set
> -CONFIG_MTD=y
> -CONFIG_MTD_BLOCK=y
> -CONFIG_MTD_CFI=y
> -CONFIG_MTD_JEDECPROBE=y
> -CONFIG_MTD_CFI_ADV_OPTIONS=y
> -CONFIG_MTD_CFI_INTELEXT=y
> -CONFIG_MTD_CFI_AMDSTD=y
> -CONFIG_MTD_PHYSMAP=y
> -# CONFIG_BLK_DEV is not set
> -CONFIG_NETDEVICES=y
> -CONFIG_NET_ETHERNET=y
> -CONFIG_ARM_KS8695_ETHER=y
> -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> -# CONFIG_INPUT_KEYBOARD is not set
> -# CONFIG_INPUT_MOUSE is not set
> -# CONFIG_SERIO is not set
> -CONFIG_SERIAL_KS8695=y
> -CONFIG_SERIAL_KS8695_CONSOLE=y
> -# CONFIG_HW_RANDOM is not set
> -CONFIG_I2C=y
> -CONFIG_I2C_CHARDEV=y
> -CONFIG_I2C_GPIO=y
> -CONFIG_GPIO_SYSFS=y
> -CONFIG_GPIO_PCA953X=y
> -# CONFIG_HWMON is not set
> -CONFIG_WATCHDOG=y
> -CONFIG_KS8695_WATCHDOG=y
> -# CONFIG_VGA_CONSOLE is not set
> -# CONFIG_USB_SUPPORT is not set
> -CONFIG_RTC_CLASS=y
> -CONFIG_RTC_DRV_PCF8563=y
> -CONFIG_TMPFS=y
> -CONFIG_JFFS2_FS=y
> -CONFIG_JFFS2_SUMMARY=y
> -CONFIG_JFFS2_COMPRESSION_OPTIONS=y
> -CONFIG_JFFS2_RUBIN=y
> -CONFIG_SQUASHFS=y
> -# CONFIG_NETWORK_FILESYSTEMS is not set
> -CONFIG_DEBUG_KERNEL=y
> -CONFIG_DEBUG_MUTEXES=y
> -# CONFIG_FTRACE is not set
> -CONFIG_DEBUG_USER=y
> 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 @@
> -# CONFIG_SWAP is not set
> -CONFIG_SYSVIPC=y
> -CONFIG_LOG_BUF_SHIFT=14
> -CONFIG_SYSFS_DEPRECATED_V2=y
> -CONFIG_BLK_DEV_INITRD=y
> -CONFIG_SLAB=y
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -# CONFIG_BLK_DEV_BSG is not set
> -# CONFIG_IOSCHED_DEADLINE is not set
> -# CONFIG_IOSCHED_CFQ is not set
> -CONFIG_ARCH_KS8695=y
> -CONFIG_MACH_KS8695=y
> -CONFIG_MACH_DSM320=y
> -# CONFIG_ARM_THUMB is not set
> -CONFIG_PCI=y
> -CONFIG_PCI_DEBUG=y
> -CONFIG_PCCARD=y
> -CONFIG_YENTA=y
> -CONFIG_AEABI=y
> -CONFIG_ZBOOT_ROM_TEXT=0x0
> -CONFIG_ZBOOT_ROM_BSS=0x0
> -CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
> -CONFIG_NET=y
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_INET=y
> -CONFIG_IP_PNP=y
> -CONFIG_IP_PNP_DHCP=y
> -# CONFIG_IPV6 is not set
> -CONFIG_MTD=y
> -CONFIG_MTD_REDBOOT_PARTS=y
> -CONFIG_MTD_CMDLINE_PARTS=y
> -CONFIG_MTD_BLOCK=y
> -CONFIG_MTD_CFI=y
> -CONFIG_MTD_JEDECPROBE=y
> -CONFIG_MTD_CFI_INTELEXT=y
> -CONFIG_MTD_PHYSMAP=y
> -CONFIG_BLK_DEV_RAM=y
> -CONFIG_BLK_DEV_RAM_SIZE=8192
> -CONFIG_NETDEVICES=y
> -CONFIG_NET_ETHERNET=y
> -CONFIG_MII=y
> -CONFIG_PRISM54=m
> -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> -# CONFIG_INPUT_KEYBOARD is not set
> -# CONFIG_INPUT_MOUSE is not set
> -# CONFIG_SERIO is not set
> -CONFIG_SERIAL_KS8695=y
> -CONFIG_SERIAL_KS8695_CONSOLE=y
> -# CONFIG_HWMON is not set
> -# CONFIG_VGA_CONSOLE is not set
> -CONFIG_EXT2_FS=y
> -CONFIG_TMPFS=y
> -CONFIG_JFFS2_FS=y
> -CONFIG_JFFS2_SUMMARY=y
> -CONFIG_JFFS2_COMPRESSION_OPTIONS=y
> -CONFIG_JFFS2_RUBIN=y
> -CONFIG_CRAMFS=y
> -CONFIG_NFS_FS=y
> -CONFIG_NFS_V3=y
> -CONFIG_ROOT_NFS=y
> -CONFIG_DEBUG_KERNEL=y
> -CONFIG_DEBUG_MUTEXES=y
> -# CONFIG_FTRACE is not set
> -CONFIG_DEBUG_USER=y
> -CONFIG_DEBUG_LL=y
> 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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/include/debug/ks8695.S
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - Debug macros
> - */
> -
> -#define KS8695_UART_PA	0x03ffe000
> -#define KS8695_UART_VA	0xf00fe000
> -#define KS8695_URTH	(0x04)
> -#define KS8695_URLS	(0x14)
> -#define URLS_URTE	(1 << 6)
> -#define URLS_URTHRE	(1 << 5)
> -
> -	.macro	addruart, rp, rv, tmp
> -		ldr	\rp, =KS8695_UART_PA		@ physical base address
> -		ldr	\rv, =KS8695_UART_VA		@ virtual base address
> -	.endm
> -
> -	.macro	senduart, rd, rx
> -		str	\rd, [\rx, #KS8695_URTH]	@ Write to Transmit Holding Register
> -	.endm
> -
> -	.macro	busyuart, rd, rx
> -1001:		ldr	\rd, [\rx, #KS8695_URLS]	@ Read Line Status Register
> -		tst	\rd, #URLS_URTE			@ Holding & Shift registers empty?
> -		beq	1001b
> -	.endm
> -
> -	.macro	waituart, rd, rx
> -1001:		ldr	\rd, [\rx, #KS8695_URLS]	@ Read Line Status Register
> -		tst	\rd, #URLS_URTHRE		@ Holding Register empty?
> -		beq	1001b
> -	.endm
> 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 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -if ARCH_KS8695
> -
> -menu "Kendin/Micrel KS8695 Implementations"
> -
> -config MACH_KS8695
> -	bool "KS8695 development board"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to run on the original
> -	  Kendin-Micrel KS8695 development board.
> -
> -config MACH_DSM320
> -	bool "DSM-320 Wireless Media Player"
> -	help
> -	  Say 'Y' here if you want your kernel to run on the D-Link
> -	  DSM-320 Wireless Media Player.
> -
> -config MACH_ACS5K
> -	bool "Brivo Systems LLC, ACS-5000 Master board"
> -	help
> -	  say 'Y' here if you want your kernel to run on the Brivo
> -	  Systems LLC, ACS-5000 Master board.
> -
> -config MACH_LITE300
> -	bool "SecureComputing SG300"
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  SecureComputing / SnapGear SG300 VPN Internet Router.
> -	  See http://www.securecomputing.com for more details.
> -
> -config MACH_SG310
> -	bool "McAfee SG310"
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  McAfee / SnapGear SG310 VPN Internet Router.
> -	  See http://www.mcafee.com for more details.
> -
> -config MACH_SE4200
> -	bool "SecureComputing SE4200"
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  SecureComputing / SnapGear SE4200 Secure Wireless VPN
> -	  Internet Router.
> -	  See http://www.securecomputing.com for more details.
> -
> -config MACH_CM4002
> -	bool "OpenGear CM4002"
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  CM4002 Secure Access Server. See http://www.opengear.com for
> -	  more details.
> -
> -config MACH_CM4008
> -	bool "OpenGear CM4008"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  CM4008 Console Server. See http://www.opengear.com for more
> -	  details.
> -
> -config MACH_CM41xx
> -	bool "OpenGear CM41xx"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  CM4016 or CM4048 Console Servers. See http://www.opengear.com for
> -	  more details.
> -
> -config MACH_IM4004
> -	bool "OpenGear IM4004"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  IM4004 Secure Access Server. See http://www.opengear.com for
> -	  more details.
> -
> -config MACH_IM42xx
> -	bool "OpenGear IM42xx"
> -	select HAVE_PCI
> -	help
> -	  Say 'Y' here if you want your kernel to support the OpenGear
> -	  IM4216 or IM4248 Console Servers. See http://www.opengear.com for
> -	  more details.
> -
> -endmenu
> -
> -endif
> 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 @@
> -# SPDX-License-Identifier: GPL-2.0
> -# arch/arm/mach-ks8695/Makefile
> -#
> -# Makefile for KS8695 architecture support
> -#
> -
> -obj-y				:= cpu.o irq.o time.o devices.o
> -
> -# PCI support is optional
> -obj-$(CONFIG_PCI)		+= pci.o
> -
> -# Board-specific support
> -obj-$(CONFIG_MACH_KS8695)	+= board-micrel.o
> -obj-$(CONFIG_MACH_DSM320)	+= board-dsm320.o
> -obj-$(CONFIG_MACH_ACS5K)	+= board-acs5k.o
> -obj-$(CONFIG_MACH_LITE300)	+= board-sg.o
> -obj-$(CONFIG_MACH_SG310)	+= board-sg.o
> -obj-$(CONFIG_MACH_SE4200)	+= board-sg.o
> -obj-$(CONFIG_MACH_CM4002)	+= board-og.o
> -obj-$(CONFIG_MACH_CM4008)	+= board-og.o
> -obj-$(CONFIG_MACH_CM41xx)	+= board-og.o
> -obj-$(CONFIG_MACH_IM4004)	+= board-og.o
> -obj-$(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 @@
> -# SPDX-License-Identifier: GPL-2.0-only
> -# Note: the following conditions must always be true:
> -#   ZRELADDR == virt_to_phys(TEXTADDR)
> -#   PARAMS_PHYS must be within 4MB of ZRELADDR
> -#   INITRD_PHYS must be in RAM
> -
> -   zreladdr-y	+= 0x00008000
> -params_phys-y	:= 0x00000100
> -initrd_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * arch/arm/mach-ks8695/board-acs5k.c
> - *
> - * Brivo Systems LLC, ACS-5000 Master Board
> - *
> - * Copyright 2008 Simtec Electronics
> - *		  Daniel Silverstone <dsilvers@simtec.co.uk>
> - */
> -#include <linux/gpio.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/gpio/machine.h>
> -#include <linux/i2c.h>
> -#include <linux/i2c-algo-bit.h>
> -#include <linux/platform_data/i2c-gpio.h>
> -#include <linux/platform_data/pca953x.h>
> -
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/map.h>
> -#include <linux/mtd/physmap.h>
> -#include <linux/mtd/partitions.h>
> -
> -#include <asm/mach-types.h>
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include <asm/mach/irq.h>
> -
> -#include "devices.h"
> -#include <mach/gpio-ks8695.h>
> -
> -#include "generic.h"
> -
> -static struct gpiod_lookup_table acs5k_i2c_gpiod_table = {
> -	.dev_id		= "i2c-gpio",
> -	.table		= {
> -		GPIO_LOOKUP_IDX("KS8695", 4, NULL, 0,
> -				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
> -		GPIO_LOOKUP_IDX("KS8695", 5, NULL, 1,
> -				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
> -	},
> -};
> -
> -static struct i2c_gpio_platform_data acs5k_i2c_device_platdata = {
> -	.udelay		= 10,
> -};
> -
> -static struct platform_device acs5k_i2c_device = {
> -	.name		= "i2c-gpio",
> -	.id		= -1,
> -	.num_resources	= 0,
> -	.resource	= NULL,
> -	.dev		= {
> -		.platform_data	= &acs5k_i2c_device_platdata,
> -	},
> -};
> -
> -static int acs5k_pca9555_setup(struct i2c_client *client,
> -			       unsigned gpio_base, unsigned ngpio,
> -			       void *context)
> -{
> -	static int acs5k_gpio_value[] = {
> -		-1, -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, 0, 1, 0, -1, -1
> -	};
> -	int n;
> -
> -	for (n = 0; n < ARRAY_SIZE(acs5k_gpio_value); ++n) {
> -		gpio_request(gpio_base + n, "ACS-5000 GPIO Expander");
> -		if (acs5k_gpio_value[n] < 0)
> -			gpio_direction_input(gpio_base + n);
> -		else
> -			gpio_direction_output(gpio_base + n,
> -					      acs5k_gpio_value[n]);
> -		gpio_export(gpio_base + n, 0); /* Export, direction locked down */
> -	}
> -
> -	return 0;
> -}
> -
> -static struct pca953x_platform_data acs5k_i2c_pca9555_platdata = {
> -	.gpio_base	= 16, /* Start directly after the CPU's GPIO */
> -	.invert		= 0, /* Do not invert */
> -	.setup		= acs5k_pca9555_setup,
> -};
> -
> -static struct i2c_board_info acs5k_i2c_devs[] __initdata = {
> -	{
> -		I2C_BOARD_INFO("pcf8563", 0x51),
> -	},
> -	{
> -		I2C_BOARD_INFO("pca9555", 0x20),
> -		.platform_data = &acs5k_i2c_pca9555_platdata,
> -	},
> -};
> -
> -static void __init acs5k_i2c_init(void)
> -{
> -	/* The gpio interface */
> -	gpiod_add_lookup_table(&acs5k_i2c_gpiod_table);
> -	platform_device_register(&acs5k_i2c_device);
> -	/* I2C devices */
> -	i2c_register_board_info(0, acs5k_i2c_devs,
> -				ARRAY_SIZE(acs5k_i2c_devs));
> -}
> -
> -static struct mtd_partition acs5k_nor_partitions[] = {
> -	[0] = {
> -		.name	= "Boot Agent and config",
> -		.size	= SZ_256K,
> -		.offset	= 0,
> -		.mask_flags = MTD_WRITEABLE,
> -	},
> -	[1] = {
> -		.name	= "Kernel",
> -		.size	= SZ_1M,
> -		.offset	= SZ_256K,
> -	},
> -	[2] = {
> -		.name	= "SquashFS1",
> -		.size	= SZ_2M,
> -		.offset	= SZ_256K + SZ_1M,
> -	},
> -	[3] = {
> -		.name	= "SquashFS2",
> -		.size	= SZ_4M + SZ_2M,
> -		.offset	= SZ_256K + SZ_1M + SZ_2M,
> -	},
> -	[4] = {
> -		.name	= "Data",
> -		.size	= SZ_16M + SZ_4M + SZ_2M + SZ_512K, /* 22.5 MB */
> -		.offset	= SZ_256K + SZ_8M + SZ_1M,
> -	}
> -};
> -
> -static struct physmap_flash_data acs5k_nor_pdata = {
> -	.width		= 4,
> -	.nr_parts	= ARRAY_SIZE(acs5k_nor_partitions),
> -	.parts		= acs5k_nor_partitions,
> -};
> -
> -static struct resource acs5k_nor_resource[] = {
> -	[0] = {
> -		.start = SZ_32M, /* We expect the bootloader to map
> -				  * the flash here.
> -				  */
> -		.end   = SZ_32M + SZ_16M - 1,
> -		.flags = IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.start = SZ_32M + SZ_16M,
> -		.end   = SZ_32M + SZ_32M - SZ_256K - 1,
> -		.flags = IORESOURCE_MEM,
> -	}
> -};
> -
> -static struct platform_device acs5k_device_nor = {
> -	.name		= "physmap-flash",
> -	.id		= -1,
> -	.num_resources	= ARRAY_SIZE(acs5k_nor_resource),
> -	.resource	= acs5k_nor_resource,
> -	.dev		= {
> -		.platform_data = &acs5k_nor_pdata,
> -	},
> -};
> -
> -static void __init acs5k_register_nor(void)
> -{
> -	int ret;
> -
> -	if (acs5k_nor_partitions[0].mask_flags == 0)
> -		printk(KERN_WARNING "Warning: Unprotecting bootloader and configuration partition\n");
> -
> -	ret = platform_device_register(&acs5k_device_nor);
> -	if (ret < 0)
> -		printk(KERN_ERR "failed to register physmap-flash device\n");
> -}
> -
> -static int __init acs5k_protection_setup(char *s)
> -{
> -	/* We can't allocate anything here but we should be able
> -	 * to trivially parse s and decide if we can protect the
> -	 * bootloader partition or not
> -	 */
> -	if (strcmp(s, "no") == 0)
> -		acs5k_nor_partitions[0].mask_flags = 0;
> -
> -	return 1;
> -}
> -
> -__setup("protect_bootloader=", acs5k_protection_setup);
> -
> -static void __init acs5k_init_gpio(void)
> -{
> -	int i;
> -
> -	ks8695_register_gpios();
> -	for (i = 0; i < 4; ++i)
> -		gpio_request(i, "ACS5K IRQ");
> -	gpio_request(7, "ACS5K KS_FRDY");
> -	for (i = 8; i < 16; ++i)
> -		gpio_request(i, "ACS5K Unused");
> -
> -	gpio_request(3, "ACS5K CAN Control");
> -	gpio_request(6, "ACS5K Heartbeat");
> -	gpio_direction_output(3, 1); /* Default CAN_RESET high */
> -	gpio_direction_output(6, 0); /* Default KS8695_ACTIVE low */
> -	gpio_export(3, 0); /* export CAN_RESET as output only */
> -	gpio_export(6, 0); /* export KS8695_ACTIVE as output only */
> -}
> -
> -static void __init acs5k_init(void)
> -{
> -	acs5k_init_gpio();
> -
> -	/* Network device */
> -	ks8695_add_device_lan();	/* eth0 = LAN */
> -	ks8695_add_device_wan();	/* ethX = WAN */
> -
> -	/* NOR devices */
> -	acs5k_register_nor();
> -
> -	/* I2C bus */
> -	acs5k_i2c_init();
> -}
> -
> -MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
> -	/* Maintainer: Simtec Electronics. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= acs5k_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * arch/arm/mach-ks8695/board-dsm320.c
> - *
> - * DSM-320 D-Link Wireless Media Player, board support.
> - *
> - * Copyright 2008 Simtec Electronics
> - *		  Daniel Silverstone <dsilvers@simtec.co.uk>
> - */
> -#include <linux/gpio.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/map.h>
> -#include <linux/mtd/physmap.h>
> -#include <linux/mtd/partitions.h>
> -
> -#include <asm/mach-types.h>
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include <asm/mach/irq.h>
> -
> -#include "devices.h"
> -#include <mach/gpio-ks8695.h>
> -
> -#include "generic.h"
> -
> -#ifdef CONFIG_PCI
> -static int dsm320_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> -{
> -	switch (slot) {
> -	case 0:
> -		/* PCI-AHB bridge? */
> -		return KS8695_IRQ_EXTERN0;
> -	case 18:
> -		/* Mini PCI slot */
> -		return KS8695_IRQ_EXTERN2;
> -	case 20:
> -		/* RealMAGIC chip */
> -		return KS8695_IRQ_EXTERN0;
> -	}
> -	BUG();
> -}
> -
> -static struct ks8695_pci_cfg __initdata dsm320_pci = {
> -	.mode		= KS8695_MODE_MINIPCI,
> -	.map_irq	= dsm320_pci_map_irq,
> -};
> -
> -static void __init dsm320_register_pci(void)
> -{
> -	/* Initialise the GPIO lines for interrupt mode */
> -	/* RealMAGIC */
> -	ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
> -	/* MiniPCI Slot */
> -	ks8695_gpio_interrupt(KS8695_GPIO_2, IRQ_TYPE_LEVEL_LOW);
> -
> -	ks8695_init_pci(&dsm320_pci);
> -}
> -
> -#else
> -static inline void __init dsm320_register_pci(void) { }
> -#endif
> -
> -static struct physmap_flash_data dsm320_nor_pdata = {
> -	.width		= 4,
> -	.nr_parts	= 0,
> -};
> -
> -static struct resource dsm320_nor_resource[] = {
> -	[0] = {
> -		.start = SZ_32M, /* We expect the bootloader to map
> -				  * the flash here.
> -				  */
> -		.end   = SZ_32M + SZ_4M - 1,
> -		.flags = IORESOURCE_MEM,
> -	}
> -};
> -
> -static struct platform_device dsm320_device_nor = {
> -	.name		= "physmap-flash",
> -	.id		= -1,
> -	.num_resources	= ARRAY_SIZE(dsm320_nor_resource),
> -	.resource	= dsm320_nor_resource,
> -	.dev		= {
> -		.platform_data = &dsm320_nor_pdata,
> -	},
> -};
> -
> -void __init dsm320_register_nor(void)
> -{
> -	int ret;
> -
> -	ret = platform_device_register(&dsm320_device_nor);
> -	if (ret < 0)
> -		printk(KERN_ERR "failed to register physmap-flash device\n");
> -}
> -
> -static void __init dsm320_init(void)
> -{
> -	/* GPIO registration */
> -	ks8695_register_gpios();
> -
> -	/* PCI registration */
> -	dsm320_register_pci();
> -
> -	/* Network device */
> -	ks8695_add_device_lan();	/* eth0 = LAN */
> -
> -	/* NOR devices */
> -	dsm320_register_nor();
> -}
> -
> -MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
> -	/* Maintainer: Simtec Electronics. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= dsm320_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * arch/arm/mach-ks8695/board-micrel.c
> - */
> -#include <linux/gpio.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -
> -#include <asm/mach-types.h>
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include <asm/mach/irq.h>
> -
> -#include <mach/gpio-ks8695.h>
> -#include "devices.h"
> -
> -#include "generic.h"
> -
> -#ifdef CONFIG_PCI
> -static int micrel_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> -{
> -	return KS8695_IRQ_EXTERN0;
> -}
> -
> -static struct ks8695_pci_cfg __initdata micrel_pci = {
> -	.mode		= KS8695_MODE_MINIPCI,
> -	.map_irq	= micrel_pci_map_irq,
> -};
> -#endif
> -
> -
> -static void __init micrel_init(void)
> -{
> -	printk(KERN_INFO "Micrel KS8695 Development Board initializing\n");
> -
> -	ks8695_register_gpios();
> -
> -#ifdef CONFIG_PCI
> -	ks8695_init_pci(&micrel_pci);
> -#endif
> -
> -	/* Add devices */
> -	ks8695_add_device_wan();	/* eth0 = WAN */
> -	ks8695_add_device_lan();	/* eth1 = LAN */
> -}
> -
> -MACHINE_START(KS8695, "KS8695 Centaur Development Board")
> -	/* Maintainer: Micrel Semiconductor Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= micrel_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * board-og.c -- support for the OpenGear KS8695 based boards.
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/interrupt.h>
> -#include <linux/init.h>
> -#include <linux/delay.h>
> -#include <linux/platform_device.h>
> -#include <linux/serial_8250.h>
> -#include <linux/gpio.h>
> -#include <linux/irq.h>
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -#include "devices.h"
> -#include <mach/regs-gpio.h>
> -#include <mach/gpio-ks8695.h>
> -#include "generic.h"
> -
> -static int og_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> -{
> -	if (machine_is_im4004() && (slot == 8))
> -		return KS8695_IRQ_EXTERN1;
> -	return KS8695_IRQ_EXTERN0;
> -}
> -
> -static struct ks8695_pci_cfg __initdata og_pci = {
> -	.mode		= KS8695_MODE_PCI,
> -	.map_irq	= og_pci_map_irq,
> -};
> -
> -static void __init og_register_pci(void)
> -{
> -	/* Initialize the GPIO lines for interrupt mode */
> -	ks8695_gpio_interrupt(KS8695_GPIO_0, IRQ_TYPE_LEVEL_LOW);
> -
> -	/* Cardbus Slot */
> -	if (machine_is_im4004())
> -		ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW);
> -
> -	if (IS_ENABLED(CONFIG_PCI))
> -		ks8695_init_pci(&og_pci);
> -}
> -
> -/*
> - * The PCI bus reset is driven by a dedicated GPIO line. Toggle it here
> - * and bring the PCI bus out of reset.
> - */
> -static void __init og_pci_bus_reset(void)
> -{
> -	unsigned int rstline = 1;
> -
> -	/* Some boards use a different GPIO as the PCI reset line */
> -	if (machine_is_im4004())
> -		rstline = 2;
> -	else if (machine_is_im42xx())
> -		rstline = 0;
> -
> -	gpio_request(rstline, "PCI reset");
> -	gpio_direction_output(rstline, 0);
> -
> -	/* Drive a reset on the PCI reset line */
> -	gpio_set_value(rstline, 1);
> -	gpio_set_value(rstline, 0);
> -	mdelay(100);
> -	gpio_set_value(rstline, 1);
> -	mdelay(100);
> -}
> -
> -/*
> - * Direct connect serial ports (non-PCI that is).
> - */
> -#define	S8250_PHYS	0x03800000
> -#define	S8250_VIRT	0xf4000000
> -#define	S8250_SIZE	0x00100000
> -
> -static struct map_desc og_io_desc[] __initdata = {
> -	{
> -		.virtual	= S8250_VIRT,
> -		.pfn		= __phys_to_pfn(S8250_PHYS),
> -		.length		= S8250_SIZE,
> -		.type		= MT_DEVICE,
> -	}
> -};
> -
> -static struct resource og_uart_resources[] = {
> -	{
> -		.start		= S8250_VIRT,
> -		.end		= S8250_VIRT + S8250_SIZE,
> -		.flags		= IORESOURCE_MEM
> -	},
> -};
> -
> -static struct plat_serial8250_port og_uart_data[] = {
> -	{
> -		.mapbase	= S8250_VIRT,
> -		.membase	= (char *) S8250_VIRT,
> -		.irq		= 3,
> -		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
> -		.iotype		= UPIO_MEM,
> -		.regshift	= 2,
> -		.uartclk	= 115200 * 16,
> -	},
> -	{ },
> -};
> -
> -static struct platform_device og_uart = {
> -	.name			= "serial8250",
> -	.id			= 0,
> -	.dev.platform_data	= og_uart_data,
> -	.num_resources		= 1,
> -	.resource		= og_uart_resources
> -};
> -
> -static struct platform_device *og_devices[] __initdata = {
> -	&og_uart
> -};
> -
> -static void __init og_init(void)
> -{
> -	ks8695_register_gpios();
> -
> -	if (machine_is_cm4002()) {
> -		ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_HIGH);
> -		iotable_init(og_io_desc, ARRAY_SIZE(og_io_desc));
> -		platform_add_devices(og_devices, ARRAY_SIZE(og_devices));
> -	} else {
> -		og_pci_bus_reset();
> -		og_register_pci();
> -	}
> -
> -	ks8695_add_device_lan();
> -	ks8695_add_device_wan();
> -}
> -
> -#ifdef CONFIG_MACH_CM4002
> -MACHINE_START(CM4002, "OpenGear/CM4002")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_CM4008
> -MACHINE_START(CM4008, "OpenGear/CM4008")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_CM41xx
> -MACHINE_START(CM41XX, "OpenGear/CM41xx")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_IM4004
> -MACHINE_START(IM4004, "OpenGear/IM4004")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_IM42xx
> -MACHINE_START(IM42XX, "OpenGear/IM42xx")
> -	/* OpenGear Inc. */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= og_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart        = ks8695_restart,
> -MACHINE_END
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * board-sg.c -- support for the SnapGear KS8695 based boards
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/mtd/mtd.h>
> -#include <linux/mtd/map.h>
> -#include <linux/mtd/physmap.h>
> -#include <linux/mtd/partitions.h>
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
> -#include "devices.h"
> -#include "generic.h"
> -
> -/*
> - * The SG310 machine type is fitted with a conventional 8MB Strataflash
> - * device. Define its partitioning.
> - */
> -#define	FL_BASE		0x02000000
> -#define	FL_SIZE		SZ_8M
> -
> -static struct mtd_partition sg_mtd_partitions[] = {
> -	[0] = {
> -		.name	= "SnapGear Boot Loader",
> -		.size	= SZ_128K,
> -	},
> -	[1] = {
> -		.name	= "SnapGear non-volatile configuration",
> -		.size	= SZ_512K,
> -		.offset	= SZ_256K,
> -	},
> -	[2] = {
> -		.name	= "SnapGear image",
> -		.offset	= SZ_512K + SZ_256K,
> -	},
> -	[3] = {
> -		.name	= "SnapGear StrataFlash",
> -	},
> -	[4] = {
> -		.name	= "SnapGear Boot Tags",
> -		.size	= SZ_128K,
> -		.offset	= SZ_128K,
> -	},
> -};
> -
> -static struct physmap_flash_data sg_mtd_pdata = {
> -	.width		= 1,
> -	.nr_parts	= ARRAY_SIZE(sg_mtd_partitions),
> -	.parts		= sg_mtd_partitions,
> -};
> -
> -
> -static struct resource sg_mtd_resource[] = {
> -	[0] = {
> -		.start = FL_BASE,
> -		.end   = FL_BASE + FL_SIZE - 1,
> -		.flags = IORESOURCE_MEM,
> -	},
> -};
> -
> -static struct platform_device sg_mtd_device = {
> -	.name		= "physmap-flash",
> -	.id		= 0,
> -	.num_resources	= ARRAY_SIZE(sg_mtd_resource),
> -	.resource	= sg_mtd_resource,
> -	.dev		= {
> -		.platform_data = &sg_mtd_pdata,
> -	},
> -};
> -
> -static void __init sg_init(void)
> -{
> -	ks8695_add_device_lan();
> -	ks8695_add_device_wan();
> -
> -	if (machine_is_sg310())
> -		platform_device_register(&sg_mtd_device);
> -}
> -
> -#ifdef CONFIG_MACH_LITE300
> -MACHINE_START(LITE300, "SecureComputing/SG300")
> -	/* SnapGear */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= sg_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_SG310
> -MACHINE_START(SG310, "McAfee/SG310")
> -	/* SnapGear */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= sg_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_END
> -#endif
> -
> -#ifdef CONFIG_MACH_SE4200
> -MACHINE_START(SE4200, "SecureComputing/SE4200")
> -	/* SnapGear */
> -	.atag_offset	= 0x100,
> -	.map_io		= ks8695_map_io,
> -	.init_irq	= ks8695_init_irq,
> -	.init_machine	= sg_init,
> -	.init_time	= ks8695_timer_init,
> -	.restart	= ks8695_restart,
> -MACHINE_END
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/cpu.c
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 CPU support
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/init.h>
> -#include <linux/io.h>
> -
> -#include <mach/hardware.h>
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -
> -#include "regs-sys.h"
> -#include <mach/regs-misc.h>
> -
> -
> -static struct map_desc ks8695_io_desc[] __initdata = {
> -	{
> -		.virtual	= (unsigned long)KS8695_IO_VA,
> -		.pfn		= __phys_to_pfn(KS8695_IO_PA),
> -		.length		= KS8695_IO_SIZE,
> -		.type		= MT_DEVICE,
> -	}
> -};
> -
> -static void __init ks8695_processor_info(void)
> -{
> -	unsigned long id, rev;
> -
> -	id = __raw_readl(KS8695_MISC_VA + KS8695_DID);
> -	rev = __raw_readl(KS8695_MISC_VA + KS8695_RID);
> -
> -	printk("KS8695 ID=%04lx  SubID=%02lx  Revision=%02lx\n", (id & DID_ID), (rev & RID_SUBID), (rev & RID_REVISION));
> -}
> -
> -static unsigned int sysclk[8] = { 125000000, 100000000, 62500000, 50000000, 41700000, 33300000, 31300000, 25000000 };
> -static unsigned int cpuclk[8] = { 166000000, 166000000, 83000000, 83000000, 55300000, 55300000, 41500000, 41500000 };
> -
> -static void __init ks8695_clock_info(void)
> -{
> -	unsigned int scdc = __raw_readl(KS8695_SYS_VA + KS8695_CLKCON) & CLKCON_SCDC;
> -
> -	printk("Clocks: System %u MHz, CPU %u MHz\n",
> -			sysclk[scdc] / 1000000, cpuclk[scdc] / 1000000);
> -}
> -
> -void __init ks8695_map_io(void)
> -{
> -	iotable_init(ks8695_io_desc, ARRAY_SIZE(ks8695_io_desc));
> -
> -	ks8695_processor_info();
> -	ks8695_clock_info();
> -}
> 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 @@
> -/*
> - * arch/arm/mach-ks8695/devices.c
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> - */
> -
> -#include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> -
> -#include <linux/gpio.h>
> -#include <linux/platform_device.h>
> -
> -#include <mach/irqs.h>
> -#include "regs-wan.h"
> -#include "regs-lan.h"
> -#include "regs-hpna.h"
> -#include <mach/regs-switch.h>
> -#include <mach/regs-misc.h>
> -
> -
> -/* --------------------------------------------------------------------
> - *  Ethernet
> - * -------------------------------------------------------------------- */
> -
> -static u64 eth_dmamask = 0xffffffffUL;
> -
> -static struct resource ks8695_wan_resources[] = {
> -	[0] = {
> -		.start	= KS8695_WAN_PA,
> -		.end	= KS8695_WAN_PA + 0x00ff,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.name	= "WAN RX",
> -		.start	= KS8695_IRQ_WAN_RX_STATUS,
> -		.end	= KS8695_IRQ_WAN_RX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[2] = {
> -		.name	= "WAN TX",
> -		.start	= KS8695_IRQ_WAN_TX_STATUS,
> -		.end	= KS8695_IRQ_WAN_TX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[3] = {
> -		.name	= "WAN Link",
> -		.start	= KS8695_IRQ_WAN_LINK,
> -		.end	= KS8695_IRQ_WAN_LINK,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[4] = {
> -		.name	= "WAN PHY",
> -		.start	= KS8695_MISC_PA,
> -		.end	= KS8695_MISC_PA + 0x1f,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -};
> -
> -static struct platform_device ks8695_wan_device = {
> -	.name		= "ks8695_ether",
> -	.id		= 0,
> -	.dev		= {
> -				.dma_mask		= &eth_dmamask,
> -				.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.resource	= ks8695_wan_resources,
> -	.num_resources	= ARRAY_SIZE(ks8695_wan_resources),
> -};
> -
> -
> -static struct resource ks8695_lan_resources[] = {
> -	[0] = {
> -		.start	= KS8695_LAN_PA,
> -		.end	= KS8695_LAN_PA + 0x00ff,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.name	= "LAN RX",
> -		.start	= KS8695_IRQ_LAN_RX_STATUS,
> -		.end	= KS8695_IRQ_LAN_RX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[2] = {
> -		.name	= "LAN TX",
> -		.start	= KS8695_IRQ_LAN_TX_STATUS,
> -		.end	= KS8695_IRQ_LAN_TX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[3] = {
> -		.name	= "LAN SWITCH",
> -		.start	= KS8695_SWITCH_PA,
> -		.end	= KS8695_SWITCH_PA + 0x4f,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -};
> -
> -static struct platform_device ks8695_lan_device = {
> -	.name		= "ks8695_ether",
> -	.id		= 1,
> -	.dev		= {
> -				.dma_mask		= &eth_dmamask,
> -				.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.resource	= ks8695_lan_resources,
> -	.num_resources	= ARRAY_SIZE(ks8695_lan_resources),
> -};
> -
> -
> -static struct resource ks8695_hpna_resources[] = {
> -	[0] = {
> -		.start	= KS8695_HPNA_PA,
> -		.end	= KS8695_HPNA_PA + 0x00ff,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	[1] = {
> -		.name	= "HPNA RX",
> -		.start	= KS8695_IRQ_HPNA_RX_STATUS,
> -		.end	= KS8695_IRQ_HPNA_RX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -	[2] = {
> -		.name	= "HPNA TX",
> -		.start	= KS8695_IRQ_HPNA_TX_STATUS,
> -		.end	= KS8695_IRQ_HPNA_TX_STATUS,
> -		.flags	= IORESOURCE_IRQ,
> -	},
> -};
> -
> -static struct platform_device ks8695_hpna_device = {
> -	.name		= "ks8695_ether",
> -	.id		= 2,
> -	.dev		= {
> -				.dma_mask		= &eth_dmamask,
> -				.coherent_dma_mask	= 0xffffffff,
> -	},
> -	.resource	= ks8695_hpna_resources,
> -	.num_resources	= ARRAY_SIZE(ks8695_hpna_resources),
> -};
> -
> -void __init ks8695_add_device_wan(void)
> -{
> -	platform_device_register(&ks8695_wan_device);
> -}
> -
> -void __init ks8695_add_device_lan(void)
> -{
> -	platform_device_register(&ks8695_lan_device);
> -}
> -
> -void __init ks8696_add_device_hpna(void)
> -{
> -	platform_device_register(&ks8695_hpna_device);
> -}
> -
> -
> -/* --------------------------------------------------------------------
> - *  Watchdog
> - * -------------------------------------------------------------------- */
> -
> -static struct platform_device ks8695_wdt_device = {
> -	.name		= "ks8695_wdt",
> -	.id		= -1,
> -	.num_resources	= 0,
> -};
> -
> -static void __init ks8695_add_device_watchdog(void)
> -{
> -	platform_device_register(&ks8695_wdt_device);
> -}
> -
> -
> -/* -------------------------------------------------------------------- */
> -
> -/*
> - * These devices are always present and don't need any board-specific
> - * setup.
> - */
> -static int __init ks8695_add_standard_devices(void)
> -{
> -	ks8695_add_device_watchdog();
> -	return 0;
> -}
> -
> -arch_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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/devices.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - */
> -
> -#ifndef __ASM_ARCH_DEVICES_H
> -#define __ASM_ARCH_DEVICES_H
> -
> -#include <linux/pci.h>
> -
> - /* Ethernet */
> -extern void __init ks8695_add_device_wan(void);
> -extern void __init ks8695_add_device_lan(void);
> -extern void __init ks8695_add_device_hpna(void);
> -
> - /* PCI */
> -#define KS8695_MODE_PCI		0
> -#define KS8695_MODE_MINIPCI	1
> -#define KS8695_MODE_CARDBUS	2
> -
> -struct ks8695_pci_cfg {
> -	short mode;
> -	int (*map_irq)(const struct pci_dev *, u8, u8);
> -};
> -extern __init void ks8695_init_pci(struct ks8695_pci_cfg *);
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> -/*
> - * arch/arm/mach-ks8695/generic.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> -*/
> -
> -extern __init void ks8695_map_io(void);
> -extern __init void ks8695_init_irq(void);
> -extern void ks8695_restart(enum reboot_mode, const char *);
> -extern 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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/entry-macro.S
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * Low-level IRQ helper macros for KS8695
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> -*/
> -
> -#include <mach/hardware.h>
> -#include <mach/regs-irq.h>
> -
> -	.macro  get_irqnr_preamble, base, tmp
> -		ldr	\base, =KS8695_IRQ_VA			@ Base address of interrupt controller
> -	.endm
> -
> -	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
> -		ldr	\irqstat, [\base, #KS8695_INTMS]	@ Mask Status register
> -
> -		teq	\irqstat, #0
> -		beq	1001f
> -
> -		mov	\irqnr, #0
> -
> -		tst	\irqstat, #0xff
> -		moveq	\irqstat, \irqstat, lsr #8
> -		addeq	\irqnr, \irqnr, #8
> -		tsteq	\irqstat, #0xff
> -		moveq	\irqstat, \irqstat, lsr #8
> -		addeq	\irqnr, \irqnr, #8
> -		tsteq	\irqstat, #0xff
> -		moveq	\irqstat, \irqstat, lsr #8
> -		addeq	\irqnr, \irqnr, #8
> -		tst	\irqstat, #0x0f
> -		moveq	\irqstat, \irqstat, lsr #4
> -		addeq	\irqnr, \irqnr, #4
> -		tst	\irqstat, #0x03
> -		moveq	\irqstat, \irqstat, lsr #2
> -		addeq	\irqnr, \irqnr, #2
> -		tst	\irqstat, #0x01
> -		addseq	\irqnr, \irqnr, #1
> -1001:
> -	.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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * Copyright (C) 2006 Andrew Victor
> - */
> -
> -#ifndef __MACH_KS8659_GPIO_H
> -#define __MACH_KS8659_GPIO_H
> -
> -#include <linux/kernel.h>
> -
> -#define KS8695_GPIO_0		0
> -#define KS8695_GPIO_1		1
> -#define KS8695_GPIO_2		2
> -#define KS8695_GPIO_3		3
> -#define KS8695_GPIO_4		4
> -#define KS8695_GPIO_5		5
> -#define KS8695_GPIO_6		6
> -#define KS8695_GPIO_7		7
> -#define KS8695_GPIO_8		8
> -#define KS8695_GPIO_9		9
> -#define KS8695_GPIO_10		10
> -#define KS8695_GPIO_11		11
> -#define KS8695_GPIO_12		12
> -#define KS8695_GPIO_13		13
> -#define KS8695_GPIO_14		14
> -#define KS8695_GPIO_15		15
> -
> -/*
> - * Configure GPIO pin as external interrupt source.
> - */
> -extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
> -
> -/* Register the GPIOs */
> -extern void ks8695_register_gpios(void);
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/hardware.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - Memory Map definitions
> -*/
> -
> -#ifndef __ASM_ARCH_HARDWARE_H
> -#define __ASM_ARCH_HARDWARE_H
> -
> -#include <linux/sizes.h>
> -
> -/*
> - * Clocks are derived from MCLK, which is 25MHz
> - */
> -#define KS8695_CLOCK_RATE	25000000
> -
> -/*
> - * Physical RAM address.
> - */
> -#define KS8695_SDRAM_PA		0x00000000
> -
> -
> -/*
> - * We map an entire MiB with the System Configuration Registers in even
> - * though only 64KiB is needed. This makes it easier for use with the
> - * head debug code as the initial MMU setup only deals in L1 sections.
> - */
> -#define KS8695_IO_PA		0x03F00000
> -#define KS8695_IO_VA		IOMEM(0xF0000000)
> -#define KS8695_IO_SIZE		SZ_1M
> -
> -#define KS8695_PCIMEM_PA	0x60000000
> -#define KS8695_PCIMEM_SIZE	SZ_512M
> -
> -#define KS8695_PCIIO_PA		0x80000000
> -#define KS8695_PCIIO_SIZE	SZ_64K
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/irqs.h
> - *
> - * Copyright (C) 2006 Simtec Electronics
> - *   Ben Dooks <ben@simtec.co.uk>
> - */
> -
> -#ifndef __ASM_ARCH_IRQS_H
> -#define __ASM_ARCH_IRQS_H
> -
> -
> -#define NR_IRQS				32
> -
> -/*
> - * IRQ definitions
> - */
> -#define KS8695_IRQ_COMM_RX		0
> -#define KS8695_IRQ_COMM_TX		1
> -#define KS8695_IRQ_EXTERN0		2
> -#define KS8695_IRQ_EXTERN1		3
> -#define KS8695_IRQ_EXTERN2		4
> -#define KS8695_IRQ_EXTERN3		5
> -#define KS8695_IRQ_TIMER0		6
> -#define KS8695_IRQ_TIMER1		7
> -#define KS8695_IRQ_UART_TX		8
> -#define KS8695_IRQ_UART_RX		9
> -#define KS8695_IRQ_UART_LINE_STATUS	10
> -#define KS8695_IRQ_UART_MODEM_STATUS	11
> -#define KS8695_IRQ_LAN_RX_STOP		12
> -#define KS8695_IRQ_LAN_TX_STOP		13
> -#define KS8695_IRQ_LAN_RX_BUF		14
> -#define KS8695_IRQ_LAN_TX_BUF		15
> -#define KS8695_IRQ_LAN_RX_STATUS	16
> -#define KS8695_IRQ_LAN_TX_STATUS	17
> -#define KS8695_IRQ_HPNA_RX_STOP		18
> -#define KS8695_IRQ_HPNA_TX_STOP		19
> -#define KS8695_IRQ_HPNA_RX_BUF		20
> -#define KS8695_IRQ_HPNA_TX_BUF		21
> -#define KS8695_IRQ_HPNA_RX_STATUS	22
> -#define KS8695_IRQ_HPNA_TX_STATUS	23
> -#define KS8695_IRQ_BUS_ERROR		24
> -#define KS8695_IRQ_WAN_RX_STOP		25
> -#define KS8695_IRQ_WAN_TX_STOP		26
> -#define KS8695_IRQ_WAN_RX_BUF		27
> -#define KS8695_IRQ_WAN_TX_BUF		28
> -#define KS8695_IRQ_WAN_RX_STATUS	29
> -#define KS8695_IRQ_WAN_TX_STATUS	30
> -#define KS8695_IRQ_WAN_LINK		31
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/memory.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 Memory definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef __ASM_ARCH_MEMORY_H
> -#define __ASM_ARCH_MEMORY_H
> -
> -#include <mach/hardware.h>
> -
> -#ifndef __ASSEMBLY__
> -
> -#ifdef CONFIG_PCI
> -
> -/* PCI mappings */
> -#define __virt_to_bus(x)	((x) - PAGE_OFFSET + KS8695_PCIMEM_PA)
> -#define __bus_to_virt(x)	((x) - KS8695_PCIMEM_PA + PAGE_OFFSET)
> -
> -/* Platform-bus mapping */
> -extern struct bus_type platform_bus_type;
> -#define is_lbus_device(dev)		(dev && dev->bus == &platform_bus_type)
> -#define __arch_dma_to_virt(dev, x)	({ (void *) (is_lbus_device(dev) ? \
> -					__phys_to_virt(x) : __bus_to_virt(x)); })
> -#define __arch_virt_to_dma(dev, x)	({ is_lbus_device(dev) ? \
> -					(dma_addr_t)__virt_to_phys((unsigned long)x) \
> -					: (dma_addr_t)__virt_to_bus(x); })
> -#define __arch_pfn_to_dma(dev, pfn)	\
> -	({ dma_addr_t __dma = __pfn_to_phys(pfn); \
> -	   if (!is_lbus_device(dev)) \
> -		__dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
> -	   __dma; })
> -
> -#define __arch_dma_to_pfn(dev, x)	\
> -	({ dma_addr_t __dma = x;				\
> -	   if (!is_lbus_device(dev))				\
> -		__dma += PHYS_OFFSET - KS8695_PCIMEM_PA;	\
> -	   __phys_to_pfn(__dma);				\
> -	})
> -
> -#endif
> -
> -#endif
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-gpio.h
> - *
> - * Copyright (C) 2007 Andrew Victor
> - *
> - * KS8695 - GPIO control registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_GPIO_H
> -#define KS8695_GPIO_H
> -
> -#define KS8695_GPIO_OFFSET	(0xF0000 + 0xE600)
> -#define KS8695_GPIO_VA		(KS8695_IO_VA + KS8695_GPIO_OFFSET)
> -#define KS8695_GPIO_PA		(KS8695_IO_PA + KS8695_GPIO_OFFSET)
> -
> -
> -#define KS8695_IOPM		(0x00)		/* I/O Port Mode Register */
> -#define KS8695_IOPC		(0x04)		/* I/O Port Control Register */
> -#define KS8695_IOPD		(0x08)		/* I/O Port Data Register */
> -
> -
> -/* Port Mode Register */
> -#define IOPM(x)			(1 << (x))	/* Mode for GPIO Pin x */
> -
> -/* Port Control Register */
> -#define IOPC_IOTIM1EN		(1 << 17)	/* GPIO Pin for Timer1 Enable */
> -#define IOPC_IOTIM0EN		(1 << 16)	/* GPIO Pin for Timer0 Enable */
> -#define IOPC_IOEINT3EN		(1 << 15)	/* GPIO Pin for External/Soft Interrupt 3 Enable */
> -#define IOPC_IOEINT3TM		(7 << 12)	/* GPIO Pin for External/Soft Interrupt 3 Trigger Mode */
> -#define IOPC_IOEINT3_MODE(x)	((x) << 12)
> -#define IOPC_IOEINT2EN		(1 << 11)	/* GPIO Pin for External/Soft Interrupt 2 Enable */
> -#define IOPC_IOEINT2TM		(7 << 8)	/* GPIO Pin for External/Soft Interrupt 2 Trigger Mode */
> -#define IOPC_IOEINT2_MODE(x)	((x) << 8)
> -#define IOPC_IOEINT1EN		(1 << 7)	/* GPIO Pin for External/Soft Interrupt 1 Enable */
> -#define IOPC_IOEINT1TM		(7 << 4)	/* GPIO Pin for External/Soft Interrupt 1 Trigger Mode */
> -#define IOPC_IOEINT1_MODE(x)	((x) << 4)
> -#define IOPC_IOEINT0EN		(1 << 3)	/* GPIO Pin for External/Soft Interrupt 0 Enable */
> -#define IOPC_IOEINT0TM		(7 << 0)	/* GPIO Pin for External/Soft Interrupt 0 Trigger Mode */
> -#define IOPC_IOEINT0_MODE(x)	((x) << 0)
> -
> - /* Trigger Modes */
> -#define IOPC_TM_LOW		(0)		/* Level Detection (Active Low) */
> -#define IOPC_TM_HIGH		(1)		/* Level Detection (Active High) */
> -#define IOPC_TM_RISING		(2)		/* Rising Edge Detection */
> -#define IOPC_TM_FALLING		(4)		/* Falling Edge Detection */
> -#define IOPC_TM_EDGE		(6)		/* Both Edge Detection */
> -
> -/* Port Data Register */
> -#define IOPD(x)			(1 << (x))	/* Signal Level of GPIO Pin x */
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-irq.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - IRQ registers and bit definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_IRQ_H
> -#define KS8695_IRQ_H
> -
> -#define KS8695_IRQ_OFFSET	(0xF0000 + 0xE200)
> -#define KS8695_IRQ_VA		(KS8695_IO_VA + KS8695_IRQ_OFFSET)
> -#define KS8695_IRQ_PA		(KS8695_IO_PA + KS8695_IRQ_OFFSET)
> -
> -
> -/*
> - * Interrupt Controller registers
> - */
> -#define KS8695_INTMC		(0x00)		/* Mode Control Register */
> -#define KS8695_INTEN		(0x04)		/* Interrupt Enable Register */
> -#define KS8695_INTST		(0x08)		/* Interrupt Status Register */
> -#define KS8695_INTPW		(0x0c)		/* Interrupt Priority (WAN MAC) */
> -#define KS8695_INTPH		(0x10)		/* Interrupt Priority (HPNA) [KS8695 only] */
> -#define KS8695_INTPL		(0x14)		/* Interrupt Priority (LAN MAC) */
> -#define KS8695_INTPT		(0x18)		/* Interrupt Priority (Timer) */
> -#define KS8695_INTPU		(0x1c)		/* Interrupt Priority (UART) */
> -#define KS8695_INTPE		(0x20)		/* Interrupt Priority (External Interrupt) */
> -#define KS8695_INTPC		(0x24)		/* Interrupt Priority (Communications Channel) */
> -#define KS8695_INTPBE		(0x28)		/* Interrupt Priority (Bus Error Response) */
> -#define KS8695_INTMS		(0x2c)		/* Interrupt Mask Status Register */
> -#define KS8695_INTHPF		(0x30)		/* Interrupt Pending Highest Priority (FIQ) */
> -#define KS8695_INTHPI		(0x34)		/* Interrupt Pending Highest Priority (IRQ) */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-misc.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - Miscellaneous Registers
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_MISC_H
> -#define KS8695_MISC_H
> -
> -#define KS8695_MISC_OFFSET	(0xF0000 + 0xEA00)
> -#define KS8695_MISC_VA		(KS8695_IO_VA + KS8695_MISC_OFFSET)
> -#define KS8695_MISC_PA		(KS8695_IO_PA + KS8695_MISC_OFFSET)
> -
> -
> -/*
> - * Miscellaneous registers
> - */
> -#define KS8695_DID		(0x00)		/* Device ID */
> -#define KS8695_RID		(0x04)		/* Revision ID */
> -#define KS8695_HMC		(0x08)		/* HPNA Miscellaneous Control [KS8695 only] */
> -#define KS8695_WMC		(0x0c)		/* WAN Miscellaneous Control */
> -#define KS8695_WPPM		(0x10)		/* WAN PHY Power Management */
> -#define KS8695_PPS		(0x1c)		/* PHY PowerSave */
> -
> -/* Device ID Register */
> -#define DID_ID			(0xffff << 0)	/* Device ID */
> -
> -/* Revision ID Register */
> -#define RID_SUBID		(0xf << 4)	/* Sub-Device ID */
> -#define RID_REVISION		(0xf << 0)	/* Revision ID */
> -
> -/* HPNA Miscellaneous Control Register */
> -#define HMC_HSS			(1 << 1)	/* Speed */
> -#define HMC_HDS			(1 << 0)	/* Duplex */
> -
> -/* WAN Miscellaneous Control Register */
> -#define WMC_WANC		(1 << 30)	/* Auto-negotiation complete */
> -#define WMC_WANR		(1 << 29)	/* Auto-negotiation restart */
> -#define WMC_WANAP		(1 << 28)	/* Advertise Pause */
> -#define WMC_WANA100F		(1 << 27)	/* Advertise 100 FDX */
> -#define WMC_WANA100H		(1 << 26)	/* Advertise 100 HDX */
> -#define WMC_WANA10F		(1 << 25)	/* Advertise 10 FDX */
> -#define WMC_WANA10H		(1 << 24)	/* Advertise 10 HDX */
> -#define WMC_WLS			(1 << 23)	/* Link status */
> -#define WMC_WDS			(1 << 22)	/* Duplex status */
> -#define WMC_WSS			(1 << 21)	/* Speed status */
> -#define WMC_WLPP		(1 << 20)	/* Link Partner Pause */
> -#define WMC_WLP100F		(1 << 19)	/* Link Partner 100 FDX */
> -#define WMC_WLP100H		(1 << 18)	/* Link Partner 100 HDX */
> -#define WMC_WLP10F		(1 << 17)	/* Link Partner 10 FDX */
> -#define WMC_WLP10H		(1 << 16)	/* Link Partner 10 HDX */
> -#define WMC_WAND		(1 << 15)	/* Auto-negotiation disable */
> -#define WMC_WANF100		(1 << 14)	/* Force 100 */
> -#define WMC_WANFF		(1 << 13)	/* Force FDX */
> -#define WMC_WLED1S		(7 <<  4)	/* LED1 Select */
> -#define		WLED1S_SPEED		(0 << 4)
> -#define		WLED1S_LINK		(1 << 4)
> -#define		WLED1S_DUPLEX		(2 << 4)
> -#define		WLED1S_COLLISION	(3 << 4)
> -#define		WLED1S_ACTIVITY		(4 << 4)
> -#define		WLED1S_FDX_COLLISION	(5 << 4)
> -#define		WLED1S_LINK_ACTIVITY	(6 << 4)
> -#define WMC_WLED0S		(7 << 0)	/* LED0 Select */
> -#define		WLED0S_SPEED		(0 << 0)
> -#define		WLED0S_LINK		(1 << 0)
> -#define		WLED0S_DUPLEX		(2 << 0)
> -#define		WLED0S_COLLISION	(3 << 0)
> -#define		WLED0S_ACTIVITY		(4 << 0)
> -#define		WLED0S_FDX_COLLISION	(5 << 0)
> -#define		WLED0S_LINK_ACTIVITY	(6 << 0)
> -
> -/* WAN PHY Power Management Register */
> -#define WPPM_WLPBK		(1 << 14)	/* Local Loopback */
> -#define WPPM_WRLPKB		(1 << 13)	/* Remove Loopback */
> -#define WPPM_WPI		(1 << 12)	/* PHY isolate */
> -#define WPPM_WFL		(1 << 10)	/* Force link */
> -#define WPPM_MDIXS		(1 << 9)	/* MDIX Status */
> -#define WPPM_FEF		(1 << 8)	/* Far End Fault */
> -#define WPPM_AMDIXP		(1 << 7)	/* Auto MDIX Parameter */
> -#define WPPM_TXDIS		(1 << 6)	/* Disable transmitter */
> -#define WPPM_DFEF		(1 << 5)	/* Disable Far End Fault */
> -#define WPPM_PD			(1 << 4)	/* Power Down */
> -#define WPPM_DMDX		(1 << 3)	/* Disable Auto MDI/MDIX */
> -#define WPPM_FMDX		(1 << 2)	/* Force MDIX */
> -#define WPPM_LPBK		(1 << 1)	/* MAX Loopback */
> -
> -/* PHY Power Save Register */
> -#define PPS_PPSM		(1 << 0)	/* PHY Power Save Mode */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-switch.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - Switch Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_SWITCH_H
> -#define KS8695_SWITCH_H
> -
> -#define KS8695_SWITCH_OFFSET	(0xF0000 + 0xe800)
> -#define KS8695_SWITCH_VA	(KS8695_IO_VA + KS8695_SWITCH_OFFSET)
> -#define KS8695_SWITCH_PA	(KS8695_IO_PA + KS8695_SWITCH_OFFSET)
> -
> -
> -/*
> - * Switch registers
> - */
> -#define KS8695_SEC0		(0x00)		/* Switch Engine Control 0 */
> -#define KS8695_SEC1		(0x04)		/* Switch Engine Control 1 */
> -#define KS8695_SEC2		(0x08)		/* Switch Engine Control 2 */
> -
> -#define KS8695_SEPXCZ(x,z)	(0x0c + (((x)-1)*3 + ((z)-1))*4)	/* Port Configuration Registers */
> -
> -#define KS8695_SEP12AN		(0x48)		/* Port 1 & 2 Auto-Negotiation */
> -#define KS8695_SEP34AN		(0x4c)		/* Port 3 & 4 Auto-Negotiation */
> -#define KS8695_SEIAC		(0x50)		/* Indirect Access Control */
> -#define KS8695_SEIADH2		(0x54)		/* Indirect Access Data High 2 */
> -#define KS8695_SEIADH1		(0x58)		/* Indirect Access Data High 1 */
> -#define KS8695_SEIADL		(0x5c)		/* Indirect Access Data Low */
> -#define KS8695_SEAFC		(0x60)		/* Advance Feature Control */
> -#define KS8695_SEDSCPH		(0x64)		/* TOS Priority High */
> -#define KS8695_SEDSCPL		(0x68)		/* TOS Priority Low */
> -#define KS8695_SEMAH		(0x6c)		/* Switch Engine MAC Address High */
> -#define KS8695_SEMAL		(0x70)		/* Switch Engine MAC Address Low */
> -#define KS8695_LPPM12		(0x74)		/* Port 1 & 2 PHY Power Management */
> -#define KS8695_LPPM34		(0x78)		/* Port 3 & 4 PHY Power Management */
> -
> -
> -/* Switch Engine Control 0 */
> -#define SEC0_LLED1S		(7 << 25)	/* LED1 Select */
> -#define		LLED1S_SPEED		(0 << 25)
> -#define		LLED1S_LINK		(1 << 25)
> -#define		LLED1S_DUPLEX		(2 << 25)
> -#define		LLED1S_COLLISION	(3 << 25)
> -#define		LLED1S_ACTIVITY		(4 << 25)
> -#define		LLED1S_FDX_COLLISION	(5 << 25)
> -#define		LLED1S_LINK_ACTIVITY	(6 << 25)
> -#define SEC0_LLED0S		(7 << 22)	/* LED0 Select */
> -#define		LLED0S_SPEED		(0 << 22)
> -#define		LLED0S_LINK		(1 << 22)
> -#define		LLED0S_DUPLEX		(2 << 22)
> -#define		LLED0S_COLLISION	(3 << 22)
> -#define		LLED0S_ACTIVITY		(4 << 22)
> -#define		LLED0S_FDX_COLLISION	(5 << 22)
> -#define		LLED0S_LINK_ACTIVITY	(6 << 22)
> -#define SEC0_ENABLE		(1 << 0)	/* Enable Switch */
> -
> -
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-uart.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - UART register and bit definitions.
> - */
> -
> -#ifndef KS8695_UART_H
> -#define KS8695_UART_H
> -
> -#define KS8695_UART_OFFSET	(0xF0000 + 0xE000)
> -#define KS8695_UART_VA		(KS8695_IO_VA + KS8695_UART_OFFSET)
> -#define KS8695_UART_PA		(KS8695_IO_PA + KS8695_UART_OFFSET)
> -
> -
> -/*
> - * UART registers
> - */
> -#define KS8695_URRB	(0x00)		/* Receive Buffer Register */
> -#define KS8695_URTH	(0x04)		/* Transmit Holding Register */
> -#define KS8695_URFC	(0x08)		/* FIFO Control Register */
> -#define KS8695_URLC	(0x0C)		/* Line Control Register */
> -#define KS8695_URMC	(0x10)		/* Modem Control Register */
> -#define KS8695_URLS	(0x14)		/* Line Status Register */
> -#define KS8695_URMS	(0x18)		/* Modem Status Register */
> -#define KS8695_URBD	(0x1C)		/* Baud Rate Divisor Register */
> -#define KS8695_USR	(0x20)		/* Status Register */
> -
> -
> -/* FIFO Control Register */
> -#define URFC_URFRT	(3 << 6)	/* Receive FIFO Trigger Level */
> -#define		URFC_URFRT_1	(0 << 6)
> -#define		URFC_URFRT_4	(1 << 6)
> -#define		URFC_URFRT_8	(2 << 6)
> -#define		URFC_URFRT_14	(3 << 6)
> -#define URFC_URTFR	(1 << 2)	/* Transmit FIFO Reset */
> -#define URFC_URRFR	(1 << 1)	/* Receive FIFO Reset */
> -#define URFC_URFE	(1 << 0)	/* FIFO Enable */
> -
> -/* Line Control Register */
> -#define URLC_URSBC	(1 << 6)	/* Set Break Condition */
> -#define URLC_PARITY	(7 << 3)	/* Parity */
> -#define		URPE_NONE	(0 << 3)
> -#define		URPE_ODD	(1 << 3)
> -#define		URPE_EVEN	(3 << 3)
> -#define		URPE_MARK	(5 << 3)
> -#define		URPE_SPACE	(7 << 3)
> -#define URLC_URSB	(1 << 2)	/* Stop Bits */
> -#define URLC_URCL	(3 << 0)	/* Character Length */
> -#define		URCL_5		(0 << 0)
> -#define		URCL_6		(1 << 0)
> -#define		URCL_7		(2 << 0)
> -#define		URCL_8		(3 << 0)
> -
> -/* Modem Control Register */
> -#define URMC_URLB	(1 << 4)	/* Loop-back mode */
> -#define URMC_UROUT2	(1 << 3)	/* OUT2 signal */
> -#define URMC_UROUT1	(1 << 2)	/* OUT1 signal */
> -#define URMC_URRTS	(1 << 1)	/* Request to Send */
> -#define URMC_URDTR	(1 << 0)	/* Data Terminal Ready */
> -
> -/* Line Status Register */
> -#define URLS_URRFE	(1 << 7)	/* Receive FIFO Error */
> -#define URLS_URTE	(1 << 6)	/* Transmit Empty */
> -#define URLS_URTHRE	(1 << 5)	/* Transmit Holding Register Empty */
> -#define URLS_URBI	(1 << 4)	/* Break Interrupt */
> -#define URLS_URFE	(1 << 3)	/* Framing Error */
> -#define URLS_URPE	(1 << 2)	/* Parity Error */
> -#define URLS_URROE	(1 << 1)	/* Receive Overrun Error */
> -#define URLS_URDR	(1 << 0)	/* Receive Data Ready */
> -
> -/* Modem Status Register */
> -#define URMS_URDCD	(1 << 7)	/* Data Carrier Detect */
> -#define URMS_URRI	(1 << 6)	/* Ring Indicator */
> -#define URMS_URDSR	(1 << 5)	/* Data Set Ready */
> -#define URMS_URCTS	(1 << 4)	/* Clear to Send */
> -#define URMS_URDDCD	(1 << 3)	/* Delta Data Carrier Detect */
> -#define URMS_URTERI	(1 << 2)	/* Trailing Edge Ring Indicator */
> -#define URMS_URDDST	(1 << 1)	/* Delta Data Set Ready */
> -#define URMS_URDCTS	(1 << 0)	/* Delta Clear to Send */
> -
> -/* Status Register */
> -#define USR_UTI		(1 << 0)	/* Timeout Indication */
> -
> -
> -#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 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/*
> - * arch/arm/mach-ks8695/include/mach/uncompress.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - Kernel uncompressor
> - */
> -
> -#ifndef __ASM_ARCH_UNCOMPRESS_H
> -#define __ASM_ARCH_UNCOMPRESS_H
> -
> -#include <linux/io.h>
> -#include <mach/regs-uart.h>
> -
> -static inline void putc(char c)
> -{
> -	while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE))
> -		barrier();
> -
> -	__raw_writel(c, (void __iomem*)KS8695_UART_PA + KS8695_URTH);
> -}
> -
> -static inline void flush(void)
> -{
> -	while (!(__raw_readl((void __iomem*)KS8695_UART_PA + KS8695_URLS) & URLS_URTE))
> -		barrier();
> -}
> -
> -#define arch_decomp_setup()
> -
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/irq.c
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - */
> -
> -#include <linux/init.h>
> -#include <linux/module.h>
> -#include <linux/interrupt.h>
> -#include <linux/ioport.h>
> -#include <linux/device.h>
> -#include <linux/io.h>
> -
> -#include <mach/hardware.h>
> -#include <asm/irq.h>
> -
> -#include <asm/mach/irq.h>
> -
> -#include <mach/regs-irq.h>
> -#include <mach/regs-gpio.h>
> -
> -static void ks8695_irq_mask(struct irq_data *d)
> -{
> -	unsigned long inten;
> -
> -	inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
> -	inten &= ~(1 << d->irq);
> -
> -	__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
> -}
> -
> -static void ks8695_irq_unmask(struct irq_data *d)
> -{
> -	unsigned long inten;
> -
> -	inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
> -	inten |= (1 << d->irq);
> -
> -	__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
> -}
> -
> -static void ks8695_irq_ack(struct irq_data *d)
> -{
> -	__raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST);
> -}
> -
> -
> -static struct irq_chip ks8695_irq_level_chip;
> -static struct irq_chip ks8695_irq_edge_chip;
> -
> -
> -static int ks8695_irq_set_type(struct irq_data *d, unsigned int type)
> -{
> -	unsigned long ctrl, mode;
> -	unsigned short level_triggered = 0;
> -
> -	ctrl = __raw_readl(KS8695_GPIO_VA + KS8695_IOPC);
> -
> -	switch (type) {
> -		case IRQ_TYPE_LEVEL_HIGH:
> -			mode = IOPC_TM_HIGH;
> -			level_triggered = 1;
> -			break;
> -		case IRQ_TYPE_LEVEL_LOW:
> -			mode = IOPC_TM_LOW;
> -			level_triggered = 1;
> -			break;
> -		case IRQ_TYPE_EDGE_RISING:
> -			mode = IOPC_TM_RISING;
> -			break;
> -		case IRQ_TYPE_EDGE_FALLING:
> -			mode = IOPC_TM_FALLING;
> -			break;
> -		case IRQ_TYPE_EDGE_BOTH:
> -			mode = IOPC_TM_EDGE;
> -			break;
> -		default:
> -			return -EINVAL;
> -	}
> -
> -	switch (d->irq) {
> -		case KS8695_IRQ_EXTERN0:
> -			ctrl &= ~IOPC_IOEINT0TM;
> -			ctrl |= IOPC_IOEINT0_MODE(mode);
> -			break;
> -		case KS8695_IRQ_EXTERN1:
> -			ctrl &= ~IOPC_IOEINT1TM;
> -			ctrl |= IOPC_IOEINT1_MODE(mode);
> -			break;
> -		case KS8695_IRQ_EXTERN2:
> -			ctrl &= ~IOPC_IOEINT2TM;
> -			ctrl |= IOPC_IOEINT2_MODE(mode);
> -			break;
> -		case KS8695_IRQ_EXTERN3:
> -			ctrl &= ~IOPC_IOEINT3TM;
> -			ctrl |= IOPC_IOEINT3_MODE(mode);
> -			break;
> -		default:
> -			return -EINVAL;
> -	}
> -
> -	if (level_triggered) {
> -		irq_set_chip_and_handler(d->irq, &ks8695_irq_level_chip,
> -					 handle_level_irq);
> -	}
> -	else {
> -		irq_set_chip_and_handler(d->irq, &ks8695_irq_edge_chip,
> -					 handle_edge_irq);
> -	}
> -
> -	__raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC);
> -	return 0;
> -}
> -
> -static struct irq_chip ks8695_irq_level_chip = {
> -	.irq_ack	= ks8695_irq_mask,
> -	.irq_mask	= ks8695_irq_mask,
> -	.irq_unmask	= ks8695_irq_unmask,
> -	.irq_set_type	= ks8695_irq_set_type,
> -};
> -
> -static struct irq_chip ks8695_irq_edge_chip = {
> -	.irq_ack	= ks8695_irq_ack,
> -	.irq_mask	= ks8695_irq_mask,
> -	.irq_unmask	= ks8695_irq_unmask,
> -	.irq_set_type	= ks8695_irq_set_type,
> -};
> -
> -void __init ks8695_init_irq(void)
> -{
> -	unsigned int irq;
> -
> -	/* Disable all interrupts initially */
> -	__raw_writel(0, KS8695_IRQ_VA + KS8695_INTMC);
> -	__raw_writel(0, KS8695_IRQ_VA + KS8695_INTEN);
> -
> -	for (irq = 0; irq < NR_IRQS; irq++) {
> -		switch (irq) {
> -			/* Level-triggered interrupts */
> -			case KS8695_IRQ_BUS_ERROR:
> -			case KS8695_IRQ_UART_MODEM_STATUS:
> -			case KS8695_IRQ_UART_LINE_STATUS:
> -			case KS8695_IRQ_UART_RX:
> -			case KS8695_IRQ_COMM_TX:
> -			case KS8695_IRQ_COMM_RX:
> -				irq_set_chip_and_handler(irq,
> -							 &ks8695_irq_level_chip,
> -							 handle_level_irq);
> -				break;
> -
> -			/* Edge-triggered interrupts */
> -			default:
> -				/* clear pending bit */
> -				ks8695_irq_ack(irq_get_irq_data(irq));
> -				irq_set_chip_and_handler(irq,
> -							 &ks8695_irq_edge_chip,
> -							 handle_edge_irq);
> -		}
> -
> -		irq_clear_status_flags(irq, IRQ_NOREQUEST);
> -	}
> -}
> 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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/pci.c
> - *
> - *  Copyright (C) 2003, Micrel Semiconductors
> - *  Copyright (C) 2006, Greg Ungerer <gerg@snapgear.com>
> - *  Copyright (C) 2006, Ben Dooks
> - *  Copyright (C) 2007, Andrew Victor
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/pci.h>
> -#include <linux/mm.h>
> -#include <linux/init.h>
> -#include <linux/irq.h>
> -#include <linux/delay.h>
> -#include <linux/io.h>
> -
> -#include <asm/signal.h>
> -#include <asm/mach/pci.h>
> -#include <mach/hardware.h>
> -
> -#include "devices.h"
> -#include "regs-pci.h"
> -
> -
> -static int pci_dbg;
> -
> -static void ks8695_pci_setupconfig(unsigned int bus_nr, unsigned int devfn, unsigned int where)
> -{
> -	unsigned long pbca;
> -
> -	pbca = PBCA_ENABLE | (where & ~3);
> -	pbca |= PCI_SLOT(devfn) << 11 ;
> -	pbca |= PCI_FUNC(devfn) << 8;
> -	pbca |= bus_nr << 16;
> -
> -	if (bus_nr == 0) {
> -		/* use Type-0 transaction */
> -		__raw_writel(pbca, KS8695_PCI_VA + KS8695_PBCA);
> -	} else {
> -		/* use Type-1 transaction */
> -		__raw_writel(pbca | PBCA_TYPE1, KS8695_PCI_VA + KS8695_PBCA);
> -	}
> -}
> -
> -static void __iomem *ks8695_pci_map_bus(struct pci_bus *bus, unsigned int devfn,
> -					int where)
> -{
> -	ks8695_pci_setupconfig(bus->number, devfn, where);
> -	return KS8695_PCI_VA +  KS8695_PBCD;
> -}
> -
> -static void ks8695_local_writeconfig(int where, u32 value)
> -{
> -	ks8695_pci_setupconfig(0, 0, where);
> -	__raw_writel(value, KS8695_PCI_VA + KS8695_PBCD);
> -}
> -
> -static struct pci_ops ks8695_pci_ops = {
> -	.map_bus = ks8695_pci_map_bus,
> -	.read	= pci_generic_config_read32,
> -	.write	= pci_generic_config_write32,
> -};
> -
> -static struct resource pci_mem = {
> -	.name	= "PCI Memory space",
> -	.start	= KS8695_PCIMEM_PA,
> -	.end	= KS8695_PCIMEM_PA + (KS8695_PCIMEM_SIZE - 1),
> -	.flags	= IORESOURCE_MEM,
> -};
> -
> -static struct resource pci_io = {
> -	.name	= "PCI IO space",
> -	.start	= KS8695_PCIIO_PA,
> -	.end	= KS8695_PCIIO_PA + (KS8695_PCIIO_SIZE - 1),
> -	.flags	= IORESOURCE_IO,
> -};
> -
> -static int __init ks8695_pci_setup(int nr, struct pci_sys_data *sys)
> -{
> -	if (nr > 0)
> -		return 0;
> -
> -	request_resource(&iomem_resource, &pci_mem);
> -	request_resource(&ioport_resource, &pci_io);
> -
> -	pci_add_resource_offset(&sys->resources, &pci_io, sys->io_offset);
> -	pci_add_resource_offset(&sys->resources, &pci_mem, sys->mem_offset);
> -
> -	/* Assign and enable processor bridge */
> -	ks8695_local_writeconfig(PCI_BASE_ADDRESS_0, KS8695_PCIMEM_PA);
> -
> -	/* Enable bus-master & Memory Space access */
> -	ks8695_local_writeconfig(PCI_COMMAND, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
> -
> -	/* Set cache-line size & latency. */
> -	ks8695_local_writeconfig(PCI_CACHE_LINE_SIZE, (32 << 8) | (L1_CACHE_BYTES / sizeof(u32)));
> -
> -	/* Reserve PCI memory space for PCI-AHB resources */
> -	if (!request_mem_region(KS8695_PCIMEM_PA, SZ_64M, "PCI-AHB Bridge")) {
> -		printk(KERN_ERR "Cannot allocate PCI-AHB Bridge memory.\n");
> -		return -EBUSY;
> -	}
> -
> -	return 1;
> -}
> -
> -static inline unsigned int size_mask(unsigned long size)
> -{
> -	return (~size) + 1;
> -}
> -
> -static int ks8695_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
> -{
> -	unsigned long pc = instruction_pointer(regs);
> -	unsigned long instr = *(unsigned long *)pc;
> -	unsigned long cmdstat;
> -
> -	cmdstat = __raw_readl(KS8695_PCI_VA + KS8695_CRCFCS);
> -
> -	printk(KERN_ERR "PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx [%s%s%s%s%s]\n",
> -		addr, fsr, regs->ARM_pc, regs->ARM_lr,
> -		cmdstat & (PCI_STATUS_SIG_TARGET_ABORT << 16) ? "GenTarget" : " ",
> -		cmdstat & (PCI_STATUS_REC_TARGET_ABORT << 16) ? "RecvTarget" : " ",
> -		cmdstat & (PCI_STATUS_REC_MASTER_ABORT << 16) ? "MasterAbort" : " ",
> -		cmdstat & (PCI_STATUS_SIG_SYSTEM_ERROR << 16) ? "SysError" : " ",
> -		cmdstat & (PCI_STATUS_DETECTED_PARITY << 16)  ? "Parity" : " "
> -	);
> -
> -	__raw_writel(cmdstat, KS8695_PCI_VA + KS8695_CRCFCS);
> -
> -	/*
> -	 * If the instruction being executed was a read,
> -	 * make it look like it read all-ones.
> -	 */
> -	if ((instr & 0x0c100000) == 0x04100000) {
> -		int reg = (instr >> 12) & 15;
> -		unsigned long val;
> -
> -		if (instr & 0x00400000)
> -			val = 255;
> -		else
> -			val = -1;
> -
> -		regs->uregs[reg] = val;
> -		regs->ARM_pc += 4;
> -		return 0;
> -	}
> -
> -	if ((instr & 0x0e100090) == 0x00100090) {
> -		int reg = (instr >> 12) & 15;
> -
> -		regs->uregs[reg] = -1;
> -		regs->ARM_pc += 4;
> -		return 0;
> -	}
> -
> -	return 1;
> -}
> -
> -static void __init ks8695_pci_preinit(void)
> -{
> -	/* make software reset to avoid freeze if PCI bus was messed up */
> -	__raw_writel(0x80000000, KS8695_PCI_VA + KS8695_PBCS);
> -
> -	/* stage 1 initialization, subid, subdevice = 0x0001 */
> -	__raw_writel(0x00010001, KS8695_PCI_VA + KS8695_CRCSID);
> -
> -	/* stage 2 initialization */
> -	/* prefetch limits with 16 words, retry enable */
> -	__raw_writel(0x40000000, KS8695_PCI_VA + KS8695_PBCS);
> -
> -	/* configure memory mapping */
> -	__raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBA);
> -	__raw_writel(size_mask(KS8695_PCIMEM_SIZE), KS8695_PCI_VA + KS8695_PMBAM);
> -	__raw_writel(KS8695_PCIMEM_PA, KS8695_PCI_VA + KS8695_PMBAT);
> -	__raw_writel(0, KS8695_PCI_VA + KS8695_PMBAC);
> -
> -	/* configure IO mapping */
> -	__raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBA);
> -	__raw_writel(size_mask(KS8695_PCIIO_SIZE), KS8695_PCI_VA + KS8695_PIOBAM);
> -	__raw_writel(KS8695_PCIIO_PA, KS8695_PCI_VA + KS8695_PIOBAT);
> -	__raw_writel(0, KS8695_PCI_VA + KS8695_PIOBAC);
> -
> -	/* hook in fault handlers */
> -	hook_fault_code(8, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
> -	hook_fault_code(10, ks8695_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
> -}
> -
> -static void ks8695_show_pciregs(void)
> -{
> -	if (!pci_dbg)
> -		return;
> -
> -	printk(KERN_INFO "PCI: CRCFID = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFID));
> -	printk(KERN_INFO "PCI: CRCFCS = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFCS));
> -	printk(KERN_INFO "PCI: CRCFRV = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFRV));
> -	printk(KERN_INFO "PCI: CRCFLT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFLT));
> -	printk(KERN_INFO "PCI: CRCBMA = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCBMA));
> -	printk(KERN_INFO "PCI: CRCSID = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCSID));
> -	printk(KERN_INFO "PCI: CRCFIT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_CRCFIT));
> -
> -	printk(KERN_INFO "PCI: PBM    = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PBM));
> -	printk(KERN_INFO "PCI: PBCS   = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PBCS));
> -
> -	printk(KERN_INFO "PCI: PMBA   = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBA));
> -	printk(KERN_INFO "PCI: PMBAC  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAC));
> -	printk(KERN_INFO "PCI: PMBAM  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAM));
> -	printk(KERN_INFO "PCI: PMBAT  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PMBAT));
> -
> -	printk(KERN_INFO "PCI: PIOBA  = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBA));
> -	printk(KERN_INFO "PCI: PIOBAC = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAC));
> -	printk(KERN_INFO "PCI: PIOBAM = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAM));
> -	printk(KERN_INFO "PCI: PIOBAT = %08x\n", __raw_readl(KS8695_PCI_VA + KS8695_PIOBAT));
> -}
> -
> -
> -static struct hw_pci ks8695_pci __initdata = {
> -	.nr_controllers	= 1,
> -	.ops		= &ks8695_pci_ops,
> -	.preinit	= ks8695_pci_preinit,
> -	.setup		= ks8695_pci_setup,
> -	.postinit	= NULL,
> -	.map_irq	= NULL,
> -};
> -
> -void __init ks8695_init_pci(struct ks8695_pci_cfg *cfg)
> -{
> -	if (__raw_readl(KS8695_PCI_VA + KS8695_CRCFRV) & CFRV_GUEST) {
> -		printk("PCI: KS8695 in guest mode, not initialising\n");
> -		return;
> -	}
> -
> -	pcibios_min_io = 0;
> -	pcibios_min_mem = 0;
> -
> -	printk(KERN_INFO "PCI: Initialising\n");
> -	ks8695_show_pciregs();
> -
> -	/* set Mode */
> -	__raw_writel(cfg->mode << 29, KS8695_PCI_VA + KS8695_PBM);
> -
> -	ks8695_pci.map_irq = cfg->map_irq;	/* board-specific map_irq method */
> -
> -	pci_common_init(&ks8695_pci);
> -}
> 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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-wan.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - HPNA Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_HPNA_H
> -#define KS8695_HPNA_H
> -
> -#define KS8695_HPNA_OFFSET	(0xF0000 + 0xA000)
> -#define KS8695_HPNA_VA		(KS8695_IO_VA + KS8695_HPNA_OFFSET)
> -#define KS8695_HPNA_PA		(KS8695_IO_PA + KS8695_HPNA_OFFSET)
> -
> -
> -/*
> - * HPNA registers
> - */
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-lan.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - LAN Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_LAN_H
> -#define KS8695_LAN_H
> -
> -#define KS8695_LAN_OFFSET	(0xF0000 + 0x8000)
> -#define KS8695_LAN_VA		(KS8695_IO_VA + KS8695_LAN_OFFSET)
> -#define KS8695_LAN_PA		(KS8695_IO_PA + KS8695_LAN_OFFSET)
> -
> -
> -/*
> - * LAN registers
> - */
> -#define KS8695_LMDTXC		(0x00)		/* DMA Transmit Control */
> -#define KS8695_LMDRXC		(0x04)		/* DMA Receive Control */
> -#define KS8695_LMDTSC		(0x08)		/* DMA Transmit Start Command */
> -#define KS8695_LMDRSC		(0x0c)		/* DMA Receive Start Command */
> -#define KS8695_LTDLB		(0x10)		/* Transmit Descriptor List Base Address */
> -#define KS8695_LRDLB		(0x14)		/* Receive Descriptor List Base Address */
> -#define KS8695_LMAL		(0x18)		/* MAC Station Address Low */
> -#define KS8695_LMAH		(0x1c)		/* MAC Station Address High */
> -#define KS8695_LMAAL(n)		(0x80 + ((n)*8))	/* MAC Additional Station Address (0..15) Low */
> -#define KS8695_LMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station Address (0..15) High */
> -
> -
> -/* DMA Transmit Control Register */
> -#define LMDTXC_LMTRST		(1    << 31)	/* Soft Reset */
> -#define LMDTXC_LMTBS		(0x3f << 24)	/* Transmit Burst Size */
> -#define LMDTXC_LMTUCG		(1    << 18)	/* Transmit UDP Checksum Generate */
> -#define LMDTXC_LMTTCG		(1    << 17)	/* Transmit TCP Checksum Generate */
> -#define LMDTXC_LMTICG		(1    << 16)	/* Transmit IP Checksum Generate */
> -#define LMDTXC_LMTFCE		(1    <<  9)	/* Transmit Flow Control Enable */
> -#define LMDTXC_LMTLB		(1    <<  8)	/* Loopback mode */
> -#define LMDTXC_LMTEP		(1    <<  2)	/* Transmit Enable Padding */
> -#define LMDTXC_LMTAC		(1    <<  1)	/* Transmit Add CRC */
> -#define LMDTXC_LMTE		(1    <<  0)	/* TX Enable */
> -
> -/* DMA Receive Control Register */
> -#define LMDRXC_LMRBS		(0x3f << 24)	/* Receive Burst Size */
> -#define LMDRXC_LMRUCC		(1    << 18)	/* Receive UDP Checksum check */
> -#define LMDRXC_LMRTCG		(1    << 17)	/* Receive TCP Checksum check */
> -#define LMDRXC_LMRICG		(1    << 16)	/* Receive IP Checksum check */
> -#define LMDRXC_LMRFCE		(1    <<  9)	/* Receive Flow Control Enable */
> -#define LMDRXC_LMRB		(1    <<  6)	/* Receive Broadcast */
> -#define LMDRXC_LMRM		(1    <<  5)	/* Receive Multicast */
> -#define LMDRXC_LMRU		(1    <<  4)	/* Receive Unicast */
> -#define LMDRXC_LMRERR		(1    <<  3)	/* Receive Error Frame */
> -#define LMDRXC_LMRA		(1    <<  2)	/* Receive All */
> -#define LMDRXC_LMRE		(1    <<  1)	/* RX Enable */
> -
> -/* Additional Station Address High */
> -#define LMAAH_E			(1    << 31)	/* Address Enabled */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-mem.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - Memory Controller registers and bit definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_MEM_H
> -#define KS8695_MEM_H
> -
> -#define KS8695_MEM_OFFSET	(0xF0000 + 0x4000)
> -#define KS8695_MEM_VA		(KS8695_IO_VA + KS8695_MEM_OFFSET)
> -#define KS8695_MEM_PA		(KS8695_IO_PA + KS8695_MEM_OFFSET)
> -
> -
> -/*
> - * Memory Controller Registers
> - */
> -#define KS8695_EXTACON0		(0x00)		/* External I/O 0 Access Control */
> -#define KS8695_EXTACON1		(0x04)		/* External I/O 1 Access Control */
> -#define KS8695_EXTACON2		(0x08)		/* External I/O 2 Access Control */
> -#define KS8695_ROMCON0		(0x10)		/* ROM/SRAM/Flash 1 Control Register */
> -#define KS8695_ROMCON1		(0x14)		/* ROM/SRAM/Flash 2 Control Register */
> -#define KS8695_ERGCON		(0x20)		/* External I/O and ROM/SRAM/Flash General Register */
> -#define KS8695_SDCON0		(0x30)		/* SDRAM Control Register 0 */
> -#define KS8695_SDCON1		(0x34)		/* SDRAM Control Register 1 */
> -#define KS8695_SDGCON		(0x38)		/* SDRAM General Control */
> -#define KS8695_SDBCON		(0x3c)		/* SDRAM Buffer Control */
> -#define KS8695_REFTIM		(0x40)		/* SDRAM Refresh Timer */
> -
> -
> -/* External I/O Access Control Registers */
> -#define EXTACON_EBNPTR		(0x3ff << 22)		/* Last Address Pointer */
> -#define EXTACON_EBBPTR		(0x3ff << 12)		/* Base Pointer */
> -#define EXTACON_EBTACT		(7     <<  9)		/* Write Enable/Output Enable Active Time */
> -#define EXTACON_EBTCOH		(7     <<  6)		/* Chip Select Hold Time */
> -#define EXTACON_EBTACS		(7     <<  3)		/* Address Setup Time before ECSN */
> -#define EXTACON_EBTCOS		(7     <<  0)		/* Chip Select Time before OEN */
> -
> -/* ROM/SRAM/Flash Control Register */
> -#define ROMCON_RBNPTR		(0x3ff << 22)		/* Next Pointer */
> -#define ROMCON_RBBPTR		(0x3ff << 12)		/* Base Pointer */
> -#define ROMCON_RBTACC		(7     <<  4)		/* Access Cycle Time */
> -#define ROMCON_RBTPA		(3     <<  2)		/* Page Address Access Time */
> -#define ROMCON_PMC		(3     <<  0)		/* Page Mode Configuration */
> -#define		PMC_NORMAL		(0 << 0)
> -#define		PMC_4WORD		(1 << 0)
> -#define		PMC_8WORD		(2 << 0)
> -#define		PMC_16WORD		(3 << 0)
> -
> -/* External I/O and ROM/SRAM/Flash General Register */
> -#define ERGCON_TMULT		(3 << 28)		/* Time Multiplier */
> -#define ERGCON_DSX2		(3 << 20)		/* Data Width (External I/O Bank 2) */
> -#define ERGCON_DSX1		(3 << 18)		/* Data Width (External I/O Bank 1) */
> -#define ERGCON_DSX0		(3 << 16)		/* Data Width (External I/O Bank 0) */
> -#define ERGCON_DSR1		(3 <<  2)		/* Data Width (ROM/SRAM/Flash Bank 1) */
> -#define ERGCON_DSR0		(3 <<  0)		/* Data Width (ROM/SRAM/Flash Bank 0) */
> -
> -/* SDRAM Control Register */
> -#define SDCON_DBNPTR		(0x3ff << 22)		/* Last Address Pointer */
> -#define SDCON_DBBPTR		(0x3ff << 12)		/* Base Pointer */
> -#define SDCON_DBCAB		(3     <<  8)		/* Column Address Bits */
> -#define SDCON_DBBNUM		(1     <<  3)		/* Number of Banks */
> -#define SDCON_DBDBW		(3     <<  1)		/* Data Bus Width */
> -
> -/* SDRAM General Control Register */
> -#define SDGCON_SDTRC		(3 << 2)		/* RAS to CAS latency */
> -#define SDGCON_SDCAS		(3 << 0)		/* CAS latency */
> -
> -/* SDRAM Buffer Control Register */
> -#define SDBCON_SDESTA		(1 << 31)		/* SDRAM Engine Status */
> -#define SDBCON_RBUFBDIS		(1 << 24)		/* Read Buffer Burst Enable */
> -#define SDBCON_WFIFOEN		(1 << 23)		/* Write FIFO Enable */
> -#define SDBCON_RBUFEN		(1 << 22)		/* Read Buffer Enable */
> -#define SDBCON_FLUSHWFIFO	(1 << 21)		/* Flush Write FIFO */
> -#define SDBCON_RBUFINV		(1 << 20)		/* Read Buffer Invalidate */
> -#define SDBCON_SDINI		(3 << 16)		/* SDRAM Initialization Control */
> -#define SDBCON_SDMODE		(0x3fff << 0)		/* SDRAM Mode Register Value Program */
> -
> -/* SDRAM Refresh Timer Register */
> -#define REFTIM_REFTIM		(0xffff << 0)		/* Refresh Timer Value */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-pci.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - PCI bridge registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#define KS8695_PCI_OFFSET	(0xF0000 + 0x2000)
> -#define KS8695_PCI_VA		(KS8695_IO_VA + KS8695_PCI_OFFSET)
> -#define KS8695_PCI_PA		(KS8695_IO_PA + KS8695_PCI_OFFSET)
> -
> -
> -#define KS8695_CRCFID		(0x000)		/* Configuration: Identification */
> -#define KS8695_CRCFCS		(0x004)		/* Configuration: Command and Status */
> -#define KS8695_CRCFRV		(0x008)		/* Configuration: Revision */
> -#define KS8695_CRCFLT		(0x00C)		/* Configuration: Latency Timer */
> -#define KS8695_CRCBMA		(0x010)		/* Configuration: Base Memory Address */
> -#define KS8695_CRCSID		(0x02C)		/* Configuration: Subsystem ID */
> -#define KS8695_CRCFIT		(0x03C)		/* Configuration: Interrupt */
> -#define KS8695_PBCA		(0x100)		/* Bridge Configuration Address */
> -#define KS8695_PBCD		(0x104)		/* Bridge Configuration Data */
> -#define KS8695_PBM		(0x200)		/* Bridge Mode */
> -#define KS8695_PBCS		(0x204)		/* Bridge Control and Status */
> -#define KS8695_PMBA		(0x208)		/* Bridge Memory Base Address */
> -#define KS8695_PMBAC		(0x20C)		/* Bridge Memory Base Address Control */
> -#define KS8695_PMBAM		(0x210)		/* Bridge Memory Base Address Mask */
> -#define KS8695_PMBAT		(0x214)		/* Bridge Memory Base Address Translation */
> -#define KS8695_PIOBA		(0x218)		/* Bridge I/O Base Address */
> -#define KS8695_PIOBAC		(0x21C)		/* Bridge I/O Base Address Control */
> -#define KS8695_PIOBAM		(0x220)		/* Bridge I/O Base Address Mask */
> -#define KS8695_PIOBAT		(0x224)		/* Bridge I/O Base Address Translation */
> -
> -
> -/* Configuration: Identification */
> -
> -/* Configuration: Command and Status */
> -
> -/* Configuration: Revision */
> -
> -
> -
> -#define CFRV_GUEST		(1 << 23)
> -
> -#define PBCA_TYPE1		(1)
> -#define PBCA_ENABLE		(1 << 31)
> -
> -
> 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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-sys.h
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - *
> - * KS8695 - System control registers and bit definitions
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_SYS_H
> -#define KS8695_SYS_H
> -
> -#define KS8695_SYS_OFFSET	(0xF0000 + 0x0000)
> -#define KS8695_SYS_VA		(KS8695_IO_VA + KS8695_SYS_OFFSET)
> -#define KS8695_SYS_PA		(KS8695_IO_PA + KS8695_SYS_OFFSET)
> -
> -
> -#define KS8695_SYSCFG		(0x00)		/* System Configuration Register */
> -#define KS8695_CLKCON		(0x04)		/* System Clock and Bus Control Register */
> -
> -
> -/* System Configuration Register */
> -#define SYSCFG_SPRBP		(0x3ff << 16)	/* Register Bank Base Pointer */
> -
> -/* System Clock and Bus Control Register */
> -#define CLKCON_SFMODE		(1 << 8)	/* System Fast Mode for Simulation */
> -#define CLKCON_SCDC		(7 << 0)	/* System Clock Divider Select */
> -
> -
> -#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 @@
> -/*
> - * arch/arm/mach-ks8695/include/mach/regs-wan.h
> - *
> - * Copyright (C) 2006 Andrew Victor
> - *
> - * KS8695 - WAN Registers and bit definitions.
> - *
> - * This file is licensed under  the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - */
> -
> -#ifndef KS8695_WAN_H
> -#define KS8695_WAN_H
> -
> -#define KS8695_WAN_OFFSET	(0xF0000 + 0x6000)
> -#define KS8695_WAN_VA		(KS8695_IO_VA + KS8695_WAN_OFFSET)
> -#define KS8695_WAN_PA		(KS8695_IO_PA + KS8695_WAN_OFFSET)
> -
> -
> -/*
> - * WAN registers
> - */
> -#define KS8695_WMDTXC		(0x00)		/* DMA Transmit Control */
> -#define KS8695_WMDRXC		(0x04)		/* DMA Receive Control */
> -#define KS8695_WMDTSC		(0x08)		/* DMA Transmit Start Command */
> -#define KS8695_WMDRSC		(0x0c)		/* DMA Receive Start Command */
> -#define KS8695_WTDLB		(0x10)		/* Transmit Descriptor List Base Address */
> -#define KS8695_WRDLB		(0x14)		/* Receive Descriptor List Base Address */
> -#define KS8695_WMAL		(0x18)		/* MAC Station Address Low */
> -#define KS8695_WMAH		(0x1c)		/* MAC Station Address High */
> -#define KS8695_WMAAL(n)		(0x80 + ((n)*8))	/* MAC Additional Station Address (0..15) Low */
> -#define KS8695_WMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station Address (0..15) High */
> -
> -
> -/* DMA Transmit Control Register */
> -#define WMDTXC_WMTRST		(1    << 31)	/* Soft Reset */
> -#define WMDTXC_WMTBS		(0x3f << 24)	/* Transmit Burst Size */
> -#define WMDTXC_WMTUCG		(1    << 18)	/* Transmit UDP Checksum Generate */
> -#define WMDTXC_WMTTCG		(1    << 17)	/* Transmit TCP Checksum Generate */
> -#define WMDTXC_WMTICG		(1    << 16)	/* Transmit IP Checksum Generate */
> -#define WMDTXC_WMTFCE		(1    <<  9)	/* Transmit Flow Control Enable */
> -#define WMDTXC_WMTLB		(1    <<  8)	/* Loopback mode */
> -#define WMDTXC_WMTEP		(1    <<  2)	/* Transmit Enable Padding */
> -#define WMDTXC_WMTAC		(1    <<  1)	/* Transmit Add CRC */
> -#define WMDTXC_WMTE		(1    <<  0)	/* TX Enable */
> -
> -/* DMA Receive Control Register */
> -#define WMDRXC_WMRBS		(0x3f << 24)	/* Receive Burst Size */
> -#define WMDRXC_WMRUCC		(1    << 18)	/* Receive UDP Checksum check */
> -#define WMDRXC_WMRTCG		(1    << 17)	/* Receive TCP Checksum check */
> -#define WMDRXC_WMRICG		(1    << 16)	/* Receive IP Checksum check */
> -#define WMDRXC_WMRFCE		(1    <<  9)	/* Receive Flow Control Enable */
> -#define WMDRXC_WMRB		(1    <<  6)	/* Receive Broadcast */
> -#define WMDRXC_WMRM		(1    <<  5)	/* Receive Multicast */
> -#define WMDRXC_WMRU		(1    <<  4)	/* Receive Unicast */
> -#define WMDRXC_WMRERR		(1    <<  3)	/* Receive Error Frame */
> -#define WMDRXC_WMRA		(1    <<  2)	/* Receive All */
> -#define WMDRXC_WMRE		(1    <<  0)	/* RX Enable */
> -
> -/* Additional Station Address High */
> -#define WMAAH_E			(1    << 31)	/* Address Enabled */
> -
> -
> -#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 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * arch/arm/mach-ks8695/time.c
> - *
> - * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
> - * Copyright (C) 2006 Simtec Electronics
> - */
> -
> -#include <linux/init.h>
> -#include <linux/interrupt.h>
> -#include <linux/irq.h>
> -#include <linux/kernel.h>
> -#include <linux/sched.h>
> -#include <linux/io.h>
> -#include <linux/clockchips.h>
> -
> -#include <asm/mach/time.h>
> -#include <asm/system_misc.h>
> -
> -#include <mach/regs-irq.h>
> -
> -#include "generic.h"
> -
> -#define KS8695_TMR_OFFSET	(0xF0000 + 0xE400)
> -#define KS8695_TMR_VA		(KS8695_IO_VA + KS8695_TMR_OFFSET)
> -#define KS8695_TMR_PA		(KS8695_IO_PA + KS8695_TMR_OFFSET)
> -
> -/*
> - * Timer registers
> - */
> -#define KS8695_TMCON		(0x00)		/* Timer Control Register */
> -#define KS8695_T1TC		(0x04)		/* Timer 1 Timeout Count Register */
> -#define KS8695_T0TC		(0x08)		/* Timer 0 Timeout Count Register */
> -#define KS8695_T1PD		(0x0C)		/* Timer 1 Pulse Count Register */
> -#define KS8695_T0PD		(0x10)		/* Timer 0 Pulse Count Register */
> -
> -/* Timer Control Register */
> -#define TMCON_T1EN		(1 << 1)	/* Timer 1 Enable */
> -#define TMCON_T0EN		(1 << 0)	/* Timer 0 Enable */
> -
> -/* Timer0 Timeout Counter Register */
> -#define T0TC_WATCHDOG		(0xff)		/* Enable watchdog mode */
> -
> -static int ks8695_set_periodic(struct clock_event_device *evt)
> -{
> -	u32 rate = DIV_ROUND_CLOSEST(KS8695_CLOCK_RATE, HZ);
> -	u32 half = DIV_ROUND_CLOSEST(rate, 2);
> -	u32 tmcon;
> -
> -	/* Disable timer 1 */
> -	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	tmcon &= ~TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/* Both registers need to count down */
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
> -
> -	/* Re-enable timer1 */
> -	tmcon |= TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -	return 0;
> -}
> -
> -static int ks8695_set_next_event(unsigned long cycles,
> -				 struct clock_event_device *evt)
> -
> -{
> -	u32 half = DIV_ROUND_CLOSEST(cycles, 2);
> -	u32 tmcon;
> -
> -	/* Disable timer 1 */
> -	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	tmcon &= ~TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/* Both registers need to count down */
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1TC);
> -	writel_relaxed(half, KS8695_TMR_VA + KS8695_T1PD);
> -
> -	/* Re-enable timer1 */
> -	tmcon |= TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	return 0;
> -}
> -
> -static struct clock_event_device clockevent_ks8695 = {
> -	.name			= "ks8695_t1tc",
> -	/* Reasonably fast and accurate clock event */
> -	.rating			= 300,
> -	.features		= CLOCK_EVT_FEAT_ONESHOT |
> -				  CLOCK_EVT_FEAT_PERIODIC,
> -	.set_next_event		= ks8695_set_next_event,
> -	.set_state_periodic	= ks8695_set_periodic,
> -};
> -
> -/*
> - * IRQ handler for the timer.
> - */
> -static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id)
> -{
> -	struct clock_event_device *evt = &clockevent_ks8695;
> -
> -	evt->event_handler(evt);
> -	return IRQ_HANDLED;
> -}
> -
> -static struct irqaction ks8695_timer_irq = {
> -	.name		= "ks8695_tick",
> -	.flags		= IRQF_TIMER,
> -	.handler	= ks8695_timer_interrupt,
> -};
> -
> -static void ks8695_timer_setup(void)
> -{
> -	unsigned long tmcon;
> -
> -	/* Disable timer 0 and 1 */
> -	tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	tmcon &= ~TMCON_T0EN;
> -	tmcon &= ~TMCON_T1EN;
> -	writel_relaxed(tmcon, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/*
> -	 * Use timer 1 to fire IRQs on the timeline, minimum 2 cycles
> -	 * (one on each counter) maximum 2*2^32, but the API will only
> -	 * accept up to a 32bit full word (0xFFFFFFFFU).
> -	 */
> -	clockevents_config_and_register(&clockevent_ks8695,
> -					KS8695_CLOCK_RATE, 2,
> -					0xFFFFFFFFU);
> -}
> -
> -void __init ks8695_timer_init(void)
> -{
> -	ks8695_timer_setup();
> -
> -	/* Enable timer interrupts */
> -	setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq);
> -}
> -
> -void ks8695_restart(enum reboot_mode reboot_mode, const char *cmd)
> -{
> -	unsigned int reg;
> -
> -	if (reboot_mode == REBOOT_SOFT)
> -		soft_restart(0);
> -
> -	/* disable timer0 */
> -	reg = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
> -	writel_relaxed(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -
> -	/* enable watchdog mode */
> -	writel_relaxed((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
> -
> -	/* re-enable timer0 */
> -	writel_relaxed(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
> -}
> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index 820b60a50125..05143ec47d94 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -106,7 +106,7 @@ config CPU_ARM922T
>   	help
>   	  The ARM922T is a version of the ARM920T, but with smaller
>   	  instruction and data caches. It is used in Altera's
> -	  Excalibur XA device family and Micrel's KS8695 Centaur.
> +	  Excalibur XA device family and the ARM Integrator.
>   
>   	  Say Y if you want support for the ARM922T processor.
>   	  Otherwise, say N.
> 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 07/16] spi: remove w90x900 driver
  2019-08-09 20:27 ` [PATCH 07/16] spi: " Arnd Bergmann
@ 2019-08-12 10:36   ` Mark Brown
  2019-08-12 13:06   ` Mark Brown
  1 sibling, 0 replies; 37+ messages in thread
From: Mark Brown @ 2019-08-12 10:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: soc, linux-kernel, linux-spi

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

On Fri, Aug 09, 2019 at 10:27:35PM +0200, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 08/16] ASoC: remove w90x900/nuc900 platform drivers
  2019-08-09 20:27 ` [PATCH 08/16] ASoC: remove w90x900/nuc900 platform drivers Arnd Bergmann
@ 2019-08-12 10:36   ` Mark Brown
  2019-08-12 13:09   ` Applied "ASoC: remove w90x900/nuc900 platform drivers" to the asoc tree Mark Brown
  1 sibling, 0 replies; 37+ messages in thread
From: Mark Brown @ 2019-08-12 10:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: soc, Liam Girdwood, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

On Fri, Aug 09, 2019 at 10:27:36PM +0200, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 07/16] spi: remove w90x900 driver
  2019-08-09 20:27 ` [PATCH 07/16] spi: " Arnd Bergmann
  2019-08-12 10:36   ` Mark Brown
@ 2019-08-12 13:06   ` Mark Brown
  1 sibling, 0 replies; 37+ messages in thread
From: Mark Brown @ 2019-08-12 13:06 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: soc, linux-kernel, linux-spi

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

On Fri, Aug 09, 2019 at 10:27:35PM +0200, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.

This doesn't apply against current code, please check and resend.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Applied "ASoC: remove w90x900/nuc900 platform drivers" to the asoc tree
  2019-08-09 20:27 ` [PATCH 08/16] ASoC: remove w90x900/nuc900 platform drivers Arnd Bergmann
  2019-08-12 10:36   ` Mark Brown
@ 2019-08-12 13:09   ` Mark Brown
  1 sibling, 0 replies; 37+ messages in thread
From: Mark Brown @ 2019-08-12 13:09 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: alsa-devel, Liam Girdwood, linux-kernel, Mark Brown, soc

The patch

   ASoC: remove w90x900/nuc900 platform drivers

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 8b209cdb696f49f7f5d6c1922bed435e54631ddd Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 9 Aug 2019 22:27:36 +0200
Subject: [PATCH] ASoC: remove w90x900/nuc900 platform drivers

The ARM w90x900 platform is getting removed, so this driver is obsolete.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20190809202749.742267-9-arnd@arndb.de
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/Kconfig               |   1 -
 sound/soc/Makefile              |   1 -
 sound/soc/nuc900/Kconfig        |  29 ---
 sound/soc/nuc900/Makefile       |  12 -
 sound/soc/nuc900/nuc900-ac97.c  | 391 --------------------------------
 sound/soc/nuc900/nuc900-audio.c |  73 ------
 sound/soc/nuc900/nuc900-audio.h | 108 ---------
 sound/soc/nuc900/nuc900-pcm.c   | 321 --------------------------
 8 files changed, 936 deletions(-)
 delete mode 100644 sound/soc/nuc900/Kconfig
 delete mode 100644 sound/soc/nuc900/Makefile
 delete mode 100644 sound/soc/nuc900/nuc900-ac97.c
 delete mode 100644 sound/soc/nuc900/nuc900-audio.c
 delete mode 100644 sound/soc/nuc900/nuc900-audio.h
 delete mode 100644 sound/soc/nuc900/nuc900-pcm.c

diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index dc86e4073001..bdc305cece6e 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -51,7 +51,6 @@ source "sound/soc/dwc/Kconfig"
 source "sound/soc/fsl/Kconfig"
 source "sound/soc/hisilicon/Kconfig"
 source "sound/soc/jz4740/Kconfig"
-source "sound/soc/nuc900/Kconfig"
 source "sound/soc/kirkwood/Kconfig"
 source "sound/soc/img/Kconfig"
 source "sound/soc/intel/Kconfig"
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
index 250a0dea9294..861a21b79484 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -39,7 +39,6 @@ obj-$(CONFIG_SND_SOC)	+= intel/
 obj-$(CONFIG_SND_SOC)	+= mediatek/
 obj-$(CONFIG_SND_SOC)	+= meson/
 obj-$(CONFIG_SND_SOC)	+= mxs/
-obj-$(CONFIG_SND_SOC)	+= nuc900/
 obj-$(CONFIG_SND_SOC)	+= kirkwood/
 obj-$(CONFIG_SND_SOC)	+= pxa/
 obj-$(CONFIG_SND_SOC)	+= qcom/
diff --git a/sound/soc/nuc900/Kconfig b/sound/soc/nuc900/Kconfig
deleted file mode 100644
index e1b22fbcb159..000000000000
--- a/sound/soc/nuc900/Kconfig
+++ /dev/null
@@ -1,29 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-##
-## NUC900 series AC97 API
-##
-config SND_SOC_NUC900
-	tristate "SoC Audio for NUC900 series"
-	depends on ARCH_W90X900
-	select SND_SOC_NUC900_AC97
-	help
-	  This option enables support for AC97 mode on the NUC900 SoC.
-
-config SND_SOC_NUC900_AC97
-	tristate
-	select AC97_BUS
-	select SND_AC97_CODEC
-	select SND_SOC_AC97_BUS
-
-
-##
-## Boards
-##
-config SND_SOC_NUC900EVB
-	tristate "NUC900 AC97 support for demo board"
-	depends on SND_SOC_NUC900
-	select SND_SOC_NUC900_AC97
-	select SND_SOC_AC97_CODEC
-	help
-	  Select this option to enable audio (AC97) on the
-	  NUC900 demoboard.
diff --git a/sound/soc/nuc900/Makefile b/sound/soc/nuc900/Makefile
deleted file mode 100644
index c7ba2b9549d2..000000000000
--- a/sound/soc/nuc900/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-# NUC900 series audio
-snd-soc-nuc900-pcm-objs := nuc900-pcm.o
-snd-soc-nuc900-ac97-objs := nuc900-ac97.o
-
-obj-$(CONFIG_SND_SOC_NUC900) += snd-soc-nuc900-pcm.o
-obj-$(CONFIG_SND_SOC_NUC900_AC97) += snd-soc-nuc900-ac97.o
-
-# Boards
-snd-soc-nuc900-audio-objs := nuc900-audio.o
-
-obj-$(CONFIG_SND_SOC_NUC900EVB) += snd-soc-nuc900-audio.o
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c
deleted file mode 100644
index 5f2e5c069377..000000000000
--- a/sound/soc/nuc900/nuc900-ac97.c
+++ /dev/null
@@ -1,391 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2009-2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/mutex.h>
-#include <linux/suspend.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-#include <linux/clk.h>
-
-#include <mach/mfp.h>
-
-#include "nuc900-audio.h"
-
-static DEFINE_MUTEX(ac97_mutex);
-struct nuc900_audio *nuc900_ac97_data;
-EXPORT_SYMBOL_GPL(nuc900_ac97_data);
-
-static int nuc900_checkready(void)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-
-	if (!(AUDIO_READ(nuc900_audio->mmio + ACTL_ACIS0) & CODEC_READY))
-		return -EPERM;
-
-	return 0;
-}
-
-/* AC97 controller reads codec register */
-static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97,
-					unsigned short reg)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long timeout = 0x10000, val;
-
-	mutex_lock(&ac97_mutex);
-
-	val = nuc900_checkready();
-	if (val) {
-		dev_err(nuc900_audio->dev, "AC97 codec is not ready\n");
-		goto out;
-	}
-
-	/* set the R_WB bit and write register index */
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS1, R_WB | reg);
-
-	/* set the valid frame bit and valid slots */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-	val |= (VALID_FRAME | SLOT1_VALID);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, val);
-
-	udelay(100);
-
-	/* polling the AC_R_FINISH */
-	while (!(AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_R_FINISH)
-								&& --timeout)
-		mdelay(1);
-
-	if (!timeout) {
-		dev_err(nuc900_audio->dev, "AC97 read register time out !\n");
-		val = -EPERM;
-		goto out;
-	}
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0) ;
-	val &= ~SLOT1_VALID;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, val);
-
-	if (AUDIO_READ(nuc900_audio->mmio + ACTL_ACIS1) >> 2 != reg) {
-		dev_err(nuc900_audio->dev,
-				"R_INDEX of REG_ACTL_ACIS1 not match!\n");
-	}
-
-	udelay(100);
-	val = (AUDIO_READ(nuc900_audio->mmio + ACTL_ACIS2) & 0xFFFF);
-
-out:
-	mutex_unlock(&ac97_mutex);
-	return val;
-}
-
-/* AC97 controller writes to codec register */
-static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
-				unsigned short val)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long tmp, timeout = 0x10000;
-
-	mutex_lock(&ac97_mutex);
-
-	tmp = nuc900_checkready();
-	if (tmp)
-		dev_err(nuc900_audio->dev, "AC97 codec is not ready\n");
-
-	/* clear the R_WB bit and write register index */
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS1, reg);
-
-	/* write register value */
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS2, val);
-
-	/* set the valid frame bit and valid slots */
-	tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-	tmp |= SLOT1_VALID | SLOT2_VALID | VALID_FRAME;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-	udelay(100);
-
-	/* polling the AC_W_FINISH */
-	while ((AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_W_FINISH)
-								&& --timeout)
-		mdelay(1);
-
-	if (!timeout)
-		dev_err(nuc900_audio->dev, "AC97 write register time out !\n");
-
-	tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-	tmp &= ~(SLOT1_VALID | SLOT2_VALID);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-	mutex_unlock(&ac97_mutex);
-
-}
-
-static void nuc900_ac97_warm_reset(struct snd_ac97 *ac97)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long val;
-
-	mutex_lock(&ac97_mutex);
-
-	/* warm reset AC 97 */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
-	val |= AC_W_RES;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACCON, val);
-
-	udelay(100);
-
-	val = nuc900_checkready();
-	if (val)
-		dev_err(nuc900_audio->dev, "AC97 codec is not ready\n");
-
-	mutex_unlock(&ac97_mutex);
-}
-
-static void nuc900_ac97_cold_reset(struct snd_ac97 *ac97)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long val;
-
-	mutex_lock(&ac97_mutex);
-
-	/* reset Audio Controller */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val |= ACTL_RESET_BIT;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val &= (~ACTL_RESET_BIT);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	/* reset AC-link interface */
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val |= AC_RESET;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-	val &= ~AC_RESET;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-	/* cold reset AC 97 */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
-	val |= AC_C_RES;
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACCON, val);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
-	val &= (~AC_C_RES);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACCON, val);
-
-	udelay(100);
-
-	mutex_unlock(&ac97_mutex);
-
-}
-
-/* AC97 controller operations */
-static struct snd_ac97_bus_ops nuc900_ac97_ops = {
-	.read		= nuc900_ac97_read,
-	.write		= nuc900_ac97_write,
-	.reset		= nuc900_ac97_cold_reset,
-	.warm_reset	= nuc900_ac97_warm_reset,
-};
-
-static int nuc900_ac97_trigger(struct snd_pcm_substream *substream,
-				int cmd, struct snd_soc_dai *dai)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	int ret;
-	unsigned long val, tmp;
-
-	ret = 0;
-
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-			tmp |= (SLOT3_VALID | SLOT4_VALID | VALID_FRAME);
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_PSR);
-			tmp |= (P_DMA_END_IRQ | P_DMA_MIDDLE_IRQ);
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, tmp);
-			val |= AC_PLAY;
-		} else {
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_RSR);
-			tmp |= (R_DMA_END_IRQ | R_DMA_MIDDLE_IRQ);
-
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, tmp);
-			val |= AC_RECORD;
-		}
-
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-		break;
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACOS0);
-			tmp &= ~(SLOT3_VALID | SLOT4_VALID);
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_ACOS0, tmp);
-
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, RESET_PRSR);
-			val &= ~AC_PLAY;
-		} else {
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, RESET_PRSR);
-			val &= ~AC_RECORD;
-		}
-
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-
-		break;
-	default:
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-static int nuc900_ac97_probe(struct snd_soc_dai *dai)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-	unsigned long val;
-
-	mutex_lock(&ac97_mutex);
-
-	/* enable unit clock */
-	clk_enable(nuc900_audio->clk);
-
-	/* enable audio controller and AC-link interface */
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-	val |= (IIS_AC_PIN_SEL | ACLINK_EN);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val);
-
-	mutex_unlock(&ac97_mutex);
-
-	return 0;
-}
-
-static int nuc900_ac97_remove(struct snd_soc_dai *dai)
-{
-	struct nuc900_audio *nuc900_audio = nuc900_ac97_data;
-
-	clk_disable(nuc900_audio->clk);
-	return 0;
-}
-
-static const struct snd_soc_dai_ops nuc900_ac97_dai_ops = {
-	.trigger	= nuc900_ac97_trigger,
-};
-
-static struct snd_soc_dai_driver nuc900_ac97_dai = {
-	.probe			= nuc900_ac97_probe,
-	.remove			= nuc900_ac97_remove,
-	.bus_control		= true,
-	.playback = {
-		.rates		= SNDRV_PCM_RATE_8000_48000,
-		.formats	= SNDRV_PCM_FMTBIT_S16_LE,
-		.channels_min	= 1,
-		.channels_max	= 2,
-	},
-	.capture = {
-		.rates		= SNDRV_PCM_RATE_8000_48000,
-		.formats	= SNDRV_PCM_FMTBIT_S16_LE,
-		.channels_min	= 1,
-		.channels_max	= 2,
-	},
-	.ops = &nuc900_ac97_dai_ops,
-};
-
-static const struct snd_soc_component_driver nuc900_ac97_component = {
-	.name		= "nuc900-ac97",
-};
-
-static int nuc900_ac97_drvprobe(struct platform_device *pdev)
-{
-	struct nuc900_audio *nuc900_audio;
-	int ret;
-
-	if (nuc900_ac97_data)
-		return -EBUSY;
-
-	nuc900_audio = devm_kzalloc(&pdev->dev, sizeof(struct nuc900_audio),
-				    GFP_KERNEL);
-	if (!nuc900_audio)
-		return -ENOMEM;
-
-	spin_lock_init(&nuc900_audio->lock);
-
-	nuc900_audio->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	nuc900_audio->mmio = devm_ioremap_resource(&pdev->dev,
-						   nuc900_audio->res);
-	if (IS_ERR(nuc900_audio->mmio))
-		return PTR_ERR(nuc900_audio->mmio);
-
-	nuc900_audio->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(nuc900_audio->clk)) {
-		ret = PTR_ERR(nuc900_audio->clk);
-		goto out;
-	}
-
-	ret = platform_get_irq(pdev, 0);
-	if (ret < 0)
-		goto out;
-	nuc900_audio->irq_num = ret;
-
-	nuc900_ac97_data = nuc900_audio;
-
-	ret = snd_soc_set_ac97_ops(&nuc900_ac97_ops);
-	if (ret)
-		goto out;
-
-	ret = devm_snd_soc_register_component(&pdev->dev, &nuc900_ac97_component,
-					 &nuc900_ac97_dai, 1);
-	if (ret)
-		goto out;
-
-	/* enbale ac97 multifunction pin */
-	mfp_set_groupg(nuc900_audio->dev, NULL);
-
-	return 0;
-
-out:
-	snd_soc_set_ac97_ops(NULL);
-	return ret;
-}
-
-static int nuc900_ac97_drvremove(struct platform_device *pdev)
-{
-	nuc900_ac97_data = NULL;
-	snd_soc_set_ac97_ops(NULL);
-
-	return 0;
-}
-
-static struct platform_driver nuc900_ac97_driver = {
-	.driver	= {
-		.name	= "nuc900-ac97",
-	},
-	.probe		= nuc900_ac97_drvprobe,
-	.remove		= nuc900_ac97_drvremove,
-};
-
-module_platform_driver(nuc900_ac97_driver);
-
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("NUC900 AC97 SoC driver!");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nuc900-ac97");
diff --git a/sound/soc/nuc900/nuc900-audio.c b/sound/soc/nuc900/nuc900-audio.c
deleted file mode 100644
index 19146690d514..000000000000
--- a/sound/soc/nuc900/nuc900-audio.c
+++ /dev/null
@@ -1,73 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/timer.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include "nuc900-audio.h"
-
-SND_SOC_DAILINK_DEFS(ac97,
-	DAILINK_COMP_ARRAY(COMP_CPU("nuc900-ac97")),
-	DAILINK_COMP_ARRAY(COMP_CODEC("ac97-codec", "ac97-hifi")),
-	DAILINK_COMP_ARRAY(COMP_PLATFORM("nuc900-pcm-audio")));
-
-static struct snd_soc_dai_link nuc900evb_ac97_dai = {
-	.name		= "AC97",
-	.stream_name	= "AC97 HiFi",
-	SND_SOC_DAILINK_REG(ac97),
-};
-
-static struct snd_soc_card nuc900evb_audio_machine = {
-	.name		= "NUC900EVB_AC97",
-	.owner		= THIS_MODULE,
-	.dai_link	= &nuc900evb_ac97_dai,
-	.num_links	= 1,
-};
-
-static struct platform_device *nuc900evb_asoc_dev;
-
-static int __init nuc900evb_audio_init(void)
-{
-	int ret;
-
-	ret = -ENOMEM;
-	nuc900evb_asoc_dev = platform_device_alloc("soc-audio", -1);
-	if (!nuc900evb_asoc_dev)
-		goto out;
-
-	/* nuc900 board audio device */
-	platform_set_drvdata(nuc900evb_asoc_dev, &nuc900evb_audio_machine);
-
-	ret = platform_device_add(nuc900evb_asoc_dev);
-
-	if (ret) {
-		platform_device_put(nuc900evb_asoc_dev);
-		nuc900evb_asoc_dev = NULL;
-	}
-
-out:
-	return ret;
-}
-
-static void __exit nuc900evb_audio_exit(void)
-{
-	platform_device_unregister(nuc900evb_asoc_dev);
-}
-
-module_init(nuc900evb_audio_init);
-module_exit(nuc900evb_audio_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("NUC900 Series ASoC audio support");
-MODULE_AUTHOR("Wan ZongShun");
diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h
deleted file mode 100644
index 90ffa7bbce01..000000000000
--- a/sound/soc/nuc900/nuc900-audio.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (c) 2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#ifndef _NUC900_AUDIO_H
-#define _NUC900_AUDIO_H
-
-#include <linux/io.h>
-
-/* Audio Control Registers */
-#define ACTL_CON		0x00
-#define ACTL_RESET		0x04
-#define ACTL_RDSTB		0x08
-#define ACTL_RDST_LENGTH	0x0C
-#define ACTL_RDSTC		0x10
-#define ACTL_RSR		0x14
-#define ACTL_PDSTB		0x18
-#define ACTL_PDST_LENGTH	0x1C
-#define ACTL_PDSTC		0x20
-#define ACTL_PSR		0x24
-#define ACTL_IISCON		0x28
-#define ACTL_ACCON		0x2C
-#define ACTL_ACOS0		0x30
-#define ACTL_ACOS1		0x34
-#define ACTL_ACOS2		0x38
-#define ACTL_ACIS0		0x3C
-#define ACTL_ACIS1		0x40
-#define ACTL_ACIS2		0x44
-#define ACTL_COUNTER		0x48
-
-/* bit definition of REG_ACTL_CON register */
-#define R_DMA_IRQ		0x1000
-#define T_DMA_IRQ		0x0800
-#define IIS_AC_PIN_SEL		0x0100
-#define FIFO_TH			0x0080
-#define ADC_EN			0x0010
-#define M80_EN			0x0008
-#define ACLINK_EN		0x0004
-#define IIS_EN			0x0002
-
-/* bit definition of REG_ACTL_RESET register */
-#define W5691_PLAY		0x20000
-#define ACTL_RESET_BIT		0x10000
-#define RECORD_RIGHT_CHNNEL	0x08000
-#define RECORD_LEFT_CHNNEL	0x04000
-#define PLAY_RIGHT_CHNNEL	0x02000
-#define PLAY_LEFT_CHNNEL	0x01000
-#define DAC_PLAY		0x00800
-#define ADC_RECORD		0x00400
-#define M80_PLAY		0x00200
-#define AC_RECORD		0x00100
-#define AC_PLAY			0x00080
-#define IIS_RECORD		0x00040
-#define IIS_PLAY		0x00020
-#define DAC_RESET		0x00010
-#define ADC_RESET		0x00008
-#define M80_RESET		0x00004
-#define AC_RESET		0x00002
-#define IIS_RESET		0x00001
-
-/* bit definition of REG_ACTL_ACCON register */
-#define AC_BCLK_PU_EN		0x20
-#define AC_R_FINISH		0x10
-#define AC_W_FINISH		0x08
-#define AC_W_RES		0x04
-#define AC_C_RES		0x02
-
-/* bit definition of ACTL_RSR register */
-#define R_FIFO_EMPTY		0x04
-#define R_DMA_END_IRQ		0x02
-#define R_DMA_MIDDLE_IRQ	0x01
-
-/* bit definition of ACTL_PSR register */
-#define P_FIFO_EMPTY		0x04
-#define P_DMA_END_IRQ		0x02
-#define P_DMA_MIDDLE_IRQ	0x01
-
-/* bit definition of ACTL_ACOS0 register */
-#define SLOT1_VALID		0x01
-#define SLOT2_VALID		0x02
-#define SLOT3_VALID		0x04
-#define SLOT4_VALID		0x08
-#define VALID_FRAME		0x10
-
-/* bit definition of ACTL_ACOS1 register */
-#define R_WB			0x80
-
-#define CODEC_READY		0x10
-#define RESET_PRSR		0x00
-#define AUDIO_WRITE(addr, val)	__raw_writel(val, addr)
-#define AUDIO_READ(addr)	__raw_readl(addr)
-
-struct nuc900_audio {
-	void __iomem *mmio;
-	spinlock_t lock;
-	unsigned long irq_num;
-	struct resource *res;
-	struct clk *clk;
-	struct device *dev;
-
-};
-
-extern struct nuc900_audio *nuc900_ac97_data;
-
-#endif /*end _NUC900_AUDIO_H */
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c
deleted file mode 100644
index 4442a26e9502..000000000000
--- a/sound/soc/nuc900/nuc900-pcm.c
+++ /dev/null
@@ -1,321 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (c) 2010 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/dma-mapping.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/soc.h>
-
-#include <mach/hardware.h>
-
-#include "nuc900-audio.h"
-
-static const struct snd_pcm_hardware nuc900_pcm_hardware = {
-	.info			= SNDRV_PCM_INFO_INTERLEAVED |
-					SNDRV_PCM_INFO_BLOCK_TRANSFER |
-					SNDRV_PCM_INFO_MMAP |
-					SNDRV_PCM_INFO_MMAP_VALID |
-					SNDRV_PCM_INFO_PAUSE |
-					SNDRV_PCM_INFO_RESUME,
-	.buffer_bytes_max	= 4*1024,
-	.period_bytes_min	= 1*1024,
-	.period_bytes_max	= 4*1024,
-	.periods_min		= 1,
-	.periods_max		= 1024,
-};
-
-static int nuc900_dma_hw_params(struct snd_pcm_substream *substream,
-	struct snd_pcm_hw_params *params)
-{
-	return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
-}
-
-static void nuc900_update_dma_register(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	void __iomem *mmio_addr, *mmio_len;
-
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		mmio_addr = nuc900_audio->mmio + ACTL_PDSTB;
-		mmio_len = nuc900_audio->mmio + ACTL_PDST_LENGTH;
-	} else {
-		mmio_addr = nuc900_audio->mmio + ACTL_RDSTB;
-		mmio_len = nuc900_audio->mmio + ACTL_RDST_LENGTH;
-	}
-
-	AUDIO_WRITE(mmio_addr, runtime->dma_addr);
-	AUDIO_WRITE(mmio_len, runtime->dma_bytes);
-}
-
-static void nuc900_dma_start(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	unsigned long val;
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-	val |= (T_DMA_IRQ | R_DMA_IRQ);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val);
-}
-
-static void nuc900_dma_stop(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	unsigned long val;
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-	val &= ~(T_DMA_IRQ | R_DMA_IRQ);
-	AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val);
-}
-
-static irqreturn_t nuc900_dma_interrupt(int irq, void *dev_id)
-{
-	struct snd_pcm_substream *substream = dev_id;
-	struct nuc900_audio *nuc900_audio = substream->runtime->private_data;
-	unsigned long val;
-
-	spin_lock(&nuc900_audio->lock);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_CON);
-
-	if (val & R_DMA_IRQ) {
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val | R_DMA_IRQ);
-
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_RSR);
-
-		if (val & R_DMA_MIDDLE_IRQ) {
-			val |= R_DMA_MIDDLE_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, val);
-		}
-
-		if (val & R_DMA_END_IRQ) {
-			val |= R_DMA_END_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_RSR, val);
-		}
-	} else if (val & T_DMA_IRQ) {
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_CON, val | T_DMA_IRQ);
-
-		val = AUDIO_READ(nuc900_audio->mmio + ACTL_PSR);
-
-		if (val & P_DMA_MIDDLE_IRQ) {
-			val |= P_DMA_MIDDLE_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, val);
-		}
-
-		if (val & P_DMA_END_IRQ) {
-			val |= P_DMA_END_IRQ;
-			AUDIO_WRITE(nuc900_audio->mmio + ACTL_PSR, val);
-		}
-	} else {
-		dev_err(nuc900_audio->dev, "Wrong DMA interrupt status!\n");
-		spin_unlock(&nuc900_audio->lock);
-		return IRQ_HANDLED;
-	}
-
-	spin_unlock(&nuc900_audio->lock);
-
-	snd_pcm_period_elapsed(substream);
-
-	return IRQ_HANDLED;
-}
-
-static int nuc900_dma_hw_free(struct snd_pcm_substream *substream)
-{
-	snd_pcm_lib_free_pages(substream);
-	return 0;
-}
-
-static int nuc900_dma_prepare(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-	unsigned long flags, val;
-	int ret = 0;
-
-	spin_lock_irqsave(&nuc900_audio->lock, flags);
-
-	nuc900_update_dma_register(substream);
-
-	val = AUDIO_READ(nuc900_audio->mmio + ACTL_RESET);
-
-	switch (runtime->channels) {
-	case 1:
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-			val &= ~(PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL);
-			val |= PLAY_RIGHT_CHNNEL;
-		} else {
-			val &= ~(RECORD_LEFT_CHNNEL | RECORD_RIGHT_CHNNEL);
-			val |= RECORD_RIGHT_CHNNEL;
-		}
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-		break;
-	case 2:
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-			val |= (PLAY_LEFT_CHNNEL | PLAY_RIGHT_CHNNEL);
-		else
-			val |= (RECORD_LEFT_CHNNEL | RECORD_RIGHT_CHNNEL);
-		AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val);
-		break;
-	default:
-		ret = -EINVAL;
-	}
-	spin_unlock_irqrestore(&nuc900_audio->lock, flags);
-	return ret;
-}
-
-static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd)
-{
-	int ret = 0;
-
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-		nuc900_dma_start(substream);
-		break;
-
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-		nuc900_dma_stop(substream);
-		break;
-
-	default:
-		ret = -EINVAL;
-		break;
-	}
-
-	return ret;
-}
-
-static int nuc900_dma_getposition(struct snd_pcm_substream *substream,
-					dma_addr_t *src, dma_addr_t *dst)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-
-	if (src != NULL)
-		*src = AUDIO_READ(nuc900_audio->mmio + ACTL_PDSTC);
-
-	if (dst != NULL)
-		*dst = AUDIO_READ(nuc900_audio->mmio + ACTL_RDSTC);
-
-	return 0;
-}
-
-static snd_pcm_uframes_t nuc900_dma_pointer(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	dma_addr_t src, dst;
-	unsigned long res;
-
-	nuc900_dma_getposition(substream, &src, &dst);
-
-	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
-		res = dst - runtime->dma_addr;
-	else
-		res = src - runtime->dma_addr;
-
-	return bytes_to_frames(substream->runtime, res);
-}
-
-static int nuc900_dma_open(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio;
-
-	snd_soc_set_runtime_hwparams(substream, &nuc900_pcm_hardware);
-
-	nuc900_audio = nuc900_ac97_data;
-
-	if (request_irq(nuc900_audio->irq_num, nuc900_dma_interrupt,
-			0, "nuc900-dma", substream))
-		return -EBUSY;
-
-	runtime->private_data = nuc900_audio;
-
-	return 0;
-}
-
-static int nuc900_dma_close(struct snd_pcm_substream *substream)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct nuc900_audio *nuc900_audio = runtime->private_data;
-
-	free_irq(nuc900_audio->irq_num, substream);
-
-	return 0;
-}
-
-static int nuc900_dma_mmap(struct snd_pcm_substream *substream,
-	struct vm_area_struct *vma)
-{
-	struct snd_pcm_runtime *runtime = substream->runtime;
-
-	return dma_mmap_wc(substream->pcm->card->dev, vma, runtime->dma_area,
-			   runtime->dma_addr, runtime->dma_bytes);
-}
-
-static const struct snd_pcm_ops nuc900_dma_ops = {
-	.open		= nuc900_dma_open,
-	.close		= nuc900_dma_close,
-	.ioctl		= snd_pcm_lib_ioctl,
-	.hw_params	= nuc900_dma_hw_params,
-	.hw_free	= nuc900_dma_hw_free,
-	.prepare	= nuc900_dma_prepare,
-	.trigger	= nuc900_dma_trigger,
-	.pointer	= nuc900_dma_pointer,
-	.mmap		= nuc900_dma_mmap,
-};
-
-static int nuc900_dma_new(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_card *card = rtd->card->snd_card;
-	struct snd_pcm *pcm = rtd->pcm;
-	int ret;
-
-	ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
-	if (ret)
-		return ret;
-
-	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-		card->dev, 4 * 1024, (4 * 1024) - 1);
-
-	return 0;
-}
-
-static const struct snd_soc_component_driver nuc900_soc_component = {
-	.ops		= &nuc900_dma_ops,
-	.pcm_new	= nuc900_dma_new,
-};
-
-static int nuc900_soc_platform_probe(struct platform_device *pdev)
-{
-	return devm_snd_soc_register_component(&pdev->dev, &nuc900_soc_component,
-					       NULL, 0);
-}
-
-static struct platform_driver nuc900_pcm_driver = {
-	.driver = {
-			.name = "nuc900-pcm-audio",
-	},
-
-	.probe = nuc900_soc_platform_probe,
-};
-
-module_platform_driver(nuc900_pcm_driver);
-
-MODULE_AUTHOR("Wan ZongShun, <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("nuc900 Audio DMA module");
-MODULE_LICENSE("GPL");
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH 14/16] rtc: remove w90x900/nuc900 driver
  2019-08-09 20:27 ` [PATCH 14/16] rtc: remove w90x900/nuc900 driver Arnd Bergmann
@ 2019-08-12 20:57   ` Alexandre Belloni
  0 siblings, 0 replies; 37+ messages in thread
From: Alexandre Belloni @ 2019-08-12 20:57 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: soc, Alessandro Zummo, linux-kernel, linux-rtc

On 09/08/2019 22:27:42+0200, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/rtc/Kconfig      |   7 -
>  drivers/rtc/Makefile     |   1 -
>  drivers/rtc/rtc-nuc900.c | 271 ---------------------------------------
>  3 files changed, 279 deletions(-)
>  delete mode 100644 drivers/rtc/rtc-nuc900.c
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 09/16] fbdev: remove w90x900/nuc900 platform drivers
  2019-08-09 20:27 ` [PATCH 09/16] fbdev: remove w90x900/nuc900 platform drivers Arnd Bergmann
@ 2019-08-13 13:30   ` Bartlomiej Zolnierkiewicz
  2019-08-13 13:40     ` Arnd Bergmann
  0 siblings, 1 reply; 37+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-08-13 13:30 UTC (permalink / raw)
  To: Arnd Bergmann, soc; +Cc: linux-kernel, dri-devel, linux-fbdev


On 8/9/19 10:27 PM, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

BTW there is a very minor issue with internal bisectability of
this patch series (non-issue in reality because it affects only
configs with ARCH_W90X900=y and such are now gone, just FYI):

arch/arm/mach-w90x900/dev.c (which stays in tree until patch #16
("ARM: remove w90x900 platform") uses include/linux/platform_data/
files removed in patches #7 (spi), #9 (fbdev) and #10 (keyboard).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

>  drivers/video/fbdev/Kconfig                  |  14 -
>  drivers/video/fbdev/Makefile                 |   1 -
>  drivers/video/fbdev/nuc900fb.c               | 760 -------------------
>  drivers/video/fbdev/nuc900fb.h               |  51 --
>  include/Kbuild                               |   1 -
>  include/linux/platform_data/video-nuc900fb.h |  79 --
>  6 files changed, 906 deletions(-)
>  delete mode 100644 drivers/video/fbdev/nuc900fb.c
>  delete mode 100644 drivers/video/fbdev/nuc900fb.h
>  delete mode 100644 include/linux/platform_data/video-nuc900fb.h

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 09/16] fbdev: remove w90x900/nuc900 platform drivers
  2019-08-13 13:30   ` Bartlomiej Zolnierkiewicz
@ 2019-08-13 13:40     ` Arnd Bergmann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Bergmann @ 2019-08-13 13:40 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: soc, Linux Kernel Mailing List, dri-devel, Linux Fbdev development list

On Tue, Aug 13, 2019 at 3:30 PM Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
>
>
> On 8/9/19 10:27 PM, Arnd Bergmann wrote:
> > The ARM w90x900 platform is getting removed, so this driver is obsolete.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>
> BTW there is a very minor issue with internal bisectability of
> this patch series (non-issue in reality because it affects only
> configs with ARCH_W90X900=y and such are now gone, just FYI):
>
> arch/arm/mach-w90x900/dev.c (which stays in tree until patch #16
> ("ARM: remove w90x900 platform") uses include/linux/platform_data/
> files removed in patches #7 (spi), #9 (fbdev) and #10 (keyboard).

Ah right, I actually planned to change that originally but forgot.
As you say, it's not a huge issue except for building randconfig or
nuc900_defconfig.

       Arnd

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 01/16] ARM: remove ks8695 platform
  2019-08-09 20:27 ` [PATCH 01/16] ARM: remove ks8695 platform Arnd Bergmann
  2019-08-11  9:18   ` Ben Dooks
  2019-08-12  3:59   ` Greg Ungerer
@ 2019-08-13 15:27   ` Ben Dooks
  2 siblings, 0 replies; 37+ messages in thread
From: Ben Dooks @ 2019-08-13 15:27 UTC (permalink / raw)
  To: Arnd Bergmann, soc
  Cc: Greg Ungerer, Andrew Victor, linux-kernel, linux-arm-kernel

On 09/08/2019 21:27, Arnd Bergmann wrote:
> ks8695 is an older SoC originally made by Kendin, which was later acquired
> by Micrel, and subsequently by Microchip.
> 
> The platform port was originally contributed by Andrew Victor and Ben
> Dooks, and later maintained by Greg Ungerer.
> 
> When I recently submitted cleanups, but Greg noted that the platform no
> longer boots and nobody is using it any more, we decided to remove it.
> 
> Cc: Greg Ungerer <gerg@kernel.org>
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Ben Dooks <ben.dooks@codethink.co.uk>
> Link: https://wikidevi.com/wiki/Micrel
> Link: https://lore.kernel.org/linux-arm-kernel/2bc41895-d4f9-896c-0726-0b2862fcbf25@kernel.org/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ben Dooks <ben-linux@fluff.org>

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 12/16] mtd: rawnand: remove w90x900 driver
  2019-08-09 20:27 ` [PATCH 12/16] mtd: rawnand: remove w90x900 driver Arnd Bergmann
  2019-08-10  8:21   ` Boris Brezillon
@ 2019-08-26 12:58   ` Miquel Raynal
  1 sibling, 0 replies; 37+ messages in thread
From: Miquel Raynal @ 2019-08-26 12:58 UTC (permalink / raw)
  To: Arnd Bergmann, soc
  Cc: Miquel Raynal, Vignesh Raghavendra, Richard Weinberger,
	linux-kernel, Marek Vasut, linux-mtd, Brian Norris,
	David Woodhouse

On Fri, 2019-08-09 at 20:27:40 UTC, Arnd Bergmann wrote:
> The ARM w90x900 platform is getting removed, so this driver is obsolete.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2019-08-26 12:59 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 20:27 [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Arnd Bergmann
2019-08-09 20:27 ` [PATCH 01/16] ARM: remove ks8695 platform Arnd Bergmann
2019-08-11  9:18   ` Ben Dooks
2019-08-12  3:59   ` Greg Ungerer
2019-08-13 15:27   ` Ben Dooks
2019-08-09 20:27 ` [PATCH 02/16] serial: remove ks8695 driver Arnd Bergmann
2019-08-09 20:27 ` [PATCH 03/16] gpio: " Arnd Bergmann
2019-08-10  9:03   ` Linus Walleij
2019-08-09 20:27 ` [PATCH 04/16] watchdog: " Arnd Bergmann
2019-08-09 20:42   ` Guenter Roeck
2019-08-10  8:37     ` Arnd Bergmann
2019-08-10 12:56       ` Guenter Roeck
2019-08-09 20:27 ` [PATCH 05/16] net: " Arnd Bergmann
2019-08-09 20:27 ` [PATCH 06/16] watchdog: remove w90x900 driver Arnd Bergmann
2019-08-09 20:42   ` Guenter Roeck
2019-08-09 20:27 ` [PATCH 07/16] spi: " Arnd Bergmann
2019-08-12 10:36   ` Mark Brown
2019-08-12 13:06   ` Mark Brown
2019-08-09 20:27 ` [PATCH 08/16] ASoC: remove w90x900/nuc900 platform drivers Arnd Bergmann
2019-08-12 10:36   ` Mark Brown
2019-08-12 13:09   ` Applied "ASoC: remove w90x900/nuc900 platform drivers" to the asoc tree Mark Brown
2019-08-09 20:27 ` [PATCH 09/16] fbdev: remove w90x900/nuc900 platform drivers Arnd Bergmann
2019-08-13 13:30   ` Bartlomiej Zolnierkiewicz
2019-08-13 13:40     ` Arnd Bergmann
2019-08-09 20:27 ` [PATCH 10/16] Input: remove w90x900 keyboard driver Arnd Bergmann
2019-08-09 21:56   ` Dmitry Torokhov
2019-08-09 20:27 ` [PATCH 11/16] Input: remove w90x900 touchscreen driver Arnd Bergmann
2019-08-09 21:56   ` Dmitry Torokhov
2019-08-09 20:27 ` [PATCH 12/16] mtd: rawnand: remove w90x900 driver Arnd Bergmann
2019-08-10  8:21   ` Boris Brezillon
2019-08-26 12:58   ` Miquel Raynal
2019-08-09 20:27 ` [PATCH 13/16] net: remove w90p910-ether driver Arnd Bergmann
2019-08-09 20:27 ` [PATCH 14/16] rtc: remove w90x900/nuc900 driver Arnd Bergmann
2019-08-12 20:57   ` Alexandre Belloni
2019-08-09 20:27 ` [PATCH 15/16] usb: remove ehci-w90x900 driver Arnd Bergmann
2019-08-09 20:27 ` [PATCH 16/16] ARM: remove w90x900 platform Arnd Bergmann
2019-08-10  7:29 ` [PATCH 00/16] ARM: remove ks8695 and w90x900 platforms Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).