From patchwork Thu Apr 30 03:33:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Sm9obnNvbiBDSCBDaGVuICjpmbPmmK3li7Mp?= X-Patchwork-Id: 13005299 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from APC01-PU1-obe.outbound.protection.outlook.com (APC01-PU1-obe.outbound.protection.outlook.com [40.107.132.41]) by mx.groups.io with SMTP id smtpd.web10.910.1588217620703999340 for ; Wed, 29 Apr 2020 20:33:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@moxa.com header.s=selector1 header.b=gaXA41tx; spf=pass (domain: moxa.com, ip: 40.107.132.41, mailfrom: johnsonch.chen@moxa.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LCebzrYK6tVm0VYkaTu+2zaO4/x8s7mJepcWuYPyEatkqrJVr8ziF66shgYbBpIY5yEaTzNOoUuNejjE+8O++riP5tLyL/VjExQ5CCXviXU8PQGihSyNNVUYv6rgx7NqAczDnr0CGKqbLIVoRKwtPgqhBJyYUf8idCGpNTsJaChLU7OL8Z5cE7ycEpI1HUj7prgzwEu0zRX83J7jboczINHXr60Y5kI9OjomTapgH3YcVItGOw7N2ka7dX03xzDfyZm0SvFwas8i8fKyFuAG2Le1BUJwTNb8MQPxCOr0Jg4tLiUqijNddru2nvWlCWGAxi/mRYy6O/2iPAbtL7ysWA== 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-SenderADCheck; bh=6rZ4mIhCwx2yrWK4TeNxQwkBIHAey2/vPviU5TgeSaA=; b=bjg8/XgL5CwLlrwulPRQLFdABlHmJrLF2vRVk0ugRiQTs8ODQX+/nqNrkTvH2bCuOalXx8U6IG0ws9Bv4HSqGtq3hSFtNhvnwe/NC4hqIX1SEP1JavMDluPLqmbtSICZ0J8rHFeXUJmsv7Z1lLNsyqwzGbN91JLD9iprTDf+5xF8b/WRVOa0ZVkfAlCtzW97UTRcxXHMQaLMdxMouKqvBclY2vlC01S0TIICLok2glaveO63mNAcoipw3/inn2AM1MicY8xAXM23229fEfYqJtToOMdo6Ys/5UqsUHNLJugrCrWtHT8mu6XuD05b6QoAWlUKLUSJeggRQ2yLwj73/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=moxa.com; dmarc=pass action=none header.from=moxa.com; dkim=pass header.d=moxa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxa.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6rZ4mIhCwx2yrWK4TeNxQwkBIHAey2/vPviU5TgeSaA=; b=gaXA41tx9u4Pgx+zmESNpjoM+xvkW4p3lVqk055uNOVWXpCBkSKUYeoZ9+FXrut5OtQYpe9EsyqwCNxE9LtU7brOcNDoBA2ZKqbHboeOdIIu8tVz8daavnSrCwLZqdjaIVKr1iG+c8293ShA+bmhSXcqi3q2qoh57roN603BKXk= Received: from HK2PR01MB3281.apcprd01.prod.exchangelabs.com (2603:1096:202:22::12) by HK2PR01MB3313.apcprd01.prod.exchangelabs.com (2603:1096:202:19::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 03:33:38 +0000 Received: from HK2PR01MB3281.apcprd01.prod.exchangelabs.com ([fe80::f0d1:8e7c:a9aa:46b1]) by HK2PR01MB3281.apcprd01.prod.exchangelabs.com ([fe80::f0d1:8e7c:a9aa:46b1%7]) with mapi id 15.20.2937.023; Thu, 30 Apr 2020 03:33:37 +0000 From: =?utf-8?b?Sm9obnNvbiBDSCBDaGVuICjpmbPmmK3li7Mp?= To: "cip-dev@lists.cip-project.org" , "nobuhiro1.iwamatsu@toshiba.co.jp" , "pavel@denx.de" Subject: [cip-dev] [PATCH 4.4.y-cip 1/3] PM / OPP: Add "opp-supported-hw" binding Thread-Topic: [cip-dev] [PATCH 4.4.y-cip 1/3] PM / OPP: Add "opp-supported-hw" binding Thread-Index: AdYenxNSCEZO6mr5QSyFUuDS2m/e2g== Date: Thu, 30 Apr 2020 03:33:37 +0000 Message-ID: Accept-Language: zh-TW, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.cip-project.org; dkim=none (message not signed) header.d=none;lists.cip-project.org; dmarc=none action=none header.from=moxa.com; x-originating-ip: [123.51.145.16] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d30de5d8-b9dc-4d6e-835c-08d7ecb74504 x-ms-traffictypediagnostic: HK2PR01MB3313: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0389EDA07F x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: m5m0N4vEImSUVWFLsdFuMWHHM+Kaq/uXuFKrVRr5NalElkcGQsqKQaL5Bo9Xw1a+QZdNaajQt9vzvdy1aKIAPqCEjmGhE0jygwj7Lyv1dB70c42hEi9nOG/kPuw02MpyiYfLuG8DvA9lSH0B3547kXllTBdxnGs/QS/rH1M/dMsurlX600DlTey0OH/JJ1YnhDQLciwJOhe9k9v2gQpQt9Rze4/8e2B2jkzzglqUZ+DBmZk5WpR1O+yAf4+YLMRqIkNsf/le52eEYx3xvcVd6Tqf/d6lr1kqwVgbLDLfvKNpwYLur3Ijt2orcOu+Yt58ecemps4idiy8ZmXfjCfhmdoA/e4kbOap5vppWE0MKWuEQ3JgFzMytOsGrVxoTxSn55MEYNtdVXeRWyt0JMEo11JghsOHPSdvE714jMhhuxJZG7q6a7ijaD86jsuRWdxM x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HK2PR01MB3281.apcprd01.prod.exchangelabs.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39850400004)(366004)(396003)(136003)(346002)(376002)(2906002)(71200400001)(55016002)(5660300002)(86362001)(110136005)(9686003)(52536014)(316002)(8936002)(64756008)(66946007)(66476007)(33656002)(8676002)(66556008)(478600001)(186003)(26005)(66446008)(76116006)(7696005)(85182001)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: okLwLxioRIqV2R+NPSyvEtHP2md8468EzJHApGX3AC/Ty6ypeqshA0iTFCmftifEqiw+4qXBi0ucXpicludwcedHevjdu51vf5OogIEfJX1rHSG9hysRJwI+aoJTx9walHN87wmf82yAhllvkF1VbFumJ4ng9nIEIDh8Q08HqB/Q4sKzCXVKNoDR/iB9BUF6K8fYgZrzUOEoF8hWy6Y+T5S3SUY22qU+ZAM1vYLdrEJ7FB2gfp1ct9PRZJd+uHLHJK1itWZaBYRxHOpCwYAKufAJ/IdvxQLVqdHAF9+pbOO604k2L+G3dzjO20x9oSfXRlWzbUuH8PueyBQdWRp9h+Jdv71a8wG0ZHJLgUDl3ewpIwQ8ltEztmfSjLP6sd3PMLFir/SauJajWuY2ukihrEomlYDZ/KPwJ9SIDKA82dz1UTmCw4MsJnbdcHig4AM0yUyraTbv/5BX51OQlaLHq7RVJ8DmIfpM+pYv7jN4mb2dA+lFPMmsUmqNuxj0TmgQ8e8fFTYllL9e34A3TN5+K1u5pnvICUsPio84zyBCHg7Zdo75erEThjeSzduhXFMlzfWX+DDPt2zKj0wovhyLTU9LGQe9zrDGDRXbiUQNKX3/mthNF30jL/N2UfocHNWrYZ/Icya64JvmHZ/h6ImUokHFn4sQVhfi4+435fJHI9RrnxRafsqeitkmCqVwfc5TbUlE0VjJq1G5LwP/n4elW8K+85k8Yfal+vot/USqvT8J4zmi518guE8LIl7ts8hbicTyCjd1/rNMV6wFOdfqA7ymxgUSuyrz9DWUUhF4TDk= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: moxa.com X-MS-Exchange-CrossTenant-Network-Message-Id: d30de5d8-b9dc-4d6e-835c-08d7ecb74504 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 03:33:37.6169 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5571c7d4-286b-47f6-9dd5-0aa688773c8e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TCxau/bsSP14zbGLl4jGcQRG7wBeB6l3xk34BYOxRkiGuYfrJ16mubYayBD8PSAsW6EF89DVS8JZHbynwdecrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR01MB3313 Content-Language: zh-TW List-Id: From: Viresh Kumar commit 1c4d12de2719dfdf27c6dab31e7a5641ee293c94 upstream We may want to enable only a subset of OPPs, from the bigger list of OPPs, based on what version of the hardware we are running on. This would enable us to not duplicate OPP tables for every version of the hardware we support. To enable that, this patch defines a new property 'opp-supported-hw'. It can support any number of hierarchy levels of the versions the hardware follows. And based on the selected hardware versions, we can pick only the relevant OPPs at runtime. Reviewed-by: Stephen Boyd Acked-by: Rob Herring Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki Signed-off-by: Johnson Chen Signed-off-by: Victor Yu --- Documentation/devicetree/bindings/opp/opp.txt | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 0cb44dc21f97..d072fa0ffbd4 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -123,6 +123,26 @@ Optional properties: - opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this. +- opp-supported-hw: This enables us to select only a subset of OPPs from the + larger OPP table, based on what version of the hardware we are running on. We + still can't have multiple nodes with the same opp-hz value in OPP table. + + It's an user defined array containing a hierarchy of hardware version numbers, + supported by the OPP. For example: a platform with hierarchy of three levels + of versions (A, B and C), this field should be like , where X + corresponds to Version hierarchy A, Y corresponds to version hierarchy B and Z + corresponds to version hierarchy C. + + Each level of hierarchy is represented by a 32 bit value, and so there can be + only 32 different supported version per hierarchy. i.e. 1 bit per version. A + value of 0xFFFFFFFF will enable the OPP for all versions for that hierarchy + level. And a value of 0x00000000 will disable the OPP completely, and so we + never want that to happen. + + If 32 values aren't sufficient for a version hierarchy, than that version + hierarchy can be contained in multiple 32 bit values. i.e. in the + above example, Z1 & Z2 refer to the version hierarchy Z. + - status: Marks the node enabled/disabled. Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together. @@ -463,3 +483,48 @@ Example 5: Multiple OPP tables }; }; }; + +Example 6: opp-supported-hw +(example: three level hierarchy of versions: cuts, substrate and process) + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-a7"; + ... + + cpu-supply = <&cpu_supply> + operating-points-v2 = <&cpu0_opp_table_slow>; + }; + }; + + opp_table { + compatible = "operating-points-v2"; + status = "okay"; + opp-shared; + + opp00 { + /* + * Supports all substrate and process versions for 0xF + * cuts, i.e. only first four cuts. + */ + opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF> + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <900000 915000 925000>; + ... + }; + + opp01 { + /* + * Supports: + * - cuts: only one, 6th cut (represented by 6th bit). + * - substrate: supports 16 different substrate versions + * - process: supports 9 different process versions + */ + opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0> + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <900000 915000 925000>; + ... + }; + }; +};