Просмотр исходного кода

nuke obsolete kernel stuff

SVN-Revision: 14875
Felix Fietkau 17 лет назад
Родитель
Сommit
16defbb2bd
100 измененных файлов с 0 добавлено и 21972 удалено
  1. 0 57
      target/linux/adm5120/patches-2.6.26/001-adm5120.patch
  2. 0 22
      target/linux/adm5120/patches-2.6.26/002-adm5120_flash.patch
  3. 0 23
      target/linux/adm5120/patches-2.6.26/003-adm5120_switch.patch
  4. 0 33
      target/linux/adm5120/patches-2.6.26/005-adm5120_usb.patch
  5. 0 19
      target/linux/adm5120/patches-2.6.26/007-adm5120_pci.patch
  6. 0 22
      target/linux/adm5120/patches-2.6.26/009-adm5120_leds_switch_trigger.patch
  7. 0 91
      target/linux/adm5120/patches-2.6.26/101-cfi_fixup_macronix_bootloc.patch
  8. 0 68
      target/linux/adm5120/patches-2.6.26/102-jedec_pmc_39lvxxx_chips.patch
  9. 0 24
      target/linux/adm5120/patches-2.6.26/103-mtd_trxsplit.patch
  10. 0 28
      target/linux/adm5120/patches-2.6.26/120-rb153_cf_driver.patch
  11. 0 15
      target/linux/adm5120/patches-2.6.26/140-cmdline_hack.patch
  12. 0 378
      target/linux/adm5120/patches-2.6.26/200-amba_pl010_hacks.patch
  13. 0 13
      target/linux/adm5120/patches-2.6.26/201-amba_bus_hacks.patch
  14. 0 46
      target/linux/adm5120/patches-2.6.26/202-pci_disable_common_quirks.patch
  15. 0 27
      target/linux/adm5120/patches-2.6.26/203-gpio_leds_brightness.patch
  16. 0 31
      target/linux/adm5120/patches-2.6.26/310-adm5120_wdt.patch
  17. 0 190
      target/linux/ar7/config-2.6.23
  18. 0 198
      target/linux/ar7/config-2.6.24
  19. 0 214
      target/linux/ar7/config-2.6.25
  20. 0 94
      target/linux/ar7/patches-2.6.23/100-board_support.patch
  21. 0 43
      target/linux/ar7/patches-2.6.23/110-flash.patch
  22. 0 32
      target/linux/ar7/patches-2.6.23/120-gpio_chrdev.patch
  23. 0 21
      target/linux/ar7/patches-2.6.23/130-vlynq.patch
  24. 0 29
      target/linux/ar7/patches-2.6.23/140-watchdog.patch
  25. 0 32
      target/linux/ar7/patches-2.6.23/200-ethernet_driver.patch
  26. 0 93
      target/linux/ar7/patches-2.6.23/210-phy_fixed.patch
  27. 0 57
      target/linux/ar7/patches-2.6.23/500-serial_kludge.patch
  28. 0 94
      target/linux/ar7/patches-2.6.24/100-board_support.patch
  29. 0 43
      target/linux/ar7/patches-2.6.24/110-flash.patch
  30. 0 32
      target/linux/ar7/patches-2.6.24/120-gpio_chrdev.patch
  31. 0 24
      target/linux/ar7/patches-2.6.24/130-vlynq.patch
  32. 0 268
      target/linux/ar7/patches-2.6.24/140-cpmac_fix.patch
  33. 0 95
      target/linux/ar7/patches-2.6.24/150-cpmac_up_and_running.diff
  34. 0 180
      target/linux/ar7/patches-2.6.24/160-cpmac-rx-ring-use-eoq.diff
  35. 0 15
      target/linux/ar7/patches-2.6.24/170-cpmac_eth_fix.patch
  36. 0 44
      target/linux/ar7/patches-2.6.24/500-serial_kludge.patch
  37. 0 29
      target/linux/ar7/patches-2.6.24/900-temporary_cpmac_hack.diff
  38. 0 86
      target/linux/ar7/patches-2.6.25/100-board_support.patch
  39. 0 37
      target/linux/ar7/patches-2.6.25/110-flash.patch
  40. 0 28
      target/linux/ar7/patches-2.6.25/120-gpio_chrdev.patch
  41. 0 18
      target/linux/ar7/patches-2.6.25/130-vlynq.patch
  42. 0 167
      target/linux/ar7/patches-2.6.25/140-cpmac_fix.patch
  43. 0 11
      target/linux/ar7/patches-2.6.25/150-cpmac_not_broken.patch
  44. 0 91
      target/linux/ar7/patches-2.6.25/150-cpmac_up_and_running.diff
  45. 0 178
      target/linux/ar7/patches-2.6.25/160-cpmac-rx-ring-use-eoq.diff
  46. 0 13
      target/linux/ar7/patches-2.6.25/170-cpmac_eth_fix.patch
  47. 0 54
      target/linux/ar7/patches-2.6.25/200-mtd_fixes.patch
  48. 0 40
      target/linux/ar7/patches-2.6.25/500-serial_kludge.patch
  49. 0 27
      target/linux/ar7/patches-2.6.25/900-temporary_cpmac_hack.diff
  50. 0 299
      target/linux/at91/config-2.6.21
  51. 0 10403
      target/linux/at91/patches-2.6.21/000-at91patches.patch
  52. 0 219
      target/linux/at91/patches-2.6.21/001-vlink-machine.patch
  53. 0 192
      target/linux/at91/patches-2.6.21/002-led-driver.patch
  54. 0 363
      target/linux/at91/patches-2.6.21/003-gpio-driver.patch
  55. 0 38
      target/linux/at91/patches-2.6.21/006-change-gpios.patch
  56. 0 42
      target/linux/at91/patches-2.6.21/007-mtd-partition.patch
  57. 0 162
      target/linux/at91/patches-2.6.21/008-fdl-serial.patch
  58. 0 36
      target/linux/at91/patches-2.6.21/009-fdl-uartinit.patch
  59. 0 30
      target/linux/at91/patches-2.6.21/010-dm9161a-phyfix.patch
  60. 0 12
      target/linux/at91/patches-2.6.21/011-vlink-resetfix.patch
  61. 0 426
      target/linux/at91/patches-2.6.21/012-at91-mmcfix.patch
  62. 0 14
      target/linux/at91/patches-2.6.21/013-at91-mmc1wire.patch
  63. 0 20
      target/linux/at91/patches-2.6.21/014-initpartition.patch
  64. 0 69
      target/linux/at91/patches-2.6.21/015-simenable.patch
  65. 0 207
      target/linux/at91/patches-2.6.21/016-v1-15-detect.patch
  66. 0 243
      target/linux/au1000/au1500/config-2.6.23
  67. 0 270
      target/linux/au1000/au1500/config-2.6.24
  68. 0 273
      target/linux/au1000/au1500/config-2.6.25
  69. 0 19
      target/linux/au1000/patches/001-au1000_gpio_kconfig.patch
  70. 0 54
      target/linux/au1000/patches/002-sys_btn_gpio.patch
  71. 0 23
      target/linux/au1000/patches/005-au1000_eth_link_beat.patch
  72. 0 11
      target/linux/au1000/patches/012-mtx1_cmdline.patch
  73. 0 11
      target/linux/au1000/patches/013-openwrt_rootfs.patch
  74. 0 15
      target/linux/au1000/patches/014-au1000_eth_ioctl.patch
  75. 0 22
      target/linux/au1000/patches/015-pci-resource.patch
  76. 0 10
      target/linux/au1000/patches/016-net-irq.patch
  77. 0 20
      target/linux/au1000/patches/017-gpio-dir.patch
  78. 0 201
      target/linux/rb532/config-2.6.23
  79. 0 51
      target/linux/rb532/files-2.6.23/arch/mips/pci/fixup-rb500.c
  80. 0 218
      target/linux/rb532/files-2.6.23/arch/mips/pci/ops-rc32434.c
  81. 0 236
      target/linux/rb532/files-2.6.23/arch/mips/pci/pci-rc32434.c
  82. 0 5
      target/linux/rb532/files-2.6.23/arch/mips/rb500/Makefile
  83. 0 338
      target/linux/rb532/files-2.6.23/arch/mips/rb500/devices.c
  84. 0 198
      target/linux/rb532/files-2.6.23/arch/mips/rb500/gpio.c
  85. 0 265
      target/linux/rb532/files-2.6.23/arch/mips/rb500/irq.c
  86. 0 178
      target/linux/rb532/files-2.6.23/arch/mips/rb500/prom.c
  87. 0 78
      target/linux/rb532/files-2.6.23/arch/mips/rb500/serial.c
  88. 0 81
      target/linux/rb532/files-2.6.23/arch/mips/rb500/setup.c
  89. 0 94
      target/linux/rb532/files-2.6.23/arch/mips/rb500/time.c
  90. 0 3
      target/linux/rb532/files-2.6.23/drivers/block/rb500/Makefile
  91. 0 487
      target/linux/rb532/files-2.6.23/drivers/block/rb500/ata.c
  92. 0 143
      target/linux/rb532/files-2.6.23/drivers/block/rb500/ata.h
  93. 0 340
      target/linux/rb532/files-2.6.23/drivers/block/rb500/bdev.c
  94. 0 240
      target/linux/rb532/files-2.6.23/drivers/char/watchdog/rc32434_wdt.c
  95. 0 81
      target/linux/rb532/files-2.6.23/drivers/leds/leds-rb500.c
  96. 0 1167
      target/linux/rb532/files-2.6.23/drivers/net/korina.c
  97. 0 178
      target/linux/rb532/files-2.6.23/drivers/net/rc32434_eth.h
  98. 0 173
      target/linux/rb532/files-2.6.23/include/asm-mips/rc32434/ddr.h
  99. 0 168
      target/linux/rb532/files-2.6.23/include/asm-mips/rc32434/dma.h
  100. 0 72
      target/linux/rb532/files-2.6.23/include/asm-mips/rc32434/dma_v.h

+ 0 - 57
target/linux/adm5120/patches-2.6.26/001-adm5120.patch

@@ -1,57 +0,0 @@
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -18,6 +18,22 @@ choice
- 	prompt "System type"
- 	default SGI_IP22
- 
-+config ADM5120
-+	bool "Infineon/ADMtek ADM5120 SoC based machines"
-+	select CEVT_R4K
-+	select CSRC_R4K
-+	select SYS_HAS_CPU_MIPS32_R1
-+	select SYS_HAS_EARLY_PRINTK
-+	select DMA_NONCOHERENT
-+	select IRQ_CPU
-+	select SYS_SUPPORTS_LITTLE_ENDIAN
-+	select SYS_SUPPORTS_BIG_ENDIAN
-+	select SYS_SUPPORTS_32BIT_KERNEL
-+	select GENERIC_GPIO
-+	select HAVE_GPIO_LIB
-+	select SWAP_IO_SPACE if CPU_BIG_ENDIAN
-+	select MIPS_MACHINE
-+
- config MACH_ALCHEMY
- 	bool "Alchemy processor based machines"
- 
-@@ -687,6 +702,7 @@ config WR_PPMC
- 
- endchoice
- 
-+source "arch/mips/adm5120/Kconfig"
- source "arch/mips/au1000/Kconfig"
- source "arch/mips/basler/excite/Kconfig"
- source "arch/mips/jazz/Kconfig"
---- a/arch/mips/Makefile
-+++ b/arch/mips/Makefile
-@@ -174,6 +174,21 @@ cflags-$(CONFIG_MACH_JAZZ)	+= -Iinclude/
- load-$(CONFIG_MACH_JAZZ)	+= 0xffffffff80080000
- 
- #
-+# Infineon/ADMtek ADM5120
-+#
-+libs-$(CONFIG_ADM5120)			+= arch/mips/adm5120/prom/
-+core-$(CONFIG_ADM5120)			+= arch/mips/adm5120/common/
-+core-$(CONFIG_ADM5120_OEM_CELLVISION)	+= arch/mips/adm5120/cellvision/
-+core-$(CONFIG_ADM5120_OEM_COMPEX)	+= arch/mips/adm5120/compex/
-+core-$(CONFIG_ADM5120_OEM_EDIMAX)	+= arch/mips/adm5120/edimax/
-+core-$(CONFIG_ADM5120_OEM_INFINEON)	+= arch/mips/adm5120/infineon/
-+core-$(CONFIG_ADM5120_OEM_MIKROTIK)	+= arch/mips/adm5120/mikrotik/
-+core-$(CONFIG_ADM5120_OEM_MOTOROLA)	+= arch/mips/adm5120/motorola/
-+core-$(CONFIG_ADM5120_OEM_ZYXEL)	+= arch/mips/adm5120/zyxel/
-+cflags-$(CONFIG_ADM5120)		+= -Iinclude/asm-mips/mach-adm5120
-+load-$(CONFIG_ADM5120)			+= 0xffffffff80001000
-+
-+#
- # Common Alchemy Au1x00 stuff
- #
- core-$(CONFIG_SOC_AU1X00)	+= arch/mips/au1000/common/

+ 0 - 22
target/linux/adm5120/patches-2.6.26/002-adm5120_flash.patch

@@ -1,22 +0,0 @@
---- a/drivers/mtd/maps/Kconfig
-+++ b/drivers/mtd/maps/Kconfig
-@@ -586,5 +586,9 @@ config MTD_PLATRAM
- 
- 	  This selection automatically selects the map_ram driver.
- 
-+config MTD_ADM5120
-+	tristate "Map driver for ADM5120 based boards"
-+	depends on ADM5120
-+
- endmenu
- 
---- a/drivers/mtd/maps/Makefile
-+++ b/drivers/mtd/maps/Makefile
-@@ -44,6 +44,7 @@ obj-$(CONFIG_MTD_DBOX2)		+= dbox2-flash.
- obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
- obj-$(CONFIG_MTD_PCI)		+= pci.o
- obj-$(CONFIG_MTD_ALCHEMY)       += alchemy-flash.o
-+obj-$(CONFIG_MTD_ADM5120)      	+= adm5120-flash.o
- obj-$(CONFIG_MTD_AUTCPU12)	+= autcpu12-nvram.o
- obj-$(CONFIG_MTD_EDB7312)	+= edb7312.o
- obj-$(CONFIG_MTD_IMPA7)		+= impa7.o

+ 0 - 23
target/linux/adm5120/patches-2.6.26/003-adm5120_switch.patch

@@ -1,23 +0,0 @@
---- a/drivers/net/Kconfig
-+++ b/drivers/net/Kconfig
-@@ -613,6 +613,10 @@ config MIPS_AU1X00_ENET
- 	  If you have an Alchemy Semi AU1X00 based system
- 	  say Y.  Otherwise, say N.
- 
-+config ADM5120_ENET
-+	tristate "ADM5120 Ethernet switch support"
-+	depends on ADM5120
-+
- config SGI_IOC3_ETH
- 	bool "SGI IOC3 Ethernet"
- 	depends on PCI && SGI_IP27
---- a/drivers/net/Makefile
-+++ b/drivers/net/Makefile
-@@ -186,6 +186,7 @@ obj-$(CONFIG_SC92031) += sc92031.o
- # This is also a 82596 and should probably be merged
- obj-$(CONFIG_LP486E) += lp486e.o
- 
-+obj-$(CONFIG_ADM5120_ENET) += adm5120sw.o
- obj-$(CONFIG_ETH16I) += eth16i.o
- obj-$(CONFIG_ZORRO8390) += zorro8390.o
- obj-$(CONFIG_HPLANCE) += hplance.o 7990.o

+ 0 - 33
target/linux/adm5120/patches-2.6.26/005-adm5120_usb.patch

@@ -1,33 +0,0 @@
---- a/drivers/usb/host/Kconfig
-+++ b/drivers/usb/host/Kconfig
-@@ -4,6 +4,10 @@
- comment "USB Host Controller Drivers"
- 	depends on USB
- 
-+config USB_ADM5120_HCD
-+	tristate "ADM5120 HCD support (EXPERIMENTAL)"
-+	depends on USB && ADM5120 && EXPERIMENTAL
-+
- config USB_C67X00_HCD
- 	tristate "Cypress C67x00 HCD support"
- 	depends on USB
---- a/drivers/usb/host/Makefile
-+++ b/drivers/usb/host/Makefile
-@@ -10,6 +10,7 @@ isp1760-objs := isp1760-hcd.o isp1760-if
- 
- obj-$(CONFIG_PCI)		+= pci-quirks.o
- 
-+obj-$(CONFIG_USB_ADM5120_HCD)	+= adm5120-hcd.o
- obj-$(CONFIG_USB_EHCI_HCD)	+= ehci-hcd.o
- obj-$(CONFIG_USB_ISP116X_HCD)	+= isp116x-hcd.o
- obj-$(CONFIG_USB_OHCI_HCD)	+= ohci-hcd.o
---- a/drivers/usb/Makefile
-+++ b/drivers/usb/Makefile
-@@ -16,6 +16,7 @@ obj-$(CONFIG_USB_UHCI_HCD)	+= host/
- obj-$(CONFIG_USB_SL811_HCD)	+= host/
- obj-$(CONFIG_USB_U132_HCD)	+= host/
- obj-$(CONFIG_USB_R8A66597_HCD)	+= host/
-+obj-$(CONFIG_USB_ADM5120_HCD)  	+= host/
- 
- obj-$(CONFIG_USB_C67X00_HCD)	+= c67x00/
- 

+ 0 - 19
target/linux/adm5120/patches-2.6.26/007-adm5120_pci.patch

@@ -1,19 +0,0 @@
---- a/arch/mips/pci/Makefile
-+++ b/arch/mips/pci/Makefile
-@@ -48,3 +48,4 @@ obj-$(CONFIG_TOSHIBA_RBTX4938)	+= fixup-
- obj-$(CONFIG_VICTOR_MPC30X)	+= fixup-mpc30x.o
- obj-$(CONFIG_ZAO_CAPCELLA)	+= fixup-capcella.o
- obj-$(CONFIG_WR_PPMC)		+= fixup-wrppmc.o
-+obj-$(CONFIG_ADM5120)		+= pci-adm5120.o
---- a/include/linux/pci_ids.h
-+++ b/include/linux/pci_ids.h
-@@ -1707,6 +1707,9 @@
- #define PCI_VENDOR_ID_ESDGMBH		0x12fe
- #define PCI_DEVICE_ID_ESDGMBH_CPCIASIO4 0x0111
- 
-+#define PCI_VENDOR_ID_ADMTEK		0x1317
-+#define PCI_DEVICE_ID_ADMTEK_ADM5120	0x5120
-+
- #define PCI_VENDOR_ID_SIIG		0x131f
- #define PCI_SUBVENDOR_ID_SIIG		0x131f
- #define PCI_DEVICE_ID_SIIG_1S_10x_550	0x1000

+ 0 - 22
target/linux/adm5120/patches-2.6.26/009-adm5120_leds_switch_trigger.patch

@@ -1,22 +0,0 @@
---- a/drivers/leds/Kconfig
-+++ b/drivers/leds/Kconfig
-@@ -207,4 +207,12 @@ config LEDS_TRIGGER_NETDEV
- 	  This allows LEDs to be controlled by network device activity.
- 	  If unsure, say Y.
- 
-+config LEDS_TRIGGER_ADM5120_SWITCH
-+	tristate "LED ADM5120 Switch Port Status Trigger"
-+	depends on LEDS_TRIGGERS && ADM5120
-+	help
-+	  This allows LEDs to be controlled by the port states of
-+	  the ADM5120 built-in Ethernet Switch
-+	  If unsure, say N.
-+
- endif # NEW_LEDS
---- a/drivers/leds/Makefile
-+++ b/drivers/leds/Makefile
-@@ -30,3 +30,4 @@ obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)	+= 
- obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON)	+= ledtrig-default-on.o
- obj-$(CONFIG_LEDS_TRIGGER_MORSE)	+= ledtrig-morse.o
- obj-$(CONFIG_LEDS_TRIGGER_NETDEV)      += ledtrig-netdev.o
-+obj-$(CONFIG_LEDS_TRIGGER_ADM5120_SWITCH) += ledtrig-adm5120-switch.o

+ 0 - 91
target/linux/adm5120/patches-2.6.26/101-cfi_fixup_macronix_bootloc.patch

@@ -1,91 +0,0 @@
---- a/drivers/mtd/chips/cfi_cmdset_0002.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -47,12 +47,19 @@
- #define MANUFACTURER_AMD	0x0001
- #define MANUFACTURER_ATMEL	0x001F
- #define MANUFACTURER_SST	0x00BF
-+#define MANUFACTURER_MACRONIX	0x00C2
- #define SST49LF004B	        0x0060
- #define SST49LF040B	        0x0050
- #define SST49LF008A		0x005a
- #define AT49BV6416		0x00d6
- #define MANUFACTURER_SAMSUNG	0x00ec
- 
-+/* Macronix */
-+#define MX29LV160B	0x2249	/* MX29LV160 Bottom-boot chip */
-+#define MX29LV160T	0x22C4	/* MX29LV160 Top-boot chip */
-+#define MX29LV320B	0x22A8	/* MX29LV320 Bottom-boot chip */
-+#define MX29LV320T	0x22A7	/* MX29LV320 Top-boot chip */
-+
- static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
- static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
- static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
-@@ -243,6 +250,41 @@ static void fixup_s29gl032n_sectors(stru
- 	}
- }
- 
-+#ifdef CONFIG_MTD_CFI_FIXUP_MACRONIX_BOOTLOC
-+/*
-+ * Some Macronix chips has no/bad bootblock information in the CFI table
-+ */
-+static void fixup_macronix_bootloc(struct mtd_info *mtd, void* param)
-+{
-+	struct map_info *map = mtd->priv;
-+	struct cfi_private *cfi = map->fldrv_priv;
-+	struct cfi_pri_amdstd *extp = cfi->cmdset_priv;
-+	__u8 t;
-+
-+	switch (cfi->id) {
-+	/* TODO: put affected chip ids here */
-+	case MX29LV160B:
-+	case MX29LV320B:
-+		t = 2;	/* Bottom boot */
-+		break;
-+	case MX29LV160T:
-+	case MX29LV320T:
-+		t = 3;	/* Top boot */
-+		break;
-+	default:
-+		return;
-+	}
-+
-+	if (extp->TopBottom == t)
-+		/* boot location detected by the CFI layer is correct */
-+		return;
-+
-+	extp->TopBottom = t;
-+	printk("%s: Macronix chip detected, id:0x%04X, boot location forced "
-+		"to %s\n", map->name, cfi->id, (t == 2) ? "bottom" : "top");
-+}
-+#endif /* CONFIG_MTD_CFI_FIXUP_MACRONIX_BOOTLOC */
-+
- static struct cfi_fixup cfi_fixup_table[] = {
- 	{ CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL },
- #ifdef AMD_BOOTLOC_BUG
-@@ -278,6 +320,9 @@ static struct cfi_fixup fixup_table[] = 
- 	 */
- 	{ CFI_MFR_ANY, CFI_ID_ANY, fixup_use_erase_chip, NULL },
- 	{ CFI_MFR_ATMEL, AT49BV6416, fixup_use_atmel_lock, NULL },
-+#ifdef CONFIG_MTD_CFI_FIXUP_MACRONIX_BOOTLOC
-+	{ MANUFACTURER_MACRONIX, CFI_ID_ANY, fixup_macronix_bootloc, NULL, },
-+#endif
- 	{ 0, 0, NULL, NULL }
- };
- 
---- a/drivers/mtd/chips/Kconfig
-+++ b/drivers/mtd/chips/Kconfig
-@@ -196,6 +196,14 @@ config MTD_CFI_AMDSTD
- 	  provides support for one of those command sets, used on chips
- 	  including the AMD Am29LV320.
- 
-+config MTD_CFI_FIXUP_MACRONIX_BOOTLOC
-+	bool "Fix boot-block location for Macronix flash chips"
-+	depends on MTD_CFI_AMDSTD
-+	help
-+	  Some Macronix flash chips have no/wrong boot-block location in the
-+	  CFI table, and the driver may detect the type incorrectly. Select
-+	  this if your board has such chip.
-+
- config MTD_CFI_STAA
- 	tristate "Support for ST (Advanced Architecture) flash chips"
- 	depends on MTD_GEN_PROBE

+ 0 - 68
target/linux/adm5120/patches-2.6.26/102-jedec_pmc_39lvxxx_chips.patch

@@ -1,68 +0,0 @@
---- a/drivers/mtd/chips/jedec_probe.c
-+++ b/drivers/mtd/chips/jedec_probe.c
-@@ -121,6 +121,10 @@
- #define UPD29F064115	0x221C
- 
- /* PMC */
-+#define PM39LV512	0x001B
-+#define PM39LV010	0x001C
-+#define PM39LV020	0x003D
-+#define PM39LV040	0x003E
- #define PM49FL002	0x006D
- #define PM49FL004	0x006E
- #define PM49FL008	0x006A
-@@ -1173,6 +1177,54 @@ static const struct amd_flash_info jedec
- 			ERASEINFO(0x02000,2),
- 			ERASEINFO(0x04000,1),
- 		}
-+        }, {
-+		.mfr_id		= MANUFACTURER_PMC,
-+		.dev_id		= PM39LV512,
-+		.name		= "PMC Pm39LV512",
-+		.devtypes	= CFI_DEVICETYPE_X8,
-+		.uaddr		= MTD_UADDR_0x0555_0x02AA,
-+		.dev_size	= SIZE_64KiB,
-+		.cmd_set	= P_ID_AMD_STD,
-+		.nr_regions	= 1,
-+		.regions	= {
-+			ERASEINFO(0x01000,16),
-+		}
-+        }, {
-+		.mfr_id		= MANUFACTURER_PMC,
-+		.dev_id		= PM39LV010,
-+		.name		= "PMC Pm39LV010",
-+		.devtypes	= CFI_DEVICETYPE_X8,
-+		.uaddr		= MTD_UADDR_0x0555_0x02AA,
-+		.dev_size	= SIZE_128KiB,
-+		.cmd_set	= P_ID_AMD_STD,
-+		.nr_regions	= 1,
-+		.regions	= {
-+			ERASEINFO(0x01000,32),
-+		}
-+        }, {
-+		.mfr_id		= MANUFACTURER_PMC,
-+		.dev_id		= PM39LV020,
-+		.name		= "PMC Pm39LV020",
-+		.devtypes	= CFI_DEVICETYPE_X8,
-+		.uaddr		= MTD_UADDR_0x0555_0x02AA,
-+		.dev_size	= SIZE_256KiB,
-+		.cmd_set	= P_ID_AMD_STD,
-+		.nr_regions	= 1,
-+		.regions	= {
-+			ERASEINFO(0x01000,64),
-+		}
-+        }, {
-+		.mfr_id		= MANUFACTURER_PMC,
-+		.dev_id		= PM39LV040,
-+		.name		= "PMC Pm39LV040",
-+		.devtypes	= CFI_DEVICETYPE_X8,
-+		.uaddr		= MTD_UADDR_0x0555_0x02AA,
-+		.dev_size	= SIZE_512KiB,
-+		.cmd_set	= P_ID_AMD_STD,
-+		.nr_regions	= 1,
-+		.regions	= {
-+			ERASEINFO(0x01000,128),
-+		}
- 	}, {
- 		.mfr_id		= MANUFACTURER_PMC,
- 		.dev_id		= PM49FL002,

+ 0 - 24
target/linux/adm5120/patches-2.6.26/103-mtd_trxsplit.patch

@@ -1,24 +0,0 @@
---- a/drivers/mtd/Kconfig
-+++ b/drivers/mtd/Kconfig
-@@ -57,6 +57,11 @@ config MTD_ROOTFS_SPLIT
- 	depends on MTD_PARTITIONS
- 	default y
- 
-+config MTD_TRXSPLIT
-+	bool "Automatically find and split TRX partitions"
-+	depends on MTD_PARTITIONS
-+	default n
-+
- config MTD_REDBOOT_PARTS
- 	tristate "RedBoot partition table parsing"
- 	depends on MTD_PARTITIONS
---- a/drivers/mtd/Makefile
-+++ b/drivers/mtd/Makefile
-@@ -8,6 +8,7 @@ mtd-y				:= mtdcore.o mtdsuper.o
- mtd-$(CONFIG_MTD_PARTITIONS)	+= mtdpart.o
- 
- obj-$(CONFIG_MTD_CONCAT)	+= mtdconcat.o
-+obj-$(CONFIG_MTD_TRXSPLIT)	+= trxsplit.o
- obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
- obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
- obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o

+ 0 - 28
target/linux/adm5120/patches-2.6.26/120-rb153_cf_driver.patch

@@ -1,28 +0,0 @@
---- a/drivers/ata/Makefile
-+++ b/drivers/ata/Makefile
-@@ -72,6 +72,7 @@ obj-$(CONFIG_PATA_BF54X)	+= pata_bf54x.o
- obj-$(CONFIG_PATA_PLATFORM)	+= pata_platform.o
- obj-$(CONFIG_PATA_OF_PLATFORM)	+= pata_of_platform.o
- obj-$(CONFIG_PATA_ICSIDE)	+= pata_icside.o
-+obj-$(CONFIG_PATA_RB153_CF)	+= pata_rb153_cf.o
- # Should be last but two libata driver
- obj-$(CONFIG_PATA_ACPI)		+= pata_acpi.o
- # Should be last but one libata driver
---- a/drivers/ata/Kconfig
-+++ b/drivers/ata/Kconfig
-@@ -566,6 +566,15 @@ config PATA_RADISYS
- 
- 	  If unsure, say N.
- 
-+config PATA_RB153_CF
-+	tristate "RouterBOARD 153 Compact Flash support"
-+	depends on ADM5120_MACH_RB_153
-+	help
-+	  This option enables support for a Compact Flash connected on
-+	  the RouterBOARD 153.
-+
-+	  If unsure, say N.
-+
- config PATA_RB532
- 	tristate "RouterBoard 532 PATA CompactFlash support"
- 	depends on MIKROTIK_RB532

+ 0 - 15
target/linux/adm5120/patches-2.6.26/140-cmdline_hack.patch

@@ -1,15 +0,0 @@
---- a/arch/mips/kernel/head.S
-+++ b/arch/mips/kernel/head.S
-@@ -126,7 +126,12 @@
- 	/*
- 	 * Reserved space for exception handlers.
- 	 * Necessary for machines which link their kernels at KSEG0.
-+	 * Use as temporary storage for the kernel command line, so that it
-+	 * can be updated easily without having to relink the kernel.
- 	 */
-+
-+EXPORT(_image_cmdline)
-+	.ascii "CMDLINE:"
- 	.fill	0x400
- #endif
- 

+ 0 - 378
target/linux/adm5120/patches-2.6.26/200-amba_pl010_hacks.patch

@@ -1,378 +0,0 @@
---- a/drivers/serial/amba-pl010.c
-+++ b/drivers/serial/amba-pl010.c
-@@ -52,11 +52,10 @@
- 
- #include <asm/io.h>
- 
--#define UART_NR		8
--
- #define SERIAL_AMBA_MAJOR	204
- #define SERIAL_AMBA_MINOR	16
--#define SERIAL_AMBA_NR		UART_NR
-+#define SERIAL_AMBA_NR		CONFIG_SERIAL_AMBA_PL010_NUMPORTS
-+#define SERIAL_AMBA_NAME	CONFIG_SERIAL_AMBA_PL010_PORTNAME
- 
- #define AMBA_ISR_PASS_LIMIT	256
- 
-@@ -82,9 +81,9 @@ static void pl010_stop_tx(struct uart_po
- 	struct uart_amba_port *uap = (struct uart_amba_port *)port;
- 	unsigned int cr;
- 
--	cr = readb(uap->port.membase + UART010_CR);
-+	cr = __raw_readl(uap->port.membase + UART010_CR);
- 	cr &= ~UART010_CR_TIE;
--	writel(cr, uap->port.membase + UART010_CR);
-+	__raw_writel(cr, uap->port.membase + UART010_CR);
- }
- 
- static void pl010_start_tx(struct uart_port *port)
-@@ -92,9 +91,9 @@ static void pl010_start_tx(struct uart_p
- 	struct uart_amba_port *uap = (struct uart_amba_port *)port;
- 	unsigned int cr;
- 
--	cr = readb(uap->port.membase + UART010_CR);
-+	cr = __raw_readl(uap->port.membase + UART010_CR);
- 	cr |= UART010_CR_TIE;
--	writel(cr, uap->port.membase + UART010_CR);
-+	__raw_writel(cr, uap->port.membase + UART010_CR);
- }
- 
- static void pl010_stop_rx(struct uart_port *port)
-@@ -102,9 +101,9 @@ static void pl010_stop_rx(struct uart_po
- 	struct uart_amba_port *uap = (struct uart_amba_port *)port;
- 	unsigned int cr;
- 
--	cr = readb(uap->port.membase + UART010_CR);
-+	cr = __raw_readl(uap->port.membase + UART010_CR);
- 	cr &= ~(UART010_CR_RIE | UART010_CR_RTIE);
--	writel(cr, uap->port.membase + UART010_CR);
-+	__raw_writel(cr, uap->port.membase + UART010_CR);
- }
- 
- static void pl010_enable_ms(struct uart_port *port)
-@@ -112,9 +111,9 @@ static void pl010_enable_ms(struct uart_
- 	struct uart_amba_port *uap = (struct uart_amba_port *)port;
- 	unsigned int cr;
- 
--	cr = readb(uap->port.membase + UART010_CR);
-+	cr = __raw_readl(uap->port.membase + UART010_CR);
- 	cr |= UART010_CR_MSIE;
--	writel(cr, uap->port.membase + UART010_CR);
-+	__raw_writel(cr, uap->port.membase + UART010_CR);
- }
- 
- static void pl010_rx_chars(struct uart_amba_port *uap)
-@@ -122,9 +121,9 @@ static void pl010_rx_chars(struct uart_a
- 	struct tty_struct *tty = uap->port.info->tty;
- 	unsigned int status, ch, flag, rsr, max_count = 256;
- 
--	status = readb(uap->port.membase + UART01x_FR);
-+	status = __raw_readl(uap->port.membase + UART01x_FR);
- 	while (UART_RX_DATA(status) && max_count--) {
--		ch = readb(uap->port.membase + UART01x_DR);
-+		ch = __raw_readl(uap->port.membase + UART01x_DR);
- 		flag = TTY_NORMAL;
- 
- 		uap->port.icount.rx++;
-@@ -133,9 +132,9 @@ static void pl010_rx_chars(struct uart_a
- 		 * Note that the error handling code is
- 		 * out of the main execution path
- 		 */
--		rsr = readb(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX;
-+		rsr = __raw_readl(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX;
- 		if (unlikely(rsr & UART01x_RSR_ANY)) {
--			writel(0, uap->port.membase + UART01x_ECR);
-+			__raw_writel(0, uap->port.membase + UART01x_ECR);
- 
- 			if (rsr & UART01x_RSR_BE) {
- 				rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
-@@ -165,7 +164,7 @@ static void pl010_rx_chars(struct uart_a
- 		uart_insert_char(&uap->port, rsr, UART01x_RSR_OE, ch, flag);
- 
- 	ignore_char:
--		status = readb(uap->port.membase + UART01x_FR);
-+		status = __raw_readl(uap->port.membase + UART01x_FR);
- 	}
- 	spin_unlock(&uap->port.lock);
- 	tty_flip_buffer_push(tty);
-@@ -178,7 +177,7 @@ static void pl010_tx_chars(struct uart_a
- 	int count;
- 
- 	if (uap->port.x_char) {
--		writel(uap->port.x_char, uap->port.membase + UART01x_DR);
-+		__raw_writel(uap->port.x_char, uap->port.membase + UART01x_DR);
- 		uap->port.icount.tx++;
- 		uap->port.x_char = 0;
- 		return;
-@@ -190,7 +189,7 @@ static void pl010_tx_chars(struct uart_a
- 
- 	count = uap->port.fifosize >> 1;
- 	do {
--		writel(xmit->buf[xmit->tail], uap->port.membase + UART01x_DR);
-+		__raw_writel(xmit->buf[xmit->tail], uap->port.membase + UART01x_DR);
- 		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
- 		uap->port.icount.tx++;
- 		if (uart_circ_empty(xmit))
-@@ -208,9 +207,9 @@ static void pl010_modem_status(struct ua
- {
- 	unsigned int status, delta;
- 
--	writel(0, uap->port.membase + UART010_ICR);
-+	__raw_writel(0, uap->port.membase + UART010_ICR);
- 
--	status = readb(uap->port.membase + UART01x_FR) & UART01x_FR_MODEM_ANY;
-+	status = __raw_readl(uap->port.membase + UART01x_FR) & UART01x_FR_MODEM_ANY;
- 
- 	delta = status ^ uap->old_status;
- 	uap->old_status = status;
-@@ -238,7 +237,7 @@ static irqreturn_t pl010_int(int irq, vo
- 
- 	spin_lock(&uap->port.lock);
- 
--	status = readb(uap->port.membase + UART010_IIR);
-+	status = __raw_readl(uap->port.membase + UART010_IIR);
- 	if (status) {
- 		do {
- 			if (status & (UART010_IIR_RTIS | UART010_IIR_RIS))
-@@ -251,7 +250,7 @@ static irqreturn_t pl010_int(int irq, vo
- 			if (pass_counter-- == 0)
- 				break;
- 
--			status = readb(uap->port.membase + UART010_IIR);
-+			status = __raw_readl(uap->port.membase + UART010_IIR);
- 		} while (status & (UART010_IIR_RTIS | UART010_IIR_RIS |
- 				   UART010_IIR_TIS));
- 		handled = 1;
-@@ -265,7 +264,7 @@ static irqreturn_t pl010_int(int irq, vo
- static unsigned int pl010_tx_empty(struct uart_port *port)
- {
- 	struct uart_amba_port *uap = (struct uart_amba_port *)port;
--	unsigned int status = readb(uap->port.membase + UART01x_FR);
-+	unsigned int status = __raw_readl(uap->port.membase + UART01x_FR);
- 	return status & UART01x_FR_BUSY ? 0 : TIOCSER_TEMT;
- }
- 
-@@ -275,7 +274,7 @@ static unsigned int pl010_get_mctrl(stru
- 	unsigned int result = 0;
- 	unsigned int status;
- 
--	status = readb(uap->port.membase + UART01x_FR);
-+	status = __raw_readl(uap->port.membase + UART01x_FR);
- 	if (status & UART01x_FR_DCD)
- 		result |= TIOCM_CAR;
- 	if (status & UART01x_FR_DSR)
-@@ -301,12 +300,12 @@ static void pl010_break_ctl(struct uart_
- 	unsigned int lcr_h;
- 
- 	spin_lock_irqsave(&uap->port.lock, flags);
--	lcr_h = readb(uap->port.membase + UART010_LCRH);
-+	lcr_h = __raw_readl(uap->port.membase + UART010_LCRH);
- 	if (break_state == -1)
- 		lcr_h |= UART01x_LCRH_BRK;
- 	else
- 		lcr_h &= ~UART01x_LCRH_BRK;
--	writel(lcr_h, uap->port.membase + UART010_LCRH);
-+	__raw_writel(lcr_h, uap->port.membase + UART010_LCRH);
- 	spin_unlock_irqrestore(&uap->port.lock, flags);
- }
- 
-@@ -334,12 +333,12 @@ static int pl010_startup(struct uart_por
- 	/*
- 	 * initialise the old status of the modem signals
- 	 */
--	uap->old_status = readb(uap->port.membase + UART01x_FR) & UART01x_FR_MODEM_ANY;
-+	uap->old_status = __raw_readl(uap->port.membase + UART01x_FR) & UART01x_FR_MODEM_ANY;
- 
- 	/*
- 	 * Finally, enable interrupts
- 	 */
--	writel(UART01x_CR_UARTEN | UART010_CR_RIE | UART010_CR_RTIE,
-+	__raw_writel(UART01x_CR_UARTEN | UART010_CR_RIE | UART010_CR_RTIE,
- 	       uap->port.membase + UART010_CR);
- 
- 	return 0;
-@@ -362,10 +361,10 @@ static void pl010_shutdown(struct uart_p
- 	/*
- 	 * disable all interrupts, disable the port
- 	 */
--	writel(0, uap->port.membase + UART010_CR);
-+	__raw_writel(0, uap->port.membase + UART010_CR);
- 
- 	/* disable break condition and fifos */
--	writel(readb(uap->port.membase + UART010_LCRH) &
-+	__raw_writel(__raw_readl(uap->port.membase + UART010_LCRH) &
- 		~(UART01x_LCRH_BRK | UART01x_LCRH_FEN),
- 	       uap->port.membase + UART010_LCRH);
- 
-@@ -387,7 +386,7 @@ pl010_set_termios(struct uart_port *port
- 	/*
- 	 * Ask the core to calculate the divisor for us.
- 	 */
--	baud = uart_get_baud_rate(port, termios, old, 0, uap->port.uartclk/16); 
-+	baud = uart_get_baud_rate(port, termios, old, 0, uap->port.uartclk/16);
- 	quot = uart_get_divisor(port, baud);
- 
- 	switch (termios->c_cflag & CSIZE) {
-@@ -450,25 +449,25 @@ pl010_set_termios(struct uart_port *port
- 		uap->port.ignore_status_mask |= UART_DUMMY_RSR_RX;
- 
- 	/* first, disable everything */
--	old_cr = readb(uap->port.membase + UART010_CR) & ~UART010_CR_MSIE;
-+	old_cr = __raw_readl(uap->port.membase + UART010_CR) & ~UART010_CR_MSIE;
- 
- 	if (UART_ENABLE_MS(port, termios->c_cflag))
- 		old_cr |= UART010_CR_MSIE;
- 
--	writel(0, uap->port.membase + UART010_CR);
-+	__raw_writel(0, uap->port.membase + UART010_CR);
- 
- 	/* Set baud rate */
- 	quot -= 1;
--	writel((quot & 0xf00) >> 8, uap->port.membase + UART010_LCRM);
--	writel(quot & 0xff, uap->port.membase + UART010_LCRL);
-+	__raw_writel((quot & 0xf00) >> 8, uap->port.membase + UART010_LCRM);
-+	__raw_writel(quot & 0xff, uap->port.membase + UART010_LCRL);
- 
- 	/*
- 	 * ----------v----------v----------v----------v-----
- 	 * NOTE: MUST BE WRITTEN AFTER UARTLCR_M & UARTLCR_L
- 	 * ----------^----------^----------^----------^-----
- 	 */
--	writel(lcr_h, uap->port.membase + UART010_LCRH);
--	writel(old_cr, uap->port.membase + UART010_CR);
-+	__raw_writel(lcr_h, uap->port.membase + UART010_LCRH);
-+	__raw_writel(old_cr, uap->port.membase + UART010_CR);
- 
- 	spin_unlock_irqrestore(&uap->port.lock, flags);
- }
-@@ -540,7 +539,7 @@ static struct uart_ops amba_pl010_pops =
- 	.verify_port	= pl010_verify_port,
- };
- 
--static struct uart_amba_port *amba_ports[UART_NR];
-+static struct uart_amba_port *amba_ports[SERIAL_AMBA_NR];
- 
- #ifdef CONFIG_SERIAL_AMBA_PL010_CONSOLE
- 
-@@ -550,10 +549,10 @@ static void pl010_console_putchar(struct
- 	unsigned int status;
- 
- 	do {
--		status = readb(uap->port.membase + UART01x_FR);
-+		status = __raw_readl(uap->port.membase + UART01x_FR);
- 		barrier();
- 	} while (!UART_TX_READY(status));
--	writel(ch, uap->port.membase + UART01x_DR);
-+	__raw_writel(ch, uap->port.membase + UART01x_DR);
- }
- 
- static void
-@@ -567,8 +566,8 @@ pl010_console_write(struct console *co, 
- 	/*
- 	 *	First save the CR then disable the interrupts
- 	 */
--	old_cr = readb(uap->port.membase + UART010_CR);
--	writel(UART01x_CR_UARTEN, uap->port.membase + UART010_CR);
-+	old_cr = __raw_readl(uap->port.membase + UART010_CR);
-+	__raw_writel(UART01x_CR_UARTEN, uap->port.membase + UART010_CR);
- 
- 	uart_console_write(&uap->port, s, count, pl010_console_putchar);
- 
-@@ -577,10 +576,10 @@ pl010_console_write(struct console *co, 
- 	 *	and restore the TCR
- 	 */
- 	do {
--		status = readb(uap->port.membase + UART01x_FR);
-+		status = __raw_readl(uap->port.membase + UART01x_FR);
- 		barrier();
- 	} while (status & UART01x_FR_BUSY);
--	writel(old_cr, uap->port.membase + UART010_CR);
-+	__raw_writel(old_cr, uap->port.membase + UART010_CR);
- 
- 	clk_disable(uap->clk);
- }
-@@ -589,9 +588,9 @@ static void __init
- pl010_console_get_options(struct uart_amba_port *uap, int *baud,
- 			     int *parity, int *bits)
- {
--	if (readb(uap->port.membase + UART010_CR) & UART01x_CR_UARTEN) {
-+	if (__raw_readl(uap->port.membase + UART010_CR) & UART01x_CR_UARTEN) {
- 		unsigned int lcr_h, quot;
--		lcr_h = readb(uap->port.membase + UART010_LCRH);
-+		lcr_h = __raw_readl(uap->port.membase + UART010_LCRH);
- 
- 		*parity = 'n';
- 		if (lcr_h & UART01x_LCRH_PEN) {
-@@ -606,8 +605,8 @@ pl010_console_get_options(struct uart_am
- 		else
- 			*bits = 8;
- 
--		quot = readb(uap->port.membase + UART010_LCRL) |
--		       readb(uap->port.membase + UART010_LCRM) << 8;
-+		quot = __raw_readl(uap->port.membase + UART010_LCRL) |
-+		       __raw_readl(uap->port.membase + UART010_LCRM) << 8;
- 		*baud = uap->port.uartclk / (16 * (quot + 1));
- 	}
- }
-@@ -625,7 +624,7 @@ static int __init pl010_console_setup(st
- 	 * if so, search for the first available port that does have
- 	 * console support.
- 	 */
--	if (co->index >= UART_NR)
-+	if (co->index >= SERIAL_AMBA_NR)
- 		co->index = 0;
- 	uap = amba_ports[co->index];
- 	if (!uap)
-@@ -643,7 +642,7 @@ static int __init pl010_console_setup(st
- 
- static struct uart_driver amba_reg;
- static struct console amba_console = {
--	.name		= "ttyAM",
-+	.name		= SERIAL_AMBA_NAME,
- 	.write		= pl010_console_write,
- 	.device		= uart_console_device,
- 	.setup		= pl010_console_setup,
-@@ -659,11 +658,11 @@ static struct console amba_console = {
- 
- static struct uart_driver amba_reg = {
- 	.owner			= THIS_MODULE,
--	.driver_name		= "ttyAM",
--	.dev_name		= "ttyAM",
-+	.driver_name		= SERIAL_AMBA_NAME,
-+	.dev_name		= SERIAL_AMBA_NAME,
- 	.major			= SERIAL_AMBA_MAJOR,
- 	.minor			= SERIAL_AMBA_MINOR,
--	.nr			= UART_NR,
-+	.nr			= SERIAL_AMBA_NR,
- 	.cons			= AMBA_CONSOLE,
- };
- 
---- a/drivers/serial/Kconfig
-+++ b/drivers/serial/Kconfig
-@@ -287,10 +287,25 @@ config SERIAL_AMBA_PL010
- 	help
- 	  This selects the ARM(R) AMBA(R) PrimeCell PL010 UART.  If you have
- 	  an Integrator/AP or Integrator/PP2 platform, or if you have a
--	  Cirrus Logic EP93xx CPU, say Y or M here.
-+	  Cirrus Logic EP93xx CPU or an Infineon ADM5120 SOC, say Y or M here.
- 
- 	  If unsure, say N.
- 
-+config SERIAL_AMBA_PL010_NUMPORTS
-+	int "Maximum number of AMBA PL010 serial ports"
-+	depends on SERIAL_AMBA_PL010
-+	default "8"
-+	---help---
-+	  Set this to the number of serial ports you want the AMBA PL010 driver
-+	  to support.
-+
-+config SERIAL_AMBA_PL010_PORTNAME
-+	string "Name of the AMBA PL010 serial ports"
-+	depends on SERIAL_AMBA_PL010
-+	default "ttyAM"
-+	---help---
-+	  ::: To be written :::
-+
- config SERIAL_AMBA_PL010_CONSOLE
- 	bool "Support for console on AMBA serial port"
- 	depends on SERIAL_AMBA_PL010=y

+ 0 - 13
target/linux/adm5120/patches-2.6.26/201-amba_bus_hacks.patch

@@ -1,13 +0,0 @@
---- a/drivers/amba/bus.c
-+++ b/drivers/amba/bus.c
-@@ -17,6 +17,10 @@
- #include <asm/io.h>
- #include <asm/sizes.h>
- 
-+#ifndef NO_IRQ
-+#define NO_IRQ		(-1)
-+#endif
-+
- #define to_amba_device(d)	container_of(d, struct amba_device, dev)
- #define to_amba_driver(d)	container_of(d, struct amba_driver, drv)
- 

+ 0 - 46
target/linux/adm5120/patches-2.6.26/202-pci_disable_common_quirks.patch

@@ -1,46 +0,0 @@
---- a/drivers/pci/Kconfig
-+++ b/drivers/pci/Kconfig
-@@ -42,6 +42,12 @@ config PCI_DEBUG
- 
- 	  When in doubt, say N.
- 
-+config PCI_DISABLE_COMMON_QUIRKS
-+	bool "PCI disable common quirks"
-+	depends on PCI
-+	help
-+	  If you don't know what to do here, say N.
-+
- config HT_IRQ
- 	bool "Interrupts on hypertransport devices"
- 	default y
---- a/drivers/pci/quirks.c
-+++ b/drivers/pci/quirks.c
-@@ -24,6 +24,7 @@
- #include <linux/kallsyms.h>
- #include "pci.h"
- 
-+#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
- /* The Mellanox Tavor device gives false positive parity errors
-  * Mark this device with a broken_parity_status, to allow
-  * PCI scanning code to "skip" this now blacklisted device.
-@@ -1495,6 +1496,7 @@ static void __devinit fixup_rev1_53c810(
- 	}
- }
- DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
-+#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */
- 
- static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end)
- {
-@@ -1561,6 +1563,7 @@ void pci_fixup_device(enum pci_fixup_pas
- }
- EXPORT_SYMBOL(pci_fixup_device);
- 
-+#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
- /* Enable 1k I/O space granularity on the Intel P64H2 */
- static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev)
- {
-@@ -1934,3 +1937,4 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT
- 			quirk_msi_intx_disable_bug);
- 
- #endif /* CONFIG_PCI_MSI */
-+#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */

+ 0 - 27
target/linux/adm5120/patches-2.6.26/203-gpio_leds_brightness.patch

@@ -1,27 +0,0 @@
---- a/drivers/leds/leds-gpio.c
-+++ b/drivers/leds/leds-gpio.c
-@@ -43,13 +43,17 @@ static void gpio_led_set(struct led_clas
- 		container_of(led_cdev, struct gpio_led_data, cdev);
- 	int level;
- 
--	if (value == LED_OFF)
--		level = 0;
--	else
--		level = 1;
--
--	if (led_dat->active_low)
--		level = !level;
-+	switch (value) {
-+	case LED_OFF:
-+		level = led_dat->active_low ? 1 : 0;
-+		break;
-+	case LED_FULL:
-+		level = led_dat->active_low ? 0 : 1;
-+		break;
-+	default:
-+		level = value;
-+		break;
-+	}
- 
- 	/* Setting GPIOs with I2C/etc requires a task context, and we don't
- 	 * seem to have a reliable way to know if we're already in one; so

+ 0 - 31
target/linux/adm5120/patches-2.6.26/310-adm5120_wdt.patch

@@ -1,31 +0,0 @@
---- a/drivers/watchdog/Kconfig
-+++ b/drivers/watchdog/Kconfig
-@@ -632,6 +632,18 @@ config SBC_EPX_C3_WATCHDOG
- 
- # MIPS Architecture
- 
-+config ADM5120_WDT
-+	tristate "Infineon ADM5120 SoC hardware watchdog"
-+	depends on WATCHDOG && ADM5120
-+	help
-+	  This is a driver for hardware watchdog integrated in Infineon
-+	  ADM5120 SoC. This watchdog simply watches your kernel to make sure
-+	  it doesn't freeze, and if it does, it reboots your computer after a
-+	  certain amount of time.
-+
-+	  To compile this driver as a module, choose M here: the module will be
-+	  called adm5120_wdt.
-+
- config INDYDOG
- 	tristate "Indy/I2 Hardware Watchdog"
- 	depends on SGI_HAS_INDYDOG
---- a/drivers/watchdog/Makefile
-+++ b/drivers/watchdog/Makefile
-@@ -91,6 +91,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc
- # M68KNOMMU Architecture
- 
- # MIPS Architecture
-+obj-$(CONFIG_ADM5120_WDT) += adm5120_wdt.o
- obj-$(CONFIG_INDYDOG) += indydog.o
- obj-$(CONFIG_WDT_MTX1)	+= mtx-1_wdt.o
- obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o

+ 0 - 190
target/linux/ar7/config-2.6.23

@@ -1,190 +0,0 @@
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-CONFIG_AR7=y
-CONFIG_AR7_GPIO=y
-CONFIG_AR7_WDT=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-CONFIG_ATM_DRIVERS=y
-CONFIG_BASE_SMALL=0
-CONFIG_BITREVERSE=y
-CONFIG_BOOT_ELF32=y
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_BT is not set
-CONFIG_CMDLINE="init=/etc/preinit rootfstype=squashfs,jffs2,"
-CONFIG_CPMAC=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2 is not set
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-# CONFIG_DM9000 is not set
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_FIXED_MII_100_FDX=y
-# CONFIG_FIXED_MII_10_FDX is not set
-CONFIG_FIXED_PHY=y
-CONFIG_FS_POSIX_ACL=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HID_SUPPORT=n
-CONFIG_HW_HAS_PCI=y
-CONFIG_HW_RANDOM=y
-# CONFIG_I2C is not set
-# CONFIG_IDE is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IRQ_CPU=y
-CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_LEDS_GPIO=y
-CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
-# CONFIG_LEMOTE_FULONG is not set
-# CONFIG_MACH_ALCHEMY is not set
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_MACH_VR41XX is not set
-CONFIG_MIPS=y
-# CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_COBALT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MALTA is not set
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MIPS_SIM is not set
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-CONFIG_MTD_AR7_PARTS=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_MTD_BLOCK2MTD is not set
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_CMDLINE_PARTS is not set
-CONFIG_MTD_COMPLEX_MAPPINGS=y
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_BANKWIDTH=2
-CONFIG_MTD_PHYSMAP_LEN=0
-CONFIG_MTD_PHYSMAP_START=0x10000000
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEVICES_MULTIQUEUE is not set
-CONFIG_NET_ACT_POLICE=y
-CONFIG_NET_SCH_FIFO=y
-# CONFIG_NF_CT_PROTO_GRE is not set
-# CONFIG_NF_NAT_PROTO_GRE is not set
-CONFIG_NO_EXCEPT_FILL=y
-# CONFIG_NO_IOPORT is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-# CONFIG_PCI is not set
-CONFIG_PHYLIB=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_RTC is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-# CONFIG_SCSI_WAIT_SCAN is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_PTSWARM is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
-CONFIG_SYS_SUPPORTS_KGDB=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_TRAD_SIGNALS=y
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_USB_ARCH_HAS_EHCI is not set
-# CONFIG_USB_ARCH_HAS_HCD is not set
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-# CONFIG_USER_NS is not set
-# CONFIG_VGASTATE is not set
-CONFIG_VLYNQ=y
-CONFIG_ZONE_DMA_FLAG=0

+ 0 - 198
target/linux/ar7/config-2.6.24

@@ -1,198 +0,0 @@
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-CONFIG_AR7=y
-CONFIG_AR7_GPIO=y
-CONFIG_AR7_WDT=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-CONFIG_ARCH_SUPPORTS_OPROFILE=y
-CONFIG_ATM_DRIVERS=y
-CONFIG_BASE_SMALL=0
-# CONFIG_BCM47XX is not set
-CONFIG_BITREVERSE=y
-CONFIG_BOOT_ELF32=y
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_BT is not set
-CONFIG_CEVT_R4K=y
-CONFIG_CMDLINE="init=/etc/preinit rootfstype=squashfs,jffs2,"
-CONFIG_CPMAC=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2 is not set
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-CONFIG_CSRC_R4K=y
-# CONFIG_DM9000 is not set
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_FIXED_PHY=y
-CONFIG_FS_POSIX_ACL=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HW_RANDOM=y
-# CONFIG_I2C is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IDE is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IRQ_CPU=y
-CONFIG_KALLSYMS=y
-# CONFIG_LEDS_ALIX is not set
-CONFIG_LEDS_GPIO=y
-# CONFIG_LEMOTE_FULONG is not set
-# CONFIG_MACH_ALCHEMY is not set
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_MACH_VR41XX is not set
-# CONFIG_MDIO_BITBANG is not set
-CONFIG_MIPS=y
-# CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_COBALT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MALTA is not set
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MIPS_SIM is not set
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-CONFIG_MTD_AR7_PARTS=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_MTD_BLOCK2MTD is not set
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_CMDLINE_PARTS is not set
-CONFIG_MTD_COMPLEX_MAPPINGS=y
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_BANKWIDTH=2
-CONFIG_MTD_PHYSMAP_LEN=0
-CONFIG_MTD_PHYSMAP_START=0x10000000
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_SLRAM is not set
-CONFIG_NO_EXCEPT_FILL=y
-# CONFIG_NO_IOPORT is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-CONFIG_PHYLIB=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_RTC is not set
-CONFIG_RTC_LIB=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-# CONFIG_SCSI_WAIT_SCAN is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_PTSWARM is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SLAB is not set
-CONFIG_SLABINFO=y
-CONFIG_SLUB=y
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
-CONFIG_SSB_POSSIBLE=y
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
-CONFIG_SYS_SUPPORTS_KGDB=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_TICK_ONESHOT=y
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_TRAD_SIGNALS=y
-# CONFIG_USB_ARCH_HAS_EHCI is not set
-# CONFIG_USB_ARCH_HAS_HCD is not set
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-# CONFIG_USER_NS is not set
-# CONFIG_VGASTATE is not set
-CONFIG_VLYNQ=y
-CONFIG_ZONE_DMA_FLAG=0

+ 0 - 214
target/linux/ar7/config-2.6.25

@@ -1,214 +0,0 @@
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-CONFIG_AR7=y
-CONFIG_AR7_GPIO=y
-CONFIG_AR7_WDT=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-CONFIG_ARCH_SUPPORTS_OPROFILE=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ATM_DRIVERS=y
-CONFIG_BASE_SMALL=0
-# CONFIG_BCM47XX is not set
-CONFIG_BITREVERSE=y
-CONFIG_BOOT_ELF32=y
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_BT is not set
-CONFIG_CEVT_R4K=y
-CONFIG_CLASSIC_RCU=y
-CONFIG_CMDLINE="init=/etc/preinit rootfstype=squashfs,jffs2,"
-CONFIG_CPMAC=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2 is not set
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-# CONFIG_CRYPTO_AEAD is not set
-# CONFIG_CRYPTO_AUTHENC is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-CONFIG_CSRC_R4K=y
-# CONFIG_DM9000 is not set
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_FIXED_PHY=y
-CONFIG_FS_POSIX_ACL=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAVE_IDE=y
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HW_RANDOM=y
-# CONFIG_I2C is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IDE is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IRQ_CPU=y
-# CONFIG_ISDN is not set
-CONFIG_KALLSYMS=y
-# CONFIG_LEDS_ALIX is not set
-CONFIG_LEDS_GPIO=y
-# CONFIG_LEMOTE_FULONG is not set
-# CONFIG_LZO_COMPRESS is not set
-# CONFIG_LZO_DECOMPRESS is not set
-# CONFIG_MACH_ALCHEMY is not set
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_MACH_VR41XX is not set
-# CONFIG_MDIO_BITBANG is not set
-# CONFIG_MEMSTICK is not set
-CONFIG_MIPS=y
-# CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_COBALT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MALTA is not set
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MIPS_SIM is not set
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-CONFIG_MTD_AR7_PARTS=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_MTD_BLOCK2MTD is not set
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_CMDLINE_PARTS is not set
-CONFIG_MTD_COMPLEX_MAPPINGS=y
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_BANKWIDTH=2
-CONFIG_MTD_PHYSMAP_LEN=0
-CONFIG_MTD_PHYSMAP_START=0x10000000
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_SLRAM is not set
-CONFIG_NO_EXCEPT_FILL=y
-# CONFIG_NO_IOPORT is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-CONFIG_PHYLIB=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_REALTEK_PHY is not set
-# CONFIG_RTC is not set
-CONFIG_RTC_LIB=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-# CONFIG_SCSI is not set
-# CONFIG_SCSI_DMA is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP28 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SLAB is not set
-CONFIG_SLABINFO=y
-CONFIG_SLUB=y
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_SLUB_STATS is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_SOUND is not set
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
-CONFIG_SSB_POSSIBLE=y
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
-CONFIG_SYS_SUPPORTS_KGDB=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_TICK_ONESHOT=y
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_TRAD_SIGNALS=y
-# CONFIG_USB_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_DEV is not set
-CONFIG_VLYNQ=y
-# CONFIG_W1 is not set
-CONFIG_ZONE_DMA_FLAG=0

+ 0 - 94
target/linux/ar7/patches-2.6.23/100-board_support.patch

@@ -1,94 +0,0 @@
-Index: linux-2.6.23.17/arch/mips/Kconfig
-===================================================================
---- linux-2.6.23.17.orig/arch/mips/Kconfig
-+++ linux-2.6.23.17/arch/mips/Kconfig
-@@ -15,6 +15,22 @@ choice
- 	prompt "System type"
- 	default SGI_IP22
- 
-+config AR7
-+	bool "Texas Instruments AR7"
-+	select BOOT_ELF32
-+	select DMA_NONCOHERENT
-+	select IRQ_CPU
-+	select NO_EXCEPT_FILL
-+	select SWAP_IO_SPACE
-+	select SYS_HAS_CPU_MIPS32_R1
-+	select SYS_HAS_EARLY_PRINTK
-+	select SYS_SUPPORTS_32BIT_KERNEL
-+	select SYS_SUPPORTS_KGDB
-+	select SYS_SUPPORTS_LITTLE_ENDIAN
-+	select SYS_SUPPORTS_BIG_ENDIAN
-+	select GENERIC_GPIO
-+	select GENERIC_HARDIRQS_NO__DO_IRQ
-+
- config MACH_ALCHEMY
- 	bool "Alchemy processor based machines"
- 
-Index: linux-2.6.23.17/arch/mips/kernel/traps.c
-===================================================================
---- linux-2.6.23.17.orig/arch/mips/kernel/traps.c
-+++ linux-2.6.23.17/arch/mips/kernel/traps.c
-@@ -1075,10 +1075,23 @@ void *set_except_vector(int n, void *add
- 
- 	exception_handlers[n] = handler;
- 	if (n == 0 && cpu_has_divec) {
--		*(volatile u32 *)(ebase + 0x200) = 0x08000000 |
--		                                 (0x03ffffff & (handler >> 2));
--		flush_icache_range(ebase + 0x200, ebase + 0x204);
--	}
-+		if ((handler ^ (ebase + 4)) & 0xfc000000) {
-+			/* lui k0, 0x0000 */
-+			*(u32 *)(ebase + 0x200) = 0x3c1a0000 | (handler >> 16);
-+			/* ori k0, 0x0000 */
-+			*(u32 *)(ebase + 0x204) =
-+					0x375a0000 | (handler & 0xffff);
-+			/* jr k0 */
-+			*(u32 *)(ebase + 0x208) = 0x03400008;
-+			/* nop */
-+			*(u32 *)(ebase + 0x20C) = 0x00000000;
-+			flush_icache_range(ebase + 0x200, ebase + 0x210);
-+		} else {
-+			*(volatile u32 *)(ebase + 0x200) =
-+				0x08000000 | (0x03ffffff & (handler >> 2));
-+			flush_icache_range(ebase + 0x200, ebase + 0x204);
-+		}
-+ 	}
- 	return (void *)old_handler;
- }
- 
-Index: linux-2.6.23.17/arch/mips/Makefile
-===================================================================
---- linux-2.6.23.17.orig/arch/mips/Makefile
-+++ linux-2.6.23.17/arch/mips/Makefile
-@@ -161,6 +161,13 @@ libs-$(CONFIG_SIBYTE_CFE)	+= arch/mips/s
- #
- 
- #
-+# Texas Instruments AR7
-+#
-+core-$(CONFIG_AR7)		+= arch/mips/ar7/
-+cflags-$(CONFIG_AR7)		+= -Iinclude/asm-mips/ar7
-+load-$(CONFIG_AR7)		+= 0xffffffff94100000
-+
-+#
- # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
- #
- core-$(CONFIG_MACH_JAZZ)	+= arch/mips/jazz/
-Index: linux-2.6.23.17/include/asm-mips/page.h
-===================================================================
---- linux-2.6.23.17.orig/include/asm-mips/page.h
-+++ linux-2.6.23.17/include/asm-mips/page.h
-@@ -184,8 +184,10 @@ typedef struct { unsigned long pgprot; }
- #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
- 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
- 
--#define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE)
--#define CAC_ADDR(addr)		((addr) - UNCAC_BASE + PAGE_OFFSET)
-+#define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE +	\
-+				 PHYS_OFFSET)
-+#define CAC_ADDR(addr)		((addr) - UNCAC_BASE + PAGE_OFFSET -	\
-+				 PHYS_OFFSET)
- 
- #include <asm-generic/memory_model.h>
- #include <asm-generic/page.h>

+ 0 - 43
target/linux/ar7/patches-2.6.23/110-flash.patch

@@ -1,43 +0,0 @@
-Index: linux-2.6.23.17/drivers/mtd/Kconfig
-===================================================================
---- linux-2.6.23.17.orig/drivers/mtd/Kconfig
-+++ linux-2.6.23.17/drivers/mtd/Kconfig
-@@ -160,6 +160,12 @@ config MTD_AFS_PARTS
- 	  for your particular device. It won't happen automatically. The
- 	  'armflash' map driver (CONFIG_MTD_ARMFLASH) does this, for example.
- 
-+config MTD_AR7_PARTS
-+	tristate "TI AR7 partitioning support"
-+	depends on MTD_PARTITIONS
-+	---help---
-+	  TI AR7 partitioning support
-+
- comment "User Modules And Translation Layers"
- 
- config MTD_CHAR
-Index: linux-2.6.23.17/drivers/mtd/Makefile
-===================================================================
---- linux-2.6.23.17.orig/drivers/mtd/Makefile
-+++ linux-2.6.23.17/drivers/mtd/Makefile
-@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_CONCAT)	+= mtdconcat.o
- obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
- obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
- obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
-+obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
- 
- # 'Users' - code which presents functionality to userspace.
- obj-$(CONFIG_MTD_CHAR)		+= mtdchar.o
-Index: linux-2.6.23.17/drivers/mtd/maps/physmap.c
-===================================================================
---- linux-2.6.23.17.orig/drivers/mtd/maps/physmap.c
-+++ linux-2.6.23.17/drivers/mtd/maps/physmap.c
-@@ -74,7 +74,8 @@ static int physmap_flash_remove(struct p
- 
- static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
- #ifdef CONFIG_MTD_PARTITIONS
--static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
-+static const char *part_probe_types[] = {"cmdlinepart", "RedBoot",
-+					"ar7part", NULL };
- #endif
- 
- static int physmap_flash_probe(struct platform_device *dev)

+ 0 - 32
target/linux/ar7/patches-2.6.23/120-gpio_chrdev.patch

@@ -1,32 +0,0 @@
-Index: linux-2.6.23.17/drivers/char/Kconfig
-===================================================================
---- linux-2.6.23.17.orig/drivers/char/Kconfig
-+++ linux-2.6.23.17/drivers/char/Kconfig
-@@ -928,6 +928,15 @@ config MWAVE
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called mwave.
- 
-+config AR7_GPIO
-+	tristate "TI AR7 GPIO Support"
-+	depends on AR7
-+	help
-+	  Give userspace access to the GPIO pins on the Texas Instruments AR7 
-+	  processors.
-+
-+	  If compiled as a module, it will be called ar7_gpio.
-+
- config SCx200_GPIO
- 	tristate "NatSemi SCx200 GPIO Support"
- 	depends on SCx200
-Index: linux-2.6.23.17/drivers/char/Makefile
-===================================================================
---- linux-2.6.23.17.orig/drivers/char/Makefile
-+++ linux-2.6.23.17/drivers/char/Makefile
-@@ -89,6 +89,7 @@ obj-$(CONFIG_COBALT_LCD)	+= lcd.o
- obj-$(CONFIG_PPDEV)		+= ppdev.o
- obj-$(CONFIG_NWBUTTON)		+= nwbutton.o
- obj-$(CONFIG_NWFLASH)		+= nwflash.o
-+obj-$(CONFIG_AR7_GPIO)		+= ar7_gpio.o
- obj-$(CONFIG_SCx200_GPIO)	+= scx200_gpio.o
- obj-$(CONFIG_PC8736x_GPIO)	+= pc8736x_gpio.o
- obj-$(CONFIG_NSC_GPIO)		+= nsc_gpio.o

+ 0 - 21
target/linux/ar7/patches-2.6.23/130-vlynq.patch

@@ -1,21 +0,0 @@
-Index: linux-2.6.23.17/drivers/Kconfig
-===================================================================
---- linux-2.6.23.17.orig/drivers/Kconfig
-+++ linux-2.6.23.17/drivers/Kconfig
-@@ -93,4 +93,6 @@ source "drivers/kvm/Kconfig"
- source "drivers/uio/Kconfig"
- 
- source "drivers/lguest/Kconfig"
-+
-+source "drivers/vlynq/Kconfig"
- endmenu
-Index: linux-2.6.23.17/drivers/Makefile
-===================================================================
---- linux-2.6.23.17.orig/drivers/Makefile
-+++ linux-2.6.23.17/drivers/Makefile
-@@ -89,4 +89,5 @@ obj-$(CONFIG_DMA_ENGINE)	+= dma/
- obj-$(CONFIG_HID)		+= hid/
- obj-$(CONFIG_PPC_PS3)		+= ps3/
- obj-$(CONFIG_OF)		+= of/
-+obj-$(CONFIG_VLYNQ)		+= vlynq/
- obj-$(CONFIG_GPIO_DEVICE)	+= gpio/

+ 0 - 29
target/linux/ar7/patches-2.6.23/140-watchdog.patch

@@ -1,29 +0,0 @@
-Index: linux-2.6.23.17/drivers/char/watchdog/Kconfig
-===================================================================
---- linux-2.6.23.17.orig/drivers/char/watchdog/Kconfig
-+++ linux-2.6.23.17/drivers/char/watchdog/Kconfig
-@@ -583,6 +583,12 @@ config SBC_EPX_C3_WATCHDOG
- 
- # MIPS Architecture
- 
-+config AR7_WDT
-+	tristate "TI AR7 Watchdog Timer"
-+	depends on WATCHDOG && AR7
-+	help
-+	  Hardware driver for the TI AR7 Watchdog Timer.
-+
- config INDYDOG
- 	tristate "Indy/I2 Hardware Watchdog"
- 	depends on SGI_IP22
-Index: linux-2.6.23.17/drivers/char/watchdog/Makefile
-===================================================================
---- linux-2.6.23.17.orig/drivers/char/watchdog/Makefile
-+++ linux-2.6.23.17/drivers/char/watchdog/Makefile
-@@ -87,6 +87,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc
- # M68KNOMMU Architecture
- 
- # MIPS Architecture
-+obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
- obj-$(CONFIG_INDYDOG) += indydog.o
- obj-$(CONFIG_WDT_MTX1)	+= mtx-1_wdt.o
- obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o

+ 0 - 32
target/linux/ar7/patches-2.6.23/200-ethernet_driver.patch

@@ -1,32 +0,0 @@
-Index: linux-2.6.23.17/drivers/net/Kconfig
-===================================================================
---- linux-2.6.23.17.orig/drivers/net/Kconfig
-+++ linux-2.6.23.17/drivers/net/Kconfig
-@@ -1965,6 +1965,15 @@ config SC92031
- 	  To compile this driver as a module, choose M here: the module
- 	  will be called sc92031.  This is recommended.
- 
-+config CPMAC
-+	tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)"
-+	depends on NET_ETHERNET && EXPERIMENTAL && AR7
-+	select PHYLIB
-+	select FIXED_PHY
-+	select FIXED_MII_100_FDX
-+	help
-+	  TI AR7 CPMAC Ethernet support
-+
- config NET_POCKET
- 	bool "Pocket and portable adapters"
- 	depends on PARPORT
-Index: linux-2.6.23.17/drivers/net/Makefile
-===================================================================
---- linux-2.6.23.17.orig/drivers/net/Makefile
-+++ linux-2.6.23.17/drivers/net/Makefile
-@@ -156,6 +156,7 @@ obj-$(CONFIG_8139CP) += 8139cp.o
- obj-$(CONFIG_8139TOO) += 8139too.o
- obj-$(CONFIG_ZNET) += znet.o
- obj-$(CONFIG_LAN_SAA9730) += saa9730.o
-+obj-$(CONFIG_CPMAC) += cpmac.o
- obj-$(CONFIG_DEPCA) += depca.o
- obj-$(CONFIG_EWRK3) += ewrk3.o
- obj-$(CONFIG_ATP) += atp.o

+ 0 - 93
target/linux/ar7/patches-2.6.23/210-phy_fixed.patch

@@ -1,93 +0,0 @@
-Index: linux-2.6.23.17/drivers/net/phy/fixed.c
-===================================================================
---- linux-2.6.23.17.orig/drivers/net/phy/fixed.c
-+++ linux-2.6.23.17/drivers/net/phy/fixed.c
-@@ -189,6 +189,19 @@ static struct phy_driver fixed_mdio_driv
- 	.driver 	= { .owner = THIS_MODULE,},
- };
- 
-+static void fixed_mdio_release (struct device * dev)
-+{
-+	struct phy_device *phydev = container_of(dev, struct phy_device, dev);
-+	struct mii_bus *bus = phydev->bus;
-+	struct fixed_info *fixed = bus->priv;
-+
-+	kfree(phydev);
-+	kfree(bus->dev);
-+	kfree(bus);
-+	kfree(fixed->regs);
-+	kfree(fixed);
-+}
-+
- /*-----------------------------------------------------------------------------
-  *  This func is used to create all the necessary stuff, bind
-  * the fixed phy driver and register all it on the mdio_bus_type.
-@@ -224,6 +237,12 @@ static int fixed_mdio_register_device(in
- 	}
- 
- 	fixed->regs = kzalloc(MII_REGS_NUM*sizeof(int), GFP_KERNEL);
-+	if (NULL == fixed->regs) {
-+		kfree(dev);
-+		kfree(new_bus);
-+		kfree(fixed);
-+		return -ENOMEM;
-+	}
- 	fixed->regs_num = MII_REGS_NUM;
- 	fixed->phy_status.speed = speed;
- 	fixed->phy_status.duplex = duplex;
-@@ -252,8 +271,11 @@ static int fixed_mdio_register_device(in
- 	fixed->phydev = phydev;
- 
- 	if(NULL == phydev) {
--		err = -ENOMEM;
--		goto device_create_fail;
-+		kfree(dev);
-+		kfree(new_bus);
-+		kfree(fixed->regs);
-+		kfree(fixed);
-+		return -ENOMEM;
- 	}
- 
- 	phydev->irq = PHY_IGNORE_INTERRUPT;
-@@ -265,8 +287,33 @@ static int fixed_mdio_register_device(in
- 	else
- 		snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
- 				"fixed@%d:%d", speed, duplex);
-+
- 	phydev->bus = new_bus;
- 
-+#if 1
-+	phydev->dev.driver = &fixed_mdio_driver.driver;
-+	phydev->dev.release = fixed_mdio_release;
-+
-+	err = phydev->dev.driver->probe(&phydev->dev);
-+	if(err < 0) {
-+		printk(KERN_ERR "Phy %s: problems with fixed driver\n",
-+			phydev->dev.bus_id);
-+		kfree(phydev);
-+		kfree(dev);
-+		kfree(new_bus);
-+		kfree(fixed->regs);
-+		kfree(fixed);
-+		return err;
-+	}
-+
-+	err = device_register(&phydev->dev);
-+	if(err) {
-+		printk(KERN_ERR "Phy %s failed to register\n",
-+				phydev->dev.bus_id);
-+	}
-+
-+	return 0;
-+#else
- 	err = device_register(&phydev->dev);
- 	if(err) {
- 		printk(KERN_ERR "Phy %s failed to register\n",
-@@ -303,6 +350,7 @@ device_create_fail:
- 	kfree(fixed);
- 
- 	return err;
-+#endif
- }
- #endif
- 

+ 0 - 57
target/linux/ar7/patches-2.6.23/500-serial_kludge.patch

@@ -1,57 +0,0 @@
-Index: linux-2.6.23.17/drivers/serial/8250.c
-===================================================================
---- linux-2.6.23.17.orig/drivers/serial/8250.c
-+++ linux-2.6.23.17/drivers/serial/8250.c
-@@ -267,6 +267,13 @@ static const struct serial8250_config ua
- 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
- 		.flags		= UART_CAP_FIFO,
- 	},
-+	[PORT_AR7] = {
-+		.name		= "TI-AR7",
-+		.fifo_size	= 16,
-+		.tx_loadsz	= 16,
-+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
-+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
-+	},
- };
- 
- #if defined (CONFIG_SERIAL_8250_AU1X00)
-@@ -2455,7 +2462,11 @@ static void serial8250_console_putchar(s
- {
- 	struct uart_8250_port *up = (struct uart_8250_port *)port;
- 
-+#ifdef CONFIG_AR7
-+	wait_for_xmitr(up, BOTH_EMPTY);
-+#else
- 	wait_for_xmitr(up, UART_LSR_THRE);
-+#endif
- 	serial_out(up, UART_TX, ch);
- }
- 
-Index: linux-2.6.23.17/include/linux/serial_core.h
-===================================================================
---- linux-2.6.23.17.orig/include/linux/serial_core.h
-+++ linux-2.6.23.17/include/linux/serial_core.h
-@@ -40,6 +40,7 @@
- #define PORT_NS16550A	14
- #define PORT_XSCALE	15
- #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
-+#define PORT_AR7	16
- #define PORT_MAX_8250	16	/* max port ID */
- 
- /*
-Index: linux-2.6.23.17/include/linux/serialP.h
-===================================================================
---- linux-2.6.23.17.orig/include/linux/serialP.h
-+++ linux-2.6.23.17/include/linux/serialP.h
-@@ -135,6 +135,10 @@ struct rs_multiport_struct {
-  * the interrupt line _up_ instead of down, so if we register the IRQ
-  * while the UART is in that state, we die in an IRQ storm. */
- #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
-+#elif defined(CONFIG_AR7)
-+/* This is how it is set up by bootloader... */
-+#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1 \
-+			| UART_MCR_RTS | UART_MCR_DTR)
- #else
- #define ALPHA_KLUDGE_MCR 0
- #endif

+ 0 - 94
target/linux/ar7/patches-2.6.24/100-board_support.patch

@@ -1,94 +0,0 @@
-Index: linux-2.6.24.7/arch/mips/Kconfig
-===================================================================
---- linux-2.6.24.7.orig/arch/mips/Kconfig
-+++ linux-2.6.24.7/arch/mips/Kconfig
-@@ -16,6 +16,24 @@ choice
- 	prompt "System type"
- 	default SGI_IP22
- 
-+config AR7
-+	bool "Texas Instruments AR7"
-+	select BOOT_ELF32
-+	select DMA_NONCOHERENT
-+	select CEVT_R4K
-+	select CSRC_R4K
-+	select IRQ_CPU
-+	select NO_EXCEPT_FILL
-+	select SWAP_IO_SPACE
-+	select SYS_HAS_CPU_MIPS32_R1
-+	select SYS_HAS_EARLY_PRINTK
-+	select SYS_SUPPORTS_32BIT_KERNEL
-+	select SYS_SUPPORTS_KGDB
-+	select SYS_SUPPORTS_LITTLE_ENDIAN
-+	select SYS_SUPPORTS_BIG_ENDIAN
-+	select GENERIC_GPIO
-+	select GENERIC_HARDIRQS_NO__DO_IRQ
-+
- config MACH_ALCHEMY
- 	bool "Alchemy processor based machines"
- 
-Index: linux-2.6.24.7/arch/mips/kernel/traps.c
-===================================================================
---- linux-2.6.24.7.orig/arch/mips/kernel/traps.c
-+++ linux-2.6.24.7/arch/mips/kernel/traps.c
-@@ -1093,9 +1093,22 @@ void *set_except_vector(int n, void *add
- 
- 	exception_handlers[n] = handler;
- 	if (n == 0 && cpu_has_divec) {
--		*(u32 *)(ebase + 0x200) = 0x08000000 |
--					  (0x03ffffff & (handler >> 2));
--		flush_icache_range(ebase + 0x200, ebase + 0x204);
-+		if ((handler ^ (ebase + 4)) & 0xfc000000) {
-+			/* lui k0, 0x0000 */
-+			*(u32 *)(ebase + 0x200) = 0x3c1a0000 | (handler >> 16);
-+			/* ori k0, 0x0000 */
-+			*(u32 *)(ebase + 0x204) =
-+					0x375a0000 | (handler & 0xffff);
-+			/* jr k0 */
-+			*(u32 *)(ebase + 0x208) = 0x03400008;
-+			/* nop */
-+			*(u32 *)(ebase + 0x20C) = 0x00000000;
-+			flush_icache_range(ebase + 0x200, ebase + 0x210);
-+		} else {
-+			*(u32 *)(ebase + 0x200) =
-+				0x08000000 | (0x03ffffff & (handler >> 2));
-+			flush_icache_range(ebase + 0x200, ebase + 0x204);
-+		}
- 	}
- 	return (void *)old_handler;
- }
-Index: linux-2.6.24.7/arch/mips/Makefile
-===================================================================
---- linux-2.6.24.7.orig/arch/mips/Makefile
-+++ linux-2.6.24.7/arch/mips/Makefile
-@@ -159,6 +159,13 @@ libs-$(CONFIG_SIBYTE_CFE)	+= arch/mips/s
- #
- 
- #
-+# Texas Instruments AR7
-+#
-+core-$(CONFIG_AR7)		+= arch/mips/ar7/
-+cflags-$(CONFIG_AR7)		+= -Iinclude/asm-mips/ar7
-+load-$(CONFIG_AR7)		+= 0xffffffff94100000
-+
-+#
- # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
- #
- core-$(CONFIG_MACH_JAZZ)	+= arch/mips/jazz/
-Index: linux-2.6.24.7/include/asm-mips/page.h
-===================================================================
---- linux-2.6.24.7.orig/include/asm-mips/page.h
-+++ linux-2.6.24.7/include/asm-mips/page.h
-@@ -184,8 +184,10 @@ typedef struct { unsigned long pgprot; }
- #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
- 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
- 
--#define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE)
--#define CAC_ADDR(addr)		((addr) - UNCAC_BASE + PAGE_OFFSET)
-+#define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE +	\
-+				 PHYS_OFFSET)
-+#define CAC_ADDR(addr)		((addr) - UNCAC_BASE + PAGE_OFFSET -	\
-+				 PHYS_OFFSET)
- 
- #include <asm-generic/memory_model.h>
- #include <asm-generic/page.h>

+ 0 - 43
target/linux/ar7/patches-2.6.24/110-flash.patch

@@ -1,43 +0,0 @@
-Index: linux-2.6.24.7/drivers/mtd/Kconfig
-===================================================================
---- linux-2.6.24.7.orig/drivers/mtd/Kconfig
-+++ linux-2.6.24.7/drivers/mtd/Kconfig
-@@ -160,6 +160,12 @@ config MTD_AFS_PARTS
- 	  for your particular device. It won't happen automatically. The
- 	  'armflash' map driver (CONFIG_MTD_ARMFLASH) does this, for example.
- 
-+config MTD_AR7_PARTS
-+	tristate "TI AR7 partitioning support"
-+	depends on MTD_PARTITIONS
-+	---help---
-+	  TI AR7 partitioning support
-+
- comment "User Modules And Translation Layers"
- 
- config MTD_CHAR
-Index: linux-2.6.24.7/drivers/mtd/Makefile
-===================================================================
---- linux-2.6.24.7.orig/drivers/mtd/Makefile
-+++ linux-2.6.24.7/drivers/mtd/Makefile
-@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_CONCAT)	+= mtdconcat.o
- obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
- obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
- obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
-+obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
- 
- # 'Users' - code which presents functionality to userspace.
- obj-$(CONFIG_MTD_CHAR)		+= mtdchar.o
-Index: linux-2.6.24.7/drivers/mtd/maps/physmap.c
-===================================================================
---- linux-2.6.24.7.orig/drivers/mtd/maps/physmap.c
-+++ linux-2.6.24.7/drivers/mtd/maps/physmap.c
-@@ -74,7 +74,8 @@ static int physmap_flash_remove(struct p
- 
- static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
- #ifdef CONFIG_MTD_PARTITIONS
--static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
-+static const char *part_probe_types[] = {"cmdlinepart", "RedBoot",
-+					"ar7part", NULL };
- #endif
- 
- static int physmap_flash_probe(struct platform_device *dev)

+ 0 - 32
target/linux/ar7/patches-2.6.24/120-gpio_chrdev.patch

@@ -1,32 +0,0 @@
-Index: linux-2.6.24.7/drivers/char/Kconfig
-===================================================================
---- linux-2.6.24.7.orig/drivers/char/Kconfig
-+++ linux-2.6.24.7/drivers/char/Kconfig
-@@ -904,6 +904,15 @@ config MWAVE
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called mwave.
- 
-+config AR7_GPIO
-+	tristate "TI AR7 GPIO Support"
-+	depends on AR7
-+	help
-+	  Give userspace access to the GPIO pins on the Texas Instruments AR7 
-+	  processors.
-+
-+	  If compiled as a module, it will be called ar7_gpio.
-+
- config SCx200_GPIO
- 	tristate "NatSemi SCx200 GPIO Support"
- 	depends on SCx200
-Index: linux-2.6.24.7/drivers/char/Makefile
-===================================================================
---- linux-2.6.24.7.orig/drivers/char/Makefile
-+++ linux-2.6.24.7/drivers/char/Makefile
-@@ -89,6 +89,7 @@ obj-$(CONFIG_COBALT_LCD)	+= lcd.o
- obj-$(CONFIG_PPDEV)		+= ppdev.o
- obj-$(CONFIG_NWBUTTON)		+= nwbutton.o
- obj-$(CONFIG_NWFLASH)		+= nwflash.o
-+obj-$(CONFIG_AR7_GPIO)		+= ar7_gpio.o
- obj-$(CONFIG_SCx200_GPIO)	+= scx200_gpio.o
- obj-$(CONFIG_PC8736x_GPIO)	+= pc8736x_gpio.o
- obj-$(CONFIG_NSC_GPIO)		+= nsc_gpio.o

+ 0 - 24
target/linux/ar7/patches-2.6.24/130-vlynq.patch

@@ -1,24 +0,0 @@
-Index: linux-2.6.24.7/drivers/Kconfig
-===================================================================
---- linux-2.6.24.7.orig/drivers/Kconfig
-+++ linux-2.6.24.7/drivers/Kconfig
-@@ -96,5 +96,7 @@ source "drivers/kvm/Kconfig"
- 
- source "drivers/uio/Kconfig"
- 
-+source "drivers/vlynq/Kconfig"
-+
- source "drivers/virtio/Kconfig"
- endmenu
-Index: linux-2.6.24.7/drivers/Makefile
-===================================================================
---- linux-2.6.24.7.orig/drivers/Makefile
-+++ linux-2.6.24.7/drivers/Makefile
-@@ -89,6 +89,7 @@ obj-$(CONFIG_DCA)		+= dca/
- obj-$(CONFIG_HID)		+= hid/
- obj-$(CONFIG_PPC_PS3)		+= ps3/
- obj-$(CONFIG_OF)		+= of/
-+obj-$(CONFIG_VLYNQ)		+= vlynq/
- obj-$(CONFIG_SSB)		+= ssb/
- obj-$(CONFIG_VIRTIO)		+= virtio/
- obj-$(CONFIG_GPIO_DEVICE)	+= gpio/

+ 0 - 268
target/linux/ar7/patches-2.6.24/140-cpmac_fix.patch

@@ -1,268 +0,0 @@
-Index: linux-2.6.24.7/drivers/net/cpmac.c
-===================================================================
---- linux-2.6.24.7.orig/drivers/net/cpmac.c
-+++ linux-2.6.24.7/drivers/net/cpmac.c
-@@ -38,6 +38,7 @@
- #include <linux/platform_device.h>
- #include <linux/dma-mapping.h>
- #include <asm/gpio.h>
-+#include <asm/atomic.h>
- 
- MODULE_AUTHOR("Eugene Konev <[email protected]>");
- MODULE_DESCRIPTION("TI AR7 ethernet driver (CPMAC)");
-@@ -207,6 +208,7 @@ struct cpmac_priv {
- 	struct work_struct reset_work;
- 	struct platform_device *pdev;
- 	struct napi_struct napi;
-+	atomic_t reset_pending;
- };
- 
- static irqreturn_t cpmac_irq(int, void *);
-@@ -455,6 +457,9 @@ static int cpmac_start_xmit(struct sk_bu
- 	struct cpmac_desc *desc;
- 	struct cpmac_priv *priv = netdev_priv(dev);
- 
-+	if (unlikely(atomic_read(&priv->reset_pending)))
-+		return NETDEV_TX_BUSY;
-+
- 	if (unlikely(skb_padto(skb, ETH_ZLEN)))
- 		return NETDEV_TX_OK;
- 
-@@ -634,14 +639,14 @@ static void cpmac_clear_tx(struct net_de
- 		priv->desc_ring[i].dataflags = 0;
- 		if (priv->desc_ring[i].skb) {
- 			dev_kfree_skb_any(priv->desc_ring[i].skb);
--			if (netif_subqueue_stopped(dev, i))
--			    netif_wake_subqueue(dev, i);
-+			priv->desc_ring[i].skb = NULL;
- 		}
- 	}
- }
- 
- static void cpmac_hw_error(struct work_struct *work)
- {
-+	int i;
- 	struct cpmac_priv *priv =
- 		container_of(work, struct cpmac_priv, reset_work);
- 
-@@ -650,8 +655,47 @@ static void cpmac_hw_error(struct work_s
- 	spin_unlock(&priv->rx_lock);
- 	cpmac_clear_tx(priv->dev);
- 	cpmac_hw_start(priv->dev);
--	napi_enable(&priv->napi);
--	netif_start_queue(priv->dev);
-+	barrier();
-+	atomic_dec(&priv->reset_pending);
-+	
-+	for (i = 0; i < CPMAC_QUEUES; i++) {
-+		netif_wake_subqueue(priv->dev, i);
-+	}
-+	netif_wake_queue(priv->dev);
-+	cpmac_write(priv->regs, CPMAC_MAC_INT_ENABLE, 3);
-+}
-+
-+static void cpmac_check_status(struct net_device *dev)
-+{
-+	struct cpmac_priv *priv = netdev_priv(dev);
-+
-+	u32 macstatus = cpmac_read(priv->regs, CPMAC_MAC_STATUS);
-+	int rx_channel = (macstatus >> 8) & 7;
-+	int rx_code = (macstatus >> 12) & 15;
-+	int tx_channel = (macstatus >> 16) & 7;
-+	int tx_code = (macstatus >> 20) & 15;
-+
-+	if (rx_code || tx_code) {
-+		if (netif_msg_drv(priv) && net_ratelimit()) {
-+			/* Can't find any documentation on what these error codes actually are.
-+			 * So just log them and hope..
-+			 */
-+			if (rx_code)
-+				printk(KERN_WARNING "%s: host error %d on rx channel %d (macstatus %08x), resetting\n",
-+				       dev->name, rx_code, rx_channel, macstatus);
-+			if (tx_code)
-+				printk(KERN_WARNING "%s: host error %d on tx channel %d (macstatus %08x), resetting\n",
-+				       dev->name, tx_code, tx_channel, macstatus);
-+		}
-+		
-+		netif_stop_queue(dev);
-+		cpmac_hw_stop(dev);
-+		if (schedule_work(&priv->reset_work))
-+			atomic_inc(&priv->reset_pending);
-+		if (unlikely(netif_msg_hw(priv)))
-+			cpmac_dump_regs(dev);
-+	}
-+	cpmac_write(priv->regs, CPMAC_MAC_INT_CLEAR, 0xff);
- }
- 
- static irqreturn_t cpmac_irq(int irq, void *dev_id)
-@@ -661,9 +705,6 @@ static irqreturn_t cpmac_irq(int irq, vo
- 	int queue;
- 	u32 status;
- 
--	if (!dev)
--		return IRQ_NONE;
--
- 	priv = netdev_priv(dev);
- 
- 	status = cpmac_read(priv->regs, CPMAC_MAC_INT_VECTOR);
-@@ -685,49 +726,33 @@ static irqreturn_t cpmac_irq(int irq, vo
- 
- 	cpmac_write(priv->regs, CPMAC_MAC_EOI_VECTOR, 0);
- 
--	if (unlikely(status & (MAC_INT_HOST | MAC_INT_STATUS))) {
--		if (netif_msg_drv(priv) && net_ratelimit())
--			printk(KERN_ERR "%s: hw error, resetting...\n",
--			       dev->name);
--		netif_stop_queue(dev);
--		napi_disable(&priv->napi);
--		cpmac_hw_stop(dev);
--		schedule_work(&priv->reset_work);
--		if (unlikely(netif_msg_hw(priv)))
--			cpmac_dump_regs(dev);
--	}
-+	if (unlikely(status & (MAC_INT_HOST | MAC_INT_STATUS)))
-+		cpmac_check_status(dev);
- 
- 	return IRQ_HANDLED;
- }
- 
- static void cpmac_tx_timeout(struct net_device *dev)
- {
--	struct cpmac_priv *priv = netdev_priv(dev);
- 	int i;
-+	struct cpmac_priv *priv = netdev_priv(dev);
- 
- 	spin_lock(&priv->lock);
- 	dev->stats.tx_errors++;
- 	spin_unlock(&priv->lock);
- 	if (netif_msg_tx_err(priv) && net_ratelimit())
- 		printk(KERN_WARNING "%s: transmit timeout\n", dev->name);
--	/* 
--	 * FIXME: waking up random queue is not the best thing to
--	 * do... on the other hand why we got here at all?
--	 */
--#ifdef CONFIG_NETDEVICES_MULTIQUEUE
--	for (i = 0; i < CPMAC_QUEUES; i++)
--		if (priv->desc_ring[i].skb) {
--			priv->desc_ring[i].dataflags = 0;
--			dev_kfree_skb_any(priv->desc_ring[i].skb);
--			netif_wake_subqueue(dev, i);
--			break;
--		}
--#else
--	priv->desc_ring[0].dataflags = 0;
--	if (priv->desc_ring[0].skb)
--		dev_kfree_skb_any(priv->desc_ring[0].skb);
--	netif_wake_queue(dev);
--#endif
-+
-+	atomic_inc(&priv->reset_pending);
-+	barrier();
-+	cpmac_clear_tx(dev);
-+	barrier();
-+	atomic_dec(&priv->reset_pending);
-+
-+	netif_wake_queue(priv->dev);
-+	for (i = 0; i < CPMAC_QUEUES; i++) {
-+		netif_wake_subqueue(dev, i);
-+	}
- }
- 
- static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-@@ -848,15 +873,6 @@ static void cpmac_adjust_link(struct net
- 	spin_unlock(&priv->lock);
- }
- 
--static int cpmac_link_update(struct net_device *dev,
--			     struct fixed_phy_status *status)
--{
--	status->link = 1;
--	status->speed = 100;
--	status->duplex = 1;
--	return 0;
--}
--
- static int cpmac_open(struct net_device *dev)
- {
- 	int i, size, res;
-@@ -923,6 +939,7 @@ static int cpmac_open(struct net_device 
- 		goto fail_irq;
- 	}
- 
-+	atomic_set(&priv->reset_pending, 0);
- 	INIT_WORK(&priv->reset_work, cpmac_hw_error);
- 	cpmac_hw_start(dev);
- 
-@@ -999,11 +1016,11 @@ static int external_switch;
- static int __devinit cpmac_probe(struct platform_device *pdev)
- {
- 	int rc, phy_id, i;
-+	int mdio_bus_id = cpmac_mii.id;
- 	struct resource *mem;
- 	struct cpmac_priv *priv;
- 	struct net_device *dev;
- 	struct plat_cpmac_data *pdata;
--	struct fixed_info *fixed_phy;
- 	DECLARE_MAC_BUF(mac);
- 
- 	pdata = pdev->dev.platform_data;
-@@ -1017,9 +1034,23 @@ static int __devinit cpmac_probe(struct 
- 	}
- 
- 	if (phy_id == PHY_MAX_ADDR) {
--		if (external_switch || dumb_switch)
-+		if (external_switch || dumb_switch) {
-+			struct fixed_phy_status status = {};
-+
-+			mdio_bus_id = 0;
-+
-+			/*
-+			 * FIXME: this should be in the platform code!
-+			 * Since there is not platform code at all (that is,
-+			 * no mainline users of that driver), place it here
-+			 * for now.
-+			 */
- 			phy_id = 0;
--		else {
-+			status.link = 1;
-+			status.duplex = 1;
-+			status.speed = 100;
-+			fixed_phy_add(PHY_POLL, phy_id, &status);
-+		} else {
- 			printk(KERN_ERR "cpmac: no PHY present\n");
- 			return -ENODEV;
- 		}
-@@ -1063,32 +1094,8 @@ static int __devinit cpmac_probe(struct 
- 	priv->msg_enable = netif_msg_init(debug_level, 0xff);
- 	memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
- 
--	if (phy_id == 31) {
--		snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, cpmac_mii.id,
--			 phy_id);
--	} else {
--		/* Let's try to get a free fixed phy... */
--		for (i = 0; i < MAX_PHY_AMNT; i++) {
--			fixed_phy = fixed_mdio_get_phydev(i);
--			if (!fixed_phy)
--				continue;
--			if (!fixed_phy->phydev->attached_dev) {
--				strncpy(priv->phy_name,
--					fixed_phy->phydev->dev.bus_id,
--					BUS_ID_SIZE);
--				fixed_mdio_set_link_update(fixed_phy->phydev,
--							   &cpmac_link_update);
--				goto phy_found;
--			}
--		}
--		if (netif_msg_drv(priv))
--			printk(KERN_ERR "%s: Could not find fixed PHY\n",
--			       dev->name);
--		rc = -ENODEV;
--		goto fail;
--	}
-+	snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
- 
--phy_found:
- 	priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
- 				PHY_INTERFACE_MODE_MII);
- 	if (IS_ERR(priv->phy)) {

+ 0 - 95
target/linux/ar7/patches-2.6.24/150-cpmac_up_and_running.diff

@@ -1,95 +0,0 @@
-From 0daaa095cefd9d7091a7ccce2ff89f1ff4feae7a Mon Sep 17 00:00:00 2001
-From: Anton Vorontsov <[email protected]>
-Date: Wed, 5 Mar 2008 14:52:26 +0300
-Subject: [PATCH] AR7/cpmac: convert to new fixed phy infrastructure, now for real
-
-This patch converts platform code to register fixed phys early.
-cpmac driver modified to blindly accept fixed phy id (that is equal
-to platform device id).
-
-Signed-off-by: Anton Vorontsov <[email protected]>
----
- arch/mips/ar7/platform.c |   17 +++++++++++++++++
- drivers/net/cpmac.c      |   19 +++----------------
- 2 files changed, 20 insertions(+), 16 deletions(-)
-
-Index: linux-2.6.24.7/arch/mips/ar7/platform.c
-===================================================================
---- linux-2.6.24.7.orig/arch/mips/ar7/platform.c
-+++ linux-2.6.24.7/arch/mips/ar7/platform.c
-@@ -33,6 +33,8 @@
- #include <linux/vlynq.h>
- #include <linux/leds.h>
- #include <linux/string.h>
-+#include <linux/phy.h>
-+#include <linux/phy_fixed.h>
- 
- #include <asm/addrspace.h>
- #include <asm/ar7/ar7.h>
-@@ -205,6 +207,13 @@ static struct physmap_flash_data physmap
- 	.width = 2,
- };
- 
-+/* lets assume this is suitable for both high and low cpmacs links */
-+static struct fixed_phy_status fixed_phy_status __initdata = {
-+	.link = 1,
-+	.speed = 100,
-+	.duplex = 1,
-+};
-+
- static struct plat_cpmac_data cpmac_low_data = {
- 	.reset_bit = 17,
- 	.power_bit = 20,
-@@ -506,6 +515,10 @@ static int __init ar7_register_devices(v
- 	}
- 
- 	if (ar7_has_high_cpmac()) {
-+		res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
-+		if (res && res != -ENODEV)
-+			return res;
-+
- 		cpmac_get_mac(1, cpmac_high_data.dev_addr);
- 		res = platform_device_register(&cpmac_high);
- 		if (res)
-@@ -514,6 +527,10 @@ static int __init ar7_register_devices(v
- 		cpmac_low_data.phy_mask = 0xffffffff;
- 	}
- 
-+	res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
-+	if (res && res != -ENODEV)
-+		return res;
-+
- 	cpmac_get_mac(0, cpmac_low_data.dev_addr);
- 	res = platform_device_register(&cpmac_low);
- 	if (res)
-Index: linux-2.6.24.7/drivers/net/cpmac.c
-===================================================================
---- linux-2.6.24.7.orig/drivers/net/cpmac.c
-+++ linux-2.6.24.7/drivers/net/cpmac.c
-@@ -1035,23 +1035,10 @@ static int __devinit cpmac_probe(struct 
- 
- 	if (phy_id == PHY_MAX_ADDR) {
- 		if (external_switch || dumb_switch) {
--			struct fixed_phy_status status = {};
--
--			mdio_bus_id = 0;
--
--			/*
--			 * FIXME: this should be in the platform code!
--			 * Since there is not platform code at all (that is,
--			 * no mainline users of that driver), place it here
--			 * for now.
--			 */
--			phy_id = 0;
--			status.link = 1;
--			status.duplex = 1;
--			status.speed = 100;
--			fixed_phy_add(PHY_POLL, phy_id, &status);
-+			mdio_bus_id = 0; /* fixed phys bus */
-+			phy_id = pdev->id;
- 		} else {
--			printk(KERN_ERR "cpmac: no PHY present\n");
-+			dev_err(&pdev->dev, "no PHY present\n");
- 			return -ENODEV;
- 		}
- 	}

+ 0 - 180
target/linux/ar7/patches-2.6.24/160-cpmac-rx-ring-use-eoq.diff

@@ -1,180 +0,0 @@
-Index: linux-2.6.24.7/drivers/net/cpmac.c
-===================================================================
---- linux-2.6.24.7.orig/drivers/net/cpmac.c
-+++ linux-2.6.24.7/drivers/net/cpmac.c
-@@ -187,6 +187,7 @@ struct cpmac_desc {
- #define CPMAC_EOQ			0x1000
- 	struct sk_buff *skb;
- 	struct cpmac_desc *next;
-+	struct cpmac_desc *prev;
- 	dma_addr_t mapping;
- 	dma_addr_t data_mapping;
- };
-@@ -242,6 +243,16 @@ static void cpmac_dump_desc(struct net_d
- 	printk("\n");
- }
- 
-+static void cpmac_dump_all_desc(struct net_device *dev)
-+{
-+        struct cpmac_priv *priv = netdev_priv(dev);
-+        struct cpmac_desc *dump = priv->rx_head;
-+        do {
-+                cpmac_dump_desc(dev, dump);
-+                dump = dump->next;
-+        } while (dump != priv->rx_head);
-+}
-+
- static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
- {
- 	int i;
-@@ -413,21 +424,40 @@ static struct sk_buff *cpmac_rx_one(stru
- static int cpmac_poll(struct napi_struct *napi, int budget)
- {
- 	struct sk_buff *skb;
--	struct cpmac_desc *desc;
--	int received = 0;
-+	struct cpmac_desc *desc, *restart;
- 	struct cpmac_priv *priv = container_of(napi, struct cpmac_priv, napi);
-+	int received = 0, processed = 0;
- 
- 	spin_lock(&priv->rx_lock);
- 	if (unlikely(!priv->rx_head)) {
- 		if (netif_msg_rx_err(priv) && net_ratelimit())
- 			printk(KERN_WARNING "%s: rx: polling, but no queue\n",
- 			       priv->dev->name);
-+		spin_unlock(&priv->rx_lock);
- 		netif_rx_complete(priv->dev, napi);
- 		return 0;
- 	}
- 
- 	desc = priv->rx_head;
-+	restart = NULL;
- 	while (((desc->dataflags & CPMAC_OWN) == 0) && (received < budget)) {
-+		processed++;
-+		
-+		if ((desc->dataflags & CPMAC_EOQ) != 0) {
-+			/* The last update to eoq->hw_next didn't happen soon enough, and the
-+			* receiver stopped here. Remember this descriptor so we can restart
-+			* the receiver after freeing some space.
-+			*/
-+			if (unlikely(restart)) {
-+				if (netif_msg_rx_err(priv))
-+					printk(KERN_ERR "%s: poll found a duplicate EOQ: %p and %p\n",
-+						priv->dev->name, restart, desc);
-+				goto fatal_error;
-+			}
-+			
-+			restart = desc->next;
-+		}
-+
- 		skb = cpmac_rx_one(priv, desc);
- 		if (likely(skb)) {
- 			netif_receive_skb(skb);
-@@ -436,19 +466,81 @@ static int cpmac_poll(struct napi_struct
- 		desc = desc->next;
- 	}
- 
-+	if (desc != priv->rx_head) {
-+		/* We freed some buffers, but not the whole ring, add what we did free to the rx list */ 
-+		desc->prev->hw_next = (u32)0;
-+		priv->rx_head->prev->hw_next = priv->rx_head->mapping;
-+	}
-+
-+	/* Optimization: If we did not actually process an EOQ (perhaps because of 
-+	* quota limits), check to see if the tail of the queue has EOQ set. We
-+	* should immediately restart in that case so that the receiver can restart
-+	* and run in parallel with more packet processing. This lets us handle slightly
-+	* larger bursts before running out of ring space (assuming dev->weight < ring_size)
-+	*/
-+	if (!restart &&
-+	     (priv->rx_head->prev->dataflags & (CPMAC_OWN|CPMAC_EOQ)) == CPMAC_EOQ &&
-+	     (priv->rx_head->dataflags & CPMAC_OWN) != 0) {
-+		/* reset EOQ so the poll loop (above) doesn't try to restart this when it
-+		* eventually gets to this descriptor.
-+		*/
-+		priv->rx_head->prev->dataflags &= ~CPMAC_EOQ;
-+		restart = priv->rx_head;
-+	}
-+
-+	if (restart) {
-+		priv->dev->stats.rx_errors++;
-+		priv->dev->stats.rx_fifo_errors++;
-+		if (netif_msg_rx_err(priv) && net_ratelimit())
-+			printk(KERN_WARNING "%s: rx dma ring overrun\n", priv->dev->name);
-+
-+		if (unlikely((restart->dataflags & CPMAC_OWN) == 0)) {
-+			if (netif_msg_drv(priv))
-+				printk(KERN_ERR "%s: cpmac_poll is trying to restart rx from a descriptor that's not free: %p\n",
-+					priv->dev->name, restart);
-+				goto fatal_error;
-+		}
-+
-+		cpmac_write(priv->regs, CPMAC_RX_PTR(0), restart->mapping);
-+	}
-+
- 	priv->rx_head = desc;
- 	spin_unlock(&priv->rx_lock);
- 	if (unlikely(netif_msg_rx_status(priv)))
- 		printk(KERN_DEBUG "%s: poll processed %d packets\n",
- 		       priv->dev->name, received);
--	if (desc->dataflags & CPMAC_OWN) {
-+	if (processed == 0) {
-+		/* we ran out of packets to read, revert to interrupt-driven mode */ 
- 		netif_rx_complete(priv->dev, napi);
--		cpmac_write(priv->regs, CPMAC_RX_PTR(0), (u32)desc->mapping);
- 		cpmac_write(priv->regs, CPMAC_RX_INT_ENABLE, 1);
- 		return 0;
- 	}
- 
- 	return 1;
-+
-+fatal_error:
-+	/* Something went horribly wrong. Reset hardware to try to recover rather than wedging. */ 
-+	
-+	if (netif_msg_drv(priv)) {
-+		printk(KERN_ERR "%s: cpmac_poll is confused. Resetting hardware\n", priv->dev->name);
-+		cpmac_dump_all_desc(priv->dev);
-+		printk(KERN_DEBUG "%s: RX_PTR(0)=0x%08x RX_ACK(0)=0x%08x\n",
-+			priv->dev->name,
-+			cpmac_read(priv->regs, CPMAC_RX_PTR(0)),
-+			cpmac_read(priv->regs, CPMAC_RX_ACK(0)));
-+	}
-+
-+	spin_unlock(&priv->rx_lock);
-+	netif_rx_complete(priv->dev, napi);
-+	netif_stop_queue(priv->dev);
-+	napi_disable(&priv->napi);
-+	
-+	atomic_inc(&priv->reset_pending);
-+	cpmac_hw_stop(priv->dev);
-+	if (!schedule_work(&priv->reset_work))
-+		atomic_dec(&priv->reset_pending);
-+	return 0;
-+ 
- }
- 
- static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
-@@ -625,8 +717,10 @@ static void cpmac_clear_rx(struct net_de
- 			desc->dataflags = CPMAC_OWN;
- 			dev->stats.rx_dropped++;
- 		}
-+		desc->hw_next = desc->next->mapping;
- 		desc = desc->next;
- 	}
-+	priv->rx_head->prev->hw_next = 0;
- }
- 
- static void cpmac_clear_tx(struct net_device *dev)
-@@ -928,9 +1022,12 @@ static int cpmac_open(struct net_device 
- 		desc->buflen = CPMAC_SKB_SIZE;
- 		desc->dataflags = CPMAC_OWN;
- 		desc->next = &priv->rx_head[(i + 1) % priv->ring_size];
-+		desc->next->prev = desc;
- 		desc->hw_next = (u32)desc->next->mapping;
- 	}
- 
-+	priv->rx_head->prev->hw_next = (u32)0;
-+
- 	if ((res = request_irq(dev->irq, cpmac_irq, IRQF_SHARED,
- 			       dev->name, dev))) {
- 		if (netif_msg_drv(priv))

+ 0 - 15
target/linux/ar7/patches-2.6.24/170-cpmac_eth_fix.patch

@@ -1,15 +0,0 @@
-Index: linux-2.6.24.7/drivers/net/cpmac.c
-===================================================================
---- linux-2.6.24.7.orig/drivers/net/cpmac.c
-+++ linux-2.6.24.7/drivers/net/cpmac.c
-@@ -1178,9 +1178,7 @@ static int __devinit cpmac_probe(struct 
- 	priv->msg_enable = netif_msg_init(debug_level, 0xff);
- 	memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
- 
--	snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
--
--	priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
-+	priv->phy = phy_connect(dev, cpmac_mii.phy_map[phy_id]->dev.bus_id, &cpmac_adjust_link, 0,
- 				PHY_INTERFACE_MODE_MII);
- 	if (IS_ERR(priv->phy)) {
- 		if (netif_msg_drv(priv))

+ 0 - 44
target/linux/ar7/patches-2.6.24/500-serial_kludge.patch

@@ -1,44 +0,0 @@
-Index: linux-2.6.24.7/drivers/serial/8250.c
-===================================================================
---- linux-2.6.24.7.orig/drivers/serial/8250.c
-+++ linux-2.6.24.7/drivers/serial/8250.c
-@@ -267,6 +267,13 @@ static const struct serial8250_config ua
- 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
- 		.flags		= UART_CAP_FIFO,
- 	},
-+	[PORT_AR7] = {
-+		.name		= "TI-AR7",
-+		.fifo_size	= 16,
-+		.tx_loadsz	= 16,
-+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
-+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
-+	},
- };
- 
- #if defined (CONFIG_SERIAL_8250_AU1X00)
-@@ -2453,7 +2460,11 @@ static void serial8250_console_putchar(s
- {
- 	struct uart_8250_port *up = (struct uart_8250_port *)port;
- 
-+#ifdef CONFIG_AR7
-+	wait_for_xmitr(up, BOTH_EMPTY);
-+#else
- 	wait_for_xmitr(up, UART_LSR_THRE);
-+#endif
- 	serial_out(up, UART_TX, ch);
- }
- 
-Index: linux-2.6.24.7/include/linux/serial_core.h
-===================================================================
---- linux-2.6.24.7.orig/include/linux/serial_core.h
-+++ linux-2.6.24.7/include/linux/serial_core.h
-@@ -40,7 +40,8 @@
- #define PORT_NS16550A	14
- #define PORT_XSCALE	15
- #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
--#define PORT_MAX_8250	16	/* max port ID */
-+#define PORT_AR7	17
-+#define PORT_MAX_8250	17	/* max port ID */
- 
- /*
-  * ARM specific type numbers.  These are not currently guaranteed

+ 0 - 29
target/linux/ar7/patches-2.6.24/900-temporary_cpmac_hack.diff

@@ -1,29 +0,0 @@
-Index: linux-2.6.24.7/drivers/net/cpmac.c
-===================================================================
---- linux-2.6.24.7.orig/drivers/net/cpmac.c
-+++ linux-2.6.24.7/drivers/net/cpmac.c
-@@ -936,7 +936,8 @@ static void cpmac_adjust_link(struct net
- 	int new_state = 0;
- 
- 	spin_lock(&priv->lock);
--	if (priv->phy->link) {
-+	if (1 /* priv->phy->link */ ) {
-+		netif_carrier_on(dev);
- 		netif_start_queue(dev);
- 		if (priv->phy->duplex != priv->oldduplex) {
- 			new_state = 1;
-@@ -948,11 +949,11 @@ static void cpmac_adjust_link(struct net
- 			priv->oldspeed = priv->phy->speed;
- 		}
- 
--		if (!priv->oldlink) {
-+		/*if (!priv->oldlink) {
- 			new_state = 1;
--			priv->oldlink = 1;
-+			priv->oldlink = 1;*/
- 			netif_schedule(dev);
--		}
-+		/*}*/
- 	} else if (priv->oldlink) {
- 		netif_stop_queue(dev);
- 		new_state = 1;

+ 0 - 86
target/linux/ar7/patches-2.6.25/100-board_support.patch

@@ -1,86 +0,0 @@
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -18,6 +18,24 @@
- 	prompt "System type"
- 	default SGI_IP22
- 
-+config AR7
-+	bool "Texas Instruments AR7"
-+	select BOOT_ELF32
-+	select DMA_NONCOHERENT
-+	select CEVT_R4K
-+	select CSRC_R4K
-+	select IRQ_CPU
-+	select NO_EXCEPT_FILL
-+	select SWAP_IO_SPACE
-+	select SYS_HAS_CPU_MIPS32_R1
-+	select SYS_HAS_EARLY_PRINTK
-+	select SYS_SUPPORTS_32BIT_KERNEL
-+	select SYS_SUPPORTS_KGDB
-+	select SYS_SUPPORTS_LITTLE_ENDIAN
-+	select SYS_SUPPORTS_BIG_ENDIAN
-+	select GENERIC_GPIO
-+	select GENERIC_HARDIRQS_NO__DO_IRQ
-+
- config MACH_ALCHEMY
- 	bool "Alchemy processor based machines"
- 
---- a/arch/mips/kernel/traps.c
-+++ b/arch/mips/kernel/traps.c
-@@ -1112,9 +1112,22 @@
- 
- 	exception_handlers[n] = handler;
- 	if (n == 0 && cpu_has_divec) {
--		*(u32 *)(ebase + 0x200) = 0x08000000 |
--					  (0x03ffffff & (handler >> 2));
--		flush_icache_range(ebase + 0x200, ebase + 0x204);
-+		if ((handler ^ (ebase + 4)) & 0xfc000000) {
-+			/* lui k0, 0x0000 */
-+			*(u32 *)(ebase + 0x200) = 0x3c1a0000 | (handler >> 16);
-+			/* ori k0, 0x0000 */
-+			*(u32 *)(ebase + 0x204) =
-+					0x375a0000 | (handler & 0xffff);
-+			/* jr k0 */
-+			*(u32 *)(ebase + 0x208) = 0x03400008;
-+			/* nop */
-+			*(u32 *)(ebase + 0x20C) = 0x00000000;
-+			flush_icache_range(ebase + 0x200, ebase + 0x210);
-+		} else {
-+			*(u32 *)(ebase + 0x200) =
-+				0x08000000 | (0x03ffffff & (handler >> 2));
-+			flush_icache_range(ebase + 0x200, ebase + 0x204);
-+		}
- 	}
- 	return (void *)old_handler;
- }
---- a/arch/mips/Makefile
-+++ b/arch/mips/Makefile
-@@ -167,6 +167,13 @@
- #
- 
- #
-+# Texas Instruments AR7
-+#
-+core-$(CONFIG_AR7)		+= arch/mips/ar7/
-+cflags-$(CONFIG_AR7)		+= -Iinclude/asm-mips/ar7
-+load-$(CONFIG_AR7)		+= 0xffffffff94100000
-+
-+#
- # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
- #
- core-$(CONFIG_MACH_JAZZ)	+= arch/mips/jazz/
---- a/include/asm-mips/page.h
-+++ b/include/asm-mips/page.h
-@@ -182,8 +182,10 @@
- #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
- 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
- 
--#define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE)
--#define CAC_ADDR(addr)		((addr) - UNCAC_BASE + PAGE_OFFSET)
-+#define UNCAC_ADDR(addr)	((addr) - PAGE_OFFSET + UNCAC_BASE +	\
-+				 PHYS_OFFSET)
-+#define CAC_ADDR(addr)		((addr) - UNCAC_BASE + PAGE_OFFSET -	\
-+				 PHYS_OFFSET)
- 
- #include <asm-generic/memory_model.h>
- #include <asm-generic/page.h>

+ 0 - 37
target/linux/ar7/patches-2.6.25/110-flash.patch

@@ -1,37 +0,0 @@
---- a/drivers/mtd/Kconfig
-+++ b/drivers/mtd/Kconfig
-@@ -168,6 +168,12 @@
- 	  the partition map from the children of the flash node,
- 	  as described in Documentation/powerpc/booting-without-of.txt.
- 
-+config MTD_AR7_PARTS
-+	tristate "TI AR7 partitioning support"
-+	depends on MTD_PARTITIONS
-+	---help---
-+	  TI AR7 partitioning support
-+
- comment "User Modules And Translation Layers"
- 
- config MTD_CHAR
---- a/drivers/mtd/Makefile
-+++ b/drivers/mtd/Makefile
-@@ -12,6 +12,7 @@
- obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
- obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
- obj-$(CONFIG_MTD_OF_PARTS)      += ofpart.o
-+obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
- 
- # 'Users' - code which presents functionality to userspace.
- obj-$(CONFIG_MTD_CHAR)		+= mtdchar.o
---- a/drivers/mtd/maps/physmap.c
-+++ b/drivers/mtd/maps/physmap.c
-@@ -87,7 +87,8 @@
- 
- static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
- #ifdef CONFIG_MTD_PARTITIONS
--static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
-+static const char *part_probe_types[] = {"cmdlinepart", "RedBoot",
-+					"ar7part", NULL };
- #endif
- 
- static int physmap_flash_probe(struct platform_device *dev)

+ 0 - 28
target/linux/ar7/patches-2.6.25/120-gpio_chrdev.patch

@@ -1,28 +0,0 @@
---- a/drivers/char/Kconfig
-+++ b/drivers/char/Kconfig
-@@ -913,6 +913,15 @@
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called mwave.
- 
-+config AR7_GPIO
-+	tristate "TI AR7 GPIO Support"
-+	depends on AR7
-+	help
-+	  Give userspace access to the GPIO pins on the Texas Instruments AR7 
-+	  processors.
-+
-+	  If compiled as a module, it will be called ar7_gpio.
-+
- config SCx200_GPIO
- 	tristate "NatSemi SCx200 GPIO Support"
- 	depends on SCx200
---- a/drivers/char/Makefile
-+++ b/drivers/char/Makefile
-@@ -90,6 +90,7 @@
- obj-$(CONFIG_PPDEV)		+= ppdev.o
- obj-$(CONFIG_NWBUTTON)		+= nwbutton.o
- obj-$(CONFIG_NWFLASH)		+= nwflash.o
-+obj-$(CONFIG_AR7_GPIO)		+= ar7_gpio.o
- obj-$(CONFIG_SCx200_GPIO)	+= scx200_gpio.o
- obj-$(CONFIG_PC8736x_GPIO)	+= pc8736x_gpio.o
- obj-$(CONFIG_NSC_GPIO)		+= nsc_gpio.o

+ 0 - 18
target/linux/ar7/patches-2.6.25/130-vlynq.patch

@@ -1,18 +0,0 @@
---- a/drivers/Kconfig
-+++ b/drivers/Kconfig
-@@ -97,4 +97,6 @@
- source "drivers/auxdisplay/Kconfig"
- 
- source "drivers/uio/Kconfig"
-+
-+source "drivers/vlynq/Kconfig"
- endmenu
---- a/drivers/Makefile
-+++ b/drivers/Makefile
-@@ -91,5 +91,6 @@
- obj-$(CONFIG_HID)		+= hid/
- obj-$(CONFIG_PPC_PS3)		+= ps3/
- obj-$(CONFIG_OF)		+= of/
-+obj-$(CONFIG_VLYNQ)		+= vlynq/
- obj-$(CONFIG_SSB)		+= ssb/
- obj-$(CONFIG_VIRTIO)		+= virtio/

+ 0 - 167
target/linux/ar7/patches-2.6.25/140-cpmac_fix.patch

@@ -1,167 +0,0 @@
---- a/drivers/net/cpmac.c
-+++ b/drivers/net/cpmac.c
-@@ -38,6 +38,7 @@
- #include <linux/platform_device.h>
- #include <linux/dma-mapping.h>
- #include <asm/gpio.h>
-+#include <asm/atomic.h>
- 
- MODULE_AUTHOR("Eugene Konev <[email protected]>");
- MODULE_DESCRIPTION("TI AR7 ethernet driver (CPMAC)");
-@@ -207,6 +208,7 @@
- 	struct work_struct reset_work;
- 	struct platform_device *pdev;
- 	struct napi_struct napi;
-+	atomic_t reset_pending;
- };
- 
- static irqreturn_t cpmac_irq(int, void *);
-@@ -455,6 +457,9 @@
- 	struct cpmac_desc *desc;
- 	struct cpmac_priv *priv = netdev_priv(dev);
- 
-+	if (unlikely(atomic_read(&priv->reset_pending)))
-+		return NETDEV_TX_BUSY;
-+
- 	if (unlikely(skb_padto(skb, ETH_ZLEN)))
- 		return NETDEV_TX_OK;
- 
-@@ -634,14 +639,14 @@
- 		priv->desc_ring[i].dataflags = 0;
- 		if (priv->desc_ring[i].skb) {
- 			dev_kfree_skb_any(priv->desc_ring[i].skb);
--			if (netif_subqueue_stopped(dev, i))
--			    netif_wake_subqueue(dev, i);
-+			priv->desc_ring[i].skb = NULL;
- 		}
- 	}
- }
- 
- static void cpmac_hw_error(struct work_struct *work)
- {
-+	int i;
- 	struct cpmac_priv *priv =
- 		container_of(work, struct cpmac_priv, reset_work);
- 
-@@ -650,8 +655,47 @@
- 	spin_unlock(&priv->rx_lock);
- 	cpmac_clear_tx(priv->dev);
- 	cpmac_hw_start(priv->dev);
--	napi_enable(&priv->napi);
--	netif_start_queue(priv->dev);
-+	barrier();
-+	atomic_dec(&priv->reset_pending);
-+	
-+	for (i = 0; i < CPMAC_QUEUES; i++) {
-+		netif_wake_subqueue(priv->dev, i);
-+	}
-+	netif_wake_queue(priv->dev);
-+	cpmac_write(priv->regs, CPMAC_MAC_INT_ENABLE, 3);
-+}
-+
-+static void cpmac_check_status(struct net_device *dev)
-+{
-+	struct cpmac_priv *priv = netdev_priv(dev);
-+
-+	u32 macstatus = cpmac_read(priv->regs, CPMAC_MAC_STATUS);
-+	int rx_channel = (macstatus >> 8) & 7;
-+	int rx_code = (macstatus >> 12) & 15;
-+	int tx_channel = (macstatus >> 16) & 7;
-+	int tx_code = (macstatus >> 20) & 15;
-+
-+	if (rx_code || tx_code) {
-+		if (netif_msg_drv(priv) && net_ratelimit()) {
-+			/* Can't find any documentation on what these error codes actually are.
-+			 * So just log them and hope..
-+			 */
-+			if (rx_code)
-+				printk(KERN_WARNING "%s: host error %d on rx channel %d (macstatus %08x), resetting\n",
-+				       dev->name, rx_code, rx_channel, macstatus);
-+			if (tx_code)
-+				printk(KERN_WARNING "%s: host error %d on tx channel %d (macstatus %08x), resetting\n",
-+				       dev->name, tx_code, tx_channel, macstatus);
-+		}
-+		
-+		netif_stop_queue(dev);
-+		cpmac_hw_stop(dev);
-+		if (schedule_work(&priv->reset_work))
-+			atomic_inc(&priv->reset_pending);
-+		if (unlikely(netif_msg_hw(priv)))
-+			cpmac_dump_regs(dev);
-+	}
-+	cpmac_write(priv->regs, CPMAC_MAC_INT_CLEAR, 0xff);
- }
- 
- static irqreturn_t cpmac_irq(int irq, void *dev_id)
-@@ -682,49 +726,33 @@
- 
- 	cpmac_write(priv->regs, CPMAC_MAC_EOI_VECTOR, 0);
- 
--	if (unlikely(status & (MAC_INT_HOST | MAC_INT_STATUS))) {
--		if (netif_msg_drv(priv) && net_ratelimit())
--			printk(KERN_ERR "%s: hw error, resetting...\n",
--			       dev->name);
--		netif_stop_queue(dev);
--		napi_disable(&priv->napi);
--		cpmac_hw_stop(dev);
--		schedule_work(&priv->reset_work);
--		if (unlikely(netif_msg_hw(priv)))
--			cpmac_dump_regs(dev);
--	}
-+	if (unlikely(status & (MAC_INT_HOST | MAC_INT_STATUS)))
-+		cpmac_check_status(dev);
- 
- 	return IRQ_HANDLED;
- }
- 
- static void cpmac_tx_timeout(struct net_device *dev)
- {
--	struct cpmac_priv *priv = netdev_priv(dev);
- 	int i;
-+	struct cpmac_priv *priv = netdev_priv(dev);
- 
- 	spin_lock(&priv->lock);
- 	dev->stats.tx_errors++;
- 	spin_unlock(&priv->lock);
- 	if (netif_msg_tx_err(priv) && net_ratelimit())
- 		printk(KERN_WARNING "%s: transmit timeout\n", dev->name);
--	/* 
--	 * FIXME: waking up random queue is not the best thing to
--	 * do... on the other hand why we got here at all?
--	 */
--#ifdef CONFIG_NETDEVICES_MULTIQUEUE
--	for (i = 0; i < CPMAC_QUEUES; i++)
--		if (priv->desc_ring[i].skb) {
--			priv->desc_ring[i].dataflags = 0;
--			dev_kfree_skb_any(priv->desc_ring[i].skb);
--			netif_wake_subqueue(dev, i);
--			break;
--		}
--#else
--	priv->desc_ring[0].dataflags = 0;
--	if (priv->desc_ring[0].skb)
--		dev_kfree_skb_any(priv->desc_ring[0].skb);
--	netif_wake_queue(dev);
--#endif
-+
-+	atomic_inc(&priv->reset_pending);
-+	barrier();
-+	cpmac_clear_tx(dev);
-+	barrier();
-+	atomic_dec(&priv->reset_pending);
-+
-+	netif_wake_queue(priv->dev);
-+	for (i = 0; i < CPMAC_QUEUES; i++) {
-+		netif_wake_subqueue(dev, i);
-+	}
- }
- 
- static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-@@ -911,6 +939,7 @@
- 		goto fail_irq;
- 	}
- 
-+	atomic_set(&priv->reset_pending, 0);
- 	INIT_WORK(&priv->reset_work, cpmac_hw_error);
- 	cpmac_hw_start(dev);
- 

+ 0 - 11
target/linux/ar7/patches-2.6.25/150-cpmac_not_broken.patch

@@ -1,11 +0,0 @@
---- a/drivers/net/Kconfig
-+++ b/drivers/net/Kconfig
-@@ -1874,7 +1874,7 @@
- 
- config CPMAC
- 	tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)"
--	depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN
-+	depends on NET_ETHERNET && EXPERIMENTAL && AR7
- 	select PHYLIB
- 	help
- 	  TI AR7 CPMAC Ethernet support

+ 0 - 91
target/linux/ar7/patches-2.6.25/150-cpmac_up_and_running.diff

@@ -1,91 +0,0 @@
-From 0daaa095cefd9d7091a7ccce2ff89f1ff4feae7a Mon Sep 17 00:00:00 2001
-From: Anton Vorontsov <[email protected]>
-Date: Wed, 5 Mar 2008 14:52:26 +0300
-Subject: [PATCH] AR7/cpmac: convert to new fixed phy infrastructure, now for real
-
-This patch converts platform code to register fixed phys early.
-cpmac driver modified to blindly accept fixed phy id (that is equal
-to platform device id).
-
-Signed-off-by: Anton Vorontsov <[email protected]>
----
- arch/mips/ar7/platform.c |   17 +++++++++++++++++
- drivers/net/cpmac.c      |   19 +++----------------
- 2 files changed, 20 insertions(+), 16 deletions(-)
-
---- a/arch/mips/ar7/platform.c
-+++ b/arch/mips/ar7/platform.c
-@@ -33,6 +33,8 @@
- #include <linux/vlynq.h>
- #include <linux/leds.h>
- #include <linux/string.h>
-+#include <linux/phy.h>
-+#include <linux/phy_fixed.h>
- 
- #include <asm/addrspace.h>
- #include <asm/ar7/ar7.h>
-@@ -205,6 +207,13 @@
- 	.width = 2,
- };
- 
-+/* lets assume this is suitable for both high and low cpmacs links */
-+static struct fixed_phy_status fixed_phy_status __initdata = {
-+	.link = 1,
-+	.speed = 100,
-+	.duplex = 1,
-+};
-+
- static struct plat_cpmac_data cpmac_low_data = {
- 	.reset_bit = 17,
- 	.power_bit = 20,
-@@ -506,6 +515,10 @@
- 	}
- 
- 	if (ar7_has_high_cpmac()) {
-+		res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
-+		if (res && res != -ENODEV)
-+			return res;
-+
- 		cpmac_get_mac(1, cpmac_high_data.dev_addr);
- 		res = platform_device_register(&cpmac_high);
- 		if (res)
-@@ -514,6 +527,10 @@
- 		cpmac_low_data.phy_mask = 0xffffffff;
- 	}
- 
-+	res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
-+	if (res && res != -ENODEV)
-+		return res;
-+
- 	cpmac_get_mac(0, cpmac_low_data.dev_addr);
- 	res = platform_device_register(&cpmac_low);
- 	if (res)
---- a/drivers/net/cpmac.c
-+++ b/drivers/net/cpmac.c
-@@ -1035,23 +1035,10 @@
- 
- 	if (phy_id == PHY_MAX_ADDR) {
- 		if (external_switch || dumb_switch) {
--			struct fixed_phy_status status = {};
--
--			mdio_bus_id = 0;
--
--			/*
--			 * FIXME: this should be in the platform code!
--			 * Since there is not platform code at all (that is,
--			 * no mainline users of that driver), place it here
--			 * for now.
--			 */
--			phy_id = 0;
--			status.link = 1;
--			status.duplex = 1;
--			status.speed = 100;
--			fixed_phy_add(PHY_POLL, phy_id, &status);
-+			mdio_bus_id = 0; /* fixed phys bus */
-+			phy_id = pdev->id;
- 		} else {
--			printk(KERN_ERR "cpmac: no PHY present\n");
-+			dev_err(&pdev->dev, "no PHY present\n");
- 			return -ENODEV;
- 		}
- 	}

+ 0 - 178
target/linux/ar7/patches-2.6.25/160-cpmac-rx-ring-use-eoq.diff

@@ -1,178 +0,0 @@
---- a/drivers/net/cpmac.c
-+++ b/drivers/net/cpmac.c
-@@ -187,6 +187,7 @@
- #define CPMAC_EOQ			0x1000
- 	struct sk_buff *skb;
- 	struct cpmac_desc *next;
-+	struct cpmac_desc *prev;
- 	dma_addr_t mapping;
- 	dma_addr_t data_mapping;
- };
-@@ -242,6 +243,16 @@
- 	printk("\n");
- }
- 
-+static void cpmac_dump_all_desc(struct net_device *dev)
-+{
-+        struct cpmac_priv *priv = netdev_priv(dev);
-+        struct cpmac_desc *dump = priv->rx_head;
-+        do {
-+                cpmac_dump_desc(dev, dump);
-+                dump = dump->next;
-+        } while (dump != priv->rx_head);
-+}
-+
- static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
- {
- 	int i;
-@@ -413,21 +424,40 @@
- static int cpmac_poll(struct napi_struct *napi, int budget)
- {
- 	struct sk_buff *skb;
--	struct cpmac_desc *desc;
--	int received = 0;
-+	struct cpmac_desc *desc, *restart;
- 	struct cpmac_priv *priv = container_of(napi, struct cpmac_priv, napi);
-+	int received = 0, processed = 0;
- 
- 	spin_lock(&priv->rx_lock);
- 	if (unlikely(!priv->rx_head)) {
- 		if (netif_msg_rx_err(priv) && net_ratelimit())
- 			printk(KERN_WARNING "%s: rx: polling, but no queue\n",
- 			       priv->dev->name);
-+		spin_unlock(&priv->rx_lock);
- 		netif_rx_complete(priv->dev, napi);
- 		return 0;
- 	}
- 
- 	desc = priv->rx_head;
-+	restart = NULL;
- 	while (((desc->dataflags & CPMAC_OWN) == 0) && (received < budget)) {
-+		processed++;
-+		
-+		if ((desc->dataflags & CPMAC_EOQ) != 0) {
-+			/* The last update to eoq->hw_next didn't happen soon enough, and the
-+			* receiver stopped here. Remember this descriptor so we can restart
-+			* the receiver after freeing some space.
-+			*/
-+			if (unlikely(restart)) {
-+				if (netif_msg_rx_err(priv))
-+					printk(KERN_ERR "%s: poll found a duplicate EOQ: %p and %p\n",
-+						priv->dev->name, restart, desc);
-+				goto fatal_error;
-+			}
-+			
-+			restart = desc->next;
-+		}
-+
- 		skb = cpmac_rx_one(priv, desc);
- 		if (likely(skb)) {
- 			netif_receive_skb(skb);
-@@ -436,19 +466,81 @@
- 		desc = desc->next;
- 	}
- 
-+	if (desc != priv->rx_head) {
-+		/* We freed some buffers, but not the whole ring, add what we did free to the rx list */ 
-+		desc->prev->hw_next = (u32)0;
-+		priv->rx_head->prev->hw_next = priv->rx_head->mapping;
-+	}
-+
-+	/* Optimization: If we did not actually process an EOQ (perhaps because of 
-+	* quota limits), check to see if the tail of the queue has EOQ set. We
-+	* should immediately restart in that case so that the receiver can restart
-+	* and run in parallel with more packet processing. This lets us handle slightly
-+	* larger bursts before running out of ring space (assuming dev->weight < ring_size)
-+	*/
-+	if (!restart &&
-+	     (priv->rx_head->prev->dataflags & (CPMAC_OWN|CPMAC_EOQ)) == CPMAC_EOQ &&
-+	     (priv->rx_head->dataflags & CPMAC_OWN) != 0) {
-+		/* reset EOQ so the poll loop (above) doesn't try to restart this when it
-+		* eventually gets to this descriptor.
-+		*/
-+		priv->rx_head->prev->dataflags &= ~CPMAC_EOQ;
-+		restart = priv->rx_head;
-+	}
-+
-+	if (restart) {
-+		priv->dev->stats.rx_errors++;
-+		priv->dev->stats.rx_fifo_errors++;
-+		if (netif_msg_rx_err(priv) && net_ratelimit())
-+			printk(KERN_WARNING "%s: rx dma ring overrun\n", priv->dev->name);
-+
-+		if (unlikely((restart->dataflags & CPMAC_OWN) == 0)) {
-+			if (netif_msg_drv(priv))
-+				printk(KERN_ERR "%s: cpmac_poll is trying to restart rx from a descriptor that's not free: %p\n",
-+					priv->dev->name, restart);
-+				goto fatal_error;
-+		}
-+
-+		cpmac_write(priv->regs, CPMAC_RX_PTR(0), restart->mapping);
-+	}
-+
- 	priv->rx_head = desc;
- 	spin_unlock(&priv->rx_lock);
- 	if (unlikely(netif_msg_rx_status(priv)))
- 		printk(KERN_DEBUG "%s: poll processed %d packets\n",
- 		       priv->dev->name, received);
--	if (desc->dataflags & CPMAC_OWN) {
-+	if (processed == 0) {
-+		/* we ran out of packets to read, revert to interrupt-driven mode */ 
- 		netif_rx_complete(priv->dev, napi);
--		cpmac_write(priv->regs, CPMAC_RX_PTR(0), (u32)desc->mapping);
- 		cpmac_write(priv->regs, CPMAC_RX_INT_ENABLE, 1);
- 		return 0;
- 	}
- 
- 	return 1;
-+
-+fatal_error:
-+	/* Something went horribly wrong. Reset hardware to try to recover rather than wedging. */ 
-+	
-+	if (netif_msg_drv(priv)) {
-+		printk(KERN_ERR "%s: cpmac_poll is confused. Resetting hardware\n", priv->dev->name);
-+		cpmac_dump_all_desc(priv->dev);
-+		printk(KERN_DEBUG "%s: RX_PTR(0)=0x%08x RX_ACK(0)=0x%08x\n",
-+			priv->dev->name,
-+			cpmac_read(priv->regs, CPMAC_RX_PTR(0)),
-+			cpmac_read(priv->regs, CPMAC_RX_ACK(0)));
-+	}
-+
-+	spin_unlock(&priv->rx_lock);
-+	netif_rx_complete(priv->dev, napi);
-+	netif_stop_queue(priv->dev);
-+	napi_disable(&priv->napi);
-+	
-+	atomic_inc(&priv->reset_pending);
-+	cpmac_hw_stop(priv->dev);
-+	if (!schedule_work(&priv->reset_work))
-+		atomic_dec(&priv->reset_pending);
-+	return 0;
-+ 
- }
- 
- static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
-@@ -625,8 +717,10 @@
- 			desc->dataflags = CPMAC_OWN;
- 			dev->stats.rx_dropped++;
- 		}
-+		desc->hw_next = desc->next->mapping;
- 		desc = desc->next;
- 	}
-+	priv->rx_head->prev->hw_next = 0;
- }
- 
- static void cpmac_clear_tx(struct net_device *dev)
-@@ -928,9 +1022,12 @@
- 		desc->buflen = CPMAC_SKB_SIZE;
- 		desc->dataflags = CPMAC_OWN;
- 		desc->next = &priv->rx_head[(i + 1) % priv->ring_size];
-+		desc->next->prev = desc;
- 		desc->hw_next = (u32)desc->next->mapping;
- 	}
- 
-+	priv->rx_head->prev->hw_next = (u32)0;
-+
- 	if ((res = request_irq(dev->irq, cpmac_irq, IRQF_SHARED,
- 			       dev->name, dev))) {
- 		if (netif_msg_drv(priv))

+ 0 - 13
target/linux/ar7/patches-2.6.25/170-cpmac_eth_fix.patch

@@ -1,13 +0,0 @@
---- a/drivers/net/cpmac.c
-+++ b/drivers/net/cpmac.c
-@@ -1178,9 +1178,7 @@
- 	priv->msg_enable = netif_msg_init(debug_level, 0xff);
- 	memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
- 
--	snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
--
--	priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
-+	priv->phy = phy_connect(dev, cpmac_mii.phy_map[phy_id]->dev.bus_id, &cpmac_adjust_link, 0,
- 				PHY_INTERFACE_MODE_MII);
- 	if (IS_ERR(priv->phy)) {
- 		if (netif_msg_drv(priv))

+ 0 - 54
target/linux/ar7/patches-2.6.25/200-mtd_fixes.patch

@@ -1,54 +0,0 @@
---- a/drivers/mtd/ar7part.c
-+++ b/drivers/mtd/ar7part.c
-@@ -34,6 +34,10 @@
- #define LOADER_MAGIC1	le32_to_cpu(0xfeedfa42)
- #define LOADER_MAGIC2	le32_to_cpu(0xfeed1281)
- 
-+#ifndef SQUASHFS_MAGIC
-+#define SQUASHFS_MAGIC	0x73717368
-+#endif
-+
- struct ar7_bin_rec {
- 	unsigned int checksum;
- 	unsigned int length;
-@@ -47,7 +51,8 @@
- 				 unsigned long origin)
- {
- 	struct ar7_bin_rec header;
--	unsigned int offset, len;
-+	unsigned int offset;
-+	size_t len;
- 	unsigned int pre_size = master->erasesize, post_size = 0;
- 	unsigned int root_offset = ROOT_OFFSET;
- 
-@@ -66,7 +71,7 @@
- 	do { /* Try 10 blocks starting from master->erasesize */
- 		offset = pre_size;
- 		master->read(master, offset,
--			sizeof(header), &len, (u8 *)&header);
-+			     sizeof(header), &len, (uint8_t *)&header);
- 		if (!strncmp((char *)&header, "TIENV0.8", 8))
- 			ar7_parts[1].offset = pre_size;
- 		if (header.checksum == LOADER_MAGIC1)
-@@ -88,7 +93,7 @@
- 		while (header.length) {
- 			offset += sizeof(header) + header.length;
- 			master->read(master, offset, sizeof(header),
--				     &len, (u8 *)&header);
-+				     &len, (uint8_t *)&header);
- 		}
- 		root_offset = offset + sizeof(header) + 4;
- 		break;
-@@ -96,10 +101,10 @@
- 		while (header.length) {
- 			offset += sizeof(header) + header.length;
- 			master->read(master, offset, sizeof(header),
--				     &len, (u8 *)&header);
-+				     &len, (uint8_t *)&header);
- 		}
- 		root_offset = offset + sizeof(header) + 4 + 0xff;
--		root_offset &= ~(u32)0xff;
-+		root_offset &= ~(uint32_t)0xff;
- 		break;
- 	default:
- 		printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum);

+ 0 - 40
target/linux/ar7/patches-2.6.25/500-serial_kludge.patch

@@ -1,40 +0,0 @@
---- a/drivers/serial/8250.c
-+++ b/drivers/serial/8250.c
-@@ -267,6 +267,13 @@
- 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
- 		.flags		= UART_CAP_FIFO,
- 	},
-+	[PORT_AR7] = {
-+		.name		= "TI-AR7",
-+		.fifo_size	= 16,
-+		.tx_loadsz	= 16,
-+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
-+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
-+	},
- };
- 
- #if defined (CONFIG_SERIAL_8250_AU1X00)
-@@ -2457,7 +2464,11 @@
- {
- 	struct uart_8250_port *up = (struct uart_8250_port *)port;
- 
-+#ifdef CONFIG_AR7
-+	wait_for_xmitr(up, BOTH_EMPTY);
-+#else
- 	wait_for_xmitr(up, UART_LSR_THRE);
-+#endif
- 	serial_out(up, UART_TX, ch);
- }
- 
---- a/include/linux/serial_core.h
-+++ b/include/linux/serial_core.h
-@@ -40,7 +40,8 @@
- #define PORT_NS16550A	14
- #define PORT_XSCALE	15
- #define PORT_RM9000	16	/* PMC-Sierra RM9xxx internal UART */
--#define PORT_MAX_8250	16	/* max port ID */
-+#define PORT_AR7	17
-+#define PORT_MAX_8250	17	/* max port ID */
- 
- /*
-  * ARM specific type numbers.  These are not currently guaranteed

+ 0 - 27
target/linux/ar7/patches-2.6.25/900-temporary_cpmac_hack.diff

@@ -1,27 +0,0 @@
---- a/drivers/net/cpmac.c
-+++ b/drivers/net/cpmac.c
-@@ -936,7 +936,8 @@
- 	int new_state = 0;
- 
- 	spin_lock(&priv->lock);
--	if (priv->phy->link) {
-+	if (1 /* priv->phy->link */) {
-+		netif_carrier_on(dev);
- 		netif_start_queue(dev);
- 		if (priv->phy->duplex != priv->oldduplex) {
- 			new_state = 1;
-@@ -948,11 +949,11 @@
- 			priv->oldspeed = priv->phy->speed;
- 		}
- 
--		if (!priv->oldlink) {
-+		/*if (!priv->oldlink) {
- 			new_state = 1;
--			priv->oldlink = 1;
-+			priv->oldlink = 1;*/
- 			netif_schedule(dev);
--		}
-+		/*}*/
- 	} else if (priv->oldlink) {
- 		netif_stop_queue(dev);
- 		new_state = 1;

+ 0 - 299
target/linux/at91/config-2.6.21

@@ -1,299 +0,0 @@
-# CONFIG_AEABI is not set
-CONFIG_ALIGNMENT_TRAP=y
-# CONFIG_ARCH_AAEC2000 is not set
-CONFIG_ARCH_AT91=y
-CONFIG_ARCH_AT91RM9200=y
-# CONFIG_ARCH_AT91RM9200DK is not set
-# CONFIG_ARCH_AT91SAM9260 is not set
-# CONFIG_ARCH_AT91SAM9261 is not set
-# CONFIG_ARCH_AT91SAM9263 is not set
-# CONFIG_ARCH_AT91SAM9RL is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_IOP13XX is not set
-# CONFIG_ARCH_IOP32X is not set
-# CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IXP2000 is not set
-# CONFIG_ARCH_IXP23XX is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_L7200 is not set
-# CONFIG_ARCH_LH7A40X is not set
-# CONFIG_ARCH_NETX is not set
-# CONFIG_ARCH_NS9XXX is not set
-# CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_PNX4008 is not set
-# CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_RPC is not set
-# CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_SHARK is not set
-# CONFIG_ARCH_VERSATILE is not set
-CONFIG_ARM=y
-CONFIG_ARM_AT91_ETHER=y
-CONFIG_ARM_THUMB=y
-# CONFIG_ARPD is not set
-# CONFIG_ARTHUR is not set
-# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
-CONFIG_AT91_SPI=y
-# CONFIG_AT91_SPIDEV is not set
-CONFIG_AT91_VLIO=y
-# CONFIG_ATMEL_TCLIB is not set
-# CONFIG_ATM_DUMMY is not set
-# CONFIG_ATM_TCP is not set
-CONFIG_BASE_SMALL=0
-# CONFIG_BINFMT_AOUT is not set
-CONFIG_BITREVERSE=y
-# CONFIG_BLK_DEV_LOOP is not set
-# CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=4096
-# CONFIG_BONDING is not set
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_BT is not set
-# CONFIG_CIFS_STATS is not set
-# CONFIG_CLS_U32_MARK is not set
-# CONFIG_CLS_U32_PERF is not set
-# CONFIG_CONFIGFS_FS is not set
-CONFIG_CPU_32=y
-CONFIG_CPU_32v4T=y
-CONFIG_CPU_ABRT_EV4T=y
-CONFIG_CPU_ARM920T=y
-CONFIG_CPU_CACHE_V4WT=y
-CONFIG_CPU_CACHE_VIVT=y
-CONFIG_CPU_COPY_V4WB=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-# CONFIG_CPU_ICACHE_DISABLE is not set
-CONFIG_CPU_TLB_V4WBI=y
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_BLKCIPHER is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-# CONFIG_CRYPTO_CBC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_DES is not set
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_HMAC=y
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_MD4 is not set
-# CONFIG_CRYPTO_MD5 is not set
-# CONFIG_CRYPTO_NULL is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_WP512 is not set
-CONFIG_DAVICOM_PHY=y
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_DEBUG_USER is not set
-# CONFIG_DM9000 is not set
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_FIXED_PHY is not set
-# CONFIG_FPE_FASTFPE is not set
-CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_NWFPE_XP is not set
-CONFIG_FRAME_POINTER=y
-CONFIG_FS_POSIX_ACL=y
-# CONFIG_FW_LOADER is not set
-CONFIG_GENERIC_GPIO=y
-# CONFIG_GENERIC_TIME is not set
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HID=y
-CONFIG_HW_CONSOLE=y
-# CONFIG_HW_RANDOM is not set
-# CONFIG_I2C is not set
-# CONFIG_IEEE80211 is not set
-# CONFIG_IKCONFIG is not set
-# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_INPUT=y
-# CONFIG_INPUT_EVDEV is not set
-CONFIG_INPUT_MOUSEDEV=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_IP6_NF_MATCH_FRAG is not set
-# CONFIG_IP6_NF_MATCH_HL is not set
-# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
-# CONFIG_IP6_NF_MATCH_OPTS is not set
-# CONFIG_IP6_NF_MATCH_RT is not set
-# CONFIG_IP6_NF_RAW is not set
-# CONFIG_IP6_NF_TARGET_HL is not set
-# CONFIG_IP6_NF_TARGET_LOG is not set
-# CONFIG_IP_DCCP is not set
-# CONFIG_IP_NF_ARPTABLES is not set
-# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
-# CONFIG_IP_NF_TARGET_LOG is not set
-# CONFIG_IP_NF_TARGET_NETMAP is not set
-# CONFIG_IP_NF_TARGET_SAME is not set
-# CONFIG_IP_ROUTE_VERBOSE is not set
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_LEDS_TIMER=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=32
-# CONFIG_LIBCRC32C is not set
-# CONFIG_LLC2 is not set
-# CONFIG_MACH_AT91RM9200EK is not set
-# CONFIG_MACH_ATEB9200 is not set
-# CONFIG_MACH_CARMEVA is not set
-# CONFIG_MACH_CHUB is not set
-# CONFIG_MACH_CSB337 is not set
-# CONFIG_MACH_CSB637 is not set
-# CONFIG_MACH_KAFA is not set
-# CONFIG_MACH_KB9200 is not set
-# CONFIG_MACH_ONEARM is not set
-CONFIG_MACH_VLINK=y
-# CONFIG_MMC is not set
-# CONFIG_MMC_AT91 is not set
-# CONFIG_MMC_BLOCK is not set
-# CONFIG_MMC_DEBUG is not set
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_AFS_PARTS is not set
-CONFIG_MTD_AT91_DATAFLASH=y
-CONFIG_MTD_AT91_PARTS=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_MTD_BLOCK2MTD is not set
-# CONFIG_MTD_CFI is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_CMDLINE_PARTS=y
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ROOTFS_ROOT_DEV is not set
-# CONFIG_MTD_ROOTFS_SPLIT is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_NET_EMATCH is not set
-# CONFIG_NET_IPGRE_BROADCAST is not set
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_NET_RADIO is not set
-CONFIG_NET_SCH_FIFO=y
-# CONFIG_NET_SCH_NETEM is not set
-# CONFIG_NEW_LEDS is not set
-# CONFIG_NO_IDLE_HZ is not set
-# CONFIG_NO_IOPORT is not set
-# CONFIG_NVRAM is not set
-# CONFIG_OUTER_CACHE is not set
-CONFIG_PHYLIB=y
-# CONFIG_PNPACPI is not set
-# CONFIG_PPPOATM is not set
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_SYNC_TTY is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_RTC_LIB=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SERIAL_8250 is not set
-CONFIG_SERIAL_ATMEL=y
-CONFIG_SERIAL_ATMEL_CONSOLE=y
-# CONFIG_SERIAL_ATMEL_TTYAT is not set
-CONFIG_SERIO=y
-# CONFIG_SERIO_LIBPS2 is not set
-CONFIG_SERIO_RAW=y
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SMC91X is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_SOUND is not set
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_UID16=y
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_USB_ARCH_HAS_EHCI is not set
-# CONFIG_USB_ATM is not set
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_GTCO is not set
-# CONFIG_USB_KAWETH is not set
-CONFIG_USB_MON=y
-# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
-# CONFIG_USB_OHCI_HCD is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_PRINTER is not set
-# CONFIG_USB_SERIAL_EDGEPORT is not set
-# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
-# CONFIG_USB_SERIAL_FUNSOFT is not set
-# CONFIG_USB_SERIAL_GARMIN is not set
-# CONFIG_USB_SERIAL_IPAQ is not set
-# CONFIG_USB_SERIAL_IPW is not set
-# CONFIG_USB_SERIAL_IR is not set
-# CONFIG_USB_SERIAL_KEYSPAN is not set
-# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
-# CONFIG_USB_SERIAL_KLSI is not set
-# CONFIG_USB_SERIAL_KOBIL_SCT is not set
-# CONFIG_USB_SERIAL_MCT_U232 is not set
-# CONFIG_USB_SERIAL_OMNINET is not set
-# CONFIG_USB_SERIAL_SAFE is not set
-# CONFIG_USB_SERIAL_VISOR is not set
-# CONFIG_USB_STORAGE_ALAUDA is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_KARMA is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_USBAT is not set
-# CONFIG_USB_USBNET is not set
-# CONFIG_USB_USBNET_MII is not set
-# CONFIG_USB_YEALINK is not set
-CONFIG_VECTORS_BASE=0xffff0000
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-# CONFIG_VT_HW_CONSOLE_BINDING is not set
-# CONFIG_WATCHDOG is not set
-# CONFIG_XIP_KERNEL is not set
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_ZBOOT_ROM_TEXT=0x0

+ 0 - 10403
target/linux/at91/patches-2.6.21/000-at91patches.patch

@@ -1,10403 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/boot/compressed/head-at91rm9200.S
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/boot/compressed/head-at91rm9200.S
-+++ linux-2.6.21.7/arch/arm/boot/compressed/head-at91rm9200.S
-@@ -67,6 +67,12 @@
- 		cmp	r7, r3
- 		beq	99f
- 
-+		@ Promwad Chub : 1181
-+		mov	r3,	#(MACH_TYPE_CHUB & 0xff)
-+		orr	r3, r3, #(MACH_TYPE_CHUB & 0xff00)
-+		cmp	r7, r3
-+		beq	99f
-+
- 		@ Unknown board, use the AT91RM9200DK board
- 		@ mov	r7, #MACH_TYPE_AT91RM9200
- 		mov	r7,	#(MACH_TYPE_AT91RM9200DK & 0xff)
-Index: linux-2.6.21.7/arch/arm/mach-at91/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/Kconfig
-+++ linux-2.6.21.7/arch/arm/mach-at91/Kconfig
-@@ -17,6 +17,9 @@ config ARCH_AT91SAM9261
- config ARCH_AT91SAM9263
- 	bool "AT91SAM9263"
- 
-+config ARCH_AT91SAM9RL
-+	bool "AT91SAM9RL"
-+
- endchoice
- 
- # ----------------------------------------------------------
-@@ -87,6 +90,12 @@ config MACH_KAFA
- 	help
- 	  Select this if you are using Sperry-Sun's KAFA board.
- 
-+config MACH_CHUB
-+	bool "Promwad Chub board"
-+	depends on ARCH_AT91RM9200
-+	help
-+	  Select this if you are using Promwad's Chub board.
-+
- endif
- 
- # ----------------------------------------------------------
-@@ -111,6 +120,13 @@ config MACH_AT91SAM9260EK
- 	  Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
- 	  <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
- 
-+config MACH_CAM60
-+	bool "KwikByte CAM60 board"
-+	depends on ARCH_AT91SAM9260
-+	help
-+	  Select this if you are using KwikByte's CAM60 board based on the Atmel AT91SAM9260.
-+	  <http://www.kwikbyte.com>
-+
- endif
- 
- # ----------------------------------------------------------
-@@ -145,6 +161,20 @@ endif
- 
- # ----------------------------------------------------------
- 
-+if ARCH_AT91SAM9RL
-+
-+comment "AT91SAM9RL Board Type"
-+
-+config MACH_AT91SAM9RLEK
-+	bool "Atmel AT91SAM9RL-EK Evaluation Kit"
-+	depends on ARCH_AT91SAM9RL
-+	help
-+	  Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit.
-+
-+endif
-+
-+# ----------------------------------------------------------
-+
- comment "AT91 Board Options"
- 
- config MTD_AT91_DATAFLASH_CARD
-@@ -160,6 +190,20 @@ config MTD_NAND_AT91_BUSWIDTH_16
- 	  On AT91SAM926x boards both types of NAND flash can be present
- 	  (8 and 16 bit data bus width).
- 
-+config CSB300_WAKE_SW0
-+	bool "CSB300 SW0 irq0 wakeup"
-+	depends on MACH_CSB337 && PM
-+	help
-+	  If you have a CSB300 connected to your CSB337, this lets
-+	  SW0 serve as a wakeup button.  It uses IRQ0.
-+
-+config CSB300_WAKE_SW1
-+	bool "CSB300 SW1 gpio wakeup"
-+	depends on MACH_CSB337 && PM
-+	help
-+	  If you have a CSB300 connected to your CSB337, this lets
-+	  SW1 serve as a wakeup button.  It uses GPIO.
-+
- # ----------------------------------------------------------
- 
- comment "AT91 Feature Selections"
-@@ -170,6 +214,20 @@ config AT91_PROGRAMMABLE_CLOCKS
- 	  Select this if you need to program one or more of the PCK0..PCK3
- 	  programmable clock outputs.
- 
-+config ATMEL_TCLIB
-+	bool "Timer/Counter Library"
-+	help
-+	  Select this if you want a library to allocate the Timer/Counter
-+	  blocks found on many Atmel processors.  This facilitates using
-+	  these modules despite processor differences.
-+
-+config AT91_SLOW_CLOCK
-+	bool "Suspend-to-RAM uses slow clock mode (EXPERIMENTAL)"
-+	depends on PM && EXPERIMENTAL
-+	help
-+	  Select this if you wish to put the CPU into slow clock mode
-+	  while in the "Suspend to RAM" state, to save more power.
-+
- endmenu
- 
- endif
-Index: linux-2.6.21.7/arch/arm/mach-at91/Makefile
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/Makefile
-+++ linux-2.6.21.7/arch/arm/mach-at91/Makefile
-@@ -8,12 +8,15 @@ obj-n		:=
- obj-		:=
- 
- obj-$(CONFIG_PM)		+= pm.o
-+obj-$(CONFIG_AT91_SLOW_CLOCK)	+= pm_slowclock.o
-+obj-$(CONFIG_ATMEL_TCLIB)	+= tclib.o
- 
- # CPU-specific support
- obj-$(CONFIG_ARCH_AT91RM9200)	+= at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
- obj-$(CONFIG_ARCH_AT91SAM9260)	+= at91sam9260.o at91sam926x_time.o at91sam9260_devices.o
- obj-$(CONFIG_ARCH_AT91SAM9261)	+= at91sam9261.o at91sam926x_time.o at91sam9261_devices.o
- obj-$(CONFIG_ARCH_AT91SAM9263)	+= at91sam9263.o at91sam926x_time.o at91sam9263_devices.o
-+obj-$(CONFIG_ARCH_AT91SAM9RL)	+= at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o
- 
- # AT91RM9200 board-specific support
- obj-$(CONFIG_MACH_ONEARM)	+= board-1arm.o
-@@ -25,9 +28,11 @@ obj-$(CONFIG_MACH_CARMEVA)	+= board-carm
- obj-$(CONFIG_MACH_KB9200)	+= board-kb9202.o
- obj-$(CONFIG_MACH_ATEB9200)	+= board-eb9200.o
- obj-$(CONFIG_MACH_KAFA)		+= board-kafa.o
-+obj-$(CONFIG_MACH_CHUB)		+= board-chub.o
- 
- # AT91SAM9260 board-specific support
- obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
-+obj-$(CONFIG_MACH_CAM60)	+= board-cam60.o
- 
- # AT91SAM9261 board-specific support
- obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
-@@ -35,9 +40,13 @@ obj-$(CONFIG_MACH_AT91SAM9261EK) += boar
- # AT91SAM9263 board-specific support
- obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
- 
-+# AT91SAM9RL board-specific support
-+obj-$(CONFIG_MACH_AT91SAM9RLEK)	+= board-sam9rlek.o
-+
- # LEDs support
- led-$(CONFIG_ARCH_AT91RM9200DK)	+= leds.o
- led-$(CONFIG_MACH_AT91RM9200EK)	+= leds.o
-+led-$(CONFIG_MACH_AT91SAM9261EK)+= leds.o
- led-$(CONFIG_MACH_CSB337)	+= leds.o
- led-$(CONFIG_MACH_CSB637)	+= leds.o
- led-$(CONFIG_MACH_KB9200)	+= leds.o
-@@ -45,7 +54,7 @@ led-$(CONFIG_MACH_KAFA)		+= leds.o
- obj-$(CONFIG_LEDS) += $(led-y)
- 
- # VGA support
--#obj-$(CONFIG_FB_S1D13XXX)	+= ics1523.o
-+obj-$(CONFIG_FB_S1D13XXX)	+= ics1523.o
- 
- 
- ifeq ($(CONFIG_PM_DEBUG),y)
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91rm9200.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91rm9200.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91rm9200.c
-@@ -117,6 +117,21 @@ static struct clk pioD_clk = {
- 	.pmc_mask	= 1 << AT91RM9200_ID_PIOD,
- 	.type		= CLK_TYPE_PERIPHERAL,
- };
-+static struct clk ssc0_clk = {
-+	.name		= "ssc0_clk",
-+	.pmc_mask	= 1 << AT91RM9200_ID_SSC0,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ssc1_clk = {
-+	.name		= "ssc1_clk",
-+	.pmc_mask	= 1 << AT91RM9200_ID_SSC1,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ssc2_clk = {
-+	.name		= "ssc2_clk",
-+	.pmc_mask	= 1 << AT91RM9200_ID_SSC2,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
- static struct clk tc0_clk = {
- 	.name		= "tc0_clk",
- 	.pmc_mask	= 1 << AT91RM9200_ID_TC0,
-@@ -161,7 +176,9 @@ static struct clk *periph_clocks[] __ini
- 	&udc_clk,
- 	&twi_clk,
- 	&spi_clk,
--	// ssc 0 .. ssc2
-+	&ssc0_clk,
-+	&ssc1_clk,
-+	&ssc2_clk,
- 	&tc0_clk,
- 	&tc1_clk,
- 	&tc2_clk,
-@@ -250,6 +267,33 @@ static void at91rm9200_reset(void)
- 
- 
- /* --------------------------------------------------------------------
-+ *  Timer/Counter library initialization
-+ * -------------------------------------------------------------------- */
-+#ifdef CONFIG_ATMEL_TCLIB
-+
-+#include "tclib.h"
-+
-+static struct atmel_tcblock at91rm9200_tcblocks[] = {
-+	[0] = {
-+		.physaddr	= AT91RM9200_BASE_TCB0,
-+		.irq		= { AT91RM9200_ID_TC0, AT91RM9200_ID_TC1, AT91RM9200_ID_TC2 },
-+		.clk		= { &tc0_clk, &tc1_clk, &tc2_clk },
-+	},
-+	[1] = {
-+		.physaddr	= AT91RM9200_BASE_TCB1,
-+		.irq		= { AT91RM9200_ID_TC3, AT91RM9200_ID_TC4, AT91RM9200_ID_TC5 },
-+		.clk		= { &tc3_clk, &tc4_clk, &tc5_clk },
-+	},
-+};
-+
-+#define at91rm9200_tc_init()	atmel_tc_init(at91rm9200_tcblocks, ARRAY_SIZE(at91rm9200_tcblocks))
-+
-+#else
-+#define at91rm9200_tc_init()	do {} while(0)
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-  *  AT91RM9200 processor initialization
-  * -------------------------------------------------------------------- */
- void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks)
-@@ -271,6 +315,9 @@ void __init at91rm9200_initialize(unsign
- 
- 	/* Initialize GPIO subsystem */
- 	at91_gpio_init(at91rm9200_gpio, banks);
-+
-+	/* Initialize the Timer/Counter blocks */
-+	at91rm9200_tc_init();
- }
- 
- 
-@@ -284,28 +331,28 @@ void __init at91rm9200_initialize(unsign
- static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
- 	7,	/* Advanced Interrupt Controller (FIQ) */
- 	7,	/* System Peripherals */
--	0,	/* Parallel IO Controller A */
--	0,	/* Parallel IO Controller B */
--	0,	/* Parallel IO Controller C */
--	0,	/* Parallel IO Controller D */
--	6,	/* USART 0 */
--	6,	/* USART 1 */
--	6,	/* USART 2 */
--	6,	/* USART 3 */
-+	1,	/* Parallel IO Controller A */
-+	1,	/* Parallel IO Controller B */
-+	1,	/* Parallel IO Controller C */
-+	1,	/* Parallel IO Controller D */
-+	5,	/* USART 0 */
-+	5,	/* USART 1 */
-+	5,	/* USART 2 */
-+	5,	/* USART 3 */
- 	0,	/* Multimedia Card Interface */
--	4,	/* USB Device Port */
--	0,	/* Two-Wire Interface */
--	6,	/* Serial Peripheral Interface */
--	5,	/* Serial Synchronous Controller 0 */
--	5,	/* Serial Synchronous Controller 1 */
--	5,	/* Serial Synchronous Controller 2 */
-+	2,	/* USB Device Port */
-+	6,	/* Two-Wire Interface */
-+	5,	/* Serial Peripheral Interface */
-+	4,	/* Serial Synchronous Controller 0 */
-+	4,	/* Serial Synchronous Controller 1 */
-+	4,	/* Serial Synchronous Controller 2 */
- 	0,	/* Timer Counter 0 */
- 	0,	/* Timer Counter 1 */
- 	0,	/* Timer Counter 2 */
- 	0,	/* Timer Counter 3 */
- 	0,	/* Timer Counter 4 */
- 	0,	/* Timer Counter 5 */
--	3,	/* USB Host port */
-+	2,	/* USB Host port */
- 	3,	/* Ethernet MAC */
- 	0,	/* Advanced Interrupt Controller (IRQ0) */
- 	0,	/* Advanced Interrupt Controller (IRQ1) */
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91rm9200_devices.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
-@@ -480,7 +480,18 @@ void __init at91_add_device_i2c(void) {}
-  *  SPI
-  * -------------------------------------------------------------------- */
- 
--#if defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) || defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE)
-+#if defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE)		/* legacy SPI driver */
-+#define SPI_DEVNAME	"at91_spi"
-+
-+#elif defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE)	/* SPI bitbanging driver */
-+#define SPI_DEVNAME	"at91_spi"
-+
-+#elif defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)	/* new SPI driver */
-+#define SPI_DEVNAME	"atmel_spi"
-+
-+#endif
-+
-+#ifdef SPI_DEVNAME
- static u64 spi_dmamask = 0xffffffffUL;
- 
- static struct resource spi_resources[] = {
-@@ -497,7 +508,7 @@ static struct resource spi_resources[] =
- };
- 
- static struct platform_device at91rm9200_spi_device = {
--	.name		= "at91_spi",
-+	.name		= SPI_DEVNAME,
- 	.id		= 0,
- 	.dev		= {
- 				.dma_mask		= &spi_dmamask,
-@@ -606,6 +617,32 @@ void __init at91_init_leds(u8 cpu_led, u
- #endif
- 
- 
-+#if defined(CONFIG_NEW_LEDS)
-+
-+static struct platform_device at91_leds = {
-+	.name		= "at91_leds",
-+	.id		= -1,
-+};
-+
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
-+{
-+	if (!nr)
-+		return;
-+
-+	at91_leds.dev.platform_data = leds;
-+
-+	for ( ; nr; nr--, leds++) {
-+		leds->index = nr;	/* first record stores number of leds */
-+		at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
-+	}
-+
-+	platform_device_register(&at91_leds);
-+}
-+#else
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
-+#endif
-+
-+
- /* --------------------------------------------------------------------
-  *  UART
-  * -------------------------------------------------------------------- */
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9260.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91sam9260.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9260.c
-@@ -119,6 +119,11 @@ static struct clk spi1_clk = {
- 	.pmc_mask	= 1 << AT91SAM9260_ID_SPI1,
- 	.type		= CLK_TYPE_PERIPHERAL,
- };
-+static struct clk ssc_clk = {
-+	.name		= "ssc_clk",
-+	.pmc_mask	= 1 << AT91SAM9260_ID_SSC,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
- static struct clk tc0_clk = {
- 	.name		= "tc0_clk",
- 	.pmc_mask	= 1 << AT91SAM9260_ID_TC0,
-@@ -193,7 +198,7 @@ static struct clk *periph_clocks[] __ini
- 	&twi_clk,
- 	&spi0_clk,
- 	&spi1_clk,
--	// ssc
-+	&ssc_clk,
- 	&tc0_clk,
- 	&tc1_clk,
- 	&tc2_clk,
-@@ -264,6 +269,33 @@ static void at91sam9260_reset(void)
- 
- 
- /* --------------------------------------------------------------------
-+ *  Timer/Counter library initialization
-+ * -------------------------------------------------------------------- */
-+#ifdef CONFIG_ATMEL_TCLIB
-+
-+#include "tclib.h"
-+
-+static struct atmel_tcblock at91sam9260_tcblocks[] = {
-+	[0] = {
-+		.physaddr	= AT91SAM9260_BASE_TCB0,
-+		.irq		= { AT91SAM9260_ID_TC0, AT91SAM9260_ID_TC1, AT91SAM9260_ID_TC2 },
-+		.clk		= { &tc0_clk, &tc1_clk, &tc2_clk },
-+	},
-+	[1] = {
-+		.physaddr	= AT91SAM9260_BASE_TCB1,
-+		.irq		= { AT91SAM9260_ID_TC3, AT91SAM9260_ID_TC4, AT91SAM9260_ID_TC5 },
-+		.clk		= { &tc3_clk, &tc4_clk, &tc5_clk },
-+	},
-+};
-+
-+#define at91sam9260_tc_init()	atmel_tc_init(at91sam9260_tcblocks, ARRAY_SIZE(at91sam9260_tcblocks))
-+
-+#else
-+#define at91sam9260_tc_init()	do {} while(0)
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-  *  AT91SAM9260 processor initialization
-  * -------------------------------------------------------------------- */
- 
-@@ -310,6 +342,9 @@ void __init at91sam9260_initialize(unsig
- 
- 	/* Register GPIO subsystem */
- 	at91_gpio_init(at91sam9260_gpio, 3);
-+
-+	/* Initialize the Timer/Counter blocks */
-+	at91sam9260_tc_init();
- }
- 
- /* --------------------------------------------------------------------
-@@ -322,30 +357,30 @@ void __init at91sam9260_initialize(unsig
- static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = {
- 	7,	/* Advanced Interrupt Controller */
- 	7,	/* System Peripherals */
--	0,	/* Parallel IO Controller A */
--	0,	/* Parallel IO Controller B */
--	0,	/* Parallel IO Controller C */
-+	1,	/* Parallel IO Controller A */
-+	1,	/* Parallel IO Controller B */
-+	1,	/* Parallel IO Controller C */
- 	0,	/* Analog-to-Digital Converter */
--	6,	/* USART 0 */
--	6,	/* USART 1 */
--	6,	/* USART 2 */
-+	5,	/* USART 0 */
-+	5,	/* USART 1 */
-+	5,	/* USART 2 */
- 	0,	/* Multimedia Card Interface */
--	4,	/* USB Device Port */
--	0,	/* Two-Wire Interface */
--	6,	/* Serial Peripheral Interface 0 */
--	6,	/* Serial Peripheral Interface 1 */
-+	2,	/* USB Device Port */
-+	6,	/* Two-Wire Interface */
-+	5,	/* Serial Peripheral Interface 0 */
-+	5,	/* Serial Peripheral Interface 1 */
- 	5,	/* Serial Synchronous Controller */
- 	0,
- 	0,
- 	0,	/* Timer Counter 0 */
- 	0,	/* Timer Counter 1 */
- 	0,	/* Timer Counter 2 */
--	3,	/* USB Host port */
-+	2,	/* USB Host port */
- 	3,	/* Ethernet */
- 	0,	/* Image Sensor Interface */
--	6,	/* USART 3 */
--	6,	/* USART 4 */
--	6,	/* USART 5 */
-+	5,	/* USART 3 */
-+	5,	/* USART 4 */
-+	5,	/* USART 5 */
- 	0,	/* Timer Counter 3 */
- 	0,	/* Timer Counter 4 */
- 	0,	/* Timer Counter 5 */
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9260_devices.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91sam9260_devices.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9260_devices.c
-@@ -527,6 +527,32 @@ void __init at91_init_leds(u8 cpu_led, u
- #endif
- 
- 
-+#if defined(CONFIG_NEW_LEDS)
-+
-+static struct platform_device at91_leds = {
-+	.name		= "at91_leds",
-+	.id		= -1,
-+};
-+
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
-+{
-+	if (!nr)
-+		return;
-+
-+	at91_leds.dev.platform_data = leds;
-+
-+	for ( ; nr; nr--, leds++) {
-+		leds->index = nr;	/* first record stores number of leds */
-+		at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
-+	}
-+
-+	platform_device_register(&at91_leds);
-+}
-+#else
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
-+#endif
-+
-+
- /* --------------------------------------------------------------------
-  *  UART
-  * -------------------------------------------------------------------- */
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9261.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91sam9261.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9261.c
-@@ -97,6 +97,21 @@ static struct clk spi1_clk = {
- 	.pmc_mask	= 1 << AT91SAM9261_ID_SPI1,
- 	.type		= CLK_TYPE_PERIPHERAL,
- };
-+static struct clk ssc0_clk = {
-+	.name		= "ssc0_clk",
-+	.pmc_mask	= 1 << AT91SAM9261_ID_SSC0,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ssc1_clk = {
-+	.name		= "ssc1_clk",
-+	.pmc_mask	= 1 << AT91SAM9261_ID_SSC1,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ssc2_clk = {
-+	.name		= "ssc2_clk",
-+	.pmc_mask	= 1 << AT91SAM9261_ID_SSC2,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
- static struct clk tc0_clk = {
- 	.name		= "tc0_clk",
- 	.pmc_mask	= 1 << AT91SAM9261_ID_TC0,
-@@ -135,7 +150,9 @@ static struct clk *periph_clocks[] __ini
- 	&twi_clk,
- 	&spi0_clk,
- 	&spi1_clk,
--	// ssc 0 .. ssc2
-+	&ssc0_clk,
-+	&ssc1_clk,
-+	&ssc2_clk,
- 	&tc0_clk,
- 	&tc1_clk,
- 	&tc2_clk,
-@@ -230,6 +247,28 @@ static void at91sam9261_reset(void)
- 
- 
- /* --------------------------------------------------------------------
-+ *  Timer/Counter library initialization
-+ * -------------------------------------------------------------------- */
-+#ifdef CONFIG_ATMEL_TCLIB
-+
-+#include "tclib.h"
-+
-+static struct atmel_tcblock at91sam9261_tcblocks[] = {
-+	[0] = {
-+		.physaddr	= AT91SAM9261_BASE_TCB0,
-+		.irq		= { AT91SAM9261_ID_TC0, AT91SAM9261_ID_TC1, AT91SAM9261_ID_TC2 },
-+		.clk		= { &tc0_clk, &tc1_clk, &tc2_clk },
-+	}
-+};
-+
-+#define at91sam9261_tc_init()	atmel_tc_init(at91sam9261_tcblocks, ARRAY_SIZE(at91sam9261_tcblocks))
-+
-+#else
-+#define at91sam9261_tc_init()	do {} while(0)
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-  *  AT91SAM9261 processor initialization
-  * -------------------------------------------------------------------- */
- 
-@@ -250,6 +289,9 @@ void __init at91sam9261_initialize(unsig
- 
- 	/* Register GPIO subsystem */
- 	at91_gpio_init(at91sam9261_gpio, 3);
-+
-+	/* Initialize the Timer/Counter blocks */
-+	at91sam9261_tc_init();
- }
- 
- /* --------------------------------------------------------------------
-@@ -262,25 +304,25 @@ void __init at91sam9261_initialize(unsig
- static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
- 	7,	/* Advanced Interrupt Controller */
- 	7,	/* System Peripherals */
--	0,	/* Parallel IO Controller A */
--	0,	/* Parallel IO Controller B */
--	0,	/* Parallel IO Controller C */
--	0,
--	6,	/* USART 0 */
--	6,	/* USART 1 */
--	6,	/* USART 2 */
-+	1,	/* Parallel IO Controller A */
-+	1,	/* Parallel IO Controller B */
-+	1,	/* Parallel IO Controller C */
-+	0,
-+	5,	/* USART 0 */
-+	5,	/* USART 1 */
-+	5,	/* USART 2 */
- 	0,	/* Multimedia Card Interface */
--	4,	/* USB Device Port */
--	0,	/* Two-Wire Interface */
--	6,	/* Serial Peripheral Interface 0 */
--	6,	/* Serial Peripheral Interface 1 */
--	5,	/* Serial Synchronous Controller 0 */
--	5,	/* Serial Synchronous Controller 1 */
--	5,	/* Serial Synchronous Controller 2 */
-+	2,	/* USB Device Port */
-+	6,	/* Two-Wire Interface */
-+	5,	/* Serial Peripheral Interface 0 */
-+	5,	/* Serial Peripheral Interface 1 */
-+	4,	/* Serial Synchronous Controller 0 */
-+	4,	/* Serial Synchronous Controller 1 */
-+	4,	/* Serial Synchronous Controller 2 */
- 	0,	/* Timer Counter 0 */
- 	0,	/* Timer Counter 1 */
- 	0,	/* Timer Counter 2 */
--	3,	/* USB Host port */
-+	2,	/* USB Host port */
- 	3,	/* LCD Controller */
- 	0,
- 	0,
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9261_devices.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91sam9261_devices.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9261_devices.c
-@@ -14,6 +14,9 @@
- #include <asm/mach/map.h>
- 
- #include <linux/platform_device.h>
-+#include <linux/fb.h>
-+
-+#include <video/atmel_lcdc.h>
- 
- #include <asm/arch/board.h>
- #include <asm/arch/gpio.h>
-@@ -430,9 +433,9 @@ void __init at91_add_device_spi(struct s
-  *  LCD Controller
-  * -------------------------------------------------------------------- */
- 
--#if defined(CONFIG_FB_AT91) || defined(CONFIG_FB_AT91_MODULE)
-+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
- static u64 lcdc_dmamask = 0xffffffffUL;
--static struct at91fb_info lcdc_data;
-+static struct atmel_lcdfb_info lcdc_data;
- 
- static struct resource lcdc_resources[] = {
- 	[0] = {
-@@ -455,7 +458,7 @@ static struct resource lcdc_resources[] 
- };
- 
- static struct platform_device at91_lcdc_device = {
--	.name		= "at91-fb",
-+	.name		= "atmel_lcdfb",
- 	.id		= 0,
- 	.dev		= {
- 				.dma_mask		= &lcdc_dmamask,
-@@ -466,7 +469,7 @@ static struct platform_device at91_lcdc_
- 	.num_resources	= ARRAY_SIZE(lcdc_resources),
- };
- 
--void __init at91_add_device_lcdc(struct at91fb_info *data)
-+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
- {
- 	if (!data) {
- 		return;
-@@ -499,7 +502,7 @@ void __init at91_add_device_lcdc(struct 
- 	platform_device_register(&at91_lcdc_device);
- }
- #else
--void __init at91_add_device_lcdc(struct at91fb_info *data) {}
-+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
- #endif
- 
- 
-@@ -525,6 +528,32 @@ void __init at91_init_leds(u8 cpu_led, u
- #endif
- 
- 
-+#if defined(CONFIG_NEW_LEDS)
-+
-+static struct platform_device at91_leds = {
-+	.name		= "at91_leds",
-+	.id		= -1,
-+};
-+
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
-+{
-+	if (!nr)
-+		return;
-+
-+	at91_leds.dev.platform_data = leds;
-+
-+	for ( ; nr; nr--, leds++) {
-+		leds->index = nr;	/* first record stores number of leds */
-+		at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
-+	}
-+
-+	platform_device_register(&at91_leds);
-+}
-+#else
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
-+#endif
-+
-+
- /* --------------------------------------------------------------------
-  *  UART
-  * -------------------------------------------------------------------- */
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9263.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91sam9263.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9263.c
-@@ -87,6 +87,11 @@ static struct clk mmc1_clk = {
- 	.pmc_mask	= 1 << AT91SAM9263_ID_MCI1,
- 	.type		= CLK_TYPE_PERIPHERAL,
- };
-+static struct clk can_clk = {
-+	.name		= "can_clk",
-+	.pmc_mask	= 1 << AT91SAM9263_ID_CAN,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
- static struct clk twi_clk = {
- 	.name		= "twi_clk",
- 	.pmc_mask	= 1 << AT91SAM9263_ID_TWI,
-@@ -102,16 +107,46 @@ static struct clk spi1_clk = {
- 	.pmc_mask	= 1 << AT91SAM9263_ID_SPI1,
- 	.type		= CLK_TYPE_PERIPHERAL,
- };
-+static struct clk ssc0_clk = {
-+	.name		= "ssc0_clk",
-+	.pmc_mask	= 1 << AT91SAM9263_ID_SSC0,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ssc1_clk = {
-+	.name		= "ssc1_clk",
-+	.pmc_mask	= 1 << AT91SAM9263_ID_SSC1,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ac97_clk = {
-+	.name		= "ac97_clk",
-+	.pmc_mask	= 1 << AT91SAM9263_ID_AC97C,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
- static struct clk tcb_clk = {
- 	.name		= "tcb_clk",
- 	.pmc_mask	= 1 << AT91SAM9263_ID_TCB,
- 	.type		= CLK_TYPE_PERIPHERAL,
- };
-+static struct clk pwmc_clk = {
-+	.name		= "pwmc_clk",
-+	.pmc_mask	= 1 << AT91SAM9263_ID_PWMC,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
- static struct clk macb_clk = {
- 	.name		= "macb_clk",
- 	.pmc_mask	= 1 << AT91SAM9263_ID_EMAC,
- 	.type		= CLK_TYPE_PERIPHERAL,
- };
-+static struct clk dma_clk = {
-+	.name		= "dma_clk",
-+	.pmc_mask	= 1 << AT91SAM9263_ID_DMA,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk twodge_clk = {
-+	.name		= "2dge_clk",
-+	.pmc_mask	= 1 << AT91SAM9263_ID_2DGE,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
- static struct clk udc_clk = {
- 	.name		= "udc_clk",
- 	.pmc_mask	= 1 << AT91SAM9263_ID_UDP,
-@@ -142,20 +177,21 @@ static struct clk *periph_clocks[] __ini
- 	&usart2_clk,
- 	&mmc0_clk,
- 	&mmc1_clk,
--	// can
-+	&can_clk,
- 	&twi_clk,
- 	&spi0_clk,
- 	&spi1_clk,
--	// ssc0 .. ssc1
--	// ac97
-+	&ssc0_clk,
-+	&ssc1_clk,
-+	&ac97_clk,
- 	&tcb_clk,
--	// pwmc
-+	&pwmc_clk,
- 	&macb_clk,
--	// 2dge
-+	&twodge_clk,
- 	&udc_clk,
- 	&isi_clk,
- 	&lcdc_clk,
--	// dma
-+	&dma_clk,
- 	&ohci_clk,
- 	// irq0 .. irq1
- };
-@@ -237,6 +273,28 @@ static void at91sam9263_reset(void)
- 
- 
- /* --------------------------------------------------------------------
-+ *  Timer/Counter library initialization
-+ * -------------------------------------------------------------------- */
-+#ifdef CONFIG_ATMEL_TCLIB
-+
-+#include "tclib.h"
-+
-+static struct atmel_tcblock at91sam9263_tcblocks[] = {
-+	[0] = {
-+		.physaddr	= AT91SAM9263_BASE_TCB0,
-+		.irq		= { AT91SAM9263_ID_TCB, AT91SAM9263_ID_TCB, AT91SAM9263_ID_TCB },
-+		.clk		= { &tcb_clk, &tcb_clk, &tcb_clk },
-+	}
-+};
-+
-+#define at91sam9263_tc_init()	atmel_tc_init(at91sam9263_tcblocks, ARRAY_SIZE(at91sam9263_tcblocks))
-+
-+#else
-+#define at91sam9263_tc_init()	do {} while(0)
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-  *  AT91SAM9263 processor initialization
-  * -------------------------------------------------------------------- */
- 
-@@ -256,6 +314,9 @@ void __init at91sam9263_initialize(unsig
- 
- 	/* Register GPIO subsystem */
- 	at91_gpio_init(at91sam9263_gpio, 5);
-+
-+	/* Initialize the Timer/Counter blocks */
-+	at91sam9263_tc_init();
- }
- 
- /* --------------------------------------------------------------------
-@@ -268,34 +329,34 @@ void __init at91sam9263_initialize(unsig
- static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = {
- 	7,	/* Advanced Interrupt Controller (FIQ) */
- 	7,	/* System Peripherals */
--	0,	/* Parallel IO Controller A */
--	0,	/* Parallel IO Controller B */
--	0,	/* Parallel IO Controller C, D and E */
-+	1,	/* Parallel IO Controller A */
-+	1,	/* Parallel IO Controller B */
-+	1,	/* Parallel IO Controller C, D and E */
- 	0,
- 	0,
--	6,	/* USART 0 */
--	6,	/* USART 1 */
--	6,	/* USART 2 */
-+	5,	/* USART 0 */
-+	5,	/* USART 1 */
-+	5,	/* USART 2 */
- 	0,	/* Multimedia Card Interface 0 */
- 	0,	/* Multimedia Card Interface 1 */
--	4,	/* CAN */
--	0,	/* Two-Wire Interface */
--	6,	/* Serial Peripheral Interface 0 */
--	6,	/* Serial Peripheral Interface 1 */
--	5,	/* Serial Synchronous Controller 0 */
--	5,	/* Serial Synchronous Controller 1 */
--	6,	/* AC97 Controller */
-+	3,	/* CAN */
-+	6,	/* Two-Wire Interface */
-+	5,	/* Serial Peripheral Interface 0 */
-+	5,	/* Serial Peripheral Interface 1 */
-+	4,	/* Serial Synchronous Controller 0 */
-+	4,	/* Serial Synchronous Controller 1 */
-+	5,	/* AC97 Controller */
- 	0,	/* Timer Counter 0, 1 and 2 */
- 	0,	/* Pulse Width Modulation Controller */
- 	3,	/* Ethernet */
- 	0,
- 	0,	/* 2D Graphic Engine */
--	3,	/* USB Device Port */
-+	2,	/* USB Device Port */
- 	0,	/* Image Sensor Interface */
- 	3,	/* LDC Controller */
- 	0,	/* DMA Controller */
- 	0,
--	3,	/* USB Host port */
-+	2,	/* USB Host port */
- 	0,	/* Advanced Interrupt Controller (IRQ0) */
- 	0,	/* Advanced Interrupt Controller (IRQ1) */
- };
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9263_devices.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91sam9263_devices.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9263_devices.c
-@@ -13,6 +13,9 @@
- #include <asm/mach/map.h>
- 
- #include <linux/platform_device.h>
-+#include <linux/fb.h>
-+
-+#include <video/atmel_lcdc.h>
- 
- #include <asm/arch/board.h>
- #include <asm/arch/gpio.h>
-@@ -573,6 +576,180 @@ void __init at91_add_device_spi(struct s
- 
- 
- /* --------------------------------------------------------------------
-+ *  AC97
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE)
-+static u64 ac97_dmamask = 0xffffffffUL;
-+static struct atmel_ac97_data ac97_data;
-+
-+static struct resource ac97_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9263_BASE_AC97C,
-+		.end	= AT91SAM9263_BASE_AC97C + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9263_ID_AC97C,
-+		.end	= AT91SAM9263_ID_AC97C,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct platform_device at91sam9263_ac97_device = {
-+	.name		= "ac97c",
-+	.id		= 1,
-+	.dev		= {
-+				.dma_mask		= &ac97_dmamask,
-+				.coherent_dma_mask	= 0xffffffff,
-+				.platform_data		= &ac97_data,
-+	},
-+	.resource	= ac97_resources,
-+	.num_resources	= ARRAY_SIZE(ac97_resources),
-+};
-+
-+void __init at91_add_device_ac97(struct atmel_ac97_data *data)
-+{
-+	if (!data)
-+		return;
-+
-+	at91_set_A_periph(AT91_PIN_PB0, 0);	/* AC97FS */
-+	at91_set_A_periph(AT91_PIN_PB1, 0);	/* AC97CK */
-+	at91_set_A_periph(AT91_PIN_PB2, 0);	/* AC97TX */
-+	at91_set_A_periph(AT91_PIN_PB3, 0);	/* AC97RX */
-+
-+	/* reset */
-+	if (data->reset_pin)
-+		at91_set_gpio_output(data->reset_pin, 0);
-+
-+	ac97_data = *ek_data;
-+	platform_device_register(&at91sam9263_ac97_device);
-+}
-+#else
-+void __init at91_add_device_ac97(struct atmel_ac97_data *data) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  Image Sensor Interface
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_VIDEO_AT91_ISI) || defined(CONFIG_VIDEO_AT91_ISI_MODULE)
-+
-+struct resource isi_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9263_BASE_ISI,
-+		.end	= AT91SAM9263_BASE_ISI + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9263_ID_ISI,
-+		.end	= AT91SAM9263_ID_ISI,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct platform_device at91sam9263_isi_device = {
-+	.name		= "at91_isi",
-+	.id		= -1,
-+	.resource	= isi_resources,
-+	.num_resources	= ARRAY_SIZE(isi_resources),
-+};
-+
-+void __init at91_add_device_isi(void)
-+{
-+	at91_set_A_periph(AT91_PIN_PE0, 0);	/* ISI_D0 */
-+	at91_set_A_periph(AT91_PIN_PE1, 0);	/* ISI_D1 */
-+	at91_set_A_periph(AT91_PIN_PE2, 0);	/* ISI_D2 */
-+	at91_set_A_periph(AT91_PIN_PE3, 0);	/* ISI_D3 */
-+	at91_set_A_periph(AT91_PIN_PE4, 0);	/* ISI_D4 */
-+	at91_set_A_periph(AT91_PIN_PE5, 0);	/* ISI_D5 */
-+	at91_set_A_periph(AT91_PIN_PE6, 0);	/* ISI_D6 */
-+	at91_set_A_periph(AT91_PIN_PE7, 0);	/* ISI_D7 */
-+	at91_set_A_periph(AT91_PIN_PE8, 0);	/* ISI_PCK */
-+	at91_set_A_periph(AT91_PIN_PE9, 0);	/* ISI_HSYNC */
-+	at91_set_A_periph(AT91_PIN_PE10, 0);	/* ISI_VSYNC */
-+	at91_set_B_periph(AT91_PIN_PE11, 0);	/* ISI_MCK (PCK3) */
-+	at91_set_B_periph(AT91_PIN_PE12, 0);	/* ISI_PD8 */
-+	at91_set_B_periph(AT91_PIN_PE13, 0);	/* ISI_PD9 */
-+	at91_set_B_periph(AT91_PIN_PE14, 0);	/* ISI_PD10 */
-+	at91_set_B_periph(AT91_PIN_PE15, 0);	/* ISI_PD11 */
-+}
-+#else
-+void __init at91_add_device_isi(void) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  LCD Controller
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
-+static u64 lcdc_dmamask = 0xffffffffUL;
-+static struct atmel_lcdfb_info lcdc_data;
-+
-+static struct resource lcdc_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9263_LCDC_BASE,
-+		.end	= AT91SAM9263_LCDC_BASE + SZ_4K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9263_ID_LCDC,
-+		.end	= AT91SAM9263_ID_LCDC,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct platform_device at91_lcdc_device = {
-+	.name		= "atmel_lcdfb",
-+	.id		= 0,
-+	.dev		= {
-+				.dma_mask		= &lcdc_dmamask,
-+				.coherent_dma_mask	= 0xffffffff,
-+				.platform_data		= &lcdc_data,
-+	},
-+	.resource	= lcdc_resources,
-+	.num_resources	= ARRAY_SIZE(lcdc_resources),
-+};
-+
-+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
-+{
-+	if (!data)
-+		return;
-+
-+	at91_set_A_periph(AT91_PIN_PC1, 0);	/* LCDHSYNC */
-+	at91_set_A_periph(AT91_PIN_PC2, 0);	/* LCDDOTCK */
-+	at91_set_A_periph(AT91_PIN_PC3, 0);	/* LCDDEN */
-+	at91_set_B_periph(AT91_PIN_PB9, 0);	/* LCDCC */
-+	at91_set_A_periph(AT91_PIN_PC6, 0);	/* LCDD2 */
-+	at91_set_A_periph(AT91_PIN_PC7, 0);	/* LCDD3 */
-+	at91_set_A_periph(AT91_PIN_PC8, 0);	/* LCDD4 */
-+	at91_set_A_periph(AT91_PIN_PC9, 0);	/* LCDD5 */
-+	at91_set_A_periph(AT91_PIN_PC10, 0);	/* LCDD6 */
-+	at91_set_A_periph(AT91_PIN_PC11, 0);	/* LCDD7 */
-+	at91_set_A_periph(AT91_PIN_PC14, 0);	/* LCDD10 */
-+	at91_set_A_periph(AT91_PIN_PC15, 0);	/* LCDD11 */
-+	at91_set_A_periph(AT91_PIN_PC16, 0);	/* LCDD12 */
-+	at91_set_B_periph(AT91_PIN_PC12, 0);	/* LCDD13 */
-+	at91_set_A_periph(AT91_PIN_PC18, 0);	/* LCDD14 */
-+	at91_set_A_periph(AT91_PIN_PC19, 0);	/* LCDD15 */
-+	at91_set_A_periph(AT91_PIN_PC22, 0);	/* LCDD18 */
-+	at91_set_A_periph(AT91_PIN_PC23, 0);	/* LCDD19 */
-+	at91_set_A_periph(AT91_PIN_PC24, 0);	/* LCDD20 */
-+	at91_set_B_periph(AT91_PIN_PC17, 0);	/* LCDD21 */
-+	at91_set_A_periph(AT91_PIN_PC26, 0);	/* LCDD22 */
-+	at91_set_A_periph(AT91_PIN_PC27, 0);	/* LCDD23 */
-+
-+	lcdc_data = *data;
-+	platform_device_register(&at91_lcdc_device);
-+}
-+#else
-+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-  *  LEDs
-  * -------------------------------------------------------------------- */
- 
-@@ -594,6 +771,32 @@ void __init at91_init_leds(u8 cpu_led, u
- #endif
- 
- 
-+#if defined(CONFIG_NEW_LEDS)
-+
-+static struct platform_device at91_leds = {
-+	.name		= "at91_leds",
-+	.id		= -1,
-+};
-+
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
-+{
-+	if (!nr)
-+		return;
-+
-+	at91_leds.dev.platform_data = leds;
-+
-+	for ( ; nr; nr--, leds++) {
-+		leds->index = nr;	/* first record stores number of leds */
-+		at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
-+	}
-+
-+	platform_device_register(&at91_leds);
-+}
-+#else
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
-+#endif
-+
-+
- /* --------------------------------------------------------------------
-  *  UART
-  * -------------------------------------------------------------------- */
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9rl.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9rl.c
-@@ -0,0 +1,366 @@
-+/*
-+ * arch/arm/mach-at91/at91sam9rl.c
-+ *
-+ *  Copyright (C) 2005 SAN People
-+ *  Copyright (C) 2007 Atmel Corporation
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file COPYING in the main directory of this archive for
-+ * more details.
-+ */
-+
-+#include <linux/module.h>
-+
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/arch/cpu.h>
-+#include <asm/arch/at91sam9rl.h>
-+#include <asm/arch/at91_pmc.h>
-+#include <asm/arch/at91_rstc.h>
-+
-+#include "generic.h"
-+#include "clock.h"
-+
-+static struct map_desc at91sam9rl_io_desc[] __initdata = {
-+	{
-+		.virtual	= AT91_VA_BASE_SYS,
-+		.pfn		= __phys_to_pfn(AT91_BASE_SYS),
-+		.length		= SZ_16K,
-+		.type		= MT_DEVICE,
-+	},
-+};
-+
-+static struct map_desc at91sam9rl_sram_desc[] __initdata = {
-+	{
-+		.pfn		= __phys_to_pfn(AT91SAM9RL_SRAM_BASE),
-+		.type		= MT_DEVICE,
-+	}
-+};
-+
-+/* --------------------------------------------------------------------
-+ *  Clocks
-+ * -------------------------------------------------------------------- */
-+
-+/*
-+ * The peripheral clocks.
-+ */
-+static struct clk pioA_clk = {
-+	.name		= "pioA_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_PIOA,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk pioB_clk = {
-+	.name		= "pioB_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_PIOB,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk pioC_clk = {
-+	.name		= "pioC_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_PIOC,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk pioD_clk = {
-+	.name		= "pioD_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_PIOD,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk usart0_clk = {
-+	.name		= "usart0_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_US0,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk usart1_clk = {
-+	.name		= "usart1_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_US1,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk usart2_clk = {
-+	.name		= "usart2_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_US2,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk usart3_clk = {
-+	.name		= "usart3_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_US3,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk mmc_clk = {
-+	.name		= "mci_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_MCI,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk twi0_clk = {
-+	.name		= "twi0_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_TWI0,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk twi1_clk = {
-+	.name		= "twi1_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_TWI1,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk spi_clk = {
-+	.name		= "spi_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_SPI,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ssc0_clk = {
-+	.name		= "ssc0_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_SSC0,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ssc1_clk = {
-+	.name		= "ssc1_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_SSC1,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk tc0_clk = {
-+	.name		= "tc0_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_TC0,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk tc1_clk = {
-+	.name		= "tc1_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_TC1,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk tc2_clk = {
-+	.name		= "tc2_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_TC2,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk pwmc_clk = {
-+	.name		= "pwmc_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_PWMC,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk tsc_clk = {
-+	.name		= "tsc_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_TSC,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk dma_clk = {
-+	.name		= "dma_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_DMA,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk udphs_clk = {
-+	.name		= "udphs_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_UDPHS,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk lcdc_clk = {
-+	.name		= "lcdc_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_LCDC,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+static struct clk ac97_clk = {
-+	.name		= "ac97_clk",
-+	.pmc_mask	= 1 << AT91SAM9RL_ID_AC97C,
-+	.type		= CLK_TYPE_PERIPHERAL,
-+};
-+
-+static struct clk *periph_clocks[] __initdata = {
-+	&pioA_clk,
-+	&pioB_clk,
-+	&pioC_clk,
-+	&pioD_clk,
-+	&usart0_clk,
-+	&usart1_clk,
-+	&usart2_clk,
-+	&usart3_clk,
-+	&mmc_clk,
-+	&twi0_clk,
-+	&twi1_clk,
-+	&spi_clk,
-+	&ssc0_clk,
-+	&ssc1_clk,
-+	&tc0_clk,
-+	&tc1_clk,
-+	&tc2_clk,
-+	&pwmc_clk,
-+	&tsc_clk,
-+	&dma_clk,
-+	&udphs_clk,
-+	&lcdc_clk,
-+	&ac97_clk,
-+	// irq0
-+};
-+
-+/*
-+ * The two programmable clocks.
-+ * You must configure pin multiplexing to bring these signals out.
-+ */
-+static struct clk pck0 = {
-+	.name		= "pck0",
-+	.pmc_mask	= AT91_PMC_PCK0,
-+	.type		= CLK_TYPE_PROGRAMMABLE,
-+	.id		= 0,
-+};
-+static struct clk pck1 = {
-+	.name		= "pck1",
-+	.pmc_mask	= AT91_PMC_PCK1,
-+	.type		= CLK_TYPE_PROGRAMMABLE,
-+	.id		= 1,
-+};
-+
-+static void __init at91sam9rl_register_clocks(void)
-+{
-+	int i;
-+
-+	for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
-+		clk_register(periph_clocks[i]);
-+
-+	clk_register(&pck0);
-+	clk_register(&pck1);
-+}
-+
-+/* --------------------------------------------------------------------
-+ *  GPIO
-+ * -------------------------------------------------------------------- */
-+
-+static struct at91_gpio_bank at91sam9rl_gpio[] = {
-+	{
-+		.id		= AT91SAM9RL_ID_PIOA,
-+		.offset		= AT91_PIOA,
-+		.clock		= &pioA_clk,
-+	}, {
-+		.id		= AT91SAM9RL_ID_PIOB,
-+		.offset		= AT91_PIOB,
-+		.clock		= &pioB_clk,
-+	}, {
-+		.id		= AT91SAM9RL_ID_PIOC,
-+		.offset		= AT91_PIOC,
-+		.clock		= &pioC_clk,
-+	}, {
-+		.id		= AT91SAM9RL_ID_PIOD,
-+		.offset		= AT91_PIOD,
-+		.clock		= &pioD_clk,
-+	}
-+};
-+
-+static void at91sam9rl_reset(void)
-+{
-+	at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
-+}
-+
-+
-+/* --------------------------------------------------------------------
-+ *  Timer/Counter library initialization
-+ * -------------------------------------------------------------------- */
-+#ifdef CONFIG_ATMEL_TCLIB
-+
-+#include "tclib.h"
-+
-+static struct atmel_tcblock at91sam9rl_tcblocks[] = {
-+	[0] = {
-+		.physaddr	= AT91SAM9RL_BASE_TCB0,
-+		.irq		= { AT91SAM9RL_ID_TC0, AT91SAM9RL_ID_TC1, AT91SAM9RL_ID_TC2 },
-+		.clk		= { &tc0_clk, &tc1_clk, &tc2_clk },
-+	}
-+};
-+
-+#define at91sam9rl_tc_init()	atmel_tc_init(at91sam9rl_tcblocks, ARRAY_SIZE(at91sam9rl_tcblocks))
-+
-+#else
-+#define at91sam9rl_tc_init()	do {} while(0)
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  AT91SAM9RL processor initialization
-+ * -------------------------------------------------------------------- */
-+
-+void __init at91sam9rl_initialize(unsigned long main_clock)
-+{
-+	unsigned long cidr, sram_size;
-+
-+	/* Map peripherals */
-+	iotable_init(at91sam9rl_io_desc, ARRAY_SIZE(at91sam9rl_io_desc));
-+
-+	cidr = at91_sys_read(AT91_DBGU_CIDR);
-+
-+	switch (cidr & AT91_CIDR_SRAMSIZ) {
-+		case AT91_CIDR_SRAMSIZ_32K:
-+			sram_size = 2 * SZ_16K;
-+			break;
-+		case AT91_CIDR_SRAMSIZ_16K:
-+		default:
-+			sram_size = SZ_16K;
-+	}
-+
-+	at91sam9rl_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size;
-+	at91sam9rl_sram_desc->length = sram_size;
-+
-+	/* Map SRAM */
-+	iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc));
-+
-+	at91_arch_reset = at91sam9rl_reset;
-+	at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
-+
-+	/* Init clock subsystem */
-+	at91_clock_init(main_clock);
-+
-+	/* Register the processor-specific clocks */
-+	at91sam9rl_register_clocks();
-+
-+	/* Register GPIO subsystem */
-+	at91_gpio_init(at91sam9rl_gpio, 4);
-+	
-+	/* Initialize the Timer/Counter blocks */
-+	at91sam9rl_tc_init();
-+}
-+
-+/* --------------------------------------------------------------------
-+ *  Interrupt initialization
-+ * -------------------------------------------------------------------- */
-+
-+/*
-+ * The default interrupt priority levels (0 = lowest, 7 = highest).
-+ */
-+static unsigned int at91sam9rl_default_irq_priority[NR_AIC_IRQS] __initdata = {
-+	7,	/* Advanced Interrupt Controller */
-+	7,	/* System Peripherals */
-+	1,	/* Parallel IO Controller A */
-+	1,	/* Parallel IO Controller B */
-+	1,	/* Parallel IO Controller C */
-+	1,	/* Parallel IO Controller D */
-+	5,	/* USART 0 */
-+	5,	/* USART 1 */
-+	5,	/* USART 2 */
-+	5,	/* USART 3 */
-+	0,	/* Multimedia Card Interface */
-+	6,	/* Two-Wire Interface 0 */
-+	6,	/* Two-Wire Interface 1 */
-+	5,	/* Serial Peripheral Interface */
-+	4,	/* Serial Synchronous Controller 0 */
-+	4,	/* Serial Synchronous Controller 1 */
-+	0,	/* Timer Counter 0 */
-+	0,	/* Timer Counter 1 */
-+	0,	/* Timer Counter 2 */
-+	0,
-+	0,	/* Touch Screen Controller */
-+	0,	/* DMA Controller */
-+	2,	/* USB Device High speed port */
-+	2,	/* LCD Controller */
-+	6,	/* AC97 Controller */
-+	0,
-+	0,
-+	0,
-+	0,
-+	0,
-+	0,
-+	0,	/* Advanced Interrupt Controller */
-+};
-+
-+void __init at91sam9rl_init_interrupts(unsigned int priority[NR_AIC_IRQS])
-+{
-+	if (!priority)
-+		priority = at91sam9rl_default_irq_priority;
-+
-+	/* Initialize the AIC interrupt controller */
-+	at91_aic_init(priority);
-+
-+	/* Enable GPIO interrupts */
-+	at91_gpio_irq_setup();
-+}
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91sam9rl_devices.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91sam9rl_devices.c
-@@ -0,0 +1,660 @@
-+/*
-+ *  Copyright (C) 2007 Atmel Corporation
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file COPYING in the main directory of this archive for
-+ * more details.
-+ */
-+
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+
-+#include <linux/platform_device.h>
-+#include <linux/fb.h>
-+
-+#include <video/atmel_lcdc.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+#include <asm/arch/at91sam9rl.h>
-+#include <asm/arch/at91sam9rl_matrix.h>
-+#include <asm/arch/at91sam926x_mc.h>
-+
-+#include "generic.h"
-+
-+#define SZ_512	0x00000200
-+#define SZ_256	0x00000100
-+#define SZ_16	0x00000010
-+
-+
-+/* --------------------------------------------------------------------
-+ *  MMC / SD
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
-+static u64 mmc_dmamask = 0xffffffffUL;
-+static struct at91_mmc_data mmc_data;
-+
-+static struct resource mmc_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_BASE_MCI,
-+		.end	= AT91SAM9RL_BASE_MCI + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_MCI,
-+		.end	= AT91SAM9RL_ID_MCI,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct platform_device at91sam9rl_mmc_device = {
-+	.name		= "at91_mci",
-+	.id		= -1,
-+	.dev		= {
-+				.dma_mask		= &mmc_dmamask,
-+				.coherent_dma_mask	= 0xffffffff,
-+				.platform_data		= &mmc_data,
-+	},
-+	.resource	= mmc_resources,
-+	.num_resources	= ARRAY_SIZE(mmc_resources),
-+};
-+
-+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
-+{
-+	if (!data)
-+		return;
-+
-+	/* input/irq */
-+	if (data->det_pin) {
-+		at91_set_gpio_input(data->det_pin, 1);
-+		at91_set_deglitch(data->det_pin, 1);
-+	}
-+	if (data->wp_pin)
-+		at91_set_gpio_input(data->wp_pin, 1);
-+	if (data->vcc_pin)
-+		at91_set_gpio_output(data->vcc_pin, 0);
-+
-+	/* CLK */
-+	at91_set_A_periph(AT91_PIN_PA2, 0);
-+
-+	/* CMD */
-+	at91_set_A_periph(AT91_PIN_PA1, 1);
-+
-+	/* DAT0, maybe DAT1..DAT3 */
-+	at91_set_A_periph(AT91_PIN_PA0, 1);
-+	if (data->wire4) {
-+		at91_set_A_periph(AT91_PIN_PA3, 1);
-+		at91_set_A_periph(AT91_PIN_PA4, 1);
-+		at91_set_A_periph(AT91_PIN_PA5, 1);
-+	}
-+
-+	mmc_data = *data;
-+	platform_device_register(&at91sam9rl_mmc_device);
-+}
-+#else
-+void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  NAND / SmartMedia
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
-+static struct at91_nand_data nand_data;
-+
-+#define NAND_BASE	AT91_CHIPSELECT_3
-+
-+static struct resource nand_resources[] = {
-+	{
-+		.start	= NAND_BASE,
-+		.end	= NAND_BASE + SZ_256M - 1,
-+		.flags	= IORESOURCE_MEM,
-+	}
-+};
-+
-+static struct platform_device at91_nand_device = {
-+	.name		= "at91_nand",
-+	.id		= -1,
-+	.dev		= {
-+				.platform_data	= &nand_data,
-+	},
-+	.resource	= nand_resources,
-+	.num_resources	= ARRAY_SIZE(nand_resources),
-+};
-+
-+void __init at91_add_device_nand(struct at91_nand_data *data)
-+{
-+	unsigned long csa;
-+
-+	if (!data)
-+		return;
-+
-+	csa = at91_sys_read(AT91_MATRIX_EBICSA);
-+	at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
-+
-+	/* set the bus interface characteristics */
-+	at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
-+			| AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
-+
-+	at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(2) | AT91_SMC_NCS_WRPULSE_(5)
-+			| AT91_SMC_NRDPULSE_(2) | AT91_SMC_NCS_RDPULSE_(5));
-+
-+	at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
-+
-+	at91_sys_write(AT91_SMC_MODE(3), AT91_SMC_DBW_8 | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1));
-+
-+	/* enable pin */
-+	if (data->enable_pin)
-+		at91_set_gpio_output(data->enable_pin, 1);
-+
-+	/* ready/busy pin */
-+	if (data->rdy_pin)
-+		at91_set_gpio_input(data->rdy_pin, 1);
-+
-+	/* card detect pin */
-+	if (data->det_pin)
-+		at91_set_gpio_input(data->det_pin, 1);
-+
-+	at91_set_A_periph(AT91_PIN_PB4, 0);		/* NANDOE */
-+	at91_set_A_periph(AT91_PIN_PB5, 0);		/* NANDWE */
-+
-+	nand_data = *data;
-+	platform_device_register(&at91_nand_device);
-+}
-+
-+#else
-+void __init at91_add_device_nand(struct at91_nand_data *data) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  TWI (i2c)
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
-+
-+static struct resource twi_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_BASE_TWI0,
-+		.end	= AT91SAM9RL_BASE_TWI0 + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_TWI0,
-+		.end	= AT91SAM9RL_ID_TWI0,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct platform_device at91sam9rl_twi_device = {
-+	.name		= "at91_i2c",
-+	.id		= -1,
-+	.resource	= twi_resources,
-+	.num_resources	= ARRAY_SIZE(twi_resources),
-+};
-+
-+void __init at91_add_device_i2c(void)
-+{
-+	/* pins used for TWI interface */
-+	at91_set_A_periph(AT91_PIN_PA23, 0);		/* TWD */
-+	at91_set_multi_drive(AT91_PIN_PA23, 1);
-+
-+	at91_set_A_periph(AT91_PIN_PA24, 0);		/* TWCK */
-+	at91_set_multi_drive(AT91_PIN_PA24, 1);
-+
-+	platform_device_register(&at91sam9rl_twi_device);
-+}
-+#else
-+void __init at91_add_device_i2c(void) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  SPI
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
-+static u64 spi_dmamask = 0xffffffffUL;
-+
-+static struct resource spi_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_BASE_SPI,
-+		.end	= AT91SAM9RL_BASE_SPI + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_SPI,
-+		.end	= AT91SAM9RL_ID_SPI,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct platform_device at91sam9rl_spi_device = {
-+	.name		= "atmel_spi",
-+	.id		= 0,
-+	.dev		= {
-+				.dma_mask		= &spi_dmamask,
-+				.coherent_dma_mask	= 0xffffffff,
-+	},
-+	.resource	= spi_resources,
-+	.num_resources	= ARRAY_SIZE(spi_resources),
-+};
-+
-+static const unsigned spi_standard_cs[4] = { AT91_PIN_PA28, AT91_PIN_PB7, AT91_PIN_PD8, AT91_PIN_PD9 };
-+
-+
-+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
-+{
-+	int i;
-+	unsigned long cs_pin;
-+
-+	at91_set_A_periph(AT91_PIN_PA25, 0);	/* MISO */
-+	at91_set_A_periph(AT91_PIN_PA26, 0);	/* MOSI */
-+	at91_set_A_periph(AT91_PIN_PA27, 0);	/* SPCK */
-+
-+	/* Enable SPI chip-selects */
-+	for (i = 0; i < nr_devices; i++) {
-+		if (devices[i].controller_data)
-+			cs_pin = (unsigned long) devices[i].controller_data;
-+		else
-+			cs_pin = spi_standard_cs[devices[i].chip_select];
-+
-+		/* enable chip-select pin */
-+		at91_set_gpio_output(cs_pin, 1);
-+
-+		/* pass chip-select pin to driver */
-+		devices[i].controller_data = (void *) cs_pin;
-+	}
-+
-+	spi_register_board_info(devices, nr_devices);
-+	platform_device_register(&at91sam9rl_spi_device);
-+}
-+#else
-+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  LCD Controller
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
-+static u64 lcdc_dmamask = 0xffffffffUL;
-+static struct atmel_lcdfb_info lcdc_data;
-+
-+static struct resource lcdc_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_LCDC_BASE,
-+		.end	= AT91SAM9RL_LCDC_BASE + SZ_4K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_LCDC,
-+		.end	= AT91SAM9RL_ID_LCDC,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+#if defined(CONFIG_FB_INTSRAM)
-+	[2] = {
-+		.start	= AT91SAM9RL_SRAM_BASE,
-+		.end	= AT91SAM9RL_SRAM_BASE + AT91SAM9RL_SRAM_SIZE - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+#endif
-+};
-+
-+static struct platform_device at91_lcdc_device = {
-+	.name		= "atmel_lcdfb",
-+	.id		= 0,
-+	.dev		= {
-+				.dma_mask		= &lcdc_dmamask,
-+				.coherent_dma_mask	= 0xffffffff,
-+				.platform_data		= &lcdc_data,
-+	},
-+	.resource	= lcdc_resources,
-+	.num_resources	= ARRAY_SIZE(lcdc_resources),
-+};
-+
-+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
-+{
-+	if (!data) {
-+		return;
-+	}
-+
-+#warning "Check this"
-+	at91_set_B_periph(AT91_PIN_PC5, 0);	/* LCDHSYNC */
-+	at91_set_B_periph(AT91_PIN_PC6, 0);	/* LCDDOTCK */
-+	at91_set_B_periph(AT91_PIN_PC7, 0);	/* LCDDEN */
-+	at91_set_B_periph(AT91_PIN_PC3, 0);	/* LCDCC */
-+	at91_set_B_periph(AT91_PIN_PC9, 0);	/* LCDD3 */
-+	at91_set_B_periph(AT91_PIN_PC10, 0);	/* LCDD4 */
-+	at91_set_B_periph(AT91_PIN_PC11, 0);	/* LCDD5 */
-+	at91_set_B_periph(AT91_PIN_PC12, 0);	/* LCDD6 */
-+	at91_set_B_periph(AT91_PIN_PC13, 0);	/* LCDD7 */
-+	at91_set_B_periph(AT91_PIN_PC15, 0);	/* LCDD11 */
-+	at91_set_B_periph(AT91_PIN_PC16, 0);	/* LCDD12 */
-+	at91_set_B_periph(AT91_PIN_PC17, 0);	/* LCDD13 */
-+	at91_set_B_periph(AT91_PIN_PC18, 0);	/* LCDD14 */
-+	at91_set_B_periph(AT91_PIN_PC19, 0);	/* LCDD15 */
-+	at91_set_B_periph(AT91_PIN_PC20, 0);	/* LCDD18 */
-+	at91_set_B_periph(AT91_PIN_PC21, 0);	/* LCDD19 */
-+	at91_set_B_periph(AT91_PIN_PC22, 0);	/* LCDD20 */
-+	at91_set_B_periph(AT91_PIN_PC23, 0);	/* LCDD21 */
-+	at91_set_B_periph(AT91_PIN_PC24, 0);	/* LCDD22 */
-+	at91_set_B_periph(AT91_PIN_PC25, 0);	/* LCDD23 */
-+
-+	lcdc_data = *data;
-+	platform_device_register(&at91_lcdc_device);
-+}
-+#else
-+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  LEDs
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_LEDS)
-+u8 at91_leds_cpu;
-+u8 at91_leds_timer;
-+
-+void __init at91_init_leds(u8 cpu_led, u8 timer_led)
-+{
-+	/* Enable GPIO to access the LEDs */
-+	at91_set_gpio_output(cpu_led, 1);
-+	at91_set_gpio_output(timer_led, 1);
-+
-+	at91_leds_cpu	= cpu_led;
-+	at91_leds_timer	= timer_led;
-+}
-+#else
-+void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
-+#endif
-+
-+
-+#if defined(CONFIG_NEW_LEDS)
-+
-+static struct platform_device at91_leds = {
-+	.name		= "at91_leds",
-+	.id		= -1,
-+};
-+
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr)
-+{
-+	if (!nr)
-+		return;
-+
-+	at91_leds.dev.platform_data = leds;
-+
-+	for ( ; nr; nr--, leds++) {
-+		leds->index = nr;	/* first record stores number of leds */
-+		at91_set_gpio_output(leds->gpio, (leds->flags & 1) == 0);
-+	}
-+
-+	platform_device_register(&at91_leds);
-+}
-+#else
-+void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr) {}
-+#endif
-+
-+
-+/* --------------------------------------------------------------------
-+ *  UART
-+ * -------------------------------------------------------------------- */
-+
-+#if defined(CONFIG_SERIAL_ATMEL)
-+static struct resource dbgu_resources[] = {
-+	[0] = {
-+		.start	= AT91_VA_BASE_SYS + AT91_DBGU,
-+		.end	= AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91_ID_SYS,
-+		.end	= AT91_ID_SYS,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct atmel_uart_data dbgu_data = {
-+	.use_dma_tx	= 0,
-+	.use_dma_rx	= 0,		/* DBGU not capable of receive DMA */
-+	.regs		= (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
-+};
-+
-+static struct platform_device at91sam9rl_dbgu_device = {
-+	.name		= "atmel_usart",
-+	.id		= 0,
-+	.dev		= {
-+				.platform_data	= &dbgu_data,
-+				.coherent_dma_mask = 0xffffffff,
-+	},
-+	.resource	= dbgu_resources,
-+	.num_resources	= ARRAY_SIZE(dbgu_resources),
-+};
-+
-+static inline void configure_dbgu_pins(void)
-+{
-+	at91_set_A_periph(AT91_PIN_PA21, 0);		/* DRXD */
-+	at91_set_A_periph(AT91_PIN_PA22, 1);		/* DTXD */
-+}
-+
-+static struct resource uart0_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_BASE_US0,
-+		.end	= AT91SAM9RL_BASE_US0 + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_US0,
-+		.end	= AT91SAM9RL_ID_US0,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct atmel_uart_data uart0_data = {
-+	.use_dma_tx	= 1,
-+	.use_dma_rx	= 1,
-+};
-+
-+static struct platform_device at91sam9rl_uart0_device = {
-+	.name		= "atmel_usart",
-+	.id		= 1,
-+	.dev		= {
-+				.platform_data	= &uart0_data,
-+				.coherent_dma_mask = 0xffffffff,
-+	},
-+	.resource	= uart0_resources,
-+	.num_resources	= ARRAY_SIZE(uart0_resources),
-+};
-+
-+static inline void configure_usart0_pins(void)
-+{
-+	at91_set_A_periph(AT91_PIN_PA6, 1);		/* TXD0 */
-+	at91_set_A_periph(AT91_PIN_PA7, 0);		/* RXD0 */
-+	at91_set_A_periph(AT91_PIN_PA9, 0);		/* RTS0 */
-+	at91_set_A_periph(AT91_PIN_PA10, 0);		/* CTS0 */
-+}
-+
-+static struct resource uart1_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_BASE_US1,
-+		.end	= AT91SAM9RL_BASE_US1 + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_US1,
-+		.end	= AT91SAM9RL_ID_US1,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct atmel_uart_data uart1_data = {
-+	.use_dma_tx	= 1,
-+	.use_dma_rx	= 1,
-+};
-+
-+static struct platform_device at91sam9rl_uart1_device = {
-+	.name		= "atmel_usart",
-+	.id		= 2,
-+	.dev		= {
-+				.platform_data	= &uart1_data,
-+				.coherent_dma_mask = 0xffffffff,
-+	},
-+	.resource	= uart1_resources,
-+	.num_resources	= ARRAY_SIZE(uart1_resources),
-+};
-+
-+static inline void configure_usart1_pins(void)
-+{
-+	at91_set_A_periph(AT91_PIN_PA11, 1);		/* TXD1 */
-+	at91_set_A_periph(AT91_PIN_PA12, 0);		/* RXD1 */
-+}
-+
-+static struct resource uart2_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_BASE_US2,
-+		.end	= AT91SAM9RL_BASE_US2 + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_US2,
-+		.end	= AT91SAM9RL_ID_US2,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct atmel_uart_data uart2_data = {
-+	.use_dma_tx	= 1,
-+	.use_dma_rx	= 1,
-+};
-+
-+static struct platform_device at91sam9rl_uart2_device = {
-+	.name		= "atmel_usart",
-+	.id		= 3,
-+	.dev		= {
-+				.platform_data	= &uart2_data,
-+				.coherent_dma_mask = 0xffffffff,
-+	},
-+	.resource	= uart2_resources,
-+	.num_resources	= ARRAY_SIZE(uart2_resources),
-+};
-+
-+static inline void configure_usart2_pins(void)
-+{
-+	at91_set_A_periph(AT91_PIN_PA13, 1);		/* TXD2 */
-+	at91_set_A_periph(AT91_PIN_PA14, 0);		/* RXD2 */
-+}
-+
-+static struct resource uart3_resources[] = {
-+	[0] = {
-+		.start	= AT91SAM9RL_BASE_US3,
-+		.end	= AT91SAM9RL_BASE_US3 + SZ_16K - 1,
-+		.flags	= IORESOURCE_MEM,
-+	},
-+	[1] = {
-+		.start	= AT91SAM9RL_ID_US3,
-+		.end	= AT91SAM9RL_ID_US3,
-+		.flags	= IORESOURCE_IRQ,
-+	},
-+};
-+
-+static struct atmel_uart_data uart3_data = {
-+	.use_dma_tx	= 1,
-+	.use_dma_rx	= 1,
-+};
-+
-+static struct platform_device at91sam9rl_uart3_device = {
-+	.name		= "atmel_usart",
-+	.id		= 4,
-+	.dev		= {
-+				.platform_data	= &uart3_data,
-+				.coherent_dma_mask = 0xffffffff,
-+	},
-+	.resource	= uart3_resources,
-+	.num_resources	= ARRAY_SIZE(uart3_resources),
-+};
-+
-+static inline void configure_usart3_pins(void)
-+{
-+	at91_set_A_periph(AT91_PIN_PB0, 1);		/* TXD3 */
-+	at91_set_A_periph(AT91_PIN_PB1, 0);		/* RXD3 */
-+}
-+
-+struct platform_device *at91_uarts[ATMEL_MAX_UART];	/* the UARTs to use */
-+struct platform_device *atmel_default_console_device;	/* the serial console device */
-+
-+void __init at91_init_serial(struct at91_uart_config *config)
-+{
-+	int i;
-+
-+	/* Fill in list of supported UARTs */
-+	for (i = 0; i < config->nr_tty; i++) {
-+		switch (config->tty_map[i]) {
-+			case 0:
-+				configure_usart0_pins();
-+				at91_uarts[i] = &at91sam9rl_uart0_device;
-+				at91_clock_associate("usart0_clk", &at91sam9rl_uart0_device.dev, "usart");
-+				break;
-+			case 1:
-+				configure_usart1_pins();
-+				at91_uarts[i] = &at91sam9rl_uart1_device;
-+				at91_clock_associate("usart1_clk", &at91sam9rl_uart1_device.dev, "usart");
-+				break;
-+			case 2:
-+				configure_usart2_pins();
-+				at91_uarts[i] = &at91sam9rl_uart2_device;
-+				at91_clock_associate("usart2_clk", &at91sam9rl_uart2_device.dev, "usart");
-+				break;
-+			case 3:
-+				configure_usart3_pins();
-+				at91_uarts[i] = &at91sam9rl_uart3_device;
-+				at91_clock_associate("usart3_clk", &at91sam9rl_uart3_device.dev, "usart");
-+				break;
-+			case 4:
-+				configure_dbgu_pins();
-+				at91_uarts[i] = &at91sam9rl_dbgu_device;
-+				at91_clock_associate("mck", &at91sam9rl_dbgu_device.dev, "usart");
-+				break;
-+			default:
-+				continue;
-+		}
-+		at91_uarts[i]->id = i;		/* update ID number to mapped ID */
-+	}
-+
-+	/* Set serial console device */
-+	if (config->console_tty < ATMEL_MAX_UART)
-+		atmel_default_console_device = at91_uarts[config->console_tty];
-+	if (!atmel_default_console_device)
-+		printk(KERN_INFO "AT91: No default serial console defined.\n");
-+}
-+
-+void __init at91_add_device_serial(void)
-+{
-+	int i;
-+
-+	for (i = 0; i < ATMEL_MAX_UART; i++) {
-+		if (at91_uarts[i])
-+			platform_device_register(at91_uarts[i]);
-+	}
-+}
-+#else
-+void __init at91_init_serial(struct at91_uart_config *config) {}
-+void __init at91_add_device_serial(void) {}
-+#endif
-+
-+
-+/* -------------------------------------------------------------------- */
-+
-+/*
-+ * These devices are always present and don't need any board-specific
-+ * setup.
-+ */
-+static int __init at91_add_standard_devices(void)
-+{
-+	return 0;
-+}
-+
-+arch_initcall(at91_add_standard_devices);
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-cam60.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-cam60.c
-@@ -0,0 +1,148 @@
-+/*
-+ * KwikByte CAM60
-+ *
-+ * based on board-sam9260ek.c
-+ *   Copyright (C) 2005 SAN People
-+ *   Copyright (C) 2006 Atmel
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/mm.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/spi/spi.h>
-+#include <linux/spi/flash.h>
-+
-+#include <asm/hardware.h>
-+#include <asm/setup.h>
-+#include <asm/mach-types.h>
-+#include <asm/irq.h>
-+
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/mach/irq.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+#include <asm/arch/at91sam926x_mc.h>
-+
-+#include "generic.h"
-+
-+
-+/*
-+ * Serial port configuration.
-+ *    0 .. 5 = USART0 .. USART5
-+ *    6      = DBGU
-+ */
-+static struct at91_uart_config __initdata cam60_uart_config = {
-+	.console_tty	= 0,				/* ttyS0 */
-+	.nr_tty		= 1,
-+	.tty_map	= { 6, -1, -1, -1, -1, -1, -1 }	/* ttyS0, ..., ttyS6 */
-+};
-+
-+static void __init cam60_map_io(void)
-+{
-+	/* Initialize processor: 10 MHz crystal */
-+	at91sam9260_initialize(10000000);
-+
-+	/* Setup the serial ports and console */
-+	at91_init_serial(&cam60_uart_config);
-+}
-+
-+static void __init cam60_init_irq(void)
-+{
-+	at91sam9260_init_interrupts(NULL);
-+}
-+
-+
-+/*
-+ * SPI devices.
-+ */
-+#if defined(CONFIG_MTD_DATAFLASH)
-+static struct mtd_partition __initdata cam60_spi_partitions[] = {
-+	{
-+		.name	= "BOOT1",
-+		.offset	= 0,
-+		.size	= 4 * 1056,
-+	},
-+	{
-+		.name	= "BOOT2",
-+		.offset	= MTDPART_OFS_NXTBLK,
-+		.size	= 256 * 1056,
-+	},
-+	{
-+		.name	= "kernel",
-+		.offset	= MTDPART_OFS_NXTBLK,
-+		.size	= 2222 * 1056,
-+	},
-+	{
-+		.name	= "file system",
-+		.offset	= MTDPART_OFS_NXTBLK,
-+		.size	= MTDPART_SIZ_FULL,
-+	},
-+};
-+
-+static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
-+	.name		= "spi_flash",
-+	.parts		= cam60_spi_partitions,
-+	.nr_parts	= ARRAY_SIZE(cam60_spi_partitions)
-+};
-+#endif
-+
-+static struct spi_board_info cam60_spi_devices[] = {
-+#if defined(CONFIG_MTD_DATAFLASH)
-+	{	/* DataFlash chip */
-+		.modalias	= "mtd_dataflash",
-+		.chip_select	= 0,
-+		.max_speed_hz	= 15 * 1000 * 1000,
-+		.bus_num	= 0,
-+		.platform_data	= &cam60_spi_flash_platform_data
-+	},
-+#endif
-+};
-+
-+
-+/*
-+ * MACB Ethernet device
-+ */
-+static struct __initdata at91_eth_data cam60_macb_data = {
-+	.phy_irq_pin	= AT91_PIN_PB5,
-+	.is_rmii	= 0,
-+};
-+
-+
-+static void __init cam60_board_init(void)
-+{
-+	/* Serial */
-+	at91_add_device_serial();
-+	/* SPI */
-+	at91_add_device_spi(cam60_spi_devices, ARRAY_SIZE(cam60_spi_devices));
-+	/* Ethernet */
-+	at91_add_device_eth(&cam60_macb_data);
-+}
-+
-+MACHINE_START(CAM60, "KwikByte CAM60")
-+	/* Maintainer: KwikByte */
-+	.phys_io	= AT91_BASE_SYS,
-+	.io_pg_offst	= (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-+	.boot_params	= AT91_SDRAM_BASE + 0x100,
-+	.timer		= &at91sam926x_timer,
-+	.map_io		= cam60_map_io,
-+	.init_irq	= cam60_init_irq,
-+	.init_machine	= cam60_board_init,
-+MACHINE_END
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-chub.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-chub.c
-@@ -0,0 +1,132 @@
-+/*
-+ * linux/arch/arm/mach-at91/board-chub.c
-+ *
-+ *  Copyright (C) 2005 SAN People, adapted for Promwad Chub board
-+ *  by Kuten Ivan
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/mm.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+
-+#include <asm/hardware.h>
-+#include <asm/setup.h>
-+#include <asm/mach-types.h>
-+#include <asm/irq.h>
-+
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/mach/irq.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+
-+#include "generic.h"
-+
-+/*
-+ * Serial port configuration.
-+ *    0 .. 3 = USART0 .. USART3
-+ *    4      = DBGU
-+ */
-+static struct at91_uart_config __initdata chub_uart_config = {
-+	.console_tty	= 0,				/* ttyS0 */
-+	.nr_tty		= 5,
-+	.tty_map	= { 4, 0, 1, 2, 3 }		/* ttyS0, ..., ttyS4 */
-+};
-+
-+static void __init chub_init_irq(void)
-+{
-+	at91rm9200_init_interrupts(NULL);
-+}
-+
-+static void __init chub_map_io(void)
-+{
-+	/* Initialize clocks: 18.432 MHz crystal */
-+	at91rm9200_initialize(18432000, AT91RM9200_PQFP);
-+
-+	/* Setup the serial ports and console */
-+	at91_init_serial(&chub_uart_config);
-+}
-+
-+static struct at91_eth_data __initdata chub_eth_data = {
-+	.phy_irq_pin	= AT91_PIN_PB29,
-+	.is_rmii	= 0,
-+};
-+
-+static struct mtd_partition __initdata chub_nand_partition[] = {
-+	{
-+		.name	= "NAND Partition 1",
-+		.offset = 0,
-+		.size	= MTDPART_SIZ_FULL,
-+	},
-+};
-+
-+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
-+{
-+	*num_partitions = ARRAY_SIZE(chub_nand_partition);
-+	return chub_nand_partition;
-+}
-+
-+static struct at91_nand_data __initdata chub_nand_data = {
-+	.ale		= 22,
-+	.cle		= 21,
-+	.enable_pin	= AT91_PIN_PA27,
-+	.partition_info	= nand_partitions,
-+};
-+
-+static struct spi_board_info chub_spi_devices[] = {
-+	{	/* DataFlash chip */
-+		.modalias	= "mtd_dataflash",
-+		.chip_select	= 0,
-+		.max_speed_hz	= 15 * 1000 * 1000,
-+	},
-+};
-+
-+static void __init chub_board_init(void)
-+{
-+	/* Serial */
-+	at91_add_device_serial();
-+	/* I2C */
-+	at91_add_device_i2c();
-+	/* Ethernet */
-+	at91_add_device_eth(&chub_eth_data);
-+	/* SPI */
-+	at91_add_device_spi(chub_spi_devices, ARRAY_SIZE(chub_spi_devices));
-+	/* NAND Flash */
-+	at91_add_device_nand(&chub_nand_data);
-+	/* Disable write protect for NAND */
-+	at91_set_gpio_output(AT91_PIN_PB7, 1);
-+	/* Power enable for 3x RS-232 and 1x RS-485 */
-+	at91_set_gpio_output(AT91_PIN_PB9, 1);
-+	/* Disable write protect for FRAM */
-+	at91_set_gpio_output(AT91_PIN_PA21, 1);
-+	/* Disable write protect for Dataflash */
-+	at91_set_gpio_output(AT91_PIN_PA19, 1);
-+}
-+
-+MACHINE_START(CHUB, "Promwad Chub")
-+	/* Maintainer: Ivan Kuten AT Promwad DOT com */
-+	.phys_io	= AT91_BASE_SYS,
-+	.io_pg_offst	= (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-+	.boot_params	= AT91_SDRAM_BASE + 0x100,
-+	.timer		= &at91rm9200_timer,
-+	.map_io		= chub_map_io,
-+	.init_irq	= chub_init_irq,
-+	.init_machine	= chub_board_init,
-+MACHINE_END
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-csb337.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-csb337.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-csb337.c
-@@ -24,6 +24,7 @@
- #include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/spi/spi.h>
-+#include <linux/interrupt.h>
- #include <linux/mtd/physmap.h>
- 
- #include <asm/hardware.h>
-@@ -59,6 +60,7 @@ static void __init csb337_map_io(void)
- 
- 	/* Setup the LEDs */
- 	at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
-+	at91_set_gpio_output(AT91_PIN_PB2, 1);		/* third (unused) LED */
- 
- 	/* Setup the serial ports and console */
- 	at91_init_serial(&csb337_uart_config);
-@@ -149,6 +151,55 @@ static struct platform_device csb_flash 
- 	.num_resources	= ARRAY_SIZE(csb_flash_resources),
- };
- 
-+static struct at91_gpio_led csb337_leds[] = {
-+	{
-+		.name		= "led0",
-+		.gpio		= AT91_PIN_PB0,
-+		.trigger	= "heartbeat",
-+	},
-+	{
-+		.name		= "led1",
-+		.gpio		= AT91_PIN_PB1,
-+		.trigger	= "timer",
-+	},
-+	{
-+		.name		= "led2",
-+		.gpio		= AT91_PIN_PB2,
-+	}
-+};
-+
-+#if defined(CONFIG_CSB300_WAKE_SW0) || defined(CONFIG_CSB300_WAKE_SW1)
-+static irqreturn_t switch_irq_handler(int irq, void *context)
-+{
-+	return IRQ_HANDLED;
-+}
-+
-+static inline void __init switch_irq_setup(int irq, char *name, unsigned long mode)
-+{
-+	int res;
-+
-+	res = request_irq(irq, switch_irq_handler, IRQF_SAMPLE_RANDOM | mode, name, NULL);
-+	if (res == 0)
-+		enable_irq_wake(irq);
-+}
-+
-+static void __init csb300_switches(void)
-+{
-+#ifdef CONFIG_CSB300_WAKE_SW0
-+	at91_set_A_periph(AT91_PIN_PB29, 1);		/* IRQ0 */
-+	switch_irq_setup(AT91RM9200_ID_IRQ0, "csb300_sw0", IRQF_TRIGGER_FALLING);
-+#endif
-+#ifdef CONFIG_CSB300_WAKE_SW1
-+	at91_set_gpio_input(AT91_PIN_PB28, 1);
-+	at91_set_deglitch(AT91_PIN_PB28, 1);
-+	switch_irq_setup(AT91_PIN_PB28, "csb300_sw1", IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING);
-+#endif
-+	/* there's also SW2 at PA21, GPIO or TIOA2 */
-+}
-+#else
-+static void __init csb300_switches(void) {}
-+#endif
-+
- static void __init csb337_board_init(void)
- {
- 	/* Serial */
-@@ -168,8 +219,12 @@ static void __init csb337_board_init(voi
- 	at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
- 	/* MMC */
- 	at91_add_device_mmc(0, &csb337_mmc_data);
-+	/* LEDS */
-+	at91_gpio_leds(csb337_leds, ARRAY_SIZE(csb337_leds));
- 	/* NOR flash */
- 	platform_device_register(&csb_flash);
-+	/* Switches on CSB300 */
-+	csb300_switches();
- }
- 
- MACHINE_START(CSB337, "Cogent CSB337")
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-dk.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-dk.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-dk.c
-@@ -73,6 +73,185 @@ static void __init dk_init_irq(void)
- 	at91rm9200_init_interrupts(NULL);
- }
- 
-+#if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE)
-+#include <video/s1d13xxxfb.h>
-+#include <asm/arch/ics1523.h>
-+
-+/* EPSON S1D13806 FB */
-+#define AT91_FB_REG_BASE	0x30000000L
-+#define AT91_FB_REG_SIZE	0x200
-+#define AT91_FB_VMEM_BASE	0x30200000L
-+#define AT91_FB_VMEM_SIZE	0x140000L
-+
-+static void __init dk_init_video(void)
-+{
-+	/* NWAIT Signal */
-+	at91_set_A_periph(AT91_PIN_PC6, 0);
-+
-+	/* Initialization of the Static Memory Controller for Chip Select 2 */
-+	at91_sys_write(AT91_SMC_CSR(2), AT91_SMC_DBW_16			/* 16 bit */
-+				| AT91_SMC_WSEN | AT91_SMC_NWS_(4)	/* wait states */
-+				| AT91_SMC_TDF_(1)			/* float time */
-+	);
-+
-+	at91_ics1523_init();
-+}
-+
-+/* CRT:    (active)   640x480 60Hz (PCLK=CLKI=25.175MHz)
-+   Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=60.000MHz) */
-+static const struct s1d13xxxfb_regval dk_s1dfb_initregs[] = {
-+	{S1DREG_MISC,			0x00},	/* Enable Memory/Register select bit */
-+	{S1DREG_COM_DISP_MODE,		0x00},	/* disable display output */
-+	{S1DREG_GPIO_CNF0,		0x00},
-+	{S1DREG_GPIO_CNF1,		0x00},
-+	{S1DREG_GPIO_CTL0,		0x08},
-+	{S1DREG_GPIO_CTL1,		0x00},
-+	{S1DREG_CLK_CNF,		0x01},	/* no divide, MCLK source is CLKI3 0x02*/
-+	{S1DREG_LCD_CLK_CNF,		0x00},
-+	{S1DREG_CRT_CLK_CNF,		0x00},
-+	{S1DREG_MPLUG_CLK_CNF,		0x00},
-+	{S1DREG_CPU2MEM_WST_SEL,	0x01},	/* 2*period(MCLK) - 4ns > period(BCLK) */
-+	{S1DREG_SDRAM_REF_RATE,		0x03},	/* 32768 <= MCLK <= 50000 (MHz) */
-+	{S1DREG_SDRAM_TC0,		0x00},	/* MCLK source freq (MHz): */
-+	{S1DREG_SDRAM_TC1,		0x01},	/* 42 <= MCLK <= 50 */
-+	{S1DREG_MEM_CNF,		0x80},	/* SDRAM Initialization - needed before mem access */
-+	{S1DREG_PANEL_TYPE,		0x25},	/* std TFT 16bit, 8bit SCP format 2, single passive LCD */
-+	{S1DREG_MOD_RATE,		0x00},	/* toggle every FPFRAME */
-+	{S1DREG_LCD_DISP_HWIDTH,	0x4F},	/* 680 pix */
-+	{S1DREG_LCD_NDISP_HPER,		0x12},	/* 152 pix */
-+	{S1DREG_TFT_FPLINE_START,	0x01},	/* 13 pix */
-+	{S1DREG_TFT_FPLINE_PWIDTH,	0x0B},	/* 96 pix */
-+	{S1DREG_LCD_DISP_VHEIGHT0,	0xDF},
-+	{S1DREG_LCD_DISP_VHEIGHT1,	0x01},	/* 480 lines */
-+	{S1DREG_LCD_NDISP_VPER,		0x2C},	/* 44 lines */
-+	{S1DREG_TFT_FPFRAME_START,	0x0A},	/* 10 lines */
-+	{S1DREG_TFT_FPFRAME_PWIDTH,	0x01},	/* 2 lines */
-+	{S1DREG_LCD_DISP_MODE,		0x05},  /* 16 bpp */
-+	{S1DREG_LCD_MISC,		0x00},	/* dithering enabled, dual panel buffer enabled */
-+	{S1DREG_LCD_DISP_START0,	0x00},
-+	{S1DREG_LCD_DISP_START1,	0xC8},
-+	{S1DREG_LCD_DISP_START2,	0x00},
-+	{S1DREG_LCD_MEM_OFF0,		0x80},
-+	{S1DREG_LCD_MEM_OFF1,		0x02},
-+	{S1DREG_LCD_PIX_PAN,		0x00},
-+	{S1DREG_LCD_DISP_FIFO_HTC,	0x3B},
-+	{S1DREG_LCD_DISP_FIFO_LTC,	0x3C},
-+	{S1DREG_CRT_DISP_HWIDTH,	0x4F},	/* 680 pix */
-+	{S1DREG_CRT_NDISP_HPER,		0x13},	/* 160 pix */
-+	{S1DREG_CRT_HRTC_START,		0x01},	/* 13 pix */
-+	{S1DREG_CRT_HRTC_PWIDTH,	0x0B},	/* 96 pix */
-+	{S1DREG_CRT_DISP_VHEIGHT0,	0xDF},
-+	{S1DREG_CRT_DISP_VHEIGHT1,	0x01},	/* 480 lines */
-+	{S1DREG_CRT_NDISP_VPER,		0x2B},	/* 44 lines */
-+	{S1DREG_CRT_VRTC_START,		0x09},	/* 10 lines */
-+	{S1DREG_CRT_VRTC_PWIDTH,	0x01},	/* 2 lines */
-+	{S1DREG_TV_OUT_CTL,		0x10},
-+	{S1DREG_CRT_DISP_MODE,		0x05},	/* 16 bpp */
-+	{S1DREG_CRT_DISP_START0,	0x00},
-+	{S1DREG_CRT_DISP_START1,	0x00},
-+	{S1DREG_CRT_DISP_START2,	0x00},
-+	{S1DREG_CRT_MEM_OFF0,		0x80},
-+	{S1DREG_CRT_MEM_OFF1,		0x02},
-+	{S1DREG_CRT_PIX_PAN,		0x00},
-+	{S1DREG_CRT_DISP_FIFO_HTC,	0x3B},
-+	{S1DREG_CRT_DISP_FIFO_LTC,	0x3C},
-+	{S1DREG_LCD_CUR_CTL,		0x00},	/* inactive */
-+	{S1DREG_LCD_CUR_START,		0x01},
-+	{S1DREG_LCD_CUR_XPOS0,		0x00},
-+	{S1DREG_LCD_CUR_XPOS1,		0x00},
-+	{S1DREG_LCD_CUR_YPOS0,		0x00},
-+	{S1DREG_LCD_CUR_YPOS1,		0x00},
-+	{S1DREG_LCD_CUR_BCTL0,		0x00},
-+	{S1DREG_LCD_CUR_GCTL0,		0x00},
-+	{S1DREG_LCD_CUR_RCTL0,		0x00},
-+	{S1DREG_LCD_CUR_BCTL1,		0x1F},
-+	{S1DREG_LCD_CUR_GCTL1,		0x3F},
-+	{S1DREG_LCD_CUR_RCTL1,		0x1F},
-+	{S1DREG_LCD_CUR_FIFO_HTC,	0x00},
-+	{S1DREG_CRT_CUR_CTL,		0x00},	/* inactive */
-+	{S1DREG_CRT_CUR_START,		0x01},
-+	{S1DREG_CRT_CUR_XPOS0,		0x00},
-+	{S1DREG_CRT_CUR_XPOS1,		0x00},
-+	{S1DREG_CRT_CUR_YPOS0,		0x00},
-+	{S1DREG_CRT_CUR_YPOS1,		0x00},
-+	{S1DREG_CRT_CUR_BCTL0,		0x00},
-+	{S1DREG_CRT_CUR_GCTL0,		0x00},
-+	{S1DREG_CRT_CUR_RCTL0,		0x00},
-+	{S1DREG_CRT_CUR_BCTL1,		0x1F},
-+	{S1DREG_CRT_CUR_GCTL1,		0x3F},
-+	{S1DREG_CRT_CUR_RCTL1,		0x1F},
-+	{S1DREG_CRT_CUR_FIFO_HTC,	0x00},
-+	{S1DREG_BBLT_CTL0,		0x00},
-+	{S1DREG_BBLT_CTL0,		0x00},
-+	{S1DREG_BBLT_CC_EXP,		0x00},
-+	{S1DREG_BBLT_OP,		0x00},
-+	{S1DREG_BBLT_SRC_START0,	0x00},
-+	{S1DREG_BBLT_SRC_START1,	0x00},
-+	{S1DREG_BBLT_SRC_START2,	0x00},
-+	{S1DREG_BBLT_DST_START0,	0x00},
-+	{S1DREG_BBLT_DST_START1,	0x00},
-+	{S1DREG_BBLT_DST_START2,	0x00},
-+	{S1DREG_BBLT_MEM_OFF0,		0x00},
-+	{S1DREG_BBLT_MEM_OFF1,		0x00},
-+	{S1DREG_BBLT_WIDTH0,		0x00},
-+	{S1DREG_BBLT_WIDTH1,		0x00},
-+	{S1DREG_BBLT_HEIGHT0,		0x00},
-+	{S1DREG_BBLT_HEIGHT1,		0x00},
-+	{S1DREG_BBLT_BGC0,		0x00},
-+	{S1DREG_BBLT_BGC1,		0x00},
-+	{S1DREG_BBLT_FGC0,		0x00},
-+	{S1DREG_BBLT_FGC1,		0x00},
-+	{S1DREG_LKUP_MODE,		0x00},	/* LCD LUT r | LCD and CRT/TV LUT w */
-+	{S1DREG_LKUP_ADDR,		0x00},
-+	{S1DREG_PS_CNF,			0x00},	/* Power Save disable */
-+	{S1DREG_PS_STATUS,		0x02},	/* LCD Panel down, mem up */
-+	{S1DREG_CPU2MEM_WDOGT,		0x00},
-+	{S1DREG_COM_DISP_MODE,		0x02},	/* enable CRT display output */
-+};
-+
-+static struct s1d13xxxfb_pdata dk_s1dfb_pdata = {
-+	.initregs		= dk_s1dfb_initregs,
-+	.initregssize		= ARRAY_SIZE(dk_s1dfb_initregs),
-+	.platform_init_video	= dk_init_video,
-+};
-+
-+static u64 s1dfb_dmamask = 0xffffffffUL;
-+
-+static struct resource dk_s1dfb_resource[] = {
-+	[0] = {	/* video mem */
-+		.name   = "s1d13806 memory",
-+		.start  = AT91_FB_VMEM_BASE,
-+		.end    = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1,
-+		.flags  = IORESOURCE_MEM,
-+	},
-+	[1] = {	/* video registers */
-+		.name   = "s1d13806 registers",
-+		.start  = AT91_FB_REG_BASE,
-+		.end    = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1,
-+		.flags  = IORESOURCE_MEM,
-+	},
-+};
-+
-+static struct platform_device dk_s1dfb_device = {
-+	.name		= "s1d13806fb",
-+	.id		= -1,
-+	.dev		= {
-+			.dma_mask		= &s1dfb_dmamask,
-+			.coherent_dma_mask	= 0xffffffff,
-+			.platform_data		= &dk_s1dfb_pdata,
-+	},
-+	.resource	= dk_s1dfb_resource,
-+	.num_resources	= ARRAY_SIZE(dk_s1dfb_resource),
-+};
-+
-+static void __init dk_add_device_video(void)
-+{
-+	platform_device_register(&dk_s1dfb_device);
-+}
-+#else
-+static void __init dk_add_device_video(void) {}
-+#endif
-+
- static struct at91_eth_data __initdata dk_eth_data = {
- 	.phy_irq_pin	= AT91_PIN_PC4,
- 	.is_rmii	= 1,
-@@ -151,7 +330,7 @@ static struct at91_nand_data __initdata 
- #define DK_FLASH_SIZE	0x200000
- 
- static struct physmap_flash_data dk_flash_data = {
--	.width	= 2,
-+	.width		= 2,
- };
- 
- static struct resource dk_flash_resource = {
-@@ -170,6 +349,13 @@ static struct platform_device dk_flash =
- 	.num_resources	= 1,
- };
- 
-+static struct at91_gpio_led dk_leds[] = {
-+	{
-+		.name		= "led0",
-+		.gpio		= AT91_PIN_PB2,
-+		.trigger	= "timer",
-+	}
-+};
- 
- static void __init dk_board_init(void)
- {
-@@ -200,8 +386,10 @@ static void __init dk_board_init(void)
- 	at91_add_device_nand(&dk_nand_data);
- 	/* NOR Flash */
- 	platform_device_register(&dk_flash);
-+	/* LEDs */
-+	at91_gpio_leds(dk_leds, ARRAY_SIZE(dk_leds));
- 	/* VGA */
--//	dk_add_device_video();
-+	dk_add_device_video();
- }
- 
- MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-ek.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-ek.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-ek.c
-@@ -73,6 +73,187 @@ static void __init ek_init_irq(void)
- 	at91rm9200_init_interrupts(NULL);
- }
- 
-+#if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE)
-+#include <video/s1d13xxxfb.h>
-+#include <asm/arch/ics1523.h>
-+
-+/* EPSON S1D13806 FB */
-+#define AT91_FB_REG_BASE	0x40000000L
-+#define	AT91_FB_REG_SIZE	0x200
-+#define AT91_FB_VMEM_BASE	0x40200000L
-+#define AT91_FB_VMEM_SIZE	0x140000L
-+
-+static void __init ek_init_video(void)
-+{
-+	/* NWAIT Signal */
-+	at91_set_A_periph(AT91_PIN_PC6, 0);
-+
-+	/* Initialization of the Static Memory Controller for Chip Select 3 */
-+	at91_sys_write(AT91_SMC_CSR(3), AT91_SMC_DBW_16			/* 16 bit */
-+				| AT91_SMC_WSEN | AT91_SMC_NWS_(5)	/* wait states */
-+				| AT91_SMC_TDF_(1)			/* float time */
-+	);
-+
-+	at91_ics1523_init();
-+}
-+
-+/* CRT:    (active)   640x480 60Hz (PCLK=CLKI=25.175MHz)
-+   Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=60.000MHz) */
-+static const struct s1d13xxxfb_regval ek_s1dfb_initregs[] = {
-+	{S1DREG_MISC,			0x00},	/* Enable Memory/Register select bit */
-+	{S1DREG_COM_DISP_MODE,		0x00},	/* disable display output */
-+	{S1DREG_GPIO_CNF0,		0xFF},	// 0x00
-+	{S1DREG_GPIO_CNF1,		0x1F},	// 0x08
-+	{S1DREG_GPIO_CTL0,		0x00},
-+	{S1DREG_GPIO_CTL1,		0x00},
-+	{S1DREG_CLK_CNF,		0x01},	/* no divide, MCLK source is CLKI3 0x02*/
-+	{S1DREG_LCD_CLK_CNF,		0x00},
-+	{S1DREG_CRT_CLK_CNF,		0x00},
-+	{S1DREG_MPLUG_CLK_CNF,		0x00},
-+	{S1DREG_CPU2MEM_WST_SEL,	0x01},	/* 2*period(MCLK) - 4ns > period(BCLK) */
-+	{S1DREG_SDRAM_REF_RATE,		0x03},	/* 32768 <= MCLK <= 50000 (MHz) */
-+	{S1DREG_SDRAM_TC0,		0x00},	/* MCLK source freq (MHz): */
-+	{S1DREG_SDRAM_TC1,		0x01},	/* 42 <= MCLK <= 50 */
-+	{S1DREG_MEM_CNF,		0x80},	/* SDRAM Initialization - needed before mem access */
-+	{S1DREG_PANEL_TYPE,		0x25},	/* std TFT 16bit, 8bit SCP format 2, single passive LCD */
-+	{S1DREG_MOD_RATE,		0x00},	/* toggle every FPFRAME */
-+	{S1DREG_LCD_DISP_HWIDTH,	0x4F},	/* 680 pix */
-+	{S1DREG_LCD_NDISP_HPER,		0x12},	/* 152 pix */
-+	{S1DREG_TFT_FPLINE_START,	0x01},	/* 13 pix */
-+	{S1DREG_TFT_FPLINE_PWIDTH,	0x0B},	/* 96 pix */
-+	{S1DREG_LCD_DISP_VHEIGHT0,	0xDF},
-+	{S1DREG_LCD_DISP_VHEIGHT1,	0x01},	/* 480 lines */
-+	{S1DREG_LCD_NDISP_VPER,		0x2C},	/* 44 lines */
-+	{S1DREG_TFT_FPFRAME_START,	0x0A},	/* 10 lines */
-+	{S1DREG_TFT_FPFRAME_PWIDTH,	0x01},	/* 2 lines */
-+	{S1DREG_LCD_DISP_MODE,		0x05},  /* 16 bpp */
-+	{S1DREG_LCD_MISC,		0x00},	/* dithering enabled, dual panel buffer enabled */
-+	{S1DREG_LCD_DISP_START0,	0x00},
-+	{S1DREG_LCD_DISP_START1,	0xC8},
-+	{S1DREG_LCD_DISP_START2,	0x00},
-+	{S1DREG_LCD_MEM_OFF0,		0x80},
-+	{S1DREG_LCD_MEM_OFF1,		0x02},
-+	{S1DREG_LCD_PIX_PAN,		0x00},
-+	{S1DREG_LCD_DISP_FIFO_HTC,	0x3B},
-+	{S1DREG_LCD_DISP_FIFO_LTC,	0x3C},
-+	{S1DREG_CRT_DISP_HWIDTH,	0x4F},	/* 680 pix */
-+	{S1DREG_CRT_NDISP_HPER,		0x13},	/* 160 pix */
-+	{S1DREG_CRT_HRTC_START,		0x01},	/* 13 pix */
-+	{S1DREG_CRT_HRTC_PWIDTH,	0x0B},	/* 96 pix */
-+	{S1DREG_CRT_DISP_VHEIGHT0,	0xDF},
-+	{S1DREG_CRT_DISP_VHEIGHT1,	0x01},	/* 480 lines */
-+	{S1DREG_CRT_NDISP_VPER,		0x2B},	/* 44 lines */
-+	{S1DREG_CRT_VRTC_START,		0x09},	/* 10 lines */
-+	{S1DREG_CRT_VRTC_PWIDTH,	0x01},	/* 2 lines */
-+	{S1DREG_TV_OUT_CTL,		0x10},
-+	{0x005E,			0x9F},
-+	{0x005F,			0x00},
-+	{S1DREG_CRT_DISP_MODE,		0x05},	/* 16 bpp */
-+	{S1DREG_CRT_DISP_START0,	0x00},
-+	{S1DREG_CRT_DISP_START1,	0x00},
-+	{S1DREG_CRT_DISP_START2,	0x00},
-+	{S1DREG_CRT_MEM_OFF0,		0x80},
-+	{S1DREG_CRT_MEM_OFF1,		0x02},
-+	{S1DREG_CRT_PIX_PAN,		0x00},
-+	{S1DREG_CRT_DISP_FIFO_HTC,	0x3B},
-+	{S1DREG_CRT_DISP_FIFO_LTC,	0x3C},
-+	{S1DREG_LCD_CUR_CTL,		0x00},	/* inactive */
-+	{S1DREG_LCD_CUR_START,		0x01},
-+	{S1DREG_LCD_CUR_XPOS0,		0x00},
-+	{S1DREG_LCD_CUR_XPOS1,		0x00},
-+	{S1DREG_LCD_CUR_YPOS0,		0x00},
-+	{S1DREG_LCD_CUR_YPOS1,		0x00},
-+	{S1DREG_LCD_CUR_BCTL0,		0x00},
-+	{S1DREG_LCD_CUR_GCTL0,		0x00},
-+	{S1DREG_LCD_CUR_RCTL0,		0x00},
-+	{S1DREG_LCD_CUR_BCTL1,		0x1F},
-+	{S1DREG_LCD_CUR_GCTL1,		0x3F},
-+	{S1DREG_LCD_CUR_RCTL1,		0x1F},
-+	{S1DREG_LCD_CUR_FIFO_HTC,	0x00},
-+	{S1DREG_CRT_CUR_CTL,		0x00},	/* inactive */
-+	{S1DREG_CRT_CUR_START,		0x01},
-+	{S1DREG_CRT_CUR_XPOS0,		0x00},
-+	{S1DREG_CRT_CUR_XPOS1,		0x00},
-+	{S1DREG_CRT_CUR_YPOS0,		0x00},
-+	{S1DREG_CRT_CUR_YPOS1,		0x00},
-+	{S1DREG_CRT_CUR_BCTL0,		0x00},
-+	{S1DREG_CRT_CUR_GCTL0,		0x00},
-+	{S1DREG_CRT_CUR_RCTL0,		0x00},
-+	{S1DREG_CRT_CUR_BCTL1,		0x1F},
-+	{S1DREG_CRT_CUR_GCTL1,		0x3F},
-+	{S1DREG_CRT_CUR_RCTL1,		0x1F},
-+	{S1DREG_CRT_CUR_FIFO_HTC,	0x00},
-+	{S1DREG_BBLT_CTL0,		0x00},
-+	{S1DREG_BBLT_CTL0,		0x00},
-+	{S1DREG_BBLT_CC_EXP,		0x00},
-+	{S1DREG_BBLT_OP,		0x00},
-+	{S1DREG_BBLT_SRC_START0,	0x00},
-+	{S1DREG_BBLT_SRC_START1,	0x00},
-+	{S1DREG_BBLT_SRC_START2,	0x00},
-+	{S1DREG_BBLT_DST_START0,	0x00},
-+	{S1DREG_BBLT_DST_START1,	0x00},
-+	{S1DREG_BBLT_DST_START2,	0x00},
-+	{S1DREG_BBLT_MEM_OFF0,		0x00},
-+	{S1DREG_BBLT_MEM_OFF1,		0x00},
-+	{S1DREG_BBLT_WIDTH0,		0x00},
-+	{S1DREG_BBLT_WIDTH1,		0x00},
-+	{S1DREG_BBLT_HEIGHT0,		0x00},
-+	{S1DREG_BBLT_HEIGHT1,		0x00},
-+	{S1DREG_BBLT_BGC0,		0x00},
-+	{S1DREG_BBLT_BGC1,		0x00},
-+	{S1DREG_BBLT_FGC0,		0x00},
-+	{S1DREG_BBLT_FGC1,		0x00},
-+	{S1DREG_LKUP_MODE,		0x00},	/* LCD LUT r | LCD and CRT/TV LUT w */
-+	{S1DREG_LKUP_ADDR,		0x00},
-+	{S1DREG_PS_CNF,			0x10},	/* Power Save disable */
-+	{S1DREG_PS_STATUS,		0x02},	/* LCD Panel down, mem up */
-+	{S1DREG_CPU2MEM_WDOGT,		0x00},
-+	{S1DREG_COM_DISP_MODE,		0x02},	/* enable CRT display output */
-+};
-+
-+static struct s1d13xxxfb_pdata ek_s1dfb_pdata = {
-+	.initregs		= ek_s1dfb_initregs,
-+	.initregssize		= ARRAY_SIZE(ek_s1dfb_initregs),
-+	.platform_init_video	= ek_init_video,
-+};
-+
-+static u64 s1dfb_dmamask = 0xffffffffUL;
-+
-+static struct resource ek_s1dfb_resource[] = {
-+	[0] = {	/* video mem */
-+		.name   = "s1d13806 memory",
-+		.start  = AT91_FB_VMEM_BASE,
-+		.end    = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1,
-+		.flags  = IORESOURCE_MEM,
-+	},
-+	[1] = {	/* video registers */
-+		.name   = "s1d13806 registers",
-+		.start  = AT91_FB_REG_BASE,
-+		.end    = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1,
-+		.flags  = IORESOURCE_MEM,
-+	},
-+};
-+
-+static struct platform_device ek_s1dfb_device = {
-+	.name		= "s1d13806fb",
-+	.id		= -1,
-+	.dev		= {
-+			.dma_mask		= &s1dfb_dmamask,
-+			.coherent_dma_mask	= 0xffffffff,
-+			.platform_data		= &ek_s1dfb_pdata,
-+	},
-+	.resource	= ek_s1dfb_resource,
-+	.num_resources	= ARRAY_SIZE(ek_s1dfb_resource),
-+};
-+
-+static void __init ek_add_device_video(void)
-+{
-+	platform_device_register(&ek_s1dfb_device);
-+}
-+#else
-+static void __init ek_add_device_video(void) {}
-+#endif
-+
- static struct at91_eth_data __initdata ek_eth_data = {
- 	.phy_irq_pin	= AT91_PIN_PC4,
- 	.is_rmii	= 1,
-@@ -113,7 +294,7 @@ static struct spi_board_info ek_spi_devi
- #define EK_FLASH_SIZE	0x200000
- 
- static struct physmap_flash_data ek_flash_data = {
--	.width	= 2,
-+	.width		= 2,
- };
- 
- static struct resource ek_flash_resource = {
-@@ -132,6 +313,18 @@ static struct platform_device ek_flash =
- 	.num_resources	= 1,
- };
- 
-+static struct at91_gpio_led ek_leds[] = {
-+	{
-+		.name		= "led0",
-+		.gpio		= AT91_PIN_PB1,
-+		.trigger	= "heartbeat",
-+	},
-+	{
-+		.name		= "led1",
-+		.gpio		= AT91_PIN_PB2,
-+		.trigger	= "timer",
-+	}
-+};
- 
- static void __init ek_board_init(void)
- {
-@@ -158,8 +351,10 @@ static void __init ek_board_init(void)
- #endif
- 	/* NOR Flash */
- 	platform_device_register(&ek_flash);
-+	/* LEDs */
-+	at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
- 	/* VGA */
--//	ek_add_device_video();
-+	ek_add_device_video();
- }
- 
- MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-kb9202.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-kb9202.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-kb9202.c
-@@ -37,6 +37,8 @@
- #include <asm/arch/board.h>
- #include <asm/arch/gpio.h>
- 
-+#include <asm/arch/at91rm9200_mc.h>
-+
- #include "generic.h"
- 
- 
-@@ -111,6 +113,48 @@ static struct at91_nand_data __initdata 
- 	.partition_info	= nand_partitions,
- };
- 
-+
-+#if defined(CONFIG_FB_S1D15605)
-+#warning "Rather pass reset pin via platform_data"
-+static struct resource kb9202_lcd_resources[] = {
-+	[0] = {
-+		.start	= AT91_CHIPSELECT_2,
-+		.end	= AT91_CHIPSELECT_2 + 0x200FF,
-+		.flags	= IORESOURCE_MEM
-+	},
-+	[1] = {	/* reset pin */
-+		.start	= AT91_PIN_PC22,
-+		.end	= AT91_PIN_PC22,
-+		.flags	= IORESOURCE_MEM
-+	},
-+};
-+
-+static struct platform_device kb9202_lcd_device = {
-+	.name		= "s1d15605fb",
-+	.id		= 0,
-+	.num_resources	= ARRAY_SIZE(kb9202_lcd_resources),
-+	.resource	= kb9202_lcd_resources,
-+};
-+
-+static void __init kb9202_add_device_lcd(void)
-+{
-+ 	/* In case the boot loader did not set the chip select mode and timing */
-+	at91_sys_write(AT91_SMC_CSR(2),
-+		AT91_SMC_WSEN | AT91_SMC_NWS_(18) | AT91_SMC_TDF_(1) | AT91_SMC_DBW_8 |
-+		AT91_SMC_RWSETUP_(1) | AT91_SMC_RWHOLD_(1));
-+
-+	/* Backlight pin = output, off */
-+	at91_set_gpio_output(AT91_PIN_PC23, 0);
-+
-+	/* Reset pin = output, in reset */
-+	at91_set_gpio_output(AT91_PIN_PC22, 0);
-+
-+	platform_device_register(&kb9202_lcd_device);
-+}
-+#else
-+static void __init kb9202_add_device_lcd(void) {}
-+#endif
-+
- static void __init kb9202_board_init(void)
- {
- 	/* Serial */
-@@ -129,6 +173,8 @@ static void __init kb9202_board_init(voi
- 	at91_add_device_spi(NULL, 0);
- 	/* NAND */
- 	at91_add_device_nand(&kb9202_nand_data);
-+	/* LCD	*/
-+	kb9202_add_device_lcd();
- }
- 
- MACHINE_START(KB9200, "KB920x")
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-sam9260ek.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-sam9260ek.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-sam9260ek.c
-@@ -104,9 +104,9 @@ static struct spi_board_info ek_spi_devi
- 	},
- #endif
- #endif
--#if defined(CONFIG_SND_AT73C213)
-+#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
- 	{	/* AT73C213 DAC */
--		.modalias	= "snd_at73c213",
-+		.modalias	= "at73c213",
- 		.chip_select	= 0,
- 		.max_speed_hz	= 10 * 1000 * 1000,
- 		.bus_num	= 1,
-@@ -118,7 +118,7 @@ static struct spi_board_info ek_spi_devi
- /*
-  * MACB Ethernet device
-  */
--static struct __initdata at91_eth_data ek_macb_data = {
-+static struct at91_eth_data __initdata ek_macb_data = {
- 	.phy_irq_pin	= AT91_PIN_PA7,
- 	.is_rmii	= 1,
- };
-@@ -188,6 +188,8 @@ static void __init ek_board_init(void)
- 	at91_add_device_eth(&ek_macb_data);
- 	/* MMC */
- 	at91_add_device_mmc(0, &ek_mmc_data);
-+	/* I2C */
-+	at91_add_device_i2c();
- }
- 
- MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-sam9261ek.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-sam9261ek.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-sam9261ek.c
-@@ -25,7 +25,11 @@
- #include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/spi/spi.h>
-+#include <linux/spi/ads7846.h>
- #include <linux/dm9000.h>
-+#include <linux/fb.h>
-+
-+#include <video/atmel_lcdc.h>
- 
- #include <asm/hardware.h>
- #include <asm/setup.h>
-@@ -59,6 +63,9 @@ static void __init ek_map_io(void)
- 	/* Initialize processor: 18.432 MHz crystal */
- 	at91sam9261_initialize(18432000);
- 
-+	/* Setup the LEDs */
-+	at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
-+
- 	/* Setup the serial ports and console */
- 	at91_init_serial(&ek_uart_config);
- }
-@@ -195,6 +202,41 @@ static struct at91_nand_data __initdata 
- };
- 
- /*
-+ * ADS7846 Touchscreen
-+ */
-+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
-+
-+static int ads7843_pendown_state(void)
-+{
-+	return !at91_get_gpio_value(AT91_PIN_PC2);	/* Touchscreen PENIRQ */
-+}
-+
-+static struct ads7846_platform_data ads_info = {
-+	.model			= 7843,
-+	.x_min			= 150,
-+	.x_max			= 3830,
-+	.y_min			= 190,
-+	.y_max			= 3830,
-+	.vref_delay_usecs	= 100,
-+	.x_plate_ohms		= 450,
-+	.y_plate_ohms		= 250,
-+	.pressure_max		= 15000,
-+	.debounce_max		= 1,
-+	.debounce_rep		= 0,
-+	.debounce_tol		= (~0),
-+	.get_pendown_state	= ads7843_pendown_state,
-+};
-+
-+static void __init ek_add_device_ts(void)
-+{
-+	at91_set_B_periph(AT91_PIN_PC2, 1);	/* External IRQ0, with pullup */
-+	at91_set_gpio_input(AT91_PIN_PA11, 1);	/* Touchscreen BUSY signal */
-+}
-+#else
-+static void __init ek_add_device_ts(void) {}
-+#endif
-+
-+/*
-  * SPI devices
-  */
- static struct spi_board_info ek_spi_devices[] = {
-@@ -204,6 +246,17 @@ static struct spi_board_info ek_spi_devi
- 		.max_speed_hz	= 15 * 1000 * 1000,
- 		.bus_num	= 0,
- 	},
-+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
-+	{
-+		.modalias	= "ads7846",
-+		.chip_select	= 2,
-+		.max_speed_hz	= 125000 * 26,	/* (max sample rate @ 3V) * (cmd + data + overhead) */
-+		.bus_num	= 0,
-+		.platform_data	= &ads_info,
-+		.irq		= AT91SAM9261_ID_IRQ0,
-+		.controller_data = AT91_PIN_PA28,	/* CS pin */
-+	},
-+#endif
- #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
- 	{	/* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
- 		.modalias	= "mtd_dataflash",
-@@ -211,9 +264,9 @@ static struct spi_board_info ek_spi_devi
- 		.max_speed_hz	= 15 * 1000 * 1000,
- 		.bus_num	= 0,
- 	},
--#elif defined(CONFIG_SND_AT73C213)
-+#elif defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
- 	{	/* AT73C213 DAC */
--		.modalias	= "snd_at73c213",
-+		.modalias	= "at73c213",
- 		.chip_select	= 3,
- 		.max_speed_hz	= 10 * 1000 * 1000,
- 		.bus_num	= 0,
-@@ -222,6 +275,65 @@ static struct spi_board_info ek_spi_devi
- };
- 
- 
-+/*
-+ * LCD Controller
-+ */
-+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
-+static struct fb_videomode at91_tft_vga_modes[] = {
-+	{
-+	        .name           = "TX09D50VM1CCA @ 60",
-+		.refresh	= 60,
-+		.xres		= 240,		.yres		= 320,
-+		.pixclock	= KHZ2PICOS(4965),
-+
-+		.left_margin	= 1,		.right_margin	= 33,
-+		.upper_margin	= 1,		.lower_margin	= 0,
-+		.hsync_len	= 5,		.vsync_len	= 1,
-+
-+		.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-+		.vmode		= FB_VMODE_NONINTERLACED,
-+	},
-+};
-+
-+static struct fb_monspecs at91fb_default_monspecs = {
-+	.manufacturer	= "HIT",
-+	.monitor        = "TX09D50VM1CCA",
-+
-+	.modedb		= at91_tft_vga_modes,
-+	.modedb_len	= ARRAY_SIZE(at91_tft_vga_modes),
-+	.hfmin		= 15000,
-+	.hfmax		= 64000,
-+	.vfmin		= 50,
-+	.vfmax		= 150,
-+};
-+
-+#define AT91SAM9261_DEFAULT_LCDCON2 	(ATMEL_LCDC_MEMOR_LITTLE \
-+					| ATMEL_LCDC_DISTYPE_TFT    \
-+					| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
-+
-+static void at91_lcdc_power_control(int on)
-+{
-+	if (on)
-+		at91_set_gpio_value(AT91_PIN_PA12, 0);	/* power up */
-+	else
-+		at91_set_gpio_value(AT91_PIN_PA12, 1);	/* power down */
-+}
-+
-+/* Driver datas */
-+static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
-+	.default_bpp			= 16,
-+	.default_dmacon			= ATMEL_LCDC_DMAEN,
-+	.default_lcdcon2		= AT91SAM9261_DEFAULT_LCDCON2,
-+	.default_monspecs		= &at91fb_default_monspecs,
-+	.atmel_lcdfb_power_control	= at91_lcdc_power_control,
-+	.guard_time			= 1,
-+};
-+
-+#else
-+static struct atmel_lcdfb_info __initdata ek_lcdc_data;
-+#endif
-+
-+
- static void __init ek_board_init(void)
- {
- 	/* Serial */
-@@ -241,10 +353,14 @@ static void __init ek_board_init(void)
- #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
- 	/* SPI */
- 	at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
-+	/* Touchscreen */
-+	ek_add_device_ts();
- #else
- 	/* MMC */
- 	at91_add_device_mmc(0, &ek_mmc_data);
- #endif
-+	/* LCD Controller */
-+	at91_add_device_lcdc(&ek_lcdc_data);
- }
- 
- MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-sam9263ek.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-sam9263ek.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-sam9263ek.c
-@@ -25,6 +25,10 @@
- #include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/spi/spi.h>
-+#include <linux/spi/ads7846.h>
-+#include <linux/fb.h>
-+
-+#include <video/atmel_lcdc.h>
- 
- #include <asm/hardware.h>
- #include <asm/setup.h>
-@@ -86,6 +90,40 @@ static struct at91_udc_data __initdata e
- 
- 
- /*
-+ * ADS7846 Touchscreen
-+ */
-+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
-+static int ads7843_pendown_state(void)
-+{
-+	return !at91_get_gpio_value(AT91_PIN_PA15);	/* Touchscreen PENIRQ */
-+}
-+
-+static struct ads7846_platform_data ads_info = {
-+	.model			= 7843,
-+	.x_min			= 150,
-+	.x_max			= 3830,
-+	.y_min			= 190,
-+	.y_max			= 3830,
-+	.vref_delay_usecs	= 100,
-+	.x_plate_ohms		= 450,
-+	.y_plate_ohms		= 250,
-+	.pressure_max		= 15000,
-+	.debounce_max		= 1,
-+	.debounce_rep		= 0,
-+	.debounce_tol		= (~0),
-+	.get_pendown_state	= ads7843_pendown_state,
-+};
-+
-+static void __init ek_add_device_ts(void)
-+{
-+	at91_set_B_periph(AT91_PIN_PA15, 1);	/* External IRQ1, with pullup */
-+	at91_set_gpio_input(AT91_PIN_PA31, 1);	/* Touchscreen BUSY signal */
-+}
-+#else
-+static void __init ek_add_device_ts(void) {}
-+#endif
-+
-+/*
-  * SPI devices.
-  */
- static struct spi_board_info ek_spi_devices[] = {
-@@ -97,6 +135,16 @@ static struct spi_board_info ek_spi_devi
- 		.bus_num	= 0,
- 	},
- #endif
-+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
-+	{
-+		.modalias	= "ads7846",
-+		.chip_select	= 3,
-+		.max_speed_hz	= 125000 * 26,	/* (max sample rate @ 3V) * (cmd + data + overhead) */
-+		.bus_num	= 0,
-+		.platform_data	= &ads_info,
-+		.irq		= AT91SAM9263_ID_IRQ1,
-+	},
-+#endif
- };
- 
- 
-@@ -112,6 +160,14 @@ static struct at91_mmc_data __initdata e
- 
- 
- /*
-+ * MACB Ethernet device
-+ */
-+static struct at91_eth_data __initdata ek_macb_data = {
-+	.is_rmii	= 1,
-+};
-+
-+
-+/*
-  * NAND flash
-  */
- static struct mtd_partition __initdata ek_nand_partition[] = {
-@@ -148,6 +204,73 @@ static struct at91_nand_data __initdata 
- };
- 
- 
-+/*
-+ * LCD Controller
-+ */
-+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
-+static struct fb_videomode at91_tft_vga_modes[] = {
-+	{
-+	        .name           = "TX09D50VM1CCA @ 60",
-+		.refresh	= 60,
-+		.xres		= 240,		.yres		= 320,
-+		.pixclock	= KHZ2PICOS(4965),
-+
-+		.left_margin	= 1,		.right_margin	= 33,
-+		.upper_margin	= 1,		.lower_margin	= 0,
-+		.hsync_len	= 5,		.vsync_len	= 1,
-+
-+		.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-+		.vmode		= FB_VMODE_NONINTERLACED,
-+	},
-+};
-+
-+static struct fb_monspecs at91fb_default_monspecs = {
-+	.manufacturer	= "HIT",
-+	.monitor        = "TX09D70VM1CCA",
-+
-+	.modedb		= at91_tft_vga_modes,
-+	.modedb_len	= ARRAY_SIZE(at91_tft_vga_modes),
-+	.hfmin		= 15000,
-+	.hfmax		= 64000,
-+	.vfmin		= 50,
-+	.vfmax		= 150,
-+};
-+
-+#define AT91SAM9263_DEFAULT_LCDCON2 	(ATMEL_LCDC_MEMOR_LITTLE \
-+					| ATMEL_LCDC_DISTYPE_TFT    \
-+					| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
-+
-+static void at91_lcdc_power_control(int on)
-+{
-+	if (on)
-+		at91_set_gpio_value(AT91_PIN_PD12, 0);	/* power up */
-+	else
-+		at91_set_gpio_value(AT91_PIN_PD12, 1);	/* power down */
-+}
-+
-+/* Driver datas */
-+static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
-+	.default_bpp			= 16,
-+	.default_dmacon			= ATMEL_LCDC_DMAEN,
-+	.default_lcdcon2		= AT91SAM9263_DEFAULT_LCDCON2,
-+	.default_monspecs		= &at91fb_default_monspecs,
-+	.atmel_lcdfb_power_control	= at91_lcdc_power_control,
-+	.guard_time			= 1,
-+};
-+
-+#else
-+static struct atmel_lcdfb_info __initdata ek_lcdc_data;
-+#endif
-+
-+
-+/*
-+ * AC97
-+ */
-+static struct atmel_ac97_data ek_ac97_data = {
-+	.reset_pin	= AT91_PIN_PA13,
-+};
-+
-+
- static void __init ek_board_init(void)
- {
- 	/* Serial */
-@@ -157,11 +280,22 @@ static void __init ek_board_init(void)
- 	/* USB Device */
- 	at91_add_device_udc(&ek_udc_data);
- 	/* SPI */
-+	at91_set_gpio_output(AT91_PIN_PE20, 1);		/* select spi0 clock */
- 	at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
-+	/* Touchscreen */
-+	ek_add_device_ts();
- 	/* MMC */
- 	at91_add_device_mmc(1, &ek_mmc_data);
-+	/* Ethernet */
-+	at91_add_device_eth(&ek_macb_data);
- 	/* NAND */
- 	at91_add_device_nand(&ek_nand_data);
-+	/* I2C */
-+	at91_add_device_i2c();
-+	/* LCD Controller */
-+	at91_add_device_lcdc(&ek_lcdc_data);
-+	/* AC97 */
-+	at91_add_device_ac97(&ek_ac97_data);
- }
- 
- MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-sam9rlek.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-sam9rlek.c
-@@ -0,0 +1,204 @@
-+/*
-+ *  Copyright (C) 2005 SAN People
-+ *  Copyright (C) 2007 Atmel Corporation
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file COPYING in the main directory of this archive for
-+ * more details.
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/mm.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/spi/spi.h>
-+#include <linux/fb.h>
-+#include <linux/clk.h>
-+
-+#include <video/atmel_lcdc.h>
-+
-+#include <asm/hardware.h>
-+#include <asm/setup.h>
-+#include <asm/mach-types.h>
-+#include <asm/irq.h>
-+
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/mach/irq.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+#include <asm/arch/at91sam926x_mc.h>
-+
-+#include "generic.h"
-+
-+
-+/*
-+ * Serial port configuration.
-+ *    0 .. 3 = USART0 .. USART3
-+ *    4      = DBGU
-+ */
-+static struct at91_uart_config __initdata ek_uart_config = {
-+	.console_tty	= 0,				/* ttyS0 */
-+	.nr_tty		= 2,
-+	.tty_map	= { 4, 0, -1, -1, -1 }		/* ttyS0, ..., ttyS4 */
-+};
-+
-+static void __init ek_map_io(void)
-+{
-+	/* Initialize processor: 12.000 MHz crystal */
-+	at91sam9rl_initialize(12000000);
-+
-+	/* Setup the serial ports and console */
-+	at91_init_serial(&ek_uart_config);
-+}
-+
-+static void __init ek_init_irq(void)
-+{
-+	at91sam9rl_init_interrupts(NULL);
-+}
-+
-+
-+/*
-+ * MCI (SD/MMC)
-+ */
-+static struct at91_mmc_data __initdata ek_mmc_data = {
-+	.wire4		= 1,
-+	.det_pin	= AT91_PIN_PA15,
-+//	.wp_pin		= ... not connected
-+//	.vcc_pin	= ... not connected
-+};
-+
-+
-+/*
-+ * NAND flash
-+ */
-+static struct mtd_partition __initdata ek_nand_partition[] = {
-+	{
-+		.name	= "Partition 1",
-+		.offset	= 0,
-+		.size	= 256 * 1024,
-+	},
-+	{
-+		.name	= "Partition 2",
-+		.offset	= 256 * 1024 ,
-+		.size	= MTDPART_SIZ_FULL,
-+	},
-+};
-+
-+static struct mtd_partition *nand_partitions(int size, int *num_partitions)
-+{
-+	*num_partitions = ARRAY_SIZE(ek_nand_partition);
-+	return ek_nand_partition;
-+}
-+
-+static struct at91_nand_data __initdata ek_nand_data = {
-+	.ale		= 21,
-+	.cle		= 22,
-+//	.det_pin	= ... not connected
-+	.rdy_pin	= AT91_PIN_PD17,
-+	.enable_pin	= AT91_PIN_PB6,
-+	.partition_info	= nand_partitions,
-+	.bus_width_16	= 0,
-+};
-+
-+
-+/*
-+ * SPI devices
-+ */
-+static struct spi_board_info ek_spi_devices[] = {
-+	{	/* DataFlash chip */
-+		.modalias	= "mtd_dataflash",
-+		.chip_select	= 0,
-+		.max_speed_hz	= 15 * 1000 * 1000,
-+		.bus_num	= 0,
-+	},
-+};
-+
-+
-+/*
-+ * LCD Controller
-+ */
-+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
-+static struct fb_videomode at91_tft_vga_modes[] = {
-+	{
-+		.name		= "TX09D50VM1CCA @ 60",
-+		.refresh	= 60,
-+		.xres		= 240,		.yres		= 320,
-+		.pixclock	= KHZ2PICOS(4965),
-+
-+		.left_margin	= 1,		.right_margin	= 33,
-+		.upper_margin	= 1,		.lower_margin	= 0,
-+		.hsync_len	= 5,		.vsync_len	= 1,
-+
-+		.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-+		.vmode		= FB_VMODE_NONINTERLACED,
-+	},
-+};
-+
-+static struct fb_monspecs at91fb_default_monspecs = {
-+	.manufacturer	= "HIT",
-+	.monitor	= "TX09D50VM1CCA",
-+
-+	.modedb		= at91_tft_vga_modes,
-+	.modedb_len	= ARRAY_SIZE(at91_tft_vga_modes),
-+	.hfmin		= 15000,
-+	.hfmax		= 64000,
-+	.vfmin		= 50,
-+	.vfmax		= 150,
-+};
-+
-+#define AT91SAM9RL_DEFAULT_LCDCON2	(ATMEL_LCDC_MEMOR_LITTLE \
-+					| ATMEL_LCDC_DISTYPE_TFT \
-+					| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
-+
-+static void at91_lcdc_power_control(int on)
-+{
-+	if (on)
-+		at91_set_gpio_value(AT91_PIN_PA30, 0);	/* power up */
-+	else
-+		at91_set_gpio_value(AT91_PIN_PA30, 1);	/* power down */
-+}
-+
-+/* Driver datas */
-+static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
-+	.default_bpp			= 16,
-+	.default_dmacon			= ATMEL_LCDC_DMAEN,
-+	.default_lcdcon2		= AT91SAM9RL_DEFAULT_LCDCON2,
-+	.default_monspecs		= &at91fb_default_monspecs,
-+	.atmel_lcdfb_power_control	= at91_lcdc_power_control,
-+	.guard_time			= 1,
-+};
-+
-+#else
-+static struct atmel_lcdfb_info __initdata ek_lcdc_data;
-+#endif
-+
-+
-+static void __init ek_board_init(void)
-+{
-+	/* Serial */
-+	at91_add_device_serial();
-+	/* I2C */
-+	at91_add_device_i2c();
-+	/* NAND */
-+	at91_add_device_nand(&ek_nand_data);
-+	/* SPI */
-+	at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
-+	/* MMC */
-+	at91_add_device_mmc(0, &ek_mmc_data);
-+	/* LCD Controller */
-+	at91_add_device_lcdc(&ek_lcdc_data);
-+}
-+
-+MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
-+	/* Maintainer: Atmel */
-+	.phys_io	= AT91_BASE_SYS,
-+	.io_pg_offst	= (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-+	.boot_params	= AT91_SDRAM_BASE + 0x100,
-+	.timer		= &at91sam926x_timer,
-+	.map_io		= ek_map_io,
-+	.init_irq	= ek_init_irq,
-+	.init_machine	= ek_board_init,
-+MACHINE_END
-Index: linux-2.6.21.7/arch/arm/mach-at91/clock.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/clock.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/clock.c
-@@ -32,6 +32,7 @@
- #include <asm/arch/cpu.h>
- 
- #include "clock.h"
-+#include "generic.h"
- 
- 
- /*
-@@ -254,6 +255,23 @@ EXPORT_SYMBOL(clk_get_rate);
- 
- /*------------------------------------------------------------------------*/
- 
-+#ifdef CONFIG_PM
-+
-+int clk_must_disable(struct clk *clk)
-+{
-+	if (!at91_suspend_entering_slow_clock())
-+		return 0;
-+
-+	while (clk->parent)
-+		clk = clk->parent;
-+	return clk != &clk32k;
-+}
-+EXPORT_SYMBOL(clk_must_disable);
-+
-+#endif
-+
-+/*------------------------------------------------------------------------*/
-+
- #ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
- 
- /*
-@@ -375,6 +393,7 @@ static int at91_clk_show(struct seq_file
- 	seq_printf(s, "PLLB = %8x\n", at91_sys_read(AT91_CKGR_PLLBR));
- 
- 	seq_printf(s, "MCKR = %8x\n", at91_sys_read(AT91_PMC_MCKR));
-+#warning "Hard-coded PCK"
- 	for (i = 0; i < 4; i++)
- 		seq_printf(s, "PCK%d = %8x\n", i, at91_sys_read(AT91_PMC_PCKR(i)));
- 	seq_printf(s, "SR   = %8x\n", sr = at91_sys_read(AT91_PMC_SR));
-Index: linux-2.6.21.7/arch/arm/mach-at91/generic.h
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/generic.h
-+++ linux-2.6.21.7/arch/arm/mach-at91/generic.h
-@@ -13,12 +13,14 @@ extern void __init at91rm9200_initialize
- extern void __init at91sam9260_initialize(unsigned long main_clock);
- extern void __init at91sam9261_initialize(unsigned long main_clock);
- extern void __init at91sam9263_initialize(unsigned long main_clock);
-+extern void __init at91sam9rl_initialize(unsigned long main_clock);
- 
-  /* Interrupts */
- extern void __init at91rm9200_init_interrupts(unsigned int priority[]);
- extern void __init at91sam9260_init_interrupts(unsigned int priority[]);
- extern void __init at91sam9261_init_interrupts(unsigned int priority[]);
- extern void __init at91sam9263_init_interrupts(unsigned int priority[]);
-+extern void __init at91sam9rl_init_interrupts(unsigned int priority[]);
- extern void __init at91_aic_init(unsigned int priority[]);
- 
-  /* Timer */
-@@ -34,6 +36,7 @@ extern void __init at91_clock_associate(
-  /* Power Management */
- extern void at91_irq_suspend(void);
- extern void at91_irq_resume(void);
-+extern int at91_suspend_entering_slow_clock(void);
- 
-  /* GPIO */
- #define AT91RM9200_PQFP		3	/* AT91RM9200 PQFP package has 3 banks */
-Index: linux-2.6.21.7/arch/arm/mach-at91/ics1523.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/ics1523.c
-@@ -0,0 +1,207 @@
-+/*
-+ * arch/arm/mach-at91rm9200/ics1523.c
-+ *
-+ *  Copyright (C) 2003 ATMEL Rousset
-+ *
-+ * 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 <asm/hardware.h>
-+#include <asm/io.h>
-+
-+#include <linux/clk.h>
-+#include <linux/delay.h>
-+#include <linux/err.h>
-+#include <linux/init.h>
-+
-+#include <asm/arch/ics1523.h>
-+#include <asm/arch/at91_twi.h>
-+#include <asm/arch/gpio.h>
-+
-+/* TWI Errors */
-+#define	AT91_TWI_ERROR	(AT91_TWI_NACK | AT91_TWI_UNRE | AT91_TWI_OVRE)
-+
-+
-+static void __iomem *twi_base;
-+
-+#define at91_twi_read(reg)		__raw_readl(twi_base + (reg))
-+#define at91_twi_write(reg, val)	__raw_writel((val), twi_base + (reg))
-+
-+
-+/* -----------------------------------------------------------------------------
-+ * Initialization of TWI CLOCK
-+ * ----------------------------------------------------------------------------- */
-+
-+static void at91_ics1523_SetTwiClock(unsigned int mck_khz)
-+{
-+	int sclock;
-+
-+	/* Here, CKDIV = 1 and CHDIV = CLDIV  ==> CLDIV = CHDIV = 1/4*((Fmclk/FTWI) -6) */
-+	sclock = (10*mck_khz / ICS_TRANSFER_RATE);
-+	if (sclock % 10 >= 5)
-+		sclock = (sclock /10) - 5;
-+	else
-+		sclock = (sclock /10)- 6;
-+	sclock = (sclock + (4 - sclock %4)) >> 2;	/* div 4 */
-+
-+	at91_twi_write(AT91_TWI_CWGR, 0x00010000 | sclock | (sclock << 8));
-+}
-+
-+/* -----------------------------------------------------------------------------
-+ * Read a byte with TWI Interface from the Clock Generator ICS1523
-+ * ----------------------------------------------------------------------------- */
-+
-+static int at91_ics1523_ReadByte(unsigned char reg_address, unsigned char *data_in)
-+{
-+	int Status, nb_trial;
-+
-+	at91_twi_write(AT91_TWI_MMR, AT91_TWI_MREAD | AT91_TWI_IADRSZ_1 | ((ICS_ADDR << 16) & AT91_TWI_DADR));
-+	at91_twi_write(AT91_TWI_IADR, reg_address);
-+	at91_twi_write(AT91_TWI_CR, AT91_TWI_START | AT91_TWI_STOP);
-+
-+	/* Program temporizing period (300us) */
-+	udelay(300);
-+
-+	/* Wait TXcomplete ... */
-+	nb_trial = 0;
-+	Status = at91_twi_read(AT91_TWI_SR);
-+	while (!(Status & AT91_TWI_TXCOMP) && (nb_trial < 10)) {
-+		nb_trial++;
-+		Status = at91_twi_read(AT91_TWI_SR);
-+	}
-+
-+	if (Status & AT91_TWI_TXCOMP) {
-+		*data_in = (unsigned char) at91_twi_read(AT91_TWI_RHR);
-+		return ICS1523_ACCESS_OK;
-+	}
-+	else
-+		return ICS1523_ACCESS_ERROR;
-+}
-+
-+/* -----------------------------------------------------------------------------
-+ * Write a byte with TWI Interface to the Clock Generator ICS1523
-+ * ----------------------------------------------------------------------------- */
-+
-+static int at91_ics1523_WriteByte(unsigned char reg_address, unsigned char data_out)
-+{
-+	int Status, nb_trial;
-+
-+	at91_twi_write(AT91_TWI_MMR, AT91_TWI_IADRSZ_1 | ((ICS_ADDR << 16) & AT91_TWI_DADR));
-+	at91_twi_write(AT91_TWI_IADR, reg_address);
-+	at91_twi_write(AT91_TWI_THR, data_out);
-+	at91_twi_write(AT91_TWI_CR, AT91_TWI_START | AT91_TWI_STOP);
-+
-+	/* Program temporizing period (300us) */
-+	udelay(300);
-+
-+	nb_trial = 0;
-+	Status = at91_twi_read(AT91_TWI_SR);
-+	while (!(Status & AT91_TWI_TXCOMP) && (nb_trial < 10)) {
-+		nb_trial++;
-+		if (Status & AT91_TWI_ERROR) {
-+			/* If Underrun OR NACK - Start again */
-+			at91_twi_write(AT91_TWI_CR, AT91_TWI_START | AT91_TWI_STOP);
-+
-+			/*  Program temporizing period (300us) */
-+			udelay(300);
-+		}
-+		Status = at91_twi_read(AT91_TWI_SR);
-+	};
-+
-+	if (Status & AT91_TWI_TXCOMP)
-+		return ICS1523_ACCESS_OK;
-+	else
-+		return ICS1523_ACCESS_ERROR;
-+}
-+
-+/* -----------------------------------------------------------------------------
-+ * Initialization of the Clock Generator ICS1523
-+ * ----------------------------------------------------------------------------- */
-+
-+int at91_ics1523_init(void)
-+{
-+	int		nb_trial;
-+	int		ack = ICS1523_ACCESS_OK;
-+	unsigned int	status = 0xffffffff;
-+	struct clk	*twi_clk;
-+
-+	/* Map in TWI peripheral */
-+	twi_base = ioremap(AT91RM9200_BASE_TWI, SZ_16K);
-+	if (!twi_base)
-+		return -ENOMEM;
-+
-+	/* pins used for TWI interface */
-+	at91_set_A_periph(AT91_PIN_PA25, 0);            /* TWD */
-+	at91_set_multi_drive(AT91_PIN_PA25, 1);
-+	at91_set_A_periph(AT91_PIN_PA26, 0);            /* TWCK */
-+	at91_set_multi_drive(AT91_PIN_PA26, 1);
-+
-+	/* Enable the TWI clock */
-+	twi_clk = clk_get(NULL, "twi_clk");
-+	if (IS_ERR(twi_clk))
-+		return ICS1523_ACCESS_ERROR;
-+	clk_enable(twi_clk);
-+
-+	/* Disable interrupts */
-+	at91_twi_write(AT91_TWI_IDR, -1);
-+
-+	/* Reset peripheral */
-+	at91_twi_write(AT91_TWI_CR, AT91_TWI_SWRST);
-+
-+	/* Set Master mode */
-+	at91_twi_write(AT91_TWI_CR, AT91_TWI_MSEN);
-+
-+	/* Set TWI Clock Waveform Generator Register */
-+	at91_ics1523_SetTwiClock(60000);     /* MCK in KHz = 60000 KHz */
-+
-+	/* ICS1523 Initialisation */
-+	ack |= at91_ics1523_WriteByte ((unsigned char) ICS_ICR, (unsigned char) 0);
-+	ack |= at91_ics1523_WriteByte ((unsigned char) ICS_OE, (unsigned char) (ICS_OEF | ICS_OET2 | ICS_OETCK));
-+	ack |= at91_ics1523_WriteByte ((unsigned char) ICS_OD, (unsigned char) (ICS_INSEL | 0x7F));
-+	ack |= at91_ics1523_WriteByte ((unsigned char) ICS_DPAO, (unsigned char) 0);
-+
-+	nb_trial = 0;
-+	do {
-+		nb_trial++;
-+		ack |= at91_ics1523_WriteByte ((unsigned char) ICS_ICR, (unsigned char) (ICS_ENDLS | ICS_ENPLS | ICS_PDEN /*| ICS_FUNCSEL*/));
-+		ack |= at91_ics1523_WriteByte ((unsigned char) ICS_LCR, (unsigned char) (ICS_PSD | ICS_PFD));
-+		ack |= at91_ics1523_WriteByte ((unsigned char) ICS_FD0, (unsigned char) 0x39) ; /* 0x7A */
-+		ack |= at91_ics1523_WriteByte ((unsigned char) ICS_FD1, (unsigned char) 0x00);
-+		ack |= at91_ics1523_WriteByte ((unsigned char) ICS_SWRST, (unsigned char) (ICS_PLLR));
-+
-+		/* Program 1ms temporizing period */
-+		mdelay(1);
-+
-+		at91_ics1523_ReadByte ((unsigned char) ICS_SR, (char *)&status);
-+	} while (!((unsigned int) status & (unsigned int) ICS_PLLLOCK) && (nb_trial < 10));
-+
-+	ack |= at91_ics1523_WriteByte ((unsigned char) ICS_DPAC, (unsigned char) 0x03) ; /* 0x01 */
-+	ack |= at91_ics1523_WriteByte ((unsigned char) ICS_SWRST, (unsigned char) (ICS_DPAR));
-+
-+	/* Program 1ms temporizing period */
-+	mdelay(1);
-+
-+	ack |= at91_ics1523_WriteByte ((unsigned char) ICS_DPAO, (unsigned char) 0x00);
-+
-+	/* Program 1ms temporizing period */
-+	mdelay(1);
-+	
-+	/* All done - cleanup */
-+	iounmap(twi_base);
-+	clk_disable(twi_clk);
-+	clk_put(twi_clk);
-+
-+	return ack;
-+}
-Index: linux-2.6.21.7/arch/arm/mach-at91/pm.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/pm.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/pm.c
-@@ -63,6 +63,7 @@ static int at91_pm_prepare(suspend_state
-  * Verify that all the clocks are correct before entering
-  * slow-clock mode.
-  */
-+#warning "SAM9260 only has 3 programmable clocks."
- static int at91_pm_verify_clocks(void)
- {
- 	unsigned long scsr;
-@@ -104,20 +105,15 @@ static int at91_pm_verify_clocks(void)
- }
- 
- /*
-- * Call this from platform driver suspend() to see how deeply to suspend.
-+ * This is called from clk_must_disable(), to see how deeply to suspend.
-  * For example, some controllers (like OHCI) need one of the PLL clocks
-  * in order to act as a wakeup source, and those are not available when
-  * going into slow clock mode.
-- *
-- * REVISIT: generalize as clk_will_be_available(clk)?  Other platforms have
-- * the very same problem (but not using at91 main_clk), and it'd be better
-- * to add one generic API rather than lots of platform-specific ones.
-  */
- int at91_suspend_entering_slow_clock(void)
- {
- 	return (target_state == PM_SUSPEND_MEM);
- }
--EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
- 
- 
- static void (*slow_clock)(void);
-@@ -207,16 +203,23 @@ static struct pm_ops at91_pm_ops ={
- 	.enter		= at91_pm_enter,
- };
- 
-+#ifdef CONFIG_AT91_SLOW_CLOCK
-+extern void at91rm9200_slow_clock(void);
-+extern u32 at91rm9200_slow_clock_sz;
-+#endif
-+
- static int __init at91_pm_init(void)
- {
--	printk("AT91: Power Management\n");
--
--#ifdef CONFIG_AT91_PM_SLOW_CLOCK
--	/* REVISIT allocations of SRAM should be dynamically managed.
-+#ifdef CONFIG_AT91_SLOW_CLOCK
-+	/*
-+	 * REVISIT allocations of SRAM should be dynamically managed.
- 	 * FIQ handlers and other components will want SRAM/TCM too...
- 	 */
--	slow_clock = (void *) (AT91_VA_BASE_SRAM + (3 * SZ_4K));
-+	slow_clock = (void *) (AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE + (3 * SZ_4K));
- 	memcpy(slow_clock, at91rm9200_slow_clock, at91rm9200_slow_clock_sz);
-+	printk("AT91: Power Management (with slow clock mode)\n");
-+#else
-+	printk("AT91: Power Management\n");
- #endif
- 
- 	/* Disable SDRAM low-power mode.  Cannot be used with self-refresh. */
-Index: linux-2.6.21.7/arch/arm/mach-at91/pm_slowclock.S
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/pm_slowclock.S
-@@ -0,0 +1,172 @@
-+/*
-+ * arch/arm/mach-at91/pm_slow_clock.S
-+ *
-+ *  Copyright (C) 2006 Savin Zlobec
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ *
-+ */
-+
-+#include <linux/linkage.h>
-+#include <asm/hardware.h>
-+#include <asm/arch/at91_pmc.h>
-+#include <asm/arch/at91rm9200_mc.h>
-+
-+#define MCKRDY_TIMEOUT		1000
-+#define MOSCRDY_TIMEOUT 	1000
-+#define PLLALOCK_TIMEOUT	1000
-+
-+	.macro wait_mckrdy
-+	mov	r2, #MCKRDY_TIMEOUT
-+1:	sub	r2, r2, #1
-+	cmp	r2, #0
-+	beq	2f
-+	ldr	r3, [r1, #AT91_PMC_SR]
-+	tst	r3, #AT91_PMC_MCKRDY
-+	beq	1b
-+2:
-+	.endm
-+
-+	.macro wait_moscrdy
-+	mov	r2, #MOSCRDY_TIMEOUT
-+1:	sub	r2, r2, #1
-+	cmp	r2, #0
-+	beq	2f
-+	ldr	r3, [r1, #AT91_PMC_SR]
-+	tst	r3, #AT91_PMC_MOSCS
-+	beq	1b
-+2:
-+	.endm
-+
-+	.macro wait_pllalock
-+	mov	r2, #PLLALOCK_TIMEOUT
-+1:	sub	r2, r2, #1
-+	cmp	r2, #0
-+	beq	2f
-+	ldr	r3, [r1, #AT91_PMC_SR]
-+	tst	r3, #AT91_PMC_LOCKA
-+	beq	1b
-+2:
-+	.endm
-+
-+	.macro wait_plladis
-+	mov	r2, #PLLALOCK_TIMEOUT
-+1:	sub	r2, r2, #1
-+	cmp	r2, #0
-+	beq	2f
-+	ldr	r3, [r1, #AT91_PMC_SR]
-+	tst	r3, #AT91_PMC_LOCKA
-+	bne	1b
-+2:
-+	.endm
-+
-+	.text
-+
-+ENTRY(at91rm9200_slow_clock)
-+
-+	ldr	r1, .at91_va_base_sys
-+
-+	/* Put SDRAM in self refresh mode */
-+
-+	b	1f
-+	.align	5
-+1:	mcr	p15, 0, r0, c7, c10, 4
-+	mov	r2, #1
-+	str	r2, [r1, #AT91_SDRAMC_SRR]
-+
-+	/* Save Master clock setting */
-+
-+	ldr	r2, [r1, #AT91_PMC_MCKR]
-+	str	r2, .saved_mckr
-+
-+	/*
-+	 * Set the Master clock source to slow clock
-+	 *
-+	 * First set the CSS field, wait for MCKRDY
-+	 * and than set the PRES and MDIV fields.
-+	 *
-+	 * See eratta #2[78] for details.
-+	 */
-+
-+	bic	r2, r2, #3
-+	str	r2, [r1, #AT91_PMC_MCKR]
-+
-+	wait_mckrdy
-+
-+	mov	r2, #0
-+	str	r2, [r1, #AT91_PMC_MCKR]
-+
-+	/* Save PLLA setting and disable it */
-+
-+	ldr	r2, [r1, #AT91_CKGR_PLLAR]
-+	str	r2, .saved_pllar
-+
-+	mov	r2, #0
-+	str	r2, [r1, #AT91_CKGR_PLLAR]
-+
-+	wait_plladis
-+
-+	/* Turn off the main oscillator */
-+
-+	ldr	r2, [r1, #AT91_CKGR_MOR]
-+	bic	r2, r2, #AT91_PMC_MOSCEN
-+	str	r2, [r1, #AT91_CKGR_MOR]
-+
-+	/* Wait for interrupt */
-+
-+	mcr	p15, 0, r0, c7, c0, 4
-+
-+	/* Turn on the main oscillator */
-+
-+	ldr	r2, [r1, #AT91_CKGR_MOR]
-+	orr	r2, r2, #AT91_PMC_MOSCEN
-+	str	r2, [r1, #AT91_CKGR_MOR]
-+
-+	wait_moscrdy
-+
-+	/* Restore PLLA setting */
-+
-+	ldr	r2, .saved_pllar
-+	str	r2, [r1, #AT91_CKGR_PLLAR]
-+
-+	wait_pllalock
-+
-+	/*
-+	 * Restore master clock setting
-+	 *
-+	 * First set PRES if it was not 0,
-+	 * than set CSS and MDIV fields.
-+	 * After every change wait for
-+	 * MCKRDY.
-+	 *
-+	 * See eratta #2[78] for details.
-+	 */
-+
-+	ldr	r2, .saved_mckr
-+	tst	r2, #0x1C
-+	beq	2f
-+	and	r2, r2, #0x1C
-+	str	r2, [r1, #AT91_PMC_MCKR]
-+
-+	wait_mckrdy
-+
-+2:	ldr	r2, .saved_mckr
-+	str	r2, [r1, #AT91_PMC_MCKR]
-+
-+	wait_mckrdy
-+
-+	mov	pc, lr
-+
-+.saved_mckr:
-+	.word 0
-+
-+.saved_pllar:
-+	.word 0
-+
-+.at91_va_base_sys:
-+	.word AT91_VA_BASE_SYS
-+
-+ENTRY(at91rm9200_slow_clock_sz)
-+	.word .-at91rm9200_slow_clock
-Index: linux-2.6.21.7/arch/arm/mach-at91/tclib.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/tclib.c
-@@ -0,0 +1,17 @@
-+#include <linux/clk.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+
-+#include "tclib.h"
-+
-+static struct atmel_tcblock *blocks;
-+static int nblocks;
-+
-+/*
-+ * Called from the processor-specific init to register the TC Blocks.
-+ */
-+void __init atmel_tc_init(struct atmel_tcblock *tcblocks, int n)
-+{
-+	blocks = tcblocks;
-+	nblocks = n;
-+}
-Index: linux-2.6.21.7/arch/arm/mach-at91/tclib.h
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/tclib.h
-@@ -0,0 +1,11 @@
-+
-+#define TC_PER_TCB	3
-+
-+struct atmel_tcblock {
-+	u32 		physaddr;
-+	void __iomem	*ioaddr;
-+	struct clk	*clk[TC_PER_TCB];
-+	int		irq[TC_PER_TCB];
-+};
-+
-+extern void __init atmel_tc_init(struct atmel_tcblock *tcblocks, int n);
-Index: linux-2.6.21.7/arch/arm/mm/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mm/Kconfig
-+++ linux-2.6.21.7/arch/arm/mm/Kconfig
-@@ -171,8 +171,8 @@ config CPU_ARM925T
- # ARM926T
- config CPU_ARM926T
- 	bool "Support ARM926T processor"
--	depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_NS9XXX
--	default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_NS9XXX
-+	depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_NS9XXX
-+	default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_NS9XXX
- 	select CPU_32v5
- 	select CPU_ABRT_EV5TJ
- 	select CPU_CACHE_VIVT
-Index: linux-2.6.21.7/arch/arm/tools/mach-types
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/tools/mach-types
-+++ linux-2.6.21.7/arch/arm/tools/mach-types
-@@ -1335,3 +1335,32 @@ at91sam9rlek		MACH_AT91SAM9RLEK	AT91SAM9
- comtech_router		MACH_COMTECH_ROUTER	COMTECH_ROUTER		1327
- sbc2410x		MACH_SBC2410X		SBC2410X		1328
- at4x0bd			MACH_AT4X0BD		AT4X0BD			1329
-+cbifr			MACH_CBIFR		CBIFR			1330
-+arcom_quantum		MACH_ARCOM_QUANTUM	ARCOM_QUANTUM		1331
-+matrix520		MACH_MATRIX520		MATRIX520		1332
-+matrix510		MACH_MATRIX510		MATRIX510		1333
-+matrix500		MACH_MATRIX500		MATRIX500		1334
-+m501			MACH_M501		M501			1335
-+aaeon1270		MACH_AAEON1270		AAEON1270		1336
-+matrix500ev		MACH_MATRIX500EV	MATRIX500EV		1337
-+pac500			MACH_PAC500		PAC500			1338
-+pnx8181			MACH_PNX8181		PNX8181			1339
-+colibri320		MACH_COLIBRI320		COLIBRI320		1340
-+aztoolbb		MACH_AZTOOLBB		AZTOOLBB		1341
-+aztoolg2		MACH_AZTOOLG2		AZTOOLG2		1342
-+dvlhost			MACH_DVLHOST		DVLHOST			1343
-+zir9200			MACH_ZIR9200		ZIR9200			1344
-+zir9260			MACH_ZIR9260		ZIR9260			1345
-+cocopah			MACH_COCOPAH		COCOPAH			1346
-+nds			MACH_NDS		NDS			1347
-+rosencrantz		MACH_ROSENCRANTZ	ROSENCRANTZ		1348
-+fttx_odsc		MACH_FTTX_ODSC		FTTX_ODSC		1349
-+classe_r6904		MACH_CLASSE_R6904	CLASSE_R6904		1350
-+cam60			MACH_CAM60		CAM60			1351
-+mxc30031ads		MACH_MXC30031ADS	MXC30031ADS		1352
-+datacall		MACH_DATACALL		DATACALL		1353
-+at91eb01		MACH_AT91EB01		AT91EB01		1354
-+rty			MACH_RTY		RTY			1355
-+dwl2100			MACH_DWL2100		DWL2100			1356
-+vinsi			MACH_VINSI		VINSI			1357
-+db88f5281		MACH_DB88F5281		DB88F5281		1358
-Index: linux-2.6.21.7/drivers/char/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/char/Kconfig
-+++ linux-2.6.21.7/drivers/char/Kconfig
-@@ -1071,5 +1071,21 @@ config TELCLOCK
- 	  /sys/devices/platform/telco_clock, with a number of files for
- 	  controlling the behavior of this hardware.
- 
-+config AT91_SPI
-+	bool "SPI driver (legacy) for AT91RM9200 processors"
-+	depends on ARCH_AT91RM9200
-+	default y
-+	help
-+	  The SPI driver gives access to this serial bus on the AT91RM9200
-+	  processor.
-+
-+config AT91_SPIDEV
-+	bool "SPI device interface (legacy) for AT91RM9200 processors"
-+	depends on ARCH_AT91RM9200 && AT91_SPI
-+	default n
-+	help
-+	  The SPI driver gives user mode access to this serial
-+	  bus on the AT91RM9200 processor.
-+
- endmenu
- 
-Index: linux-2.6.21.7/drivers/char/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/char/Makefile
-+++ linux-2.6.21.7/drivers/char/Makefile
-@@ -93,6 +93,8 @@ obj-$(CONFIG_CS5535_GPIO)	+= cs5535_gpio
- obj-$(CONFIG_GPIO_VR41XX)	+= vr41xx_giu.o
- obj-$(CONFIG_TANBAC_TB0219)	+= tb0219.o
- obj-$(CONFIG_TELCLOCK)		+= tlclk.o
-+obj-$(CONFIG_AT91_SPI)		+= at91_spi.o
-+obj-$(CONFIG_AT91_SPIDEV)	+= at91_spidev.o
- 
- obj-$(CONFIG_WATCHDOG)		+= watchdog/
- obj-$(CONFIG_MWAVE)		+= mwave/
-Index: linux-2.6.21.7/drivers/char/at91_spi.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/char/at91_spi.c
-@@ -0,0 +1,336 @@
-+/*
-+ * Serial Peripheral Interface (SPI) driver for the Atmel AT91RM9200 (Thunder)
-+ *
-+ *  Copyright (C) SAN People (Pty) 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.
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/dma-mapping.h>
-+#include <linux/module.h>
-+#include <linux/sched.h>
-+#include <linux/completion.h>
-+#include <linux/interrupt.h>
-+#include <linux/clk.h>
-+#include <linux/platform_device.h>
-+#include <linux/atmel_pdc.h>
-+#include <asm/io.h>
-+#include <asm/semaphore.h>
-+
-+#include <asm/arch/at91_spi.h>
-+#include <asm/arch/board.h>
-+#include <asm/arch/spi.h>
-+
-+#undef DEBUG_SPI
-+
-+static struct spi_local spi_dev[NR_SPI_DEVICES];	/* state of the SPI devices */
-+static int spi_enabled = 0;
-+static struct semaphore spi_lock;			/* protect access to SPI bus */
-+static int current_device = -1;				/* currently selected SPI device */
-+static struct clk *spi_clk;				/* SPI clock */
-+static void __iomem *spi_base;				/* SPI peripheral base-address */
-+
-+DECLARE_COMPLETION(transfer_complete);
-+
-+
-+#define at91_spi_read(reg)		__raw_readl(spi_base + (reg))
-+#define at91_spi_write(reg, val)	__raw_writel((val), spi_base + (reg))
-+
-+
-+/* ......................................................................... */
-+
-+/*
-+ * Access and enable the SPI bus.
-+ * This MUST be called before any transfers are performed.
-+ */
-+void spi_access_bus(short device)
-+{
-+	/* Ensure that requested device is valid */
-+	if ((device < 0) || (device >= NR_SPI_DEVICES))
-+		panic("at91_spi: spi_access_bus called with invalid device");
-+
-+	if (spi_enabled == 0) {
-+		clk_enable(spi_clk);				/* Enable Peripheral clock */
-+		at91_spi_write(AT91_SPI_CR, AT91_SPI_SPIEN);	/* Enable SPI */
-+#ifdef DEBUG_SPI
-+		printk("SPI on\n");
-+#endif
-+	}
-+	spi_enabled++;
-+
-+	/* Lock the SPI bus */
-+	down(&spi_lock);
-+	current_device = device;
-+
-+	/* Configure SPI bus for device */
-+	at91_spi_write(AT91_SPI_MR, AT91_SPI_MSTR | AT91_SPI_MODFDIS | (spi_dev[device].pcs << 16));
-+}
-+
-+/*
-+ * Relinquish control of the SPI bus.
-+ */
-+void spi_release_bus(short device)
-+{
-+	if (device != current_device)
-+		panic("at91_spi: spi_release called with invalid device");
-+
-+	/* Release the SPI bus */
-+	current_device = -1;
-+	up(&spi_lock);
-+
-+	spi_enabled--;
-+	if (spi_enabled == 0) {
-+		at91_spi_write(AT91_SPI_CR, AT91_SPI_SPIDIS);	/* Disable SPI */
-+		clk_disable(spi_clk);				/* Disable Peripheral clock */
-+#ifdef DEBUG_SPI
-+		printk("SPI off\n");
-+#endif
-+	}
-+}
-+
-+/*
-+ * Perform a data transfer over the SPI bus
-+ */
-+int spi_transfer(struct spi_transfer_list* list)
-+{
-+	struct spi_local *device = (struct spi_local *) &spi_dev[current_device];
-+	int tx_size;
-+
-+	if (!list)
-+		panic("at91_spi: spi_transfer called with NULL transfer list");
-+	if (current_device == -1)
-+		panic("at91_spi: spi_transfer called without acquiring bus");
-+
-+#ifdef DEBUG_SPI
-+	printk("SPI transfer start [%i]\n", list->nr_transfers);
-+#endif
-+
-+	/* If we are in 16-bit mode, we need to modify what we pass to the PDC */
-+	tx_size = (at91_spi_read(AT91_SPI_CSR(current_device)) & AT91_SPI_BITS_16) ? 2 : 1;
-+
-+	/* Store transfer list */
-+	device->xfers = list;
-+	list->curr = 0;
-+
-+	/* Assume there must be at least one transfer */
-+	device->tx = dma_map_single(NULL, list->tx[0], list->txlen[0], DMA_TO_DEVICE);
-+	device->rx = dma_map_single(NULL, list->rx[0], list->rxlen[0], DMA_FROM_DEVICE);
-+
-+	/* Program PDC registers */
-+	at91_spi_write(ATMEL_PDC_TPR, device->tx);
-+	at91_spi_write(ATMEL_PDC_RPR, device->rx);
-+	at91_spi_write(ATMEL_PDC_TCR, list->txlen[0] / tx_size);
-+	at91_spi_write(ATMEL_PDC_RCR, list->rxlen[0] / tx_size);
-+
-+	/* Is there a second transfer? */
-+	if (list->nr_transfers > 1) {
-+		device->txnext = dma_map_single(NULL, list->tx[1], list->txlen[1], DMA_TO_DEVICE);
-+		device->rxnext = dma_map_single(NULL, list->rx[1], list->rxlen[1], DMA_FROM_DEVICE);
-+
-+		/* Program Next PDC registers */
-+		at91_spi_write(ATMEL_PDC_TNPR, device->txnext);
-+		at91_spi_write(ATMEL_PDC_RNPR, device->rxnext);
-+		at91_spi_write(ATMEL_PDC_TNCR, list->txlen[1] / tx_size);
-+		at91_spi_write(ATMEL_PDC_RNCR, list->rxlen[1] / tx_size);
-+	}
-+	else {
-+		device->txnext = 0;
-+		device->rxnext = 0;
-+		at91_spi_write(ATMEL_PDC_TNCR, 0);
-+		at91_spi_write(ATMEL_PDC_RNCR, 0);
-+	}
-+
-+	// TODO: If we are doing consecutive transfers (at high speed, or
-+	//   small buffers), then it might be worth modifying the 'Delay between
-+	//   Consecutive Transfers' in the CSR registers.
-+	//   This is an issue if we cannot chain the next buffer fast enough
-+	//   in the interrupt handler.
-+
-+	/* Enable transmitter and receiver */
-+	at91_spi_write(ATMEL_PDC_PTCR, ATMEL_PDC_RXTEN | ATMEL_PDC_TXTEN);
-+
-+	at91_spi_write(AT91_SPI_IER, AT91_SPI_ENDRX);		/* enable buffer complete interrupt */
-+	wait_for_completion(&transfer_complete);
-+
-+#ifdef DEBUG_SPI
-+	printk("SPI transfer end\n");
-+#endif
-+
-+	return 0;
-+}
-+
-+/* ......................................................................... */
-+
-+/*
-+ * Handle interrupts from the SPI controller.
-+ */
-+static irqreturn_t at91spi_interrupt(int irq, void *dev_id)
-+{
-+	unsigned int status;
-+	struct spi_local *device = (struct spi_local *) &spi_dev[current_device];
-+	struct spi_transfer_list *list = device->xfers;
-+
-+#ifdef DEBUG_SPI
-+	printk("SPI interrupt %i\n", current_device);
-+#endif
-+
-+	if (!list)
-+		panic("at91_spi: spi_interrupt with a NULL transfer list");
-+
-+		status = at91_spi_read(AT91_SPI_SR) & at91_spi_read(AT91_SPI_IMR);	/* read status */
-+
-+	dma_unmap_single(NULL, device->tx, list->txlen[list->curr], DMA_TO_DEVICE);
-+	dma_unmap_single(NULL, device->rx, list->rxlen[list->curr], DMA_FROM_DEVICE);
-+
-+	device->tx = device->txnext;	/* move next transfer to current transfer */
-+	device->rx = device->rxnext;
-+
-+	list->curr = list->curr + 1;
-+	if (list->curr == list->nr_transfers) {		/* all transfers complete */
-+		at91_spi_write(AT91_SPI_IDR, AT91_SPI_ENDRX);		/* disable interrupt */
-+
-+		/* Disable transmitter and receiver */
-+		at91_spi_write(ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
-+
-+		device->xfers = NULL;
-+		complete(&transfer_complete);
-+	}
-+	else if (list->curr+1 == list->nr_transfers) {	/* no more next transfers */
-+		device->txnext = 0;
-+		device->rxnext = 0;
-+		at91_spi_write(ATMEL_PDC_TNCR, 0);
-+		at91_spi_write(ATMEL_PDC_RNCR, 0);
-+	}
-+	else {
-+		int i = (list->curr)+1;
-+
-+		/* If we are in 16-bit mode, we need to modify what we pass to the PDC */
-+		int tx_size = (at91_spi_read(AT91_SPI_CSR(current_device)) & AT91_SPI_BITS_16) ? 2 : 1;
-+
-+		device->txnext = dma_map_single(NULL, list->tx[i], list->txlen[i], DMA_TO_DEVICE);
-+		device->rxnext = dma_map_single(NULL, list->rx[i], list->rxlen[i], DMA_FROM_DEVICE);
-+		at91_spi_write(ATMEL_PDC_TNPR, device->txnext);
-+		at91_spi_write(ATMEL_PDC_RNPR, device->rxnext);
-+		at91_spi_write(ATMEL_PDC_TNCR, list->txlen[i] / tx_size);
-+		at91_spi_write(ATMEL_PDC_RNCR, list->rxlen[i] / tx_size);
-+	}
-+	return IRQ_HANDLED;
-+}
-+
-+/* ......................................................................... */
-+
-+/*
-+ * Initialize the SPI controller
-+ */
-+static int __init at91spi_probe(struct platform_device *pdev)
-+{
-+	int i;
-+	unsigned long scbr;
-+	struct resource *res;
-+
-+	init_MUTEX(&spi_lock);
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	if (!res)
-+		return -ENXIO;
-+
-+	if (!request_mem_region(res->start, res->end - res->start + 1, "at91_spi"))
-+		return -EBUSY;
-+
-+	spi_base = ioremap(res->start, res->end - res->start + 1);
-+	if (!spi_base) {
-+		release_mem_region(res->start, res->end - res->start + 1);
-+		return -ENOMEM;
-+	}
-+
-+	spi_clk = clk_get(NULL, "spi_clk");
-+	if (IS_ERR(spi_clk)) {
-+		printk(KERN_ERR "at91_spi: no clock defined\n");
-+		iounmap(spi_base);
-+		release_mem_region(res->start, res->end - res->start + 1);
-+		return -ENODEV;
-+	}
-+
-+	at91_spi_write(AT91_SPI_CR, AT91_SPI_SWRST);	/* software reset of SPI controller */
-+
-+	/*
-+	 * Calculate the correct SPI baud-rate divisor.
-+	 */
-+	scbr = clk_get_rate(spi_clk) / (2 * DEFAULT_SPI_CLK);
-+	scbr = scbr + 1;		/* round up */
-+
-+	printk(KERN_INFO "at91_spi: Baud rate set to %ld\n", clk_get_rate(spi_clk) / (2 * scbr));
-+
-+	/* Set Chip Select registers to good defaults */
-+	for (i = 0; i < 4; i++) {
-+		at91_spi_write(AT91_SPI_CSR(i), AT91_SPI_CPOL | AT91_SPI_BITS_8 | (16 << 16) | (scbr << 8));
-+	}
-+
-+	at91_spi_write(ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
-+
-+	memset(&spi_dev, 0, sizeof(spi_dev));
-+	spi_dev[0].pcs = 0xE;
-+	spi_dev[1].pcs = 0xD;
-+	spi_dev[2].pcs = 0xB;
-+	spi_dev[3].pcs = 0x7;
-+
-+	if (request_irq(AT91RM9200_ID_SPI, at91spi_interrupt, 0, "spi", NULL)) {
-+		clk_put(spi_clk);
-+		iounmap(spi_base);
-+		release_mem_region(res->start, res->end - res->start + 1);
-+		return -EBUSY;
-+	}
-+
-+	at91_spi_write(AT91_SPI_CR, AT91_SPI_SPIEN);		/* Enable SPI */
-+
-+	return 0;
-+}
-+
-+static int __devexit at91spi_remove(struct platform_device *pdev)
-+{
-+	struct resource *res;
-+
-+	at91_spi_write(AT91_SPI_CR, AT91_SPI_SPIDIS);		/* Disable SPI */
-+	clk_put(spi_clk);
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	iounmap(spi_base);
-+	release_mem_region(res->start, res->end - res->start + 1);
-+
-+	free_irq(AT91RM9200_ID_SPI, 0);
-+	return 0;
-+}
-+
-+static struct platform_driver at91spi_driver = {
-+	.probe		= at91spi_probe,
-+	.remove		= __devexit_p(at91spi_remove),
-+	.driver		= {
-+		.name	= "at91_spi",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+static int __init at91spi_init(void)
-+{
-+	return platform_driver_register(&at91spi_driver);
-+}
-+
-+static void __exit at91spi_exit(void)
-+{
-+	platform_driver_unregister(&at91spi_driver);
-+}
-+
-+EXPORT_SYMBOL(spi_access_bus);
-+EXPORT_SYMBOL(spi_release_bus);
-+EXPORT_SYMBOL(spi_transfer);
-+
-+module_init(at91spi_init);
-+module_exit(at91spi_exit);
-+
-+MODULE_LICENSE("GPL")
-+MODULE_AUTHOR("Andrew Victor")
-+MODULE_DESCRIPTION("SPI driver for Atmel AT91RM9200")
-Index: linux-2.6.21.7/drivers/char/at91_spidev.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/char/at91_spidev.c
-@@ -0,0 +1,236 @@
-+/*
-+ * User-space interface to the SPI bus on Atmel AT91RM9200
-+ *
-+ *  Copyright (C) 2003 SAN People (Pty) Ltd
-+ *
-+ * Based on SPI driver by Rick Bronson
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version
-+ * 2 of the License, or (at your option) any later version.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/slab.h>
-+#include <linux/highmem.h>
-+#include <linux/pagemap.h>
-+#include <asm/arch/spi.h>
-+
-+#ifdef CONFIG_DEVFS_FS
-+#include <linux/devfs_fs_kernel.h>
-+#endif
-+
-+
-+#undef DEBUG_SPIDEV
-+
-+/* ......................................................................... */
-+
-+/*
-+ * Read or Write to SPI bus.
-+ */
-+static ssize_t spidev_rd_wr(struct file *file, char *buf, size_t count, loff_t *offset)
-+{
-+	unsigned int spi_device = (unsigned int) file->private_data;
-+
-+	struct mm_struct * mm;
-+	struct page ** maplist;
-+	struct spi_transfer_list* list;
-+	int    pgcount;
-+
-+	unsigned int ofs, pagelen;
-+	int res, i, err;
-+
-+	if (!count) {
-+		return 0;
-+	}
-+
-+	list = kmalloc(sizeof(struct spi_transfer_list), GFP_KERNEL);
-+	if (!list) {
-+		return -ENOMEM;
-+	}
-+
-+	mm = current->mm;
-+
-+	pgcount = ((unsigned long)buf+count+PAGE_SIZE-1)/PAGE_SIZE - (unsigned long)buf/PAGE_SIZE;
-+
-+	if (pgcount >= MAX_SPI_TRANSFERS) {
-+		kfree(list);
-+		return -EFBIG;
-+	}
-+
-+	maplist = kmalloc (pgcount * sizeof (struct page *), GFP_KERNEL);
-+
-+	if (!maplist) {
-+		kfree(list);
-+		return -ENOMEM;
-+	}
-+	flush_cache_all();
-+	down_read(&mm->mmap_sem);
-+	err= get_user_pages(current, mm, (unsigned long)buf, pgcount, 1, 0, maplist, NULL);
-+	up_read(&mm->mmap_sem);
-+
-+	if (err < 0) {
-+		kfree(list);
-+		kfree(maplist);
-+		return err;
-+	}
-+	pgcount = err;
-+
-+#ifdef DEBUG_SPIDEV
-+	printk("spidev_rd_rw: %i %i\n", count, pgcount);
-+#endif
-+
-+	/* Set default return value = transfer length */
-+	res = count;
-+
-+	/*
-+	 * At this point, the virtual area buf[0] .. buf[count-1] will have
-+	 * corresponding pages mapped in the physical memory and locked until
-+	 * we unmap the kiobuf.  The pages cannot be swapped out or moved
-+	 * around.
-+	 */
-+	ofs = (unsigned long) buf & (PAGE_SIZE -1);
-+	pagelen = PAGE_SIZE - ofs;
-+	if (count < pagelen)
-+		pagelen = count;
-+
-+	for (i = 0; i < pgcount; i++) {
-+		flush_dcache_page(maplist[i]);
-+
-+		list->tx[i] = list->rx[i] = page_address(maplist[i]) + ofs;
-+		list->txlen[i] = list->rxlen[i] = pagelen;
-+
-+#ifdef DEBUG_SPIDEV
-+		printk("  %i: %x  (%i)\n", i, list->tx[i], list->txlen[i]);
-+#endif
-+
-+		ofs = 0;	/* all subsequent transfers start at beginning of a page */
-+		count = count - pagelen;
-+		pagelen = (count < PAGE_SIZE) ? count : PAGE_SIZE;
-+	}
-+	list->nr_transfers = pgcount;
-+
-+	/* Perform transfer on SPI bus */
-+	spi_access_bus(spi_device);
-+	spi_transfer(list);
-+	spi_release_bus(spi_device);
-+
-+	while (pgcount--) {
-+		page_cache_release (maplist[pgcount]);
-+	}
-+	flush_cache_all();
-+
-+	kfree(maplist);
-+	kfree(list);
-+
-+	return res;
-+}
-+
-+static int spidev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-+{
-+	int spi_device = MINOR(inode->i_rdev);
-+
-+	if (spi_device >= NR_SPI_DEVICES)
-+		return -ENODEV;
-+
-+	// TODO: This interface can be used to configure the SPI bus.
-+	// Configurable options could include: Speed, Clock Polarity, Clock Phase
-+
-+	switch(cmd) {
-+		default:
-+			return -ENOIOCTLCMD;
-+	}
-+}
-+
-+/*
-+ * Open the SPI device
-+ */
-+static int spidev_open(struct inode *inode, struct file *file)
-+{
-+	unsigned int spi_device = MINOR(inode->i_rdev);
-+
-+	if (spi_device >= NR_SPI_DEVICES)
-+		return -ENODEV;
-+
-+	/*
-+	 * 'private_data' is actually a pointer, but we overload it with the
-+	 * value we want to store.
-+	 */
-+	file->private_data = (void *)spi_device;
-+
-+	return 0;
-+}
-+
-+/*
-+ * Close the SPI device
-+ */
-+static int spidev_close(struct inode *inode, struct file *file)
-+{
-+	return 0;
-+}
-+
-+/* ......................................................................... */
-+
-+static struct file_operations spidev_fops = {
-+	.owner		= THIS_MODULE,
-+	.llseek		= no_llseek,
-+	.read		= spidev_rd_wr,
-+	.write		= (int (*) (struct file *file, const char *buf, size_t count, loff_t *offset))spidev_rd_wr,
-+	.ioctl		= spidev_ioctl,
-+	.open		= spidev_open,
-+	.release	= spidev_close,
-+};
-+
-+/*
-+ * Install the SPI /dev interface driver
-+ */
-+static int __init at91_spidev_init(void)
-+{
-+#ifdef CONFIG_DEVFS_FS
-+	int i;
-+#endif
-+
-+	if (register_chrdev(SPI_MAJOR, "spi", &spidev_fops)) {
-+		printk(KERN_ERR "at91_spidev: Unable to get major %d for SPI bus\n", SPI_MAJOR);
-+		return -EIO;
-+	}
-+
-+#ifdef CONFIG_DEVFS_FS
-+	devfs_mk_dir("spi");
-+	for (i = 0; i < NR_SPI_DEVICES; i++) {
-+		devfs_mk_cdev(MKDEV(SPI_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR, "spi/%d",i);
-+	}
-+#endif
-+	printk(KERN_INFO "AT91 SPI driver loaded\n");
-+
-+	return 0;
-+}
-+
-+/*
-+ * Remove the SPI /dev interface driver
-+ */
-+static void __exit at91_spidev_exit(void)
-+{
-+#ifdef CONFIG_DEVFS_FS
-+	int i;
-+	for (i = 0; i < NR_SPI_DEVICES; i++) {
-+		devfs_remove("spi/%d", i);
-+	}
-+
-+	devfs_remove("spi");
-+#endif
-+
-+	if (unregister_chrdev(SPI_MAJOR, "spi")) {
-+		printk(KERN_ERR "at91_spidev: Unable to release major %d for SPI bus\n", SPI_MAJOR);
-+		return;
-+	}
-+}
-+
-+module_init(at91_spidev_init);
-+module_exit(at91_spidev_exit);
-+
-+MODULE_LICENSE("GPL")
-+MODULE_AUTHOR("Andrew Victor")
-+MODULE_DESCRIPTION("SPI /dev interface for Atmel AT91RM9200")
-Index: linux-2.6.21.7/drivers/i2c/busses/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/i2c/busses/Kconfig
-+++ linux-2.6.21.7/drivers/i2c/busses/Kconfig
-@@ -81,6 +81,14 @@ config I2C_AT91
- 	  This supports the use of the I2C interface on Atmel AT91
- 	  processors.
- 
-+config I2C_AT91_CLOCKRATE
-+	prompt "Atmel AT91 I2C/TWI clock-rate"
-+	depends on I2C_AT91
-+	int
-+	default 100000
-+	help
-+	  Set the AT91 I2C/TWI clock-rate.
-+
- config I2C_AU1550
- 	tristate "Au1550/Au1200 SMBus interface"
- 	depends on I2C && (SOC_AU1550 || SOC_AU1200)
-@@ -545,6 +553,14 @@ config I2C_VOODOO3
- 	  This driver can also be built as a module.  If so, the module
- 	  will be called i2c-voodoo3.
- 
-+config I2C_PCA
-+	tristate "PCA9564"
-+	depends on I2C
-+	select I2C_ALGOPCA
-+	help
-+	  This driver support the Philips PCA 9564 Parallel bus to I2C
-+	  bus controller.
-+
- config I2C_PCA_ISA
- 	tristate "PCA9564 on an ISA bus"
- 	depends on I2C
-Index: linux-2.6.21.7/drivers/i2c/busses/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/i2c/busses/Makefile
-+++ linux-2.6.21.7/drivers/i2c/busses/Makefile
-@@ -28,6 +28,7 @@ obj-$(CONFIG_I2C_OMAP)		+= i2c-omap.o
- obj-$(CONFIG_I2C_PARPORT)	+= i2c-parport.o
- obj-$(CONFIG_I2C_PARPORT_LIGHT)	+= i2c-parport-light.o
- obj-$(CONFIG_I2C_PASEMI)	+= i2c-pasemi.o
-+obj-$(CONFIG_I2C_PCA)		+= i2c-pca.o
- obj-$(CONFIG_I2C_PCA_ISA)	+= i2c-pca-isa.o
- obj-$(CONFIG_I2C_PIIX4)		+= i2c-piix4.o
- obj-$(CONFIG_I2C_PNX)		+= i2c-pnx.o
-Index: linux-2.6.21.7/drivers/i2c/busses/i2c-at91.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/i2c/busses/i2c-at91.c
-+++ linux-2.6.21.7/drivers/i2c/busses/i2c-at91.c
-@@ -31,8 +31,11 @@
- #include <asm/arch/board.h>
- #include <asm/arch/cpu.h>
- 
--#define TWI_CLOCK		100000		/* Hz. max 400 Kbits/sec */
- 
-+/* Clockrate is configurable - max 400 Kbits/sec */
-+static unsigned int clockrate = CONFIG_I2C_AT91_CLOCKRATE;
-+module_param(clockrate, uint, 0);
-+MODULE_PARM_DESC(clockrate, "The TWI clockrate");
- 
- static struct clk *twi_clk;
- static void __iomem *twi_base;
-@@ -53,7 +56,7 @@ static void __devinit at91_twi_hwinit(vo
- 	at91_twi_write(AT91_TWI_CR, AT91_TWI_MSEN);	/* Set Master mode */
- 
- 	/* Calcuate clock dividers */
--	cdiv = (clk_get_rate(twi_clk) / (2 * TWI_CLOCK)) - 3;
-+	cdiv = (clk_get_rate(twi_clk) / (2 * clockrate)) - 3;
- 	cdiv = cdiv + 1;	/* round up */
- 	ckdiv = 0;
- 	while (cdiv > 255) {
-@@ -61,11 +64,12 @@ static void __devinit at91_twi_hwinit(vo
- 		cdiv = cdiv >> 1;
- 	}
- 
--	if (cpu_is_at91rm9200()) {			/* AT91RM9200 Errata #22 */
--		if (ckdiv > 5) {
--			printk(KERN_ERR "AT91 I2C: Invalid TWI_CLOCK value!\n");
--			ckdiv = 5;
--		}
-+	if (cpu_is_at91rm9200() && (ckdiv > 5)) {	/* AT91RM9200 Errata #22 */
-+		printk(KERN_ERR "AT91 I2C: Invalid TWI clockrate!\n");
-+		ckdiv = 5;
-+	} else if (ckdiv > 7) {
-+		printk(KERN_ERR "AT91 I2C: Invalid TWI clockrate!\n");
-+		ckdiv = 7;
- 	}
- 
- 	at91_twi_write(AT91_TWI_CWGR, (ckdiv << 16) | (cdiv << 8) | cdiv);
-Index: linux-2.6.21.7/drivers/i2c/busses/i2c-pca.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/i2c/busses/i2c-pca.c
-@@ -0,0 +1,213 @@
-+/*
-+ *  Platform driver for PCA9564 I2C bus controller.
-+ *
-+ *  (C) 2006 Andrew Victor
-+ *
-+ *  Based on i2c-pca-isa.c driver for PCA9564 on ISA boards
-+ *    Copyright (C) 2004 Arcom Control Systems
-+ *
-+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/moduleparam.h>
-+#include <linux/delay.h>
-+#include <linux/init.h>
-+#include <linux/interrupt.h>
-+#include <linux/wait.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/i2c.h>
-+#include <linux/i2c-algo-pca.h>
-+
-+#include <asm/io.h>
-+
-+#include "../algos/i2c-algo-pca.h"
-+
-+#define PCA_OWN_ADDRESS		0x55	/* our address for slave mode */
-+#define PCA_CLOCK		I2C_PCA_CON_59kHz
-+
-+//#define REG_SHIFT		2
-+#define REG_SHIFT		0
-+
-+//#define DEBUG_IO
-+
-+#define PCA_IO_SIZE 4
-+
-+static void __iomem *base_addr;
-+static int irq;
-+static wait_queue_head_t pca_wait;
-+
-+static int pca_getown(struct i2c_algo_pca_data *adap)
-+{
-+	return PCA_OWN_ADDRESS;
-+}
-+
-+static int pca_getclock(struct i2c_algo_pca_data *adap)
-+{
-+	return PCA_CLOCK;
-+}
-+
-+static void pca_writebyte(struct i2c_algo_pca_data *adap, int reg, int val)
-+{
-+#ifdef DEBUG_IO
-+	static char *names[] = { "T/O", "DAT", "ADR", "CON" };
-+	printk("*** write %s at %#lx <= %#04x\n", names[reg], (unsigned long) base_addr+reg, val);
-+#endif
-+	udelay(1);
-+	outb(val, base_addr + (reg << REG_SHIFT));
-+}
-+
-+static int pca_readbyte(struct i2c_algo_pca_data *adap, int reg)
-+{
-+	int res;
-+
-+	udelay(1);
-+	res = inb(base_addr + (reg << REG_SHIFT));
-+#ifdef DEBUG_IO
-+	{
-+		static char *names[] = { "STA", "DAT", "ADR", "CON" };
-+		printk("*** read  %s => %#04x\n", names[reg], res);
-+	}
-+#endif
-+	return res;
-+}
-+
-+static int pca_waitforinterrupt(struct i2c_algo_pca_data *adap)
-+{
-+	int ret = 0;
-+
-+	if (irq > -1) {
-+		ret = wait_event_interruptible(pca_wait,
-+				pca_readbyte(adap, I2C_PCA_CON) & I2C_PCA_CON_SI);
-+	} else {
-+		while ((pca_readbyte(adap, I2C_PCA_CON) & I2C_PCA_CON_SI) == 0)
-+			udelay(100);
-+	}
-+	return ret;
-+}
-+
-+static irqreturn_t pca_handler(int this_irq, void *dev_id)
-+{
-+	wake_up_interruptible(&pca_wait);
-+	return IRQ_HANDLED;
-+}
-+
-+static struct i2c_algo_pca_data pca_i2c_data = {
-+	.get_own		= pca_getown,
-+	.get_clock		= pca_getclock,
-+	.write_byte		= pca_writebyte,
-+	.read_byte		= pca_readbyte,
-+	.wait_for_interrupt	= pca_waitforinterrupt,
-+};
-+
-+static struct i2c_adapter pca_i2c_ops = {
-+	.owner          = THIS_MODULE,
-+	.id		= I2C_HW_A_PLAT,
-+	.algo_data	= &pca_i2c_data,
-+	.name		= "PCA9564",
-+	.class		= I2C_CLASS_HWMON,
-+};
-+
-+static int __devinit pca_i2c_probe(struct platform_device *pdev)
-+{
-+	struct resource *res;
-+
-+	init_waitqueue_head(&pca_wait);
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	if (!res)
-+		return -ENODEV;
-+
-+	if (!request_mem_region(res->start, PCA_IO_SIZE, "PCA9564"))
-+		return -ENXIO;
-+
-+	base_addr = ioremap(res->start, PCA_IO_SIZE);
-+	if (base_addr == NULL)
-+		goto out_region;
-+
-+	irq = platform_get_irq(pdev, 0);
-+	if (irq > -1) {
-+		if (request_irq(irq, pca_handler, 0, "pca9564", NULL) < 0) {
-+			printk(KERN_ERR "i2c-pca: Request irq%d failed\n", irq);
-+			goto out_remap;
-+		}
-+	}
-+
-+	/* set up the driverfs linkage to our parent device */
-+	pca_i2c_ops.dev.parent = &pdev->dev;
-+
-+	if (i2c_pca_add_bus(&pca_i2c_ops) < 0) {
-+		printk(KERN_ERR "i2c-pca: Failed to add i2c bus\n");
-+		goto out_irq;
-+	}
-+
-+	return 0;
-+
-+ out_irq:
-+	if (irq > -1)
-+		free_irq(irq, &pca_i2c_ops);
-+
-+ out_remap:
-+	iounmap(base_addr);
-+
-+ out_region:
-+	release_mem_region(res->start, PCA_IO_SIZE);
-+	return -ENODEV;
-+}
-+
-+static int __devexit pca_i2c_remove(struct platform_device *pdev)
-+{
-+	struct resource *res;
-+
-+	i2c_del_adapter(&pca_i2c_ops);
-+
-+	if (irq > 0)
-+		free_irq(irq, NULL);
-+
-+	iounmap(base_addr);
-+
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	release_mem_region(res->start, PCA_IO_SIZE);
-+
-+	return 0;
-+}
-+
-+static struct platform_driver pca_i2c_driver = {
-+	.probe		= pca_i2c_probe,
-+	.remove		= __devexit_p(pca_i2c_remove),
-+	.driver		= {
-+		.name	= "pca9564",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+static int __init pca_i2c_init(void)
-+{
-+	return platform_driver_register(&pca_i2c_driver);
-+}
-+
-+static void __exit pca_i2c_exit(void)
-+{
-+	platform_driver_unregister(&pca_i2c_driver);
-+}
-+
-+module_init(pca_i2c_init);
-+module_exit(pca_i2c_exit);
-+
-+MODULE_AUTHOR("Andrew Victor");
-+MODULE_DESCRIPTION("PCA9564 platform driver");
-+MODULE_LICENSE("GPL");
-Index: linux-2.6.21.7/drivers/input/touchscreen/ads7846.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/input/touchscreen/ads7846.c
-+++ linux-2.6.21.7/drivers/input/touchscreen/ads7846.c
-@@ -39,7 +39,8 @@
- /*
-  * This code has been heavily tested on a Nokia 770, and lightly
-  * tested on other ads7846 devices (OSK/Mistral, Lubbock).
-- * Support for ads7843 and ads7845 has only been stubbed in.
-+ * Support for ads7843 tested on Atmel at91sam926x-EK.
-+ * Support for ads7845 has only been stubbed in.
-  *
-  * IRQ handling needs a workaround because of a shortcoming in handling
-  * edge triggered IRQs on some platforms like the OMAP1/2. These
-@@ -246,18 +247,16 @@ static int ads7846_read12_ser(struct dev
- 
- 	/* REVISIT:  take a few more samples, and compare ... */
- 
--	/* maybe off internal vREF */
--	if (use_internal) {
--		req->ref_off = REF_OFF;
--		req->xfer[4].tx_buf = &req->ref_off;
--		req->xfer[4].len = 1;
--		spi_message_add_tail(&req->xfer[4], &req->msg);
--
--		req->xfer[5].rx_buf = &req->scratch;
--		req->xfer[5].len = 2;
--		CS_CHANGE(req->xfer[5]);
--		spi_message_add_tail(&req->xfer[5], &req->msg);
--	}
-+	/* converter in low power mode & enable PENIRQ */
-+	req->ref_off = PWRDOWN;
-+	req->xfer[4].tx_buf = &req->ref_off;
-+	req->xfer[4].len = 1;
-+	spi_message_add_tail(&req->xfer[4], &req->msg);
-+
-+	req->xfer[5].rx_buf = &req->scratch;
-+	req->xfer[5].len = 2;
-+	CS_CHANGE(req->xfer[5]);
-+	spi_message_add_tail(&req->xfer[5], &req->msg);
- 
- 	ts->irq_disabled = 1;
- 	disable_irq(spi->irq);
-@@ -536,6 +535,9 @@ static void ads7846_rx(void *ads)
- 	} else
- 		Rt = 0;
- 
-+	if (ts->model == 7843)
-+		Rt = ts->pressure_max / 2;
-+
- 	/* Sample found inconsistent by debouncing or pressure is beyond
- 	 * the maximum. Don't report it to user space, repeat at least
- 	 * once more the measurement
-Index: linux-2.6.21.7/drivers/leds/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/leds/Kconfig
-+++ linux-2.6.21.7/drivers/leds/Kconfig
-@@ -76,6 +76,13 @@ config LEDS_NET48XX
- 	  This option enables support for the Soekris net4801 and net4826 error
- 	  LED.
- 
-+config LEDS_AT91
-+	tristate "LED support using AT91 GPIOs"
-+	depends on LEDS_CLASS && ARCH_AT91 && !LEDS
-+	help
-+	  This option enables support for LEDs connected to GPIO lines
-+	  on AT91-based boards.
-+
- config LEDS_WRAP
- 	tristate "LED Support for the WRAP series LEDs"
- 	depends on LEDS_CLASS && SCx200_GPIO
-Index: linux-2.6.21.7/drivers/leds/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/leds/Makefile
-+++ linux-2.6.21.7/drivers/leds/Makefile
-@@ -16,6 +16,7 @@ obj-$(CONFIG_LEDS_NET48XX)		+= leds-net4
- obj-$(CONFIG_LEDS_WRAP)			+= leds-wrap.o
- obj-$(CONFIG_LEDS_H1940)		+= leds-h1940.o
- obj-$(CONFIG_LEDS_COBALT)		+= leds-cobalt.o
-+obj-$(CONFIG_LEDS_AT91)			+= leds-at91.o
- 
- # LED Triggers
- obj-$(CONFIG_LEDS_TRIGGER_TIMER)	+= ledtrig-timer.o
-Index: linux-2.6.21.7/drivers/leds/leds-at91.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/leds/leds-at91.c
-@@ -0,0 +1,140 @@
-+/*
-+ * AT91 GPIO based LED driver
-+ *
-+ * Copyright (C) 2006 David Brownell
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+#include <linux/leds.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+
-+static LIST_HEAD(at91_led_list);	/* list of AT91 LEDs */
-+
-+struct at91_led {
-+	struct led_classdev	cdev;
-+	struct list_head	list;
-+	struct at91_gpio_led	*led_data;
-+};
-+
-+/*
-+ * Change the state of the LED.
-+ */
-+static void at91_led_set(struct led_classdev *cdev, enum led_brightness value)
-+{
-+	struct at91_led	*led = container_of(cdev, struct at91_led, cdev);
-+	short		active = (value == LED_OFF);
-+
-+	if (led->led_data->flags & 1)	/* active high/low? */
-+		active = !active;
-+	at91_set_gpio_value(led->led_data->gpio, active);
-+}
-+
-+static int __devexit at91_led_remove(struct platform_device *pdev)
-+{
-+	struct at91_led		*led;
-+
-+	list_for_each_entry (led, &at91_led_list, list)
-+		led_classdev_unregister(&led->cdev);
-+
-+#warning "Free allocated memory"
-+	// TODO: Free memory.	kfree(led);
-+
-+	return 0;
-+}
-+
-+static int __init at91_led_probe(struct platform_device *pdev)
-+{
-+	int			status = 0;
-+	struct at91_gpio_led	*pdata = pdev->dev.platform_data;
-+	unsigned		nr_leds;
-+	struct at91_led		*led;
-+
-+	if (!pdata)
-+		return -ENODEV;
-+
-+	nr_leds = pdata->index;		/* first index stores number of LEDs */
-+
-+	while (nr_leds--) {
-+		led = kzalloc(sizeof(struct at91_led), GFP_KERNEL);
-+		if (!led) {
-+			dev_err(&pdev->dev, "No memory for device\n");
-+			status = -ENOMEM;
-+			goto cleanup;
-+		}
-+		led->led_data = pdata;
-+		led->cdev.name = pdata->name;
-+		led->cdev.brightness_set = at91_led_set,
-+		led->cdev.default_trigger = pdata->trigger;
-+
-+		status = led_classdev_register(&pdev->dev, &led->cdev);
-+		if (status < 0) {
-+			dev_err(&pdev->dev, "led_classdev_register failed - %d\n", status);
-+cleanup:
-+			at91_led_remove(pdev);
-+			break;
-+		}
-+		list_add(&led->list, &at91_led_list);
-+		pdata++;
-+	}
-+	return status;
-+}
-+
-+#ifdef CONFIG_PM
-+static int at91_led_suspend(struct platform_device *dev, pm_message_t state)
-+{
-+	struct at91_led	*led;
-+
-+	list_for_each_entry (led, &at91_led_list, list)
-+		led_classdev_suspend(&led->cdev);
-+
-+	return 0;
-+}
-+
-+static int at91_led_resume(struct platform_device *dev)
-+{
-+	struct at91_led	*led;
-+
-+	list_for_each_entry (led, &at91_led_list, list)
-+		led_classdev_resume(&led->cdev);
-+
-+	return 0;
-+}
-+#else
-+#define	at91_led_suspend	NULL
-+#define	at91_led_resume		NULL
-+#endif
-+
-+static struct platform_driver at91_led_driver = {
-+	.probe		= at91_led_probe,
-+	.remove		= __devexit_p(at91_led_remove),
-+	.suspend	= at91_led_suspend,
-+	.resume		= at91_led_resume,
-+	.driver		= {
-+		.name	= "at91_leds",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+static int __init at91_led_init(void)
-+{
-+	return platform_driver_register(&at91_led_driver);
-+}
-+module_init(at91_led_init);
-+
-+static void __exit at91_led_exit(void)
-+{
-+	platform_driver_unregister(&at91_led_driver);
-+}
-+module_exit(at91_led_exit);
-+
-+MODULE_DESCRIPTION("AT91 GPIO LED driver");
-+MODULE_AUTHOR("David Brownell");
-+MODULE_LICENSE("GPL");
-Index: linux-2.6.21.7/drivers/mmc/at91_mci.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/mmc/at91_mci.c
-+++ linux-2.6.21.7/drivers/mmc/at91_mci.c
-@@ -86,7 +86,7 @@
- 
- #define AT91_MCI_ERRORS	(AT91_MCI_RINDE | AT91_MCI_RDIRE | AT91_MCI_RCRCE	\
- 		| AT91_MCI_RENDE | AT91_MCI_RTOE | AT91_MCI_DCRCE		\
--		| AT91_MCI_DTOE | AT91_MCI_OVRE | AT91_MCI_UNRE)			
-+		| AT91_MCI_DTOE | AT91_MCI_OVRE | AT91_MCI_UNRE)
- 
- #define at91_mci_read(host, reg)	__raw_readl((host)->baseaddr + (reg))
- #define at91_mci_write(host, reg, val)	__raw_writel((val), (host)->baseaddr + (reg))
-@@ -561,9 +561,7 @@ static void at91mci_completed_command(st
- 	pr_debug("Status = %08X [%08X %08X %08X %08X]\n",
- 		 status, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);
- 
--	if (status & (AT91_MCI_RINDE | AT91_MCI_RDIRE | AT91_MCI_RCRCE |
--			AT91_MCI_RENDE | AT91_MCI_RTOE | AT91_MCI_DCRCE |
--			AT91_MCI_DTOE | AT91_MCI_OVRE | AT91_MCI_UNRE)) {
-+	if (status & AT91_MCI_ERRORS) {
- 		if ((status & AT91_MCI_RCRCE) &&
- 			((cmd->opcode == MMC_SEND_OP_COND) || (cmd->opcode == SD_APP_OP_COND))) {
- 			cmd->error = MMC_ERR_NONE;
-@@ -665,15 +663,15 @@ static irqreturn_t at91_mci_irq(int irq,
- 
- 	int_status = at91_mci_read(host, AT91_MCI_SR);
- 	int_mask = at91_mci_read(host, AT91_MCI_IMR);
--	
-+
- 	pr_debug("MCI irq: status = %08X, %08X, %08X\n", int_status, int_mask,
- 		int_status & int_mask);
--	
-+
- 	int_status = int_status & int_mask;
- 
- 	if (int_status & AT91_MCI_ERRORS) {
- 		completed = 1;
--		
-+
- 		if (int_status & AT91_MCI_UNRE)
- 			pr_debug("MMC: Underrun error\n");
- 		if (int_status & AT91_MCI_OVRE)
-@@ -821,7 +819,7 @@ static int __init at91_mci_probe(struct 
- 	mmc->f_min = 375000;
- 	mmc->f_max = 25000000;
- 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
--	mmc->caps = MMC_CAP_BYTEBLOCK;
-+	mmc->caps = MMC_CAP_BYTEBLOCK | MMC_CAP_MULTIWRITE;
- 
- 	mmc->max_blk_size = 4095;
- 	mmc->max_blk_count = mmc->max_req_size;
-@@ -895,6 +893,8 @@ static int __init at91_mci_probe(struct 
- 
- 	mmc_add_host(mmc);
- 
-+	device_init_wakeup(&pdev->dev, 1);
-+
- 	/*
- 	 * monitor card insertion/removal if we can
- 	 */
-@@ -924,6 +924,8 @@ static int __exit at91_mci_remove(struct
- 
- 	host = mmc_priv(mmc);
- 
-+	device_init_wakeup(&pdev->dev, 0);
-+
- 	if (host->present != -1) {
- 		free_irq(host->board->det_pin, host);
- 		cancel_delayed_work(&host->mmc->detect);
-@@ -951,8 +953,12 @@ static int __exit at91_mci_remove(struct
- static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
- {
- 	struct mmc_host *mmc = platform_get_drvdata(pdev);
-+	struct at91mci_host *host = mmc_priv(mmc);
- 	int ret = 0;
- 
-+	if (device_may_wakeup(&pdev->dev))
-+		enable_irq_wake(host->board->det_pin);
-+
- 	if (mmc)
- 		ret = mmc_suspend_host(mmc, state);
- 
-@@ -962,8 +968,12 @@ static int at91_mci_suspend(struct platf
- static int at91_mci_resume(struct platform_device *pdev)
- {
- 	struct mmc_host *mmc = platform_get_drvdata(pdev);
-+	struct at91mci_host *host = mmc_priv(mmc);
- 	int ret = 0;
- 
-+	if (device_may_wakeup(&pdev->dev))
-+		disable_irq_wake(host->board->det_pin);
-+
- 	if (mmc)
- 		ret = mmc_resume_host(mmc);
- 
-Index: linux-2.6.21.7/drivers/mtd/devices/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/mtd/devices/Kconfig
-+++ linux-2.6.21.7/drivers/mtd/devices/Kconfig
-@@ -267,5 +267,11 @@ config MTD_DOCPROBE_55AA
- 	  LinuxBIOS or if you need to recover a DiskOnChip Millennium on which
- 	  you have managed to wipe the first block.
- 
--endmenu
-+config MTD_AT91_DATAFLASH
-+	tristate "AT91RM9200 DataFlash AT45DBxxx (legacy driver)"
-+	depends on MTD && ARCH_AT91RM9200 && AT91_SPI
-+	help
-+	  This enables access to the DataFlash (AT45DBxxx) on the AT91RM9200.
-+	  If you have such a board, say 'Y'.
- 
-+endmenu
-Index: linux-2.6.21.7/drivers/mtd/devices/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/mtd/devices/Makefile
-+++ linux-2.6.21.7/drivers/mtd/devices/Makefile
-@@ -17,3 +17,4 @@ obj-$(CONFIG_MTD_LART)		+= lart.o
- obj-$(CONFIG_MTD_BLOCK2MTD)	+= block2mtd.o
- obj-$(CONFIG_MTD_DATAFLASH)	+= mtd_dataflash.o
- obj-$(CONFIG_MTD_M25P80)	+= m25p80.o
-+obj-$(CONFIG_MTD_AT91_DATAFLASH)+= at91_dataflash.o
-Index: linux-2.6.21.7/drivers/mtd/devices/at91_dataflash.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/mtd/devices/at91_dataflash.c
-@@ -0,0 +1,667 @@
-+/*
-+ * Atmel DataFlash driver for Atmel AT91RM9200 (Thunder)
-+ *
-+ *  Copyright (C) SAN People (Pty) 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.
-+*/
-+
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/slab.h>
-+#include <linux/pci.h>
-+#include <linux/mtd/mtd.h>
-+#include <linux/mtd/partitions.h>
-+
-+#include <asm/arch/spi.h>
-+
-+#undef DEBUG_DATAFLASH
-+
-+#define DATAFLASH_MAX_DEVICES	4	/* max number of dataflash devices */
-+#undef	DATAFLASH_ALWAYS_ADD_DEVICE	/* always add whole device when using partitions? */
-+
-+#define OP_READ_CONTINUOUS	0xE8
-+#define OP_READ_PAGE		0xD2
-+#define OP_READ_BUFFER1		0xD4
-+#define OP_READ_BUFFER2		0xD6
-+#define OP_READ_STATUS		0xD7
-+
-+#define OP_ERASE_PAGE		0x81
-+#define OP_ERASE_BLOCK		0x50
-+
-+#define OP_TRANSFER_BUF1	0x53
-+#define OP_TRANSFER_BUF2	0x55
-+#define OP_COMPARE_BUF1		0x60
-+#define OP_COMPARE_BUF2		0x61
-+
-+#define OP_PROGRAM_VIA_BUF1	0x82
-+#define OP_PROGRAM_VIA_BUF2	0x85
-+
-+struct dataflash_local
-+{
-+	int spi;			/* SPI chip-select number */
-+
-+	unsigned int page_size;		/* number of bytes per page */
-+	unsigned short page_offset;	/* page offset in flash address */
-+};
-+
-+
-+/* Detected DataFlash devices */
-+static struct mtd_info* mtd_devices[DATAFLASH_MAX_DEVICES];
-+static int nr_devices = 0;
-+
-+/* ......................................................................... */
-+
-+#ifdef CONFIG_MTD_PARTITIONS
-+
-+static struct mtd_partition static_partitions_2M[] =
-+{
-+	{
-+		.name		= "bootloader",
-+		.offset		= 0,
-+		.size		= 1 * 32 * 8 * 528,	/* 1st sector = 32 blocks * 8 pages * 528 bytes */
-+		.mask_flags	= MTD_WRITEABLE,	/* read-only */
-+	},
-+	{
-+		.name		= "kernel",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= 6 * 32 * 8 * 528,	/* 6 sectors */
-+	},
-+	{
-+		.name		= "filesystem",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= MTDPART_SIZ_FULL,	/* rest = 9 sectors */
-+	}
-+};
-+
-+static struct mtd_partition static_partitions_4M[] =
-+{
-+	{
-+		.name		= "bootloader",
-+		.offset		= 0,
-+		.size		= 1 * 64 * 8 * 528,	/* 1st sector = 64 blocks * 8 pages * 528 bytes */
-+		.mask_flags	= MTD_WRITEABLE,	/* read-only */
-+	},
-+	{
-+		.name		= "kernel",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= 4 * 64 * 8 * 528,	/* 4 sectors */
-+	},
-+	{
-+		.name		= "filesystem",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= MTDPART_SIZ_FULL,	/* rest = 11 sectors */
-+	}
-+};
-+
-+#if defined(CONFIG_MACH_KAFA)
-+static struct mtd_partition static_partitions_8M[] =
-+{
-+	{
-+		name:		"romboot",
-+		offset:		0,
-+		size:		16 * 1056,	/* 160 Kb */
-+		mask_flags:	MTD_WRITEABLE,		/* read-only */
-+	},
-+	{
-+		name:		"uboot",
-+		offset:		MTDPART_OFS_APPEND, /* Sperry, NXTBLK is broken */
-+		size:		128 * 1056,		/* 1 MB */
-+	},
-+	{
-+		name:		"kernel",
-+		offset:		MTDPART_OFS_APPEND, /* Sperry, NXTBLK is broken */
-+		size:		1024 * 1056,		/* 1 MB */
-+	},
-+	{
-+		name:		"filesystem",
-+		offset:		MTDPART_OFS_APPEND, /* Sperry, NXTBLK is broken */
-+		size:		MTDPART_SIZ_FULL,
-+	}
-+};
-+
-+#elif defined(CONFIG_MACH_MULTMDP)
-+
-+static struct mtd_partition static_partitions_8M[] =
-+{
-+	{
-+		.name		= "bootloader",
-+		.offset		= 0,
-+		.size		= 12 * 1056,		/* 1st sector = 32 blocks * 8 pages * 1056 bytes */
-+		.mask_flags	= MTD_WRITEABLE,	/* read-only */
-+	},
-+	{
-+		.name		= "configuration",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= 20 * 1056,
-+	},
-+	{
-+		.name		= "kernel",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= 1520 * 1056,
-+	},
-+	{
-+		.name		= "filesystem",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= MTDPART_SIZ_FULL,
-+	}
-+};
-+
-+#else
-+
-+static struct mtd_partition static_partitions_8M[] =
-+{
-+	{
-+		.name		= "bootloader",
-+		.offset		= 0,
-+		.size		= 1 * 32 * 8 * 1056,	/* 1st sector = 32 blocks * 8 pages * 1056 bytes */
-+		.mask_flags	= MTD_WRITEABLE,	/* read-only */
-+	},
-+	{
-+		.name		= "kernel",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= 5 * 32 * 8 * 1056,	/* 5 sectors */
-+	},
-+	{
-+		.name		= "filesystem",
-+		.offset		= MTDPART_OFS_NXTBLK,
-+		.size		= MTDPART_SIZ_FULL,	/* rest = 26 sectors */
-+	}
-+};
-+#endif
-+
-+static const char *part_probes[] = { "cmdlinepart", NULL, };
-+
-+#endif
-+
-+/* ......................................................................... */
-+
-+/* Allocate a single SPI transfer descriptor.  We're assuming that if multiple
-+   SPI transfers occur at the same time, spi_access_bus() will serialize them.
-+   If this is not valid, then either (i) each dataflash 'priv' structure
-+   needs it's own transfer descriptor, (ii) we lock this one, or (iii) use
-+   another mechanism.   */
-+static struct spi_transfer_list* spi_transfer_desc;
-+
-+/*
-+ * Perform a SPI transfer to access the DataFlash device.
-+ */
-+static int do_spi_transfer(int nr, char* tx, int tx_len, char* rx, int rx_len,
-+		char* txnext, int txnext_len, char* rxnext, int rxnext_len)
-+{
-+	struct spi_transfer_list* list = spi_transfer_desc;
-+
-+	list->tx[0] = tx;	list->txlen[0] = tx_len;
-+	list->rx[0] = rx;	list->rxlen[0] = rx_len;
-+
-+	list->tx[1] = txnext;	list->txlen[1] = txnext_len;
-+	list->rx[1] = rxnext;	list->rxlen[1] = rxnext_len;
-+
-+	list->nr_transfers = nr;
-+
-+	return spi_transfer(list);
-+}
-+
-+/* ......................................................................... */
-+
-+/*
-+ * Poll the DataFlash device until it is READY.
-+ */
-+static void at91_dataflash_waitready(void)
-+{
-+	char* command = kmalloc(2, GFP_KERNEL);
-+
-+	if (!command)
-+		return;
-+
-+	do {
-+		command[0] = OP_READ_STATUS;
-+		command[1] = 0;
-+
-+		do_spi_transfer(1, command, 2, command, 2, NULL, 0, NULL, 0);
-+	} while ((command[1] & 0x80) == 0);
-+
-+	kfree(command);
-+}
-+
-+/*
-+ * Return the status of the DataFlash device.
-+ */
-+static unsigned short at91_dataflash_status(void)
-+{
-+	unsigned short status;
-+	char* command = kmalloc(2, GFP_KERNEL);
-+
-+	if (!command)
-+		return 0;
-+
-+	command[0] = OP_READ_STATUS;
-+	command[1] = 0;
-+
-+	do_spi_transfer(1, command, 2, command, 2, NULL, 0, NULL, 0);
-+	status = command[1];
-+
-+	kfree(command);
-+	return status;
-+}
-+
-+/* ......................................................................... */
-+
-+/*
-+ * Erase blocks of flash.
-+ */
-+static int at91_dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
-+{
-+	struct dataflash_local *priv = (struct dataflash_local *) mtd->priv;
-+	unsigned int pageaddr;
-+	char* command;
-+
-+#ifdef DEBUG_DATAFLASH
-+	printk("dataflash_erase: addr=%i len=%i\n", instr->addr, instr->len);
-+#endif
-+
-+	/* Sanity checks */
-+	if (instr->addr + instr->len > mtd->size)
-+		return -EINVAL;
-+	if ((instr->len % mtd->erasesize != 0) || (instr->len % priv->page_size != 0))
-+		return -EINVAL;
-+	if ((instr->addr % priv->page_size) != 0)
-+		return -EINVAL;
-+
-+	command = kmalloc(4, GFP_KERNEL);
-+	if (!command)
-+		return -ENOMEM;
-+
-+	while (instr->len > 0) {
-+		/* Calculate flash page address */
-+		pageaddr = (instr->addr / priv->page_size) << priv->page_offset;
-+
-+		command[0] = OP_ERASE_PAGE;
-+		command[1] = (pageaddr & 0x00FF0000) >> 16;
-+		command[2] = (pageaddr & 0x0000FF00) >> 8;
-+		command[3] = 0;
-+#ifdef DEBUG_DATAFLASH
-+		printk("ERASE: (%x) %x %x %x [%i]\n", command[0], command[1], command[2], command[3], pageaddr);
-+#endif
-+
-+		/* Send command to SPI device */
-+		spi_access_bus(priv->spi);
-+		do_spi_transfer(1, command, 4, command, 4, NULL, 0, NULL, 0);
-+
-+		at91_dataflash_waitready();		/* poll status until ready */
-+		spi_release_bus(priv->spi);
-+
-+		instr->addr += priv->page_size;		/* next page */
-+		instr->len -= priv->page_size;
-+	}
-+
-+	kfree(command);
-+
-+	/* Inform MTD subsystem that erase is complete */
-+	instr->state = MTD_ERASE_DONE;
-+	if (instr->callback)
-+		instr->callback(instr);
-+
-+	return 0;
-+}
-+
-+/*
-+ * Read from the DataFlash device.
-+ *   from   : Start offset in flash device
-+ *   len    : Amount to read
-+ *   retlen : About of data actually read
-+ *   buf    : Buffer containing the data
-+ */
-+static int at91_dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
-+{
-+	struct dataflash_local *priv = (struct dataflash_local *) mtd->priv;
-+	unsigned int addr;
-+	char* command;
-+
-+#ifdef DEBUG_DATAFLASH
-+	printk("dataflash_read: %lli .. %lli\n", from, from+len);
-+#endif
-+
-+	*retlen = 0;
-+
-+	/* Sanity checks */
-+	if (!len)
-+		return 0;
-+	if (from + len > mtd->size)
-+		return -EINVAL;
-+
-+	/* Calculate flash page/byte address */
-+	addr = (((unsigned)from / priv->page_size) << priv->page_offset) + ((unsigned)from % priv->page_size);
-+
-+	command = kmalloc(8, GFP_KERNEL);
-+	if (!command)
-+		return -ENOMEM;
-+
-+	command[0] = OP_READ_CONTINUOUS;
-+	command[1] = (addr & 0x00FF0000) >> 16;
-+	command[2] = (addr & 0x0000FF00) >> 8;
-+	command[3] = (addr & 0x000000FF);
-+#ifdef DEBUG_DATAFLASH
-+	printk("READ: (%x) %x %x %x\n", command[0], command[1], command[2], command[3]);
-+#endif
-+
-+	/* Send command to SPI device */
-+	spi_access_bus(priv->spi);
-+	do_spi_transfer(2, command, 8, command, 8, buf, len, buf, len);
-+	spi_release_bus(priv->spi);
-+
-+	*retlen = len;
-+	kfree(command);
-+	return 0;
-+}
-+
-+/*
-+ * Write to the DataFlash device.
-+ *   to     : Start offset in flash device
-+ *   len    : Amount to write
-+ *   retlen : Amount of data actually written
-+ *   buf    : Buffer containing the data
-+ */
-+static int at91_dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
-+{
-+	struct dataflash_local *priv = (struct dataflash_local *) mtd->priv;
-+	unsigned int pageaddr, addr, offset, writelen;
-+	size_t remaining;
-+	u_char *writebuf;
-+	unsigned short status;
-+	int res = 0;
-+	char* command;
-+	char* tmpbuf = NULL;
-+
-+#ifdef DEBUG_DATAFLASH
-+	printk("dataflash_write: %lli .. %lli\n", to, to+len);
-+#endif
-+
-+	*retlen = 0;
-+
-+	/* Sanity checks */
-+	if (!len)
-+		return 0;
-+	if (to + len > mtd->size)
-+		return -EINVAL;
-+
-+	command = kmalloc(4, GFP_KERNEL);
-+	if (!command)
-+		return -ENOMEM;
-+
-+	pageaddr = ((unsigned)to / priv->page_size);
-+	offset = ((unsigned)to % priv->page_size);
-+	if (offset + len > priv->page_size)
-+		writelen = priv->page_size - offset;
-+	else
-+		writelen = len;
-+	writebuf = (u_char *)buf;
-+	remaining = len;
-+
-+	/* Allocate temporary buffer */
-+	tmpbuf = kmalloc(priv->page_size, GFP_KERNEL);
-+	if (!tmpbuf) {
-+		kfree(command);
-+		return -ENOMEM;
-+	}
-+
-+	/* Gain access to the SPI bus */
-+	spi_access_bus(priv->spi);
-+
-+	while (remaining > 0) {
-+#ifdef DEBUG_DATAFLASH
-+		printk("write @ %i:%i len=%i\n", pageaddr, offset, writelen);
-+#endif
-+
-+		/* (1) Transfer to Buffer1 */
-+		if (writelen != priv->page_size) {
-+			addr = pageaddr << priv->page_offset;
-+			command[0] = OP_TRANSFER_BUF1;
-+			command[1] = (addr & 0x00FF0000) >> 16;
-+			command[2] = (addr & 0x0000FF00) >> 8;
-+			command[3] = 0;
-+#ifdef DEBUG_DATAFLASH
-+			printk("TRANSFER: (%x) %x %x %x\n", command[0], command[1], command[2], command[3]);
-+#endif
-+			do_spi_transfer(1, command, 4, command, 4, NULL, 0, NULL, 0);
-+			at91_dataflash_waitready();
-+		}
-+
-+		/* (2) Program via Buffer1 */
-+		addr = (pageaddr << priv->page_offset) + offset;
-+		command[0] = OP_PROGRAM_VIA_BUF1;
-+		command[1] = (addr & 0x00FF0000) >> 16;
-+		command[2] = (addr & 0x0000FF00) >> 8;
-+		command[3] = (addr & 0x000000FF);
-+#ifdef DEBUG_DATAFLASH
-+		printk("PROGRAM: (%x) %x %x %x\n", command[0], command[1], command[2], command[3]);
-+#endif
-+		do_spi_transfer(2, command, 4, command, 4, writebuf, writelen, tmpbuf, writelen);
-+		at91_dataflash_waitready();
-+
-+		/* (3) Compare to Buffer1 */
-+		addr = pageaddr << priv->page_offset;
-+		command[0] = OP_COMPARE_BUF1;
-+		command[1] = (addr & 0x00FF0000) >> 16;
-+		command[2] = (addr & 0x0000FF00) >> 8;
-+		command[3] = 0;
-+#ifdef DEBUG_DATAFLASH
-+		printk("COMPARE: (%x) %x %x %x\n", command[0], command[1], command[2], command[3]);
-+#endif
-+		do_spi_transfer(1, command, 4, command, 4, NULL, 0, NULL, 0);
-+		at91_dataflash_waitready();
-+
-+		/* Get result of the compare operation */
-+		status = at91_dataflash_status();
-+		if ((status & 0x40) == 1) {
-+			printk("at91_dataflash: Write error on page %i\n", pageaddr);
-+			remaining = 0;
-+			res = -EIO;
-+		}
-+
-+		remaining = remaining - writelen;
-+		pageaddr++;
-+		offset = 0;
-+		writebuf += writelen;
-+		*retlen += writelen;
-+
-+		if (remaining > priv->page_size)
-+			writelen = priv->page_size;
-+		else
-+			writelen = remaining;
-+	}
-+
-+	/* Release SPI bus */
-+	spi_release_bus(priv->spi);
-+
-+	kfree(tmpbuf);
-+	kfree(command);
-+	return res;
-+}
-+
-+/* ......................................................................... */
-+
-+/*
-+ * Initialize and register DataFlash device with MTD subsystem.
-+ */
-+static int __init add_dataflash(int channel, char *name, int IDsize,
-+		int nr_pages, int pagesize, int pageoffset)
-+{
-+	struct mtd_info *device;
-+	struct dataflash_local *priv;
-+#ifdef CONFIG_MTD_PARTITIONS
-+	struct mtd_partition *mtd_parts = 0;
-+	int mtd_parts_nr = 0;
-+#endif
-+
-+	if (nr_devices >= DATAFLASH_MAX_DEVICES) {
-+		printk(KERN_ERR "at91_dataflash: Too many devices detected\n");
-+		return 0;
-+	}
-+
-+	device = kmalloc(sizeof(struct mtd_info) + strlen(name) + 8, GFP_KERNEL);
-+	if (!device)
-+		return -ENOMEM;
-+	memset(device, 0, sizeof(struct mtd_info));
-+
-+	device->name = (char *)&device[1];
-+	sprintf(device->name, "%s.spi%d", name, channel);
-+	device->size = nr_pages * pagesize;
-+	device->erasesize = pagesize;
-+	device->writesize = pagesize;
-+	device->owner = THIS_MODULE;
-+	device->type = MTD_DATAFLASH;
-+	device->flags = MTD_WRITEABLE;
-+	device->erase = at91_dataflash_erase;
-+	device->read = at91_dataflash_read;
-+	device->write = at91_dataflash_write;
-+
-+	priv = (struct dataflash_local *) kmalloc(sizeof(struct dataflash_local), GFP_KERNEL);
-+	if (!priv) {
-+		kfree(device);
-+		return -ENOMEM;
-+	}
-+	memset(priv, 0, sizeof(struct dataflash_local));
-+
-+	priv->spi = channel;
-+	priv->page_size = pagesize;
-+	priv->page_offset = pageoffset;
-+	device->priv = priv;
-+
-+	mtd_devices[nr_devices] = device;
-+	nr_devices++;
-+	printk("at91_dataflash: %s detected [spi%i] (%i bytes)\n", name, channel, device->size);
-+
-+#ifdef CONFIG_MTD_PARTITIONS
-+#ifdef CONFIG_MTD_CMDLINE_PARTS
-+	mtd_parts_nr = parse_mtd_partitions(device, part_probes, &mtd_parts, 0);
-+#endif
-+	if (mtd_parts_nr <= 0) {
-+		switch (IDsize) {
-+			case SZ_2M:
-+				mtd_parts = static_partitions_2M;
-+				mtd_parts_nr = ARRAY_SIZE(static_partitions_2M);
-+				break;
-+			case SZ_4M:
-+				mtd_parts = static_partitions_4M;
-+				mtd_parts_nr = ARRAY_SIZE(static_partitions_4M);
-+				break;
-+			case SZ_8M:
-+				mtd_parts = static_partitions_8M;
-+				mtd_parts_nr = ARRAY_SIZE(static_partitions_8M);
-+				break;
-+		}
-+	}
-+
-+	if (mtd_parts_nr > 0) {
-+#ifdef DATAFLASH_ALWAYS_ADD_DEVICE
-+		add_mtd_device(device);
-+#endif
-+		return add_mtd_partitions(device, mtd_parts, mtd_parts_nr);
-+	}
-+#endif
-+	return add_mtd_device(device);		/* add whole device */
-+}
-+
-+/*
-+ * Detect and initialize DataFlash device connected to specified SPI channel.
-+ *
-+ *   Device            Density         ID code                 Nr Pages        Page Size       Page offset
-+ *   AT45DB011B        1Mbit   (128K)  xx0011xx (0x0c)         512             264             9
-+ *   AT45DB021B        2Mbit   (256K)  xx0101xx (0x14)         1025            264             9
-+ *   AT45DB041B        4Mbit   (512K)  xx0111xx (0x1c)         2048            264             9
-+ *   AT45DB081B        8Mbit   (1M)    xx1001xx (0x24)         4096            264             9
-+ *   AT45DB0161B       16Mbit  (2M)    xx1011xx (0x2c)         4096            528             10
-+ *   AT45DB0321B       32Mbit  (4M)    xx1101xx (0x34)         8192            528             10
-+ *   AT45DB0642        64Mbit  (8M)    xx1111xx (0x3c)         8192            1056            11
-+ *   AT45DB1282        128Mbit (16M)   xx0100xx (0x10)         16384           1056            11
-+ */
-+static int __init at91_dataflash_detect(int channel)
-+{
-+	int res = 0;
-+	unsigned short status;
-+
-+	spi_access_bus(channel);
-+	status = at91_dataflash_status();
-+	spi_release_bus(channel);
-+	if (status != 0xff) {			/* no dataflash device there */
-+		switch (status & 0x3c) {
-+			case 0x0c:	/* 0 0 1 1 */
-+				res = add_dataflash(channel, "AT45DB011B", SZ_128K, 512, 264, 9);
-+				break;
-+			case 0x14:	/* 0 1 0 1 */
-+				res = add_dataflash(channel, "AT45DB021B", SZ_256K, 1025, 264, 9);
-+				break;
-+			case 0x1c:	/* 0 1 1 1 */
-+				res = add_dataflash(channel, "AT45DB041B", SZ_512K, 2048, 264, 9);
-+				break;
-+			case 0x24:	/* 1 0 0 1 */
-+				res = add_dataflash(channel, "AT45DB081B", SZ_1M, 4096, 264, 9);
-+				break;
-+			case 0x2c:	/* 1 0 1 1 */
-+				res = add_dataflash(channel, "AT45DB161B", SZ_2M, 4096, 528, 10);
-+				break;
-+			case 0x34:	/* 1 1 0 1 */
-+				res = add_dataflash(channel, "AT45DB321B", SZ_4M, 8192, 528, 10);
-+				break;
-+			case 0x3c:	/* 1 1 1 1 */
-+				res = add_dataflash(channel, "AT45DB642", SZ_8M, 8192, 1056, 11);
-+				break;
-+// Currently unsupported since Atmel removed the "Main Memory Program via Buffer" commands.
-+//			case 0x10:	/* 0 1 0 0 */
-+//				res = add_dataflash(channel, "AT45DB1282", SZ_16M, 16384, 1056, 11);
-+//				break;
-+			default:
-+				printk(KERN_ERR "at91_dataflash: Unknown device (%x)\n", status & 0x3c);
-+		}
-+	}
-+
-+	return res;
-+}
-+
-+static int __init at91_dataflash_init(void)
-+{
-+	spi_transfer_desc = kmalloc(sizeof(struct spi_transfer_list), GFP_KERNEL);
-+	if (!spi_transfer_desc)
-+		return -ENOMEM;
-+
-+	/* DataFlash (SPI chip select 0) */
-+	at91_dataflash_detect(0);
-+
-+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
-+	/* DataFlash card (SPI chip select 3) */
-+	at91_dataflash_detect(3);
-+#endif
-+
-+	return 0;
-+}
-+
-+static void __exit at91_dataflash_exit(void)
-+{
-+	int i;
-+
-+	for (i = 0; i < DATAFLASH_MAX_DEVICES; i++) {
-+		if (mtd_devices[i]) {
-+#ifdef CONFIG_MTD_PARTITIONS
-+			del_mtd_partitions(mtd_devices[i]);
-+#else
-+			del_mtd_device(mtd_devices[i]);
-+#endif
-+			kfree(mtd_devices[i]->priv);
-+			kfree(mtd_devices[i]);
-+		}
-+	}
-+	nr_devices = 0;
-+	kfree(spi_transfer_desc);
-+}
-+
-+
-+module_init(at91_dataflash_init);
-+module_exit(at91_dataflash_exit);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Andrew Victor");
-+MODULE_DESCRIPTION("DataFlash driver for Atmel AT91RM9200");
-Index: linux-2.6.21.7/drivers/mtd/nand/at91_nand.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/mtd/nand/at91_nand.c
-+++ linux-2.6.21.7/drivers/mtd/nand/at91_nand.c
-@@ -82,6 +82,10 @@ static void at91_nand_disable(struct at9
- 		at91_set_gpio_value(host->board->enable_pin, 1);
- }
- 
-+#ifdef CONFIG_MTD_PARTITIONS
-+const char *part_probes[] = { "cmdlinepart", NULL };
-+#endif
-+
- /*
-  * Probe for the NAND device.
-  */
-@@ -151,6 +155,12 @@ static int __init at91_nand_probe(struct
- #ifdef CONFIG_MTD_PARTITIONS
- 	if (host->board->partition_info)
- 		partitions = host->board->partition_info(mtd->size, &num_partitions);
-+#ifdef CONFIG_MTD_CMDLINE_PARTS
-+	else {
-+		mtd->name = "at91_nand";
-+		num_partitions = parse_mtd_partitions(mtd, part_probes, &partitions, 0);
-+	}
-+#endif
- 
- 	if ((!partitions) || (num_partitions == 0)) {
- 		printk(KERN_ERR "at91_nand: No parititions defined, or unsupported device.\n");
-Index: linux-2.6.21.7/drivers/net/arm/at91_ether.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/net/arm/at91_ether.c
-+++ linux-2.6.21.7/drivers/net/arm/at91_ether.c
-@@ -225,6 +225,16 @@ static irqreturn_t at91ether_phy_interru
- 		if (!(phy & ((1 << 2) | 1)))
- 			goto done;
- 	}
-+	else if (lp->phy_type == MII_T78Q21x3_ID) {			/* ack interrupt in Teridian PHY */
-+		read_phy(lp->phy_address, MII_T78Q21INT_REG, &phy);
-+		if (!(phy & ((1 << 2) | 1)))
-+			goto done;
-+	}
-+	else if (lp->phy_type == MII_DP83848_ID) {
-+		read_phy(lp->phy_address, MII_DPPHYSTS_REG, &phy);	/* ack interrupt in DP83848 PHY */
-+		if (!(phy & (1 << 7)))
-+			goto done;
-+	}
- 
- 	update_linkspeed(dev, 0);
- 
-@@ -280,6 +290,19 @@ static void enable_phyirq(struct net_dev
- 		dsintr = (1 << 10) | ( 1 << 8);
- 		write_phy(lp->phy_address, MII_TPISTATUS, dsintr);
- 	}
-+	else if (lp->phy_type == MII_T78Q21x3_ID) {	/* for Teridian PHY */
-+		read_phy(lp->phy_address, MII_T78Q21INT_REG, &dsintr);
-+		dsintr = dsintr | 0x500;		/* set bits 8, 10 */
-+		write_phy(lp->phy_address, MII_T78Q21INT_REG, dsintr);
-+	}
-+	else if (lp->phy_type == MII_DP83848_ID) {	/* National Semiconductor DP83848 PHY */
-+		read_phy(lp->phy_address, MII_DPMISR_REG, &dsintr);
-+		dsintr = dsintr | 0x3c;			/* set bits 2..5 */
-+		write_phy(lp->phy_address, MII_DPMISR_REG, dsintr);
-+		read_phy(lp->phy_address, MII_DPMICR_REG, &dsintr);
-+		dsintr = dsintr | 0x3;			/* set bits 0,1 */
-+		write_phy(lp->phy_address, MII_DPMICR_REG, dsintr);
-+	}
- 
- 	disable_mdi();
- 	spin_unlock_irq(&lp->lock);
-@@ -323,6 +346,19 @@ static void disable_phyirq(struct net_de
- 		dsintr = ~((1 << 10) | (1 << 8));
- 		write_phy(lp->phy_address, MII_TPISTATUS, dsintr);
- 	}
-+	else if (lp->phy_type == MII_T78Q21x3_ID) {	/* for Teridian PHY */
-+		read_phy(lp->phy_address, MII_T78Q21INT_REG, &dsintr);
-+		dsintr = dsintr & ~0x500;			/* clear bits 8, 10 */
-+		write_phy(lp->phy_address, MII_T78Q21INT_REG, dsintr);
-+	}
-+	else if (lp->phy_type == MII_DP83848_ID) {	/* National Semiconductor DP83848 PHY */
-+		read_phy(lp->phy_address, MII_DPMICR_REG, &dsintr);
-+		dsintr = dsintr & ~0x3;				/* clear bits 0, 1 */
-+		write_phy(lp->phy_address, MII_DPMICR_REG, dsintr);
-+		read_phy(lp->phy_address, MII_DPMISR_REG, &dsintr);
-+		dsintr = dsintr & ~0x3c;			/* clear bits 2..5 */
-+		write_phy(lp->phy_address, MII_DPMISR_REG, dsintr);
-+	}
- 
- 	disable_mdi();
- 	spin_unlock_irq(&lp->lock);
-@@ -535,8 +571,8 @@ static void at91ether_sethashtable(struc
- 		mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
- 	}
- 
--	at91_emac_write(AT91_EMAC_HSH, mc_filter[0]);
--	at91_emac_write(AT91_EMAC_HSL, mc_filter[1]);
-+	at91_emac_write(AT91_EMAC_HSL, mc_filter[0]);
-+	at91_emac_write(AT91_EMAC_HSH, mc_filter[1]);
- }
- 
- /*
-@@ -943,14 +979,22 @@ static int __init at91ether_setup(unsign
- 	struct net_device *dev;
- 	struct at91_private *lp;
- 	unsigned int val;
--	int res;
-+	struct resource *res;
-+	int ret;
- 
- 	dev = alloc_etherdev(sizeof(struct at91_private));
- 	if (!dev)
- 		return -ENOMEM;
- 
--	dev->base_addr = AT91_VA_BASE_EMAC;
--	dev->irq = AT91RM9200_ID_EMAC;
-+	/* Get I/O base address and IRQ */
-+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	if (!res) {
-+		free_netdev(dev);
-+		return -ENODEV;
-+	}
-+	dev->base_addr = res->start;
-+	dev->irq = platform_get_irq(pdev, 0);
-+
- 	SET_MODULE_OWNER(dev);
- 
- 	/* Install the interrupt handler */
-@@ -1023,12 +1067,12 @@ static int __init at91ether_setup(unsign
- 	lp->phy_address = phy_address;	/* MDI address of PHY */
- 
- 	/* Register the network interface */
--	res = register_netdev(dev);
--	if (res) {
-+	ret = register_netdev(dev);
-+	if (ret) {
- 		free_irq(dev->irq, dev);
- 		free_netdev(dev);
- 		dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys);
--		return res;
-+		return ret;
- 	}
- 
- 	/* Determine current link speed */
-@@ -1063,10 +1107,16 @@ static int __init at91ether_setup(unsign
- 		printk(KERN_INFO "%s: Broadcom BCM5221 PHY\n", dev->name);
- 	else if (phy_type == MII_DP83847_ID)
- 		printk(KERN_INFO "%s: National Semiconductor DP83847 PHY\n", dev->name);
-+	else if (phy_type == MII_DP83848_ID)
-+		printk(KERN_INFO "%s: National Semiconductor DP83848 PHY\n", dev->name);
- 	else if (phy_type == MII_AC101L_ID)
- 		printk(KERN_INFO "%s: Altima AC101L PHY\n", dev->name);
- 	else if (phy_type == MII_KS8721_ID)
- 		printk(KERN_INFO "%s: Micrel KS8721 PHY\n", dev->name);
-+	else if (phy_type == MII_T78Q21x3_ID)
-+		printk(KERN_INFO "%s: Teridian 78Q21x3 PHY\n", dev->name);
-+	else if (phy_type == MII_LAN83C185_ID)
-+		printk(KERN_INFO "%s: SMSC LAN83C185 PHY\n", dev->name);
- 
- 	return 0;
- }
-@@ -1104,8 +1154,11 @@ static int __init at91ether_probe(struct
- 			case MII_RTL8201_ID:		/* Realtek RTL8201: PHY_ID1 = 0, PHY_ID2 = 0x8201 */
- 			case MII_BCM5221_ID:		/* Broadcom BCM5221: PHY_ID1 = 0x40, PHY_ID2 = 0x61e0 */
- 			case MII_DP83847_ID:		/* National Semiconductor DP83847:  */
-+			case MII_DP83848_ID:		/* National Semiconductor DP83848:  */
- 			case MII_AC101L_ID:		/* Altima AC101L: PHY_ID1 = 0x22, PHY_ID2 = 0x5520 */
- 			case MII_KS8721_ID:		/* Micrel KS8721: PHY_ID1 = 0x22, PHY_ID2 = 0x1610 */
-+			case MII_T78Q21x3_ID:		/* Teridian 78Q21x3: PHY_ID1 = 0x0E, PHY_ID2 = 7237 */
-+			case MII_LAN83C185_ID:		/* SMSC LAN83C185: PHY_ID1 = 0x0007, PHY_ID2 = 0xC0A1 */
- 				detected = at91ether_setup(phy_id, phy_address, pdev, ether_clk);
- 				break;
- 		}
-Index: linux-2.6.21.7/drivers/net/arm/at91_ether.h
-===================================================================
---- linux-2.6.21.7.orig/drivers/net/arm/at91_ether.h
-+++ linux-2.6.21.7/drivers/net/arm/at91_ether.h
-@@ -17,39 +17,46 @@
- 
- 
- /* Davicom 9161 PHY */
--#define MII_DM9161_ID	0x0181b880
--#define MII_DM9161A_ID	0x0181b8a0
--
--/* Davicom specific registers */
--#define MII_DSCR_REG	16
--#define MII_DSCSR_REG	17
--#define MII_DSINTR_REG	21
-+#define MII_DM9161_ID		0x0181b880
-+#define MII_DM9161A_ID		0x0181b8a0
-+#define MII_DSCR_REG		16
-+#define MII_DSCSR_REG		17
-+#define MII_DSINTR_REG		21
- 
- /* Intel LXT971A PHY */
--#define MII_LXT971A_ID	0x001378E0
--
--/* Intel specific registers */
--#define MII_ISINTE_REG	18
--#define MII_ISINTS_REG	19
--#define MII_LEDCTRL_REG	20
-+#define MII_LXT971A_ID		0x001378E0
-+#define MII_ISINTE_REG		18
-+#define MII_ISINTS_REG		19
-+#define MII_LEDCTRL_REG		20
- 
- /* Realtek RTL8201 PHY */
--#define MII_RTL8201_ID	0x00008200
-+#define MII_RTL8201_ID		0x00008200
- 
- /* Broadcom BCM5221 PHY */
--#define MII_BCM5221_ID	0x004061e0
--
--/* Broadcom specific registers */
--#define MII_BCMINTR_REG	26
-+#define MII_BCM5221_ID		0x004061e0
-+#define MII_BCMINTR_REG		26
- 
- /* National Semiconductor DP83847 */
--#define MII_DP83847_ID	0x20005c30
-+#define MII_DP83847_ID		0x20005c30
-+
-+/* National Semiconductor DP83848 */
-+#define MII_DP83848_ID		0x20005c90
-+#define MII_DPPHYSTS_REG	16
-+#define MII_DPMICR_REG		17
-+#define MII_DPMISR_REG		18
- 
- /* Altima AC101L PHY */
--#define MII_AC101L_ID	0x00225520
-+#define MII_AC101L_ID		0x00225520
- 
- /* Micrel KS8721 PHY */
--#define MII_KS8721_ID	0x00221610
-+#define MII_KS8721_ID		0x00221610
-+
-+/* Teridian 78Q2123/78Q2133 */
-+#define MII_T78Q21x3_ID		0x000e7230
-+#define MII_T78Q21INT_REG	17
-+
-+/* SMSC LAN83C185 */
-+#define MII_LAN83C185_ID	0x0007C0A0
- 
- /* ........................................................................ */
- 
-Index: linux-2.6.21.7/drivers/pcmcia/at91_cf.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/pcmcia/at91_cf.c
-+++ linux-2.6.21.7/drivers/pcmcia/at91_cf.c
-@@ -332,20 +332,27 @@ static int at91_cf_suspend(struct platfo
- 	struct at91_cf_data	*board = cf->board;
- 
- 	pcmcia_socket_dev_suspend(&pdev->dev, mesg);
-+
- 	if (device_may_wakeup(&pdev->dev)) {
- 		enable_irq_wake(board->det_pin);
- 		if (board->irq_pin)
- 			enable_irq_wake(board->irq_pin);
--	} else {
--		disable_irq_wake(board->det_pin);
--		if (board->irq_pin)
--			disable_irq_wake(board->irq_pin);
- 	}
-+
- 	return 0;
- }
- 
- static int at91_cf_resume(struct platform_device *pdev)
- {
-+	struct at91_cf_socket	*cf = platform_get_drvdata(pdev);
-+	struct at91_cf_data	*board = cf->board;
-+
-+	if (device_may_wakeup(&pdev->dev)) {
-+		disable_irq_wake(board->det_pin);
-+		if (board->irq_pin)
-+			disable_irq_wake(board->irq_pin);
-+	}
-+
- 	pcmcia_socket_dev_resume(&pdev->dev);
- 	return 0;
- }
-@@ -360,7 +367,6 @@ static struct platform_driver at91_cf_dr
- 		.name		= (char *) driver_name,
- 		.owner		= THIS_MODULE,
- 	},
--	.probe		= at91_cf_probe,
- 	.remove		= __exit_p(at91_cf_remove),
- 	.suspend	= at91_cf_suspend,
- 	.resume		= at91_cf_resume,
-@@ -370,7 +376,7 @@ static struct platform_driver at91_cf_dr
- 
- static int __init at91_cf_init(void)
- {
--	return platform_driver_register(&at91_cf_driver);
-+	return platform_driver_probe(&at91_cf_driver, at91_cf_probe);
- }
- module_init(at91_cf_init);
- 
-Index: linux-2.6.21.7/drivers/serial/atmel_serial.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/serial/atmel_serial.c
-+++ linux-2.6.21.7/drivers/serial/atmel_serial.c
-@@ -7,6 +7,8 @@
-  *  Based on drivers/char/serial_sa1100.c, by Deep Blue Solutions Ltd.
-  *  Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
-  *
-+ *  DMA support added by Chip Coldwell.
-+ *
-  * 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
-@@ -33,6 +35,7 @@
- #include <linux/sysrq.h>
- #include <linux/tty_flip.h>
- #include <linux/platform_device.h>
-+#include <linux/dma-mapping.h>
- #include <linux/atmel_pdc.h>
- 
- #include <asm/io.h>
-@@ -47,6 +50,11 @@
- 
- #include "atmel_serial.h"
- 
-+#define SUPPORT_PDC
-+#define PDC_BUFFER_SIZE		(L1_CACHE_BYTES << 3)
-+#warning "Revisit"
-+#define PDC_RX_TIMEOUT		(3 * 10)		/* 3 bytes */
-+
- #if defined(CONFIG_SERIAL_ATMEL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
- #define SUPPORT_SYSRQ
- #endif
-@@ -107,6 +115,13 @@
- static int (*atmel_open_hook)(struct uart_port *);
- static void (*atmel_close_hook)(struct uart_port *);
- 
-+struct atmel_dma_buffer {
-+	unsigned char	*buf;
-+	dma_addr_t	dma_addr;
-+	size_t		dma_size;
-+	unsigned int	ofs;
-+};
-+
- /*
-  * We wrap our port structure around the generic uart_port.
-  */
-@@ -114,10 +129,20 @@ struct atmel_uart_port {
- 	struct uart_port	uart;		/* uart */
- 	struct clk		*clk;		/* uart clock */
- 	unsigned short		suspended;	/* is port suspended? */
-+
-+	short			use_dma_rx;	/* enable PDC receiver */
-+	short			pdc_rx_idx;	/* current PDC RX buffer */
-+	struct atmel_dma_buffer	pdc_rx[2];	/* PDC receier */
-+
-+	short			use_dma_tx;	/* enable PDC transmitter */
-+	struct atmel_dma_buffer	pdc_tx;		/* PDC transmitter */
- };
- 
- static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART];
- 
-+#define PDC_RX_BUF(port)	&(port)->pdc_rx[(port)->pdc_rx_idx]
-+#define PDC_RX_SWITCH(port)	(port)->pdc_rx_idx = !(port)->pdc_rx_idx
-+
- #ifdef SUPPORT_SYSRQ
- static struct console atmel_console;
- #endif
-@@ -205,7 +230,12 @@ static void atmel_stop_tx(struct uart_po
- {
- 	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
- 
--	UART_PUT_IDR(port, ATMEL_US_TXRDY);
-+	if (atmel_port->use_dma_tx) {
-+		UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);		/* disable PDC transmit */
-+		UART_PUT_IDR(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE);
-+	}
-+	else
-+		UART_PUT_IDR(port, ATMEL_US_TXRDY);
- }
- 
- /*
-@@ -215,7 +245,17 @@ static void atmel_start_tx(struct uart_p
- {
- 	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
- 
--	UART_PUT_IER(port, ATMEL_US_TXRDY);
-+	if (atmel_port->use_dma_tx) {
-+		if (UART_GET_PTSR(port) & ATMEL_PDC_TXTEN)
-+			/* The transmitter is already running.  Yes, we
-+			   really need this.*/
-+			return;
-+
-+		UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE);
-+		UART_PUT_PTCR(port, ATMEL_PDC_TXTEN);		/* re-enable PDC transmit */
-+	}
-+	else
-+		UART_PUT_IER(port, ATMEL_US_TXRDY);
- }
- 
- /*
-@@ -225,7 +265,12 @@ static void atmel_stop_rx(struct uart_po
- {
- 	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
- 
--	UART_PUT_IDR(port, ATMEL_US_RXRDY);
-+	if (atmel_port->use_dma_rx) {
-+		UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS);		/* disable PDC receive */
-+		UART_PUT_IDR(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT);
-+	}
-+	else
-+		UART_PUT_IDR(port, ATMEL_US_RXRDY);
- }
- 
- /*
-@@ -248,6 +293,134 @@ static void atmel_break_ctl(struct uart_
- }
- 
- /*
-+ * Receive data via the PDC.  A buffer has been fulled.
-+ */
-+static void atmel_pdc_endrx(struct uart_port *port)
-+{
-+	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-+	struct tty_struct *tty = port->info->tty;
-+	struct atmel_dma_buffer *pdc = PDC_RX_BUF(atmel_port);
-+	unsigned int count;
-+
-+	count = pdc->dma_size - pdc->ofs;
-+	if (likely(count > 0)) {
-+		dma_sync_single_for_cpu(port->dev, pdc->dma_addr, pdc->dma_size, DMA_FROM_DEVICE);
-+		tty_insert_flip_string(tty, pdc->buf + pdc->ofs, count);
-+		tty_flip_buffer_push(tty);
-+
-+		port->icount.rx += count;
-+	}
-+
-+	/* Set this buffer as the next receive buffer */
-+	pdc->ofs = 0;
-+	UART_PUT_RNPR(port, pdc->dma_addr);
-+	UART_PUT_RNCR(port, pdc->dma_size);
-+
-+	/* Switch to next buffer */
-+	PDC_RX_SWITCH(atmel_port);		/* next PDC buffer */
-+}
-+
-+/*
-+ * Receive data via the PDC.  At least one byte was received, but the
-+ * buffer was not full when the inter-character timeout expired.
-+ */
-+static void atmel_pdc_timeout(struct uart_port *port)
-+{
-+	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-+	struct tty_struct *tty = port->info->tty;
-+	struct atmel_dma_buffer *pdc = PDC_RX_BUF(atmel_port);
-+	/* unsigned */ int ofs, count;
-+
-+	ofs = UART_GET_RPR(port) - pdc->dma_addr;	/* current DMA adress */
-+	count = ofs - pdc->ofs;
-+
-+	if (likely(count > 0)) {
-+		dma_sync_single_for_cpu(port->dev, pdc->dma_addr, pdc->dma_size, DMA_FROM_DEVICE);
-+		tty_insert_flip_string(tty, pdc->buf + pdc->ofs, count);
-+		tty_flip_buffer_push(tty);
-+
-+		pdc->ofs = ofs;
-+		port->icount.rx += count;
-+	}
-+
-+	/* reset the UART timeout */
-+	UART_PUT_CR(port, ATMEL_US_STTTO);
-+}
-+
-+/*
-+ * Deal with parity, framing and overrun errors.
-+ */
-+static void atmel_pdc_rxerr(struct uart_port *port, unsigned int status)
-+{
-+	/* clear error */
-+	UART_PUT_CR(port, ATMEL_US_RSTSTA);
-+
-+	if (status & ATMEL_US_RXBRK) {
-+		status &= ~(ATMEL_US_PARE | ATMEL_US_FRAME);	/* ignore side-effect */
-+		port->icount.brk++;
-+	}
-+	if (status & ATMEL_US_PARE)
-+		port->icount.parity++;
-+	if (status & ATMEL_US_FRAME)
-+		port->icount.frame++;
-+	if (status & ATMEL_US_OVRE)
-+		port->icount.overrun++;
-+}
-+
-+/*
-+ * A transmission via the PDC is complete.
-+ */
-+static void atmel_pdc_endtx(struct uart_port *port)
-+{
-+	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-+	struct circ_buf *xmit = &port->info->xmit;
-+	struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
-+
-+	xmit->tail += pdc->ofs;
-+	if (xmit->tail >= SERIAL_XMIT_SIZE)
-+		xmit->tail -= SERIAL_XMIT_SIZE;
-+
-+	port->icount.tx += pdc->ofs;
-+	pdc->ofs = 0;
-+
-+	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
-+		uart_write_wakeup(port);
-+}
-+
-+/*
-+ * The PDC transmitter is idle, so either start the next transfer or
-+ * disable the transmitter.
-+ */
-+static void atmel_pdc_txbufe(struct uart_port *port)
-+{
-+	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
-+	struct circ_buf *xmit = &port->info->xmit;
-+	struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
-+	int count;
-+
-+	if (!uart_circ_empty(xmit)) {
-+		/* more to transmit - setup next transfer */
-+		UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);			/* disable PDC transmit */
-+		dma_sync_single_for_device(port->dev, pdc->dma_addr, pdc->dma_size, DMA_TO_DEVICE);
-+
-+		if (xmit->tail < xmit->head)
-+			count = xmit->head - xmit->tail;
-+		else
-+			count = SERIAL_XMIT_SIZE - xmit->tail;
-+		pdc->ofs = count;
-+
-+		UART_PUT_TPR(port, pdc->dma_addr + xmit->tail);
-+		UART_PUT_TCR(port, count);
-+		UART_PUT_PTCR(port, ATMEL_PDC_TXTEN);			/* re-enable PDC transmit */
-+	}
-+	else {
-+		/* nothing left to transmit - disable the transmitter */
-+		UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);			/* disable PDC transmit */
-+		UART_PUT_IDR(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE);
-+	}
-+}
-+
-+/*
-  * Characters received (called from interrupt handler)
-  */
- static void atmel_rx_chars(struct uart_port *port)
-@@ -349,6 +522,14 @@ static irqreturn_t atmel_interrupt(int i
- 	status = UART_GET_CSR(port);
- 	pending = status & UART_GET_IMR(port);
- 	while (pending) {
-+		/* PDC receive */
-+		if (pending & ATMEL_US_ENDRX)
-+			atmel_pdc_endrx(port);
-+		if (pending & ATMEL_US_TIMEOUT)
-+			atmel_pdc_timeout(port);
-+		if (atmel_port->use_dma_rx && pending & (ATMEL_US_RXBRK | ATMEL_US_OVRE | ATMEL_US_FRAME | ATMEL_US_PARE))
-+			atmel_pdc_rxerr(port, pending);
-+
- 		/* Interrupt receive */
- 		if (pending & ATMEL_US_RXRDY)
- 			atmel_rx_chars(port);
-@@ -363,6 +544,12 @@ static irqreturn_t atmel_interrupt(int i
- 		if (pending & (ATMEL_US_RIIC | ATMEL_US_DSRIC | ATMEL_US_DCDIC | ATMEL_US_CTSIC))
- 			wake_up_interruptible(&port->info->delta_msr_wait);
- 
-+		/* PDC transmit */
-+		if (pending & ATMEL_US_ENDTX)
-+			atmel_pdc_endtx(port);
-+		if (pending & ATMEL_US_TXBUFE)
-+			atmel_pdc_txbufe(port);
-+
- 		/* Interrupt transmit */
- 		if (pending & ATMEL_US_TXRDY)
- 			atmel_tx_chars(port);
-@@ -401,6 +588,47 @@ static int atmel_startup(struct uart_por
- 	}
- 
- 	/*
-+	 * Initialize DMA (if necessary)
-+	 */
-+	if (atmel_port->use_dma_rx) {
-+		int i;
-+
-+		for (i = 0; i < 2; i++) {
-+			struct atmel_dma_buffer *pdc = &atmel_port->pdc_rx[i];
-+
-+			pdc->buf = kmalloc(PDC_BUFFER_SIZE, GFP_KERNEL);
-+			if (pdc->buf == NULL) {
-+				if (i != 0) {
-+					dma_unmap_single(port->dev, atmel_port->pdc_rx[0].dma_addr, PDC_BUFFER_SIZE, DMA_FROM_DEVICE);
-+					kfree(atmel_port->pdc_rx[0].buf);
-+				}
-+				free_irq(port->irq, port);
-+				return -ENOMEM;
-+			}
-+			pdc->dma_addr = dma_map_single(port->dev, pdc->buf, PDC_BUFFER_SIZE, DMA_FROM_DEVICE);
-+			pdc->dma_size = PDC_BUFFER_SIZE;
-+			pdc->ofs = 0;
-+		}
-+
-+		atmel_port->pdc_rx_idx = 0;
-+
-+		UART_PUT_RPR(port, atmel_port->pdc_rx[0].dma_addr);
-+		UART_PUT_RCR(port, PDC_BUFFER_SIZE);
-+
-+		UART_PUT_RNPR(port, atmel_port->pdc_rx[1].dma_addr);
-+		UART_PUT_RNCR(port, PDC_BUFFER_SIZE);
-+	}
-+	if (atmel_port->use_dma_tx) {
-+		struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
-+		struct circ_buf *xmit = &port->info->xmit;
-+
-+		pdc->buf = xmit->buf;
-+		pdc->dma_addr = dma_map_single(port->dev, pdc->buf, SERIAL_XMIT_SIZE, DMA_TO_DEVICE);
-+		pdc->dma_size = SERIAL_XMIT_SIZE;
-+		pdc->ofs = 0;
-+	}
-+
-+	/*
- 	 * If there is a specific "open" function (to register
- 	 * control line interrupts)
- 	 */
-@@ -418,7 +646,15 @@ static int atmel_startup(struct uart_por
- 	UART_PUT_CR(port, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
- 	UART_PUT_CR(port, ATMEL_US_TXEN | ATMEL_US_RXEN);		/* enable xmit & rcvr */
- 
--	UART_PUT_IER(port, ATMEL_US_RXRDY);		/* enable receive only */
-+	if (atmel_port->use_dma_rx) {
-+		UART_PUT_RTOR(port, PDC_RX_TIMEOUT);		/* set UART timeout */
-+		UART_PUT_CR(port, ATMEL_US_STTTO);
-+
-+		UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT);
-+		UART_PUT_PTCR(port, ATMEL_PDC_RXTEN);		/* enable PDC controller */
-+	}
-+	else
-+		UART_PUT_IER(port, ATMEL_US_RXRDY);		/* enable receive only */
- 
- 	return 0;
- }
-@@ -431,6 +667,31 @@ static void atmel_shutdown(struct uart_p
- 	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
- 
- 	/*
-+	 * Ensure everything is stopped.
-+	 */
-+	atmel_stop_rx(port);
-+	atmel_stop_tx(port);
-+
-+	/*
-+	 * Shut-down the DMA.
-+	 */
-+	if (atmel_port->use_dma_rx) {
-+		int i;
-+
-+		for (i = 0; i < 2; i++) {
-+			struct atmel_dma_buffer *pdc = &atmel_port->pdc_rx[i];
-+
-+			dma_unmap_single(port->dev, pdc->dma_addr, pdc->dma_size, DMA_FROM_DEVICE);
-+			kfree(pdc->buf);
-+		}
-+	}
-+	if (atmel_port->use_dma_tx) {
-+		struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
-+
-+		dma_unmap_single(port->dev, pdc->dma_addr, pdc->dma_size, DMA_TO_DEVICE);
-+	}
-+
-+	/*
- 	 * Disable all interrupts, port and break condition.
- 	 */
- 	UART_PUT_CR(port, ATMEL_US_RSTSTA);
-@@ -481,14 +742,20 @@ static void atmel_serial_pm(struct uart_
-  */
- static void atmel_set_termios(struct uart_port *port, struct ktermios * termios, struct ktermios * old)
- {
-+	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
- 	unsigned long flags;
- 	unsigned int mode, imr, quot, baud;
- 
-+	/* Get current mode register */
-+	mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL | ATMEL_US_NBSTOP | ATMEL_US_PAR);
-+
- 	baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
- 	quot = uart_get_divisor(port, baud);
- 
--	/* Get current mode register */
--	mode = UART_GET_MR(port) & ~(ATMEL_US_CHRL | ATMEL_US_NBSTOP | ATMEL_US_PAR);
-+	if (quot > 65535) {	/* BRGR is 16-bit, so switch to slower clock */
-+		quot /= 8;
-+		mode |= ATMEL_US_USCLKS_MCK_DIV8;
-+	}
- 
- 	/* byte size */
- 	switch (termios->c_cflag & CSIZE) {
-@@ -534,6 +801,9 @@ static void atmel_set_termios(struct uar
- 	if (termios->c_iflag & (BRKINT | PARMRK))
- 		port->read_status_mask |= ATMEL_US_RXBRK;
- 
-+	if (atmel_port->use_dma_rx)	/* need to enable error interrupts */
-+		UART_PUT_IER(port, port->read_status_mask);
-+
- 	/*
- 	 * Characters to ignore
- 	 */
-@@ -712,6 +982,13 @@ static void __devinit atmel_init_port(st
- 		clk_enable(atmel_port->clk);
- 		port->uartclk = clk_get_rate(atmel_port->clk);
- 	}
-+
-+#ifdef SUPPORT_PDC
-+	atmel_port->use_dma_rx = data->use_dma_rx;
-+	atmel_port->use_dma_tx = data->use_dma_tx;
-+	if (atmel_port->use_dma_tx)
-+		port->fifosize = PDC_BUFFER_SIZE;
-+#endif
- }
- 
- /*
-@@ -888,7 +1165,8 @@ static int atmel_serial_suspend(struct p
- 	struct uart_port *port = platform_get_drvdata(pdev);
- 	struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
- 
--	if (device_may_wakeup(&pdev->dev) && !at91_suspend_entering_slow_clock())
-+	if (device_may_wakeup(&pdev->dev)
-+			&& !clk_must_disable(atmel_port->clk))
- 		enable_irq_wake(port->irq);
- 	else {
- 		uart_suspend_port(&atmel_uart, port);
-Index: linux-2.6.21.7/drivers/serial/atmel_serial.h
-===================================================================
---- linux-2.6.21.7.orig/drivers/serial/atmel_serial.h
-+++ linux-2.6.21.7/drivers/serial/atmel_serial.h
-@@ -46,6 +46,9 @@
- #define			ATMEL_US_USMODE_ISO7816_T1	6
- #define			ATMEL_US_USMODE_IRDA		8
- #define		ATMEL_US_USCLKS		(3   <<  4)		/* Clock Selection */
-+#define			ATMEL_US_USCLKS_MCK		(0 <<  4)
-+#define			ATMEL_US_USCLKS_MCK_DIV8	(1 <<  4)
-+#define			ATMEL_US_USCLKS_SCK		(3 <<  4)
- #define		ATMEL_US_CHRL		(3   <<  6)		/* Character Length */
- #define			ATMEL_US_CHRL_5			(0 <<  6)
- #define			ATMEL_US_CHRL_6			(1 <<  6)
-Index: linux-2.6.21.7/drivers/spi/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/spi/Kconfig
-+++ linux-2.6.21.7/drivers/spi/Kconfig
-@@ -54,6 +54,7 @@ comment "SPI Master Controller Drivers"
- config SPI_ATMEL
- 	tristate "Atmel SPI Controller"
- 	depends on (ARCH_AT91 || AVR32) && SPI_MASTER
-+	select SPI_AT91_MANUAL_CS if ARCH_AT91RM9200
- 	help
- 	  This selects a driver for the Atmel SPI Controller, present on
- 	  many AT32 (AVR32) and AT91 (ARM) chips.
-@@ -82,6 +83,24 @@ config SPI_BUTTERFLY
- 	  inexpensive battery powered microcontroller evaluation board.
- 	  This same cable can be used to flash new firmware.
- 
-+config SPI_AT91
-+	tristate "AT91RM9200 Bitbang SPI Master"
-+	depends on SPI_MASTER && ARCH_AT91RM9200 && !SPI_ATMEL && EXPERIMENTAL
-+	select SPI_BITBANG
-+	select SPI_AT91_MANUAL_CS
-+	help
-+	  This is dumb PIO bitbanging driver for the Atmel AT91RM9200.
-+	  The SPI_ATMEL driver will be its replacement, using the native
-+	  SPI hardware and its DMA controller.
-+
-+config SPI_AT91_MANUAL_CS
-+	bool
-+	depends on ARCH_AT91RM9200
-+	help
-+	  Works around an AT91RM9200 problem whereby the SPI chip-select
-+	  will be wrongly disabled.  The workaround uses those pins as
-+	  GPIOs instead of letting the SPI controller manage them.
-+
- config SPI_IMX
- 	tristate "Freescale iMX SPI controller"
- 	depends on SPI_MASTER && ARCH_IMX && EXPERIMENTAL
-Index: linux-2.6.21.7/drivers/spi/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/spi/Makefile
-+++ linux-2.6.21.7/drivers/spi/Makefile
-@@ -20,6 +20,7 @@ obj-$(CONFIG_SPI_OMAP_UWIRE)		+= omap_uw
- obj-$(CONFIG_SPI_MPC83xx)		+= spi_mpc83xx.o
- obj-$(CONFIG_SPI_S3C24XX_GPIO)		+= spi_s3c24xx_gpio.o
- obj-$(CONFIG_SPI_S3C24XX)		+= spi_s3c24xx.o
-+obj-$(CONFIG_SPI_AT91)			+= spi_at91_bitbang.o
- # 	... add above this line ...
- 
- # SPI protocol drivers (device/link on bus)
-Index: linux-2.6.21.7/drivers/spi/spi_at91_bitbang.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/spi/spi_at91_bitbang.c
-@@ -0,0 +1,207 @@
-+/*
-+ * at91_spi.c - at91 SPI driver (BOOTSTRAP/BITBANG VERSION)
-+ *
-+ * Copyright (C) 2006 David Brownell
-+ *
-+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/spi/spi.h>
-+#include <linux/spi/spi_bitbang.h>
-+
-+#include <asm/arch/gpio.h>
-+
-+
-+/*
-+ * FIXME this bitbanging version is just to help bootstrap systems until
-+ * there's a native SPI+IRQ+DMA controller driver ... such a driver should
-+ * be a drop-in replacement for this one, and much faster.
-+ *
-+ * remember:
-+ *
-+ *	- other at91 parts (like at91sam9) have multiple controllers
-+ *	  and different pin muxing; this version is at91rm9200 specfic.
-+ *
-+ *	- at91sam9261 SPI0 pins are directly muxed with MMC/SD pins.
-+ *
-+ *	- rm9200 spi chipselects drop wrongly, so the native driver
-+ *	  will need to use gpios much like this does.
-+ *
-+ *	- real hardware only allows 8..16 bits per word, while this
-+ *	  bitbanger allows 1..32 (incompatible superset).
-+ *
-+ *	- this disregards clock parameters.  with inlined gpio calls,
-+ *	  gcc 3.4.4 produces about 1.5 mbit/sec, more than 2x faster
-+ *	  than using the subroutined veresion from txrx_word().
-+ *
-+ *	- suspend/resume and <linux/clk.h> support is missing ...
-+ */
-+
-+#define	spi_miso_bit	AT91_PIN_PA0
-+#define	spi_mosi_bit	AT91_PIN_PA1
-+#define	spi_sck_bit	AT91_PIN_PA2
-+
-+struct at91_spi {
-+	struct spi_bitbang	bitbang;
-+	struct platform_device	*pdev;
-+};
-+
-+/*----------------------------------------------------------------------*/
-+
-+static inline void setsck(struct spi_device *spi, int is_on)
-+{
-+	at91_set_gpio_value(spi_sck_bit, is_on);
-+}
-+
-+static inline void setmosi(struct spi_device *spi, int is_on)
-+{
-+	at91_set_gpio_value(spi_mosi_bit, is_on);
-+}
-+
-+static inline int getmiso(struct spi_device *spi)
-+{
-+	return at91_get_gpio_value(spi_miso_bit);
-+}
-+
-+static void at91_spi_chipselect(struct spi_device *spi, int is_active)
-+{
-+	unsigned long cs = (unsigned long) spi->controller_data;
-+
-+	/* set default clock polarity */
-+	if (is_active)
-+		setsck(spi, spi->mode & SPI_CPOL);
-+
-+	/* only support active-low (default) */
-+	at91_set_gpio_value(cs, !is_active);
-+}
-+
-+/*
-+ * NOTE:  this is "as fast as we can"; it should be a function of
-+ * the device clock ...
-+ */
-+#define	spidelay(X)	do{} while(0)
-+
-+#define	EXPAND_BITBANG_TXRX
-+#include <linux/spi/spi_bitbang.h>
-+
-+static u32 at91_spi_txrx_word_mode0(struct spi_device *spi,
-+		unsigned nsecs, u32 word, u8 bits)
-+{
-+	return bitbang_txrx_be_cpha0(spi, nsecs, 0, word, 8);
-+}
-+
-+static u32 at91_spi_txrx_word_mode1(struct spi_device *spi,
-+		unsigned nsecs, u32 word, u8 bits)
-+{
-+	return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, 8);
-+}
-+
-+static u32 at91_spi_txrx_word_mode2(struct spi_device *spi,
-+		unsigned nsecs, u32 word, u8 bits)
-+{
-+	return bitbang_txrx_be_cpha0(spi, nsecs, 1, word, 8);
-+}
-+
-+static u32 at91_spi_txrx_word_mode3(struct spi_device *spi,
-+		unsigned nsecs, u32 word, u8 bits)
-+{
-+	return bitbang_txrx_be_cpha1(spi, nsecs, 1, word, 8);
-+}
-+
-+/*----------------------------------------------------------------------*/
-+
-+static int __init at91_spi_probe(struct platform_device *pdev)
-+{
-+	int			status;
-+	struct spi_master	*master;
-+	struct at91_spi		*at91_spi;
-+
-+	if (pdev->id != 0)	/* SPI0 bus */
-+		return -EINVAL;
-+
-+	master = spi_alloc_master(&pdev->dev, sizeof *at91_spi);
-+	if (!master)
-+		return -ENOMEM;
-+
-+	at91_spi = spi_master_get_devdata(master);
-+	at91_spi->pdev = pdev;
-+	platform_set_drvdata(pdev, at91_spi);
-+
-+	/* SPI and bitbang hookup */
-+	master->bus_num = 0;
-+	master->num_chipselect = 4;
-+
-+	at91_spi->bitbang.master = spi_master_get(master);
-+	at91_spi->bitbang.chipselect = at91_spi_chipselect;
-+	at91_spi->bitbang.txrx_word[SPI_MODE_0] = at91_spi_txrx_word_mode0;
-+	at91_spi->bitbang.txrx_word[SPI_MODE_1] = at91_spi_txrx_word_mode1;
-+	at91_spi->bitbang.txrx_word[SPI_MODE_2] = at91_spi_txrx_word_mode2;
-+	at91_spi->bitbang.txrx_word[SPI_MODE_3] = at91_spi_txrx_word_mode3;
-+
-+	status = spi_bitbang_start(&at91_spi->bitbang);
-+	if (status < 0)
-+		(void) spi_master_put(at91_spi->bitbang.master);
-+
-+	return status;
-+}
-+
-+static int __exit at91_spi_remove(struct platform_device *pdev)
-+{
-+	struct at91_spi	*at91_spi = platform_get_drvdata(pdev);
-+	int status;
-+
-+	/* stop() unregisters child devices too */
-+	status = spi_bitbang_stop(&at91_spi->bitbang);
-+	(void) spi_master_put(at91_spi->bitbang.master);
-+
-+	platform_set_drvdata(pdev, NULL);
-+	return status;
-+}
-+
-+static struct platform_driver at91_spi_driver = {
-+	.probe		= at91_spi_probe,
-+	.remove		= __exit_p(at91_spi_remove),
-+	.driver		= {
-+		.name	= "at91_spi",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+static int __init at91_spi_init(void)
-+{
-+	at91_set_gpio_output(spi_sck_bit, 0);
-+	at91_set_gpio_output(spi_mosi_bit, 0);
-+	at91_set_gpio_input(spi_miso_bit, 1 /* pullup */);
-+
-+	/* register driver */
-+	return platform_driver_register(&at91_spi_driver);
-+}
-+
-+static void __exit at91_spi_exit(void)
-+{
-+	platform_driver_unregister(&at91_spi_driver);
-+}
-+
-+device_initcall(at91_spi_init);
-+module_exit(at91_spi_exit);
-+
-+MODULE_ALIAS("at91_spi.0");
-+
-+MODULE_DESCRIPTION("AT91 SPI support (BOOTSTRAP/BITBANG VERSION)");
-+MODULE_AUTHOR("David Brownell");
-+MODULE_LICENSE("GPL");
-Index: linux-2.6.21.7/drivers/usb/gadget/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/usb/gadget/Kconfig
-+++ linux-2.6.21.7/drivers/usb/gadget/Kconfig
-@@ -189,7 +189,7 @@ config USB_OTG
- 
- config USB_GADGET_AT91
- 	boolean "AT91 USB Device Port"
--	depends on ARCH_AT91
-+	depends on ARCH_AT91 && !ARCH_AT91SAM9RL
- 	select USB_GADGET_SELECTED
- 	help
- 	   Many Atmel AT91 processors (such as the AT91RM2000) have a
-Index: linux-2.6.21.7/drivers/usb/gadget/at91_udc.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/usb/gadget/at91_udc.c
-+++ linux-2.6.21.7/drivers/usb/gadget/at91_udc.c
-@@ -1804,7 +1804,7 @@ static int at91udc_suspend(struct platfo
- 	 */
- 	if ((!udc->suspended && udc->addr)
- 			|| !wake
--			|| at91_suspend_entering_slow_clock()) {
-+			|| clk_must_disable(udc->fclk)) {
- 		pullup(udc, 0);
- 		wake = 0;
- 	} else
-Index: linux-2.6.21.7/drivers/usb/host/ohci-at91.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/usb/host/ohci-at91.c
-+++ linux-2.6.21.7/drivers/usb/host/ohci-at91.c
-@@ -299,7 +299,7 @@ ohci_hcd_at91_drv_suspend(struct platfor
- 	 *
- 	 * REVISIT: some boards will be able to turn VBUS off...
- 	 */
--	if (at91_suspend_entering_slow_clock()) {
-+	if (clk_must_disable(fclk)) {
- 		ohci_usb_reset (ohci);
- 		at91_stop_clock();
- 	}
-Index: linux-2.6.21.7/drivers/video/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/video/Kconfig
-+++ linux-2.6.21.7/drivers/video/Kconfig
-@@ -663,6 +663,17 @@ config FB_EPSON1355
- 	  framebuffer.  Product specs at
- 	  <http://www.erd.epson.com/vdc/html/products.htm>.
- 
-+config FB_S1D15605
-+	tristate "Epson S1D15605 framebuffer support"
-+	depends on FB
-+	default m if MACH_KB9200
-+	select FB_CFB_FILLRECT
-+	select FB_CFB_COPYAREA
-+	select FB_CFB_IMAGEBLIT
-+	help
-+	  Build in support for the S1D15605 Epson Research 128x64
-+	  LCD controller as a framebuffer.
-+
- config FB_S1D13XXX
- 	tristate "Epson S1D13XXX framebuffer support"
- 	depends on FB
-@@ -674,6 +685,22 @@ config FB_S1D13XXX
- 	  working with S1D13806). Product specs at
- 	  <http://www.erd.epson.com/vdc/html/legacy_13xxx.htm>
- 
-+config FB_ATMEL
-+	tristate "AT91/AT32 LCD Controller support"
-+	depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || AVR32)
-+	select FB_CFB_FILLRECT
-+	select FB_CFB_COPYAREA
-+	select FB_CFB_IMAGEBLIT
-+	help
-+	  This enables support for the AT91/AT32 LCD Controller.
-+
-+config FB_INTSRAM
-+	bool "Frame Buffer in internal SRAM"
-+	depends on FB_ATMEL && ARCH_AT91SAM9261
-+	help
-+	  Say Y if you want to map Frame Buffer in internal SRAM. Say N if you want
-+	  to let frame buffer in external SDRAM.
-+
- config FB_NVIDIA
- 	tristate "nVidia Framebuffer Support"
- 	depends on FB && PCI
-Index: linux-2.6.21.7/drivers/video/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/video/Makefile
-+++ linux-2.6.21.7/drivers/video/Makefile
-@@ -75,6 +75,8 @@ obj-$(CONFIG_FB_G364)             += g36
- obj-$(CONFIG_FB_SA1100)           += sa1100fb.o
- obj-$(CONFIG_FB_HIT)              += hitfb.o
- obj-$(CONFIG_FB_EPSON1355)	  += epson1355fb.o
-+obj-$(CONFIG_FB_S1D15605)	  += s1d15605fb.o
-+obj-$(CONFIG_FB_ATMEL)            += atmel_lcdfb.o
- obj-$(CONFIG_FB_PVR2)             += pvr2fb.o
- obj-$(CONFIG_FB_VOODOO1)          += sstfb.o
- obj-$(CONFIG_FB_ARMCLCD)	  += amba-clcd.o
-Index: linux-2.6.21.7/drivers/video/atmel_lcdfb.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/video/atmel_lcdfb.c
-@@ -0,0 +1,752 @@
-+/*
-+ *  Driver for AT91/AT32 LCD Controller
-+ *
-+ *  Copyright (C) 2007 Atmel Corporation
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file COPYING in the main directory of this archive for
-+ * more details.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/platform_device.h>
-+#include <linux/dma-mapping.h>
-+#include <linux/interrupt.h>
-+#include <linux/clk.h>
-+#include <linux/fb.h>
-+#include <linux/init.h>
-+#include <linux/delay.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/cpu.h>
-+#include <asm/arch/gpio.h>
-+
-+#include <video/atmel_lcdc.h>
-+
-+#define lcdc_readl(sinfo, reg)		__raw_readl((sinfo)->mmio+(reg))
-+#define lcdc_writel(sinfo, reg, val)	__raw_writel((val), (sinfo)->mmio+(reg))
-+
-+/* configurable parameters */
-+#define ATMEL_LCDC_CVAL_DEFAULT		0xc8
-+#define ATMEL_LCDC_DMA_BURST_LEN	8
-+
-+#if defined(CONFIG_ARCH_AT91SAM9263)
-+#define ATMEL_LCDC_FIFO_SIZE		2048
-+#else
-+#define ATMEL_LCDC_FIFO_SIZE		512
-+#endif
-+
-+#if defined(CONFIG_ARCH_AT91)
-+#define	ATMEL_LCDFB_FBINFO_DEFAULT	FBINFO_DEFAULT
-+
-+static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
-+					struct fb_var_screeninfo *var)
-+{
-+
-+}
-+#elif defined(CONFIG_AVR32)
-+#define	ATMEL_LCDFB_FBINFO_DEFAULT	(FBINFO_DEFAULT \
-+					| FBINFO_PARTIAL_PAN_OK \
-+					| FBINFO_HWACCEL_XPAN \
-+					| FBINFO_HWACCEL_YPAN)
-+
-+static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
-+				     struct fb_var_screeninfo *var)
-+{
-+	u32 dma2dcfg;
-+	u32 pixeloff;
-+
-+	pixeloff = (var->xoffset * var->bits_per_pixel) & 0x1f;
-+
-+	dma2dcfg = ((var->xres_virtual - var->xres) * var->bits_per_pixel) / 8;
-+	dma2dcfg |= pixeloff << ATMEL_LCDC_PIXELOFF_OFFSET;
-+	lcdc_writel(sinfo, ATMEL_LCDC_DMA2DCFG, dma2dcfg);
-+
-+	/* Update configuration */
-+	lcdc_writel(sinfo, ATMEL_LCDC_DMACON,
-+		    lcdc_readl(sinfo, ATMEL_LCDC_DMACON)
-+		    | ATMEL_LCDC_DMAUPDT);
-+}
-+#endif
-+
-+
-+static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
-+	.type		= FB_TYPE_PACKED_PIXELS,
-+	.visual		= FB_VISUAL_TRUECOLOR,
-+	.xpanstep	= 0,
-+	.ypanstep	= 0,
-+	.ywrapstep	= 0,
-+	.accel		= FB_ACCEL_NONE,
-+};
-+
-+
-+static void atmel_lcdfb_update_dma(struct fb_info *info,
-+			       struct fb_var_screeninfo *var)
-+{
-+	struct atmel_lcdfb_info *sinfo = info->par;
-+	struct fb_fix_screeninfo *fix = &info->fix;
-+	unsigned long dma_addr;
-+
-+	dma_addr = (fix->smem_start + var->yoffset * fix->line_length
-+		    + var->xoffset * var->bits_per_pixel / 8);
-+
-+	dma_addr &= ~3UL;
-+
-+	/* Set framebuffer DMA base address and pixel offset */
-+	lcdc_writel(sinfo, ATMEL_LCDC_DMABADDR1, dma_addr);
-+
-+	atmel_lcdfb_update_dma2d(sinfo, var);
-+}
-+
-+static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
-+{
-+	struct fb_info *info = sinfo->info;
-+
-+	dma_free_writecombine(info->device, info->fix.smem_len,
-+				info->screen_base, info->fix.smem_start);
-+}
-+
-+/**
-+ *	atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory
-+ *	@sinfo: the frame buffer to allocate memory for
-+ */
-+static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
-+{
-+	struct fb_info *info = sinfo->info;
-+	struct fb_var_screeninfo *var = &info->var;
-+
-+	info->fix.smem_len = (var->xres_virtual * var->yres_virtual
-+			    * ((var->bits_per_pixel + 7) / 8));
-+
-+	info->screen_base = dma_alloc_writecombine(info->device, info->fix.smem_len,
-+					(dma_addr_t *)&info->fix.smem_start, GFP_KERNEL);
-+
-+	if (!info->screen_base) {
-+		return -ENOMEM;
-+	}
-+
-+	return 0;
-+}
-+
-+/**
-+ *      atmel_lcdfb_check_var - Validates a var passed in.
-+ *      @var: frame buffer variable screen structure
-+ *      @info: frame buffer structure that represents a single frame buffer
-+ *
-+ *	Checks to see if the hardware supports the state requested by
-+ *	var passed in. This function does not alter the hardware
-+ *	state!!!  This means the data stored in struct fb_info and
-+ *	struct atmel_lcdfb_info do not change. This includes the var
-+ *	inside of struct fb_info.  Do NOT change these. This function
-+ *	can be called on its own if we intent to only test a mode and
-+ *	not actually set it. The stuff in modedb.c is a example of
-+ *	this. If the var passed in is slightly off by what the
-+ *	hardware can support then we alter the var PASSED in to what
-+ *	we can do. If the hardware doesn't support mode change a
-+ *	-EINVAL will be returned by the upper layers. You don't need
-+ *	to implement this function then. If you hardware doesn't
-+ *	support changing the resolution then this function is not
-+ *	needed. In this case the driver would just provide a var that
-+ *	represents the static state the screen is in.
-+ *
-+ *	Returns negative errno on error, or zero on success.
-+ */
-+static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
-+			     struct fb_info *info)
-+{
-+	struct device *dev = info->device;
-+	struct atmel_lcdfb_info *sinfo = info->par;
-+	unsigned long clk_value_khz;
-+
-+	clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000;
-+
-+	dev_dbg(dev, "%s:\n", __func__);
-+	dev_dbg(dev, "  resolution: %ux%u\n", var->xres, var->yres);
-+	dev_dbg(dev, "  pixclk:     %lu KHz\n", PICOS2KHZ(var->pixclock));
-+	dev_dbg(dev, "  bpp:        %u\n", var->bits_per_pixel);
-+	dev_dbg(dev, "  clk:        %lu KHz\n", clk_value_khz);
-+
-+	if ((PICOS2KHZ(var->pixclock) * var->bits_per_pixel / 8) > clk_value_khz) {
-+		dev_err(dev, "%lu KHz pixel clock is too fast\n", PICOS2KHZ(var->pixclock));
-+		return -EINVAL;
-+	}
-+
-+	/* Force same alignment for each line */
-+	var->xres = (var->xres + 3) & ~3UL;
-+	var->xres_virtual = (var->xres_virtual + 3) & ~3UL;
-+
-+	var->red.msb_right = var->green.msb_right = var->blue.msb_right = 0;
-+	var->transp.msb_right = 0;
-+	var->transp.offset = var->transp.length = 0;
-+	var->xoffset = var->yoffset = 0;
-+
-+	switch (var->bits_per_pixel) {
-+	case 2:
-+	case 4:
-+	case 8:
-+		var->red.offset = var->green.offset = var->blue.offset = 0;
-+		var->red.length = var->green.length = var->blue.length
-+			= var->bits_per_pixel;
-+		break;
-+	case 15:
-+	case 16:
-+		var->red.offset = 0;
-+		var->green.offset = 5;
-+		var->blue.offset = 10;
-+		var->red.length = var->green.length = var->blue.length = 5;
-+		break;
-+	case 24:
-+	case 32:
-+		var->red.offset = 0;
-+		var->green.offset = 8;
-+		var->blue.offset = 16;
-+		var->red.length = var->green.length = var->blue.length = 8;
-+		break;
-+	default:
-+		dev_err(dev, "color depth %d not supported\n",
-+					var->bits_per_pixel);
-+		return -EINVAL;
-+	}
-+
-+	return 0;
-+}
-+
-+/**
-+ *      atmel_lcdfb_set_par - Alters the hardware state.
-+ *      @info: frame buffer structure that represents a single frame buffer
-+ *
-+ *	Using the fb_var_screeninfo in fb_info we set the resolution
-+ *	of the this particular framebuffer. This function alters the
-+ *	par AND the fb_fix_screeninfo stored in fb_info. It doesn't
-+ *	not alter var in fb_info since we are using that data. This
-+ *	means we depend on the data in var inside fb_info to be
-+ *	supported by the hardware.  atmel_lcdfb_check_var is always called
-+ *	before atmel_lcdfb_set_par to ensure this.  Again if you can't
-+ *	change the resolution you don't need this function.
-+ *
-+ */
-+static int atmel_lcdfb_set_par(struct fb_info *info)
-+{
-+	struct atmel_lcdfb_info *sinfo = info->par;
-+	unsigned long value;
-+	unsigned long clk_value_khz;
-+
-+	dev_dbg(info->device, "%s:\n", __func__);
-+	dev_dbg(info->device, "  * resolution: %ux%u (%ux%u virtual)\n",
-+		 info->var.xres, info->var.yres,
-+		 info->var.xres_virtual, info->var.yres_virtual);
-+
-+	/* Turn off the LCD controller and the DMA controller */
-+	lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET);
-+
-+	lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0);
-+
-+	if (info->var.bits_per_pixel <= 8)
-+		info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
-+	else
-+		info->fix.visual = FB_VISUAL_TRUECOLOR;
-+
-+	info->fix.line_length = info->var.xres_virtual * (info->var.bits_per_pixel / 8);
-+
-+	/* Re-initialize the DMA engine... */
-+	dev_dbg(info->device, "  * update DMA engine\n");
-+	atmel_lcdfb_update_dma(info, &info->var);
-+
-+	/* ...set frame size and burst length = 8 words (?) */
-+	value = (info->var.yres * info->var.xres * info->var.bits_per_pixel) / 32;
-+	value |= ((ATMEL_LCDC_DMA_BURST_LEN - 1) << ATMEL_LCDC_BLENGTH_OFFSET);
-+	lcdc_writel(sinfo, ATMEL_LCDC_DMAFRMCFG, value);
-+
-+	/* Now, the LCDC core... */
-+
-+	/* Set pixel clock */
-+	clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000;
-+
-+	value = clk_value_khz / PICOS2KHZ(info->var.pixclock);
-+
-+	if (clk_value_khz % PICOS2KHZ(info->var.pixclock))
-+		value++;
-+
-+	value = (value / 2) - 1;
-+
-+	if (value <= 0) {
-+		dev_notice(info->device, "Bypassing pixel clock divider\n");
-+		lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1, ATMEL_LCDC_BYPASS);
-+	} else
-+		lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1, value << ATMEL_LCDC_CLKVAL_OFFSET);
-+
-+	/* Initialize control register 2 */
-+	value = sinfo->default_lcdcon2;
-+
-+	if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT))
-+		value |= ATMEL_LCDC_INVLINE_INVERTED;
-+	if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT))
-+		value |= ATMEL_LCDC_INVFRAME_INVERTED;
-+
-+	switch (info->var.bits_per_pixel) {
-+		case 1:	value |= ATMEL_LCDC_PIXELSIZE_1; break;
-+		case 2: value |= ATMEL_LCDC_PIXELSIZE_2; break;
-+		case 4: value |= ATMEL_LCDC_PIXELSIZE_4; break;
-+		case 8: value |= ATMEL_LCDC_PIXELSIZE_8; break;
-+		case 15: /* fall through */
-+		case 16: value |= ATMEL_LCDC_PIXELSIZE_16; break;
-+		case 24: value |= ATMEL_LCDC_PIXELSIZE_24; break;
-+		case 32: value |= ATMEL_LCDC_PIXELSIZE_32; break;
-+		default: BUG(); break;
-+	}
-+	dev_dbg(info->device, "  * LCDCON2 = %08lx\n", value);
-+	lcdc_writel(sinfo, ATMEL_LCDC_LCDCON2, value);
-+
-+	/* Vertical timing */
-+	value = (info->var.vsync_len - 1) << ATMEL_LCDC_VPW_OFFSET;
-+	value |= info->var.upper_margin << ATMEL_LCDC_VBP_OFFSET;
-+	value |= info->var.lower_margin;
-+	dev_dbg(info->device, "  * LCDTIM1 = %08lx\n", value);
-+	lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value);
-+
-+	/* Horizontal timing */
-+	value = (info->var.right_margin - 1) << ATMEL_LCDC_HFP_OFFSET;
-+	value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET;
-+	value |= (info->var.left_margin - 1);
-+	dev_dbg(info->device, "  * LCDTIM2 = %08lx\n", value);
-+	lcdc_writel(sinfo, ATMEL_LCDC_TIM2, value);
-+
-+	/* Display size */
-+	value = (info->var.xres - 1) << ATMEL_LCDC_HOZVAL_OFFSET;
-+	value |= info->var.yres - 1;
-+	lcdc_writel(sinfo, ATMEL_LCDC_LCDFRMCFG, value);
-+
-+	/* FIFO Threshold: Use formula from data sheet */
-+	value = ATMEL_LCDC_FIFO_SIZE - (2 * ATMEL_LCDC_DMA_BURST_LEN + 3);
-+	lcdc_writel(sinfo, ATMEL_LCDC_FIFO, value);
-+
-+	/* Toggle LCD_MODE every frame */
-+	lcdc_writel(sinfo, ATMEL_LCDC_MVAL, 0);
-+
-+	/* Disable all interrupts */
-+	lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
-+
-+	/* Set contrast */
-+	value = ATMEL_LCDC_PS_DIV8 | ATMEL_LCDC_POL_POSITIVE | ATMEL_LCDC_ENA_PWMENABLE;
-+	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, value);
-+	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT);
-+	/* ...wait for DMA engine to become idle... */
-+	while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY)
-+		msleep(10);
-+
-+	dev_dbg(info->device, "  * re-enable DMA engine\n");
-+	/* ...and enable it with updated configuration */
-+	lcdc_writel(sinfo, ATMEL_LCDC_DMACON, sinfo->default_dmacon);
-+
-+	dev_dbg(info->device, "  * re-enable LCDC core\n");
-+	lcdc_writel(sinfo, ATMEL_LCDC_PWRCON,
-+		(sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR);
-+
-+	dev_dbg(info->device, "  * DONE\n");
-+
-+	return 0;
-+}
-+
-+static inline unsigned int chan_to_field(unsigned int chan, const struct fb_bitfield *bf)
-+{
-+	chan &= 0xffff;
-+	chan >>= 16 - bf->length;
-+	return chan << bf->offset;
-+}
-+
-+/**
-+ *  	atmel_lcdfb_setcolreg - Optional function. Sets a color register.
-+ *      @regno: Which register in the CLUT we are programming
-+ *      @red: The red value which can be up to 16 bits wide
-+ *	@green: The green value which can be up to 16 bits wide
-+ *	@blue:  The blue value which can be up to 16 bits wide.
-+ *	@transp: If supported the alpha value which can be up to 16 bits wide.
-+ *      @info: frame buffer info structure
-+ *
-+ *  	Set a single color register. The values supplied have a 16 bit
-+ *  	magnitude which needs to be scaled in this function for the hardware.
-+ *	Things to take into consideration are how many color registers, if
-+ *	any, are supported with the current color visual. With truecolor mode
-+ *	no color palettes are supported. Here a psuedo palette is created
-+ *	which we store the value in pseudo_palette in struct fb_info. For
-+ *	pseudocolor mode we have a limited color palette. To deal with this
-+ *	we can program what color is displayed for a particular pixel value.
-+ *	DirectColor is similar in that we can program each color field. If
-+ *	we have a static colormap we don't need to implement this function.
-+ *
-+ *	Returns negative errno on error, or zero on success. In an
-+ *	ideal world, this would have been the case, but as it turns
-+ *	out, the other drivers return 1 on failure, so that's what
-+ *	we're going to do.
-+ */
-+static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
-+			     unsigned int green, unsigned int blue,
-+			     unsigned int transp, struct fb_info *info)
-+{
-+	struct atmel_lcdfb_info *sinfo = info->par;
-+	unsigned int val;
-+	u32 *pal;
-+	int ret = 1;
-+
-+	if (info->var.grayscale)
-+		red = green = blue = (19595 * red + 38470 * green
-+				      + 7471 * blue) >> 16;
-+
-+	switch (info->fix.visual) {
-+	case FB_VISUAL_TRUECOLOR:
-+		if (regno < 16) {
-+			pal = info->pseudo_palette;
-+
-+			val  = chan_to_field(red, &info->var.red);
-+			val |= chan_to_field(green, &info->var.green);
-+			val |= chan_to_field(blue, &info->var.blue);
-+
-+			pal[regno] = val;
-+			ret = 0;
-+		}
-+		break;
-+
-+	case FB_VISUAL_PSEUDOCOLOR:
-+		if (regno < 256) {
-+			val  = ((red   >> 11) & 0x001f);
-+			val |= ((green >>  6) & 0x03e0);
-+			val |= ((blue  >>  1) & 0x7c00);
-+
-+			/*
-+			 * TODO: intensity bit. Maybe something like
-+			 *   ~(red[10] ^ green[10] ^ blue[10]) & 1
-+			 */
-+
-+			lcdc_writel(sinfo, ATMEL_LCDC_LUT(regno), val);
-+			ret = 0;
-+		}
-+		break;
-+	}
-+
-+	return ret;
-+}
-+
-+static int atmel_lcdfb_pan_display(struct fb_var_screeninfo *var,
-+			       struct fb_info *info)
-+{
-+	dev_dbg(info->device, "%s\n", __func__);
-+
-+	atmel_lcdfb_update_dma(info, var);
-+
-+	return 0;
-+}
-+
-+static struct fb_ops atmel_lcdfb_ops = {
-+	.owner		= THIS_MODULE,
-+	.fb_check_var	= atmel_lcdfb_check_var,
-+	.fb_set_par	= atmel_lcdfb_set_par,
-+	.fb_setcolreg	= atmel_lcdfb_setcolreg,
-+	.fb_pan_display	= atmel_lcdfb_pan_display,
-+	.fb_fillrect	= cfb_fillrect,
-+	.fb_copyarea	= cfb_copyarea,
-+	.fb_imageblit	= cfb_imageblit,
-+};
-+
-+static irqreturn_t atmel_lcdfb_interrupt(int irq, void *dev_id)
-+{
-+	struct fb_info *info = dev_id;
-+	struct atmel_lcdfb_info *sinfo = info->par;
-+	u32 status;
-+
-+	status = lcdc_readl(sinfo, ATMEL_LCDC_ISR);
-+	lcdc_writel(sinfo, ATMEL_LCDC_IDR, status);
-+	return IRQ_HANDLED;
-+}
-+
-+static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
-+{
-+	struct fb_info *info = sinfo->info;
-+	int ret = 0;
-+
-+	memset_io(info->screen_base, 0, info->fix.smem_len);
-+	info->var.activate |= FB_ACTIVATE_FORCE | FB_ACTIVATE_NOW;
-+
-+	dev_info(info->device,
-+	       "%luKiB frame buffer at %08lx (mapped at %p)\n",
-+	       (unsigned long)info->fix.smem_len / 1024,
-+	       (unsigned long)info->fix.smem_start,
-+	       info->screen_base);
-+
-+	/* Allocate colormap */
-+	ret = fb_alloc_cmap(&info->cmap, 256, 0);
-+	if (ret < 0)
-+		dev_err(info->device, "Alloc color map failed\n");
-+
-+	return ret;
-+}
-+
-+static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
-+{
-+	if (sinfo->bus_clk)
-+		clk_enable(sinfo->bus_clk);
-+	clk_enable(sinfo->lcdc_clk);
-+}
-+
-+static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
-+{
-+	if (sinfo->bus_clk)
-+		clk_disable(sinfo->bus_clk);
-+	clk_disable(sinfo->lcdc_clk);
-+}
-+
-+
-+static int __init atmel_lcdfb_probe(struct platform_device *pdev)
-+{
-+	struct device *dev = &pdev->dev;
-+	struct fb_info *info;
-+	struct atmel_lcdfb_info *sinfo;
-+	struct atmel_lcdfb_info *pdata_sinfo;
-+	struct resource *regs = NULL;
-+	struct resource *map = NULL;
-+	int ret;
-+
-+	dev_dbg(dev, "%s BEGIN\n", __func__);
-+
-+	ret = -ENOMEM;
-+	info = framebuffer_alloc(sizeof(struct atmel_lcdfb_info), dev);
-+	if (!info) {
-+		dev_err(dev, "cannot allocate memory\n");
-+		goto out;
-+	}
-+
-+	sinfo = info->par;
-+
-+	if (dev->platform_data) {
-+		pdata_sinfo = (struct atmel_lcdfb_info *)dev->platform_data;
-+		sinfo->default_bpp = pdata_sinfo->default_bpp;
-+		sinfo->default_dmacon = pdata_sinfo->default_dmacon;
-+		sinfo->default_lcdcon2 = pdata_sinfo->default_lcdcon2;
-+		sinfo->default_monspecs = pdata_sinfo->default_monspecs;
-+		sinfo->atmel_lcdfb_power_control = pdata_sinfo->atmel_lcdfb_power_control;
-+		sinfo->guard_time = pdata_sinfo->guard_time;
-+	} else {
-+		dev_err(dev, "cannot get default configuration\n");
-+		goto free_info;
-+	}
-+	sinfo->info = info;
-+	sinfo->pdev = pdev;
-+
-+	strcpy(info->fix.id, sinfo->pdev->name);
-+	info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
-+	info->pseudo_palette = sinfo->pseudo_palette;
-+	info->fbops = &atmel_lcdfb_ops;
-+
-+	memcpy(&info->monspecs, sinfo->default_monspecs, sizeof(info->monspecs));
-+	info->fix = atmel_lcdfb_fix;
-+
-+	/* Enable LCDC Clocks */
-+	if (cpu_is_at91sam9261()) {
-+		sinfo->bus_clk = clk_get(dev, "hck1");
-+		if (IS_ERR(sinfo->bus_clk)) {
-+			ret = PTR_ERR(sinfo->bus_clk);
-+			goto free_info;
-+		}
-+	}
-+	sinfo->lcdc_clk = clk_get(dev, "lcdc_clk");
-+	if (IS_ERR(sinfo->lcdc_clk)) {
-+		ret = PTR_ERR(sinfo->lcdc_clk);
-+		goto put_bus_clk;
-+	}
-+	atmel_lcdfb_start_clock(sinfo);
-+
-+	ret = fb_find_mode(&info->var, info, NULL, info->monspecs.modedb,
-+			info->monspecs.modedb_len, info->monspecs.modedb,
-+			sinfo->default_bpp);
-+	if (!ret) {
-+		dev_err(dev, "no suitable video mode found\n");
-+		goto stop_clk;
-+	}
-+
-+
-+	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+	if (!regs) {
-+		dev_err(dev, "resources unusable\n");
-+		ret = -ENXIO;
-+		goto stop_clk;
-+	}
-+
-+	sinfo->irq_base = platform_get_irq(pdev, 0);
-+	if (sinfo->irq_base < 0) {
-+		dev_err(dev, "unable to get irq\n");
-+		ret = sinfo->irq_base;
-+		goto stop_clk;
-+	}
-+
-+	/* Initialize video memory */
-+	map = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-+	if (map) {
-+		/* use a pre-allocated memory buffer */
-+		info->fix.smem_start = map->start;
-+		info->fix.smem_len = map->end - map->start + 1;
-+		if (!request_mem_region(info->fix.smem_start,
-+					info->fix.smem_len, pdev->name)) {
-+			ret = -EBUSY;
-+			goto stop_clk;
-+		}
-+
-+		info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
-+		if (!info->screen_base)
-+			goto release_intmem;
-+	} else {
-+		/* alocate memory buffer */
-+		ret = atmel_lcdfb_alloc_video_memory(sinfo);
-+		if (ret < 0) {
-+			dev_err(dev, "cannot allocate framebuffer: %d\n", ret);
-+			goto stop_clk;
-+		}
-+	}
-+
-+	/* LCDC registers */
-+	info->fix.mmio_start = regs->start;
-+	info->fix.mmio_len = regs->end - regs->start + 1;
-+
-+	if (!request_mem_region(info->fix.mmio_start,
-+				info->fix.mmio_len, pdev->name)) {
-+		ret = -EBUSY;
-+		goto free_fb;
-+	}
-+
-+	sinfo->mmio = ioremap(info->fix.mmio_start, info->fix.mmio_len);
-+	if (!sinfo->mmio) {
-+		dev_err(dev, "cannot map LCDC registers\n");
-+		goto release_mem;
-+	}
-+
-+	/* interrupt */
-+	ret = request_irq(sinfo->irq_base, atmel_lcdfb_interrupt, 0, pdev->name, info);
-+	if (ret) {
-+		dev_err(dev, "request_irq failed: %d\n", ret);
-+		goto unmap_mmio;
-+	}
-+
-+	ret = atmel_lcdfb_init_fbinfo(sinfo);
-+	if (ret < 0) {
-+		dev_err(dev, "init fbinfo failed: %d\n", ret);
-+		goto unregister_irqs;
-+	}
-+
-+	/*
-+	 * This makes sure that our colour bitfield
-+	 * descriptors are correctly initialised.
-+	 */
-+	atmel_lcdfb_check_var(&info->var, info);
-+
-+	ret = fb_set_var(info, &info->var);
-+	if (ret) {
-+		dev_warn(dev, "unable to set display parameters\n");
-+		goto free_cmap;
-+	}
-+
-+	dev_set_drvdata(dev, info);
-+
-+	/*
-+	 * Tell the world that we're ready to go
-+	 */
-+	ret = register_framebuffer(info);
-+	if (ret < 0) {
-+		dev_err(dev, "failed to register framebuffer device: %d\n", ret);
-+		goto free_cmap;
-+	}
-+
-+	/* Power up the LCDC screen */
-+	if (sinfo->atmel_lcdfb_power_control)
-+		sinfo->atmel_lcdfb_power_control(1);
-+
-+	dev_info(dev, "fb%d: Atmel LCDC at 0x%08lx (mapped at %p), irq %lu\n",
-+		       info->node, info->fix.mmio_start, sinfo->mmio, sinfo->irq_base);
-+
-+	return 0;
-+
-+
-+free_cmap:
-+	fb_dealloc_cmap(&info->cmap);
-+unregister_irqs:
-+	free_irq(sinfo->irq_base, info);
-+unmap_mmio:
-+	iounmap(sinfo->mmio);
-+release_mem:
-+ 	release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
-+free_fb:
-+	if (map)
-+		iounmap(info->screen_base);
-+	else
-+		atmel_lcdfb_free_video_memory(sinfo);
-+
-+release_intmem:
-+	if (map)
-+		release_mem_region(info->fix.smem_start, info->fix.smem_len);
-+stop_clk:
-+	atmel_lcdfb_stop_clock(sinfo);
-+	clk_put(sinfo->lcdc_clk);
-+put_bus_clk:
-+	if (sinfo->bus_clk)
-+		clk_put(sinfo->bus_clk);
-+free_info:
-+	framebuffer_release(info);
-+out:
-+	dev_dbg(dev, "%s FAILED\n", __func__);
-+	return ret;
-+}
-+
-+static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
-+{
-+	struct device *dev = &pdev->dev;
-+	struct fb_info *info = dev_get_drvdata(dev);
-+	struct atmel_lcdfb_info *sinfo = info->par;
-+
-+	if (!sinfo)
-+		return 0;
-+
-+	if (sinfo->atmel_lcdfb_power_control)
-+		sinfo->atmel_lcdfb_power_control(0);
-+	unregister_framebuffer(info);
-+	atmel_lcdfb_stop_clock(sinfo);
-+	clk_put(sinfo->lcdc_clk);
-+	if (sinfo->bus_clk)
-+		clk_put(sinfo->bus_clk);
-+	fb_dealloc_cmap(&info->cmap);
-+	free_irq(sinfo->irq_base, info);
-+	iounmap(sinfo->mmio);
-+ 	release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
-+	if (platform_get_resource(pdev, IORESOURCE_MEM, 1)) {
-+		iounmap(info->screen_base);
-+		release_mem_region(info->fix.smem_start, info->fix.smem_len);
-+	} else {
-+		atmel_lcdfb_free_video_memory(sinfo);
-+	}
-+
-+	dev_set_drvdata(dev, NULL);
-+	framebuffer_release(info);
-+
-+	return 0;
-+}
-+
-+static struct platform_driver atmel_lcdfb_driver = {
-+	.remove		= __exit_p(atmel_lcdfb_remove),
-+	.driver		= {
-+		.name	= "atmel_lcdfb",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+static int __init atmel_lcdfb_init(void)
-+{
-+	return platform_driver_probe(&atmel_lcdfb_driver, atmel_lcdfb_probe);
-+}
-+
-+static void __exit atmel_lcdfb_exit(void)
-+{
-+	platform_driver_unregister(&atmel_lcdfb_driver);
-+}
-+
-+module_init(atmel_lcdfb_init);
-+module_exit(atmel_lcdfb_exit);
-+
-+MODULE_DESCRIPTION("AT91/AT32 LCD Controller framebuffer driver");
-+MODULE_AUTHOR("Nicolas Ferre <[email protected]>");
-+MODULE_LICENSE("GPL");
-Index: linux-2.6.21.7/drivers/video/backlight/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/video/backlight/Kconfig
-+++ linux-2.6.21.7/drivers/video/backlight/Kconfig
-@@ -63,3 +63,11 @@ config BACKLIGHT_PROGEAR
- 	help
- 	  If you have a Frontpath ProGear say Y to enable the
- 	  backlight driver.
-+
-+config BACKLIGHT_KB920x
-+	tristate "KwikByte KB9202 Backlight Driver"
-+	depends on BACKLIGHT_CLASS_DEVICE && MACH_KB9200
-+	default y
-+	help
-+	  If you have a KwikByte KB9202 board, say Y to enable the
-+	  backlight driver.
-Index: linux-2.6.21.7/drivers/video/backlight/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/video/backlight/Makefile
-+++ linux-2.6.21.7/drivers/video/backlight/Makefile
-@@ -6,3 +6,4 @@ obj-$(CONFIG_BACKLIGHT_CORGI)	+= corgi_b
- obj-$(CONFIG_BACKLIGHT_HP680)	+= hp680_bl.o
- obj-$(CONFIG_BACKLIGHT_LOCOMO)	+= locomolcd.o
- obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
-+obj-$(CONFIG_BACKLIGHT_KB920x)	+= kb920x_bl.o
-Index: linux-2.6.21.7/drivers/video/backlight/kb920x_bl.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/video/backlight/kb920x_bl.c
-@@ -0,0 +1,164 @@
-+/*
-+ * Backlight Driver for KB9202
-+ *
-+ * Copyright (c) 2006 KwikByte
-+ *
-+ * Based on Sharp's Corgi Backlight Driver
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+#include <linux/spinlock.h>
-+#include <linux/fb.h>
-+#include <linux/backlight.h>
-+
-+#include <asm/arch/gpio.h>
-+
-+/* The backlight is on(1)/off(0) */
-+#define	KB9202_DEFAULT_INTENSITY	1
-+#define	KB9202_MAX_INTENSITY		1
-+
-+static int kb9202bl_suspended;
-+static int current_intensity = 0;
-+static DEFINE_SPINLOCK(bl_lock);
-+
-+static int kb9202bl_set_intensity(struct backlight_device *bd)
-+{
-+	unsigned long flags;
-+	int intensity = bd->props.brightness;
-+
-+	if (bd->props.power != FB_BLANK_UNBLANK)
-+		intensity = 0;
-+	if (bd->props.fb_blank != FB_BLANK_UNBLANK)
-+		intensity = 0;
-+	if (kb9202bl_suspended)
-+		intensity = 0;
-+
-+	if ((!current_intensity) && (bd->props.power == FB_BLANK_UNBLANK))
-+		intensity = 1;
-+
-+	spin_lock_irqsave(&bl_lock, flags);
-+	if (intensity)
-+		gpio_set_value(AT91_PIN_PC23, 1);
-+	else
-+		gpio_set_value(AT91_PIN_PC23, 0);
-+	spin_unlock_irqrestore(&bl_lock, flags);
-+
-+	current_intensity = intensity;
-+
-+	return 0;
-+}
-+
-+static int kb9202bl_get_intensity(struct backlight_device *bd)
-+{
-+	return current_intensity;
-+}
-+
-+static struct backlight_ops kb9202bl_ops = {
-+	.get_brightness	= kb9202bl_get_intensity,
-+	.update_status	= kb9202bl_set_intensity,
-+};
-+
-+static int __init kb9202bl_probe(struct platform_device *pdev)
-+{
-+	struct backlight_device *bd;
-+
-+	bd = backlight_device_register ("kb9202-bl", &pdev->dev, NULL, &kb9202bl_ops);
-+	if (IS_ERR(bd))
-+		return PTR_ERR(bd);
-+
-+	platform_set_drvdata(pdev, bd);
-+
-+	bd->props.max_brightness = KB9202_MAX_INTENSITY;
-+	bd->props.brightness = KB9202_DEFAULT_INTENSITY;
-+	(void) kb9202bl_set_intensity(bd);
-+
-+	return 0;
-+}
-+
-+static int kb9202bl_remove(struct platform_device *pdev)
-+{
-+	struct backlight_device *bd = platform_get_drvdata(pdev);
-+
-+	bd->props.brightness = 0;
-+	bd->props.power = 0;
-+	(void) kb9202bl_set_intensity(bd);
-+
-+	backlight_device_unregister(bd);
-+
-+	return 0;
-+}
-+
-+#ifdef CONFIG_PM
-+static int kb9202bl_suspend(struct platform_device *dev, pm_message_t state)
-+{
-+	struct backlight_device *bd = platform_get_drvdata(pdev);
-+
-+	kb9202bl_suspended = 1;
-+	(void) kb9202bl_set_intensity(bd);
-+	return 0;
-+}
-+
-+static int kb9202bl_resume(struct platform_device *dev)
-+{
-+	struct backlight_device *bd = platform_get_drvdata(pdev);
-+
-+	kb9202bl_suspended = 0;
-+	(void) kb9202bl_set_intensity(bd);
-+	return 0;
-+}
-+#else
-+#define kb9202bl_suspend	NULL
-+#define kb9202bl_resume		NULL
-+#endif
-+
-+static struct platform_driver kb9202bl_driver = {
-+	.probe		= kb9202bl_probe,
-+	.remove		= kb9202bl_remove,
-+	.suspend	= kb9202bl_suspend,
-+	.resume		= kb9202bl_resume,
-+	.driver		= {
-+		.name	= "kb9202-bl",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+static struct platform_device *kb9202bl_device;
-+
-+static int __init kb9202bl_init(void)
-+{
-+	int ret;
-+
-+	ret = platform_driver_register(&kb9202bl_driver);
-+	if (!ret) {
-+		kb9202bl_device = platform_device_alloc("kb9202-bl", -1);
-+		if (!kb9202bl_device)
-+			return -ENOMEM;
-+
-+		ret = platform_device_add(kb9202bl_device);
-+		if (ret) {
-+			platform_device_put(kb9202bl_device);
-+			platform_driver_unregister(&kb9202bl_driver);
-+		}
-+	}
-+	return ret;
-+}
-+
-+static void __exit kb9202bl_exit(void)
-+{
-+	platform_device_unregister(kb9202bl_device);
-+	platform_driver_unregister(&kb9202bl_driver);
-+}
-+
-+module_init(kb9202bl_init);
-+module_exit(kb9202bl_exit);
-+
-+MODULE_AUTHOR("KwikByte <[email protected]>");
-+MODULE_DESCRIPTION("KB9202 Backlight Driver");
-+MODULE_LICENSE("GPL");
-Index: linux-2.6.21.7/drivers/video/s1d15605fb.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/video/s1d15605fb.c
-@@ -0,0 +1,659 @@
-+/*
-+ *  drivers/video/s1d15605.c
-+ *
-+ * Adapted from several sources including:
-+ * 1) Driver for AT91 LCD Controller
-+ *    Copyright (C) 2006 Atmel
-+ *
-+ * 2) Copyright (C) 2005 S. Kevin Hester
-+ *
-+ *   This file is subject to the terms and conditions of the GNU General Public
-+ *   License. See the file COPYING in the main directory of this archive for
-+ *   more details.
-+ *
-+ *   This is a basic framebuffer driver for the Optrex F-51320 128x64 mono LCD
-+ *   display.  This display uses a clone of the common Epson SED 1531 display
-+ *   controller.
-+ *
-+ *   I've heavily borrowed code from the vfb.c driver.
-+ *
-+ * 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
-+ */
-+
-+#ifdef DEBUG
-+#define MSG(string, args...) printk("s1d15605fb:" string, ##args)
-+#else
-+#define MSG(string, args...)
-+#endif
-+
-+#include <linux/kernel.h>
-+#include <linux/platform_device.h>
-+#include <linux/dma-mapping.h>
-+#include <linux/interrupt.h>
-+#include <linux/clk.h>
-+#include <linux/fb.h>
-+#include <linux/init.h>
-+#include <linux/delay.h>
-+
-+#include <asm/uaccess.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+
-+#ifdef CONFIG_PMAC_BACKLIGHT
-+#include <asm/backlight.h>
-+#endif
-+
-+#define VIDEOWIDTH		128
-+#define VIDEOHEIGHT		64
-+#define VIDEODEPTH		1	/* bits/pixel */
-+#define VIDEOWIDTH_BYTES	((VIDEOWIDTH * VIDEODEPTH) / 8)
-+
-+/* The number of bytes that actually go to the device */
-+#define ACTUALVIDEOMEMSIZE	(VIDEOWIDTH_BYTES * VIDEOHEIGHT)
-+#define VIDEOMEMSIZE		PAGE_SIZE
-+
-+static struct fb_var_screeninfo s1d15605_default __initdata = {
-+	.xres		= VIDEOWIDTH,
-+	.yres		= VIDEOHEIGHT,
-+	.xres_virtual	= VIDEOWIDTH,
-+	.yres_virtual	= VIDEOHEIGHT,
-+	.bits_per_pixel	= VIDEODEPTH,
-+	.red		= { 0, 1, 0 },
-+	.green		= { 0, 1, 0 },
-+	.blue		= { 0, 1, 0 },
-+	.activate	= FB_ACTIVATE_NOW,
-+	.pixclock	= 20000,
-+	.vmode		= FB_VMODE_NONINTERLACED,
-+};
-+
-+static struct fb_fix_screeninfo s1d15605_fix __initdata = {
-+	.id		= "s1d15605",
-+	.type		= FB_TYPE_PACKED_PIXELS,
-+	.visual		= FB_VISUAL_MONO10,
-+	.xpanstep	= 0,
-+	.ypanstep	= 0,
-+	.ywrapstep	= 0,
-+	.accel		= FB_ACCEL_NONE,
-+};
-+
-+struct s1d15605fb_info {
-+	struct fb_info		*info;
-+	char			*mmio;
-+	unsigned long		reset_pin;
-+	struct platform_device	*pdev;
-+};
-+
-+/*
-+ * LCD device interface
-+ */
-+#define	RESET_DISPLAY		0xE2
-+#define	LCD_BIAS_1_9		0xA2
-+#define	ADC_SELECT_REVERSE	0xA1
-+#define	COMMON_OUTPUT_NORMAL	0xC0
-+#define	V5_RESISTOR_RATIO	0x26
-+#define	ELECTRONIC_VOLUME_SET	0x81
-+#define	ELECTRONIC_VOLUME_INIT	0x20
-+#define	POWER_CONTROL_SET	0x28
-+#define	VOLTAGE_REGULATOR	0x02
-+#define	VOLTAGE_FOLLOWER	0x01
-+#define	BOOSTER_CIRCUIT		0x04
-+#define	DISPLAY_ON		0xAF
-+#define	START_LINE_SET		0x40
-+#define	PAGE_ADDRESS_SET	0xB0
-+#define	COLUMN_ADDRESS_HIGH	0x10
-+#define	COLUMN_ADDRESS_LOW	0x00
-+#define	RESISTOR_RATIO_START	0x20
-+
-+#define	NUM_OF_PAGES		8
-+#define	NUM_OF_COLUMNS		128
-+
-+#define	WRITE_COMMAND(x)	__raw_writeb((x), (sinfo)->mmio)
-+#define	READ_COMMAND		__raw_readb((sinfo)->mmio)
-+#define	WRITE_DATA(x)		__raw_writeb((x), (sinfo)->mmio + (0x10000))
-+#define	READ_DATA		__raw_readb((sinfo)->mmio + (0x10000))
-+
-+
-+/*
-+ *	s1d15605fb_resize_framebuffer
-+ *
-+ *	Free allocated space if different.  Allocate on new of changed.
-+ *	Returns -ENOMEM if the new framebuffer can not be allocated,
-+ *	zero on success.
-+ */
-+static int s1d15605fb_resize_framebuffer(struct s1d15605fb_info *sinfo)
-+{
-+	struct fb_info			*info = sinfo->info;
-+	struct fb_fix_screeninfo	*fix = &info->fix;
-+	struct fb_var_screeninfo	*var = &info->var;
-+	unsigned int			new_size;
-+	void				*new_vaddr;
-+
-+	new_size = ((var->xres_virtual * var->yres_virtual * var->bits_per_pixel) / 8);
-+
-+	MSG("%s: x (%d) y (%d) bpp (%d): new size 0x%08x\n", __FUNCTION__,
-+		var->xres_virtual, var->yres_virtual, var->bits_per_pixel, new_size);
-+
-+	if (new_size == fix->smem_len)
-+		return 0;
-+
-+	if (fix->smem_len) {
-+		kfree(info->screen_base);
-+	}
-+
-+	new_vaddr = kmalloc(new_size, GFP_KERNEL);
-+
-+	if (!new_vaddr) {
-+		fix->smem_len = 0;
-+		return -ENOMEM;
-+	}
-+
-+	info->screen_base = new_vaddr;
-+	fix->smem_start = (unsigned)new_vaddr;
-+	fix->smem_len = new_size;
-+	fix->line_length = (var->xres_virtual * var->bits_per_pixel) / 8;
-+
-+	dev_info(info->device,
-+		"%luKiB frame buffer at %08lx (mapped at %p)\n",
-+		(unsigned long)info->fix.smem_len / 1024,
-+		(unsigned long)info->fix.smem_start,
-+		info->screen_base);
-+
-+	return 0;
-+}
-+
-+
-+/*
-+ * The s1d15605 seems to be divided into eight 128 pixel wide pages (from top to
-+ * bottom) each page seems to be eight pixels high, where these eight pixels are
-+ * one byte
-+ */
-+static void s1d15605_update(struct fb_info *info)
-+{
-+	struct s1d15605fb_info	*sinfo = info->par;
-+	int			page, i, row, colmask;
-+	u8			retVal, *rowPtr;
-+
-+	WRITE_COMMAND(START_LINE_SET);
-+	for (page = 0; page < NUM_OF_PAGES; ++page) {
-+		WRITE_COMMAND(PAGE_ADDRESS_SET + page);
-+		WRITE_COMMAND(COLUMN_ADDRESS_HIGH);
-+		WRITE_COMMAND(COLUMN_ADDRESS_LOW);
-+
-+		for (i = 0; i < NUM_OF_COLUMNS; ++i)
-+		{
-+			/* point of opportunity: optimization */
-+			colmask = (1 << (i & 0x7));
-+			rowPtr = (u8*)(info->screen_base);
-+			rowPtr += (VIDEOWIDTH_BYTES * 8 * page);
-+			rowPtr += (i >> 3);
-+			retVal = 0;
-+			for (row = 0; row < 8; ++row)
-+			{
-+				retVal = (retVal >> 1) | (((*rowPtr) & colmask) ? 0x80 : 0);
-+				rowPtr += VIDEOWIDTH_BYTES;
-+			}
-+			WRITE_DATA(retVal);
-+		}
-+	}
-+
-+	WRITE_COMMAND(DISPLAY_ON);
-+}
-+
-+
-+/*
-+ * Setting the video mode has been split into two parts.
-+ * First part, xxxfb_check_var, must not write anything
-+ * to hardware, it should only verify and adjust var.
-+ * This means it doesn't alter par but it does use hardware
-+ * data from it to check this var.
-+ */
-+static int s1d15605_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
-+{
-+	/*
-+	 * Some very basic checks
-+	 */
-+	if (!var->xres)
-+		var->xres = 1;
-+	if (!var->yres)
-+		var->yres = 1;
-+	if (var->xres > var->xres_virtual)
-+		var->xres_virtual = var->xres;
-+	if (var->yres > var->yres_virtual)
-+		var->yres_virtual = var->yres;
-+
-+	if(var->bits_per_pixel > VIDEODEPTH)
-+		return -EINVAL;
-+
-+	/*
-+	 * Memory limit
-+	 */
-+	if (((var->yres_virtual * var->bits_per_pixel * var->yres_virtual) >> 3) >
-+			ACTUALVIDEOMEMSIZE)
-+		return -ENOMEM;
-+
-+	/*
-+	 * Now that we checked it we alter var. The reason being is that the video
-+	 * mode passed in might not work but slight changes to it might make it
-+	 * work. This way we let the user know what is acceptable.
-+	 */
-+	switch (var->bits_per_pixel) {
-+	case 1:
-+		var->red.offset = var->green.offset = var->blue.offset = 0;
-+		var->red.length = var->green.length = var->blue.length
-+			= var->bits_per_pixel;
-+		break;
-+	default:
-+		return -EINVAL;
-+	}
-+
-+	var->xoffset = var->yoffset = 0;
-+	var->red.msb_right = var->green.msb_right = var->blue.msb_right =
-+		var->transp.msb_right = 0;
-+
-+	return 0;
-+}
-+
-+
-+/*
-+ * This routine actually sets the video mode. It's in here where we
-+ * the hardware state info->par and fix which can be affected by the
-+ * change in par. For this driver it doesn't do much.
-+ */
-+static int s1d15605_set_par(struct fb_info *info)
-+{
-+	int	ret;
-+
-+	MSG("%s:\n", __func__);
-+	MSG("  * resolution: %ux%u (%ux%u virtual)\n",
-+		 info->var.xres, info->var.yres,
-+		 info->var.xres_virtual, info->var.yres_virtual);
-+
-+	ret = s1d15605fb_resize_framebuffer(info->par);
-+
-+	info->fix.visual = FB_VISUAL_MONO10;
-+	return ret;
-+}
-+
-+
-+/*
-+ * Set a single color register. The values supplied are already
-+ * rounded down to the hardware's capabilities (according to the
-+ * entries in the var structure). Return != 0 for invalid regno.
-+ */
-+static int s1d15605_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
-+			u_int transp, struct fb_info *info)
-+{
-+	if (regno > 1)	/* no. of hw registers - we only do mono now */
-+		return 1;
-+
-+	return 0;
-+}
-+
-+
-+/*
-+ * Currently, the routine will simply shut-off the backlight and prevent
-+ * updates/refreshes.  Modify according to application.
-+ *
-+ * 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off
-+ */
-+static int s1d15605_blank(int blank, struct fb_info *info)
-+{
-+#ifdef CONFIG_PMAC_BACKLIGHT
-+	if (blank)
-+		pmac_backlight->props.power = FB_BLANK_POWERDOWN;
-+	else
-+		pmac_backlight->props.power = FB_BLANK_UNBLANK;
-+	backlight_update_status(pmac_backlight);
-+#endif
-+	return 1;
-+}
-+
-+
-+/*
-+ * Pan or Wrap the Display
-+ *
-+ * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
-+ */
-+/*
-+static int s1d15605_pan_display(struct fb_var_screeninfo *var,
-+			struct fb_info *info)
-+{
-+	if (var->vmode & FB_VMODE_YWRAP) {
-+		if (var->yoffset < 0
-+		    || var->yoffset >= info->var.yres_virtual
-+		    || var->xoffset)
-+			return -EINVAL;
-+	} else {
-+		if (var->xoffset + var->xres > info->var.xres_virtual ||
-+		    var->yoffset + var->yres > info->var.yres_virtual)
-+			return -EINVAL;
-+	}
-+	info->var.xoffset = var->xoffset;
-+	info->var.yoffset = var->yoffset;
-+	if (var->vmode & FB_VMODE_YWRAP)
-+		info->var.vmode |= FB_VMODE_YWRAP;
-+	else
-+		info->var.vmode &= ~FB_VMODE_YWRAP;
-+	return 0;
-+}
-+*/
-+
-+
-+static void s1d15605_copyarea(struct fb_info *info, const struct fb_copyarea *region)
-+{
-+	cfb_copyarea(info, region);
-+	s1d15605_update(info);
-+}
-+
-+
-+static void s1d15605_fillrect (struct fb_info *info, const struct fb_fillrect *rect)
-+{
-+	cfb_fillrect(info, rect);
-+	s1d15605_update(info);
-+}
-+
-+
-+static void s1d15605_imageblit(struct fb_info *p, const struct fb_image *image)
-+{
-+	cfb_imageblit(p, image);
-+	s1d15605_update(p);
-+}
-+
-+
-+/*
-+ * Write the users data to our framebuffer, and then trigger a psuedo DMA
-+ */
-+static ssize_t s1d15605_write(struct file *file, const char *buf,
-+			size_t count, loff_t *ppos)
-+{
-+	unsigned long p = *ppos;
-+	struct inode *inode = file->f_dentry->d_inode;
-+	int fbidx = iminor(inode);
-+	struct fb_info *info = registered_fb[fbidx];
-+	int err;
-+
-+	if (p > info->fix.smem_len)
-+		return -ENOSPC;
-+	if (count >= info->fix.smem_len)
-+		count = info->fix.smem_len;
-+	err = 0;
-+	if (count + p > info->fix.smem_len) {
-+		count = info->fix.smem_len - p;
-+		err = -ENOSPC;
-+	}
-+	if (count) {
-+		char *base_addr;
-+
-+		base_addr = info->screen_base;
-+		count -= copy_from_user(base_addr+p, buf, count);
-+		*ppos += count;
-+		err = -EFAULT;
-+	}
-+
-+	s1d15605_update(info);
-+
-+	if (count)
-+		return count;
-+
-+	return err;
-+}
-+
-+#ifdef	USE_PRIVATE_VMA_FXS
-+static void s1d15605_vma_open(struct vm_area_struct *vma)
-+{
-+	// FIXME - store stats in the device data via vm_private_data
-+}
-+
-+
-+static void s1d15605_vma_close(struct vm_area_struct *vma)
-+{
-+	// FIXME - store stats in the device data via vm_private_data
-+}
-+
-+
-+static struct page *s1d15605_vma_nopage(struct vm_area_struct *vma,
-+				unsigned long address, int *type)
-+{
-+	struct page *page;
-+	struct fb_info *info = vma->vm_private_data;
-+
-+	page = virt_to_page(info->screen_base);
-+	get_page(page);
-+
-+	// FIXME - now someone has a link to our page, start periodically blitting
-+	// latest updates to the actual device.
-+
-+	return page;
-+}
-+
-+
-+static struct vm_operations_struct s1d15605_vm_ops = {
-+	.open	= s1d15605_vma_open,
-+	.close	= s1d15605_vma_close,
-+	.nopage	= s1d15605_vma_nopage
-+};
-+
-+
-+/* We don't do much here - because we have special vm_ops */
-+static int s1d15605_mmap(struct fb_info *info, struct vm_area_struct *vma)
-+{
-+	vma->vm_ops = &s1d15605_vm_ops;
-+	vma->vm_flags |= VM_RESERVED;
-+	vma->vm_private_data = info;
-+	s1d15605_vma_open(vma);
-+
-+	return 0;
-+}
-+#endif /* USE_PRIVATE_VMA_FXS */
-+
-+
-+static struct fb_ops s1d15605fb_ops = {
-+	.owner		= THIS_MODULE,
-+	.fb_check_var	= s1d15605_check_var,
-+	.fb_set_par	= s1d15605_set_par,
-+	.fb_setcolreg	= s1d15605_setcolreg,
-+	.fb_blank	= s1d15605_blank,
-+//	.fb_pan_display	= s1d15605_pan_display,
-+	.fb_fillrect	= s1d15605_fillrect,
-+	.fb_copyarea	= s1d15605_copyarea,
-+	.fb_imageblit	= s1d15605_imageblit,
-+	.fb_write	= s1d15605_write,
-+#ifdef	USE_PRIVATE_VMA_FXS
-+	.fb_mmap	= s1d15605_mmap,
-+#endif
-+};
-+
-+
-+static void s1d15605_device_init(struct s1d15605fb_info *sinfo) {
-+
-+	char	value;
-+
-+	/* release the reset line by reading the device - proto hardware */
-+	value = READ_COMMAND;
-+	value = READ_COMMAND;
-+
-+#ifdef CONFIG_MACH_KB9200
-+	/* new boards have dedicated reset line */
-+	gpio_set_value(sinfo->reset_pin, 1);
-+#endif
-+
-+	/* initialize the device within 5ms */
-+	WRITE_COMMAND(RESET_DISPLAY);
-+	WRITE_COMMAND(LCD_BIAS_1_9);
-+	WRITE_COMMAND(ADC_SELECT_REVERSE);
-+	WRITE_COMMAND(COMMON_OUTPUT_NORMAL);
-+	WRITE_COMMAND(V5_RESISTOR_RATIO);
-+	WRITE_COMMAND(ELECTRONIC_VOLUME_SET);
-+	WRITE_COMMAND(ELECTRONIC_VOLUME_INIT);
-+	WRITE_COMMAND(POWER_CONTROL_SET | VOLTAGE_REGULATOR | VOLTAGE_FOLLOWER | BOOSTER_CIRCUIT);
-+	WRITE_COMMAND(DISPLAY_ON);
-+
-+	WRITE_COMMAND(RESISTOR_RATIO_START + 4);
-+	WRITE_COMMAND(ELECTRONIC_VOLUME_SET);
-+	WRITE_COMMAND(0x33);
-+}
-+
-+
-+static int s1d15605fb_probe(struct platform_device *pdev)
-+{
-+	struct device *dev = &pdev->dev;
-+	struct fb_info *info;
-+	struct s1d15605fb_info *sinfo;
-+	int ret;
-+
-+	MSG("%s\n", __func__);
-+
-+	if (!(info = framebuffer_alloc(sizeof(struct s1d15605fb_info), dev))) {
-+		dev_err(dev, "Cannot allocate framebuffer struct\n");
-+		return -ENOMEM;
-+	}
-+
-+	sinfo = info->par;
-+	sinfo->info = info;
-+	sinfo->pdev = pdev;
-+
-+	if (pdev->num_resources < 2) {
-+		dev_err(dev, "Resources unusable\n");
-+		ret = -ENODEV;
-+		goto free_info;
-+	}
-+
-+	info->fbops = &s1d15605fb_ops;
-+	strcpy(info->fix.id, pdev->name);
-+
-+	info->fix.mmio_start = pdev->resource[0].start;
-+	info->fix.mmio_len = pdev->resource[0].end - pdev->resource[0].start + 1;
-+	sinfo->reset_pin = pdev->resource[1].start;
-+
-+	ret = s1d15605fb_resize_framebuffer(sinfo);
-+	if (ret < 0) {
-+		dev_err(dev, "Cannot resize framebuffer: %d\n", ret);
-+		goto free_fb;
-+	}
-+
-+	if (!request_mem_region(info->fix.mmio_start,
-+				info->fix.mmio_len, pdev->name)) {
-+		ret = -EBUSY;
-+		goto free_fb;
-+	}
-+
-+	sinfo->mmio = ioremap(info->fix.mmio_start, info->fix.mmio_len);
-+	if (!sinfo->mmio) {
-+		dev_err(dev, "Cannot map LCD memory region\n");
-+		goto release_mem;
-+	}
-+
-+	s1d15605_device_init(sinfo);
-+
-+	ret = fb_find_mode(&info->var, info, NULL, NULL, 0, NULL, 1);
-+
-+	if (!ret || (ret == 4))
-+		info->var = s1d15605_default;
-+
-+	info->fix = s1d15605_fix;
-+	info->flags = FBINFO_FLAG_DEFAULT |
-+/*		FBINFO_HWACCEL_YPAN | */
-+		FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA;
-+
-+	ret = register_framebuffer(info);
-+	if (ret < 0) {
-+		dev_err(dev, "Failed to register framebuffer device: %d\n", ret);
-+		goto unmap_mmio;
-+	}
-+
-+	dev_set_drvdata(dev, info);
-+
-+	memset(info->screen_base, 0, info->fix.smem_len);
-+	info->var.activate |= FB_ACTIVATE_NOW;
-+	ret = fb_set_var(info, &info->var);
-+	if (ret) {
-+		dev_warn(dev, "Unable to set display parameters\n");
-+	}
-+
-+	info->var.activate &= ~(FB_ACTIVATE_FORCE | FB_ACTIVATE_NOW);
-+
-+	dev_dbg(dev, "%s SUCCESS\n", __func__);
-+
-+	dev_info(dev, "Driver $Revision: 1.1 $\n");
-+
-+	return 0;
-+
-+unmap_mmio:
-+	iounmap(sinfo->mmio);
-+release_mem:
-+	release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
-+free_fb:
-+	kfree(info->screen_base);
-+
-+free_info:
-+	framebuffer_release(info);
-+
-+	dev_dbg(dev, "%s FAILED\n", __func__);
-+	return ret;
-+}
-+
-+
-+static int s1d15605fb_remove(struct platform_device *pdev)
-+{
-+	struct device *dev = &pdev->dev;
-+	struct fb_info *info = dev_get_drvdata(dev);
-+	struct s1d15605fb_info *sinfo = info->par;
-+
-+	if (!sinfo)
-+		return 0;
-+
-+	unregister_framebuffer(info);
-+
-+	iounmap(sinfo->mmio);
-+	release_mem_region(info->fix.mmio_start, info->fix.mmio_len);
-+
-+	kfree(info->screen_base);
-+
-+	dev_set_drvdata(dev, NULL);
-+	framebuffer_release(info);
-+	return 0;
-+}
-+
-+
-+static struct platform_driver s1d15605fb_driver = {
-+	.probe		= s1d15605fb_probe,
-+	.remove		= s1d15605fb_remove,
-+	.driver		= {
-+		.name	= "s1d15605fb",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+
-+static int __init s1d15605fb_init(void)
-+{
-+	return platform_driver_register(&s1d15605fb_driver);
-+}
-+
-+
-+static void __exit s1d15605fb_exit(void)
-+{
-+	platform_driver_unregister(&s1d15605fb_driver);
-+}
-+
-+
-+module_init(s1d15605fb_init);
-+module_exit(s1d15605fb_exit);
-+
-+
-+MODULE_AUTHOR("KwikByte");
-+MODULE_DESCRIPTION("Epson S1D15605 LCD Controller framebuffer driver");
-+MODULE_LICENSE("GPL");
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91_adc.h
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91_adc.h
-@@ -0,0 +1,61 @@
-+/*
-+ * include/asm-arm/arch-at91/at91_adc.h
-+ *
-+ * Copyright (C) SAN People
-+ *
-+ * Analog-to-Digital Converter (ADC) registers.
-+ * Based on AT91SAM9260 datasheet revision D.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ */
-+
-+#ifndef AT91_ADC_H
-+#define AT91_ADC_H
-+
-+#define AT91_ADC_CR		0x00		/* Control Register */
-+#define		AT91_ADC_SWRST		(1 << 0)	/* Software Reset */
-+#define		AT91_ADC_START		(1 << 1)	/* Start Conversion */
-+
-+#define AT91_ADC_MR		0x04		/* Mode Register */
-+#define		AT91_ADC_TRGEN		(1 << 0)	/* Trigger Enable */
-+#define		AT91_ADC_TRGSEL		(7 << 1)	/* Trigger Selection */
-+#define			AT91_ADC_TRGSEL_TC0		(0 << 1)
-+#define			AT91_ADC_TRGSEL_TC1		(1 << 1)
-+#define			AT91_ADC_TRGSEL_TC2		(2 << 1)
-+#define			AT91_ADC_TRGSEL_EXTERNAL	(6 << 1)
-+#define		AT91_ADC_LOWRES		(1 << 4)	/* Low Resolution */
-+#define		AT91_ADC_SLEEP		(1 << 5)	/* Sleep Mode */
-+#define		AT91_ADC_PRESCAL	(0x3f << 8)	/* Prescalar Rate Selection */
-+#define			AT91_ADC_PRESCAL_(x)	((x) << 8)
-+#define		AT91_ADC_STARTUP	(0x1f << 16)	/* Startup Up Time */
-+#define			AT91_ADC_STARTUP_(x)	((x) << 16)
-+#define		AT91_ADC_SHTIM		(0xf  << 24)	/* Sample & Hold Time */
-+#define			AT91_ADC_SHTIM_(x)	((x) << 24)
-+
-+#define AT91_ADC_CHER		0x10		/* Channel Enable Register */
-+#define AT91_ADC_CHDR		0x14		/* Channel Disable Register */
-+#define AT91_ADC_CHSR		0x18		/* Channel Status Register */
-+#define		AT91_ADC_CH(n)		(1 << (n))	/* Channel Number */
-+
-+#define AT91_ADC_SR		0x1C		/* Status Register */
-+#define		AT91_ADC_EOC(n)		(1 << (n))	/* End of Conversion on Channel N */
-+#define		AT91_ADC_OVRE(n)	(1 << ((n) + 8))/* Overrun Error on Channel N */
-+#define		AT91_ADC_DRDY		(1 << 16)	/* Data Ready */
-+#define		AT91_ADC_GOVRE		(1 << 17)	/* General Overrun Error */
-+#define		AT91_ADC_ENDRX		(1 << 18)	/* End of RX Buffer */
-+#define		AT91_ADC_RXFUFF		(1 << 19)	/* RX Buffer Full */
-+
-+#define AT91_ADC_LCDR		0x20		/* Last Converted Data Register */
-+#define		AT91_ADC_LDATA		(0x3ff)
-+
-+#define AT91_ADC_IER		0x24		/* Interrupt Enable Register */
-+#define AT91_ADC_IDR		0x28		/* Interrupt Disable Register */
-+#define AT91_ADC_IMR		0x2C		/* Interrupt Mask Register */
-+
-+#define AT91_ADC_CHR(n)		(0x30 + ((n) * 4)	/* Channel Data Register N */
-+#define		AT91_ADC_DATA		(0x3ff)
-+
-+#endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91_mci.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/at91_mci.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91_mci.h
-@@ -26,6 +26,9 @@
- #define AT91_MCI_MR		0x04		/* Mode Register */
- #define		AT91_MCI_CLKDIV		(0xff  <<  0)	/* Clock Divider */
- #define		AT91_MCI_PWSDIV		(7     <<  8)	/* Power Saving Divider */
-+#define		AT91_MCI_RDPROOF	(1     << 11)	/* Read Proof Enable [SAM926[03] only] */
-+#define		AT91_MCI_WRPROOF	(1     << 12)	/* Write Proof Enable [SAM926[03] only] */
-+#define		AT91_MCI_PDCFBYTE	(1     << 13)	/* PDC Force Byte Transfer [SAM926[03] only] */
- #define		AT91_MCI_PDCPADV	(1     << 14)	/* PDC Padding Value */
- #define		AT91_MCI_PDCMODE	(1     << 15)	/* PDC-orientated Mode */
- #define		AT91_MCI_BLKLEN		(0xfff << 18)	/* Data Block Length */
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91_pmc.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/at91_pmc.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91_pmc.h
-@@ -37,7 +37,9 @@
- #define	AT91_PMC_PCDR		(AT91_PMC + 0x14)	/* Peripheral Clock Disable Register */
- #define	AT91_PMC_PCSR		(AT91_PMC + 0x18)	/* Peripheral Clock Status Register */
- 
--#define	AT91_CKGR_MOR		(AT91_PMC + 0x20)	/* Main Oscillator Register */
-+#define AT91_CKGR_UCKR		(AT91_PMC + 0x1C)	/* UTMI Clock Register [SAM9RL only] */
-+
-+#define	AT91_CKGR_MOR		(AT91_PMC + 0x20)	/* Main Oscillator Register [not on SAM9RL] */
- #define		AT91_PMC_MOSCEN		(1    << 0)		/* Main Oscillator Enable */
- #define		AT91_PMC_OSCBYPASS	(1    << 1)		/* Oscillator Bypass [AT91SAM926x only] */
- #define		AT91_PMC_OSCOUNT	(0xff << 8)		/* Main Oscillator Start-up Time */
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91rm9200.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/at91rm9200.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91rm9200.h
-@@ -107,185 +107,4 @@
- #define AT91RM9200_UHP_BASE	0x00300000	/* USB Host controller */
- 
- 
--#if 0
--/*
-- * PIO pin definitions (peripheral A/B multiplexing).
-- */
--#define AT91_PA0_MISO		(1 <<  0)	/* A: SPI Master-In Slave-Out */
--#define AT91_PA0_PCK3		(1 <<  0)	/* B: PMC Programmable Clock Output 3 */
--#define AT91_PA1_MOSI		(1 <<  1)	/* A: SPI Master-Out Slave-In */
--#define AT91_PA1_PCK0		(1 <<  1)	/* B: PMC Programmable Clock Output 0 */
--#define AT91_PA2_SPCK		(1 <<  2)	/* A: SPI Serial Clock */
--#define AT91_PA2_IRQ4		(1 <<  2)	/* B: External Interrupt 4 */
--#define AT91_PA3_NPCS0		(1 <<  3)	/* A: SPI Peripheral Chip Select 0 */
--#define AT91_PA3_IRQ5		(1 <<  3)	/* B: External Interrupt 5 */
--#define AT91_PA4_NPCS1		(1 <<  4)	/* A: SPI Peripheral Chip Select 1 */
--#define AT91_PA4_PCK1		(1 <<  4)	/* B: PMC Programmable Clock Output 1 */
--#define AT91_PA5_NPCS2		(1 <<  5)	/* A: SPI Peripheral Chip Select 2 */
--#define AT91_PA5_TXD3		(1 <<  5)	/* B: USART Transmit Data 3 */
--#define AT91_PA6_NPCS3		(1 <<  6)	/* A: SPI Peripheral Chip Select 3 */
--#define AT91_PA6_RXD3		(1 <<  6)	/* B: USART Receive Data 3 */
--#define AT91_PA7_ETXCK_EREFCK	(1 <<  7)	/* A: Ethernet Reference Clock / Transmit Clock */
--#define AT91_PA7_PCK2		(1 <<  7)	/* B: PMC Programmable Clock Output 2 */
--#define AT91_PA8_ETXEN		(1 <<  8)	/* A: Ethernet Transmit Enable */
--#define AT91_PA8_MCCDB		(1 <<  8)	/* B: MMC Multimedia Card B Command */
--#define AT91_PA9_ETX0		(1 <<  9)	/* A: Ethernet Transmit Data 0 */
--#define AT91_PA9_MCDB0		(1 <<  9)	/* B: MMC Multimedia Card B Data 0 */
--#define AT91_PA10_ETX1		(1 << 10)	/* A: Ethernet Transmit Data 1 */
--#define AT91_PA10_MCDB1		(1 << 10)	/* B: MMC Multimedia Card B Data 1 */
--#define AT91_PA11_ECRS_ECRSDV	(1 << 11)	/* A: Ethernet Carrier Sense / Data Valid */
--#define AT91_PA11_MCDB2		(1 << 11)	/* B: MMC Multimedia Card B Data 2 */
--#define AT91_PA12_ERX0		(1 << 12)	/* A: Ethernet Receive Data 0 */
--#define AT91_PA12_MCDB3		(1 << 12)	/* B: MMC Multimedia Card B Data 3 */
--#define AT91_PA13_ERX1		(1 << 13)	/* A: Ethernet Receive Data 1 */
--#define AT91_PA13_TCLK0		(1 << 13)	/* B: TC External Clock Input 0 */
--#define AT91_PA14_ERXER		(1 << 14)	/* A: Ethernet Receive Error */
--#define AT91_PA14_TCLK1		(1 << 14)	/* B: TC External Clock Input 1 */
--#define AT91_PA15_EMDC		(1 << 15)	/* A: Ethernet Management Data Clock */
--#define AT91_PA15_TCLK2		(1 << 15)	/* B: TC External Clock Input 2 */
--#define AT91_PA16_EMDIO		(1 << 16)	/* A: Ethernet Management Data I/O */
--#define AT91_PA16_IRQ6		(1 << 16)	/* B: External Interrupt 6 */
--#define AT91_PA17_TXD0		(1 << 17)	/* A: USART Transmit Data 0 */
--#define AT91_PA17_TIOA0		(1 << 17)	/* B: TC I/O Line A 0 */
--#define AT91_PA18_RXD0		(1 << 18)	/* A: USART Receive Data 0 */
--#define AT91_PA18_TIOB0		(1 << 18)	/* B: TC I/O Line B 0 */
--#define AT91_PA19_SCK0		(1 << 19)	/* A: USART Serial Clock 0 */
--#define AT91_PA19_TIOA1		(1 << 19)	/* B: TC I/O Line A 1 */
--#define AT91_PA20_CTS0		(1 << 20)	/* A: USART Clear To Send 0 */
--#define AT91_PA20_TIOB1		(1 << 20)	/* B: TC I/O Line B 1 */
--#define AT91_PA21_RTS0		(1 << 21)	/* A: USART Ready To Send 0 */
--#define AT91_PA21_TIOA2		(1 << 21)	/* B: TC I/O Line A 2 */
--#define AT91_PA22_RXD2		(1 << 22)	/* A: USART Receive Data 2 */
--#define AT91_PA22_TIOB2		(1 << 22)	/* B: TC I/O Line B 2 */
--#define AT91_PA23_TXD2		(1 << 23)	/* A: USART Transmit Data 2 */
--#define AT91_PA23_IRQ3		(1 << 23)	/* B: External Interrupt 3 */
--#define AT91_PA24_SCK2		(1 << 24)	/* A: USART Serial Clock 2 */
--#define AT91_PA24_PCK1		(1 << 24)	/* B: PMC Programmable Clock Output 1 */
--#define AT91_PA25_TWD		(1 << 25)	/* A: TWI Two-wire Serial Data */
--#define AT91_PA25_IRQ2		(1 << 25)	/* B: External Interrupt 2 */
--#define AT91_PA26_TWCK		(1 << 26)	/* A: TWI Two-wire Serial Clock */
--#define AT91_PA26_IRQ1		(1 << 26)	/* B: External Interrupt 1 */
--#define AT91_PA27_MCCK		(1 << 27)	/* A: MMC Multimedia Card Clock */
--#define AT91_PA27_TCLK3		(1 << 27)	/* B: TC External Clock Input 3 */
--#define AT91_PA28_MCCDA		(1 << 28)	/* A: MMC Multimedia Card A Command */
--#define AT91_PA28_TCLK4		(1 << 28)	/* B: TC External Clock Input 4 */
--#define AT91_PA29_MCDA0		(1 << 29)	/* A: MMC Multimedia Card A Data 0 */
--#define AT91_PA29_TCLK5		(1 << 29)	/* B: TC External Clock Input 5 */
--#define AT91_PA30_DRXD		(1 << 30)	/* A: DBGU Receive Data */
--#define AT91_PA30_CTS2		(1 << 30)	/* B: USART Clear To Send 2 */
--#define AT91_PA31_DTXD		(1 << 31)	/* A: DBGU Transmit Data */
--#define AT91_PA31_RTS2		(1 << 31)	/* B: USART Ready To Send 2 */
--
--#define AT91_PB0_TF0		(1 <<  0)	/* A: SSC Transmit Frame Sync 0 */
--#define AT91_PB0_RTS3		(1 <<  0)	/* B: USART Ready To Send 3 */
--#define AT91_PB1_TK0		(1 <<  1)	/* A: SSC Transmit Clock 0 */
--#define AT91_PB1_CTS3		(1 <<  1)	/* B: USART Clear To Send 3 */
--#define AT91_PB2_TD0		(1 <<  2)	/* A: SSC Transmit Data 0 */
--#define AT91_PB2_SCK3		(1 <<  2)	/* B: USART Serial Clock 3 */
--#define AT91_PB3_RD0		(1 <<  3)	/* A: SSC Receive Data 0 */
--#define AT91_PB3_MCDA1		(1 <<  3)	/* B: MMC Multimedia Card A Data 1 */
--#define AT91_PB4_RK0		(1 <<  4)	/* A: SSC Receive Clock 0 */
--#define AT91_PB4_MCDA2		(1 <<  4)	/* B: MMC Multimedia Card A Data 2 */
--#define AT91_PB5_RF0		(1 <<  5)	/* A: SSC Receive Frame Sync 0 */
--#define AT91_PB5_MCDA3		(1 <<  5)	/* B: MMC Multimedia Card A Data 3 */
--#define AT91_PB6_TF1		(1 <<  6)	/* A: SSC Transmit Frame Sync 1 */
--#define AT91_PB6_TIOA3		(1 <<  6)	/* B: TC I/O Line A 3 */
--#define AT91_PB7_TK1		(1 <<  7)	/* A: SSC Transmit Clock 1 */
--#define AT91_PB7_TIOB3		(1 <<  7)	/* B: TC I/O Line B 3 */
--#define AT91_PB8_TD1		(1 <<  8)	/* A: SSC Transmit Data 1 */
--#define AT91_PB8_TIOA4		(1 <<  8)	/* B: TC I/O Line A 4 */
--#define AT91_PB9_RD1		(1 <<  9)	/* A: SSC Receive Data 1 */
--#define AT91_PB9_TIOB4		(1 <<  9)	/* B: TC I/O Line B 4 */
--#define AT91_PB10_RK1		(1 << 10)	/* A: SSC Receive Clock 1 */
--#define AT91_PB10_TIOA5		(1 << 10)	/* B: TC I/O Line A 5 */
--#define AT91_PB11_RF1		(1 << 11)	/* A: SSC Receive Frame Sync 1 */
--#define AT91_PB11_TIOB5		(1 << 11)	/* B: TC I/O Line B 5 */
--#define AT91_PB12_TF2		(1 << 12)	/* A: SSC Transmit Frame Sync 2 */
--#define AT91_PB12_ETX2		(1 << 12)	/* B: Ethernet Transmit Data 2 */
--#define AT91_PB13_TK2		(1 << 13)	/* A: SSC Transmit Clock 3 */
--#define AT91_PB13_ETX3		(1 << 13)	/* B: Ethernet Transmit Data 3 */
--#define AT91_PB14_TD2		(1 << 14)	/* A: SSC Transmit Data 2 */
--#define AT91_PB14_ETXER		(1 << 14)	/* B: Ethernet Transmit Coding Error */
--#define AT91_PB15_RD2		(1 << 15)	/* A: SSC Receive Data 2 */
--#define AT91_PB15_ERX2		(1 << 15)	/* B: Ethernet Receive Data 2 */
--#define AT91_PB16_RK2		(1 << 16)	/* A: SSC Receive Clock 2 */
--#define AT91_PB16_ERX3		(1 << 16)	/* B: Ethernet Receive Data 3 */
--#define AT91_PB17_RF2		(1 << 17)	/* A: SSC Receive Frame Sync 2 */
--#define AT91_PB17_ERXDV		(1 << 17)	/* B: Ethernet Receive Data Valid */
--#define AT91_PB18_RI1		(1 << 18)	/* A: USART Ring Indicator 1 */
--#define AT91_PB18_ECOL		(1 << 18)	/* B: Ethernet Collision Detected */
--#define AT91_PB19_DTR1		(1 << 19)	/* A: USART Data Terminal Ready 1 */
--#define AT91_PB19_ERXCK		(1 << 19)	/* B: Ethernet Receive Clock */
--#define AT91_PB20_TXD1		(1 << 20)	/* A: USART Transmit Data 1 */
--#define AT91_PB21_RXD1		(1 << 21)	/* A: USART Receive Data 1 */
--#define AT91_PB22_SCK1		(1 << 22)	/* A: USART Serial Clock 1 */
--#define AT91_PB23_DCD1		(1 << 23)	/* A: USART Data Carrier Detect 1 */
--#define AT91_PB24_CTS1		(1 << 24)	/* A: USART Clear To Send 1 */
--#define AT91_PB25_DSR1		(1 << 25)	/* A: USART Data Set Ready 1 */
--#define AT91_PB25_EF100		(1 << 25)	/* B: Ethernet Force 100 Mbit */
--#define AT91_PB26_RTS1		(1 << 26)	/* A: USART Ready To Send 1 */
--#define AT91_PB27_PCK0		(1 << 27)	/* B: PMC Programmable Clock Output 0 */
--#define AT91_PB28_FIQ		(1 << 28)	/* A: Fast Interrupt */
--#define AT91_PB29_IRQ0		(1 << 29)	/* A: External Interrupt 0 */
--
--#define AT91_PC0_BFCK		(1 <<  0)	/* A: Burst Flash Clock */
--#define AT91_PC1_BFRDY_SMOE	(1 <<  1)	/* A: Burst Flash Ready / SmartMedia Output Enable */
--#define AT91_PC2_BFAVD		(1 <<  2)	/* A: Burst Flash Address Valid */
--#define AT91_PC3_BFBAA_SMWE	(1 <<  3)	/* A: Burst Flash Address Advance / SmartMedia Write Enable */
--#define AT91_PC4_BFOE		(1 <<  4)	/* A: Burst Flash Output Enable */
--#define AT91_PC5_BFWE		(1 <<  5)	/* A: Burst Flash Write Enable */
--#define AT91_PC6_NWAIT		(1 <<  6)	/* A: SMC Wait Signal */
--#define AT91_PC7_A23		(1 <<  7)	/* A: Address Bus 23 */
--#define AT91_PC8_A24		(1 <<  8)	/* A: Address Bus 24 */
--#define AT91_PC9_A25_CFRNW	(1 <<  9)	/* A: Address Bus 25 / Compact Flash Read Not Write */
--#define AT91_PC10_NCS4_CFCS	(1 << 10)	/* A: SMC Chip Select 4 / Compact Flash Chip Select */
--#define AT91_PC11_NCS5_CFCE1	(1 << 11)	/* A: SMC Chip Select 5 / Compact Flash Chip Enable 1 */
--#define AT91_PC12_NCS6_CFCE2	(1 << 12)	/* A: SMC Chip Select 6 / Compact Flash Chip Enable 2 */
--#define AT91_PC13_NCS7		(1 << 13)	/* A: Chip Select 7 */
--
--#define AT91_PD0_ETX0		(1 <<  0)	/* A: Ethernet Transmit Data 0 */
--#define AT91_PD1_ETX1		(1 <<  1)	/* A: Ethernet Transmit Data 1 */
--#define AT91_PD2_ETX2		(1 <<  2)	/* A: Ethernet Transmit Data 2 */
--#define AT91_PD3_ETX3		(1 <<  3)	/* A: Ethernet Transmit Data 3 */
--#define AT91_PD4_ETXEN		(1 <<  4)	/* A: Ethernet Transmit Enable */
--#define AT91_PD5_ETXER		(1 <<  5)	/* A: Ethernet Transmit Coding Error */
--#define AT91_PD6_DTXD		(1 <<  6)	/* A: DBGU Transmit Data */
--#define AT91_PD7_PCK0		(1 <<  7)	/* A: PMC Programmable Clock Output 0 */
--#define AT91_PD7_TSYNC		(1 <<  7)	/* B: ETM Trace Synchronization Signal */
--#define AT91_PD8_PCK1		(1 <<  8)	/* A: PMC Programmable Clock Output 1 */
--#define AT91_PD8_TCLK		(1 <<  8)	/* B: ETM Trace Clock */
--#define AT91_PD9_PCK2		(1 <<  9)	/* A: PMC Programmable Clock Output 2 */
--#define AT91_PD9_TPS0		(1 <<  9)	/* B: ETM Trace ARM Pipeline Status 0 */
--#define AT91_PD10_PCK3		(1 << 10)	/* A: PMC Programmable Clock Output 3 */
--#define AT91_PD10_TPS1		(1 << 10)	/* B: ETM Trace ARM Pipeline Status 1 */
--#define AT91_PD11_TPS2		(1 << 11)	/* B: ETM Trace ARM Pipeline Status 2 */
--#define AT91_PD12_TPK0		(1 << 12)	/* B: ETM Trace Packet Port 0 */
--#define AT91_PD13_TPK1		(1 << 13)	/* B: ETM Trace Packet Port 1 */
--#define AT91_PD14_TPK2		(1 << 14)	/* B: ETM Trace Packet Port 2 */
--#define AT91_PD15_TD0		(1 << 15)	/* A: SSC Transmit Data 0 */
--#define AT91_PD15_TPK3		(1 << 15)	/* B: ETM Trace Packet Port 3 */
--#define AT91_PD16_TD1		(1 << 16)	/* A: SSC Transmit Data 1 */
--#define AT91_PD16_TPK4		(1 << 16)	/* B: ETM Trace Packet Port 4 */
--#define AT91_PD17_TD2		(1 << 17)	/* A: SSC Transmit Data 2 */
--#define AT91_PD17_TPK5		(1 << 17)	/* B: ETM Trace Packet Port 5 */
--#define AT91_PD18_NPCS1		(1 << 18)	/* A: SPI Peripheral Chip Select 1 */
--#define AT91_PD18_TPK6		(1 << 18)	/* B: ETM Trace Packet Port 6 */
--#define AT91_PD19_NPCS2		(1 << 19)	/* A: SPI Peripheral Chip Select 2 */
--#define AT91_PD19_TPK7		(1 << 19)	/* B: ETM Trace Packet Port 7 */
--#define AT91_PD20_NPCS3		(1 << 20)	/* A: SPI Peripheral Chip Select 3 */
--#define AT91_PD20_TPK8		(1 << 20)	/* B: ETM Trace Packet Port 8 */
--#define AT91_PD21_RTS0		(1 << 21)	/* A: USART Ready To Send 0 */
--#define AT91_PD21_TPK9		(1 << 21)	/* B: ETM Trace Packet Port 9 */
--#define AT91_PD22_RTS1		(1 << 22)	/* A: USART Ready To Send 1 */
--#define AT91_PD22_TPK10		(1 << 22)	/* B: ETM Trace Packet Port 10 */
--#define AT91_PD23_RTS2		(1 << 23)	/* A: USART Ready To Send 2 */
--#define AT91_PD23_TPK11		(1 << 23)	/* B: ETM Trace Packet Port 11 */
--#define AT91_PD24_RTS3		(1 << 24)	/* A: USART Ready To Send 3 */
--#define AT91_PD24_TPK12		(1 << 24)	/* B: ETM Trace Packet Port 12 */
--#define AT91_PD25_DTR1		(1 << 25)	/* A: USART Data Terminal Ready 1 */
--#define AT91_PD25_TPK13		(1 << 25)	/* B: ETM Trace Packet Port 13 */
--#define AT91_PD26_TPK14		(1 << 26)	/* B: ETM Trace Packet Port 14 */
--#define AT91_PD27_TPK15		(1 << 27)	/* B: ETM Trace Packet Port 15 */
--#endif
--
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9260.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/at91sam9260.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9260.h
-@@ -117,13 +117,4 @@
- #define AT91SAM9XE_SRAM_BASE	0x00300000	/* Internal SRAM base address */
- 
- 
--#if 0
--/*
-- * PIO pin definitions (peripheral A/B multiplexing).
-- */
--
--// TODO: Add
--
--#endif
--
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9260_matrix.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/at91sam9260_matrix.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9260_matrix.h
-@@ -67,7 +67,7 @@
- #define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
- #define			AT91_MATRIX_CS4A_SMC		(0 << 4)
- #define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
--#define		AT91_MATRIX_CS5A		(1 << 5 )	/* Chip Select 5 Assignment */
-+#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
- #define			AT91_MATRIX_CS5A_SMC		(0 << 5)
- #define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
- #define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9261.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/at91sam9261.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9261.h
-@@ -98,195 +98,4 @@
- #define AT91SAM9261_LCDC_BASE	0x00600000	/* LDC controller */
- 
- 
--#if 0
--/*
-- * PIO pin definitions (peripheral A/B multiplexing).
-- */
--#define AT91_PA0_SPI0_MISO	(1 <<  0)	/* A: SPI0 Master In Slave */
--#define AT91_PA0_MCDA0		(1 <<  0)	/* B: Multimedia Card A Data 0 */
--#define AT91_PA1_SPI0_MOSI	(1 <<  1)	/* A: SPI0 Master Out Slave */
--#define AT91_PA1_MCCDA		(1 <<  1)	/* B: Multimedia Card A Command */
--#define AT91_PA2_SPI0_SPCK	(1 <<  2)	/* A: SPI0 Serial Clock */
--#define AT91_PA2_MCCK		(1 <<  2)	/* B: Multimedia Card Clock */
--#define AT91_PA3_SPI0_NPCS0	(1 <<  3)	/* A: SPI0 Peripheral Chip Select 0 */
--#define AT91_PA4_SPI0_NPCS1	(1 <<  4)	/* A: SPI0 Peripheral Chip Select 1 */
--#define AT91_PA4_MCDA1		(1 <<  4)	/* B: Multimedia Card A Data 1 */
--#define AT91_PA5_SPI0_NPCS2	(1 <<  5)	/* A: SPI0 Peripheral Chip Select 2 */
--#define AT91_PA5_MCDA2		(1 <<  5)	/* B: Multimedia Card A Data 2 */
--#define AT91_PA6_SPI0_NPCS3	(1 <<  6)	/* A: SPI0 Peripheral Chip Select 3 */
--#define AT91_PA6_MCDA3		(1 <<  6)	/* B: Multimedia Card A Data 3 */
--#define AT91_PA7_TWD		(1 <<  7)	/* A: TWI Two-wire Serial Data */
--#define AT91_PA7_PCK0		(1 <<  7)	/* B: PMC Programmable clock Output 0 */
--#define AT91_PA8_TWCK		(1 <<  8)	/* A: TWI Two-wire Serial Clock */
--#define AT91_PA8_PCK1		(1 <<  8)	/* B: PMC Programmable clock Output 1 */
--#define AT91_PA9_DRXD		(1 <<  9)	/* A: DBGU Debug Receive Data */
--#define AT91_PA9_PCK2		(1 <<  9)	/* B: PMC Programmable clock Output 2 */
--#define AT91_PA10_DTXD		(1 << 10)	/* A: DBGU Debug Transmit Data */
--#define AT91_PA10_PCK3		(1 << 10)	/* B: PMC Programmable clock Output 3 */
--#define AT91_PA11_TSYNC		(1 << 11)	/* A: Trace Synchronization Signal */
--#define AT91_PA11_SCK1		(1 << 11)	/* B: USART1 Serial Clock */
--#define AT91_PA12_TCLK		(1 << 12)	/* A: Trace Clock */
--#define AT91_PA12_RTS1		(1 << 12)	/* B: USART1 Ready To Send */
--#define AT91_PA13_TPS0		(1 << 13)	/* A: Trace ARM Pipeline Status 0 */
--#define AT91_PA13_CTS1		(1 << 13)	/* B: USART1 Clear To Send */
--#define AT91_PA14_TPS1		(1 << 14)	/* A: Trace ARM Pipeline Status 1 */
--#define AT91_PA14_SCK2		(1 << 14)	/* B: USART2 Serial Clock */
--#define AT91_PA15_TPS2		(1 << 15)	/* A: Trace ARM Pipeline Status 2 */
--#define AT91_PA15_RTS2		(1 << 15)	/* B: USART2 Ready To Send */
--#define AT91_PA16_TPK0		(1 << 16)	/* A: Trace Packet Port 0 */
--#define AT91_PA16_CTS2		(1 << 16)	/* B: USART2 Clear To Send */
--#define AT91_PA17_TPK1		(1 << 17)	/* A: Trace Packet Port 1 */
--#define AT91_PA17_TF1		(1 << 17)	/* B: SSC1 Transmit Frame Sync */
--#define AT91_PA18_TPK2		(1 << 18)	/* A: Trace Packet Port 2 */
--#define AT91_PA18_TK1		(1 << 18)	/* B: SSC1 Transmit Clock */
--#define AT91_PA19_TPK3		(1 << 19)	/* A: Trace Packet Port 3 */
--#define AT91_PA19_TD1		(1 << 19)	/* B: SSC1 Transmit Data */
--#define AT91_PA20_TPK4		(1 << 20)	/* A: Trace Packet Port 4 */
--#define AT91_PA20_RD1		(1 << 20)	/* B: SSC1 Receive Data */
--#define AT91_PA21_TPK5		(1 << 21)	/* A: Trace Packet Port 5 */
--#define AT91_PA21_RK1		(1 << 21)	/* B: SSC1 Receive Clock */
--#define AT91_PA22_TPK6		(1 << 22)	/* A: Trace Packet Port 6 */
--#define AT91_PA22_RF1		(1 << 22)	/* B: SSC1 Receive Frame Sync */
--#define AT91_PA23_TPK7		(1 << 23)	/* A: Trace Packet Port 7 */
--#define AT91_PA23_RTS0		(1 << 23)	/* B: USART0 Ready To Send */
--#define AT91_PA24_TPK8		(1 << 24)	/* A: Trace Packet Port 8 */
--#define AT91_PA24_SPI1_NPCS1	(1 << 24)	/* B: SPI1 Peripheral Chip Select 1 */
--#define AT91_PA25_TPK9		(1 << 25)	/* A: Trace Packet Port 9 */
--#define AT91_PA25_SPI1_NPCS2	(1 << 25)	/* B: SPI1 Peripheral Chip Select 2 */
--#define AT91_PA26_TPK10		(1 << 26)	/* A: Trace Packet Port 10 */
--#define AT91_PA26_SPI1_NPCS3	(1 << 26)	/* B: SPI1 Peripheral Chip Select 3 */
--#define AT91_PA27_TPK11		(1 << 27)	/* A: Trace Packet Port 11 */
--#define AT91_PA27_SPI0_NPCS1	(1 << 27)	/* B: SPI0 Peripheral Chip Select 1 */
--#define AT91_PA28_TPK12		(1 << 28)	/* A: Trace Packet Port 12 */
--#define AT91_PA28_SPI0_NPCS2	(1 << 28)	/* B: SPI0 Peripheral Chip Select 2 */
--#define AT91_PA29_TPK13		(1 << 29)	/* A: Trace Packet Port 13 */
--#define AT91_PA29_SPI0_NPCS3	(1 << 29)	/* B: SPI0 Peripheral Chip Select 3 */
--#define AT91_PA30_TPK14		(1 << 30)	/* A: Trace Packet Port 14 */
--#define AT91_PA30_A23		(1 << 30)	/* B: Address Bus bit 23 */
--#define AT91_PA31_TPK15		(1 << 31)	/* A: Trace Packet Port 15 */
--#define AT91_PA31_A24		(1 << 31)	/* B: Address Bus bit 24 */
--
--#define AT91_PB0_LCDVSYNC	(1 <<  0)	/* A: LCD Vertical Synchronization */
--#define AT91_PB1_LCDHSYNC	(1 <<  1)	/* A: LCD Horizontal Synchronization */
--#define AT91_PB2_LCDDOTCK	(1 <<  2)	/* A: LCD Dot Clock */
--#define AT91_PB2_PCK0		(1 <<  2)	/* B: PMC Programmable clock Output 0 */
--#define AT91_PB3_LCDDEN		(1 <<  3)	/* A: LCD Data Enable */
--#define AT91_PB4_LCDCC		(1 <<  4)	/* A: LCD Contrast Control */
--#define AT91_PB4_LCDD2		(1 <<  4)	/* B: LCD Data Bus Bit 2 */
--#define AT91_PB5_LCDD0		(1 <<  5)	/* A: LCD Data Bus Bit 0 */
--#define AT91_PB5_LCDD3		(1 <<  5)	/* B: LCD Data Bus Bit 3 */
--#define AT91_PB6_LCDD1		(1 <<  6)	/* A: LCD Data Bus Bit 1 */
--#define AT91_PB6_LCDD4		(1 <<  6)	/* B: LCD Data Bus Bit 4 */
--#define AT91_PB7_LCDD2		(1 <<  7)	/* A: LCD Data Bus Bit 2 */
--#define AT91_PB7_LCDD5		(1 <<  7)	/* B: LCD Data Bus Bit 5 */
--#define AT91_PB8_LCDD3		(1 <<  8)	/* A: LCD Data Bus Bit 3 */
--#define AT91_PB8_LCDD6		(1 <<  8)	/* B: LCD Data Bus Bit 6 */
--#define AT91_PB9_LCDD4		(1 <<  9)	/* A: LCD Data Bus Bit 4 */
--#define AT91_PB9_LCDD7		(1 <<  9)	/* B: LCD Data Bus Bit 7 */
--#define AT91_PB10_LCDD5		(1 << 10)	/* A: LCD Data Bus Bit 5 */
--#define AT91_PB10_LCDD10	(1 << 10)	/* B: LCD Data Bus Bit 10 */
--#define AT91_PB11_LCDD6		(1 << 11)	/* A: LCD Data Bus Bit 6 */
--#define AT91_PB11_LCDD11	(1 << 11)	/* B: LCD Data Bus Bit 11 */
--#define AT91_PB12_LCDD7		(1 << 12)	/* A: LCD Data Bus Bit 7 */
--#define AT91_PB12_LCDD12	(1 << 12)	/* B: LCD Data Bus Bit 12 */
--#define AT91_PB13_LCDD8		(1 << 13)	/* A: LCD Data Bus Bit 8 */
--#define AT91_PB13_LCDD13	(1 << 13)	/* B: LCD Data Bus Bit 13 */
--#define AT91_PB14_LCDD9		(1 << 14)	/* A: LCD Data Bus Bit 9 */
--#define AT91_PB14_LCDD14	(1 << 14)	/* B: LCD Data Bus Bit 14 */
--#define AT91_PB15_LCDD10	(1 << 15)	/* A: LCD Data Bus Bit 10 */
--#define AT91_PB15_LCDD15	(1 << 15)	/* B: LCD Data Bus Bit 15 */
--#define AT91_PB16_LCDD11	(1 << 16)	/* A: LCD Data Bus Bit 11 */
--#define AT91_PB16_LCDD19	(1 << 16)	/* B: LCD Data Bus Bit 19 */
--#define AT91_PB17_LCDD12	(1 << 17)	/* A: LCD Data Bus Bit 12 */
--#define AT91_PB17_LCDD20	(1 << 17)	/* B: LCD Data Bus Bit 20 */
--#define AT91_PB18_LCDD13	(1 << 18)	/* A: LCD Data Bus Bit 13 */
--#define AT91_PB18_LCDD21	(1 << 18)	/* B: LCD Data Bus Bit 21 */
--#define AT91_PB19_LCDD14	(1 << 19)	/* A: LCD Data Bus Bit 14 */
--#define AT91_PB19_LCDD22	(1 << 19)	/* B: LCD Data Bus Bit 22 */
--#define AT91_PB20_LCDD15	(1 << 20)	/* A: LCD Data Bus Bit 15 */
--#define AT91_PB20_LCDD23	(1 << 20)	/* B: LCD Data Bus Bit 23 */
--#define AT91_PB21_TF0		(1 << 21)	/* A: SSC0 Transmit Frame Sync */
--#define AT91_PB21_LCDD16	(1 << 21)	/* B: LCD Data Bus Bit 16 */
--#define AT91_PB22_TK0		(1 << 22)	/* A: SSC0 Transmit Clock */
--#define AT91_PB22_LCDD17	(1 << 22)	/* B: LCD Data Bus Bit 17 */
--#define AT91_PB23_TD0		(1 << 23)	/* A: SSC0 Transmit Data */
--#define AT91_PB23_LCDD18	(1 << 23)	/* B: LCD Data Bus Bit 18 */
--#define AT91_PB24_RD0		(1 << 24)	/* A: SSC0 Receive Data */
--#define AT91_PB24_LCDD19	(1 << 24)	/* B: LCD Data Bus Bit 19 */
--#define AT91_PB25_RK0		(1 << 25)	/* A: SSC0 Receive Clock */
--#define AT91_PB25_LCDD20	(1 << 25)	/* B: LCD Data Bus Bit 20 */
--#define AT91_PB26_RF0		(1 << 26)	/* A: SSC0 Receive Frame Sync */
--#define AT91_PB26_LCDD21	(1 << 26)	/* B: LCD Data Bus Bit 21 */
--#define AT91_PB27_SPI1_NPCS1	(1 << 27)	/* A: SPI1 Peripheral Chip Select 1 */
--#define AT91_PB27_LCDD22	(1 << 27)	/* B: LCD Data Bus Bit 22 */
--#define AT91_PB28_SPI1_NPCS0	(1 << 28)	/* A: SPI1 Peripheral Chip Select 0 */
--#define AT91_PB28_LCDD23	(1 << 28)	/* B: LCD Data Bus Bit 23 */
--#define AT91_PB29_SPI1_SPCK	(1 << 29)	/* A: SPI1 Serial Clock */
--#define AT91_PB29_IRQ2		(1 << 29)	/* B: Interrupt input 2 */
--#define AT91_PB30_SPI1_MISO	(1 << 30)	/* A: SPI1 Master In Slave */
--#define AT91_PB30_IRQ1		(1 << 30)	/* B: Interrupt input 1 */
--#define AT91_PB31_SPI1_MOSI	(1 << 31)	/* A: SPI1 Master Out Slave */
--#define AT91_PB31_PCK2		(1 << 31)	/* B: PMC Programmable clock Output 2 */
--
--#define AT91_PC0_SMOE		(1 << 0)	/* A: SmartMedia Output Enable */
--#define AT91_PC0_NCS6		(1 << 0)	/* B: Chip Select 6 */
--#define AT91_PC1_SMWE		(1 << 1)	/* A: SmartMedia Write Enable */
--#define AT91_PC1_NCS7		(1 << 1)	/* B: Chip Select 7 */
--#define AT91_PC2_NWAIT		(1 << 2)	/* A: NWAIT */
--#define AT91_PC2_IRQ0		(1 << 2)	/* B: Interrupt input 0 */
--#define AT91_PC3_A25_CFRNW	(1 << 3)	/* A: Address Bus[25] / Compact Flash Read Not Write */
--#define AT91_PC4_NCS4_CFCS0	(1 << 4)	/* A: Chip Select 4 / CompactFlash Chip Select 0 */
--#define AT91_PC5_NCS5_CFCS1	(1 << 5)	/* A: Chip Select 5 / CompactFlash Chip Select 1 */
--#define AT91_PC6_CFCE1		(1 << 6)	/* A: CompactFlash Chip Enable 1 */
--#define AT91_PC7_CFCE2		(1 << 7)	/* A: CompactFlash Chip Enable 2 */
--#define AT91_PC8_TXD0		(1 << 8)	/* A: USART0 Transmit Data */
--#define AT91_PC8_PCK2		(1 << 8)	/* B: PMC Programmable clock Output 2 */
--#define AT91_PC9_RXD0		(1 << 9)	/* A: USART0 Receive Data */
--#define AT91_PC9_PCK3		(1 << 9)	/* B: PMC Programmable clock Output 3 */
--#define AT91_PC10_RTS0		(1 << 10)	/* A: USART0 Ready To Send */
--#define AT91_PC10_SCK0		(1 << 10)	/* B: USART0 Serial Clock */
--#define AT91_PC11_CTS0		(1 << 11)	/* A: USART0 Clear To Send */
--#define AT91_PC11_FIQ		(1 << 11)	/* B: AIC Fast Interrupt Input */
--#define AT91_PC12_TXD1		(1 << 12)	/* A: USART1 Transmit Data */
--#define AT91_PC12_NCS6		(1 << 12)	/* B: Chip Select 6 */
--#define AT91_PC13_RXD1		(1 << 13)	/* A: USART1 Receive Data */
--#define AT91_PC13_NCS7		(1 << 13)	/* B: Chip Select 7 */
--#define AT91_PC14_TXD2		(1 << 14)	/* A: USART2 Transmit Data */
--#define AT91_PC14_SPI1_NPCS2	(1 << 14)	/* B: SPI1 Peripheral Chip Select 2 */
--#define AT91_PC15_RXD2		(1 << 15)	/* A: USART2 Receive Data */
--#define AT91_PC15_SPI1_NPCS3	(1 << 15)	/* B: SPI1 Peripheral Chip Select 3 */
--#define AT91_PC16_D16		(1 << 16)	/* A: Data Bus [16] */
--#define AT91_PC16_TCLK0		(1 << 16)	/* B: Timer Counter 0 external clock input */
--#define AT91_PC17_D17		(1 << 17)	/* A: Data Bus [17] */
--#define AT91_PC17_TCLK1		(1 << 17)	/* B: Timer Counter 1 external clock input */
--#define AT91_PC18_D18		(1 << 18)	/* A: Data Bus [18] */
--#define AT91_PC18_TCLK2		(1 << 18)	/* B: Timer Counter 2 external clock input */
--#define AT91_PC19_D19		(1 << 19)	/* A: Data Bus [19] */
--#define AT91_PC19_TIOA0		(1 << 19)	/* B: Timer Counter 0 Multipurpose Timer I/O Pin A */
--#define AT91_PC20_D20		(1 << 20)	/* A: Data Bus [20] */
--#define AT91_PC20_TIOB0		(1 << 20)	/* B: Timer Counter 0 Multipurpose Timer I/O Pin B */
--#define AT91_PC21_D21		(1 << 21)	/* A: Data Bus [21] */
--#define AT91_PC21_TIOA1		(1 << 21)	/* B: Timer Counter 1 Multipurpose Timer I/O Pin A */
--#define AT91_PC22_D22		(1 << 22)	/* A: Data Bus [22] */
--#define AT91_PC22_TIOB1		(1 << 22)	/* B: Timer Counter 1 Multipurpose Timer I/O Pin B */
--#define AT91_PC23_D23		(1 << 23)	/* A: Data Bus [23] */
--#define AT91_PC23_TIOA2		(1 << 23)	/* B: Timer Counter 2 Multipurpose Timer I/O Pin A */
--#define AT91_PC24_D24		(1 << 24)	/* A: Data Bus [24] */
--#define AT91_PC24_TIOB2		(1 << 24)	/* B: Timer Counter 2 Multipurpose Timer I/O Pin B */
--#define AT91_PC25_D25		(1 << 25)	/* A: Data Bus [25] */
--#define AT91_PC25_TF2		(1 << 25)	/* B: SSC2 Transmit Frame Sync */
--#define AT91_PC26_D26		(1 << 26)	/* A: Data Bus [26] */
--#define AT91_PC26_TK2		(1 << 26)	/* B: SSC2 Transmit Clock */
--#define AT91_PC27_D27		(1 << 27)	/* A: Data Bus [27] */
--#define AT91_PC27_TD2		(1 << 27)	/* B: SSC2 Transmit Data */
--#define AT91_PC28_D28		(1 << 28)	/* A: Data Bus [28] */
--#define AT91_PC28_RD2		(1 << 28)	/* B: SSC2 Receive Data */
--#define AT91_PC29_D29		(1 << 29)	/* A: Data Bus [29] */
--#define AT91_PC29_RK2		(1 << 29)	/* B: SSC2 Receive Clock */
--#define AT91_PC30_D30		(1 << 30)	/* A: Data Bus [30] */
--#define AT91_PC30_RF2		(1 << 30)	/* B: SSC2 Receive Frame Sync */
--#define AT91_PC31_D31		(1 << 31)	/* A: Data Bus [31] */
--#define AT91_PC31_PCK1		(1 << 31)	/* B: PMC Programmable clock Output 1 */
--#endif
--
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9263.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/at91sam9263.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9263.h
-@@ -119,13 +119,5 @@
- #define AT91SAM9263_DMAC_BASE	0x00800000	/* DMA Controller */
- #define AT91SAM9263_UHP_BASE	0x00a00000	/* USB Host controller */
- 
--#if 0
--/*
-- * PIO pin definitions (peripheral A/B multiplexing).
-- */
--
--// TODO: Add
--
--#endif
- 
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9rl.h
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9rl.h
-@@ -0,0 +1,110 @@
-+/*
-+ * include/asm-arm/arch-at91/at91sam9260.h
-+ *
-+ *  Copyright (C) 2007 Atmel Corporation
-+ *
-+ * Common definitions.
-+ * Based on AT91SAM9RL datasheet revision A. (Preliminary)
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file COPYING in the main directory of this archive for
-+ * more details.
-+ */
-+
-+#ifndef AT91SAM9RL_H
-+#define AT91SAM9RL_H
-+
-+/*
-+ * Peripheral identifiers/interrupts.
-+ */
-+#define AT91_ID_FIQ		0	/* Advanced Interrupt Controller (FIQ) */
-+#define AT91_ID_SYS		1	/* System Controller */
-+#define AT91SAM9RL_ID_PIOA	2	/* Parallel IO Controller A */
-+#define AT91SAM9RL_ID_PIOB	3	/* Parallel IO Controller B */
-+#define AT91SAM9RL_ID_PIOC	4	/* Parallel IO Controller C */
-+#define AT91SAM9RL_ID_PIOD	5	/* Parallel IO Controller D */
-+#define AT91SAM9RL_ID_US0	6	/* USART 0 */
-+#define AT91SAM9RL_ID_US1	7	/* USART 1 */
-+#define AT91SAM9RL_ID_US2	8	/* USART 2 */
-+#define AT91SAM9RL_ID_US3	9	/* USART 3 */
-+#define AT91SAM9RL_ID_MCI	10	/* Multimedia Card Interface */
-+#define AT91SAM9RL_ID_TWI0	11	/* TWI 0 */
-+#define AT91SAM9RL_ID_TWI1	12	/* TWI 1 */
-+#define AT91SAM9RL_ID_SPI	13	/* Serial Peripheral Interface */
-+#define AT91SAM9RL_ID_SSC0	14	/* Serial Synchronous Controller 0 */
-+#define AT91SAM9RL_ID_SSC1	15	/* Serial Synchronous Controller 1 */
-+#define AT91SAM9RL_ID_TC0	16	/* Timer Counter 0 */
-+#define AT91SAM9RL_ID_TC1	17	/* Timer Counter 1 */
-+#define AT91SAM9RL_ID_TC2	18	/* Timer Counter 2 */
-+#define AT91SAM9RL_ID_PWMC	19	/* Pulse Width Modulation Controller */
-+#define AT91SAM9RL_ID_TSC	20	/* Touch Screen Controller */
-+#define AT91SAM9RL_ID_DMA	21	/* DMA Controller */
-+#define AT91SAM9RL_ID_UDPHS	22	/* USB Device HS */
-+#define AT91SAM9RL_ID_LCDC	23	/* LCD Controller */
-+#define AT91SAM9RL_ID_AC97C	24	/* AC97 Controller */
-+#define AT91SAM9RL_ID_IRQ0	31	/* Advanced Interrupt Controller (IRQ0) */
-+
-+
-+/*
-+ * User Peripheral physical base addresses.
-+ */
-+#define AT91SAM9RL_BASE_TCB0	0xfffa0000
-+#define AT91SAM9RL_BASE_TC0	0xfffa0000
-+#define AT91SAM9RL_BASE_TC1	0xfffa0040
-+#define AT91SAM9RL_BASE_TC2	0xfffa0080
-+#define AT91SAM9RL_BASE_MCI	0xfffa4000
-+#define AT91SAM9RL_BASE_TWI0	0xfffa8000
-+#define AT91SAM9RL_BASE_TWI1	0xfffac000
-+#define AT91SAM9RL_BASE_US0	0xfffb0000
-+#define AT91SAM9RL_BASE_US1	0xfffb4000
-+#define AT91SAM9RL_BASE_US2	0xfffb8000
-+#define AT91SAM9RL_BASE_US3	0xfffbc000
-+#define AT91SAM9RL_BASE_SSC0	0xfffc0000
-+#define AT91SAM9RL_BASE_SSC1	0xfffc4000
-+#define AT91SAM9RL_BASE_PWMC	0xfffc8000
-+#define AT91SAM9RL_BASE_SPI	0xfffcc000
-+#define AT91SAM9RL_BASE_TSC	0xfffd0000
-+#define AT91SAM9RL_BASE_UDPHS	0xfffd4000
-+#define AT91SAM9RL_BASE_AC97C	0xfffd8000
-+#define AT91_BASE_SYS		0xffffc000
-+
-+
-+/*
-+ * System Peripherals (offset from AT91_BASE_SYS)
-+ */
-+#define AT91_DMA	(0xffffe600 - AT91_BASE_SYS)
-+#define AT91_ECC	(0xffffe800 - AT91_BASE_SYS)
-+#define AT91_SDRAMC	(0xffffea00 - AT91_BASE_SYS)
-+#define AT91_SMC	(0xffffec00 - AT91_BASE_SYS)
-+#define AT91_MATRIX	(0xffffee00 - AT91_BASE_SYS)
-+#define AT91_CCFG	(0xffffef10 - AT91_BASE_SYS)
-+#define AT91_AIC	(0xfffff000 - AT91_BASE_SYS)
-+#define AT91_DBGU	(0xfffff200 - AT91_BASE_SYS)
-+#define AT91_PIOA	(0xfffff400 - AT91_BASE_SYS)
-+#define AT91_PIOB	(0xfffff600 - AT91_BASE_SYS)
-+#define AT91_PIOC	(0xfffff800 - AT91_BASE_SYS)
-+#define AT91_PIOD	(0xfffffa00 - AT91_BASE_SYS)
-+#define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
-+#define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
-+#define AT91_SHDWC	(0xfffffd10 - AT91_BASE_SYS)
-+#define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
-+#define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
-+#define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
-+#define AT91_SCKCR	(0xfffffd50 - AT91_BASE_SYS)
-+#define AT91_GPBR	(0xfffffd60 - AT91_BASE_SYS)
-+#define AT91_RTC	(0xfffffe00 - AT91_BASE_SYS)
-+
-+
-+/*
-+ * Internal Memory.
-+ */
-+#define AT91SAM9RL_SRAM_BASE	0x00300000	/* Internal SRAM base address */
-+#define AT91SAM9RL_SRAM_SIZE	SZ_16K		/* Internal SRAM size (16Kb) */
-+
-+#define AT91SAM9RL_ROM_BASE	0x00400000	/* Internal ROM base address */
-+#define AT91SAM9RL_ROM_SIZE	(2 * SZ_16K)	/* Internal ROM size (32Kb) */
-+
-+#define AT91SAM9RL_LCDC_BASE	0x00500000	/* LCD Controller */
-+#define AT91SAM9RL_UDPHS_BASE	0x00600000	/* USB Device HS controller */
-+
-+#endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9rl_matrix.h
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/at91sam9rl_matrix.h
-@@ -0,0 +1,96 @@
-+/*
-+ * include/asm-arm/arch-at91/at91sam9rl_matrix.h
-+ *
-+ *  Copyright (C) 2007 Atmel Corporation
-+ *
-+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
-+ * Based on AT91SAM9RL datasheet revision A. (Preliminary)
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file COPYING in the main directory of this archive for
-+ * more details.
-+ */
-+
-+#ifndef AT91SAM9RL_MATRIX_H
-+#define AT91SAM9RL_MATRIX_H
-+
-+#define AT91_MATRIX_MCFG0	(AT91_MATRIX + 0x00)	/* Master Configuration Register 0 */
-+#define AT91_MATRIX_MCFG1	(AT91_MATRIX + 0x04)	/* Master Configuration Register 1 */
-+#define AT91_MATRIX_MCFG2	(AT91_MATRIX + 0x08)	/* Master Configuration Register 2 */
-+#define AT91_MATRIX_MCFG3	(AT91_MATRIX + 0x0C)	/* Master Configuration Register 3 */
-+#define AT91_MATRIX_MCFG4	(AT91_MATRIX + 0x10)	/* Master Configuration Register 4 */
-+#define AT91_MATRIX_MCFG5	(AT91_MATRIX + 0x14)	/* Master Configuration Register 5 */
-+#define		AT91_MATRIX_ULBT	(7 << 0)	/* Undefined Length Burst Type */
-+#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-+#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-+#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-+#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-+#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-+
-+#define AT91_MATRIX_SCFG0	(AT91_MATRIX + 0x40)	/* Slave Configuration Register 0 */
-+#define AT91_MATRIX_SCFG1	(AT91_MATRIX + 0x44)	/* Slave Configuration Register 1 */
-+#define AT91_MATRIX_SCFG2	(AT91_MATRIX + 0x48)	/* Slave Configuration Register 2 */
-+#define AT91_MATRIX_SCFG3	(AT91_MATRIX + 0x4C)	/* Slave Configuration Register 3 */
-+#define AT91_MATRIX_SCFG4	(AT91_MATRIX + 0x50)	/* Slave Configuration Register 4 */
-+#define AT91_MATRIX_SCFG5	(AT91_MATRIX + 0x54)	/* Slave Configuration Register 5 */
-+#define		AT91_MATRIX_SLOT_CYCLE		(0xff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-+#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-+#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-+#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-+#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-+#define		AT91_MATRIX_FIXED_DEFMSTR	(7    << 18)	/* Fixed Index of Default Master */
-+#define		AT91_MATRIX_ARBT		(3    << 24)	/* Arbitration Type */
-+#define			AT91_MATRIX_ARBT_ROUND_ROBIN	(0 << 24)
-+#define			AT91_MATRIX_ARBT_FIXED_PRIORITY	(1 << 24)
-+
-+#define AT91_MATRIX_PRAS0	(AT91_MATRIX + 0x80)	/* Priority Register A for Slave 0 */
-+#define AT91_MATRIX_PRAS1	(AT91_MATRIX + 0x88)	/* Priority Register A for Slave 1 */
-+#define AT91_MATRIX_PRAS2	(AT91_MATRIX + 0x90)	/* Priority Register A for Slave 2 */
-+#define AT91_MATRIX_PRAS3	(AT91_MATRIX + 0x98)	/* Priority Register A for Slave 3 */
-+#define AT91_MATRIX_PRAS4	(AT91_MATRIX + 0xA0)	/* Priority Register A for Slave 4 */
-+#define AT91_MATRIX_PRAS5	(AT91_MATRIX + 0xA8)	/* Priority Register A for Slave 5 */
-+#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-+#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-+#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-+#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-+#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-+#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-+
-+#define AT91_MATRIX_MRCR	(AT91_MATRIX + 0x100)	/* Master Remap Control Register */
-+#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-+#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-+#define		AT91_MATRIX_RCB2		(1 << 2)
-+#define		AT91_MATRIX_RCB3		(1 << 3)
-+#define		AT91_MATRIX_RCB4		(1 << 4)
-+#define		AT91_MATRIX_RCB5		(1 << 5)
-+
-+#define AT91_MATRIX_TCMR	(AT91_MATRIX + 0x114)	/* TCM Configuration Register */
-+#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-+#define			AT91_MATRIX_ITCM_0		(0 << 0)
-+#define			AT91_MATRIX_ITCM_16		(5 << 0)
-+#define			AT91_MATRIX_ITCM_32		(6 << 0)
-+#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-+#define			AT91_MATRIX_DTCM_0		(0 << 4)
-+#define			AT91_MATRIX_DTCM_16		(5 << 4)
-+#define			AT91_MATRIX_DTCM_32		(6 << 4)
-+
-+#define AT91_MATRIX_EBICSA	(AT91_MATRIX + 0x120)	/* EBI0 Chip Select Assignment Register */
-+#define		AT91_MATRIX_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-+#define			AT91_MATRIX_CS1A_SMC		(0 << 1)
-+#define			AT91_MATRIX_CS1A_SDRAMC		(1 << 1)
-+#define		AT91_MATRIX_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-+#define			AT91_MATRIX_CS3A_SMC		(0 << 3)
-+#define			AT91_MATRIX_CS3A_SMC_SMARTMEDIA	(1 << 3)
-+#define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-+#define			AT91_MATRIX_CS4A_SMC		(0 << 4)
-+#define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
-+#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-+#define			AT91_MATRIX_CS5A_SMC		(0 << 5)
-+#define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
-+#define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-+#define		AT91_MATRIX_VDDIOMSEL		(1 << 16)	/* Memory voltage selection */
-+#define			AT91_MATRIX_VDDIOMSEL_1_8V	(0 << 16)
-+#define			AT91_MATRIX_VDDIOMSEL_3_3V	(1 << 16)
-+
-+
-+#endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/board.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/board.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/board.h
-@@ -62,7 +62,7 @@ struct at91_mmc_data {
- };
- extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data);
- 
-- /* Ethernet */
-+ /* Ethernet (EMAC & MACB) */
- struct at91_eth_data {
- 	u8		phy_irq_pin;	/* PHY IRQ */
- 	u8		is_rmii;	/* using RMII interface? */
-@@ -114,9 +114,31 @@ struct atmel_uart_data {
- };
- extern void __init at91_add_device_serial(void);
- 
-+ /* LCD Controller */
-+struct atmel_lcdfb_info;
-+extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data);
-+
-+ /* AC97 */
-+struct atmel_ac97_data {
-+	u8		reset_pin;	/* reset */
-+};
-+extern void __init at91_add_device_ac97(struct atmel_ac97_data *data);
-+
-+ /* ISI */
-+extern void __init at91_add_device_isi(void);
-+
-  /* LEDs */
- extern u8 at91_leds_cpu;
- extern u8 at91_leds_timer;
- extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
- 
-+struct at91_gpio_led {
-+	u8		index;		/* index of LED */
-+	char*		name;		/* name of LED */
-+	u8		gpio;		/* AT91_PIN_xx */
-+	u8		flags;		/* 1=active-high */
-+	char*		trigger;	/* default trigger */
-+};
-+extern void __init at91_gpio_leds(struct at91_gpio_led *leds, int nr);
-+
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/cpu.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/cpu.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/cpu.h
-@@ -26,6 +26,8 @@
- #define ARCH_ID_AT91SAM9XE256	0x329a93a0
- #define ARCH_ID_AT91SAM9XE512	0x329aa3a0
- 
-+#define ARCH_ID_AT91SAM9RL64	0x019b03a0
-+
- static inline unsigned long at91_cpu_identify(void)
- {
- 	return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION);
-@@ -68,4 +70,10 @@ static inline unsigned long at91_arch_id
- #define cpu_is_at91sam9263()	(0)
- #endif
- 
-+#ifdef CONFIG_ARCH_AT91SAM9RL
-+#define cpu_is_at91sam9rl()	(at91_cpu_identify() == ARCH_ID_AT91SAM9RL64)
-+#else
-+#define cpu_is_at91sam9rl()	(0)
-+#endif
-+
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/hardware.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/hardware.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/hardware.h
-@@ -24,6 +24,8 @@
- #include <asm/arch/at91sam9261.h>
- #elif defined(CONFIG_ARCH_AT91SAM9263)
- #include <asm/arch/at91sam9263.h>
-+#elif defined(CONFIG_ARCH_AT91SAM9RL)
-+#include <asm/arch/at91sam9rl.h>
- #else
- #error "Unsupported AT91 processor"
- #endif
-@@ -69,22 +71,5 @@
- /* Clocks */
- #define AT91_SLOW_CLOCK		32768		/* slow clock */
- 
--#ifndef __ASSEMBLY__
--#include <asm/io.h>
--
--static inline unsigned int at91_sys_read(unsigned int reg_offset)
--{
--	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
--
--	return __raw_readl(addr + reg_offset);
--}
--
--static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
--{
--	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
--
--	__raw_writel(value, addr + reg_offset);
--}
--#endif
- 
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/ics1523.h
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/ics1523.h
-@@ -0,0 +1,154 @@
-+//*----------------------------------------------------------------------------
-+//*         ATMEL Microcontroller Software Support  -  ROUSSET  -
-+//*----------------------------------------------------------------------------
-+//* The software is delivered "AS IS" without warranty or condition of any
-+//* kind, either express, implied or statutory. This includes without
-+//* limitation any warranty or condition with respect to merchantability or
-+//* fitness for any particular purpose, or against the infringements of
-+//* intellectual property rights of others.
-+//*----------------------------------------------------------------------------
-+//* File Name           : ics1523.h
-+//* Object              : Clock Generator Prototyping File.
-+//*
-+//* 1.0 08/28/02 ED     : Creation
-+//* 1.2 13/01/03 FB		: Update on lib V3
-+//*----------------------------------------------------------------------------
-+
-+#ifndef ics1523_h
-+#define ics1523_h
-+
-+/*-------------------------------------------*/
-+/* ICS1523 TWI Serial Clock Definition       */
-+/*-------------------------------------------*/
-+
-+#define		ICS_MIN_CLOCK		100		/* Min Frequency Access Clock KHz */
-+#define		ICS_MAX_CLOCK		400		/* Max Frequency Access Clock KHz */
-+#define		ICS_TRANSFER_RATE	ICS_MAX_CLOCK	/* Transfer speed to apply */
-+
-+#define		ICS_WRITE_CLK_PNB	30		/* TWCK Clock Periods required to write */
-+#define		ICS_READ_CLK_PNB	40		/* TWCK Clock Periods required to read */
-+
-+/*-------------------------------------------*/
-+/* ICS1523 Write Operation Definition        */
-+/*-------------------------------------------*/
-+
-+#define		ICS1523_ACCESS_OK	0		/* OK */
-+#define		ICS1523_ACCESS_ERROR	-1		/* NOK */
-+
-+/*-------------------------------------------*/
-+/* ICS1523 Device Addresses Definition       */
-+/*-------------------------------------------*/
-+
-+#define		ICS_ADDR		0x26		/* Device Address */
-+
-+/*--------------------------------------------------*/
-+/* ICS1523 Registers Internal Addresses Definition  */
-+/*--------------------------------------------------*/
-+
-+#define		ICS_ICR			0x0		/* Input Control Register */
-+#define		ICS_LCR			0x1		/* Loop Control Register */
-+#define		ICS_FD0			0x2		/* PLL FeedBack Divider LSBs */
-+#define		ICS_FD1			0x3		/* PLL FeedBack Divider MSBs */
-+#define		ICS_DPAO		0x4		/* Dynamic Phase Aligner Offset */
-+#define		ICS_DPAC		0x5		/* Dynamic Phase Aligner Resolution */
-+#define		ICS_OE			0x6		/* Output Enables Register */
-+#define		ICS_OD			0x7		/* Osc Divider Register */
-+#define		ICS_SWRST		0x8		/* DPA & PLL Reset Register */
-+#define		ICS_VID			0x10		/* Chip Version Register */
-+#define		ICS_RID			0x11		/* Chip Revision Register */
-+#define		ICS_SR			0x12		/* Status Register */
-+
-+/*------------------------------------------------------*/
-+/* ICS1523 Input Control Register Bits Definition       */
-+/*------------------------------------------------------*/
-+
-+#define		ICS_PDEN		0x1		/* Phase Detector Enable */
-+#define		ICS_PDPOL		0x2		/* Phase Detector Enable Polarity */
-+#define		ICS_REFPOL		0x4		/* External Reference Polarity */
-+#define		ICS_FBKPOL		0x8		/* External Feedback Polarity */
-+#define		ICS_FBKSEL		0x10		/* External Feedback Select */
-+#define		ICS_FUNCSEL		0x20		/* Function Out Select */
-+#define		ICS_ENPLS		0x40		/* Enable PLL Lock/Ref Status Output */
-+#define		ICS_ENDLS		0x80		/* Enable DPA Lock/Ref Status Output */
-+
-+/*-----------------------------------------------------*/
-+/* ICS1523 Loop Control Register Bits Definition       */
-+/*-----------------------------------------------------*/
-+
-+#define		ICS_PFD			0x7		/* Phase Detector Gain */
-+#define		ICS_PSD			0x30		/* Post-Scaler Divider */
-+
-+/*----------------------------------------------------*/
-+/* ICS1523 PLL FeedBack Divider LSBs Definition       */
-+/*----------------------------------------------------*/
-+
-+#define		ICS_FBDL		0xFF		/* PLL FeedBack Divider LSBs */
-+
-+/*----------------------------------------------------*/
-+/* ICS1523 PLL FeedBack Divider MSBs Definition       */
-+/*----------------------------------------------------*/
-+
-+#define		ICS_FBDM		0xF		/* PLL FeedBack Divider MSBs */
-+
-+/*------------------------------------------------------------*/
-+/* ICS1523 Dynamic Phase Aligner Offset Bits Definition       */
-+/*------------------------------------------------------------*/
-+
-+#define		ICS_DPAOS		0x2F		/* Dynamic Phase Aligner Offset */
-+#define		ICS_FILSEL		0x80		/* Loop Filter Select */
-+
-+/*----------------------------------------------------------------*/
-+/* ICS1523 Dynamic Phase Aligner Resolution Bits Definition       */
-+/*----------------------------------------------------------------*/
-+
-+#define		ICS_DPARES		0x3		/* Dynamic Phase Aligner Resolution */
-+#define		ICS_MMREV		0xFC		/* Metal Mask Revision Number */
-+
-+/*-------------------------------------------------------*/
-+/* ICS1523 Output Enables Register Bits Definition       */
-+/*-------------------------------------------------------*/
-+
-+#define		ICS_OEPCK		0x1		/* Output Enable for PECL PCLK Outputs */
-+#define		ICS_OETCK		0x2		/* Output Enable for STTL CLK Output */
-+#define		ICS_OEP2		0x4		/* Output Enable for PECL CLK/2 Outputs */
-+#define		ICS_OET2		0x8		/* Output Enable for STTL CLK/2 Output */
-+#define		ICS_OEF			0x10		/* Output Enable for STTL FUNC Output */
-+#define		ICS_CLK2INV		0x20		/* CLK/2 Invert */
-+#define		ICS_OSCL		0xC0		/* SSTL Clock Scaler */
-+
-+/*----------------------------------------------------*/
-+/* ICS1523 Osc Divider Register Bits Definition       */
-+/*----------------------------------------------------*/
-+
-+#define		ICS_OSCDIV		0x7F		/* Oscillator Divider Modulus */
-+#define		ICS_INSEL		0x80		/* Input Select */
-+
-+/*---------------------------------------------------*/
-+/* ICS1523 DPA & PLL Reset Register Definition       */
-+/*---------------------------------------------------*/
-+
-+#define		ICS_DPAR		0x0A		/* DPA Reset Command */
-+#define		ICS_PLLR		0x50		/* PLL Reset Command */
-+
-+/*------------------------------------------------*/
-+/* ICS1523 Chip Version Register Definition       */
-+/*------------------------------------------------*/
-+
-+#define		ICS_CHIPV		0xFF		/* Chip Version */
-+
-+/*-------------------------------------------------*/
-+/* ICS1523 Chip Revision Register Definition       */
-+/*-------------------------------------------------*/
-+
-+#define		ICS_CHIPR		0xFF		/* Chip Revision */
-+
-+/*------------------------------------------*/
-+/* ICS1523 Status Register Definition       */
-+/*------------------------------------------*/
-+
-+#define		ICS_DPALOCK		0x1		/* DPA Lock Status */
-+#define		ICS_PLLLOCK		0x2		/* PLL Lock Status */
-+
-+int at91_ics1523_init(void);
-+
-+#endif /* ics1523_h */
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/io.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/io.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/io.h
-@@ -29,4 +29,22 @@
- #define __mem_pci(a)		(a)
- 
- 
-+#ifndef __ASSEMBLY__
-+
-+static inline unsigned int at91_sys_read(unsigned int reg_offset)
-+{
-+	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
-+
-+	return __raw_readl(addr + reg_offset);
-+}
-+
-+static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
-+{
-+	void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS;
-+
-+	__raw_writel(value, addr + reg_offset);
-+}
-+
-+#endif
-+
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/irqs.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/irqs.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/irqs.h
-@@ -21,6 +21,7 @@
- #ifndef __ASM_ARCH_IRQS_H
- #define __ASM_ARCH_IRQS_H
- 
-+#include <asm/io.h>
- #include <asm/arch/at91_aic.h>
- 
- #define NR_AIC_IRQS 32
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/spi.h
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/spi.h
-@@ -0,0 +1,54 @@
-+/*
-+ * Serial Peripheral Interface (SPI) driver for the Atmel AT91RM9200
-+ *
-+ * (c) SAN People (Pty) 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.
-+ */
-+
-+#ifndef AT91_LEGACY_SPI_H
-+#define AT91_LEGACY_SPI_H
-+
-+#define SPI_MAJOR		153	/* registered device number */
-+
-+#define DEFAULT_SPI_CLK		6000000
-+
-+
-+/* Maximum number of buffers in a single SPI transfer.
-+ *  DataFlash uses maximum of 2
-+ *  spidev interface supports up to 8.
-+ */
-+#define MAX_SPI_TRANSFERS	8
-+#define NR_SPI_DEVICES		4	/* number of devices on SPI bus */
-+
-+/*
-+ * Describes the buffers for a SPI transfer.
-+ * A transmit & receive buffer must be specified for each transfer
-+ */
-+struct spi_transfer_list {
-+	void* tx[MAX_SPI_TRANSFERS];	/* transmit */
-+	int txlen[MAX_SPI_TRANSFERS];
-+	void* rx[MAX_SPI_TRANSFERS];	/* receive */
-+	int rxlen[MAX_SPI_TRANSFERS];
-+	int nr_transfers;		/* number of transfers */
-+	int curr;			/* current transfer */
-+};
-+
-+struct spi_local {
-+	unsigned int pcs;		/* Peripheral Chip Select value */
-+
-+	struct spi_transfer_list *xfers;	/* current transfer list */
-+	dma_addr_t tx, rx;		/* DMA address for current transfer */
-+	dma_addr_t txnext, rxnext;	/* DMA address for next transfer */
-+};
-+
-+
-+/* Exported functions */
-+extern void spi_access_bus(short device);
-+extern void spi_release_bus(short device);
-+extern int spi_transfer(struct spi_transfer_list* list);
-+
-+#endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/timex.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/timex.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/timex.h
-@@ -37,6 +37,11 @@
- #define AT91SAM9_MASTER_CLOCK	99959500
- #define CLOCK_TICK_RATE		(AT91SAM9_MASTER_CLOCK/16)
- 
-+#elif defined(CONFIG_ARCH_AT91SAM9RL)
-+
-+#define AT91SAM9_MASTER_CLOCK	100000000
-+#define CLOCK_TICK_RATE		(AT91SAM9_MASTER_CLOCK/16)
-+
- #endif
- 
- #endif
-Index: linux-2.6.21.7/include/asm-arm/arch-at91/uncompress.h
-===================================================================
---- linux-2.6.21.7.orig/include/asm-arm/arch-at91/uncompress.h
-+++ linux-2.6.21.7/include/asm-arm/arch-at91/uncompress.h
-@@ -21,7 +21,7 @@
- #ifndef __ASM_ARCH_UNCOMPRESS_H
- #define __ASM_ARCH_UNCOMPRESS_H
- 
--#include <asm/hardware.h>
-+#include <asm/io.h>
- #include <asm/arch/at91_dbgu.h>
- 
- /*
-Index: linux-2.6.21.7/include/linux/clk.h
-===================================================================
---- linux-2.6.21.7.orig/include/linux/clk.h
-+++ linux-2.6.21.7/include/linux/clk.h
-@@ -121,4 +121,24 @@ int clk_set_parent(struct clk *clk, stru
-  */
- struct clk *clk_get_parent(struct clk *clk);
- 
-+/**
-+ * clk_must_disable - report whether a clock's users must disable it
-+ * @clk: one node in the clock tree
-+ *
-+ * This routine returns true only if the upcoming system state requires
-+ * disabling the specified clock.
-+ *
-+ * It's common for platform power states to constrain certain clocks (and
-+ * their descendants) to be unavailable, while other states allow that
-+ * clock to be active.  A platform's power states often include an "all on"
-+ * mode; system wide sleep states like "standby" or "suspend-to-RAM"; and
-+ * operating states which sacrifice functionality for lower power usage.
-+ *
-+ * The constraint value is commonly tested in device driver suspend(), to
-+ * leave clocks active if they are needed for features like wakeup events.
-+ * On platforms that support reduced functionality operating states, the
-+ * constraint may also need to be tested during resume() and probe() calls.
-+ */
-+int clk_must_disable(struct clk *clk);
-+
- #endif
-Index: linux-2.6.21.7/include/linux/i2c-id.h
-===================================================================
---- linux-2.6.21.7.orig/include/linux/i2c-id.h
-+++ linux-2.6.21.7/include/linux/i2c-id.h
-@@ -202,6 +202,7 @@
- 
- /* --- PCA 9564 based algorithms */
- #define I2C_HW_A_ISA		0x1a0000 /* generic ISA Bus interface card */
-+#define I2C_HW_A_PLAT		0x1a0001 /* generic platform_bus interface */
- 
- /* --- ACPI Embedded controller algorithms                              */
- #define I2C_HW_ACPI_EC          0x1f0000
-Index: linux-2.6.21.7/include/video/atmel_lcdc.h
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/include/video/atmel_lcdc.h
-@@ -0,0 +1,196 @@
-+/*
-+ *  Header file for AT91/AT32 LCD Controller
-+ *
-+ *  Data structure and register user interface
-+ *
-+ *  Copyright (C) 2007 Atmel Corporation
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * 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 __ATMEL_LCDC_H__
-+#define __ATMEL_LCDC_H__
-+
-+ /* LCD Controller info data structure */
-+struct atmel_lcdfb_info {
-+	spinlock_t		lock;
-+	struct fb_info		*info;
-+	void __iomem		*mmio;
-+	unsigned long		irq_base;
-+
-+	unsigned int		guard_time;
-+	struct platform_device	*pdev;
-+	struct clk		*bus_clk;
-+	struct clk		*lcdc_clk;
-+	unsigned int		default_bpp;
-+	unsigned int		default_lcdcon2;
-+	unsigned int		default_dmacon;
-+	void (*atmel_lcdfb_power_control)(int on);
-+	struct fb_monspecs	*default_monspecs;
-+	u32			pseudo_palette[16];
-+};
-+
-+#define ATMEL_LCDC_DMABADDR1	0x00
-+#define ATMEL_LCDC_DMABADDR2	0x04
-+#define ATMEL_LCDC_DMAFRMPT1	0x08
-+#define ATMEL_LCDC_DMAFRMPT2	0x0c
-+#define ATMEL_LCDC_DMAFRMADD1	0x10
-+#define ATMEL_LCDC_DMAFRMADD2	0x14
-+
-+#define ATMEL_LCDC_DMAFRMCFG	0x18
-+#define	ATMEL_LCDC_FRSIZE	(0x7fffff <<  0)
-+#define	ATMEL_LCDC_BLENGTH_OFFSET	24
-+#define	ATMEL_LCDC_BLENGTH	(0x7f     << ATMEL_LCDC_BLENGTH_OFFSET)
-+
-+#define ATMEL_LCDC_DMACON	0x1c
-+#define	ATMEL_LCDC_DMAEN	(0x1 << 0)
-+#define	ATMEL_LCDC_DMARST	(0x1 << 1)
-+#define	ATMEL_LCDC_DMABUSY	(0x1 << 2)
-+#define		ATMEL_LCDC_DMAUPDT	(0x1 << 3)
-+#define		ATMEL_LCDC_DMA2DEN	(0x1 << 4)
-+
-+#define ATMEL_LCDC_DMA2DCFG	0x20
-+#define		ATMEL_LCDC_ADDRINC_OFFSET	0
-+#define		ATMEL_LCDC_ADDRINC		(0xffff)
-+#define		ATMEL_LCDC_PIXELOFF_OFFSET	24
-+#define		ATMEL_LCDC_PIXELOFF		(0x1f << 24)
-+
-+#define ATMEL_LCDC_LCDCON1	0x0800
-+#define	ATMEL_LCDC_BYPASS	(1     <<  0)
-+#define	ATMEL_LCDC_CLKVAL_OFFSET	12
-+#define	ATMEL_LCDC_CLKVAL	(0x1ff << ATMEL_LCDC_CLKVAL_OFFSET)
-+#define	ATMEL_LCDC_LINCNT	(0x7ff << 21)
-+
-+#define ATMEL_LCDC_LCDCON2	0x0804
-+#define	ATMEL_LCDC_DISTYPE	(3 << 0)
-+#define		ATMEL_LCDC_DISTYPE_STNMONO	(0 << 0)
-+#define		ATMEL_LCDC_DISTYPE_STNCOLOR	(1 << 0)
-+#define		ATMEL_LCDC_DISTYPE_TFT		(2 << 0)
-+#define	ATMEL_LCDC_SCANMOD	(1 << 2)
-+#define		ATMEL_LCDC_SCANMOD_SINGLE	(0 << 2)
-+#define		ATMEL_LCDC_SCANMOD_DUAL		(1 << 2)
-+#define	ATMEL_LCDC_IFWIDTH	(3 << 3)
-+#define		ATMEL_LCDC_IFWIDTH_4		(0 << 3)
-+#define		ATMEL_LCDC_IFWIDTH_8		(1 << 3)
-+#define		ATMEL_LCDC_IFWIDTH_16		(2 << 3)
-+#define	ATMEL_LCDC_PIXELSIZE	(7 << 5)
-+#define		ATMEL_LCDC_PIXELSIZE_1		(0 << 5)
-+#define		ATMEL_LCDC_PIXELSIZE_2		(1 << 5)
-+#define		ATMEL_LCDC_PIXELSIZE_4		(2 << 5)
-+#define		ATMEL_LCDC_PIXELSIZE_8		(3 << 5)
-+#define		ATMEL_LCDC_PIXELSIZE_16		(4 << 5)
-+#define		ATMEL_LCDC_PIXELSIZE_24		(5 << 5)
-+#define		ATMEL_LCDC_PIXELSIZE_32		(6 << 5)
-+#define	ATMEL_LCDC_INVVD	(1 << 8)
-+#define		ATMEL_LCDC_INVVD_NORMAL		(0 << 8)
-+#define		ATMEL_LCDC_INVVD_INVERTED	(1 << 8)
-+#define	ATMEL_LCDC_INVFRAME	(1 << 9 )
-+#define		ATMEL_LCDC_INVFRAME_NORMAL	(0 << 9)
-+#define		ATMEL_LCDC_INVFRAME_INVERTED	(1 << 9)
-+#define	ATMEL_LCDC_INVLINE	(1 << 10)
-+#define		ATMEL_LCDC_INVLINE_NORMAL	(0 << 10)
-+#define		ATMEL_LCDC_INVLINE_INVERTED	(1 << 10)
-+#define	ATMEL_LCDC_INVCLK	(1 << 11)
-+#define		ATMEL_LCDC_INVCLK_NORMAL	(0 << 11)
-+#define		ATMEL_LCDC_INVCLK_INVERTED	(1 << 11)
-+#define	ATMEL_LCDC_INVDVAL	(1 << 12)
-+#define		ATMEL_LCDC_INVDVAL_NORMAL	(0 << 12)
-+#define		ATMEL_LCDC_INVDVAL_INVERTED	(1 << 12)
-+#define	ATMEL_LCDC_CLKMOD	(1 << 15)
-+#define		ATMEL_LCDC_CLKMOD_ACTIVEDISPLAY	(0 << 15)
-+#define		ATMEL_LCDC_CLKMOD_ALWAYSACTIVE	(1 << 15)
-+#define	ATMEL_LCDC_MEMOR	(1 << 31)
-+#define		ATMEL_LCDC_MEMOR_BIG		(0 << 31)
-+#define		ATMEL_LCDC_MEMOR_LITTLE		(1 << 31)
-+
-+#define ATMEL_LCDC_TIM1		0x0808
-+#define	ATMEL_LCDC_VFP		(0xff <<  0)
-+#define	ATMEL_LCDC_VBP_OFFSET		8
-+#define	ATMEL_LCDC_VBP		(0xff <<  ATMEL_LCDC_VBP_OFFSET)
-+#define	ATMEL_LCDC_VPW_OFFSET		16
-+#define	ATMEL_LCDC_VPW		(0x3f << ATMEL_LCDC_VPW_OFFSET)
-+#define	ATMEL_LCDC_VHDLY_OFFSET		24
-+#define	ATMEL_LCDC_VHDLY	(0xf  << ATMEL_LCDC_VHDLY_OFFSET)
-+
-+#define ATMEL_LCDC_TIM2		0x080c
-+#define	ATMEL_LCDC_HBP		(0xff  <<  0)
-+#define	ATMEL_LCDC_HPW_OFFSET		8
-+#define	ATMEL_LCDC_HPW		(0x3f  <<  ATMEL_LCDC_HPW_OFFSET)
-+#define	ATMEL_LCDC_HFP_OFFSET		21
-+#define	ATMEL_LCDC_HFP		(0x7ff << ATMEL_LCDC_HFP_OFFSET)
-+
-+#define ATMEL_LCDC_LCDFRMCFG	0x0810
-+#define	ATMEL_LCDC_LINEVAL	(0x7ff <<  0)
-+#define	ATMEL_LCDC_HOZVAL_OFFSET	21
-+#define	ATMEL_LCDC_HOZVAL	(0x7ff << ATMEL_LCDC_HOZVAL_OFFSET)
-+
-+#define ATMEL_LCDC_FIFO		0x0814
-+#define	ATMEL_LCDC_FIFOTH	(0xffff)
-+
-+#define ATMEL_LCDC_MVAL		0x0818
-+
-+#define ATMEL_LCDC_DP1_2	0x081c
-+#define ATMEL_LCDC_DP4_7	0x0820
-+#define ATMEL_LCDC_DP3_5	0x0824
-+#define ATMEL_LCDC_DP2_3	0x0828
-+#define ATMEL_LCDC_DP5_7	0x082c
-+#define ATMEL_LCDC_DP3_4	0x0830
-+#define ATMEL_LCDC_DP4_5	0x0834
-+#define ATMEL_LCDC_DP6_7	0x0838
-+#define	ATMEL_LCDC_DP1_2_VAL	(0xff)
-+#define	ATMEL_LCDC_DP4_7_VAL	(0xfffffff)
-+#define	ATMEL_LCDC_DP3_5_VAL	(0xfffff)
-+#define	ATMEL_LCDC_DP2_3_VAL	(0xfff)
-+#define	ATMEL_LCDC_DP5_7_VAL	(0xfffffff)
-+#define	ATMEL_LCDC_DP3_4_VAL	(0xffff)
-+#define	ATMEL_LCDC_DP4_5_VAL	(0xfffff)
-+#define	ATMEL_LCDC_DP6_7_VAL	(0xfffffff)
-+
-+#define ATMEL_LCDC_PWRCON	0x083c
-+#define	ATMEL_LCDC_PWR		(1    <<  0)
-+#define	ATMEL_LCDC_GUARDT_OFFSET	1
-+#define	ATMEL_LCDC_GUARDT	(0x7f <<  ATMEL_LCDC_GUARDT_OFFSET)
-+#define	ATMEL_LCDC_BUSY		(1    << 31)
-+
-+#define ATMEL_LCDC_CONTRAST_CTR	0x0840
-+#define	ATMEL_LCDC_PS		(3 << 0)
-+#define		ATMEL_LCDC_PS_DIV1		(0 << 0)
-+#define		ATMEL_LCDC_PS_DIV2		(1 << 0)
-+#define		ATMEL_LCDC_PS_DIV4		(2 << 0)
-+#define		ATMEL_LCDC_PS_DIV8		(3 << 0)
-+#define	ATMEL_LCDC_POL		(1 << 2)
-+#define		ATMEL_LCDC_POL_NEGATIVE		(0 << 2)
-+#define		ATMEL_LCDC_POL_POSITIVE		(1 << 2)
-+#define	ATMEL_LCDC_ENA		(1 << 3)
-+#define		ATMEL_LCDC_ENA_PWMDISABLE	(0 << 3)
-+#define		ATMEL_LCDC_ENA_PWMENABLE	(1 << 3)
-+
-+#define ATMEL_LCDC_CONTRAST_VAL	0x0844
-+#define	ATMEL_LCDC_CVAL	(0xff)
-+
-+#define ATMEL_LCDC_IER		0x0848
-+#define ATMEL_LCDC_IDR		0x084c
-+#define ATMEL_LCDC_IMR		0x0850
-+#define ATMEL_LCDC_ISR		0x0854
-+#define ATMEL_LCDC_ICR		0x0858
-+#define	ATMEL_LCDC_LNI		(1 << 0)
-+#define	ATMEL_LCDC_LSTLNI	(1 << 1)
-+#define	ATMEL_LCDC_EOFI		(1 << 2)
-+#define	ATMEL_LCDC_UFLWI	(1 << 4)
-+#define	ATMEL_LCDC_OWRI		(1 << 5)
-+#define	ATMEL_LCDC_MERI		(1 << 6)
-+
-+#define ATMEL_LCDC_LUT(n)	(0x0c00 + ((n)*4))
-+
-+#endif /* __ATMEL_LCDC_H__ */
-Index: linux-2.6.21.7/sound/soc/at91/eti_b1_wm8731.c
-===================================================================
---- linux-2.6.21.7.orig/sound/soc/at91/eti_b1_wm8731.c
-+++ linux-2.6.21.7/sound/soc/at91/eti_b1_wm8731.c
-@@ -34,8 +34,7 @@
- #include <sound/soc.h>
- #include <sound/soc-dapm.h>
- 
--#include <asm/arch/hardware.h>
--#include <asm/arch/at91_pio.h>
-+#include <asm/hardware.h>
- #include <asm/arch/gpio.h>
- 
- #include "../codecs/wm8731.h"
-@@ -48,13 +47,6 @@
- #define	DBG(x...)
- #endif
- 
--#define AT91_PIO_TF1	(1 << (AT91_PIN_PB6 - PIN_BASE) % 32)
--#define AT91_PIO_TK1	(1 << (AT91_PIN_PB7 - PIN_BASE) % 32)
--#define AT91_PIO_TD1	(1 << (AT91_PIN_PB8 - PIN_BASE) % 32)
--#define AT91_PIO_RD1	(1 << (AT91_PIN_PB9 - PIN_BASE) % 32)
--#define AT91_PIO_RK1	(1 << (AT91_PIN_PB10 - PIN_BASE) % 32)
--#define AT91_PIO_RF1	(1 << (AT91_PIN_PB11 - PIN_BASE) % 32)
--
- static struct clk *pck1_clk;
- static struct clk *pllb_clk;
- 
-@@ -277,7 +269,6 @@ static struct platform_device *eti_b1_sn
- static int __init eti_b1_init(void)
- {
- 	int ret;
--	u32 ssc_pio_lines;
- 	struct at91_ssc_periph *ssc = eti_b1_dai.cpu_dai->private_data;
- 
- 	if (!request_mem_region(AT91RM9200_BASE_SSC1, SZ_16K, "soc-audio")) {
-@@ -311,19 +302,12 @@ static int __init eti_b1_init(void)
- 		goto fail_io_unmap;
- 	}
- 
-- 	ssc_pio_lines = AT91_PIO_TF1 | AT91_PIO_TK1 | AT91_PIO_TD1
--			| AT91_PIO_RD1 /* | AT91_PIO_RK1 */ | AT91_PIO_RF1;
--
--	/* Reset all PIO registers and assign lines to peripheral A */
-- 	at91_sys_write(AT91_PIOB + PIO_PDR,  ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_ODR,  ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_IFDR, ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_CODR, ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_IDR,  ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_MDDR, ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_PUDR, ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_ASR,  ssc_pio_lines);
-- 	at91_sys_write(AT91_PIOB + PIO_OWDR, ssc_pio_lines);
-+ 	at91_set_A_periph(AT91_PIN_PB6, 0);	/* TF1 */
-+ 	at91_set_A_periph(AT91_PIN_PB7, 0);	/* TK1 */
-+ 	at91_set_A_periph(AT91_PIN_PB8, 0);	/* TD1 */
-+ 	at91_set_A_periph(AT91_PIN_PB9, 0);	/* RD1 */
-+/* 	at91_set_A_periph(AT91_PIN_PB10, 0);*/	/* RK1 */ 	
-+ 	at91_set_A_periph(AT91_PIN_PB11, 0);	/* RF1 */
- 
- 	/*
- 	 * Set PCK1 parent to PLLB and its rate to 12 Mhz.

+ 0 - 219
target/linux/at91/patches-2.6.21/001-vlink-machine.patch

@@ -1,219 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/boot/compressed/head-at91rm9200.S
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/boot/compressed/head-at91rm9200.S
-+++ linux-2.6.21.7/arch/arm/boot/compressed/head-at91rm9200.S
-@@ -61,6 +61,12 @@
- 		cmp	r7, r3
- 		beq	99f
- 
-+		@ FDL Versalink : 1053
-+		mov   r3, #(MACH_TYPE_VLINK & 0xff)
-+		orr r3, r3, #(MACH_TYPE_VLINK & 0xff00)
-+		cmp r7, r3
-+		beq 99f
-+
- 		@ Ajeco 1ARM : 1075
- 		mov	r3,	#(MACH_TYPE_ONEARM & 0xff)
- 		orr	r3, r3, #(MACH_TYPE_ONEARM & 0xff00)
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-@@ -0,0 +1,160 @@
-+/*
-+ * linux/arch/arm/mach-at91/board-vlink.c
-+ *
-+ *  Copyright (C) 2005 SAN People
-+ *  Copyright (C) 2006,2007 Guthrie Consulting
-+ *
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/init.h>
-+#include <linux/mm.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/spi/spi.h>
-+#include <linux/mtd/physmap.h>
-+
-+#include <asm/hardware.h>
-+#include <asm/setup.h>
-+#include <asm/mach-types.h>
-+#include <asm/irq.h>
-+
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/mach/irq.h>
-+
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+#include <asm/arch/at91rm9200_mc.h>
-+
-+#include "generic.h"
-+
-+
-+/*
-+ * Serial port configuration.
-+ *    0 .. 3 = USART0 .. USART3
-+ *    4      = DBGU
-+ */
-+static struct at91_uart_config __initdata vlink_uart_config = {
-+	.console_tty	= 0,				/* ttyS0 */
-+	.nr_tty		= 5,
-+	.tty_map	= { 4, 1, 0, 3, 2 }		/* ttyS0, ..., ttyS4 */
-+};
-+
-+static void __init vlink_map_io(void)
-+{
-+	/* Initialize processor: 18.432 MHz crystal */
-+	at91rm9200_initialize(18432000, AT91RM9200_PQFP);
-+
-+	/* Setup the LEDs */
-+//	at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
-+
-+	/* Setup the serial ports and console */
-+	at91_init_serial(&vlink_uart_config);
-+}
-+
-+static void __init vlink_init_irq(void)
-+{
-+	at91rm9200_init_interrupts(NULL);
-+}
-+
-+static struct at91_eth_data __initdata vlink_eth_data = {
-+	.phy_irq_pin	= AT91_PIN_PC4,
-+	.is_rmii	= 1,
-+};
-+
-+static struct at91_usbh_data __initdata vlink_usbh_data = {
-+	.ports		= 1,
-+};
-+
-+static struct at91_udc_data __initdata vlink_udc_data = {
-+	.vbus_pin	= AT91_PIN_PD4,
-+	.pullup_pin	= AT91_PIN_PD5,
-+};
-+
-+static struct at91_mmc_data __initdata vlink_mmc_data = {
-+//	.det_pin	= AT91_PIN_PB27,
-+	.slot_b		= 0,
-+	.wire4		= 1,
-+//	.wp_pin		= AT91_PIN_PA17,
-+};
-+
-+static struct spi_board_info vlink_spi_devices[] = {
-+	{	/* DataFlash chip */
-+		.modalias	= "mtd_dataflash",
-+		.chip_select	= 0,
-+		.max_speed_hz	= 15 * 1000 * 1000,
-+	},
-+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
-+	{	/* DataFlash card */
-+		.modalias	= "mtd_dataflash",
-+		.chip_select	= 3,
-+		.max_speed_hz	= 15 * 1000 * 1000,
-+	},
-+#endif
-+};
-+
-+static struct at91_gpio_led vlink_leds[] = {
-+	{
-+		.name		= "led0",
-+		.gpio		= AT91_PIN_PB1,
-+		.trigger	= "heartbeat",
-+	},
-+	{
-+		.name		= "led1",
-+		.gpio		= AT91_PIN_PB2,
-+		.trigger	= "timer",
-+	}
-+};
-+
-+static void __init vlink_board_init(void)
-+{
-+	/* Serial */
-+	at91_add_device_serial();
-+	/* Ethernet */
-+	at91_add_device_eth(&vlink_eth_data);
-+	/* USB Host */
-+	at91_add_device_usbh(&vlink_usbh_data);
-+	/* USB Device */
-+	at91_add_device_udc(&vlink_udc_data);
-+	at91_set_multi_drive(vlink_udc_data.pullup_pin, 1);	/* pullup_pin is connected to reset */
-+	/* I2C */
-+	at91_add_device_i2c();
-+	/* SPI */
-+	at91_add_device_spi(vlink_spi_devices, ARRAY_SIZE(vlink_spi_devices));
-+#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
-+	/* DataFlash card */
-+//	at91_set_gpio_output(AT91_PIN_PB22, 0);
-+#else
-+	/* MMC */
-+//	at91_set_gpio_output(AT91_PIN_PB22, 1);	/* this MMC card slot can optionally use SPI signaling (CS3). */
-+	at91_add_device_mmc(0, &vlink_mmc_data);
-+#endif
-+	/* LEDs */
-+	at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
-+}
-+
-+MACHINE_START(VLINK, "FDL VersaLink")
-+	/* Maintainer: Guthrie Consulting */
-+	.phys_io	= AT91_BASE_SYS,
-+	.io_pg_offst	= (AT91_VA_BASE_SYS >> 18) & 0xfffc,
-+	.boot_params	= AT91_SDRAM_BASE + 0x100,
-+	.timer		= &at91rm9200_timer,
-+	.map_io		= vlink_map_io,
-+	.init_irq	= vlink_init_irq,
-+	.init_machine	= vlink_board_init,
-+MACHINE_END
-Index: linux-2.6.21.7/arch/arm/mach-at91/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/Kconfig
-+++ linux-2.6.21.7/arch/arm/mach-at91/Kconfig
-@@ -96,6 +96,12 @@ config MACH_CHUB
- 	help
- 	  Select this if you are using Promwad's Chub board.
- 
-+config MACH_VLINK
-+	bool "Figment Design Labs VersaLink"
-+	depends on ARCH_AT91RM9200
-+	help
-+		Select this if you are using FDL's VersaLink board
-+
- endif
- 
- # ----------------------------------------------------------
-Index: linux-2.6.21.7/arch/arm/mach-at91/Makefile
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/Makefile
-+++ linux-2.6.21.7/arch/arm/mach-at91/Makefile
-@@ -29,6 +29,7 @@ obj-$(CONFIG_MACH_KB9200)	+= board-kb920
- obj-$(CONFIG_MACH_ATEB9200)	+= board-eb9200.o
- obj-$(CONFIG_MACH_KAFA)		+= board-kafa.o
- obj-$(CONFIG_MACH_CHUB)		+= board-chub.o
-+obj-$(CONFIG_MACH_VLINK)	+= board-vlink.o
- 
- # AT91SAM9260 board-specific support
- obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
-@@ -51,6 +52,7 @@ led-$(CONFIG_MACH_CSB337)	+= leds.o
- led-$(CONFIG_MACH_CSB637)	+= leds.o
- led-$(CONFIG_MACH_KB9200)	+= leds.o
- led-$(CONFIG_MACH_KAFA)		+= leds.o
-+led-$(CONFIG_MACH_VLINK)	+= leds.o
- obj-$(CONFIG_LEDS) += $(led-y)
- 
- # VGA support

+ 0 - 192
target/linux/at91/patches-2.6.21/002-led-driver.patch

@@ -1,192 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-vlink.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-@@ -61,7 +61,7 @@ static void __init vlink_map_io(void)
- 	at91rm9200_initialize(18432000, AT91RM9200_PQFP);
- 
- 	/* Setup the LEDs */
--//	at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
-+	at91_init_leds(AT91_PIN_PC14, AT91_PIN_PC15);
- 
- 	/* Setup the serial ports and console */
- 	at91_init_serial(&vlink_uart_config);
-@@ -81,10 +81,12 @@ static struct at91_usbh_data __initdata 
- 	.ports		= 1,
- };
- 
-+/*
- static struct at91_udc_data __initdata vlink_udc_data = {
- 	.vbus_pin	= AT91_PIN_PD4,
- 	.pullup_pin	= AT91_PIN_PD5,
- };
-+*/
- 
- static struct at91_mmc_data __initdata vlink_mmc_data = {
- //	.det_pin	= AT91_PIN_PB27,
-@@ -108,18 +110,19 @@ static struct spi_board_info vlink_spi_d
- #endif
- };
- 
--static struct at91_gpio_led vlink_leds[] = {
-+/*static struct at91_gpio_led vlink_leds[] = {
- 	{
- 		.name		= "led0",
--		.gpio		= AT91_PIN_PB1,
-+		.gpio		= AT91_PIN_PC14,
- 		.trigger	= "heartbeat",
- 	},
- 	{
- 		.name		= "led1",
--		.gpio		= AT91_PIN_PB2,
-+		.gpio		= AT91_PIN_PC15,
- 		.trigger	= "timer",
- 	}
- };
-+*/
- 
- static void __init vlink_board_init(void)
- {
-@@ -130,8 +133,8 @@ static void __init vlink_board_init(void
- 	/* USB Host */
- 	at91_add_device_usbh(&vlink_usbh_data);
- 	/* USB Device */
--	at91_add_device_udc(&vlink_udc_data);
--	at91_set_multi_drive(vlink_udc_data.pullup_pin, 1);	/* pullup_pin is connected to reset */
-+//	at91_add_device_udc(&vlink_udc_data);
-+//	at91_set_multi_drive(vlink_udc_data.pullup_pin, 1);	/* pullup_pin is connected to reset */
- 	/* I2C */
- 	at91_add_device_i2c();
- 	/* SPI */
-@@ -145,7 +148,7 @@ static void __init vlink_board_init(void
- 	at91_add_device_mmc(0, &vlink_mmc_data);
- #endif
- 	/* LEDs */
--	at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
-+//	at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
- }
- 
- MACHINE_START(VLINK, "FDL VersaLink")
-Index: linux-2.6.21.7/arch/arm/mach-at91/Makefile
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/Makefile
-+++ linux-2.6.21.7/arch/arm/mach-at91/Makefile
-@@ -52,7 +52,7 @@ led-$(CONFIG_MACH_CSB337)	+= leds.o
- led-$(CONFIG_MACH_CSB637)	+= leds.o
- led-$(CONFIG_MACH_KB9200)	+= leds.o
- led-$(CONFIG_MACH_KAFA)		+= leds.o
--led-$(CONFIG_MACH_VLINK)	+= leds.o
-+led-$(CONFIG_MACH_VLINK)	+= vlink_leds.o
- obj-$(CONFIG_LEDS) += $(led-y)
- 
- # VGA support
-Index: linux-2.6.21.7/arch/arm/mach-at91/vlink_leds.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/arch/arm/mach-at91/vlink_leds.c
-@@ -0,0 +1,105 @@
-+/*
-+ * LED driver for Atmel AT91-based boards.
-+ *
-+ *  Copyright (C) SAN People (Pty) Ltd
-+ *	Modified for FDL VersaLink Copyright (C) Guthrie Consulting
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version
-+ * 2 of the License, or (at your option) any later version.
-+*/
-+
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/init.h>
-+
-+#include <asm/mach-types.h>
-+#include <asm/leds.h>
-+#include <asm/arch/board.h>
-+#include <asm/arch/gpio.h>
-+
-+
-+static inline void at91_led_on(unsigned int led)
-+{
-+	at91_set_gpio_value(led, 0);
-+}
-+
-+static inline void at91_led_off(unsigned int led)
-+{
-+	at91_set_gpio_value(led, 1);
-+}
-+
-+static inline void at91_led_toggle(unsigned int led)
-+{
-+	unsigned long is_off = at91_get_gpio_value(led);
-+	if (is_off) {
-+		at91_led_on(led);
-+		at91_led_off(at91_leds_cpu);
-+		}
-+	else {
-+		at91_led_on(at91_leds_cpu);
-+		at91_led_off(led);
-+		}
-+}
-+
-+
-+/*
-+ * Handle LED events.
-+ */
-+
-+/*
-+ * VersaLink has a single bi-coloured LED which changes colour when the
-+ * polarity is reversed
-+ */
-+static void at91_leds_event(led_event_t evt)
-+{
-+	unsigned long flags;
-+
-+	local_irq_save(flags);
-+
-+	switch(evt) {
-+	case led_start:		/* System startup */
-+		at91_led_toggle(at91_leds_timer);
-+		break;
-+
-+	case led_stop:		/* System stop / suspend */
-+		at91_led_toggle(at91_leds_timer);
-+		break;
-+
-+#ifdef CONFIG_LEDS_TIMER
-+	case led_timer:		/* Every 50 timer ticks */
-+		at91_led_toggle(at91_leds_timer);
-+		break;
-+#endif
-+
-+#ifdef CONFIG_LEDS_CPU
-+	case led_idle_start:	/* Entering idle state */
-+		at91_led_toggle(at91_leds_timer);
-+		break;
-+
-+	case led_idle_end:	/* Exit idle state */
-+		at91_led_toggle(at91_leds_timer);
-+		break;
-+#endif
-+
-+	default:
-+		break;
-+	}
-+
-+	local_irq_restore(flags);
-+}
-+
-+
-+static int __init leds_init(void)
-+{
-+	if (!at91_leds_timer || !at91_leds_cpu)
-+		return -ENODEV;
-+
-+	leds_event = at91_leds_event;
-+
-+	leds_event(led_start);
-+	return 0;
-+}
-+
-+__initcall(leds_init);

+ 0 - 363
target/linux/at91/patches-2.6.21/003-gpio-driver.patch

@@ -1,363 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/mach-at91/gpio.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/gpio.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/gpio.c
-@@ -27,6 +27,7 @@
- 
- static struct at91_gpio_bank *gpio;
- static int gpio_banks;
-+static u32 pio_gpio_pin[4] = { 0, 0, 0, 0 };
- 
- 
- static inline void __iomem *pin_to_controller(unsigned pin)
-@@ -71,9 +72,13 @@ int __init_or_module at91_set_GPIO_perip
- {
- 	void __iomem	*pio = pin_to_controller(pin);
- 	unsigned	mask = pin_to_mask(pin);
-+	int bank = (pin - PIN_BASE) / 32;
- 
- 	if (!pio)
- 		return -EINVAL;
-+
-+	pio_gpio_pin[bank] |= mask;
-+
- 	__raw_writel(mask, pio + PIO_IDR);
- 	__raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
- 	__raw_writel(mask, pio + PIO_PER);
-@@ -130,10 +135,13 @@ int __init_or_module at91_set_gpio_input
- {
- 	void __iomem	*pio = pin_to_controller(pin);
- 	unsigned	mask = pin_to_mask(pin);
-+	int bank = (pin - PIN_BASE) / 32;
- 
- 	if (!pio)
- 		return -EINVAL;
- 
-+	pio_gpio_pin[bank] |= mask;
-+
- 	__raw_writel(mask, pio + PIO_IDR);
- 	__raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
- 	__raw_writel(mask, pio + PIO_ODR);
-@@ -151,10 +159,13 @@ int __init_or_module at91_set_gpio_outpu
- {
- 	void __iomem	*pio = pin_to_controller(pin);
- 	unsigned	mask = pin_to_mask(pin);
-+	int bank = (pin - PIN_BASE) / 32;
- 
- 	if (!pio)
- 		return -EINVAL;
- 
-+	pio_gpio_pin[bank] |= mask;
-+
- 	__raw_writel(mask, pio + PIO_IDR);
- 	__raw_writel(mask, pio + PIO_PUDR);
- 	__raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
-@@ -262,6 +273,18 @@ int at91_get_gpio_value(unsigned pin)
- }
- EXPORT_SYMBOL(at91_get_gpio_value);
- 
-+int at91_is_pin_gpio(unsigned pin)
-+{
-+  void __iomem  *pio = pin_to_controller(pin);
-+  unsigned  mask = pin_to_mask(pin);
-+  int     bank = (pin - PIN_BASE) / 32;
-+
-+  if (!pio)
-+    return -EINVAL;
-+  return (pio_gpio_pin[bank] & mask) != 0;
-+}
-+EXPORT_SYMBOL(at91_is_pin_gpio);
-+
- /*--------------------------------------------------------------------------*/
- 
- #ifdef CONFIG_PM
-Index: linux-2.6.21.7/drivers/char/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/char/Kconfig
-+++ linux-2.6.21.7/drivers/char/Kconfig
-@@ -1087,5 +1087,12 @@ config AT91_SPIDEV
- 	  The SPI driver gives user mode access to this serial
- 	  bus on the AT91RM9200 processor.
- 
-+config AT91_VLIO
-+  tristate "Versalink LED and GPIO interface"
-+  depends on ARCH_AT91RM9200 && MACH_VLINK
-+  default n
-+  help
-+    Provides a handler GPIO's in userspace
-+
- endmenu
- 
-Index: linux-2.6.21.7/drivers/char/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/char/Makefile
-+++ linux-2.6.21.7/drivers/char/Makefile
-@@ -95,6 +95,7 @@ obj-$(CONFIG_TANBAC_TB0219)	+= tb0219.o
- obj-$(CONFIG_TELCLOCK)		+= tlclk.o
- obj-$(CONFIG_AT91_SPI)		+= at91_spi.o
- obj-$(CONFIG_AT91_SPIDEV)	+= at91_spidev.o
-+obj-$(CONFIG_AT91_VLIO)  += vlink_giu.o
- 
- obj-$(CONFIG_WATCHDOG)		+= watchdog/
- obj-$(CONFIG_MWAVE)		+= mwave/
-Index: linux-2.6.21.7/drivers/char/vlink_giu.c
-===================================================================
---- /dev/null
-+++ linux-2.6.21.7/drivers/char/vlink_giu.c
-@@ -0,0 +1,256 @@
-+/*
-+ *  Driver for FDL Versalink GPIO
-+ *
-+ *  Copyright (C) 2005 Guthrie Consulting
-+ *	Author: Hamish Guthrie <[email protected]>
-+ *
-+ *  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/module.h>
-+#include <linux/moduleparam.h>
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/kernel.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/errno.h>
-+#include <linux/init.h>
-+#include <linux/types.h>
-+#include <linux/proc_fs.h>
-+#include <linux/fcntl.h>
-+#include <linux/seq_file.h>
-+#include <linux/cdev.h>
-+#include <asm/arch/gpio.h>
-+#include <asm/uaccess.h>
-+
-+static int major;	/* default is dynamic major device number */
-+module_param(major, int, 0);
-+MODULE_PARM_DESC(major, "Major device number");
-+
-+#define VIO_NR_DEVS 96
-+
-+struct vio_dev {
-+	struct cdev cdev;
-+};
-+
-+struct vio_dev *vio_devices;
-+static struct class *vio_class;
-+
-+static ssize_t gpio_read(struct file *file, char __user *buf, size_t len,
-+                         loff_t *ppos)
-+{
-+	unsigned int pin;
-+	int retval;
-+	char value = '0';
-+
-+	pin = iminor(file->f_dentry->d_inode);
-+
-+	retval = at91_get_gpio_value(PIN_BASE + pin);
-+	if (retval < 0)
-+		return -EFAULT;
-+
-+	value = retval + 0x30;
-+	if (put_user(value, buf))
-+		return -EFAULT;
-+
-+	return 1;
-+}
-+
-+static ssize_t gpio_write(struct file *file, const char __user *data,
-+                          size_t len, loff_t *ppos)
-+{
-+	unsigned int pin;
-+	size_t i;
-+	char c;
-+	int retval = 0;
-+
-+	pin = iminor(file->f_dentry->d_inode);
-+
-+	for (i = 0; i < len; i++) {
-+		if (get_user(c, data + i))
-+			return -EFAULT;
-+
-+		switch (c) {
-+		case '0':
-+		case '1':
-+			retval = at91_set_gpio_value(PIN_BASE + pin, (int)c - 0x30);
-+			if (retval < 0)
-+				return -EFAULT;
-+			break;
-+		default:
-+			break;
-+		}
-+
-+		if (retval < 0)
-+			break;
-+	}
-+
-+	return i;
-+}
-+
-+static int gpio_open(struct inode *inode, struct file *file)
-+{
-+	return nonseekable_open(inode, file);
-+}
-+
-+static int gpio_release(struct inode *inode, struct file *file)
-+{
-+	return 0;
-+}
-+
-+static struct file_operations vio_fops = {
-+	.owner		= THIS_MODULE,
-+	.read		= gpio_read,
-+	.write		= gpio_write,
-+	.open		= gpio_open,
-+	.release	= gpio_release,
-+};
-+
-+static void vio_setup_cdev(struct vio_dev *dev, int index)
-+{
-+	int err, devno = MKDEV(major, index);
-+
-+	cdev_init(&dev->cdev, &vio_fops);
-+	dev->cdev.owner = THIS_MODULE;
-+	dev->cdev.ops = &vio_fops;
-+	err = cdev_add (&dev->cdev, devno, 1);
-+	if (err)
-+		printk(KERN_NOTICE "vio: Error %d adding vio%d", err, index);
-+}
-+
-+static int vio_remove(struct platform_device *dev)
-+{
-+	int i;
-+	dev_t devno = MKDEV(major, 0);
-+
-+	if (vio_devices) {
-+		for(i=0; i<VIO_NR_DEVS; i++) {
-+			int iodev = at91_is_pin_gpio(PIN_BASE + i);
-+			if (iodev) {
-+				cdev_del(&vio_devices[i].cdev);
-+				class_device_destroy(vio_class, MKDEV(major, i));
-+			}
-+		}
-+		kfree(vio_devices);
-+	}
-+
-+	class_destroy(vio_class);
-+	unregister_chrdev_region(devno, VIO_NR_DEVS);
-+
-+	platform_set_drvdata(dev, NULL);
-+
-+	return 0;
-+}
-+
-+static int vio_probe(struct platform_device *dev)
-+{
-+	int retval, i, j;
-+	dev_t vdev = 0;
-+
-+	if (major) {
-+		vdev = MKDEV(major, 0);
-+		retval = register_chrdev_region(vdev, VIO_NR_DEVS, "vio");
-+	} else {
-+		retval = alloc_chrdev_region(&vdev, 0, VIO_NR_DEVS, "vio");
-+		major = MAJOR(vdev);
-+	}
-+	if (retval < 0) {
-+		printk(KERN_WARNING "vio: can't get major %d\n", major);
-+		return retval;
-+	}
-+
-+	if (major == 0) {
-+		major = retval;
-+		printk(KERN_INFO "vio: major number %d\n", major);
-+	}
-+
-+	vio_class = class_create(THIS_MODULE, "vio");
-+
-+	if (IS_ERR(vio_class)) {
-+		printk(KERN_ERR "vio: Error creating vio class\n");
-+		vio_remove(dev);
-+		return PTR_ERR(vio_class);
-+	}
-+
-+	vio_devices = kmalloc(VIO_NR_DEVS * sizeof(struct vio_dev), GFP_KERNEL);
-+	if (!vio_devices) {
-+		retval = -ENOMEM;
-+		goto fail;
-+	}
-+	memset(vio_devices, 0, VIO_NR_DEVS * sizeof(struct vio_dev));
-+
-+	for (i=0; i<VIO_NR_DEVS/32; i++)
-+		for(j=0; j<32; j++) {
-+			int iodev = at91_is_pin_gpio(PIN_BASE + i*32 + j);
-+			if (iodev) {
-+				vio_setup_cdev(&vio_devices[i*32 + j], i*32 + j);
-+				class_device_create(vio_class, NULL, MKDEV(major, i*32 + j), NULL,
-+					"vio%c%d", i + 'A', j);
-+			}
-+		}
-+
-+	platform_set_drvdata(dev, vio_devices);
-+
-+	return 0;
-+
-+fail:
-+	vio_remove(dev);
-+	return retval;
-+}
-+
-+static struct platform_device *vio_platform_device;
-+
-+static struct platform_driver vio_driver = {
-+	.probe 		= vio_probe,
-+	.remove		= vio_remove,
-+	.driver		= {
-+		.name	= "vio",
-+		.owner	= THIS_MODULE,
-+	},
-+};
-+
-+static int __init vio_init(void)
-+{
-+	int retval;
-+
-+	vio_platform_device = platform_device_register_simple("vio", -1, NULL, 0);
-+	if (IS_ERR(vio_platform_device)) {
-+		printk(KERN_WARNING "vio: device registration failed\n");
-+		return PTR_ERR(vio_platform_device);
-+	}
-+
-+	retval = platform_driver_register(&vio_driver);
-+	if (retval < 0) {
-+		printk(KERN_WARNING "vio: driver registration failed\n");
-+		platform_device_unregister(vio_platform_device);
-+	}
-+	
-+	return retval;
-+}
-+
-+static void __exit vio_exit(void)
-+{
-+	platform_driver_unregister(&vio_driver);
-+	platform_device_unregister(vio_platform_device);
-+}
-+
-+module_init(vio_init);
-+module_exit(vio_exit);
-+
-+MODULE_AUTHOR("Hamish Guthrie <[email protected]>");
-+MODULE_DESCRIPTION("FDL Versalink GPIO Driver");
-+MODULE_LICENSE("GPL");

+ 0 - 38
target/linux/at91/patches-2.6.21/006-change-gpios.patch

@@ -1,38 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-vlink.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-@@ -149,6 +149,33 @@ static void __init vlink_board_init(void
- #endif
- 	/* LEDs */
- //	at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
-+
-+/* Other LED's */
-+       at91_set_gpio_output(AT91_PIN_PC7, 1);  // LED FRONT AP1
-+       at91_set_gpio_output(AT91_PIN_PC8, 1);  // LED FRONT BP1
-+       at91_set_gpio_output(AT91_PIN_PB14, 1); // LED BACK AP1
-+       at91_set_gpio_output(AT91_PIN_PB15, 1); // LED BACK BP1
-+       at91_set_gpio_output(AT91_PIN_PB16, 1); // LED BACK AP2
-+       at91_set_gpio_output(AT91_PIN_PB17, 1); // LED BACK BP2
-+
-+/* SIM Cards */
-+       at91_set_gpio_output(AT91_PIN_PB9, 1);  // ENBSC3
-+       at91_set_gpio_output(AT91_PIN_PB10, 1); // ENBSC2
-+       at91_set_gpio_output(AT91_PIN_PB11, 1); // ENBSC1
-+
-+/* GSM Module Control */
-+       at91_set_gpio_output(AT91_PIN_PB12, 1); // GSMONOFF
-+
-+/* Test jig presence detection */
-+       at91_set_gpio_input(AT91_PIN_PB8, 1);   // JIGPRESENT
-+
-+/* Power indicator */
-+       at91_set_gpio_input(AT91_PIN_PB22, 1);  // PWR_IND
-+
-+/* USB Device control */
-+       at91_set_gpio_input(AT91_PIN_PB27, 1);  // UDB_CNX
-+       at91_set_gpio_output(AT91_PIN_PB28, 1); // UDB_PUP
-+
- }
- 
- MACHINE_START(VLINK, "FDL VersaLink")

+ 0 - 42
target/linux/at91/patches-2.6.21/007-mtd-partition.patch

@@ -1,42 +0,0 @@
-Index: linux-2.6.21.7/drivers/mtd/devices/at91_dataflash.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/mtd/devices/at91_dataflash.c
-+++ linux-2.6.21.7/drivers/mtd/devices/at91_dataflash.c
-@@ -173,7 +173,7 @@ static struct mtd_partition static_parti
- };
- #endif
- 
--static const char *part_probes[] = { "cmdlinepart", NULL, };
-+static const char *part_probes[] = { "cmdlinepart", "at91part", NULL, };
- 
- #endif
- 
-Index: linux-2.6.21.7/drivers/mtd/Kconfig
-===================================================================
---- linux-2.6.21.7.orig/drivers/mtd/Kconfig
-+++ linux-2.6.21.7/drivers/mtd/Kconfig
-@@ -162,6 +162,12 @@ config MTD_AFS_PARTS
- 	  for your particular device. It won't happen automatically. The
- 	  'armflash' map driver (CONFIG_MTD_ARMFLASH) does this, for example.
- 
-+config MTD_AT91_PARTS
-+ tristate "Atmel AT91 partitioning support"
-+ depends on MTD_PARTITIONS && ARCH_AT91RM9200 && AT91_SPI
-+ ---help---
-+   Atmel AT91 partitioning support
-+
- comment "User Modules And Translation Layers"
- 	depends on MTD
- 
-Index: linux-2.6.21.7/drivers/mtd/Makefile
-===================================================================
---- linux-2.6.21.7.orig/drivers/mtd/Makefile
-+++ linux-2.6.21.7/drivers/mtd/Makefile
-@@ -12,6 +12,7 @@ obj-$(CONFIG_MTD_CONCAT)	+= mtdconcat.o
- obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
- obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
- obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
-+obj-$(CONFIG_MTD_AT91_PARTS) += at91part.o
- 
- # 'Users' - code which presents functionality to userspace.
- obj-$(CONFIG_MTD_CHAR)		+= mtdchar.o

+ 0 - 162
target/linux/at91/patches-2.6.21/008-fdl-serial.patch

@@ -1,162 +0,0 @@
-Index: linux-2.6.21.7/drivers/serial/atmel_serial.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/serial/atmel_serial.c
-+++ linux-2.6.21.7/drivers/serial/atmel_serial.c
-@@ -174,7 +174,35 @@ static void atmel_set_mctrl(struct uart_
- 				at91_set_gpio_value(AT91_PIN_PA21, 0);
- 			else
- 				at91_set_gpio_value(AT91_PIN_PA21, 1);
-+
-+      /*
-+       * FDL VersaLink adds GPIOS to provide full modem control on
-+       * USART 0 - Drive DTR and RI pins manually
-+       */
-+      if (mctrl & TIOCM_DTR)
-+        at91_set_gpio_value(AT91_PIN_PB6, 0);
-+      else
-+        at91_set_gpio_value(AT91_PIN_PB6, 1);
-+      if (mctrl & TIOCM_RI)
-+        at91_set_gpio_value(AT91_PIN_PB7, 0);
-+      else
-+        at91_set_gpio_value(AT91_PIN_PB7, 1);
- 		}
-+
-+    /*
-+     * FDL VersaLink adds GPIOS to provide full modem control on
-+     * USART 3 - Drive DTR and RI pins manually
-+     */
-+    if (port->mapbase == AT91RM9200_BASE_US3) {
-+      if (mctrl & TIOCM_DTR)
-+        at91_set_gpio_value(AT91_PIN_PB29, 0);
-+      else
-+        at91_set_gpio_value(AT91_PIN_PB29, 1);
-+      if (mctrl & TIOCM_RI)
-+        at91_set_gpio_value(AT91_PIN_PB2, 0);
-+      else
-+        at91_set_gpio_value(AT91_PIN_PB2, 1);
-+    }
- 	}
- #endif
- 
-@@ -211,8 +239,10 @@ static u_int atmel_get_mctrl(struct uart
- 	/*
- 	 * The control signals are active low.
- 	 */
--	if (!(status & ATMEL_US_DCD))
--		ret |= TIOCM_CD;
-+
-+  if (!(port->mapbase == AT91RM9200_BASE_US0 || port->mapbase == AT91RM9200_BASE_US3))
-+		if (!(status & ATMEL_US_DCD))
-+			ret |= TIOCM_CD;
- 	if (!(status & ATMEL_US_CTS))
- 		ret |= TIOCM_CTS;
- 	if (!(status & ATMEL_US_DSR))
-@@ -220,6 +250,16 @@ static u_int atmel_get_mctrl(struct uart
- 	if (!(status & ATMEL_US_RI))
- 		ret |= TIOCM_RI;
- 
-+  /*
-+   * Read the GPIO's for the FDL VersaLink special case
-+   */
-+  if (port->mapbase == AT91RM9200_BASE_US0)
-+    if (!(at91_get_gpio_value(AT91_PIN_PA19)))
-+      ret |= TIOCM_CD;
-+  if (port->mapbase == AT91RM9200_BASE_US3)
-+    if (!(at91_get_gpio_value(AT91_PIN_PA24)))
-+      ret |= TIOCM_CD;
-+
- 	return ret;
- }
- 
-@@ -511,6 +551,34 @@ static void atmel_tx_chars(struct uart_p
- }
- 
- /*
-+ * USART0 DCD Interrupt handler
-+ */
-+
-+static irqreturn_t atmel_u0_DCD_interrupt(int irq, void *dev_id)
-+{
-+  struct uart_port *port = dev_id;
-+  int status = at91_get_gpio_value(irq);
-+
-+  uart_handle_dcd_change(port, !(status));
-+
-+  return IRQ_HANDLED;
-+}
-+
-+/*
-+ * USART3 DCD Interrupt handler
-+ */
-+
-+static irqreturn_t atmel_u3_DCD_interrupt(int irq, void *dev_id)
-+{
-+  struct uart_port *port = dev_id;
-+  int status = at91_get_gpio_value(irq);
-+
-+  uart_handle_dcd_change(port, !(status));
-+
-+  return IRQ_HANDLED;
-+}
-+
-+/*
-  * Interrupt handler
-  */
- static irqreturn_t atmel_interrupt(int irq, void *dev_id)
-@@ -587,6 +655,23 @@ static int atmel_startup(struct uart_por
- 		return retval;
- 	}
- 
-+	if (port->mapbase == AT91RM9200_BASE_US0) {
-+		retval = request_irq(AT91_PIN_PA19, atmel_u0_DCD_interrupt, 0, "atmel_serial", port);
-+		if (retval) {
-+			printk("atmel_serial: atmel_startup - Can't get u0DCD irq\n");
-+			free_irq(port->irq, port);
-+			return retval;
-+		}
-+	}
-+	if (port->mapbase == AT91RM9200_BASE_US3) {
-+		retval = request_irq(AT91_PIN_PA24, atmel_u3_DCD_interrupt, 0, "atmel_serial", port);
-+		if (retval) {
-+			printk("atmel_serial: atmel_startup - Can't get u3DCD irq\n");
-+			free_irq(port->irq, port);
-+			return retval;
-+		}
-+	}
-+
- 	/*
- 	 * Initialize DMA (if necessary)
- 	 */
-@@ -603,6 +688,10 @@ static int atmel_startup(struct uart_por
- 					kfree(atmel_port->pdc_rx[0].buf);
- 				}
- 				free_irq(port->irq, port);
-+        if (port->mapbase == AT91RM9200_BASE_US0)
-+          free_irq(AT91_PIN_PA19, port);
-+        if (port->mapbase == AT91RM9200_BASE_US3)
-+          free_irq(AT91_PIN_PA24, port);
- 				return -ENOMEM;
- 			}
- 			pdc->dma_addr = dma_map_single(port->dev, pdc->buf, PDC_BUFFER_SIZE, DMA_FROM_DEVICE);
-@@ -636,6 +725,10 @@ static int atmel_startup(struct uart_por
- 		retval = atmel_open_hook(port);
- 		if (retval) {
- 			free_irq(port->irq, port);
-+      if (port->mapbase == AT91RM9200_BASE_US0)
-+        free_irq(AT91_PIN_PA19, port);
-+      if (port->mapbase == AT91RM9200_BASE_US3)
-+        free_irq(AT91_PIN_PA24, port);
- 			return retval;
- 		}
- 	}
-@@ -701,6 +794,10 @@ static void atmel_shutdown(struct uart_p
- 	 * Free the interrupt
- 	 */
- 	free_irq(port->irq, port);
-+  if (port->mapbase == AT91RM9200_BASE_US0)
-+    free_irq(AT91_PIN_PA19, port);
-+  if (port->mapbase == AT91RM9200_BASE_US3)
-+    free_irq(AT91_PIN_PA24, port);
- 
- 	/*
- 	 * If there is a specific "close" function (to unregister

+ 0 - 36
target/linux/at91/patches-2.6.21/009-fdl-uartinit.patch

@@ -1,36 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91rm9200_devices.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
-@@ -618,7 +618,6 @@ void __init at91_init_leds(u8 cpu_led, u
- 
- 
- #if defined(CONFIG_NEW_LEDS)
--
- static struct platform_device at91_leds = {
- 	.name		= "at91_leds",
- 	.id		= -1,
-@@ -724,6 +723,10 @@ static inline void configure_usart0_pins
- 	 *  We need to drive the pin manually.  Default is off (RTS is active low).
- 	 */
- 	at91_set_gpio_output(AT91_PIN_PA21, 1);
-+	at91_set_gpio_output(AT91_PIN_PB6, 1);  /* DTR0 */
-+	at91_set_gpio_output(AT91_PIN_PB7, 1);  /* RI0 */
-+	at91_set_gpio_input(AT91_PIN_PA19, 1);  /* DCD0 */
-+	at91_set_deglitch(AT91_PIN_PA19, 1);
- }
- 
- static struct resource uart1_resources[] = {
-@@ -835,6 +838,12 @@ static inline void configure_usart3_pins
- {
- 	at91_set_B_periph(AT91_PIN_PA5, 1);		/* TXD3 */
- 	at91_set_B_periph(AT91_PIN_PA6, 0);		/* RXD3 */
-+	at91_set_B_periph(AT91_PIN_PB0, 0);   /* RTS3 */
-+	at91_set_B_periph(AT91_PIN_PB1, 0);   /* CTS3 */
-+	at91_set_gpio_output(AT91_PIN_PB29, 1); /* DTR0 */
-+	at91_set_gpio_output(AT91_PIN_PB2, 1);  /* RI0 */
-+	at91_set_gpio_input(AT91_PIN_PA24, 1);  /* DCD0 */
-+	at91_set_deglitch(AT91_PIN_PA24, 1);
- }
- 
- struct platform_device *at91_uarts[ATMEL_MAX_UART];	/* the UARTs to use */

+ 0 - 30
target/linux/at91/patches-2.6.21/010-dm9161a-phyfix.patch

@@ -1,30 +0,0 @@
-Index: linux-2.6.21.7/drivers/net/arm/at91_ether.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/net/arm/at91_ether.c
-+++ linux-2.6.21.7/drivers/net/arm/at91_ether.c
-@@ -146,6 +146,7 @@ static void update_linkspeed(struct net_
- 	struct at91_private *lp = netdev_priv(dev);
- 	unsigned int bmsr, bmcr, lpa, mac_cfg;
- 	unsigned int speed, duplex;
-+	unsigned long timeout = jiffies + HZ;
- 
- 	if (!mii_link_ok(&lp->mii)) {		/* no link */
- 		netif_carrier_off(dev);
-@@ -158,8 +159,15 @@ static void update_linkspeed(struct net_
- 	read_phy(lp->phy_address, MII_BMSR, &bmsr);
- 	read_phy(lp->phy_address, MII_BMCR, &bmcr);
- 	if (bmcr & BMCR_ANENABLE) {				/* AutoNegotiation is enabled */
--		if (!(bmsr & BMSR_ANEGCOMPLETE))
--			return;			/* Do nothing - another interrupt generated when negotiation complete */
-+		while (!(bmsr & BMSR_ANEGCOMPLETE)) {
-+			if (time_after(jiffies, timeout)) {
-+				printk("at91_ether: Auto-negotiate timeout\n");
-+				return;
-+			}
-+			read_phy(lp->phy_address, MII_BMSR, &bmsr);
-+			read_phy(lp->phy_address, MII_BMCR, &bmcr);
-+			cpu_relax();
-+		}
- 
- 		read_phy(lp->phy_address, MII_LPA, &lpa);
- 		if ((lpa & LPA_100FULL) || (lpa & LPA_100HALF)) speed = SPEED_100;

+ 0 - 12
target/linux/at91/patches-2.6.21/011-vlink-resetfix.patch

@@ -1,12 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-vlink.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-@@ -175,6 +175,7 @@ static void __init vlink_board_init(void
- /* USB Device control */
-        at91_set_gpio_input(AT91_PIN_PB27, 1);  // UDB_CNX
-        at91_set_gpio_output(AT91_PIN_PB28, 1); // UDB_PUP
-+			 at91_set_multi_drive(AT91_PIN_PB28, 1); // Set to multi-drive
- 
- }
- 

+ 0 - 426
target/linux/at91/patches-2.6.21/012-at91-mmcfix.patch

@@ -1,426 +0,0 @@
-Index: linux-2.6.21.7/drivers/mmc/at91_mci.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/mmc/at91_mci.c
-+++ linux-2.6.21.7/drivers/mmc/at91_mci.c
-@@ -79,7 +79,8 @@
- 
- #define DRIVER_NAME "at91_mci"
- 
--#undef	SUPPORT_4WIRE
-+//#undef	SUPPORT_4WIRE
-+#define 	SUPPORT_4WIRE
- 
- #define FL_SENT_COMMAND	(1 << 0)
- #define FL_SENT_STOP	(1 << 1)
-@@ -132,7 +133,7 @@ struct at91mci_host
- /*
-  * Copy from sg to a dma block - used for transfers
-  */
--static inline void at91mci_sg_to_dma(struct at91mci_host *host, struct mmc_data *data)
-+static inline void at91_mci_sg_to_dma(struct at91mci_host *host, struct mmc_data *data)
- {
- 	unsigned int len, i, size;
- 	unsigned *dmabuf = host->buffer;
-@@ -181,7 +182,7 @@ static inline void at91mci_sg_to_dma(str
- /*
-  * Prepare a dma read
-  */
--static void at91mci_pre_dma_read(struct at91mci_host *host)
-+static void at91_mci_pre_dma_read(struct at91mci_host *host)
- {
- 	int i;
- 	struct scatterlist *sg;
-@@ -249,23 +250,24 @@ static void at91mci_pre_dma_read(struct 
- /*
-  * Handle after a dma read
-  */
--static void at91mci_post_dma_read(struct at91mci_host *host)
-+static int at91_mci_post_dma_read(struct at91mci_host *host)
- {
- 	struct mmc_command *cmd;
- 	struct mmc_data *data;
-+	int completed = 0;
- 
- 	pr_debug("post dma read\n");
- 
- 	cmd = host->cmd;
- 	if (!cmd) {
- 		pr_debug("no command\n");
--		return;
-+		return 1;
- 	}
- 
- 	data = cmd->data;
- 	if (!data) {
- 		pr_debug("no data\n");
--		return;
-+		return 1;
- 	}
- 
- 	while (host->in_use_index < host->transfer_index) {
-@@ -300,39 +302,14 @@ static void at91mci_post_dma_read(struct
- 
- 	/* Is there another transfer to trigger? */
- 	if (host->transfer_index < data->sg_len)
--		at91mci_pre_dma_read(host);
-+		at91_mci_pre_dma_read(host);
- 	else {
-+		at91_mci_write(host, AT91_MCI_IDR, AT91_MCI_ENDRX);
- 		at91_mci_write(host, AT91_MCI_IER, AT91_MCI_RXBUFF);
--		at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
- 	}
- 
- 	pr_debug("post dma read done\n");
--}
--
--/*
-- * Handle transmitted data
-- */
--static void at91_mci_handle_transmitted(struct at91mci_host *host)
--{
--	struct mmc_command *cmd;
--	struct mmc_data *data;
--
--	pr_debug("Handling the transmit\n");
--
--	/* Disable the transfer */
--	at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
--
--	/* Now wait for cmd ready */
--	at91_mci_write(host, AT91_MCI_IDR, AT91_MCI_TXBUFE);
--	at91_mci_write(host, AT91_MCI_IER, AT91_MCI_NOTBUSY);
--
--	cmd = host->cmd;
--	if (!cmd) return;
--
--	data = cmd->data;
--	if (!data) return;
--
--	data->bytes_xfered = host->total_length;
-+	return completed;
- }
- 
- /*
-@@ -340,10 +317,17 @@ static void at91_mci_handle_transmitted(
-  */
- static void at91_mci_enable(struct at91mci_host *host)
- {
-+	unsigned int mr;
-+
- 	at91_mci_write(host, AT91_MCI_CR, AT91_MCI_MCIEN);
- 	at91_mci_write(host, AT91_MCI_IDR, 0xffffffff);
- 	at91_mci_write(host, AT91_MCI_DTOR, AT91_MCI_DTOMUL_1M | AT91_MCI_DTOCYC);
--	at91_mci_write(host, AT91_MCI_MR, AT91_MCI_PDCMODE | 0x34a);
-+	mr = AT91_MCI_PDCMODE | 0x34a;
-+
-+	if (cpu_is_at91sam9260() || cpu_is_at91sam9263())
-+		mr |= AT91_MCI_RDPROOF | AT91_MCI_WRPROOF;
-+
-+	at91_mci_write(host, AT91_MCI_MR, mr);
- 
- 	/* use Slot A or B (only one at same time) */
- 	at91_mci_write(host, AT91_MCI_SDCR, host->board->slot_b);
-@@ -359,9 +343,8 @@ static void at91_mci_disable(struct at91
- 
- /*
-  * Send a command
-- * return the interrupts to enable
-  */
--static unsigned int at91_mci_send_command(struct at91mci_host *host, struct mmc_command *cmd)
-+static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command *cmd)
- {
- 	unsigned int cmdr, mr;
- 	unsigned int block_length;
-@@ -372,8 +355,7 @@ static unsigned int at91_mci_send_comman
- 
- 	host->cmd = cmd;
- 
--	/* Not sure if this is needed */
--#if 0
-+	/* Needed for leaving busy state before CMD1 */
- 	if ((at91_mci_read(host, AT91_MCI_SR) & AT91_MCI_RTOE) && (cmd->opcode == 1)) {
- 		pr_debug("Clearing timeout\n");
- 		at91_mci_write(host, AT91_MCI_ARGR, 0);
-@@ -383,7 +365,7 @@ static unsigned int at91_mci_send_comman
- 			pr_debug("Clearing: SR = %08X\n", at91_mci_read(host, AT91_MCI_SR));
- 		}
- 	}
--#endif
-+
- 	cmdr = cmd->opcode;
- 
- 	if (mmc_resp_type(cmd) == MMC_RSP_NONE)
-@@ -440,50 +422,48 @@ static unsigned int at91_mci_send_comman
- 		at91_mci_write(host, ATMEL_PDC_TCR, 0);
- 		at91_mci_write(host, ATMEL_PDC_TNPR, 0);
- 		at91_mci_write(host, ATMEL_PDC_TNCR, 0);
-+		ier = AT91_MCI_CMDRDY;
-+	} else {
-+		/* zero block length in PDC mode */
-+		mr = at91_mci_read(host, AT91_MCI_MR) & 0x7fff;
-+		at91_mci_write(host, AT91_MCI_MR, mr | (block_length << 16) | AT91_MCI_PDCMODE);
-+
-+		/*
-+		 * Disable the PDC controller
-+		 */
-+		at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
- 
--		at91_mci_write(host, AT91_MCI_ARGR, cmd->arg);
--		at91_mci_write(host, AT91_MCI_CMDR, cmdr);
--		return AT91_MCI_CMDRDY;
--	}
--
--	mr = at91_mci_read(host, AT91_MCI_MR) & 0x7fff;	/* zero block length and PDC mode */
--	at91_mci_write(host, AT91_MCI_MR, mr | (block_length << 16) | AT91_MCI_PDCMODE);
--
--	/*
--	 * Disable the PDC controller
--	 */
--	at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
--
--	if (cmdr & AT91_MCI_TRCMD_START) {
--		data->bytes_xfered = 0;
--		host->transfer_index = 0;
--		host->in_use_index = 0;
--		if (cmdr & AT91_MCI_TRDIR) {
--			/*
--			 * Handle a read
--			 */
--			host->buffer = NULL;
--			host->total_length = 0;
-+		if (cmdr & AT91_MCI_TRCMD_START) {
-+			data->bytes_xfered = 0;
-+			host->transfer_index = 0;
-+			host->in_use_index = 0;
-+			if (cmdr & AT91_MCI_TRDIR) {
-+				/*
-+				 * Handle a read
-+				 */
-+				host->buffer = NULL;
-+				host->total_length = 0;
- 
--			at91mci_pre_dma_read(host);
--			ier = AT91_MCI_ENDRX /* | AT91_MCI_RXBUFF */;
--		}
--		else {
--			/*
--			 * Handle a write
--			 */
--			host->total_length = block_length * blocks;
--			host->buffer = dma_alloc_coherent(NULL,
--						  host->total_length,
--						  &host->physical_address, GFP_KERNEL);
--
--			at91mci_sg_to_dma(host, data);
--
--			pr_debug("Transmitting %d bytes\n", host->total_length);
--
--			at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address);
--			at91_mci_write(host, ATMEL_PDC_TCR, host->total_length / 4);
--			ier = AT91_MCI_TXBUFE;
-+				at91_mci_pre_dma_read(host);
-+				ier = AT91_MCI_ENDRX /* | AT91_MCI_RXBUFF */;
-+			}
-+			else {
-+				/*
-+			 	* Handle a write
-+			 	*/
-+				host->total_length = block_length * blocks;
-+				host->buffer = dma_alloc_coherent(NULL,
-+							host->total_length,
-+							&host->physical_address, GFP_KERNEL);
-+
-+				at91_mci_sg_to_dma(host, data);
-+
-+				pr_debug("Transmitting %d bytes\n", host->total_length);
-+
-+				at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address);
-+				at91_mci_write(host, ATMEL_PDC_TCR, host->total_length / 4);
-+				ier = AT91_MCI_CMDRDY;
-+			}
- 		}
- 	}
- 
-@@ -498,39 +478,24 @@ static unsigned int at91_mci_send_comman
- 	if (cmdr & AT91_MCI_TRCMD_START) {
- 		if (cmdr & AT91_MCI_TRDIR)
- 			at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTEN);
--		else
--			at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_TXTEN);
- 	}
--	return ier;
--}
- 
--/*
-- * Wait for a command to complete
-- */
--static void at91mci_process_command(struct at91mci_host *host, struct mmc_command *cmd)
--{
--	unsigned int ier;
--
--	ier = at91_mci_send_command(host, cmd);
--
--	pr_debug("setting ier to %08X\n", ier);
--
--	/* Stop on errors or the required value */
-+	/* Enable selected interrupts */
- 	at91_mci_write(host, AT91_MCI_IER, AT91_MCI_ERRORS | ier);
- }
- 
- /*
-  * Process the next step in the request
-  */
--static void at91mci_process_next(struct at91mci_host *host)
-+static void at91_mci_process_next(struct at91mci_host *host)
- {
- 	if (!(host->flags & FL_SENT_COMMAND)) {
- 		host->flags |= FL_SENT_COMMAND;
--		at91mci_process_command(host, host->request->cmd);
-+		at91_mci_send_command(host, host->request->cmd);
- 	}
- 	else if ((!(host->flags & FL_SENT_STOP)) && host->request->stop) {
- 		host->flags |= FL_SENT_STOP;
--		at91mci_process_command(host, host->request->stop);
-+		at91_mci_send_command(host, host->request->stop);
- 	}
- 	else
- 		mmc_request_done(host->mmc, host->request);
-@@ -539,7 +504,7 @@ static void at91mci_process_next(struct 
- /*
-  * Handle a command that has been completed
-  */
--static void at91mci_completed_command(struct at91mci_host *host)
-+static void at91_mci_completed_command(struct at91mci_host *host)
- {
- 	struct mmc_command *cmd = host->cmd;
- 	unsigned int status;
-@@ -583,7 +548,7 @@ static void at91mci_completed_command(st
- 	else
- 		cmd->error = MMC_ERR_NONE;
- 
--	at91mci_process_next(host);
-+	at91_mci_process_next(host);
- }
- 
- /*
-@@ -595,7 +560,60 @@ static void at91_mci_request(struct mmc_
- 	host->request = mrq;
- 	host->flags = 0;
- 
--	at91mci_process_next(host);
-+	at91_mci_process_next(host);
-+}
-+
-+/*
-+ * Handle transmitted data
-+ */
-+static void at91_mci_handle_transmitted(struct at91mci_host *host)
-+{
-+	struct mmc_command *cmd;
-+	struct mmc_data *data;
-+
-+	pr_debug("Handling the transmit\n");
-+
-+	/* Disable the transfer */
-+	at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
-+
-+	/* Now wait for cmd ready */
-+	at91_mci_write(host, AT91_MCI_IDR, AT91_MCI_TXBUFE);
-+
-+	cmd = host->cmd;
-+	if (!cmd) return;
-+
-+	data = cmd->data;
-+	if (!data) return;
-+
-+	if (cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK) {
-+		pr_debug("multiple write : wait for BLKE...\n");
-+		at91_mci_write(host, AT91_MCI_IER, AT91_MCI_BLKE);
-+	} else
-+		at91_mci_write(host, AT91_MCI_IER, AT91_MCI_NOTBUSY);
-+
-+	data->bytes_xfered = host->total_length;
-+}
-+
-+
-+/*Handle after command sent ready*/
-+static int at91_mci_handle_cmdrdy(struct at91mci_host *host)
-+{
-+	if (!host->cmd)
-+		return 1;
-+	else if (!host->cmd->data) {
-+		if (host->flags & FL_SENT_STOP) {
-+			/*After multi block write, we mus wait for NOTBUSY*/
-+			at91_mci_write(host, AT91_MCI_IER, AT91_MCI_NOTBUSY);
-+		} else return 1;
-+	} else if (host->cmd->data->flags & MMC_DATA_WRITE) {
-+		/*After sending multi-block-write command, start DMA transfer*/
-+		at91_mci_write(host, AT91_MCI_IER, AT91_MCI_TXBUFE);
-+		at91_mci_write(host, AT91_MCI_IER, AT91_MCI_BLKE);
-+		at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_TXTEN);
-+	}
-+
-+	/* command not completed, have to wait */
-+	return 0;
- }
- 
- /*
-@@ -698,29 +716,33 @@ static irqreturn_t at91_mci_irq(int irq,
- 			at91_mci_handle_transmitted(host);
- 		}
- 
-+		if (int_status & AT91_MCI_ENDRX) {
-+			pr_debug("ENDRX\n");
-+			at91_mci_post_dma_read(host);
-+		}
-+
- 		if (int_status & AT91_MCI_RXBUFF) {
- 			pr_debug("RX buffer full\n");
--			at91_mci_write(host, AT91_MCI_IER, AT91_MCI_CMDRDY);
-+			at91_mci_write(host, ATMEL_PDC_PTCR, ATMEL_PDC_RXTDIS | ATMEL_PDC_TXTDIS);
-+			at91_mci_write(host, AT91_MCI_IDR, AT91_MCI_RXBUFF | AT91_MCI_ENDRX);
-+			completed = 1;
- 		}
- 
- 		if (int_status & AT91_MCI_ENDTX)
- 			pr_debug("Transmit has ended\n");
- 
--		if (int_status & AT91_MCI_ENDRX) {
--			pr_debug("Receive has ended\n");
--			at91mci_post_dma_read(host);
--		}
--
- 		if (int_status & AT91_MCI_NOTBUSY) {
- 			pr_debug("Card is ready\n");
--			at91_mci_write(host, AT91_MCI_IER, AT91_MCI_CMDRDY);
-+			completed = 1;
- 		}
- 
- 		if (int_status & AT91_MCI_DTIP)
- 			pr_debug("Data transfer in progress\n");
- 
--		if (int_status & AT91_MCI_BLKE)
-+		if (int_status & AT91_MCI_BLKE) {
- 			pr_debug("Block transfer has ended\n");
-+			completed = 1;
-+		}
- 
- 		if (int_status & AT91_MCI_TXRDY)
- 			pr_debug("Ready to transmit\n");
-@@ -730,14 +752,14 @@ static irqreturn_t at91_mci_irq(int irq,
- 
- 		if (int_status & AT91_MCI_CMDRDY) {
- 			pr_debug("Command ready\n");
--			completed = 1;
-+			completed = at91_mci_handle_cmdrdy(host);
- 		}
- 	}
- 
- 	if (completed) {
- 		pr_debug("Completed command\n");
- 		at91_mci_write(host, AT91_MCI_IDR, 0xffffffff);
--		at91mci_completed_command(host);
-+		at91_mci_completed_command(host);
- 	} else
- 		at91_mci_write(host, AT91_MCI_IDR, int_status);
- 

+ 0 - 14
target/linux/at91/patches-2.6.21/013-at91-mmc1wire.patch

@@ -1,14 +0,0 @@
-Index: linux-2.6.21.7/drivers/mmc/at91_mci.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/mmc/at91_mci.c
-+++ linux-2.6.21.7/drivers/mmc/at91_mci.c
-@@ -79,8 +79,7 @@
- 
- #define DRIVER_NAME "at91_mci"
- 
--//#undef	SUPPORT_4WIRE
--#define 	SUPPORT_4WIRE
-+#undef	SUPPORT_4WIRE
- 
- #define FL_SENT_COMMAND	(1 << 0)
- #define FL_SENT_STOP	(1 << 1)

+ 0 - 20
target/linux/at91/patches-2.6.21/014-initpartition.patch

@@ -1,20 +0,0 @@
-Index: linux-2.6.21.7/drivers/mtd/devices/at91_dataflash.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/mtd/devices/at91_dataflash.c
-+++ linux-2.6.21.7/drivers/mtd/devices/at91_dataflash.c
-@@ -161,12 +161,12 @@ static struct mtd_partition static_parti
- 		.mask_flags	= MTD_WRITEABLE,	/* read-only */
- 	},
- 	{
--		.name		= "kernel",
-+		.name		= "knlroot",
- 		.offset		= MTDPART_OFS_NXTBLK,
--		.size		= 5 * 32 * 8 * 1056,	/* 5 sectors */
-+		.size		= 0x320400,	/* 5 sectors */
- 	},
- 	{
--		.name		= "filesystem",
-+		.name		= "jffs2",
- 		.offset		= MTDPART_OFS_NXTBLK,
- 		.size		= MTDPART_SIZ_FULL,	/* rest = 26 sectors */
- 	}

+ 0 - 69
target/linux/at91/patches-2.6.21/015-simenable.patch

@@ -1,69 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-vlink.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-@@ -150,32 +150,38 @@ static void __init vlink_board_init(void
- 	/* LEDs */
- //	at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
- 
--/* Other LED's */
--       at91_set_gpio_output(AT91_PIN_PC7, 1);  // LED FRONT AP1
--       at91_set_gpio_output(AT91_PIN_PC8, 1);  // LED FRONT BP1
--       at91_set_gpio_output(AT91_PIN_PB14, 1); // LED BACK AP1
--       at91_set_gpio_output(AT91_PIN_PB15, 1); // LED BACK BP1
--       at91_set_gpio_output(AT91_PIN_PB16, 1); // LED BACK AP2
--       at91_set_gpio_output(AT91_PIN_PB17, 1); // LED BACK BP2
--
--/* SIM Cards */
--       at91_set_gpio_output(AT91_PIN_PB9, 1);  // ENBSC3
--       at91_set_gpio_output(AT91_PIN_PB10, 1); // ENBSC2
--       at91_set_gpio_output(AT91_PIN_PB11, 1); // ENBSC1
--
--/* GSM Module Control */
--       at91_set_gpio_output(AT91_PIN_PB12, 1); // GSMONOFF
--
--/* Test jig presence detection */
--       at91_set_gpio_input(AT91_PIN_PB8, 1);   // JIGPRESENT
--
--/* Power indicator */
--       at91_set_gpio_input(AT91_PIN_PB22, 1);  // PWR_IND
--
--/* USB Device control */
--       at91_set_gpio_input(AT91_PIN_PB27, 1);  // UDB_CNX
--       at91_set_gpio_output(AT91_PIN_PB28, 1); // UDB_PUP
--			 at91_set_multi_drive(AT91_PIN_PB28, 1); // Set to multi-drive
-+	/* Other LED's */
-+	at91_set_gpio_output(AT91_PIN_PC7, 1);  // LED FRONT AP1
-+	at91_set_gpio_output(AT91_PIN_PC8, 1);  // LED FRONT BP1
-+	at91_set_gpio_output(AT91_PIN_PB14, 1); // LED BACK AP1
-+	at91_set_gpio_output(AT91_PIN_PB15, 1); // LED BACK BP1
-+	at91_set_gpio_output(AT91_PIN_PB16, 1); // LED BACK AP2
-+	at91_set_gpio_output(AT91_PIN_PB17, 1); // LED BACK BP2
-+
-+	/* Test jig presence detection */
-+	at91_set_gpio_input(AT91_PIN_PB8, 1);   // JIGPRESENT
-+
-+	/* SIM Cards */
-+	if (at91_get_gpio_value(AT91_PIN_PB8)) {
-+		at91_set_gpio_output(AT91_PIN_PB11, 0);
-+		at91_set_gpio_output(AT91_PIN_PB9, 1);
-+	} else {
-+		at91_set_gpio_output(AT91_PIN_PB11, 1);
-+		at91_set_gpio_output(AT91_PIN_PB9, 0);
-+	}
-+
-+	at91_set_gpio_output(AT91_PIN_PB10, 1); // ENBSC2
-+
-+	/* GSM Module Control */
-+	at91_set_gpio_output(AT91_PIN_PB12, 1); // GSMONOFF
-+
-+	/* Power indicator */
-+	at91_set_gpio_input(AT91_PIN_PB22, 1);  // PWR_IND
-+
-+	/* USB Device control */
-+	at91_set_gpio_input(AT91_PIN_PB27, 1);  // UDB_CNX
-+	at91_set_gpio_output(AT91_PIN_PB28, 1); // UDB_PUP
-+	at91_set_multi_drive(AT91_PIN_PB28, 1); // Set to multi-drive
- 
- }
- 

+ 0 - 207
target/linux/at91/patches-2.6.21/016-v1-15-detect.patch

@@ -1,207 +0,0 @@
-Index: linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/at91rm9200_devices.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/at91rm9200_devices.c
-@@ -840,9 +840,9 @@ static inline void configure_usart3_pins
- 	at91_set_B_periph(AT91_PIN_PA6, 0);		/* RXD3 */
- 	at91_set_B_periph(AT91_PIN_PB0, 0);   /* RTS3 */
- 	at91_set_B_periph(AT91_PIN_PB1, 0);   /* CTS3 */
--	at91_set_gpio_output(AT91_PIN_PB29, 1); /* DTR0 */
--	at91_set_gpio_output(AT91_PIN_PB2, 1);  /* RI0 */
--	at91_set_gpio_input(AT91_PIN_PA24, 1);  /* DCD0 */
-+	at91_set_gpio_output(AT91_PIN_PB29, 1); /* DTR3 */
-+	at91_set_gpio_output(AT91_PIN_PB2, 1);  /* RI3 */
-+	at91_set_gpio_input(AT91_PIN_PA24, 1);  /* DCD3 */
- 	at91_set_deglitch(AT91_PIN_PA24, 1);
- }
- 
-Index: linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-===================================================================
---- linux-2.6.21.7.orig/arch/arm/mach-at91/board-vlink.c
-+++ linux-2.6.21.7/arch/arm/mach-at91/board-vlink.c
-@@ -126,6 +126,7 @@ static struct spi_board_info vlink_spi_d
- 
- static void __init vlink_board_init(void)
- {
-+	int v100;
- 	/* Serial */
- 	at91_add_device_serial();
- 	/* Ethernet */
-@@ -147,6 +148,10 @@ static void __init vlink_board_init(void
- //	at91_set_gpio_output(AT91_PIN_PB22, 1);	/* this MMC card slot can optionally use SPI signaling (CS3). */
- 	at91_add_device_mmc(0, &vlink_mmc_data);
- #endif
-+// Set VLink version PIN as an input with pull up (V1.5 = GND)
-+	at91_set_gpio_input(AT91_PIN_PC2, 1);  
-+	v100 = at91_get_gpio_value(AT91_PIN_PC2);
-+
- 	/* LEDs */
- //	at91_gpio_leds(vlink_leds, ARRAY_SIZE(vlink_leds));
- 
-@@ -164,10 +169,16 @@ static void __init vlink_board_init(void
- 	/* SIM Cards */
- 	if (at91_get_gpio_value(AT91_PIN_PB8)) {
- 		at91_set_gpio_output(AT91_PIN_PB11, 0);
--		at91_set_gpio_output(AT91_PIN_PB9, 1);
-+		if (v100)
-+			at91_set_gpio_output(AT91_PIN_PB9, 1);
-+		else
-+			at91_set_gpio_output(AT91_PIN_PC13, 1);
- 	} else {
- 		at91_set_gpio_output(AT91_PIN_PB11, 1);
--		at91_set_gpio_output(AT91_PIN_PB9, 0);
-+		if (v100)
-+			at91_set_gpio_output(AT91_PIN_PB9, 0);
-+		else
-+			at91_set_gpio_output(AT91_PIN_PC13, 0);
- 	}
- 
- 	at91_set_gpio_output(AT91_PIN_PB10, 1); // ENBSC2
-@@ -182,7 +193,18 @@ static void __init vlink_board_init(void
- 	at91_set_gpio_input(AT91_PIN_PB27, 1);  // UDB_CNX
- 	at91_set_gpio_output(AT91_PIN_PB28, 1); // UDB_PUP
- 	at91_set_multi_drive(AT91_PIN_PB28, 1); // Set to multi-drive
--
-+	
-+	if (v100)
-+	{	// V100
-+		at91_set_gpio_input (AT91_PIN_PC12, 1);   // SD Card present
-+	}
-+	else
-+	{	// DO special things for V1.5
-+		at91_set_gpio_output(AT91_PIN_PB9 , 0);   // USB suspend
-+		at91_set_gpio_input (AT91_PIN_PC10, 1);   // SD Card present
-+		at91_set_gpio_output(AT91_PIN_PC11, 0);   // USB Vin CTRL for modules onboard 
-+		at91_set_gpio_output(AT91_PIN_PC12, 0);   // SIM control 
-+	}
- }
- 
- MACHINE_START(VLINK, "FDL VersaLink")
-Index: linux-2.6.21.7/drivers/char/vlink_giu.c
-===================================================================
---- linux-2.6.21.7.orig/drivers/char/vlink_giu.c
-+++ linux-2.6.21.7/drivers/char/vlink_giu.c
-@@ -41,8 +41,7 @@ static int major;	/* default is dynamic 
- module_param(major, int, 0);
- MODULE_PARM_DESC(major, "Major device number");
- 
--#define VIO_NR_DEVS 96
--
-+#define VIO_NR_DEVS   96
- struct vio_dev {
- 	struct cdev cdev;
- };
-@@ -50,6 +49,53 @@ struct vio_dev {
- struct vio_dev *vio_devices;
- static struct class *vio_class;
- 
-+// KWJ + AJE
-+#define MAX_VIO_NAMES 24
-+typedef struct
-+{
-+	char port;
-+	char pin;
-+	char name100[10];
-+	char name150[10];
-+} VIO_NAMES;
-+
-+VIO_NAMES VioName[MAX_VIO_NAMES] = {  //Port,PIN, V100     , V150
-+										{'A',19,"port1DTR" ,"port1DTR"},
-+										{'A',24,"port2DTR" ,"port2DTR"},
-+										{'B',8, "jigOn"    ,"jigOn"} ,
-+										{'B',9, "enbSC3"   ,"usbSUSPND"},
-+										{'B',10,"enbSC2"   ,"enbSC2"},
-+										{'B',11,"enbSC1"   ,"enbSC1"},
-+										{'B',12,"gsmONOFF" ,"gsmONOFF"},
-+										{'B',14,"ledBAP1"  ,"ledBAP1"},
-+										{'B',15,"ledBBP1"  ,"ledBBP1"},
-+										{'B',16,"ledBAP2"  ,"ledBAP2"},
-+										{'B',17,"ledBBP2"  ,"ledBBP2"},
-+										{'B',27,"udpCNX"   ,"udpCNX"},
-+										{'B',28,"udpPUP"   ,"udpPUP"},
-+										{'B',29,"port2DCD" ,"port2DCD"},
-+										{'C',2, "vlVer100" ,"vlVer150"},
-+										{'C',7, "ledFAP1"  ,"ledFAP1"},
-+										{'C',8, "ledFBP1"  ,"ledFBP1"},
-+										{'C',10,"vioC10"   ,"sdCardON"},
-+										{'C',11,"vioC11"   ,"vusbCTRL"},
-+										{'C',12,"sdCardON" ,"simCTRL"},
-+										{'C',13,"vioC13"   ,"enbSC3"},
-+										{'C',14,"ledFBP2"  ,"ledFBP2"},
-+										{'C',15,"ledFAP2"  ,"ledFAP2"},
-+										{0,0,"",""}
-+								   };
-+/*										{'B',18,"gsmRIO"  ,"gsmRIO"},
-+										{'B',20,"gsmTX"   ,"gsmTX"},
-+										{'B',21,"gsmRX"   ,"gsmRX"},
-+										{'B',22,"gsmPIND" ,"gsmPIND"},
-+										{'B',23,"gsmDCD"  ,"gsmDCD"},
-+										{'B',24,"gsmCTS"  ,"gsmCTS"},
-+										{'B',25,"gsmDSR"  ,"gsmDSR"},
-+										{'B',26,"gsmRTS"  ,"gsmRTS"},*/
-+static void lookupPINName(char version100, char *devName, char port, char pin);
-+// EOF KWJ + AJE
-+
- static ssize_t gpio_read(struct file *file, char __user *buf, size_t len,
-                          loff_t *ppos)
- {
-@@ -160,6 +206,8 @@ static int vio_probe(struct platform_dev
- {
- 	int retval, i, j;
- 	dev_t vdev = 0;
-+	char devName[30];
-+	int  vlinkV100;
- 
- 	if (major) {
- 		vdev = MKDEV(major, 0);
-@@ -185,6 +233,7 @@ static int vio_probe(struct platform_dev
- 		vio_remove(dev);
- 		return PTR_ERR(vio_class);
- 	}
-+    vlinkV100 = at91_get_gpio_value(AT91_PIN_PC2);		// Denotes V1.5 if ground
- 
- 	vio_devices = kmalloc(VIO_NR_DEVS * sizeof(struct vio_dev), GFP_KERNEL);
- 	if (!vio_devices) {
-@@ -198,8 +247,10 @@ static int vio_probe(struct platform_dev
- 			int iodev = at91_is_pin_gpio(PIN_BASE + i*32 + j);
- 			if (iodev) {
- 				vio_setup_cdev(&vio_devices[i*32 + j], i*32 + j);
--				class_device_create(vio_class, NULL, MKDEV(major, i*32 + j), NULL,
--					"vio%c%d", i + 'A', j);
-+				// Lookup name of vio to create
-+				lookupPINName(vlinkV100, devName, i, j);
-+				class_device_create(vio_class, NULL, MKDEV(major, i*32 + j), NULL, devName);
-+//					"vio%c%d", i + 'A', j);
- 			}
- 		}
- 
-@@ -212,6 +263,29 @@ fail:
- 	return retval;
- }
- 
-+static void lookupPINName(char version100, char *devName, char port, char pin)
-+{
-+	int i = -1;
-+	char found = 0;
-+	while (!found)
-+	{
-+		i++;
-+		if (i >= MAX_VIO_NAMES)
-+			break;
-+		if (VioName[i].port == port+'A' && VioName[i].pin == pin)
-+		{
-+			printk(KERN_ERR "vio++: %c%d=%s\n",VioName[i].port,VioName[i].pin,VioName[i].name150);
-+			if (version100)
-+				strcpy(devName, VioName[i].name100);
-+			else
-+				strcpy(devName, VioName[i].name150);
-+			found = 1;
-+		}
-+	}
-+	if (!found)
-+		sprintf(devName, "vio%c%d", port + 'A', pin);
-+}
-+
- static struct platform_device *vio_platform_device;
- 
- static struct platform_driver vio_driver = {

+ 0 - 243
target/linux/au1000/au1500/config-2.6.23

@@ -1,243 +0,0 @@
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-CONFIG_64BIT_PHYS_ADDR=y
-# CONFIG_8139TOO is not set
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-# CONFIG_ATM is not set
-CONFIG_BASE_SMALL=0
-CONFIG_BITREVERSE=y
-# CONFIG_BROADCOM_PHY is not set
-CONFIG_CHR_DEV_SG=m
-CONFIG_CMDLINE="root=/dev/mtdblock0 rootfstype=squashfs,jffs2 init=/etc/preinit"
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2 is not set
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-CONFIG_CRAMFS=m
-CONFIG_CRC16=y
-CONFIG_DEVPORT=y
-# CONFIG_DM9000 is not set
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DUMMY=m
-CONFIG_ELF_CORE=y
-# CONFIG_FIXED_PHY is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
-# CONFIG_HAMRADIO is not set
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HID=m
-CONFIG_HID_SUPPORT=y
-CONFIG_HW_HAS_PCI=y
-CONFIG_HW_RANDOM=y
-CONFIG_HZ=250
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-CONFIG_I2C=m
-CONFIG_I2C_ALGOBIT=m
-CONFIG_I2C_ALGOPCA=m
-CONFIG_I2C_ALGOPCF=m
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=m
-# CONFIG_IDE is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_INPUT=y
-CONFIG_INPUT_KEYBOARD=y
-# CONFIG_KEYBOARD_ATKBD is not set
-CONFIG_KEYBOARD_GPIO=y
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_LEDS_ALIX is not set
-CONFIG_LEDS_GPIO=y
-# CONFIG_LEDS_TRIGGERS is not set
-# CONFIG_LEMOTE_FULONG is not set
-CONFIG_MACH_ALCHEMY=y
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_MACH_VR41XX is not set
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_MIPS=y
-# CONFIG_MIPS_ATLAS is not set
-CONFIG_MIPS_AU1X00_ENET=y
-# CONFIG_MIPS_BOSPORUS is not set
-# CONFIG_MIPS_COBALT is not set
-# CONFIG_MIPS_DB1000 is not set
-# CONFIG_MIPS_DB1100 is not set
-# CONFIG_MIPS_DB1200 is not set
-# CONFIG_MIPS_DB1500 is not set
-# CONFIG_MIPS_DB1550 is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_MIRAGE is not set
-CONFIG_MIPS_MTX1=y
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1100 is not set
-# CONFIG_MIPS_PB1200 is not set
-# CONFIG_MIPS_PB1500 is not set
-# CONFIG_MIPS_PB1550 is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MIPS_SIM is not set
-# CONFIG_MIPS_XXS1500 is not set
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_ALCHEMY is not set
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_MTD_BLOCK2MTD is not set
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-# CONFIG_MTD_CFI_STAA is not set
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_CMDLINE_PARTS is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_CONCAT=y
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-CONFIG_MTD_MTX1=y
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_NATSEMI is not set
-# CONFIG_NE2K_PCI is not set
-# CONFIG_NET_SCH_ESFQ_NFCT is not set
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NO_IOPORT is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-# CONFIG_PCIPCWATCHDOG is not set
-CONFIG_PHYLIB=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_PPP_MPPE is not set
-# CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_QSEMI_PHY is not set
-CONFIG_RESOURCES_64BIT=y
-# CONFIG_RTC is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_SCSI_CONSTANTS=y
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_SCSI_WAIT_SCAN=m
-CONFIG_SERIAL_8250_AU1X00=y
-# CONFIG_SERIAL_8250_EXTENDED is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_PCI=m
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_PTSWARM is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SMC91X is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_SND_AU1X00 is not set
-CONFIG_SOC_AU1500=y
-CONFIG_SOC_AU1X00=y
-CONFIG_SOFT_WATCHDOG=m
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_STANDALONE is not set
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_KGDB=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-# CONFIG_TC35815 is not set
-# CONFIG_TMD_HERMES is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_TRAD_SIGNALS=y
-# CONFIG_USBPCWATCHDOG is not set
-CONFIG_USB_EHCI_HCD=m
-# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
-CONFIG_USB_OHCI_HCD=m
-# CONFIG_USB_PWC is not set
-# CONFIG_USB_R8A66597_HCD is not set
-# CONFIG_USB_SERIAL_OTI6858 is not set
-CONFIG_USB_UHCI_HCD=m
-# CONFIG_USER_NS is not set
-CONFIG_V4L_USB_DRIVERS=y
-# CONFIG_VGASTATE is not set
-# CONFIG_VIA_RHINE is not set
-CONFIG_VIDEO_CAPTURE_DRIVERS=y
-# CONFIG_VIDEO_CPIA2 is not set
-CONFIG_VIDEO_V4L1=y
-CONFIG_WDT_MTX1=y
-CONFIG_ZONE_DMA_FLAG=0

+ 0 - 270
target/linux/au1000/au1500/config-2.6.24

@@ -1,270 +0,0 @@
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-CONFIG_64BIT_PHYS_ADDR=y
-# CONFIG_8139TOO is not set
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-CONFIG_ARCH_SUPPORTS_OPROFILE=y
-# CONFIG_ATM is not set
-CONFIG_BASE_SMALL=0
-# CONFIG_BCM47XX is not set
-CONFIG_BITREVERSE=y
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_BT_HCIUART_LL is not set
-CONFIG_CEVT_R4K=y
-CONFIG_CHR_DEV_SG=m
-CONFIG_CMDLINE="root=/dev/mtdblock0 rootfstype=squashfs,jffs2 init=/etc/preinit"
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2 is not set
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-CONFIG_CRAMFS=m
-CONFIG_CRC16=y
-CONFIG_CSRC_R4K=y
-CONFIG_DEVPORT=y
-# CONFIG_DM9000 is not set
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DUMMY=m
-CONFIG_ELF_CORE=y
-# CONFIG_FIXED_PHY is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
-# CONFIG_HAMRADIO is not set
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HID=m
-# CONFIG_HIDRAW is not set
-CONFIG_HID_SUPPORT=y
-CONFIG_HW_HAS_PCI=y
-CONFIG_HW_RANDOM=y
-CONFIG_HZ=250
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-CONFIG_I2C=m
-CONFIG_I2C_ALGOBIT=m
-CONFIG_I2C_ALGOPCA=m
-CONFIG_I2C_ALGOPCF=m
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=m
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IDE is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_INPUT=y
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_IRQ_CPU=y
-# CONFIG_KEYBOARD_ATKBD is not set
-CONFIG_KEYBOARD_GPIO=y
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_LEDS_ALIX is not set
-CONFIG_LEDS_GPIO=y
-# CONFIG_LEDS_TRIGGERS is not set
-# CONFIG_LEMOTE_FULONG is not set
-CONFIG_MACH_ALCHEMY=y
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_MACH_VR41XX is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_MDIO_BITBANG is not set
-CONFIG_MIPS=y
-# CONFIG_MIPS_ATLAS is not set
-CONFIG_MIPS_AU1X00_ENET=y
-# CONFIG_MIPS_BOSPORUS is not set
-# CONFIG_MIPS_COBALT is not set
-# CONFIG_MIPS_DB1000 is not set
-# CONFIG_MIPS_DB1100 is not set
-# CONFIG_MIPS_DB1200 is not set
-# CONFIG_MIPS_DB1500 is not set
-# CONFIG_MIPS_DB1550 is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_MIRAGE is not set
-CONFIG_MIPS_MTX1=y
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1100 is not set
-# CONFIG_MIPS_PB1200 is not set
-# CONFIG_MIPS_PB1500 is not set
-# CONFIG_MIPS_PB1550 is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MIPS_SIM is not set
-# CONFIG_MIPS_XXS1500 is not set
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_ALCHEMY is not set
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_MTD_BLOCK2MTD is not set
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-# CONFIG_MTD_CFI_STAA is not set
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_CMDLINE_PARTS is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_CONCAT=y
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-CONFIG_MTD_MTX1=y
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_NATSEMI is not set
-# CONFIG_NE2K_PCI is not set
-# CONFIG_NET_SCH_ESFQ_NFCT is not set
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NO_IOPORT is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-# CONFIG_PCIPCWATCHDOG is not set
-CONFIG_PCI=y
-CONFIG_PCI_DOMAINS=y
-CONFIG_PHYLIB=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_PPP_MPPE is not set
-# CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_QSEMI_PHY is not set
-CONFIG_RESOURCES_64BIT=y
-# CONFIG_RTC is not set
-CONFIG_RTC_LIB=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_SCSI_CONSTANTS=y
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_SCSI_WAIT_SCAN=m
-CONFIG_SERIAL_8250_AU1X00=y
-# CONFIG_SERIAL_8250_EXTENDED is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_PCI=m
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_PTSWARM is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-CONFIG_SLABINFO=y
-# CONFIG_SMC91X is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_SND_AU1X00 is not set
-CONFIG_SOC_AU1500=y
-CONFIG_SOC_AU1X00=y
-CONFIG_SOFT_WATCHDOG=m
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
-CONFIG_SSB_POSSIBLE=y
-# CONFIG_STANDALONE is not set
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_KGDB=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-# CONFIG_TC35815 is not set
-CONFIG_TICK_ONESHOT=y
-# CONFIG_TMD_HERMES is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_TRAD_SIGNALS=y
-# CONFIG_USBPCWATCHDOG is not set
-CONFIG_USB=m
-CONFIG_USB_EHCI_HCD=m
-# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
-CONFIG_USB_OHCI_HCD=m
-# CONFIG_USB_PWC is not set
-# CONFIG_USB_R8A66597_HCD is not set
-# CONFIG_USB_SERIAL_CH341 is not set
-# CONFIG_USB_SERIAL_OTI6858 is not set
-CONFIG_USB_UHCI_HCD=m
-# CONFIG_USER_NS is not set
-CONFIG_V4L_USB_DRIVERS=y
-# CONFIG_VGASTATE is not set
-# CONFIG_VIA_RHINE is not set
-CONFIG_VIDEO_CAPTURE_DRIVERS=y
-# CONFIG_VIDEO_CPIA2 is not set
-# CONFIG_VIDEO_TCM825X is not set
-CONFIG_VIDEO_V4L1=y
-# CONFIG_VIDEO_VP27SMPX is not set
-CONFIG_WDT_MTX1=y
-CONFIG_ZONE_DMA_FLAG=0

+ 0 - 273
target/linux/au1000/au1500/config-2.6.25

@@ -1,273 +0,0 @@
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-CONFIG_64BIT_PHYS_ADDR=y
-# CONFIG_8139TOO is not set
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-CONFIG_ARCH_SUPPORTS_OPROFILE=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-# CONFIG_ATM is not set
-CONFIG_BASE_SMALL=0
-# CONFIG_BCM47XX is not set
-CONFIG_BITREVERSE=y
-# CONFIG_BROADCOM_PHY is not set
-CONFIG_CEVT_R4K=y
-CONFIG_CHR_DEV_SG=m
-CONFIG_CLASSIC_RCU=y
-CONFIG_CMDLINE="root=/dev/mtdblock0 rootfstype=squashfs,jffs2 init=/etc/preinit"
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2 is not set
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-CONFIG_CRAMFS=m
-CONFIG_CRC16=y
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_AUTHENC=m
-CONFIG_CRYPTO_GF128MUL=m
-CONFIG_CSRC_R4K=y
-CONFIG_DEVPORT=y
-# CONFIG_DM9000 is not set
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DUMMY=m
-# CONFIG_E1000E_ENABLED is not set
-CONFIG_ELF_CORE=y
-# CONFIG_FIXED_PHY is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
-# CONFIG_HAMRADIO is not set
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAVE_IDE=y
-# CONFIG_HAVE_KPROBES is not set
-# CONFIG_HAVE_KRETPROBES is not set
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HID=m
-CONFIG_HID_SUPPORT=y
-CONFIG_HW_HAS_PCI=y
-CONFIG_HW_RANDOM=y
-CONFIG_HZ=250
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-CONFIG_I2C=m
-CONFIG_I2C_ALGOBIT=m
-CONFIG_I2C_ALGOPCA=m
-CONFIG_I2C_ALGOPCF=m
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=m
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IDE is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_INPUT=y
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_IRQ_CPU=y
-CONFIG_KEXEC=y
-# CONFIG_KEYBOARD_ATKBD is not set
-CONFIG_KEYBOARD_GPIO=y
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_LEDS_ALIX is not set
-CONFIG_LEDS_GPIO=y
-# CONFIG_LEDS_TRIGGERS is not set
-# CONFIG_LEMOTE_FULONG is not set
-CONFIG_LZO_COMPRESS=m
-CONFIG_LZO_DECOMPRESS=m
-CONFIG_MACH_ALCHEMY=y
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_MACH_VR41XX is not set
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_MDIO_BITBANG is not set
-# CONFIG_MEMSTICK is not set
-CONFIG_MIPS=y
-# CONFIG_MIPS_ATLAS is not set
-CONFIG_MIPS_AU1X00_ENET=y
-# CONFIG_MIPS_BOSPORUS is not set
-# CONFIG_MIPS_COBALT is not set
-# CONFIG_MIPS_DB1000 is not set
-# CONFIG_MIPS_DB1100 is not set
-# CONFIG_MIPS_DB1200 is not set
-# CONFIG_MIPS_DB1500 is not set
-# CONFIG_MIPS_DB1550 is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_MIRAGE is not set
-CONFIG_MIPS_MTX1=y
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1100 is not set
-# CONFIG_MIPS_PB1200 is not set
-# CONFIG_MIPS_PB1500 is not set
-# CONFIG_MIPS_PB1550 is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MIPS_SIM is not set
-# CONFIG_MIPS_XXS1500 is not set
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_ALCHEMY is not set
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_MTD_BLOCK2MTD is not set
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-# CONFIG_MTD_CFI_STAA is not set
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_CMDLINE_PARTS is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_CONCAT=y
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-CONFIG_MTD_MTX1=y
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_NATSEMI is not set
-# CONFIG_NE2K_PCI is not set
-# CONFIG_NET_SCH_ESFQ_NFCT is not set
-# CONFIG_NET_VENDOR_3COM is not set
-CONFIG_NO_HZ=y
-# CONFIG_NO_IOPORT is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-CONFIG_PCI=y
-# CONFIG_PCIPCWATCHDOG is not set
-CONFIG_PCI_DOMAINS=y
-CONFIG_PHYLIB=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_PPP_MPPE is not set
-# CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_R6040 is not set
-# CONFIG_REALTEK_PHY is not set
-CONFIG_RESOURCES_64BIT=y
-# CONFIG_RTC is not set
-CONFIG_RTC_LIB=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_SCSI_CONSTANTS=y
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_SCSI_WAIT_SCAN=m
-CONFIG_SERIAL_8250_AU1X00=y
-# CONFIG_SERIAL_8250_EXTENDED is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_PCI=m
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP28 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-CONFIG_SLABINFO=y
-# CONFIG_SMC91X is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_SND_AU1X00 is not set
-CONFIG_SOC_AU1500=y
-CONFIG_SOC_AU1X00=y
-CONFIG_SOFT_WATCHDOG=m
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
-CONFIG_SSB_POSSIBLE=y
-# CONFIG_STANDALONE is not set
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_KGDB=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-# CONFIG_TC35815 is not set
-CONFIG_TICK_ONESHOT=y
-# CONFIG_TMD_HERMES is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_TRAD_SIGNALS=y
-# CONFIG_USB_R8A66597_HCD is not set
-CONFIG_USB_SUPPORT=y
-# CONFIG_USBPCWATCHDOG is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_VIA_RHINE is not set
-CONFIG_VIDEO_CAPTURE_DRIVERS=y
-CONFIG_VIDEO_V4L1=y
-CONFIG_VIDEO_V4L2_COMMON=m
-CONFIG_WDT_MTX1=y
-CONFIG_ZONE_DMA_FLAG=0

+ 0 - 19
target/linux/au1000/patches/001-au1000_gpio_kconfig.patch

@@ -1,19 +0,0 @@
-From 8dea23a2b6dae52267b3a969e715d3f0753acf47 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <[email protected]>
-Date: Wed, 10 Oct 2007 14:54:11 +0200
-Subject: [PATCH] [PATCH] Add missing generic GPIO support for au1000
-With the generic GPIO support for au1000, we do not
-select it in the kernel configuration.
-
-Signed-off-by: Florian Fainelli <[email protected]>
----
- arch/mips/au1000/Kconfig |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
---- a/arch/mips/au1000/Kconfig
-+++ b/arch/mips/au1000/Kconfig
-@@ -135,3 +135,4 @@ config SOC_AU1X00
- 	select SYS_SUPPORTS_32BIT_KERNEL
- 	select SYS_SUPPORTS_APM_EMULATION
- 	select SYS_SUPPORTS_KGDB
-+	select GENERIC_GPIO

+ 0 - 54
target/linux/au1000/patches/002-sys_btn_gpio.patch

@@ -1,54 +0,0 @@
-This patch adds support for the GPIO connected system button on the MTX-1 boards. Default configuration is updated accordingly.
-
-Signed-off-by: Florian Fainelli <[email protected]>
----
---- a/arch/mips/au1000/mtx-1/platform.c
-+++ b/arch/mips/au1000/mtx-1/platform.c
-@@ -23,9 +23,32 @@
- #include <linux/types.h>
- #include <linux/platform_device.h>
- #include <linux/leds.h>
-+#include <linux/gpio_keys.h>
-+#include <linux/input.h>
- 
- #include <asm/gpio.h>
- 
-+static struct gpio_keys_button mtx1_gpio_button[] = {
-+	{
-+		.gpio = 207,
-+		.code = BTN_0,
-+		.desc = "System button",
-+	}
-+};
-+
-+static struct gpio_keys_platform_data mtx1_buttons_data = {
-+	.buttons = mtx1_gpio_button,
-+	.nbuttons = ARRAY_SIZE(mtx1_gpio_button),
-+};
-+
-+static struct platform_device mtx1_button = {
-+	.name = "gpio-keys",
-+	.id = -1,
-+	.dev = {
-+		.platform_data = &mtx1_buttons_data,
-+	}
-+};
-+
- static struct resource mtx1_wdt_res[] = {
- 	[0] = {
- 		.start = 15,
-@@ -62,11 +85,13 @@ static struct platform_device mtx1_gpio_
- 
- static struct platform_device *mtx1_devs[] = {
- 	&mtx1_gpio_leds,
--	&mtx1_wdt
-+	&mtx1_wdt,
-+	&mtx1_button
- };
- 
- static int __init mtx1_register_devices(void)
- {
-+	gpio_direction_input(207);
- 	return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
- }
- 

+ 0 - 23
target/linux/au1000/patches/005-au1000_eth_link_beat.patch

@@ -1,23 +0,0 @@
---- a/drivers/net/au1000_eth.c
-+++ b/drivers/net/au1000_eth.c
-@@ -15,6 +15,9 @@
-  * Author: MontaVista Software, Inc.
-  *         	[email protected] or [email protected]
-  *
-+ *         Bjoern Riemer 2004
-+ *           [email protected] or [email protected]
-+ *             // fixed the link beat detection with ioctls (SIOCGMIIPHY)
-  * ########################################################################
-  *
-  *  This program is free software; you can distribute it and/or modify it
-@@ -835,6 +838,10 @@ static int au1000_init(struct net_device
- 
- 	control = MAC_RX_ENABLE | MAC_TX_ENABLE;
- #ifndef CONFIG_CPU_LITTLE_ENDIAN
-+	/*riemer: fix for startup without cable */
-+	if (!link)
-+		dev->flags &= ~IFF_RUNNING;
-+
- 	control |= MAC_BIG_ENDIAN;
- #endif
- 	if (aup->phy_dev) {

+ 0 - 11
target/linux/au1000/patches/012-mtx1_cmdline.patch

@@ -1,11 +0,0 @@
---- a/arch/mips/au1000/mtx-1/init.c
-+++ b/arch/mips/au1000/mtx-1/init.c
-@@ -54,7 +54,7 @@ void __init prom_init(void)
- 	prom_argv = (char **) fw_arg1;
- 	prom_envp = (char **) fw_arg2;
- 
--	prom_init_cmdline();
-+	strcpy(arcs_cmdline, CONFIG_CMDLINE);
- 
- 	memsize_str = prom_getenv("memsize");
- 	if (!memsize_str)

+ 0 - 11
target/linux/au1000/patches/013-openwrt_rootfs.patch

@@ -1,11 +0,0 @@
---- a/drivers/mtd/maps/mtx-1_flash.c
-+++ b/drivers/mtd/maps/mtx-1_flash.c
-@@ -28,7 +28,7 @@ static struct map_info mtx1_map = {
- 
- static struct mtd_partition mtx1_partitions[] = {
-         {
--                .name = "filesystem",
-+                .name = "rootfs",
-                 .size = 0x01C00000,
-                 .offset = 0,
-         },{

+ 0 - 15
target/linux/au1000/patches/014-au1000_eth_ioctl.patch

@@ -1,15 +0,0 @@
---- a/drivers/net/au1000_eth.c
-+++ b/drivers/net/au1000_eth.c
-@@ -1306,9 +1306,12 @@ static void set_rx_mode(struct net_devic
- 	}
- }
- 
-+#define AU1000_KNOWN_PHY_IOCTLS 		(SIOCGMIIPHY & 0xfff0)
- static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
- {
- 	struct au1000_private *aup = (struct au1000_private *)dev->priv;
-+	if((cmd & AU1000_KNOWN_PHY_IOCTLS) != AU1000_KNOWN_PHY_IOCTLS)
-+		return -EINVAL;
- 
- 	if (!netif_running(dev)) return -EINVAL;
- 

+ 0 - 22
target/linux/au1000/patches/015-pci-resource.patch

@@ -1,22 +0,0 @@
---- a/arch/mips/au1000/common/pci.c
-+++ b/arch/mips/au1000/common/pci.c
-@@ -39,15 +39,15 @@
- 
- /* TBD */
- static struct resource pci_io_resource = {
--	.start	= PCI_IO_START,
--	.end	= PCI_IO_END,
-+	.start	= (resource_size_t)PCI_IO_START,
-+	.end	= (resource_size_t)PCI_IO_END,
- 	.name	= "PCI IO space",
- 	.flags	= IORESOURCE_IO
- };
- 
- static struct resource pci_mem_resource = {
--	.start	= PCI_MEM_START,
--	.end	= PCI_MEM_END,
-+	.start	= (resource_size_t)PCI_MEM_START,
-+	.end	= (resource_size_t)PCI_MEM_END,
- 	.name	= "PCI memory space",
- 	.flags	= IORESOURCE_MEM
- };

+ 0 - 10
target/linux/au1000/patches/016-net-irq.patch

@@ -1,10 +0,0 @@
---- a/include/asm-mips/mach-au1x00/au1000.h
-+++ b/include/asm-mips/mach-au1x00/au1000.h
-@@ -623,6 +623,7 @@ enum soc_au1500_ints {
- 	AU1000_RTC_MATCH1_INT,
- 	AU1000_RTC_MATCH2_INT,
- 	AU1500_PCI_ERR_INT,
-+	AU1500_RESERVED_INT,
- 	AU1000_USB_DEV_REQ_INT,
- 	AU1000_USB_DEV_SUS_INT,
- 	AU1000_USB_HOST_INT,

+ 0 - 20
target/linux/au1000/patches/017-gpio-dir.patch

@@ -1,20 +0,0 @@
---- a/arch/mips/au1000/common/gpio.c
-+++ b/arch/mips/au1000/common/gpio.c
-@@ -66,7 +66,8 @@ static int au1xxx_gpio2_direction_input(
- static int au1xxx_gpio2_direction_output(unsigned gpio, int value)
- {
- 	gpio -= AU1XXX_GPIO_BASE;
--	gpio2->dir = (0x01 << gpio) | (value << gpio);
-+	gpio2->dir |= 0x01 << gpio;
-+	gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | (value << gpio);
- 	return 0;
- }
- 
-@@ -95,6 +96,7 @@ static int au1xxx_gpio1_direction_input(
- static int au1xxx_gpio1_direction_output(unsigned gpio, int value)
- {
- 	gpio1->trioutclr = (0x01 & gpio);
-+	au1xxx_gpio1_write(gpio, value);
- 	return 0;
- }
- 

+ 0 - 201
target/linux/rb532/config-2.6.23

@@ -1,201 +0,0 @@
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-# CONFIG_8139TOO is not set
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-# CONFIG_ATM is not set
-# CONFIG_AX25 is not set
-CONFIG_BASE_SMALL=0
-CONFIG_BITREVERSE=y
-CONFIG_BLK_DEV_CF_MIPS=y
-# CONFIG_BT is not set
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2 is not set
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-CONFIG_DEVPORT=y
-# CONFIG_DM9000 is not set
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_EXT2_FS=y
-CONFIG_FS_POSIX_ACL=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HID_SUPPORT=y
-CONFIG_HW_HAS_PCI=y
-CONFIG_HW_RANDOM=y
-# CONFIG_I2C is not set
-# CONFIG_IDE is not set
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_INPUT=y
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_IRQ_CPU=y
-CONFIG_KEXEC=y
-# CONFIG_KEYBOARD_ATKBD is not set
-CONFIG_KEYBOARD_GPIO=y
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-CONFIG_KORINA=y
-# CONFIG_LEDS_ALIX is not set
-# CONFIG_LEDS_GPIO is not set
-CONFIG_LEDS_RB500=y
-# CONFIG_LEMOTE_FULONG is not set
-# CONFIG_MACH_ALCHEMY is not set
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_MACH_VR41XX is not set
-CONFIG_MIKROTIK_RB500=y
-# CONFIG_MINI_FO is not set
-CONFIG_MIPS=y
-# CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_COBALT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=4
-# CONFIG_MIPS_MALTA is not set
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_MIPS_SIM is not set
-CONFIG_MTD=y
-# CONFIG_MTD_ABSENT is not set
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_BLOCK2MTD=y
-# CONFIG_MTD_CFI is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-CONFIG_MTD_CHAR=y
-# CONFIG_MTD_CMDLINE_PARTS is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MTDRAM is not set
-CONFIG_MTD_NAND=y
-# CONFIG_MTD_NAND_CAFE is not set
-# CONFIG_MTD_NAND_DISKONCHIP is not set
-# CONFIG_MTD_NAND_ECC_SMC is not set
-CONFIG_MTD_NAND_IDS=y
-# CONFIG_MTD_NAND_MUSEUM_IDS is not set
-# CONFIG_MTD_NAND_NANDSIM is not set
-CONFIG_MTD_NAND_PLATFORM=y
-CONFIG_MTD_NAND_VERIFY_WRITE=y
-# CONFIG_MTD_ONENAND is not set
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_PLATRAM is not set
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_NATSEMI is not set
-# CONFIG_NE2K_PCI is not set
-# CONFIG_NET_SCH_ESFQ_NFCT is not set
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NO_IOPORT is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_64KB is not set
-# CONFIG_PAGE_SIZE_8KB is not set
-# CONFIG_PCIPCWATCHDOG is not set
-CONFIG_PCI=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-CONFIG_RC32434_WDT=y
-# CONFIG_RTC is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-# CONFIG_SCSI_WAIT_SCAN is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_PTSWARM is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_SOUND is not set
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SYSVIPC_SYSCTL=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-# CONFIG_TC35815 is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_TRAD_SIGNALS=y
-# CONFIG_USB is not set
-# CONFIG_USER_NS is not set
-# CONFIG_VGASTATE is not set
-CONFIG_VIA_RHINE=y
-# CONFIG_VIA_RHINE_MMIO is not set
-CONFIG_VIA_RHINE_NAPI=y
-# CONFIG_YAFFS_9BYTE_TAGS is not set
-CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED=y
-CONFIG_YAFFS_AUTO_YAFFS2=y
-CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=0
-# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
-# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
-CONFIG_YAFFS_DOES_ECC=y
-CONFIG_YAFFS_ECC_WRONG_ORDER=y
-CONFIG_YAFFS_FS=y
-CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
-CONFIG_YAFFS_YAFFS1=y
-CONFIG_YAFFS_YAFFS2=y
-CONFIG_ZONE_DMA_FLAG=0

+ 0 - 51
target/linux/rb532/files-2.6.23/arch/mips/pci/fixup-rb500.c

@@ -1,51 +0,0 @@
-/*
- * Copyright 2001 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *         	[email protected] or [email protected]
- *
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-
-#include <asm/pci.h>
-#include <asm/io.h>
-
-#include <asm/rc32434/rc32434.h>
-
-static int __devinitdata irq_map[2][12] = {
-	{ 0, 0, 2, 3, 2, 3, 0, 0, 0, 0, 0, 1 },
-	{ 0, 0, 1, 3, 0, 2, 1, 3, 0, 2, 1, 3 }
-};
-
-int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
-{
-	int irq = 0;
-
-	if (dev->bus->number < 2 && PCI_SLOT(dev->devfn) < 12) {
-		irq = irq_map[dev->bus->number][PCI_SLOT(dev->devfn)];
-	}
-	return irq + GROUP4_IRQ_BASE + 4;
-}
-

+ 0 - 218
target/linux/rb532/files-2.6.23/arch/mips/pci/ops-rc32434.c

@@ -1,218 +0,0 @@
-/**************************************************************************
- *
- *  BRIEF MODULE DESCRIPTION
- *     pci_ops for IDT EB434 board
- *
- *  Copyright 2004 IDT Inc. ([email protected])
- *  Copyright 2006 Felix Fietkau <[email protected]>
- *         
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- **************************************************************************
- * May 2004 rkt, neb
- *
- * Initial Release
- *
- * 
- *
- **************************************************************************
- */
-
-#include <linux/autoconf.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/types.h>
-#include <linux/delay.h>
-
-#include <asm/cpu.h>
-#include <asm/io.h>
-
-#include <asm/rc32434/rc32434.h>
-#include <asm/rc32434/pci.h> 
-
-#define PCI_ACCESS_READ  0
-#define PCI_ACCESS_WRITE 1
-
-
-#define PCI_CFG_SET(bus,slot,func,off) \
-	(rc32434_pci->pcicfga = (0x80000000 | \
-				((bus) << 16) | ((slot)<<11) | \
-				((func)<<8) | (off)))
-
-static inline int config_access(unsigned char access_type, struct pci_bus *bus,
-                         unsigned int devfn, unsigned char where,
-                         u32 * data)
-{ 
-	unsigned int slot = PCI_SLOT(devfn);
-	u8 func = PCI_FUNC(devfn);
-	
-	/* Setup address */
-	PCI_CFG_SET(bus->number, slot, func, where);
-	rc32434_sync();
-	
-	if (access_type == PCI_ACCESS_WRITE)
-		rc32434_pci->pcicfgd = *data;
-	else
-		*data = rc32434_pci->pcicfgd;
-	
-	rc32434_sync();
-	
-	return 0;
-}
-
-
-/*
- * We can't address 8 and 16 bit words directly.  Instead we have to
- * read/write a 32bit word and mask/modify the data we actually want.
- */
-static int read_config_byte(struct pci_bus *bus, unsigned int devfn,
-                            int where, u8 * val)
-{
-	u32 data;
-	int ret;
-	
-	ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data);
-	*val = (data >> ((where & 3) << 3)) & 0xff;
-	return ret;
-}
-
-static int read_config_word(struct pci_bus *bus, unsigned int devfn,
-                            int where, u16 * val)
-{
-	u32 data;
-	int ret;
-	
-	ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data);
-	*val = (data >> ((where & 3) << 3)) & 0xffff;
-	return ret;
-}
-
-static int read_config_dword(struct pci_bus *bus, unsigned int devfn,
-                             int where, u32 * val)
-{
-	int ret;
-	int delay = 1;
-
-	if (bus->number == 0 && PCI_SLOT(devfn) > 21)
-		return 0;
-
-retry:
-	ret = config_access(PCI_ACCESS_READ, bus, devfn, where, val);
-	
-	/* PCI scan: check for invalid values, device may not have
-	 * finished initializing */
-
-	if (where == PCI_VENDOR_ID) {
-		if (ret == 0xffffffff || ret == 0x00000000 ||
-			ret == 0x0000ffff || ret == 0xffff0000) {
-
-			if (delay > 4)
-				return 0;
-
-			delay *= 2;
-			msleep(delay);
-			goto retry;
-		}
-	}
-	
-	return ret;
-}
-
-static int
-write_config_byte(struct pci_bus *bus, unsigned int devfn, int where,
-                  u8 val)
-{
-	u32 data = 0;
-	
-	if (config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
-		return -1;
-	
-	data = (data & ~(0xff << ((where & 3) << 3))) |
-		(val << ((where & 3) << 3));
-	
-	if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data))
-		return -1;
-	
-	return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int
-write_config_word(struct pci_bus *bus, unsigned int devfn, int where,
-                  u16 val)
-{
-	u32 data = 0;
-	
-	if (config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
-		return -1;
-	
-	data = (data & ~(0xffff << ((where & 3) << 3))) |
-		(val << ((where & 3) << 3));
-	
-	if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data))
-		return -1;
-	
-	
-	return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int 
-write_config_dword(struct pci_bus *bus, unsigned int devfn, int where,
-                   u32 val)
-{
-	if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &val))
-		return -1;
-	
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_config_read(struct pci_bus *bus, unsigned int devfn,
-			   int where, int size, u32 * val)
-{
-	switch (size) {
-	case 1: 
-		return read_config_byte(bus, devfn, where, (u8 *) val);
-	case 2: 
-		return read_config_word(bus, devfn, where, (u16 *) val);
-	default:
-		return read_config_dword(bus, devfn, where, val);
-	}
-}
-
-static int pci_config_write(struct pci_bus *bus, unsigned int devfn,
-			    int where, int size, u32 val)
-{
-	switch (size) {
-	case 1: 
-		return write_config_byte(bus, devfn, where, (u8) val);
-	case 2: 
-		return write_config_word(bus, devfn, where, (u16) val);
-	default:
-		return write_config_dword(bus, devfn, where, val);
-	}
-}
-
-struct pci_ops rc32434_pci_ops = {
-	.read =  pci_config_read,
-	.write = pci_config_write,
-};

+ 0 - 236
target/linux/rb532/files-2.6.23/arch/mips/pci/pci-rc32434.c

@@ -1,236 +0,0 @@
-/**************************************************************************
- *
- *  BRIEF MODULE DESCRIPTION
- *     PCI initialization for IDT EB434 board
- *
- *  Copyright 2004 IDT Inc. ([email protected])
- *
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- **************************************************************************
- * May 2004 rkt, neb
- *
- * Initial Release
- *
- *
- *
- **************************************************************************
- */
-
-#include <linux/autoconf.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-
-#include <asm/rc32434/rc32434.h>
-#include <asm/rc32434/pci.h>
-
-#define PCI_ACCESS_READ  0
-#define PCI_ACCESS_WRITE 1
-
-/* define an unsigned array for the PCI registers */
-unsigned int korinaCnfgRegs[25] = {
-	KORINA_CNFG1,	 KORINA_CNFG2,  KORINA_CNFG3,  KORINA_CNFG4,
-	KORINA_CNFG5,	 KORINA_CNFG6,  KORINA_CNFG7,  KORINA_CNFG8,
-	KORINA_CNFG9,	 KORINA_CNFG10, KORINA_CNFG11, KORINA_CNFG12,
-	KORINA_CNFG13, KORINA_CNFG14, KORINA_CNFG15, KORINA_CNFG16,
-	KORINA_CNFG17, KORINA_CNFG18, KORINA_CNFG19, KORINA_CNFG20,
-	KORINA_CNFG21, KORINA_CNFG22, KORINA_CNFG23, KORINA_CNFG24
-};
-static struct resource rc32434_res_pci_mem1;
-static struct resource rc32434_res_pci_mem2;
-
-static struct resource rc32434_res_pci_mem1 = {
-	.name = "PCI MEM1",
-	.start = 0x50000000,
-	.end = 0x5FFFFFFF,
-	.flags = IORESOURCE_MEM,
-	.parent = &rc32434_res_pci_mem1,
-	.sibling = NULL,
-	.child = &rc32434_res_pci_mem2
-};
-
-static struct resource rc32434_res_pci_mem2 = {
-	.name = "PCI Mem2",
-	.start = 0x60000000,
-	.end = 0x6FFFFFFF,
-	.flags = IORESOURCE_MEM,
-	.parent = &rc32434_res_pci_mem1,
-	.sibling = NULL,
-	.child = NULL
-};
-
-static struct resource rc32434_res_pci_io1 = {
-	.name = "PCI I/O1",
-	.start = 0x18800000,
-	.end = 0x188FFFFF,
-	.flags = IORESOURCE_IO,
-};
-
-extern struct pci_ops rc32434_pci_ops;
-
-#define PCI_MEM1_START	PCI_ADDR_START
-#define PCI_MEM1_END	PCI_ADDR_START + CPUTOPCI_MEM_WIN - 1
-#define PCI_MEM2_START	PCI_ADDR_START + CPUTOPCI_MEM_WIN
-#define PCI_MEM2_END	PCI_ADDR_START + ( 2* CPUTOPCI_MEM_WIN)  - 1
-#define PCI_IO1_START	PCI_ADDR_START + (2 * CPUTOPCI_MEM_WIN)
-#define PCI_IO1_END 	PCI_ADDR_START + (2* CPUTOPCI_MEM_WIN) + CPUTOPCI_IO_WIN -1
-#define PCI_IO2_START	PCI_ADDR_START + (2 * CPUTOPCI_MEM_WIN) + CPUTOPCI_IO_WIN
-#define PCI_IO2_END 	PCI_ADDR_START + (2* CPUTOPCI_MEM_WIN) + (2 * CPUTOPCI_IO_WIN) -1
-
-
-struct pci_controller rc32434_controller2;
-
-struct pci_controller rc32434_controller = {
-	.pci_ops 	= &rc32434_pci_ops,
-	.mem_resource 	= &rc32434_res_pci_mem1,
-	.io_resource 	= &rc32434_res_pci_io1,
-	.mem_offset     = 0,
-	.io_offset      = 0,
-
-};
-
-#ifdef __MIPSEB__
-#define PCI_ENDIAN_FLAG PCILBAC_sb_m
-#else
-#define PCI_ENDIAN_FLAG 0
-#endif
-
-static int __init rc32434_pcibridge_init(void)
-{
-	unsigned int pcicValue, pcicData = 0;
-	unsigned int dummyRead, pciCntlVal;
-	int loopCount;
-	unsigned int pciConfigAddr;
-
-	pcicValue = rc32434_pci->pcic;
-	pcicValue = (pcicValue >> PCIM_SHFT) & PCIM_BIT_LEN;
-	if (!((pcicValue == PCIM_H_EA) ||
-		 (pcicValue == PCIM_H_IA_FIX) ||
-		(pcicValue == PCIM_H_IA_RR))) {
-		printk("PCI init error!!!\n");
-		/* Not in Host Mode, return ERROR */
-		return -1;
-	}
-	/* Enables the Idle Grant mode, Arbiter Parking */
-	pcicData |=(PCIC_igm_m|PCIC_eap_m|PCIC_en_m);
-	rc32434_pci->pcic = pcicData; /* Enable the PCI bus Interface */
-	/* Zero out the PCI status & PCI Status Mask */
-	for(;;)
-	{
-	   pcicData = rc32434_pci->pcis;
-	   if (!(pcicData & PCIS_rip_m))
-		    break;
-	}
-
-	rc32434_pci->pcis = 0;
-	rc32434_pci->pcism = 0xFFFFFFFF;
-	/* Zero out the PCI decoupled registers */
-	rc32434_pci->pcidac=0; /* disable PCI decoupled accesses at initialization */
-	rc32434_pci->pcidas=0; /* clear the status */
-	rc32434_pci->pcidasm=0x0000007F; /* Mask all the interrupts */
-	/* Mask PCI Messaging Interrupts */
-	rc32434_pci_msg->pciiic = 0;
-	rc32434_pci_msg->pciiim = 0xFFFFFFFF;
-	rc32434_pci_msg->pciioic = 0;
-	rc32434_pci_msg->pciioim = 0;
-
-
-	/* Setup PCILB0 as Memory Window */
-	rc32434_pci->pcilba[0].a = (unsigned int) (PCI_ADDR_START);
-
-	/* setup the PCI map address as same as the local address */
-
-	rc32434_pci->pcilba[0].m = (unsigned int) (PCI_ADDR_START);
-
-
-	/* Setup PCILBA1 as MEM */
-	rc32434_pci->pcilba[0].c = ( ((SIZE_256MB & 0x1f) << PCILBAC_size_b) | PCI_ENDIAN_FLAG);
-	dummyRead = rc32434_pci->pcilba[0].c; /* flush the CPU write Buffers */
-	rc32434_pci->pcilba[1].a = 0x60000000;
-	rc32434_pci->pcilba[1].m = 0x60000000;
-
-	/* setup PCILBA2 as IO Window*/
-	rc32434_pci->pcilba[1].c = (((SIZE_256MB & 0x1f) << PCILBAC_size_b )| PCI_ENDIAN_FLAG);
-	dummyRead = rc32434_pci->pcilba[1].c; /* flush the CPU write Buffers */
-	rc32434_pci->pcilba[2].a = 0x18C00000;
-	rc32434_pci->pcilba[2].m = 0x18FFFFFF;
-
-	/* setup PCILBA2 as IO Window*/
-	rc32434_pci->pcilba[2].c = (((SIZE_4MB & 0x1f) << PCILBAC_size_b) | PCI_ENDIAN_FLAG );
-	dummyRead = rc32434_pci->pcilba[2].c; /* flush the CPU write Buffers */
-
-	/* Setup PCILBA3 as IO Window */
-	rc32434_pci->pcilba[3].a = 0x18800000;
-	rc32434_pci->pcilba[3].m = 0x18800000;
-	rc32434_pci->pcilba[3].c = ( (((SIZE_1MB & 0x1ff) << PCILBAC_size_b) | PCILBAC_msi_m) | PCI_ENDIAN_FLAG);
-	dummyRead = rc32434_pci->pcilba[3].c; /* flush the CPU write Buffers */
-
-	pciConfigAddr=(unsigned int)(0x80000004);
-	for(loopCount=0;loopCount<24;loopCount++){
-		rc32434_pci->pcicfga=pciConfigAddr;
-		dummyRead=rc32434_pci->pcicfga;
-		rc32434_pci->pcicfgd = korinaCnfgRegs[loopCount];
-		dummyRead=rc32434_pci->pcicfgd;
-		pciConfigAddr += 4;
-	}
-	rc32434_pci->pcitc = (unsigned int)((PCITC_RTIMER_VAL&0xff) << PCITC_rtimer_b)
-		| ((PCITC_DTIMER_VAL&0xff) << PCITC_dtimer_b);
-
-	pciCntlVal=rc32434_pci->pcic;
-	pciCntlVal &=~(PCIC_tnr_m);
-	rc32434_pci->pcic = pciCntlVal;
-	pciCntlVal=rc32434_pci->pcic;
-	return 0;
-}
-
-/* Do platform specific device initialization at pci_enable_device() time */
-int pcibios_plat_dev_init(struct pci_dev *dev)
-{
-	if (PCI_SLOT(dev->devfn) == 6 && dev->bus->number == 0) {
-		/* disable prefetched memory range */
-		pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, 0);
-		pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, 0x10);
-
-		pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 4);
-	}
-	return 0;
-}
-
-static int __init rc32434_pci_init(void)
-{
-	printk("PCI: Initializing PCI\n");
-
-	ioport_resource.start = rc32434_res_pci_io1.start;
-	ioport_resource.end = rc32434_res_pci_io1.end;
-
-	rc32434_pcibridge_init();
-
-	register_pci_controller(&rc32434_controller);
-	rc32434_sync();
-
-	return 0;
-}
-
-arch_initcall(rc32434_pci_init);
-

+ 0 - 5
target/linux/rb532/files-2.6.23/arch/mips/rb500/Makefile

@@ -1,5 +0,0 @@
-#
-# Makefile for the RB500 board specific parts of the kernel
-#
-
-obj-y	 += irq.o time.o setup.o serial.o prom.o gpio.o devices.o

+ 0 - 338
target/linux/rb532/files-2.6.23/arch/mips/rb500/devices.c

@@ -1,338 +0,0 @@
-/*
- *  RouterBoard 500 Platform devices
- *
- *  Copyright (C) 2006 Felix Fietkau <[email protected]>
- *  Copyright (C) 2007 Florian Fainelli <[email protected]>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- *  GNU General Public License for more details.
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/ctype.h>
-#include <linux/string.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/gpio_keys.h>
-#include <linux/input.h>
-
-#include <asm/bootinfo.h>
-
-#include <asm/rc32434/rc32434.h>
-#include <asm/rc32434/dma.h>
-#include <asm/rc32434/dma_v.h>
-#include <asm/rc32434/eth.h>
-#include <asm/rc32434/rb.h>
-
-#define ETH0_DMA_RX_IRQ   	GROUP1_IRQ_BASE + 0
-#define ETH0_DMA_TX_IRQ   	GROUP1_IRQ_BASE + 1
-#define ETH0_RX_OVR_IRQ   	GROUP3_IRQ_BASE + 9
-#define ETH0_TX_UND_IRQ   	GROUP3_IRQ_BASE + 10
-
-#define ETH0_RX_DMA_ADDR  (DMA0_PhysicalAddress + 0*DMA_CHAN_OFFSET)
-#define ETH0_TX_DMA_ADDR  (DMA0_PhysicalAddress + 1*DMA_CHAN_OFFSET)
-
-/* NAND definitions */
-#define MEM32(x) *((volatile unsigned *) (x))
-
-#define GPIO_RDY (1 << 0x08)
-#define GPIO_WPX (1 << 0x09)
-#define GPIO_ALE (1 << 0x0a)
-#define GPIO_CLE (1 << 0x0b)
-
-extern char* board_type;
-
-static struct resource korina_dev0_res[] = {
-	{
-		.name = "korina_regs",
-		.start = ETH0_PhysicalAddress,
-		.end = ETH0_PhysicalAddress + sizeof(ETH_t),
-		.flags = IORESOURCE_MEM,
-	 }, {
-		.name = "korina_rx",
-		.start = ETH0_DMA_RX_IRQ,
-		.end = ETH0_DMA_RX_IRQ,
-		.flags = IORESOURCE_IRQ
-	}, {
-		.name = "korina_tx",
-		.start = ETH0_DMA_TX_IRQ,
-		.end = ETH0_DMA_TX_IRQ,
-		.flags = IORESOURCE_IRQ
-	}, {
-		.name = "korina_ovr",
-		.start = ETH0_RX_OVR_IRQ,
-		.end = ETH0_RX_OVR_IRQ,
-		.flags = IORESOURCE_IRQ
-	}, {
-		.name = "korina_und",
-		.start = ETH0_TX_UND_IRQ,
-		.end = ETH0_TX_UND_IRQ,
-		.flags = IORESOURCE_IRQ
-	}, {
-		.name = "korina_dma_rx",
-		.start = ETH0_RX_DMA_ADDR,
-		.end = ETH0_RX_DMA_ADDR + DMA_CHAN_OFFSET - 1,
-		.flags = IORESOURCE_MEM,
-	 }, {
-		.name = "korina_dma_tx",
-		.start = ETH0_TX_DMA_ADDR,
-		.end = ETH0_TX_DMA_ADDR + DMA_CHAN_OFFSET - 1,
-		.flags = IORESOURCE_MEM,
-	 }
-};
-
-static struct korina_device korina_dev0_data = {
-	.name = "korina0",
-	.mac = {0xde, 0xca, 0xff, 0xc0, 0xff, 0xee}
-};
-
-static struct platform_device korina_dev0 = {
-	.id = 0,
-	.name = "korina",
-	.dev.platform_data = &korina_dev0_data,
-	.resource = korina_dev0_res,
-	.num_resources = ARRAY_SIZE(korina_dev0_res),
-};
-
-#define CF_GPIO_NUM 13
-
-static struct resource cf_slot0_res[] = {
-	{
-		.name = "cf_membase",
-		.flags = IORESOURCE_MEM
-	}, {
-		.name = "cf_irq",
-		.start = (8 + 4 * 32 + CF_GPIO_NUM),	/* 149 */
-		.end = (8 + 4 * 32 + CF_GPIO_NUM),
-		.flags = IORESOURCE_IRQ
-	}
-};
-
-static struct cf_device cf_slot0_data = {
-	.gpio_pin = 13
-};
-
-static struct platform_device cf_slot0 = {
-	.id = 0,
-	.name = "rb500-cf",
-	.dev.platform_data = &cf_slot0_data,
-	.resource = cf_slot0_res,
-	.num_resources = ARRAY_SIZE(cf_slot0_res),
-};
-
-/* Resources and device for NAND.  There is no data needed and no irqs, so just define the memory used. */
-
-/*
- * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
- * will not be able to find the kernel that we load.  So set the oobinfo
- * when creating the partitions
- */
-static struct nand_ecclayout rb500_nand_ecclayout = {
-	.eccbytes	= 6,
-	.eccpos		= { 8, 9, 10, 13, 14, 15 },
-	.oobavail	= 9,
-	.oobfree	= { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
-};
-
-int rb500_dev_ready(struct mtd_info *mtd)
-{
-        return MEM32(IDT434_REG_BASE + GPIOD) & GPIO_RDY;
-}
-
-void rb500_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-        struct nand_chip *chip = mtd->priv;
-        unsigned char orbits, nandbits;
-
-        if (ctrl & NAND_CTRL_CHANGE) {
-
-                orbits = (ctrl & NAND_CLE) << 1;
-                orbits |= (ctrl & NAND_ALE) >> 1;
-
-                nandbits = (~ctrl & NAND_CLE) << 1;
-                nandbits |= (~ctrl & NAND_ALE) >> 1;
-
-                changeLatchU5(orbits, nandbits);
-        }
-        if (cmd != NAND_CMD_NONE)
-                writeb(cmd, chip->IO_ADDR_W);
-}
-
-static struct resource nand_slot0_res[] = {
-	[0] = {
-		.name = "nand_membase",
-		.flags = IORESOURCE_MEM
-	}
-};
-
-struct platform_nand_data rb500_nand_data = {
-	.ctrl.dev_ready = rb500_dev_ready,
-	.ctrl.cmd_ctrl	= rb500_cmd_ctrl,
-};
-
-static struct platform_device nand_slot0 = {
-	.name = "gen_nand",
-	.id = -1,
-	.resource = nand_slot0_res,
-	.num_resources = ARRAY_SIZE(nand_slot0_res),
-	.dev.platform_data = &rb500_nand_data,
-};
-
-static struct mtd_partition rb500_partition_info[] = {
-	{
-		.name = "Routerboard NAND boot",
-		.offset = 0,
-		.size = 4 * 1024 * 1024,
-	}, {
-		.name = "rootfs",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = MTDPART_SIZ_FULL,
-	}
-};
-
-static struct platform_device rb500_led = {
-	.name = "rb500-led",
-	.id = 0,
-};
-
-static struct gpio_keys_button rb500_gpio_btn[] = {
-	{
-		.gpio = 1,
-		.code = BTN_0,
-		.desc = "S1",
-		.active_low = 1,
-	}
-};
-
-static struct gpio_keys_platform_data rb500_gpio_btn_data = {
-	.buttons = rb500_gpio_btn,
-	.nbuttons = ARRAY_SIZE(rb500_gpio_btn),
-};
-
-static struct platform_device rb500_button = {
-	.name 	= "gpio-keys",
-	.id	= -1,
-	.dev	= {
-		.platform_data = &rb500_gpio_btn_data,
-	}
-};
-
-static struct platform_device *rb500_devs[] = {
-	&korina_dev0,
-	&nand_slot0,
-	&cf_slot0,
-	&rb500_led,
-	&rb500_button
-};
-
-static void __init parse_mac_addr(char *macstr)
-{
-	int i, j;
-	unsigned char result, value;
-
-	for (i = 0; i < 6; i++) {
-		result = 0;
-
-		if (i != 5 && *(macstr + 2) != ':')
-			return;
-
-		for (j = 0; j < 2; j++) {
-			if (isxdigit(*macstr)
-			    && (value =
-				isdigit(*macstr) ? *macstr -
-				'0' : toupper(*macstr) - 'A' + 10) < 16) {
-				result = result * 16 + value;
-				macstr++;
-			} else
-				return;
-		}
-
-		macstr++;
-		korina_dev0_data.mac[i] = result;
-	}
-}
-
-
-/* DEVICE CONTROLLER 1 */
-#define CFG_DC_DEV1 (void*)0xb8010010
-#define CFG_DC_DEV2 (void*)0xb8010020
-#define CFG_DC_DEVBASE    0x0
-#define CFG_DC_DEVMASK    0x4
-#define CFG_DC_DEVC       0x8
-#define CFG_DC_DEVTC      0xC
-
-/* NAND definitions */
-#define NAND_CHIP_DELAY	25
-
-static int rb500_nand_fixup(struct mtd_info *mtd)
-{
-	struct nand_chip *chip = mtd->priv;
-
-	if (mtd->writesize == 512)
-		chip->ecc.layout = &rb500_nand_ecclayout;
-
-	return 0;
-}
-
-static void __init rb500_nand_setup(void)
-{
-	switch (mips_machtype) {
-	case MACH_MIKROTIK_RB532A:
-		changeLatchU5(LO_FOFF | LO_CEX, LO_ULED | LO_ALE | LO_CLE | LO_WPX);
-		break;
-	default:
-		changeLatchU5(LO_WPX | LO_FOFF | LO_CEX, LO_ULED | LO_ALE | LO_CLE);
-		break;
-	}
-
-	/* Setup NAND specific settings */
-	rb500_nand_data.chip.nr_chips = 1;
-	rb500_nand_data.chip.nr_partitions = ARRAY_SIZE(rb500_partition_info);
-	rb500_nand_data.chip.partitions = rb500_partition_info;
-	rb500_nand_data.chip.chip_delay = NAND_CHIP_DELAY;
-	rb500_nand_data.chip.options = NAND_NO_AUTOINCR;
-
-	rb500_nand_data.chip.chip_fixup = &rb500_nand_fixup;
-}
-
-
-static int __init plat_setup_devices(void)
-{
-	/* Look for the CF card reader */
-	if (!readl(CFG_DC_DEV1 + CFG_DC_DEVMASK))
-		rb500_devs[1] = NULL;
-	else {
-		cf_slot0_res[0].start =
-		    readl(CFG_DC_DEV1 + CFG_DC_DEVBASE);
-		cf_slot0_res[0].end = cf_slot0_res[0].start + 0x1000;
-	}
-
-	/* Read the NAND resources from the device controller */
-	nand_slot0_res[0].start = readl(CFG_DC_DEV2 + CFG_DC_DEVBASE);
-	nand_slot0_res[0].end = nand_slot0_res[0].start + 0x1000;
-
-	/* Initialise the NAND device */
-	rb500_nand_setup();
-
-	return platform_add_devices(rb500_devs, ARRAY_SIZE(rb500_devs));
-}
-
-static int __init setup_kmac(char *s)
-{
-	printk("korina mac = %s\n", s);
-	parse_mac_addr(s);
-	return 0;
-}
-
-__setup("kmac=", setup_kmac);
-
-arch_initcall(plat_setup_devices);

+ 0 - 198
target/linux/rb532/files-2.6.23/arch/mips/rb500/gpio.c

@@ -1,198 +0,0 @@
-/*
- *  Miscellaneous functions for IDT EB434 board
- *
- *  Copyright 2004 IDT Inc. ([email protected])
- *  Copyright 2006 Phil Sutter <[email protected]>
- *  Copyright 2007 Florian Fainelli <[email protected]>
- *
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/spinlock.h>
-#include <linux/io.h>
-#include <linux/platform_device.h>
-
-#include <asm/addrspace.h>
-#include <asm/gpio.h>
-
-#include <asm/rc32434/rb.h>
-
-#define GPIO_BADDR  0x18050000
-
-static volatile unsigned char *devCtl3Base;
-static unsigned char latchU5State;
-static spinlock_t clu5Lock = SPIN_LOCK_UNLOCKED;
-
-struct rb500_gpio_reg __iomem *rb500_gpio_reg0;
-EXPORT_SYMBOL(rb500_gpio_reg0);
-
-static struct resource rb500_gpio_reg0_res[] = {
-	{
-		.name 	= "gpio_reg0",
-		.start 	= GPIO_BADDR,
-		.end 	= GPIO_BADDR + sizeof(struct rb500_gpio_reg),
-		.flags 	= IORESOURCE_MEM,
-	}
-};
-
-void set434Reg(unsigned regOffs, unsigned bit, unsigned len, unsigned val)
-{
-	unsigned flags, data;
-	unsigned i = 0;
-
-	spin_lock_irqsave(&clu5Lock, flags);
-	data = *(volatile unsigned *) (IDT434_REG_BASE + regOffs);
-	for (i = 0; i != len; ++i) {
-		if (val & (1 << i))
-			data |= (1 << (i + bit));
-		else
-			data &= ~(1 << (i + bit));
-	}
-	*(volatile unsigned *) (IDT434_REG_BASE + regOffs) = data;
-	spin_unlock_irqrestore(&clu5Lock, flags);
-}
-EXPORT_SYMBOL(set434Reg);
-
-void changeLatchU5(unsigned char orMask, unsigned char nandMask)
-{
-	unsigned flags;
-
-	spin_lock_irqsave(&clu5Lock, flags);
-	latchU5State = (latchU5State | orMask) & ~nandMask;
-	if (!devCtl3Base)
-		devCtl3Base = (volatile unsigned char *)
-		    KSEG1ADDR(*(volatile unsigned *)
-			      KSEG1ADDR(0x18010030));
-	*devCtl3Base = latchU5State;
-	spin_unlock_irqrestore(&clu5Lock, flags);
-}
-EXPORT_SYMBOL(changeLatchU5);
-
-unsigned char getLatchU5State(void)
-{
-	return latchU5State;
-}
-EXPORT_SYMBOL(getLatchU5State);
-
-int rb500_gpio_get_value(unsigned gpio)
-{
-	return readl(&rb500_gpio_reg0->gpiod) & (1 << gpio);
-}
-EXPORT_SYMBOL(rb500_gpio_get_value);
-
-void rb500_gpio_set_value(unsigned gpio, int value)
-{
-	unsigned tmp;
-
-	tmp = readl(&rb500_gpio_reg0->gpiod) & ~(1 << gpio);
-	if (value)
-		tmp |= 1 << gpio;
-
-	writel(tmp, (void *)&rb500_gpio_reg0->gpiod);
-}
-EXPORT_SYMBOL(rb500_gpio_set_value);
-
-int rb500_gpio_direction_input(unsigned gpio)
-{
-	writel(readl(&rb500_gpio_reg0->gpiocfg) & ~(1 << gpio), (void *)&rb500_gpio_reg0->gpiocfg);
-
-	return 0;
-}
-EXPORT_SYMBOL(rb500_gpio_direction_input);
-
-int rb500_gpio_direction_output(unsigned gpio, int value)
-{
-	gpio_set_value(gpio, value);
-	writel(readl(&rb500_gpio_reg0->gpiocfg) | (1 << gpio), (void *)&rb500_gpio_reg0->gpiocfg);
-
-	return 0;
-}
-EXPORT_SYMBOL(rb500_gpio_direction_output);
-
-void rb500_gpio_set_int_level(unsigned gpio, int value)
-{
-	unsigned tmp;
-
-	tmp = readl(&rb500_gpio_reg0->gpioilevel) & ~(1 << gpio);
-	if (value)
-		tmp |= 1 << gpio;
-	writel(tmp, (void *)&rb500_gpio_reg0->gpioilevel);
-}
-EXPORT_SYMBOL(rb500_gpio_set_int_level);
-
-int rb500_gpio_get_int_level(unsigned gpio)
-{
-	return readl(&rb500_gpio_reg0->gpioilevel) & (1 << gpio);
-}
-EXPORT_SYMBOL(rb500_gpio_get_int_level);
-
-void rb500_gpio_set_int_status(unsigned gpio, int value)
-{
-	unsigned tmp;
-
-	tmp = readl(&rb500_gpio_reg0->gpioistat);
-	if (value)
-		tmp |= 1 << gpio;
-	writel(tmp, (void *)&rb500_gpio_reg0->gpioistat);
-}
-EXPORT_SYMBOL(rb500_gpio_set_int_status);
-
-int rb500_gpio_get_int_status(unsigned gpio)
-{
-	return readl(&rb500_gpio_reg0->gpioistat) & (1 << gpio);
-}
-EXPORT_SYMBOL(rb500_gpio_get_int_status);
-
-void rb500_gpio_set_func(unsigned gpio, int value)
-{
-        unsigned tmp;
-
-        tmp = readl(&rb500_gpio_reg0->gpiofunc);
-        if (value)
-                tmp |= 1 << gpio;
-        writel(tmp, (void *)&rb500_gpio_reg0->gpiofunc);
-}
-EXPORT_SYMBOL(rb500_gpio_set_func);
-
-int rb500_gpio_get_func(unsigned gpio)
-{
-        return readl(&rb500_gpio_reg0->gpiofunc) & (1 << gpio);
-}
-EXPORT_SYMBOL(rb500_gpio_get_func);
-
-int __init rb500_gpio_init(void)
-{
-	rb500_gpio_reg0 = ioremap_nocache(rb500_gpio_reg0_res[0].start,
-				rb500_gpio_reg0_res[0].end -
-				rb500_gpio_reg0_res[0].start);
-
-	if (!rb500_gpio_reg0) {
-		printk(KERN_ERR "rb500: cannot remap GPIO register 0\n");
-		return -ENXIO;
-	}
-
-	return 0;
-}
-arch_initcall(rb500_gpio_init);

+ 0 - 265
target/linux/rb532/files-2.6.23/arch/mips/rb500/irq.c

@@ -1,265 +0,0 @@
-/*
- * BRIEF MODULE DESCRIPTION
- *	RC32434 interrupt routines.
- *
- * Copyright 2002 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *		[email protected] or [email protected]
- *
- *  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  SOFTWARE  IS PROVIDED	  ``AS	IS'' AND   ANY	EXPRESS OR IMPLIED
- *  WARRANTIES,	  INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO	EVENT  SHALL   THE AUTHOR  BE	 LIABLE FOR ANY	  DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED	  TO, PROCUREMENT OF  SUBSTITUTE GOODS	OR SERVICES; LOSS OF
- *  USE, DATA,	OR PROFITS; OR	BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN	 CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/kernel_stat.h>
-#include <linux/module.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/ioport.h>
-#include <linux/timex.h>
-#include <linux/slab.h>
-#include <linux/random.h>
-#include <linux/delay.h>
-
-#include <asm/bitops.h>
-#include <asm/bootinfo.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/time.h>
-#include <asm/mipsregs.h>
-#include <asm/system.h>
-#include <asm/rc32434/rc32434.h>
-#include <asm/rc32434/gpio.h>
-
-extern void set_debug_traps(void);
-extern irq_cpustat_t irq_stat [NR_CPUS];
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
-
-static unsigned int startup_irq(unsigned int irq);
-static void rb500_end_irq(unsigned int irq_nr);
-static void mask_and_ack_irq(unsigned int irq_nr);
-static void rb500_enable_irq(unsigned int irq_nr);
-static void rb500_disable_irq(unsigned int irq_nr);
-
-extern void __init init_generic_irq(void);
-extern struct rb500_gpio_reg __iomem *rb500_gpio_reg0;
-
-typedef struct {
-  u32 mask;       /* mask of valid bits in pending/mask registers */
-  volatile u32 *base_addr;
-} intr_group_t;
-
-#define RC32434_NR_IRQS  (GROUP4_IRQ_BASE + 32)
-
-#if (NR_IRQS < RC32434_NR_IRQS)
-#error Too little irqs defined. Did you override <asm/irq.h> ?
-#endif
-
-static const intr_group_t intr_group[NUM_INTR_GROUPS] = {
-  { 0x0000efff, (u32 *)KSEG1ADDR(IC_GROUP0_PEND + 0 * IC_GROUP_OFFSET) },
-  { 0x00001fff, (u32 *)KSEG1ADDR(IC_GROUP0_PEND + 1 * IC_GROUP_OFFSET) },
-  { 0x00000007, (u32 *)KSEG1ADDR(IC_GROUP0_PEND + 2 * IC_GROUP_OFFSET) },
-  { 0x0003ffff, (u32 *)KSEG1ADDR(IC_GROUP0_PEND + 3 * IC_GROUP_OFFSET) },
-  { 0xffffffff, (u32 *)KSEG1ADDR(IC_GROUP0_PEND + 4 * IC_GROUP_OFFSET) }
-};
-
-#define READ_PEND(base) (*(base))
-#define READ_MASK(base) (*(base + 2))
-#define WRITE_MASK(base, val) (*(base + 2) = (val))
-
-static inline int irq_to_group(unsigned int irq_nr)
-{
-  return ((irq_nr - GROUP0_IRQ_BASE) >> 5);
-}
-
-static inline int group_to_ip(unsigned int group)
-{
-  return group + 2;
-}
-
-static inline void enable_local_irq(unsigned int ip)
-{
-  int ipnum = 0x100 << ip;
-  clear_c0_cause(ipnum);
-  set_c0_status(ipnum);
-}
-
-static inline void disable_local_irq(unsigned int ip)
-{
-  int ipnum = 0x100 << ip;
-  clear_c0_status(ipnum);
-}
-
-static inline void ack_local_irq(unsigned int ip)
-{
-  int ipnum = 0x100 << ip;
-  clear_c0_cause(ipnum);
-}
-
-static void rb500_enable_irq(unsigned int irq_nr)
-{
-  int           ip = irq_nr - GROUP0_IRQ_BASE;
-  unsigned int  group, intr_bit;
-  volatile unsigned int  *addr;
-  
-  
-  if (ip < 0)
-    enable_local_irq(irq_nr);
-  else {
-    group = ip >> 5;
- 
-    ip &= (1<<5)-1;
-    intr_bit = 1 << ip;
- 
-    enable_local_irq(group_to_ip(group));
-    
-    addr = intr_group[group].base_addr;
-    WRITE_MASK(addr, READ_MASK(addr) & ~intr_bit);
-  }
-}
-
-static void rb500_disable_irq(unsigned int irq_nr)
-{
-  int           ip = irq_nr - GROUP0_IRQ_BASE;
-  unsigned int  group, intr_bit, mask;
-  volatile unsigned int  *addr;
-  
-  if (ip < 0) {
-	disable_local_irq(irq_nr);
-    }else{
-    group = ip >> 5;
-    
-    ip &= (1<<5) -1;
-    intr_bit = 1 << ip;
-    addr = intr_group[group].base_addr;
-    mask = READ_MASK(addr);
-    mask |= intr_bit;
-    WRITE_MASK(addr,mask);
-   
-    /*
-     * if there are no more interrupts enabled in this
-     * group, disable corresponding IP
-     */
-    if (mask == intr_group[group].mask)
-      disable_local_irq(group_to_ip(group));
-  }
-}
-
-static unsigned int startup_irq(unsigned int irq_nr)
-{
-  rb500_enable_irq(irq_nr);
-  return 0; 
-}
-
-static void shutdown_irq(unsigned int irq_nr)
-{
-  rb500_disable_irq(irq_nr);
-  return;
-}
-
-static void mask_and_ack_irq(unsigned int irq_nr)
-{
-  rb500_disable_irq(irq_nr);
-  ack_local_irq(group_to_ip(irq_to_group(irq_nr)));
-}
-
-static void rb500_end_irq(unsigned int irq_nr)
-{
-
-  int ip = irq_nr - GROUP0_IRQ_BASE;
-  unsigned int intr_bit, group;
-  volatile unsigned int *addr;
-
-	if ((irq_desc[irq_nr].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
-		printk("warning: end_irq %d did not enable (%x)\n", 
-			irq_nr, irq_desc[irq_nr].status);
-		return;
-	}
-	
-	if (ip < 0) {
-		enable_local_irq(irq_nr);
-	} else {
-		group = ip >> 5;
-	
-		ip &= (1 << 5) - 1;
-		intr_bit = 1 << ip;
-	
-		if (irq_nr >= GROUP4_IRQ_BASE && irq_nr <= (GROUP4_IRQ_BASE + 13)) {
-			rb500_gpio_reg0->gpioistat = rb500_gpio_reg0->gpioistat & ~intr_bit;
-		}
-	
-		enable_local_irq(group_to_ip(group));
-	
-		addr = intr_group[group].base_addr;
-		WRITE_MASK(addr, READ_MASK(addr) & ~intr_bit);
-	}
-}
-
-static struct hw_interrupt_type rc32434_irq_type = {
-  .typename = "RB500",
-  .startup = startup_irq,
-  .shutdown = shutdown_irq,
-  .enable = rb500_enable_irq,
-  .disable = rb500_disable_irq,
-  .ack = mask_and_ack_irq,
-  .end = rb500_end_irq,
-};
-
-
-void __init arch_init_irq(void)
-{
-	int i;
-
-	printk("Initializing IRQ's: %d out of %d\n", RC32434_NR_IRQS, NR_IRQS);
-	memset(irq_desc, 0, sizeof(irq_desc));
-  
-	for (i = 0; i < RC32434_NR_IRQS; i++) {
-		irq_desc[i].status = IRQ_DISABLED;
-		irq_desc[i].action = NULL;
-		irq_desc[i].depth = 1;
-		irq_desc[i].chip = &rc32434_irq_type;
-		spin_lock_init(&irq_desc[i].lock);
-	}
-}
-
-/* Main Interrupt dispatcher */
-asmlinkage void plat_irq_dispatch(void)
-{
-	unsigned int ip, pend, group;
-	volatile unsigned int *addr;
-	unsigned int cp0_cause = read_c0_cause() & read_c0_status();
-
-	if (cp0_cause & CAUSEF_IP7) {
-		ll_timer_interrupt(7);
-	} else if ((ip = (cp0_cause & 0x7c00))) {
-		group = 21 - rc32434_clz(ip);
-
-		addr = intr_group[group].base_addr;
-
-		pend = READ_PEND(addr);
-		pend &= ~READ_MASK(addr); // only unmasked interrupts
-		pend = 39 - rc32434_clz(pend);
-		do_IRQ((group << 5) + pend);
-	}
-}

+ 0 - 178
target/linux/rb532/files-2.6.23/arch/mips/rb500/prom.c

@@ -1,178 +0,0 @@
-/*
-* prom.c
-**********************************************************************
-* P . Sadik Oct 10, 2003
-*
-* Started change log
-* idt_cpu_freq is make a kernel configuration parameter
-* idt_cpu_freq is exported so that other modules can use it.
-* Code cleanup
-**********************************************************************
-* P. Sadik Oct 20, 2003
-*
-* Removed NVRAM code from here, since they are already available under
-* nvram directory.
-* Added serial port initialisation.
-**********************************************************************
-**********************************************************************
-* P. Sadik Oct 30, 2003
-*
-* Added reset_cons_port
-**********************************************************************
-
-  P.Christeas, 2005-2006
-  Port to 2.6, add 2.6 cmdline parsing
-
-*/
-
-#include <linux/autoconf.h>
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/console.h>
-#include <asm/bootinfo.h>
-#include <linux/bootmem.h>
-#include <linux/ioport.h>
-#include <linux/blkdev.h>
-#include <asm/rc32434/ddr.h>
-
-#define PROM_ENTRY(x)   (0xbfc00000+((x)*8))
-extern void __init setup_serial_port(void);
-
-unsigned int idt_cpu_freq = 132000000;
-EXPORT_SYMBOL(idt_cpu_freq);
-unsigned int gpio_bootup_state = 0;
-EXPORT_SYMBOL(gpio_bootup_state);
-
-char mips_mac_address[18] = "08:00:06:05:40:01";
-EXPORT_SYMBOL(mips_mac_address);
-
-/* what to append to cmdline when button is [not] pressed */
-#define GPIO_INIT_NOBUTTON ""
-#define GPIO_INIT_BUTTON   " 2"
-
-#ifdef CONFIG_MIKROTIK_RB500
-unsigned soft_reboot = 0;
-EXPORT_SYMBOL(soft_reboot);
-#endif
-
-#define SR_NMI			0x00180000      /* NMI */
-#define SERIAL_SPEED_ENTRY	0x00000001
-
-#ifdef CONFIG_REMOTE_DEBUG
-extern int remote_debug;
-#endif
-
-#define FREQ_TAG   "HZ="
-#define GPIO_TAG   "gpio="
-#define KMAC_TAG   "kmac="
-#define MEM_TAG	   "mem="
-#define BOARD_TAG  "board="
-#define IGNORE_CMDLINE_MEM 1
-#define DEBUG_DDR
-
-#define BOARD_RB532	"500"
-#define BOARD_RB532A	"500r5"
-
-void parse_soft_settings(unsigned *ptr, unsigned size);
-void parse_hard_settings(unsigned *ptr, unsigned size);
-
-void __init prom_setup_cmdline(void);
-
-void __init prom_init(void)
-{
-	DDR_t ddr = (DDR_t) DDR_VirtualAddress; /* define the pointer to the DDR registers */
-	phys_t memsize = 0-ddr->ddrmask;
-
-	/* this should be the very first message, even before serial is properly initialized */
-	prom_setup_cmdline();
-	setup_serial_port();
-
-	mips_machgroup = MACH_GROUP_MIKROTIK;
-	soft_reboot = read_c0_status() & SR_NMI;
-	pm_power_off = NULL;
-
-	/*
-	 * give all RAM to boot allocator,
-	 * except for the first 0x400 and the last 0x200 bytes
-	 */
-	add_memory_region(ddr->ddrbase + 0x400, memsize - 0x600, BOOT_MEM_RAM);
-}
-
-void __init prom_free_prom_memory(void)
-{
-	/* No prom memory to free */
-}
-
-static inline int match_tag(char *arg, const char *tag)
-{
-	return (strncmp(arg, tag, strlen(tag)) == 0);
-}
-
-static inline unsigned long tag2ul(char *arg, const char *tag)
-{
-	char *num = arg+strlen(tag);
-	return simple_strtoul(num, 0, 10);
-}
-
-extern char _image_cmdline;
-void __init prom_setup_cmdline(void){
-	char cmd_line[CL_SIZE];
-	char *cp;
-	int prom_argc;
-	char **prom_argv, **prom_envp;
-	int i;
-
-	prom_argc = fw_arg0;
-	prom_argv = (char **) fw_arg1;
-	prom_envp = (char **) fw_arg2;
-
-	cp=cmd_line;
-		/* Note: it is common that parameters start at argv[1] and not argv[0],
-		however, our elf loader starts at [0] */
-	for(i=0;i<prom_argc;i++){
-		if (match_tag(prom_argv[i], FREQ_TAG)) {
-			idt_cpu_freq = tag2ul(prom_argv[i], FREQ_TAG);
-			continue;
-		}
-#ifdef IGNORE_CMDLINE_MEM
-		/* parses out the "mem=xx" arg */
-		if (match_tag(prom_argv[i], MEM_TAG)) {
-			continue;
-		}
-#endif
-		if (i>0) *(cp++) = ' ';
-		if (match_tag(prom_argv[i], BOARD_TAG)) {
-			char *board = prom_argv[i] + strlen(BOARD_TAG);
-			if (match_tag(board, BOARD_RB532A))
-				mips_machtype = MACH_MIKROTIK_RB532A;
-			else
-				mips_machtype = MACH_MIKROTIK_RB532;
-		}
-
-		if (match_tag(prom_argv[i], GPIO_TAG)) {
-			gpio_bootup_state = tag2ul(prom_argv[i], GPIO_TAG);
-		}
-		strcpy(cp,prom_argv[i]);
-		cp+=strlen(prom_argv[i]);
-	}
-	*(cp++) = ' ';
-	strcpy(cp,(&_image_cmdline + 8));
-	cp += strlen(&_image_cmdline);
-
-	i=strlen(arcs_cmdline);
-	if (i>0){
-		*(cp++) = ' ';
-		strcpy(cp,arcs_cmdline);
-		cp+=strlen(arcs_cmdline);
-	}
-	if (gpio_bootup_state&0x02)
-		strcpy(cp,GPIO_INIT_NOBUTTON);
-	else
-		strcpy(cp,GPIO_INIT_BUTTON);
-	cmd_line[CL_SIZE-1] = '\0';
-
-	strcpy(arcs_cmdline,cmd_line);
-}
-

+ 0 - 78
target/linux/rb532/files-2.6.23/arch/mips/rb500/serial.c

@@ -1,78 +0,0 @@
-/**************************************************************************
- *
- *  BRIEF MODULE DESCRIPTION
- *     Serial port initialisation.
- *
- *  Copyright 2004 IDT Inc. ([email protected])
- *         
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- **************************************************************************
- * May 2004 rkt, neb
- *
- * Initial Release
- *
- * 
- *
- **************************************************************************
- */
-
-
-#include <linux/autoconf.h>
-#include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/pci.h>
-#include <linux/interrupt.h>
-#include <linux/tty.h>
-#include <linux/serial.h>
-#include <linux/serial_core.h>
-#include <linux/serial_8250.h>
-
-#include <asm/time.h>
-#include <asm/cpu.h>
-#include <asm/bootinfo.h>
-#include <asm/irq.h>
-#include <asm/serial.h>
-#include <asm/rc32434/rc32434.h>
-
-extern unsigned int idt_cpu_freq;
-
-static struct uart_port serial_req = {
-	.type = PORT_16550A,
-	.line = 0,
-	.irq = RC32434_UART0_IRQ,
-	//.flags = STD_COM_FLAGS,
-	.iotype = UPIO_MEM,
-	.membase = (char *) KSEG1ADDR(RC32434_UART0_BASE),
-//	.fifosize = 14
-	.regshift = 2
-};
-
-int __init setup_serial_port(void)
-{
-	serial_req.uartclk = idt_cpu_freq;
-
-	if (early_serial_setup(&serial_req))
-		return -ENODEV;
-	
-	return(0);
-}

+ 0 - 81
target/linux/rb532/files-2.6.23/arch/mips/rb500/setup.c

@@ -1,81 +0,0 @@
-/*
- * setup.c - boot time setup code
- */
-
-#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/sched.h>
-#include <linux/irq.h>
-#include <linux/ioport.h>
-#include <linux/pm.h>
-#include <asm/bootinfo.h>
-#include <asm/mipsregs.h>
-#include <asm/pgtable.h>
-#include <asm/reboot.h>
-#include <asm/addrspace.h>     /* for KSEG1ADDR() */
-#include <asm/time.h>
-#include <asm/io.h>
-#include <asm/rc32434/rc32434.h>
-#include <asm/rc32434/pci.h>
-
-#ifdef CONFIG_PCI
-extern void rc32434_time_init(void);
-extern int __init rc32434_pcibridge_init(void);
-#endif
-
-#define epldMask ((volatile unsigned char *)0xB900000d)
-
-static void rb_machine_restart(char *command)
-{
-	/* just jump to the reset vector */
-	* (volatile unsigned *) KSEG1ADDR(0x18008000) = 0x80000001;
-	((void (*)(void))KSEG1ADDR(0x1FC00000u))();
-}
-
-static void rb_machine_halt(void)
-{
-	for(;;) continue;
-}
-
-#ifdef CONFIG_CPU_HAS_WB
-void (*__wbflush) (void);
-
-static void rb_write_buffer_flush(void)
-{
-	__asm__ __volatile__
-	    ("sync\n\t" "nop\n\t" "loop: bc0f loop\n\t" "nop\n\t");
-}
-#endif
-
-void __init plat_mem_setup(void)
-{
-	unsigned int pciCntlVal;
-
-	board_time_init = rc32434_time_init;
-
-#ifdef CONFIG_CPU_HAS_WB
-	__wbflush = rb_write_buffer_flush;
-#endif
-	_machine_restart = rb_machine_restart;
-	_machine_halt = rb_machine_halt;
-	/*_machine_power_off = rb_machine_power_halt;*/
-	pm_power_off = rb_machine_halt;
-
-	set_io_port_base(KSEG1);
-
-	pciCntlVal=rc32434_pci->pcic;
-	pciCntlVal &= 0xFFFFFF7;
-	rc32434_pci->pcic = pciCntlVal;
-
-#ifdef CONFIG_PCI
-	/* Enable PCI interrupts in EPLD Mask register */
-	*epldMask = 0x0;
-	*(epldMask + 1) = 0x0;
-#endif
-	write_c0_wired(0);
-}
-
-const char *get_system_type(void)
-{
-	return "MIPS RB500";
-}

+ 0 - 94
target/linux/rb532/files-2.6.23/arch/mips/rb500/time.c

@@ -1,94 +0,0 @@
-/*
-****************************************************************************
-* Carsten Langgaard, [email protected]
-* Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
-*
-***************************************************************************
-*
-*  This program is free software; you can distribute it and/or modify it
-*  under the terms of the GNU General Public License (Version 2) as
-*  published by the Free Software Foundation.
-*
-*  This program is distributed in the hope 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.
-*
-****************************************************************************
-*
-* Setting up the clock on the MIPS boards.
-*
-****************************************************************************
-* P. Sadik Oct 10, 2003
-*
-* Started change log.
-* mips_counter_frequency is now calculated at run time, based on idt_cpu_freq.
-* Code cleanup
-****************************************************************************
-*/
-
-#include <linux/autoconf.h>
-#include <linux/init.h>
-#include <linux/kernel_stat.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/mc146818rtc.h>
-#include <linux/irq.h>
-#include <linux/timex.h>
-
-#include <asm/irq_cpu.h>
-#include <asm/mipsregs.h>
-#include <asm/ptrace.h>
-#include <asm/debug.h>
-#include <asm/rc32434/rc32434.h>
-
-static unsigned long r4k_offset; /* Amount to incr compare reg each time */
-static unsigned long r4k_cur;    /* What counter should be at next timer irq */
-extern unsigned int mips_hpt_frequency;
-extern unsigned int idt_cpu_freq;
-
-/* 
- * Figure out the r4k offset, the amount to increment the compare
- * register for each time tick. There is no RTC available.
- *
- * The RC32434 counts at half the CPU *core* speed.
- */
-static unsigned long __init cal_r4koff(void)
-{
-	mips_hpt_frequency = idt_cpu_freq * IDT_CLOCK_MULT / 2;
-	return (mips_hpt_frequency / HZ);
-}
-
-
-void __init rc32434_time_init(void)
-{
-	unsigned int est_freq, flags;
-
-	local_irq_save(flags);
-
-	printk("calculating r4koff... ");
-	r4k_offset = cal_r4koff();
-	printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
-
-	est_freq = 2*r4k_offset*HZ;	
-	est_freq += 5000;	/* round */
-	est_freq -= est_freq%10000;
-	printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, 
-	       (est_freq%1000000)*100/1000000);
-	local_irq_restore(flags);
-}
-
-void __init plat_timer_setup(struct irqaction *irq)
-{
-	/* we are using the cpu counter for timer interrupts */
-	setup_irq(MIPS_CPU_TIMER_IRQ, irq);
-
-	/* to generate the first timer interrupt */
-	r4k_cur = (read_c0_count() + r4k_offset);
-	write_c0_compare(r4k_cur);
-}
-

+ 0 - 3
target/linux/rb532/files-2.6.23/drivers/block/rb500/Makefile

@@ -1,3 +0,0 @@
-## Makefile for the RB532 CF port
-
-obj-y		+= bdev.o ata.o

+ 0 - 487
target/linux/rb532/files-2.6.23/drivers/block/rb500/ata.c

@@ -1,487 +0,0 @@
-/* CF-mips driver
-   This is a block driver for the direct (mmaped) interface to the CF-slot,
-   found in Routerboard.com's RB532 board
-   See SDK provided from routerboard.com.
-   
-   Module adapted By P.Christeas <[email protected]>, 2005-6.
-   Cleaned up and adapted to platform_device by Felix Fietkau <[email protected]>
-
-   This work is redistributed under the terms of the GNU General Public License.
-*/
-
-#include <linux/kernel.h>	/* printk() */
-#include <linux/module.h>	/* module to be loadable */
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/pci.h>
-#include <linux/ioport.h>	/* request_mem_region() */
-
-#include <asm/gpio.h>
-#include <asm/unaligned.h>		/* ioremap() */
-#include <asm/io.h>		/* ioremap() */
-#include <asm/rc32434/rb.h>
-
-#include "ata.h"
-
-#define REQUEST_MEM_REGION 0
-#define DEBUG 1
-
-#if DEBUG
-#define DEBUGP printk
-#else
-#define DEBUGP(format, args...)
-#endif
-
-#define SECS	1000000		/* unit for wait_not_busy() is 1us */
-
-unsigned cf_head = 0;
-unsigned cf_cyl = 0;
-unsigned cf_spt = 0;
-unsigned cf_sectors = 0;
-static unsigned cf_block_size = 1;
-static void *baddr = 0;
-
-#define DBUF32 ((volatile u32 *)((unsigned long)dev->baddr | ATA_DBUF_OFFSET))
-
-
-static void cf_do_tasklet(unsigned long dev_l);
-
-
-static inline void wareg(u8 val, unsigned reg, struct cf_mips_dev* dev)
-{
-	writeb(val, dev->baddr + ATA_REG_OFFSET + reg);
-}
-
-static inline u8 rareg(unsigned reg, struct cf_mips_dev* dev)
-{
-	return readb(dev->baddr + ATA_REG_OFFSET + reg);
-}
-
-static inline int cfrdy(struct cf_mips_dev *dev)
-{
-	return gpio_get_value(dev->pin);
-}
-
-static inline void prepare_cf_irq(struct cf_mips_dev *dev)
-{
-	rb500_gpio_set_int_level(1, dev->pin);	/* interrupt on cf ready (not busy) */
-	rb500_gpio_set_int_status(0, dev->pin); 	/* clear interrupt status */
-}
-
-static inline int cf_present(struct cf_mips_dev* dev)
-{
-	/* TODO: read and configure CIS into memory mapped mode
-	 * TODO:   parse CISTPL_CONFIG on CF+ cards to get base address (0x200)
-	 * TODO:   maybe adjust power saving setting for Hitachi Microdrive
-	 */
-	int i;
-
-	/* setup CFRDY GPIO as input */
-	rb500_gpio_set_func(dev->pin, 0);
-	gpio_direction_input(dev->pin);
-
-	for (i = 0; i < 0x10; ++i) {
-		if (rareg(i,dev) != 0xff)
-			return 1;
-	}
-	return 0;
-}
-
-static inline int is_busy(struct cf_mips_dev *dev)
-{
-	return !cfrdy(dev);
-}
-
-static int wait_not_busy(int to_us, int wait_for_busy,struct cf_mips_dev *dev)
-{
-	int us_passed = 0;
-	if (wait_for_busy && !is_busy(dev)) {
-		/* busy must appear within 400ns,
-		 * but it may dissapear before we see it
-		 *  => must not wait for busy in a loop
-		 */
-		ndelay(400);
-	}
-
-	do {
-		if (us_passed)
-			udelay(1);	/* never reached in async mode */
-		if (!is_busy(dev)) {
-			if (us_passed > 1 * SECS) {
-				printk(KERN_WARNING "cf-mips:   not busy ok (after %dus)"
-				       ", status 0x%02x\n", us_passed, (unsigned) rareg(ATA_REG_ST,dev));
-			}
-			return CF_TRANS_OK;
-		}
-		if (us_passed == 1 * SECS) {
-			printk(KERN_WARNING "cf-mips: wait not busy %dus..\n", to_us);
-		}
-		if (dev->async_mode) {
-			dev->to_timer.expires = jiffies + (to_us * HZ / SECS);
-			dev->irq_enable_time = jiffies;
-			prepare_cf_irq(dev);
-			if (is_busy(dev)) {
-				add_timer(&dev->to_timer);
-				enable_irq(dev->irq);
-				return CF_TRANS_IN_PROGRESS;
-			}
-			continue;
-		}
-		++us_passed;
-	} while (us_passed < to_us);
-
-	printk(KERN_ERR "cf-mips:  wait not busy timeout (%dus)"
-	       ", status 0x%02x, state %d\n",
-	       to_us, (unsigned) rareg(ATA_REG_ST,dev), dev->tstate);
-	return CF_TRANS_FAILED;
-}
-
-static irqreturn_t cf_irq_handler(int irq, void *dev_id)
-{
-	/* While tasklet has not disabled irq, irq will be retried all the time
-	 * because of ILEVEL matching GPIO pin status => deadlock.
-	 * To avoid this, we change ILEVEL to 0.
-	 */
-	struct cf_mips_dev *dev=dev_id;
-
-	rb500_gpio_set_int_level(0, dev->pin);
-	rb500_gpio_set_int_status(0, dev->pin);
-	
-	del_timer(&dev->to_timer);
-	tasklet_schedule(&dev->tasklet);
-	return IRQ_HANDLED;
-}
-
-static int do_reset(struct cf_mips_dev *dev)
-{
-	printk(KERN_INFO "cf-mips: resetting..\n");
-
-	wareg(ATA_REG_DC_SRST, ATA_REG_DC,dev);
-	udelay(1);		/* FIXME: how long should we wait here? */
-	wareg(0, ATA_REG_DC,dev);
-
-	return wait_not_busy(30 * SECS, 1,dev);
-}
-
-static int set_multiple(struct cf_mips_dev *dev)
-{
-	if (dev->block_size <= 1)
-		return CF_TRANS_OK;
-
-	wareg(dev->block_size, ATA_REG_SC,dev);
-	wareg(ATA_REG_DH_BASE | ATA_REG_DH_LBA, ATA_REG_DH,dev);
-	wareg(ATA_CMD_SET_MULTIPLE, ATA_REG_CMD,dev);
-
-	return wait_not_busy(10 * SECS, 1,dev);
-}
-
-static int set_cmd(struct cf_mips_dev *dev)
-{
-	//DEBUGP(KERN_INFO "cf-mips: ata cmd 0x%02x\n", dev->tcmd);
-	// sector_count should be <=24 bits..
-	BUG_ON(dev->tsect_start>=0x10000000);
-	// This way, it addresses 2^24 * 512 = 128G
-
-	if (dev->tsector_count) {
-		wareg(dev->tsector_count & 0xff, ATA_REG_SC,dev);
-		wareg(dev->tsect_start & 0xff, ATA_REG_SN,dev);
-		wareg((dev->tsect_start >> 8) & 0xff, ATA_REG_CL,dev);
-		wareg((dev->tsect_start >> 16) & 0xff, ATA_REG_CH,dev);
-	}
-	wareg(((dev->tsect_start >> 24) & 0x0f) | ATA_REG_DH_BASE | ATA_REG_DH_LBA,
-	      ATA_REG_DH,dev);	/* select drive on all commands */
-	wareg(dev->tcmd, ATA_REG_CMD,dev);
-	return wait_not_busy(10 * SECS, 1,dev);
-}
-
-static int do_trans(struct cf_mips_dev *dev)
-{
-	int res;
-	unsigned st;
-	int transfered;
-	
-	//printk("do_trans: %d sectors left\n",dev->tsectors_left);
-	while (dev->tsectors_left) {
-		transfered = 0;
-
-		st = rareg(ATA_REG_ST,dev);
-		if (!(st & ATA_REG_ST_DRQ)) {
-			printk(KERN_ERR "cf-mips: do_trans without DRQ (status 0x%x)!\n", st);
-			if (st & ATA_REG_ST_ERR) {
-				int errId = rareg(ATA_REG_ERR,dev);
-				printk(KERN_ERR "cf-mips: %s error, status 0x%x, errid 0x%x\n",
-				       (dev->tread ? "read" : "write"), st, errId);
-			}
-			return CF_TRANS_FAILED;
-		}
-		do { /* Fill/read the buffer one block */
-			u32 *qbuf, *qend;
-			qbuf = (u32 *)dev->tbuf;
-			qend = qbuf + CF_SECT_SIZE / sizeof(u32);
-			if (dev->tread) {
-			    while (qbuf!=qend)
-				put_unaligned(*DBUF32,qbuf++);
-				//*(qbuf++) = *DBUF32;
-			}
-			else {
-			    while(qbuf!=qend)
-				*DBUF32 = get_unaligned(qbuf++);
-			}
-
-			dev->tsectors_left--;
-			dev->tbuf += CF_SECT_SIZE;
-			dev->tbuf_size -= CF_SECT_SIZE;
-			transfered++;
-		} while (transfered != dev->block_size && dev->tsectors_left > 0);
-
-		res = wait_not_busy(10 * SECS, 1,dev);
-		if (res != CF_TRANS_OK)
-			return res;
-	};
-
-	st = rareg(ATA_REG_ST,dev);
-	if (st & (ATA_REG_ST_DRQ | ATA_REG_ST_DWF | ATA_REG_ST_ERR)) {
-		if (st & ATA_REG_ST_DRQ) {
-			printk(KERN_ERR "cf-mips: DRQ after all %d sectors are %s"
-			       ", status 0x%x\n", dev->tsector_count, (dev->tread ? "read" : "written"), st);
-		} else if (st & ATA_REG_ST_DWF) {
-			printk(KERN_ERR "cf-mips: write fault, status 0x%x\n", st);
-		} else {
-			int errId = rareg(ATA_REG_ERR,dev);
-			printk(KERN_ERR "cf-mips: %s error, status 0x%x, errid 0x%x\n",
-			       (dev->tread ? "read" : "write"), st, errId);
-		}
-		return CF_TRANS_FAILED;
-	}
-	return CF_TRANS_OK;
-}
-
-static int cf_do_state(struct cf_mips_dev *dev)
-{
-	int res;
-	switch (dev->tstate) {	/* fall through everywhere */
-	case TS_IDLE:
-		dev->tstate = TS_READY;
-		if (is_busy(dev)) {
-			dev->tstate = TS_AFTER_RESET;
-			res = do_reset(dev);
-			if (res != CF_TRANS_OK)
-				break;
-		}
-	case TS_AFTER_RESET:
-		if (dev->tstate == TS_AFTER_RESET) {
-			dev->tstate = TS_READY;
-			res = set_multiple(dev);
-			if (res != CF_TRANS_OK)
-				break;
-		}
-	case TS_READY:
-		dev->tstate = TS_CMD;
-		res = set_cmd(dev);
-		if (res != CF_TRANS_OK)
-			break;;
-	case TS_CMD:
-		dev->tstate = TS_TRANS;
-	case TS_TRANS:
-		res = do_trans(dev);
-		break;
-	default:
-		printk(KERN_ERR "cf-mips: BUG: unknown tstate %d\n", dev->tstate);
-		return CF_TRANS_FAILED;
-	}
-	if (res != CF_TRANS_IN_PROGRESS)
-		dev->tstate = TS_IDLE;
-	return res;
-}
-
-static void cf_do_tasklet(unsigned long dev_l)
-{
-	struct cf_mips_dev* dev=(struct cf_mips_dev*) dev_l;
-	int res;
-
-	disable_irq(dev->irq);
-
-	if (dev->tstate == TS_IDLE)
-		return;		/* can happen when irq is first registered */
-
-#if 0
-	DEBUGP(KERN_WARNING "cf-mips:   not busy ok (tasklet)  status 0x%02x\n",
-	       (unsigned) rareg(ATA_REG_ST,dev));
-#endif
-
-	res = cf_do_state(dev);
-	if (res == CF_TRANS_IN_PROGRESS)
-		return;
-	cf_async_trans_done(dev,res);
-}
-
-static void cf_async_timeout(unsigned long dev_l)
-{
-	struct cf_mips_dev* dev=(struct cf_mips_dev*) dev_l;
-	disable_irq(dev->irq);
-	/* Perhaps send abort to the device? */
-	printk(KERN_ERR "cf-mips:  wait not busy timeout (%lus)"
-	       ", status 0x%02x, state %d\n",
-	       jiffies - dev->irq_enable_time, (unsigned) rareg(ATA_REG_ST,dev), dev->tstate);
-	dev->tstate = TS_IDLE;
-	cf_async_trans_done(dev,CF_TRANS_FAILED);
-}
-
-int cf_do_transfer(struct cf_mips_dev* dev,sector_t sector, unsigned long nsect, 
-	char* buffer, int is_write)
-{
-	BUG_ON(dev->tstate!=TS_IDLE);
-	if (nsect > ATA_MAX_SECT_PER_CMD) {
-		printk(KERN_WARNING "cf-mips: sector count %lu out of range\n",nsect);
-		return CF_TRANS_FAILED;
-	}
-	if (sector + nsect > dev->sectors) {
-		printk(KERN_WARNING "cf-mips: sector %lu out of range\n",sector);
-		return CF_TRANS_FAILED;
-	}
-	dev->tbuf = buffer;
-	dev->tbuf_size = nsect*512;
-	dev->tsect_start = sector;
-	dev->tsector_count = nsect;
-	dev->tsectors_left = dev->tsector_count;
-	dev->tread = (is_write)?0:1;
-	
-	dev->tcmd = (dev->block_size == 1 ?
-		(is_write ? ATA_CMD_WRITE_SECTORS : ATA_CMD_READ_SECTORS) :
-		(is_write ? ATA_CMD_WRITE_MULTIPLE : ATA_CMD_READ_MULTIPLE));
-
-	return cf_do_state(dev);
-}
-
-static int do_identify(struct cf_mips_dev *dev)
-{
-	u16 sbuf[CF_SECT_SIZE >> 1];
- 	int res;
-	char tstr[17]; //serial
-	char tmp;
-	int i;
-	BUG_ON(dev->tstate!=TS_IDLE);
-	dev->tbuf = (char *) sbuf;
-	dev->tbuf_size = CF_SECT_SIZE;
-	dev->tsect_start = 0;
-	dev->tsector_count = 0;
-	dev->tsectors_left = 1;
-	dev->tread = 1;
-	dev->tcmd = ATA_CMD_IDENTIFY_DRIVE;
-
-	DEBUGP(KERN_INFO "cf-mips: identify drive..\n");
-	res = cf_do_state(dev);
-	if (res == CF_TRANS_IN_PROGRESS) {
-		printk(KERN_ERR "cf-mips: BUG: async identify cmd\n");
-		return CF_TRANS_FAILED;
-	}
-	if (res != CF_TRANS_OK)
-		return 0;
-
-	dev->head = sbuf[3];
-	dev->cyl = sbuf[1];
-	dev->spt = sbuf[6];
-	dev->sectors = ((unsigned long) sbuf[7] << 16) | sbuf[8];
-	dev->dtype=sbuf[0];
-	memcpy(tstr, &sbuf[12], 16);
-	tstr[16] = '\0';
-
-	/* Byte-swap the serial number */
-	for (i = 0; i<8; i++) {
-		tmp = tstr[i * 2];
-		tstr[i * 2] = tstr[i * 2 +1];
-		tstr[i * 2 + 1] = tmp;
-	}
-
-	printk(KERN_INFO "cf-mips: %s detected, C/H/S=%d/%d/%d sectors=%u (%uMB) Serial=%s\n",
-	       (sbuf[0] == 0x848A ? "CF card" : "ATA drive"), dev->cyl, dev->head,
-	       dev->spt, dev->sectors, dev->sectors >> 11, tstr);
-	return 1;
-}
-
-static void init_multiple(struct cf_mips_dev * dev)
-{
-	int res;
-	DEBUGP(KERN_INFO "cf-mips: detecting block size\n");
-
-	dev->block_size = 128;	/* max block size = 128 sectors (64KB) */
-	do {
-		wareg(dev->block_size, ATA_REG_SC,dev);
-		wareg(ATA_REG_DH_BASE | ATA_REG_DH_LBA, ATA_REG_DH,dev);
-		wareg(ATA_CMD_SET_MULTIPLE, ATA_REG_CMD,dev);
-
-		res = wait_not_busy(10 * SECS, 1,dev);
-		if (res != CF_TRANS_OK) {
-			printk(KERN_ERR "cf-mips: failed to detect block size: busy!\n");
-			dev->block_size = 1;
-			return;
-		}
-		if ((rareg(ATA_REG_ST,dev) & ATA_REG_ST_ERR) == 0)
-			break;
-		dev->block_size /= 2;
-	} while (dev->block_size > 1);
-
-	printk(KERN_INFO "cf-mips: multiple sectors = %d\n", dev->block_size);
-}
-
-int cf_init(struct cf_mips_dev *dev)
-{
-	tasklet_init(&dev->tasklet,cf_do_tasklet,(unsigned long)dev);
-	dev->baddr = ioremap_nocache((unsigned long)dev->base, CFDEV_BUF_SIZE);
-	if (!dev->baddr) {
-		printk(KERN_ERR "cf-mips: cf_init: ioremap for (%lx,%x) failed\n",
-		       (unsigned long) dev->base, CFDEV_BUF_SIZE);
-		return -EBUSY;
-	}
-
-	if (!cf_present(dev)) {
-		printk(KERN_WARNING "cf-mips: cf card not present\n");
-		iounmap(dev->baddr);
-		return -ENODEV;
-	}
-
-	if (do_reset(dev) != CF_TRANS_OK) {
-		printk(KERN_ERR "cf-mips: cf reset failed\n");
-		iounmap(dev->baddr);
-		return -EBUSY;
-	}
-
-	if (!do_identify(dev)) {
-		printk(KERN_ERR "cf-mips: cf identify failed\n");
-		iounmap(dev->baddr);
-		return -EBUSY;
-	}
-
-/*	set_apm_level(ATA_APM_WITH_STANDBY); */
-	init_multiple(dev);
-
-	init_timer(&dev->to_timer);
-	dev->to_timer.function = cf_async_timeout;
-	dev->to_timer.data = (unsigned long)dev;
-
-	prepare_cf_irq(dev);
-	if (request_irq(dev->irq, cf_irq_handler, 0, "CF Mips", dev)) {
-		printk(KERN_ERR "cf-mips: failed to get irq\n");
-		iounmap(dev->baddr);
-		return -EBUSY;
-	}
-	/* Disable below would be odd, because request will enable, and the tasklet
-	  will disable it itself */
-	//disable_irq(dev->irq);
-	
-	dev->async_mode = 1;
-
-	return 0;
-}
-
-void cf_cleanup(struct cf_mips_dev *dev)
-{
-	iounmap(dev->baddr);
-	free_irq(dev->irq, NULL);
-#if REQUEST_MEM_REGION
-	release_mem_region((unsigned long)dev->base, CFDEV_BUF_SIZE);
-#endif
-}
-
-
-/*eof*/

+ 0 - 143
target/linux/rb532/files-2.6.23/drivers/block/rb500/ata.h

@@ -1,143 +0,0 @@
-/* CF-mips driver
-   This is a block driver for the direct (mmaped) interface to the CF-slot,
-   found in Routerboard.com's RB532 board
-   See SDK provided from routerboard.com.
-   
-   Module adapted By P.Christeas <[email protected]>, 2005-6.
-   Cleaned up and adapted to platform_device by Felix Fietkau <[email protected]>
-
-   This work is redistributed under the terms of the GNU General Public License.
-*/
-
-#ifndef __CFMIPS_ATA_H__
-#define __CFMIPS_ATA_H__
-
-#include <linux/interrupt.h>
-
-#define CFG_DC_DEV1	(void*)0xb8010010
-#define   CFG_DC_DEVBASE	0x0
-#define   CFG_DC_DEVMASK	0x4
-#define   CFG_DC_DEVC		0x8
-#define   CFG_DC_DEVTC		0xC
-
-#define CFDEV_BUF_SIZE	0x1000
-#define ATA_CIS_OFFSET	0x200
-#define ATA_REG_OFFSET	0x800
-#define ATA_DBUF_OFFSET	0xC00
-
-#define ATA_REG_FEAT	0x1
-#define ATA_REG_SC	0x2
-#define ATA_REG_SN	0x3
-#define ATA_REG_CL	0x4
-#define ATA_REG_CH	0x5
-#define ATA_REG_DH	0x6
-#define   ATA_REG_DH_BASE	0xa0
-#define   ATA_REG_DH_LBA	0x40
-#define   ATA_REG_DH_DRV	0x10
-#define ATA_REG_CMD	0x7
-#define ATA_REG_ST	0x7
-#define   ATA_REG_ST_BUSY	0x80
-#define   ATA_REG_ST_RDY	0x40
-#define   ATA_REG_ST_DWF	0x20
-#define   ATA_REG_ST_DSC	0x10
-#define   ATA_REG_ST_DRQ	0x08
-#define   ATA_REG_ST_CORR	0x04
-#define   ATA_REG_ST_ERR	0x01
-#define ATA_REG_ERR	0xd
-#define ATA_REG_DC	0xe
-#define   ATA_REG_DC_IEN	0x02
-#define   ATA_REG_DC_SRST	0x04
-
-#define ATA_CMD_READ_SECTORS	0x20
-#define ATA_CMD_WRITE_SECTORS	0x30
-#define ATA_CMD_EXEC_DRIVE_DIAG	0x90
-#define ATA_CMD_READ_MULTIPLE	0xC4
-#define ATA_CMD_WRITE_MULTIPLE	0xC5
-#define ATA_CMD_SET_MULTIPLE	0xC6
-#define ATA_CMD_IDENTIFY_DRIVE	0xEC
-#define ATA_CMD_SET_FEATURES	0xEF
-
-#define ATA_FEATURE_ENABLE_APM	0x05
-#define ATA_FEATURE_DISABLE_APM	0x85
-#define ATA_APM_DISABLED	0x00
-#define ATA_APM_MIN_POWER	0x01
-#define ATA_APM_WITH_STANDBY	0x7f
-#define ATA_APM_WITHOUT_STANDBY	0x80
-#define ATA_APM_MAX_PERFORMANCE	0xfe
-
-#define CF_SECT_SIZE	0x200
-/* That is the ratio CF_SECT_SIZE/512 (the kernel sector size) */
-#define CF_KERNEL_MUL	1
-#define ATA_MAX_SECT_PER_CMD	0x100
-
-#define CF_TRANS_FAILED		0
-#define CF_TRANS_OK		1
-#define CF_TRANS_IN_PROGRESS	2
-
-
-enum trans_state {
-	TS_IDLE = 0,
-	TS_AFTER_RESET,
-	TS_READY,
-	TS_CMD,
-	TS_TRANS
-};
-
-// 
-// #if DEBUG
-// static unsigned long busy_time;
-// #endif
-
-/** Struct to hold the cfdev
-Actually, all the data here only has one instance. However, for 
-reasons of programming conformity, it is passed around as a pointer
-*/
-struct cf_mips_dev {
-	void *base; /* base address for I/O */
-	void *baddr; /* remapped address */
-
-	int pin; /* gpio pin */
-	int irq; /* gpio irq */
-	
-	unsigned head;
-	unsigned cyl;
-	unsigned spt;
-	unsigned sectors;
-	
-	unsigned short block_size;
-	unsigned dtype ; // ATA or CF
-	struct request_queue *queue;
-	struct gendisk  *gd;
-	
-	/* Transaction state */
-	enum trans_state tstate;
-	char *tbuf;
-	unsigned long tbuf_size;
-	sector_t tsect_start;
-	unsigned tsector_count;
-	unsigned tsectors_left;
-	int tread;
-	unsigned tcmd;
-	int async_mode;
-	unsigned long irq_enable_time;
-	
-	struct request *active_req; /* A request is being carried out. Is that different from tstate? */
-	int users;
-	struct timer_list to_timer;
-	struct tasklet_struct tasklet;
-
-	/** This lock ensures that the requests to this device are all done
-	atomically. Transfers can run in parallel, requests are all queued
-	one-by-one */
-	spinlock_t lock;
-};
-
-int cf_do_transfer(struct cf_mips_dev* dev,sector_t sector, unsigned long nsect, 
-	char* buffer, int is_write);
-int cf_init(struct cf_mips_dev* dev);
-void cf_cleanup(struct cf_mips_dev* dev);
-
-void cf_async_trans_done(struct cf_mips_dev* dev, int result);
-// void *cf_get_next_buf(unsigned long *buf_size);
-
-#endif

+ 0 - 340
target/linux/rb532/files-2.6.23/drivers/block/rb500/bdev.c

@@ -1,340 +0,0 @@
-/* CF-mips driver
-   This is a block driver for the direct (mmaped) interface to the CF-slot,
-   found in Routerboard.com's RB532 board
-   See SDK provided from routerboard.com.
-   
-   Module adapted By P.Christeas <[email protected]>, 2005-6.
-   Cleaned up and adapted to platform_device by Felix Fietkau <[email protected]>
-
-   This work is redistributed under the terms of the GNU General Public License.
-*/
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/time.h>
-#include <linux/wait.h>
-#include <linux/fs.h>
-#include <linux/genhd.h>
-#include <linux/blkdev.h>
-#include <linux/blkpg.h>
-#include <linux/hdreg.h>
-#include <linux/platform_device.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/gpio.h>
-
-#include <asm/rc32434/rb.h>
-
-#ifdef DEBUG
-#define DEBUGP printk
-#define DLEVEL 1
-#else
-#define DEBUGP(format, args...)
-#define DLEVEL 0
-#endif
-
-#define CF_MIPS_MAJOR 13
-#define MAJOR_NR	CF_MIPS_MAJOR
-#define CF_MAX_PART	16		/* max 15 partitions */
-
-#include "ata.h"
-
-//extern struct block_device_operations cf_bdops;
-
-// static struct hd_struct cf_parts[CF_MAX_PART];
-// static int cf_part_sizes[CF_MAX_PART];
-// static int cf_hsect_sizes[CF_MAX_PART];
-// static int cf_max_sectors[CF_MAX_PART];
-// static int cf_blksize_sizes[CF_MAX_PART];
-
-// static spinlock_t lock = SPIN_LOCK_UNLOCKED;
-
-// volatile int cf_busy = 0;
-
-static struct request *active_req = NULL;
-
-static int cf_open (struct inode *, struct file *);
-static int cf_release (struct inode *, struct file *);
-static int cf_ioctl (struct inode *, struct file *, unsigned, unsigned long);
-
-static void cf_request(request_queue_t * q);
-static int cf_transfer(const struct request *req);
-
-/*long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
-long (*compat_ioctl) (struct file *, unsigned, unsigned long);*/
-// int (*direct_access) (struct block_device *, sector_t, unsigned long *);
-// int (*media_changed) (struct gendisk *);
-// int (*revalidate_disk) (struct gendisk *);
-
-static struct block_device_operations cf_bdops = {
-      .owner = THIS_MODULE,
-      .open = cf_open,
-      .release = cf_release,
-      .ioctl = cf_ioctl,
-      .media_changed = NULL,
-      .unlocked_ioctl = NULL,
-      .revalidate_disk = NULL,
-      .compat_ioctl = NULL,
-      .direct_access = NULL
-};
-
-
-int cf_mips_probe(struct platform_device *pdev)
-{
-	struct gendisk* cf_gendisk=NULL;
-	struct cf_device *cdev = (struct cf_device *) pdev->dev.platform_data;
-	struct cf_mips_dev *dev;
-	struct resource *r;
-	int reg_result;
-
-	reg_result = register_blkdev(MAJOR_NR, "cf-mips");
-	if (reg_result < 0) {
-		printk(KERN_WARNING "cf-mips: can't get major %d\n", MAJOR_NR);
-		return reg_result;
-	}
-
-	dev = (struct cf_mips_dev *)kmalloc(sizeof(struct cf_mips_dev),GFP_KERNEL);
-	if (!dev)
-		goto out_err;
-	memset(dev, 0, sizeof(struct cf_mips_dev));
-	cdev->dev = dev;
-	
-	dev->pin = cdev->gpio_pin;
-	dev->irq = platform_get_irq_byname(pdev, "cf_irq");
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cf_membase");
-	dev->base = (void *) r->start;
-	
-	if (cf_init(dev)) goto out_err;
-	printk("init done");
-	
-	spin_lock_init(&dev->lock);
-	dev->queue = blk_init_queue(cf_request,&dev->lock);
-	if (!dev->queue){
-		printk(KERN_ERR "cf-mips: no mem for queue\n");
-		goto out_err;
-	}
-	blk_queue_max_sectors(dev->queue,ATA_MAX_SECT_PER_CMD);
-
-	/* For memory devices, it is always better to avoid crossing segments
-	inside the same request. */
-/*	if (dev->dtype==0x848A){
-		printk(KERN_INFO "Setting boundary for cf to 0x%x",(dev->block_size*512)-1);
-		blk_queue_segment_boundary(dev->queue, (dev->block_size*512)-1);
-	}*/
-
-	dev->gd = alloc_disk(CF_MAX_PART);
-	cf_gendisk = dev->gd;
-	cdev->gd = dev->gd;
-	if (!cf_gendisk) goto out_err; /* Last of these goto's */
-	
-	cf_gendisk->major = MAJOR_NR;
-	cf_gendisk->first_minor = 0;
-	cf_gendisk->queue=dev->queue;
-	BUG_ON(cf_gendisk->minors != CF_MAX_PART);
-	strcpy(cf_gendisk->disk_name,"cfa");
-	cf_gendisk->fops = &cf_bdops;
-	cf_gendisk->flags = 0 ; /* is not yet GENHD_FL_REMOVABLE */
-	cf_gendisk->private_data=dev;
-	
-	set_capacity(cf_gendisk,dev->sectors * CF_KERNEL_MUL);
-	
-	/* Let the disk go live */
-	add_disk(cf_gendisk);
-#if 0
-	result = cf_init();
-	
-	/* default cfg for all partitions */
-	memset(cf_parts, 0, sizeof (cf_parts[0]) * CF_MAX_PART);
-	memset(cf_part_sizes, 0, sizeof (cf_part_sizes[0]) * CF_MAX_PART);
-	for (i = 0; i < CF_MAX_PART; ++i) {
-		cf_hsect_sizes[i] = CF_SECT_SIZE;
-		cf_max_sectors[i] = ATA_MAX_SECT_PER_CMD;
-		cf_blksize_sizes[i] = BLOCK_SIZE;
-	}
-
-	/* setup info for whole disk (partition 0) */
-	cf_part_sizes[0] = cf_sectors / 2;
-	cf_parts[0].nr_sects = cf_sectors;
-
-	blk_size[MAJOR_NR] = cf_part_sizes;
-	blksize_size[MAJOR_NR] = cf_blksize_sizes;
-	max_sectors[MAJOR_NR] = cf_max_sectors;
-	hardsect_size[MAJOR_NR] = cf_hsect_sizes;
-	read_ahead[MAJOR_NR] = 8;	/* (4kB) */
-
-	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
-
-	add_gendisk(&cf_gendisk);
-#endif
-// 	printk(KERN_INFO "cf-mips partition check: \n");
-// 	register_disk(cf_gendisk, MKDEV(MAJOR_NR, 0), CF_MAX_PART,
-// 		      &cf_bdops, dev->sectors);
-	return 0;
-
-out_err:
-	if (dev->queue){
-		blk_cleanup_queue(dev->queue);
-	}
-	if (reg_result) {
-		unregister_blkdev(MAJOR_NR, "cf-mips");
-		return reg_result;
-	}
-	if (dev){
-		cf_cleanup(dev);
-		kfree(dev);
-	}
-	return 1;
-}
-
-static int
-cf_mips_remove(struct platform_device *pdev)
-{
-	struct cf_device *cdev = (struct cf_device *) pdev->dev.platform_data;
-	struct cf_mips_dev *dev = (struct cf_mips_dev *) cdev->dev;
-	
-	unregister_blkdev(MAJOR_NR, "cf-mips");
-	blk_cleanup_queue(dev->queue);
-
-	del_gendisk(dev->gd);
-	cf_cleanup(dev);
-	return 0;
-}
-
-
-static struct platform_driver cf_driver = {
-	.driver.name = "rb500-cf",
-	.probe = cf_mips_probe,
-	.remove = cf_mips_remove,
-};
-
-static int __init cf_mips_init(void)
-{
-	printk(KERN_INFO "cf-mips module loaded\n");
-	return platform_driver_register(&cf_driver);
-}
-
-static void cf_mips_cleanup(void)
-{
-	platform_driver_unregister(&cf_driver);
-	printk(KERN_INFO "cf-mips module removed\n");
-}
-
-module_init(cf_mips_init);
-module_exit(cf_mips_cleanup);
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_BLOCKDEV_MAJOR(CF_MIPS_MAJOR);
-
-
-static int cf_open(struct inode *inode, struct file *filp)
-{
-	struct cf_mips_dev  *dev=inode->i_bdev->bd_disk->private_data;
-	int minor = MINOR(inode->i_rdev);
-	
-	if (minor >= CF_MAX_PART)
-		return -ENODEV;
-	//DEBUGP(KERN_INFO "cf-mips module opened, minor %d\n", minor);
-	spin_lock(&dev->lock);
-	dev->users++;
-	spin_unlock(&dev->lock);
-	filp->private_data=dev;
-	
-	/* dirty workaround to set CFRDY GPIO as an input when some other
-	   program sets it as an output */
-	gpio_set_value(dev->pin, 0);
-	return 0;		/* success */
-}
-
-static int cf_release(struct inode *inode, struct file *filp)
-{
-	int minor = MINOR(inode->i_rdev);
-	struct cf_mips_dev  *dev=inode->i_bdev->bd_disk->private_data;
-	spin_lock(&dev->lock);
-	dev->users--;
-	spin_unlock(&dev->lock);
-	return 0;
-}
-
-static int cf_ioctl(struct inode *inode, struct file *filp,
-	 unsigned int cmd, unsigned long arg)
-{
-	unsigned minor = MINOR(inode->i_rdev);
-	struct cf_mips_dev  *dev=inode->i_bdev->bd_disk->private_data;
-
-	DEBUGP(KERN_INFO "cf_ioctl cmd %u\n", cmd);
-	switch (cmd) {
-	case BLKRRPART:	/* re-read partition table */
-		if (!capable(CAP_SYS_ADMIN))
-			return -EACCES;
-		printk(KERN_INFO "cf-mips partition check: \n");
-		register_disk(dev->gd);
-		return 0;
-
-	case HDIO_GETGEO:
-		{
-			struct hd_geometry geo;
-			geo.cylinders = dev->cyl;
-			geo.heads = dev->head;
-			geo.sectors = dev->spt;
-			geo.start = (*dev->gd->part)[minor].start_sect;
-			if (copy_to_user((void *) arg, &geo, sizeof (geo)))
-				return -EFAULT;
-		}
-		return 0;
-	}
-
-	return -EINVAL;		/* unknown command */
-}
-
-static void cf_request(request_queue_t * q)
-{
-	struct cf_mips_dev* dev;
-	
-	struct request * req;
-	int status;
-
-	/* We could have q->queuedata = dev , but haven't yet. */
-	if (active_req)
-		return;
-
-	while ((req=elv_next_request(q))!=NULL){
-		dev=req->rq_disk->private_data;
-		status=cf_transfer(req);
-		if (status==CF_TRANS_IN_PROGRESS){
-			active_req=req;
-			return;
-		}
-		end_request(req,status);
-	}
-}
-
-static int cf_transfer(const struct request *req)
-{
-	struct cf_mips_dev* dev=req->rq_disk->private_data;
-
-	if (!blk_fs_request(req)){	
-		if (printk_ratelimit())
-			printk(KERN_WARNING "cf-mips: skipping non-fs request 0x%x\n",req->cmd[0]);
-		return CF_TRANS_FAILED;
-	}
-	
-	return cf_do_transfer(dev,req->sector,req->current_nr_sectors,req->buffer,rq_data_dir(req));
-}
-
-void cf_async_trans_done(struct cf_mips_dev * dev,int result)
-{
-	struct request *req;
-	
-	spin_lock(&dev->lock);
-	req=active_req;
-	active_req=NULL;
-	end_request(req,result);
-	spin_unlock(&dev->lock);
-
-	spin_lock(&dev->lock);
-	cf_request(dev->queue);
-	spin_unlock(&dev->lock);
-}
-

+ 0 - 240
target/linux/rb532/files-2.6.23/drivers/char/watchdog/rc32434_wdt.c

@@ -1,240 +0,0 @@
-/*
- *	RC32434_WDT 0.01: IDT Interprise 79RC32434 watchdog driver 
- *	Copyright (c) Ondrej Zajicek <[email protected]>, 2006
- *
- *	based on
- *
- *	SoftDog	0.05:	A Software Watchdog Device
- *
- *	(c) Copyright 1996 Alan Cox <[email protected]>, 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.
- *	
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/reboot.h>
-#include <linux/smp_lock.h>
-#include <linux/init.h>
-#include <asm/bootinfo.h>
-#include <asm/time.h>
-#include <asm/uaccess.h>
-#include <asm/rc32434/integ.h>
-
-#define DEFAULT_TIMEOUT	15		/* (secs) Default is 15 seconds */
-#define MAX_TIMEOUT	20		
-/*
- * (secs) Max is 20 seconds 
- * (max frequency of counter is ~200 MHz, counter is 32-bit unsigned int) 
- */
-
-#define NAME "rc32434_wdt"
-#define VERSION "0.1"
-
-static INTEG_t rc_wdt = (INTEG_t) INTEG_VirtualAddress;                                                                     
-
-static int expect_close = 0;
-static int access = 0;
-static int timeout = 0;
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-MODULE_LICENSE("GPL");
-
-
-static inline void start_wdt(void)
-{
-	rc_wdt -> wtcount = 0;
-	rc_wdt -> errcs |= ERRCS_wre_m;
-	rc_wdt -> wtc   |= WTC_en_m;
-}
-
-static inline void stop_wdt(void)
-{
-	rc_wdt -> wtc   &= ~WTC_en_m;
-	rc_wdt -> errcs &= ~ERRCS_wre_m;
-}
-
-static inline void set_wdt(int new_timeout)
-{
-	u32 cmp = new_timeout * mips_hpt_frequency;
-	u32 state;
-	
-	timeout = new_timeout;
-	/*
-	 * store and disable WTC
-	 */
-	state = rc_wdt -> wtc & WTC_en_m;
-	rc_wdt -> wtc   &= ~WTC_en_m;
-
-	rc_wdt -> wtcount = 0;
-	rc_wdt -> wtcompare = cmp;
-
-	/*
-	 * restore WTC
-	 */	
-	rc_wdt -> wtc |= state;
-}
-
-static inline void update_wdt(void)
-{
-	rc_wdt -> wtcount = 0;
-}
-
-/*
- *	Allow only one person to hold it open
- */
- 
-static int wdt_open(struct inode *inode, struct file *file)
-{
-	if (access)
-		return -EBUSY;
-	if (nowayout) {
-		__module_get(THIS_MODULE);
-	}
-	/*
-	 *	Activate timer
-	 */
-	start_wdt();
-	printk(KERN_INFO NAME ": enabling watchdog timer\n");
-	access = 1;
-	return 0;
-}
-
-static int wdt_release(struct inode *inode, struct file *file)
-{
-	/*
-	 *	Shut off the timer.
-	 * 	Lock it in if it's a module and we set nowayout
-	 */
-	if (expect_close && nowayout == 0) {
-		stop_wdt ();
-		printk(KERN_INFO NAME ": disabling watchdog timer\n");
-		module_put(THIS_MODULE);
-	} else {
-		printk (KERN_CRIT NAME ": device closed unexpectedly.  WDT will not stop!\n");
-	}
-	access = 0;
-	return 0;
-}
-
-static ssize_t wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-	/*
-	 *	Refresh the timer.
-	 */
-	if (len) {
-		if (!nowayout) {
-			size_t i;
-
-			/* In case it was set long ago */
-			expect_close = 0;
-
-			for (i = 0; i != len; i++) {
-				char c;
-				if (get_user(c, data + i))
-					return -EFAULT;
-				if (c == 'V')
-					expect_close = 1;
-			}
-		}
-		update_wdt ();
-		return len;
-	}
-	return 0;
-}
-
-static int wdt_ioctl(struct inode *inode, struct file *file,
-	unsigned int cmd, unsigned long arg)
-{
-	int new_timeout;
-	static struct watchdog_info ident = {
-		.options =		WDIOF_SETTIMEOUT |
-					WDIOF_KEEPALIVEPING |
-					WDIOF_MAGICCLOSE,
-		.firmware_version =	0,
-		.identity =		"RC32434_WDT Watchdog",
-	};
-	switch (cmd) {
-		default:
-			return -ENOTTY;
-		case WDIOC_GETSUPPORT:
-			if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
-				return -EFAULT;
-			return 0;
-		case WDIOC_GETSTATUS:
-		case WDIOC_GETBOOTSTATUS:
-			return put_user(0,(int *)arg);
-		case WDIOC_KEEPALIVE:
-			update_wdt();
-			return 0;
-		case WDIOC_SETTIMEOUT:
-			if (get_user(new_timeout, (int *)arg))
-				return -EFAULT;
-			if (new_timeout < 1)
-				return -EINVAL;
-			if (new_timeout > MAX_TIMEOUT)
-				return -EINVAL;
-			set_wdt(new_timeout);
-			/* Fall */
-		case WDIOC_GETTIMEOUT:
-			return put_user(timeout, (int *)arg);
-	}
-}
-
-static struct file_operations wdt_fops = {
-	owner:		THIS_MODULE,
-	llseek:		no_llseek,
-	write:		wdt_write,
-	ioctl:		wdt_ioctl,
-	open:		wdt_open,
-	release:	wdt_release,
-};
-
-static struct miscdevice wdt_miscdev = {
-	minor:		WATCHDOG_MINOR,
-	name:		"watchdog",
-	fops:		&wdt_fops,
-};
-
-static char banner[] __initdata = KERN_INFO NAME ": Watchdog Timer version " VERSION ", timer margin: %d sec\n";
-
-static int __init watchdog_init(void)
-{
-	int ret;
-
-	/*
-  	 * There should be check for RC32434 SoC
-	 */
-	if (mips_machgroup != MACH_GROUP_MIKROTIK) return -1;
-
-	ret = misc_register(&wdt_miscdev);
-
-	if (ret)
-		return ret;
-
-	stop_wdt();
-	set_wdt(DEFAULT_TIMEOUT);
-
-	printk(banner, timeout);
-
-	return 0;
-}
-
-static void __exit watchdog_exit(void)
-{
-	misc_deregister(&wdt_miscdev);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_exit);

+ 0 - 81
target/linux/rb532/files-2.6.23/drivers/leds/leds-rb500.c

@@ -1,81 +0,0 @@
-/*
- * linux/drivers/leds/leds-rb500.c
- *
- * Copyright (C) 2006
- *     Twente Institute for Wireless and Mobile Communications BV
- *
- * 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 (see file GPLv2).
- *
- * Author: Tjalling Hattink <[email protected]>
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/leds.h>
-#include <asm/rc32434/rb.h>
-
-static void rb500led_amber_set(struct led_classdev *led_cdev, enum led_brightness value)
-{
-	if (value)
-		changeLatchU5(LO_ULED, 0);
-	else
-		changeLatchU5(0, LO_ULED);
-}
-
-static struct led_classdev rb500_amber_led = {
-	.name			= "rb500led:amber",
-	.default_trigger	= "ide-disk",
-	.brightness_set		= rb500led_amber_set,
-};
-
-static int rb500led_probe(struct platform_device *pdev)
-{
-	int ret;
-
-	changeLatchU5(0, LO_ULED);
-
-	ret = led_classdev_register(&pdev->dev, &rb500_amber_led);
-
-	return ret;
-}
-
-static int rb500led_remove(struct platform_device *pdev)
-{
-	led_classdev_unregister(&rb500_amber_led);
-
-	return 0;
-}
-
-static struct platform_driver rb500led_driver = {
-	.probe		= rb500led_probe,
-	.remove		= rb500led_remove,
-	.driver		= {
-		.name		= "rb500-led",
-	},
-};
-
-static int __init rb500led_init(void)
-{
-	return platform_driver_register(&rb500led_driver);
-}
-
-static void __exit rb500led_exit(void)
-{
- 	platform_driver_unregister(&rb500led_driver);
-}
-
-module_init(rb500led_init);
-module_exit(rb500led_exit);
-
-MODULE_AUTHOR("[email protected]");
-MODULE_DESCRIPTION("Mikrotik RB500 LED driver");
-MODULE_LICENSE("GPL");

+ 0 - 1167
target/linux/rb532/files-2.6.23/drivers/net/korina.c

@@ -1,1167 +0,0 @@
-/**************************************************************************
- *
- *  BRIEF MODULE DESCRIPTION
- *     Driver for the IDT RC32434 on-chip ethernet controller.
- *
- *  Copyright 2004 IDT Inc. ([email protected])
- *  Copyright 2006 Felix Fietkau <[email protected]>
- *         
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- **************************************************************************
- * May 2004 rkt, neb
- *
- * Based on the driver developed by B. Maruthanayakam, H. Kou and others.
- *
- * Aug 2004 Sadik
- *
- * Added NAPI
- *
- **************************************************************************
- */
-
-#include <linux/autoconf.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/moduleparam.h>
-#include <linux/sched.h>
-#include <linux/ctype.h>
-#include <linux/types.h>
-#include <linux/fcntl.h>
-#include <linux/interrupt.h>
-#include <linux/ptrace.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/proc_fs.h>
-#include <linux/in.h>
-#include <linux/slab.h>
-#include <linux/string.h>
-#include <linux/delay.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <linux/errno.h>
-#include <linux/platform_device.h>
-#include <asm/bootinfo.h>
-#include <asm/system.h>
-#include <asm/bitops.h>
-#include <asm/pgtable.h>
-#include <asm/segment.h>
-#include <asm/io.h>
-#include <asm/dma.h>
-
-#include <asm/rc32434/rb.h>
-#include "rc32434_eth.h"
-
-#define DRIVER_VERSION "(mar2904)"
-
-#define DRIVER_NAME "rc32434 Ethernet driver. " DRIVER_VERSION
-
-#define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \
-			           ((dev)->dev_addr[1]))
-#define STATION_ADDRESS_LOW(dev)  (((dev)->dev_addr[2] << 24) | \
-				   ((dev)->dev_addr[3] << 16) | \
-				   ((dev)->dev_addr[4] << 8)  | \
-				   ((dev)->dev_addr[5]))
-
-#define MII_CLOCK 1250000 				/* no more than 2.5MHz */
-#define CONFIG_IDT_USE_NAPI 1
-
-
-static inline void rc32434_abort_tx(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	rc32434_abort_dma(dev, lp->tx_dma_regs);
-	
-}
-
-static inline void rc32434_abort_rx(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	rc32434_abort_dma(dev, lp->rx_dma_regs);
-	
-}
-
-static inline void rc32434_start_tx(struct rc32434_local *lp,  volatile DMAD_t td)
-{
-	rc32434_start_dma(lp->tx_dma_regs, CPHYSADDR(td));
-}
-
-static inline void rc32434_start_rx(struct rc32434_local *lp, volatile DMAD_t rd)
-{
-	rc32434_start_dma(lp->rx_dma_regs, CPHYSADDR(rd));
-}
-
-static inline void rc32434_chain_tx(struct rc32434_local *lp, volatile DMAD_t td)
-{
-	rc32434_chain_dma(lp->tx_dma_regs, CPHYSADDR(td));
-}
-
-static inline void rc32434_chain_rx(struct rc32434_local *lp, volatile DMAD_t rd)
-{
-	rc32434_chain_dma(lp->rx_dma_regs, CPHYSADDR(rd));
-}
-
-#ifdef RC32434_PROC_DEBUG
-static int rc32434_read_proc(char *buf, char **start, off_t fpos,
-			     int length, int *eof, void *data)
-{
-	struct net_device *dev = (struct net_device *)data;
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	int len = 0;
-	
-	/* print out header */
-	len += sprintf(buf + len, "\n\tKorina Ethernet Debug\n\n");
-	len += sprintf (buf + len,
-			"DMA halt count      = %10d, DMA run count = %10d\n",
-			lp->dma_halt_cnt, lp->dma_run_cnt);
-	
-	if (fpos >= len) {
-		*start = buf;
-		*eof = 1;
-		return 0;
-	}
-	*start = buf + fpos;
-	
-	if ((len -= fpos) > length) 
-		return length;	
-	*eof = 1;
-	
-	return len;
-	
-}
-#endif
-
-
-/*
- * Restart the RC32434 ethernet controller. 
- */
-static int rc32434_restart(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	
-	/*
-	 * Disable interrupts
-	 */
-	disable_irq(lp->rx_irq);
-	disable_irq(lp->tx_irq);
-#ifdef	RC32434_REVISION
-	disable_irq(lp->ovr_irq);
-#endif	
-	disable_irq(lp->und_irq);
-	
-	/* Mask F E bit in Tx DMA */
-	__raw_writel(__raw_readl(&lp->tx_dma_regs->dmasm) | DMASM_f_m | DMASM_e_m, &lp->tx_dma_regs->dmasm);
-	/* Mask D H E bit in Rx DMA */
-	__raw_writel(__raw_readl(&lp->rx_dma_regs->dmasm) | DMASM_d_m | DMASM_h_m | DMASM_e_m, &lp->rx_dma_regs->dmasm);
-	
-	rc32434_init(dev);
-	rc32434_multicast_list(dev);
-	
-	enable_irq(lp->und_irq);
-#ifdef	RC32434_REVISION
-	enable_irq(lp->ovr_irq);
-#endif
-	enable_irq(lp->tx_irq);
-	enable_irq(lp->rx_irq);
-	
-	return 0;
-}
-
-static int rc32434_probe(struct platform_device *pdev)
-{
-	struct korina_device *bif = (struct korina_device *) pdev->dev.platform_data;
-	struct rc32434_local *lp = NULL;
-	struct net_device *dev = NULL;
-	struct resource *r;
-	int i, retval,err;
-	
-	dev = alloc_etherdev(sizeof(struct rc32434_local));
-	if(!dev) {
-		ERR("Korina_eth: alloc_etherdev failed\n");
-		return -1;
-	}
-
-	platform_set_drvdata(pdev, dev);
-	SET_MODULE_OWNER(dev);
-	bif->dev = dev;
-	
-	memcpy(dev->dev_addr, bif->mac, 6);
-
-	/* Initialize the device structure. */
-	if (dev->priv == NULL) {
-		lp = (struct rc32434_local *)kmalloc(sizeof(*lp), GFP_KERNEL);
-		memset(lp, 0, sizeof(struct rc32434_local));
-	} 
-	else {
-		lp = (struct rc32434_local *)dev->priv;
-	}
-	
-	lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx");
-	lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx");
-	lp->ovr_irq = platform_get_irq_byname(pdev, "korina_ovr");
-	lp->und_irq = platform_get_irq_byname(pdev, "korina_und");
-
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs");
-	dev->base_addr = r->start;
-	lp->eth_regs = ioremap_nocache(r->start, r->end - r->start);
-	if (!lp->eth_regs) {
-		ERR("Can't remap eth registers\n");
-		retval = -ENXIO;
-		goto probe_err_out;
-	}
-
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_rx");
-	lp->rx_dma_regs = ioremap_nocache(r->start, r->end - r->start);
-	if (!lp->rx_dma_regs) {
-		ERR("Can't remap Rx DMA registers\n");
-		retval = -ENXIO;
-		goto probe_err_out;
-	}
-
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_tx");
-	lp->tx_dma_regs = ioremap_nocache(r->start, r->end - r->start);
-	if (!lp->tx_dma_regs) {
-		ERR("Can't remap Tx DMA registers\n");
-		retval = -ENXIO;
-		goto probe_err_out;
-	}
-	
-#ifdef RC32434_PROC_DEBUG
-	lp->ps = create_proc_read_entry (bif->name, 0, proc_net,
-					 rc32434_read_proc, dev);
-#endif
-	
-	lp->td_ring =	(DMAD_t)kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
-	if (!lp->td_ring) {
-		ERR("Can't allocate descriptors\n");
-		retval = -ENOMEM;
-		goto probe_err_out;
-	}
-	
-	dma_cache_inv((unsigned long)(lp->td_ring), TD_RING_SIZE + RD_RING_SIZE);
-	
-	/* now convert TD_RING pointer to KSEG1 */
-	lp->td_ring = (DMAD_t )KSEG1ADDR(lp->td_ring);
-	lp->rd_ring = &lp->td_ring[RC32434_NUM_TDS];
-	
-	
-	spin_lock_init(&lp->lock);
-	
-	/* just use the rx dma irq */
-	dev->irq = lp->rx_irq;
-	
-	dev->priv = lp;
-	
-	dev->open = rc32434_open;
-	dev->stop = rc32434_close;
-	dev->hard_start_xmit = rc32434_send_packet;
-	dev->get_stats	= rc32434_get_stats;
-	dev->set_multicast_list = &rc32434_multicast_list;
-	dev->tx_timeout = rc32434_tx_timeout;
-	dev->watchdog_timeo = RC32434_TX_TIMEOUT;
-
-#ifdef CONFIG_IDT_USE_NAPI
-	dev->poll = rc32434_poll;
-	dev->weight = 64;
-	printk("Using NAPI with weight %d\n",dev->weight);
-#else
-	lp->rx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
-	tasklet_init(lp->rx_tasklet, rc32434_rx_tasklet, (unsigned long)dev);
-#endif
-	lp->tx_tasklet = kmalloc(sizeof(struct tasklet_struct), GFP_KERNEL);
-	tasklet_init(lp->tx_tasklet, rc32434_tx_tasklet, (unsigned long)dev);
-	
-	if ((err = register_netdev(dev))) {
-		printk(KERN_ERR "rc32434 ethernet. Cannot register net device %d\n", err);
-		free_netdev(dev);
-		retval = -EINVAL;
-		goto probe_err_out;
-	}
-	
-	INFO("Rx IRQ %d, Tx IRQ %d, ", lp->rx_irq, lp->tx_irq);
-	for (i = 0; i < 6; i++) {
-		printk("%2.2x", dev->dev_addr[i]);
-		if (i<5)
-			printk(":");
-	}
-	printk("\n");
-	
-	return 0;
-	
- probe_err_out:
-	rc32434_cleanup_module();
-	ERR(" failed.  Returns %d\n", retval);
-	return retval;
-	
-}
-
-static int rc32434_remove(struct platform_device *pdev)
-{
-	struct korina_device *bif = (struct korina_device *) pdev->dev.platform_data;
-	
-	if (bif->dev != NULL) {
-		struct rc32434_local *lp = (struct rc32434_local *)bif->dev->priv;
-		if (lp != NULL) {
-			if (lp->eth_regs)
-				iounmap((void*)lp->eth_regs);
-			if (lp->rx_dma_regs)
-				iounmap((void*)lp->rx_dma_regs);
-			if (lp->tx_dma_regs)
-				iounmap((void*)lp->tx_dma_regs);
-			if (lp->td_ring)
-				kfree((void*)KSEG0ADDR(lp->td_ring));
-			
-#ifdef RC32434_PROC_DEBUG
-			if (lp->ps) {
-				remove_proc_entry(bif->name, proc_net);
-			}
-#endif
-			kfree(lp);
-		}
-		
-		platform_set_drvdata(pdev, NULL);
-		unregister_netdev(bif->dev);
-		free_netdev(bif->dev);
-		kfree(bif->dev);
-	}
-	return 0;
-}
-
-
-static int rc32434_open(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	
-	/* Initialize */
-	if (rc32434_init(dev)) {
-		ERR("Error: cannot open the Ethernet device\n");
-		return -EAGAIN;
-	}
-	
-	/* Install the interrupt handler that handles the Done Finished Ovr and Und Events */	
-	if (request_irq(lp->rx_irq, &rc32434_rx_dma_interrupt,
-		  SA_SHIRQ | SA_INTERRUPT,
-			"Korina ethernet Rx", dev)) {
-		ERR(": unable to get Rx DMA IRQ %d\n",
-		    lp->rx_irq);
-		return -EAGAIN;
-	}
-	if (request_irq(lp->tx_irq, &rc32434_tx_dma_interrupt,
-		  SA_SHIRQ | SA_INTERRUPT,
-			"Korina ethernet Tx", dev)) {
-		ERR(": unable to get Tx DMA IRQ %d\n",
-		    lp->tx_irq);
-		free_irq(lp->rx_irq, dev);
-		return -EAGAIN;
-	}
-	
-#ifdef	RC32434_REVISION
-	/* Install handler for overrun error. */
-	if (request_irq(lp->ovr_irq, &rc32434_ovr_interrupt,
-			SA_SHIRQ | SA_INTERRUPT,
-			"Ethernet Overflow", dev)) {
-		ERR(": unable to get OVR IRQ %d\n",
-		    lp->ovr_irq);
-		free_irq(lp->rx_irq, dev);
-		free_irq(lp->tx_irq, dev);
-		return -EAGAIN;
-	}
-#endif
-	
-	/* Install handler for underflow error. */
-	if (request_irq(lp->und_irq, &rc32434_und_interrupt,
-			SA_SHIRQ | SA_INTERRUPT,
-			"Ethernet Underflow", dev)) {
-		ERR(": unable to get UND IRQ %d\n",
-		    lp->und_irq);
-		free_irq(lp->rx_irq, dev);
-		free_irq(lp->tx_irq, dev);
-#ifdef	RC32434_REVISION		
-		free_irq(lp->ovr_irq, dev);		
-#endif
-		return -EAGAIN;
-	}
-	
-	
-	return 0;
-}
-
-
-
-
-static int rc32434_close(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	u32 tmp;
-	
-	/* Disable interrupts */
-	disable_irq(lp->rx_irq);
-	disable_irq(lp->tx_irq);
-#ifdef	RC32434_REVISION
-	disable_irq(lp->ovr_irq);
-#endif
-	disable_irq(lp->und_irq);
-	
-	tmp = __raw_readl(&lp->tx_dma_regs->dmasm);
-	tmp = tmp | DMASM_f_m | DMASM_e_m;
-	__raw_writel(tmp, &lp->tx_dma_regs->dmasm);
-	
-	tmp = __raw_readl(&lp->rx_dma_regs->dmasm);
-	tmp = tmp | DMASM_d_m | DMASM_h_m | DMASM_e_m;
-	__raw_writel(tmp, &lp->rx_dma_regs->dmasm);
-	
-	free_irq(lp->rx_irq, dev);
-	free_irq(lp->tx_irq, dev);
-#ifdef	RC32434_REVISION	
-	free_irq(lp->ovr_irq, dev);
-#endif
-	free_irq(lp->und_irq, dev);
-	return 0;
-}
-
-
-/* transmit packet */
-static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev)
-{
-	struct rc32434_local		*lp = (struct rc32434_local *)dev->priv;
-	unsigned long 			flags;
-	u32					length;
-	DMAD_t				td;
-	
-	
-	spin_lock_irqsave(&lp->lock, flags);
-	
-	td = &lp->td_ring[lp->tx_chain_tail];
-	
-	/* stop queue when full, drop pkts if queue already full */
-	if(lp->tx_count >= (RC32434_NUM_TDS - 2)) {
-		lp->tx_full = 1;
-		
-		if(lp->tx_count == (RC32434_NUM_TDS - 2)) {
-			netif_stop_queue(dev);
-		}
-		else {
-			lp->stats.tx_dropped++;
-			dev_kfree_skb_any(skb);
-			spin_unlock_irqrestore(&lp->lock, flags);
-			return 1;
-		}	   
-	}	 
-	
-	lp->tx_count ++;
-	
-	lp->tx_skb[lp->tx_chain_tail] = skb;
-	
-	length = skb->len;
-	dma_cache_wback((u32)skb->data, skb->len);
-	
-	/* Setup the transmit descriptor. */
-	dma_cache_inv((u32) td, sizeof(*td));
-	td->ca = CPHYSADDR(skb->data);
-	
-	if(__raw_readl(&(lp->tx_dma_regs->dmandptr)) == 0) {
-		if( lp->tx_chain_status == empty ) {
-			td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m;                                /*  Update tail      */
-			lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK;                          /*   Move tail       */
-			__raw_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR    */
-			lp->tx_chain_head = lp->tx_chain_tail;                                                  /* Move head to tail */
-		}
-		else {
-			td->control = DMA_COUNT(length) |DMAD_cof_m|DMAD_iof_m;                                 /* Update tail */
-			lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &=  ~(DMAD_cof_m);          /* Link to prev */
-			lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link =  CPHYSADDR(td);              /* Link to prev */
-			lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK;                          /* Move tail */
-			__raw_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr)); /* Write to NDPTR */
-			lp->tx_chain_head = lp->tx_chain_tail;                                                  /* Move head to tail */
-			lp->tx_chain_status = empty;
-		}
-	}
-	else {
-		if( lp->tx_chain_status == empty ) {
-			td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m;                                /* Update tail */
-			lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK;                          /* Move tail */
-			lp->tx_chain_status = filled;
-		}
-		else {
-			td->control = DMA_COUNT(length) |DMAD_cof_m |DMAD_iof_m;                                /* Update tail */
-			lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].control &=  ~(DMAD_cof_m);          /* Link to prev */
-			lp->td_ring[(lp->tx_chain_tail-1)& RC32434_TDS_MASK].link =  CPHYSADDR(td);              /* Link to prev */
-			lp->tx_chain_tail = (lp->tx_chain_tail + 1) & RC32434_TDS_MASK;                          /* Move tail */
-		}
-	}
-	dma_cache_wback((u32) td, sizeof(*td));
-	
-	dev->trans_start = jiffies;				
-	
-	spin_unlock_irqrestore(&lp->lock, flags);
-	
-	return 0;
-}
-
-
-/* Ethernet MII-PHY Handler */
-static void rc32434_mii_handler(unsigned long data)
-{
-	struct net_device *dev = (struct net_device *)data;		
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	unsigned long 	flags;
-	unsigned long duplex_status;
-	int port_addr = (lp->rx_irq == 0x2c? 1:0) << 8;
-	
-	spin_lock_irqsave(&lp->lock, flags);
-	
-	/* Two ports are using the same MII, the difference is the PHY address */
-	__raw_writel(0, &rc32434_eth0_regs->miimcfg);  
-	__raw_writel(0, &rc32434_eth0_regs->miimcmd);  
-	__raw_writel(port_addr |0x05, &rc32434_eth0_regs->miimaddr);  
-	__raw_writel(MIIMCMD_scn_m, &rc32434_eth0_regs->miimcmd);  
-	while(__raw_readl(&rc32434_eth0_regs->miimind) & MIIMIND_nv_m);
-	
-	ERR("irq:%x		port_addr:%x	RDD:%x\n", 
-	    lp->rx_irq, port_addr, __raw_readl(&rc32434_eth0_regs->miimrdd));
-	duplex_status = (__raw_readl(&rc32434_eth0_regs->miimrdd) & 0x140)? ETHMAC2_fd_m: 0;
-	if(duplex_status != lp->duplex_mode) {
-		ERR("The MII-PHY is Auto-negotiated to %s-Duplex mode for Eth-%x\n", duplex_status? "Full":"Half", lp->rx_irq == 0x2c? 1:0);		
-		lp->duplex_mode = duplex_status;
-		rc32434_restart(dev);		
-	}
-	
-	lp->mii_phy_timer.expires = jiffies + 10 * HZ;	
-	add_timer(&lp->mii_phy_timer);
-	
-	spin_unlock_irqrestore(&lp->lock, flags);
-	
-}
-
-#ifdef	RC32434_REVISION	
-/* Ethernet Rx Overflow interrupt */
-static irqreturn_t
-rc32434_ovr_interrupt(int irq, void *dev_id)
-{
-	struct net_device *dev = (struct net_device *)dev_id;
-	struct rc32434_local *lp;
-	unsigned int ovr;
-	irqreturn_t retval = IRQ_NONE;
-	
-	ASSERT(dev != NULL);
-	
-	lp = (struct rc32434_local *)dev->priv;
-	spin_lock(&lp->lock);
-	ovr = __raw_readl(&lp->eth_regs->ethintfc);
-	
-	if(ovr & ETHINTFC_ovr_m) {
-		netif_stop_queue(dev);
-		
-		/* clear OVR bit */
-		__raw_writel((ovr & ~ETHINTFC_ovr_m), &lp->eth_regs->ethintfc);
-		
-		/* Restart interface */
-		rc32434_restart(dev);
-		retval = IRQ_HANDLED;
-	}
-	spin_unlock(&lp->lock);
-	
-	return retval;
-}
-
-#endif
-
-
-/* Ethernet Tx Underflow interrupt */
-static irqreturn_t
-rc32434_und_interrupt(int irq, void *dev_id)
-{
-	struct net_device *dev = (struct net_device *)dev_id;
-	struct rc32434_local *lp;
-	unsigned int und;
-	irqreturn_t retval = IRQ_NONE;
-	
-	ASSERT(dev != NULL);
-	
-	lp = (struct rc32434_local *)dev->priv;
-	
-	spin_lock(&lp->lock);
-	
-	und = __raw_readl(&lp->eth_regs->ethintfc);
-	
-	if(und & ETHINTFC_und_m) {
-		netif_stop_queue(dev);
-		
-		__raw_writel((und & ~ETHINTFC_und_m), &lp->eth_regs->ethintfc);
-		
-		/* Restart interface */
-		rc32434_restart(dev);
-		retval = IRQ_HANDLED;
-	}
-	
-	spin_unlock(&lp->lock);
-	
-	return retval;
-}
-
-
-/* Ethernet Rx DMA interrupt */
-static irqreturn_t
-rc32434_rx_dma_interrupt(int irq, void *dev_id)
-{
-	struct net_device *dev = (struct net_device *)dev_id;
-	struct rc32434_local* lp;
-	volatile u32 dmas,dmasm;
-	irqreturn_t retval;
-	
-	ASSERT(dev != NULL);
-	
-	lp = (struct rc32434_local *)dev->priv;
-	
-	spin_lock(&lp->lock);
-	dmas = __raw_readl(&lp->rx_dma_regs->dmas);
-	if(dmas & (DMAS_d_m|DMAS_h_m|DMAS_e_m)) {
-		/* Mask D H E bit in Rx DMA */
-		dmasm = __raw_readl(&lp->rx_dma_regs->dmasm);
-		__raw_writel(dmasm | (DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm);
-#ifdef CONFIG_IDT_USE_NAPI
-		if(netif_rx_schedule_prep(dev))
-                        __netif_rx_schedule(dev);
-#else
-		tasklet_hi_schedule(lp->rx_tasklet);
-#endif
-		
-		if (dmas & DMAS_e_m)
-			ERR(": DMA error\n");
-		
-		retval = IRQ_HANDLED;
-	}
-	else
-		retval = IRQ_NONE;
-	
-	spin_unlock(&lp->lock);
-	return retval;
-}
-
-#ifdef CONFIG_IDT_USE_NAPI
-static int rc32434_poll(struct net_device *rx_data_dev, int *budget)
-#else
-static void rc32434_rx_tasklet(unsigned long rx_data_dev)
-#endif
-{
-	struct net_device *dev = (struct net_device *)rx_data_dev;	
-	struct rc32434_local* lp = netdev_priv(dev);
-	volatile DMAD_t  rd = &lp->rd_ring[lp->rx_next_done];
-	struct sk_buff *skb, *skb_new;
-	u8* pkt_buf;
-	u32 devcs, count, pkt_len, pktuncrc_len;
-	volatile u32 dmas;
-#ifdef CONFIG_IDT_USE_NAPI
-	u32 received = 0;
-	int rx_work_limit = min(*budget,dev->quota);
-#else
-	unsigned long 	flags;
-	spin_lock_irqsave(&lp->lock, flags);
-#endif
-
-	dma_cache_inv((u32)rd, sizeof(*rd));
-	while ( (count = RC32434_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) {
-#ifdef CONFIG_IDT_USE_NAPI
-		if(--rx_work_limit <0)
-                {
-                        break;
-                }
-#endif
-		/* init the var. used for the later operations within the while loop */
-		skb_new = NULL;
-		devcs = rd->devcs;
-		pkt_len = RCVPKT_LENGTH(devcs);
-		skb = lp->rx_skb[lp->rx_next_done];
-      
-		if (count < 64) {
-			lp->stats.rx_errors++;
-			lp->stats.rx_dropped++;			
-		}
-		else if ((devcs & ( ETHRX_ld_m)) !=	ETHRX_ld_m) {
-			/* check that this is a whole packet */
-			/* WARNING: DMA_FD bit incorrectly set in Rc32434 (errata ref #077) */
-			lp->stats.rx_errors++;
-			lp->stats.rx_dropped++;
-		}
-		else if ( (devcs & ETHRX_rok_m)  ) {
-			
-			{
-				/* must be the (first and) last descriptor then */
-				pkt_buf = (u8*)lp->rx_skb[lp->rx_next_done]->data;
-				
-				pktuncrc_len = pkt_len - 4;
-				/* invalidate the cache */
-				dma_cache_inv((unsigned long)pkt_buf, pktuncrc_len);
-				
-				/* Malloc up new buffer. */					  
-				skb_new = dev_alloc_skb(RC32434_RBSIZE + 2);					             	
-				
-				if (skb_new != NULL){
-					/* Make room */
-					skb_put(skb, pktuncrc_len);		    
-					
-					skb->protocol = eth_type_trans(skb, dev);
-					
-					/* pass the packet to upper layers */
-#ifdef CONFIG_IDT_USE_NAPI
-					netif_receive_skb(skb);
-#else
-					netif_rx(skb);
-#endif
-					
-					dev->last_rx = jiffies;
-					lp->stats.rx_packets++;
-					lp->stats.rx_bytes += pktuncrc_len;
-					
-					if (IS_RCV_MP(devcs))
-						lp->stats.multicast++;
-					
-					/* 16 bit align */						  
-					skb_reserve(skb_new, 2);	
-					
-					skb_new->dev = dev;
-					lp->rx_skb[lp->rx_next_done] = skb_new;
-				}
-				else {
-					ERR("no memory, dropping rx packet.\n");
-					lp->stats.rx_errors++;		
-					lp->stats.rx_dropped++;					
-				}
-			}
-			
-		}			
-		else {
-			/* This should only happen if we enable accepting broken packets */
-			lp->stats.rx_errors++;
-			lp->stats.rx_dropped++;
-			
-			/* add statistics counters */
-			if (IS_RCV_CRC_ERR(devcs)) {
-				DBG(2, "RX CRC error\n");
-				lp->stats.rx_crc_errors++;
-			} 
-			else if (IS_RCV_LOR_ERR(devcs)) {
-				DBG(2, "RX LOR error\n");
-				lp->stats.rx_length_errors++;
-			}				
-			else if (IS_RCV_LE_ERR(devcs)) {
-				DBG(2, "RX LE error\n");
-				lp->stats.rx_length_errors++;
-			}
-			else if (IS_RCV_OVR_ERR(devcs)) {
-				lp->stats.rx_over_errors++;
-			}
-			else if (IS_RCV_CV_ERR(devcs)) {
-				/* code violation */
-				DBG(2, "RX CV error\n");
-				lp->stats.rx_frame_errors++;
-			}
-			else if (IS_RCV_CES_ERR(devcs)) {
-				DBG(2, "RX Preamble error\n");
-			}
-		}
-		
-		rd->devcs = 0;
-		
-		/* restore descriptor's curr_addr */
-		if(skb_new)
-			rd->ca = CPHYSADDR(skb_new->data); 
-		else
-			rd->ca = CPHYSADDR(skb->data);
-		
-		rd->control = DMA_COUNT(RC32434_RBSIZE) |DMAD_cod_m |DMAD_iod_m;
-		lp->rd_ring[(lp->rx_next_done-1)& RC32434_RDS_MASK].control &=  ~(DMAD_cod_m); 	
-		
-		lp->rx_next_done = (lp->rx_next_done + 1) & RC32434_RDS_MASK;
-		dma_cache_wback((u32)rd, sizeof(*rd));
-		rd = &lp->rd_ring[lp->rx_next_done];
-		__raw_writel( ~DMAS_d_m, &lp->rx_dma_regs->dmas);
-	}	
-#ifdef CONFIG_IDT_USE_NAPI
-        dev->quota -= received;
-        *budget =- received;
-        if(rx_work_limit < 0)
-                goto not_done;
-#endif
-	
-	dmas = __raw_readl(&lp->rx_dma_regs->dmas);
-	
-	if(dmas & DMAS_h_m) {
-		__raw_writel( ~(DMAS_h_m | DMAS_e_m), &lp->rx_dma_regs->dmas);
-#ifdef RC32434_PROC_DEBUG
-		lp->dma_halt_cnt++;
-#endif
-		rd->devcs = 0;
-		skb = lp->rx_skb[lp->rx_next_done];
-		rd->ca = CPHYSADDR(skb->data);
-		dma_cache_wback((u32)rd, sizeof(*rd));
-		rc32434_chain_rx(lp,rd);
-	}
-	
-#ifdef CONFIG_IDT_USE_NAPI
-	netif_rx_complete(dev);
-#endif
-	/* Enable D H E bit in Rx DMA */
-	__raw_writel(__raw_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m |DMASM_e_m), &lp->rx_dma_regs->dmasm); 
-#ifdef CONFIG_IDT_USE_NAPI
-	return 0;
- not_done:
-	return 1;
-#else
-	spin_unlock_irqrestore(&lp->lock, flags);
-	return;
-#endif
-
-	
-}	
-
-
-
-/* Ethernet Tx DMA interrupt */
-static irqreturn_t
-rc32434_tx_dma_interrupt(int irq, void *dev_id)
-{
-	struct net_device *dev = (struct net_device *)dev_id;
-	struct rc32434_local *lp;
-	volatile u32 dmas,dmasm;
-	irqreturn_t retval;
-	
-	ASSERT(dev != NULL);
-	
-	lp = (struct rc32434_local *)dev->priv;
-	
-	spin_lock(&lp->lock);
-	
-	dmas = __raw_readl(&lp->tx_dma_regs->dmas);
-	
-	if (dmas & (DMAS_f_m | DMAS_e_m)) {
-		dmasm = __raw_readl(&lp->tx_dma_regs->dmasm);
-		/* Mask F E bit in Tx DMA */
-		__raw_writel(dmasm | (DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm);
-		
-		tasklet_hi_schedule(lp->tx_tasklet);
-		
-		if(lp->tx_chain_status == filled && (__raw_readl(&(lp->tx_dma_regs->dmandptr)) == 0)) {
-			__raw_writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), &(lp->tx_dma_regs->dmandptr));			
-			lp->tx_chain_status = empty;
-			lp->tx_chain_head = lp->tx_chain_tail;
-			dev->trans_start = jiffies;
-		}
-		
-		if (dmas & DMAS_e_m)
-			ERR(": DMA error\n");
-		
-		retval = IRQ_HANDLED;
-	}
-	else
-		retval = IRQ_NONE;
-	
-	spin_unlock(&lp->lock);
-	
-	return retval;
-}
-
-
-static void rc32434_tx_tasklet(unsigned long tx_data_dev)
-{
-	struct net_device *dev = (struct net_device *)tx_data_dev;	
-	struct rc32434_local* lp = (struct rc32434_local *)dev->priv;
-	volatile DMAD_t td = &lp->td_ring[lp->tx_next_done];
-	u32 devcs;
-	unsigned long 	flags;
-	volatile u32 dmas;
-	
-	spin_lock_irqsave(&lp->lock, flags);
-	
-	/* process all desc that are done */
-	while(IS_DMA_FINISHED(td->control)) {
-		if(lp->tx_full == 1) {
-			netif_wake_queue(dev);
-			lp->tx_full = 0;
-		}
-		
-		devcs = lp->td_ring[lp->tx_next_done].devcs;    
-		if ((devcs & (ETHTX_fd_m | ETHTX_ld_m)) != (ETHTX_fd_m | ETHTX_ld_m)) {
-			lp->stats.tx_errors++;
-			lp->stats.tx_dropped++;				
-			
-			/* should never happen */
-			DBG(1, __FUNCTION__ ": split tx ignored\n");
-		}
-		else if (IS_TX_TOK(devcs)) {
-			lp->stats.tx_packets++;
-			lp->stats.tx_bytes+=lp->tx_skb[lp->tx_next_done]->len;
-		}
-		else {
-			lp->stats.tx_errors++;
-			lp->stats.tx_dropped++;				
-			
-			/* underflow */
-			if (IS_TX_UND_ERR(devcs)) 
-				lp->stats.tx_fifo_errors++;
-			
-			/* oversized frame */
-			if (IS_TX_OF_ERR(devcs))
-				lp->stats.tx_aborted_errors++;
-			
-			/* excessive deferrals */
-			if (IS_TX_ED_ERR(devcs))
-				lp->stats.tx_carrier_errors++;
-			
-			/* collisions: medium busy */
-			if (IS_TX_EC_ERR(devcs))
-				lp->stats.collisions++;
-			
-			/* late collision */
-			if (IS_TX_LC_ERR(devcs))
-				lp->stats.tx_window_errors++;
-			
-		}
-		
-		/* We must always free the original skb */
-		if (lp->tx_skb[lp->tx_next_done] != NULL) {
-			dev_kfree_skb_any(lp->tx_skb[lp->tx_next_done]);
-			lp->tx_skb[lp->tx_next_done] = NULL;
-		}
-		
-		lp->td_ring[lp->tx_next_done].control = DMAD_iof_m;
-		lp->td_ring[lp->tx_next_done].devcs = ETHTX_fd_m | ETHTX_ld_m;	
-		lp->td_ring[lp->tx_next_done].link = 0;
-		lp->td_ring[lp->tx_next_done].ca = 0;
-		lp->tx_count --;
-		
-		/* go on to next transmission */
-		lp->tx_next_done = (lp->tx_next_done + 1) & RC32434_TDS_MASK;
-		td = &lp->td_ring[lp->tx_next_done];
-		
-	}
-	
-	dmas = __raw_readl(&lp->tx_dma_regs->dmas);
-	__raw_writel( ~dmas, &lp->tx_dma_regs->dmas);
-	
-	/* Enable F E bit in Tx DMA */
-	__raw_writel(__raw_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm); 
-	spin_unlock_irqrestore(&lp->lock, flags);
-	
-}
-
-
-static struct net_device_stats * rc32434_get_stats(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	return &lp->stats;
-}
-
-
-/*
- * Set or clear the multicast filter for this adaptor.
- */
-static void rc32434_multicast_list(struct net_device *dev)
-{   
-	/* listen to broadcasts always and to treat 	*/
-	/*       IFF bits independantly	*/
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	unsigned long flags;
-	u32 recognise = ETHARC_ab_m; 		/* always accept broadcasts */
-	
-	if (dev->flags & IFF_PROMISC)         		/* set promiscuous mode */
-		recognise |= ETHARC_pro_m;
-	
-	if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 15))
-		recognise |= ETHARC_am_m;    	  	/* all multicast & bcast */
-	else if (dev->mc_count > 0) {
-		DBG(2, __FUNCTION__ ": mc_count %d\n", dev->mc_count);
-		recognise |= ETHARC_am_m;    	  	/* for the time being */
-	}
-	
-	spin_lock_irqsave(&lp->lock, flags);
-	__raw_writel(recognise, &lp->eth_regs->etharc);
-	spin_unlock_irqrestore(&lp->lock, flags);
-}
-
-
-static void rc32434_tx_timeout(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	unsigned long flags;
-	
-	spin_lock_irqsave(&lp->lock, flags);
-	rc32434_restart(dev);
-	spin_unlock_irqrestore(&lp->lock, flags);
-	
-}
-
-
-/*
- * Initialize the RC32434 ethernet controller.
- */
-static int rc32434_init(struct net_device *dev)
-{
-	struct rc32434_local *lp = (struct rc32434_local *)dev->priv;
-	int i, j;
-	
-	/* Disable DMA */       
-	rc32434_abort_tx(dev);
-	rc32434_abort_rx(dev); 
-	
-	/* reset ethernet logic */ 
-	__raw_writel(0, &lp->eth_regs->ethintfc);
-	while((__raw_readl(&lp->eth_regs->ethintfc) & ETHINTFC_rip_m))
-		dev->trans_start = jiffies;	
-	
-	/* Enable Ethernet Interface */ 
-	__raw_writel(ETHINTFC_en_m, &lp->eth_regs->ethintfc); 
-	
-#ifndef CONFIG_IDT_USE_NAPI
-	tasklet_disable(lp->rx_tasklet);
-#endif
-	tasklet_disable(lp->tx_tasklet);
-	
-	/* Initialize the transmit Descriptors */
-	for (i = 0; i < RC32434_NUM_TDS; i++) {
-		lp->td_ring[i].control = DMAD_iof_m;
-		lp->td_ring[i].devcs = ETHTX_fd_m | ETHTX_ld_m;
-		lp->td_ring[i].ca = 0;
-		lp->td_ring[i].link = 0;
-		if (lp->tx_skb[i] != NULL) {
-			dev_kfree_skb_any(lp->tx_skb[i]);
-			lp->tx_skb[i] = NULL;
-		}
-	}
-	lp->tx_next_done = lp->tx_chain_head = lp->tx_chain_tail = 	lp->tx_full = lp->tx_count = 0;
-	lp->	tx_chain_status = empty;
-	
-	/*
-	 * Initialize the receive descriptors so that they
-	 * become a circular linked list, ie. let the last
-	 * descriptor point to the first again.
-	 */
-	for (i=0; i<RC32434_NUM_RDS; i++) {
-		struct sk_buff *skb = lp->rx_skb[i];
-		
-		if (lp->rx_skb[i] == NULL) {
-			skb = dev_alloc_skb(RC32434_RBSIZE + 2);
-			if (skb == NULL) {
-				ERR("No memory in the system\n");
-				for (j = 0; j < RC32434_NUM_RDS; j ++)
-					if (lp->rx_skb[j] != NULL) 
-						dev_kfree_skb_any(lp->rx_skb[j]);
-				
-				return 1;
-			}
-			else {
-				skb->dev = dev;
-				skb_reserve(skb, 2);
-				lp->rx_skb[i] = skb;
-				lp->rd_ring[i].ca = CPHYSADDR(skb->data); 
-				
-			}
-		}
-		lp->rd_ring[i].control =	DMAD_iod_m | DMA_COUNT(RC32434_RBSIZE);
-		lp->rd_ring[i].devcs = 0;
-		lp->rd_ring[i].ca = CPHYSADDR(skb->data);
-		lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
-		
-	}
-	/* loop back */
-	lp->rd_ring[RC32434_NUM_RDS-1].link = CPHYSADDR(&lp->rd_ring[0]);
-	lp->rx_next_done   = 0;
-	
-	lp->rd_ring[RC32434_NUM_RDS-1].control |= DMAD_cod_m;
-	lp->rx_chain_head = 0;
-	lp->rx_chain_tail = 0;
-	lp->rx_chain_status = empty;
-	
-	__raw_writel(0, &lp->rx_dma_regs->dmas);
-	/* Start Rx DMA */
-	rc32434_start_rx(lp, &lp->rd_ring[0]);
-	
-	/* Enable F E bit in Tx DMA */
-	__raw_writel(__raw_readl(&lp->tx_dma_regs->dmasm) & ~(DMASM_f_m | DMASM_e_m), &lp->tx_dma_regs->dmasm); 
-	/* Enable D H E bit in Rx DMA */
-	__raw_writel(__raw_readl(&lp->rx_dma_regs->dmasm) & ~(DMASM_d_m | DMASM_h_m | DMASM_e_m), &lp->rx_dma_regs->dmasm); 
-	
-	/* Accept only packets destined for this Ethernet device address */
-	__raw_writel(ETHARC_ab_m, &lp->eth_regs->etharc); 
-	
-	/* Set all Ether station address registers to their initial values */ 
-	__raw_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal0); 
-	__raw_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah0);
-	
-	__raw_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal1); 
-	__raw_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah1);
-	
-	__raw_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal2); 
-	__raw_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah2);
-	
-	__raw_writel(STATION_ADDRESS_LOW(dev), &lp->eth_regs->ethsal3); 
-	__raw_writel(STATION_ADDRESS_HIGH(dev), &lp->eth_regs->ethsah3); 
-	
-	
-	/* Frame Length Checking, Pad Enable, CRC Enable, Full Duplex set */ 
-	__raw_writel(ETHMAC2_pe_m | ETHMAC2_cen_m | ETHMAC2_fd_m, &lp->eth_regs->ethmac2);  
-	//ETHMAC2_flc_m		ETHMAC2_fd_m	lp->duplex_mode
-	
-	/* Back to back inter-packet-gap */ 
-	__raw_writel(0x15, &lp->eth_regs->ethipgt); 
-	/* Non - Back to back inter-packet-gap */ 
-	__raw_writel(0x12, &lp->eth_regs->ethipgr); 
-	
-	/* Management Clock Prescaler Divisor */
-	/* Clock independent setting */
-	__raw_writel(((idt_cpu_freq)/MII_CLOCK+1) & ~1,
-		       &lp->eth_regs->ethmcp);
-	
-	/* don't transmit until fifo contains 48b */
-	__raw_writel(48, &lp->eth_regs->ethfifott);
-	
-	__raw_writel(ETHMAC1_re_m, &lp->eth_regs->ethmac1);
-	
-#ifndef CONFIG_IDT_USE_NAPI
-	tasklet_enable(lp->rx_tasklet);
-#endif
-	tasklet_enable(lp->tx_tasklet);
-	
-	netif_start_queue(dev);
-	
-	return 0; 
-}
-
-static struct platform_driver korina_driver = {
-	.driver.name = "korina",
-	.probe = rc32434_probe,
-	.remove = rc32434_remove,
-};
-
-static int __init rc32434_init_module(void)
-{
-	return platform_driver_register(&korina_driver);
-}
-
-static void rc32434_cleanup_module(void)
-{
-	return platform_driver_unregister(&korina_driver);
-}
-
-module_init(rc32434_init_module);
-module_exit(rc32434_cleanup_module);

+ 0 - 178
target/linux/rb532/files-2.6.23/drivers/net/rc32434_eth.h

@@ -1,178 +0,0 @@
-/**************************************************************************
- *
- *  BRIEF MODULE DESCRIPTION
- *     Definitions for IDT RC32434 on-chip ethernet controller.
- *
- *  Copyright 2004 IDT Inc. ([email protected])
- *         
- *  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  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  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.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- **************************************************************************
- * May 2004 rkt, neb
- *
- * Initial Release
- *
- * Aug 2004
- *
- * Added NAPI
- *
- **************************************************************************
- */
-
-
-#include  <asm/rc32434/rc32434.h>
-#include  <asm/rc32434/dma_v.h>
-#include  <asm/rc32434/eth_v.h>
-
-#define CONFIG_IDT_USE_NAPI 1
-#define RC32434_DEBUG	2
-//#define RC32434_PROC_DEBUG
-#undef	RC32434_DEBUG
-
-#ifdef RC32434_DEBUG
-
-/* use 0 for production, 1 for verification, >2 for debug */
-static int rc32434_debug = RC32434_DEBUG;
-#define ASSERT(expr) \
-	if(!(expr)) {	\
-		printk( "Assertion failed! %s,%s,%s,line=%d\n",	\
-		#expr,__FILE__,__FUNCTION__,__LINE__);		}
-#define DBG(lvl, format, arg...) if (rc32434_debug > lvl) printk(KERN_INFO "%s: " format, dev->name , ## arg)
-#else
-#define ASSERT(expr) do {} while (0)
-#define DBG(lvl, format, arg...) do {} while (0)
-#endif
-
-#define INFO(format, arg...) printk(KERN_INFO "%s: " format, dev->name , ## arg)
-#define ERR(format, arg...) printk(KERN_ERR "%s: " format, dev->name , ## arg)
-#define WARN(format, arg...) printk(KERN_WARNING "%s: " format, dev->name , ## arg)		
-
-/* the following must be powers of two */
-#ifdef CONFIG_IDT_USE_NAPI
-#define RC32434_NUM_RDS    64    		/* number of receive descriptors */
-#define RC32434_NUM_TDS    64    		/* number of transmit descriptors */
-#else
-#define RC32434_NUM_RDS    128    		/* number of receive descriptors */
-#define RC32434_NUM_TDS    128    		/* number of transmit descriptors */
-#endif
-
-#define RC32434_RBSIZE     1536  		/* size of one resource buffer = Ether MTU */
-#define RC32434_RDS_MASK   (RC32434_NUM_RDS-1)
-#define RC32434_TDS_MASK   (RC32434_NUM_TDS-1)
-#define RD_RING_SIZE (RC32434_NUM_RDS * sizeof(struct DMAD_s))
-#define TD_RING_SIZE (RC32434_NUM_TDS * sizeof(struct DMAD_s))
-
-#define RC32434_TX_TIMEOUT HZ * 100
-
-#define rc32434_eth0_regs ((ETH_t)(ETH0_VirtualAddress))
-#define rc32434_eth1_regs ((ETH_t)(ETH1_VirtualAddress))
-
-enum status	{ filled,	empty};
-#define IS_DMA_FINISHED(X)   (((X) & (DMAD_f_m)) != 0)
-#define IS_DMA_DONE(X)   (((X) & (DMAD_d_m)) != 0)
-
-
-/* Information that need to be kept for each board. */
-struct rc32434_local {
-	ETH_t  eth_regs;
-	DMA_Chan_t  rx_dma_regs;
-	DMA_Chan_t  tx_dma_regs;
-	volatile DMAD_t   td_ring;			/* transmit descriptor ring */ 
-	volatile DMAD_t   rd_ring;			/* receive descriptor ring  */
-	
-	struct sk_buff* tx_skb[RC32434_NUM_TDS]; 	/* skbuffs for pkt to trans */
-	struct sk_buff* rx_skb[RC32434_NUM_RDS]; 	/* skbuffs for pkt to trans */
-	
-#ifndef CONFIG_IDT_USE_NAPI
-	struct tasklet_struct * rx_tasklet;
-#endif
-	struct tasklet_struct * tx_tasklet;
-	
-	int	rx_next_done;
-	int	rx_chain_head;
-	int	rx_chain_tail;
-	enum status	rx_chain_status;
-	
-	int	tx_next_done;
-	int	tx_chain_head;
-	int	tx_chain_tail;
-	enum status	tx_chain_status;
-	int tx_count;			
-	int	tx_full;
-	
-	struct timer_list    mii_phy_timer;
-	unsigned long duplex_mode;
-	
-	int   	rx_irq;
-	int    tx_irq;
-	int    ovr_irq;
-	int    und_irq;
-	
-	struct net_device_stats stats;
-	spinlock_t lock; 
-	
-	/* debug /proc entry */
-	struct proc_dir_entry *ps;
-	int dma_halt_cnt;  int dma_run_cnt;
-};
-
-extern unsigned int idt_cpu_freq;
-
-/* Index to functions, as function prototypes. */
-static int rc32434_open(struct net_device *dev);
-static int rc32434_send_packet(struct sk_buff *skb, struct net_device *dev);
-static void rc32434_mii_handler(unsigned long data);
-static irqreturn_t  rc32434_und_interrupt(int irq, void *dev_id);
-static irqreturn_t rc32434_rx_dma_interrupt(int irq, void *dev_id);
-static irqreturn_t rc32434_tx_dma_interrupt(int irq, void *dev_id);
-#ifdef	RC32434_REVISION	
-static irqreturn_t rc32434_ovr_interrupt(int irq, void *dev_id);
-#endif
-static int  rc32434_close(struct net_device *dev);
-static struct net_device_stats *rc32434_get_stats(struct net_device *dev);
-static void rc32434_multicast_list(struct net_device *dev);
-static int  rc32434_init(struct net_device *dev);
-static void rc32434_tx_timeout(struct net_device *dev);
-
-static void rc32434_tx_tasklet(unsigned long tx_data_dev);
-#ifdef CONFIG_IDT_USE_NAPI
-static int rc32434_poll(struct net_device *rx_data_dev, int *budget);
-#else
-static void rc32434_rx_tasklet(unsigned long rx_data_dev);
-#endif
-static void rc32434_cleanup_module(void);
-
-
-static inline void rc32434_abort_dma(struct net_device *dev, DMA_Chan_t ch)
-{
-	if (__raw_readl(&ch->dmac) & DMAC_run_m) {
-		__raw_writel(0x10, &ch->dmac); 
-		
-		while (!(__raw_readl(&ch->dmas) & DMAS_h_m))
-			dev->trans_start = jiffies;		
-		
-		__raw_writel(0, &ch->dmas);  
-	}
-	
-	__raw_writel(0, &ch->dmadptr); 
-	__raw_writel(0, &ch->dmandptr); 
-}

+ 0 - 173
target/linux/rb532/files-2.6.23/include/asm-mips/rc32434/ddr.h

@@ -1,173 +0,0 @@
-#ifndef __IDT_DDR_H__
-#define __IDT_DDR_H__
-
-/*******************************************************************************
- *
- * Copyright 2002 Integrated Device Technology, Inc.
- *		All rights reserved.
- *
- * DDR register definition.
- *
- * File   : $Id: ddr.h,v 1.2 2002/06/06 18:34:03 astichte Exp $
- *
- * Author : [email protected]
- * Date   : 20011005
- * Update :
- *          $Log: ddr.h,v $
- *          Revision 1.2  2002/06/06 18:34:03  astichte
- *          Added XXX_PhysicalAddress and XXX_VirtualAddress
- *
- *          Revision 1.1  2002/05/29 17:33:21  sysarch
- *          jba File moved from vcode/include/idt/acacia
- *
- *
- ******************************************************************************/
-
-enum
-{
-	DDR0_PhysicalAddress	= 0x18018000,
-	DDR_PhysicalAddress	= DDR0_PhysicalAddress,		// Default
-
-	DDR0_VirtualAddress	= 0xb8018000,
-	DDR_VirtualAddress	= DDR0_VirtualAddress,		// Default
-} ;
-
-typedef struct DDR_s
-{
-	u32	ddrbase ;
-	u32	ddrmask ;
-	u32	res1;
-	u32	res2;
-	u32	ddrc ;
-	u32	ddrabase ;
-	u32	ddramask ;
-	u32	ddramap ;
-	u32	ddrcust;
-	u32	ddrrdc;
-	u32	ddrspare;
-} volatile *DDR_t ;
-
-enum
-{
-	DDR0BASE_baseaddr_b	= 16,
-	DDR0BASE_baseaddr_m	= 0xffff0000,
-
-	DDR0MASK_mask_b		= 16,
-	DDR0MASK_mask_m		= 0xffff0000,
-
-	DDR1BASE_baseaddr_b	= 16,
-	DDR1BASE_baseaddr_m	= 0xffff0000,
-
-	DDR1MASK_mask_b		= 16,
-	DDR1MASK_mask_m		= 0xffff0000,
-
-	DDRC_ata_b		= 5,
-	DDRC_ata_m		= 0x000000E0,
-	DDRC_dbw_b		= 8,
-	DDRC_dbw_m		= 0x00000100,
-	DDRC_wr_b		= 9,
-	DDRC_wr_m		= 0x00000600,
-	DDRC_ps_b		= 11,
-	DDRC_ps_m		= 0x00001800,
-	DDRC_dtype_b		= 13,
-	DDRC_dtype_m		= 0x0000e000,
-	DDRC_rfc_b		= 16,
-	DDRC_rfc_m		= 0x000f0000,
-	DDRC_rp_b		= 20,
-	DDRC_rp_m		= 0x00300000,
-	DDRC_ap_b		= 22,
-	DDRC_ap_m		= 0x00400000,
-	DDRC_rcd_b		= 23,
-	DDRC_rcd_m		= 0x01800000,
-	DDRC_cl_b		= 25,
-	DDRC_cl_m		= 0x06000000,
-	DDRC_dbm_b		= 27,
-	DDRC_dbm_m		= 0x08000000,
-	DDRC_sds_b		= 28,
-	DDRC_sds_m		= 0x10000000,
-	DDRC_atp_b		= 29,
-	DDRC_atp_m		= 0x60000000,
-	DDRC_re_b		= 31,
-	DDRC_re_m		= 0x80000000,
-
-	DDRRDC_ces_b		= 0,
-	DDRRDC_ces_m		= 0x00000001,
-	DDRRDC_ace_b		= 1,
-	DDRRDC_ace_m		= 0x00000002,
-
-	DDRABASE_baseaddr_b	= 16,
-	DDRABASE_baseaddr_m	= 0xffff0000,
-
-	DDRAMASK_mask_b		= 16,
-	DDRAMASK_mask_m		= 0xffff0000,
-
-	DDRAMAP_map_b		= 16,
-	DDRAMAP_map_m		= 0xffff0000,
-
-	DDRCUST_cs_b		= 0,
-	DDRCUST_cs_m		= 0x00000003,
-	DDRCUST_we_b		= 2,
-	DDRCUST_we_m		= 0x00000004,
-	DDRCUST_ras_b		= 3,
-	DDRCUST_ras_m		= 0x00000008,
-	DDRCUST_cas_b		= 4,
-	DDRCUST_cas_m		= 0x00000010,
-	DDRCUST_cke_b		= 5,
-	DDRCUST_cke_m		= 0x00000020,
-	DDRCUST_ba_b		= 6,
-	DDRCUST_ba_m		= 0x000000c0,
-
-	RCOUNT_rcount_b		= 0,
-	RCOUNT_rcount_m		= 0x0000ffff,
-
-	RCOMPARE_rcompare_b	= 0,
-	RCOMPARE_rcompare_m	= 0x0000ffff,
-
-	RTC_ce_b		= 0,
-	RTC_ce_m		= 0x00000001,
-	RTC_to_b		= 1,
-	RTC_to_m		= 0x00000002,
-	RTC_rqe_b		= 2,
-	RTC_rqe_m		= 0x00000004,
-
-	DDRDQSC_dm_b		= 0,
-	DDRDQSC_dm_m		= 0x00000003,
-	DDRDQSC_dqsbs_b		= 2,
-	DDRDQSC_dqsbs_m		= 0x000000fc,
-	DDRDQSC_db_b		= 8,
-	DDRDQSC_db_m		= 0x00000100,
-	DDRDQSC_dbsp_b		= 9,
-	DDRDQSC_dbsp_m		= 0x01fffe00,
-	DDRDQSC_bdp_b		= 25,
-	DDRDQSC_bdp_m		= 0x7e000000,
-
-	DDRDLLC_eao_b		= 0,
-	DDRDLLC_eao_m		= 0x00000001,
-	DDRDLLC_eo_b		= 1,
-	DDRDLLC_eo_m		= 0x0000003e,
-	DDRDLLC_fs_b		= 6,
-	DDRDLLC_fs_m		= 0x000000c0,
-	DDRDLLC_as_b		= 8,
-	DDRDLLC_as_m		= 0x00000700,
-	DDRDLLC_sp_b		= 11,
-	DDRDLLC_sp_m		= 0x001ff800,
-
-	DDRDLLFC_men_b		= 0,
-	DDRDLLFC_men_m		= 0x00000001,
-	DDRDLLFC_aen_b		= 1,
-	DDRDLLFC_aen_m		= 0x00000002,
-	DDRDLLFC_ff_b		= 2,
-	DDRDLLFC_ff_m		= 0x00000004,
-
-	DDRDLLTA_addr_b		= 2,
-	DDRDLLTA_addr_m		= 0xfffffffc,
-
-	DDRDLLED_dbe_b		= 0,
-	DDRDLLED_dbe_m		= 0x00000001,
-	DDRDLLED_dte_b		= 1,
-	DDRDLLED_dte_m		= 0x00000002,
-	
-		
-} ;
-
-#endif	// __IDT_DDR_H__

+ 0 - 168
target/linux/rb532/files-2.6.23/include/asm-mips/rc32434/dma.h

@@ -1,168 +0,0 @@
-#ifndef __IDT_DMA_H__
-#define __IDT_DMA_H__
-
-/*******************************************************************************
- *
- * Copyright 2002 Integrated Device Technology, Inc.
- *		All rights reserved.
- *
- * DMA register definition.
- *
- * File   : $Id: dma.h,v 1.3 2002/06/06 18:34:03 astichte Exp $
- *
- * Author : [email protected]
- * Date   : 20011005
- * Update :
- *	    $Log: dma.h,v $
- *	    Revision 1.3  2002/06/06 18:34:03  astichte
- *	    Added XXX_PhysicalAddress and XXX_VirtualAddress
- *	
- *	    Revision 1.2  2002/06/05 18:30:46  astichte
- *	    Removed IDTField
- *	
- *	    Revision 1.1  2002/05/29 17:33:21  sysarch
- *	    jba File moved from vcode/include/idt/acacia
- *	
- *
- ******************************************************************************/
-
-enum
-{
-	DMA0_PhysicalAddress	= 0x18040000,
-	DMA_PhysicalAddress	= DMA0_PhysicalAddress,		// Default
-
-	DMA0_VirtualAddress	= 0xb8040000,
-	DMA_VirtualAddress	= DMA0_VirtualAddress,		// Default
-} ;
-
-/*
- * DMA descriptor (in physical memory).
- */
-
-typedef struct DMAD_s
-{
-	u32			control ;	// Control. use DMAD_*
-	u32			ca ;		// Current Address.
-	u32			devcs ; 	// Device control and status.
-	u32			link ;		// Next descriptor in chain.
-} volatile *DMAD_t ;
-
-enum
-{
-	DMAD_size		= sizeof (struct DMAD_s),
-	DMAD_count_b		= 0,		// in DMAD_t -> control
-	DMAD_count_m		= 0x0003ffff,	// in DMAD_t -> control
-	DMAD_ds_b		= 20,		// in DMAD_t -> control
-	DMAD_ds_m		= 0x00300000,	// in DMAD_t -> control
-		DMAD_ds_ethRcv_v	= 0,
-		DMAD_ds_ethXmt_v	= 0,
-		DMAD_ds_memToFifo_v	= 0,
-		DMAD_ds_fifoToMem_v	= 0,
-		DMAD_ds_pciToMem_v	= 0,
-		DMAD_ds_memToPci_v	= 0,
-	
-	DMAD_devcmd_b		= 22,		// in DMAD_t -> control
-	DMAD_devcmd_m		= 0x01c00000,	// in DMAD_t -> control
-		DMAD_devcmd_byte_v	= 0,	//memory-to-memory
-		DMAD_devcmd_halfword_v	= 1,	//memory-to-memory
-		DMAD_devcmd_word_v	= 2,	//memory-to-memory
-		DMAD_devcmd_2words_v	= 3,	//memory-to-memory
-		DMAD_devcmd_4words_v	= 4,	//memory-to-memory
-		DMAD_devcmd_6words_v	= 5,	//memory-to-memory
-		DMAD_devcmd_8words_v	= 6,	//memory-to-memory
-		DMAD_devcmd_16words_v	= 7,	//memory-to-memory
-	DMAD_cof_b		= 25,		// chain on finished
-	DMAD_cof_m		= 0x02000000,	// 
-	DMAD_cod_b		= 26,		// chain on done
-	DMAD_cod_m		= 0x04000000,	// 
-	DMAD_iof_b		= 27,		// interrupt on finished
-	DMAD_iof_m		= 0x08000000,	// 
-	DMAD_iod_b		= 28,		// interrupt on done
-	DMAD_iod_m		= 0x10000000,	// 
-	DMAD_t_b		= 29,		// terminated
-	DMAD_t_m		= 0x20000000,	// 
-	DMAD_d_b		= 30,		// done
-	DMAD_d_m		= 0x40000000,	// 
-	DMAD_f_b		= 31,		// finished
-	DMAD_f_m		= 0x80000000,	// 
-} ;
-
-/*
- * DMA register (within Internal Register Map).
- */
-
-struct DMA_Chan_s
-{
-	u32		dmac ;		// Control.
-	u32		dmas ;		// Status.	
-	u32		dmasm ; 	// Mask.
-	u32		dmadptr ;	// Descriptor pointer.
-	u32		dmandptr ;	// Next descriptor pointer.
-};
-
-typedef struct DMA_Chan_s volatile *DMA_Chan_t ;
-
-//DMA_Channels	  use DMACH_count instead
-
-enum
-{
-	DMAC_run_b	= 0,		// 
-	DMAC_run_m	= 0x00000001,	// 
-	DMAC_dm_b	= 1,		// done mask
-	DMAC_dm_m	= 0x00000002,	// 
-	DMAC_mode_b	= 2,		// 
-	DMAC_mode_m	= 0x0000000c,	// 
-		DMAC_mode_auto_v	= 0,
-		DMAC_mode_burst_v	= 1,
-		DMAC_mode_transfer_v	= 2, //usually used
-		DMAC_mode_reserved_v	= 3,
-	DMAC_a_b	= 4,		// 
-	DMAC_a_m	= 0x00000010,	// 
-
-	DMAS_f_b	= 0,		// finished (sticky) 
-	DMAS_f_m	= 0x00000001,	//		     
-	DMAS_d_b	= 1,		// done (sticky)     
-	DMAS_d_m	= 0x00000002,	//		     
-	DMAS_c_b	= 2,		// chain (sticky)    
-	DMAS_c_m	= 0x00000004,	//		     
-	DMAS_e_b	= 3,		// error (sticky)    
-	DMAS_e_m	= 0x00000008,	//		     
-	DMAS_h_b	= 4,		// halt (sticky)     
-	DMAS_h_m	= 0x00000010,	//		     
-
-	DMASM_f_b	= 0,		// finished (1=mask)
-	DMASM_f_m	= 0x00000001,	// 
-	DMASM_d_b	= 1,		// done (1=mask)
-	DMASM_d_m	= 0x00000002,	// 
-	DMASM_c_b	= 2,		// chain (1=mask)
-	DMASM_c_m	= 0x00000004,	// 
-	DMASM_e_b	= 3,		// error (1=mask)
-	DMASM_e_m	= 0x00000008,	// 
-	DMASM_h_b	= 4,		// halt (1=mask)
-	DMASM_h_m	= 0x00000010,	// 
-} ;
-
-/*
- * DMA channel definitions
- */
-
-enum
-{
-	DMACH_ethRcv = 0,
-	DMACH_ethXmt = 1,
-	DMACH_memToFifo = 2,
-	DMACH_fifoToMem = 3,
-	DMACH_pciToMem = 4,
-	DMACH_memToPci = 5,
-	
-	DMACH_count //must be last
-};
-
-
-typedef struct DMAC_s
-{
-	struct DMA_Chan_s ch [DMACH_count] ; //use ch[DMACH_]
-} volatile *DMA_t ;
-
-#endif	// __IDT_DMA_H__
-

+ 0 - 72
target/linux/rb532/files-2.6.23/include/asm-mips/rc32434/dma_v.h

@@ -1,72 +0,0 @@
-#ifndef __IDT_DMA_V_H__
-#define __IDT_DMA_V_H__
-
-/*******************************************************************************
- *
- * Copyright 2002 Integrated Device Technology, Inc.
- *		All rights reserved.
- *
- * DMA register definition.
- *
- * File   : $Id: dma.h,v 1.3 2002/06/06 18:34:03 astichte Exp $
- *
- * Author : [email protected]
- * Date   : 20011005
- * Update :
- *	    $Log: dma.h,v $
- *	    Revision 1.3  2002/06/06 18:34:03  astichte
- *	    Added XXX_PhysicalAddress and XXX_VirtualAddress
- *	
- *	    Revision 1.2  2002/06/05 18:30:46  astichte
- *	    Removed IDTField
- *	
- *	    Revision 1.1  2002/05/29 17:33:21  sysarch
- *	    jba File moved from vcode/include/idt/acacia
- *	
- *
- ******************************************************************************/
-#include  <asm/rc32434/dma.h> 
-#include  <asm/rc32434/rc32434.h>
-#define DMA_CHAN_OFFSET  0x14
-#define IS_DMA_USED(X) (((X) & (DMAD_f_m | DMAD_d_m | DMAD_t_m)) != 0)
-#define DMA_COUNT(count)   \
-  ((count) & DMAD_count_m)
-
-#define DMA_HALT_TIMEOUT 500
-
-
-static inline int rc32434_halt_dma(DMA_Chan_t ch)
-{
-	int timeout=1;
-	if (local_readl(&ch->dmac) & DMAC_run_m) {
-		local_writel(0, &ch->dmac); 
-		for (timeout = DMA_HALT_TIMEOUT; timeout > 0; timeout--) {
-			if (local_readl(&ch->dmas) & DMAS_h_m) {
-				local_writel(0, &ch->dmas);  
-				break;
-			}
-		}
-	}
-
-	return timeout ? 0 : 1;
-}
-
-static inline void rc32434_start_dma(DMA_Chan_t ch, u32 dma_addr)
-{
-	local_writel(0, &ch->dmandptr); 
-	local_writel(dma_addr, &ch->dmadptr);
-}
-
-static inline void rc32434_chain_dma(DMA_Chan_t ch, u32 dma_addr)
-{
-	local_writel(dma_addr, &ch->dmandptr);
-}
-
-#endif	// __IDT_DMA_V_H__
-
-
-
-
-
-
-

Некоторые файлы не были показаны из-за большого количества измененных файлов