public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4][v2]include:configs:ls1021atwr: Enable USB IP support
Date: Mon, 27 Apr 2015 14:08:27 +0200	[thread overview]
Message-ID: <201504271408.27108.marex@denx.de> (raw)
In-Reply-To: <BL2PR03MB161703FC64708D7C80EB188E0E90@BL2PR03MB161.namprd03.prod.outlook.com>

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:
> > 
> > <type> 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

      reply	other threads:[~2015-04-27 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 17:03 [U-Boot] [PATCH 3/4][v2]include:configs:ls1021atwr: Enable USB IP support Ramneek Mehresh
2015-04-24  3:29 ` Marek Vasut
2015-04-27  5:44   ` Ramneek Mehresh
2015-04-27 12:08     ` Marek Vasut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201504271408.27108.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox