Skip to contentSkip to conversation

boot/dtbs/4.4.54-ti-r93/am335x-boneblack.dtb

DISCUSSION Riko Ho 2 participants 8 messages Jul 5, 2017 – Jul 6, 2017

lore
Share & tools
lore

Riko Ho

author
#0 lore raw

Dear meta-ti Team Member,

Is it possible that I use this dtb with beagle yocto kernel ? if it is, how to do that ?

loading */boot/dtbs/4.4.54-ti-r93/am335x-boneblack.dtb *

Signature · 9 lines
*

/*******/
Sent by Ubuntu LTS 16.04,
Kind regards,
Riko Ho
/*******/

*
#1 lore raw
Quoted 7 lines · Riko Ho

Dear meta-ti Team Member,

Is it possible that I use this dtb with beagle yocto kernel ? if it is, how to do that ?

loading /boot/dtbs/4.4.54-ti-r93/am335x-boneblack.dtb --

Riko,

You can try loading that *.dtb with meta-ti's kernel, but it won't use the kernel overlay features built-into the *.dtb as the meta-ti tree lacks those out-of-tree-in-development-etc overlay patches.

Regards,

Signature · 2 lines
Robert Nelson
https://rcn-ee.com/
author
#2 lore raw

Dear Meta TI Team Member,

I want to use SPI0 and used kernel from yoc to. I have added SPI0 node patch on bone*.Black.dts. I ll send later on for verifying. I m not on my dev computer now.

I can get dev/spidev1.0. did a loopback. It s running. But all 0000. There s a bug when it was started booting. I ll show you later.
I ve checked the cable. Tested with Debian image, was working.

How can I use meta ti kernel with Linux yocto kernel ? Merging isn't it? I did menu config on Linux yocto kernel and enable SPI option, was it right? Or ?

/*******/
Sent by Android 4.4.2,
Regards,
Riko Ho
/*******/

Quoted 22 lines · Robert Nelson
Quoted 3 lines · Riko Ho

Dear meta-ti Team Member,

Is it possible that I use this dtb with beagle yocto kernel ? if it is,

how

Quoted 4 lines

to do that ?

loading /boot/dtbs/4.4.54-ti-r93/am335x-boneblack.dtb --

Riko,

You can try loading that *.dtb with meta-ti's kernel, but it won't use the kernel overlay features built-into the *.dtb as the meta-ti tree lacks those out-of-tree-in-development-etc overlay patches.

Regards,

--
Robert Nelson
https://rcn-ee.com/

#3 lore raw
Quoted 9 lines · Riko Ho

Dear Meta TI Team Member,

I want to use SPI0 and used kernel from yoc to. I have added SPI0 node patch on bone*.Black.dts. I ll send later on for verifying. I m not on my dev computer now.

I can get dev/spidev1.0. did a loopback. It s running. But all 0000. There s a bug when it was started booting. I ll show you later.
I ve checked the cable. Tested with Debian image, was working.

This fixes that bug: (aka the spi maintainer believes what we are doing with the spidev node is wrong..)

https://github.com/RobertCNelson/ti-linux-kernel-dev/blob/ti-linux-4.4.y/patches/reverts/0001-Revert-spi-spidev-Warn-loudly-if-instantiated-from-D.patch

Regards,

Signature · 2 lines
Robert Nelson
https://rcn-ee.com/
author
#4 lore raw

Dear Meta TI Yocto Team Member/ Robert,

Ok, thanks for the fixes.
For that fix, only add into spidev.c, and use linux-yocto kernel, without using ti kernel ?

Here's what I got :

====

SPI0 Bug :
spidev spi1.0: buggy DT: spidev listed directly in DT

------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at /home/bianchi77/poky/build/tmp/work-shared/beaglebone/kernel-source/drivers/spi/spidev.c:758 spidev_probe+0x74/0x1c8
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.10.9-yocto-standard #4
Hardware name: Generic AM33XX (Flattened Device Tree)
[<c010f250>] (unwind_backtrace) from [<c010c0cc>] (show_stack+0x20/0x24)
[<c010c0cc>] (show_stack) from [<c04a450c>] (dump_stack+0x20/0x28)
[<c04a450c>] (dump_stack) from [<c012d734>] (__warn+0xec/0x108)
[<c012d734>] (__warn) from [<c012d820>] (warn_slowpath_null+0x30/0x38)
[<c012d820>] (warn_slowpath_null) from [<c0620e94>] (spidev_probe+0x74/0x1c8)
[<c0620e94>] (spidev_probe) from [<c061d1e0>] (spi_drv_probe+0x98/0xb0)
[<c061d1e0>] (spi_drv_probe) from [<c05ab304>] (driver_probe_device+0x1fc/0x2c4)
[<c05ab304>] (driver_probe_device) from [<c05ab574>] (__device_attach_driver+0xa4/0xbc)
[<c05ab574>] (__device_attach_driver) from [<c05a9688>] (bus_for_each_drv+0x98/0xa0)
[<c05a9688>] (bus_for_each_drv) from [<c05ab050>] (__device_attach+0xac/0x114)
[<c05ab050>] (__device_attach) from [<c05ab5a8>] (device_initial_probe+0x1c/0x20)
[<c05ab5a8>] (device_initial_probe) from [<c05aa5dc>] (bus_probe_device+0x38/0x90)
[<c05aa5dc>] (bus_probe_device) from [<c05a8814>] (device_add+0x42c/0x510)
[<c05a8814>] (device_add) from [<c061e3d0>] (spi_add_device+0xf4/0x158)
[<c061e3d0>] (spi_add_device) from [<c061e85c>] (of_register_spi_device+0x2a0/0x304)
[<c061e85c>] (of_register_spi_device) from [<c061eea4>] (spi_register_master+0x3fc/0x4ac)
[<c061eea4>] (spi_register_master) from [<c061ef98>] (devm_spi_register_master+0x44/0x78)
[<c061ef98>] (devm_spi_register_master) from [<c0628068>] (omap2_mcspi_probe+0x26c/0x368)
[<c0628068>] (omap2_mcspi_probe) from [<c05ad1e4>] (platform_drv_probe+0x60/0xac)
[<c05ad1e4>] (platform_drv_probe) from [<c05ab304>] (driver_probe_device+0x1fc/0x2c4)
[<c05ab304>] (driver_probe_device) from [<c05ab458>] (__driver_attach+0x8c/0xb8)
[<c05ab458>] (__driver_attach) from [<c05a95b4>] (bus_for_each_dev+0x90/0xa0)
[<c05a95b4>] (bus_for_each_dev) from [<c05aacd8>] (driver_attach+0x28/0x30)
[<c05aacd8>] (driver_attach) from [<c05aa8b0>] (bus_add_driver+0x184/0x1f4)
[<c05aa8b0>] (bus_add_driver) from [<c05ac0a8>] (driver_register+0xb0/0xf0)
[<c05ac0a8>] (driver_register) from [<c05ad124>] (__platform_driver_register+0x40/0x54)
[<c05ad124>] (__platform_driver_register) from [<c0d3e89c>] (omap2_mcspi_driver_init+0x18/0x20)
[<c0d3e89c>] (omap2_mcspi_driver_init) from [<c0101b78>] (do_one_initcall+0x134/0x15c)
[<c0101b78>] (do_one_initcall) from [<c0d00ef8>] (kernel_init_freeable+0x1c4/0x280)
[<c0d00ef8>] (kernel_init_freeable) from [<c08c3480>] (kernel_init+0x18/0x11c)
[<c08c3480>] (kernel_init) from [<c0107798>] (ret_from_fork+0x14/0x3c)
---[ end trace 2ff68809195d7a1f ]---

=====

file = work-shared/beaglebone/kernel-source/arch/arm/boot/dts/am335x-boneblack.dts

I added inside &am33xx_pinmux :

/*Added by Riko Ho 5 July 2017 for SPI0 Enable BEGIN */

       spi0_pins: spi0_pins {
            pinctrl-single,pins = <
                       0x150 (PIN_OUTPUT_PULLUP | MUX_MODE0)
                       0x154 (PIN_INPUT_PULLUP | MUX_MODE0)
                       0x158 (PIN_INPUT_PULLUP | MUX_MODE0)
                       0x15C (PIN_OUTPUT_PULLUP | MUX_MODE0)
             >;
       };

/*Added by Riko Ho 5 July 2017 for SPI0 Enable END */

and

// Added SPI0 node

&spi0 {
         status = "okay";
         pinctrl-names = "default";
         pinctrl-0 = <&spi0_pins>;
        spidev@0 {
                  spi-max-frequency = <24000000>;
                  reg = <0>;
                  compatible = "linux,spidev";
        };
};

at the end.

===========

Quoted 17 lines · Robert Nelson
Quoted 9 lines · Riko Ho

Dear Meta TI Team Member,

I want to use SPI0 and used kernel from yoc to. I have added SPI0 node patch on bone*.Black.dts. I ll send later on for verifying. I m not on my dev computer now.

I can get dev/spidev1.0. did a loopback. It s running. But all 0000. There s a bug when it was started booting. I ll show you later.
I ve checked the cable. Tested with Debian image, was working.

This fixes that bug: (aka the spi maintainer believes what we are doing with the spidev node is wrong..)

https://github.com/RobertCNelson/ti-linux-kernel-dev/blob/ti-linux-4.4.y/patches/reverts/0001-Revert-spi-spidev-Warn-loudly-if-instantiated-from-D.patch

Regards,

Signature · 9 lines
*

/*******/
Sent by Ubuntu LTS 16.04,
Kind regards,
Riko Ho
/*******/

*
author
#5 lore raw

The bug is gone but SPI0 still 000000

In reply to Robert Nelson

Dear Meta-TI Yocto Member,

The bug is gone but SPI0 still 000000

root@beaglebone:~# ./spidev_test_fromhost -D /dev/spidev1.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00
root@beaglebone:~#

What do I miss here ??

Signature · 9 lines
*

/*******/
Sent by Ubuntu LTS 16.04,
Kind regards,
Riko Ho
/*******/

*
author
#6 lore raw

Different response if I change the mode of SPI, but not yet right ?

In reply to Robert Nelson

Dear Team Member,
Different response if I change the mode of SPI, but not yet right ? What is the issue ?

root@beaglebone:~# ./spidev_test
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00

root@beaglebone:~# ./spidev_test -C
spi mode: 4
bits per word: 8
max speed: 500000 Hz (500 KHz)

00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00

root@beaglebone:~# ./spidev_test -CO
spi mode: 6
bits per word: 8
max speed: 500000 Hz (500 KHz)

03 03 03 03 03 03
03 03 03 03 03 03
03 03 03 03 03 03
03 03 03 03 03 03
03 03 03 03 03 03
03 03 03 03 03 03
03 03

root@beaglebone:~# ./spidev_test -CH
spi mode: 5
bits per word: 8
max speed: 500000 Hz (500 KHz)

0F 0F 0F 0F 0F 0F
0F 0F 0F 0F 0F 0F
0F 0F 0F 0F 0F 0F
0F 0F 0F 0F 0F 0F
0F 0F 0F 0F 0F 0F
0F 0F 0F 0F 0F 0F
0F 0F
root@beaglebone:~#

author
#7 lore raw

./spidev_test -l ==> setup: unsupported mode bits 20 ?

In reply to Robert Nelson

Dear Meta-TI Team Member,

I tried with -l parameter but it said

root@beaglebone:~# ./spidev_test -l spidev spi1.0: setup: unsupported mode bits 20
What is the cause ?

spidev spi1.0: setup: unsupported mode bits 20
can't set spi mode: Invalid argument
Aborted

Thanks,
Riko