Angel Pons | 1ddb894 | 2020-04-04 18:51:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 2 | |
Kyösti Mälkki | 13f6650 | 2019-03-03 08:01:05 +0200 | [diff] [blame] | 3 | #include <device/mmio.h> |
Julius Werner | 1ed0c8c | 2014-10-20 13:16:29 -0700 | [diff] [blame] | 4 | #include <soc/trustzone.h> |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 5 | |
| 6 | /* Setting TZPC[TrustZone Protection Controller] */ |
| 7 | void trustzone_init(void) |
| 8 | { |
| 9 | struct exynos_tzpc *tzpc; |
| 10 | unsigned int addr; |
| 11 | |
| 12 | for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) { |
| 13 | tzpc = (struct exynos_tzpc *)addr; |
| 14 | |
| 15 | if (addr == TZPC0_BASE) |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 16 | write32(&tzpc->r0size, R0SIZE); |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 17 | |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 18 | write32(&tzpc->decprot0set, DECPROTXSET); |
| 19 | write32(&tzpc->decprot1set, DECPROTXSET); |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 20 | |
| 21 | if (addr != TZPC9_BASE) { |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 22 | write32(&tzpc->decprot2set, DECPROTXSET); |
| 23 | write32(&tzpc->decprot3set, DECPROTXSET); |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 24 | } |
| 25 | } |
| 26 | } |