ttc_dkb.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * linux/arch/arm/mach-mmp/ttc_dkb.c
  3. *
  4. * Support for the Marvell PXA910-based TTC_DKB Development Platform.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * publishhed by the Free Software Foundation.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/kernel.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/mtd/mtd.h>
  14. #include <linux/mtd/partitions.h>
  15. #include <linux/mtd/onenand.h>
  16. #include <linux/interrupt.h>
  17. #include <asm/mach-types.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach/flash.h>
  20. #include <mach/addr-map.h>
  21. #include <mach/mfp-pxa910.h>
  22. #include <mach/pxa910.h>
  23. #include "common.h"
  24. #define TTCDKB_NR_IRQS (IRQ_BOARD_START + 24)
  25. static unsigned long ttc_dkb_pin_config[] __initdata = {
  26. /* UART2 */
  27. GPIO47_UART2_RXD,
  28. GPIO48_UART2_TXD,
  29. /* DFI */
  30. DF_IO0_ND_IO0,
  31. DF_IO1_ND_IO1,
  32. DF_IO2_ND_IO2,
  33. DF_IO3_ND_IO3,
  34. DF_IO4_ND_IO4,
  35. DF_IO5_ND_IO5,
  36. DF_IO6_ND_IO6,
  37. DF_IO7_ND_IO7,
  38. DF_IO8_ND_IO8,
  39. DF_IO9_ND_IO9,
  40. DF_IO10_ND_IO10,
  41. DF_IO11_ND_IO11,
  42. DF_IO12_ND_IO12,
  43. DF_IO13_ND_IO13,
  44. DF_IO14_ND_IO14,
  45. DF_IO15_ND_IO15,
  46. DF_nCS0_SM_nCS2_nCS0,
  47. DF_ALE_SM_WEn_ND_ALE,
  48. DF_CLE_SM_OEn_ND_CLE,
  49. DF_WEn_DF_WEn,
  50. DF_REn_DF_REn,
  51. DF_RDY0_DF_RDY0,
  52. };
  53. static struct mtd_partition ttc_dkb_onenand_partitions[] = {
  54. {
  55. .name = "bootloader",
  56. .offset = 0,
  57. .size = SZ_1M,
  58. .mask_flags = MTD_WRITEABLE,
  59. }, {
  60. .name = "reserved",
  61. .offset = MTDPART_OFS_APPEND,
  62. .size = SZ_128K,
  63. .mask_flags = MTD_WRITEABLE,
  64. }, {
  65. .name = "reserved",
  66. .offset = MTDPART_OFS_APPEND,
  67. .size = SZ_8M,
  68. .mask_flags = MTD_WRITEABLE,
  69. }, {
  70. .name = "kernel",
  71. .offset = MTDPART_OFS_APPEND,
  72. .size = (SZ_2M + SZ_1M),
  73. .mask_flags = 0,
  74. }, {
  75. .name = "filesystem",
  76. .offset = MTDPART_OFS_APPEND,
  77. .size = SZ_48M,
  78. .mask_flags = 0,
  79. }
  80. };
  81. static struct onenand_platform_data ttc_dkb_onenand_info = {
  82. .parts = ttc_dkb_onenand_partitions,
  83. .nr_parts = ARRAY_SIZE(ttc_dkb_onenand_partitions),
  84. };
  85. static struct resource ttc_dkb_resource_onenand[] = {
  86. [0] = {
  87. .start = SMC_CS0_PHYS_BASE,
  88. .end = SMC_CS0_PHYS_BASE + SZ_1M,
  89. .flags = IORESOURCE_MEM,
  90. },
  91. };
  92. static struct platform_device ttc_dkb_device_onenand = {
  93. .name = "onenand-flash",
  94. .id = -1,
  95. .resource = ttc_dkb_resource_onenand,
  96. .num_resources = ARRAY_SIZE(ttc_dkb_resource_onenand),
  97. .dev = {
  98. .platform_data = &ttc_dkb_onenand_info,
  99. },
  100. };
  101. static struct platform_device *ttc_dkb_devices[] = {
  102. &ttc_dkb_device_onenand,
  103. };
  104. static void __init ttc_dkb_init(void)
  105. {
  106. mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
  107. /* on-chip devices */
  108. pxa910_add_uart(1);
  109. /* off-chip devices */
  110. platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
  111. }
  112. MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
  113. .map_io = mmp_map_io,
  114. .nr_irqs = TTCDKB_NR_IRQS,
  115. .init_irq = pxa910_init_irq,
  116. .timer = &pxa910_timer,
  117. .init_machine = ttc_dkb_init,
  118. MACHINE_END