Commit Graph

10 Commits

Author SHA1 Message Date
simonb 4c99e006ad Need this to build the system - libc nlist assumes all mips have ecoff. 2002-03-11 02:33:37 +00:00
simonb ee374e2f14 Remove the -O0 workaround for nfs_bio.c - the in-tree toolchain builds
this properly.
2002-03-06 23:50:42 +00:00
simonb 4025359daa cgd notes that we shouldn't use the CPU xtal for calculating wall-clock
time - but as yet we don't attach the RTC becuase it's on an SMbus.
One for later...
2002-03-06 08:02:12 +00:00
simonb 52bf6c669b Neaten slightly. 2002-03-06 07:51:02 +00:00
simonb 2bf916e97d Implement a clkread() function for microtime() using a multu/mfhi
sequence using the reciprocal of the delay divisor to perform the
division.
Set the cp0 compare register so that it doesn't trigger interrupts and
reset the cp0 count register in the hardclock interrupt handler.
2002-03-06 07:47:57 +00:00
simonb 86cb239e4f Add a "clkread" function to the systemsw. 2002-03-06 07:35:13 +00:00
simonb 465e846051 Calculate the reciprocal of the divisor delay. From the comments:
To implement a more accurate microtime using the CP0 COUNT
	register we need to divide that register by the number of
	cycles per MHz.  But...

	DIV and DIVU are expensive on MIPS (eg 75 clocks on the
	R4000).  MULT and MULTU are only 12 clocks on the same CPU.
	On the SB1 these appear to be 40-72 clocks for DIV/DIVU and 3
	clocks for MUL/MULTU.

	The strategy we use to to calculate the reciprical of cycles
	per MHz, scaled by 1<<32.  Then we can simply issue a MULTU
	and pluck of the HI register and have the results of the
	division.
2002-03-06 07:34:36 +00:00
simonb be6459cce6 Use the divisor delay from curcpu() in the implementation of delay(). 2002-03-06 03:29:16 +00:00
simonb 8eb960909e Determine and display the CPU clock frequency from the "System
Identification and Revision Register", and set the frequency
related variables in curcpu info structure.
2002-03-06 03:27:34 +00:00
simonb 4b7a128684 A basic port to the Broadcom/SiByte SB1250 evaluation board (the
"swarm").  Other SB-cpu boards will be supported by this port in
the future.

Includes support for on-chip ethernet and serial.  Many features
still missing - notably SMP, PCI/LDT and IDE.

This code is provided by the Broadband Processor Business Unit at
Broadcom Corp with minor updates by me.
2002-03-06 02:13:37 +00:00