~ [ 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 ] ~

Diff markup

Differences between /include/linux/soc/ixp4xx/cpu.h (Architecture sparc) and /include/linux/soc/ixp4xx/cpu.h (Architecture i386)


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