blob: d9c141f56270f9692de9eb776268e1b9feaa756b [file] [log] [blame]
Bryan O'Donoghue4b576102018-07-11 16:35:17 +01001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00006
Bryan O'Donoghue4b576102018-07-11 16:35:17 +01007#include <stdint.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008
9#include <lib/mmio.h>
10
Bryan O'Donoghue4b576102018-07-11 16:35:17 +010011#include <imx_caam.h>
12
13void imx_caam_init(void)
14{
15 struct caam_ctrl *caam = (struct caam_ctrl *)CAAM_AIPS_BASE;
16 uint32_t reg;
17 int i;
18
19 for (i = 0; i < CAAM_NUM_JOB_RINGS; i++) {
20 reg = mmio_read_32((uintptr_t)&caam->jr[i].jrmidr_ms);
21 reg |= JROWN_NS | JROWN_MID;
22 mmio_write_32((uintptr_t)&caam->jr[i].jrmidr_ms, reg);
23 }
24}