ts72xx.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * arch/arm/mach-ep93xx/ts72xx.c
  3. * Technologic Systems TS72xx SBC support.
  4. *
  5. * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
  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 as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. */
  12. #include <linux/config.h>
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/mm.h>
  16. #include <linux/sched.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/mtd/physmap.h>
  19. #include <asm/io.h>
  20. #include <asm/hardware.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/map.h>
  24. static struct map_desc ts72xx_io_desc[] __initdata = {
  25. {
  26. .virtual = TS72XX_MODEL_VIRT_BASE,
  27. .pfn = __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
  28. .length = TS72XX_MODEL_SIZE,
  29. .type = MT_DEVICE,
  30. }, {
  31. .virtual = TS72XX_OPTIONS_VIRT_BASE,
  32. .pfn = __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
  33. .length = TS72XX_OPTIONS_SIZE,
  34. .type = MT_DEVICE,
  35. }, {
  36. .virtual = TS72XX_OPTIONS2_VIRT_BASE,
  37. .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
  38. .length = TS72XX_OPTIONS2_SIZE,
  39. .type = MT_DEVICE,
  40. }
  41. };
  42. static struct map_desc ts72xx_nand_io_desc[] __initdata = {
  43. {
  44. .virtual = TS72XX_NAND_DATA_VIRT_BASE,
  45. .pfn = __phys_to_pfn(TS72XX_NAND1_DATA_PHYS_BASE),
  46. .length = TS72XX_NAND_DATA_SIZE,
  47. .type = MT_DEVICE,
  48. }, {
  49. .virtual = TS72XX_NAND_CONTROL_VIRT_BASE,
  50. .pfn = __phys_to_pfn(TS72XX_NAND1_CONTROL_PHYS_BASE),
  51. .length = TS72XX_NAND_CONTROL_SIZE,
  52. .type = MT_DEVICE,
  53. }, {
  54. .virtual = TS72XX_NAND_BUSY_VIRT_BASE,
  55. .pfn = __phys_to_pfn(TS72XX_NAND1_BUSY_PHYS_BASE),
  56. .length = TS72XX_NAND_BUSY_SIZE,
  57. .type = MT_DEVICE,
  58. }
  59. };
  60. static struct map_desc ts72xx_alternate_nand_io_desc[] __initdata = {
  61. {
  62. .virtual = TS72XX_NAND_DATA_VIRT_BASE,
  63. .pfn = __phys_to_pfn(TS72XX_NAND2_DATA_PHYS_BASE),
  64. .length = TS72XX_NAND_DATA_SIZE,
  65. .type = MT_DEVICE,
  66. }, {
  67. .virtual = TS72XX_NAND_CONTROL_VIRT_BASE,
  68. .pfn = __phys_to_pfn(TS72XX_NAND2_CONTROL_PHYS_BASE),
  69. .length = TS72XX_NAND_CONTROL_SIZE,
  70. .type = MT_DEVICE,
  71. }, {
  72. .virtual = TS72XX_NAND_BUSY_VIRT_BASE,
  73. .pfn = __phys_to_pfn(TS72XX_NAND2_BUSY_PHYS_BASE),
  74. .length = TS72XX_NAND_BUSY_SIZE,
  75. .type = MT_DEVICE,
  76. }
  77. };
  78. static void __init ts72xx_map_io(void)
  79. {
  80. ep93xx_map_io();
  81. iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
  82. /*
  83. * The TS-7200 has NOR flash, the other models have NAND flash.
  84. */
  85. if (!board_is_ts7200()) {
  86. if (is_ts9420_installed()) {
  87. iotable_init(ts72xx_alternate_nand_io_desc,
  88. ARRAY_SIZE(ts72xx_alternate_nand_io_desc));
  89. } else {
  90. iotable_init(ts72xx_nand_io_desc,
  91. ARRAY_SIZE(ts72xx_nand_io_desc));
  92. }
  93. }
  94. }
  95. static void __init ts72xx_init_machine(void)
  96. {
  97. ep93xx_init_devices();
  98. if (board_is_ts7200())
  99. physmap_configure(TS72XX_NOR_PHYS_BASE, 0x01000000, 1, NULL);
  100. }
  101. MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
  102. /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
  103. .phys_io = EP93XX_APB_PHYS_BASE,
  104. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  105. .boot_params = 0x00000100,
  106. .map_io = ts72xx_map_io,
  107. .init_irq = ep93xx_init_irq,
  108. .timer = &ep93xx_timer,
  109. .init_machine = ts72xx_init_machine,
  110. MACHINE_END