Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spec-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
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
This is an archived project. Repository and other project resources are read-only.
fmc-projects
spec
spec-sw
Commits
a498451d
Commit
a498451d
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
kernel/wr-nic-dio.c: minor details
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
0af71323
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
kernel/wr-nic-dio.c
+12
-4
12 additions, 4 deletions
kernel/wr-nic-dio.c
with
12 additions
and
4 deletions
kernel/wr-nic-dio.c
+
12
−
4
View file @
a498451d
...
...
@@ -126,10 +126,9 @@ static int wrn_dio_cmd_pulse(struct wrn_drvdata *drvdata,
/* if not "now", set trig, trigh, cycles */
if
(
!
(
cmd
->
flags
&
WR_DIO_F_NOW
))
{
/* not now: set relevant registers */
p
ri
ntk
(
"%x %x %x
\n
"
,
map
->
trig_h
,
map
->
trig_l
,
map
->
cycle
);
w
ri
tel
(
ts
->
tv_nsec
/
8
,
base
+
map
->
cycle
);
writel
(
GET_HI32
(
ts
->
tv_sec
),
base
+
map
->
trig_h
);
writel
(
ts
->
tv_sec
,
base
+
map
->
trig_l
);
writel
(
ts
->
tv_nsec
/
8
,
base
+
map
->
cycle
);
}
/* set the width */
...
...
@@ -177,16 +176,25 @@ static int wrn_dio_cmd_stamp(struct wrn_drvdata *drvdata,
if
(
nstamp
==
WR_DIO_N_STAMP
)
break
;
reg
=
readl
(
base
+
map
->
fifo_status
);
printk
(
"ctrl %08x
\n
"
,
reg
);
if
(
reg
&
0x20000
)
/* empty */
break
;
/* fifo is not-empty, pick one sample */
ts
->
tv_nsec
=
8
*
readl
(
base
+
map
->
fifo_cycle
);
/* reading the low tai pops the fifo */
ts
->
tv_sec
=
0
;
SET_HI32
(
ts
->
tv_sec
,
readl
(
base
+
map
->
fifo_tai_h
));
/* reading the low tai pops the fifo */
ts
->
tv_sec
|=
readl
(
base
+
map
->
fifo_tai_l
);
/* At startup I get many zero values: discard them */
if
(
!
ts
->
tv_sec
)
continue
;
/* subtract 5 cycles lost in input sync circuits */
ts
->
tv_nsec
-=
40
;
if
(
ts
->
tv_nsec
<
0
)
{
ts
->
tv_nsec
+=
1000
*
1000
*
1000
;
ts
->
tv_sec
--
;
}
nstamp
++
;
ts
++
;
}
...
...
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