[PATCH 2/4] m68k: Add and use defines for 68060 PCR register
From: Daniel Palmer
Date: Thu Nov 19 2026 - 07:40:29 EST
Add some defines for the various bits in the 68060s
PCR register and then remove the magic numbers in the
places that use them.
Signed-off-by: Daniel Palmer <daniel@xxxxxxxx>
---
arch/m68k/include/asm/m68060.h | 15 +++++++++++++++
arch/m68k/kernel/head.S | 3 ++-
arch/m68k/kernel/setup_mm.c | 6 ++++--
3 files changed, 21 insertions(+), 3 deletions(-)
create mode 100644 arch/m68k/include/asm/m68060.h
diff --git a/arch/m68k/include/asm/m68060.h b/arch/m68k/include/asm/m68060.h
new file mode 100644
index 000000000000..a69ccde11693
--- /dev/null
+++ b/arch/m68k/include/asm/m68060.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_M68K_M68060_H
+#define _ASM_M68K_M68060_H
+
+/* From MC68060 User's Manual (section 3.2.2.5) */
+#define M68060_PCR_ID 0xffff0000
+#define M68060_PCR_ID_68060 0x0430
+#define M68060_PCR_ID_68LC060 0x0431 /* LC or EC */
+#define M68060_PCR_REVISION 0x0000ff00
+#define M68060_PCR_EDEBUG 0x00000080 /* internal state on idle bus cycles */
+#define M68060_PCR_I14 0x00000020 /* Reserved: errata I14 workaround */
+#define M68060_PCR_DFP 0x00000002 /* disable the FPU */
+#define M68060_PCR_ESS 0x00000001 /* enable superscalar dispatch */
+
+#endif /* _ASM_M68K_M68060_H */
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index 502eeae49eaf..7d90069e9af1 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -264,6 +264,7 @@
#include <asm/entry.h>
#include <asm/page.h>
#include <asm/asm-offsets.h>
+#include <asm/m68060.h>
#ifdef CONFIG_MAC
# include <asm/machw.h>
#endif
@@ -1484,7 +1485,7 @@ L(cache68060):
/* MMU stuff works in copyback mode now, so enable the cache */
movec %d0,%cacr
/* enable superscalar dispatch in PCR */
- moveq #1,%d0
+ moveq #M68060_PCR_ESS,%d0
.chip 68060
movec %d0,%pcr
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 51b5881078cd..7abff6266837 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -9,6 +9,7 @@
* This file handles the architecture-dependent parts of system setup
*/
+#include <linux/bitfield.h>
#include <linux/kernel.h>
#include <linux/cpu.h>
#include <linux/mm.h>
@@ -35,6 +36,7 @@
#include <asm/fpu.h>
#include <asm/irq.h>
#include <asm/io.h>
+#include <asm/m68060.h>
#include <asm/machdep.h>
#ifdef CONFIG_AMIGA
#include <asm/amigahw.h>
@@ -232,10 +234,10 @@ void __init setup_arch(char **cmdline_p)
asm (".chip 68060; movec %%pcr,%0; .chip 68k"
: "=d" (pcr));
- if (((pcr >> 8) & 0xff) <= 5) {
+ if (FIELD_GET(M68060_PCR_REVISION, pcr) <= 5) {
pr_warn("Enabling workaround for errata I14\n");
asm (".chip 68060; movec %0,%%pcr; .chip 68k"
- : : "d" (pcr | 0x20));
+ : : "d" (pcr | M68060_PCR_I14));
}
}
--
2.55.0