lg4k-linux icon indicating copy to clipboard operation
lg4k-linux copied to clipboard

Changed board name to gc573

Open cdorn0 opened this issue 4 years ago • 8 comments

Changed board name to gc573; Changed printk to use the module name for kernel messages; extracted library and patched to a working version

cdorn0 avatar Mar 23 '21 08:03 cdorn0

Hey, first of all thanks, that seems like a decent amount of work. But have you checked if those patches also work with the newer driver version? Getting that one to work properly is imo more desireable since it finally added support for RGB/444 video modes rather than being limited to 422.

derrod avatar Mar 23 '21 10:03 derrod

Hi, the development branch is a mix of the new driver version and the older one. The only thing missing is the actual FPGA control file (aver_xilinx.o) and the bmp loader (pic_bmp.o) as I did not get it to work with the board source files. Furthermore I did not add the new color schemes NV12/YV12, as they require some rework. It might be possible that it works better with the board objects they shipped with the new driver. I am working on the RGB3 support right now, but I am a little short on time. The other open point is the RGB LED stuff, because the red blinking is a little bit annoying. Unfortunately I am not familiar with the windows driver model and windows driver debugging, so I am still not sure how to start there. Yet I was able to find out, that the LEDs are directly controlled by the FPGA, there is no special driver used. Furthermore the 6-Pin Header is in fact a XILINX JTAG port and the FPGA identifies itself to be a Artix7 XC7A100. Unfortunately the PCIe BAR config indicates that it is not a simple AXI GPIO attached to a AXI2PCIe bridge.

cdorn0 avatar Mar 23 '21 12:03 cdorn0

Firstly I wanted to say thank you to both of you. I found this PR really useful, I'm on Archlinux and I can confirm this compiles and I can get the card working with the latest 5.11.12 kernel. Initial basic tests show video is playing back nicely - audio seems to drift a lot. There seems to be something up kworker as i'm getting a lot of:

BUG: scheduling while atomic: kworker/3:3/1224/0x00000002 and BUG: workqueue leaked lock or atomic: kworker/3:3/0x7fffffff/1224 last function: sys_work_func [gc573]

This version is a lot better because at least I can poweroff/reboot without forcing the machine off. I'm going to see if I can get my head around some of the issues I'm experiencing - I've got some basic kernel knowledge so this will be a good learning exercise. If this works well under other distros then I think it's worth considering merging.

antpk avatar Apr 09 '21 22:04 antpk

@derrod I will be creating an AUR package for ArchLinux this week to make it easier to use this driver. Take a look at this branch:

https://github.com/antpk/lg4k-linux/tree/devwithlatestdriver

This is @antpk's branch that adds the new driver to @cdorn0's branch. There are a couple of changes necessary. The install.sh script needs to be updated to point to cx511h.ko instead of gc573.ko (unless making other adjustments), and the comment at this commit needs to be reviewed/resolved:

https://github.com/antpk/lg4k-linux/commit/d5fcb4604e919a7e0082302af1edf90ecbd5a4c4

I will be doing testing tonight.

It would be ideal if the AUR package referred to this repo rather than antpk's, assuming you intend to continue maintaining this driver. Please let me know your thoughts.

Also, hi @illwieckz I see you everywhere I swear

Gelmo avatar Nov 18 '21 19:11 Gelmo

I don't see why it would be an issue if the AUR package referred to a different repo. This isn't my original work in the first place. If and when I can successfully test the work on any forks I'll merge it.

derrod avatar Nov 21 '21 14:11 derrod

Sounds good, thanks.

Gelmo avatar Nov 21 '21 14:11 Gelmo

I haven't managed to get the card working (i.e. with the driver not crashing the whole system) with any of the patches I tested (including this PR), but I haven't tested https://github.com/antpk/lg4k-linux/tree/devwithlatestdriver yet. Hi @Gelmo :wave:, did you get something working and usable on your end?

illwieckz avatar Nov 21 '21 16:11 illwieckz

@illwieckz Not yet, no. I have the module building via dkms, but it is not functional. Looks like additional adjustments to the board binaries are needed:

[    2.004870] cx511h: pci_model_driver_init, 604: pci_model_driver_init
[    2.004872] cx511h: pci_model_driver_init, 643: id->device=54
[    2.004884] cx511h: pci_model_probe, 134: pci_model_probe prepare
[    2.004895] CL511H 0000:03:00.0: enabling device (0000 -> 0002)
[    2.005033] cx511h: pci_model_probe, 189: set 32bit DMA mask
[    2.005116] cx511h: pci_model_probe, 257: pci_model_probe sub_id=5730
[    2.005117] cx511h: board_probe start
[    2.005146] cx511h: >>aver_xilinx_init
[    2.005160] cx511h: aver_xilinx_init ok
[    2.005161] cx511h: >>aver_xilinx_init_registers
[    2.110173] cx511h: ****************************
[    2.110175] cx511h: chip_version:20201015
[    2.110176] cx511h: ****************************
[    2.110177] cx511h: aver_xilinx_set_i2c_speed bus 0 value 3d
[    2.110178] cx511h: aver_xilinx_set_i2c_speed bus 1 value 138
[    2.110179] cx511h: AVER Xilinx Set I2C Bus:2 Speed:0 value:f9
[    2.180934] cx511h: aver_xilinx_init_registers ok
[    2.180963] cx511h: board_i2c_init
[    2.180963] cx511h: >>>board_probe fail
[    2.180964] cx511h: pci_model_probe, 262: board_probe=8
[    2.180965] CL511H 0000:03:00.0: Driver probe function unexpectedly returned 8
[    2.180977] cx511h: pci_model_driver_init, 679: >>>pci_register_driver ok

Gelmo avatar Dec 01 '21 05:12 Gelmo