[PATCH v2 4/4] ARM: configs: stm32: Remove useless flags in STM32 defconfig

patrice.chotard@foss.st.com posted 4 patches 12 months ago
[PATCH v2 4/4] ARM: configs: stm32: Remove useless flags in STM32 defconfig
Posted by patrice.chotard@foss.st.com 12 months ago
From: Patrice Chotard <patrice.chotard@foss.st.com>

As stm32_defconfig is dedicated to STM32 MCUs, disable
CONFIG_COMMON_CLK_STM32MP flag which is only used by STM32 MPUs.

Disable CONFIG_SUSPEND, CONFIG_ADVISE_SYSCALLS, CONFIG_IO_URING
CONFIG_POSIX_TIMERS, CONFIG_GCC_PLUGINS, it will reduce the kernel
image size for these platforms which embed a low amount of memory.

Tested on STM32F746-DISCO board which embeds 8MB of memory.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
---
 arch/arm/configs/stm32_defconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
index d62a0c0b7ce5..77048b5e1ec4 100644
--- a/arch/arm/configs/stm32_defconfig
+++ b/arch/arm/configs/stm32_defconfig
@@ -6,12 +6,15 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
+# CONFIG_POSIX_TIMERS is not set
 CONFIG_BASE_SMALL=y
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
 # CONFIG_SIGNALFD is not set
 # CONFIG_EVENTFD is not set
 # CONFIG_AIO is not set
+# CONFIG_IO_URING is not set
+# CONFIG_ADVISE_SYSCALLS is not set
 # CONFIG_MMU is not set
 CONFIG_ARCH_STM32=y
 CONFIG_CPU_V7M_NUM_IRQ=240
@@ -20,6 +23,8 @@ CONFIG_DRAM_BASE=0x90000000
 # CONFIG_ATAGS is not set
 CONFIG_XIP_KERNEL=y
 CONFIG_XIP_PHYS_ADDR=0x08008000
+# CONFIG_SUSPEND is not set
+# CONFIG_GCC_PLUGINS is not set
 CONFIG_BINFMT_FLAT=y
 # CONFIG_COREDUMP is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
@@ -60,6 +65,7 @@ CONFIG_DMADEVICES=y
 CONFIG_STM32_DMA=y
 CONFIG_STM32_DMAMUX=y
 CONFIG_STM32_MDMA=y
+# CONFIG_COMMON_CLK_STM32MP is not set
 CONFIG_IIO=y
 CONFIG_STM32_ADC_CORE=y
 CONFIG_STM32_ADC=y
-- 
2.25.1
Re: [PATCH v2 4/4] ARM: configs: stm32: Remove useless flags in STM32 defconfig
Posted by Arnd Bergmann 12 months ago
On Fri, Dec 20, 2024, at 13:55, patrice.chotard@foss.st.com wrote:
> From: Patrice Chotard <patrice.chotard@foss.st.com>
>
> As stm32_defconfig is dedicated to STM32 MCUs, disable
> CONFIG_COMMON_CLK_STM32MP flag which is only used by STM32 MPUs.
>
> Disable CONFIG_SUSPEND, CONFIG_ADVISE_SYSCALLS, CONFIG_IO_URING
> CONFIG_POSIX_TIMERS, CONFIG_GCC_PLUGINS, it will reduce the kernel
> image size for these platforms which embed a low amount of memory.
>
> Tested on STM32F746-DISCO board which embeds 8MB of memory.

Out of curiosity, what is the smallest memory configuration that
you see people using on stm32f7/h7 these days? I know we had
configs that kind-of worked on 2MB in the past, but I assume there
has been a lot of bloat since.

       Arnd
Re: [PATCH v2 4/4] ARM: configs: stm32: Remove useless flags in STM32 defconfig
Posted by Patrice CHOTARD 11 months, 2 weeks ago

On 12/20/24 18:06, Arnd Bergmann wrote:
> On Fri, Dec 20, 2024, at 13:55, patrice.chotard@foss.st.com wrote:
>> From: Patrice Chotard <patrice.chotard@foss.st.com>
>>
>> As stm32_defconfig is dedicated to STM32 MCUs, disable
>> CONFIG_COMMON_CLK_STM32MP flag which is only used by STM32 MPUs.
>>
>> Disable CONFIG_SUSPEND, CONFIG_ADVISE_SYSCALLS, CONFIG_IO_URING
>> CONFIG_POSIX_TIMERS, CONFIG_GCC_PLUGINS, it will reduce the kernel
>> image size for these platforms which embed a low amount of memory.
>>
>> Tested on STM32F746-DISCO board which embeds 8MB of memory.
> 
> Out of curiosity, what is the smallest memory configuration that
> you see people using on stm32f7/h7 these days? I know we had
> configs that kind-of worked on 2MB in the past, but I assume there
> has been a lot of bloat since.
> 
>        Arnd

Hi Arnd

Currently, i have no idea about what is the smallest memory configuration on stm32f4/f7/h7
used by people using these SoCs. As you said, kernel Linux size is increasing version after version.

My goal was just to ensure that official ST boards are still booting a kernel Linux.

Patrice