blob: 44ecd1f300fe73f4643699cfe9ba5398c775801f [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
GuanXuetaob50f1702011-01-15 18:16:59 +08002/*
3 * linux/arch/unicore32/include/asm/cache.h
4 *
5 * Code specific to PKUnity SoC and UniCore ISA
6 *
7 * Copyright (C) 2001-2010 GUAN Xue-tao
GuanXuetaob50f1702011-01-15 18:16:59 +08008 */
9#ifndef __UNICORE_CACHE_H__
10#define __UNICORE_CACHE_H__
11
12#define L1_CACHE_SHIFT (5)
13#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
14
15/*
16 * Memory returned by kmalloc() may be used for DMA, so we must make
17 * sure that all such allocations are cache aligned. Otherwise,
18 * unrelated code may cause parts of the buffer to be read into the
19 * cache before the transfer is done, causing old data to be seen by
20 * the CPU.
21 */
22#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
23
24#endif