PERFORCE change 29807 for review

Juli Mallett jmallett at FreeBSD.org
Sat Apr 26 12:16:16 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=29807

Change 29807 by jmallett at jmallett_dalek on 2003/04/26 12:16:00

	Stubbed out support for multiple models, IP22 in particular,
	as it's what I'm working on.

Affected files ...

.. //depot/projects/mips/sys/conf/options.mips#8 edit
.. //depot/projects/mips/sys/mips/conf/GENERIC#11 edit
.. //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#7 edit

Differences ...

==== //depot/projects/mips/sys/conf/options.mips#8 (text+ko) ====

@@ -1,6 +1,8 @@
 # $FreeBSD$
 # Options specific to the mips platform kernels
 
+IP22			opt_model.h
+
 R4000			opt_global.h
 R4400			opt_global.h
 R10000			opt_global.h

==== //depot/projects/mips/sys/mips/conf/GENERIC#11 (text+ko) ====

@@ -15,6 +15,7 @@
 
 # Platform support
 platform	sgimips			#SGI MIPS systems.
+options		IP22			#IP22 (Indy, Indigo2, ...)
 
 # Hardware support
 device		arcbios			#ARCBIOS

==== //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#7 (text+ko) ====

@@ -26,7 +26,7 @@
  * $FreeBSD$
  */
 
-#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/systm.h>
 
 #include <machine/cpufunc.h>
@@ -37,6 +37,18 @@
 #include <dev/arcbios/arcbios.h>
 #include <dev/arcbios/arcbiosvar.h>
 
+#include "opt_model.h"
+
+static void ip22_init(void);
+
+struct machine_type {
+	const char *identifier;
+	void (*init)(void);
+} machines[] = {
+	{ "SGI-IP22",	ip22_init },
+	{ NULL,		NULL }
+};
+
 void
 platform_halt(void)
 {
@@ -52,6 +64,8 @@
 void
 platform_start(int argc, char **argv)
 {
+	struct machine_type *mtp;
+	const char *cpufreq;
 
 	/*
 	 * Initialise the ARCBIOS stuff.
@@ -59,5 +73,31 @@
 	arcbios_init(MIPS_PHYS_TO_KSEG1(0x00001000));
 	arcbios_cnattach();
 	printf("See MIPS Run\n");
+
+	cpufreq = ARCBIOS->GetEnvironmentVariable("cpufreq");
+	if (cpufreq == NULL)
+		panic("$cpufreq not set");
+
+	printf("%s at %sMHz\n", arcbios_system_identifier, cpufreq);
+
+	for (mtp = machines; mtp->identifier != NULL; mtp++) {
+		if (strcmp(mtp->identifier, arcbios_system_identifier) == 0)
+			break;
+	}
+	if (mtp->identifier == NULL)
+		printf("Warning: unsupported system, nothing will work.\n");
+	else
+		(*mtp->init)();
+
 	cpu_reset();
 }
+
+static void
+ip22_init(void)
+{
+#ifdef	IP22
+	;
+#else
+	printf("Warning: IP22 support not compiled in.\n");
+#endif
+}


More information about the p4-projects mailing list