Skip to contentSkip to conversation

ARM: mvebu: Add support for SPI controller in Armada 370/XP

PATCH New Ezequiel Garcia 5 participants 11 messages Feb 4, 2013 – Feb 5, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: mvebu: Add support for SPI controller in Armada 370/XP

The Armada 370 and Armada XP SoC has an SPI controller. This patch adds support for this controller in Armada 370 and Armada XP SoC common device tree files.

Cc Gregory Clement <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Lior Amsalem <[email protected]>
---
 arch/arm/boot/dts/armada-370-xp.dtsi |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-370-xp.dtsi +22 -0
index 28276fe..22340d5 100644
@@ -145,6 +145,28 @@
 			clocks = <&gateclk 17>;
 			status = "disabled";
 		};
+
+		spi0: spi at d0010600 {
+			compatible = "marvell,orion-spi";
+			reg = <0xd0010600 0x50>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <0>;
+			interrupts = <30>;
+			clocks = <&coreclk 0>;
+			status = "disabled";
+		};
+
+		spi1: spi at d0010680 {
+			compatible = "marvell,orion-spi";
+			reg = <0xd0010680 0x50>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <1>;
+			interrupts = <92>;
+			clocks = <&coreclk 0>;
+			status = "disabled";
+		};
 	};
 };
 
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 2/2 ARM: mvebu: Update defconfig to select SPI support

Cc Gregory Clement <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Lior Amsalem <[email protected]>
---
 arch/arm/configs/mvebu_defconfig |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/configs/mvebu_defconfig +2 -0
index 4e6f0ce..e243451 100644
@@ -40,6 +40,8 @@ CONFIG_MWIFIEX_SDIO=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_I2C=y
+CONFIG_SPI=y
+CONFIG_SPI_ORION=y
 CONFIG_I2C_MV64XXX=y
 CONFIG_SERIAL_8250_DW=y
 CONFIG_GPIOLIB=y
Signature · 1 line
1.7.8.6
#2 lore raw

PATCH 2/2 ARM: mvebu: Update defconfig to select SPI support

Hi Ezequiel,

Quoted 14 lines · Ezequiel Garcia
Cc Gregory Clement <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Lior Amsalem <[email protected]>
---
 arch/arm/configs/mvebu_defconfig |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/configs/mvebu_defconfig +0 -0
index 4e6f0ce..e243451 100644

arch/arm/configs/mvebu_defconfig CONFIG_MWIFIEX_SDIO=y · line 47

Quoted 8 lines
arch/arm/configs/mvebu_defconfig +2 -0
@@ -40,6 +40,8 @@ CONFIG_MWIFIEX_SDIO=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_I2C=y
+CONFIG_SPI=y
+CONFIG_SPI_ORION=y
 CONFIG_I2C_MV64XXX=y
 CONFIG_SERIAL_8250_DW=y
 CONFIG_GPIOLIB=y

For this patch you can add my

Regards,

Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

cover ARM: mvebu: Add support for SPI controller in Armada 370/XP

In reply to Ezequiel Garcia

Hi,

This patchset adds support for the SPI controller
available in Armada 370 and Armada XP SoC.

The patches are based in Jason Cooper's mvebu/dt branch.

Feel free to test and/or provide feedback.

Ezequiel Garcia (2):
ARM: mvebu: Update defconfig to select SPI support
ARM: mvebu: Add support for SPI controller in Armada 370/XP

 arch/arm/boot/dts/armada-370-xp.dtsi |   22 ++++++++++++++++++++++
 arch/arm/configs/mvebu_defconfig     |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

Thanks,

Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
#4 lore raw

cover ARM: mvebu: Add support for SPI controller in Armada 370/XP

Ezequiel,

This series looks good. just a few comments:

Quoted 6 lines · Ezequiel Garcia

Hi,

This patchset adds support for the SPI controller
available in Armada 370 and Armada XP SoC.

The patches are based in Jason Cooper's mvebu/dt branch.

It probably doesn't matter for this series (I haven't tried to apply it yet), but please base future work off of a mainline tag (eg v3.8-rc6). It makes merge conflicts easier to resolve.

Feel free to test-merge against the mvebu/ branches and let me know of any conflicts.

Also, your patch series appears to be out of order, did you use git send-email once per file?

thx,

Jason.

#5 lore raw

cover ARM: mvebu: Add support for SPI controller in Armada 370/XP

Jason,

Quoted 8 lines · Jason Cooper

This series looks good. just a few comments:

Quoted 5 lines · Ezequiel Garcia

Hi,

This patchset adds support for the SPI controller
available in Armada 370 and Armada XP SoC.

Quoted 9 lines
Quoted 1 line

The patches are based in Jason Cooper's mvebu/dt branch.

It probably doesn't matter for this series (I haven't tried to apply it yet), but please base future work off of a mainline tag (eg v3.8-rc6). It makes merge conflicts easier to resolve.

Feel free to test-merge against the mvebu/ branches and let me know of any conflicts.

Ah, I see.

I was mistakenly assuming you wanted against that branch; I'll base the patches on mainline in the future.

Thanks for the advice.

Quoted 3 lines

Also, your patch series appears to be out of order, did you use git send-email once per file?

I always send the cover letter manually. This time I did it after the patches. I'm in the process of automating this in my workflow,
but feel free to make a suggestion.

Thanks,

Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
#6 lore raw

cover ARM: mvebu: Add support for SPI controller in Armada 370/XP

Ezequiel,

Quoted 8 lines · Ezequiel Garcia
Quoted 7 lines · Jason Cooper
Quoted 1 line · Ezequiel Garcia

The patches are based in Jason Cooper's mvebu/dt branch.

It probably doesn't matter for this series (I haven't tried to apply it yet), but please base future work off of a mainline tag (eg v3.8-rc6). It makes merge conflicts easier to resolve.

Quoted 8 lines
Quoted 3 lines

Feel free to test-merge against the mvebu/ branches and let me know of any conflicts.

Ah, I see.

I was mistakenly assuming you wanted against that branch; I'll base the patches on mainline in the future.

Nope, the branches are organized that way to sanely merge in with all the other arm-soc code. While I make every effort to keep them stable (ie, not rebased), they may change at anytime if I need to fix things.

tags are stable, and if all patches are based on tags, then merge conflicts follow a predictable pattern. Anything else devolves into chaos.

Quoted 6 lines
Quoted 2 lines

Also, your patch series appears to be out of order, did you use git send-email once per file?

I always send the cover letter manually. This time I did it after the patches. I'm in the process of automating this in my workflow,
but feel free to make a suggestion.

if format-patch is called properly (I know from experience how to call it improperly ;-) ), you can just do

$ git send-email ... /path/to/patches/*.patch

and it'll get the order correct. It will also ask for confirmation before sending each email.

Dry-run sending a series just to yourself lets you see how it will appear once it goes out to the list.

hth,

Jason.

#7 lore raw

cover ARM: mvebu: Add support for SPI controller in Armada 370/XP

Jason,

Quoted 20 lines · Jason Cooper

Ezequiel,

Quoted 8 lines · Ezequiel Garcia
Quoted 7 lines · Jason Cooper
Quoted 1 line · Ezequiel Garcia

The patches are based in Jason Cooper's mvebu/dt branch.

It probably doesn't matter for this series (I haven't tried to apply it yet), but please base future work off of a mainline tag (eg v3.8-rc6). It makes merge conflicts easier to resolve.

Quoted 8 lines
Quoted 3 lines

Feel free to test-merge against the mvebu/ branches and let me know of any conflicts.

Ah, I see.

I was mistakenly assuming you wanted against that branch; I'll base the patches on mainline in the future.

Quoted 8 lines

Nope, the branches are organized that way to sanely merge in with all the other arm-soc code. While I make every effort to keep them stable (ie, not rebased), they may change at anytime if I need to fix things.

tags are stable, and if all patches are based on tags, then merge conflicts follow a predictable pattern. Anything else devolves into chaos.

Ah?... this explains why I was seeing your branches rebased! ;-)

Quoted 10 lines
Quoted 6 lines
Quoted 2 lines

Also, your patch series appears to be out of order, did you use git send-email once per file?

I always send the cover letter manually. This time I did it after the patches. I'm in the process of automating this in my workflow,
but feel free to make a suggestion.

if format-patch is called properly (I know from experience how to call it improperly ;-) ), you can just do

Quoted 8 lines
$ git send-email ... /path/to/patches/*.patch

and it'll get the order correct. It will also ask for confirmation before sending each email.

Dry-run sending a series just to yourself lets you see how it will appear once it goes out to the list.

Okey, great. Thanks for the advices!

Signature · 1 line
    Ezequiel
#8 lore raw

cover ARM: mvebu: Add support for SPI controller in Armada 370/XP

In reply to Ezequiel Garcia
Quoted 4 lines · Ezequiel Garcia

Hi,

This patchset adds support for the SPI controller
available in Armada 370 and Armada XP SoC.

Hi Ezequiel

Do any of the boards we have with mainline support have any devices on the SPI busses? Its hard to test otherwise.

Thanks
Andrew

#9 lore raw

cover ARM: mvebu: Add support for SPI controller in Armada 370/XP

Andrew,

Quoted 11 lines · Andrew Lunn
Quoted 4 lines · Ezequiel Garcia

Hi,

This patchset adds support for the SPI controller
available in Armada 370 and Armada XP SoC.

Hi Ezequiel

Do any of the boards we have with mainline support have any devices on the SPI busses? Its hard to test otherwise.

Mmm... very true.

Recently added Armada XP GP board as an SPI flash. Probably other evaluation boards also has similar SPI flashes, but I should check that.

I'll prepare a patch for GP board tomorrow,
based on Gregory's patches for that board,
so you can test that.
Also, I hope to prepare patches for the other
evaluation boards soon.

Regards,

Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
#10 lore raw

PATCH 1/2 ARM: mvebu: Add support for SPI controller in Armada 370/XP

In reply to Ezequiel Garcia

Hi Ezequiel,

Quoted 17 lines · Ezequiel Garcia

The Armada 370 and Armada XP SoC has an SPI controller. This patch adds support for this controller in Armada 370 and Armada XP SoC common device tree files.

Cc Gregory Clement <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Lior Amsalem <[email protected]>
---
 arch/arm/boot/dts/armada-370-xp.dtsi |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/boot/dts/armada-370-xp.dtsi +0 -0
index 28276fe..22340d5 100644

arch/arm/boot/dts/armada-370-xp.dtsi line 151

Quoted 7 lines
arch/arm/boot/dts/armada-370-xp.dtsi +4 -0
@@ -145,6 +145,28 @@
 			clocks = <&gateclk 17>;
 			status = "disabled";
 		};
+
+		spi0: spi at d0010600 {
+			compatible = "marvell,orion-spi";
+			reg = <0xd0010600 0x50>;

Currently the driver only use the 5th first register. All of the other mvebu platform declare the last register at offset 0x28. The Armada 370 SoC have also the last register at offset 0x28. Only for the Armada XP SoC there are more registers and we have a the last register at offset 0x50. Obviously the driver won't use these extra register.

So I think that the best for now is to declare:

			reg = <0xd0010600 0x28>;

arch/arm/boot/dts/armada-370-xp.dtsi line 162

Quoted 11 lines
arch/arm/boot/dts/armada-370-xp.dtsi +11 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <0>;
+			interrupts = <30>;
+			clocks = <&coreclk 0>;
+			status = "disabled";
+		};
+
+		spi1: spi at d0010680 {
+			compatible = "marvell,orion-spi";
+			reg = <0xd0010680 0x50>;

and here:

			reg = <0xd0010680 0x28>;

arch/arm/boot/dts/armada-370-xp.dtsi line 172

Quoted 11 lines
arch/arm/boot/dts/armada-370-xp.dtsi +7 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <1>;
+			interrupts = <92>;
+			clocks = <&coreclk 0>;
+			status = "disabled";
+		};
 	};
 };
 

Once it will be fixed, for this patch you can add my

Regards,

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