nanoengine.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * linux/arch/arm/mach-sa1100/nanoengine.c
  3. *
  4. * Bright Star Engineering's nanoEngine board init code.
  5. *
  6. * Copyright (C) 2009 Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #include <linux/init.h>
  14. #include <linux/kernel.h>
  15. #include <linux/mtd/mtd.h>
  16. #include <linux/mtd/partitions.h>
  17. #include <linux/root_dev.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/setup.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach/flash.h>
  22. #include <asm/mach/map.h>
  23. #include <asm/mach/serial_sa1100.h>
  24. #include <mach/hardware.h>
  25. #include "generic.h"
  26. /* Flash bank 0 */
  27. static struct mtd_partition nanoengine_partitions[] = {
  28. {
  29. .name = "nanoEngine boot firmware and parameter table",
  30. .size = 0x00010000, /* 32K */
  31. .offset = 0,
  32. .mask_flags = MTD_WRITEABLE,
  33. }, {
  34. .name = "kernel/initrd reserved",
  35. .size = 0x002f0000,
  36. .offset = 0x00010000,
  37. .mask_flags = MTD_WRITEABLE,
  38. }, {
  39. .name = "experimental filesystem allocation",
  40. .size = 0x00100000,
  41. .offset = 0x00300000,
  42. .mask_flags = MTD_WRITEABLE,
  43. }
  44. };
  45. static struct flash_platform_data nanoengine_flash_data = {
  46. .map_name = "jedec_probe",
  47. .parts = nanoengine_partitions,
  48. .nr_parts = ARRAY_SIZE(nanoengine_partitions),
  49. };
  50. static struct resource nanoengine_flash_resources[] = {
  51. {
  52. .start = SA1100_CS0_PHYS,
  53. .end = SA1100_CS0_PHYS + SZ_32M - 1,
  54. .flags = IORESOURCE_MEM,
  55. }, {
  56. .start = SA1100_CS1_PHYS,
  57. .end = SA1100_CS1_PHYS + SZ_32M - 1,
  58. .flags = IORESOURCE_MEM,
  59. }
  60. };
  61. static struct map_desc nanoengine_io_desc[] __initdata = {
  62. {
  63. /* System Registers */
  64. .virtual = 0xf0000000,
  65. .pfn = __phys_to_pfn(0x10000000),
  66. .length = 0x00100000,
  67. .type = MT_DEVICE
  68. }, {
  69. /* Internal PCI Config Space */
  70. .virtual = 0xf1000000,
  71. .pfn = __phys_to_pfn(0x18A00000),
  72. .length = 0x00100000,
  73. .type = MT_DEVICE
  74. }
  75. };
  76. static void __init nanoengine_map_io(void)
  77. {
  78. sa1100_map_io();
  79. iotable_init(nanoengine_io_desc, ARRAY_SIZE(nanoengine_io_desc));
  80. sa1100_register_uart(0, 1);
  81. sa1100_register_uart(1, 2);
  82. sa1100_register_uart(2, 3);
  83. Ser1SDCR0 |= SDCR0_UART;
  84. /* disable IRDA -- UART2 is used as a normal serial port */
  85. Ser2UTCR4 = 0;
  86. Ser2HSCR0 = 0;
  87. }
  88. static void __init nanoengine_init(void)
  89. {
  90. sa11x0_register_mtd(&nanoengine_flash_data, nanoengine_flash_resources,
  91. ARRAY_SIZE(nanoengine_flash_resources));
  92. }
  93. MACHINE_START(NANOENGINE, "BSE nanoEngine")
  94. .boot_params = 0xc0000000,
  95. .map_io = nanoengine_map_io,
  96. .init_irq = sa1100_init_irq,
  97. .timer = &sa1100_timer,
  98. .init_machine = nanoengine_init,
  99. MACHINE_END