g42xxeb_reg.h revision 1.1 1 1.1 bsh /*
2 1.1 bsh * Copyright (c) 2002 Genetec corp. All rights reserved.
3 1.1 bsh * Written by Hiroyuki Bessho for Genetec corp.
4 1.1 bsh *
5 1.1 bsh * Redistribution and use in source and binary forms, with or without
6 1.1 bsh * modification, are permitted provided that the following conditions
7 1.1 bsh * are met:
8 1.1 bsh * 1. Redistributions of source code must retain the above copyright
9 1.1 bsh * notice, this list of conditions and the following disclaimer.
10 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright
11 1.1 bsh * notice, this list of conditions and the following disclaimer in the
12 1.1 bsh * documentation and/or other materials provided with the distribution.
13 1.1 bsh * 3. The name of Genetec corp. may not be used to endorse
14 1.1 bsh * or promote products derived from this software without specific prior
15 1.1 bsh * written permission.
16 1.1 bsh *
17 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORP. ``AS IS'' AND
18 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORP.
21 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.1 bsh * POSSIBILITY OF SUCH DAMAGE.
28 1.1 bsh */
29 1.1 bsh
30 1.1 bsh #ifndef _EVBARM_G42XXEB_REG_H
31 1.1 bsh #define _EVBARM_G42XXEB_REG_H
32 1.1 bsh
33 1.1 bsh #include <arm/xscale/pxa2x0reg.h>
34 1.1 bsh
35 1.1 bsh /* g42xxeb on-board IOs */
36 1.1 bsh #define G42XXEB_PLDREG_BASE PXA2X0_CS3_START /* Phisical address */
37 1.1 bsh #define G42XXEB_PLDREG_SIZE 0x00000100
38 1.1 bsh
39 1.1 bsh #define G42XXEB_AX88796_PBASE (PXA2X0_CS3_START+0x02000000)
40 1.1 bsh
41 1.1 bsh
42 1.1 bsh /*
43 1.1 bsh * Logical mapping for onboard/integrated peripherals
44 1.1 bsh * that are used while bootstrapping.
45 1.1 bsh */
46 1.1 bsh #define G42XXEB_IO_AREA_VBASE 0xfd000000
47 1.1 bsh #define G42XXEB_PLDREG_VBASE 0xfd000000
48 1.1 bsh #define G42XXEB_INTCTL_VBASE 0xfd100000
49 1.1 bsh #define G42XXEB_CLKMAN_VBASE 0xfd200000
50 1.1 bsh #define G42XXEB_GPIO_VBASE 0xfd300000
51 1.1 bsh
52 1.1 bsh #define G42XXEB_VBASE_FREE 0xfd400000
53 1.1 bsh /* FFUART and/or BTUART are mapped to this area when
54 1.1 bsh used for console or kgdb port */
55 1.1 bsh
56 1.1 bsh /*
57 1.1 bsh * Onboard register address
58 1.1 bsh * (offset from G42XXEB_OBIO_PBASE)
59 1.1 bsh */
60 1.1 bsh #define G42XXEB_INTSTS1 0x0a
61 1.1 bsh #define G42XXEB_INTSTS2 0x0c
62 1.1 bsh #define G42XXEB_INTCNTL 0x0e
63 1.1 bsh #define G42XXEB_INTCNTH 0x10
64 1.1 bsh #define G42XXEB_INTMASK 0x14
65 1.1 bsh
66 1.1 bsh #define G42XXEB_INT_MMCSD 0
67 1.1 bsh #define G42XXEB_INT_SDIO 1
68 1.1 bsh #define G42XXEB_INT_EXT0 2
69 1.1 bsh #define G42XXEB_INT_EXT1 3
70 1.1 bsh #define G42XXEB_INT_USB 4
71 1.1 bsh #define G42XXEB_INT_ETH 5
72 1.1 bsh #define G42XXEB_INT_CODEC 6
73 1.1 bsh #define G42XXEB_INT_EXT2 7
74 1.1 bsh #define G42XXEB_INT_KEY 8
75 1.1 bsh #define G42XXEB_INT_EXT3 9
76 1.1 bsh
77 1.1 bsh #define G42XXEB_N_INTS 10
78 1.1 bsh
79 1.1 bsh /* interrupt type */
80 1.1 bsh #define G42XXEB_INT_LEVEL_LOW 0
81 1.1 bsh #define G42XXEB_INT_LEVEL_HIGH 1
82 1.1 bsh #define G42XXEB_INT_EDGE_FALLING 4
83 1.1 bsh #define G42XXEB_INT_EDGE_RISING 5
84 1.1 bsh #define G42XXEB_INT_EDGE_BOTH 6
85 1.1 bsh
86 1.1 bsh
87 1.1 bsh #define G42XXEB_DIPSW 0x16
88 1.1 bsh #define G42XXEB_LED 0x18
89 1.1 bsh
90 1.1 bsh #define G42XXEB_RST 0x1a
91 1.1 bsh #define RST_ASIX88796 (1<<0)
92 1.1 bsh #define RST_EXT(n) (1<<((n)+1))
93 1.1 bsh #define G42XXEB_EXTCTRL 0x1c
94 1.1 bsh #define G42XXEB_OPTBRDID 0x20
95 1.1 bsh #define G42XXEB_PLDVER 0x22
96 1.1 bsh
97 1.1 bsh
98 1.1 bsh #define G42XXEB_LCDCTL 0x28
99 1.1 bsh #define LCDCTL_BL_ON (1<<7)
100 1.1 bsh #define LCDCTL_DPSH (1<<1)
101 1.1 bsh #define LCDCTL_DPSV (1<<0)
102 1.1 bsh #define LCDCTL_BL_PWM_SHIFT 8 /* Backlight blightness */
103 1.1 bsh #define LCDCTL_BL_PWN (0xff<<LCDCTL_BL_PWM_SHIFT)
104 1.1 bsh
105 1.1 bsh #define G42XXEB_KEYSCAN 0x2a
106 1.1 bsh #define KEYSCAN_SCAN_OUT 0x1f00
107 1.1 bsh #define KEYSCAN_SENSE_IN 0x0f
108 1.1 bsh #define G42XXEB_WP 0x2c // SD/MMC write protect status
109 1.1 bsh
110 1.1 bsh #define ioreg_read(a) (*(volatile unsigned *)(a))
111 1.1 bsh #define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v))
112 1.1 bsh
113 1.1 bsh #define ioreg16_read(a) (*(volatile uint16_t *)(a))
114 1.1 bsh #define ioreg16_write(a,v) (*(volatile uint16_t *)(a)=(v))
115 1.1 bsh
116 1.1 bsh #define ioreg8_read(a) (*(volatile uint8_t *)(a))
117 1.1 bsh #define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v))
118 1.1 bsh
119 1.1 bsh #define pldreg16_read(off) ioreg16_read(G42XXEB_PLDREG_VBASE+(off))
120 1.1 bsh #define pldreg16_write(off,v) ioreg16_write(G42XXEB_PLDREG_VBASE+(off),v)
121 1.1 bsh #define pldreg8_read(off) ioreg8_read(G42XXEB_PLDREG_VBASE+(off))
122 1.1 bsh #define pldreg8_write(off,v) ioreg8_write(G42XXEB_PLDREG_VBASE+(off),v)
123 1.1 bsh
124 1.1 bsh #endif /* _EVBARM_G42XXEB_REG_H */
125