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

Yao Zi ziyao at disroot.org
Mon Aug 11 11:09:45 PDT 2025


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.

Regards,
Yao Zi

>  	select REGMAP_MMIO
>  	help
>  	  Enables support for NAND controller on Loongson family chips.



More information about the linux-mtd mailing list