linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: gregory.clement@free-electrons.com (Gregory CLEMENT)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] arm64: dts: marvell: add NAND support on the 7040-DB board
Date: Mon, 25 Sep 2017 17:06:41 +0200	[thread overview]
Message-ID: <874lrqkebi.fsf@free-electrons.com> (raw)
In-Reply-To: <20170925145352.13145-4-miquel.raynal@free-electrons.com> (Miquel Raynal's message of "Mon, 25 Sep 2017 16:53:52 +0200")

Hi Miquel,
 
 On lun., sept. 25 2017, Miquel Raynal <miquel.raynal@free-electrons.com> wrote:

> From: Gregory CLEMENT <gregory.clement@free-electrons.com>
>
> The NAND controller used in A7K/A8K is present on the CP110 master part.
> It is compatible with the pxa3xx_nand driver but requires the use of the
> marvell,armada-8k-nand compatible string due to the need to first enable
> the NAND controller.
>
> Add properties to the NAND node to fit the bindings constraints of the
> pxa3xx_nand driver and enable the NAND controller.
>
> Add the 'marvell,system-controller' property to the cp110 master NAND
> node with a reference to the syscon node. This is new compared to other
> boards using the pxa3xx_nand driver and it is needed to be bootloader
> independent and enable the NAND controller from the NAND controller
> driver itself by writing in these syscon registers.
>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> [miquel.raynal at free-electrons.com: add NAND ready/busy MPP subnode,
> change compatible string to fit the needs of the A7k/A8k SoCs and add
> the system controller property]
> Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
> ---
>  arch/arm64/boot/dts/marvell/armada-7040-db.dts     | 24 ++++++++++++++++++++++
>  arch/arm64/boot/dts/marvell/armada-70x0.dtsi       | 14 +++++++++++++
>  .../boot/dts/marvell/armada-cp110-master.dtsi      |  3 ++-
>  3 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-7040-db.dts b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> index 9c3bdf87e543..b98cf265bae5 100644
> --- a/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> @@ -144,6 +144,30 @@
>  	};
>  };
>  
> +&cpm_nand {
> +	status = "okay";
> +	num-cs = <1>;
> +	pinctrl-0 = <&nand_pins>, <&nand_rb>;
> +	pinctrl-names = "default";
> +	nand-ecc-strength = <4>;
> +	nand-ecc-step-size = <512>;
> +	marvell,nand-enable-arbiter;
> +	nand-on-flash-bbt;
> +
> +	partition at 0 {
> +		label = "U-Boot";
> +		reg = <0 0x200000>;
> +	};
> +	partition at 200000 {
> +		label = "Linux";
> +		reg = <0x200000 0xe00000>;
> +	};
> +	partition at 1000000 {
> +		label = "Filesystem";
> +		reg = <0x1000000 0x3f000000>;
> +	};
> +};
> +
>  &cpm_spi1 {
>  	status = "okay";
>  
> diff --git a/arch/arm64/boot/dts/marvell/armada-70x0.dtsi b/arch/arm64/boot/dts/marvell/armada-70x0.dtsi
> index 860b6ae9dcc5..0e1a1e5be399 100644
> --- a/arch/arm64/boot/dts/marvell/armada-70x0.dtsi
> +++ b/arch/arm64/boot/dts/marvell/armada-70x0.dtsi
> @@ -64,5 +64,19 @@
>  &cpm_syscon0 {
>  	cpm_pinctrl: pinctrl {
>  		compatible = "marvell,armada-7k-pinctrl";
> +
> +		nand_pins: nand-pins {
> +			marvell,pins =
> +			"mpp15", "mpp16", "mpp17", "mpp18",
> +			"mpp19", "mpp20", "mpp21", "mpp22",
> +			"mpp23", "mpp24", "mpp25", "mpp26",
> +			"mpp27";
> +			marvell,function = "dev";
> +		};
> +
> +		nand_rb: nand-rb {
> +			marvell,pins = "mpp13";
> +			marvell,function = "nf";
> +		};
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
> index 8263a8a504a8..d41b41b613ec 100644
> --- a/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
> +++ b/arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
> @@ -274,12 +274,13 @@
>  				 * this controller is only usable on the CPM
>  				 * for A7K and on the CPS for A8K.
>  				 */
> -				compatible = "marvell,armada370-nand";
> +				compatible = "marvell,armada-8k-nand";

the controller on cp110 remains compatible with the one on Armada 370
(even if it needs more initialization steps), so we should keep it also
and having instead the following line:

compatible = "marvell,armada-8k-nand", "marvell,armada370-nand";

You don't have to send a new version, unless someone is against it, I
will amend it when applying on the mvebu branches.

Thanks,

Gregory


>  				reg = <0x720000 0x54>;
>  				#address-cells = <1>;
>  				#size-cells = <1>;
>  				interrupts = <ICU_GRP_NSR 115 IRQ_TYPE_LEVEL_HIGH>;
>  				clocks = <&cpm_clk 1 2>;
> +				marvell,system-controller = <&cpm_syscon0>;
>  				status = "disabled";
>  			};
>  
> -- 
> 2.11.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2017-09-25 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25 14:53 [PATCH 0/3] Enable NAND on Armada-7040-DB board Miquel Raynal
2017-09-25 14:53 ` [PATCH 1/3] Documentation: devicetree: add pxa3xx compatible and syscon property Miquel Raynal
2017-09-25 14:53 ` [PATCH 2/3] mtd: nand: pxa3xx: enable NAND controller if the SoC needs it Miquel Raynal
2017-09-25 14:53 ` [PATCH 3/3] arm64: dts: marvell: add NAND support on the 7040-DB board Miquel Raynal
2017-09-25 15:06   ` Gregory CLEMENT [this message]
2017-10-12 14:30     ` Gregory CLEMENT
2017-10-05 12:53 ` [PATCH 0/3] Enable NAND on Armada-7040-DB board Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lrqkebi.fsf@free-electrons.com \
    --to=gregory.clement@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).