+#ifdef CONFIG_SYS_DPAA_FMAN
+static void fdt_fixup_liodn_tbl_fman(void *blob,
+ struct fman_liodn_id_table *tbl,
+ int sz)
+{
+ int i;
+
+ for (i = 0; i < sz; i++) {
+ int off;
+
+ if (tbl[i].compat == NULL)
+ continue;
+
+ /* Try the new compatible first.
+ * If the node is missing, try the old.
+ */
+ off = fdt_node_offset_by_compat_reg(blob,
+ tbl[i].compat[0], tbl[i].compat_offset);
+ if (off < 0)
+ off = fdt_node_offset_by_compat_reg(blob,
+ tbl[i].compat[1], tbl[i].compat_offset);
+
+ if (off >= 0) {
+ off = fdt_setprop(blob, off, "fsl,liodn",
+ &tbl[i].id[0],
+ sizeof(u32) * tbl[i].num_ids);
+ if (off > 0)
+ printf("WARNING unable to set fsl,liodn for FMan Port: %s\n",
+ fdt_strerror(off));
+ } else {
+ debug("WARNING: could not set fsl,liodn for FMan Portport: %s.\n",
+ fdt_strerror(off));
+ }
+ }
+}
+#endif
+