From patchwork Wed Jan 27 14:49:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 371538 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp337459jam; Wed, 27 Jan 2021 06:52:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy95palm5g3cTZRYaFnLUZb3BXmQWVigfiiYXs9H5h7CgnBvO/w4qIW5UvPEip/L5gmOy4p X-Received: by 2002:aa7:d651:: with SMTP id v17mr9540375edr.91.1611759152868; Wed, 27 Jan 2021 06:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611759152; cv=none; d=google.com; s=arc-20160816; b=vmUAsU2kbMTTX7irgVVaQCJnbpjrNca0M3oCMzuVbKgBJErtKxaKwMbEa4UPxtQFiA iD4iBIEPP7xcb/ANIYuz0GJgVLR9fByrmzJjFOjZr0PaKjZ9ugf3SzCfaw+TVPxNIwhE qLYujVmohrBShKvMRbh5Uz899YmQLIlwo06pjrQPciKtTm631cNshU9xWg/73qPw7RSI rBPf5goGVwDC5qomMm723L8zz9BQYwJePEPir3YxhoJ1hGncEvmwlBwpHKX1To3T1vkQ 1ittjba2h8oHInrnPEFCiFI0kyhk0XX8h/nbKPvDcLDC9q3nMCpCECZC9SAC1ZNK1S/h rVFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GCGC/gkCyw1X0Err6vZJJCoT1TDJpHK/DfxHGbzxp00=; b=OT8xK2qwLuHPutndkneAY6MPhtT+So1uIt5jTqYPJQslHJHA4xoBknS7jPHdQGs/tX 8fP/odkqGCV0EFJSDn3afilJKuUjyI2ClG8Q2G8GXMZbMHud6ZkUGzRHM4LVvJq98R8X XKgHq5YpaT9+cc+3nEG1qyT2Xj+S2/yimgt1FQqT8GSyDZ9vBoUXHC73uidh1S6VWqxt wExY+57Ycxx5ANOz+dkwGJ1UhGGzyySdp5nNiMlSCoxsAaB3zyodF5MzPgfOEV8bYLoq ZHmCUwA4yDN/fGP+pAbDkMTor4Bd0wlYs6Qo6p5sBIMVrHLcu+zHvaE8vDFzTm2ynsyH o/UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HDMOxm8B; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si1149323edg.300.2021.01.27.06.52.32; Wed, 27 Jan 2021 06:52:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HDMOxm8B; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234589AbhA0OvO (ORCPT + 15 others); Wed, 27 Jan 2021 09:51:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234325AbhA0Our (ORCPT ); Wed, 27 Jan 2021 09:50:47 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 216F4C061756 for ; Wed, 27 Jan 2021 06:50:07 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id c6so2796402ede.0 for ; Wed, 27 Jan 2021 06:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GCGC/gkCyw1X0Err6vZJJCoT1TDJpHK/DfxHGbzxp00=; b=HDMOxm8BahVW66FebcoyOtIxADN4QSEmi0GGMF1ClaANemxus4PC6mIRHDfmylCRag dNGaPo5EGnabEx0h+qvBjn29EtyfJ9NqWPcllg9p5GrPgU3DtckdMhWf7WD8LU3zNZpb tgJp0pBZc5faWCSFbr9pXdqGUrp3AC89KHS669wMphvUpkZFIPOEU1gbppH3TG+AJ6t1 3sCPaBuMK9bvsGBdkLHfj8BNTvNrID7JE9pzB+dp4n3Kwzsrmll6CGB30cFquxNUIjXT eRlMr6PFh3orGEXZ4n+6/qEHt+uAzE7b+EdnowlWpL/NFGWEzsD9w4vzbjhS0jsPejOS ZMfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GCGC/gkCyw1X0Err6vZJJCoT1TDJpHK/DfxHGbzxp00=; b=J0kFJdvgqMMyYwny/3QgY/luE1A13kF/FJ6yrsLjaxAPgqYsz7YXZMQ+oIBDhr5GMS MnF0AYPcTrmxeZzwFZc+gZb921GstFVdBCwSVIrnwYFQPZ3R7g2qcNbb33W0HS0p7pHJ butLx/ApCxTbiD83c9q8pBS8EPp6Kc7ZJ7yYqxuvAU0B0omlgbo0RRM3w5QBhPVq8bmh jFgT8sD7EQY28BD59Q8UgXXClSeM0w8ut6GPJcr8rsqt6H1+y/8R6gtSAWI40jAcDfrQ 7z8EjW5BmhmAJt9boEmSAY5K9s6QeLrLr+BoVM0Iyd1bdPXcJTN6j24l8vD7AwFCIB2r ggug== X-Gm-Message-State: AOAM531Q4M7w2il/eYJ7LIWdgRumrEMp4sKSO+ortGqwPRVALU+GJ1lO 8ZZv6R7VjAfrwnyIVY8E4BhVSg== X-Received: by 2002:a05:6402:78f:: with SMTP id d15mr9145986edy.362.1611759005648; Wed, 27 Jan 2021 06:50:05 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:62e7:589a:1625:7acc]) by smtp.gmail.com with ESMTPSA id ah12sm947799ejc.70.2021.01.27.06.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 06:50:04 -0800 (PST) From: Robert Foss To: agross@kernel.org, bjorn.andersson@linaro.org, robert.foss@linaro.org, todor.too@gmail.com, mchehab@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will@kernel.org, shawnguo@kernel.org, leoyang.li@nxp.com, geert+renesas@glider.be, arnd@arndb.de, Anson.Huang@nxp.com, michael@walle.cc, agx@sigxcpu.org, max.oss.09@gmail.com, angelogioacchino.delregno@somainline.org, linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Rob Herring , Andrey Konovalov Cc: Tomasz Figa , Azam Sadiq Pasha Kapatrala Syed , Sarvesh Sridutt , Laurent Pinchart , Jonathan Marek Subject: [PATCH v3 00/22] Add support for the SDM845 Camera Subsystem Date: Wed, 27 Jan 2021 15:49:08 +0100 Message-Id: <20210127144930.2158242-1-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This series implements support for the camera subsystem found in the SDM845 SOCs and the Titan 170 ISP. The support is partial in that it implements CSIPHY, CSID, and partial VFE support. The Titan generation of the ISP diverges a fair amount from the design of the previous architecture generation, CAMSS. As a result some pretty invasive refactoring is done in this series. It also means that at this time we're unable to implement support for all of the IP blocks contained. This is due to a combination of legal considerations with respect to the IP and its owner Qualcomm and time & man hour constrains on the Linaro side. The CSIPHY (CSI Physical Layer) & CSID (CSI Decoder) support is complete, but the VFE (Video Front End, which is referred to as IFE (Image Front End) in the Titan generation of ISPs) only has support for the RDI (Raw Dump Interface) which allows the raw output of the CSID to be written to memory. The 2nd interface implemented in the VFE silicon is the PIX interface, and camss does not support it for this generation of ISPs. The reason for this is that the PIX interface is used for sending image data to the BPS (Bayer Processing Section) & IPE (Image Processing Engine), but both of these units are beyond the scope of enabling basic ISP functionality for the SDM845. Since the Titan architecture generation diverges quite a bit from the CAMSS generation, a lot of pretty major refactoring is carried out in this series. Both the CSID & VFE core paths are made more general and hardware version specific parts are broken out. The CSIPHY didn't require quite as radical changes and therefore keeps its current form. Tested on: - Qcom RB3 / db845c + camera mezzanine, which is SDM845 based - db410c + D3 Camera mezzanine, which is APQ8016 based Branch: - https://git.linaro.org/people/robert.foss/linux.git/log/?h=camss_sdm845_v1 - https://git.linaro.org/people/robert.foss/linux.git/log/?h=camss_sdm845_v2 - https://git.linaro.org/people/robert.foss/linux.git/log/?h=camss_sdm845_v3 Due to the dt-bindings supporting sdm660-camss, this series depends the sdm660 clock driver being upstreamed. I've linked this series below. SDM630/660 Multimedia and GPU clock controllers https://lkml.org/lkml/2020/9/26/166 Robert Foss (22): media: camss: Fix vfe_isr_comp_done() documentation media: camss: Fix vfe_isr comment typo media: camss: Add CAMSS_845 camss version media: camss: Make ISPIF subdevice optional media: camss: Refactor VFE HW version support media: camss: Add support for VFE hardware version Titan 170 media: camss: Add missing format identifiers media: camss: Refactor CSID HW version support media: camss: Add support for CSID hardware version Titan 170 media: camss: Add support for CSIPHY hardware version Titan 170 media: camss: Remove per VFE power domain toggling media: camss: Enable SDM845 dt-bindings: media: camss: Add qcom,msm8916-camss binding dt-bindings: media: camss: Add qcom,msm8996-camss binding dt-bindings: media: camss: Add qcom,sdm660-camss binding dt-bindings: media: camss: Add qcom,sdm845-camss binding MAINTAINERS: Change CAMSS documentation to use dtschema bindings media: dt-bindings: media: Remove qcom,camss documentation arm64: defconfig: Build Qcom CAMSS as module arm64: dts: sdm845: Add CAMSS ISP node arm64: dts: sdm845-db845c: Configure regulators for camss node arm64: dts: sdm845-db845c: Enable ov8856 sensor and connect to ISP .../devicetree/bindings/media/qcom,camss.txt | 236 ---- .../bindings/media/qcom,msm8916-camss.yaml | 256 ++++ .../bindings/media/qcom,msm8996-camss.yaml | 387 ++++++ .../bindings/media/qcom,sdm660-camss.yaml | 398 ++++++ .../bindings/media/qcom,sdm845-camss.yaml | 370 ++++++ MAINTAINERS | 2 +- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 23 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 130 ++ arch/arm64/configs/defconfig | 1 + drivers/media/platform/qcom/camss/Makefile | 6 + .../platform/qcom/camss/camss-csid-170.c | 602 +++++++++ .../platform/qcom/camss/camss-csid-4-1.c | 338 +++++ .../platform/qcom/camss/camss-csid-4-7.c | 406 ++++++ .../media/platform/qcom/camss/camss-csid.c | 620 +-------- .../media/platform/qcom/camss/camss-csid.h | 178 ++- .../qcom/camss/camss-csiphy-3ph-1-0.c | 182 ++- .../media/platform/qcom/camss/camss-csiphy.c | 66 +- .../media/platform/qcom/camss/camss-ispif.c | 117 +- .../media/platform/qcom/camss/camss-ispif.h | 3 +- .../media/platform/qcom/camss/camss-vfe-170.c | 804 ++++++++++++ .../media/platform/qcom/camss/camss-vfe-4-1.c | 119 +- .../media/platform/qcom/camss/camss-vfe-4-7.c | 240 ++-- .../media/platform/qcom/camss/camss-vfe-4-8.c | 1166 +++++++++++++++++ .../platform/qcom/camss/camss-vfe-gen1.c | 763 +++++++++++ .../platform/qcom/camss/camss-vfe-gen1.h | 110 ++ drivers/media/platform/qcom/camss/camss-vfe.c | 840 +----------- drivers/media/platform/qcom/camss/camss-vfe.h | 118 +- .../media/platform/qcom/camss/camss-video.c | 100 ++ drivers/media/platform/qcom/camss/camss.c | 419 ++++-- drivers/media/platform/qcom/camss/camss.h | 17 +- 30 files changed, 6959 insertions(+), 2058 deletions(-) delete mode 100644 Documentation/devicetree/bindings/media/qcom,camss.txt create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8916-camss.yaml create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8996-camss.yaml create mode 100644 Documentation/devicetree/bindings/media/qcom,sdm660-camss.yaml create mode 100644 Documentation/devicetree/bindings/media/qcom,sdm845-camss.yaml create mode 100644 drivers/media/platform/qcom/camss/camss-csid-170.c create mode 100644 drivers/media/platform/qcom/camss/camss-csid-4-1.c create mode 100644 drivers/media/platform/qcom/camss/camss-csid-4-7.c create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-170.c create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-4-8.c create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-gen1.c create mode 100644 drivers/media/platform/qcom/camss/camss-vfe-gen1.h -- 2.27.0 Reviewed-by: Rob Herring