crypto: ccp - Remove check for x86 family and model
Each x86 SoC will make use of a unique PCI ID for the CCP device so it is not necessary to check for the CPU family and model. Signed-off-by: Gary R Hook <gary.hook@amd.com> Acked-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
ce0ae266fe
commit
3f19ce2054
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AMD Cryptographic Coprocessor (CCP) driver
|
* AMD Cryptographic Coprocessor (CCP) driver
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Advanced Micro Devices, Inc.
|
* Copyright (C) 2013,2016 Advanced Micro Devices, Inc.
|
||||||
*
|
*
|
||||||
* Author: Tom Lendacky <thomas.lendacky@amd.com>
|
* Author: Tom Lendacky <thomas.lendacky@amd.com>
|
||||||
*
|
*
|
||||||
@ -577,41 +577,22 @@ bool ccp_queues_suspended(struct ccp_device *ccp)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_X86
|
|
||||||
static const struct x86_cpu_id ccp_support[] = {
|
|
||||||
{ X86_VENDOR_AMD, 22, },
|
|
||||||
{ },
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int __init ccp_mod_init(void)
|
static int __init ccp_mod_init(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_X86
|
#ifdef CONFIG_X86
|
||||||
struct cpuinfo_x86 *cpuinfo = &boot_cpu_data;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!x86_match_cpu(ccp_support))
|
ret = ccp_pci_init();
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/* Don't leave the driver loaded if init failed */
|
||||||
|
if (!ccp_get_device()) {
|
||||||
|
ccp_pci_exit();
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
switch (cpuinfo->x86) {
|
|
||||||
case 22:
|
|
||||||
if ((cpuinfo->x86_model < 48) || (cpuinfo->x86_model > 63))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
ret = ccp_pci_init();
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/* Don't leave the driver loaded if init failed */
|
|
||||||
if (!ccp_get_device()) {
|
|
||||||
ccp_pci_exit();
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ARM64
|
#ifdef CONFIG_ARM64
|
||||||
@ -636,13 +617,7 @@ static int __init ccp_mod_init(void)
|
|||||||
static void __exit ccp_mod_exit(void)
|
static void __exit ccp_mod_exit(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_X86
|
#ifdef CONFIG_X86
|
||||||
struct cpuinfo_x86 *cpuinfo = &boot_cpu_data;
|
ccp_pci_exit();
|
||||||
|
|
||||||
switch (cpuinfo->x86) {
|
|
||||||
case 22:
|
|
||||||
ccp_pci_exit();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ARM64
|
#ifdef CONFIG_ARM64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user