From patchwork Tue Apr 17 19:06:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luka Perkov X-Patchwork-Id: 153291 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 9F5A6B7016 for ; Wed, 18 Apr 2012 05:07:02 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 86FAA280E7; Tue, 17 Apr 2012 21:06:59 +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 L3TX2ppgMUGu; Tue, 17 Apr 2012 21:06:59 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2AF3280A4; Tue, 17 Apr 2012 21:06:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E789280A4 for ; Tue, 17 Apr 2012 21:06:55 +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 WAZ1XufONXdm for ; Tue, 17 Apr 2012 21:06:51 +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-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id A09FE2809B for ; Tue, 17 Apr 2012 21:06:50 +0200 (CEST) Received: by werb10 with SMTP id b10so5414122wer.3 for ; Tue, 17 Apr 2012 12:06:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent:x-gm-message-state; bh=iRxTjJVj1EUVteWa3FKmVLTdqVCKsBFxJ2rUaxxcmY0=; b=DrXlDf2QOEOCcwAyjvK5IWaPJOruJ9GH5YeKY7tD6+Ik6dDPRfykJu4jSbMWxVzo5y JZfZGqfBOjSAFYZ8g/zHPRc3ibdqn9OUJY0uAU7lGmop1LIuSYbjH+A6g+gb0xDaqzI1 3FCh4rwVQifr+9TjdWAy6LOWW3lvNJRnNJEc7rAajV57K1bujsVt4O1NFavLSpV6VjRx 75pme8atMSdyQ5DGc3ozlo2P8cBqpelUEYMX3lW1t0dPFYV8Y8TSLw+ZTRdVW1rtVdLt 4rWmISChfIi+Jq1HlCu3UWtQr3bQn22Y8GQFc7sUC0ZQUjTd63MQa4QCULNPb+Tbv6mZ tdpA== Received: by 10.180.85.70 with SMTP id f6mr9961996wiz.5.1334689609676; Tue, 17 Apr 2012 12:06:49 -0700 (PDT) Received: from localhost (213-191-157-4.dhcp.iskon.hr. [213.191.157.4]) by mx.google.com with ESMTPS id ff2sm46228083wib.9.2012.04.17.12.06.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Apr 2012 12:06:48 -0700 (PDT) Date: Tue, 17 Apr 2012 21:06:49 +0200 From: Luka Perkov To: u-boot@lists.denx.de Message-ID: <20120417190649.GA22913@w500.iskon.local> Mail-Followup-To: u-boot@lists.denx.de, gmbnomis@gmail.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQmc45dJ+4ukfcq/hjIygWI2CbTJzDttRaz4HSv5KPTuwZa6kcqFs1C5XVhmiTbOvq/oCT+z Subject: [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 IDE_BUS assumes that each bus has two devices and thus returns the first bus even when the second one should be probed. 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 When this is commited I will do a coding style cleanup. There are tabs after few "#define" parts in include/ide.h. 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)])