Compile sc16si7xx.ko for rasbian - how?

Running 2019-02-26-Raspbian-lite.img on a balenafin v1.1 (with a CM3+)

and I need to apply a patch against sc16is7xx.ko to fix hardware flow control.

I tried checking out git clone --depth=1 --branch rpi-4.19.y https://github.com/balena-os/linux.git but this produced more dts overlays than could fit on /boot

Is there an easier way to do this?

I tried installing the stuff I compiled for the 3B+ while working out the kinks with the sc16is752 but failed to boot on the balena. If there are instructions on how to take the stock raspbian kernel and make it work with the balena / CM3 then I’ll be happy to pursure that instead.

Hi,

What hardware flow control problem are you trying to fix? You might also want to ask on the Raspberry Pi forums (https://www.raspberrypi.org/forum) for help on patching the kernel on the Rasbian Lite.

I’ll raise this up to our balenaFin engineering team and see how we can help you out.

Regards,
Carlo

Hi,

I realized you were referring to the Raspbian Image that we do provide for the balenaFin: https://www.balena.io/fin/1.1/docs/downloads/

I already raised your problem to the team and they would also like to help you on the patching as well. Can you let us know what hardware you are trying to run with the balenaFin? It would be nice if you can share to us your use case for what you are building.

Cheers,
Carlo

CTS didn’t work properly with the old driver. The patch I linked to fixes it and is in the raspbian repo already; just want to get it running on the Balenafin, with the Raspbian image for now (probably using BalenaOS later).

Use case is using a SC16SI752 SPI to UART chip to add another Bluetooth low energy 5 radio using HCI uart interface. Hat is public here

(edit I suppose I also need some patches for the device tree as well, but easier to add manually (sc16is752-spi1-overlay.dts and sc16is752-spi0-overlay.dts ))

Hey,

The patch you are referring to, is not merged upstream nor released yet, so you are right in thinking to manually patch kernel for this. So please detail each step you took for patching our Raspbian distro. And we will love to help you through this.

Yes, its was only just commited after I poked an old issue, and the spi1 overlay I had to write myself.

I basically followed this for Raspbian https://www.bluetooth.com/blog/how-to-setup-bluez-on-raspberry-pi-and-support-pb-adv/

The question seems to be where do I get the kernel sources used for the Rasbian image - or are they just the plain Rasbian kernel? I initially tried using same sources, built for Pi3 but that kernel didn’t boot.

Hey, just wanted to say that we are still looking into this and we will get back to you. Thank you for your patience :slight_smile:

Seems the provided raspbian image doesn’t support ID EEPROM from a HAT which pushed the whole thing a bit down on the list of things to get done.

ID EEPROM is detectd on i2c-0 (address 50) but there is no /proc/device-tree/hat after booting with the HAT plugged in. (nor is the device tree overlay loaded from EEPROM)

The ID EEPROM solves both the device tree overlay issue as well as providing an uuid.

pi@balenafin:~ $ for item in /proc/device-tree/hat/*; do echo -n "$item: ";cat $item; echo; done
/proc/device-tree/hat/*: cat: '/proc/device-tree/hat/*': No such file or directory

pi@balenafin:~ $ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@balenafin:~ $

Will get back to poking it soon™

(edit: between this, this and this i got correct kernel source and config to compile a patched module that works along with adding the dtoverlay manually)

Hi,

I have had an update from our team about this; we’re planning to discuss it internally to see if we can simplify the build process for this image. I do not have a timescale for this at the current time.

Regards.

no rush on my end.

finding the old config helped alot

sudo modprobe configs
zcat /proc/config.gz >.config

combined with the other stuff for getting the (correct) kernel source. however the bigger issue is the HAT support (although I need to go back to the stock image to see if that makes a difference, plan raspbian on a Pi3 does work as expected)

Hi, can you please elaborate more on the issue you are having regarding HAT support? the only thing that needs devicetree configuration is the HAT EEPROM parsing that we enable in the balenaFin dt-blob.bin https://github.com/balena-io/balena-fin/tree/master/software/dt-blob

I don’t know how the internals of the HAT detection and parsing works so I can’t add much besides “didn’t work” and that the I2C wiring seems to be working. (same HAT is detected and parsed on Raspberry Pi 2,3, and 4 no problem)

(Will update if I find the time to do some more digging, but more likely will focus on the plain Raspberry Pi for now)

Thanks for following up @ bearer
Feel free to share more info with us, once you have more time to run your tests on BalenaFin.