Port-acorn32 archive

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

Re: Booting on RiscPC





On 28/03/2019 09:43, Stephen Borrill wrote:
On Wed, 27 Mar 2019, Mike Pumford wrote:

It may take a few days as I'm going to be away from the hardware but I'll have a look into the driver and see if I can see any way for that keyboard failure to happen. Is the behaviour consistent? does the same key always give the same pair of characters?

Yes, always consistent.
I did find a couple of possible start of day quirks where we could
potentially take an interrupt before the code was really ready. I've also added code that drains the keyboard input before we attach (the pckbc code does this and it seems reasonable given that the code is taking over control from another OS). Not sure if this will help you out or if we need to do more things to ensure the keyboard controller is in a sane state when we take over from RISC OS.

Mike
Index: 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
--- arch/arm/iomd/iomdkbc.c	14 May 2012 10:38:08 -0000	1.5
+++ arch/arm/iomd/iomdkbc.c	1 Apr 2019 22:25:55 -0000
@@ -143,13 +143,13 @@
 			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);
+		/* Flush port */
+		(void) iomdkbc_poll_data1(t, PCKBPORT_KBD_SLOT);
 		pckbport_attach_slot(sc->sc_dev, t->t_pt, PCKBPORT_KBD_SLOT);
 	}
 
@@ -165,10 +165,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)
@@ -243,8 +241,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