I did a very brief look.I suppose a #define can be used, but this is a HW-specific number that will never ever change.
+ dmac_flush_range(fl_table, fl_table + SZ_16K);Can you use a #define for the 4096? Will that value ever change?
+
+ for (i = 0; i< 4096; i++)
I guess so.. again, HW specific.+ if ((fl_table[i]& 0x03) == FL_TYPE_TABLE) {Does it make sense to define say:
+ void *sl_table = __va(fl_table[i]& 0xFFFFFC00);
#define MASK_XX (x) x& 0xFFFFFC00
and
#define MASK_XY (x) x& 0xFFFF0000
and use those instead of these hard-coded values?
I guess I can use the IOMMU PA shift. PAGE_SHIFT is not appropriate here because that is MMU-specific.+ priv->pgtable = (unsigned long *)__get_free_pages(GFP_KERNEL, 2);Ugh. Can you use get_order(SZ_16K) instead?
+ /* Invalidate context TLB */Hmm, PAGE_SHIFT can't be used? Or some other #define?
+ SET_CTX_TLBIALL(base, ctx, 0);
+ SET_V2PPR_VA(base, ctx, va>> 12);