Xtest fails on HiKey960

Hi all,

I’m getting a failure while running xtest on Hikey960.

I follow the instructions on github

“make” and “make flash” was completed.
But xtest fails.

# xtest
Run test suite with level=0

TEE test application started with device [(null)]
######################################################
#
# regression
#
######################################################
 
* regression_1001 Core self tests
E/TC:6 0 tee_entry_std:536 Bad arg address 0x217061000
regression_1000.c:246: res has an unexpected value: 0xffff000e = 
TEEC_ERROR_COMMUNICATION, expected 0x0 = TEEC_SUCCESS
Segmentation fault

How can I fix this problem?
Thank you.

@tateoka Please share if you have used a specific OP-TEE branch to fetch source code.

Hi,

Not specified.

I did it as follows.

repo init -u https://github.com/OP-TEE/manifest.git -m hikey960.xml

repo sync

Thank you.

@tateoka I will suggest you to use one of the OP-TEE release branch as those are tested ones. So to use latest release branch (v3.3.0), use following commands:

repo init -u https://github.com/OP-TEE/manifest.git -m hikey960.xml -b 3.3.0

repo sync

Thank you for your help.
I installed v3.3.0.
As a result, it seems to work fine!

BTW.
Today, I noticed the package says “this is 4GB model.”
Do I need additional configuration etc?

Thank you.

It looks like you need to enable CFG_DRAM_SIZE_GB=4 while building optee_os. So for auto-build you need to apply following patch to “build” repo:

diff --git a/hikey960.mk b/hikey960.mk
index fbb91e2..0395d4e 100644
--- a/hikey960.mk
+++ b/hikey960.mk
@@ -178,7 +178,8 @@ linux-cleaner: linux-cleaner-common
 ################################################################################
 OPTEE_OS_COMMON_FLAGS += PLATFORM=hikey-hikey960 \
                        CFG_CONSOLE_UART=$(CFG_CONSOLE_UART) \
-                       CFG_SECURE_DATA_PATH=n
+                       CFG_SECURE_DATA_PATH=n \
+                       CFG_DRAM_SIZE_GB=4
 OPTEE_OS_CLEAN_COMMON_FLAGS += PLATFORM=hikey-hikey960
 
 .PHONY: optee-os

BTW, it won’t have any impact on OP-TEE TA execution until you use dynamic (registered) shared memory.

Hello . today I met the same problem. And I have followed your instruction, i.e. installed the v3.3.0 and added the CFG_DRAM_SIZE_GB=4. but after I run the conmand “build flash” and restart the board. I met a new problem:a panic occured . the information is as follow. this panic occured in both normal boot mode and fastboot mode . and I have to recovery the board as described in this git:https://github.com/96boards-hikey/tools-images-hikey960/blob/master/README.md
I can enter the fastboot mode and reflash the optee on my board after recovering, but this panic occured again. I don`t know what caused this problem. Could you please help me? thank you very much! BTW, I did not met the problem when I flashed optee in the first.
NOTICE: BL2: v1.4(release):
NOTICE: BL2: Built : 10:04:52, Mar 18 2019
NOTICE: ufs: H**** device must set VS_DebugSaveConfigTime 0x10
NOTICE: BL2: Booting BL31
NOTICE: BL31: v1.4(release):
NOTICE: BL31: Built : 10:04:54, Mar 18 2019
D/TC:0 0 add_phys_mem:539 TEE_SHMEM_START type NSEC_SHM 0x3ee00000 size 0x00200000
D/TC:0 0 add_phys_mem:539 TA_RAM_START type TA_RAM 0x3f200000 size 0x00e00000
D/TC:0 0 add_phys_mem:539 VCORE_UNPG_RW_PA type TEE_RAM_RW 0x3f04e000 size 0x001b2000
D/TC:0 0 add_phys_mem:539 VCORE_UNPG_RX_PA type TEE_RAM_RX 0x3f000000 size 0x0004e000
D/TC:0 0 add_phys_mem:539 CONSOLE_UART_BASE type IO_NSEC 0xffe00000 size 0x00200000
D/TC:0 0 verify_special_mem_areas:483 NSEC DDR memory [40000000 100000000]
D/TC:0 0 verify_special_mem_areas:483 NSEC DDR memory [0 3e000000]
E/TC:0 0 verify_special_mem_areas:514 [40000000 100000000] intersects [ffe00000 100000000]
E/TC:0 0 Panic ‘Special memory intersection’ at core/arch/arm/mm/core_mmu.c:515 <verify_special_mem_areas>
E/TC:0 0 Call stack:
E/TC:0 0 0x000000003f00c504
D/TC:0 0 unwind_stack_arm64:56 FP out of bounds 0x3f0a8ce0

It seems to be a known issue here [1]. And its fix has been included in v3.4.0 release. So I would suggest you to try latest v3.4.0 release or else you need to backport the fix.

[1] https://github.com/OP-TEE/optee_os/issues/2597

1 Like

Thanks a lot for your constructive suggestions. I changed the macro definition DRAM1_SIZE_NSEC to 0xA0000000, as a result ,it looks work fine.:grin::grin: