Skip to content

Commit a7174f9

Browse files
arndbherbertx
authored andcommitted
crypto: hisilicon - allow compile-testing on x86
To avoid missing arm64 specific warnings that get introduced in this driver, allow compile-testing on all 64-bit architectures. The only actual arm64 specific code in this driver is an open- coded 128 bit MMIO write. On non-arm64 the same can be done using memcpy_toio. What I also noticed is that the mmio store (either one) is not endian-safe, this will only work on little- endian configurations, so I also add a Kconfig dependency on that, regardless of the architecture. Finally, a depenndecy on CONFIG_64BIT is needed because of the writeq(). Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 5fd39c4 commit a7174f9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

drivers/crypto/hisilicon/Kconfig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,25 @@ config CRYPTO_DEV_HISI_SEC
1616

1717
config CRYPTO_DEV_HISI_QM
1818
tristate
19-
depends on ARM64 && PCI && PCI_MSI
19+
depends on ARM64 || COMPILE_TEST
20+
depends on PCI && PCI_MSI
2021
help
2122
HiSilicon accelerator engines use a common queue management
2223
interface. Specific engine driver may use this module.
2324

2425
config CRYPTO_HISI_SGL
2526
tristate
26-
depends on ARM64
27+
depends on ARM64 || COMPILE_TEST
2728
help
2829
HiSilicon accelerator engines use a common hardware scatterlist
2930
interface for data format. Specific engine driver may use this
3031
module.
3132

3233
config CRYPTO_DEV_HISI_ZIP
3334
tristate "Support for HiSilicon ZIP accelerator"
34-
depends on ARM64 && PCI && PCI_MSI
35+
depends on PCI && PCI_MSI
36+
depends on ARM64 || (COMPILE_TEST && 64BIT)
37+
depends on !CPU_BIG_ENDIAN || COMPILE_TEST
3538
select CRYPTO_DEV_HISI_QM
3639
select CRYPTO_HISI_SGL
3740
select SG_SPLIT

drivers/crypto/hisilicon/qm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@ static void qm_mb_write(struct hisi_qm *qm, const void *src)
331331
void __iomem *fun_base = qm->io_base + QM_MB_CMD_SEND_BASE;
332332
unsigned long tmp0 = 0, tmp1 = 0;
333333

334+
if (!IS_ENABLED(CONFIG_ARM64)) {
335+
memcpy_toio(fun_base, src, 16);
336+
wmb();
337+
return;
338+
}
339+
334340
asm volatile("ldp %0, %1, %3\n"
335341
"stp %0, %1, %2\n"
336342
"dsb sy\n"

0 commit comments

Comments
 (0)