Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot configure OneWire or UART for on bone-debian-9.5-iot #204

Closed
kwijbrans opened this issue May 5, 2019 · 7 comments
Closed

Cannot configure OneWire or UART for on bone-debian-9.5-iot #204

kwijbrans opened this issue May 5, 2019 · 7 comments

Comments

@kwijbrans
Copy link

kwijbrans commented May 5, 2019

I am trying to get my BBB to work with a OneWire interface a P9.12 and UART4 enabled. Added uboot_overlay_addr0=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr1=/lib/firmware/BB-W1-P9.12-00A0.dtbo

Somehow, it does not work: I do not see any devices on the OneWire bus even though two were present when I used Debian Jessie, and I do not see the UART4 device /dev/ttyO4.

sudo /opt/scripts/tools/version.sh gives:

klaas@beaglebone:~$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[1aa73453b2c980b75e31e83dab7dd8b6696f10c7]
eeprom:[A335BNLT0A5C2513BBBK0336]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-10-07]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR]
kernel:[4.14.71-ti-r80]
nodejs:[v6.14.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-UART4-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr1=/lib/firmware/BB-W1-P9.12-00A0.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.4.20180928.0-0rcnee0~stretch+20180928]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.3-git20181005.0-0rcnee0~stretch+20181005]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0]
dmesg | grep pinctrl-single
[    1.039846] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[    1.041080] gpio-of-helper ocp:cape-universal: ready
END

What can be wrong? Output seems very similar to output of the working configuration in issue #142.

@RobertCNelson
Copy link
Member

@kwijbrans , okay you have an issue another user posted a few week back..

So verison.sh is only detecting the version of u-boot on teh microSD drive:

bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR]
k

and from the cmdline, we see a special flag isn't being passed..

cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0]

Thus, you have "something" on the eMMC, can you please figure that out and share with me the "flasher" that programmed your eMMC? Then i can update version.sh to detect this issue and report it for the next user. (Technically you are the "2nd" user, but the "1st" user with this issue couln't remember anything..)

Regards,

@kwijbrans
Copy link
Author

@RobertCNelson: Unfortunately, I do not know the flasher that was used previously, this is a system that was configured to also use a harddisk and the harddisk crashed. Trying to get it up and running again.

Is the eMMC on /dev/mmcblk1 when booted from the SD? I have dumped the first 4 MB using dd if=/dev/mmcblk1, would this be of use?

@kwijbrans
Copy link
Author

One addition: I zeroed the eMMC with sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=10 and now it works.

@RobertCNelson
Copy link
Member

@kwijbrans yeah, if you can send me the 4MB *.img i'll do some work on debugging what it was. ;)

@kwijbrans
Copy link
Author

@RobertCNelson: attached the dump of the first 4 MB, hope it helps finding the issue.

mmcblk1.zip

@WalterCEden
Copy link

I may be having the same problem so I'm posting several items below. I'm also a relatively newbie to BBB and trying to get a DS18B20 temperature sensor working with 1-wire. Here is the output from version.sh (this was booted from an SD card).

git:/opt/scripts/:[1aa73453b2c980b75e31e83dab7dd8b6696f10c7]
eeprom:[A335BNLT00C04417BBBK1847]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-10-07]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.09-00002-g0b54a51eee]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot2018.03-00002-gac9cce7c6a]:[location: dd MBR]
kernel:[4.14.71-ti-r80]
nodejs:[v6.14.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-W1-P9.12-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.4.20180928.0-0rcnee0stretch+20180928]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0stretch+20180517]
pkg:[kmod]:[23-2rcnee1stretch+20171005]
pkg:[librobotcontrol]:[1.0.3-git20181005.0-0rcnee0stretch+20181005]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.107595] pinctrl-single 44e10800.pinmux: 142pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.119429] gpio-of-helper ocp:cape-universal: ready
END

Here is my uEnv.txt file.

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.14.71-ti-r80
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1

###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-W1-P9.12-00A0.dtbo
#uboot_overlay_addr1=/lib/firmware/.dtbo
#uboot_overlay_addr2=/lib/firmware/.dtbo
#uboot_overlay_addr3=/lib/firmware/.dtbo

###Additional custom capes
#uboot_overlay_addr4=/lib/firmware/.dtbo
#uboot_overlay_addr5=/lib/firmware/.dtbo
#uboot_overlay_addr6=/lib/firmware/.dtbo
#uboot_overlay_addr7=/lib/firmware/.dtbo

###Custom Cape
#dtb_overlay=/lib/firmware/w1-00A0.dtbo

###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1

###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_rproc (4.14.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_uio (4.4.x-ti, 4.14.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo

###Cape Universal Enable
enable_uboot_cape_universal=1

###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1

###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 quiet video=HDMI-A-1:1024x768@60e

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=coherent_pool=1M net.ifnames=0 quiet overlayroot=tmpfs

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

So I booted by holding down the user button while pressing power on.

I executed the two sudo modprobe commands with no errors report.

All I see in /sys/bus/w1/devices is w1_bus_master1

Suggestions?

@pdp7
Copy link
Contributor

pdp7 commented Jun 10, 2020

@kwangwoo74 Please try with our current Debian image:
https://github.com/beagleboard/Latest-Images

@pdp7 pdp7 closed this as completed Jun 10, 2020
RobertCNelson pushed a commit that referenced this issue Feb 10, 2022
icss_iep_perout_enable_hw() is invoked with spin_lock_irqsave() and
hence cannot use sleeping lock. Enable regmap fast_io for
iep_regmap_config so that it will use spinlock instead of mutex.

This fixes the following dump
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:947
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 1103, name: sh
5 locks held by sh/1103:
 #0: ffff00002b814438 (sb_writers#5){.+.+}-{0:0}, at: ksys_write+0x6c/0xf8
 #1: ffff0000322ae888 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0xf0/0x1b8
 #2: ffff0000744837d0 (kn->active#158){++++}-{0:0}, at: kernfs_fop_write_iter+0xf8/0x1b8
 #3: ffff0000344401b8 (&iep->ptp_clk_mutex){+.+.}-{3:3}, at: icss_iep_ptp_enable+0x168/0x2f0 [icss_iep]
 #4: ffff0000344401f8 (&iep->irq_lock){....}-{2:2}, at: icss_iep_ptp_enable+0x19c/0x2f0 [icss_iep]
irq event stamp: 92858
hardirqs last  enabled at (92857): [<ffff800010cbefa0>] _raw_spin_unlock_irqrestore+0x80/0x98
hardirqs last disabled at (92858): [<ffff800010cbf660>] _raw_spin_lock_irqsave+0xb0/0x144
softirqs last  enabled at (92658): [<ffff80001001062c>] efi_header_end+0x62c/0x6b0
softirqs last disabled at (92645): [<ffff80001005993c>] irq_exit+0x1c4/0x1d8
Preemption disabled at:
[<ffff800009491484>] icss_iep_ptp_enable+0x19c/0x2f0 [icss_iep]
CPU: 1 PID: 1103 Comm: sh Not tainted 5.10.65-08510-g2bea885230fd-dirty #204
Hardware name: Texas Instruments AM642 EVM (DT)
Call trace:
 dump_backtrace+0x0/0x1d0
 show_stack+0x18/0x28
 dump_stack+0xec/0x154
 ___might_sleep+0x194/0x240
 __might_sleep+0x50/0x88
 __mutex_lock+0x5c/0x900
 mutex_lock_nested+0x34/0x50
 regmap_lock_mutex+0x14/0x20
 regmap_write+0x3c/0x78
 icss_iep_perout_enable_hw+0xd0/0x2c0 [icss_iep]
 icss_iep_ptp_enable+0x2b4/0x2f0 [icss_iep]
 pps_enable_store+0xc0/0xe0
 dev_attr_store+0x18/0x30
 sysfs_kf_write+0x4c/0x78
 kernfs_fop_write_iter+0x120/0x1b8
 new_sync_write+0xe8/0x188
 vfs_write+0x2ac/0x450
 ksys_write+0x6c/0xf8
 __arm64_sys_write+0x1c/0x28
 el0_svc_common.constprop.0+0x7c/0x1f0
 do_el0_svc+0x24/0x90
 el0_svc+0x20/0x30
 el0_sync_handler+0xb0/0xb8
 el0_sync+0x180/0x1c0

=============================
[ BUG: Invalid wait context ]
5.10.65-08510-g2bea885230fd-dirty #204 Tainted: G        W
-----------------------------
sh/1103 is trying to lock:
ffff000034440468 (icss_iep:959:(iep->plat_data->config)->lock){+.+.}-{3:3}, at: regmap_lock_mutex+0x14/0x20
other info that might help us debug this:
context-{4:4}
5 locks held by sh/1103:
 #0: ffff00002b814438 (sb_writers#5){.+.+}-{0:0}, at: ksys_write+0x6c/0xf8
 #1: ffff0000322ae888 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0xf0/0x1b8
 #2: ffff0000744837d0 (kn->active#158){++++}-{0:0}, at: kernfs_fop_write_iter+0xf8/0x1b8
 #3: ffff0000344401b8 (&iep->ptp_clk_mutex){+.+.}-{3:3}, at: icss_iep_ptp_enable+0x168/0x2f0 [icss_iep]
 #4: ffff0000344401f8 (&iep->irq_lock){....}-{2:2}, at: icss_iep_ptp_enable+0x19c/0x2f0 [icss_iep]
stack backtrace:
CPU: 1 PID: 1103 Comm: sh Tainted: G        W         5.10.65-08510-g2bea885230fd-dirty #204
Hardware name: Texas Instruments AM642 EVM (DT)
Call trace:
 dump_backtrace+0x0/0x1d0
 show_stack+0x18/0x28
 dump_stack+0xec/0x154
 __lock_acquire+0x1d38/0x1d60
 lock_acquire+0x154/0x410
 __mutex_lock+0x9c/0x900
 mutex_lock_nested+0x34/0x50
 regmap_lock_mutex+0x14/0x20
 regmap_write+0x3c/0x78
 icss_iep_perout_enable_hw+0xd0/0x2c0 [icss_iep]
 icss_iep_ptp_enable+0x2b4/0x2f0 [icss_iep]
 pps_enable_store+0xc0/0xe0
 dev_attr_store+0x18/0x30
 sysfs_kf_write+0x4c/0x78
 kernfs_fop_write_iter+0x120/0x1b8
 new_sync_write+0xe8/0x188
 vfs_write+0x2ac/0x450
 ksys_write+0x6c/0xf8
 __arm64_sys_write+0x1c/0x28
 el0_svc_common.constprop.0+0x7c/0x1f0
 do_el0_svc+0x24/0x90
 el0_svc+0x20/0x30
 el0_sync_handler+0xb0/0xb8
 el0_sync+0x180/0x1c0

Fixes: 5d58df8 ("net: ethernet: ti: icss_iep: fix pps irq race vs pps disable")
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Vignesh Raghavendra <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants