All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: imx: always export scu symbols
@ 2020-10-14  8:57 ` Joakim Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Joakim Zhang @ 2020-10-14  8:57 UTC (permalink / raw)
  To: shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, linux-arm-kernel, linux-kernel,
	Liu Ying, Peng Fan, Joakim Zhang

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] 6+ messages in thread

* [PATCH] firmware: imx: always export scu symbols
@ 2020-10-14  8:57 ` Joakim Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Joakim Zhang @ 2020-10-14  8:57 UTC (permalink / raw)
  To: shawnguo, s.hauer
  Cc: Peng Fan, Liu Ying, linux-kernel, Joakim Zhang, linux-imx,
	kernel, festevam, linux-arm-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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] firmware: imx: always export scu symbols
  2020-10-14  8:57 ` Joakim Zhang
@ 2020-10-15  1:33   ` Liu Ying
  -1 siblings, 0 replies; 6+ messages in thread
From: Liu Ying @ 2020-10-15  1:33 UTC (permalink / raw)
  To: Joakim Zhang, shawnguo, s.hauer
  Cc: kernel, festevam, linux-imx, linux-arm-kernel, linux-kernel, Peng Fan

Hi Joakim,

On Wed, 2020-10-14 at 16:57 +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.

s/scu/SCU/

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

This is done in our downstream tree. I did this because a downstream
display driver covers SoCs w/wo SCU. For upstream, I find the drivers
can be splited so that this is not needed.

Do you see any existing upstream driver covers SoCs w/wo SCU?
I think this can be introduced together with the first that kink of
driver.

-- 
 Liu Ying


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

* Re: [PATCH] firmware: imx: always export scu symbols
@ 2020-10-15  1:33   ` Liu Ying
  0 siblings, 0 replies; 6+ messages in thread
From: Liu Ying @ 2020-10-15  1:33 UTC (permalink / raw)
  To: Joakim Zhang, shawnguo, s.hauer
  Cc: Peng Fan, linux-kernel, linux-imx, kernel, festevam, linux-arm-kernel

Hi Joakim,

On Wed, 2020-10-14 at 16:57 +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.

s/scu/SCU/

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

This is done in our downstream tree. I did this because a downstream
display driver covers SoCs w/wo SCU. For upstream, I find the drivers
can be splited so that this is not needed.

Do you see any existing upstream driver covers SoCs w/wo SCU?
I think this can be introduced together with the first that kink of
driver.

-- 
 Liu Ying


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] firmware: imx: always export scu symbols
  2020-10-15  1:33   ` Liu Ying
@ 2020-10-15  3:17     ` Joakim Zhang
  -1 siblings, 0 replies; 6+ messages in thread
From: Joakim Zhang @ 2020-10-15  3:17 UTC (permalink / raw)
  To: Ying Liu, shawnguo, s.hauer, Marc Kleine-Budde
  Cc: kernel, festevam, dl-linux-imx, linux-arm-kernel, linux-kernel, Peng Fan


Hi Ying,

> -----Original Message-----
> From: Ying Liu <victor.liu@nxp.com>
> Sent: 2020年10月15日 9:33
> To: Joakim Zhang <qiangqing.zhang@nxp.com>; shawnguo@kernel.org;
> s.hauer@pengutronix.de
> Cc: kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx
> <linux-imx@nxp.com>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; Peng Fan <peng.fan@nxp.com>
> Subject: Re: [PATCH] firmware: imx: always export scu symbols
> 
> Hi Joakim,
> 
> On Wed, 2020-10-14 at 16:57 +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.
> 
> s/scu/SCU/

OK.

> >
> > 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 */
> 
> This is done in our downstream tree. I did this because a downstream display
> driver covers SoCs w/wo SCU. For upstream, I find the drivers can be splited so
> that this is not needed.
> 
> Do you see any existing upstream driver covers SoCs w/wo SCU?
Yes, FlexCAN driver covers SoCs w/wo SCU, so I need this patch to avoid adding IS_ENABLED(CONFIG_IMX_SCU) in FlexCAN driver.

> I think this can be introduced together with the first that kink of driver.
Ok, it seems better, thanks.

Best Regards,
Joakim Zhang
> --
>  Liu Ying


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

* RE: [PATCH] firmware: imx: always export scu symbols
@ 2020-10-15  3:17     ` Joakim Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Joakim Zhang @ 2020-10-15  3:17 UTC (permalink / raw)
  To: Ying Liu, shawnguo, s.hauer, Marc Kleine-Budde
  Cc: Peng Fan, linux-kernel, dl-linux-imx, kernel, festevam, linux-arm-kernel


Hi Ying,

> -----Original Message-----
> From: Ying Liu <victor.liu@nxp.com>
> Sent: 2020年10月15日 9:33
> To: Joakim Zhang <qiangqing.zhang@nxp.com>; shawnguo@kernel.org;
> s.hauer@pengutronix.de
> Cc: kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx
> <linux-imx@nxp.com>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; Peng Fan <peng.fan@nxp.com>
> Subject: Re: [PATCH] firmware: imx: always export scu symbols
> 
> Hi Joakim,
> 
> On Wed, 2020-10-14 at 16:57 +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.
> 
> s/scu/SCU/

OK.

> >
> > 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 */
> 
> This is done in our downstream tree. I did this because a downstream display
> driver covers SoCs w/wo SCU. For upstream, I find the drivers can be splited so
> that this is not needed.
> 
> Do you see any existing upstream driver covers SoCs w/wo SCU?
Yes, FlexCAN driver covers SoCs w/wo SCU, so I need this patch to avoid adding IS_ENABLED(CONFIG_IMX_SCU) in FlexCAN driver.

> I think this can be introduced together with the first that kink of driver.
Ok, it seems better, thanks.

Best Regards,
Joakim Zhang
> --
>  Liu Ying

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14  8:57 [PATCH] firmware: imx: always export scu symbols Joakim Zhang
2020-10-14  8:57 ` Joakim Zhang
2020-10-15  1:33 ` Liu Ying
2020-10-15  1:33   ` Liu Ying
2020-10-15  3:17   ` Joakim Zhang
2020-10-15  3:17     ` Joakim Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.