mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 01:24:12 +08:00
68005b67d1
Now that we've switched all the powerpc nommu and swiotlb methods to use the generic dma_direct_* calls we can remove these ops vectors entirely and rely on the common direct mapping bypass that avoids indirect function calls entirely. This also allows to remove a whole lot of boilerplate code related to setting up these operations. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
35 lines
813 B
C
35 lines
813 B
C
/*
|
|
* Contains routines needed to support swiotlb for ppc.
|
|
*
|
|
* Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
|
|
* Author: Becky Bruce
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*
|
|
*/
|
|
#include <linux/memblock.h>
|
|
#include <asm/machdep.h>
|
|
#include <asm/swiotlb.h>
|
|
|
|
unsigned int ppc_swiotlb_enable;
|
|
|
|
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);
|