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
2b60408c
Commit
2b60408c
authored
Jun 25, 2014
by
Tomasz Wlostowski
Committed by
Federico Vaga
Aug 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: add WR calibration offset
parent
212bf81c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
calibration.c
kernel/calibration.c
+9
-7
fmc-tdc.h
kernel/fmc-tdc.h
+6
-1
No files found.
kernel/calibration.c
View file @
2b60408c
...
...
@@ -42,16 +42,15 @@ static int ft_read_calibration_eeprom(struct fmc_device *fmc, void *buf,
if
(
ret
==
0
)
break
;
}
if
(
ret
)
return
ret
;
/* Open "cali" as a device id, vendor is "FileData" -- big endian */
ret
=
sdbfs_open_
id
(
&
fs
,
0x61746144656c6946LL
,
0x696c6163
);
ret
=
sdbfs_open_
name
(
&
fs
,
"calib"
);
if
(
ret
)
return
ret
;
ret
=
sdbfs_fread
(
&
fs
,
0
,
buf
,
length
);
sdbfs_dev_destroy
(
&
fs
);
return
ret
;
}
...
...
@@ -62,7 +61,7 @@ int ft_handle_eeprom_calibration(struct fmctdc_dev *ft)
struct
ft_calibration
*
calib
;
struct
device
*
d
=
&
ft
->
fmc
->
dev
;
int
i
;
u32
raw_calib
[
5
];
u32
raw_calib
[
7
];
/* Retrieve and validate the calibration */
calib
=
&
ft
->
calib
;
...
...
@@ -85,11 +84,14 @@ int ft_handle_eeprom_calibration(struct fmctdc_dev *ft)
calib
->
vcxo_default_tune
=
le32_to_cpu
(
raw_calib
[
4
]);
}
calib
->
calibration_temp
=
le32_to_cpu
(
raw_calib
[
5
]);
calib
->
wr_offset
=
le32_to_cpu
(
raw_calib
[
6
])
/
100
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
calib
->
zero_offset
);
i
++
)
dev_info
(
d
,
"calib: zero_offset[%i] = %
li
\n
"
,
i
,
(
long
)
calib
->
zero_offset
[
i
]);
dev_info
(
d
,
"calib: zero_offset[%i] = %
i ps
\n
"
,
i
,
calib
->
zero_offset
[
i
]);
dev_info
(
d
,
"calib: vcxo_default_tune %i
\n
"
,
calib
->
vcxo_default_tune
);
dev_info
(
d
,
"calib: wr offset = %i ps
\n
"
,
calib
->
wr_offset
);
return
0
;
}
kernel/fmc-tdc.h
View file @
2b60408c
...
...
@@ -91,6 +91,12 @@ struct ft_calibration { /* All of these are big endian in the EEPROM */
/* Default DAC value for VCXO. Set during init and for local timing */
uint32_t
vcxo_default_tune
;
/* Temperature at which the device has been calibrated */
uint32_t
calibration_temp
;
/* White Rabbit timescale offset in ps */
int32_t
wr_offset
;
};
/* Hardware TDC timestamp */
...
...
@@ -226,7 +232,6 @@ struct zio_channel;
int
ft_read_sw_fifo
(
struct
fmctdc_dev
*
ft
,
int
channel
,
struct
zio_channel
*
chan
);
int
ft_enable_termination
(
struct
fmctdc_dev
*
ft
,
int
channel
,
int
enable
);
signed
long
fmc_find_sdb_device_ext
(
struct
sdb_array
*
tree
,
uint64_t
vid
,
uint32_t
did
,
int
index
,
unsigned
long
*
sz
);
...
...
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