Using bcm2835 with QCA7000
Stefan Wahren
info at lategoodbye.de
Sat Apr 19 01:39:43 PDT 2014
Hi,
i'm porting the spi protocol driver [1] for the Qualcomm QCA7000
Homeplug GreenPHY [2] to linux mainline including devicetree support. My
current development platform uses a i.MX28, but the goal is that the
driver works with many other spi masters. Now i want to go the
combination bcm2835 and QCA7000. Unfortunately it seems to me that most
of the Raspberry Pi users use a kernel without devicetree support and
any update to date documentation about that is rare.
So i hope somebody on this list can review my dts patch. If it finally
works i would add it as another example in the binding documentation.
The pin assignment and spi role of the QCA7000 are identical to the
Microchip ENC28J60. So we need the following pins: CE0, MISO, MOSI, SCLK
and GPIO25 as the interrupt pin.
Are these modifications okay?
Any comments about this are very welcome.
Kind regards
Stefan Wahren
[1] - https://github.com/I2SE/qca7000/tree/linux-mainline
[2] - http://www.qca.qualcomm.com/wp-content/uploads/2013/11/QCA7000.pdf
[3] - http://ww1.microchip.com/downloads/en/devicedoc/39662a.pdf
---
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts
b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 2a3b1c1..3172d07 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -23,15 +23,20 @@
&gpio {
pinctrl-names = "default";
- pinctrl-0 = <&gpioout &alt0 &alt3>;
+ pinctrl-0 = <&gpioout &gpioin &alt3>;
gpioout: gpioout {
brcm,pins = <6>;
brcm,function = <1>; /* GPIO out */
};
- alt0: alt0 {
- brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>;
+ gpioin: gpioin {
+ brcm,pins = <25>;
+ brcm,function = <0>; /* GPIO in */
+ };
+
+ spi0: spi0 {
+ brcm,pins = <8 9 10 11>; /* CS, MISO, MOSI, SCLK */
brcm,function = <4>; /* alt0 */
};
@@ -41,6 +46,24 @@
};
};
+&spi {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi0>;
+
+ qca7000: qca7000 at 0 {
+ compatible = "qca,qca7000";
+ spi-cpha; /* SPI mode: CPHA=1 */
+ spi-cpol; /* SPI mode: CPOL=1 */
+ spi-max-frequency = <8000000>; /* freq: 8 MHz */
+ intr-gpios = <&gpioin 25 0>; /* interrupt gpio */
+ interrupt-parent = <&gpio>;
+ interrupts = <2 25>;
+ linux,pluggable;
+ reg = <0x0>; /* CE0 */
+ };
+};
+
&i2c0 {
status = "okay";
clock-frequency = <100000>;
More information about the linux-rpi-kernel
mailing list