From patchwork Wed Apr 15 11:18:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Huang X-Patchwork-Id: 1271100 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=nZjtaCi1; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 492KdK2Km8z9sSY for ; Wed, 15 Apr 2020 21:19:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896864AbgDOLT3 (ORCPT ); Wed, 15 Apr 2020 07:19:29 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:10954 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2896859AbgDOLTO (ORCPT ); Wed, 15 Apr 2020 07:19:14 -0400 X-UUID: 4689c1e6803b44e585c94d0e9fcdfbbb-20200415 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=WnKlsLhJX74YWfoFdl9oaQ0btahiulghMcD1I/yVavU=; b=nZjtaCi1meAdYaffwGqz32mxfL5Fl0K/uVStM+X+K+8b6TZDsAp8GA2lrKm8XEHQNudNOdK1NGqmnYS/wpri6DWm7r/YspRVbhh2SASwENguGU6kep5BH0RUq/8g1cg5NuBOYJcCbT44zMExSEUJF0MGzjIbthY2q5sH7QemBJ8=; X-UUID: 4689c1e6803b44e585c94d0e9fcdfbbb-20200415 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1370799082; Wed, 15 Apr 2020 19:19:04 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 15 Apr 2020 19:18:58 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 15 Apr 2020 19:18:56 +0800 From: Anthony Huang To: Rob Herring , Matthias Brugger CC: , , , , , Anthony Huang Subject: [PATCH 1/2] dt-bindings: soc: mediatek: Add document for mmdvfs driver Date: Wed, 15 Apr 2020 19:18:25 +0800 Message-ID: <1586949506-22990-2-git-send-email-anthony.huang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1586949506-22990-1-git-send-email-anthony.huang@mediatek.com> References: <1586949506-22990-1-git-send-email-anthony.huang@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 6E8016FB62832FDC77AFD38C32ECD32F9BA2BAC1C9D6B2D6531A95EF5A3DC4142000:8 X-MTK: N Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This document describes the properties what mtk mmdvfs device node support. Signed-off-by: Anthony Huang --- .../devicetree/bindings/soc/mediatek/mmdvfs.yaml | 198 ++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/mediatek/mmdvfs.yaml diff --git a/Documentation/devicetree/bindings/soc/mediatek/mmdvfs.yaml b/Documentation/devicetree/bindings/soc/mediatek/mmdvfs.yaml new file mode 100644 index 0000000..9ef1833 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mediatek/mmdvfs.yaml @@ -0,0 +1,198 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mediatek/mmdvfs.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek MMDVFS driver binding + +maintainers: + - Rob Herring + - Mark Rutland + +description: | + The Mediatek MMDVFS(Multimedia Dynamic Voltage and Frequency Scaling) driver + is used to set clk for Mediatek multimedia hardwares, such as display, + camera, mdp and video codec. MMDVFS driver reads which clock muxes and clock + sources are used on this platform from DTS, and sets current clock according + to current voltage informed by regulator callback. + +properties: + compatible: + items: + - const: mediatek,mmdvfs + + operating-points-v2: + description: + Contains any one of opp tables for multimedia modules. + MMDVFS uses it to get voltage setting on this platform. + + mediatek,support_mux: + description: A list of clock mux names defined in clock-names. + allOf: + - $ref: /schemas/types.yaml#/definitions/string-array + + clocks: + description: + A list of phandles of clock muxes and clock sources for + multimedia hardwares. + + clock-names: + description: + A list of name strings of clock muxes and clock sources for + multimedia hardwares. + + # If the platform needs frequency hopping for some clock sources, these + # following properties should be set. + + mediatek,support_hopping: + description: a list of clock names supporting frequency hopping. + allOf: + - $ref: /schemas/types.yaml#/definitions/string-array + + mediatek,action: + description: + A cell with one entry. + It represents the action taken when setting clocks. + 0 means not setting frequency hopping and just set clock mux. + 1 means setting frequency hopping first if the voltage is increasing, but + setting clock mux first if the voltage is decreasing. + allOf: + - $ref: "/schemas/types.yaml#/definitions/uint32" + - enum: [0, 1] + maxItems: 1 + +patternProperties: + "^mediatek,mux_+$": + description: + A series of properties with "mediatek,mux_" prefix. + Each property represents one clock mux, and its value is a list of all + the clock sources for it. The postfix and every item in the property + must be from the clock-names. + + "^mediatek,hopping_+$": + description: + A cell with the same size as opp numbers of an opp table for any MM module + and each entry represents the clock rate for each opp. For example, the + first entry is the clock rate set in opp-0, and the second entry is the + clock rate set in opp-1. + +required: + - compatible + - operating-points-v2 + - mediatek,support_mux + - clock + - clock-names + +examples: + - | + #include + + opp_table_mm: opp-table-mm { + compatible = "operating-points-v2"; + + opp-0 { + opp-hz = /bits/ 64 <315000000>; + opp-microvolt = <650000>; + }; + opp-1 { + opp-hz = /bits/ 64 <450000000>; + opp-microvolt = <725000>; + }; + opp-2 { + opp-hz = /bits/ 64 <606000000>; + opp-microvolt = <825000>; + }; + }; + + opp_table_cam: opp-table-cam { + compatible = "operating-points-v2"; + + opp-0 { + opp-hz = /bits/ 64 <315000000>; + opp-microvolt = <650000>; + }; + opp-1 { + opp-hz = /bits/ 64 <416000000>; + opp-microvolt = <725000>; + }; + opp-2 { + opp-hz = /bits/ 64 <560000000>; + opp-microvolt = <825000>; + }; + }; + + /* Other opp tables for multimedia modules */ + + mmdvfs { + compatible = "mediatek,mmdvfs"; + + operating-points-v2 = <&opp_table_mm>; + + mediatek,support_mux = "mm", "cam", "img", "ipe", + "venc", "vdec", "dpe", "ccu"; + + mediatek,mux_mm = "clk_mmpll_d5_d2", + "clk_mmpll_d7", "clk_tvdpll_mainpll_d2_ck"; + mediatek,mux_cam = "clk_mmpll_d5_d2", + "clk_univpll_d3", "clk_adsppll_d5"; + mediatek,mux_img = "clk_mmpll_d5_d2", + "clk_univpll_d3", "clk_tvdpll_mainpll_d2_ck"; + mediatek,mux_ipe = "clk_mmpll_d5_d2", + "clk_univpll_d3", "clk_mainpll_d2"; + mediatek,mux_venc = "clk_mainpll_d3", + "clk_mmpll_d7", "clk_mmpll_d5"; + mediatek,mux_vdec = "clk_univpll_d2_d2", + "clk_univpll_d3", "clk_univpll_d2"; + mediatek,mux_dpe = "clk_mainpll_d3", + "clk_mmpll_d7", "clk_mainpll_d2"; + mediatek,mux_ccu = "clk_mmpll_d5_d2", + "clk_univpll_d3", "clk_adsppll_d5"; + + mediatek,support_hopping = "clk_mmpll_ck"; + mediatek,hopping_clk_mmpll_ck = <630000000 630000000 650000000>; + mediatek,action = <1>; + + + clocks = <&topckgen CLK_TOP_MM>, + <&topckgen CLK_TOP_CAM>, + <&topckgen CLK_TOP_IMG>, + <&topckgen CLK_TOP_IPE>, + <&topckgen CLK_TOP_VENC>, + <&topckgen CLK_TOP_VDEC>, + <&topckgen CLK_TOP_DPE>, + <&topckgen CLK_TOP_CCU>, + <&topckgen CLK_TOP_MMPLL_D5>, + <&topckgen CLK_TOP_UNIVPLL_D2>, + <&topckgen CLK_TOP_TVDPLL_MAINPLL_D2_CK>, + <&topckgen CLK_TOP_ADSPPLL_D5>, + <&topckgen CLK_TOP_MAINPLL_D2>, + <&topckgen CLK_TOP_MMPLL_D6>, + <&topckgen CLK_TOP_MMPLL_D7>, + <&topckgen CLK_TOP_UNIVPLL_D3>, + <&topckgen CLK_TOP_MAINPLL_D3>, + <&topckgen CLK_TOP_MMPLL_D5_D2>, + <&topckgen CLK_TOP_UNIVPLL_D2_D2>, + <&topckgen CLK_TOP_MMPLL_CK>; + clock-names = "mm", + "cam", + "img", + "ipe", + "venc", + "vdec", + "dpe", + "ccu", + "clk_mmpll_d5", + "clk_univpll_d2", + "clk_tvdpll_mainpll_d2_ck", + "clk_adsppll_d5", + "clk_mainpll_d2", + "clk_mmpll_d6", + "clk_mmpll_d7", + "clk_univpll_d3", + "clk_mainpll_d3", + "clk_mmpll_d5_d2", + "clk_univpll_d2_d2", + "clk_mmpll_ck"; + }; +...