cerf.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * linux/arch/arm/mach-sa1100/cerf.c
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * Apr-2003 : Removed some old PDA crud [FB]
  9. * Oct-2003 : Added uart2 resource [FB]
  10. * Jan-2004 : Removed io map for flash [FB]
  11. */
  12. #include <linux/config.h>
  13. #include <linux/init.h>
  14. #include <linux/kernel.h>
  15. #include <linux/tty.h>
  16. #include <linux/device.h>
  17. #include <linux/mtd/mtd.h>
  18. #include <linux/mtd/partitions.h>
  19. #include <asm/irq.h>
  20. #include <asm/hardware.h>
  21. #include <asm/setup.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/flash.h>
  25. #include <asm/mach/map.h>
  26. #include <asm/mach/serial_sa1100.h>
  27. #include <asm/arch/cerf.h>
  28. #include "generic.h"
  29. static struct resource cerfuart2_resources[] = {
  30. [0] = {
  31. .start = 0x80030000,
  32. .end = 0x8003ffff,
  33. .flags = IORESOURCE_MEM,
  34. },
  35. };
  36. static struct platform_device cerfuart2_device = {
  37. .name = "sa11x0-uart",
  38. .id = 2,
  39. .num_resources = ARRAY_SIZE(cerfuart2_resources),
  40. .resource = cerfuart2_resources,
  41. };
  42. static struct platform_device *cerf_devices[] __initdata = {
  43. &cerfuart2_device,
  44. };
  45. #ifdef CONFIG_SA1100_CERF_FLASH_32MB
  46. # define CERF_FLASH_SIZE 0x02000000
  47. #elif defined CONFIG_SA1100_CERF_FLASH_16MB
  48. # define CERF_FLASH_SIZE 0x01000000
  49. #elif defined CONFIG_SA1100_CERF_FLASH_8MB
  50. # define CERF_FLASH_SIZE 0x00800000
  51. #else
  52. # error "Undefined flash size for CERF"
  53. #endif
  54. static struct mtd_partition cerf_partitions[] = {
  55. {
  56. .name = "Bootloader",
  57. .size = 0x00020000,
  58. .offset = 0x00000000,
  59. }, {
  60. .name = "Params",
  61. .size = 0x00040000,
  62. .offset = 0x00020000,
  63. }, {
  64. .name = "Kernel",
  65. .size = 0x00100000,
  66. .offset = 0x00060000,
  67. }, {
  68. .name = "Filesystem",
  69. .size = CERF_FLASH_SIZE-0x00160000,
  70. .offset = 0x00160000,
  71. }
  72. };
  73. static struct flash_platform_data cerf_flash_data = {
  74. .map_name = "cfi_probe",
  75. .parts = cerf_partitions,
  76. .nr_parts = ARRAY_SIZE(cerf_partitions),
  77. };
  78. static struct resource cerf_flash_resource = {
  79. .start = SA1100_CS0_PHYS,
  80. .end = SA1100_CS0_PHYS + SZ_32M - 1,
  81. .flags = IORESOURCE_MEM,
  82. };
  83. static void __init cerf_init_irq(void)
  84. {
  85. sa1100_init_irq();
  86. set_irq_type(CERF_ETH_IRQ, IRQT_RISING);
  87. }
  88. static struct map_desc cerf_io_desc[] __initdata = {
  89. /* virtual physical length type */
  90. { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE } /* Crystal Ethernet Chip */
  91. };
  92. static void __init cerf_map_io(void)
  93. {
  94. sa1100_map_io();
  95. iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc));
  96. sa1100_register_uart(0, 3);
  97. sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
  98. sa1100_register_uart(2, 1);
  99. /* set some GPDR bits here while it's safe */
  100. GPDR |= CERF_GPIO_CF_RESET;
  101. }
  102. static void __init cerf_init(void)
  103. {
  104. platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
  105. sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1);
  106. }
  107. MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
  108. /* Maintainer: support@intrinsyc.com */
  109. .phys_ram = 0xc0000000,
  110. .phys_io = 0x80000000,
  111. .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
  112. .map_io = cerf_map_io,
  113. .init_irq = cerf_init_irq,
  114. .timer = &sa1100_timer,
  115. .init_machine = cerf_init,
  116. MACHINE_END