From patchwork Mon May 14 19:29:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luka Perkov X-Patchwork-Id: 159129 X-Patchwork-Delegate: trini@ti.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 1CEB9B7032 for ; Tue, 15 May 2012 05:29:35 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 30B2D2807F; Mon, 14 May 2012 21:29:32 +0200 (CEST) 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 sUZNeSs8lviS; Mon, 14 May 2012 21:29:31 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B745C28080; Mon, 14 May 2012 21:29:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 88B7B28080 for ; Mon, 14 May 2012 21:29:25 +0200 (CEST) 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 eL-tAaB5rLlR for ; Mon, 14 May 2012 21:29:19 +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 mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by theia.denx.de (Postfix) with ESMTPS id 1FCFB2807F for ; Mon, 14 May 2012 21:29:16 +0200 (CEST) Received: by wibhj6 with SMTP id hj6so2530748wib.9 for ; Mon, 14 May 2012 12:29:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent:x-gm-message-state; bh=H9lKBDvoTsncFmNUB4pFzme9MtePB49V6pXcLRMwYH4=; b=IZVDQjSGBCgWS6p2dEkWcr5nQrIfEbTvNYgRSYmCjPNJrpYsvTSPxPZlPK+IGDrebY gxI6bqUo26YGastXqeZB3JRy6pmJ83R/qTHmNUZAUnugWPomtREYSTYdnp72cOnwRfYu QkOhlDc5bhmmZMM5Rp0OVuvIeSom6Y7d0WkV4zJBDP6ufajBOlgjJaeZZc2qFE9xOoFi RgVc7R5DivTLvv91ELPM3ZRq4dC2lNuF7PL0DMAY5r3JLP0DvcyU31+JMmxYOkDEchTn 5Hwx68Dz6L2EpC0mL71y5DFhF9kUDo/B09h2GoY1OhqrxqhCLoO1gv7/HwbMjkiPm2os l6uA== Received: by 10.180.86.5 with SMTP id l5mr22880121wiz.6.1337023755373; Mon, 14 May 2012 12:29:15 -0700 (PDT) Received: from localhost ([213.191.150.244]) by mx.google.com with ESMTPS id gd4sm57891265wib.6.2012.05.14.12.29.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 May 2012 12:29:13 -0700 (PDT) Date: Mon, 14 May 2012 21:29:10 +0200 From: Luka Perkov To: Albert ARIBAUD , David Purdy , u-boot@lists.denx.de, gmbnomis@gmail.com, dreagle@doukki.net Message-ID: <20120514192910.GA23116@w500.iskon.local> Mail-Followup-To: Albert ARIBAUD , David Purdy , u-boot@lists.denx.de, gmbnomis@gmail.com, dreagle@doukki.net References: <20120417190649.GA22913@w500.iskon.local> <4F8FB2DB.5090502@aribaud.net> <20120429201941.GA6293@w500.iskon.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120429201941.GA6293@w500.iskon.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQmVi3/6C/fKYV91etiPBVHjR+vJyJdkCK5n9JRWrqymuUDU2gukljn8estVKYHgyElGbmQX Subject: Re: [U-Boot] [PATCH] fix IDE_BUS(dev) macro 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 Hi Albert, On Sun, Apr 29, 2012 at 10:19:41PM +0200, Luka Perkov wrote: > On Thu, Apr 19, 2012 at 08:38:19AM +0200, Albert ARIBAUD wrote: > > Not my main area of expertise here, but I am not sure how this plays > > on Marvell non-kirkwood platforms (e.g., orion5x). > > > > ISTR it is not the first time we deal with the whole IDE number of > > bus / number of ports [ / useable ports ] issue, and we may be > > running in circles here, fixing one platform and breaking another. > > > > I'll try this on EDMiniV2 in the coming days, and let people know > > the results in this thread. > > I was just wondering did you have the time to test this patch on your > board? Albert, did you maybe have time to test this patch. I have included it bellow so you dont have to search for it... Signed-off-by: Simon Baatz Tested-by: Luka Perkov --- Simon discovered this while adding support for new board IB NAS6210. More info can be found here: http://lists.denx.de/pipermail/u-boot/2012-April/122525.html include/ide.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ide.h b/include/ide.h index 8ecc9dd..385e909 100644 --- a/include/ide.h +++ b/include/ide.h @@ -24,7 +24,7 @@ #ifndef _IDE_H #define _IDE_H -#define IDE_BUS(dev) (dev >> 1) +#define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS)) #define ATA_CURR_BASE(dev) (CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])