Skip to content

Commit 5ec9faa

Browse files
author
Hu Yeqing
committed
mtd: rawnand: Add Phytium NAND flash controller support
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]>
1 parent 255e26b commit 5ec9faa

File tree

7 files changed

+2891
-0
lines changed

7 files changed

+2891
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/phytium,nfc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Phytium Nand Flash controller
8+
9+
maintainers:
10+
- Chen Baozi <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: phytium,nfc
15+
16+
reg:
17+
maxItems: 1
18+
19+
interrupts:
20+
maxItems: 1
21+
22+
nand-ecc-strength:
23+
const: 8
24+
25+
nand-ecc-step-size:
26+
const: 512
27+
28+
allOf:
29+
- $ref: "nand-controller.yaml#"
30+
31+
required:
32+
- compatible
33+
- reg
34+
- interrupts
35+
36+
examples:
37+
- |
38+
nand0: nand@28002000 {
39+
compatible = "phytium,nfc";
40+
reg = <0x0 0x28002000 0x0 0x1000>;
41+
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
42+
};

drivers/mtd/nand/raw/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,25 @@ config MTD_NAND_ORION
150150
No board specific support is done by this driver, each board
151151
must advertise a platform_device for the driver to attach.
152152

153+
config MTD_NAND_PHYTIUM
154+
tristate
155+
156+
config MTD_NAND_PHYTIUM_PCI
157+
tristate "Support Phytium NAND controller as a PCI device"
158+
select MTD_NAND_PHYTIUM
159+
depends on PCI
160+
help
161+
Enable the driver for NAND flash controller of Phytium Px210 chipset,
162+
using the Phytium NAND controller core.
163+
164+
config MTD_NAND_PHYTIUM_PLAT
165+
tristate "Support Phytium NAND controller as a platform device"
166+
select MTD_NAND_PHYTIUM
167+
depends on ARCH_PHYTIUM
168+
help
169+
Enable the driver for NAND flash controller of Phytium CPU chipset,
170+
using the Phytium NAND controller core.
171+
153172
config MTD_NAND_MARVELL
154173
tristate "Marvell EBU NAND controller"
155174
depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU || \

drivers/mtd/nand/raw/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ obj-$(CONFIG_MTD_NAND_INTEL_LGM) += intel-nand-controller.o
5757
obj-$(CONFIG_MTD_NAND_ROCKCHIP) += rockchip-nand-controller.o
5858
obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-nand-controller.o
5959
obj-$(CONFIG_MTD_NAND_RENESAS) += renesas-nand-controller.o
60+
obj-$(CONFIG_MTD_NAND_PHYTIUM) += phytium_nand.o
61+
obj-$(CONFIG_MTD_NAND_PHYTIUM_PCI) += phytium_nand_pci.o
62+
obj-$(CONFIG_MTD_NAND_PHYTIUM_PLAT) += phytium_nand_plat.o
6063

6164
nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
6265
nand-objs += nand_onfi.o

0 commit comments

Comments
 (0)