mach-scb9328.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. /*
  25. * This scb9328 has a 32MiB flash
  26. */
  27. static struct resource flash_resource = {
  28. .start = MX1_CS0_PHYS,
  29. .end = MX1_CS0_PHYS + (32 * 1024 * 1024) - 1,
  30. .flags = IORESOURCE_MEM,
  31. };
  32. static struct physmap_flash_data scb_flash_data = {
  33. .width = 2,
  34. };
  35. static struct platform_device scb_flash_device = {
  36. .name = "physmap-flash",
  37. .id = 0,
  38. .dev = {
  39. .platform_data = &scb_flash_data,
  40. },
  41. .resource = &flash_resource,
  42. .num_resources = 1,
  43. };
  44. /*
  45. * scb9328 has a DM9000 network controller
  46. * connected to CS5, with 16 bit data path
  47. * and interrupt connected to GPIO 3
  48. */
  49. /*
  50. * internal datapath is fixed 16 bit
  51. */
  52. static struct dm9000_plat_data dm9000_platdata = {
  53. .flags = DM9000_PLATF_16BITONLY,
  54. };
  55. /*
  56. * the DM9000 drivers wants two defined address spaces
  57. * to gain access to address latch registers and the data path.
  58. */
  59. static struct resource dm9000x_resources[] = {
  60. {
  61. .name = "address area",
  62. .start = MX1_CS5_PHYS,
  63. .end = MX1_CS5_PHYS + 1,
  64. .flags = IORESOURCE_MEM, /* address access */
  65. }, {
  66. .name = "data area",
  67. .start = MX1_CS5_PHYS + 4,
  68. .end = MX1_CS5_PHYS + 5,
  69. .flags = IORESOURCE_MEM, /* data access */
  70. }, {
  71. .start = IRQ_GPIOC(3),
  72. .end = IRQ_GPIOC(3),
  73. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  74. },
  75. };
  76. static struct platform_device dm9000x_device = {
  77. .name = "dm9000",
  78. .id = 0,
  79. .num_resources = ARRAY_SIZE(dm9000x_resources),
  80. .resource = dm9000x_resources,
  81. .dev = {
  82. .platform_data = &dm9000_platdata,
  83. }
  84. };
  85. static const int mxc_uart1_pins[] = {
  86. PC9_PF_UART1_CTS,
  87. PC10_PF_UART1_RTS,
  88. PC11_PF_UART1_TXD,
  89. PC12_PF_UART1_RXD,
  90. };
  91. static const struct imxuart_platform_data uart_pdata __initconst = {
  92. .flags = IMXUART_HAVE_RTSCTS,
  93. };
  94. static struct platform_device *devices[] __initdata = {
  95. &scb_flash_device,
  96. &dm9000x_device,
  97. };
  98. /*
  99. * scb9328_init - Init the CPU card itself
  100. */
  101. static void __init scb9328_init(void)
  102. {
  103. imx1_soc_init();
  104. mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
  105. ARRAY_SIZE(mxc_uart1_pins), "UART1");
  106. imx1_add_imx_uart0(&uart_pdata);
  107. printk(KERN_INFO"Scb9328: Adding devices\n");
  108. platform_add_devices(devices, ARRAY_SIZE(devices));
  109. }
  110. static void __init scb9328_timer_init(void)
  111. {
  112. mx1_clocks_init(32000);
  113. }
  114. static struct sys_timer scb9328_timer = {
  115. .init = scb9328_timer_init,
  116. };
  117. MACHINE_START(SCB9328, "Synertronixx scb9328")
  118. /* Sascha Hauer */
  119. .boot_params = 0x08000100,
  120. .map_io = mx1_map_io,
  121. .init_early = imx1_init_early,
  122. .init_irq = mx1_init_irq,
  123. .timer = &scb9328_timer,
  124. .init_machine = scb9328_init,
  125. MACHINE_END