Dear Wolfgang Denk, Wolfgang Denk <w...@denx.de> writes:
>> -#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. Thanks for the review. I've given the clean-up a stab today, as a separate patch that the CuBox support series can build on. >> 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)" ? The two USB host controllers on Dove are separate entities at different base offsets (0x50000 vs. 0x51000). We could fill up the register struct to have a size of 0x1000, but then the next SoC to be supported could come up with a different offset. Sascha _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot