From patchwork Fri Mar 18 08:09:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 87501 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 2D639B6FDE for ; Fri, 18 Mar 2011 19:14:29 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8A038281E4; Fri, 18 Mar 2011 09:14:19 +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 8Vu0wa-XhTYd; Fri, 18 Mar 2011 09:14:19 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0972D28202; Fri, 18 Mar 2011 09:14:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0668A2820C for ; Fri, 18 Mar 2011 09:14:13 +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 WBakifwjYva7 for ; Fri, 18 Mar 2011 09:14:12 +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-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by theia.denx.de (Postfix) with ESMTPS id 0F79F281EF for ; Fri, 18 Mar 2011 09:14:03 +0100 (CET) Received: by iyi12 with SMTP id 12so3490009iyi.3 for ; Fri, 18 Mar 2011 01:14:01 -0700 (PDT) Received: by 10.42.219.65 with SMTP id ht1mr1244953icb.14.1300436041851; Fri, 18 Mar 2011 01:14:01 -0700 (PDT) Received: from localhost.localdomain (196-215-42-15.dynamic.isadsl.co.za [196.215.42.15]) by mx.google.com with ESMTPS id uf10sm1721078icb.17.2011.03.18.01.13.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 01:14:01 -0700 (PDT) From: rogan@dawes.za.net To: u-boot@lists.denx.de Date: Fri, 18 Mar 2011 10:09:58 +0200 Message-Id: <1300435803-4940-3-git-send-email-rogan@dawes.za.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4D81FE7F.8090002@dawes.za.net> References: <4D81FE7F.8090002@dawes.za.net> Subject: [U-Boot] [PATCH 2/7] IDE: Don't assume there are always two devices per bus 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 From: Rogan Dawes Some SATA controllers can operate in an IDE compatible mode (e.g. mvsata) but will only ever have a single device per bus. This allows the upcoming DNS323 port to properly identify and use a drive on both SATA interfaces. --- include/ide.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/ide.h b/include/ide.h index 6a1b7ae..c812b28 100644 --- a/include/ide.h +++ b/include/ide.h @@ -24,7 +24,8 @@ #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) - 1)) #define ATA_CURR_BASE(dev) (CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])