Unable to enable SPI

Hi everyone!

I just got my shipment of Bubblegum-96 a few days ago and I installed the latest Linaro build of Debian (20161115?). The problem is that I cannot get the SPI interface to work. The device tree shipped with the kernel just says “disabled” and no instructions on how to enable it is given. By changing the dtb file (adding pinctrl entries and changing “disabled” to “okay”) I was able to produce the following output:

[ 0.110124] pinctrl core: registered pin 40 (P_SPI0_SCLK) on e01b0000.pinctrl
[ 0.110156] pinctrl core: registered pin 41 (P_SPI0_SS) on e01b0000.pinctrl
[ 0.110156] pinctrl core: registered pin 42 (P_SPI0_MISO) on e01b0000.pinctrl
[ 0.110156] pinctrl core: registered pin 43 (P_SPI0_MOSI) on e01b0000.pinctrl
[ 0.127031] [OWL] SPI controller initialization
[ 0.127124] pinctrl-s900 e01b0000.pinctrl: found group selector 33 for mfp1_3_1_spi0_ss
[ 0.127156] pinctrl-s900 e01b0000.pinctrl: found group selector 34 for mfp1_3_1_spi0_miso
[ 0.127187] pinctrl-s900 e01b0000.pinctrl: request pin 40 (P_SPI0_SCLK) for e01d0000.spi
[ 0.127187] pinctrl-s900 e01b0000.pinctrl: request pin 43 (P_SPI0_MOSI) for e01d0000.spi
[ 0.127187] pinctrl-s900 e01b0000.pinctrl: request pin 41 (P_SPI0_SS) for e01d0000.spi
[ 0.127218] pinctrl-s900 e01b0000.pinctrl: request pin 42 (P_SPI0_MISO) for e01d0000.spi

However no pulses can be observed on the SPI pins.

Any thoughts?

Best

It is possible you are the first person to try an bring up SPI on the Low Speed connector which may explain why the software isn’t configured exactly right.

However based on the edits you have made so far I wouldn’t really expect to see any pulses on the SPI pins.

I would only expect them to toggle when software on the BG96 tries to use SPI to communicate with a peripheral. Perhaps you also need to grab the DT fragments used on DB410C to enable spidev?

Hi Daniel,

I already changed the dtb file (sorry for forgetting to put it here :)), listed below:


        pinctrl@e01b0000 {
                compatible = "actions,s900-pinctrl";
                reg = <0x0 0xe01b0000 0x0 0x1000>;
                pinctrl-names = "default";
                pinctrl-0 = <0x2>;
                clocks = <0x3 0x17>;
                clock-names = "mfp";

                pinctrl_default {
                        linux,phandle = <0x2>;
                        phandle = <0x2>;
                };

                spi0 {
                        linux,phandle = <0x2f>;
                        phandle = <0x2f>;

                        spi0_mfp {
                                actions,groups = "mfp1_5_4", "mfp1_3_1_spi0_ss", "mfp1_3_1_spi0_miso";
                                actions,function = "spi0";
                        };

                        spi0_pull {
                                actions,pins = "P_SPI0_SCLK", "P_SPI0_MOSI";
                                actions,pull = <0x0>;
                        };

                        spi0_paddrv {
                                actions,groups = "paddrv1_15_14", "paddrv1_13_12";
                                actions,paddrv = <0x3>;
                        };
                };
        spi@e01d0000 {
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                compatible = "actions,s900-spi";
                reg = <0x0 0xe01d0000 0x0 0x1000>;
                interrupts = <0x0 0x13 0x4>;
                clocks = <0x3 0x3e>;
                clock-names = "spi0";
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <0x2f>;
                spidev@0 {
                        compatible = "rohm,dh2228fv";
                        reg = <0x0>;
                        spi-max-frequency = <20000000>;
                };
        };

And echo xxxx > /dev/spidev0.0 gives me SCLK but not MOSI signal. This is the strange part as I have already set the pinmux in dtb.

Almost a year and support from vendor is none. In the meantime I tried everything that I can do, however the SPI is still not working. Now it makes me think of a hardware issue. The kernel is updated a while ago to 3.10.99, but that is not important. Still no one replies my GitHub issues. E-mail reply from the support ceased from the second conversation. Thank you uCRobotics. You really made me a self-taught linux expert.

Sorry to hear this. I’m not sure there’s much advice I can offer to propel things forward (I like the bubblegum board but I agree that as soon as you venture plug in extra hardware the difficulty level ratchetts up several notches). Anyhow I did enjoy the phraseology of “made me a self-taught linux expert” comment so much I did, at least, want to comment to say that!

1 Like