Commit 8e6143ad authored by Dimitris Lampridis's avatar Dimitris Lampridis

[hdl][sw] update and unify WRTD Node identification value

parent 68990667
......@@ -206,6 +206,9 @@ architecture arch of wrtd_ref_spec150t_adc is
-- Constants
-----------------------------------------------------------------------------
-- WRTD Node identification (WTN1)
constant c_WRTD_NODE_ID : std_logic_vector(31 downto 0) := x"5754_4E01";
-- Number of masters attached to the primary wishbone crossbar
constant c_NUM_WB_MASTERS : integer := 1;
......@@ -238,7 +241,7 @@ architecture arch of wrtd_ref_spec150t_adc is
constant c_MT_CONFIG : t_mt_config :=
(
app_id => x"115790d1",
app_id => c_WRTD_NODE_ID,
cpu_count => 1,
cpu_config => (
0 => (
......@@ -350,7 +353,7 @@ begin -- architecture arch
cmp_xwb_metadata : entity work.xwb_metadata
generic map (
g_VENDOR_ID => x"0000_10DC",
g_DEVICE_ID => x"574E_0001", -- WRTD Node (WN) 1
g_DEVICE_ID => c_WRTD_NODE_ID,
g_VERSION => x"0100_0000",
g_CAPABILITIES => x"0000_0000",
g_COMMIT_ID => (others => '0'))
......
......@@ -293,6 +293,9 @@ architecture arch of wrtd_ref_svec_tdc_fd is
-- Constants
-----------------------------------------------------------------------------
-- WRTD Node identification (WTN2)
constant c_WRTD_NODE_ID : std_logic_vector(31 downto 0) := x"5754_4E02";
-- Number of masters attached to the primary wishbone crossbar
constant c_NUM_WB_MASTERS : integer := 1;
......@@ -333,7 +336,7 @@ architecture arch of wrtd_ref_svec_tdc_fd is
constant c_MT_CONFIG : t_mt_config :=
(
app_id => x"115790de",
app_id => c_WRTD_NODE_ID,
cpu_count => 2,
cpu_config => (
0 | 1 => (
......@@ -484,7 +487,7 @@ begin -- architecture arch
cmp_xwb_metadata : entity work.xwb_metadata
generic map (
g_VENDOR_ID => x"0000_10DC",
g_DEVICE_ID => x"574E_0002", -- WRTD Node (WN) 2
g_DEVICE_ID => c_WRTD_NODE_ID,
g_VERSION => x"0100_0000",
g_CAPABILITIES => x"0000_0000",
g_COMMIT_ID => (others => '0'))
......
......@@ -126,10 +126,10 @@ static const struct platform_device_id wrtd_s150a_id_table[] = {
.name = "wrtd-s150a",
.driver_data = WRTD_S150A_VER,
}, {
.name = "id:000010DC574E0001",
.name = "id:000010DC57544E01",
.driver_data = WRTD_S150A_VER,
}, {
.name = "id:000010dc574e0001",
.name = "id:000010dc57544e01",
.driver_data = WRTD_S150A_VER,
},
{},
......
......@@ -188,10 +188,10 @@ static const struct platform_device_id wrtd_stf_id_table[] = {
.name = "wrtd-stf",
.driver_data = WRTD_STF_VER,
}, {
.name = "id:000010DC574E0002",
.name = "id:000010DC57544E02",
.driver_data = WRTD_STF_VER,
}, {
.name = "id:000010dc574e0002",
.name = "id:000010dc57544e02",
.driver_data = WRTD_STF_VER,
},
{},
......
......@@ -15,6 +15,18 @@
#define WRTD_DEFAULT_TIMEOUT 1000
/* Used to detect WRTD Nodes */
#define WRTD_NODE_ID 0x57544E00
#define WRTD_NODE_ID_MASK 0xFFFFFF00
inline int wrtd_node_id_match(uint32_t id)
{
if ((id & WRTD_NODE_ID_MASK) == WRTD_NODE_ID)
return 1;
else
return 0;
}
/* Add nanoseconds to an existing wrtd timestamp */
static inline void wrtd_ts_add_ns(struct wrtd_tstamp *ts, uint32_t ns)
{
......
......@@ -46,8 +46,7 @@ wrtd_status wrtd_get_node_count(uint32_t *count)
return WRTD_ERROR_RESOURCE_UNKNOWN;
}
cfgrom = trtl_config_get(trtl);
/* WRTD = 0x57525444 */
if (cfgrom->app_id == 0x57525444)
if (wrtd_node_id_match(cfgrom->app_id))
dev_count++;
trtl_close(trtl);
}
......@@ -81,7 +80,6 @@ wrtd_status wrtd_get_node_id(uint32_t index, uint32_t *node_id)
if (!dev_list)
return WRTD_ERROR_INTERNAL;
*node_id = 0;
for (i = 0; dev_list[i]; i++) {
......@@ -91,8 +89,7 @@ wrtd_status wrtd_get_node_id(uint32_t index, uint32_t *node_id)
return WRTD_ERROR_RESOURCE_UNKNOWN;
}
cfgrom = trtl_config_get(trtl);
/* WRTD = 0x57525444 */
if (cfgrom->app_id == 0x57525444)
if (wrtd_node_id_match(cfgrom->app_id))
dev_count++;
if (dev_count == index) {
char *eptr;
......
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