Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FPGA Configuration Space
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
FPGA Configuration Space
Commits
03df8afd
Commit
03df8afd
authored
12 years ago
by
Wesley W. Terpstra
Browse files
Options
Downloads
Patches
Plain Diff
Print the correct addresses read/write.
Debugging with bad information sucks!
parent
eb346cf7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
driver/pcie_wb.c
+6
-6
6 additions, 6 deletions
driver/pcie_wb.c
with
6 additions
and
6 deletions
driver/pcie_wb.c
+
6
−
6
View file @
03df8afd
...
...
@@ -114,15 +114,15 @@ static void wb_write(struct wishbone* wb, wb_addr_t addr, wb_data_t data)
switch
(
dev
->
width
)
{
case
4
:
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": iowrite32(0x%x, 0x%x)
\n
"
,
data
,
addr
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": iowrite32(0x%x, 0x%x)
\n
"
,
data
,
addr
&
~
3
);
iowrite32
(
data
,
window
+
(
addr
&
WINDOW_LOW
));
break
;
case
2
:
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": iowrite16(0x%x, 0x%x)
\n
"
,
data
>>
dev
->
shift
,
addr
+
dev
->
low_addr
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": iowrite16(0x%x, 0x%x)
\n
"
,
data
>>
dev
->
shift
,
(
addr
&
~
3
)
+
dev
->
low_addr
);
iowrite16
(
data
>>
dev
->
shift
,
window
+
(
addr
&
WINDOW_LOW
)
+
dev
->
low_addr
);
break
;
case
1
:
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": iowrite8(0x%x, 0x%x)
\n
"
,
data
>>
dev
->
shift
,
addr
+
dev
->
low_addr
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": iowrite8(0x%x, 0x%x)
\n
"
,
data
>>
dev
->
shift
,
(
addr
&
~
3
)
+
dev
->
low_addr
);
iowrite8
(
data
>>
dev
->
shift
,
window
+
(
addr
&
WINDOW_LOW
)
+
dev
->
low_addr
);
break
;
}
...
...
@@ -148,15 +148,15 @@ static wb_data_t wb_read(struct wishbone* wb, wb_addr_t addr)
switch
(
dev
->
width
)
{
case
4
:
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": ioread32(0x%x)
\n
"
,
addr
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": ioread32(0x%x)
\n
"
,
addr
&
~
3
);
out
=
((
wb_data_t
)
ioread32
(
window
+
(
addr
&
WINDOW_LOW
)));
break
;
case
2
:
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": ioread16(0x%x)
\n
"
,
addr
+
dev
->
low_addr
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": ioread16(0x%x)
\n
"
,
(
addr
&
~
3
)
+
dev
->
low_addr
);
out
=
((
wb_data_t
)
ioread16
(
window
+
(
addr
&
WINDOW_LOW
)
+
dev
->
low_addr
))
<<
dev
->
shift
;
break
;
case
1
:
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": ioread8(0x%x)
\n
"
,
addr
+
dev
->
low_addr
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": ioread8(0x%x)
\n
"
,
(
addr
&
~
3
)
+
dev
->
low_addr
);
out
=
((
wb_data_t
)
ioread8
(
window
+
(
addr
&
WINDOW_LOW
)
+
dev
->
low_addr
))
<<
dev
->
shift
;
break
;
default:
// technically should be unreachable
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment