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

Ralph Siemsen <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <CANp-EDa+2Hdzg2nn9mcOupkLNPvAohnu_1UZ9AaysG_gvK==AA@mail.gmail.com>
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.

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.