mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	Power SVM wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Consolidate the support for this into the swiotlb_init interface by adding a new flag. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			626 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
	
		
			626 B
		
	
	
	
		
			C
		
	
	
	
	
	
// SPDX-License-Identifier: GPL-2.0-or-later
 | 
						|
/*
 | 
						|
 * Contains routines needed to support swiotlb for ppc.
 | 
						|
 *
 | 
						|
 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
 | 
						|
 * Author: Becky Bruce
 | 
						|
 */
 | 
						|
#include <linux/memblock.h>
 | 
						|
#include <asm/machdep.h>
 | 
						|
#include <asm/swiotlb.h>
 | 
						|
 | 
						|
unsigned int ppc_swiotlb_enable;
 | 
						|
unsigned int ppc_swiotlb_flags;
 | 
						|
 | 
						|
void __init swiotlb_detect_4g(void)
 | 
						|
{
 | 
						|
	if ((memblock_end_of_DRAM() - 1) > 0xffffffff)
 | 
						|
		ppc_swiotlb_enable = 1;
 | 
						|
}
 | 
						|
 | 
						|
static int __init check_swiotlb_enabled(void)
 | 
						|
{
 | 
						|
	if (ppc_swiotlb_enable)
 | 
						|
		swiotlb_print_info();
 | 
						|
	else
 | 
						|
		swiotlb_exit();
 | 
						|
 | 
						|
	return 0;
 | 
						|
}
 | 
						|
subsys_initcall(check_swiotlb_enabled);
 |