009bf4a71b4aefb4193f2394f5f1c14cbcec5b82
[openwrt/svn-archive/archive.git] / target / linux / adm5120-2.6 / files / include / asm-mips / mach-adm5120 / adm5120_info.h
1 /*
2 * $Id$
3 *
4 * Copyright (C) 2007 OpenWrt.org
5 * Copyright (C) 2007 Gabor Juhos <juhosg@freemail.hu>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23 #ifndef _ADM5120_INFO_H
24 #define _ADM5120_INFO_H
25
26 #include <linux/types.h>
27
28 extern unsigned int adm5120_prom_type;
29 #define ADM5120_PROM_GENERIC 0
30 #define ADM5120_PROM_CFE 1
31 #define ADM5120_PROM_MYLOADER 2
32 #define ADM5120_PROM_ROUTERBOOT 3
33 #define ADM5120_PROM_BOOTBASE 4
34 #define ADM5120_PROM_UBOOT 5
35 #define ADM5120_PROM_LAST 5
36
37 extern unsigned int adm5120_product_code;
38 extern unsigned int adm5120_revision;
39 extern unsigned int adm5120_nand_boot;
40
41 extern unsigned long adm5120_speed;
42 #define ADM5120_SPEED_175 175000000
43 #define ADM5120_SPEED_200 200000000
44 #define ADM5120_SPEED_225 225000000
45 #define ADM5120_SPEED_250 250000000
46
47 extern unsigned int adm5120_package;
48 #define ADM5120_PACKAGE_PQFP 0
49 #define ADM5120_PACKAGE_BGA 1
50
51 extern unsigned long adm5120_memsize;
52
53 /*
54 * TODO:remove adm5120_eth* variables when the switch driver will be
55 * converted into a real platform driver
56 */
57 extern unsigned int adm5120_eth_num_ports;
58 extern unsigned char adm5120_eth_macs[6][6];
59
60 extern void adm5120_mem_init(void) __init;
61 extern void adm5120_time_init(void) __init;
62 extern void adm5120_ndelay(u32 ns);
63
64 extern void adm5120_restart(char *command);
65 extern void adm5120_halt(void);
66 extern void adm5120_power_off(void);
67
68 extern void (*adm5120_board_reset)(void);
69
70 static inline int adm5120_package_pqfp(void)
71 {
72 return (adm5120_package == ADM5120_PACKAGE_PQFP);
73 }
74
75 static inline int adm5120_package_bga(void)
76 {
77 return (adm5120_package == ADM5120_PACKAGE_BGA);
78 }
79
80 static inline int adm5120_has_pci(void)
81 {
82 return (adm5120_package == ADM5120_PACKAGE_BGA);
83 }
84
85 static inline int adm5120_has_gmii(void)
86 {
87 return (adm5120_package == ADM5120_PACKAGE_BGA);
88 }
89
90 #endif /* _ADM5120_INFO_H */