spear1310.c 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/of_platform.h>
  16. #include <asm/hardware/gic.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/map.h>
  19. #include <mach/generic.h>
  20. #include <mach/spear.h>
  21. /* Base addresses */
  22. #define SPEAR1310_SSP1_BASE UL(0x5D400000)
  23. #define SPEAR1310_SATA0_BASE UL(0xB1000000)
  24. #define SPEAR1310_SATA1_BASE UL(0xB1800000)
  25. #define SPEAR1310_SATA2_BASE UL(0xB4000000)
  26. #define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000)
  27. #define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000)
  28. #define SPEAR1310_RAS_BASE UL(0xD8400000)
  29. #define VA_SPEAR1310_RAS_BASE IOMEM(UL(0xFA400000))
  30. /* ssp device registration */
  31. static struct pl022_ssp_controller ssp1_plat_data = {
  32. .bus_id = 0,
  33. .enable_dma = 0,
  34. .num_chipselect = 3,
  35. };
  36. /* Add SPEAr1310 auxdata to pass platform data */
  37. static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
  38. OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
  39. OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
  40. OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
  41. OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
  42. OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
  43. {}
  44. };
  45. static void __init spear1310_dt_init(void)
  46. {
  47. of_platform_populate(NULL, of_default_bus_match_table,
  48. spear1310_auxdata_lookup, NULL);
  49. }
  50. static const char * const spear1310_dt_board_compat[] = {
  51. "st,spear1310",
  52. "st,spear1310-evb",
  53. NULL,
  54. };
  55. /*
  56. * Following will create 16MB static virtual/physical mappings
  57. * PHYSICAL VIRTUAL
  58. * 0xD8000000 0xFA000000
  59. */
  60. struct map_desc spear1310_io_desc[] __initdata = {
  61. {
  62. .virtual = VA_SPEAR1310_RAS_GRP1_BASE,
  63. .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE),
  64. .length = SZ_16M,
  65. .type = MT_DEVICE
  66. },
  67. };
  68. static void __init spear1310_map_io(void)
  69. {
  70. iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
  71. spear13xx_map_io();
  72. }
  73. DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
  74. .smp = smp_ops(spear13xx_smp_ops),
  75. .map_io = spear1310_map_io,
  76. .init_irq = spear13xx_dt_init_irq,
  77. .handle_irq = gic_handle_irq,
  78. .timer = &spear13xx_timer,
  79. .init_machine = spear1310_dt_init,
  80. .restart = spear_restart,
  81. .dt_compat = spear1310_dt_board_compat,
  82. MACHINE_END