/drivers/media/video/sun5i/sun5i_cedar.h

https://bitbucket.org/ndreys/linux-sunxi · C Header · 127 lines · 70 code · 15 blank · 42 comment · 0 complexity · a3ef7996d287acaef81d2ce96a90aa68 MD5 · raw file

  1. /*
  2. * drivers/media/video/sun5i/sun5i_cedar.h
  3. *
  4. * (C) Copyright 2007-2012
  5. * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. /*
  23. **************************************************************************************************************
  24. * eLDK
  25. * the Easy Portable/Player Develop Kits
  26. * desktop system
  27. *
  28. * (c) Copyright 2009-2012, ,HUANGXIN China
  29. * All Rights Reserved
  30. *
  31. * File : sun4i_cedar.h
  32. * By : HUANGXIN
  33. * Func :
  34. * Version : v1.0
  35. * ============================================================================================================
  36. * 2011-5-25 9:57:05 HUANGXIN create this file, implements the fundemental interface;
  37. **************************************************************************************************************
  38. */
  39. #ifndef _SUN4I_CEDAR_H_
  40. #define _SUN4I_CEDAR_H_
  41. enum IOCTL_CMD {
  42. IOCTL_UNKOWN = 0x100,
  43. IOCTL_GET_ENV_INFO,
  44. IOCTL_WAIT_VE,
  45. IOCTL_RESET_VE,
  46. IOCTL_ENABLE_VE,
  47. IOCTL_DISABLE_VE,
  48. IOCTL_SET_VE_FREQ,
  49. IOCTL_CONFIG_AVS2 = 0x200,
  50. IOCTL_GETVALUE_AVS2 ,
  51. IOCTL_PAUSE_AVS2 ,
  52. IOCTL_START_AVS2 ,
  53. IOCTL_RESET_AVS2 ,
  54. IOCTL_ADJUST_AVS2,
  55. IOCTL_ENGINE_REQ,
  56. IOCTL_ENGINE_REL,
  57. IOCTL_ENGINE_CHECK_DELAY,
  58. IOCTL_GET_IC_VER,
  59. IOCTL_ADJUST_AVS2_ABS,
  60. };
  61. struct cedarv_env_infomation{
  62. unsigned int phymem_start;
  63. int phymem_total_size;
  64. unsigned int address_macc;
  65. };
  66. struct __cedarv_task {
  67. int task_prio;
  68. int ID;
  69. unsigned long timeout;
  70. unsigned int frametime;
  71. unsigned int block_mode;
  72. };
  73. struct cedarv_engine_task {
  74. struct __cedarv_task t;
  75. struct list_head list;
  76. struct task_struct *task_handle;
  77. unsigned int status;
  78. unsigned int running;
  79. unsigned int is_first_task;
  80. };
  81. /*?????task_prio??????task?frametime??????task_prio??task????????total_time*/
  82. struct cedarv_engine_task_info {
  83. int task_prio;
  84. unsigned int frametime;
  85. unsigned int total_time;
  86. };
  87. /*--------------------------------------------------------------------------------*/
  88. #define REGS_pBASE (0x01C00000) // register base addr
  89. #define SRAM_REGS_pBASE (REGS_pBASE + 0x00000) // SRAM Controller
  90. #define CCMU_REGS_pBASE (REGS_pBASE + 0x20000) // clock manager unit
  91. #define MACC_REGS_pBASE (REGS_pBASE + 0x0E000) // media accelerate VE
  92. #define SS_REGS_pBASE (REGS_pBASE + 0x15000) // Security System
  93. #define SDRAM_REGS_pBASE (REGS_pBASE + 0x01000) // SDRAM Controller
  94. #define AVS_REGS_pBASE (REGS_pBASE + 0x20c00)
  95. #define SRAM_REGS_BASE SRAM_REGS_pBASE // SRAM Controller
  96. #define CCMU_REGS_BASE CCMU_REGS_pBASE // Clock Control manager unit OK
  97. #define MACC_REGS_BASE MACC_REGS_pBASE // Media ACCelerate
  98. #define SS_REGS_BASE SS_REGS_pBASE // Security System
  99. #define SDRAM_REGS_BASE SDRAM_REGS_pBASE //SDRAM Controller OK
  100. #define AVS_REGS_BASE AVS_REGS_pBASE
  101. #define MPEG_REGS_BASE (MACC_REGS_BASE + 0x100) // MPEG engine
  102. #define H264_REGS_BASE (MACC_REGS_BASE + 0x200) // H264 engine
  103. #define VC1_REGS_BASE (MACC_REGS_BASE + 0x300) // VC-1 engine
  104. #define SRAM_REGS_SIZE (4096) // 4K
  105. #define CCMU_REGS_SIZE (1024) // 1K
  106. #define MACC_REGS_SIZE (4096) // 4K
  107. #define SS_REGS_SIZE (4096) // 4K
  108. /*--------------------------------------------------------------------------------*/
  109. #define SRAM_REG_o_CFG (0x00)
  110. #define SRAM_REG_ADDR_CFG (SRAM_REGS_BASE + SRAM_REG_o_CFG) // SRAM MAP Cfg Reg 0
  111. /*--------------------------------------------------------------------------------*/
  112. #endif