Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Contains routines needed to support swiotlb for ppc.
0004  *
0005  * Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
0006  * Author: Becky Bruce
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);