[PATCH v2 13/18] x86: apl: Drop support for !OF_PLATDATA_PARENT

Simon Glass sjg at chromium.org
Wed Dec 23 03:30:25 CET 2020


This code was kept around after of-platdata started supporting parent
devices. That feature seems stable now, so let's drop it.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2:
- Remove an old comment about this in pinctrl

 arch/x86/cpu/apollolake/Kconfig     |  1 +
 arch/x86/cpu/apollolake/spl.c       | 28 ----------------------------
 drivers/misc/p2sb-uclass.c          | 15 ---------------
 drivers/pinctrl/intel/pinctrl_apl.c |  2 --
 4 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/arch/x86/cpu/apollolake/Kconfig b/arch/x86/cpu/apollolake/Kconfig
index c6c1350f4f0..f5dbd6cbd34 100644
--- a/arch/x86/cpu/apollolake/Kconfig
+++ b/arch/x86/cpu/apollolake/Kconfig
@@ -19,6 +19,7 @@ config INTEL_APOLLOLAKE
 	select SMP_AP_WORK
 	select INTEL_GMA_SWSMISCI
 	select ACPI_GNVS_EXTERNAL
+	select TPL_OF_PLATDATA_PARENT
 	imply ENABLE_MRC_CACHE
 	imply AHCI_PCI
 	imply SCSI
diff --git a/arch/x86/cpu/apollolake/spl.c b/arch/x86/cpu/apollolake/spl.c
index 3a1588bbd8b..16a2f15c6bc 100644
--- a/arch/x86/cpu/apollolake/spl.c
+++ b/arch/x86/cpu/apollolake/spl.c
@@ -83,33 +83,6 @@ static int apl_flash_probe(struct udevice *dev)
 	return spi_flash_std_probe(dev);
 }
 
-/*
- * Manually set the parent of the SPI flash to SPI, since dtoc doesn't. We also
- * need to allocate the parent_plat since by the time this function is
- * called device_bind() has already gone past that step.
- */
-static int apl_flash_bind(struct udevice *dev)
-{
-	if (CONFIG_IS_ENABLED(OF_PLATDATA) &&
-	    !CONFIG_IS_ENABLED(OF_PLATDATA_PARENT)) {
-		struct dm_spi_slave_plat *plat;
-		struct udevice *spi;
-		int ret;
-
-		ret = uclass_first_device_err(UCLASS_SPI, &spi);
-		if (ret)
-			return ret;
-		dev->parent = spi;
-
-		plat = calloc(sizeof(*plat), 1);
-		if (!plat)
-			return -ENOMEM;
-		dev->parent_plat = plat;
-	}
-
-	return 0;
-}
-
 static const struct dm_spi_flash_ops apl_flash_ops = {
 	.read		= apl_flash_std_read,
 };
@@ -123,7 +96,6 @@ U_BOOT_DRIVER(winbond_w25q128fw) = {
 	.name		= "winbond_w25q128fw",
 	.id		= UCLASS_SPI_FLASH,
 	.of_match	= apl_flash_ids,
-	.bind		= apl_flash_bind,
 	.probe		= apl_flash_probe,
 	.priv_auto	= sizeof(struct spi_flash),
 	.ops		= &apl_flash_ops,
diff --git a/drivers/misc/p2sb-uclass.c b/drivers/misc/p2sb-uclass.c
index 8f9ec027a2e..ac2852559f5 100644
--- a/drivers/misc/p2sb-uclass.c
+++ b/drivers/misc/p2sb-uclass.c
@@ -168,26 +168,11 @@ int p2sb_get_port_id(struct udevice *dev)
 
 int p2sb_set_port_id(struct udevice *dev, int portid)
 {
-	struct udevice *ps2b;
 	struct p2sb_child_plat *pplat;
 
 	if (!CONFIG_IS_ENABLED(OF_PLATDATA))
 		return -ENOSYS;
 
-	if (!CONFIG_IS_ENABLED(OF_PLATDATA_PARENT)) {
-		uclass_find_first_device(UCLASS_P2SB, &ps2b);
-		if (!ps2b)
-			return -EDEADLK;
-		dev->parent = ps2b;
-
-		/*
-		 * We must allocate this, since when the device was bound it did
-		 * not have a parent.
-		 */
-		dev->parent_plat = malloc(sizeof(*pplat));
-		if (!dev->parent_plat)
-			return -ENOMEM;
-	}
 	pplat = dev_get_parent_plat(dev);
 	pplat->pid = portid;
 
diff --git a/drivers/pinctrl/intel/pinctrl_apl.c b/drivers/pinctrl/intel/pinctrl_apl.c
index 48b0e9a161b..2bb654c8a18 100644
--- a/drivers/pinctrl/intel/pinctrl_apl.c
+++ b/drivers/pinctrl/intel/pinctrl_apl.c
@@ -152,8 +152,6 @@ static int apl_pinctrl_of_to_plat(struct udevice *dev)
 	 * linker list (i.e. alphabetical order by driver name). So the GPIO
 	 * device may well be bound before its parent (p2sb), and this call
 	 * will fail if p2sb is not bound yet.
-	 *
-	 * TODO(sjg at chromium.org): Add a parent pointer to child devices in dtoc
 	 */
 	ret = p2sb_set_port_id(dev, plat->dtplat.intel_p2sb_port_id);
 	if (ret)
-- 
2.29.2.729.g45daf8777d-goog



More information about the U-Boot mailing list