diff options
Diffstat (limited to 'src/mainboard/google/rush_ryu/romstage.c')
-rw-r--r-- | src/mainboard/google/rush_ryu/romstage.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/mainboard/google/rush_ryu/romstage.c b/src/mainboard/google/rush_ryu/romstage.c index 307c1f7008..f6de3d5b7d 100644 --- a/src/mainboard/google/rush_ryu/romstage.c +++ b/src/mainboard/google/rush_ryu/romstage.c @@ -19,41 +19,39 @@ #include <soc/addressmap.h> #include <soc/clock.h> +#include <soc/funitcfg.h> #include <soc/padconfig.h> #include <soc/nvidia/tegra/i2c.h> #include <soc/romstage.h> -static struct clk_rst_ctlr *clk_rst = (void *)TEGRA_CLK_RST_BASE; - static const struct pad_config padcfgs[] = { /* AP_SYS_RESET_L */ PAD_CFG_GPIO_OUT1(GPIO_PI5, PINMUX_PULL_UP), - /* TPM on I2C3 */ + /* WP_L */ + PAD_CFG_GPIO_INPUT(KB_ROW1, PINMUX_PULL_NONE), +}; + +static const struct pad_config tpm_pads[] = { PAD_CFG_SFIO(CAM_I2C_SCL, PINMUX_INPUT_ENABLE, I2C3), PAD_CFG_SFIO(CAM_I2C_SDA, PINMUX_INPUT_ENABLE, I2C3), - /* EC on I2C2 - pulled to 3.3V */ +}; + +static const struct pad_config ec_i2c_pads[] = { PAD_CFG_SFIO(GEN2_I2C_SCL, PINMUX_OPEN_DRAIN|PINMUX_INPUT_ENABLE, I2C2), PAD_CFG_SFIO(GEN2_I2C_SDA, PINMUX_OPEN_DRAIN|PINMUX_INPUT_ENABLE, I2C2), - /* WP_L */ - PAD_CFG_GPIO_INPUT(KB_ROW1, PINMUX_PULL_NONE), }; -static void configure_clocks(void) -{ - /* TPM on I2C3 */ - clock_enable_clear_reset(0, 0, CLK_U_I2C3, 0, 0, 0); - clock_configure_i2c_scl_freq(i2c3, PLLP, 400); - - /* EC on I2C2 */ - clock_enable_clear_reset(0, CLK_H_I2C2, 0, 0, 0, 0); - clock_configure_i2c_scl_freq(i2c2, PLLP, 100); -} +static const struct funit_cfg funits[] = { + /* TPM on I2C3 @ 400kHz */ + FUNIT_CFG(I2C3, PLLP, 400, tpm_pads, ARRAY_SIZE(tpm_pads)), + /* EC on I2C2 - pulled to 3.3V @ 100kHz */ + FUNIT_CFG(I2C2, PLLP, 100, ec_i2c_pads, ARRAY_SIZE(ec_i2c_pads)), +}; void romstage_mainboard_init(void) { - configure_clocks(); - /* Bring up controller interfaces for ramstage loading. */ + soc_configure_funits(funits, ARRAY_SIZE(funits)); soc_configure_pads(padcfgs, ARRAY_SIZE(padcfgs)); /* TPM */ |