sama5.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Setup code for SAMA5
  4. *
  5. * Copyright (C) 2013 Atmel,
  6. * 2013 Ludovic Desroches <[email protected]>
  7. */
  8. #include <linux/of.h>
  9. #include <linux/of_platform.h>
  10. #include <asm/hardware/cache-l2x0.h>
  11. #include <asm/mach/arch.h>
  12. #include <asm/mach/map.h>
  13. #include <asm/outercache.h>
  14. #include <asm/system_misc.h>
  15. #include "generic.h"
  16. #include "sam_secure.h"
  17. static void sama5_l2c310_write_sec(unsigned long val, unsigned reg)
  18. {
  19. /* OP-TEE configures the L2 cache and does not allow modifying it yet */
  20. }
  21. static void __init sama5_secure_cache_init(void)
  22. {
  23. sam_secure_init();
  24. if (IS_ENABLED(CONFIG_OUTER_CACHE) && sam_linux_is_optee_available())
  25. outer_cache.write_sec = sama5_l2c310_write_sec;
  26. }
  27. static void __init sama5_dt_device_init(void)
  28. {
  29. of_platform_default_populate(NULL, NULL, NULL);
  30. sama5_pm_init();
  31. }
  32. static const char *const sama5_dt_board_compat[] __initconst = {
  33. "atmel,sama5",
  34. NULL
  35. };
  36. DT_MACHINE_START(sama5_dt, "Atmel SAMA5")
  37. /* Maintainer: Atmel */
  38. .init_machine = sama5_dt_device_init,
  39. .dt_compat = sama5_dt_board_compat,
  40. MACHINE_END
  41. static const char *const sama5_alt_dt_board_compat[] __initconst = {
  42. "atmel,sama5d4",
  43. NULL
  44. };
  45. DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5")
  46. /* Maintainer: Atmel */
  47. .init_machine = sama5_dt_device_init,
  48. .dt_compat = sama5_alt_dt_board_compat,
  49. .l2c_aux_mask = ~0UL,
  50. MACHINE_END
  51. static void __init sama5d2_init(void)
  52. {
  53. of_platform_default_populate(NULL, NULL, NULL);
  54. sama5d2_pm_init();
  55. }
  56. static const char *const sama5d2_compat[] __initconst = {
  57. "atmel,sama5d2",
  58. NULL
  59. };
  60. DT_MACHINE_START(sama5d2, "Atmel SAMA5")
  61. /* Maintainer: Atmel */
  62. .init_machine = sama5d2_init,
  63. .init_early = sama5_secure_cache_init,
  64. .dt_compat = sama5d2_compat,
  65. .l2c_aux_mask = ~0UL,
  66. MACHINE_END