Skip to content

Commit

Permalink
Merge branch 'smp': Add MSM8916 SMP + CPUidle without PSCI
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-gh committed Apr 20, 2020
2 parents a609ad0 + c30d5fe commit 1b12cb1
Show file tree
Hide file tree
Showing 16 changed files with 628 additions and 118 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/arm/cpus.yaml
Expand Up @@ -178,6 +178,7 @@ properties:
- enum:
- psci
- spin-table
- qcom,arm-cortex-acc
# On ARM 32-bit systems this property is optional
- enum:
- actions,s500-smp
Expand All @@ -203,6 +204,7 @@ properties:
- marvell,mmp3-smp
- mediatek,mt6589-smp
- mediatek,mt81xx-tz-smp
- qcom,arm-cortex-acc
- qcom,gcc-msm8660
- qcom,kpss-acc-v1
- qcom,kpss-acc-v2
Expand Down
19 changes: 19 additions & 0 deletions Documentation/devicetree/bindings/arm/msm/acc.txt
@@ -0,0 +1,19 @@
Application Processor Sub-system (APSS) Application Clock Controller (ACC)

The ACC provides clock, power domain, and reset control to a CPU. There is one ACC
register region per CPU within the APSS remapped region as well as an alias register
region that remaps accesses to the ACC associated with the CPU accessing the region.

Required properties:
- compatible: Must be "qcom,arm-cortex-acc"
- reg: The first element specifies the base address and size of
the register region. An optional second element specifies
the base address and size of the alias register region.

Example:

clock-controller@b088000 {
compatible = "qcom,arm-cortex-acc";
reg = <0x0b088000 0x1000>,
<0x0b008000 0x1000>;
}
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/arm/msm/qcom,saw2.txt
Expand Up @@ -27,6 +27,7 @@ PROPERTIES
"qcom,apq8064-saw2-v1.1-cpu"
"qcom,msm8974-saw2-v2.1-cpu"
"qcom,apq8084-saw2-v2.1-cpu"
"qcom,msm8916-saw2-v3.0-cpu"

- reg:
Usage: required
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Expand Up @@ -2226,6 +2226,7 @@ F: drivers/*/qcom*
F: drivers/*/qcom/
F: drivers/bluetooth/btqcomsmd.c
F: drivers/clocksource/timer-qcom.c
F: drivers/cpuidle/cpuidle-qcom-spm.c
F: drivers/extcon/extcon-qcom*
F: drivers/i2c/busses/i2c-qcom-geni.c
F: drivers/i2c/busses/i2c-qup.c
Expand Down
100 changes: 100 additions & 0 deletions arch/arm/boot/dts/qcom-msm8916-no-psci.dtsi
@@ -0,0 +1,100 @@
// SPDX-License-Identifier: GPL-2.0-only

/ {
cpus {
cpu@0 {
enable-method = "qcom,arm-cortex-acc";
qcom,acc = <&acc0>;
qcom,saw = <&saw0>;

/* TODO: power domain support */
cpu-idle-states = <&CPU_SLEEP_0>;
/delete-property/ power-domains;
/delete-property/ power-domain-names;
};
cpu@1 {
enable-method = "qcom,arm-cortex-acc";
qcom,acc = <&acc1>;
qcom,saw = <&saw1>;

/* TODO: power domain support */
cpu-idle-states = <&CPU_SLEEP_0>;
/delete-property/ power-domains;
/delete-property/ power-domain-names;
};
cpu@2 {
enable-method = "qcom,arm-cortex-acc";
qcom,acc = <&acc2>;
qcom,saw = <&saw2>;

/* TODO: power domain support */
cpu-idle-states = <&CPU_SLEEP_0>;
/delete-property/ power-domains;
/delete-property/ power-domain-names;
};
cpu@3 {
enable-method = "qcom,arm-cortex-acc";
qcom,acc = <&acc3>;
qcom,saw = <&saw3>;

/* TODO: power domain support */
cpu-idle-states = <&CPU_SLEEP_0>;
/delete-property/ power-domains;
/delete-property/ power-domain-names;
};

l2-cache {
power-domain = <&l2ccc_0>;
};

idle-states {
/delete-property/ entry-method;
cpu-sleep-0 {
compatible = "qcom,idle-state-spc";
};
};
};

/delete-node/ psci;

soc {
l2ccc_0: clock-controller@b011000 {
compatible = "qcom,8916-l2ccc";
reg = <0x0b011000 0x1000>;
};

acc0: clock-controller@b088000 {
compatible = "qcom,arm-cortex-acc";
reg = <0x0b088000 0x1000>, <0x0b008000 0x1000>;
};
acc1: clock-controller@b098000 {
compatible = "qcom,arm-cortex-acc";
reg = <0x0b098000 0x1000>, <0x0b008000 0x1000>;
};
acc2: clock-controller@b0a8000 {
compatible = "qcom,arm-cortex-acc";
reg = <0x0b0a8000 0x1000>, <0x0b008000 0x1000>;
};
acc3: clock-controller@b0b8000 {
compatible = "qcom,arm-cortex-acc";
reg = <0x0b0b8000 0x1000>, <0x0b008000 0x1000>;
};

saw0: power-controller@b089000 {
compatible = "qcom,msm8916-saw2-v3.0-cpu";
reg = <0xb089000 0x1000>, <0xb009000 0x1000>;
};
saw1: power-controller@b099000 {
compatible = "qcom,msm8916-saw2-v3.0-cpu";
reg = <0xb099000 0x1000>, <0xb009000 0x1000>;
};
saw2: power-controller@b0a9000 {
compatible = "qcom,msm8916-saw2-v3.0-cpu";
reg = <0xb0a9000 0x1000>, <0xb009000 0x1000>;
};
saw3: power-controller@b0b9000 {
compatible = "qcom,msm8916-saw2-v3.0-cpu";
reg = <0xb0b9000 0x1000>, <0xb009000 0x1000>;
};
};
};
16 changes: 16 additions & 0 deletions arch/arm/mach-qcom/platsmp.c
Expand Up @@ -291,6 +291,13 @@ static int kpssv2_boot_secondary(unsigned int cpu, struct task_struct *idle)
return qcom_boot_secondary(cpu, kpssv2_release_secondary);
}

extern int qcom_cortex_a_release_secondary(unsigned int cpu);

static int cortex_a_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
return qcom_boot_secondary(cpu, qcom_cortex_a_release_secondary);
}

static void __init qcom_smp_prepare_cpus(unsigned int max_cpus)
{
int cpu;
Expand Down Expand Up @@ -332,3 +339,12 @@ static const struct smp_operations qcom_smp_kpssv2_ops __initconst = {
#endif
};
CPU_METHOD_OF_DECLARE(qcom_smp_kpssv2, "qcom,kpss-acc-v2", &qcom_smp_kpssv2_ops);

static const struct smp_operations qcom_smp_cortex_a_ops __initconst = {
.smp_prepare_cpus = qcom_smp_prepare_cpus,
.smp_boot_secondary = cortex_a_boot_secondary,
#ifdef CONFIG_HOTPLUG_CPU
.cpu_die = qcom_cpu_die,
#endif
};
CPU_METHOD_OF_DECLARE(qcom_smp_cortex_a, "qcom,arm-cortex-acc", &qcom_smp_cortex_a_ops);
4 changes: 4 additions & 0 deletions arch/arm64/kernel/cpu_ops.c
Expand Up @@ -19,12 +19,16 @@ extern const struct cpu_operations smp_spin_table_ops;
extern const struct cpu_operations acpi_parking_protocol_ops;
#endif
extern const struct cpu_operations cpu_psci_ops;
extern const struct cpu_operations qcom_cortex_a_ops;

static const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;

static const struct cpu_operations *const dt_supported_cpu_ops[] __initconst = {
&smp_spin_table_ops,
&cpu_psci_ops,
#ifdef CONFIG_ARCH_QCOM
&qcom_cortex_a_ops,
#endif
NULL,
};

Expand Down
13 changes: 13 additions & 0 deletions drivers/cpuidle/Kconfig.arm
Expand Up @@ -94,3 +94,16 @@ config ARM_TEGRA_CPUIDLE
select ARM_CPU_SUSPEND
help
Select this to enable cpuidle for NVIDIA Tegra20/30/114/124 SoCs.

config ARM_QCOM_SPM_CPUIDLE
bool "CPU Idle Driver for Qualcomm Subsystem Power Manager (SPM)"
depends on ARCH_QCOM || COMPILE_TEST
select ARM_CPU_SUSPEND
select CPU_IDLE_MULTIPLE_DRIVERS
select DT_IDLE_STATES
select QCOM_SCM
help
Select this to enable cpuidle for Qualcomm processors.
The Subsystem Power Manager (SPM) controls low power modes for the
CPU and L2 cores. It interface with various system drivers to put
the cores in low power modes.
1 change: 1 addition & 0 deletions drivers/cpuidle/Makefile
Expand Up @@ -25,6 +25,7 @@ obj-$(CONFIG_ARM_PSCI_CPUIDLE) += cpuidle_psci.o
cpuidle_psci-y := cpuidle-psci.o
cpuidle_psci-$(CONFIG_PM_GENERIC_DOMAINS_OF) += cpuidle-psci-domain.o
obj-$(CONFIG_ARM_TEGRA_CPUIDLE) += cpuidle-tegra.o
obj-$(CONFIG_ARM_QCOM_SPM_CPUIDLE) += cpuidle-qcom-spm.o

###############################################################################
# MIPS drivers
Expand Down

0 comments on commit 1b12cb1

Please sign in to comment.