Linux Audio

Check our new training course

Loading...
v5.9
 1// SPDX-License-Identifier: GPL-2.0-or-later
 2/*
 3 * Contains routines needed to support swiotlb for ppc.
 4 *
 5 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
 6 * Author: Becky Bruce
 7 */
 8#include <linux/memblock.h>
 9#include <asm/machdep.h>
10#include <asm/swiotlb.h>
11
12unsigned int ppc_swiotlb_enable;
 
13
14void __init swiotlb_detect_4g(void)
15{
16	if ((memblock_end_of_DRAM() - 1) > 0xffffffff)
17		ppc_swiotlb_enable = 1;
18}
19
20static int __init check_swiotlb_enabled(void)
21{
22	if (ppc_swiotlb_enable)
23		swiotlb_print_info();
24	else
25		swiotlb_exit();
26
27	return 0;
28}
29subsys_initcall(check_swiotlb_enabled);
v6.2
 1// SPDX-License-Identifier: GPL-2.0-or-later
 2/*
 3 * Contains routines needed to support swiotlb for ppc.
 4 *
 5 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc.
 6 * Author: Becky Bruce
 7 */
 8#include <linux/memblock.h>
 9#include <asm/machdep.h>
10#include <asm/swiotlb.h>
11
12unsigned int ppc_swiotlb_enable;
13unsigned int ppc_swiotlb_flags;
14
15void __init swiotlb_detect_4g(void)
16{
17	if ((memblock_end_of_DRAM() - 1) > 0xffffffff)
18		ppc_swiotlb_enable = 1;
19}
20
21static int __init check_swiotlb_enabled(void)
22{
23	if (ppc_swiotlb_enable)
24		swiotlb_print_info();
25	else
26		swiotlb_exit();
27
28	return 0;
29}
30subsys_initcall(check_swiotlb_enabled);