Re: [U-Boot] [PATCH v3 025/108] x86: tpl: Add a fake PCI bus

2019-11-02 Thread Bin Meng
On Mon, Oct 28, 2019 at 3:12 PM Bin Meng  wrote:
>
> On Mon, Oct 21, 2019 at 11:40 AM Simon Glass  wrote:
> >
> > In TPL we try to minimise code size so do not include the PCI subsystem.
> > We can use fixed BARs and drivers can directly program the devices that
> > they need.
> >
> > However we do need to bind the devices on the PCI bus and without PCI this
> > does not ordinarily happen. As a work-around, define a fake PCI bus which
> > does this binding, but no other PCI operations. This is a convenient way
> > to ensure that we can use the same device tree for TPL, SPL and U-Boot
> > proper:
> >
> >TPL- CONFIG_TPL_PCI is not set (no auto-config, fake PCI bus)
> >SPL- CONFIG_SPL_PCI is set (no auto-config but with real PCI bus)
> >U-Boot - CONFIG_PCI is set (full auto-config after relocation)
> >
> > Signed-off-by: Simon Glass 
> > ---
> >
> > Changes in v3:
> > - Fix 'autoallocation' typo
> > - Improve wording in commit message
> >
> > Changes in v2: None
> >
> >  arch/x86/lib/tpl.c | 25 +
> >  1 file changed, 25 insertions(+)
> >
>
> Reviewed-by: Bin Meng 

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 025/108] x86: tpl: Add a fake PCI bus

2019-10-28 Thread Bin Meng
On Mon, Oct 21, 2019 at 11:40 AM Simon Glass  wrote:
>
> In TPL we try to minimise code size so do not include the PCI subsystem.
> We can use fixed BARs and drivers can directly program the devices that
> they need.
>
> However we do need to bind the devices on the PCI bus and without PCI this
> does not ordinarily happen. As a work-around, define a fake PCI bus which
> does this binding, but no other PCI operations. This is a convenient way
> to ensure that we can use the same device tree for TPL, SPL and U-Boot
> proper:
>
>TPL- CONFIG_TPL_PCI is not set (no auto-config, fake PCI bus)
>SPL- CONFIG_SPL_PCI is set (no auto-config but with real PCI bus)
>U-Boot - CONFIG_PCI is set (full auto-config after relocation)
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3:
> - Fix 'autoallocation' typo
> - Improve wording in commit message
>
> Changes in v2: None
>
>  arch/x86/lib/tpl.c | 25 +
>  1 file changed, 25 insertions(+)
>

Reviewed-by: Bin Meng 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 025/108] x86: tpl: Add a fake PCI bus

2019-10-22 Thread Simon Glass
Hi Andy,

On Tue, 22 Oct 2019 at 02:19, Andy Shevchenko  wrote:
>
> On Tue, Oct 22, 2019 at 1:54 AM Simon Glass  wrote:
> > On Mon, 21 Oct 2019 at 01:52, Andy Shevchenko  
> > wrote:
> > > On Mon, Oct 21, 2019 at 7:24 AM Simon Glass  wrote:
>
> > > PCI(e) bus is present in a lot of SoCs (not exclusively x86). Perhaps
> > > better idea is to have something like lib/pci.c with minimum support
> > > for PCI type 1 and probably PCI type 2 accessors and other very basic
> > > functions.
> >
> > I don't know of any use case for PCI in TPL on other platforms.
> >
> > x86 is I think unique in that it requires PCI to do anything.
>
> I don't think so. PCI is a core part of the SoC, indeed, though what
> exactly do we need from it here? IO accessors to PCI configuration
> space?

I mean that on other SoCs I am familiar with you can access
peripherals through memory-mapped I/O.

On x86 so far as I am aware you can't see any peripheral without doing
some PCI config.

Therefore PCI is 'more core' on x86 than others. For example on an
Nvidia chip I am familiar with, you can do everything except enable
the PCI network chip, which you wouldn't do in TPL.

>
> > For
> > other platforms I am familiar with they can boot a fair way without
> > it.
>
> Perhaps we may achieve the same here?
>
> > I do want to avoid the premature-optimisation problem, i.e. inventing
> > new use cases that no one uses. The only thing we really know right
> > now is that we need this for newer x86 platforms.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 025/108] x86: tpl: Add a fake PCI bus

2019-10-22 Thread Andy Shevchenko
On Tue, Oct 22, 2019 at 1:54 AM Simon Glass  wrote:
> On Mon, 21 Oct 2019 at 01:52, Andy Shevchenko  
> wrote:
> > On Mon, Oct 21, 2019 at 7:24 AM Simon Glass  wrote:

> > PCI(e) bus is present in a lot of SoCs (not exclusively x86). Perhaps
> > better idea is to have something like lib/pci.c with minimum support
> > for PCI type 1 and probably PCI type 2 accessors and other very basic
> > functions.
>
> I don't know of any use case for PCI in TPL on other platforms.
>
> x86 is I think unique in that it requires PCI to do anything.

I don't think so. PCI is a core part of the SoC, indeed, though what
exactly do we need from it here? IO accessors to PCI configuration
space?

> For
> other platforms I am familiar with they can boot a fair way without
> it.

Perhaps we may achieve the same here?

> I do want to avoid the premature-optimisation problem, i.e. inventing
> new use cases that no one uses. The only thing we really know right
> now is that we need this for newer x86 platforms.


-- 
With Best Regards,
Andy Shevchenko
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 025/108] x86: tpl: Add a fake PCI bus

2019-10-21 Thread Simon Glass
Hi Andy,

On Mon, 21 Oct 2019 at 01:52, Andy Shevchenko  wrote:
>
> On Mon, Oct 21, 2019 at 7:24 AM Simon Glass  wrote:
> >
> > In TPL we try to minimise code size so do not include the PCI subsystem.
> > We can use fixed BARs and drivers can directly program the devices that
> > they need.
> >
> > However we do need to bind the devices on the PCI bus and without PCI this
> > does not ordinarily happen. As a work-around, define a fake PCI bus which
> > does this binding, but no other PCI operations. This is a convenient way
> > to ensure that we can use the same device tree for TPL, SPL and U-Boot
> > proper:
> >
> >TPL- CONFIG_TPL_PCI is not set (no auto-config, fake PCI bus)
> >SPL- CONFIG_SPL_PCI is set (no auto-config but with real PCI bus)
> >U-Boot - CONFIG_PCI is set (full auto-config after relocation)
>
> PCI(e) bus is present in a lot of SoCs (not exclusively x86). Perhaps
> better idea is to have something like lib/pci.c with minimum support
> for PCI type 1 and probably PCI type 2 accessors and other very basic
> functions.

I don't know of any use case for PCI in TPL on other platforms.

x86 is I think unique in that it requires PCI to do anything. For
other platforms I am familiar with they can boot a fair way without
it.

I do want to avoid the premature-optimisation problem, i.e. inventing
new use cases that no one uses. The only thing we really know right
now is that we need this for newer x86 platforms.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 025/108] x86: tpl: Add a fake PCI bus

2019-10-21 Thread Andy Shevchenko
On Mon, Oct 21, 2019 at 7:24 AM Simon Glass  wrote:
>
> In TPL we try to minimise code size so do not include the PCI subsystem.
> We can use fixed BARs and drivers can directly program the devices that
> they need.
>
> However we do need to bind the devices on the PCI bus and without PCI this
> does not ordinarily happen. As a work-around, define a fake PCI bus which
> does this binding, but no other PCI operations. This is a convenient way
> to ensure that we can use the same device tree for TPL, SPL and U-Boot
> proper:
>
>TPL- CONFIG_TPL_PCI is not set (no auto-config, fake PCI bus)
>SPL- CONFIG_SPL_PCI is set (no auto-config but with real PCI bus)
>U-Boot - CONFIG_PCI is set (full auto-config after relocation)

PCI(e) bus is present in a lot of SoCs (not exclusively x86). Perhaps
better idea is to have something like lib/pci.c with minimum support
for PCI type 1 and probably PCI type 2 accessors and other very basic
functions.

-- 
With Best Regards,
Andy Shevchenko
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot