board-artpec6.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * ARTPEC-6 device support.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/amba/bus.h>
  9. #include <linux/clocksource.h>
  10. #include <linux/dma-mapping.h>
  11. #include <linux/io.h>
  12. #include <linux/irqchip.h>
  13. #include <linux/irqchip/arm-gic.h>
  14. #include <linux/mfd/syscon.h>
  15. #include <linux/of.h>
  16. #include <linux/of_address.h>
  17. #include <linux/clk-provider.h>
  18. #include <linux/regmap.h>
  19. #include <linux/smp.h>
  20. #include <asm/smp_scu.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach/map.h>
  23. #include <asm/psci.h>
  24. #include <linux/arm-smccc.h>
  25. #define ARTPEC6_DMACFG_REGNUM 0x10
  26. #define ARTPEC6_DMACFG_UARTS_BURST 0xff
  27. #define SECURE_OP_L2C_WRITEREG 0xb4000001
  28. static void __init artpec6_init_machine(void)
  29. {
  30. struct regmap *regmap;
  31. regmap = syscon_regmap_lookup_by_compatible("axis,artpec6-syscon");
  32. if (!IS_ERR(regmap)) {
  33. /* Use PL011 DMA Burst Request signal instead of DMA
  34. * Single Request
  35. */
  36. regmap_write(regmap, ARTPEC6_DMACFG_REGNUM,
  37. ARTPEC6_DMACFG_UARTS_BURST);
  38. };
  39. }
  40. static void artpec6_l2c310_write_sec(unsigned long val, unsigned reg)
  41. {
  42. struct arm_smccc_res res;
  43. arm_smccc_smc(SECURE_OP_L2C_WRITEREG, reg, val, 0,
  44. 0, 0, 0, 0, &res);
  45. WARN_ON(res.a0);
  46. }
  47. static const char * const artpec6_dt_match[] = {
  48. "axis,artpec6",
  49. NULL
  50. };
  51. DT_MACHINE_START(ARTPEC6, "Axis ARTPEC-6 Platform")
  52. .l2c_aux_val = 0x0C000000,
  53. .l2c_aux_mask = 0xF3FFFFFF,
  54. .l2c_write_sec = artpec6_l2c310_write_sec,
  55. .init_machine = artpec6_init_machine,
  56. .dt_compat = artpec6_dt_match,
  57. MACHINE_END