dbb02cf8ed7a5dfcaaeb5e0c6a26190c86eae0b9
[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) Gabor Juhos <juhosg@freemail.hu>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13 #ifndef _ADM5120_INFO_H
14 #define _ADM5120_INFO_H
15
16 #include <linux/types.h>
17
18 #define ADM5120_BOARD_NAMELEN 64
19
20 struct adm5120_board {
21 char name[ADM5120_BOARD_NAMELEN];
22 unsigned long mach_type;
23 unsigned int iface_num; /* Number of Ethernet interfaces */
24 unsigned int has_usb; /* USB controller presence flag */
25 u32 flash0_size; /* Flash 0 size */
26 };
27
28 extern struct adm5120_board adm5120_board;
29
30 extern unsigned int adm5120_boot_loader;
31 #define BOOT_LOADER_UNKNOWN 0
32 #define BOOT_LOADER_CFE 1
33 #define BOOT_LOADER_UBOOT 2
34 #define BOOT_LOADER_MYLOADER 3
35 #define BOOT_LOADER_ROUTERBOOT 4
36 #define BOOT_LOADER_BOOTBASE 5
37 #define BOOT_LOADER_LAST 5
38
39 extern unsigned int adm5120_product_code;
40 extern unsigned int adm5120_revision;
41 extern unsigned int adm5120_nand_boot;
42
43 extern unsigned long adm5120_speed;
44 #define ADM5120_SPEED_175 175000000
45 #define ADM5120_SPEED_200 200000000
46 #define ADM5120_SPEED_225 225000000
47 #define ADM5120_SPEED_250 250000000
48
49 extern unsigned int adm5120_package;
50 #define ADM5120_PACKAGE_PQFP 0
51 #define ADM5120_PACKAGE_BGA 1
52
53 extern void adm5120_info_init(void);
54
55 static inline int adm5120_has_pci(void)
56 {
57 return (adm5120_package == ADM5120_PACKAGE_BGA);
58 }
59
60 static inline int adm5120_has_gmii(void)
61 {
62 return (adm5120_package == ADM5120_PACKAGE_BGA);
63 }
64
65 static inline char *adm5120_board_name(void)
66 {
67 return adm5120_board.name;
68 }
69
70 #endif /* _ADM5120_INFO_H */