Skip to content

Commit

Permalink
crypto: ccp: Add support to detect CCP devices on Hygon 4th CPUs
Browse files Browse the repository at this point in the history
hygon inclusion
category: feature
CVE: NA

---------------------------

Since Hygon 4th CPUs, there are new Secure Processor devices with 3
different PCI device IDs, add them in the device list.

Signed-off-by: Xin Jiang <[email protected]>
Signed-off-by: hanliyang <[email protected]>
  • Loading branch information
Xin Jiang authored and Avenger-285714 committed Jul 29, 2024
1 parent a599f4d commit 1308a0d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/crypto/ccp/hygon/sp-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ static const struct psp_vdata pspv1 = {
.intsts_reg = 0x10614, /* P2CMSG_INTSTS */
};

static const struct psp_vdata pspv2 = {
.sev = &csvv1,
.feature_reg = 0x105fc,
.inten_reg = 0x10670,
.intsts_reg = 0x10674,
};

#endif

const struct sp_dev_vdata hygon_dev_vdata[] = {
Expand All @@ -44,6 +51,15 @@ const struct sp_dev_vdata hygon_dev_vdata[] = {
.bar = 2,
#ifdef CONFIG_CRYPTO_DEV_SP_CCP
.ccp_vdata = &ccpv5b,
#endif
},
{ /* 2 */
.bar = 2,
#ifdef CONFIG_CRYPTO_DEV_SP_CCP
.ccp_vdata = &ccpv5a,
#endif
#ifdef CONFIG_CRYPTO_DEV_SP_PSP
.psp_vdata = &pspv2,
#endif
},
};
3 changes: 3 additions & 0 deletions drivers/crypto/ccp/sp-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,9 @@ static const struct pci_device_id sp_pci_table[] = {
{ PCI_VDEVICE(AMD, 0x156E), (kernel_ulong_t)&dev_vdata[8] },
{ PCI_VDEVICE(HYGON, 0x1456), (kernel_ulong_t)&hygon_dev_vdata[0] },
{ PCI_VDEVICE(HYGON, 0x1468), (kernel_ulong_t)&hygon_dev_vdata[1] },
{ PCI_VDEVICE(HYGON, 0x1486), (kernel_ulong_t)&hygon_dev_vdata[2] },
{ PCI_VDEVICE(HYGON, 0x14b8), (kernel_ulong_t)&hygon_dev_vdata[1] },
{ PCI_VDEVICE(HYGON, 0x14a6), (kernel_ulong_t)&hygon_dev_vdata[2] },
/* Last entry must be zero */
{ 0, }
};
Expand Down

0 comments on commit 1308a0d

Please sign in to comment.