t132: Add support for tpm i2c
Iniitialize I2C bus required for TPM operation. Problem observed was that if frequency is raised above 20KHz, TPM starts responding with NAKs either for address or for data. Need to look into that. BUG=None BRANCH=None TEST=Compiles successfully and TPM success messages seen while booting. Change-Id: I9e1b4958d2ec010e31179df12a099277e6ce09e0 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/210001 Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
670e21ed11
commit
01e87ae354
3 changed files with 36 additions and 0 deletions
|
|
@ -19,6 +19,38 @@
|
|||
|
||||
#include <soc/romstage.h>
|
||||
|
||||
#include <soc/addressmap.h>
|
||||
#include <soc/clock.h>
|
||||
#include <soc/nvidia/tegra/i2c.h>
|
||||
#include <soc/nvidia/tegra132/pinmux.h>
|
||||
#include <soc/nvidia/tegra132/gpio.h>
|
||||
|
||||
static struct clk_rst_ctlr *clk_rst = (void *)TEGRA_CLK_RST_BASE;
|
||||
|
||||
static void configure_tpm_i2c_bus(void)
|
||||
{
|
||||
clock_configure_i2c_scl_freq(i2c3, PLLP, 19);
|
||||
|
||||
i2c_init(2);
|
||||
}
|
||||
|
||||
void mainboard_init_tpm_i2c(void)
|
||||
{
|
||||
clock_enable_clear_reset(0, 0, CLK_U_I2C3, 0, 0, 0);
|
||||
|
||||
gpio_output(GPIO(I5), 1);
|
||||
|
||||
// I2C3 (cam) clock.
|
||||
pinmux_set_config(PINMUX_CAM_I2C_SCL_INDEX,
|
||||
PINMUX_CAM_I2C_SCL_FUNC_I2C3 | PINMUX_INPUT_ENABLE);
|
||||
// I2C3 (cam) data.
|
||||
pinmux_set_config(PINMUX_CAM_I2C_SDA_INDEX,
|
||||
PINMUX_CAM_I2C_SDA_FUNC_I2C3 | PINMUX_INPUT_ENABLE);
|
||||
|
||||
|
||||
configure_tpm_i2c_bus();
|
||||
}
|
||||
|
||||
void mainboard_configure_pmc(void)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,5 +22,6 @@
|
|||
|
||||
void mainboard_configure_pmc(void);
|
||||
void mainboard_enable_vdd_cpu(void);
|
||||
void mainboard_init_tpm_i2c(void);
|
||||
|
||||
#endif /* __SOC_NVIDIA_TEGRA132_SOC_ROMSTAGE_H__ */
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "ccplex.h"
|
||||
|
||||
#include <soc/clock.h>
|
||||
#include <soc/romstage.h>
|
||||
|
||||
void romstage(void);
|
||||
|
||||
|
|
@ -85,6 +86,8 @@ void romstage(void)
|
|||
ccplex_load_mts();
|
||||
printk(BIOS_INFO, "T132 romstage: MTS loading done\n");
|
||||
|
||||
mainboard_init_tpm_i2c();
|
||||
|
||||
entry = load_ramstage();
|
||||
|
||||
if (entry == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue