a88d63fd77b1c8d5f935ca97778ed3bf0a14437d
* Copyright (c) 1992 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
* %sccs.include.redist.c%
* from: $Hdr: fbbm_253.c,v 4.300 91/06/09 06:33:12 root Rel41 $ SONY; */
* @
(#)fbbm_253.c 7.1 (Berkeley) %G%
* NWB-253 frame buffer driver
#include "../include/fix_machine_type.h"
#include "../iop/framebuf.h"
#include "../iop/fbreg.h"
#include "../fb/fbdefs.h"
extern char *ext_fnt24_addr
[];
extern char *ext_fnt_addr
[];
#define NOP { int j; for (j = 0; j < 40; j++); }
#define VRAM_START (unsigned int *)(0x88000000)
#define VRAM_WIDTH (2048/32)
fb253_Krom_addr(fb
, c
, sr
)
if ((c
>= 0x20) && (c
<= 0x7e)) {
c
= ((c
& 0x1f) | ((c
& 0xe0) << 2)) << 7;
return (caddr_t
)(c
+ fb
->Krom_base
+ (sr
->extent
.y
> 16 ? 0 : 96));
} else if ((c
>= 0xa1) && (c
<= 0xdf)) {
return ((caddr_t
)ext_fnt24_addr
[c
+ 64]);
return ((caddr_t
)ext_fnt_addr
[c
+ 64]);
} else if ((c
>= 0x2020) && (c
<= 0x7e7e)) {
c
= ((c
&0x1f)|((c
&0x60)<<5)|((c
&0x700)>>1))<<7;
c
= ((c
&0x7f)|((c
&0xf00)>>1)|((c
&0x4000)>>3))<<7;
c
= ((c
&0x7f)|((c
&0xf00)>>1)|((c
&0x2000)>>2)|0x1000)<<7;
c
= ((c
&0x1f)|((c
&0x60)<<5)|((c
&0x700)>>1)|0x1000)<<7;
return (caddr_t
)(c
+ fb
->Krom_base
+ (sr
->extent
.y
> 16 ? 0 : 96));
fb253_set_dimmer(fb
, dim
)
fb
->status_flag
= (fb
->status_flag
& 0xf3) | ((dim
& 3) << 2);
*(volatile u_short
*)(0xb8ff0000) = fb
->status_flag
;
dim
= (fb
->status_flag
>> 2) & 3;
fb253_get_pixel(fb
, pixel
)
fb253_ioctl(fb
, cmd
, data
)
if (*(volatile u_short
*)(0xb8ff0000) & 0x08)
if (*data
& FB_INT_VSYNC
) {
*(volatile u_short
*)(0xb8ff0000) = fb
->status_flag
;
if (*data
& FB_INT_VSYNC
) {
*(volatile u_short
*)(0xb8ff0000) = fb
->status_flag
;
if (off
< 2048/8 * 2048) /* X/8 * Y */
return (((unsigned int)0x8000000 + off
) >> PGSHIFT
);
if (badaddr(0xb8ff0000, 2) || badaddr(0xb8e00000, 2))
if ((*(volatile u_short
*)(0xb8ff0000) & 7) == 4)
nwp512_data1
, nwp512_data2
,
nwp518_data1
, nwp518_data2
,
nwe501_data1
, nwe501_data2
,
register volatile u_short
*ctlreg
= (u_short
*)(0xb8ff0000);
register volatile u_short
*crtreg
= (u_short
*)(0xb8fe0000);
register volatile u_short
*p
;
*ctlreg
= 0; /* stop crtc */
/* initialize crtc without R3{0,1,2} */
for (i
= 0; i
< 28; i
++) {
*ctlreg
= 0x02; /* start crtc */
/* set crtc control reg */
for (i
= 0; i
< 6; i
++) {
struct mfbdev fb253
= { (caddr_t
)VRAM_START
, VRAM_WIDTH
};
id
= ((*(volatile u_short
*)(0xb8ff0000)) >> 8) & 0xf;
fb
->FrameRect
.extent
.x
= 2048;
fb
->FrameRect
.extent
.y
= 2048;
fb
->VisRect
.extent
.x
= 816;
fb
->VisRect
.extent
.y
= 1024;
fb
->FrameRect
.extent
.x
= 2048;
fb
->FrameRect
.extent
.y
= 2048;
fb
->VisRect
.extent
.x
= 1024;
fb
->VisRect
.extent
.y
= 768;
fb
->FrameRect
.origin
.x
= 0;
fb
->FrameRect
.origin
.y
= 0;
fb
->VisRect
.origin
.x
= 0;
fb
->VisRect
.origin
.y
= 0;
fb
->Krom_BM0
.type
= BM_MEM
;
fb
->Krom_BM0
.rect
.origin
.x
= 0;
fb
->Krom_BM0
.rect
.origin
.y
= 0;
fb
->Krom_BM0
.rect
.extent
.x
= 16;
fb
->Krom_BM0
.rect
.extent
.y
= 16;
fb
->Krom_BM1
.type
= BM_MEM
;
fb
->Krom_BM1
.rect
.origin
.x
= 0;
fb
->Krom_BM1
.rect
.origin
.y
= 0;
fb
->Krom_BM1
.rect
.extent
.x
= 24;
fb
->Krom_BM1
.rect
.extent
.y
= 24;
fb
->Krom_base
= (char *)(0xb8e00000);
fb
->Krom_font_extent0
.x
= 16;
fb
->Krom_font_extent0
.y
= 16;
fb
->Krom_font_extent1
.x
= 24;
fb
->Krom_font_extent1
.y
= 24;
fb
->fbbm_op
= &fb253_ops
;
fb
->private = (caddr_t
)&fb253
;