summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2011-01-23 09:39:16 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2011-01-23 09:39:16 +0000
commit62f7612598b42a14d20d009b113a6775c9692a81 (patch)
treea954646bd92c7958360370371582002b3ab3bbfa
parent1ec7cd16b8364beafeefbcc375736eb7b208802a (diff)
Spinning up secondary CPUs on an MP kernel results in PDC output on the
system LCD. Move LCD initialisation to a mountroot hook in order to avoid PDC output after initialisation. Committing on behalf of kettenis@
-rw-r--r--sys/arch/hppa/dev/lcd.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/sys/arch/hppa/dev/lcd.c b/sys/arch/hppa/dev/lcd.c
index 7e303170a2e..ccedccf6363 100644
--- a/sys/arch/hppa/dev/lcd.c
+++ b/sys/arch/hppa/dev/lcd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcd.c,v 1.2 2007/07/20 22:13:45 kettenis Exp $ */
+/* $OpenBSD: lcd.c,v 1.3 2011/01/23 09:39:15 jsing Exp $ */
/*
* Copyright (c) 2007 Mark Kettenis
@@ -56,6 +56,7 @@ struct cfdriver lcd_cd = {
NULL, "lcd", DV_DULL
};
+void lcd_mountroot(void *);
void lcd_write(struct lcd_softc *, const char *);
void lcd_blink(void *, int);
void lcd_blink_finish(void *);
@@ -99,18 +100,26 @@ lcd_attach(struct device *parent, struct device *self, void *aux)
for (i = 0; i < 3; i++)
sc->sc_heartbeat[i] = pdc_lcd->heartbeat[i];
+ timeout_set(&sc->sc_to, lcd_blink_finish, sc);
+
+ sc->sc_blink.bl_func = lcd_blink;
+ sc->sc_blink.bl_arg = sc;
+ blink_led_register(&sc->sc_blink);
+
+ mountroothook_establish(lcd_mountroot, sc);
+}
+
+void
+lcd_mountroot(void *arg)
+{
+ struct lcd_softc *sc = arg;
+
bus_space_write_1(sc->sc_iot, sc->sc_cmdh, 0, LCD_CLS);
delay(100 * sc->sc_delay);
bus_space_write_1(sc->sc_iot, sc->sc_cmdh, 0, LCD_LOCATE(0, 0));
delay(sc->sc_delay);
lcd_write(sc, "OpenBSD/" MACHINE);
-
- timeout_set(&sc->sc_to, lcd_blink_finish, sc);
-
- sc->sc_blink.bl_func = lcd_blink;
- sc->sc_blink.bl_arg = sc;
- blink_led_register(&sc->sc_blink);
}
void