From patchwork Tue May 4 12:48:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Upadhyay X-Patchwork-Id: 71780 X-Patchwork-Delegate: prafulla@marvell.com Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 57AAAB076F1 for ; Tue, 4 May 2010 14:49:08 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 47836C912DD7 for ; Tue, 4 May 2010 14:49:08 +0200 (CEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.9) for (single-drop); Tue, 04 May 2010 14:49:08 +0200 (CEST) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Tue, 04 May 2010 14:47:32 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Tue, 04 May 2010 14:47:32 +0200 Received: from scanner-1.m-online.net (unknown [192.168.8.165]) by mail.m-online.net (Postfix) with ESMTP id F1AC420017F; Tue, 4 May 2010 14:47:31 +0200 (CEST) Received: from mxin-3.m-online.net ([192.168.6.165]) by scanner-1.m-online.net (scanner-1.m-online.net [192.168.8.165]) (amavisd-new, port 10026) with ESMTP id 25831-03; Tue, 4 May 2010 14:47:30 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-3.m-online.net (Postfix) with ESMTP id 4076046159E; Tue, 4 May 2010 14:47:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B7C53280BC; Tue, 4 May 2010 14:47:24 +0200 (CEST) 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 KQkI7tBqiaeP; Tue, 4 May 2010 14:47:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A886828098; Tue, 4 May 2010 14:47:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 21C3E28093 for ; Tue, 4 May 2010 14:47:17 +0200 (CEST) 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 1xiL5Ym4M-I8 for ; Tue, 4 May 2010 14:47:15 +0200 (CEST) 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 ahm.einfochips.com (ahm.einfochips.com [203.88.139.151]) by theia.denx.de (Postfix) with ESMTP id 0840B28090 for ; Tue, 4 May 2010 14:47:13 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by ahm.einfochips.com (Postfix) with ESMTP id 41ECFA608009; Tue, 4 May 2010 18:14:48 +0530 (IST) Received: from ahm.einfochips.com ([127.0.0.1]) by localhost (ahm.einfochips.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jvkzu2Z-c7G4; Tue, 4 May 2010 18:14:48 +0530 (IST) Received: from localhost.localdomain (unknown [192.168.14.15]) by ahm.einfochips.com (Postfix) with ESMTPA id 228AAA608001; Tue, 4 May 2010 18:14:48 +0530 (IST) From: Tanmay Upadhyay To: prafulla@marvell.com Date: Tue, 4 May 2010 18:18:58 +0530 Message-Id: <1272977338-3492-1-git-send-email-tanmay.upadhyay@einfochips.com> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: References: Cc: u-boot@lists.denx.de, Dhaval Vasa , Tanmay Upadhyay Subject: [U-Boot] [PATCH] OpenRD: Reset PCIe endpoint while boot-up through PERST# X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 X-Virus-Scanned: by amavisd-new at m-online.net As per PCIe specifications PERST# line (A11 on the PCIe connector) should be asserted for minimum 100us. PCIe endpoint comes out of reset when this line is high. In case of OpenRD, this line was in tri-state. This might prevent PCIe devices to appear on the PCIe bus. This patch holds PERST# line low for 100 us and then sets high while booting. XGI Vollari Z11 GPU and Intel WiFi 4965 works fine without this fix. Where as Broadcom's BCM970012 doesn't appear on the PCIe bus without the fix. There might be few other devices as well which require this. Signed-off-by: Tanmay Upadhyay Signed-off-by: Dhaval Vasa --- board/Marvell/openrd_base/openrd_base.c | 4 ++++ board/Marvell/openrd_base/openrd_base.h | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/Marvell/openrd_base/openrd_base.c b/board/Marvell/openrd_base/openrd_base.c index c00a08a..b76047a 100644 --- a/board/Marvell/openrd_base/openrd_base.c +++ b/board/Marvell/openrd_base/openrd_base.c @@ -103,6 +103,10 @@ int board_init(void) kirkwood_mpp_conf(kwmpp_config); + /* PERST# should be asserted for at least 100 us */ + udelay(100); + writel(readl(KW_GPIO0_BASE) | (1<<7), KW_GPIO0_BASE); + /* * arch number of board */ diff --git a/board/Marvell/openrd_base/openrd_base.h b/board/Marvell/openrd_base/openrd_base.h index f3daf17..1655c12 100644 --- a/board/Marvell/openrd_base/openrd_base.h +++ b/board/Marvell/openrd_base/openrd_base.h @@ -30,10 +30,10 @@ #ifndef __OPENRD_BASE_H #define __OPENRD_BASE_H -#define OPENRD_OE_LOW (~(1<<28)) /* RS232 / RS485 */ -#define OPENRD_OE_HIGH (~(1<<2)) /* SD / UART1 */ -#define OPENRD_OE_VAL_LOW (0) /* Sel RS232 */ -#define OPENRD_OE_VAL_HIGH (1 << 2) /* Sel SD */ +#define OPENRD_OE_LOW (~((1<<28) | (1<<7))) /* RS232 / RS485, PCIe */ +#define OPENRD_OE_HIGH (~(1<<2)) /* SD / UART1 */ +#define OPENRD_OE_VAL_LOW 0 /* Sel RS232, PCIe reset */ +#define OPENRD_OE_VAL_HIGH (1 << 2) /* Sel SD */ /* PHY related */ #define MV88E1116_LED_FCTRL_REG 10