18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (c) 2017 Samsung Electronics Co., Ltd. 58c2ecf20Sopenharmony_ci * http://www.samsung.com/ 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Register definition file for Samsung MFC V10.x Interface (FIMV) driver 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef _REGS_MFC_V10_H 128c2ecf20Sopenharmony_ci#define _REGS_MFC_V10_H 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include <linux/sizes.h> 158c2ecf20Sopenharmony_ci#include "regs-mfc-v8.h" 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* MFCv10 register definitions*/ 188c2ecf20Sopenharmony_ci#define S5P_FIMV_MFC_CLOCK_OFF_V10 0x7120 198c2ecf20Sopenharmony_ci#define S5P_FIMV_MFC_STATE_V10 0x7124 208c2ecf20Sopenharmony_ci#define S5P_FIMV_D_STATIC_BUFFER_ADDR_V10 0xF570 218c2ecf20Sopenharmony_ci#define S5P_FIMV_D_STATIC_BUFFER_SIZE_V10 0xF574 228c2ecf20Sopenharmony_ci#define S5P_FIMV_E_NUM_T_LAYER_V10 0xFBAC 238c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER0_V10 0xFBB0 248c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER1_V10 0xFBB4 258c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER2_V10 0xFBB8 268c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER3_V10 0xFBBC 278c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER4_V10 0xFBC0 288c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER5_V10 0xFBC4 298c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_QP_LAYER6_V10 0xFBC8 308c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER0_V10 0xFD18 318c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER1_V10 0xFD1C 328c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER2_V10 0xFD20 338c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER3_V10 0xFD24 348c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER4_V10 0xFD28 358c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER5_V10 0xFD2C 368c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HIERARCHICAL_BIT_RATE_LAYER6_V10 0xFD30 378c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HEVC_OPTIONS_V10 0xFDD4 388c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HEVC_REFRESH_PERIOD_V10 0xFDD8 398c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HEVC_CHROMA_QP_OFFSET_V10 0xFDDC 408c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HEVC_LF_BETA_OFFSET_DIV2_V10 0xFDE0 418c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HEVC_LF_TC_OFFSET_DIV2_V10 0xFDE4 428c2ecf20Sopenharmony_ci#define S5P_FIMV_E_HEVC_NAL_CONTROL_V10 0xFDE8 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci/* MFCv10 Context buffer sizes */ 458c2ecf20Sopenharmony_ci#define MFC_CTX_BUF_SIZE_V10 (30 * SZ_1K) 468c2ecf20Sopenharmony_ci#define MFC_H264_DEC_CTX_BUF_SIZE_V10 (2 * SZ_1M) 478c2ecf20Sopenharmony_ci#define MFC_OTHER_DEC_CTX_BUF_SIZE_V10 (20 * SZ_1K) 488c2ecf20Sopenharmony_ci#define MFC_H264_ENC_CTX_BUF_SIZE_V10 (100 * SZ_1K) 498c2ecf20Sopenharmony_ci#define MFC_HEVC_ENC_CTX_BUF_SIZE_V10 (30 * SZ_1K) 508c2ecf20Sopenharmony_ci#define MFC_OTHER_ENC_CTX_BUF_SIZE_V10 (15 * SZ_1K) 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci/* MFCv10 variant defines */ 538c2ecf20Sopenharmony_ci#define MAX_FW_SIZE_V10 (SZ_1M) 548c2ecf20Sopenharmony_ci#define MAX_CPB_SIZE_V10 (3 * SZ_1M) 558c2ecf20Sopenharmony_ci#define MFC_VERSION_V10 0xA0 568c2ecf20Sopenharmony_ci#define MFC_NUM_PORTS_V10 1 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci/* MFCv10 codec defines*/ 598c2ecf20Sopenharmony_ci#define S5P_FIMV_CODEC_HEVC_DEC 17 608c2ecf20Sopenharmony_ci#define S5P_FIMV_CODEC_VP9_DEC 18 618c2ecf20Sopenharmony_ci#define S5P_FIMV_CODEC_HEVC_ENC 26 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci/* Decoder buffer size for MFC v10 */ 648c2ecf20Sopenharmony_ci#define DEC_VP9_STATIC_BUFFER_SIZE 20480 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci/* Encoder buffer size for MFC v10.0 */ 678c2ecf20Sopenharmony_ci#define ENC_V100_BASE_SIZE(x, y) \ 688c2ecf20Sopenharmony_ci (((x + 3) * (y + 3) * 8) \ 698c2ecf20Sopenharmony_ci + ((y * 64) + 1280) * DIV_ROUND_UP(x, 8)) 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci#define ENC_V100_H264_ME_SIZE(x, y) \ 728c2ecf20Sopenharmony_ci (ENC_V100_BASE_SIZE(x, y) \ 738c2ecf20Sopenharmony_ci + (DIV_ROUND_UP(x * y, 64) * 32)) 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci#define ENC_V100_MPEG4_ME_SIZE(x, y) \ 768c2ecf20Sopenharmony_ci (ENC_V100_BASE_SIZE(x, y) \ 778c2ecf20Sopenharmony_ci + (DIV_ROUND_UP(x * y, 128) * 16)) 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci#define ENC_V100_VP8_ME_SIZE(x, y) \ 808c2ecf20Sopenharmony_ci ENC_V100_BASE_SIZE(x, y) 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci#define ENC_V100_HEVC_ME_SIZE(x, y) \ 838c2ecf20Sopenharmony_ci (((x + 3) * (y + 3) * 32) \ 848c2ecf20Sopenharmony_ci + ((y * 128) + 1280) * DIV_ROUND_UP(x, 4)) 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci#endif /*_REGS_MFC_V10_H*/ 878c2ecf20Sopenharmony_ci 88