Hi..
I want check i2c communication with TCA8418 board to beaglebone AM335x processor so that i have downloaded arago toolchin with kerlnel and u-boot from TI SDK
ti-sdk-am335x-evm-05.04.01.00 version.I have booted SD Card with newly cross compiled kernel(version 3.2.0 and tca8418 module has beed added externaly)
and u-boot 2011.09.
Board has been booted well But i am unable to communicate i2c with tca8418 board and can't find event from /dev/input/ to check key pressed
Give me solution to check tca8418 keyboard with beaglebone (or)Explain the procedure to work with tca8418 i2c.
what is needed beyond.........solution pls
With Regards
Tamilarasi
I do not have this EVM. I am guessing that your board file needs TCA8418 platform data definition. Is the driver compiled with the kernel or as a loadable module? The device file might not be in /dev/input. Look around in /dev for any tca8418 directories.
Hi...
Thank you for kind responsble answer...
This TCA8418 driver is loaded as a module to kernel 3.2.0. It is ported after cross compiling to am335x process eventhought event is not found in /dev directory.This am335x i2c is communicating throught I2C_2 SDA,SCL lines.
I found in my /dev dirctory only I2c_1 and I2c_3 lines but not I2c_2 .
How to enable i2c_2 line ?
The i2c1 and i2c3 are probably configured in your board file. It should be a file in arch/arm/mach-omap2. Look for the ".o" file to see which one was compiled in. Look in your specific board.c to see how i2c1 and i2c3 are setup. Take care to check for pinmux conflicts.
Loading the TCA8418 module as a loadable module might not work. Usually code in the board.c file adds the i2c device into the i2c core driver. The TCA8418 probably is not written to add itself.
I am trying to interface TCA8418 keyboard with am335x processor throught I2C communication.So I have cross compiled the TI kernel version 3.2.0 for arago toolchain.
Now I2C_3 line is working fine to communicate board with processor. Eventhought TCA8418 driver added as a module, Compilation has done throught procedure.
The problem is event could not occur in beaglebone kernel /dev dirctory.
Is there any other procedure to compile kernel with TCA8418 (or) which kernel would be support for am335x along with tca8418
driver?
By checking cat /proc/interrupts I2C interrupts has incremented when i2cdump 3 0x34 is executed
This is my cross compiled u-boot and kernel
U-Boot SPL 2011.09 (Jul 19 2012 - 10:21:52)Texas Instruments Revision detection unimplementedNo AC power, disabling frequency switchOMAP SD/MMC: 0reading u-boot.imgreading u-boot.imgU-Boot 2011.09 (Jul 19 2012 - 10:21:52)I2C: readyDRAM: 256 MiBWARNING: Caches not enabledNo daughter card presentNAND: HW ECC Hamming Code selectednand_get_flash_type: second ID read did not match 10,10 against 00,00No NAND device found!!!0 MiBMMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1*** Warning - readenv() failed, using default environmentNet: cpswHit any key to stop autoboot: 0 SD/MMC found on device 0reading uEnv.txt33 bytes readLoaded environment from uEnv.txtImporting environment from mmc ...reading uImage3040712 bytes read## Booting kernel from Legacy Image at 80007fc0 ... Image Name: Linux-3.2.0 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3040648 Bytes = 2.9 MiB Load Address: 80008000 Entry Point: 80008000 Verifying Checksum ... OK XIP Kernel Image ... OKOKStarting kernel ...Uncompressing Linux... done, booting the kernel.[ 0.155090] tps65910 1-002d: could not be detected[ 0.207794] Could not set LED4 to fully on[ 0.911102] mtdoops: mtd device (mtddev=name/number) must be supplied[ 1.017120] omap_hwmod: wkup_m3: wkup_m3: hwmod data error: OMAP4 does not support st_shift[ 15.601654] [ 15.601654] CPSW phy found : id is : 0x7c0f1[ 15.608459] PHY 0:01 not found.---O---. | | .-. o o | | |-----.-----.-----.| | .----..-----.-----.| | | __ | ---'| '--.| .-'| | || | | | | |--- || --'| | | ' | | | |'---'---'--'--'--. |-----''----''--' '-----'-'-'-' -' | '---'The Angstrom Distribution beaglebone ttyO0Angstrom v2012.01-core - Kernel 3.2.0
I have checked keyscan using i2c tool commands
i2cdetect -r 3 device ID selectedBefore executing i2cdump 3 0x34(i2cdump i2cline device Id)cat /proc/interrupts CPU0 12: 2634 INTC edma 14: 0 INTC edma_error 18: 41 INTC musb-hdrc.0 19: 1 INTC musb-hdrc.1 30: 3272 INTC omap_i2c 40: 0 INTC cpsw.0 43: 0 INTC cpsw.0 64: 8074 INTC mmc0 68: 5872 INTC gp timer 70: 143 INTC omap_i2c 72: 1664 INTC OMAP UART0 75: 0 INTC rtc0 76: 0 INTC rtc0 77: 0 INTC wkup_m3 78: 1 INTC wkup_m3_txev 93: 576 INTC cpsw.0 94: 101 INTC cpsw.0166: 0 GPIO mmc0Err: 0i2cdump 3 0x34 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: c4 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XX ...............X 30: c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 XX ???????????????X40: c4 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XX ...............X70: c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 XX ???????????????X80: c4 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?............... 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XX ...............Xb0: c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 XX ???????????????X c0: c4 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XX ...............X f0: c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 XX ???????????????XAtter Executing i2cdump 3 0x34cat /proc/interrupts CPU0 12: 2640 INTC edma 14: 0 INTC edma_error 18: 41 INTC musb-hdrc.0 19: 1 INTC musb-hdrc.1 30: 4280 INTC omap_i2c 40: 0 INTC cpsw.0 43: 0 INTC cpsw.0 64: 8104 INTC mmc0 68: 6644 INTC gp timer 70: 143 INTC omap_i2c 72: 2042 INTC OMAP UART0 75: 0 INTC rtc0 76: 0 INTC rtc0 77: 0 INTC wkup_m3 78: 1 INTC wkup_m3_txev 93: 634 INTC cpsw.0 94: 111 INTC cpsw.0166: 0 GPIO mmc0Err: 0
Kindly give me solution to this problem.
With Regards.
Senthamilarasi
Looks like you have managed to hook up your I2C device to i2c3 and you are talking to it. You could just talk to it using i2c but I asusme that you want to use the input interface. I am not sure what you have done so far in the kernel. The 3.2 kernel does not have the TCA8418 driver but later kernels have it. To port over the driver, the following files need to be changed.
File:include/linux/input/tca8418_keypad.hGet from kernel.org or aragohttp://arago-project.org/git/projects/?p=linux-davinci.git;a=blob_plain;f=include/linux/input/tca8418_keypad.h;hb=HEAD
File:drivers/input/keyboard/tca8418_keypad.cGet from kernel.org or aragohttp://arago-project.org/git/projects/?p=linux-davinci.git;a=blob_plain;f=drivers/input/keyboard/tca8418_keypad.c;hb=HEAD
File:drivers/input/keyboard/Makefileobj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.oobj-$(CONFIG_KEYBOARD_TCA8418) += tca8418_keypad.oobj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
File: drivers/input/keyboard/Kconfigconfig KEYBOARD_TCA6416 tristate "TCA6416/TCA6408A Keypad Support" depends on I2C help This driver implements basic keypad functionality for keys connected through TCA6416/TCA6408A IO expanders. Say Y here if your device has keys connected to TCA6416/TCA6408A IO expander. Your board-specific setup logic must also provide pin-mask details(of which TCA6416 pins are used for keypad). If enabled the entire TCA6416 device will be managed through this driver. To compile this driver as a module, choose M here: the module will be called tca6416_keypad.config KEYBOARD_TCA8418 tristate "TCA8418 Keypad Support" depends on I2C help This driver implements basic keypad functionality for keys connected through TCA8418 keypad decoder. Say Y here if your device has keys connected to TCA8418 keypad decoder. If enabled the complete TCA8418 device will be managed through this driver. To compile this driver as a module, choose M here: the module will be called tca8418_keypad.config KEYBOARD_MATRIX
File:arch/arm/configs/am335x_evm_defconfig# CONFIG_KEYBOARD_TCA6416 is not setCONFIG_KEYBOARD_TCA8418=yCONFIG_KEYBOARD_MATRIX=y
File:arch/arm/mach-omap2/board-am3517evm.cA platform device needs to be added. I cannot find an example for this. You might want to contact the writer of the driver code. You might be able to guess it by looking at examples of other I2C keypad code on other boards.
Hi ....
Thank you for valuable answer...
As per your advice have modified everthing in kernel regarding TCA8418 driver, Except below mentioned file because it's already existed in kernel as board-am335xevm.c
File:arch/arm/mach-omap2/board-am33xevm.c so i didn't change anything.(i am using am3359 beaglebone processor)
So i cross compiled compiled the kernel using the following steps
step 1: export PATH=~/am335x/ti-sdk-am335x-evm-05.04.01.00/linux-devkit/bin:$PATH
step 2: export ARCH=arm
step 3:export CROSS_COMPILE=arm-arago-linux-gnueabi-
step 4:make ARCH=arm am335x_evm_defconfig
step 5 :make menuconfig ====> here is enabled TCA8418 driver and i2c support modules(as predefined using *)
step 6: make uImage
Finally i got uImage in arch/arm/boot/uImage
Then i ported this uImage to SDcard along with TI u-boot and MLO, Board is booted well.
Eventhought i didn't get Event around /dev and /dev/input directory,
I2c communication is enabled and working fine.
Note: I tried latest kernel 3.4.7 but here board-am335xevm.c support is not existed .
Unable to find the problem in this kernel, Any other solution please (or) Any configuration needs for TCA8418 registers and am335x board.
M.senthamilarasi
The board file absolutely needs to modified to startup the driver. You will not get any event devices until then. There are also other questions of how to specify an GPIO IRQ for asynchronous notification. Might be that the driver uses polling. I suggest you e-mail the driver writer.
Sorry about pointing you to the wrong board file. My error.
Thank you very much for your respose
Now i understood the problem is in am335x board file, Needs in include platform data definitions about the TCA8418 device.
Can you suggest me how to add platform data definitions to board file, Becase i am new this beaglebone environment and i have e-mailed to the driver writter.
=>kernel version 3.2.0
=>board file is board-am335xevm.c
=>i2c line i2c_3
If you have any idea of platform definitions please help me to this project.
With Regards..
I can only make some guesses at what the structure initializations should be in your board.c file. No guarantees.
File: arch/arm/mach-omap2/board-am335xevm.c
...#include <linux/input/tca8418_keypad.h>.../* KEY(row, col, val) */static uint32_t tca8418_km_data[] = { KEY(0, 0, KEY_LEFT), KEY(0, 1, KEY_DOWN), KEY(0, 2, KEY_ENTER), KEY(0, 3, KEY_M), KEY(1, 0, KEY_RIGHT), KEY(1, 1, KEY_UP), KEY(1, 2, KEY_I), KEY(1, 3, KEY_N), KEY(2, 0, KEY_A), KEY(2, 1, KEY_E), KEY(2, 2, KEY_J), KEY(2, 3, KEY_O), KEY(3, 0, KEY_B), KEY(3, 1, KEY_F), KEY(3, 2, KEY_K), KEY(3, 3, KEY_P)};static const struct matrix_keymap_data tca8418_mkdata[] = { .keymap = tca8418_km_data, .keymap_size = ARRAY_SIZE(tca8418_km_data),};static struct tca8418_keypad_platform_data tca8418_pdata = { .keymap_data = &tca8418_mkdata; .rows = 4; .cols = 4; .rep = 1; /* Just a guess */ .irq_is_gpio = 0; /* Just a guess */};static struct i2c_board_info am335x_i2c_boardinfo2[] = { { I2C_BOARD_INFO(TCA8418_NAME, TCA8418_I2C_ADDR), .platform_data = &tca8418_pdata, },};...
Search around in your kernel source for usage of the matrix_keymap_data structure. There are a lot of examples.
Hi Norman Wong
i was on leave around one month so that unable continue my work. Recently i started my keyboard work.
I have added below platform data with my board file board-am335xevm.c
static struct tca8418_keypad_platform_data am335x_tca8418_info = { .keymap_data = &am335x_evm_keymap_data, .rows=8, .cols=10, .rep=0, .irq_is_gpio=0,
};
{ I2C_BOARD_INFO("tca8418_keypad", 0x34), .platform_data=&am335x_tca8418_info, },
==>After compilation of this kernel, I have ported this uImage to the board.
==>Now i am getting event0 on /dev/input/event0 and /sys/class/input/event0 but keys are not detected from tca8418 board.
==>After porting this image donot connect the TCA8418 keyboard to the beaglebone but event0 is existed.
==>By using I2c tools can be accessed the keyboard, So i confomed that keyboard is working fine, and it has been set as keypad mode.
I posted Boot log and dmesg please help us to solve this problem.
root@beaglebone:~# ls /dev/inputby-path event0 mice
root@beaglebone:~# ls /sys/class/input/event0 input0 mice
Boot log
Starting kernel ...Uncompressing Linux... done, booting the kernel.[ 0.155273] tps65910 1-002d: could not be detected[ 1.168151] omap_i2c omap_i2c.3: controller timed out[ 1.188140] tps65910 3-002d: could not be detected[ 1.241302] Could not set LED4 to fully on[ 2.242340] omap_i2c omap_i2c.3: controller timed out[ 2.242401] Could not set LED4 to fully on[ 2.380340] kobject_add_internal failed for omap_i2c.3 with -EEXIST, don't try to register things with the .[ 2.394897] omap_device: omap_i2c: build failed (-17)[ 2.524475] mtdoops: mtd device (mtddev=name/number) must be supplied[ 2.606231] omap_hwmod: wkup_m3: wkup_m3: hwmod data error: OMAP4 does not support st_shiftFailed to mount /sys/kernel/security: No such file or directory.---O---. | | .-. o o | | |-----.-----.-----.| | .----..-----.-----.| | | __ | ---'| '--.| .-'| | || | | | | |--- || --'| | | ' | | | |'---'---'--'--'--. |-----''----''--' '-----'-'-'-' -' | '---'The Angstrom Distribution beaglebone ttyO0Angstrom v2012.03-core - Kernel 3.2.0
dmesg | grep tca8418
[ 0.155639] tca8418 keyscan key probe[ 0.156219] input: tca8418_keypad as /devices/platform/omap/omap_i2c.1/i2c-1/1-0034/input/input0
dmesg
[ 0.000000] Linux version 3.2.0 (arasi@arasi) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #2 Fri Sep 12 [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache[ 0.000000] Machine: am335xevm[ 0.000000] Memory policy: ECC disabled, Data cache writeback [ 0.000000] On node 0 totalpages: 65536[ 0.000000] free_area_init_node: node 0, pgdat c065545c, node_mem_map c068c000[ 0.000000] Normal zone: 512 pages used for memmap[ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 65024 pages, LIFO batch:15[ 0.000000] AM335X ES1.0 (sgx neon )[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768[ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024 [ 0.000000] Kernel command line: console=ttyO0,115200n8 run_hardware_tests quiet root=/dev/mmcblk0p2 rw rooe[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)[ 0.000000] Memory: 256MB = 256MB total[ 0.000000] Memory: 253152k/253152k available, 8992k reserved, 0K highmem[ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)[ 0.000000] vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB) [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)[ 0.000000] .text : 0xc0008000 - 0xc05c3000 (5868 kB)[ 0.000000] .init : 0xc05c3000 - 0xc0600000 ( 244 kB)[ 0.000000] .data : 0xc0600000 - 0xc065e320 ( 377 kB) [ 0.000000] .bss : 0xc065e344 - 0xc068b424 ( 181 kB)[ 0.000000] NR_IRQS:396[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts[ 0.000000] Total of 128 interrupts on 1 active controller [ 0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz[ 0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz[ 0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms[ 0.000000] Console: colour dummy device 80x30 [ 0.000183] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464)[ 0.058166] pid_max: default: 32768 minimum: 301[ 0.058319] Security Framework initialized[ 0.058441] Mount-cache hash table entries: 512 [ 0.058898] CPU: Testing write buffer coherency: ok[ 0.059844] devtmpfs: initialized[ 0.080566] omap_hwmod: gfx: failed to hardreset[ 0.097320] omap_hwmod: pruss: failed to hardreset[ 0.098724] print_constraints: dummy: [ 0.099182] NET: Registered protocol family 16[ 0.101989] OMAP GPIO hardware version 0.1[ 0.105560] omap_mux_init: Add partition: #1: core, flags: 0[ 0.108520] omap_i2c.1: alias fck already exists [ 0.109710] omap2_mcspi.1: alias fck already exists[ 0.109985] omap2_mcspi.2: alias fck already exists[ 0.110351] edma.0: alias fck already exists[ 0.110382] edma.0: alias fck already exists [ 0.110412] edma.0: alias fck already exists[ 0.144836] bio: create slab <bio-0> at 0[ 0.147796] SCSI subsystem initialized[ 0.149993] usbcore: registered new interface driver usbfs[ 0.150421] usbcore: registered new interface driver hub [ 0.150695] usbcore: registered new device driver usb[ 0.150848] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3[ 0.151245] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1 [ 0.152954] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz[ 0.154815] tps65910 1-002d: could not be detected[ 0.155181] tca8418 keyscan key probe[ 0.155822] input: tca8418_keypad as /devices/platform/omap/omap_
The dmesg looks okay. The tca8418 code seems to print errors if anything went wrong. A couple things to check.
The file "/dev/input/event0" is a symbolic link to "/devices/platform/omap/omap_i2c.1/i2c-1/1-0034/input/input0".
In your event0 tests, you are executing as root.
You have reached the limits of my knowledge on the subject. Hopefully somebody more knowledgable than me can advise you.