summaryrefslogtreecommitdiff
path: root/board/w7o/w7o.h
blob: 9ef682c66f0bff9916f71e35ef1e7dc43788005f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * (C) Copyright 2001
 * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#ifndef _W7O_H_
#define _W7O_H_
#include <config.h>

/* AMCC 405GP PowerPC GPIO registers */
#define PPC405GP_GPIO0_OR	0xef600700L	/* GPIO Output */
#define PPC405GP_GPIO0_TCR	0xef600704L	/* GPIO Three-State Control */
#define PPC405GP_GPIO0_ODR	0xef600718L	/* GPIO Open Drain */
#define PPC405GP_GPIO0_IR	0xef60071cL	/* GPIO Input */

/* LMG FPGA <=> CPU GPIO signals */
#define LMG_XCV_INIT		0x10000000L
#define LMG_XCV_PROG		0x04000000L
#define LMG_XCV_DONE		0x00400000L
#define LMG_XCV_CNFG_0		0x08000000L
#define LMG_XCV_IRQ_0		0x0L

/* LMC FPGA <=> CPU GPIO signals */
#define LMC_XCV_INIT		0x00800000L
#define LMC_XCV_PROG		0x40000000L
#define LMC_XCV_DONE		0x01000000L
#define LMC_XCV_CNFG_0		0x00004000L	/* Shared with IRQ 0 */
#define LMC_XCV_CNFG_1		0x00002000L	/* Shared with IRQ 1 */
#define LMC_XCV_CNFG_2		0x00001000L	/* Shared with IRQ 2 */
#define LMC_XCV_IRQ_0		0x00080000L	/* Shared with GPIO 17 */
#define LMC_XCV_IRQ_1		0x00040000L	/* Shared with GPIO 18 */
#define LMC_XCV_IRQ_3		0x00020000L	/* Shared tiwht GPIO 19 */


/*
 * Setup FPGA <=> GPIO mappings
 */
#if defined(CONFIG_W7OLMG)
# define GPIO_XCV_INIT		LMG_XCV_INIT
# define GPIO_XCV_PROG		LMG_XCV_PROG
# define GPIO_XCV_DONE		LMG_XCV_DONE
# define GPIO_XCV_CNFG		LMG_XCV_CNFG_0
# define GPIO_XCV_IRQ		LMG_XCV_IRQ_0
# define GPIO_GPIO_1		0x40000000L
# define GPIO_GPIO_6		0x02000000L
# define GPIO_GPIO_7		0x01000000L
# define GPIO_GPIO_8		0x00800000L
#elif defined(CONFIG_W7OLMC)
# define GPIO_XCV_INIT		LMC_XCV_INIT
# define GPIO_XCV_PROG		LMC_XCV_PROG
# define GPIO_XCV_DONE		LMC_XCV_DONE
# define GPIO_XCV_CNFG		LMC_XCV_CNFG_0
# define GPIO_XCV_IRQ		LMC_XCV_IRQ_0
#else
# error "Unknown W7O board configuration"
#endif

/* Power On Self Tests */
extern void post2(void);
extern int test_led(void);
extern int test_sdram(unsigned long size);
extern void test_fpga(unsigned short *daddr);

/* FGPA */
extern int init_fpga(void);

/* Misc */
extern int temp_uart_init(void);
extern void init_fsboot(void);

#endif /* _W7O_H_ */