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
9adaeddf
Commit
9adaeddf
authored
Sep 09, 2002
by
Irene Zubarev
Committed by
Greg Kroah-Hartman
Sep 09, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] IBM PCI Hotplug driver update for ISA based controllers
parent
af6e9e07
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
drivers/hotplug/ibmphp_ebda.c
drivers/hotplug/ibmphp_ebda.c
+10
-3
drivers/hotplug/ibmphp_hpc.c
drivers/hotplug/ibmphp_hpc.c
+34
-0
No files found.
drivers/hotplug/ibmphp_ebda.c
View file @
9adaeddf
...
@@ -815,6 +815,7 @@ static int __init ebda_rsrc_controller (void)
...
@@ -815,6 +815,7 @@ static int __init ebda_rsrc_controller (void)
struct
ebda_hpc_slot
*
slot_ptr
;
struct
ebda_hpc_slot
*
slot_ptr
;
struct
bus_info
*
bus_info_ptr1
,
*
bus_info_ptr2
;
struct
bus_info
*
bus_info_ptr1
,
*
bus_info_ptr2
;
int
rc
;
int
rc
;
int
retval
;
struct
slot
*
slot_cur
;
struct
slot
*
slot_cur
;
struct
list_head
*
list
;
struct
list_head
*
list
;
...
@@ -933,6 +934,10 @@ static int __init ebda_rsrc_controller (void)
...
@@ -933,6 +934,10 @@ static int __init ebda_rsrc_controller (void)
case
0
:
case
0
:
hpc_ptr
->
u
.
isa_ctlr
.
io_start
=
readw
(
io_mem
+
addr
);
hpc_ptr
->
u
.
isa_ctlr
.
io_start
=
readw
(
io_mem
+
addr
);
hpc_ptr
->
u
.
isa_ctlr
.
io_end
=
readw
(
io_mem
+
addr
+
2
);
hpc_ptr
->
u
.
isa_ctlr
.
io_end
=
readw
(
io_mem
+
addr
+
2
);
retval
=
check_region
(
hpc_ptr
->
u
.
isa_ctlr
.
io_start
,
(
hpc_ptr
->
u
.
isa_ctlr
.
io_end
-
hpc_ptr
->
u
.
isa_ctlr
.
io_start
+
1
));
if
(
retval
)
return
-
ENODEV
;
request_region
(
hpc_ptr
->
u
.
isa_ctlr
.
io_start
,
(
hpc_ptr
->
u
.
isa_ctlr
.
io_end
-
hpc_ptr
->
u
.
isa_ctlr
.
io_start
+
1
),
"ibmphp"
);
hpc_ptr
->
irq
=
readb
(
io_mem
+
addr
+
4
);
hpc_ptr
->
irq
=
readb
(
io_mem
+
addr
+
4
);
addr
+=
5
;
addr
+=
5
;
break
;
break
;
...
@@ -949,9 +954,9 @@ static int __init ebda_rsrc_controller (void)
...
@@ -949,9 +954,9 @@ static int __init ebda_rsrc_controller (void)
return
-
ENODEV
;
return
-
ENODEV
;
}
}
/* following 3 line: Now our driver only supports I2c ctlrType */
/* following 3 line: Now our driver only supports I2c
/ISA
ctlrType */
if
((
hpc_ptr
->
ctlr_type
!=
2
)
&&
(
hpc_ptr
->
ctlr_type
!=
4
))
{
if
((
hpc_ptr
->
ctlr_type
!=
2
)
&&
(
hpc_ptr
->
ctlr_type
!=
4
)
&&
(
hpc_ptr
->
ctlr_type
!=
0
)
)
{
err
(
"Please run this driver on
ibm xseries440
\n
"
);
err
(
"Please run this driver on
IBM xSeries440 or xSeries 235
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -1211,6 +1216,8 @@ void ibmphp_free_ebda_hpc_queue (void)
...
@@ -1211,6 +1216,8 @@ void ibmphp_free_ebda_hpc_queue (void)
list_for_each_safe
(
list
,
next
,
&
ebda_hpc_head
)
{
list_for_each_safe
(
list
,
next
,
&
ebda_hpc_head
)
{
controller
=
list_entry
(
list
,
struct
controller
,
ebda_hpc_list
);
controller
=
list_entry
(
list
,
struct
controller
,
ebda_hpc_list
);
if
(
controller
->
ctlr_type
==
0
)
release_region
(
controller
->
u
.
isa_ctlr
.
io_start
,
(
controller
->
u
.
isa_ctlr
.
io_end
-
controller
->
u
.
isa_ctlr
.
io_start
+
1
));
free_ebda_hpc
(
controller
);
free_ebda_hpc
(
controller
);
}
}
}
}
...
...
drivers/hotplug/ibmphp_hpc.c
View file @
9adaeddf
...
@@ -351,10 +351,41 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void *WPGBbar, u8 index,
...
@@ -351,10 +351,41 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void *WPGBbar, u8 index,
return
(
rc
);
return
(
rc
);
}
}
//------------------------------------------------------------
// Read from ISA type HPC
//------------------------------------------------------------
static
u8
isa_ctrl_read
(
struct
controller
*
ctlr_ptr
,
u8
offset
)
{
u16
start_address
;
u16
end_address
;
u8
data
;
start_address
=
ctlr_ptr
->
u
.
isa_ctlr
.
io_start
;
end_address
=
ctlr_ptr
->
u
.
isa_ctlr
.
io_end
;
data
=
inb
(
start_address
+
offset
);
return
data
;
}
//--------------------------------------------------------------
// Write to ISA type HPC
//--------------------------------------------------------------
static
void
isa_ctrl_write
(
struct
controller
*
ctlr_ptr
,
u8
offset
,
u8
data
)
{
u16
start_address
;
u16
port_address
;
start_address
=
ctlr_ptr
->
u
.
isa_ctlr
.
io_start
;
port_address
=
start_address
+
(
u16
)
offset
;
outb
(
data
,
port_address
);
}
static
u8
ctrl_read
(
struct
controller
*
ctlr
,
void
*
base
,
u8
offset
)
static
u8
ctrl_read
(
struct
controller
*
ctlr
,
void
*
base
,
u8
offset
)
{
{
u8
rc
;
u8
rc
;
switch
(
ctlr
->
ctlr_type
)
{
switch
(
ctlr
->
ctlr_type
)
{
case
0
:
rc
=
isa_ctrl_read
(
ctlr
,
offset
);
break
;
case
2
:
case
2
:
case
4
:
case
4
:
rc
=
i2c_ctrl_read
(
ctlr
,
base
,
offset
);
rc
=
i2c_ctrl_read
(
ctlr
,
base
,
offset
);
...
@@ -369,6 +400,9 @@ static u8 ctrl_write (struct controller *ctlr, void *base, u8 offset, u8 data)
...
@@ -369,6 +400,9 @@ static u8 ctrl_write (struct controller *ctlr, void *base, u8 offset, u8 data)
{
{
u8
rc
=
0
;
u8
rc
=
0
;
switch
(
ctlr
->
ctlr_type
)
{
switch
(
ctlr
->
ctlr_type
)
{
case
0
:
isa_ctrl_write
(
ctlr
,
offset
,
data
);
break
;
case
2
:
case
2
:
case
4
:
case
4
:
rc
=
i2c_ctrl_write
(
ctlr
,
base
,
offset
,
data
);
rc
=
i2c_ctrl_write
(
ctlr
,
base
,
offset
,
data
);
...
...
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