[OpenBIOS] [PATCH 2/7] pc_kbd.c: fix up reg property and missing address property

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun May 4 19:49:50 CEST 2014


Create the missing address property for the PC serial keyboard, otherwise
pc_kbd_open() will dereference a NULL pointer when opening the serial keyboard
device.

Similarly fix up the reg property to match the PC serial port which appears to
give values matching those found in SPARC64 device trees.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/drivers/pc_kbd.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/openbios-devel/drivers/pc_kbd.c b/openbios-devel/drivers/pc_kbd.c
index 0f1ee70..49218f8 100644
--- a/openbios-devel/drivers/pc_kbd.c
+++ b/openbios-devel/drivers/pc_kbd.c
@@ -15,6 +15,8 @@
  *          simple polling video/keyboard console functions
  * ****************************************************************** */
 
+#define SER_SIZE 8
+
 /*
  *  keyboard driver
  */
@@ -206,10 +208,21 @@ ob_pc_kbd_init(const char *path, const char *dev_name, uint64_t base,
     push_str("keyboard");
     fword("property");
 
-    PUSH(0);
+    PUSH((base + offset) >> 32);
+    fword("encode-int");
+    PUSH((base + offset) & 0xffffffff);
+    fword("encode-int");
+    fword("encode+");
+    PUSH(SER_SIZE);
     fword("encode-int");
+    fword("encode+");
     push_str("reg");
     fword("property");
+    
+    PUSH(offset);
+    fword("encode-int");
+    push_str("address");
+    fword("property");
 
     chosen = find_dev("/chosen");
     push_str(nodebuff);
-- 
1.7.10.4




More information about the OpenBIOS mailing list