[PATCH] pinctrl: qcom: handle reserved ranges

Neil Armstrong neil.armstrong at linaro.org
Thu Apr 10 09:48:18 CEST 2025


On 10/04/2025 01:40, Alexey Minnekhanov wrote:
> On 4/1/25 10:46, Neil Armstrong via groups.io wrote:
>> From: Caleb Connolly <caleb.connolly at linaro.org>
>>
>> Some Qualcomm boards feature reserved ranges of pins which are protected
>> by firmware. Attempting to read or write any registers associated with
>> these pins results the board resetting.
>>
>> Add support for parsing these ranges from devicetree and ensure that the
>> pinctrl and GPIO drivers don't try to interact with these pins.
>>
>> Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
>> Signed-off-by: Neil Armstrong <neil.armstrong at linaro.org>
>> ---
>>   arch/arm/mach-snapdragon/include/mach/gpio.h | 15 +++++++
>>   drivers/gpio/msm_gpio.c                      |  9 ++++
>>   drivers/pinctrl/qcom/pinctrl-qcom.c          | 64 ++++++++++++++++++++++++++++
>>   3 files changed, 88 insertions(+)
> 
> ...
> 
>> +#define MSM_PINCTRL_MAX_RESERVED_RANGES 32
>> +
>>   struct msm_pinctrl_priv {
>>       phys_addr_t base;
>>       struct msm_pinctrl_data *data;
>> +    u32 reserved_ranges[MSM_PINCTRL_MAX_RESERVED_RANGES * 2];
>> +    int reserved_ranges_count;
>>   };
> Why storing of reserved pins isn't implemented using bitmap?
> 
>      DECLARE_BITMAP(reserved_pins, 256);
> 
> would only consume 32 bytes, instead of 256+4 like here.
> 
> Do I miss something?


You're right, I'll convert it to bitmap.

Neil

> 
> ---
> Regards,
> Alexey Minnekhanov



More information about the U-Boot mailing list