spear1310.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. /* ssp device registration */
  27. static struct pl022_ssp_controller ssp1_plat_data = {
  28. .bus_id = 0,
  29. .enable_dma = 0,
  30. .num_chipselect = 3,
  31. };
  32. /* Add SPEAr1310 auxdata to pass platform data */
  33. static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
  34. OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
  35. OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
  36. OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
  37. OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
  38. OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
  39. {}
  40. };
  41. static void __init spear1310_dt_init(void)
  42. {
  43. of_platform_populate(NULL, of_default_bus_match_table,
  44. spear1310_auxdata_lookup, NULL);
  45. }
  46. static const char * const spear1310_dt_board_compat[] = {
  47. "st,spear1310",
  48. "st,spear1310-evb",
  49. NULL,
  50. };
  51. /*
  52. * Following will create 16MB static virtual/physical mappings
  53. * PHYSICAL VIRTUAL
  54. * 0xD8000000 0xFA000000
  55. */
  56. struct map_desc spear1310_io_desc[] __initdata = {
  57. {
  58. .virtual = VA_SPEAR1310_RAS_GRP1_BASE,
  59. .pfn = __phys_to_pfn(SPEAR1310_RAS_GRP1_BASE),
  60. .length = SZ_16M,
  61. .type = MT_DEVICE
  62. },
  63. };
  64. static void __init spear1310_map_io(void)
  65. {
  66. iotable_init(spear1310_io_desc, ARRAY_SIZE(spear1310_io_desc));
  67. spear13xx_map_io();
  68. }
  69. DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
  70. .map_io = spear1310_map_io,
  71. .init_irq = spear13xx_dt_init_irq,
  72. .handle_irq = gic_handle_irq,
  73. .timer = &spear13xx_timer,
  74. .init_machine = spear1310_dt_init,
  75. .restart = spear_restart,
  76. .dt_compat = spear1310_dt_board_compat,
  77. MACHINE_END