[OpenBIOS] r452 - in openbios-devel: arch/ppc/qemu drivers

svn at openbios.org svn at openbios.org
Sat Feb 14 10:44:55 CET 2009


Author: blueswirl
Date: 2009-02-14 10:44:55 +0100 (Sat, 14 Feb 2009)
New Revision: 452

Modified:
   openbios-devel/arch/ppc/qemu/init.c
   openbios-devel/arch/ppc/qemu/qemu.fs
   openbios-devel/drivers/escc.c
Log:
Support for Qemu -nographic flag

Modified: openbios-devel/arch/ppc/qemu/init.c
===================================================================
--- openbios-devel/arch/ppc/qemu/init.c	2009-02-12 19:39:47 UTC (rev 451)
+++ openbios-devel/arch/ppc/qemu/init.c	2009-02-14 09:44:55 UTC (rev 452)
@@ -414,6 +414,7 @@
 	uint64_t ram_size;
         const struct cpudef *cpu;
 	char buf[64];
+        const char *stdin_path, *stdout_path;
 
 	/* set device tree root info */
 
@@ -560,6 +561,50 @@
 	}
 #endif
 
+        if (fw_cfg_read_i16(FW_CFG_NOGRAPHIC)) {
+                if (CONFIG_SERIAL_PORT) {
+                       stdin_path = "scca";
+                       stdout_path = "scca";
+                } else {
+                       stdin_path = "sccb";
+                       stdout_path = "sccb";
+                }
+        } else {
+                stdin_path = "adb-keyboard";
+                stdout_path = "screen";
+        }
+
+        push_str("/chosen");
+        fword("find-device");
+
+        push_str(stdin_path);
+        fword("open-dev");
+        fword("encode-int");
+        push_str("stdin");
+        fword("property");
+
+        push_str(stdout_path);
+        fword("open-dev");
+        fword("encode-int");
+        push_str("stdout");
+        fword("property");
+
+        push_str(stdin_path);
+        fword("pathres-resolve-aliases");
+        push_str("input-device");
+        fword("$setenv");
+
+        push_str(stdout_path);
+        fword("pathres-resolve-aliases");
+        push_str("output-device");
+        fword("$setenv");
+
+        push_str(stdin_path);
+        fword("input");
+
+        push_str(stdout_path);
+        fword("output");
+
 #if 0
 	if( getbool("tty-interface?") == 1 )
 #endif

Modified: openbios-devel/arch/ppc/qemu/qemu.fs
===================================================================
--- openbios-devel/arch/ppc/qemu/qemu.fs	2009-02-12 19:39:47 UTC (rev 451)
+++ openbios-devel/arch/ppc/qemu/qemu.fs	2009-02-14 09:44:55 UTC (rev 452)
@@ -37,26 +37,15 @@
 :noname
   " rtc" " rtc" preopen
   " memory" " /memory" preopen
-  \ " stdout" " /packages/terminal-emulator" preopen
-  " stdout" " screen" preopen
-  " stdin" " adb-keyboard" preopen
-
 ; SYSTEM-initializer
 
 
 \ use the tty interface if available
 : activate-tty-interface
   " /packages/terminal-emulator" find-dev if drop
-    " adb-keyboard" " input-device" $setenv
-    " screen" " output-device" $setenv
   then
 ;
 
-:noname
-  " keyboard" input
-; CONSOLE-IN-initializer
-
-
 \ -------------------------------------------------------------------------
 \ pre-booting
 \ -------------------------------------------------------------------------

Modified: openbios-devel/drivers/escc.c
===================================================================
--- openbios-devel/drivers/escc.c	2009-02-12 19:39:47 UTC (rev 451)
+++ openbios-devel/drivers/escc.c	2009-02-14 09:44:55 UTC (rev 452)
@@ -140,7 +140,7 @@
     len = POP();
     addr = (char *)POP();
 
-    if (len != 1)
+    if (len < 1)
         printk("escc_read: bad len, addr %x len %x\n", (unsigned int)addr, len);
 
     if (uart_charav(*address)) {
@@ -175,19 +175,17 @@
 static void
 escc_open(unsigned long *address)
 {
+#ifdef CONFIG_DRIVER_ESCC_SUN
     int len;
     phandle_t ph;
     unsigned long *prop;
-#ifdef CONFIG_DRIVER_ESCC_SUN
     char *args;
-#endif
 
     fword("my-self");
     fword("ihandle>phandle");
     ph = (phandle_t)POP();
     prop = (unsigned long *)get_property(ph, "address", &len);
     *address = *prop;
-#ifdef CONFIG_DRIVER_ESCC_SUN
     fword("my-args");
     args = pop_fstr_copy();
     if (args) {
@@ -196,6 +194,8 @@
         //printk("escc_open: address %lx, args %s\n", *address, args);
         free(args);
     }
+#else
+    *address = (unsigned long)serial_dev; // XXX
 #endif
     RET ( -1 );
 }
@@ -295,7 +295,7 @@
     len = POP();
     addr = (unsigned char *)POP();
 
-    if (len != 1)
+    if (len < 1)
         printk("escc_read: bad len, addr %x len %x\n", (unsigned int)addr, len);
 
     if (keyboard_dataready()) {




More information about the OpenBIOS mailing list