aspenite.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * linux/arch/arm/mach-mmp/aspenite.c
  3. *
  4. * Support for the Marvell PXA168-based Aspenite and Zylonite2
  5. * Development Platform.
  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. * publishhed by the Free Software Foundation.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/kernel.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/smc91x.h>
  15. #include <linux/mtd/mtd.h>
  16. #include <linux/mtd/partitions.h>
  17. #include <linux/mtd/nand.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include <mach/addr-map.h>
  21. #include <mach/mfp-pxa168.h>
  22. #include <mach/pxa168.h>
  23. #include <mach/gpio.h>
  24. #include "common.h"
  25. static unsigned long common_pin_config[] __initdata = {
  26. /* Data Flash Interface */
  27. GPIO0_DFI_D15,
  28. GPIO1_DFI_D14,
  29. GPIO2_DFI_D13,
  30. GPIO3_DFI_D12,
  31. GPIO4_DFI_D11,
  32. GPIO5_DFI_D10,
  33. GPIO6_DFI_D9,
  34. GPIO7_DFI_D8,
  35. GPIO8_DFI_D7,
  36. GPIO9_DFI_D6,
  37. GPIO10_DFI_D5,
  38. GPIO11_DFI_D4,
  39. GPIO12_DFI_D3,
  40. GPIO13_DFI_D2,
  41. GPIO14_DFI_D1,
  42. GPIO15_DFI_D0,
  43. /* Static Memory Controller */
  44. GPIO18_SMC_nCS0,
  45. GPIO34_SMC_nCS1,
  46. GPIO23_SMC_nLUA,
  47. GPIO25_SMC_nLLA,
  48. GPIO28_SMC_RDY,
  49. GPIO29_SMC_SCLK,
  50. GPIO35_SMC_BE1,
  51. GPIO36_SMC_BE2,
  52. GPIO27_GPIO, /* Ethernet IRQ */
  53. /* UART1 */
  54. GPIO107_UART1_RXD,
  55. GPIO108_UART1_TXD,
  56. };
  57. static struct smc91x_platdata smc91x_info = {
  58. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  59. };
  60. static struct resource smc91x_resources[] = {
  61. [0] = {
  62. .start = SMC_CS1_PHYS_BASE + 0x300,
  63. .end = SMC_CS1_PHYS_BASE + 0xfffff,
  64. .flags = IORESOURCE_MEM,
  65. },
  66. [1] = {
  67. .start = gpio_to_irq(27),
  68. .end = gpio_to_irq(27),
  69. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  70. }
  71. };
  72. static struct platform_device smc91x_device = {
  73. .name = "smc91x",
  74. .id = 0,
  75. .dev = {
  76. .platform_data = &smc91x_info,
  77. },
  78. .num_resources = ARRAY_SIZE(smc91x_resources),
  79. .resource = smc91x_resources,
  80. };
  81. static struct mtd_partition aspenite_nand_partitions[] = {
  82. {
  83. .name = "bootloader",
  84. .offset = 0,
  85. .size = SZ_1M,
  86. .mask_flags = MTD_WRITEABLE,
  87. }, {
  88. .name = "reserved",
  89. .offset = MTDPART_OFS_APPEND,
  90. .size = SZ_128K,
  91. .mask_flags = MTD_WRITEABLE,
  92. }, {
  93. .name = "reserved",
  94. .offset = MTDPART_OFS_APPEND,
  95. .size = SZ_8M,
  96. .mask_flags = MTD_WRITEABLE,
  97. }, {
  98. .name = "kernel",
  99. .offset = MTDPART_OFS_APPEND,
  100. .size = (SZ_2M + SZ_1M),
  101. .mask_flags = 0,
  102. }, {
  103. .name = "filesystem",
  104. .offset = MTDPART_OFS_APPEND,
  105. .size = SZ_48M,
  106. .mask_flags = 0,
  107. }
  108. };
  109. static struct pxa3xx_nand_platform_data aspenite_nand_info = {
  110. .enable_arbiter = 1,
  111. .parts = aspenite_nand_partitions,
  112. .nr_parts = ARRAY_SIZE(aspenite_nand_partitions),
  113. };
  114. static void __init common_init(void)
  115. {
  116. mfp_config(ARRAY_AND_SIZE(common_pin_config));
  117. /* on-chip devices */
  118. pxa168_add_uart(1);
  119. pxa168_add_nand(&aspenite_nand_info);
  120. /* off-chip devices */
  121. platform_device_register(&smc91x_device);
  122. }
  123. MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
  124. .phys_io = APB_PHYS_BASE,
  125. .boot_params = 0x00000100,
  126. .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
  127. .map_io = pxa_map_io,
  128. .init_irq = pxa168_init_irq,
  129. .timer = &pxa168_timer,
  130. .init_machine = common_init,
  131. MACHINE_END
  132. MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
  133. .phys_io = APB_PHYS_BASE,
  134. .boot_params = 0x00000100,
  135. .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
  136. .map_io = pxa_map_io,
  137. .init_irq = pxa168_init_irq,
  138. .timer = &pxa168_timer,
  139. .init_machine = common_init,
  140. MACHINE_END