board-cdb89712.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*
  2. * linux/arch/arm/mach-clps711x/cdb89712.c
  3. *
  4. * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
  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 as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/types.h>
  23. #include <linux/string.h>
  24. #include <linux/mm.h>
  25. #include <linux/io.h>
  26. #include <linux/interrupt.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/mtd/physmap.h>
  29. #include <linux/mtd/plat-ram.h>
  30. #include <linux/mtd/partitions.h>
  31. #include <mach/hardware.h>
  32. #include <asm/pgtable.h>
  33. #include <asm/page.h>
  34. #include <asm/setup.h>
  35. #include <asm/mach-types.h>
  36. #include <asm/mach/arch.h>
  37. #include <asm/mach/map.h>
  38. #include "common.h"
  39. #include "devices.h"
  40. #define CDB89712_CS8900_BASE (CS2_PHYS_BASE + 0x300)
  41. #define CDB89712_CS8900_IRQ (IRQ_EINT3)
  42. static struct resource cdb89712_cs8900_resource[] __initdata = {
  43. DEFINE_RES_MEM(CDB89712_CS8900_BASE, SZ_1K),
  44. DEFINE_RES_IRQ(CDB89712_CS8900_IRQ),
  45. };
  46. static struct mtd_partition cdb89712_flash_partitions[] __initdata = {
  47. {
  48. .name = "Flash",
  49. .offset = 0,
  50. .size = MTDPART_SIZ_FULL,
  51. },
  52. };
  53. static struct physmap_flash_data cdb89712_flash_pdata __initdata = {
  54. .width = 4,
  55. .probe_type = "map_rom",
  56. .parts = cdb89712_flash_partitions,
  57. .nr_parts = ARRAY_SIZE(cdb89712_flash_partitions),
  58. };
  59. static struct resource cdb89712_flash_resources[] __initdata = {
  60. DEFINE_RES_MEM(CS0_PHYS_BASE, SZ_8M),
  61. };
  62. static struct platform_device cdb89712_flash_pdev __initdata = {
  63. .name = "physmap-flash",
  64. .id = 0,
  65. .resource = cdb89712_flash_resources,
  66. .num_resources = ARRAY_SIZE(cdb89712_flash_resources),
  67. .dev = {
  68. .platform_data = &cdb89712_flash_pdata,
  69. },
  70. };
  71. static struct mtd_partition cdb89712_bootrom_partitions[] __initdata = {
  72. {
  73. .name = "BootROM",
  74. .offset = 0,
  75. .size = MTDPART_SIZ_FULL,
  76. },
  77. };
  78. static struct physmap_flash_data cdb89712_bootrom_pdata __initdata = {
  79. .width = 4,
  80. .probe_type = "map_rom",
  81. .parts = cdb89712_bootrom_partitions,
  82. .nr_parts = ARRAY_SIZE(cdb89712_bootrom_partitions),
  83. };
  84. static struct resource cdb89712_bootrom_resources[] __initdata = {
  85. DEFINE_RES_NAMED(CS7_PHYS_BASE, SZ_128, "BOOTROM", IORESOURCE_MEM |
  86. IORESOURCE_CACHEABLE | IORESOURCE_READONLY),
  87. };
  88. static struct platform_device cdb89712_bootrom_pdev __initdata = {
  89. .name = "physmap-flash",
  90. .id = 1,
  91. .resource = cdb89712_bootrom_resources,
  92. .num_resources = ARRAY_SIZE(cdb89712_bootrom_resources),
  93. .dev = {
  94. .platform_data = &cdb89712_bootrom_pdata,
  95. },
  96. };
  97. static struct platdata_mtd_ram cdb89712_sram_pdata __initdata = {
  98. .bankwidth = 4,
  99. };
  100. static struct resource cdb89712_sram_resources[] __initdata = {
  101. DEFINE_RES_MEM(CLPS711X_SRAM_BASE, CLPS711X_SRAM_SIZE),
  102. };
  103. static struct platform_device cdb89712_sram_pdev __initdata = {
  104. .name = "mtd-ram",
  105. .id = 0,
  106. .resource = cdb89712_sram_resources,
  107. .num_resources = ARRAY_SIZE(cdb89712_sram_resources),
  108. .dev = {
  109. .platform_data = &cdb89712_sram_pdata,
  110. },
  111. };
  112. static void __init cdb89712_init(void)
  113. {
  114. clps711x_devices_init();
  115. platform_device_register(&cdb89712_flash_pdev);
  116. platform_device_register(&cdb89712_bootrom_pdev);
  117. platform_device_register(&cdb89712_sram_pdev);
  118. platform_device_register_simple("cs89x0", 0, cdb89712_cs8900_resource,
  119. ARRAY_SIZE(cdb89712_cs8900_resource));
  120. }
  121. MACHINE_START(CDB89712, "Cirrus-CDB89712")
  122. /* Maintainer: Ray Lehtiniemi */
  123. .atag_offset = 0x100,
  124. .nr_irqs = CLPS711X_NR_IRQS,
  125. .map_io = clps711x_map_io,
  126. .init_early = clps711x_init_early,
  127. .init_irq = clps711x_init_irq,
  128. .init_time = clps711x_timer_init,
  129. .init_machine = cdb89712_init,
  130. .handle_irq = clps711x_handle_irq,
  131. .restart = clps711x_restart,
  132. MACHINE_END