mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-31 22:23:05 +00:00

Number of RVU PFs on CN20K silicon have increased to 96 from maximum of 32 that were supported on earlier silicons. Every RVU PF and VF is identified by HW using a 16bit PF_FUNC value. Due to the change in Max number of PFs in CN20K, the bit encoding of this PF_FUNC has changed. This patch handles the change by using helper functions(using silicon check) to use PF,VF masks and shifts to support both new silicon CN20K, OcteonTx series. These helper functions are used in different modules. Also moved the NIX AF register offset macros to other files which will be posted in coming patches. Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sai Krishna <saikrishnag@marvell.com> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> Link: https://patch.msgid.link/1749639716-13868-2-git-send-email-sbhatta@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
26 lines
465 B
C
26 lines
465 B
C
/* SPDX-License-Identifier: GPL-2.0-only
|
|
* Copyright (C) 2024 Marvell.
|
|
*/
|
|
|
|
#ifndef __SOC_SILICON_H
|
|
#define __SOC_SILICON_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/pci.h>
|
|
|
|
#if defined(CONFIG_ARM64)
|
|
|
|
#define CN20K_CHIPID 0x20
|
|
/*
|
|
* Silicon check for CN20K family
|
|
*/
|
|
static inline bool is_cn20k(struct pci_dev *pdev)
|
|
{
|
|
return (pdev->subsystem_device & 0xFF) == CN20K_CHIPID;
|
|
}
|
|
#else
|
|
#define is_cn20k(pdev) ((void)(pdev), 0)
|
|
#endif
|
|
|
|
#endif /* __SOC_SILICON_H */
|