Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
fef702be
Commit
fef702be
authored
Nov 02, 2002
by
Geert Uytterhoeven
Committed by
Linus Torvalds
Nov 02, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] HP9000/300 I/O access fixes
HP9000/300: Replace remaining readb() and friends by in_8() and friends
parent
0cfcb1f1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
43 deletions
+42
-43
arch/m68k/hp300/time.c
arch/m68k/hp300/time.c
+9
-9
drivers/video/hpfb.c
drivers/video/hpfb.c
+33
-34
No files found.
arch/m68k/hp300/time.c
View file @
fef702be
...
...
@@ -40,7 +40,7 @@ static void hp300_tick(int irq, void *dev_id, struct pt_regs *regs)
{
unsigned
long
tmp
;
void
(
*
vector
)(
int
,
void
*
,
struct
pt_regs
*
)
=
dev_id
;
readb
(
CLOCKBASE
+
CLKSR
);
in_8
(
CLOCKBASE
+
CLKSR
);
asm
volatile
(
"movpw %1@(5),%0"
:
"=d"
(
tmp
)
:
"a"
(
CLOCKBASE
));
vector
(
irq
,
NULL
,
regs
);
}
...
...
@@ -51,25 +51,25 @@ unsigned long hp300_gettimeoffset(void)
unsigned
char
lsb
,
msb1
,
msb2
;
unsigned
short
ticks
;
msb1
=
readb
(
CLOCKBASE
+
5
);
lsb
=
readb
(
CLOCKBASE
+
7
);
msb2
=
readb
(
CLOCKBASE
+
5
);
msb1
=
in_8
(
CLOCKBASE
+
5
);
lsb
=
in_8
(
CLOCKBASE
+
7
);
msb2
=
in_8
(
CLOCKBASE
+
5
);
if
(
msb1
!=
msb2
)
/* A carry happened while we were reading. Read it again */
lsb
=
readb
(
CLOCKBASE
+
7
);
lsb
=
in_8
(
CLOCKBASE
+
7
);
ticks
=
INTVAL
-
((
msb2
<<
8
)
|
lsb
);
return
(
USECS_PER_JIFFY
*
ticks
)
/
INTVAL
;
}
void
__init
hp300_sched_init
(
void
(
*
vector
)(
int
,
void
*
,
struct
pt_regs
*
))
{
writeb
(
0x1
,
CLOCKBASE
+
CLKCR2
);
/* select CR1 */
writeb
(
0x1
,
CLOCKBASE
+
CLKCR
1
);
/* reset */
out_8
(
CLOCKBASE
+
CLKCR2
,
0x1
);
/* select CR1 */
out_8
(
CLOCKBASE
+
CLKCR1
,
0x
1
);
/* reset */
asm
volatile
(
" movpw %0,%1@(5)"
:
:
"d"
(
INTVAL
),
"a"
(
CLOCKBASE
));
sys_request_irq
(
6
,
hp300_tick
,
IRQ_FLG_STD
,
"timer tick"
,
vector
);
writeb
(
0x1
,
CLOCKBASE
+
CLKCR2
);
/* select CR1 */
writeb
(
0x40
,
CLOCKBASE
+
CLKCR1
);
/* enable irq */
out_8
(
CLOCKBASE
+
CLKCR2
,
0x1
);
/* select CR1 */
out_8
(
CLOCKBASE
+
CLKCR1
,
0x40
);
/* enable irq */
}
drivers/video/hpfb.c
View file @
fef702be
...
...
@@ -78,29 +78,29 @@ static int hpfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned
blue
,
unsigned
transp
,
struct
fb_info
*
info
)
{
while
(
readw
(
fb_regs
+
0x6002
)
&
0x4
)
udelay
(
1
);
writew
(
0
,
fb_regs
+
0x60f
0
);
writew
(
regno
,
fb_regs
+
0x60b8
);
writew
(
red
,
fb_regs
+
0x60b2
);
writew
(
green
,
fb_regs
+
0x60b4
);
writew
(
blue
,
fb_regs
+
0x60b6
);
writew
(
0xff
,
fb_regs
+
0x60f0
);
while
(
in_be16
(
fb_regs
+
0x6002
)
&
0x4
)
udelay
(
1
);
out_be16
(
fb_regs
+
0x60f0
,
0
);
out_be16
(
fb_regs
+
0x60b8
,
regno
);
out_be16
(
fb_regs
+
0x60b2
,
red
);
out_be16
(
fb_regs
+
0x60b4
,
green
);
out_be16
(
fb_regs
+
0x60b6
,
blue
);
out_be16
(
fb_regs
+
0x60f0
,
0xff
);
udelay
(
100
);
writew
(
0xffff
,
fb_regs
+
0x60ba
);
out_be16
(
fb_regs
+
0x60ba
,
0xffff
);
return
0
;
}
void
hpfb_copyarea
(
struct
fb_info
*
info
,
struct
fb_copyarea
*
area
)
{
while
(
readb
(
fb_regs
+
BUSY
)
&
fb_bitmask
);
writeb
(
0x3
,
fb_regs
+
WMRR
);
writew
(
area
->
sx
,
fb_regs
+
SOURCE_X
);
writew
(
area
->
sy
,
fb_regs
+
SOURCE_Y
);
writew
(
area
->
dx
,
fb_regs
+
DEST_X
);
writew
(
area
->
dy
,
fb_regs
+
DEST_Y
);
writew
(
area
->
height
,
fb_regs
+
WHEIGHT
);
writew
(
area
->
width
,
fb_regs
+
WWIDTH
);
writeb
(
fb_bitmask
,
fb_regs
+
WMOVE
);
while
(
in_8
(
fb_regs
+
BUSY
)
&
fb_bitmask
);
out_8
(
fb_regs
+
WMRR
,
0x3
);
out_be16
(
fb_regs
+
SOURCE_X
,
area
->
sx
);
out_be16
(
fb_regs
+
SOURCE_Y
,
area
->
sy
);
out_be16
(
fb_regs
+
DEST_X
,
area
->
dx
);
out_be16
(
fb_regs
+
DEST_Y
,
area
->
dy
);
out_be16
(
fb_regs
+
WHEIGHT
,
area
->
height
);
out_be16
(
fb_regs
+
WWIDTH
,
area
->
width
);
out_8
(
fb_regs
+
WMOVE
,
fb_bitmask
);
}
static
struct
fb_ops
hpfb_ops
=
{
...
...
@@ -121,38 +121,37 @@ int __init hpfb_init_one(unsigned long base)
{
unsigned
long
fboff
;
fboff
=
(
readb
(
base
+
TOPCAT_FBOMSB
)
<<
8
)
|
readb
(
base
+
TOPCAT_FBOLSB
);
fboff
=
(
in_8
(
base
+
TOPCAT_FBOMSB
)
<<
8
)
|
in_8
(
base
+
TOPCAT_FBOLSB
);
hpfb_fix
.
smem_start
=
0xf0000000
|
(
readb
(
base
+
fboff
)
<<
16
);
hpfb_fix
.
smem_start
=
0xf0000000
|
(
in_8
(
base
+
fboff
)
<<
16
);
fb_regs
=
base
;
#if 0
/* This is the magic incantation NetBSD uses to make Catseye boards work. */
writeb(0, base+0x480
0);
writeb(0, base+0x451
0);
writeb(0, base+0x4512
);
writeb(0, base+0x4514
);
writeb(0, base+0x4516
);
writeb(0x90, base+0x4206
);
out_8(base+0x4800,
0);
out_8(base+0x4510,
0);
out_8(base+0x4512, 0
);
out_8(base+0x4514, 0
);
out_8(base+0x4516, 0
);
out_8(base+0x4206, 0x90
);
#endif
/*
* Give the hardware a bit of a prod and work out how many bits per
* pixel are supported.
*/
writeb
(
0xff
,
base
+
TC_WEN
);
writeb
(
0xff
,
base
+
TC_FBEN
);
writeb
(
0xff
,
hpfb_fix
.
smem_start
);
fb_bitmask
=
readb
(
hpfb_fix
.
smem_start
);
out_8
(
base
+
TC_WEN
,
0xff
);
out_8
(
base
+
TC_FBEN
,
0xff
);
out_8
(
hpfb_fix
.
smem_start
,
0xff
);
fb_bitmask
=
in_8
(
hpfb_fix
.
smem_start
);
/*
* Enable reading/writing of all the planes.
*/
writeb
(
fb_bitmask
,
base
+
TC_WEN
);
writeb
(
fb_bitmask
,
base
+
TC_REN
);
writeb
(
fb_bitmask
,
base
+
TC_FBEN
);
writeb
(
0x1
,
base
+
TC_NBLANK
);
out_8
(
base
+
TC_WEN
,
fb_bitmask
);
out_8
(
base
+
TC_REN
,
fb_bitmask
);
out_8
(
base
+
TC_FBEN
,
fb_bitmask
);
out_8
(
base
+
TC_NBLANK
,
0x1
);
/*
* Let there be consoles..
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment