Subject: Re: VAX 4000-300 works
To: None <port-vax@netbsd.org>
From: None <carlini@bulean.ENET.dec.com>
List: port-vax
Date: 06/04/1999 06:05:48
"michael@camaronet.de" "Michael Kukat"  wrote:

> Another port with usable results: the VAX 4000/300 works !
>
>Port status: Primary cache works, console works, all QBUS devices are usable.

There is a 128KB backup cache in there too. There are a bunch of control
registers accessed through IPRs (i.e. MFPR to read, MTPR to write).

There's seven pages or so in the manual and I can't type it all in but here are
the highlights:

IPR 0x71 BCBTS Backup Cache Tag Store.
IPR 0x72 BCP1TS Primary Tag Store 1st half
IPR 0x73 BCP2TS                   2nd half
IPR 0x74 BCRFR  Refresh Register
IPR 0x75 BCIDX  Index Register
IPR 0x76 BCSTS  Status
IPR 0x77 BCCTL  Control register
IPR 0x78 BCERR  Error Address
IPR 0x79 BCFBTS Flush backup tag store
IPR 0x7A BCFPTS Flush primary tag store

The interesting ones seem to be:

BCCTL:
	bit 0 - Force hit: used by diags, keep as 0
	bit 1 - Enable_BTS: enables backup tag store
	bit 2 - Enable PTS: enables primary tag store - must be set if
		primary cache is on and backup cache is on. See below
	bit 3 - Enable_refresh, must be on to allow tag store DRAM to
		be refreshed
	bit 4 - should be 0
	bits 31:5 - MBZ

Turning the bcache on is the following sequence:
	Start with Pcache off
	Flush backup tag store (MTPR 0x79)
	Flush primary tag store (MTPR 0x7A)
	Enable_PTS=1, Enable_BTS=1, Enable_Refresh=1
	Flush and turn on Primary cache (as you already do?)		

This assumes that you start off with all caches off and enable_BTS=0,
enable_PTS=0; if you start in some other state (e.g. if the console turns on
the Pcache for you) then the sequence is different. If the above doesn't work,
report the initial state (Pcache state, BCCTL state) when NetBSD starts to boot
and I'll read some other portion of the table for you.

>To do: Find out some memory addresses to get backup cache running, and check
>out how to handle the CPU-internal SGEC ethernet controller and the DSSI
>controller. For now it only runs with the good old QBUS ethernet adapters.
>(I use the DELQA from my MV II)

The ethernet address lives at 0x20084000: read in longwords and use the 2nd
byte of each of the first 6 longwords.

As for the rest you reall do have to get the manual (EK-KA670-TM KA670 CPU
Module Technical Manual): start at page 147 and stop at page 198 :-) Actually
you don't stop since the SHAC description starts at 198 and finishes at 212 or
so. (Programming the SHAC isn't enough to use DSSI devices - you need the MSCP
stuff; I know that Matt Thomas tried to get this released some time ago but I
don't think anything happened about that in the end).

>Another question: Is there support for the KZQSA scsi adapter ? NetBSD doesn't
>talk about it when initializing.

KZQSA isn't too good at handling disks - I don't think its an OpenVMS
restriction, it's just not what the hardware does best.

Antonio