summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2005-07-01 23:56:48 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2005-07-01 23:56:48 +0000
commitc9ea2d56d0dbb66b0f4753d7b0b84e4f872b3f5b (patch)
tree2781318302edef42b79df8d1cd750033cd343703
parent420968103d6f70617afff7176732e5a22c1e80f2 (diff)
- New macros to identify the zaurus model.
- Updated constants in zaurus_reg.h.
-rw-r--r--sys/arch/zaurus/include/zaurus_reg.h37
-rw-r--r--sys/arch/zaurus/include/zaurus_var.h14
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_machdep.c23
3 files changed, 52 insertions, 22 deletions
diff --git a/sys/arch/zaurus/include/zaurus_reg.h b/sys/arch/zaurus/include/zaurus_reg.h
index 5736cefbb9d..4ac873edfed 100644
--- a/sys/arch/zaurus/include/zaurus_reg.h
+++ b/sys/arch/zaurus/include/zaurus_reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_reg.h,v 1.4 2005/05/24 20:32:43 uwe Exp $ */
+/* $OpenBSD: zaurus_reg.h,v 1.5 2005/07/01 23:56:47 uwe Exp $ */
/* $NetBSD: lubbock_reg.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */
/*
@@ -30,22 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-
-#ifndef _EVBARM_ZAURUS_REG_H
-#define _EVBARM_ZAURUS_REG_H
+#ifndef _ZAURUS_REG_H
+#define _ZAURUS_REG_H
#include <arm/xscale/pxa2x0reg.h>
-#define ZAURUS_SRAM_PBASE (PXA2X0_CS2_START+0x02000000)
-#define ZAURUS_SRAM_SIZE 0x00100000
-
-#define ZAURUS_91C96_PBASE PXA2X0_CS3_START
-#define ZAURUS_91C96_IO ZAURUS_91C96_PBASE
-#define ZAURUS_91C96_ATTRMEM (ZAURUS_91C96_PBASE+0x02000000)
-
-
/* SA-1111 companion chip registers */
-#define ZAURUS_SACC_PBASE PXA2X0_CS4_START
+#define ZAURUS_SACC_PBASE PXA2X0_CS4_START
/*
* Logical mapping for onboard/integrated peripherals
@@ -69,4 +60,22 @@
#define ioreg8_read(a) (*(volatile uint8_t *)(a))
#define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v))
-#endif /* _EVBARM_ZAURUS_REG_H */
+/*
+ * Magic numbers for the C860 (PXA255) and C3000 (PXA27x).
+ */
+
+/* physical adresses of companion chips */
+#define C3000_SCOOP0_BASE 0x10800000 /* XXX same as C860 */
+#define C3000_SCOOP1_BASE 0x08800040
+
+/* processor IRQ numbers */
+#define C860_CF0_IRQ 17
+#define C3000_CF0_IRQ 105
+#define C3000_CF1_IRQ 106
+
+/* processor GPIO pins */
+#define C860_CF0_IRQ_PIN 14
+#define C3000_CF0_IRQ_PIN 94
+#define C3000_CF1_IRQ_PIN 93
+
+#endif /* _ZAURUS_REG_H */
diff --git a/sys/arch/zaurus/include/zaurus_var.h b/sys/arch/zaurus/include/zaurus_var.h
index 88f43d3ce81..871d70bf858 100644
--- a/sys/arch/zaurus/include/zaurus_var.h
+++ b/sys/arch/zaurus/include/zaurus_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_var.h,v 1.3 2005/01/14 18:44:08 drahn Exp $ */
+/* $OpenBSD: zaurus_var.h,v 1.4 2005/07/01 23:56:47 uwe Exp $ */
/* $NetBSD: lubbock_var.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */
/*
@@ -39,6 +39,16 @@
#include <machine/bus.h>
#include <machine/zaurus_reg.h>
-/* XXX */
+#ifdef _KERNEL
+
+#define ZAURUS_C860 0xC0860
+#define ZAURUS_C3000 0xC3000
+
+extern int zaurusmod;
+
+#define ZAURUS_ISC860 (zaurusmod == ZAURUS_C860)
+#define ZAURUS_ISC3000 (zaurusmod == ZAURUS_C3000)
+
+#endif
#endif /* _EVBARM_ZAURUS_VAR_H */
diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c
index 42c25b89ac1..079e1ef79b7 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.17 2005/05/27 18:42:15 uwe Exp $ */
+/* $OpenBSD: zaurus_machdep.c,v 1.18 2005/07/01 23:56:47 uwe Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -191,6 +191,8 @@ u_int cpu_reset_address = 0;
#define UND_STACK_SIZE 1
#endif
+int zaurusmod;
+
BootConfig bootconfig; /* Boot config storage */
char *boot_args = NULL;
char *boot_file = NULL;
@@ -405,13 +407,13 @@ struct l1_sec_map {
},
{
ZAURUS_SCOOP0_VBASE,
- SCOOP0_BASE,
+ C3000_SCOOP0_BASE,
SCOOP_SIZE,
PTE_NOCACHE,
},
{
ZAURUS_SCOOP1_VBASE,
- trunc_page(SCOOP1_BASE),
+ trunc_page(C3000_SCOOP1_BASE),
round_page(SCOOP_SIZE),
PTE_NOCACHE,
},
@@ -501,7 +503,7 @@ green_on(int virt)
if (virt)
p = (u_int16_t *)(ZAURUS_SCOOP0_VBASE+SCOOP_GPWR);
else
- p = (u_int16_t *)(SCOOP0_BASE+SCOOP_GPWR);
+ p = (u_int16_t *)(C3000_SCOOP0_BASE+SCOOP_GPWR);
*p = *p | (1<<SCOOP0_LED_GREEN);
}
@@ -512,12 +514,12 @@ irda_on(int virt)
/* clobber IrDA led p */
volatile u_int16_t *p;
/* XXX scoop1 registers are not page-aligned! */
- int ofs = SCOOP1_BASE - trunc_page(SCOOP1_BASE);
+ int ofs = C3000_SCOOP1_BASE - trunc_page(C3000_SCOOP1_BASE);
if (virt)
p = (u_int16_t *)(ZAURUS_SCOOP1_VBASE+ofs+SCOOP_GPWR);
else
- p = (u_int16_t *)(SCOOP1_BASE+SCOOP_GPWR);
+ p = (u_int16_t *)(C3000_SCOOP1_BASE+SCOOP_GPWR);
*p = *p & ~(1<<SCOOP1_IR_ON);
}
@@ -667,6 +669,15 @@ initarm(void *arg)
boothowto |= RB_DFLTROOT;
#endif /* RAMDISK_HOOKS */
+ /*
+ * This test will work for now but has to be revised when support
+ * for other models is added.
+ */
+ if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X)
+ zaurusmod = ZAURUS_C3000;
+ else
+ zaurusmod = ZAURUS_C860;
+
/* setup GPIO for BTUART, in case bootloader doesn't take care of it */
pxa2x0_gpio_bootstrap(ZAURUS_GPIO_VBASE);
#if 0