Skip to content

Commit dd25ed7

Browse files
xen0ntsbogend
authored andcommitted
MIPS: Loongson64: Reorder CPUCFG model match arms
Originally the match arms are ordered by model release date, however the LOONGSON_64R cores are even more reduced capability-wise. So put them at top of the switch block. Suggested-by: Huacai Chen <[email protected]> Signed-off-by: WANG Xuerui <[email protected]> Reviewed-by: Huacai Chen <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent f06da27 commit dd25ed7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

arch/mips/loongson64/cpucfg-emul.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,22 @@ void loongson3_cpucfg_synthesize_data(struct cpuinfo_mips *c)
137137

138138
/* Add CPUCFG features non-discoverable otherwise. */
139139
switch (c->processor_id & (PRID_IMP_MASK | PRID_REV_MASK)) {
140+
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_0:
141+
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_1:
142+
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_2:
143+
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_3:
144+
decode_loongson_config6(c);
145+
probe_uca(c);
146+
147+
c->loongson3_cpucfg_data[0] |= (LOONGSON_CFG1_LSLDR0 |
148+
LOONGSON_CFG1_LSSYNCI | LOONGSON_CFG1_LLSYNC |
149+
LOONGSON_CFG1_TGTSYNC);
150+
c->loongson3_cpucfg_data[1] |= (LOONGSON_CFG2_LBT1 |
151+
LOONGSON_CFG2_LBT2 | LOONGSON_CFG2_LPMP |
152+
LOONGSON_CFG2_LPM_REV2);
153+
c->loongson3_cpucfg_data[2] = 0;
154+
break;
155+
140156
case PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R1:
141157
c->loongson3_cpucfg_data[0] |= (LOONGSON_CFG1_LSLDR0 |
142158
LOONGSON_CFG1_LSSYNCI | LOONGSON_CFG1_LSUCA |
@@ -164,22 +180,6 @@ void loongson3_cpucfg_synthesize_data(struct cpuinfo_mips *c)
164180
LOONGSON_CFG3_LCAMVW_REV1);
165181
break;
166182

167-
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_0:
168-
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_1:
169-
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_2:
170-
case PRID_IMP_LOONGSON_64R | PRID_REV_LOONGSON2K_R1_3:
171-
decode_loongson_config6(c);
172-
probe_uca(c);
173-
174-
c->loongson3_cpucfg_data[0] |= (LOONGSON_CFG1_LSLDR0 |
175-
LOONGSON_CFG1_LSSYNCI | LOONGSON_CFG1_LLSYNC |
176-
LOONGSON_CFG1_TGTSYNC);
177-
c->loongson3_cpucfg_data[1] |= (LOONGSON_CFG2_LBT1 |
178-
LOONGSON_CFG2_LBT2 | LOONGSON_CFG2_LPMP |
179-
LOONGSON_CFG2_LPM_REV2);
180-
c->loongson3_cpucfg_data[2] = 0;
181-
break;
182-
183183
case PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0:
184184
case PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_1:
185185
case PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R3_0:

0 commit comments

Comments
 (0)