0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/memblock.h>
0009 #include <asm/machdep.h>
0010 #include <asm/swiotlb.h>
0011
0012 unsigned int ppc_swiotlb_enable;
0013 unsigned int ppc_swiotlb_flags;
0014
0015 void __init swiotlb_detect_4g(void)
0016 {
0017 if ((memblock_end_of_DRAM() - 1) > 0xffffffff)
0018 ppc_swiotlb_enable = 1;
0019 }
0020
0021 static int __init check_swiotlb_enabled(void)
0022 {
0023 if (ppc_swiotlb_enable)
0024 swiotlb_print_info();
0025 else
0026 swiotlb_exit();
0027
0028 return 0;
0029 }
0030 subsys_initcall(check_swiotlb_enabled);