diff options
author | Mika Westerberg <mika.westerberg@iki.fi> | 2010-03-27 07:05:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-04-14 06:19:24 -0400 |
commit | 99e6a23adfadc2da2006f3715c4332c3bf502c07 (patch) | |
tree | 5e97ad3f9e7935c7afa885cb8b09913d20097a11 | |
parent | b370e082e7c4bd47195b2ec117ceeadd9286d8c0 (diff) |
ARM: 5998/1: ep93xx: added chip revision reading function
Added a new function: ep93xx_chip_revision() which reads chip revision
from the sysconfig register.
Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/include/mach/platform.h | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 5b1d836c2f05..8d3f77e9fa86 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -222,6 +222,20 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits) | |||
222 | } | 222 | } |
223 | EXPORT_SYMBOL(ep93xx_devcfg_set_clear); | 223 | EXPORT_SYMBOL(ep93xx_devcfg_set_clear); |
224 | 224 | ||
225 | /** | ||
226 | * ep93xx_chip_revision() - returns the EP93xx chip revision | ||
227 | * | ||
228 | * See <mach/platform.h> for more information. | ||
229 | */ | ||
230 | unsigned int ep93xx_chip_revision(void) | ||
231 | { | ||
232 | unsigned int v; | ||
233 | |||
234 | v = __raw_readl(EP93XX_SYSCON_SYSCFG); | ||
235 | v &= EP93XX_SYSCON_SYSCFG_REV_MASK; | ||
236 | v >>= EP93XX_SYSCON_SYSCFG_REV_SHIFT; | ||
237 | return v; | ||
238 | } | ||
225 | 239 | ||
226 | /************************************************************************* | 240 | /************************************************************************* |
227 | * EP93xx peripheral handling | 241 | * EP93xx peripheral handling |
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index c6dc14dbca18..b663390b4d87 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
@@ -33,6 +33,14 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits) | |||
33 | ep93xx_devcfg_set_clear(0x00, bits); | 33 | ep93xx_devcfg_set_clear(0x00, bits); |
34 | } | 34 | } |
35 | 35 | ||
36 | #define EP93XX_CHIP_REV_D0 3 | ||
37 | #define EP93XX_CHIP_REV_D1 4 | ||
38 | #define EP93XX_CHIP_REV_E0 5 | ||
39 | #define EP93XX_CHIP_REV_E1 6 | ||
40 | #define EP93XX_CHIP_REV_E2 7 | ||
41 | |||
42 | unsigned int ep93xx_chip_revision(void); | ||
43 | |||
36 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); | 44 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); |
37 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | 45 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, |
38 | struct i2c_board_info *devices, int num); | 46 | struct i2c_board_info *devices, int num); |