mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 01:51:34 +00:00
8ba2ed1be9
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>
31 lines
626 B
C
31 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);
|