]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: rawnand: loongson: Add nand chip select support
authorBinbin Zhou <zhoubinbin@loongson.cn>
Thu, 4 Sep 2025 13:06:35 +0000 (21:06 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 10 Sep 2025 08:56:09 +0000 (10:56 +0200)
commit7ad5bdf88d7295c295a363a5daf481b283acedc2
tree78be82c5285a51b1a9daed7f6be3264249e44e19
parentfb1dd6b6722b5187a4fa7385d0be60b28c0f9936
mtd: rawnand: loongson: Add nand chip select support

The page address register describes the page address of the starting
address for NAND read/write/erase operations.

According to the manual, it consists of two parts:
{chip select, page number}

The `chip select` is fixed at 2 bits, and the `page number` is
determined based on the actual capacity of the single-chip memory.
Therefore we need to determine the `chip select` bits base on the `page
number`.

For example, for a 1GB capacity chip (2K page size), it has 1M pages.
Thus, [19:0] is used to represent the page number, and [21:20]
represents the chip select.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/loongson-nand-controller.c