OPAE Intel FPGA Linux Device Driver Architecture Guide

ID 683857
Date 10/02/2017
Public
Document Table of Contents

1.1.8.2. Enumeration Flow

  • ccidrv_init()
    • Initialize fpga_ids using idr_init().
    • Initialize fpga_chrdevs[i].devt using alloc_chrdev_region().
    • Initialize fpga_class using class_create().
    • pci_register_driver(&cci_pci_driver);
  • cci_pci_probe()
    • Enable the PCI device, request access to its regions, set PCI master mode, configure DMA.
  • cci_pci_create_feature_devs() build_info_alloc_and_init()
    • Allocate a struct build_feature_devs_info, initialize it.
    • .parent_dev is set to a parent sysfs directory (intel-fpga-dev.id) that contains the FME and Port sysfs directories.
  • parse_feature_list()
    • Walk the BAR0 Device Feature List to discover the FME, the Port, and their private features.
  • parse_feature() parse_feature_afus() parse_feature_fme()
    • When an FME is encountered:
      • build_info_create_dev()
        • Allocate a platform device for the FME, storing in build_feature_devs_info.feature_dev.
        • feature_dev.id is initialized to the result of idr_alloc(fpga_ids[FME_ID],
        • feature_dev.parent is set to build_feature_devs_info.parent_dev.
        • Allocate an array of struct resource in feature_dev.resource.
      • Allocate a struct feature_platform_data, initialize it, and store a pointer in feature_dev.dev.platform_data
        • create_feature_instance() build_info_add_sub_feature()
        • Initialize feature_dev.resource[FME_FEATURE_ID_HEADER].
        • feature_platform_data_add()
        • Initialize feature_platform_data.features[FME_FEATURE_ID_HEADER], everything but .fops.
  • parse_feature() parse_feature_afus() parse_feature_port()
    • When a Port is encountered:
      • build_info_create_dev()
        • Allocate a platform device for the Port, storing in build_feature_devs_info.feature_dev.
        • feature_dev.id is initialized to the result of idr_alloc(fpga_ids[PORT_ID],
        • feature_dev.parent is set to build_feature_devs_info.parent_dev.
        • Allocate an array of struct resource in feature_dev.resource.
        • Allocate a struct feature_platform_data, initialize it, and store a pointer in feature_dev.dev.platform_data
      • build_info_commit_dev()
        • Add the struct feature_platform_data.node for the Port to the list of Ports in struct cci_drvdata.port_dev_list
      • create_feature_instance() build_info_add_sub_feature()
        • Initialize feature_dev.resource[PORT_FEATURE_ID_HEADER].
      • feature_platform_data_add()
        • Initialize feature_platform_data.features[PORT_FEATURE_ID_HEADER], everything but .fops.
  • parse_feature() parse_feature_afus() parse_feature_port_uafu()
    • – When an AFU is encountered:
      • create_feature_instance() build_info_add_sub_feature()
        • Initialize feature_dev.resource[PORT_FEATURE_ID_UAFU].
      • feature_platform_data_add()
        • Initialize feature_platform_data.features[PORT_FEATURE_ID_UAFU], everything but .fops.
  • parse_feature() parse_feature_private() parse_feature_fme_private()
    • When an FME private feature is encountered:
      • create_feature_instance() build_info_add_sub_feature()
        • Initialize feature_dev.resource[id].
      • feature_platform_data_add()
        • Initialize feature_platform_data.features[id], everything but .fops.
  • parse_feature() parse_feature_private() parse_feature_port_private()
  • When a Port private feature is encountered: * create_feature_instance() build_info_add_sub_feature() * Initialize feature_dev.resource[id]. * feature_platform_data_add() * Initialize feature_platform_data.features[id], everything but .fops.
  • parse_ports_from_fme()
    • If the driver is loaded on the Physical Function (PF), then:
      • Run the parse_feature_list() flow on each port described in the FME header.
      • Use the BAR mentioned in each Port entry in the header.