UDOOboard / linux_kernel

Kernel Linux Repository for UDOO
Other
38 stars 43 forks source link

can bus #10

Closed serusko closed 8 years ago

serusko commented 8 years ago

im really confused of this pieace of code how can i enable can bus for udoo quad

i tryed edit this file https://github.com/UDOOboard/linux_kernel/blob/imx_3.14.28_1.0.0_ga_udoo/arch/arm/mach-imx/mach-imx6q.c

imx6q_init_machine(void) { ... imx6q_flexcan0_switch_auto(1); imx6q_flexcan1_switch_auto(1); }

im hopeless a 2many days im tryed yocto dora and armbian with hundred changes and its still does not work

i have working image from yoctyo dora, with founded can0 device (installed canutils and working cansend and candump) but if i connect osciloscope output is dumb

please have anyone working image ? can u send me this :dollar:

UDOOboard commented 8 years ago

Hi serus22,

since the kernel 3.10 you need to use device tree (dts files) to enable functionalities for the board you are working on, instead of platform files.

The file you should use to enable flexcan is /boot/dts/imx6qdl-udoo.dtsi

patrykk commented 8 years ago

Please check file https://github.com/patrykk/linux-udoo/blob/624b9b08ef828f9f2f2f8a8e8c60ce54a26744f7/arch/arm/boot/dts/imx6qdl-udoo.dtsi and find records related to can. Then you have to recompile dts file and you will have can device. On kernel .4.3.x it works.

serusko commented 8 years ago

thank you for hint, but ii still dont understand what i should change in .dtsi file because in older 3.x version i saw commented can config lines but in yours @patrykk is all enabled, so, its enabled by default ? anyway, its that all what i should do ? because i found in forum this patch http://pastebin.com/qA6AMkep (there are enabled uart and spi pins too, i edit it). Tried with yocto project v. dora and i had one can interface in linux (i test and configure it with canutils), buts it did not work, all time was logical 1 on pins, no signal just static value. i also tried configure arduino pins 23, 24 as INPUT and OUTPUT, all variations (i found that numbers in manual, maybe i have wrong numbers)

UDOOboard commented 8 years ago

FlexCan support has been added in commit c9e99c7

You can enable the right node &flexcan1 in your dts.