I trying to move the SPI bus on a Raspberry Pi 3. I would like to move it from GPIO 7-11 to GPIO pins 22-26. The file "bcm2708_common.dtsi" contains the node for the spi0 bus:
spi0: spi@7e204000 {
compatible = "brcm,bcm2835-spi";
reg = <0x7e204000 0x1000>;
interrupts = <2 22>;
clocks = <&clk_core>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
/* the dma channels */
dmas = <&dma 6>, <&dma 7>;
dma-names = "tx", "rx";
/* the chipselects used - <0> means native GPIO
* add more gpios if necessary as <&gpio 6 1>
* (but do not forget to make them output!)
*/
cs-gpios = <0>, <0>;
};
The spi is configured in the top-level dts file "bcm2710-rpi-3-b.dts":
&gpio {
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,function = <4>; /* alt0 */
};
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
cs-gpios = <0 0>;
spidev@0{
compatible = "spidev";
reg = <0>; /* CE0 */
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <500000>;
};
spidev@1{
compatible = "spidev";
reg = <1>; /* CE1 */
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <500000>;
};
};
Is reconfiguring the spi pins as simple as changing the gpio entry to this or is there something more that I need to do?
&gpio {
spi0_pins: spi0_pins {
brcm,pins = <22 23 24 25 26>;
brcm,function = <4>; /* alt0 */
};
};