]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/omap-common/hwinit-common.c
OMAP4/5: device: Add support to get the device type.
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / omap-common / hwinit-common.c
index ab46bff5af7ab32b62e9fbb243e0896737c2a1aa..10e766980554a568f46665c6eea32090c1272ce1 100644 (file)
@@ -217,7 +217,11 @@ int arch_cpu_init(void)
  */
 u32 get_device_type(void)
 {
-       return 0;
+       struct omap_sys_ctrl_regs *ctrl =
+                     (struct omap_sys_ctrl_regs *) SYSCTRL_GENERAL_CORE_BASE;
+
+       return (readl(&ctrl->control_status) &
+                                     (DEVICE_TYPE_MASK)) >> DEVICE_TYPE_SHIFT;
 }
 
 /*