From patchwork Tue Mar 22 20:49:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 600946 X-Patchwork-Delegate: hdegoede@redhat.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 3qV4Ys0M5gz9s4x for ; Wed, 23 Mar 2016 07:49:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33899A74E3; Tue, 22 Mar 2016 21:49:19 +0100 (CET) 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 0_T5UWwXJ31h; Tue, 22 Mar 2016 21:49:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 65E49A7498; Tue, 22 Mar 2016 21:49:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 707B9A7498 for ; Tue, 22 Mar 2016 21:49:14 +0100 (CET) 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 BvTtLwY5qS83 for ; Tue, 22 Mar 2016 21:49:14 +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 mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by theia.denx.de (Postfix) with ESMTPS id 18915A748A for ; Tue, 22 Mar 2016 21:49:11 +0100 (CET) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id B4711C00EB0C; Tue, 22 Mar 2016 20:49:09 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-4-163.ams2.redhat.com [10.36.4.163]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MKn6nw028491; Tue, 22 Mar 2016 16:49:07 -0400 From: Hans de Goede To: Ian Campbell Date: Tue, 22 Mar 2016 21:49:03 +0100 Message-Id: <1458679744-13831-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/2] sunxi: Turn satapwr on from board_init X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" There are 2 reasons for doing this: 1) The main reason for doing this is to move it outside of board/sunxi/ahci.c, so that it can be used on boards which use a usb<->sata chip too; 2) While doing this I realized that doing it from board_init also meant doing it much earlier. Some printf get_timer(0) calls show that the time between board_init() and scsi_init() is more then 600 ms, so we can drop the mdelay(500) While at it also drop the printf("SUNXI SCSI INIT\n") AHCI init is noisy enough by itself. Signed-off-by: Hans de Goede --- board/sunxi/ahci.c | 8 -------- board/sunxi/board.c | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/board/sunxi/ahci.c b/board/sunxi/ahci.c index 6d51b9b..522e54a 100644 --- a/board/sunxi/ahci.c +++ b/board/sunxi/ahci.c @@ -72,14 +72,6 @@ static int sunxi_ahci_phy_init(u32 base) void scsi_init(void) { - printf("SUNXI SCSI INIT\n"); -#ifdef CONFIG_SATAPWR - gpio_request(CONFIG_SATAPWR, "satapwr"); - gpio_direction_output(CONFIG_SATAPWR, 1); - /* Give attached sata device time to power-up to avoid link timeouts */ - mdelay(500); -#endif - if (sunxi_ahci_phy_init(SUNXI_SATA_BASE) < 0) return; diff --git a/board/sunxi/board.c b/board/sunxi/board.c index e16718f..2e2a1f5 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -90,6 +90,10 @@ int board_init(void) if (ret) return ret; +#ifdef CONFIG_SATAPWR + gpio_request(CONFIG_SATAPWR, "satapwr"); + gpio_direction_output(CONFIG_SATAPWR, 1); +#endif #ifdef CONFIG_MACPWR gpio_request(CONFIG_MACPWR, "macpwr"); gpio_direction_output(CONFIG_MACPWR, 1);