Manual device overlay for uart2 works OK, adding to /boot/uEnv.txt fails

Hello,

I am on a BBB with:

Linux arm 3.8.13-bone63 #2 SMP Sat Aug 16 00:01:36 PDT 2014 armv7l armv7l armv7l GNU/Linux
root@arm:/home/ubuntu# lsb_release -a
LSB Version: core-2.0-armhf:core-2.0-noarch:core-3.0-armhf:core-3.0-noarch:core-3.1-armhf:core-3.1-noarch:core-3.2-armhf:core-3.2-noarch:core-4.0-armhf:core-4.0-noarch:core-4.1-armhf:core-4.1-noarch:security-4.0-armhf:security-4.0-noarch:security-4.1-armhf:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

The .dts below work sfine when compiled, copied to /libfirmware and echo enable-uart2 > /sys/devices/bone_capemgr.*/slots

HOWEVER, with my /boot/uEnv.txt containing this:

cat /boot/uEnv.txt

uname_r=3.8.13-bone63
#dtb=
cmdline=quiet
###uuid=5dcad23b-fa16-4918-983f-82a6f0c02aae
#capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
optargs=quiet drm.debug=7 capemgr.enable_partno=enable-uart2,enable-uart5
uuid=6baebde8-2358-4f59-aced-798c4aee4cfb

Upon reboot in dmesg I get:

dmesg | grep uart2

[ 0.000000] Kernel command line: console=ttyO0,115200n8 quiet drm.debug=7 capemgr.enable_partno=enable-uart2,enable-uart5 root=UUID=6baebde8-2358-4f59-aced-798c4aee4cfb ro rootfstype=ext4 rootwait fixrtc quiet
[ 0.728384] bone-capemgr bone_capemgr.9: enabled_partno part_number ‘enable-uart2’, version ‘N/A’, prio ‘0’
[ 0.728426] bone-capemgr bone_capemgr.9: slot #7: ‘Override Board Name,00A0,Override Manuf,enable-uart2’
[ 0.729118] bone-capemgr bone_capemgr.9: loader: before slot-7 enable-uart2:00A0 (prio 0)
[ 0.729131] bone-capemgr bone_capemgr.9: loader: check slot-7 enable-uart2:00A0 (prio 0)
[ 0.732152] bone-capemgr bone_capemgr.9: loader: after slot-7 enable-uart2:00A0 (prio 0)
[ 0.732172] bone-capemgr bone_capemgr.9: slot #7: Requesting part number/version based 'enable-uart2-00A0.dtbo
[ 0.732188] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware ‘enable-uart2-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 1.043033] bone-capemgr bone_capemgr.9: failed to load firmware ‘enable-uart2-00A0.dtbo’
[ 1.051672] bone-capemgr bone_capemgr.9: loader: failed to load slot-7 enable-uart2:00A0 (prio 0)

And when I then do:
echo enable-uart2 > /sys/devices/bone_capemgr.*/slots

then all is well and dmesg says:

[ 721.217812] bone-capemgr bone_capemgr.9: part_number ‘enable-uart2’, version ‘N/A’
[ 721.218087] bone-capemgr bone_capemgr.9: slot #9: ‘Override Board Name,00A0,Override Manuf,enable-uart2’
[ 721.218349] bone-capemgr bone_capemgr.9: slot #9: Requesting part number/version based 'enable-uart2-00A0.dtbo
[ 721.218401] bone-capemgr bone_capemgr.9: slot #9: Requesting firmware ‘enable-uart2-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 721.223775] bone-capemgr bone_capemgr.9: slot #9: dtbo ‘enable-uart2-00A0.dtbo’ loaded; converting to live tree

cat enable-uart2-00A0.dts

/*

Hello,

I am on a BBB with:

Linux arm 3.8.13-bone63 #2 SMP Sat Aug 16 00:01:36 PDT 2014 armv7l armv7l
armv7l GNU/Linux
root@arm:/home/ubuntu# lsb_release -a
LSB Version:
core-2.0-armhf:core-2.0-noarch:core-3.0-armhf:core-3.0-noarch:core-3.1-armhf:core-3.1-noarch:core-3.2-armhf:core-3.2-noarch:core-4.0-armhf:core-4.0-noarch:core-4.1-armhf:core-4.1-noarch:security-4.0-armhf:security-4.0-noarch:security-4.1-armhf:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

The .dts below work sfine when compiled, copied to /libfirmware and echo
enable-uart2 > /sys/devices/bone_capemgr.*/slots

HOWEVER, with my /boot/uEnv.txt containing this:

Details here:

http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Loading_custom_capes

# cat /boot/uEnv.txt
uname_r=3.8.13-bone63
#dtb=
cmdline=quiet
###uuid=5dcad23b-fa16-4918-983f-82a6f0c02aae
#capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
optargs=quiet drm.debug=7 capemgr.enable_partno=enable-uart2,enable-uart5
uuid=6baebde8-2358-4f59-aced-798c4aee4cfb

capemgr.enable_partno=enable-uart2,enable-uart5

btw, uart2/uart5 are built-in: (1) (2)

capemgr.enable_partno=BB-UART2,BB-UART5

Just make sure you disable hdmi first (uart5)

capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

full line:

capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
capemgr.enable_partno=BB-UART2,BB-UART5

1: https://github.com/RobertCNelson/linux-stable-rcn-ee/blob/v3.8.13-bone64/firmware/capes/BB-UART2-00A0.dts

2: https://github.com/RobertCNelson/linux-stable-rcn-ee/blob/v3.8.13-bone64/firmware/capes/BB-UART5-00A0.dts

Regards,

Robert, thank you very much, however the overlays are not compiling - I am pretty sure I have the latest dtc:

root@arm:/home/ubuntu/wattup/src/dts# dtc -version
Version: DTC 1.4.0-gf345d9e4

  • dtc -O dtb -o BB-UART2-RTSCTS-00A0.dtbo -b 0 -@ BB-UART2-RTSCTS-00A0.dts
    Error: BB-UART2-RTSCTS-00A0.dts:5.1-2 syntax error
    FATAL ERROR: Unable to parse input tree

Dejan Nenov

Why are you trying to compile them? "built-in" means they are built-in
and ready to go.. No compiling required..

Regards,

Robert, thank you - yes I should be able to use them directly, of course.

Except I have NOT been able to!

My ubuntu distro has no /boot/uEnt.txt in the FAT partition.

Instead the /boot/uEnv.txt appears in the linux filesystem partition and does not do anything at boot time, obviously.

I have manually created a /boot/uEvnt.txt on the FAT partition after booting from eMMC, using

cat /proc/cmdline > /boot/uEnv.txt

and then then added the capemgr enable/disable lines:

console=ttyO0,115200n8 quiet drm.debug=7 root=UUID=4c074e4e-40e6-43ad-a0a1-52113ea40176 ro rootfstype=ext4 rootwait fixrtc quiet
capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
capemgr.enable_partno=BB-UART2,BB-UART5

After rebooting a “ls /dev/ttyO*” (that’s tty-“capital-oh” not zero) returns only:

/dev/ttyO0

and

root@arm:/home/ubuntu# cat /sys/devices/bone_capemgr.9/slots
0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

dmesg dumps is here: http://pastebin.com/iT4RWFnq

Thanks again,

Dejan Nenov

Robert, thank you - yes I should be able to use them directly, of course.

Except I have __NOT__ been able to!

My ubuntu distro has no /boot/uEnt.txt in the FAT partition.

Instead the /boot/uEnv.txt appears in the linux filesystem partition and
does not do anything at boot time, obviously.

It should.. unless you have an older u-boot in eMMC.. (the flasher
upgrades the eMMC, the non-flasher is at the whim of whatever is
installed..)

I have manually created a /boot/uEvnt.txt on the FAT partition after booting
from eMMC, using

cat /proc/cmdline > /boot/uEnv.txt

and then then added the capemgr enable/disable lines:

console=ttyO0,115200n8 quiet drm.debug=7
root=UUID=4c074e4e-40e6-43ad-a0a1-52113ea40176 ro rootfstype=ext4 rootwait
fixrtc quiet
capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
capemgr.enable_partno=BB-UART2,BB-UART5

that's one line right? it looks like an enter after quiet, so the
capemgr calls never got added to the cmdline.

Regards,

Robert, thank you again - Indeed that was the problem:

RESOLUTION for the following configuration:

Linux arm 3.8.13-bone63 #2 SMP Sat Aug 16 00:01:36 PDT 2014 armv7l armv7l armv7l GNU/Linux

Ubuntu 14.04.1 LTS

To enable UART2 using the built-in BB-UART2 overlay so that it is active after reboot do the following:

  1. Boot the BBB from eMMC (boot with the SD card removed)
  2. login, sudo su, and then mount the boot partition to /mnt/boot, you can do it in a single line like this:

[ -d /mnt/boot ] || mkdir /mnt/boot; mount /dev/mmcblk0p1 /mnt/boot

  1. Create a uEnvt.txt file:

[ -d /mnt/boot/boot ] || mkdir /mnt/boot/boot; nano /mnt/boot/boot/uEnv.txt

  1. On a single line(IMPORTANT SINGLE LINE) enter:

console=ttyO0,115200n8 quiet drm.debug=7 root=UUID=4c074e4e-40e6-43ad-a0a1-52113ea40176 ro rootfstype=ext4 rootwait fixrtc quiet capemgr.enable_partno=BB-UART2

End the file with a single carriage return on an empty line (linux not DOS CRLF)

  1. Save and reboot

  2. Login again and check:

cat /sys/devices/bone_capemgr.9/slots

should return:

0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART2

and

ls /dev/ttyO* should show:

/dev/ttyO0 /dev/ttyO2

If you would like to enable BB-UART5, you have to first disable the HDMI overlay.
In that case, please this line in uEnv.txt:

console=ttyO0,115200n8 quiet drm.debug=7 root=UUID=4c074e4e-40e6-43ad-a0a1-52113ea40176 ro rootfstype=ext4 rootwait fixrtc quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-UART2,BB-UART5

and after reboot you will get:

cat /sys/devices/bone_capemgr.9/slots

0: 54:PF—
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART2
8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART5

ls /dev/ttyO*

/dev/ttyO0 /dev/ttyO2 /dev/ttyO5