linux/arch/powerpc/kernel/dma-swiotlb.c
Christoph Hellwig 8ba2ed1be9 swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction
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>
2022-04-18 07:21:12 +02:00

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);