v850e2_cache.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * include/asm-v850/v850e2_cache_cache.h -- Cache control for V850E2
  3. * cache memories
  4. *
  5. * Copyright (C) 2003,05 NEC Electronics Corporation
  6. * Copyright (C) 2003,05 Miles Bader <miles@gnu.org>
  7. *
  8. * This file is subject to the terms and conditions of the GNU General
  9. * Public License. See the file COPYING in the main directory of this
  10. * archive for more details.
  11. *
  12. * Written by Miles Bader <miles@gnu.org>
  13. */
  14. #ifndef __V850_V850E2_CACHE_H__
  15. #define __V850_V850E2_CACHE_H__
  16. #include <asm/types.h>
  17. /* Cache control registers. */
  18. /* Bus Transaction Control */
  19. #define V850E2_CACHE_BTSC_ADDR 0xFFFFF070
  20. #define V850E2_CACHE_BTSC (*(volatile u16 *)V850E2_CACHE_BTSC_ADDR)
  21. #define V850E2_CACHE_BTSC_ICM 0x0001 /* icache enable */
  22. #define V850E2_CACHE_BTSC_DCM0 0x0004 /* dcache enable, bit 0 */
  23. #define V850E2_CACHE_BTSC_DCM1 0x0008 /* dcache enable, bit 1 */
  24. #define V850E2_CACHE_BTSC_DCM_WT /* write-through */ \
  25. V850E2_CACHE_BTSC_DCM0
  26. #ifdef CONFIG_V850E2_V850E2S
  27. # define V850E2_CACHE_BTSC_DCM_WB_NO_ALLOC /* write-back, non-alloc */ \
  28. V850E2_CACHE_BTSC_DCM1
  29. # define V850E2_CACHE_BTSC_DCM_WB_ALLOC /* write-back, non-alloc */ \
  30. (V850E2_CACHE_BTSC_DCM1 | V850E2_CACHE_BTSC_DCM0)
  31. # define V850E2_CACHE_BTSC_ISEQ 0x0010 /* icache `address sequence mode' */
  32. # define V850E2_CACHE_BTSC_DSEQ 0x0020 /* dcache `address sequence mode' */
  33. # define V850E2_CACHE_BTSC_IRFC 0x0030
  34. # define V850E2_CACHE_BTSC_ILCD 0x4000
  35. # define V850E2_CACHE_BTSC_VABE 0x8000
  36. #endif /* CONFIG_V850E2_V850E2S */
  37. /* Cache operation start address register (low-bits). */
  38. #define V850E2_CACHE_CADL_ADDR 0xFFFFF074
  39. #define V850E2_CACHE_CADL (*(volatile u16 *)V850E2_CACHE_CADL_ADDR)
  40. /* Cache operation start address register (high-bits). */
  41. #define V850E2_CACHE_CADH_ADDR 0xFFFFF076
  42. #define V850E2_CACHE_CADH (*(volatile u16 *)V850E2_CACHE_CADH_ADDR)
  43. /* Cache operation count register. */
  44. #define V850E2_CACHE_CCNT_ADDR 0xFFFFF078
  45. #define V850E2_CACHE_CCNT (*(volatile u16 *)V850E2_CACHE_CCNT_ADDR)
  46. /* Cache operation specification register. */
  47. #define V850E2_CACHE_COPR_ADDR 0xFFFFF07A
  48. #define V850E2_CACHE_COPR (*(volatile u16 *)V850E2_CACHE_COPR_ADDR)
  49. #define V850E2_CACHE_COPR_STRT 0x0001 /* start cache operation */
  50. #define V850E2_CACHE_COPR_LBSL 0x0100 /* 0 = icache, 1 = dcache */
  51. #define V850E2_CACHE_COPR_WSLE 0x0200 /* operate on cache way */
  52. #define V850E2_CACHE_COPR_WSL(way) ((way) * 0x0400) /* way select */
  53. #define V850E2_CACHE_COPR_CFC(op) ((op) * 0x1000) /* cache function code */
  54. /* Size of a cache line in bytes. */
  55. #define V850E2_CACHE_LINE_SIZE_BITS 4
  56. #define V850E2_CACHE_LINE_SIZE (1 << V850E2_CACHE_LINE_SIZE_BITS)
  57. /* The size of each cache `way' in lines. */
  58. #define V850E2_CACHE_WAY_SIZE 256
  59. /* For <asm/cache.h> */
  60. #define L1_CACHE_BYTES V850E2_CACHE_LINE_SIZE
  61. #define L1_CACHE_SHIFT V850E2_CACHE_LINE_SIZE_BITS
  62. #endif /* __V850_V850E2_CACHE_H__ */