| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/media/platform/coda/coda_regs.h |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2012 Vista Silicon SL |
|---|
| 5 | 6 | * Javier Martin <javier.martin@vista-silicon.com> |
|---|
| 6 | 7 | * Xavier Duret |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | 10 | #ifndef _REGS_CODA_H_ |
|---|
| .. | .. |
|---|
| 181 | 177 | #define CODA_RET_DEC_SEQ_FRATE_DR 0x1e8 |
|---|
| 182 | 178 | #define CODA_RET_DEC_SEQ_JPG_PARA 0x1e4 |
|---|
| 183 | 179 | #define CODA_RET_DEC_SEQ_JPG_THUMB_IND 0x1e8 |
|---|
| 184 | | -#define CODA9_RET_DEC_SEQ_HEADER_REPORT 0x1ec |
|---|
| 180 | +#define CODA7_RET_DEC_SEQ_HEADER_REPORT 0x1ec |
|---|
| 185 | 181 | |
|---|
| 186 | 182 | /* Decoder Picture Run */ |
|---|
| 187 | 183 | #define CODA_CMD_DEC_PIC_ROT_MODE 0x180 |
|---|
| .. | .. |
|---|
| 346 | 342 | #define CODA_CMD_ENC_SEQ_JPG_THUMB_SIZE 0x1a4 |
|---|
| 347 | 343 | #define CODA_CMD_ENC_SEQ_JPG_THUMB_OFFSET 0x1a8 |
|---|
| 348 | 344 | |
|---|
| 345 | +/* Encoder Parameter Change */ |
|---|
| 346 | +#define CODA_CMD_ENC_PARAM_CHANGE_ENABLE 0x180 |
|---|
| 347 | +#define CODA_PARAM_CHANGE_RC_GOP BIT(0) |
|---|
| 348 | +#define CODA_PARAM_CHANGE_RC_INTRA_QP BIT(1) |
|---|
| 349 | +#define CODA_PARAM_CHANGE_RC_BITRATE BIT(2) |
|---|
| 350 | +#define CODA_PARAM_CHANGE_RC_FRAME_RATE BIT(3) |
|---|
| 351 | +#define CODA_PARAM_CHANGE_INTRA_MB_NUM BIT(4) |
|---|
| 352 | +#define CODA_PARAM_CHANGE_SLICE_MODE BIT(5) |
|---|
| 353 | +#define CODA_PARAM_CHANGE_HEC_MODE BIT(6) |
|---|
| 354 | +#define CODA_CMD_ENC_PARAM_RC_GOP 0x184 |
|---|
| 355 | +#define CODA_CMD_ENC_PARAM_RC_INTRA_QP 0x188 |
|---|
| 356 | +#define CODA_CMD_ENC_PARAM_RC_BITRATE 0x18c |
|---|
| 357 | +#define CODA_CMD_ENC_PARAM_RC_FRAME_RATE 0x190 |
|---|
| 358 | +#define CODA_CMD_ENC_PARAM_INTRA_MB_NUM 0x194 |
|---|
| 359 | +#define CODA_CMD_ENC_PARAM_SLICE_MODE 0x198 |
|---|
| 360 | +#define CODA_CMD_ENC_PARAM_HEC_MODE 0x19c |
|---|
| 361 | +#define CODA_RET_ENC_PARAM_CHANGE_SUCCESS 0x1c0 |
|---|
| 362 | + |
|---|
| 349 | 363 | /* Encoder Picture Run */ |
|---|
| 350 | 364 | #define CODA9_CMD_ENC_PIC_SRC_INDEX 0x180 |
|---|
| 351 | 365 | #define CODA9_CMD_ENC_PIC_SRC_STRIDE 0x184 |
|---|
| .. | .. |
|---|
| 437 | 451 | #define CODA9_CMD_FIRMWARE_CODE_REV 0x1c4 |
|---|
| 438 | 452 | |
|---|
| 439 | 453 | #define CODA9_GDMA_BASE 0x1000 |
|---|
| 454 | +#define CODA9_GDI_CONTROL (CODA9_GDMA_BASE + 0x034) |
|---|
| 455 | +#define CODA9_GDI_PIC_INIT_HOST (CODA9_GDMA_BASE + 0x038) |
|---|
| 456 | +#define CODA9_GDI_STATUS (CODA9_GDMA_BASE + 0x080) |
|---|
| 440 | 457 | #define CODA9_GDI_WPROT_ERR_CLR (CODA9_GDMA_BASE + 0x0a0) |
|---|
| 441 | 458 | #define CODA9_GDI_WPROT_RGN_EN (CODA9_GDMA_BASE + 0x0ac) |
|---|
| 442 | 459 | |
|---|
| 443 | 460 | #define CODA9_GDI_BUS_CTRL (CODA9_GDMA_BASE + 0x0f0) |
|---|
| 444 | 461 | #define CODA9_GDI_BUS_STATUS (CODA9_GDMA_BASE + 0x0f4) |
|---|
| 462 | + |
|---|
| 463 | +#define CODA9_GDI_INFO_CONTROL (CODA9_GDMA_BASE + 0x400) |
|---|
| 464 | +#define CODA9_GDI_INFO_PIC_SIZE (CODA9_GDMA_BASE + 0x404) |
|---|
| 465 | +#define CODA9_GDI_INFO_BASE_Y (CODA9_GDMA_BASE + 0x408) |
|---|
| 466 | +#define CODA9_GDI_INFO_BASE_CB (CODA9_GDMA_BASE + 0x40c) |
|---|
| 467 | +#define CODA9_GDI_INFO_BASE_CR (CODA9_GDMA_BASE + 0x410) |
|---|
| 445 | 468 | |
|---|
| 446 | 469 | #define CODA9_GDI_XY2_CAS_0 (CODA9_GDMA_BASE + 0x800) |
|---|
| 447 | 470 | #define CODA9_GDI_XY2_CAS_F (CODA9_GDMA_BASE + 0x83c) |
|---|
| .. | .. |
|---|
| 463 | 486 | #define CODA9_GDI_RBC2_AXI_1F (CODA9_GDMA_BASE + 0x91c) |
|---|
| 464 | 487 | #define CODA9_GDI_TILEDBUF_BASE (CODA9_GDMA_BASE + 0x920) |
|---|
| 465 | 488 | |
|---|
| 489 | +#define CODA9_JPEG_BASE 0x3000 |
|---|
| 490 | +#define CODA9_REG_JPEG_PIC_START (CODA9_JPEG_BASE + 0x000) |
|---|
| 491 | +#define CODA9_REG_JPEG_PIC_STATUS (CODA9_JPEG_BASE + 0x004) |
|---|
| 492 | +#define CODA9_JPEG_STATUS_OVERFLOW BIT(3) |
|---|
| 493 | +#define CODA9_JPEG_STATUS_BBC_INT BIT(2) |
|---|
| 494 | +#define CODA9_JPEG_STATUS_ERROR BIT(1) |
|---|
| 495 | +#define CODA9_JPEG_STATUS_DONE BIT(0) |
|---|
| 496 | +#define CODA9_REG_JPEG_PIC_ERRMB (CODA9_JPEG_BASE + 0x008) |
|---|
| 497 | +#define CODA9_JPEG_ERRMB_RESTART_IDX_MASK (0xf << 24) |
|---|
| 498 | +#define CODA9_JPEG_ERRMB_MCU_POS_X_MASK (0xfff << 12) |
|---|
| 499 | +#define CODA9_JPEG_ERRMB_MCU_POS_Y_MASK 0xfff |
|---|
| 500 | +#define CODA9_REG_JPEG_PIC_CTRL (CODA9_JPEG_BASE + 0x010) |
|---|
| 501 | +#define CODA9_JPEG_PIC_CTRL_USER_HUFFMAN_EN BIT(6) |
|---|
| 502 | +#define CODA9_JPEG_PIC_CTRL_TC_DIRECTION BIT(4) |
|---|
| 503 | +#define CODA9_JPEG_PIC_CTRL_ENCODER_EN BIT(3) |
|---|
| 504 | +#define CODA9_REG_JPEG_PIC_SIZE (CODA9_JPEG_BASE + 0x014) |
|---|
| 505 | +#define CODA9_REG_JPEG_MCU_INFO (CODA9_JPEG_BASE + 0x018) |
|---|
| 506 | +#define CODA9_JPEG_MCU_BLOCK_NUM_OFFSET 16 |
|---|
| 507 | +#define CODA9_JPEG_COMP_NUM_OFFSET 12 |
|---|
| 508 | +#define CODA9_JPEG_COMP0_INFO_OFFSET 8 |
|---|
| 509 | +#define CODA9_JPEG_COMP1_INFO_OFFSET 4 |
|---|
| 510 | +#define CODA9_JPEG_COMP2_INFO_OFFSET 0 |
|---|
| 511 | +#define CODA9_REG_JPEG_ROT_INFO (CODA9_JPEG_BASE + 0x01c) |
|---|
| 512 | +#define CODA9_JPEG_ROT_MIR_ENABLE BIT(4) |
|---|
| 513 | +#define CODA9_JPEG_ROT_MIR_MODE_MASK 0xf |
|---|
| 514 | +#define CODA9_REG_JPEG_SCL_INFO (CODA9_JPEG_BASE + 0x020) |
|---|
| 515 | +#define CODA9_JPEG_SCL_ENABLE BIT(4) |
|---|
| 516 | +#define CODA9_JPEG_SCL_HOR_MODE_MASK (0x3 << 2) |
|---|
| 517 | +#define CODA9_JPEG_SCL_VER_MODE_MASK (0x3 << 0) |
|---|
| 518 | +#define CODA9_REG_JPEG_IF_INFO (CODA9_JPEG_BASE + 0x024) |
|---|
| 519 | +#define CODA9_JPEG_SENS_IF_CLR BIT(1) |
|---|
| 520 | +#define CODA9_JPEG_DISP_IF_CLR BIT(0) |
|---|
| 521 | +#define CODA9_REG_JPEG_OP_INFO (CODA9_JPEG_BASE + 0x02c) |
|---|
| 522 | +#define CODA9_JPEG_BUS_REQ_NUM_OFFSET 0 |
|---|
| 523 | +#define CODA9_JPEG_BUS_REQ_NUM_MASK 0x7 |
|---|
| 524 | +#define CODA9_REG_JPEG_DPB_CONFIG (CODA9_JPEG_BASE + 0x030) |
|---|
| 525 | +#define CODA9_REG_JPEG_DPB_BASE00 (CODA9_JPEG_BASE + 0x040) |
|---|
| 526 | +#define CODA9_REG_JPEG_HUFF_CTRL (CODA9_JPEG_BASE + 0x080) |
|---|
| 527 | +#define CODA9_REG_JPEG_HUFF_ADDR (CODA9_JPEG_BASE + 0x084) |
|---|
| 528 | +#define CODA9_REG_JPEG_HUFF_DATA (CODA9_JPEG_BASE + 0x088) |
|---|
| 529 | +#define CODA9_REG_JPEG_QMAT_CTRL (CODA9_JPEG_BASE + 0x090) |
|---|
| 530 | +#define CODA9_REG_JPEG_QMAT_ADDR (CODA9_JPEG_BASE + 0x094) |
|---|
| 531 | +#define CODA9_REG_JPEG_QMAT_DATA (CODA9_JPEG_BASE + 0x098) |
|---|
| 532 | +#define CODA9_REG_JPEG_RST_INTVAL (CODA9_JPEG_BASE + 0x0b0) |
|---|
| 533 | +#define CODA9_REG_JPEG_RST_INDEX (CODA9_JPEG_BASE + 0x0b4) |
|---|
| 534 | +#define CODA9_REG_JPEG_RST_COUNT (CODA9_JPEG_BASE + 0x0b8) |
|---|
| 535 | +#define CODA9_REG_JPEG_DPCM_DIFF_Y (CODA9_JPEG_BASE + 0x0f0) |
|---|
| 536 | +#define CODA9_REG_JPEG_DPCM_DIFF_CB (CODA9_JPEG_BASE + 0x0f4) |
|---|
| 537 | +#define CODA9_REG_JPEG_DPCM_DIFF_CR (CODA9_JPEG_BASE + 0x0f8) |
|---|
| 538 | +#define CODA9_REG_JPEG_GBU_CTRL (CODA9_JPEG_BASE + 0x100) |
|---|
| 539 | +#define CODA9_REG_JPEG_GBU_BT_PTR (CODA9_JPEG_BASE + 0x110) |
|---|
| 540 | +#define CODA9_REG_JPEG_GBU_WD_PTR (CODA9_JPEG_BASE + 0x114) |
|---|
| 541 | +#define CODA9_REG_JPEG_GBU_TT_CNT (CODA9_JPEG_BASE + 0x118) |
|---|
| 542 | +#define CODA9_REG_JPEG_GBU_BBSR (CODA9_JPEG_BASE + 0x140) |
|---|
| 543 | +#define CODA9_REG_JPEG_GBU_BBER (CODA9_JPEG_BASE + 0x144) |
|---|
| 544 | +#define CODA9_REG_JPEG_GBU_BBIR (CODA9_JPEG_BASE + 0x148) |
|---|
| 545 | +#define CODA9_REG_JPEG_GBU_BBHR (CODA9_JPEG_BASE + 0x14c) |
|---|
| 546 | +#define CODA9_REG_JPEG_GBU_BCNT (CODA9_JPEG_BASE + 0x158) |
|---|
| 547 | +#define CODA9_REG_JPEG_GBU_FF_RPTR (CODA9_JPEG_BASE + 0x160) |
|---|
| 548 | +#define CODA9_REG_JPEG_GBU_FF_WPTR (CODA9_JPEG_BASE + 0x164) |
|---|
| 549 | +#define CODA9_REG_JPEG_BBC_END_ADDR (CODA9_JPEG_BASE + 0x208) |
|---|
| 550 | +#define CODA9_REG_JPEG_BBC_WR_PTR (CODA9_JPEG_BASE + 0x20c) |
|---|
| 551 | +#define CODA9_REG_JPEG_BBC_RD_PTR (CODA9_JPEG_BASE + 0x210) |
|---|
| 552 | +#define CODA9_REG_JPEG_BBC_EXT_ADDR (CODA9_JPEG_BASE + 0x214) |
|---|
| 553 | +#define CODA9_REG_JPEG_BBC_INT_ADDR (CODA9_JPEG_BASE + 0x218) |
|---|
| 554 | +#define CODA9_REG_JPEG_BBC_DATA_CNT (CODA9_JPEG_BASE + 0x21c) |
|---|
| 555 | +#define CODA9_REG_JPEG_BBC_COMMAND (CODA9_JPEG_BASE + 0x220) |
|---|
| 556 | +#define CODA9_REG_JPEG_BBC_BUSY (CODA9_JPEG_BASE + 0x224) |
|---|
| 557 | +#define CODA9_REG_JPEG_BBC_CTRL (CODA9_JPEG_BASE + 0x228) |
|---|
| 558 | +#define CODA9_REG_JPEG_BBC_CUR_POS (CODA9_JPEG_BASE + 0x22c) |
|---|
| 559 | +#define CODA9_REG_JPEG_BBC_BAS_ADDR (CODA9_JPEG_BASE + 0x230) |
|---|
| 560 | +#define CODA9_REG_JPEG_BBC_STRM_CTRL (CODA9_JPEG_BASE + 0x234) |
|---|
| 561 | +#define CODA9_REG_JPEG_BBC_FLUSH_CMD (CODA9_JPEG_BASE + 0x238) |
|---|
| 562 | + |
|---|
| 466 | 563 | #endif |
|---|