[U-Boot] [PATCH] fix IDE_BUS(dev) macro

Albert ARIBAUD
2012-10-07T09:28:31Z

Hi uboot at lukaperkov.net,

On Sun, 7 Oct 2012 09:15:52 +0200, uboot at lukaperkov.net wrote:

> Hi Tom, Albert, Prafulla and others,
>
> On Tue, Apr 17, 2012 at 09:06:49PM +0200, Luka Perkov wrote:
> > 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 <gmbnomis@gmail.com>
> > Tested-by: Luka Perkov <uboot@lukaperkov.net>
> > ---
> >
> > 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)])
> >
>
> I have assigned this patch to Tom in patchwork here:
>
> http://patchwork.ozlabs.org/patch/159129/
>
> From when it was submitted we have got confirmations that this patch
> does the job for kirkwood boards on the u-boot mailing list:
>
> http://lists.denx.de/pipermail/u-boot/2012-April/122684.html
> http://lists.denx.de/pipermail/u-boot/2012-June/125658.html
>
> It would be nice if this patch would enter v2012.10 release. At least
> someone could pull it into his repo so it can find it's way into master
> eventually.

As discussed on IRC, there are tests that actually cover the plaforms I
should have tested myself, so I personally think this can go in 2012.10.

> Regards,
> Luka

Amicalement,
--
Albert.