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
7eae642f
Commit
7eae642f
authored
Feb 09, 2006
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: Implement SUN4V PCI config space access.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
bade5622
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
4 deletions
+93
-4
arch/sparc64/kernel/pci_sun4v.c
arch/sparc64/kernel/pci_sun4v.c
+36
-4
arch/sparc64/kernel/pci_sun4v.h
arch/sparc64/kernel/pci_sun4v.h
+9
-0
arch/sparc64/kernel/pci_sun4v_asm.S
arch/sparc64/kernel/pci_sun4v_asm.S
+48
-0
No files found.
arch/sparc64/kernel/pci_sun4v.c
View file @
7eae642f
...
@@ -74,15 +74,47 @@ struct pci_iommu_ops pci_sun4v_iommu_ops = {
...
@@ -74,15 +74,47 @@ struct pci_iommu_ops pci_sun4v_iommu_ops = {
static
int
pci_sun4v_read_pci_cfg
(
struct
pci_bus
*
bus_dev
,
unsigned
int
devfn
,
static
int
pci_sun4v_read_pci_cfg
(
struct
pci_bus
*
bus_dev
,
unsigned
int
devfn
,
int
where
,
int
size
,
u32
*
value
)
int
where
,
int
size
,
u32
*
value
)
{
{
/* XXX Implement me! XXX */
struct
pci_pbm_info
*
pbm
=
bus_dev
->
sysdata
;
return
0
;
unsigned
long
devhandle
=
pbm
->
devhandle
;
unsigned
int
bus
=
bus_dev
->
number
;
unsigned
int
device
=
PCI_SLOT
(
devfn
);
unsigned
int
func
=
PCI_FUNC
(
devfn
);
unsigned
long
ret
;
ret
=
pci_sun4v_config_get
(
devhandle
,
HV_PCI_DEVICE_BUILD
(
bus
,
device
,
func
),
where
,
size
);
switch
(
size
)
{
case
1
:
*
value
=
ret
&
0xff
;
break
;
case
2
:
*
value
=
ret
&
0xffff
;
break
;
case
4
:
*
value
=
ret
&
0xffffffff
;
break
;
};
return
PCIBIOS_SUCCESSFUL
;
}
}
static
int
pci_sun4v_write_pci_cfg
(
struct
pci_bus
*
bus_dev
,
unsigned
int
devfn
,
static
int
pci_sun4v_write_pci_cfg
(
struct
pci_bus
*
bus_dev
,
unsigned
int
devfn
,
int
where
,
int
size
,
u32
value
)
int
where
,
int
size
,
u32
value
)
{
{
/* XXX Implement me! XXX */
struct
pci_pbm_info
*
pbm
=
bus_dev
->
sysdata
;
return
0
;
unsigned
long
devhandle
=
pbm
->
devhandle
;
unsigned
int
bus
=
bus_dev
->
number
;
unsigned
int
device
=
PCI_SLOT
(
devfn
);
unsigned
int
func
=
PCI_FUNC
(
devfn
);
unsigned
long
ret
;
ret
=
pci_sun4v_config_put
(
devhandle
,
HV_PCI_DEVICE_BUILD
(
bus
,
device
,
func
),
where
,
size
,
value
);
return
PCIBIOS_SUCCESSFUL
;
}
}
static
struct
pci_ops
pci_sun4v_ops
=
{
static
struct
pci_ops
pci_sun4v_ops
=
{
...
...
arch/sparc64/kernel/pci_sun4v.h
View file @
7eae642f
...
@@ -16,5 +16,14 @@ extern unsigned long pci_sun4v_iommu_map(unsigned long devhandle,
...
@@ -16,5 +16,14 @@ extern unsigned long pci_sun4v_iommu_map(unsigned long devhandle,
extern
unsigned
long
pci_sun4v_iommu_demap
(
unsigned
long
devhandle
,
extern
unsigned
long
pci_sun4v_iommu_demap
(
unsigned
long
devhandle
,
unsigned
long
tsbid
,
unsigned
long
tsbid
,
unsigned
long
num_ttes
);
unsigned
long
num_ttes
);
extern
unsigned
long
pci_sun4v_config_get
(
unsigned
long
devhandle
,
unsigned
long
pci_device
,
unsigned
long
config_offset
,
unsigned
long
size
);
extern
int
pci_sun4v_config_put
(
unsigned
long
devhandle
,
unsigned
long
pci_device
,
unsigned
long
config_offset
,
unsigned
long
size
,
unsigned
long
data
);
#endif
/* !(_PCI_SUN4V_H) */
#endif
/* !(_PCI_SUN4V_H) */
arch/sparc64/kernel/pci_sun4v_asm.S
View file @
7eae642f
...
@@ -54,3 +54,51 @@ pci_sun4v_iommu_demap:
...
@@ -54,3 +54,51 @@ pci_sun4v_iommu_demap:
ta
HV_FAST_TRAP
ta
HV_FAST_TRAP
retl
retl
mov
%
o1
,
%
o0
mov
%
o1
,
%
o0
/
*
%
o0
:
devhandle
*
%
o1
:
pci_device
*
%
o2
:
pci_config_offset
*
%
o3
:
size
*
*
returns
%
o0
:
data
*
*
If
there
is
an
error
,
the
data
will
be
returned
*
as
all
1
's.
*/
.
globl
pci_sun4v_config_get
pci_sun4v_config_get
:
mov
%
o3
,
%
o4
mov
%
o2
,
%
o3
mov
%
o1
,
%
o2
mov
%
o0
,
%
o1
mov
HV_FAST_PCI_CONFIG_GET
,
%
o0
ta
HV_FAST_TRAP
brnz
,
a
,
pn
%
o1
,
1
f
mov
-
1
,
%
o2
1
:
retl
mov
%
o2
,
%
o0
/
*
%
o0
:
devhandle
*
%
o1
:
pci_device
*
%
o2
:
pci_config_offset
*
%
o3
:
size
*
%
o4
:
data
*
*
returns
%
o0
:
status
*
*
status
will
be
zero
if
the
operation
completed
*
successfully
,
else
-
1
if
not
*/
.
globl
pci_sun4v_config_put
pci_sun4v_config_put
:
mov
%
o3
,
%
o4
mov
%
o2
,
%
o3
mov
%
o1
,
%
o2
mov
%
o0
,
%
o1
mov
HV_FAST_PCI_CONFIG_PUT
,
%
o0
ta
HV_FAST_TRAP
brnz
,
a
,
pn
%
o1
,
1
f
mov
-
1
,
%
o1
1
:
retl
mov
%
o1
,
%
o0
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