Commit 8315f9b2 authored by Sunil Goutham's avatar Sunil Goutham Committed by David S. Miller

octeontx2-af: Set discovery ID for RVUM block

Currently there is no way for AF dependent drivers in
any domain to check if the AF driver is loaded. This
patch sets an ID for RVUM block which will automatically
reflects in PF/VFs discovery register which they can
check and defer their probe until AF is up.
Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f4eebf2
...@@ -421,6 +421,19 @@ static void rvu_check_block_implemented(struct rvu *rvu) ...@@ -421,6 +421,19 @@ static void rvu_check_block_implemented(struct rvu *rvu)
} }
} }
static void rvu_setup_rvum_blk_revid(struct rvu *rvu)
{
rvu_write64(rvu, BLKADDR_RVUM,
RVU_PRIV_BLOCK_TYPEX_REV(BLKTYPE_RVUM),
RVU_BLK_RVUM_REVID);
}
static void rvu_clear_rvum_blk_revid(struct rvu *rvu)
{
rvu_write64(rvu, BLKADDR_RVUM,
RVU_PRIV_BLOCK_TYPEX_REV(BLKTYPE_RVUM), 0x00);
}
int rvu_lf_reset(struct rvu *rvu, struct rvu_block *block, int lf) int rvu_lf_reset(struct rvu *rvu, struct rvu_block *block, int lf)
{ {
int err; int err;
...@@ -2591,6 +2604,8 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2591,6 +2604,8 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (err) if (err)
goto err_flr; goto err_flr;
rvu_setup_rvum_blk_revid(rvu);
/* Enable AF's VFs (if any) */ /* Enable AF's VFs (if any) */
err = rvu_enable_sriov(rvu); err = rvu_enable_sriov(rvu);
if (err) if (err)
...@@ -2611,6 +2626,7 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2611,6 +2626,7 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
rvu_fwdata_exit(rvu); rvu_fwdata_exit(rvu);
rvu_reset_all_blocks(rvu); rvu_reset_all_blocks(rvu);
rvu_free_hw_resources(rvu); rvu_free_hw_resources(rvu);
rvu_clear_rvum_blk_revid(rvu);
err_release_regions: err_release_regions:
pci_release_regions(pdev); pci_release_regions(pdev);
err_disable_device: err_disable_device:
...@@ -2635,7 +2651,7 @@ static void rvu_remove(struct pci_dev *pdev) ...@@ -2635,7 +2651,7 @@ static void rvu_remove(struct pci_dev *pdev)
rvu_disable_sriov(rvu); rvu_disable_sriov(rvu);
rvu_reset_all_blocks(rvu); rvu_reset_all_blocks(rvu);
rvu_free_hw_resources(rvu); rvu_free_hw_resources(rvu);
rvu_clear_rvum_blk_revid(rvu);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#ifndef RVU_STRUCT_H #ifndef RVU_STRUCT_H
#define RVU_STRUCT_H #define RVU_STRUCT_H
/* RVU Block revision IDs */
#define RVU_BLK_RVUM_REVID 0x01
/* RVU Block Address Enumeration */ /* RVU Block Address Enumeration */
enum rvu_block_addr_e { enum rvu_block_addr_e {
BLKADDR_RVUM = 0x0ULL, BLKADDR_RVUM = 0x0ULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment