From: Stephen Warren <swarren@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 10/14] tegra: usb: Add support for USB peripheral
Date: Wed, 07 Dec 2011 16:46:13 -0700 [thread overview]
Message-ID: <4EDFFAC5.5070002@nvidia.com> (raw)
In-Reply-To: <CAPnjgZ1G+mv6uv8SrdMm7DoqFjeeyVHYv6nbQxn9qixfbQMGvA@mail.gmail.com>
On 12/06/2011 02:23 PM, Simon Glass wrote:
> Hi Stephen,
>
> On Tue, Dec 6, 2011 at 12:42 PM, Stephen Warren <swarren@nvidia.com> wrote:
>> On 12/05/2011 06:14 PM, Simon Glass wrote:
>>> Hi Stephen,
>>>
>>> On Mon, Dec 5, 2011 at 4:17 PM, Stephen Warren <swarren@nvidia.com> wrote:
>>>> On 12/05/2011 04:35 PM, Simon Glass wrote:
...
>>>>> Also the only way I can see it being hard-coded is by the kernel
>>>>> looking at the peripheral address and converting this to an ID. That
>>>>> seems really ugly to me. Or am I missing something?
>>>>
>>>> Well, the Tegra SD/MMC driver works exactly that way (well, mapping an
>>>> instance ID to both base address and periph ID), so there's certainly
>>>> precedent for this. And that driver is not unique.
>>>
>>> I don't know if I can NAK a comment but I would like to NAK this one.
>>
>> I don't know what that means; that you believe my statement is
>> incorrect, or you don't like the argument I'm basing on it or ...?
>
> What happens is that the SD/MMC driver (dating from pre-FDT days) has
> a hard-coded base address and peripheral ID, based on an instance ID
> (0, 1, 2).
That's basically the exact same thing, it's just the exact fields that
are the key into and output from the table are different.
> I would expect that we want the FDT to control all of this - it
> already has the base address, can have the peripheral ID, and the
> instance ID (ordering) should be set by the FDT not hard-coded IMO.
> That's the reason for my NAK comment. It just seems completely wrong
> to duplicate this information in the driver and require the instance
> ordering to be hard-coded in the driver. It means that boards that
> want to change this ordering must fiddle around in the driver to make
> this work.
>
> Also this is U-Boot, not the kernel. Commands like 'ext2load' require
> that you pass the instance ID to indicate which device to use.
SD/MMC is a very different use-case, and not a good analogy to USB.
With SD, the user always wants to identify a specific device that they
know contains their files.
With USB, the user doesn't care that there are multiple USB host
controllers in the SoC; they just want to plug in their device somewhere
and have it work. Having to decide which USB controller to enable at a
time is pretty hokey, given there's unlikely to be any indication at all
on the PCB or case which ports map to which USB controllers.
What the user might care about is selecting a enumerated particular USB
device. They'd only know which one after looking at some "lsusb" command
(or whatever it's called in U-Boot) in the general case.
Hence, I assert that USB host controller number is completely
irrelevant, and all should be active at once.
This of course is all somewhat moot given that I pointed out
ehci-tegra.c only supports one of the hosts anyway...
> OK, so is your objection that we ignore a peripheral that has no
> alias?
Yes.
And that enumeration is based on alias nodes not enumerating all nodes
that match the compatible flag.
> If I change the code to locate these and add them at the end
> would that be better?
Sure.
I think the best implementation would be to enumerate everything solely
based on compatible flags, and allowing "usb start" to accept either an
alias name (which would be fixed) or a DT unit address or node name
(which would be fixed) or a controller index (which might vary based on
enumeration order) to select the controller.
The next best implementation would be to enumerate solely based on
compatible flags, then sort the list based on alias, thus allowing alias
to cause a static order.
However, enumerating based on alias, then enumerating based on
compatible flags and adding any missing nodes would be fine.
>> As I mentioned elsewhere, the patches only allow one to actually use usb
>> controller 0; ehci-tegra.c's ehci_hcd_init() hard-codes port 0 when
>> calling tegrausb_start_port(). Rather than relying on non-standard
>> aliases usage to restrict the set of USB devices that get instantiated,
>> why not just add status = "disabled" to all but one USB host's node in
>> each board's .dts file; that's the standard way to disable devices.
>
> I can do that, but how do I solve the ordering problem?
If you only have one enabled controller in the .dts file, there can't be
any ordering issue since there is always only 1 controller.
--
nvpublic
next prev parent reply other threads:[~2011-12-07 23:46 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 3:54 [U-Boot] [PATCH 01/14] fdt: Tidy up a few fdtdec problems Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 02/14] fdt: Add functions to access phandles, arrays and bools Simon Glass
2011-11-28 18:41 ` Stephen Warren
2011-11-29 5:12 ` David Gibson
2011-12-02 1:01 ` Simon Glass
2011-12-02 15:55 ` Stephen Warren
2011-12-02 16:38 ` Simon Glass
2011-12-02 3:33 ` Jerry Van Baren
2011-12-02 4:58 ` Simon Glass
2011-12-02 17:22 ` Jerry Van Baren
2011-12-02 18:12 ` Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 03/14] arm: fdt: Ensure that an embedded fdt is word-aligned Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 04/14] arm: fdt: Add skeleton device tree file Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 05/14] tegra: fdt: Add Tegra2x " Simon Glass
2011-11-28 18:56 ` Stephen Warren
2011-12-02 1:24 ` Simon Glass
2011-12-02 15:58 ` Stephen Warren
2011-12-02 16:47 ` Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 06/14] tegra: fdt: Add device tree file for Tegra2 Seaboard Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 07/14] tegra: fdt: Add initial device tree definitions for USB ports Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 08/14] tegra: usb: Add USB definitions for Tegra2 Seaboard Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 09/14] tegra: usb: Add support for data alignment and txfifo threshold Simon Glass
2011-11-28 19:05 ` Stephen Warren
2011-12-02 1:42 ` Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 10/14] tegra: usb: Add support for USB peripheral Simon Glass
2011-11-28 19:21 ` Stephen Warren
2011-12-02 1:51 ` Simon Glass
2011-12-02 16:10 ` Stephen Warren
2011-12-02 17:00 ` Simon Glass
2011-12-02 20:40 ` Stephen Warren
2011-12-02 23:07 ` Simon Glass
2011-12-03 0:59 ` Simon Glass
2011-12-05 21:33 ` Stephen Warren
2011-12-05 21:46 ` Simon Glass
2011-12-05 22:15 ` Stephen Warren
2011-12-05 23:35 ` Simon Glass
2011-12-06 0:17 ` Stephen Warren
2011-12-06 1:14 ` Simon Glass
2011-12-06 20:42 ` Stephen Warren
2011-12-06 21:23 ` Simon Glass
2011-12-07 23:46 ` Stephen Warren [this message]
2011-12-08 21:24 ` Simon Glass
2011-12-12 18:18 ` Stephen Warren
2011-12-12 18:42 ` Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 11/14] tegra: usb: Add USB support to nvidia boards Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 12/14] tegra: usb: Add common USB defines for tegra2 boards Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 13/14] tegra: usb: Enable USB on Seaboard Simon Glass
2011-11-24 3:54 ` [U-Boot] [PATCH 14/14] tegra: fdt: Enable FDT support for Seaboard Simon Glass
2011-11-28 18:33 ` [U-Boot] [PATCH 01/14] fdt: Tidy up a few fdtdec problems Stephen Warren
2011-11-29 1:10 ` David Gibson
2011-12-01 20:59 ` Simon Glass
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=4EDFFAC5.5070002@nvidia.com \
--to=swarren@nvidia.com \
--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