Re: [PATCH 03/17] spi: cadence_qspi: Use APB write protection

"Kumar, Udit" <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>

On 8/1/2026 6:37 PM, Ralph Siemsen wrote:
> On Sat, Aug 1, 2026 at 3:24 AM Kumar, Udit <[email protected]> wrote:
>>
>> On 7/31/2026 10:03 PM, Ralph Siemsen wrote:
>>> Prevent random memory writes from corrupting flash memory.
>>
>> my suggestion will be check first, why stray write are happening
> 
> This is purely defensive, there are no known stray writes occurring.
> 
>>> +static void cadence_qspi_apb_write_protect_enable(void *reg_base)
>>> +{
>>> +     writel(CQSPI_REG_WRPROT_ENABLE,
>>> +            reg_base + CQSPI_REG_WRITE_PROTECT_CTRL);
>>> +}
>>> +
>>
>> I expect compilation warning on platform, which does not define
>> CONFIG_CADENCE_QSPI_WRITE_PROTECT
> 
> Originally I used #ifdef around this code, but checkpatch complained.
> I can add it back in.
> 
> Curiously, I do not see a warning (about unused function) when
> CONFIG_CADENCE_QSPI_WRITE_PROTECT is not defined.

Could you share your compiler details

My compiler reports warning (gcc version 11.3.1 20220712)

../drivers/spi/cadence_qspi_apb.c:334:13: warning:
‘cadence_qspi_apb_write_protect_enable’ defined but not used
[-Wunused-function]
  334 | static void cadence_qspi_apb_write_protect_enable(void *reg_base)






> Regards,
> Ralph
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.