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: Wed, 15 Aug 2018 11:20:09 +0200	[thread overview]
Message-ID: <096bd8c9-65e3-89c0-2a08-4c91db8ca5c2@gmail.com> (raw)
In-Reply-To: <CAEUhbmVvdmtpmQE2XN0zmP85Er2nQuqMYteC-BbAYevpbyqxDQ@mail.gmail.com>

On 08/14/2018 11:35 AM, Bin Meng wrote:
[...]

>>>>>> I think knowing where Linux does this
>>>>>> would be instructive to figure out where we need to have some additional
>>>>>> logic added OR we can make some cost/benefit analysis to see if it makes
>>>>>> more sense overall to add compatibles to some nodes rather than add to
>>>>>> the binary size.
>>>>>
>>>>> Adding compatible does not make any sense, the PCI ID provides that
>>>>> information. Adding compatible would only add redundancy which could
>>>>> possibly be even harmful (ie. if the controller got replaced with
>>>>> another one).
>>>>
>>>> To try and move things along rather than re-argue the same point, you're
>>>> saying that our pci_find_and_bind_driver() is the rough equivalent of
>>>> of_pci_find_child_device() or at least pci_set_of_node() (which calls
>>>> of_pci_find_child_device()).
>>>>
>>>> So, Bin, if this isn't the right place to start down this path, where
>>>> would be?  Given that Linux can take a DTB and PCI bus with devices and
>>>> get things right, what would it look like for U-Boot to replicate the
>>>> same behavior?  Instead of having to add explicit compatible nodes for
>>>> each PCI device, as I understand (but correct me if I'm wrong) we're
>>>> doing today.  Thanks!
>>>
>>> So is this a requirement for all U-Boot driver subsystems to replicate
>>> the same Linux behavior? If yes, can we have it officially documented
>>> somewhere?
>>
>> No, because we are not replicating Linux behavior.
>>
> 
> But you kept mentioning you wanted U-Boot to use exactly the same DT
> from Linux. And I pointed out that FreeBSD's DT files are not the same
> as Linux. Here you are saying you don't want U-Boot to replicate Linux
> behavior, if not the Linux behavior, what do you want to suggest then?

Just parse the information out of the DT fully and be done with it.
That is what I suggest.

>>> Since Marek refused to take the original U-Boot option 1 to support
>>> his case, and asked U-Boot to follow Linux's practice on PCI device
>>> binding, if we go that way, here is what we can do:
>>
>> You are inserting words into my mouth and I dislike that. I never said
>> anything about Linux. I said DT is OS agnostic and U-Boot should be able
>> to parse DT as fully as possible.
> 
> See above comment. I might have used some words that made you feel
> uncomfortable, and for me I felt the same way. Part of the reason is
> that I am not a native English speaker and I may mis-use/interpret
> words. If that's the case I apologize. Anyway I won't quarrel against
> this over and over again. This does not help to move things forward.

This is a technical discussion, we should use arguments, not feelings.
I am fine, but thanks for your concern.

>>> * Keep pci-uclass driver's post_bind() and child_post_bind() only for
>>> Sandbox configuration
>>> * Keep the call to pci_bus_find_devfn() in pci_bind_bus_devices() only
>>> for Sandbox configuration
>>> * Sandbox is special. We should limit the mechanism of matching PCI
>>> emulation device via "compatible" to sandbox only
>>
>> I don't think this is limited to sandbox, although I don't see a
>> real-world usecase right now.
>>
> 
> You are welcome to send patches against sandbox PCI codes to remove
> such limitation, to make it behave like a real-world bus device.
> 
>>> * Assign the DT node to the bound device in pci_find_and_bind_driver()
>>> if there is a valid PCI "reg" encoding for a specific PCI device in
>>> the device tree
>>> * Create DM PCI test case against the DT node assignment
>>> * Remove all compatible string in U-Boot's PCI device drivers: eg:
>>> ehci_pci_ids[], xhci_pci_ids[], etc. IOW, all PCI device drivers
>>> should only use U_BOOT_PCI_DEVICE(), aka the original U-Boot option 2
>>> * Fork a "pci-ns16550" driver to support U_BOOT_PCI_DEVICE(), as
>>> currently PCI ns16550 device driver uses "compatible" string to do the
>>> matching, and update crownbay.dts and galileo.dts (so far I only know
>>> two boards are using PCI ns16550 serial port)
>>
>> I cannot test such changes, but I believe there is
>> PCI_CLASS_COMMUNICATION_SERIAL and matching on that would suffice ?
>>
> 
> Maybe, but I need check the datasheet to confirm. This can be a good
> start though. Note I can test the changes, and I can do the whole
> bunch of such proposed design changes if you don't mind, but let's
> wait for Simon's comments.

All those sandbox changes can be done in parallel to this change though,
right ?

>>> * Make sure all DM PCI test cases are not broken
>>> * Document all of the above changes in doc/driver-model/pci-info.txt
>>>
>>> I am not sure if I missed anything. Simon, could you also comment on it?
> 
> Regards,
> Bin
> 


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2018-08-15  9:20 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 [this message]
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
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=096bd8c9-65e3-89c0-2a08-4c91db8ca5c2@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.