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
Kirill Smelkov
linux
Commits
f0ba2daa
Commit
f0ba2daa
authored
Jul 27, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: In schizo driver, if virtual-dma property exists, respect it.
parent
5c6cf233
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
7 deletions
+64
-7
arch/sparc64/kernel/pci_schizo.c
arch/sparc64/kernel/pci_schizo.c
+64
-7
No files found.
arch/sparc64/kernel/pci_schizo.c
View file @
f0ba2daa
...
...
@@ -1616,8 +1616,40 @@ static void schizo_pbm_strbuf_init(struct pci_pbm_info *pbm)
static
void
schizo_pbm_iommu_init
(
struct
pci_pbm_info
*
pbm
)
{
struct
pci_iommu
*
iommu
=
pbm
->
iommu
;
unsigned
long
tsbbase
,
i
,
tagbase
,
database
;
unsigned
long
tsbbase
,
i
,
tagbase
,
database
,
order
;
u32
vdma
[
2
],
dma_mask
;
u64
control
;
int
err
,
tsbsize
;
err
=
prom_getproperty
(
pbm
->
prom_node
,
"virtual-dma"
,
(
char
*
)
&
vdma
[
0
],
sizeof
(
vdma
));
if
(
err
==
0
||
err
==
-
1
)
{
/* No property, use default values. */
vdma
[
0
]
=
0xc0000000
;
vdma
[
1
]
=
0x40000000
;
}
dma_mask
=
vdma
[
0
];
switch
(
vdma
[
1
])
{
case
0x20000000
:
dma_mask
|=
0x1fffffff
;
tsbsize
=
64
;
break
;
case
0x40000000
:
dma_mask
|=
0x3fffffff
;
tsbsize
=
128
;
break
;
case
0x80000000
:
dma_mask
|=
0x7fffffff
;
tsbsize
=
128
;
break
;
default:
prom_printf
(
"SCHIZO: strange virtual-dma size.
\n
"
);
prom_halt
();
};
/* Setup initial software IOMMU state. */
spin_lock_init
(
&
iommu
->
lock
);
...
...
@@ -1656,16 +1688,32 @@ static void schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
* table (128K ioptes * 8 bytes per iopte). This is
* page order 7 on UltraSparc.
*/
tsbbase
=
__get_free_pages
(
GFP_KERNEL
,
get_order
(
IO_TSB_SIZE
));
order
=
get_order
(
tsbsize
*
8
*
1024
);
tsbbase
=
__get_free_pages
(
GFP_KERNEL
,
order
);
if
(
!
tsbbase
)
{
prom_printf
(
"%s: Error, gfp(tsb) failed.
\n
"
,
pbm
->
name
);
prom_halt
();
}
iommu
->
page_table
=
(
iopte_t
*
)
tsbbase
;
iommu
->
page_table_sz_bits
=
17
;
iommu
->
page_table_map_base
=
0xc0000000
;
iommu
->
dma_addr_mask
=
0xffffffff
;
memset
((
char
*
)
tsbbase
,
0
,
IO_TSB_SIZE
);
iommu
->
page_table_map_base
=
vdma
[
0
];
iommu
->
dma_addr_mask
=
dma_mask
;
memset
((
char
*
)
tsbbase
,
0
,
PAGE_SIZE
<<
order
);
switch
(
tsbsize
)
{
case
64
:
iommu
->
page_table_sz_bits
=
16
;
break
;
case
128
:
iommu
->
page_table_sz_bits
=
17
;
break
;
default:
prom_printf
(
"iommu_init: Illegal TSB size %d
\n
"
,
tsbsize
);
prom_halt
();
break
;
};
/* We start with no consistent mappings. */
iommu
->
lowest_consistent_map
=
...
...
@@ -1680,7 +1728,16 @@ static void schizo_pbm_iommu_init(struct pci_pbm_info *pbm)
control
=
schizo_read
(
iommu
->
iommu_control
);
control
&=
~
(
SCHIZO_IOMMU_CTRL_TSBSZ
|
SCHIZO_IOMMU_CTRL_TBWSZ
);
control
|=
(
SCHIZO_IOMMU_TSBSZ_128K
|
SCHIZO_IOMMU_CTRL_ENAB
);
switch
(
tsbsize
)
{
case
64
:
control
|=
SCHIZO_IOMMU_TSBSZ_64K
;
break
;
case
128
:
control
|=
SCHIZO_IOMMU_TSBSZ_128K
;
break
;
};
control
|=
SCHIZO_IOMMU_CTRL_ENAB
;
schizo_write
(
iommu
->
iommu_control
,
control
);
}
...
...
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