atmel_sfr.c 669 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (C) 2015 Atmel Corporation
  3. * Wenyou Yang <wenyou.yang@atmel.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <asm/hardware.h>
  9. #include <asm/io.h>
  10. #include <asm/arch/sama5_sfr.h>
  11. void redirect_int_from_saic_to_aic(void)
  12. {
  13. struct atmel_sfr *sfr = (struct atmel_sfr *)ATMEL_BASE_SFR;
  14. u32 key32;
  15. if (!(readl(&sfr->aicredir) & ATMEL_SFR_AICREDIR_NSAIC)) {
  16. key32 = readl(&sfr->sn1) ^ ATMEL_SFR_AICREDIR_KEY;
  17. writel((key32 | ATMEL_SFR_AICREDIR_NSAIC), &sfr->aicredir);
  18. }
  19. }
  20. void configure_2nd_sram_as_l2_cache(void)
  21. {
  22. struct atmel_sfr *sfr = (struct atmel_sfr *)ATMEL_BASE_SFR;
  23. writel(1, &sfr->l2cc_hramc);
  24. }