| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. |
|---|
| 3 | 4 | * Copyright (C) 2017 Linaro Ltd. |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License version 2 and |
|---|
| 7 | | - * only version 2 as published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | | - * |
|---|
| 14 | 5 | */ |
|---|
| 15 | 6 | #ifndef __VENUS_HFI_VENUS_IO_H__ |
|---|
| 16 | 7 | #define __VENUS_HFI_VENUS_IO_H__ |
|---|
| 17 | 8 | |
|---|
| 18 | 9 | #define VBIF_BASE 0x80000 |
|---|
| 19 | 10 | |
|---|
| 20 | | -#define VBIF_AXI_HALT_CTRL0 (VBIF_BASE + 0x208) |
|---|
| 21 | | -#define VBIF_AXI_HALT_CTRL1 (VBIF_BASE + 0x20c) |
|---|
| 11 | +#define VBIF_AXI_HALT_CTRL0 0x208 |
|---|
| 12 | +#define VBIF_AXI_HALT_CTRL1 0x20c |
|---|
| 22 | 13 | |
|---|
| 23 | 14 | #define VBIF_AXI_HALT_CTRL0_HALT_REQ BIT(0) |
|---|
| 24 | 15 | #define VBIF_AXI_HALT_CTRL1_HALT_ACK BIT(0) |
|---|
| 25 | 16 | #define VBIF_AXI_HALT_ACK_TIMEOUT_US 500000 |
|---|
| 26 | 17 | |
|---|
| 27 | 18 | #define CPU_BASE 0xc0000 |
|---|
| 19 | + |
|---|
| 28 | 20 | #define CPU_CS_BASE (CPU_BASE + 0x12000) |
|---|
| 29 | 21 | #define CPU_IC_BASE (CPU_BASE + 0x1f000) |
|---|
| 30 | 22 | |
|---|
| 31 | | -#define CPU_CS_A2HSOFTINTCLR (CPU_CS_BASE + 0x1c) |
|---|
| 23 | +#define CPU_CS_A2HSOFTINTCLR 0x1c |
|---|
| 32 | 24 | |
|---|
| 33 | | -#define VIDC_CTRL_INIT (CPU_CS_BASE + 0x48) |
|---|
| 25 | +#define VIDC_CTRL_INIT 0x48 |
|---|
| 34 | 26 | #define VIDC_CTRL_INIT_RESERVED_BITS31_1_MASK 0xfffffffe |
|---|
| 35 | 27 | #define VIDC_CTRL_INIT_RESERVED_BITS31_1_SHIFT 1 |
|---|
| 36 | 28 | #define VIDC_CTRL_INIT_CTRL_MASK 0x1 |
|---|
| 37 | 29 | #define VIDC_CTRL_INIT_CTRL_SHIFT 0 |
|---|
| 38 | 30 | |
|---|
| 39 | 31 | /* HFI control status */ |
|---|
| 40 | | -#define CPU_CS_SCIACMDARG0 (CPU_CS_BASE + 0x4c) |
|---|
| 32 | +#define CPU_CS_SCIACMDARG0 0x4c |
|---|
| 41 | 33 | #define CPU_CS_SCIACMDARG0_MASK 0xff |
|---|
| 42 | 34 | #define CPU_CS_SCIACMDARG0_SHIFT 0x0 |
|---|
| 43 | 35 | #define CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK 0xfe |
|---|
| .. | .. |
|---|
| 48 | 40 | #define CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK BIT(30) |
|---|
| 49 | 41 | |
|---|
| 50 | 42 | /* HFI queue table info */ |
|---|
| 51 | | -#define CPU_CS_SCIACMDARG1 (CPU_CS_BASE + 0x50) |
|---|
| 43 | +#define CPU_CS_SCIACMDARG1 0x50 |
|---|
| 52 | 44 | |
|---|
| 53 | 45 | /* HFI queue table address */ |
|---|
| 54 | | -#define CPU_CS_SCIACMDARG2 (CPU_CS_BASE + 0x54) |
|---|
| 46 | +#define CPU_CS_SCIACMDARG2 0x54 |
|---|
| 55 | 47 | |
|---|
| 56 | 48 | /* Venus cpu */ |
|---|
| 57 | | -#define CPU_CS_SCIACMDARG3 (CPU_CS_BASE + 0x58) |
|---|
| 49 | +#define CPU_CS_SCIACMDARG3 0x58 |
|---|
| 58 | 50 | |
|---|
| 59 | | -#define SFR_ADDR (CPU_CS_BASE + 0x5c) |
|---|
| 60 | | -#define MMAP_ADDR (CPU_CS_BASE + 0x60) |
|---|
| 61 | | -#define UC_REGION_ADDR (CPU_CS_BASE + 0x64) |
|---|
| 62 | | -#define UC_REGION_SIZE (CPU_CS_BASE + 0x68) |
|---|
| 51 | +#define SFR_ADDR 0x5c |
|---|
| 52 | +#define MMAP_ADDR 0x60 |
|---|
| 53 | +#define UC_REGION_ADDR 0x64 |
|---|
| 54 | +#define UC_REGION_SIZE 0x68 |
|---|
| 63 | 55 | |
|---|
| 64 | | -#define CPU_IC_SOFTINT (CPU_IC_BASE + 0x18) |
|---|
| 56 | +#define CPU_CS_H2XSOFTINTEN_V6 0x148 |
|---|
| 57 | + |
|---|
| 58 | +#define CPU_CS_X2RPMH_V6 0x168 |
|---|
| 59 | +#define CPU_CS_X2RPMH_MASK0_BMSK_V6 0x1 |
|---|
| 60 | +#define CPU_CS_X2RPMH_MASK0_SHFT_V6 0x0 |
|---|
| 61 | +#define CPU_CS_X2RPMH_MASK1_BMSK_V6 0x2 |
|---|
| 62 | +#define CPU_CS_X2RPMH_MASK1_SHFT_V6 0x1 |
|---|
| 63 | +#define CPU_CS_X2RPMH_SWOVERRIDE_BMSK_V6 0x4 |
|---|
| 64 | +#define CPU_CS_X2RPMH_SWOVERRIDE_SHFT_V6 0x3 |
|---|
| 65 | + |
|---|
| 66 | +/* Relative to CPU_IC_BASE */ |
|---|
| 67 | +#define CPU_IC_SOFTINT 0x18 |
|---|
| 68 | +#define CPU_IC_SOFTINT_V6 0x150 |
|---|
| 65 | 69 | #define CPU_IC_SOFTINT_H2A_MASK 0x8000 |
|---|
| 66 | 70 | #define CPU_IC_SOFTINT_H2A_SHIFT 0xf |
|---|
| 71 | +#define CPU_IC_SOFTINT_H2A_SHIFT_V6 0x0 |
|---|
| 67 | 72 | |
|---|
| 68 | 73 | /* Venus wrapper */ |
|---|
| 69 | 74 | #define WRAPPER_BASE 0x000e0000 |
|---|
| 70 | 75 | |
|---|
| 71 | | -#define WRAPPER_HW_VERSION (WRAPPER_BASE + 0x00) |
|---|
| 76 | +#define WRAPPER_HW_VERSION 0x00 |
|---|
| 72 | 77 | #define WRAPPER_HW_VERSION_MAJOR_VERSION_MASK 0x78000000 |
|---|
| 73 | 78 | #define WRAPPER_HW_VERSION_MAJOR_VERSION_SHIFT 28 |
|---|
| 74 | 79 | #define WRAPPER_HW_VERSION_MINOR_VERSION_MASK 0xfff0000 |
|---|
| 75 | 80 | #define WRAPPER_HW_VERSION_MINOR_VERSION_SHIFT 16 |
|---|
| 76 | 81 | #define WRAPPER_HW_VERSION_STEP_VERSION_MASK 0xffff |
|---|
| 77 | 82 | |
|---|
| 78 | | -#define WRAPPER_CLOCK_CONFIG (WRAPPER_BASE + 0x04) |
|---|
| 83 | +#define WRAPPER_CLOCK_CONFIG 0x04 |
|---|
| 79 | 84 | |
|---|
| 80 | | -#define WRAPPER_INTR_STATUS (WRAPPER_BASE + 0x0c) |
|---|
| 85 | +#define WRAPPER_INTR_STATUS 0x0c |
|---|
| 81 | 86 | #define WRAPPER_INTR_STATUS_A2HWD_MASK 0x10 |
|---|
| 82 | 87 | #define WRAPPER_INTR_STATUS_A2HWD_SHIFT 0x4 |
|---|
| 83 | 88 | #define WRAPPER_INTR_STATUS_A2H_MASK 0x4 |
|---|
| 84 | 89 | #define WRAPPER_INTR_STATUS_A2H_SHIFT 0x2 |
|---|
| 85 | 90 | |
|---|
| 86 | | -#define WRAPPER_INTR_MASK (WRAPPER_BASE + 0x10) |
|---|
| 91 | +#define WRAPPER_INTR_MASK 0x10 |
|---|
| 87 | 92 | #define WRAPPER_INTR_MASK_A2HWD_BASK 0x10 |
|---|
| 88 | 93 | #define WRAPPER_INTR_MASK_A2HWD_SHIFT 0x4 |
|---|
| 89 | 94 | #define WRAPPER_INTR_MASK_A2HVCODEC_MASK 0x8 |
|---|
| .. | .. |
|---|
| 91 | 96 | #define WRAPPER_INTR_MASK_A2HCPU_MASK 0x4 |
|---|
| 92 | 97 | #define WRAPPER_INTR_MASK_A2HCPU_SHIFT 0x2 |
|---|
| 93 | 98 | |
|---|
| 94 | | -#define WRAPPER_INTR_CLEAR (WRAPPER_BASE + 0x14) |
|---|
| 99 | +#define WRAPPER_INTR_STATUS_A2HWD_MASK_V6 0x8 |
|---|
| 100 | +#define WRAPPER_INTR_MASK_A2HWD_BASK_V6 0x8 |
|---|
| 101 | + |
|---|
| 102 | +#define WRAPPER_INTR_CLEAR 0x14 |
|---|
| 95 | 103 | #define WRAPPER_INTR_CLEAR_A2HWD_MASK 0x10 |
|---|
| 96 | 104 | #define WRAPPER_INTR_CLEAR_A2HWD_SHIFT 0x4 |
|---|
| 97 | 105 | #define WRAPPER_INTR_CLEAR_A2H_MASK 0x4 |
|---|
| 98 | 106 | #define WRAPPER_INTR_CLEAR_A2H_SHIFT 0x2 |
|---|
| 99 | 107 | |
|---|
| 100 | | -#define WRAPPER_POWER_STATUS (WRAPPER_BASE + 0x44) |
|---|
| 101 | | -#define WRAPPER_VDEC_VCODEC_POWER_CONTROL (WRAPPER_BASE + 0x48) |
|---|
| 102 | | -#define WRAPPER_VENC_VCODEC_POWER_CONTROL (WRAPPER_BASE + 0x4c) |
|---|
| 103 | | -#define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET (WRAPPER_BASE + 0x64) |
|---|
| 108 | +#define WRAPPER_POWER_STATUS 0x44 |
|---|
| 109 | +#define WRAPPER_VDEC_VCODEC_POWER_CONTROL 0x48 |
|---|
| 110 | +#define WRAPPER_VENC_VCODEC_POWER_CONTROL 0x4c |
|---|
| 111 | +#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6 0x54 |
|---|
| 112 | +#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6 0x58 |
|---|
| 113 | +#define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET 0x64 |
|---|
| 104 | 114 | |
|---|
| 105 | | -#define WRAPPER_CPU_CLOCK_CONFIG (WRAPPER_BASE + 0x2000) |
|---|
| 106 | | -#define WRAPPER_CPU_AXI_HALT (WRAPPER_BASE + 0x2008) |
|---|
| 115 | +#define WRAPPER_CPU_CLOCK_CONFIG 0x2000 |
|---|
| 116 | +#define WRAPPER_CPU_AXI_HALT 0x2008 |
|---|
| 107 | 117 | #define WRAPPER_CPU_AXI_HALT_HALT BIT(16) |
|---|
| 108 | | -#define WRAPPER_CPU_AXI_HALT_STATUS (WRAPPER_BASE + 0x200c) |
|---|
| 118 | +#define WRAPPER_CPU_AXI_HALT_STATUS 0x200c |
|---|
| 109 | 119 | #define WRAPPER_CPU_AXI_HALT_STATUS_IDLE BIT(24) |
|---|
| 110 | 120 | |
|---|
| 111 | | -#define WRAPPER_CPU_CGC_DIS (WRAPPER_BASE + 0x2010) |
|---|
| 112 | | -#define WRAPPER_CPU_STATUS (WRAPPER_BASE + 0x2014) |
|---|
| 121 | +#define WRAPPER_CPU_CGC_DIS 0x2010 |
|---|
| 122 | +#define WRAPPER_CPU_STATUS 0x2014 |
|---|
| 113 | 123 | #define WRAPPER_CPU_STATUS_WFI BIT(0) |
|---|
| 114 | | -#define WRAPPER_SW_RESET (WRAPPER_BASE + 0x3000) |
|---|
| 124 | +#define WRAPPER_SW_RESET 0x3000 |
|---|
| 125 | +#define WRAPPER_CPA_START_ADDR 0x1020 |
|---|
| 126 | +#define WRAPPER_CPA_END_ADDR 0x1024 |
|---|
| 127 | +#define WRAPPER_FW_START_ADDR 0x1028 |
|---|
| 128 | +#define WRAPPER_FW_END_ADDR 0x102C |
|---|
| 129 | +#define WRAPPER_NONPIX_START_ADDR 0x1030 |
|---|
| 130 | +#define WRAPPER_NONPIX_END_ADDR 0x1034 |
|---|
| 131 | +#define WRAPPER_A9SS_SW_RESET 0x3000 |
|---|
| 132 | +#define WRAPPER_A9SS_SW_RESET_BIT BIT(4) |
|---|
| 115 | 133 | |
|---|
| 116 | 134 | /* Venus 4xx */ |
|---|
| 117 | | -#define WRAPPER_VCODEC0_MMCC_POWER_STATUS (WRAPPER_BASE + 0x90) |
|---|
| 118 | | -#define WRAPPER_VCODEC0_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x94) |
|---|
| 135 | +#define WRAPPER_VCODEC0_MMCC_POWER_STATUS 0x90 |
|---|
| 136 | +#define WRAPPER_VCODEC0_MMCC_POWER_CONTROL 0x94 |
|---|
| 119 | 137 | |
|---|
| 120 | | -#define WRAPPER_VCODEC1_MMCC_POWER_STATUS (WRAPPER_BASE + 0x110) |
|---|
| 121 | | -#define WRAPPER_VCODEC1_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x114) |
|---|
| 138 | +#define WRAPPER_VCODEC1_MMCC_POWER_STATUS 0x110 |
|---|
| 139 | +#define WRAPPER_VCODEC1_MMCC_POWER_CONTROL 0x114 |
|---|
| 140 | + |
|---|
| 141 | +/* Venus 6xx */ |
|---|
| 142 | +#define WRAPPER_CORE_POWER_STATUS_V6 0x80 |
|---|
| 143 | +#define WRAPPER_CORE_POWER_CONTROL_V6 0x84 |
|---|
| 144 | + |
|---|
| 145 | +/* Wrapper TZ 6xx */ |
|---|
| 146 | +#define WRAPPER_TZ_BASE_V6 0x000c0000 |
|---|
| 147 | +#define WRAPPER_TZ_CPU_STATUS_V6 0x10 |
|---|
| 148 | + |
|---|
| 149 | +/* Venus AON */ |
|---|
| 150 | +#define AON_BASE_V6 0x000e0000 |
|---|
| 151 | +#define AON_WRAPPER_MVP_NOC_LPI_CONTROL 0x00 |
|---|
| 152 | +#define AON_WRAPPER_MVP_NOC_LPI_STATUS 0x04 |
|---|
| 122 | 153 | |
|---|
| 123 | 154 | #endif |
|---|