Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
FPGA Configuration Space
Commits
8fa20372
Commit
8fa20372
authored
Mar 19, 2014
by
Cesar Prados
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vme_wb: add access of the high bits of the WB bus
address
parent
5e72f59e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
vme_wb.c
vme-wb/vme_wb.c
+25
-7
vme_wb.h
vme-wb/vme_wb.h
+6
-0
No files found.
vme-wb/vme_wb.c
View file @
8fa20372
...
...
@@ -100,18 +100,25 @@ static void wb_write(struct wishbone *wb, wb_addr_t addr, wb_data_t data)
{
struct
vme_wb_dev
*
dev
;
unsigned
char
*
reg_win
;
unsigned
char
*
ctrl_win
;
wb_addr_t
window_offset
;
dev
=
container_of
(
wb
,
struct
vme_wb_dev
,
wb
);
reg_win
=
dev
->
vme_res
.
map
[
MAP_REG
]
->
kernel_va
;
ctrl_win
=
dev
->
vme_res
.
map
[
MAP_CTRL
]
->
kernel_va
;
addr
=
addr
&
WBM_ADD_MASK
;
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
VME_WB
": iowrite32(0x%x, 0x%x)
\n
"
,
data
,
addr
);
iowrite32
(
cpu_to_be32
(
data
),
reg_win
+
addr
);
window_offset
=
addr
&
WINDOW_HIGH
;
if
(
window_offset
!=
dev
->
window_offset
)
{
iowrite32
(
cpu_to_be32
(
window_offset
),
ctrl_win
+
WINDOW_OFFSET_LOW
);
dev
->
window_offset
=
window_offset
;
}
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
VME_WB
": WRITE
\n
"
);
printk
(
KERN_ALERT
VME_WB
": WRITE (0x%x) = 0x%x)
\n
"
,
data
,
addr
);
iowrite32
(
cpu_to_be32
(
data
),
reg_win
+
(
addr
&
WINDOW_LOW
));
}
static
wb_data_t
wb_read
(
struct
wishbone
*
wb
,
wb_addr_t
addr
)
...
...
@@ -119,15 +126,25 @@ static wb_data_t wb_read(struct wishbone *wb, wb_addr_t addr)
wb_data_t
out
;
struct
vme_wb_dev
*
dev
;
unsigned
char
*
reg_win
;
unsigned
char
*
ctrl_win
;
wb_addr_t
window_offset
;
dev
=
container_of
(
wb
,
struct
vme_wb_dev
,
wb
);
reg_win
=
dev
->
vme_res
.
map
[
MAP_REG
]
->
kernel_va
;
ctrl_win
=
dev
->
vme_res
.
map
[
MAP_CTRL
]
->
kernel_va
;
addr
=
addr
&
WBM_ADD_MASK
;
out
=
be32_to_cpu
(
ioread32
(
reg_win
+
(
addr
)));
window_offset
=
addr
&
WINDOW_HIGH
;
if
(
window_offset
!=
dev
->
window_offset
)
{
iowrite32
(
cpu_to_be32
(
window_offset
),
ctrl_win
+
WINDOW_OFFSET_LOW
);
dev
->
window_offset
=
window_offset
;
}
out
=
be32_to_cpu
(
ioread32
(
reg_win
+
(
addr
&
WINDOW_LOW
)));
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
VME_WB
": READ (
%x) =
%x
\n
"
,
(
addr
),
out
);
printk
(
KERN_ALERT
VME_WB
": READ (
0x%x) = 0x
%x
\n
"
,
(
addr
),
out
);
mb
();
return
out
;
...
...
@@ -415,6 +432,7 @@ static int vme_probe(struct device *pdev, unsigned int ndev)
mutex_init
(
&
dev
->
mutex
);
dev
->
wb
.
wops
=
&
wb_ops
;
dev
->
wb
.
parent
=
pdev
;
dev
->
window_offset
=
0
;
/* Map CR/CSR space */
error
=
vme_map_window
(
dev
,
MAP_CR_CSR
);
...
...
vme-wb/vme_wb.h
View file @
8fa20372
...
...
@@ -43,9 +43,15 @@
#define MASTER_ADD 32
#define MASTER_DATA 40
#define EMUL_DAT_WD 48
#define WINDOW_OFFSET_LOW 56
#define WINDOW_OFFSET_HIGH 64
#define WBM_ADD_MASK 0xFFFFFFFC
#define WINDOW_HIGH 0xFFFF0000UL
#define WINDOW_LOW 0x0000FFFCUL
enum
vme_map_win
{
MAP_CR_CSR
=
0
,
/* CR/CSR */
MAP_REG
,
/* A32 wb space */
...
...
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