From 5cde94d9ab577c5ab68fc71e15a05d1bda5041f2 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 24 Sep 2016 01:14:53 +0200 Subject: oxnas: backport upstream NAND driver Signed-off-by: Daniel Golle --- .../oxnas/files/arch/arm/boot/dts/ox820-akitio.dts | 30 +++++++--- .../oxnas/files/arch/arm/boot/dts/ox820-kd20.dts | 70 ++++++++++++---------- .../files/arch/arm/boot/dts/ox820-pogoplug-pro.dts | 38 +++++++----- .../files/arch/arm/boot/dts/ox820-pogoplug-v3.dts | 38 +++++++----- .../oxnas/files/arch/arm/boot/dts/ox820-stg212.dts | 37 +++++++----- .../linux/oxnas/files/arch/arm/boot/dts/ox820.dtsi | 9 ++- 6 files changed, 133 insertions(+), 89 deletions(-) (limited to 'target/linux/oxnas/files/arch/arm/boot/dts') diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts index 712c03e..5f7c2a1 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio.dts @@ -34,15 +34,6 @@ nand@41000000 { status = "okay"; - partition@0 { - label = "boot"; - reg = <0x0 0x26c0000>; - }; - - partition@26c0000 { - label = "ubi"; - reg = <0x26c0000 0xd940000>; - }; }; ethernet@40400000 { @@ -132,3 +123,24 @@ }; }; }; + +&nandc { + status = "okay"; + + nand@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + nand-ecc-mode = "soft"; + nand-ecc-algo = "hamming"; + + partition@0 { + label = "boot"; + reg = <0x00000000 0x026c0000>; + }; + + partition@26c0000 { + label = "ubi"; + reg = <0x026c0000 0x0d940000>; + }; +}; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts index 1312fd6..a59addc 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-kd20.dts @@ -31,37 +31,6 @@ nr-ports = <2>; }; - nand@41000000 { - status = "okay"; - - partition@0 { - label = "stage1"; - reg = <0x00000000 0x00040000>; - read-only; - }; - - partition@40000 { - label = "u-boot"; - reg = <0x00040000 0x00200000>; - read-only; - }; - - partition@240000 { - label = "initrd"; - reg = <0x00240000 0x00600000>; - }; - - partition@840000 { - label = "kernel"; - reg = <0x00840000 0x007C0000>; - }; - - partition@e00000 { - label = "ubi"; - reg = <0x01000000 0x07000000>; - }; - }; - ethernet@40400000 { status = "okay"; snps,phy-addr = <1>; @@ -163,3 +132,42 @@ gpios = <&GPIOA 9 0>; }; }; + +&nandc { + status = "okay"; + + nand@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + nand-ecc-mode = "soft"; + nand-ecc-algo = "hamming"; + + partition@0 { + label = "stage1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + + partition@40000 { + label = "u-boot"; + reg = <0x00040000 0x00200000>; + read-only; + }; + + partition@240000 { + label = "initrd"; + reg = <0x00240000 0x00600000>; + }; + + partition@840000 { + label = "kernel"; + reg = <0x00840000 0x007C0000>; + }; + + partition@e00000 { + label = "ubi"; + reg = <0x01000000 0x07000000>; + }; + }; +}; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-pro.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-pro.dts index f3730c3..5b087e9 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-pro.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-pro.dts @@ -28,21 +28,6 @@ status = "okay"; }; - nand@41000000 { - status = "okay"; - - partition@0 { - label = "boot"; - reg = <0x00000000 0x00e00000>; - /*read-only;*/ - }; - - partition@e00000 { - label = "ubi"; - reg = <0x00e00000 0x07200000>; - }; - }; - ethernet@40400000 { status = "okay"; }; @@ -84,3 +69,26 @@ }; }; }; + +&nandc { + status = "okay"; + + nand@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + nand-ecc-mode = "soft"; + nand-ecc-algo = "hamming"; + + partition@0 { + label = "boot"; + reg = <0x00000000 0x00e00000>; + /*read-only;*/ + }; + + partition@e00000 { + label = "ubi"; + reg = <0x00e00000 0x07200000>; + }; + }; +}; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-v3.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-v3.dts index 8029132..be0f6c9 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-v3.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-pogoplug-v3.dts @@ -25,21 +25,6 @@ status = "okay"; }; - nand@41000000 { - status = "okay"; - - partition@0 { - label = "boot"; - reg = <0x00000000 0x00e00000>; - /*read-only;*/ - }; - - partition@e00000 { - label = "ubi"; - reg = <0x00e00000 0x07200000>; - }; - }; - ethernet@40400000 { status = "okay"; }; @@ -81,3 +66,26 @@ }; }; + +&nandc { + status = "okay"; + + nand@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + nand-ecc-mode = "soft"; + nand-ecc-algo = "hamming"; + + partition@0 { + label = "boot"; + reg = <0x00000000 0x00e00000>; + /*read-only;*/ + }; + + partition@e00000 { + label = "ubi"; + reg = <0x00e00000 0x07200000>; + }; + }; +}; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts index a8112c9..ad93d4e 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-stg212.dts @@ -27,20 +27,6 @@ status = "okay"; }; - nand@41000000 { - status = "okay"; - - partition@0 { - label = "boot"; - reg = <0x00000000 0x00e00000>; - /*read-only;*/ - }; - - partition@e00000 { - label = "ubi"; - reg = <0x00e00000 0x07200000>; - }; - }; ethernet@40400000 { status = "okay"; @@ -91,3 +77,26 @@ }; }; + +&nandc { + status = "okay"; + + nand@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + nand-ecc-mode = "soft"; + nand-ecc-algo = "hamming"; + + partition@0 { + label = "boot"; + reg = <0x00000000 0x00e00000>; + read-only; + }; + + partition@e00000 { + label = "ubi"; + reg = <0x00e00000 0x07200000>; + }; + }; +}; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820.dtsi b/target/linux/oxnas/files/arch/arm/boot/dts/ox820.dtsi index 4ba4b8b..c096a7d 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820.dtsi +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820.dtsi @@ -298,16 +298,15 @@ status = "disabled"; }; - nand@41000000 { - compatible = "plxtech,nand-nas782x", "gen_nand"; - reg = <0x41000000 0x100000>, <0x41C00000 0x20>; - nand-ecc-mode = "soft"; + nandc: nand-controller@41000000 { + compatible = "oxsemi,ox820-nand"; + reg = <0x41000000 0x100000>; clocks = <&stdclk 9>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_nand0>; resets = <&rst 15>; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; status = "disabled"; }; -- cgit v1.1