diff options
author | Petr Štetiar <ynezz@true.cz> | 2011-06-17 06:11:59 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-08-15 06:58:59 -0400 |
commit | 505ed6fd82608bd4f26d487220ec40a3c5d0dded (patch) | |
tree | 7326ad35f9a117e2ea423c55b3d3ba423f909ec5 /arch | |
parent | 2a004c686e7997ddb795dbce10b263e241f9bdaf (diff) |
ARM: 6967/1: ep93xx: ts72xx: fix board model detection
Fix the obvious error in board detection logic, because according to the TS's
manual, the model is stored in the least three significant bits. For example
the byte read on my ts-7300 is 0x23 and the detection then fails.
Cc: Ryan Mallon <ryan@bluewatersys.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-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) |