[BUG] mvebu pci auto config broken

Ake Rehnman ake.rehnman at gmail.com
Wed Nov 25 11:47:19 CET 2020


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:

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;


More information about the U-Boot mailing list