AnsweredAssumed Answered

C291 PKC kernel driver

Question asked by Ondrej Ille on Feb 13, 2017
Latest reply on Feb 17, 2017 by bpe



We are developing an custom encryption card based on C291 CPU. We plan to operate it in PKC mode. Our main platform is MIPS CPU Cavium OCTEON III. We are using Linux kernel version , its a Montavista kernel.

I used the kernel driver available for host platforms in x86 and PPC platforms. I inserted the driver into our kernel,

modified the makefiles to define proper endian. Then I modified the crypto header file according to patch available with

reference design (crypto-changes.patch). Since 2.6 kernel has different support of per-cpu variables I temporarily removed "__percpu" flags used in the driver. Further I changed some x86 specific assembly in the test code.


Then I compiled our kernel image and booted the device. I get kernel module available under /lib/modules...  However if I try to insmod it I get : "Operation not permitted error". If I try "modprobe -f fsl_crypto_offload_drv" then I get following error:

FATAL: Error inserting fsl_crypto_offload_drv (/lib/modules/ Invalid module format

I dont get any message in "dmesg". 


Since I am using the "-f" option possibly different kernel and module versions are ignored. Since the driver is compiled as part of kernel, not standalone, my assumption is that any interface incompatibility should cause error at compile time...


Could you please help us with the driver integration? Is there some part of makefile which I forgot to modify? Are there some other changes necessary in our kernel to get the module working? We are not planning on using the virtualization neither DMA in the first step, so according variables of config file are set to "n".


With Regards

Ondrej Ille