Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when testing optee os with arm trusted firmware (I utilized optee os tee.bin as bl32 image) on juno platform, I got an error #149

Closed
diamond001 opened this issue Dec 8, 2014 · 16 comments

Comments

@diamond001
Copy link

when I tested optee os with arm trusted firmware (I utilized optee os tee.bin as bl32 image) on juno platform, I got an error:
INFO: Using FIP
INFO: Loading file 'bl32.bin' at address 0x4023000
WARNING: Failed to reserve memory: 0x4023000 - 0x407e540
INFO: Trying to load image at address 0x4023000, size = 0x5b540
INFO: Current memory layout:
INFO: total region = [0x4023000, 0x4040000]
INFO: free region = [0x4023000, 0x4040000]
WARNING: Failed to load BL3-2 (-12)

I found that tee.bin is 172K, but the tzram free space for bl32 is 64K (./plat/juno/include/platform_def.h), it's smaller than the requested size.
I tried to modify the size of tzram for bl32, but the atf stop at the beginning of bl2:

VERBOSE: Reserved 12288 bytes (discarded 0 bytes below)
INFO: BL1: 0x4001000 - 0x4004000 [size = 12288] -- hugo -002
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v1.0(debug):bbb59e7
NOTICE: BL1: Built : 16:28:51, Dec 5 2014
INFO: BL1: RAM 0x4001000 - 0x4004000
VERBOSE: FIP header looks OK.
INFO: Using FIP
INFO: Loading file 'bl2.bin' at address 0x4053000
VERBOSE: Reserved 53248 bytes (discarded 32760 bytes above)
INFO: File 'bl2.bin' loaded: 0x4053000 - 0x4058008
VERBOSE: Reserved 12288 bytes (discarded 0 bytes below)
NOTICE: BL1: Booting BL2
INFO: BL1: BL2 address = 0x4053000
INFO: BL1: BL2 spsr = 0x3c5
VERBOSE: BL1: BL2 memory layout address = 0x4004000

Could you please tell me how to solve this problem?

@jenswi-linaro
Copy link
Contributor

Hi,

OP-TEE is too large to fit in tsram, please build ARM-TF with:
PLAT_TSP_LOCATION=dram
as a parameter for make

Regards,
Jens

@diamond001
Copy link
Author

Thanks for you replay. I recompiled ARM-TF with: PLAT_TSP_LOCATION=dram.
Then I tested again, bl32 was successfully loadded, but the booting procedure stop at: "INFO: BL3-1: Initializing BL3-2"

My serial console printed log:
VERBOSE: Reserved 12288 bytes (discarded 0 bytes below)
INFO: BL1: 0x4001000 - 0x4004000 [size = 12288] -- hugo -002
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v1.0(debug):40c0f72
NOTICE: BL1: Built : 15:39:50, Dec 8 2014
INFO: BL1: RAM 0x4001000 - 0x4004000
VERBOSE: FIP header looks OK.
INFO: Using FIP
INFO: Loading file 'bl2.bin' at address 0x4033000
VERBOSE: Reserved 53248 bytes (discarded 32760 bytes above)
INFO: File 'bl2.bin' loaded: 0x4033000 - 0x4038008
VERBOSE: Reserved 12288 bytes (discarded 0 bytes below)
NOTICE: BL1: Booting BL2
INFO: BL1: BL2 address = 0x4033000
INFO: BL1: BL2 spsr = 0x3c5
VERBOSE: BL1: BL2 memory layout address = 0x4004000
INFO: bl1_run_bl2:
NOTICE: BL2: v1.0(debug):40c0f72
NOTICE: BL2: Built : 15:39:50, Dec 8 2014
INFO: BL2: Loading BL3-0
VERBOSE: FIP header looks OK.
INFO: Using FIP
INFO: Loading file 'bl30.bin' at address 0x4009000
VERBOSE: Reserved 65860 bytes (discarded 20480 bytes below)
INFO: File 'bl30.bin' loaded: 0x4009000 - 0x4014144
INFO: BL2: BL3-0 transferred to SCP
INFO: BL2: Loading BL3-1
VERBOSE: FIP header looks OK.
INFO: Using FIP
INFO: Loading file 'bl31.bin' at address 0x4009000
VERBOSE: Reserved 57360 bytes (discarded 20480 bytes below)
INFO: File 'bl31.bin' loaded: 0x4009000 - 0x4012010
INFO: BL2: Loading BL3-2
VERBOSE: FIP header looks OK.
INFO: Using FIP
INFO: Loading file 'bl32.bin' at address 0xff000000
VERBOSE: Reserved 374080 bytes (discarded 0 bytes below)
INFO: File 'bl32.bin' loaded: 0xff000000 - 0xff05b540
INFO: BL2: Loading BL3-3
VERBOSE: FIP header looks OK.
INFO: Using FIP
INFO: Loading file 'bl33.bin' at address 0xe0000000
VERBOSE: Reserved 520093696 bytes (discarded 519110656 bytes above)
INFO: File 'bl33.bin' loaded: 0xe0000000 - 0xe00f0000
NOTICE: BL1: Booting BL3-1
INFO: BL1: BL3-1 address = 0x4009000
INFO: BL1: BL3-1 spsr = 0x3cd
INFO: BL1: BL3-1 params address = 0x4038860
INFO: BL1: BL3-1 plat params address = 0xf1e2d3c4b5a6978
NOTICE: BL3-1: v1.0(debug):40c0f72
NOTICE: BL3-1: Built : 15:39:50, Dec 8 2014
INFO: BL3-1: Initializing runtime services
INFO: BL3-1: Initializing BL3-2

is that on a OK condition? Do I have to use an extra serial cable to print optee os's log?

@jenswi-linaro
Copy link
Contributor

OP-TEE outputs on UART3 so you need an extra serial cable. Since it stopped at "Initializing BL3-2" I'm suspecting that something went wrong when OP-TEE was initializing, hopefully you'll see something on UART3.

Which arguments did you use to build OP-TEE?

@diamond001
Copy link
Author

hi, I build OP-TEE like this:

#/bin/bash
export
PATH=/home/zhangxiaoqi/juno-linaro/toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.08_linux/bin:$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-
export PLATFORM=vexpress
export PLATFORM_FLAVOR=juno
export O=./out-os-juno
export CFG_TEE_CORE_LOG_LEVEL=4
export DEBUG=1
cd /home/juno-linaro/optee_os
make -jgetconf _NPROCESSORS_ONLN $@

Is that OK?

2014-12-08 17:25 GMT+08:00 Jens Wiklander notifications@github.com:

OP-TEE outputs on UART3 so you need an extra serial cable. Since it
stopped at "Initializing BL3-2" I'm suspecting that something went wrong
when OP-TEE was initializing, hopefully you'll see something on UART3.

Which arguments did you use to build OP-TEE?


Reply to this email directly or view it on GitHub
#149 (comment).

@jenswi-linaro
Copy link
Contributor

Looks OK. Perhaps some recent change in ARM-TF is breaking OP-TEE? I've tested OK with 0f4b06347b4c2a5d018e085f7102fd3cc10ffa88.

Regards,
Jens

@diamond001
Copy link
Author

hi, I also tested with 0f4b06347b4c2a5d018e085f7102fd3cc10ffa88, but it
stll stopped at "Initializing BL3-2".

2014-12-08 18:04 GMT+08:00 Jens Wiklander notifications@github.com:

Looks OK. Perhaps some recent change in ARM-TF is breaking OP-TEE? I've
tested OK with 0f4b06347b4c2a5d018e085f7102fd3cc10ffa88.

Regards,
Jens


Reply to this email directly or view it on GitHub
#149 (comment).

@diamond001
Copy link
Author

hi, the juno board I got has only two uart channels on the rear. At present, I utilize UART0 to print ARM-TF log. The other uart channel is UART1 as juno board's "Getting Started" says. There is no UART3.
How many uart channels do you have?

@jbech-linaro
Copy link
Contributor

Hi diamond001,

There are four UARTs on Juno. Two are internal and two are external. Exactly how they are configured depends on which ARM-TF commit you are using. For more information please see the following ARM-software/tf-issues#220. In OP-TEE you can see how this is used here. Depending on your use case, you probably have to change this accordingly in ARM-TF and/or OP-TEE.

@vchong
Copy link
Contributor

vchong commented Dec 10, 2014

Hi diamond001,

Are you still stuck at "Initializing BL3-2"?
If yes, please try cleaning your arm-tf directory and also aa5da46138e1583990086b76b56e0a9186cb7b7d.
I was stuck too on fvp and those 2 steps helped me.

cd arm-trusted-firmware
make PLAT=juno clean
make realclean
git checkout aa5da46138e1583990086b76b56e0a9186cb7b7d

@diamond001
Copy link
Author

Many thanks to you all.

I tried to change the version() of optee os to sovle this problem.

cd optee_os
git reset --hard 90e7497

then I rebuild optee os and ARM-TF, the problem has been sovled.

The git log of this version:

commit 90e7497
Author: Jens Wiklander jens.wiklander@linaro.org
Date: Thu Oct 16 22:20:50 2014 +0200
plat-vexpress: add juno flavor

Adds support for ARM Versatile Express V2M-Juno by adding flavor juno.

UART3 (SoC UART1) is used as console uart instead of UART1 (FPGA UART1)
which is used by TSP in ARM Trusted Firmware. UART3 is used for OP-TEE
since that uart is easily accessible on the Juno board, while UART0 and
UART1 only are accessible via headers on the motherboard.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Juno and FVP)
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

BTW, in optee_os, I tried to switch between many versions, I found that the
version a7ec939 (Date: Mon Nov 3
16:02:00) causes this problem.

I tried to compare version a7ec939
(Date: Mon Nov 3 16:02:00) with version
65b5d06 (Date: Mon Nov 3 08:02:24 ).
I found that they diff too much ... I am at a loss.
There are too many differences that I could not location which modifed
point lead to this problem.

Could you please help me?

2014-12-10 17:15 GMT+08:00 vchong notifications@github.com:

Hi diamond001,

Are you still stuck at "Initializing BL3-2"?
If yes, please try cleaning your arm-tf directory and also
aa5da46138e1583990086b76b56e0a9186cb7b7d.
I was stuck too on fvp and those 2 steps helped me.

cd arm-trusted-firmware
make PLAT=juno clean
make realclean
git checkout aa5da46138e1583990086b76b56e0a9186cb7b7d


Reply to this email directly or view it on GitHub
#149 (comment).

@jenswi-linaro
Copy link
Contributor

I'll have a look at it next time I have access to Juno hardware, probably during next week.

@jenswi-linaro
Copy link
Contributor

I can reproduce the problem. I'm able to boot Juno OK on master (d6d47ed) though, using ARM-TF commit 0f4b06347b4c2a5d018e085f7102fd3cc10ffa88.

@diamond001
Copy link
Author

Many thanks.

2014-12-16 17:50 GMT+08:00 Jens Wiklander notifications@github.com:

I can reproduce the problem. I'm able to boot Juno OK on master (d6d47ed
d6d47ed)
though, using ARM-TF commit 0f4b06347b4c2a5d018e085f7102fd3cc10ffa88.


Reply to this email directly or view it on GitHub
#149 (comment).

@hwithaar
Copy link

hwithaar commented Mar 4, 2015

I had the same issue and now work with the 'old' version.
When will this be fixed in a later version?

@jenswi-linaro
Copy link
Contributor

The problem is that ARM-TF doesn't have generic support to load partitioned binaries. The current patch is a temporary solution that also gives a good example of what we need to load OP-TEE.

I've discussed this with one of the ARM-TF engineers and some generic support for loading partitioned binaries will be added. Once that's in place we'll prepare new OP-TEE patches which we'll try to get merged into ARM-TF.

@ghost
Copy link

ghost commented Jun 23, 2015

Related to ARM-software/tf-issues#301, still to be resolved

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants