joholl / rpi4-uboot-tpm

How to use a TPM in U-Boot on Raspberry Pi 4
Apache License 2.0
82 stars 17 forks source link

How to get into U-boot shell? #13

Closed parthghughri closed 1 year ago

parthghughri commented 2 years ago

As per Testing section:

> Boot your board and once the U-Boot bootloader starts, interrupt to enter commands:
> 
> tpm2 init
> tpm2 startup TPM2_SU_CLEAR
> tpm2 get_capability 0x6 0x106 0x200 2
> 
> For an Infineon TPM you should get 0x534c4239 and 0x36373000 which is hex for SLB9670. Congrats!

I am using Raspberry pi 4 model B with Infineon TPM 9670.

How we can interrupt and get U-boot shell. In my case it is directly booting to the Linux kernel. It will be really helpful if you can help me with that. Thank you in advance.

parthghughri commented 2 years ago

Update: I tried to interrupt the boot process by repeatedly pressing 'Esc' but got a black screen. I tried to edit u-boot's boot.scr file and removed all contents so that it won't boot the kernel. But the same result, got a black screen.

Suggestions are appreciated. Thank you

joholl commented 2 years ago

You're supposed to be prompted with a "press any key to enter U-Boot shell" or something similar. If you do not press a key within something like 2s, it continues booting into linux.

Hm, hard to say, really. Maybe it does not even boot into U-Boot, first. Do you have kernel=u-boot.bin in your /boot/config.txt?

When you boot into linux, your serial console (via UART, not HDMI) works, right? That is, do you see the linux boot log on the screen?

parthghughri commented 2 years ago

Thank you for the response. Actually, the issue was with the UART cable I am having. I used another one and I got the U-boot shell. But now the issue I am facing is exactly same as #7, solution mentioned there seems not working for me. I read the TPM device tree, so is there any issue with the gpio-reset pin brcm pin (line 4 and line 18 below)? Looks like pin 24 is getting overlapped. (I am very new to this things so the question might seem silly, feel free to correct me :))

Thank you.


1. slb9670: slb9670@0 {
2.              compatible = "infineon,slb9670", "tis,tpm2-spi", "tcg,tpm_tis-spi";
3.              reg = <0>;
4.              gpio-reset = <&gpio 24 1>;
5.              #address-cells = <1>;
6.              #size-cells = <0>;
7.              status = "okay";
8. 
9.              /* for kernel driver */
10.                 spi-max-frequency = <1000000>;
11.             };
12.         };
13.     };
14. 
15.     fragment@1 {
16.         target = <&spi0_gpio7>;
17.         __overlay__ {
18.             brcm,pins = <7 8 9 10 11 24>;
19.             brcm,function = <0>;
20.         };
21.     };
joholl commented 2 years ago

I don't think that is the problem. By the way: if you do not use/connect the reset pin, it should work fine, as well. Unfortunately, I do not have any time to look into that any further.

Please let us know if/how you fixed your issue.

joholl commented 1 year ago

Gone stale.