• Ohad Sharabi's avatar
    habanalabs: expose ASIC specific PCI info to common code · c592c270
    Ohad Sharabi authored
    LKD has interfaces in which it receives device address.
    For instance the debugfs_read/write variants receives device address for
    CFG/SRAM/DRAM for read/write and need to translate to the mapped PCI BAR
    address.
    
    In addition, the dynamic FW load protocol dictates that the address to
    which the LKD will copy the image for the next FW component will be
    received as a device address and can be placed either in SRAM or DRAM.
    
    We need to distinguish those regions as the access methods to those
    regions are different (in DRAM we possibly need to set the BAR base).
    
    Looking forward this code will be used to remove duplicated code in the
    debugfs_read/write that search the memory region for the input device
    address.
    Signed-off-by: default avatarOhad Sharabi <osharabi@habana.ai>
    Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
    Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
    c592c270
goya.c 152 KB