Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
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
White Rabbit Trigger Distribution
Commits
03f503b9
Commit
03f503b9
authored
Oct 26, 2018
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrtd: more cleanup.
parent
9d98a661
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
29 deletions
+7
-29
wrtd-rt-common.h
software/firmware/common/wrtd-rt-common.h
+1
-0
wrtd-rt-fd.c
software/firmware/fd/wrtd-rt-fd.c
+0
-5
wrtd-rt-tdc.c
software/firmware/tdc/wrtd-rt-tdc.c
+1
-2
wrtd-tdc.c
software/firmware/tdc/wrtd-tdc.c
+5
-22
No files found.
software/firmware/common/wrtd-rt-common.h
View file @
03f503b9
...
...
@@ -22,6 +22,7 @@
/* By default use lxi-evntsvc. */
#define WRTD_UDP_PORT 5044
/* Functions defined by the user. */
static
void
wrtd_local_output
(
struct
wrtd_event
*
ev
,
unsigned
ch
);
static
void
wrtd_io
(
void
);
static
int
wrtd_user_init
(
void
);
...
...
software/firmware/fd/wrtd-rt-fd.c
View file @
03f503b9
...
...
@@ -6,14 +6,9 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <errno.h>
#include <string.h>
#include "mockturtle-rt.h"
#include <mockturtle-framework.h>
#include "wrtd-common.h"
#include "hw/fd_channel_regs.h"
#include "hw/fd_main_regs.h"
#include "wrtd-fd.h"
...
...
software/firmware/tdc/wrtd-rt-tdc.c
View file @
03f503b9
...
...
@@ -6,13 +6,11 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#include <string.h>
#include "mockturtle-rt.h"
#include <mockturtle-framework.h>
#include "wrtd-common.h"
#include "hw/fmctdc-direct.h"
#include "hw/tdc_regs.h"
#define NBR_CPUS 2
#define CPU_IDX 0
...
...
@@ -68,6 +66,7 @@ static inline int wr_sync_timeout(void)
static
void
wrtd_local_output
(
struct
wrtd_event
*
ev
,
unsigned
ch
)
{
/* No output. */
return
;
}
...
...
software/firmware/tdc/wrtd-tdc.c
View file @
03f503b9
...
...
@@ -14,8 +14,7 @@
#define BASE_DP_TDC_REGS 0x2000
#define BASE_DP_TDC_DIRECT 0x8000
#define FT_CH_1 1
#define FT_NUM_CHANNELS 5
#define TDC_NUM_CHANNELS 5
#define NB_ACAM_REGS 11
...
...
@@ -130,15 +129,12 @@ static int tdc_enable_termination(struct wrtd_tdc_dev *tdc,
{
uint32_t
ien
;
if
(
channel
<
FT_CH_1
||
channel
>
FT_NUM_CHANNELS
)
return
-
EINVAL
;
ien
=
tdc_readl
(
tdc
,
BASE_DP_TDC_REGS
+
TDC_REG_INPUT_ENABLE
);
if
(
enable
)
ien
|=
(
1
<<
(
channel
-
1
)
);
ien
|=
(
1
<<
channel
);
else
ien
&=
~
(
1
<<
(
channel
-
1
)
);
ien
&=
~
(
1
<<
channel
);
tdc_writel
(
tdc
,
ien
,
BASE_DP_TDC_REGS
+
TDC_REG_INPUT_ENABLE
);
...
...
@@ -149,7 +145,7 @@ static int tdc_channels_init(struct wrtd_tdc_dev *tdc)
{
int
i
;
for
(
i
=
FT_CH_1
;
i
<=
FT
_NUM_CHANNELS
;
i
++
)
{
for
(
i
=
0
;
i
<
TDC
_NUM_CHANNELS
;
i
++
)
{
/* termination is off by default */
tdc_enable_termination
(
tdc
,
i
,
0
);
}
...
...
@@ -177,15 +173,6 @@ static void tdc_enable_acquisition(struct wrtd_tdc_dev *tdc, int enable)
}
}
static
int
tdc_irq_init
(
struct
wrtd_tdc_dev
*
tdc
)
{
/* IRQ coalescing: 40 timestamps or 40 milliseconds */
tdc_writel
(
tdc
,
40
,
BASE_DP_TDC_REGS
+
TDC_REG_IRQ_THRESHOLD
);
tdc_writel
(
tdc
,
40
,
BASE_DP_TDC_REGS
+
TDC_REG_IRQ_TIMEOUT
);
return
0
;
}
/* FIXME missing all calibration */
static
int
tdc_init
(
struct
wrtd_tdc_dev
*
tdc
)
{
...
...
@@ -211,10 +198,6 @@ static int tdc_init(struct wrtd_tdc_dev *tdc)
if
(
err
)
return
err
;
err
=
tdc_irq_init
(
tdc
);
if
(
err
)
return
err
;
tdc_enable_acquisition
(
tdc
,
1
);
pr_debug
(
"%s: TDC initialization complete
\n\r
"
,
__func__
);
...
...
@@ -239,7 +222,7 @@ static inline int tdc_wr_time_ready(struct wrtd_tdc_dev *tdc)
static
inline
int
tdc_wr_sync_timeout
(
void
)
{
/* Wait
4 seconds until the tcd is ready
. */
/* Wait
3 seconds until the tcd is ready (+ 1 for truncation)
. */
return
4
;
}
...
...
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