Skip to content

Commit cc93d24

Browse files
authored
PTL Alpha release kernel 6.14 Ubuntu 24.04 (LT6911GXD)(iot)
2 parents ffcbb11 + 1c46221 commit cc93d24

41 files changed

Lines changed: 2010 additions & 762 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ Three ways are available:
4343
CONFIG_VIDEO_OV02C10=m
4444
CONFIG_VIDEO_OV05C10=m
4545
```
46+
```conf
47+
To enable HDMI2MIPI camera:
48+
CONFIG_VIDEO_INTEL_IPU7_ISYS_RESET=y
49+
CONFIG_VIDEO_LT6911GXD=m
50+
```
4651
5. Build you kernel
4752

4853
### 2. Out-of-tree build
Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
config VIDEO_INTEL_IPU7
22
tristate "Intel IPU7 driver"
3-
depends on ACPI
4-
depends on MEDIA_SUPPORT
5-
depends on MEDIA_PCI_SUPPORT
6-
depends on X86_64
7-
select IOMMU_API
3+
depends on ACPI || COMPILE_TEST
4+
depends on VIDEO_DEV
5+
depends on X86 && HAS_DMA
6+
depends on IPU_BRIDGE || !IPU_BRIDGE
7+
#
8+
# This driver incorrectly tries to override the dma_ops. It should
9+
# never have done that, but for now keep it working on architectures
10+
# that use dma ops
11+
#
12+
depends on ARCH_HAS_DMA_OPS
13+
select AUXILIARY_BUS
814
select IOMMU_IOVA
9-
select X86_DEV_DMA_OPS
10-
select VIDEOBUF2_DMA_CONTIG
15+
select VIDEO_V4L2_SUBDEV_API
16+
select MEDIA_CONTROLLER
17+
select VIDEOBUF2_DMA_SG
1118
select V4L2_FWNODE
12-
select PHYS_ADDR_T_64BIT
13-
select COMMON_CLK
1419
help
15-
This is the Intel imaging processing unit, found in Intel SoCs and
16-
used for capturing images and video from a camera sensor.
20+
This is the 7th Gen Intel Image Processing Unit, found in Intel SoCs
21+
and used for capturing images and video from camera sensors.
1722

1823
To compile this driver, say Y here! It contains 3 modules -
1924
intel_ipu7, intel_ipu7_isys and intel_ipu7_psys.
@@ -30,11 +35,11 @@ config VIDEO_INTEL_IPU7_MGC
3035
you must select this option, otherwise no.
3136

3237
config VIDEO_INTEL_IPU7_ISYS_RESET
33-
tristate "IPU7 ISYS RESET"
38+
bool "IPU7 ISYS RESET"
3439
depends on VIDEO_INTEL_IPU7
3540
default n
3641
help
37-
This is to support ISYS reset in Intel IPU7 IPU driver and
38-
used for HDMI to MIPI device hot plug use cases.
42+
This option enables IPU7 ISYS reset feature to support
43+
HDMI-MIPI converter hot-plugging.
3944

40-
To compile this driver, say Y here!
45+
If doubt, say N here.

drivers/media/pci/intel/ipu7/ipu7-boot.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "ipu7-boot.h"
2020
#include "ipu7-bus.h"
2121
#include "ipu7-buttress-regs.h"
22+
#include "ipu7-dma.h"
2223
#include "ipu7-platform-regs.h"
2324
#include "ipu7-syscom.h"
2425

@@ -56,9 +57,9 @@ static const struct ipu7_boot_context contexts[IPU_SUBSYS_NUM] = {
5657
static u32 get_fw_boot_reg_addr(const struct ipu7_bus_device *adev,
5758
enum ia_gofo_buttress_reg_id reg)
5859
{
59-
u32 base = (adev->subsys == IPU_IS) ? 0 : IA_GOFO_FW_BOOT_ID_MAX;
60+
u32 base = (adev->subsys == IPU_IS) ? 0U : (u32)IA_GOFO_FW_BOOT_ID_MAX;
6061

61-
return BUTTRESS_FW_BOOT_PARAMS_ENTRY(base + reg);
62+
return BUTTRESS_FW_BOOT_PARAMS_ENTRY(base + (u32)reg);
6263
}
6364

6465
static void write_fw_boot_param(const struct ipu7_bus_device *adev,
@@ -105,7 +106,7 @@ static int ipu7_boot_cell_reset(const struct ipu7_bus_device *adev)
105106
writel(val, base + ucx_ctrl_status);
106107

107108
ret = readl_poll_timeout(base + ucx_ctrl_status, val2,
108-
(val2 & 0x3) == (val & 0x3), 100, timeout);
109+
(val2 & 0x3U) == (val & 0x3U), 100, timeout);
109110
if (ret) {
110111
dev_err(dev, "cell enter reset timeout. status: 0x%x\n", val2);
111112
return -ETIMEDOUT;
@@ -122,7 +123,7 @@ static int ipu7_boot_cell_reset(const struct ipu7_bus_device *adev)
122123
writel(val, base + ucx_ctrl_status);
123124

124125
ret = readl_poll_timeout(base + ucx_ctrl_status, val2,
125-
(val2 & 0x3) == (val & 0x3), 100, timeout);
126+
(val2 & 0x3U) == (val & 0x3U), 100, timeout);
126127
if (ret) {
127128
dev_err(dev, "cell exit reset timeout. status: 0x%x\n", val2);
128129
return -ETIMEDOUT;
@@ -224,9 +225,9 @@ int ipu7_boot_init_boot_config(struct ipu7_bus_device *adev,
224225
/* Allocate boot config. */
225226
adev->boot_config_size =
226227
sizeof(*cfgs) * num_queues + sizeof(*boot_config);
227-
adev->boot_config = dma_alloc_attrs(dev, adev->boot_config_size,
228-
&adev->boot_config_dma_addr,
229-
GFP_KERNEL, 0);
228+
adev->boot_config = ipu7_dma_alloc(adev, adev->boot_config_size,
229+
&adev->boot_config_dma_addr,
230+
GFP_KERNEL, 0);
230231
if (!adev->boot_config) {
231232
dev_err(dev, "Failed to allocate boot config.\n");
232233
return -ENOMEM;
@@ -245,8 +246,8 @@ int ipu7_boot_init_boot_config(struct ipu7_bus_device *adev,
245246
boot_config->syscom_context_config.max_input_queues =
246247
syscom->num_input_queues;
247248

248-
dma_sync_single_for_device(dev, adev->boot_config_dma_addr,
249-
adev->boot_config_size, DMA_TO_DEVICE);
249+
ipu7_dma_sync_single(adev, adev->boot_config_dma_addr,
250+
adev->boot_config_size);
250251

251252
for (i = 0; i < num_queues; i++) {
252253
u32 queue_size = qconfigs[i].max_capacity *
@@ -259,9 +260,9 @@ int ipu7_boot_init_boot_config(struct ipu7_bus_device *adev,
259260
}
260261

261262
/* Allocate queue memory */
262-
syscom->queue_mem = dma_alloc_attrs(dev, total_queue_size_aligned,
263-
&syscom->queue_mem_dma_addr,
264-
GFP_KERNEL, 0);
263+
syscom->queue_mem = ipu7_dma_alloc(adev, total_queue_size_aligned,
264+
&syscom->queue_mem_dma_addr,
265+
GFP_KERNEL, 0);
265266
if (!syscom->queue_mem) {
266267
dev_err(dev, "Failed to allocate queue memory.\n");
267268
return -ENOMEM;
@@ -281,8 +282,8 @@ int ipu7_boot_init_boot_config(struct ipu7_bus_device *adev,
281282
queue_mem_ptr += qconfigs[i].queue_size;
282283
}
283284

284-
dma_sync_single_for_device(dev, syscom->queue_mem_dma_addr,
285-
total_queue_size_aligned, DMA_TO_DEVICE);
285+
ipu7_dma_sync_single(adev, syscom->queue_mem_dma_addr,
286+
total_queue_size_aligned);
286287

287288
return 0;
288289
}
@@ -295,20 +296,19 @@ EXPORT_SYMBOL_NS_GPL(ipu7_boot_init_boot_config, INTEL_IPU7);
295296
void ipu7_boot_release_boot_config(struct ipu7_bus_device *adev)
296297
{
297298
struct ipu7_syscom_context *syscom = adev->syscom;
298-
struct device *dev = &adev->auxdev.dev;
299299

300300
if (syscom->queue_mem) {
301-
dma_free_attrs(dev, syscom->queue_mem_size,
302-
syscom->queue_mem,
303-
syscom->queue_mem_dma_addr, 0);
301+
ipu7_dma_free(adev, syscom->queue_mem_size,
302+
syscom->queue_mem,
303+
syscom->queue_mem_dma_addr, 0);
304304
syscom->queue_mem = NULL;
305305
syscom->queue_mem_dma_addr = 0;
306306
}
307307

308308
if (adev->boot_config) {
309-
dma_free_attrs(dev, adev->boot_config_size,
310-
adev->boot_config,
311-
adev->boot_config_dma_addr, 0);
309+
ipu7_dma_free(adev, adev->boot_config_size,
310+
adev->boot_config,
311+
adev->boot_config_dma_addr, 0);
312312
adev->boot_config = NULL;
313313
adev->boot_config_dma_addr = 0;
314314
}

drivers/media/pci/intel/ipu7/ipu7-boot.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
3-
* Copyright (C) 2022 - 2024 Intel Corporation
3+
* Copyright (C) 2022 - 2025 Intel Corporation
44
*/
55

6+
#ifndef IPU7_BOOT_H
7+
#define IPU7_BOOT_H
8+
69
#include <linux/types.h>
710

811
struct ipu7_bus_device;
@@ -19,3 +22,4 @@ void ipu7_boot_release_boot_config(struct ipu7_bus_device *adev);
1922
int ipu7_boot_start_fw(const struct ipu7_bus_device *adev);
2023
int ipu7_boot_stop_fw(const struct ipu7_bus_device *adev);
2124
u32 ipu7_boot_get_boot_state(const struct ipu7_bus_device *adev);
25+
#endif

drivers/media/pci/intel/ipu7/ipu7-bus.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static void ipu7_bus_release(struct device *dev)
8282
struct ipu7_bus_device *
8383
ipu7_bus_initialize_device(struct pci_dev *pdev, struct device *parent,
8484
void *pdata, const struct ipu_buttress_ctrl *ctrl,
85-
char *name)
85+
const char *name)
8686
{
8787
struct auxiliary_device *auxdev;
8888
struct ipu7_bus_device *adev;
@@ -93,11 +93,6 @@ ipu7_bus_initialize_device(struct pci_dev *pdev, struct device *parent,
9393
if (!adev)
9494
return ERR_PTR(-ENOMEM);
9595

96-
if (isp->secure_mode)
97-
adev->dma_mask = DMA_BIT_MASK(IPU_MMU_ADDR_BITS);
98-
else
99-
adev->dma_mask = DMA_BIT_MASK(IPU_MMU_ADDR_BITS_NON_SECURE);
100-
10196
adev->isp = isp;
10297
adev->ctrl = ctrl;
10398
adev->pdata = pdata;
@@ -108,10 +103,6 @@ ipu7_bus_initialize_device(struct pci_dev *pdev, struct device *parent,
108103

109104
auxdev->dev.parent = parent;
110105
auxdev->dev.release = ipu7_bus_release;
111-
auxdev->dev.dma_ops = &ipu7_dma_ops;
112-
auxdev->dev.dma_mask = &adev->dma_mask;
113-
auxdev->dev.dma_parms = pdev->dev.dma_parms;
114-
auxdev->dev.coherent_dma_mask = adev->dma_mask;
115106

116107
ret = auxiliary_device_init(auxdev);
117108
if (ret < 0) {

drivers/media/pci/intel/ipu7/ipu7-bus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct ipu7_auxdrv_data {
6363
struct ipu7_bus_device *
6464
ipu7_bus_initialize_device(struct pci_dev *pdev, struct device *parent,
6565
void *pdata, const struct ipu_buttress_ctrl *ctrl,
66-
char *name);
66+
const char *name);
6767
int ipu7_bus_add_device(struct ipu7_bus_device *adev);
6868
void ipu7_bus_del_devices(struct pci_dev *pdev);
6969
#endif

drivers/media/pci/intel/ipu7/ipu7-buttress-regs.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ enum {
289289

290290
#define BUTTRESS_TSC_CMD_START_TSC_SYNC BIT(0)
291291
#define BUTTRESS_PWR_STATUS_HH_STATUS_SHIFT 11
292-
#define BUTTRESS_PWR_STATUS_HH_STATUS_MASK (0x3 << 11)
292+
#define BUTTRESS_PWR_STATUS_HH_STATUS_MASK (0x3U << 11)
293293
#define BUTTRESS_TSW_WA_SOFT_RESET BIT(8)
294294
/* new for PTL */
295295
#define BUTTRESS_SEL_PB_TIMESTAMP BIT(9)
@@ -328,8 +328,8 @@ enum {
328328
#define BUTTRESS_CSE2IUDATA0_IPC_NACK_MASK 0xffff
329329

330330
/* IS/PS freq control */
331-
#define BUTTRESS_IS_FREQ_CTL_RATIO_MASK 0xff
332-
#define BUTTRESS_PS_FREQ_CTL_RATIO_MASK 0xff
331+
#define BUTTRESS_IS_FREQ_CTL_RATIO_MASK 0xffU
332+
#define BUTTRESS_PS_FREQ_CTL_RATIO_MASK 0xffU
333333
#define BUTTRESS_IS_FREQ_CTL_CDYN_MASK 0xff
334334
#define BUTTRESS_PS_FREQ_CTL_CDYN_MASK 0xff
335335

@@ -354,11 +354,11 @@ enum {
354354
/* buttree power status */
355355
#define IPU_BUTTRESS_PWR_STATE_IS_PWR_SHIFT 0
356356
#define IPU_BUTTRESS_PWR_STATE_IS_PWR_MASK \
357-
(0x3 << IPU_BUTTRESS_PWR_STATE_IS_PWR_SHIFT)
357+
(0x3U << IPU_BUTTRESS_PWR_STATE_IS_PWR_SHIFT)
358358

359359
#define IPU_BUTTRESS_PWR_STATE_PS_PWR_SHIFT 4
360360
#define IPU_BUTTRESS_PWR_STATE_PS_PWR_MASK \
361-
(0x3 << IPU_BUTTRESS_PWR_STATE_PS_PWR_SHIFT)
361+
(0x3U << IPU_BUTTRESS_PWR_STATE_PS_PWR_SHIFT)
362362

363363
#define IPU_BUTTRESS_PWR_STATE_DN_DONE 0x0
364364
#define IPU_BUTTRESS_PWR_STATE_UP_PROCESS 0x1

0 commit comments

Comments
 (0)