Index: linux/drivers/soc/fsl/qbman/qman_ccsr.c
===================================================================
--- linux/drivers/soc/fsl/qbman/qman_ccsr.c	(revision a7d252c645c59e877fe468e4c3e33dde47381d7c)
+++ linux/drivers/soc/fsl/qbman/qman_ccsr.c	(revision 0f6ff4a923384618e979e106051b36c2db126791)
@@ -50,4 +50,5 @@
 EXPORT_SYMBOL(qm_channel_caam);
 
+#ifdef CONFIG_FSL_QMAN_CONFIG
 /* Register offsets */
 #define REG_QCSP_LIO_CFG(n)	(0x0000 + ((n) * 0x10))
@@ -284,7 +285,9 @@
 /* Pointer to the start of the QMan's CCSR space */
 static u32 __iomem *qm_ccsr_start;
+#endif /* CONFIG_FSL_QMAN_CONFIG */
 /* A SDQCR mask comprising all the available/visible pool channels */
 static u32 qm_pools_sdqcr;
 
+#ifdef CONFIG_FSL_QMAN_CONFIG
 static inline u32 qm_ccsr_in(u32 offset)
 {
@@ -296,4 +299,5 @@
 	iowrite32be(val, qm_ccsr_start + offset/4);
 }
+#endif /* CONFIG_FSL_QMAN_CONFIG */
 
 u32 qm_get_pools_sdqcr(void)
@@ -302,4 +306,5 @@
 }
 
+#ifdef CONFIG_FSL_QMAN_CONFIG
 enum qm_dc_portal {
 	qm_dc_portal_fman0 = 0,
@@ -662,4 +667,18 @@
 	}
 }
+#else /* !CONFIG_FSL_QMAN_CONFIG */
+static unsigned int qm_get_fqid_maxcnt(void)
+{
+	return 1U << 16;
+}
+
+void qman_liodn_fixup(u16 channel)
+{
+}
+
+void qman_set_sdest(u16 channel, unsigned int cpu_idx)
+{
+}
+#endif /* CONFIG_FSL_QMAN_CONFIG */
 
 static int qman_resource_init(struct device *dev)
@@ -712,4 +731,5 @@
 }
 
+#ifdef CONFIG_FSL_QMAN_CONFIG
 static int fsl_qman_probe(struct platform_device *pdev)
 {
@@ -830,4 +850,5 @@
 	return 0;
 }
+#endif /* CONFIG_FSL_QMAN_CONFIG */
 
 #ifndef __rtems__
@@ -858,16 +879,18 @@
 {
 	const char *fdt = bsp_fdt_get();
+	const char *name;
+	int node;
+	int ret;
+#ifdef CONFIG_FSL_QMAN_CONFIG
 	struct {
 		struct platform_device pdev;
 		struct device_node of_node;
 	} dev;
-	const char *name;
-	int node;
-	int ret;
+#endif
 
 	name = "fsl,qman";
-	node = fdt_node_offset_by_compatible(fdt, 0, name);
-	if (node < 0)
-		panic("qman: no qman in FDT");
+	node = fdt_node_offset_by_compatible(fdt, -1, name);
+#ifdef CONFIG_FSL_QMAN_CONFIG
+	BSD_ASSERT(node >= 0);
 
 	memset(&dev, 0, sizeof(dev));
@@ -877,6 +900,32 @@
 
 	ret = fsl_qman_probe(&dev.pdev);
-	if (ret != 0)
-		panic("qman: init failed");
+	BSD_ASSERT(ret == 0);
+#else /* !CONFIG_FSL_QMAN_CONFIG */
+	BSD_ASSERT(node < 0);
+	BSD_ASSERT(fdt_node_offset_by_compatible(fdt, -1,
+	    "fsl,qman-portal-3.1.2") >= 0);
+
+	qman_ip_rev = QMAN_REV31;
+	qm_channel_pool1 = QMAN_CHANNEL_POOL1_REV3;
+	qm_channel_caam = QMAN_CHANNEL_CAAM_REV3;
+
+	qm_fqalloc = devm_gen_pool_create(NULL, 0, -1, "qman-fqalloc");
+	BSD_ASSERT(!IS_ERR(qm_fqalloc));
+
+	qm_qpalloc = devm_gen_pool_create(NULL, 0, -1, "qman-qpalloc");
+	BSD_ASSERT(!IS_ERR(qm_qpalloc));
+
+	qm_cgralloc = devm_gen_pool_create(NULL, 0, -1, "qman-cgralloc");
+	BSD_ASSERT(!IS_ERR(qm_cgralloc));
+
+	ret = qman_resource_init(NULL);
+	BSD_ASSERT(ret == 0);
+
+	ret = qman_alloc_fq_table(qm_get_fqid_maxcnt());
+	BSD_ASSERT(ret == 0);
+
+	ret = qman_wq_alloc();
+	BSD_ASSERT(ret == 0);
+#endif /* CONFIG_FSL_QMAN_CONFIG */
 
 	qman_sysinit_portals();
Index: linux/drivers/soc/fsl/qbman/qman_portal.c
===================================================================
--- linux/drivers/soc/fsl/qbman/qman_portal.c	(revision a7d252c645c59e877fe468e4c3e33dde47381d7c)
+++ linux/drivers/soc/fsl/qbman/qman_portal.c	(revision 0f6ff4a923384618e979e106051b36c2db126791)
@@ -404,5 +404,5 @@
 		return (NULL);
 
-	list_del(&pcfg->node);
+	list_del_init(&pcfg->node);
 
 	irq_sources = QM_PIRQ_EQCI | QM_PIRQ_EQRI | QM_PIRQ_MRI | QM_PIRQ_CSCI
@@ -434,7 +434,7 @@
 	if (ret != 0)
 		panic("qman: no portal CE address");
-#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
-	pcfg->addr_virt[0] = (__iomem void *)
-	    ((uintptr_t)&qoriq_qman_portal[0][0] + (uintptr_t)res.start);
+	pcfg->addr_virt[0] = (__iomem void *)(uintptr_t)res.start;
+#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT) && \
+    !defined(QORIQ_IS_HYPERVISOR_GUEST)
 	BSD_ASSERT((uintptr_t)pcfg->addr_virt[0] >=
 	    (uintptr_t)&qoriq_qman_portal[0][0]);
@@ -446,7 +446,7 @@
 	if (ret != 0)
 		panic("qman: no portal CI address");
-#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
-	pcfg->addr_virt[1] = (__iomem void *)
-	    ((uintptr_t)&qoriq_qman_portal[0][0] + (uintptr_t)res.start);
+	pcfg->addr_virt[1] = (__iomem void *)(uintptr_t)res.start;
+#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT) && \
+    !defined(QORIQ_IS_HYPERVISOR_GUEST)
 	BSD_ASSERT((uintptr_t)pcfg->addr_virt[1] >=
 	    (uintptr_t)&qoriq_qman_portal[1][0]);
@@ -472,6 +472,5 @@
 
 		portal = init_pcfg(pcfg);
-		if (portal == NULL)
-			panic("qman: cannot create portal");
+		BSD_ASSERT(portal != NULL);
 
 		qman_portal_update_sdest(pcfg, val);
@@ -491,21 +490,7 @@
 	int i;
 	int node;
-	int parent;
-
-	memset(&dn, 0, sizeof(dn));
-
-	name = "fsl,qman-portal";
-	node = fdt_node_offset_by_compatible(fdt, 0, name);
-	if (node < 0)
-		panic("qman: no portals in FDT");
-	parent = fdt_parent_offset(fdt, node);
-	if (parent < 0)
-		panic("qman: no parent of portals in FDT");
-	node = fdt_first_subnode(fdt, parent);
-
-	dn.full_name = name;
-	dn.offset = node;
-
-#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT)
+
+#if QORIQ_CHIP_IS_T_VARIANT(QORIQ_CHIP_VARIANT) && \
+    !defined(QORIQ_IS_HYPERVISOR_GUEST)
 	qoriq_clear_ce_portal(&qoriq_qman_portal[0][0],
 	    sizeof(qoriq_qman_portal[0]));
@@ -514,17 +499,54 @@
 #endif
 
+	memset(&dn, 0, sizeof(dn));
+	name = "fsl,qman-portal";
+	node = -1;
+	dn.full_name = name;
 	i = 0;
-	while (node >= 0 && i < MAX_QMAN_PORTALS) {
-		if (fdt_node_check_compatible(fdt, node, name) == 0) {
-			do_init_pcfg(&dn, &qman_configs[i], cpu_count);
-			++i;
+
+	while (i < MAX_QMAN_PORTALS) {
+		node = fdt_node_offset_by_compatible(fdt, node, name);
+		if (node < 0)
+			break;
+
+		dn.offset = node;
+		do_init_pcfg(&dn, &qman_configs[i], cpu_count);
+		++i;
+	}
+
+	if (i < cpu_count)
+		panic("qman: not enough affine portals");
+
+	/*
+	 * We try to use the "cell-index" for the affine portal processor
+	 * index.  This is not always possible, so equip the remaining
+	 * processors with portals from the free list.  Ignore the
+	 * "libbsd,dequeue" property.
+	 */
+	for (i = 0; i < cpu_count; ++i) {
+		struct qman_portal *p;
+
+		p = affine_portals[i];
+		if (p == NULL) {
+			struct qm_portal_config *pcfg;
+			struct qman_portal *portal;
+
+			if (list_empty(&qman_free_portals))
+				panic("qman: no free affine portal");
+
+			pcfg = list_first_entry(&qman_free_portals,
+			    struct qm_portal_config, node);
+			list_del_init(&pcfg->node);
+
+			pcfg->cpu = i;
+			pcfg->pools = qm_get_pools_sdqcr();
+
+			portal = init_pcfg(pcfg);
+			BSD_ASSERT(portal != NULL);
+
+			qman_portal_update_sdest(pcfg, i);
+
 		}
-
-		node = fdt_next_subnode(fdt, node);
-		dn.offset = node;
-	}
-
-	if (i < cpu_count)
-		panic("qman: not enough portals in FDT");
+	}
 
 	/* all assigned portals are initialized now */
Index: rtemsbsd/include/rtems/bsd/local/opt_dpaa.h
===================================================================
--- rtemsbsd/include/rtems/bsd/local/opt_dpaa.h	(revision a7d252c645c59e877fe468e4c3e33dde47381d7c)
+++ rtemsbsd/include/rtems/bsd/local/opt_dpaa.h	(revision 0f6ff4a923384618e979e106051b36c2db126791)
@@ -19,2 +19,6 @@
 
 #define KBUILD_MODNAME "dpaa"
+
+#ifndef QORIQ_IS_HYPERVISOR_GUEST
+#define CONFIG_FSL_QMAN_CONFIG
+#endif
