Skip to contentSkip to conversation

Compile-test NVIDIA Tegra CPUIDLE driver

PATCH In review Dmitry Osipenko 1 participant 7 messages Jul 12, 2021 – Aug 16, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Compile-test NVIDIA Tegra CPUIDLE driver

This series enables compile-testing of the tegra-cpuidle driver.

Changelog:

v2: - Improved ARM_TEGRA_CPUIDLE Kconfig to fix/exclude compile-testing of
ARM platforms that don't have MMU. This problem was reported by the Intel's build bot for v1.

Dmitry Osipenko (5):
soc/tegra: fuse: Add stubs needed for compile testing soc/tegra: irq: Add stubs needed for compile testing soc/tegra: pm: Make stubs usable for compile testing
clk: tegra: Add stubs needed for compile testing
cpuidle: tegra: Enable compile testing

 drivers/cpuidle/Kconfig.arm |  2 +-
 include/linux/clk/tegra.h   |  4 ++++
 include/soc/tegra/fuse.h    | 31 ++++++++++++++++++++++++++-----
 include/soc/tegra/irq.h     |  9 ++++++++-
 include/soc/tegra/pm.h      |  2 +-
 5 files changed, 40 insertions(+), 8 deletions(-)
Signature · 1 line
2.32.0
#1 lore raw

PATCH v2 1/5 soc/tegra: fuse: Add stubs needed for compile testing

Add stubs needed for compile-testing of tegra-cpuidle driver.

---
 include/soc/tegra/fuse.h | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)
include/soc/tegra/fuse.h +26 -5
index 990701f788bc..67d2bc856fbc 100644
@@ -6,6 +6,8 @@
 #ifndef __SOC_TEGRA_FUSE_H__
 #define __SOC_TEGRA_FUSE_H__
 
+#include <linux/types.h>
+
 #define TEGRA20		0x20
 #define TEGRA30		0x30
 #define TEGRA114	0x35
@@ -22,11 +24,6 @@
 
 #ifndef __ASSEMBLY__
 
-u32 tegra_read_chipid(void);
-u8 tegra_get_chip_id(void);
-u8 tegra_get_platform(void);
-bool tegra_is_silicon(void);
-
 enum tegra_revision {
 	TEGRA_REVISION_UNKNOWN = 0,
 	TEGRA_REVISION_A01,
@@ -57,6 +54,10 @@ extern struct tegra_sku_info tegra_sku_info;
 u32 tegra_read_straps(void);
 u32 tegra_read_ram_code(void);
 int tegra_fuse_readl(unsigned long offset, u32 *value);
+u32 tegra_read_chipid(void);
+u8 tegra_get_chip_id(void);
+u8 tegra_get_platform(void);
+bool tegra_is_silicon(void);
 #else
 static struct tegra_sku_info tegra_sku_info __maybe_unused;
 
@@ -74,6 +75,26 @@ static inline int tegra_fuse_readl(unsigned long offset, u32 *value)
 {
 	return -ENODEV;
 }
+
+static inline u32 tegra_read_chipid(void)
+{
+	return 0;
+}
+
+static inline u8 tegra_get_chip_id(void)
+{
+	return 0;
+}
+
+static inline u8 tegra_get_platform(void)
+{
+	return 0;
+}
+
+static inline bool tegra_is_silicon(void)
+{
+	return false;
+}
 #endif
 
 struct device *tegra_soc_device_register(void);
Signature · 1 line
2.32.0
#2 lore raw

PATCH v2 2/5 soc/tegra: irq: Add stubs needed for compile testing

In reply to Dmitry Osipenko

Add stubs needed for compile-testing of tegra-cpuidle driver.

---
 include/soc/tegra/irq.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
include/soc/tegra/irq.h +8 -1
index 8eb11a7109e4..94539551c8c1 100644
@@ -6,8 +6,15 @@
 #ifndef __SOC_TEGRA_IRQ_H
 #define __SOC_TEGRA_IRQ_H
 
-#if defined(CONFIG_ARM)
+#include <linux/types.h>
+
+#if defined(CONFIG_ARM) && defined(CONFIG_ARCH_TEGRA)
 bool tegra_pending_sgi(void);
+#else
+static inline bool tegra_pending_sgi(void)
+{
+	return false;
+}
 #endif
 
 #endif /* __SOC_TEGRA_IRQ_H */
Signature · 1 line
2.32.0
#3 lore raw

PATCH v2 3/5 soc/tegra: pm: Make stubs usable for compile testing

In reply to Dmitry Osipenko

The PM stubs need to depend on ARCH_TEGRA in order to be usable for compile-testing of tegra-cpuidle driver. Add the dependency.

---
 include/soc/tegra/pm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/soc/tegra/pm.h +1 -1
index 08477d7bfab9..81701944fe78 100644
@@ -16,7 +16,7 @@ enum tegra_suspend_mode {
 	TEGRA_MAX_SUSPEND_MODE,
 };
 
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM)
+#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM) && defined(CONFIG_ARCH_TEGRA)
 enum tegra_suspend_mode
 tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode);
 
Signature · 1 line
2.32.0
#4 lore raw

PATCH v2 4/5 clk: tegra: Add stubs needed for compile testing

In reply to Dmitry Osipenko

Add stubs needed for compile-testing of tegra-cpuidle driver.

---
 include/linux/clk/tegra.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/clk/tegra.h +4 -0
index d128ad1570aa..9bd06d8a5436 100644
@@ -42,7 +42,11 @@ struct tegra_cpu_car_ops {
 #endif
 };
 
+#ifdef CONFIG_ARCH_TEGRA
 extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
+#else
+static struct tegra_cpu_car_ops *tegra_cpu_car_ops __maybe_unused;
+#endif
 
 static inline void tegra_wait_cpu_in_reset(u32 cpu)
 {
Signature · 1 line
2.32.0
#5 lore raw

PATCH v2 5/5 cpuidle: tegra: Enable compile testing

In reply to Dmitry Osipenko

Enable compile testing of tegra-cpuidle driver.

---
 drivers/cpuidle/Kconfig.arm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/Kconfig.arm +1 -1
index 334f83e56120..599286fc0b08 100644
@@ -99,7 +99,7 @@ config ARM_MVEBU_V7_CPUIDLE
 
 config ARM_TEGRA_CPUIDLE
 	bool "CPU Idle Driver for NVIDIA Tegra SoCs"
-	depends on ARCH_TEGRA && !ARM64
+	depends on (ARCH_TEGRA || COMPILE_TEST) && !ARM64 && MMU
 	select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
 	select ARM_CPU_SUSPEND
 	help
Signature · 1 line
2.32.0
#6 lore raw

Re: [PATCH v2 5/5] cpuidle: tegra: Enable compile testing

12.07.2021 03:03, Dmitry Osipenko пишет:

Quoted 13 lines

Enable compile testing of tegra-cpuidle driver.

---
 drivers/cpuidle/Kconfig.arm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/Kconfig.arm +0 -0
index 334f83e56120..599286fc0b08 100644

drivers/cpuidle/Kconfig.arm config ARM_MVEBU_V7_CPUIDLE · line 105

Quoted 8 lines
drivers/cpuidle/Kconfig.arm +1 -1
@@ -99,7 +99,7 @@ config ARM_MVEBU_V7_CPUIDLE
 
 config ARM_TEGRA_CPUIDLE
 	bool "CPU Idle Driver for NVIDIA Tegra SoCs"
-	depends on ARCH_TEGRA && !ARM64
+	depends on (ARCH_TEGRA || COMPILE_TEST) && !ARM64 && MMU
 	select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
 	select ARM_CPU_SUSPEND
 	help

Daniel, could you please ack this patch?