Skip to contentSkip to conversation

x86: fdt: Drop the unused compatible strings in fdtdec

PATCH New Simon Glass 3 participants 13 messages Jun 19, 2016 – Jul 3, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/5 x86: fdt: Drop the unused compatible strings in fdtdec

We have drivers for several more devices now, so drop the strings which are no-longer used.

---

Changes in v3:
- Rebase to master

 arch/x86/cpu/ivybridge/lpc.c | 6 ------
 include/fdtdec.h             | 5 -----
 lib/fdtdec.c                 | 5 -----
 3 files changed, 16 deletions(-)
arch/x86/cpu/ivybridge/lpc.c +0 -6
index ff1faa5..4e0be2a 100644
@@ -424,8 +424,6 @@ static void set_spi_speed(void)
 static int lpc_init_extra(struct udevice *dev)
 {
 	struct udevice *pch = dev->parent;
-	const void *blob = gd->fdt_blob;
-	int node;
 
 	debug("pch: lpc_init\n");
 	dm_pci_write_bar32(pch, 0, 0);
@@ -434,10 +432,6 @@ static int lpc_init_extra(struct udevice *dev)
 	dm_pci_write_bar32(pch, 3, 0x800);
 	dm_pci_write_bar32(pch, 4, 0x900);
 
-	node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_PCH);
-	if (node < 0)
-		return -ENOENT;
-
 	/* Set the value for PCI command register. */
 	dm_pci_write_config16(pch, PCI_COMMAND, 0x000f);
 
include/fdtdec.h +0 -5
index 54e3d81..ae30b8a 100644
@@ -153,14 +153,9 @@ enum fdt_compat_id {
 	COMPAT_SAMSUNG_EXYNOS5_I2C,	/* Exynos5 High Speed I2C Controller */
 	COMPAT_SAMSUNG_EXYNOS_SYSMMU,	/* Exynos sysmmu */
 	COMPAT_INTEL_MICROCODE,		/* Intel microcode update */
-	COMPAT_INTEL_PANTHERPOINT_AHCI,	/* Intel Pantherpoint AHCI */
-	COMPAT_INTEL_MODEL_206AX,	/* Intel Model 206AX CPU */
-	COMPAT_INTEL_GMA,		/* Intel Graphics Media Accelerator */
 	COMPAT_AMS_AS3722,		/* AMS AS3722 PMIC */
-	COMPAT_INTEL_ICH_SPI,		/* Intel ICH7/9 SPI controller */
 	COMPAT_INTEL_QRK_MRC,		/* Intel Quark MRC */
 	COMPAT_SOCIONEXT_XHCI,		/* Socionext UniPhier xHCI */
-	COMPAT_INTEL_PCH,		/* Intel PCH */
 	COMPAT_ALTERA_SOCFPGA_DWMAC,	/* SoCFPGA Ethernet controller */
 	COMPAT_ALTERA_SOCFPGA_DWMMC,	/* SoCFPGA DWMMC controller */
 	COMPAT_ALTERA_SOCFPGA_DWC2USB,	/* SoCFPGA DWC2 USB controller */
lib/fdtdec.c +0 -5
index 686b89d..2f54d71 100644
@@ -58,14 +58,9 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(SAMSUNG_EXYNOS5_I2C, "samsung,exynos5-hsi2c"),
 	COMPAT(SAMSUNG_EXYNOS_SYSMMU, "samsung,sysmmu-v3.3"),
 	COMPAT(INTEL_MICROCODE, "intel,microcode"),
-	COMPAT(INTEL_PANTHERPOINT_AHCI, "intel,pantherpoint-ahci"),
-	COMPAT(INTEL_MODEL_206AX, "intel,model-206ax"),
-	COMPAT(INTEL_GMA, "intel,gma"),
 	COMPAT(AMS_AS3722, "ams,as3722"),
-	COMPAT(INTEL_ICH_SPI, "intel,ich-spi"),
 	COMPAT(INTEL_QRK_MRC, "intel,quark-mrc"),
 	COMPAT(SOCIONEXT_XHCI, "socionext,uniphier-xhci"),
-	COMPAT(COMPAT_INTEL_PCH, "intel,bd82x6x"),
 	COMPAT(ALTERA_SOCFPGA_DWMAC, "altr,socfpga-stmmac"),
 	COMPAT(ALTERA_SOCFPGA_DWMMC, "altr,socfpga-dw-mshc"),
 	COMPAT(ALTERA_SOCFPGA_DWC2USB, "snps,dwc2"),
Signature · 1 line
2.8.0.rc3.226.g39d4020
#1 lore raw

PATCH v3 1/5 x86: fdt: Drop the unused compatible strings in fdtdec

Quoted 8 lines · Simon Glass

We have drivers for several more devices now, so drop the strings which are no-longer used.

---

Quoted 7 lines

Changes in v3:
- Rebase to master

 arch/x86/cpu/ivybridge/lpc.c | 6 ------
 include/fdtdec.h             | 5 -----
 lib/fdtdec.c                 | 5 -----
 3 files changed, 16 deletions(-)

Applied to u-boot-dm/next.

#2 lore raw

PATCH v3 2/5 fdt: Drop unused exynos compatible strings

In reply to Simon Glass

A few drivers have moved to driver model, so we can drop these strings.

---

Changes in v3:
- Add new patch to drop unused exynos compatible strings

 include/fdtdec.h | 3 ---
 lib/fdtdec.c     | 3 ---
 2 files changed, 6 deletions(-)
include/fdtdec.h +0 -3
index ae30b8a..8ce98a3 100644
@@ -141,12 +141,9 @@ enum fdt_compat_id {
 	COMPAT_SAMSUNG_EXYNOS_USB_PHY,	/* Exynos phy controller for usb2.0 */
 	COMPAT_SAMSUNG_EXYNOS5_USB3_PHY,/* Exynos phy controller for usb3.0 */
 	COMPAT_SAMSUNG_EXYNOS_TMU,	/* Exynos TMU */
-	COMPAT_SAMSUNG_EXYNOS_FIMD,	/* Exynos Display controller */
 	COMPAT_SAMSUNG_EXYNOS_MIPI_DSI,	/* Exynos mipi dsi */
-	COMPAT_SAMSUNG_EXYNOS5_DP,	/* Exynos Display port controller */
 	COMPAT_SAMSUNG_EXYNOS_DWMMC,	/* Exynos DWMMC controller */
 	COMPAT_SAMSUNG_EXYNOS_MMC,	/* Exynos MMC controller */
-	COMPAT_SAMSUNG_EXYNOS_SERIAL,	/* Exynos UART */
 	COMPAT_MAXIM_MAX77686_PMIC,	/* MAX77686 PMIC */
 	COMPAT_GENERIC_SPI_FLASH,	/* Generic SPI Flash chip */
 	COMPAT_MAXIM_98095_CODEC,	/* MAX98095 Codec */
lib/fdtdec.c +0 -3
index 2f54d71..59b75f0 100644
@@ -46,12 +46,9 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"),
 	COMPAT(SAMSUNG_EXYNOS5_USB3_PHY, "samsung,exynos5250-usb3-phy"),
 	COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
-	COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
 	COMPAT(SAMSUNG_EXYNOS_MIPI_DSI, "samsung,exynos-mipi-dsi"),
-	COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
 	COMPAT(SAMSUNG_EXYNOS_DWMMC, "samsung,exynos-dwmmc"),
 	COMPAT(SAMSUNG_EXYNOS_MMC, "samsung,exynos-mmc"),
-	COMPAT(SAMSUNG_EXYNOS_SERIAL, "samsung,exynos4210-uart"),
 	COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686"),
 	COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
 	COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),
Signature · 1 line
2.8.0.rc3.226.g39d4020
#3 lore raw

PATCH v3 2/5 fdt: Drop unused exynos compatible strings

Hi Simon,

Quoted 3 lines · Simon Glass

A few drivers have moved to driver model, so we can drop these strings.

CC'd Minkyu.

Best Regards,
Jaehoon Chung

Quoted 44 lines

---

Changes in v3:
- Add new patch to drop unused exynos compatible strings

 include/fdtdec.h | 3 ---
 lib/fdtdec.c     | 3 ---
 2 files changed, 6 deletions(-)
include/fdtdec.h +0 -3
index ae30b8a..8ce98a3 100644
@@ -141,12 +141,9 @@ enum fdt_compat_id {
 	COMPAT_SAMSUNG_EXYNOS_USB_PHY,	/* Exynos phy controller for usb2.0 */
 	COMPAT_SAMSUNG_EXYNOS5_USB3_PHY,/* Exynos phy controller for usb3.0 */
 	COMPAT_SAMSUNG_EXYNOS_TMU,	/* Exynos TMU */
-	COMPAT_SAMSUNG_EXYNOS_FIMD,	/* Exynos Display controller */
 	COMPAT_SAMSUNG_EXYNOS_MIPI_DSI,	/* Exynos mipi dsi */
-	COMPAT_SAMSUNG_EXYNOS5_DP,	/* Exynos Display port controller */
 	COMPAT_SAMSUNG_EXYNOS_DWMMC,	/* Exynos DWMMC controller */
 	COMPAT_SAMSUNG_EXYNOS_MMC,	/* Exynos MMC controller */
-	COMPAT_SAMSUNG_EXYNOS_SERIAL,	/* Exynos UART */
 	COMPAT_MAXIM_MAX77686_PMIC,	/* MAX77686 PMIC */
 	COMPAT_GENERIC_SPI_FLASH,	/* Generic SPI Flash chip */
 	COMPAT_MAXIM_98095_CODEC,	/* MAX98095 Codec */
lib/fdtdec.c +0 -3
index 2f54d71..59b75f0 100644
@@ -46,12 +46,9 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"),
 	COMPAT(SAMSUNG_EXYNOS5_USB3_PHY, "samsung,exynos5250-usb3-phy"),
 	COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
-	COMPAT(SAMSUNG_EXYNOS_FIMD, "samsung,exynos-fimd"),
 	COMPAT(SAMSUNG_EXYNOS_MIPI_DSI, "samsung,exynos-mipi-dsi"),
-	COMPAT(SAMSUNG_EXYNOS5_DP, "samsung,exynos5-dp"),
 	COMPAT(SAMSUNG_EXYNOS_DWMMC, "samsung,exynos-dwmmc"),
 	COMPAT(SAMSUNG_EXYNOS_MMC, "samsung,exynos-mmc"),
-	COMPAT(SAMSUNG_EXYNOS_SERIAL, "samsung,exynos4210-uart"),
 	COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686"),
 	COMPAT(GENERIC_SPI_FLASH, "spi-flash"),
 	COMPAT(MAXIM_98095_CODEC, "maxim,max98095-codec"),
#4 lore raw

PATCH v3 2/5 fdt: Drop unused exynos compatible strings

Quoted 5 lines · Jaehoon Chung

Hi Simon,

Quoted 2 lines · Simon Glass

A few drivers have moved to driver model, so we can drop these strings.

Quoted 8 lines
Quoted 1 line

CC'd Minkyu.

Best Regards,
Jaehoon Chung

Applied to u-boot-dm/next.

#5 lore raw

PATCH v3 3/5 fdt: Add a note to avoid adding new compatible strings

In reply to Simon Glass

The list is shrinking and we should avoid adding new things. Instead, a proper driver should be created with driver model.

---

Changes in v3:
- Add new patch to request people avoid adding new compatible strings

 lib/fdtdec.c | 5 +++++
 1 file changed, 5 insertions(+)
lib/fdtdec.c +5 -0
index 59b75f0..668acca 100644
@@ -19,6 +19,11 @@ DECLARE_GLOBAL_DATA_PTR;
  * Here are the type we know about. One day we might allow drivers to
  * register. For now we just put them here. The COMPAT macro allows us to
  * turn this into a sparse list later, and keeps the ID with the name.
+ *
+ * NOTE: This list is basically a TODO list for things that need to be
+ * converted to driver model. So don't add new things here unless there is a
+ * good reason why driver-model conversion is infeasible. Examples include
+ * things which are used before driver model is available.
  */
 #define COMPAT(id, name) name
 static const char * const compat_names[COMPAT_COUNT] = {
Signature · 1 line
2.8.0.rc3.226.g39d4020
#6 lore raw

PATCH v3 3/5 fdt: Add a note to avoid adding new compatible strings

Quoted 12 lines · Simon Glass

The list is shrinking and we should avoid adding new things. Instead, a proper driver should be created with driver model.

---

Changes in v3:
- Add new patch to request people avoid adding new compatible strings

 lib/fdtdec.c | 5 +++++
 1 file changed, 5 insertions(+)
#7 lore raw

PATCH v3 3/5 fdt: Add a note to avoid adding new compatible strings

Quoted 7 lines · Bin Meng
Quoted 6 lines · Simon Glass

The list is shrinking and we should avoid adding new things. Instead, a proper driver should be created with driver model.

---

Quoted 8 lines
Quoted 6 lines

Changes in v3:
- Add new patch to request people avoid adding new compatible strings

 lib/fdtdec.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied to u-boot-dm/next.

#8 lore raw

PATCH v3 4/5 fdt: x86: Tidy up a few COMPAT string definitions

In reply to Simon Glass

The 'COMPAT_' part should appear only once so drop the duplicate part. It is ignored anyway, but let's keep things consistent.

---

Changes in v3:
- Add new patch to tidy up a few COMPAT string definitions

 lib/fdtdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/fdtdec.c +3 -3
index 668acca..b79be59 100644
@@ -66,9 +66,9 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(ALTERA_SOCFPGA_DWMAC, "altr,socfpga-stmmac"),
 	COMPAT(ALTERA_SOCFPGA_DWMMC, "altr,socfpga-dw-mshc"),
 	COMPAT(ALTERA_SOCFPGA_DWC2USB, "snps,dwc2"),
-	COMPAT(COMPAT_INTEL_BAYTRAIL_FSP, "intel,baytrail-fsp"),
-	COMPAT(COMPAT_INTEL_BAYTRAIL_FSP_MDP, "intel,baytrail-fsp-mdp"),
-	COMPAT(COMPAT_INTEL_IVYBRIDGE_FSP, "intel,ivybridge-fsp"),
+	COMPAT(INTEL_BAYTRAIL_FSP, "intel,baytrail-fsp"),
+	COMPAT(INTEL_BAYTRAIL_FSP_MDP, "intel,baytrail-fsp-mdp"),
+	COMPAT(INTEL_IVYBRIDGE_FSP, "intel,ivybridge-fsp"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
Signature · 1 line
2.8.0.rc3.226.g39d4020
#9 lore raw

PATCH v3 4/5 fdt: x86: Tidy up a few COMPAT string definitions

Quoted 12 lines · Simon Glass

The 'COMPAT_' part should appear only once so drop the duplicate part. It is ignored anyway, but let's keep things consistent.

---

Changes in v3:
- Add new patch to tidy up a few COMPAT string definitions

 lib/fdtdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
#10 lore raw

PATCH v3 4/5 fdt: x86: Tidy up a few COMPAT string definitions

Quoted 7 lines · Bin Meng
Quoted 6 lines · Simon Glass

The 'COMPAT_' part should appear only once so drop the duplicate part. It is ignored anyway, but let's keep things consistent.

---

Quoted 8 lines
Quoted 6 lines

Changes in v3:
- Add new patch to tidy up a few COMPAT string definitions

 lib/fdtdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-dm/next.

#11 lore raw

PATCH v3 5/5 sandbox: Find keyboard driver using driver model

In reply to Simon Glass

The cros-ec keyboard is always a child of the cros-ec node. Rather than searching the device tree, looking at the children. Remove the compat string which is now unused.

---

Changes in v3:
- Add new patch to find keyboard driver using driver model

 drivers/misc/cros_ec_sandbox.c | 11 ++++++++++-
 include/fdtdec.h               |  1 -
 lib/fdtdec.c                   |  1 -
 3 files changed, 10 insertions(+), 3 deletions(-)
drivers/misc/cros_ec_sandbox.c +10 -1
index 98f19a6..c4fbca0 100644
@@ -517,6 +517,7 @@ int cros_ec_probe(struct udevice *dev)
 	struct ec_state *ec = dev->priv;
 	struct cros_ec_dev *cdev = dev->uclass_priv;
 	const void *blob = gd->fdt_blob;
+	struct udevice *keyb_dev;
 	int node;
 	int err;
 
@@ -525,7 +526,15 @@ int cros_ec_probe(struct udevice *dev)
 	if (err)
 		return err;
 
-	node = fdtdec_next_compatible(blob, 0, COMPAT_GOOGLE_CROS_EC_KEYB);
+	node = -1;
+	for (device_find_first_child(dev, &keyb_dev);
+	     keyb_dev;
+	     device_find_next_child(&keyb_dev)) {
+		if (device_get_uclass_id(keyb_dev) == UCLASS_KEYBOARD) {
+			node = keyb_dev->of_offset;
+			break;
+		}
+	}
 	if (node < 0) {
 		debug("%s: No cros_ec keyboard found\n", __func__);
 	} else if (keyscan_read_fdt_matrix(ec, blob, node)) {
include/fdtdec.h +0 -1
index 8ce98a3..1be87cd 100644
@@ -137,7 +137,6 @@ enum fdt_compat_id {
 	COMPAT_SAMSUNG_S3C2440_I2C,	/* Exynos I2C Controller */
 	COMPAT_SAMSUNG_EXYNOS5_SOUND,	/* Exynos Sound */
 	COMPAT_WOLFSON_WM8994_CODEC,	/* Wolfson WM8994 Sound Codec */
-	COMPAT_GOOGLE_CROS_EC_KEYB,	/* Google CROS_EC Keyboard */
 	COMPAT_SAMSUNG_EXYNOS_USB_PHY,	/* Exynos phy controller for usb2.0 */
 	COMPAT_SAMSUNG_EXYNOS5_USB3_PHY,/* Exynos phy controller for usb3.0 */
 	COMPAT_SAMSUNG_EXYNOS_TMU,	/* Exynos TMU */
lib/fdtdec.c +0 -1
index b79be59..eb2d508 100644
@@ -47,7 +47,6 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(SAMSUNG_S3C2440_I2C, "samsung,s3c2440-i2c"),
 	COMPAT(SAMSUNG_EXYNOS5_SOUND, "samsung,exynos-sound"),
 	COMPAT(WOLFSON_WM8994_CODEC, "wolfson,wm8994-codec"),
-	COMPAT(GOOGLE_CROS_EC_KEYB, "google,cros-ec-keyb"),
 	COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"),
 	COMPAT(SAMSUNG_EXYNOS5_USB3_PHY, "samsung,exynos5250-usb3-phy"),
 	COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
Signature · 1 line
2.8.0.rc3.226.g39d4020
#12 lore raw

PATCH v3 5/5 sandbox: Find keyboard driver using driver model

Quoted 7 lines · Simon Glass

The cros-ec keyboard is always a child of the cros-ec node. Rather than searching the device tree, looking at the children. Remove the compat string which is now unused.

---

Quoted 7 lines

Changes in v3:
- Add new patch to find keyboard driver using driver model

 drivers/misc/cros_ec_sandbox.c | 11 ++++++++++-
 include/fdtdec.h               |  1 -
 lib/fdtdec.c                   |  1 -
 3 files changed, 10 insertions(+), 3 deletions(-)

Applied to u-boot-dm/next.