Path: blob/master/arch/sh/include/cpu-sh5/cpu/cache.h
17293 views
#ifndef __ASM_SH_CPU_SH5_CACHE_H1#define __ASM_SH_CPU_SH5_CACHE_H23/*4* include/asm-sh/cpu-sh5/cache.h5*6* Copyright (C) 2000, 2001 Paolo Alberelli7* Copyright (C) 2003, 2004 Paul Mundt8*9* This file is subject to the terms and conditions of the GNU General Public10* License. See the file "COPYING" in the main directory of this archive11* for more details.12*/1314#define L1_CACHE_SHIFT 51516/* Valid and Dirty bits */17#define SH_CACHE_VALID (1LL<<0)18#define SH_CACHE_UPDATED (1LL<<57)1920/* Unimplemented compat bits.. */21#define SH_CACHE_COMBINED 022#define SH_CACHE_ASSOC 02324/* Cache flags */25#define SH_CACHE_MODE_WT (1LL<<0)26#define SH_CACHE_MODE_WB (1LL<<1)2728/*29* Control Registers.30*/31#define ICCR_BASE 0x01600000 /* Instruction Cache Control Register */32#define ICCR_REG0 0 /* Register 0 offset */33#define ICCR_REG1 1 /* Register 1 offset */34#define ICCR0 ICCR_BASE+ICCR_REG035#define ICCR1 ICCR_BASE+ICCR_REG13637#define ICCR0_OFF 0x0 /* Set ICACHE off */38#define ICCR0_ON 0x1 /* Set ICACHE on */39#define ICCR0_ICI 0x2 /* Invalidate all in IC */4041#define ICCR1_NOLOCK 0x0 /* Set No Locking */4243#define OCCR_BASE 0x01E00000 /* Operand Cache Control Register */44#define OCCR_REG0 0 /* Register 0 offset */45#define OCCR_REG1 1 /* Register 1 offset */46#define OCCR0 OCCR_BASE+OCCR_REG047#define OCCR1 OCCR_BASE+OCCR_REG14849#define OCCR0_OFF 0x0 /* Set OCACHE off */50#define OCCR0_ON 0x1 /* Set OCACHE on */51#define OCCR0_OCI 0x2 /* Invalidate all in OC */52#define OCCR0_WT 0x4 /* Set OCACHE in WT Mode */53#define OCCR0_WB 0x0 /* Set OCACHE in WB Mode */5455#define OCCR1_NOLOCK 0x0 /* Set No Locking */5657/*58* SH-559* A bit of description here, for neff=32.60*61* |<--- tag (19 bits) --->|62* +-----------------------------+-----------------+------+----------+------+63* | | | ways |set index |offset|64* +-----------------------------+-----------------+------+----------+------+65* ^ 2 bits 8 bits 5 bits66* +- Bit 3167*68* Cacheline size is based on offset: 5 bits = 32 bytes per line69* A cache line is identified by a tag + set but OCACHETAG/ICACHETAG70* have a broader space for registers. These are outlined by71* CACHE_?C_*_STEP below.72*73*/7475/* Instruction cache */76#define CACHE_IC_ADDRESS_ARRAY 0x010000007778/* Operand Cache */79#define CACHE_OC_ADDRESS_ARRAY 0x018000008081/* These declarations relate to cache 'synonyms' in the operand cache. A82'synonym' occurs where effective address bits overlap between those used for83indexing the cache sets and those passed to the MMU for translation. In the84case of SH5-101 & SH5-103, only bit 12 is affected for 4k pages. */8586#define CACHE_OC_N_SYNBITS 1 /* Number of synonym bits */87#define CACHE_OC_SYN_SHIFT 1288/* Mask to select synonym bit(s) */89#define CACHE_OC_SYN_MASK (((1UL<<CACHE_OC_N_SYNBITS)-1)<<CACHE_OC_SYN_SHIFT)9091/*92* Instruction cache can't be invalidated based on physical addresses.93* No Instruction Cache defines required, then.94*/9596#endif /* __ASM_SH_CPU_SH5_CACHE_H */979899