MCPcopy Create free account
hub / github.com/F-Stack/f-stack / intel_max10_device_init

Function intel_max10_device_init

dpdk/drivers/raw/ifpga/base/opae_intel_max10.c:1434–1498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1432}
1433
1434int
1435intel_max10_device_init(struct intel_max10_device *dev)
1436{
1437 int ret = 0;
1438
1439 TAILQ_INIT(&dev->opae_sensor_list);
1440
1441
1442 if (dev->type == M10_N3000) {
1443 dev->ops = &m10bmc_n3000_regmap;
1444 dev->csr = &m10bmc_spi_csr;
1445
1446 dev->raw_blk_ops.write_blk = n3000_bulk_raw_write;
1447 dev->raw_blk_ops.read_blk = n3000_bulk_raw_read;
1448 dev->bmc_ops.flash_read = n3000_flash_read;
1449 dev->bmc_ops.flash_write = n3000_flash_write;
1450
1451 /* check the max10 version */
1452 ret = check_max10_version(dev);
1453 if (ret) {
1454 dev_err(dev, "Failed to find max10 hardware!\n");
1455 return ret;
1456 }
1457
1458 /* load the MAX10 device table */
1459 ret = init_max10_device_table(dev);
1460 if (ret) {
1461 dev_err(dev, "Init max10 device table fail\n");
1462 return ret;
1463 }
1464
1465 /* init max10 devices, like sensor*/
1466 if (dev->flags & MAX10_FLAGS_SECURE)
1467 ret = max10_secure_hw_init(dev);
1468 else
1469 ret = max10_non_secure_hw_init(dev);
1470 if (ret) {
1471 dev_err(dev, "Failed to init max10 hardware!\n");
1472 opae_free(dev->fdt_root);
1473 return ret;
1474 }
1475 } else if (dev->type == M10_N6000) {
1476 dev->ops = &m10bmc_pmci_regmap;
1477 dev->csr = &m10bmc_pmci_csr;
1478 dev->staging_area_size = MAX_STAGING_AREA_SIZE;
1479 dev->flags |= MAX10_FLAGS_SECURE;
1480
1481 dev->bmc_ops.flash_read = pmci_flash_bulk_read;
1482 dev->bmc_ops.flash_write = pmci_flash_bulk_write;
1483 dev->bmc_ops.check_flash_range = pmci_check_flash_address;
1484
1485 ret = max10_sensor_init_table(dev, &n6000bmc_sensor_board_data);
1486 if (ret)
1487 return ret;
1488
1489 ret = pthread_mutex_init(&dev->bmc_ops.lock, NULL);
1490 if (ret)
1491 return ret;

Callers 3

fme_spi_initFunction · 0.85
fme_nios_spi_initFunction · 0.85
fme_pmci_initFunction · 0.85

Calls 6

check_max10_versionFunction · 0.85
init_max10_device_tableFunction · 0.85
max10_secure_hw_initFunction · 0.85
max10_non_secure_hw_initFunction · 0.85
max10_sensor_init_tableFunction · 0.85
pthread_mutex_initFunction · 0.85

Tested by

no test coverage detected