[U-Boot] [PATCH 2/8] dm: pci: Only allow serial device to be bound before relocation

Simon Glass sjg at chromium.org
Tue Aug 18 04:00:16 CEST 2015


Hi Bin,

On 15 August 2015 at 01:07, Bin Meng <bmeng.cn at gmail.com> wrote:
> To further limit the memory space, we only allow serial device
> to be bound before relocation.
>
> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> ---
>
>  drivers/pci/pci-uclass.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
> index 4160274..b7dca0f 100644
> --- a/drivers/pci/pci-uclass.c
> +++ b/drivers/pci/pci-uclass.c
> @@ -487,9 +487,13 @@ static int pci_find_and_bind_driver(struct udevice *parent,
>                          * whose driver has the DM_FLAG_PRE_RELOC set, to save
>                          * precious memory space as on some platforms as that
>                          * space is pretty limited (ie: using Cache As RAM).
> +                        *
> +                        * To further limit the memory space, we only allow
> +                        * serial device to be bound.
>                          */
>                         if (!(gd->flags & GD_FLG_RELOC) &&
> -                           !(drv->flags & DM_FLAG_PRE_RELOC))
> +                           !(drv->flags & DM_FLAG_PRE_RELOC) &&
> +                           (drv->id != UCLASS_SERIAL))
>                                 return 0;
>
>                         /*
> --
> 1.8.2.1
>

This seems to go too far. We may have other drivers that need to do
pre-reloc init. Why not just rely on DM_FLAG_PRE_RELOC?

Regards,
Simon


More information about the U-Boot mailing list