hmatrix.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * High-Speed Bus Matrix configuration registers
  3. *
  4. * Copyright (C) 2008 Atmel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __HMATRIX_H
  11. #define __HMATRIX_H
  12. extern struct clk at32_hmatrix_clk;
  13. void hmatrix_write_reg(unsigned long offset, u32 value);
  14. u32 hmatrix_read_reg(unsigned long offset);
  15. void hmatrix_sfr_set_bits(unsigned int slave_id, u32 mask);
  16. void hmatrix_sfr_clear_bits(unsigned int slave_id, u32 mask);
  17. /* Master Configuration register */
  18. #define HMATRIX_MCFG(m) (0x0000 + 4 * (m))
  19. /* Undefined length burst limit */
  20. # define HMATRIX_MCFG_ULBT_INFINITE 0 /* Infinite length */
  21. # define HMATRIX_MCFG_ULBT_SINGLE 1 /* Single Access */
  22. # define HMATRIX_MCFG_ULBT_FOUR_BEAT 2 /* Four beat */
  23. # define HMATRIX_MCFG_ULBT_EIGHT_BEAT 3 /* Eight beat */
  24. # define HMATRIX_MCFG_ULBT_SIXTEEN_BEAT 4 /* Sixteen beat */
  25. /* Slave Configuration register */
  26. #define HMATRIX_SCFG(s) (0x0040 + 4 * (s))
  27. # define HMATRIX_SCFG_SLOT_CYCLE(x) ((x) << 0) /* Max burst cycles */
  28. # define HMATRIX_SCFG_DEFMSTR_NONE ( 0 << 16) /* No default master */
  29. # define HMATRIX_SCFG_DEFMSTR_LAST ( 1 << 16) /* Last def master */
  30. # define HMATRIX_SCFG_DEFMSTR_FIXED ( 2 << 16) /* Fixed def master */
  31. # define HMATRIX_SCFG_FIXED_DEFMSTR(m) ((m) << 18) /* Fixed master ID */
  32. # define HMATRIX_SCFG_ARBT_ROUND_ROBIN ( 0 << 24) /* RR arbitration */
  33. # define HMATRIX_SCFG_ARBT_FIXED_PRIO ( 1 << 24) /* Fixed priority */
  34. /* Slave Priority register A (master 0..7) */
  35. #define HMATRIX_PRAS(s) (0x0080 + 8 * (s))
  36. # define HMATRIX_PRAS_PRIO(m, p) ((p) << ((m) * 4))
  37. /* Slave Priority register A (master 8..15) */
  38. #define HMATRIX_PRBS(s) (0x0084 + 8 * (s))
  39. # define HMATRIX_PRBS_PRIO(m, p) ((p) << (((m) - 8) * 4))
  40. /* Master Remap Control Register */
  41. #define HMATRIX_MRCR 0x0100
  42. # define HMATRIX_MRCR_REMAP(m) ( 1 << (m)) /* Remap master m */
  43. /* Special Function Register. Bit definitions are chip-specific */
  44. #define HMATRIX_SFR(s) (0x0110 + 4 * (s))
  45. #endif /* __HMATRIX_H */