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 | 1ed0c8c | 2014-10-20 13:16:29 -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 | void trustzone_init(void) |
| 22 | { |
| 23 | struct exynos_tzpc *tzpc; |
| 24 | unsigned int addr; |
| 25 | |
| 26 | for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) { |
| 27 | tzpc = (struct exynos_tzpc *)addr; |
| 28 | |
| 29 | if (addr == TZPC0_BASE) |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 30 | write32(&tzpc->r0size, R0SIZE); |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 31 | |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 32 | write32(&tzpc->decprot0set, DECPROTXSET); |
| 33 | write32(&tzpc->decprot1set, DECPROTXSET); |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 34 | |
| 35 | if (addr != TZPC9_BASE) { |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 36 | write32(&tzpc->decprot2set, DECPROTXSET); |
| 37 | write32(&tzpc->decprot3set, DECPROTXSET); |
Gabe Black | 8128a56 | 2013-09-18 05:48:37 -0700 | [diff] [blame] | 38 | } |
| 39 | } |
| 40 | } |