[Letux-kernel] mcbsp 1

H. Nikolaus Schaller hns at goldelico.com
Fri Apr 28 21:42:46 CEST 2017


> Am 28.04.2017 um 21:34 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> 
>> Am 28.04.2017 um 21:28 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> 
>> 
>>> Am 28.04.2017 um 21:12 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>> 
>>> 
>>>> Am 28.04.2017 um 21:05 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>>>> 
>>>> Hi,
>>>> 
>>>>> Am 28.04.2017 um 19:57 schrieb Andreas Kemnade <andreas at kemnade.info>:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> On Fri, 28 Apr 2017 08:44:04 +0200
>>>>> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
>>>>> 
>>>>> 
>>>>>> 
>>>>>> Essentially the same task could be to find out why the Si4721 is not working any more.
>>>>>> 
>>>>>> It responds a little to I2C commands but not reliably. Maybe, it is missing the McBSP1
>>>>>> clock for some operations.
>>>>>> 
>>>>> Well, it has several clocks (I2C clock, 32khz clock and the I2S clocks).
>>>>> I remember being reliably able to tune to a station without mcbsp set
>>>>> up. only for the command which actually enables the i2s interface, the
>>>>> mcbsp clocks are required.
>>>>> 
>>>>> So I think the other clocks are more interesting at first. The 32khz
>>>>> stuff: hmm. the also not-so-stable bluetooth has that also...
>>>>> But it should be rarely switched off.
>>>>> Hmm, I2C. maybe frequency too high for the si4721. Or it does some
>>>>> clock stretching the master is not properly acting upon.
>>>> 
>>>> I have checked with the data sheet and I2C can do 400kHz.
>> 
>> https://www.silabs.com/documents/public/data-sheets/Si4720-21-B20.pdf
>> 
>>>> It also seems to work without other clocks.
>>>> 
>>>> The main difference is that it does not have the usual "register+value"
>>>> model like many other I2C chips.
>>>> 
>>>> It has a command + parameters + optional response.
>>>> 
>>>> This explains why a simple i2cdump does not return reliable values.
>>>> Because it triggers commands 0x00, 0x01, 0x02 etc. with missing parameters
>>>> and expects responses.
>>>> 
>>>> So maybe the first attempt already mixes up the chip. And trying to i2cdump
>>>> register 0x11 issues a POWER_DOWN command.
>>>> 
>>>> This means that it is quite difficult to check if the chip is working
>>>> properly by i2cget and i2cset.
>>>> 
>>>> The only thing that could work is to read "register" 0x10 (GET_REV)
>>>> which should return the chip version number.
>>>> 
>>>> So why does our ./si4721 tool [1] not work any more?
>>>> Maybe something in the /dev/i2c ioctls has changed... Or the usleep is too
>>>> long or too short?
>>>> 
>>>> And we should also modify the hw-test [2] to do an i2cget from bus 1,
>>>> address 0x11 command 0x10 since a simple i2cdetect may fail.
>> 
>> root at letux:~# i2cget -y 1 0x11 0x10 w
>> 0x0080
>> root at letux:~#
>> 
>> which seems to be 2 bytes of the chip revision.
>> 
>> https://www.silabs.com/documents/public/application-notes/AN332.pdf (page 14)
>> 
>>> 
>>> or restore the old test which did call the ./si4721 tool.
>>> 
>>> In summary, the general problem is less likely the kernel but the tool.
> 
> Yes, it certainly is. I now tried to run the same command as hw-test should do, but I get a big problem from I2C:
> 
> root at letux:~# /root/si4721 -d -up -dn
> [  821.248474] omap_i2c 48060000.i2c: Arbitration lost
> ^C
> root at letux:~# [  824.555297] omap_i2c 48070000.i2c: controller timed out
> [  824.562164] twl: Read failed (mod 4, reg 0x5e count 1)
> [  825.524749] omap_i2c 48072000.i2c: controller timed out
> [  825.555694] bma180 1-0041: failed to read accel_x register
> [  825.561798] accel channel read error
> [  825.566192] Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa060004
> [  825.566223] pgd = c0004000
> [  825.566223] [fa060004] *pgd=48011452(bad)
> [  825.566314] Internal error: : 1028 [#1] PREEMPT SMP ARM
> [  825.566314] Modules linked in: bnep bluetooth usb_f_ecm g_ether usb_f_rndis u_ether libcomposite configfs ipv6 libertas_sdio libertas cfg80211 bq27xxx_battery omapdrm drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea drm panel_tpo_td028ttec1 snd_soc_simple_card snd_soc_simple_card_utils snd_soc_omap_twl4030 encoder_opa362 wwan_on_off twl4030_madc_hwmon snd_soc_gtm601 pwm_omap_dmtimer generic_adc_battery connector_analog_tv pwm_bl extcon_gpio omap3_isp videobuf2_dma_contig videobuf2_memops w1_bq27000 videobuf2_v4l2 videobuf2_core ov9650 v4l2_common omap_hdq omap2430 bmp280_i2c videodev bmp280 itg3200 phy_twl4030_usb hmc5843_i2c bma180 at24 hmc5843_core snd_soc_omap_mcbsp industrialio_triggered_buffer nvmem_core tsc2007 media leds_tca6507 kfifo_buf snd_soc_omap
> [  825.566925]  musb_hdrc snd_pcm_dmaengine gpio_twl4030 snd_soc_twl4030 twl4030_vibra twl4030_pwrbutton twl4030_madc w2sg0004 twl4030_charger industrialio w2cbw003_bluetooth ehci_omap omapdss
> [  825.567077] CPU: 0 PID: 470 Comm: irq/77-48060000 Tainted: G        W       4.11.0-rc8-letux+ #1021
> [  825.567108] Hardware name: Generic OMAP36xx (Flattened Device Tree)
> [  825.567108] task: dda643c0 task.stack: ddb70000
> [  825.567169] PC is at omap_i2c_isr_thread+0x2c/0x30c
> [  825.567199] LR is at irq_thread_fn+0x1c/0x34
> [  825.567199] pc : [<c05e308c>]    lr : [<c0196ee4>]    psr: 600f0113
> [  825.567199] sp : ddb71f30  ip : 00000000  fp : 00000000
> [  825.567230] r10: c0c452d3  r9 : 00000001  r8 : 00000002
> [  825.567260] r7 : 00000065  r6 : 00000000  r5 : ddb99840  r4 : ddba1810
> [  825.567260] r3 : fa060004  r2 : 00000002  r1 : fa060000  r0 : c085555c
> [  825.567291] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
> [  825.567321] Control: 10c5387d  Table: 9b2e0019  DAC: 00000051
> [  825.567321] Process irq/77-48060000 (pid: 470, stack limit = 0xddb70218)
> [  825.567352] Stack: (0xddb71f30 to 0xddb72000)
> [  825.567382] 1f20:                                     c05e3060 ddb99840 ddb99840 dd820000
> [  825.567413] 1f40: c0196ec8 ddb99864 00000000 c0196ee4 dd820000 ddb99840 ddb70000 c019717c
> [  825.567443] 1f60: 00000000 c0196fe0 00000000 ddb08c80 ddb99800 00000000 ddb99840 c0197090
> [  825.567474] 1f80: dd8b1d08 ddb08cb8 00000000 c0152a38 ddb99800 c0152900 00000000 00000000
> [  825.567504] 1fa0: 00000000 00000000 00000000 c01070d0 00000000 00000000 00000000 00000000
> [  825.567535] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> [  825.567565] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 880c1004 82000008
> [  825.567626] [<c05e308c>] (omap_i2c_isr_thread) from [<c0196ee4>] (irq_thread_fn+0x1c/0x34)
> [  825.567657] [<c0196ee4>] (irq_thread_fn) from [<c019717c>] (irq_thread+0xec/0x1c8)
> [  825.567718] [<c019717c>] (irq_thread) from [<c0152a38>] (kthread+0x138/0x154)
> [  825.567749] [<c0152a38>] (kthread) from [<c01070d0>] (ret_from_fork+0x14/0x24)
> [  825.567779] Code: e5941004 e594200c e5d03001 e0813213 (e1d350b0)
> [  825.567810] ---[ end trace 3d16e7372ccd2c77 ]---
> [  825.567901] In-band Error seen by MPU  at address 0
> [  825.567901] ------------[ cut here ]------------
> [  825.567962] WARNING: CPU: 0 PID: 470 at drivers/bus/omap_l3_smx.c:166 omap3_l3_app_irq+0xe0/0x124
> ^C[  825.567962] Modules linked in: bnep bluetooth usb_f_ecm g_ether usb_f_rndis u_ether libcomposite configfs ipv6 libertas_sdio libertas cfg80211 bq27xxx_battery omapdrm drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea drm panel_tpo_td028ttec1 snd_soc_simple_card snd_soc_simple_card_utils snd_soc_omap_twl4030 encoder_opa362 wwan_on_off twl4030_madc_hwmon snd_soc_gtm601 pwm_omap_dmtimer generic_adc_battery connector_analog_tv pwm_bl extcon_gpio omap3_isp videobuf2_dma_contig videobuf2_memops w1_bq27000 videobuf2_v4l2 videobuf2_core ov9650 v4l2_common omap_hdq omap2430 bmp280_i2c videodev bmp280 itg3200 phy_twl4030_usb hmc5843_i2c bma180 at24 hmc5843_core snd_soc_omap_mcbsp industrialio_triggered_buffer nvmem_core tsc2007 media leds_tca6507 kfifo_buf snd_soc_omap
> 
> root at letux:~# [  825.568572]  musb_hdrc snd_pcm_dmaengine gpio_twl4030 snd_soc_twl4030 twl4030_vibra twl4030_pwrbutton twl4030_madc w2sg0004 twl4030_charger industrialio w2cbw003_bluetooth ehci_omap omapdss
> [  825.568695] CPU: 0 PID: 470 Comm: irq/77-48060000 Tainted: G      D W       4.11.0-rc8-letux+ #1021
> [  825.568725] Hardware name: Generic OMAP36xx (Flattened Device Tree)
> [  825.568786] [<c010f378>] (unwind_backtrace) from [<c010b8fc>] (show_stack+0x10/0x14)
> [  825.568817] [<c010b8fc>] (show_stack) from [<c043e4a0>] (dump_stack+0x98/0xd0)
> [  825.568847] [<c043e4a0>] (dump_stack) from [<c012f4b8>] (__warn+0xd0/0x100)
> [  825.568908] [<c012f4b8>] (__warn) from [<c012f58c>] (warn_slowpath_null+0x1c/0x24)
> [  825.568939] [<c012f58c>] (warn_slowpath_null) from [<c046acf8>] (omap3_l3_app_irq+0xe0/0x124)
> [  825.568969] [<c046acf8>] (omap3_l3_app_irq) from [<c0195da0>] (__handle_irq_event_percpu+0x180/0x49c)
> [  825.569000] [<c0195da0>] (__handle_irq_event_percpu) from [<c01960d4>] (handle_irq_event_percpu+0x18/0x54)
> [  825.569030] [<c01960d4>] (handle_irq_event_percpu) from [<c0196148>] (handle_irq_event+0x38/0x5c)
> [  825.569061] [<c0196148>] (handle_irq_event) from [<c0199838>] (handle_level_irq+0xe4/0x124)
> [  825.569122] [<c0199838>] (handle_level_irq) from [<c0195068>] (generic_handle_irq+0x18/0x28)
> [  825.569152] [<c0195068>] (generic_handle_irq) from [<c01955b8>] (__handle_domain_irq+0xa0/0xe0)
> [  825.569183] [<c01955b8>] (__handle_domain_irq) from [<c0756ff0>] (__irq_svc+0x70/0xb0)
> [  825.569244] [<c0756ff0>] (__irq_svc) from [<c075672c>] (_raw_spin_unlock_irq+0x2c/0x5c)
> [  825.569274] [<c075672c>] (_raw_spin_unlock_irq) from [<c0133e00>] (do_exit+0x224/0xb3c)
> [  825.569305] [<c0133e00>] (do_exit) from [<c010bbe0>] (die+0x2e0/0x438)
> [  825.569335] [<c010bbe0>] (die) from [<c010137c>] (do_DataAbort+0xa0/0xb4)
> [  825.569366] [<c010137c>] (do_DataAbort) from [<c0756f3c>] (__dabt_svc+0x5c/0xa0)
> [  825.569396] Exception stack(0xddb71ee0 to 0xddb71f28)
> [  825.569427] 1ee0: c085555c fa060000 00000002 fa060004 ddba1810 ddb99840 00000000 00000065
> [  825.569458] 1f00: 00000002 00000001 c0c452d3 00000000 00000000 ddb71f30 c0196ee4 c05e308c
> [  825.569488] 1f20: 600f0113 ffffffff
> [  825.569519] [<c0756f3c>] (__dabt_svc) from [<c05e308c>] (omap_i2c_isr_thread+0x2c/0x30c)
> [  825.569549] [<c05e308c>] (omap_i2c_isr_thread) from [<c0196ee4>] (irq_thread_fn+0x1c/0x34)
> [  825.569580] [<c0196ee4>] (irq_thread_fn) from [<c019717c>] (irq_thread+0xec/0x1c8)
> [  825.569610] [<c019717c>] (irq_thread) from [<c0152a38>] (kthread+0x138/0x154)
> [  825.569671] [<c0152a38>] (kthread) from [<c01070d0>] (ret_from_fork+0x14/0x24)
> [  825.569671] ---[ end trace 3d16e7372ccd2c78 ]---
> [  825.569763] genirq: exiting task "irq/77-48060000" (470) is an active IRQ thread (irq 77)
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.566314] Internal error: : 1028 [#1] PREEMPT SMP ARM
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567321] Process irq/77-48060000 (pid: 470, stack limit = 0xddb70218)
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567352] Stack: (0xddb71f30 to 0xddb72000)
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567382] 1f20:                                     c05e3060 ddb99840 ddb99840 dd820000
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567413] 1f40: c0196ec8 ddb99864 00000000 c0196ee4 dd820000 ddb99840 ddb70000 c019717c
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567443] 1f60: 00000000 c0196fe0 00000000 ddb08c80 ddb99800 00000000 ddb99840 c0197090
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567474] 1f80: dd8b1d08 ddb08cb8 00000000 c0152a38 ddb99800 c0152900 00000000 00000000
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567504] 1fa0: 00000000 00000000 00000000 c01070d0 00000000 00000000 00000000 00000000
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567535] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567565] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 880c1004 82000008
> 
> Message from syslogd at letux at Jan  1 00:13:40 ...
> kernel:[  825.567779] Code: e5941004 e594200c e5d03001 e0813213 (e1d350b0)
> 
> 
>>> And then if we can identify the chip and tune,

got it:

root at letux:~# /root/si4721 -i /dev/i2c-1 -d -up -dn
init resp: 80
get_chiprev resp: 80
1532300000323042
powered off
root at letux:~#

The problem is that the /dev/i2c numbers have changed! And the hard-coded i2c-2 is now the wrong default
and the hw-test script does not overwrite it.

>>> we can and have to fix
>>> the McBSP1 (I have changed the subject :).

As soon as we find time :)

BR,
Nikolaus

>>> 
>>>> 
>>>> BR,
>>>> Nikolaus
>>>> 
>>>> [1] http://git.goldelico.com/?p=gta04-kernel.git;a=blob;f=Letux/root/si4721.c;h=410bb33b5a13698dc9d6c1948ada1e3e77580297;hb=refs/heads/letux-4.11-rc8
>>>> [2] http://git.goldelico.com/?p=gta04-kernel.git;a=blob;f=Letux/root/hw-test;h=f442d02eb6c4d9aa9c7dfbb2d5c8ae9e7740e90f;hb=refs/heads/letux-4.11-rc8#l514
>>>> _______________________________________________
>>>> http://projects.goldelico.com/p/gta04-kernel/
>>>> Letux-kernel mailing list
>>>> Letux-kernel at openphoenux.org
>>>> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel
>>> 
>>> _______________________________________________
>>> http://projects.goldelico.com/p/gta04-kernel/
>>> Letux-kernel mailing list
>>> Letux-kernel at openphoenux.org
>>> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel
>> 
>> _______________________________________________
>> http://projects.goldelico.com/p/gta04-kernel/
>> Letux-kernel mailing list
>> Letux-kernel at openphoenux.org
>> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel
> 
> _______________________________________________
> http://projects.goldelico.com/p/gta04-kernel/
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20170428/ae2a9293/attachment-0001.asc>


More information about the Letux-kernel mailing list