cache.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 __attribute__((__section__(".data..read_mostly")))
  19. /* Read-only memory is marked before mark_rodata_ro() is called. */
  20. #define __ro_after_init __read_mostly
  21. void parisc_cache_init(void); /* initializes cache-flushing */
  22. void disable_sr_hashing_asm(int); /* low level support for above */
  23. void disable_sr_hashing(void); /* turns off space register hashing */
  24. void free_sid(unsigned long);
  25. unsigned long alloc_sid(void);
  26. struct seq_file;
  27. extern void show_cache_info(struct seq_file *m);
  28. extern int split_tlb;
  29. extern int dcache_stride;
  30. extern int icache_stride;
  31. extern struct pdc_cache_info cache_info;
  32. void parisc_setup_cache_timing(void);
  33. #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" \
  34. ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
  35. : : "r" (addr))
  36. #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" \
  37. ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
  38. ALTERNATIVE(ALT_COND_NO_SPLIT_TLB, INSN_NOP) \
  39. : : "r" (addr))
  40. #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" \
  41. ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
  42. : : "r" (addr))
  43. #define asm_io_fdc(addr) asm volatile("fdc %%r0(%0)" \
  44. ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \
  45. ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) \
  46. : : "r" (addr))
  47. #define asm_io_sync() asm volatile("sync" \
  48. ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \
  49. ALTERNATIVE(ALT_COND_NO_IOC_FDC, INSN_NOP) :: )
  50. #endif /* ! __ASSEMBLY__ */
  51. /* Classes of processor wrt: disabling space register hashing */
  52. #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
  53. #define SRHASH_PCXL 1 /* pcxl */
  54. #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
  55. #endif