All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] pci: Support parsing PCI controller DT subnodes
Date: Thu, 23 Aug 2018 09:42:13 +0200	[thread overview]
Message-ID: <36c1bbd9-4230-f46c-c77f-a683a74afe2d@gmail.com> (raw)
In-Reply-To: <CAEUhbmXQ4NySzRDzhH++Wuc1d1gdrvV8V02+7U1WwLMyc953jw@mail.gmail.com>

On 08/23/2018 04:11 AM, Bin Meng wrote:
> Hi Marek,

Hello Bin,

> On Wed, Aug 22, 2018 at 5:57 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
>> On 08/22/2018 04:14 AM, Bin Meng wrote:
>> [...]
>>>>>> I said in the previous discussion I am willing to update the
>>>>>> documentation to match the implementation, but that's about it.
>>>>>>
>>>>>>> So far almost all PCI device drivers in U-Boot supports both
>>>>>>> scenarios, except PCI UART which currently only supports scenario#1.
>>>>>>> If you declare what you do in this patch is pureblood then you should
>>>>>>> revoke the other 2 at the same time. Leaving such in the mainstream
>>>>>>> only creates chaos in the future and we should avoid doing that, given
>>>>>>> we already had lots of discussion here.
>>>>>>
>>>>>> No. The compatible is valid for some PCI subdevs, ie. bridges, so that
>>>>>> has to stay. You also need compatible for sandbox, you said that
>>>>>> yourself. And declaring a PCI device with BFD in DT is needed, ie. for
>>>>>> the r8a7794-style bindings.
>>>>>>
>>>>>
>>>>> OK, now new comments :) So you admit "compatible" can be valid for
>>>>> some cases.
>>>>
>>>> _some_ select ones, and that is a _very_ important distinction.
>>>>
>>>>> I have to point out that your theory on PCI device probing
>>>>> is self-contradictory.You refuse to add a "compatible" string to your
>>>>> PCI device because you said the vendor/device id/class provides enough
>>>>> information to bind the driver, then why do you want to specify your
>>>>> devices in the device tree in the first place.
>>>>
>>>> Because of the USB PHY , which is attached to that device and can not be
>>>> probed on the PCI bus, unlike the device itself ?
>>>>
>>>
>>> You can create a new EHCI PCI driver to match your USB EHCI
>>> controller's vendor id/device id, and do any additional PHY setup in
>>> that driver. BTW what's the vendor id and device id of the EHCI
>>> controller on your board? I can have a look up at the PCI database.
>>
>> You can not.
>>
>> 1033:00e0 -- https://pci-ids.ucw.cz/read/PC/1033/00e0
>>
>> You can buy that controller as a discrete chip on a PCI card or have one
>> in an SoC on a PCI bus, I have both.
> 
> Hardware vendors like to create such fantastic stuff in their SoCs,
> sigh. So how about subvendor and subdevice id? The embedded one can't
> be the same as the the discrete one. If they are really all the same,
> then why can't we add a specific compatible string to describe such
> device? The compatible idea was invented to describe devices that
> cannot be discovered via some probeable ways.

I cannot if you look at the r8a7794 PHY phandles in the DT. The PHY
connects to two devices and this is well modeled in DT.

>>>>> According to your
>>>>> theory, "Each PCI device already has a PCI ID and class which is used
>>>>> to identify it and based on which the drivers bind to it, so a DT
>>>>> compatible is NOT needed and is actually redundant and harmful.", I
>>>>> would argue why not just creating a dedicate PCI device driver using
>>>>> PCI ID and class information to do the driver binding and start from
>>>>> there.
>>>>
>>>> Because the same device with the same PCI ID can be used without that PHY .
>>>>
>>>>> As you mentioned PCI bus is probable bus like USB, everything
>>>>> can be self-contained in the PCI device driver itself. There is no
>>>>> need to create nothing in the device tree. If you want an example,
>>>>> check 8250_pci.c in the Linux kernel. Everything that is needed to
>>>>> configure the driver is included in the driver itself. It does not
>>>>> read anything from the device tree.
>>>>
>>>> Well, see above for why this approach doesn't work.
>>>
>>> Please explain why it does not work. I see Intel e1000 driver in the
>>> Linux kernel has lots of PHY configuration within the driver. It does
>>> not use any external PHY (eg: Marvell 88exxx) driver that Linux
>>> already has. The Ethernet PHY are not probeable on the PCI bus too.
>>
>> That's a different thing, the ethernet MACs have an internal MDIO
>> interface and you can scan the MDIO bus and read out PHY registers 0/1
>> to get the PHY ID.
>>
> 
> Yes, I know. But my point is that Linux drivers are not always
> consistent. There is diversity and Linux is fine with that. There is
> also diversity when it comes to U-Boot PCI support and we have 2
> supported PCI scenarios, the 1st of which can satisfy your use case.
> 
>> This does not apply to this particular usecase here. In this case, the
>> controller can be either embedded or discrete, with PHY or without PHY.
>>
> 
> Does the embedded one have no register that can identify the PHY presence?

No, why would it ? They are two completely separate blocks .

[...]

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2018-08-23  7:42 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 13:03 [U-Boot] [PATCH] pci: Support parsing PCI controller DT subnodes Marek Vasut
2018-08-08 13:14 ` Bin Meng
2018-08-08 13:24   ` Marek Vasut
2018-08-08 13:39     ` Bin Meng
2018-08-08 14:33       ` Marek Vasut
2018-08-08 15:32         ` Bin Meng
2018-08-08 19:37           ` Marek Vasut
2018-08-08 23:24             ` Bin Meng
2018-08-09  0:36               ` Marek Vasut
2018-08-09  2:37                 ` Bin Meng
2018-08-09  7:54                   ` Marek Vasut
2018-08-09  9:41                     ` Bin Meng
2018-08-09 10:25                       ` Marek Vasut
2018-08-10  3:42                         ` Bin Meng
2018-08-10 10:32                           ` Marek Vasut
2018-08-13  2:07                             ` Bin Meng
2018-08-13 13:39                               ` Tom Rini
2018-08-13 16:07                                 ` Marek Vasut
2018-08-13 17:16                                   ` Tom Rini
2018-08-14  2:34                                     ` Bin Meng
2018-08-14  8:54                                       ` Marek Vasut
2018-08-14  9:35                                         ` Bin Meng
2018-08-15  9:20                                           ` Marek Vasut
2018-08-14 19:39                                       ` Tom Rini
2018-08-13 13:43                               ` Marek Vasut
2018-08-10 12:01             ` Tom Rini
2018-08-10 12:38               ` Marek Vasut
2018-08-13  2:24                 ` Bin Meng
2018-08-13 13:46                   ` Marek Vasut
2018-08-14  1:46                     ` Bin Meng
2018-08-14  8:55                       ` Marek Vasut
2018-08-14  9:40                         ` Bin Meng
2018-08-15  9:22                           ` Marek Vasut
2018-08-15 10:19                             ` Bin Meng
2018-08-15 10:27                               ` Marek Vasut
2018-08-15 11:25                               ` Tom Rini
2018-08-16 11:47                                 ` Marek Vasut
2018-08-17  1:51                                   ` Bin Meng
2018-08-17 10:27                                     ` Marek Vasut
2018-08-20  7:18                                       ` Bin Meng
2018-08-20  8:09                                         ` Marek Vasut
2018-08-20 16:57                                     ` Simon Glass
2018-08-20 18:42                                       ` Marek Vasut
2018-08-20 19:29                                         ` Simon Glass
2018-08-20 20:15                                           ` Marek Vasut
2018-08-22 18:08                                             ` Simon Glass
2018-08-22 20:19                                               ` Marek Vasut
2018-08-23 10:45                                                 ` Simon Glass
2018-08-23 12:58                                                   ` Marek Vasut
2018-08-30  0:29                                                     ` Simon Glass
2018-08-30  9:25                                                       ` Marek Vasut
2018-09-01 21:45                                                         ` Simon Glass
2018-09-01 22:43                                                           ` Marek Vasut
2018-09-02  1:07                                                             ` Simon Glass
2018-09-02 18:24                                                               ` Marek Vasut
2018-09-02 23:35                                                                 ` Simon Glass
2018-09-03  0:53                                                                   ` Marek Vasut
2018-08-21  3:46                                           ` Bin Meng
2018-08-21  4:02                                             ` Marek Vasut
2018-08-21  4:15                                               ` Bin Meng
2018-08-21  4:30                                                 ` Marek Vasut
2018-08-21  4:56                                                   ` Bin Meng
2018-08-21  5:43                                                     ` Marek Vasut
2018-08-21  7:16                                                       ` Bin Meng
2018-08-21 10:28                                                         ` Marek Vasut
2018-08-22  2:14                                                           ` Bin Meng
2018-08-22  9:57                                                             ` Marek Vasut
2018-08-23  2:11                                                               ` Bin Meng
2018-08-23  7:42                                                                 ` Marek Vasut [this message]
2018-08-21 17:32                                             ` Simon Glass
2018-08-21 18:26                                               ` Marek Vasut
2018-08-21 18:29                                                 ` Simon Glass
2018-08-21 18:56                                                   ` Marek Vasut

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=36c1bbd9-4230-f46c-c77f-a683a74afe2d@gmail.com \
    --to=marek.vasut@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.