AR# 71156

|

2018.1/2 Zynq UltraScale+ MPSoC: ATF does not build in PetaLinux or Yocto when ATF DEBUG is enabled

描述

In Zynq UltraScale+ MPSoC, the device's ATF does not build when ATF DEBUG=1 compiler options are enabled using PetaLinux or Yocto. 

Run petalinux-config > ARM Trusted Firmware Compilation Configuration and enable debug as shown below:

 



$ petalinux-build -c arm-trusted-firmware

[INFO] building arm-trusted-firmware
[INFO] sourcing bitbake
INFO: bitbake virtual/arm-trusted-firmware
Loading cache: 100%
|###########################################################################################
Time: 0:00:00
Loaded 3434 entries from dependency cache.
Parsing recipes: 100%
|###########################################################################################
Time: 0:00:04
Parsing of 2544 .bb files complete (2501 cached, 43 parsed). 3436 targets, 136 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100%
|###########################################################################################
Time: 0:00:03
Checking sstate mirror object availability: 100%
|###########################################################################################
Time: 0:00:02
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: arm-trusted-firmware-1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0 do_compile: oe_runmake failed
ERROR: arm-trusted-firmware-1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0 do_compile: Function failed: do_compile (log file is located at /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/temp/log.do_compile.128745)
ERROR: Logfile of failure stored in: /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/temp/log.do_compile.128745
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 56 DEBUG=1 PRELOADED_BL33_BASE=0x10080000 ZYNQMP_ATF_MEM_BASE=0xFFFEA000 ZYNQMP_ATF_MEM_SIZE=0x16000 -C /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/git BUILD_BASE=/tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/build PLAT=zynqmp RESET_TO_BL31=1 bl31
| make: Entering directory '/tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/git'
|   CC      drivers/arm/cci/cci.c
|   CC      plat/common/plat_psci_common.c
|   CC      plat/xilinx/zynqmp/bl31_zynqmp_setup.c
|   CC      plat/xilinx/zynqmp/plat_psci.c
|   CC      plat/xilinx/zynqmp/plat_zynqmp.c
|   CC      plat/xilinx/zynqmp/plat_startup.c
|   CC      plat/xilinx/zynqmp/plat_topology.c
|   CC      plat/xilinx/zynqmp/sip_svc_setup.c
|   CC      plat/xilinx/zynqmp/zynqmp_ipi.c
|   CC      plat/xilinx/zynqmp/pm_service/pm_svc_main.c
|   CC      plat/xilinx/zynqmp/pm_service/pm_api_sys.c
|   CC      plat/xilinx/zynqmp/pm_service/pm_api_pinctrl.c
|   CC      plat/xilinx/zynqmp/pm_service/pm_api_ioctl.c
|   CC      plat/xilinx/zynqmp/pm_service/pm_api_clock.c
|   CC      plat/xilinx/zynqmp/pm_service/pm_ipi.c
|   CC      plat/xilinx/zynqmp/pm_service/pm_client.c
|   CC      bl31/bl31_main.c
|   CC      plat/xilinx/zynqmp/ipi_mailbox_service/ipi_mailbox_svc.c
|   CC      bl31/interrupt_mgmt.c
|   CC      bl31/bl31_context_mgmt.c
|   CC      common/runtime_svc.c
|   CC      services/arm_arch_svc/arm_arch_svc_setup.c
|   CC      services/std_svc/std_svc_setup.c
|   CC      lib/el3_runtime/cpu_data_array.c
|   CC      lib/el3_runtime/aarch64/context_mgmt.c
|   CC      lib/cpus/errata_report.c
|   CC      lib/psci/psci_on.c
|   CC      lib/psci/psci_off.c
| bl31/bl31_context_mgmt.c: In function 'cm_get_context_by_mpidr':
| bl31/bl31_context_mgmt.c:82:2: warning: 'platform_get_core_pos' is deprecated [-Wdeprecated-declarations]
|   return cm_get_context_by_index(platform_get_core_pos(mpidr), security_state);
|   ^~~~~~
| In file included from bl31/bl31_context_mgmt.c:13:0:
| include/plat/common/platform.h:381:14: note: declared here
|  unsigned int platform_get_core_pos(unsigned long mpidr) __deprecated;
|               ^~~~~~~~~~~~~~~~~~~~~
| bl31/bl31_context_mgmt.c: In function 'cm_set_context_by_mpidr':
| bl31/bl31_context_mgmt.c:93:2: warning: 'platform_get_core_pos' is deprecated [-Wdeprecated-declarations]
|   cm_set_context_by_index(platform_get_core_pos(mpidr),
|   ^~~~~~~~~~~~~~~~~~~~~~~
| In file included from bl31/bl31_context_mgmt.c:13:0:
| include/plat/common/platform.h:381:14: note: declared here
|  unsigned int platform_get_core_pos(unsigned long mpidr) __deprecated;
|               ^~~~~~~~~~~~~~~~~~~~~
| bl31/bl31_context_mgmt.c: In function 'cm_init_context':
| bl31/bl31_context_mgmt.c:108:3: warning: 'platform_get_core_pos' is deprecated [-Wdeprecated-declarations]
|    cm_init_context_by_index(platform_get_core_pos(mpidr), ep);
|    ^~~~~~~~~~~~~~~~~~~~~~~~
| In file included from bl31/bl31_context_mgmt.c:13:0:
| include/plat/common/platform.h:381:14: note: declared here
|  unsigned int platform_get_core_pos(unsigned long mpidr) __deprecated;
|               ^~~~~~~~~~~~~~~~~~~~~
|   CC      lib/psci/psci_suspend.c
|   CC      lib/psci/psci_common.c
|   CC      lib/psci/psci_main.c
|   CC      lib/psci/psci_setup.c
|   CC      lib/psci/psci_system_off.c
|   CC      lib/psci/psci_mem_protect.c
|   CC      lib/locks/bakery/bakery_lock_coherent.c
|   CC      lib/extensions/spe/spe.c
|   CC      common/bl_common.c
|   CC      common/tf_log.c
|   CC      common/tf_printf.c
|   CC      common/tf_snprintf.c
|   CC      plat/common/plat_log_common.c
|   CC      plat/common/aarch64/plat_common.c
|   CC      lib/stdlib/abort.c
|   CC      lib/stdlib/assert.c
|   CC      lib/stdlib/exit.c
|   CC      lib/stdlib/mem.c
|   CC      lib/stdlib/printf.c
|   CC      lib/stdlib/putchar.c
|   CC      lib/stdlib/puts.c
|   CC      lib/stdlib/strchr.c
|   CC      lib/stdlib/sscanf.c
|   CC      lib/stdlib/strcmp.c
|   CC      lib/stdlib/strlen.c
|   CC      lib/stdlib/strncmp.c
| plat/common/aarch64/plat_common.c: In function 'plat_get_syscnt_freq2':
| plat/common/aarch64/plat_common.c:67:2: warning: 'plat_get_syscnt_freq' is deprecated [-Wdeprecated-declarations]
|   unsigned long long freq = plat_get_syscnt_freq();
|   ^~~~~~~~
| In file included from plat/common/aarch64/plat_common.c:10:0:
| include/plat/common/platform.h:43:20: note: declared here
|  unsigned long long plat_get_syscnt_freq(void) __deprecated;
|                     ^~~~~~~~~~~~~~~~~~~~
|   CC      lib/stdlib/strnlen.c
|   CC      lib/stdlib/subr_prf.c
|   CC      lib/stdlib/timingsafe_bcmp.c
|   CC      lib/xlat_tables/xlat_tables_common.c
|   CC      lib/xlat_tables/aarch64/xlat_tables.c
|   CC      drivers/delay_timer/delay_timer.c
|   CC      drivers/delay_timer/generic_delay_timer.c
|   CC      drivers/arm/gic/common/gic_common.c
|   CC      drivers/arm/gic/v2/gicv2_main.c
|   CC      drivers/arm/gic/v2/gicv2_helpers.c
|   CC      plat/arm/common/arm_cci.c
|   CC      plat/arm/common/arm_common.c
|   CC      plat/common/plat_gicv2.c
|   CC      plat/arm/common/arm_gicv2.c
|   CC      plat/xilinx/zynqmp/aarch64/zynqmp_common.c
|   AS      lib/cpus/aarch64/aem_generic.S
|   AS      lib/cpus/aarch64/cortex_a53.S
|   AS      bl31/aarch64/runtime_exceptions.S
|   AS      bl31/aarch64/bl31_entrypoint.S
|   AS      bl31/aarch64/crash_reporting.S
|   AS      plat/common/aarch64/platform_mp_stack.S
|   AS      lib/el3_runtime/aarch64/cpu_data.S
|   AS      lib/cpus/aarch64/cpu_helpers.S
|   AS      lib/psci/aarch64/psci_helpers.S
|   AS      lib/locks/exclusive/aarch64/spinlock.S
|   AS      lib/aarch64/cache_helpers.S
|   AS      lib/el3_runtime/aarch64/context.S
|   AS      lib/aarch64/misc_helpers.S
|   AS      common/aarch64/debug.S
|   AS      drivers/console/aarch64/console.S
|   AS      plat/common/aarch64/platform_helpers.S
|   AS      plat/arm/common/aarch64/arm_helpers.S
|   AS      plat/xilinx/zynqmp/aarch64/zynqmp_helpers.S
|   AS      drivers/cadence/uart/aarch64/cdns_console.S
|   PP      bl31/bl31.ld.S
|   LD      /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/build/zynqmp/debug/bl31/bl31.elf
| aarch64-xilinx-linux-ld: /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/build/zynqmp/debug/bl31/bl31.elf section `xlat_table' will not fit in region `RAM'
| aarch64-xilinx-linux-ld: BL31 image has exceeded its limit.
| aarch64-xilinx-linux-ld: region `RAM' overflowed by 4097 bytes
| make: *** [Makefile:605: /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/build/zynqmp/debug/bl31/bl31.elf] Error 1
| make: Leaving directory '/tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/git'
| ERROR: oe_runmake failed
| WARNING: /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/temp/run.do_compile.128745:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at /tmp/sandeepg/plnx/2018.1/zcu102-test/work/aarch64-xilinx-linux/arm-trusted-firmware/1.4-xilinx-v2018.1+gitAUTOINC+df4a7e97d5-r0/temp/log.do_compile.128745)
ERROR: Task (/proj/petalinux/released/Petalinux-v2018.1/petalinux-v2018.1_0417_1/petalinux-v2018.1-final/components/yocto/source/aarch64/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2018.1.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 565 tasks of which 503 didn't need to be rerun and 1 failed.
 
Summary: 1 task failed:
  /proj/petalinux/released/Petalinux-v2018.1/petalinux-v2018.1_0417_1/petalinux-v2018.1-final/components/yocto/source/aarch64/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_2018.1.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build arm-trusted-firmware
$

解决方案

This is due to an increase in the size of the ATF, which cannot fit in the available OCM space if the DEBUG flag is enabled.

The ATF source code is capable of being built to DDR, but the PetaLinux or Yocto arm-trusted-firmware.bb recipes are using the ZYNQMP_ATF_MEM_BASE=0XFFFEA000 ZYNQMP_ATF_MEM_SIZE=0X16000 build flags which prevent code from being placed on DDR.

To work around this issue, follow the bellow steps.

1) Set ZYNQMP_ATF_MEM_BASE=0x1000 and  ZYNQMP_ATF_MEM_SIZE=0x7F000 from petalinux-config > ARM Trusted Firmware Compilation Configuration

 


 

 

2) Append DEBUG configurations in ATF recipes as shown below:

 

$ mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-bsp/arm-trusted-firmware
$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_%.bbappend

# arm-trusted-firmware_%.bbappend content

DEBUG ?= "1"

EXTRA_OEMAKE_append = "${@bb.utils.contains('DEBUG', '1', ' DEBUG=${DEBUG}', '', d)}"

OUTPUT_DIR = "${@bb.utils.contains('DEBUG', '1', '${B}/${PLATFORM}/debug', '${B}/${PLATFORM}/release', d)}"

 
 

 

3) Rebuild ATF

$ petalinux-build -c arm-trusted-firmware

链接问答记录

相关答复记录

Answer Number 问答标题 问题版本 已解决问题的版本
70771 SDK 2018.1, ATF - section `xlat_table' will not fit in region `RAM' N/A N/A
AR# 71156
日期 06/18/2018
状态 Active
Type 综合文章
器件
Tools
Boards & Kits
People Also Viewed