summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2005-05-09 15:32:20 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2005-05-09 15:32:20 +0000
commite75d6f81d9ccc654cb8375f3756f843856272ccc (patch)
treefea322ec53fe2ed09c46e82f9a4883639ea88684
parent9a6a9f058b587409d1ec4d8b8cbe0a90a9b3affa (diff)
Enable clock to STUART unit, and enable com2 in GENERIC and RAMDISK
configurations. The STUARTCONSOLE option doesn't work yet.
-rw-r--r--sys/arch/zaurus/conf/GENERIC5
-rw-r--r--sys/arch/zaurus/conf/RAMDISK5
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_machdep.c71
3 files changed, 50 insertions, 31 deletions
diff --git a/sys/arch/zaurus/conf/GENERIC b/sys/arch/zaurus/conf/GENERIC
index b122e773567..81b4cf14549 100644
--- a/sys/arch/zaurus/conf/GENERIC
+++ b/sys/arch/zaurus/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.37 2005/05/01 07:54:43 david Exp $
+# $OpenBSD: GENERIC,v 1.38 2005/05/09 15:32:19 uwe Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -131,9 +131,10 @@ cd* at scsibus?
options COM_PXA2X0
com0 at pxaip? addr 0x40100000 intr 22 # Full Function UART
com1 at pxaip? addr 0x40200000 intr 21 # BlueTooth UART
-#com2 at pxaip? addr 0x40700000 intr 20 # Standard UART (for IrDA)
+com2 at pxaip? addr 0x40700000 intr 20 # Standard UART (for IrDA)
options FFUARTCONSOLE
#options BTUARTCONSOLE
+#options STUARTCONSOLE
pxapcic0 at pxaip? # CF (pcmcia) support
pcmcia* at pxapcic?
diff --git a/sys/arch/zaurus/conf/RAMDISK b/sys/arch/zaurus/conf/RAMDISK
index a4dd0085c62..effef5f35d0 100644
--- a/sys/arch/zaurus/conf/RAMDISK
+++ b/sys/arch/zaurus/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.26 2005/05/01 07:54:43 david Exp $
+# $OpenBSD: RAMDISK,v 1.27 2005/05/09 15:32:19 uwe Exp $
machine zaurus arm
@@ -107,9 +107,10 @@ cd* at scsibus?
options COM_PXA2X0
com0 at pxaip? addr 0x40100000 intr 22 # Full Function UART
com1 at pxaip? addr 0x40200000 intr 21 # BlueTooth UART
-#com2 at pxaip? addr 0x40700000 intr 20 # Standard UART (for IrDA)
+com2 at pxaip? addr 0x40700000 intr 20 # Standard UART (for IrDA)
options FFUARTCONSOLE
#options BTUARTCONSOLE
+#options STUARTCONSOLE
#aupxa0 at pxaip? # AC97 interface
diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c
index ffcf3e41763..3d02e48ec60 100644
--- a/sys/arch/zaurus/zaurus/zaurus_machdep.c
+++ b/sys/arch/zaurus/zaurus/zaurus_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_machdep.c,v 1.14 2005/05/02 02:45:29 uwe Exp $ */
+/* $OpenBSD: zaurus_machdep.c,v 1.15 2005/05/09 15:32:19 uwe Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -252,8 +252,13 @@ bs_protos(bs_notimpl);
#include "com.h"
#if NCOM > 0
-#include <dev/ic/comreg.h>
+#if defined(COM_PXA2X0)
+#include <arm/xscale/pxacomreg.h>
+#include <arm/xscale/pxacomvar.h>
+#else
#include <dev/ic/comvar.h>
+#include <dev/ic/comreg.h>
+#endif
#endif
#ifndef CONSPEED
@@ -645,12 +650,19 @@ initarm(void *arg)
pxa2x0_gpio_set_function(35, GPIO_ALT_FN_1_IN);
pxa2x0_gpio_set_function(40, GPIO_ALT_FN_2_OUT);
pxa2x0_gpio_set_function(41, GPIO_ALT_FN_2_OUT);
+
+ /* STUART */
+ pxa2x0_gpio_set_function(46, GPIO_ALT_FN_2_IN);
+ pxa2x0_gpio_set_function(47, GPIO_ALT_FN_1_OUT);
#endif
+ /* tell com to drive STUART in slow infrared mode */
+ comsiraddr = (bus_addr_t)PXA2X0_STUART_BASE;
+
#if 1
/* turn on clock to UART block.
XXX this should not be necessary, consinit() will do it */
- early_clkman(CKEN_FFUART | CKEN_BTUART, 1);
+ early_clkman(CKEN_FFUART | CKEN_BTUART | CKEN_STUART, 1);
#endif
green_on(0);
@@ -1133,6 +1145,14 @@ initarm(void *arg)
return(kernelstack.pv_va + USPACE_SVC_STACK_TOP);
}
+#if defined(FFUARTCONSOLE)
+const char *console = "ffuart";
+#elif defined(BTUARTCONSOLE)
+const char *console = "btuart";
+#elif defined(STUARTCONSOLE)
+const char *console = "stuart";
+#endif
+
void
process_kernel_args(char *args)
{
@@ -1218,44 +1238,38 @@ int comkgdbmode = KGDB_DEVMODE;
void
consinit(void)
{
+#if NCOM > 0
static int consinit_called = 0;
-#if 0
- char *console = CONSDEVNAME;
-#endif
+ paddr_t paddr;
+ u_int cken = 0;
if (consinit_called != 0)
return;
consinit_called = 1;
-#if NCOM > 0
-
-#ifdef FFUARTCONSOLE
#ifdef KGDB
- if (strcmp(kgdb_devname, "ffuart") == 0) {
+ if (strcmp(kgdb_devname, console) == 0) {
/* port is reserved for kgdb */
} else
#endif
- if (comcnattach(&pxa2x0_a4x_bs_tag, PXA2X0_FFUART_BASE, comcnspeed,
- PXA2X0_COM_FREQ, comcnmode) == 0) {
- early_clkman(CKEN_FFUART, 1);
- return;
- }
-#endif /* FFUARTCONSOLE */
-
-#ifdef BTUARTCONSOLE
-#ifdef KGDB
- if (strcmp(kgdb_devname, "btuart") == 0) {
- /* port is reserved for kgdb */
- } else
+ if (strcmp(console, "ffuart") == 0) {
+ paddr = PXA2X0_FFUART_BASE;
+ cken = CKEN_FFUART;
+ } else if (strcmp(console, "btuart") == 0) {
+ paddr = PXA2X0_BTUART_BASE;
+ cken = CKEN_BTUART;
+ } else if (strcmp(console, "stuart") == 0) {
+#if 0
+ /* XXX enable the infrared transmitter LED. */
#endif
- if (comcnattach(&pxa2x0_a4x_bs_tag, PXA2X0_BTUART_BASE, comcnspeed,
+ paddr = PXA2X0_STUART_BASE;
+ cken = CKEN_STUART;
+ }
+ if (cken != 0 && comcnattach(&pxa2x0_a4x_bs_tag, paddr, comcnspeed,
PXA2X0_COM_FREQ, comcnmode) == 0) {
- early_clkman(CKEN_BTUART, 1);
- return;
+ early_clkman(cken, 1);
}
-#endif /* BTUARTCONSOLE */
-
#endif /* NCOM */
}
@@ -1273,6 +1287,9 @@ kgdb_port_init(void)
} else if (strcmp(kgdb_devname, "btuart") == 0) {
paddr = PXA2X0_BTUART_BASE;
cken = CKEN_BTUART;
+ } else if (strcmp(kgdb_devname, "stuart") == 0) {
+ paddr = PXA2X0_STUART_BASE;
+ cken = CKEN_STUART;
} else
return;