0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <core/subdev.h>
0023 #include <nvfw/acr.h>
0024
0025 void
0026 wpr_header_dump(struct nvkm_subdev *subdev, const struct wpr_header *hdr)
0027 {
0028 nvkm_debug(subdev, "wprHeader\n");
0029 nvkm_debug(subdev, "\tfalconID : %d\n", hdr->falcon_id);
0030 nvkm_debug(subdev, "\tlsbOffset : 0x%x\n", hdr->lsb_offset);
0031 nvkm_debug(subdev, "\tbootstrapOwner: %d\n", hdr->bootstrap_owner);
0032 nvkm_debug(subdev, "\tlazyBootstrap : %d\n", hdr->lazy_bootstrap);
0033 nvkm_debug(subdev, "\tstatus : %d\n", hdr->status);
0034 }
0035
0036 void
0037 wpr_header_v1_dump(struct nvkm_subdev *subdev, const struct wpr_header_v1 *hdr)
0038 {
0039 nvkm_debug(subdev, "wprHeader\n");
0040 nvkm_debug(subdev, "\tfalconID : %d\n", hdr->falcon_id);
0041 nvkm_debug(subdev, "\tlsbOffset : 0x%x\n", hdr->lsb_offset);
0042 nvkm_debug(subdev, "\tbootstrapOwner: %d\n", hdr->bootstrap_owner);
0043 nvkm_debug(subdev, "\tlazyBootstrap : %d\n", hdr->lazy_bootstrap);
0044 nvkm_debug(subdev, "\tbinVersion : %d\n", hdr->bin_version);
0045 nvkm_debug(subdev, "\tstatus : %d\n", hdr->status);
0046 }
0047
0048 static void
0049 lsb_header_tail_dump(struct nvkm_subdev *subdev, struct lsb_header_tail *hdr)
0050 {
0051 nvkm_debug(subdev, "lsbHeader\n");
0052 nvkm_debug(subdev, "\tucodeOff : 0x%x\n", hdr->ucode_off);
0053 nvkm_debug(subdev, "\tucodeSize : 0x%x\n", hdr->ucode_size);
0054 nvkm_debug(subdev, "\tdataSize : 0x%x\n", hdr->data_size);
0055 nvkm_debug(subdev, "\tblCodeSize : 0x%x\n", hdr->bl_code_size);
0056 nvkm_debug(subdev, "\tblImemOff : 0x%x\n", hdr->bl_imem_off);
0057 nvkm_debug(subdev, "\tblDataOff : 0x%x\n", hdr->bl_data_off);
0058 nvkm_debug(subdev, "\tblDataSize : 0x%x\n", hdr->bl_data_size);
0059 nvkm_debug(subdev, "\tappCodeOff : 0x%x\n", hdr->app_code_off);
0060 nvkm_debug(subdev, "\tappCodeSize : 0x%x\n", hdr->app_code_size);
0061 nvkm_debug(subdev, "\tappDataOff : 0x%x\n", hdr->app_data_off);
0062 nvkm_debug(subdev, "\tappDataSize : 0x%x\n", hdr->app_data_size);
0063 nvkm_debug(subdev, "\tflags : 0x%x\n", hdr->flags);
0064 }
0065
0066 void
0067 lsb_header_dump(struct nvkm_subdev *subdev, struct lsb_header *hdr)
0068 {
0069 lsb_header_tail_dump(subdev, &hdr->tail);
0070 }
0071
0072 void
0073 lsb_header_v1_dump(struct nvkm_subdev *subdev, struct lsb_header_v1 *hdr)
0074 {
0075 lsb_header_tail_dump(subdev, &hdr->tail);
0076 }
0077
0078 void
0079 flcn_acr_desc_dump(struct nvkm_subdev *subdev, struct flcn_acr_desc *hdr)
0080 {
0081 int i;
0082
0083 nvkm_debug(subdev, "acrDesc\n");
0084 nvkm_debug(subdev, "\twprRegionId : %d\n", hdr->wpr_region_id);
0085 nvkm_debug(subdev, "\twprOffset : 0x%x\n", hdr->wpr_offset);
0086 nvkm_debug(subdev, "\tmmuMemRange : 0x%x\n",
0087 hdr->mmu_mem_range);
0088 nvkm_debug(subdev, "\tnoRegions : %d\n",
0089 hdr->regions.no_regions);
0090
0091 for (i = 0; i < ARRAY_SIZE(hdr->regions.region_props); i++) {
0092 nvkm_debug(subdev, "\tregion[%d] :\n", i);
0093 nvkm_debug(subdev, "\t startAddr : 0x%x\n",
0094 hdr->regions.region_props[i].start_addr);
0095 nvkm_debug(subdev, "\t endAddr : 0x%x\n",
0096 hdr->regions.region_props[i].end_addr);
0097 nvkm_debug(subdev, "\t regionId : %d\n",
0098 hdr->regions.region_props[i].region_id);
0099 nvkm_debug(subdev, "\t readMask : 0x%x\n",
0100 hdr->regions.region_props[i].read_mask);
0101 nvkm_debug(subdev, "\t writeMask : 0x%x\n",
0102 hdr->regions.region_props[i].write_mask);
0103 nvkm_debug(subdev, "\t clientMask : 0x%x\n",
0104 hdr->regions.region_props[i].client_mask);
0105 }
0106
0107 nvkm_debug(subdev, "\tucodeBlobSize: %d\n",
0108 hdr->ucode_blob_size);
0109 nvkm_debug(subdev, "\tucodeBlobBase: 0x%llx\n",
0110 hdr->ucode_blob_base);
0111 nvkm_debug(subdev, "\tvprEnabled : %d\n",
0112 hdr->vpr_desc.vpr_enabled);
0113 nvkm_debug(subdev, "\tvprStart : 0x%x\n",
0114 hdr->vpr_desc.vpr_start);
0115 nvkm_debug(subdev, "\tvprEnd : 0x%x\n",
0116 hdr->vpr_desc.vpr_end);
0117 nvkm_debug(subdev, "\thdcpPolicies : 0x%x\n",
0118 hdr->vpr_desc.hdcp_policies);
0119 }
0120
0121 void
0122 flcn_acr_desc_v1_dump(struct nvkm_subdev *subdev, struct flcn_acr_desc_v1 *hdr)
0123 {
0124 int i;
0125
0126 nvkm_debug(subdev, "acrDesc\n");
0127 nvkm_debug(subdev, "\twprRegionId : %d\n", hdr->wpr_region_id);
0128 nvkm_debug(subdev, "\twprOffset : 0x%x\n", hdr->wpr_offset);
0129 nvkm_debug(subdev, "\tmmuMemoryRange : 0x%x\n",
0130 hdr->mmu_memory_range);
0131 nvkm_debug(subdev, "\tnoRegions : %d\n",
0132 hdr->regions.no_regions);
0133
0134 for (i = 0; i < ARRAY_SIZE(hdr->regions.region_props); i++) {
0135 nvkm_debug(subdev, "\tregion[%d] :\n", i);
0136 nvkm_debug(subdev, "\t startAddr : 0x%x\n",
0137 hdr->regions.region_props[i].start_addr);
0138 nvkm_debug(subdev, "\t endAddr : 0x%x\n",
0139 hdr->regions.region_props[i].end_addr);
0140 nvkm_debug(subdev, "\t regionId : %d\n",
0141 hdr->regions.region_props[i].region_id);
0142 nvkm_debug(subdev, "\t readMask : 0x%x\n",
0143 hdr->regions.region_props[i].read_mask);
0144 nvkm_debug(subdev, "\t writeMask : 0x%x\n",
0145 hdr->regions.region_props[i].write_mask);
0146 nvkm_debug(subdev, "\t clientMask : 0x%x\n",
0147 hdr->regions.region_props[i].client_mask);
0148 nvkm_debug(subdev, "\t shadowMemStartAddr: 0x%x\n",
0149 hdr->regions.region_props[i].shadow_mem_start_addr);
0150 }
0151
0152 nvkm_debug(subdev, "\tucodeBlobSize : %d\n",
0153 hdr->ucode_blob_size);
0154 nvkm_debug(subdev, "\tucodeBlobBase : 0x%llx\n",
0155 hdr->ucode_blob_base);
0156 nvkm_debug(subdev, "\tvprEnabled : %d\n",
0157 hdr->vpr_desc.vpr_enabled);
0158 nvkm_debug(subdev, "\tvprStart : 0x%x\n",
0159 hdr->vpr_desc.vpr_start);
0160 nvkm_debug(subdev, "\tvprEnd : 0x%x\n",
0161 hdr->vpr_desc.vpr_end);
0162 nvkm_debug(subdev, "\thdcpPolicies : 0x%x\n",
0163 hdr->vpr_desc.hdcp_policies);
0164 }