summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Sethi <Varun.Sethi@freescale.com>2013-05-30 12:45:13 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-05-30 22:35:55 (GMT)
commita87f76cb563a5acbea9bc46f4f676888cfa3f719 (patch)
treebc3340b0bd35d4e8d690f69d75a80586a3de3047
parent20e8259f58873f032c7a2753602ec2bfc15e27a8 (diff)
downloadlinux-fsl-qoriq-a87f76cb563a5acbea9bc46f4f676888cfa3f719.tar.xz
iommu/fsl : Enable PAMU window for all possible LIODNS
The "enable_rmaining_liodn" function opens the PAMU window for all possible LIODN values. This provides a workaround to the bug in u-boot, where it fails to program LIODN values (in device tree), for cases where packet frame descriptors from FMAN can be enqueued directly to hardware blocks like SEC and RMAN. Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Change-Id: I454d37dc7b7bc5bc74de0af815e19eb2796937b8 Reviewed-on: http://git.am.freescale.net:8181/2789 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Bulie Radu-Andrei-B37577 <Radu.Bulie@freescale.com> Reviewed-by: Yoder Stuart-B08248 <stuart.yoder@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
-rw-r--r--drivers/iommu/fsl_pamu.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 6f32f6a..e4be15a 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -749,6 +749,32 @@ int setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size,
return 0;
}
+/*
+ * Primarily to Enable LIODNs which u-boot didn't update in the device tree.
+ */
+static void __init enable_remaining_liodns(void)
+{
+ int liodn;
+ struct paace *ppaace;
+
+ for (liodn = 0; liodn < PAACE_NUMBER_ENTRIES; liodn++) {
+ ppaace = pamu_get_ppaace(liodn);
+ if (!get_bf(ppaace->addr_bitfields, PAACE_AF_V)) {
+ pamu_init_ppaace(ppaace);
+ /* window size is 2^(WSE+1) bytes */
+ set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, 35);
+ ppaace->wbah = 0;
+ set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
+ set_bf(ppaace->impl_attr, PAACE_IA_ATM,
+ PAACE_ATM_NO_XLATE);
+ set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
+ PAACE_AP_PERMS_ALL);
+ mb();
+ pamu_enable_liodn(liodn);
+ }
+ }
+}
+
/* Enable all device LIODNS */
static void __init setup_liodns(void)
{
@@ -792,6 +818,16 @@ static void __init setup_liodns(void)
pamu_enable_liodn(liodn);
}
}
+
+ /*
+ * Currently u-boot doesn't fixup LIODNs for cases
+ * where a frame is passed to a hardware block from
+ * another hardware block. For example, frame can
+ * be passed from FMAN rx port to SEC or RMAN. So,
+ * as a work around we enable all the possible LIODN
+ * values.
+ */
+ enable_remaining_liodns();
}
irqreturn_t pamu_av_isr(int irq, void *arg)