2020-11-27 07:40:40

by Pankaj Sharma

[permalink] [raw]
Subject: [PATCH] can: m_can: add support for bosch mcan version 3.3.0

Add support for mcan bit timing and control mode according to bosch mcan IP
version 3.3.0
The mcan version read from the Core Release field of CREL register would be
33. Accordingly the properties are to be set for mcan v3.3.0

Signed-off-by: Pankaj Sharma <[email protected]>
---
Depends on:
https://marc.info/?l=linux-can&m=160624495218700&w=2

drivers/net/can/m_can/m_can.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 86bbbfa..7652175 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1385,6 +1385,8 @@ static int m_can_dev_setup(struct m_can_classdev *m_can_dev)
&m_can_data_bittiming_const_31X;
break;
case 32:
+ case 33:
+ /* Support both MCAN version v3.2.x and v3.3.0 */
m_can_dev->can.bittiming_const = m_can_dev->bit_timing ?
m_can_dev->bit_timing : &m_can_bittiming_const_31X;

--
2.7.4


2020-11-27 08:12:18

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH] can: m_can: add support for bosch mcan version 3.3.0

On 11/26/20 5:51 AM, Pankaj Sharma wrote:
> Add support for mcan bit timing and control mode according to bosch mcan IP
> version 3.3.0
> The mcan version read from the Core Release field of CREL register would be
> 33. Accordingly the properties are to be set for mcan v3.3.0
>
> Signed-off-by: Pankaj Sharma <[email protected]>

Applied to linux-can/testing

tnx,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


Attachments:
signature.asc (499.00 B)
OpenPGP digital signature

2020-11-27 08:12:44

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH] can: m_can: add support for bosch mcan version 3.3.0

On 11/26/20 5:51 AM, Pankaj Sharma wrote:
> Add support for mcan bit timing and control mode according to bosch mcan IP
> version 3.3.0
> The mcan version read from the Core Release field of CREL register would be
> 33. Accordingly the properties are to be set for mcan v3.3.0

BTW: do you have the v3.2 and v3.1 datasheets?

Marc

> Signed-off-by: Pankaj Sharma <[email protected]>
> ---
> Depends on:
> https://marc.info/?l=linux-can&m=160624495218700&w=2
>
> drivers/net/can/m_can/m_can.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 86bbbfa..7652175 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -1385,6 +1385,8 @@ static int m_can_dev_setup(struct m_can_classdev *m_can_dev)
> &m_can_data_bittiming_const_31X;
> break;
> case 32:
> + case 33:
> + /* Support both MCAN version v3.2.x and v3.3.0 */
> m_can_dev->can.bittiming_const = m_can_dev->bit_timing ?
> m_can_dev->bit_timing : &m_can_bittiming_const_31X;
>
>


--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


Attachments:
signature.asc (499.00 B)
OpenPGP digital signature