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
8b766794
Commit
8b766794
authored
Feb 22, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://lia64.bkbits.net/to-linus-2.5
into ppc970.osdl.org:/home/torvalds/v2.5/linux
parents
6e9aed30
4ce0447a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
39 deletions
+34
-39
arch/ia64/sn/io/machvec/pci_dma.c
arch/ia64/sn/io/machvec/pci_dma.c
+33
-39
include/asm-ia64/tlb.h
include/asm-ia64/tlb.h
+1
-0
No files found.
arch/ia64/sn/io/machvec/pci_dma.c
View file @
8b766794
...
@@ -225,13 +225,13 @@ sn_pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr
...
@@ -225,13 +225,13 @@ sn_pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr
int
int
sn_pci_map_sg
(
struct
pci_dev
*
hwdev
,
struct
scatterlist
*
sg
,
int
nents
,
int
direction
)
sn_pci_map_sg
(
struct
pci_dev
*
hwdev
,
struct
scatterlist
*
sg
,
int
nents
,
int
direction
)
{
{
int
i
;
int
i
;
vertex_hdl_t
vhdl
;
vertex_hdl_t
vhdl
;
unsigned
long
phys_addr
;
unsigned
long
phys_addr
;
struct
sn_device_sysdata
*
device_sysdata
;
struct
sn_device_sysdata
*
device_sysdata
;
pcibr_dmamap_t
dma_map
;
pcibr_dmamap_t
dma_map
;
struct
scatterlist
*
saved_sg
=
sg
;
struct
scatterlist
*
saved_sg
=
sg
;
unsigned
dma_flag
;
/* can't go anywhere w/o a direction in life */
/* can't go anywhere w/o a direction in life */
if
(
direction
==
PCI_DMA_NONE
)
if
(
direction
==
PCI_DMA_NONE
)
...
@@ -243,34 +243,33 @@ sn_pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dire
...
@@ -243,34 +243,33 @@ sn_pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dire
device_sysdata
=
SN_DEVICE_SYSDATA
(
hwdev
);
device_sysdata
=
SN_DEVICE_SYSDATA
(
hwdev
);
vhdl
=
device_sysdata
->
vhdl
;
vhdl
=
device_sysdata
->
vhdl
;
/*
* 64 bit DMA mask can use direct translations
* PCI only
* 32 bit DMA mask might be able to use direct, otherwise use dma map
* PCI-X
* only 64 bit DMA mask supported; both direct and dma map will fail
*/
if
(
hwdev
->
dma_mask
==
~
0UL
)
dma_flag
=
PCIIO_DMA_DATA
|
PCIIO_DMA_A64
;
else
dma_flag
=
PCIIO_DMA_DATA
;
/*
/*
* Setup a DMA address for each entry in the
* Setup a DMA address for each entry in the
* scatterlist.
* scatterlist.
*/
*/
for
(
i
=
0
;
i
<
nents
;
i
++
,
sg
++
)
{
for
(
i
=
0
;
i
<
nents
;
i
++
,
sg
++
)
{
phys_addr
=
__pa
((
unsigned
long
)
page_address
(
sg
->
page
)
+
sg
->
offset
);
phys_addr
=
__pa
((
unsigned
long
)
page_address
(
sg
->
page
)
+
sg
->
offset
);
sg
->
dma_address
=
pcibr_dmatrans_addr
(
vhdl
,
NULL
,
phys_addr
,
/*
sg
->
length
,
dma_flag
);
* Handle 32-63 bit cards via direct mapping
if
(
sg
->
dma_address
)
{
*/
if
(
IS_PCI32G
(
hwdev
))
{
sg
->
dma_address
=
pcibr_dmatrans_addr
(
vhdl
,
NULL
,
phys_addr
,
sg
->
length
,
PCIIO_DMA_DATA
);
sg
->
dma_length
=
sg
->
length
;
sg
->
dma_length
=
sg
->
length
;
/*
continue
;
* See if we got a direct map entry
*/
if
(
sg
->
dma_address
)
{
continue
;
}
}
}
/*
dma_map
=
pcibr_dmamap_alloc
(
vhdl
,
NULL
,
sg
->
length
,
* It is a 32 bit card and we cannot do direct mapping,
PCIIO_DMA_DATA
|
MINIMAL_ATE_FLAG
(
phys_addr
,
sg
->
length
));
* so we use an ATE.
*/
dma_map
=
pcibr_dmamap_alloc
(
vhdl
,
NULL
,
sg
->
length
,
PCIIO_DMA_DATA
);
if
(
!
dma_map
)
{
if
(
!
dma_map
)
{
printk
(
KERN_ERR
"sn_pci_map_sg: Unable to allocate "
printk
(
KERN_ERR
"sn_pci_map_sg: Unable to allocate "
"anymore 32 bit page map entries.
\n
"
);
"anymore 32 bit page map entries.
\n
"
);
...
@@ -356,38 +355,33 @@ sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
...
@@ -356,38 +355,33 @@ sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
unsigned
long
phys_addr
;
unsigned
long
phys_addr
;
struct
sn_device_sysdata
*
device_sysdata
;
struct
sn_device_sysdata
*
device_sysdata
;
pcibr_dmamap_t
dma_map
=
NULL
;
pcibr_dmamap_t
dma_map
=
NULL
;
unsigned
dma_flag
;
if
(
direction
==
PCI_DMA_NONE
)
if
(
direction
==
PCI_DMA_NONE
)
BUG
();
BUG
();
/* SN cannot support DMA addresses smaller than 32 bits. */
if
(
IS_PCI32L
(
hwdev
))
return
0
;
/*
/*
* find vertex for the device
* find vertex for the device
*/
*/
device_sysdata
=
SN_DEVICE_SYSDATA
(
hwdev
);
device_sysdata
=
SN_DEVICE_SYSDATA
(
hwdev
);
vhdl
=
device_sysdata
->
vhdl
;
vhdl
=
device_sysdata
->
vhdl
;
/*
* Call our dmamap interface
*/
dma_addr
=
0
;
phys_addr
=
__pa
(
ptr
);
phys_addr
=
__pa
(
ptr
);
/*
/*
* Devices that support 32 bit to 63 bit DMA addresses get
* 64 bit DMA mask can use direct translations
* 32 bit DMA addresses.
* PCI only
*
* 32 bit DMA mask might be able to use direct, otherwise use dma map
* First try to get a 32 bit direct map register.
* PCI-X
* only 64 bit DMA mask supported; both direct and dma map will fail
*/
*/
if
(
IS_PCI32G
(
hwdev
))
{
if
(
hwdev
->
dma_mask
==
~
0UL
)
dma_addr
=
pcibr_dmatrans_addr
(
vhdl
,
NULL
,
phys_addr
,
size
,
dma_flag
=
PCIIO_DMA_DATA
|
PCIIO_DMA_A64
;
PCIIO_DMA_DATA
);
else
if
(
dma_addr
)
dma_flag
=
PCIIO_DMA_DATA
;
return
dma_addr
;
}
dma_addr
=
pcibr_dmatrans_addr
(
vhdl
,
NULL
,
phys_addr
,
size
,
dma_flag
);
if
(
dma_addr
)
return
dma_addr
;
/*
/*
* It's a 32 bit card and we cannot do direct mapping so
* It's a 32 bit card and we cannot do direct mapping so
...
...
include/asm-ia64/tlb.h
View file @
8b766794
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/swap.h>
#include <asm/pgalloc.h>
#include <asm/processor.h>
#include <asm/processor.h>
#include <asm/tlbflush.h>
#include <asm/tlbflush.h>
...
...
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