From 8a47c75221bb2302bcd8a1fabaefcdbdc38a88dc Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Tue, 25 Nov 2008 14:55:45 +0000 Subject: rename zaurus_reg.h to machine_reg and rename some of the internal fields so that arm/xscale/... is not referring to zaurus specific defines. ok miod kevlo, with some suggested changes from deraadt@ --- sys/arch/arm/xscale/pxa27x_udc.c | 28 +++++------ sys/arch/zaurus/dev/scoop_pcic.c | 4 +- sys/arch/zaurus/dev/zaurus_scoop.c | 4 +- sys/arch/zaurus/include/machine_reg.h | 83 +++++++++++++++++++++++++++++++++ sys/arch/zaurus/include/zaurus_reg.h | 83 --------------------------------- sys/arch/zaurus/include/zaurus_var.h | 4 +- sys/arch/zaurus/zaurus/zaurus_machdep.c | 4 +- 7 files changed, 105 insertions(+), 105 deletions(-) create mode 100644 sys/arch/zaurus/include/machine_reg.h delete mode 100644 sys/arch/zaurus/include/zaurus_reg.h diff --git a/sys/arch/arm/xscale/pxa27x_udc.c b/sys/arch/arm/xscale/pxa27x_udc.c index f29154bb07a..1090271b57f 100644 --- a/sys/arch/arm/xscale/pxa27x_udc.c +++ b/sys/arch/arm/xscale/pxa27x_udc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa27x_udc.c,v 1.22 2007/06/14 06:55:10 mbalmer Exp $ */ +/* $OpenBSD: pxa27x_udc.c,v 1.23 2008/11/25 14:55:44 drahn Exp $ */ /* * Copyright (c) 2007 Dale Rahn @@ -42,7 +42,7 @@ #define PXAUDC_EP0MAXP 16 /* XXX */ #define PXAUDC_NEP 24 /* total number of endpoints */ -#include /* XXX */ +#include /* XXX */ #include "usbf.h" @@ -231,10 +231,10 @@ pxaudc_attach(struct device *parent, struct device *self, void *aux) /* Establish device connect interrupt. */ #if 0 - sc->sc_conn_ih = pxa2x0_gpio_intr_establish(C3000_USB_DEVICE_PIN, /* XXX */ + sc->sc_conn_ih = pxa2x0_gpio_intr_establish(PXA_USB_DEVICE_PIN, /* XXX */ IST_EDGE_BOTH, IPL_USB, pxaudc_connect_intr, sc, "usbc"); #endif - sc->sc_conn_ih = pxa2x0_gpio_intr_establish(C3000_USB_CONNECT_PIN, + sc->sc_conn_ih = pxa2x0_gpio_intr_establish(PXA_USB_CONNECT_PIN, IST_EDGE_BOTH, IPL_USB, pxaudc_connect_intr, sc, "usbc"); if (sc->sc_conn_ih == NULL) { printf(": unable to establish connect interrupt\n"); @@ -318,28 +318,28 @@ pxaudc_power(int why, void *arg) int pxaudc_is_host(void) { - return (!pxa2x0_gpio_get_bit(C3000_USB_CONNECT_PIN) && - !pxa2x0_gpio_get_bit(C3000_USB_DEVICE_PIN)); + return (!pxa2x0_gpio_get_bit(PXA_USB_CONNECT_PIN) && + !pxa2x0_gpio_get_bit(PXA_USB_DEVICE_PIN)); } int pxaudc_is_device(void) { - return (pxa2x0_gpio_get_bit(C3000_USB_CONNECT_PIN) && - pxa2x0_gpio_get_bit(C3000_USB_DEVICE_PIN)); + return (pxa2x0_gpio_get_bit(PXA_USB_CONNECT_PIN) && + pxa2x0_gpio_get_bit(PXA_USB_DEVICE_PIN)); } void pxaudc_setup(struct pxaudc_softc *sc) { pxa2x0_gpio_set_function(45, GPIO_OUT); - pxa2x0_gpio_set_function(C3000_USB_CONNECT_PIN, GPIO_IN); /* 41 */ + pxa2x0_gpio_set_function(PXA_USB_CONNECT_PIN, GPIO_IN); /* 41 */ pxa2x0_gpio_set_function(40, GPIO_OUT); pxa2x0_gpio_set_function(39, GPIO_IN); pxa2x0_gpio_set_function(38, GPIO_IN); pxa2x0_gpio_set_function(37, GPIO_OUT); pxa2x0_gpio_set_function(36, GPIO_IN); - pxa2x0_gpio_set_function(C3000_USB_DEVICE_PIN, GPIO_IN); /* 35 */ + pxa2x0_gpio_set_function(PXA_USB_DEVICE_PIN, GPIO_IN); /* 35 */ pxa2x0_gpio_set_function(34, GPIO_IN); pxa2x0_gpio_set_function(89, GPIO_OUT); pxa2x0_gpio_set_function(120, GPIO_OUT); @@ -349,14 +349,14 @@ pxaudc_setup(struct pxaudc_softc *sc) void pxaudc_hide(struct pxaudc_softc *sc) { - pxa2x0_gpio_clear_bit(C3000_USB_PULLUP_PIN); + pxa2x0_gpio_clear_bit(PXA_USB_PULLUP_PIN); } /* Show us to the host. */ void pxaudc_show(struct pxaudc_softc *sc) { - pxa2x0_gpio_set_bit(C3000_USB_PULLUP_PIN); + pxa2x0_gpio_set_bit(PXA_USB_PULLUP_PIN); } /* @@ -791,8 +791,8 @@ pxaudc_connect_intr(void *v) struct pxaudc_softc *sc = v; DPRINTF(10,("pxaudc_connect_intr: connect=%d device=%d\n", - pxa2x0_gpio_get_bit(C3000_USB_CONNECT_PIN), - pxa2x0_gpio_get_bit(C3000_USB_DEVICE_PIN))); + pxa2x0_gpio_get_bit(PXA_USB_CONNECT_PIN), + pxa2x0_gpio_get_bit(PXA_USB_DEVICE_PIN))); /* XXX only set a flag here */ if (pxaudc_is_host()) { diff --git a/sys/arch/zaurus/dev/scoop_pcic.c b/sys/arch/zaurus/dev/scoop_pcic.c index b663fc567a4..8f3bd018959 100644 --- a/sys/arch/zaurus/dev/scoop_pcic.c +++ b/sys/arch/zaurus/dev/scoop_pcic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scoop_pcic.c,v 1.1 2005/07/01 23:51:55 uwe Exp $ */ +/* $OpenBSD: scoop_pcic.c,v 1.2 2008/11/25 14:55:44 drahn Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/sys/arch/zaurus/dev/zaurus_scoop.c b/sys/arch/zaurus/dev/zaurus_scoop.c index cc321d57e14..78e057bb022 100644 --- a/sys/arch/zaurus/dev/zaurus_scoop.c +++ b/sys/arch/zaurus/dev/zaurus_scoop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_scoop.c,v 1.17 2007/12/27 07:09:46 thib Exp $ */ +/* $OpenBSD: zaurus_scoop.c,v 1.18 2008/11/25 14:55:44 drahn Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler @@ -29,7 +29,7 @@ #include -#include +#include #include #include diff --git a/sys/arch/zaurus/include/machine_reg.h b/sys/arch/zaurus/include/machine_reg.h new file mode 100644 index 00000000000..67f5aada0ab --- /dev/null +++ b/sys/arch/zaurus/include/machine_reg.h @@ -0,0 +1,83 @@ +/* $OpenBSD: machine_reg.h,v 1.1 2008/11/25 14:55:44 drahn Exp $ */ +/* $NetBSD: lubbock_reg.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ + +/* + * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. + * Written by Hiroyuki Bessho for Genetec Corporation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of Genetec Corporation may not be used to endorse or + * promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ZAURUS_REG_H +#define _ZAURUS_REG_H + +#include + +/* + * Logical mapping for onboard/integrated peripherals + */ +#define ZAURUS_IO_AREA_VBASE 0xfd000000 +#define ZAURUS_GPIO_VBASE 0xfd000000 +#define ZAURUS_CLKMAN_VBASE 0xfd100000 +#define ZAURUS_INTCTL_VBASE 0xfd200000 +#define ZAURUS_SCOOP0_VBASE 0xfd300000 +#define ZAURUS_SCOOP1_VBASE 0xfd400000 +#define ZAURUS_VBASE_FREE 0xfd500000 +/* FFUART, BTUART and/or STUART are mapped to this area when + used for console or kgdb port */ + +#define ioreg_read(a) (*(volatile unsigned *)(a)) +#define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v)) + +#define ioreg16_read(a) (*(volatile uint16_t *)(a)) +#define ioreg16_write(a,v) (*(volatile uint16_t *)(a)=(v)) + +#define ioreg8_read(a) (*(volatile uint8_t *)(a)) +#define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v)) + +/* + * 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_RC_IRQ_PIN 13 /* remote control */ +#define C3000_CF0_IRQ_PIN 94 +#define C3000_CF1_IRQ_PIN 93 +#define PXA_USB_DEVICE_PIN 35 /* indicate connection type */ +#define PXA_USB_CONNECT_PIN 41 /* connection interrupt */ +#define PXA_USB_PULLUP_PIN 45 /* show/hide device presence */ +#define GPIO_HP_IN_C3000 116 /* headphone jack */ + +#endif /* _ZAURUS_REG_H */ diff --git a/sys/arch/zaurus/include/zaurus_reg.h b/sys/arch/zaurus/include/zaurus_reg.h deleted file mode 100644 index fd4e40eb3ac..00000000000 --- a/sys/arch/zaurus/include/zaurus_reg.h +++ /dev/null @@ -1,83 +0,0 @@ -/* $OpenBSD: zaurus_reg.h,v 1.8 2006/11/25 18:10:29 uwe Exp $ */ -/* $NetBSD: lubbock_reg.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ - -/* - * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _ZAURUS_REG_H -#define _ZAURUS_REG_H - -#include - -/* - * Logical mapping for onboard/integrated peripherals - */ -#define ZAURUS_IO_AREA_VBASE 0xfd000000 -#define ZAURUS_GPIO_VBASE 0xfd000000 -#define ZAURUS_CLKMAN_VBASE 0xfd100000 -#define ZAURUS_INTCTL_VBASE 0xfd200000 -#define ZAURUS_SCOOP0_VBASE 0xfd300000 -#define ZAURUS_SCOOP1_VBASE 0xfd400000 -#define ZAURUS_VBASE_FREE 0xfd500000 -/* FFUART, BTUART and/or STUART are mapped to this area when - used for console or kgdb port */ - -#define ioreg_read(a) (*(volatile unsigned *)(a)) -#define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v)) - -#define ioreg16_read(a) (*(volatile uint16_t *)(a)) -#define ioreg16_write(a,v) (*(volatile uint16_t *)(a)=(v)) - -#define ioreg8_read(a) (*(volatile uint8_t *)(a)) -#define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v)) - -/* - * 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_RC_IRQ_PIN 13 /* remote control */ -#define C3000_CF0_IRQ_PIN 94 -#define C3000_CF1_IRQ_PIN 93 -#define C3000_USB_DEVICE_PIN 35 /* indicate connection type */ -#define C3000_USB_CONNECT_PIN 41 /* connection interrupt */ -#define C3000_USB_PULLUP_PIN 45 /* show/hide device presence */ -#define GPIO_HP_IN_C3000 116 /* headphone jack */ - -#endif /* _ZAURUS_REG_H */ diff --git a/sys/arch/zaurus/include/zaurus_var.h b/sys/arch/zaurus/include/zaurus_var.h index 871d70bf858..a0a8c78bd6f 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.4 2005/07/01 23:56:47 uwe Exp $ */ +/* $OpenBSD: zaurus_var.h,v 1.5 2008/11/25 14:55:44 drahn Exp $ */ /* $NetBSD: lubbock_var.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ /* @@ -37,7 +37,7 @@ #include #include -#include +#include #ifdef _KERNEL diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c index fe369b81a6f..38ee72873c1 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.29 2008/06/08 20:56:33 miod Exp $ */ +/* $OpenBSD: zaurus_machdep.c,v 1.30 2008/11/25 14:55:44 drahn Exp $ */ /* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */ /* @@ -150,7 +150,7 @@ #include #include #include -#include +#include #include #include -- cgit v1.2.3