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

cassiopeia patch



鈴木(康) です。


カシオペアの修正を送ります。
ちょっと汚すぎるので、
正しい修正方法で直して欲しいです。
よろしくお願いします。> たけむらさん。

変更点

1) port = 0 に対応できていないので、とりあえず 0x20 のビットを立てる
ことにした。
以下のところが問題でした。

	if (!(port = GET_PORT(port_irq))) {/* GPIO port not specfied */

 	if (!port)
 		panic("isa_intr_establish: can't ISA IRQ to GIU port.");

2) active low に対応できていないんで、
とりあえず、次のようにしてしのいでいる。

	if (port & 0x20)
	    mode = VRGIU_INTR_LEVEL_LOW_THROUGH;  /* XXX Is this OK? */

3) dma は通らないと思っているんで、とりあえず stub を入れている。


ちなみに 次の config を使っています。
これ以外に十字ボタンがあり、右以外は認識できています。
# 右が認識できるようになったらまた別途 送ります。

# CASIO CASSIOPEIA E55 and for DoCoMo
# BUTTON_PRESS -> LOW
button0 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_OK active 0 port 6
button1 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_CANCEL active 0 port 7
button2 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_APP0 active 0 port 8
button3 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_APP1 active 0 port 9
button4 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_APP2 active 0 port 10
button5 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_APP3 active 0 port 11
button6 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_DOWN active 0 port 12
button7 at vrgiu? platform CASIO_CASSIOPEIAE_E55 id BTN_UP active 0 port 13
vrisab4 at vrgiu? platform CASIO_CASSIOPEIAE_E55 isaportoffset 0xc000
isa4    at vrisab4
wdc0    at isa4 port 0x170 irq 0x00200003


--- isa_machdep.c.org	Sun Feb 27 20:21:03 2000
+++ isa_machdep.c	Sun Feb 27 22:26:24 2000
@@ -163,26 +163,30 @@
 {
 	struct vrisab_softc *sc = (void*)ic;
 	int port, irq, mode;
-#define GET_PORT(i) (((i)>>16)&0x1f)
+#define GET_PORT(i) (((i)>>16)&0x3f)
 #define GET_IRQ(i) ((i)&0xf)
 	/* 
 	 * ISA IRQ <-> GPIO port mapping
 	 */
 	irq = GET_IRQ(port_irq);
-	if (!(port = GET_PORT(port_irq))) {/* GPIO port not specfied */
+	if (!(port = GET_PORT(port_irq))) {/* GPIO port not specfied */ 
 		port = sc->sc_intr_map[irq]; /* Use Already mapped port */
 	} else { /* GPIO port specified. */
 		if (sc->sc_intr_map[irq] != -1)
 			panic("isa_intr_establish: conflict GPIO line. %d <-> %d",
 			      port, sc->sc_intr_map[irq]);
-		sc->sc_intr_map[irq] = port; /* Register it */
+		sc->sc_intr_map[irq] = port & 0x1f; /* Register it */
 		printf("ISA IRQ %d -> GPIO port %d\n", irq, port);
 	}
 	if (!port)
 		panic("isa_intr_establish: can't ISA IRQ to GIU port.");
 	/* Call Vr routine */
-	mode = VRGIU_INTR_LEVEL_HIGH_THROUGH;  /* XXX Is this OK? */
-	return sc->sc_gf->gf_intr_establish(sc->sc_gc, port, mode, level, ih_fun, ih_arg);
+	if (port & 0x20)
+	    mode = VRGIU_INTR_LEVEL_LOW_THROUGH;  /* XXX Is this OK? */
+	else
+	    mode = VRGIU_INTR_LEVEL_HIGH_THROUGH;  /* XXX Is this OK? */
+
+	return sc->sc_gf->gf_intr_establish(sc->sc_gc, port & 0x1f, mode, level, ih_fun, ih_arg);
 }
 
 void
@@ -247,3 +251,43 @@
 #endif
 
 	
+void
+isa_dmainit(ic, bst, dmat, dev)
+	isa_chipset_tag_t ic;
+	bus_space_tag_t bst;
+	bus_dma_tag_t dmat;
+	struct device *dev;
+{
+}
+
+int
+isa_dmamap_create(ic, chan, size, flags)
+	isa_chipset_tag_t ic;
+	int chan;
+	bus_size_t size;
+	int flags;
+{
+	return ENXIO;
+}
+
+int
+isa_dmastart(ic, chan, addr, nbytes, p, flags, busdmaflags)
+	isa_chipset_tag_t ic;
+	int chan;
+	void *addr;
+	bus_size_t nbytes;
+	struct proc *p;
+	int flags;
+	int busdmaflags;
+{
+	return ENXIO;
+}
+
+void
+isa_dmadone(ic, chan)
+	isa_chipset_tag_t ic;
+	int chan;
+{
+}
+
+int isa_dmamaxsize() { return 0; }

--
					鈴木 康司 @NEC
					suz@hpc.bs1.fc.nec.co.jp
					TEL 0423-33-5381