From: Peng Fan <[email protected]>
V5:
Add missed "static inline" in misc.h
V4:
Add dummy functions to fix build issue when soc-imx-scu.c built in,
but drivers/firmware/imx/imx-scu.c not built in.
No change to Patch 2/2.
V3:
Per Arnd's suggestions, merged Patch 2/3/4/5 into one patch
Dropped the defconfig change with a default Kconfig
Leonard, I dropped you R-b in V3 since the change.
V2:
Include Leonard's patch to fix build break after enable compile test
Add Leonard's R-b tag
Rename soc-imx8.c to soc-imx8m.c which is for i.MX8M family
Add SOC_IMX8M for build gate soc-imx8m.c
Increase build coverage for i.MX SoC driver
Peng Fan (2):
firmware: imx: add dummy functions
soc: imx: increase build coverage for imx8m soc driver
drivers/soc/Makefile | 2 +-
drivers/soc/imx/Kconfig | 9 +++++++++
drivers/soc/imx/Makefile | 2 +-
drivers/soc/imx/{soc-imx8.c => soc-imx8m.c} | 0
include/linux/firmware/imx/ipc.h | 13 +++++++++++++
include/linux/firmware/imx/sci.h | 22 ++++++++++++++++++++++
include/linux/firmware/imx/svc/misc.h | 19 +++++++++++++++++++
7 files changed, 65 insertions(+), 2 deletions(-)
rename drivers/soc/imx/{soc-imx8.c => soc-imx8m.c} (100%)
--
2.16.4
From: Peng Fan <[email protected]>
The soc-imx8.c driver is actually for i.MX8M family, so rename it
to soc-imx8m.c.
Use CONFIG_SOC_IMX8M as build gate, not CONFIG_ARCH_MXC, to control
whether build this driver, also make it possible for compile test.
Default set it to y for ARCH_MXC && ARM64
Signed-off-by: Peng Fan <[email protected]>
Reviewed-by: Leonard Crestez <[email protected]>
---
drivers/soc/Makefile | 2 +-
drivers/soc/imx/Kconfig | 9 +++++++++
drivers/soc/imx/Makefile | 2 +-
drivers/soc/imx/{soc-imx8.c => soc-imx8m.c} | 0
4 files changed, 11 insertions(+), 2 deletions(-)
rename drivers/soc/imx/{soc-imx8.c => soc-imx8m.c} (100%)
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index 8b49d782a1ab..a39f17cea376 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_ARCH_DOVE) += dove/
obj-$(CONFIG_MACH_DOVE) += dove/
obj-y += fsl/
obj-$(CONFIG_ARCH_GEMINI) += gemini/
-obj-$(CONFIG_ARCH_MXC) += imx/
+obj-y += imx/
obj-$(CONFIG_ARCH_IXP4XX) += ixp4xx/
obj-$(CONFIG_SOC_XWAY) += lantiq/
obj-y += mediatek/
diff --git a/drivers/soc/imx/Kconfig b/drivers/soc/imx/Kconfig
index 0281ef9a1800..70019cefa617 100644
--- a/drivers/soc/imx/Kconfig
+++ b/drivers/soc/imx/Kconfig
@@ -17,4 +17,13 @@ config IMX_SCU_SOC
Controller Unit SoC info module, it will provide the SoC info
like SoC family, ID and revision etc.
+config SOC_IMX8M
+ bool "i.MX8M SoC family support"
+ depends on ARCH_MXC || COMPILE_TEST
+ default ARCH_MXC && ARM64
+ help
+ If you say yes here you get support for the NXP i.MX8M family
+ support, it will provide the SoC info like SoC family,
+ ID and revision etc.
+
endmenu
diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile
index cf9ca42ff739..103e2c93c342 100644
--- a/drivers/soc/imx/Makefile
+++ b/drivers/soc/imx/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o
-obj-$(CONFIG_ARCH_MXC) += soc-imx8.o
+obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o
obj-$(CONFIG_IMX_SCU_SOC) += soc-imx-scu.o
diff --git a/drivers/soc/imx/soc-imx8.c b/drivers/soc/imx/soc-imx8m.c
similarity index 100%
rename from drivers/soc/imx/soc-imx8.c
rename to drivers/soc/imx/soc-imx8m.c
--
2.16.4
From: Peng Fan <[email protected]>
IMX_SCU_SOC could be enabled with COMPILE_TEST, however there is
no dummy functions when CONFIG_IMX_SCU not defined. Then there
will be build failure.
So add dummy functions to avoid build failure for COMPILE_TEST
Signed-off-by: Peng Fan <[email protected]>
---
include/linux/firmware/imx/ipc.h | 13 +++++++++++++
include/linux/firmware/imx/sci.h | 22 ++++++++++++++++++++++
include/linux/firmware/imx/svc/misc.h | 19 +++++++++++++++++++
3 files changed, 54 insertions(+)
diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h
index 6312c8cb084a..30475082f472 100644
--- a/include/linux/firmware/imx/ipc.h
+++ b/include/linux/firmware/imx/ipc.h
@@ -35,6 +35,7 @@ struct imx_sc_rpc_msg {
uint8_t func;
};
+#ifdef 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.
@@ -56,4 +57,16 @@ 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 -ENOTSUPP;
+}
+
+static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
+{
+ return -ENOTSUPP;
+}
+#endif
#endif /* _SC_IPC_H */
diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
index 17ba4e405129..7ea875b186e3 100644
--- a/include/linux/firmware/imx/sci.h
+++ b/include/linux/firmware/imx/sci.h
@@ -16,8 +16,30 @@
#include <linux/firmware/imx/svc/misc.h>
#include <linux/firmware/imx/svc/pm.h>
+#ifdef CONFIG_IMX_SCU
int imx_scu_enable_general_irq_channel(struct device *dev);
int imx_scu_irq_register_notifier(struct notifier_block *nb);
int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
+#else
+static inline int imx_scu_enable_general_irq_channel(struct device *dev)
+{
+ return -ENOTSUPP;
+}
+
+static inline int imx_scu_irq_register_notifier(struct notifier_block *nb)
+{
+ return -ENOTSUPP;
+}
+
+static inline int imx_scu_irq_unregister_notifier(struct notifier_block *nb)
+{
+ return -ENOTSUPP;
+}
+
+static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable)
+{
+ return -ENOTSUPP;
+}
+#endif
#endif /* _SC_SCI_H */
diff --git a/include/linux/firmware/imx/svc/misc.h b/include/linux/firmware/imx/svc/misc.h
index 031dd4d3c766..760db08a67fc 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
*/
+#ifdef CONFIG_IMX_SCU
int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
u8 ctrl, u32 val);
@@ -54,5 +55,23 @@ 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 -ENOTSUPP;
+}
+static inline int imx_sc_misc_get_control(struct imx_sc_ipc *ipc,
+ u32 resource, u8 ctrl, u32 *val)
+{
+ return -ENOTSUPP;
+}
+
+static inline int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
+ bool enable, u64 phys_addr)
+{
+ return -ENOTSUPP;
+}
+#endif
#endif /* _SC_MISC_API_H */
--
2.16.4
On Fri, Feb 21, 2020 at 10:32:17AM +0800, [email protected] wrote:
> From: Peng Fan <[email protected]>
>
> V5:
> Add missed "static inline" in misc.h
>
> V4:
> Add dummy functions to fix build issue when soc-imx-scu.c built in,
> but drivers/firmware/imx/imx-scu.c not built in.
> No change to Patch 2/2.
>
> V3:
> Per Arnd's suggestions, merged Patch 2/3/4/5 into one patch
> Dropped the defconfig change with a default Kconfig
>
> Leonard, I dropped you R-b in V3 since the change.
>
> V2:
> Include Leonard's patch to fix build break after enable compile test
> Add Leonard's R-b tag
>
> Rename soc-imx8.c to soc-imx8m.c which is for i.MX8M family
> Add SOC_IMX8M for build gate soc-imx8m.c
> Increase build coverage for i.MX SoC driver
>
> Peng Fan (2):
> firmware: imx: add dummy functions
> soc: imx: increase build coverage for imx8m soc driver
Applied both, thanks.