]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/pxa/cpuinfo.c
Merge branch 'karo-tx-uboot' into kc-merge
[karo-tx-uboot.git] / arch / arm / cpu / pxa / cpuinfo.c
index f1cdd408eb3537481ab110ae93b921c78b0f1639..17d8be5b5b1c1025902012d87015764ed080764d 100644 (file)
@@ -3,20 +3,7 @@
  *
  * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <errno.h>
 #include <linux/compiler.h>
 
-#define        CPU_MASK_PXA_REVID      0x00f
+#ifdef CONFIG_CPU_PXA25X
+#if ((CONFIG_SYS_INIT_SP_ADDR) != 0xfffff800)
+#error "Init SP address must be set to 0xfffff800 for PXA250"
+#endif
+#endif
+
+#define        CPU_MASK_PXA_PRODID     0x000003f0
+#define        CPU_MASK_PXA_REVID      0x0000000f
+
+#define        CPU_MASK_PRODREV        (CPU_MASK_PXA_PRODID | CPU_MASK_PXA_REVID)
 
-#define        CPU_MASK_PXA_PRODID     0x3f0
 #define        CPU_VALUE_PXA25X        0x100
 #define        CPU_VALUE_PXA27X        0x110
 
@@ -51,6 +46,11 @@ int cpu_is_pxa27x(void)
        return id == CPU_VALUE_PXA27X;
 }
 
+uint32_t pxa_get_cpu_revision(void)
+{
+       return pxa_get_cpuid() & CPU_MASK_PRODREV;
+}
+
 #ifdef CONFIG_DISPLAY_CPUINFO
 static const char *pxa25x_get_revision(void)
 {