Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - Software
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
FMC TDC 1ns 5cha - Software
Commits
3fbdc4ef
Commit
3fbdc4ef
authored
May 17, 2014
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
cd0ea761
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
calibration.c
kernel/calibration.c
+5
-2
fmc-tdc.h
kernel/fmc-tdc.h
+2
-0
ft-irq.c
kernel/ft-irq.c
+7
-3
No files found.
kernel/calibration.c
View file @
3fbdc4ef
...
...
@@ -38,9 +38,12 @@ static int ft_read_calibration_eeprom(struct fmc_device *fmc, void *buf,
/* Look for sdb entry point */
for
(
i
=
0x40
;
i
<
fmc
->
eeprom_len
-
0x40
;
i
+=
0x40
)
{
fs
.
entrypoint
=
i
;
printk
(
"trying %x
\n
"
,
i
);
ret
=
sdbfs_dev_create
(
&
fs
,
0
);
if
(
ret
==
0
)
break
;
if
(
ret
==
0
)
{
printk
(
"found sdb @ %x
\n
"
,
i
);
break
;
}
}
if
(
ret
)
...
...
kernel/fmc-tdc.h
View file @
3fbdc4ef
...
...
@@ -108,6 +108,7 @@ struct ft_wr_timestamp {
uint32_t
frac
;
int
seq_id
;
int
channel
;
struct
ft_hw_timestamp
raw
;
};
struct
ft_sw_fifo
{
...
...
@@ -123,6 +124,7 @@ struct ft_channel_state {
int32_t
user_offset
;
struct
ft_wr_timestamp
prev_ts
;
struct
ft_hw_timestamp
prev_hwts
;
struct
ft_sw_fifo
fifo
;
};
...
...
kernel/ft-irq.c
View file @
3fbdc4ef
...
...
@@ -97,7 +97,7 @@ int ft_read_sw_fifo(struct fmctdc_dev *ft, int channel,
v
[
FT_ATTR_TDC_SECONDS
]
=
ts
.
seconds
;
v
[
FT_ATTR_TDC_COARSE
]
=
ts
.
coarse
;
v
[
FT_ATTR_TDC_FRAC
]
=
ts
.
frac
;
v
[
FT_ATTR_TDC_SEQ
]
=
ts
.
seq_id
;
v
[
FT_ATTR_TDC_SEQ
]
=
ts
.
raw
.
metadata
;
v
[
FT_ATTR_TDC_OFFSET
]
=
ft
->
calib
.
zero_offset
[
channel
-
1
];
v
[
FT_ATTR_TDC_USER_OFFSET
]
=
st
->
user_offset
;
...
...
@@ -130,6 +130,8 @@ static inline void process_timestamp(struct fmctdc_dev *ft,
struct
ft_wr_timestamp
ts
;
int
channel
,
edge
,
frac
;
printk
(
"raw: %x %x %x %x
\n
"
,
hwts
->
metadata
,
hwts
->
utc
,
hwts
->
coarse
,
hwts
->
bins
);
channel
=
(
hwts
->
metadata
&
0x7
)
+
1
;
edge
=
hwts
->
metadata
&
(
1
<<
4
)
?
1
:
0
;
...
...
@@ -187,13 +189,15 @@ static inline void process_timestamp(struct fmctdc_dev *ft,
ts
.
seq_id
++
;
st
->
cur_seq_id
++
;
}
ts
.
raw
=
st
->
prev_hwts
;
/* Put the timestamp in the FIFO */
enqueue_timestamp
(
ft
,
channel
,
&
ts
);
}
}
else
}
else
{
st
->
prev_ts
=
ts
;
st
->
prev_hwts
=
*
hwts
;
}
st
->
expected_edge
=
1
-
st
->
expected_edge
;
}
}
...
...
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