Hi,
in Open Security configuration, Kernel and CAAM runns well, no HAB events. CAAM is build in Kernel.
After activating Closed Security Kernel gets a Kernel Panic (oops).
[ | 6.625359] caam caam.0: failed to instantiate RNG |
[ | 6.630163] Unable to handle kernel NULL pointer dereference at virtual address 00000038 |
[ | 6.638267] pgd = 80004000 |
[ | 6.640975] [00000038] *pgd=00000000 |
[ | 6.644568] Internal error: Oops: 5 [#1] PREEMPT |
if i compile kernel with CAAM as modul settings the Kernel starts, building CAAM Kernel Module not work
Kernel build log : (CAAM as Module Configuration)
LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 7 modules
ERROR: "caam_algapi_hash_startup" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_algapi_shutdown" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_sm_startup" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_sm_shutdown" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_rng_shutdown" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_algapi_hash_shutdown" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_algapi_startup" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_sm_example_init" [drivers/crypto/caam/caam.ko] undefined!
ERROR: "caam_rng_startup" [drivers/crypto/caam/caam.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Board: Custom Board ->based on Sabrelite Board
CPU: i.MX6s i.MX6q (separate kernel config)
Kernel 3.0.35 (BSP4.0.0)
who knows this trouble? there solutions?
regards Bernhard
Boot Log: (CAAM build in Kernel Configuration) after Security Closed
[ 3.923219] mmc0: no vmmc regulator found [ 3.929440] mmc0: SDHCI controller on platform [sdhci-esdhc-imx.2] using ADMA [ 3.936662] sdhci sdhci-esdhc-imx.0: no card-detect pin available! [ 3.943864] mmc1: no vmmc regulator found [ 3.954129] mmc1: SDHCI controller on platform [sdhci-esdhc-imx.0] using ADMA [ 4.052546] mmc0: new SDIO card at address 0001 [ 4.204879] mmc1: new SDIO card at address 0001 [ 6.625359] caam caam.0: failed to instantiate RNG [ 6.630163] Unable to handle kernel NULL pointer dereference at virtual address 00000038 [ 6.638267] pgd = 80004000 [ 6.640975] [00000038] *pgd=00000000 [ 6.644568] Internal error: Oops: 5 [#1] PREEMPT [ 6.649188] Modules linked in: [ 6.652258] CPU: 0 Not tainted (3.0.35-2039-g267e004-svn5792 #13) [ 6.658716] PC is at caam_sm_shutdown+0x18/0x2c [ 6.663249] LR is at caam_sm_shutdown+0x14/0x2c [ 6.667782] pc : [<802fbac0>]lr : [<802fbabc>]psr: 60000013 [ 6.667787] sp : 8d007eb0 ip : 00000001 fp : 804c4060 [ 6.679273] r10: 804c4060 r9 : 8f8e0000 r8 : fffffffb [ 6.684500] r7 : 8f8e0000 r6 : 8e020800 r5 : 8cc2d540 r4 : 00000000 [ 6.691030] r3 : 802f1e10 r2 : 88003000 r1 : 8b900060 r0 : 00000000 [ 6.697562] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [ 6.704874] Control: 10c53c7d Table: 10004059 DAC: 00000015 [ 6.710622] Process swapper (pid: 1, stack limit = 0x8d0062e8) [ 6.716459] Stack: (0x8d007eb0 to 0x8d008000) [ 6.720819] 7ea0: 8e020800 802f150c 802f1e10 8cc2d540 [ 6.729002] 7ec0: ffffffed 8e020800 8f8e0000 802f1e74 00000000 00000001 8c022390 8e020808 [ 6.737184] 7ee0: 8e029600 33000000 8e020808 8e020808 80511970 8e02083c 00000000 804f02bc [ 6.745366] 7f00: 00000000 800218cc 00000000 8024096c 80240954 8023f748 8e020808 804f02bc [ 6.753548] 7f20: 8e02083c 00000000 00000000 8023f8e0 804f02bc 00000000 8023f854 8023e968 [ 6.761729] 7f40: 8d8010f8 8e003450 804f02bc 804ea2a8 8c872480 8023f11c 8047b074 801ed36c [ 6.769911] 7f60: 804f02bc 804f02bc 8d006000 800355e0 00000000 00000000 800218cc 8023fdb4 [ 6.778092] 7f80: 804f9580 8d006000 800355e0 00000000 00000000 8002f34c 00000000 8d81b4e0 [ 6.786274] 7fa0: 800951c8 800218cc 804dd3f8 800951f8 000001df 800355e0 00000013 37340000 [ 6.794456] 7fc0: 00000039 80027bc8 80027c38 800355e0 00000013 00000000 00000000 00000000 [ 6.802638] 7fe0: 00000000 800089e8 00000000 00000000 80008964 800355e0 ebffeffb eaeeffdf [ 6.810831] [<802fbac0>] (caam_sm_shutdown+0x18/0x2c) from [<802f150c>] (caam_remove+0x20/0xc4) [ 6.819539] [<802f150c>] (caam_remove+0x20/0xc4) from [<802f1e74>] (caam_probe+0x8c4/0xa70) [ 6.827902] [<802f1e74>] (caam_probe+0x8c4/0xa70) from [<8024096c>] (platform_drv_probe+0x18/0x1c) [ 6.836881] [<8024096c>] (platform_drv_probe+0x18/0x1c) from [<8023f748>] (driver_probe_device+0x90/0x19c) [ 6.846546] [<8023f748>] (driver_probe_device+0x90/0x19c) from [<8023f8e0>] (__driver_attach+0x8c/0x90) [ 6.855948] [<8023f8e0>] (__driver_attach+0x8c/0x90) from [<8023e968>] (bus_for_each_dev+0x5c/0x88) [ 6.865003] [<8023e968>] (bus_for_each_dev+0x5c/0x88) from [<8023f11c>] (bus_add_driver+0x17c/0x244) [ 6.874145] [<8023f11c>] (bus_add_driver+0x17c/0x244) from [<8023fdb4>] (driver_register+0x78/0x13c) [ 6.883290] [<8023fdb4>] (driver_register+0x78/0x13c) from [<8002f34c>] (do_one_initcall+0x34/0x174) [ 6.892437] [<8002f34c>] (do_one_initcall+0x34/0x174) from [<800089e8>] (kernel_init+0x84/0x124) [ 6.901237] [<800089e8>] (kernel_init+0x84/0x124) from [<800355e0>] (kernel_thread_exit+0x0/0x8) [ 6.910031] Code: ebfd0dfb e5900060 ebfd0df9 e1a04000 (e5900038) [ 6.916157] ---[ end trace f74bc9c599f351aa ]--- [ 6.920785] Kernel panic - not syncing: Attempted to kill init! [ 6.926736] [<80039a2c>] (unwind_backtrace+0x0/0xf8) from [<803a0040>] (panic+0x64/0x178) [ 6.934940] [<803a0040>] (panic+0x64/0x178) from [<80063018>] (do_exit+0x670/0x6f8) [ 6.942607] [<80063018>] (do_exit+0x670/0x6f8) from [<80038198>] (die+0x22c/0x2a0) [ 6.950197] [<80038198>] (die+0x22c/0x2a0) from [<8039fa24>] (__do_kernel_fault.part.5+0x54/0x74) [ 6.959092] [<8039fa24>] (__do_kernel_fault.part.5+0x54/0x74) from [<8003d5f0>] (do_page_fault+0x2b4/0x31c) [ 6.968853] [<8003d5f0>] (do_page_fault+0x2b4/0x31c) from [<8002f194>] (do_DataAbort+0x34/0x9c) [ 6.977569] [<8002f194>] (do_DataAbort+0x34/0x9c) from [<80034710>] (__dabt_svc+0x70/0xa0) [ 6.985842] Exception stack(0x8d007e68 to 0x8d007eb0) [ 6.990901] 7e60: 00000000 8b900060 88003000 802f1e10 00000000 8cc2d540 [ 6.999093] 7e80: 8e020800 8f8e0000 fffffffb 8f8e0000 804c4060 804c4060 00000001 8d007eb0 [ 7.007281] 7ea0: 802fbabc 802fbac0 60000013 ffffffff [ 7.012346] [<80034710>] (__dabt_svc+0x70/0xa0) from [<802fbac0>] (caam_sm_shutdown+0x18/0x2c) [ 7.020975] [<802fbac0>] (caam_sm_shutdown+0x18/0x2c) from [<802f150c>] (caam_remove+0x20/0xc4) [ 7.029692] [<802f150c>] (caam_remove+0x20/0xc4) from [<802f1e74>] (caam_probe+0x8c4/0xa70) [ 7.038060] [<802f1e74>] (caam_probe+0x8c4/0xa70) from [<8024096c>] (platform_drv_probe+0x18/0x1c) [ 7.047038] [<8024096c>] (platform_drv_probe+0x18/0x1c) from [<8023f748>] (driver_probe_device+0x90/0x19c) [ 7.056711] [<8023f748>] (driver_probe_device+0x90/0x19c) from [<8023f8e0>] (__driver_attach+0x8c/0x90) [ 7.066121] [<8023f8e0>] (__driver_attach+0x8c/0x90) from [<8023e968>] (bus_for_each_dev+0x5c/0x88) [ 7.075184] [<8023e968>] (bus_for_each_dev+0x5c/0x88) from [<8023f11c>] (bus_add_driver+0x17c/0x244) [ 7.084325] [<8023f11c>] (bus_add_driver+0x17c/0x244) from [<8023fdb4>] (driver_register+0x78/0x13c) [ 7.093474] [<8023fdb4>] (driver_register+0x78/0x13c) from [<8002f34c>] (do_one_initcall+0x34/0x174) [ 7.102622] [<8002f34c>] (do_one_initcall+0x34/0x174) from [<800089e8>] (kernel_init+0x84/0x124) [ 7.111424] [<800089e8>] (kernel_init+0x84/0x124) from [<800355e0>] (kernel_thread_exit+0x0/0x8)
We are using the Yocto release from May and are seeing the same (seemingly common) problem.
Please advice,
/Otto
----
platform 2101000.jr0: 2000025b: CCB: desc idx 2: RNG: Hardware error.
platform 2101000.jr0: unable to instantiate RNG
Unable to handle kernel NULL pointer dereference at virtual address 00000034
pgd = 80004000
[00000034] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.17-1.0.0_ga+g232293e #70
task: a805c000 ti: a805a000 task.ti: a805a000
PC is at caam_algapi_init+0x6c/0x4dc
LR is at caam_algapi_init+0x64/0x4dc
pc : [<80bff968>] lr : [<80bff960>] psr: a0000113
sp : a805beb8 ip : 80632dc0 fp : 00000000
r10: 00000000 r9 : a815b210 r8 : 80c6c840
r7 : 80c6c840 r6 : 80c6c840 r5 : 00000006 r4 : 80c17400
r3 : 00000000 r2 : a805be88 r1 : 000000d0 r0 : 00000000
Dear Otto,
We have solved it.
However, I do not remember it in detail now.
The kernel version which we used was 3.0.35.
Maybe 6400 was set to RNG4_ENT_CLOCKS_SAMPLE.
RNG4_ENT_CLOCKS_SAMPLE is defined in intern.h.
If I become free, it will inform a little in more detail.
BR,
George
George,
For now we decided to simply turn off the CAAM functions as they are not that important for our project.
Thanks for your help and have a great weekend !
/Otto
Dear Yuri,
I need your help.
A phenomenon similar also to my customer's board occurs.
boot.log (Attached file)
It seems to me that following patch file can improve this phenomenon.
ENGR00290444: Need to update CAAM driver with SM patches from STC
Since we are using L3.0.35_4.1.0_ER_SOURCE_BSP, it does not include the patch.
Is my understanding correct?
Best Regards,
George
If You are using BSP release 3.0.35_4.1.0 :
there are fixes for CAAM driver and black keys test application, the
patches are not part of the formal BSP and are online in our git repository:
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/log/?h=imx_3.0.35_4.1.0
Patches related to CAAM changes are:
ENGR00290444: Need to update CAAM driver with SM patches from STC
ENGR00290448: Double instantiation of RNG in CAAM Driver
ENGR00290449: Cannot build CAAM as a loadable module
ENGR00291081 CAAM: Fix the Copyright issue introduced by commit: 2b94a4b
Dear Yuri,
Our customer have a very similar issue.
So could you give us a advice how avoid RNG hardware error?
Best Regards,
Satoshi Shimoda
Dear Yuri,
Thank you for your response.
We had already found and applied those patches.
And kernel-panic was avoidable.
However, the RNG Hardware error occurs rarely.
platform caam_jr.0: 2000025b: CCB: desc idx 2: RNG: Hardware error.
platform caam_jr.0: unable to instantiate RNG
caam caam.0: error instantiating rng, terminating
We are looking for workaround.
For example, CAAM initialization is repeated until it is successful.
If there is some advice, please let me know.
Best Regards,
George
With regards to the RNG failure, please have the customer add the below
lines to their .csf file after the [Authenticate CSF] section.
[Unlock]
Engine = CAAM
Features = RNG
It should be done fo both U-Boot and UImage ".csf" files.
~Yuri.
I am having exactly the same problem. When I click the link you provided in your reply, I get an "Unauthorized" banner. Basically I see no indication that CAAM is initializing when it is compiled in. When I attempt to compile it as a module I get the same "undefined" errors as described by the original poster.
George