blob: a36e2961a929d158e3266174b7e884db166985a8 [file] [log] [blame]
Jacky Bai91c6d322019-05-21 20:24:52 +08001/*
2 * copyright (c) 2019, arm limited and contributors. all rights reserved.
3 *
4 * spdx-license-identifier: bsd-3-clause
5 */
6
7#include <lib/mmio.h>
8
9#include <imx_aipstz.h>
10
11void imx_aipstz_init(const struct aipstz_cfg *aipstz_cfg)
12{
13 const struct aipstz_cfg *aipstz = aipstz_cfg;
14
15 while (aipstz->base != 0U) {
16 mmio_write_32(aipstz->base + AIPSTZ_MPR0, aipstz->mpr0);
17 mmio_write_32(aipstz->base + AIPSTZ_MPR1, aipstz->mpr1);
18
19 for (int i = 0; i < AIPSTZ_OPACR_NUM; i++)
20 mmio_write_32(aipstz->base + OPACR_OFFSET(i), aipstz->opacr[i]);
21
22 aipstz++;
23 }
24}