From patchwork Tue Jan 9 07:25:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengyang Chen X-Patchwork-Id: 13514369 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7347EC47073 for ; Tue, 9 Jan 2024 07:40:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1766710E369; Tue, 9 Jan 2024 07:40:49 +0000 (UTC) Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2040.outbound.protection.partner.outlook.cn [139.219.17.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60CBE10E35B for ; Tue, 9 Jan 2024 07:40:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QmqOsLopXDhHml/katI6kHEtsB01GPi66IRM81JnTNuqfRJi7FR+Aos/BEWH9BK0wzAJgup3rQSMOSDMnziNywv4irGctsNMlCW4o8ArGVyozaOrmM7L1fTu/V9kCVNGFbNbfsuCF88scphiycWbUrLQG6vzw/1hrP5tfXWZR+tr0Z+KMrj1t0wvAyVbNIXW7QnmbTpZdNHnPvjNr1xU8BMX4+/HEXQl3q7ealuMLabjilr1QCN1QdCypvLi0ZdlNYWPN0fDwudjKpyQv0SO5bqYbs6lj+F6NAvCgSeEpiUjVTKjkNcsjbxYZ4UGjt/uP4kfk5opxiDscIio7n0Lrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3kqumkryVSdpbCjG5y2mqCPrbAy3Pxz8ya7rERp6Oxk=; b=V2SsxW0ey8JBlfkv+GGzcP9ZqZBwkPSC9YzaRsTqeAVFtBcHu8Mt3gt8EPHoZkqB73sywy9Z+2cYmip8isqZ31FxX2SVNeona78TDKlBAEiz8K5+DQEYiGaEFHKY4I5ZWY4++EhwNCLUqmBHJX/w36K1Ye55wVprsjAg5tr2kWmx4ya9QdmBF33GTc1RQOgx4CBPTgUoAXIXQdg4kxR4keJVbHYzpSNi6SpDu8Jfe7thSLkXqFiREOzunug8dHQPsLPCROKqdMMxRgquf/jzOpKv27b8I1lQ2xuN/YAwhIQwq79MtB3YdUQB7b+5kdAkg/sh7w9N007qClJiO7RRJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:3::6) by NT0PR01MB1231.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.32; Tue, 9 Jan 2024 07:25:25 +0000 Received: from NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn ([fe80::85fc:7fb9:8b00:dd88]) by NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn ([fe80::85fc:7fb9:8b00:dd88%3]) with mapi id 15.20.7135.019; Tue, 9 Jan 2024 07:25:25 +0000 From: Shengyang Chen To: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/2] dt-bindings: display: bridge: cdns: Add properties to support StarFive JH7110 SoC Date: Tue, 9 Jan 2024 15:25:15 +0800 Message-Id: <20240109072516.24328-2-shengyang.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240109072516.24328-1-shengyang.chen@starfivetech.com> References: <20240109072516.24328-1-shengyang.chen@starfivetech.com> X-ClientProxiedBy: NT0PR01CA0008.CHNPR01.prod.partner.outlook.cn (2406:e500:c510::13) To NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:3::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: NT0PR01MB1070:EE_|NT0PR01MB1231:EE_ X-MS-Office365-Filtering-Correlation-Id: 789af601-4a03-44f1-e12b-08dc10e42607 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +lbkfvI1/eraylV/9bDmX9pXTaYVJbKwldc22CQ5yniXYV1xgM0Z52uuP0hKNpddrZ+3vKTE3fn+U2pbp/W5pLJqGWaXoEiuc/UHBsyUeUCDZkTiEEsOaf7r4MeTo6+uRR4mb2UAxTLRoPZAPZXe89zdpw/mHLwh6IkMWSpDe1PhJje9AgDtnlIWA08DcHcZrF8Ukks4Q3U+f23e+Nn6Z7n3CDnu1q+4+sNaLfAox2c+8DVvYb91/wdcO+2ZfRosuzHj78UQ8rrKy3NqipFI9RETN1yVs5E3BcFSP4vy52vb0UxzH+kmyU4cSEK+OM1GhdXW/2e7SqCf651ob7/RGd15Wz+sQ2YhdmdwRCTNTV0vhASQxXndYr1auMpSA9dONsnGjk4z1qq7KCjydbUULSzJmBeE/t1uCukBVeRinzW5brAej0q+ERxt7ZfKwVsMOjEILpIIsfJWLV83lNAH0uQzP0JnOYwxgWmrrn5ZaTVaLeQ7Q/mA0e4Gd1wQCQzqv459zIZCNaXUUSnAvwBl4aCftAqg+XcHLnXYbzpKO/byIpM81rv6UcFbnAI/tFe5 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(366004)(39830400003)(346002)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(86362001)(66946007)(40160700002)(36756003)(40180700001)(38100700002)(83380400001)(1076003)(38350700005)(508600001)(52116002)(6666004)(7416002)(8676002)(8936002)(2906002)(66556008)(4326008)(44832011)(5660300002)(66476007)(26005)(41300700001)(2616005)(41320700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sxXojW9gpMPwVen4lpTUSyyZmtQXcislezjqx2ws0JA21CeFWKnWNRztGpRLEK9Pjgk3vv5kd0nZ12z9nFFV4kGnraRrxiVn1GzM0Rik2myIinjSUpORXcyuWIy7+j+PyOlksV2lsNj6dvrX4nkR0e2DSSltqRoQYQEnnr2dQYBxYAi9VT9NScj7w51ZatPx7clACD5bvDVpgbuFy9Flm1uNmqpIifChNV9AlYFF3W325it9fVkejgA+csRKApUWIDMbF//7sbTl00ETUeYefjeffTUJXTKs3VOAzECWZEQgx/419IhP97x5d7bsYNJLCxjs7tEdmhGBn33uREdbvgcQncis1kzjn0BHG1M/HsqiyC5ZonTDBLTNxaDwiUdmb5pU49QbJX7kPQFAoXBLnhdyt5g5vPyXRaZa09Ahc9RRVKi9fPpHXpYNGbzIGpBNjm9nPch/r7uR3NChVCCvxVWQWQflnVFJW4AvbHKmSun6+N8PfeXIoIiomM4Ma14GWPdD3sHH9r0oCr1ej45sS/xxfy0gZjF8+UfwgO7H6nGf+9/+4mHJhgHBX3UyaNLT2d8FK2QkC+kj28q9hFy/6IS7/qU1a/UCCcMI489yRb8YMqpJkallDY4IGdnwU27phneE4ZmnrGnsxhh04xUqwDkuJOLa7fXLwMM0EfW5hOhkgcgRrdvv9NmGju0z+c8mdR/mBSDNZQ6E9s2DtkUveR7+MVXPqMnbAfF1/lM9Xfi2SGwugaHgdDedG4obL1mis7OwKwyM7CEtDajVkvRgT2YxauU/Gzb65P/AUnGbY5FKPm6WLctJJRQkzCNQQaaBX6BoRoCuGuKAgJqPbWSXB/DKHVPpOG86Np35F7t8YjyHzwSS2JXNa8NMrqKxvyg0f0N6qhuyEUmLa6kCsW9OgF8k9rwOMAWnvqi0X3O8PfqoOqExjshiwYUXfseQfiUezGu0fKzLHveclv6WiuuernOQrFR+QQTd/BFWKA9bw5PtxCzaZFSx1azcwJ/x/W1rl/7iI84aIfVHVTE/iE3vDvFvFqbZNBRtsORJRygM8voveDzqpYz87lPCsEDX5BF0K2T+3G4f63zPoXmISC7DoO53eYEVQVR/7dmRfWuAe5PncrYEUlhvDJbQYj+Szi4waEKH6GpDYe2sOOOBdB5WZ7/Xt+IiZwt2DfnFeaPF8IjYWU89z+4K/L97UvyB8dN0/90KFhaMoiDNOC4infoZNY6Mg4XnPOfdcUAv5YB5vTwplk/O0KV3b1S4b0oUsszOkuf0OQiXz80HQ3p0YTbxjj2OJ+IYVaNJThrr+/2rOxR1Gxn7J9t5ui4jTYnx8qA8FvD7azB7t4V8cgCgaoHONzWf1Gxa+N63UJD6ZnHSP6953m+ABp9mjATGllxUyebNrxWtCx2pvM8U9KMGry9PRi89tvRokB2yfZwwF04KB2aRark+zxUoSY8Vlnm5C5Sg1I/TKwGUiYm4rGJti2FewoHzk4/zlfpgx407p+/uGvYeBzoBsdy3EdptqEBc9JuVWnLbBLvvz4FPsObG8/QlSu2sstyTsfFhN9rnmF/ifUcdbDsRDpKT9nCjw64mhLD2sadWh4hfZ702tGrm6gx0jDyTQeG+hEheFz98Pyo5f6g= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 789af601-4a03-44f1-e12b-08dc10e42607 X-MS-Exchange-CrossTenant-AuthSource: NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2024 07:25:25.7523 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mg6fOvHskeakmtW8bD39pRJCu3acbR00qYuNpzNMJedMvB9InCkCcNxOk6XapFspiLzH+vSbO/PZl8B/Rfp3aXs4X47pEQiDkDeH963aAeM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: NT0PR01MB1231 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrzej.hajda@intel.com, tomi.valkeinen@ideasonboard.com, Laurent.pinchart@ideasonboard.com, krzysztof.kozlowski+dt@linaro.org, r-ravikumar@ti.com, rfoss@kernel.org, jernej.skrabec@gmail.com, u.kleine-koenig@pengutronix.de, shengyang.chen@starfivetech.com, conor+dt@kernel.org, jonas@kwiboo.se, mripard@kernel.org, robh+dt@kernel.org, aford173@gmail.com, neil.armstrong@linaro.org, keith.zhao@starfivetech.com, bbrezillon@kernel.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org, jack.zhu@starfivetech.com, tzimmermann@suse.de, changhuang.liang@starfivetech.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Keith Zhao Add properties in CDNS DSI yaml file to match with CDNS DSI module in StarFive JH7110 SoC. Signed-off-by: Keith Zhao --- .../bindings/display/bridge/cdns,dsi.yaml | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/cdns,dsi.yaml b/Documentation/devicetree/bindings/display/bridge/cdns,dsi.yaml index 23060324d16e..da091e105794 100644 --- a/Documentation/devicetree/bindings/display/bridge/cdns,dsi.yaml +++ b/Documentation/devicetree/bindings/display/bridge/cdns,dsi.yaml @@ -16,6 +16,7 @@ properties: compatible: enum: - cdns,dsi + - starfve,jh7110-dsi - ti,j721e-dsi reg: @@ -27,14 +28,20 @@ properties: Register block for wrapper settings registers in case of TI J7 SoCs. clocks: + minItems: 2 items: - description: PSM clock, used by the IP - description: sys clock, used by the IP + - description: apb clock, used by the IP + - description: txesc clock, used by the IP clock-names: + minItems: 2 items: - const: dsi_p_clk - const: dsi_sys_clk + - const: apb + - const: txesc phys: maxItems: 1 @@ -46,10 +53,21 @@ properties: maxItems: 1 resets: - maxItems: 1 + minItems: 1 + items: + - description: dsi sys reset line + - description: dsi dpi reset line + - description: dsi apb reset line + - description: dsi txesc reset line + - description: dsi txbytehs reset line reset-names: - const: dsi_p_rst + items: + - const: dsi_p_rst + - const: dpi + - const: apb + - const: txesc + - const: txbytehs ports: $ref: /schemas/graph.yaml#/properties/ports @@ -90,6 +108,28 @@ allOf: reg: maxItems: 1 + - if: + properties: + compatible: + contains: + const: starfive,jh7110-dsi + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + resets: + minItems: 5 + maxItems: 5 + required: + - reset-names + else: + properties: + clocks: + maxItems: 2 + resets: + maxItems: 1 + required: - compatible - reg From patchwork Tue Jan 9 07:25:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengyang Chen X-Patchwork-Id: 13514370 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21E91C47073 for ; Tue, 9 Jan 2024 07:40:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2359B10E371; Tue, 9 Jan 2024 07:40:49 +0000 (UTC) Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2040.outbound.protection.partner.outlook.cn [139.219.17.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id D036810E35B for ; Tue, 9 Jan 2024 07:40:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IisVBVwVCo/++08g3i5VHvwbDtOWZUMHLKjyf+J8VH+WedNbIx9nziC0zuiaC5bDu0e2ZO1VmffJ51VuBFctonJ4gPOWcWsKqcFXzYK9ExQR1mk4SNxRb8m0ovaQAodgN3mxCE6NduIQutxRJ0Dm/T2UtoclSbwr1m78d4X5OFmYNh+fVofswcMVa+xEbraCyPoiL7pGvbe/ID38Dq5X4QTa5MFR+obukVAfwB7TR5GYMqgw9DKKlTtdk1SpN+3KG8wnttBK0DHicQr+d0Xvx1kCO97F4A31WND2it97Pkl4ANm2tAzwBfViTGDyCyANMKWsyEs0SoHoLvPNReKKRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RyBNE/c5ohK97c6vvQAsxO3Nu5hkH4bde+VEnNwEOa0=; b=BPpzzxH8SxYpCW4xQ0qx6K13BrqMZS98wdSWYDp2eL3YkpDDkONgg2EiqH2AHoRytE6jl3MSIusK91YxTNmd9jSCosaQt9OppTrCNtQexuQmxo0HVqG0EqXsHyCU4jiVv817mfufzDvR417wx5Xo1RGbLX3aR8NbK9QEP95+zK9OusJZqaNYpEDMfMfWQ6RoEj5zgnfm7vK4wFuw0M1ZvCti4COol5SgnyQcKxKu0GT41AnSZ0CE62o9KIBBb/ZB7Gr+Os3QbOShshcJ86xJs0YQGXpGNTA2ScGbFrRqrt1Yld+9CQ2mSUOg2GkgnD4vXWL185LL3k5zaxuUJPVZbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:3::6) by NT0PR01MB1231.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.32; Tue, 9 Jan 2024 07:25:27 +0000 Received: from NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn ([fe80::85fc:7fb9:8b00:dd88]) by NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn ([fe80::85fc:7fb9:8b00:dd88%3]) with mapi id 15.20.7135.019; Tue, 9 Jan 2024 07:25:27 +0000 From: Shengyang Chen To: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/2] gpu: drm: bridge: cadence: Add a driver and platform ops for StarFive JH7110 SoC Date: Tue, 9 Jan 2024 15:25:16 +0800 Message-Id: <20240109072516.24328-3-shengyang.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240109072516.24328-1-shengyang.chen@starfivetech.com> References: <20240109072516.24328-1-shengyang.chen@starfivetech.com> X-ClientProxiedBy: NT0PR01CA0008.CHNPR01.prod.partner.outlook.cn (2406:e500:c510::13) To NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:3::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: NT0PR01MB1070:EE_|NT0PR01MB1231:EE_ X-MS-Office365-Filtering-Correlation-Id: 1871c946-213e-4eb4-f41f-08dc10e426c8 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bCm187VP5pnl8t5Sc7ONQN24ZH1BIN8sUUTYcK1oIXwraQxYK9evC76lUv3nPSyjxvhq040lYuIkO/giBNc8ZNq1ajSpCpPeWlddA/tLM9LjI4SNLMhfJxA8GCqQOpCnfXnQ2b0+anbRSa4wX63NdE4wN3HDWnpv0XqDpy3yomZJ374iKQyCOak5MwL2NMMXR+nxPzPJ9dOoGpHWGWiayEgVV7mtyFyVPLzPA7hbBMqqb5uzkF0TV3M7sWSXiFAxe+JJ/1gLL267yacUXRTqk767CuojXBP4+N2vqLjcsZqExD2Ywrt6H+KQhu390+VEpt3Yj3cPj6gJROpIHxaKmvJTZ6YAoiNhKE/bjqHRbT6g6OiOLEN01Ugwl0DeE1MauNnmifkRL6+y3EkQuHgwZQiZWkvKMhj6+9GgnZuXlNmOtTY52IHyc8YE+/oXnWwra+5Ypgec/c6QSTkjurhqeEY+o+sJvp9Xmea/VCWo9whH5egPFHkKW7cmf3biCZudnj2tyHEdaHOYLRBfNb3eVj+uVSI69PYYmG1wx9GhDeviLUZ8dFH7SiLA6VLHATLg X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn; PTR:; CAT:NONE; SFS:(13230031)(396003)(136003)(366004)(39830400003)(346002)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(86362001)(66946007)(40160700002)(36756003)(40180700001)(38100700002)(83380400001)(1076003)(38350700005)(508600001)(52116002)(6666004)(7416002)(8676002)(8936002)(2906002)(66556008)(4326008)(44832011)(5660300002)(66476007)(30864003)(26005)(41300700001)(2616005)(41320700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CrJE1grbSG18oq9ytGs0xx4cX2ufDljgJkpUfGDKkImcy/bYJhwh8s6bn4zUBjSeQqUztZejbw9XpPQJVA5re2ctoJx//e9ONUh7VaCrfxoHZSL9WJ/wVke9ddVzJ1JqG+GrFpSgUMVTLwWOuSzC4G+4otBFZJizILd0H1Gke4En3f7Wf20DTtqfX6Bi3ZTJVh8TLF5oD+Oq3Y6J/bSrrH14cv+yCeRO3+QS7hSb04qytOy0frp5mIxtLUKuWrEO/hnIh7SpFQ9V9gPI/3KtvtUsYzjTMg4pvFykKtWG1CIPvGKcUVZu08ZMifs4dUAajYlXJQ1SJx7X3b1Oi/5IcDWge2kDRYyUDB5yUvP1a0JhZQ6Yea9BF+k1Tzdu4kdqy9eEJCTRsVjrNcE7kVa7U0k06L21455G/SlYNxapKFQZkoiVsqu1e9aDr981O78T+c+TqVfoQ1Ktnc3f2vWXNKM0SUu/G6qBv2djMK/RvfQUNwS6qkS9b/H9SdWBZYgGVSwN6qhOX3A1lGCTdcPCrCrvtUYYMZ7MxbcAbpJuT9N28LbjhEzAPs0n8XKJYTO2SOiKnTuCIS4atSdaHdk2kIAFpykzEF1PVVm8d23ZNU4LgS5vu1efp+7BPxzI6OPjBsEr1BHj/c4GlXsT5fPG+j4fCfM58btEgtMFMy7/8+rQGjqPHu7hXRM8g+ocXgUFf8ZB031CO8/LaOa9V9iKPVz3FQfN/kPpwhMXGaJYJCsoMM21omwhLkYhqzse05L7fGsI9dQwOFWLImqfBDIHDnDL0TZsMsTfnRIxTrZxoUdWA8AJvsM6R1jXYaVIWJ37H6rS5S83Eaq1Nkqw2c9Pt0wK+NVC6YtZf2gyQY1BZvuxr5KAM/xFUIOU5zn91gAIacElQhuRNm0jTl7m2k8VD3l68R7ju1NYdV26DqlVRP807KHVEuuHU2X/ucORDCJfvbQT+Ss0uyWE1L+3IZBXFDJpiYmySFNFNLbLSB2oXoB5FzQLJdJXNbrkOYdgkthJkbr9zyeduX7z5gLVQMHoiS//bULJikl/MV8m2eonqFRqFa3jkHu+/555oeF4Mcx6LOXlOXCLwVT65MwUAsFmYJaKlKKNBZCxJxChm/0YxJxYcmLsbl414pcPQM2jLFHfRad0IIlsEZouxySG9dt4TUwrDdqEcd571FxM2HBAYQrgWDI6Oe1FB4BKVYNzIhKVTxM+Aosw+w3Izz38qG1E3q0OZonxXctEmPjkWIUjmOFMr1Q9PFqwxkjTj4O+bAN/kvHDlhS9dj1bUGgwGaSXIC2For0QSTAnOqfhol2JkKfrkl6+aRV3VYInK83o3qii4KDixcvoHiVB+WZ+ZrOScDxBOe+wQ8vQDlC7mRukx304Plo2MbOfohu0jn4Weto2QTTbmtqjNGwvr16XimF9bQj9Bw9WV+wp7Z/XNEaPdZD6XbAmhf4qSKk5pnzF9LpzlZAHd+62ZMwiKyPhhmARW1DGWZvOiPVLh/o0NhI2Nze2cOjvXzfHTh1PDH2pPZDhU5kz9raPZgKm6PQzBsYrLBMI3Vvt3GtyDMK4GCeEoyPJ+r+QRRJFghV92TyaqQ/b2zFHn1vn9g/4d7SoU/bGNDnvbnriZ+tGEHsPwphSGIM= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1871c946-213e-4eb4-f41f-08dc10e426c8 X-MS-Exchange-CrossTenant-AuthSource: NT0PR01MB1070.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2024 07:25:27.0750 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yMFlPADzGlDKts0BLOrlrxw8sLPImz+TpPVawgTso3xBNCWPeJpGlRVdF+6yCpDO4GZScIEnIQGQ9NP4tpkb+rVa7zapBI1NUQOj9qC8tJA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: NT0PR01MB1231 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrzej.hajda@intel.com, tomi.valkeinen@ideasonboard.com, Laurent.pinchart@ideasonboard.com, krzysztof.kozlowski+dt@linaro.org, r-ravikumar@ti.com, rfoss@kernel.org, jernej.skrabec@gmail.com, u.kleine-koenig@pengutronix.de, shengyang.chen@starfivetech.com, conor+dt@kernel.org, jonas@kwiboo.se, mripard@kernel.org, robh+dt@kernel.org, aford173@gmail.com, neil.armstrong@linaro.org, keith.zhao@starfivetech.com, bbrezillon@kernel.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org, jack.zhu@starfivetech.com, tzimmermann@suse.de, changhuang.liang@starfivetech.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Keith Zhao In order to fit CDNS DSI module in StarFive JH7110 SoC, The mainly modification is followed: 1.Add driver for StarFive JH7110 SoC to drive its CDNS DSI module. 2.Add platform ops in cdns-dsi.c for StarFive JH7110 SoC probing. Signed-off-by: Keith Zhao --- MAINTAINERS | 8 + drivers/gpu/drm/bridge/cadence/Kconfig | 7 + drivers/gpu/drm/bridge/cadence/Makefile | 1 + .../gpu/drm/bridge/cadence/cdns-dsi-core.c | 29 ++- .../gpu/drm/bridge/cadence/cdns-dsi-core.h | 21 ++ .../gpu/drm/bridge/cadence/cdns-dsi-jh7110.c | 193 ++++++++++++++++++ .../gpu/drm/bridge/cadence/cdns-dsi-jh7110.h | 16 ++ 7 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.c create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.h diff --git a/MAINTAINERS b/MAINTAINERS index d32920dd943f..a220ea04f5c4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6847,6 +6847,14 @@ F: Documentation/devicetree/bindings/display/solomon,ssd-common.yaml F: Documentation/devicetree/bindings/display/solomon,ssd13*.yaml F: drivers/gpu/drm/solomon/ssd130x* +DRM DRIVERS FOR STARFIVE +M: Keith Zhao +M: Shengyang Chen +L: dri-devel@lists.freedesktop.org +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110* + DRM DRIVER FOR ST-ERICSSON MCDE M: Linus Walleij S: Maintained diff --git a/drivers/gpu/drm/bridge/cadence/Kconfig b/drivers/gpu/drm/bridge/cadence/Kconfig index cced81633ddc..ad9f572f4720 100644 --- a/drivers/gpu/drm/bridge/cadence/Kconfig +++ b/drivers/gpu/drm/bridge/cadence/Kconfig @@ -19,6 +19,13 @@ config DRM_CDNS_DSI_J721E help Support J721E Cadence DSI wrapper. The wrapper manages the routing of the DSS DPI signal to the Cadence DSI. + +config DRM_CDNS_DSI_JH7110 + bool "JH7110 SOC Cadence DSI support" + default n + help + Cadence DPI to DSI bridge which is embedded in the + StarFive JH7110 SoC. endif config DRM_CDNS_MHDP8546 diff --git a/drivers/gpu/drm/bridge/cadence/Makefile b/drivers/gpu/drm/bridge/cadence/Makefile index c95fd5b81d13..87f603a9f4ad 100644 --- a/drivers/gpu/drm/bridge/cadence/Makefile +++ b/drivers/gpu/drm/bridge/cadence/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_DRM_CDNS_DSI) += cdns-dsi.o cdns-dsi-y := cdns-dsi-core.o cdns-dsi-$(CONFIG_DRM_CDNS_DSI_J721E) += cdns-dsi-j721e.o +cdns-dsi-$(CONFIG_DRM_CDNS_DSI_JH7110) += cdns-dsi-jh7110.o obj-$(CONFIG_DRM_CDNS_MHDP8546) += cdns-mhdp8546.o cdns-mhdp8546-y := cdns-mhdp8546-core.o cdns-mhdp8546-hdcp.o cdns-mhdp8546-$(CONFIG_DRM_CDNS_MHDP8546_J721E) += cdns-mhdp8546-j721e.o diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c index 7457d38622b0..a8f976f9eeed 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -27,6 +27,10 @@ #include "cdns-dsi-j721e.h" #endif +#ifdef CONFIG_DRM_CDNS_DSI_JH7110 +#include "cdns-dsi-jh7110.h" +#endif + #define IP_CONF 0x0 #define SP_HS_FIFO_DEPTH(x) (((x) & GENMASK(30, 26)) >> 26) #define SP_LP_FIFO_DEPTH(x) (((x) & GENMASK(25, 21)) >> 21) @@ -552,6 +556,10 @@ static int cdns_dsi_adjust_phy_config(struct cdns_dsi *dsi, /* data rate was in bytes/sec, convert to bits/sec. */ phy_cfg->hs_clk_rate = dlane_bps * 8; + if (dsi->platform_ops && dsi->platform_ops->update) + adj_dsi_htotal = dsi->platform_ops->update(dsi, dsi_cfg, phy_cfg, + dpi_hz, dpi_htotal, dsi_htotal); + dsi_hfp_ext = adj_dsi_htotal - dsi_htotal; dsi_cfg->hfp += dsi_hfp_ext; dsi_cfg->htotal = dsi_htotal + dsi_hfp_ext; @@ -683,7 +691,7 @@ static void cdns_dsi_bridge_post_disable(struct drm_bridge *bridge) pm_runtime_put(dsi->base.dev); } -static void cdns_dsi_hs_init(struct cdns_dsi *dsi) +void cdns_dsi_hs_init(struct cdns_dsi *dsi) { struct cdns_dsi_output *output = &dsi->output; u32 status; @@ -1026,6 +1034,14 @@ static ssize_t cdns_dsi_transfer(struct mipi_dsi_host *host, cdns_dsi_init_link(dsi); + /* + * on JH7110 SoC , when transfer dsi command , + * cdns_dsi_hs_init is needed. + * or the final ret will be error value. + */ + if (dsi->platform_ops && dsi->platform_ops->transfer) + dsi->platform_ops->transfer(dsi); + ret = mipi_dsi_create_packet(&packet, msg); if (ret) goto out; @@ -1142,6 +1158,9 @@ static int __maybe_unused cdns_dsi_resume(struct device *dev) clk_prepare_enable(dsi->dsi_p_clk); clk_prepare_enable(dsi->dsi_sys_clk); + if (dsi->platform_ops && dsi->platform_ops->resume) + dsi->platform_ops->resume(dsi); + return 0; } @@ -1152,6 +1171,10 @@ static int __maybe_unused cdns_dsi_suspend(struct device *dev) clk_disable_unprepare(dsi->dsi_sys_clk); clk_disable_unprepare(dsi->dsi_p_clk); reset_control_assert(dsi->dsi_p_rst); + + if (dsi->platform_ops && dsi->platform_ops->suspend) + dsi->platform_ops->suspend(dsi); + dsi->link_initialized = false; return 0; } @@ -1294,6 +1317,10 @@ static const struct of_device_id cdns_dsi_of_match[] = { #ifdef CONFIG_DRM_CDNS_DSI_J721E { .compatible = "ti,j721e-dsi", .data = &dsi_ti_j721e_ops, }, #endif +#ifdef CONFIG_DRM_CDNS_DSI_JH7110 + { .compatible = "starfive,jh7110-dsi", .data = &dsi_ti_jh7110_ops, }, +#endif + { }, }; MODULE_DEVICE_TABLE(of, cdns_dsi_of_match); diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h index ca7ea2da635c..f4491009c977 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.h @@ -53,12 +53,22 @@ struct cdns_dsi; * @deinit: Called in the CDNS DSI remove * @enable: Called at the beginning of CDNS DSI bridge enable * @disable: Called at the end of CDNS DSI bridge disable + * @resume: Called at the resume of CDNS DSI + * @suspend: Called at the suspend of CDNS DSI + * @update: Called at the middle of CDNS DSI bridge enable */ struct cdns_dsi_platform_ops { int (*init)(struct cdns_dsi *dsi); void (*deinit)(struct cdns_dsi *dsi); void (*enable)(struct cdns_dsi *dsi); void (*disable)(struct cdns_dsi *dsi); + void (*resume)(struct cdns_dsi *dsi); + void (*suspend)(struct cdns_dsi *dsi); + int (*update)(struct cdns_dsi *dsi, struct cdns_dsi_cfg *dsi_cfg, + struct phy_configure_opts_mipi_dphy *phy_cfg, + unsigned long dpi_hz, unsigned long dpi_htotal, + unsigned long dsi_htotal); + void (*transfer)(struct cdns_dsi *dsi); }; struct cdns_dsi { @@ -79,6 +89,17 @@ struct cdns_dsi { bool link_initialized; bool phy_initialized; struct phy *dphy; + +#ifdef CONFIG_DRM_CDNS_DSI_JH7110 + struct clk *apb_clk; + struct clk *txesc_clk; + struct reset_control *dpi_rst; + struct reset_control *apb_rst; + struct reset_control *txesc_rst; + struct reset_control *txbytehs_rst; +#endif }; +void cdns_dsi_hs_init(struct cdns_dsi *dsi); + #endif /* !__CDNS_DSI_H__ */ diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.c new file mode 100644 index 000000000000..654d083f49e1 --- /dev/null +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.c @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * JH7110 SoC Cadence DSI wrapper + * + * Copyright (C) 2023 StarFive Technology Co., Ltd. + */ + +#include +#include +#include +#include + +#include "cdns-dsi-jh7110.h" + +static int cdns_dsi_clock_enable(struct cdns_dsi *dsi, struct device *dev) +{ + int ret; + + ret = clk_prepare_enable(dsi->apb_clk); + if (ret) { + dev_err(dev, "Failed to prepare/enable apb_clk\n"); + return ret; + } + + ret = clk_prepare_enable(dsi->txesc_clk); + if (ret) { + dev_err(dev, "Failed to prepare/enable txesc_clk\n"); + return ret; + } + + return ret; +} + +static void cdns_dsi_clock_disable(struct cdns_dsi *dsi) +{ + clk_disable_unprepare(dsi->apb_clk); + clk_disable_unprepare(dsi->txesc_clk); +} + +static int cdns_dsi_resets_deassert(struct cdns_dsi *dsi, struct device *dev) +{ + int ret; + + ret = reset_control_deassert(dsi->apb_rst); + if (ret < 0) { + dev_err(dev, "failed to deassert apb_rst\n"); + return ret; + } + + ret = reset_control_deassert(dsi->txesc_rst); + if (ret < 0) { + dev_err(dev, "failed to deassert txesc_rst\n"); + return ret; + } + + ret = reset_control_deassert(dsi->dpi_rst); + if (ret < 0) { + dev_err(dev, "failed to deassert dpi_rst\n"); + return ret; + } + + return ret; +} + +static int cdns_dsi_resets_assert(struct cdns_dsi *dsi, struct device *dev) +{ + int ret; + + ret = reset_control_assert(dsi->apb_rst); + if (ret < 0) { + dev_err(dev, "failed to assert apb_rst\n"); + return ret; + } + + ret = reset_control_assert(dsi->txesc_rst); + if (ret < 0) { + dev_err(dev, "failed to assert txesc_rst\n"); + return ret; + } + + ret = reset_control_assert(dsi->dpi_rst); + if (ret < 0) { + dev_err(dev, "failed to assert dpi_rst\n"); + return ret; + } + + return ret; +} + +static int cdns_dsi_get_clock(struct device *dev, struct cdns_dsi *dsi) +{ + dsi->apb_clk = devm_clk_get(dev, "apb"); + if (IS_ERR(dsi->apb_clk)) + return PTR_ERR(dsi->apb_clk); + + dsi->txesc_clk = devm_clk_get(dev, "txesc"); + if (IS_ERR(dsi->txesc_clk)) + return PTR_ERR(dsi->txesc_clk); + + return 0; +} + +static int cdns_dsi_get_reset(struct device *dev, struct cdns_dsi *dsi) +{ + dsi->dpi_rst = devm_reset_control_get(dev, "dpi"); + if (IS_ERR(dsi->dpi_rst)) + return PTR_ERR(dsi->dpi_rst); + + dsi->apb_rst = devm_reset_control_get(dev, "apb"); + if (IS_ERR(dsi->apb_rst)) + return PTR_ERR(dsi->apb_rst); + + dsi->txesc_rst = devm_reset_control_get(dev, "txesc"); + if (IS_ERR(dsi->txesc_rst)) + return PTR_ERR(dsi->txesc_rst); + + dsi->txbytehs_rst = devm_reset_control_get(dev, "txbytehs"); + if (IS_ERR(dsi->txbytehs_rst)) + return PTR_ERR(dsi->txbytehs_rst); + + return 0; +} + +static int cdns_dsi_jh7110_init(struct cdns_dsi *dsi) +{ + int ret; + + ret = cdns_dsi_get_clock(dsi->base.dev, dsi); + if (ret) + return ret; + + return cdns_dsi_get_reset(dsi->base.dev, dsi); +} + +static void cdns_dsi_jh7110_resume(struct cdns_dsi *dsi) +{ + int ret; + + ret = cdns_dsi_clock_enable(dsi, dsi->base.dev); + if (ret) { + dev_err(dsi->base.dev, "failed to enable clock\n"); + return; + } + ret = cdns_dsi_resets_deassert(dsi, dsi->base.dev); + if (ret < 0) { + dev_err(dsi->base.dev, "failed to deassert reset\n"); + return; + } +} + +static void cdns_dsi_jh7110_suspend(struct cdns_dsi *dsi) +{ + int ret; + + ret = cdns_dsi_resets_assert(dsi, dsi->base.dev); + if (ret < 0) { + dev_err(dsi->base.dev, "failed to deassert reset\n"); + return; + } + + cdns_dsi_clock_disable(dsi); +} + +static int cdns_dsi_jh7110_update(struct cdns_dsi *dsi, struct cdns_dsi_cfg *dsi_cfg, + struct phy_configure_opts_mipi_dphy *phy_cfg, + unsigned long dpi_hz, unsigned long dpi_htotal, + unsigned long dsi_htotal) +{ + unsigned long long dlane_bps; + unsigned long adj_dsi_htotal; + unsigned int lanes = dsi->output.dev->lanes; + + phy_cfg->hs_clk_rate = phy_cfg->hs_clk_rate - (phy_cfg->hs_clk_rate % 10000000); + phy_cfg->hs_clk_rate = phy_cfg->hs_clk_rate + 40000000; + dlane_bps = phy_cfg->hs_clk_rate * lanes * dpi_htotal / 8; + adj_dsi_htotal = dlane_bps / dpi_hz; + + return adj_dsi_htotal; +} + +static void jh7110_cdns_dsi_hs_init(struct cdns_dsi *dsi) +{ + cdns_dsi_hs_init(dsi); + reset_control_deassert(dsi->txbytehs_rst); +} + +const struct cdns_dsi_platform_ops dsi_ti_jh7110_ops = { + .init = cdns_dsi_jh7110_init, + .resume = cdns_dsi_jh7110_resume, + .suspend = cdns_dsi_jh7110_suspend, + .update = cdns_dsi_jh7110_update, + .transfer = jh7110_cdns_dsi_hs_init, +}; diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.h b/drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.h new file mode 100644 index 000000000000..15d6a766b502 --- /dev/null +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-jh7110.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * JH7110 Cadence DSI + * + * Copyright (C) 2022-2023 StarFive Technology Co., Ltd. + * Author: keith.zhao + */ + +#ifndef __CDNS_DSI_JH7110_H__ +#define __CDNS_DSI_JH7110_H__ + +#include "cdns-dsi-core.h" + +extern const struct cdns_dsi_platform_ops dsi_ti_jh7110_ops; + +#endif /* !__CDNS_DSI_JH7110_H__ */