Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: kernel: Rename read/write_c0_ecc to read/writec0_errctl

CP0 register 26 is used as ECC register for legacy cores, but newer
cores (MIPS32/MIPS64) use it as an ErrCtl register. Since the kernel only
uses CP0 26 as ErrCtl register rename the access functions to the more
fitting name.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

+21 -26
+2 -2
arch/mips/include/asm/mipsregs.h
··· 2039 2039 #define read_c0_perfcntr3_64() __read_64bit_c0_register($25, 7) 2040 2040 #define write_c0_perfcntr3_64(val) __write_64bit_c0_register($25, 7, val) 2041 2041 2042 - #define read_c0_ecc() __read_32bit_c0_register($26, 0) 2043 - #define write_c0_ecc(val) __write_32bit_c0_register($26, 0, val) 2042 + #define read_c0_errctl() __read_32bit_c0_register($26, 0) 2043 + #define write_c0_errctl(val) __write_32bit_c0_register($26, 0, val) 2044 2044 2045 2045 #define read_c0_derraddr0() __read_ulong_c0_register($26, 1) 2046 2046 #define write_c0_derraddr0(val) __write_ulong_c0_register($26, 1, val)
+3 -4
arch/mips/kernel/mips-mt.c
··· 122 122 unsigned long ectlval; 123 123 unsigned long itcblkgrn; 124 124 125 - /* ErrCtl register is known as "ecc" to Linux */ 126 - ectlval = read_c0_ecc(); 127 - write_c0_ecc(ectlval | (0x1 << 26)); 125 + ectlval = read_c0_errctl(); 126 + write_c0_errctl(ectlval | (0x1 << 26)); 128 127 ehb(); 129 128 #define INDEX_0 (0x80000000) 130 129 #define INDEX_8 (0x80000008) ··· 144 145 ehb(); 145 146 /* Write out to ITU with CACHE op */ 146 147 cache_op(Index_Store_Tag_D, INDEX_0); 147 - write_c0_ecc(ectlval); 148 + write_c0_errctl(ectlval); 148 149 ehb(); 149 150 printk("Mapped %ld ITC cells starting at 0x%08x\n", 150 151 ((itcblkgrn & 0x7fe00000) >> 20), itc_base);
-4
arch/mips/kernel/spram.c
··· 26 26 27 27 #define ERRCTL_SPRAM (1 << 28) 28 28 29 - /* errctl access */ 30 - #define read_c0_errctl(x) read_c0_ecc(x) 31 - #define write_c0_errctl(x) write_c0_ecc(x) 32 - 33 29 /* 34 30 * Different semantics to the set_c0_* function built by __BUILD_SET_C0 35 31 */
+16 -16
arch/mips/kernel/traps.c
··· 1705 1705 l2parity &= l1parity; 1706 1706 1707 1707 /* Probe L1 ECC support */ 1708 - cp0_ectl = read_c0_ecc(); 1709 - write_c0_ecc(cp0_ectl | ERRCTL_PE); 1708 + cp0_ectl = read_c0_errctl(); 1709 + write_c0_errctl(cp0_ectl | ERRCTL_PE); 1710 1710 back_to_back_c0_hazard(); 1711 - cp0_ectl = read_c0_ecc(); 1711 + cp0_ectl = read_c0_errctl(); 1712 1712 1713 1713 /* Probe L2 ECC support */ 1714 1714 gcr_ectl = read_gcr_err_control(); ··· 1727 1727 cp0_ectl |= ERRCTL_PE; 1728 1728 else 1729 1729 cp0_ectl &= ~ERRCTL_PE; 1730 - write_c0_ecc(cp0_ectl); 1730 + write_c0_errctl(cp0_ectl); 1731 1731 back_to_back_c0_hazard(); 1732 - WARN_ON(!!(read_c0_ecc() & ERRCTL_PE) != l1parity); 1732 + WARN_ON(!!(read_c0_errctl() & ERRCTL_PE) != l1parity); 1733 1733 1734 1734 /* Configure L2 ECC checking */ 1735 1735 if (l2parity) ··· 1761 1761 unsigned long errctl; 1762 1762 unsigned int l1parity_present, l2parity_present; 1763 1763 1764 - errctl = read_c0_ecc(); 1764 + errctl = read_c0_errctl(); 1765 1765 errctl &= ~(ERRCTL_PE|ERRCTL_L2P); 1766 1766 1767 1767 /* probe L1 parity support */ 1768 - write_c0_ecc(errctl | ERRCTL_PE); 1768 + write_c0_errctl(errctl | ERRCTL_PE); 1769 1769 back_to_back_c0_hazard(); 1770 - l1parity_present = (read_c0_ecc() & ERRCTL_PE); 1770 + l1parity_present = (read_c0_errctl() & ERRCTL_PE); 1771 1771 1772 1772 /* probe L2 parity support */ 1773 - write_c0_ecc(errctl|ERRCTL_L2P); 1773 + write_c0_errctl(errctl|ERRCTL_L2P); 1774 1774 back_to_back_c0_hazard(); 1775 - l2parity_present = (read_c0_ecc() & ERRCTL_L2P); 1775 + l2parity_present = (read_c0_errctl() & ERRCTL_L2P); 1776 1776 1777 1777 if (l1parity_present && l2parity_present) { 1778 1778 if (l1parity) ··· 1791 1791 1792 1792 printk(KERN_INFO "Writing ErrCtl register=%08lx\n", errctl); 1793 1793 1794 - write_c0_ecc(errctl); 1794 + write_c0_errctl(errctl); 1795 1795 back_to_back_c0_hazard(); 1796 - errctl = read_c0_ecc(); 1796 + errctl = read_c0_errctl(); 1797 1797 printk(KERN_INFO "Readback ErrCtl register=%08lx\n", errctl); 1798 1798 1799 1799 if (l1parity_present) ··· 1812 1812 case CPU_5KC: 1813 1813 case CPU_5KE: 1814 1814 case CPU_LOONGSON32: 1815 - write_c0_ecc(0x80000000); 1815 + write_c0_errctl(0x80000000); 1816 1816 back_to_back_c0_hazard(); 1817 1817 /* Set the PE bit (bit 31) in the c0_errctl register. */ 1818 1818 printk(KERN_INFO "Cache parity protection %sabled\n", 1819 - (read_c0_ecc() & 0x80000000) ? "en" : "dis"); 1819 + (read_c0_errctl() & 0x80000000) ? "en" : "dis"); 1820 1820 break; 1821 1821 case CPU_20KC: 1822 1822 case CPU_25KF: ··· 1887 1887 if ((cpu_has_mips_r2_r6) && 1888 1888 (((current_cpu_data.processor_id & 0xff0000) == PRID_COMP_MIPS) || 1889 1889 ((current_cpu_data.processor_id & 0xff0000) == PRID_COMP_LOONGSON))) { 1890 - pr_err("FTLB error exception, cp0_ecc=0x%08x:\n", 1891 - read_c0_ecc()); 1890 + pr_err("FTLB error exception, cp0_errctl=0x%08x:\n", 1891 + read_c0_errctl()); 1892 1892 pr_err("cp0_errorepc == %0*lx\n", field, read_c0_errorepc()); 1893 1893 reg_val = read_c0_cacheerr(); 1894 1894 pr_err("c0_cacheerr == %08x\n", reg_val);