Skip to content
Permalink
Browse files
cpuidle: Add RISC-V SBI CPU idle driver
The RISC-V SBI HSM extension provides HSM suspend call which can
be used by Linux RISC-V to enter platform specific low-power state.

This patch adds a CPU idle driver based on RISC-V SBI calls which
will populate idle states from device tree and use SBI calls to
entry these idle states.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
  • Loading branch information
avpatel committed Feb 18, 2021
1 parent adfae32 commit 400edab10d72cefa47812c9ff46f182be38cb2ee
Show file tree
Hide file tree
Showing 5 changed files with 515 additions and 0 deletions.
@@ -4641,6 +4641,13 @@ S: Supported
F: drivers/cpuidle/cpuidle-psci.h
F: drivers/cpuidle/cpuidle-psci-domain.c

CPUIDLE DRIVER - RISC-V SBI
M: Anup Patel <anup.patel@wdc.com>
L: linux-pm@vger.kernel.org
L: linux-riscv@lists.infradead.org
S: Supported
F: drivers/cpuidle/cpuidle-sbi.c

CRAMFS FILESYSTEM
M: Nicolas Pitre <nico@fluxnic.net>
S: Maintained
@@ -66,6 +66,11 @@ depends on PPC
source "drivers/cpuidle/Kconfig.powerpc"
endmenu

menu "RISC-V CPU Idle Drivers"
depends on RISCV
source "drivers/cpuidle/Kconfig.riscv"
endmenu

config HALTPOLL_CPUIDLE
tristate "Halt poll cpuidle driver"
depends on X86 && KVM_GUEST
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# RISC-V CPU Idle drivers
#

config RISCV_SBI_CPUIDLE
bool "RISC-V SBI CPU idle Driver"
depends on RISCV_SBI
select DT_IDLE_STATES
select CPU_IDLE_MULTIPLE_DRIVERS
help
Select this option to enable RISC-V SBI firmware based CPU idle
driver for RISC-V systems.

config RISCV_SBI_CPUIDLE_DOMAIN
bool "RISC-V SBI CPU idle Domain"
depends on RISCV_SBI_CPUIDLE
depends on PM_GENERIC_DOMAINS_OF
select DT_IDLE_GENPD
default y
help
Select this to enable the RISC-V SBI based CPU idle driver to use
PM domains, which is needed to support the hierarchical DT based
layout of the idle states.
@@ -35,3 +35,7 @@ obj-$(CONFIG_MIPS_CPS_CPUIDLE) += cpuidle-cps.o
# POWERPC drivers
obj-$(CONFIG_PSERIES_CPUIDLE) += cpuidle-pseries.o
obj-$(CONFIG_POWERNV_CPUIDLE) += cpuidle-powernv.o

###############################################################################
# RISC-V drivers
obj-$(CONFIG_RISCV_SBI_CPUIDLE) += cpuidle-sbi.o

0 comments on commit 400edab

Please sign in to comment.