Basic KA48 (VAXstation 4000 VLC) support.

From Michael Kukat <michael@camaronet.de>
This commit is contained in:
ragge 1999-03-09 12:57:57 +00:00
parent ae8bd3e155
commit fb6b53bfe4
13 changed files with 308 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.12 1998/08/08 16:10:41 ragge Exp $ */
/* $NetBSD: autoconf.c,v 1.13 1999/03/09 12:57:57 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -166,6 +166,18 @@ autoconf()
break;
case VAX_TYP_SOC:
switch (vax_boardtype) {
case VAX_BTYP_48: {
int *map, i;
/* Map all 16MB of I/O space to low 16MB of memory */
map = (int *)0x700000; /* XXX */
*(int *)0x20080008 = (int)map; /* XXX */
for (i = 0; i < 0x8000; i++)
map[i] = 0x80000000 | i;
}
break;
}
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: consio.c,v 1.11 1998/08/08 16:10:41 ragge Exp $ */
/* $NetBSD: consio.c,v 1.12 1999/03/09 12:57:57 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -162,7 +162,6 @@ setup()
case VAX_BTYP_49:
case VAX_BTYP_410:
case VAX_BTYP_420:
case VAX_BTYP_440:
put_fp = rom_putchar;
get_fp = rom_getchar;
rom_putc = 0x20040058; /* 537133144 */
@ -174,6 +173,7 @@ setup()
break;
case VAX_BTYP_46:
case VAX_BTYP_48:
put_fp = rom_putchar;
get_fp = rom_getchar;
rom_putc = 0x20040068;

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.42 1998/12/10 18:24:52 ragge Exp $
# $NetBSD: GENERIC,v 1.43 1999/03/09 12:57:57 ragge Exp $
#
# GENERIC VAX configuration file; all supported devices.
#
@ -15,6 +15,7 @@ options "VAX650" # MV III, 3600, 3800, 3900
options "VAX410" # VS 2000
options "VAX43" # VS 3100/76
options "VAX46" # VS 4000/60
options "VAX48" # VS 4000 VLC
# Max users on system; this is just a hint
maxusers 8

View File

@ -1,4 +1,4 @@
# $NetBSD: files.vax,v 1.45 1999/01/19 21:04:47 ragge Exp $
# $NetBSD: files.vax,v 1.46 1999/03/09 12:57:57 ragge Exp $
#
# new style config file for vax architecture
#
@ -306,7 +306,7 @@ file arch/vax/uba/dh.c dh needs-flag
# These are general files needed for compilation.
file dev/cons.c
file dev/cninit.c
file dev/clock_subr.c vax8200|vax410|vax43|vax630|vax46
file dev/clock_subr.c vax8200|vax410|vax43|vax630|vax46|vax48
file arch/vax/vax/locore.c
file arch/vax/vax/mem.c
file arch/vax/vax/clock.c
@ -325,6 +325,7 @@ file arch/vax/vax/ka630.c vax630
file arch/vax/vax/ka410.c vax410
file arch/vax/vax/ka43.c vax43
file arch/vax/vax/ka46.c vax46
file arch/vax/vax/ka48.c vax48
file arch/vax/vax/emulate.s vax630|vax650|vax410
file arch/vax/vax/ka650.c vax650
file arch/vax/vax/scb.c

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed at Ludd, University of
* Lule}, Sweden and its contributors.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* KA48 (VS4000 VLC) specific definitions. *** INCOMPLETE ! MK-990306 ***
*/
/* IPR bits definitions */
#define PCSTS_FLUSH 4
#define PCSTS_ENABLE 2
#define PCTAG_PARITY 0x80000000
#define PCTAG_VALID 1
/* memory addresses of interest */
#define KA48_INVFLT 0x20200000
#define KA48_INVFLTSZ 32768
#define KA48_CCR 0x23000000
#define KA48_TAGST 0x2d000000
#define KA48_TAGSZ 32768
#define CCR_CENA 0x00000001
#define CCR_SPECIO 0x00000010
#define KA48_BWF0 0x20080014
#define BWF0_FEN 0x01000000

View File

@ -1,4 +1,4 @@
/* $NetBSD: sid.h,v 1.9 1997/02/12 17:50:38 ragge Exp $ */
/* $NetBSD: sid.h,v 1.10 1999/03/09 12:57:58 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -167,7 +167,7 @@
#define VAX_TYP_V14 20
#define VAX_BTYP_660 0x14000001 /* VAX 4000 model 200 */
#define VAX_BTYP_440 0x14000004 /* VS 4000/30, 3100/30, 3100/40 */
#define VAX_BTYP_48 0x14000004 /* VAXstation 4000 VLC */
#define VAX_BTYP_550 0x14000007 /* VAXft model 410, 610 */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.25 1999/02/02 18:37:20 ragge Exp $ */
/* $NetBSD: clock.c,v 1.26 1999/03/09 12:57:58 ragge Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -153,7 +153,7 @@ delay(i)
asm ("1: sobgtr %0, 1b" : : "r" (dep_call->cpu_vups * i));
}
#if VAX750 || VAX780 || VAX8200 || VAX8600 || VAX8800
#if VAX750 || VAX780 || VAX8200 || VAX8600 || VAX8800 || VAX48
/*
* On most VAXen there are a microsecond clock that should
* be used for interval interrupts. Have a generic version here.

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.39 1998/11/13 04:47:10 oster Exp $ */
/* $NetBSD: conf.c,v 1.40 1999/03/09 12:57:58 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@ -177,7 +177,7 @@ struct consdev constab[]={
#else
#define NGEN 0
#endif
#if VAX410 || VAX43
#if VAX410 || VAX43 || VAX48
cons_init(dz), /* DZ11-like serial console on VAXstations */
#endif
#if VAX650 || VAX630

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.8 1998/09/30 14:09:59 ragge Exp $
# $NetBSD: genassym.cf,v 1.9 1999/03/09 12:57:58 ragge Exp $
#
# Copyright (c) 1997 Ludd, University of Lule}, Sweden.
# All rights reserved.
@ -111,3 +111,4 @@ define SYS_exit SYS_exit
define VAX_TYP_UV2 VAX_TYP_UV2
define VAX_TYP_8SS VAX_TYP_8SS
define VAX_BTYP_46 VAX_BTYP_46
define VAX_BTYP_48 VAX_BTYP_48

202
sys/arch/vax/vax/ka48.c Normal file
View File

@ -0,0 +1,202 @@
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
*
* This code is derived from software contributed to Ludd by Bertram Barth.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed at Ludd, University of
* Lule}, Sweden and its contributors.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*** needs to be completed MK-990306 ***/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <machine/pte.h>
#include <machine/cpu.h>
#include <machine/mtpr.h>
#include <machine/sid.h>
#include <machine/pmap.h>
#include <machine/nexus.h>
#include <machine/uvax.h>
#include <machine/ka410.h>
#include <machine/ka420.h>
#include <machine/ka48.h>
#include <machine/clock.h>
#include <machine/vsbus.h>
static void ka48_conf __P((struct device*, struct device*, void*));
static void ka48_steal_pages __P((void));
static void ka48_memerr __P((void));
static int ka48_mchk __P((caddr_t));
static void ka48_halt __P((void));
static void ka48_reboot __P((int));
static void ka48_cache_enable __P((void));
struct vs_cpu *ka48_cpu;
extern short *clk_page;
/*
* Declaration of 48-specific calls.
*/
struct cpu_dep ka48_calls = {
ka48_steal_pages,
generic_clock,
ka48_mchk,
ka48_memerr,
ka48_conf,
chip_clkread,
chip_clkwrite,
6, /* ~VUPS */
2, /* SCB pages */
ka48_halt,
ka48_reboot,
};
void
ka48_conf(parent, self, aux)
struct device *parent, *self;
void *aux;
{
extern int clk_adrshift, clk_tweak;
printf(": KA48\n");
ka48_cpu = (void *)vax_map_physmem(VS_REGS, 1);
printf("%s: turning on floating point chip\n", self->dv_xname);
mtpr(2, PR_ACCS); /* Enable floating points */
/*
* Setup parameters necessary to read time from clock chip.
*/
clk_adrshift = 1; /* Addressed at long's... */
clk_tweak = 2; /* ...and shift two */
clk_page = (short *)vax_map_physmem(VS_CLOCK, 1);
}
void
ka48_cache_enable()
{
int i, *tmp;
return; /*** not yet MK-990306 ***/
/* Disable caches */
*(int *)KA48_CCR &= ~CCR_SPECIO;/* secondary */
mtpr(PCSTS_FLUSH, PR_PCSTS); /* primary */
*(int *)KA48_BWF0 &= ~BWF0_FEN; /* invalidate filter */
/* Clear caches */
tmp = (void *)KA48_INVFLT; /* inv filter */
for (i = 0; i < 32768; i++)
tmp[i] = 0;
/* Write valid parity to all primary cache entries */
for (i = 0; i < 256; i++) {
mtpr(i << 3, PR_PCIDX);
mtpr(PCTAG_PARITY, PR_PCTAG);
}
/* Secondary cache */
tmp = (void *)KA48_TAGST;
for (i = 0; i < KA48_TAGSZ*2; i+=2)
tmp[i] = 0;
/* Enable cache */
*(int *)KA48_BWF0 |= BWF0_FEN; /* invalidate filter */
mtpr(PCSTS_ENABLE, PR_PCSTS);
*(int *)KA48_CCR = CCR_SPECIO | CCR_CENA;
}
void
ka48_memerr()
{
printf("Memory err!\n");
}
int
ka48_mchk(addr)
caddr_t addr;
{
panic("Machine check");
return 0;
}
void
ka48_steal_pages()
{
extern vm_offset_t avail_start, virtual_avail, avail_end;
int i;
/* Interrupt vector number in interrupt mask table */
inr_ni = VS4000_NI;
inr_sr = VS4000_SR;
inr_st = VS4000_ST;
MAPPHYS(le_iomem, (NI_IOSIZE/VAX_NBPG), VM_PROT_READ|VM_PROT_WRITE);
/* Turn on caches (to speed up execution a bit) */
ka48_cache_enable();
/*
* The I/O MMU maps all 16K device addressable memory to
* the low 16M of the physical memory. In this way the
* device operations emulate the VS3100 way.
* This area must be on a 128k boundary and that causes
* a slight waste of memory. We steal it from the end.
*
* This will be reworked the day NetBSD/vax changes to
* 4K pages. (No use before that).
*/
{ int *io_map, *lio_map;
avail_end &= ~0x3ffff;
lio_map = (int *)avail_end;
*(int *)(VS_REGS + 8) = avail_end & 0x07fe0000;
MAPVIRT(io_map, (0x20000 / VAX_NBPG));
pmap_map((vm_offset_t)io_map, (vm_offset_t)avail_end,
(vm_offset_t)avail_end + 0x20000, VM_PROT_READ|VM_PROT_WRITE);
for (i = 0; i < 0x8000; i++)
lio_map[i] = 0x80000000|i;
}
}
static void
ka48_halt()
{
asm("halt");
}
static void
ka48_reboot(arg)
int arg;
{
asm("halt");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.c,v 1.33 1999/01/19 21:04:49 ragge Exp $ */
/* $NetBSD: locore.c,v 1.34 1999/03/09 12:57:58 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -80,6 +80,7 @@ extern struct cpu_dep ka860_calls;
extern struct cpu_dep ka820_calls;
extern struct cpu_dep ka43_calls;
extern struct cpu_dep ka46_calls;
extern struct cpu_dep ka48_calls;
extern struct cpu_dep ka410_calls;
extern struct cpu_dep ka630_calls;
extern struct cpu_dep ka650_calls;
@ -128,20 +129,22 @@ start()
cpu_model[6] = '5';
break;
#endif
#if VAX630 || VAX650 || VAX410 || VAX43 || VAX46
#if VAX630 || VAX650 || VAX410 || VAX43 || VAX46 || VAX48
case VAX_TYP_UV2:
case VAX_TYP_CVAX:
case VAX_TYP_RIGEL:
case VAX_TYP_MARIAH:
case VAX_TYP_SOC:
vax_siedata = *(int *)(0x20040004); /* SIE address */
vax_boardtype = (vax_cputype<<24) | ((vax_siedata>>24)&0xFF);
switch (vax_boardtype) {
#if VAX410 || VAX43 || VAX46
#if VAX410 || VAX43 || VAX46 || VAX48
case VAX_BTYP_420: /* They are very similar */
case VAX_BTYP_410:
case VAX_BTYP_43:
case VAX_BTYP_46:
case VAX_BTYP_48:
vax_confdata = *(int *)(0x20020000);
vax_bustype = VAX_VSBUS | VAX_CPUBUS;
#if VAX410
@ -156,6 +159,10 @@ start()
#if VAX46
if (vax_boardtype == VAX_BTYP_46)
dep_call = &ka46_calls;
#endif
#if VAX48
if (vax_boardtype == VAX_BTYP_48)
dep_call = &ka48_calls;
#endif
strcpy(cpu_model, (vax_confdata & 0x80 ?
"MicroVAX " : "VAXstation "));
@ -174,6 +181,11 @@ start()
case VAX_BTYP_46:
strcat(cpu_model, "4000/60");
break;
#endif
#if VAX48
case VAX_BTYP_48:
strcpy(cpu_model, "VAXstation 4000 VLC");
break;
#endif
default:
#if VAX410

View File

@ -1,4 +1,4 @@
/* $NetBSD: dz_vsbus.c,v 1.7 1999/02/02 18:37:21 ragge Exp $ */
/* $NetBSD: dz_vsbus.c,v 1.8 1999/03/09 12:57:58 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -131,7 +131,8 @@ dz_vsbus_attach(parent, self, aux)
dzattach(sc);
if ((vax_confdata & 0x80) == 0) /* workstation, have lkc */
if (((vax_confdata & 0x80) == 0) ||/* workstation, have lkc */
(vax_boardtype == VAX_BTYP_48))
config_found(self, 0, dz_print);
}
@ -199,6 +200,7 @@ dzcnprobe(cndev)
case VAX_BTYP_420:
case VAX_BTYP_43:
case VAX_BTYP_46:
case VAX_BTYP_48:
cndev->cn_dev = makedev(DZMAJOR, 3);
dz_regs = iospace;
ioaccess(iospace, 0x200A0000, 1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vsbus.c,v 1.14 1999/02/02 18:37:21 ragge Exp $ */
/* $NetBSD: vsbus.c,v 1.15 1999/03/09 12:57:58 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -148,6 +148,10 @@ vsbus_attach(parent, self, aux)
va.va_type = inr_sr;
config_found(self, &va, vsbus_print);
/* XXX - Detecting smg on 4000 VLC crashes, SCSI is 53c94 */
if (vax_boardtype == VAX_BTYP_48)
return;
/* If sm_addr is set, a monochrome graphics adapter is found */
/* XXX - fixa! */
va.va_type = inr_vf;