diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-07 14:36:35 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-07 14:36:35 +0000 |
commit | f4de3c1ed2cb9f4d979d70304112128a738aa423 (patch) | |
tree | ae13457442c9ab1f2290d787a2feb08d2549ca88 | |
parent | ea3119c0196f94aa03b381d981ab57e35b1c4a92 (diff) |
Remove a lie, the early boot console does not need any mapping.
In fact we even use the firmware interface for "bsd -c" and "bsd -d".
So do the necessary firmware calls before calling initppc() to be able
to use printf() really early in the boot sequence.
-rw-r--r-- | sys/arch/macppc/macppc/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/ofw_machdep.c | 47 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/ofw_machdep.h | 3 |
3 files changed, 22 insertions, 34 deletions
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index 85ce70b75bf..caf7b518a3c 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.169 2015/03/31 16:00:38 mpi Exp $ */ +/* $OpenBSD: machdep.c,v 1.170 2015/04/07 14:36:34 mpi Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -306,10 +306,6 @@ initppc(startkernel, endkernel, args) (caddr_t)devio_ex_storage, sizeof(devio_ex_storage), EX_NOCOALESCE|EX_NOWAIT); - /* - * Now we can set up the console as mapping is enabled. - */ - ofwconsinit(); /* while using openfirmware, run userconfig */ if (boothowto & RB_CONFIG) { #ifdef BOOT_CONFIG diff --git a/sys/arch/macppc/macppc/ofw_machdep.c b/sys/arch/macppc/macppc/ofw_machdep.c index 8e6c1a00064..18291bdca28 100644 --- a/sys/arch/macppc/macppc/ofw_machdep.c +++ b/sys/arch/macppc/macppc/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.50 2015/03/31 10:36:52 mpi Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.51 2015/04/07 14:36:34 mpi Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */ /* @@ -107,7 +107,7 @@ static struct ofwfb ofwfb; #endif int save_ofw_mapping(void); -void ofw_open_inputs(int); +void ofw_consinit(int); void ofw_read_mem_regions(int, int, int); /* @@ -212,7 +212,7 @@ save_ofw_mapping(void) if ((chosen = OF_finddevice("/chosen")) == -1) return (0); - ofw_open_inputs(chosen); + ofw_consinit(chosen); /* Get memory node. */ memory = OF_finddevice("/memory"); @@ -270,28 +270,13 @@ save_ofw_mapping(void) strcmp(model, "PowerMac12,1") == 0) OF_quiesce(); - return (0); -} - -void -ofw_open_inputs(int chosen) -{ - int stdout, stdin; - - if (OF_getprop(chosen, "stdin", &stdin, sizeof(int)) != sizeof(int)) - return; - - OF_stdin = stdin; - if (OF_getprop(chosen, "stdout", &stdout, sizeof(int)) != sizeof(int)) - return; - - if (stdout == 0) { - /* If the screen is to be console, but not active, open it */ - stdout = OF_open("screen"); - } - OF_stdout = stdout; - + /* + * Next time we'll call the firmware make sure we save and + * restore our MMU settings. + */ fwcall = &fwentry; + + return (0); } static int display_ofh; @@ -651,9 +636,17 @@ struct consdev consdev_ofw = { }; void -ofwconsinit() +ofw_consinit(int chosen) { - struct consdev *cp; - cp = &consdev_ofw; + struct consdev *cp = &consdev_ofw; + + OF_getprop(chosen, "stdin", &OF_stdin, sizeof(OF_stdin)); + OF_getprop(chosen, "stdout", &OF_stdout, sizeof(OF_stdout)); + + /* If the screen is to be console, but not active, open it */ + if (OF_stdout == 0) + OF_stdout = OF_open("screen"); + cn_tab = cp; } + diff --git a/sys/arch/macppc/macppc/ofw_machdep.h b/sys/arch/macppc/macppc/ofw_machdep.h index 8808668ddf7..270aed5a525 100644 --- a/sys/arch/macppc/macppc/ofw_machdep.h +++ b/sys/arch/macppc/macppc/ofw_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.h,v 1.8 2015/03/31 10:36:52 mpi Exp $ */ +/* $OpenBSD: ofw_machdep.h,v 1.9 2015/04/07 14:36:34 mpi Exp $ */ /* * Copyright (c) 2002, Miodrag Vallat. @@ -29,7 +29,6 @@ extern int cons_backlight_available; void ofwconprobe(void); -void ofwconsinit(void); struct rasops_info; void ofwconsswitch(struct rasops_info *); |