Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/vexpress Allow 'console=fb' to act as a shortcu...



details:   https://anonhg.NetBSD.org/src/rev/d89d5e4e8973
branches:  trunk
changeset: 824481:d89d5e4e8973
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Jun 06 09:56:57 2017 +0000

description:
Allow 'console=fb' to act as a shortcut on vexpress for
'stdout-path=/smb@08000000/motherboard/iofpga@3,00000000/clcd@1f0000'

diffstat:

 sys/arch/arm/vexpress/vexpress_platform.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 6a1e0a33cef5 -r d89d5e4e8973 sys/arch/arm/vexpress/vexpress_platform.c
--- a/sys/arch/arm/vexpress/vexpress_platform.c Tue Jun 06 09:56:00 2017 +0000
+++ b/sys/arch/arm/vexpress/vexpress_platform.c Tue Jun 06 09:56:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vexpress_platform.c,v 1.2 2017/06/02 20:16:05 jmcneill Exp $ */
+/* $NetBSD: vexpress_platform.c,v 1.3 2017/06/06 09:56:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_fdt_arm.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.2 2017/06/02 20:16:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vexpress_platform.c,v 1.3 2017/06/06 09:56:57 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -55,6 +55,10 @@
 
 #include <arm/vexpress/vexpress_platform.h>
 
+#include <libfdt.h>
+
+#define        VEXPRESS_CLCD_NODE_PATH \
+       "/smb@08000000/motherboard/iofpga@3,00000000/clcd@1f0000"
 #define        VEXPRESS_REF_FREQ       24000000
 
 #define        DEVMAP_ALIGN(a) ((a) & ~L1_S_OFFSET)
@@ -165,6 +169,14 @@
        arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU);
 
        vexpress_a15_smp_init();
+
+       if (match_bootconf_option(boot_args, "console", "fb")) {
+               void *fdt_data = __UNCONST(fdtbus_get_data());
+               const int chosen_off = fdt_path_offset(fdt_data, "/chosen");
+               if (chosen_off >= 0)
+                       fdt_setprop_string(fdt_data, chosen_off, "stdout-path",
+                           VEXPRESS_CLCD_NODE_PATH);
+       }
 }
 
 static void



Home | Main Index | Thread Index | Old Index