Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Production Test Suite
Commits
e421d9ac
Commit
e421d9ac
authored
Mar 15, 2013
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common:gn4124: Allow dma items to pages 0 to 254 (was only page 0).
parent
f52a8dab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
gn4124.py
common/gn4124.py
+5
-4
No files found.
common/gn4124.py
View file @
e421d9ac
...
...
@@ -191,17 +191,18 @@ class CGN4124:
self
.
dma_csr
.
wr_reg
(
self
.
R_DMA_ATTRIB
,
attrib
)
else
:
# write nexy DMA item(s) in host memory
# uses
page 0
to store DMA items
# uses
255 pages (out of 256)
to store DMA items
# current and next item addresses are automatically set
if
(
self
.
dma_item_cnt
*
0x20
)
>
self
.
PAGE_SIZE
:
if
(
self
.
dma_item_cnt
*
0x20
)
>
self
.
PAGE_SIZE
*
255
:
raise
GN4124OperationError
(
'Maximum number of DMA items exceeded!'
)
current_item_addr
=
(
self
.
dma_item_cnt
-
1
)
*
0x20
next_item_addr
=
(
self
.
dma_item_cnt
)
*
0x20
next_item_page
=
((
self
.
dma_item_cnt
)
*
0x20
)
/
0x1000
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_CARRIER_START_ADDR
+
current_item_addr
,
carrier_addr
)
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_HOST_START_ADDR_L
+
current_item_addr
,
host_addr
)
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_HOST_START_ADDR_H
+
current_item_addr
,
0x0
)
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_LENGTH
+
current_item_addr
,
length
)
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_NEXT_ITEM_ADDR_L
+
current_item_addr
,
self
.
pages
[
0
]
+
next_item_addr
)
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_NEXT_ITEM_ADDR_L
+
current_item_addr
,
self
.
pages
[
next_item_page
]
+
(
next_item_addr
&
0xFFF
)
)
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_NEXT_ITEM_ADDR_H
+
current_item_addr
,
0x0
)
attrib
=
(
dma_dir
<<
self
.
DMA_ATTRIB_DIR
)
+
(
last_item
<<
self
.
DMA_ATTRIB_LAST
)
self
.
wr_reg
(
self
.
HOST_BAR
,
self
.
HOST_DMA_ATTRIB
+
current_item_addr
,
attrib
)
...
...
@@ -218,7 +219,7 @@ class CGN4124:
print
(
"0x
%02
X: 0x
%08
X"
%
(
addr
,
self
.
dma_csr
.
rd_reg
(
addr
)))
print
(
"Items in host memory:"
)
for
item
in
range
(
self
.
PAGE_SIZE
/
0x20
):
for
item
in
range
(
self
.
dma_item_cnt
*
0x20
):
print
(
"Item
%
d:"
%
item
)
for
addr
in
range
(
0x0
,
0x20
,
0x4
):
print
(
"0x
%02
X: 0x
%08
X"
%
(
item
*
0x20
+
addr
,
self
.
rd_reg
(
self
.
HOST_BAR
,
item
*
0x20
+
addr
)))
...
...
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