uengine.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Generic library functions for the microengines found on the Intel
  3. * IXP2000 series of network processors.
  4. *
  5. * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org>
  6. * Dedicated to Marija Kulikova.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as
  10. * published by the Free Software Foundation; either version 2.1 of the
  11. * License, or (at your option) any later version.
  12. */
  13. #ifndef __IXP2000_UENGINE_H
  14. #define __IXP2000_UENGINE_H
  15. extern u32 ixp2000_uengine_mask;
  16. struct ixp2000_uengine_code
  17. {
  18. u32 cpu_model_bitmask;
  19. u8 cpu_min_revision;
  20. u8 cpu_max_revision;
  21. u32 uengine_parameters;
  22. struct ixp2000_reg_value {
  23. int reg;
  24. u32 value;
  25. } *initial_reg_values;
  26. int num_insns;
  27. u8 *insns;
  28. };
  29. u32 ixp2000_uengine_csr_read(int uengine, int offset);
  30. void ixp2000_uengine_csr_write(int uengine, int offset, u32 value);
  31. void ixp2000_uengine_reset(u32 uengine_mask);
  32. void ixp2000_uengine_set_mode(int uengine, u32 mode);
  33. void ixp2000_uengine_load_microcode(int uengine, u8 *ucode, int insns);
  34. void ixp2000_uengine_init_context(int uengine, int context, int pc);
  35. void ixp2000_uengine_start_contexts(int uengine, u8 ctx_mask);
  36. void ixp2000_uengine_stop_contexts(int uengine, u8 ctx_mask);
  37. int ixp2000_uengine_load(int uengine, struct ixp2000_uengine_code *c);
  38. #define IXP2000_UENGINE_8_CONTEXTS 0x00000000
  39. #define IXP2000_UENGINE_4_CONTEXTS 0x80000000
  40. #define IXP2000_UENGINE_PRN_UPDATE_EVERY 0x40000000
  41. #define IXP2000_UENGINE_PRN_UPDATE_ON_ACCESS 0x00000000
  42. #define IXP2000_UENGINE_NN_FROM_SELF 0x00100000
  43. #define IXP2000_UENGINE_NN_FROM_PREVIOUS 0x00000000
  44. #define IXP2000_UENGINE_ASSERT_EMPTY_AT_3 0x000c0000
  45. #define IXP2000_UENGINE_ASSERT_EMPTY_AT_2 0x00080000
  46. #define IXP2000_UENGINE_ASSERT_EMPTY_AT_1 0x00040000
  47. #define IXP2000_UENGINE_ASSERT_EMPTY_AT_0 0x00000000
  48. #define IXP2000_UENGINE_LM_ADDR1_GLOBAL 0x00020000
  49. #define IXP2000_UENGINE_LM_ADDR1_PER_CONTEXT 0x00000000
  50. #define IXP2000_UENGINE_LM_ADDR0_GLOBAL 0x00010000
  51. #define IXP2000_UENGINE_LM_ADDR0_PER_CONTEXT 0x00000000
  52. #endif