main attachment, the serial port is now longer recognized as console.
To fix this, store the OFW node of the initial console and check it
in the attachment driver.
ok kettenis@
-/* $OpenBSD: armv7_machdep.c,v 1.35 2016/08/08 19:27:12 kettenis Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.36 2016/08/15 21:04:32 patrick Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
#include <dev/cons.h>
#include <dev/ofw/fdt.h>
+#include <dev/ofw/openfirm.h>
#include <net/if.h>
int comcnspeed = CONSPEED;
int comcnmode = CONMODE;
+int stdout_node = 0;
+
/*
* void boot(int howto, char *bootstr)
*
/* Lookup the physical address of the interface. */
if (stdout) {
node = fdt_find_node(stdout);
- if (node && fdt_is_compatible(node, name))
+ if (node && fdt_is_compatible(node, name)) {
+ stdout_node = OF_finddevice(stdout);
return (node);
+ }
}
return (NULL);
-/* $OpenBSD: armv7_machdep.h,v 1.8 2016/06/08 15:27:05 jsg Exp $ */
+/* $OpenBSD: armv7_machdep.h,v 1.9 2016/08/15 21:04:32 patrick Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
#ifndef __PLATFORMVAR_H__
#define __PLATFORMVAR_H__
+extern int stdout_node;
+
void platform_init(void);
void platform_powerdown(void);
void platform_watchdog_reset(void);
-/* $OpenBSD: com_fdt.c,v 1.2 2016/08/15 14:17:34 patrick Exp $ */
+/* $OpenBSD: com_fdt.c,v 1.3 2016/08/15 21:04:32 patrick Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
* All rights reserved.
sc->sc.sc_frequency = 48000000;
sc->sc.sc_uarttype = COM_UART_TI16750;
+ if (stdout_node == faa->fa_node) {
+ SET(sc->sc.sc_hwflags, COM_HW_CONSOLE);
+ SET(sc->sc.sc_swflags, COM_SW_SOFTCAR);
+ }
+
if (bus_space_map(sc->sc.sc_iot, sc->sc.sc_iobase,
faa->fa_reg[0].size, 0, &sc->sc.sc_ioh)) {
printf("%s: bus_space_map failed\n", __func__);