diff options
-rw-r--r-- | arch/arm/mach-ep93xx/include/mach/ts72xx.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h index ee7f87589efa..f1397a13e76b 100644 --- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h +++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * TS72xx memory map: | 6 | * TS72xx memory map: |
7 | * | 7 | * |
8 | * virt phys size | 8 | * virt phys size |
9 | * febff000 22000000 4K model number register | 9 | * febff000 22000000 4K model number register (bits 0-2) |
10 | * febfe000 22400000 4K options register | 10 | * febfe000 22400000 4K options register |
11 | * febfd000 22800000 4K options register #2 | 11 | * febfd000 22800000 4K options register #2 |
12 | * febf9000 10800000 4K TS-5620 RTC index register | 12 | * febf9000 10800000 4K TS-5620 RTC index register |
@@ -22,6 +22,7 @@ | |||
22 | #define TS72XX_MODEL_TS7260 0x02 | 22 | #define TS72XX_MODEL_TS7260 0x02 |
23 | #define TS72XX_MODEL_TS7300 0x03 | 23 | #define TS72XX_MODEL_TS7300 0x03 |
24 | #define TS72XX_MODEL_TS7400 0x04 | 24 | #define TS72XX_MODEL_TS7400 0x04 |
25 | #define TS72XX_MODEL_MASK 0x07 | ||
25 | 26 | ||
26 | 27 | ||
27 | #define TS72XX_OPTIONS_PHYS_BASE 0x22400000 | 28 | #define TS72XX_OPTIONS_PHYS_BASE 0x22400000 |
@@ -53,29 +54,34 @@ | |||
53 | 54 | ||
54 | #ifndef __ASSEMBLY__ | 55 | #ifndef __ASSEMBLY__ |
55 | 56 | ||
57 | static inline int ts72xx_model(void) | ||
58 | { | ||
59 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) & TS72XX_MODEL_MASK; | ||
60 | } | ||
61 | |||
56 | static inline int board_is_ts7200(void) | 62 | static inline int board_is_ts7200(void) |
57 | { | 63 | { |
58 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7200; | 64 | return ts72xx_model() == TS72XX_MODEL_TS7200; |
59 | } | 65 | } |
60 | 66 | ||
61 | static inline int board_is_ts7250(void) | 67 | static inline int board_is_ts7250(void) |
62 | { | 68 | { |
63 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7250; | 69 | return ts72xx_model() == TS72XX_MODEL_TS7250; |
64 | } | 70 | } |
65 | 71 | ||
66 | static inline int board_is_ts7260(void) | 72 | static inline int board_is_ts7260(void) |
67 | { | 73 | { |
68 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7260; | 74 | return ts72xx_model() == TS72XX_MODEL_TS7260; |
69 | } | 75 | } |
70 | 76 | ||
71 | static inline int board_is_ts7300(void) | 77 | static inline int board_is_ts7300(void) |
72 | { | 78 | { |
73 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7300; | 79 | return ts72xx_model() == TS72XX_MODEL_TS7300; |
74 | } | 80 | } |
75 | 81 | ||
76 | static inline int board_is_ts7400(void) | 82 | static inline int board_is_ts7400(void) |
77 | { | 83 | { |
78 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7400; | 84 | return ts72xx_model() == TS72XX_MODEL_TS7400; |
79 | } | 85 | } |
80 | 86 | ||
81 | static inline int is_max197_installed(void) | 87 | static inline int is_max197_installed(void) |