~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/soc/ixp4xx/cpu.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * IXP4XX cpu type detection
  4  *
  5  * Copyright (C) 2007 MontaVista Software, Inc.
  6  */
  7 
  8 #ifndef __SOC_IXP4XX_CPU_H__
  9 #define __SOC_IXP4XX_CPU_H__
 10 
 11 #include <linux/io.h>
 12 #include <linux/regmap.h>
 13 #ifdef CONFIG_ARM
 14 #include <asm/cputype.h>
 15 #endif
 16 
 17 /* Processor id value in CP15 Register 0 */
 18 #define IXP42X_PROCESSOR_ID_VALUE       0x690541c0 /* including unused 0x690541Ex */
 19 #define IXP42X_PROCESSOR_ID_MASK        0xffffffc0
 20 
 21 #define IXP43X_PROCESSOR_ID_VALUE       0x69054040
 22 #define IXP43X_PROCESSOR_ID_MASK        0xfffffff0
 23 
 24 #define IXP46X_PROCESSOR_ID_VALUE       0x69054200 /* including IXP455 */
 25 #define IXP46X_PROCESSOR_ID_MASK        0xfffffff0
 26 
 27 /* Feature register in the expansion bus controller */
 28 #define IXP4XX_EXP_CNFG2                0x2c
 29 
 30 /* "fuse" bits of IXP_EXP_CFG2 */
 31 /* All IXP4xx CPUs */
 32 #define IXP4XX_FEATURE_RCOMP            (1 << 0)
 33 #define IXP4XX_FEATURE_USB_DEVICE       (1 << 1)
 34 #define IXP4XX_FEATURE_HASH             (1 << 2)
 35 #define IXP4XX_FEATURE_AES              (1 << 3)
 36 #define IXP4XX_FEATURE_DES              (1 << 4)
 37 #define IXP4XX_FEATURE_HDLC             (1 << 5)
 38 #define IXP4XX_FEATURE_AAL              (1 << 6)
 39 #define IXP4XX_FEATURE_HSS              (1 << 7)
 40 #define IXP4XX_FEATURE_UTOPIA           (1 << 8)
 41 #define IXP4XX_FEATURE_NPEB_ETH0        (1 << 9)
 42 #define IXP4XX_FEATURE_NPEC_ETH         (1 << 10)
 43 #define IXP4XX_FEATURE_RESET_NPEA       (1 << 11)
 44 #define IXP4XX_FEATURE_RESET_NPEB       (1 << 12)
 45 #define IXP4XX_FEATURE_RESET_NPEC       (1 << 13)
 46 #define IXP4XX_FEATURE_PCI              (1 << 14)
 47 #define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16)
 48 #define IXP4XX_FEATURE_XSCALE_MAX_FREQ  (3 << 22)
 49 #define IXP42X_FEATURE_MASK             (IXP4XX_FEATURE_RCOMP            | \
 50                                          IXP4XX_FEATURE_USB_DEVICE       | \
 51                                          IXP4XX_FEATURE_HASH             | \
 52                                          IXP4XX_FEATURE_AES              | \
 53                                          IXP4XX_FEATURE_DES              | \
 54                                          IXP4XX_FEATURE_HDLC             | \
 55                                          IXP4XX_FEATURE_AAL              | \
 56                                          IXP4XX_FEATURE_HSS              | \
 57                                          IXP4XX_FEATURE_UTOPIA           | \
 58                                          IXP4XX_FEATURE_NPEB_ETH0        | \
 59                                          IXP4XX_FEATURE_NPEC_ETH         | \
 60                                          IXP4XX_FEATURE_RESET_NPEA       | \
 61                                          IXP4XX_FEATURE_RESET_NPEB       | \
 62                                          IXP4XX_FEATURE_RESET_NPEC       | \
 63                                          IXP4XX_FEATURE_PCI              | \
 64                                          IXP4XX_FEATURE_UTOPIA_PHY_LIMIT | \
 65                                          IXP4XX_FEATURE_XSCALE_MAX_FREQ)
 66 
 67 
 68 /* IXP43x/46x CPUs */
 69 #define IXP4XX_FEATURE_ECC_TIMESYNC     (1 << 15)
 70 #define IXP4XX_FEATURE_USB_HOST         (1 << 18)
 71 #define IXP4XX_FEATURE_NPEA_ETH         (1 << 19)
 72 #define IXP43X_FEATURE_MASK             (IXP42X_FEATURE_MASK             | \
 73                                          IXP4XX_FEATURE_ECC_TIMESYNC     | \
 74                                          IXP4XX_FEATURE_USB_HOST         | \
 75                                          IXP4XX_FEATURE_NPEA_ETH)
 76 
 77 /* IXP46x CPU (including IXP455) only */
 78 #define IXP4XX_FEATURE_NPEB_ETH_1_TO_3  (1 << 20)
 79 #define IXP4XX_FEATURE_RSA              (1 << 21)
 80 #define IXP46X_FEATURE_MASK             (IXP43X_FEATURE_MASK             | \
 81                                          IXP4XX_FEATURE_NPEB_ETH_1_TO_3  | \
 82                                          IXP4XX_FEATURE_RSA)
 83 
 84 #ifdef CONFIG_ARCH_IXP4XX
 85 #define cpu_is_ixp42x_rev_a0() ((read_cpuid_id() & (IXP42X_PROCESSOR_ID_MASK | 0xF)) == \
 86                                 IXP42X_PROCESSOR_ID_VALUE)
 87 #define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \
 88                          IXP42X_PROCESSOR_ID_VALUE)
 89 #define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \
 90                          IXP43X_PROCESSOR_ID_VALUE)
 91 #define cpu_is_ixp46x() ((read_cpuid_id() & IXP46X_PROCESSOR_ID_MASK) == \
 92                          IXP46X_PROCESSOR_ID_VALUE)
 93 static inline u32 cpu_ixp4xx_features(struct regmap *rmap)
 94 {
 95         u32 val;
 96 
 97         regmap_read(rmap, IXP4XX_EXP_CNFG2, &val);
 98         /* For some reason this register is inverted */
 99         val = ~val;
100         if (cpu_is_ixp42x_rev_a0())
101                 return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP |
102                                                IXP4XX_FEATURE_AES);
103         if (cpu_is_ixp42x())
104                 return val & IXP42X_FEATURE_MASK;
105         if (cpu_is_ixp43x())
106                 return val & IXP43X_FEATURE_MASK;
107         return val & IXP46X_FEATURE_MASK;
108 }
109 #else
110 #define cpu_is_ixp42x_rev_a0()          0
111 #define cpu_is_ixp42x()                 0
112 #define cpu_is_ixp43x()                 0
113 #define cpu_is_ixp46x()                 0
114 static inline u32 cpu_ixp4xx_features(struct regmap *rmap)
115 {
116         return 0;
117 }
118 #endif
119 
120 #endif  /* _ASM_ARCH_CPU_H */
121 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php