Home | History | Annotate | Line # | Download | only in nvfw
      1  1.1  riastrad /*	$NetBSD: pmu.h,v 1.2 2021/12/18 23:45:32 riastradh Exp $	*/
      2  1.1  riastrad 
      3  1.1  riastrad #ifndef __NVFW_PMU_H__
      4  1.1  riastrad #define __NVFW_PMU_H__
      5  1.1  riastrad 
      6  1.1  riastrad struct nv_pmu_args {
      7  1.1  riastrad 	u32 reserved;
      8  1.1  riastrad 	u32 freq_hz;
      9  1.1  riastrad 	u32 trace_size;
     10  1.1  riastrad 	u32 trace_dma_base;
     11  1.1  riastrad 	u16 trace_dma_base1;
     12  1.1  riastrad 	u8 trace_dma_offset;
     13  1.1  riastrad 	u32 trace_dma_idx;
     14  1.1  riastrad 	bool secure_mode;
     15  1.1  riastrad 	bool raise_priv_sec;
     16  1.1  riastrad 	struct {
     17  1.1  riastrad 		u32 dma_base;
     18  1.1  riastrad 		u16 dma_base1;
     19  1.1  riastrad 		u8 dma_offset;
     20  1.1  riastrad 		u16 fb_size;
     21  1.1  riastrad 		u8 dma_idx;
     22  1.1  riastrad 	} gc6_ctx;
     23  1.1  riastrad 	u8 pad;
     24  1.1  riastrad };
     25  1.1  riastrad 
     26  1.1  riastrad #define NV_PMU_UNIT_INIT                                                   0x07
     27  1.1  riastrad #define NV_PMU_UNIT_ACR                                                    0x0a
     28  1.1  riastrad 
     29  1.1  riastrad struct nv_pmu_init_msg {
     30  1.1  riastrad 	struct nv_falcon_msg hdr;
     31  1.1  riastrad #define NV_PMU_INIT_MSG_INIT                                               0x00
     32  1.1  riastrad 	u8 msg_type;
     33  1.1  riastrad 
     34  1.1  riastrad 	u8 pad;
     35  1.1  riastrad 	u16 os_debug_entry_point;
     36  1.1  riastrad 
     37  1.1  riastrad 	struct {
     38  1.1  riastrad 		u16 size;
     39  1.1  riastrad 		u16 offset;
     40  1.1  riastrad 		u8 index;
     41  1.1  riastrad 		u8 pad;
     42  1.1  riastrad 	} queue_info[5];
     43  1.1  riastrad 
     44  1.1  riastrad 	u16 sw_managed_area_offset;
     45  1.1  riastrad 	u16 sw_managed_area_size;
     46  1.1  riastrad };
     47  1.1  riastrad 
     48  1.1  riastrad struct nv_pmu_acr_cmd {
     49  1.1  riastrad 	struct nv_falcon_cmd hdr;
     50  1.1  riastrad #define NV_PMU_ACR_CMD_INIT_WPR_REGION                                     0x00
     51  1.1  riastrad #define NV_PMU_ACR_CMD_BOOTSTRAP_FALCON                                    0x01
     52  1.1  riastrad #define NV_PMU_ACR_CMD_BOOTSTRAP_MULTIPLE_FALCONS                          0x03
     53  1.1  riastrad 	u8 cmd_type;
     54  1.1  riastrad };
     55  1.1  riastrad 
     56  1.1  riastrad struct nv_pmu_acr_msg {
     57  1.1  riastrad 	struct nv_falcon_cmd hdr;
     58  1.1  riastrad 	u8 msg_type;
     59  1.1  riastrad };
     60  1.1  riastrad 
     61  1.1  riastrad struct nv_pmu_acr_init_wpr_region_cmd {
     62  1.1  riastrad 	struct nv_pmu_acr_cmd cmd;
     63  1.1  riastrad 	u32 region_id;
     64  1.1  riastrad 	u32 wpr_offset;
     65  1.1  riastrad };
     66  1.1  riastrad 
     67  1.1  riastrad struct nv_pmu_acr_init_wpr_region_msg {
     68  1.1  riastrad 	struct nv_pmu_acr_msg msg;
     69  1.1  riastrad 	u32 error_code;
     70  1.1  riastrad };
     71  1.1  riastrad 
     72  1.1  riastrad struct nv_pmu_acr_bootstrap_falcon_cmd {
     73  1.1  riastrad 	struct nv_pmu_acr_cmd cmd;
     74  1.1  riastrad #define NV_PMU_ACR_BOOTSTRAP_FALCON_FLAGS_RESET_YES                  0x00000000
     75  1.1  riastrad #define NV_PMU_ACR_BOOTSTRAP_FALCON_FLAGS_RESET_NO                   0x00000001
     76  1.1  riastrad 	u32 flags;
     77  1.1  riastrad 	u32 falcon_id;
     78  1.1  riastrad };
     79  1.1  riastrad 
     80  1.1  riastrad struct nv_pmu_acr_bootstrap_falcon_msg {
     81  1.1  riastrad 	struct nv_pmu_acr_msg msg;
     82  1.1  riastrad 	u32 falcon_id;
     83  1.1  riastrad };
     84  1.1  riastrad 
     85  1.1  riastrad struct nv_pmu_acr_bootstrap_multiple_falcons_cmd {
     86  1.1  riastrad 	struct nv_pmu_acr_cmd cmd;
     87  1.1  riastrad #define NV_PMU_ACR_BOOTSTRAP_MULTIPLE_FALCONS_FLAGS_RESET_YES        0x00000000
     88  1.1  riastrad #define NV_PMU_ACR_BOOTSTRAP_MULTIPLE_FALCONS_FLAGS_RESET_NO         0x00000001
     89  1.1  riastrad 	u32 flags;
     90  1.1  riastrad 	u32 falcon_mask;
     91  1.1  riastrad 	u32 use_va_mask;
     92  1.1  riastrad 	u32 wpr_lo;
     93  1.1  riastrad 	u32 wpr_hi;
     94  1.1  riastrad };
     95  1.1  riastrad 
     96  1.1  riastrad struct nv_pmu_acr_bootstrap_multiple_falcons_msg {
     97  1.1  riastrad 	struct nv_pmu_acr_msg msg;
     98  1.1  riastrad 	u32 falcon_mask;
     99  1.1  riastrad };
    100  1.1  riastrad #endif
    101