You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __SITARA_PRUSS_HEADER__
  2. #define __SITARA_PRUSS_HEADER__
  3. #include <stdio.h>
  4. #include <fcntl.h>
  5. #include <unistd.h>
  6. #include <errno.h>
  7. #include <string.h>
  8. #include <sys/mman.h>
  9. #include <sys/types.h>
  10. #include <sys/stat.h>
  11. //#define CLI_NCURSES
  12. #ifdef CLI_NCURSES
  13. #include "../../../../cli/cli.h"
  14. #endif
  15. #include "../../general/sitara-am437x.h"
  16. #include "pru_ctrl.h"
  17. #include "pru_cfg.h"
  18. #include "tupus_ext.h"
  19. #define PRUSS_BLOCK_SIZE 0x400000 // 4MB
  20. #define PRU_HALT_TIMEOUT 0xFFFF
  21. #define DEFAULT_PRU_SIGNAL_REACTION 5
  22. //#define PRUSS0_DATA_SIZE 0x1000
  23. //#define PRUSS0_CODE_SIZE 0x1000
  24. //#define PRUSS1_DATA_SIZE 0x2000
  25. //#define PRUSS1_CODE_SIZE 0x3000
  26. bool init_PRU_ICSS0( void );
  27. bool init_PRU_ICSS1( void );
  28. bool pru_disable( uint8_t system, uint8_t unit );
  29. bool pru_enable( uint8_t system, uint8_t unit );
  30. bool pru_clk_disable( uint8_t system, uint8_t unit );
  31. bool pru_clk_enable( uint8_t system, uint8_t unit );
  32. bool _pru_load( uint8_t system, uint8_t unit, char *fileName );
  33. bool _pru_save( uint8_t system, uint8_t unit, char *fileName );
  34. bool _pru_sreset( uint8_t system, uint8_t unit );
  35. bool _pru_run( uint8_t system, uint8_t unit );
  36. bool _pru_stop( uint8_t system, uint8_t unit );
  37. bool _pru_waitForHalt( uint8_t system, uint8_t unit );
  38. void close_PRU_ICSS0( void );
  39. void close_PRU_ICSS1( void );
  40. bool _setHost0Online( void );
  41. bool _setHost2Online( void );
  42. bool _setHost3Online( void );
  43. bool _setHost1Online( void );
  44. volatile structTUPUS *_getTUPUS(uint8_t system, uint8_t unit );
  45. volatile pruCfg *_getPRUSS_GFG( uint8_t system );
  46. volatile pruCtrl *_getPRU_CTRL( uint8_t system, uint8_t unit );
  47. void _cleanTUPUS( uint8_t system, uint8_t unit );
  48. void _setCoreOnline( uint8_t system, uint8_t unit );
  49. bool _sendCommand( uint8_t system, uint8_t unit, uint32_t cmd, uint32_t address, uint32_t data );
  50. #endif