VIM4 GPIO issues

Hello to all, this is my first post.
VIM4 board, Ubuntu 22.04 LTS, kernel 5.4.125, custom hw is connected to 40 pins GPIO header, for access I’m using WiringPi from Khadas github repo.
My aplication requires SPI, I2C ports and 4 GPIO but Linux kernel is using I2S for audio and UART_E. I have only opened pin 18 (GPIOD_5, 39 on 10J1 connector). As my understanding Fenix is for building Vim4 firmware but I got error saying jammy (22.04 LTS) not supported?
Also when I free I2CM_F pins only GPIOY_17 can be accessed but as GPIO pin 7 (not as pin 6 as per table after gpio readall command). When I try to open GPIO 3 (GPIOY_6) my USB keyboard and mouse freeze. How to free I2S for GPIO use?

Hello @yt7pwr

You can edit dts to disable I2S to release GPIOs now, for next release we will provide overlays to enable/disable I2S function.

Thanks for help, it is working with Ubuntu 20.04 as a build host. Now I need to fix SPI port because it is turned off somewhere in dts script :frowning:

I cant find where is SoC A311 SPI_A defined in Vim4 dts file.
Khadas-vim4-linux-5.4-dt-overlays_1.1~20220829_arm64.deb do not contain any spi*.dtbo file.
Any help would be appreciated.

Please double check.

root@Khadas:~# dpkg -L khadas-vim4-linux-5.4-dt-overlays | grep spi

No spi0.dtbo inside. I also did not find spi0.dts inside fenix folder. Inside kvim4.dts only one line in aliases section:
spi0 = &spifc; but spifc definition is for nor memory?

spi0.dtbo has no releationship with spi0 = &spifc, spi0.dtbo overlay is to enable spidev.

Where in fenix folder, in what file is located definition or enable/disable options for spi0?

Ok, I saw that repo before but I was under impression that should be automatically downloaded by fenix script?

In aliases kvim4.dts:
spi0 = &spicc0
I added lines before &spicc2:
&spicc0 {
status = “disabled”;
pinctrl-names = “default”;
pinctrl-0 = <&spicc0_pins>;
cs-gpios = <&gpio GPIOT_21 GPIO_ACTIVE_HIGH>;

Now I have node /dev/spidev0.0 but with one problem: test program in Wiringpi examples folder spiSpeed displays poor results for transfer speed (Mb/Sec column). SPI CS ping is always 5mS long no mather what speed is selected (1-32MHz).