From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 30 Jun 2013 00:26:42 +0200 Subject: [U-Boot] [PATCH v5 2/8] usb: ehci-marvell: add support for second USB controller In-Reply-To: <1372458871-11683-1-git-send-email-t-uboot@infra-silbe.de> References: <20130626140403.1434738047D@gemini.denx.de> <1372458871-11683-1-git-send-email-t-uboot@infra-silbe.de> Message-ID: <201306300026.42365.marex@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 Sascha Silbe, > Dear Wolfgang Denk, > > Wolfgang Denk 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. Check drivers/usb/host/ehci-mxs.c for handling of such a case ;-) Best regards, Marek Vasut