[PATCH v3 3/9] pinctrl: stm32: Introduce HDP driver

Clement LE GOFFIC clement.legoffic at foss.st.com
Wed May 28 04:43:55 PDT 2025


On 5/28/25 10:28, Krzysztof Kozlowski wrote:
> On 23/05/2025 14:38, Clément Le Goffic wrote:

Hi,

>> This patch introduce the driver for the Hardware Debug Port available on
> 
> "Add driver...", see submitting patches

Sure, I'll shorten the commit message

> 
> 
> 
>> STM32MP platforms. The HDP allows the observation of internal SoC
>> signals by using multiplexers. Each HDP port can provide up to 16
>> internal signals (one of them can be software controlled as a GPO).
>>
>> Signed-off-by: Clément Le Goffic <clement.legoffic at foss.st.com>
>> ---
>>   drivers/pinctrl/stm32/Kconfig             |  14 +
>>   drivers/pinctrl/stm32/Makefile            |   1 +
>>   drivers/pinctrl/stm32/pinctrl-stm32-hdp.c | 720 ++++++++++++++++++++++++++++++
>>   3 files changed, 735 insertions(+)
>>
>> diff --git a/drivers/pinctrl/stm32/Kconfig b/drivers/pinctrl/stm32/Kconfig
>> index 2656d3d3ae40..4b474cfd1f2c 100644
>> --- a/drivers/pinctrl/stm32/Kconfig
>> +++ b/drivers/pinctrl/stm32/Kconfig
>> @@ -57,4 +57,18 @@ config PINCTRL_STM32MP257
>>   	depends on OF && HAS_IOMEM
>>   	default MACH_STM32MP25
>>   	select PINCTRL_STM32
>> +
>> +config PINCTRL_STM32_HDP
>> +	tristate "STMicroelectronics STM32 Hardware Debug Port (HDP) pin control"
>> +	depends on OF && HAS_IOMEM
>> +	default ARM64 || (ARM && CPU_V7)
> 
> I just cleaned this up and I still think this should be default for your
> arch, not for every other platform during compile test. See bunch of my
> commits "Do not enable by default during compile testing".
> 

Ok I'll use "default ARCH_STM32 && !ARM_SINGLE_ARMV7M" which is more 
restrictive.

> 
>> +	select PINMUX
>> +	select GENERIC_PINCONF
>> +	select GPIOLIB
>> +	help
>> +	  The Hardware Debug Port allows the observation of internal signals.
>> +	  It uses configurable multiplexer to route signals in a dedicated observation register.
>> +	  This driver also permits the observation of signals on external SoC pins.
>> +	  It permits the observation of up to 16 signals per HDP line.
>> +
>>   endif
>> diff --git a/drivers/pinctrl/stm32/Makefile b/drivers/pinctrl/stm32/Makefile
>> index 7b17464d8de1..98a1bbc7e16c 100644
>> --- a/drivers/pinctrl/stm32/Makefile
>> +++ b/drivers/pinctrl/stm32/Makefile
>> @@ -11,3 +11,4 @@ obj-$(CONFIG_PINCTRL_STM32H743)	+= pinctrl-stm32h743.o
>>   obj-$(CONFIG_PINCTRL_STM32MP135) += pinctrl-stm32mp135.o
>>   obj-$(CONFIG_PINCTRL_STM32MP157) += pinctrl-stm32mp157.o
>>   obj-$(CONFIG_PINCTRL_STM32MP257) += pinctrl-stm32mp257.o
>> +obj-$(CONFIG_PINCTRL_STM32_HDP) += pinctrl-stm32-hdp.o
>> diff --git a/drivers/pinctrl/stm32/pinctrl-stm32-hdp.c b/drivers/pinctrl/stm32/pinctrl-stm32-hdp.c
>> new file mode 100644
>> index 000000000000..e91442eb566b
>> --- /dev/null
>> +++ b/drivers/pinctrl/stm32/pinctrl-stm32-hdp.c
>> @@ -0,0 +1,720 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * Copyright (C) STMicroelectronics 2025 - All Rights Reserved
>> + * Author: Clément Le Goffic <clement.legoffic at foss.st.com> for STMicroelectronics.
>> + */
>> +#include <linux/bits.h>
>> +#include <linux/clk.h>
>> +#include <linux/gpio/driver.h>
>> +#include <linux/io.h>
>> +#include <linux/of.h>
>> +#include <linux/of_device.h>
> 
> Not used.

Ack

> 
>> +#include <linux/pinctrl/consumer.h>
>> +#include <linux/pinctrl/pinconf-generic.h>
>> +#include <linux/pinctrl/pinctrl.h>
>> +#include <linux/pinctrl/pinmux.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/pm.h>
>> +
> Best regards,
> Krzysztof




More information about the linux-arm-kernel mailing list