Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp792208ybl; Wed, 28 Aug 2019 05:30:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeNmNOmk4vy2+v5Ar7sboJwkngfDHs2timG8qxeY+Zpj8BpKaWGIaMijjSX9+ufBzHRdrU X-Received: by 2002:a63:b46:: with SMTP id a6mr3286491pgl.235.1566995418906; Wed, 28 Aug 2019 05:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566995418; cv=none; d=google.com; s=arc-20160816; b=XpJjY1G4blrmkXMW6K/5CBVh0mWEQMNtXmLoMkVZ1yIKx+X7aRFsZjgDWjE4JmLc/r YBu6POlGGLQMYFhcDE7GxSLJMrOOEbbPKdsCF6y2Sh7P+jzReQq/kDRZVkEaYTDD7ymL puTGwKmHdmlJ9keudrpQTpesBT37xa27snwqDIgmuUCu8tTNT0ehngOk7zdKkkfwOyO+ nVqVWdqe3RoANdxh7+0er+4ApmVBRUNp5X4OfMHQG0dCBpQiVdI/C+/3O+YPH9XabTDF IdxVR6xkp3B3oGtJJ5I7ApsYecgqu0jGkxITTXrXY5gI6fLt1dbQZ9fJ1VFvM9ZtVtig qjgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=4uTaRkmBUPQFnXz46Wm3TLIaYXRKYnwZSyycZIORTXQ=; b=rIiRcjRAk/1C20QRj88MKvW+P68kYORxknLvO8Al7rGghYbQJw9A45EYCcPmzX1zbS tUnYVaTHAERbLhzkf/WaHGEXAh/1a4h4e2x85Sk99g01c5rfGK/JFsV5wdpAQkmc9eI0 FXjzdDX9g4WdmVVt8WdRnla29Y0Ws95tdqbkfVZdWTy0sh5ftF8GQVfqDhl3z5KVJshr BUoL/kqviK07akOovkwbCJ7K4WrRiPB3yR2gVgL+CGsx9nnzukO9nVfwhgYhniPtbvOZ eZtGY3LLIjmiXwCleny2FgEDpwYe84sAIHTRsqxHvEkbhJotI3KNPUtQudp+1YhFP4xu lxtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si1802043plr.158.2019.08.28.05.30.03; Wed, 28 Aug 2019 05:30:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbfH1M3H (ORCPT + 99 others); Wed, 28 Aug 2019 08:29:07 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:2747 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726541AbfH1M3C (ORCPT ); Wed, 28 Aug 2019 08:29:02 -0400 X-UUID: 6eaa46da8a724eadb1ee62c224dd50aa-20190828 X-UUID: 6eaa46da8a724eadb1ee62c224dd50aa-20190828 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1926949016; Wed, 28 Aug 2019 20:28:52 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 20:28:58 +0800 Received: from mtksdaap41.mediatek.inc (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 20:28:58 +0800 From: Henry Chen To: Georgi Djakov , Rob Herring , Matthias Brugger , Viresh Kumar , Stephen Boyd , Ryan Case CC: Nicolas Boichat , Fan Chen , James Liao , Weiyi Lu , , , , Subject: [PATCH V3 00/10] Add driver for dvfsrc, support for active state of scpsys Date: Wed, 28 Aug 2019 20:28:38 +0800 Message-ID: <1566995328-15158-1-git-send-email-henryc.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patchsets add support for MediaTek hardware module named DVFSRC (dynamic voltage and frequency scaling resource collector). The DVFSRC is a HW module which is used to collect all the requests from both software and hardware and turn into the decision of minimum operating voltage and minimum DRAM frequency to fulfill those requests. So, This series is to implement the dvfsrc driver to collect all the requests of operating voltage or DRAM bandwidth from other device drivers likes GPU/Camera through 2 frameworks basically: 1. interconnect framework: to aggregate the bandwidth requirements from different clients [1] https://patchwork.kernel.org/cover/10766329/ Below is the emi bandwidth map of mt8183. There has a hw module "DRAM scheduler" which used to control the throughput. The DVFSRC will collect forecast data of dram bandwidth from SW consumers(camera/gpu...), and according the forecast to change the DRAM frequency ICC provider ICC Nodes ---- ---- --------- |CPU | |--->|VPU | ----- | |-----> ---- | ---- |DRAM |--|DRAM | ---- | ---- | |--|scheduler|----->|GPU | |--->|DISP| | |--|(EMI) | ---- | ---- | |--| | ----- | ---- ----- | |----->|MMSYS|--|--->|VDEC| --------- ----- | ---- /|\ | ---- |change DRAM freq |--->|VENC| ---------- | ---- | DVFSR | | | | | ---- ---------- |--->|IMG | | ---- | ---- |--->|CAM | ---- 2. Active state management of power domains[1]: to handle the operating voltage opp requirement from different power domains [2] https://lwn.net/Articles/744047/ Changes in RFC V3: * Remove RFC from the subject prefix of the series * Combine dt-binding patch and move interconnect dt-binding document into dvfsrc. (Rob) * Remove unused header, add unit descirption to the bandwidth, rename compatible name on interconnect driver. (Georgi) * Fixed some coding style: check flow, naming, used readx_poll_timeout on dvfsrc driver. (Ryan) * Rename interconnect driver mt8183.c to mtk-emi.c * Rename interconnect header mtk,mt8183.h to mtk,emi.h * mtk-scpsys.c: Add opp table check first to avoid OF runtime parse failed Changes in RFC V2: * Remove the DT property dram_type. (Rob) * Used generic dts property 'opp-level' to get the performace state. (Stephen) * Remove unecessary dependency config on Kconfig. (Stephen) * Remove unused header file, fixed some coding style issue, typo, error handling on dvfsrc driver. (Nicolas/Stephen) * Remove irq handler on dvfsrc driver. (Stephen) * Remove init table on dvfsrc driver, combine hw init on trustzone. * Add interconnect support of mt8183 to aggregate the emi bandwidth. (Georgi) RFC V2: https://lore.kernel.org/patchwork/patch/1068113/ RFC V1: https://lore.kernel.org/patchwork/cover/1028535/ Henry Chen (10): dt-bindings: soc: Add dvfsrc driver bindings dt-bindings: soc: Add opp table on scpsys bindings soc: mediatek: add support for the performance state arm64: dts: mt8183: add performance state support of scpsys soc: mediatek: add header for mediatek SIP interface soc: mediatek: add MT8183 dvfsrc support arm64: dts: mt8183: add dvfsrc related nodes dt-bindings: interconnect: add MT8183 interconnect dt-bindings interconnect: mediatek: Add mt8183 interconnect provider driver arm64: dts: mt8183: Add interconnect provider DT nodes .../devicetree/bindings/soc/mediatek/dvfsrc.txt | 32 ++ .../devicetree/bindings/soc/mediatek/scpsys.txt | 42 +++ arch/arm64/boot/dts/mediatek/mt8183.dtsi | 33 ++ drivers/interconnect/Kconfig | 1 + drivers/interconnect/Makefile | 1 + drivers/interconnect/mediatek/Kconfig | 13 + drivers/interconnect/mediatek/Makefile | 3 + drivers/interconnect/mediatek/mtk-emi.c | 246 ++++++++++++++ drivers/soc/mediatek/Kconfig | 15 + drivers/soc/mediatek/Makefile | 1 + drivers/soc/mediatek/mtk-dvfsrc.c | 374 +++++++++++++++++++++ drivers/soc/mediatek/mtk-scpsys.c | 58 ++++ drivers/soc/mediatek/mtk-scpsys.h | 22 ++ include/dt-bindings/interconnect/mtk,mt8183-emi.h | 18 + include/dt-bindings/soc/mtk,dvfsrc.h | 14 + include/soc/mediatek/mtk_dvfsrc.h | 22 ++ include/soc/mediatek/mtk_sip.h | 17 + 17 files changed, 912 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/mediatek/dvfsrc.txt create mode 100644 drivers/interconnect/mediatek/Kconfig create mode 100644 drivers/interconnect/mediatek/Makefile create mode 100644 drivers/interconnect/mediatek/mtk-emi.c create mode 100644 drivers/soc/mediatek/mtk-dvfsrc.c create mode 100644 drivers/soc/mediatek/mtk-scpsys.h create mode 100644 include/dt-bindings/interconnect/mtk,mt8183-emi.h create mode 100644 include/dt-bindings/soc/mtk,dvfsrc.h create mode 100644 include/soc/mediatek/mtk_dvfsrc.h create mode 100644 include/soc/mediatek/mtk_sip.h -- 1.9.1