UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
1,063 Views
Registered: ‎02-08-2017

Create ArmTrustedFirmware using commands - Windows

Jump to solution

I can use SDK as GUI to create ArmTrustedFirmaware (ATF) as I can find easily as shown below

ATF_wizard_01.PNG

 

I want to have this step included in my script. So I need to use xsct commands to do this task. I have checked UG-1208 but I can't find sny command to create project for ATF

XSCT_Projcommands.PNG

 

Can anyone advise please how to exeute this in command mode (I am using windows machine).

 

Thanks in Advance

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
679 Views
Registered: ‎10-06-2016

Re: Create ArmTrustedFirmware using commands - Windows

Jump to solution

Hi @moibrahim,

 

ATF source files provides multiple configuration options through the preproessor that might be used at build time and the best way to understand its purpose is just searching in the code.

 

As you can see in the Makefiles it is used to select the serial console driver for the ATF. There is no need really to set to cadence as is is already defined default.

 

ZYNQMP_CONSOLE	?=	cadence
ifeq (${ZYNQMP_CONSOLE}, $(filter ${ZYNQMP_CONSOLE},cadence cadence0 cadence1))
  PLAT_BL_COMMON_SOURCES += drivers/cadence/uart/aarch64/cdns_console.S
else ifeq (${ZYNQMP_CONSOLE}, dcc)
  PLAT_BL_COMMON_SOURCES += \
			    drivers/arm/dcc/dcc_console.c
else
  $(error "Please define ZYNQMP_CONSOLE")
endif

These macros are used to define where the ATF is going to be placed, again the default values correspond to @sadanan values so there is no really need to add.

 

/*******************************************************************************
 * BL31 specific defines.
 ******************************************************************************/
/*
 * Put BL31 at the top of the Trusted SRAM (just below the shared memory, if
 * present). BL31_BASE is calculated using the current BL31 debug size plus a
 * little space for growth.
 */
#ifndef ZYNQMP_ATF_MEM_BASE
#if !DEBUG
# define BL31_BASE			0xfffea000
# define BL31_LIMIT			0xffffffff
#else
# define BL31_BASE			0x1000
# define BL31_LIMIT			0x7ffff
#endif
#else
# define BL31_BASE			(ZYNQMP_ATF_MEM_BASE)
# define BL31_LIMIT			(ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_SIZE - 1)
# ifdef ZYNQMP_ATF_MEM_PROGBITS_SIZE
#  define BL31_PROGBITS_LIMIT		(ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_PROGBITS_SIZE - 1)
# endif
#endif
  • SPD:

 

Not sure really about this, I mean, is quite specific to the ATF by itself but from the source files it seems that none is also the default value so no surprises again.

 

 

Regarding to DEBUG, it only defines the debug Macro does not really change the build configuration so the executable will be placed on release folder but with DEBUG symbol defined (probably you will have some printing messages but you can check the code).

 

Finally just a quick point to the Petalinux flow which is the usual way to get the ATF built. As you can see in the recipe the build command used is the following one.

 

do_compile() {
	oe_runmake -C ${S} BUILD_BASE=${B} PLAT=${PLATFORM} RESET_TO_BL31=1 bl31
}

 

Regards

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
4 Replies
Xilinx Employee
Xilinx Employee
1,042 Views
Registered: ‎10-21-2010

Re: Create ArmTrustedFirmware using commands - Windows

Jump to solution

Hi,

There is no XSCT command to create ATF. However, you can create/build ATF from XSCT console like this. Please note that this will not be a standard eclipse project, so you cant see this in your project explorer

 

xsct% cd [getws]
xsct% exec cp -r $::env(XILINX_SDK)/data/embeddedsw/lib/sw_apps/atf_sources .
xsct% cd atf_sources/src
xsct% make DEBUG=1 RESET_TO_BL31=1 PLAT=zynqmp ZYNQMP_CONSOLE=cadence ZYNQMP_ATF_MEM_BASE=0XFFFEA000 ZYNQMP_ATF_MEM_SIZE=0X16000 SPD=none bl31 CROSS_COMPILE=aarch64-none-elf-

 

0 Kudos
Explorer
Explorer
1,036 Views
Registered: ‎02-08-2017

Re: Create ArmTrustedFirmware using commands - Windows

Jump to solution

@sadanan

Thanks alot for your help. I have one more question please:

I was following steps explained in this tutorial . It says building ATF can be using

make PLAT=zynqmp RESET_TO_BL31=1

I have no idea actually what are other parameters that you have clarified:

* DEBUG=1 --> I thought we have to choose 'Release' as the build output is found in /build/zynqmp/release/bl31 directory.

* what is meant by this console: ZYNQMP_CONSOLE=cadence

* how did you choose these adresses: ZYNQMP_ATF_MEM_BASE=0XFFFEA000 ZYNQMP_ATF_MEM_SIZE=0X16000

* what is SPD

 

I don't have documentation describing this, so I asked you directly.

Thanks in Advance

0 Kudos
Highlighted
Moderator
Moderator
680 Views
Registered: ‎10-06-2016

Re: Create ArmTrustedFirmware using commands - Windows

Jump to solution

Hi @moibrahim,

 

ATF source files provides multiple configuration options through the preproessor that might be used at build time and the best way to understand its purpose is just searching in the code.

 

As you can see in the Makefiles it is used to select the serial console driver for the ATF. There is no need really to set to cadence as is is already defined default.

 

ZYNQMP_CONSOLE	?=	cadence
ifeq (${ZYNQMP_CONSOLE}, $(filter ${ZYNQMP_CONSOLE},cadence cadence0 cadence1))
  PLAT_BL_COMMON_SOURCES += drivers/cadence/uart/aarch64/cdns_console.S
else ifeq (${ZYNQMP_CONSOLE}, dcc)
  PLAT_BL_COMMON_SOURCES += \
			    drivers/arm/dcc/dcc_console.c
else
  $(error "Please define ZYNQMP_CONSOLE")
endif

These macros are used to define where the ATF is going to be placed, again the default values correspond to @sadanan values so there is no really need to add.

 

/*******************************************************************************
 * BL31 specific defines.
 ******************************************************************************/
/*
 * Put BL31 at the top of the Trusted SRAM (just below the shared memory, if
 * present). BL31_BASE is calculated using the current BL31 debug size plus a
 * little space for growth.
 */
#ifndef ZYNQMP_ATF_MEM_BASE
#if !DEBUG
# define BL31_BASE			0xfffea000
# define BL31_LIMIT			0xffffffff
#else
# define BL31_BASE			0x1000
# define BL31_LIMIT			0x7ffff
#endif
#else
# define BL31_BASE			(ZYNQMP_ATF_MEM_BASE)
# define BL31_LIMIT			(ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_SIZE - 1)
# ifdef ZYNQMP_ATF_MEM_PROGBITS_SIZE
#  define BL31_PROGBITS_LIMIT		(ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_PROGBITS_SIZE - 1)
# endif
#endif
  • SPD:

 

Not sure really about this, I mean, is quite specific to the ATF by itself but from the source files it seems that none is also the default value so no surprises again.

 

 

Regarding to DEBUG, it only defines the debug Macro does not really change the build configuration so the executable will be placed on release folder but with DEBUG symbol defined (probably you will have some printing messages but you can check the code).

 

Finally just a quick point to the Petalinux flow which is the usual way to get the ATF built. As you can see in the recipe the build command used is the following one.

 

do_compile() {
	oe_runmake -C ${S} BUILD_BASE=${B} PLAT=${PLATFORM} RESET_TO_BL31=1 bl31
}

 

Regards

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Explorer
Explorer
670 Views
Registered: ‎02-08-2017

Re: Create ArmTrustedFirmware using commands - Windows

Jump to solution

@ibaie. Thanks, I really apperciate your reply and explanations.

0 Kudos