[BUG] mvebu pci auto config broken

Stefan Roese sr at denx.de
Thu Nov 26 17:30:40 CET 2020


Hi Ake,

On 25.11.20 11:47, Ake Rehnman wrote:
> Hello all,
> 
> it seems since the transition to DM for pci marvell mvebu does not work...
> 
> autoconfig tries to configure the memory controller but it seems to
> trash the configuration made by mvebu_pcie_probe().
> 
> Also pci enumeration command does not work.
> 
> Here are my patches:

Thanks for looking into this.

As already mentioned to you in a private mail, please send a proper
patch with a problem description and commit text and Signed-off-by
etc as explained here:

http://www.denx.de/wiki/view/U-Boot/Patches

Otherwise this patch can not be reviewed and after accepted pushed into
mainline U-Boot.

Thanks,
Stefan

> diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
> index 3f46b7697d..5724f9f707 100644
> --- a/drivers/pci/pci_auto.c
> +++ b/drivers/pci/pci_auto.c
> @@ -360,6 +360,12 @@ int dm_pciauto_config_device(struct udevice *dev)
> 
>    break;
> 
> +#if defined(CONFIG_ARCH_MVEBU)
> + case 0x0580:
> + debug("akre: PCI Autoconfig: Found Marvell memory controller. Doing
> nothing\n");
> + break;
> +#endif
> +
>   #if defined(CONFIG_PCIAUTO_SKIP_HOST_BRIDGE)
>    case PCI_CLASS_BRIDGE_OTHER:
>    debug("PCI Autoconfig: Skipping bridge device %d\n",
> diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c
> index c9afe75150..1ec3fd9bbe 100644
> --- a/drivers/pci/pci_mvebu.c
> +++ b/drivers/pci/pci_mvebu.c
> @@ -484,6 +484,8 @@ static int mvebu_pcie_bind(struct udevice *parent)
>    struct uclass_driver *drv;
>    struct udevice *dev;
>    ofnode subnode;
> + int ret;
> + int cnt=0;
> 
>    /* Lookup eth driver */
>    drv = lists_uclass_lookup(UCLASS_PCI);
> @@ -499,10 +501,18 @@ static int mvebu_pcie_bind(struct udevice *parent)
>    pcie = calloc(1, sizeof(*pcie));
>    if (!pcie)
>    return -ENOMEM;
> + strncpy(pcie->name,ofnode_get_name(subnode),sizeof(pcie->name));
> 
>    /* Create child device UCLASS_PCI and bind it */
> - device_bind_ofnode(parent, &pcie_mvebu_drv, pcie->name, pcie,
> + ret=device_bind_ofnode(parent, &pcie_mvebu_drv, pcie->name, pcie,
>       subnode, &dev);
> + if (ret)
> + {
> + debug("akre: device_bind_ofnode failed ret=%d\n",ret);
> + return ret;
> + }
> +
> + dev->req_seq = cnt++;
>    }
> 
>    return 0;
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list