xref: /rk3399_ARM-atf/plat/imx/common/imx_caam.c (revision 36044baf08a9f816a8a062a8a50ede12a816a6dd)
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 <mmio.h>
8 #include <imx_caam.h>
9 
10 void imx_caam_init(void)
11 {
12 	struct caam_ctrl *caam = (struct caam_ctrl *)CAAM_AIPS_BASE;
13 	uint32_t reg;
14 	int i;
15 
16 	for (i = 0; i < CAAM_NUM_JOB_RINGS; i++) {
17 		reg = mmio_read_32((uintptr_t)&caam->jr[i].jrmidr_ms);
18 		reg |= JROWN_NS | JROWN_MID;
19 		mmio_write_32((uintptr_t)&caam->jr[i].jrmidr_ms, reg);
20 	}
21 }
22