Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Remove trustzone firmware indirect calls by explici...



details:   https://anonhg.NetBSD.org/src/rev/391f48a09fe4
branches:  trunk
changeset: 328689:391f48a09fe4
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Sun Apr 13 20:45:25 2014 +0000

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

While here, also remove unused variable conaddr

diffstat:

 sys/arch/arm/samsung/exynos_soc.c       |  29 ++++++++++-------------------
 sys/arch/arm/samsung/exynos_var.h       |  18 +++++++++++++-----
 sys/arch/arm/samsung/files.exynos       |   3 +--
 sys/arch/evbarm/odroid/odroid_machdep.c |   8 ++++----
 4 files changed, 28 insertions(+), 30 deletions(-)

diffs (183 lines):

diff -r d1bf6f26371c -r 391f48a09fe4 sys/arch/arm/samsung/exynos_soc.c
--- a/sys/arch/arm/samsung/exynos_soc.c Sun Apr 13 19:04:01 2014 +0000
+++ b/sys/arch/arm/samsung/exynos_soc.c Sun Apr 13 20:45:25 2014 +0000
@@ -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 @@
 
 
 #ifdef ARM_TRUSTZONE_FIRMWARE
-static int
+int
 exynos_do_idle(void)
 {
         exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
@@ -121,10 +121,11 @@
 }
 
 
-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 @@
 }
 
 
-static int
+int
 exynos_cpu_boot(int cpu)
 {
        exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
@@ -155,11 +156,11 @@
  * 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 @@
        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,14 +214,8 @@
 
        return 0;
 }
+#endif /* ARM_TRUSTZONE_FIRMWARE */
 
-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 @@
                        __func__, error);
        KASSERT(exynos_core_bsh == iobase);
 #endif
-#ifdef ARM_TRUSTZONE_FIRMWARE
-       /* setup trustzone handlers */
-       trustzone_firmware_handlers = &exynos_firmware_handlers;
-#endif
 }
 
 
diff -r d1bf6f26371c -r 391f48a09fe4 sys/arch/arm/samsung/exynos_var.h
--- a/sys/arch/arm/samsung/exynos_var.h Sun Apr 13 19:04:01 2014 +0000
+++ b/sys/arch/arm/samsung/exynos_var.h Sun Apr 13 20:45:25 2014 +0000
@@ -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_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_ */
diff -r d1bf6f26371c -r 391f48a09fe4 sys/arch/arm/samsung/files.exynos
--- a/sys/arch/arm/samsung/files.exynos Sun Apr 13 19:04:01 2014 +0000
+++ b/sys/arch/arm/samsung/files.exynos Sun Apr 13 20:45:25 2014 +0000
@@ -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_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
 
diff -r d1bf6f26371c -r 391f48a09fe4 sys/arch/evbarm/odroid/odroid_machdep.c
--- a/sys/arch/evbarm/odroid/odroid_machdep.c   Sun Apr 13 19:04:01 2014 +0000
+++ b/sys/arch/evbarm/odroid/odroid_machdep.c   Sun Apr 13 20:45:25 2014 +0000
@@ -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 @@
 // __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 @@
                        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);
        }



Home | Main Index | Thread Index | Old Index