perf tools: Streamline bpf examples and headers installation
[linux/fpc-iii.git] / arch / arm / mach-ep93xx / ts72xx.h
blob00b4941d29c95000bd851f0e3100455bce9611c1
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * arch/arm/mach-ep93xx/include/mach/ts72xx.h
4 */
6 /*
7 * TS72xx memory map:
9 * virt phys size
10 * febff000 22000000 4K model number register (bits 0-2)
11 * febfe000 22400000 4K options register
12 * febfd000 22800000 4K options register #2
13 * febfc000 23400000 4K CPLD version register
16 #ifndef __TS72XX_H_
17 #define __TS72XX_H_
19 #define TS72XX_MODEL_PHYS_BASE 0x22000000
20 #define TS72XX_MODEL_VIRT_BASE IOMEM(0xfebff000)
21 #define TS72XX_MODEL_SIZE 0x00001000
23 #define TS72XX_MODEL_TS7200 0x00
24 #define TS72XX_MODEL_TS7250 0x01
25 #define TS72XX_MODEL_TS7260 0x02
26 #define TS72XX_MODEL_TS7300 0x03
27 #define TS72XX_MODEL_TS7400 0x04
28 #define TS72XX_MODEL_MASK 0x07
31 #define TS72XX_OPTIONS_PHYS_BASE 0x22400000
32 #define TS72XX_OPTIONS_VIRT_BASE IOMEM(0xfebfe000)
33 #define TS72XX_OPTIONS_SIZE 0x00001000
35 #define TS72XX_OPTIONS_COM2_RS485 0x02
36 #define TS72XX_OPTIONS_MAX197 0x01
39 #define TS72XX_OPTIONS2_PHYS_BASE 0x22800000
40 #define TS72XX_OPTIONS2_VIRT_BASE IOMEM(0xfebfd000)
41 #define TS72XX_OPTIONS2_SIZE 0x00001000
43 #define TS72XX_OPTIONS2_TS9420 0x04
44 #define TS72XX_OPTIONS2_TS9420_BOOT 0x02
46 #define TS72XX_CPLDVER_PHYS_BASE 0x23400000
47 #define TS72XX_CPLDVER_VIRT_BASE IOMEM(0xfebfc000)
48 #define TS72XX_CPLDVER_SIZE 0x00001000
50 #ifndef __ASSEMBLY__
52 static inline int ts72xx_model(void)
54 return __raw_readb(TS72XX_MODEL_VIRT_BASE) & TS72XX_MODEL_MASK;
57 static inline int board_is_ts7200(void)
59 return ts72xx_model() == TS72XX_MODEL_TS7200;
62 static inline int board_is_ts7250(void)
64 return ts72xx_model() == TS72XX_MODEL_TS7250;
67 static inline int board_is_ts7260(void)
69 return ts72xx_model() == TS72XX_MODEL_TS7260;
72 static inline int board_is_ts7300(void)
74 return ts72xx_model() == TS72XX_MODEL_TS7300;
77 static inline int board_is_ts7400(void)
79 return ts72xx_model() == TS72XX_MODEL_TS7400;
82 static inline int is_max197_installed(void)
84 return !!(__raw_readb(TS72XX_OPTIONS_VIRT_BASE) &
85 TS72XX_OPTIONS_MAX197);
88 static inline int is_ts9420_installed(void)
90 return !!(__raw_readb(TS72XX_OPTIONS2_VIRT_BASE) &
91 TS72XX_OPTIONS2_TS9420);
93 #endif
94 #endif /* __TS72XX_H_ */