My goal is to write code that uses TPM features before the OS loads. Is it possible to do that with TSS? If not, what are some other alternatives for libraries that wrap TPM functions into a good API. I saw that in trustedGrub they used memory mapped io for TPM interface, and that's what I'm trying to avoid. Also, if I'm using UEFI instead of BIOS, does it give me any more comfortable interface to use the TPM with?
TSS was designed to be an operating system API that sits between the application and the kernel.
Although technically it would be possible to implement some parts of the TSS at a lower level, I'm not aware of any such implementations. You will have to construct the data to communicate with the TPM yourself. TrustedGrub provides some utility functions that you've already seen (actually some commands are fully implemented), and if you're developing for UEFI, EDK II provides a function to submit a command to TPM 1.2 that you can build on. There is an equivalent one for TPM 2.0. I'm not aware of a higher-level UEFI API.