1 1.1 bsh /* 2 1.2 bsh * Copyright (c) 2002, 2005 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.2 bsh #define G42XXEB_FFUART_VBASE 0xfd400000 52 1.2 bsh #define G42XXEB_BTUART_VBASE 0xfd500000 53 1.1 bsh 54 1.1 bsh /* 55 1.1 bsh * Onboard register address 56 1.1 bsh * (offset from G42XXEB_OBIO_PBASE) 57 1.1 bsh */ 58 1.1 bsh #define G42XXEB_INTSTS1 0x0a 59 1.1 bsh #define G42XXEB_INTSTS2 0x0c 60 1.1 bsh #define G42XXEB_INTCNTL 0x0e 61 1.1 bsh #define G42XXEB_INTCNTH 0x10 62 1.1 bsh #define G42XXEB_INTMASK 0x14 63 1.1 bsh 64 1.1 bsh #define G42XXEB_INT_MMCSD 0 65 1.1 bsh #define G42XXEB_INT_SDIO 1 66 1.1 bsh #define G42XXEB_INT_EXT0 2 67 1.1 bsh #define G42XXEB_INT_EXT1 3 68 1.1 bsh #define G42XXEB_INT_USB 4 69 1.1 bsh #define G42XXEB_INT_ETH 5 70 1.1 bsh #define G42XXEB_INT_CODEC 6 71 1.1 bsh #define G42XXEB_INT_EXT2 7 72 1.1 bsh #define G42XXEB_INT_KEY 8 73 1.1 bsh #define G42XXEB_INT_EXT3 9 74 1.1 bsh 75 1.1 bsh #define G42XXEB_N_INTS 10 76 1.1 bsh 77 1.1 bsh /* interrupt type */ 78 1.1 bsh #define G42XXEB_INT_LEVEL_LOW 0 79 1.1 bsh #define G42XXEB_INT_LEVEL_HIGH 1 80 1.1 bsh #define G42XXEB_INT_EDGE_FALLING 4 81 1.1 bsh #define G42XXEB_INT_EDGE_RISING 5 82 1.1 bsh #define G42XXEB_INT_EDGE_BOTH 6 83 1.1 bsh 84 1.1 bsh 85 1.1 bsh #define G42XXEB_DIPSW 0x16 86 1.1 bsh #define G42XXEB_LED 0x18 87 1.1 bsh 88 1.1 bsh #define G42XXEB_RST 0x1a 89 1.1 bsh #define RST_ASIX88796 (1<<0) 90 1.1 bsh #define RST_EXT(n) (1<<((n)+1)) 91 1.1 bsh #define G42XXEB_EXTCTRL 0x1c 92 1.1 bsh #define G42XXEB_OPTBRDID 0x20 93 1.1 bsh #define G42XXEB_PLDVER 0x22 94 1.1 bsh 95 1.1 bsh 96 1.1 bsh #define G42XXEB_LCDCTL 0x28 97 1.1 bsh #define LCDCTL_BL_ON (1<<7) 98 1.1 bsh #define LCDCTL_DPSH (1<<1) 99 1.1 bsh #define LCDCTL_DPSV (1<<0) 100 1.1 bsh #define LCDCTL_BL_PWM_SHIFT 8 /* Backlight blightness */ 101 1.1 bsh #define LCDCTL_BL_PWN (0xff<<LCDCTL_BL_PWM_SHIFT) 102 1.1 bsh 103 1.1 bsh #define G42XXEB_KEYSCAN 0x2a 104 1.1 bsh #define KEYSCAN_SCAN_OUT 0x1f00 105 1.1 bsh #define KEYSCAN_SENSE_IN 0x0f 106 1.1 bsh #define G42XXEB_WP 0x2c // SD/MMC write protect status 107 1.1 bsh 108 1.1 bsh #define ioreg_read(a) (*(volatile unsigned *)(a)) 109 1.1 bsh #define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v)) 110 1.1 bsh 111 1.1 bsh #define ioreg16_read(a) (*(volatile uint16_t *)(a)) 112 1.1 bsh #define ioreg16_write(a,v) (*(volatile uint16_t *)(a)=(v)) 113 1.1 bsh 114 1.1 bsh #define ioreg8_read(a) (*(volatile uint8_t *)(a)) 115 1.1 bsh #define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v)) 116 1.1 bsh 117 1.1 bsh #define pldreg16_read(off) ioreg16_read(G42XXEB_PLDREG_VBASE+(off)) 118 1.1 bsh #define pldreg16_write(off,v) ioreg16_write(G42XXEB_PLDREG_VBASE+(off),v) 119 1.1 bsh #define pldreg8_read(off) ioreg8_read(G42XXEB_PLDREG_VBASE+(off)) 120 1.1 bsh #define pldreg8_write(off,v) ioreg8_write(G42XXEB_PLDREG_VBASE+(off),v) 121 1.1 bsh 122 1.1 bsh #endif /* _EVBARM_G42XXEB_REG_H */ 123