Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - 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 DEL 1ns 4cha - Software
Commits
705c9c41
Commit
705c9c41
authored
Jul 17, 2012
by
Luis Fernando Ruiz
Committed by
Alessandro Rubini
Sep 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temperature attribute exported to sysfs.
New temperature attribute added for reading in fd_zio_info_get().
parent
f08b523a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
fine-delay.in
doc/fine-delay.in
+16
-5
fd-zio.c
fd-zio.c
+11
-3
fine-delay.h
fine-delay.h
+1
-1
No files found.
doc/fine-delay.in
View file @
705c9c41
...
@@ -660,10 +660,10 @@ directory is @i{/sys/bus/zio/devices/fd-0200}:
...
@@ -660,10 +660,10 @@ directory is @i{/sys/bus/zio/devices/fd-0200}:
@
smallexample
@
smallexample
spusa
#
ls
-
Ff
/
sys
/
bus
/
zio
/
devices
/
fd
-
0200
/
spusa
#
ls
-
Ff
/
sys
/
bus
/
zio
/
devices
/
fd
-
0200
/
./
enable
utc
-
l
power
/
fd
-
ch2
/
./
enable
utc
-
l
subsystem
fd
-
ch1
/
../
resolution
-
bits
coarse
driver
fd
-
ch3
/
../
resolution
-
bits
coarse
power
/
fd
-
ch2
/
uevent
version
command
fd
-
input
/
fd
-
ch4
/
uevent
version
command
driver
fd
-
ch3
/
name
utc
-
h
subsystem
fd
-
ch1
/
name
utc
-
h
temperature
fd
-
input
/
fd
-
ch4
/
@
end
smallexample
@
end
smallexample
@
c
==========================================================================
@
c
==========================================================================
...
@@ -671,7 +671,8 @@ directory is @i{/sys/bus/zio/devices/fd-0200}:
...
@@ -671,7 +671,8 @@ directory is @i{/sys/bus/zio/devices/fd-0200}:
@
section
Device
Attributes
@
section
Device
Attributes
Device
-
wide
attributes
are
the
three
time
tags
(@
i
{
utc
-
h
},
@
i
{
utc
-
l
},
Device
-
wide
attributes
are
the
three
time
tags
(@
i
{
utc
-
h
},
@
i
{
utc
-
l
},
@
i
{
coarse
}),
a
read
-
only
@
i
{
version
}
and
a
write
-
only
@
i
{
command
}.
@
i
{
coarse
}),
a
read
-
only
@
i
{
version
},
a
read
-
only
@
i
{
temperature
}
and
a
write
-
only
@
i
{
command
}.
To
read
device
time
you
To
read
device
time
you
should
read
@
i
{
utc
-
h
}
first
.
Reading
@
u
{
utc
-
h
}
will
atomically
read
should
read
@
i
{
utc
-
h
}
first
.
Reading
@
u
{
utc
-
h
}
will
atomically
read
all
values
from
the
card
and
store
them
in
the
software
driver
:
when
all
values
from
the
card
and
store
them
in
the
software
driver
:
when
...
@@ -697,6 +698,16 @@ last: writing @i{utc-h} atomically programs the hardware:
...
@@ -697,6 +698,16 @@ last: writing @i{utc-h} atomically programs the hardware:
10003
10003
@end smallexample
@end smallexample
The temperature value is scaled by four bits, so you need divide it by
16 to obtain the value in degrees. In this example:
@smallexample
spusa# cat temperature
1129
@end smallexample
Temperature is 70.5625 degrees.
If you write 0 to @i{command}, board time will be
If you write 0 to @i{command}, board time will be
synchronized to the current Linux clock within one microsecond
synchronized to the current Linux clock within one microsecond
(reading Linux time and writing to the @i{fine-delay} registers is
(reading Linux time and writing to the @i{fine-delay} registers is
...
...
fd-zio.c
View file @
705c9c41
...
@@ -44,6 +44,7 @@ static struct zio_attribute fd_zattr_dev[] = {
...
@@ -44,6 +44,7 @@ static struct zio_attribute fd_zattr_dev[] = {
ZATTR_EXT_REG
(
"utc-l"
,
_RW_
,
FD_ATTR_DEV_UTC_L
,
0
),
ZATTR_EXT_REG
(
"utc-l"
,
_RW_
,
FD_ATTR_DEV_UTC_L
,
0
),
ZATTR_EXT_REG
(
"coarse"
,
_RW_
,
FD_ATTR_DEV_COARSE
,
0
),
ZATTR_EXT_REG
(
"coarse"
,
_RW_
,
FD_ATTR_DEV_COARSE
,
0
),
ZATTR_EXT_REG
(
"command"
,
S_IWUGO
,
FD_ATTR_DEV_COMMAND
,
0
),
ZATTR_EXT_REG
(
"command"
,
S_IWUGO
,
FD_ATTR_DEV_COMMAND
,
0
),
ZATTR_EXT_REG
(
"temperature"
,
_RW_
,
FD_ATTR_DEV_TEMP
,
0
),
};
};
/* Extended attributes for the TDC (== input) cset */
/* Extended attributes for the TDC (== input) cset */
...
@@ -191,13 +192,20 @@ static int fd_zio_info_get(struct device *dev, struct zio_attribute *zattr,
...
@@ -191,13 +192,20 @@ static int fd_zio_info_get(struct device *dev, struct zio_attribute *zattr,
if
(
__fd_get_type
(
dev
)
==
FD_TYPE_OUTPUT
)
if
(
__fd_get_type
(
dev
)
==
FD_TYPE_OUTPUT
)
return
fd_zio_info_output
(
dev
,
zattr
,
usr_val
);
return
fd_zio_info_output
(
dev
,
zattr
,
usr_val
);
/* reading temperature */
zdev
=
to_zio_dev
(
dev
);
attr
=
zdev
->
zattr_set
.
ext_zattr
;
fd
=
zdev
->
private_data
;
if
(
zattr
->
priv
.
addr
==
FD_ATTR_DEV_TEMP
)
{
attr
[
FD_ATTR_DEV_TEMP
].
value
=
fd_read_temp
(
fd
,
0
);
return
0
;
}
/* following is whole-dev */
/* following is whole-dev */
if
(
zattr
->
priv
.
addr
!=
FD_ATTR_DEV_UTC_H
)
if
(
zattr
->
priv
.
addr
!=
FD_ATTR_DEV_UTC_H
)
return
0
;
return
0
;
/* reading utc-h calls an atomic get-time */
/* reading utc-h calls an atomic get-time */
zdev
=
to_zio_dev
(
dev
);
attr
=
zdev
->
zattr_set
.
ext_zattr
;
fd
=
zdev
->
private_data
;
fd_time_get
(
fd
,
&
t
,
NULL
);
fd_time_get
(
fd
,
&
t
,
NULL
);
attr
[
FD_ATTR_DEV_UTC_H
].
value
=
t
.
utc
>>
32
;
attr
[
FD_ATTR_DEV_UTC_H
].
value
=
t
.
utc
>>
32
;
attr
[
FD_ATTR_DEV_UTC_L
].
value
=
t
.
utc
&
0xffffffff
;
attr
[
FD_ATTR_DEV_UTC_L
].
value
=
t
.
utc
&
0xffffffff
;
...
...
fine-delay.h
View file @
705c9c41
...
@@ -23,7 +23,7 @@ enum fd_zattr_dev_idx {
...
@@ -23,7 +23,7 @@ enum fd_zattr_dev_idx {
FD_ATTR_DEV_UTC_L
,
FD_ATTR_DEV_UTC_L
,
FD_ATTR_DEV_COARSE
,
FD_ATTR_DEV_COARSE
,
FD_ATTR_DEV_COMMAND
,
/* see below for commands */
FD_ATTR_DEV_COMMAND
,
/* see below for commands */
FD_ATTR_DEV_
RESERVE_5
,
FD_ATTR_DEV_
TEMP
,
FD_ATTR_DEV_RESERVE_6
,
FD_ATTR_DEV_RESERVE_6
,
FD_ATTR_DEV_RESERVE_7
,
FD_ATTR_DEV_RESERVE_7
,
FD_ATTR_DEV__LAST
,
FD_ATTR_DEV__LAST
,
...
...
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