All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [U-boot] use of CONFIG_SYS_EARLY_PCI_INIT with DM PCI
@ 2017-04-25 23:25 Suneel Garapati
  2017-04-27 11:29 ` Suneel Garapati
  0 siblings, 1 reply; 3+ messages in thread
From: Suneel Garapati @ 2017-04-25 23:25 UTC (permalink / raw)
  To: u-boot

Hi Simon,

Request your inputs on below query -

Boards I work on have most of the devices on PCI bus, driver model
support enabled, would like to use CONFIG_SYS_EARLY_PCI_INIT to call
pci_init but the below snippet would hinder.

 #ifdef CONFIG_PCI
 static int initr_pci(void)
 {
-#ifndef CONFIG_DM_PCI
        pci_init();
-#endif
....

Is this change valid or should create another config item for driver
model based early pci init?

Regards,
Suneel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [U-boot] use of CONFIG_SYS_EARLY_PCI_INIT with DM PCI
  2017-04-25 23:25 [U-Boot] [U-boot] use of CONFIG_SYS_EARLY_PCI_INIT with DM PCI Suneel Garapati
@ 2017-04-27 11:29 ` Suneel Garapati
  2017-05-02 11:27   ` Simon Glass
  0 siblings, 1 reply; 3+ messages in thread
From: Suneel Garapati @ 2017-04-27 11:29 UTC (permalink / raw)
  To: u-boot

Hi Tom/Simon,

Request to help on below query.

Regards,
Suneel
On Tue, Apr 25, 2017 at 16:25 Suneel Garapati <suneelglinux@gmail.com>
wrote:

> Hi Simon,
>
> Request your inputs on below query -
>
> Boards I work on have most of the devices on PCI bus, driver model
> support enabled, would like to use CONFIG_SYS_EARLY_PCI_INIT to call
> pci_init but the below snippet would hinder.
>
>  #ifdef CONFIG_PCI
>  static int initr_pci(void)
>  {
> -#ifndef CONFIG_DM_PCI
>         pci_init();
> -#endif
> ....
>
> Is this change valid or should create another config item for driver
> model based early pci init?
>
> Regards,
> Suneel
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [U-boot] use of CONFIG_SYS_EARLY_PCI_INIT with DM PCI
  2017-04-27 11:29 ` Suneel Garapati
@ 2017-05-02 11:27   ` Simon Glass
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Glass @ 2017-05-02 11:27 UTC (permalink / raw)
  To: u-boot

Hi Suneel,

On 27 April 2017 at 05:29, Suneel Garapati <suneelglinux@gmail.com> wrote:
> Hi Tom/Simon,
>
> Request to help on below query.
>
> Regards,
> Suneel
>
> On Tue, Apr 25, 2017 at 16:25 Suneel Garapati <suneelglinux@gmail.com>
> wrote:
>>
>> Hi Simon,
>>
>> Request your inputs on below query -
>>
>> Boards I work on have most of the devices on PCI bus, driver model
>> support enabled, would like to use CONFIG_SYS_EARLY_PCI_INIT to call
>> pci_init but the below snippet would hinder.
>>
>>  #ifdef CONFIG_PCI
>>  static int initr_pci(void)
>>  {
>> -#ifndef CONFIG_DM_PCI
>>         pci_init();
>> -#endif
>> ....
>>
>> Is this change valid or should create another config item for driver
>> model based early pci init?

Here are my ideas:

1. Create a new DM_FLAG_OF_AUTO_INIT flag to dm/device.h which can be
used in a uclass, i.e.:

UCLASS_DRIVER(pci_generic) = {
   .id = UCLASS_PCI_GENERIC,
   .name = "pci_generic",
   .flags = DM_FLAG_OF_AUTO_INIT,
};

2. Update dm_init_and_scan() to add a new call to dm_auto_init() at
the end of it

3. Implement dm_auto_init() to scan all the uclasses (see
uclass_find() for an example) and for any that have the flag set,
probe all their devices

That way, PCI will be auto-probed on machines which have it.

Later we could come up with a way to allow boards to turn this on/off,
but for now, maybe just always doing it is good enough.

Regards,
Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-02 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 23:25 [U-Boot] [U-boot] use of CONFIG_SYS_EARLY_PCI_INIT with DM PCI Suneel Garapati
2017-04-27 11:29 ` Suneel Garapati
2017-05-02 11:27   ` Simon Glass

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.