From owner-p4-projects@FreeBSD.ORG Sat Apr 26 12:16:15 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E52EC37B404; Sat, 26 Apr 2003 12:16:14 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DF4C37B401 for ; Sat, 26 Apr 2003 12:16:14 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0925043F3F for ; Sat, 26 Apr 2003 12:16:14 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3QJGD0U020231 for ; Sat, 26 Apr 2003 12:16:13 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3QJGDe8020223 for perforce@freebsd.org; Sat, 26 Apr 2003 12:16:13 -0700 (PDT) Date: Sat, 26 Apr 2003 12:16:13 -0700 (PDT) Message-Id: <200304261916.h3QJGDe8020223@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 29807 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2003 19:16:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=29807 Change 29807 by jmallett@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 +#include #include #include @@ -37,6 +37,18 @@ #include #include +#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 +}