Skip to content

Commit

Permalink
Merge pull request #1111 from msperl/rpi-4.2.y-patch-spi-dt
Browse files Browse the repository at this point in the history
spi: bcm270x: dt: move to cs-gpio and add an overlay for GPIO 35-39
  • Loading branch information
pelwell committed Aug 19, 2015
2 parents aab561e + 3588f26 commit 069a8df
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 9 deletions.
10 changes: 8 additions & 2 deletions arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@

&gpio {
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,pins = <9 10 11>;
brcm,function = <4>; /* alt0 */
};

spi0_cs_pins: spi0_cs_pins {
brcm,pins = <8 7>;
brcm,function = <1>; /* output */
};

i2c0_pins: i2c0 {
brcm,pins = <0 1>;
brcm,function = <4>;
Expand Down Expand Up @@ -44,7 +49,8 @@

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
cs-gpios = <&gpio 8 1>, <&gpio 7 1>;

spidev@0{
compatible = "spidev";
Expand Down
10 changes: 8 additions & 2 deletions arch/arm/boot/dts/bcm2708-rpi-b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@

&gpio {
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,pins = <9 10 11>;
brcm,function = <4>; /* alt0 */
};

spi0_cs_pins: spi0_cs_pins {
brcm,pins = <8 7>;
brcm,function = <1>; /* output */
};

i2c0_pins: i2c0 {
brcm,pins = <0 1>;
brcm,function = <4>;
Expand Down Expand Up @@ -44,7 +49,8 @@

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
cs-gpios = <&gpio 8 1>, <&gpio 7 1>;

spidev@0{
compatible = "spidev";
Expand Down
10 changes: 8 additions & 2 deletions arch/arm/boot/dts/bcm2708-rpi-cm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@

&gpio {
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,pins = <9 10 11>;
brcm,function = <4>; /* alt0 */
};

spi0_cs_pins: spi0_cs_pins {
brcm,pins = <8 7>;
brcm,function = <1>; /* output */
};

i2c0_pins: i2c0 {
brcm,pins = <0 1>;
brcm,function = <4>;
Expand All @@ -34,7 +39,8 @@

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
cs-gpios = <&gpio 8 1>, <&gpio 7 1>;

spidev@0{
compatible = "spidev";
Expand Down
10 changes: 8 additions & 2 deletions arch/arm/boot/dts/bcm2709-rpi-2-b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@

&gpio {
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,pins = <9 10 11>;
brcm,function = <4>; /* alt0 */
};

spi0_cs_pins: spi0_cs_pins {
brcm,pins = <8 7>;
brcm,function = <1>; /* output */
};

i2c0_pins: i2c0 {
brcm,pins = <0 1>;
brcm,function = <4>;
Expand Down Expand Up @@ -44,7 +49,8 @@

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
cs-gpios = <&gpio 8 1>, <&gpio 7 1>;

spidev@0{
compatible = "spidev";
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += spi-gpio35-39-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += tinylcd35-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += uart1-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += vga666-overlay.dtb
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,12 @@ Load: dtoverlay=spi-bcm2835
Params: <None>


Name: spi-gpio35-39
Info: move SPI function block to GPIO 35 to 39
Load: dtoverlay=spi-gpio35-39
Params: <None>


Name: tinylcd35
Info: 3.5" Color TFT Display by www.tinylcd.com
Options: Touch, RTC, keypad
Expand Down
9 changes: 8 additions & 1 deletion arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Device tree overlay for spi-bcm2835
* Device tree overlay to use spi-bcm2708
*/

/dts-v1/;
Expand All @@ -15,4 +15,11 @@
compatible = "brcm,bcm2708-spi";
};
};

fragment@1 {
target = <&spi0_cs_pins>;
__overlay__ {
brcm,function = <4>; /* alt0 */
};
};
};
31 changes: 31 additions & 0 deletions arch/arm/boot/dts/overlays/spi-gpio35-39-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Device tree overlay to move spi0 to gpio 35 to 39 on CM
*/

/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";

fragment@0 {
target = <&spi0>;
__overlay__ {
cs-gpios = <&gpio 36 1>, <&gpio 35 1>;
};
};

fragment@1 {
target = <&spi0_cs_pins>;
__overlay__ {
bcrm,pins = <36 35>;
};
};

fragment@2 {
target = <&spi0_pins>;
__overlay__ {
bcrm,pins = <37 38 39>;
};
};
};

0 comments on commit 069a8df

Please sign in to comment.