diff mbox series

[v2,12/15] media: add Kconfig and Makefile for IPU6

Message ID 20231024112924.3934228-13-bingbu.cao@intel.com (mailing list archive)
State New, archived
Headers show
Series Intel IPU6 and IPU6 input system drivers | expand

Commit Message

Bingbu Cao Oct. 24, 2023, 11:29 a.m. UTC
From: Bingbu Cao <bingbu.cao@intel.com>

Add IPU6 support in Kconfig and Makefile, with this patch you can
build the Intel IPU6 and input system modules by select the
CONFIG_VIDEO_INTEL_IPU6 in config.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Andreas Helbech Kleist <andreaskleist@gmail.com>
---
 drivers/media/pci/intel/Kconfig       |  1 +
 drivers/media/pci/intel/Makefile      |  1 +
 drivers/media/pci/intel/ipu6/Kconfig  | 17 +++++++++++++++++
 drivers/media/pci/intel/ipu6/Makefile | 23 +++++++++++++++++++++++
 4 files changed, 42 insertions(+)
 create mode 100644 drivers/media/pci/intel/ipu6/Kconfig
 create mode 100644 drivers/media/pci/intel/ipu6/Makefile

Comments

Andy Shevchenko Oct. 24, 2023, 1:04 p.m. UTC | #1
On Tue, Oct 24, 2023 at 07:29:21PM +0800, bingbu.cao@intel.com wrote:
> From: Bingbu Cao <bingbu.cao@intel.com>
> 
> Add IPU6 support in Kconfig and Makefile, with this patch you can
> build the Intel IPU6 and input system modules by select the
> CONFIG_VIDEO_INTEL_IPU6 in config.

...

> +	depends on X86 && X86_64

How is that? One is a superset of the other IIUC.

...

> +intel-ipu6-objs				+= ipu6.o \

+= doesn't seem right.
Besides that 'objs' is for user space, in kernel we use 'y'.

> +					ipu6-bus.o \
> +					ipu6-dma.o \
> +					ipu6-mmu.o \
> +					ipu6-buttress.o \
> +					ipu6-cpd.o \
> +					ipu6-fw-com.o
> +
> +obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6.o
> +
> +intel-ipu6-isys-objs			+= ipu6-isys.o \

Ditto.

> +					ipu6-isys-csi2.o \
> +					ipu6-fw-isys.o \
> +					ipu6-isys-video.o \
> +					ipu6-isys-queue.o \
> +					ipu6-isys-subdev.o \
> +					ipu6-isys-mcd-phy.o \
> +					ipu6-isys-jsl-phy.o \
> +					ipu6-isys-dwc-phy.o
> +
> +obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6-isys.o
Bingbu Cao Oct. 25, 2023, 8:43 a.m. UTC | #2
Andy,

Thanks for the review.

On 10/24/23 9:04 PM, Andy Shevchenko wrote:
> On Tue, Oct 24, 2023 at 07:29:21PM +0800, bingbu.cao@intel.com wrote:
>> From: Bingbu Cao <bingbu.cao@intel.com>
>>
>> Add IPU6 support in Kconfig and Makefile, with this patch you can
>> build the Intel IPU6 and input system modules by select the
>> CONFIG_VIDEO_INTEL_IPU6 in config.
> 
> ...
> 
>> +	depends on X86 && X86_64
> 
> How is that? One is a superset of the other IIUC.

It's trying to prevent build IPU6 with other arch such as 'UM'.

# make W=1 O=build_dir ARCH=um olddefconfig
ipu6-dma.c:... error: implicit declaration of function 'clflush_cache_range';

X86_64 looks like not an actual architecture.

> 
> ...
> 
>> +intel-ipu6-objs				+= ipu6.o \
> 
> += doesn't seem right.
> Besides that 'objs' is for user space, in kernel we use 'y'.
> 
>> +					ipu6-bus.o \
>> +					ipu6-dma.o \
>> +					ipu6-mmu.o \
>> +					ipu6-buttress.o \
>> +					ipu6-cpd.o \
>> +					ipu6-fw-com.o
>> +
>> +obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6.o
>> +
>> +intel-ipu6-isys-objs			+= ipu6-isys.o \
> 
> Ditto.

Ack.

> 
>> +					ipu6-isys-csi2.o \
>> +					ipu6-fw-isys.o \
>> +					ipu6-isys-video.o \
>> +					ipu6-isys-queue.o \
>> +					ipu6-isys-subdev.o \
>> +					ipu6-isys-mcd-phy.o \
>> +					ipu6-isys-jsl-phy.o \
>> +					ipu6-isys-dwc-phy.o
>> +
>> +obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6-isys.o
>
Sakari Ailus Oct. 25, 2023, 12:21 p.m. UTC | #3
Hi Andy,

On Tue, Oct 24, 2023 at 04:04:05PM +0300, Andy Shevchenko wrote:
> On Tue, Oct 24, 2023 at 07:29:21PM +0800, bingbu.cao@intel.com wrote:
> > From: Bingbu Cao <bingbu.cao@intel.com>
> > 
> > Add IPU6 support in Kconfig and Makefile, with this patch you can
> > build the Intel IPU6 and input system modules by select the
> > CONFIG_VIDEO_INTEL_IPU6 in config.
> 
> ...
> 
> > +	depends on X86 && X86_64
> 
> How is that? One is a superset of the other IIUC.
> 
> ...
> 
> > +intel-ipu6-objs				+= ipu6.o \
> 
> += doesn't seem right.
> Besides that 'objs' is for user space, in kernel we use 'y'.

This is a common pattern used in other Makefiles, too... I guess ":=" would
work, too.

How otherwise would you do this?

It'd be nice to align the object names starting after the column after
"+= ".

> 
> > +					ipu6-bus.o \
> > +					ipu6-dma.o \
> > +					ipu6-mmu.o \
> > +					ipu6-buttress.o \
> > +					ipu6-cpd.o \
> > +					ipu6-fw-com.o
> > +
> > +obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6.o
> > +
> > +intel-ipu6-isys-objs			+= ipu6-isys.o \
> 
> Ditto.
> 
> > +					ipu6-isys-csi2.o \
> > +					ipu6-fw-isys.o \
> > +					ipu6-isys-video.o \
> > +					ipu6-isys-queue.o \
> > +					ipu6-isys-subdev.o \
> > +					ipu6-isys-mcd-phy.o \
> > +					ipu6-isys-jsl-phy.o \
> > +					ipu6-isys-dwc-phy.o
> > +
> > +obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6-isys.o
>
Andy Shevchenko Oct. 25, 2023, 8 p.m. UTC | #4
On Wed, Oct 25, 2023 at 04:43:16PM +0800, Bingbu Cao wrote:
> On 10/24/23 9:04 PM, Andy Shevchenko wrote:
> > On Tue, Oct 24, 2023 at 07:29:21PM +0800, bingbu.cao@intel.com wrote:

...
> > 
> >> +	depends on X86 && X86_64
> > 
> > How is that? One is a superset of the other IIUC.
> 
> It's trying to prevent build IPU6 with other arch such as 'UM'.
> 
> # make W=1 O=build_dir ARCH=um olddefconfig
> ipu6-dma.c:... error: implicit declaration of function 'clflush_cache_range';

Is UM ever supported 64-bit builds?

> X86_64 looks like not an actual architecture.

How comes?
Andy Shevchenko Oct. 25, 2023, 8:01 p.m. UTC | #5
On Wed, Oct 25, 2023 at 12:21:13PM +0000, Sakari Ailus wrote:
> On Tue, Oct 24, 2023 at 04:04:05PM +0300, Andy Shevchenko wrote:
> > On Tue, Oct 24, 2023 at 07:29:21PM +0800, bingbu.cao@intel.com wrote:

...

> > > +intel-ipu6-objs				+= ipu6.o \
> > 
> > += doesn't seem right.
> > Besides that 'objs' is for user space, in kernel we use 'y'.
> 
> This is a common pattern used in other Makefiles, too... I guess ":=" would
> work, too.
> 
> How otherwise would you do this?

:= has different meaning in make language. How you will guarantee somewhere
else somebody won't use same target, note that make is recursive.
diff mbox series

Patch

diff --git a/drivers/media/pci/intel/Kconfig b/drivers/media/pci/intel/Kconfig
index ee4684159d3d..04cb3d253486 100644
--- a/drivers/media/pci/intel/Kconfig
+++ b/drivers/media/pci/intel/Kconfig
@@ -1,6 +1,7 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
 
 source "drivers/media/pci/intel/ipu3/Kconfig"
+source "drivers/media/pci/intel/ipu6/Kconfig"
 source "drivers/media/pci/intel/ivsc/Kconfig"
 
 config IPU_BRIDGE
diff --git a/drivers/media/pci/intel/Makefile b/drivers/media/pci/intel/Makefile
index f199a97e1d78..3a2cc6567159 100644
--- a/drivers/media/pci/intel/Makefile
+++ b/drivers/media/pci/intel/Makefile
@@ -5,3 +5,4 @@ 
 obj-$(CONFIG_IPU_BRIDGE) += ipu-bridge.o
 obj-y	+= ipu3/
 obj-y	+= ivsc/
+obj-$(CONFIG_VIDEO_INTEL_IPU6)	+= ipu6/
diff --git a/drivers/media/pci/intel/ipu6/Kconfig b/drivers/media/pci/intel/ipu6/Kconfig
new file mode 100644
index 000000000000..5cb4f3c2d59f
--- /dev/null
+++ b/drivers/media/pci/intel/ipu6/Kconfig
@@ -0,0 +1,17 @@ 
+config VIDEO_INTEL_IPU6
+	tristate "Intel IPU6 driver"
+	depends on ACPI || COMPILE_TEST
+	depends on MEDIA_SUPPORT
+	depends on MEDIA_PCI_SUPPORT
+	depends on X86 && X86_64
+	select IOMMU_IOVA
+	select VIDEO_V4L2_SUBDEV_API
+	select VIDEOBUF2_DMA_CONTIG
+	select V4L2_FWNODE
+	select IPU_BRIDGE
+	help
+	  This is the 6th Gen Intel Image Processing Unit, found in Intel SoCs
+	  and used for capturing images and video from camera sensors.
+
+	  To compile this driver, say Y here! It contains 2 modules -
+	  intel_ipu6 and intel_ipu6_isys.
diff --git a/drivers/media/pci/intel/ipu6/Makefile b/drivers/media/pci/intel/ipu6/Makefile
new file mode 100644
index 000000000000..6a6339c84ef4
--- /dev/null
+++ b/drivers/media/pci/intel/ipu6/Makefile
@@ -0,0 +1,23 @@ 
+# SPDX-License-Identifier: GPL-2.0-only
+
+intel-ipu6-objs				+= ipu6.o \
+					ipu6-bus.o \
+					ipu6-dma.o \
+					ipu6-mmu.o \
+					ipu6-buttress.o \
+					ipu6-cpd.o \
+					ipu6-fw-com.o
+
+obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6.o
+
+intel-ipu6-isys-objs			+= ipu6-isys.o \
+					ipu6-isys-csi2.o \
+					ipu6-fw-isys.o \
+					ipu6-isys-video.o \
+					ipu6-isys-queue.o \
+					ipu6-isys-subdev.o \
+					ipu6-isys-mcd-phy.o \
+					ipu6-isys-jsl-phy.o \
+					ipu6-isys-dwc-phy.o
+
+obj-$(CONFIG_VIDEO_INTEL_IPU6)		+= intel-ipu6-isys.o