4 * Copyright (C) 2007 OpenWrt.org
5 * Copyright (C) Gabor Juhos <juhosg@freemail.hu>
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.
13 #ifndef _ADM5120_INFO_H
14 #define _ADM5120_INFO_H
16 #include <linux/types.h>
18 #define ADM5120_BOARD_NAMELEN 64
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 */
28 extern struct adm5120_board adm5120_board
;
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
39 extern unsigned int adm5120_product_code
;
40 extern unsigned int adm5120_revision
;
41 extern unsigned int adm5120_nand_boot
;
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
49 extern unsigned int adm5120_package
;
50 #define ADM5120_PACKAGE_PQFP 0
51 #define ADM5120_PACKAGE_BGA 1
53 extern void adm5120_info_init(void);
55 static inline int adm5120_has_pci(void)
57 return (adm5120_package
== ADM5120_PACKAGE_BGA
);
60 static inline int adm5120_has_gmii(void)
62 return (adm5120_package
== ADM5120_PACKAGE_BGA
);
65 static inline char *adm5120_board_name(void)
67 return adm5120_board
.name
;
70 #endif /* _ADM5120_INFO_H */