Subject: Re: Blade 100 USB keyboard problems
To: None <port-sparc64@netbsd.org>
From: Julian Coleman <jdc@coris.org.uk>
List: port-sparc64
Date: 12/16/2005 18:06:02
--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

> Could you try a really recent -current kernel? It should work now.

I hadn't actually checked in the change - I wanted to double check that it
didn't break non-USB machines first (I don't think it will).  I'll test it
on a U1 and check it in (probably tommorow).  I've attached the patch.

J

-- 
  My other computer also runs NetBSD    /        Sailing at Newbiggin
        http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/

--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="consinit.c.patch"

--- sys/arch/sparc64/dev/consinit.c.dist	2005-12-11 15:05:37.000000000 +0000
+++ sys/arch/sparc64/dev/consinit.c	2005-12-16 17:58:59.000000000 +0000
@@ -33,6 +33,7 @@
 
 #include "opt_ddb.h"
 #include "pcons.h"
+#include "ukbd.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -59,6 +60,8 @@
 
 #include <sparc64/dev/cons.h>
 
+#include <dev/usb/ukbdvar.h>
+
 static void prom_cnprobe __P((struct consdev *));
 static void prom_cninit __P((struct consdev *));
 int  prom_cngetc __P((dev_t));
@@ -206,11 +209,19 @@
 
 	if (prom_stdin_node != 0 &&
 	    (prom_getproplen(prom_stdin_node, "keyboard") >= 0)) {
-#if NKBD > 0
-		printf("cninit: kdb/display not configured\n");
+#if NUKBD > 0
+		if ((OF_instance_to_path(prom_stdin(), buffer, sizeof(buffer)) >= 0) &&
+		    (strstr(buffer, "/usb@") != NULL)) {
+			/*
+		 	* If we have a USB keyboard, it will show up as (e.g.)
+		 	*   /pci@1f,0/usb@c,3/keyboard@1	(Blade 100)
+		 	*/
+			consname = "usb-keyboard/display";
+			ukbd_cnattach();
+		} else
 #endif
-		consname = "keyboard/display";
-	} else if (prom_stdout_node != 0 &&
+			consname = "sun-keyboard/display";
+	} else if (prom_stdin_node != 0 &&
 		   (OF_instance_to_path(prom_stdin(), buffer, sizeof(buffer)) >= 0)) {
 		consname = buffer;
 	}

--LZvS9be/3tNcYl/X--