Commit 9ba1dc99 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Jakub Kicinski

nfp: use dev_info for the DMA mask

In preparation for new chips instead of defines use dev_info constants
to store DMA mask length.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarFei Qin <fei.qin@corigine.com>
Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f524b335
...@@ -685,8 +685,7 @@ static int nfp_pci_probe(struct pci_dev *pdev, ...@@ -685,8 +685,7 @@ static int nfp_pci_probe(struct pci_dev *pdev,
pci_set_master(pdev); pci_set_master(pdev);
err = dma_set_mask_and_coherent(&pdev->dev, err = dma_set_mask_and_coherent(&pdev->dev, dev_info->dma_mask);
DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS));
if (err) if (err)
goto err_pci_disable; goto err_pci_disable;
......
...@@ -63,9 +63,6 @@ ...@@ -63,9 +63,6 @@
#define NFP_NET_Q0_BAR 2 #define NFP_NET_Q0_BAR 2
#define NFP_NET_Q1_BAR 4 /* OBSOLETE */ #define NFP_NET_Q1_BAR 4 /* OBSOLETE */
/* Max bits in DMA address */
#define NFP_NET_MAX_DMA_BITS 40
/* Default size for MTU and freelist buffer sizes */ /* Default size for MTU and freelist buffer sizes */
#define NFP_NET_DEFAULT_MTU 1500U #define NFP_NET_DEFAULT_MTU 1500U
......
...@@ -98,8 +98,7 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev, ...@@ -98,8 +98,7 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev,
pci_set_master(pdev); pci_set_master(pdev);
err = dma_set_mask_and_coherent(&pdev->dev, err = dma_set_mask_and_coherent(&pdev->dev, dev_info->dma_mask);
DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS));
if (err) if (err)
goto err_pci_regions; goto err_pci_regions;
......
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/* Copyright (C) 2019 Netronome Systems, Inc. */ /* Copyright (C) 2019 Netronome Systems, Inc. */
#include <linux/dma-mapping.h>
#include "nfp_dev.h" #include "nfp_dev.h"
const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = {
[NFP_DEV_NFP6000] = { [NFP_DEV_NFP6000] = {
.dma_mask = DMA_BIT_MASK(40),
.chip_names = "NFP4000/NFP5000/NFP6000", .chip_names = "NFP4000/NFP5000/NFP6000",
.pcie_cfg_expbar_offset = 0x0400, .pcie_cfg_expbar_offset = 0x0400,
.pcie_expl_offset = 0x1000, .pcie_expl_offset = 0x1000,
......
...@@ -12,6 +12,7 @@ enum nfp_dev_id { ...@@ -12,6 +12,7 @@ enum nfp_dev_id {
}; };
struct nfp_dev_info { struct nfp_dev_info {
u64 dma_mask;
const char *chip_names; const char *chip_names;
u32 pcie_cfg_expbar_offset; u32 pcie_cfg_expbar_offset;
u32 pcie_expl_offset; u32 pcie_expl_offset;
......
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