From patchwork Thu Mar 16 14:08:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jayesh Choudhary X-Patchwork-Id: 70819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp526102wrt; Thu, 16 Mar 2023 07:51:58 -0700 (PDT) X-Google-Smtp-Source: AK7set9QEWAiSeygsi+lshROVX4Ayq7hxCASMFRCrAlNgBeqeIJ6cPMa8vAMrHqhXxQRUqIvnQxe X-Received: by 2002:a17:903:d1:b0:1a1:a273:1812 with SMTP id x17-20020a17090300d100b001a1a2731812mr33689plc.45.1678978318579; Thu, 16 Mar 2023 07:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678978318; cv=none; d=google.com; s=arc-20160816; b=mY09UxZkoGycStDH4OpkdUXwHtgF81UXwvkibBbA/1rHBGxnPox7f8o+UlQSzElaT7 bDKAZVPSiP9J+7Pu4ok3RKGbY27E75rXQ00C+3c/Q+phf3E2CRokh2ezljIkLkJsNXPP YQ5Y4SjBai/2+/tkPEOqty/0Jme5tUaVyriONGgEPR3V+9tVjMwUYi5PlmDXllDCn8ZD euM8iJ1GUvQ/Q/m8L1LsI5msncYVYjY06EPfoAUjTWEJaBkPkawLwIJ7ouEUo0NU3/8X FZ4f7URVgg22RZC6icycduhn4Faa5mUk3//eJlJIu/WCAMT5KBP1CHmSgy+JNOWN3JiV vehw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DFCetOEU3TZe5LK6V2//inRuqcocQaj/wwz3OvKoFtg=; b=AyCFw0uYUtgQvQ1Rdp+y8iDoTCmMdOMaoVIzKNG96jE8gcz6fec4Zzezrea/MnGmXi UetNO8F1FGau0f2CMpfWzoSAEtJmiO8xXvdAlWSWF/uAxizFHR48uXBQyv/rGG5L7KiJ BiTrCtsmHwMfm8F69HCbiyZqx3zIlFtiUObTDmJVpYmfL1GEiq4r4+LsLvnllTz6b4VY cTgsy7Q98IRoJldSZoJOmuE0zYAeuHBCnsI2TKIdu31dkJZ/8I9MIg3oz5ATT2HTFwgq R0Hy1K8awvGCf96bdbJGWSPcsvacTXfT/LAlgqhC23gFbOPmKTX5yidUZ7m0eT8/98mR lz/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qLNvjAoH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020a170902d48a00b001994a4f9d34si6233795plg.145.2023.03.16.07.51.43; Thu, 16 Mar 2023 07:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qLNvjAoH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbjCPOJN (ORCPT + 99 others); Thu, 16 Mar 2023 10:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230516AbjCPOJJ (ORCPT ); Thu, 16 Mar 2023 10:09:09 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E9782410E; Thu, 16 Mar 2023 07:09:06 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32GE8RD9042793; Thu, 16 Mar 2023 09:08:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678975707; bh=DFCetOEU3TZe5LK6V2//inRuqcocQaj/wwz3OvKoFtg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qLNvjAoHPP6VojLtzH0LEfxpflcyfpac0Y4qKt0CgyrFCEW4pDUGVySGWAhSFlL+a h746l2h+7J4b8flMe29w1GJrG6SOXTtxwLi6OKLs4pOlyaPoor4x/DqY6LibUFbncJ GmadGPKbwr5Vi6wqgzi9huPq1HCyvz5zCwhi0l0w= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32GE8RP4058627 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Mar 2023 09:08:27 -0500 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 16 Mar 2023 09:08:26 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 16 Mar 2023 09:08:26 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32GE8QaX011450; Thu, 16 Mar 2023 09:08:26 -0500 From: Jayesh Choudhary To: , , CC: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 1/2] dt-bindings: drm/bridge: Add no-hpd property Date: Thu, 16 Mar 2023 19:38:22 +0530 Message-ID: <20230316140823.234263-2-j-choudhary@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230316140823.234263-1-j-choudhary@ti.com> References: <20230316140823.234263-1-j-choudhary@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760536369416814799?= X-GMAIL-MSGID: =?utf-8?q?1760536369416814799?= From: Rahul T R Add no-hpd property to the bindings, to disable hpd when not connected or unusable Signed-off-by: Rahul T R Signed-off-by: Jayesh Choudhary --- .../devicetree/bindings/display/bridge/cdns,mhdp8546.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml b/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml index b2e8bc6da9d0..69d381195218 100644 --- a/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml +++ b/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml @@ -57,6 +57,12 @@ properties: interrupts: maxItems: 1 + cdns,no-hpd: + type: boolean + description: + Set if the HPD line on the bridge isn't hooked up to anything or is + otherwise unusable. + ports: $ref: /schemas/graph.yaml#/properties/ports From patchwork Thu Mar 16 14:08:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jayesh Choudhary X-Patchwork-Id: 70803 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp507692wrt; Thu, 16 Mar 2023 07:15:51 -0700 (PDT) X-Google-Smtp-Source: AK7set/EDRRHY3TbarVlPlib5rpMc97/M7msHjrZj3mErfz1QMBuhJUE3Tae5gvksiAVmgr9Rxqh X-Received: by 2002:a05:6a20:8416:b0:cc:606a:4330 with SMTP id c22-20020a056a20841600b000cc606a4330mr4534034pzd.55.1678976151185; Thu, 16 Mar 2023 07:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678976151; cv=none; d=google.com; s=arc-20160816; b=Id7gHZO0aYfAxjkbSzLlB1+hRwGxI5TmH0rWQgCsGZqx66Cj/aCahBF8C0l49ciFvR hij4fbDpj2mu+bV34LGjIi8LCKaQlYLeim0bBsa40Rw26bINeVq9GIQn6IBYU554hnMI OJg/YHqeMwuHG3CrwGurD1fwCFFj2A6GdvnAXJQ7adBl837II2GsW6kAAI31v9aG5t4n iYtk5ZT9J34ioAQU2suhsW3gcQLkX9lTP35qcHx21JHxfMgJzjPmYVLCG17iu8hGklb4 N1bNvv//xVkaVkm7GCcB9KdWJcQIPh4hQWM/Mx3umtyYgWOEX+7nigr9zBbTLDJeXrIt cHPQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IIg8Hw2d+AztRioYXlvly6uzmoxjKPtZvpXX4icR5Mk=; b=W3sOGh76cuzEpkemW4zDkg7JewWtYi5vPZi1kqRC/97E616iT2WrIlbrUuWkfSPGIG MQCJmIaaNSoM0trfuQGEX5IGLijThalh7pCrADfl2u/VHEyn9pZMOmlCAWpanI3nhxUP 9SA2mPe74uGDdL2UnlBGOchh4Ct/aZTXIaac9ZcsevQbJxzn+tAYEqDVSW3X9s1VXRpb WFe+HAC0eZkN54bi3bVzzfxEp1lLItwK+DZNcVsdXsrl6VqH2LyUjvcjcJ5QUI6T7h1+ jBH9fsse2tpvkGfjLaazuVxrMAepeShJJd7mEN5do0M8PrZ9vkxiGaxYJLdiEwce0G7Q FL0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=zKpTtxVe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a656687000000b004fc8e102b08si7871523pgw.852.2023.03.16.07.15.38; Thu, 16 Mar 2023 07:15:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=zKpTtxVe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbjCPOJ7 (ORCPT + 99 others); Thu, 16 Mar 2023 10:09:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230241AbjCPOJ5 (ORCPT ); Thu, 16 Mar 2023 10:09:57 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3F164D62F; Thu, 16 Mar 2023 07:09:34 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32GE8TW4056592; Thu, 16 Mar 2023 09:08:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678975709; bh=IIg8Hw2d+AztRioYXlvly6uzmoxjKPtZvpXX4icR5Mk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=zKpTtxVeM2R+FONAejLejVzcQApuPKHcxzqB0/x9I4QjqqpNz1hY09gXAoNlwzWGV RFHbUGauXRvI4d5aMctVg+ZHz5pA6LiJzlBUdjmoQBB22AiJwCpuQCZ654FrqJDR/G AyM+YQr7jhJqEsGACtEkTD9DKPtT1esDTBDeu8NU= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32GE8TbI058640 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Mar 2023 09:08:29 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 16 Mar 2023 09:08:28 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 16 Mar 2023 09:08:28 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32GE8RxP048696; Thu, 16 Mar 2023 09:08:28 -0500 From: Jayesh Choudhary To: , , CC: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 2/2] drm: bridge: cdns-mhdp8546: Add support for no-hpd Date: Thu, 16 Mar 2023 19:38:23 +0530 Message-ID: <20230316140823.234263-3-j-choudhary@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230316140823.234263-1-j-choudhary@ti.com> References: <20230316140823.234263-1-j-choudhary@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760534096919672119?= X-GMAIL-MSGID: =?utf-8?q?1760534096919672119?= From: Rahul T R In J721S2 EVMs DP0 hpd is not connected to correct hpd pin on SOC, to handle such cases, Add support for "no-hpd" property in the device tree node to disable hpd Also change the log level for dpcd read failuers to debug, since framework retries 32 times for each read Signed-off-by: Rahul T R Signed-off-by: Jayesh Choudhary --- .../drm/bridge/cadence/cdns-mhdp8546-core.c | 37 ++++++++++++++++--- .../drm/bridge/cadence/cdns-mhdp8546-core.h | 1 + 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index f6822dfa3805..e177794b069d 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -54,6 +54,8 @@ #include "cdns-mhdp8546-hdcp.h" #include "cdns-mhdp8546-j721e.h" +static int cdns_mhdp_update_link_status(struct cdns_mhdp_device *mhdp); + static int cdns_mhdp_mailbox_read(struct cdns_mhdp_device *mhdp) { int ret, empty; @@ -749,7 +751,7 @@ static int cdns_mhdp_fw_activate(const struct firmware *fw, * MHDP_HW_STOPPED happens only due to driver removal when * bridge should already be detached. */ - if (mhdp->bridge_attached) + if (mhdp->bridge_attached && !mhdp->no_hpd) writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT, mhdp->regs + CDNS_APB_INT_MASK); @@ -845,7 +847,7 @@ static ssize_t cdns_mhdp_transfer(struct drm_dp_aux *aux, ret = cdns_mhdp_dpcd_read(mhdp, msg->address, msg->buffer, msg->size); if (ret) { - dev_err(mhdp->dev, + dev_dbg(mhdp->dev, "Failed to read DPCD addr %u\n", msg->address); @@ -1738,6 +1740,19 @@ static int cdns_mhdp_attach(struct drm_bridge *bridge, spin_unlock(&mhdp->start_lock); + if (mhdp->no_hpd) { + ret = wait_event_timeout(mhdp->fw_load_wq, + mhdp->hw_state == MHDP_HW_READY, + msecs_to_jiffies(100)); + if (ret == 0) { + dev_err(mhdp->dev, "%s: Timeout waiting for fw loading\n", + __func__); + return -ETIMEDOUT; + } + + cdns_mhdp_update_link_status(mhdp); + return 0; + } /* Enable SW event interrupts */ if (hw_ready) writel(~(u32)CDNS_APB_INT_MASK_SW_EVENT_INT, @@ -2256,7 +2271,16 @@ static int cdns_mhdp_update_link_status(struct cdns_mhdp_device *mhdp) mutex_lock(&mhdp->link_mutex); - mhdp->plugged = cdns_mhdp_detect_hpd(mhdp, &hpd_pulse); + if (mhdp->no_hpd) { + ret = drm_dp_dpcd_read_link_status(&mhdp->aux, status); + hpd_pulse = false; + if (ret < 0) + mhdp->plugged = false; + else + mhdp->plugged = true; + } else { + mhdp->plugged = cdns_mhdp_detect_hpd(mhdp, &hpd_pulse); + } if (!mhdp->plugged) { cdns_mhdp_link_down(mhdp); @@ -2451,6 +2475,8 @@ static int cdns_mhdp_probe(struct platform_device *pdev) mhdp->aux.dev = dev; mhdp->aux.transfer = cdns_mhdp_transfer; + mhdp->no_hpd = of_property_read_bool(dev->of_node, "cdns,no-hpd"); + mhdp->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mhdp->regs)) { dev_err(dev, "Failed to get memory resource\n"); @@ -2526,8 +2552,9 @@ static int cdns_mhdp_probe(struct platform_device *pdev) mhdp->bridge.of_node = pdev->dev.of_node; mhdp->bridge.funcs = &cdns_mhdp_bridge_funcs; - mhdp->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | - DRM_BRIDGE_OP_HPD; + mhdp->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID; + if (!mhdp->no_hpd) + mhdp->bridge.ops |= DRM_BRIDGE_OP_HPD; mhdp->bridge.type = DRM_MODE_CONNECTOR_DisplayPort; if (mhdp->info) mhdp->bridge.timings = mhdp->info->timings; diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h index bedddd510d17..6786ccb51387 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.h @@ -388,6 +388,7 @@ struct cdns_mhdp_device { bool link_up; bool plugged; + bool no_hpd; /* * "start_lock" protects the access to bridge_attached and