Module Name:    src
Committed By:   reinoud
Date:           Sun Apr 13 20:45:25 UTC 2014

Modified Files:
        src/sys/arch/arm/samsung: exynos_soc.c exynos_var.h files.exynos
        src/sys/arch/evbarm/odroid: odroid_machdep.c

Log Message:
Remove trustzone firmware indirect calls by explicit calling the exynos
routines in exynos_soc.c

While here, also remove unused variable conaddr


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/samsung/exynos_soc.c \
    src/sys/arch/arm/samsung/files.exynos
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/samsung/exynos_var.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/odroid/odroid_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/samsung/exynos_soc.c
diff -u src/sys/arch/arm/samsung/exynos_soc.c:1.1 src/sys/arch/arm/samsung/exynos_soc.c:1.2
--- src/sys/arch/arm/samsung/exynos_soc.c:1.1	Sun Apr 13 02:26:26 2014
+++ src/sys/arch/arm/samsung/exynos_soc.c	Sun Apr 13 20:45:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_soc.c,v 1.1 2014/04/13 02:26:26 matt Exp $	*/
+/*	$NetBSD: exynos_soc.c,v 1.2 2014/04/13 20:45:25 reinoud Exp $	*/
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #define	_ARM32_BUS_DMA_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: exynos_soc.c,v 1.1 2014/04/13 02:26:26 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_soc.c,v 1.2 2014/04/13 20:45:25 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -112,7 +112,7 @@ static struct consdev exynos_earlycons =
 
 
 #ifdef ARM_TRUSTZONE_FIRMWARE
-static int
+int
 exynos_do_idle(void)
 {
         exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
@@ -121,10 +121,11 @@ exynos_do_idle(void)
 }
 
 
-static int
+int
 exynos_set_cpu_boot_addr(int cpu, vaddr_t boot_addr)
 {
 #if 0
+	/* XXX we need to map in iRAM space for this XXX */
         void __iomem *boot_reg = S5P_VA_SYSRAM_NS + 0x1c;
 
         if (!soc_is_exynos5420())
@@ -137,7 +138,7 @@ exynos_set_cpu_boot_addr(int cpu, vaddr_
 }
 
 
-static int
+int
 exynos_cpu_boot(int cpu)
 {
 	exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
@@ -155,11 +156,11 @@ exynos_cpu_boot(int cpu)
  * Exynos4412, but why?
  */
 
-static int
+int
 exynos_l2cc_init(void)
 {
 	const uint32_t tag_latency  = 0x110;
-	const uint32_t data_latency = IS_EXYNOS4410 ? 0x110 : 0x120;
+	const uint32_t data_latency = IS_EXYNOS4410_P() ? 0x110 : 0x120;
 	const uint32_t prefetch4412   = /* 0111 0001 0000 0000 0000 0000 0000 0111 */
 				PREFETCHCTL_DBLLINEF_EN  |
 				PREFETCHCTL_INSTRPREF_EN |
@@ -198,7 +199,7 @@ exynos_l2cc_init(void)
 	KASSERT(aux_val         == 0x7C470001);
 	KASSERT(aux_keepmask    == 0xC200FFFF);
 
-	if (IS_EXYNOS4412_R0)
+	if (IS_EXYNOS4412_R0_P())
 		prefetch = prefetch4412_r0;
 	else
 		prefetch = prefetch4412;	/* newer than >= r1_0 */
@@ -213,15 +214,9 @@ exynos_l2cc_init(void)
 
 	return 0;
 }
-
-static struct trustzone_firmware_handlers exynos_firmware_handlers = {
-	.do_idle           = exynos_do_idle,
-	.set_cpu_boot_addr = exynos_set_cpu_boot_addr,
-	.cpu_boot          = exynos_cpu_boot,
-	.l2cc_init         = exynos_l2cc_init
-};
 #endif /* ARM_TRUSTZONE_FIRMWARE */
 
+
 void
 exynos_bootstrap(vaddr_t iobase, vaddr_t uartbase)
 {
@@ -242,10 +237,6 @@ exynos_bootstrap(vaddr_t iobase, vaddr_t
 			__func__, error);
 	KASSERT(exynos_core_bsh == iobase);
 #endif
-#ifdef ARM_TRUSTZONE_FIRMWARE
-	/* setup trustzone handlers */
-	trustzone_firmware_handlers = &exynos_firmware_handlers;
-#endif
 }
 
 
Index: src/sys/arch/arm/samsung/files.exynos
diff -u src/sys/arch/arm/samsung/files.exynos:1.1 src/sys/arch/arm/samsung/files.exynos:1.2
--- src/sys/arch/arm/samsung/files.exynos:1.1	Sun Apr 13 02:26:26 2014
+++ src/sys/arch/arm/samsung/files.exynos	Sun Apr 13 20:45:25 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.exynos,v 1.1 2014/04/13 02:26:26 matt Exp $
+#	$NetBSD: files.exynos,v 1.2 2014/04/13 20:45:25 reinoud Exp $
 #
 # Configuration info for Samsung Exynos SoC ARM Peripherals
 #
@@ -17,7 +17,6 @@ file	arch/arm/samsung/exynos_soc.c
 file	arch/arm/samsung/exynos_space.c
 #file	arch/arm/samsung/primecell.c
 file	arch/arm/samsung/exynos_smc.S		arm_trustzone_firmware
-file	arch/arm/trustzone/firmware.c		arm_trustzone_firmware
 
 file	arch/arm/arm/bus_space_a4x.S		exyo
 

Index: src/sys/arch/arm/samsung/exynos_var.h
diff -u src/sys/arch/arm/samsung/exynos_var.h:1.2 src/sys/arch/arm/samsung/exynos_var.h:1.3
--- src/sys/arch/arm/samsung/exynos_var.h:1.2	Sun Apr 13 17:06:02 2014
+++ src/sys/arch/arm/samsung/exynos_var.h	Sun Apr 13 20:45:25 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_var.h,v 1.2 2014/04/13 17:06:02 reinoud Exp $ */
+/* $NetBSD: exynos_var.h,v 1.3 2014/04/13 20:45:25 reinoud Exp $ */
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -102,9 +102,17 @@ extern struct bus_space exynos_bs_tag;
 extern struct bus_space exynos_a4x_bs_tag;
 extern bus_space_handle_t exynos_core_bsh;
 
-void exynos_bootstrap(vaddr_t, vaddr_t);
-void exynos_device_register(device_t self, void *aux);
-void exyo_device_register(device_t self, void *aux);
-void exynos_wdt_reset(void);
+extern void exynos_bootstrap(vaddr_t, vaddr_t);
+extern void exynos_device_register(device_t self, void *aux);
+extern void exyo_device_register(device_t self, void *aux);
+extern void exynos_wdt_reset(void);
+
+#ifdef ARM_TRUSTZONE_FIRMWARE
+/* trustzone calls */
+extern int exynos_do_idle(void);
+extern int exynos_set_cpu_boot_addr(int cpu, vaddr_t boot_addr);
+extern int exynos_cpu_boot(int cpu);
+extern int exynos_l2cc_init(void);
+#endif
 
 #endif	/* _ARM_SAMSUNG_EXYNOS_VAR_H_ */

Index: src/sys/arch/evbarm/odroid/odroid_machdep.c
diff -u src/sys/arch/evbarm/odroid/odroid_machdep.c:1.2 src/sys/arch/evbarm/odroid/odroid_machdep.c:1.3
--- src/sys/arch/evbarm/odroid/odroid_machdep.c:1.2	Sun Apr 13 06:18:51 2014
+++ src/sys/arch/evbarm/odroid/odroid_machdep.c	Sun Apr 13 20:45:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: odroid_machdep.c,v 1.2 2014/04/13 06:18:51 skrll Exp $ */
+/*	$NetBSD: odroid_machdep.c,v 1.3 2014/04/13 20:45:25 reinoud Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.2 2014/04/13 06:18:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.3 2014/04/13 20:45:25 reinoud Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_exynos.h"
@@ -160,7 +160,7 @@ static const struct sscom_uart_info exyn
 // __CTASSERT(EXYNOS_CORE_PBASE + EXYNOS_UART0_OFFSET <= CONADDR);
 // __CTASSERT(CONADDR <= EXYNOS_CORE_PBASE + EXYNOS_UART4_OFFSET);
 // __CTASSERT(CONADDR % EXYNOS_BLOCK_SIZE == 0);
-static const bus_addr_t conaddr = CONADDR;
+//static const bus_addr_t conaddr = CONADDR;
 static const int conspeed = CONSPEED;
 static const int conmode = CONMODE;
 #endif /*defined(KGDB) || defined(SSCOM0CONSOLE) || defined(SSCOM1CONSOLE) */
@@ -325,7 +325,7 @@ curcpu()->ci_data.cpu_cc_freq = 1*1000*1
 			EXYNOS_IOPHYSTOVIRT(armreg_cbar_read());
 
 #ifdef ARM_TRUSTZONE_FIRMWARE
-		trustzone_firmware_handlers->l2cc_init();
+		exynos_l2cc_init();
 #endif
 		arml2cc_init(&exynos_bs_tag, pl310_bh, 0x2000);
 	}

Reply via email to