Skip to content

Commit c102671

Browse files
committed
Merge branch 'pm-devfreq'
* pm-devfreq: (24 commits) PM / devfreq: Add debugfs support with devfreq_summary file PM / devfreq: exynos: Rename Exynos to lowercase PM / devfreq: imx8m-ddrc: Fix inconsistent IS_ERR and PTR_ERR PM / devfreq: exynos-bus: Add error log when fail to get devfreq-event PM / devfreq: exynos-bus: Disable devfreq-event device when fails PM / devfreq: rk3399_dmc: Disable devfreq-event device when fails PM / devfreq: imx8m-ddrc: Remove unused defines PM / devfreq: exynos-bus: Reduce goto statements and remove unused headers PM / devfreq: rk3399_dmc: Add COMPILE_TEST and HAVE_ARM_SMCCC dependency PM / devfreq: rockchip-dfi: Convert to devm_platform_ioremap_resource PM / devfreq: rk3399_dmc: Add missing of_node_put() PM / devfreq: rockchip-dfi: Add missing of_node_put() PM / devfreq: Fix multiple kernel-doc warnings PM / devfreq: exynos-bus: Extract exynos_bus_profile_init_passive() PM / devfreq: exynos-bus: Extract exynos_bus_profile_init() PM / devfreq: Move declaration of DEVICE_ATTR_RW(min_freq) PM / devfreq: Move statistics to separate struct devfreq_stats PM / devfreq: Add clearing transitions stats PM / devfreq: Change time stats to 64-bit PM / devfreq: Add new name attribute for sysfs ...
2 parents c95d9c1 + 854e334 commit c102671

File tree

16 files changed

+856
-132
lines changed

16 files changed

+856
-132
lines changed

Documentation/ABI/testing/sysfs-class-devfreq

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ Description:
77
The name of devfreq object denoted as ... is same as the
88
name of device using devfreq.
99

10+
What: /sys/class/devfreq/.../name
11+
Date: November 2019
12+
Contact: Chanwoo Choi <[email protected]>
13+
Description:
14+
The /sys/class/devfreq/.../name shows the name of device
15+
of the corresponding devfreq object.
16+
1017
What: /sys/class/devfreq/.../governor
1118
Date: September 2011
1219
Contact: MyungJoo Ham <[email protected]>
@@ -48,12 +55,15 @@ What: /sys/class/devfreq/.../trans_stat
4855
Date: October 2012
4956
Contact: MyungJoo Ham <[email protected]>
5057
Description:
51-
This ABI shows the statistics of devfreq behavior on a
52-
specific device. It shows the time spent in each state and
53-
the number of transitions between states.
58+
This ABI shows or clears the statistics of devfreq behavior
59+
on a specific device. It shows the time spent in each state
60+
and the number of transitions between states.
5461
In order to activate this ABI, the devfreq target device
5562
driver should provide the list of available frequencies
56-
with its profile.
63+
with its profile. If need to reset the statistics of devfreq
64+
behavior on a specific device, enter 0(zero) to 'trans_stat'
65+
as following:
66+
echo 0 > /sys/class/devfreq/.../trans_stat
5767

5868
What: /sys/class/devfreq/.../userspace/set_freq
5969
Date: September 2011
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/memory-controllers/fsl/imx8m-ddrc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: i.MX8M DDR Controller
8+
9+
maintainers:
10+
- Leonard Crestez <[email protected]>
11+
12+
description:
13+
The DDRC block is integrated in i.MX8M for interfacing with DDR based
14+
memories.
15+
16+
It supports switching between different frequencies at runtime but during
17+
this process RAM itself becomes briefly inaccessible so actual frequency
18+
switching is implemented by TF-A code which runs from a SRAM area.
19+
20+
The Linux driver for the DDRC doesn't even map registers (they're included
21+
for the sake of "describing hardware"), it mostly just exposes firmware
22+
capabilities through standard Linux mechanism like devfreq and OPP tables.
23+
24+
properties:
25+
compatible:
26+
items:
27+
- enum:
28+
- fsl,imx8mn-ddrc
29+
- fsl,imx8mm-ddrc
30+
- fsl,imx8mq-ddrc
31+
- const: fsl,imx8m-ddrc
32+
33+
reg:
34+
maxItems: 1
35+
description:
36+
Base address and size of DDRC CTL area.
37+
This is not currently mapped by the imx8m-ddrc driver.
38+
39+
clocks:
40+
maxItems: 4
41+
42+
clock-names:
43+
items:
44+
- const: core
45+
- const: pll
46+
- const: alt
47+
- const: apb
48+
49+
operating-points-v2: true
50+
opp-table: true
51+
52+
required:
53+
- reg
54+
- compatible
55+
- clocks
56+
- clock-names
57+
58+
additionalProperties: false
59+
60+
examples:
61+
- |
62+
#include <dt-bindings/clock/imx8mm-clock.h>
63+
ddrc: memory-controller@3d400000 {
64+
compatible = "fsl,imx8mm-ddrc", "fsl,imx8m-ddrc";
65+
reg = <0x3d400000 0x400000>;
66+
clock-names = "core", "pll", "alt", "apb";
67+
clocks = <&clk IMX8MM_CLK_DRAM_CORE>,
68+
<&clk IMX8MM_DRAM_PLL>,
69+
<&clk IMX8MM_CLK_DRAM_ALT>,
70+
<&clk IMX8MM_CLK_DRAM_APB>;
71+
operating-points-v2 = <&ddrc_opp_table>;
72+
};

drivers/devfreq/Kconfig

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ config DEVFREQ_GOV_PASSIVE
7777
comment "DEVFREQ Drivers"
7878

7979
config ARM_EXYNOS_BUS_DEVFREQ
80-
tristate "ARM EXYNOS Generic Memory Bus DEVFREQ Driver"
80+
tristate "ARM Exynos Generic Memory Bus DEVFREQ Driver"
8181
depends on ARCH_EXYNOS || COMPILE_TEST
8282
select DEVFREQ_GOV_SIMPLE_ONDEMAND
8383
select DEVFREQ_GOV_PASSIVE
@@ -91,6 +91,16 @@ config ARM_EXYNOS_BUS_DEVFREQ
9191
and adjusts the operating frequencies and voltages with OPP support.
9292
This does not yet operate with optimal voltages.
9393

94+
config ARM_IMX8M_DDRC_DEVFREQ
95+
tristate "i.MX8M DDRC DEVFREQ Driver"
96+
depends on (ARCH_MXC && HAVE_ARM_SMCCC) || \
97+
(COMPILE_TEST && HAVE_ARM_SMCCC)
98+
select DEVFREQ_GOV_SIMPLE_ONDEMAND
99+
select DEVFREQ_GOV_USERSPACE
100+
help
101+
This adds the DEVFREQ driver for the i.MX8M DDR Controller. It allows
102+
adjusting DRAM frequency.
103+
94104
config ARM_TEGRA_DEVFREQ
95105
tristate "NVIDIA Tegra30/114/124/210 DEVFREQ Driver"
96106
depends on ARCH_TEGRA_3x_SOC || ARCH_TEGRA_114_SOC || \
@@ -115,14 +125,15 @@ config ARM_TEGRA20_DEVFREQ
115125

116126
config ARM_RK3399_DMC_DEVFREQ
117127
tristate "ARM RK3399 DMC DEVFREQ Driver"
118-
depends on ARCH_ROCKCHIP
128+
depends on (ARCH_ROCKCHIP && HAVE_ARM_SMCCC) || \
129+
(COMPILE_TEST && HAVE_ARM_SMCCC)
119130
select DEVFREQ_EVENT_ROCKCHIP_DFI
120131
select DEVFREQ_GOV_SIMPLE_ONDEMAND
121132
select PM_DEVFREQ_EVENT
122133
help
123-
This adds the DEVFREQ driver for the RK3399 DMC(Dynamic Memory Controller).
124-
It sets the frequency for the memory controller and reads the usage counts
125-
from hardware.
134+
This adds the DEVFREQ driver for the RK3399 DMC(Dynamic Memory Controller).
135+
It sets the frequency for the memory controller and reads the usage counts
136+
from hardware.
126137

127138
source "drivers/devfreq/event/Kconfig"
128139

drivers/devfreq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o
99

1010
# DEVFREQ Drivers
1111
obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o
12+
obj-$(CONFIG_ARM_IMX8M_DDRC_DEVFREQ) += imx8m-ddrc.o
1213
obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ) += rk3399_dmc.o
1314
obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra30-devfreq.o
1415
obj-$(CONFIG_ARM_TEGRA20_DEVFREQ) += tegra20-devfreq.o

drivers/devfreq/devfreq-event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ EXPORT_SYMBOL_GPL(devfreq_event_add_edev);
346346

347347
/**
348348
* devfreq_event_remove_edev() - Remove the devfreq-event device registered.
349-
* @dev : the devfreq-event device
349+
* @edev : the devfreq-event device
350350
*
351-
* Note that this function remove the registered devfreq-event device.
351+
* Note that this function removes the registered devfreq-event device.
352352
*/
353353
int devfreq_event_remove_edev(struct devfreq_event_dev *edev)
354354
{

0 commit comments

Comments
 (0)