mach-scb9328.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * linux/arch/arm/mach-mx1/mach-scb9328.c
  3. *
  4. * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de>
  5. * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. */
  12. #include <linux/platform_device.h>
  13. #include <linux/mtd/physmap.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/dm9000.h>
  16. #include <asm/mach-types.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/time.h>
  19. #include <mach/common.h>
  20. #include <mach/hardware.h>
  21. #include <mach/irqs.h>
  22. #include <mach/iomux-mx1.h>
  23. #include "devices-imx1.h"
  24. #include "devices.h"
  25. /*
  26. * This scb9328 has a 32MiB flash
  27. */
  28. static struct resource flash_resource = {
  29. .start = MX1_CS0_PHYS,
  30. .end = MX1_CS0_PHYS + (32 * 1024 * 1024) - 1,
  31. .flags = IORESOURCE_MEM,
  32. };
  33. static struct physmap_flash_data scb_flash_data = {
  34. .width = 2,
  35. };
  36. static struct platform_device scb_flash_device = {
  37. .name = "physmap-flash",
  38. .id = 0,
  39. .dev = {
  40. .platform_data = &scb_flash_data,
  41. },
  42. .resource = &flash_resource,
  43. .num_resources = 1,
  44. };
  45. /*
  46. * scb9328 has a DM9000 network controller
  47. * connected to CS5, with 16 bit data path
  48. * and interrupt connected to GPIO 3
  49. */
  50. /*
  51. * internal datapath is fixed 16 bit
  52. */
  53. static struct dm9000_plat_data dm9000_platdata = {
  54. .flags = DM9000_PLATF_16BITONLY,
  55. };
  56. /*
  57. * the DM9000 drivers wants two defined address spaces
  58. * to gain access to address latch registers and the data path.
  59. */
  60. static struct resource dm9000x_resources[] = {
  61. {
  62. .name = "address area",
  63. .start = MX1_CS5_PHYS,
  64. .end = MX1_CS5_PHYS + 1,
  65. .flags = IORESOURCE_MEM, /* address access */
  66. }, {
  67. .name = "data area",
  68. .start = MX1_CS5_PHYS + 4,
  69. .end = MX1_CS5_PHYS + 5,
  70. .flags = IORESOURCE_MEM, /* data access */
  71. }, {
  72. .start = IRQ_GPIOC(3),
  73. .end = IRQ_GPIOC(3),
  74. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  75. },
  76. };
  77. static struct platform_device dm9000x_device = {
  78. .name = "dm9000",
  79. .id = 0,
  80. .num_resources = ARRAY_SIZE(dm9000x_resources),
  81. .resource = dm9000x_resources,
  82. .dev = {
  83. .platform_data = &dm9000_platdata,
  84. }
  85. };
  86. static int mxc_uart1_pins[] = {
  87. PC9_PF_UART1_CTS,
  88. PC10_PF_UART1_RTS,
  89. PC11_PF_UART1_TXD,
  90. PC12_PF_UART1_RXD,
  91. };
  92. static int uart1_mxc_init(struct platform_device *pdev)
  93. {
  94. return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
  95. ARRAY_SIZE(mxc_uart1_pins), "UART1");
  96. }
  97. static void uart1_mxc_exit(struct platform_device *pdev)
  98. {
  99. mxc_gpio_release_multiple_pins(mxc_uart1_pins,
  100. ARRAY_SIZE(mxc_uart1_pins));
  101. }
  102. static const struct imxuart_platform_data uart_pdata __initconst = {
  103. .init = uart1_mxc_init,
  104. .exit = uart1_mxc_exit,
  105. .flags = IMXUART_HAVE_RTSCTS,
  106. };
  107. static struct platform_device *devices[] __initdata = {
  108. &scb_flash_device,
  109. &dm9000x_device,
  110. };
  111. /*
  112. * scb9328_init - Init the CPU card itself
  113. */
  114. static void __init scb9328_init(void)
  115. {
  116. imx1_add_imx_uart0(&uart_pdata);
  117. printk(KERN_INFO"Scb9328: Adding devices\n");
  118. platform_add_devices(devices, ARRAY_SIZE(devices));
  119. }
  120. static void __init scb9328_timer_init(void)
  121. {
  122. mx1_clocks_init(32000);
  123. }
  124. static struct sys_timer scb9328_timer = {
  125. .init = scb9328_timer_init,
  126. };
  127. MACHINE_START(SCB9328, "Synertronixx scb9328")
  128. /* Sascha Hauer */
  129. .phys_io = 0x00200000,
  130. .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
  131. .boot_params = 0x08000100,
  132. .map_io = mx1_map_io,
  133. .init_irq = mx1_init_irq,
  134. .timer = &scb9328_timer,
  135. .init_machine = scb9328_init,
  136. MACHINE_END