From: Wolfgang Denk Date: Mon, 25 Apr 2011 23:31:21 +0200 Subject: [U-Boot] [PATCH 02/11] IDE: Don't assume there are always two devices per bus In-Reply-To: <1300435500-4909-3-git-send-email-rogan@dawes.za.net> References: <4D81FE7F.8090002@dawes.za.net> <1300435500-4909-3-git-send-email-rogan@dawes.za.net> Message-ID: <20110425213121.C7ABED52702@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear rogan at dawes.za.net, In message <1300435500-4909-3-git-send-email-rogan@dawes.za.net> you 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)) I am still not convinced this is a correct approach. Can we not have mixed configurations, with 1 device on one controller (bus) and 2 devices on another controller (bus) ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Q: How many IBM CPU's does it take to execute a job? A: Four; three to hold it down, and one to rip its head off.