blikvm icon indicating copy to clipboard operation
blikvm copied to clipboard

Support for Banana Pi BPI-CM4?

Open melroy89 opened this issue 2 years ago • 22 comments

Banana Pi has released a wonderful BPI-CM4 hardware module compatible with the Raspberry Pi cm4...

Could you verify if your image works on this device? If not. Would you please consider supporting this nice piece of cm4 hardware as well with your images?

More info: https://wiki.banana-pi.org/Banana_Pi_BPI-CM4#System_image

And on the forum: https://forum.banana-pi.org/t/banana-pi-bpi-cm4-computer-module-with-amlogic-a311d/13390

Thanks!!!

melroy89 avatar Apr 14 '23 13:04 melroy89

I am creating an H616 based image using the Armbian system. After this image, some hardware using Armbian images will be easier to port again.

blikvm avatar Apr 14 '23 14:04 blikvm

That sounds great

melroy89 avatar Apr 14 '23 14:04 melroy89

There are btw third party images for the BPI-CM4 available, see: https://wiki.banana-pi.org/Banana_Pi_BPI-CM4#Armbian

@ThomasVon2021 Just wondering if that would mean your image will support this banana chipset as well?

So anyway, do you think I can try to do a estimated bet by buying the banana pi cm4?

Ps. I did bought your Blikvm Pcie card. So in theory hardware wise it should be compatible. Assuming you used only the first hdmi pin connector. (BPI-CM4 only support 1 hdmi instead of 2 hdmi connections with the Raspberry Pi cm4)

melroy89 avatar Apr 14 '23 14:04 melroy89

Yes or no? Should I try to order the BPI-CM4? Assuming the new image will support it?

melroyvandenberg avatar Apr 19 '23 15:04 melroyvandenberg

The new mirror is launched with an Armbian system based on the H616 chip.

blikvm avatar Apr 21 '23 14:04 blikvm

Uh ok.. sure, but the Banana Pi BPI Compute Module 4 is using the Amlogic A311D chip. But hopefully it will support that chip as well as you try to mention earlier I guess.

What do you mean with "New mirror is launched"?

melroy89 avatar Apr 21 '23 22:04 melroy89

Hmmm I think I will just buy a Rasp CM4.. That works at least.

EDIT: Nevermind, I can't buy a Raspberry CM4 anymore.. It's ALL SOLD OUT!

melroy89 avatar Apr 24 '23 18:04 melroy89

You can buy on this link: https://www.aliexpress.us/item/3256805010517286.html?gps-id=pcStoreJustForYou&scm=1007.23125.137358.0&scm_id=1007.23125.137358.0&scm-url=1007.23125.137358.0&pvid=a836ab78-eeb0-4c86-8433-26e90e1be101&_t=gps-id%3ApcStoreJustForYou%2Cscm-url%3A1007.23125.137358.0%2Cpvid%3Aa836ab78-eeb0-4c86-8433-26e90e1be101%2Ctpp_buckets%3A668%232846%238113%231998&pdp_npi=3%40dis%21USD%2172.65%2172.65%21%21%21%21%21%402103200516824009886804703e0f21%2112000032095720174%21rec%21US%21251804802&spm=a2g0o.store_pc_home.smartJustForYou_6000897758043.3&gatewayAdapt=glo2usa&_randl_shipto=US

blikvm avatar Apr 25 '23 05:04 blikvm

We have created a new hardware based on H616, called blikvm V4, which is still under testing. You can join Discord to see more information.

blikvm avatar Apr 25 '23 05:04 blikvm

But I already bought Blikvm Pcie version v3.. Which needs a CM4 module... I really think we are still talking past each other.

I want to use a Banana Pi BPI inside the Blikvm Pcie card.

Unless this card isn't shipped yet, you want to sent me the v4? See order number: 8138090434501280

melroy89 avatar Apr 28 '23 15:04 melroy89

The PCIe version is designed specifically for CM4 and cannot be replaced with other modules. Because different chip pin definitions are different.

blikvm avatar Apr 29 '23 00:04 blikvm

Maybe you should better look into the Banana Pi BPI-CM4 ... It's pin compatible. It's compatible with cm4 from raspberry.

image

This whole github issue is about to support that module, the pin layout isn't the problem at all. It's only a different cpu chip you might need to support in the image.

melroy89 avatar Apr 29 '23 12:04 melroy89

So in order to have HDMI input, we use CSI, so far so good. CSI is actually supported by the Banana Pi BPI-CM4 as well.. but only 1 port (CAM1). And the 2nd CSI (CAM0) is not connected. So I hope you are not using 128-138 pins for CSI. But instead you use one of the ports in the pins 115-141?

EDIT: We talked on the chat (Discord), be we sorted it out. CSI is connected to CAM1. Which is luckily pin 115 until 141, since CAM0 is not connected on the Banana Pi variant.

image

melroy89 avatar May 03 '23 14:05 melroy89

Small update, I received the Banana PI CM4 module. I first tested the default Ubuntu Mate provided image from Banana Pi, which is booting from SD card. SO far so good, next will be trying to boot the BliKVM image from this hardware. Finally, I need to try to boot the image eventually from the SD card inside the BliKVM PCIe hardware.

https://www.youtube.com/watch?v=wU6zKKlJtbQ

melroy89 avatar May 16 '23 18:05 melroy89

I think you need build blikvm software on a armbian os or Ubuntu Mate. You can refer to https://github.com/ThomasVon2021/blikvm/blob/master/dev-readme.md. If you have any questions, we can discuss them at any time.

blikvm avatar May 17 '23 01:05 blikvm

I think so as well. Raspberry Pi OS Lite is actually already Debian. But it might need the additional linux device trees files. That's it.

melroy89 avatar May 17 '23 10:05 melroy89

If you use Armbian, it should be relatively smooth. Currently, I have been completely successful in using Armbian on H616

blikvm avatar May 18 '23 00:05 blikvm

Despite the Banana Pi CM (CM4IO) device tree dtb file being present in the /boot/dtb/amlogic folder of the official Banana Pi Armbian Image. These device tree files are also present in the amlogic Linux kernel.

image

I can not see the GPIO numbers (gpio<number> file) in the /sys/class/gpio/ folder... Too bad. Which is a requirement for ArmbianIO code to get it working.

image

And the gpioinfo command gives (showing all "unnamed"):

gpiochip0 - 85 lines:
	line   0:      unnamed       unused   input  active-high 
	line   1:      unnamed       unused   input  active-high 
	line   2:      unnamed       unused   input  active-high 
	line   3:      unnamed       unused   input  active-high 
	line   4:      unnamed       unused   input  active-high 
	line   5:      unnamed       unused   input  active-high 
	line   6:      unnamed      "reset"  output   active-low [used]
	line   7:      unnamed       unused   input  active-high 
	line   8:      unnamed       unused   input  active-high 
	line   9:      unnamed       unused   input  active-high 
	line  10:      unnamed       unused   input  active-high 
	line  11:      unnamed       unused   input  active-high 
	line  12:      unnamed       unused   input  active-high 
	line  13:      unnamed       unused   input  active-high 
	line  14:      unnamed       unused   input  active-high 
	line  15:      unnamed       unused   input  active-high 
	line  16:      unnamed       unused   input  active-high 
	line  17:      unnamed       unused   input  active-high 
	line  18:      unnamed       unused   input  active-high 
	line  19:      unnamed       unused   input  active-high 
	line  20:      unnamed       unused   input  active-high 
	line  21:      unnamed       unused   input  active-high 
	line  22:      unnamed       unused   input  active-high 
	line  23:      unnamed       unused   input  active-high 
	line  24:      unnamed       unused   input  active-high 
	line  25:      unnamed       unused   input  active-high 
	line  26:      unnamed       unused   input  active-high 
	line  27:      unnamed       unused   input  active-high 
	line  28:      unnamed       unused   input  active-high 
	line  29:      unnamed       unused   input  active-high 
	line  30:      unnamed       unused   input  active-high 
	line  31:      unnamed       unused   input  active-high 
	line  32:      unnamed       unused   input  active-high 
	line  33:      unnamed       unused   input  active-high 
	line  34:      unnamed       unused   input  active-high 
	line  35:      unnamed       unused   input  active-high 
	line  36:      unnamed       unused   input  active-high 
	line  37:      unnamed      "reset"  output   active-low [used]
	line  38:      unnamed       unused   input  active-high 
	line  39:      unnamed       unused   input  active-high 
	line  40:      unnamed       unused   input  active-high 
	line  41:      unnamed       unused   input  active-high 
	line  42:      unnamed       unused   input  active-high 
	line  43:      unnamed       unused   input  active-high 
	line  44:      unnamed       unused   input  active-high 
	line  45:      unnamed       unused   input  active-high 
	line  46:      unnamed       unused   input  active-high 
	line  47:      unnamed         "cd"   input   active-low [used]
	line  48:      unnamed       unused   input  active-high 
	line  49:      unnamed       unused   input  active-high 
	line  50:      unnamed       unused   input  active-high 
	line  51:      unnamed       unused   input  active-high 
	line  52:      unnamed       unused   input  active-high 
	line  53:      unnamed       unused   input  active-high 
	line  54:      unnamed       unused   input  active-high 
	line  55:      unnamed       unused   input  active-high 
	line  56:      unnamed       unused   input  active-high 
	line  57:      unnamed      "reset"  output   active-low [used]
	line  58:      unnamed       unused   input  active-high 
	line  59:      unnamed       unused   input  active-high 
	line  60:      unnamed       unused   input  active-high 
	line  61:      unnamed       unused   input  active-high 
	line  62:      unnamed       unused   input  active-high 
	line  63:      unnamed       unused   input  active-high 
	line  64:      unnamed       unused   input  active-high 
	line  65:      unnamed       unused   input  active-high 
	line  66:      unnamed       unused   input  active-high 
	line  67:      unnamed       unused   input  active-high 
	line  68:      unnamed       unused   input  active-high 
	line  69:      unnamed       unused   input  active-high 
	line  70:      unnamed       unused   input  active-high 
	line  71:      unnamed       unused   input  active-high 
	line  72:      unnamed       unused   input  active-high 
	line  73:      unnamed       unused   input  active-high 
	line  74:      unnamed       unused   input  active-high 
	line  75:      unnamed       unused   input  active-high 
	line  76:      unnamed       unused   input  active-high 
	line  77:      unnamed       unused   input  active-high 
	line  78:      unnamed       unused   input  active-high 
	line  79:      unnamed       unused   input  active-high 
	line  80:      unnamed       unused   input  active-high 
	line  81:      unnamed       unused   input  active-high 
	line  82:      unnamed     "enable"  output  active-high [used]
	line  83:      unnamed "device-wake" output active-high [used]
	line  84:      unnamed       unused   input  active-high 

cat /sys/kernel/debug/gpio gives only:

gpiochip1: GPIOs 412-426, parent: platform/ff800000.sys-ctrl:pinctrl@14, aobus-banks:
 gpio-414 (                    |green:status        ) out lo 
 gpio-415 (                    |enable              ) out hi 
 gpio-419 (                    |blue:status         ) out lo 
 gpio-421 (                    |VDDIO_C             ) out lo 

gpiochip0: GPIOs 427-511, parent: platform/ff634400.bus:pinctrl@40, periphs-banks:
 gpio-433 (                    |reset               ) out hi ACTIVE LOW
 gpio-464 (                    |reset               ) out hi ACTIVE LOW
 gpio-474 (                    |cd                  ) in  lo ACTIVE LOW
 gpio-484 (                    |reset               ) out hi ACTIVE LOW
 gpio-509 (                    |enable              ) out hi 
 gpio-510 (                    |device-wake         ) out lo 

melroy89 avatar Jul 23 '23 20:07 melroy89

Sorry, I missed this message. I'll ask my hardware colleague for a response later.

blikvm avatar Sep 22 '23 13:09 blikvm

You need fan、oled、atx gpio number, right?

blikvm avatar Sep 22 '23 13:09 blikvm

I need the Banana Pi CM4 GPIO pin numbers as a Linux device tree file. In order to use ArmbianIO. ArmbianIO is using the old fashion device tree mapping on disk: /sys/kernel/debug/gpio, so without the correct device tree file, ArmbianIO software can't access the GPIO pins.

ArmbianIO is used by BlikVM (which I hope you know). Therefore, the following file also need to be extended for Banana Pi CM4 as well: https://github.com/ThomasVon2021/blikvm/blob/master/third_lib/GPIO/armbianio.c#L55 (if you know what the int values are in the array for Banana Pi then I could also create a PR upstream project).

And you are correct, without GPIO.. the fan, oled, atx but also simple things like a LED will NOT work... And blikvm software will not start.

melroy89 avatar Oct 06 '23 20:10 melroy89