|
@@ -123,8 +123,9 @@ static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev,
|
|
return phys_to_dma(hwdev, virt_to_phys(address));
|
|
return phys_to_dma(hwdev, virt_to_phys(address));
|
|
}
|
|
}
|
|
|
|
|
|
-static void swiotlb_print_info(unsigned long bytes)
|
|
|
|
|
|
+void swiotlb_print_info(void)
|
|
{
|
|
{
|
|
|
|
+ unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
|
|
phys_addr_t pstart, pend;
|
|
phys_addr_t pstart, pend;
|
|
|
|
|
|
pstart = virt_to_phys(io_tlb_start);
|
|
pstart = virt_to_phys(io_tlb_start);
|
|
@@ -142,7 +143,7 @@ static void swiotlb_print_info(unsigned long bytes)
|
|
* structures for the software IO TLB used to implement the DMA API.
|
|
* structures for the software IO TLB used to implement the DMA API.
|
|
*/
|
|
*/
|
|
void __init
|
|
void __init
|
|
-swiotlb_init_with_default_size(size_t default_size)
|
|
|
|
|
|
+swiotlb_init_with_default_size(size_t default_size, int verbose)
|
|
{
|
|
{
|
|
unsigned long i, bytes;
|
|
unsigned long i, bytes;
|
|
|
|
|
|
@@ -178,14 +179,14 @@ swiotlb_init_with_default_size(size_t default_size)
|
|
io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
|
|
io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
|
|
if (!io_tlb_overflow_buffer)
|
|
if (!io_tlb_overflow_buffer)
|
|
panic("Cannot allocate SWIOTLB overflow buffer!\n");
|
|
panic("Cannot allocate SWIOTLB overflow buffer!\n");
|
|
-
|
|
|
|
- swiotlb_print_info(bytes);
|
|
|
|
|
|
+ if (verbose)
|
|
|
|
+ swiotlb_print_info();
|
|
}
|
|
}
|
|
|
|
|
|
void __init
|
|
void __init
|
|
-swiotlb_init(void)
|
|
|
|
|
|
+swiotlb_init(int verbose)
|
|
{
|
|
{
|
|
- swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */
|
|
|
|
|
|
+ swiotlb_init_with_default_size(64 * (1<<20), verbose); /* default to 64MB */
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -262,7 +263,7 @@ swiotlb_late_init_with_default_size(size_t default_size)
|
|
if (!io_tlb_overflow_buffer)
|
|
if (!io_tlb_overflow_buffer)
|
|
goto cleanup4;
|
|
goto cleanup4;
|
|
|
|
|
|
- swiotlb_print_info(bytes);
|
|
|
|
|
|
+ swiotlb_print_info();
|
|
|
|
|
|
late_alloc = 1;
|
|
late_alloc = 1;
|
|
|
|
|