cache.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * include/asm-parisc/cache.h
  4. */
  5. #ifndef __ARCH_PARISC_CACHE_H
  6. #define __ARCH_PARISC_CACHE_H
  7. #include <asm/alternative.h>
  8. /*
  9. * PA 2.0 processors have 64 and 128-byte L2 cachelines; PA 1.1 processors
  10. * have 32-byte cachelines. The L1 length appears to be 16 bytes but this
  11. * is not clearly documented.
  12. */
  13. #define L1_CACHE_BYTES 16
  14. #define L1_CACHE_SHIFT 4
  15. #ifndef __ASSEMBLY__
  16. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  17. #define ARCH_DMA_MINALIGN L1_CACHE_BYTES
  18. #define __read_mostly __section(".data..read_mostly")
  19. void parisc_cache_init(void); /* initializes cache-flushing */
  20. void disable_sr_hashing_asm(int); /* low level support for above */
  21. void disable_sr_hashing(void); /* turns off space register hashing */
  22. void free_sid(unsigned long);
  23. unsigned long alloc_sid(void);
  24. struct seq_file;
  25. extern void show_cache_info(struct seq_file *m);
  26. extern int split_tlb;
  27. extern int dcache_stride;
  28. extern int icache_stride;
  29. extern struct pdc_cache_info cache_info;
  30. void parisc_setup_cache_timing(void);
  31. #define pdtlb(sr, addr) asm volatile("pdtlb 0(%%sr%0,%1)" \
  32. ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
  33. : : "i"(sr), "r" (addr) : "memory")
  34. #define pitlb(sr, addr) asm volatile("pitlb 0(%%sr%0,%1)" \
  35. ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
  36. ALTERNATIVE(ALT_COND_NO_SPLIT_TLB, INSN_NOP) \
  37. : : "i"(sr), "r" (addr) : "memory")
  38. #define asm_io_fdc(addr) asm volatile("fdc %%r0(%0)" \
  39. ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \
  40. ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) \
  41. : : "r" (addr) : "memory")
  42. #define asm_io_sync() asm volatile("sync" \
  43. ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \
  44. ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) :::"memory")
  45. #define asm_syncdma() asm volatile("syncdma" :::"memory")
  46. #endif /* ! __ASSEMBLY__ */
  47. /* Classes of processor wrt: disabling space register hashing */
  48. #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
  49. #define SRHASH_PCXL 1 /* pcxl */
  50. #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
  51. #endif