Discussion:
[fedora-arm] what do i have to do to enable spi on fedora 27 on a raspberry pi
a***@sharklasers.com
2018-02-25 08:59:39 UTC
Permalink
to quote the fedoraproject wiki on the raspberry pi:

Are Device Tree Overlays supported?
There's basic support for overlays in u-boot and the linux kernel but an overlay manager isn't yet upstream. There's (sic)

Is GPIO supported?
GPIO isn't supported well as they need to be mapped with Device Tree overlays. This will be improved in the F-27 cycle, and in Fedora 28.

Is SPI supported?
Yes, basic SPI is supported.

Is I2C supported?
Yes, basic I2C is supported.

by default, i know that i2c is functional since i added an rtc and added a simple udev rule to make it work, however, spi isn't that simple

i have an enc28j60 wired to the gpio in hopes of having a secondary ethernet interface, i know it's wired correctly since i downloaded raspbian and added the appropriate overlay magic to config.txt and it automatically registers as eth1

on fedora, a simple modprobe spidev or modprobe spi-bcm2835{,aux} doesn't seem to populate /dev/ with any spidev*

i even grafted all of the fedora kernel patches (https://src.fedoraproject.org/rpms/kernel.git) onto the raspberry pi kernel (https://github.com/raspberrypi/linux.git, rpi-4.15.y), built it (make olddefconfig), installed it, did all that funny mkimage crap, booted off it (raspberries instead of penguins (everything else still worked)), and still no functional spi

i think this implies that between raspbian and fedora there's a specific CONFIG_ option in the kernel i need to add, but i don't know what one (ones?) it would be

any help would be appreciated





----
Sent using Sharklasers.com
Block or report abuse: https://www.sharklasers.com//abuse/?a=QFN5JQEJUKAGxgix9HENcwTVQsCV0cMeyLZF

_______________________________________________
arm mailing list -- ***@lists.fedoraproject.org
To unsubsc
Richard Ryniker
2018-02-25 16:11:21 UTC
Permalink
You might try Fedberry. I uncommented "dtparam=spi=on" in
/boot/config.txt and now see the /dev/spidev0.0 and /dev/spidev0.1
devices. The GPIO devices (gpiochip0, gpiochip1, and gpiochip2) are
present by default, without any special configuration.

With F27, uncertain about what device tree overlay capabilities actually
exist, I experimented by manually adding the SPI text to the initial
binary device tree file (dtc from binary or tree to source, edit, dtc
back to binary) but this did not work. I wonder whether the F27 SPI DT
overlay data may be incomplete (Raspbian has more detail), or if your
suspicion about kernel configuration is the fundamental problem.

I2C is what I need currently, and F27 has been very good for that.
_______________________________________________
arm mailing list -- ***@lists.fedoraproject.org
To unsubs
adpdyj+
2018-04-11 02:09:12 UTC
Permalink
for the sake of completeness:

diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 9d293decf8d3..d32d4861c98d 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -26,2 +26,3 @@
serial1 = &uart1;
+ ethernet1 = &eth1;
};
@@ -375,2 +377,15 @@
};
+ spi0_pins: spi0_pins {
+ brcm,pins = <9 10 11>;
+ brcm,function = <BCM2835_FSEL_ALT0>;
+ };
+ spi0_cs_pins: spi0_cs_pins {
+ brcm,pins = <8 7>;
+ brcm,function = <BCM2835_FSEL_GPIO_OUT>;
+ };
+ eth1_pins: eth1_pins {
+ brcm,pins = <25>;
+ brcm,function = <BCM2835_FSEL_GPIO_IN>;
+ brcm,pull = <BCM2835_PUD_OFF>;
+ };
};
@@ -415,3 +430,17 @@
#size-cells = <0>;
- status = "disabled";
+ status = "okay";
+ dmas = <&dma 6>, <&dma 7>;
+ dma-names = "tx", "rx";
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
+ cs-gpios = <&gpio 8 GPIO_ACTIVE_LOW>, <&gpio 7 GPIO_ACTIVE_LOW>;
+ eth1: ***@0 {
+ compatible = "microchip,enc28j60";
+ reg = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&eth1_pins>;
+ interrupt-parent = <&gpio>;
+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
+ spi-max-frequency = <24000000>;
+ };
};

$CPP -I../../../../include -E -P -x assembler-with-cpp bcm2837-rpi-3-b.dts | dtc -I dts -O dtb -o bcm2837-rpi-3-b.dtb -
_______________________________________________
arm mailing list -- ***@lists.fedoraproject.org
To unsubscribe send an email to arm-l

Loading...