blob: b83d54fa4c7a4b7d15297fa1c40f6ee216678a27 [file] [log] [blame]
Gabe Black8128a562013-09-18 05:48:37 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2013 Google Inc.
5 * Copyright (C) 2012 Samsung Electronics
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Gabe Black8128a562013-09-18 05:48:37 -070015 */
16
17#include <arch/io.h>
Julius Werner80af4422014-10-20 13:18:56 -070018#include <soc/trustzone.h>
Gabe Black8128a562013-09-18 05:48:37 -070019
20/* Setting TZPC[TrustZone Protection Controller]
21 * We pretty much disable it all, as the kernel
22 * expects it that way -- and that's not the default.
23 */
24void trustzone_init(void)
25{
26 struct exynos_tzpc *tzpc;
27 unsigned int addr;
28
29 for (addr = TZPC10_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
30 tzpc = (struct exynos_tzpc *)addr;
31 if (addr == TZPC0_BASE)
Julius Werner2f37bd62015-02-19 14:51:15 -080032 write32(&tzpc->r0size, R0SIZE);
33 write32(&tzpc->decprot0set, DECPROTXSET);
34 write32(&tzpc->decprot1set, DECPROTXSET);
35 write32(&tzpc->decprot2set, DECPROTXSET);
36 write32(&tzpc->decprot3set, DECPROTXSET);
Gabe Black8128a562013-09-18 05:48:37 -070037 }
38}