diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-22 15:36:52 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-22 15:36:52 +1000 |
commit | 529294d59fdc77bf15f00f2308bbeb73e03e7042 (patch) | |
tree | e04c555d8c1ed398b1543442e0f2d4d82b360acb /arch/ppc64/kernel/btext.c | |
parent | f7abbc190b0edec34627d5348ba1d5fa5577da77 (diff) | |
download | op-kernel-dev-529294d59fdc77bf15f00f2308bbeb73e03e7042.zip op-kernel-dev-529294d59fdc77bf15f00f2308bbeb73e03e7042.tar.gz |
ppc64: Rearrange btext initialization for consistency with ppc32
Moved init_boot_display from arch/ppc64/kernel/pmac_setup.c to
arch/ppc64/kernel/btext.c and declared it in asm-ppc64/btext.h.
Call it from init_early rather than pmac_init_early.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/kernel/btext.c')
-rw-r--r-- | arch/ppc64/kernel/btext.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/btext.c b/arch/ppc64/kernel/btext.c index b6fbfbe..506a378 100644 --- a/arch/ppc64/kernel/btext.c +++ b/arch/ppc64/kernel/btext.c @@ -18,6 +18,7 @@ #include <asm/io.h> #include <asm/lmb.h> #include <asm/processor.h> +#include <asm/udbg.h> #undef NO_SCROLL @@ -131,6 +132,47 @@ int btext_initialize(struct device_node *np) return 0; } +static void btext_putc(unsigned char c) +{ + btext_drawchar(c); +} + +void __init init_boot_display(void) +{ + char *name; + struct device_node *np = NULL; + int rc = -ENODEV; + + printk("trying to initialize btext ...\n"); + + name = (char *)get_property(of_chosen, "linux,stdout-path", NULL); + if (name != NULL) { + np = of_find_node_by_path(name); + if (np != NULL) { + if (strcmp(np->type, "display") != 0) { + printk("boot stdout isn't a display !\n"); + of_node_put(np); + np = NULL; + } + } + } + if (np) + rc = btext_initialize(np); + if (rc) { + for (np = NULL; (np = of_find_node_by_type(np, "display"));) { + if (get_property(np, "linux,opened", NULL)) { + printk("trying %s ...\n", np->full_name); + rc = btext_initialize(np); + printk("result: %d\n", rc); + } + if (rc == 0) + break; + } + } + if (rc == 0 && udbg_putc == NULL) + udbg_putc = btext_putc; +} + /* Calc the base address of a given point (x,y) */ static unsigned char * calc_base(int x, int y) |