diff mbox series

[V4,1/6] firmware: imx: always export SCU symbols

Message ID 20201021052437.3763-2-qiangqing.zhang@nxp.com
State Superseded
Headers show
Series can: flexcan: add stop mode support for i.MX8QM | expand

Commit Message

Joakim Zhang Oct. 21, 2020, 5:24 a.m. UTC
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(+)

Comments

Shawn Guo Nov. 1, 2020, 7:43 a.m. UTC | #1
On Wed, Oct 21, 2020 at 01:24:32PM +0800, Joakim Zhang wrote:
> 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 +++++++++++++++

Could you rebase it to my imx/drivers branch?  There is one patch from
Peng Fan that already changed ipc.h.

Shawn

>  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
>
Joakim Zhang Nov. 2, 2020, 2:50 a.m. UTC | #2
> -----Original Message-----

> From: Shawn Guo <shawnguo@kernel.org>

> Sent: 2020年11月1日 15:43

> To: Joakim Zhang <qiangqing.zhang@nxp.com>

> Cc: mkl@pengutronix.de; robh+dt@kernel.org; s.hauer@pengutronix.de;

> kernel@pengutronix.de; dl-linux-imx <linux-imx@nxp.com>; Ying Liu

> <victor.liu@nxp.com>; linux-can@vger.kernel.org; netdev@vger.kernel.org;

> linux-kernel@vger.kernel.org

> Subject: Re: [PATCH V4 1/6] firmware: imx: always export SCU symbols

> 

> On Wed, Oct 21, 2020 at 01:24:32PM +0800, Joakim Zhang wrote:

> > 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 +++++++++++++++

> 

> Could you rebase it to my imx/drivers branch?  There is one patch from Peng

> Fan that already changed ipc.h.



Hi Shawn,

Please ignore 1/6 patch since it has been done with Peng's patch. I will resend flexcan patch set after Peng's patch goes into mainline.

Could you please review 5/6 patch which is suggested by Flexcan driver maintainer? Thanks.

Best Regards,
Joakim Zhang


> Shawn

> 

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

> >
diff mbox series

Patch

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 */