summaryrefslogtreecommitdiff
path: root/sys/arch/armv7
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-04-10 12:24:14 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-04-10 12:24:14 +0000
commitb8eb3fc346cdf9eb8dab5d711365207ebfeed65f (patch)
tree741e367a35720908786bd7f6ab38e045978dd155 /sys/arch/armv7
parentd214125c5b96da9ab6be83f7767887ce527e4d1d (diff)
Don't try to get a board name string before attaching mainbus with the
platform abstraction. The string is only displayed when attaching the soc abstractions so this is not needed. When arm mainbus becomes aware of fdt it can show the /model property itself.
Diffstat (limited to 'sys/arch/armv7')
-rw-r--r--sys/arch/armv7/armv7/armv7.c22
-rw-r--r--sys/arch/armv7/armv7/autoconf.c12
2 files changed, 18 insertions, 16 deletions
diff --git a/sys/arch/armv7/armv7/armv7.c b/sys/arch/armv7/armv7/armv7.c
index 53927a47ae5..bf7735c2806 100644
--- a/sys/arch/armv7/armv7/armv7.c
+++ b/sys/arch/armv7/armv7/armv7.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7.c,v 1.11 2015/07/15 21:09:40 jsg Exp $ */
+/* $OpenBSD: armv7.c,v 1.12 2016/04/10 12:24:13 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -18,6 +18,9 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/types.h>
+#include <sys/malloc.h>
+
#define _ARM32_BUS_DMA_PRIVATE
#include <machine/bus.h>
#include <arm/armv7/armv7var.h>
@@ -100,14 +103,23 @@ armv7_attach(struct device *parent, struct device *self, void *aux)
{
struct armv7_softc *sc = (struct armv7_softc *)self;
struct board_dev *bd;
+ int len;
+ const char *name = platform_board_name();
+
+ if (hw_prod == NULL && name != NULL) {
+ len = strlen(name) + 1;
+ hw_prod = malloc(len, M_DEVBUF, M_NOWAIT);
+ if (hw_prod)
+ strlcpy(hw_prod, name, len);
+ }
- sc->sc_board_devs = platform_board_devs();
-
- if (hw_prod)
- printf(": %s\n", hw_prod);
+ if (name != NULL)
+ printf(": %s\n", name);
else
printf(": UNKNOWN BOARD %u\n", board_id);
+ sc->sc_board_devs = platform_board_devs();
+
/* Directly configure on-board devices (dev* in config file). */
for (bd = sc->sc_board_devs; bd->name != NULL; bd++) {
struct armv7_dev *ad = armv7_find_dev(bd->name, bd->unit);
diff --git a/sys/arch/armv7/armv7/autoconf.c b/sys/arch/armv7/armv7/autoconf.c
index 1c0e4895d67..be6257b37db 100644
--- a/sys/arch/armv7/armv7/autoconf.c
+++ b/sys/arch/armv7/armv7/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.3 2015/05/19 03:30:54 jsg Exp $ */
+/* $OpenBSD: autoconf.c,v 1.4 2016/04/10 12:24:13 jsg Exp $ */
/* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */
/*
@@ -48,7 +48,6 @@
#include <sys/device.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#include <sys/malloc.h>
#include <machine/bootconfig.h>
#include <machine/intr.h>
@@ -75,15 +74,6 @@ device_register(struct device *dev, void *aux)
void
cpu_configure(void)
{
- int len;
- const char *name = platform_board_name();
- if (name) {
- len = strlen(name) + 1;
- hw_prod = malloc(len, M_DEVBUF, M_NOWAIT);
- if (hw_prod)
- strlcpy(hw_prod, name, len);
- }
-
softintr_init();
/*