Source-Changes-HG archive

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

[src/netbsd-8]: src/sys Pull up following revision(s) (requested by jmcneill ...



details:   https://anonhg.NetBSD.org/src/rev/7c3ca7c0732b
branches:  netbsd-8
changeset: 850705:7c3ca7c0732b
user:      snj <snj%NetBSD.org@localhost>
date:      Tue Jun 06 16:26:53 2017 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #13):
        sys/arch/arm/fdt/plfb_fdt.c: revision 1.2
        sys/arch/arm/vexpress/vexpress_platform.c: revision 1.3
        sys/arch/evbarm/conf/VEXPRESS_A15: revision 1.13
        sys/arch/evbarm/fdt/fdt_machdep.c: revisions 1.5, 1.6
        sys/dev/ic/pl050.c: revision 1.2
Fix spelling of WS_DEFAULT_FG and WS_KERNEL_FG options.
--
Attach kbd slot to console
--
Allow plfb to be the console device
--
Add support for stdout-path= kernel cmdline option to override the
console device specified in the FDT.
--
Initialize boot_args before bootstrap for the benefit of platform code.
--
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/fdt/plfb_fdt.c               |  29 +++++++++++++++++-
 sys/arch/arm/vexpress/vexpress_platform.c |  16 +++++++++-
 sys/arch/evbarm/conf/VEXPRESS_A15         |   6 +-
 sys/arch/evbarm/fdt/fdt_machdep.c         |  47 ++++++++++++++++++++++++++----
 sys/dev/ic/pl050.c                        |   7 +++-
 5 files changed, 88 insertions(+), 17 deletions(-)

diffs (253 lines):

diff -r 3443c61d4a1c -r 7c3ca7c0732b sys/arch/arm/fdt/plfb_fdt.c
--- a/sys/arch/arm/fdt/plfb_fdt.c       Tue Jun 06 09:31:21 2017 +0000
+++ b/sys/arch/arm/fdt/plfb_fdt.c       Tue Jun 06 16:26:53 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: plfb_fdt.c,v 1.1 2017/06/03 14:50:39 jmcneill Exp $ */
+/* $NetBSD: plfb_fdt.c,v 1.1.2.1 2017/06/06 16:26:53 snj Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.1 2017/06/03 14:50:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.1.2.1 2017/06/06 16:26:53 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -68,6 +68,8 @@
 
 #define        PLFB_BPP                32
 
+static int plfb_console_phandle = -1;
+
 struct plfb_softc {
        struct genfb_softc      sc_gen;
        bus_space_tag_t         sc_bst;
@@ -170,7 +172,8 @@
        plfb_init(sc);
 
        sc->sc_wstype = WSDISPLAY_TYPE_PLFB;
-       prop_dictionary_set_bool(dict, "is_console", false);
+       prop_dictionary_set_bool(dict, "is_console",
+           phandle == plfb_console_phandle);
 
        genfb_init(&sc->sc_gen);
 
@@ -294,3 +297,23 @@
            LCDCONTROL_PWR | LCDCONTROL_EN | LCDCONTROL_BPP_24 |
            LCDCONTROL_BGR);
 }
+
+static int
+plfb_console_match(int phandle)
+{
+       return of_match_compatible(phandle, compatible);
+}
+
+static void
+plfb_console_consinit(struct fdt_attach_args *faa, u_int uart_freq)
+{
+       plfb_console_phandle = faa->faa_phandle;
+       genfb_cnattach();
+}
+
+static const struct fdt_console plfb_fdt_console = {
+       .match = plfb_console_match,
+       .consinit = plfb_console_consinit
+};
+
+FDT_CONSOLE(plfb, &plfb_fdt_console);
diff -r 3443c61d4a1c -r 7c3ca7c0732b sys/arch/arm/vexpress/vexpress_platform.c
--- a/sys/arch/arm/vexpress/vexpress_platform.c Tue Jun 06 09:31:21 2017 +0000
+++ b/sys/arch/arm/vexpress/vexpress_platform.c Tue Jun 06 16:26:53 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.2.2.1 2017/06/06 16:26:53 snj 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.2.2.1 2017/06/06 16:26:53 snj 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
diff -r 3443c61d4a1c -r 7c3ca7c0732b sys/arch/evbarm/conf/VEXPRESS_A15
--- a/sys/arch/evbarm/conf/VEXPRESS_A15 Tue Jun 06 09:31:21 2017 +0000
+++ b/sys/arch/evbarm/conf/VEXPRESS_A15 Tue Jun 06 16:26:53 2017 +0000
@@ -1,5 +1,5 @@
 #
-#      $NetBSD: VEXPRESS_A15,v 1.12 2017/06/03 17:05:23 jmcneill Exp $
+#      $NetBSD: VEXPRESS_A15,v 1.12.2.1 2017/06/06 16:26:53 snj Exp $
 #
 #      ARM Versatile Express A15
 #
@@ -68,9 +68,9 @@
 wsdisplay*     at genfb?
 options        VCONS_DRAW_INTR
 options        WSEMUL_VT100
-options        WS_DEFAULT_FB=WSCOL_WHITE
+options        WS_DEFAULT_FG=WSCOL_WHITE
 options        WS_DEFAULT_BG=WSCOL_BLACK
-options        WS_KERNEL_FB=WSCOL_GREEN
+options        WS_KERNEL_FG=WSCOL_GREEN
 options        WS_KERNEL_BG=WSCOL_BLACK
 options        WSDISPLAY_COMPAT_PCVT
 options        WSDISPLAY_COMPAT_SYSCONS
diff -r 3443c61d4a1c -r 7c3ca7c0732b sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Tue Jun 06 09:31:21 2017 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Tue Jun 06 16:26:53 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.4 2017/06/02 13:53:29 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.4.2.1 2017/06/06 16:26:53 snj 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.4 2017/06/02 13:53:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.4.2.1 2017/06/06 16:26:53 snj Exp $");
 
 #include "opt_machdep.h"
 #include "opt_ddb.h"
@@ -87,6 +87,7 @@
 extern char KERNEL_BASE_phys[];
 #define KERNEL_BASE_PHYS ((paddr_t)KERNEL_BASE_phys)
 
+static void fdt_update_stdout_path(void);
 static void fdt_device_register(device_t, void *);
 static void fdt_reset(void);
 static void fdt_powerdown(void);
@@ -167,6 +168,11 @@
        DPRINTN((uintptr_t)fdt_addr_r, 16);
        DPRINT(">");
 
+       const int chosen = OF_finddevice("/chosen");
+       if (chosen >= 0)
+               OF_getprop(chosen, "bootargs", bootargs, sizeof(bootargs));
+       boot_args = bootargs;
+
        DPRINT(" devmap");
        pmap_devmap_register(plat->devmap());
 
@@ -178,6 +184,12 @@
        if (set_cpufuncs())
                panic("cpu not recognized!");
 
+       /*
+        * If stdout-path is specified on the command line, override the
+        * value in /chosen/stdout-path before initializing console.
+        */
+       fdt_update_stdout_path();
+
        DPRINT(" consinit");
        consinit();
 
@@ -243,13 +255,8 @@
        arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0,
            plat->devmap(), mapallmem_p);
 
-       const int chosen = OF_finddevice("/chosen");
-       if (chosen >= 0)
-               OF_getprop(chosen, "bootargs", bootargs, sizeof(bootargs));
-
        DPRINTF("bootargs: %s\n", bootargs);
 
-       boot_args = bootargs;
        parse_mi_bootargs(boot_args);
 
 #ifdef PMAP_NEED_ALLOC_POOLPAGE
@@ -265,6 +272,32 @@
 
 }
 
+static void
+fdt_update_stdout_path(void)
+{
+       char *stdout_path, *ep;
+       int stdout_path_len;
+       char buf[256];
+
+       const int chosen_off = fdt_path_offset(fdt_data, "/chosen");
+       if (chosen_off == -1)
+               return;
+
+       if (get_bootconf_option(boot_args, "stdout-path",
+           BOOTOPT_TYPE_STRING, &stdout_path) == 0)
+               return;
+
+       ep = strchr(stdout_path, ' ');
+       stdout_path_len = ep ? (ep - stdout_path) : strlen(stdout_path);
+       if (stdout_path_len >= sizeof(buf))
+               return;
+
+       strncpy(buf, stdout_path, stdout_path_len);
+       buf[stdout_path_len] = '\0';
+       fdt_setprop(fdt_data, chosen_off, "stdout-path",
+           buf, stdout_path_len + 1);
+}
+
 void
 consinit(void)
 {
diff -r 3443c61d4a1c -r 7c3ca7c0732b sys/dev/ic/pl050.c
--- a/sys/dev/ic/pl050.c        Tue Jun 06 09:31:21 2017 +0000
+++ b/sys/dev/ic/pl050.c        Tue Jun 06 16:26:53 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pl050.c,v 1.1 2017/06/03 17:03:36 jmcneill Exp $ */
+/* $NetBSD: pl050.c,v 1.1.2.1 2017/06/06 16:26:53 snj Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pl050.c,v 1.1 2017/06/03 17:03:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl050.c,v 1.1.2.1 2017/06/06 16:26:53 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -164,6 +164,9 @@
                        sc->sc_slot = slot;
                        break;
                }
+
+       if (sc->sc_slot == PCKBPORT_KBD_SLOT)
+               pckbport_cnattach(sc, &plkmi_ops, sc->sc_slot);
 }
 
 int



Home | Main Index | Thread Index | Old Index