Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4692881yba; Tue, 30 Apr 2019 02:49:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzv8O6JIxtb1VDdYGSwvtxEMXzDGA2h3znk/66JLN5q6yV0/hXbaR45MMx8X7GQgPJLhKc+ X-Received: by 2002:a62:2b4e:: with SMTP id r75mr18518360pfr.131.1556617761624; Tue, 30 Apr 2019 02:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556617761; cv=none; d=google.com; s=arc-20160816; b=Sbu4VYKNU/7Ez6CRwBajn3YjHm+Y5CGjoH0/PfEeSH7UTdClvHSPBVOZGmeAwlbJWw iSn11EjQUJ6cY8ZD8OWbMZ+HDwPLhtKfr25O7/fOub0JLyZmKp/Hmqjqv/9ltiZ4AHSx p962I4QKK7wM0XupT1BGgvrk1cpZsm2uJkVWF/hXdHUx88NtBFcdXAp6McEDronvC1dx d2SjswkghBudDwhmxPh6H+fwDFnucP/HIurhPAhpbXSn/sxPys5gBSj8b1dZ6OoZaz7v SjTtkqPOQrjOhhMXx23FTt5ba0EOS2nqX2Sps5BAQE8nfvDoN711JnaRhDDJn2TNx5E4 fb8A== 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=LZQnl03JcTZNH558jjZL04ZMvvIkk1oxQpJ/aCXyy1Q=; b=TB2qj55pAw3nwozbxDsBOKJ32wIxi1c+G9yxfcJOob+uGdxcVIJz11hGPKztyw3iMN OZC+safrUhR4WGAA9YUR1WBCoaa99dZcQNyfSbWcfliGhXqNTVFV/XDIT3B29TKm0b9g e3FT7biyPPUclyrltHfENs/CwPcN+o0Nzw2c7hDGvZW6aRXJKIfEaYlkJk4LCTuc/W0Y MsswbFqBMhPkbZp/1DzxuNSKJpskc1H3JUQX/tDrL/K3rFKZov/v+kkXw/0kj3tbDA9z +uPg9OlepWRWtlJM3yFMupUmQqFkyZBXxJ11e6GVlm6M4vSPaow8UM7anGE5ktBLelx0 WQ6A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14si22656577pgd.551.2019.04.30.02.49.06; Tue, 30 Apr 2019 02:49:21 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727405AbfD3JqQ (ORCPT + 99 others); Tue, 30 Apr 2019 05:46:16 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:25758 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726979AbfD3Jp0 (ORCPT ); Tue, 30 Apr 2019 05:45:26 -0400 X-UUID: 46bc264e5f0b41d2a503e0747e5afcd3-20190430 X-UUID: 46bc264e5f0b41d2a503e0747e5afcd3-20190430 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 229218210; Tue, 30 Apr 2019 17:45:20 +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; Tue, 30 Apr 2019 17:45:18 +0800 Received: from mtkslt205.mediatek.inc (10.21.15.75) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 30 Apr 2019 17:45:18 +0800 From: Henry Chen To: Georgi Djakov , Rob Herring , Matthias Brugger , Viresh Kumar , Stephen Boyd CC: Nicolas Boichat , Fan Chen , James Liao , Weiyi Lu , , , , Subject: [PATCH RFC V2] Add driver for dvfsrc, support for active state of scpsys Date: Tue, 30 Apr 2019 16:50:54 +0800 Message-ID: <1556614265-12745-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 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 V1: https://lore.kernel.org/patchwork/cover/1028535/ Henry Chen (11): 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 dt-bindings: interconnect: Add header for interconnect node interconnect: mediatek: Add mt8183 interconnect provider driver arm64: dts: mt8183: Add interconnect provider DT nodes .../bindings/interconnect/mtk,mt8183.txt | 24 ++ .../devicetree/bindings/soc/mediatek/dvfsrc.txt | 23 ++ .../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 | 5 + drivers/interconnect/mediatek/mt8183.c | 223 +++++++++++++ drivers/soc/mediatek/Kconfig | 15 + drivers/soc/mediatek/Makefile | 1 + drivers/soc/mediatek/mtk-dvfsrc.c | 347 +++++++++++++++++++++ drivers/soc/mediatek/mtk-scpsys.c | 53 ++++ drivers/soc/mediatek/mtk-scpsys.h | 22 ++ include/dt-bindings/interconnect/mtk,mt8183.h | 18 ++ include/dt-bindings/soc/mtk,dvfsrc.h | 14 + include/soc/mediatek/mtk_dvfsrc.h | 22 ++ include/soc/mediatek/mtk_sip.h | 17 + 18 files changed, 874 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/mtk,mt8183.txt 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/mt8183.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.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