diff mbox series

[U-Boot,v1,2/9] arm: dts: imx7: colibri: split dt for raw NAND and eMMC devices

Message ID 20190106210049.30918-3-stefan@agner.ch
State Superseded
Delegated to: Stefano Babic
Headers show
Series arm: Colibri iMX7 fixes and DM_MMC conversion | expand

Commit Message

Stefan Agner Jan. 6, 2019, 9 p.m. UTC
From: Stefan Agner <stefan.agner@toradex.com>

In preparation of adding CONFIG_DM_MMC support use separate device
trees for raw NAND and eMMC devices.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
---

 arch/arm/dts/imx7-colibri-emmc.dts            | 16 +++++++
 arch/arm/dts/imx7-colibri-rawnand.dts         | 46 +++++++++++++++++++
 .../{imx7-colibri.dts => imx7-colibri.dtsi}   | 39 +---------------
 board/toradex/colibri_imx7/MAINTAINERS        |  3 ++
 configs/colibri_imx7_defconfig                |  2 +-
 5 files changed, 67 insertions(+), 39 deletions(-)
 create mode 100644 arch/arm/dts/imx7-colibri-emmc.dts
 create mode 100644 arch/arm/dts/imx7-colibri-rawnand.dts
 rename arch/arm/dts/{imx7-colibri.dts => imx7-colibri.dtsi} (65%)

Comments

Marcel Ziswiler Jan. 6, 2019, 11:18 p.m. UTC | #1
On Sun, 2019-01-06 at 22:00 +0100, Stefan Agner wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
> 
> In preparation of adding CONFIG_DM_MMC support use separate device
> trees for raw NAND and eMMC devices.
> 
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> ---
> 
>  arch/arm/dts/imx7-colibri-emmc.dts            | 16 +++++++
>  arch/arm/dts/imx7-colibri-rawnand.dts         | 46
> +++++++++++++++++++
>  .../{imx7-colibri.dts => imx7-colibri.dtsi}   | 39 +---------------

I believe renaming that one also needs changes in resp. Makefile
otherwise leading to the following:

make[3]: *** No rule to make target 'arch/arm/dts/imx7-colibri.dtb',
needed by 'dtbs'.  Stop.

Plus you may want to add the eMMC one as well e.g. as follows:

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index dda4e59491..9596b2a64f 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -458,7 +458,8 @@ dtb-$(CONFIG_MX6UL) += \
 
 dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
 
-dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
+dtb-$(CONFIG_MX7) += imx7-colibri-emmc.dtb \
+       imx7-colibri-rawnand.dtb \
        imx7d-sdb.dtb \
        imx7d-sdb-qspi.dtb

BTW: Remember, I am not too big of a fan of renaming stuff and
everywhere else we so far did not call anything -rawnand as of yet.
However, in general I agree that this would be more clear and if you do
clean-up the rest of the world(TM) in a similar fashion I am OK with
it.

>  board/toradex/colibri_imx7/MAINTAINERS        |  3 ++
>  configs/colibri_imx7_defconfig                |  2 +-
>  5 files changed, 67 insertions(+), 39 deletions(-)
>  create mode 100644 arch/arm/dts/imx7-colibri-emmc.dts
>  create mode 100644 arch/arm/dts/imx7-colibri-rawnand.dts
>  rename arch/arm/dts/{imx7-colibri.dts => imx7-colibri.dtsi} (65%)
> 
> diff --git a/arch/arm/dts/imx7-colibri-emmc.dts b/arch/arm/dts/imx7-
> colibri-emmc.dts
> new file mode 100644
> index 0000000000..295ca05916
> --- /dev/null
> +++ b/arch/arm/dts/imx7-colibri-emmc.dts
> @@ -0,0 +1,16 @@
> +// SPDX-License-Identifier: GPL-2.0+ OR X11

Don't we rather want GPL-2.0 OR MIT?

> +/*
> + * Copyright 2019 Toradex AG
> + */
> +
> +/dts-v1/;
> +#include "imx7-colibri.dtsi"
> +
> +/ {
> +	model = "Toradex Colibri iMX7D 1GB (eMMC)";
> +	compatible = "toradex,imx7d-colibri-emmc", "fsl,imx7d";
> +
> +	chosen {
> +		stdout-path = &uart1;
> +	};
> +};

I guess the meat-on-the-bone will follow (;-p).

> diff --git a/arch/arm/dts/imx7-colibri-rawnand.dts
> b/arch/arm/dts/imx7-colibri-rawnand.dts
> new file mode 100644
> index 0000000000..4eb86fb011
> --- /dev/null
> +++ b/arch/arm/dts/imx7-colibri-rawnand.dts
> @@ -0,0 +1,46 @@
> +// SPDX-License-Identifier: GPL-2.0+ OR X11

Dito.

> +/*
> + * Copyright 2019 Toradex AG
> + */
> +
> +/dts-v1/;
> +#include "imx7-colibri.dtsi"
> +
> +/ {
> +	model = "Toradex Colibri iMX7S/D";
> +	compatible = "toradex,imx7-colibri", "fsl,imx7";
> +
> +	chosen {
> +		stdout-path = &uart1;
> +	};
> +};
> +
> +&gpmi {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_gpmi_nand>;
> +	,use-minimum-ecc;
> +	nand-on-flash-bbt;
> +	-ecc-mode = "hw";
> +	status = "okay";
> +};
> +
> +&iomuxc {
> +	pinctrl_gpmi_nand: gpmi-nand-grp {
> +		fsl,pins = <
> +			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
> +			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
> +			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
> +			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
> +			MX7D_PAD_SD3_STROBE__NAND_RE_B		0x71
> +			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0x71
> +			MX7D_PAD_SD3_DATA0__NAND_DATA00		0x71
> +			MX7D_PAD_SD3_DATA1__NAND_DATA01		0x71
> +			MX7D_PAD_SD3_DATA2__NAND_DATA02		0x71
> +			MX7D_PAD_SD3_DATA3__NAND_DATA03		0x71
> +			MX7D_PAD_SD3_DATA4__NAND_DATA04		0x71
> +			MX7D_PAD_SD3_DATA5__NAND_DATA05		0x71
> +			MX7D_PAD_SD3_DATA6__NAND_DATA06		0x71
> +			MX7D_PAD_SD3_DATA7__NAND_DATA07		0x71
> +		>;
> +	};
> +};
> diff --git a/arch/arm/dts/imx7-colibri.dts b/arch/arm/dts/imx7-
> colibri.dtsi
> similarity index 65%
> rename from arch/arm/dts/imx7-colibri.dts
> rename to arch/arm/dts/imx7-colibri.dtsi
> index dca501be25..47295117aa 100644
> --- a/arch/arm/dts/imx7-colibri.dts
> +++ b/arch/arm/dts/imx7-colibri.dtsi
> @@ -1,30 +1,12 @@
>  // SPDX-License-Identifier: GPL-2.0+ OR X11
>  /*
> - * Copyright 2016 Toradex AG
> + * Copyright 2016-2019 Toradex AG
>   */
>  
>  /dts-v1/;
>  #include <dt-bindings/gpio/gpio.h>
>  #include "imx7d.dtsi"
>  
> -/ {
> -	model = "Toradex Colibri iMX7S/D";
> -	compatible = "toradex,imx7-colibri", "fsl,imx7";
> -
> -	chosen {
> -		stdout-path = &uart1;
> -	};
> -};
> -
> -&gpmi {
> -	pinctrl-names = "default";
> -	pinctrl-0 = <&pinctrl_gpmi_nand>;
> -	fsl,use-minimum-ecc;
> -	nand-on-flash-bbt;
> -	nand-ecc-mode = "hw";
> -	status = "okay";
> -};
> -
>  &i2c1 {
>  	pinctrl-names = "default", "gpio";
>  	pinctrl-0 = <&pinctrl_i2c1>;
> @@ -57,25 +39,6 @@
>  };
>  
>  &iomuxc {
> -	pinctrl_gpmi_nand: gpmi-nand-grp {
> -		fsl,pins = <
> -			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
> -			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
> -			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
> -			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
> -			MX7D_PAD_SD3_STROBE__NAND_RE_B		0x71
> -			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0x71
> -			MX7D_PAD_SD3_DATA0__NAND_DATA00		0x71
> -			MX7D_PAD_SD3_DATA1__NAND_DATA01		0x71
> -			MX7D_PAD_SD3_DATA2__NAND_DATA02		0x71
> -			MX7D_PAD_SD3_DATA3__NAND_DATA03		0x71
> -			MX7D_PAD_SD3_DATA4__NAND_DATA04		0x71
> -			MX7D_PAD_SD3_DATA5__NAND_DATA05		0x71
> -			MX7D_PAD_SD3_DATA6__NAND_DATA06		0x71
> -			MX7D_PAD_SD3_DATA7__NAND_DATA07		0x71
> -		>;
> -	};
> -
>  	pinctrl_i2c4: i2c4-grp {
>  		fsl,pins = <
>  			MX7D_PAD_ENET1_RGMII_TD3__I2C4_SDA	0x400
> 0007f
> diff --git a/board/toradex/colibri_imx7/MAINTAINERS
> b/board/toradex/colibri_imx7/MAINTAINERS
> index 9c1d42aa8c..f55f8045f4 100644
> --- a/board/toradex/colibri_imx7/MAINTAINERS
> +++ b/board/toradex/colibri_imx7/MAINTAINERS
> @@ -8,3 +8,6 @@ F:	board/toradex/colibri_imx7/
>  F:	include/configs/colibri_imx7.h
>  F:	configs/colibri_imx7_defconfig
>  F:	configs/colibri_imx7_emmc_defconfig

I guess that one follows later as well (;-p).

> +F:	arch/arm/dts/imx7-colibri.dtsi
> +F:	arch/arm/dts/imx7-colibri-emmc.dts
> +F:	arch/arm/dts/imx7-colibri-rawnand.dts
> diff --git a/configs/colibri_imx7_defconfig
> b/configs/colibri_imx7_defconfig
> index 7b496bcea9..7441102ed4 100644
> --- a/configs/colibri_imx7_defconfig
> +++ b/configs/colibri_imx7_defconfig
> @@ -43,7 +43,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-
> nand:512k(mx7-bcb),1536k(u-boot1)ro,1536k
>  CONFIG_CMD_UBI=y
>  CONFIG_OF_CONTROL=y
>  CONFIG_OF_EMBED=y
> -CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri"
> +CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri-rawnand"
>  CONFIG_ENV_IS_IN_NAND=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_DFU_MMC=y
Stefan Agner Jan. 7, 2019, 4:33 p.m. UTC | #2
On 07.01.2019 00:18, Marcel Ziswiler wrote:
> On Sun, 2019-01-06 at 22:00 +0100, Stefan Agner wrote:
>> From: Stefan Agner <stefan.agner@toradex.com>
>>
>> In preparation of adding CONFIG_DM_MMC support use separate device
>> trees for raw NAND and eMMC devices.
>>
>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
>> ---
>>
>>  arch/arm/dts/imx7-colibri-emmc.dts            | 16 +++++++
>>  arch/arm/dts/imx7-colibri-rawnand.dts         | 46
>> +++++++++++++++++++
>>  .../{imx7-colibri.dts => imx7-colibri.dtsi}   | 39 +---------------
> 
> I believe renaming that one also needs changes in resp. Makefile
> otherwise leading to the following:
> 
> make[3]: *** No rule to make target 'arch/arm/dts/imx7-colibri.dtb',
> needed by 'dtbs'.  Stop.

Good catch, I definitely need to remove imx7-colibri.dtb there.

> 
> Plus you may want to add the eMMC one as well e.g. as follows:
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index dda4e59491..9596b2a64f 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -458,7 +458,8 @@ dtb-$(CONFIG_MX6UL) += \
>  
>  dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
>  
> -dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
> +dtb-$(CONFIG_MX7) += imx7-colibri-emmc.dtb \
> +       imx7-colibri-rawnand.dtb \
>         imx7d-sdb.dtb \
>         imx7d-sdb-qspi.dtb

It seems that removing is actually sufficient. dtc/Makefile along with
CONFIG_OF_EMBED actually builds the device tree specified in the config
file automatically. Should we still add board device trees to
arch/arm/dts/Makefile?

@Stefano/ML any preference?


> 
> BTW: Remember, I am not too big of a fan of renaming stuff and
> everywhere else we so far did not call anything -rawnand as of yet.
> However, in general I agree that this would be more clear and if you do
> clean-up the rest of the world(TM) in a similar fashion I am OK with
> it.
> 

I don't _re_name, I just name :-) When we had to name the dt's in the
kernel, we did not knew that there will be an eMMC variant. It's a
different start condition here.

Also mind that device trees are named differently: Since we use the same
boot loader for i.MX 7S and 7D, I dropped a letter there too... IMHO,
renaming the dt in Linux now is too much churn. So I suggest either
leave as is in Kernel and deviate a bit in U-Boot or drop -rawnand in
U-Boot, what do you think?

--
Stefan

>>  board/toradex/colibri_imx7/MAINTAINERS        |  3 ++
>>  configs/colibri_imx7_defconfig                |  2 +-
>>  5 files changed, 67 insertions(+), 39 deletions(-)
>>  create mode 100644 arch/arm/dts/imx7-colibri-emmc.dts
>>  create mode 100644 arch/arm/dts/imx7-colibri-rawnand.dts
>>  rename arch/arm/dts/{imx7-colibri.dts => imx7-colibri.dtsi} (65%)
>>
>> diff --git a/arch/arm/dts/imx7-colibri-emmc.dts b/arch/arm/dts/imx7-
>> colibri-emmc.dts
>> new file mode 100644
>> index 0000000000..295ca05916
>> --- /dev/null
>> +++ b/arch/arm/dts/imx7-colibri-emmc.dts
>> @@ -0,0 +1,16 @@
>> +// SPDX-License-Identifier: GPL-2.0+ OR X11
> 
> Don't we rather want GPL-2.0 OR MIT?
> 
>> +/*
>> + * Copyright 2019 Toradex AG
>> + */
>> +
>> +/dts-v1/;
>> +#include "imx7-colibri.dtsi"
>> +
>> +/ {
>> +	model = "Toradex Colibri iMX7D 1GB (eMMC)";
>> +	compatible = "toradex,imx7d-colibri-emmc", "fsl,imx7d";
>> +
>> +	chosen {
>> +		stdout-path = &uart1;
>> +	};
>> +};
> 
> I guess the meat-on-the-bone will follow (;-p).
> 
>> diff --git a/arch/arm/dts/imx7-colibri-rawnand.dts
>> b/arch/arm/dts/imx7-colibri-rawnand.dts
>> new file mode 100644
>> index 0000000000..4eb86fb011
>> --- /dev/null
>> +++ b/arch/arm/dts/imx7-colibri-rawnand.dts
>> @@ -0,0 +1,46 @@
>> +// SPDX-License-Identifier: GPL-2.0+ OR X11
> 
> Dito.
> 
>> +/*
>> + * Copyright 2019 Toradex AG
>> + */
>> +
>> +/dts-v1/;
>> +#include "imx7-colibri.dtsi"
>> +
>> +/ {
>> +	model = "Toradex Colibri iMX7S/D";
>> +	compatible = "toradex,imx7-colibri", "fsl,imx7";
>> +
>> +	chosen {
>> +		stdout-path = &uart1;
>> +	};
>> +};
>> +
>> +&gpmi {
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&pinctrl_gpmi_nand>;
>> +	,use-minimum-ecc;
>> +	nand-on-flash-bbt;
>> +	-ecc-mode = "hw";
>> +	status = "okay";
>> +};
>> +
>> +&iomuxc {
>> +	pinctrl_gpmi_nand: gpmi-nand-grp {
>> +		fsl,pins = <
>> +			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
>> +			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
>> +			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
>> +			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
>> +			MX7D_PAD_SD3_STROBE__NAND_RE_B		0x71
>> +			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0x71
>> +			MX7D_PAD_SD3_DATA0__NAND_DATA00		0x71
>> +			MX7D_PAD_SD3_DATA1__NAND_DATA01		0x71
>> +			MX7D_PAD_SD3_DATA2__NAND_DATA02		0x71
>> +			MX7D_PAD_SD3_DATA3__NAND_DATA03		0x71
>> +			MX7D_PAD_SD3_DATA4__NAND_DATA04		0x71
>> +			MX7D_PAD_SD3_DATA5__NAND_DATA05		0x71
>> +			MX7D_PAD_SD3_DATA6__NAND_DATA06		0x71
>> +			MX7D_PAD_SD3_DATA7__NAND_DATA07		0x71
>> +		>;
>> +	};
>> +};
>> diff --git a/arch/arm/dts/imx7-colibri.dts b/arch/arm/dts/imx7-
>> colibri.dtsi
>> similarity index 65%
>> rename from arch/arm/dts/imx7-colibri.dts
>> rename to arch/arm/dts/imx7-colibri.dtsi
>> index dca501be25..47295117aa 100644
>> --- a/arch/arm/dts/imx7-colibri.dts
>> +++ b/arch/arm/dts/imx7-colibri.dtsi
>> @@ -1,30 +1,12 @@
>>  // SPDX-License-Identifier: GPL-2.0+ OR X11
>>  /*
>> - * Copyright 2016 Toradex AG
>> + * Copyright 2016-2019 Toradex AG
>>   */
>>
>>  /dts-v1/;
>>  #include <dt-bindings/gpio/gpio.h>
>>  #include "imx7d.dtsi"
>>
>> -/ {
>> -	model = "Toradex Colibri iMX7S/D";
>> -	compatible = "toradex,imx7-colibri", "fsl,imx7";
>> -
>> -	chosen {
>> -		stdout-path = &uart1;
>> -	};
>> -};
>> -
>> -&gpmi {
>> -	pinctrl-names = "default";
>> -	pinctrl-0 = <&pinctrl_gpmi_nand>;
>> -	fsl,use-minimum-ecc;
>> -	nand-on-flash-bbt;
>> -	nand-ecc-mode = "hw";
>> -	status = "okay";
>> -};
>> -
>>  &i2c1 {
>>  	pinctrl-names = "default", "gpio";
>>  	pinctrl-0 = <&pinctrl_i2c1>;
>> @@ -57,25 +39,6 @@
>>  };
>>
>>  &iomuxc {
>> -	pinctrl_gpmi_nand: gpmi-nand-grp {
>> -		fsl,pins = <
>> -			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
>> -			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
>> -			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
>> -			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
>> -			MX7D_PAD_SD3_STROBE__NAND_RE_B		0x71
>> -			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0x71
>> -			MX7D_PAD_SD3_DATA0__NAND_DATA00		0x71
>> -			MX7D_PAD_SD3_DATA1__NAND_DATA01		0x71
>> -			MX7D_PAD_SD3_DATA2__NAND_DATA02		0x71
>> -			MX7D_PAD_SD3_DATA3__NAND_DATA03		0x71
>> -			MX7D_PAD_SD3_DATA4__NAND_DATA04		0x71
>> -			MX7D_PAD_SD3_DATA5__NAND_DATA05		0x71
>> -			MX7D_PAD_SD3_DATA6__NAND_DATA06		0x71
>> -			MX7D_PAD_SD3_DATA7__NAND_DATA07		0x71
>> -		>;
>> -	};
>> -
>>  	pinctrl_i2c4: i2c4-grp {
>>  		fsl,pins = <
>>  			MX7D_PAD_ENET1_RGMII_TD3__I2C4_SDA	0x400
>> 0007f
>> diff --git a/board/toradex/colibri_imx7/MAINTAINERS
>> b/board/toradex/colibri_imx7/MAINTAINERS
>> index 9c1d42aa8c..f55f8045f4 100644
>> --- a/board/toradex/colibri_imx7/MAINTAINERS
>> +++ b/board/toradex/colibri_imx7/MAINTAINERS
>> @@ -8,3 +8,6 @@ F:	board/toradex/colibri_imx7/
>>  F:	include/configs/colibri_imx7.h
>>  F:	configs/colibri_imx7_defconfig
>>  F:	configs/colibri_imx7_emmc_defconfig
> 
> I guess that one follows later as well (;-p).
> 
>> +F:	arch/arm/dts/imx7-colibri.dtsi
>> +F:	arch/arm/dts/imx7-colibri-emmc.dts
>> +F:	arch/arm/dts/imx7-colibri-rawnand.dts
>> diff --git a/configs/colibri_imx7_defconfig
>> b/configs/colibri_imx7_defconfig
>> index 7b496bcea9..7441102ed4 100644
>> --- a/configs/colibri_imx7_defconfig
>> +++ b/configs/colibri_imx7_defconfig
>> @@ -43,7 +43,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-
>> nand:512k(mx7-bcb),1536k(u-boot1)ro,1536k
>>  CONFIG_CMD_UBI=y
>>  CONFIG_OF_CONTROL=y
>>  CONFIG_OF_EMBED=y
>> -CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri"
>> +CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri-rawnand"
>>  CONFIG_ENV_IS_IN_NAND=y
>>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>>  CONFIG_DFU_MMC=y
Marcel Ziswiler Jan. 7, 2019, 8:21 p.m. UTC | #3
On Mon, 2019-01-07 at 17:33 +0100, Stefan Agner wrote:
> On 07.01.2019 00:18, Marcel Ziswiler wrote:
> > On Sun, 2019-01-06 at 22:00 +0100, Stefan Agner wrote:
> > > From: Stefan Agner <stefan.agner@toradex.com>
> > > 
> > > In preparation of adding CONFIG_DM_MMC support use separate
> > > device
> > > trees for raw NAND and eMMC devices.
> > > 
> > > Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> > > ---
> > > 
> > >  arch/arm/dts/imx7-colibri-emmc.dts            | 16 +++++++
> > >  arch/arm/dts/imx7-colibri-rawnand.dts         | 46
> > > +++++++++++++++++++
> > >  .../{imx7-colibri.dts => imx7-colibri.dtsi}   | 39 +----------
> > > -----
> > 
> > I believe renaming that one also needs changes in resp. Makefile
> > otherwise leading to the following:
> > 
> > make[3]: *** No rule to make target 'arch/arm/dts/imx7-
> > colibri.dtb',
> > needed by 'dtbs'.  Stop.
> 
> Good catch, I definitely need to remove imx7-colibri.dtb there.
> 
> > Plus you may want to add the eMMC one as well e.g. as follows:
> > 
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > index dda4e59491..9596b2a64f 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -458,7 +458,8 @@ dtb-$(CONFIG_MX6UL) += \
> >  
> >  dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
> >  
> > -dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
> > +dtb-$(CONFIG_MX7) += imx7-colibri-emmc.dtb \
> > +       imx7-colibri-rawnand.dtb \
> >         imx7d-sdb.dtb \
> >         imx7d-sdb-qspi.dtb
> 
> It seems that removing is actually sufficient. dtc/Makefile along
> with
> CONFIG_OF_EMBED actually builds the device tree specified in the
> config
> file automatically. Should we still add board device trees to
> arch/arm/dts/Makefile?

Ah, that's why. I don't see much of an advantage having them all in
there then.

> @Stefano/ML any preference?
> 
> 
> > BTW: Remember, I am not too big of a fan of renaming stuff and
> > everywhere else we so far did not call anything -rawnand as of yet.
> > However, in general I agree that this would be more clear and if
> > you do
> > clean-up the rest of the world(TM) in a similar fashion I am OK
> > with
> > it.
> > 
> 
> I don't _re_name, I just name :-)

Yeah, but I do know how a git rename looks like (;-p). So you are
cheating just a tiny little bit!

> When we had to name the dt's in the
> kernel, we did not knew that there will be an eMMC variant. It's a
> different start condition here.

Sure.

> Also mind that device trees are named differently: Since we use the
> same
> boot loader for i.MX 7S and 7D, I dropped a letter there too...

Yep, fully aware of this and fully agree.

> IMHO,
> renaming the dt in Linux now is too much churn. So I suggest either
> leave as is in Kernel and deviate a bit in U-Boot or drop -rawnand in
> U-Boot, what do you think?

No, I'm fine with it. With the Makefile fixed:

Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

> --
> Stefan
> 
> > >  board/toradex/colibri_imx7/MAINTAINERS        |  3 ++
> > >  configs/colibri_imx7_defconfig                |  2 +-
> > >  5 files changed, 67 insertions(+), 39 deletions(-)
> > >  create mode 100644 arch/arm/dts/imx7-colibri-emmc.dts
> > >  create mode 100644 arch/arm/dts/imx7-colibri-rawnand.dts
> > >  rename arch/arm/dts/{imx7-colibri.dts => imx7-colibri.dtsi}
> > > (65%)
> > > 
> > > diff --git a/arch/arm/dts/imx7-colibri-emmc.dts
> > > b/arch/arm/dts/imx7-
> > > colibri-emmc.dts
> > > new file mode 100644
> > > index 0000000000..295ca05916
> > > --- /dev/null
> > > +++ b/arch/arm/dts/imx7-colibri-emmc.dts
> > > @@ -0,0 +1,16 @@
> > > +// SPDX-License-Identifier: GPL-2.0+ OR X11
> > 
> > Don't we rather want GPL-2.0 OR MIT?
> > 
> > > +/*
> > > + * Copyright 2019 Toradex AG
> > > + */
> > > +
> > > +/dts-v1/;
> > > +#include "imx7-colibri.dtsi"
> > > +
> > > +/ {
> > > +	model = "Toradex Colibri iMX7D 1GB (eMMC)";
> > > +	compatible = "toradex,imx7d-colibri-emmc", "fsl,imx7d";
> > > +
> > > +	chosen {
> > > +		stdout-path = &uart1;
> > > +	};
> > > +};
> > 
> > I guess the meat-on-the-bone will follow (;-p).
> > 
> > > diff --git a/arch/arm/dts/imx7-colibri-rawnand.dts
> > > b/arch/arm/dts/imx7-colibri-rawnand.dts
> > > new file mode 100644
> > > index 0000000000..4eb86fb011
> > > --- /dev/null
> > > +++ b/arch/arm/dts/imx7-colibri-rawnand.dts
> > > @@ -0,0 +1,46 @@
> > > +// SPDX-License-Identifier: GPL-2.0+ OR X11
> > 
> > Dito.
> > 
> > > +/*
> > > + * Copyright 2019 Toradex AG
> > > + */
> > > +
> > > +/dts-v1/;
> > > +#include "imx7-colibri.dtsi"
> > > +
> > > +/ {
> > > +	model = "Toradex Colibri iMX7S/D";
> > > +	compatible = "toradex,imx7-colibri", "fsl,imx7";
> > > +
> > > +	chosen {
> > > +		stdout-path = &uart1;
> > > +	};
> > > +};
> > > +
> > > +&gpmi {
> > > +	pinctrl-names = "default";
> > > +	pinctrl-0 = <&pinctrl_gpmi_nand>;
> > > +	,use-minimum-ecc;
> > > +	nand-on-flash-bbt;
> > > +	-ecc-mode = "hw";
> > > +	status = "okay";
> > > +};
> > > +
> > > +&iomuxc {
> > > +	pinctrl_gpmi_nand: gpmi-nand-grp {
> > > +		fsl,pins = <
> > > +			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
> > > +			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
> > > +			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
> > > +			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
> > > +			MX7D_PAD_SD3_STROBE__NAND_RE_B		0
> > > x71
> > > +			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA0__NAND_DATA00		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA1__NAND_DATA01		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA2__NAND_DATA02		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA3__NAND_DATA03		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA4__NAND_DATA04		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA5__NAND_DATA05		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA6__NAND_DATA06		0
> > > x71
> > > +			MX7D_PAD_SD3_DATA7__NAND_DATA07		0
> > > x71
> > > +		>;
> > > +	};
> > > +};
> > > diff --git a/arch/arm/dts/imx7-colibri.dts b/arch/arm/dts/imx7-
> > > colibri.dtsi
> > > similarity index 65%
> > > rename from arch/arm/dts/imx7-colibri.dts
> > > rename to arch/arm/dts/imx7-colibri.dtsi
> > > index dca501be25..47295117aa 100644
> > > --- a/arch/arm/dts/imx7-colibri.dts
> > > +++ b/arch/arm/dts/imx7-colibri.dtsi
> > > @@ -1,30 +1,12 @@
> > >  // SPDX-License-Identifier: GPL-2.0+ OR X11
> > >  /*
> > > - * Copyright 2016 Toradex AG
> > > + * Copyright 2016-2019 Toradex AG
> > >   */
> > > 
> > >  /dts-v1/;
> > >  #include <dt-bindings/gpio/gpio.h>
> > >  #include "imx7d.dtsi"
> > > 
> > > -/ {
> > > -	model = "Toradex Colibri iMX7S/D";
> > > -	compatible = "toradex,imx7-colibri", "fsl,imx7";
> > > -
> > > -	chosen {
> > > -		stdout-path = &uart1;
> > > -	};
> > > -};
> > > -
> > > -&gpmi {
> > > -	pinctrl-names = "default";
> > > -	pinctrl-0 = <&pinctrl_gpmi_nand>;
> > > -	fsl,use-minimum-ecc;
> > > -	nand-on-flash-bbt;
> > > -	nand-ecc-mode = "hw";
> > > -	status = "okay";
> > > -};
> > > -
> > >  &i2c1 {
> > >  	pinctrl-names = "default", "gpio";
> > >  	pinctrl-0 = <&pinctrl_i2c1>;
> > > @@ -57,25 +39,6 @@
> > >  };
> > > 
> > >  &iomuxc {
> > > -	pinctrl_gpmi_nand: gpmi-nand-grp {
> > > -		fsl,pins = <
> > > -			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
> > > -			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
> > > -			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
> > > -			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
> > > -			MX7D_PAD_SD3_STROBE__NAND_RE_B		0
> > > x71
> > > -			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA0__NAND_DATA00		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA1__NAND_DATA01		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA2__NAND_DATA02		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA3__NAND_DATA03		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA4__NAND_DATA04		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA5__NAND_DATA05		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA6__NAND_DATA06		0
> > > x71
> > > -			MX7D_PAD_SD3_DATA7__NAND_DATA07		0
> > > x71
> > > -		>;
> > > -	};
> > > -
> > >  	pinctrl_i2c4: i2c4-grp {
> > >  		fsl,pins = <
> > >  			MX7D_PAD_ENET1_RGMII_TD3__I2C4_SDA	0x400
> > > 0007f
> > > diff --git a/board/toradex/colibri_imx7/MAINTAINERS
> > > b/board/toradex/colibri_imx7/MAINTAINERS
> > > index 9c1d42aa8c..f55f8045f4 100644
> > > --- a/board/toradex/colibri_imx7/MAINTAINERS
> > > +++ b/board/toradex/colibri_imx7/MAINTAINERS
> > > @@ -8,3 +8,6 @@ F:	board/toradex/colibri_imx7/
> > >  F:	include/configs/colibri_imx7.h
> > >  F:	configs/colibri_imx7_defconfig
> > >  F:	configs/colibri_imx7_emmc_defconfig
> > 
> > I guess that one follows later as well (;-p).
> > 
> > > +F:	arch/arm/dts/imx7-colibri.dtsi
> > > +F:	arch/arm/dts/imx7-colibri-emmc.dts
> > > +F:	arch/arm/dts/imx7-colibri-rawnand.dts
> > > diff --git a/configs/colibri_imx7_defconfig
> > > b/configs/colibri_imx7_defconfig
> > > index 7b496bcea9..7441102ed4 100644
> > > --- a/configs/colibri_imx7_defconfig
> > > +++ b/configs/colibri_imx7_defconfig
> > > @@ -43,7 +43,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-
> > > nand:512k(mx7-bcb),1536k(u-boot1)ro,1536k
> > >  CONFIG_CMD_UBI=y
> > >  CONFIG_OF_CONTROL=y
> > >  CONFIG_OF_EMBED=y
> > > -CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri"
> > > +CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri-rawnand"
> > >  CONFIG_ENV_IS_IN_NAND=y
> > >  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
> > >  CONFIG_DFU_MMC=y
diff mbox series

Patch

diff --git a/arch/arm/dts/imx7-colibri-emmc.dts b/arch/arm/dts/imx7-colibri-emmc.dts
new file mode 100644
index 0000000000..295ca05916
--- /dev/null
+++ b/arch/arm/dts/imx7-colibri-emmc.dts
@@ -0,0 +1,16 @@ 
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * Copyright 2019 Toradex AG
+ */
+
+/dts-v1/;
+#include "imx7-colibri.dtsi"
+
+/ {
+	model = "Toradex Colibri iMX7D 1GB (eMMC)";
+	compatible = "toradex,imx7d-colibri-emmc", "fsl,imx7d";
+
+	chosen {
+		stdout-path = &uart1;
+	};
+};
diff --git a/arch/arm/dts/imx7-colibri-rawnand.dts b/arch/arm/dts/imx7-colibri-rawnand.dts
new file mode 100644
index 0000000000..4eb86fb011
--- /dev/null
+++ b/arch/arm/dts/imx7-colibri-rawnand.dts
@@ -0,0 +1,46 @@ 
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * Copyright 2019 Toradex AG
+ */
+
+/dts-v1/;
+#include "imx7-colibri.dtsi"
+
+/ {
+	model = "Toradex Colibri iMX7S/D";
+	compatible = "toradex,imx7-colibri", "fsl,imx7";
+
+	chosen {
+		stdout-path = &uart1;
+	};
+};
+
+&gpmi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_gpmi_nand>;
+	fsl,use-minimum-ecc;
+	nand-on-flash-bbt;
+	nand-ecc-mode = "hw";
+	status = "okay";
+};
+
+&iomuxc {
+	pinctrl_gpmi_nand: gpmi-nand-grp {
+		fsl,pins = <
+			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
+			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
+			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
+			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
+			MX7D_PAD_SD3_STROBE__NAND_RE_B		0x71
+			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0x71
+			MX7D_PAD_SD3_DATA0__NAND_DATA00		0x71
+			MX7D_PAD_SD3_DATA1__NAND_DATA01		0x71
+			MX7D_PAD_SD3_DATA2__NAND_DATA02		0x71
+			MX7D_PAD_SD3_DATA3__NAND_DATA03		0x71
+			MX7D_PAD_SD3_DATA4__NAND_DATA04		0x71
+			MX7D_PAD_SD3_DATA5__NAND_DATA05		0x71
+			MX7D_PAD_SD3_DATA6__NAND_DATA06		0x71
+			MX7D_PAD_SD3_DATA7__NAND_DATA07		0x71
+		>;
+	};
+};
diff --git a/arch/arm/dts/imx7-colibri.dts b/arch/arm/dts/imx7-colibri.dtsi
similarity index 65%
rename from arch/arm/dts/imx7-colibri.dts
rename to arch/arm/dts/imx7-colibri.dtsi
index dca501be25..47295117aa 100644
--- a/arch/arm/dts/imx7-colibri.dts
+++ b/arch/arm/dts/imx7-colibri.dtsi
@@ -1,30 +1,12 @@ 
 // SPDX-License-Identifier: GPL-2.0+ OR X11
 /*
- * Copyright 2016 Toradex AG
+ * Copyright 2016-2019 Toradex AG
  */
 
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include "imx7d.dtsi"
 
-/ {
-	model = "Toradex Colibri iMX7S/D";
-	compatible = "toradex,imx7-colibri", "fsl,imx7";
-
-	chosen {
-		stdout-path = &uart1;
-	};
-};
-
-&gpmi {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_gpmi_nand>;
-	fsl,use-minimum-ecc;
-	nand-on-flash-bbt;
-	nand-ecc-mode = "hw";
-	status = "okay";
-};
-
 &i2c1 {
 	pinctrl-names = "default", "gpio";
 	pinctrl-0 = <&pinctrl_i2c1>;
@@ -57,25 +39,6 @@ 
 };
 
 &iomuxc {
-	pinctrl_gpmi_nand: gpmi-nand-grp {
-		fsl,pins = <
-			MX7D_PAD_SD3_CLK__NAND_CLE		0x71
-			MX7D_PAD_SD3_CMD__NAND_ALE		0x71
-			MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B	0x71
-			MX7D_PAD_SAI1_TX_DATA__NAND_READY_B	0x74
-			MX7D_PAD_SD3_STROBE__NAND_RE_B		0x71
-			MX7D_PAD_SD3_RESET_B__NAND_WE_B		0x71
-			MX7D_PAD_SD3_DATA0__NAND_DATA00		0x71
-			MX7D_PAD_SD3_DATA1__NAND_DATA01		0x71
-			MX7D_PAD_SD3_DATA2__NAND_DATA02		0x71
-			MX7D_PAD_SD3_DATA3__NAND_DATA03		0x71
-			MX7D_PAD_SD3_DATA4__NAND_DATA04		0x71
-			MX7D_PAD_SD3_DATA5__NAND_DATA05		0x71
-			MX7D_PAD_SD3_DATA6__NAND_DATA06		0x71
-			MX7D_PAD_SD3_DATA7__NAND_DATA07		0x71
-		>;
-	};
-
 	pinctrl_i2c4: i2c4-grp {
 		fsl,pins = <
 			MX7D_PAD_ENET1_RGMII_TD3__I2C4_SDA	0x4000007f
diff --git a/board/toradex/colibri_imx7/MAINTAINERS b/board/toradex/colibri_imx7/MAINTAINERS
index 9c1d42aa8c..f55f8045f4 100644
--- a/board/toradex/colibri_imx7/MAINTAINERS
+++ b/board/toradex/colibri_imx7/MAINTAINERS
@@ -8,3 +8,6 @@  F:	board/toradex/colibri_imx7/
 F:	include/configs/colibri_imx7.h
 F:	configs/colibri_imx7_defconfig
 F:	configs/colibri_imx7_emmc_defconfig
+F:	arch/arm/dts/imx7-colibri.dtsi
+F:	arch/arm/dts/imx7-colibri-emmc.dts
+F:	arch/arm/dts/imx7-colibri-rawnand.dts
diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig
index 7b496bcea9..7441102ed4 100644
--- a/configs/colibri_imx7_defconfig
+++ b/configs/colibri_imx7_defconfig
@@ -43,7 +43,7 @@  CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:512k(mx7-bcb),1536k(u-boot1)ro,1536k
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
-CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri"
+CONFIG_DEFAULT_DEVICE_TREE="imx7-colibri-rawnand"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y