[OpenBIOS] r398 - openbios-devel/drivers

svn at openbios.org svn at openbios.org
Tue Jan 13 09:05:51 CET 2009


Author: laurent
Date: 2009-01-13 09:05:51 +0100 (Tue, 13 Jan 2009)
New Revision: 398

Modified:
   openbios-devel/drivers/escc.c
Log:
escc: add "AAPL," and "reg" properties (allow to use it with linux)

Modified: openbios-devel/drivers/escc.c
===================================================================
--- openbios-devel/drivers/escc.c	2009-01-13 07:49:44 UTC (rev 397)
+++ openbios-devel/drivers/escc.c	2009-01-13 08:05:51 UTC (rev 398)
@@ -363,6 +363,7 @@
     char buf[64], tty[32];
     phandle_t dnode, aliases;
     int len;
+    cell props[2];
 
     /* add device */
 
@@ -393,7 +394,22 @@
     snprintf(buf + len, sizeof(buf) - len, "CHRP,es2");
     set_property(dnode, "compatible", buf, len + 9);
 
+    props[0] = IO_ESCC_OFFSET + offset * 0x20;
+    props[1] = 0x00000020;
+    set_property(dnode, "reg", (char *)&props, 2 * sizeof(cell));
+
+    props[0] = addr + IO_ESCC_OFFSET + offset * 0x20;
+    OLDWORLD(set_property(dnode, "AAPL,address",
+            (char *)&props, 1 * sizeof(cell)));
+
+    props[0] = 0x00000010 - offset;
+    OLDWORLD(set_property(dnode, "AAPL,interrupts",
+            (char *)&props, 1 * sizeof(cell)));
+
     device_end();
+
+    uart_init_line((unsigned char*)addr + IO_ESCC_OFFSET + offset * 0x20,
+                   CONFIG_SERIAL_SPEED);
 }
 
 void
@@ -424,10 +440,10 @@
 
     fword("finish-device");
 
-    escc_add_channel(buf, "a", IO_ESCC_OFFSET, 2);
-    escc_add_channel(buf, "b", IO_ESCC_OFFSET, 0);
+    escc_add_channel(buf, "a", addr, 1);
+    escc_add_channel(buf, "b", addr, 0);
 
-    /* Reinitialize uart */
-    uart_init(addr + IO_ESCC_OFFSET, CONFIG_SERIAL_SPEED);
+    serial_dev = (unsigned char *)addr + IO_ESCC_OFFSET +
+                 0x20 * CONFIG_SERIAL_PORT;
 }
 #endif




More information about the OpenBIOS mailing list