From patchwork Fri Jan 8 12:04:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 12006483 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AD58C433E0 for ; Fri, 8 Jan 2021 12:09:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D1872388B for ; Fri, 8 Jan 2021 12:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D1872388B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=FxblPCqDfhuhujGsAIA8BP9fx/o7yuOxhSZo3bNvXiU=; b=XNeHeHDd0tMGTNU8JqKpuJGnNK BCJWNGMSiWhiLDfHnOU6DBvMOu9NHqvhSHs47vNk6fn7CPpFYE53osaIb+McyC0yeTgEw30iu+a48 ThAeQu28FLyV0coS70A0qgJ4HJ1A4CogqZk266RkFwHkgdOSjGfIxJgOOJWr/xF740yTwBuTaAiX9 vaVNWUX84PdIJYJqaKgTg8QSHlXqwskyFlwg3j7NAgqQlwrhmmnC0L75uPihKiESdOPNAlXNDOBJ+ REwPMGhH2CMcOCuxpuSjGjf+e/MeREuCI2Pi2uE+GQjXrvReBlizZ5tuPee/Pxwb+CmfRtUoLIpcN aBE/syhg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxqWO-0002RV-1l; Fri, 08 Jan 2021 12:05:36 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxqVf-0002I5-KZ for linux-arm-kernel@lists.infradead.org; Fri, 08 Jan 2021 12:04:55 +0000 Received: by mail-ej1-x632.google.com with SMTP id g20so14285644ejb.1 for ; Fri, 08 Jan 2021 04:04:49 -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=asWxFY0f6/Inx6rPHpsAJiBWcsPrumNhnqo0mf0c6II=; b=M1ZgjcdXul7+t7ICsKkbmaoMBiD4b4XCGxZuVkFJH8EdCSKwvBEPKMaElX/fWGSbWd MwyosPhwS/oQhskLw76mxJWRDizhPRJP70Qb1X7rlCfr6pLS4FvJXGtdav+RtKN6/4Ru ZY4Z6OC04j32hDVcYeDYMsIGw6/OsdRXTBktKkyVd3PxKHcNu5ut9csR4rNdN0DuwsIx AJorSzYlN14yLSpIh+vJNSrobLHWBaSCdCnvFc2qlzr8teEyWUorR+xhq9ndtUWDYxam K0ER8LxRH7OtDkytmgk2uDTUZVVodOFn01HWOQeaGex2xeBhyXpEAJU7vSW/9bPq7+nB 4Hiw== 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=asWxFY0f6/Inx6rPHpsAJiBWcsPrumNhnqo0mf0c6II=; b=ANGEkq+3j+R1XcGphMCsqHHO90TEE/LKlDm+nJVStQvauQKwZe5Q5n6NhoYt32ozyR TVOd1zPuuFax43NXoZEje7QqOjzlPQWwcGHHfUlRgjn9qhI8f23TQUCY49YGQdQVwnAG HvQqmXVIpFcWyTZpKA9Fc7iFMy0W5D3WpEPCAtzwEQvSB28CusW1V1xl4MQqHdzE2Ldo CFD9PhzVrnXC864yBC037ZckWj34gXy4mXO6DOhab+4iLIkB/zkkXv5V0XXvsc3J68zM 1kYw4Knxk+QxBdA21xQ9Nxy1bMONso7nNi0lUdwsq8PgDgqTEtd+Jj2ppJo82K1CyWhS lCKA== X-Gm-Message-State: AOAM530RB8dL9fhVouIbV9VciRqlCpubMqNW7E1Mm5z2X/El745fH6Eb 3t3D+5NpAk/O836bV4R3+agyrQ== X-Google-Smtp-Source: ABdhPJwDX9sqLk6ILtXbn402DuG+30QRQym/ut51FgHROgwjNeJ5iJoGFDe3UFj8N/it+VHW57x1Uw== X-Received: by 2002:a17:906:c83b:: with SMTP id dd27mr2518214ejb.356.1610107488699; Fri, 08 Jan 2021 04:04:48 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:bb2e:8b50:322a:1b9a]) by smtp.gmail.com with ESMTPSA id i18sm3674498edt.68.2021.01.08.04.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 04:04:47 -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, 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 , Andrey Konovalov Subject: [PATCH v1 00/17] Add support for SDM845 Camera Subsystem Date: Fri, 8 Jan 2021 13:04:12 +0100 Message-Id: <20210108120429.895046-1-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210108_070451_845055_DDB9337C X-CRM114-Status: GOOD ( 19.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Azam Sadiq Pasha Kapatrala Syed , Sarvesh Sridutt , Laurent Pinchart , Tomasz Figa Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Robert Foss (17): media: camss: Fix comment using wrong function name 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: dt-bindings: media: qcom,camss: Add bindings for SDM845 camss media: camss: Enable SDM845 arm64: defconfig: Build Qcom CAMSS as module arm64: dts: sdm845: Add CAMSS ISP node arm64: dts: sdm845-db845c: Add CAMSS ISP node arm64: dts: sdm845-db845c: Enable ov8856 sensor and connect to ISP .../devicetree/bindings/media/qcom,camss.txt | 51 +- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 28 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 151 +++ 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 | 177 ++- .../qcom/camss/camss-csiphy-3ph-1-0.c | 182 ++- .../media/platform/qcom/camss/camss-csiphy.c | 66 +- .../media/platform/qcom/camss/camss-ispif.c | 147 ++- .../media/platform/qcom/camss/camss-ispif.h | 3 +- .../media/platform/qcom/camss/camss-vfe-170.c | 808 ++++++++++++ .../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 | 760 +++++++++++ .../platform/qcom/camss/camss-vfe-gen1.h | 110 ++ drivers/media/platform/qcom/camss/camss-vfe.c | 838 +----------- drivers/media/platform/qcom/camss/camss-vfe.h | 118 +- .../media/platform/qcom/camss/camss-video.c | 100 ++ drivers/media/platform/qcom/camss/camss.c | 421 ++++-- drivers/media/platform/qcom/camss/camss.h | 17 +- 25 files changed, 5630 insertions(+), 1845 deletions(-) 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