~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/u-boot/arch/arm/cpu/armv7/exynos/tzpc.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Lowlevel setup for SMDK5250 board based on S5PC520
 
3
 *
 
4
 * Copyright (C) 2012 Samsung Electronics
 
5
 *
 
6
 * SPDX-License-Identifier:     GPL-2.0+
 
7
 */
 
8
 
 
9
#include <common.h>
 
10
#include <asm/arch/tzpc.h>
 
11
#include <asm/io.h>
 
12
 
 
13
/* Setting TZPC[TrustZone Protection Controller] */
 
14
void tzpc_init(void)
 
15
{
 
16
        struct exynos_tzpc *tzpc;
 
17
        unsigned int addr, start = 0, end = 0;
 
18
 
 
19
        start = samsung_get_base_tzpc();
 
20
 
 
21
        if (cpu_is_exynos5())
 
22
                end = start + ((EXYNOS5_NR_TZPC_BANKS - 1) * TZPC_BASE_OFFSET);
 
23
        else if (cpu_is_exynos4())
 
24
                end = start + ((EXYNOS4_NR_TZPC_BANKS - 1) * TZPC_BASE_OFFSET);
 
25
 
 
26
        for (addr = start; addr <= end; addr += TZPC_BASE_OFFSET) {
 
27
                tzpc = (struct exynos_tzpc *)addr;
 
28
 
 
29
                if (addr == start)
 
30
                        writel(R0SIZE, &tzpc->r0size);
 
31
 
 
32
                writel(DECPROTXSET, &tzpc->decprot0set);
 
33
                writel(DECPROTXSET, &tzpc->decprot1set);
 
34
 
 
35
                if (cpu_is_exynos5() && (addr == end))
 
36
                        break;
 
37
 
 
38
                writel(DECPROTXSET, &tzpc->decprot2set);
 
39
                writel(DECPROTXSET, &tzpc->decprot3set);
 
40
        }
 
41
}