From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rogan Dawes Date: Thu, 26 Aug 2010 15:16:13 +0200 Subject: [U-Boot] [PATCH] IDE: Don't assume there are always two devices per bus In-Reply-To: <1281937660-25632-2-git-send-email-user@aphrodite> References: <20100815213046.A427B1606A5@gemini.denx.de> <1281937660-25632-2-git-send-email-user@aphrodite> Message-ID: <4C76691D.9070701@dawes.za.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2010/08/16 7:47 AM, Rogan Dawes wrote: > 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)]) > Anything wrong with this patch? Regards, Rogan