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: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Fei Qin <fei.qin@corigine.com> Signed-off-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
f524b335c0
commit
9ba1dc994f
@ -685,8 +685,7 @@ static int nfp_pci_probe(struct pci_dev *pdev,
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
||||
err = dma_set_mask_and_coherent(&pdev->dev,
|
||||
DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS));
|
||||
err = dma_set_mask_and_coherent(&pdev->dev, dev_info->dma_mask);
|
||||
if (err)
|
||||
goto err_pci_disable;
|
||||
|
||||
|
@ -63,9 +63,6 @@
|
||||
#define NFP_NET_Q0_BAR 2
|
||||
#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 */
|
||||
#define NFP_NET_DEFAULT_MTU 1500U
|
||||
|
||||
|
@ -98,8 +98,7 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev,
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
||||
err = dma_set_mask_and_coherent(&pdev->dev,
|
||||
DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS));
|
||||
err = dma_set_mask_and_coherent(&pdev->dev, dev_info->dma_mask);
|
||||
if (err)
|
||||
goto err_pci_regions;
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
/* Copyright (C) 2019 Netronome Systems, Inc. */
|
||||
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
#include "nfp_dev.h"
|
||||
|
||||
const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = {
|
||||
[NFP_DEV_NFP6000] = {
|
||||
.dma_mask = DMA_BIT_MASK(40),
|
||||
.chip_names = "NFP4000/NFP5000/NFP6000",
|
||||
.pcie_cfg_expbar_offset = 0x0400,
|
||||
.pcie_expl_offset = 0x1000,
|
||||
|
@ -12,6 +12,7 @@ enum nfp_dev_id {
|
||||
};
|
||||
|
||||
struct nfp_dev_info {
|
||||
u64 dma_mask;
|
||||
const char *chip_names;
|
||||
u32 pcie_cfg_expbar_offset;
|
||||
u32 pcie_expl_offset;
|
||||
|
Loading…
x
Reference in New Issue
Block a user