[linux] 01/01: WIP: [armel] Combine marvell and versatile flavours into an 'armv5' flavour
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Wed Jan 27 20:55:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch benh/armel-single-flavour
in repository linux.
commit afc67a59cd9e8a09fd6e291c483ca0a724d711e9
Author: Ben Hutchings <ben at decadent.org.uk>
Date: Wed Jan 27 19:07:01 2016 +0000
WIP: [armel] Combine marvell and versatile flavours into an 'armv5' flavour
This only just fits (98.6% of limit), and the merged configuration
doesn't look entirely sensible.
---
debian/changelog | 5 +-
.../config/armel/{config.marvell => config.armv5} | 250 ++-
debian/config/armel/config.versatile | 451 ------
debian/config/armel/defines | 18 +-
debian/installer/armel/kernel-versions | 3 +-
.../{armel-marvell => armel-armv5}/btrfs-modules | 0
.../cdrom-core-modules | 0
.../{armel-marvell => armel-armv5}/core-modules | 0
.../{armel-marvell => armel-armv5}/crc-modules | 0
.../crypto-dm-modules | 0
.../{armel-marvell => armel-armv5}/crypto-modules | 0
.../{armel-marvell => armel-armv5}/event-modules | 0
.../{armel-marvell => armel-armv5}/ext4-modules | 0
.../{armel-marvell => armel-armv5}/fat-modules | 0
.../{armel-marvell => armel-armv5}/fb-modules | 0
.../{armel-marvell => armel-armv5}/fuse-modules | 0
.../{armel-marvell => armel-armv5}/input-modules | 0
.../{armel-marvell => armel-armv5}/ipv6-modules | 0
.../{armel-marvell => armel-armv5}/isofs-modules | 0
.../{armel-marvell => armel-armv5}/jffs2-modules | 0
.../{armel-marvell => armel-armv5}/jfs-modules | 0
.../{armel-marvell => armel-armv5}/kernel-image | 0
.../{armel-marvell => armel-armv5}/leds-modules | 0
.../{armel-marvell => armel-armv5}/loop-modules | 0
.../{armel-marvell => armel-armv5}/md-modules | 0
.../{armel-marvell => armel-armv5}/minix-modules | 0
.../{armel-marvell => armel-armv5}/mmc-modules | 0
.../{armel-marvell => armel-armv5}/mouse-modules | 0
.../{armel-marvell => armel-armv5}/mtd-modules | 0
.../multipath-modules | 0
.../{armel-marvell => armel-armv5}/nbd-modules | 0
.../{armel-versatile => armel-armv5}/nic-modules | 3 +
.../nic-shared-modules | 0
.../{armel-marvell => armel-armv5}/nic-usb-modules | 0
.../{armel-marvell => armel-armv5}/ppp-modules | 0
.../{armel-versatile => armel-armv5}/sata-modules | 2 +
.../scsi-common-modules | 0
.../scsi-core-modules | 0
.../squashfs-modules | 0
.../{armel-marvell => armel-armv5}/udf-modules | 0
.../{armel-marvell => armel-armv5}/uinput-modules | 0
.../{armel-marvell => armel-armv5}/usb-modules | 0
.../usb-serial-modules | 0
.../usb-storage-modules | 0
.../virtio-modules | 0
.../{armel-marvell => armel-armv5}/zlib-modules | 0
.../armel/modules/armel-marvell/nic-modules | 3 -
.../armel/modules/armel-marvell/sata-modules | 2 -
.../armel/modules/armel-versatile/btrfs-modules | 1 -
.../modules/armel-versatile/cdrom-core-modules | 2 -
.../armel/modules/armel-versatile/core-modules | 1 -
.../armel/modules/armel-versatile/crc-modules | 1 -
.../modules/armel-versatile/crypto-dm-modules | 1 -
.../armel/modules/armel-versatile/crypto-modules | 1 -
.../armel/modules/armel-versatile/ext4-modules | 1 -
.../armel/modules/armel-versatile/fat-modules | 1 -
.../armel/modules/armel-versatile/fuse-modules | 1 -
.../armel/modules/armel-versatile/isofs-modules | 1 -
.../armel/modules/armel-versatile/kernel-image | 1 -
.../armel/modules/armel-versatile/loop-modules | 1 -
.../armel/modules/armel-versatile/md-modules | 1 -
.../modules/armel-versatile/multipath-modules | 1 -
.../armel/modules/armel-versatile/nbd-modules | 1 -
.../modules/armel-versatile/nic-shared-modules | 1 -
.../armel/modules/armel-versatile/nic-usb-modules | 1 -
.../armel/modules/armel-versatile/ppp-modules | 2 -
.../modules/armel-versatile/scsi-core-modules | 1 -
.../armel/modules/armel-versatile/squashfs-modules | 1 -
.../armel/modules/armel-versatile/udf-modules | 1 -
.../armel/modules/armel-versatile/usb-modules | 1 -
.../modules/armel-versatile/usb-serial-modules | 1 -
.../modules/armel-versatile/usb-storage-modules | 1 -
.../armel/modules/armel-versatile/zlib-modules | 1 -
...g-ll-rework-integrator-versatile-handling.patch | 78 +
.../arm-versatile-add-dt-based-pci-detection.patch | 87 +
...m-versatile-add-the-syscon-leds-to-the-dt.patch | 91 ++
.../arm-versatile-convert-to-multi-platform.patch | 147 ++
...satile-merge-mach-code-into-a-single-file.patch | 1061 ++++++++++++
...le-switch-to-dt-only-booting-and-remove-l.patch | 1692 ++++++++++++++++++++
.../clk-realview-stop-using-machine-headers.patch | 40 +
...lk-versatile-icst-add-device-tree-support.patch | 121 ++
.../clk-versatile-icst-convert-to-use-regmap.patch | 190 +++
...le-icst-refactor-to-allocate-regmap-separ.patch | 99 ++
...-fpga-fix-pci-irq-mapping-on-versatile-pb.patch | 25 +
debian/patches/series | 11 +
85 files changed, 3891 insertions(+), 515 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 31f7355..ef2ff4c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,13 +15,12 @@ linux (4.4-1~exp2) UNRELEASED; urgency=medium
Michlmayr. (Closes: #812386)
[ Ben Hutchings ]
- * [armel] Replace kirkwood and orion5x flavours with a 'marvell' flavour
- * [armel/marvell] Adjust configuration to reduce image size:
+ * [armel] Replace all flavours with an 'armv5' flavour
+ * [armel/armv5] Adjust configuration to reduce image size:
- Disable support for DNS-323 as the kernel image was already too large
for this machine
+ Disable MACH_DNS323
+ Change MTD_CFI_AMDSTD from built-in to module
- - input: Disable KEYBOARD_ATKBD
- mtd: Change JFFS2_FS, MTD_SPI_NOR, and M25P80 from built-in to modules
-- Ian Campbell <ijc at debian.org> Sat, 23 Jan 2016 08:23:05 +0000
diff --git a/debian/config/armel/config.marvell b/debian/config/armel/config.armv5
similarity index 76%
rename from debian/config/armel/config.marvell
rename to debian/config/armel/config.armv5
index 6d5750f..5d1b603 100644
--- a/debian/config/armel/config.marvell
+++ b/debian/config/armel/config.armv5
@@ -78,13 +78,20 @@ CONFIG_MACH_RD88F5181L_FXO=y
CONFIG_MACH_RD88F6183AP_GE=y
##
+## file: arch/arm/mach-versatile/Kconfig
+##
+CONFIG_ARCH_VERSATILE=y
+
+##
## file: arch/arm/mm/Kconfig
##
+CONFIG_CPU_ARM926T=y
CONFIG_CPU_FEROCEON_OLD_ID=y
CONFIG_ARM_THUMB=y
# CONFIG_CPU_ICACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_DISABLE is not set
# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
##
## file: block/Kconfig.iosched
@@ -125,20 +132,20 @@ CONFIG_SUN_PARTITION=y
##
CONFIG_ATA=m
CONFIG_SATA_AHCI=m
-# CONFIG_SATA_SIL24 is not set
+CONFIG_SATA_SIL24=m
CONFIG_ATA_SFF=y
# CONFIG_PDC_ADMA is not set
# CONFIG_SATA_QSTOR is not set
-# CONFIG_SATA_SX4 is not set
+CONFIG_SATA_SX4=m
# CONFIG_ATA_PIIX is not set
CONFIG_SATA_MV=m
# CONFIG_SATA_NV is not set
-# CONFIG_SATA_PROMISE is not set
-# CONFIG_SATA_SIL is not set
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SIL=m
# CONFIG_SATA_SIS is not set
# CONFIG_SATA_SVW is not set
# CONFIG_SATA_ULI is not set
-# CONFIG_SATA_VIA is not set
+CONFIG_SATA_VIA=m
# CONFIG_SATA_VITESSE is not set
# CONFIG_PATA_ALI is not set
# CONFIG_PATA_AMD is not set
@@ -180,6 +187,23 @@ CONFIG_SATA_MV=m
# CONFIG_ATA_GENERIC is not set
##
+## file: drivers/atm/Kconfig
+##
+CONFIG_ATM_DRIVERS=y
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP is not set
+# CONFIG_ATM_LANAI is not set
+# CONFIG_ATM_ENI is not set
+# CONFIG_ATM_FIRESTREAM is not set
+# CONFIG_ATM_ZATM is not set
+# CONFIG_ATM_NICSTAR is not set
+# CONFIG_ATM_IDT77252 is not set
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_IA is not set
+# CONFIG_ATM_HE is not set
+
+##
## file: drivers/bluetooth/Kconfig
##
# CONFIG_BT_HCIUART is not set
@@ -189,6 +213,12 @@ CONFIG_BT_HCIBFUSB=m
CONFIG_BT_HCIVHCI=m
##
+## file: drivers/char/Kconfig
+##
+# CONFIG_NVRAM is not set
+# CONFIG_APPLICOM is not set
+
+##
## file: drivers/cpuidle/Kconfig
##
CONFIG_CPU_IDLE=y
@@ -236,7 +266,12 @@ CONFIG_I2C_CHARDEV=y
##
## file: drivers/i2c/busses/Kconfig
##
+# CONFIG_I2C_ISCH is not set
CONFIG_I2C_MV64XXX=y
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_PCA_PLATFORM=m
+# CONFIG_I2C_SIMTEC is not set
+CONFIG_I2C_VERSATILE=m
##
## file: drivers/input/gameport/Kconfig
@@ -251,16 +286,23 @@ CONFIG_INPUT_JOYSTICK=y
##
## file: drivers/input/keyboard/Kconfig
##
-# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_LKKBD is not set
CONFIG_KEYBOARD_GPIO=m
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_KEYBOARD_STOWAWAY=m
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
##
## file: drivers/input/serio/Kconfig
##
-CONFIG_SERIO=m
-CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_AMBAKMI=y
# CONFIG_SERIO_PCIPS2 is not set
-CONFIG_SERIO_LIBPS2=m
+CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
##
@@ -306,9 +348,11 @@ CONFIG_ISDN_DIVAS_MAINT=m
##
## file: drivers/leds/Kconfig
##
+CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_NS2=m
CONFIG_LEDS_NETXBIG=m
+CONFIG_LEDS_SYSCON=y
##
## file: drivers/leds/trigger/Kconfig
@@ -317,6 +361,11 @@ CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
##
+## file: drivers/mfd/Kconfig
+##
+CONFIG_MFD_SYSCON=y
+
+##
## file: drivers/mmc/Kconfig
##
CONFIG_MMC=m
@@ -417,11 +466,49 @@ CONFIG_MTD_NAND_ORION=y
CONFIG_MTD_SPI_NOR=m
##
+## file: drivers/net/Kconfig
+##
+# CONFIG_NET_FC is not set
+
+##
## file: drivers/net/arcnet/Kconfig
##
# CONFIG_ARCNET is not set
##
+## file: drivers/net/ethernet/Kconfig
+##
+CONFIG_FEALNX=m
+
+##
+## file: drivers/net/ethernet/3com/Kconfig
+##
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+
+##
+## file: drivers/net/ethernet/8390/Kconfig
+##
+# CONFIG_AX88796 is not set
+CONFIG_NE2K_PCI=m
+
+##
+## file: drivers/net/ethernet/adaptec/Kconfig
+##
+CONFIG_ADAPTEC_STARFIRE=m
+
+##
+## file: drivers/net/ethernet/alteon/Kconfig
+##
+# CONFIG_ACENIC is not set
+
+##
+## file: drivers/net/ethernet/amd/Kconfig
+##
+CONFIG_AMD8111_ETH=m
+
+##
## file: drivers/net/ethernet/atheros/Kconfig
##
# CONFIG_ATL1 is not set
@@ -429,18 +516,32 @@ CONFIG_MTD_SPI_NOR=m
##
## file: drivers/net/ethernet/broadcom/Kconfig
##
+# CONFIG_B44 is not set
# CONFIG_BNX2 is not set
# CONFIG_TIGON3 is not set
# CONFIG_BNX2X is not set
##
+## file: drivers/net/ethernet/davicom/Kconfig
+##
+# CONFIG_DM9000 is not set
+
+##
## file: drivers/net/ethernet/dlink/Kconfig
##
# CONFIG_DL2K is not set
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+
+##
+## file: drivers/net/ethernet/hp/Kconfig
+##
+CONFIG_HP100=m
##
## file: drivers/net/ethernet/intel/Kconfig
##
+CONFIG_E100=m
# CONFIG_E1000 is not set
# CONFIG_E1000E is not set
# CONFIG_IGB is not set
@@ -456,9 +557,15 @@ CONFIG_MVMDIO=m
##
## file: drivers/net/ethernet/natsemi/Kconfig
##
+CONFIG_NATSEMI=m
# CONFIG_NS83820 is not set
##
+## file: drivers/net/ethernet/nvidia/Kconfig
+##
+# CONFIG_FORCEDETH is not set
+
+##
## file: drivers/net/ethernet/packetengines/Kconfig
##
# CONFIG_HAMACHI is not set
@@ -472,19 +579,60 @@ CONFIG_MVMDIO=m
##
## file: drivers/net/ethernet/realtek/Kconfig
##
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
# CONFIG_R8169 is not set
##
+## file: drivers/net/ethernet/silan/Kconfig
+##
+CONFIG_SC92031=m
+
+##
## file: drivers/net/ethernet/sis/Kconfig
##
-# CONFIG_SIS190 is not set
+CONFIG_SIS900=m
+
+##
+## file: drivers/net/ethernet/smsc/Kconfig
+##
+CONFIG_SMC91X=m
+CONFIG_EPIC100=m
+
+##
+## file: drivers/net/ethernet/sun/Kconfig
+##
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+
+##
+## file: drivers/net/ethernet/ti/Kconfig
+##
+# CONFIG_TLAN is not set
##
## file: drivers/net/ethernet/via/Kconfig
##
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
# CONFIG_VIA_VELOCITY is not set
##
+## file: drivers/net/fddi/Kconfig
+##
+# CONFIG_FDDI is not set
+
+##
+## file: drivers/net/hippi/Kconfig
+##
+# CONFIG_HIPPI is not set
+
+##
## file: drivers/net/wireless/mwifiex/Kconfig
##
CONFIG_MWIFIEX=m
@@ -522,6 +670,7 @@ CONFIG_RTC_DRV_RS5C372=y
CONFIG_RTC_DRV_PCF8563=y
CONFIG_RTC_DRV_M41T80=y
CONFIG_RTC_DRV_S35390A=y
+CONFIG_RTC_DRV_PL031=y
CONFIG_RTC_DRV_MV=y
##
@@ -539,7 +688,7 @@ CONFIG_RTC_DRV_MV=y
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_STEX is not set
-# CONFIG_SCSI_SYM53C8XX_2 is not set
+CONFIG_SCSI_SYM53C8XX_2=m
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_LPFC is not set
@@ -604,8 +753,18 @@ CONFIG_FB_XGI=m
CONFIG_KIRKWOOD_THERMAL=m
##
+## file: drivers/tty/Kconfig
+##
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+##
## file: drivers/tty/serial/Kconfig
##
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
CONFIG_SERIAL_OF_PLATFORM=y
##
@@ -635,27 +794,64 @@ CONFIG_USB_SPEEDTOUCH=m
##
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_EHCI_HCD_ORION=y
-# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_ISP116X_HCD=m
CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_HCD_SSB is not set
CONFIG_USB_UHCI_HCD=m
+# CONFIG_USB_U132_HCD is not set
CONFIG_USB_SL811_HCD=m
+# CONFIG_USB_R8A66597_HCD is not set
+
+##
+## file: drivers/video/backlight/Kconfig
+##
+CONFIG_BACKLIGHT_CLASS_DEVICE=m
##
## file: drivers/video/console/Kconfig
##
# CONFIG_VGA_CONSOLE is not set
-CONFIG_FRAMEBUFFER_CONSOLE=m
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
##
## file: drivers/video/fbdev/Kconfig
##
-CONFIG_FB=m
+CONFIG_FB=y
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_CIRRUS=m
+# CONFIG_FB_PM2 is not set
+CONFIG_FB_ARMCLCD=y
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+CONFIG_FB_S3=m
+CONFIG_FB_S3_DDC=y
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_TRIDENT is not set
+CONFIG_FB_ARK=m
+CONFIG_FB_PM3=m
+CONFIG_FB_SM501=m
+CONFIG_FB_VIRTUAL=m
##
## file: drivers/virtio/Kconfig
##
-# CONFIG_VIRTIO_PCI is not set
-# CONFIG_VIRTIO_BALLOON is not set
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_BALLOON=y
##
## file: drivers/watchdog/Kconfig
@@ -719,11 +915,33 @@ CONFIG_NETROM=m
CONFIG_ROSE=m
##
+## file: net/decnet/Kconfig
+##
+CONFIG_DECNET=m
+CONFIG_DECNET_ROUTER=y
+
+##
## file: net/ipv6/Kconfig
##
CONFIG_IPV6=m
##
+## file: net/ipx/Kconfig
+##
+CONFIG_IPX=m
+CONFIG_IPX_INTERN=y
+
+##
+## file: net/irda/Kconfig
+##
+# CONFIG_IRDA is not set
+
+##
+## file: net/lapb/Kconfig
+##
+# CONFIG_LAPB is not set
+
+##
## file: net/mpls/Kconfig
##
# CONFIG_NET_MPLS_GSO is not set
diff --git a/debian/config/armel/config.versatile b/debian/config/armel/config.versatile
deleted file mode 100644
index af5c2e6..0000000
--- a/debian/config/armel/config.versatile
+++ /dev/null
@@ -1,451 +0,0 @@
-##
-## file: arch/arm/Kconfig
-##
-## choice: ARM system type
-CONFIG_ARCH_VERSATILE=y
-## end choice
-CONFIG_PCI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE=""
-# CONFIG_XIP_KERNEL is not set
-CONFIG_ATAGS_PROC=y
-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_NWFPE_XP is not set
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_VFP=y
-
-##
-## file: arch/arm/Kconfig.debug
-##
-# CONFIG_DEBUG_USER is not set
-
-##
-## file: arch/arm/mach-imx/Kconfig
-##
-# CONFIG_ARCH_MXC is not set
-
-##
-## file: arch/arm/mach-versatile/Kconfig
-##
-CONFIG_ARCH_VERSATILE_PB=y
-CONFIG_MACH_VERSATILE_AB=y
-
-##
-## file: arch/arm/mm/Kconfig
-##
-CONFIG_CPU_ARM926T=y
-CONFIG_ARM_THUMB=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
-
-##
-## file: drivers/ata/Kconfig
-##
-CONFIG_ATA=m
-CONFIG_SATA_AHCI=m
-CONFIG_SATA_SIL24=m
-# CONFIG_PDC_ADMA is not set
-# CONFIG_SATA_QSTOR is not set
-CONFIG_SATA_SX4=m
-# CONFIG_ATA_PIIX is not set
-# CONFIG_SATA_MV is not set
-# CONFIG_SATA_NV is not set
-CONFIG_SATA_PROMISE=m
-CONFIG_SATA_SIL=m
-# CONFIG_SATA_SIS is not set
-# CONFIG_SATA_SVW is not set
-# CONFIG_SATA_ULI is not set
-CONFIG_SATA_VIA=m
-# CONFIG_SATA_VITESSE is not set
-# CONFIG_PATA_ALI is not set
-# CONFIG_PATA_AMD is not set
-# CONFIG_PATA_ARTOP is not set
-# CONFIG_PATA_ATIIXP is not set
-# CONFIG_PATA_CMD64X is not set
-# CONFIG_PATA_CS5520 is not set
-# CONFIG_PATA_CYPRESS is not set
-# CONFIG_PATA_EFAR is not set
-# CONFIG_PATA_HPT366 is not set
-# CONFIG_PATA_HPT37X is not set
-# CONFIG_PATA_HPT3X2N is not set
-# CONFIG_PATA_HPT3X3 is not set
-# CONFIG_PATA_IT8213 is not set
-# CONFIG_PATA_IT821X is not set
-# CONFIG_PATA_JMICRON is not set
-# CONFIG_PATA_MARVELL is not set
-# CONFIG_PATA_NETCELL is not set
-# CONFIG_PATA_NS87415 is not set
-# CONFIG_PATA_OLDPIIX is not set
-# CONFIG_PATA_OPTIDMA is not set
-# CONFIG_PATA_PDC2027X is not set
-# CONFIG_PATA_PDC_OLD is not set
-# CONFIG_PATA_RADISYS is not set
-# CONFIG_PATA_SC1200 is not set
-# CONFIG_PATA_SERVERWORKS is not set
-# CONFIG_PATA_SIL680 is not set
-# CONFIG_PATA_SIS is not set
-# CONFIG_PATA_TRIFLEX is not set
-# CONFIG_PATA_VIA is not set
-# CONFIG_PATA_WINBOND is not set
-# CONFIG_PATA_CMD640_PCI is not set
-# CONFIG_PATA_MPIIX is not set
-# CONFIG_PATA_NS87410 is not set
-# CONFIG_PATA_OPTI is not set
-# CONFIG_PATA_RZ1000 is not set
-# CONFIG_ATA_GENERIC is not set
-
-##
-## file: drivers/atm/Kconfig
-##
-CONFIG_ATM_DRIVERS=y
-# CONFIG_ATM_DUMMY is not set
-# CONFIG_ATM_TCP is not set
-# CONFIG_ATM_LANAI is not set
-# CONFIG_ATM_ENI is not set
-# CONFIG_ATM_FIRESTREAM is not set
-# CONFIG_ATM_ZATM is not set
-# CONFIG_ATM_NICSTAR is not set
-# CONFIG_ATM_IDT77252 is not set
-# CONFIG_ATM_AMBASSADOR is not set
-# CONFIG_ATM_HORIZON is not set
-# CONFIG_ATM_IA is not set
-# CONFIG_ATM_HE is not set
-
-##
-## file: drivers/char/Kconfig
-##
-# CONFIG_NVRAM is not set
-# CONFIG_APPLICOM is not set
-
-##
-## file: drivers/i2c/Kconfig
-##
-CONFIG_I2C=m
-
-##
-## file: drivers/i2c/busses/Kconfig
-##
-# CONFIG_I2C_ISCH is not set
-# CONFIG_I2C_OCORES is not set
-CONFIG_I2C_PCA_PLATFORM=m
-# CONFIG_I2C_SIMTEC is not set
-CONFIG_I2C_VERSATILE=m
-
-##
-## file: drivers/input/keyboard/Kconfig
-##
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-CONFIG_KEYBOARD_STOWAWAY=m
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-
-##
-## file: drivers/input/serio/Kconfig
-##
-CONFIG_SERIO=y
-CONFIG_SERIO_SERPORT=y
-CONFIG_SERIO_AMBAKMI=y
-# CONFIG_SERIO_PCIPS2 is not set
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-
-##
-## file: drivers/input/touchscreen/Kconfig
-##
-# CONFIG_INPUT_TOUCHSCREEN is not set
-
-##
-## file: drivers/net/Kconfig
-##
-# CONFIG_NET_FC is not set
-CONFIG_IFB=m
-
-##
-## file: drivers/net/arcnet/Kconfig
-##
-# CONFIG_ARCNET is not set
-
-##
-## file: drivers/net/ethernet/Kconfig
-##
-CONFIG_FEALNX=m
-
-##
-## file: drivers/net/ethernet/3com/Kconfig
-##
-CONFIG_NET_VENDOR_3COM=y
-CONFIG_VORTEX=m
-CONFIG_TYPHOON=m
-
-##
-## file: drivers/net/ethernet/8390/Kconfig
-##
-# CONFIG_AX88796 is not set
-CONFIG_NE2K_PCI=m
-
-##
-## file: drivers/net/ethernet/adaptec/Kconfig
-##
-CONFIG_ADAPTEC_STARFIRE=m
-
-##
-## file: drivers/net/ethernet/alteon/Kconfig
-##
-# CONFIG_ACENIC is not set
-
-##
-## file: drivers/net/ethernet/amd/Kconfig
-##
-CONFIG_AMD8111_ETH=m
-
-##
-## file: drivers/net/ethernet/broadcom/Kconfig
-##
-# CONFIG_B44 is not set
-# CONFIG_BNX2 is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_BNX2X is not set
-
-##
-## file: drivers/net/ethernet/davicom/Kconfig
-##
-# CONFIG_DM9000 is not set
-
-##
-## file: drivers/net/ethernet/dlink/Kconfig
-##
-CONFIG_SUNDANCE=m
-# CONFIG_SUNDANCE_MMIO is not set
-
-##
-## file: drivers/net/ethernet/hp/Kconfig
-##
-CONFIG_HP100=m
-
-##
-## file: drivers/net/ethernet/intel/Kconfig
-##
-CONFIG_E100=m
-
-##
-## file: drivers/net/ethernet/natsemi/Kconfig
-##
-CONFIG_NATSEMI=m
-
-##
-## file: drivers/net/ethernet/nvidia/Kconfig
-##
-# CONFIG_FORCEDETH is not set
-
-##
-## file: drivers/net/ethernet/realtek/Kconfig
-##
-CONFIG_8139CP=m
-CONFIG_8139TOO=m
-# CONFIG_8139TOO_PIO is not set
-CONFIG_8139TOO_TUNE_TWISTER=y
-CONFIG_8139TOO_8129=y
-# CONFIG_8139_OLD_RX_RESET is not set
-
-##
-## file: drivers/net/ethernet/silan/Kconfig
-##
-CONFIG_SC92031=m
-
-##
-## file: drivers/net/ethernet/sis/Kconfig
-##
-CONFIG_SIS900=m
-
-##
-## file: drivers/net/ethernet/smsc/Kconfig
-##
-CONFIG_SMC91X=m
-CONFIG_EPIC100=m
-
-##
-## file: drivers/net/ethernet/sun/Kconfig
-##
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_CASSINI is not set
-
-##
-## file: drivers/net/ethernet/ti/Kconfig
-##
-# CONFIG_TLAN is not set
-
-##
-## file: drivers/net/ethernet/via/Kconfig
-##
-CONFIG_VIA_RHINE=m
-# CONFIG_VIA_RHINE_MMIO is not set
-
-##
-## file: drivers/net/fddi/Kconfig
-##
-# CONFIG_FDDI is not set
-
-##
-## file: drivers/net/hippi/Kconfig
-##
-# CONFIG_HIPPI is not set
-
-##
-## file: drivers/pci/Kconfig
-##
-CONFIG_PCI_IOV=y
-
-##
-## file: drivers/pcmcia/Kconfig
-##
-# CONFIG_PCCARD is not set
-
-##
-## file: drivers/rtc/Kconfig
-##
-CONFIG_RTC_DRV_PL031=y
-
-##
-## file: drivers/scsi/Kconfig
-##
-CONFIG_SCSI_SYM53C8XX_2=m
-
-##
-## file: drivers/spi/Kconfig
-##
-# CONFIG_SPI is not set
-
-##
-## file: drivers/tty/Kconfig
-##
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-##
-## file: drivers/tty/serial/Kconfig
-##
-CONFIG_SERIAL_AMBA_PL011=y
-CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-# CONFIG_SERIAL_JSM is not set
-
-##
-## file: drivers/tty/serial/8250/Kconfig
-##
-# CONFIG_SERIAL_8250 is not set
-
-##
-## file: drivers/usb/Kconfig
-##
-CONFIG_USB_SUPPORT=y
-CONFIG_USB=m
-
-##
-## file: drivers/usb/host/Kconfig
-##
-CONFIG_USB_EHCI_HCD=m
-CONFIG_USB_ISP116X_HCD=m
-CONFIG_USB_OHCI_HCD=m
-# CONFIG_USB_OHCI_HCD_SSB is not set
-CONFIG_USB_UHCI_HCD=m
-# CONFIG_USB_U132_HCD is not set
-# CONFIG_USB_SL811_HCD is not set
-# CONFIG_USB_R8A66597_HCD is not set
-
-##
-## file: drivers/video/backlight/Kconfig
-##
-CONFIG_BACKLIGHT_CLASS_DEVICE=m
-
-##
-## file: drivers/video/console/Kconfig
-##
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-
-##
-## file: drivers/video/fbdev/Kconfig
-##
-CONFIG_FB=y
-CONFIG_FIRMWARE_EDID=y
-CONFIG_FB_MODE_HELPERS=y
-CONFIG_FB_TILEBLITTING=y
-CONFIG_FB_CIRRUS=m
-# CONFIG_FB_PM2 is not set
-CONFIG_FB_ARMCLCD=y
-# CONFIG_FB_CYBER2000 is not set
-# CONFIG_FB_ASILIANT is not set
-# CONFIG_FB_IMSTT is not set
-# CONFIG_FB_S1D13XXX is not set
-# CONFIG_FB_MATROX is not set
-# CONFIG_FB_RADEON is not set
-# CONFIG_FB_ATY128 is not set
-# CONFIG_FB_ATY is not set
-CONFIG_FB_S3=m
-CONFIG_FB_S3_DDC=y
-# CONFIG_FB_SAVAGE is not set
-# CONFIG_FB_SIS is not set
-# CONFIG_FB_NEOMAGIC is not set
-# CONFIG_FB_KYRO is not set
-# CONFIG_FB_3DFX is not set
-# CONFIG_FB_VOODOO1 is not set
-# CONFIG_FB_VT8623 is not set
-# CONFIG_FB_TRIDENT is not set
-CONFIG_FB_ARK=m
-CONFIG_FB_PM3=m
-CONFIG_FB_SM501=m
-CONFIG_FB_VIRTUAL=m
-
-##
-## file: drivers/virtio/Kconfig
-##
-CONFIG_VIRTIO_PCI=y
-CONFIG_VIRTIO_BALLOON=y
-
-##
-## file: lib/Kconfig.debug
-##
-CONFIG_ENABLE_WARN_DEPRECATED=y
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_UNUSED_SYMBOLS=y
-# CONFIG_HEADERS_CHECK is not set
-CONFIG_DEBUG_BUGVERBOSE=y
-
-##
-## file: mm/Kconfig
-##
-## choice: Memory model
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-## end choice
-
-##
-## file: net/decnet/Kconfig
-##
-CONFIG_DECNET=m
-CONFIG_DECNET_ROUTER=y
-
-##
-## file: net/ipx/Kconfig
-##
-CONFIG_IPX=m
-CONFIG_IPX_INTERN=y
-
-##
-## file: net/irda/Kconfig
-##
-# CONFIG_IRDA is not set
-
-##
-## file: net/lapb/Kconfig
-##
-# CONFIG_LAPB is not set
-
diff --git a/debian/config/armel/defines b/debian/config/armel/defines
index 7913c37..be7c730 100644
--- a/debian/config/armel/defines
+++ b/debian/config/armel/defines
@@ -1,7 +1,6 @@
[base]
flavours:
- marvell
- versatile
+ armv5
kernel-arch: arm
[build]
@@ -17,12 +16,13 @@ install-stem: vmlinuz
[relations]
headers%gcc-4.9: linux-compiler-gcc-4.9-arm
-[marvell_description]
-hardware: Marvell Kirkwood/Orion
-hardware-long: Marvell Kirkwood based systems (SheevaPlug, QNAP TS-119/TS-219, etc)
- and Orion 5181, 5182 and 5281 based systems (QNAP TS-109/TS-209, etc)
+[armv5_description]
+hardware: ARMv5 multiplatform compatible systems
+hardware-long: Marvell Kirkwood based systems (SheevaPlug, QNAP TS-119/TS-219, etc);
+ Marvell Orion 5181, 5182 and 5281 based systems (QNAP TS-109/TS-209, etc); and
+ Versatile systems (PB, AB, Qemu)
-[marvell_image]
+[armv5_image]
recommends: u-boot-tools
## Maximum kernel size for supported devices (64 bytes is the u-boot header)
# SheevaPlug: 4194304 - 64 = 4194240
@@ -33,7 +33,3 @@ recommends: u-boot-tools
check-size: 2097080
check-size-with-dtb: true
breaks: flash-kernel (<< 3.37~)
-
-[versatile_description]
-hardware: Versatile
-hardware-long: Versatile systems (PB, AB, Qemu)
diff --git a/debian/installer/armel/kernel-versions b/debian/installer/armel/kernel-versions
index 501fd06..c3d4425 100644
--- a/debian/installer/armel/kernel-versions
+++ b/debian/installer/armel/kernel-versions
@@ -1,3 +1,2 @@
# arch version flavour installedname suffix build-depends
-armel - marvell - y -
-armel - versatile - y -
+armel - armv5 - y -
diff --git a/debian/installer/armel/modules/armel-marvell/btrfs-modules b/debian/installer/armel/modules/armel-armv5/btrfs-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/btrfs-modules
rename to debian/installer/armel/modules/armel-armv5/btrfs-modules
diff --git a/debian/installer/armel/modules/armel-marvell/cdrom-core-modules b/debian/installer/armel/modules/armel-armv5/cdrom-core-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/cdrom-core-modules
rename to debian/installer/armel/modules/armel-armv5/cdrom-core-modules
diff --git a/debian/installer/armel/modules/armel-marvell/core-modules b/debian/installer/armel/modules/armel-armv5/core-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/core-modules
rename to debian/installer/armel/modules/armel-armv5/core-modules
diff --git a/debian/installer/armel/modules/armel-marvell/crc-modules b/debian/installer/armel/modules/armel-armv5/crc-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/crc-modules
rename to debian/installer/armel/modules/armel-armv5/crc-modules
diff --git a/debian/installer/armel/modules/armel-marvell/crypto-dm-modules b/debian/installer/armel/modules/armel-armv5/crypto-dm-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/crypto-dm-modules
rename to debian/installer/armel/modules/armel-armv5/crypto-dm-modules
diff --git a/debian/installer/armel/modules/armel-marvell/crypto-modules b/debian/installer/armel/modules/armel-armv5/crypto-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/crypto-modules
rename to debian/installer/armel/modules/armel-armv5/crypto-modules
diff --git a/debian/installer/armel/modules/armel-marvell/event-modules b/debian/installer/armel/modules/armel-armv5/event-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/event-modules
rename to debian/installer/armel/modules/armel-armv5/event-modules
diff --git a/debian/installer/armel/modules/armel-marvell/ext4-modules b/debian/installer/armel/modules/armel-armv5/ext4-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/ext4-modules
rename to debian/installer/armel/modules/armel-armv5/ext4-modules
diff --git a/debian/installer/armel/modules/armel-marvell/fat-modules b/debian/installer/armel/modules/armel-armv5/fat-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/fat-modules
rename to debian/installer/armel/modules/armel-armv5/fat-modules
diff --git a/debian/installer/armel/modules/armel-marvell/fb-modules b/debian/installer/armel/modules/armel-armv5/fb-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/fb-modules
rename to debian/installer/armel/modules/armel-armv5/fb-modules
diff --git a/debian/installer/armel/modules/armel-marvell/fuse-modules b/debian/installer/armel/modules/armel-armv5/fuse-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/fuse-modules
rename to debian/installer/armel/modules/armel-armv5/fuse-modules
diff --git a/debian/installer/armel/modules/armel-marvell/input-modules b/debian/installer/armel/modules/armel-armv5/input-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/input-modules
rename to debian/installer/armel/modules/armel-armv5/input-modules
diff --git a/debian/installer/armel/modules/armel-marvell/ipv6-modules b/debian/installer/armel/modules/armel-armv5/ipv6-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/ipv6-modules
rename to debian/installer/armel/modules/armel-armv5/ipv6-modules
diff --git a/debian/installer/armel/modules/armel-marvell/isofs-modules b/debian/installer/armel/modules/armel-armv5/isofs-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/isofs-modules
rename to debian/installer/armel/modules/armel-armv5/isofs-modules
diff --git a/debian/installer/armel/modules/armel-marvell/jffs2-modules b/debian/installer/armel/modules/armel-armv5/jffs2-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/jffs2-modules
rename to debian/installer/armel/modules/armel-armv5/jffs2-modules
diff --git a/debian/installer/armel/modules/armel-marvell/jfs-modules b/debian/installer/armel/modules/armel-armv5/jfs-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/jfs-modules
rename to debian/installer/armel/modules/armel-armv5/jfs-modules
diff --git a/debian/installer/armel/modules/armel-marvell/kernel-image b/debian/installer/armel/modules/armel-armv5/kernel-image
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/kernel-image
rename to debian/installer/armel/modules/armel-armv5/kernel-image
diff --git a/debian/installer/armel/modules/armel-marvell/leds-modules b/debian/installer/armel/modules/armel-armv5/leds-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/leds-modules
rename to debian/installer/armel/modules/armel-armv5/leds-modules
diff --git a/debian/installer/armel/modules/armel-marvell/loop-modules b/debian/installer/armel/modules/armel-armv5/loop-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/loop-modules
rename to debian/installer/armel/modules/armel-armv5/loop-modules
diff --git a/debian/installer/armel/modules/armel-marvell/md-modules b/debian/installer/armel/modules/armel-armv5/md-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/md-modules
rename to debian/installer/armel/modules/armel-armv5/md-modules
diff --git a/debian/installer/armel/modules/armel-marvell/minix-modules b/debian/installer/armel/modules/armel-armv5/minix-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/minix-modules
rename to debian/installer/armel/modules/armel-armv5/minix-modules
diff --git a/debian/installer/armel/modules/armel-marvell/mmc-modules b/debian/installer/armel/modules/armel-armv5/mmc-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/mmc-modules
rename to debian/installer/armel/modules/armel-armv5/mmc-modules
diff --git a/debian/installer/armel/modules/armel-marvell/mouse-modules b/debian/installer/armel/modules/armel-armv5/mouse-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/mouse-modules
rename to debian/installer/armel/modules/armel-armv5/mouse-modules
diff --git a/debian/installer/armel/modules/armel-marvell/mtd-modules b/debian/installer/armel/modules/armel-armv5/mtd-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/mtd-modules
rename to debian/installer/armel/modules/armel-armv5/mtd-modules
diff --git a/debian/installer/armel/modules/armel-marvell/multipath-modules b/debian/installer/armel/modules/armel-armv5/multipath-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/multipath-modules
rename to debian/installer/armel/modules/armel-armv5/multipath-modules
diff --git a/debian/installer/armel/modules/armel-marvell/nbd-modules b/debian/installer/armel/modules/armel-armv5/nbd-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/nbd-modules
rename to debian/installer/armel/modules/armel-armv5/nbd-modules
diff --git a/debian/installer/armel/modules/armel-versatile/nic-modules b/debian/installer/armel/modules/armel-armv5/nic-modules
similarity index 65%
rename from debian/installer/armel/modules/armel-versatile/nic-modules
rename to debian/installer/armel/modules/armel-armv5/nic-modules
index 2fcb2d3..5d523dd 100644
--- a/debian/installer/armel/modules/armel-versatile/nic-modules
+++ b/debian/installer/armel/modules/armel-armv5/nic-modules
@@ -1,6 +1,9 @@
3c59x ?
8139too ?
e100 ?
+inet_lro
+mv643xx_eth
+mvmdio
natsemi ?
ne2k-pci ?
smc91x
diff --git a/debian/installer/armel/modules/armel-marvell/nic-shared-modules b/debian/installer/armel/modules/armel-armv5/nic-shared-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/nic-shared-modules
rename to debian/installer/armel/modules/armel-armv5/nic-shared-modules
diff --git a/debian/installer/armel/modules/armel-marvell/nic-usb-modules b/debian/installer/armel/modules/armel-armv5/nic-usb-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/nic-usb-modules
rename to debian/installer/armel/modules/armel-armv5/nic-usb-modules
diff --git a/debian/installer/armel/modules/armel-marvell/ppp-modules b/debian/installer/armel/modules/armel-armv5/ppp-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/ppp-modules
rename to debian/installer/armel/modules/armel-armv5/ppp-modules
diff --git a/debian/installer/armel/modules/armel-versatile/sata-modules b/debian/installer/armel/modules/armel-armv5/sata-modules
similarity index 64%
rename from debian/installer/armel/modules/armel-versatile/sata-modules
rename to debian/installer/armel/modules/armel-armv5/sata-modules
index 01318c2..0e9826c 100644
--- a/debian/installer/armel/modules/armel-versatile/sata-modules
+++ b/debian/installer/armel/modules/armel-armv5/sata-modules
@@ -1 +1,3 @@
#include <sata-modules>
+ahci
+sata_mv
diff --git a/debian/installer/armel/modules/armel-versatile/scsi-common-modules b/debian/installer/armel/modules/armel-armv5/scsi-common-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-versatile/scsi-common-modules
rename to debian/installer/armel/modules/armel-armv5/scsi-common-modules
diff --git a/debian/installer/armel/modules/armel-marvell/scsi-core-modules b/debian/installer/armel/modules/armel-armv5/scsi-core-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/scsi-core-modules
rename to debian/installer/armel/modules/armel-armv5/scsi-core-modules
diff --git a/debian/installer/armel/modules/armel-marvell/squashfs-modules b/debian/installer/armel/modules/armel-armv5/squashfs-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/squashfs-modules
rename to debian/installer/armel/modules/armel-armv5/squashfs-modules
diff --git a/debian/installer/armel/modules/armel-marvell/udf-modules b/debian/installer/armel/modules/armel-armv5/udf-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/udf-modules
rename to debian/installer/armel/modules/armel-armv5/udf-modules
diff --git a/debian/installer/armel/modules/armel-marvell/uinput-modules b/debian/installer/armel/modules/armel-armv5/uinput-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/uinput-modules
rename to debian/installer/armel/modules/armel-armv5/uinput-modules
diff --git a/debian/installer/armel/modules/armel-marvell/usb-modules b/debian/installer/armel/modules/armel-armv5/usb-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/usb-modules
rename to debian/installer/armel/modules/armel-armv5/usb-modules
diff --git a/debian/installer/armel/modules/armel-marvell/usb-serial-modules b/debian/installer/armel/modules/armel-armv5/usb-serial-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/usb-serial-modules
rename to debian/installer/armel/modules/armel-armv5/usb-serial-modules
diff --git a/debian/installer/armel/modules/armel-marvell/usb-storage-modules b/debian/installer/armel/modules/armel-armv5/usb-storage-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/usb-storage-modules
rename to debian/installer/armel/modules/armel-armv5/usb-storage-modules
diff --git a/debian/installer/armel/modules/armel-versatile/virtio-modules b/debian/installer/armel/modules/armel-armv5/virtio-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-versatile/virtio-modules
rename to debian/installer/armel/modules/armel-armv5/virtio-modules
diff --git a/debian/installer/armel/modules/armel-marvell/zlib-modules b/debian/installer/armel/modules/armel-armv5/zlib-modules
similarity index 100%
rename from debian/installer/armel/modules/armel-marvell/zlib-modules
rename to debian/installer/armel/modules/armel-armv5/zlib-modules
diff --git a/debian/installer/armel/modules/armel-marvell/nic-modules b/debian/installer/armel/modules/armel-marvell/nic-modules
deleted file mode 100644
index 9f90d9e..0000000
--- a/debian/installer/armel/modules/armel-marvell/nic-modules
+++ /dev/null
@@ -1,3 +0,0 @@
-inet_lro
-mv643xx_eth
-mvmdio
diff --git a/debian/installer/armel/modules/armel-marvell/sata-modules b/debian/installer/armel/modules/armel-marvell/sata-modules
deleted file mode 100644
index 3adbfa1..0000000
--- a/debian/installer/armel/modules/armel-marvell/sata-modules
+++ /dev/null
@@ -1,2 +0,0 @@
-ahci
-sata_mv
diff --git a/debian/installer/armel/modules/armel-versatile/btrfs-modules b/debian/installer/armel/modules/armel-versatile/btrfs-modules
deleted file mode 100644
index e261e13..0000000
--- a/debian/installer/armel/modules/armel-versatile/btrfs-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <btrfs-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/cdrom-core-modules b/debian/installer/armel/modules/armel-versatile/cdrom-core-modules
deleted file mode 100644
index e264d7a..0000000
--- a/debian/installer/armel/modules/armel-versatile/cdrom-core-modules
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <cdrom-core-modules>
-
diff --git a/debian/installer/armel/modules/armel-versatile/core-modules b/debian/installer/armel/modules/armel-versatile/core-modules
deleted file mode 100644
index f05d062..0000000
--- a/debian/installer/armel/modules/armel-versatile/core-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <core-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/crc-modules b/debian/installer/armel/modules/armel-versatile/crc-modules
deleted file mode 100644
index 7e00de7..0000000
--- a/debian/installer/armel/modules/armel-versatile/crc-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <crc-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/crypto-dm-modules b/debian/installer/armel/modules/armel-versatile/crypto-dm-modules
deleted file mode 100644
index 4c8f235..0000000
--- a/debian/installer/armel/modules/armel-versatile/crypto-dm-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <crypto-dm-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/crypto-modules b/debian/installer/armel/modules/armel-versatile/crypto-modules
deleted file mode 100644
index 3a1e862..0000000
--- a/debian/installer/armel/modules/armel-versatile/crypto-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <crypto-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/ext4-modules b/debian/installer/armel/modules/armel-versatile/ext4-modules
deleted file mode 100644
index 394c577..0000000
--- a/debian/installer/armel/modules/armel-versatile/ext4-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <ext4-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/fat-modules b/debian/installer/armel/modules/armel-versatile/fat-modules
deleted file mode 100644
index 274584e..0000000
--- a/debian/installer/armel/modules/armel-versatile/fat-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <fat-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/fuse-modules b/debian/installer/armel/modules/armel-versatile/fuse-modules
deleted file mode 100644
index 0b6ba0c..0000000
--- a/debian/installer/armel/modules/armel-versatile/fuse-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <fuse-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/isofs-modules b/debian/installer/armel/modules/armel-versatile/isofs-modules
deleted file mode 100644
index da4fa9a..0000000
--- a/debian/installer/armel/modules/armel-versatile/isofs-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <isofs-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/kernel-image b/debian/installer/armel/modules/armel-versatile/kernel-image
deleted file mode 100644
index 8b13789..0000000
--- a/debian/installer/armel/modules/armel-versatile/kernel-image
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/debian/installer/armel/modules/armel-versatile/loop-modules b/debian/installer/armel/modules/armel-versatile/loop-modules
deleted file mode 100644
index c1c948f..0000000
--- a/debian/installer/armel/modules/armel-versatile/loop-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <loop-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/md-modules b/debian/installer/armel/modules/armel-versatile/md-modules
deleted file mode 100644
index 26115e1..0000000
--- a/debian/installer/armel/modules/armel-versatile/md-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <md-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/multipath-modules b/debian/installer/armel/modules/armel-versatile/multipath-modules
deleted file mode 100644
index a8b69b2..0000000
--- a/debian/installer/armel/modules/armel-versatile/multipath-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <multipath-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/nbd-modules b/debian/installer/armel/modules/armel-versatile/nbd-modules
deleted file mode 100644
index 3c9b3e5..0000000
--- a/debian/installer/armel/modules/armel-versatile/nbd-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <nbd-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/nic-shared-modules b/debian/installer/armel/modules/armel-versatile/nic-shared-modules
deleted file mode 100644
index cc84b14..0000000
--- a/debian/installer/armel/modules/armel-versatile/nic-shared-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <nic-shared-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/nic-usb-modules b/debian/installer/armel/modules/armel-versatile/nic-usb-modules
deleted file mode 100644
index c479669..0000000
--- a/debian/installer/armel/modules/armel-versatile/nic-usb-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <nic-usb-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/ppp-modules b/debian/installer/armel/modules/armel-versatile/ppp-modules
deleted file mode 100644
index f1ae9b3..0000000
--- a/debian/installer/armel/modules/armel-versatile/ppp-modules
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <ppp-modules>
-
diff --git a/debian/installer/armel/modules/armel-versatile/scsi-core-modules b/debian/installer/armel/modules/armel-versatile/scsi-core-modules
deleted file mode 100644
index dd65d66..0000000
--- a/debian/installer/armel/modules/armel-versatile/scsi-core-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <scsi-core-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/squashfs-modules b/debian/installer/armel/modules/armel-versatile/squashfs-modules
deleted file mode 100644
index 42d7788..0000000
--- a/debian/installer/armel/modules/armel-versatile/squashfs-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <squashfs-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/udf-modules b/debian/installer/armel/modules/armel-versatile/udf-modules
deleted file mode 100644
index b90d7ee..0000000
--- a/debian/installer/armel/modules/armel-versatile/udf-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <udf-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/usb-modules b/debian/installer/armel/modules/armel-versatile/usb-modules
deleted file mode 100644
index c598ded..0000000
--- a/debian/installer/armel/modules/armel-versatile/usb-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <usb-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/usb-serial-modules b/debian/installer/armel/modules/armel-versatile/usb-serial-modules
deleted file mode 100644
index c0a0dc3..0000000
--- a/debian/installer/armel/modules/armel-versatile/usb-serial-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <usb-serial-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/usb-storage-modules b/debian/installer/armel/modules/armel-versatile/usb-storage-modules
deleted file mode 100644
index 8c5e81b..0000000
--- a/debian/installer/armel/modules/armel-versatile/usb-storage-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <usb-storage-modules>
diff --git a/debian/installer/armel/modules/armel-versatile/zlib-modules b/debian/installer/armel/modules/armel-versatile/zlib-modules
deleted file mode 100644
index e02ad64..0000000
--- a/debian/installer/armel/modules/armel-versatile/zlib-modules
+++ /dev/null
@@ -1 +0,0 @@
-#include <zlib-modules>
diff --git a/debian/patches/features/arm/arm-debug-ll-rework-integrator-versatile-handling.patch b/debian/patches/features/arm/arm-debug-ll-rework-integrator-versatile-handling.patch
new file mode 100644
index 0000000..0ed0d94
--- /dev/null
+++ b/debian/patches/features/arm/arm-debug-ll-rework-integrator-versatile-handling.patch
@@ -0,0 +1,78 @@
+From: Arnd Bergmann <arnd at arndb.de>
+Date: Thu, 3 Dec 2015 17:54:05 +0100
+Subject: ARM: debug-ll: rework integrator/versatile handling
+Origin: https://git.kernel.org/linus/4db22c1033ce240dd75237fe911375671c191224
+
+Enabling one of the integrator platforms in a multiplatform kernel
+while trying to use DEBUG_LL for another platform can default to
+the wrong UART address, as the options are purely based on the
+architecture being enabled or not.
+
+This changes the logic to use the integrator default addresses only
+if we have also picked the respective Kconfig symbols introduced
+here. Versatile is not yet part of multiplatform, but hopefully
+soon will be, so we do the same change for versatile as well.
+
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+---
+ arch/arm/Kconfig.debug | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+--- a/arch/arm/Kconfig.debug
++++ b/arch/arm/Kconfig.debug
+@@ -430,6 +430,14 @@ choice
+ Say Y here if you want kernel low-level debugging support
+ on i.MX7D.
+
++ config DEBUG_INTEGRATOR
++ bool "Kernel low-level debugging messages via ARM Integrator UART"
++ depends on ARCH_INTEGRATOR
++ select DEBUG_UART_PL01X
++ help
++ Say Y here if you want kernel low-level debugging support
++ on ARM Integrator platforms.
++
+ config DEBUG_KEYSTONE_UART0
+ bool "Kernel low-level debugging on KEYSTONE2 using UART0"
+ depends on ARCH_KEYSTONE
+@@ -1108,6 +1116,14 @@ choice
+ Say Y here if you want kernel low-level debugging support
+ for Mediatek mt6589 based platforms on UART0.
+
++ config DEBUG_VERSATILE
++ bool "Kernel low-level debugging messages via ARM Versatile UART"
++ depends on ARCH_VERSATILE
++ select DEBUG_UART_PL01X
++ help
++ Say Y here if you want kernel low-level debugging support
++ on ARM Versatile platforms.
++
+ config DEBUG_MT8127_UART0
+ bool "Mediatek mt8127/mt6592 UART0"
+ depends on ARCH_MEDIATEK
+@@ -1392,12 +1408,12 @@ config DEBUG_UART_PHYS
+ default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT
+ default 0x10124000 if DEBUG_RK3X_UART0
+ default 0x10126000 if DEBUG_RK3X_UART1
+- default 0x101f1000 if ARCH_VERSATILE
++ default 0x101f1000 if DEBUG_VERSATILE
+ default 0x101fb000 if DEBUG_NOMADIK_UART
+ default 0x11002000 if DEBUG_MT8127_UART0
+ default 0x11006000 if DEBUG_MT6589_UART0
+ default 0x11009000 if DEBUG_MT8135_UART3
+- default 0x16000000 if ARCH_INTEGRATOR
++ default 0x16000000 if DEBUG_INTEGRATOR
+ default 0x18000300 if DEBUG_BCM_5301X
+ default 0x18010000 if DEBUG_SIRFATLAS7_UART0
+ default 0x18020000 if DEBUG_SIRFATLAS7_UART1
+@@ -1496,8 +1512,8 @@ config DEBUG_UART_VIRT
+ default 0xf1002000 if DEBUG_MT8127_UART0
+ default 0xf1006000 if DEBUG_MT6589_UART0
+ default 0xf1009000 if DEBUG_MT8135_UART3
+- default 0xf11f1000 if ARCH_VERSATILE
+- default 0xf1600000 if ARCH_INTEGRATOR
++ default 0xf11f1000 if DEBUG_VERSATILE
++ default 0xf1600000 if DEBUG_INTEGRATOR
+ default 0xf1c28000 if DEBUG_SUNXI_UART0
+ default 0xf1c28400 if DEBUG_SUNXI_UART1
+ default 0xf1f02800 if DEBUG_SUNXI_R_UART
diff --git a/debian/patches/features/arm/arm-versatile-add-dt-based-pci-detection.patch b/debian/patches/features/arm/arm-versatile-add-dt-based-pci-detection.patch
new file mode 100644
index 0000000..36a3b63
--- /dev/null
+++ b/debian/patches/features/arm/arm-versatile-add-dt-based-pci-detection.patch
@@ -0,0 +1,87 @@
+From: Rob Herring <robh at kernel.org>
+Date: Tue, 8 Dec 2015 14:44:15 -0600
+Subject: [1/4] ARM: versatile: add DT based PCI detection
+Origin: https://git.kernel.org/linus/a8e2894c125f69aaea474592ebebd463bb7e1b0a
+
+Disable the Versatile PCI DT node when no PCI backplane is detected. This
+will prevent the Versatile PCI driver from probing when PCI is not
+populated.
+
+Signed-off-by: Rob Herring <robh at kernel.org>
+Cc: Russell King <linux at arm.linux.org.uk>
+Cc: Linus Walleij <linus.walleij at linaro.org>
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+---
+ arch/arm/mach-versatile/versatile_dt.c | 50 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c
+index 7de3e92a13b0..a58575832fa3 100644
+--- a/arch/arm/mach-versatile/versatile_dt.c
++++ b/arch/arm/mach-versatile/versatile_dt.c
+@@ -22,15 +22,65 @@
+ */
+
+ #include <linux/init.h>
++#include <linux/io.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
+ #include <linux/of_irq.h>
+ #include <linux/of_platform.h>
++#include <linux/slab.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+
+ #include "core.h"
+
++#define VERSATILE_SYS_PCICTL_OFFSET 0x44
++static void __iomem *versatile_sys_base;
++
++static void __init versatile_dt_pci_init(void)
++{
++ u32 val;
++ struct device_node *np;
++ struct property *newprop;
++
++ np = of_find_compatible_node(NULL, NULL, "arm,versatile-pci");
++ if (!np)
++ return;
++
++ /* Check if PCI backplane is detected */
++ val = readl(versatile_sys_base + VERSATILE_SYS_PCICTL_OFFSET);
++ if (val & 1) {
++ /*
++ * Enable PCI accesses. Note that the documentaton is
++ * inconsistent whether or not this is needed, but the old
++ * driver had it so we will keep it.
++ */
++ writel(1, versatile_sys_base + VERSATILE_SYS_PCICTL_OFFSET);
++ return;
++ }
++
++ newprop = kzalloc(sizeof(*newprop), GFP_KERNEL);
++ if (!newprop)
++ return;
++
++ newprop->name = kstrdup("status", GFP_KERNEL);
++ newprop->value = kstrdup("disabled", GFP_KERNEL);
++ newprop->length = sizeof("disabled");
++ of_update_property(np, newprop);
++
++ pr_info("Not plugged into PCI backplane!\n");
++}
++
+ static void __init versatile_dt_init(void)
+ {
++ struct device_node *np;
++
++ np = of_find_compatible_node(NULL, NULL, "arm,core-module-versatile");
++ if (np)
++ versatile_sys_base = of_iomap(np, 0);
++ WARN_ON(!versatile_sys_base);
++
++ versatile_dt_pci_init();
++
+ of_platform_populate(NULL, of_default_bus_match_table,
+ versatile_auxdata_lookup, NULL);
+ }
diff --git a/debian/patches/features/arm/arm-versatile-add-the-syscon-leds-to-the-dt.patch b/debian/patches/features/arm/arm-versatile-add-the-syscon-leds-to-the-dt.patch
new file mode 100644
index 0000000..6e4010d
--- /dev/null
+++ b/debian/patches/features/arm/arm-versatile-add-the-syscon-leds-to-the-dt.patch
@@ -0,0 +1,91 @@
+From: Linus Walleij <linus.walleij at linaro.org>
+Date: Tue, 5 Jan 2016 15:02:08 +0100
+Subject: ARM: versatile: add the syscon LEDs to the DT
+Origin: https://git.kernel.org/linus/07ebfa59b9db40ae29fbf2ef24ba7dc5fa8a5dad
+
+The device tree version of Versatile AP/PB never had LED support
+so we are missing LEDs from our hardware boards. Add this as
+syscon LEDs like we did for Integrator and Juno. We need to
+spawn devices in the syscon with "simple-mfd" for this to work.
+
+Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+---
+ arch/arm/boot/dts/versatile-ab.dts | 62 +++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 61 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts
+index 01f40197ea13..7b858258374b 100644
+--- a/arch/arm/boot/dts/versatile-ab.dts
++++ b/arch/arm/boot/dts/versatile-ab.dts
+@@ -30,9 +30,69 @@
+ };
+
+ core-module at 10000000 {
+- compatible = "arm,core-module-versatile", "syscon";
++ compatible = "arm,core-module-versatile", "syscon", "simple-mfd";
+ reg = <0x10000000 0x200>;
+
++ led at 08.0 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x01>;
++ label = "versatile:0";
++ linux,default-trigger = "heartbeat";
++ default-state = "on";
++ };
++ led at 08.1 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x02>;
++ label = "versatile:1";
++ linux,default-trigger = "mmc0";
++ default-state = "off";
++ };
++ led at 08.2 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x04>;
++ label = "versatile:2";
++ linux,default-trigger = "cpu0";
++ default-state = "off";
++ };
++ led at 08.3 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x08>;
++ label = "versatile:3";
++ default-state = "off";
++ };
++ led at 08.4 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x10>;
++ label = "versatile:4";
++ default-state = "off";
++ };
++ led at 08.5 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x20>;
++ label = "versatile:5";
++ default-state = "off";
++ };
++ led at 08.6 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x40>;
++ label = "versatile:6";
++ default-state = "off";
++ };
++ led at 08.7 {
++ compatible = "register-bit-led";
++ offset = <0x08>;
++ mask = <0x80>;
++ label = "versatile:7";
++ default-state = "off";
++ };
++
+ /* OSC1 on AB, OSC4 on PB */
+ osc1: cm_aux_osc at 24M {
+ #clock-cells = <0>;
diff --git a/debian/patches/features/arm/arm-versatile-convert-to-multi-platform.patch b/debian/patches/features/arm/arm-versatile-convert-to-multi-platform.patch
new file mode 100644
index 0000000..a5b59e1
--- /dev/null
+++ b/debian/patches/features/arm/arm-versatile-convert-to-multi-platform.patch
@@ -0,0 +1,147 @@
+From: Rob Herring <robh at kernel.org>
+Date: Tue, 8 Dec 2015 14:44:18 -0600
+Subject: [4/4] ARM: versatile: convert to multi-platform
+Origin: https://git.kernel.org/linus/a29da136de345f074d0c64f1c3b38eef30116b32
+
+Now that all the prerequisites are in place, we can enable Versatile
+boards for multi-platform kernels.
+
+Signed-off-by: Rob Herring <robh at kernel.org>
+Cc: Russell King <linux at arm.linux.org.uk>
+Cc: Linus Walleij <linus.walleij at linaro.org>
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+---
+ arch/arm/Kconfig | 22 +----------
+ arch/arm/configs/versatile_defconfig | 2 +-
+ arch/arm/mach-versatile/Kconfig | 16 ++++++++
+ arch/arm/mach-versatile/Makefile.boot | 4 --
+ arch/arm/mach-versatile/include/mach/uncompress.h | 45 -----------------------
+ 5 files changed, 19 insertions(+), 70 deletions(-)
+ create mode 100644 arch/arm/mach-versatile/Kconfig
+ delete mode 100644 arch/arm/mach-versatile/Makefile.boot
+ delete mode 100644 arch/arm/mach-versatile/include/mach/uncompress.h
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -362,26 +362,6 @@ config ARCH_REALVIEW
+ help
+ This enables support for ARM Ltd RealView boards.
+
+-config ARCH_VERSATILE
+- bool "ARM Ltd. Versatile family"
+- select ARCH_WANT_OPTIONAL_GPIOLIB
+- select ARM_AMBA
+- select ARM_TIMER_SP804
+- select ARM_VIC
+- select CLKSRC_VERSATILE
+- select COMMON_CLK
+- select COMMON_CLK_VERSATILE
+- select CPU_ARM926T
+- select GENERIC_CLOCKEVENTS
+- select ICST
+- select PLAT_VERSATILE
+- select MIGHT_HAVE_PCI
+- select SPARSE_IRQ
+- select USE_OF
+- select VERSATILE_FPGA_IRQ
+- help
+- This enables support for ARM Ltd Versatile board.
+-
+ config ARCH_CLPS711X
+ bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
+ select ARCH_REQUIRE_GPIOLIB
+@@ -918,6 +898,8 @@ source "arch/arm/mach-uniphier/Kconfig"
+
+ source "arch/arm/mach-ux500/Kconfig"
+
++source "arch/arm/mach-versatile/Kconfig"
++
+ source "arch/arm/mach-vexpress/Kconfig"
+ source "arch/arm/plat-versatile/Kconfig"
+
+--- a/arch/arm/configs/versatile_defconfig
++++ b/arch/arm/configs/versatile_defconfig
+@@ -6,8 +6,8 @@ CONFIG_SLAB=y
+ CONFIG_MODULES=y
+ CONFIG_MODULE_UNLOAD=y
+ CONFIG_PARTITION_ADVANCED=y
++# CONFIG_ARCH_MULTI_V7 is not set
+ CONFIG_ARCH_VERSATILE=y
+-CONFIG_MACH_VERSATILE_AB=y
+ CONFIG_AEABI=y
+ CONFIG_OABI_COMPAT=y
+ CONFIG_ZBOOT_ROM_TEXT=0x0
+--- /dev/null
++++ b/arch/arm/mach-versatile/Kconfig
+@@ -0,0 +1,16 @@
++config ARCH_VERSATILE
++ bool "ARM Ltd. Versatile family"
++ depends on ARCH_MULTI_V5
++ select ARM_AMBA
++ select ARM_TIMER_SP804
++ select ARM_VIC
++ select CLKSRC_VERSATILE
++ select COMMON_CLK_VERSATILE
++ select CPU_ARM926T
++ select ICST
++ select MIGHT_HAVE_PCI
++ select PLAT_VERSATILE
++ select VERSATILE_FPGA_IRQ
++ help
++ This enables support for ARM Ltd Versatile board.
++
+--- a/arch/arm/mach-versatile/Makefile.boot
++++ /dev/null
+@@ -1,4 +0,0 @@
+- zreladdr-y += 0x00008000
+-params_phys-y := 0x00000100
+-initrd_phys-y := 0x00800000
+-
+--- a/arch/arm/mach-versatile/include/mach/uncompress.h
++++ /dev/null
+@@ -1,45 +0,0 @@
+-/*
+- * arch/arm/mach-versatile/include/mach/uncompress.h
+- *
+- * Copyright (C) 2003 ARM Limited
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-#define AMBA_UART_DR (*(volatile unsigned char *)0x101F1000)
+-#define AMBA_UART_LCRH (*(volatile unsigned char *)0x101F102C)
+-#define AMBA_UART_CR (*(volatile unsigned char *)0x101F1030)
+-#define AMBA_UART_FR (*(volatile unsigned char *)0x101F1018)
+-
+-/*
+- * This does not append a newline
+- */
+-static inline void putc(int c)
+-{
+- while (AMBA_UART_FR & (1 << 5))
+- barrier();
+-
+- AMBA_UART_DR = c;
+-}
+-
+-static inline void flush(void)
+-{
+- while (AMBA_UART_FR & (1 << 3))
+- barrier();
+-}
+-
+-/*
+- * nothing to do
+- */
+-#define arch_decomp_setup()
diff --git a/debian/patches/features/arm/arm-versatile-merge-mach-code-into-a-single-file.patch b/debian/patches/features/arm/arm-versatile-merge-mach-code-into-a-single-file.patch
new file mode 100644
index 0000000..cec6838
--- /dev/null
+++ b/debian/patches/features/arm/arm-versatile-merge-mach-code-into-a-single-file.patch
@@ -0,0 +1,1061 @@
+From: Rob Herring <robh at kernel.org>
+Date: Tue, 8 Dec 2015 14:44:17 -0600
+Subject: [3/4] ARM: versatile: merge mach code into a single file
+Origin: https://git.kernel.org/linus/a70967892111934e292485ce84f1bab38cc55380
+
+With DT-only support now in place and most of the legacy code removed,
+the separation of core.c and versatile_dt.c makes little sense. The
+headers in mach include directory also have to move for multi-platform
+support, but with a single .c file the remaining definitions needed can
+also be moved into the versatile_dt.c.
+
+In the move, the system registers and IB2 registers are converted to
+run-time mappings and all register accesses converted to use
+readl/writel.
+
+Signed-off-by: Rob Herring <robh at kernel.org>
+Cc: Russell King <linux at arm.linux.org.uk>
+Cc: Linus Walleij <linus.walleij at linaro.org>
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+---
+ arch/arm/mach-versatile/Makefile | 2 +-
+ arch/arm/mach-versatile/core.c | 331 ------------------------
+ arch/arm/mach-versatile/core.h | 41 ---
+ arch/arm/mach-versatile/include/mach/hardware.h | 32 ---
+ arch/arm/mach-versatile/include/mach/platform.h | 242 -----------------
+ arch/arm/mach-versatile/versatile_dt.c | 325 ++++++++++++++++++++++-
+ 6 files changed, 325 insertions(+), 648 deletions(-)
+ delete mode 100644 arch/arm/mach-versatile/core.c
+ delete mode 100644 arch/arm/mach-versatile/core.h
+ delete mode 100644 arch/arm/mach-versatile/include/mach/hardware.h
+ delete mode 100644 arch/arm/mach-versatile/include/mach/platform.h
+
+diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile
+index ccef51284d0d..41b124b5107b 100644
+--- a/arch/arm/mach-versatile/Makefile
++++ b/arch/arm/mach-versatile/Makefile
+@@ -2,4 +2,4 @@
+ # Makefile for the linux kernel.
+ #
+
+-obj-y := core.o versatile_dt.o
++obj-y := versatile_dt.o
+diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
+deleted file mode 100644
+index 072ae192421c..000000000000
+--- a/arch/arm/mach-versatile/core.c
++++ /dev/null
+@@ -1,331 +0,0 @@
+-/*
+- * linux/arch/arm/mach-versatile/core.c
+- *
+- * Copyright (C) 1999 - 2003 ARM Limited
+- * Copyright (C) 2000 Deep Blue Solutions Ltd
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-#include <linux/init.h>
+-#include <linux/device.h>
+-#include <linux/dma-mapping.h>
+-#include <linux/platform_device.h>
+-#include <linux/interrupt.h>
+-#include <linux/of_platform.h>
+-#include <linux/amba/bus.h>
+-#include <linux/amba/clcd.h>
+-#include <linux/platform_data/video-clcd-versatile.h>
+-#include <linux/amba/mmci.h>
+-#include <linux/io.h>
+-#include <linux/mtd/physmap.h>
+-#include <linux/reboot.h>
+-
+-#include <asm/mach/arch.h>
+-#include <asm/mach/map.h>
+-#include <mach/hardware.h>
+-#include <mach/platform.h>
+-
+-#include "core.h"
+-
+-static struct map_desc versatile_io_desc[] __initdata __maybe_unused = {
+- {
+- .virtual = IO_ADDRESS(VERSATILE_SYS_BASE),
+- .pfn = __phys_to_pfn(VERSATILE_SYS_BASE),
+- .length = SZ_4K,
+- .type = MT_DEVICE
+- }, {
+- .virtual = IO_ADDRESS(VERSATILE_SCTL_BASE),
+- .pfn = __phys_to_pfn(VERSATILE_SCTL_BASE),
+- .length = SZ_4K * 9,
+- .type = MT_DEVICE
+- },
+- {
+- .virtual = IO_ADDRESS(VERSATILE_IB2_BASE),
+- .pfn = __phys_to_pfn(VERSATILE_IB2_BASE),
+- .length = SZ_64M,
+- .type = MT_DEVICE
+- },
+-};
+-
+-void __init versatile_map_io(void)
+-{
+- debug_ll_io_init();
+- iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc));
+-}
+-
+-
+-#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
+-
+-static void versatile_flash_set_vpp(struct platform_device *pdev, int on)
+-{
+- u32 val;
+-
+- val = __raw_readl(VERSATILE_FLASHCTRL);
+- if (on)
+- val |= VERSATILE_FLASHPROG_FLVPPEN;
+- else
+- val &= ~VERSATILE_FLASHPROG_FLVPPEN;
+- __raw_writel(val, VERSATILE_FLASHCTRL);
+-}
+-
+-static struct physmap_flash_data versatile_flash_data = {
+- .width = 4,
+- .set_vpp = versatile_flash_set_vpp,
+-};
+-
+-static struct resource versatile_flash_resource = {
+- .start = VERSATILE_FLASH_BASE,
+- .end = VERSATILE_FLASH_BASE + VERSATILE_FLASH_SIZE - 1,
+- .flags = IORESOURCE_MEM,
+-};
+-
+-struct platform_device versatile_flash_device = {
+- .name = "physmap-flash",
+- .id = 0,
+- .dev = {
+- .platform_data = &versatile_flash_data,
+- },
+- .num_resources = 1,
+- .resource = &versatile_flash_resource,
+-};
+-
+-#define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET)
+-
+-unsigned int mmc_status(struct device *dev)
+-{
+- struct amba_device *adev = container_of(dev, struct amba_device, dev);
+- u32 mask;
+-
+- if (adev->res.start == VERSATILE_MMCI0_BASE)
+- mask = 1;
+- else
+- mask = 2;
+-
+- return readl(VERSATILE_SYSMCI) & mask;
+-}
+-
+-static struct mmci_platform_data mmc0_plat_data = {
+- .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
+- .status = mmc_status,
+- .gpio_wp = -1,
+- .gpio_cd = -1,
+-};
+-
+-static struct mmci_platform_data mmc1_plat_data = {
+- .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
+- .status = mmc_status,
+- .gpio_wp = -1,
+- .gpio_cd = -1,
+-};
+-
+-/*
+- * CLCD support.
+- */
+-#define SYS_CLCD_MODE_MASK (3 << 0)
+-#define SYS_CLCD_MODE_888 (0 << 0)
+-#define SYS_CLCD_MODE_5551 (1 << 0)
+-#define SYS_CLCD_MODE_565_RLSB (2 << 0)
+-#define SYS_CLCD_MODE_565_BLSB (3 << 0)
+-#define SYS_CLCD_NLCDIOON (1 << 2)
+-#define SYS_CLCD_VDDPOSSWITCH (1 << 3)
+-#define SYS_CLCD_PWR3V5SWITCH (1 << 4)
+-#define SYS_CLCD_ID_MASK (0x1f << 8)
+-#define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8)
+-#define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8)
+-#define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8)
+-#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
+-#define SYS_CLCD_ID_VGA (0x1f << 8)
+-
+-static bool is_sanyo_2_5_lcd;
+-
+-/*
+- * Disable all display connectors on the interface module.
+- */
+-static void versatile_clcd_disable(struct clcd_fb *fb)
+-{
+- void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
+- u32 val;
+-
+- val = readl(sys_clcd);
+- val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
+- writel(val, sys_clcd);
+-
+- /*
+- * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
+- */
+- if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
+- void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
+- unsigned long ctrl;
+-
+- ctrl = readl(versatile_ib2_ctrl);
+- ctrl &= ~0x01;
+- writel(ctrl, versatile_ib2_ctrl);
+- }
+-}
+-
+-/*
+- * Enable the relevant connector on the interface module.
+- */
+-static void versatile_clcd_enable(struct clcd_fb *fb)
+-{
+- struct fb_var_screeninfo *var = &fb->fb.var;
+- void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
+- u32 val;
+-
+- val = readl(sys_clcd);
+- val &= ~SYS_CLCD_MODE_MASK;
+-
+- switch (var->green.length) {
+- case 5:
+- val |= SYS_CLCD_MODE_5551;
+- break;
+- case 6:
+- if (var->red.offset == 0)
+- val |= SYS_CLCD_MODE_565_RLSB;
+- else
+- val |= SYS_CLCD_MODE_565_BLSB;
+- break;
+- case 8:
+- val |= SYS_CLCD_MODE_888;
+- break;
+- }
+-
+- /*
+- * Set the MUX
+- */
+- writel(val, sys_clcd);
+-
+- /*
+- * And now enable the PSUs
+- */
+- val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
+- writel(val, sys_clcd);
+-
+- /*
+- * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
+- */
+- if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
+- void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
+- unsigned long ctrl;
+-
+- ctrl = readl(versatile_ib2_ctrl);
+- ctrl |= 0x01;
+- writel(ctrl, versatile_ib2_ctrl);
+- }
+-}
+-
+-/*
+- * Detect which LCD panel is connected, and return the appropriate
+- * clcd_panel structure. Note: we do not have any information on
+- * the required timings for the 8.4in panel, so we presently assume
+- * VGA timings.
+- */
+-static int versatile_clcd_setup(struct clcd_fb *fb)
+-{
+- void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
+- const char *panel_name;
+- u32 val;
+-
+- is_sanyo_2_5_lcd = false;
+-
+- val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
+- if (val == SYS_CLCD_ID_SANYO_3_8)
+- panel_name = "Sanyo TM38QV67A02A";
+- else if (val == SYS_CLCD_ID_SANYO_2_5) {
+- panel_name = "Sanyo QVGA Portrait";
+- is_sanyo_2_5_lcd = true;
+- } else if (val == SYS_CLCD_ID_EPSON_2_2)
+- panel_name = "Epson L2F50113T00";
+- else if (val == SYS_CLCD_ID_VGA)
+- panel_name = "VGA";
+- else {
+- printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
+- val);
+- panel_name = "VGA";
+- }
+-
+- fb->panel = versatile_clcd_get_panel(panel_name);
+- if (!fb->panel)
+- return -EINVAL;
+-
+- return versatile_clcd_setup_dma(fb, SZ_1M);
+-}
+-
+-static void versatile_clcd_decode(struct clcd_fb *fb, struct clcd_regs *regs)
+-{
+- clcdfb_decode(fb, regs);
+-
+- /* Always clear BGR for RGB565: we do the routing externally */
+- if (fb->fb.var.green.length == 6)
+- regs->cntl &= ~CNTL_BGR;
+-}
+-
+-static struct clcd_board clcd_plat_data = {
+- .name = "Versatile",
+- .caps = CLCD_CAP_5551 | CLCD_CAP_565 | CLCD_CAP_888,
+- .check = clcdfb_check,
+- .decode = versatile_clcd_decode,
+- .disable = versatile_clcd_disable,
+- .enable = versatile_clcd_enable,
+- .setup = versatile_clcd_setup,
+- .mmap = versatile_clcd_mmap_dma,
+- .remove = versatile_clcd_remove_dma,
+-};
+-
+-/*
+- * Lookup table for attaching a specific name and platform_data pointer to
+- * devices as they get created by of_platform_populate(). Ideally this table
+- * would not exist, but the current clock implementation depends on some devices
+- * having a specific name.
+- */
+-struct of_dev_auxdata versatile_auxdata_lookup[] __initdata = {
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI0_BASE, "fpga:05", &mmc0_plat_data),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI1_BASE, "fpga:0b", &mmc1_plat_data),
+-
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_CLCD_BASE, "dev:20", &clcd_plat_data),
+-
+- {}
+-};
+-
+-void versatile_restart(enum reboot_mode mode, const char *cmd)
+-{
+- void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
+- u32 val;
+-
+- val = __raw_readl(sys + VERSATILE_SYS_RESETCTL_OFFSET);
+- val |= 0x105;
+-
+- __raw_writel(0xa05f, sys + VERSATILE_SYS_LOCK_OFFSET);
+- __raw_writel(val, sys + VERSATILE_SYS_RESETCTL_OFFSET);
+- __raw_writel(0, sys + VERSATILE_SYS_LOCK_OFFSET);
+-}
+-
+-/* Early initializations */
+-void __init versatile_init_early(void)
+-{
+- u32 val;
+-
+- /*
+- * set clock frequency:
+- * VERSATILE_REFCLK is 32KHz
+- * VERSATILE_TIMCLK is 1MHz
+- */
+- val = readl(__io_address(VERSATILE_SCTL_BASE));
+- writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) |
+- (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
+- (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) |
+- (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
+- __io_address(VERSATILE_SCTL_BASE));
+-}
+diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h
+deleted file mode 100644
+index c3d71571fc7a..000000000000
+--- a/arch/arm/mach-versatile/core.h
++++ /dev/null
+@@ -1,41 +0,0 @@
+-/*
+- * linux/arch/arm/mach-versatile/core.h
+- *
+- * Copyright (C) 2004 ARM Limited
+- * Copyright (C) 2000 Deep Blue Solutions Ltd
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#ifndef __ASM_ARCH_VERSATILE_H
+-#define __ASM_ARCH_VERSATILE_H
+-
+-#include <linux/amba/bus.h>
+-#include <linux/of_platform.h>
+-#include <linux/reboot.h>
+-
+-extern struct platform_device versatile_flash_device;
+-
+-extern void __init versatile_init_early(void);
+-extern void __init versatile_init_irq(void);
+-extern void __init versatile_map_io(void);
+-extern void versatile_timer_init(void);
+-extern void versatile_restart(enum reboot_mode, const char *);
+-extern unsigned int mmc_status(struct device *dev);
+-#ifdef CONFIG_OF
+-extern struct of_dev_auxdata versatile_auxdata_lookup[];
+-#endif
+-
+-#endif
+diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h
+deleted file mode 100644
+index 22a1158b7e27..000000000000
+--- a/arch/arm/mach-versatile/include/mach/hardware.h
++++ /dev/null
+@@ -1,32 +0,0 @@
+-/*
+- * arch/arm/mach-versatile/include/mach/hardware.h
+- *
+- * This file contains the hardware definitions of the Versatile boards.
+- *
+- * Copyright (C) 2003 ARM Limited.
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-#ifndef __ASM_ARCH_HARDWARE_H
+-#define __ASM_ARCH_HARDWARE_H
+-
+-#include <asm/sizes.h>
+-
+-/* macro to get at MMIO space when running virtually */
+-#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
+-
+-#define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n))
+-
+-#endif
+diff --git a/arch/arm/mach-versatile/include/mach/platform.h b/arch/arm/mach-versatile/include/mach/platform.h
+deleted file mode 100644
+index 7fe008bd1509..000000000000
+--- a/arch/arm/mach-versatile/include/mach/platform.h
++++ /dev/null
+@@ -1,242 +0,0 @@
+-/*
+- * arch/arm/mach-versatile/include/mach/platform.h
+- *
+- * Copyright (c) ARM Limited 2003. All rights reserved.
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#ifndef __address_h
+-#define __address_h 1
+-
+-/*
+- * Memory definitions
+- */
+-#define VERSATILE_BOOT_ROM_LO 0x30000000 /* DoC Base (64Mb)...*/
+-#define VERSATILE_BOOT_ROM_HI 0x30000000
+-#define VERSATILE_BOOT_ROM_BASE VERSATILE_BOOT_ROM_HI /* Normal position */
+-#define VERSATILE_BOOT_ROM_SIZE SZ_64M
+-
+-#define VERSATILE_SSRAM_BASE /* VERSATILE_SSMC_BASE ? */
+-#define VERSATILE_SSRAM_SIZE SZ_2M
+-
+-#define VERSATILE_FLASH_BASE 0x34000000
+-#define VERSATILE_FLASH_SIZE SZ_64M
+-
+-/*
+- * SDRAM
+- */
+-#define VERSATILE_SDRAM_BASE 0x00000000
+-
+-/*
+- * Logic expansion modules
+- *
+- */
+-
+-
+-/* ------------------------------------------------------------------------
+- * Versatile Registers
+- * ------------------------------------------------------------------------
+- *
+- */
+-#define VERSATILE_SYS_ID_OFFSET 0x00
+-#define VERSATILE_SYS_SW_OFFSET 0x04
+-#define VERSATILE_SYS_LED_OFFSET 0x08
+-#define VERSATILE_SYS_OSC0_OFFSET 0x0C
+-
+-#if defined(CONFIG_ARCH_VERSATILE_PB)
+-#define VERSATILE_SYS_OSC1_OFFSET 0x10
+-#define VERSATILE_SYS_OSC2_OFFSET 0x14
+-#define VERSATILE_SYS_OSC3_OFFSET 0x18
+-#define VERSATILE_SYS_OSC4_OFFSET 0x1C
+-#elif defined(CONFIG_MACH_VERSATILE_AB)
+-#define VERSATILE_SYS_OSC1_OFFSET 0x1C
+-#endif
+-
+-#define VERSATILE_SYS_OSCCLCD_OFFSET 0x1c
+-
+-#define VERSATILE_SYS_LOCK_OFFSET 0x20
+-#define VERSATILE_SYS_100HZ_OFFSET 0x24
+-#define VERSATILE_SYS_CFGDATA1_OFFSET 0x28
+-#define VERSATILE_SYS_CFGDATA2_OFFSET 0x2C
+-#define VERSATILE_SYS_FLAGS_OFFSET 0x30
+-#define VERSATILE_SYS_FLAGSSET_OFFSET 0x30
+-#define VERSATILE_SYS_FLAGSCLR_OFFSET 0x34
+-#define VERSATILE_SYS_NVFLAGS_OFFSET 0x38
+-#define VERSATILE_SYS_NVFLAGSSET_OFFSET 0x38
+-#define VERSATILE_SYS_NVFLAGSCLR_OFFSET 0x3C
+-#define VERSATILE_SYS_RESETCTL_OFFSET 0x40
+-#define VERSATILE_SYS_PCICTL_OFFSET 0x44
+-#define VERSATILE_SYS_MCI_OFFSET 0x48
+-#define VERSATILE_SYS_FLASH_OFFSET 0x4C
+-#define VERSATILE_SYS_CLCD_OFFSET 0x50
+-#define VERSATILE_SYS_CLCDSER_OFFSET 0x54
+-#define VERSATILE_SYS_BOOTCS_OFFSET 0x58
+-#define VERSATILE_SYS_24MHz_OFFSET 0x5C
+-#define VERSATILE_SYS_MISC_OFFSET 0x60
+-#define VERSATILE_SYS_TEST_OSC0_OFFSET 0x80
+-#define VERSATILE_SYS_TEST_OSC1_OFFSET 0x84
+-#define VERSATILE_SYS_TEST_OSC2_OFFSET 0x88
+-#define VERSATILE_SYS_TEST_OSC3_OFFSET 0x8C
+-#define VERSATILE_SYS_TEST_OSC4_OFFSET 0x90
+-
+-#define VERSATILE_SYS_BASE 0x10000000
+-#define VERSATILE_SYS_ID (VERSATILE_SYS_BASE + VERSATILE_SYS_ID_OFFSET)
+-#define VERSATILE_SYS_SW (VERSATILE_SYS_BASE + VERSATILE_SYS_SW_OFFSET)
+-#define VERSATILE_SYS_LED (VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET)
+-#define VERSATILE_SYS_OSC0 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC0_OFFSET)
+-#define VERSATILE_SYS_OSC1 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC1_OFFSET)
+-
+-#if defined(CONFIG_ARCH_VERSATILE_PB)
+-#define VERSATILE_SYS_OSC2 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC2_OFFSET)
+-#define VERSATILE_SYS_OSC3 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC3_OFFSET)
+-#define VERSATILE_SYS_OSC4 (VERSATILE_SYS_BASE + VERSATILE_SYS_OSC4_OFFSET)
+-#endif
+-
+-#define VERSATILE_SYS_LOCK (VERSATILE_SYS_BASE + VERSATILE_SYS_LOCK_OFFSET)
+-#define VERSATILE_SYS_100HZ (VERSATILE_SYS_BASE + VERSATILE_SYS_100HZ_OFFSET)
+-#define VERSATILE_SYS_CFGDATA1 (VERSATILE_SYS_BASE + VERSATILE_SYS_CFGDATA1_OFFSET)
+-#define VERSATILE_SYS_CFGDATA2 (VERSATILE_SYS_BASE + VERSATILE_SYS_CFGDATA2_OFFSET)
+-#define VERSATILE_SYS_FLAGS (VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGS_OFFSET)
+-#define VERSATILE_SYS_FLAGSSET (VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGSSET_OFFSET)
+-#define VERSATILE_SYS_FLAGSCLR (VERSATILE_SYS_BASE + VERSATILE_SYS_FLAGSCLR_OFFSET)
+-#define VERSATILE_SYS_NVFLAGS (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGS_OFFSET)
+-#define VERSATILE_SYS_NVFLAGSSET (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSSET_OFFSET)
+-#define VERSATILE_SYS_NVFLAGSCLR (VERSATILE_SYS_BASE + VERSATILE_SYS_NVFLAGSCLR_OFFSET)
+-#define VERSATILE_SYS_RESETCTL (VERSATILE_SYS_BASE + VERSATILE_SYS_RESETCTL_OFFSET)
+-#define VERSATILE_SYS_PCICTL (VERSATILE_SYS_BASE + VERSATILE_SYS_PCICTL_OFFSET)
+-#define VERSATILE_SYS_MCI (VERSATILE_SYS_BASE + VERSATILE_SYS_MCI_OFFSET)
+-#define VERSATILE_SYS_FLASH (VERSATILE_SYS_BASE + VERSATILE_SYS_FLASH_OFFSET)
+-#define VERSATILE_SYS_CLCD (VERSATILE_SYS_BASE + VERSATILE_SYS_CLCD_OFFSET)
+-#define VERSATILE_SYS_CLCDSER (VERSATILE_SYS_BASE + VERSATILE_SYS_CLCDSER_OFFSET)
+-#define VERSATILE_SYS_BOOTCS (VERSATILE_SYS_BASE + VERSATILE_SYS_BOOTCS_OFFSET)
+-#define VERSATILE_SYS_24MHz (VERSATILE_SYS_BASE + VERSATILE_SYS_24MHz_OFFSET)
+-#define VERSATILE_SYS_MISC (VERSATILE_SYS_BASE + VERSATILE_SYS_MISC_OFFSET)
+-#define VERSATILE_SYS_TEST_OSC0 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC0_OFFSET)
+-#define VERSATILE_SYS_TEST_OSC1 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC1_OFFSET)
+-#define VERSATILE_SYS_TEST_OSC2 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC2_OFFSET)
+-#define VERSATILE_SYS_TEST_OSC3 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC3_OFFSET)
+-#define VERSATILE_SYS_TEST_OSC4 (VERSATILE_SYS_BASE + VERSATILE_SYS_TEST_OSC4_OFFSET)
+-
+-/*
+- * Values for VERSATILE_SYS_RESET_CTRL
+- */
+-#define VERSATILE_SYS_CTRL_RESET_CONFIGCLR 0x01
+-#define VERSATILE_SYS_CTRL_RESET_CONFIGINIT 0x02
+-#define VERSATILE_SYS_CTRL_RESET_DLLRESET 0x03
+-#define VERSATILE_SYS_CTRL_RESET_PLLRESET 0x04
+-#define VERSATILE_SYS_CTRL_RESET_POR 0x05
+-#define VERSATILE_SYS_CTRL_RESET_DoC 0x06
+-
+-#define VERSATILE_SYS_CTRL_LED (1 << 0)
+-
+-
+-/* ------------------------------------------------------------------------
+- * Versatile control registers
+- * ------------------------------------------------------------------------
+- */
+-
+-/*
+- * VERSATILE_IDFIELD
+- *
+- * 31:24 = manufacturer (0x41 = ARM)
+- * 23:16 = architecture (0x08 = AHB system bus, ASB processor bus)
+- * 15:12 = FPGA (0x3 = XVC600 or XVC600E)
+- * 11:4 = build value
+- * 3:0 = revision number (0x1 = rev B (AHB))
+- */
+-
+-/*
+- * VERSATILE_SYS_LOCK
+- * control access to SYS_OSCx, SYS_CFGDATAx, SYS_RESETCTL,
+- * SYS_CLD, SYS_BOOTCS
+- */
+-#define VERSATILE_SYS_LOCK_LOCKED (1 << 16)
+-#define VERSATILE_SYS_LOCKVAL_MASK 0xFFFF /* write 0xA05F to enable write access */
+-
+-/*
+- * VERSATILE_SYS_FLASH
+- */
+-#define VERSATILE_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */
+-
+-/*
+- * VERSATILE_INTREG
+- * - used to acknowledge and control MMCI and UART interrupts
+- */
+-#define VERSATILE_INTREG_WPROT 0x00 /* MMC protection status (no interrupt generated) */
+-#define VERSATILE_INTREG_RI0 0x01 /* Ring indicator UART0 is asserted, */
+-#define VERSATILE_INTREG_CARDIN 0x08 /* MMCI card in detect */
+- /* write 1 to acknowledge and clear */
+-#define VERSATILE_INTREG_RI1 0x02 /* Ring indicator UART1 is asserted, */
+-#define VERSATILE_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */
+-
+-/*
+- * VERSATILE peripheral addresses
+- */
+-#define VERSATILE_MMCI0_BASE 0x10005000 /* MMC interface */
+-#define VERSATILE_MMCI1_BASE 0x1000B000 /* MMC Interface */
+-#define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */
+-#define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */
+-#define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */
+-
+-/*
+- * LED settings, bits [7:0]
+- */
+-#define VERSATILE_SYS_LED0 (1 << 0)
+-#define VERSATILE_SYS_LED1 (1 << 1)
+-#define VERSATILE_SYS_LED2 (1 << 2)
+-#define VERSATILE_SYS_LED3 (1 << 3)
+-#define VERSATILE_SYS_LED4 (1 << 4)
+-#define VERSATILE_SYS_LED5 (1 << 5)
+-#define VERSATILE_SYS_LED6 (1 << 6)
+-#define VERSATILE_SYS_LED7 (1 << 7)
+-
+-#define ALL_LEDS 0xFF
+-
+-#define LED_BANK VERSATILE_SYS_LED
+-
+-/*
+- * Control registers
+- */
+-#define VERSATILE_IDFIELD_OFFSET 0x0 /* Versatile build information */
+-#define VERSATILE_FLASHPROG_OFFSET 0x4 /* Flash devices */
+-#define VERSATILE_INTREG_OFFSET 0x8 /* Interrupt control */
+-#define VERSATILE_DECODE_OFFSET 0xC /* Fitted logic modules */
+-
+-/*
+- * System controller bit assignment
+- */
+-#define VERSATILE_REFCLK 0
+-#define VERSATILE_TIMCLK 1
+-
+-#define VERSATILE_TIMER1_EnSel 15
+-#define VERSATILE_TIMER2_EnSel 17
+-#define VERSATILE_TIMER3_EnSel 19
+-#define VERSATILE_TIMER4_EnSel 21
+-
+-
+-/*
+- * IB2 Versatile/AB expansion board definitions
+- */
+-/* VICINTSOURCE27 */
+-#define VERSATILE_IB2_INT_BASE (VERSATILE_IB2_BASE + 0x02000000)
+-#define VERSATILE_IB2_IER (VERSATILE_IB2_INT_BASE + 0)
+-#define VERSATILE_IB2_ISR (VERSATILE_IB2_INT_BASE + 4)
+-
+-#define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000)
+-#define VERSATILE_IB2_CTRL (VERSATILE_IB2_CTL_BASE + 0)
+-#define VERSATILE_IB2_STAT (VERSATILE_IB2_CTL_BASE + 4)
+-
+-#endif
+diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c
+index 86fa2d35a019..c44871851255 100644
+--- a/arch/arm/mach-versatile/versatile_dt.c
++++ b/arch/arm/mach-versatile/versatile_dt.c
+@@ -28,13 +28,334 @@
+ #include <linux/of_irq.h>
+ #include <linux/of_platform.h>
+ #include <linux/slab.h>
++#include <linux/amba/bus.h>
++#include <linux/amba/clcd.h>
++#include <linux/platform_data/video-clcd-versatile.h>
++#include <linux/amba/mmci.h>
++#include <linux/mtd/physmap.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
++#include <asm/mach/map.h>
+
+-#include "core.h"
++/* macro to get at MMIO space when running virtually */
++#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
++#define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n))
+
++/*
++ * Memory definitions
++ */
++#define VERSATILE_FLASH_BASE 0x34000000
++#define VERSATILE_FLASH_SIZE SZ_64M
++
++/*
++ * ------------------------------------------------------------------------
++ * Versatile Registers
++ * ------------------------------------------------------------------------
++ */
++#define VERSATILE_SYS_LOCK_OFFSET 0x20
++#define VERSATILE_SYS_RESETCTL_OFFSET 0x40
+ #define VERSATILE_SYS_PCICTL_OFFSET 0x44
++#define VERSATILE_SYS_MCI_OFFSET 0x48
++#define VERSATILE_SYS_FLASH_OFFSET 0x4C
++#define VERSATILE_SYS_CLCD_OFFSET 0x50
++
++/*
++ * VERSATILE_SYS_FLASH
++ */
++#define VERSATILE_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */
++
++/*
++ * VERSATILE peripheral addresses
++ */
++#define VERSATILE_MMCI0_BASE 0x10005000 /* MMC interface */
++#define VERSATILE_MMCI1_BASE 0x1000B000 /* MMC Interface */
++#define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */
++#define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */
++#define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */
++#define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000)
++
++/*
++ * System controller bit assignment
++ */
++#define VERSATILE_REFCLK 0
++#define VERSATILE_TIMCLK 1
++
++#define VERSATILE_TIMER1_EnSel 15
++#define VERSATILE_TIMER2_EnSel 17
++#define VERSATILE_TIMER3_EnSel 19
++#define VERSATILE_TIMER4_EnSel 21
++
+ static void __iomem *versatile_sys_base;
++static void __iomem *versatile_ib2_ctrl;
++
++static void versatile_flash_set_vpp(struct platform_device *pdev, int on)
++{
++ u32 val;
++
++ val = readl(versatile_sys_base + VERSATILE_SYS_FLASH_OFFSET);
++ if (on)
++ val |= VERSATILE_FLASHPROG_FLVPPEN;
++ else
++ val &= ~VERSATILE_FLASHPROG_FLVPPEN;
++ writel(val, versatile_sys_base + VERSATILE_SYS_FLASH_OFFSET);
++}
++
++static struct physmap_flash_data versatile_flash_data = {
++ .width = 4,
++ .set_vpp = versatile_flash_set_vpp,
++};
++
++static struct resource versatile_flash_resource = {
++ .start = VERSATILE_FLASH_BASE,
++ .end = VERSATILE_FLASH_BASE + VERSATILE_FLASH_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++};
++
++struct platform_device versatile_flash_device = {
++ .name = "physmap-flash",
++ .id = 0,
++ .dev = {
++ .platform_data = &versatile_flash_data,
++ },
++ .num_resources = 1,
++ .resource = &versatile_flash_resource,
++};
++
++unsigned int mmc_status(struct device *dev)
++{
++ struct amba_device *adev = container_of(dev, struct amba_device, dev);
++ u32 mask;
++
++ if (adev->res.start == VERSATILE_MMCI0_BASE)
++ mask = 1;
++ else
++ mask = 2;
++
++ return readl(versatile_sys_base + VERSATILE_SYS_MCI_OFFSET) & mask;
++}
++
++static struct mmci_platform_data mmc0_plat_data = {
++ .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
++ .status = mmc_status,
++ .gpio_wp = -1,
++ .gpio_cd = -1,
++};
++
++static struct mmci_platform_data mmc1_plat_data = {
++ .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
++ .status = mmc_status,
++ .gpio_wp = -1,
++ .gpio_cd = -1,
++};
++
++/*
++ * CLCD support.
++ */
++#define SYS_CLCD_MODE_MASK (3 << 0)
++#define SYS_CLCD_MODE_888 (0 << 0)
++#define SYS_CLCD_MODE_5551 (1 << 0)
++#define SYS_CLCD_MODE_565_RLSB (2 << 0)
++#define SYS_CLCD_MODE_565_BLSB (3 << 0)
++#define SYS_CLCD_NLCDIOON (1 << 2)
++#define SYS_CLCD_VDDPOSSWITCH (1 << 3)
++#define SYS_CLCD_PWR3V5SWITCH (1 << 4)
++#define SYS_CLCD_ID_MASK (0x1f << 8)
++#define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8)
++#define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8)
++#define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8)
++#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
++#define SYS_CLCD_ID_VGA (0x1f << 8)
++
++static bool is_sanyo_2_5_lcd;
++
++/*
++ * Disable all display connectors on the interface module.
++ */
++static void versatile_clcd_disable(struct clcd_fb *fb)
++{
++ void __iomem *sys_clcd = versatile_sys_base + VERSATILE_SYS_CLCD_OFFSET;
++ u32 val;
++
++ val = readl(sys_clcd);
++ val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
++ writel(val, sys_clcd);
++
++ /*
++ * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
++ */
++ if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
++ unsigned long ctrl;
++
++ ctrl = readl(versatile_ib2_ctrl);
++ ctrl &= ~0x01;
++ writel(ctrl, versatile_ib2_ctrl);
++ }
++}
++
++/*
++ * Enable the relevant connector on the interface module.
++ */
++static void versatile_clcd_enable(struct clcd_fb *fb)
++{
++ struct fb_var_screeninfo *var = &fb->fb.var;
++ void __iomem *sys_clcd = versatile_sys_base + VERSATILE_SYS_CLCD_OFFSET;
++ u32 val;
++
++ val = readl(sys_clcd);
++ val &= ~SYS_CLCD_MODE_MASK;
++
++ switch (var->green.length) {
++ case 5:
++ val |= SYS_CLCD_MODE_5551;
++ break;
++ case 6:
++ if (var->red.offset == 0)
++ val |= SYS_CLCD_MODE_565_RLSB;
++ else
++ val |= SYS_CLCD_MODE_565_BLSB;
++ break;
++ case 8:
++ val |= SYS_CLCD_MODE_888;
++ break;
++ }
++
++ /*
++ * Set the MUX
++ */
++ writel(val, sys_clcd);
++
++ /*
++ * And now enable the PSUs
++ */
++ val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
++ writel(val, sys_clcd);
++
++ /*
++ * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
++ */
++ if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
++ unsigned long ctrl;
++
++ ctrl = readl(versatile_ib2_ctrl);
++ ctrl |= 0x01;
++ writel(ctrl, versatile_ib2_ctrl);
++ }
++}
++
++/*
++ * Detect which LCD panel is connected, and return the appropriate
++ * clcd_panel structure. Note: we do not have any information on
++ * the required timings for the 8.4in panel, so we presently assume
++ * VGA timings.
++ */
++static int versatile_clcd_setup(struct clcd_fb *fb)
++{
++ void __iomem *sys_clcd = versatile_sys_base + VERSATILE_SYS_CLCD_OFFSET;
++ const char *panel_name;
++ u32 val;
++
++ is_sanyo_2_5_lcd = false;
++
++ val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
++ if (val == SYS_CLCD_ID_SANYO_3_8)
++ panel_name = "Sanyo TM38QV67A02A";
++ else if (val == SYS_CLCD_ID_SANYO_2_5) {
++ panel_name = "Sanyo QVGA Portrait";
++ is_sanyo_2_5_lcd = true;
++ } else if (val == SYS_CLCD_ID_EPSON_2_2)
++ panel_name = "Epson L2F50113T00";
++ else if (val == SYS_CLCD_ID_VGA)
++ panel_name = "VGA";
++ else {
++ printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
++ val);
++ panel_name = "VGA";
++ }
++
++ fb->panel = versatile_clcd_get_panel(panel_name);
++ if (!fb->panel)
++ return -EINVAL;
++
++ return versatile_clcd_setup_dma(fb, SZ_1M);
++}
++
++static void versatile_clcd_decode(struct clcd_fb *fb, struct clcd_regs *regs)
++{
++ clcdfb_decode(fb, regs);
++
++ /* Always clear BGR for RGB565: we do the routing externally */
++ if (fb->fb.var.green.length == 6)
++ regs->cntl &= ~CNTL_BGR;
++}
++
++static struct clcd_board clcd_plat_data = {
++ .name = "Versatile",
++ .caps = CLCD_CAP_5551 | CLCD_CAP_565 | CLCD_CAP_888,
++ .check = clcdfb_check,
++ .decode = versatile_clcd_decode,
++ .disable = versatile_clcd_disable,
++ .enable = versatile_clcd_enable,
++ .setup = versatile_clcd_setup,
++ .mmap = versatile_clcd_mmap_dma,
++ .remove = versatile_clcd_remove_dma,
++};
++
++/*
++ * Lookup table for attaching a specific name and platform_data pointer to
++ * devices as they get created by of_platform_populate(). Ideally this table
++ * would not exist, but the current clock implementation depends on some devices
++ * having a specific name.
++ */
++struct of_dev_auxdata versatile_auxdata_lookup[] __initdata = {
++ OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI0_BASE, "fpga:05", &mmc0_plat_data),
++ OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI1_BASE, "fpga:0b", &mmc1_plat_data),
++ OF_DEV_AUXDATA("arm,primecell", VERSATILE_CLCD_BASE, "dev:20", &clcd_plat_data),
++ {}
++};
++
++static struct map_desc versatile_io_desc[] __initdata __maybe_unused = {
++ {
++ .virtual = IO_ADDRESS(VERSATILE_SCTL_BASE),
++ .pfn = __phys_to_pfn(VERSATILE_SCTL_BASE),
++ .length = SZ_4K * 9,
++ .type = MT_DEVICE
++ }
++};
++
++static void __init versatile_map_io(void)
++{
++ debug_ll_io_init();
++ iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc));
++}
++
++static void __init versatile_init_early(void)
++{
++ u32 val;
++
++ /*
++ * set clock frequency:
++ * VERSATILE_REFCLK is 32KHz
++ * VERSATILE_TIMCLK is 1MHz
++ */
++ val = readl(__io_address(VERSATILE_SCTL_BASE));
++ writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) |
++ (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
++ (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) |
++ (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
++ __io_address(VERSATILE_SCTL_BASE));
++}
++
++static void versatile_restart(enum reboot_mode mode, const char *cmd)
++{
++ u32 val;
++
++ val = readl(versatile_sys_base + VERSATILE_SYS_RESETCTL_OFFSET);
++ val |= 0x105;
++
++ writel(0xa05f, versatile_sys_base + VERSATILE_SYS_LOCK_OFFSET);
++ writel(val, versatile_sys_base + VERSATILE_SYS_RESETCTL_OFFSET);
++ writel(0, versatile_sys_base + VERSATILE_SYS_LOCK_OFFSET);
++}
+
+ static void __init versatile_dt_pci_init(void)
+ {
+@@ -79,6 +400,8 @@ static void __init versatile_dt_init(void)
+ versatile_sys_base = of_iomap(np, 0);
+ WARN_ON(!versatile_sys_base);
+
++ versatile_ib2_ctrl = ioremap(VERSATILE_IB2_CTL_BASE, SZ_4K);
++
+ versatile_dt_pci_init();
+
+ platform_device_register(&versatile_flash_device);
diff --git a/debian/patches/features/arm/arm-versatile-switch-to-dt-only-booting-and-remove-l.patch b/debian/patches/features/arm/arm-versatile-switch-to-dt-only-booting-and-remove-l.patch
new file mode 100644
index 0000000..d3a7be6
--- /dev/null
+++ b/debian/patches/features/arm/arm-versatile-switch-to-dt-only-booting-and-remove-l.patch
@@ -0,0 +1,1692 @@
+From: Rob Herring <robh at kernel.org>
+Date: Tue, 8 Dec 2015 14:44:16 -0600
+Subject: [2/4] ARM: versatile: switch to DT only booting and remove legacy
+ code
+Origin: https://git.kernel.org/linus/16956fed35fecde2201e23458cda193526b19559
+
+With DT support for clocks, irqchips, timers, and PCI now in place, DT
+based booting has feature parity with non-DT legacy boot. The final
+piece is actually enabling common clock support on Versatile. Enabling
+full DT support requires either removing the old Versatile clock code,
+updating the legacy boot to use the common clock code, or making DT and
+legacy boot mutually exclusive. Given that removing legacy boot code is
+the goal anyway, I am going with the 1st option.
+
+Signed-off-by: Rob Herring <robh at kernel.org>
+Cc: Russell King <linux at arm.linux.org.uk>
+Cc: Linus Walleij <linus.walleij at linaro.org>
+Cc: Mike Turquette <mturquette at linaro.org>
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+---
+ arch/arm/Kconfig | 13 +-
+ arch/arm/mach-versatile/Kconfig | 33 --
+ arch/arm/mach-versatile/Makefile | 6 +-
+ arch/arm/mach-versatile/core.c | 497 +-----------------------
+ arch/arm/mach-versatile/core.h | 9 +-
+ arch/arm/mach-versatile/include/mach/clkdev.h | 16 -
+ arch/arm/mach-versatile/include/mach/hardware.h | 6 -
+ arch/arm/mach-versatile/include/mach/irqs.h | 134 -------
+ arch/arm/mach-versatile/include/mach/platform.h | 174 ---------
+ arch/arm/mach-versatile/pci.c | 368 ------------------
+ arch/arm/mach-versatile/versatile_ab.c | 44 ---
+ arch/arm/mach-versatile/versatile_dt.c | 1 +
+ arch/arm/mach-versatile/versatile_pb.c | 91 -----
+ drivers/clk/versatile/Kconfig | 4 +-
+ 14 files changed, 24 insertions(+), 1372 deletions(-)
+ delete mode 100644 arch/arm/mach-versatile/Kconfig
+ delete mode 100644 arch/arm/mach-versatile/include/mach/clkdev.h
+ delete mode 100644 arch/arm/mach-versatile/include/mach/irqs.h
+ delete mode 100644 arch/arm/mach-versatile/pci.c
+ delete mode 100644 arch/arm/mach-versatile/versatile_ab.c
+ delete mode 100644 arch/arm/mach-versatile/versatile_pb.c
+
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -368,13 +368,16 @@ config ARCH_VERSATILE
+ select ARM_AMBA
+ select ARM_TIMER_SP804
+ select ARM_VIC
+- select CLKDEV_LOOKUP
++ select CLKSRC_VERSATILE
++ select COMMON_CLK
++ select COMMON_CLK_VERSATILE
++ select CPU_ARM926T
+ select GENERIC_CLOCKEVENTS
+- select HAVE_MACH_CLKDEV
+ select ICST
+ select PLAT_VERSATILE
+- select PLAT_VERSATILE_CLOCK
+- select PLAT_VERSATILE_SCHED_CLOCK
++ select MIGHT_HAVE_PCI
++ select SPARSE_IRQ
++ select USE_OF
+ select VERSATILE_FPGA_IRQ
+ help
+ This enables support for ARM Ltd Versatile board.
+@@ -915,8 +918,6 @@ source "arch/arm/mach-uniphier/Kconfig"
+
+ source "arch/arm/mach-ux500/Kconfig"
+
+-source "arch/arm/mach-versatile/Kconfig"
+-
+ source "arch/arm/mach-vexpress/Kconfig"
+ source "arch/arm/plat-versatile/Kconfig"
+
+--- a/arch/arm/mach-versatile/Kconfig
++++ /dev/null
+@@ -1,33 +0,0 @@
+-menu "Versatile platform type"
+- depends on ARCH_VERSATILE
+-
+-config ARCH_VERSATILE_PB
+- bool "Support Versatile Platform Baseboard for ARM926EJ-S"
+- default y
+- select CPU_ARM926T
+- select MIGHT_HAVE_PCI
+- help
+- Include support for the ARM(R) Versatile Platform Baseboard
+- for the ARM926EJ-S.
+-
+-config MACH_VERSATILE_AB
+- bool "Support Versatile Application Baseboard for ARM926EJ-S"
+- select CPU_ARM926T
+- help
+- Include support for the ARM(R) Versatile Application Baseboard
+- for the ARM926EJ-S.
+-
+-config MACH_VERSATILE_DT
+- bool "Support Versatile platform from device tree"
+- select CPU_ARM926T
+- select USE_OF
+- help
+- Include support for the ARM(R) Versatile/PB platform,
+- using the device tree for discovery
+-
+-config MACH_VERSATILE_AUTO
+- def_bool y
+- depends on !ARCH_VERSATILE_PB && !MACH_VERSATILE_AB
+- select MACH_VERSATILE_DT
+-
+-endmenu
+--- a/arch/arm/mach-versatile/Makefile
++++ b/arch/arm/mach-versatile/Makefile
+@@ -2,8 +2,4 @@
+ # Makefile for the linux kernel.
+ #
+
+-obj-y := core.o
+-obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o
+-obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o
+-obj-$(CONFIG_MACH_VERSATILE_DT) += versatile_dt.o
+-obj-$(CONFIG_PCI) += pci.o
++obj-y := core.o versatile_dt.o
+--- a/arch/arm/mach-versatile/core.c
++++ b/arch/arm/mach-versatile/core.c
+@@ -23,111 +23,22 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/platform_device.h>
+ #include <linux/interrupt.h>
+-#include <linux/irqdomain.h>
+-#include <linux/of_address.h>
+ #include <linux/of_platform.h>
+ #include <linux/amba/bus.h>
+ #include <linux/amba/clcd.h>
+ #include <linux/platform_data/video-clcd-versatile.h>
+-#include <linux/amba/pl061.h>
+ #include <linux/amba/mmci.h>
+-#include <linux/amba/pl022.h>
+ #include <linux/io.h>
+-#include <linux/irqchip/arm-vic.h>
+-#include <linux/irqchip/versatile-fpga.h>
+-#include <linux/gfp.h>
+-#include <linux/clkdev.h>
+ #include <linux/mtd/physmap.h>
+-#include <linux/bitops.h>
+ #include <linux/reboot.h>
+
+-#include <clocksource/timer-sp804.h>
+-
+-#include <asm/irq.h>
+-#include <asm/hardware/icst.h>
+-#include <asm/mach-types.h>
+-
+ #include <asm/mach/arch.h>
+-#include <asm/mach/irq.h>
+-#include <asm/mach/time.h>
+ #include <asm/mach/map.h>
+ #include <mach/hardware.h>
+ #include <mach/platform.h>
+
+-#include <plat/sched_clock.h>
+-
+ #include "core.h"
+
+-/*
+- * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
+- * is the (PA >> 12).
+- *
+- * Setup a VA for the Versatile Vectored Interrupt Controller.
+- */
+-#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE)
+-#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE)
+-
+-/* These PIC IRQs are valid in each configuration */
+-#define PIC_VALID_ALL BIT(SIC_INT_KMI0) | BIT(SIC_INT_KMI1) | \
+- BIT(SIC_INT_SCI3) | BIT(SIC_INT_UART3) | \
+- BIT(SIC_INT_CLCD) | BIT(SIC_INT_TOUCH) | \
+- BIT(SIC_INT_KEYPAD) | BIT(SIC_INT_DoC) | \
+- BIT(SIC_INT_USB) | BIT(SIC_INT_PCI0) | \
+- BIT(SIC_INT_PCI1) | BIT(SIC_INT_PCI2) | \
+- BIT(SIC_INT_PCI3)
+-#if 1
+-#define IRQ_MMCI0A IRQ_VICSOURCE22
+-#define IRQ_AACI IRQ_VICSOURCE24
+-#define IRQ_ETH IRQ_VICSOURCE25
+-#define PIC_MASK 0xFFD00000
+-#define PIC_VALID PIC_VALID_ALL
+-#else
+-#define IRQ_MMCI0A IRQ_SIC_MMCI0A
+-#define IRQ_AACI IRQ_SIC_AACI
+-#define IRQ_ETH IRQ_SIC_ETH
+-#define PIC_MASK 0
+-#define PIC_VALID PIC_VALID_ALL | BIT(SIC_INT_MMCI0A) | \
+- BIT(SIC_INT_MMCI1A) | BIT(SIC_INT_AACI) | \
+- BIT(SIC_INT_ETH)
+-#endif
+-
+-/* Lookup table for finding a DT node that represents the vic instance */
+-static const struct of_device_id vic_of_match[] __initconst = {
+- { .compatible = "arm,versatile-vic", },
+- {}
+-};
+-
+-static const struct of_device_id sic_of_match[] __initconst = {
+- { .compatible = "arm,versatile-sic", },
+- {}
+-};
+-
+-void __init versatile_init_irq(void)
+-{
+- struct device_node *np;
+-
+- np = of_find_matching_node_by_address(NULL, vic_of_match,
+- VERSATILE_VIC_BASE);
+- __vic_init(VA_VIC_BASE, 0, IRQ_VIC_START, ~0, 0, np);
+-
+- writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
+-
+- np = of_find_matching_node_by_address(NULL, sic_of_match,
+- VERSATILE_SIC_BASE);
+-
+- fpga_irq_init(VA_SIC_BASE, "SIC", IRQ_SIC_START,
+- IRQ_VICSOURCE31, PIC_VALID, np);
+-
+- /*
+- * Interrupts on secondary controller from 0 to 8 are routed to
+- * source 31 on PIC.
+- * Interrupts from 21 to 31 are routed directly to the VIC on
+- * the corresponding number on primary controller. This is controlled
+- * by setting PIC_ENABLEx.
+- */
+- writel(PIC_MASK, VA_SIC_BASE + SIC_INT_PIC_ENABLE);
+-}
+-
+ static struct map_desc versatile_io_desc[] __initdata __maybe_unused = {
+ {
+ .virtual = IO_ADDRESS(VERSATILE_SYS_BASE),
+@@ -135,59 +46,22 @@ static struct map_desc versatile_io_desc
+ .length = SZ_4K,
+ .type = MT_DEVICE
+ }, {
+- .virtual = IO_ADDRESS(VERSATILE_SIC_BASE),
+- .pfn = __phys_to_pfn(VERSATILE_SIC_BASE),
+- .length = SZ_4K,
+- .type = MT_DEVICE
+- }, {
+- .virtual = IO_ADDRESS(VERSATILE_VIC_BASE),
+- .pfn = __phys_to_pfn(VERSATILE_VIC_BASE),
+- .length = SZ_4K,
+- .type = MT_DEVICE
+- }, {
+ .virtual = IO_ADDRESS(VERSATILE_SCTL_BASE),
+ .pfn = __phys_to_pfn(VERSATILE_SCTL_BASE),
+ .length = SZ_4K * 9,
+ .type = MT_DEVICE
+ },
+-#ifdef CONFIG_MACH_VERSATILE_AB
+ {
+ .virtual = IO_ADDRESS(VERSATILE_IB2_BASE),
+ .pfn = __phys_to_pfn(VERSATILE_IB2_BASE),
+ .length = SZ_64M,
+ .type = MT_DEVICE
+ },
+-#endif
+-#ifdef CONFIG_DEBUG_LL
+- {
+- .virtual = IO_ADDRESS(VERSATILE_UART0_BASE),
+- .pfn = __phys_to_pfn(VERSATILE_UART0_BASE),
+- .length = SZ_4K,
+- .type = MT_DEVICE
+- },
+-#endif
+-#ifdef CONFIG_PCI
+- {
+- .virtual = IO_ADDRESS(VERSATILE_PCI_CORE_BASE),
+- .pfn = __phys_to_pfn(VERSATILE_PCI_CORE_BASE),
+- .length = SZ_4K,
+- .type = MT_DEVICE
+- }, {
+- .virtual = (unsigned long)VERSATILE_PCI_VIRT_BASE,
+- .pfn = __phys_to_pfn(VERSATILE_PCI_BASE),
+- .length = VERSATILE_PCI_BASE_SIZE,
+- .type = MT_DEVICE
+- }, {
+- .virtual = (unsigned long)VERSATILE_PCI_CFG_VIRT_BASE,
+- .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE),
+- .length = VERSATILE_PCI_CFG_BASE_SIZE,
+- .type = MT_DEVICE
+- },
+-#endif
+ };
+
+ void __init versatile_map_io(void)
+ {
++ debug_ll_io_init();
+ iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc));
+ }
+
+@@ -217,7 +91,7 @@ static struct resource versatile_flash_r
+ .flags = IORESOURCE_MEM,
+ };
+
+-static struct platform_device versatile_flash_device = {
++struct platform_device versatile_flash_device = {
+ .name = "physmap-flash",
+ .id = 0,
+ .dev = {
+@@ -227,52 +101,6 @@ static struct platform_device versatile_
+ .resource = &versatile_flash_resource,
+ };
+
+-static struct resource smc91x_resources[] = {
+- [0] = {
+- .start = VERSATILE_ETH_BASE,
+- .end = VERSATILE_ETH_BASE + SZ_64K - 1,
+- .flags = IORESOURCE_MEM,
+- },
+- [1] = {
+- .start = IRQ_ETH,
+- .end = IRQ_ETH,
+- .flags = IORESOURCE_IRQ,
+- },
+-};
+-
+-static struct platform_device smc91x_device = {
+- .name = "smc91x",
+- .id = 0,
+- .num_resources = ARRAY_SIZE(smc91x_resources),
+- .resource = smc91x_resources,
+-};
+-
+-static struct resource versatile_i2c_resource = {
+- .start = VERSATILE_I2C_BASE,
+- .end = VERSATILE_I2C_BASE + SZ_4K - 1,
+- .flags = IORESOURCE_MEM,
+-};
+-
+-static struct platform_device versatile_i2c_device = {
+- .name = "versatile-i2c",
+- .id = 0,
+- .num_resources = 1,
+- .resource = &versatile_i2c_resource,
+-};
+-
+-static struct i2c_board_info versatile_i2c_board_info[] = {
+- {
+- I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
+- },
+-};
+-
+-static int __init versatile_i2c_init(void)
+-{
+- return i2c_register_board_info(0, versatile_i2c_board_info,
+- ARRAY_SIZE(versatile_i2c_board_info));
+-}
+-arch_initcall(versatile_i2c_init);
+-
+ #define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET)
+
+ unsigned int mmc_status(struct device *dev)
+@@ -295,126 +123,11 @@ static struct mmci_platform_data mmc0_pl
+ .gpio_cd = -1,
+ };
+
+-static struct resource char_lcd_resources[] = {
+- {
+- .start = VERSATILE_CHAR_LCD_BASE,
+- .end = (VERSATILE_CHAR_LCD_BASE + SZ_4K - 1),
+- .flags = IORESOURCE_MEM,
+- },
+-};
+-
+-static struct platform_device char_lcd_device = {
+- .name = "arm-charlcd",
+- .id = -1,
+- .num_resources = ARRAY_SIZE(char_lcd_resources),
+- .resource = char_lcd_resources,
+-};
+-
+-static struct resource leds_resources[] = {
+- {
+- .start = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET,
+- .end = VERSATILE_SYS_BASE + VERSATILE_SYS_LED_OFFSET + 4,
+- .flags = IORESOURCE_MEM,
+- },
+-};
+-
+-static struct platform_device leds_device = {
+- .name = "versatile-leds",
+- .id = -1,
+- .num_resources = ARRAY_SIZE(leds_resources),
+- .resource = leds_resources,
+-};
+-
+-/*
+- * Clock handling
+- */
+-static const struct icst_params versatile_oscvco_params = {
+- .ref = 24000000,
+- .vco_max = ICST307_VCO_MAX,
+- .vco_min = ICST307_VCO_MIN,
+- .vd_min = 4 + 8,
+- .vd_max = 511 + 8,
+- .rd_min = 1 + 2,
+- .rd_max = 127 + 2,
+- .s2div = icst307_s2div,
+- .idx2s = icst307_idx2s,
+-};
+-
+-static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco)
+-{
+- void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET;
+- u32 val;
+-
+- val = readl(clk->vcoreg) & ~0x7ffff;
+- val |= vco.v | (vco.r << 9) | (vco.s << 16);
+-
+- writel(0xa05f, sys_lock);
+- writel(val, clk->vcoreg);
+- writel(0, sys_lock);
+-}
+-
+-static const struct clk_ops osc4_clk_ops = {
+- .round = icst_clk_round,
+- .set = icst_clk_set,
+- .setvco = versatile_oscvco_set,
+-};
+-
+-static struct clk osc4_clk = {
+- .ops = &osc4_clk_ops,
+- .params = &versatile_oscvco_params,
+-};
+-
+-/*
+- * These are fixed clocks.
+- */
+-static struct clk ref24_clk = {
+- .rate = 24000000,
+-};
+-
+-static struct clk sp804_clk = {
+- .rate = 1000000,
+-};
+-
+-static struct clk dummy_apb_pclk;
+-
+-static struct clk_lookup lookups[] = {
+- { /* AMBA bus clock */
+- .con_id = "apb_pclk",
+- .clk = &dummy_apb_pclk,
+- }, { /* UART0 */
+- .dev_id = "dev:f1",
+- .clk = &ref24_clk,
+- }, { /* UART1 */
+- .dev_id = "dev:f2",
+- .clk = &ref24_clk,
+- }, { /* UART2 */
+- .dev_id = "dev:f3",
+- .clk = &ref24_clk,
+- }, { /* UART3 */
+- .dev_id = "fpga:09",
+- .clk = &ref24_clk,
+- }, { /* KMI0 */
+- .dev_id = "fpga:06",
+- .clk = &ref24_clk,
+- }, { /* KMI1 */
+- .dev_id = "fpga:07",
+- .clk = &ref24_clk,
+- }, { /* MMC0 */
+- .dev_id = "fpga:05",
+- .clk = &ref24_clk,
+- }, { /* MMC1 */
+- .dev_id = "fpga:0b",
+- .clk = &ref24_clk,
+- }, { /* SSP */
+- .dev_id = "dev:f4",
+- .clk = &ref24_clk,
+- }, { /* CLCD */
+- .dev_id = "dev:20",
+- .clk = &osc4_clk,
+- }, { /* SP804 timers */
+- .dev_id = "sp804",
+- .clk = &sp804_clk,
+- },
++static struct mmci_platform_data mmc1_plat_data = {
++ .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
++ .status = mmc_status,
++ .gpio_wp = -1,
++ .gpio_cd = -1,
+ };
+
+ /*
+@@ -449,11 +162,10 @@ static void versatile_clcd_disable(struc
+ val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
+ writel(val, sys_clcd);
+
+-#ifdef CONFIG_MACH_VERSATILE_AB
+ /*
+ * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
+ */
+- if (machine_is_versatile_ab() && is_sanyo_2_5_lcd) {
++ if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
+ void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
+ unsigned long ctrl;
+
+@@ -461,7 +173,6 @@ static void versatile_clcd_disable(struc
+ ctrl &= ~0x01;
+ writel(ctrl, versatile_ib2_ctrl);
+ }
+-#endif
+ }
+
+ /*
+@@ -502,11 +213,10 @@ static void versatile_clcd_enable(struct
+ val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
+ writel(val, sys_clcd);
+
+-#ifdef CONFIG_MACH_VERSATILE_AB
+ /*
+ * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
+ */
+- if (machine_is_versatile_ab() && is_sanyo_2_5_lcd) {
++ if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
+ void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
+ unsigned long ctrl;
+
+@@ -514,7 +224,6 @@ static void versatile_clcd_enable(struct
+ ctrl |= 0x01;
+ writel(ctrl, versatile_ib2_ctrl);
+ }
+-#endif
+ }
+
+ /*
+@@ -575,113 +284,6 @@ static struct clcd_board clcd_plat_data
+ .remove = versatile_clcd_remove_dma,
+ };
+
+-static struct pl061_platform_data gpio0_plat_data = {
+- .gpio_base = 0,
+- .irq_base = IRQ_GPIO0_START,
+-};
+-
+-static struct pl061_platform_data gpio1_plat_data = {
+- .gpio_base = 8,
+- .irq_base = IRQ_GPIO1_START,
+-};
+-
+-static struct pl061_platform_data gpio2_plat_data = {
+- .gpio_base = 16,
+- .irq_base = IRQ_GPIO2_START,
+-};
+-
+-static struct pl061_platform_data gpio3_plat_data = {
+- .gpio_base = 24,
+- .irq_base = IRQ_GPIO3_START,
+-};
+-
+-static struct pl022_ssp_controller ssp0_plat_data = {
+- .bus_id = 0,
+- .enable_dma = 0,
+- .num_chipselect = 1,
+-};
+-
+-#define AACI_IRQ { IRQ_AACI }
+-#define MMCI0_IRQ { IRQ_MMCI0A,IRQ_SIC_MMCI0B }
+-#define KMI0_IRQ { IRQ_SIC_KMI0 }
+-#define KMI1_IRQ { IRQ_SIC_KMI1 }
+-
+-/*
+- * These devices are connected directly to the multi-layer AHB switch
+- */
+-#define SMC_IRQ { }
+-#define MPMC_IRQ { }
+-#define CLCD_IRQ { IRQ_CLCDINT }
+-#define DMAC_IRQ { IRQ_DMAINT }
+-
+-/*
+- * These devices are connected via the core APB bridge
+- */
+-#define SCTL_IRQ { }
+-#define WATCHDOG_IRQ { IRQ_WDOGINT }
+-#define GPIO0_IRQ { IRQ_GPIOINT0 }
+-#define GPIO1_IRQ { IRQ_GPIOINT1 }
+-#define GPIO2_IRQ { IRQ_GPIOINT2 }
+-#define GPIO3_IRQ { IRQ_GPIOINT3 }
+-#define RTC_IRQ { IRQ_RTCINT }
+-
+-/*
+- * These devices are connected via the DMA APB bridge
+- */
+-#define SCI_IRQ { IRQ_SCIINT }
+-#define UART0_IRQ { IRQ_UARTINT0 }
+-#define UART1_IRQ { IRQ_UARTINT1 }
+-#define UART2_IRQ { IRQ_UARTINT2 }
+-#define SSP_IRQ { IRQ_SSPINT }
+-
+-/* FPGA Primecells */
+-APB_DEVICE(aaci, "fpga:04", AACI, NULL);
+-APB_DEVICE(mmc0, "fpga:05", MMCI0, &mmc0_plat_data);
+-APB_DEVICE(kmi0, "fpga:06", KMI0, NULL);
+-APB_DEVICE(kmi1, "fpga:07", KMI1, NULL);
+-
+-/* DevChip Primecells */
+-AHB_DEVICE(smc, "dev:00", SMC, NULL);
+-AHB_DEVICE(mpmc, "dev:10", MPMC, NULL);
+-AHB_DEVICE(clcd, "dev:20", CLCD, &clcd_plat_data);
+-AHB_DEVICE(dmac, "dev:30", DMAC, NULL);
+-APB_DEVICE(sctl, "dev:e0", SCTL, NULL);
+-APB_DEVICE(wdog, "dev:e1", WATCHDOG, NULL);
+-APB_DEVICE(gpio0, "dev:e4", GPIO0, &gpio0_plat_data);
+-APB_DEVICE(gpio1, "dev:e5", GPIO1, &gpio1_plat_data);
+-APB_DEVICE(gpio2, "dev:e6", GPIO2, &gpio2_plat_data);
+-APB_DEVICE(gpio3, "dev:e7", GPIO3, &gpio3_plat_data);
+-APB_DEVICE(rtc, "dev:e8", RTC, NULL);
+-APB_DEVICE(sci0, "dev:f0", SCI, NULL);
+-APB_DEVICE(uart0, "dev:f1", UART0, NULL);
+-APB_DEVICE(uart1, "dev:f2", UART1, NULL);
+-APB_DEVICE(uart2, "dev:f3", UART2, NULL);
+-APB_DEVICE(ssp0, "dev:f4", SSP, &ssp0_plat_data);
+-
+-static struct amba_device *amba_devs[] __initdata = {
+- &dmac_device,
+- &uart0_device,
+- &uart1_device,
+- &uart2_device,
+- &smc_device,
+- &mpmc_device,
+- &clcd_device,
+- &sctl_device,
+- &wdog_device,
+- &gpio0_device,
+- &gpio1_device,
+- &gpio2_device,
+- &gpio3_device,
+- &rtc_device,
+- &sci0_device,
+- &ssp0_device,
+- &aaci_device,
+- &mmc0_device,
+- &kmi0_device,
+- &kmi1_device,
+-};
+-
+-#ifdef CONFIG_OF
+ /*
+ * Lookup table for attaching a specific name and platform_data pointer to
+ * devices as they get created by of_platform_populate(). Ideally this table
+@@ -690,43 +292,12 @@ static struct amba_device *amba_devs[] _
+ */
+ struct of_dev_auxdata versatile_auxdata_lookup[] __initdata = {
+ OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI0_BASE, "fpga:05", &mmc0_plat_data),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_KMI0_BASE, "fpga:06", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_KMI1_BASE, "fpga:07", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART3_BASE, "fpga:09", NULL),
+- /* FIXME: this is buggy, the platform data is needed for this MMC instance too */
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI1_BASE, "fpga:0b", NULL),
++ OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI1_BASE, "fpga:0b", &mmc1_plat_data),
+
+ OF_DEV_AUXDATA("arm,primecell", VERSATILE_CLCD_BASE, "dev:20", &clcd_plat_data),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART0_BASE, "dev:f1", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART1_BASE, "dev:f2", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART2_BASE, "dev:f3", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_SSP_BASE, "dev:f4", &ssp0_plat_data),
+
+-#if 0
+- /*
+- * These entries are unnecessary because no clocks referencing
+- * them. I've left them in for now as place holders in case
+- * any of them need to be added back, but they should be
+- * removed before actually committing this patch. --gcl
+- */
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_AACI_BASE, "fpga:04", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_SCI1_BASE, "fpga:0a", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_SMC_BASE, "dev:00", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_MPMC_BASE, "dev:10", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_DMAC_BASE, "dev:30", NULL),
+-
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_SCTL_BASE, "dev:e0", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_WATCHDOG_BASE, "dev:e1", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_GPIO0_BASE, "dev:e4", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_GPIO1_BASE, "dev:e5", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_GPIO2_BASE, "dev:e6", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_GPIO3_BASE, "dev:e7", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_RTC_BASE, "dev:e8", NULL),
+- OF_DEV_AUXDATA("arm,primecell", VERSATILE_SCI_BASE, "dev:f0", NULL),
+-#endif
+ {}
+ };
+-#endif
+
+ void versatile_restart(enum reboot_mode mode, const char *cmd)
+ {
+@@ -745,12 +316,6 @@ void versatile_restart(enum reboot_mode
+ void __init versatile_init_early(void)
+ {
+ u32 val;
+- void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
+-
+- osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET;
+- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+-
+- versatile_sched_clock_init(sys + VERSATILE_SYS_24MHz_OFFSET, 24000000);
+
+ /*
+ * set clock frequency:
+@@ -764,45 +329,3 @@ void __init versatile_init_early(void)
+ (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
+ __io_address(VERSATILE_SCTL_BASE));
+ }
+-
+-void __init versatile_init(void)
+-{
+- int i;
+-
+- platform_device_register(&versatile_flash_device);
+- platform_device_register(&versatile_i2c_device);
+- platform_device_register(&smc91x_device);
+- platform_device_register(&char_lcd_device);
+- platform_device_register(&leds_device);
+-
+- for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
+- struct amba_device *d = amba_devs[i];
+- amba_device_register(d, &iomem_resource);
+- }
+-}
+-
+-/*
+- * Where is the timer (VA)?
+- */
+-#define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE)
+-#define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20)
+-#define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE)
+-#define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20)
+-
+-/*
+- * Set up timer interrupt, and return the current time in seconds.
+- */
+-void __init versatile_timer_init(void)
+-{
+-
+- /*
+- * Initialise to a known state (all timers off)
+- */
+- sp804_timer_disable(TIMER0_VA_BASE);
+- sp804_timer_disable(TIMER1_VA_BASE);
+- sp804_timer_disable(TIMER2_VA_BASE);
+- sp804_timer_disable(TIMER3_VA_BASE);
+-
+- sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
+- sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0");
+-}
+--- a/arch/arm/mach-versatile/core.h
++++ b/arch/arm/mach-versatile/core.h
+@@ -26,7 +26,8 @@
+ #include <linux/of_platform.h>
+ #include <linux/reboot.h>
+
+-extern void __init versatile_init(void);
++extern struct platform_device versatile_flash_device;
++
+ extern void __init versatile_init_early(void);
+ extern void __init versatile_init_irq(void);
+ extern void __init versatile_map_io(void);
+@@ -37,10 +38,4 @@ extern unsigned int mmc_status(struct de
+ extern struct of_dev_auxdata versatile_auxdata_lookup[];
+ #endif
+
+-#define APB_DEVICE(name, busid, base, plat) \
+-static AMBA_APB_DEVICE(name, busid, 0, VERSATILE_##base##_BASE, base##_IRQ, plat)
+-
+-#define AHB_DEVICE(name, busid, base, plat) \
+-static AMBA_AHB_DEVICE(name, busid, 0, VERSATILE_##base##_BASE, base##_IRQ, plat)
+-
+ #endif
+--- a/arch/arm/mach-versatile/include/mach/clkdev.h
++++ /dev/null
+@@ -1,16 +0,0 @@
+-#ifndef __ASM_MACH_CLKDEV_H
+-#define __ASM_MACH_CLKDEV_H
+-
+-#include <plat/clock.h>
+-
+-struct clk {
+- unsigned long rate;
+- const struct clk_ops *ops;
+- const struct icst_params *params;
+- void __iomem *vcoreg;
+-};
+-
+-#define __clk_get(clk) ({ 1; })
+-#define __clk_put(clk) do { } while (0)
+-
+-#endif
+--- a/arch/arm/mach-versatile/include/mach/hardware.h
++++ b/arch/arm/mach-versatile/include/mach/hardware.h
+@@ -24,12 +24,6 @@
+
+ #include <asm/sizes.h>
+
+-/*
+- * PCI space virtual addresses
+- */
+-#define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul
+-#define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul
+-
+ /* macro to get at MMIO space when running virtually */
+ #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
+
+--- a/arch/arm/mach-versatile/include/mach/irqs.h
++++ /dev/null
+@@ -1,134 +0,0 @@
+-/*
+- * arch/arm/mach-versatile/include/mach/irqs.h
+- *
+- * Copyright (C) 2003 ARM Limited
+- * Copyright (C) 2000 Deep Blue Solutions Ltd.
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#include <mach/platform.h>
+-
+-/*
+- * IRQ interrupts definitions are the same as the INT definitions
+- * held within platform.h
+- */
+-#define IRQ_VIC_START 32
+-#define IRQ_WDOGINT (IRQ_VIC_START + INT_WDOGINT)
+-#define IRQ_SOFTINT (IRQ_VIC_START + INT_SOFTINT)
+-#define IRQ_COMMRx (IRQ_VIC_START + INT_COMMRx)
+-#define IRQ_COMMTx (IRQ_VIC_START + INT_COMMTx)
+-#define IRQ_TIMERINT0_1 (IRQ_VIC_START + INT_TIMERINT0_1)
+-#define IRQ_TIMERINT2_3 (IRQ_VIC_START + INT_TIMERINT2_3)
+-#define IRQ_GPIOINT0 (IRQ_VIC_START + INT_GPIOINT0)
+-#define IRQ_GPIOINT1 (IRQ_VIC_START + INT_GPIOINT1)
+-#define IRQ_GPIOINT2 (IRQ_VIC_START + INT_GPIOINT2)
+-#define IRQ_GPIOINT3 (IRQ_VIC_START + INT_GPIOINT3)
+-#define IRQ_RTCINT (IRQ_VIC_START + INT_RTCINT)
+-#define IRQ_SSPINT (IRQ_VIC_START + INT_SSPINT)
+-#define IRQ_UARTINT0 (IRQ_VIC_START + INT_UARTINT0)
+-#define IRQ_UARTINT1 (IRQ_VIC_START + INT_UARTINT1)
+-#define IRQ_UARTINT2 (IRQ_VIC_START + INT_UARTINT2)
+-#define IRQ_SCIINT (IRQ_VIC_START + INT_SCIINT)
+-#define IRQ_CLCDINT (IRQ_VIC_START + INT_CLCDINT)
+-#define IRQ_DMAINT (IRQ_VIC_START + INT_DMAINT)
+-#define IRQ_PWRFAILINT (IRQ_VIC_START + INT_PWRFAILINT)
+-#define IRQ_MBXINT (IRQ_VIC_START + INT_MBXINT)
+-#define IRQ_GNDINT (IRQ_VIC_START + INT_GNDINT)
+-#define IRQ_VICSOURCE21 (IRQ_VIC_START + INT_VICSOURCE21)
+-#define IRQ_VICSOURCE22 (IRQ_VIC_START + INT_VICSOURCE22)
+-#define IRQ_VICSOURCE23 (IRQ_VIC_START + INT_VICSOURCE23)
+-#define IRQ_VICSOURCE24 (IRQ_VIC_START + INT_VICSOURCE24)
+-#define IRQ_VICSOURCE25 (IRQ_VIC_START + INT_VICSOURCE25)
+-#define IRQ_VICSOURCE26 (IRQ_VIC_START + INT_VICSOURCE26)
+-#define IRQ_VICSOURCE27 (IRQ_VIC_START + INT_VICSOURCE27)
+-#define IRQ_VICSOURCE28 (IRQ_VIC_START + INT_VICSOURCE28)
+-#define IRQ_VICSOURCE29 (IRQ_VIC_START + INT_VICSOURCE29)
+-#define IRQ_VICSOURCE30 (IRQ_VIC_START + INT_VICSOURCE30)
+-#define IRQ_VICSOURCE31 (IRQ_VIC_START + INT_VICSOURCE31)
+-#define IRQ_VIC_END (IRQ_VIC_START + 31)
+-
+-/*
+- * FIQ interrupts definitions are the same as the INT definitions.
+- */
+-#define FIQ_WDOGINT INT_WDOGINT
+-#define FIQ_SOFTINT INT_SOFTINT
+-#define FIQ_COMMRx INT_COMMRx
+-#define FIQ_COMMTx INT_COMMTx
+-#define FIQ_TIMERINT0_1 INT_TIMERINT0_1
+-#define FIQ_TIMERINT2_3 INT_TIMERINT2_3
+-#define FIQ_GPIOINT0 INT_GPIOINT0
+-#define FIQ_GPIOINT1 INT_GPIOINT1
+-#define FIQ_GPIOINT2 INT_GPIOINT2
+-#define FIQ_GPIOINT3 INT_GPIOINT3
+-#define FIQ_RTCINT INT_RTCINT
+-#define FIQ_SSPINT INT_SSPINT
+-#define FIQ_UARTINT0 INT_UARTINT0
+-#define FIQ_UARTINT1 INT_UARTINT1
+-#define FIQ_UARTINT2 INT_UARTINT2
+-#define FIQ_SCIINT INT_SCIINT
+-#define FIQ_CLCDINT INT_CLCDINT
+-#define FIQ_DMAINT INT_DMAINT
+-#define FIQ_PWRFAILINT INT_PWRFAILINT
+-#define FIQ_MBXINT INT_MBXINT
+-#define FIQ_GNDINT INT_GNDINT
+-#define FIQ_VICSOURCE21 INT_VICSOURCE21
+-#define FIQ_VICSOURCE22 INT_VICSOURCE22
+-#define FIQ_VICSOURCE23 INT_VICSOURCE23
+-#define FIQ_VICSOURCE24 INT_VICSOURCE24
+-#define FIQ_VICSOURCE25 INT_VICSOURCE25
+-#define FIQ_VICSOURCE26 INT_VICSOURCE26
+-#define FIQ_VICSOURCE27 INT_VICSOURCE27
+-#define FIQ_VICSOURCE28 INT_VICSOURCE28
+-#define FIQ_VICSOURCE29 INT_VICSOURCE29
+-#define FIQ_VICSOURCE30 INT_VICSOURCE30
+-#define FIQ_VICSOURCE31 INT_VICSOURCE31
+-
+-
+-/*
+- * Secondary interrupt controller
+- */
+-#define IRQ_SIC_START 64
+-#define IRQ_SIC_MMCI0B (IRQ_SIC_START + SIC_INT_MMCI0B)
+-#define IRQ_SIC_MMCI1B (IRQ_SIC_START + SIC_INT_MMCI1B)
+-#define IRQ_SIC_KMI0 (IRQ_SIC_START + SIC_INT_KMI0)
+-#define IRQ_SIC_KMI1 (IRQ_SIC_START + SIC_INT_KMI1)
+-#define IRQ_SIC_SCI3 (IRQ_SIC_START + SIC_INT_SCI3)
+-#define IRQ_SIC_UART3 (IRQ_SIC_START + SIC_INT_UART3)
+-#define IRQ_SIC_CLCD (IRQ_SIC_START + SIC_INT_CLCD)
+-#define IRQ_SIC_TOUCH (IRQ_SIC_START + SIC_INT_TOUCH)
+-#define IRQ_SIC_KEYPAD (IRQ_SIC_START + SIC_INT_KEYPAD)
+-#define IRQ_SIC_DoC (IRQ_SIC_START + SIC_INT_DoC)
+-#define IRQ_SIC_MMCI0A (IRQ_SIC_START + SIC_INT_MMCI0A)
+-#define IRQ_SIC_MMCI1A (IRQ_SIC_START + SIC_INT_MMCI1A)
+-#define IRQ_SIC_AACI (IRQ_SIC_START + SIC_INT_AACI)
+-#define IRQ_SIC_ETH (IRQ_SIC_START + SIC_INT_ETH)
+-#define IRQ_SIC_USB (IRQ_SIC_START + SIC_INT_USB)
+-#define IRQ_SIC_PCI0 (IRQ_SIC_START + SIC_INT_PCI0)
+-#define IRQ_SIC_PCI1 (IRQ_SIC_START + SIC_INT_PCI1)
+-#define IRQ_SIC_PCI2 (IRQ_SIC_START + SIC_INT_PCI2)
+-#define IRQ_SIC_PCI3 (IRQ_SIC_START + SIC_INT_PCI3)
+-#define IRQ_SIC_END 95
+-
+-#define IRQ_GPIO0_START (IRQ_SIC_END + 1)
+-#define IRQ_GPIO0_END (IRQ_GPIO0_START + 31)
+-#define IRQ_GPIO1_START (IRQ_GPIO0_END + 1)
+-#define IRQ_GPIO1_END (IRQ_GPIO1_START + 31)
+-#define IRQ_GPIO2_START (IRQ_GPIO1_END + 1)
+-#define IRQ_GPIO2_END (IRQ_GPIO2_START + 31)
+-#define IRQ_GPIO3_START (IRQ_GPIO2_END + 1)
+-#define IRQ_GPIO3_END (IRQ_GPIO3_START + 31)
+-
+-#define NR_IRQS (IRQ_GPIO3_END + 1)
+--- a/arch/arm/mach-versatile/include/mach/platform.h
++++ b/arch/arm/mach-versatile/include/mach/platform.h
+@@ -185,79 +185,13 @@
+ /*
+ * VERSATILE peripheral addresses
+ */
+-#define VERSATILE_PCI_CORE_BASE 0x10001000 /* PCI core control */
+-#define VERSATILE_I2C_BASE 0x10002000 /* I2C control */
+-#define VERSATILE_SIC_BASE 0x10003000 /* Secondary interrupt controller */
+-#define VERSATILE_AACI_BASE 0x10004000 /* Audio */
+ #define VERSATILE_MMCI0_BASE 0x10005000 /* MMC interface */
+-#define VERSATILE_KMI0_BASE 0x10006000 /* KMI interface */
+-#define VERSATILE_KMI1_BASE 0x10007000 /* KMI 2nd interface */
+-#define VERSATILE_CHAR_LCD_BASE 0x10008000 /* Character LCD */
+-#define VERSATILE_UART3_BASE 0x10009000 /* UART 3 */
+-#define VERSATILE_SCI1_BASE 0x1000A000
+ #define VERSATILE_MMCI1_BASE 0x1000B000 /* MMC Interface */
+- /* 0x1000C000 - 0x1000CFFF = reserved */
+-#define VERSATILE_ETH_BASE 0x10010000 /* Ethernet */
+-#define VERSATILE_USB_BASE 0x10020000 /* USB */
+- /* 0x10030000 - 0x100FFFFF = reserved */
+-#define VERSATILE_SMC_BASE 0x10100000 /* SMC */
+-#define VERSATILE_MPMC_BASE 0x10110000 /* MPMC */
+ #define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */
+-#define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */
+-#define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */
+-#define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */
+- /* 0x10000000 - 0x100FFFFF */
+-#define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */
+ #define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */
+-#define VERSATILE_WATCHDOG_BASE 0x101E1000 /* Watchdog */
+-#define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */
+-#define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */
+-#define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */
+-#define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */
+-#define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */
+-#define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */
+-#define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */
+- /* 0x101E9000 - reserved */
+-#define VERSATILE_SCI_BASE 0x101F0000 /* Smart card controller */
+-#define VERSATILE_UART0_BASE 0x101F1000 /* Uart 0 */
+-#define VERSATILE_UART1_BASE 0x101F2000 /* Uart 1 */
+-#define VERSATILE_UART2_BASE 0x101F3000 /* Uart 2 */
+-#define VERSATILE_SSP_BASE 0x101F4000 /* Synchronous Serial Port */
+-
+-#define VERSATILE_SSMC_BASE 0x20000000 /* SSMC */
+ #define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */
+-#define VERSATILE_MBX_BASE 0x40000000 /* MBX */
+-
+-/* PCI space */
+-#define VERSATILE_PCI_BASE 0x41000000 /* PCI Interface */
+-#define VERSATILE_PCI_CFG_BASE 0x42000000
+-#define VERSATILE_PCI_IO_BASE 0x43000000
+-#define VERSATILE_PCI_MEM_BASE0 0x44000000
+-#define VERSATILE_PCI_MEM_BASE1 0x50000000
+-#define VERSATILE_PCI_MEM_BASE2 0x60000000
+-/* Sizes of above maps */
+-#define VERSATILE_PCI_BASE_SIZE 0x01000000
+-#define VERSATILE_PCI_CFG_BASE_SIZE 0x02000000
+-#define VERSATILE_PCI_IO_BASE_SIZE 0x01000000
+-#define VERSATILE_PCI_MEM_BASE0_SIZE 0x0c000000 /* 32Mb */
+-#define VERSATILE_PCI_MEM_BASE1_SIZE 0x10000000 /* 256Mb */
+-#define VERSATILE_PCI_MEM_BASE2_SIZE 0x10000000 /* 256Mb */
+-
+-#define VERSATILE_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */
+-#define VERSATILE_LT_BASE 0x80000000 /* Logic Tile expansion */
+
+ /*
+- * Disk on Chip
+- */
+-#define VERSATILE_DOC_BASE 0x2C000000
+-#define VERSATILE_DOC_SIZE (16 << 20)
+-#define VERSATILE_DOC_PAGE_SIZE 512
+-#define VERSATILE_DOC_TOTAL_PAGES (DOC_SIZE / PAGE_SIZE)
+-
+-#define ERASE_UNIT_PAGES 32
+-#define START_PAGE 0x80
+-
+-/*
+ * LED settings, bits [7:0]
+ */
+ #define VERSATILE_SYS_LED0 (1 << 0)
+@@ -281,106 +215,6 @@
+ #define VERSATILE_INTREG_OFFSET 0x8 /* Interrupt control */
+ #define VERSATILE_DECODE_OFFSET 0xC /* Fitted logic modules */
+
+-
+-/* ------------------------------------------------------------------------
+- * Versatile Interrupt Controller - control registers
+- * ------------------------------------------------------------------------
+- *
+- * Offsets from interrupt controller base
+- *
+- * System Controller interrupt controller base is
+- *
+- * VERSATILE_IC_BASE
+- *
+- * Core Module interrupt controller base is
+- *
+- * VERSATILE_SYS_IC
+- *
+- */
+-/* VIC definitions in include/asm-arm/hardware/vic.h */
+-
+-#define SIC_IRQ_STATUS 0
+-#define SIC_IRQ_RAW_STATUS 0x04
+-#define SIC_IRQ_ENABLE 0x08
+-#define SIC_IRQ_ENABLE_SET 0x08
+-#define SIC_IRQ_ENABLE_CLEAR 0x0C
+-#define SIC_INT_SOFT_SET 0x10
+-#define SIC_INT_SOFT_CLEAR 0x14
+-#define SIC_INT_PIC_ENABLE 0x20 /* read status of pass through mask */
+-#define SIC_INT_PIC_ENABLES 0x20 /* set interrupt pass through bits */
+-#define SIC_INT_PIC_ENABLEC 0x24 /* Clear interrupt pass through bits */
+-
+-/* ------------------------------------------------------------------------
+- * Interrupts - bit assignment (primary)
+- * ------------------------------------------------------------------------
+- */
+-
+-#define INT_WDOGINT 0 /* Watchdog timer */
+-#define INT_SOFTINT 1 /* Software interrupt */
+-#define INT_COMMRx 2 /* Debug Comm Rx interrupt */
+-#define INT_COMMTx 3 /* Debug Comm Tx interrupt */
+-#define INT_TIMERINT0_1 4 /* Timer 0 and 1 */
+-#define INT_TIMERINT2_3 5 /* Timer 2 and 3 */
+-#define INT_GPIOINT0 6 /* GPIO 0 */
+-#define INT_GPIOINT1 7 /* GPIO 1 */
+-#define INT_GPIOINT2 8 /* GPIO 2 */
+-#define INT_GPIOINT3 9 /* GPIO 3 */
+-#define INT_RTCINT 10 /* Real Time Clock */
+-#define INT_SSPINT 11 /* Synchronous Serial Port */
+-#define INT_UARTINT0 12 /* UART 0 on development chip */
+-#define INT_UARTINT1 13 /* UART 1 on development chip */
+-#define INT_UARTINT2 14 /* UART 2 on development chip */
+-#define INT_SCIINT 15 /* Smart Card Interface */
+-#define INT_CLCDINT 16 /* CLCD controller */
+-#define INT_DMAINT 17 /* DMA controller */
+-#define INT_PWRFAILINT 18 /* Power failure */
+-#define INT_MBXINT 19 /* Graphics processor */
+-#define INT_GNDINT 20 /* Reserved */
+- /* External interrupt signals from logic tiles or secondary controller */
+-#define INT_VICSOURCE21 21 /* Disk on Chip */
+-#define INT_VICSOURCE22 22 /* MCI0A */
+-#define INT_VICSOURCE23 23 /* MCI1A */
+-#define INT_VICSOURCE24 24 /* AACI */
+-#define INT_VICSOURCE25 25 /* Ethernet */
+-#define INT_VICSOURCE26 26 /* USB */
+-#define INT_VICSOURCE27 27 /* PCI 0 */
+-#define INT_VICSOURCE28 28 /* PCI 1 */
+-#define INT_VICSOURCE29 29 /* PCI 2 */
+-#define INT_VICSOURCE30 30 /* PCI 3 */
+-#define INT_VICSOURCE31 31 /* SIC source */
+-
+-#define VERSATILE_SC_VALID_INT 0x003FFFFF
+-
+-#define MAXIRQNUM 31
+-#define MAXFIQNUM 31
+-#define MAXSWINUM 31
+-
+-/* ------------------------------------------------------------------------
+- * Interrupts - bit assignment (secondary)
+- * ------------------------------------------------------------------------
+- */
+-#define SIC_INT_MMCI0B 1 /* Multimedia Card 0B */
+-#define SIC_INT_MMCI1B 2 /* Multimedia Card 1B */
+-#define SIC_INT_KMI0 3 /* Keyboard/Mouse port 0 */
+-#define SIC_INT_KMI1 4 /* Keyboard/Mouse port 1 */
+-#define SIC_INT_SCI3 5 /* Smart Card interface */
+-#define SIC_INT_UART3 6 /* UART 3 empty or data available */
+-#define SIC_INT_CLCD 7 /* Character LCD */
+-#define SIC_INT_TOUCH 8 /* Touchscreen */
+-#define SIC_INT_KEYPAD 9 /* Key pressed on display keypad */
+- /* 10:20 - reserved */
+-#define SIC_INT_DoC 21 /* Disk on Chip memory controller */
+-#define SIC_INT_MMCI0A 22 /* MMC 0A */
+-#define SIC_INT_MMCI1A 23 /* MMC 1A */
+-#define SIC_INT_AACI 24 /* Audio Codec */
+-#define SIC_INT_ETH 25 /* Ethernet controller */
+-#define SIC_INT_USB 26 /* USB controller */
+-#define SIC_INT_PCI0 27
+-#define SIC_INT_PCI1 28
+-#define SIC_INT_PCI2 29
+-#define SIC_INT_PCI3 30
+-
+-
+ /*
+ * System controller bit assignment
+ */
+@@ -393,16 +227,9 @@
+ #define VERSATILE_TIMER4_EnSel 21
+
+
+-#define VERSATILE_CSR_BASE 0x10000000
+-#define VERSATILE_CSR_SIZE 0x10000000
+-
+-#ifdef CONFIG_MACH_VERSATILE_AB
+ /*
+ * IB2 Versatile/AB expansion board definitions
+ */
+-#define VERSATILE_IB2_CAMERA_BANK VERSATILE_IB2_BASE
+-#define VERSATILE_IB2_KBD_DATAREG (VERSATILE_IB2_BASE + 0x01000000)
+-
+ /* VICINTSOURCE27 */
+ #define VERSATILE_IB2_INT_BASE (VERSATILE_IB2_BASE + 0x02000000)
+ #define VERSATILE_IB2_IER (VERSATILE_IB2_INT_BASE + 0)
+@@ -411,6 +238,5 @@
+ #define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000)
+ #define VERSATILE_IB2_CTRL (VERSATILE_IB2_CTL_BASE + 0)
+ #define VERSATILE_IB2_STAT (VERSATILE_IB2_CTL_BASE + 4)
+-#endif
+
+ #endif
+--- a/arch/arm/mach-versatile/pci.c
++++ /dev/null
+@@ -1,368 +0,0 @@
+-/*
+- * linux/arch/arm/mach-versatile/pci.c
+- *
+- * (C) Copyright Koninklijke Philips Electronics NV 2004. All rights reserved.
+- * You can redistribute and/or modify this software under the terms of version 2
+- * of the GNU General Public License as published by the Free Software Foundation.
+- * THIS SOFTWARE IS PROVIDED "AS IS" 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.
+- * Koninklijke Philips Electronics nor its subsidiaries is obligated to provide any support for this software.
+- *
+- * ARM Versatile PCI driver.
+- *
+- * 14/04/2005 Initial version, colin.king at philips.com
+- *
+- */
+-#include <linux/kernel.h>
+-#include <linux/pci.h>
+-#include <linux/ioport.h>
+-#include <linux/interrupt.h>
+-#include <linux/spinlock.h>
+-#include <linux/init.h>
+-#include <linux/io.h>
+-
+-#include <mach/hardware.h>
+-#include <mach/irqs.h>
+-#include <asm/irq.h>
+-#include <asm/mach/pci.h>
+-
+-/*
+- * these spaces are mapped using the following base registers:
+- *
+- * Usage Local Bus Memory Base/Map registers used
+- *
+- * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0, non prefetch
+- * Mem 60000000 - 6FFFFFFF LB_BASE1/LB_MAP1, prefetch
+- * IO 44000000 - 4FFFFFFF LB_BASE2/LB_MAP2, IO
+- * Cfg 42000000 - 42FFFFFF PCI config
+- *
+- */
+-#define __IO_ADDRESS(n) ((void __iomem *)(unsigned long)IO_ADDRESS(n))
+-#define SYS_PCICTL __IO_ADDRESS(VERSATILE_SYS_PCICTL)
+-#define PCI_IMAP0 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x0)
+-#define PCI_IMAP1 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x4)
+-#define PCI_IMAP2 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x8)
+-#define PCI_SMAP0 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x14)
+-#define PCI_SMAP1 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x18)
+-#define PCI_SMAP2 __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0x1c)
+-#define PCI_SELFID __IO_ADDRESS(VERSATILE_PCI_CORE_BASE+0xc)
+-
+-#define DEVICE_ID_OFFSET 0x00
+-#define CSR_OFFSET 0x04
+-#define CLASS_ID_OFFSET 0x08
+-
+-#define VP_PCI_DEVICE_ID 0x030010ee
+-#define VP_PCI_CLASS_ID 0x0b400000
+-
+-static unsigned long pci_slot_ignore = 0;
+-
+-static int __init versatile_pci_slot_ignore(char *str)
+-{
+- int retval;
+- int slot;
+-
+- while ((retval = get_option(&str,&slot))) {
+- if ((slot < 0) || (slot > 31)) {
+- printk("Illegal slot value: %d\n",slot);
+- } else {
+- pci_slot_ignore |= (1 << slot);
+- }
+- }
+- return 1;
+-}
+-
+-__setup("pci_slot_ignore=", versatile_pci_slot_ignore);
+-
+-
+-static void __iomem *__pci_addr(struct pci_bus *bus,
+- unsigned int devfn, int offset)
+-{
+- unsigned int busnr = bus->number;
+-
+- /*
+- * Trap out illegal values
+- */
+- if (offset > 255)
+- BUG();
+- if (busnr > 255)
+- BUG();
+- if (devfn > 255)
+- BUG();
+-
+- return VERSATILE_PCI_CFG_VIRT_BASE + ((busnr << 16) |
+- (PCI_SLOT(devfn) << 11) | (PCI_FUNC(devfn) << 8) | offset);
+-}
+-
+-static int versatile_read_config(struct pci_bus *bus, unsigned int devfn, int where,
+- int size, u32 *val)
+-{
+- void __iomem *addr = __pci_addr(bus, devfn, where & ~3);
+- u32 v;
+- int slot = PCI_SLOT(devfn);
+-
+- if (pci_slot_ignore & (1 << slot)) {
+- /* Ignore this slot */
+- switch (size) {
+- case 1:
+- v = 0xff;
+- break;
+- case 2:
+- v = 0xffff;
+- break;
+- default:
+- v = 0xffffffff;
+- }
+- } else {
+- switch (size) {
+- case 1:
+- v = __raw_readl(addr);
+- if (where & 2) v >>= 16;
+- if (where & 1) v >>= 8;
+- v &= 0xff;
+- break;
+-
+- case 2:
+- v = __raw_readl(addr);
+- if (where & 2) v >>= 16;
+- v &= 0xffff;
+- break;
+-
+- default:
+- v = __raw_readl(addr);
+- break;
+- }
+- }
+-
+- *val = v;
+- return PCIBIOS_SUCCESSFUL;
+-}
+-
+-static int versatile_write_config(struct pci_bus *bus, unsigned int devfn, int where,
+- int size, u32 val)
+-{
+- void __iomem *addr = __pci_addr(bus, devfn, where);
+- int slot = PCI_SLOT(devfn);
+-
+- if (pci_slot_ignore & (1 << slot)) {
+- return PCIBIOS_SUCCESSFUL;
+- }
+-
+- switch (size) {
+- case 1:
+- __raw_writeb((u8)val, addr);
+- break;
+-
+- case 2:
+- __raw_writew((u16)val, addr);
+- break;
+-
+- case 4:
+- __raw_writel(val, addr);
+- break;
+- }
+-
+- return PCIBIOS_SUCCESSFUL;
+-}
+-
+-static struct pci_ops pci_versatile_ops = {
+- .read = versatile_read_config,
+- .write = versatile_write_config,
+-};
+-
+-static struct resource unused_mem = {
+- .name = "PCI unused",
+- .start = VERSATILE_PCI_MEM_BASE0,
+- .end = VERSATILE_PCI_MEM_BASE0+VERSATILE_PCI_MEM_BASE0_SIZE-1,
+- .flags = IORESOURCE_MEM,
+-};
+-
+-static struct resource non_mem = {
+- .name = "PCI non-prefetchable",
+- .start = VERSATILE_PCI_MEM_BASE1,
+- .end = VERSATILE_PCI_MEM_BASE1+VERSATILE_PCI_MEM_BASE1_SIZE-1,
+- .flags = IORESOURCE_MEM,
+-};
+-
+-static struct resource pre_mem = {
+- .name = "PCI prefetchable",
+- .start = VERSATILE_PCI_MEM_BASE2,
+- .end = VERSATILE_PCI_MEM_BASE2+VERSATILE_PCI_MEM_BASE2_SIZE-1,
+- .flags = IORESOURCE_MEM | IORESOURCE_PREFETCH,
+-};
+-
+-static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
+-{
+- int ret = 0;
+-
+- ret = request_resource(&iomem_resource, &unused_mem);
+- if (ret) {
+- printk(KERN_ERR "PCI: unable to allocate unused "
+- "memory region (%d)\n", ret);
+- goto out;
+- }
+- ret = request_resource(&iomem_resource, &non_mem);
+- if (ret) {
+- printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
+- "memory region (%d)\n", ret);
+- goto release_unused_mem;
+- }
+- ret = request_resource(&iomem_resource, &pre_mem);
+- if (ret) {
+- printk(KERN_ERR "PCI: unable to allocate prefetchable "
+- "memory region (%d)\n", ret);
+- goto release_non_mem;
+- }
+-
+- /*
+- * the mem resource for this bus
+- * the prefetch mem resource for this bus
+- */
+- pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset);
+- pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset);
+-
+- goto out;
+-
+- release_non_mem:
+- release_resource(&non_mem);
+- release_unused_mem:
+- release_resource(&unused_mem);
+- out:
+- return ret;
+-}
+-
+-int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
+-{
+- int ret = 0;
+- int i;
+- int myslot = -1;
+- unsigned long val;
+- void __iomem *local_pci_cfg_base;
+-
+- val = __raw_readl(SYS_PCICTL);
+- if (!(val & 1)) {
+- printk("Not plugged into PCI backplane!\n");
+- ret = -EIO;
+- goto out;
+- }
+-
+- ret = pci_ioremap_io(0, VERSATILE_PCI_IO_BASE);
+- if (ret)
+- goto out;
+-
+- if (nr == 0) {
+- ret = pci_versatile_setup_resources(sys);
+- if (ret < 0) {
+- printk("pci_versatile_setup: resources... oops?\n");
+- goto out;
+- }
+- } else {
+- printk("pci_versatile_setup: resources... nr == 0??\n");
+- goto out;
+- }
+-
+- /*
+- * We need to discover the PCI core first to configure itself
+- * before the main PCI probing is performed
+- */
+- for (i=0; i<32; i++)
+- if ((__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+DEVICE_ID_OFFSET) == VP_PCI_DEVICE_ID) &&
+- (__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+CLASS_ID_OFFSET) == VP_PCI_CLASS_ID)) {
+- myslot = i;
+- break;
+- }
+-
+- if (myslot == -1) {
+- printk("Cannot find PCI core!\n");
+- ret = -EIO;
+- goto out;
+- }
+-
+- printk("PCI core found (slot %d)\n",myslot);
+-
+- __raw_writel(myslot, PCI_SELFID);
+- local_pci_cfg_base = VERSATILE_PCI_CFG_VIRT_BASE + (myslot << 11);
+-
+- val = __raw_readl(local_pci_cfg_base + CSR_OFFSET);
+- val |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
+- __raw_writel(val, local_pci_cfg_base + CSR_OFFSET);
+-
+- /*
+- * Configure the PCI inbound memory windows to be 1:1 mapped to SDRAM
+- */
+- __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_0);
+- __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_1);
+- __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_2);
+-
+- /*
+- * For many years the kernel and QEMU were symbiotically buggy
+- * in that they both assumed the same broken IRQ mapping.
+- * QEMU therefore attempts to auto-detect old broken kernels
+- * so that they still work on newer QEMU as they did on old
+- * QEMU. Since we now use the correct (ie matching-hardware)
+- * IRQ mapping we write a definitely different value to a
+- * PCI_INTERRUPT_LINE register to tell QEMU that we expect
+- * real hardware behaviour and it need not be backwards
+- * compatible for us. This write is harmless on real hardware.
+- */
+- __raw_writel(0, VERSATILE_PCI_VIRT_BASE+PCI_INTERRUPT_LINE);
+-
+- /*
+- * Do not to map Versatile FPGA PCI device into memory space
+- */
+- pci_slot_ignore |= (1 << myslot);
+- ret = 1;
+-
+- out:
+- return ret;
+-}
+-
+-
+-void __init pci_versatile_preinit(void)
+-{
+- pcibios_min_mem = 0x50000000;
+-
+- __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0);
+- __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28, PCI_IMAP1);
+- __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28, PCI_IMAP2);
+-
+- __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP0);
+- __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP1);
+- __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP2);
+-
+- __raw_writel(1, SYS_PCICTL);
+-}
+-
+-/*
+- * map the specified device/slot/pin to an IRQ. Different backplanes may need to modify this.
+- */
+-static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+-{
+- int irq;
+-
+- /*
+- * Slot INTA INTB INTC INTD
+- * 31 PCI1 PCI2 PCI3 PCI0
+- * 30 PCI0 PCI1 PCI2 PCI3
+- * 29 PCI3 PCI0 PCI1 PCI2
+- */
+- irq = IRQ_SIC_PCI0 + ((slot + 2 + pin - 1) & 3);
+-
+- return irq;
+-}
+-
+-static struct hw_pci versatile_pci __initdata = {
+- .map_irq = versatile_map_irq,
+- .nr_controllers = 1,
+- .ops = &pci_versatile_ops,
+- .setup = pci_versatile_setup,
+- .preinit = pci_versatile_preinit,
+-};
+-
+-static int __init versatile_pci_init(void)
+-{
+- pci_common_init(&versatile_pci);
+- return 0;
+-}
+-
+-subsys_initcall(versatile_pci_init);
+--- a/arch/arm/mach-versatile/versatile_ab.c
++++ /dev/null
+@@ -1,44 +0,0 @@
+-/*
+- * linux/arch/arm/mach-versatile/versatile_ab.c
+- *
+- * Copyright (C) 2004 ARM Limited
+- * Copyright (C) 2000 Deep Blue Solutions Ltd
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#include <linux/init.h>
+-#include <linux/device.h>
+-#include <linux/amba/bus.h>
+-#include <linux/io.h>
+-
+-#include <mach/hardware.h>
+-#include <asm/irq.h>
+-#include <asm/mach-types.h>
+-
+-#include <asm/mach/arch.h>
+-
+-#include "core.h"
+-
+-MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
+- /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
+- .atag_offset = 0x100,
+- .map_io = versatile_map_io,
+- .init_early = versatile_init_early,
+- .init_irq = versatile_init_irq,
+- .init_time = versatile_timer_init,
+- .init_machine = versatile_init,
+- .restart = versatile_restart,
+-MACHINE_END
+--- a/arch/arm/mach-versatile/versatile_dt.c
++++ b/arch/arm/mach-versatile/versatile_dt.c
+@@ -81,6 +81,7 @@ static void __init versatile_dt_init(voi
+
+ versatile_dt_pci_init();
+
++ platform_device_register(&versatile_flash_device);
+ of_platform_populate(NULL, of_default_bus_match_table,
+ versatile_auxdata_lookup, NULL);
+ }
+--- a/arch/arm/mach-versatile/versatile_pb.c
++++ /dev/null
+@@ -1,91 +0,0 @@
+-/*
+- * linux/arch/arm/mach-versatile/versatile_pb.c
+- *
+- * Copyright (C) 2004 ARM Limited
+- * Copyright (C) 2000 Deep Blue Solutions Ltd
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public License
+- * along with this program; if not, write to the Free Software
+- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+- */
+-
+-#include <linux/init.h>
+-#include <linux/device.h>
+-#include <linux/amba/bus.h>
+-#include <linux/amba/pl061.h>
+-#include <linux/amba/mmci.h>
+-#include <linux/io.h>
+-
+-#include <mach/hardware.h>
+-#include <asm/irq.h>
+-#include <asm/mach-types.h>
+-
+-#include <asm/mach/arch.h>
+-
+-#include "core.h"
+-
+-#if 1
+-#define IRQ_MMCI1A IRQ_VICSOURCE23
+-#else
+-#define IRQ_MMCI1A IRQ_SIC_MMCI1A
+-#endif
+-
+-static struct mmci_platform_data mmc1_plat_data = {
+- .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
+- .status = mmc_status,
+- .gpio_wp = -1,
+- .gpio_cd = -1,
+-};
+-
+-#define UART3_IRQ { IRQ_SIC_UART3 }
+-#define SCI1_IRQ { IRQ_SIC_SCI3 }
+-#define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B }
+-
+-/*
+- * These devices are connected via the DMA APB bridge
+- */
+-
+-/* FPGA Primecells */
+-APB_DEVICE(uart3, "fpga:09", UART3, NULL);
+-APB_DEVICE(sci1, "fpga:0a", SCI1, NULL);
+-APB_DEVICE(mmc1, "fpga:0b", MMCI1, &mmc1_plat_data);
+-
+-
+-static struct amba_device *amba_devs[] __initdata = {
+- &uart3_device,
+- &sci1_device,
+- &mmc1_device,
+-};
+-
+-static void __init versatile_pb_init(void)
+-{
+- int i;
+-
+- versatile_init();
+-
+- for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
+- struct amba_device *d = amba_devs[i];
+- amba_device_register(d, &iomem_resource);
+- }
+-}
+-
+-MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
+- /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
+- .atag_offset = 0x100,
+- .map_io = versatile_map_io,
+- .init_early = versatile_init_early,
+- .init_irq = versatile_init_irq,
+- .init_time = versatile_timer_init,
+- .init_machine = versatile_pb_init,
+- .restart = versatile_restart,
+-MACHINE_END
+--- a/drivers/clk/versatile/Kconfig
++++ b/drivers/clk/versatile/Kconfig
+@@ -1,6 +1,8 @@
+ config COMMON_CLK_VERSATILE
+ bool "Clock driver for ARM Reference designs"
+- depends on ARCH_INTEGRATOR || ARCH_REALVIEW || ARCH_VEXPRESS || ARM64 || COMPILE_TEST
++ depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
++ ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
++ COMPILE_TEST
+ ---help---
+ Supports clocking on ARM Reference designs:
+ - Integrator/AP and Integrator/CP
diff --git a/debian/patches/features/arm/clk-realview-stop-using-machine-headers.patch b/debian/patches/features/arm/clk-realview-stop-using-machine-headers.patch
new file mode 100644
index 0000000..c56b5a7
--- /dev/null
+++ b/debian/patches/features/arm/clk-realview-stop-using-machine-headers.patch
@@ -0,0 +1,40 @@
+From: Arnd Bergmann <arnd at arndb.de>
+Date: Wed, 25 Nov 2015 17:32:16 +0100
+Subject: [1/4] clk/realview: stop using machine headers
+Origin: https://git.kernel.org/linus/3c30a4a357bd1011322782d6a60fa284d8bd8286
+
+In order to move realview into multiplatform, we have to prevent device
+drivers from accessing the machine header files.
+
+In case of the clk driver, this is very simple, we just copy the
+small set of register definitions into the driver that needs them.
+
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
+---
+ drivers/clk/versatile/clk-realview.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/clk/versatile/clk-realview.c b/drivers/clk/versatile/clk-realview.c
+index 86f70997d59d..bd4dd2463e23 100644
+--- a/drivers/clk/versatile/clk-realview.c
++++ b/drivers/clk/versatile/clk-realview.c
+@@ -11,11 +11,15 @@
+ #include <linux/io.h>
+ #include <linux/clk-provider.h>
+
+-#include <mach/hardware.h>
+-#include <mach/platform.h>
+-
+ #include "clk-icst.h"
+
++#define REALVIEW_SYS_OSC0_OFFSET 0x0C
++#define REALVIEW_SYS_OSC1_OFFSET 0x10
++#define REALVIEW_SYS_OSC2_OFFSET 0x14
++#define REALVIEW_SYS_OSC3_OFFSET 0x18
++#define REALVIEW_SYS_OSC4_OFFSET 0x1C /* OSC1 for RealView/AB */
++#define REALVIEW_SYS_LOCK_OFFSET 0x20
++
+ /*
+ * Implementation of the ARM RealView clock trees.
+ */
diff --git a/debian/patches/features/arm/clk-versatile-icst-add-device-tree-support.patch b/debian/patches/features/arm/clk-versatile-icst-add-device-tree-support.patch
new file mode 100644
index 0000000..1338388
--- /dev/null
+++ b/debian/patches/features/arm/clk-versatile-icst-add-device-tree-support.patch
@@ -0,0 +1,121 @@
+From: Linus Walleij <linus.walleij at linaro.org>
+Date: Tue, 13 Oct 2015 14:29:54 +0200
+Subject: [4/4] clk: versatile-icst: add device tree support
+Origin: https://git.kernel.org/linus/d430819d69a51dc4798bb98d841afa9af2f5c83a
+
+This adds support for the ARM syscon ICST clocks to initialized
+directly from the device tree syscon node on ARM Integrator,
+Versatile and RealView reference designs.
+
+Cc: Michael Turquette <mturquette at baylibre.com>
+Cc: Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-clk at vger.kernel.org
+Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
+---
+ drivers/clk/versatile/clk-icst.c | 89 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 88 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
+index 87bd4667b126..e62f8cb2c9b5 100644
+--- a/drivers/clk/versatile/clk-icst.c
++++ b/drivers/clk/versatile/clk-icst.c
+@@ -3,7 +3,7 @@
+ * We wrap the custom interface from <asm/hardware/icst.h> into the generic
+ * clock framework.
+ *
+- * Copyright (C) 2012 Linus Walleij
++ * Copyright (C) 2012-2015 Linus Walleij
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+@@ -206,3 +206,90 @@ struct clk *icst_clk_register(struct device *dev,
+ return icst_clk_setup(dev, desc, name, parent_name, map);
+ }
+ EXPORT_SYMBOL_GPL(icst_clk_register);
++
++#ifdef CONFIG_OF
++/*
++ * In a device tree, an memory-mapped ICST clock appear as a child
++ * of a syscon node. Assume this and probe it only as a child of a
++ * syscon.
++ */
++
++static const struct icst_params icst525_params = {
++ .vco_max = ICST525_VCO_MAX_5V,
++ .vco_min = ICST525_VCO_MIN,
++ .vd_min = 8,
++ .vd_max = 263,
++ .rd_min = 3,
++ .rd_max = 65,
++ .s2div = icst525_s2div,
++ .idx2s = icst525_idx2s,
++};
++
++static const struct icst_params icst307_params = {
++ .vco_max = ICST307_VCO_MAX,
++ .vco_min = ICST307_VCO_MIN,
++ .vd_min = 4 + 8,
++ .vd_max = 511 + 8,
++ .rd_min = 1 + 2,
++ .rd_max = 127 + 2,
++ .s2div = icst307_s2div,
++ .idx2s = icst307_idx2s,
++};
++
++static void __init of_syscon_icst_setup(struct device_node *np)
++{
++ struct device_node *parent;
++ struct regmap *map;
++ struct clk_icst_desc icst_desc;
++ const char *name = np->name;
++ const char *parent_name;
++ struct clk *regclk;
++
++ /* We do not release this reference, we are using it perpetually */
++ parent = of_get_parent(np);
++ if (!parent) {
++ pr_err("no parent node for syscon ICST clock\n");
++ return;
++ }
++ map = syscon_node_to_regmap(parent);
++ if (IS_ERR(map)) {
++ pr_err("no regmap for syscon ICST clock parent\n");
++ return;
++ }
++
++ if (of_property_read_u32(np, "vco-offset", &icst_desc.vco_offset)) {
++ pr_err("no VCO register offset for ICST clock\n");
++ return;
++ }
++ if (of_property_read_u32(np, "lock-offset", &icst_desc.lock_offset)) {
++ pr_err("no lock register offset for ICST clock\n");
++ return;
++ }
++
++ if (of_device_is_compatible(np, "arm,syscon-icst525"))
++ icst_desc.params = &icst525_params;
++ else if (of_device_is_compatible(np, "arm,syscon-icst307"))
++ icst_desc.params = &icst307_params;
++ else {
++ pr_err("unknown ICST clock %s\n", name);
++ return;
++ }
++
++ /* Parent clock name is not the same as node parent */
++ parent_name = of_clk_get_parent_name(np, 0);
++
++ regclk = icst_clk_setup(NULL, &icst_desc, name, parent_name, map);
++ if (IS_ERR(regclk)) {
++ pr_err("error setting up syscon ICST clock %s\n", name);
++ return;
++ }
++ of_clk_add_provider(np, of_clk_src_simple_get, regclk);
++ pr_debug("registered syscon ICST clock %s\n", name);
++}
++
++CLK_OF_DECLARE(arm_syscon_icst525_clk,
++ "arm,syscon-icst525", of_syscon_icst_setup);
++CLK_OF_DECLARE(arm_syscon_icst307_clk,
++ "arm,syscon-icst307", of_syscon_icst_setup);
++
++#endif
diff --git a/debian/patches/features/arm/clk-versatile-icst-convert-to-use-regmap.patch b/debian/patches/features/arm/clk-versatile-icst-convert-to-use-regmap.patch
new file mode 100644
index 0000000..27b79e6
--- /dev/null
+++ b/debian/patches/features/arm/clk-versatile-icst-convert-to-use-regmap.patch
@@ -0,0 +1,190 @@
+From: Linus Walleij <linus.walleij at linaro.org>
+Date: Mon, 12 Oct 2015 15:52:50 +0200
+Subject: [2/4] clk: versatile-icst: convert to use regmap
+Origin: https://git.kernel.org/linus/179c8fb3c2a6cc86cc746e6d071be00f611328de
+
+Instead of passing around register bases, pass around a regmap
+in this driver. This refactoring make things so much easier when
+we later want to manage an ICST that is part of a syscon.
+
+Cc: Michael Turquette <mturquette at baylibre.com>
+Cc: Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-clk at vger.kernel.org
+Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
+[bwh: Adjust to apply after Kconfig dependency changes]
+---
+ drivers/clk/versatile/Kconfig | 1 +
+ drivers/clk/versatile/clk-icst.c | 88 +++++++++++++++++++++++++++-------------
+ 2 files changed, 61 insertions(+), 28 deletions(-)
+
+--- a/drivers/clk/versatile/Kconfig
++++ b/drivers/clk/versatile/Kconfig
+@@ -3,6 +3,7 @@ config COMMON_CLK_VERSATILE
+ depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
+ ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
+ COMPILE_TEST
++ select REGMAP_MMIO
+ ---help---
+ Supports clocking on ARM Reference designs:
+ - Integrator/AP and Integrator/CP
+--- a/drivers/clk/versatile/clk-icst.c
++++ b/drivers/clk/versatile/clk-icst.c
+@@ -19,9 +19,13 @@
+ #include <linux/err.h>
+ #include <linux/clk-provider.h>
+ #include <linux/io.h>
++#include <linux/regmap.h>
+
+ #include "clk-icst.h"
+
++/* Magic unlocking token used on all Versatile boards */
++#define VERSATILE_LOCK_VAL 0xA05F
++
+ /**
+ * struct clk_icst - ICST VCO clock wrapper
+ * @hw: corresponding clock hardware entry
+@@ -32,8 +36,9 @@
+ */
+ struct clk_icst {
+ struct clk_hw hw;
+- void __iomem *vcoreg;
+- void __iomem *lockreg;
++ struct regmap *map;
++ u32 vcoreg_off;
++ u32 lockreg_off;
+ struct icst_params *params;
+ unsigned long rate;
+ };
+@@ -41,53 +46,67 @@ struct clk_icst {
+ #define to_icst(_hw) container_of(_hw, struct clk_icst, hw)
+
+ /**
+- * vco_get() - get ICST VCO settings from a certain register
+- * @vcoreg: register containing the VCO settings
++ * vco_get() - get ICST VCO settings from a certain ICST
++ * @icst: the ICST clock to get
++ * @vco: the VCO struct to return the value in
+ */
+-static struct icst_vco vco_get(void __iomem *vcoreg)
++static int vco_get(struct clk_icst *icst, struct icst_vco *vco)
+ {
+ u32 val;
+- struct icst_vco vco;
++ int ret;
+
+- val = readl(vcoreg);
+- vco.v = val & 0x1ff;
+- vco.r = (val >> 9) & 0x7f;
+- vco.s = (val >> 16) & 03;
+- return vco;
++ ret = regmap_read(icst->map, icst->vcoreg_off, &val);
++ if (ret)
++ return ret;
++ vco->v = val & 0x1ff;
++ vco->r = (val >> 9) & 0x7f;
++ vco->s = (val >> 16) & 03;
++ return 0;
+ }
+
+ /**
+ * vco_set() - commit changes to an ICST VCO
+- * @locreg: register to poke to unlock the VCO for writing
+- * @vcoreg: register containing the VCO settings
+- * @vco: ICST VCO parameters to commit
++ * @icst: the ICST clock to set
++ * @vco: the VCO struct to set the changes from
+ */
+-static void vco_set(void __iomem *lockreg,
+- void __iomem *vcoreg,
+- struct icst_vco vco)
++static int vco_set(struct clk_icst *icst, struct icst_vco vco)
+ {
+ u32 val;
++ int ret;
+
+- val = readl(vcoreg) & ~0x7ffff;
++ ret = regmap_read(icst->map, icst->vcoreg_off, &val);
++ if (ret)
++ return ret;
+ val |= vco.v | (vco.r << 9) | (vco.s << 16);
+
+ /* This magic unlocks the VCO so it can be controlled */
+- writel(0xa05f, lockreg);
+- writel(val, vcoreg);
++ ret = regmap_write(icst->map, icst->lockreg_off, VERSATILE_LOCK_VAL);
++ if (ret)
++ return ret;
++ ret = regmap_write(icst->map, icst->vcoreg_off, val);
++ if (ret)
++ return ret;
+ /* This locks the VCO again */
+- writel(0, lockreg);
++ ret = regmap_write(icst->map, icst->lockreg_off, 0);
++ if (ret)
++ return ret;
++ return 0;
+ }
+
+-
+ static unsigned long icst_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+ {
+ struct clk_icst *icst = to_icst(hw);
+ struct icst_vco vco;
++ int ret;
+
+ if (parent_rate)
+ icst->params->ref = parent_rate;
+- vco = vco_get(icst->vcoreg);
++ ret = vco_get(icst, &vco);
++ if (ret) {
++ pr_err("ICST: could not get VCO setting\n");
++ return 0;
++ }
+ icst->rate = icst_hz(icst->params, vco);
+ return icst->rate;
+ }
+@@ -112,8 +131,7 @@ static int icst_set_rate(struct clk_hw *
+ icst->params->ref = parent_rate;
+ vco = icst_hz_to_vco(icst->params, rate);
+ icst->rate = icst_hz(icst->params, vco);
+- vco_set(icst->lockreg, icst->vcoreg, vco);
+- return 0;
++ return vco_set(icst, vco);
+ }
+
+ static const struct clk_ops icst_ops = {
+@@ -132,6 +150,11 @@ struct clk *icst_clk_register(struct dev
+ struct clk_icst *icst;
+ struct clk_init_data init;
+ struct icst_params *pclone;
++ struct regmap_config icst_regmap_conf = {
++ .reg_bits = 32,
++ .val_bits = 32,
++ .reg_stride = 4,
++ };
+
+ icst = kzalloc(sizeof(struct clk_icst), GFP_KERNEL);
+ if (!icst) {
+@@ -151,10 +174,19 @@ struct clk *icst_clk_register(struct dev
+ init.flags = CLK_IS_ROOT;
+ init.parent_names = (parent_name ? &parent_name : NULL);
+ init.num_parents = (parent_name ? 1 : 0);
++ icst->map = regmap_init_mmio(dev, base, &icst_regmap_conf);
++ if (IS_ERR(icst->map)) {
++ int ret;
++
++ pr_err("could not initialize ICST regmap\n");
++ ret = PTR_ERR(icst->map);
++ kfree(icst);
++ return ERR_PTR(ret);
++ }
+ icst->hw.init = &init;
+ icst->params = pclone;
+- icst->vcoreg = base + desc->vco_offset;
+- icst->lockreg = base + desc->lock_offset;
++ icst->vcoreg_off = desc->vco_offset;
++ icst->lockreg_off = desc->lock_offset;
+
+ clk = clk_register(dev, &icst->hw);
+ if (IS_ERR(clk)) {
diff --git a/debian/patches/features/arm/clk-versatile-icst-refactor-to-allocate-regmap-separ.patch b/debian/patches/features/arm/clk-versatile-icst-refactor-to-allocate-regmap-separ.patch
new file mode 100644
index 0000000..7763be4
--- /dev/null
+++ b/debian/patches/features/arm/clk-versatile-icst-refactor-to-allocate-regmap-separ.patch
@@ -0,0 +1,99 @@
+From: Linus Walleij <linus.walleij at linaro.org>
+Date: Mon, 12 Oct 2015 16:14:28 +0200
+Subject: [3/4] clk: versatile-icst: refactor to allocate regmap separately
+Origin: https://git.kernel.org/linus/384d977d74f434ea089e9419fa9233fcfa18602b
+
+Break out the registration function so it creates a regmap and
+pass to the setup function, so the latter can be shared with
+a device tree probe function that already has a regmap.
+
+Cc: Michael Turquette <mturquette at baylibre.com>
+Cc: Stephen Boyd <sboyd at codeaurora.org>
+Cc: linux-clk at vger.kernel.org
+Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
+---
+ drivers/clk/versatile/clk-icst.c | 47 ++++++++++++++++++++++++----------------
+ 1 file changed, 28 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
+index 80e955ac6ef5..87bd4667b126 100644
+--- a/drivers/clk/versatile/clk-icst.c
++++ b/drivers/clk/versatile/clk-icst.c
+@@ -20,6 +20,7 @@
+ #include <linux/clk-provider.h>
+ #include <linux/io.h>
+ #include <linux/regmap.h>
++#include <linux/mfd/syscon.h>
+
+ #include "clk-icst.h"
+
+@@ -140,21 +141,16 @@ static const struct clk_ops icst_ops = {
+ .set_rate = icst_set_rate,
+ };
+
+-struct clk *icst_clk_register(struct device *dev,
+- const struct clk_icst_desc *desc,
+- const char *name,
+- const char *parent_name,
+- void __iomem *base)
++static struct clk *icst_clk_setup(struct device *dev,
++ const struct clk_icst_desc *desc,
++ const char *name,
++ const char *parent_name,
++ struct regmap *map)
+ {
+ struct clk *clk;
+ struct clk_icst *icst;
+ struct clk_init_data init;
+ struct icst_params *pclone;
+- struct regmap_config icst_regmap_conf = {
+- .reg_bits = 32,
+- .val_bits = 32,
+- .reg_stride = 4,
+- };
+
+ icst = kzalloc(sizeof(struct clk_icst), GFP_KERNEL);
+ if (!icst) {
+@@ -174,15 +170,7 @@ struct clk *icst_clk_register(struct device *dev,
+ init.flags = CLK_IS_ROOT;
+ init.parent_names = (parent_name ? &parent_name : NULL);
+ init.num_parents = (parent_name ? 1 : 0);
+- icst->map = regmap_init_mmio(dev, base, &icst_regmap_conf);
+- if (IS_ERR(icst->map)) {
+- int ret;
+-
+- pr_err("could not initialize ICST regmap\n");
+- ret = PTR_ERR(icst->map);
+- kfree(icst);
+- return ERR_PTR(ret);
+- }
++ icst->map = map;
+ icst->hw.init = &init;
+ icst->params = pclone;
+ icst->vcoreg_off = desc->vco_offset;
+@@ -196,4 +184,25 @@ struct clk *icst_clk_register(struct device *dev,
+
+ return clk;
+ }
++
++struct clk *icst_clk_register(struct device *dev,
++ const struct clk_icst_desc *desc,
++ const char *name,
++ const char *parent_name,
++ void __iomem *base)
++{
++ struct regmap_config icst_regmap_conf = {
++ .reg_bits = 32,
++ .val_bits = 32,
++ .reg_stride = 4,
++ };
++ struct regmap *map;
++
++ map = regmap_init_mmio(dev, base, &icst_regmap_conf);
++ if (IS_ERR(map)) {
++ pr_err("could not initialize ICST regmap\n");
++ return ERR_CAST(map);
++ }
++ return icst_clk_setup(dev, desc, name, parent_name, map);
++}
+ EXPORT_SYMBOL_GPL(icst_clk_register);
diff --git a/debian/patches/features/arm/revert-irqchip-versatile-fpga-fix-pci-irq-mapping-on-versatile-pb.patch b/debian/patches/features/arm/revert-irqchip-versatile-fpga-fix-pci-irq-mapping-on-versatile-pb.patch
new file mode 100644
index 0000000..c394a12
--- /dev/null
+++ b/debian/patches/features/arm/revert-irqchip-versatile-fpga-fix-pci-irq-mapping-on-versatile-pb.patch
@@ -0,0 +1,25 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Wed, 27 Jan 2016 20:09:03 +0000
+Subject: Revert "irqchip/versatile-fpga: Fix PCI IRQ mapping on Versatile PB"
+Forwarded: not-needed
+
+This reverts commit d5d4fdd86f5759924fe54efa793e22eccf508db6. It
+conflicts with Versatile multiplatform support and was reverted
+upstream by *merge* commit d0b6342df0201c9a53629e59b67513fa72d82c58.
+
+---
+--- b/drivers/irqchip/irq-versatile-fpga.c
++++ a/drivers/irqchip/irq-versatile-fpga.c
+@@ -210,12 +210,7 @@
+ parent_irq = -1;
+ }
+
+-#ifdef CONFIG_ARCH_VERSATILE
+- fpga_irq_init(base, node->name, IRQ_SIC_START, parent_irq, valid_mask,
+- node);
+-#else
+ fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node);
+-#endif
+
+ writel(clear_mask, base + IRQ_ENABLE_CLEAR);
+ writel(clear_mask, base + FIQ_ENABLE_CLEAR);
diff --git a/debian/patches/series b/debian/patches/series
index b2757f7..39971c9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -114,3 +114,14 @@ features/arm/arm-orion-always-use-multi_irq_handler.patch
features/arm/arm-orion-use-sparse_irq-everywhere.patch
features/arm/arm-orion5x-clean-up-mach-.h-headers.patch
features/arm/arm-orion5x-multiplatform-support.patch
+features/arm/arm-debug-ll-rework-integrator-versatile-handling.patch
+features/arm/arm-versatile-add-dt-based-pci-detection.patch
+features/arm/arm-versatile-switch-to-dt-only-booting-and-remove-l.patch
+features/arm/arm-versatile-merge-mach-code-into-a-single-file.patch
+features/arm/arm-versatile-convert-to-multi-platform.patch
+features/arm/arm-versatile-add-the-syscon-leds-to-the-dt.patch
+features/arm/clk-realview-stop-using-machine-headers.patch
+features/arm/clk-versatile-icst-convert-to-use-regmap.patch
+features/arm/clk-versatile-icst-refactor-to-allocate-regmap-separ.patch
+features/arm/clk-versatile-icst-add-device-tree-support.patch
+features/arm/revert-irqchip-versatile-fpga-fix-pci-irq-mapping-on-versatile-pb.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list