l2_cache_pl310.c 468 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2021 Nuvoton Technology Corp.
  4. */
  5. #include <common.h>
  6. #include <asm/io.h>
  7. #include <asm/pl310.h>
  8. void l2_pl310_init(void);
  9. void set_pl310_ctrl(u32 enable)
  10. {
  11. struct pl310_regs *const pl310 = (struct pl310_regs *)CFG_SYS_PL310_BASE;
  12. writel(enable, &pl310->pl310_ctrl);
  13. }
  14. void v7_outer_cache_enable(void)
  15. {
  16. l2_pl310_init();
  17. set_pl310_ctrl(1);
  18. }
  19. void v7_outer_cache_disable(void)
  20. {
  21. set_pl310_ctrl(0);
  22. }