2019-06-04 16:11:33 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2010-02-22 19:16:08 +08:00
|
|
|
/*
|
|
|
|
* Microblaze support for cache consistent memory.
|
|
|
|
* Copyright (C) 2010 Michal Simek <monstr@monstr.eu>
|
|
|
|
* Copyright (C) 2010 PetaLogix
|
|
|
|
* Copyright (C) 2005 John Williams <jwilliams@itee.uq.edu.au>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/init.h>
|
2020-09-22 21:36:11 +08:00
|
|
|
#include <linux/dma-map-ops.h>
|
2010-02-22 19:16:08 +08:00
|
|
|
#include <asm/cpuinfo.h>
|
2019-08-14 22:03:48 +08:00
|
|
|
#include <asm/cacheflush.h>
|
2010-02-22 19:16:08 +08:00
|
|
|
|
2019-08-14 22:03:47 +08:00
|
|
|
void arch_dma_prep_coherent(struct page *page, size_t size)
|
2010-02-22 19:16:08 +08:00
|
|
|
{
|
2019-08-14 22:03:47 +08:00
|
|
|
phys_addr_t paddr = page_to_phys(page);
|
2010-02-22 19:16:08 +08:00
|
|
|
|
2019-08-14 22:03:47 +08:00
|
|
|
flush_dcache_range(paddr, paddr + size);
|
|
|
|
}
|