2020-12-10 00:28:44

by Yifeng Zhao

[permalink] [raw]
Subject: [PATCH v16 0/8] Add Rockchip NFC drivers for RK3308 and others


Rockchp's NFC(Nand Flash Controller) has four versions: V600, V622, V800 and
V900.This series patch can support all four versions.


Changes in v16:
- Fix some comments about 'ret' variable.

Changes in v15:
- Use a buffer pointer nfc->page_buf instead of the original two pointers.
- Fix coding style.
- Fix some comments.

Changes in v14:
- Add oob_read and oob_write hook api.
- Support timing config and ecc config for each chips.
- Fix some comments.

Changes in v13:
- The nfc->buffer will realloc while the page size of the second mtd
is large than the first one.
- Fix coding style.
- Fix some comments.

Changes in v12:
- Fix some warnings while make dt_binding_check
- Drop a allOf defined

Changes in v11:
- Fix compile error.

Changes in v10:
- Fix compile error on master v5.9-rc7.

Changes in v9:
- The nfc->buffer will realloc while the page size of the second mtd
is large than the first one
- Fix coding style.
- Remove struct rk_nfc_clk.
- Prepend some function with rk_nfc_.
- Replace function readl_poll_timeout_atomic with readl_relaxed_poll_timeout.
- Remove function rk_nfc_read_byte and rk_nfc_write_byte.
- Don't select the die if 'check_only == true' in function rk_nfc_exec_op.
- Modify function rk_nfc_write_page and rk_nfc_write_page_raw.

Changes in v8:
- Fix a error while make dt_binding_check

Changes in v7:
- Fix some wrong define
- Rebase to linux-next.
- Fix coding style.
- Reserved 4 bytes at the beginning of the oob area.
- Page raw read and write included ecc data.

Changes in v6:
- Fix some wrong define
- Modified the definition of compatible
- The mtd->name set by NAND label property.
- Add some comments.
- Fix compile error.

Changes in v5:
- Fix some wrong define.
- Add boot-medium define.
- Remove some compatible define.
- Add boot blocks support with different ECC for bootROM.
- Rename rockchip-nand.c to rockchip-nand-controller.c.
- Unification of other variable names.
- Remove some compatible define.

Changes in v4:
- The compatible define with rkxx_nfc.
- Add assigned-clocks.
- Fix some wrong defineChanges in.
- Define platform data structure for the register offsets.
- The compatible define with rkxx_nfc.
- Use SET_SYSTEM_SLEEP_PM_OPS to define PM_OPS.
- Use exec_op instead of legacy hooks.

Changes in v3:
- Change the title for the dt-bindings.

Changes in v2:
- Fix compile error.
- Include header files sorted by file name.

Yifeng Zhao (8):
dt-bindings: mtd: Describe Rockchip RK3xxx NAND flash controller
mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others
MAINTAINERS: add maintainers to ROCKCHIP NFC
arm64: dts: rockchip: Add NFC node for RK3308 SoC
arm64: dts: rockchip: Add NFC node for PX30 SoC
arm: dts: rockchip: Add NFC node for RV1108 SoC
arm: dts: rockchip: Add NFC node for RK2928 and other SoCs
arm: dts: rockchip: Add NFC node for RK3036 SoC

.../mtd/rockchip,nand-controller.yaml | 161 ++
MAINTAINERS | 4 +-
arch/arm/boot/dts/rk3036.dtsi | 52 +
arch/arm/boot/dts/rk3xxx.dtsi | 9 +
arch/arm/boot/dts/rv1108.dtsi | 11 +
arch/arm64/boot/dts/rockchip/px30.dtsi | 15 +
arch/arm64/boot/dts/rockchip/rk3308.dtsi | 15 +
drivers/mtd/nand/raw/Kconfig | 12 +
drivers/mtd/nand/raw/Makefile | 1 +
.../mtd/nand/raw/rockchip-nand-controller.c | 1495 +++++++++++++++++
10 files changed, 1773 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mtd/rockchip,nand-controller.yaml
create mode 100644 drivers/mtd/nand/raw/rockchip-nand-controller.c

--
2.17.1




2020-12-10 00:30:19

by Yifeng Zhao

[permalink] [raw]
Subject: [PATCH v16 5/8] arm64: dts: rockchip: Add NFC node for PX30 SoC

Add NAND FLASH Controller(NFC) node for PX30 SoC.

Signed-off-by: Yifeng Zhao <[email protected]>
---

Changes in v16: None
Changes in v15: None
Changes in v14: None
Changes in v13: None
Changes in v12: None
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

arch/arm64/boot/dts/rockchip/px30.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
index 2695ea8cda14..6cd67e80d623 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -973,6 +973,21 @@
status = "disabled";
};

+ nfc: nand-controller@ff3b0000 {
+ compatible = "rockchip,px30-nfc";
+ reg = <0x0 0xff3b0000 0x0 0x4000>;
+ interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru HCLK_NANDC>, <&cru SCLK_NANDC>;
+ clock-names = "ahb", "nfc";
+ assigned-clocks = <&cru SCLK_NANDC>;
+ assigned-clock-rates = <150000000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&flash_ale &flash_bus8 &flash_cle &flash_cs0
+ &flash_rdn &flash_rdy &flash_wrn &flash_dqs>;
+ power-domains = <&power PX30_PD_MMC_NAND>;
+ status = "disabled";
+ };
+
gpu: gpu@ff400000 {
compatible = "rockchip,px30-mali", "arm,mali-bifrost";
reg = <0x0 0xff400000 0x0 0x4000>;
--
2.17.1



2020-12-10 00:32:26

by Yifeng Zhao

[permalink] [raw]
Subject: [PATCH v16 6/8] arm: dts: rockchip: Add NFC node for RV1108 SoC

Add NAND FLASH Controller(NFC) node for RV1108 SoC.

Signed-off-by: Yifeng Zhao <[email protected]>
---

Changes in v16: None
Changes in v15: None
Changes in v14: None
Changes in v13: None
Changes in v12: None
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

arch/arm/boot/dts/rv1108.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/rv1108.dtsi b/arch/arm/boot/dts/rv1108.dtsi
index a1a08cb9364e..1696ea19488b 100644
--- a/arch/arm/boot/dts/rv1108.dtsi
+++ b/arch/arm/boot/dts/rv1108.dtsi
@@ -452,6 +452,17 @@
#reset-cells = <1>;
};

+ nfc: nand-controller@30100000 {
+ compatible = "rockchip,rv1108-nfc";
+ reg = <0x30100000 0x1000>;
+ interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru HCLK_NANDC>, <&cru SCLK_NANDC>;
+ clock-names = "ahb", "nfc";
+ assigned-clocks = <&cru SCLK_NANDC>;
+ assigned-clock-rates = <150000000>;
+ status = "disabled";
+ };
+
emmc: mmc@30110000 {
compatible = "rockchip,rv1108-dw-mshc", "rockchip,rk3288-dw-mshc";
reg = <0x30110000 0x4000>;
--
2.17.1



2020-12-10 06:01:46

by Yifeng Zhao

[permalink] [raw]
Subject: [PATCH v16 4/8] arm64: dts: rockchip: Add NFC node for RK3308 SoC

Add NAND FLASH Controller(NFC) node for RK3308 SoC.

Signed-off-by: Yifeng Zhao <[email protected]>
---

Changes in v16: None
Changes in v15: None
Changes in v14: None
Changes in v13: None
Changes in v12: None
Changes in v11: None
Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

arch/arm64/boot/dts/rockchip/rk3308.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3308.dtsi b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
index b3118cabd0f6..f6b4d47089b5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3308.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3308.dtsi
@@ -629,6 +629,21 @@
status = "disabled";
};

+ nfc: nand-controller@ff4b0000 {
+ compatible = "rockchip,rk3308-nfc",
+ "rockchip,rv1108-nfc";
+ reg = <0x0 0xff4b0000 0x0 0x4000>;
+ interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cru HCLK_NANDC>, <&cru SCLK_NANDC>;
+ clock-names = "ahb", "nfc";
+ assigned-clocks = <&cru SCLK_NANDC>;
+ assigned-clock-rates = <150000000>;
+ pinctrl-0 = <&flash_ale &flash_bus8 &flash_cle &flash_csn0
+ &flash_rdn &flash_rdy &flash_wrn>;
+ pinctrl-names = "default";
+ status = "disabled";
+ };
+
cru: clock-controller@ff500000 {
compatible = "rockchip,rk3308-cru";
reg = <0x0 0xff500000 0x0 0x1000>;
--
2.17.1



2021-01-18 13:08:54

by Heiko Stübner

[permalink] [raw]
Subject: Re: (subset) [PATCH v16 0/8] Add Rockchip NFC drivers for RK3308 and others

On Thu, 10 Dec 2020 08:21:30 +0800, Yifeng Zhao wrote:
> Rockchp's NFC(Nand Flash Controller) has four versions: V600, V622, V800 and
> V900.This series patch can support all four versions.
>
>
> Changes in v16:
> - Fix some comments about 'ret' variable.
>
> [...]

Applied, thanks!

[6/8] arm: dts: rockchip: Add NFC node for RV1108 SoC
commit: 2525f194f9dc07c48b0a12697128357068c2e04b
[7/8] arm: dts: rockchip: Add NFC node for RK2928 and other SoCs
commit: 9c2bfe53b2fc4a8a63311f162e80b27978db6c06
[8/8] arm: dts: rockchip: Add NFC node for RK3036 SoC
commit: 4cd9a03435bcd20ce6f524e3826fd263951c22fe

Best regards,
--
Heiko Stuebner <[email protected]>

2021-01-18 13:09:09

by Heiko Stübner

[permalink] [raw]
Subject: Re: (subset) [PATCH v16 0/8] Add Rockchip NFC drivers for RK3308 and others

Am Montag, 18. Januar 2021, 13:57:36 CET schrieb Heiko Stuebner:
> On Thu, 10 Dec 2020 08:21:30 +0800, Yifeng Zhao wrote:
> > Rockchp's NFC(Nand Flash Controller) has four versions: V600, V622, V800 and
> > V900.This series patch can support all four versions.
> >
> >
> > Changes in v16:
> > - Fix some comments about 'ret' variable.
> >
> > [...]
>
> Applied, thanks!
>
> [6/8] arm: dts: rockchip: Add NFC node for RV1108 SoC
> commit: 2525f194f9dc07c48b0a12697128357068c2e04b
> [7/8] arm: dts: rockchip: Add NFC node for RK2928 and other SoCs
> commit: 9c2bfe53b2fc4a8a63311f162e80b27978db6c06
> [8/8] arm: dts: rockchip: Add NFC node for RK3036 SoC
> commit: 4cd9a03435bcd20ce6f524e3826fd263951c22fe

I of course also applied patches 4-5 (arm32) in
- https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/commit/?h=v5.12-armsoc/dts32&id=2525f194f9dc07c48b0a12697128357068c2e04b
- https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/commit/?h=v5.12-armsoc/dts32&id=9c2bfe53b2fc4a8a63311f162e80b27978db6c06

just b4 seemed to hickup with my 2 fetches for arm32+arm64.


Heiko