From patchwork Mon Feb 27 20:52:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 143272 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 2B573B6FD5 for ; Tue, 28 Feb 2012 07:54:07 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B1BB128389; Mon, 27 Feb 2012 21:53:57 +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 aQGaalTAoqgr; Mon, 27 Feb 2012 21:53:57 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA0CB28354; Mon, 27 Feb 2012 21:53:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6C0FF28333 for ; Mon, 27 Feb 2012 21:53: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 QDh+6-zTZ9hN for ; Mon, 27 Feb 2012 21:53:25 +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-yx0-f202.google.com (mail-yx0-f202.google.com [209.85.213.202]) by theia.denx.de (Postfix) with ESMTPS id BC94928337 for ; Mon, 27 Feb 2012 21:53:24 +0100 (CET) Received: by yenq2 with SMTP id q2so118123yen.3 for ; Mon, 27 Feb 2012 12:53:23 -0800 (PST) Received-SPF: pass (google.com: domain of sjg@google.com designates 10.236.103.68 as permitted sender) client-ip=10.236.103.68; Authentication-Results: mr.google.com; spf=pass (google.com: domain of sjg@google.com designates 10.236.103.68 as permitted sender) smtp.mail=sjg@google.com Received: from mr.google.com ([10.236.103.68]) by 10.236.103.68 with SMTP id e44mr29435255yhg.3.1330376003545 (num_hops = 1); Mon, 27 Feb 2012 12:53:23 -0800 (PST) Received: by 10.236.103.68 with SMTP id e44mr19580025yhg.3.1330376003535; Mon, 27 Feb 2012 12:53:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.103.68 with SMTP id e44mr19579992yhg.3.1330376003460; Mon, 27 Feb 2012 12:53:23 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i14si1396468anf.1.2012.02.27.12.53.23 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 27 Feb 2012 12:53:23 -0800 (PST) Received: from sglass.mtv.corp.google.com (sglass.mtv.corp.google.com [172.22.72.144]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 5929A10005F; Mon, 27 Feb 2012 12:53:23 -0800 (PST) Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id 26D7C140EB8; Mon, 27 Feb 2012 12:53:23 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Mon, 27 Feb 2012 12:52:50 -0800 Message-Id: <1330375973-10681-18-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1330375973-10681-1-git-send-email-sjg@chromium.org> References: <1330375973-10681-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkAuHS04YIfVHVgeGGd2pQC/f2N78bDmgaZNaOmkfsyTxjZx7PsfXkdRFJR5/vE35Csl+8JUtNCWFuumA5kiulpcVc/Mh4sK2D025v+kvAxJS7JhGRo/tPQIRV5xmaGjcZ1KGRGVA89hS52fk18nlJ6NNaN/cxW8En6HWysfizLwxCMhKA= Cc: linux-tegra@vger.kernel.org, Tom Warren Subject: [U-Boot] [PATCH v6 17/20] tegra: usb: Add USB support to nvidia boards 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This adds basic USB support for port 0. The other port is not supported yet. Tegra2 (SeaBoard) # usb start (Re)start USB... USB: Register 10011 NbrPorts 1 USB EHCI 1.00 scanning bus for devices... 5 USB Device(s) found scanning bus for storage devices... 1 Storage Device(s) found Tegra2 (SeaBoard) # ext2load usb 0:3 10000000 /boot/vmlinuz Loading file "/boot/vmlinuz" from usb device 0:3 (ROOT-A) 2932976 bytes read Signed-off-by: Simon Glass --- Changes in v2: - Add setting of pinmux for USB VBUS GPIO Changes in v5: - Put pinmux setting into a board-specific function board/nvidia/common/board.c | 12 ++++++++++++ board/nvidia/common/board.h | 6 ++++++ board/nvidia/seaboard/seaboard.c | 6 ++++++ 3 files changed, 24 insertions(+), 0 deletions(-) diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index e8253a0..72d8630 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "board.h" DECLARE_GLOBAL_DATA_PTR; @@ -50,6 +51,12 @@ int timer_init(void) return 0; } +void __pin_mux_usb(void) +{ +} + +void pin_mux_usb(void) __attribute__((weak, alias("__pin_mux_usb"))); + /* * Routine: board_init * Description: Early hardware init. @@ -69,6 +76,11 @@ int board_init(void) /* boot param addr */ gd->bd->bi_boot_params = (NV_PA_SDRAM_BASE + 0x100); +#ifdef CONFIG_USB_EHCI_TEGRA + pin_mux_usb(); + board_usb_init(gd->fdt_blob); +#endif + return 0; } diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h index a638af2..09fb158 100644 --- a/board/nvidia/common/board.h +++ b/board/nvidia/common/board.h @@ -27,4 +27,10 @@ void gpio_config_uart(void); void gpio_early_init_uart(void); +/* + * Set up any pin muxing needed for USB (for now, since fdt doesn't support + * it). Boards can overwrite the default fucction which does nothing. + */ +void pin_mux_usb(void); + #endif /* BOARD_H */ diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c index 9ab6825..94efb1e 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -90,3 +90,9 @@ int board_mmc_init(bd_t *bd) return 0; } #endif + +void pin_mux_usb(void) +{ + /* For USB's GPIO PD0. For now, since we have no pinmux in fdt */ + pinmux_tristate_disable(PINGRP_SLXK); +}