Rockpi 4 1.4B SPI

I got three pieces of those RockPi 4 v1.4B 4GB. I didn’t order a SPI flash built-in, but I received with this EEPROM chip on board. Now the problem is to have a SPI1 device, since the CS0 is already occupied by flash IC. I am searching to solve the problem by simply using a GPIO for CS1 , but unfortunately the RK3399 doesn’t support cs-gpios in the main linux kernel.

Is there any solution, there are also some custom patches for Linux system to add a cs-gpios, but isn’t up to Rockchip to make a version of their devices to add support for cs-gpios?

I didn’t order a SPI flash built-in, but I received with this EEPROM chip on board

I don’t get it. Can you take a picture of the board?

If you want to use SPI1 on GPIO header, I think the best way is to de-solder to SPI flash on board. The RK3399 only has one CS for each SPI bus.

I understand, but I don’t want to unsolder the EEPROM, because I am afraid I will burn the board. RK3399 has only one CS for each SPI bus - correct. As many other boards, the GPIO is used as second, third,…CS aka cs-gpios. As said, you could contact Rockchip to change their kernel driver to support this, there are also user patches, but all different and not merged into mainline kernel.

I have a solution. Patched kernel and dtb to add one additional CS, you can add them how many you want:

https://forum.armbian.com/topic/12227-httpsforumarmbiancomtopic12227-rockpi-4-spirockpi-4-spi/page/2/

https://forum.armbian.com/applications/core/interface/file/attachment.php?id=5552

You could ask Rockchip if they can merge the patch into mainline kernel.

Rockchip is not responsible for mainline kernel. IDK if there is any official paths and procedures. AFAIK Rockchip maintains 4.4.y only https://github.com/rockchip-linux/kernel

Prepare a patch for here https://github.com/armbian/build/tree/master/patch/kernel/rockchip64-current (and DEV 5.6.y branch) and it will be done in a matter of days and will once finds the way to the mainline. If this is generally desired and prepared by their (higher) standards.

I am a noob in this world, just learning. The patch comes from member of yours team, I guess: martinayotte . I don’t know if it’s a good idea to upload a patch on his behalf due to the intellectual property.

Ask him, but IMHO if you edit patches and send them under your name + adding a reference or claiming co-authorship its perfectly fine. Lots of patches came from the wilderness where we actually don’t know who is the author without high end forensics :slight_smile: Its might be his work or not. I don’t know …

That is fine and welcome.

Hello to you all,

It seems that I am struggling with the same problem. I have a v1.6 Board and as it seems I cannot use the spidev on the bus 1 because it is used by the SPI Flash

Is there a non-hardware changing solution to disabling the SPI Flash?
And in case there is none, would the de-soldering affect me in any other way besides not being able to boot from SPI?

Thank you in advance for your help!
Regards,
Artur

And in case there is none, would the de-soldering affect me in any other way besides not being able to boot from SPI?

Yes, the SPI flash did not store anything except the bootloader, you can also put bootloader on SD card or eMMC. The SPI flash is only useful when user want to boot form NVMe/USB without SD card or eMMC.

It looks the SPI1 device communication of GPIO is getting worse for lack of bandwidth or lower bitrate, while HDMI monitor is connected.

It’s getting better if access and run the code by SSH connected to Rock PI 4b, even the monitor is still connected. Is there any solution to fix it?

Just for your Information if somebody is interested,

I ended up de-soldering the SPI Flash. Took some time and was a bit messy (I scratched the board a bit but without cutting any connections).

Once the SPI Flash was out, everything started to work as expected

It seems to me redundant to have both a soldered SPI Flash, and a eMMC. I am using the bootloader on the eMMC and the OS is flashed on the NVMe, it is working flawlessly.
Still asking myself if the SPI Flash can be somehow disabled on boot.
Anyway, too late for me to investigate this.

Thanks, will try it out.

The individual users and the project users have different requirements. If you are an early user in this forum, you will find many users want to boot off NVMe SSD directly, which requires the SPI flash.

hi, I tried to de-solder the SPI Flash, but it looks does not work much. Any other ideas are welcome.

I see the log about spi as below.
rockchip-spi ff1d0000.spi: no high_speed pinctrl state