Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spi: bcm270x: dt: move to cs-gpio and add an overlay for GPIO 35-39 #1111

Merged
merged 1 commit into from
Aug 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -43,6 +43,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 @@ -474,6 +474,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>;
};
};
};