linux/drivers/gpu/drm/lima/lima_regs.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright 2010-2017 ARM Limited. All rights reserved.
 * Copyright 2017-2019 Qiang Yu <[email protected]>
 */

#ifndef __LIMA_REGS_H__
#define __LIMA_REGS_H__

/* This file's register definition is collected from the
 * official ARM Mali Utgard GPU kernel driver source code
 */

/* PMU regs */
#define LIMA_PMU_POWER_UP
#define LIMA_PMU_POWER_DOWN
#define LIMA_PMU_POWER_GP0_MASK
#define LIMA_PMU_POWER_L2_MASK
#define LIMA_PMU_POWER_PP_MASK(i)

/*
 * On Mali450 each block automatically starts up its corresponding L2
 * and the PPs are not fully independent controllable.
 * Instead PP0, PP1-3 and PP4-7 can be turned on or off.
 */
#define LIMA450_PMU_POWER_PP0_MASK
#define LIMA450_PMU_POWER_PP13_MASK
#define LIMA450_PMU_POWER_PP47_MASK

#define LIMA_PMU_STATUS
#define LIMA_PMU_INT_MASK
#define LIMA_PMU_INT_RAWSTAT
#define LIMA_PMU_INT_CLEAR
#define LIMA_PMU_INT_CMD_MASK
#define LIMA_PMU_SW_DELAY

/* L2 cache regs */
#define LIMA_L2_CACHE_SIZE
#define LIMA_L2_CACHE_STATUS
#define LIMA_L2_CACHE_STATUS_COMMAND_BUSY
#define LIMA_L2_CACHE_STATUS_DATA_BUSY
#define LIMA_L2_CACHE_COMMAND
#define LIMA_L2_CACHE_COMMAND_CLEAR_ALL
#define LIMA_L2_CACHE_CLEAR_PAGE
#define LIMA_L2_CACHE_MAX_READS
#define LIMA_L2_CACHE_ENABLE
#define LIMA_L2_CACHE_ENABLE_ACCESS
#define LIMA_L2_CACHE_ENABLE_READ_ALLOCATE
#define LIMA_L2_CACHE_PERFCNT_SRC0
#define LIMA_L2_CACHE_PERFCNT_VAL0
#define LIMA_L2_CACHE_PERFCNT_SRC1
#define LIMA_L2_CACHE_ERFCNT_VAL1

/* GP regs */
#define LIMA_GP_VSCL_START_ADDR
#define LIMA_GP_VSCL_END_ADDR
#define LIMA_GP_PLBUCL_START_ADDR
#define LIMA_GP_PLBUCL_END_ADDR
#define LIMA_GP_PLBU_ALLOC_START_ADDR
#define LIMA_GP_PLBU_ALLOC_END_ADDR
#define LIMA_GP_CMD
#define LIMA_GP_CMD_START_VS
#define LIMA_GP_CMD_START_PLBU
#define LIMA_GP_CMD_UPDATE_PLBU_ALLOC
#define LIMA_GP_CMD_RESET
#define LIMA_GP_CMD_FORCE_HANG
#define LIMA_GP_CMD_STOP_BUS
#define LIMA_GP_CMD_SOFT_RESET
#define LIMA_GP_INT_RAWSTAT
#define LIMA_GP_INT_CLEAR
#define LIMA_GP_INT_MASK
#define LIMA_GP_INT_STAT
#define LIMA_GP_IRQ_VS_END_CMD_LST
#define LIMA_GP_IRQ_PLBU_END_CMD_LST
#define LIMA_GP_IRQ_PLBU_OUT_OF_MEM
#define LIMA_GP_IRQ_VS_SEM_IRQ
#define LIMA_GP_IRQ_PLBU_SEM_IRQ
#define LIMA_GP_IRQ_HANG
#define LIMA_GP_IRQ_FORCE_HANG
#define LIMA_GP_IRQ_PERF_CNT_0_LIMIT
#define LIMA_GP_IRQ_PERF_CNT_1_LIMIT
#define LIMA_GP_IRQ_WRITE_BOUND_ERR
#define LIMA_GP_IRQ_SYNC_ERROR
#define LIMA_GP_IRQ_AXI_BUS_ERROR
#define LIMA_GP_IRQ_AXI_BUS_STOPPED
#define LIMA_GP_IRQ_VS_INVALID_CMD
#define LIMA_GP_IRQ_PLB_INVALID_CMD
#define LIMA_GP_IRQ_RESET_COMPLETED
#define LIMA_GP_IRQ_SEMAPHORE_UNDERFLOW
#define LIMA_GP_IRQ_SEMAPHORE_OVERFLOW
#define LIMA_GP_IRQ_PTR_ARRAY_OUT_OF_BOUNDS
#define LIMA_GP_WRITE_BOUND_LOW
#define LIMA_GP_PERF_CNT_0_ENABLE
#define LIMA_GP_PERF_CNT_1_ENABLE
#define LIMA_GP_PERF_CNT_0_SRC
#define LIMA_GP_PERF_CNT_1_SRC
#define LIMA_GP_PERF_CNT_0_VALUE
#define LIMA_GP_PERF_CNT_1_VALUE
#define LIMA_GP_PERF_CNT_0_LIMIT
#define LIMA_GP_STATUS
#define LIMA_GP_STATUS_VS_ACTIVE
#define LIMA_GP_STATUS_BUS_STOPPED
#define LIMA_GP_STATUS_PLBU_ACTIVE
#define LIMA_GP_STATUS_BUS_ERROR
#define LIMA_GP_STATUS_WRITE_BOUND_ERR
#define LIMA_GP_VERSION
#define LIMA_GP_VSCL_START_ADDR_READ
#define LIMA_GP_PLBCL_START_ADDR_READ
#define LIMA_GP_CONTR_AXI_BUS_ERROR_STAT

#define LIMA_GP_IRQ_MASK_ALL

#define LIMA_GP_IRQ_MASK_ERROR

#define LIMA_GP_IRQ_MASK_USED

/* PP regs */
#define LIMA_PP_FRAME
#define LIMA_PP_RSW
#define LIMA_PP_STACK
#define LIMA_PP_STACK_SIZE
#define LIMA_PP_ORIGIN_OFFSET_X
#define LIMA_PP_WB(i)
#define LIMA_PP_WB_SOURCE_SELECT
#define LIMA_PP_WB_SOURCE_ADDR

#define LIMA_PP_VERSION
#define LIMA_PP_CURRENT_REND_LIST_ADDR
#define LIMA_PP_STATUS
#define LIMA_PP_STATUS_RENDERING_ACTIVE
#define LIMA_PP_STATUS_BUS_STOPPED
#define LIMA_PP_CTRL
#define LIMA_PP_CTRL_STOP_BUS
#define LIMA_PP_CTRL_FLUSH_CACHES
#define LIMA_PP_CTRL_FORCE_RESET
#define LIMA_PP_CTRL_START_RENDERING
#define LIMA_PP_CTRL_SOFT_RESET
#define LIMA_PP_INT_RAWSTAT
#define LIMA_PP_INT_CLEAR
#define LIMA_PP_INT_MASK
#define LIMA_PP_INT_STATUS
#define LIMA_PP_IRQ_END_OF_FRAME
#define LIMA_PP_IRQ_END_OF_TILE
#define LIMA_PP_IRQ_HANG
#define LIMA_PP_IRQ_FORCE_HANG
#define LIMA_PP_IRQ_BUS_ERROR
#define LIMA_PP_IRQ_BUS_STOP
#define LIMA_PP_IRQ_CNT_0_LIMIT
#define LIMA_PP_IRQ_CNT_1_LIMIT
#define LIMA_PP_IRQ_WRITE_BOUNDARY_ERROR
#define LIMA_PP_IRQ_INVALID_PLIST_COMMAND
#define LIMA_PP_IRQ_CALL_STACK_UNDERFLOW
#define LIMA_PP_IRQ_CALL_STACK_OVERFLOW
#define LIMA_PP_IRQ_RESET_COMPLETED
#define LIMA_PP_WRITE_BOUNDARY_LOW
#define LIMA_PP_BUS_ERROR_STATUS
#define LIMA_PP_PERF_CNT_0_ENABLE
#define LIMA_PP_PERF_CNT_0_SRC
#define LIMA_PP_PERF_CNT_0_LIMIT
#define LIMA_PP_PERF_CNT_0_VALUE
#define LIMA_PP_PERF_CNT_1_ENABLE
#define LIMA_PP_PERF_CNT_1_SRC
#define LIMA_PP_PERF_CNT_1_LIMIT
#define LIMA_PP_PERF_CNT_1_VALUE
#define LIMA_PP_PERFMON_CONTR
#define LIMA_PP_PERFMON_BASE

#define LIMA_PP_IRQ_MASK_ALL

#define LIMA_PP_IRQ_MASK_ERROR

#define LIMA_PP_IRQ_MASK_USED

/* MMU regs */
#define LIMA_MMU_DTE_ADDR
#define LIMA_MMU_STATUS
#define LIMA_MMU_STATUS_PAGING_ENABLED
#define LIMA_MMU_STATUS_PAGE_FAULT_ACTIVE
#define LIMA_MMU_STATUS_STALL_ACTIVE
#define LIMA_MMU_STATUS_IDLE
#define LIMA_MMU_STATUS_REPLAY_BUFFER_EMPTY
#define LIMA_MMU_STATUS_PAGE_FAULT_IS_WRITE
#define LIMA_MMU_STATUS_BUS_ID(x)
#define LIMA_MMU_STATUS_STALL_NOT_ACTIVE
#define LIMA_MMU_COMMAND
#define LIMA_MMU_COMMAND_ENABLE_PAGING
#define LIMA_MMU_COMMAND_DISABLE_PAGING
#define LIMA_MMU_COMMAND_ENABLE_STALL
#define LIMA_MMU_COMMAND_DISABLE_STALL
#define LIMA_MMU_COMMAND_ZAP_CACHE
#define LIMA_MMU_COMMAND_PAGE_FAULT_DONE
#define LIMA_MMU_COMMAND_HARD_RESET
#define LIMA_MMU_PAGE_FAULT_ADDR
#define LIMA_MMU_ZAP_ONE_LINE
#define LIMA_MMU_INT_RAWSTAT
#define LIMA_MMU_INT_CLEAR
#define LIMA_MMU_INT_MASK
#define LIMA_MMU_INT_PAGE_FAULT
#define LIMA_MMU_INT_READ_BUS_ERROR
#define LIMA_MMU_INT_STATUS

#define LIMA_VM_FLAG_PRESENT
#define LIMA_VM_FLAG_READ_PERMISSION
#define LIMA_VM_FLAG_WRITE_PERMISSION
#define LIMA_VM_FLAG_OVERRIDE_CACHE
#define LIMA_VM_FLAG_WRITE_CACHEABLE
#define LIMA_VM_FLAG_WRITE_ALLOCATE
#define LIMA_VM_FLAG_WRITE_BUFFERABLE
#define LIMA_VM_FLAG_READ_CACHEABLE
#define LIMA_VM_FLAG_READ_ALLOCATE
#define LIMA_VM_FLAG_MASK

#define LIMA_VM_FLAGS_CACHE

#define LIMA_VM_FLAGS_UNCACHE

/* DLBU regs */
#define LIMA_DLBU_MASTER_TLLIST_PHYS_ADDR
#define LIMA_DLBU_MASTER_TLLIST_VADDR
#define LIMA_DLBU_TLLIST_VBASEADDR
#define LIMA_DLBU_FB_DIM
#define LIMA_DLBU_TLLIST_CONF
#define LIMA_DLBU_START_TILE_POS
#define LIMA_DLBU_PP_ENABLE_MASK

/* BCAST regs */
#define LIMA_BCAST_BROADCAST_MASK
#define LIMA_BCAST_INTERRUPT_MASK

#endif