blob: 10290c31425ba37fda84d4263e71f2a6ec5d99ff [file] [log] [blame]
wdenk47d1a6e2002-11-03 00:01:44 +00001/*
2 * (C) Copyright 2002 Wolfgang Grandegger <wg@denx.de>
3 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
wdenk47d1a6e2002-11-03 00:01:44 +00005 */
6
7#ifndef _PN62_H_
8#define _PN62_H_
9
10/*
11 * Definitions for the Intel Bridge 21554 or 21555.
12 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020013#define I2155X_VPD_ADDR 0xe6
14#define I2155X_VPD_DATA 0xe8
wdenk47d1a6e2002-11-03 00:01:44 +000015
16#define I2155X_VPD_START 0x80
17#define I2155X_VPD_SN_START 0x80
18#define I2155X_VPD_SN_SIZE 0x10
19#define I2155X_VPD_MAC0_START 0x90
20#define I2155X_VPD_MAC1_START 0x96
21
22#define I2155X_SCRAPAD_ADDR 0xa8
23#define I2155X_SCRAPAD_MAX 8
24
25#define I2155X_BAR2_BASE 0x98
26#define I2155X_BAR3_BASE 0x9c
27#define I2155X_BAR4_BASE 0xa0
28
29#define I2155X_BAR2_SETUP 0xb0
30#define I2155X_BAR3_SETUP 0xb4
31#define I2155X_BAR4_SETUP 0xb8
32
33/*
34 * Interrupt request numbers
35 */
36#define PN62_IRQ_HOST 0x0
37#define PN62_IRQ_PLX9054 0x1
38#define PN62_IRQ_ETH0 0x2
39#define PN62_IRQ_ETH1 0x3
40#define PN62_IRQ_COM1 0x4
41#define PN62_IRQ_COM2 0x4
42
43/*
44 * Miscellaneous definitons.
45 */
46#define PN62_SMEM_DEFAULT 0x1f00000
47
48/*
49 * Definitions for boot protocol using Scratchpad registers.
50 */
51#define BOOT_DONE 0
Wolfgang Denk53677ef2008-05-20 16:00:29 +020052#define BOOT_DONE_CLEAR 0x00dead00
53#define BOOT_DONE_ERROR 0xbad0dead
54#define BOOT_DONE_U_BOOT 0x12345678
55#define BOOT_DONE_LINUX 0x87654321
56#define BOOT_CMD 1
57#define BOOT_CMD_MOVE 0x1
58#define BOOT_CMD_BOOT 0x2
wdenk47d1a6e2002-11-03 00:01:44 +000059#define BOOT_DATA 2
60#define BOOT_PROTO 3
Wolfgang Denk53677ef2008-05-20 16:00:29 +020061#define BOOT_PROTO_READY 0x23456789
62#define BOOT_PROTO_CLEAR 0x00000000
wdenk47d1a6e2002-11-03 00:01:44 +000063#define BOOT_STATUS 4
64
65/*
66 * LED Definitions:
67 */
68#define PN62_LED_BASE 0xff800300
69#define PN62_LED_MAX 12
70
71/*
72 * LED0 - 7 mounted on top of board, D1 - D8
73 * LED8 - 11 upper four LEDs on the front panel of the board.
74 */
75#define LED_0 0x00 /* OFF */
76#define LED_1 0x01 /* ON */
77#define LED_SLOW_CLOCK 0x02 /* SLOW 1Hz ish */
78#define LED_nSLOW_CLOCK 0x03 /* inverse of above */
79#define LED_WATCHDOG_OUT 0x06 /* Reset Watchdog level */
80#define LED_WATCHDOG_CLOCK 0x07 /* clock to watchdog */
81
82/*
83 * LED's currently setup in AMD79C973 device as the following:
84 * LED0 100Mbit
85 * LED1 LNKSE
86 * LED2 TX Activity
87 * LED3 RX Activity
88 */
89#define LED_E0_LED0 0x08 /* Ethernet Port 0 LED 0 */
90#define LED_E0_LED1 0x09 /* Ethernet Port 0 LED 1 */
91#define LED_E0_LED2 0x0A /* Ethernet Port 0 LED 2 */
92#define LED_E0_LED3 0x0B /* Ethernet Port 0 LED 3 */
93#define LED_E1_LED0 0x0C /* Ethernet Port 1 LED 0 */
94#define LED_E1_LED1 0x0D /* Ethernet Port 1 LED 1 */
95#define LED_E1_LED2 0x0E /* Ethernet Port 1 LED 2 */
96#define LED_E1_LED3 0x0F /* Ethernet Port 1 LED 3 */
97#define LED_STROBE0 0x10 /* Processor Strobe 0 */
98#define LED_STROBE1 0x11 /* Processor Strobe 1 */
99#define LED_STROBE2 0x12 /* Processor Strobe 2 */
100#define LED_STROBE3 0x13 /* Processor Strobe 3 */
101#define LED_STROBE4 0x14 /* Processor Strobe 4 */
102#define LED_STROBE5 0x15 /* Processor Strobe 5 */
103#define LED_STROBE6 0x16 /* Processor Strobe 6 */
104#define LED_STROBE7 0x17 /* Processor Strobe 7 */
105#define LED_HOST_STROBE0 0x18 /* Host strobe 0 */
106#define LED_HOST_STROBE1 0x19 /* Host strobe 1 */
107#define LED_HOST_STROBE2 0x1A /* Host strobe 2 */
108#define LED_HOST_STROBE3 0x1B /* Host strobe 3 */
109#define LED_HOST_STROBE4 0x1C /* Host strobe 4 */
110#define LED_HOST_STROBE5 0x1D /* Host strobe 5 */
111#define LED_HOST_STROBE6 0x1E /* Host strobe 6 */
112#define LED_HOST_STROBE7 0x1F /* Host strobe 7 */
113#define LED_MPC_INT0 0x20 /* MPC8240 INT 0 */
114#define LED_MPC_INT1 0x21 /* MPC8240 INT 1 */
115#define LED_MPC_INT2 0x22 /* MPC8240 INT 2 */
116#define LED_MPC_INT3 0x23 /* MPC8240 INT 3 */
117#define LED_MPC_INT4 0x24 /* MPC8240 INT 4 */
118#define LED_UART0_CS 0x25 /* UART 0 Chip Select */
119#define LED_UART1_CS 0x26 /* UART 1 Chip Select */
120#define LED_SRAM_CS 0x27 /* SRAM Chip Select */
121#define LED_SRAM_WR 0x28 /* SRAM WR Signal */
122#define LED_SRAM_RD 0x29 /* SRAM RD Signal */
123#define LED_MPC_RCS0 0x2A /* MPC8240 RCS0 Signal */
124#define LED_S_PCI_FRAME 0x2B /* Secondary PCI Frame Signal */
125#define LED_MPC_CS0 0x2C /* MPC8240 CS0 Signal */
126#define LED_HOST_INT 0x2D /* MPC8240 to Host Interrupt signal */
127#define LED_LAST_FUNCTION LED_HOST_INT /* last function */
128
129/*
130 * Forward declarations
131 */
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200132int i2155x_init (void);
wdenk47d1a6e2002-11-03 00:01:44 +0000133void i2155x_write_scrapad(int idx, u32 val);
134u32 i2155x_read_scrapad (int idx);
135void i2155x_set_bar_base (int bar, u32 addr);
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200136int i2155x_read_vpd (int offset, int size, unsigned char *data);
wdenk47d1a6e2002-11-03 00:01:44 +0000137
138int am79c95x_init (void);
139
Wolfgang Denk53677ef2008-05-20 16:00:29 +0200140void set_led (unsigned int number, unsigned int function);
wdenk47d1a6e2002-11-03 00:01:44 +0000141void fatal_error (unsigned int error_code);
142void show_startup_phase (int phase);
143
144
145#endif /* _PN62_H_ */