blob: 9ef682c66f0bff9916f71e35ef1e7dc43788005f [file] [log] [blame]
wdenk161961b2002-03-09 23:21:25 +00001/*
2 * (C) Copyright 2001
3 * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk161961b2002-03-09 23:21:25 +00006 */
7
8#ifndef _W7O_H_
9#define _W7O_H_
10#include <config.h>
11
Wolfgang Denk0ee70772005-09-23 11:05:55 +020012/* AMCC 405GP PowerPC GPIO registers */
13#define PPC405GP_GPIO0_OR 0xef600700L /* GPIO Output */
14#define PPC405GP_GPIO0_TCR 0xef600704L /* GPIO Three-State Control */
15#define PPC405GP_GPIO0_ODR 0xef600718L /* GPIO Open Drain */
16#define PPC405GP_GPIO0_IR 0xef60071cL /* GPIO Input */
wdenk161961b2002-03-09 23:21:25 +000017
wdenk161961b2002-03-09 23:21:25 +000018/* LMG FPGA <=> CPU GPIO signals */
19#define LMG_XCV_INIT 0x10000000L
20#define LMG_XCV_PROG 0x04000000L
21#define LMG_XCV_DONE 0x00400000L
22#define LMG_XCV_CNFG_0 0x08000000L
23#define LMG_XCV_IRQ_0 0x0L
24
25/* LMC FPGA <=> CPU GPIO signals */
26#define LMC_XCV_INIT 0x00800000L
27#define LMC_XCV_PROG 0x40000000L
28#define LMC_XCV_DONE 0x01000000L
29#define LMC_XCV_CNFG_0 0x00004000L /* Shared with IRQ 0 */
30#define LMC_XCV_CNFG_1 0x00002000L /* Shared with IRQ 1 */
31#define LMC_XCV_CNFG_2 0x00001000L /* Shared with IRQ 2 */
32#define LMC_XCV_IRQ_0 0x00080000L /* Shared with GPIO 17 */
33#define LMC_XCV_IRQ_1 0x00040000L /* Shared with GPIO 18 */
34#define LMC_XCV_IRQ_3 0x00020000L /* Shared tiwht GPIO 19 */
35
36
37/*
38 * Setup FPGA <=> GPIO mappings
39 */
40#if defined(CONFIG_W7OLMG)
41# define GPIO_XCV_INIT LMG_XCV_INIT
42# define GPIO_XCV_PROG LMG_XCV_PROG
43# define GPIO_XCV_DONE LMG_XCV_DONE
44# define GPIO_XCV_CNFG LMG_XCV_CNFG_0
45# define GPIO_XCV_IRQ LMG_XCV_IRQ_0
46# define GPIO_GPIO_1 0x40000000L
47# define GPIO_GPIO_6 0x02000000L
48# define GPIO_GPIO_7 0x01000000L
49# define GPIO_GPIO_8 0x00800000L
50#elif defined(CONFIG_W7OLMC)
51# define GPIO_XCV_INIT LMC_XCV_INIT
52# define GPIO_XCV_PROG LMC_XCV_PROG
53# define GPIO_XCV_DONE LMC_XCV_DONE
54# define GPIO_XCV_CNFG LMC_XCV_CNFG_0
55# define GPIO_XCV_IRQ LMC_XCV_IRQ_0
56#else
57# error "Unknown W7O board configuration"
58#endif
59
60/* Power On Self Tests */
61extern void post2(void);
62extern int test_led(void);
63extern int test_sdram(unsigned long size);
64extern void test_fpga(unsigned short *daddr);
65
66/* FGPA */
67extern int init_fpga(void);
68
69/* Misc */
70extern int temp_uart_init(void);
71extern void init_fsboot(void);
72
73#endif /* _W7O_H_ */