Subject: Re: Current tarballs best for Centris 660AV
To: Andreas Boschke <andreas@cs.ucsb.edu>
From: Dave Huang <khym@bga.com>
List: port-mac68k
Date: 12/13/1996 22:03:51
On Wed, 11 Dec 1996, Andreas Boschke wrote:
> Where can I find tarballs which are most current for a Centris 660AV?

You can get the userland binaries from:
ftp://ftp.eskimo.com/u/w/wormey/netbsd/tarballs

And I've put the kernel that I run on my Centris 660av on:
ftp://host4.alterity.com/pub/netbsd.gz

> I understand a few folks out there have gotten their Centris/Quadra
> 660AV running NetBSD.

The kernel I run has the following patches, which lets stuff like dt and X
run... 

The X server on ftp.netbsd.org, in arch/mac68k/X11 can't find the rgb
database though; it prints "Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'". 
ktrace shows that it's actually looking for /usr/X11R6/lib/X11/rgb.db
though, which I don't have. The older X server, at ftp.macbsd.com,
/pub/NetBSD/cray-ymp/X11R6/X.11Mar95.tgz works fine...

Anyways, here are some patches to get the internal video configured on a
660av (wonder if it works on an 840av too? I couldn't figure out how to
determine the amount of VRAM though, so it's currently limited to 1MB... I
think 840avs can have 2MB).

diff -cr /usr/src/sys/arch/mac68k/dev/grf_iv.c ./dev/grf_iv.c
*** /usr/src/sys/arch/mac68k/dev/grf_iv.c	Mon Oct 14 11:10:38 1996
--- ./dev/grf_iv.c	Wed Dec 11 01:48:53 1996
***************
*** 106,113 ****
  	gm->hres = 80;		/* XXX Hack */
  	gm->vres = 80;		/* XXX Hack */
  	gm->fbsize = gm->rowbytes * gm->height;
! 	gm->fbbase = (caddr_t) mac68k_vidlog;
! 	gm->fboff = 0;
  
  	/* Perform common video attachment. */
  	grf_establish(sc, NULL, grfiv_mode, grfiv_phys);
--- 106,113 ----
  	gm->hres = 80;		/* XXX Hack */
  	gm->vres = 80;		/* XXX Hack */
  	gm->fbsize = gm->rowbytes * gm->height;
! 	gm->fbbase = (caddr_t) (mac68k_vidlog & ~PGOFSET);
! 	gm->fboff = mac68k_vidlog & PGOFSET;
  
  	/* Perform common video attachment. */
  	grf_establish(sc, NULL, grfiv_mode, grfiv_phys);
***************
*** 142,146 ****
  	 * If we're using IIsi or similar, this will be 0.
  	 * If we're using IIvx or similar, this will be correct.
  	 */
! 	return (caddr_t) mac68k_vidphys;
  }
--- 142,146 ----
  	 * If we're using IIsi or similar, this will be 0.
  	 * If we're using IIvx or similar, this will be correct.
  	 */
! 	return (caddr_t) (mac68k_vidphys + addr - mac68k_vidlog);
  }
diff -cr /usr/src/sys/arch/mac68k/dev/ite.c ./dev/ite.c
*** /usr/src/sys/arch/mac68k/dev/ite.c	Tue Nov 19 06:18:12 1996
--- ./dev/ite.c	Fri Dec 13 21:25:59 1996
***************
*** 857,863 ****
  
  	if (strcmp(ga->ga_name, "ite"))
  		return 0;
! 	pa = pmap_extract(pmap_kernel(), (vm_offset_t) gm->fbbase);
  
  	return (pa == (vm_offset_t) mac68k_vidphys);
  }
--- 857,863 ----
  
  	if (strcmp(ga->ga_name, "ite"))
  		return 0;
! 	pa = pmap_extract(pmap_kernel(), (vm_offset_t) (gm->fbbase + gm->fboff));
  
  	return (pa == (vm_offset_t) mac68k_vidphys);
  }
diff -cr /usr/src/sys/arch/mac68k/mac68k/locore.s ./mac68k/locore.s
*** /usr/src/sys/arch/mac68k/mac68k/locore.s	Thu Nov  7 06:17:49 1996
--- ./mac68k/locore.s	Mon Dec  9 19:51:32 1996
***************
*** 900,908 ****
  	.long	0x4e7b0005		| movc d0,itt1 ;Disable itt1
  	.long	0x4e7b0006		| movc d0,dtt0 ;Disable dtt0
  	.long	0x4e7b0007		| movc d0,dtt1 ;Disable dtt1
- 	.long	0x4e7b0003		| movc d0,tc   ;Disable MMU
  
! 	movl	#0x0,sp@-		| Fake unenabled MMU
  	jra	do_bootstrap
  
  Lstartnot040:
--- 900,910 ----
  	.long	0x4e7b0005		| movc d0,itt1 ;Disable itt1
  	.long	0x4e7b0006		| movc d0,dtt0 ;Disable dtt0
  	.long	0x4e7b0007		| movc d0,dtt1 ;Disable dtt1
  
! 	.long	0x4e7a0003		| movec tc,d0
! 	lea	_macos_tc,a0
! 	movl	d0,a0@
! 	movl	d0,sp@-			| Save current TC for bootstrap
  	jra	do_bootstrap
  
  Lstartnot040:
***************
*** 938,943 ****
--- 940,947 ----
  
  	cmpl	#MMU_68040, _mmutype
  	jne	Lenablepre040MMU	| if not 040, skip
+ 	movql	#0,d0
+ 	.long	0x4e7b0003		| movc d0,tc   ;Disable MMU
  	movl	a1,d1
  	.long	0x4e7b1807		| movc d1,srp
  	.word	0xf4d8			| cinva bc
***************
*** 1874,1886 ****
  	.long	0x4e7a0003		| movec tc,d0
  	andw	#0x8000,d0
  	jeq	Lget_phys1		| MMU is disabled
! 	movc	sfc,d1
! 	movql	#1,d0			| FC for ptestr
! 	movc	d0,sfc
  	movl	sp@(4),a0		| logical address to look up
  	.word	0xf568			| ptestr (a0)
  	.long	0x4e7a0805		| movec mmusr,d0
! 	movc	d1,sfc
  	rts
  Lget_phys1:
  #endif
--- 1878,1890 ----
  	.long	0x4e7a0003		| movec tc,d0
  	andw	#0x8000,d0
  	jeq	Lget_phys1		| MMU is disabled
! 	movc	dfc,d1
! 	movql	#5,d0			| FC for ptestr
! 	movc	d0,dfc
  	movl	sp@(4),a0		| logical address to look up
  	.word	0xf568			| ptestr (a0)
  	.long	0x4e7a0805		| movec mmusr,d0
! 	movc	d1,dfc
  	rts
  Lget_phys1:
  #endif
diff -cr /usr/src/sys/arch/mac68k/mac68k/machdep.c ./mac68k/machdep.c
*** /usr/src/sys/arch/mac68k/mac68k/machdep.c	Tue Nov 19 06:18:22 1996
--- ./mac68k/machdep.c	Fri Dec 13 21:47:43 1996
***************
*** 2335,2341 ****
  {
  	static int firstpass = 1;
  	int setup_mrg_vectors = 0;
- 	u_long phys;
  	struct cpu_model_info *cpui;
  
  	/*
--- 2335,2340 ----
***************
*** 2355,2371 ****
  		return;
  
  	/*
- 	 * Get the PA of the console framebuffer, iff we're on an 040.  
- 	 * We can't call get_physical() on the 851/030 this early, but
- 	 * neither can we call it later on the 040; by the time
- 	 * we've figured out we have an 851 or 030, we've disabled the
- 	 * 040 MMU.  XXX This sucks.
- 	 */
- 	if (mmutype == MMU_68040)
- 		mac68k_vidphys = get_physical(videoaddr, &phys) ?
- 		    phys : videoaddr;
- 
- 	/*
  	 * Set up any machine specific stuff that we have to before
  	 * ANYTHING else happens
  	 */
--- 2354,2359 ----
***************
*** 2599,2605 ****
  			return 0;
  
  		*phys = ph;
! 		mask = 0x00000fff;
  	} else {
  		i = get_pte(addr, pte, &psr);
  
--- 2587,2593 ----
  			return 0;
  
  		*phys = ph;
! 		mask = (macos_tc & 0x4000) ? 0x00001fff : 0x00000fff;
  	} else {
  		i = get_pte(addr, pte, &psr);
  
***************
*** 2811,2816 ****
--- 2799,2810 ----
  			 */
  			check_video("LC video (0x50f40000)",
  					512 * 1024, 512 * 1024);
+ 		} else if (0x50100000 <= videoaddr && videoaddr < 0x50101000) {
+ 			/*
+ 			 * Kludge for AV internal video
+ 			 */
+ 			check_video("AV video (0x50100?00)", 1 * 1024 * 1024,
+ 						1 * 1024 * 1024);
  		} else {
  			printf( "  no internal video at address 0 -- "
  				"videoaddr is 0x%lx.\n", videoaddr);
diff -cr /usr/src/sys/arch/mac68k/mac68k/pmap_bootstrap.c ./mac68k/pmap_bootstrap.c
*** /usr/src/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Tue Oct 15 06:38:40 1996
--- ./mac68k/pmap_bootstrap.c	Mon Dec  9 19:51:32 1996
***************
*** 570,576 ****
  	oldROMBase = ROMBase;
  	mac68k_vidphys = videoaddr;
  
! 	if ((tc & 0x80000000) && (mmutype == MMU_68030)) {
  		if (mac68k_machine.do_graybars)
  			printf("Getting mapping from MMU.\n");
  		(void) get_mapping();
--- 570,577 ----
  	oldROMBase = ROMBase;
  	mac68k_vidphys = videoaddr;
  
! 	if (((tc & 0x80000000) && (mmutype == MMU_68030)) ||
! 	    ((tc & 0x8000) && (mmutype == MMU_68040))) {
  		if (mac68k_machine.do_graybars)
  			printf("Getting mapping from MMU.\n");
  		(void) get_mapping();