mach-apf9328.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * linux/arch/arm/mach-imx/mach-apf9328.c
  3. *
  4. * Copyright (c) 2005-2011 ARMadeus systems <support@armadeus.com>
  5. *
  6. * This work is based on mach-scb9328.c which is:
  7. * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de>
  8. * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. */
  15. #include <linux/init.h>
  16. #include <linux/kernel.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/mtd/physmap.h>
  19. #include <linux/dm9000.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach/time.h>
  23. #include <mach/common.h>
  24. #include <mach/hardware.h>
  25. #include <mach/irqs.h>
  26. #include <mach/iomux-mx1.h>
  27. #include "devices-imx1.h"
  28. static const int apf9328_pins[] __initconst = {
  29. /* UART1 */
  30. PC9_PF_UART1_CTS,
  31. PC10_PF_UART1_RTS,
  32. PC11_PF_UART1_TXD,
  33. PC12_PF_UART1_RXD,
  34. /* UART2 */
  35. PB28_PF_UART2_CTS,
  36. PB29_PF_UART2_RTS,
  37. PB30_PF_UART2_TXD,
  38. PB31_PF_UART2_RXD,
  39. };
  40. /*
  41. * The APF9328 can have up to 32MB NOR Flash
  42. */
  43. static struct resource flash_resource = {
  44. .start = MX1_CS0_PHYS,
  45. .end = MX1_CS0_PHYS + SZ_32M - 1,
  46. .flags = IORESOURCE_MEM,
  47. };
  48. static struct physmap_flash_data apf9328_flash_data = {
  49. .width = 2,
  50. };
  51. static struct platform_device apf9328_flash_device = {
  52. .name = "physmap-flash",
  53. .id = 0,
  54. .dev = {
  55. .platform_data = &apf9328_flash_data,
  56. },
  57. .resource = &flash_resource,
  58. .num_resources = 1,
  59. };
  60. /*
  61. * APF9328 has a DM9000 Ethernet controller
  62. */
  63. static struct dm9000_plat_data dm9000_setup = {
  64. .flags = DM9000_PLATF_16BITONLY
  65. };
  66. static struct resource dm9000_resources[] = {
  67. {
  68. .start = MX1_CS4_PHYS + 0x00C00000,
  69. .end = MX1_CS4_PHYS + 0x00C00001,
  70. .flags = IORESOURCE_MEM,
  71. }, {
  72. .start = MX1_CS4_PHYS + 0x00C00002,
  73. .end = MX1_CS4_PHYS + 0x00C00003,
  74. .flags = IORESOURCE_MEM,
  75. }, {
  76. .start = IRQ_GPIOB(14),
  77. .end = IRQ_GPIOB(14),
  78. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  79. },
  80. };
  81. static struct platform_device dm9000x_device = {
  82. .name = "dm9000",
  83. .id = 0,
  84. .num_resources = ARRAY_SIZE(dm9000_resources),
  85. .resource = dm9000_resources,
  86. .dev = {
  87. .platform_data = &dm9000_setup,
  88. }
  89. };
  90. static const struct imxuart_platform_data uart1_pdata __initconst = {
  91. .flags = IMXUART_HAVE_RTSCTS,
  92. };
  93. static struct platform_device *devices[] __initdata = {
  94. &apf9328_flash_device,
  95. &dm9000x_device,
  96. };
  97. static void __init apf9328_init(void)
  98. {
  99. imx1_soc_init();
  100. mxc_gpio_setup_multiple_pins(apf9328_pins,
  101. ARRAY_SIZE(apf9328_pins),
  102. "APF9328");
  103. imx1_add_imx_uart0(NULL);
  104. imx1_add_imx_uart1(&uart1_pdata);
  105. platform_add_devices(devices, ARRAY_SIZE(devices));
  106. }
  107. static void __init apf9328_timer_init(void)
  108. {
  109. mx1_clocks_init(32768);
  110. }
  111. static struct sys_timer apf9328_timer = {
  112. .init = apf9328_timer_init,
  113. };
  114. MACHINE_START(APF9328, "Armadeus APF9328")
  115. /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */
  116. .map_io = mx1_map_io,
  117. .init_early = imx1_init_early,
  118. .init_irq = mx1_init_irq,
  119. .timer = &apf9328_timer,
  120. .init_machine = apf9328_init,
  121. MACHINE_END