From patchwork Mon Mar 18 23:25:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Warren X-Patchwork-Id: 228836 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3C00E2C00A7 for ; Tue, 19 Mar 2013 10:26:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 20A4A4A039; Tue, 19 Mar 2013 00:26:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fokXHtabetpD; Tue, 19 Mar 2013 00:26:35 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C8A4D4A044; Tue, 19 Mar 2013 00:26:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 716074A02D for ; Tue, 19 Mar 2013 00:26:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ni27ZQ5Q3aGg for ; Tue, 19 Mar 2013 00:26:24 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by theia.denx.de (Postfix) with ESMTPS id 924F94A02F for ; Tue, 19 Mar 2013 00:26:08 +0100 (CET) Received: by mail-pb0-f46.google.com with SMTP id uo15so6820548pbc.33 for ; Mon, 18 Mar 2013 16:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-nvconfidentiality; bh=MjhB55dxPcYxFpCPEx7TaDPkdFUYfAkeP7osSJtd/j4=; b=zmbDY26qQa3XE6UTBQPLgXLVyGeVBeqD02G6zSyB0PQ2BuBxL4nn0CrUHn6Wl8vVCG 8DUxjo4Qf/cEqIRNv4AGBjSn3+K+ajOFTurv6nq6BE8VT4+CqE/Nhmhslek1RhAUflJ3 UcuLL/clLDWoPSy695cyCkn7JiF6fip4BhCxNk5SfZlEWeWuIcs805Bi8cKhewMoJdDC wa6Zyt8I5WMS3b/kWwFyrp/0vqf4TMgvyb1uvR4Akb3wfTJK4MZKH1wSElwqCDBmpT7j Iosal6DgM1HBDu7EEfkWnpkjI3fFXTPs8rcmHgQieqIhjsGuQuBTlDD5LWMdH4Itcg3p +4SA== X-Received: by 10.68.143.167 with SMTP id sf7mr35604274pbb.21.1363649166128; Mon, 18 Mar 2013 16:26:06 -0700 (PDT) Received: from tom-ubuntu64.nvidia.com (ip68-230-103-25.ph.ph.cox.net. [68.230.103.25]) by mx.google.com with ESMTPS id zm1sm21733930pbc.26.2013.03.18.16.26.03 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Mar 2013 16:26:05 -0700 (PDT) From: Tom Warren To: u-boot@lists.denx.de Date: Mon, 18 Mar 2013 16:25:35 -0700 Message-Id: <1363649136-23155-4-git-send-email-twarren@nvidia.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1363649136-23155-1-git-send-email-twarren@nvidia.com> References: <1363649136-23155-1-git-send-email-twarren@nvidia.com> X-NVConfidentiality: public Cc: swarren@nvidia.com, afleming@freescale.com, Tom Warren , twarren.nvidia@gmail.com Subject: [U-Boot] [PATCH v2 3/4] Tegra114: MMC: Add SD bus power-rail init routine X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de T114 requires SD bus power-rail bringup for the SDIO card on SDMMC3. Signed-off-by: Tom Warren Reviewed-by: Stephen Warren --- v2: Remove I2C retries board/nvidia/dalmore/dalmore.c | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/board/nvidia/dalmore/dalmore.c b/board/nvidia/dalmore/dalmore.c index 7449b5b..2c23a29 100644 --- a/board/nvidia/dalmore/dalmore.c +++ b/board/nvidia/dalmore/dalmore.c @@ -18,6 +18,10 @@ #include #include #include "pinmux-config-dalmore.h" +#include + +#define BAT_I2C_ADDRESS 0x48 /* TPS65090 charger */ +#define PMU_I2C_ADDRESS 0x58 /* TPS65913 PMU */ /* * Routine: pinmux_init @@ -37,3 +41,61 @@ void pinmux_init(void) /* Initialize any non-default pad configs (APB_MISC_GP regs) */ padgrp_config_table(dalmore_padctrl, ARRAY_SIZE(dalmore_padctrl)); } + +#if defined(CONFIG_TEGRA_MMC) +/* + * Do I2C/PMU writes to bring up SD card bus power + * + */ +void board_sdmmc_voltage_init(void) +{ + uchar reg, data_buffer[1]; + int ret; + + ret = i2c_set_bus_num(0);/* PMU is on bus 0 */ + if (ret) + printf("%s: i2c_set_bus_num returned %d\n", __func__, ret); + + /* TPS65913: LDO9_VOLTAGE = 3.3V */ + data_buffer[0] = 0x31; + reg = 0x61; + + ret = i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1); + if (ret) + printf("%s: PMU i2c_write %02X<-%02X returned %d\n", + __func__, reg, data_buffer[0], ret); + + /* TPS65913: LDO9_CTRL = Active */ + data_buffer[0] = 0x01; + reg = 0x60; + + ret = i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1); + if (ret) + printf("%s: PMU i2c_write %02X<-%02X returned %d\n", + __func__, reg, data_buffer[0], ret); + + /* TPS65090: FET6_CTRL = enable output auto discharge, enable FET6 */ + data_buffer[0] = 0x03; + reg = 0x14; + + ret = i2c_write(BAT_I2C_ADDRESS, reg, 1, data_buffer, 1); + if (ret) + printf("%s: BAT i2c_write %02X<-%02X returned %d\n", + __func__, reg, data_buffer[0], ret); +} + +/* + * Routine: pin_mux_mmc + * Description: setup the MMC muxes, power rails, etc. + */ +void pin_mux_mmc(void) +{ + /* + * NOTE: We don't do mmc-specific pin muxes here. + * They were done globally in pinmux_init(). + */ + + /* Bring up the SDIO3 power rail */ + board_sdmmc_voltage_init(); +} +#endif /* MMC */