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
04b55057
Commit
04b55057
authored
Mar 21, 2003
by
Alan Cox
Committed by
Linus Torvalds
Mar 21, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] module for legacy PC9800 ide
parent
baac05a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
drivers/ide/legacy/pc9800.c
drivers/ide/legacy/pc9800.c
+80
-0
No files found.
drivers/ide/legacy/pc9800.c
0 → 100644
View file @
04b55057
/*
* ide_pc9800.c
*
* Copyright (C) 1997-2000 Linux/98 project,
* Kyoto University Microcomputer Club.
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/ide.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/pc9800.h>
#define PC9800_IDE_BANKSELECT 0x432
#undef PC9800_IDE_DEBUG
static
void
pc9800_select
(
ide_drive_t
*
drive
)
{
#ifdef PC9800_IDE_DEBUG
byte
old
;
/* Too noisy: */
/* printk(KERN_DEBUG "pc9800_select(%s)\n", drive->name); */
outb
(
0x80
,
PC9800_IDE_BANKSELECT
);
old
=
inb
(
PC9800_IDE_BANKSELECT
);
if
(
old
!=
HWIF
(
drive
)
->
index
)
printk
(
KERN_DEBUG
"ide-pc9800: switching bank #%d -> #%d
\n
"
,
old
,
HWIF
(
drive
)
->
index
);
#endif
outb
(
HWIF
(
drive
)
->
index
,
PC9800_IDE_BANKSELECT
);
}
void
__init
ide_probe_for_pc9800
(
void
)
{
u8
saved_bank
;
if
(
!
PC9800_9821_P
()
/* || !PC9821_IDEIF_DOUBLE_P() */
)
return
;
if
(
!
request_region
(
PC9800_IDE_BANKSELECT
,
1
,
"ide0/1 bank"
))
{
printk
(
KERN_ERR
"ide: bank select port (%#x) is already occupied!
\n
"
,
PC9800_IDE_BANKSELECT
);
return
;
}
/* Do actual probing. */
if
((
saved_bank
=
inb
(
PC9800_IDE_BANKSELECT
))
==
(
u8
)
~
0
||
(
outb
(
saved_bank
^
1
,
PC9800_IDE_BANKSELECT
),
/* Next outb is dummy for reading status. */
outb
(
0x80
,
PC9800_IDE_BANKSELECT
),
inb
(
PC9800_IDE_BANKSELECT
)
!=
(
saved_bank
^
1
)))
{
printk
(
KERN_INFO
"ide: pc9800 type bank selecting port not found
\n
"
);
release_region
(
PC9800_IDE_BANKSELECT
,
1
);
return
;
}
/* Restore original value, just in case. */
outb
(
saved_bank
,
PC9800_IDE_BANKSELECT
);
/* These ports are probably used by IDE I/F. */
request_region
(
0x430
,
1
,
"ide"
);
request_region
(
0x435
,
1
,
"ide"
);
if
(
ide_hwifs
[
0
].
io_ports
[
IDE_DATA_OFFSET
]
==
HD_DATA
&&
ide_hwifs
[
1
].
io_ports
[
IDE_DATA_OFFSET
]
==
HD_DATA
)
{
ide_hwifs
[
0
].
chipset
=
ide_pc9800
;
ide_hwifs
[
0
].
mate
=
&
ide_hwifs
[
1
];
ide_hwifs
[
0
].
selectproc
=
pc9800_select
;
ide_hwifs
[
1
].
chipset
=
ide_pc9800
;
ide_hwifs
[
1
].
mate
=
&
ide_hwifs
[
0
];
ide_hwifs
[
1
].
selectproc
=
pc9800_select
;
}
}
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