
Dear Sascha Silbe,
In message 1372195668-25496-3-git-send-email-t-uboot@infra-silbe.de you wrote:
From: Sascha Silbe sascha-pgp@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