imx_caam.c 500 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <stdint.h>
  7. #include <lib/mmio.h>
  8. #include <imx_caam.h>
  9. void imx_caam_init(void)
  10. {
  11. struct caam_ctrl *caam = (struct caam_ctrl *)CAAM_AIPS_BASE;
  12. uint32_t reg;
  13. int i;
  14. for (i = 0; i < CAAM_NUM_JOB_RINGS; i++) {
  15. reg = mmio_read_32((uintptr_t)&caam->jr[i].jrmidr_ms);
  16. reg |= JROWN_NS | JROWN_MID;
  17. mmio_write_32((uintptr_t)&caam->jr[i].jrmidr_ms, reg);
  18. }
  19. }