Commit 72af2fc8504daccd2f8ae2459e3e225e9c2cc512
Committed by
Minkyu Kang
1 parent
ffbff1dd6e
Exists in
master
and in
53 other branches
exynos: move tzpc_init to armv7/exynos
tzpc_init is common for all exynos5 boards, hence move it to armv7/exynos so that all other boards can use it. Also update the smdk5250 Makefile and config file. Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org> Acked-by: Chander Kashyap <chander.kashyap@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Showing 7 changed files with 77 additions and 77 deletions Side-by-side Diff
arch/arm/cpu/armv7/exynos/Makefile
arch/arm/cpu/armv7/exynos/tzpc.c
1 | +/* | |
2 | + * Lowlevel setup for SMDK5250 board based on S5PC520 | |
3 | + * | |
4 | + * Copyright (C) 2012 Samsung Electronics | |
5 | + * | |
6 | + * See file CREDITS for list of people who contributed to this | |
7 | + * project. | |
8 | + * | |
9 | + * This program is free software; you can redistribute it and/or | |
10 | + * modify it under the terms of the GNU General Public License as | |
11 | + * published by the Free Software Foundation; either version 2 of | |
12 | + * the License, or (at your option) any later version. | |
13 | + * | |
14 | + * This program is distributed in the hope that it will be useful, | |
15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | + * GNU General Public License for more details. | |
18 | + * | |
19 | + * You should have received a copy of the GNU General Public License | |
20 | + * along with this program; if not, write to the Free Software | |
21 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
22 | + * MA 02111-1307 USA | |
23 | + */ | |
24 | + | |
25 | +#include <asm/arch/tzpc.h> | |
26 | +#include <asm/io.h> | |
27 | + | |
28 | +/* Setting TZPC[TrustZone Protection Controller] */ | |
29 | +void tzpc_init(void) | |
30 | +{ | |
31 | + struct exynos_tzpc *tzpc; | |
32 | + unsigned int addr; | |
33 | + | |
34 | + for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) { | |
35 | + tzpc = (struct exynos_tzpc *)addr; | |
36 | + | |
37 | + if (addr == TZPC0_BASE) | |
38 | + writel(R0SIZE, &tzpc->r0size); | |
39 | + | |
40 | + writel(DECPROTXSET, &tzpc->decprot0set); | |
41 | + writel(DECPROTXSET, &tzpc->decprot1set); | |
42 | + | |
43 | + if (addr != TZPC9_BASE) { | |
44 | + writel(DECPROTXSET, &tzpc->decprot2set); | |
45 | + writel(DECPROTXSET, &tzpc->decprot3set); | |
46 | + } | |
47 | + } | |
48 | +} |
arch/arm/include/asm/arch-exynos/tzpc.h
... | ... | @@ -47,6 +47,34 @@ |
47 | 47 | unsigned int pcellid2; |
48 | 48 | unsigned int pcellid3; |
49 | 49 | }; |
50 | + | |
51 | +/* TZPC : Register Offsets */ | |
52 | +#define TZPC0_BASE 0x10100000 | |
53 | +#define TZPC1_BASE 0x10110000 | |
54 | +#define TZPC2_BASE 0x10120000 | |
55 | +#define TZPC3_BASE 0x10130000 | |
56 | +#define TZPC4_BASE 0x10140000 | |
57 | +#define TZPC5_BASE 0x10150000 | |
58 | +#define TZPC6_BASE 0x10160000 | |
59 | +#define TZPC7_BASE 0x10170000 | |
60 | +#define TZPC8_BASE 0x10180000 | |
61 | +#define TZPC9_BASE 0x10190000 | |
62 | + | |
63 | +#define TZPC_BASE_OFFSET 0x10000 | |
64 | + | |
65 | +/* | |
66 | + * TZPC Register Value : | |
67 | + * R0SIZE: 0x0 : Size of secured ram | |
68 | + */ | |
69 | +#define R0SIZE 0x0 | |
70 | + | |
71 | +/* | |
72 | + * TZPC Decode Protection Register Value : | |
73 | + * DECPROTXSET: 0xFF : Set Decode region to non-secure | |
74 | + */ | |
75 | +#define DECPROTXSET 0xFF | |
76 | +void tzpc_init(void); | |
77 | + | |
50 | 78 | #endif |
51 | 79 | |
52 | 80 | #endif |
board/samsung/smdk5250/Makefile
board/samsung/smdk5250/setup.h
... | ... | @@ -28,18 +28,6 @@ |
28 | 28 | #include <config.h> |
29 | 29 | #include <asm/arch/dmc.h> |
30 | 30 | |
31 | -/* TZPC : Register Offsets */ | |
32 | -#define TZPC0_BASE 0x10100000 | |
33 | -#define TZPC1_BASE 0x10110000 | |
34 | -#define TZPC2_BASE 0x10120000 | |
35 | -#define TZPC3_BASE 0x10130000 | |
36 | -#define TZPC4_BASE 0x10140000 | |
37 | -#define TZPC5_BASE 0x10150000 | |
38 | -#define TZPC6_BASE 0x10160000 | |
39 | -#define TZPC7_BASE 0x10170000 | |
40 | -#define TZPC8_BASE 0x10180000 | |
41 | -#define TZPC9_BASE 0x10190000 | |
42 | - | |
43 | 31 | /* APLL_CON1 */ |
44 | 32 | #define APLL_CON1_VAL (0x00203800) |
45 | 33 | |
... | ... | @@ -458,18 +446,6 @@ |
458 | 446 | /* CLK_GATE_IP_DISP1 */ |
459 | 447 | #define CLK_GATE_DP1_ALLOW (1 << 4) |
460 | 448 | |
461 | -/* | |
462 | - * TZPC Register Value : | |
463 | - * R0SIZE: 0x0 : Size of secured ram | |
464 | - */ | |
465 | -#define R0SIZE 0x0 | |
466 | - | |
467 | -/* | |
468 | - * TZPC Decode Protection Register Value : | |
469 | - * DECPROTXSET: 0xFF : Set Decode region to non-secure | |
470 | - */ | |
471 | -#define DECPROTXSET 0xFF | |
472 | - | |
473 | 449 | #define DDR3PHY_CTRL_PHY_RESET (1 << 0) |
474 | 450 | #define DDR3PHY_CTRL_PHY_RESET_OFF (0 << 0) |
475 | 451 | |
... | ... | @@ -590,6 +566,5 @@ |
590 | 566 | void sdelay(unsigned long); |
591 | 567 | void mem_ctrl_init(void); |
592 | 568 | void system_clock_init(void); |
593 | -void tzpc_init(void); | |
594 | 569 | #endif |
board/samsung/smdk5250/tzpc_init.c
1 | -/* | |
2 | - * Lowlevel setup for SMDK5250 board based on S5PC520 | |
3 | - * | |
4 | - * Copyright (C) 2012 Samsung Electronics | |
5 | - * | |
6 | - * See file CREDITS for list of people who contributed to this | |
7 | - * project. | |
8 | - * | |
9 | - * This program is free software; you can redistribute it and/or | |
10 | - * modify it under the terms of the GNU General Public License as | |
11 | - * published by the Free Software Foundation; either version 2 of | |
12 | - * the License, or (at your option) any later version. | |
13 | - * | |
14 | - * This program is distributed in the hope that it will be useful, | |
15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | - * GNU General Public License for more details. | |
18 | - * | |
19 | - * You should have received a copy of the GNU General Public License | |
20 | - * along with this program; if not, write to the Free Software | |
21 | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
22 | - * MA 02111-1307 USA | |
23 | - */ | |
24 | - | |
25 | -#include <asm/arch/tzpc.h> | |
26 | -#include"setup.h" | |
27 | - | |
28 | -/* Setting TZPC[TrustZone Protection Controller] */ | |
29 | -void tzpc_init(void) | |
30 | -{ | |
31 | - struct exynos_tzpc *tzpc; | |
32 | - unsigned int addr; | |
33 | - | |
34 | - for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) { | |
35 | - tzpc = (struct exynos_tzpc *)addr; | |
36 | - | |
37 | - if (addr == TZPC0_BASE) | |
38 | - writel(R0SIZE, &tzpc->r0size); | |
39 | - | |
40 | - writel(DECPROTXSET, &tzpc->decprot0set); | |
41 | - writel(DECPROTXSET, &tzpc->decprot1set); | |
42 | - | |
43 | - if (addr != TZPC9_BASE) { | |
44 | - writel(DECPROTXSET, &tzpc->decprot2set); | |
45 | - writel(DECPROTXSET, &tzpc->decprot3set); | |
46 | - } | |
47 | - } | |
48 | -} |
include/configs/exynos5250-dt.h