Date:2011-03-04 19:42:25 (9 years 3 months ago)
Author:Peter Zotov
Commit:2308d11889e7f9a9409ce55079e40c44b4d476b1
Message:MIPS: JZ4750: Add workarounds for CP0 STATUS.

The JZ4750 has (probable) errata which leads to hangs on certain
access to ERL and EXL bits in CP0 STATUS. This workaround is ported
from official Ingenic (chip manufacturer) kernel, but author knows
no documents on this errata.
Files: arch/mips/include/asm/irqflags.h (4 diffs)
arch/mips/kernel/head.S (1 diff)

Change Details

arch/mips/include/asm/irqflags.h
3030    " ei \n"
3131#else
3232    " mfc0 $1,$12 \n"
33#if defined(CONFIG_MACH_JZ4750)
34    " ori $1,0x19 \n"
35    " xori $1,0x18 \n"
36#else
3337    " ori $1,0x1f \n"
3438    " xori $1,0x1e \n"
39#endif
3540    " mtc0 $1,$12 \n"
3641#endif
3742    " irq_enable_hazard \n"
...... 
8893    " di \n"
8994#else
9095    " mfc0 $1,$12 \n"
96#if defined(CONFIG_MACH_JZ4750)
97    " ori $1,0x19 \n"
98    " xori $1,0x19 \n"
99#else
91100    " ori $1,0x1f \n"
92101    " xori $1,0x1f \n"
102#endif
93103    " .set noreorder \n"
94104    " mtc0 $1,$12 \n"
95105#endif
...... 
141151    " andi \\result, 1 \n"
142152#else
143153    " mfc0 \\result, $12 \n"
154#if defined(CONFIG_MACH_JZ4750)
155    " ori $1, \\result, 0x19 \n"
156    " xori $1, 0x19 \n"
157#else
144158    " ori $1, \\result, 0x1f \n"
145159    " xori $1, 0x1f \n"
160#endif
146161    " .set noreorder \n"
147162    " mtc0 $1, $12 \n"
148163#endif
...... 
191206#else
192207    " mfc0 $1, $12 \n"
193208    " andi \\flags, 1 \n"
209#if defined(CONFIG_MACH_JZ4750)
210    " ori $1, 0x19 \n"
211    " xori $1, 0x19 \n"
212#else
194213    " ori $1, 0x1f \n"
195214    " xori $1, 0x1f \n"
215#endif
196216    " or \\flags, $1 \n"
197217    " mtc0 \\flags, $12 \n"
198218#endif
arch/mips/kernel/head.S
9696    mtc0 t0, CP0_STATUS
9797#else
9898    mfc0 t0, CP0_STATUS
99#if defined(CONFIG_MACH_JZ4750)
100    or t0, ST0_CU0|\set|0x19|\clr
101    xor t0, 0x19|\clr
102#else
99103    or t0, ST0_CU0|\set|0x1f|\clr
100104    xor t0, 0x1f|\clr
105#endif
101106    mtc0 t0, CP0_STATUS
102107    .set noreorder
103108    sll zero,3 # ehb

Archive Download the corresponding diff file



interactive