Skip to content

Commit 8bfd485

Browse files
smaeulchanwoochoi
authored andcommitted
PM / devfreq: Add a driver for the sun8i/sun50i MBUS
This driver works by adjusting the divider on the DRAM controller's module clock. Thus there is no fixed set of OPPs, only "full speed" down to "quarter speed" (or whatever the maximum divider is on that variant). It makes use of the MDFS hardware in the MBUS, in "DFS" mode, which takes care of updating registers during the critical section while DRAM is inaccessible. This driver should support several sunxi SoCs, starting with the A33, which have a DesignWare DDR3 controller with merged PHY register space and the matching MBUS register layout (so not A63 or later). However, the driver has only been tested on the A64/H5, so those are the only compatibles enabled for now. Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
1 parent 0fcfb00 commit 8bfd485

File tree

3 files changed

+520
-0
lines changed

3 files changed

+520
-0
lines changed

drivers/devfreq/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ config ARM_RK3399_DMC_DEVFREQ
132132
It sets the frequency for the memory controller and reads the usage counts
133133
from hardware.
134134

135+
config ARM_SUN8I_A33_MBUS_DEVFREQ
136+
tristate "sun8i/sun50i MBUS DEVFREQ Driver"
137+
depends on ARCH_SUNXI || COMPILE_TEST
138+
select DEVFREQ_GOV_SIMPLE_ONDEMAND
139+
help
140+
This adds the DEVFREQ driver for the MBUS controller in some
141+
Allwinner sun8i (A33 through H3) and sun50i (A64 and H5) SoCs.
142+
135143
source "drivers/devfreq/event/Kconfig"
136144

137145
endif # PM_DEVFREQ

drivers/devfreq/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o
1212
obj-$(CONFIG_ARM_IMX_BUS_DEVFREQ) += imx-bus.o
1313
obj-$(CONFIG_ARM_IMX8M_DDRC_DEVFREQ) += imx8m-ddrc.o
1414
obj-$(CONFIG_ARM_RK3399_DMC_DEVFREQ) += rk3399_dmc.o
15+
obj-$(CONFIG_ARM_SUN8I_A33_MBUS_DEVFREQ) += sun8i-a33-mbus.o
1516
obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra30-devfreq.o
1617

1718
# DEVFREQ Event Drivers

0 commit comments

Comments
 (0)