Skip to contentSkip to conversation

dt-bindings: mtd-physmap: Add endianness supports

PATCH RESEND Superseded Prabhakar Kushwaha 3 participants 10 messages Feb 22, 2018 – Feb 24, 2018

Subsystems (3)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover dt-bindings: mtd-physmap: Add endianness supports

Connection between flash and controller is not necessary to be always of same type. It may varies from platform to platform.

Adding endianness (optional) property to provide connection type information. This endianness property is checked in physmap_of_core.c to decide swap type.

This patch also set "big-endian" property for ls1021a, ls1043a and ls1046a device tree. here connection between IFC controller and NOR flash is big-endian.

Prabhakar Kushwaha (4):
dt-bindings: mtd-physmap: Add endianness supports
driver: mtd: update struct map_info's swap as per map requirement
ARM: dts: Add NOR connection type with IFC
ARM64: dts: Add NOR connection type with IFC

Resending as all patches of patchset never reaches to patchwork.

 Documentation/devicetree/bindings/mtd/mtd-physmap.txt | 5 +++++
 arch/arm/boot/dts/ls1021a-qds.dts                     | 1 +
 arch/arm/boot/dts/ls1021a-twr.dts                     | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts     | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts     | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts     | 1 +
 drivers/mtd/maps/physmap_of_core.c                    | 8 ++++++++
 7 files changed, 18 insertions(+)
Signature · 1 line
2.14.1
#1 lore raw

PATCH RESEND v4 1/4 dt-bindings: mtd-physmap: Add endianness supports

Connection between flash and controller is not necessary to be always of same type. It may varies from platform to platform.

Adding endianness (optional) property to provide connection type information.

---
Changes for v2: updated subject
Changes for v3: fixed typo for "big-endian" Changes for v4: Moved binding definition in mtd-physmap.txt as discussed at https://patchwork.ozlabs.org/patch/842543/

Resending as all patches of patchset never reaches to patchwork.

 Documentation/devicetree/bindings/mtd/mtd-physmap.txt | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/mtd/mtd-physmap.txt +5 -0
index 4a0a48bf4ecb..961a8eed9d0d 100644
@@ -41,6 +41,11 @@ additional (optional) property is defined:
 
  - erase-size : The chip's physical erase block size in bytes.
 
+ The device tree may optionally contain endianness property.
+ little-endian or big-endian : It represents connection between controller and
+			flash. If this property is absent, flash is considered
+			to be host-endian.
+
 The device tree may optionally contain sub-nodes describing partitions of the
 address space. See partition.txt for more detail.
 
Signature · 1 line
2.14.1
#2 lore raw

PATCH RESEND v4 2/4 driver: mtd: update struct map_info's swap as per map requirement

In reply to Prabhakar Kushwaha

It is not necessary for all device's maps to be CFI_HOST_ENDIAN. Maps device can be Big endian or little endian.

Currently it is being taken care using CONFIG_MTD_CFI_LE_BYTE_SWAP or CONFIG_MTD_CFI_BE_BYTE_SWAP i.e. compile time.

Now update struct map_info's swap field based on device characteristics defined in device tree.

---
Changes for v2: Incorporated review comments from Boris Brezillon
http://patchwork.ozlabs.org/patch/758381/
Changes for v3: None
Changes for v4: Updated code as per new defined binding of physmap.txt

Resending as all patches of patchset never reaches to patchwork.

 drivers/mtd/maps/physmap_of_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mtd/maps/physmap_of_core.c +8 -0
index b1bd4faecfb2..6eee160dfb3d 100644
@@ -20,6 +20,7 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/concat.h>
+#include <linux/mtd/cfi_endian.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
@@ -233,6 +234,13 @@ static int of_flash_probe(struct platform_device *dev)
 		info->list[i].map.bankwidth = be32_to_cpup(width);
 		info->list[i].map.device_node = dp;
 
+		if (of_property_read_bool(dp, "big-endian"))
+			info->list[i].map.swap = CFI_BIG_ENDIAN;
+		else if (of_property_read_bool(dp, "little-endian"))
+			info->list[i].map.swap = CFI_LITTLE_ENDIAN;
+		else
+			info->list[i].map.swap = CFI_HOST_ENDIAN;
+
 		err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
 		if (err)
 			goto err_out;
Signature · 1 line
2.14.1
#3 lore raw

PATCH RESEND v4 3/4 ARM: dts: Add NOR connection type with IFC

In reply to Prabhakar Kushwaha

Connection between IFC and NOR flash is of big-endian type.

So add big-endian property in flash node to reflect the same.

---
Changes for v2: None
Changes for v3: None
Changes for v4: Updated device tree as per new binding

Resending as all patches of patchset never reaches to patchwork.

 arch/arm/boot/dts/ls1021a-qds.dts | 1 +
 arch/arm/boot/dts/ls1021a-twr.dts | 1 +
 2 files changed, 2 insertions(+)
arch/arm/boot/dts/ls1021a-qds.dts +1 -0
index 940875316d0f..8a383d37884a 100644
@@ -237,6 +237,7 @@
 		reg = <0x0 0x0 0x8000000>;
 		bank-width = <2>;
 		device-width = <1>;
+		big-endian;
 	};
 
 	fpga: board-control at 3,0 {
arch/arm/boot/dts/ls1021a-twr.dts +1 -0
index a8b148ad1dd2..2056d30df020 100644
@@ -205,6 +205,7 @@
 		reg = <0x0 0x0 0x8000000>;
 		bank-width = <2>;
 		device-width = <1>;
+		big-endian;
 	};
 };
 
Signature · 1 line
2.14.1
#4 lore raw

PATCH RESEND v4 4/4 ARM64: dts: Add NOR connection type with IFC

In reply to Prabhakar Kushwaha

Connection between IFC and NOR flash is of big-endian type.

So add big-endian property in flash node to reflect the same.

---
Changes for v2: None
Changes for v3: None
Changes for v4: Updated device tree as per new binding

Resending as all patches of patchset never reaches to patchwork.

 arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts | 1 +
 3 files changed, 3 insertions(+)
arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts +1 -0
index 6341281485cf..80aed686933f 100644
@@ -89,6 +89,7 @@
 		reg = <0x0 0x0 0x8000000>;
 		bank-width = <2>;
 		device-width = <1>;
+		big-endian;
 	};
 
 	nand at 1,0 {
arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts +1 -0
index 3dc0c8e9663d..600ab2fb6f5a 100644
@@ -104,6 +104,7 @@
 			reg = <0x0 0x0 0x8000000>;
 			bank-width = <2>;
 			device-width = <1>;
+			big-endian;
 		};
 
 		nand at 1,0 {
arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts +1 -0
index 434383bade0e..153bba913e9a 100644
@@ -180,6 +180,7 @@
 		reg = <0x0 0x0 0x8000000>;
 		bank-width = <2>;
 		device-width = <1>;
+		big-endian;
 	};
 
 	nand at 1,0 {
Signature · 1 line
2.14.1
#5 lore raw

PATCH RESEND v2 1/2 ARM: dts: Add big-endian for IFC on LS1021A

In reply to Prabhakar Kushwaha

For the patch to update struct map_info's swap field based on device characteristics defined in device tree, big-endian parameter is added for LS1021A.

---
Due to patch series http://patchwork.ozlabs.org/project/linux-mtd/list/?series=28735
this patch is now independent of flash propoerty. So resending.

Resending as all patches of patchset never reaches to patchwork.

 arch/arm/boot/dts/ls1021a.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/ls1021a.dtsi +1 -0
index 9319e1f0f1d8..babb086ad94f 100644
@@ -145,6 +145,7 @@
 		ifc: ifc at 1530000 {
 			compatible = "fsl,ifc", "simple-bus";
 			reg = <0x0 0x1530000 0x0 0x10000>;
+			big-endian;
 			interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
Signature · 1 line
2.14.1
#6 lore raw

PATCH RESEND v2 1/2 ARM: dts: Add big-endian for IFC on LS1021A

Quoted 4 lines · On Thu, 22 Feb 2018 15:45:10 +0530 Prabhakar Kushwaha…

For the patch to update struct map_info's swap field based on device characteristics defined in device tree, big-endian parameter is added for LS1021A.

Quoted 8 lines

---
Due to patch series http://patchwork.ozlabs.org/project/linux-mtd/list/?series=28735
this patch is now independent of flash propoerty. So resending.

Resending as all patches of patchset never reaches to patchwork.

Again, that's not the case, I just marked them as "Not applicable" (see my previous reply).

Also, according to the cover letter this patch should not be part of "dt-bindings: mtd-physmap: Add endianness supports", so why are you sending it here?

Quoted 16 lines
 arch/arm/boot/dts/ls1021a.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/ls1021a.dtsi +1 -0
index 9319e1f0f1d8..babb086ad94f 100644
@@ -145,6 +145,7 @@
 		ifc: ifc at 1530000 {
 			compatible = "fsl,ifc", "simple-bus";
 			reg = <0x0 0x1530000 0x0 0x10000>;
+			big-endian;
 			interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH RESEND v2 2/2 ARM: dts: ls1021aqds: Add nand node for ifc controller

In reply to Prabhakar Kushwaha

LS1021AQDS support NAND flash on IFC chip-select 2.

So add NAND node in device tree for IFC controller.

---
Due to patch series http://patchwork.ozlabs.org/project/linux-mtd/list/?series=28735
this patch is now independent of flash propoerty. So resending.

Resending as all patches of patchset never reaches to patchwork.

 arch/arm/boot/dts/ls1021a-qds.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/ls1021a-qds.dts +5 -0
index 8a383d37884a..fe352ff60b35 100644
@@ -240,6 +240,11 @@
 		big-endian;
 	};
 
+	nand at 2,0 {
+		compatible = "fsl,ifc-nand";
+		reg = <0x2 0x0 0x10000>;
+	};
+
 	fpga: board-control at 3,0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
Signature · 1 line
2.14.1
#8 lore raw

v4 cover dt-bindings: mtd-physmap: Add endianness supports

In reply to Prabhakar Kushwaha

Hi Prabhakar,

Quoted 11 lines · On Thu, 22 Feb 2018 15:45:05 +0530 Prabhakar Kushwaha…

Connection between flash and controller is not necessary to be always of same type. It may varies from platform to platform.

Adding endianness (optional) property to provide connection type information. This endianness property is checked in physmap_of_core.c to decide swap type.

This patch also set "big-endian" property for ls1021a, ls1043a and ls1046a device tree. here connection between IFC controller and NOR flash is big-endian.

Quoted 5 lines

Prabhakar Kushwaha (4):
dt-bindings: mtd-physmap: Add endianness supports
driver: mtd: update struct map_info's swap as per map requirement
ARM: dts: Add NOR connection type with IFC
ARM64: dts: Add NOR connection type with IFC

First of all, can you stop sending dts changes until we've agreed on the dt-bindings/driver changes.

Quoted 2 lines

Resending as all patches of patchset never reaches to patchwork.

Hm, I think they reached patchwork, it's just that dts changes won't be applied to the MTD tree, so I mark them as 'Not applicable'.

Regards,

Boris

Quoted 10 lines
 Documentation/devicetree/bindings/mtd/mtd-physmap.txt | 5 +++++
 arch/arm/boot/dts/ls1021a-qds.dts                     | 1 +
 arch/arm/boot/dts/ls1021a-twr.dts                     | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts     | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts     | 1 +
 arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts     | 1 +
 drivers/mtd/maps/physmap_of_core.c                    | 8 ++++++++
 7 files changed, 18 insertions(+)
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#9 lore raw

v4 cover dt-bindings: mtd-physmap: Add endianness supports

Quoted 16 lines · Boris Brezillon

Hi Prabhakar,

Quoted 11 lines · On Thu, 22 Feb 2018 15:45:05 +0530 Prabhakar Kushwaha…

Connection between flash and controller is not necessary to be always of same type. It may varies from platform to platform.

Adding endianness (optional) property to provide connection type information. This endianness property is checked in physmap_of_core.c to decide swap type.

This patch also set "big-endian" property for ls1021a, ls1043a and ls1046a device tree. here connection between IFC controller and NOR flash is big-endian.

Quoted 8 lines
Quoted 5 lines

Prabhakar Kushwaha (4):
dt-bindings: mtd-physmap: Add endianness supports
driver: mtd: update struct map_info's swap as per map requirement
ARM: dts: Add NOR connection type with IFC
ARM64: dts: Add NOR connection type with IFC

First of all, can you stop sending dts changes until we've agreed on the dt-bindings/driver changes.

+1

Shawn