From: Stephan R. <mai...@op...> - 2010-04-05 23:17:47
|
Hi all, same things about this Nuvoton nct667x driver for lirc. i have manged to build this driver with the actual patch [1]. This driver loads with udev and a device node /dev/lirc0 will be created. But there are some issues running this driver. Background: ASRocks provide this driver [2], created from any Nuvoton developer since beginning this year/ end of last year. I think this driver is GPL2 or later, but there are only one license header in the file lirc_wb677.h. In the original zip file you find precompiled binary drivers for ubuntu 9.10 (32/64bit) and the sources packed as an *.deb file. Compiling the original sources are a pain, because there are some hardcoded paths and special ubuntu things. Between version 1.0.1 and 1.0.4 (actual) there was an splitting from lirc_wb677.c to lirc_wb677_main.c and lirc_wb677_mouse_kbd.c. for this splitting there are an comment in the file lirc_wb677_mouse_kbd.c. It seems the original author has contacted any LIRC forum. This splitting are the reason to create an patch against Jarods kernel patch, because i dont know if its possible to mange the build with two *.c sources in the orginal LIRC (i have tryed this without success - there will be build two seperate kernel modules lirc_wb677_main.ko and lirc_wb677_mouse_kbd.ko. What i have do: - extract the originally sources and copy all included *.h and *.c files to an with Jarods patch patched kernel in drivers/input/lirc. - patch the Makefile and Kconfig to build this driver (with multipart objects) - remove "#include "/usr/src/lirc-0.8.6/drivers/kcompat.h"" from lirc_wb677_common_extern.h - change "#include "/usr/src/lirc-0.8.6/drivers/lirc.h"" to "#include <linux/lirc.h>" in file lirc_wb677_common_extern.h - change "#include "/usr/src/lirc-0.8.6/drivers/lirc_dev/lirc_dev.h"" to "#include "lirc_dev.h"" in file lirc_wb677_common_extern.h - replace all references to "lirc_t" with "int" in the files lirc_wb677_common_extern.h, lirc_wb677.h and lirc_wb677_main.c - add the follow lines to lirc_wb677_main.c: #include <linux/sched.h> #include <linux/module.h> #define MOD_INC_USE_COUNT #define MOD_DEC_USE_COUNT What works, what not: loading the driver via "modprobe lirc_wb677" (also on an system without this nct667 chip)loads lirc_dev and lirc_wb677 but gives: root@openelec:~ # modprobe lirc_wb677 Killed root@openelec:~ # lsmod Module Size Used by lirc_wb677 19760 2 lirc_dev 5376 1 lirc_wb677 root@openelec:~ # dmesg [ 52.277097] lirc_dev: IR Remote Control driver registered, major 251 [ 52.279956] lirc_wb677 w677hga: chip id high: 0xff expect:0xb4 [ 52.279969] lirc_wb677 w677hga: chip id low: 0xff expect:0x73 [ 52.280946] input: MCE Remote Keyboard as /devices/virtual/input/input4 [ 52.284555] BUG: unable to handle kernel NULL pointer dereference at 00000008 [ 52.284569] IP: [<f80c8b39>] 0xf80c8b39 [ 52.284579] *pde = 00000000 [ 52.284586] Oops: 0000 [#1] SMP [ 52.284593] last sysfs file: /sys/devices/pci0000:00/0000:00:0b.0/host1/target1:0:0/1:0:0:0/model [ 52.284601] Modules linked in: lirc_wb677(+) lirc_dev snd_hda_codec_nvhdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec ath5k snd_pcm snd_timer mac80211 snd ath nvidia(P) soundcore cfg80211 snd_page_alloc forcedeth i2c_core rfkill led_class [ 52.284644] [ 52.284653] Pid: 803, comm: modprobe Tainted: P 2.6.33.2 #1 FMCP7A-ION/Aspire R3600 [ 52.284662] EIP: 0060:[<f80c8b39>] EFLAGS: 00010202 CPU: 1 [ 52.284669] EAX: 00000000 EBX: f601c694 ECX: f4cbc19c EDX: 00000000 [ 52.284677] ESI: 00000000 EDI: f601c668 EBP: f601c600 ESP: f4f0bf64 [ 52.284685] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [ 52.284694] Process modprobe (pid: 803, ti=f4f0a000 task=f6515220 task.ti=f4f0a000) [ 52.284701] Stack: [ 52.284705] 00000000 00000010 f6573a40 00000000 f601a668 00000030 f80d96a0 f80d91e7 [ 52.284722] <0> 00000000 b78453a0 00000000 c0401045 f80db398 00000000 b78453a0 f4f0a000 [ 52.284740] <0> c0445d80 b76fe000 bfc0e764 c0402697 b76fe000 000067e0 08eed378 bfc0e764 [ 52.284759] Call Trace: [ 52.284768] [<f80d96a0>] ? 0xf80d96a0 [ 52.284775] [<f80d91e7>] ? 0xf80d91e7 [ 52.284782] [<c0401045>] ? 0xc0401045 [ 52.284789] [<c0445d80>] ? 0xc0445d80 [ 52.284796] [<c0402697>] ? 0xc0402697 [ 52.284802] Code: 3a c8 83 c4 0c 85 c0 89 c6 74 09 89 d8 e8 a4 e8 43 c8 eb 32 c7 45 68 01 00 00 00 b8 58 93 0c f8 e8 13 5d 58 c8 8b 45 60 8b 75 28 <8b> 58 08 e8 4b 7a 4a c8 56 55 53 50 68 a6 91 0c f8 e8 c5 4e 58 [ 52.284897] EIP: [<f80c8b39>] SS:ESP 0068:f4f0bf64 [ 52.284905] CR2: 0000000000000008 [ 52.284913] ---[ end trace e0c956ce55abab8f ]--- /var/log/messages: Apr 5 22:55:54 openelec daemon.notice lircd-0.8.7-CVS[417]: accepted new client on /dev/lircd Apr 5 22:55:54 openelec daemon.err lircd-0.8.7-CVS[417]: could not get file information for /dev/lirc0 Apr 5 22:55:54 openelec daemon.err lircd-0.8.7-CVS[417]: default_init(): No such file or directory Apr 5 22:55:54 openelec daemon.warn lircd-0.8.7-CVS[417]: Failed to initialize hardware on an system *with* this chip is installed all the same except: /var/log/messages: Apr 5 17:27:24 openelec daemon.notice lircd-0.8.7-CVS[447]: accepted new client on /dev/lircd Apr 5 17:27:24 openelec daemon.err lircd-0.8.7-CVS[447]: could not set receive mode Apr 5 17:27:24 openelec daemon.err lircd-0.8.7-CVS[447]: default_init(): Unknown error 515 Apr 5 17:27:24 openelec daemon.warn lircd-0.8.7-CVS[447]: Failed to initialize hardware Apr 5 17:30:50 openelec daemon.notice lircd-0.8.7-CVS[447]: accepted new client on /dev/lircd Apr 5 17:32:21 openelec daemon.info lircd-0.8.7-CVS[447]: removed client unfortunately i have no system with this chip here, and i do this for some users of my little embedded distribution. i am in contact (per email) with an user which have such system, but this user have no experience with debugging etc. so i must explain him what he must do. i hope there are anyone here which can take an look at the patch and the sources and can help me to get this driver running. unfortunately i am not a coder. If you need some informations let me know this. thank you very much Stephan [1] http://sources.openelec.tv/tmp/patches/linux-2.6.33-02-add_lirc_driver_nct667x-0.5.diff [2] http://www.asrock.com/Nettop/download.asp?Model=ION 330HT&o=Linux Am 03.04.2010 22:57, schrieb Stephan Raue: > Am 03.04.2010 22:27, schrieb Jarod Wilson: >> On Sat, Apr 3, 2010 at 3:39 PM, Stephan Raue<mai...@op...> wrote: >> >>> ok, i have managed to compile this driver. more later :-) >>> >> So out of curiosity, are you the original author of the driver, or are >> you just trying to clean up the source asrock or whomever released to >> compile for others as well? >> >> > i am the developer of an mediacenter os (www.openelec.tv) - and i am > also not an c, c++ coder (so i hope i find some people here for help). > also i dont have an ASRock board that needs this driver. But there is > any interest to have this driver included in openelec. > > So i can test this driver not directly - but tomorrow an user of > openelec can do this for me. > > in the beginning of this year was any interest of an lirc driver for > this chipset from many XBMC (www.xbmc.org) users. So ASRock have it > managed that (i think nuvoton) has released an driver for Ubuntu [1] > with sources packed in an *.deb file. but building the sources are > crap, because of many hardcoded paths and ubuntu like things (for > example: #include "/usr/src/lirc-0.8.6/drivers/path/to/file.h"). you > can this see in the original package. it seems the original author > dont want spend many time to this driver. > > because there was an splitting from one *.c sourcefile to two files > between version 1.0.1 and 1.0.4 i have give up to integrate this > driver in the lirc sources. > > if you want, i can contact asrock if i can get the name and email > adress of the author so i can ask him what for a license the driver > have, or if he can release a new version with an license (gpl) header. > > greetings > > Stephan > > [1] http://www.asrock.com/Nettop/download.asp?Model=ION 330HT&o=Linux > -- > ### OpenELEC.tv ### > The free and open Mediacenter Distribution 4 you > http://www.openelec.tv > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev -- ### OpenELEC.tv ### The free and open Mediacenter Distribution 4 you http://www.openelec.tv |