renesas-rcar / arm-trusted-firmware

arm-trusted-firmware
Other
25 stars 39 forks source link

BL31 and BL32(optee) can not print log using uart on Salvator-XS #11

Open chenlifu2015 opened 5 years ago

chenlifu2015 commented 5 years ago

Run ATF on R-Car H3 Salvator-XS, BL2 is running at EL3., after jump to Bl31, BL31 can not print log, when loading BL33(uboot),can print log again

chenlifu2015 commented 5 years ago

Here is the log: [ 0.000077] INFO: ARM GICv2 driver initialized [ 0.003363] NOTICE: BL2: R-Car H3 Initial Program Loader(CA57) [ 0.009193] NOTICE: BL2: Initial Program Loader(Rev.2.0.0) [ 0.014735] NOTICE: BL2: PRR is R-Car H3 Ver.3.0 [ 0.019411] NOTICE: BL2: Board is Salvator-XS Rev.1.0 [ 0.024533] NOTICE: BL2: Boot device is HyperFlash(160MHz) [ 0.030054] NOTICE: BL2: LCM state is CM [ 0.034102] NOTICE: BL2: AVS setting succeeded. DVFS_SetVID=0x53 [ 0.040087] NOTICE: BL2: CH0: 0x400000000 - 0x43fffffff, 1 GiB [ 0.045958] NOTICE: BL2: CH1: 0x500000000 - 0x53fffffff, 1 GiB [ 0.051842] NOTICE: BL2: CH2: 0x600000000 - 0x63fffffff, 1 GiB [ 0.057727] NOTICE: BL2: CH3: 0x700000000 - 0x73fffffff, 1 GiB [ 0.063652] NOTICE: BL2: DDR3200(rev.0.34) [ 0.076300] NOTICE: BL2: [COLD_BOOT] Boot_init_dram datal = 15 Boot_init_dram ddr_phyvalid = 15 [ 0.087043] NOTICE: BL2: DRAM Split is OFF(DDR f) [ 0.091798] NOTICE: BL2: QoS is default setting(rev.0.10) [ 0.097250] NOTICE: BL2: DRAM refresh interval 1.95 usec [ 0.102680] NOTICE: BL2: v1.5(debug): [ 0.106337] NOTICE: BL2: Built : 17:31:28, May 21 2019 [ 0.111533] NOTICE: BL2: Normal boot [ 0.115170] INFO: BL2: Loading BL31 [ 0.118900] NOTICE: BL2: dst=0xe6324100 src=0x8180000 len=512(0x200) [ 0.125298] NOTICE: BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800) [ 0.131901] INFO: Loading image id=3 at address 0x44000000 [ 0.137587] NOTICE: BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000) [ 0.144592] INFO: Image id=3 loaded at address 0x44000000, size = 0x10000 [ 0.151350] INFO: BL2: Loading BL32 [ 0.155073] INFO: Loading image id=4 at address 0x44100000 [ 0.160779] NOTICE: BL2: dst=0x44100000 src=0x8200000 len=524288(0x80000) [ 0.169676] INFO: Image id=4 loaded at address 0x44100000, size = 0x80000 [ 0.175289] INFO: BL2: Loading BL33 [ 0.178969] INFO: Loading image id=5 at address 0x50000000 [ 0.184674] NOTICE: BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000) [ 0.195808] INFO: Image id=5 loaded at address 0x50000000, size = 0x100000 [ 0.201631] NOTICE: BL2: Booting BL31 [ 0.205170] INFO: Entry point address = 0x44000000 [ 0.210189] INFO: SPSR = 0x3cd

/*No log for BL31 and BL32, only the log foe BL33(u-boot) U-Boot 2015.04 (Jul 25 2018 - 11:54:15)

CPU: Renesas Electronics R8A7795 rev 3.0 Board: Salvator-X I2C: ready DRAM: 3.9 GiB Bank #0: 0x048000000 - 0x07fffffff, 896 MiB Bank #1: 0x500000000 - 0x53fffffff, 1 GiB Bank #2: 0x600000000 - 0x63fffffff, 1 GiB Bank #3: 0x700000000 - 0x73fffffff, 1 GiB

MMC: sh-sdhi: 0, sh-sdhi: 1, sh-sdhi: 2 In: serial Out: serial Err: serial Net: ravb Hit any key to stop autoboot: 0 ravb Waiting for PHY auto negotiation to complete.. done ravb: 100Base/Full Using ravb device TFTP from server 192.168.1.101; our IP address is 192.168.1.102 Filename 'Image'. Load address: 0x48080000 Loading: *

qwertylhl commented 5 years ago

Hi chenlifu2015,

Yes. This is the expected behavior but not an issue. For BL31, it will output log to memory by default. You can use JTAG debugger to read it. Alternatively, you can use scif.S instead of rcar_printf.c and rcar_console.S by modifying platform.mk. Then BL31 could print log during boot period.

For BL32, it will print log to both of secure memory area and Linux world when RCAR_DEBUG_LOG=1. Same with BL31, you can also use JTAG debugger to read it. And for the log except for boot period, you could see it from Linux console.

PS: If more than one software could control the Uart module, the result would be unexpected. And this will be an issue.

chenlifu2015 commented 5 years ago

Hi qwertylhl, Thanks for your apply, but I can not find the macro defination of RCAR_DEBUG_LOG on the code source of ATF and OP-TEE

qwertylhl commented 5 years ago

Hi chenlifu2015,

R-Car ATF does not support this macro. For R-Car OP-TEE, please refer to the following file. core/arch/arm/plat-rcar/conf.mk

chenlifu2015 commented 5 years ago

Hi qwertylhl, Thanks for your apply, I have modified the platform.mk in plat/renesas/rcar/, like this: image BL31_SOURCES += ${RCAR_GIC_SOURCES} \ drivers/arm/cci/cci.c \ lib/cpus/aarch64/aem_generic.S \ lib/cpus/aarch64/cortex_a53.S \ lib/cpus/aarch64/cortex_a57.S \ plat/renesas/rcar/bl31_rcar_setup.c \ plat/renesas/rcar/rcar_pm.c \ plat/renesas/rcar/rcar_sip_svc.c \ plat/renesas/rcar/drivers/board/board.c \ plat/renesas/rcar/drivers/dramconf/dramconf.c \

before modified, use rcar_console.S

                            plat/renesas/rcar/drivers/scif/scif.S         \   
                            plat/renesas/rcar/drivers/memdrv/rcar_printf.c  \

but there is no print, too, and I don`t understand the meaning of "Then BL31 could print log during boot period, And for the log except for boot period, you could see it from Linux console", you mean I can see the log of BL31 only after Linux start up on R-Car H3?

qwertylhl commented 5 years ago

Hi chenlifu2015,

but there is no print, too I suggest you to change the log level by checking the document of R-Car BSP. And it seems that rcar_printf.c is not used when output log from scif. I do not clearly remember the details. Please check the code for it.

Then BL31 could print log during boot period Above is for BL31.

And for the log except for boot period, you could see it from Linux console This is for BL32. And only the log except for boot period could be seen frome Linux console. For example, when you run a CA in Linux, you could see log of secure world.

chenlifu2015 commented 5 years ago

Hi qwertylhl Errors will happen when we build the bl31 without building the rcar_printf.c, but Bl2 also used the scif.S and rcar_printf.c, and BL2 can print log, so I guess scif.S will use some function in rcar_printf.c. you mean that I can see log of both BL2/BL31/BL32(optee)/BL33(uboot)/linux(zImage) during the boot, but I only see the log of BL2/BL33/linux, and the log level of BL2 is same as BL31, so I really don`t know where is the problem(BL2 is running at EL3)