Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm Start code now updates a global variable fdt...



details:   https://anonhg.NetBSD.org/src/rev/44593f7b2a38
branches:  trunk
changeset: 830269:44593f7b2a38
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Mar 03 13:46:32 2018 +0000

description:
Start code now updates a global variable fdt_addr_r to handle differences
in boot protocol (think arm64)

diffstat:

 sys/arch/evbarm/exynos/exynos_start.S     |  17 +++++++++++++----
 sys/arch/evbarm/fdt/fdt_machdep.c         |  11 +++++++----
 sys/arch/evbarm/rpi/rpi2_start.S          |  13 ++++++++++++-
 sys/arch/evbarm/rpi/rpi_start.S           |  11 +++++++++--
 sys/arch/evbarm/sunxi/sunxi_start.S       |  15 +++++++++++++--
 sys/arch/evbarm/tegra/tegra_start.S       |  15 +++++++++++++--
 sys/arch/evbarm/ti/ti_start.S             |  15 +++++++++++++--
 sys/arch/evbarm/vexpress/vexpress_start.S |  15 +++++++++++++--
 8 files changed, 93 insertions(+), 19 deletions(-)

diffs (truncated from 336 to 300 lines):

diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/exynos/exynos_start.S
--- a/sys/arch/evbarm/exynos/exynos_start.S     Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/exynos/exynos_start.S     Sat Mar 03 13:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exynos_start.S,v 1.4 2017/06/10 23:20:56 jmcneill Exp $        */
+/*     $NetBSD: exynos_start.S,v 1.5 2018/03/03 13:46:32 skrll Exp $   */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
 #include "opt_cputypes.h"
 #include "opt_multiprocessor.h"
 #include "opt_arm_debug.h"
+#include "opt_fdt.h"
 
 #include <arm/asm.h>
 #include <arm/armreg.h>
@@ -45,7 +46,7 @@
 
 #include <evbarm/exynos/platform.h>
 
-RCSID("$NetBSD: exynos_start.S,v 1.4 2017/06/10 23:20:56 jmcneill Exp $")
+RCSID("$NetBSD: exynos_start.S,v 1.5 2018/03/03 13:46:32 skrll Exp $")
 
 
 #if defined(VERBOSE_INIT_ARM)
@@ -95,10 +96,18 @@
         */
        movw    r4, #:lower16:uboot_args
        movt    r4, #:upper16:uboot_args
-#if KERNEL_BASE_VOFFSET != 0
        sub     r4, r4, #KERNEL_BASE_VOFFSET
+       stmia   r4, {r0-r3}                     // Save the arguments
+
+#ifdef FDT
+       /*
+        * ARM boot protocol has FDT address in r2
+        */
+       movw    r4, #:lower16:fdt_addr_r
+       movt    r4, #:upper16:fdt_addr_r
+       sub     r4, r4, #KERNEL_BASE_VOFFSET
+       str     r2, [r4]
 #endif
-       stmia   r4, {r0-r3}                     // Save the arguments
 
        /* Add DTB PA (1MB) from r2 to MMU init table */
        movw    r3, #:lower16:(L1_S_SIZE - 1)           /* align DTB PA to 1M */
diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Sat Mar 03 13:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.19 2017/12/21 08:28:55 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.20 2018/03/03 13:46:32 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.19 2017/12/21 08:28:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.20 2018/03/03 13:46:32 skrll Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -87,7 +87,11 @@
 BootConfig bootconfig;
 char bootargs[FDT_MAX_BOOT_STRING] = "";
 char *boot_args = NULL;
-u_int uboot_args[4] = { 0 };   /* filled in by xxx_start.S (not in bss) */
+/*
+ * filled in by xxx_start.S (must not be in bss)
+ */
+unsigned long  uboot_args[4] = { 0 };
+const uint8_t *fdt_addr_r = (const uint8_t *)0xdeadc0de;
 
 static char fdt_memory_ext_storage[EXTENT_FIXED_STORAGE_SIZE(DRAM_BLOCKS)];
 static struct extent *fdt_memory_ext;
@@ -333,7 +337,6 @@
        uint64_t memory_addr, memory_size;
 
        /* Load FDT */
-       const uint8_t *fdt_addr_r = (const uint8_t *)uboot_args[2];
        int error = fdt_check_header(fdt_addr_r);
        if (error == 0) {
                error = fdt_move(fdt_addr_r, fdt_data, sizeof(fdt_data));
diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/rpi/rpi2_start.S
--- a/sys/arch/evbarm/rpi/rpi2_start.S  Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/rpi/rpi2_start.S  Sat Mar 03 13:46:32 2018 +0000
@@ -32,13 +32,14 @@
 #include "opt_cputypes.h"
 #include "opt_multiprocessor.h"
 #include "opt_arm_debug.h"
+#include "opt_fdt.h"
 
 #include <arm/asm.h>
 #include <arm/armreg.h>
 
 #include "assym.h"
 
-RCSID("$NetBSD: rpi2_start.S,v 1.4 2017/12/10 21:38:27 skrll Exp $")
+RCSID("$NetBSD: rpi2_start.S,v 1.5 2018/03/03 13:46:32 skrll Exp $")
 
 #if defined(KERNEL_BASES_EQUAL)
 #define CALL(f)                bl      _C_LABEL(f)
@@ -100,6 +101,16 @@
 
        stmia   r4, {r0-r3}             // Save the arguments
 
+#ifdef FDT
+       /*
+        * ARM boot protocol has FDT address in r2
+        */
+       movw    r4, #:lower16:fdt_addr_r
+       movt    r4, #:upper16:fdt_addr_r
+       sub     r4, r4, #KERNEL_BASE_VOFFSET
+       str     r2, [r4]
+#endif
+
        /*
         * Setup the CPU
         */
diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/rpi/rpi_start.S
--- a/sys/arch/evbarm/rpi/rpi_start.S   Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/rpi/rpi_start.S   Sat Mar 03 13:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_start.S,v 1.16 2018/01/01 11:28:33 skrll Exp $     */
+/*     $NetBSD: rpi_start.S,v 1.17 2018/03/03 13:46:32 skrll Exp $     */
 
 /*
  * Copyright (c) 2002, 2003  Genetec Corporation.  All rights reserved.
@@ -90,12 +90,13 @@
 #include "opt_arm_debug.h"
 #include "opt_cputypes.h"
 #include "opt_cpuoptions.h"
+#include "opt_fdt.h"
 
 #include <machine/asm.h>
 #include <arm/armreg.h>
 #include "assym.h"
 
-RCSID("$NetBSD: rpi_start.S,v 1.16 2018/01/01 11:28:33 skrll Exp $")
+RCSID("$NetBSD: rpi_start.S,v 1.17 2018/03/03 13:46:32 skrll Exp $")
 
 
 #if defined(VERBOSE_INIT_ARM)
@@ -139,6 +140,10 @@
        ldr     r8, Luboot_args
        stmia   r8!, {r0-r3}
 
+#ifdef FDT
+       ldr     r8, Lfdt_addr_r
+       str     r2, [r8]
+#endif
        mrs     r0, cpsr
        bic     r0, r0, #PSR_MODE
        orr     r0, r0, #(I32_bit | F32_bit | PSR_SVC32_MODE)
@@ -296,6 +301,8 @@
 
 Luboot_args:
        .word   uboot_args
+Lfdt_addr_r:
+       .word   fdt_addr_r
 
 /*
  * Coprocessor register initialization values
diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/sunxi/sunxi_start.S
--- a/sys/arch/evbarm/sunxi/sunxi_start.S       Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/sunxi/sunxi_start.S       Sat Mar 03 13:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_start.S,v 1.2 2017/11/08 19:49:26 skrll Exp $ */
+/* $NetBSD: sunxi_start.S,v 1.3 2018/03/03 13:46:32 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2015 The NetBSD Foundation, Inc.
@@ -35,12 +35,13 @@
 #include "opt_multiprocessor.h"
 #include "opt_arm_debug.h"
 #include "opt_fdt_arm.h"
+#include "opt_fdt.h"
 
 #include <arm/asm.h>
 #include <arm/armreg.h>
 #include "assym.h"
 
-RCSID("$NetBSD: sunxi_start.S,v 1.2 2017/11/08 19:49:26 skrll Exp $")
+RCSID("$NetBSD: sunxi_start.S,v 1.3 2018/03/03 13:46:32 skrll Exp $")
 
 #if defined(VERBOSE_INIT_ARM) && defined(CONSADDR)
 #define        XPUTC(n)        mov r0, n; bl xputc
@@ -94,6 +95,16 @@
 
        stmia   r4, {r0-r3}             // Save the arguments
 
+#ifdef FDT
+       /*
+        * ARM boot protocol has FDT address in r2
+        */
+       movw    r4, #:lower16:fdt_addr_r
+       movt    r4, #:upper16:fdt_addr_r
+       sub     r4, r4, #KERNEL_BASE_VOFFSET
+       str     r2, [r4]
+#endif
+
        /* Add DTB PA (1MB) from r2 to MMU init table */
        movw    r3, #:lower16:(L1_S_SIZE - 1)           /* align DTB PA to 1M */
        movt    r3, #:upper16:(L1_S_SIZE - 1)
diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/tegra/tegra_start.S
--- a/sys/arch/evbarm/tegra/tegra_start.S       Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/tegra/tegra_start.S       Sat Mar 03 13:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_start.S,v 1.15 2017/05/30 22:55:27 jmcneill Exp $ */
+/* $NetBSD: tegra_start.S,v 1.16 2018/03/03 13:46:33 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2015 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
 #include "opt_multiprocessor.h"
 #include "opt_arm_debug.h"
 #include "opt_fdt_arm.h"
+#include "opt_fdt.h"
 
 #include <arm/asm.h>
 #include <arm/armreg.h>
@@ -42,7 +43,7 @@
 
 #include <arm/nvidia/tegra_reg.h>
 
-RCSID("$NetBSD: tegra_start.S,v 1.15 2017/05/30 22:55:27 jmcneill Exp $")
+RCSID("$NetBSD: tegra_start.S,v 1.16 2018/03/03 13:46:33 skrll Exp $")
 
 #if defined(VERBOSE_INIT_ARM) && defined(CONSADDR)
 #define        XPUTC(n)        mov r0, n; bl xputc
@@ -96,6 +97,16 @@
 
        stmia   r4, {r0-r3}             // Save the arguments
 
+#ifdef FDT
+       /*
+        * ARM boot protocol has FDT address in r2
+        */
+       movw    r4, #:lower16:fdt_addr_r
+       movt    r4, #:upper16:fdt_addr_r
+       sub     r4, r4, #KERNEL_BASE_VOFFSET
+       str     r2, [r4]
+#endif
+
        /*
         * Turn on the SMP bit
         */
diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/ti/ti_start.S
--- a/sys/arch/evbarm/ti/ti_start.S     Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/ti/ti_start.S     Sat Mar 03 13:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_start.S,v 1.1 2017/10/26 01:16:32 jakllsch Exp $ */
+/* $NetBSD: ti_start.S,v 1.2 2018/03/03 13:46:33 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2015 The NetBSD Foundation, Inc.
@@ -34,6 +34,7 @@
 #include "opt_multiprocessor.h"
 #include "opt_arm_debug.h"
 #include "opt_fdt_arm.h"
+#include "opt_fdt.h"
 
 #include <arm/asm.h>
 #include <arm/armreg.h>
@@ -41,7 +42,7 @@
 
 #include <arch/arm/ti/ti_platform.h>
 
-RCSID("$NetBSD: ti_start.S,v 1.1 2017/10/26 01:16:32 jakllsch Exp $")
+RCSID("$NetBSD: ti_start.S,v 1.2 2018/03/03 13:46:33 skrll Exp $")
 
 #if defined(VERBOSE_INIT_ARM) && defined(CONSADDR)
 #define        XPUTC(n)        mov r0, n; bl xputc
@@ -95,6 +96,16 @@
 
        stmia   r4, {r0-r3}             // Save the arguments
 
+#ifdef FDT
+       /*
+        * ARM boot protocol has FDT address in r2
+        */
+       movw    r4, #:lower16:fdt_addr_r
+       movt    r4, #:upper16:fdt_addr_r
+       sub     r4, r4, #KERNEL_BASE_VOFFSET
+       str     r2, [r4]
+#endif
+
        /* Add DTB PA (1MB) from r2 to MMU init table */
        movw    r3, #:lower16:(L1_S_SIZE - 1)           /* align DTB PA to 1M */
        movt    r3, #:upper16:(L1_S_SIZE - 1)
diff -r a397bfe78686 -r 44593f7b2a38 sys/arch/evbarm/vexpress/vexpress_start.S
--- a/sys/arch/evbarm/vexpress/vexpress_start.S Sat Mar 03 11:23:24 2018 +0000
+++ b/sys/arch/evbarm/vexpress/vexpress_start.S Sat Mar 03 13:46:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vexpress_start.S,v 1.5 2017/06/04 19:15:46 jmcneill Exp $      */
+/*     $NetBSD: vexpress_start.S,v 1.6 2018/03/03 13:46:33 skrll Exp $ */
 



Home | Main Index | Thread Index | Old Index