From owner-p4-projects@FreeBSD.ORG Wed May 2 14:07:09 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 700B416A409; Wed, 2 May 2007 14:07:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D30616A404 for ; Wed, 2 May 2007 14:07:09 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 1076D13C4AD for ; Wed, 2 May 2007 14:07:09 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l42E78wU020325 for ; Wed, 2 May 2007 14:07:08 GMT (envelope-from bms@incunabulum.net) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l42E78rt020322 for perforce@freebsd.org; Wed, 2 May 2007 14:07:08 GMT (envelope-from bms@incunabulum.net) Date: Wed, 2 May 2007 14:07:08 GMT Message-Id: <200705021407.l42E78rt020322@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bms@incunabulum.net using -f From: Bruce M Simpson To: Perforce Change Reviews Cc: Subject: PERFORCE change 119155 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2007 14:07:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=119155 Change 119155 by bms@bms_anglepoise on 2007/05/02 14:07:06 Merge Sentry5 changes with MALTA changes. Make YAMON optional. Don't try to detect an FPU if CPU_NOFPU is defined; the Sentry5 throws an exception even though the Cop1 enabled bit stays set in the status register after locore tries to enable it. Add custom ld script for CFE firmware targets; it needs to see the first PT_LOAD at an offset > 0. Affected files ... .. //depot/projects/mips2/src/sys/conf/ldscript.mips.cfe#1 add .. //depot/projects/mips2/src/sys/conf/options.mips#5 edit .. //depot/projects/mips2/src/sys/mips/conf/MALTA#13 edit .. //depot/projects/mips2/src/sys/mips/mips/locore.S#16 edit .. //depot/projects/mips2/src/sys/mips/mips/machdep.c#30 edit .. //depot/projects/mips2/src/sys/mips/mips/tick.c#12 edit Differences ... ==== //depot/projects/mips2/src/sys/conf/options.mips#5 (text+ko) ==== @@ -3,8 +3,15 @@ CPU_MIPS4KC opt_global.h CPU_MIPS32 opt_global.h CPU_MIPS64 opt_global.h +CPU_NOFPU opt_global.h +CPU_SENTRY5 opt_global.h + +YAMON opt_global.h +CFE opt_global.h + KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h PHYSADDR opt_global.h + TICK_USE_YAMON_FREQ opt_global.h TICK_USE_MALTA_RTC opt_global.h ==== //depot/projects/mips2/src/sys/mips/conf/MALTA#13 (text+ko) ==== @@ -24,11 +24,15 @@ #makeoptions ARCH_FLAGS=-march=mips32 makeoptions MIPS_LITTLE_ENDIAN=defined +options YAMON + # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" options KERNVIRTADDR=0x80100000 -options TICK_USE_YAMON_FREQ=defined +#options TICK_USE_YAMON_FREQ=defined +options TICK_USE_MALTA_RTC=defined + include "../mips4k/malta/std.malta" hints "MALTA.hints" #Default places to look for devices. ==== //depot/projects/mips2/src/sys/mips/mips/locore.S#16 (text+ko) ==== @@ -80,7 +80,15 @@ /* Read and store the PrID FPU ID for CPU identification. */ mfc0 t0, MIPS_COP_0_PRID +#ifndef CPU_NOFPU cfc1 t1, MIPS_FPU_ID +#else + /* + * This platform has no FPU, and attempting to detect one + * using the official method causes an exception. + */ + li t1, 0x0 +#endif sw t0, cpu_id sw t1, fpu_id @@ -94,9 +102,9 @@ */ la sp, topstack -#if 1 +#ifdef YAMON /* - * XXX: Save the YAMON environment pointer. + * Save the YAMON environment pointer. */ sw a2, fenvp #endif ==== //depot/projects/mips2/src/sys/mips/mips/machdep.c#30 (text+ko) ==== @@ -70,6 +70,10 @@ #include #include +#ifdef CPU_SENTRY5 +/* XXX */ +void sentry5_reset(void); +#endif #ifdef DDB #include @@ -455,6 +459,10 @@ platform_reset(void) { +#ifdef CPU_SENTRY5 + /* Yes yes I know this is a mess. */ + sentry5_reset(); +#endif } void ==== //depot/projects/mips2/src/sys/mips/mips/tick.c#12 (text+ko) ==== @@ -114,7 +114,8 @@ tick_init_params(void) { - printf("Calibrating MIPS32 clock ... "); + if (bootverbose) + printf("Calibrating MIPS32 clock ... "); do { #if defined(TICK_USE_YAMON_FREQ) @@ -156,7 +157,14 @@ counter_freq = counterval[1] - counterval[0]; #else + /* + * Don't cause a call to DELAY() to happen when we haven't + * initialized the very things which DELAY() depends upon; + * it will cause a divide-by-zero trap. + */ + #if 0 printf("using hard-coded default clock of 10MHz\n"); + #endif counter_freq = 10000000; #endif } while (0); @@ -211,6 +219,7 @@ void DELAY(int n) { +#ifndef CPU_SENTRY5 /* TODO: Fix clock calibration for this board */ uint32_t cur, last, delta, usecs; /* * This works by polling the timer and counting the @@ -235,6 +244,7 @@ delta %= counts_per_usec; } } +#endif } /*