All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-09-24 14:28 ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski, t.figa

Some Exynos-based boards are running with secure firmware running in
TrustZone secure world, which changes the way some things have to be
initialized.

This series adds support for specifying firmware operations, implements
some firmware operations for Exynos secure firmware and adds a method of
enabling secure firmware operations on Exynos-based boards through board
file and device tree.

Changes since v1
http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
  - Changed return types of all operations to int
  - Defined all operations to return 0 on success, -ENOSYS when not
    implemented or appropriate error code on error

Tomasz Figa (6):
  ARM: Add interface for registering and calling firmware-specific
    operations
  ARM: EXYNOS: Add support for secure monitor calls
  ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
  ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
  ARM: EXYNOS: Add support for Exynos secure firmware
  ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up

 .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
 arch/arm/common/Makefile                           |  2 +
 arch/arm/common/firmware.c                         | 18 ++++++++
 arch/arm/include/asm/firmware.h                    | 31 +++++++++++++
 arch/arm/mach-exynos/Makefile                      |  6 +++
 arch/arm/mach-exynos/common.c                      | 34 ++++++++++++++
 arch/arm/mach-exynos/common.h                      |  2 +
 arch/arm/mach-exynos/exynos-smc.S                  | 22 +++++++++
 arch/arm/mach-exynos/firmware.c                    | 54 ++++++++++++++++++++++
 arch/arm/mach-exynos/include/mach/map.h            |  3 ++
 arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
 arch/arm/mach-exynos/platsmp.c                     | 36 ++++++++++++---
 arch/arm/mach-exynos/smc.h                         | 31 +++++++++++++
 arch/arm/plat-samsung/include/plat/map-s5p.h       |  1 +
 14 files changed, 243 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/common/firmware.c
 create mode 100644 arch/arm/include/asm/firmware.h
 create mode 100644 arch/arm/mach-exynos/exynos-smc.S
 create mode 100644 arch/arm/mach-exynos/firmware.c
 create mode 100644 arch/arm/mach-exynos/smc.h

-- 
1.7.12

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

* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-09-24 14:28 ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

Some Exynos-based boards are running with secure firmware running in
TrustZone secure world, which changes the way some things have to be
initialized.

This series adds support for specifying firmware operations, implements
some firmware operations for Exynos secure firmware and adds a method of
enabling secure firmware operations on Exynos-based boards through board
file and device tree.

Changes since v1
http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
  - Changed return types of all operations to int
  - Defined all operations to return 0 on success, -ENOSYS when not
    implemented or appropriate error code on error

Tomasz Figa (6):
  ARM: Add interface for registering and calling firmware-specific
    operations
  ARM: EXYNOS: Add support for secure monitor calls
  ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
  ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
  ARM: EXYNOS: Add support for Exynos secure firmware
  ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up

 .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
 arch/arm/common/Makefile                           |  2 +
 arch/arm/common/firmware.c                         | 18 ++++++++
 arch/arm/include/asm/firmware.h                    | 31 +++++++++++++
 arch/arm/mach-exynos/Makefile                      |  6 +++
 arch/arm/mach-exynos/common.c                      | 34 ++++++++++++++
 arch/arm/mach-exynos/common.h                      |  2 +
 arch/arm/mach-exynos/exynos-smc.S                  | 22 +++++++++
 arch/arm/mach-exynos/firmware.c                    | 54 ++++++++++++++++++++++
 arch/arm/mach-exynos/include/mach/map.h            |  3 ++
 arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
 arch/arm/mach-exynos/platsmp.c                     | 36 ++++++++++++---
 arch/arm/mach-exynos/smc.h                         | 31 +++++++++++++
 arch/arm/plat-samsung/include/plat/map-s5p.h       |  1 +
 14 files changed, 243 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/common/firmware.c
 create mode 100644 arch/arm/include/asm/firmware.h
 create mode 100644 arch/arm/mach-exynos/exynos-smc.S
 create mode 100644 arch/arm/mach-exynos/firmware.c
 create mode 100644 arch/arm/mach-exynos/smc.h

-- 
1.7.12

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

* [PATCH 1/6] ARM: Add interface for registering and calling firmware-specific operations
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-09-24 14:28   ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski, t.figa

Some boards are running with secure firmware running in TrustZone secure
world, which changes the way some things have to be initialized.

This patch adds an interface for platforms to specify available firmware
operations and call them.

A wrapper macro, call_firmware_op(), checks if the operation is provided
and calls it if so, otherwise returns -ENOSYS to allow fallback to l

By default no operations are provided.

Example of use:

In code using firmware ops:

	__raw_writel(virt_to_phys(exynos4_secondary_startup),
		CPU1_BOOT_REG);

	/* Call Exynos specific smc call */
	if (call_firmware_op(cpu_boot, cpu) == -ENOSYS)
		cpu_boot_legacy(cpu); /* Try legacy way */

	gic_raise_softirq(cpumask_of(cpu), 1);

In board-/platform-specific code:

	static int platformX_do_idle(void)
	{
		/* tell platformX firmware to enter idle */
	        return 0;
	}

	static int platformX_cpu_boot(int i)
	{
		/* tell platformX firmware to boot CPU i */
		return 0;
	}

	static const struct firmware_ops platformX_firmware_ops = {
		.do_idle	= exynos_do_idle,
		.cpu_boot	= exynos_cpu_boot,
		/* cpu_boot_reg not available on platformX */
	};

	static void __init board_init_early(void)
	{
	        register_firmware_ops(&platformX_firmware_ops);
	}

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/common/Makefile        |  2 ++
 arch/arm/common/firmware.c      | 18 ++++++++++++++++++
 arch/arm/include/asm/firmware.h | 31 +++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 arch/arm/common/firmware.c
 create mode 100644 arch/arm/include/asm/firmware.h

diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index e8a4e58..55d4182 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -2,6 +2,8 @@
 # Makefile for the linux kernel.
 #
 
+obj-y += firmware.o
+
 obj-$(CONFIG_ARM_GIC)		+= gic.o
 obj-$(CONFIG_ARM_VIC)		+= vic.o
 obj-$(CONFIG_ICST)		+= icst.o
diff --git a/arch/arm/common/firmware.c b/arch/arm/common/firmware.c
new file mode 100644
index 0000000..27ddccb
--- /dev/null
+++ b/arch/arm/common/firmware.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ * Tomasz Figa <t.figa@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/suspend.h>
+
+#include <asm/firmware.h>
+
+static const struct firmware_ops default_firmware_ops;
+
+const struct firmware_ops *firmware_ops = &default_firmware_ops;
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
new file mode 100644
index 0000000..5d87d8e
--- /dev/null
+++ b/arch/arm/include/asm/firmware.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ * Tomasz Figa <t.figa@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARM_FIRMWARE_H
+#define __ASM_ARM_FIRMWARE_H
+
+struct firmware_ops {
+	int (*do_idle)(void);
+	int (*cpu_boot)(int cpu);
+	int (*cpu_boot_reg)(int cpu, void __iomem **ptr);
+	int (*l2x0_init)(void);
+};
+
+extern const struct firmware_ops *firmware_ops;
+
+#define call_firmware_op(op, ...)					\
+	((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
+
+static inline void register_firmware_ops(const struct firmware_ops *ops)
+{
+	firmware_ops = ops;
+}
+
+#endif
-- 
1.7.12

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

* [PATCH 1/6] ARM: Add interface for registering and calling firmware-specific operations
@ 2012-09-24 14:28   ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

Some boards are running with secure firmware running in TrustZone secure
world, which changes the way some things have to be initialized.

This patch adds an interface for platforms to specify available firmware
operations and call them.

A wrapper macro, call_firmware_op(), checks if the operation is provided
and calls it if so, otherwise returns -ENOSYS to allow fallback to l

By default no operations are provided.

Example of use:

In code using firmware ops:

	__raw_writel(virt_to_phys(exynos4_secondary_startup),
		CPU1_BOOT_REG);

	/* Call Exynos specific smc call */
	if (call_firmware_op(cpu_boot, cpu) == -ENOSYS)
		cpu_boot_legacy(cpu); /* Try legacy way */

	gic_raise_softirq(cpumask_of(cpu), 1);

In board-/platform-specific code:

	static int platformX_do_idle(void)
	{
		/* tell platformX firmware to enter idle */
	        return 0;
	}

	static int platformX_cpu_boot(int i)
	{
		/* tell platformX firmware to boot CPU i */
		return 0;
	}

	static const struct firmware_ops platformX_firmware_ops = {
		.do_idle	= exynos_do_idle,
		.cpu_boot	= exynos_cpu_boot,
		/* cpu_boot_reg not available on platformX */
	};

	static void __init board_init_early(void)
	{
	????????register_firmware_ops(&platformX_firmware_ops);
	}

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/common/Makefile        |  2 ++
 arch/arm/common/firmware.c      | 18 ++++++++++++++++++
 arch/arm/include/asm/firmware.h | 31 +++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 arch/arm/common/firmware.c
 create mode 100644 arch/arm/include/asm/firmware.h

diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index e8a4e58..55d4182 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -2,6 +2,8 @@
 # Makefile for the linux kernel.
 #
 
+obj-y += firmware.o
+
 obj-$(CONFIG_ARM_GIC)		+= gic.o
 obj-$(CONFIG_ARM_VIC)		+= vic.o
 obj-$(CONFIG_ICST)		+= icst.o
diff --git a/arch/arm/common/firmware.c b/arch/arm/common/firmware.c
new file mode 100644
index 0000000..27ddccb
--- /dev/null
+++ b/arch/arm/common/firmware.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ * Tomasz Figa <t.figa@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/suspend.h>
+
+#include <asm/firmware.h>
+
+static const struct firmware_ops default_firmware_ops;
+
+const struct firmware_ops *firmware_ops = &default_firmware_ops;
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
new file mode 100644
index 0000000..5d87d8e
--- /dev/null
+++ b/arch/arm/include/asm/firmware.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ * Tomasz Figa <t.figa@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARM_FIRMWARE_H
+#define __ASM_ARM_FIRMWARE_H
+
+struct firmware_ops {
+	int (*do_idle)(void);
+	int (*cpu_boot)(int cpu);
+	int (*cpu_boot_reg)(int cpu, void __iomem **ptr);
+	int (*l2x0_init)(void);
+};
+
+extern const struct firmware_ops *firmware_ops;
+
+#define call_firmware_op(op, ...)					\
+	((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
+
+static inline void register_firmware_ops(const struct firmware_ops *ops)
+{
+	firmware_ops = ops;
+}
+
+#endif
-- 
1.7.12

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

* [PATCH 2/6] ARM: EXYNOS: Add support for secure monitor calls
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-09-24 14:28   ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski, t.figa

Some boards use secure monitor calls to communicate with secure
firmware.

This patch adds exynos_smc function which uses smc assembly instruction
to do secure monitor calls.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/Makefile     |  5 +++++
 arch/arm/mach-exynos/exynos-smc.S | 22 ++++++++++++++++++++++
 arch/arm/mach-exynos/smc.h        | 31 +++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 arch/arm/mach-exynos/exynos-smc.S
 create mode 100644 arch/arm/mach-exynos/smc.h

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 9b58024..5c1de47 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -30,6 +30,11 @@ obj-$(CONFIG_EXYNOS4_MCT)	+= mct.o
 
 obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
 
+obj-$(CONFIG_ARCH_EXYNOS)	+= exynos-smc.o
+
+plus_sec := $(call as-instr,.arch_extension sec,+sec)
+AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
+
 # machine support
 
 obj-$(CONFIG_MACH_SMDKC210)		+= mach-smdkv310.o
diff --git a/arch/arm/mach-exynos/exynos-smc.S b/arch/arm/mach-exynos/exynos-smc.S
new file mode 100644
index 0000000..2e27aa3
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos-smc.S
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ *
+ * Copied from omap-smc.S Copyright (C) 2010 Texas Instruments, Inc.
+ *
+ * This program is free software,you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/linkage.h>
+
+/*
+ * Function signature: void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3)
+ */
+
+ENTRY(exynos_smc)
+	stmfd	sp!, {r4-r11, lr}
+	dsb
+	smc	#0
+	ldmfd	sp!, {r4-r11, pc}
+ENDPROC(exynos_smc)
diff --git a/arch/arm/mach-exynos/smc.h b/arch/arm/mach-exynos/smc.h
new file mode 100644
index 0000000..e972390
--- /dev/null
+++ b/arch/arm/mach-exynos/smc.h
@@ -0,0 +1,31 @@
+/*
+ *  Copyright (c) 2012 Samsung Electronics.
+ *
+ * EXYNOS - SMC Call
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_EXYNOS_SMC_H
+#define __ASM_ARCH_EXYNOS_SMC_H
+
+#define SMC_CMD_INIT            (-1)
+#define SMC_CMD_INFO            (-2)
+/* For Power Management */
+#define SMC_CMD_SLEEP           (-3)
+#define SMC_CMD_CPU1BOOT        (-4)
+#define SMC_CMD_CPU0AFTR        (-5)
+/* For CP15 Access */
+#define SMC_CMD_C15RESUME       (-11)
+/* For L2 Cache Access */
+#define SMC_CMD_L2X0CTRL        (-21)
+#define SMC_CMD_L2X0SETUP1      (-22)
+#define SMC_CMD_L2X0SETUP2      (-23)
+#define SMC_CMD_L2X0INVALL      (-24)
+#define SMC_CMD_L2X0DEBUG       (-25)
+
+extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3);
+
+#endif
-- 
1.7.12

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

* [PATCH 2/6] ARM: EXYNOS: Add support for secure monitor calls
@ 2012-09-24 14:28   ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

Some boards use secure monitor calls to communicate with secure
firmware.

This patch adds exynos_smc function which uses smc assembly instruction
to do secure monitor calls.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/Makefile     |  5 +++++
 arch/arm/mach-exynos/exynos-smc.S | 22 ++++++++++++++++++++++
 arch/arm/mach-exynos/smc.h        | 31 +++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 arch/arm/mach-exynos/exynos-smc.S
 create mode 100644 arch/arm/mach-exynos/smc.h

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 9b58024..5c1de47 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -30,6 +30,11 @@ obj-$(CONFIG_EXYNOS4_MCT)	+= mct.o
 
 obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
 
+obj-$(CONFIG_ARCH_EXYNOS)	+= exynos-smc.o
+
+plus_sec := $(call as-instr,.arch_extension sec,+sec)
+AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
+
 # machine support
 
 obj-$(CONFIG_MACH_SMDKC210)		+= mach-smdkv310.o
diff --git a/arch/arm/mach-exynos/exynos-smc.S b/arch/arm/mach-exynos/exynos-smc.S
new file mode 100644
index 0000000..2e27aa3
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos-smc.S
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ *
+ * Copied from omap-smc.S Copyright (C) 2010 Texas Instruments, Inc.
+ *
+ * This program is free software,you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/linkage.h>
+
+/*
+ * Function signature: void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3)
+ */
+
+ENTRY(exynos_smc)
+	stmfd	sp!, {r4-r11, lr}
+	dsb
+	smc	#0
+	ldmfd	sp!, {r4-r11, pc}
+ENDPROC(exynos_smc)
diff --git a/arch/arm/mach-exynos/smc.h b/arch/arm/mach-exynos/smc.h
new file mode 100644
index 0000000..e972390
--- /dev/null
+++ b/arch/arm/mach-exynos/smc.h
@@ -0,0 +1,31 @@
+/*
+ *  Copyright (c) 2012 Samsung Electronics.
+ *
+ * EXYNOS - SMC Call
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_EXYNOS_SMC_H
+#define __ASM_ARCH_EXYNOS_SMC_H
+
+#define SMC_CMD_INIT            (-1)
+#define SMC_CMD_INFO            (-2)
+/* For Power Management */
+#define SMC_CMD_SLEEP           (-3)
+#define SMC_CMD_CPU1BOOT        (-4)
+#define SMC_CMD_CPU0AFTR        (-5)
+/* For CP15 Access */
+#define SMC_CMD_C15RESUME       (-11)
+/* For L2 Cache Access */
+#define SMC_CMD_L2X0CTRL        (-21)
+#define SMC_CMD_L2X0SETUP1      (-22)
+#define SMC_CMD_L2X0SETUP2      (-23)
+#define SMC_CMD_L2X0INVALL      (-24)
+#define SMC_CMD_L2X0DEBUG       (-25)
+
+extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3);
+
+#endif
-- 
1.7.12

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

* [PATCH 3/6] ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-09-24 14:28   ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski, t.figa

Exynos4412 uses different information register for each core. This patch
adjusts the bring-up code to take that into account.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/platsmp.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 36c3984..a7f4031 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -34,8 +34,21 @@
 
 extern void exynos4_secondary_startup(void);
 
-#define CPU1_BOOT_REG		(samsung_rev() == EXYNOS4210_REV_1_1 ? \
-				S5P_INFORM5 : S5P_VA_SYSRAM)
+static inline void __iomem *cpu_boot_reg_base(void)
+{
+	if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
+		return S5P_INFORM5;
+	return S5P_VA_SYSRAM;
+}
+
+static inline void __iomem *cpu_boot_reg(int cpu)
+{
+	void __iomem *boot_reg;
+	boot_reg = cpu_boot_reg_base();
+	if (soc_is_exynos4412())
+		boot_reg += 4*cpu;
+	return boot_reg;
+}
 
 /*
  * control for which core is the next to come out of the secondary
@@ -89,6 +102,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
+	unsigned long phys_cpu = cpu_logical_map(cpu);
 
 	/*
 	 * Set synchronisation state between this boot processor
@@ -104,7 +118,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 	 * Note that "pen_release" is the hardware CPU ID, whereas
 	 * "cpu" is Linux's internal ID.
 	 */
-	write_pen_release(cpu_logical_map(cpu));
+	write_pen_release(phys_cpu);
 
 	if (!(__raw_readl(S5P_ARM_CORE1_STATUS) & S5P_CORE_LOCAL_PWR_EN)) {
 		__raw_writel(S5P_CORE_LOCAL_PWR_EN,
@@ -138,7 +152,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 		smp_rmb();
 
 		__raw_writel(virt_to_phys(exynos4_secondary_startup),
-			CPU1_BOOT_REG);
+							cpu_boot_reg(phys_cpu));
 		gic_raise_softirq(cpumask_of(cpu), 1);
 
 		if (pen_release == -1)
@@ -186,6 +200,8 @@ void __init smp_init_cpus(void)
 
 void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 {
+	int i;
+
 	if (!soc_is_exynos5250())
 		scu_enable(scu_base_addr());
 
@@ -195,6 +211,7 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * until it receives a soft interrupt, and then the
 	 * secondary CPU branches to this address.
 	 */
-	__raw_writel(virt_to_phys(exynos4_secondary_startup),
-			CPU1_BOOT_REG);
+	for (i = 1; i < max_cpus; ++i)
+		__raw_writel(virt_to_phys(exynos4_secondary_startup),
+					cpu_boot_reg(cpu_logical_map(i)));
 }
-- 
1.7.12

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

* [PATCH 3/6] ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
@ 2012-09-24 14:28   ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

Exynos4412 uses different information register for each core. This patch
adjusts the bring-up code to take that into account.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/platsmp.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 36c3984..a7f4031 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -34,8 +34,21 @@
 
 extern void exynos4_secondary_startup(void);
 
-#define CPU1_BOOT_REG		(samsung_rev() == EXYNOS4210_REV_1_1 ? \
-				S5P_INFORM5 : S5P_VA_SYSRAM)
+static inline void __iomem *cpu_boot_reg_base(void)
+{
+	if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
+		return S5P_INFORM5;
+	return S5P_VA_SYSRAM;
+}
+
+static inline void __iomem *cpu_boot_reg(int cpu)
+{
+	void __iomem *boot_reg;
+	boot_reg = cpu_boot_reg_base();
+	if (soc_is_exynos4412())
+		boot_reg += 4*cpu;
+	return boot_reg;
+}
 
 /*
  * control for which core is the next to come out of the secondary
@@ -89,6 +102,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
 int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
+	unsigned long phys_cpu = cpu_logical_map(cpu);
 
 	/*
 	 * Set synchronisation state between this boot processor
@@ -104,7 +118,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 	 * Note that "pen_release" is the hardware CPU ID, whereas
 	 * "cpu" is Linux's internal ID.
 	 */
-	write_pen_release(cpu_logical_map(cpu));
+	write_pen_release(phys_cpu);
 
 	if (!(__raw_readl(S5P_ARM_CORE1_STATUS) & S5P_CORE_LOCAL_PWR_EN)) {
 		__raw_writel(S5P_CORE_LOCAL_PWR_EN,
@@ -138,7 +152,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 		smp_rmb();
 
 		__raw_writel(virt_to_phys(exynos4_secondary_startup),
-			CPU1_BOOT_REG);
+							cpu_boot_reg(phys_cpu));
 		gic_raise_softirq(cpumask_of(cpu), 1);
 
 		if (pen_release == -1)
@@ -186,6 +200,8 @@ void __init smp_init_cpus(void)
 
 void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 {
+	int i;
+
 	if (!soc_is_exynos5250())
 		scu_enable(scu_base_addr());
 
@@ -195,6 +211,7 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 	 * until it receives a soft interrupt, and then the
 	 * secondary CPU branches to this address.
 	 */
-	__raw_writel(virt_to_phys(exynos4_secondary_startup),
-			CPU1_BOOT_REG);
+	for (i = 1; i < max_cpus; ++i)
+		__raw_writel(virt_to_phys(exynos4_secondary_startup),
+					cpu_boot_reg(cpu_logical_map(i)));
 }
-- 
1.7.12

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

* [PATCH 4/6] ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-09-24 14:28   ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski, t.figa

On TrustZone-enabled boards the non-secure SYSRAM is used for secondary
CPU bring-up, so add a mapping for it.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/common.c                | 34 ++++++++++++++++++++++++++++
 arch/arm/mach-exynos/include/mach/map.h      |  3 +++
 arch/arm/plat-samsung/include/plat/map-s5p.h |  1 +
 3 files changed, 38 insertions(+)

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4eb39cd..ddec3d5 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -214,6 +214,33 @@ static struct map_desc exynos4_iodesc1[] __initdata = {
 	},
 };
 
+static struct map_desc exynos4210_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSRAM_NS,
+		.pfn		= __phys_to_pfn(EXYNOS4210_PA_SYSRAM_NS),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	},
+};
+
+static struct map_desc exynos4x12_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSRAM_NS,
+		.pfn		= __phys_to_pfn(EXYNOS4x12_PA_SYSRAM_NS),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	},
+};
+
+static struct map_desc exynos5250_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSRAM_NS,
+		.pfn		= __phys_to_pfn(EXYNOS5250_PA_SYSRAM_NS),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	},
+};
+
 static struct map_desc exynos5_iodesc[] __initdata = {
 	{
 		.virtual	= (unsigned long)S3C_VA_SYS,
@@ -321,6 +348,13 @@ static void __init exynos4_map_io(void)
 	else
 		iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
 
+	if (soc_is_exynos4210())
+		iotable_init(exynos4210_iodesc, ARRAY_SIZE(exynos4210_iodesc));
+	if (soc_is_exynos4212() || soc_is_exynos4412())
+		iotable_init(exynos4x12_iodesc, ARRAY_SIZE(exynos4x12_iodesc));
+	if (soc_is_exynos5250())
+		iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc));
+
 	/* initialize device information early */
 	exynos4_default_sdhci0();
 	exynos4_default_sdhci1();
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index c72b675..f4a8ac3 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -26,6 +26,9 @@
 #define EXYNOS4_PA_SYSRAM0		0x02025000
 #define EXYNOS4_PA_SYSRAM1		0x02020000
 #define EXYNOS5_PA_SYSRAM		0x02020000
+#define EXYNOS4210_PA_SYSRAM_NS		0x0203F000
+#define EXYNOS4x12_PA_SYSRAM_NS		0x0204F000
+#define EXYNOS5250_PA_SYSRAM_NS		0x0204F000
 
 #define EXYNOS4_PA_FIMC0		0x11800000
 #define EXYNOS4_PA_FIMC1		0x11810000
diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h
index c2d7bda..c186786 100644
--- a/arch/arm/plat-samsung/include/plat/map-s5p.h
+++ b/arch/arm/plat-samsung/include/plat/map-s5p.h
@@ -22,6 +22,7 @@
 #define S5P_VA_GPIO3		S3C_ADDR(0x02280000)
 
 #define S5P_VA_SYSRAM		S3C_ADDR(0x02400000)
+#define S5P_VA_SYSRAM_NS	S3C_ADDR(0x02410000)
 #define S5P_VA_DMC0		S3C_ADDR(0x02440000)
 #define S5P_VA_DMC1		S3C_ADDR(0x02480000)
 #define S5P_VA_SROMC		S3C_ADDR(0x024C0000)
-- 
1.7.12

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

* [PATCH 4/6] ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
@ 2012-09-24 14:28   ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

On TrustZone-enabled boards the non-secure SYSRAM is used for secondary
CPU bring-up, so add a mapping for it.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/common.c                | 34 ++++++++++++++++++++++++++++
 arch/arm/mach-exynos/include/mach/map.h      |  3 +++
 arch/arm/plat-samsung/include/plat/map-s5p.h |  1 +
 3 files changed, 38 insertions(+)

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 4eb39cd..ddec3d5 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -214,6 +214,33 @@ static struct map_desc exynos4_iodesc1[] __initdata = {
 	},
 };
 
+static struct map_desc exynos4210_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSRAM_NS,
+		.pfn		= __phys_to_pfn(EXYNOS4210_PA_SYSRAM_NS),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	},
+};
+
+static struct map_desc exynos4x12_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSRAM_NS,
+		.pfn		= __phys_to_pfn(EXYNOS4x12_PA_SYSRAM_NS),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	},
+};
+
+static struct map_desc exynos5250_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSRAM_NS,
+		.pfn		= __phys_to_pfn(EXYNOS5250_PA_SYSRAM_NS),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	},
+};
+
 static struct map_desc exynos5_iodesc[] __initdata = {
 	{
 		.virtual	= (unsigned long)S3C_VA_SYS,
@@ -321,6 +348,13 @@ static void __init exynos4_map_io(void)
 	else
 		iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
 
+	if (soc_is_exynos4210())
+		iotable_init(exynos4210_iodesc, ARRAY_SIZE(exynos4210_iodesc));
+	if (soc_is_exynos4212() || soc_is_exynos4412())
+		iotable_init(exynos4x12_iodesc, ARRAY_SIZE(exynos4x12_iodesc));
+	if (soc_is_exynos5250())
+		iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc));
+
 	/* initialize device information early */
 	exynos4_default_sdhci0();
 	exynos4_default_sdhci1();
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index c72b675..f4a8ac3 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -26,6 +26,9 @@
 #define EXYNOS4_PA_SYSRAM0		0x02025000
 #define EXYNOS4_PA_SYSRAM1		0x02020000
 #define EXYNOS5_PA_SYSRAM		0x02020000
+#define EXYNOS4210_PA_SYSRAM_NS		0x0203F000
+#define EXYNOS4x12_PA_SYSRAM_NS		0x0204F000
+#define EXYNOS5250_PA_SYSRAM_NS		0x0204F000
 
 #define EXYNOS4_PA_FIMC0		0x11800000
 #define EXYNOS4_PA_FIMC1		0x11810000
diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h
index c2d7bda..c186786 100644
--- a/arch/arm/plat-samsung/include/plat/map-s5p.h
+++ b/arch/arm/plat-samsung/include/plat/map-s5p.h
@@ -22,6 +22,7 @@
 #define S5P_VA_GPIO3		S3C_ADDR(0x02280000)
 
 #define S5P_VA_SYSRAM		S3C_ADDR(0x02400000)
+#define S5P_VA_SYSRAM_NS	S3C_ADDR(0x02410000)
 #define S5P_VA_DMC0		S3C_ADDR(0x02440000)
 #define S5P_VA_DMC1		S3C_ADDR(0x02480000)
 #define S5P_VA_SROMC		S3C_ADDR(0x024C0000)
-- 
1.7.12

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

* [PATCH 5/6] ARM: EXYNOS: Add support for Exynos secure firmware
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-09-24 14:28   ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski, t.figa

Some Exynos-based boards contain secure firmware and must use firmware
operations to set up some hardware.

This patch adds firmware operations for Exynos secure firmware and a way
for board code and device tree to specify that they must be used.

Example of use:

In board code:

	...MACHINE_START(...)
		/* ... */
		.init_early	= exynos_firmware_init,
		/* ... */
	MACHINE_END

In device tree:

	/ {
		/* ... */

		firmware {
			compatible = "samsung,secure-firmware";
		};

		/* ... */
	};

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
 arch/arm/mach-exynos/Makefile                      |  1 +
 arch/arm/mach-exynos/common.h                      |  2 +
 arch/arm/mach-exynos/firmware.c                    | 54 ++++++++++++++++++++++
 arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
 5 files changed, 66 insertions(+)
 create mode 100644 arch/arm/mach-exynos/firmware.c

diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung-boards.txt
index 0bf68be..f447059 100644
--- a/Documentation/devicetree/bindings/arm/samsung-boards.txt
+++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt
@@ -6,3 +6,11 @@ Required root node properties:
     - compatible = should be one or more of the following.
         (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
         (b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
+
+Optional:
+    - firmware node, specifying presence and type of secure firmware, currently
+        supported value of compatible property is "samsung,secure-firmware":
+
+	firmware {
+		compatible = "samsung,secure-firmware";
+	};
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 5c1de47..b464333 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_EXYNOS4_MCT)	+= mct.o
 obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
 
 obj-$(CONFIG_ARCH_EXYNOS)	+= exynos-smc.o
+obj-$(CONFIG_ARCH_EXYNOS)	+= firmware.o
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index aed2eeb..540918f 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -21,6 +21,8 @@ void exynos4_restart(char mode, const char *cmd);
 void exynos5_restart(char mode, const char *cmd);
 void exynos_init_late(void);
 
+void exynos_firmware_init(void);
+
 #ifdef CONFIG_PM_GENERIC_DOMAINS
 int exynos_pm_late_initcall(void);
 #else
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
new file mode 100644
index 0000000..67d975d
--- /dev/null
+++ b/arch/arm/mach-exynos/firmware.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ * Tomasz Figa <t.figa@samsung.com>
+ *
+ * This program is free software,you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/of.h>
+
+#include <asm/firmware.h>
+
+#include <mach/map.h>
+
+#include "smc.h"
+
+static int exynos_do_idle(void)
+{
+        exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
+        return 0;
+}
+
+static int exynos_cpu_boot(int cpu)
+{
+	exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
+	return 0;
+}
+
+static int exynos_cpu_boot_reg(int cpu, void __iomem **ptr)
+{
+	*ptr = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu;
+	return 0;
+}
+
+static const struct firmware_ops exynos_firmware_ops = {
+	.do_idle	= exynos_do_idle,
+	.cpu_boot	= exynos_cpu_boot,
+	.cpu_boot_reg	= exynos_cpu_boot_reg,
+};
+
+void __init exynos_firmware_init(void)
+{
+	if (of_have_populated_dt() &&
+	    !of_find_compatible_node(NULL, NULL, "samsung,secure-firmware"))
+		return;
+
+	pr_info("Running under secure firmware.\n");
+
+	register_firmware_ops(&exynos_firmware_ops);
+}
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index b2b5d5f..a244e4a 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -88,6 +88,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
 	.init_irq	= exynos4_init_irq,
 	.map_io		= exynos4210_dt_map_io,
 	.handle_irq	= gic_handle_irq,
+	.init_early	= exynos_firmware_init,
 	.init_machine	= exynos4210_dt_machine_init,
 	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
-- 
1.7.12

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

* [PATCH 5/6] ARM: EXYNOS: Add support for Exynos secure firmware
@ 2012-09-24 14:28   ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

Some Exynos-based boards contain secure firmware and must use firmware
operations to set up some hardware.

This patch adds firmware operations for Exynos secure firmware and a way
for board code and device tree to specify that they must be used.

Example of use:

In board code:

	...MACHINE_START(...)
		/* ... */
		.init_early	= exynos_firmware_init,
		/* ... */
	MACHINE_END

In device tree:

	/ {
		/* ... */

		firmware {
			compatible = "samsung,secure-firmware";
		};

		/* ... */
	};

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
 arch/arm/mach-exynos/Makefile                      |  1 +
 arch/arm/mach-exynos/common.h                      |  2 +
 arch/arm/mach-exynos/firmware.c                    | 54 ++++++++++++++++++++++
 arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
 5 files changed, 66 insertions(+)
 create mode 100644 arch/arm/mach-exynos/firmware.c

diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung-boards.txt
index 0bf68be..f447059 100644
--- a/Documentation/devicetree/bindings/arm/samsung-boards.txt
+++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt
@@ -6,3 +6,11 @@ Required root node properties:
     - compatible = should be one or more of the following.
         (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
         (b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
+
+Optional:
+    - firmware node, specifying presence and type of secure firmware, currently
+        supported value of compatible property is "samsung,secure-firmware":
+
+	firmware {
+		compatible = "samsung,secure-firmware";
+	};
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 5c1de47..b464333 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_EXYNOS4_MCT)	+= mct.o
 obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
 
 obj-$(CONFIG_ARCH_EXYNOS)	+= exynos-smc.o
+obj-$(CONFIG_ARCH_EXYNOS)	+= firmware.o
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index aed2eeb..540918f 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -21,6 +21,8 @@ void exynos4_restart(char mode, const char *cmd);
 void exynos5_restart(char mode, const char *cmd);
 void exynos_init_late(void);
 
+void exynos_firmware_init(void);
+
 #ifdef CONFIG_PM_GENERIC_DOMAINS
 int exynos_pm_late_initcall(void);
 #else
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
new file mode 100644
index 0000000..67d975d
--- /dev/null
+++ b/arch/arm/mach-exynos/firmware.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics.
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ * Tomasz Figa <t.figa@samsung.com>
+ *
+ * This program is free software,you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/of.h>
+
+#include <asm/firmware.h>
+
+#include <mach/map.h>
+
+#include "smc.h"
+
+static int exynos_do_idle(void)
+{
+        exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
+        return 0;
+}
+
+static int exynos_cpu_boot(int cpu)
+{
+	exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
+	return 0;
+}
+
+static int exynos_cpu_boot_reg(int cpu, void __iomem **ptr)
+{
+	*ptr = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu;
+	return 0;
+}
+
+static const struct firmware_ops exynos_firmware_ops = {
+	.do_idle	= exynos_do_idle,
+	.cpu_boot	= exynos_cpu_boot,
+	.cpu_boot_reg	= exynos_cpu_boot_reg,
+};
+
+void __init exynos_firmware_init(void)
+{
+	if (of_have_populated_dt() &&
+	    !of_find_compatible_node(NULL, NULL, "samsung,secure-firmware"))
+		return;
+
+	pr_info("Running under secure firmware.\n");
+
+	register_firmware_ops(&exynos_firmware_ops);
+}
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index b2b5d5f..a244e4a 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -88,6 +88,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
 	.init_irq	= exynos4_init_irq,
 	.map_io		= exynos4210_dt_map_io,
 	.handle_irq	= gic_handle_irq,
+	.init_early	= exynos_firmware_init,
 	.init_machine	= exynos4210_dt_machine_init,
 	.init_late	= exynos_init_late,
 	.timer		= &exynos4_timer,
-- 
1.7.12

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

* [PATCH 6/6] ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-09-24 14:28   ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski, t.figa

Boards using secure firmware must use different CPU boot registers and
call secure firmware to boot the CPU.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/platsmp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index a7f4031..4a18250 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -25,6 +25,7 @@
 #include <asm/hardware/gic.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
+#include <asm/firmware.h>
 
 #include <mach/hardware.h>
 #include <mach/regs-clock.h>
@@ -44,6 +45,8 @@ static inline void __iomem *cpu_boot_reg_base(void)
 static inline void __iomem *cpu_boot_reg(int cpu)
 {
 	void __iomem *boot_reg;
+	if (!call_firmware_op(cpu_boot_reg, cpu, &boot_reg))
+		return boot_reg;
 	boot_reg = cpu_boot_reg_base();
 	if (soc_is_exynos4412())
 		boot_reg += 4*cpu;
@@ -153,6 +156,10 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 		__raw_writel(virt_to_phys(exynos4_secondary_startup),
 							cpu_boot_reg(phys_cpu));
+
+		/* Call Exynos specific smc call */
+		call_firmware_op(cpu_boot, phys_cpu);
+
 		gic_raise_softirq(cpumask_of(cpu), 1);
 
 		if (pen_release == -1)
-- 
1.7.12

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

* [PATCH 6/6] ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
@ 2012-09-24 14:28   ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-09-24 14:28 UTC (permalink / raw)
  To: linux-arm-kernel

Boards using secure firmware must use different CPU boot registers and
call secure firmware to boot the CPU.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/platsmp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index a7f4031..4a18250 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -25,6 +25,7 @@
 #include <asm/hardware/gic.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
+#include <asm/firmware.h>
 
 #include <mach/hardware.h>
 #include <mach/regs-clock.h>
@@ -44,6 +45,8 @@ static inline void __iomem *cpu_boot_reg_base(void)
 static inline void __iomem *cpu_boot_reg(int cpu)
 {
 	void __iomem *boot_reg;
+	if (!call_firmware_op(cpu_boot_reg, cpu, &boot_reg))
+		return boot_reg;
 	boot_reg = cpu_boot_reg_base();
 	if (soc_is_exynos4412())
 		boot_reg += 4*cpu;
@@ -153,6 +156,10 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 		__raw_writel(virt_to_phys(exynos4_secondary_startup),
 							cpu_boot_reg(phys_cpu));
+
+		/* Call Exynos specific smc call */
+		call_firmware_op(cpu_boot, phys_cpu);
+
 		gic_raise_softirq(cpumask_of(cpu), 1);
 
 		if (pen_release == -1)
-- 
1.7.12

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

* Re: [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-10-02  9:13   ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-10-02  9:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-arm-kernel, kyungmin.park, kgene.kim, linux, arnd, olof,
	m.szyprowski

Hi,

On Monday 24 of September 2012 16:28:27 Tomasz Figa wrote:
> Some Exynos-based boards are running with secure firmware running in
> TrustZone secure world, which changes the way some things have to be
> initialized.
> 
> This series adds support for specifying firmware operations, implements
> some firmware operations for Exynos secure firmware and adds a method of
> enabling secure firmware operations on Exynos-based boards through board
> file and device tree.
> 
> Changes since v1
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
>   - Changed return types of all operations to int
>   - Defined all operations to return 0 on success, -ENOSYS when not
>     implemented or appropriate error code on error
> 
> Tomasz Figa (6):
>   ARM: Add interface for registering and calling firmware-specific
>     operations
>   ARM: EXYNOS: Add support for secure monitor calls
>   ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
>   ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
>   ARM: EXYNOS: Add support for Exynos secure firmware
>   ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
> 
>  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
>  arch/arm/common/Makefile                           |  2 +
>  arch/arm/common/firmware.c                         | 18 ++++++++
>  arch/arm/include/asm/firmware.h                    | 31 +++++++++++++
>  arch/arm/mach-exynos/Makefile                      |  6 +++
>  arch/arm/mach-exynos/common.c                      | 34 ++++++++++++++
>  arch/arm/mach-exynos/common.h                      |  2 +
>  arch/arm/mach-exynos/exynos-smc.S                  | 22 +++++++++
>  arch/arm/mach-exynos/firmware.c                    | 54
> ++++++++++++++++++++++ arch/arm/mach-exynos/include/mach/map.h          
>  |  3 ++
>  arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
>  arch/arm/mach-exynos/platsmp.c                     | 36 ++++++++++++---
>  arch/arm/mach-exynos/smc.h                         | 31 +++++++++++++
>  arch/arm/plat-samsung/include/plat/map-s5p.h       |  1 +
>  14 files changed, 243 insertions(+), 6 deletions(-)
>  create mode 100644 arch/arm/common/firmware.c
>  create mode 100644 arch/arm/include/asm/firmware.h
>  create mode 100644 arch/arm/mach-exynos/exynos-smc.S
>  create mode 100644 arch/arm/mach-exynos/firmware.c
>  create mode 100644 arch/arm/mach-exynos/smc.h

Any comments, nitpicks or acks on this patchset?

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center

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

* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-10-02  9:13   ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-10-02  9:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Monday 24 of September 2012 16:28:27 Tomasz Figa wrote:
> Some Exynos-based boards are running with secure firmware running in
> TrustZone secure world, which changes the way some things have to be
> initialized.
> 
> This series adds support for specifying firmware operations, implements
> some firmware operations for Exynos secure firmware and adds a method of
> enabling secure firmware operations on Exynos-based boards through board
> file and device tree.
> 
> Changes since v1
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
>   - Changed return types of all operations to int
>   - Defined all operations to return 0 on success, -ENOSYS when not
>     implemented or appropriate error code on error
> 
> Tomasz Figa (6):
>   ARM: Add interface for registering and calling firmware-specific
>     operations
>   ARM: EXYNOS: Add support for secure monitor calls
>   ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
>   ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
>   ARM: EXYNOS: Add support for Exynos secure firmware
>   ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
> 
>  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
>  arch/arm/common/Makefile                           |  2 +
>  arch/arm/common/firmware.c                         | 18 ++++++++
>  arch/arm/include/asm/firmware.h                    | 31 +++++++++++++
>  arch/arm/mach-exynos/Makefile                      |  6 +++
>  arch/arm/mach-exynos/common.c                      | 34 ++++++++++++++
>  arch/arm/mach-exynos/common.h                      |  2 +
>  arch/arm/mach-exynos/exynos-smc.S                  | 22 +++++++++
>  arch/arm/mach-exynos/firmware.c                    | 54
> ++++++++++++++++++++++ arch/arm/mach-exynos/include/mach/map.h          
>  |  3 ++
>  arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
>  arch/arm/mach-exynos/platsmp.c                     | 36 ++++++++++++---
>  arch/arm/mach-exynos/smc.h                         | 31 +++++++++++++
>  arch/arm/plat-samsung/include/plat/map-s5p.h       |  1 +
>  14 files changed, 243 insertions(+), 6 deletions(-)
>  create mode 100644 arch/arm/common/firmware.c
>  create mode 100644 arch/arm/include/asm/firmware.h
>  create mode 100644 arch/arm/mach-exynos/exynos-smc.S
>  create mode 100644 arch/arm/mach-exynos/firmware.c
>  create mode 100644 arch/arm/mach-exynos/smc.h

Any comments, nitpicks or acks on this patchset?

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center

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

* Re: [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
  2012-10-02  9:13   ` Tomasz Figa
@ 2012-10-10 15:35     ` Kyungmin Park
  -1 siblings, 0 replies; 32+ messages in thread
From: Kyungmin Park @ 2012-10-10 15:35 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: linux-samsung-soc, linux-arm-kernel, kgene.kim, linux, arnd,
	olof, m.szyprowski

Hi Arnd or Olof,

Can you pick up for v3.7?

To Tomasz,
Can you rebase it on the latest arm-soc tree?

Thank you,
Kyungmin Park

On Tue, Oct 2, 2012 at 6:13 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> Hi,
>
> On Monday 24 of September 2012 16:28:27 Tomasz Figa wrote:
>> Some Exynos-based boards are running with secure firmware running in
>> TrustZone secure world, which changes the way some things have to be
>> initialized.
>>
>> This series adds support for specifying firmware operations, implements
>> some firmware operations for Exynos secure firmware and adds a method of
>> enabling secure firmware operations on Exynos-based boards through board
>> file and device tree.
>>
>> Changes since v1
>> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
>>   - Changed return types of all operations to int
>>   - Defined all operations to return 0 on success, -ENOSYS when not
>>     implemented or appropriate error code on error
>>
>> Tomasz Figa (6):
>>   ARM: Add interface for registering and calling firmware-specific
>>     operations
>>   ARM: EXYNOS: Add support for secure monitor calls
>>   ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
>>   ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
>>   ARM: EXYNOS: Add support for Exynos secure firmware
>>   ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
>>
>>  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
>>  arch/arm/common/Makefile                           |  2 +
>>  arch/arm/common/firmware.c                         | 18 ++++++++
>>  arch/arm/include/asm/firmware.h                    | 31 +++++++++++++
>>  arch/arm/mach-exynos/Makefile                      |  6 +++
>>  arch/arm/mach-exynos/common.c                      | 34 ++++++++++++++
>>  arch/arm/mach-exynos/common.h                      |  2 +
>>  arch/arm/mach-exynos/exynos-smc.S                  | 22 +++++++++
>>  arch/arm/mach-exynos/firmware.c                    | 54
>> ++++++++++++++++++++++ arch/arm/mach-exynos/include/mach/map.h
>>  |  3 ++
>>  arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
>>  arch/arm/mach-exynos/platsmp.c                     | 36 ++++++++++++---
>>  arch/arm/mach-exynos/smc.h                         | 31 +++++++++++++
>>  arch/arm/plat-samsung/include/plat/map-s5p.h       |  1 +
>>  14 files changed, 243 insertions(+), 6 deletions(-)
>>  create mode 100644 arch/arm/common/firmware.c
>>  create mode 100644 arch/arm/include/asm/firmware.h
>>  create mode 100644 arch/arm/mach-exynos/exynos-smc.S
>>  create mode 100644 arch/arm/mach-exynos/firmware.c
>>  create mode 100644 arch/arm/mach-exynos/smc.h
>
> Any comments, nitpicks or acks on this patchset?
>
> Best regards,
> --
> Tomasz Figa
> Samsung Poland R&D Center
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-10-10 15:35     ` Kyungmin Park
  0 siblings, 0 replies; 32+ messages in thread
From: Kyungmin Park @ 2012-10-10 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd or Olof,

Can you pick up for v3.7?

To Tomasz,
Can you rebase it on the latest arm-soc tree?

Thank you,
Kyungmin Park

On Tue, Oct 2, 2012 at 6:13 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> Hi,
>
> On Monday 24 of September 2012 16:28:27 Tomasz Figa wrote:
>> Some Exynos-based boards are running with secure firmware running in
>> TrustZone secure world, which changes the way some things have to be
>> initialized.
>>
>> This series adds support for specifying firmware operations, implements
>> some firmware operations for Exynos secure firmware and adds a method of
>> enabling secure firmware operations on Exynos-based boards through board
>> file and device tree.
>>
>> Changes since v1
>> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
>>   - Changed return types of all operations to int
>>   - Defined all operations to return 0 on success, -ENOSYS when not
>>     implemented or appropriate error code on error
>>
>> Tomasz Figa (6):
>>   ARM: Add interface for registering and calling firmware-specific
>>     operations
>>   ARM: EXYNOS: Add support for secure monitor calls
>>   ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
>>   ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
>>   ARM: EXYNOS: Add support for Exynos secure firmware
>>   ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
>>
>>  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
>>  arch/arm/common/Makefile                           |  2 +
>>  arch/arm/common/firmware.c                         | 18 ++++++++
>>  arch/arm/include/asm/firmware.h                    | 31 +++++++++++++
>>  arch/arm/mach-exynos/Makefile                      |  6 +++
>>  arch/arm/mach-exynos/common.c                      | 34 ++++++++++++++
>>  arch/arm/mach-exynos/common.h                      |  2 +
>>  arch/arm/mach-exynos/exynos-smc.S                  | 22 +++++++++
>>  arch/arm/mach-exynos/firmware.c                    | 54
>> ++++++++++++++++++++++ arch/arm/mach-exynos/include/mach/map.h
>>  |  3 ++
>>  arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
>>  arch/arm/mach-exynos/platsmp.c                     | 36 ++++++++++++---
>>  arch/arm/mach-exynos/smc.h                         | 31 +++++++++++++
>>  arch/arm/plat-samsung/include/plat/map-s5p.h       |  1 +
>>  14 files changed, 243 insertions(+), 6 deletions(-)
>>  create mode 100644 arch/arm/common/firmware.c
>>  create mode 100644 arch/arm/include/asm/firmware.h
>>  create mode 100644 arch/arm/mach-exynos/exynos-smc.S
>>  create mode 100644 arch/arm/mach-exynos/firmware.c
>>  create mode 100644 arch/arm/mach-exynos/smc.h
>
> Any comments, nitpicks or acks on this patchset?
>
> Best regards,
> --
> Tomasz Figa
> Samsung Poland R&D Center
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 5/6] ARM: EXYNOS: Add support for Exynos secure firmware
  2012-09-24 14:28   ` Tomasz Figa
@ 2012-10-10 16:00     ` Olof Johansson
  -1 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:00 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: linux-samsung-soc, linux-arm-kernel, kyungmin.park, kgene.kim,
	linux, arnd, m.szyprowski

Hi,

On Mon, Sep 24, 2012 at 04:28:32PM +0200, Tomasz Figa wrote:
> Some Exynos-based boards contain secure firmware and must use firmware
> operations to set up some hardware.
> 
> This patch adds firmware operations for Exynos secure firmware and a way
> for board code and device tree to specify that they must be used.
> 
> Example of use:
> 
> In board code:
> 
> 	...MACHINE_START(...)
> 		/* ... */
> 		.init_early	= exynos_firmware_init,
> 		/* ... */
> 	MACHINE_END
> 
> In device tree:
> 
> 	/ {
> 		/* ... */
> 
> 		firmware {
> 			compatible = "samsung,secure-firmware";
> 		};
> 
> 		/* ... */
> 	};
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> ---
>  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
>  arch/arm/mach-exynos/Makefile                      |  1 +
>  arch/arm/mach-exynos/common.h                      |  2 +
>  arch/arm/mach-exynos/firmware.c                    | 54 ++++++++++++++++++++++
>  arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
>  5 files changed, 66 insertions(+)
>  create mode 100644 arch/arm/mach-exynos/firmware.c
> 
> diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> index 0bf68be..f447059 100644
> --- a/Documentation/devicetree/bindings/arm/samsung-boards.txt
> +++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> @@ -6,3 +6,11 @@ Required root node properties:
>      - compatible = should be one or more of the following.
>          (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
>          (b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
> +
> +Optional:
> +    - firmware node, specifying presence and type of secure firmware, currently
> +        supported value of compatible property is "samsung,secure-firmware":
> +
> +	firmware {
> +		compatible = "samsung,secure-firmware";
> +	};

If you require the binding to specify the memory area, then you at least allow
for future work to move to a dynamic mapping without updating the binding and
all device trees. So, please do that even if the code is hardcoded to the
static address today.

For extra credit, make sure that the reg property is matching the static mapping
when you setup your firmware interface on your platform.


[...]

> +static int exynos_cpu_boot_reg(int cpu, void __iomem **ptr)
> +{
> +	*ptr = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu;
> +	return 0;
> +}

It would be nice to get a memory map for the SMC area in documentation
somewhere, but that can be done separately later.


-Olof

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

* [PATCH 5/6] ARM: EXYNOS: Add support for Exynos secure firmware
@ 2012-10-10 16:00     ` Olof Johansson
  0 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Sep 24, 2012 at 04:28:32PM +0200, Tomasz Figa wrote:
> Some Exynos-based boards contain secure firmware and must use firmware
> operations to set up some hardware.
> 
> This patch adds firmware operations for Exynos secure firmware and a way
> for board code and device tree to specify that they must be used.
> 
> Example of use:
> 
> In board code:
> 
> 	...MACHINE_START(...)
> 		/* ... */
> 		.init_early	= exynos_firmware_init,
> 		/* ... */
> 	MACHINE_END
> 
> In device tree:
> 
> 	/ {
> 		/* ... */
> 
> 		firmware {
> 			compatible = "samsung,secure-firmware";
> 		};
> 
> 		/* ... */
> 	};
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> ---
>  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
>  arch/arm/mach-exynos/Makefile                      |  1 +
>  arch/arm/mach-exynos/common.h                      |  2 +
>  arch/arm/mach-exynos/firmware.c                    | 54 ++++++++++++++++++++++
>  arch/arm/mach-exynos/mach-exynos4-dt.c             |  1 +
>  5 files changed, 66 insertions(+)
>  create mode 100644 arch/arm/mach-exynos/firmware.c
> 
> diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> index 0bf68be..f447059 100644
> --- a/Documentation/devicetree/bindings/arm/samsung-boards.txt
> +++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> @@ -6,3 +6,11 @@ Required root node properties:
>      - compatible = should be one or more of the following.
>          (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
>          (b) "samsung,exynos4210"  - for boards based on Exynos4210 SoC.
> +
> +Optional:
> +    - firmware node, specifying presence and type of secure firmware, currently
> +        supported value of compatible property is "samsung,secure-firmware":
> +
> +	firmware {
> +		compatible = "samsung,secure-firmware";
> +	};

If you require the binding to specify the memory area, then you at least allow
for future work to move to a dynamic mapping without updating the binding and
all device trees. So, please do that even if the code is hardcoded to the
static address today.

For extra credit, make sure that the reg property is matching the static mapping
when you setup your firmware interface on your platform.


[...]

> +static int exynos_cpu_boot_reg(int cpu, void __iomem **ptr)
> +{
> +	*ptr = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu;
> +	return 0;
> +}

It would be nice to get a memory map for the SMC area in documentation
somewhere, but that can be done separately later.


-Olof

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

* Re: [PATCH 6/6] ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
  2012-09-24 14:28   ` Tomasz Figa
@ 2012-10-10 16:08     ` Olof Johansson
  -1 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:08 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: linux-samsung-soc, linux-arm-kernel, kyungmin.park, kgene.kim,
	linux, arnd, m.szyprowski

On Mon, Sep 24, 2012 at 04:28:33PM +0200, Tomasz Figa wrote:
> Boards using secure firmware must use different CPU boot registers and
> call secure firmware to boot the CPU.
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> ---
>  arch/arm/mach-exynos/platsmp.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
> index a7f4031..4a18250 100644
> --- a/arch/arm/mach-exynos/platsmp.c
> +++ b/arch/arm/mach-exynos/platsmp.c
> @@ -25,6 +25,7 @@
>  #include <asm/hardware/gic.h>
>  #include <asm/smp_plat.h>
>  #include <asm/smp_scu.h>
> +#include <asm/firmware.h>
>  
>  #include <mach/hardware.h>
>  #include <mach/regs-clock.h>
> @@ -44,6 +45,8 @@ static inline void __iomem *cpu_boot_reg_base(void)
>  static inline void __iomem *cpu_boot_reg(int cpu)
>  {
>  	void __iomem *boot_reg;
> +	if (!call_firmware_op(cpu_boot_reg, cpu, &boot_reg))
> +		return boot_reg;

Nit: new lines between variable declaration and code.


-Olof

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

* [PATCH 6/6] ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
@ 2012-10-10 16:08     ` Olof Johansson
  0 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 24, 2012 at 04:28:33PM +0200, Tomasz Figa wrote:
> Boards using secure firmware must use different CPU boot registers and
> call secure firmware to boot the CPU.
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> ---
>  arch/arm/mach-exynos/platsmp.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
> index a7f4031..4a18250 100644
> --- a/arch/arm/mach-exynos/platsmp.c
> +++ b/arch/arm/mach-exynos/platsmp.c
> @@ -25,6 +25,7 @@
>  #include <asm/hardware/gic.h>
>  #include <asm/smp_plat.h>
>  #include <asm/smp_scu.h>
> +#include <asm/firmware.h>
>  
>  #include <mach/hardware.h>
>  #include <mach/regs-clock.h>
> @@ -44,6 +45,8 @@ static inline void __iomem *cpu_boot_reg_base(void)
>  static inline void __iomem *cpu_boot_reg(int cpu)
>  {
>  	void __iomem *boot_reg;
> +	if (!call_firmware_op(cpu_boot_reg, cpu, &boot_reg))
> +		return boot_reg;

Nit: new lines between variable declaration and code.


-Olof

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

* Re: [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
  2012-09-24 14:28 ` Tomasz Figa
@ 2012-10-10 16:09   ` Olof Johansson
  -1 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:09 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: linux-samsung-soc, linux-arm-kernel, kyungmin.park, kgene.kim,
	linux, arnd, m.szyprowski

On Mon, Sep 24, 2012 at 04:28:27PM +0200, Tomasz Figa wrote:
> Some Exynos-based boards are running with secure firmware running in
> TrustZone secure world, which changes the way some things have to be
> initialized.
> 
> This series adds support for specifying firmware operations, implements
> some firmware operations for Exynos secure firmware and adds a method of
> enabling secure firmware operations on Exynos-based boards through board
> file and device tree.
> 
> Changes since v1
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
>   - Changed return types of all operations to int
>   - Defined all operations to return 0 on success, -ENOSYS when not
>     implemented or appropriate error code on error
> 
> Tomasz Figa (6):
>   ARM: Add interface for registering and calling firmware-specific
>     operations
>   ARM: EXYNOS: Add support for secure monitor calls
>   ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
>   ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
>   ARM: EXYNOS: Add support for Exynos secure firmware
>   ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up

Besides the open comment on the device-tree binding, the other patches are:

Reviewed-by: Olof Johansson <olof@lixom.net>

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

* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-10-10 16:09   ` Olof Johansson
  0 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 24, 2012 at 04:28:27PM +0200, Tomasz Figa wrote:
> Some Exynos-based boards are running with secure firmware running in
> TrustZone secure world, which changes the way some things have to be
> initialized.
> 
> This series adds support for specifying firmware operations, implements
> some firmware operations for Exynos secure firmware and adds a method of
> enabling secure firmware operations on Exynos-based boards through board
> file and device tree.
> 
> Changes since v1
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
>   - Changed return types of all operations to int
>   - Defined all operations to return 0 on success, -ENOSYS when not
>     implemented or appropriate error code on error
> 
> Tomasz Figa (6):
>   ARM: Add interface for registering and calling firmware-specific
>     operations
>   ARM: EXYNOS: Add support for secure monitor calls
>   ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
>   ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
>   ARM: EXYNOS: Add support for Exynos secure firmware
>   ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up

Besides the open comment on the device-tree binding, the other patches are:

Reviewed-by: Olof Johansson <olof@lixom.net>

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

* Re: [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
  2012-10-10 15:35     ` Kyungmin Park
@ 2012-10-10 16:11       ` Olof Johansson
  -1 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:11 UTC (permalink / raw)
  To: Kyungmin Park
  Cc: Tomasz Figa, linux-samsung-soc, linux-arm-kernel, kgene.kim,
	linux, arnd, m.szyprowski

Hi,

On Thu, Oct 11, 2012 at 12:35:54AM +0900, Kyungmin Park wrote:
> Hi Arnd or Olof,
> 
> Can you pick up for v3.7?
> 
> To Tomasz,
> Can you rebase it on the latest arm-soc tree?

This code should have been in arm-soc by the beginning of the merge window
(and in linux-next) to be merged for 3.7, but we will be happy to queue
it up for 3.8 once 3.7-rc1 is out. I have one outstanding comment on
the DT binding but the rest looks OK to me.

Tomasz, please rebase and send this to Kukjin so he can queue it up with other
Samsung code.


Thanks!

-Olof

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

* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-10-10 16:11       ` Olof Johansson
  0 siblings, 0 replies; 32+ messages in thread
From: Olof Johansson @ 2012-10-10 16:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Oct 11, 2012 at 12:35:54AM +0900, Kyungmin Park wrote:
> Hi Arnd or Olof,
> 
> Can you pick up for v3.7?
> 
> To Tomasz,
> Can you rebase it on the latest arm-soc tree?

This code should have been in arm-soc by the beginning of the merge window
(and in linux-next) to be merged for 3.7, but we will be happy to queue
it up for 3.8 once 3.7-rc1 is out. I have one outstanding comment on
the DT binding but the rest looks OK to me.

Tomasz, please rebase and send this to Kukjin so he can queue it up with other
Samsung code.


Thanks!

-Olof

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

* Re: [PATCH 5/6] ARM: EXYNOS: Add support for Exynos secure firmware
  2012-10-10 16:00     ` Olof Johansson
@ 2012-10-11 13:18       ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-10-11 13:18 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linux-samsung-soc, linux-arm-kernel, kyungmin.park, kgene.kim,
	linux, arnd, m.szyprowski

Hi Olof,

On Wednesday 10 of October 2012 09:00:27 Olof Johansson wrote:
> Hi,
> 
> On Mon, Sep 24, 2012 at 04:28:32PM +0200, Tomasz Figa wrote:
> > Some Exynos-based boards contain secure firmware and must use firmware
> > operations to set up some hardware.
> > 
> > This patch adds firmware operations for Exynos secure firmware and a
> > way
> > for board code and device tree to specify that they must be used.
> > 
> > Example of use:
> > 
> > In board code:
> > 	...MACHINE_START(...)
> > 	
> > 		/* ... */
> > 		.init_early	= exynos_firmware_init,
> > 		/* ... */
> > 	
> > 	MACHINE_END
> > 
> > In device tree:
> > 	/ {
> > 	
> > 		/* ... */
> > 		
> > 		firmware {
> > 		
> > 			compatible = "samsung,secure-firmware";
> > 		
> > 		};
> > 		
> > 		/* ... */
> > 	
> > 	};
> > 
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> > ---
> > 
> >  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
> >  arch/arm/mach-exynos/Makefile                      |  1 +
> >  arch/arm/mach-exynos/common.h                      |  2 +
> >  arch/arm/mach-exynos/firmware.c                    | 54
> >  ++++++++++++++++++++++ arch/arm/mach-exynos/mach-exynos4-dt.c        
> >      |  1 +
> >  5 files changed, 66 insertions(+)
> >  create mode 100644 arch/arm/mach-exynos/firmware.c
> > 
> > diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt
> > b/Documentation/devicetree/bindings/arm/samsung-boards.txt index
> > 0bf68be..f447059 100644
> > --- a/Documentation/devicetree/bindings/arm/samsung-boards.txt
> > +++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> > 
> > @@ -6,3 +6,11 @@ Required root node properties:
> >      - compatible = should be one or more of the following.
> >      
> >          (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
> >          (b) "samsung,exynos4210"  - for boards based on Exynos4210
> >          SoC.
> > 
> > +
> > +Optional:
> > +    - firmware node, specifying presence and type of secure firmware,
> > currently +        supported value of compatible property is
> > "samsung,secure-firmware": +
> > +	firmware {
> > +		compatible = "samsung,secure-firmware";
> > +	};
> 
> If you require the binding to specify the memory area, then you at least
> allow for future work to move to a dynamic mapping without updating the
> binding and all device trees. So, please do that even if the code is
> hardcoded to the static address today.

All right.

> For extra credit, make sure that the reg property is matching the static
> mapping when you setup your firmware interface on your platform.

Hmm, do you know a way to look up physical address of such static mapping, 
given only the virtual address? Additional problem is that the code is 
executed very early (in init_early callback), before most of VM 
initialization code.

I could do something like

	if (soc_is_exynos4210())
		paddr = EXYNOS4210_PA_SYSRAM_NS;
	else if (soc_is_exynos4212() || soc_is_exynos4412())
		paddr = EXYNOS4x12_PA_SYSRAM_NS;
	...

and compare paddr with address received from device tree, but I don't 
really like this construct.
 
> > +static int exynos_cpu_boot_reg(int cpu, void __iomem **ptr)
> > +{
> > +	*ptr = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu;
> > +	return 0;
> > +}
> 
> It would be nice to get a memory map for the SMC area in documentation
> somewhere, but that can be done separately later.

OK.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center

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

* [PATCH 5/6] ARM: EXYNOS: Add support for Exynos secure firmware
@ 2012-10-11 13:18       ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-10-11 13:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof,

On Wednesday 10 of October 2012 09:00:27 Olof Johansson wrote:
> Hi,
> 
> On Mon, Sep 24, 2012 at 04:28:32PM +0200, Tomasz Figa wrote:
> > Some Exynos-based boards contain secure firmware and must use firmware
> > operations to set up some hardware.
> > 
> > This patch adds firmware operations for Exynos secure firmware and a
> > way
> > for board code and device tree to specify that they must be used.
> > 
> > Example of use:
> > 
> > In board code:
> > 	...MACHINE_START(...)
> > 	
> > 		/* ... */
> > 		.init_early	= exynos_firmware_init,
> > 		/* ... */
> > 	
> > 	MACHINE_END
> > 
> > In device tree:
> > 	/ {
> > 	
> > 		/* ... */
> > 		
> > 		firmware {
> > 		
> > 			compatible = "samsung,secure-firmware";
> > 		
> > 		};
> > 		
> > 		/* ... */
> > 	
> > 	};
> > 
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Signed-off-by: Tomasz Figa <t.figa@samsung.com>
> > ---
> > 
> >  .../devicetree/bindings/arm/samsung-boards.txt     |  8 ++++
> >  arch/arm/mach-exynos/Makefile                      |  1 +
> >  arch/arm/mach-exynos/common.h                      |  2 +
> >  arch/arm/mach-exynos/firmware.c                    | 54
> >  ++++++++++++++++++++++ arch/arm/mach-exynos/mach-exynos4-dt.c        
> >      |  1 +
> >  5 files changed, 66 insertions(+)
> >  create mode 100644 arch/arm/mach-exynos/firmware.c
> > 
> > diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt
> > b/Documentation/devicetree/bindings/arm/samsung-boards.txt index
> > 0bf68be..f447059 100644
> > --- a/Documentation/devicetree/bindings/arm/samsung-boards.txt
> > +++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt
> > 
> > @@ -6,3 +6,11 @@ Required root node properties:
> >      - compatible = should be one or more of the following.
> >      
> >          (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board.
> >          (b) "samsung,exynos4210"  - for boards based on Exynos4210
> >          SoC.
> > 
> > +
> > +Optional:
> > +    - firmware node, specifying presence and type of secure firmware,
> > currently +        supported value of compatible property is
> > "samsung,secure-firmware": +
> > +	firmware {
> > +		compatible = "samsung,secure-firmware";
> > +	};
> 
> If you require the binding to specify the memory area, then you at least
> allow for future work to move to a dynamic mapping without updating the
> binding and all device trees. So, please do that even if the code is
> hardcoded to the static address today.

All right.

> For extra credit, make sure that the reg property is matching the static
> mapping when you setup your firmware interface on your platform.

Hmm, do you know a way to look up physical address of such static mapping, 
given only the virtual address? Additional problem is that the code is 
executed very early (in init_early callback), before most of VM 
initialization code.

I could do something like

	if (soc_is_exynos4210())
		paddr = EXYNOS4210_PA_SYSRAM_NS;
	else if (soc_is_exynos4212() || soc_is_exynos4412())
		paddr = EXYNOS4x12_PA_SYSRAM_NS;
	...

and compare paddr with address received from device tree, but I don't 
really like this construct.
 
> > +static int exynos_cpu_boot_reg(int cpu, void __iomem **ptr)
> > +{
> > +	*ptr = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu;
> > +	return 0;
> > +}
> 
> It would be nice to get a memory map for the SMC area in documentation
> somewhere, but that can be done separately later.

OK.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center

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

* Re: [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
  2012-10-10 16:11       ` Olof Johansson
@ 2012-10-11 13:19         ` Tomasz Figa
  -1 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-10-11 13:19 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Kyungmin Park, linux-samsung-soc, linux-arm-kernel, kgene.kim,
	linux, arnd, m.szyprowski

Hi Olof,

On Wednesday 10 of October 2012 09:11:36 Olof Johansson wrote:
> Hi,
> 
> On Thu, Oct 11, 2012 at 12:35:54AM +0900, Kyungmin Park wrote:
> > Hi Arnd or Olof,
> > 
> > Can you pick up for v3.7?
> > 
> > To Tomasz,
> > Can you rebase it on the latest arm-soc tree?
> 
> This code should have been in arm-soc by the beginning of the merge
> window (and in linux-next) to be merged for 3.7, but we will be happy to
> queue it up for 3.8 once 3.7-rc1 is out. I have one outstanding comment
> on the DT binding but the rest looks OK to me.
> 
> Tomasz, please rebase and send this to Kukjin so he can queue it up with
> other Samsung code.

OK.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center

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

* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-10-11 13:19         ` Tomasz Figa
  0 siblings, 0 replies; 32+ messages in thread
From: Tomasz Figa @ 2012-10-11 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Olof,

On Wednesday 10 of October 2012 09:11:36 Olof Johansson wrote:
> Hi,
> 
> On Thu, Oct 11, 2012 at 12:35:54AM +0900, Kyungmin Park wrote:
> > Hi Arnd or Olof,
> > 
> > Can you pick up for v3.7?
> > 
> > To Tomasz,
> > Can you rebase it on the latest arm-soc tree?
> 
> This code should have been in arm-soc by the beginning of the merge
> window (and in linux-next) to be merged for 3.7, but we will be happy to
> queue it up for 3.8 once 3.7-rc1 is out. I have one outstanding comment
> on the DT binding but the rest looks OK to me.
> 
> Tomasz, please rebase and send this to Kukjin so he can queue it up with
> other Samsung code.

OK.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center

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

* RE: [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
  2012-10-10 16:11       ` Olof Johansson
@ 2012-10-15 13:59         ` Kukjin Kim
  -1 siblings, 0 replies; 32+ messages in thread
From: Kukjin Kim @ 2012-10-15 13:59 UTC (permalink / raw)
  To: 'Olof Johansson', 'Kyungmin Park'
  Cc: 'Tomasz Figa',
	linux-samsung-soc, linux-arm-kernel, linux, arnd, m.szyprowski

Olof Johansson wrote:
> 
> Hi,
> 
> On Thu, Oct 11, 2012 at 12:35:54AM +0900, Kyungmin Park wrote:
> > Hi Arnd or Olof,
> >
> > Can you pick up for v3.7?
> >
> > To Tomasz,
> > Can you rebase it on the latest arm-soc tree?
> 
> This code should have been in arm-soc by the beginning of the merge window
> (and in linux-next) to be merged for 3.7, but we will be happy to queue
> it up for 3.8 once 3.7-rc1 is out. I have one outstanding comment on
> the DT binding but the rest looks OK to me.
> 
Yeah, I agree.

Olof, thanks for your review.

> Tomasz, please rebase and send this to Kukjin so he can queue it up with
> other
> Samsung code.
> 
OK, let me apply this series in Samsung tree when Tomasz's rebased code
against on v3.7-rc1 is available.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
@ 2012-10-15 13:59         ` Kukjin Kim
  0 siblings, 0 replies; 32+ messages in thread
From: Kukjin Kim @ 2012-10-15 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

Olof Johansson wrote:
> 
> Hi,
> 
> On Thu, Oct 11, 2012 at 12:35:54AM +0900, Kyungmin Park wrote:
> > Hi Arnd or Olof,
> >
> > Can you pick up for v3.7?
> >
> > To Tomasz,
> > Can you rebase it on the latest arm-soc tree?
> 
> This code should have been in arm-soc by the beginning of the merge window
> (and in linux-next) to be merged for 3.7, but we will be happy to queue
> it up for 3.8 once 3.7-rc1 is out. I have one outstanding comment on
> the DT binding but the rest looks OK to me.
> 
Yeah, I agree.

Olof, thanks for your review.

> Tomasz, please rebase and send this to Kukjin so he can queue it up with
> other
> Samsung code.
> 
OK, let me apply this series in Samsung tree when Tomasz's rebased code
against on v3.7-rc1 is available.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

end of thread, other threads:[~2012-10-15 14:00 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-24 14:28 [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support Tomasz Figa
2012-09-24 14:28 ` Tomasz Figa
2012-09-24 14:28 ` [PATCH 1/6] ARM: Add interface for registering and calling firmware-specific operations Tomasz Figa
2012-09-24 14:28   ` Tomasz Figa
2012-09-24 14:28 ` [PATCH 2/6] ARM: EXYNOS: Add support for secure monitor calls Tomasz Figa
2012-09-24 14:28   ` Tomasz Figa
2012-09-24 14:28 ` [PATCH 3/6] ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412 Tomasz Figa
2012-09-24 14:28   ` Tomasz Figa
2012-09-24 14:28 ` [PATCH 4/6] ARM: EXYNOS: Add IO mapping for non-secure SYSRAM Tomasz Figa
2012-09-24 14:28   ` Tomasz Figa
2012-09-24 14:28 ` [PATCH 5/6] ARM: EXYNOS: Add support for Exynos secure firmware Tomasz Figa
2012-09-24 14:28   ` Tomasz Figa
2012-10-10 16:00   ` Olof Johansson
2012-10-10 16:00     ` Olof Johansson
2012-10-11 13:18     ` Tomasz Figa
2012-10-11 13:18       ` Tomasz Figa
2012-09-24 14:28 ` [PATCH 6/6] ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up Tomasz Figa
2012-09-24 14:28   ` Tomasz Figa
2012-10-10 16:08   ` Olof Johansson
2012-10-10 16:08     ` Olof Johansson
2012-10-02  9:13 ` [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support Tomasz Figa
2012-10-02  9:13   ` Tomasz Figa
2012-10-10 15:35   ` Kyungmin Park
2012-10-10 15:35     ` Kyungmin Park
2012-10-10 16:11     ` Olof Johansson
2012-10-10 16:11       ` Olof Johansson
2012-10-11 13:19       ` Tomasz Figa
2012-10-11 13:19         ` Tomasz Figa
2012-10-15 13:59       ` Kukjin Kim
2012-10-15 13:59         ` Kukjin Kim
2012-10-10 16:09 ` Olof Johansson
2012-10-10 16:09   ` Olof Johansson

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.