Port-acorn32 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Booting on RiscPC





On 05/04/2019 18:22, Mike Pumford wrote:

I'll keep digging to see if I can come up with a patch.

Okay. Assuming you are still using the same actual physical keyboard as you were with NetBSD 3 the issue must be in getting the command to the keyboard. If its a different keyboard its possible you are using one of the rare keyboards that doesn't support scan code set 1.

This patch gives commands a bit longer to get through to the keyboard. If that doesn't work I can switch the code over to using software translation (which should work no matter what the keyboard is). I have tested the software translation and it seems to do no harm on my system where the keyboard already works :)

Mike
Index: sys/arch/arm/iomd/iomdkbc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/iomd/iomdkbc.c,v
retrieving revision 1.5
diff -u -r1.5 iomdkbc.c
--- sys/arch/arm/iomd/iomdkbc.c	14 May 2012 10:38:08 -0000	1.5
+++ sys/arch/arm/iomd/iomdkbc.c	7 Apr 2019 22:57:53 -0000
@@ -143,10 +143,8 @@
 			t->t_iot = ka->ka_iot;
 			t->t_ioh[PCKBPORT_KBD_SLOT] = ka->ka_ioh;
 		}
-		t->t_rxih[PCKBPORT_KBD_SLOT] = intr_claim(ka->ka_rxirq,
-		    IPL_TTY, device_xname(sc->sc_dev), iomdkbc_intr, t);
+		/* Setup interrupt vector to claim later */
 		t->t_rxirq[PCKBPORT_KBD_SLOT] = ka->ka_rxirq;
-		disable_irq(t->t_rxirq[PCKBPORT_KBD_SLOT]);
 		sc->sc_id = t;
 		t->t_sc = sc;
 		t->t_pt = pckbport_attach(t, &iomdkbc_ops);
@@ -165,10 +163,8 @@
 		t->t_haveport[PCKBPORT_AUX_SLOT] = 1;
 		t->t_iot = pa->pa_iot;
 		t->t_ioh[PCKBPORT_AUX_SLOT] = pa->pa_ioh;
-		t->t_rxih[PCKBPORT_AUX_SLOT] = intr_claim(pa->pa_irq,
-		    IPL_TTY, device_xname(sc->sc_dev), iomdkbc_intr, t);
+		/* Setup interrupt vector to claim later */
 		t->t_rxirq[PCKBPORT_AUX_SLOT] = pa->pa_irq;
-		disable_irq(t->t_rxirq[PCKBPORT_AUX_SLOT]);
 		sc->sc_id = t;
 		t->t_sc = sc;
 		if (t->t_pt == NULL)
@@ -185,12 +181,13 @@
 	bus_space_handle_t ioh = t->t_ioh[slot];
 	int timeout;
 
-	timeout = 10000;
+	timeout = 20000;
 	while ((bus_space_read_1(iot, ioh, IOMDKBC_CR) &
 		   IOMDKBC_TXE) == 0) {
 		DELAY(10);
 		if (--timeout == 0) return 0;
 	}
+	DELAY(10);
 
         bus_space_write_1(iot, ioh, IOMDKBC_DR, cmd);
 	return 1;
@@ -204,12 +201,13 @@
 	bus_space_handle_t ioh = t->t_ioh[slot];
 	int timeout;
 
-	timeout = 10000;
+	timeout = 20000;
 	while ((bus_space_read_1(iot, ioh, IOMDKBC_CR) &
 		   IOMDKBC_RXF) == 0) {
 		DELAY(10);
 		if (--timeout == 0) return -1;
 	}
+	DELAY(10);
 
         return bus_space_read_1(iot, ioh, IOMDKBC_DR);
 }
@@ -221,7 +219,6 @@
 static int
 iomdkbc_xt_translation(void *cookie, pckbport_slot_t slot, int on)
 {
-
 	if (on)
 		return 0; /* Can't do XT translation */
 	else
@@ -243,8 +240,9 @@
 iomdkbc_intr_establish(void *cookie, pckbport_slot_t slot)
 {
 	struct iomdkbc_internal *t = cookie;
-
-	enable_irq(t->t_rxirq[slot]);
+	t->t_rxih[slot] = intr_claim( t->t_rxirq[slot], IPL_TTY,
+				      device_xname( t->t_sc->sc_dev),
+				      iomdkbc_intr, t );
 }
 
 static void


Home | Main Index | Thread Index | Old Index