From patchwork Sat Nov 6 15:54:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 12606335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A825C433F5 for ; Sat, 6 Nov 2021 15:54:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE0286124D for ; Sat, 6 Nov 2021 15:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233935AbhKFP52 (ORCPT ); Sat, 6 Nov 2021 11:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbhKFP51 (ORCPT ); Sat, 6 Nov 2021 11:57:27 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D2DC061570; Sat, 6 Nov 2021 08:54:46 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id k22so824919iol.13; Sat, 06 Nov 2021 08:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iiKkWXx7LH2mtsbKdfcA3IaZmnBXPN3UgFdD8y0kBYA=; b=MJxwBVe9vLmvxQwX+/3/BR4kcgDSfMwKNajXuRCbZSQXxFYDunWJ8Q0+HSe7Hq/IKn qw4sCGPdv/TEkP6fm9DH6+01JgDt0ANlSOwFgn5jU0EtOch35OOrDTdFmPJ7nknZgoJr Ty+qxgkBgSNiN+dzo0hJtwBnmhEl2+Qck8f5LXeAk/08dweFu1/MIIrfPgIl5ZKm6dpl ACwhe8NDeG/ypLFfBB2Upq92BbqcCpOvtnX2ZMcqCA/i5Cqy31eTMVGPMboLbaG1Y9/b 77pP2jOmvtkpT2WPsd4fX/DoancCOYhqejRuNZAh95OITWsRCmlIsUb9p3pHVqHjWXFi 0Wew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iiKkWXx7LH2mtsbKdfcA3IaZmnBXPN3UgFdD8y0kBYA=; b=BA3JNacb5nt7EMqB/dCpGZB+7dAoFIXnpsFdYN86SLaRALPOn3NO/83/5spS9gDtiZ O8/SW5vAqVsTpEPUp3kRgVZVOW7DIKYxx2jaizUJETW/ft7sQUEYPc1EkYFUkL4E9U73 LSG44ECf0OZDFKyOfOk0/si79bQfYt21iCgYRRdkexsFffN/wCnALfkFBO8CSxN/7HXr M9rJqLDQey+6TrfHffYVO+A0DqsIHM92DxQSCx//wX7PhwVwmkLAuOf+06WNYEf4X/PA Uus3MWks3gx6HBqOAYs8fDSnj9xL4aRcSu18YQUuXRzZ7On3OhppWYZd/Jna6kWqwQ3V rBlg== X-Gm-Message-State: AOAM532RuQb0WDhf4sByZnKrJLIhx9KozDGz/q9OqHBk4cCrLvOw7sBE Fz7IsvizukiKojDMMKw2UHA= X-Google-Smtp-Source: ABdhPJxtrSSYCX6qkHYipUtxezBT7pSTriqytk8UjlFhB6d5r7EJeLQHagN9vMzwwHmiq3/E09KJgg== X-Received: by 2002:a05:6602:1607:: with SMTP id x7mr4941365iow.134.1636214085658; Sat, 06 Nov 2021 08:54:45 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:64ba:1c0f:6d36:c11d]) by smtp.gmail.com with ESMTPSA id d2sm5718313ilg.77.2021.11.06.08.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 08:54:44 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: tharvey@gateworks.com, frieder.schrempf@kontron.de, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, aford@beaconembedded.com, cstevens@beaconembedded.com, jagan@amarulasolutions.com, Adam Ford , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Peng Fan , Lucas Stach , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 1/5] soc: imx: imx8m-blk-ctrl: Fix imx8mm mipi reset Date: Sat, 6 Nov 2021 10:54:23 -0500 Message-Id: <20211106155427.753197-1-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Most of the blk-ctrl reset bits are found in one register, however there are two bits in offset 8 for pulling the MIPI DPHY out of reset and these need to be set when IMX8MM_DISPBLK_PD_MIPI_CSI is brought out of reset or the MIPI_CSI hangs. Fixes: 926e57c065df ("soc: imx: imx8m-blk-ctrl: add DISP blk-ctrl") Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Reviewed-by: Lucas Stach --- V2: Make a note that the extra register is only for Mini/Nano DISPLAY_BLK_CTRL Rename the new register to mipi_phy_rst_mask Encapsulate the edits to this register with an if-statement drivers/soc/imx/imx8m-blk-ctrl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c index 519b3651d1d9..581eb4bc7f7d 100644 --- a/drivers/soc/imx/imx8m-blk-ctrl.c +++ b/drivers/soc/imx/imx8m-blk-ctrl.c @@ -17,6 +17,7 @@ #define BLK_SFT_RSTN 0x0 #define BLK_CLK_EN 0x4 +#define BLK_MIPI_RESET_DIV 0x8 /* Mini/Nano DISPLAY_BLK_CTRL only */ struct imx8m_blk_ctrl_domain; @@ -36,6 +37,15 @@ struct imx8m_blk_ctrl_domain_data { const char *gpc_name; u32 rst_mask; u32 clk_mask; + + /* + * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register + * which is used to control the reset for the MIPI Phy. + * Since it's only present in certain circumstances, + * an if-statement should be used before setting and clearing this + * register. + */ + u32 mipi_phy_rst_mask; }; #define DOMAIN_MAX_CLKS 3 @@ -78,6 +88,8 @@ static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd) /* put devices into reset */ regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); + if (data->mipi_phy_rst_mask) + regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); /* enable upstream and blk-ctrl clocks to allow reset to propagate */ ret = clk_bulk_prepare_enable(data->num_clks, domain->clks); @@ -99,6 +111,8 @@ static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd) /* release reset */ regmap_set_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); + if (data->mipi_phy_rst_mask) + regmap_set_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); /* disable upstream clocks */ clk_bulk_disable_unprepare(data->num_clks, domain->clks); @@ -120,6 +134,9 @@ static int imx8m_blk_ctrl_power_off(struct generic_pm_domain *genpd) struct imx8m_blk_ctrl *bc = domain->bc; /* put devices into reset and disable clocks */ + if (data->mipi_phy_rst_mask) + regmap_clear_bits(bc->regmap, BLK_MIPI_RESET_DIV, data->mipi_phy_rst_mask); + regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, data->rst_mask); regmap_clear_bits(bc->regmap, BLK_CLK_EN, data->clk_mask); @@ -488,6 +505,7 @@ static const struct imx8m_blk_ctrl_domain_data imx8mm_disp_blk_ctl_domain_data[] .gpc_name = "mipi-csi", .rst_mask = BIT(3) | BIT(4), .clk_mask = BIT(10) | BIT(11), + .mipi_phy_rst_mask = BIT(16) | BIT(17), }, }; From patchwork Sat Nov 6 15:54:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 12606337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D3CAC433EF for ; Sat, 6 Nov 2021 15:54:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 634D06108C for ; Sat, 6 Nov 2021 15:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233396AbhKFP5b (ORCPT ); Sat, 6 Nov 2021 11:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbhKFP5a (ORCPT ); Sat, 6 Nov 2021 11:57:30 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3465C061570; Sat, 6 Nov 2021 08:54:48 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id c3so720600iob.6; Sat, 06 Nov 2021 08:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xlbEuMkmcRjubQYNuPiav4PNtAAXrSUF3zgeRzk/Gy8=; b=fc/kMKxMM3Jrkdr0S9iYURs3Tod1RIp02N5vNEyqxSYh1RneaoEEV3P2SJe/HKSJil KJipsjIC6PtO4FO0JJ9qBfXbDBnJG7r+jglc1EYuvgGdh2F3+0j4jEkCgToaPpBevTZs Ng0VcRNuP1ST181ufAze3evtCJMfMhM5Ol3pNKpLxdqHbopyr1IZxSq9I5EqLOxap3K2 Xe+X984B7V6mw2vJydW7ld6oHPWa9olRk6GMAa4MHNxzvCZ1M8Tdgrbe3cvRPWEZtWCC 0PgDjJlBFrgOSRKFan6cTehdQqQF7zIfDlXFI2woRjNdN+9lsdLUPXCIQmrixiy9ic1E 9HmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xlbEuMkmcRjubQYNuPiav4PNtAAXrSUF3zgeRzk/Gy8=; b=LUE5K7afnboaxKizFjcrdiGeCyC2UZsxLnfcTknrR3uqpJs6eDAGEXppL+rwZ3KbYE RpQNmY5zd2dgeZDYMVn3sWSn/AP6hEof5xeR51y+4cMAJPGkkZx3LH5i7Q1JNIT4Ellq lUaA0ZTLU77Hki6NxbY/qru6HRBwwXZUxs4uL/Spv3y7LB1qULO1FABCHgTZLil6KTW3 GNnz8huaw/xeHZ8FpNJeu3aYkWvwNO95YRaTxVebAatvecJfX0xJdYGqVUJvTWLgYPcv LD/fDbyJehHLevXSNWsk1Z69ODENh3cWVVour8fbVmO9riwG2XVy4jH0hKCFJFWlw1EO wtTA== X-Gm-Message-State: AOAM531dE0JGo/e3pm1HLE9iIVydktmRlvkDCByWgEQTo4Vu7iiQ0due yRs8986AKVigNb1aaS6YYSo= X-Google-Smtp-Source: ABdhPJyeMLhlNCeFZ4dvYT/Yc2Ab+v62itqCY4n1vu2RjVpDay9V89bezkrsCwBb4h4GKVdp8B5uVQ== X-Received: by 2002:a05:6602:3419:: with SMTP id n25mr3796778ioz.57.1636214087972; Sat, 06 Nov 2021 08:54:47 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:64ba:1c0f:6d36:c11d]) by smtp.gmail.com with ESMTPSA id d2sm5718313ilg.77.2021.11.06.08.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 08:54:47 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: tharvey@gateworks.com, frieder.schrempf@kontron.de, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, aford@beaconembedded.com, cstevens@beaconembedded.com, jagan@amarulasolutions.com, Adam Ford , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Peng Fan , Lucas Stach , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/5] arm64: dts: imx8mm: Add CSI nodes Date: Sat, 6 Nov 2021 10:54:24 -0500 Message-Id: <20211106155427.753197-2-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211106155427.753197-1-aford173@gmail.com> References: <20211106155427.753197-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org There is a csi bridge and csis interface that tie together to allow csi2 capture. Signed-off-by: Adam Ford Reviewed-by: Laurent Pinchart Reviewed-By: Tim Harvey Tested-By: Tim Harvey Reviewed-by: Fabio Estevam --- V2: No change arch/arm64/boot/dts/freescale/imx8mm.dtsi | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi index c2f3f118f82e..1f69c14d953f 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi @@ -1068,6 +1068,22 @@ aips4: bus@32c00000 { #size-cells = <1>; ranges = <0x32c00000 0x32c00000 0x400000>; + csi: csi@32e20000 { + compatible = "fsl,imx8mm-csi", "fsl,imx7-csi"; + reg = <0x32e20000 0x1000>; + interrupts = ; + clocks = <&clk IMX8MM_CLK_CSI1_ROOT>; + clock-names = "mclk"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_CSI_BRIDGE>; + status = "disabled"; + + port { + csi_in: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_out>; + }; + }; + }; + disp_blk_ctrl: blk-ctrl@32e28000 { compatible = "fsl,imx8mm-disp-blk-ctrl", "syscon"; reg = <0x32e28000 0x100>; @@ -1095,6 +1111,41 @@ disp_blk_ctrl: blk-ctrl@32e28000 { #power-domain-cells = <1>; }; + mipi_csi: mipi-csi@32e30000 { + compatible = "fsl,imx8mm-mipi-csi2"; + reg = <0x32e30000 0x1000>; + interrupts = ; + assigned-clocks = <&clk IMX8MM_CLK_CSI1_CORE>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>; + assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_1000M>, + <&clk IMX8MM_SYS_PLL2_1000M>; + clock-frequency = <333000000>; + clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>, + <&clk IMX8MM_CLK_CSI1_ROOT>, + <&clk IMX8MM_CLK_CSI1_PHY_REF>, + <&clk IMX8MM_CLK_DISP_AXI_ROOT>; + clock-names = "pclk", "wrap", "phy", "axi"; + power-domains = <&disp_blk_ctrl IMX8MM_DISPBLK_PD_MIPI_CSI>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + }; + + port@1 { + reg = <1>; + + imx8mm_mipi_csi_out: endpoint { + remote-endpoint = <&csi_in>; + }; + }; + }; + }; + usbotg1: usb@32e40000 { compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb"; reg = <0x32e40000 0x200>; From patchwork Sat Nov 6 15:54:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 12606339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AE61C433FE for ; Sat, 6 Nov 2021 15:54:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 015EC6108C for ; Sat, 6 Nov 2021 15:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234529AbhKFP5h (ORCPT ); Sat, 6 Nov 2021 11:57:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234504AbhKFP5b (ORCPT ); Sat, 6 Nov 2021 11:57:31 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8308DC061714; Sat, 6 Nov 2021 08:54:50 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id z206so14265446iof.0; Sat, 06 Nov 2021 08:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a7XNPVMIy98WZ+IbOsiYnn8UHL05ZLnQcKzciYPO5ok=; b=bWJSfuEH8vrp/4kT7BNRQT+Z6LVsDcHOX1hw6yUdNfZ6iAgOMsY3YL3HFWcfCiYPKu lXAJhmd/2dDUtoc5J1/3JUbUDvesmDE9n7Ttwjnks28/Pasc7GzxZY4g4p0l+2d0BgNc U3fpjVeE7Ll/DmNeq+Ps+C8ck/psM59JJXgmmWHlsdlFmnQm9v1ZRa3JoG91dQ0xbbqH C9Vv95utJOdqCttZAyYaILf2e8XByHIh0BPZjbB8OfBL6uyvKC6fvnUPHp0i9cGDAr9x ev47Py0ZBAw5huiDPIC8gWTr0QOn/ER62kHgmwxN63PgkdInXIbOtS2bFf8VhFnNfx0s yYQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a7XNPVMIy98WZ+IbOsiYnn8UHL05ZLnQcKzciYPO5ok=; b=KaiMkj6eZmjv6ymCZf49lw6mpDtSzYyD740wLRakfd4fKcnGb1TmGw6gQEWPLmwuEV 4C4YUh08UI7JcmyVFulGMW4pFFiU5i21o+uQCyAi/pbuPbK2uVrynBGVo+evDcPOirFv KVyRLXZfs3V5c4RX2l1VvxCenbOzrB5em7wkp69o6L26JnQ5YVmgtr/NYh4YGCXCEkJW Q+6N5QDH+sI1w/1HBXLaIKMkDorTGdQohPtq1jp+raJoyvZXje+aT1RkMvzm+5ZkTmVZ UusIQoR8rXJBwzX82x65D8xREjjfTjH9crYbMhgR/TUgNAr9Ikt8PqY2y3NVmXxkBvls fPLA== X-Gm-Message-State: AOAM533oiJDYelPHT3F3ZhrDP/ST1LaZ8cBCpDZJtgwPiicvgwhJrjN6 K99p1KTOdVEIm3+nRmyEhg0= X-Google-Smtp-Source: ABdhPJzEjVwqo8hUmbWdU7/Wbj/y7B7b5TydZWgt5ZaoTxhCBhIqv6pnYBf6XK/BL7BRz4CRYaTZDw== X-Received: by 2002:a6b:6b08:: with SMTP id g8mr4714187ioc.150.1636214089881; Sat, 06 Nov 2021 08:54:49 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:64ba:1c0f:6d36:c11d]) by smtp.gmail.com with ESMTPSA id d2sm5718313ilg.77.2021.11.06.08.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 08:54:49 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: tharvey@gateworks.com, frieder.schrempf@kontron.de, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, aford@beaconembedded.com, cstevens@beaconembedded.com, jagan@amarulasolutions.com, Adam Ford , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Peng Fan , Lucas Stach , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 3/5] arm64: defconfig: Enable VIDEO_IMX_MEDIA Date: Sat, 6 Nov 2021 10:54:25 -0500 Message-Id: <20211106155427.753197-3-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211106155427.753197-1-aford173@gmail.com> References: <20211106155427.753197-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org To use a camera, the CSIS and CSI drivers need to be enabled with VIDEO_IMX_MEDIA. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam --- V2: No Change arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index f2e2b9bdd702..bc261cf2ef5a 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -958,6 +958,7 @@ CONFIG_MFD_CROS_EC_DEV=y CONFIG_STAGING=y CONFIG_STAGING_MEDIA=y CONFIG_VIDEO_HANTRO=m +CONFIG_VIDEO_IMX_MEDIA=m CONFIG_CHROME_PLATFORMS=y CONFIG_CROS_EC=y CONFIG_CROS_EC_I2C=y From patchwork Sat Nov 6 15:54:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 12606341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE262C433EF for ; Sat, 6 Nov 2021 15:55:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9F1C6124D for ; Sat, 6 Nov 2021 15:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234549AbhKFP5i (ORCPT ); Sat, 6 Nov 2021 11:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234519AbhKFP5d (ORCPT ); Sat, 6 Nov 2021 11:57:33 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 963CBC061570; Sat, 6 Nov 2021 08:54:52 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id i11so3347776ilv.13; Sat, 06 Nov 2021 08:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bumy0VDul+gcmA0r67vymTvlrNYaUXXRfbPb8ywD07g=; b=l4ZyS5nX9X1I0dFs+nluMoED++JUqsHsoFPn3JRg28ABTcCC/V22KjGA+Ft69dzWTn m1eaIwyrzBd8rGMHFWxa6BlDRO7wXm+5BRklPKyCCZ11ztxdhNbmsqxvxuiwgXzoc+MG G6NxO8K24JgkHmOexI62bSpQj3FlWimWgo1sN6J591cn8oUb5VjE1EWVRFZCceaQt0Mn aqnu3t+IJhdOa8P0EqkQ6TZCvHocxeDzVHMY26wuRySz3vo1wLAtvFfvQIqgeahE3FLf J17e36rK9jeGDkBflD6K3A/54xiwnsGNL5quTU2rfRYtBxPUDdtcXgDEnNGtWJQQzrBv bV0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bumy0VDul+gcmA0r67vymTvlrNYaUXXRfbPb8ywD07g=; b=CSCsA83rt9CU0qRhEdSJzz84QwnfmuOvdSFx1pI3N7n/NkLVgeI6FNiGD2Y8dyPTZS aPxrWho86I0tOeL6a8UB47ZCZIuoip0789Dex/WXx+H4FrHdki1IQcIQE/Von+UZ5vsx MNYLJkitoU9rhwp+nyJHvRG+wPdmU6DMk6+wk+qL6kGlriKpYWRkjCK5rEPzqomnuSTR gB8iaIMBwnPZQzx/veA0fR+wGnomWCMnpIeGKblzmw0Tm8pXI86HY6q96n7Bgx1z2jKb gTsTLh9n8RwwJeQn1V+GA3gD0GQqeXqyg6qds4zvwx8exgylPGFPBhp3TEvor5ToNcxs RBww== X-Gm-Message-State: AOAM531oeXZjCUQOCfD9o0FFvu0taAHzO0Yoizcd4OYK23IAhBFBb2mX Eaf+pl2SWbADZU2jeRkHaoM= X-Google-Smtp-Source: ABdhPJxV6c2Llyaj0786TGHnFT2bxq61GmeS0chcYvU5Ulm1FlWJgPIBVkw/1YG2tUvw2F5CcYySrA== X-Received: by 2002:a05:6e02:1ba4:: with SMTP id n4mr27912049ili.269.1636214091942; Sat, 06 Nov 2021 08:54:51 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:64ba:1c0f:6d36:c11d]) by smtp.gmail.com with ESMTPSA id d2sm5718313ilg.77.2021.11.06.08.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 08:54:51 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: tharvey@gateworks.com, frieder.schrempf@kontron.de, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, aford@beaconembedded.com, cstevens@beaconembedded.com, jagan@amarulasolutions.com, Adam Ford , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Lucas Stach , Peng Fan , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 4/5] arm64: dts: imx8mm-beacon: Enable OV5640 Camera Date: Sat, 6 Nov 2021 10:54:26 -0500 Message-Id: <20211106155427.753197-4-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211106155427.753197-1-aford173@gmail.com> References: <20211106155427.753197-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The baseboard has support for a TDNext 5640 Camera which uses an OV5640 connected to a 2-lane CSI2 interface. With the CSI and mipi_csi2 drivers pointing to an OV5640 camera, the media pipeline can be configured with the following: media-ctl --links "'ov5640 1-003c':0->'imx7-mipi-csis.0':0[1]" The camera and various nodes in the pipeline can be configured for UYVY: media-ctl -v -V "'ov5640 1-003c':0 [fmt:UYVY8_1X16/640x480 field:none]" media-ctl -v -V "'csi':0 [fmt:UYVY8_1X16/640x480 field:none]" Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam --- V2: No change .../freescale/imx8mm-beacon-baseboard.dtsi | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi index 6f5e63696ec0..0fb95f4a5e78 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi @@ -43,6 +43,16 @@ reg_audio: regulator-audio { enable-active-high; }; + reg_camera: regulator-camera { + compatible = "regulator-fixed"; + regulator-name = "mipi_pwr"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + gpio = <&pca6416_1 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + startup-delay-us = <100000>; + }; + reg_usdhc2_vmmc: regulator-usdhc2 { compatible = "regulator-fixed"; regulator-name = "VSD_3V3"; @@ -67,6 +77,10 @@ sound { }; }; +&csi { + status = "okay"; +}; + &ecspi2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_espi2>; @@ -90,6 +104,30 @@ &i2c2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2>; status = "okay"; + + camera@3c { + compatible = "ovti,ov5640"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ov5640>; + reg = <0x3c>; + clocks = <&clk IMX8MM_CLK_CLKO1>; + clock-names = "xclk"; + assigned-clocks = <&clk IMX8MM_CLK_CLKO1>; + assigned-clock-parents = <&clk IMX8MM_CLK_24M>; + assigned-clock-rates = <24000000>; + AVDD-supply = <®_camera>; /* 2.8v */ + powerdown-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + + port { + /* MIPI CSI-2 bus endpoint */ + ov5640_to_mipi_csi2: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_in>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; }; &i2c4 { @@ -141,6 +179,18 @@ pca6416_1: gpio@21 { }; }; +&mipi_csi { + status = "okay"; + ports { + port@0 { + imx8mm_mipi_csi_in: endpoint { + remote-endpoint = <&ov5640_to_mipi_csi2>; + data-lanes = <1 2>; + }; + }; + }; +}; + &sai3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai3>; @@ -209,6 +259,14 @@ MX8MM_IOMUXC_SAI3_RXFS_GPIO4_IO28 0x41 >; }; + pinctrl_ov5640: ov5640grp { + fsl,pins = < + MX8MM_IOMUXC_GPIO1_IO07_GPIO1_IO7 0x19 + MX8MM_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x19 + MX8MM_IOMUXC_GPIO1_IO14_CCMSRCGPCMIX_CLKO1 0x59 + >; + }; + pinctrl_pcal6414: pcal6414-gpiogrp { fsl,pins = < MX8MM_IOMUXC_SAI2_MCLK_GPIO4_IO27 0x19 From patchwork Sat Nov 6 15:54:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 12606343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED75DC433FE for ; Sat, 6 Nov 2021 15:55:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC5EC61284 for ; Sat, 6 Nov 2021 15:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234570AbhKFP5k (ORCPT ); Sat, 6 Nov 2021 11:57:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234532AbhKFP5g (ORCPT ); Sat, 6 Nov 2021 11:57:36 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E7A8C061714; Sat, 6 Nov 2021 08:54:54 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id k1so12568430ilo.7; Sat, 06 Nov 2021 08:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nBcoZb4cANV3EfFk1jlOBnnvSvADPABY6nQqW9dTSxE=; b=FJmuv4f4v2wR4rm6As+zpSWSJORr++vMB3aFxmJjj1UUfufQ7cbFbwajKusW2ILhwA GDCGrTDvjvfHacZ2zWNy/LKu0TzA1vmUStLhTQ1mQaLNguF52x20l61EUJkybP76YDi5 +E+6nE9s+ur87TDnVGox9dEZD2Hp6g9bny63zZexWplZKBUqMJBojFWcmVkWzsV43+4/ iOYBjw3jQa1tv2cVOFnxvD1CTO35iKteo4v2heKCc1Z1RfYRrlld3xyHA2ybTtgmK5Mq nLssraQuK2791u748s1miSVG9NiMuUn1RuKMif1tTwkfFbHb/pbmykuZ6oU+b+7LRqRI 9Viw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nBcoZb4cANV3EfFk1jlOBnnvSvADPABY6nQqW9dTSxE=; b=BATceiKQfO0Xo/1fxQMz4QU49Bq8w6vORd9Zg8Wp8u4ntBMd9Z3fS5JzAVzELkSkMp pkKPTJG0q8U6+oPo5FF9xtBO9giuf26bq9AQRMlaTcHuMItXh7M8amzkbJdUfz9A061G Nh1iGKcmNwyLIJtscFZZyzQQlBReldRGDr6K6vlViAjs98HHyPNgXkg4ucnU009FFeNo npgrmOVCBpS1tk0ui7Yf37wRERix0ENCdOKmrfs2eSrhl/QSVP7clxPNuzSG6V9XKgm5 /+64iR7KUqbC6Pz9U7y8Ho8FqGB57GrqYLThDTYzPfcCCC7lsgiTJQD8io85kOZTaygO xYbA== X-Gm-Message-State: AOAM533UMc3kColQfMwY/qtJpXsrduoiqfuk+lP4stH1fKWDqwoqn7cD VYisHK2ZbOEbn3prA8btjEU= X-Google-Smtp-Source: ABdhPJy+BiqbWNfyydrcutyDetwpsLA0bY1tGP2GgldxnjF3A4eVczGPjf0kgIiTo2s3QdyGSkSoCA== X-Received: by 2002:a05:6e02:168c:: with SMTP id f12mr26512828ila.171.1636214093765; Sat, 06 Nov 2021 08:54:53 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:64ba:1c0f:6d36:c11d]) by smtp.gmail.com with ESMTPSA id d2sm5718313ilg.77.2021.11.06.08.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 08:54:53 -0700 (PDT) From: Adam Ford To: linux-arm-kernel@lists.infradead.org Cc: tharvey@gateworks.com, frieder.schrempf@kontron.de, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, aford@beaconembedded.com, cstevens@beaconembedded.com, jagan@amarulasolutions.com, Adam Ford , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Peng Fan , Lucas Stach , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 5/5] arm64: defconfig: Enable OV5640 Date: Sat, 6 Nov 2021 10:54:27 -0500 Message-Id: <20211106155427.753197-5-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211106155427.753197-1-aford173@gmail.com> References: <20211106155427.753197-1-aford173@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The Beacon EmbeddedWorks imx8mm development kit has a TD Next 5640 Camera. Enable the OV5640 driver to use the camera. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam --- V2: No Change arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index bc261cf2ef5a..4c1eb9aae5e5 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -668,6 +668,7 @@ CONFIG_VIDEO_QCOM_VENUS=m CONFIG_SDR_PLATFORM_DRIVERS=y CONFIG_VIDEO_RCAR_DRIF=m CONFIG_VIDEO_IMX219=m +CONFIG_VIDEO_OV5640=m CONFIG_VIDEO_OV5645=m CONFIG_VIDEO_QCOM_CAMSS=m CONFIG_DRM=m