summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-stm32
diff options
context:
space:
mode:
authorKees Cook <kees+treewide@kernel.org>2026-09-02 15:31:14 -0700
committerKees Cook <kees@kernel.org>2026-09-04 21:37:00 -0700
commit3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d (patch)
treec65086f9bdcd48c6360fb7cb4598bca084da1f32 /arch/arm/mach-stm32
downloadlinux-stable-3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d.tar.gz
linux-stable-3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d.zip
treewide: refresh kmalloc_obj() conversionsgrafted
This is another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci This catches both the set of kmalloc() uses added since the first kmalloc_obj() conversions in v7.0 and adds a large group missed in the first pass due to Coccinelle not interacting well with the cleanup.h scoped_...() family of macros[1]. I worked around this with spatch's "--macro-file" argument to a file with all the scoped_...() macros mapped to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control flow indicator I could find. Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc, riscv, and s390 with no new warnings. Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1] Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2] Signed-off-by: Kees Cook <kees+treewide@kernel.org>
Diffstat (limited to 'arch/arm/mach-stm32')
-rw-r--r--arch/arm/mach-stm32/Kconfig64
-rw-r--r--arch/arm/mach-stm32/Makefile2
-rw-r--r--arch/arm/mach-stm32/board-dt.c35
3 files changed, 101 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
new file mode 100644
index 000000000..4ac3384e3
--- /dev/null
+++ b/arch/arm/mach-stm32/Kconfig
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: GPL-2.0-only
+menuconfig ARCH_STM32
+ bool "STMicroelectronics STM32 family"
+ depends on ARM_SINGLE_ARMV7M || ARCH_MULTI_V7
+ select ARMV7M_SYSTICK if ARM_SINGLE_ARMV7M
+ select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
+ select ARM_GIC if ARCH_MULTI_V7
+ select ARM_PSCI if ARCH_MULTI_V7
+ select ARM_AMBA
+ select ARCH_HAS_RESET_CONTROLLER
+ select CLKSRC_STM32
+ select PINCTRL
+ select RESET_CONTROLLER
+ select STM32_EXTI if ARM_SINGLE_ARMV7M
+ select STM32_FIREWALL
+ help
+ Support for STMicroelectronics STM32MP1 processors using Cortex-A7
+ cores. Note that support for the earlier Cortex-M based variants
+ is deprecated and scheduled for removal in early 2027.
+
+if ARCH_STM32
+
+if ARM_SINGLE_ARMV7M
+
+config MACH_STM32F429
+ bool "STMicroelectronics STM32F429 (DEPRECATED)"
+ default y
+
+config MACH_STM32F469
+ bool "STMicroelectronics STM32F469 (DEPRECATED)"
+ default y
+
+config MACH_STM32F746
+ bool "STMicroelectronics STM32F746 (DEPRECATED)"
+ default y
+
+config MACH_STM32F769
+ bool "STMicroelectronics STM32F769 (DEPRECATED)"
+ default y
+
+config MACH_STM32H743
+ bool "STMicroelectronics STM32H743 (DEPRECATED)"
+ default y
+
+endif # ARMv7-M
+
+if ARCH_MULTI_V7
+
+config MACH_STM32MP157
+ bool "STMicroelectronics STM32MP157"
+ select ARM_ERRATA_814220
+ default y
+
+config MACH_STM32MP13
+ bool "STMicroelectronics STM32MP13x"
+ select ARM_ERRATA_814220
+ default y
+ help
+ Support for STM32MP13 SoCs:
+ STM32MP131, STM32MP133, STM32MP135
+
+endif # ARMv7-A
+
+endif
diff --git a/arch/arm/mach-stm32/Makefile b/arch/arm/mach-stm32/Makefile
new file mode 100644
index 000000000..c80d80c19
--- /dev/null
+++ b/arch/arm/mach-stm32/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += board-dt.o
diff --git a/arch/arm/mach-stm32/board-dt.c b/arch/arm/mach-stm32/board-dt.c
new file mode 100644
index 000000000..e6233c872
--- /dev/null
+++ b/arch/arm/mach-stm32/board-dt.c
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) Maxime Coquelin 2015
+ * Copyright (C) STMicroelectronics 2017
+ * Author: Maxime Coquelin <mcoquelin.stm32@gmail.com>
+ */
+
+#include <linux/kernel.h>
+#include <asm/mach/arch.h>
+#ifdef CONFIG_ARM_SINGLE_ARMV7M
+#include <asm/v7m.h>
+#endif
+
+static const char *const stm32_compat[] __initconst = {
+ "st,stm32f429",
+ "st,stm32f469",
+ "st,stm32f746",
+ "st,stm32f769",
+ "st,stm32h743",
+ "st,stm32h747",
+ "st,stm32h750",
+ "st,stm32mp131",
+ "st,stm32mp133",
+ "st,stm32mp135",
+ "st,stm32mp151",
+ "st,stm32mp157",
+ NULL
+};
+
+DT_MACHINE_START(STM32DT, "STM32 (Device Tree Support)")
+ .dt_compat = stm32_compat,
+#ifdef CONFIG_ARM_SINGLE_ARMV7M
+ .restart = armv7m_restart,
+#endif
+MACHINE_END