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
19b6a7e4
Commit
19b6a7e4
authored
Aug 25, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Move DMA mask-based bounce detection to dmabounce code.
parent
46e13d2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
20 deletions
+17
-20
arch/arm/common/dmabounce.c
arch/arm/common/dmabounce.c
+15
-9
arch/arm/common/sa1111.c
arch/arm/common/sa1111.c
+2
-11
No files found.
arch/arm/common/dmabounce.c
View file @
19b6a7e4
...
...
@@ -216,27 +216,33 @@ static inline dma_addr_t
map_single
(
struct
device
*
dev
,
void
*
ptr
,
size_t
size
,
enum
dma_data_direction
dir
)
{
dma_addr_t
dma_addr
;
struct
dmabounce_device_info
*
device_info
=
find_dmabounce_dev
(
dev
);
dma_addr_t
dma_addr
;
int
needs_bounce
=
0
;
if
(
device_info
)
DO_STATS
(
device_info
->
map_op_count
++
);
dma_addr
=
virt_to_dma
(
dev
,
ptr
);
if
(
dev
->
dma_mask
)
{
unsigned
long
mask
=
*
dev
->
dma_mask
;
unsigned
long
limit
;
limit
=
(
*
dev
->
dma_mask
+
1
)
&
~
(
*
dev
->
dma_mask
);
if
(
limit
&&
(
size
>
limit
))
{
dev_err
(
dev
,
"DMA mapping too big "
"(requested %#x mask %#Lx)
\n
"
,
size
,
*
dev
->
dma_mask
);
limit
=
(
mask
+
1
)
&
~
mask
;
if
(
limit
&&
size
>
limit
)
{
dev_err
(
dev
,
"DMA mapping too big (requested %#x "
"mask %#Lx)
\n
"
,
size
,
*
dev
->
dma_mask
);
return
~
0
;
}
}
dma_addr
=
virt_to_dma
(
dev
,
ptr
);
/*
* Figure out if we need to bounce from the DMA mask.
*/
needs_bounce
=
(
dma_addr
|
(
dma_addr
+
size
-
1
))
&
~
mask
;
}
if
(
device_info
&&
dma_needs_bounce
(
dev
,
dma_addr
,
size
))
{
if
(
device_info
&&
(
needs_bounce
||
dma_needs_bounce
(
dev
,
dma_addr
,
size
)
))
{
struct
safe_buffer
*
buf
;
buf
=
alloc_safe_buffer
(
device_info
,
ptr
,
size
,
dir
);
...
...
arch/arm/common/sa1111.c
View file @
19b6a7e4
...
...
@@ -761,9 +761,6 @@ static void __sa1111_remove(struct sa1111 *sachip)
*/
int
dma_needs_bounce
(
struct
device
*
dev
,
dma_addr_t
addr
,
size_t
size
)
{
unsigned
int
physaddr
=
SA1111_DMA_ADDR
((
unsigned
int
)
addr
);
u32
dma_mask
=
*
dev
->
dma_mask
;
/*
* Section 4.6 of the "Intel StrongARM SA-1111 Development Module
* User's Guide" mentions that jumpers R51 and R52 control the
...
...
@@ -771,14 +768,8 @@ int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
* SDRAM bank 1 on Neponset). The default configuration selects
* Assabet, so any address in bank 1 is necessarily invalid.
*/
if
((
machine_is_assabet
()
||
machine_is_pfs168
())
&&
(
addr
>=
0xc8000000
||
(
addr
+
size
)
>=
0xc8000000
))
return
1
;
/*
* Check to see if either the start or end are illegal.
*/
return
((
addr
&
~
dma_mask
))
||
((
addr
+
size
-
1
)
&
~
dma_mask
);
return
((
machine_is_assabet
()
||
machine_is_pfs168
())
&&
(
addr
>=
0xc8000000
||
(
addr
+
size
)
>=
0xc8000000
));
}
struct
sa1111_save_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