ark1668e.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Setup code for arkmicro soc
  3. *
  4. * Licensed under GPLv2 or later.
  5. */
  6. #include <linux/of.h>
  7. #include <linux/of_platform.h>
  8. #include <linux/amba/serial.h>
  9. #include <linux/dma/dw.h>
  10. #include <linux/device.h>
  11. #include <linux/of.h>
  12. #include <asm/mach/arch.h>
  13. #include <asm/mach/map.h>
  14. #include <asm/system_misc.h>
  15. #include <asm/smp_scu.h>
  16. void __iomem *ark_scu_base;
  17. static struct map_desc ark_cortex_a9_scu_map __initdata = {
  18. .length = SZ_256,
  19. .type = MT_DEVICE,
  20. };
  21. static void __init ark_scu_map_io(void)
  22. {
  23. unsigned long base;
  24. base = scu_a9_get_base();
  25. ark_cortex_a9_scu_map.pfn = __phys_to_pfn(base);
  26. /* Expected address is in vmalloc area that's why simple assign here */
  27. ark_cortex_a9_scu_map.virtual = base;
  28. iotable_init(&ark_cortex_a9_scu_map, 1);
  29. ark_scu_base = (void __iomem *)base;
  30. BUG_ON(!ark_scu_base);
  31. }
  32. /**
  33. * ark_map_io - Create memory mappings needed for early I/O.
  34. */
  35. static void __init ark_map_io(void)
  36. {
  37. debug_ll_io_init();
  38. ark_scu_map_io();
  39. }
  40. static const char * const ark_board_dt_compat[] = {
  41. "arkmicro,ark1668e",
  42. NULL,
  43. };
  44. DT_MACHINE_START(ARKMIDRO_DT, "Arkmicro arm soc Family")
  45. .map_io = ark_map_io,
  46. .dt_compat = ark_board_dt_compat,
  47. MACHINE_END