ARM: ux500: update ASIC detection for U5500
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Dec 2011 10:41:09 +0000 (11:41 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 18 Dec 2011 23:35:06 +0000 (00:35 +0100)
This adds a few CPU identification functions for the U5500 variants.
Contains portions of code written by Rabin Vincent.

Cc: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-ux500/include/mach/hardware.h
arch/arm/mach-ux500/include/mach/id.h

index 470ac52663d61e7021586c29de997a78205fdba9..b6ba26a1367da3ebffcc2cfa794a2f7c3497743c 100644 (file)
 #ifndef __MACH_HARDWARE_H
 #define __MACH_HARDWARE_H
 
-/* macros to get at IO space when running virtually
+/*
+ * Macros to get at IO space when running virtually
  * We dont map all the peripherals, let ioremap do
  * this for us. We map only very basic peripherals here.
  */
 #define U8500_IO_VIRTUAL       0xf0000000
 #define U8500_IO_PHYSICAL      0xa0000000
 
-/* this macro is used in assembly, so no cast */
+/* This macro is used in assembly, so no cast */
 #define IO_ADDRESS(x)           \
        (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL)
 
 /* typesafe io address */
 #define __io_address(n)                __io(IO_ADDRESS(n))
-/* used by some plat-nomadik code */
+/* Used by some plat-nomadik code */
 #define io_p2v(n)              __io_address(n)
 
 #include <mach/db8500-regs.h>
@@ -36,6 +37,5 @@ extern void __iomem *_PRCMU_BASE;
 
 #define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
 
-#endif
-
+#endif                         /* __ASSEMBLY__ */
 #endif                         /* __MACH_HARDWARE_H */
index 02b541a37ee5ebca1f28dac8a03e6d248f42a41b..833d6a6edc9b0ebd10755b4b62af9e865ab40225 100644 (file)
@@ -46,6 +46,30 @@ static inline bool __attribute_const__ cpu_is_u5500(void)
        return dbx500_partnumber() == 0x5500;
 }
 
+/*
+ * 5500 revisions
+ */
+
+static inline bool __attribute_const__ cpu_is_u5500v1(void)
+{
+       return cpu_is_u5500() && (dbx500_revision() & 0xf0) == 0xA0;
+}
+
+static inline bool __attribute_const__ cpu_is_u5500v2(void)
+{
+       return (dbx500_id.revision & 0xf0) == 0xB0;
+}
+
+static inline bool __attribute_const__ cpu_is_u5500v20(void)
+{
+       return cpu_is_u5500() && ((dbx500_revision() & 0xf0) == 0xB0);
+}
+
+static inline bool __attribute_const__ cpu_is_u5500v21(void)
+{
+       return cpu_is_u5500() && (dbx500_revision() == 0xB1);
+}
+
 /*
  * 8500 revisions
  */
This page took 0.04049 seconds and 5 git commands to generate.