PM / devferq: Add generic exynos bus frequency driver and new passive governor
Subsystems (4)
Chanwoo Choi
maintainerv9 cover PM / devferq: Add generic exynos bus frequency driver and new passive governor
This patch-set includes the two features as following. The generic exynos bus frequency driver is able to support almost Exynos SoCs for bus frequency scaling. And the new passive governor is able to make the dependency on between devices for frequency/voltage scaling. I had posted the patch-set[1] with the similiar concept. This is is revised version for exynos bus frequency.
- Generic exynos bus frequency driver
- New passive governor of DEVFREQ framework
[1] https://lkml.org/lkml/2015/1/7/872
: [PATCHv3 0/8] devfreq: Add generic exynos memory-bus frequency driver
Changes from v8:
(https://lkml.org/lkml/2016/4/8/14)
- Fix possible recursive locking issue by using mutex_lock_nested()
Changes from v7:
(https://lkml.org/lkml/2016/3/31/308)
- Use IS_ERR() instead of IS_ERR_OR_NULL() macro
- Add signed-off-by/acked-by tag of DEVFREQ maintainer
- Fix the comment in governor_passive.c
Changes from v6:
(https://lkml.org/lkml/2016/3/27/187)
- Patch1/2 add signed-off-by tag from DEVFREQ Maintainer (Myungjoo Ham)
- Drop patch5 (PM / devfreq: Add governer type with unique number)
- Add missing description about the transition_notifier_list in struct devfreq
- Remove the passive governor code from devfreq.c core driver. Instead, passive governor uses the DEVFREQ_GOV_START/STOP signal to register/unregister the DEVFREQ_TRANSITION_NOTIFIER between the parent devfreq device and passive devfreq device.
- Add the author (myungjoo.ham at samsung.com) of passive governor
- Add 'struct devfreq_passive_data' to pass the devfreq instance of parent.
Changes from v5:
(https://lkml.org/lkml/2016/3/24/5)
- Rebase the patch-set on Linux v4.6-rc1
- Add Tested-by tag from Markus Reichl <[email protected]>
- Add Tested-by tag from Anand Moon <[email protected]>
Changes from v4:
(https://lkml.org/lkml/2015/12/14/43)
- Add new DEVFREQ_TRANSITION_NOTIFIER notifier. The passive devfreq device recevie the changed frequency of parent
devfreq device through DEVFREQ_TRANSITION_NOTIFIER.
- Add governor type to identify thme using the defined constant
- Modify the passive governor using the DEVFREQ_TRANSITION_NOTIFIER notifier.
- Fix the RCU locking probrlm (Reported-by: Tobias Jakobi)
- Fix the debugfs error during the kernel booting (Reported-by: Tobias Jakobi)
- The Device Tree patches have got Reviewed-by tag from Exynos SoC Maintainer (Krzysztof Kozlowski <[email protected]>)
Changes from v3:
(https://lkml.org/lkml/2015/12/11/75)
- Add the reviewed-by tag from Krzysztof Kozlowski (patch2/3/13/14/15/16/17)
- Fix typo of the description on patch14
- Modify the subject and description of patch17
- Reorder the 'bus_xxx' device tree node alphabetically in
both exynos3250-rinato/monk.dts and exynos4412-trats/odroidu3
Changes from v2:
(https://lkml.org/lkml/2015/12/8/869)
- Fix typo on documentation
- Modify the more appropriate sentence on patch description
- Add the detailed description about both parent and passive bus device
- Modify the DMC frequency for Exynos4x12 DMC bus (200MHz -> 267MHz)
- Modify the voltage of 200MHz was included in Exynos3250 DMC bus (800mV -> 825mV)
- Rename OPP nodes as 'opp@<opp-hz>'
- Delete the duplicate 'opp-microvolt' property of passive devfreq device
- Reorder the 'bus_xxx' device tree node alphabetically in exynos3250-rinato/monk.dts
- Reorder the 'bus_xxx' device tree node alphabetically in exynos4412-trats/odroidu3
- Add new exynos4412-ppmu-common.dtsi to remove the duplicate PPMU dt node on rinato/monk/trats2/odroid-u3 board
- Add the log message if bus device is registered to devfreq framework successfully
- Add the reviewed-by tag from Krzysztof Kozlowski
- Add the tested-by tag from Anand Moon on Odroid U3
- Add 'SAMSUNG BUS FREQUENCY DRIVER' entry to MAINTAINERS
Changes from v1:
(https://lkml.org/lkml/2015/11/26/260)
- Check whether the instance of regulator is NULL or not when executing regulator_disable() because of only parent devfreq device has the regulator instance. After fixing it, the wake-up from suspend state is well working. (patch1)
- Fix bug which checks 'bus-clk' instead of 'bus->regulator' after calling devm_clk_get() (on patch1)
- Update the documentation to remove the description about DEVFREQ-EVENT subsystem (on patch2)
- Add the full name of DMC (Dynamic Memory Controller) (on patch2)
- Modify the detailed correlation of buses for Exynos3250 on documentation (patch2)
- Add the MFC bus node for Exynos3250 (on patch11, patch12)
- Fix the duplicate frequency of bus_display on Exynos4x12.dtsi
- Add the PPMU node for exynos4412-odroidu3
- Add the support of bus frequency for exynos4412-odroidu3
[Description]
Detailed descirption for patch-set:
1. Add generic exynos bus frequency driver
: This patch-set adds the generic exynos bus frequency driver for AXI bus of sub-blocks in exynos SoC. The Samsung Exynos SoC have the common architecture for bus between DRAM and sub-blocks in SoC.
There are the different buses according to Exynos SoC because Exynos SoC
has the differnt sub-blocks and bus speed. In spite of this difference among Exynos SoCs, this driver is able to support almost Exynos SoC by adding unique data of each bus in the devicetree file.
In devicetree, each bus node has a bus clock, regulator, operation-point
and devfreq-event devices which measure the utilization of each bus block.
For example,
- The bus of DMC block in exynos3250.dtsi are listed below:
bus_dmc: bus_dmc {
compatible = "samsung,exynos-bus";
clocks = <&cmu_dmc CLK_DIV_DMC>;
clock-names = "bus";
operating-points-v2 = <&bus_dmc_opp_table>;
status = "disabled";
};
bus_dmc_opp_table: opp_table1 {
compatible = "operating-points-v2";
opp-shared;
opp at 50000000 {
opp-hz = /bits/ 64 <50000000>;
opp-microvolt = <800000>;
};
opp at 100000000 {
opp-hz = /bits/ 64 <100000000>;
opp-microvolt = <800000>;
};
opp at 134000000 {
opp-hz = /bits/ 64 <134000000>;
opp-microvolt = <800000>;
};
opp at 200000000 {
opp-hz = /bits/ 64 <200000000>;
opp-microvolt = <825000>;
};
opp at 400000000 {
opp-hz = /bits/ 64 <400000000>;
opp-microvolt = <875000>;
};
};- Usage case to handle the frequency and voltage of bus on runtime in exynos3250-rinato.dts are listed below:
&bus_dmc {
devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
vdd-supply = <&buck1_reg>; /* VDD_MIF */
status = "okay";
};2. Add new passive governor of DEVFREQ framework
: This patch-set add the new passive governor for DEVFREQ framework. The existing governors (ondemand, performance and so on) are used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The existing governors are independently used for specific device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers.
The passive governor depends on operation of parent driver with existinggovernors(ondemand, performance and so on) extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree:
For exameple,
There are one more bus device drivers in Exynos3250 which need to
change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, LEFTBUS bus driver is operated as parent with ondemand governor and then the rest device driver with passive governor.
The buses of Internal block in exynos3250.dtsi are listed below:
When LEFTBUS bus driver (parent) changes the bus frequency with ondemand governor on runtime, the rest bus devices which sharing the same power line (VDD_INT) will change the each bus frequency according to the decision of LEFTBUS bus driver (parent).
- INT (Internal) block
: VDD_INT |--- LEFTBUS |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM
- The buss of INT block in exynos3250.dtsi are listed below:
bus_leftbus: bus_leftbus {
compatible = "samsung,exynos-bus";
clocks = <&cmu CLK_DIV_GDL>;
clock-names = "bus";
operating-points-v2 = <&bus_leftbus_opp_table>;
status = "disabled";
};
bus_rightbus: bus_rightbus {
compatible = "samsung,exynos-bus";
clocks = <&cmu CLK_DIV_GDR>;
clock-names = "bus";
operating-points-v2 = <&bus_leftbus_opp_table>;
status = "disabled";
};
(Omit the rest bus dt node)- Usage case to handle the frequency and voltage of bus on runtime in exynos3250-rinato.dts are listed below:
/* Parent bus device of VDD_INT */
&bus_leftbus {
devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
vdd-supply = <&buck3_reg>;
status = "okay";
};
/* Passive bus device depend on LEFTBUS bus. */
&bus_rightbus {
devfreq = <&bus_leftbus>; /* 'devfreq' property indicates
the phandle of parent device. */
status = "okay";
};
(Omit the rest bus dt node)Chanwoo Choi (20):
PM / devfreq: exynos: Add generic exynos bus frequency driver
PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver PM / devfreq: Add devfreq_get_devfreq_by_phandle()
PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier
PM / devfreq: Add new passive governor
PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor PM / devfreq: exynos: Update documentation for bus devices using passive governor PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
MAINTAINERS: Add samsung bus frequency driver entry
ARM: dts: Add DMC bus node for Exynos3250
ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk
ARM: dts: Add bus nodes using VDD_INT for Exynos3250
ARM: dts: Add bus nodes using VDD_MIF for Exynos4x12
ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
ARM: dts: Add bus nodes using VDD_MIF for Exynos4210
ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU nodes
ARM: dts: Add support of bus frequency using VDD_INT for exynos3250-rinato
ARM: dts: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3
ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3
.../devicetree/bindings/devfreq/exynos-bus.txt | 390 ++++++++ MAINTAINERS | 9 + arch/arm/boot/dts/exynos3250-monk.dts | 47 +- arch/arm/boot/dts/exynos3250-rinato.dts | 88 +- arch/arm/boot/dts/exynos3250.dtsi | 181 ++++ arch/arm/boot/dts/exynos4210.dtsi | 159 +++ arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 56 +- arch/arm/boot/dts/exynos4412-ppmu-common.dtsi | 50 + arch/arm/boot/dts/exynos4412-trats2.dts | 88 +- arch/arm/boot/dts/exynos4x12.dtsi | 174 ++++ drivers/devfreq/Kconfig | 36 +- drivers/devfreq/Makefile | 4 +- drivers/devfreq/devfreq.c | 207 +++- drivers/devfreq/exynos-bus.c | 570 +++++++++++ drivers/devfreq/exynos/Makefile | 3 - drivers/devfreq/exynos/exynos4_bus.c | 1055 -------------------- drivers/devfreq/exynos/exynos4_bus.h | 110 -- drivers/devfreq/exynos/exynos5_bus.c | 431 -------- drivers/devfreq/exynos/exynos_ppmu.c | 119 --- drivers/devfreq/exynos/exynos_ppmu.h | 86 -- drivers/devfreq/governor_passive.c | 207 ++++ include/linux/devfreq.h | 99 ++ 22 files changed, 2221 insertions(+), 1948 deletions(-) create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-bus.txt create mode 100644 arch/arm/boot/dts/exynos4412-ppmu-common.dtsi create mode 100644 drivers/devfreq/exynos-bus.c delete mode 100644 drivers/devfreq/exynos/Makefile delete mode 100644 drivers/devfreq/exynos/exynos4_bus.c delete mode 100644 drivers/devfreq/exynos/exynos4_bus.h delete mode 100644 drivers/devfreq/exynos/exynos5_bus.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.h create mode 100644 drivers/devfreq/governor_passive.c
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 1/20 PM / devfreq: exynos: Add generic exynos bus frequency driver
This patch adds the generic exynos bus frequency driver for AMBA AXI bus of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC have the common architecture for bus between DRAM and sub-blocks in SoC. This driver can support the generic bus frequency driver for Exynos SoCs.
In devicetree, Each bus block has a bus clock, regulator, operation-point and devfreq-event devices which measure the utilization of each bus block.
--- drivers/devfreq/Kconfig | 15 ++ drivers/devfreq/Makefile | 1 + drivers/devfreq/exynos-bus.c | 443 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 459 insertions(+) create mode 100644 drivers/devfreq/exynos-bus.c
drivers/devfreq/Kconfig +15 -0
@@ -66,6 +66,21 @@ config DEVFREQ_GOV_USERSPACE comment "DEVFREQ Drivers" +config ARM_EXYNOS_BUS_DEVFREQ + bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" + depends on ARCH_EXYNOS + select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_EVENT_EXYNOS_PPMU + select PM_DEVFREQ_EVENT + select PM_OPP + help + This adds the common DEVFREQ driver for Exynos Memory bus. Exynos + Memory bus has one more group of memory bus (e.g, MIF and INT block). + Each memory bus group could contain many memoby bus block. It reads + PPMU counters of memory controllers by using DEVFREQ-event device + and adjusts the operating frequencies and voltages with OPP support. + This does not yet operate with optimal voltages. + config ARM_EXYNOS4_BUS_DEVFREQ bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM
drivers/devfreq/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o # DEVFREQ Drivers +obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos/ obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos/ obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra-devfreq.o
drivers/devfreq/exynos-bus.c new file +443 -0
443 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v9 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
Quoted 13 lines · Chanwoo Choi
This patch adds the generic exynos bus frequency driver for AMBA AXI bus of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC have the common architecture for bus between DRAM and sub-blocks in SoC. This driver can support the generic bus frequency driver for Exynos SoCs.
In devicetree, Each bus block has a bus clock, regulator, operation-point and devfreq-event devices which measure the utilization of each bus block.
Signed-off-by Chanwoo Choi <[email protected]>[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]Tested-by Markus Reichl <[email protected]>Tested-by Anand Moon <[email protected]>Signed-off-by MyungJoo Ham <[email protected]>
Quoted 6 lines
--- drivers/devfreq/Kconfig | 15 ++ drivers/devfreq/Makefile | 1 + drivers/devfreq/exynos-bus.c | 443 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 459 insertions(+) create mode 100644 drivers/devfreq/exynos-bus.c
Best regards,
Krzysztof
Chanwoo Choi
maintainerPATCH v9 2/20 PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver
In reply to Chanwoo ChoiThis patch adds the documentation for generic exynos bus frequency driver.
--- .../devicetree/bindings/devfreq/exynos-bus.txt | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-bus.txt
Documentation/devicetree/bindings/devfreq/exynos-bus.txt new file +95 -0
@@ -0,0 +1,95 @@ +* Generic Exynos Bus frequency device + +The Samsung Exynos SoC has many buses for data transfer between DRAM +and sub-blocks in SoC. Most Exynos SoCs share the common architecture +for buses. Generally, each bus of Exynos SoC includes a source clock +and a power line, which are able to change the clock frequency +of the bus in runtime. To monitor the usage of each bus in runtime, +the driver uses the PPMU (Platform Performance Monitoring Unit), which +is able to measure the current load of sub-blocks. + +There are a little different composition among Exynos SoC because each Exynos +SoC has different sub-blocks. Therefore, shch difference should be specified +in devicetree file instead of each device driver. In result, this driver +is able to support the bus frequency for all Exynos SoCs. + +Required properties for bus device: +- compatible: Should be "samsung,exynos-bus". +- clock-names : the name of clock used by the bus, "bus". +- clocks : phandles for clock specified in "clock-names" property. +- operating-points-v2: the OPP table including frequency/voltage information + to support DVFS (Dynamic Voltage/Frequency Scaling) feature. +- vdd-supply: the regulator to provide the buses with the voltage. +- devfreq-events: the devfreq-event device to monitor the current utilization + of buses. + +Optional properties for bus device: +- exynos,saturation-ratio: the percentage value which is used to calibrate + the performance count against total cycle count. +- exynos,voltage-tolerance: the percentage value for bus voltage tolerance + which is used to calculate the max voltage. + +Example1: + Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to + power line (regulator). The MIF (Memory Interface) AXI bus is used to + transfer data between DRAM and CPU and uses the VDD_MIF regualtor. + + - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block + + - MIF bus's frequency/voltage table + ----------------------- + |Lv| Freq | Voltage | + ----------------------- + |L1| 50000 |800000 | + |L2| 100000 |800000 | + |L3| 134000 |800000 | + |L4| 200000 |825000 | + |L5| 400000 |875000 | + ----------------------- + +Example2 : + The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi + is listed below: + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu_dmc CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + opp-microvolt = <800000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-microvolt = <800000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + opp-microvolt = <800000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <825000>; + }; + opp at 400000000 { + opp-hz = /bits/ 64 <400000000>; + opp-microvolt = <875000>; + }; + }; + + Usage case to handle the frequency and voltage of bus on runtime + in exynos3250-rinato.dts is listed below: + + &bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; /* VDD_MIF */ + status = "okay"; + };
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 3/20 PM / devfreq: Add devfreq_get_devfreq_by_phandle()
In reply to Chanwoo ChoiThis patch adds the new devfreq_get_devfreq_by_phandle() OF helper function which can find the instance of devfreq device by using phandle ("devfreq").
--- drivers/devfreq/devfreq.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/devfreq.h | 9 +++++++++ 2 files changed, 53 insertions(+)
drivers/devfreq/devfreq.c +44 -0
@@ -25,6 +25,7 @@#include <linux/list.h> #include <linux/printk.h> #include <linux/hrtimer.h> +#include <linux/of.h> #include "governor.h" static struct class *devfreq_class;
@@ -639,6 +640,49 @@ struct devfreq *devm_devfreq_add_device(struct device *dev, }EXPORT_SYMBOL (devm_devfreq_add_device); +#ifdef CONFIG_OF +/* +* devfreq_get_devfreq_by_phandle - Get the devfreq device from devicetree +* @dev - instance to the given device +* @index - index into list of devfreq +* +* return the instance of devfreq device +*/ +struct devfreq *devfreq_get_devfreq_by_phandle (struct device *dev,int index) +{ +struct device_node *node; +struct devfreq *devfreq; + +if (!dev) +return ERR_PTR (-EINVAL ); + +if (!dev->of_node) +return ERR_PTR (-EINVAL ); + + node =of_parse_phandle (dev->of_node,"devfreq" , index); +if (!node) +return ERR_PTR (-ENODEV ); + +mutex_lock (&devfreq_list_lock); +list_for_each_entry (devfreq, &devfreq_list, node) { +if (devfreq->dev.parent + && devfreq->dev.parent->of_node == node) { +mutex_unlock (&devfreq_list_lock); +return devfreq; + } + } +mutex_unlock (&devfreq_list_lock); + +return ERR_PTR (-EPROBE_DEFER ); +} +#else +struct devfreq *devfreq_get_devfreq_by_phandle (struct device *dev,int index) +{ +return ERR_PTR (-ENODEV ); +} +#endif /* CONFIG_OF */ +EXPORT_SYMBOL_GPL (devfreq_get_devfreq_by_phandle); +/** * devm_devfreq_remove_device() - Resource-managed devfreq_remove_device() * @dev: the device to add devfreq feature.
include/linux/devfreq.h +9 -0
@@ -208,6 +208,9 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev,extern void devm_devfreq_unregister_opp_notifier (struct device *dev,struct devfreq *devfreq); +extern struct devfreq *devfreq_get_devfreq_by_phandle (struct device *dev, +int index); +/** * devfreq_update_stats() - update the last_status pointer in struct devfreq * @df: the devfreq instance whose status needs updating
@@ -307,6 +310,12 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev, { } +static inline struct devfreq *devfreq_get_devfreq_by_phandle (struct device *dev, +int index) +{ +return ERR_PTR (-ENODEV ); +} +static inline int devfreq_update_stats (struct devfreq *df) {return -EINVAL ;
Signature · 1 line
1.9.1
Re: [PATCH v9 03/20] PM / devfreq: Add devfreq_get_devfreq_by_phandle()
Quoted 8 lines · Chanwoo Choi
This patch adds the new
devfreq_get_devfreq_by_phandle()OF helper function which can find the instance of devfreq device by using phandle ("devfreq").Signed-off-by Chanwoo Choi <[email protected]>Signed-off-by MyungJoo Ham <[email protected]>[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]Tested-by Markus Reichl <[email protected]>Tested-by Anand Moon <[email protected]>
Quoted 5 lines
--- drivers/devfreq/devfreq.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/devfreq.h | 9 +++++++++ 2 files changed, 53 insertions(+)
Best regards,
Krzysztof
Chanwoo Choi
maintainerPATCH v9 4/20 PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier
In reply to Chanwoo ChoiThis patch adds the new DEVFREQ_TRANSITION_NOTIFIER notifier to send the notification when the frequency of device is changed. This notifier has two state as following:
- DEVFREQ_PRECHANGE : Notify it before chaning the frequency of device
- DEVFREQ_POSTCHANGE : Notify it after changed the frequency of device
And this patch adds the resourced-managed function to release the resource automatically when error happen.
--- drivers/devfreq/devfreq.c | 163 +++++++++++++++++++++++++++++++++++++++++++++- include/linux/devfreq.h | 59 ++++++++++++++++- 2 files changed, 220 insertions(+), 2 deletions(-)
drivers/devfreq/devfreq.c +162 -1
@@ -189,6 +189,29 @@ static struct devfreq_governor *find_devfreq_governor(const char *name)return ERR_PTR (-ENODEV ); } +static int devfreq_notify_transition (struct devfreq *devfreq, +struct devfreq_freqs *freqs,unsigned int state) +{ +if (!devfreq) +return -EINVAL ; + +switch (state) { +case DEVFREQ_PRECHANGE : +srcu_notifier_call_chain (&devfreq->transition_notifier_list, +DEVFREQ_PRECHANGE , freqs); +break ; + +case DEVFREQ_POSTCHANGE : +srcu_notifier_call_chain (&devfreq->transition_notifier_list, +DEVFREQ_POSTCHANGE , freqs); +break ; +default : +return -EINVAL ; + } + +return 0 ; +} +/* Load monitoring helper functions for governors use */ /**
@@ -200,7 +223,8 @@ static struct devfreq_governor *find_devfreq_governor(const char *name)*/ int update_devfreq (struct devfreq *devfreq) { -unsigned long freq; +struct devfreq_freqs freqs; +unsigned long freq, cur_freq;int err =0 ;u32 flags =0 ;
@@ -234,10 +258,22 @@ int update_devfreq(struct devfreq *devfreq) flags |=DEVFREQ_FLAG_LEAST_UPPER_BOUND ;/* Use LUB */ } +if (devfreq->profile->get_cur_freq) + devfreq->profile->get_cur_freq (devfreq->dev.parent, &cur_freq); +else + cur_freq = devfreq->previous_freq; + + freqs.old = cur_freq; + freqs.new = freq; +devfreq_notify_transition (devfreq, &freqs,DEVFREQ_PRECHANGE ); + err = devfreq->profile->target (devfreq->dev.parent, &freq, flags);if (err)return err; + freqs.new = freq; +devfreq_notify_transition (devfreq, &freqs,DEVFREQ_POSTCHANGE ); +if (devfreq->profile->freq_table)if (devfreq_update_status (devfreq, freq)) dev_err(&devfreq->dev,
@@ -542,6 +578,8 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_out; } +srcu_init_notifier_head (&devfreq->transition_notifier_list); +mutex_unlock (&devfreq->lock);mutex_lock (&devfreq_list_lock);
@@ -1310,6 +1348,129 @@ void devm_devfreq_unregister_opp_notifier(struct device *dev, }EXPORT_SYMBOL (devm_devfreq_unregister_opp_notifier); +/** +* devfreq_register_notifier() - Register a driver with devfreq +* @devfreq: The devfreq object. +* @nb: The notifier block to register. +* @list: DEVFREQ_TRANSITION_NOTIFIER. +*/ +int devfreq_register_notifier (struct devfreq *devfreq, +struct notifier_block *nb, +unsigned int list) +{ +int ret =0 ; + +if (!devfreq) +return -EINVAL ; + +switch (list) { +case DEVFREQ_TRANSITION_NOTIFIER : + ret =srcu_notifier_chain_register ( + &devfreq->transition_notifier_list, nb); +break ; +default : + ret = -EINVAL ; + } + +return ret; +} +EXPORT_SYMBOL (devfreq_register_notifier); + +/* +* devfreq_unregister_notifier() - Unregister a driver with devfreq +* @devfreq: The devfreq object. +* @nb: The notifier block to be unregistered. +* @list: DEVFREQ_TRANSITION_NOTIFIER. +*/ +int devfreq_unregister_notifier (struct devfreq *devfreq, +struct notifier_block *nb, +unsigned int list) +{ +int ret =0 ; + +if (!devfreq) +return -EINVAL ; + +switch (list) { +case DEVFREQ_TRANSITION_NOTIFIER : + ret =srcu_notifier_chain_unregister ( + &devfreq->transition_notifier_list, nb); +break ; +default : + ret = -EINVAL ; + } + +return ret; +} +EXPORT_SYMBOL (devfreq_unregister_notifier); + +struct devfreq_notifier_devres { +struct devfreq *devfreq; +struct notifier_block *nb; +unsigned int list; +}; + +static void devm_devfreq_notifier_release (struct device *dev,void *res) +{ +struct devfreq_notifier_devres *this = res; + +devfreq_unregister_notifier (this->devfreq, this->nb, this->list); +} + +/** +* devm_devfreq_register_notifier() +- Resource-managed devfreq_register_notifier() +* @dev: The devfreq user device. (parent of devfreq) +* @devfreq: The devfreq object. +* @nb: The notifier block to be unregistered. +* @list: DEVFREQ_TRANSITION_NOTIFIER. +*/ +int devm_devfreq_register_notifier (struct device *dev, +struct devfreq *devfreq, +struct notifier_block *nb, +unsigned int list) +{ +struct devfreq_notifier_devres *ptr; +int ret; + + ptr =devres_alloc (devm_devfreq_notifier_release,sizeof (*ptr), +GFP_KERNEL ); +if (!ptr) +return -ENOMEM ; + + ret =devfreq_register_notifier (devfreq, nb, list); +if (ret) { +devres_free (ptr); +return ret; + } + + ptr->devfreq = devfreq; + ptr->nb = nb; + ptr->list = list; +devres_add (dev, ptr); + +return 0 ; +} +EXPORT_SYMBOL (devm_devfreq_register_notifier); + +/** +* devm_devfreq_unregister_notifier() +- Resource-managed devfreq_unregister_notifier() +* @dev: The devfreq user device. (parent of devfreq) +* @devfreq: The devfreq object. +* @nb: The notifier block to be unregistered. +* @list: DEVFREQ_TRANSITION_NOTIFIER. +*/ +void devm_devfreq_unregister_notifier (struct device *dev, +struct devfreq *devfreq, +struct notifier_block *nb, +unsigned int list) +{ +WARN_ON (devres_release (dev, devm_devfreq_notifier_release, + devm_devfreq_dev_match, devfreq)); +} +EXPORT_SYMBOL (devm_devfreq_unregister_notifier); +MODULE_AUTHOR ("MyungJoo Ham <[email protected]>" );MODULE_DESCRIPTION ("devfreq class support" );MODULE_LICENSE ("GPL" );
include/linux/devfreq.h +58 -1
89 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v9 4/20 PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier
Quoted 14 lines · Chanwoo Choi
This patch adds the new
DEVFREQ_TRANSITION_NOTIFIERnotifier to send the notification when the frequency of device is changed. This notifier has two state as following:
-DEVFREQ_PRECHANGE: Notify it before chaning the frequency of device
-DEVFREQ_POSTCHANGE: Notify it after changed the frequency of deviceAnd this patch adds the resourced-managed function to release the resource automatically when error happen.
Signed-off-by Chanwoo Choi <[email protected]>[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]Tested-by Markus Reichl <[email protected]>Tested-by Anand Moon <[email protected]>Signed-off-by MyungJoo Ham <[email protected]>
Quoted 4 lines
--- drivers/devfreq/devfreq.c | 163 +++++++++++++++++++++++++++++++++++++++++++++- include/linux/devfreq.h | 59 ++++++++++++++++- 2 files changed, 220 insertions(+), 2 deletions(-)
Best regards,
Krzysztof
Chanwoo Choi
maintainerPATCH v9 5/20 PM / devfreq: Add new passive governor
In reply to Chanwoo ChoiThis patch adds the new passive governor for DEVFREQ framework. The following governors are already present and used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The following governors are independently used for one device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers.
- ondemand / performance / powersave / userspace
The passive governor depends on operation of parent driver with specific governos extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree:
- the source clock and OPP tables
- the instance of parent device
For exameple,
there are one more devfreq device drivers which need to change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, specific device driver is operated as parent with ondemand governor and then the rest device driver with passive governor is influenced by parent device.
--- drivers/devfreq/Kconfig | 8 ++ drivers/devfreq/Makefile | 1 + drivers/devfreq/governor_passive.c | 207 +++++++++++++++++++++++++++++++++++++ include/linux/devfreq.h | 33 ++++++ 4 files changed, 249 insertions(+) create mode 100644 drivers/devfreq/governor_passive.c
drivers/devfreq/Kconfig +8 -0
@@ -64,6 +64,14 @@ config DEVFREQ_GOV_USERSPACE Otherwise, the governor does not change the frequency given at the initialization. +config DEVFREQ_GOV_PASSIVE + tristate "Passive" + help + Sets the frequency based on the frequency of its parent devfreq + device. This governor does not change the frequency by itself + through sysfs entries. The passive governor recommends that + devfreq device uses the OPP table to get the frequency/voltage. + comment "DEVFREQ Drivers" config ARM_EXYNOS_BUS_DEVFREQ
drivers/devfreq/Makefile +1 -0
@@ -4,6 +4,7 @@ obj-$(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) += governor_simpleondemand.o obj-$(CONFIG_DEVFREQ_GOV_PERFORMANCE) += governor_performance.o obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o +obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o # DEVFREQ Drivers obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o
drivers/devfreq/governor_passive.c new file +207 -0
207 lines not on this page · raw message
include/linux/devfreq.h +33 -0
@@ -272,6 +272,39 @@ struct devfreq_simple_ondemand_data { };#endif +#if IS_ENABLED (CONFIG_DEVFREQ_GOV_PASSIVE ) +/** +* struct devfreq_passive_data - void *data fed to struct devfreq +* and devfreq_add_device +* @parent: the devfreq instance of parent device. +* @get_target_freq: Optional callback, Returns desired operating frequency +* for the device using passive governor. That is called +* when passive governor should decide the next frequency +* by using the new frequency of parent devfreq device +* using governors except for passive governor. +* If the devfreq device has the specific method to decide +* the next frequency, should use this callback. +* @this: the devfreq instance of own device. +* @nb: the notifier block for DEVFREQ_TRANSITION_NOTIFIER list +* +* The devfreq_passive_data have to set the devfreq instance of parent +* device with governors except for the passive governor. But, don't need to +* initialize the 'this' and 'nb' field because the devfreq core will handle +* them. +*/ +struct devfreq_passive_data { +/* Should set the devfreq instance of parent device */ +struct devfreq *parent; + +/* Optional callback to decide the next frequency of passvice device */ +int (*get_target_freq)(struct devfreq *this,unsigned long *freq); + +/* For passive governor's internal use. Don't need to set them */ +struct devfreq *this; +struct notifier_block nb; +}; +#endif +#else /* !CONFIG_PM_DEVFREQ */ static inline struct devfreq *devfreq_add_device(struct device *dev, struct devfreq_dev_profile *profile,
Signature · 1 line
1.9.1
Re: [PATCH v9 05/20] PM / devfreq: Add new passive governor
Quoted 30 lines · Chanwoo Choi
This patch adds the new passive governor for DEVFREQ framework. The following governors are already present and used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The following governors are independently used for one device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers.
- ondemand / performance / powersave / userspaceThe passive governor depends on operation of parent driver with specific governos extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree:
- the source clock and OPP tables
- the instance of parent deviceFor exameple,
there are one more devfreq device drivers which need to change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, specific device driver is operated as parent with ondemand governor and then the rest device driver with passive governor is influenced by parent device.Suggested-by Myungjoo Ham <[email protected]>Signed-off-by Chanwoo Choi <[email protected]>[tjakobi: Reported RCU locking issue and cw00.choi fix it]Reported-by Tobias Jakobi <[email protected]>[linux.amoon: Reported possible recursive locking and cw00.choi fix it]Reported-by Anand Moon <[email protected]>Signed-off-by MyungJoo Ham <[email protected]>
Quoted 8 lines
--- drivers/devfreq/Kconfig | 8 ++ drivers/devfreq/Makefile | 1 + drivers/devfreq/governor_passive.c | 207 +++++++++++++++++++++++++++++++++++++ include/linux/devfreq.h | 33 ++++++ 4 files changed, 249 insertions(+) create mode 100644 drivers/devfreq/governor_passive.c
Best regards,
Krzysztof
Chanwoo Choi
maintainerPATCH v9 6/20 PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor
In reply to Chanwoo ChoiThis patch adds the support of bus frequency feature for sub-blocks which share the one power line. If each bus depends on the power line, each bus is not able to change the voltage by oneself. To optimize the power-consumption on runtime, some buses using the same power line should change the source clock and regulator at the same time. So, this patch uses the passive governor to support the bus frequency for all buses which sharing the one power line.
For example,
Exynos3250 include the two power line for AXI buses as following:
: VDD_MIF : MIF (Memory Interface) provide the DMC (Dynamic Memory Controller)
with the power (regulator).
: VDD_INT : INT (Internal) provide the various sub-blocks with the power
(regulator).
Each bus is included in as follwoing block. In the case of VDD_MIF, only DMC bus use the power line. So, there is no any depencency between buese. But, in the case of VDD_INT, various buses share the one power line of VDD_INT. We need to make the depenency between buses. When using passive governor, there is no problem to support the bus frequency as DVFS for all buses. One bus should be operated as the parent bus device which gathering the current load of INT block and then decides the new frequency with some governors except of passive governor. After deciding the new frequency by the parent bus device, the rest bus devices will change the each source clock according to new frequency of the parent bus device.
- MIF (Memory Interface) block
: VDD_MIF |--- DMC
- INT (Internal) block
: VDD_INT |--- LEFTBUS (parent)
|--- PERIL
|--- MFC
|--- G3D
|--- RIGHTBUS
|--- FSYS
|--- LCD0
|--- PERIR
|--- ISP
|--- CAM--- drivers/devfreq/Kconfig | 1 + drivers/devfreq/exynos-bus.c | 219 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 174 insertions(+), 46 deletions(-)
drivers/devfreq/Kconfig +1 -0
@@ -78,6 +78,7 @@ config ARM_EXYNOS_BUS_DEVFREQ bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" depends on ARCH_EXYNOS select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_GOV_PASSIVE select DEVFREQ_EVENT_EXYNOS_PPMU select PM_DEVFREQ_EVENT select PM_OPP
drivers/devfreq/exynos-bus.c +173 -46
310 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v9 06/20] PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor
Quoted 41 lines · Chanwoo Choi
This patch adds the support of bus frequency feature for sub-blocks which share the one power line. If each bus depends on the power line, each bus is not able to change the voltage by oneself. To optimize the power-consumption on runtime, some buses using the same power line should change the source clock and regulator at the same time. So, this patch uses the passive governor to support the bus frequency for all buses which sharing the one power line.
For example,
Exynos3250 include the two power line for AXI buses as following:
:VDD_MIF: MIF (Memory Interface) provide the DMC (Dynamic Memory Controller)
with the power (regulator).
:VDD_INT: INT (Internal) provide the various sub-blocks with the power
(regulator).Each bus is included in as follwoing block. In the case of
VDD_MIF, only DMC bus use the power line. So, there is no any depencency between buese. But, in the case ofVDD_INT, various buses share the one power line ofVDD_INT. We need to make the depenency between buses. When using passive governor, there is no problem to support the bus frequency as DVFS for all buses. One bus should be operated as the parent bus device which gathering the current load of INT block and then decides the new frequency with some governors except of passive governor. After deciding the new frequency by the parent bus device, the rest bus devices will change the each source clock according to new frequency of the parent bus device.- MIF (Memory Interface) block
:VDD_MIF|--- DMC- INT (Internal) block
: VDD_INT |--- LEFTBUS (parent) |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM
Quoted 8 lines
Signed-off-by Chanwoo Choi <[email protected]>[tjakobi: Reported debugfs error during booting and cw00.choi fix it.]Reported-by Tobias Jakobi <[email protected]>Signed-off-by MyungJoo Ham <[email protected]>--- drivers/devfreq/Kconfig | 1 + drivers/devfreq/exynos-bus.c | 219 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 174 insertions(+), 46 deletions(-)
Best regards,
Krzysztof
Chanwoo Choi
maintainerPATCH v9 7/20 PM / devfreq: exynos: Update documentation for bus devices using passive governor
In reply to Chanwoo ChoiThis patch updates the documentation for passive bus devices and adds the detailed example of Exynos3250.
--- .../devicetree/bindings/devfreq/exynos-bus.txt | 250 ++++++++++++++++++++- 1 file changed, 247 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +247 -3
@@ -8,22 +8,46 @@ of the bus in runtime. To monitor the usage of each bus in runtime, the driver uses the PPMU (Platform Performance Monitoring Unit), which is able to measure the current load of sub-blocks. +The Exynos SoC includes the various sub-blocks which have the each AXI bus. +The each AXI bus has the owned source clock but, has not the only owned +power line. The power line might be shared among one more sub-blocks. +So, we can divide into two type of device as the role of each sub-block. +There are two type of bus devices as following: +- parent bus device +- passive bus device + +Basically, parent and passive bus device share the same power line. +The parent bus device can only change the voltage of shared power line +and the rest bus devices (passive bus device) depend on the decision of +the parent bus device. If there are three blocks which share the VDD_xxx +power line, Only one block should be parent device and then the rest blocks +should depend on the parent device as passive device. + + VDD_xxx |--- A block (parent) + |--- B block (passive) + |--- C block (passive) + There are a little different composition among Exynos SoC because each Exynos SoC has different sub-blocks. Therefore, shch difference should be specified in devicetree file instead of each device driver. In result, this driver is able to support the bus frequency for all Exynos SoCs. -Required properties for bus device: +Required properties for all bus devices: - compatible: Should be "samsung,exynos-bus". - clock-names : the name of clock used by the bus, "bus". - clocks : phandles for clock specified in "clock-names" property. - operating-points-v2: the OPP table including frequency/voltage information to support DVFS (Dynamic Voltage/Frequency Scaling) feature. + +Required properties only for parent bus device: - vdd-supply: the regulator to provide the buses with the voltage. - devfreq-events: the devfreq-event device to monitor the current utilization of buses. -Optional properties for bus device: +Required properties only for passive bus device: +- devfreq: the parent bus device. + +Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. - exynos,voltage-tolerance: the percentage value for bus voltage tolerance
@@ -34,7 +58,20 @@ Example1: power line (regulator). The MIF (Memory Interface) AXI bus is used to transfer data between DRAM and CPU and uses the VDD_MIF regualtor. - - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block + - MIF (Memory Interface) block + : VDD_MIF |--- DMC (Dynamic Memory Controller) + + - INT (Internal) block + : VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC + |--- G3D + |--- RIGHTBUS + |--- FSYS + |--- LCD0 + |--- PERIR + |--- ISP + |--- CAM - MIF bus's frequency/voltage table -----------------------
@@ -47,6 +84,24 @@ Example1: |L5| 400000 |875000 | ----------------------- + - INT bus's frequency/voltage table + ---------------------------------------------------------- + |Block|LEFTBUS|RIGHTBUS|MCUISP |ISP |PERIL ||VDD_INT | + | name| |LCD0 | | | || | + | | |FSYS | | | || | + | | |MFC | | | || | + ---------------------------------------------------------- + |Mode |*parent|passive |passive|passive|passive|| | + ---------------------------------------------------------- + |Lv |Frequency ||Voltage | + ---------------------------------------------------------- + |L1 |50000 |50000 |50000 |50000 |50000 ||900000 | + |L2 |80000 |80000 |80000 |80000 |80000 ||900000 | + |L3 |100000 |100000 |100000 |100000 |100000 ||1000000 | + |L4 |134000 |134000 |200000 |200000 | ||1000000 | + |L5 |200000 |200000 |400000 |300000 | ||1000000 | + ---------------------------------------------------------- + Example2 : The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi is listed below:
@@ -85,6 +140,154 @@ Example2 : }; }; + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_160>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mcuisp: bus_mcuisp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>; + clock-names = "bus"; + operating-points-v2 = <&bus_mcuisp_opp_table>; + status = "disabled"; + }; + + bus_isp: bus_isp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_266>; + clock-names = "bus"; + operating-points-v2 = <&bus_isp_opp_table>; + status = "disabled"; + }; + + bus_peril: bus_peril { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peril_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + opp-microvolt = <900000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + opp-microvolt = <900000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-microvolt = <1000000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + opp-microvolt = <1000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <1000000>; + }; + }; + + bus_mcuisp_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + }; + opp at 400000000 { + opp-hz = /bits/ 64 <400000000>; + }; + }; + + bus_isp_opp_table: opp_table3 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + }; + opp at 300000000 { + opp-hz = /bits/ 64 <300000000>; + }; + }; + + bus_peril_opp_table: opp_table4 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + }; + + Usage case to handle the frequency and voltage of bus on runtime in exynos3250-rinato.dts is listed below:
@@ -93,3 +296,44 @@ Example2 : vdd-supply = <&buck1_reg>; /* VDD_MIF */ status = "okay"; }; + + &bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; + }; + + &bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; + }; + + &bus_lcd0 { + devfreq = <&bus_leftbus>; + status = "okay"; + }; + + &bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; + }; + + &bus_mcuisp { + devfreq = <&bus_leftbus>; + status = "okay"; + }; + + &bus_isp { + devfreq = <&bus_leftbus>; + status = "okay"; + }; + + &bus_peril { + devfreq = <&bus_leftbus>; + status = "okay"; + }; + + &bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; + };
Signature · 1 line
1.9.1
Re: [PATCH v9 07/20] PM / devfreq: exynos: Update documentation for bus devices using passive governor
Quoted 28 lines · Chanwoo Choi
This patch updates the documentation for passive bus devices and adds the detailed example of Exynos3250.
Signed-off-by Chanwoo Choi <[email protected]>Acked-by MyungJoo Ham <[email protected]>--- .../devicetree/bindings/devfreq/exynos-bus.txt | 250 ++++++++++++++++++++- 1 file changed, 247 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/devfreq/exynos-bus.txt +11
-0@@ -8,22 +8,46 @@ of the bus in runtime. To monitor the usage of each bus in runtime, the driver uses the PPMU (Platform Performance Monitoring Unit), which is able to measure the current load of sub-blocks. +The Exynos SoC includes the various sub-blocks which have the each AXI bus. +The each AXI bus has the owned source clock but, has not the only owned +power line. The power line might be shared among one more sub-blocks. +So, we can divide into two type of device as the role of each sub-block. +There are two type of bus devices as following: +- parent bus device +- passive bus device + +Basically, parent and passive bus device share the same power line. +The parent bus device can only change the voltage of shared power line +and the rest bus devices (passive bus device) depend on the decision of
Documentation/devicetree/bindings/devfreq/exynos-bus.txt of the bus in runtime. To monitor the usage of each bus in runtime, · line 31
Quoted 10 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +8
-0+the parent bus device. If there are three blocks which share the VDD_xxx +power line, Only one block should be parent device and then the rest blocks +should depend on the parent device as passive device. + + VDD_xxx |--- A block (parent) + |--- B block (passive) + |--- C block (passive) + There are a little different composition among Exynos SoC because each Exynos SoC has different sub-blocks. Therefore, shch difference should be specified
s/shch/such/
Quoted 25 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +7
-2in devicetree file instead of each device driver. In result, this driver is able to support the bus frequency for all Exynos SoCs. -Required properties for bus device: +Required properties for all bus devices: - compatible: Should be "samsung,exynos-bus". - clock-names : the name of clock used by the bus, "bus". - clocks : phandles for clock specified in "clock-names" property. - operating-points-v2: the OPP table including frequency/voltage information to support DVFS (Dynamic Voltage/Frequency Scaling) feature. + +Required properties only for parent bus device: - vdd-supply: the regulator to provide the buses with the voltage. - devfreq-events: the devfreq-event device to monitor the current utilization of buses. -Optional properties for bus device: +Required properties only for passive bus device: +- devfreq: the parent bus device. + +Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. - exynos,voltage-tolerance: the percentage value for bus voltage tolerance
Documentation/devicetree/bindings/devfreq/exynos-bus.txt Example1: · line 59
Quoted 2 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +0
-0@@ -34,7 +58,20 @@ Example1: power line (regulator). The MIF (Memory Interface) AXI bus is used to transfer data between DRAM and CPU and uses the VDD_MIF regualtor.
s/regualtor/regulator/
Best regards,
Krzysztof
Chanwoo Choi
maintainerRe: [PATCH v9 07/20] PM / devfreq: exynos: Update documentation for bus devices using passive governor
Quoted 33 lines · Krzysztof Kozlowski
Quoted 32 lines · Chanwoo Choi
This patch updates the documentation for passive bus devices and adds the detailed example of Exynos3250.
Signed-off-by Chanwoo Choi <[email protected]>Acked-by MyungJoo Ham <[email protected]>--- .../devicetree/bindings/devfreq/exynos-bus.txt | 250 ++++++++++++++++++++- 1 file changed, 247 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/devfreq/exynos-bus.txt +15
-0@@ -8,22 +8,46 @@ of the bus in runtime. To monitor the usage of each bus in runtime, the driver uses the PPMU (Platform Performance Monitoring Unit), which is able to measure the current load of sub-blocks. +The Exynos SoC includes the various sub-blocks which have the each AXI bus. +The each AXI bus has the owned source clock but, has not the only owned +power line. The power line might be shared among one more sub-blocks. +So, we can divide into two type of device as the role of each sub-block. +There are two type of bus devices as following: +- parent bus device +- passive bus device + +Basically, parent and passive bus device share the same power line. +The parent bus device can only change the voltage of shared power line +and the rest bus devices (passive bus device) depend on the decision of +the parent bus device. If there are three blocks which share the VDD_xxx +power line, Only one block should be parent device and then the rest blocks +should depend on the parent device as passive device. +
Quoted 8 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt of the bus in runtime. To monitor the usage of each bus in runtime, · line 31
Quoted 6 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +4
-0+ VDD_xxx |--- A block (parent) + |--- B block (passive) + |--- C block (passive) + There are a little different composition among Exynos SoC because each Exynos SoC has different sub-blocks. Therefore, shch difference should be specifieds/shch/such/
I'll fix it on patch2 because this typo happen on patch2.
Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +3
-1in devicetree file instead of each device driver. In result, this driver is able to support the bus frequency for all Exynos SoCs. -Required properties for bus device: +Required properties for all bus devices: - compatible: Should be "samsung,exynos-bus". - clock-names : the name of clock used by the bus, "bus". - clocks : phandles for clock specified in "clock-names" property. - operating-points-v2: the OPP table including frequency/voltage information to support DVFS (Dynamic Voltage/Frequency Scaling) feature. + +Required properties only for parent bus device: - vdd-supply: the regulator to provide the buses with the voltage. - devfreq-events: the devfreq-event device to monitor the current utilization of buses.
Quoted 13 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt Example1: · line 59
Quoted 11 lines
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +4
-1-Optional properties for bus device: +Required properties only for passive bus device: +- devfreq: the parent bus device. + +Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. - exynos,voltage-tolerance: the percentage value for bus voltage tolerance@@ -34,7 +58,20 @@ Example1: power line (regulator). The MIF (Memory Interface) AXI bus is used to transfer data between DRAM and CPU and uses the VDD_MIF regualtor.s/regualtor/regulator/
ditto.
Quoted 3 lines
Thanks for your review.
Best Regards,
Chanwoo Choi
Chanwoo Choi
maintainerPATCH v9 8/20 PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line
In reply to Chanwoo ChoiThis patch adds the detailed corrleation between sub-blocks and power line for Exynos3250, Exynos4210 and Exynos4x12.
--- .../devicetree/bindings/devfreq/exynos-bus.txt | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+)
Documentation/devicetree/bindings/devfreq/exynos-bus.txt +51 -0
@@ -53,6 +53,57 @@ Optional properties only for parent bus device: - exynos,voltage-tolerance: the percentage value for bus voltage tolerance which is used to calculate the max voltage. +Detailed correlation between sub-blocks and power line according to Exynos SoC: +- In case of Exynos3250, there are two power line as following: + VDD_MIF |--- DMC + + VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC + |--- G3D + |--- RIGHTBUS + |--- PERIR + |--- FSYS + |--- LCD0 + |--- PERIR + |--- ISP + |--- CAM + +- In case of Exynos4210, there is one power line as following: + VDD_INT |--- DMC (parent device) + |--- LEFTBUS + |--- PERIL + |--- MFC(L) + |--- G3D + |--- TV + |--- LCD0 + |--- RIGHTBUS + |--- PERIR + |--- MFC(R) + |--- CAM + |--- FSYS + |--- GPS + |--- LCD0 + |--- LCD1 + +- In case of Exynos4x12, there are two power line as following: + VDD_MIF |--- DMC + + VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC(L) + |--- G3D + |--- TV + |--- IMAGE + |--- RIGHTBUS + |--- PERIR + |--- MFC(R) + |--- CAM + |--- FSYS + |--- GPS + |--- LCD0 + |--- ISP + Example1: Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to power line (regulator). The MIF (Memory Interface) AXI bus is used to
Signature · 1 line
1.9.1
Re: [PATCH v9 08/20] PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line
Quoted 1 line · Chanwoo Choi
This patch adds the detailed corrleation between sub-blocks and power line
s/corrleation/correlation/
Quoted 7 lines
for Exynos3250, Exynos4210 and Exynos4x12.
Signed-off-by Chanwoo Choi <[email protected]>Acked-by MyungJoo Ham <[email protected]>--- .../devicetree/bindings/devfreq/exynos-bus.txt | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+)
Best regards,
Krzysztof
Chanwoo Choi
maintainerRe: [PATCH v9 08/20] PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line
Quoted 4 lines · Krzysztof Kozlowski
Quoted 1 line · Chanwoo Choi
This patch adds the detailed corrleation between sub-blocks and power line
s/corrleation/correlation/
OK. I'll fix it.
Quoted 4 lines
Quoted 4 lines
for Exynos3250, Exynos4210 and Exynos4x12.
Quoted 9 lines
Quoted 5 lines
Signed-off-by Chanwoo Choi <[email protected]>Acked-by MyungJoo Ham <[email protected]>--- .../devicetree/bindings/devfreq/exynos-bus.txt | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+)
Best Regards,
Chanwoo Choi
Chanwoo Choi
maintainerPATCH v9 9/20 PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
In reply to Chanwoo ChoiThis patch removes the unused exynos4/5 busfreq driver. Instead, generic exynos-bus frequency driver support the all Exynos SoCs.
--- drivers/devfreq/Kconfig | 22 - drivers/devfreq/Makefile | 2 - drivers/devfreq/exynos/Makefile | 3 - drivers/devfreq/exynos/exynos4_bus.c | 1055 ---------------------------------- drivers/devfreq/exynos/exynos4_bus.h | 110 ---- drivers/devfreq/exynos/exynos5_bus.c | 431 -------------- drivers/devfreq/exynos/exynos_ppmu.c | 119 ---- drivers/devfreq/exynos/exynos_ppmu.h | 86 --- 8 files changed, 1828 deletions(-) delete mode 100644 drivers/devfreq/exynos/Makefile delete mode 100644 drivers/devfreq/exynos/exynos4_bus.c delete mode 100644 drivers/devfreq/exynos/exynos4_bus.h delete mode 100644 drivers/devfreq/exynos/exynos5_bus.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.h
drivers/devfreq/Kconfig +0 -22
@@ -90,28 +90,6 @@ config ARM_EXYNOS_BUS_DEVFREQ and adjusts the operating frequencies and voltages with OPP support. This does not yet operate with optimal voltages. -config ARM_EXYNOS4_BUS_DEVFREQ - bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" - depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos4210 memory bus (vdd_int) - and Exynos4212/4412 memory interface and bus (vdd_mif + vdd_int). - It reads PPMU counters of memory controllers and adjusts - the operating frequencies and voltages with OPP support. - This does not yet operate with optimal voltages. - -config ARM_EXYNOS5_BUS_DEVFREQ - tristate "ARM Exynos5250 Bus DEVFREQ Driver" - depends on SOC_EXYNOS5250 - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos5250 bus interface (vdd_int). - It reads PPMU counters of memory controllers and adjusts the - operating frequencies and voltages with OPP support. - config ARM_TEGRA_DEVFREQ tristate "Tegra DEVFREQ Driver" depends on ARCH_TEGRA_124_SOC
drivers/devfreq/Makefile +0 -2
@@ -8,8 +8,6 @@ obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o # DEVFREQ Drivers obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o -obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos/ -obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos/ obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra-devfreq.o # DEVFREQ Event Drivers
drivers/devfreq/exynos/Makefile deleted +0 -3
@@ -1,3 +0,0 @@ -# Exynos DEVFREQ Drivers -obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos_ppmu.o exynos4_bus.o -obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos_ppmu.o exynos5_bus.o
drivers/devfreq/exynos/exynos4_bus.c deleted +0 -1055
1,055 lines not on this page · raw message
drivers/devfreq/exynos/exynos4_bus.h deleted +0 -110
110 lines not on this page · raw message
drivers/devfreq/exynos/exynos5_bus.c deleted +0 -431
431 lines not on this page · raw message
drivers/devfreq/exynos/exynos_ppmu.c deleted +0 -119
119 lines not on this page · raw message
drivers/devfreq/exynos/exynos_ppmu.h deleted +0 -86
86 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v9 9/20 PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
Quoted 5 lines · Chanwoo Choi
This patch removes the unused exynos4/5 busfreq driver. Instead, generic exynos-bus frequency driver support the all Exynos SoCs.
Signed-off-by Chanwoo Choi <[email protected]>Signed-off-by MyungJoo Ham <[email protected]>
Quoted 16 lines
--- drivers/devfreq/Kconfig | 22 - drivers/devfreq/Makefile | 2 - drivers/devfreq/exynos/Makefile | 3 - drivers/devfreq/exynos/exynos4_bus.c | 1055 ---------------------------------- drivers/devfreq/exynos/exynos4_bus.h | 110 ---- drivers/devfreq/exynos/exynos5_bus.c | 431 -------------- drivers/devfreq/exynos/exynos_ppmu.c | 119 ---- drivers/devfreq/exynos/exynos_ppmu.h | 86 --- 8 files changed, 1828 deletions(-) delete mode 100644 drivers/devfreq/exynos/Makefile delete mode 100644 drivers/devfreq/exynos/exynos4_bus.c delete mode 100644 drivers/devfreq/exynos/exynos4_bus.h delete mode 100644 drivers/devfreq/exynos/exynos5_bus.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.h
Best regards,
Krzysztof
Chanwoo Choi
maintainerPATCH v9 10/20 MAINTAINERS: Add samsung bus frequency driver entry
In reply to Chanwoo ChoiThis patch adds the 'BUS FREQUENCY DRIVER FOR SAMSUNG EXYNOS' entry to review the patches as maintainer. I can access the all datasheet of Exynos SoC and test it on some Exynos-based board. Patches will be picked up by DEVFREQ maintainer on devfreq git repository.
--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
@@ -3539,6 +3539,15 @@ F: drivers/devfreq/devfreq-event.c F: include/linux/devfreq-event.h F: Documentation/devicetree/bindings/devfreq/event/ +BUS FREQUENCY DRIVER FOR SAMSUNG EXYNOS +M: Chanwoo Choi <[email protected]> +L: linux-pm at vger.kernel.org +L: linux-samsung-soc at vger.kernel.org +T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git +S: Maintained +F: drivers/devfreq/exynos-bus.c +F: Documentation/devicetree/bindings/devfreq/exynos-bus.txt + DEVICE NUMBER REGISTRY M: Torben Mathiasen <[email protected]> W: http://lanana.org/docs/device-list/index.html
Signature · 1 line
1.9.1
Re: [PATCH v9 10/20] MAINTAINERS: Add samsung bus frequency driver entry
Quoted 9 lines · Chanwoo Choi
This patch adds the 'BUS FREQUENCY DRIVER FOR SAMSUNG EXYNOS' entry to review the patches as maintainer. I can access the all datasheet of Exynos SoC and test it on some Exynos-based board. Patches will be picked up by DEVFREQ maintainer on devfreq git repository.
Signed-off-by Chanwoo Choi <[email protected]>--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
Best regards,
Krzysztof
Chanwoo Choi
maintainerRe: [PATCH v9 10/20] MAINTAINERS: Add samsung bus frequency driver entry
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Chanwoo Choi
This patch adds the 'BUS FREQUENCY DRIVER FOR SAMSUNG EXYNOS' entry to review the patches as maintainer. I can access the all datasheet of Exynos SoC and test it on some Exynos-based board. Patches will be picked up by DEVFREQ maintainer on devfreq git repository.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Chanwoo Choi <[email protected]>--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
Thanks for your review.
Best Regards,
Chanwoo Choi
Chanwoo Choi
maintainerPATCH v9 11/20 ARM: dts: Add DMC bus node for Exynos3250
In reply to Chanwoo ChoiThis patch adds the DMC (Dynamic Memory Controller) bus node for Exynos3250 SoC. The DMC is an AMBA AXI-compliant slave to interface external JEDEC standard SDRAM devices. The bus includes the OPP tables and the source clock for DMC block.
Following list specifies the detailed relation between the clock and DMC block:
- The source clock of DMC block : div_dmc
--- arch/arm/boot/dts/exynos3250.dtsi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
arch/arm/boot/dts/exynos3250.dtsi +34 -0
@@ -688,6 +688,40 @@ clock-names = "ppmu"; status = "disabled"; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu_dmc CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + opp-microvolt = <800000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-microvolt = <800000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + opp-microvolt = <800000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <825000>; + }; + opp at 400000000 { + opp-hz = /bits/ 64 <400000000>; + opp-microvolt = <875000>; + }; + }; }; };
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 12/20 ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk
In reply to Chanwoo ChoiThis patch adds the DMC (Dynamic Memory Controller) bus frequency node which includes the devfreq-events and regulator properties. The bus frequency support the DVFS (Dynamic Voltage Frequency Scaling) feature with ondemand governor.
The devfreq-events (ppmu_dmc0*) can monitor the utilization of DMC bus on runtime and the buck1_reg (VDD_MIF power line) supplies the power to the DMC block.
--- arch/arm/boot/dts/exynos3250-monk.dts | 6 ++++++ arch/arm/boot/dts/exynos3250-rinato.dts | 6 ++++++ 2 files changed, 12 insertions(+)
arch/arm/boot/dts/exynos3250-monk.dts +6 -0
@@ -156,6 +156,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; };
arch/arm/boot/dts/exynos3250-rinato.dts +6 -0
@@ -147,6 +147,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; };
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 13/20 ARM: dts: Add bus nodes using VDD_INT for Exynos3250
In reply to Chanwoo ChoiThis patch adds the bus nodes using VDD_INT for Exynos3250 SoC. Exynos3250 has following AXI buses to translate data between DRAM and sub-blocks.
Following list specifies the detailed relation between DRAM and sub-blocks:
- ACLK400 clock for MCUISP
- ACLK266 clock for ISP
- ACLK200 clock for FSYS
- ACLK160 clock for LCD0
- ACLK100 clock for PERIL
- GDL clock for LEFTBUS
- GDR clock for RIGHTBUS
- SCLK_MFC clock for MFC
--- arch/arm/boot/dts/exynos3250.dtsi | 147 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+)
arch/arm/boot/dts/exynos3250.dtsi +147 -0
@@ -722,6 +722,153 @@ opp-microvolt = <875000>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_160>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mcuisp: bus_mcuisp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>; + clock-names = "bus"; + operating-points-v2 = <&bus_mcuisp_opp_table>; + status = "disabled"; + }; + + bus_isp: bus_isp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_266>; + clock-names = "bus"; + operating-points-v2 = <&bus_isp_opp_table>; + status = "disabled"; + }; + + bus_peril: bus_peril { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peril_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + opp-microvolt = <900000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + opp-microvolt = <900000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-microvolt = <1000000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + opp-microvolt = <1000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <1000000>; + }; + }; + + bus_mcuisp_opp_table: opp_table3 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + }; + opp at 400000000 { + opp-hz = /bits/ 64 <400000000>; + }; + }; + + bus_isp_opp_table: opp_table4 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + }; + opp at 300000000 { + opp-hz = /bits/ 64 <300000000>; + }; + }; + + bus_peril_opp_table: opp_table5 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + }; + opp at 80000000 { + opp-hz = /bits/ 64 <80000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + }; }; };
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 14/20 ARM: dts: Add bus nodes using VDD_MIF for Exynos4x12
In reply to Chanwoo ChoiThis patch adds the bus nodes using VDD_MIF for Exynos4x12 SoC. Exynos4x12 has the following AXI buses to translate data between DRAM and DMC/ACP/C2C.
--- arch/arm/boot/dts/exynos4x12.dtsi | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+)
arch/arm/boot/dts/exynos4x12.dtsi +68 -0
@@ -281,6 +281,74 @@ clocks = <&clock CLK_SMMU_LITE1>, <&clock CLK_FIMC_LITE1>; #iommu-cells = <0>; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_acp: bus_acp { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_ACP>; + clock-names = "bus"; + operating-points-v2 = <&bus_acp_opp_table>; + status = "disabled"; + }; + + bus_c2c: bus_c2c { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_C2C>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-microvolt = <900000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + opp-microvolt = <900000>; + }; + opp at 160000000 { + opp-hz = /bits/ 64 <160000000>; + opp-microvolt = <900000>; + }; + opp at 267000000 { + opp-hz = /bits/ 64 <267000000>; + opp-microvolt = <950000>; + }; + opp at 400000000 { + opp-hz = /bits/ 64 <400000000>; + opp-microvolt = <1050000>; + }; + }; + + bus_acp_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + }; + opp at 160000000 { + opp-hz = /bits/ 64 <160000000>; + }; + opp at 267000000 { + opp-hz = /bits/ 64 <267000000>; + }; + }; }; &combiner {
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 15/20 ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
In reply to Chanwoo ChoiThis patch adds the bus nodes using VDD_INT for Exynos4x12 SoC. Exynos4x12 has the following AXI buses to translate data between DRAM and sub-blocks.
Following list specifies the detailed relation between DRAM and sub-blocks:
- ACLK100 clock for PERIL/PERIR/MFC(PCLK)
- ACLK160 clock for CAM/TV/LCD
: The minimum clock of ACLK160 should be over 160MHz.
When drop the clock under 160MHz, show the broken image.
- ACLK133 clock for FSYS
- GDL clock for LEFTBUS
- GDR clock for RIGHTBUS
- SCLK_MFC clock for MFC
--- arch/arm/boot/dts/exynos4x12.dtsi | 106 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+)
arch/arm/boot/dts/exynos4x12.dtsi +106 -0
@@ -349,6 +349,112 @@ opp-hz = /bits/ 64 <267000000>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK133>; + clock-names = "bus"; + operating-points-v2 = <&bus_fsys_opp_table>; + status = "disabled"; + }; + + bus_peri: bus_peri { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peri_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table3 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-microvolt = <900000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + opp-microvolt = <925000>; + }; + opp at 160000000 { + opp-hz = /bits/ 64 <160000000>; + opp-microvolt = <950000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <1000000>; + }; + }; + + bus_display_opp_table: opp_table4 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 160000000 { + opp-hz = /bits/ 64 <160000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + }; + }; + + bus_fsys_opp_table: opp_table5 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + }; + }; + + bus_peri_opp_table: opp_table6 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 50000000 { + opp-hz = /bits/ 64 <50000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + }; }; &combiner {
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 16/20 ARM: dts: Add bus nodes using VDD_MIF for Exynos4210
In reply to Chanwoo ChoiThis patch adds the bus nodes for Exynos4210 SoC. Exynos4210 SoC has one power line for all buses to translate data between DRAM and sub-blocks.
Following list specifies the detailed relation between DRAM and sub-blocks:
- DMC/ACP clock for DMC (Dynamic Memory Controller)
- ACLK200 clock for LCD0
- ACLK100 clock for PERIL/PERIR/MFC(PCLK)
- ACLK160 clock for CAM/TV/LCD0/LCD1
- ACLK133 clock for FSYS/GPS
- GDL/GDR clock for LEFTBUS/RIGHTBUS
- SCLK_MFC clock for MFC
--- arch/arm/boot/dts/exynos4210.dtsi | 159 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+)
arch/arm/boot/dts/exynos4210.dtsi +159 -0
@@ -257,6 +257,165 @@ power-domains = <&pd_lcd1>; #iommu-cells = <0>; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_acp: bus_acp { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_ACP>; + clock-names = "bus"; + operating-points-v2 = <&bus_acp_opp_table>; + status = "disabled"; + }; + + bus_peri: bus_peri { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peri_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK133>; + clock-names = "bus"; + operating-points-v2 = <&bus_fsys_opp_table>; + status = "disabled"; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + opp-microvolt = <1025000>; + }; + opp at 267000000 { + opp-hz = /bits/ 64 <267000000>; + opp-microvolt = <1050000>; + }; + opp at 400000000 { + opp-hz = /bits/ 64 <400000000>; + opp-microvolt = <1150000>; + }; + }; + + bus_acp_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + }; + opp at 160000000 { + opp-hz = /bits/ 64 <160000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + }; + }; + + bus_peri_opp_table: opp_table3 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 5000000 { + opp-hz = /bits/ 64 <5000000>; + }; + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + }; + + bus_fsys_opp_table: opp_table4 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 10000000 { + opp-hz = /bits/ 64 <10000000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + }; + }; + + bus_display_opp_table: opp_table5 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 134000000 { + opp-hz = /bits/ 64 <134000000>; + }; + opp at 160000000 { + opp-hz = /bits/ 64 <160000000>; + }; + }; + + bus_leftbus_opp_table: opp_table6 { + compatible = "operating-points-v2"; + opp-shared; + + opp at 100000000 { + opp-hz = /bits/ 64 <100000000>; + }; + opp at 160000000 { + opp-hz = /bits/ 64 <160000000>; + }; + opp at 200000000 { + opp-hz = /bits/ 64 <200000000>; + }; + }; }; &gic {
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 17/20 ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU nodes
In reply to Chanwoo ChoiThis patch adds the exynos4412-ppmu-common.dtsi to remove duplicate PPMU nodes because exynos3250-rinato/monk, exynos4412-trats2/odroidu3 has the same PPMU device tree node.
--- arch/arm/boot/dts/exynos3250-monk.dts | 41 +------------------- arch/arm/boot/dts/exynos3250-rinato.dts | 41 +------------------- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + arch/arm/boot/dts/exynos4412-ppmu-common.dtsi | 50 +++++++++++++++++++++++++ arch/arm/boot/dts/exynos4412-trats2.dts | 41 +------------------- 5 files changed, 54 insertions(+), 120 deletions(-) create mode 100644 arch/arm/boot/dts/exynos4412-ppmu-common.dtsi
arch/arm/boot/dts/exynos3250-monk.dts +1 -40
@@ -14,6 +14,7 @@ /dts-v1/; #include "exynos3250.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include <dt-bindings/input/input.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/clock/samsung,s2mps11.h>
@@ -464,46 +465,6 @@ status = "okay"; }; -&ppmu_dmc0 { - status = "okay"; - - events { - ppmu_dmc0_3: ppmu-event3-dmc0 { - event-name = "ppmu-event3-dmc0"; - }; - }; -}; - -&ppmu_dmc1 { - status = "okay"; - - events { - ppmu_dmc1_3: ppmu-event3-dmc1 { - event-name = "ppmu-event3-dmc1"; - }; - }; -}; - -&ppmu_leftbus { - status = "okay"; - - events { - ppmu_leftbus_3: ppmu-event3-leftbus { - event-name = "ppmu-event3-leftbus"; - }; - }; -}; - -&ppmu_rightbus { - status = "okay"; - - events { - ppmu_rightbus_3: ppmu-event3-rightbus { - event-name = "ppmu-event3-rightbus"; - }; - }; -}; - &xusbxti { clock-frequency = <24000000>; };
arch/arm/boot/dts/exynos3250-rinato.dts +1 -40
53 lines not on this page · raw message
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +1 -0
@@ -11,6 +11,7 @@ #include <dt-bindings/input/input.h> #include <dt-bindings/clock/maxim,max77686.h> #include "exynos4412.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include <dt-bindings/gpio/gpio.h> / {
arch/arm/boot/dts/exynos4412-ppmu-common.dtsi new file +50 -0
50 lines not on this page · raw message
arch/arm/boot/dts/exynos4412-trats2.dts +1 -40
53 lines not on this page · raw message
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 18/20 ARM: dts: Add support of bus frequency using VDD_INT for exynos3250-rinato
In reply to Chanwoo ChoiThis patch adds the bus device-tree nodes of INT (internal) block to enable the bus frequency scaling. The following sub-blocks share the VDD_INT power source:
- LEFTBUS (parent device)
- RIGHTBUS
- PERIL
- LCD0
- FSYS
- MCUISP / ISP
- MFC
The LEFTBUS is parent device with devfreq ondemand governor and the rest of devices depend on the LEFTBUS device.
--- arch/arm/boot/dts/exynos3250-rinato.dts | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
arch/arm/boot/dts/exynos3250-rinato.dts +41 -0
@@ -154,6 +154,47 @@ status = "okay"; }; +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_lcd0 { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mcuisp { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_isp { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peril { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; };
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 19/20 ARM: dts: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3
In reply to Chanwoo ChoiThis patch expands the voltage range of buck1/3 regulator due to as following:
- MIF (Memory Interface) bus frequency needs the range of '900 - 1100 mV'.
- INT (Internal) bus frequency needs the range of '900 - 1050 mV'.
--- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +4 -4
@@ -356,8 +356,8 @@ buck1_reg: BUCK1 { regulator-name = "vdd_mif"; - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <1000000>; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1100000>; regulator-always-on; regulator-boot-on; };
@@ -372,8 +372,8 @@ buck3_reg: BUCK3 { regulator-name = "vdd_int"; - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <1000000>; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1050000>; regulator-always-on; regulator-boot-on; };
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerPATCH v9 20/20 ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3
In reply to Chanwoo ChoiTHis patch adds the bus device tree nodes for both MIF (Memory) and INT (Internal) block to enable the bus frequency.
The DMC bus is parent device in MIF block using VDD_MIF and the LEFTBUS bus is parent device in INT block using VDD_INT.
--- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 47 +++++++++++++++++++++++++ arch/arm/boot/dts/exynos4412-trats2.dts | 47 +++++++++++++++++++++++++ 2 files changed, 94 insertions(+)
arch/arm/boot/dts/exynos4412-odroid-common.dtsi +47 -0
@@ -109,6 +109,53 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + +&bus_acp { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_c2c { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_display { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peri { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; };
arch/arm/boot/dts/exynos4412-trats2.dts +47 -0
53 lines not on this page · raw message
Signature · 1 line
1.9.1
Chanwoo Choi
maintainerDear Myungjoo and Krzysztof,
This patch-set already get the acked-by or signed-off-by tag from Exynos SoC and DEVFREQ maintainer except for patch10.
If there is no comment, could you pick this patch-set?
Best Regards,
Chanwoo Choi
Quoted 289 lines · Chanwoo Choi
This patch-set includes the two features as following. The generic exynos bus frequency driver is able to support almost Exynos SoCs for bus frequency scaling. And the new passive governor is able to make the dependency on between devices for frequency/voltage scaling. I had posted the patch-set[1] with the similiar concept. This is is revised version for exynos bus frequency.
- Generic exynos bus frequency driver
- New passive governor of DEVFREQ framework
[1] https://lkml.org/lkml/2015/1/7/872
: [PATCHv3 0/8] devfreq: Add generic exynos memory-bus frequency driverChanges from v8:
(https://lkml.org/lkml/2016/4/8/14)
- Fix possible recursive locking issue by usingmutex_lock_nested()Changes from v7:
(https://lkml.org/lkml/2016/3/31/308)
- UseIS_ERR()instead ofIS_ERR_OR_NULL()macro
- Add signed-off-by/acked-by tag of DEVFREQ maintainer
- Fix the comment ingovernor_passive.cChanges from v6:
(https://lkml.org/lkml/2016/3/27/187)
- Patch1/2 add signed-off-by tag from DEVFREQ Maintainer (Myungjoo Ham)
- Drop patch5 (PM / devfreq: Add governer type with unique number)
- Add missing description about thetransition_notifier_listin struct devfreq
- Remove the passive governor code fromdevfreq.ccore driver. Instead, passive governor uses the DEVFREQ_GOV_START/STOP signal to register/unregister theDEVFREQ_TRANSITION_NOTIFIERbetween the parent devfreq device and passive devfreq device.
- Add the author (myungjoo.ham at samsung.com) of passive governor
- Add 'structdevfreq_passive_data' to pass the devfreq instance of parent.Changes from v5:
(https://lkml.org/lkml/2016/3/24/5)
- Rebase the patch-set on Linux v4.6-rc1
- Add Tested-by tag from Markus Reichl <[email protected]>
- Add Tested-by tag from Anand Moon <[email protected]>Changes from v4:
(https://lkml.org/lkml/2015/12/14/43)
- Add newDEVFREQ_TRANSITION_NOTIFIERnotifier. The passive devfreq device recevie the changed frequency of parent
devfreq device throughDEVFREQ_TRANSITION_NOTIFIER.
- Add governor type to identify thme using the defined constant
- Modify the passive governor using theDEVFREQ_TRANSITION_NOTIFIERnotifier.
- Fix the RCU locking probrlm (Reported-by: Tobias Jakobi)
- Fix the debugfs error during the kernel booting (Reported-by: Tobias Jakobi)
- The Device Tree patches have got Reviewed-by tag from Exynos SoC Maintainer (Krzysztof Kozlowski <[email protected]>)Changes from v3:
(https://lkml.org/lkml/2015/12/11/75)
- Add the reviewed-by tag from Krzysztof Kozlowski (patch2/3/13/14/15/16/17)
- Fix typo of the description on patch14
- Modify the subject and description of patch17
- Reorder the 'bus_xxx' device tree node alphabetically in
bothexynos3250-rinato/monk.dtsand exynos4412-trats/odroidu3Changes from v2:
(https://lkml.org/lkml/2015/12/8/869)
- Fix typo on documentation
- Modify the more appropriate sentence on patch description
- Add the detailed description about both parent and passive bus device
- Modify the DMC frequency for Exynos4x12 DMC bus (200MHz -> 267MHz)
- Modify the voltage of 200MHz was included in Exynos3250 DMC bus (800mV -> 825mV)
- Rename OPP nodes as 'opp@<opp-hz>'
- Delete the duplicate 'opp-microvolt' property of passive devfreq device
- Reorder the 'bus_xxx' device tree node alphabetically inexynos3250-rinato/monk.dts
- Reorder the 'bus_xxx' device tree node alphabetically in exynos4412-trats/odroidu3
- Add newexynos4412-ppmu-common.dtsito remove the duplicate PPMU dt node on rinato/monk/trats2/odroid-u3 board
- Add the log message if bus device is registered to devfreq framework successfully
- Add the reviewed-by tag from Krzysztof Kozlowski
- Add the tested-by tag from Anand Moon on Odroid U3
- Add 'SAMSUNG BUS FREQUENCY DRIVER' entry toMAINTAINERSChanges from v1:
(https://lkml.org/lkml/2015/11/26/260)
- Check whether the instance of regulator is NULL or not when executingregulator_disable()because of only parent devfreq device has the regulator instance. After fixing it, the wake-up from suspend state is well working. (patch1)
- Fix bug which checks 'bus-clk' instead of 'bus->regulator' after callingdevm_clk_get()(on patch1)
- Update the documentation to remove the description about DEVFREQ-EVENT subsystem (on patch2)
- Add the full name of DMC (Dynamic Memory Controller) (on patch2)
- Modify the detailed correlation of buses for Exynos3250 on documentation (patch2)
- Add the MFC bus node for Exynos3250 (on patch11, patch12)
- Fix the duplicate frequency ofbus_displayonExynos4x12.dtsi
- Add the PPMU node for exynos4412-odroidu3
- Add the support of bus frequency for exynos4412-odroidu3[Description]
Detailed descirption for patch-set:
1. Add generic exynos bus frequency driver
: This patch-set adds the generic exynos bus frequency driver for AXI bus of sub-blocks in exynos SoC. The Samsung Exynos SoC have the common architecture for bus between DRAM and sub-blocks in SoC.There are the different buses according to Exynos SoC because Exynos SoC
has the differnt sub-blocks and bus speed. In spite of this difference among Exynos SoCs, this driver is able to support almost Exynos SoC by adding unique data of each bus in the devicetree file.In devicetree, each bus node has a bus clock, regulator, operation-point
and devfreq-event devices which measure the utilization of each bus block.For example,
- The bus of DMC block inexynos3250.dtsiare listed below:bus_dmc: bus_dmc { compatible = "samsung,exynos-bus"; clocks = <&cmu_dmc CLK_DIV_DMC>; clock-names = "bus"; operating-points-v2 = <&bus_dmc_opp_table>; status = "disabled"; }; bus_dmc_opp_table: opp_table1 { compatible = "operating-points-v2"; opp-shared; opp at 50000000 { opp-hz = /bits/ 64 <50000000>; opp-microvolt = <800000>; }; opp at 100000000 { opp-hz = /bits/ 64 <100000000>; opp-microvolt = <800000>; }; opp at 134000000 { opp-hz = /bits/ 64 <134000000>; opp-microvolt = <800000>; }; opp at 200000000 { opp-hz = /bits/ 64 <200000000>; opp-microvolt = <825000>; }; opp at 400000000 { opp-hz = /bits/ 64 <400000000>; opp-microvolt = <875000>; }; };- Usage case to handle the frequency and voltage of bus on runtime in
exynos3250-rinato.dtsare listed below:&bus_dmc { devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; vdd-supply = <&buck1_reg>; /* VDD_MIF */ status = "okay"; };2. Add new passive governor of DEVFREQ framework
: This patch-set add the new passive governor for DEVFREQ framework. The existing governors (ondemand, performance and so on) are used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The existing governors are independently used for specific device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers.The passive governor depends on operation of parent driver with existing
governors(ondemand, performance and so on)extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree:For exameple,
There are one more bus device drivers in Exynos3250 which need to
change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, LEFTBUS bus driver is operated as parent with ondemand governor and then the rest device driver with passive governor.The buses of Internal block in
exynos3250.dtsiare listed below:
When LEFTBUS bus driver (parent) changes the bus frequency with ondemand governor on runtime, the rest bus devices which sharing the same power line (VDD_INT) will change the each bus frequency according to the decision of LEFTBUS bus driver (parent).- INT (Internal) block
: VDD_INT |--- LEFTBUS |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM- The buss of INT block in
exynos3250.dtsiare listed below:bus_leftbus: bus_leftbus { compatible = "samsung,exynos-bus"; clocks = <&cmu CLK_DIV_GDL>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; status = "disabled"; }; bus_rightbus: bus_rightbus { compatible = "samsung,exynos-bus"; clocks = <&cmu CLK_DIV_GDR>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; status = "disabled"; }; (Omit the rest bus dt node)- Usage case to handle the frequency and voltage of bus on runtime in
exynos3250-rinato.dtsare listed below:/* Parent bus device of VDD_INT */ &bus_leftbus { devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; vdd-supply = <&buck3_reg>; status = "okay"; }; /* Passive bus device depend on LEFTBUS bus. */ &bus_rightbus { devfreq = <&bus_leftbus>; /* 'devfreq' property indicates the phandle of parent device. */ status = "okay"; }; (Omit the rest bus dt node)Chanwoo Choi (20):
PM / devfreq: exynos: Add generic exynos bus frequency driver
PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver PM / devfreq: Adddevfreq_get_devfreq_by_phandle()
PM / devfreq: Add newDEVFREQ_TRANSITION_NOTIFIERnotifier
PM / devfreq: Add new passive governor
PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor PM / devfreq: exynos: Update documentation for bus devices using passive governor PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
MAINTAINERS: Add samsung bus frequency driver entry
ARM: dts: Add DMC bus node for Exynos3250
ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk
ARM: dts: Add bus nodes usingVDD_INTfor Exynos3250
ARM: dts: Add bus nodes usingVDD_MIFfor Exynos4x12
ARM: dts: Add bus nodes usingVDD_INTfor Exynos4x12
ARM: dts: Add bus nodes usingVDD_MIFfor Exynos4210
ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU nodes
ARM: dts: Add support of bus frequency usingVDD_INTfor exynos3250-rinato
ARM: dts: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3
ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3.../devicetree/bindings/devfreq/exynos-bus.txt | 390 ++++++++ MAINTAINERS | 9 + arch/arm/boot/dts/exynos3250-monk.dts | 47 +- arch/arm/boot/dts/exynos3250-rinato.dts | 88 +- arch/arm/boot/dts/exynos3250.dtsi | 181 ++++ arch/arm/boot/dts/exynos4210.dtsi | 159 +++ arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 56 +- arch/arm/boot/dts/exynos4412-ppmu-common.dtsi | 50 + arch/arm/boot/dts/exynos4412-trats2.dts | 88 +- arch/arm/boot/dts/exynos4x12.dtsi | 174 ++++ drivers/devfreq/Kconfig | 36 +- drivers/devfreq/Makefile | 4 +- drivers/devfreq/devfreq.c | 207 +++- drivers/devfreq/exynos-bus.c | 570 +++++++++++ drivers/devfreq/exynos/Makefile | 3 - drivers/devfreq/exynos/exynos4_bus.c | 1055 -------------------- drivers/devfreq/exynos/exynos4_bus.h | 110 -- drivers/devfreq/exynos/exynos5_bus.c | 431 -------- drivers/devfreq/exynos/exynos_ppmu.c | 119 --- drivers/devfreq/exynos/exynos_ppmu.h | 86 -- drivers/devfreq/governor_passive.c | 207 ++++ include/linux/devfreq.h | 99 ++ 22 files changed, 2221 insertions(+), 1948 deletions(-) create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-bus.txt create mode 100644 arch/arm/boot/dts/exynos4412-ppmu-common.dtsi create mode 100644 drivers/devfreq/exynos-bus.c delete mode 100644 drivers/devfreq/exynos/Makefile delete mode 100644 drivers/devfreq/exynos/exynos4_bus.c delete mode 100644 drivers/devfreq/exynos/exynos4_bus.h delete mode 100644 drivers/devfreq/exynos/exynos5_bus.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.h create mode 100644 drivers/devfreq/governor_passive.c
Quoted 6 lines · Chanwoo Choi
Dear Myungjoo and Krzysztof,
This patch-set already get the acked-by or signed-off-by tag from Exynos SoC and DEVFREQ maintainer except for patch10.
If there is no comment, could you pick this patch-set?
I cannot find any description of dependencies between the patches so I assume the obvious one: DTS patches do not depend on anything. This means that:
1. driver/devfreq related changes (including dt-bindings documentation) go to Myungjoo,
2. I can pick DTS changes.
But first I would like to see the bindings documentation beeing applied by someone as a proof that there won't be more development in DTS in these series. There is no sense of picking DTS if after comments from Rob, you will rework them, right?
Anyway I see Rob's questions. For these bindings I think you should get DT-guys ack first.
Best regards,
Krzysztof
Hi Krzysztof,
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Chanwoo Choi
Dear Myungjoo and Krzysztof,
This patch-set already get the acked-by or signed-off-by tag from Exynos SoC and DEVFREQ maintainer except for patch10.
Quoted 8 lines
Quoted 1 line
If there is no comment, could you pick this patch-set?
I cannot find any description of dependencies between the patches so I assume the obvious one: DTS patches do not depend on anything. This means that:
1. driver/devfreq related changes (including dt-bindings documentation) go to Myungjoo,
2. I can pick DTS changes.
Yes.
Quoted 5 lines
But first I would like to see the bindings documentation beeing applied by someone as a proof that there won't be more development in DTS in these series. There is no sense of picking DTS if after comments from Rob, you will rework them, right?
I already discussed the Rob's question on December, last year on patchset[1]. But, after that, I didn't receive the any reply from him.
[1] https://lkml.org/lkml/2015/12/10/943
So, I thought that there is no comment. But, today, he give some question after 4 months.
But I'll again reply to Rob's question.
Quoted 3 lines
Anyway I see Rob's questions. For these bindings I think you should get DT-guys ack first.
OK.
Best Regards,
Chanwoo Choi
Quoted 9 lines · Chanwoo Choi
This patch-set includes the two features as following. The generic exynos bus frequency driver is able to support almost Exynos SoCs for bus frequency scaling. And the new passive governor is able to make the dependency on between devices for frequency/voltage scaling. I had posted the patch-set[1] with the similiar concept. This is is revised version for exynos bus frequency.
- Generic exynos bus frequency driver
- New passive governor of DEVFREQ framework
[1] https://lkml.org/lkml/2015/1/7/872
: [PATCHv3 0/8] devfreq: Add generic exynos memory-bus frequency driver
Applied DTS patches for late v4.7 (hopefully).
Best regards,
Krzysztof