[rtems commit] leon, grspw_router: added router_port_link_div()

Daniel Hellstrom danielh at rtems.org
Thu Mar 11 16:51:34 UTC 2021


Module:    rtems
Branch:    master
Commit:    8660602ae2960aa30b3a2882c660cde8b2b46a31
Changeset: http://git.rtems.org/rtems/commit/?id=8660602ae2960aa30b3a2882c660cde8b2b46a31

Author:    Martin Aberg <maberg at gaisler.com>
Date:      Fri Feb  8 16:30:15 2019 +0100

leon, grspw_router: added router_port_link_div()

Allows user to set SpaceWire run clock divisor for an individual port.

---

 bsps/include/grlib/grspw_router.h    | 1 +
 bsps/shared/grlib/spw/grspw_router.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/bsps/include/grlib/grspw_router.h b/bsps/include/grlib/grspw_router.h
index 2fab8d5..8547f19 100644
--- a/bsps/include/grlib/grspw_router.h
+++ b/bsps/include/grlib/grspw_router.h
@@ -343,6 +343,7 @@ extern int router_port_enable(void *d, int port);
 extern int router_port_disable(void *d, int port);
 extern int router_port_link_stop(void *d, int port);
 extern int router_port_link_start(void *d, int port);
+extern int router_port_link_div(void *d, int port, int rundiv);
 extern int router_port_link_receive_spill(void *d, int port);
 extern int router_port_link_transmit_reset(void *d, int port);
 
diff --git a/bsps/shared/grlib/spw/grspw_router.c b/bsps/shared/grlib/spw/grspw_router.c
index d8ba8fe..9a31c3b 100644
--- a/bsps/shared/grlib/spw/grspw_router.c
+++ b/bsps/shared/grlib/spw/grspw_router.c
@@ -1431,6 +1431,11 @@ int router_port_link_start(void *d, int port)
 	return router_port_ctrl_rmw(d, port, NULL, PCTRL_LD | PCTRL_LS, PCTRL_LS);
 }
 
+int router_port_link_div(void *d, int port, int rundiv)
+{
+	return router_port_ctrl_rmw(d, port, NULL, PCTRL_RD, (rundiv << PCTRL_RD_BIT) & PCTRL_RD);
+}
+
 int router_port_link_receive_spill(void *d, int port)
 {
 	struct router_priv *priv = d;



More information about the vc mailing list