Commit 612e94bd authored by Radha Mohan Chintakuntla's avatar Radha Mohan Chintakuntla Committed by David S. Miller

net: thunderx: Introduce BGX_ID_MASK macro to extract bgx_id

This patch fixes the 'bgx_id' determination on 83xx where there are
4 BGX blocks instead of 2 on other platforms.
Signed-off-by: default avatarRadha Mohan Chintakuntla <rchintakuntla@cavium.com>
Signed-off-by: default avatarSunil Goutham <sgoutham@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b71de936
...@@ -1242,8 +1242,8 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1242,8 +1242,8 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_read_config_word(pdev, PCI_DEVICE_ID, &sdevid); pci_read_config_word(pdev, PCI_DEVICE_ID, &sdevid);
if (sdevid != PCI_DEVICE_ID_THUNDER_RGX) { if (sdevid != PCI_DEVICE_ID_THUNDER_RGX) {
bgx->bgx_id = bgx->bgx_id = (pci_resource_start(pdev,
(pci_resource_start(pdev, PCI_CFG_REG_BAR_NUM) >> 24) & 1; PCI_CFG_REG_BAR_NUM) >> 24) & BGX_ID_MASK;
bgx->bgx_id += nic_get_node_id(pdev) * MAX_BGX_PER_NODE; bgx->bgx_id += nic_get_node_id(pdev) * MAX_BGX_PER_NODE;
bgx->max_lmac = MAX_LMAC_PER_BGX; bgx->max_lmac = MAX_LMAC_PER_BGX;
bgx_vnic[bgx->bgx_id] = bgx; bgx_vnic[bgx->bgx_id] = bgx;
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#define MAX_DMAC_PER_LMAC 8 #define MAX_DMAC_PER_LMAC 8
#define MAX_FRAME_SIZE 9216 #define MAX_FRAME_SIZE 9216
#define BGX_ID_MASK 0x3
#define MAX_DMAC_PER_LMAC_TNS_BYPASS_MODE 2 #define MAX_DMAC_PER_LMAC_TNS_BYPASS_MODE 2
/* Registers */ /* Registers */
......
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