mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping
@ 2026-02-25 15:28 Ahmad Fatoum
  2026-02-25 15:28 ` [PATCH master 2/2] ARM: Layerscape: icid: fixup ICID also for new fsl,ls1028a-dwc3 compat Ahmad Fatoum
  2026-02-26 12:01 ` [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2026-02-25 15:28 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Newer kernel device trees no longer have the snps,dwc3 compatible we
match against, but instead have fsl,ls1028a-dwc3.

This is also the case for the DT embedded into barebox, so have barebox
match against the new compatible. Compatibility for the old compatible
is not needed as this code only runs against the barebox live tree.

Fixes: ea73c9d2c24e ("Revert "ARM64: dts: Layerscape: workaround v6.19-rc1 DT sync DWC3 breakage"")
Fixes: a3bf6c16f77d ("dts: update to v6.19-rc1")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-layerscape/soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-layerscape/soc.c b/arch/arm/mach-layerscape/soc.c
index 87702a066988..5b1936860eb0 100644
--- a/arch/arm/mach-layerscape/soc.c
+++ b/arch/arm/mach-layerscape/soc.c
@@ -130,7 +130,7 @@ static void layerscape_usb_enable_snooping(void)
 {
 	struct device_node *np;
 
-	for_each_compatible_node(np, NULL, "snps,dwc3") {
+	for_each_compatible_node(np, NULL, "fsl,ls1028a-dwc3") {
 		struct resource res;
 
 		if (of_address_to_resource(np, 0, &res))
-- 
2.47.3




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH master 2/2] ARM: Layerscape: icid: fixup ICID also for new fsl,ls1028a-dwc3 compat
  2026-02-25 15:28 [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping Ahmad Fatoum
@ 2026-02-25 15:28 ` Ahmad Fatoum
  2026-02-26 12:01 ` [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2026-02-25 15:28 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Newer kernel device trees no longer have the snps,dwc3 compatible we
match against, but instead have fsl,ls1028a-dwc3.

Adapt the code to match against both as we don't know beforehand what
flavor the kernel device tree will have.

Fixes: ea73c9d2c24e ("Revert "ARM64: dts: Layerscape: workaround v6.19-rc1 DT sync DWC3 breakage"")
Fixes: a3bf6c16f77d ("dts: update to v6.19-rc1")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-layerscape/icid.c | 47 +++++++++++++++++++++------------
 1 file changed, 30 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-layerscape/icid.c b/arch/arm/mach-layerscape/icid.c
index ebe3896075b7..2cdeaa3a8bca 100644
--- a/arch/arm/mach-layerscape/icid.c
+++ b/arch/arm/mach-layerscape/icid.c
@@ -63,6 +63,7 @@
 
 struct icid_id_table {
 	const char *compat;
+	const char *alt_compat;
 	u32 id;
 	u32 reg;
 	phys_addr_t compat_addr;
@@ -93,6 +94,27 @@ static phandle of_get_iommu_handle(struct device_node *root)
 	return of_node_create_phandle(iommu);
 }
 
+static bool of_fixup_icid_node(struct device_node *root, phandle iommu_handle,
+			       const struct icid_id_table *icid,
+			       const char *compat)
+{
+	struct device_node *np;
+
+	for_each_compatible_node_from(np, root, NULL, compat) {
+		struct resource res;
+
+		if (of_address_to_resource(np, 0, &res))
+			continue;
+
+		if (res.start == icid->compat_addr) {
+			of_set_iommu_prop(np, iommu_handle, icid->id);
+			return true;
+		}
+	}
+
+	return false;
+}
+
 static int of_fixup_icid(struct device_node *root, phandle iommu_handle,
 			 const struct icid_id_table *icid_table, int num_icid)
 {
@@ -100,22 +122,13 @@ static int of_fixup_icid(struct device_node *root, phandle iommu_handle,
 
 	for (i = 0; i < num_icid; i++) {
 		const struct icid_id_table *icid = &icid_table[i];
-		struct device_node *np;
 
 		if (!icid->compat)
 			continue;
 
-		for_each_compatible_node_from(np, root, NULL, icid->compat) {
-			struct resource res;
-
-			if (of_address_to_resource(np, 0, &res))
-				continue;
-
-			if (res.start == icid->compat_addr) {
-				of_set_iommu_prop(np, iommu_handle, icid->id);
-				break;
-			}
-		}
+		if (!of_fixup_icid_node(root, iommu_handle, icid, icid->compat)
+		    && icid->alt_compat)
+			of_fixup_icid_node(root, iommu_handle, icid, icid->alt_compat);
 	}
 
 	return 0;
@@ -168,19 +181,19 @@ static const struct icid_id_table icid_tbl_ls1046a[] = {
 		.compat_addr = LSCH2_ESDHC_ADDR,
 		.reg_addr = offsetof(struct ccsr_scfg, sdhc_icid) + LSCH2_SCFG_ADDR,
 	}, {
-		.compat = "snps,dwc3",
+		.compat = "fsl,ls1028a-dwc3", .alt_compat = "snps,dwc3",
 		.id = FSL_USB1_STREAM_ID,
 		.reg = (((FSL_USB1_STREAM_ID) << 24) | (1 << 23)),
 		.compat_addr = LSCH2_XHCI_USB1_ADDR,
 		.reg_addr = offsetof(struct ccsr_scfg, usb1_icid) + LSCH2_SCFG_ADDR,
 	}, {
-		.compat = "snps,dwc3",
+		.compat = "fsl,ls1028a-dwc3", .alt_compat = "snps,dwc3",
 		.id = FSL_USB2_STREAM_ID,
 		.reg = (((FSL_USB2_STREAM_ID) << 24) | (1 << 23)),
 		.compat_addr = LSCH2_XHCI_USB2_ADDR,
 		.reg_addr = offsetof(struct ccsr_scfg, usb2_icid) + LSCH2_SCFG_ADDR,
 	}, {
-		.compat = "snps,dwc3",
+		.compat = "fsl,ls1028a-dwc3", .alt_compat = "snps,dwc3",
 		.id = FSL_USB3_STREAM_ID,
 		.reg = (((FSL_USB3_STREAM_ID) << 24) | (1 << 23)),
 		.compat_addr = LSCH2_XHCI_USB3_ADDR,
@@ -584,13 +597,13 @@ void ls1046a_setup_icids(void)
 
 static const struct icid_id_table icid_tbl_ls1028a[] = {
 	{
-		.compat = "snps,dwc3",
+		.compat = "fsl,ls1028a-dwc3", .alt_compat = "snps,dwc3",
 		.id = 1,
 		.reg = 1,
 		.compat_addr = LSCH3_XHCI_USB1_ADDR,
 		.reg_addr = offsetof(struct lsch3_ccsr_gur, usb1_amqr) + LSCH3_GUTS_ADDR,
 	}, {
-		.compat = "snps,dwc3",
+		.compat = "fsl,ls1028a-dwc3", .alt_compat = "snps,dwc3",
 		.id = 2,
 		.reg = 2,
 		.compat_addr = LSCH3_XHCI_USB2_ADDR,
-- 
2.47.3




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping
  2026-02-25 15:28 [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping Ahmad Fatoum
  2026-02-25 15:28 ` [PATCH master 2/2] ARM: Layerscape: icid: fixup ICID also for new fsl,ls1028a-dwc3 compat Ahmad Fatoum
@ 2026-02-26 12:01 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2026-02-26 12:01 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 25 Feb 2026 16:28:29 +0100, Ahmad Fatoum wrote:
> Newer kernel device trees no longer have the snps,dwc3 compatible we
> match against, but instead have fsl,ls1028a-dwc3.
> 
> This is also the case for the DT embedded into barebox, so have barebox
> match against the new compatible. Compatibility for the old compatible
> is not needed as this code only runs against the barebox live tree.
> 
> [...]

Applied, thanks!

[1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping
      https://git.pengutronix.de/cgit/barebox/commit/?id=50946afccfd1 (link may not be stable)
[2/2] ARM: Layerscape: icid: fixup ICID also for new fsl,ls1028a-dwc3 compat
      https://git.pengutronix.de/cgit/barebox/commit/?id=4c99998aa6c3 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-26 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-25 15:28 [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping Ahmad Fatoum
2026-02-25 15:28 ` [PATCH master 2/2] ARM: Layerscape: icid: fixup ICID also for new fsl,ls1028a-dwc3 compat Ahmad Fatoum
2026-02-26 12:01 ` [PATCH master 1/2] ARM: Layerscape: LS1046: re-enable USB bus snooping Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox