summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2006-06-01 18:46:06 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2006-06-01 18:46:06 +0000
commit37c7e3af83377548f282dbcccf1cd4bb4dad716a (patch)
tree75012e8adb6f3d741e86ccfcbdc71582bd0ea50f /sys/arch
parent037b84a240f6ab84d7fe79649d7e98565599fa54 (diff)
After changing J3 to J4 on the thecus board, serial interrupts work just
fine (on XINT1), so remove the poll console hacks and rewire the com irq to the correct value for thecus.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/xscale/i80321_timer.c4
-rw-r--r--sys/arch/armish/dev/com_obio.c70
-rw-r--r--sys/arch/armish/dev/iq80321_pci.c16
3 files changed, 19 insertions, 71 deletions
diff --git a/sys/arch/arm/xscale/i80321_timer.c b/sys/arch/arm/xscale/i80321_timer.c
index d36273f7cab..59e5799e191 100644
--- a/sys/arch/arm/xscale/i80321_timer.c
+++ b/sys/arch/arm/xscale/i80321_timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i80321_timer.c,v 1.2 2006/05/29 17:27:31 drahn Exp $ */
+/* $OpenBSD: i80321_timer.c,v 1.3 2006/06/01 18:46:05 drahn Exp $ */
/* $NetBSD: i80321_timer.c,v 1.13 2005/12/24 20:06:52 perry Exp $ */
/*
@@ -418,7 +418,6 @@ resettodr(void)
*
* Handle the hardclock interrupt.
*/
-int poll_console(void);
int
clockhandler(void *arg)
{
@@ -431,6 +430,5 @@ clockhandler(void *arg)
if (i80321_hardclock_hook != NULL)
(*i80321_hardclock_hook)();
- poll_console();
return (1);
}
diff --git a/sys/arch/armish/dev/com_obio.c b/sys/arch/armish/dev/com_obio.c
index aa23b30a977..2d488cc2817 100644
--- a/sys/arch/armish/dev/com_obio.c
+++ b/sys/arch/armish/dev/com_obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_obio.c,v 1.2 2006/05/29 17:30:26 drahn Exp $ */
+/* $OpenBSD: com_obio.c,v 1.3 2006/06/01 18:46:05 drahn Exp $ */
/* $NetBSD: com_obio.c,v 1.9 2005/12/11 12:17:09 christos Exp $ */
/*-
@@ -70,57 +70,12 @@ struct cfdriver com_obio_cd = {
int
com_obio_match(struct device *parent, void *cf, void *aux)
{
-
/* We take it on faith that the device is there. */
return (1);
}
-int comintr0(void *a);
-int comintr1(void *a);
-int comintr2(void *a);
-int comintr3(void *a);
-int
-comintr0(void *a)
-{
- return comintr(a);
-}
-int
-comintr1(void *a)
-{
- return comintr(a);
-}
-int
-comintr2(void *a)
-{
- return comintr(a);
-}
-int
-comintr3(void *a)
-{
- return comintr(a);
-}
-
-uint32_t get_pending_irq(void);
+int com_irq_override = -1;
-struct com_softc *console_comsc;
-int poll_console(void);
-int poll_console()
-{
- int ret;
-#if 0
- uint32_t pending0, pending1;
- pending0 = get_pending_irq();
-#endif
- ret = comintr(console_comsc);
-#if 0
- if (ret != 0) {
- pending1 = get_pending_irq();
- printf("serviced com irq, opending %x npending %x\n",
- pending0, pending1);
- }
-#endif
- return ret;
-}
void
com_obio_attach(struct device *parent, struct device *self, void *aux)
{
@@ -129,7 +84,10 @@ com_obio_attach(struct device *parent, struct device *self, void *aux)
struct com_softc *sc = &osc->sc_com;
int error;
- console_comsc = sc;
+ /* XXX old value is already printed */
+ if (com_irq_override != -1)
+ oba->oba_irq = com_irq_override;
+
sc->sc_iot = oba->oba_st;
sc->sc_iobase = oba->oba_addr;
sc->sc_frequency = COM_FREQ;
@@ -143,24 +101,8 @@ com_obio_attach(struct device *parent, struct device *self, void *aux)
}
com_attach_subr(sc);
- oba->oba_irq = 0x1c;
-#if 1
osc->sc_ih = i80321_intr_establish(oba->oba_irq, IPL_TTY,
comintr, sc, sc->sc_dev.dv_xname);
-#else
-#define ICU_INT_XINT0 27
-#define ICU_INT_XINT(x) ((x) + ICU_INT_XINT0)
-#if 1
- osc->sc_ih = i80321_intr_establish(ICU_INT_XINT(0), IPL_TTY,
- comintr0, sc, sc->sc_dev.dv_xname);
-#endif
- osc->sc_ih = i80321_intr_establish(ICU_INT_XINT(1), IPL_TTY,
- comintr1, sc, sc->sc_dev.dv_xname);
- osc->sc_ih = i80321_intr_establish(ICU_INT_XINT(2), IPL_TTY,
- comintr2, sc, sc->sc_dev.dv_xname);
- osc->sc_ih = i80321_intr_establish(ICU_INT_XINT(3), IPL_TTY,
- comintr3, sc, sc->sc_dev.dv_xname);
-#endif
if (osc->sc_ih == NULL)
printf("%s: unable to establish interrupt at CPLD irq %d\n",
sc->sc_dev.dv_xname, oba->oba_irq);
diff --git a/sys/arch/armish/dev/iq80321_pci.c b/sys/arch/armish/dev/iq80321_pci.c
index f61b3ecc872..5598e2f8712 100644
--- a/sys/arch/armish/dev/iq80321_pci.c
+++ b/sys/arch/armish/dev/iq80321_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iq80321_pci.c,v 1.5 2006/06/01 08:26:36 drahn Exp $ */
+/* $OpenBSD: iq80321_pci.c,v 1.6 2006/06/01 18:46:05 drahn Exp $ */
/* $NetBSD: iq80321_pci.c,v 1.5 2005/12/11 12:17:09 christos Exp $ */
/*
@@ -85,14 +85,13 @@ struct board_id {
struct irq_map *iq80321_irq_map;
struct irq_map iq80321_thecus_irq_map[] = {
- { 1, 1, ICU_INT_XINT(0) }, /* thecus re0 27 ??? */
+ { 1, 1, ICU_INT_XINT(0) }, /* thecus re0 27 */
{ 2, 1, ICU_INT_XINT(3) }, /* thecus re1 30 */
{ 3, 1, ICU_INT_XINT(2) }, /* thecus sata 29 */
{ 4, 1, ICU_INT_XINT(0) }, /* thecus uhci0 27 ??? */
{ 4, 2, ICU_INT_XINT(0) }, /* thecus uhci1 27 */
{ 4, 3, ICU_INT_XINT(2) }, /* thecus ehci0 29 */
{ 5, 1, ICU_INT_XINT(3) }, /* thecus minipci slot */
-
{ 0, 0, 255}
};
@@ -102,7 +101,6 @@ struct irq_map iq80321_hdlg_irq_map[] = {
{ 3, 1, ICU_INT_XINT(2) }, /* ochi0 29 */
{ 3, 2, ICU_INT_XINT(2) }, /* ochi0 29 */
{ 3, 3, ICU_INT_XINT(2) }, /* echi0 29 */
-
{ 0, 0, 255}
};
struct board_id thecus = {
@@ -167,6 +165,16 @@ iq80321_pci_init2(pci_chipset_tag_t pc, void *cookie)
printf(": %s", sys->name);
iq80321_irq_map = sys->irq_map;
+ /* XXX */
+ if (sys == &thecus) {
+ /*
+ * thecus com irq appears to not be attached, override
+ * it's irq here, it is tied to the tick timer, irq9
+ * - yes this is a hack.
+ */
+ extern int com_irq_override;
+ com_irq_override = 28;
+ }
}
int