17e6ad46Vishal Kulkarni/*
27e6ad46Vishal Kulkarni * This file and its contents are supplied under the terms of the
37e6ad46Vishal Kulkarni * Common Development and Distribution License ("CDDL"), version 1.0.
47e6ad46Vishal Kulkarni * You may only use this file in accordance with the terms of version
57e6ad46Vishal Kulkarni * 1.0 of the CDDL.
67e6ad46Vishal Kulkarni *
77e6ad46Vishal Kulkarni * A full copy of the text of the CDDL should have accompanied this
87e6ad46Vishal Kulkarni * source.  A copy of the CDDL is also available via the Internet at
97e6ad46Vishal Kulkarni * http://www.illumos.org/license/CDDL.
107e6ad46Vishal Kulkarni */
117e6ad46Vishal Kulkarni
127e6ad46Vishal Kulkarni/*
137e6ad46Vishal Kulkarni * Copyright (c) 2019 by Chelsio Communications, Inc.
147e6ad46Vishal Kulkarni */
157e6ad46Vishal Kulkarni
167e6ad46Vishal Kulkarni#include "cudbg_view_compat.h"
177e6ad46Vishal Kulkarni#include "cudbg.h"
187e6ad46Vishal Kulkarni
197e6ad46Vishal Kulkarniint
207e6ad46Vishal Kulkarniview_ulptx_la_rev0(void *data, struct cudbg_buffer *cudbg_poutbuf)
217e6ad46Vishal Kulkarni{
227e6ad46Vishal Kulkarni	struct cudbg_ulptx_la_rev0 *ulptx_la_buff;
237e6ad46Vishal Kulkarni	int i, j, rc = 0;
247e6ad46Vishal Kulkarni
257e6ad46Vishal Kulkarni	ulptx_la_buff = (struct cudbg_ulptx_la_rev0 *)data;
267e6ad46Vishal Kulkarni
277e6ad46Vishal Kulkarni	for (i = 0; i < CUDBG_NUM_ULPTX; i++) {
287e6ad46Vishal Kulkarni		printf("==============================\n");
297e6ad46Vishal Kulkarni		printf("DUMPING ULP_TX_LA_%d\n", i);
307e6ad46Vishal Kulkarni		printf("==============================\n");
317e6ad46Vishal Kulkarni
327e6ad46Vishal Kulkarni		printf("[0x%x] %-24s %#x\n",
337e6ad46Vishal Kulkarni			     (A_ULP_TX_LA_RDPTR_0 + 0x10 * i),
347e6ad46Vishal Kulkarni			     cudbg_ulptx_rdptr[i], ulptx_la_buff->rdptr[i]);
357e6ad46Vishal Kulkarni		printf("[0x%x] %-24s %#x\n",
367e6ad46Vishal Kulkarni			     (A_ULP_TX_LA_WRPTR_0 + 0x10 * i),
377e6ad46Vishal Kulkarni			     cudbg_ulptx_wrptr[i], ulptx_la_buff->wrptr[i]);
387e6ad46Vishal Kulkarni		printf("[0x%x] %-24s %#-13x\n",
397e6ad46Vishal Kulkarni			     (A_ULP_TX_LA_RDDATA_0 + 0x10 * i),
407e6ad46Vishal Kulkarni			     cudbg_ulptx_rddata[i], ulptx_la_buff->rddata[i]);
417e6ad46Vishal Kulkarni
427e6ad46Vishal Kulkarni		for (j = 0; j < CUDBG_NUM_ULPTX_READ; j++) {
437e6ad46Vishal Kulkarni			printf("[%#x]   %#-16x [%u]\n",
447e6ad46Vishal Kulkarni				     j, ulptx_la_buff->rd_data[i][j],
457e6ad46Vishal Kulkarni				     ulptx_la_buff->rd_data[i][j]);
467e6ad46Vishal Kulkarni		}
477e6ad46Vishal Kulkarni	}
487e6ad46Vishal Kulkarni
497e6ad46Vishal Kulkarni	return rc;
507e6ad46Vishal Kulkarni}
51