MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / asm-mips / mach-pb1x00 / pb1550.h
blob5d28b40fa62e853fe62696efa9eb66b1df110bdc
1 /*
2 * AMD Alchemy Semi PB1550 Referrence Board
3 * Board Registers defines.
5 * Copyright 2004 Embedded Edge LLC.
7 * ########################################################################
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 * ########################################################################
26 #ifndef __ASM_PB1550_H
27 #define __ASM_PB1550_H
29 #include <linux/types.h>
31 #define BCSR_PHYS_ADDR 0xAF000000
33 typedef volatile struct
35 /*00*/ u16 whoami;
36 u16 reserved0;
37 /*04*/ u16 status;
38 u16 reserved1;
39 /*08*/ u16 switches;
40 u16 reserved2;
41 /*0C*/ u16 resets;
42 u16 reserved3;
43 /*10*/ u16 pcmcia;
44 u16 reserved4;
45 /*14*/ u16 pci;
46 u16 reserved5;
47 /*18*/ u16 leds;
48 u16 reserved6;
49 /*1C*/ u16 system;
50 u16 reserved7;
52 } BCSR;
54 static BCSR * const bcsr = (BCSR *)BCSR_PHYS_ADDR;
57 * Register bit definitions for the BCSRs
59 #define BCSR_WHOAMI_DCID 0x000F
60 #define BCSR_WHOAMI_CPLD 0x00F0
61 #define BCSR_WHOAMI_BOARD 0x0F00
63 #define BCSR_STATUS_PCMCIA0VS 0x0003
64 #define BCSR_STATUS_PCMCIA1VS 0x000C
65 #define BCSR_STATUS_PCMCIA0FI 0x0010
66 #define BCSR_STATUS_PCMCIA1FI 0x0020
67 #define BCSR_STATUS_SWAPBOOT 0x0040
68 #define BCSR_STATUS_SRAMWIDTH 0x0080
69 #define BCSR_STATUS_FLASHBUSY 0x0100
70 #define BCSR_STATUS_ROMBUSY 0x0200
71 #define BCSR_STATUS_USBOTGID 0x0800
72 #define BCSR_STATUS_U0RXD 0x1000
73 #define BCSR_STATUS_U1RXD 0x2000
74 #define BCSR_STATUS_U3RXD 0x8000
76 #define BCSR_SWITCHES_OCTAL 0x00FF
77 #define BCSR_SWITCHES_DIP_1 0x0080
78 #define BCSR_SWITCHES_DIP_2 0x0040
79 #define BCSR_SWITCHES_DIP_3 0x0020
80 #define BCSR_SWITCHES_DIP_4 0x0010
81 #define BCSR_SWITCHES_DIP_5 0x0008
82 #define BCSR_SWITCHES_DIP_6 0x0004
83 #define BCSR_SWITCHES_DIP_7 0x0002
84 #define BCSR_SWITCHES_DIP_8 0x0001
85 #define BCSR_SWITCHES_ROTARY 0x0F00
87 #define BCSR_RESETS_PHY0 0x0001
88 #define BCSR_RESETS_PHY1 0x0002
89 #define BCSR_RESETS_DC 0x0004
90 #define BCSR_RESETS_WSC 0x2000
91 #define BCSR_RESETS_SPISEL 0x4000
92 #define BCSR_RESETS_DMAREQ 0x8000
94 #define BCSR_PCMCIA_PC0VPP 0x0003
95 #define BCSR_PCMCIA_PC0VCC 0x000C
96 #define BCSR_PCMCIA_PC0DRVEN 0x0010
97 #define BCSR_PCMCIA_PC0RST 0x0080
98 #define BCSR_PCMCIA_PC1VPP 0x0300
99 #define BCSR_PCMCIA_PC1VCC 0x0C00
100 #define BCSR_PCMCIA_PC1DRVEN 0x1000
101 #define BCSR_PCMCIA_PC1RST 0x8000
103 #define BCSR_PCI_M66EN 0x0001
104 #define BCSR_PCI_M33 0x0100
105 #define BCSR_PCI_EXTERNARB 0x0200
106 #define BCSR_PCI_GPIO200RST 0x0400
107 #define BCSR_PCI_CLKOUT 0x0800
108 #define BCSR_PCI_CFGHOST 0x1000
110 #define BCSR_LEDS_DECIMALS 0x00FF
111 #define BCSR_LEDS_LED0 0x0100
112 #define BCSR_LEDS_LED1 0x0200
113 #define BCSR_LEDS_LED2 0x0400
114 #define BCSR_LEDS_LED3 0x0800
116 #define BCSR_SYSTEM_VDDI 0x001F
117 #define BCSR_SYSTEM_POWEROFF 0x4000
118 #define BCSR_SYSTEM_RESET 0x8000
120 #define PCMCIA_MAX_SOCK 1
121 #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
123 /* VPP/VCC */
124 #define SET_VCC_VPP(VCC, VPP, SLOT)\
125 ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
127 #if defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER)
128 #define PB1550_BOTH_BANKS
129 #elif defined(CONFIG_MTD_PB1550_BOOT) && !defined(CONFIG_MTD_PB1550_USER)
130 #define PB1550_BOOT_ONLY
131 #elif !defined(CONFIG_MTD_PB1550_BOOT) && defined(CONFIG_MTD_PB1550_USER)
132 #define PB1550_USER_ONLY
133 #endif
135 /* Timing values as described in databook, * ns value stripped of
136 * lower 2 bits.
137 * These defines are here rather than an SOC1550 generic file because
138 * the parts chosen on another board may be different and may require
139 * different timings.
141 #define NAND_T_H (18 >> 2)
142 #define NAND_T_PUL (30 >> 2)
143 #define NAND_T_SU (30 >> 2)
144 #define NAND_T_WH (30 >> 2)
146 /* Bitfield shift amounts */
147 #define NAND_T_H_SHIFT 0
148 #define NAND_T_PUL_SHIFT 4
149 #define NAND_T_SU_SHIFT 8
150 #define NAND_T_WH_SHIFT 12
152 #define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
153 ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
154 ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
155 ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
157 #endif /* __ASM_PB1550_H */