110-pronghorn_series_support.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. --- a/arch/arm/configs/ixp4xx_defconfig
  2. +++ b/arch/arm/configs/ixp4xx_defconfig
  3. @@ -15,6 +15,8 @@ CONFIG_ARCH_ADI_COYOTE=y
  4. CONFIG_MACH_GATEWAY7001=y
  5. CONFIG_MACH_WG302V1=y
  6. CONFIG_MACH_WG302V2=y
  7. +CONFIG_MACH_PRONGHORN=y
  8. +CONFIG_MACH_PRONGHORNMETRO=y
  9. CONFIG_ARCH_IXDP425=y
  10. CONFIG_MACH_IXDPG425=y
  11. CONFIG_MACH_IXDP465=y
  12. --- a/arch/arm/mach-ixp4xx/Kconfig
  13. +++ b/arch/arm/mach-ixp4xx/Kconfig
  14. @@ -61,6 +61,22 @@ config MACH_WG302V2
  15. WG302 v2 or WAG302 v2 Access Points. For more information
  16. on this platform, see http://openwrt.org
  17. +config MACH_PRONGHORN
  18. + bool "ADI Pronghorn series"
  19. + select PCI
  20. + help
  21. + Say 'Y' here if you want your kernel to support the ADI
  22. + Engineering Pronghorn series. For more
  23. + information on this platform, see http://www.adiengineering.com
  24. +
  25. +#
  26. +# There're only minimal differences kernel-wise between the Pronghorn and
  27. +# Pronghorn Metro boards - they use different chip selects to drive the
  28. +# CF slot connected to the expansion bus, so we just enable them together.
  29. +#
  30. +config MACH_PRONGHORNMETRO
  31. + def_bool MACH_PRONGHORN
  32. +
  33. config ARCH_IXDP425
  34. bool "IXDP425"
  35. help
  36. --- a/arch/arm/mach-ixp4xx/Makefile
  37. +++ b/arch/arm/mach-ixp4xx/Makefile
  38. @@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_WG302V1) += wg302
  39. obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
  40. obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
  41. obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o
  42. +obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o
  43. obj-y += common.o
  44. @@ -39,6 +40,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se
  45. obj-$(CONFIG_MACH_FSG) += fsg-setup.o
  46. obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o
  47. obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o
  48. +obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o
  49. obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
  50. obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
  51. --- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
  52. +++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
  53. @@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set
  54. */
  55. if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
  56. machine_is_gateway7001() || machine_is_wg302v2() ||
  57. - machine_is_devixp() || machine_is_miccpt() || machine_is_mic256())
  58. + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() ||
  59. + machine_is_pronghorn() || machine_is_pronghorn_metro())
  60. uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
  61. else
  62. uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
  63. --- /dev/null
  64. +++ b/arch/arm/mach-ixp4xx/pronghorn-pci.c
  65. @@ -0,0 +1,69 @@
  66. +/*
  67. + * arch/arch/mach-ixp4xx/pronghorn-pci.c
  68. + *
  69. + * PCI setup routines for ADI Engineering Pronghorn series
  70. + *
  71. + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
  72. + *
  73. + * based on coyote-pci.c:
  74. + * Copyright (C) 2002 Jungo Software Technologies.
  75. + * Copyright (C) 2003 MontaVista Softwrae, Inc.
  76. + *
  77. + * Maintainer: Imre Kaloz <kaloz@openwrt.org>
  78. + *
  79. + * This program is free software; you can redistribute it and/or modify
  80. + * it under the terms of the GNU General Public License version 2 as
  81. + * published by the Free Software Foundation.
  82. + *
  83. + */
  84. +
  85. +#include <linux/kernel.h>
  86. +#include <linux/pci.h>
  87. +#include <linux/init.h>
  88. +#include <linux/irq.h>
  89. +
  90. +#include <asm/mach-types.h>
  91. +#include <mach/hardware.h>
  92. +
  93. +#include <asm/mach/pci.h>
  94. +
  95. +void __init pronghorn_pci_preinit(void)
  96. +{
  97. + irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_LEVEL_LOW);
  98. + irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW);
  99. + irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW);
  100. + irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW);
  101. +
  102. + ixp4xx_pci_preinit();
  103. +}
  104. +
  105. +static int __init pronghorn_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  106. +{
  107. + if (slot == 13)
  108. + return IRQ_IXP4XX_GPIO4;
  109. + else if (slot == 14)
  110. + return IRQ_IXP4XX_GPIO6;
  111. + else if (slot == 15)
  112. + return IRQ_IXP4XX_GPIO11;
  113. + else if (slot == 16)
  114. + return IRQ_IXP4XX_GPIO1;
  115. + else
  116. + return -1;
  117. +}
  118. +
  119. +struct hw_pci pronghorn_pci __initdata = {
  120. + .nr_controllers = 1,
  121. + .preinit = pronghorn_pci_preinit,
  122. + .ops = &ixp4xx_ops,
  123. + .setup = ixp4xx_setup,
  124. + .map_irq = pronghorn_map_irq,
  125. +};
  126. +
  127. +int __init pronghorn_pci_init(void)
  128. +{
  129. + if (machine_is_pronghorn() || machine_is_pronghorn_metro())
  130. + pci_common_init(&pronghorn_pci);
  131. + return 0;
  132. +}
  133. +
  134. +subsys_initcall(pronghorn_pci_init);
  135. --- /dev/null
  136. +++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c
  137. @@ -0,0 +1,252 @@
  138. +/*
  139. + * arch/arm/mach-ixp4xx/pronghorn-setup.c
  140. + *
  141. + * Board setup for the ADI Engineering Pronghorn series
  142. + *
  143. + * Copyright (C) 2008 Imre Kaloz <Kaloz@openwrt.org>
  144. + *
  145. + * based on coyote-setup.c:
  146. + * Copyright (C) 2003-2005 MontaVista Software, Inc.
  147. + *
  148. + * Author: Imre Kaloz <Kaloz@openwrt.org>
  149. + */
  150. +
  151. +#include <linux/kernel.h>
  152. +#include <linux/init.h>
  153. +#include <linux/device.h>
  154. +#include <linux/serial.h>
  155. +#include <linux/tty.h>
  156. +#include <linux/serial_8250.h>
  157. +#include <linux/slab.h>
  158. +#include <linux/types.h>
  159. +#include <linux/memory.h>
  160. +#include <linux/i2c-gpio.h>
  161. +#include <linux/leds.h>
  162. +#include <linux/dma-mapping.h>
  163. +
  164. +#include <asm/setup.h>
  165. +#include <mach/hardware.h>
  166. +#include <asm/irq.h>
  167. +#include <asm/mach-types.h>
  168. +#include <asm/mach/arch.h>
  169. +#include <asm/mach/flash.h>
  170. +
  171. +static struct flash_platform_data pronghorn_flash_data = {
  172. + .map_name = "cfi_probe",
  173. + .width = 2,
  174. +};
  175. +
  176. +static struct resource pronghorn_flash_resource = {
  177. + .flags = IORESOURCE_MEM,
  178. +};
  179. +
  180. +static struct platform_device pronghorn_flash = {
  181. + .name = "IXP4XX-Flash",
  182. + .id = 0,
  183. + .dev = {
  184. + .platform_data = &pronghorn_flash_data,
  185. + },
  186. + .num_resources = 1,
  187. + .resource = &pronghorn_flash_resource,
  188. +};
  189. +
  190. +static struct resource pronghorn_uart_resources [] = {
  191. + {
  192. + .start = IXP4XX_UART1_BASE_PHYS,
  193. + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
  194. + .flags = IORESOURCE_MEM
  195. + },
  196. + {
  197. + .start = IXP4XX_UART2_BASE_PHYS,
  198. + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
  199. + .flags = IORESOURCE_MEM
  200. + }
  201. +};
  202. +
  203. +static struct plat_serial8250_port pronghorn_uart_data[] = {
  204. + {
  205. + .mapbase = IXP4XX_UART1_BASE_PHYS,
  206. + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
  207. + .irq = IRQ_IXP4XX_UART1,
  208. + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  209. + .iotype = UPIO_MEM,
  210. + .regshift = 2,
  211. + .uartclk = IXP4XX_UART_XTAL,
  212. + },
  213. + {
  214. + .mapbase = IXP4XX_UART2_BASE_PHYS,
  215. + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
  216. + .irq = IRQ_IXP4XX_UART2,
  217. + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  218. + .iotype = UPIO_MEM,
  219. + .regshift = 2,
  220. + .uartclk = IXP4XX_UART_XTAL,
  221. + },
  222. + { },
  223. +};
  224. +
  225. +static struct platform_device pronghorn_uart = {
  226. + .name = "serial8250",
  227. + .id = PLAT8250_DEV_PLATFORM,
  228. + .dev = {
  229. + .platform_data = pronghorn_uart_data,
  230. + },
  231. + .num_resources = 2,
  232. + .resource = pronghorn_uart_resources,
  233. +};
  234. +
  235. +static struct i2c_gpio_platform_data pronghorn_i2c_gpio_data = {
  236. + .sda_pin = 9,
  237. + .scl_pin = 10,
  238. +};
  239. +
  240. +static struct platform_device pronghorn_i2c_gpio = {
  241. + .name = "i2c-gpio",
  242. + .id = 0,
  243. + .dev = {
  244. + .platform_data = &pronghorn_i2c_gpio_data,
  245. + },
  246. +};
  247. +
  248. +static struct gpio_led pronghorn_led_pin[] = {
  249. + {
  250. + .name = "pronghorn:green:status",
  251. + .gpio = 7,
  252. + }
  253. +};
  254. +
  255. +static struct gpio_led_platform_data pronghorn_led_data = {
  256. + .num_leds = 1,
  257. + .leds = pronghorn_led_pin,
  258. +};
  259. +
  260. +static struct platform_device pronghorn_led = {
  261. + .name = "leds-gpio",
  262. + .id = -1,
  263. + .dev.platform_data = &pronghorn_led_data,
  264. +};
  265. +
  266. +static struct resource pronghorn_pata_resources[] = {
  267. + {
  268. + .flags = IORESOURCE_MEM
  269. + },
  270. + {
  271. + .flags = IORESOURCE_MEM,
  272. + },
  273. + {
  274. + .name = "intrq",
  275. + .start = IRQ_IXP4XX_GPIO0,
  276. + .end = IRQ_IXP4XX_GPIO0,
  277. + .flags = IORESOURCE_IRQ,
  278. + },
  279. +};
  280. +
  281. +static struct ixp4xx_pata_data pronghorn_pata_data = {
  282. + .cs0_bits = 0xbfff0043,
  283. + .cs1_bits = 0xbfff0043,
  284. +};
  285. +
  286. +static struct platform_device pronghorn_pata = {
  287. + .name = "pata_ixp4xx_cf",
  288. + .id = 0,
  289. + .dev.platform_data = &pronghorn_pata_data,
  290. + .num_resources = ARRAY_SIZE(pronghorn_pata_resources),
  291. + .resource = pronghorn_pata_resources,
  292. +};
  293. +
  294. +static struct eth_plat_info pronghorn_plat_eth[] = {
  295. + {
  296. + .phy = 0,
  297. + .rxq = 3,
  298. + .txreadyq = 20,
  299. + }, {
  300. + .phy = 1,
  301. + .rxq = 4,
  302. + .txreadyq = 21,
  303. + }
  304. +};
  305. +
  306. +static struct platform_device pronghorn_eth[] = {
  307. + {
  308. + .name = "ixp4xx_eth",
  309. + .id = IXP4XX_ETH_NPEB,
  310. + .dev.platform_data = pronghorn_plat_eth,
  311. + .dev.coherent_dma_mask = DMA_BIT_MASK(32),
  312. + }, {
  313. + .name = "ixp4xx_eth",
  314. + .id = IXP4XX_ETH_NPEC,
  315. + .dev.platform_data = pronghorn_plat_eth + 1,
  316. + .dev.coherent_dma_mask = DMA_BIT_MASK(32),
  317. + }
  318. +};
  319. +
  320. +static struct platform_device *pronghorn_devices[] __initdata = {
  321. + &pronghorn_flash,
  322. + &pronghorn_uart,
  323. + &pronghorn_led,
  324. + &pronghorn_eth[0],
  325. + &pronghorn_eth[1],
  326. +};
  327. +
  328. +static void __init pronghorn_init(void)
  329. +{
  330. + ixp4xx_sys_init();
  331. +
  332. + pronghorn_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
  333. + pronghorn_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
  334. +
  335. + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
  336. + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
  337. +
  338. + platform_add_devices(pronghorn_devices, ARRAY_SIZE(pronghorn_devices));
  339. +
  340. + if (machine_is_pronghorn()) {
  341. + pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2);
  342. + pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(2);
  343. +
  344. + pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3);
  345. + pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(3);
  346. +
  347. + pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS2;
  348. + pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS3;
  349. + } else {
  350. + pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(3);
  351. + pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(3);
  352. +
  353. + pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(4);
  354. + pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(4);
  355. +
  356. + pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS3;
  357. + pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS4;
  358. +
  359. + platform_device_register(&pronghorn_i2c_gpio);
  360. + }
  361. +
  362. + platform_device_register(&pronghorn_pata);
  363. +}
  364. +
  365. +MACHINE_START(PRONGHORN, "ADI Engineering Pronghorn")
  366. + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
  367. + .map_io = ixp4xx_map_io,
  368. + .init_irq = ixp4xx_init_irq,
  369. + .init_time = ixp4xx_timer_init,
  370. + .atag_offset = 0x0100,
  371. + .init_machine = pronghorn_init,
  372. +#if defined(CONFIG_PCI)
  373. + .dma_zone_size = SZ_64M,
  374. +#endif
  375. + .restart = ixp4xx_restart,
  376. +MACHINE_END
  377. +
  378. +MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro")
  379. + /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
  380. + .map_io = ixp4xx_map_io,
  381. + .init_irq = ixp4xx_init_irq,
  382. + .init_time = ixp4xx_timer_init,
  383. + .atag_offset = 0x0100,
  384. + .init_machine = pronghorn_init,
  385. +#if defined(CONFIG_PCI)
  386. + .dma_zone_size = SZ_64M,
  387. +#endif
  388. + .restart = ixp4xx_restart,
  389. +MACHINE_END