tzpc.c 701 B

1234567891011121314151617181920212223242526
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2015 Chen-Yu Tsai <wens@csie.org>
  4. */
  5. #include <asm/io.h>
  6. #include <asm/arch/cpu.h>
  7. #include <asm/arch/tzpc.h>
  8. /* Configure Trust Zone Protection Controller */
  9. void tzpc_init(void)
  10. {
  11. struct sunxi_tzpc *tzpc = (struct sunxi_tzpc *)SUNXI_TZPC_BASE;
  12. #ifdef CONFIG_MACH_SUN6I
  13. /* Enable non-secure access to the RTC */
  14. writel(SUN6I_TZPC_DECPORT0_RTC, &tzpc->decport0_set);
  15. #endif
  16. #ifdef CONFIG_MACH_SUN8I_H3
  17. /* Enable non-secure access to all peripherals */
  18. writel(SUN8I_H3_TZPC_DECPORT0_ALL, &tzpc->decport0_set);
  19. writel(SUN8I_H3_TZPC_DECPORT1_ALL, &tzpc->decport1_set);
  20. writel(SUN8I_H3_TZPC_DECPORT2_ALL, &tzpc->decport2_set);
  21. #endif
  22. }