git: 9f224d3ec46e - stable/14 - riscv: Remove the unused riscv64_cpu driver

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Sat, 07 Sep 2024 01:47:58 UTC
The branch stable/14 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=9f224d3ec46ef822165df35990f96c6e7c6b67c8

commit 9f224d3ec46ef822165df35990f96c6e7c6b67c8
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2024-01-30 20:33:30 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2024-09-07 00:00:40 +0000

    riscv: Remove the unused riscv64_cpu driver
    
    This is a repeat of 63bf2d735ca3 ("Remove the unused arm64_cpu driver.")
    for RISC-V, which copied the defunct code from arm64 with no changes
    beyond substituting riscv64 for arm64, and made no use of it elsewhere.
    It has thus always been entirely superfluous.
    
    Reviewed by:    mhorne
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D43672
    
    (cherry picked from commit 722b40377198e384a808f9561ae7262767068ab2)
---
 sys/riscv/riscv/mp_machdep.c | 76 --------------------------------------------
 1 file changed, 76 deletions(-)

diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c
index 2d68675f21aa..641288e0b235 100644
--- a/sys/riscv/riscv/mp_machdep.c
+++ b/sys/riscv/riscv/mp_machdep.c
@@ -80,10 +80,6 @@ static enum {
 #endif
 } cpu_enum_method;
 
-static device_identify_t riscv64_cpu_identify;
-static device_probe_t riscv64_cpu_probe;
-static device_attach_t riscv64_cpu_attach;
-
 static void ipi_ast(void *);
 static void ipi_hardclock(void *);
 static void ipi_preempt(void *);
@@ -96,7 +92,6 @@ extern cpuset_t all_harts;
 #ifdef INVARIANTS
 static uint32_t cpu_reg[MAXCPU][2];
 #endif
-static device_t cpu_list[MAXCPU];
 
 void mpentry(u_long hartid);
 void init_secondary(uint64_t);
@@ -116,77 +111,6 @@ static volatile int aps_ready;
 /* Temporary variables for init_secondary()  */
 void *dpcpu[MAXCPU - 1];
 
-static device_method_t riscv64_cpu_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_identify,	riscv64_cpu_identify),
-	DEVMETHOD(device_probe,		riscv64_cpu_probe),
-	DEVMETHOD(device_attach,	riscv64_cpu_attach),
-
-	DEVMETHOD_END
-};
-
-static driver_t riscv64_cpu_driver = {
-	"riscv64_cpu",
-	riscv64_cpu_methods,
-	0
-};
-
-DRIVER_MODULE(riscv64_cpu, cpu, riscv64_cpu_driver, 0, 0);
-
-static void
-riscv64_cpu_identify(driver_t *driver, device_t parent)
-{
-
-	if (device_find_child(parent, "riscv64_cpu", -1) != NULL)
-		return;
-	if (BUS_ADD_CHILD(parent, 0, "riscv64_cpu", -1) == NULL)
-		device_printf(parent, "add child failed\n");
-}
-
-static int
-riscv64_cpu_probe(device_t dev)
-{
-	u_int cpuid;
-
-	cpuid = device_get_unit(dev);
-	if (cpuid >= MAXCPU || cpuid > mp_maxid)
-		return (EINVAL);
-
-	device_quiet(dev);
-	return (0);
-}
-
-static int
-riscv64_cpu_attach(device_t dev)
-{
-	const uint32_t *reg;
-	size_t reg_size;
-	u_int cpuid;
-	int i;
-
-	cpuid = device_get_unit(dev);
-
-	if (cpuid >= MAXCPU || cpuid > mp_maxid)
-		return (EINVAL);
-	KASSERT(cpu_list[cpuid] == NULL, ("Already have cpu %u", cpuid));
-
-	reg = cpu_get_cpuid(dev, &reg_size);
-	if (reg == NULL)
-		return (EINVAL);
-
-	if (bootverbose) {
-		device_printf(dev, "register <");
-		for (i = 0; i < reg_size; i++)
-			printf("%s%x", (i == 0) ? "" : " ", reg[i]);
-		printf(">\n");
-	}
-
-	/* Set the device to start it later */
-	cpu_list[cpuid] = dev;
-
-	return (0);
-}
-
 static void
 release_aps(void *dummy __unused)
 {