ttc_dkb.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 <asm/mach-types.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/flash.h>
  19. #include <mach/addr-map.h>
  20. #include <mach/mfp-pxa910.h>
  21. #include <mach/pxa910.h>
  22. #include "common.h"
  23. static unsigned long ttc_dkb_pin_config[] __initdata = {
  24. /* UART2 */
  25. GPIO47_UART2_RXD,
  26. GPIO48_UART2_TXD,
  27. /* DFI */
  28. DF_IO0_ND_IO0,
  29. DF_IO1_ND_IO1,
  30. DF_IO2_ND_IO2,
  31. DF_IO3_ND_IO3,
  32. DF_IO4_ND_IO4,
  33. DF_IO5_ND_IO5,
  34. DF_IO6_ND_IO6,
  35. DF_IO7_ND_IO7,
  36. DF_IO8_ND_IO8,
  37. DF_IO9_ND_IO9,
  38. DF_IO10_ND_IO10,
  39. DF_IO11_ND_IO11,
  40. DF_IO12_ND_IO12,
  41. DF_IO13_ND_IO13,
  42. DF_IO14_ND_IO14,
  43. DF_IO15_ND_IO15,
  44. DF_nCS0_SM_nCS2_nCS0,
  45. DF_ALE_SM_WEn_ND_ALE,
  46. DF_CLE_SM_OEn_ND_CLE,
  47. DF_WEn_DF_WEn,
  48. DF_REn_DF_REn,
  49. DF_RDY0_DF_RDY0,
  50. };
  51. static struct mtd_partition ttc_dkb_onenand_partitions[] = {
  52. {
  53. .name = "bootloader",
  54. .offset = 0,
  55. .size = SZ_1M,
  56. .mask_flags = MTD_WRITEABLE,
  57. }, {
  58. .name = "reserved",
  59. .offset = MTDPART_OFS_APPEND,
  60. .size = SZ_128K,
  61. .mask_flags = MTD_WRITEABLE,
  62. }, {
  63. .name = "reserved",
  64. .offset = MTDPART_OFS_APPEND,
  65. .size = SZ_8M,
  66. .mask_flags = MTD_WRITEABLE,
  67. }, {
  68. .name = "kernel",
  69. .offset = MTDPART_OFS_APPEND,
  70. .size = (SZ_2M + SZ_1M),
  71. .mask_flags = 0,
  72. }, {
  73. .name = "filesystem",
  74. .offset = MTDPART_OFS_APPEND,
  75. .size = SZ_48M,
  76. .mask_flags = 0,
  77. }
  78. };
  79. static struct onenand_platform_data ttc_dkb_onenand_info = {
  80. .parts = ttc_dkb_onenand_partitions,
  81. .nr_parts = ARRAY_SIZE(ttc_dkb_onenand_partitions),
  82. };
  83. static struct resource ttc_dkb_resource_onenand[] = {
  84. [0] = {
  85. .start = SMC_CS0_PHYS_BASE,
  86. .end = SMC_CS0_PHYS_BASE + SZ_1M,
  87. .flags = IORESOURCE_MEM,
  88. },
  89. };
  90. static struct platform_device ttc_dkb_device_onenand = {
  91. .name = "onenand-flash",
  92. .id = -1,
  93. .resource = ttc_dkb_resource_onenand,
  94. .num_resources = ARRAY_SIZE(ttc_dkb_resource_onenand),
  95. .dev = {
  96. .platform_data = &ttc_dkb_onenand_info,
  97. },
  98. };
  99. static struct platform_device *ttc_dkb_devices[] = {
  100. &ttc_dkb_device_onenand,
  101. };
  102. static void __init ttc_dkb_init(void)
  103. {
  104. mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
  105. /* on-chip devices */
  106. pxa910_add_uart(1);
  107. /* off-chip devices */
  108. platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
  109. }
  110. MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
  111. .phys_io = APB_PHYS_BASE,
  112. .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
  113. .map_io = mmp_map_io,
  114. .init_irq = pxa910_init_irq,
  115. .timer = &pxa910_timer,
  116. .init_machine = ttc_dkb_init,
  117. MACHINE_END