From b8de44742e6334ce34499af928689d969a1a3283 Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Fri, 22 Aug 2014 17:24:11 -0700 Subject: ryu: initialize LTE modem BUG=chrome-os-partner:30748 TEST=Verify that LTE modem appears on USB during kernel boots on Ryu. Change-Id: I5b73a632ab827abe9c064a097e04d2c9030f9b46 Signed-off-by: Patrick Georgi Original-Commit-Id: 070538e60b384d17e17ba3544881ef642c3f33ba Original-Change-Id: I8ec1f94c9aec5b4895a01cdfd3b86f88cd6bb877 Original-Signed-off-by: Ben Chan Original-Reviewed-on: https://chromium-review.googlesource.com/214020 Original-Reviewed-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/9002 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/google/rush_ryu/romstage.c | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/mainboard/google/rush_ryu/romstage.c') diff --git a/src/mainboard/google/rush_ryu/romstage.c b/src/mainboard/google/rush_ryu/romstage.c index 088357f4f2..4d22335fda 100644 --- a/src/mainboard/google/rush_ryu/romstage.c +++ b/src/mainboard/google/rush_ryu/romstage.c @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -24,11 +25,20 @@ #include #include +#include "gpio.h" +#include "pmic.h" + static const struct pad_config padcfgs[] = { /* AP_SYS_RESET_L */ PAD_CFG_GPIO_OUT1(GPIO_PI5, PINMUX_PULL_UP), /* WP_L */ PAD_CFG_GPIO_INPUT(KB_ROW1, PINMUX_PULL_NONE), + /* MODEM_RESET */ + PAD_CFG_GPIO_OUT0(KB_ROW11, PINMUX_PULL_DOWN), + /* MODEM_PWR_ON */ + PAD_CFG_GPIO_OUT0(KB_ROW12, PINMUX_PULL_DOWN), + /* MDM_DET - expected to be pulled down by LTE modem */ + PAD_CFG_GPIO_INPUT(GPIO_PV1, PINMUX_PULL_UP), }; static const struct pad_config tpm_pads[] = { @@ -50,6 +60,32 @@ static const struct funit_cfg funits[] = { FUNIT_CFG(I2C6, PLLP, 400, NULL, 0), }; +static void lte_modem_init(void) +{ + int mdm_det; + + /* A LTE modem is present if MDM_DET is pulled down by the modem */ + mdm_det = gpio_get_in_value(MDM_DET); + if (mdm_det == 1) + return; + + printk(BIOS_DEBUG, "Found LTE modem\n"); + + /* Enable PMIC CLK32KGAUDIO to drive CLK_MDM_32K */ + pmic_write_reg(I2CPWR_BUS, TI65913_PRIMARY_SECONDARY_PAD2, 0x02, 0); + pmic_write_reg(I2CPWR_BUS, TI65913_CLK32KGAUDIO_CTRL, 0x01, 0); + + /* FULL_CARD_POWER_OFF# (A44: MODEM_PWR_ON) and RESET# + * (A44: MODEM_RESET) of the LTE modem are actively low and initially + * pulled down by the pad config. To properly enable the LTE modem, + * de-assert FULL_CARD_POWER_OFF#, wait for at least 10ms, and then + * de-assert RESET#. + */ + gpio_output(MODEM_PWR_ON, 1); + udelay(15000); + gpio_output(MODEM_RESET, 1); +} + void romstage_mainboard_init(void) { /* Bring up controller interfaces for ramstage loading. */ @@ -63,6 +99,8 @@ void romstage_mainboard_init(void) i2c_init(I2C2_BUS); /* I2C6 bus (audio, etc.) */ i2c_init(I2C6_BUS); + + lte_modem_init(); } void mainboard_configure_pmc(void) -- cgit v1.2.3