[PATCH v2 6/8] mtd: rawnand: loongson: Add Loongson-2K0500 NAND controller support

Binbin Zhou zhoubb.aaron at gmail.com
Mon Aug 11 18:46:07 PDT 2025


HI Yao:

Thanks for your reply.

On Tue, Aug 12, 2025 at 2:09 AM Yao Zi <ziyao at disroot.org> wrote:
>
> On Mon, Aug 11, 2025 at 02:03:13PM +0800, Binbin Zhou wrote:
> > The Loongson-2K0500 NAND controller is similar to the Loongson-1C.
> >
> > It supports a maximum capacity of 16GB FLASH per chip with a maximum
> > page size of 8KB, and it supports up to 4 chip selects and 4 RDY
> > signals.
> >
> > Its DMA controller is defaulted to APBDMA0.
> >
> > Signed-off-by: Binbin Zhou <zhoubinbin at loongson.cn>
> > ---
> >  drivers/mtd/nand/raw/Kconfig                  |  2 +-
> >  .../mtd/nand/raw/loongson-nand-controller.c   | 55 ++++++++++++++++++-
> >  2 files changed, 54 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
> > index d9e3f13666ac..7b0c5d06aa95 100644
> > --- a/drivers/mtd/nand/raw/Kconfig
> > +++ b/drivers/mtd/nand/raw/Kconfig
> > @@ -464,7 +464,7 @@ config MTD_NAND_NUVOTON_MA35
> >
> >  config MTD_NAND_LOONGSON
> >       tristate "Loongson NAND controller"
> > -     depends on LOONGSON1_APB_DMA || COMPILE_TEST
> > +     depends on LOONGSON1_APB_DMA || LOONGSON2_APB_DMA || COMPILE_TEST
>
> Why is this dependency necessary? I think the DMA operations are done
> through DMAengine API, and thus the consumer decouples with the DMA
> provider. If so, I think the depends line should be removed, instead of
> extended.

This is an existing execution dependency. Although there is no
guarantee that it will work with other DMA engines in the future, only
this combination has been tested and proven to be correct at present.
Therefore, I would still like to retain this dependency.
>
> Regards,
> Yao Zi
>
> >       select REGMAP_MMIO
> >       help
> >         Enables support for NAND controller on Loongson family chips.


-- 
Thanks.
Binbin



More information about the linux-mtd mailing list