Path: blob/master/arch/sparc/include/asm/cypress.h
17386 views
/*1* cypress.h: Cypress module specific definitions and defines.2*3* Copyright (C) 1995 David S. Miller ([email protected])4*/56#ifndef _SPARC_CYPRESS_H7#define _SPARC_CYPRESS_H89/* Cypress chips have %psr 'impl' of '0001' and 'vers' of '0001'. */1011/* The MMU control register fields on the Sparc Cypress 604/605 MMU's.12*13* ---------------------------------------------------------------14* |implvers| MCA | MCM |MV| MID |BM| C|RSV|MR|CM|CL|CE|RSV|NF|ME|15* ---------------------------------------------------------------16* 31 24 23-22 21-20 19 18-15 14 13 12 11 10 9 8 7-2 1 017*18* MCA: MultiChip Access -- Used for configuration of multiple19* CY7C604/605 cache units.20* MCM: MultiChip Mask -- Again, for multiple cache unit config.21* MV: MultiChip Valid -- Indicates MCM and MCA have valid settings.22* MID: ModuleID -- Unique processor ID for MBus transactions. (605 only)23* BM: Boot Mode -- 0 = not in boot mode, 1 = in boot mode24* C: Cacheable -- Indicates whether accesses are cacheable while25* the MMU is off. 0=no 1=yes26* MR: MemoryReflection -- Indicates whether the bus attached to the27* MBus supports memory reflection. 0=no 1=yes (605 only)28* CM: CacheMode -- Indicates whether the cache is operating in write29* through or copy-back mode. 0=write-through 1=copy-back30* CL: CacheLock -- Indicates if the entire cache is locked or not.31* 0=not-locked 1=locked (604 only)32* CE: CacheEnable -- Is the virtual cache on? 0=no 1=yes33* NF: NoFault -- Do faults generate traps? 0=yes 1=no34* ME: MmuEnable -- Is the MMU doing translations? 0=no 1=yes35*/3637#define CYPRESS_MCA 0x00c0000038#define CYPRESS_MCM 0x0030000039#define CYPRESS_MVALID 0x0008000040#define CYPRESS_MIDMASK 0x00078000 /* Only on 605 */41#define CYPRESS_BMODE 0x0000400042#define CYPRESS_ACENABLE 0x0000200043#define CYPRESS_MRFLCT 0x00000800 /* Only on 605 */44#define CYPRESS_CMODE 0x0000040045#define CYPRESS_CLOCK 0x00000200 /* Only on 604 */46#define CYPRESS_CENABLE 0x0000010047#define CYPRESS_NFAULT 0x0000000248#define CYPRESS_MENABLE 0x000000014950static inline void cypress_flush_page(unsigned long page)51{52__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :53"r" (page), "i" (ASI_M_FLUSH_PAGE));54}5556static inline void cypress_flush_segment(unsigned long addr)57{58__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :59"r" (addr), "i" (ASI_M_FLUSH_SEG));60}6162static inline void cypress_flush_region(unsigned long addr)63{64__asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :65"r" (addr), "i" (ASI_M_FLUSH_REGION));66}6768static inline void cypress_flush_context(void)69{70__asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :71"i" (ASI_M_FLUSH_CTX));72}7374/* XXX Displacement flushes for buggy chips and initial testing75* XXX go here.76*/7778#endif /* !(_SPARC_CYPRESS_H) */798081