* pull-request: can 2016-09-21 @ 2016-09-21 8:43 Marc Kleine-Budde 2016-09-21 8:43 ` [PATCH] net: can: ifi: Configure transmitter delay Marc Kleine-Budde 2016-09-22 6:48 ` pull-request: can 2016-09-21 David Miller 0 siblings, 2 replies; 3+ messages in thread From: Marc Kleine-Budde @ 2016-09-21 8:43 UTC (permalink / raw) To: netdev; +Cc: davem, linux-can, kernel Hello David, this is another pull request of one patch for the upcoming linux-4.8 release. Marek Vasut fixes the CAN-FD bit rate switch in the ifi driver by configuring the transmitter delay. regards, Marc --- The following changes since commit b5036cd4ed3173ab8cdbc85e2ba74acf46bafb51: ipmr, ip6mr: return lastuse relative to now (2016-09-21 00:58:23 -0400) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.8-20160921 for you to fetch changes up to 8d58790b832e13d6006d842037732304af357c3c: net: can: ifi: Configure transmitter delay (2016-09-21 10:32:24 +0200) ---------------------------------------------------------------- linux-can-fixes-for-4.8-20160921 ---------------------------------------------------------------- Marek Vasut (1): net: can: ifi: Configure transmitter delay drivers/net/can/ifi_canfd/ifi_canfd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] net: can: ifi: Configure transmitter delay 2016-09-21 8:43 pull-request: can 2016-09-21 Marc Kleine-Budde @ 2016-09-21 8:43 ` Marc Kleine-Budde 2016-09-22 6:48 ` pull-request: can 2016-09-21 David Miller 1 sibling, 0 replies; 3+ messages in thread From: Marc Kleine-Budde @ 2016-09-21 8:43 UTC (permalink / raw) To: netdev Cc: davem, linux-can, kernel, Marek Vasut, Marc Kleine-Budde, Mark Rutland, Oliver Hartkopp, Wolfgang Grandegger, linux-stable From: Marek Vasut <marex@denx.de> Configure the transmitter delay register at +0x1c to correctly handle the CAN FD bitrate switch (BRS). This moves the SSP (secondary sample point) to a proper offset, so that the TDC mechanism works and won't generate error frames on the CAN link. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Oliver Hartkopp <socketcan@hartkopp.net> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> --- drivers/net/can/ifi_canfd/ifi_canfd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c index 2d1d22eec750..368bb0710d8f 100644 --- a/drivers/net/can/ifi_canfd/ifi_canfd.c +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c @@ -81,6 +81,10 @@ #define IFI_CANFD_TIME_SET_TIMEA_4_12_6_6 BIT(15) #define IFI_CANFD_TDELAY 0x1c +#define IFI_CANFD_TDELAY_DEFAULT 0xb +#define IFI_CANFD_TDELAY_MASK 0x3fff +#define IFI_CANFD_TDELAY_ABS BIT(14) +#define IFI_CANFD_TDELAY_EN BIT(15) #define IFI_CANFD_ERROR 0x20 #define IFI_CANFD_ERROR_TX_OFFSET 0 @@ -641,7 +645,7 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev) struct ifi_canfd_priv *priv = netdev_priv(ndev); const struct can_bittiming *bt = &priv->can.bittiming; const struct can_bittiming *dbt = &priv->can.data_bittiming; - u16 brp, sjw, tseg1, tseg2; + u16 brp, sjw, tseg1, tseg2, tdc; /* Configure bit timing */ brp = bt->brp - 2; @@ -664,6 +668,11 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev) (brp << IFI_CANFD_TIME_PRESCALE_OFF) | (sjw << IFI_CANFD_TIME_SJW_OFF_7_9_8_8), priv->base + IFI_CANFD_FTIME); + + /* Configure transmitter delay */ + tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK; + writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc, + priv->base + IFI_CANFD_TDELAY); } static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id, -- 2.9.3 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: pull-request: can 2016-09-21 2016-09-21 8:43 pull-request: can 2016-09-21 Marc Kleine-Budde 2016-09-21 8:43 ` [PATCH] net: can: ifi: Configure transmitter delay Marc Kleine-Budde @ 2016-09-22 6:48 ` David Miller 1 sibling, 0 replies; 3+ messages in thread From: David Miller @ 2016-09-22 6:48 UTC (permalink / raw) To: mkl; +Cc: netdev, linux-can, kernel From: Marc Kleine-Budde <mkl@pengutronix.de> Date: Wed, 21 Sep 2016 10:43:54 +0200 > this is another pull request of one patch for the upcoming linux-4.8 release. > > Marek Vasut fixes the CAN-FD bit rate switch in the ifi driver by configuring > the transmitter delay. Pulled, thanks. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-22 6:48 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-09-21 8:43 pull-request: can 2016-09-21 Marc Kleine-Budde 2016-09-21 8:43 ` [PATCH] net: can: ifi: Configure transmitter delay Marc Kleine-Budde 2016-09-22 6:48 ` pull-request: can 2016-09-21 David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).