Skip to content

Commit 18fb053

Browse files
Matthew WhiteheadKAGA-KOKO
authored andcommitted
x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors
There are comments in processor-cyrix.h advising you to _not_ make calls using the deprecated macros in this style: setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80); This is because it expands the macro into a non-functioning calling sequence. The calling order must be: outb(CX86_CCR2, 0x22); inb(0x23); From the comments: * When using the old macros a line like * setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); * gets expanded to: * do { * outb((CX86_CCR2), 0x22); * outb((({ * outb((CX86_CCR2), 0x22); * inb(0x23); * }) | 0x88), 0x23); * } while (0); The new macros fix this problem, so use them instead. Tested on an actual Geode processor. Signed-off-by: Matthew Whitehead <tedheadster@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: luto@kernel.org Link: https://lkml.kernel.org/r/1552596361-8967-2-git-send-email-tedheadster@gmail.com
1 parent 9bd6812 commit 18fb053

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arch/x86/kernel/cpu/cyrix.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static void set_cx86_reorder(void)
124124
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
125125

126126
/* Load/Store Serialize to mem access disable (=reorder it) */
127-
setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80);
127+
setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80);
128128
/* set load/store serialize from 1GB to 4GB */
129129
ccr3 |= 0xe0;
130130
setCx86(CX86_CCR3, ccr3);
@@ -135,11 +135,11 @@ static void set_cx86_memwb(void)
135135
pr_info("Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
136136

137137
/* CCR2 bit 2: unlock NW bit */
138-
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04);
138+
setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
139139
/* set 'Not Write-through' */
140140
write_cr0(read_cr0() | X86_CR0_NW);
141141
/* CCR2 bit 2: lock NW bit and set WT1 */
142-
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14);
142+
setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14);
143143
}
144144

145145
/*
@@ -153,14 +153,14 @@ static void geode_configure(void)
153153
local_irq_save(flags);
154154

155155
/* Suspend on halt power saving and enable #SUSP pin */
156-
setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88);
156+
setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
157157

158158
ccr3 = getCx86(CX86_CCR3);
159159
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
160160

161161

162162
/* FPU fast, DTE cache, Mem bypass */
163-
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38);
163+
setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38);
164164
setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
165165

166166
set_cx86_memwb();
@@ -296,7 +296,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
296296
/* GXm supports extended cpuid levels 'ala' AMD */
297297
if (c->cpuid_level == 2) {
298298
/* Enable cxMMX extensions (GX1 Datasheet 54) */
299-
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1);
299+
setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1);
300300

301301
/*
302302
* GXm : 0x30 ... 0x5f GXm datasheet 51
@@ -319,7 +319,7 @@ static void init_cyrix(struct cpuinfo_x86 *c)
319319
if (dir1 > 7) {
320320
dir0_msn++; /* M II */
321321
/* Enable MMX extensions (App note 108) */
322-
setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1);
322+
setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);
323323
} else {
324324
/* A 6x86MX - it has the bug. */
325325
set_cpu_bug(c, X86_BUG_COMA);

0 commit comments

Comments
 (0)