netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM
  2020-10-19 15:57 ` [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM Joakim Zhang
@ 2020-10-19  8:15   ` Marc Kleine-Budde
  2020-10-19  8:39     ` Joakim Zhang
  0 siblings, 1 reply; 14+ messages in thread
From: Marc Kleine-Budde @ 2020-10-19  8:15 UTC (permalink / raw)
  To: Joakim Zhang, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 9481 bytes --]

On 10/19/20 5:57 PM, Joakim Zhang wrote:
> The System Controller Firmware (SCFW) is a low-level system function
> which runs on a dedicated Cortex-M core to provide power, clock, and
> resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
> (QM, QP), and i.MX8QX (QXP, DX). SCU driver manages the IPC interface
> between host CPU and the SCU firmware running on M4.
> 
> For i.MX8QM, stop mode request is controlled by System Controller Unit(SCU)
> firmware, this patch introduces FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW quirk
> for this function.
> 
> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> ---
>  drivers/net/can/flexcan.c | 131 +++++++++++++++++++++++++++++++++-----
>  1 file changed, 114 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index c0cdee904ca7..8ad5065c918f 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -9,6 +9,7 @@
>  //
>  // Based on code originally by Andrey Volkov <avolkov@varma-el.com>
>  
> +#include <dt-bindings/firmware/imx/rsrc.h>
>  #include <linux/bitfield.h>
>  #include <linux/can.h>
>  #include <linux/can/dev.h>
> @@ -17,6 +18,7 @@
>  #include <linux/can/rx-offload.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
> +#include <linux/firmware/imx/sci.h>
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
>  #include <linux/mfd/syscon.h>
> @@ -203,6 +205,8 @@
>  
>  #define FLEXCAN_TIMEOUT_US		(250)
>  
> +#define FLEXCAN_IMX_SC_R_CAN(x)		(IMX_SC_R_CAN_0 + (x))

Why not move it into the appropriate svc header file?

> +
>  /* FLEXCAN hardware feature flags
>   *
>   * Below is some version info we got:
> @@ -242,6 +246,8 @@
>  #define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
>  /* support memory detection and correction */
>  #define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)
> +/* Setup stop mode with SCU firmware to support wakeup */
> +#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)
>  
>  /* Structure of the message buffer */
>  struct flexcan_mb {
> @@ -347,6 +353,7 @@ struct flexcan_priv {
>  	u8 mb_count;
>  	u8 mb_size;
>  	u8 clk_src;	/* clock source of CAN Protocol Engine */
> +	u8 can_idx;
>  
>  	u64 rx_mask;
>  	u64 tx_mask;
> @@ -358,6 +365,9 @@ struct flexcan_priv {
>  	struct regulator *reg_xceiver;
>  	struct flexcan_stop_mode stm;
>  
> +	/* IPC handle when setup stop mode by System Controller firmware(scfw) */
> +	struct imx_sc_ipc *sc_ipc_handle;
> +
>  	/* Read and Write APIs */
>  	u32 (*read)(void __iomem *addr);
>  	void (*write)(u32 val, void __iomem *addr);
> @@ -387,7 +397,7 @@ static const struct flexcan_devtype_data fsl_imx6q_devtype_data = {
>  static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = {
>  	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
>  		FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_BROKEN_PERR_STATE |
> -		FLEXCAN_QUIRK_SUPPORT_FD,
> +		FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW,
>  };
>  
>  static struct flexcan_devtype_data fsl_imx8mp_devtype_data = {
> @@ -546,18 +556,42 @@ static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable)
>  	priv->write(reg_mcr, &regs->mcr);
>  }
>  
> +static int flexcan_stop_mode_enable_scfw(struct flexcan_priv *priv, bool enabled)
> +{
> +	u8 idx = priv->can_idx;
> +	u32 rsrc_id, val;
> +
> +	rsrc_id = FLEXCAN_IMX_SC_R_CAN(idx);
> +
> +	if (enabled)
> +		val = 1;
> +	else
> +		val = 0;
> +
> +	/* stop mode request via scu firmware */
> +	return imx_sc_misc_set_control(priv->sc_ipc_handle, rsrc_id,
> +				       IMX_SC_C_IPG_STOP, val);
> +}
> +
>  static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
>  {
>  	struct flexcan_regs __iomem *regs = priv->regs;
>  	u32 reg_mcr;
> +	int ret;
>  
>  	reg_mcr = priv->read(&regs->mcr);
>  	reg_mcr |= FLEXCAN_MCR_SLF_WAK;
>  	priv->write(reg_mcr, &regs->mcr);
>  
>  	/* enable stop request */
> -	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> -			   1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
> +	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
> +		ret = flexcan_stop_mode_enable_scfw(priv, true);
> +		if (ret < 0)
> +			return ret;
> +	} else {
> +		regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> +				   1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
> +	}
>  
>  	return flexcan_low_power_enter_ack(priv);
>  }
> @@ -566,10 +600,17 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
>  {
>  	struct flexcan_regs __iomem *regs = priv->regs;
>  	u32 reg_mcr;
> +	int ret;
>  
>  	/* remove stop request */
> -	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> -			   1 << priv->stm.req_bit, 0);
> +	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
> +		ret = flexcan_stop_mode_enable_scfw(priv, false);
> +		if (ret < 0)
> +			return ret;
> +	} else {
> +		regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> +				   1 << priv->stm.req_bit, 0);
> +	}
>  
>  	reg_mcr = priv->read(&regs->mcr);
>  	reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
> @@ -1838,7 +1879,7 @@ static void unregister_flexcandev(struct net_device *dev)
>  	unregister_candev(dev);
>  }
>  
> -static int flexcan_setup_stop_mode(struct platform_device *pdev)
> +static int flexcan_setup_stop_mode_gpr(struct platform_device *pdev)
>  {
>  	struct net_device *dev = platform_get_drvdata(pdev);
>  	struct device_node *np = pdev->dev.of_node;
> @@ -1883,11 +1924,6 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
>  		"gpr %s req_gpr=0x02%x req_bit=%u\n",
>  		gpr_np->full_name, priv->stm.req_gpr, priv->stm.req_bit);
>  
> -	device_set_wakeup_capable(&pdev->dev, true);
> -
> -	if (of_property_read_bool(np, "wakeup-source"))
> -		device_set_wakeup_enable(&pdev->dev, true);
> -
>  	return 0;
>  
>  out_put_node:
> @@ -1895,6 +1931,64 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
>  	return ret;
>  }
>  
> +static int flexcan_setup_stop_mode_scfw(struct platform_device *pdev)
> +{
> +	struct net_device *dev = platform_get_drvdata(pdev);
> +	struct flexcan_priv *priv;
> +	u8 can_idx;
> +	int ret;
> +
> +	ret = of_property_read_u8(pdev->dev.of_node, "fsl,scu-index", &can_idx);
> +	if (ret < 0) {
> +		dev_dbg(&pdev->dev, "failed to get scu index\n");
> +		return ret;
> +	}
> +
> +	priv = netdev_priv(dev);
> +	priv->can_idx = can_idx;
> +
> +	/* this function could be defered probe, return -EPROBE_DEFER */
> +	ret = imx_scu_get_handle(&priv->sc_ipc_handle);
> +	if (ret < 0) {
> +		dev_dbg(&pdev->dev, "get ipc handle used by SCU failed\n");
> +		return ret;
> +	}

Don't print an error message on -EPROBE_DEFER.

> +
> +	return 0;
> +}
> +
> +/* flexcan_setup_stop_mode - Setup stop mode for wakeup
> + *
> + * Return: = 0 setup stop mode successfully or doesn't support this feature
> + *         < 0 fail to setup stop mode (could be defered probe)
> + */
> +static int flexcan_setup_stop_mode(struct platform_device *pdev)
> +{
> +	struct net_device *dev = platform_get_drvdata(pdev);
> +	struct flexcan_priv *priv;
> +	int ret;
> +
> +	priv = netdev_priv(dev);
> +
> +	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW)
> +		ret = flexcan_setup_stop_mode_scfw(pdev);
> +	else if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)
> +		ret = flexcan_setup_stop_mode_gpr(pdev);
> +	else
> +		/* return 0 directly if doesn't support stop mode feature */
> +		return 0;
> +
> +	if (ret)
> +		return ret;
> +
> +	device_set_wakeup_capable(&pdev->dev, true);
> +
> +	if (of_property_read_bool(pdev->dev.of_node, "wakeup-source"))
> +		device_set_wakeup_enable(&pdev->dev, true);
> +
> +	return 0;
> +}
> +
>  static const struct of_device_id flexcan_of_match[] = {
>  	{ .compatible = "fsl,imx8qm-flexcan", .data = &fsl_imx8qm_devtype_data, },
>  	{ .compatible = "fsl,imx8mp-flexcan", .data = &fsl_imx8mp_devtype_data, },
> @@ -2040,17 +2134,19 @@ static int flexcan_probe(struct platform_device *pdev)
>  		goto failed_register;
>  	}
>  
> +	err = flexcan_setup_stop_mode(pdev);
> +	if (err < 0) {
> +		dev_err(&pdev->dev, "setup stop mode failed\n");
> +		goto failed_canregister;
> +	}
> +
>  	of_can_transceiver(dev);
>  	devm_can_led_init(dev);
>  
> -	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) {
> -		err = flexcan_setup_stop_mode(pdev);
> -		if (err)
> -			dev_dbg(&pdev->dev, "failed to setup stop-mode\n");
> -	}
> -
>  	return 0;
>  
> + failed_canregister:
> +	unregister_flexcandev(dev);
>   failed_register:
>  	pm_runtime_put_noidle(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
> @@ -2062,6 +2158,7 @@ static int flexcan_remove(struct platform_device *pdev)
>  {
>  	struct net_device *dev = platform_get_drvdata(pdev);
>  
> +	device_set_wakeup_enable(&pdev->dev, false);

Please make this a seperate patch, as it fixes a bug.

>  	unregister_flexcandev(dev);
>  	pm_runtime_disable(&pdev->dev);
>  	free_candev(dev);
> 

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 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM
  2020-10-19  8:15   ` Marc Kleine-Budde
@ 2020-10-19  8:39     ` Joakim Zhang
  2020-10-19  8:41       ` Marc Kleine-Budde
  0 siblings, 1 reply; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19  8:39 UTC (permalink / raw)
  To: Marc Kleine-Budde, robh+dt, shawnguo, s.hauer
  Cc: kernel, dl-linux-imx, Ying Liu, linux-can, Pankaj Bansal, netdev,
	linux-kernel


Hi Marc,

> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: 2020年10月19日 16:16
> To: Joakim Zhang <qiangqing.zhang@nxp.com>; robh+dt@kernel.org;
> shawnguo@kernel.org; s.hauer@pengutronix.de
> Cc: kernel@pengutronix.de; dl-linux-imx <linux-imx@nxp.com>; Ying Liu
> <victor.liu@nxp.com>; linux-can@vger.kernel.org; Pankaj Bansal
> <pankaj.bansal@nxp.com>; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH V2 8/8] can: flexcan: add CAN wakeup function for
> i.MX8QM
> 
> On 10/19/20 5:57 PM, Joakim Zhang wrote:
> > The System Controller Firmware (SCFW) is a low-level system function
> > which runs on a dedicated Cortex-M core to provide power, clock, and
> > resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
> > (QM, QP), and i.MX8QX (QXP, DX). SCU driver manages the IPC interface
> > between host CPU and the SCU firmware running on M4.
> >
> > For i.MX8QM, stop mode request is controlled by System Controller
> > Unit(SCU) firmware, this patch introduces
> > FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW quirk for this function.
> >
> > Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> > ---
> >  drivers/net/can/flexcan.c | 131
> > +++++++++++++++++++++++++++++++++-----
> >  1 file changed, 114 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> > index c0cdee904ca7..8ad5065c918f 100644
> > --- a/drivers/net/can/flexcan.c
> > +++ b/drivers/net/can/flexcan.c
> > @@ -9,6 +9,7 @@
> >  //
> >  // Based on code originally by Andrey Volkov <avolkov@varma-el.com>
> >
> > +#include <dt-bindings/firmware/imx/rsrc.h>
> >  #include <linux/bitfield.h>
> >  #include <linux/can.h>
> >  #include <linux/can/dev.h>
> > @@ -17,6 +18,7 @@
> >  #include <linux/can/rx-offload.h>
> >  #include <linux/clk.h>
> >  #include <linux/delay.h>
> > +#include <linux/firmware/imx/sci.h>
> >  #include <linux/interrupt.h>
> >  #include <linux/io.h>
> >  #include <linux/mfd/syscon.h>
> > @@ -203,6 +205,8 @@
> >
> >  #define FLEXCAN_TIMEOUT_US		(250)
> >
> > +#define FLEXCAN_IMX_SC_R_CAN(x)		(IMX_SC_R_CAN_0 + (x))
> 
> Why not move it into the appropriate svc header file?

Sorry, not quite understand. Which file do you mean the appropriate svc header file? Is it include/dt-bindings/firmware/imx/rsrc.h?
After glancing the header file under include/linux/firmware/imx, have not found the appropriate svc header. Could you please explain more?


> > +
> >  /* FLEXCAN hardware feature flags
> >   *
> >   * Below is some version info we got:
> > @@ -242,6 +246,8 @@
> >  #define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
> >  /* support memory detection and correction */  #define
> > FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)
> > +/* Setup stop mode with SCU firmware to support wakeup */ #define
> > +FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)
> >
> >  /* Structure of the message buffer */  struct flexcan_mb { @@ -347,6
> > +353,7 @@ struct flexcan_priv {
> >  	u8 mb_count;
> >  	u8 mb_size;
> >  	u8 clk_src;	/* clock source of CAN Protocol Engine */
> > +	u8 can_idx;
> >
> >  	u64 rx_mask;
> >  	u64 tx_mask;
> > @@ -358,6 +365,9 @@ struct flexcan_priv {
> >  	struct regulator *reg_xceiver;
> >  	struct flexcan_stop_mode stm;
> >
> > +	/* IPC handle when setup stop mode by System Controller firmware(scfw)
> */
> > +	struct imx_sc_ipc *sc_ipc_handle;
> > +
> >  	/* Read and Write APIs */
> >  	u32 (*read)(void __iomem *addr);
> >  	void (*write)(u32 val, void __iomem *addr); @@ -387,7 +397,7 @@
> > static const struct flexcan_devtype_data fsl_imx6q_devtype_data = {
> > static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = {
> >  	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG |
> FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
> >  		FLEXCAN_QUIRK_USE_OFF_TIMESTAMP |
> FLEXCAN_QUIRK_BROKEN_PERR_STATE |
> > -		FLEXCAN_QUIRK_SUPPORT_FD,
> > +		FLEXCAN_QUIRK_SUPPORT_FD |
> FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW,
> >  };
> >
> >  static struct flexcan_devtype_data fsl_imx8mp_devtype_data = { @@
> > -546,18 +556,42 @@ static void flexcan_enable_wakeup_irq(struct
> flexcan_priv *priv, bool enable)
> >  	priv->write(reg_mcr, &regs->mcr);
> >  }
> >
> > +static int flexcan_stop_mode_enable_scfw(struct flexcan_priv *priv,
> > +bool enabled) {
> > +	u8 idx = priv->can_idx;
> > +	u32 rsrc_id, val;
> > +
> > +	rsrc_id = FLEXCAN_IMX_SC_R_CAN(idx);
> > +
> > +	if (enabled)
> > +		val = 1;
> > +	else
> > +		val = 0;
> > +
> > +	/* stop mode request via scu firmware */
> > +	return imx_sc_misc_set_control(priv->sc_ipc_handle, rsrc_id,
> > +				       IMX_SC_C_IPG_STOP, val);
> > +}
> > +
> >  static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
> > {
> >  	struct flexcan_regs __iomem *regs = priv->regs;
> >  	u32 reg_mcr;
> > +	int ret;
> >
> >  	reg_mcr = priv->read(&regs->mcr);
> >  	reg_mcr |= FLEXCAN_MCR_SLF_WAK;
> >  	priv->write(reg_mcr, &regs->mcr);
> >
> >  	/* enable stop request */
> > -	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> > -			   1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
> > +	if (priv->devtype_data->quirks &
> FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
> > +		ret = flexcan_stop_mode_enable_scfw(priv, true);
> > +		if (ret < 0)
> > +			return ret;
> > +	} else {
> > +		regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> > +				   1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
> > +	}
> >
> >  	return flexcan_low_power_enter_ack(priv);
> >  }
> > @@ -566,10 +600,17 @@ static inline int flexcan_exit_stop_mode(struct
> > flexcan_priv *priv)  {
> >  	struct flexcan_regs __iomem *regs = priv->regs;
> >  	u32 reg_mcr;
> > +	int ret;
> >
> >  	/* remove stop request */
> > -	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> > -			   1 << priv->stm.req_bit, 0);
> > +	if (priv->devtype_data->quirks &
> FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
> > +		ret = flexcan_stop_mode_enable_scfw(priv, false);
> > +		if (ret < 0)
> > +			return ret;
> > +	} else {
> > +		regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
> > +				   1 << priv->stm.req_bit, 0);
> > +	}
> >
> >  	reg_mcr = priv->read(&regs->mcr);
> >  	reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
> > @@ -1838,7 +1879,7 @@ static void unregister_flexcandev(struct
> net_device *dev)
> >  	unregister_candev(dev);
> >  }
> >
> > -static int flexcan_setup_stop_mode(struct platform_device *pdev)
> > +static int flexcan_setup_stop_mode_gpr(struct platform_device *pdev)
> >  {
> >  	struct net_device *dev = platform_get_drvdata(pdev);
> >  	struct device_node *np = pdev->dev.of_node; @@ -1883,11 +1924,6 @@
> > static int flexcan_setup_stop_mode(struct platform_device *pdev)
> >  		"gpr %s req_gpr=0x02%x req_bit=%u\n",
> >  		gpr_np->full_name, priv->stm.req_gpr, priv->stm.req_bit);
> >
> > -	device_set_wakeup_capable(&pdev->dev, true);
> > -
> > -	if (of_property_read_bool(np, "wakeup-source"))
> > -		device_set_wakeup_enable(&pdev->dev, true);
> > -
> >  	return 0;
> >
> >  out_put_node:
> > @@ -1895,6 +1931,64 @@ static int flexcan_setup_stop_mode(struct
> platform_device *pdev)
> >  	return ret;
> >  }
> >
> > +static int flexcan_setup_stop_mode_scfw(struct platform_device *pdev)
> > +{
> > +	struct net_device *dev = platform_get_drvdata(pdev);
> > +	struct flexcan_priv *priv;
> > +	u8 can_idx;
> > +	int ret;
> > +
> > +	ret = of_property_read_u8(pdev->dev.of_node, "fsl,scu-index", &can_idx);
> > +	if (ret < 0) {
> > +		dev_dbg(&pdev->dev, "failed to get scu index\n");
> > +		return ret;
> > +	}
> > +
> > +	priv = netdev_priv(dev);
> > +	priv->can_idx = can_idx;
> > +
> > +	/* this function could be defered probe, return -EPROBE_DEFER */
> > +	ret = imx_scu_get_handle(&priv->sc_ipc_handle);
> > +	if (ret < 0) {
> > +		dev_dbg(&pdev->dev, "get ipc handle used by SCU failed\n");
> > +		return ret;
> > +	}
> 
> Don't print an error message on -EPROBE_DEFER.

Ok, make sense, thanks.


> > +
> > +	return 0;
> > +}
> > +
> > +/* flexcan_setup_stop_mode - Setup stop mode for wakeup
> > + *
> > + * Return: = 0 setup stop mode successfully or doesn't support this feature
> > + *         < 0 fail to setup stop mode (could be defered probe)
> > + */
> > +static int flexcan_setup_stop_mode(struct platform_device *pdev) {
> > +	struct net_device *dev = platform_get_drvdata(pdev);
> > +	struct flexcan_priv *priv;
> > +	int ret;
> > +
> > +	priv = netdev_priv(dev);
> > +
> > +	if (priv->devtype_data->quirks &
> FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW)
> > +		ret = flexcan_setup_stop_mode_scfw(pdev);
> > +	else if (priv->devtype_data->quirks &
> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)
> > +		ret = flexcan_setup_stop_mode_gpr(pdev);
> > +	else
> > +		/* return 0 directly if doesn't support stop mode feature */
> > +		return 0;
> > +
> > +	if (ret)
> > +		return ret;
> > +
> > +	device_set_wakeup_capable(&pdev->dev, true);
> > +
> > +	if (of_property_read_bool(pdev->dev.of_node, "wakeup-source"))
> > +		device_set_wakeup_enable(&pdev->dev, true);
> > +
> > +	return 0;
> > +}
> > +
> >  static const struct of_device_id flexcan_of_match[] = {
> >  	{ .compatible = "fsl,imx8qm-flexcan", .data =
> &fsl_imx8qm_devtype_data, },
> >  	{ .compatible = "fsl,imx8mp-flexcan", .data =
> > &fsl_imx8mp_devtype_data, }, @@ -2040,17 +2134,19 @@ static int
> flexcan_probe(struct platform_device *pdev)
> >  		goto failed_register;
> >  	}
> >
> > +	err = flexcan_setup_stop_mode(pdev);
> > +	if (err < 0) {
> > +		dev_err(&pdev->dev, "setup stop mode failed\n");
> > +		goto failed_canregister;
> > +	}
> > +
> >  	of_can_transceiver(dev);
> >  	devm_can_led_init(dev);
> >
> > -	if (priv->devtype_data->quirks &
> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) {
> > -		err = flexcan_setup_stop_mode(pdev);
> > -		if (err)
> > -			dev_dbg(&pdev->dev, "failed to setup stop-mode\n");
> > -	}
> > -
> >  	return 0;
> >
> > + failed_canregister:
> > +	unregister_flexcandev(dev);
> >   failed_register:
> >  	pm_runtime_put_noidle(&pdev->dev);
> >  	pm_runtime_disable(&pdev->dev);
> > @@ -2062,6 +2158,7 @@ static int flexcan_remove(struct platform_device
> > *pdev)  {
> >  	struct net_device *dev = platform_get_drvdata(pdev);
> >
> > +	device_set_wakeup_enable(&pdev->dev, false);
> 
> Please make this a seperate patch, as it fixes a bug.

Ok.


Best Regards,
Joakim Zh
> >  	unregister_flexcandev(dev);
> >  	pm_runtime_disable(&pdev->dev);
> >  	free_candev(dev);
> >
> 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 |


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM
  2020-10-19  8:39     ` Joakim Zhang
@ 2020-10-19  8:41       ` Marc Kleine-Budde
  2020-10-19  9:03         ` Joakim Zhang
  0 siblings, 1 reply; 14+ messages in thread
From: Marc Kleine-Budde @ 2020-10-19  8:41 UTC (permalink / raw)
  To: Joakim Zhang, robh+dt, shawnguo, s.hauer
  Cc: kernel, dl-linux-imx, Ying Liu, linux-can, Pankaj Bansal, netdev,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 856 bytes --]

On 10/19/20 10:39 AM, Joakim Zhang wrote:
>>> +#define FLEXCAN_IMX_SC_R_CAN(x)		(IMX_SC_R_CAN_0 + (x))
>>
>> Why not move it into the appropriate svc header file?
> 
> Sorry, not quite understand. Which file do you mean the appropriate svc
> header file? Is it include/dt-bindings/firmware/imx/rsrc.h?

yes, I meant that:

> include/dt-bindings/firmware/imx/rsrc.h:111:#define IMX_SC_R_CAN_0                      105

> After glancing the header file under include/linux/firmware/imx, have not
> found the appropriate svc header. Could you please explain more?

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 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM
  2020-10-19  8:41       ` Marc Kleine-Budde
@ 2020-10-19  9:03         ` Joakim Zhang
  2020-10-19  9:05           ` Marc Kleine-Budde
  0 siblings, 1 reply; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19  9:03 UTC (permalink / raw)
  To: Marc Kleine-Budde, robh+dt, shawnguo, s.hauer, Aisheng Dong
  Cc: kernel, dl-linux-imx, Ying Liu, linux-can, Pankaj Bansal, netdev,
	linux-kernel


Hi Marc,

> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: 2020年10月19日 16:42
> To: Joakim Zhang <qiangqing.zhang@nxp.com>; robh+dt@kernel.org;
> shawnguo@kernel.org; s.hauer@pengutronix.de
> Cc: kernel@pengutronix.de; dl-linux-imx <linux-imx@nxp.com>; Ying Liu
> <victor.liu@nxp.com>; linux-can@vger.kernel.org; Pankaj Bansal
> <pankaj.bansal@nxp.com>; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH V2 8/8] can: flexcan: add CAN wakeup function for
> i.MX8QM
> 
> On 10/19/20 10:39 AM, Joakim Zhang wrote:
> >>> +#define FLEXCAN_IMX_SC_R_CAN(x)		(IMX_SC_R_CAN_0 + (x))
> >>
> >> Why not move it into the appropriate svc header file?
> >
> > Sorry, not quite understand. Which file do you mean the appropriate
> > svc header file? Is it include/dt-bindings/firmware/imx/rsrc.h?
> 
> yes, I meant that:
> 
> > include/dt-bindings/firmware/imx/rsrc.h:111:#define IMX_SC_R_CAN_0
> 105

As I can see in rsrc.h file, it just list each resource sequentially, and there is a note in the comments:
"Note items from list should never be changed or removed (only added to at the end of the list)."
So the driver author doesn't want any scu users to change these resource macro. If we only do below change for CAN, but keep other devices unchanged,
It would be very strange. And I think this code change could not be accepted. There may be another consideration, now we only has 3 CAN instances, how can we handle
if later SoCs have more CAN instances, and they still want to reuse this header file. This is also reason I prefer to use these defined macros directly in flexcan driver. 

--- a/include/dt-bindings/firmware/imx/rsrc.h
+++ b/include/dt-bindings/firmware/imx/rsrc.h
@@ -108,9 +108,7 @@
 #define IMX_SC_R_ADC_1                 102
 #define IMX_SC_R_FTM_0                 103
 #define IMX_SC_R_FTM_1                 104
-#define IMX_SC_R_CAN_0                 105
-#define IMX_SC_R_CAN_1                 106
-#define IMX_SC_R_CAN_2                 107
+#define IMX_SC_R_CAN(x)                 (105 + (x))
 #define IMX_SC_R_DMA_1_CH0             108
 #define IMX_SC_R_DMA_1_CH1             109
 #define IMX_SC_R_DMA_1_CH2             110
 
Add @Aisheng Dong, could above code changes can be accepted by you?

Best Regards,
Joakim Zhang

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM
  2020-10-19  9:03         ` Joakim Zhang
@ 2020-10-19  9:05           ` Marc Kleine-Budde
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Kleine-Budde @ 2020-10-19  9:05 UTC (permalink / raw)
  To: Joakim Zhang, robh+dt, shawnguo, s.hauer, Aisheng Dong
  Cc: kernel, dl-linux-imx, Ying Liu, linux-can, Pankaj Bansal, netdev,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1888 bytes --]

On 10/19/20 11:03 AM, Joakim Zhang wrote:
>>> include/dt-bindings/firmware/imx/rsrc.h:111:#define IMX_SC_R_CAN_0
>> 105
> 
> As I can see in rsrc.h file, it just list each resource sequentially, and there is a note in the comments:

> "Note items from list should never be changed or removed (only added to at
> the end of the list)."

So don't do it! Do not remove the CAN_0...2 :) Only add IMX_SC_R_CAN(x)

> So the driver author doesn't want any scu users to
> change these resource macro. If we only do below change for CAN, but keep
> other devices unchanged, It would be very strange. And I think this code
> change could not be accepted. There may be another consideration, now we only
> has 3 CAN instances, how can we handle if later SoCs have more CAN instances,
> and they still want to reuse this header file. This is also reason I prefer
> to use these defined macros directly in flexcan driver.
> 
> --- a/include/dt-bindings/firmware/imx/rsrc.h
> +++ b/include/dt-bindings/firmware/imx/rsrc.h
> @@ -108,9 +108,7 @@
>  #define IMX_SC_R_ADC_1                 102
>  #define IMX_SC_R_FTM_0                 103
>  #define IMX_SC_R_FTM_1                 104
> -#define IMX_SC_R_CAN_0                 105
> -#define IMX_SC_R_CAN_1                 106
> -#define IMX_SC_R_CAN_2                 107
> +#define IMX_SC_R_CAN(x)                 (105 + (x))
>  #define IMX_SC_R_DMA_1_CH0             108
>  #define IMX_SC_R_DMA_1_CH1             109
>  #define IMX_SC_R_DMA_1_CH2             110
>  
> Add @Aisheng Dong, could above code changes can be accepted by you?

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 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM
@ 2020-10-19 15:57 Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 1/8] firmware: imx: always export SCU symbols Joakim Zhang
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

The first patch from Liu Ying aims to export SCU symbols for SoCs w/wo SCU,
so that no need to check CONFIG_IMX_SCU in the specific driver.

The following patches are flexcan fixes and add stop mode support for i.MX8QM.

ChangeLogs:
V1->V2:
	* split ECC fix patches into separate patches.
	* free can dev if failed to setup stop mode.
	* disable wakeup on flexcan_remove.
	* add FLEXCAN_IMX_SC_R_CAN macro helper.
	* fsl,can-index->fsl,scu-index.
	* move fsl,scu-index and priv->can_idx into
	* flexcan_setup_stop_mode_scfw()
	* prove failed if failed to setup stop mode.

Joakim Zhang (7):
  dt-bindings: can: flexcan: fix fsl,clk-source property
  can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A
  can: flexcan: add ECC initialization for LX2160A
  can: flexcan: add ECC initialization for VF610
  dt-bindings: can: flexcan: add fsl,scu-index property to indicate a
    resource
  can: flexcan: rename macro FLEXCAN_QUIRK_SETUP_STOP_MODE ->
    FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR
  can: flexcan: add CAN wakeup function for i.MX8QM

Liu Ying (1):
  firmware: imx: always export SCU symbols

 .../bindings/net/can/fsl-flexcan.txt          |   8 +-
 drivers/net/can/flexcan.c                     | 149 +++++++++++++++---
 include/linux/firmware/imx/ipc.h              |  15 ++
 include/linux/firmware/imx/svc/misc.h         |  23 +++
 4 files changed, 168 insertions(+), 27 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH V2 1/8] firmware: imx: always export SCU symbols
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 2/8] dt-bindings: can: flexcan: fix fsl,clk-source property Joakim Zhang
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

From: Liu Ying <victor.liu@nxp.com>

Always export SCU symbols for both SCU SoCs and non-SCU SoCs to avoid
build error.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 include/linux/firmware/imx/ipc.h      | 15 +++++++++++++++
 include/linux/firmware/imx/svc/misc.h | 23 +++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h
index 891057434858..300fa253fc30 100644
--- a/include/linux/firmware/imx/ipc.h
+++ b/include/linux/firmware/imx/ipc.h
@@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
 	uint8_t func;
 };
 
+#if IS_ENABLED(CONFIG_IMX_SCU)
 /*
  * This is an function to send an RPC message over an IPC channel.
  * It is called by client-side SCFW API function shims.
@@ -55,4 +56,18 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp);
  * @return Returns an error code (0 = success, failed if < 0)
  */
 int imx_scu_get_handle(struct imx_sc_ipc **ipc);
+
+#else
+static inline int
+imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp)
+{
+	return -EIO;
+}
+
+static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
+{
+	return -EIO;
+}
+#endif
+
 #endif /* _SC_IPC_H */
diff --git a/include/linux/firmware/imx/svc/misc.h b/include/linux/firmware/imx/svc/misc.h
index 031dd4d3c766..d255048f17de 100644
--- a/include/linux/firmware/imx/svc/misc.h
+++ b/include/linux/firmware/imx/svc/misc.h
@@ -46,6 +46,7 @@ enum imx_misc_func {
  * Control Functions
  */
 
+#if IS_ENABLED(CONFIG_IMX_SCU)
 int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
 			    u8 ctrl, u32 val);
 
@@ -55,4 +56,26 @@ int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource,
 int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
 			bool enable, u64 phys_addr);
 
+#else
+static inline int
+imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
+			u8 ctrl, u32 val)
+{
+	return -EIO;
+}
+
+static inline int
+imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource,
+			u8 ctrl, u32 *val)
+{
+	return -EIO;
+}
+
+static inline int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
+				      bool enable, u64 phys_addr)
+{
+	return -EIO;
+}
+#endif
+
 #endif /* _SC_MISC_API_H */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V2 2/8] dt-bindings: can: flexcan: fix fsl,clk-source property
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 1/8] firmware: imx: always export SCU symbols Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 3/8] can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A Joakim Zhang
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

Correct fsl,clk-source example since flexcan driver uses "of_property_read_u8"
to get this property.

Fixes: 9d733992772d ("dt-bindings: can: flexcan: add PE clock source property to device tree")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
index e10b6eb955e1..6af67f5e581c 100644
--- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
+++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
@@ -53,5 +53,5 @@ Example:
 		interrupts = <48 0x2>;
 		interrupt-parent = <&mpic>;
 		clock-frequency = <200000000>; // filled in by bootloader
-		fsl,clk-source = <0>; // select clock source 0 for PE
+		fsl,clk-source = /bits/ 8 <0>; // select clock source 0 for PE
 	};
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V2 3/8] can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 1/8] firmware: imx: always export SCU symbols Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 2/8] dt-bindings: can: flexcan: fix fsl,clk-source property Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 4/8] can: flexcan: add ECC initialization for LX2160A Joakim Zhang
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

After double check with Layerscape CAN owner (Pankaj Bansal), confirm that
LS1021A doesn't support ECC feature, so remove FLEXCAN_QUIRK_DISABLE_MECR
quirk.

Fixes: 99b7668c04b27 ("can: flexcan: adding platform specific details for LS1021A")
Cc: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/can/flexcan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 4d594e977497..586e1417a697 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -405,8 +405,7 @@ static const struct flexcan_devtype_data fsl_vf610_devtype_data = {
 
 static const struct flexcan_devtype_data fsl_ls1021a_r2_devtype_data = {
 	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
-		FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE |
-		FLEXCAN_QUIRK_USE_OFF_TIMESTAMP,
+		FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP,
 };
 
 static const struct flexcan_devtype_data fsl_lx2160a_r1_devtype_data = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V2 4/8] can: flexcan: add ECC initialization for LX2160A
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
                   ` (2 preceding siblings ...)
  2020-10-19 15:57 ` [PATCH V2 3/8] can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 5/8] can: flexcan: add ECC initialization for VF610 Joakim Zhang
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

After double check with Layerscape CAN owner (Pankaj Bansal), confirm
that LX2160A indeed supports ECC feature, so correct the feature table.

For SoCs with ECC supported, even use FLEXCAN_QUIRK_DISABLE_MECR quirk to
disable non-correctable errors interrupt and freeze mode, had better use
FLEXCAN_QUIRK_SUPPORT_ECC quirk to initialize all memory.

Fixes: 2c19bb43e5572 ("can: flexcan: add lx2160ar1 support")
Cc: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/can/flexcan.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 586e1417a697..c2330eab3595 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -217,7 +217,7 @@
  *   MX8MP FlexCAN3  03.00.17.01    yes       yes        no      yes       yes          yes
  *   VF610 FlexCAN3  ?               no       yes        no      yes       yes?          no
  * LS1021A FlexCAN2  03.00.04.00     no       yes        no       no       yes           no
- * LX2160A FlexCAN3  03.00.23.00     no       yes        no       no       yes          yes
+ * LX2160A FlexCAN3  03.00.23.00     no       yes        no      yes       yes          yes
  *
  * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
  */
@@ -411,7 +411,8 @@ static const struct flexcan_devtype_data fsl_ls1021a_r2_devtype_data = {
 static const struct flexcan_devtype_data fsl_lx2160a_r1_devtype_data = {
 	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
 		FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE |
-		FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_SUPPORT_FD,
+		FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_SUPPORT_FD |
+		FLEXCAN_QUIRK_SUPPORT_ECC,
 };
 
 static const struct can_bittiming_const flexcan_bittiming_const = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V2 5/8] can: flexcan: add ECC initialization for VF610
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
                   ` (3 preceding siblings ...)
  2020-10-19 15:57 ` [PATCH V2 4/8] can: flexcan: add ECC initialization for LX2160A Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 6/8] dt-bindings: can: flexcan: add fsl,scu-index property to indicate a resource Joakim Zhang
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

For SoCs with ECC supported, even use FLEXCAN_QUIRK_DISABLE_MECR quirk to
disable non-correctable errors interrupt and freeze mode, had better use
FLEXCAN_QUIRK_SUPPORT_ECC quirk to initialize all memory.

Fixes: cdce844865bea ("can: flexcan: add vf610 support for FlexCAN")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/can/flexcan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index c2330eab3595..06f94b6f0ebe 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -400,7 +400,7 @@ static struct flexcan_devtype_data fsl_imx8mp_devtype_data = {
 static const struct flexcan_devtype_data fsl_vf610_devtype_data = {
 	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
 		FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP |
-		FLEXCAN_QUIRK_BROKEN_PERR_STATE,
+		FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SUPPORT_ECC,
 };
 
 static const struct flexcan_devtype_data fsl_ls1021a_r2_devtype_data = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V2 6/8] dt-bindings: can: flexcan: add fsl,scu-index property to indicate a resource
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
                   ` (4 preceding siblings ...)
  2020-10-19 15:57 ` [PATCH V2 5/8] can: flexcan: add ECC initialization for VF610 Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 7/8] can: flexcan: rename macro FLEXCAN_QUIRK_SETUP_STOP_MODE -> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM Joakim Zhang
  7 siblings, 0 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

For SoCs with SCU support, need setup stop mode via SCU firmware,
so this property can help indicate a resource in SCU firmware.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
index 6af67f5e581c..38a7da4fef3f 100644
--- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
+++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
@@ -43,6 +43,11 @@ Optional properties:
 		  0: clock source 0 (oscillator clock)
 		  1: clock source 1 (peripheral clock)
 
+- fsl,scu-index: The scu index of CAN instance.
+                 For SoCs with SCU support, need setup stop mode via SCU firmware,
+                 so this property can help indicate a resource. It supports up to
+                 3 CAN instances now, so the value should be 0, 1, or 2.
+
 - wakeup-source: enable CAN remote wakeup
 
 Example:
@@ -54,4 +59,5 @@ Example:
 		interrupt-parent = <&mpic>;
 		clock-frequency = <200000000>; // filled in by bootloader
 		fsl,clk-source = /bits/ 8 <0>; // select clock source 0 for PE
+		fsl,scu-index = /bits/ 8 <1>; // the second CAN instance
 	};
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V2 7/8] can: flexcan: rename macro FLEXCAN_QUIRK_SETUP_STOP_MODE -> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
                   ` (5 preceding siblings ...)
  2020-10-19 15:57 ` [PATCH V2 6/8] dt-bindings: can: flexcan: add fsl,scu-index property to indicate a resource Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19 15:57 ` [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM Joakim Zhang
  7 siblings, 0 replies; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

This patch intends to rename FLEXCAN_QUIRK_SETUP_STOP_MODE quirk
to FLEXCAN_QUIRK_SETUP_STOP_MODE_GRP for non-scu SoCs, coming patch will
add quirk for scu SoCs.

For non-scu SoCs, setup stop mode with GPR register.
For scu SoCs, setup stop mode with SCU firmware.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/can/flexcan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 06f94b6f0ebe..c0cdee904ca7 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -236,8 +236,8 @@
 #define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6)
 /* default to BE register access */
 #define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7)
-/* Setup stop mode to support wakeup */
-#define FLEXCAN_QUIRK_SETUP_STOP_MODE BIT(8)
+/* Setup stop mode with GPR to support wakeup */
+#define FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR BIT(8)
 /* Support CAN-FD mode */
 #define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
 /* support memory detection and correction */
@@ -381,7 +381,7 @@ static const struct flexcan_devtype_data fsl_imx28_devtype_data = {
 static const struct flexcan_devtype_data fsl_imx6q_devtype_data = {
 	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
 		FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_BROKEN_PERR_STATE |
-		FLEXCAN_QUIRK_SETUP_STOP_MODE,
+		FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR,
 };
 
 static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = {
@@ -393,7 +393,7 @@ static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = {
 static struct flexcan_devtype_data fsl_imx8mp_devtype_data = {
 	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
 		FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP |
-		FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE |
+		FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR |
 		FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SUPPORT_ECC,
 };
 
@@ -2043,7 +2043,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	of_can_transceiver(dev);
 	devm_can_led_init(dev);
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE) {
+	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) {
 		err = flexcan_setup_stop_mode(pdev);
 		if (err)
 			dev_dbg(&pdev->dev, "failed to setup stop-mode\n");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM
  2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
                   ` (6 preceding siblings ...)
  2020-10-19 15:57 ` [PATCH V2 7/8] can: flexcan: rename macro FLEXCAN_QUIRK_SETUP_STOP_MODE -> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR Joakim Zhang
@ 2020-10-19 15:57 ` Joakim Zhang
  2020-10-19  8:15   ` Marc Kleine-Budde
  7 siblings, 1 reply; 14+ messages in thread
From: Joakim Zhang @ 2020-10-19 15:57 UTC (permalink / raw)
  To: mkl, robh+dt, shawnguo, s.hauer
  Cc: kernel, linux-imx, victor.liu, linux-can, pankaj.bansal, netdev,
	linux-kernel

The System Controller Firmware (SCFW) is a low-level system function
which runs on a dedicated Cortex-M core to provide power, clock, and
resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
(QM, QP), and i.MX8QX (QXP, DX). SCU driver manages the IPC interface
between host CPU and the SCU firmware running on M4.

For i.MX8QM, stop mode request is controlled by System Controller Unit(SCU)
firmware, this patch introduces FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW quirk
for this function.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/can/flexcan.c | 131 +++++++++++++++++++++++++++++++++-----
 1 file changed, 114 insertions(+), 17 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index c0cdee904ca7..8ad5065c918f 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -9,6 +9,7 @@
 //
 // Based on code originally by Andrey Volkov <avolkov@varma-el.com>
 
+#include <dt-bindings/firmware/imx/rsrc.h>
 #include <linux/bitfield.h>
 #include <linux/can.h>
 #include <linux/can/dev.h>
@@ -17,6 +18,7 @@
 #include <linux/can/rx-offload.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
+#include <linux/firmware/imx/sci.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
@@ -203,6 +205,8 @@
 
 #define FLEXCAN_TIMEOUT_US		(250)
 
+#define FLEXCAN_IMX_SC_R_CAN(x)		(IMX_SC_R_CAN_0 + (x))
+
 /* FLEXCAN hardware feature flags
  *
  * Below is some version info we got:
@@ -242,6 +246,8 @@
 #define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
 /* support memory detection and correction */
 #define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)
+/* Setup stop mode with SCU firmware to support wakeup */
+#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)
 
 /* Structure of the message buffer */
 struct flexcan_mb {
@@ -347,6 +353,7 @@ struct flexcan_priv {
 	u8 mb_count;
 	u8 mb_size;
 	u8 clk_src;	/* clock source of CAN Protocol Engine */
+	u8 can_idx;
 
 	u64 rx_mask;
 	u64 tx_mask;
@@ -358,6 +365,9 @@ struct flexcan_priv {
 	struct regulator *reg_xceiver;
 	struct flexcan_stop_mode stm;
 
+	/* IPC handle when setup stop mode by System Controller firmware(scfw) */
+	struct imx_sc_ipc *sc_ipc_handle;
+
 	/* Read and Write APIs */
 	u32 (*read)(void __iomem *addr);
 	void (*write)(u32 val, void __iomem *addr);
@@ -387,7 +397,7 @@ static const struct flexcan_devtype_data fsl_imx6q_devtype_data = {
 static const struct flexcan_devtype_data fsl_imx8qm_devtype_data = {
 	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
 		FLEXCAN_QUIRK_USE_OFF_TIMESTAMP | FLEXCAN_QUIRK_BROKEN_PERR_STATE |
-		FLEXCAN_QUIRK_SUPPORT_FD,
+		FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW,
 };
 
 static struct flexcan_devtype_data fsl_imx8mp_devtype_data = {
@@ -546,18 +556,42 @@ static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable)
 	priv->write(reg_mcr, &regs->mcr);
 }
 
+static int flexcan_stop_mode_enable_scfw(struct flexcan_priv *priv, bool enabled)
+{
+	u8 idx = priv->can_idx;
+	u32 rsrc_id, val;
+
+	rsrc_id = FLEXCAN_IMX_SC_R_CAN(idx);
+
+	if (enabled)
+		val = 1;
+	else
+		val = 0;
+
+	/* stop mode request via scu firmware */
+	return imx_sc_misc_set_control(priv->sc_ipc_handle, rsrc_id,
+				       IMX_SC_C_IPG_STOP, val);
+}
+
 static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
 {
 	struct flexcan_regs __iomem *regs = priv->regs;
 	u32 reg_mcr;
+	int ret;
 
 	reg_mcr = priv->read(&regs->mcr);
 	reg_mcr |= FLEXCAN_MCR_SLF_WAK;
 	priv->write(reg_mcr, &regs->mcr);
 
 	/* enable stop request */
-	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
-			   1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
+	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
+		ret = flexcan_stop_mode_enable_scfw(priv, true);
+		if (ret < 0)
+			return ret;
+	} else {
+		regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
+				   1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
+	}
 
 	return flexcan_low_power_enter_ack(priv);
 }
@@ -566,10 +600,17 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
 {
 	struct flexcan_regs __iomem *regs = priv->regs;
 	u32 reg_mcr;
+	int ret;
 
 	/* remove stop request */
-	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
-			   1 << priv->stm.req_bit, 0);
+	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
+		ret = flexcan_stop_mode_enable_scfw(priv, false);
+		if (ret < 0)
+			return ret;
+	} else {
+		regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
+				   1 << priv->stm.req_bit, 0);
+	}
 
 	reg_mcr = priv->read(&regs->mcr);
 	reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
@@ -1838,7 +1879,7 @@ static void unregister_flexcandev(struct net_device *dev)
 	unregister_candev(dev);
 }
 
-static int flexcan_setup_stop_mode(struct platform_device *pdev)
+static int flexcan_setup_stop_mode_gpr(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 	struct device_node *np = pdev->dev.of_node;
@@ -1883,11 +1924,6 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
 		"gpr %s req_gpr=0x02%x req_bit=%u\n",
 		gpr_np->full_name, priv->stm.req_gpr, priv->stm.req_bit);
 
-	device_set_wakeup_capable(&pdev->dev, true);
-
-	if (of_property_read_bool(np, "wakeup-source"))
-		device_set_wakeup_enable(&pdev->dev, true);
-
 	return 0;
 
 out_put_node:
@@ -1895,6 +1931,64 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
 	return ret;
 }
 
+static int flexcan_setup_stop_mode_scfw(struct platform_device *pdev)
+{
+	struct net_device *dev = platform_get_drvdata(pdev);
+	struct flexcan_priv *priv;
+	u8 can_idx;
+	int ret;
+
+	ret = of_property_read_u8(pdev->dev.of_node, "fsl,scu-index", &can_idx);
+	if (ret < 0) {
+		dev_dbg(&pdev->dev, "failed to get scu index\n");
+		return ret;
+	}
+
+	priv = netdev_priv(dev);
+	priv->can_idx = can_idx;
+
+	/* this function could be defered probe, return -EPROBE_DEFER */
+	ret = imx_scu_get_handle(&priv->sc_ipc_handle);
+	if (ret < 0) {
+		dev_dbg(&pdev->dev, "get ipc handle used by SCU failed\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+/* flexcan_setup_stop_mode - Setup stop mode for wakeup
+ *
+ * Return: = 0 setup stop mode successfully or doesn't support this feature
+ *         < 0 fail to setup stop mode (could be defered probe)
+ */
+static int flexcan_setup_stop_mode(struct platform_device *pdev)
+{
+	struct net_device *dev = platform_get_drvdata(pdev);
+	struct flexcan_priv *priv;
+	int ret;
+
+	priv = netdev_priv(dev);
+
+	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW)
+		ret = flexcan_setup_stop_mode_scfw(pdev);
+	else if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)
+		ret = flexcan_setup_stop_mode_gpr(pdev);
+	else
+		/* return 0 directly if doesn't support stop mode feature */
+		return 0;
+
+	if (ret)
+		return ret;
+
+	device_set_wakeup_capable(&pdev->dev, true);
+
+	if (of_property_read_bool(pdev->dev.of_node, "wakeup-source"))
+		device_set_wakeup_enable(&pdev->dev, true);
+
+	return 0;
+}
+
 static const struct of_device_id flexcan_of_match[] = {
 	{ .compatible = "fsl,imx8qm-flexcan", .data = &fsl_imx8qm_devtype_data, },
 	{ .compatible = "fsl,imx8mp-flexcan", .data = &fsl_imx8mp_devtype_data, },
@@ -2040,17 +2134,19 @@ static int flexcan_probe(struct platform_device *pdev)
 		goto failed_register;
 	}
 
+	err = flexcan_setup_stop_mode(pdev);
+	if (err < 0) {
+		dev_err(&pdev->dev, "setup stop mode failed\n");
+		goto failed_canregister;
+	}
+
 	of_can_transceiver(dev);
 	devm_can_led_init(dev);
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) {
-		err = flexcan_setup_stop_mode(pdev);
-		if (err)
-			dev_dbg(&pdev->dev, "failed to setup stop-mode\n");
-	}
-
 	return 0;
 
+ failed_canregister:
+	unregister_flexcandev(dev);
  failed_register:
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
@@ -2062,6 +2158,7 @@ static int flexcan_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 
+	device_set_wakeup_enable(&pdev->dev, false);
 	unregister_flexcandev(dev);
 	pm_runtime_disable(&pdev->dev);
 	free_candev(dev);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-10-19  9:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 15:57 [PATCH V2 0/8] can: flexcan: add stop mode support for i.MX8QM Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 1/8] firmware: imx: always export SCU symbols Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 2/8] dt-bindings: can: flexcan: fix fsl,clk-source property Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 3/8] can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 4/8] can: flexcan: add ECC initialization for LX2160A Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 5/8] can: flexcan: add ECC initialization for VF610 Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 6/8] dt-bindings: can: flexcan: add fsl,scu-index property to indicate a resource Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 7/8] can: flexcan: rename macro FLEXCAN_QUIRK_SETUP_STOP_MODE -> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR Joakim Zhang
2020-10-19 15:57 ` [PATCH V2 8/8] can: flexcan: add CAN wakeup function for i.MX8QM Joakim Zhang
2020-10-19  8:15   ` Marc Kleine-Budde
2020-10-19  8:39     ` Joakim Zhang
2020-10-19  8:41       ` Marc Kleine-Budde
2020-10-19  9:03         ` Joakim Zhang
2020-10-19  9:05           ` Marc Kleine-Budde

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).