Commit 9d98a661 authored by Tristan Gingold's avatar Tristan Gingold

wrtd: minor cleanup.

parent d11fcb12
......@@ -17,8 +17,6 @@
#include "wrtd-fd.h"
#define OUT_TIMEOUT 10
#define NBR_CPUS 2
#define CPU_IDX 0
......@@ -41,11 +39,6 @@ struct wrtd_fd_dev fd0 = {
.io_addr = 0x0
};
static int wr_present(void)
{
return fd_wr_present(&fd0);
}
static int wr_link_up(void)
{
return fd_wr_link_up(&fd0);
......@@ -111,7 +104,7 @@ static int wrtd_o_sim_init(void)
*/
static int wrtd_user_init(void)
{
if (!wr_present()) {
if (!fd_wr_present(&fd0)) {
pr_error("WhiteRabbit not found\n\r");
return -EINVAL;
}
......
......@@ -14,12 +14,6 @@
#include "hw/fmctdc-direct.h"
#include "hw/tdc_regs.h"
#ifdef SIMULATION
static const int is_simulation = 1;
#else
static const int is_simulation = 0;
#endif
#define NBR_CPUS 2
#define CPU_IDX 0
......@@ -77,9 +71,9 @@ static void wrtd_local_output(struct wrtd_event *ev, unsigned ch)
return;
}
#ifdef SIMULATION
static int wrtd_i_sim_init(struct wrtd_tdc_dev *tdc)
{
#if 0
/* TODO: preconfigure the rules. */
int i;
......@@ -91,25 +85,25 @@ static int wrtd_i_sim_init(struct wrtd_tdc_dev *tdc)
wrtd_in_channels[i].config.flags =
WRTD_ENABLED | WRTD_ARMED | WRTD_TRIGGER_ASSIGNED;
}
#endif
tdc_writel(tdc, 0x40, BASE_DP_TDC_DIRECT + DR_REG_DEAD_TIME);
tdc_writel(tdc, 0x1f, BASE_DP_TDC_DIRECT + DR_REG_CHAN_ENABLE);
return 0;
}
#endif
static int wrtd_user_init(void)
{
if (!is_simulation)
tdc_init(&tdc0);
tdc_wr_enable_lock(&tdc0, 0);
#ifdef SIMULATION
/* Skip WR sync and automatically generate some events when
simulating */
if (is_simulation)
wrtd_i_sim_init(&tdc0);
wrtd_i_sim_init(&tdc0);
#else
tdc_init(&tdc0);
#endif
wr_enable_lock(0);
pr_debug("rt-input firmware initialized.\n\r");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment