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

Procedure for Raspberry Pi 3 (B+) #3

Closed SECimon closed 3 years ago

SECimon commented 4 years ago

I want to get this working on a RPi 3B+.

I have no clue how to do that, so here is what I did (different) so far:

Kernel: make O=result ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- **bcmrpi3_defconfig**

U-Boot: make -j$(nproc) CROSS_COMPILE=aarch64-linux-gnu- **rpi_3_defconfig**

Device Overlay: I just mapped the GPIO pins from RPI 4 to RPI 3B+? /dts-v1/; /plugin/;

/ { compatible = "brcm,bcm2837", "brcm,bcm2837B0", "brcm,bcm2837b0";

fragment@0 {
    target = <&spi0>;
    __overlay__ {
        compatible = "spi-gpio";
        pinctrl-names = "default";
        pinctrl-0 = <&spi0_gpio11>;
        gpio-sck = <&gpio 14 0>;
        gpio-mosi = <&gpio 12 0>;
        gpio-miso = <&gpio 13 0>;
        cs-gpios = <&gpio 11 1>;
        spi-delay-us = <0>;
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";

        /* for kernel driver */
        sck-gpios = <&gpio 14 0>;
        mosi-gpios = <&gpio 12 0>;
        miso-gpios = <&gpio 13 0>;
        num-chipselects = <1>;

        slb9670: slb9670@0 {
            compatible = "infineon,slb9670", "tis,tpm2-spi", "tcg,tpm_tis-spi";
            reg = <0>;
            gpio-reset = <&gpio 5 1>;
            #address-cells = <1>;
            #size-cells = <0>;
            status = "okay";

            /* for kernel driver */
            spi-max-frequency = <1000000>;
        };
    };
};

fragment@1 {
    target = <&spi0_gpio11>;
    __overlay__ {
        brcm,pins = <11 10 13 12 14 5>;
        brcm,function = <0>;
    };
};

fragment@2 {
    target = <&spidev0>;
    __overlay__ {
        status = "disabled";
    };
};

fragment@3 {
    target = <&spidev1>;
    __overlay__ {
        status = "disabled";
    };
};

};

But it is not working. I get the following error message: Couldn't set TPM 0 (rc = 1)

joholl commented 3 years ago

@SECimon Sorry for the late answer. Could you solve this issue?

SECimon commented 3 years ago

No, I could not solve it. I would still appreciate to get it running.

joholl commented 3 years ago

Unfortunately, I do not have the time to look into this. I suggest cranking up the logging when compiling the kernel. Connect to the Raspberry UART and log to a file. Then, you can try to figure out if uboot is actually trying to load the correct kernel modules etc.