From patchwork Thu Apr 30 03:34:01 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: 13005301 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.50]) by mx.groups.io with SMTP id smtpd.web10.918.1588217643302312574 for ; Wed, 29 Apr 2020 20:34:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@moxa.com header.s=selector1 header.b=VxcYckYX; spf=pass (domain: moxa.com, ip: 40.107.132.50, mailfrom: johnsonch.chen@moxa.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k2NbSZg1UkCG4l2AgOBv5bUYJymvFnkMAAvOe5f/Hv+w6XCcsRro9JbEO42RUM7/hPrVDbNeRpjiM1Tka0Z9vPCZvomU4unRaV1D9ASFwzcvvcDB0lpUbz9AN93J+ngaOyPM5dV8zwwIeaOF6x5iQxWhSj5g3dwcmZvhapnf+sq1iE5afnE9dk0PMbI6zsZz+7mrOTLOVHYSMxeGrHZGV03Kwh/WKvMrIR6wsSpzXsfEQWqK1ZZvyMg4Oz9pMZLnjVOOsH0w56lfC8NGd68mAkr78r6HocTUMkqYIHbUyxGaD2t1DZ7Y+LixIFGS/5iT+r4VQ+Z1hMbFawkOYckkxA== 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=y8qpHF31rnb3Dt8T0tvrj26M23gpMVBYbwcaW/nXeic=; b=Qy2Ik4eeBIJRc+bCgXmyntvPHfLAArivkePvPYKUePsTjT9CSDS9PtSDfCF6ufkO0eCP3J2du3WMxDoT9C95lTx1pLQZV4Rd28sdIFxE67PLYK0K/RlZBjPE8nLOV2XZKbuhX3RFvDCHO8Hj5z74uTfSmTU+4phVRcsu4WVY2T/42RH5ACuCHdVNXHjQRzrwG+Dtft2xsE1gnPL9klpi8+OZacNIXQu6VL9Xpe69b6pwwDyR8g/g8Q1EuAbqEuQ9WoEoV9iTCBCxup75nTWA/BHmw+BC3us0yBmmt1RgeC9Hk4nx3qiImRAASvnQcIzBcZXHZs+4wMjXWEdFYsTvsw== 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=y8qpHF31rnb3Dt8T0tvrj26M23gpMVBYbwcaW/nXeic=; b=VxcYckYXBBpeIZ5p/neSWC66l+066m2l8wc6XCO9INHBwX0vVeWhUs1EPo/ygm2ORFZl1kdAoooE46muHbxwWrrOfuUXrxaN2n71Ynr/ZAmy/8IMHv9n7xctwz/FudvbxJW1t8K/dLVymAis2u6e7UlOa6bqD3yRV/UeMSU1ql4= 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:34:01 +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:34:01 +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 3/3] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime Thread-Topic: [cip-dev] [PATCH 4.4.y-cip 3/3] cpufreq: ti: Add cpufreq driver to determine available OPPs at runtime Thread-Index: AdYen0mssNII0WHPS4yXx042E25KCQ== Date: Thu, 30 Apr 2020 03:34:01 +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: 87a51612-1303-4cdc-881b-08d7ecb75314 x-ms-traffictypediagnostic: HK2PR01MB3313: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2331; x-forefront-prvs: 0389EDA07F x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +WJjCrI9/M8VF67tU2sRGgA2vgOsceQfoRud+lQNBcKCbW3wiSy22Wc8W/e5afQbKICVxeBp1DRR0BVWApQdqrD66CTLwzouQc2a9v/voxpRn3+5aeeJLQu7JQHJPC2scl1iib5YhvAxAKjsnbAeZ/IWACs0lE0Vrk+ZnpVCuKcxzIs3LmQo+aJTUY1OOSykHRH59xoSYXUux1bMows8RggOEDjUsnzRujOGzcZLTQjKCe6Z04WPDuoKFyfMq7UkkEe/YnN7AFSVHzIPEI6yaB9nt/aND+lgGyo6YbuwwRaNrCswx3rk0vHlTrtsxQskcTDwWUVvgLyCYV8pQ4j7MunfzDgF/h1Lq75pf9nPh/qzmFbmBLmnTChq1/RdyRGe4J/mGgBl8kHgNqTRS8kjtVC8ka7dKew9xONsVb0wOleHJI1SI/35YpLFk4p2B14dxNI3DhW27+L833NdD8PZ0N69FOdkDezC1nGXLSdRCOk= 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)(30864003)(86362001)(110136005)(9686003)(52536014)(316002)(8936002)(64756008)(66946007)(66476007)(33656002)(8676002)(66556008)(478600001)(186003)(26005)(66446008)(76116006)(7696005)(85182001)(6506007)(2004002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: tIf2A1eZ4LknZsbFxSlJwnyrklr3g9ITd+N3v1sYbxCXd2B1ZaAtmNnbfJJf7LwljnCKqu4D2ENxWjd4cSQk89rM9seQMBppvWe+nBXCo8KjAxiP7mGzt270P9UMQRkvWnWOUBuLIHqIOO6fNjF/+WmTZvECIOXTBFw49jEMkfGYqx3tCSr9kuOlvfdsWeK2cSjTDleCioWHUzHSZzhdE2dYcJggq0p4ly7EzEuCZFq7tGj0s4LEgA/IvA7CRJiRjO+GGydCBq6mVJl7ocWfPcWYySHsgfy9L0qQP6/ZHQruiSI8qK8kdnMCgbj0vu0eq+h2Lw7dUoEhetzyR+hQTkiKwvedLEkRmb3tYDJLg4d8aLOAvF+DWXyB4Op/DsZqpkiqzVOw69p9gYlGA4qrvZuRkFPuKy0pH9CE9VuUzUXYkTU7CX6SEdrjfuA6emetcTN1M2wqn+LN/pdAcC+oGyhzcixjmRqFyxL0f6Is8wB+Urp+5/YOZRLygly+yTxYOSb22cmzh8jlJwukfhqFiTQeW5PtR+KBtwFEhFw658NfK+nabsJZ6AS1QmK3auIRq5Noge1qol+rbLyZ0cV0HQPrA3S2YIyIiJijDl3ccU6VCjT24SqWHd9aIctjkrmgTlkbGnuC1X/xiZ1kuVeldRvwL2jzqJVkdDNzzo9CLNWUgqlMlU3dBHukVkPF1YCEstD6VDq5JkRwAfVEXBulE20pMJ7TZvqx/SX4Y+ELXf1xGphKfDC648s/JlIOAP6TiAnIGGv37iQliJITFSqqZ5M39qmpAN2X2vbvXmIzDj8= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: moxa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87a51612-1303-4cdc-881b-08d7ecb75314 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 03:34:01.1340 (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: ShmW7li4cb51KoYSu/R4oinVM40GOx2Ei9a+HOd6p+sepyGa879IKIsm/KvgfNMeCk7N8Rtl1y+uH+Ol7+o55A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR01MB3313 Content-Language: zh-TW List-Id: From: Dave Gerlach commit e13cf046cd70894393a1085ca39da7ef751353fb upstream Some TI SoCs, like those in the AM335x, AM437x, DRA7x, and AM57x families, have different OPPs available for the MPU depending on which specific variant of the SoC is in use. This can be determined through use of the revision and an eFuse register present in the silicon. Introduce a ti-cpufreq driver that can read the aformentioned values and provide them as version matching data to the opp framework. Through this the opp-supported-hw dt binding that is part of the operating-points-v2 table can be used to indicate availability of OPPs for each device. This driver also creates the "cpufreq-dt" platform_device after passing the version matching data to the OPP framework so that the cpufreq-dt handles the actual cpufreq implementation. Even without the necessary data to pass the version matching data the driver will still create this device to maintain backwards compatibility with operating-points v1 tables. Acked-by: Viresh Kumar Signed-off-by: Dave Gerlach Signed-off-by: Rafael J. Wysocki [Johnson Chen: Use original api _of_get_opp_desc_node() and assign returned value of dev_pm_opp_set_supported_hw() to ret directly] Signed-off-by: Johnson Chen Signed-off-by: Victor Yu --- drivers/base/power/opp/core.c | 1 + drivers/cpufreq/Kconfig.arm | 11 ++ drivers/cpufreq/Makefile | 1 + drivers/cpufreq/ti-cpufreq.c | 272 ++++++++++++++++++++++++++++++++++++++++++ include/linux/pm_opp.h | 7 ++ 5 files changed, 292 insertions(+) create mode 100644 drivers/cpufreq/ti-cpufreq.c diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index c53a3e261306..4035d282d6df 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -1325,6 +1325,7 @@ struct device_node *_of_get_opp_desc_node(struct device *dev) return of_parse_phandle(dev->of_node, "operating-points-v2", 0); } +EXPORT_SYMBOL_GPL(_of_get_opp_desc_node); /* Initializes OPP tables based on new bindings */ static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np) diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index eed1e073d96d..6b834112d857 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -231,6 +231,17 @@ config ARM_TEGRA124_CPUFREQ help This adds the CPUFreq driver support for Tegra124 SOCs. +config ARM_TI_CPUFREQ + bool "Texas Instruments CPUFreq support" + depends on ARCH_OMAP2PLUS + help + This driver enables valid OPPs on the running platform based on + values contained within the SoC in use. Enable this in order to + use the cpufreq-dt driver on all Texas Instruments platforms that + provide dt based operating-points-v2 tables with opp-supported-hw + data provided. Required for cpufreq support on AM335x, AM437x, + DRA7x, and AM57x platforms. + config ARM_PXA2xx_CPUFREQ tristate "Intel PXA2xx CPUfreq driver" depends on PXA27x || PXA25x diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index c0af1a1281c8..6e889596d9a1 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -75,6 +75,7 @@ obj-$(CONFIG_ARM_SCPI_CPUFREQ) += scpi-cpufreq.o obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o obj-$(CONFIG_ARM_TEGRA20_CPUFREQ) += tegra20-cpufreq.o obj-$(CONFIG_ARM_TEGRA124_CPUFREQ) += tegra124-cpufreq.o +obj-$(CONFIG_ARM_TI_CPUFREQ) += ti-cpufreq.o obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o obj-$(CONFIG_ACPI_CPPC_CPUFREQ) += cppc_cpufreq.o diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c new file mode 100644 index 000000000000..3dbf57164ded --- /dev/null +++ b/drivers/cpufreq/ti-cpufreq.c @@ -0,0 +1,272 @@ +/* + * TI CPUFreq/OPP hw-supported driver + * + * Copyright (C) 2016-2017 Texas Instruments, Inc. + * Dave Gerlach + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define REVISION_MASK 0xF +#define REVISION_SHIFT 28 + +#define AM33XX_800M_ARM_MPU_MAX_FREQ 0x1E2F +#define AM43XX_600M_ARM_MPU_MAX_FREQ 0xFFA + +#define DRA7_EFUSE_HAS_OD_MPU_OPP 11 +#define DRA7_EFUSE_HAS_HIGH_MPU_OPP 15 +#define DRA7_EFUSE_HAS_ALL_MPU_OPP 23 + +#define DRA7_EFUSE_NOM_MPU_OPP BIT(0) +#define DRA7_EFUSE_OD_MPU_OPP BIT(1) +#define DRA7_EFUSE_HIGH_MPU_OPP BIT(2) + +#define VERSION_COUNT 2 + +struct ti_cpufreq_data; + +struct ti_cpufreq_soc_data { + unsigned long (*efuse_xlate)(struct ti_cpufreq_data *opp_data, + unsigned long efuse); + unsigned long efuse_fallback; + unsigned long efuse_offset; + unsigned long efuse_mask; + unsigned long efuse_shift; + unsigned long rev_offset; +}; + +struct ti_cpufreq_data { + struct device *cpu_dev; + struct device_node *opp_node; + struct regmap *syscon; + const struct ti_cpufreq_soc_data *soc_data; +}; + +static unsigned long amx3_efuse_xlate(struct ti_cpufreq_data *opp_data, + unsigned long efuse) +{ + if (!efuse) + efuse = opp_data->soc_data->efuse_fallback; + /* AM335x and AM437x use "OPP disable" bits, so invert */ + return ~efuse; +} + +static unsigned long dra7_efuse_xlate(struct ti_cpufreq_data *opp_data, + unsigned long efuse) +{ + unsigned long calculated_efuse = DRA7_EFUSE_NOM_MPU_OPP; + + /* + * The efuse on dra7 and am57 parts contains a specific + * value indicating the highest available OPP. + */ + + switch (efuse) { + case DRA7_EFUSE_HAS_ALL_MPU_OPP: + case DRA7_EFUSE_HAS_HIGH_MPU_OPP: + calculated_efuse |= DRA7_EFUSE_HIGH_MPU_OPP; + case DRA7_EFUSE_HAS_OD_MPU_OPP: + calculated_efuse |= DRA7_EFUSE_OD_MPU_OPP; + } + + return calculated_efuse; +} + +static struct ti_cpufreq_soc_data am3x_soc_data = { + .efuse_xlate = amx3_efuse_xlate, + .efuse_fallback = AM33XX_800M_ARM_MPU_MAX_FREQ, + .efuse_offset = 0x07fc, + .efuse_mask = 0x1fff, + .rev_offset = 0x600, +}; + +static struct ti_cpufreq_soc_data am4x_soc_data = { + .efuse_xlate = amx3_efuse_xlate, + .efuse_fallback = AM43XX_600M_ARM_MPU_MAX_FREQ, + .efuse_offset = 0x0610, + .efuse_mask = 0x3f, + .rev_offset = 0x600, +}; + +static struct ti_cpufreq_soc_data dra7_soc_data = { + .efuse_xlate = dra7_efuse_xlate, + .efuse_offset = 0x020c, + .efuse_mask = 0xf80000, + .efuse_shift = 19, + .rev_offset = 0x204, +}; + +/** + * ti_cpufreq_get_efuse() - Parse and return efuse value present on SoC + * @opp_data: pointer to ti_cpufreq_data context + * @efuse_value: Set to the value parsed from efuse + * + * Returns error code if efuse not read properly. + */ +static int ti_cpufreq_get_efuse(struct ti_cpufreq_data *opp_data, + u32 *efuse_value) +{ + struct device *dev = opp_data->cpu_dev; + u32 efuse; + int ret; + + ret = regmap_read(opp_data->syscon, opp_data->soc_data->efuse_offset, + &efuse); + if (ret) { + dev_err(dev, + "Failed to read the efuse value from syscon: %d\n", + ret); + return ret; + } + + efuse = (efuse & opp_data->soc_data->efuse_mask); + efuse >>= opp_data->soc_data->efuse_shift; + + *efuse_value = opp_data->soc_data->efuse_xlate(opp_data, efuse); + + return 0; +} + +/** + * ti_cpufreq_get_rev() - Parse and return rev value present on SoC + * @opp_data: pointer to ti_cpufreq_data context + * @revision_value: Set to the value parsed from revision register + * + * Returns error code if revision not read properly. + */ +static int ti_cpufreq_get_rev(struct ti_cpufreq_data *opp_data, + u32 *revision_value) +{ + struct device *dev = opp_data->cpu_dev; + u32 revision; + int ret; + + ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset, + &revision); + if (ret) { + dev_err(dev, + "Failed to read the revision number from syscon: %d\n", + ret); + return ret; + } + + *revision_value = BIT((revision >> REVISION_SHIFT) & REVISION_MASK); + + return 0; +} + +static int ti_cpufreq_setup_syscon_register(struct ti_cpufreq_data *opp_data) +{ + struct device *dev = opp_data->cpu_dev; + struct device_node *np = opp_data->opp_node; + + opp_data->syscon = syscon_regmap_lookup_by_phandle(np, + "syscon"); + if (IS_ERR(opp_data->syscon)) { + dev_err(dev, + "\"syscon\" is missing, cannot use OPPv2 table.\n"); + return PTR_ERR(opp_data->syscon); + } + + return 0; +} + +static const struct of_device_id ti_cpufreq_of_match[] = { + { .compatible = "ti,am33xx", .data = &am3x_soc_data, }, + { .compatible = "ti,am4372", .data = &am4x_soc_data, }, + { .compatible = "ti,dra7", .data = &dra7_soc_data }, + {}, +}; + +static int ti_cpufreq_init(void) +{ + u32 version[VERSION_COUNT]; + struct device_node *np; + const struct of_device_id *match; + struct ti_cpufreq_data *opp_data; + int ret; + + np = of_find_node_by_path("/"); + match = of_match_node(ti_cpufreq_of_match, np); + if (!match) + return -ENODEV; + + opp_data = kzalloc(sizeof(*opp_data), GFP_KERNEL); + if (!opp_data) + return -ENOMEM; + + opp_data->soc_data = match->data; + + opp_data->cpu_dev = get_cpu_device(0); + if (!opp_data->cpu_dev) { + pr_err("%s: Failed to get device for CPU0\n", __func__); + return -ENODEV; + } + + opp_data->opp_node = _of_get_opp_desc_node(opp_data->cpu_dev); + if (!opp_data->opp_node) { + dev_info(opp_data->cpu_dev, + "OPP-v2 not supported, cpufreq-dt will attempt to use legacy tables.\n"); + goto register_cpufreq_dt; + } + + ret = ti_cpufreq_setup_syscon_register(opp_data); + if (ret) + goto fail_put_node; + + /* + * OPPs determine whether or not they are supported based on + * two metrics: + * 0 - SoC Revision + * 1 - eFuse value + */ + ret = ti_cpufreq_get_rev(opp_data, &version[0]); + if (ret) + goto fail_put_node; + + ret = ti_cpufreq_get_efuse(opp_data, &version[1]); + if (ret) + goto fail_put_node; + + of_node_put(opp_data->opp_node); + + ret = dev_pm_opp_set_supported_hw(opp_data->cpu_dev, + version, VERSION_COUNT); + if (ret) { + dev_err(opp_data->cpu_dev, + "Failed to set supported hardware\n"); + goto fail_put_node; + } + +register_cpufreq_dt: + platform_device_register_simple("cpufreq-dt", -1, NULL, 0); + + return 0; + +fail_put_node: + of_node_put(opp_data->opp_node); + + return ret; +} +module_init(ti_cpufreq_init); + +MODULE_DESCRIPTION("TI CPUFreq/OPP hw-supported driver"); +MODULE_AUTHOR("Dave Gerlach "); +MODULE_LICENSE("GPL v2"); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 3a85110242f0..6c6348692cd4 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -151,6 +151,8 @@ int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask); void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask); int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask); int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask); +struct device_node *_of_get_opp_desc_node(struct device *dev); + #else static inline int dev_pm_opp_of_add_table(struct device *dev) { @@ -179,6 +181,11 @@ static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_va { return -ENOSYS; } +static inline struct device_node *_of_get_opp_desc_node(struct device *dev) +{ + return NULL; +} + #endif #endif /* __LINUX_OPP_H__ */