IRC log of #cubox of Thu 01 Jan 2015. All times are in CET < Back to index

09:17 Exaga HAPPY NEW YEAR 2015 everybody. may you have a prosperous and productive 12 months ahead!
14:45 Exaga happy new year Artox x
14:45 Artox thanks Exaga
14:45 Artox you too
14:45 Exaga ty :)
15:03 Dom__ rabeeh: are you here?
15:08 Dom__ some other with experience in kernel driver development?
15:08 curlymo kernel driver for what?
15:09 Dom__ i want to add an i2c device driver
15:10 curlymo in the kernel itself?
15:10 curlymo what device?
15:10 Dom__ i read, that i need to call i2c_register_board_info to identify my device in the board driver. but don't know, which file contains the board driver
15:10 curlymo what device?
15:11 Dom__ ov5647 camera
15:11 Dom__ on a hummingboard i2ex
15:11 Humpelstilzchen and I thought we use devicetree nowadays for that
15:12 Dom__ Humpelstilzchen: do you speak german or only dutch?
15:12 Humpelstilzchen german
15:13 Dom__ ok. kannst du mir das erkl?ren wie das mit dem devicetree funktioniertss
15:13 Dom__ ?
15:13 curlymo ehm, english?
15:13 Humpelstilzchen yeah lets keep english
15:13 curlymo you can try to port this: https://android.googlesource.com/kernel/msm/+/e8cd8ba448c7f010908b9a9c61ee6457359a1f03/drivers/media/video/msm/ov5647.c
15:14 Humpelstilzchen Dom__: this is a driver you find on the web=
15:14 Humpelstilzchen ?
15:14 Dom__ i have already different source codes for this device
15:14 Dom__ i already compiled a driver (.ko-file) and loaded them
15:14 curlymo and?
15:14 Dom__ but my probe method is never called
15:15 Dom__ so i read in the web, that i have to use i2c_register_board_info give kernel the informationen, that on i2c bus 0, address 0x36 is the ov5647
15:16 curlymo but if the probe method doesn't work, nothing will :)
15:17 Dom__ if i use "echo ov4537 0x36 > /sys/bus/i2c/devices/i2c-0/new_device", probe method will be called
15:17 curlymo ok
15:18 curlymo but don't you need a loop to check when the device is connected?
15:18 Dom__ *echo ov5647 0x36...
15:18 curlymo so load the kernel module -> start a loop that check for the camera -> register camera
15:19 Dom__ i never wrote a kernel module before, so i don't know what is the correct way
15:20 Dom__ the source codes of ov5647 in the web don't have a loop for checking for the camera
15:20 Humpelstilzchen uhm why a loop?
15:21 Humpelstilzchen its either there or not
15:21 curlymo but when it's not connected when the module is loaded?
15:21 Humpelstilzchen i2c is usually not a hotplug bus
15:21 Dom__ it is alway connected
15:22 curlymo You can't assume that a user operates i2c as expected :)
15:22 Dom__ Humpelstilzchen: what must i do, to connect i2c bus 0 on address 0x36 to my driver?
15:23 Dom__ curlymo: i don't want to cover user mistakes now
15:24 Dom__ only want to run this driver
15:24 curlymo you can check how to get the probe to run in two examples that are essentially the same moduels. With and without device tree.
15:24 curlymo https://github.com/linux4kix/linux-linaro-stable-mx6/commit/7311833a128054c5f254b8168a8022e7b87db7e8
15:24 curlymo ^with device tree
15:24 curlymo https://github.com/xbianonpi/xbian-package-kernel/blob/master/patches/imx6/xbian_lirc_kernel.patch#L1171-L1855
15:24 curlymo ^without device tree but with module arguments
15:24 Humpelstilzchen but that requires the module to already support device trees
15:24 Humpelstilzchen we don't know that yet
15:25 Humpelstilzchen Dom__: can you point us to the module you use?
15:26 _unreal_ hello, I was given a cubox development platform some time ago. it does not boot I know little about it and am trying to figure out how to get a build onto it. http://www.solid-run.com/archive/mw/Unbricking_CuBox_-_Reflashing_SPI_Memory
15:26 _unreal_ cubox v1
15:28 Dom__ Humpelstilzchen: https://github.com/linux4kix/linux-linaro-stable-mx6/blob/linux-linaro-lsk-v3.14-mx6/drivers/media/i2c/soc_camera/ov5642.c
15:28 Dom__ i used this module as start
15:29 curlymo how do you know probe doesn't run?
15:29 Dom__ added printk at beginning of this function
15:29 curlymo good
15:34 curlymo If i read here: https://www.kernel.org/doc/Documentation/i2c/writing-clients
15:35 curlymo The idtable requires an I2C address. The one in the module is just 0
15:35 curlymo what happens if you change the 0 to 0x36?
15:36 Dom__ i try it
15:37 Dom__ but i think it is only a id, not the bus address
15:37 curlymo ok
15:38 curlymo i'm just wondering how the kernel knows what module to probe
15:38 Humpelstilzchen curlymo: kernel uses devicetree
15:38 curlymo i know
15:38 curlymo but i don't see device tree parsing in the i2c modules
15:39 Humpelstilzchen me neither, which suggest that it is not ported (yet)
15:39 curlymo i sure it's just me, but trying to understand as well :)
15:39 Humpelstilzchen so we probably need a separate module to load this one
15:39 curlymo the i2c_device_id is 0 for all module i see
15:40 Dom__ how can i get the device to the device tree?
15:40 curlymo i would just start by probing and registering it manually
15:40 curlymo just compare the two modules i posted earlier
15:42 curlymo https://github.com/xbianonpi/xbian-package-kernel/blob/master/patches/imx6/xbian_lirc_kernel.patch#L1830-L1831
15:43 curlymo then create two dummy __init and __exit functions that just call ov5642_probe and ov5642_remove respectively
15:43 curlymo only issue would be figuring how to manually create the struct i2c_client
15:47 curlymo If you compare the actual source of this module: http://lxr.free-electrons.com/source/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c with one of the patches, the functions should be easily replaceable: https://lists.ozlabs.org/pipermail/linuxppc-dev/2012-October/101626.html
15:47 Dom__ re, pc hanged
15:48 curlymo therefor you should be able to manually call __init and __exit when modprobe the module manually
15:57 curlymo have to go
15:58 Dom__ ok. thanks curlymo
15:58 Humpelstilzchen hmm i2c devices might not need the device tree parsing
15:58 Humpelstilzchen https://www.kernel.org/doc/Documentation/i2c/instantiating-devices
15:59 Dom__ yes, right
15:59 Humpelstilzchen can you try that?
15:59 Dom__ but where to add the i2c_register_board_info?
15:59 Humpelstilzchen Dom__: thats the old method, which is pre-devicetree
16:00 Dom__ if it works, its ok for me :D
16:00 _unreal_ what is the difference between these? http://download.solid-run.com/pub/solidrun/cubox/u-boot/2009.08_5.4.4_SR1/aug-6-2013/
16:00 _unreal_ I have found little to no info describing what they are
16:00 Humpelstilzchen Dom__: the ppoint of devicetree was to remove board init stuff why it probably doesn't exist
16:01 Humpelstilzchen so look at method 1b
16:01 _unreal_ could any of you take a quick look at that link and let me know if any of you know what the differences between the 3 images are?
16:01 Dom__ ok. thanks
16:02 _unreal_ Humpelstilzchen, ?
16:06 _unreal_ is every one just ignoring me
16:08 _unreal_ any one live?
16:08 Dom__ or nobody knows an answer
16:09 Humpelstilzchen ^
16:09 _unreal_ so its to much to say sorry dont knw
16:09 Humpelstilzchen you expect 100 people to say "don't know"?
16:10 _unreal_ really........
16:10 Humpelstilzchen _unreal_: try the forum
16:11 _unreal_ I have been looking and reading.
16:12 _unreal_ all I want is to get this cubox to boot
16:12 _unreal_ it was given to me its a cubox v1 devlopment platform (AKA first beast made)
16:44 _unreal_ lookhttp://www.solid-run.com/archive/mw/Unbricking_CuBox_-_Reflashing_SPI_Memory
16:44 _unreal_ frig
16:48 _unreal_ ok I'm running this command
16:48 _unreal_ [laptop@localhost cubox]$ ./burn_u-boot.sh /dev/ttyUSB0 /home/laptop/Downloads/cubox/solidrun/cubox/u-boot/2009.08_5.4.4_SR1/apr-8-2013/u-boot-cubox_hynix_cubox_2GB_uart.bin
22:39 Dom__ rabeeh: are you here?
22:48 curlymo Did you try my suggestion?
23:02 Dom__ no, i need some information about the soc to understand the imageflow
23:23 curlymo @Dom___
23:23 curlymo the documents about the SOC are called IMX6DQRM.pdf and IMX6SDLRM.pdf