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