spear1310.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * arch/arm/mach-spear13xx/spear1310.c
  3. *
  4. * SPEAr1310 machine source file
  5. *
  6. * Copyright (C) 2012 ST Microelectronics
  7. * Viresh Kumar <viresh.linux@gmail.com>
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #define pr_fmt(fmt) "SPEAr1310: " fmt
  14. #include <linux/amba/pl022.h>
  15. #include <linux/irqchip.h>
  16. #include <linux/of_platform.h>
  17. #include <linux/pata_arasan_cf_data.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach/map.h>
  20. #include "generic.h"
  21. #include <mach/spear.h>
  22. /* Base addresses */
  23. #define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000)
  24. #define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000)
  25. static void __init spear1310_dt_init(void)
  26. {
  27. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  28. }
  29. static const char * const spear1310_dt_board_compat[] = {
  30. "st,spear1310",
  31. "st,spear1310-evb",
  32. NULL,
  33. };
  34. /*
  35. * Following will create 16MB static virtual/physical mappings
  36. * PHYSICAL VIRTUAL
  37. * 0xD8000000 0xFA000000
  38. */
  39. struct map_desc spear1310_io_desc[] __initdata = {
  40. {
  41. .virtual = VA_SPEAR1310_RAS_GRP1_BASE,
  42. .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE),
  43. .length = SZ_16M,
  44. .type = MT_DEVICE
  45. },
  46. };
  47. static void __init spear1310_map_io(void)
  48. {
  49. iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
  50. spear13xx_map_io();
  51. }
  52. DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
  53. .smp = smp_ops(spear13xx_smp_ops),
  54. .map_io = spear1310_map_io,
  55. .init_irq = irqchip_init,
  56. .init_time = spear13xx_timer_init,
  57. .init_machine = spear1310_dt_init,
  58. .restart = spear_restart,
  59. .dt_compat = spear1310_dt_board_compat,
  60. MACHINE_END