summaryrefslogtreecommitdiff
path: root/src/mainboard/google/rush_ryu/romstage.c
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2014-08-22 17:24:11 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-03-27 08:03:39 +0100
commitb8de44742e6334ce34499af928689d969a1a3283 (patch)
treef435217f786e78b192b1cb19a644959e57f40432 /src/mainboard/google/rush_ryu/romstage.c
parent4058d7b9d465ce730a7043e0ce2ae780a7627d81 (diff)
downloadcoreboot-b8de44742e6334ce34499af928689d969a1a3283.tar.xz
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 <pgeorgi@chromium.org> Original-Commit-Id: 070538e60b384d17e17ba3544881ef642c3f33ba Original-Change-Id: I8ec1f94c9aec5b4895a01cdfd3b86f88cd6bb877 Original-Signed-off-by: Ben Chan <benchan@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/214020 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/9002 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard/google/rush_ryu/romstage.c')
-rw-r--r--src/mainboard/google/rush_ryu/romstage.c38
1 files changed, 38 insertions, 0 deletions
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 <delay.h>
#include <soc/addressmap.h>
#include <soc/clock.h>
#include <soc/funitcfg.h>
@@ -24,11 +25,20 @@
#include <soc/nvidia/tegra/i2c.h>
#include <soc/romstage.h>
+#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)