summaryrefslogtreecommitdiffstats
path: root/plat/imx/imx8m/imx_aipstz.c
blob: ecf8b1ddafd6542b6dc6741a97b8951781373117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Copyright (c) 2019, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <lib/mmio.h>

#include <imx_aipstz.h>

void imx_aipstz_init(const struct aipstz_cfg *aipstz_cfg)
{
	const struct aipstz_cfg *aipstz = aipstz_cfg;

	while (aipstz->base != 0U) {
		mmio_write_32(aipstz->base + AIPSTZ_MPR0, aipstz->mpr0);
		mmio_write_32(aipstz->base + AIPSTZ_MPR1, aipstz->mpr1);

		for (int i = 0; i < AIPSTZ_OPACR_NUM; i++)
			mmio_write_32(aipstz->base + OPACR_OFFSET(i), aipstz->opacr[i]);

		aipstz++;
	}
}