This kernel module allows you to interface to a SWI device such as the Microchip ATECC608B through the GPIO pins of a RK3328 based system. It emulates an I2C adaptor so that existing software works out-of-the-box.
You must specify the GPIO number through the gpio_num module parameter. For example:
insmod i2c-swi-gpio.ko gpio_num=82
If successful in communicating with the SWI device, a new i2c adapter should be added to the system. The default emulated i2c address for the device is 0x60, but this can be changed through the i2c_addr module parameter.
The provided Makefile looks for a linux-rockchip within the parent folder of this repository. Either create a simlink to your kernel sources or modify to Makefile to your pleasing. You can then simply build as you would a linux kernel with a valid configuration. For example,
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
- Make the module more generic, perhaps through the kernel pinctrl interface.
- Make use of the kernel devicetree