sama5d4.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Chip-specific setup code for the SAMA5D4 family
  3. *
  4. * Copyright (C) 2013 Atmel Corporation,
  5. * Nicolas Ferre <nicolas.ferre@atmel.com>
  6. *
  7. * Licensed under GPLv2 or later.
  8. */
  9. #include <linux/module.h>
  10. #include <linux/dma-mapping.h>
  11. #include <linux/clk/at91_pmc.h>
  12. #include <asm/irq.h>
  13. #include <asm/mach/arch.h>
  14. #include <asm/mach/map.h>
  15. #include <mach/sama5d4.h>
  16. #include <mach/cpu.h>
  17. #include <mach/hardware.h>
  18. #include "soc.h"
  19. #include "generic.h"
  20. #include "sam9_smc.h"
  21. /* --------------------------------------------------------------------
  22. * Processor initialization
  23. * -------------------------------------------------------------------- */
  24. static struct map_desc at91_io_desc[] __initdata = {
  25. {
  26. .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
  27. .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC),
  28. .length = SZ_512,
  29. .type = MT_DEVICE,
  30. },
  31. {
  32. .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC),
  33. .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC),
  34. .length = SZ_512,
  35. .type = MT_DEVICE,
  36. },
  37. { /* On sama5d4, we use USART3 as serial console */
  38. .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3),
  39. .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3),
  40. .length = SZ_256,
  41. .type = MT_DEVICE,
  42. },
  43. { /* A bunch of peripheral with fine grained IO space */
  44. .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2),
  45. .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2),
  46. .length = SZ_2K,
  47. .type = MT_DEVICE,
  48. },
  49. };
  50. static void __init sama5d4_map_io(void)
  51. {
  52. iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
  53. at91_init_sram(0, SAMA5D4_NS_SRAM_BASE, SAMA5D4_NS_SRAM_SIZE);
  54. }
  55. AT91_SOC_START(sama5d4)
  56. .map_io = sama5d4_map_io,
  57. AT91_SOC_END