Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc/tegra: cbb: Add support for CBB fabrics in Tegra264

Add support for CBB 2.0 based fabrics in Tegra264 SoC using DT. Fabrics
reporting errors are: SYSTEM, TOP0, UPHY0 and VISION.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Sumit Gupta and committed by
Thierry Reding
fa4854a9 5f2c2c43

+279
+279
drivers/soc/tegra/cbb/tegra234-cbb.c
··· 89 89 T234_MAX_FABRIC_ID, 90 90 }; 91 91 92 + enum tegra264_cbb_fabric_ids { 93 + T264_SYSTEM_CBB_FABRIC_ID, 94 + T264_TOP_0_CBB_FABRIC_ID, 95 + T264_VISION_CBB_FABRIC_ID, 96 + T264_DISP_USB_CBB_FABRIC_ID, 97 + T264_UPHY0_CBB_FABRIC_ID, 98 + T264_RSVD0_FABRIC_ID, 99 + T264_RSVD1_FABRIC_ID, 100 + T264_RSVD2_FABRIC_ID, 101 + T264_RSVD3_FABRIC_ID, 102 + T264_RSVD4_FABRIC_ID, 103 + T264_RSVD5_FABRIC_ID, 104 + T264_AON_FABRIC_ID, 105 + T264_PSC_FABRIC_ID, 106 + T264_OESP_FABRIC_ID, 107 + T264_APE_FABRIC_ID, 108 + T264_BPMP_FABRIC_ID, 109 + T264_RCE_0_FABRIC_ID, 110 + T264_RCE_1_FABRIC_ID, 111 + T264_RSVD6_FABRIC_ID, 112 + T264_DCE_FABRIC_ID, 113 + T264_FSI_FABRIC_ID, 114 + T264_ISC_FABRIC_ID, 115 + T264_SB_FABRIC_ID, 116 + T264_ISC_CPU_FABRIC_ID, 117 + T264_RSVD7_FABRIC_ID, 118 + }; 119 + 92 120 struct tegra234_target_lookup { 93 121 const char *name; 94 122 unsigned int offset; ··· 482 454 483 455 tegra_cbb_print_err(file, "\t Fabric\t\t: %s (id:%#x)\n", 484 456 cbb->fabric->fab_list[fab_id].name, fab_id); 457 + 458 + if (of_machine_is_compatible("nvidia,tegra264") && fab_id == T264_UPHY0_CBB_FABRIC_ID) { 459 + /* 460 + * In T264, AON Fabric ID value is incorrectly same as UPHY0 fabric ID. 461 + * For 'ID = 0x4', we must check for the address which caused the error 462 + * to find the correct fabric which returned error. 463 + */ 464 + tegra_cbb_print_err(file, "\t or Fabric\t\t: %s\n", 465 + cbb->fabric->fab_list[T264_AON_FABRIC_ID].name); 466 + tegra_cbb_print_err(file, "\t Please use Address to determine correct fabric.\n"); 467 + } 485 468 486 469 tegra_cbb_print_err(file, "\t Target_Id\t\t: %#x\n", target_id); 487 470 tegra_cbb_print_err(file, "\t Burst_length\t\t: %#x\n", burst_length); ··· 1182 1143 .firewall_wr_ctl = 0x8e8, 1183 1144 }; 1184 1145 1146 + static const char * const tegra264_initiator_id[] = { 1147 + [0x0] = "TZ", 1148 + [0x1] = "CCPLEX", 1149 + [0x2] = "ISC", 1150 + [0x3] = "BPMP_FW", 1151 + [0x4] = "AON", 1152 + [0x5] = "MSS_SEQ", 1153 + [0x6] = "GPCDMA_P", 1154 + [0x7] = "TSECA_NONSECURE", 1155 + [0x8] = "TSECA_LIGHTSECURE", 1156 + [0x9] = "TSECA_HEAVYSECURE", 1157 + [0xa] = "CORESIGHT", 1158 + [0xb] = "APE_0", 1159 + [0xc] = "APE_1", 1160 + [0xd] = "PEATRANS", 1161 + [0xe] = "JTAGM_DFT", 1162 + [0xf] = "RCE", 1163 + [0x10] = "DCE", 1164 + [0x11] = "PSC_FW_USER", 1165 + [0x12] = "PSC_FW_SUPERVISOR", 1166 + [0x13] = "PSC_FW_MACHINE", 1167 + [0x14] = "PSC_BOOT", 1168 + [0x15] = "BPMP_BOOT", 1169 + [0x16] = "GPU_0", 1170 + [0x17] = "GPU_1", 1171 + [0x18] = "GPU_2", 1172 + [0x19] = "GPU_3", 1173 + [0x1a] = "GPU_4", 1174 + [0x1b] = "PSC_EXT_BOOT", 1175 + [0x1c] = "PSC_EXT_RUNTIME", 1176 + [0x1d] = "OESP_EXT", 1177 + [0x1e] = "SB_EXT", 1178 + [0x1f] = "FSI_SAFETY_0", 1179 + [0x20] = "FSI_SAFETY_1", 1180 + [0x21] = "FSI_SAFETY_2", 1181 + [0x22] = "FSI_SAFETY_3", 1182 + [0x23] = "FSI_CHSM", 1183 + [0x24] = "RCE_1", 1184 + [0x25] = "BPMP_OEM_FW", 1185 + [0x26 ... 0x3d] = "RSVD", 1186 + [0x3e] = "CBB_SMN", 1187 + [0x3f] = "CBB_RSVD" 1188 + }; 1189 + 1190 + static const struct tegra234_target_lookup tegra264_top0_cbb_target_map[] = { 1191 + { "RSVD", 0x000000 }, 1192 + { "CBB_CENTRAL", 0xC020000 }, 1193 + { "AXI2APB_1", 0x80000 }, 1194 + { "AXI2APB_10", 0x81000 }, 1195 + { "AXI2APB_11", 0x82000 }, 1196 + { "RSVD", 0x00000 }, 1197 + { "RSVD", 0x00000 }, 1198 + { "AXI2APB_14", 0x83000 }, 1199 + { "AXI2APB_15", 0x84000 }, 1200 + { "AXI2APB_16", 0x85000 }, 1201 + { "AXI2APB_17", 0x86000 }, 1202 + { "AXI2APB_2", 0x87000 }, 1203 + { "AXI2APB_3", 0x88000 }, 1204 + { "RSVD", 0x00000 }, 1205 + { "AXI2APB_5", 0x8A000 }, 1206 + { "AXI2APB_6", 0x8B000 }, 1207 + { "AXI2APB_7", 0x8C000 }, 1208 + { "AXI2APB_8", 0x8D000 }, 1209 + { "AXI2APB_9", 0x8E000 }, 1210 + { "FSI_SLAVE", 0x64000 }, 1211 + { "DISP_USB_CBB_T", 0x65000 }, 1212 + { "SYSTEM_CBB_T", 0x66000 }, 1213 + { "UPHY0_CBB_T", 0x67000 }, 1214 + { "VISION_CBB_T", 0x68000 }, 1215 + { "CCPLEX_SLAVE", 0x69000 }, 1216 + { "PCIE_C0", 0x6A000 }, 1217 + { "SMN_UCF_RX_0", 0x6B000 }, 1218 + { "SMN_UCF_RX_1", 0x6C000 }, 1219 + { "AXI2APB_4", 0x89000 }, 1220 + }; 1221 + 1222 + static const struct tegra234_target_lookup tegra264_sys_cbb_target_map[] = { 1223 + { "RSVD", 0x00000 }, 1224 + { "AXI2APB_1", 0xE1000 }, 1225 + { "RSVD", 0x00000 }, 1226 + { "AON_SLAVE", 0x79000 }, 1227 + { "APE_SLAVE", 0x73000 }, 1228 + { "BPMP_SLAVE", 0x74000 }, 1229 + { "OESP_SLAVE", 0x75000 }, 1230 + { "PSC_SLAVE", 0x76000 }, 1231 + { "SB_SLAVE", 0x7A000 }, 1232 + { "SMN_SYSTEM_RX", 0x7B000 }, 1233 + { "STM", 0x77000 }, 1234 + { "RSVD", 0x00000 }, 1235 + { "AXI2APB_3", 0xE3000 }, 1236 + { "TOP_CBB_T", 0x7C000 }, 1237 + { "AXI2APB_2", 0xE4000 }, 1238 + { "AXI2APB_4", 0xE5000 }, 1239 + { "AXI2APB_5", 0xE6000 }, 1240 + }; 1241 + 1242 + static const struct tegra234_target_lookup tegra264_uphy0_cbb_target_map[] = { 1243 + [0 ... 20] = { "RSVD", 0x00000 }, 1244 + { "AXI2APB_1", 0x71000 }, 1245 + { "RSVD", 0x00000 }, 1246 + { "AXI2APB_3", 0x75000 }, 1247 + { "SMN_UPHY0_RX", 0x53000 }, 1248 + { "RSVD", 0x00000 }, 1249 + { "RSVD", 0x00000 }, 1250 + { "RSVD", 0x00000 }, 1251 + { "RSVD", 0x00000 }, 1252 + { "PCIE_C4", 0x4B000 }, 1253 + { "AXI2APB_2", 0x74000 }, 1254 + { "AXI2APB_4", 0x76000 }, 1255 + { "AXI2APB_5", 0x77000 }, 1256 + { "RSVD", 0x00000 }, 1257 + { "AXI2APB_7", 0x79000 }, 1258 + { "PCIE_C2", 0x56000 }, 1259 + { "RSVD", 0x00000 }, 1260 + { "RSVD", 0x00000 }, 1261 + { "PCIE_C1", 0x55000 }, 1262 + { "RSVD", 0x00000 }, 1263 + { "AXI2APB_10", 0x72000 }, 1264 + { "AXI2APB_11", 0x7C000 }, 1265 + { "AXI2APB_8", 0x7A000 }, 1266 + { "AXI2APB_9", 0x7B000 }, 1267 + { "RSVD", 0x00000 }, 1268 + { "RSVD", 0x00000 }, 1269 + { "PCIE_C5", 0x4E000 }, 1270 + { "PCIE_C3", 0x58000 }, 1271 + { "RSVD", 0x00000 }, 1272 + { "ISC_SLAVE", 0x54000 }, 1273 + { "TOP_CBB_T", 0x57000 }, 1274 + { "AXI2APB_12", 0x7D000 }, 1275 + { "AXI2APB_13", 0x70000 }, 1276 + { "AXI2APB_6", 0x7E000 }, 1277 + }; 1278 + 1279 + static const struct tegra234_target_lookup tegra264_vision_cbb_target_map[] = { 1280 + [0 ... 5] = { "RSVD", 0x0 }, 1281 + { "HOST1X", 0x45000 }, 1282 + { "RSVD", 0x00000 }, 1283 + { "RSVD", 0x00000 }, 1284 + { "AXI2APB_2", 0x71000 }, 1285 + { "RSVD", 0x00000 }, 1286 + { "RSVD", 0x00000 }, 1287 + { "SMN_VISION_RX", 0x47000 }, 1288 + [13 ... 19] = { "RSVD", 0x0 }, 1289 + { "RCE_0_SLAVE", 0x4B000 }, 1290 + { "RCE_1_SLAVE", 0x4C000 }, 1291 + { "AXI2APB_1", 0x72000 }, 1292 + { "AXI2APB_3", 0x73000 }, 1293 + { "TOP_CBB_T", 0x4D000 }, 1294 + 1295 + }; 1296 + 1297 + static const struct tegra234_fabric_lookup tegra264_cbb_fab_list[] = { 1298 + [T264_SYSTEM_CBB_FABRIC_ID] = { "system-cbb-fabric", true, 1299 + tegra264_sys_cbb_target_map, 1300 + ARRAY_SIZE(tegra264_sys_cbb_target_map) }, 1301 + [T264_TOP_0_CBB_FABRIC_ID] = { "top0-cbb-fabric", true, 1302 + tegra264_top0_cbb_target_map, 1303 + ARRAY_SIZE(tegra264_top0_cbb_target_map) }, 1304 + [T264_VISION_CBB_FABRIC_ID] = { "vision-cbb-fabric", true, 1305 + tegra264_vision_cbb_target_map, 1306 + ARRAY_SIZE(tegra264_vision_cbb_target_map) }, 1307 + [T264_DISP_USB_CBB_FABRIC_ID] = { "disp-usb-cbb-fabric" }, 1308 + [T264_UPHY0_CBB_FABRIC_ID] = { "uphy0-cbb-fabric", true, 1309 + tegra264_uphy0_cbb_target_map, 1310 + ARRAY_SIZE(tegra264_uphy0_cbb_target_map) }, 1311 + [T264_AON_FABRIC_ID] = { "aon-fabric" }, 1312 + [T264_PSC_FABRIC_ID] = { "psc-fabric" }, 1313 + [T264_OESP_FABRIC_ID] = { "oesp-fabric" }, 1314 + [T264_APE_FABRIC_ID] = { "ape-fabirc" }, 1315 + [T264_BPMP_FABRIC_ID] = { "bpmp-fabric" }, 1316 + [T264_RCE_0_FABRIC_ID] = { "rce0-fabric" }, 1317 + [T264_RCE_1_FABRIC_ID] = { "rce1-fabric" }, 1318 + [T264_DCE_FABRIC_ID] = { "dce-fabric" }, 1319 + [T264_FSI_FABRIC_ID] = { "fsi-fabric" }, 1320 + [T264_ISC_FABRIC_ID] = { "isc-fabric" }, 1321 + [T264_SB_FABRIC_ID] = { "sb-fabric" }, 1322 + [T264_ISC_CPU_FABRIC_ID] = { "isc-cpu-fabric" }, 1323 + }; 1324 + 1325 + static const struct tegra234_cbb_fabric tegra264_top0_cbb_fabric = { 1326 + .fab_id = T264_TOP_0_CBB_FABRIC_ID, 1327 + .fab_list = tegra264_cbb_fab_list, 1328 + .initiator_id = tegra264_initiator_id, 1329 + .errors = tegra241_cbb_errors, 1330 + .max_errors = ARRAY_SIZE(tegra241_cbb_errors), 1331 + .err_intr_enbl = 0x7, 1332 + .err_status_clr = 0x1ff007f, 1333 + .notifier_offset = 0x90000, 1334 + .off_mask_erd = 0x4a004, 1335 + .firewall_base = 0x3c0000, 1336 + .firewall_ctl = 0x5b0, 1337 + .firewall_wr_ctl = 0x5a8, 1338 + }; 1339 + 1340 + static const struct tegra234_cbb_fabric tegra264_sys_cbb_fabric = { 1341 + .fab_id = T264_SYSTEM_CBB_FABRIC_ID, 1342 + .fab_list = tegra264_cbb_fab_list, 1343 + .initiator_id = tegra264_initiator_id, 1344 + .errors = tegra241_cbb_errors, 1345 + .max_errors = ARRAY_SIZE(tegra241_cbb_errors), 1346 + .err_intr_enbl = 0xf, 1347 + .err_status_clr = 0x1ff007f, 1348 + .notifier_offset = 0x40000, 1349 + .firewall_base = 0x29c000, 1350 + .firewall_ctl = 0x170, 1351 + .firewall_wr_ctl = 0x168, 1352 + }; 1353 + 1354 + static const struct tegra234_cbb_fabric tegra264_uphy0_cbb_fabric = { 1355 + .fab_id = T264_UPHY0_CBB_FABRIC_ID, 1356 + .fab_list = tegra264_cbb_fab_list, 1357 + .initiator_id = tegra264_initiator_id, 1358 + .errors = tegra241_cbb_errors, 1359 + .max_errors = ARRAY_SIZE(tegra241_cbb_errors), 1360 + .err_intr_enbl = 0x1, 1361 + .err_status_clr = 0x1ff007f, 1362 + .notifier_offset = 0x80000, 1363 + .firewall_base = 0x360000, 1364 + .firewall_ctl = 0x590, 1365 + .firewall_wr_ctl = 0x588, 1366 + }; 1367 + 1368 + static const struct tegra234_cbb_fabric tegra264_vision_cbb_fabric = { 1369 + .fab_id = T264_VISION_CBB_FABRIC_ID, 1370 + .fab_list = tegra264_cbb_fab_list, 1371 + .initiator_id = tegra264_initiator_id, 1372 + .errors = tegra241_cbb_errors, 1373 + .max_errors = ARRAY_SIZE(tegra241_cbb_errors), 1374 + .err_intr_enbl = 0x1, 1375 + .err_status_clr = 0x1ff007f, 1376 + .notifier_offset = 0x80000, 1377 + .firewall_base = 0x290000, 1378 + .firewall_ctl = 0x5d0, 1379 + .firewall_wr_ctl = 0x5c8, 1380 + }; 1381 + 1185 1382 static const struct of_device_id tegra234_cbb_dt_ids[] = { 1186 1383 { .compatible = "nvidia,tegra234-cbb-fabric", .data = &tegra234_cbb_fabric }, 1187 1384 { .compatible = "nvidia,tegra234-aon-fabric", .data = &tegra234_aon_fabric }, ··· 1425 1150 { .compatible = "nvidia,tegra234-dce-fabric", .data = &tegra234_dce_fabric }, 1426 1151 { .compatible = "nvidia,tegra234-rce-fabric", .data = &tegra234_rce_fabric }, 1427 1152 { .compatible = "nvidia,tegra234-sce-fabric", .data = &tegra234_sce_fabric }, 1153 + { .compatible = "nvidia,tegra264-sys-cbb-fabric", .data = &tegra264_sys_cbb_fabric }, 1154 + { .compatible = "nvidia,tegra264-top0-cbb-fabric", .data = &tegra264_top0_cbb_fabric }, 1155 + { .compatible = "nvidia,tegra264-uphy0-cbb-fabric", .data = &tegra264_uphy0_cbb_fabric }, 1156 + { .compatible = "nvidia,tegra264-vision-cbb-fabric", .data = &tegra264_vision_cbb_fabric }, 1428 1157 { /* sentinel */ }, 1429 1158 }; 1430 1159 MODULE_DEVICE_TABLE(of, tegra234_cbb_dt_ids);