Path: blob/master/arch/mn10300/include/asm/cache.h
15126 views
/* MN10300 cache management registers1*2* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public Licence7* as published by the Free Software Foundation; either version8* 2 of the Licence, or (at your option) any later version.9*/1011#ifndef _ASM_CACHE_H12#define _ASM_CACHE_H1314#include <asm/cpu-regs.h>15#include <proc/cache.h>1617#ifndef __ASSEMBLY__18#define L1_CACHE_DISPARITY (L1_CACHE_NENTRIES * L1_CACHE_BYTES)19#else20#define L1_CACHE_DISPARITY L1_CACHE_NENTRIES * L1_CACHE_BYTES21#endif2223#define ARCH_DMA_MINALIGN L1_CACHE_BYTES2425/* data cache purge registers26* - read from the register to unconditionally purge that cache line27* - write address & 0xffffff00 to conditionally purge that cache line28* - clear LSB to request invalidation as well29*/30#define DCACHE_PURGE(WAY, ENTRY) \31__SYSREG(0xc8400000 + (WAY) * L1_CACHE_WAYDISP + \32(ENTRY) * L1_CACHE_BYTES, u32)3334#define DCACHE_PURGE_WAY0(ENTRY) \35__SYSREG(0xc8400000 + 0 * L1_CACHE_WAYDISP + (ENTRY) * L1_CACHE_BYTES, u32)36#define DCACHE_PURGE_WAY1(ENTRY) \37__SYSREG(0xc8400000 + 1 * L1_CACHE_WAYDISP + (ENTRY) * L1_CACHE_BYTES, u32)38#define DCACHE_PURGE_WAY2(ENTRY) \39__SYSREG(0xc8400000 + 2 * L1_CACHE_WAYDISP + (ENTRY) * L1_CACHE_BYTES, u32)40#define DCACHE_PURGE_WAY3(ENTRY) \41__SYSREG(0xc8400000 + 3 * L1_CACHE_WAYDISP + (ENTRY) * L1_CACHE_BYTES, u32)4243/* instruction cache access registers */44#define ICACHE_DATA(WAY, ENTRY, OFF) \45__SYSREG(0xc8000000 + (WAY) * L1_CACHE_WAYDISP + \46(ENTRY) * L1_CACHE_BYTES + (OFF) * 4, u32)47#define ICACHE_TAG(WAY, ENTRY) \48__SYSREG(0xc8100000 + (WAY) * L1_CACHE_WAYDISP + \49(ENTRY) * L1_CACHE_BYTES, u32)5051/* data cache access registers */52#define DCACHE_DATA(WAY, ENTRY, OFF) \53__SYSREG(0xc8200000 + (WAY) * L1_CACHE_WAYDISP + \54(ENTRY) * L1_CACHE_BYTES + (OFF) * 4, u32)55#define DCACHE_TAG(WAY, ENTRY) \56__SYSREG(0xc8300000 + (WAY) * L1_CACHE_WAYDISP + \57(ENTRY) * L1_CACHE_BYTES, u32)5859#endif /* _ASM_CACHE_H */606162