Jean-Francois Lessard Posted August 10 Share Posted August 10 Hi I've made a new kernel Auxiliary Display Driver for TM16XX and compatible LED controllers. This driver supports various LED controller chips, including TM16XX family, FD6XX family, PT6964, and HBS658. It provides support for both I2C and SPI interfaces. I wanted it to manage the hardware on the kernel space while having an easy sysfs user space interface. It also aims to reduce the code to maintain by relaying on existing kernel features instead of recoding them. Plus, you can switch to hardware i2c/spi (instead of software gpio) depending on the pins used. You can use "vfdconf-convert" to convert your existing vfd.conf to its device-tree version. Or you can use the already converted vfd.conf of https://github.com/arthur-liberman/vfd-configurations that are listed in the device table. You don't need to manually edit your device tree, the "make" command will apply the device tree source overlay to your dtb. It comes with a service written as a simple bash script. So it's easily customizable without having to write custom C code. Instructions and source code at https://github.com/jefflessard/tm16xx-display/ Could you please give it a try and report your feedback? 2 Quote Link to comment Share on other sites More sharing options...
ning Posted August 11 Share Posted August 11 I'm happy to and will test your driver on JianPian Rk3566 TV box. 0 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted August 11 Author Share Posted August 11 @ning thank you! Do you have an existing vfd.conf for this device? Couldn't find one online. Let me know if you need help for it's configuration. 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 11 Share Posted August 11 I don't have vfd.conf. I can try the drivers one by one, then try to write a conf. 0 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted August 12 Author Share Posted August 12 I have added rk3566-h96-max-v56 to the repo. You could try with this one. I think the JianPian is very similar to H96 Max V56 so I made this config file from this post. This is a blind attempt... I have no much info on the JianPian and I have no way to test the config. Let me know if it works for you. 2 Quote Link to comment Share on other sites More sharing options...
ning Posted August 12 Share Posted August 12 OK, I will try this suggestion. 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 13 Share Posted August 13 the correct part is VFD device is fdhisi,fd6551, I see the chip on board. but the i2c gpios are icorrect.. 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 13 Share Posted August 13 it's on i2c4. I don't see I2c error during probe. please let me know what to do next! &i2c4 { status = "okay"; vfd@24 { compatible = "fdhisi,fd6551"; reg = <0x24>; tm16xx,digits = [04 03 02 01]; tm16xx,segment-mapping = [03 01 02 06 04 05 00]; #address-cells = <2>; #size-cells = <0>; led@0,0 { reg = <0 0>; function = LED_FUNCTION_ALARM; }; led@0,1 { reg = <0 1>; function = LED_FUNCTION_USB; }; led@0,3 { reg = <0 3>; function = "play"; }; led@0,2 { reg = <0 2>; function = "pause"; }; led@0,4 { reg = <0 4>; function = "colon"; }; led@0,5 { reg = <0 5>; function = LED_FUNCTION_LAN; }; led@0,6 { reg = <0 6>; function = LED_FUNCTION_WLAN; }; }; }; 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 13 Share Posted August 13 use sysfs leds interface to control it but it doesn't show any thing... 0 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted August 13 Author Share Posted August 13 All LEDs should be on when you probe the driver, before writing to sysfs LEDs. You can also enable debug to see what bytes are being written to the controller. ``` systemctl stop display make debug module-install rmmod tm16xx # clear previous kernel logs dmesg -c > /dev/null modprobe tm16xx # you should see all LEDs ON # check probe logs dmesg -c echo 1 > /sys/class/leds/display\:\:lan/brightness # you should see only LAN led on # check new logs dmesg -c ``` You can paste the probe logs here so I can see what is happening on the wire 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 13 Share Posted August 13 I checked your code, the i2c address is correct, brightness register is correct. dig registers are correct. it should work, but no. I don't know why, let me check fd6551's VDD. if there no power, will it answer I2C command, I2C write should return -1, but no error in dmesg. 0 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted August 13 Author Share Posted August 13 i2c slaves usually responds with ACK. But maybe rockchip hardware i2c doesn't check this. Of course, if there is no VDD to the controller, this would have to be investigated first. Otherwise, just throwing some ideas here: 1. It might be a problem with hardware i2c. You could use software i2c to validate this assomption. By keeping i2c4 disabled and configuring i2c-gpio instead (example template here). Using i2c-gpio, you should see if controller doesn't not ACK in dmesg. 2. May be an issue with the led controller identification. For example, some magicsee-n5 boards have the fd6551 chip but use brightness commands of the fd655 chip. You could try setting compatible to "fdhisi,fd655". In anyway, it would be easier to start from a known working configuration. Since you don't have an OpenVFD vfd.conf, would you mind sharing the Android dtb from the original firmware? 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 13 Share Posted August 13 after read spec, 7 SEG pins for 7 LEDs (LAN, WIFI...etc) and 4 DIG pins control 4 digital. 5 DIG pins are controlled by 66h~6eh, while 4 digitals how to control seg pins? use 1 DIG pin? I guess Yes. each digital has 7 LEDs, and there also 7 Seg LED. write number to DIG register, at least 1 LED will on. OK. 1 DIG pin controls 1 digtal, and each digital has 7 seg, 1 seg connects to 1 SEG pin. there are 5 digitals (one virtual), and they share SEG pins. So let me check VDD. 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 13 Share Posted August 13 it's easy to try fd655 and i2c-gpio. and I read Android dts many times, not findings. jianpian.dts 0 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted August 14 Author Share Posted August 14 After reviewing your original dtb I found that i2c4 is disabled (i2c@fe5d0000 uses pinctrl with phandle <0xdd>). But 2 pins are defined on the top level fddis_dev: ``` fddis_dev { fddis_gpio_dat = <0x35 0x0c 0x00>; fddis_gpio_clk = <0x35 0x0b 0x00>; compatible = "fddis_dev"; status = "okay"; }; ``` This means that original firmware uses software i2c. So start with i2c-gpio first. Once everything works then you could later try moving to hardware i2c if you like. Please try the conf I've created for you. It already has this pin definition: rk3566-h96-max-v56. 0 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted August 14 Author Share Posted August 14 (edited) I've looked at rk3368.dtsi and there is no hardware i2c on pins RK_PB3 and RK_PB4. So you really need to stick to software "i2c-gpio". Edited August 14 by Jean-Francois Lessard 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 14 Share Posted August 14 i2c1 { /omit-if-no-ref/ i2c1_xfer: i2c1-xfer { rockchip,pins = /* i2c1_scl */ <0 RK_PB3 1 &pcfg_pull_none_smt>, /* i2c1_sda */ <0 RK_PB4 1 &pcfg_pull_none_smt>; }; }; phandle 0x35 is gpio0 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 14 Share Posted August 14 [ 23.946809] tm16xx 4-0034: Display initialized successfully i2c4 is bad, any address can have good write result. 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 14 Share Posted August 14 use i2c1, error timeout, use gpio-i2c error no such device. let me check power VDD. 0 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted August 14 Author Share Posted August 14 3 hours ago, ning said: use gpio-i2c error no such device 3 hours ago, ning said: phandle 0x35 is gpio0 gpio-i2c is not the same as i2c-gpio. Have you tried rk3566-h96-max-v56 ? Pins already refer to &gpio0 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 18 Share Posted August 18 VDD has 3.3V.. I have no idea now. 0 Quote Link to comment Share on other sites More sharing options...
ning Posted August 28 Share Posted August 28 in fd6551 data sheet, page 7, it says: clk better lower than 100K. I don't know how to set i2c-rockchip or i2c-gpio to 100k or lower? i2c-gpio,delay-us = <10>; ? http://www.fdhisi.com/down/upload/20191023/1571794231.pdf 0 Quote Link to comment Share on other sites More sharing options...
Berserker Posted September 19 Share Posted September 19 (edited) On step make install error Скрытый текст root@rk3318-box:~/tm16xx-display# make install make EXTRA_CFLAGS="" -C /lib/modules/6.8.11-edge-rockchip64/build M=/root/tm16xx-display modules make[1]: Entering directory '/usr/src/linux-headers-6.8.11-edge-rockchip64' make[3]: *** No rule to make target 'scripts/mod/modpost', needed by '/root/tm16xx-display/Module.symvers'. Stop. make[2]: *** [/usr/src/linux-headers-6.8.11-edge-rockchip64/Makefile:1873: modpost] Error 2 make[1]: *** [Makefile:240: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.8.11-edge-rockchip64' make: *** [Makefile:28: module] Error 2 sory i have rk3318 4gb ram and fd628, box name t9 Edited September 19 by Berserker 0 Quote Link to comment Share on other sites More sharing options...
L Jumadi Posted September 24 Share Posted September 24 Hi @Jean-Francois Lessard I try your openvfd version on my Tanix Tx3mini Clone but get error FDT_ERR_NOTFOUND, Im using make tx6-allwinner-h6.dtb ORIGINAL_DTB=original.dtb as My Tanix use Allwinner H616. when I try to make install it success but I guess without proper dts config It still unusable 0 Quote Link to comment Share on other sites More sharing options...
L Jumadi Posted September 26 Share Posted September 26 Trying to seek solution it seems it depend very much on overlay which is new implemented in armbian, especially for my TV box chip. I use dtmerge to debug overlay creation and error cant find symbol either gpio or gpiochip1 and get warning overlay map not loaded and no matching platform found.. while trying on arthur-liberman give compilation error also 0 Quote Link to comment Share on other sites More sharing options...
L Jumadi Posted October 1 Share Posted October 1 Im succeed with liberman open_vfd . Im troubled before because my box using chip / bank name different than usual aobank_chip or gpiochip. Still not inspect your code further but if you not using the chip_name config then its not compatible with my box 0 Quote Link to comment Share on other sites More sharing options...
jock Posted October 4 Share Posted October 4 Hello @Jean-Francois Lessard, congratulations for the excellent driver! I stumbled here because I started making myself an fd6551 driver , and just after I discovered you already published a fully working product, which is way more polished than mine. Anyway, I did not have yet the chance to tm16xx driver, but will do soon and report here the result. I have a HK1 box with rk3318 and fd6551 chip on board. 1 Quote Link to comment Share on other sites More sharing options...
jock Posted October 5 Share Posted October 5 In the meantime I integrated the driver into armbian for rockchip64 targets: https://github.com/armbian/build/pull/7338 , so it will be a bit easier to test it out-of-the box and it would also be easier for amlogic people to copy-paste the driver patch and integrate the device trees as well. My tests on hk1 rk3318 tv box (board silkscreen YX_RK3318) worked like a charm and the display is now pleasantly showing up-to-date date and time 3 Quote Link to comment Share on other sites More sharing options...
Jean-Francois Lessard Posted yesterday at 12:30 AM Author Share Posted yesterday at 12:30 AM @jock Thank you! It's always nice to know that your work is appreciated. Thanks also for the pull request. Since I can't test all configuration combinations myself, the idea was to contribute this driver to mainline Linux once there are sufficient reports of it working properly. Your pull request makes this one step closer @L Jumadi I am less familiar with Allwinner SoCs and it gpio driver. After looking at sun50i-h6-tanix.dtsi (line 34) and sun50i-h6.dtsi (line 352) it looks like its using a multi cell pin controller. This is not about supporting the same chip_name config as OpenVFD but rather configuring the device tree properly. I've updated https://github.com/jefflessard/tm16xx-display/blob/main/devices/tanix-tx6-allwinner-h6.dtso to use the same pin configuration as in sun50i-h6-tanix.dtsi so you can test it. I think it should works now, if not, then someone with more knowledge of Allwinner than I have would need to figure out the appropriate device tree configuration. I'll then be glad to update the device tree configuration on my GitHub to make it easier for next users. 0 Quote Link to comment Share on other sites More sharing options...
L Jumadi Posted yesterday at 05:52 AM Share Posted yesterday at 05:52 AM (edited) @Jean-Francois Lessard thanks, I try make dtb now without error. Make modules ok but when I run sudo make module-install (or make clean?) sometimes it remove build directory. then I try again it create new lib/modules/6.7.12 directory while my original 6.7.12-edge-sunxi64 still there then error but tml16xx.ko already installed on updates directory so I try modprobe it success make service-install no error but when I check with systemtl status display it error Failed to start Display service May be its my system that not using standar (armbian unofficial) but for libermann make and modules install all ok Need to mention in readme.md also statement for make module make module-install make service-install as many newbie confuse Still dunno where to check which step really make it failed Edited yesterday at 06:07 AM by L Jumadi add additional make clean that I also do 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.