c7e9729da6
CPP refers to the internal NFP Command Push Pull bus. This patch allows to create CPP commands from user space allowing to access any single part of the chip. This CPP interface is the base for having other functionalities like mutexes when accessing specific chip components, chip resources management, firmware upload or using the NSP, an embedded arm processor which can perform tasks on demand. NSP was the previous only way for doing things in the chip by the PMD, where a NSPU interface was used for commands like firmware upload or port link configuration. CPP interface supersedes NSPU, but it is still possible to use NSP through CPP. CPP interface adds a great flexibility for doing things like extended stats or firmware debugging. Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright(c) 2018 Netronome Systems, Inc.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#ifndef NFP_RESOURCE_H
|
|
#define NFP_RESOURCE_H
|
|
|
|
#include "nfp_cpp.h"
|
|
|
|
#define NFP_RESOURCE_NFP_NFFW "nfp.nffw"
|
|
#define NFP_RESOURCE_NFP_HWINFO "nfp.info"
|
|
#define NFP_RESOURCE_NSP "nfp.sp"
|
|
|
|
/**
|
|
* Opaque handle to a NFP Resource
|
|
*/
|
|
struct nfp_resource;
|
|
|
|
struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
|
|
const char *name);
|
|
|
|
/**
|
|
* Release a NFP Resource, and free the handle
|
|
* @param[in] res NFP Resource handle
|
|
*/
|
|
void nfp_resource_release(struct nfp_resource *res);
|
|
|
|
/**
|
|
* Return the CPP ID of a NFP Resource
|
|
* @param[in] res NFP Resource handle
|
|
* @return CPP ID of the NFP Resource
|
|
*/
|
|
uint32_t nfp_resource_cpp_id(const struct nfp_resource *res);
|
|
|
|
/**
|
|
* Return the name of a NFP Resource
|
|
* @param[in] res NFP Resource handle
|
|
* @return Name of the NFP Resource
|
|
*/
|
|
const char *nfp_resource_name(const struct nfp_resource *res);
|
|
|
|
/**
|
|
* Return the target address of a NFP Resource
|
|
* @param[in] res NFP Resource handle
|
|
* @return Address of the NFP Resource
|
|
*/
|
|
uint64_t nfp_resource_address(const struct nfp_resource *res);
|
|
|
|
uint64_t nfp_resource_size(const struct nfp_resource *res);
|
|
|
|
#endif /* NFP_RESOURCE_H */
|