From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 27 Apr 2015 14:08:27 +0200 Subject: [U-Boot] [PATCH 3/4][v2]include:configs:ls1021atwr: Enable USB IP support In-Reply-To: References: <1429808594-22900-1-git-send-email-ramneek.mehresh@freescale.com> <201504240529.41232.marex@denx.de> Message-ID: <201504271408.27108.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 On Monday, April 27, 2015 at 07:44:15 AM, Ramneek Mehresh wrote: [...] > > > diff --git a/include/linux/usb/xhci-fsl.h > > > b/include/linux/usb/xhci-fsl.h index 8eaab2c..329abf7 100644 > > > --- a/include/linux/usb/xhci-fsl.h > > > +++ b/include/linux/usb/xhci-fsl.h > > > @@ -46,6 +46,11 @@ > > > > > > #define USBOTGSS_IRQ_SET_1_OEVT_EN BIT(16) > > > #define USBOTGSS_IRQ_SET_1_DMADISABLECLR_EN BIT(17) > > > > > > +#ifdef CONFIG_LS102XA > > > +#define CONFIG_SYS_FSL_XHCI_USB1_ADDR > > > +CONFIG_SYS_LS102XA_XHCI_USB1_ADDR #define > > > +CONFIG_SYS_FSL_XHCI_USB2_ADDR 0 > > > > Do you need to define this _bogus_ address at all? If so, then the driver > > which depends on this is broken. Why can't you just define a list of > > addresses instead ? You would be able to use ARRAY_SIZE() in the driver > > to determine how many controllers there are then. This is how it would > > look like: > > > > #define CONFIG_FOO_BAR_ADDRS { USB1_ADDR, USB2_ADDR, ..., > > USBn_ADDR } > > > > In the driver, there'd be: > > > > addrs[] = CONFIG_FOO_BAR_ADDRS; > > I agree to use an array for defining list of controller addresses. However, > the no. of controller(s) to be initialized on a particular platform is > determined by CONFIG_USB_MAX_CONTROLLER_COUNT used in usb_init() function. > This macro is defined in each platform file, and defines the index > argument passed on to xhci_hcd_init(). There may be some platform on which > we can have more than one controller in soc, but only one is used (exposed > via external connector). Hence, CONFIG_USB_MAX_CONTROLLER_COUNT is > defined by platform header file. Ah right, sorry. Keep the CONFIG_USB_MAX_CONTROLLER_COUNT macro then. > Hence, I can assign controller address on the basis of address: > struct fsl_xhci *ctx = &fsl_xhci; > ctx->hcd = addrs[index]; Yeah Best regards, Marek Vasut