tree: drop last paragraph of GPL copyright header
[coreboot.git] / src / soc / nvidia / tegra210 / secmon.c
blob392e06c71b547b7c80ba4d333c997b1055df057a
1 /*
2 * This file is part of the coreboot project.
4 * Copyright 2014 Google Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <arch/secmon.h>
17 #include <console/console.h>
18 #include <soc/addressmap.h>
19 #include <soc/mmu_operations.h>
21 static void soc_get_secure_mem(uint64_t *base, size_t *size)
23 uintptr_t tz_base_mib;
24 size_t tz_size_mib;
26 carveout_range(CARVEOUT_TZ, &tz_base_mib, &tz_size_mib);
28 tz_base_mib *= MiB;
29 tz_size_mib *= MiB;
31 *base = tz_base_mib;
32 *size = tz_size_mib;
35 void soc_get_secmon_base_size(uint64_t *base, size_t *size)
37 uintptr_t tz_base;
38 size_t ttb_size, tz_size;
40 soc_get_secure_mem(&tz_base, &tz_size);
42 ttb_size = CONFIG_TTB_SIZE_MB * MiB;
44 *base = tz_base + ttb_size;
45 *size = tz_size - ttb_size;