ARM: mmp: move cputype.h to include/linux/soc/
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 8 Aug 2019 13:47:24 +0000 (15:47 +0200)
committerLubomir Rintel <lkundrak@v3.sk>
Thu, 17 Oct 2019 14:36:12 +0000 (16:36 +0200)
Let's move cputype.h away from mach-mmp/ so that the drivers outside that
directory are able to tell the precise silicon revision. The MMP3 USB OTG
PHY driver needs this.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
12 files changed:
MAINTAINERS
arch/arm/mach-mmp/common.c
arch/arm/mach-mmp/cputype.h [deleted file]
arch/arm/mach-mmp/devices.c
arch/arm/mach-mmp/mmp2.c
arch/arm/mach-mmp/pm-mmp2.c
arch/arm/mach-mmp/pm-pxa910.c
arch/arm/mach-mmp/pxa168.c
arch/arm/mach-mmp/pxa910.c
arch/arm/mach-mmp/time.c
include/Kbuild
include/linux/soc/mmp/cputype.h [new file with mode: 0644]

index 296de2b51c832ecc1869a77624c964ce398a5236..85f64ade294d1e8e9bf27f17a91367b25dfaa3f6 100644 (file)
@@ -10908,6 +10908,7 @@ L:      linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Odd Fixes
 F:     arch/arm/boot/dts/mmp*
 F:     arch/arm/mach-mmp/
+F:     linux/soc/mmp/
 
 MMU GATHER AND TLB INVALIDATION
 M:     Will Deacon <will@kernel.org>
index 24c689a01ecb75e1133d44fee1fbdcc367f3b8c3..e94349d4726ca34ef521b175768e78993aa1db61 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
 #include "addr-map.h"
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 
 #include "common.h"
 
diff --git a/arch/arm/mach-mmp/cputype.h b/arch/arm/mach-mmp/cputype.h
deleted file mode 100644 (file)
index c3ec889..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __ASM_MACH_CPUTYPE_H
-#define __ASM_MACH_CPUTYPE_H
-
-#include <asm/cputype.h>
-
-/*
- *  CPU   Stepping   CPU_ID      CHIP_ID
- *
- * PXA168    S0    0x56158400   0x0000C910
- * PXA168    A0    0x56158400   0x00A0A168
- * PXA910    Y1    0x56158400   0x00F2C920
- * PXA910    A0    0x56158400   0x00F2C910
- * PXA910    A1    0x56158400   0x00A0C910
- * PXA920    Y0    0x56158400   0x00F2C920
- * PXA920    A0    0x56158400   0x00A0C920
- * PXA920    A1    0x56158400   0x00A1C920
- * MMP2             Z0    0x560f5811   0x00F00410
- * MMP2      Z1    0x560f5811   0x00E00410
- * MMP2      A0    0x560f5811   0x00A0A610
- * MMP3      A0    0x562f5842   0x00A02128
- * MMP3      B0    0x562f5842   0x00B02128
- */
-
-extern unsigned int mmp_chip_id;
-
-#ifdef CONFIG_CPU_PXA168
-static inline int cpu_is_pxa168(void)
-{
-       return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
-               ((mmp_chip_id & 0xfff) == 0x168);
-}
-#else
-#define cpu_is_pxa168()        (0)
-#endif
-
-/* cpu_is_pxa910() is shared on both pxa910 and pxa920 */
-#ifdef CONFIG_CPU_PXA910
-static inline int cpu_is_pxa910(void)
-{
-       return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
-               (((mmp_chip_id & 0xfff) == 0x910) ||
-                ((mmp_chip_id & 0xfff) == 0x920));
-}
-#else
-#define cpu_is_pxa910()        (0)
-#endif
-
-#if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT)
-static inline int cpu_is_mmp2(void)
-{
-       return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
-               (((mmp_chip_id & 0xfff) == 0x410) ||
-                ((mmp_chip_id & 0xfff) == 0x610));
-}
-#else
-#define cpu_is_mmp2()  (0)
-#endif
-
-#ifdef CONFIG_MACH_MMP3_DT
-static inline int cpu_is_mmp3(void)
-{
-       return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
-               ((mmp_chip_id & 0xffff) == 0x2128);
-}
-
-static inline int cpu_is_mmp3_a0(void)
-{
-       return (cpu_is_mmp3() &&
-               ((mmp_chip_id & 0x00ff0000) == 0x00a00000));
-}
-
-static inline int cpu_is_mmp3_b0(void)
-{
-       return (cpu_is_mmp3() &&
-               ((mmp_chip_id & 0x00ff0000) == 0x00b00000));
-}
-
-#else
-#define cpu_is_mmp3()          (0)
-#define cpu_is_mmp3_a0()       (0)
-#define cpu_is_mmp3_b0()       (0)
-#endif
-
-#endif /* __ASM_MACH_CPUTYPE_H */
index 130c1a603ba291df5f9a89a5c96c02804ccf5f42..18bee66a671ffd99265f89fce84e284ce8648817 100644 (file)
@@ -11,7 +11,7 @@
 #include <asm/irq.h>
 #include "irqs.h"
 #include "devices.h"
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 #include "regs-usb.h"
 
 int __init pxa_register_device(struct pxa_device_desc *desc,
index 18ea3e1a26e69056448f9254d69ed2dd6b956c31..bbc4c2274de3a9beb454aa39316ef1f128dc7731 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/mach/time.h>
 #include "addr-map.h"
 #include "regs-apbc.h"
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 #include "irqs.h"
 #include "mfp.h"
 #include "devices.h"
index 2923dd5732a62e78296339fdfde8fe43b189c10d..2d86381e152d6604cb9d4cb96e655a14885f8ca0 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/interrupt.h>
 #include <asm/mach-types.h>
 
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 #include "addr-map.h"
 #include "pm-mmp2.h"
 #include "regs-icu.h"
index 58535ce206dc5568ddc84ce6e9914b69724118ff..69ebe18ff209fa39d72d06391ee56240ed320fad 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/mach-types.h>
 #include <asm/outercache.h>
 
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 #include "addr-map.h"
 #include "pm-pxa910.h"
 #include "regs-icu.h"
index 6e02774889679502168fc2dd61f4c04afb3b0789..b642e900727a5a8c4d4a2f7ce49f5f2966b8febe 100644 (file)
@@ -21,7 +21,7 @@
 #include "addr-map.h"
 #include "clock.h"
 #include "common.h"
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 #include "devices.h"
 #include "irqs.h"
 #include "mfp.h"
index cba31c758dea63801646a47768c3903916873563..b19a069d9fabe421c005d314d4477aca77f313f3 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/mach/time.h>
 #include "addr-map.h"
 #include "regs-apbc.h"
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 #include "irqs.h"
 #include "mfp.h"
 #include "devices.h"
index 8f4cacbf640e97fa8a017e31eaee6a6521128eab..110dcb3314d13f04c4e783a5762dbcd401c6f77e 100644 (file)
@@ -33,7 +33,7 @@
 #include "regs-timers.h"
 #include "regs-apbc.h"
 #include "irqs.h"
-#include "cputype.h"
+#include <linux/soc/mmp/cputype.h>
 #include "clock.h"
 
 #define TIMERS_VIRT_BASE       TIMERS1_VIRT_BASE
index ffba79483cc5edad5f3327a624bd0c1bba2aa822..5a01ab62f61ebbfce4ab3fd44412fa5275e66dd3 100644 (file)
@@ -633,6 +633,7 @@ header-test-                        += linux/soc/amlogic/meson-canvas.h
 header-test-                   += linux/soc/brcmstb/brcmstb.h
 header-test-                   += linux/soc/ixp4xx/npe.h
 header-test-                   += linux/soc/mediatek/infracfg.h
+header-test-                   += linux/soc/mmp/cputype.h
 header-test-                   += linux/soc/qcom/smd-rpm.h
 header-test-                   += linux/soc/qcom/smem.h
 header-test-                   += linux/soc/qcom/smem_state.h
diff --git a/include/linux/soc/mmp/cputype.h b/include/linux/soc/mmp/cputype.h
new file mode 100644 (file)
index 0000000..c3ec889
--- /dev/null
@@ -0,0 +1,85 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_MACH_CPUTYPE_H
+#define __ASM_MACH_CPUTYPE_H
+
+#include <asm/cputype.h>
+
+/*
+ *  CPU   Stepping   CPU_ID      CHIP_ID
+ *
+ * PXA168    S0    0x56158400   0x0000C910
+ * PXA168    A0    0x56158400   0x00A0A168
+ * PXA910    Y1    0x56158400   0x00F2C920
+ * PXA910    A0    0x56158400   0x00F2C910
+ * PXA910    A1    0x56158400   0x00A0C910
+ * PXA920    Y0    0x56158400   0x00F2C920
+ * PXA920    A0    0x56158400   0x00A0C920
+ * PXA920    A1    0x56158400   0x00A1C920
+ * MMP2             Z0    0x560f5811   0x00F00410
+ * MMP2      Z1    0x560f5811   0x00E00410
+ * MMP2      A0    0x560f5811   0x00A0A610
+ * MMP3      A0    0x562f5842   0x00A02128
+ * MMP3      B0    0x562f5842   0x00B02128
+ */
+
+extern unsigned int mmp_chip_id;
+
+#ifdef CONFIG_CPU_PXA168
+static inline int cpu_is_pxa168(void)
+{
+       return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
+               ((mmp_chip_id & 0xfff) == 0x168);
+}
+#else
+#define cpu_is_pxa168()        (0)
+#endif
+
+/* cpu_is_pxa910() is shared on both pxa910 and pxa920 */
+#ifdef CONFIG_CPU_PXA910
+static inline int cpu_is_pxa910(void)
+{
+       return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
+               (((mmp_chip_id & 0xfff) == 0x910) ||
+                ((mmp_chip_id & 0xfff) == 0x920));
+}
+#else
+#define cpu_is_pxa910()        (0)
+#endif
+
+#if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT)
+static inline int cpu_is_mmp2(void)
+{
+       return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
+               (((mmp_chip_id & 0xfff) == 0x410) ||
+                ((mmp_chip_id & 0xfff) == 0x610));
+}
+#else
+#define cpu_is_mmp2()  (0)
+#endif
+
+#ifdef CONFIG_MACH_MMP3_DT
+static inline int cpu_is_mmp3(void)
+{
+       return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
+               ((mmp_chip_id & 0xffff) == 0x2128);
+}
+
+static inline int cpu_is_mmp3_a0(void)
+{
+       return (cpu_is_mmp3() &&
+               ((mmp_chip_id & 0x00ff0000) == 0x00a00000));
+}
+
+static inline int cpu_is_mmp3_b0(void)
+{
+       return (cpu_is_mmp3() &&
+               ((mmp_chip_id & 0x00ff0000) == 0x00b00000));
+}
+
+#else
+#define cpu_is_mmp3()          (0)
+#define cpu_is_mmp3_a0()       (0)
+#define cpu_is_mmp3_b0()       (0)
+#endif
+
+#endif /* __ASM_MACH_CPUTYPE_H */