Cape no longer working

On the BBB, using Linux beaglebone 4.1.18-ti-r53 (from console flasher
image), the CryptoCape no longer appears to load:

debian@beaglebone:~$ dmesg | grep CRYPTO
[ 3.607175] bone_capemgr bone_capemgr: slot #3: 'BB-BONE
-CRYPTO,00A0,SparkFun,BB-BONE-CRYPTO'
[ 4.617394] bone_capemgr bone_capemgr: loader: failed to load slot-3
BB-BONE-CRYPTO:00A0 (prio 0)

I'm not sure how to debug this further.

I tried this on both an older cape and a newer one and I (or SparkFun)
haven't changed.

I checked
https://github.com/RobertCNelson/dtb-rebuilder/tree/4.1-ti/src/arm but
I didn't see the overlay.

Is there something else one needs to do now to enable this (or other
capes?)

Thanks,

Josh

The 'console' doesn't ship the *.dtbo objects (yet, i need to finish up the
deb package)..

sudo apt-get update
sudo apt-get install git-core device-tree-compiler

git clone https://github.com/beagleboard/bb.org-overlays
cd ./bb.org-overlays

./install.sh

Regards,

Great! thanks, but now I'm having another problem. It doesn't seem like
UART4 is being enabled even though it appears to be included (https://g
ithub.com/beagleboard/bb.org
-overlays/blob/bde762dcc6586ce2821a76ddebc5edcec3f09917/src/arm/BB-BONE
-CRYPTO-00A0.dts#L56-L62)

I would have expected /dev/ttyS4, but nope:

debian@beaglebone:~$ dmesg | grep CRYPTO
[ 3.627256] bone_capemgr bone_capemgr: slot #3: 'BB-BONE
-CRYPTO,00A0,SparkFun,BB-BONE-CRYPTO'
[ 3.640694] bone_capemgr bone_capemgr: slot #3: dtbo 'BB-BONE-CRYPTO
-00A0.dtbo' loaded; overlay id #0

debian@beaglebone:~$ dmesg | grep tty
[ 0.000000] Kernel command line: console=ttyO0,115200n8
root=UUID=9544b715-25a2-4e6c-a360-9928caf9af46 ro rootfstype=ext4
rootwait coherent_pool=1M quiet cape_universal=enable
[ 0.000376] WARNING: Your 'console=ttyO0' has been replaced by
'ttyS0'
[ 3.154045] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158,
base_baud = 3000000) is a 8250
[ 3.161437] console [ttyS0] enabled

I also would have expected the GPIO to be exported automatically, for
example, gpio1_17 (which is in BB-BONE-CRYPTO-00A0.dts
) but it doesn't seem to be the case:

debian@beaglebone:/sys/class/gpio$ ls /sys/class/gpio/
export gpiochip0 gpiochip32 gpiochip64 gpiochip96 unexport

The i2c fragments (tpm/rtc) loaded fine, just fragment0 and 1 seem to
not have been effective.

Josh

I'm seeing that too:

root@beaglebone:~# uname -r
4.1.18-ti-r56

root@beaglebone:~# dmesg | grep bone
[ 0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8
bone_capemgr.enable_partno=BB-BONE-CRYPTO root=/dev/mmcblk0p1
rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
[ 3.386147] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,
,BBG115096703'
[ 3.386174] bone_capemgr bone_capemgr:
compatible-baseboard=ti,beaglebone-black - #slots=4
[ 3.437209] bone_capemgr bone_capemgr: slot #0: No cape found
[ 3.497009] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.557005] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.617001] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.622797] bone_capemgr bone_capemgr: enabled_partno PARTNO
'BB-BONE-CRYPTO' VER 'N/A' PR '0'
[ 3.622810] bone_capemgr bone_capemgr: slot #4: override
[ 3.622823] bone_capemgr bone_capemgr: Using override eeprom data at
slot 4
[ 3.622838] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,BB-BONE-CRYPTO'
[ 3.623136] bone_capemgr bone_capemgr: initialized OK.
[ 3.633106] bone_capemgr bone_capemgr: slot #4: dtbo
'BB-BONE-CRYPTO-00A0.dtbo' loaded; overlay id #0
[ 15.731133] LUN: removable file:
/var/cache/doc-beaglebone-getting-started/beaglebone-getting-started-2015-12-04.img

root@beaglebone:~# dmesg | grep serial
[ 3.149805] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158,
base_baud = 3000000) is a 8250
[ 3.632025] omap8250 481a8000.serial: could not find pctldev for node
/ocp/interrupt-controller@48200000, deferring probe
[ 14.562673] omap8250 481a8000.serial: could not find pctldev for node
/ocp/interrupt-controller@48200000, deferring probe
[ 14.578263] omap8250 481a8000.serial: could not find pctldev for node
/ocp/interrupt-controller@48200000, deferring probe
[ 14.838456] omap8250 481a8000.serial: could not find pctldev for node
/ocp/interrupt-controller@48200000, deferring probe
[ 15.059017] omap8250 481a8000.serial: could not find pctldev for node
/ocp/interrupt-controller@48200000, deferring probe
[ 17.240607] omap8250 481a8000.serial: could not find pctldev for node
/ocp/interrupt-controller@48200000, deferring probe
[ 17.360686] omap8250 481a8000.serial: could not find pctldev for node
/ocp/interrupt-controller@48200000, deferring probe

and we see ^^

will start booting previous versions..

Regards,

okay, it's something the 2nd fragment:

root@beaglebone:~# dmesg | grep serial
[ 3.162576] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158,
base_baud = 3000000) is a 8250
[ 3.644352] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 197,
base_baud = 3000000) is a 8250
[ 3.645270] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 198,
base_baud = 3000000) is a 8250
root@beaglebone:~# dmesg | grep bone
[ 0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8
bone_capemgr.enable_partno=BB-UART2,BB-BONE-CRYPTO root=/dev/mmcblk0p1
rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
[ 3.387814] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,
,BBG115096703'
[ 3.387840] bone_capemgr bone_capemgr:
compatible-baseboard=ti,beaglebone-black - #slots=4
[ 3.447187] bone_capemgr bone_capemgr: slot #0: No cape found
[ 3.507009] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.567006] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.627002] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.632800] bone_capemgr bone_capemgr: enabled_partno PARTNO 'BB-UART2'
VER 'N/A' PR '0'
[ 3.632812] bone_capemgr bone_capemgr: slot #4: override
[ 3.632826] bone_capemgr bone_capemgr: Using override eeprom data at
slot 4
[ 3.632840] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,BB-UART2'
[ 3.632937] bone_capemgr bone_capemgr: enabled_partno PARTNO
'BB-BONE-CRYPTO' VER 'N/A' PR '0'
[ 3.632949] bone_capemgr bone_capemgr: slot #5: override
[ 3.632960] bone_capemgr bone_capemgr: Using override eeprom data at
slot 5
[ 3.632973] bone_capemgr bone_capemgr: slot #5: 'Override Board
Name,00A0,Override Manuf,BB-BONE-CRYPTO'
[ 3.633319] bone_capemgr bone_capemgr: initialized OK.
[ 3.644871] bone_capemgr bone_capemgr: slot #4: dtbo
'BB-UART2-00A0.dtbo' loaded; overlay id #0
[ 3.645649] bone_capemgr bone_capemgr: slot #5: dtbo
'BB-BONE-CRYPTO-00A0.dtbo' loaded; overlay id #1
[ 11.698329] LUN: removable file:
/var/cache/doc-beaglebone-getting-started/beaglebone-getting-started-2015-12-04.img
root@beaglebone:~# dmesg | grep serial
[ 3.162576] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158,
base_baud = 3000000) is a 8250
[ 3.644352] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 197,
base_baud = 3000000) is a 8250
[ 3.645270] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 198,
base_baud = 3000000) is a 8250

http://paste.debian.net/425172/

Regards,

Now it works if we remove:

- /* TPM - Driver currently only available in 3.13.x
*/
- tpm_i2c_atmel@29 {
- compatible = "tpm_i2c_atmel";
- reg = <0x29>;
- };

i bet something changed in v4.1.x with regards to the tpm_i2c_atmel node..
time to grep the kernel..

Regards,

Got it:

http://paste.debian.net/425175/

it helps when the i2c bus is actually enabled..

Regards,

>
Now it works if we remove:

- /* TPM - Driver currently only available in
3.13.x */
- tpm_i2c_atmel@29 {
- compatible = "tpm_i2c_atmel";
- reg = <0x29>;
- };

i bet something changed in v4.1.x with regards to the tpm_i2c_atmel
node.. time to grep the kernel..

Ok, thanks, odd.

The tpm module did seem to come up with /dev/tpm0 though when the
UART/GPIO didn't.

If successful, I think you'll just see "Issuing TPM_STARTUP" or
something similar.

They moved the tpm in the sysfs in 4.X or around there, but on a quick
look the driver name is still the same and the address hasn't
changed...

and pushed:

https://github.com/beagleboard/bb.org-overlays/commit/d94f9b7bfe1b67302fe05485e662054936b11963

debian@beaglebone:~$ dmesg | grep serial
[ 3.162564] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 158,
base_baud = 3000000) is a 8250
[ 3.644695] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 197,
base_baud = 3000000) is a 8250
[ 3.645602] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 198,
base_baud = 3000000) is a 8250
debian@beaglebone:~$ dmesg | grep bone
[ 0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8
bone_capemgr.enable_partno=BB-UART2,BB-BONE-CRYPTO root=/dev/mmcblk0p1
rootfstype=ext4 rootwait coherent_pool=1M quiet cape_universal=enable
[ 3.396105] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,
,BBG115096703'
[ 3.396132] bone_capemgr bone_capemgr:
compatible-baseboard=ti,beaglebone-black - #slots=4
[ 3.447180] bone_capemgr bone_capemgr: slot #0: No cape found
[ 3.506977] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.566975] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.626971] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.632769] bone_capemgr bone_capemgr: enabled_partno PARTNO 'BB-UART2'
VER 'N/A' PR '0'
[ 3.632782] bone_capemgr bone_capemgr: slot #4: override
[ 3.632795] bone_capemgr bone_capemgr: Using override eeprom data at
slot 4
[ 3.632810] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,BB-UART2'
[ 3.632908] bone_capemgr bone_capemgr: enabled_partno PARTNO
'BB-BONE-CRYPTO' VER 'N/A' PR '0'
[ 3.632919] bone_capemgr bone_capemgr: slot #5: override
[ 3.632930] bone_capemgr bone_capemgr: Using override eeprom data at
slot 5
[ 3.632943] bone_capemgr bone_capemgr: slot #5: 'Override Board
Name,00A0,Override Manuf,BB-BONE-CRYPTO'
[ 3.633294] bone_capemgr bone_capemgr: initialized OK.
[ 3.645208] bone_capemgr bone_capemgr: slot #4: dtbo
'BB-UART2-00A0.dtbo' loaded; overlay id #0
[ 3.647528] bone_capemgr bone_capemgr: slot #5: dtbo
'BB-BONE-CRYPTO-00A0.dtbo' loaded; overlay id #1
[ 13.422266] LUN: removable file:
/var/cache/doc-beaglebone-getting-started/beaglebone-getting-started-2015-12-04.img

Regards,

Great! Thanks so much.

Sorry about missing that for a while, I need to keep up a bit better :confused:

Josh

I think we could convert gpio1_17 into a led, then you can easily toggle it
from userspace.

is gpio1_13 and irq source from the TPM?

My crypto cape is at home, so i've only been force load testing the *.dtbo

Regards,

gpio1_17 is tied to the reset line of the ATmega on the cape and is
meant to be toggled from userspace to allow for, well, resetting.
Besides the obvious this allows users to reset the ATmega to upload
sketches with avrdude (using UART4).

So, while it sounds odd to make it an LED, if that makes it easier to
toggle then writing a 1/0 to the gpio? (I'm not familiar with the LED
feature), then sure, easier is better I think.

gpio1_13 is an input from the ATAES132, so I don't think it would
qualify. I never made a linux driver for that chip and I'm not aware
of people using it (but people tend to be discrete about what they use
crypto hardware for :stuck_out_tongue: )

Lastly, this TPM only uses those i2c pins I believe that the TPM is
(now) setup correctly hardware/software wise.