I’m trying to get a Rock Pi 4B v1.4 working with two peripherals:
- The HifiBerry DAC+ Pro XLR, an I2S based DAC and
- a Waveshare 3.5 inch RPi LCD (B) display, which is SPI based
I have adapted drivers for the DAC+ Pro and created the relevant device tree bindings and it works fine. I’ve also created device tree bindings for the display, together with a short wiring harness that connects it either to SPI2, which is free, or to SPI1 which is used for the on-board flash, so that I needed to use an additional GPIO CS line in the device tree binding.
My problem is this: with the DAC+ Pro board connected and the display connected on top of it, if I blacklist the DAC’s kernel modules, the display seems to work more or less fine at a 10MHz SPI clock. I can use modetest to make it display a test pattern.
Probing the SPI1 lines with an oscilloscope shows the clock line being like a sawtooth (or rather what you would get from a square waveform, if the low-to-high transitions were linear ramps), rising to only 2V before dropping back to 0V. I would ascribe this to capacitive loading of the line due to the DAC+ headers and wiring harness, but the curious thing is that the data lines show up much better on the oscilloscope, reaching 3V with minimal capacitive loading showing.
If I allow the DAC+ drivers to load, then the SPI bus becomes unusable at anything above 100kHz or so. The display doesn’t work any more and probing the clock line shows again a sawtooth waveform, now barely reaching 0.5V or so. The data lines are also sawtooth like, although they can reach higher voltages, depending on the number of consecutive high states. In order to get the SPI bus to work, I have to drop the clock speed to something on the order of 100 kHz or so.
The situation is similar with the SPI2 bus.
I’m running Libreelec with a 6.6 version kernel. Any hints as to how this behavior might be explained and what I might look into, would be most welcome.