net/nfp: read chip model from PluDevice register
authorHeinrich Kuhn <heinrich.kuhn@netronome.com>
Mon, 25 Jan 2021 15:25:44 +0000 (17:25 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:12 +0000 (18:16 +0100)
commitc0a8b0247533ccae77af853600e58565ad94b0aa
tree7c890a914a8739a7ce09e09fb7995236279a2f83
parentb3e3d602a5ff6b91dd6006328b95e78ccd513f20
net/nfp: read chip model from PluDevice register

For newer smartNIC NVRAM versions the chip model should be read from the
PluDevice register as it provides the authoritative chip model/revision.
This method of reading the chip model is backwards compatible with
legacy NVRAM versions too.

Since the model number is purely used for reporting purposes, follow the
hardware team convention of subtracting 0x10 from the PluDevice register
to obtain the chip model/revision number.

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Louis Peens <louis.peens@netronome.com>
drivers/net/nfp/nfpcore/nfp_cpp.h
drivers/net/nfp/nfpcore/nfp_cppcore.c