I was finally able to get Trusty running (to a point) on my hardware.
I think I heard that u-boot provides native support for dispatching OPTEE, but I'm not sure if there is native support for dispatching the Trusty OS from u-boot. I know that the Arm Trusted Firmware (ATF) does provide a Secure Payload Dispatcher (SPD) for trusty, so I configured the ATF to use that SPD. In addition to that ATF change, I had to make sure all the u-boot device tree nodes were properly annotated with "u-boot,dm-spl".
In case this helps anyone: There were several obvious device tree nodes that needed the u-boot,dm-spl annotation, the one that took the longest to find was this one:
&{/imx8qx-pm} {
u-boot,dm-spl;
connectivity_power_domain{
conn_sdhc0{
u-boot,dm-spl;
};
};
};Without that one the eMMC was unusable because it appeared there there was a clock related to the eMMC that SPL wasn't able to enable.
To configure the ATF (bl31.bin) to use the trusty SPD meant I needed to add "SPL=trusty" to the make parameters for bl31 in the AndroidUboot.mk file found in the ${ANDROID_BUILD_TOP}/device/<vendor>/<hw>/<product> directory. After those changes, SPL was able to properly load the third container with the Trusty OS, u-boot proper and ATF. Then ATF properly kicked off the Trusty OS, and then jumped to u-boot proper. I was able to confirm this because u-boot reported that it was able to use IPC to communicate with the Trusty OS.
However, among the first things that Trusty and u-boot attempted to do was to initialize the RPMB keys in the eMMC by blowing those fuses. Apparently I had accidentally blown those fuses at some point while I was experimenting. So at the moment my hardware is unable to boot using Trusty TEE OS because the "destroyed" RPMB keys in the eMMC which cause u-boot to hang. I have new hardware on the way which should allow me to complete testing.
So a word to the wise... Don't experiment with the RPMB fuses if you plan to use Trusty TEE, or else you might need to replace your eMMC.