Subject: g4, cache and speculative addressing
To: netbsd-macppc <port-macppc@NetBSD.ORG>
From: Riccardo Mottola <rollei@tiscalinet.it>
List: port-macppc
Date: 06/27/2005 10:47:30
Hey all.

Let's resume the situation... and make a point.

1. the card I have (from newertech) seems to work fine under macos, when
set to the card specs
	- 400Mhz (verified to be such with the utility, macos reports bogus
data for an unkown cpu probably)
	- 1:2 cache (the card was called maxpower 400/200)
	- 1Mb cache
	- speculative addressing off
	- powersaving ON

2. the kernel I have in netbsd has the following cache options line:

options 	ALTIVEC		# Include AltiVec support
options         L2CR_CONFIG="(L2SIZ_1M|L2CLK_20|L2RAM_PIPELINE_BURST)"
#MaxPower newertech g4 400

the kernel was compiled with optimization flags (-maltivec is included
just by using the option above) and reports the cpu as:

cpu0 at mainbus0: 7400 (Revision 2.7), ID 0 (primary)
cpu0: HID0 8294c0a4<EMCP,ECLK,DOZE,DPM,EIEC,ICE,DCE,SGE,BTIC,BHT>
cpu0: 409.10 MHz, no-parity 1MB WB L2 cache (PB SRAM) at 2:1 ratio

- other people seem to have mhck kernel stability issues on 7400 cpu's
(but not 7450 apparently)
- I don't know if I have a backside cache. To be honest I don't even
know exactly what a backside cache is. I thought it was essentially 1:2
cache on the cpu or the cpu doughterboard. The powerlogix utility
doesn't report anything about it. What could I expect getting that
option wrong?
- powerlogix states that speculative addressing could be a problem on
non-g3/g4 computers which get such a processor. But My question is "why"
? is it a ROM problem? an MacOS problem? Should it be disabled in NetBSD
too? (and how?) I thought we didn't utilize ROM functions. But if the
problem is instead some hardware controller...
- the speeds seem reasonable. The powerlogic utility repots a bus speed
of 44Mhz, when operating in 400/200 mode which would imply a multiplyer
of 4.545 which is  strange. Anyway it is far below 50Mhz and under macos
it runs fine. ALso I would have no idea on how to change it in netbsd.

the powerlogic utility reports the L2CR bytesin hex that it will use.
Could it be useful to get those? netbsd should come up with the same
values?

I will try to stress the box again today and maybe try to build another
kernel with the same options but different optimizations.

-Riccardo