<div dir="ltr"><div><br></div>Sorry, I'm preparing RFC for lima driver, this mail is send by accident.<div>Will resend a formal one latter.</div><div><br></div><div>Regards,</div><div>Qiang</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 18, 2018 at 11:16 AM, Qiang Yu <span dir="ltr"><<a href="mailto:yuq825@gmail.com" target="_blank">yuq825@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Lima Project Developers <<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.<wbr>org</a>><br>
<br>
Signed-off-by: Qiang Yu <<a href="mailto:yuq825@gmail.com">yuq825@gmail.com</a>><br>
Signed-off-by: Heiko Stuebner <<a href="mailto:heiko@sntech.de">heiko@sntech.de</a>><br>
---<br>
drivers/gpu/drm/lima/lima_<wbr>regs.h | 304 ++++++++++++++++++++++++++++++<wbr>+<br>
1 file changed, 304 insertions(+)<br>
create mode 100644 drivers/gpu/drm/lima/lima_<wbr>regs.h<br>
<br>
diff --git a/drivers/gpu/drm/lima/lima_<wbr>regs.h b/drivers/gpu/drm/lima/lima_<wbr>regs.h<br>
new file mode 100644<br>
index 000000000000..ea4a37d69b98<br>
--- /dev/null<br>
+++ b/drivers/gpu/drm/lima/lima_<wbr>regs.h<br>
@@ -0,0 +1,304 @@<br>
+/*<br>
+ * Copyright (C) 2010-2017 ARM Limited. All rights reserved.<br>
+ * Copyright (C) 2017-2018 Lima Project<br>
+ * <br>
+ * This program is free software and is provided to you under<br>
+ * the terms of the GNU General Public License version 2 as<br>
+ * published by the Free Software Foundation, and any use by<br>
+ * you of this program is subject to the terms of such GNU<br>
+ * licence.<br>
+ * <br>
+ * A copy of the licence is included with the program, and<br>
+ * can also be obtained from Free Software Foundation, Inc.,<br>
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.<br>
+ */<br>
+<br>
+#ifndef __LIMA_REGS_H__<br>
+#define __LIMA_REGS_H__<br>
+<br>
+/* PMU regs */<br>
+#define LIMA_PMU_POWER_UP 0x00<br>
+#define LIMA_PMU_POWER_DOWN 0x04<br>
+#define LIMA_PMU_POWER_GP0_MASK (1 << 0)<br>
+#define LIMA_PMU_POWER_L2_MASK (1 << 1)<br>
+#define LIMA_PMU_POWER_PP_MASK(i) (1 << (2 + i))<br>
+<br>
+/*<br>
+ * On Mali450 each block automatically starts up its corresponding L2<br>
+ * and the PPs are not fully independent controllable.<br>
+ * Instead PP0, PP1-3 and PP4-7 can be turned on or off.<br>
+ */<br>
+#define LIMA450_PMU_POWER_PP0_MASK BIT(1)<br>
+#define LIMA450_PMU_POWER_PP13_MASK BIT(2)<br>
+#define LIMA450_PMU_POWER_PP47_MASK BIT(3)<br>
+<br>
+#define LIMA_PMU_STATUS 0x08<br>
+#define LIMA_PMU_INT_MASK 0x0C<br>
+#define LIMA_PMU_INT_RAWSTAT 0x10<br>
+#define LIMA_PMU_INT_CLEAR 0x18<br>
+#define LIMA_PMU_INT_CMD_MASK (1 << 0)<br>
+#define LIMA_PMU_SW_DELAY 0x1C<br>
+<br>
+/* L2 cache regs */<br>
+#define LIMA_L2_CACHE_SIZE 0x0004<br>
+#define LIMA_L2_CACHE_STATUS 0x0008<br>
+#define LIMA_L2_CACHE_STATUS_COMMAND_<wbr>BUSY (1 << 0)<br>
+#define LIMA_L2_CACHE_STATUS_DATA_BUSY (1 << 1)<br>
+#define LIMA_L2_CACHE_COMMAND 0x0010<br>
+#define LIMA_L2_CACHE_COMMAND_CLEAR_<wbr>ALL (1 << 0)<br>
+#define LIMA_L2_CACHE_CLEAR_PAGE 0x0014<br>
+#define LIMA_L2_CACHE_MAX_READS 0x0018<br>
+#define LIMA_L2_CACHE_ENABLE 0x001C<br>
+#define LIMA_L2_CACHE_ENABLE_ACCESS (1 << 0)<br>
+#define LIMA_L2_CACHE_ENABLE_READ_<wbr>ALLOCATE (1 << 1)<br>
+#define LIMA_L2_CACHE_PERFCNT_SRC0 0x0020<br>
+#define LIMA_L2_CACHE_PERFCNT_VAL0 0x0024<br>
+#define LIMA_L2_CACHE_PERFCNT_SRC1 0x0028<br>
+#define LIMA_L2_CACHE_ERFCNT_VAL1 0x002C<br>
+<br>
+/* GP regs */<br>
+#define LIMA_GP_VSCL_START_ADDR 0x00<br>
+#define LIMA_GP_VSCL_END_ADDR 0x04<br>
+#define LIMA_GP_PLBUCL_START_ADDR 0x08<br>
+#define LIMA_GP_PLBUCL_END_ADDR 0x0c<br>
+#define LIMA_GP_PLBU_ALLOC_START_ADDR 0x10<br>
+#define LIMA_GP_PLBU_ALLOC_END_ADDR 0x14<br>
+#define LIMA_GP_CMD 0x20<br>
+#define LIMA_GP_CMD_START_VS (1 << 0)<br>
+#define LIMA_GP_CMD_START_PLBU (1 << 1)<br>
+#define LIMA_GP_CMD_UPDATE_PLBU_ALLOC (1 << 4)<br>
+#define LIMA_GP_CMD_RESET (1 << 5)<br>
+#define LIMA_GP_CMD_FORCE_HANG (1 << 6)<br>
+#define LIMA_GP_CMD_STOP_BUS (1 << 9)<br>
+#define LIMA_GP_CMD_SOFT_RESET (1 << 10)<br>
+#define LIMA_GP_INT_RAWSTAT 0x24<br>
+#define LIMA_GP_INT_CLEAR 0x28<br>
+#define LIMA_GP_INT_MASK 0x2C<br>
+#define LIMA_GP_INT_STAT 0x30<br>
+#define LIMA_GP_IRQ_VS_END_CMD_LST (1 << 0)<br>
+#define LIMA_GP_IRQ_PLBU_END_CMD_LST (1 << 1)<br>
+#define LIMA_GP_IRQ_PLBU_OUT_OF_MEM (1 << 2)<br>
+#define LIMA_GP_IRQ_VS_SEM_IRQ (1 << 3)<br>
+#define LIMA_GP_IRQ_PLBU_SEM_IRQ (1 << 4)<br>
+#define LIMA_GP_IRQ_HANG (1 << 5)<br>
+#define LIMA_GP_IRQ_FORCE_HANG (1 << 6)<br>
+#define LIMA_GP_IRQ_PERF_CNT_0_LIMIT (1 << 7)<br>
+#define LIMA_GP_IRQ_PERF_CNT_1_LIMIT (1 << 8)<br>
+#define LIMA_GP_IRQ_WRITE_BOUND_ERR (1 << 9)<br>
+#define LIMA_GP_IRQ_SYNC_ERROR (1 << 10)<br>
+#define LIMA_GP_IRQ_AXI_BUS_ERROR (1 << 11)<br>
+#define LIMA_GP_IRQ_AXI_BUS_STOPPED (1 << 12)<br>
+#define LIMA_GP_IRQ_VS_INVALID_CMD (1 << 13)<br>
+#define LIMA_GP_IRQ_PLB_INVALID_CMD (1 << 14)<br>
+#define LIMA_GP_IRQ_RESET_COMPLETED (1 << 19)<br>
+#define LIMA_GP_IRQ_SEMAPHORE_<wbr>UNDERFLOW (1 << 20)<br>
+#define LIMA_GP_IRQ_SEMAPHORE_OVERFLOW (1 << 21)<br>
+#define LIMA_GP_IRQ_PTR_ARRAY_OUT_OF_<wbr>BOUNDS (1 << 22)<br>
+#define LIMA_GP_WRITE_BOUND_LOW 0x34<br>
+#define LIMA_GP_PERF_CNT_0_ENABLE 0x3C<br>
+#define LIMA_GP_PERF_CNT_1_ENABLE 0x40<br>
+#define LIMA_GP_PERF_CNT_0_SRC 0x44<br>
+#define LIMA_GP_PERF_CNT_1_SRC 0x48<br>
+#define LIMA_GP_PERF_CNT_0_VALUE 0x4C<br>
+#define LIMA_GP_PERF_CNT_1_VALUE 0x50<br>
+#define LIMA_GP_PERF_CNT_0_LIMIT 0x54<br>
+#define LIMA_GP_STATUS 0x68<br>
+#define LIMA_GP_STATUS_VS_ACTIVE (1 << 1)<br>
+#define LIMA_GP_STATUS_BUS_STOPPED (1 << 2)<br>
+#define LIMA_GP_STATUS_PLBU_ACTIVE (1 << 3)<br>
+#define LIMA_GP_STATUS_BUS_ERROR (1 << 6)<br>
+#define LIMA_GP_STATUS_WRITE_BOUND_ERR (1 << 8)<br>
+#define LIMA_GP_VERSION 0x6C<br>
+#define LIMA_GP_VSCL_START_ADDR_READ 0x80<br>
+#define LIMA_GP_PLBCL_START_ADDR_READ 0x84<br>
+#define LIMA_GP_CONTR_AXI_BUS_ERROR_<wbr>STAT 0x94<br>
+<br>
+#define LIMA_GP_IRQ_MASK_ALL \<br>
+ ( \<br>
+ LIMA_GP_IRQ_VS_END_CMD_LST | \<br>
+ LIMA_GP_IRQ_PLBU_END_CMD_LST | \<br>
+ LIMA_GP_IRQ_PLBU_OUT_OF_MEM | \<br>
+ LIMA_GP_IRQ_VS_SEM_IRQ | \<br>
+ LIMA_GP_IRQ_PLBU_SEM_IRQ | \<br>
+ LIMA_GP_IRQ_HANG | \<br>
+ LIMA_GP_IRQ_FORCE_HANG | \<br>
+ LIMA_GP_IRQ_PERF_CNT_0_LIMIT | \<br>
+ LIMA_GP_IRQ_PERF_CNT_1_LIMIT | \<br>
+ LIMA_GP_IRQ_WRITE_BOUND_ERR | \<br>
+ LIMA_GP_IRQ_SYNC_ERROR | \<br>
+ LIMA_GP_IRQ_AXI_BUS_ERROR | \<br>
+ LIMA_GP_IRQ_AXI_BUS_STOPPED | \<br>
+ LIMA_GP_IRQ_VS_INVALID_CMD | \<br>
+ LIMA_GP_IRQ_PLB_INVALID_CMD | \<br>
+ LIMA_GP_IRQ_RESET_COMPLETED | \<br>
+ LIMA_GP_IRQ_SEMAPHORE_<wbr>UNDERFLOW | \<br>
+ LIMA_GP_IRQ_SEMAPHORE_OVERFLOW | \<br>
+ LIMA_GP_IRQ_PTR_ARRAY_OUT_OF_<wbr>BOUNDS)<br>
+<br>
+#define LIMA_GP_IRQ_MASK_ERROR \<br>
+ ( \<br>
+ LIMA_GP_IRQ_PLBU_OUT_OF_MEM | \<br>
+ LIMA_GP_IRQ_FORCE_HANG | \<br>
+ LIMA_GP_IRQ_WRITE_BOUND_ERR | \<br>
+ LIMA_GP_IRQ_SYNC_ERROR | \<br>
+ LIMA_GP_IRQ_AXI_BUS_ERROR | \<br>
+ LIMA_GP_IRQ_VS_INVALID_CMD | \<br>
+ LIMA_GP_IRQ_PLB_INVALID_CMD | \<br>
+ LIMA_GP_IRQ_SEMAPHORE_<wbr>UNDERFLOW | \<br>
+ LIMA_GP_IRQ_SEMAPHORE_OVERFLOW | \<br>
+ LIMA_GP_IRQ_PTR_ARRAY_OUT_OF_<wbr>BOUNDS)<br>
+<br>
+#define LIMA_GP_IRQ_MASK_USED \<br>
+ ( \<br>
+ LIMA_GP_IRQ_VS_END_CMD_LST | \<br>
+ LIMA_GP_IRQ_PLBU_END_CMD_LST | \<br>
+ LIMA_GP_IRQ_MASK_ERROR)<br>
+<br>
+/* PP regs */<br>
+#define LIMA_PP_FRAME 0x0000<br>
+#define LIMA_PP_RSW 0x0004<br>
+#define LIMA_PP_STACK 0x0030<br>
+#define LIMA_PP_STACK_SIZE 0x0034<br>
+#define LIMA_PP_ORIGIN_OFFSET_X 0x0040<br>
+#define LIMA_PP_WB(i) (0x0100 * (i + 1))<br>
+#define LIMA_PP_WB_SOURCE_SELECT 0x0000<br>
+#define LIMA_PP_WB_SOURCE_ADDR 0x0004<br>
+<br>
+#define LIMA_PP_VERSION 0x1000<br>
+#define LIMA_PP_CURRENT_REND_LIST_ADDR 0x1004<br>
+#define LIMA_PP_STATUS 0x1008<br>
+#define LIMA_PP_STATUS_RENDERING_<wbr>ACTIVE (1 << 0)<br>
+#define LIMA_PP_STATUS_BUS_STOPPED (1 << 4)<br>
+#define LIMA_PP_CTRL 0x100c<br>
+#define LIMA_PP_CTRL_STOP_BUS (1 << 0)<br>
+#define LIMA_PP_CTRL_FLUSH_CACHES (1 << 3)<br>
+#define LIMA_PP_CTRL_FORCE_RESET (1 << 5)<br>
+#define LIMA_PP_CTRL_START_RENDERING (1 << 6)<br>
+#define LIMA_PP_CTRL_SOFT_RESET (1 << 7)<br>
+#define LIMA_PP_INT_RAWSTAT 0x1020<br>
+#define LIMA_PP_INT_CLEAR 0x1024<br>
+#define LIMA_PP_INT_MASK 0x1028<br>
+#define LIMA_PP_INT_STATUS 0x102c<br>
+#define LIMA_PP_IRQ_END_OF_FRAME (1 << 0)<br>
+#define LIMA_PP_IRQ_END_OF_TILE (1 << 1)<br>
+#define LIMA_PP_IRQ_HANG (1 << 2)<br>
+#define LIMA_PP_IRQ_FORCE_HANG (1 << 3)<br>
+#define LIMA_PP_IRQ_BUS_ERROR (1 << 4)<br>
+#define LIMA_PP_IRQ_BUS_STOP (1 << 5)<br>
+#define LIMA_PP_IRQ_CNT_0_LIMIT (1 << 6)<br>
+#define LIMA_PP_IRQ_CNT_1_LIMIT (1 << 7)<br>
+#define LIMA_PP_IRQ_WRITE_BOUNDARY_<wbr>ERROR (1 << 8)<br>
+#define LIMA_PP_IRQ_INVALID_PLIST_<wbr>COMMAND (1 << 9)<br>
+#define LIMA_PP_IRQ_CALL_STACK_<wbr>UNDERFLOW (1 << 10)<br>
+#define LIMA_PP_IRQ_CALL_STACK_<wbr>OVERFLOW (1 << 11)<br>
+#define LIMA_PP_IRQ_RESET_COMPLETED (1 << 12)<br>
+#define LIMA_PP_WRITE_BOUNDARY_LOW 0x1044<br>
+#define LIMA_PP_BUS_ERROR_STATUS 0x1050<br>
+#define LIMA_PP_PERF_CNT_0_ENABLE 0x1080<br>
+#define LIMA_PP_PERF_CNT_0_SRC 0x1084<br>
+#define LIMA_PP_PERF_CNT_0_LIMIT 0x1088<br>
+#define LIMA_PP_PERF_CNT_0_VALUE 0x108c<br>
+#define LIMA_PP_PERF_CNT_1_ENABLE 0x10a0<br>
+#define LIMA_PP_PERF_CNT_1_SRC 0x10a4<br>
+#define LIMA_PP_PERF_CNT_1_LIMIT 0x10a8<br>
+#define LIMA_PP_PERF_CNT_1_VALUE 0x10ac<br>
+#define LIMA_PP_PERFMON_CONTR 0x10b0<br>
+#define LIMA_PP_PERFMON_BASE 0x10b4<br>
+<br>
+#define LIMA_PP_IRQ_MASK_ALL \<br>
+ ( \<br>
+ LIMA_PP_IRQ_END_OF_FRAME | \<br>
+ LIMA_PP_IRQ_END_OF_TILE | \<br>
+ LIMA_PP_IRQ_HANG | \<br>
+ LIMA_PP_IRQ_FORCE_HANG | \<br>
+ LIMA_PP_IRQ_BUS_ERROR | \<br>
+ LIMA_PP_IRQ_BUS_STOP | \<br>
+ LIMA_PP_IRQ_CNT_0_LIMIT | \<br>
+ LIMA_PP_IRQ_CNT_1_LIMIT | \<br>
+ LIMA_PP_IRQ_WRITE_BOUNDARY_<wbr>ERROR | \<br>
+ LIMA_PP_IRQ_INVALID_PLIST_<wbr>COMMAND | \<br>
+ LIMA_PP_IRQ_CALL_STACK_<wbr>UNDERFLOW | \<br>
+ LIMA_PP_IRQ_CALL_STACK_<wbr>OVERFLOW | \<br>
+ LIMA_PP_IRQ_RESET_COMPLETED)<br>
+<br>
+#define LIMA_PP_IRQ_MASK_ERROR \<br>
+ ( \<br>
+ LIMA_PP_IRQ_FORCE_HANG | \<br>
+ LIMA_PP_IRQ_BUS_ERROR | \<br>
+ LIMA_PP_IRQ_WRITE_BOUNDARY_<wbr>ERROR | \<br>
+ LIMA_PP_IRQ_INVALID_PLIST_<wbr>COMMAND | \<br>
+ LIMA_PP_IRQ_CALL_STACK_<wbr>UNDERFLOW | \<br>
+ LIMA_PP_IRQ_CALL_STACK_<wbr>OVERFLOW)<br>
+<br>
+#define LIMA_PP_IRQ_MASK_USED \<br>
+ ( \<br>
+ LIMA_PP_IRQ_END_OF_FRAME | \<br>
+ LIMA_PP_IRQ_MASK_ERROR)<br>
+<br>
+/* MMU regs */<br>
+#define LIMA_MMU_DTE_ADDR 0x0000<br>
+#define LIMA_MMU_STATUS 0x0004<br>
+#define LIMA_MMU_STATUS_PAGING_ENABLED (1 << 0)<br>
+#define LIMA_MMU_STATUS_PAGE_FAULT_<wbr>ACTIVE (1 << 1)<br>
+#define LIMA_MMU_STATUS_STALL_ACTIVE (1 << 2)<br>
+#define LIMA_MMU_STATUS_IDLE (1 << 3)<br>
+#define LIMA_MMU_STATUS_REPLAY_BUFFER_<wbr>EMPTY (1 << 4)<br>
+#define LIMA_MMU_STATUS_PAGE_FAULT_IS_<wbr>WRITE (1 << 5)<br>
+#define LIMA_MMU_STATUS_BUS_ID(x) ((x >> 6) & 0x1F)<br>
+#define LIMA_MMU_COMMAND 0x0008<br>
+#define LIMA_MMU_COMMAND_ENABLE_PAGING 0x00<br>
+#define LIMA_MMU_COMMAND_DISABLE_<wbr>PAGING 0x01<br>
+#define LIMA_MMU_COMMAND_ENABLE_STALL 0x02<br>
+#define LIMA_MMU_COMMAND_DISABLE_STALL 0x03<br>
+#define LIMA_MMU_COMMAND_ZAP_CACHE 0x04<br>
+#define LIMA_MMU_COMMAND_PAGE_FAULT_<wbr>DONE 0x05<br>
+#define LIMA_MMU_COMMAND_HARD_RESET 0x06<br>
+#define LIMA_MMU_PAGE_FAULT_ADDR 0x000C<br>
+#define LIMA_MMU_ZAP_ONE_LINE 0x0010<br>
+#define LIMA_MMU_INT_RAWSTAT 0x0014<br>
+#define LIMA_MMU_INT_CLEAR 0x0018<br>
+#define LIMA_MMU_INT_MASK 0x001C<br>
+#define LIMA_MMU_INT_PAGE_FAULT 0x01<br>
+#define LIMA_MMU_INT_READ_BUS_ERROR 0x02<br>
+#define LIMA_MMU_INT_STATUS 0x0020<br>
+<br>
+#define LIMA_VM_FLAG_PRESENT (1 << 0)<br>
+#define LIMA_VM_FLAG_READ_PERMISSION (1 << 1)<br>
+#define LIMA_VM_FLAG_WRITE_PERMISSION (1 << 2)<br>
+#define LIMA_VM_FLAG_OVERRIDE_CACHE (1 << 3)<br>
+#define LIMA_VM_FLAG_WRITE_CACHEABLE (1 << 4)<br>
+#define LIMA_VM_FLAG_WRITE_ALLOCATE (1 << 5)<br>
+#define LIMA_VM_FLAG_WRITE_BUFFERABLE (1 << 6)<br>
+#define LIMA_VM_FLAG_READ_CACHEABLE (1 << 7)<br>
+#define LIMA_VM_FLAG_READ_ALLOCATE (1 << 8)<br>
+#define LIMA_VM_FLAG_MASK 0x1FF<br>
+<br>
+#define LIMA_VM_FLAGS_CACHE ( \<br>
+ LIMA_VM_FLAG_PRESENT | \<br>
+ LIMA_VM_FLAG_READ_PERMISSION | \<br>
+ LIMA_VM_FLAG_WRITE_PERMISSION | \<br>
+ LIMA_VM_FLAG_OVERRIDE_CACHE | \<br>
+ LIMA_VM_FLAG_WRITE_CACHEABLE | \<br>
+ LIMA_VM_FLAG_WRITE_BUFFERABLE | \<br>
+ LIMA_VM_FLAG_READ_CACHEABLE | \<br>
+ LIMA_VM_FLAG_READ_ALLOCATE )<br>
+<br>
+#define LIMA_VM_FLAGS_UNCACHE ( \<br>
+ LIMA_VM_FLAG_PRESENT | \<br>
+ LIMA_VM_FLAG_READ_PERMISSION | \<br>
+ LIMA_VM_FLAG_WRITE_PERMISSION )<br>
+<br>
+/* DLBU regs */<br>
+#define LIMA_DLBU_MASTER_TLLIST_PHYS_<wbr>ADDR 0x0000<br>
+#define LIMA_DLBU_MASTER_TLLIST_VADDR 0x0004<br>
+#define LIMA_DLBU_TLLIST_VBASEADDR 0x0008<br>
+#define LIMA_DLBU_FB_DIM 0x000C<br>
+#define LIMA_DLBU_TLLIST_CONF 0x0010<br>
+#define LIMA_DLBU_START_TILE_POS 0x0014<br>
+#define LIMA_DLBU_PP_ENABLE_MASK 0x0018<br>
+<br>
+/* BCAST regs */<br>
+#define LIMA_BCAST_BROADCAST_MASK 0x0<br>
+#define LIMA_BCAST_INTERRUPT_MASK 0x4<br>
+<br>
+#endif<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
</font></span></blockquote></div><br></div>