diff mbox series

[v2,6/9] ixp4xx: Add a ixp4xx hardware crypto kernel module

Message ID 20230928-ixp4xx-v2-6-ce011eef8239@linaro.org
State Superseded
Headers show
Series Resurrect OpenWrt IXP4xx support | expand

Commit Message

Linus Walleij Sept. 28, 2023, 1:28 p.m. UTC
The IXP4xx crypto module must be loaded after the rootfs is
up as it depends on loading some NPE microcode from the file
system.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 package/kernel/linux/modules/crypto.mk | 13 +++++++++++++
 target/linux/ixp4xx/Makefile           |  1 +
 2 files changed, 14 insertions(+)

Comments

Robert Marko Oct. 4, 2023, 12:52 p.m. UTC | #1
On Thu, 28 Sept 2023 at 15:29, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> The IXP4xx crypto module must be loaded after the rootfs is
> up as it depends on loading some NPE microcode from the file
> system.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  package/kernel/linux/modules/crypto.mk | 13 +++++++++++++
>  target/linux/ixp4xx/Makefile           |  1 +
>  2 files changed, 14 insertions(+)
>
> diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
> index 501be4b0a02c..bfb70f0344fb 100644
> --- a/package/kernel/linux/modules/crypto.mk
> +++ b/package/kernel/linux/modules/crypto.mk
> @@ -399,6 +399,19 @@ endef
>
>  $(eval $(call KernelPackage,crypto-hw-hifn-795x))
>
> +define KernelPackage/crypto-hw-ixp4xx
> +  TITLE:=Intel IXP4xx crypto accelerator
> +  DEPENDS:=@TARGET_ixp4xx +kmod-random-core +kmod-crypto-manager +kmod-crypto-authenc +kmod-crypto-des
> +  KCONFIG:= \
> +       CONFIG_CRYPTO_HW=y \
> +       CONFIG_CRYPTO_DEV_IXP4XX
> +  FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.ko
> +  AUTOLOAD:=$(call AutoLoad,09,ixp4xx_crypto)

AutoProbe should work here since its now DT-based and can be probed
against the compatible instead
of manually loading it.

Regards
Robert
> +  $(call AddDepends/crypto)
> +endef
> +
> +$(eval $(call KernelPackage,crypto-hw-ixp4xx))
> +
>
>  define KernelPackage/crypto-hw-padlock
>    TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
> diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile
> index 89a1b2407bfe..6cd30877eeee 100644
> --- a/target/linux/ixp4xx/Makefile
> +++ b/target/linux/ixp4xx/Makefile
> @@ -21,6 +21,7 @@ KERNELNAME:=zImage dtbs
>  include $(INCLUDE_DIR)/target.mk
>
>  DEFAULT_PACKAGES += fconfig \
> +       kmod-crypto-hw-ixp4xx \
>         kmod-usb-ledtrig-usbport \
>         kmod-leds-gpio
>
>
> --
> 2.34.1
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
index 501be4b0a02c..bfb70f0344fb 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -399,6 +399,19 @@  endef
 
 $(eval $(call KernelPackage,crypto-hw-hifn-795x))
 
+define KernelPackage/crypto-hw-ixp4xx
+  TITLE:=Intel IXP4xx crypto accelerator
+  DEPENDS:=@TARGET_ixp4xx +kmod-random-core +kmod-crypto-manager +kmod-crypto-authenc +kmod-crypto-des
+  KCONFIG:= \
+	CONFIG_CRYPTO_HW=y \
+	CONFIG_CRYPTO_DEV_IXP4XX
+  FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.ko
+  AUTOLOAD:=$(call AutoLoad,09,ixp4xx_crypto)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-hw-ixp4xx))
+
 
 define KernelPackage/crypto-hw-padlock
   TITLE:=VIA PadLock ACE with AES/SHA hw crypto module
diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile
index 89a1b2407bfe..6cd30877eeee 100644
--- a/target/linux/ixp4xx/Makefile
+++ b/target/linux/ixp4xx/Makefile
@@ -21,6 +21,7 @@  KERNELNAME:=zImage dtbs
 include $(INCLUDE_DIR)/target.mk
 
 DEFAULT_PACKAGES += fconfig \
+	kmod-crypto-hw-ixp4xx \
 	kmod-usb-ledtrig-usbport \
 	kmod-leds-gpio