All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5
@ 2013-03-15  6:23 Inderpal Singh
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos Inderpal Singh
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Inderpal Singh @ 2013-03-15  6:23 UTC (permalink / raw)
  To: u-boot

The first patch moves the tzpc_init file from smdk5250 to armv7/exynos.
The second makes tzpc_init common for exynos4 and exynos5. And the third
makes necessary changes to exynos4 based origen and smdkv310 boards.

The patchset has been tested on exynos4 based origen and exynos5 based
Arndale board.

Changes in v2:
	- removed uninitialised warning for start and end variables
	- corrected the SPL_TEXT_BASE for origen and smdkv310
	- Added Chander's Acked-by

Inderpal Singh (3):
  exynos: move tzpc_init to armv7/exynos
  exynos: update tzpc_init to make it common for exynos4 and exynos5
  exynos: Update origen and smdkv310 to use common tzpc_init

 arch/arm/cpu/armv7/exynos/Makefile      |    2 +-
 arch/arm/cpu/armv7/exynos/tzpc_init.c   |   57 +++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/s5p-common/Makefile  |    2 ++
 arch/arm/include/asm/arch-exynos/tzpc.h |   28 +++++++++++++++
 board/samsung/origen/lowlevel_init.S    |   44 ++---------------------
 board/samsung/origen/origen_setup.h     |   25 -------------
 board/samsung/smdk5250/Makefile         |    1 -
 board/samsung/smdk5250/lowlevel_init.S  |    2 ++
 board/samsung/smdk5250/setup.h          |   25 -------------
 board/samsung/smdk5250/tzpc_init.c      |   48 -------------------------
 board/samsung/smdkv310/lowlevel_init.S  |   60 ++-----------------------------
 include/configs/exynos5250-dt.h         |    2 --
 include/configs/origen.h                |    2 ++
 include/configs/smdkv310.h              |    2 ++
 spl/Makefile                            |    4 +++
 15 files changed, 102 insertions(+), 202 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/exynos/tzpc_init.c
 delete mode 100644 board/samsung/smdk5250/tzpc_init.c

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos
  2013-03-15  6:23 [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
@ 2013-03-15  6:23 ` Inderpal Singh
  2013-03-29  2:57   ` Minkyu Kang
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 2/3] exynos: update tzpc_init to make it common for exynos4 and exynos5 Inderpal Singh
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Inderpal Singh @ 2013-03-15  6:23 UTC (permalink / raw)
  To: u-boot

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>
---
 arch/arm/cpu/armv7/exynos/Makefile      |    2 +-
 arch/arm/cpu/armv7/exynos/tzpc_init.c   |   48 +++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-exynos/tzpc.h |   28 ++++++++++++++++++
 board/samsung/smdk5250/Makefile         |    1 -
 board/samsung/smdk5250/setup.h          |   25 ----------------
 board/samsung/smdk5250/tzpc_init.c      |   48 -------------------------------
 include/configs/exynos5250-dt.h         |    2 --
 7 files changed, 77 insertions(+), 77 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/exynos/tzpc_init.c
 delete mode 100644 board/samsung/smdk5250/tzpc_init.c

diff --git a/arch/arm/cpu/armv7/exynos/Makefile b/arch/arm/cpu/armv7/exynos/Makefile
index 9119961..b9cf921 100644
--- a/arch/arm/cpu/armv7/exynos/Makefile
+++ b/arch/arm/cpu/armv7/exynos/Makefile
@@ -22,7 +22,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).o
 
-COBJS	+= clock.o power.o soc.o system.o pinmux.o
+COBJS	+= clock.o power.o soc.o system.o pinmux.o tzpc_init.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/arch/arm/cpu/armv7/exynos/tzpc_init.c b/arch/arm/cpu/armv7/exynos/tzpc_init.c
new file mode 100644
index 0000000..81adb4b
--- /dev/null
+++ b/arch/arm/cpu/armv7/exynos/tzpc_init.c
@@ -0,0 +1,48 @@
+/*
+ * Lowlevel setup for SMDK5250 board based on S5PC520
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <asm/arch/tzpc.h>
+#include <asm/io.h>
+
+/* Setting TZPC[TrustZone Protection Controller] */
+void tzpc_init(void)
+{
+	struct exynos_tzpc *tzpc;
+	unsigned int addr;
+
+	for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
+		tzpc = (struct exynos_tzpc *)addr;
+
+		if (addr == TZPC0_BASE)
+			writel(R0SIZE, &tzpc->r0size);
+
+		writel(DECPROTXSET, &tzpc->decprot0set);
+		writel(DECPROTXSET, &tzpc->decprot1set);
+
+		if (addr != TZPC9_BASE) {
+			writel(DECPROTXSET, &tzpc->decprot2set);
+			writel(DECPROTXSET, &tzpc->decprot3set);
+		}
+	}
+}
diff --git a/arch/arm/include/asm/arch-exynos/tzpc.h b/arch/arm/include/asm/arch-exynos/tzpc.h
index c5eb4b1..050ad70 100644
--- a/arch/arm/include/asm/arch-exynos/tzpc.h
+++ b/arch/arm/include/asm/arch-exynos/tzpc.h
@@ -47,6 +47,34 @@ struct exynos_tzpc {
 	unsigned int pcellid2;
 	unsigned int pcellid3;
 };
+
+/* TZPC : Register Offsets */
+#define TZPC0_BASE		0x10100000
+#define TZPC1_BASE		0x10110000
+#define TZPC2_BASE		0x10120000
+#define TZPC3_BASE		0x10130000
+#define TZPC4_BASE		0x10140000
+#define TZPC5_BASE		0x10150000
+#define TZPC6_BASE		0x10160000
+#define TZPC7_BASE		0x10170000
+#define TZPC8_BASE		0x10180000
+#define TZPC9_BASE		0x10190000
+
+#define TZPC_BASE_OFFSET		0x10000
+
+/*
+ * TZPC Register Value :
+ * R0SIZE: 0x0 : Size of secured ram
+ */
+#define R0SIZE			0x0
+
+/*
+ * TZPC Decode Protection Register Value :
+ * DECPROTXSET: 0xFF : Set Decode region to non-secure
+ */
+#define DECPROTXSET		0xFF
+void tzpc_init(void);
+
 #endif
 
 #endif
diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
index ecca9f3..f2c32ee 100644
--- a/board/samsung/smdk5250/Makefile
+++ b/board/samsung/smdk5250/Makefile
@@ -28,7 +28,6 @@ SOBJS	:= lowlevel_init.o
 
 COBJS	:= clock_init.o
 COBJS	+= dmc_common.o dmc_init_ddr3.o
-COBJS	+= tzpc_init.o
 COBJS	+= smdk5250_spl.o
 
 ifndef CONFIG_SPL_BUILD
diff --git a/board/samsung/smdk5250/setup.h b/board/samsung/smdk5250/setup.h
index a159601..8c1a3f4 100644
--- a/board/samsung/smdk5250/setup.h
+++ b/board/samsung/smdk5250/setup.h
@@ -28,18 +28,6 @@
 #include <config.h>
 #include <asm/arch/dmc.h>
 
-/* TZPC : Register Offsets */
-#define TZPC0_BASE		0x10100000
-#define TZPC1_BASE		0x10110000
-#define TZPC2_BASE		0x10120000
-#define TZPC3_BASE		0x10130000
-#define TZPC4_BASE		0x10140000
-#define TZPC5_BASE		0x10150000
-#define TZPC6_BASE		0x10160000
-#define TZPC7_BASE		0x10170000
-#define TZPC8_BASE		0x10180000
-#define TZPC9_BASE		0x10190000
-
 /* APLL_CON1	*/
 #define APLL_CON1_VAL	(0x00203800)
 
@@ -458,18 +446,6 @@
 /* CLK_GATE_IP_DISP1 */
 #define CLK_GATE_DP1_ALLOW	(1 << 4)
 
-/*
- * TZPC Register Value :
- * R0SIZE: 0x0 : Size of secured ram
- */
-#define R0SIZE			0x0
-
-/*
- * TZPC Decode Protection Register Value :
- * DECPROTXSET: 0xFF : Set Decode region to non-secure
- */
-#define DECPROTXSET		0xFF
-
 #define DDR3PHY_CTRL_PHY_RESET	(1 << 0)
 #define DDR3PHY_CTRL_PHY_RESET_OFF	(0 << 0)
 
@@ -590,5 +566,4 @@ void update_reset_dll(struct exynos5_dmc *, enum ddr_mode);
 void sdelay(unsigned long);
 void mem_ctrl_init(void);
 void system_clock_init(void);
-void tzpc_init(void);
 #endif
diff --git a/board/samsung/smdk5250/tzpc_init.c b/board/samsung/smdk5250/tzpc_init.c
deleted file mode 100644
index c833541..0000000
--- a/board/samsung/smdk5250/tzpc_init.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Lowlevel setup for SMDK5250 board based on S5PC520
- *
- * Copyright (C) 2012 Samsung Electronics
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <asm/arch/tzpc.h>
-#include"setup.h"
-
-/* Setting TZPC[TrustZone Protection Controller] */
-void tzpc_init(void)
-{
-	struct exynos_tzpc *tzpc;
-	unsigned int addr;
-
-	for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
-		tzpc = (struct exynos_tzpc *)addr;
-
-		if (addr == TZPC0_BASE)
-			writel(R0SIZE, &tzpc->r0size);
-
-		writel(DECPROTXSET, &tzpc->decprot0set);
-		writel(DECPROTXSET, &tzpc->decprot1set);
-
-		if (addr != TZPC9_BASE) {
-			writel(DECPROTXSET, &tzpc->decprot2set);
-			writel(DECPROTXSET, &tzpc->decprot3set);
-		}
-	}
-}
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index c03dcf7..8ac05aa 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -87,8 +87,6 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	EXYNOS_DEVICE_SETTINGS
 
-#define TZPC_BASE_OFFSET		0x10000
-
 /* SD/MMC configuration */
 #define CONFIG_GENERIC_MMC
 #define CONFIG_MMC
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 2/3] exynos: update tzpc_init to make it common for exynos4 and exynos5
  2013-03-15  6:23 [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos Inderpal Singh
@ 2013-03-15  6:23 ` Inderpal Singh
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 3/3] exynos: Update origen and smdkv310 to use common tzpc_init Inderpal Singh
  2013-03-27  8:46 ` [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
  3 siblings, 0 replies; 8+ messages in thread
From: Inderpal Singh @ 2013-03-15  6:23 UTC (permalink / raw)
  To: u-boot

This requires that cpu_is_exynos4/5 should be made available before tzpc_init.
Hence this patch also makes necessary changes to have cpu_info in spl and
invokes arch_cpu_init before tzpc_init in low_level_init.S for smdk5250.

Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
Acked-by: Chander Kashyap <chander.kashyap@linaro.org>
---
 arch/arm/cpu/armv7/exynos/tzpc_init.c  |   15 ++++++++++++---
 arch/arm/cpu/armv7/s5p-common/Makefile |    2 ++
 board/samsung/smdk5250/lowlevel_init.S |    2 ++
 spl/Makefile                           |    4 ++++
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/tzpc_init.c b/arch/arm/cpu/armv7/exynos/tzpc_init.c
index 81adb4b..5204fb1 100644
--- a/arch/arm/cpu/armv7/exynos/tzpc_init.c
+++ b/arch/arm/cpu/armv7/exynos/tzpc_init.c
@@ -22,6 +22,7 @@
  * MA 02111-1307 USA
  */
 
+#include <common.h>
 #include <asm/arch/tzpc.h>
 #include <asm/io.h>
 
@@ -29,12 +30,20 @@
 void tzpc_init(void)
 {
 	struct exynos_tzpc *tzpc;
-	unsigned int addr;
+	unsigned int addr, start = 0, end = 0;
 
-	for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
+	if (cpu_is_exynos5()) {
+		start = TZPC0_BASE;
+		end = TZPC9_BASE;
+	} else if (cpu_is_exynos4()) {
+		start = TZPC1_BASE;
+		end = TZPC6_BASE;
+	}
+
+	for (addr = start; addr <= end; addr += TZPC_BASE_OFFSET) {
 		tzpc = (struct exynos_tzpc *)addr;
 
-		if (addr == TZPC0_BASE)
+		if (addr == start)
 			writel(R0SIZE, &tzpc->r0size);
 
 		writel(DECPROTXSET, &tzpc->decprot0set);
diff --git a/arch/arm/cpu/armv7/s5p-common/Makefile b/arch/arm/cpu/armv7/s5p-common/Makefile
index 1705399..0c38bd0 100644
--- a/arch/arm/cpu/armv7/s5p-common/Makefile
+++ b/arch/arm/cpu/armv7/s5p-common/Makefile
@@ -26,9 +26,11 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libs5p-common.o
 
 COBJS-y		+= cpu_info.o
+ifndef CONFIG_SPL_BUILD
 COBJS-y		+= timer.o
 COBJS-y		+= sromc.o
 COBJS-$(CONFIG_PWM)	+= pwm.o
+endif
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS-y) $(SOBJS))
diff --git a/board/samsung/smdk5250/lowlevel_init.S b/board/samsung/smdk5250/lowlevel_init.S
index bc6cb6f..edc565e 100644
--- a/board/samsung/smdk5250/lowlevel_init.S
+++ b/board/samsung/smdk5250/lowlevel_init.S
@@ -75,12 +75,14 @@ lowlevel_init:
 	bl	mem_ctrl_init
 
 1:
+	bl	arch_cpu_init
 	bl	tzpc_init
 	ldmia	r13!, {ip,pc}
 
 wakeup_reset:
 	bl	system_clock_init
 	bl	mem_ctrl_init
+	bl	arch_cpu_init
 	bl	tzpc_init
 
 exit_wakeup:
diff --git a/spl/Makefile b/spl/Makefile
index 101d478..8d33210 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -92,6 +92,10 @@ LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
 LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
 endif
 
+ifeq ($(SOC),exynos)
+LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
+endif
+
 # Add GCC lib
 ifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
 PLATFORM_LIBGCC = $(SPLTREE)/arch/$(ARCH)/lib/libgcc.o
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 3/3] exynos: Update origen and smdkv310 to use common tzpc_init
  2013-03-15  6:23 [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos Inderpal Singh
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 2/3] exynos: update tzpc_init to make it common for exynos4 and exynos5 Inderpal Singh
@ 2013-03-15  6:23 ` Inderpal Singh
  2013-03-27  8:46 ` [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
  3 siblings, 0 replies; 8+ messages in thread
From: Inderpal Singh @ 2013-03-15  6:23 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
Acked-by: Chander Kashyap <chander.kashyap@linaro.org>
---
 board/samsung/origen/lowlevel_init.S   |   44 ++---------------------
 board/samsung/origen/origen_setup.h    |   25 -------------
 board/samsung/smdkv310/lowlevel_init.S |   60 ++------------------------------
 include/configs/origen.h               |    2 ++
 include/configs/smdkv310.h             |    2 ++
 5 files changed, 8 insertions(+), 125 deletions(-)

diff --git a/board/samsung/origen/lowlevel_init.S b/board/samsung/origen/lowlevel_init.S
index 9daa0da..be9d418 100644
--- a/board/samsung/origen/lowlevel_init.S
+++ b/board/samsung/origen/lowlevel_init.S
@@ -87,12 +87,14 @@ lowlevel_init:
 1:
 	/* for UART */
 	bl uart_asm_init
+	bl arch_cpu_init
 	bl tzpc_init
 	pop	{pc}
 
 wakeup_reset:
 	bl system_clock_init
 	bl mem_ctrl_asm_init
+	bl arch_cpu_init
 	bl tzpc_init
 
 exit_wakeup:
@@ -353,45 +355,3 @@ uart_asm_init:
 	nop
 	nop
 
-/* Setting TZPC[TrustZone Protection Controller] */
-tzpc_init:
-	ldr	r0, =TZPC0_BASE
-	mov	r1, #R0SIZE
-	str	r1, [r0]
-	mov	r1, #DECPROTXSET
-	str	r1, [r0, #TZPC_DECPROT0SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT1SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT2SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
-	ldr	r0, =TZPC1_BASE
-	str	r1, [r0, #TZPC_DECPROT0SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT1SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT2SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
-	ldr	r0, =TZPC2_BASE
-	str	r1, [r0, #TZPC_DECPROT0SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT1SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT2SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
-	ldr	r0, =TZPC3_BASE
-	str	r1, [r0, #TZPC_DECPROT0SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT1SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT2SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
-	ldr	r0, =TZPC4_BASE
-	str	r1, [r0, #TZPC_DECPROT0SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT1SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT2SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
-	ldr	r0, =TZPC5_BASE
-	str	r1, [r0, #TZPC_DECPROT0SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT1SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT2SET_OFFSET]
-	str	r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
-	mov	pc, lr
diff --git a/board/samsung/origen/origen_setup.h b/board/samsung/origen/origen_setup.h
index 930b948..926a4cc 100644
--- a/board/samsung/origen/origen_setup.h
+++ b/board/samsung/origen/origen_setup.h
@@ -121,19 +121,6 @@
 #define UBRDIV_OFFSET		0x28
 #define UFRACVAL_OFFSET		0x2C
 
-/* TZPC : Register Offsets */
-#define TZPC0_BASE		0x10110000
-#define TZPC1_BASE		0x10120000
-#define TZPC2_BASE		0x10130000
-#define TZPC3_BASE		0x10140000
-#define TZPC4_BASE		0x10150000
-#define TZPC5_BASE		0x10160000
-
-#define TZPC_DECPROT0SET_OFFSET	0x804
-#define TZPC_DECPROT1SET_OFFSET	0x810
-#define TZPC_DECPROT2SET_OFFSET	0x81C
-#define TZPC_DECPROT3SET_OFFSET	0x828
-
 /* CLK_SRC_CPU */
 #define MUX_HPM_SEL_MOUTAPLL		0x0
 #define MUX_HPM_SEL_SCLKMPLL		0x1
@@ -617,16 +604,4 @@
  * UBRFRACVAL = ((((800MHz*10/(115200*16) -10))%10)*16/10)
  */
 #define UFRACVAL_VAL		0x4
-
-/*
- * TZPC Register Value :
- * R0SIZE: 0x0 : Size of secured ram
- */
-#define R0SIZE			0x0
-
-/*
- * TZPC Decode Protection Register Value :
- * DECPROTXSET: 0xFF : Set Decode region to non-secure
- */
-#define DECPROTXSET		0xFF
 #endif
diff --git a/board/samsung/smdkv310/lowlevel_init.S b/board/samsung/smdkv310/lowlevel_init.S
index 7a1ea98..31e0e2e 100644
--- a/board/samsung/smdkv310/lowlevel_init.S
+++ b/board/samsung/smdkv310/lowlevel_init.S
@@ -85,12 +85,14 @@ lowlevel_init:
 1:
 	/* for UART */
 	bl uart_asm_init
+	bl arch_cpu_init
 	bl tzpc_init
 	pop	{pc}
 
 wakeup_reset:
 	bl system_clock_init
 	bl mem_ctrl_asm_init
+	bl arch_cpu_init
 	bl tzpc_init
 
 exit_wakeup:
@@ -410,61 +412,3 @@ uart_asm_init:
 	nop
 	nop
 	nop
-
-/* Setting TZPC[TrustZone Protection Controller] */
-tzpc_init:
-	ldr	r0, =0x10110000
-	mov	r1, #0x0
-	str	r1, [r0]
-	mov	r1, #0xff
-	str	r1, [r0, #0x0804]
-	str	r1, [r0, #0x0810]
-	str	r1, [r0, #0x081C]
-	str	r1, [r0, #0x0828]
-
-	ldr	r0, =0x10120000
-	mov	r1, #0x0
-	str	r1, [r0]
-	mov	r1, #0xff
-	str	r1, [r0, #0x0804]
-	str	r1, [r0, #0x0810]
-	str	r1, [r0, #0x081C]
-	str	r1, [r0, #0x0828]
-
-	ldr	r0, =0x10130000
-	mov	r1, #0x0
-	str	r1, [r0]
-	mov	r1, #0xff
-	str	r1, [r0, #0x0804]
-	str	r1, [r0, #0x0810]
-	str	r1, [r0, #0x081C]
-	str	r1, [r0, #0x0828]
-
-	ldr	r0, =0x10140000
-	mov	r1, #0x0
-	str	r1, [r0]
-	mov	r1, #0xff
-	str	r1, [r0, #0x0804]
-	str	r1, [r0, #0x0810]
-	str	r1, [r0, #0x081C]
-	str	r1, [r0, #0x0828]
-
-	ldr	r0, =0x10150000
-	mov	r1, #0x0
-	str	r1, [r0]
-	mov	r1, #0xff
-	str	r1, [r0, #0x0804]
-	str	r1, [r0, #0x0810]
-	str	r1, [r0, #0x081C]
-	str	r1, [r0, #0x0828]
-
-	ldr	r0, =0x10160000
-	mov	r1, #0x0
-	str	r1, [r0]
-	mov	r1, #0xff
-	str	r1, [r0, #0x0804]
-	str	r1, [r0, #0x0810]
-	str	r1, [r0, #0x081C]
-	str	r1, [r0, #0x0828]
-
-	mov	pc, lr
diff --git a/include/configs/origen.h b/include/configs/origen.h
index ff2b24d..e179911 100644
--- a/include/configs/origen.h
+++ b/include/configs/origen.h
@@ -96,6 +96,8 @@
 #define CONFIG_SPL
 #define COPY_BL2_FNPTR_ADDR	0x02020030
 
+#define CONFIG_SPL_TEXT_BASE	0x02021410
+
 #define CONFIG_BOOTCOMMAND	"fatload mmc 0 40007000 uImage; bootm 40007000"
 
 /* Miscellaneous configurable options */
diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h
index b796b46..5e43066 100644
--- a/include/configs/smdkv310.h
+++ b/include/configs/smdkv310.h
@@ -95,6 +95,8 @@
 #define CONFIG_SPL
 #define COPY_BL2_FNPTR_ADDR	0x00002488
 
+#define CONFIG_SPL_TEXT_BASE	0x02021410
+
 #define CONFIG_BOOTCOMMAND	"fatload mmc 0 40007000 uImage; bootm 40007000"
 
 /* Miscellaneous configurable options */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5
  2013-03-15  6:23 [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
                   ` (2 preceding siblings ...)
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 3/3] exynos: Update origen and smdkv310 to use common tzpc_init Inderpal Singh
@ 2013-03-27  8:46 ` Inderpal Singh
  2013-03-27 10:22   ` Minkyu Kang
  3 siblings, 1 reply; 8+ messages in thread
From: Inderpal Singh @ 2013-03-27  8:46 UTC (permalink / raw)
  To: u-boot

Dear Minkyu,

Let me know your view about this patchset.

With Regards,
Inder

On 15 March 2013 11:53, Inderpal Singh <inderpal.singh@linaro.org> wrote:
> The first patch moves the tzpc_init file from smdk5250 to armv7/exynos.
> The second makes tzpc_init common for exynos4 and exynos5. And the third
> makes necessary changes to exynos4 based origen and smdkv310 boards.
>
> The patchset has been tested on exynos4 based origen and exynos5 based
> Arndale board.
>
> Changes in v2:
>         - removed uninitialised warning for start and end variables
>         - corrected the SPL_TEXT_BASE for origen and smdkv310
>         - Added Chander's Acked-by
>
> Inderpal Singh (3):
>   exynos: move tzpc_init to armv7/exynos
>   exynos: update tzpc_init to make it common for exynos4 and exynos5
>   exynos: Update origen and smdkv310 to use common tzpc_init
>
>  arch/arm/cpu/armv7/exynos/Makefile      |    2 +-
>  arch/arm/cpu/armv7/exynos/tzpc_init.c   |   57 +++++++++++++++++++++++++++++
>  arch/arm/cpu/armv7/s5p-common/Makefile  |    2 ++
>  arch/arm/include/asm/arch-exynos/tzpc.h |   28 +++++++++++++++
>  board/samsung/origen/lowlevel_init.S    |   44 ++---------------------
>  board/samsung/origen/origen_setup.h     |   25 -------------
>  board/samsung/smdk5250/Makefile         |    1 -
>  board/samsung/smdk5250/lowlevel_init.S  |    2 ++
>  board/samsung/smdk5250/setup.h          |   25 -------------
>  board/samsung/smdk5250/tzpc_init.c      |   48 -------------------------
>  board/samsung/smdkv310/lowlevel_init.S  |   60 ++-----------------------------
>  include/configs/exynos5250-dt.h         |    2 --
>  include/configs/origen.h                |    2 ++
>  include/configs/smdkv310.h              |    2 ++
>  spl/Makefile                            |    4 +++
>  15 files changed, 102 insertions(+), 202 deletions(-)
>  create mode 100644 arch/arm/cpu/armv7/exynos/tzpc_init.c
>  delete mode 100644 board/samsung/smdk5250/tzpc_init.c
>
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5
  2013-03-27  8:46 ` [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
@ 2013-03-27 10:22   ` Minkyu Kang
  0 siblings, 0 replies; 8+ messages in thread
From: Minkyu Kang @ 2013-03-27 10:22 UTC (permalink / raw)
  To: u-boot

On 27/03/13 17:46, Inderpal Singh wrote:
> Dear Minkyu,
> 
> Let me know your view about this patchset.
> 
> With Regards,
> Inder
> 
> On 15 March 2013 11:53, Inderpal Singh <inderpal.singh@linaro.org> wrote:
>> The first patch moves the tzpc_init file from smdk5250 to armv7/exynos.
>> The second makes tzpc_init common for exynos4 and exynos5. And the third
>> makes necessary changes to exynos4 based origen and smdkv310 boards.
>>
>> The patchset has been tested on exynos4 based origen and exynos5 based
>> Arndale board.
>>
>> Changes in v2:
>>         - removed uninitialised warning for start and end variables
>>         - corrected the SPL_TEXT_BASE for origen and smdkv310
>>         - Added Chander's Acked-by
>>
>> Inderpal Singh (3):
>>   exynos: move tzpc_init to armv7/exynos
>>   exynos: update tzpc_init to make it common for exynos4 and exynos5
>>   exynos: Update origen and smdkv310 to use common tzpc_init
>>
>>  arch/arm/cpu/armv7/exynos/Makefile      |    2 +-
>>  arch/arm/cpu/armv7/exynos/tzpc_init.c   |   57 +++++++++++++++++++++++++++++
>>  arch/arm/cpu/armv7/s5p-common/Makefile  |    2 ++
>>  arch/arm/include/asm/arch-exynos/tzpc.h |   28 +++++++++++++++
>>  board/samsung/origen/lowlevel_init.S    |   44 ++---------------------
>>  board/samsung/origen/origen_setup.h     |   25 -------------
>>  board/samsung/smdk5250/Makefile         |    1 -
>>  board/samsung/smdk5250/lowlevel_init.S  |    2 ++
>>  board/samsung/smdk5250/setup.h          |   25 -------------
>>  board/samsung/smdk5250/tzpc_init.c      |   48 -------------------------
>>  board/samsung/smdkv310/lowlevel_init.S  |   60 ++-----------------------------
>>  include/configs/exynos5250-dt.h         |    2 --
>>  include/configs/origen.h                |    2 ++
>>  include/configs/smdkv310.h              |    2 ++
>>  spl/Makefile                            |    4 +++
>>  15 files changed, 102 insertions(+), 202 deletions(-)
>>  create mode 100644 arch/arm/cpu/armv7/exynos/tzpc_init.c
>>  delete mode 100644 board/samsung/smdk5250/tzpc_init.c
>>
>> --
>> 1.7.9.5
>>
> 

listed in my queue.

Thanks,
Minkyu Kang.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos
  2013-03-15  6:23 ` [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos Inderpal Singh
@ 2013-03-29  2:57   ` Minkyu Kang
  2013-04-05  9:07     ` Inderpal Singh
  0 siblings, 1 reply; 8+ messages in thread
From: Minkyu Kang @ 2013-03-29  2:57 UTC (permalink / raw)
  To: u-boot

Dear Inderpal Singh,

On 15/03/13 15:23, Inderpal Singh wrote:
> 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>
> ---
>  arch/arm/cpu/armv7/exynos/Makefile      |    2 +-
>  arch/arm/cpu/armv7/exynos/tzpc_init.c   |   48 +++++++++++++++++++++++++++++++
>  arch/arm/include/asm/arch-exynos/tzpc.h |   28 ++++++++++++++++++
>  board/samsung/smdk5250/Makefile         |    1 -
>  board/samsung/smdk5250/setup.h          |   25 ----------------
>  board/samsung/smdk5250/tzpc_init.c      |   48 -------------------------------
>  include/configs/exynos5250-dt.h         |    2 --
>  7 files changed, 77 insertions(+), 77 deletions(-)
>  create mode 100644 arch/arm/cpu/armv7/exynos/tzpc_init.c
>  delete mode 100644 board/samsung/smdk5250/tzpc_init.c
> 
> diff --git a/arch/arm/cpu/armv7/exynos/Makefile b/arch/arm/cpu/armv7/exynos/Makefile
> index 9119961..b9cf921 100644
> --- a/arch/arm/cpu/armv7/exynos/Makefile
> +++ b/arch/arm/cpu/armv7/exynos/Makefile
> @@ -22,7 +22,7 @@ include $(TOPDIR)/config.mk
>  
>  LIB	= $(obj)lib$(SOC).o
>  
> -COBJS	+= clock.o power.o soc.o system.o pinmux.o
> +COBJS	+= clock.o power.o soc.o system.o pinmux.o tzpc_init.o

patch looks good.
but, do we need to build tzpc always?
and please rename tzpc_init.c to just tzpc.c.

>  
>  SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
>  OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
> diff --git a/arch/arm/cpu/armv7/exynos/tzpc_init.c b/arch/arm/cpu/armv7/exynos/tzpc_init.c
> new file mode 100644
> index 0000000..81adb4b
> --- /dev/null
> +++ b/arch/arm/cpu/armv7/exynos/tzpc_init.c
> @@ -0,0 +1,48 @@
> +/*
> + * Lowlevel setup for SMDK5250 board based on S5PC520
> + *
> + * Copyright (C) 2012 Samsung Electronics
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <asm/arch/tzpc.h>
> +#include <asm/io.h>
> +
> +/* Setting TZPC[TrustZone Protection Controller] */
> +void tzpc_init(void)
> +{
> +	struct exynos_tzpc *tzpc;
> +	unsigned int addr;
> +
> +	for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
> +		tzpc = (struct exynos_tzpc *)addr;
> +
> +		if (addr == TZPC0_BASE)
> +			writel(R0SIZE, &tzpc->r0size);
> +
> +		writel(DECPROTXSET, &tzpc->decprot0set);
> +		writel(DECPROTXSET, &tzpc->decprot1set);
> +
> +		if (addr != TZPC9_BASE) {
> +			writel(DECPROTXSET, &tzpc->decprot2set);
> +			writel(DECPROTXSET, &tzpc->decprot3set);
> +		}
> +	}
> +}
> diff --git a/arch/arm/include/asm/arch-exynos/tzpc.h b/arch/arm/include/asm/arch-exynos/tzpc.h
> index c5eb4b1..050ad70 100644
> --- a/arch/arm/include/asm/arch-exynos/tzpc.h
> +++ b/arch/arm/include/asm/arch-exynos/tzpc.h
> @@ -47,6 +47,34 @@ struct exynos_tzpc {
>  	unsigned int pcellid2;
>  	unsigned int pcellid3;
>  };
> +
> +/* TZPC : Register Offsets */
> +#define TZPC0_BASE		0x10100000
> +#define TZPC1_BASE		0x10110000
> +#define TZPC2_BASE		0x10120000
> +#define TZPC3_BASE		0x10130000
> +#define TZPC4_BASE		0x10140000
> +#define TZPC5_BASE		0x10150000
> +#define TZPC6_BASE		0x10160000
> +#define TZPC7_BASE		0x10170000
> +#define TZPC8_BASE		0x10180000
> +#define TZPC9_BASE		0x10190000

we did not need these defines.
please use samsung_get_base_tzpc().

> +
> +#define TZPC_BASE_OFFSET		0x10000
> +
> +/*
> + * TZPC Register Value :
> + * R0SIZE: 0x0 : Size of secured ram
> + */
> +#define R0SIZE			0x0
> +
> +/*
> + * TZPC Decode Protection Register Value :
> + * DECPROTXSET: 0xFF : Set Decode region to non-secure
> + */
> +#define DECPROTXSET		0xFF
> +void tzpc_init(void);
> +
>  #endif
>  
>  #endif
> diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
> index ecca9f3..f2c32ee 100644
> --- a/board/samsung/smdk5250/Makefile
> +++ b/board/samsung/smdk5250/Makefile
> @@ -28,7 +28,6 @@ SOBJS	:= lowlevel_init.o
>  
>  COBJS	:= clock_init.o
>  COBJS	+= dmc_common.o dmc_init_ddr3.o
> -COBJS	+= tzpc_init.o
>  COBJS	+= smdk5250_spl.o
>  
>  ifndef CONFIG_SPL_BUILD
> diff --git a/board/samsung/smdk5250/setup.h b/board/samsung/smdk5250/setup.h
> index a159601..8c1a3f4 100644
> --- a/board/samsung/smdk5250/setup.h
> +++ b/board/samsung/smdk5250/setup.h
> @@ -28,18 +28,6 @@
>  #include <config.h>
>  #include <asm/arch/dmc.h>
>  
> -/* TZPC : Register Offsets */
> -#define TZPC0_BASE		0x10100000
> -#define TZPC1_BASE		0x10110000
> -#define TZPC2_BASE		0x10120000
> -#define TZPC3_BASE		0x10130000
> -#define TZPC4_BASE		0x10140000
> -#define TZPC5_BASE		0x10150000
> -#define TZPC6_BASE		0x10160000
> -#define TZPC7_BASE		0x10170000
> -#define TZPC8_BASE		0x10180000
> -#define TZPC9_BASE		0x10190000
> -
>  /* APLL_CON1	*/
>  #define APLL_CON1_VAL	(0x00203800)
>  
> @@ -458,18 +446,6 @@
>  /* CLK_GATE_IP_DISP1 */
>  #define CLK_GATE_DP1_ALLOW	(1 << 4)
>  
> -/*
> - * TZPC Register Value :
> - * R0SIZE: 0x0 : Size of secured ram
> - */
> -#define R0SIZE			0x0
> -
> -/*
> - * TZPC Decode Protection Register Value :
> - * DECPROTXSET: 0xFF : Set Decode region to non-secure
> - */
> -#define DECPROTXSET		0xFF
> -
>  #define DDR3PHY_CTRL_PHY_RESET	(1 << 0)
>  #define DDR3PHY_CTRL_PHY_RESET_OFF	(0 << 0)
>  
> @@ -590,5 +566,4 @@ void update_reset_dll(struct exynos5_dmc *, enum ddr_mode);
>  void sdelay(unsigned long);
>  void mem_ctrl_init(void);
>  void system_clock_init(void);
> -void tzpc_init(void);
>  #endif
> diff --git a/board/samsung/smdk5250/tzpc_init.c b/board/samsung/smdk5250/tzpc_init.c
> deleted file mode 100644
> index c833541..0000000
> --- a/board/samsung/smdk5250/tzpc_init.c
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -/*
> - * Lowlevel setup for SMDK5250 board based on S5PC520
> - *
> - * Copyright (C) 2012 Samsung Electronics
> - *
> - * See file CREDITS for list of people who contributed to this
> - * project.
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License as
> - * published by the Free Software Foundation; either version 2 of
> - * the License, or (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> - * MA 02111-1307 USA
> - */
> -
> -#include <asm/arch/tzpc.h>
> -#include"setup.h"
> -
> -/* Setting TZPC[TrustZone Protection Controller] */
> -void tzpc_init(void)
> -{
> -	struct exynos_tzpc *tzpc;
> -	unsigned int addr;
> -
> -	for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) {
> -		tzpc = (struct exynos_tzpc *)addr;
> -
> -		if (addr == TZPC0_BASE)
> -			writel(R0SIZE, &tzpc->r0size);
> -
> -		writel(DECPROTXSET, &tzpc->decprot0set);
> -		writel(DECPROTXSET, &tzpc->decprot1set);
> -
> -		if (addr != TZPC9_BASE) {
> -			writel(DECPROTXSET, &tzpc->decprot2set);
> -			writel(DECPROTXSET, &tzpc->decprot3set);
> -		}
> -	}
> -}
> diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
> index c03dcf7..8ac05aa 100644
> --- a/include/configs/exynos5250-dt.h
> +++ b/include/configs/exynos5250-dt.h
> @@ -87,8 +87,6 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	EXYNOS_DEVICE_SETTINGS
>  
> -#define TZPC_BASE_OFFSET		0x10000
> -
>  /* SD/MMC configuration */
>  #define CONFIG_GENERIC_MMC
>  #define CONFIG_MMC
> 

Thanks,
Minkyu Kang.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos
  2013-03-29  2:57   ` Minkyu Kang
@ 2013-04-05  9:07     ` Inderpal Singh
  0 siblings, 0 replies; 8+ messages in thread
From: Inderpal Singh @ 2013-04-05  9:07 UTC (permalink / raw)
  To: u-boot

Dear Minkyu,

Thanks for the review.


On 29 March 2013 08:27, Minkyu Kang <mk7.kang@samsung.com> wrote:

> Dear Inderpal Singh,
>
> On 15/03/13 15:23, Inderpal Singh wrote:
> > 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>
> > ---
> >  arch/arm/cpu/armv7/exynos/Makefile      |    2 +-
> >  arch/arm/cpu/armv7/exynos/tzpc_init.c   |   48
> +++++++++++++++++++++++++++++++
> >  arch/arm/include/asm/arch-exynos/tzpc.h |   28 ++++++++++++++++++
> >  board/samsung/smdk5250/Makefile         |    1 -
> >  board/samsung/smdk5250/setup.h          |   25 ----------------
> >  board/samsung/smdk5250/tzpc_init.c      |   48
> -------------------------------
> >  include/configs/exynos5250-dt.h         |    2 --
> >  7 files changed, 77 insertions(+), 77 deletions(-)
> >  create mode 100644 arch/arm/cpu/armv7/exynos/tzpc_init.c
> >  delete mode 100644 board/samsung/smdk5250/tzpc_init.c
> >
> > diff --git a/arch/arm/cpu/armv7/exynos/Makefile
> b/arch/arm/cpu/armv7/exynos/Makefile
> > index 9119961..b9cf921 100644
> > --- a/arch/arm/cpu/armv7/exynos/Makefile
> > +++ b/arch/arm/cpu/armv7/exynos/Makefile
> > @@ -22,7 +22,7 @@ include $(TOPDIR)/config.mk
> >
> >  LIB  = $(obj)lib$(SOC).o
> >
> > -COBJS        += clock.o power.o soc.o system.o pinmux.o
> > +COBJS        += clock.o power.o soc.o system.o pinmux.o tzpc_init.o
>
> patch looks good.
> but, do we need to build tzpc always?
> and please rename tzpc_init.c to just tzpc.c.
>

Yes, we need it always.
I have renamed the file to tzpc.c in the v3 version.


>
> >
> >  SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> >  OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS))
> > diff --git a/arch/arm/cpu/armv7/exynos/tzpc_init.c
> b/arch/arm/cpu/armv7/exynos/tzpc_init.c
> > new file mode 100644
> > index 0000000..81adb4b
> > --- /dev/null
> > +++ b/arch/arm/cpu/armv7/exynos/tzpc_init.c
> > @@ -0,0 +1,48 @@
> > +/*
> > + * Lowlevel setup for SMDK5250 board based on S5PC520
> > + *
> > + * Copyright (C) 2012 Samsung Electronics
> > + *
> > + * See file CREDITS for list of people who contributed to this
> > + * project.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> > + * MA 02111-1307 USA
> > + */
> > +
> > +#include <asm/arch/tzpc.h>
> > +#include <asm/io.h>
> > +
> > +/* Setting TZPC[TrustZone Protection Controller] */
> > +void tzpc_init(void)
> > +{
> > +     struct exynos_tzpc *tzpc;
> > +     unsigned int addr;
> > +
> > +     for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr +=
> TZPC_BASE_OFFSET) {
> > +             tzpc = (struct exynos_tzpc *)addr;
> > +
> > +             if (addr == TZPC0_BASE)
> > +                     writel(R0SIZE, &tzpc->r0size);
> > +
> > +             writel(DECPROTXSET, &tzpc->decprot0set);
> > +             writel(DECPROTXSET, &tzpc->decprot1set);
> > +
> > +             if (addr != TZPC9_BASE) {
> > +                     writel(DECPROTXSET, &tzpc->decprot2set);
> > +                     writel(DECPROTXSET, &tzpc->decprot3set);
> > +             }
> > +     }
> > +}
> > diff --git a/arch/arm/include/asm/arch-exynos/tzpc.h
> b/arch/arm/include/asm/arch-exynos/tzpc.h
> > index c5eb4b1..050ad70 100644
> > --- a/arch/arm/include/asm/arch-exynos/tzpc.h
> > +++ b/arch/arm/include/asm/arch-exynos/tzpc.h
> > @@ -47,6 +47,34 @@ struct exynos_tzpc {
> >       unsigned int pcellid2;
> >       unsigned int pcellid3;
> >  };
> > +
> > +/* TZPC : Register Offsets */
> > +#define TZPC0_BASE           0x10100000
> > +#define TZPC1_BASE           0x10110000
> > +#define TZPC2_BASE           0x10120000
> > +#define TZPC3_BASE           0x10130000
> > +#define TZPC4_BASE           0x10140000
> > +#define TZPC5_BASE           0x10150000
> > +#define TZPC6_BASE           0x10160000
> > +#define TZPC7_BASE           0x10170000
> > +#define TZPC8_BASE           0x10180000
> > +#define TZPC9_BASE           0x10190000
>
> we did not need these defines.
> please use samsung_get_base_tzpc().
>

Yes, good point.
Have removed these macros and used samsung_get_base tzpc in v3.

With Regards,
Inder


>
> > +
> > +#define TZPC_BASE_OFFSET             0x10000
> > +
> > +/*
> > + * TZPC Register Value :
> > + * R0SIZE: 0x0 : Size of secured ram
> > + */
> > +#define R0SIZE                       0x0
> > +
> > +/*
> > + * TZPC Decode Protection Register Value :
> > + * DECPROTXSET: 0xFF : Set Decode region to non-secure
> > + */
> > +#define DECPROTXSET          0xFF
> > +void tzpc_init(void);
> > +
> >  #endif
> >
> >  #endif
> > diff --git a/board/samsung/smdk5250/Makefile
> b/board/samsung/smdk5250/Makefile
> > index ecca9f3..f2c32ee 100644
> > --- a/board/samsung/smdk5250/Makefile
> > +++ b/board/samsung/smdk5250/Makefile
> > @@ -28,7 +28,6 @@ SOBJS       := lowlevel_init.o
> >
> >  COBJS        := clock_init.o
> >  COBJS        += dmc_common.o dmc_init_ddr3.o
> > -COBJS        += tzpc_init.o
> >  COBJS        += smdk5250_spl.o
> >
> >  ifndef CONFIG_SPL_BUILD
> > diff --git a/board/samsung/smdk5250/setup.h
> b/board/samsung/smdk5250/setup.h
> > index a159601..8c1a3f4 100644
> > --- a/board/samsung/smdk5250/setup.h
> > +++ b/board/samsung/smdk5250/setup.h
> > @@ -28,18 +28,6 @@
> >  #include <config.h>
> >  #include <asm/arch/dmc.h>
> >
> > -/* TZPC : Register Offsets */
> > -#define TZPC0_BASE           0x10100000
> > -#define TZPC1_BASE           0x10110000
> > -#define TZPC2_BASE           0x10120000
> > -#define TZPC3_BASE           0x10130000
> > -#define TZPC4_BASE           0x10140000
> > -#define TZPC5_BASE           0x10150000
> > -#define TZPC6_BASE           0x10160000
> > -#define TZPC7_BASE           0x10170000
> > -#define TZPC8_BASE           0x10180000
> > -#define TZPC9_BASE           0x10190000
> > -
> >  /* APLL_CON1 */
> >  #define APLL_CON1_VAL        (0x00203800)
> >
> > @@ -458,18 +446,6 @@
> >  /* CLK_GATE_IP_DISP1 */
> >  #define CLK_GATE_DP1_ALLOW   (1 << 4)
> >
> > -/*
> > - * TZPC Register Value :
> > - * R0SIZE: 0x0 : Size of secured ram
> > - */
> > -#define R0SIZE                       0x0
> > -
> > -/*
> > - * TZPC Decode Protection Register Value :
> > - * DECPROTXSET: 0xFF : Set Decode region to non-secure
> > - */
> > -#define DECPROTXSET          0xFF
> > -
> >  #define DDR3PHY_CTRL_PHY_RESET       (1 << 0)
> >  #define DDR3PHY_CTRL_PHY_RESET_OFF   (0 << 0)
> >
> > @@ -590,5 +566,4 @@ void update_reset_dll(struct exynos5_dmc *, enum
> ddr_mode);
> >  void sdelay(unsigned long);
> >  void mem_ctrl_init(void);
> >  void system_clock_init(void);
> > -void tzpc_init(void);
> >  #endif
> > diff --git a/board/samsung/smdk5250/tzpc_init.c
> b/board/samsung/smdk5250/tzpc_init.c
> > deleted file mode 100644
> > index c833541..0000000
> > --- a/board/samsung/smdk5250/tzpc_init.c
> > +++ /dev/null
> > @@ -1,48 +0,0 @@
> > -/*
> > - * Lowlevel setup for SMDK5250 board based on S5PC520
> > - *
> > - * Copyright (C) 2012 Samsung Electronics
> > - *
> > - * See file CREDITS for list of people who contributed to this
> > - * project.
> > - *
> > - * This program is free software; you can redistribute it and/or
> > - * modify it under the terms of the GNU General Public License as
> > - * published by the Free Software Foundation; either version 2 of
> > - * the License, or (at your option) any later version.
> > - *
> > - * This program is distributed in the hope that it will be useful,
> > - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > - * GNU General Public License for more details.
> > - *
> > - * You should have received a copy of the GNU General Public License
> > - * along with this program; if not, write to the Free Software
> > - * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> > - * MA 02111-1307 USA
> > - */
> > -
> > -#include <asm/arch/tzpc.h>
> > -#include"setup.h"
> > -
> > -/* Setting TZPC[TrustZone Protection Controller] */
> > -void tzpc_init(void)
> > -{
> > -     struct exynos_tzpc *tzpc;
> > -     unsigned int addr;
> > -
> > -     for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr +=
> TZPC_BASE_OFFSET) {
> > -             tzpc = (struct exynos_tzpc *)addr;
> > -
> > -             if (addr == TZPC0_BASE)
> > -                     writel(R0SIZE, &tzpc->r0size);
> > -
> > -             writel(DECPROTXSET, &tzpc->decprot0set);
> > -             writel(DECPROTXSET, &tzpc->decprot1set);
> > -
> > -             if (addr != TZPC9_BASE) {
> > -                     writel(DECPROTXSET, &tzpc->decprot2set);
> > -                     writel(DECPROTXSET, &tzpc->decprot3set);
> > -             }
> > -     }
> > -}
> > diff --git a/include/configs/exynos5250-dt.h
> b/include/configs/exynos5250-dt.h
> > index c03dcf7..8ac05aa 100644
> > --- a/include/configs/exynos5250-dt.h
> > +++ b/include/configs/exynos5250-dt.h
> > @@ -87,8 +87,6 @@
> >  #define CONFIG_EXTRA_ENV_SETTINGS \
> >       EXYNOS_DEVICE_SETTINGS
> >
> > -#define TZPC_BASE_OFFSET             0x10000
> > -
> >  /* SD/MMC configuration */
> >  #define CONFIG_GENERIC_MMC
> >  #define CONFIG_MMC
> >
>
> Thanks,
> Minkyu Kang.
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-05  9:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-15  6:23 [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
2013-03-15  6:23 ` [U-Boot] [PATCH v2 1/3] exynos: move tzpc_init to armv7/exynos Inderpal Singh
2013-03-29  2:57   ` Minkyu Kang
2013-04-05  9:07     ` Inderpal Singh
2013-03-15  6:23 ` [U-Boot] [PATCH v2 2/3] exynos: update tzpc_init to make it common for exynos4 and exynos5 Inderpal Singh
2013-03-15  6:23 ` [U-Boot] [PATCH v2 3/3] exynos: Update origen and smdkv310 to use common tzpc_init Inderpal Singh
2013-03-27  8:46 ` [U-Boot] [PATCH v2 0/3] Make tzpc initialization common for exynos4 and exynos5 Inderpal Singh
2013-03-27 10:22   ` Minkyu Kang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.