1 /*        $NetBSD: zaurus_reg.h,v 1.6 2018/02/08 09:05:18 dholland Exp $        */
2 /*        $OpenBSD: zaurus_reg.h,v 1.7 2005/12/14 14:39:38 uwe Exp $  */
3 /*        NetBSD: lubbock_reg.h,v 1.1 2003/06/18 10:51:15 bsh Exp */
4 
5 /*
6  * Copyright (c) 2002, 2003  Genetec Corporation.  All rights reserved.
7  * Written by Hiroyuki Bessho for Genetec Corporation.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. The name of Genetec Corporation may not be used to endorse or
18  *    promote products derived from this software without specific prior
19  *    written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GENETEC CORPORATION
25  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef _ZAURUS_REG_H
35 #define _ZAURUS_REG_H
36 
37 #include <arm/xscale/pxa2x0cpu.h>
38 
39 /*
40  * Logical mapping for onboard/integrated peripherals
41  */
42 #define   ZAURUS_IO_AREA_VBASE          0xfd000000
43 #define ZAURUS_GPIO_VBASE     0xfd000000
44 #define ZAURUS_CLKMAN_VBASE   0xfd100000
45 #define ZAURUS_INTCTL_VBASE   0xfd200000
46 #define ZAURUS_MEMCTL_VBASE   0xfd300000
47 #define ZAURUS_SCOOP0_VBASE   0xfd400000
48 #define ZAURUS_SCOOP1_VBASE   0xfd500000
49 #define ZAURUS_FFUART_VBASE   0xfd600000
50 #define ZAURUS_BTUART_VBASE   0xfd700000
51 #define ZAURUS_STUART_VBASE   0xfd800000
52 #define ZAURUS_POWMAN_VBASE   0xfd900000
53 #define ZAURUS_VBASE_FREE     0xfda00000
54 
55 #define ioreg_read(a)                   (*(volatile uint32_t *)(a))
56 #define ioreg_write(a,v)      (*(volatile uint32_t *)(a)=(v))
57 #define ioreg16_read(a)                 (*(volatile uint16_t *)(a))
58 #define ioreg16_write(a,v)    (*(volatile uint16_t *)(a)=(v))
59 #define ioreg8_read(a)                  (*(volatile uint8_t *)(a))
60 #define ioreg8_write(a,v)     (*(volatile uint8_t *)(a)=(v))
61 
62 /*
63  * Magic numbers for the C860 (PXA255) and C3000 (PXA27x).
64  */
65 
66 /* physical addresses of companion chips */
67 #define C860_SCOOP0_BASE                0x10800000
68 #define C3000_SCOOP0_BASE               0x10800000
69 #define C3000_SCOOP1_BASE               0x08800040
70 
71 /* processor IRQ numbers */
72 #define C860_CF0_IRQ                              17
73 #define C3000_CF0_IRQ                             105
74 #define C3000_CF1_IRQ                             106
75 
76 /* processor GPIO pins */
77 #define C860_GPIO_SD_DETECT_PIN                   9
78 #define C860_RC_IRQ_PIN                           4         /* remote control */
79 #define C860_GPIO_SD_WP_PIN             7
80 #define C860_CF0_IRQ_PIN                14
81 #define C860_GPIO_SD_POWER_PIN                    33
82 #define   C3000_GPIO_SD_DETECT_PIN      9
83 #define C3000_RC_IRQ_PIN                13        /* remote control */
84 #define   C3000_GPIO_SD_WP_PIN                    81
85 #define C3000_CF1_IRQ_PIN               93
86 #define C3000_CF0_IRQ_PIN               94
87 
88 /* USB related pins */
89 #define C3000_USB_DEVICE_PIN            35        /* Client cable is connected */
90 #define C3000_USB_HOST_PIN              41        /* Host cable is connected */
91 #define C3000_USB_HOST_POWER_PIN        37        /* host provides power for USB */
92 
93 #endif /* _ZAURUS_REG_H */
94