Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mock-turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
27e6198c
Commit
27e6198c
authored
Jul 25, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:fw:ep style improvement
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
c6aa871a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
70 deletions
+72
-70
mockturtle-rt-common.c
software/firmware/lib/mockturtle-rt-common.c
+59
-61
mockturtle-rt.h
software/firmware/lib/mockturtle-rt.h
+13
-9
No files found.
software/firmware/lib/mockturtle-rt-common.c
View file @
27e6198c
...
...
@@ -72,17 +72,17 @@ void pr_message(struct trtl_fw_msg *msg)
pp_printf
(
"%s: data[%d] = 0x%"
PRIx32
"
\n\r
"
,
__func__
,
i
,
d
[
i
]);
}
static
inline
void
rmq_ep_out_writel
(
int
slot
,
uint32_t
data
,
uint32_t
addr
)
static
inline
void
rmq_ep_out_writel
(
int
slot
,
uint32_t
data
,
uint32_t
addr
)
{
mq_writel
(
TRTL_RMQ
,
data
,
addr
+
TRTL_MQ_SLOT_ENDPOINT_CONFIG_START
+
TRTL_MQ_SLOT_OUT
(
slot
)
);
}
static
inline
void
rmq_ep_in_writel
(
int
slot
,
uint32_t
data
,
uint32_t
addr
)
static
inline
void
rmq_ep_in_writel
(
int
slot
,
uint32_t
data
,
uint32_t
addr
)
{
mq_writel
(
TRTL_RMQ
,
data
,
addr
+
TRTL_MQ_SLOT_ENDPOINT_CONFIG_START
+
TRTL_MQ_SLOT_IN
(
slot
)
);
}
static
void
rmq_ep_bind_in
(
int
slot
,
struct
trtl_ep_address
*
addr
)
static
void
rmq_ep_bind_in
(
int
slot
,
struct
trtl_ep_eth_address
*
addr
)
{
uint32_t
cfg
=
0
;
...
...
@@ -136,8 +136,6 @@ static void rmq_ep_bind_out ( int slot, struct trtl_ep_address* addr )
rmq_ep_out_writel
(
slot
,
addr
->
dst_ip
,
TRTL_EP_OUT_DST_IP
);
rmq_ep_out_writel
(
slot
,
addr
->
src_port
,
TRTL_EP_OUT_SRC_PORT
);
rmq_ep_out_writel
(
slot
,
addr
->
dst_port
,
TRTL_EP_OUT_DST_PORT
);
}
void
mq_bind
(
enum
trtl_mq_type
type
,
int
slot
,
int
is_out
,
struct
trtl_ep_address
*
addr
)
...
...
software/firmware/lib/mockturtle-rt.h
View file @
27e6198c
...
...
@@ -11,6 +11,7 @@
#ifndef __MOCKTURTLE_RT_H
#define __MOCKTURTLE_RT_H
#include <errno.h>
#include <stdint.h>
#include <stdarg.h>
#include <generated/autoconf.h>
...
...
@@ -450,17 +451,18 @@ static inline void *mq_map_in_header(enum trtl_mq_type type, int slot)
* @copydoc TRTL_MQ_CMD_CLAIM
* @param[in] type MQ type to use
* @param[in] slot slot number
* @return
1 on success, 0
if queue busy/full
* @return
0 on success, -EBUSY
if queue busy/full
*/
static
inline
int
mq_claim
(
enum
trtl_mq_type
type
,
int
slot
)
{
uint32_t
status
=
mq_readl
(
type
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_STATUS
);
if
(
status
&
TRTL_MQ_SLOT_STATUS_FULL
)
return
0
;
return
-
EBUSY
;
mq_writel
(
type
,
TRTL_MQ_CMD_CLAIM
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
return
1
;
mq_writel
(
type
,
TRTL_MQ_CMD_CLAIM
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
return
0
;
}
/**
...
...
@@ -487,13 +489,15 @@ static inline void mq_send(enum trtl_mq_type type, int slot)
}
/**
* Binds an RMQ slot to a particular IP configuration. Used when the Ethernet/UDP endpoint is enabled.
* Binds an RMQ slot to a particular IP configuration. Used when the Ethernet/UDP
* endpoint is enabled.
* @param[in] type MQ type to use
* @param[in] slot slot number
* @param[in] is_out non-zero if we're configuring an output slot
* @param[in] addr bind address
*/
void
mq_bind
(
enum
trtl_mq_type
type
,
int
slot
,
int
is_out
,
struct
trtl_ep_address
*
addr
);
void
mq_bind
(
enum
trtl_mq_type
type
,
int
slot
,
int
is_out
,
struct
trtl_ep_address
*
addr
);
/**
...
...
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