Skip to content

Commit

Permalink
mtd: rawnand: Add Phytium NAND flash controller support
Browse files Browse the repository at this point in the history
This patch implements a device driver of NAND flash controller
for both Phytium PCIe chipset and SoCs. Since interrupt flags
depends on the bus implementation, e.g., PCI vs platform,
we extract the interrupt register function from NFC driver core.

Signed-off-by: Zhu Mingshuai <[email protected]>
Signed-off-by: Zhou Yulin <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
Signed-off-by: Hu Yeqing <[email protected]>
  • Loading branch information
Hu Yeqing committed May 23, 2024
1 parent 255e26b commit 12e20f8
Show file tree
Hide file tree
Showing 7 changed files with 2,890 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Documentation/devicetree/bindings/mtd/phytium,nfc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/phytium,nfc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Phytium Nand Flash controller

maintainers:
- Chen Baozi <[email protected]>

properties:
compatible:
const: phytium,nfc

reg:
maxItems: 1

interrupts:
maxItems: 1

nand-ecc-strength:
const: 8

nand-ecc-step-size:
const: 512

allOf:
- $ref: "nand-controller.yaml#"

required:
- compatible
- reg
- interrupts

examples:
- |
nand0: nand@28002000 {
compatible = "phytium,nfc";
reg = <0x0 0x28002000 0x0 0x1000>;
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
};
19 changes: 19 additions & 0 deletions drivers/mtd/nand/raw/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,25 @@ config MTD_NAND_ORION
No board specific support is done by this driver, each board
must advertise a platform_device for the driver to attach.

config MTD_NAND_PHYTIUM
tristate

config MTD_NAND_PHYTIUM_PCI
tristate "Support Phytium NAND controller as a PCI device"
select MTD_NAND_PHYTIUM
depends on PCI
help
Enable the driver for NAND flash controller of Phytium Px210 chipset,
using the Phytium NAND controller core.

config MTD_NAND_PHYTIUM_PLAT
tristate "Support Phytium NAND controller as a platform device"
select MTD_NAND_PHYTIUM
depends on ARCH_PHYTIUM
help
Enable the driver for NAND flash controller of Phytium CPU chipset,
using the Phytium NAND controller core.

config MTD_NAND_MARVELL
tristate "Marvell EBU NAND controller"
depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU || \
Expand Down
3 changes: 3 additions & 0 deletions drivers/mtd/nand/raw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ obj-$(CONFIG_MTD_NAND_INTEL_LGM) += intel-nand-controller.o
obj-$(CONFIG_MTD_NAND_ROCKCHIP) += rockchip-nand-controller.o
obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-nand-controller.o
obj-$(CONFIG_MTD_NAND_RENESAS) += renesas-nand-controller.o
obj-$(CONFIG_MTD_NAND_PHYTIUM) += phytium_nand.o
obj-$(CONFIG_MTD_NAND_PHYTIUM_PCI) += phytium_nand_pci.o
obj-$(CONFIG_MTD_NAND_PHYTIUM_PLAT) += phytium_nand_plat.o

nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
nand-objs += nand_onfi.o
Expand Down
Loading

0 comments on commit 12e20f8

Please sign in to comment.