Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 1 | /* |
| 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 Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include <arch/io.h> |
Julius Werner | 80af442 | 2014-10-20 13:18:56 -0700 | [diff] [blame] | 18 | #include <soc/trustzone.h> |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 19 | |
| 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 | */ |
| 24 | void 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 Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 32 | 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 Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 37 | } |
| 38 | } |