Skip to content

Commit

Permalink
Support CPU frequency scaling on Apple M1 SoC.
Browse files Browse the repository at this point in the history
Signed-off-by: Stan Skowronek <stan@corellium.com>
  • Loading branch information
Stan-Corellium committed Jan 22, 2021
1 parent 749dc1e commit 857454e
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 4 deletions.
13 changes: 9 additions & 4 deletions arch/arm64/boot/dts/apple/apple-m1-j274.dts
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,28 @@
enable-method = "apple,startcpu";
};

cpu@4 {
cpu@0x10100 {
device_type = "cpu";
compatible = "apple,v1";
reg = <0x10100>;
enable-method = "apple,startcpu";
};

cpu@5 {
cpu@0x10101 {
device_type = "cpu";
compatible = "apple,v1";
reg = <0x10101>;
enable-method = "apple,startcpu";
};

cpu@6 {
cpu@0x10102 {
device_type = "cpu";
compatible = "apple,v1";
reg = <0x10102>;
enable-method = "apple,startcpu";
};

cpu@7 {
cpu@0x10103 {
device_type = "cpu";
compatible = "apple,v1";
reg = <0x10103>;
Expand Down Expand Up @@ -153,6 +153,11 @@
0x2 0x3b754004 0x0 0xc 0x2 0x11350000 0x0 0x8 0x2 0x11330fb0 0x0 0x4>;
};

cpufreq: cpufreq@210e00000 {
compatible = "apple,pmgr-cpufreq-m1";
reg = <0x2 0x10e00000 0x0 0x100000 0x2 0x11e00000 0x0 0x100000 0x2 0x3b700000 0x0 0x100000>;
};

aic: interrupt-controller@23b100000 {
compatible = "apple,aic";
#interrupt-cells = <3>;
Expand Down
6 changes: 6 additions & 0 deletions drivers/cpufreq/Kconfig.arm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ config ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM
To compile this driver as a module, choose M here: the
module will be called sun50i-cpufreq-nvmem.

config ARM_APPLE_M1_CPUFREQ
tristate "Apple M1 CPU power state driver"
depends on ARCH_APPLE
help
This add the CPUFreq driver support for Apple M1 SoC.

config ARM_ARMADA_37XX_CPUFREQ
tristate "Armada 37xx CPUFreq support"
depends on ARCH_MVEBU && CPUFREQ_DT
Expand Down
1 change: 1 addition & 0 deletions drivers/cpufreq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ obj-$(CONFIG_X86_SFI_CPUFREQ) += sfi-cpufreq.o

##################################################################################
# ARM SoC drivers
obj-$(CONFIG_ARM_APPLE_M1_CPUFREQ) += apple-m1-cpufreq.o
obj-$(CONFIG_ARM_ARMADA_37XX_CPUFREQ) += armada-37xx-cpufreq.o
obj-$(CONFIG_ARM_ARMADA_8K_CPUFREQ) += armada-8k-cpufreq.o
obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ) += brcmstb-avs-cpufreq.o
Expand Down

0 comments on commit 857454e

Please sign in to comment.