Dear Sascha Silbe, In message <1372195668-25496-3-git-send-email-t-ub...@infra-silbe.de> you wrote: > From: Sascha Silbe <sascha-...@silbe.org> > > Marvell 88AP510 (Armada 510, dove) has two separate USB > controllers. Use the index parameter that already gets passed in to > calculate the base address of the controller. ... > -#define rdl(off) readl(MVUSB0_BASE + (off)) > -#define wrl(off, val) writel((val), MVUSB0_BASE + (off)) > +#define rdl(base, off) readl((base) + (off)) > +#define wrl(base, off, val) writel((val), (base) + (off))
Instead of extending this, can we eventually clean this up and use C structs instead? U-Boot does not allow device accesses through a based plus offset notation. > u32 size, base, attrib; > +#ifdef MVUSB1_BASE > + u32 usb_base = (index == 0) ? MVUSB0_BASE : MVUSB1_BASE; > +#else > + u32 usb_base = MVUSB0_BASE; > +#endif Can we please also avoid this #ifdef's ? Eventually you can use something like "base_0 + index * sizeof(struct usb_something)" ? 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: w...@denx.de Syntactic sugar causes cancer of the semicolon. - Epigrams in Programming, ACM SIGPLAN Sept. 1982 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot