tizen 2.4 release
[kernel/u-boot-tm1.git] / board / w7o / w7o.h
1 /*
2  * (C) Copyright 2001
3  * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23
24 #ifndef _W7O_H_
25 #define _W7O_H_
26 #include <config.h>
27
28 /* AMCC 405GP PowerPC GPIO registers */
29 #define PPC405GP_GPIO0_OR       0xef600700L     /* GPIO Output */
30 #define PPC405GP_GPIO0_TCR      0xef600704L     /* GPIO Three-State Control */
31 #define PPC405GP_GPIO0_ODR      0xef600718L     /* GPIO Open Drain */
32 #define PPC405GP_GPIO0_IR       0xef60071cL     /* GPIO Input */
33
34 /* LMG FPGA <=> CPU GPIO signals */
35 #define LMG_XCV_INIT            0x10000000L
36 #define LMG_XCV_PROG            0x04000000L
37 #define LMG_XCV_DONE            0x00400000L
38 #define LMG_XCV_CNFG_0          0x08000000L
39 #define LMG_XCV_IRQ_0           0x0L
40
41 /* LMC FPGA <=> CPU GPIO signals */
42 #define LMC_XCV_INIT            0x00800000L
43 #define LMC_XCV_PROG            0x40000000L
44 #define LMC_XCV_DONE            0x01000000L
45 #define LMC_XCV_CNFG_0          0x00004000L     /* Shared with IRQ 0 */
46 #define LMC_XCV_CNFG_1          0x00002000L     /* Shared with IRQ 1 */
47 #define LMC_XCV_CNFG_2          0x00001000L     /* Shared with IRQ 2 */
48 #define LMC_XCV_IRQ_0           0x00080000L     /* Shared with GPIO 17 */
49 #define LMC_XCV_IRQ_1           0x00040000L     /* Shared with GPIO 18 */
50 #define LMC_XCV_IRQ_3           0x00020000L     /* Shared tiwht GPIO 19 */
51
52
53 /*
54  * Setup FPGA <=> GPIO mappings
55  */
56 #if defined(CONFIG_W7OLMG)
57 # define GPIO_XCV_INIT          LMG_XCV_INIT
58 # define GPIO_XCV_PROG          LMG_XCV_PROG
59 # define GPIO_XCV_DONE          LMG_XCV_DONE
60 # define GPIO_XCV_CNFG          LMG_XCV_CNFG_0
61 # define GPIO_XCV_IRQ           LMG_XCV_IRQ_0
62 # define GPIO_GPIO_1            0x40000000L
63 # define GPIO_GPIO_6            0x02000000L
64 # define GPIO_GPIO_7            0x01000000L
65 # define GPIO_GPIO_8            0x00800000L
66 #elif defined(CONFIG_W7OLMC)
67 # define GPIO_XCV_INIT          LMC_XCV_INIT
68 # define GPIO_XCV_PROG          LMC_XCV_PROG
69 # define GPIO_XCV_DONE          LMC_XCV_DONE
70 # define GPIO_XCV_CNFG          LMC_XCV_CNFG_0
71 # define GPIO_XCV_IRQ           LMC_XCV_IRQ_0
72 #else
73 # error "Unknown W7O board configuration"
74 #endif
75
76 /* Power On Self Tests */
77 extern void post2(void);
78 extern int test_led(void);
79 extern int test_sdram(unsigned long size);
80 extern void test_fpga(unsigned short *daddr);
81
82 /* FGPA */
83 extern int init_fpga(void);
84
85 /* Misc */
86 extern int temp_uart_init(void);
87 extern void init_fsboot(void);
88
89 #endif /* _W7O_H_ */