84a972a54b
Add support for reading NPA/SSO pf_func which will be used by a PSM to access NPA/SSO. PSM is a hardware block capable of dispatching jobs to different blocks within a baseband module. Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com> Reviewed-by: Jerin Jacob <jerinj@marvell.com>
53 lines
699 B
C
53 lines
699 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright(C) 2021 Marvell.
|
|
*/
|
|
|
|
#include "roc_api.h"
|
|
#include "roc_priv.h"
|
|
|
|
int
|
|
roc_bphy_dev_init(struct roc_bphy *roc_bphy)
|
|
{
|
|
struct idev_cfg *idev;
|
|
|
|
idev = idev_get_cfg();
|
|
if (!idev)
|
|
return -ENODEV;
|
|
|
|
if (!roc_bphy || !roc_bphy->pci_dev)
|
|
return -EINVAL;
|
|
|
|
idev->bphy = roc_bphy;
|
|
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
roc_bphy_dev_fini(struct roc_bphy *roc_bphy)
|
|
{
|
|
struct idev_cfg *idev;
|
|
|
|
idev = idev_get_cfg();
|
|
if (!idev)
|
|
return -ENODEV;
|
|
|
|
if (!roc_bphy)
|
|
return -EINVAL;
|
|
|
|
idev->bphy = NULL;
|
|
|
|
return 0;
|
|
}
|
|
|
|
uint16_t
|
|
roc_bphy_npa_pf_func_get(void)
|
|
{
|
|
return idev_npa_pffunc_get();
|
|
}
|
|
|
|
uint16_t
|
|
roc_bphy_sso_pf_func_get(void)
|
|
{
|
|
return idev_sso_pffunc_get();
|
|
}
|