From patchwork Wed Apr 16 12:09:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 881667 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 387572472AF for ; Wed, 16 Apr 2025 12:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805358; cv=none; b=qUdYZxBCCU8G3WJ49nX8VEaPW9FwguKAb7INI7uStsMvq02UpE5gTALy9rvDaeprJ7CUYaVzbnAv0hWJBOimAL2XJR9l6MmlNmK/rJKPWQlECFf3/7KXx1cxvR7S0xzY+3KkJJoelM7PoI4/lOA+a3O4ap+EvK9ld0d59+VzhmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805358; c=relaxed/simple; bh=Fsq3IsfRfLPhpH89xl1+2GZ2fe7G6A+M3L1l9JzPvvE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Mf3KN1/XZg3ItqYfUSVHsK79Kqgt2EfQ5yKOcnWDmidf94DJTESi6QP2WvKs7OTsIKm97TpQZ7XAihitV9BPXAA0gqLCQ3g/aWJclTmgTE0oTTUdRh0jgqRQsHNayGT7x3RbL2tjQCH30MKffkZlMLK7tcKSmj4NZsb4J80X2iA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ovyhz738; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ovyhz738" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mIPk029930 for ; Wed, 16 Apr 2025 12:09:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=DAL8uahlk04w/X75KcEckyyZ62fJkoZs++N zriOmaKo=; b=ovyhz7381tNcFwMOzBDeTIAgUzJEjUKngF2XVmkEAErGyywF4XW 8NjcK4MJC23CaDT5QjoHl07vkoCkrCBKV/00ma2EIUeLZs1XXpcP2HXlVTtRoubY GsRAc3VHWz2eg6phzaSkpE4RScy4z7CckFnGoBcL3rgpUm9pOiiOupw9VJCgUGQ0 VmJFq3wZbih0YyLntIdv8cz39vwbTWIX9xg5/ZVy4QvRh9PxrntpKNtquv3TuDwT RUB4sA6x4kcR0dZVhhoYge7ZWH9tmsvAW0VZ1fv5DOzqz6ZExR8zMDXLXJV/ND6N 3fQt4HhhGb94lD0AASBxlKL2qIs9kGpVrPw== Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45ygxk3aq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 12:09:15 +0000 (GMT) Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-72e313f527cso5560470a34.3 for ; Wed, 16 Apr 2025 05:09:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744805354; x=1745410154; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DAL8uahlk04w/X75KcEckyyZ62fJkoZs++NzriOmaKo=; b=v2qGCjskFhPIvu0ZjEcAVS28bt9MlJTtCEwmoTmADBM5IkAClT2OEhmZ7FckqXwSOj zO6hR1kF4lMSgA8JfwpU+6WRcZvGUap4FNP/x2UeV50ulJ5C+CZUoyl8NecAHC0J8lCX wqJe4Lm3Ne1BmJBYjjDRhc0AtaUn0sIWqT1JYC+FCY/59Y0O//0l99wZNxthuJBoYyGj LbmgggFf20Jy9HxOZUyGLx1OEqZubOGN6v4wSYTOACeZ4vZs50DZSuhxnCJhHy8XrerR HZfCPD/zBEO8eNCKE15aiSgPOvUvcGkZoasbVQv/cmyX5cSmxgEuGMdRZTErj0/cP/xb ofYQ== X-Gm-Message-State: AOJu0YyVsp5XeyY/dbY/HbZNWAImZ2rOBriLU3esrfHBZEtcLVRZ2Qr6 3csctpTz+hX8sWCPvIIghYMGBAr8++dM0qiOjKPTuphpP2QrLYRmjySG0Sq595D0G/5l1hgjC5y hj/ql7DhkcGbNQGpZQ9tACcdU7AgMGaYQVlXiNarXE12oK7Z5blAPJSX7b+gaww3x X-Gm-Gg: ASbGncvSWKZmbcupbtNtPxFQIsqsx41BuV7gIkh/GRaAU/57Rkh4hQi19LtuTEEhCB1 n5Pnp0GnYeFCHAClp+1IPHEYpOYlWVxUud8VifNQ8kJuIScDhfGyVoiLLggrqwIKJru4k5gAmSr qBfW7VYw6IhTTfNj/MqOZP5d7X9qFe9eeZ6zI0WBmrhBnr3IuRKJW3bPlyPMEzS/cuategD8NDg 1LwWx/PQ6ad6asICJ8rUny38okWDSOagFuMYGlDzgUhdwRCcJ2z+ihvCZRrPKhRH+7VA1dyVBYQ R+J1yGkKvIaV50yWM6eSAMzJ0/onyVXt1/WTg6wLeXz+Nic= X-Received: by 2002:a05:6830:6083:b0:727:24ab:3e4 with SMTP id 46e09a7af769-72ec6bc4d44mr775267a34.9.1744805354054; Wed, 16 Apr 2025 05:09:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaF53FRT62RBJCX7ZF6q40OSXW0Zxg0SBHfuynnj3vXP0zFvThAr7UVjvQrhU21Wf2AhcTIw== X-Received: by 2002:a05:6830:6083:b0:727:24ab:3e4 with SMTP id 46e09a7af769-72ec6bc4d44mr775245a34.9.1744805353614; Wed, 16 Apr 2025 05:09:13 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.qualcomm.com ([2a01:e0a:82c:5f0:15e4:d866:eb53:4185]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f36f068968sm8328669a12.35.2025.04.16.05.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 05:09:13 -0700 (PDT) From: Loic Poulain To: bryan.odonoghue@linaro.org, rfoss@kernel.org, konradybcio@kernel.org, andersson@kernel.org, krzk+dt@kernel.org, robh@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, Loic Poulain Subject: [PATCH 1/6] media: qcom: camss: Add support for TFE (Spectra 340) Date: Wed, 16 Apr 2025 14:09:03 +0200 Message-Id: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=WecMa1hX c=1 sm=1 tr=0 ts=67ff9deb cx=c_pps a=OI0sxtj7PyCX9F1bxD/puw==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=QcRrIoSkKhIA:10 a=EUspDBNiAAAA:8 a=3N2MxXviChhTLmTrQkMA:9 a=IZ6BfI08DC7DjxxD:21 a=Z1Yy7GAxqfX1iEi80vsk:22 X-Proofpoint-GUID: ire3rt7vxQcPxsDVdo0_5duDNv2ijyaL X-Proofpoint-ORIG-GUID: ire3rt7vxQcPxsDVdo0_5duDNv2ijyaL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160099 Add support for TFE (Thin Front End) found in QCM2290. Signed-off-by: Loic Poulain --- drivers/media/platform/qcom/camss/Makefile | 1 + .../media/platform/qcom/camss/camss-vfe-340.c | 281 ++++++++++++++++++ drivers/media/platform/qcom/camss/camss-vfe.h | 1 + 3 files changed, 283 insertions(+) create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-340.c diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile index d26a9c24a430..719898f5d32b 100644 --- a/drivers/media/platform/qcom/camss/Makefile +++ b/drivers/media/platform/qcom/camss/Makefile @@ -17,6 +17,7 @@ qcom-camss-objs += \ camss-vfe-4-7.o \ camss-vfe-4-8.o \ camss-vfe-17x.o \ + camss-vfe-340.o \ camss-vfe-480.o \ camss-vfe-680.o \ camss-vfe-780.o \ diff --git a/drivers/media/platform/qcom/camss/camss-vfe-340.c b/drivers/media/platform/qcom/camss/camss-vfe-340.c new file mode 100644 index 000000000000..fc454d66e1d2 --- /dev/null +++ b/drivers/media/platform/qcom/camss/camss-vfe-340.c @@ -0,0 +1,281 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module 340 (TFE) + * + * Copyright (c) 2025 Qualcomm Technologies, Inc. + */ + +#include +#include +#include +#include + +#include "camss.h" +#include "camss-vfe.h" + +#define TFE_GLOBAL_RESET_CMD (0x014) +#define TFE_GLOBAL_RESET_CMD_CORE BIT(0) + +#define TFE_REG_UPDATE_CMD (0x02C) + +#define TFE_IRQ_CMD (0x030) +#define TFE_IRQ_CMD_CLEAR BIT(0) +#define TFE_IRQ_MASK_0 (0x034) +#define TFE_IRQ_MASK_0_RST_DONE BIT(0) +#define TFE_IRQ_MASK_0_BUS_WR BIT(1) +#define TFE_IRQ_MASK_1 (0x038) +#define TFE_IRQ_MASK_2 (0x03c) +#define TFE_IRQ_CLEAR_0 (0x040) + +#define TFE_IRQ_STATUS_0 (0x04c) + +#define BUS_REG(a) (0xa00 + (a)) + +#define TFE_BUS_IRQ_MASK_0 BUS_REG(0x18) +#define TFE_BUS_IRQ_MASK_RUP_DONE_ALL 0x000f +#define TFE_BUS_IRQ_MASK_RUP_DONE(src) BIT(src) +#define TFE_BUS_IRQ_MASK_BUF_DONE_ALL 0xff00 +#define TFE_BUS_IRQ_MASK_BUF_DONE(sg) BIT((sg) + 8) +#define TFE_BUS_IRQ_MASK_0_CONS_VIOL BIT(28) +#define TFE_BUS_IRQ_MASK_0_VIOL BIT(30) +#define TFE_BUS_IRQ_MASK_0_IMG_VIOL BIT(31) + +#define TFE_BUS_IRQ_MASK_1 BUS_REG(0x1C) +#define TFE_BUS_IRQ_CLEAR_0 BUS_REG(0x20) +#define TFE_BUS_IRQ_STATUS_0 BUS_REG(0x28) +#define TFE_BUS_IRQ_CMD BUS_REG(0x30) +#define TFE_BUS_IRQ_CMD_CLEAR BIT(0) + +#define TFE_BUS_STATUS_CLEAR BUS_REG(0x60) +#define TFE_BUS_VIOLATION_STATUS BUS_REG(0x64) +#define TFE_BUS_OVERFLOW_STATUS BUS_REG(0x68) +#define TFE_BUS_IMAGE_SZ_VIOLATION_STATUS BUS_REG(0x70) + +#define TFE_BUS_CLIENT_CFG(c) BUS_REG(0x200 + (c) * 0x100) +#define TFE_BUS_CLIENT_CFG_EN BIT(0) +#define TFE_BUS_CLIENT_CFG_MODE_FRAME BIT(16) +#define TFE_BUS_IMAGE_ADDR(c) BUS_REG(0x204 + (c) * 0x100) +#define TFE_BUS_FRAME_INCR(c) BUS_REG(0x208 + (c) * 0x100) +#define TFE_BUS_IMAGE_CFG_0(c) BUS_REG(0x20C + (c) * 0x100) +#define TFE_BUS_IMAGE_CFG_0_DEFAULT 0xffff +#define TFE_BUS_IMAGE_CFG_1(c) BUS_REG(0x210 + (c) * 0x100) +#define TFE_BUS_IMAGE_CFG_2(c) BUS_REG(0x214 + (c) * 0x100) +#define TFE_BUS_IMAGE_CFG_2_DEFAULT 0xffff +#define TFE_BUS_PACKER_CFG(c) BUS_REG(0x218 + (c) * 0x100) +#define TFE_BUS_PACKER_CFG_FMT_PLAIN64 0xa +#define TFE_BUS_IRQ_SUBSAMPLE_CFG_0(c) BUS_REG(0x230 + (c) * 0x100) +#define TFE_BUS_IRQ_SUBSAMPLE_CFG_1(c) BUS_REG(0x234 + (c) * 0x100) +#define TFE_BUS_FRAMEDROP_CFG_0(c) BUS_REG(0x238 + (c) * 0x100) +#define TFE_BUS_FRAMEDROP_CFG_1(c) BUS_REG(0x23c + (c) * 0x100) + +#define RDI_CLIENT(n) (7 + (n)) +#define TFE_SOURCES_NUM 4 +#define TFE_SUBGROUPS_NUM 8 +#define TFE_CLIENTS_NUM 10 + +static inline unsigned int __regupdate_iface(enum vfe_line_id line_id) +{ + switch (line_id) { + case VFE_LINE_RDI0: + return 1; + case VFE_LINE_RDI1: + return 2; + case VFE_LINE_RDI2: + return 3; + case VFE_LINE_PIX: + default: + return 0; + } +} + +static inline unsigned int __regupdate_line(unsigned int iface) +{ + if (!iface) + return VFE_LINE_PIX; + if (iface < 4) + return VFE_LINE_RDI0 + (iface - 1); + + return VFE_LINE_NONE; +} + +static inline unsigned int __subgroup_line(unsigned int subgroup) +{ + switch (subgroup) { + case 5: + return VFE_LINE_RDI0; + case 6: + return VFE_LINE_RDI1; + case 7: + return VFE_LINE_RDI2; + default: + return VFE_LINE_PIX; + } + + return VFE_LINE_NONE; +} + +static void vfe_global_reset(struct vfe_device *vfe) +{ + writel_relaxed(TFE_IRQ_MASK_0_RST_DONE, vfe->base + TFE_IRQ_MASK_0); + writel(TFE_GLOBAL_RESET_CMD_CORE, vfe->base + TFE_GLOBAL_RESET_CMD); +} + +static irqreturn_t vfe_isr(int irq, void *dev) +{ + struct vfe_device *vfe = dev; + u32 status; + int i; + + status = readl_relaxed(vfe->base + TFE_IRQ_STATUS_0); + writel_relaxed(status, vfe->base + TFE_IRQ_CLEAR_0); + writel_relaxed(TFE_IRQ_CMD_CLEAR, vfe->base + TFE_IRQ_CMD); + + + if (status & TFE_IRQ_MASK_0_RST_DONE) { + dev_dbg(vfe->camss->dev, "VFE%u: Reset done!", vfe->id); + vfe_isr_reset_ack(vfe); + } + + if (status & TFE_IRQ_MASK_0_BUS_WR) { + u32 bus_status = readl_relaxed(vfe->base + TFE_BUS_IRQ_STATUS_0); + + writel_relaxed(bus_status, vfe->base + TFE_BUS_IRQ_CLEAR_0); + writel_relaxed(TFE_BUS_IRQ_CMD_CLEAR, vfe->base + TFE_BUS_IRQ_CMD); + + for (i = 0; i < TFE_SOURCES_NUM; i++) { + if (bus_status & TFE_BUS_IRQ_MASK_RUP_DONE(i)) + vfe->res->hw_ops->reg_update_clear(vfe, __regupdate_line(i)); + } + + for (i = 0; i < TFE_SUBGROUPS_NUM; i++) { + if (bus_status & TFE_BUS_IRQ_MASK_BUF_DONE(i)) + vfe_buf_done(vfe, __subgroup_line(i)); + } + + if (bus_status & TFE_BUS_IRQ_MASK_0_CONS_VIOL) + dev_err_ratelimited(vfe->camss->dev, "VFE%u: Bad config violation", + vfe->id); + + if (bus_status & TFE_BUS_IRQ_MASK_0_VIOL) + dev_err_ratelimited(vfe->camss->dev, "VFE%u: Input data violation", + vfe->id); + + if (bus_status & TFE_BUS_IRQ_MASK_0_IMG_VIOL) + dev_err_ratelimited(vfe->camss->dev, "VFE%u: Image size violation", + vfe->id); + } + + status = readl_relaxed(vfe->base + TFE_BUS_OVERFLOW_STATUS); + if (status) { + writel_relaxed(status, vfe->base + TFE_BUS_STATUS_CLEAR); + for (i = 0; i < TFE_CLIENTS_NUM; i++) { + if (status & BIT(i)) + dev_err_ratelimited(vfe->camss->dev, + "VFE%u: bus overflow for client %u\n", + vfe->id, i); + } + } + + return IRQ_HANDLED; +} + +static int vfe_halt(struct vfe_device *vfe) +{ + /* rely on vfe_disable_output() to stop the VFE */ + return 0; +} + +static void vfe_enable_irq(struct vfe_device *vfe) +{ + writel_relaxed(TFE_IRQ_MASK_0_RST_DONE | TFE_IRQ_MASK_0_BUS_WR, + vfe->base + TFE_IRQ_MASK_0); + writel_relaxed(TFE_BUS_IRQ_MASK_RUP_DONE_ALL | TFE_BUS_IRQ_MASK_BUF_DONE_ALL | + TFE_BUS_IRQ_MASK_0_CONS_VIOL | TFE_BUS_IRQ_MASK_0_VIOL | + TFE_BUS_IRQ_MASK_0_IMG_VIOL, vfe->base + TFE_BUS_IRQ_MASK_0); +} + +static void vfe_wm_update(struct vfe_device *vfe, u8 rdi, u32 addr, + struct vfe_line *line) +{ + u8 client = RDI_CLIENT(rdi); + + writel_relaxed(addr, vfe->base + TFE_BUS_IMAGE_ADDR(client)); +} + +static void vfe_wm_start(struct vfe_device *vfe, u8 rdi, struct vfe_line *line) +{ + struct v4l2_pix_format_mplane *pix = + &line->video_out.active_fmt.fmt.pix_mp; + u32 stride = pix->plane_fmt[0].bytesperline; + u8 client = RDI_CLIENT(rdi); + + /* Configuration for plain RDI frames */ + writel_relaxed(TFE_BUS_IMAGE_CFG_0_DEFAULT, vfe->base + TFE_BUS_IMAGE_CFG_0(client)); + writel_relaxed(0u, vfe->base + TFE_BUS_IMAGE_CFG_1(client)); + writel_relaxed(TFE_BUS_IMAGE_CFG_2_DEFAULT, vfe->base + TFE_BUS_IMAGE_CFG_2(client)); + writel_relaxed(stride * pix->height, vfe->base + TFE_BUS_FRAME_INCR(client)); + writel_relaxed(TFE_BUS_PACKER_CFG_FMT_PLAIN64, vfe->base + TFE_BUS_PACKER_CFG(client)); + + /* No dropped frames, one irq per frame */ + writel_relaxed(0, vfe->base + TFE_BUS_FRAMEDROP_CFG_0(client)); + writel_relaxed(1, vfe->base + TFE_BUS_FRAMEDROP_CFG_1(client)); + writel_relaxed(0, vfe->base + TFE_BUS_IRQ_SUBSAMPLE_CFG_0(client)); + writel_relaxed(1, vfe->base + TFE_BUS_IRQ_SUBSAMPLE_CFG_1(client)); + + vfe_enable_irq(vfe); + + writel(TFE_BUS_CLIENT_CFG_EN | TFE_BUS_CLIENT_CFG_MODE_FRAME, + vfe->base + TFE_BUS_CLIENT_CFG(client)); + + dev_dbg(vfe->camss->dev, "VFE%u: Started RDI%u width %u height %u stride %u\n", + vfe->id, rdi, pix->width, pix->height, stride); +} + +static void vfe_wm_stop(struct vfe_device *vfe, u8 rdi) +{ + u8 client = RDI_CLIENT(rdi); + + writel(0, vfe->base + TFE_BUS_CLIENT_CFG(client)); + + dev_dbg(vfe->camss->dev, "VFE%u: Stopped RDI%u\n", vfe->id, rdi); +} + +static const struct camss_video_ops vfe_video_ops_520 = { + .queue_buffer = vfe_queue_buffer_v2, + .flush_buffers = vfe_flush_buffers, +}; + +static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe) +{ + vfe->video_ops = vfe_video_ops_520; +} + +static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_id) +{ + vfe->reg_update |= BIT(__regupdate_iface(line_id)); + writel_relaxed(vfe->reg_update, vfe->base + TFE_REG_UPDATE_CMD); +} + +static inline void vfe_reg_update_clear(struct vfe_device *vfe, + enum vfe_line_id line_id) +{ + vfe->reg_update &= ~BIT(__regupdate_iface(line_id)); +} + +const struct vfe_hw_ops vfe_ops_340 = { + .global_reset = vfe_global_reset, + .hw_version = vfe_hw_version, + .isr = vfe_isr, + .pm_domain_off = vfe_pm_domain_off, + .pm_domain_on = vfe_pm_domain_on, + .subdev_init = vfe_subdev_init, + .vfe_disable = vfe_disable, + .vfe_enable = vfe_enable_v2, + .vfe_halt = vfe_halt, + .vfe_wm_start = vfe_wm_start, + .vfe_wm_stop = vfe_wm_stop, + .vfe_buf_done = vfe_buf_done, + .vfe_wm_update = vfe_wm_update, + .reg_update = vfe_reg_update, + .reg_update_clear = vfe_reg_update_clear, +}; diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/platform/qcom/camss/camss-vfe.h index a23f666be753..9b138849caca 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.h +++ b/drivers/media/platform/qcom/camss/camss-vfe.h @@ -242,6 +242,7 @@ extern const struct vfe_hw_ops vfe_ops_4_1; extern const struct vfe_hw_ops vfe_ops_4_7; extern const struct vfe_hw_ops vfe_ops_4_8; extern const struct vfe_hw_ops vfe_ops_170; +extern const struct vfe_hw_ops vfe_ops_340; extern const struct vfe_hw_ops vfe_ops_480; extern const struct vfe_hw_ops vfe_ops_680; extern const struct vfe_hw_ops vfe_ops_780; From patchwork Wed Apr 16 12:09:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 881935 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB4CA2475DD for ; Wed, 16 Apr 2025 12:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805360; cv=none; b=FaTUuE5nv2T/2Bo6JPhEBoAA4qjDd9V2+OtodkGuJIr2DNhUe1K23SyQMKlW7gQhJRAkQJMz9aY/juLOJqkL4sg0GXsdwze/DkQ/kjS0MlsWgxv8Ez7YshTYaxdrmBMZRgYPQf6XG4xe0OCjDhAA6h4onoeJimAxuh4DpuTCGRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805360; c=relaxed/simple; bh=+rtwGwEhlHWlON+ChK0GyA8Y841fjoHwRuKQLtTs9tE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZmbW3bJkidMzujdqU/rDR6U8Z3LCsTa9hira3XxOwfSq9QpXWJRLHFarDAjbXbv99C9NHTmRptqwkl6oxGTgaQV9HgJsH+CFOO27kc7FA7X1btkpXRwLJzFpwcpLHNIRyEE8nmHGYwOA8T00sg9StuCzEr8APEfLBi+z7O8qFCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=LRaHKRjQ; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="LRaHKRjQ" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mNgw020975 for ; Wed, 16 Apr 2025 12:09:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=r9sjeCOaeJf D5r4FvyEP4TtxnrhhEaHs3OtwmGAyYq8=; b=LRaHKRjQeAIOCjonZQARkaKRyK9 JtXI9pMAAmS+VqeCkTs483C/DOTJENi6hGMl7llVYXJSZ2ViKseVP7vCcltwf38S 5n41sdsUy148Jm58oERtvmvq96OWPZ1yOIU0m80VuLIttXw2lqauhF+BP2Lln4ou ACDfL380HtsHl5ve9i8GS2u0NQTWl33wXYvMPR0YSGjuMkO/DiukFry6zwO9zsVU Bb6+FC+1Y+GdeXt2itnAkSfdSLQGMUTDF3smAUooABONv8D23ABH0DRqIZuI90Ws jbZz2UyZTlUSvr/UkWmqDoUhK1xC6ueu3K6KPOWpsawnprsGuOdtZLRrIZQ== Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yf69uew3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 12:09:17 +0000 (GMT) Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-72e26093f05so2574345a34.2 for ; Wed, 16 Apr 2025 05:09:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744805356; x=1745410156; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r9sjeCOaeJfD5r4FvyEP4TtxnrhhEaHs3OtwmGAyYq8=; b=aTaRMo8VU/i4ZJS3/T4IPBKVK8Q4Vh/c1+rJvv3+FNikzLzn5csw3hSFmbLAtYgvZi aynAz2yLve7gBaUW3Ci4ojt39SociW0us/GdNTrvAwV9ZlFYO99Rb1cVD66yDbtwA14R vOu1PB2jvhpGyzptnMsruJdqP8FgNRdvbr7CpVfbo3fSZWiEEN+x+rlo4l6PP2fmmTu9 Ib0jVYNq2mYz8zC0StqXf87VIEO/l0smE2Jw0Ux5shFeMQ5rTTyl2ezkwy1zcmGlohyk QobU5RFP9Uh/EiYId8OrduxYL6intkA7JDyexKv5V8V4VpU2kpzgDV5YQMbgNwE4rNVc C2XQ== X-Gm-Message-State: AOJu0YxJ74RAmWOzYf5eneHES9CaT/HvTR+aHLwFR1rRBVyYOuGz/6V7 30DEJL4XzrxFglOqBt+TN3hTVRwFMN5QU4EsKGibTfO3HR7ResILXWBFSTfP+sT8U+QtHLAxnPx s0P/8Y5ZuB4kE/3BgbRnz3Cen5R7rhAThqNU+ONH1/sbuoLOOA3kVp9vIdXVVZ9cc X-Gm-Gg: ASbGncs/vg6oZGEJJnmZQD31VxLjSN1rjwYxZYelCm/Mw3Zq8riQy0c3+rLLs8t3P4/ MgKuImG7usw2XLOtQU90qJ4hO17lmO/vzsmVemntLuAmkzKYkXkyiSfWe+kU9Ac5yZCipsfWuhE DnzazJZi6uTrtLkQWwF/4bCixSlmvL7PUQlCXppBewQ1XB9H9KB9bM3Eud+ofyhcs2SLm3wDMjd 0Tfu/9kYeAR6pHsUkXoR0gb+xTqzbsQIVzhswaOXJPGyEzYv3m2hxbv/InEPXqAF2YaHez5nVa5 67qPaSNRKTnOVjfjxIKCjwyfKlinF4z3q1kmW9DmmXRfiAA= X-Received: by 2002:a05:6808:3996:b0:3f6:a889:59c6 with SMTP id 5614622812f47-400b0217336mr1102414b6e.26.1744805356341; Wed, 16 Apr 2025 05:09:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEO3QkKPnveFjGFjOOdaF6vvX+XJFgK3cgdY/vutS5QOKJM9QSG7S2Q0NI/A6UZUg1huhe3mQ== X-Received: by 2002:a05:6808:3996:b0:3f6:a889:59c6 with SMTP id 5614622812f47-400b0217336mr1102381b6e.26.1744805355957; Wed, 16 Apr 2025 05:09:15 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.qualcomm.com ([2a01:e0a:82c:5f0:15e4:d866:eb53:4185]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f36f068968sm8328669a12.35.2025.04.16.05.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 05:09:15 -0700 (PDT) From: Loic Poulain To: bryan.odonoghue@linaro.org, rfoss@kernel.org, konradybcio@kernel.org, andersson@kernel.org, krzk+dt@kernel.org, robh@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, Loic Poulain Subject: [PATCH 2/6] media: qcom: camss: Add CSID 340 support Date: Wed, 16 Apr 2025 14:09:04 +0200 Message-Id: <20250416120908.206873-2-loic.poulain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> References: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: Xth1fX1HpdjvRmznTCgehEHY0Yh_1Oqt X-Authority-Analysis: v=2.4 cv=JNc7s9Kb c=1 sm=1 tr=0 ts=67ff9ded cx=c_pps a=OI0sxtj7PyCX9F1bxD/puw==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=QcRrIoSkKhIA:10 a=EUspDBNiAAAA:8 a=L3ROWYctCJYvUZd4tikA:9 a=Z1Yy7GAxqfX1iEi80vsk:22 X-Proofpoint-ORIG-GUID: Xth1fX1HpdjvRmznTCgehEHY0Yh_1Oqt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 impostorscore=0 clxscore=1015 phishscore=0 adultscore=0 priorityscore=1501 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160099 Add support for CSID found in QCM2290, it's a simplified gen-2 version. - There is no Test Pattern Generator (moved outside CSID) - There is no subsampling (moved to CAMIF module) Signed-off-by: Loic Poulain --- drivers/media/platform/qcom/camss/Makefile | 1 + .../platform/qcom/camss/camss-csid-340.c | 190 ++++++++++++++++++ .../media/platform/qcom/camss/camss-csid.h | 1 + 3 files changed, 192 insertions(+) create mode 100644 drivers/media/platform/qcom/camss/camss-csid-340.c diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile index 719898f5d32b..3217bf40976d 100644 --- a/drivers/media/platform/qcom/camss/Makefile +++ b/drivers/media/platform/qcom/camss/Makefile @@ -6,6 +6,7 @@ qcom-camss-objs += \ camss-csid.o \ camss-csid-4-1.o \ camss-csid-4-7.o \ + camss-csid-340.o \ camss-csid-680.o \ camss-csid-gen2.o \ camss-csid-780.o \ diff --git a/drivers/media/platform/qcom/camss/camss-csid-340.c b/drivers/media/platform/qcom/camss/camss-csid-340.c new file mode 100644 index 000000000000..24f8f6fb6f4c --- /dev/null +++ b/drivers/media/platform/qcom/camss/camss-csid-340.c @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module 340 + * + * Copyright (c) 2025 Qualcomm Technologies, Inc. + */ + +#include +#include +#include +#include + +#include "camss.h" +#include "camss-csid.h" +#include "camss-csid-gen2.h" + +#define CSID_RST_STROBES (0x010) +#define CSID_RST_SW_REGS BIT(0) +#define CSID_RST_IRQ BIT(1) +#define CSID_RST_IFE_CLK BIT(2) +#define CSID_RST_PHY_CLK BIT(3) +#define CSID_RST_CSID_CLK BIT(4) + +#define CSID_IRQ_STATUS (0x070) +#define CSID_IRQ_MASK (0x074) +#define CSID_IRQ_MASK_RST_DONE BIT(0) +#define CSID_IRQ_CLEAR (0x078) +#define CSID_IRQ_CMD (0x080) +#define CSID_IRQ_CMD_CLEAR BIT(0) + +#define CSID_CSI2_RX_CFG0 (0x100) +#define CSI2_RX_CFG0_NUM_ACTIVE_LANES 0 +#define CSI2_RX_CFG0_DL0_INPUT_SEL 4 +#define CSI2_RX_CFG0_DL1_INPUT_SEL 8 +#define CSI2_RX_CFG0_DL2_INPUT_SEL 12 +#define CSI2_RX_CFG0_DL3_INPUT_SEL 16 +#define CSI2_RX_CFG0_PHY_NUM_SEL 20 +#define CSI2_RX_CFG0_PHY_SEL_BASE_IDX 1 +#define CSI2_RX_CFG0_PHY_TYPE_SEL 24 + +#define CSID_CSI2_RX_CFG1 (0x104) +#define CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN BIT(0) +#define CSI2_RX_CFG1_MISR_EN BIT(6) +#define CSI2_RX_CFG1_CGC_MODE BIT(7) + +#define CSID_RDI_CFG0(rdi) (0x300 + 0x100 * (rdi)) +#define CSID_RDI_CFG0_BYTE_CNTR_EN BIT(0) +#define CSID_RDI_CFG0_TIMESTAMP_EN BIT(1) +#define CSID_RDI_CFG0_DECODE_FORMAT_NOP (0xf << 12) +#define CSID_RDI_CFG0_DT(dt) ((dt) << 16) +#define CSID_RDI_CFG0_VC(vc) ((vc) << 22) +#define CSID_RDI_CFG0_DTID(dtid) ((dtid) << 22) +#define CSID_RDI_CFG0_ENABLE BIT(31) + +#define CSID_RDI_CTRL(rdi) (0x308 + 0x100 * (rdi)) +#define CSID_RDI_CTRL_HALT_AT_FRAME_BOUNDARY 0 +#define CSID_RDI_CTRL_RESUME_AT_FRAME_BOUNDARY 1 + +static void __csid_configure_rx(struct csid_device *csid, + struct csid_phy_config *phy, int vc) +{ + u32 val; + + val = (phy->lane_cnt - 1) << CSI2_RX_CFG0_NUM_ACTIVE_LANES; + val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL; + val |= (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX) << CSI2_RX_CFG0_PHY_NUM_SEL; + writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG0); + + val = CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN; + writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG1); +} + +static void __csid_ctrl_rdi(struct csid_device *csid, int enable, u8 rdi) +{ + writel(!!enable, csid->base + CSID_RDI_CTRL(rdi)); +} + +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8 vc) +{ + struct v4l2_mbus_framefmt *input_format = &csid->fmt[MSM_CSID_PAD_FIRST_SRC + vc]; + const struct csid_format_info *format = csid_get_fmt_entry(csid->res->formats->formats, + csid->res->formats->nformats, + input_format->code); + u8 lane_cnt = csid->phy.lane_cnt; + u8 dt_id; + u32 val; + + if (!lane_cnt) + lane_cnt = 4; + + /* + * DT_ID is a two bit bitfield that is concatenated with + * the four least significant bits of the five bit VC + * bitfield to generate an internal CID value. + * + * CSID_RDI_CFG0(vc) + * DT_ID : 28:27 + * VC : 26:22 + * DT : 21:16 + * + * CID : VC 3:0 << 2 | DT_ID 1:0 + */ + dt_id = vc & 0x03; + + val = CSID_RDI_CFG0_DECODE_FORMAT_NOP; /* only for RDI path */ + val |= CSID_RDI_CFG0_DT(format->data_type); + val |= CSID_RDI_CFG0_VC(vc); + val |= CSID_RDI_CFG0_DTID(dt_id); + + if (enable) + val |= CSID_RDI_CFG0_ENABLE; + + dev_dbg(csid->camss->dev, "CSID%u: Stream %s (dt:0x%x vc=%u)\n", + csid->id, enable ? "enable" : "disable", format->data_type, vc); + + writel_relaxed(val, csid->base + CSID_RDI_CFG0(vc)); +} + +static void csid_configure_stream(struct csid_device *csid, u8 enable) +{ + int i; + + for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { + if (csid->phy.en_vc & BIT(i)) { + __csid_configure_rdi_stream(csid, enable, i); + __csid_configure_rx(csid, &csid->phy, i); + __csid_ctrl_rdi(csid, enable, i); + } + } +} + +static int csid_reset(struct csid_device *csid) +{ + unsigned long time; + + writel_relaxed(CSID_IRQ_MASK_RST_DONE, csid->base + CSID_IRQ_MASK); + writel_relaxed(CSID_IRQ_MASK_RST_DONE, csid->base + CSID_IRQ_CLEAR); + writel_relaxed(CSID_IRQ_CMD_CLEAR, csid->base + CSID_IRQ_CMD); + + reinit_completion(&csid->reset_complete); + + /* Reset with registers preserved */ + writel(CSID_RST_IRQ | CSID_RST_IFE_CLK | CSID_RST_PHY_CLK | CSID_RST_CSID_CLK, + csid->base + CSID_RST_STROBES); + + time = wait_for_completion_timeout(&csid->reset_complete, + msecs_to_jiffies(CSID_RESET_TIMEOUT_MS)); + if (!time) { + dev_err(csid->camss->dev, "CSID%u: reset timeout\n", csid->id); + return -EIO; + } + + dev_dbg(csid->camss->dev, "CSID%u: reset done\n", csid->id); + + return 0; +} + +static irqreturn_t csid_isr(int irq, void *dev) +{ + struct csid_device *csid = dev; + u32 val; + + val = readl_relaxed(csid->base + CSID_IRQ_STATUS); + writel_relaxed(val, csid->base + CSID_IRQ_CLEAR); + writel_relaxed(CSID_IRQ_CMD_CLEAR, csid->base + CSID_IRQ_CMD); + + if (val & CSID_IRQ_MASK_RST_DONE) + complete(&csid->reset_complete); + else + dev_warn_ratelimited(csid->camss->dev, "Spurious CSID interrupt\n"); + + return IRQ_HANDLED; +} + +static int csid_configure_testgen_pattern(struct csid_device *csid, s32 val) +{ + return -EOPNOTSUPP; /* Not part of CSID */ +} + +static void csid_subdev_init(struct csid_device *csid) {} + +const struct csid_hw_ops csid_ops_340 = { + .configure_testgen_pattern = csid_configure_testgen_pattern, + .configure_stream = csid_configure_stream, + .hw_version = csid_hw_version, + .isr = csid_isr, + .reset = csid_reset, + .src_pad_code = csid_src_pad_code, + .subdev_init = csid_subdev_init, +}; diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media/platform/qcom/camss/camss-csid.h index 9dc826d8c8f6..3399e92658d8 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.h +++ b/drivers/media/platform/qcom/camss/camss-csid.h @@ -213,6 +213,7 @@ extern const struct csid_formats csid_formats_gen2; extern const struct csid_hw_ops csid_ops_4_1; extern const struct csid_hw_ops csid_ops_4_7; +extern const struct csid_hw_ops csid_ops_340; extern const struct csid_hw_ops csid_ops_680; extern const struct csid_hw_ops csid_ops_gen2; extern const struct csid_hw_ops csid_ops_780; From patchwork Wed Apr 16 12:09:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 881666 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D980248862 for ; Wed, 16 Apr 2025 12:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805362; cv=none; b=L56phBuF3hbtf2cmH3qal61FjX7s8W2EXFCQ/f5r8lPgBS3GKz72ycND/38jjVU59g+Mq/yF/zCYe69tV5xPbdcS2+wELwk54TfUrmw4Om/IX56/0bvJ5CKpFPaYJTbeHoUVD1sY3K/eq2svA0z04rkP06c/pO+EcCQCR4Ilf+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805362; c=relaxed/simple; bh=EikXQgvXEbeuMOm0/ej6wfNj69w5FhPyG4oLxunLFsQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=S6W21Q4KC3qOvwRU+AdUKVEn2qwUHU/rwedgZPnYjuurIz2G50QM1OgfGO/f9JN/cwyM/voSEpkmIDk2a6gyMLWGlRCp8dEtZZdDaK/Hcr8lMTFuMdNGYXLGDgCLDaoWOT3iF8hBE6V2SA4nUbyTrbeywNyuTKDuchTDM++4+Z0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=igXmAevR; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="igXmAevR" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mJIO026274 for ; Wed, 16 Apr 2025 12:09:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ynah7SVilvt NbvliQkFcZ5ZlC7MftpwWwSoA7dNu06o=; b=igXmAevRUqaEmmO9F73+A/65Khc 9Tu+Cvt8as49BNWPWidWrCba8OfSjI8J7ZtthoaFeLP+10fqQUsXfaErcJ7FwIcd 0At5jQEoQhdQDDanoJ6CNJbaUBfgEGC2h2OKlXvIyU/vuiPT3RWXHq2M5M6SWYAe BLXDQH7GnK15kqtIWsdFw3QnatXWinw/T/iJ6JjmITGP4aMbF9J2fR2rNRGTyKWC KxbSIQX3PEeGG85nhDhYpPTXaatbbBXNt2xMIz/mtdztTNMdKZSGrwaAe9x3vXbs GbuFhxRIS91R6gETRxsjFU1m1yR/X8nUvtdQntwm6KRRf4hMqy91juvPaGQ== Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yfs1bd3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 12:09:19 +0000 (GMT) Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-3fe246005c6so2066817b6e.0 for ; Wed, 16 Apr 2025 05:09:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744805358; x=1745410158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ynah7SVilvtNbvliQkFcZ5ZlC7MftpwWwSoA7dNu06o=; b=WiUZ7OeH/Y4PePkKvrMADGgYTIR4EZpJgS4fWDG7sQhhIzOg6XoQ8z/gfmMd2eyAZS JyCT9PoKPiXH3CIZx4IHDZrowtML9NbgczwF/U3F5Vo6wBCmE3YOcLgsh57VVTQz53qq exzKMClzUU+J9P8m0Sp8eZhsawt56n2gKjqBGBzhxKAh2bWFDiiuwBJcppYqsnmh2MlR 1oh+zMgqwtj1Ikzzd1LJTwVAZv15X2k9GtUI5mFkHvYTKkdMs0TfsROkmtBxJZ7oLf2D rGDN6617eQryjDeRsD9XMK4d07/uigocATsvShI2LX1PswkulOY3Z5vLkzQ9juYPBrfb +L0Q== X-Gm-Message-State: AOJu0YwQEDCrb7sVITuyifqebep+RD1xCXtfzMskn/vhyp56iXclu9Z6 oZbb1H2Z0wIvF524BIVOTWvmNqAdyRmZ78omYGjlxTsh1kW8VzPiwUYsFMqLNPI6TxTM8ZwR6cO VIm5ivh7VZYqFDYrFVEm88ZcBxS1jgCm6RRgCbalQO+saWpn/6X+tH0Yz9wy2KarK X-Gm-Gg: ASbGnct51cLgIXvvn+wpH0Mi784vIadl5xuMnzbXejI1LXjMHGxjyKMz0Funp7wk7Jy kpQKgWUmajdyu24K+CLahT0FUoR35c6J7B7mksITkpgVG4FXMP8KEVNbTeIXjvPsFiETZs42YLz +GZA66BB/wz2oyIe7SQfAxN4VYBv7YXINw8Yh2Tu5SC2xy0jHK4P3ghdaqaMmuGebaRtc0ULwNz MaiNd3TB6Y4spim+xeTlaHB+bk+FZOop9vVyyvG9XN0YVD3o9tjH9ceZewnGXnK+TOVQbfICSfe plOvw3yGXOHWlUUvqeQdA7epRlg0OYgRD5AoW9pKl4g75hw= X-Received: by 2002:a05:6808:4495:b0:3f8:effc:938 with SMTP id 5614622812f47-400b022dfd0mr944819b6e.34.1744805358328; Wed, 16 Apr 2025 05:09:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmTv/iEO8MvigYLmmer++FToIwH8hBxnPDVpvhmHwbMKueBxQw0RSzJClWAxOcSgk0PlBeHg== X-Received: by 2002:a05:6808:4495:b0:3f8:effc:938 with SMTP id 5614622812f47-400b022dfd0mr944781b6e.34.1744805357909; Wed, 16 Apr 2025 05:09:17 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.qualcomm.com ([2a01:e0a:82c:5f0:15e4:d866:eb53:4185]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f36f068968sm8328669a12.35.2025.04.16.05.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 05:09:17 -0700 (PDT) From: Loic Poulain To: bryan.odonoghue@linaro.org, rfoss@kernel.org, konradybcio@kernel.org, andersson@kernel.org, krzk+dt@kernel.org, robh@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, Loic Poulain Subject: [PATCH 3/6] media: qcom: camss: csiphy-3ph: Add CSIPHY 2ph DPHY v2.0.1 init sequence Date: Wed, 16 Apr 2025 14:09:05 +0200 Message-Id: <20250416120908.206873-3-loic.poulain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> References: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=P9I6hjAu c=1 sm=1 tr=0 ts=67ff9def cx=c_pps a=AKZTfHrQPB8q3CcvmcIuDA==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=QcRrIoSkKhIA:10 a=EUspDBNiAAAA:8 a=Z2TnqjxRs3nyLks1V8oA:9 a=pF_qn-MSjDawc0seGVz6:22 X-Proofpoint-GUID: PNrePLkKTSIYBr7rCYiTO90fjRzIuosi X-Proofpoint-ORIG-GUID: PNrePLkKTSIYBr7rCYiTO90fjRzIuosi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 impostorscore=0 phishscore=0 suspectscore=0 mlxscore=0 spamscore=0 malwarescore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160099 This is the CSI PHY version found in QCS2290/QCM2290 SoCs. The table is extracted from downstream camera driver. Signed-off-by: Loic Poulain --- .../qcom/camss/camss-csiphy-3ph-1-0.c | 89 +++++++++++++++++++ drivers/media/platform/qcom/camss/camss.h | 1 + 2 files changed, 90 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index f732a76de93e..0e314ff9292f 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c @@ -319,6 +319,90 @@ csiphy_lane_regs lane_regs_sm8250[] = { {0x0884, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, }; +/* GEN2 2.0.1 2PH DPHY mode */ +static const struct +csiphy_lane_regs lane_regs_qcm2290[] = { + {0x0030, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0034, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0028, 0x04, 0x00, CSIPHY_DNP_PARAMS}, + {0x003C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x001C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0000, 0xD7, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0004, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0020, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0008, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x000C, 0xFF, 0x00, CSIPHY_DNP_PARAMS}, + {0x0010, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0038, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0060, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0064, 0x3F, 0x00, CSIPHY_DEFAULT_PARAMS}, + + {0x0730, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x072C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0734, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0728, 0x04, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x073C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x071C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0700, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0704, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0720, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0708, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x070C, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0710, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0738, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0760, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0764, 0x3F, 0x00, CSIPHY_DEFAULT_PARAMS}, + + {0x0230, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x022C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0234, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0228, 0x04, 0x00, CSIPHY_DNP_PARAMS}, + {0x023C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x021C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0200, 0xD7, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0204, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0220, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0208, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x020C, 0xFF, 0x00, CSIPHY_DNP_PARAMS}, + {0x0210, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0238, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0260, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0264, 0x3F, 0x00, CSIPHY_DEFAULT_PARAMS}, + + {0x0430, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x042C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0434, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0428, 0x04, 0x00, CSIPHY_DNP_PARAMS}, + {0x043C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x041C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0400, 0xD7, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0404, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0420, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0408, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x040C, 0xFF, 0x00, CSIPHY_DNP_PARAMS}, + {0x0410, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0438, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0460, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0464, 0x3F, 0x00, CSIPHY_DEFAULT_PARAMS}, + + {0x0630, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x062C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0634, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0628, 0x04, 0x00, CSIPHY_DNP_PARAMS}, + {0x063C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x061C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0600, 0xD7, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0604, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0620, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0608, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE}, + {0x060C, 0xFF, 0x00, CSIPHY_DNP_PARAMS}, + {0x0610, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0638, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0660, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS}, + {0x0664, 0x3F, 0x00, CSIPHY_DEFAULT_PARAMS}, +}; + /* GEN2 2.1.2 2PH DPHY mode */ static const struct csiphy_lane_regs lane_regs_sm8550[] = { @@ -744,6 +828,7 @@ static bool csiphy_is_gen2(u32 version) bool ret = false; switch (version) { + case CAMSS_2290: case CAMSS_7280: case CAMSS_8250: case CAMSS_8280XP: @@ -829,6 +914,10 @@ static int csiphy_init(struct csiphy_device *csiphy) regs->lane_regs = &lane_regs_sdm845[0]; regs->lane_array_size = ARRAY_SIZE(lane_regs_sdm845); break; + case CAMSS_2290: + regs->lane_regs = &lane_regs_qcm2290[0]; + regs->lane_array_size = ARRAY_SIZE(lane_regs_qcm2290); + break; case CAMSS_7280: case CAMSS_8250: regs->lane_regs = &lane_regs_sm8250[0]; diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h index 63c0afee154a..377707d91ff2 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -78,6 +78,7 @@ enum pm_domain { enum camss_version { CAMSS_660, + CAMSS_2290, CAMSS_7280, CAMSS_8x16, CAMSS_8x53, From patchwork Wed Apr 16 12:09:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 881934 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6508724C068 for ; Wed, 16 Apr 2025 12:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805364; cv=none; b=Y5eIN1nD3flwm5D8B3HNxEiEzhSJngvETCsR01hfUhPgBSZOtrQN7uQlA78n3CvAxnYCnaF1OV9vX5LsVEV7rP4cd5+Jaz60pdxENA0cmR2Rp3hrr9Qao3wfVljGdQCaqMLdvc6ERSUqJb/FUkpI5XXcmEgHqLidzRVQXKh7Dr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805364; c=relaxed/simple; bh=NPVt5Eh4Sxu8Ws6J9AGsZ3lKsahEbFRxLpruWStJmUY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dtSP1g4W3YjPDntonJGsbZ6Z9C6+2sNRMhepCKEkIXgAO/bekPZeNQDiGF/L3D5ltJ0mbK4ZViibajuZhclF2TRIBZWjUj9LRSu/lv3xmb3atC33b+j42O6GRQlEjMM0cUTIqqeN1vIdDhQijT8ucTsIL8WeLrBV69dvJny9V0k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lSoVWQWM; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lSoVWQWM" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mGIW007041 for ; Wed, 16 Apr 2025 12:09:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=bWGiRxcgZ25 rVa8O+VrLYX4RCWMiG+80+yHZX4iCUnY=; b=lSoVWQWMD5mqTlwdR96uxcMAHpl ZUKOXKNHUBcK4feyLUhOzMCyOTz5XHFahl/Bq5yZ8G2lE3xtaqfUF8j6XDNTvdCh QV4z4l9hRzRnDwIg5fEQpJp1anZfrORGfI05bUQeJTe7Win0g2laBp1R7C7aFMVy F9lrQTVuNOMEcIe+EEplkWrwXKb92q5taTBzt0u+nVvlGm7xPcC3Dk0krX+2H0l2 1Hwj0K1qHWmo5gHO1wJHDq/7lCZ6dIRNdDt4LyipzqYJC6PI2c2kHJS2WB+NsBHq +HK9bIeEwc2D5sHfW0M+jS915sYDlBnPqLCU97WiBaIt2jVs7t5kdh1U0tA== Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yfgjkchw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 12:09:21 +0000 (GMT) Received: by mail-oi1-f197.google.com with SMTP id 5614622812f47-3f684f66583so1943832b6e.1 for ; Wed, 16 Apr 2025 05:09:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744805360; x=1745410160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bWGiRxcgZ25rVa8O+VrLYX4RCWMiG+80+yHZX4iCUnY=; b=A/A26lsTuOzKvYU2jMK1sczKaSWIIJP0YdCo6vKHwNOwXq0HJO/kMlx/in/I82mZUg ulFb3iRvp+EH55BjbaGvatY4CWRMCHD8dbvM0WhLCSQBCWzDLWgrlBm0XZCOqAgxSQpo RWtYJM2Si2P3fjPLnBUlVj2XTjlHqHsjDJbF92LQbYYXxD/UKCSI9Xs1wUWzij96Bmpd xzB2TBDJ51WjyQ0xfshTJTbJvG9KT2hSBLpWRZO6z36CfumxoFG/YWo6+/BX8D+s560X z52aXjIgDV1EwdQ6KQNSH++ul8aB/WXO19FUqghRjVhMPxMljGUi11GsL8xI9LTi90bt cNqg== X-Gm-Message-State: AOJu0YzjGeyGbhKWtQelxr66SrDTm6vCjV+aDUhhPtjA4c3NmQ7YG9ur WBgAQGzOywt12ILEgFdge/mbkFiobqtecmNRDLyuhSzyMHH0b3vyHWNemmMFLf4ijmE/NAPAx+b oVAZ7B1IiEurIraYHtFI3FgRpNgs4FIII8vL6bxvHoOhYy3D6AnUFBn3+kq1lOCM8tdQbySsx X-Gm-Gg: ASbGnculZfvpaJ5PAN674gR+V7mAYOeZ/R6XomYaWJ6KRppw2JWwcnuvGGUasBs4ISb A+lmYdTs3+rxTV3T9zrUU2UlW5rkK6/n3ggXaldkXbs5OtS7ks8Y48CSH4hko1AW5ycBHt95tpw nE1T8U60hgyv4NzK7llIahZa0KZEoVXfYwhsCQKgTTrbWQDHqFm010wwSINNswf3pombn80E0L1 JZ3Bxs2/2Zkr7K+j6lF+xOtW1dZbLh9YxWD2uO5HNBhXustHhf261PFlBpITQxZgawqKvG0K6iD KQgqeZTgzU3DFljj8CWIVQHHFoIK8i/cAtgtZ3kbsJ3lsd4= X-Received: by 2002:a05:6808:220f:b0:3f6:e059:40b2 with SMTP id 5614622812f47-400b0217609mr963748b6e.27.1744805360189; Wed, 16 Apr 2025 05:09:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERkhJLDuDjh221NQaFSFVJW/EglXsgM8zuZ1aXTPm3pwFvSY22ltbiULU+wSVMldsT2p30UQ== X-Received: by 2002:a05:6808:220f:b0:3f6:e059:40b2 with SMTP id 5614622812f47-400b0217609mr963724b6e.27.1744805359864; Wed, 16 Apr 2025 05:09:19 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.qualcomm.com ([2a01:e0a:82c:5f0:15e4:d866:eb53:4185]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f36f068968sm8328669a12.35.2025.04.16.05.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 05:09:19 -0700 (PDT) From: Loic Poulain To: bryan.odonoghue@linaro.org, rfoss@kernel.org, konradybcio@kernel.org, andersson@kernel.org, krzk+dt@kernel.org, robh@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, Loic Poulain Subject: [PATCH 4/6] media: qcom: camss: add support for QCM2290 camss Date: Wed, 16 Apr 2025 14:09:06 +0200 Message-Id: <20250416120908.206873-4-loic.poulain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> References: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: 8K1QCKNbGZ_bYJ4VwBglYPEhPf79b7yN X-Proofpoint-ORIG-GUID: 8K1QCKNbGZ_bYJ4VwBglYPEhPf79b7yN X-Authority-Analysis: v=2.4 cv=Cve/cm4D c=1 sm=1 tr=0 ts=67ff9df1 cx=c_pps a=WJcna6AvsNCxL/DJwPP1KA==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=QcRrIoSkKhIA:10 a=EUspDBNiAAAA:8 a=c8dJUS_lH9wIvx9YmlQA:9 a=_Y9Zt4tPzoBS9L09Snn2:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160099 The camera subsystem for QCM2290 which is based on Spectra 340. Signed-off-by: Loic Poulain --- drivers/media/platform/qcom/camss/camss-vfe.c | 2 + drivers/media/platform/qcom/camss/camss.c | 146 ++++++++++++++++++ 2 files changed, 148 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index 4bca6c3abaff..c575c9767492 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -340,6 +340,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code, } break; case CAMSS_660: + case CAMSS_2290: case CAMSS_7280: case CAMSS_8x96: case CAMSS_8250: @@ -1969,6 +1970,7 @@ static int vfe_bpl_align(struct vfe_device *vfe) int ret = 8; switch (vfe->camss->res->version) { + case CAMSS_2290: case CAMSS_7280: case CAMSS_8250: case CAMSS_8280XP: diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 06f42875702f..1e0eb2a650a3 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -515,6 +515,138 @@ static const struct camss_subdev_resources vfe_res_8x96[] = { } }; +static const struct camss_subdev_resources csiphy_res_2290[] = { + /* CSIPHY0 */ + { + .regulators = { "vdda-phy", "vdda-pll" }, + .clock = { "top_ahb", "ahb", "csiphy0", "csiphy0_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 240000000, 341330000, 384000000 }, + { 100000000, 200000000, 268800000 } }, + .reg = { "csiphy0" }, + .interrupt = { "csiphy0" }, + .csiphy = { + .hw_ops = &csiphy_ops_3ph_1_0, + .formats = &csiphy_formats_sdm845 + } + }, + + /* CSIPHY1 */ + { + .regulators = { "vdda-phy", "vdda-pll" }, + .clock = { "top_ahb", "ahb", "csiphy1", "csiphy1_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 240000000, 341330000, 384000000 }, + { 100000000, 200000000, 268800000 } }, + .reg = { "csiphy1" }, + .interrupt = { "csiphy1" }, + .csiphy = { + .hw_ops = &csiphy_ops_3ph_1_0, + .formats = &csiphy_formats_sdm845 + } + } +}; + +static const struct camss_subdev_resources csid_res_2290[] = { + /* CSID0 */ + { + .regulators = {}, + .clock = { "top_ahb", "ahb", "csi0", "vfe0_cphy_rx", "vfe0" }, + .clock_rate = { { 0 }, + { 0 }, + { 192000000, 240000000, 384000000, 426400000 }, + { 0 }, + { 0 } }, + .reg = { "csid0" }, + .interrupt = { "csid0" }, + .csid = { + .hw_ops = &csid_ops_340, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2 + } + }, + + /* CSID1 */ + { + .regulators = {}, + .clock = { "top_ahb", "ahb", "csi1", "vfe1_cphy_rx", "vfe1" }, + .clock_rate = { { 0 }, + { 0 }, + { 192000000, 240000000, 384000000, 426400000 }, + { 0 }, + { 0 } }, + .reg = { "csid1" }, + .interrupt = { "csid1" }, + .csid = { + .hw_ops = &csid_ops_340, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2 + } + } +}; + +static const struct camss_subdev_resources vfe_res_2290[] = { + /* VFE0 */ + { + .regulators = {}, + .clock = { "top_ahb", "ahb", "axi", "vfe0", "camnoc_rt_axi", "camnoc_nrt_axi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 19200000, 153600000, 192000000, 256000000, 384000000, 460800000 }, + { 0 }, + { 0 }, }, + .reg = { "vfe0" }, + .interrupt = { "vfe0" }, + .vfe = { + .line_num = 4, + .hw_ops = &vfe_ops_340, + .formats_rdi = &vfe_formats_rdi_845, + .formats_pix = &vfe_formats_pix_845 + } + }, + + /* VFE1 */ + { + .regulators = {}, + .clock = { "top_ahb", "ahb", "axi", "vfe1", "camnoc_rt_axi", "camnoc_nrt_axi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 19200000, 153600000, 192000000, 256000000, 384000000, 460800000 }, + { 0 }, + { 0 }, }, + .reg = { "vfe1" }, + .interrupt = { "vfe1" }, + .vfe = { + .line_num = 4, + .hw_ops = &vfe_ops_340, + .formats_rdi = &vfe_formats_rdi_845, + .formats_pix = &vfe_formats_pix_845 + } + }, +}; + +static const struct resources_icc icc_res_2290[] = { + { + .name = "ahb", + .icc_bw_tbl.avg = 150000, + .icc_bw_tbl.peak = 300000, + }, + { + .name = "hf_mnoc", + .icc_bw_tbl.avg = 2097152, + .icc_bw_tbl.peak = 2097152, + }, + { + .name = "sf_mnoc", + .icc_bw_tbl.avg = 2097152, + .icc_bw_tbl.peak = 2097152, + }, +}; + static const struct camss_subdev_resources csiphy_res_660[] = { /* CSIPHY0 */ { @@ -3753,6 +3885,19 @@ static const struct camss_resources msm8996_resources = { .link_entities = camss_link_entities }; +static const struct camss_resources qcm2290_resources = { + .version = CAMSS_2290, + .csiphy_res = csiphy_res_2290, + .csid_res = csid_res_2290, + .vfe_res = vfe_res_2290, + .icc_res = icc_res_2290, + .icc_path_num = ARRAY_SIZE(icc_res_2290), + .csiphy_num = ARRAY_SIZE(csiphy_res_2290), + .csid_num = ARRAY_SIZE(csid_res_2290), + .vfe_num = ARRAY_SIZE(vfe_res_2290), + .link_entities = camss_link_entities +}; + static const struct camss_resources sdm660_resources = { .version = CAMSS_660, .csiphy_res = csiphy_res_660, @@ -3865,6 +4010,7 @@ static const struct of_device_id camss_dt_match[] = { { .compatible = "qcom,msm8916-camss", .data = &msm8916_resources }, { .compatible = "qcom,msm8953-camss", .data = &msm8953_resources }, { .compatible = "qcom,msm8996-camss", .data = &msm8996_resources }, + { .compatible = "qcom,qcm2290-camss", .data = &qcm2290_resources }, { .compatible = "qcom,sc7280-camss", .data = &sc7280_resources }, { .compatible = "qcom,sc8280xp-camss", .data = &sc8280xp_resources }, { .compatible = "qcom,sdm660-camss", .data = &sdm660_resources }, From patchwork Wed Apr 16 12:09:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 881665 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D168E23D297 for ; Wed, 16 Apr 2025 12:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805365; cv=none; b=imgxt4Cwu+bV/dTW3gFG7oARKK8+eB5RapBT7twLyVJ0KMbDc/y9wjX3cQ4Mk4gzQyJNnw3/FB7Fp0K8NUJd8vwN004vBaFTf/zpCu6oWR/ZSJyuulyXwqkpu0UUHd0JlAUtDZYFaUIlThpHCYmTmXwXBT4rf+PIfRb1x/rvrxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805365; c=relaxed/simple; bh=p2sisv3FaynmKm9MXmyj2FKEdx47s/LAReVhcDfPSNw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KJQBl9nZouTcMhLyUec+ryuZ6EGMO3XNd6buJ/g8pjnO9dI91pMMQqizZKRgiQLXo8jH5jMEvcYsRxWFD1q50qVydwEgr8vBSlx6s7L9YH5TjigxKePvNyC+ZTzvnm9tTuSow3zKGndIGtXjxhUs5tu7xyXJESzheQyi+1Hgkfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=i0nKqE6j; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="i0nKqE6j" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mIJG000415 for ; Wed, 16 Apr 2025 12:09:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=oCwCmdS+SDe 7GEj+Sp5OjyZYetJhaZ9LvSjllX9L3iQ=; b=i0nKqE6jCK69pqRbpvTePAOq+Eq Zee5qI3QB4aHxZJXKypvABhFcijJksZVlnvvCHoXXDzu+Y6T9gCJP4pbKnNugWV5 5N7jDALeE4PW7YXd9XNY4QuHzdviOYfXm1Q94HbJtA1nNs+UvDuyg+rV/9yXpQrV G05mnP8JOeIOyMd7airUgVrQIux3b3BVhlVPi6kFwb/f/OlCrffUOkQqDmH8zJEG l7VmcLjQOxbT+UXx3Dhe5fDQ+edQwCaqQ7SYTNjORWhziGh0HWM7BeusfD0iaC5G j0wNcHs6uR75UE9N4W3jqyhHTyglrbfEZOCaRB9oWP/VL9VGMzm7U6zX2sg== Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yf4vkhs4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 12:09:23 +0000 (GMT) Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-72c40592a9aso2388949a34.2 for ; Wed, 16 Apr 2025 05:09:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744805362; x=1745410162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oCwCmdS+SDe7GEj+Sp5OjyZYetJhaZ9LvSjllX9L3iQ=; b=Yqo7iTdHFzq15GZj98dpLVpXwDNvToZssDjVRjX7toclIrpNvY8sNDXvLWM7OrJAq4 N/isPxU1AtBygNg1dHO9PbDBXTYVcdeN00DexDlKkeYENm/sX3etwuG6Fo9ShO8+bOFj sHHRCMRQQrNvca59U7Cn9gr18hOnGC1BV1Z+MTjqHexZoXudaPnHVdrr/HQivy0lxlYd OUIQRTM19lFX65q0OdPml+FjkpsyigTIiCHxzXc9RFGF+fM2deXz13hmQctHr7y48Ytu 0jGYgz9f7Yx2h9fH67/Uq2BKoJqeQ20ateDPNL4iO8Eel7kieb81YlEWUYIR2NibLBed QGXg== X-Gm-Message-State: AOJu0YwXm1mQ7G6qC8vISbEVgV1EYVCGm2gWtJQ4HTBtvk2CiCavwIT+ LodqQ84Rlgdoa4opdOv26i0N2YGPpjBHggDbuFcMV01wIiHCZL9/6M33ZVYVlUy4jgxJdRdlPcw FMuZpOSEaKR+9LNpf2ThaCxi9j0ITTntEwr/p/Au242dNdE4BiMpc2ifVcJI0/2Oo X-Gm-Gg: ASbGnctDl6cbdg6+H+YBVh4jE6BNVZdlvMPhPaLopsUUDtGK/o3atcoxNUzFdSf2x+l Pda8AH2r5cE/ZtFbU9fZRJQDRmE4ods8Hqenuqef+ibzER2ZJyM64hI0tuNqF67OXVnshRAu4La BtNzq/0mL+jjD8XEt7szMQEGEsE5oid1R6wVVNdzOjWycjzRz8O8NgURlu2yajDoWeRCUAtZgqv K4xKSLn0VcnikdGm/CcobIl2CsJuz6+eS7a7dHtRGHggZmLs4RvBXxSbdqVaO92jGZE2SfnPfPP W4/oZ9aptsg2PjEuZWdt2KGhJaiYlgLOuZtSRy6HE1coGRQ= X-Received: by 2002:a05:6808:3203:b0:3f6:a476:f7e0 with SMTP id 5614622812f47-400b01caaabmr911751b6e.9.1744805361979; Wed, 16 Apr 2025 05:09:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFznpFYEgBEZNt9B+00ktVcV1ME9H4Y8YDtK6rz2hRIOktahqd7meqmf6jvFuO+P/HM8WFt4A== X-Received: by 2002:a05:6808:3203:b0:3f6:a476:f7e0 with SMTP id 5614622812f47-400b01caaabmr911734b6e.9.1744805361635; Wed, 16 Apr 2025 05:09:21 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.qualcomm.com ([2a01:e0a:82c:5f0:15e4:d866:eb53:4185]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f36f068968sm8328669a12.35.2025.04.16.05.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 05:09:21 -0700 (PDT) From: Loic Poulain To: bryan.odonoghue@linaro.org, rfoss@kernel.org, konradybcio@kernel.org, andersson@kernel.org, krzk+dt@kernel.org, robh@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, Loic Poulain Subject: [PATCH 5/6] media: dt-bindings: media: camss: Add qcom, qcm2290-camss binding Date: Wed, 16 Apr 2025 14:09:07 +0200 Message-Id: <20250416120908.206873-5-loic.poulain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> References: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Q-HKYnS_AH_Ai8vzL25m90RJci6JvbVc X-Authority-Analysis: v=2.4 cv=IZ6HWXqa c=1 sm=1 tr=0 ts=67ff9df3 cx=c_pps a=OI0sxtj7PyCX9F1bxD/puw==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=QcRrIoSkKhIA:10 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=JlZtY4oE0OGdv2NQSfYA:9 a=Z1Yy7GAxqfX1iEi80vsk:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-GUID: Q-HKYnS_AH_Ai8vzL25m90RJci6JvbVc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 impostorscore=0 suspectscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160099 Add bindings for qcom,qcm2290-camss in order to support the camera subsystem found in the Qualcomm Robotics RB1 Platform (QRB2210). Signed-off-by: Loic Poulain --- .../bindings/media/qcom,qcm2290-camss.yaml | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,qcm2290-camss.yaml diff --git a/Documentation/devicetree/bindings/media/qcom,qcm2290-camss.yaml b/Documentation/devicetree/bindings/media/qcom,qcm2290-camss.yaml new file mode 100644 index 000000000000..dc53f445a90b --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,qcm2290-camss.yaml @@ -0,0 +1,246 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,qcm2290-camss.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm QCM2290 Camera Subsystem (CAMSS) + +maintainers: + - Loic Poulain + +description: + The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms. + +properties: + compatible: + const: qcom,qcm2290-camss + + reg: + maxItems: 6 + + reg-names: + items: + - const: csid0 + - const: csid1 + - const: csiphy0 + - const: csiphy1 + - const: vfe0 + - const: vfe1 + + clocks: + maxItems: 15 + + clock-names: + items: + - const: ahb + - const: axi + - const: top_ahb + - const: csi0 + - const: csi1 + - const: csiphy0 + - const: csiphy1 + - const: csiphy0_timer + - const: csiphy1_timer + - const: vfe0 + - const: vfe1 + - const: vfe0_cphy_rx + - const: vfe1_cphy_rx + - const: camnoc_nrt_axi + - const: camnoc_rt_axi + + interrupts: + maxItems: 6 + + interrupt-names: + items: + - const: csid0 + - const: csid1 + - const: csiphy0 + - const: csiphy1 + - const: vfe0 + - const: vfe1 + + interconnects: + maxItems: 3 + + interconnect-names: + items: + - const: ahb + - const: hf_mnoc + - const: sf_mnoc + + iommus: + maxItems: 4 + + power-domains: + items: + - description: GDSC CAMSS Block, Global Distributed Switch Controller. + + vdda-phy-supply: + description: + Phandle to a 1.2V regulator supply to CSI PHYs. + + vdda-pll-supply: + description: + Phandle to 1.8V regulator supply to CAMSS refclk pll block. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + description: + CSI input ports. + + properties: + port@0: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data on CSIPHY 0. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + + port@1: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data on CSIPHY 1. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - interrupts + - interrupt-names + - interconnects + - interconnect-names + - iommus + - power-domains + - vdda-phy-supply + - vdda-pll-supply + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + soc { + #address-cells = <2>; + #size-cells = <2>; + + camss: camss@5c52000 { + compatible = "qcom,qcm2290-camss"; + + reg = <0 0x5c52000 0 0x1000>, + <0 0x5c53000 0 0x1000>, + <0 0x5c6e000 0 0x1000>, + <0 0x5c75000 0 0x1000>, + <0 0x5c6f000 0 0x4000>, + <0 0x5c76000 0 0x4000>; + reg-names = "csid0", + "csid1", + "csiphy0", + "csiphy1", + "vfe0", + "vfe1"; + + interrupts = , + , + , + , + , + ; + interrupt-names = "csid0", + "csid1", + "csiphy0", + "csiphy1", + "vfe0", + "vfe1"; + + power-domains = <&gcc GCC_CAMSS_TOP_GDSC>; + + clocks = <&gcc GCC_CAMERA_AHB_CLK>, + <&gcc GCC_CAMSS_AXI_CLK>, + <&gcc GCC_CAMSS_TOP_AHB_CLK>, + <&gcc GCC_CAMSS_TFE_0_CSID_CLK>, + <&gcc GCC_CAMSS_TFE_1_CSID_CLK>, + <&gcc GCC_CAMSS_CPHY_0_CLK>, + <&gcc GCC_CAMSS_CPHY_1_CLK>, + <&gcc GCC_CAMSS_CSI0PHYTIMER_CLK>, + <&gcc GCC_CAMSS_CSI1PHYTIMER_CLK>, + <&gcc GCC_CAMSS_TFE_0_CLK>, + <&gcc GCC_CAMSS_TFE_1_CLK>, + <&gcc GCC_CAMSS_TFE_0_CPHY_RX_CLK>, + <&gcc GCC_CAMSS_TFE_1_CPHY_RX_CLK>, + <&gcc GCC_CAMSS_NRT_AXI_CLK>, + <&gcc GCC_CAMSS_RT_AXI_CLK>; + clock-names = "ahb", + "axi", + "top_ahb", + "csi0", + "csi1", + "csiphy0", + "csiphy1", + "csiphy0_timer", + "csiphy1_timer", + "vfe0", + "vfe1", + "vfe0_cphy_rx", + "vfe1_cphy_rx", + "camnoc_nrt_axi", + "camnoc_rt_axi"; + + iommus = <&apps_smmu 0x400 0x0>, + <&apps_smmu 0x800 0x0>, + <&apps_smmu 0x820 0x0>, + <&apps_smmu 0x840 0x0>; + + interconnects = <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG + &config_noc SLAVE_CAMERA_CFG RPM_ALWAYS_TAG>, + <&mmrt_virt MASTER_CAMNOC_HF RPM_ALWAYS_TAG + &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, + <&mmnrt_virt MASTER_CAMNOC_SF RPM_ALWAYS_TAG + &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; + interconnect-names = "ahb", + "hf_mnoc", + "sf_mnoc"; + + vdda-phy-supply = <&pm4125_l5>; + vdda-pll-supply = <&pm4125_l13>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; From patchwork Wed Apr 16 12:09:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 881933 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4099623D297 for ; Wed, 16 Apr 2025 12:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805367; cv=none; b=Up6JGrxDhGydVV9QSjZsluia6skeUbxkCbcviLrr7Rx/CPy2yPLOGXbjJ1ZQUTQqGmqKKCjIK+JN5+TM6mIOr8F9moURef6Us48gKDvGtj4xjuN/Rwzr46K1yFSpntyxK/oHngyrGzMG9AHFmuFYqIiZVZ1D9dhhIv6WL6REFYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744805367; c=relaxed/simple; bh=OqhOoI2tcXTG0wlBrE+3lgaB36K07OcLYbZIEAwMF6g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fXppx0sDneGdJn53jvZaUmz8bPVz3MUoQPYF4zewbhpJewtI18i+L6IdtgXw1qeOE/kQeHOiiliFUQ8o4tjhaJ4B8vMtetHRss1BcfugUDOtTuhdGUObcrKPJLD31g0HInPzq3g/IJoCa09Z4JmERuGmW11qDpx6i5QvalGqVds= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=fwUNQmN/; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="fwUNQmN/" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53G9mGnr020882 for ; Wed, 16 Apr 2025 12:09:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=TdDsbHFW7Px dDWoRI/tvr0I5QZItG1JmOXgwMLEsLgU=; b=fwUNQmN/gkjj/RgpQCDdiRSCKAd jh2aylSxsEl0e+2+b/Y9C6YypGFl+NezGxBhVjVy0MCX456JC+lWaGhkkdqu6lkL wcwOpZCK7l0BTZpCUd7x50Kxp2GU/ZD7IxV3oL+Rw26QCHLO8KYL9EjkdQiMY1tf MxHKmZaRkmKTaKqkW7pucxc6zfOXX1Uv1g4Dy41SAGr1ZJKUUEjmsD3Xt2ZZyQ1Z ccchDuqhwpDd6pC2ky/jTzbQOh+MshGUBawk6G7/7FW4+DZ0nrRuL0UiGgBbc6rA zWe9k6vn3PEumk2p2cyg9fabJ3QqSQudmw7Q71keys8/UT0vTvcfUx1npOw== Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yf69uewg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 16 Apr 2025 12:09:24 +0000 (GMT) Received: by mail-oi1-f197.google.com with SMTP id 5614622812f47-3f99583b44aso5926045b6e.0 for ; Wed, 16 Apr 2025 05:09:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744805364; x=1745410164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TdDsbHFW7PxdDWoRI/tvr0I5QZItG1JmOXgwMLEsLgU=; b=qpUiu6Bjqrgl6zc6yWUJsJgVFB6V/5QRv7BRRdQYHCMxSsmlSlnqh0nkohhataZ6QC r/NlQyriVoLomV1eXefFl3DhJDVRhzqbwkPcBGoa/oO5dXZ1TJIBm0e9PthlpqmxCMup upgmQ2HpH1yty3h7npnInQXkytKVHRyAQveB/M6OPxRSl/i5fZ5W0rNcbjornwOahPZt cUtMsbl+8SpLjVT07Za+xPCbQXRzkDxwSlf6BFjP2TILIfxMnSgReq4Kl1CiWmpbF2fK Xt9ol/5aTTgLxQ1nWMX/RCsIS5kc/q1YKOec2jjROqXTE3ArLlQeNNW8KrUvUmYu+erz +zdg== X-Gm-Message-State: AOJu0YyWvIOVEQ16Tgz1Yjf+PjJJumf55nWsuGIqXK3IAn/BYvoqXksb hI9X0mq+g/jVMOSispyqAakptunQz3ImoRpF4Jy3iIs5/wq/MEtJGuNxCIqDYyoxP6T55wutJc3 dKs8o1cpo1SS1NfYoluy+zwVDY52YchUsKvwFJ5PT13SdcLOVyl1Lzfx6OcUluSlj X-Gm-Gg: ASbGncvZrFW4XuDbdWDZIhm8r1E7HompzXwqDgAadUDMpF8aQSBhBt04Ypainp9Cdeo 8rBNXIJD+2HyVOb7nxPFjaq+YNNvXHq7SQRXcb+2m7adZ6ihdYSSyNWoxpbiuB1YElt4IG4Y7WD cGDSC6UL+0ctigPhtzLcGjOaKzolzJrAtBjVj3+793ULQ4cVaZttOO3TPjxhQyMbhvXaTraILtm 3vu4aNE1Es8TC/W8s7p+FjSvtpD0S9hk4eIXcal/uC8TFVz10V97fDklvyeRZOPhYZO8rTsMww4 UONzvKG2Uovp0AWrZ9g2+eewXF7n970a/MtoxqExqO7DqKk= X-Received: by 2002:a05:6808:bd0:b0:3f4:1838:50d with SMTP id 5614622812f47-400b022e76cmr768941b6e.35.1744805363805; Wed, 16 Apr 2025 05:09:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPxwGuY2IT3x38U3lP9QQuKdo27S9+gWmKkyWLAv/MVq8s4YMRehZlhUvSkwnIYyyKJSfNXA== X-Received: by 2002:a05:6808:bd0:b0:3f4:1838:50d with SMTP id 5614622812f47-400b022e76cmr768915b6e.35.1744805363476; Wed, 16 Apr 2025 05:09:23 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.qualcomm.com ([2a01:e0a:82c:5f0:15e4:d866:eb53:4185]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f36f068968sm8328669a12.35.2025.04.16.05.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 05:09:23 -0700 (PDT) From: Loic Poulain To: bryan.odonoghue@linaro.org, rfoss@kernel.org, konradybcio@kernel.org, andersson@kernel.org, krzk+dt@kernel.org, robh@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, Loic Poulain Subject: [PATCH 6/6] arm64: dts: qcom: qcm2290: Add CAMSS node Date: Wed, 16 Apr 2025 14:09:08 +0200 Message-Id: <20250416120908.206873-6-loic.poulain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> References: <20250416120908.206873-1-loic.poulain@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: qQelEd1rHQsK4Wgj1a_d6jC2xx8lmkOY X-Authority-Analysis: v=2.4 cv=JNc7s9Kb c=1 sm=1 tr=0 ts=67ff9df4 cx=c_pps a=WJcna6AvsNCxL/DJwPP1KA==:117 a=xqWC_Br6kY4A:10 a=XR8D0OoHHMoA:10 a=QcRrIoSkKhIA:10 a=EUspDBNiAAAA:8 a=EzCDy3pf2FPqfMyO2-oA:9 a=_Y9Zt4tPzoBS9L09Snn2:22 X-Proofpoint-ORIG-GUID: qQelEd1rHQsK4Wgj1a_d6jC2xx8lmkOY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-16_04,2025-04-15_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 impostorscore=0 clxscore=1015 phishscore=0 adultscore=0 priorityscore=1501 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504160099 Add node for the QCM2290 camera subsystem. Signed-off-by: Loic Poulain --- arch/arm64/boot/dts/qcom/qcm2290.dtsi | 93 +++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi index f0746123e594..4b81e721e50c 100644 --- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi +++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi @@ -1579,6 +1579,99 @@ adreno_smmu: iommu@59a0000 { #iommu-cells = <2>; }; + camss: camss@5c52000 { + compatible = "qcom,qcm2290-camss"; + + reg = <0 0x5c6e000 0 0x1000>, + <0 0x5c75000 0 0x1000>, + <0 0x5c52000 0 0x1000>, + <0 0x5c53000 0 0x1000>, + <0 0x5c6f000 0 0x4000>, + <0 0x5c76000 0 0x4000>; + reg-names = "csid0", + "csid1", + "csiphy0", + "csiphy1", + "vfe0", + "vfe1"; + + interrupts = , + , + , + , + , + ; + interrupt-names = "csid0", + "csid1", + "csiphy0", + "csiphy1", + "vfe0", + "vfe1"; + + power-domains = <&gcc GCC_CAMSS_TOP_GDSC>; + + clocks = <&gcc GCC_CAMERA_AHB_CLK>, + <&gcc GCC_CAMSS_AXI_CLK>, + <&gcc GCC_CAMSS_TOP_AHB_CLK>, + <&gcc GCC_CAMSS_TFE_0_CSID_CLK>, + <&gcc GCC_CAMSS_TFE_1_CSID_CLK>, + <&gcc GCC_CAMSS_CPHY_0_CLK>, + <&gcc GCC_CAMSS_CPHY_1_CLK>, + <&gcc GCC_CAMSS_CSI0PHYTIMER_CLK>, + <&gcc GCC_CAMSS_CSI1PHYTIMER_CLK>, + <&gcc GCC_CAMSS_TFE_0_CLK>, + <&gcc GCC_CAMSS_TFE_1_CLK>, + <&gcc GCC_CAMSS_TFE_0_CPHY_RX_CLK>, + <&gcc GCC_CAMSS_TFE_1_CPHY_RX_CLK>, + <&gcc GCC_CAMSS_NRT_AXI_CLK>, + <&gcc GCC_CAMSS_RT_AXI_CLK>; + clock-names = "ahb", + "axi", + "top_ahb", + "csi0", + "csi1", + "csiphy0", + "csiphy1", + "csiphy0_timer", + "csiphy1_timer", + "vfe0", + "vfe1", + "vfe0_cphy_rx", + "vfe1_cphy_rx", + "camnoc_nrt_axi", + "camnoc_rt_axi"; + + iommus = <&apps_smmu 0x400 0x0>, + <&apps_smmu 0x800 0x0>, + <&apps_smmu 0x820 0x0>, + <&apps_smmu 0x840 0x0>; + + interconnects = <&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG + &config_noc SLAVE_CAMERA_CFG RPM_ALWAYS_TAG>, + <&mmrt_virt MASTER_CAMNOC_HF RPM_ALWAYS_TAG + &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>, + <&mmnrt_virt MASTER_CAMNOC_SF RPM_ALWAYS_TAG + &bimc SLAVE_EBI1 RPM_ALWAYS_TAG>; + interconnect-names = "ahb", + "hf_mnoc", + "sf_mnoc"; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + }; + + port@1 { + reg = <1>; + }; + }; + }; + mdss: display-subsystem@5e00000 { compatible = "qcom,qcm2290-mdss"; reg = <0x0 0x05e00000 0x0 0x1000>;