[MIPS] Save write-only Config.OD from being clobbered Save the Config.OD bit from being clobbered by coherency_setup(). This bit, when set, fixes various errata in the early steppings of Au1x00 SOCs. Unfortunately, the bit was write-only on the most early of them. In addition, also restore the bit after a wakeup from sleep. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by Sergei Shtylyov and committed by Ralf Baechle 9370b351 cac4bcbc

+39
+5
arch/mips/au1000/common/sleeper.S
··· 112 112 mtc0 k0, CP0_PAGEMASK 113 113 lw k0, 0x14(sp) 114 114 mtc0 k0, CP0_CONFIG 115 + 116 + /* We need to catch the ealry Alchemy SOCs with 117 + * the write-only Config[OD] bit and set it back to one... 118 + */ 119 + jal au1x00_fixup_config_od 115 120 lw $1, PT_R1(sp) 116 121 lw $2, PT_R2(sp) 117 122 lw $3, PT_R3(sp)
+34
arch/mips/mm/c-r4k.c
··· 1161 1161 c->options |= MIPS_CPU_SUBSET_CACHES; 1162 1162 } 1163 1163 1164 + void au1x00_fixup_config_od(void) 1165 + { 1166 + /* 1167 + * c0_config.od (bit 19) was write only (and read as 0) 1168 + * on the early revisions of Alchemy SOCs. It disables the bus 1169 + * transaction overlapping and needs to be set to fix various errata. 1170 + */ 1171 + switch (read_c0_prid()) { 1172 + case 0x00030100: /* Au1000 DA */ 1173 + case 0x00030201: /* Au1000 HA */ 1174 + case 0x00030202: /* Au1000 HB */ 1175 + case 0x01030200: /* Au1500 AB */ 1176 + /* 1177 + * Au1100 errata actually keeps silence about this bit, so we set it 1178 + * just in case for those revisions that require it to be set according 1179 + * to arch/mips/au1000/common/cputable.c 1180 + */ 1181 + case 0x02030200: /* Au1100 AB */ 1182 + case 0x02030201: /* Au1100 BA */ 1183 + case 0x02030202: /* Au1100 BC */ 1184 + set_c0_config(1 << 19); 1185 + break; 1186 + } 1187 + } 1188 + 1164 1189 static inline void coherency_setup(void) 1165 1190 { 1166 1191 change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT); ··· 1205 1180 case CPU_R4400SC: 1206 1181 case CPU_R4400MC: 1207 1182 clear_c0_config(CONF_CU); 1183 + break; 1184 + /* 1185 + * We need to catch the ealry Alchemy SOCs with 1186 + * the write-only co_config.od bit and set it back to one... 1187 + */ 1188 + case CPU_AU1000: /* rev. DA, HA, HB */ 1189 + case CPU_AU1100: /* rev. AB, BA, BC ?? */ 1190 + case CPU_AU1500: /* rev. AB */ 1191 + au1x00_fixup_config_od(); 1208 1192 break; 1209 1193 } 1210 1194 }