EXPORT_SYMBOL_GPL(swiotlb_nr_tbl);
/* default to 64MB */
-#define IO_TLB_DEFAULT_SIZE (64UL<<20)
+#ifdef CONFIG_MTK_LM_MODE
+#define IO_TLB_DEFAULT_SIZE (SZ_64M)
+#else
+#define IO_TLB_DEFAULT_SIZE ((1 << IO_TLB_SHIFT) * IO_TLB_SEGSIZE)
+#endif // end of CONFIG_MTK_LM_MODE
unsigned long swiotlb_size_or_default(void)
{
unsigned long size;
vstart = phys_to_virt(io_tlb_start);
vend = phys_to_virt(io_tlb_end);
- printk(KERN_INFO "software IO TLB [mem %#010llx-%#010llx] (%luMB) mapped at [%p-%p]\n",
+ printk(KERN_ALERT"software IO TLB [mem %#010llx-%#010llx] (%luMB) mapped at [%p-%p]\n",
(unsigned long long)io_tlb_start,
(unsigned long long)io_tlb_end,
bytes >> 20, vstart, vend - 1);
*/
printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at "
"device %s\n", size, dev ? dev_name(dev) : "?");
+ BUG();
if (size <= io_tlb_overflow || !do_panic)
return;