summaryrefslogtreecommitdiff
path: root/arch/mips/include/asm/mach-pmcs-msp71xx/msp_prom.h
blob: 4120a01c30a9a1cf441d600a165359f92e58894e (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * MIPS boards bootprom interface for the Linux kernel.
 *
 * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
 * Author: Carsten Langgaard, carstenl@mips.com
 *
 * ########################################################################
 *
 * ########################################################################
 */

#ifndef _ASM_MSP_PROM_H
#define _ASM_MSP_PROM_H

#include <linux/types.h>

#define DEVICEID			"deviceid"
#define FEATURES			"features"
#define PROM_ENV			"prom_env"
#define PROM_ENV_FILE			"/proc/"PROM_ENV
#define PROM_ENV_SIZE			256

#define CPU_DEVID_FAMILY		0x0000ff00
#define CPU_DEVID_REVISION		0x000000ff

#define FPGA_IS_POLO(revision) \
		(((revision >= 0xb0) && (revision < 0xd0)))
#define FPGA_IS_5000(revision) \
		((revision >= 0x80) && (revision <= 0x90))
#define FPGA_IS_ZEUS(revision)		((revision < 0x7f))
#define FPGA_IS_DUET(revision) \
		(((revision >= 0xa0) && (revision < 0xb0)))
#define FPGA_IS_MSP4200(revision)	((revision >= 0xd0))
#define FPGA_IS_MSP7100(revision)	((revision >= 0xd0))

#define MACHINE_TYPE_POLO		"POLO"
#define MACHINE_TYPE_DUET		"DUET"
#define MACHINE_TYPE_ZEUS		"ZEUS"
#define MACHINE_TYPE_MSP2000REVB	"MSP2000REVB"
#define MACHINE_TYPE_MSP5000		"MSP5000"
#define MACHINE_TYPE_MSP4200		"MSP4200"
#define MACHINE_TYPE_MSP7120		"MSP7120"
#define MACHINE_TYPE_MSP7130		"MSP7130"
#define MACHINE_TYPE_OTHER		"OTHER"

#define MACHINE_TYPE_POLO_FPGA		"POLO-FPGA"
#define MACHINE_TYPE_DUET_FPGA		"DUET-FPGA"
#define MACHINE_TYPE_ZEUS_FPGA		"ZEUS_FPGA"
#define MACHINE_TYPE_MSP2000REVB_FPGA	"MSP2000REVB-FPGA"
#define MACHINE_TYPE_MSP5000_FPGA	"MSP5000-FPGA"
#define MACHINE_TYPE_MSP4200_FPGA	"MSP4200-FPGA"
#define MACHINE_TYPE_MSP7100_FPGA	"MSP7100-FPGA"
#define MACHINE_TYPE_OTHER_FPGA		"OTHER-FPGA"

/* Device Family definitions */
#define FAMILY_FPGA			0x0000
#define FAMILY_ZEUS			0x1000
#define FAMILY_POLO			0x2000
#define FAMILY_DUET			0x4000
#define FAMILY_TRIAD			0x5000
#define FAMILY_MSP4200			0x4200
#define FAMILY_MSP4200_FPGA		0x4f00
#define FAMILY_MSP7100			0x7100
#define FAMILY_MSP7100_FPGA		0x7f00

/* Device Type definitions */
#define TYPE_MSP7120			0x7120
#define TYPE_MSP7130			0x7130

#define ENET_KEY		'E'
#define ENETTXD_KEY		'e'
#define PCI_KEY			'P'
#define PCIMUX_KEY		'p'
#define SEC_KEY			'S'
#define SPAD_KEY		'D'
#define TDM_KEY			'T'
#define ZSP_KEY			'Z'

#define FEATURE_NOEXIST		'-'
#define FEATURE_EXIST		'+'

#define ENET_MII		'M'
#define ENET_RMII		'R'

#define ENETTXD_FALLING		'F'
#define ENETTXD_RISING		'R'

#define PCI_HOST		'H'
#define PCI_PERIPHERAL		'P'

#define PCIMUX_FULL		'F'
#define PCIMUX_SINGLE		'S'

#define SEC_DUET		'D'
#define SEC_POLO		'P'
#define SEC_SLOW		'S'
#define SEC_TRIAD		'T'

#define SPAD_POLO		'P'

#define TDM_DUET		'D'	/* DUET TDMs might exist */
#define TDM_POLO		'P'	/* POLO TDMs might exist */
#define TDM_TRIAD		'T'	/* TRIAD TDMs might exist */

#define ZSP_DUET		'D'	/* one DUET zsp engine */
#define ZSP_TRIAD		'T'	/* two TRIAD zsp engines */

extern char *prom_getenv(char *name);
extern void prom_init_cmdline(void);
extern void prom_meminit(void);
extern void prom_fixup_mem_map(unsigned long start_mem,
			       unsigned long end_mem);

extern int get_ethernet_addr(char *ethaddr_name, char *ethernet_addr);
extern unsigned long get_deviceid(void);
extern char identify_enet(unsigned long interface_num);
extern char identify_enetTxD(unsigned long interface_num);
extern char identify_pci(void);
extern char identify_sec(void);
extern char identify_spad(void);
extern char identify_sec(void);
extern char identify_tdm(void);
extern char identify_zsp(void);
extern unsigned long identify_family(void);
extern unsigned long identify_revision(void);

/*
 * The following macro calls prom_printf and puts the format string
 * into an init section so it can be reclaimed.
 */
#define ppfinit(f, x...) \
	do { \
		static char _f[] __initdata = KERN_INFO f; \
		printk(_f, ## x); \
	} while (0)

/* Memory descriptor management. */
#define PROM_MAX_PMEMBLOCKS    7	/* 6 used */

enum yamon_memtypes {
	yamon_dontuse,
	yamon_prom,
	yamon_free,
};

struct prom_pmemblock {
	unsigned long base; /* Within KSEG0. */
	unsigned int size;  /* In bytes. */
	unsigned int type;  /* free or prom memory */
};

extern int prom_argc;
extern char **prom_argv;
extern char **prom_envp;
extern int *prom_vec;
extern struct prom_pmemblock *prom_getmdesc(void);

#endif /* !_ASM_MSP_PROM_H */