blob: b0cdc384325283ce025d0979d905e098c4d4211c [file] [log] [blame]
Angel Pons1ddb8942020-04-04 18:51:26 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Gabe Black8128a562013-09-18 05:48:37 -07002
Kyösti Mälkki13f66502019-03-03 08:01:05 +02003#include <device/mmio.h>
Julius Werner80af4422014-10-20 13:18:56 -07004#include <soc/trustzone.h>
Gabe Black8128a562013-09-18 05:48:37 -07005
6/* Setting TZPC[TrustZone Protection Controller]
7 * We pretty much disable it all, as the kernel
8 * expects it that way -- and that's not the default.
9 */
10void trustzone_init(void)
11{
12 struct exynos_tzpc *tzpc;
13 unsigned int addr;
14
15 for (addr = TZPC10_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
16 tzpc = (struct exynos_tzpc *)addr;
17 if (addr == TZPC0_BASE)
Julius Werner2f37bd62015-02-19 14:51:15 -080018 write32(&tzpc->r0size, R0SIZE);
19 write32(&tzpc->decprot0set, DECPROTXSET);
20 write32(&tzpc->decprot1set, DECPROTXSET);
21 write32(&tzpc->decprot2set, DECPROTXSET);
22 write32(&tzpc->decprot3set, DECPROTXSET);
Gabe Black8128a562013-09-18 05:48:37 -070023 }
24}