Soren Brinkmann [Fri, 22 Apr 2016 17:02:46 +0000 (10:02 -0700)]
zynqmp: Reduce mapped memory area
The GIC area is specified larger than it needs to be and can be reduced.
Which allows reducing the structures required for the translation tables
as well.
This results in a reduction of memory footprint of ca. 4k.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Mon, 15 Jun 2015 12:22:50 +0000 (14:22 +0200)]
zynqmp: FSBL->ATF handover
Parse the parameter structure the FSBL populates, to populate the bl32
and bl33 image structures.
Cc: Sarat Chand Savitala <saratcha@xilinx.com>
Cc: petalinux-dev@xilinx.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[ SB
- pass pointers to structs instead of structs
- handle execution state parameter
- populate bl32 SPSR
- add documentation
- query bootmode and consider missing handoff parameters an error when
not in JTAG boot mode
]
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Soren Brinkmann [Mon, 18 Apr 2016 18:49:42 +0000 (11:49 -0700)]
zynqmp: Introduce zynqmp_get_bootmode
Provide a function to retrieve the bootmode.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Soren Brinkmann [Mon, 18 Apr 2016 18:27:48 +0000 (11:27 -0700)]
zynqmp: Remove bogus comment
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Soren Brinkmann [Thu, 14 Apr 2016 17:27:00 +0000 (10:27 -0700)]
zynqmp: Revise memory configuration options
Drop the current configuration options for selecting the location of
the ATF and TSP (ZYNQMP_ATF_LOCATION, ZYNQMP_TSP_RAM_LOCATION).
The new configuration provides one default setup (ATF in OCM,
BL32 in DRAM). Additionally, the new configuration options
- ZYNQMP_ATF_MEM_BASE
- ZYNQMP_ATF_MEM_SIZE
- ZYNQMP_BL32_MEM_BASE
- ZYNQMP_BL32_MEM_SIZE
can be used to freely configure the memory locations used for ATF and
secure payload.
Also, allow setting the BL33 entry point via PRELOADED_BL33_BASE.
Cc: petalinux-dev@xilinx.com
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Soren Brinkmann [Mon, 18 Apr 2016 17:46:19 +0000 (10:46 -0700)]
context: Fix typo in comment
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Soren Brinkmann [Mon, 11 Apr 2016 22:30:56 +0000 (15:30 -0700)]
zynqmp: ipi: Consolidate IRQ #defines
The bit mapping in I(E|D|S)R are equal, consolidate the #defines.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Soren Brinkmann [Mon, 11 Apr 2016 20:26:41 +0000 (13:26 -0700)]
zynqmp: Remove unused/redundant #includes
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
danh-arm [Thu, 14 Apr 2016 18:15:36 +0000 (19:15 +0100)]
Merge pull request #549 from ljerry/tf_issue_373
Allow to dump platform-defined regs in crash log
Gerald Lejeune [Thu, 26 Nov 2015 14:47:53 +0000 (15:47 +0100)]
Dump platform-defined regs in crash reporting
It is up to the platform to implement the new plat_crash_print_regs macro to
report all relevant platform registers helpful for troubleshooting.
plat_crash_print_regs merges or calls previously defined plat_print_gic_regs
and plat_print_interconnect_regs macros for each existing platforms.
NOTE: THIS COMMIT REQUIRES ALL PLATFORMS THAT ENABLE THE `CRASH_REPORTING`
BUILD FLAG TO MIGRATE TO USE THE NEW `plat_crash_print_regs()` MACRO. BY
DEFAULT, `CRASH_REPORTING` IS ENABLED IN DEBUG BUILDS FOR ALL PLATFORMS.
Fixes: arm-software/tf-issues#373
Signed-off-by: Gerald Lejeune <gerald.lejeune@st.com>
danh-arm [Thu, 14 Apr 2016 11:17:44 +0000 (12:17 +0100)]
Merge pull request #593 from mtk09422/mtcmos-fix
mt8173: Fix timing issue of mfg mtcmos power off
danh-arm [Thu, 14 Apr 2016 10:39:46 +0000 (11:39 +0100)]
Merge pull request #591 from soby-mathew/sm/xlat_common
Refactor the xlat_tables library
Fan Chen [Fri, 1 Apr 2016 10:35:43 +0000 (18:35 +0800)]
mt8173: Fix timing issue of mfg mtcmos power off
In mt8173, there are totally 10 non-cpu mtcmos, so we cannot tell
if SPM finished the power control flow by 10 status bits of PASR_PDP_3.
So, extend PASR_PDP_3 status bits from 10 to 20 so that we can
make sure if the control action has been done precisely.
Change-Id: Ifd4faaa4173c6e0543aa8471149adb9fe7fadedc
Signed-off-by: Fan Chen <fan.chen@mediatek.com>
Soby Mathew [Fri, 8 Apr 2016 15:42:58 +0000 (16:42 +0100)]
Migrate platform ports to the new xlat_tables library
This patch modifies the upstream platform port makefiles to use the new
xlat_tables library files. This patch also makes mmap region setup common
between AArch64 and AArch32 for FVP platform port. The file `fvp_common.c`
is moved from the `plat/arm/board/fvp/aarch64` folder to the parent folder
as it is not specific to AArch64.
Change-Id: Id2e9aac45e46227b6f83cccfd1e915404018ea0b
Soby Mathew [Tue, 22 Mar 2016 15:51:08 +0000 (15:51 +0000)]
Refactor the xlat_tables library code
The AArch32 long descriptor format and the AArch64 descriptor format
correspond to each other which allows possible sharing of xlat_tables
library code between AArch64 and AArch32. This patch refactors the
xlat_tables library code to seperate the common functionality from
architecture specific code. Prior to this patch, all of the xlat_tables
library code were in `lib/aarch64/xlat_tables.c` file. The refactored code
is now in `lib/xlat_tables/` directory. The AArch64 specific programming
for xlat_tables is in `lib/xlat_tables/aarch64/xlat_tables.c` and the rest
of the code common to AArch64 and AArch32 is in
`lib/xlat_tables/xlat_tables_common.c`. Also the data types used in
xlat_tables library APIs are reworked to make it compatible between AArch64
and AArch32.
The `lib/aarch64/xlat_tables.c` file now includes the new xlat_tables
library files to retain compatibility for existing platform ports.
The macros related to xlat_tables library are also moved from
`include/lib/aarch64/arch.h` to the header `include/lib/xlat_tables.h`.
NOTE: THE `lib/aarch64/xlat_tables.c` FILE IS DEPRECATED AND PLATFORM PORTS
ARE EXPECTED TO INCLUDE THE NEW XLAT_TABLES LIBRARY FILES IN THEIR MAKEFILES.
Change-Id: I3d17217d24aaf3a05a4685d642a31d4d56255a0f
danh-arm [Wed, 13 Apr 2016 09:03:00 +0000 (10:03 +0100)]
Merge pull request #590 from yatharth-arm/yk/tzc400
Use unsigned long long instead of uintptr_t in TZC400/DMC500 drivers
Yatharth Kochar [Fri, 8 Apr 2016 13:40:44 +0000 (14:40 +0100)]
Use unsigned long long instead of uintptr_t in TZC400/DMC500 drivers
Currently the `tzc400_configure_region` and `tzc_dmc500_configure_region`
functions uses uintptr_t as the data type for `region_top` and `region_base`
variables, which will be converted to 32/64 bits for AArch32/AArch64
respectively. But the expectation is to keep these addresses at least 64 bit.
This patch modifies the data types to make it at least 64 bit by using
unsigned long long instead of uintptr_t for the `region_top` and
`region_base` variables. It also modifies the associated macros
`_tzc##fn_name##_write_region_xxx` accordingly.
Change-Id: I4e3c6a8a39ad04205cf0f3bda336c3970b15a28b
danh-arm [Tue, 12 Apr 2016 13:47:54 +0000 (14:47 +0100)]
Merge pull request #589 from soby-mathew/sm/fix_rk_build_err
Fix build error in Rockchip platform
Soby Mathew [Tue, 12 Apr 2016 13:04:29 +0000 (14:04 +0100)]
Fix build error in Rockchip platform
This patch fixes the compilation error in Rockchip rk3368 platform port when
it is built in release mode.
Fixes ARM-software/tf-issues#389
Change-Id: I1a3508ac3a620289cf700e79db8f08569331ac53
danh-arm [Mon, 11 Apr 2016 09:23:47 +0000 (10:23 +0100)]
Merge pull request #579 from ashutoshksingh/master
pass r0-r6 as part of smc param
danh-arm [Fri, 8 Apr 2016 13:31:58 +0000 (14:31 +0100)]
Merge pull request #569 from Xilinx/zynqmp-v1
Support for Xilinx Zynq UltraScale+ MPSoC
danh-arm [Fri, 8 Apr 2016 12:51:46 +0000 (13:51 +0100)]
Merge pull request #588 from antonio-nino-diaz-arm/an/ignore-check-md
Fix style check and remove markdown files from it
Antonio Nino Diaz [Fri, 8 Apr 2016 10:51:19 +0000 (11:51 +0100)]
Remove markdown files from coding style check
All markdown (.md) files in the root directory of the repository and
all the files inside the 'docs' directory have been removed from
ROOT_DIRS_TO_CHECK in the Makefile in order not to perform the coding
style check on them.
Change-Id: Iac397b44f95cbcdb9a52cc20bf69998c394ac00a
Antonio Nino Diaz [Fri, 8 Apr 2016 10:49:10 +0000 (11:49 +0100)]
Fix list of paths to perform coding style check on
Removed an extra parentheses that produced an invalid list of files
and directories to check by checkpatch.pl.
Change-Id: Iefe2c1f8be6e7b7b58f6ffe3e16fe6336b9a8689
danh-arm [Fri, 8 Apr 2016 09:43:46 +0000 (10:43 +0100)]
Merge pull request #587 from antonio-nino-diaz-arm/an/rename-bl33-base
Rename BL33_BASE and make it work with RESET_TO_BL31
danh-arm [Fri, 8 Apr 2016 09:40:39 +0000 (10:40 +0100)]
Merge pull request #586 from antonio-nino-diaz-arm/an/spd-bl32
Remove BL32_BASE when building without SPD for FVP
danh-arm [Fri, 8 Apr 2016 09:36:11 +0000 (10:36 +0100)]
Merge pull request #585 from soby-mathew/sm/tf_printf_ll_changes
Differentiate `long` and `long long` formats in tf_printf
Antonio Nino Diaz [Wed, 6 Apr 2016 16:31:57 +0000 (17:31 +0100)]
Rename BL33_BASE option to PRELOADED_BL33_BASE
To avoid confusion the build option BL33_BASE has been renamed to
PRELOADED_BL33_BASE, which is more descriptive of what it does and
doesn't get mistaken by similar names like BL32_BASE that work in a
completely different way.
NOTE: PLATFORMS USING BUILD OPTION `BL33_BASE` MUST CHANGE TO THE NEW
BUILD OPTION `PRELOADED_BL33_BASE`.
Change-Id: I658925ebe95406edf0325f15aa1752e1782aa45b
Antonio Nino Diaz [Wed, 6 Apr 2016 14:05:54 +0000 (15:05 +0100)]
Fix BL33_BASE option to work with RESET_TO_BL31
The BL33 address is now set in arm_bl31_early_platform_setup() so
that the preloaded BL33 boot option is available when RESET_TO_BL31
is also used.
Change-Id: Iab93e3916f9199c3387886b055c7cd2315efed29
Antonio Nino Diaz [Tue, 5 Apr 2016 10:38:49 +0000 (11:38 +0100)]
Remove BL32_BASE when building without SPD for FVP
Previously, when building TF without SPD support, BL2 tried to load a
BL32 image from the FIP and fails to find one, which resulted on
warning messages on the console. Even if there is a BL32 image in the
FIP it shouldn't be loaded because there is no way to transfer
control to the Secure Payload without SPD support.
The Makefile has been modified to pass a define of the form
SPD_${SPD} to the source code the same way it's done for PLAT. The
define SPD_none is then used to undefine BL32_BASE when BL32 is not
used to prevent BL2 from trying to load a BL32 image and failing,
thus removing the warning messages mentioned above.
Fixes ARM-software/tf-issues#287
Change-Id: Ifeb6f1c26935efb76afd353fea88e87ba09e9658
Soby Mathew [Tue, 22 Mar 2016 17:38:00 +0000 (17:38 +0000)]
Differentiate `long` and `long long` formats in tf_printf
This patch adds support to differentiate between `long` and `long long`
format specifiers in tf_printf(). In AArch64, they are the same which is
a 64-bit word. But, in AArch32 they are different and tf_printf() needs
to handle these format specifiers separately. This patch also fixes the
type of variables used to generic C types.
Change-Id: If3bbb0245cd0183acbe13bc1fe0d9743f417578f
danh-arm [Thu, 7 Apr 2016 16:17:25 +0000 (17:17 +0100)]
Merge pull request #584 from soby-mathew/sm/enable_scr_sif
Enable SCR_EL3.SIF bit
danh-arm [Thu, 7 Apr 2016 16:16:51 +0000 (17:16 +0100)]
Merge pull request #583 from mtk09422/fix-build-error
mt8173: fix spm driver build errors
danh-arm [Thu, 7 Apr 2016 16:16:27 +0000 (17:16 +0100)]
Merge pull request #582 from jcastillo-arm/jc/fip_extract
fip_create: add support for image unpacking
danh-arm [Thu, 7 Apr 2016 16:11:45 +0000 (17:11 +0100)]
Merge pull request #578 from EvanLloyd/ejll/woa_make2
Make improvements for host environment portability
danh-arm [Thu, 7 Apr 2016 16:11:20 +0000 (17:11 +0100)]
Merge pull request #575 from soby-mathew/sm/new_tzc_driver
Refactor the TZC driver and add DMC-500 driver
danh-arm [Thu, 7 Apr 2016 16:10:44 +0000 (17:10 +0100)]
Merge pull request #572 from jcastillo-arm/jc/tbb_nvcounter
TBB NVcounter support
danh-arm [Thu, 7 Apr 2016 16:09:48 +0000 (17:09 +0100)]
Merge pull request #563 from sbranden/tf_issue_380
Add support for %z in tf_print()
Soby Mathew [Mon, 4 Apr 2016 11:34:24 +0000 (12:34 +0100)]
Enable SCR_EL3.SIF bit
This patch enables the SCR_EL3.SIF (Secure Instruction Fetch) bit in BL1 and
BL31 common architectural setup code. When in secure state, this disables
instruction fetches from Non-secure memory.
NOTE: THIS COULD BREAK PLATFORMS THAT HAVE SECURE WORLD CODE EXECUTING FROM
NON-SECURE MEMORY, BUT THIS IS CONSIDERED UNLIKELY AND IS A SERIOUS SECURITY
RISK.
Fixes ARM-Software/tf-issues#372
Change-Id: I684e84b8d523c3b246e9a5fabfa085b6405df319
yt.lee [Thu, 7 Apr 2016 05:28:57 +0000 (13:28 +0800)]
mt8173: fix spm driver build errors
To fix build errors in following build conditions,
DEBUG=1 LOG_LEVEL<40
DEBUG=0 LOG_LEVEL>=40
Change-Id: Ib34aed07b2ae0abd8a3a46948adc9fbeaae715aa
Signed-off-by: yt.lee <yt.lee@mediatek.com>
Soren Brinkmann [Wed, 9 Mar 2016 08:58:23 +0000 (00:58 -0800)]
Add Xilinx to acknowledgements file
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Soren Brinkmann [Mon, 7 Mar 2016 04:16:27 +0000 (20:16 -0800)]
Add support for Xilinx Zynq UltraScale+ MPSOC
The Xilinx Zynq UltraScale+ MPSOC containes a quad A53 cluster. This
patch adds the platform port for that SoC.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Juan Castillo [Mon, 15 Feb 2016 17:21:10 +0000 (17:21 +0000)]
fip_create: add support for image unpacking
This patch adds support for image unpacking to the FIP packaging
tool. Command line option '-u,--unpack' may be used to unpack the
contents of an existing FIP file into the working directory. The
tool uses default hardcoded filenames for the unpacked images. If
the files already exist, they can be overwritten by specifying the
option '-f,--force'.
Change-Id: I360b11d9c5403e8c0a7a9cac32c1d90ebb228063
danh-arm [Wed, 6 Apr 2016 11:43:33 +0000 (12:43 +0100)]
Merge pull request #581 from rockchip-linux/rockchip-atf-
20160405
Support for Rockchip's family SoCs
Tony Xie [Fri, 15 Jan 2016 09:17:32 +0000 (17:17 +0800)]
Support for Rockchip's family SoCs
This patch adds to support the RK3368 and RK3399 SoCs.
RK3368/RK3399 is one of the Rockchip family SoCs, which is an
multi-cores ARM SoCs.
This patch adds support to boot the Trusted Firmware on RK3368/RK3399
SoCs, and adds support to boot secondary CPUs, enter/exit core
power states for all CPUs in the slow/fast clusters.
This is the initial version for rockchip SoCs.(RK3368/RK3399 and next SoCs)
* Support arm gicv2 & gicv3.
* Boot up multi-cores CPU.
* Add generic CPU helper functions.
* Support suspend/resume.
* Add system_off & system_reset implementation.
* Add delay timer platform implementation.
* Support the new porting interface for the PSCI implementation.
Change-Id: I704bb3532d65e8c70dbd99b512c5e6e440ea6f43
Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Shengfei xu <xsf@rock-chips.com>
danh-arm [Mon, 4 Apr 2016 12:39:32 +0000 (13:39 +0100)]
Merge pull request #580 from soby-mathew/sm/ret_type_plat_ns_ep
Modify return type of plat_get_ns_image_entrypoint()
Soren Brinkmann [Mon, 7 Mar 2016 04:23:39 +0000 (20:23 -0800)]
arm: common: Make timer configuration conditional
Make the timer configuration conditional on the optional interface being
available.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Soren Brinkmann [Mon, 7 Mar 2016 04:14:51 +0000 (20:14 -0800)]
drivers: Add Cadence UART driver
Add a driver for the Cadence UART which is found in Xilinx Zynq SOCs.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Soby Mathew [Wed, 23 Mar 2016 10:11:10 +0000 (10:11 +0000)]
Modify return type of plat_get_ns_image_entrypoint()
This patch modifies the return type of the platform API
`plat_get_ns_image_entrypoint()` from `unsigned long` to
`uintptr_t` in accordance with the coding guidelines.
Change-Id: Icb4510ca98b706aa4d535fe27e203394184fb4ca
danh-arm [Fri, 1 Apr 2016 16:41:10 +0000 (17:41 +0100)]
Merge pull request #577 from antonio-nino-diaz-arm/an/remove-xlat-helpers
Remove xlat_helpers.c
danh-arm [Fri, 1 Apr 2016 16:40:54 +0000 (17:40 +0100)]
Merge pull request #576 from mtk09422/bl31-security
mt8173: Protect BL31 memory from non-secure access
Ashutosh Singh [Thu, 31 Mar 2016 16:18:34 +0000 (17:18 +0100)]
pass r0-r6 as part of smc param
In new communication protocol between optee os and linux driver,
r0-r6 registers are used. opteed need to copy these registers
as well when optee context registers are initialized.
Change-Id: Ifb47b73f847c61746cb58ea78411c1c71f208030
Signed-off-by: Ashutosh Singh <ashutosh.singh@arm.com>
Evan Lloyd [Thu, 3 Dec 2015 12:58:52 +0000 (12:58 +0000)]
Make:Improve version string generation portability
To get round problems encountered when building in a DOS build
environment the generation of the .o file containing build identifier
strings is modified.
The problems encounterred were:
1. DOS echo doesn't strip ' characters from the output text.
2. git is not available from CMD.EXE so the BUILD_STRING value needs
some other origin.
A BUILD_STRING value of "development build" is used for now.
MAKE_BUILD_STRINGS is used to customise build string generation in a DOS
environment. This variable is not defined in the UNIX build environment
make file helper, and so the existing build string generation behaviour
is retained in these build environments.
NOTE: This commit completes a cumulative series aimed at improving
build portability across development environments.
This enables the build to run on several new build environments,
if the relevant tools are available.
At this point the build is tested on Windows 7 Enterprise SP1,
using CMD.EXE, Cygwin and Msys (MinGW),as well as a native
Linux envionment". The Windows platform builds used
aarch64-none-elf-gcc.exe 4.9.1. CMD.EXE and Msys used Gnu
Make 3.81, cygwin used Gnu Make 4.1.
CAVEAT: The cert_create tool build is not tested on the Windows
platforms (openssl-for-windows has a GPL license).
Change-Id: Iaa4fc89dbe2a9ebae87e2600c9eef10a6af30251
Evan Lloyd [Thu, 3 Dec 2015 12:19:30 +0000 (12:19 +0000)]
Make:Improve directory generation portability.
Because of command differences in some build environments the "inline"
method of generating the build directory structure is not portable.
(e.g. in DOS environments the mkdir shell command fails if a directory
already exists, whereas in UNIX environments it succeeds.)
To improve portability we generate the directories needed using make,
but use the "order-only prerequisites" feature of make to prevent writes
of files into the directories generating re-builds, as suggested in the
GNU make Manual (Version 4.1 September 2014).
Change-Id: Ic9af475831063c7fe6f8bccffef184d79e799419
Evan Lloyd [Thu, 3 Dec 2015 11:35:40 +0000 (11:35 +0000)]
Make:Allow for extension in tool names.
In some build environments executable programs have a specific file
extension. The value of BIN_EXT is appended to the relevant tool file
names to allow for this.
The value of BIN_EXT is set, where appropriate, by the build environment
specific make helper (to .exe for Windows build environments).
.gitignore is updated to hide the new (.exe) files.
Change-Id: Icc32f64b750e425265075ad4e0dea18129640b86
Evan Lloyd [Thu, 3 Dec 2015 09:47:51 +0000 (09:47 +0000)]
Make:Use "simply expanded" make variables.
Replace some "recursively expanded" make variables with "simply
expanded" variables (i.e. replace = with :=). This has no functional
impact but is more consistent and theoretically more efficient.
Change-Id: Iaf33d7c8ad48464ae0d39923515d1e7f230c95c1
Evan Lloyd [Wed, 2 Dec 2015 20:30:13 +0000 (20:30 +0000)]
Build:Replace soft links with file copy.
Some build environments do not support symbolic links. This patch
removes the symlinks previously used to build fip_create and instead
copies the relevant header files.
The original motivation for using symlinks was to avoid Trusted Firmware
library headers conflicting with headers in the compiler standard
include path. Copying the header files instead has the same effect.
Like other build artefacts, the copied files are listed in .gitignore.
The distclean targets have also been updated to remove the copies.
Change-Id: Ie8b67bcb133f7f1d660ae93b857950aa15e42b1e
Evan Lloyd [Wed, 2 Dec 2015 18:56:06 +0000 (18:56 +0000)]
Make:Use environment variables for OS detection.
Add make helper files to select the appropriate settings for the build
environment. Selection is made in make_helpers/build_env.mk, which
selects other files to include using generic build environment settings.
The Trusted Firmware Makefile and supporting tool Makefiles are updated
to include build_env.mk instead of unix.mk.
NOTE: This change does not fully enable builds in other build
environments. It facilitates this without compromising the
existing build environments.
Change-Id: Ic4064ffe6ce158bbd16d7cc9f27dd4655a3580f6
Evan Lloyd [Wed, 2 Dec 2015 18:41:22 +0000 (18:41 +0000)]
Make:Diagnostic fail if no eval
To help diagnose make problems, we report an error if the make
program used does not provide the $(eval ) make functionality.
This will detect early versions of GNU make and other make programs.
Change-Id: I0ebb0f63694cf0b04eaeb7ea1e9e172fb9770ce0
Evan Lloyd [Wed, 2 Dec 2015 18:33:55 +0000 (18:33 +0000)]
Make:Make shell commands more portable
Macros are inserted to replace direct invocations of commands that are
problematic on some build environments. (e.g. Some environments expect
\ in paths instead of /.)
The changes take into account mismatched command mappings across
environments.
The new helper file unix.mk retains existing makefile behaviour on unix
like build environments by providing the following macro definitions:
SHELL_COPY cp -f
SHELL_COPY_TREE cp -rf
SHELL_DELETE rm -f
SHELL_DELETE_ALL rm -rf
MAKE_PREREQ_DIR mkdir -p (As make target)
SHELL_REMOVE_DIR rm -rf
Change-Id: I1b5ca5e1208e78230b15284c4af00c1c006cffcb
Evan Lloyd [Wed, 2 Dec 2015 18:22:22 +0000 (18:22 +0000)]
Make:Add realclean to .PHONY list
Update the cert_create Makefile to list realclean as .PHONY
(like clean)
Change-Id: I9dc8a61a11574a044372e0952b5b12b74e133747
Evan Lloyd [Wed, 2 Dec 2015 18:17:37 +0000 (18:17 +0000)]
Make:Remove calls to shell from makefiles.
As an initial stage of making Trusted Firmware build environment more
portable, we remove most uses of the $(shell ) function and replace them
with more portable make function based solutions.
Note that the setting of BUILD_STRING still uses $(shell ) since it's
not possible to reimplement this as a make function. Avoiding invocation
of this on incompatible host platforms will be implemented separately.
Change-Id: I768e2f9a265c78814a4adf2edee4cc46cda0f5b8
Jimmy Huang [Tue, 29 Mar 2016 09:42:41 +0000 (17:42 +0800)]
mt8173: Protect BL31 memory from non-secure access
BL31 usually handles confidential stuff, its memory must not be
read/write accessible from non-secure world. This patch protects
the BL31 memory range from non-secure read/write access.
Change-Id: I442fb92b667bb2f9a62d471a90508b1ba4489911
Signed-off-by: Jimmy Huang <jimmy.huang@mediatek.com>
Vikram Kanigiri [Fri, 29 Jan 2016 12:32:58 +0000 (12:32 +0000)]
Add support to program a DMC-500 TZC on ARM platforms
This patch adds support to program TrustZone protection on ARM platforms that
implement a DMC-500. arm_dmc_500.c has been added which implements the
arm_dmc_tzc_setup() function. This function relies on constants related to TZC
programming that are exported by each platform to program TrustZone protection
using the DMC-500 TrustZone controller driver. This function should be called
from plat_arm_security_setup() which is implemented by each platform.
Change-Id: I5400bdee9e4b29155fd11296a40693d512312f29
Vikram Kanigiri [Fri, 29 Jan 2016 11:37:04 +0000 (11:37 +0000)]
Add ARM CoreLink DMC-500 driver to program TrustZone protection
The ARM CoreLink DMC-500 Dynamic Memory Controller provides the
programmable address region control of a TrustZone Address Space
Controller. The access permissions can be defined for eight
separate address regions plus a background or default region.
This patch adds a DMC-500 driver to define address regions and
program their access permissions as per ARM 100131_0000_02_en
(r0p0) document.
Change-Id: I9d33120f9480d742bcf7937e4b876f9d40c727e6
Soby Mathew [Fri, 26 Feb 2016 14:23:19 +0000 (14:23 +0000)]
Migrate ARM standard platforms to the refactored TZC driver
This patch migrates ARM Standard platforms to the refactored TZC driver.
Change-Id: I2a2f60b645f73e14d8f416740c4551cec87cb1fb
Vikram Kanigiri [Thu, 28 Jan 2016 17:22:16 +0000 (17:22 +0000)]
Refactor the ARM CoreLink TZC-400 driver
TrustZone protection can be programmed by both memory and TrustZone
address space controllers like DMC-500 and TZC-400. These peripherals
share a similar programmer's view.
Furthermore, it is possible to have multiple instances of each type of
peripheral in a system resulting in multiple programmer's views.
For example, on the TZC-400 each of the 4 filter units can be enabled
or disabled for each region. There is a single set of registers to
program the region attributes. On the DMC-500, each filter unit has its
own programmer's view resulting in multiple sets of registers to program
the region attributes. The layout of the registers is almost the same
across all these variations.
Hence the existing driver in `tzc400\tzc400.c` is refactored into the
new driver in `tzc\tzc400.c`. The previous driver file is still maintained
for compatibility and it is now deprecated.
Change-Id: Ieabd0528e244582875bc7e65029a00517671216d
Antonio Nino Diaz [Thu, 31 Mar 2016 08:08:56 +0000 (09:08 +0100)]
Remove xlat_helpers.c
lib/aarch64/xlat_helpers.c defines helper functions to build
translation descriptors, but no common code or upstream platform
port uses them. As the rest of the xlat_tables code evolves, there
may be conflicts with these helpers, therefore this code should be
removed.
Change-Id: I9f5be99720f929264818af33db8dada785368711
Juan Castillo [Fri, 22 Jan 2016 11:05:57 +0000 (11:05 +0000)]
TBB: add non-volatile counter support
This patch adds support for non-volatile counter authentication to
the Authentication Module. This method consists of matching the
counter values provided in the certificates with the ones stored
in the platform. If the value from the certificate is lower than
the platform, the boot process is aborted. This mechanism protects
the system against rollback.
The TBBR CoT has been updated to include this method as part of the
authentication process. Two counters are used: one for the trusted
world images and another for the non trusted world images.
** NEW PLATFORM APIs (mandatory when TBB is enabled) **
int plat_get_nv_ctr(void *cookie, unsigned int *nv_ctr);
This API returns the non-volatile counter value stored
in the platform. The cookie in the first argument may be
used to select the counter in case the platform provides
more than one (i.e. TBSA compliant platforms must provide
trusted and non-trusted counters). This cookie is specified
in the CoT.
int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr);
This API sets a new counter value. The cookie may be
used to select the counter to be updated.
An implementation of these new APIs for ARM platforms is also
provided. The values are obtained from the Trusted Non-Volatile
Counters peripheral. The cookie is used to pass the extension OID.
This OID may be interpreted by the platform to know which counter
must return. On Juno, The trusted and non-trusted counter values
have been tied to 31 and 223, respectively, and cannot be modified.
** IMPORTANT **
THIS PATCH BREAKS THE BUILD WHEN TRUSTED_BOARD_BOOT IS ENABLED. THE
NEW PLATFORM APIs INTRODUCED IN THIS PATCH MUST BE IMPLEMENTED IN
ORDER TO SUCCESSFULLY BUILD TF.
Change-Id: Ic943b76b25f2a37f490eaaab6d87b4a8b3cbc89a
danh-arm [Thu, 31 Mar 2016 10:42:14 +0000 (11:42 +0100)]
Merge pull request #570 from davwan01/bl31-in-dram
Add support to load BL31 in DRAM
danh-arm [Thu, 31 Mar 2016 08:39:45 +0000 (09:39 +0100)]
Merge pull request #554 from ljerry/tf_issue_368_ter
Enable asynchronous abort exceptions during boot
David Wang [Mon, 7 Mar 2016 03:02:57 +0000 (11:02 +0800)]
Add support to load BL31 in DRAM
This patch adds an option to the ARM common platforms to load BL31 in the
TZC secured DRAM instead of the default secure SRAM.
To enable this feature, set `ARM_BL31_IN_DRAM` to 1 in build options.
If TSP is present, then setting this option also sets the TSP location
to DRAM and ignores the `ARM_TSP_RAM_LOCATION` build flag.
To use this feature, BL2 platform code must map in the DRAM used by
BL31. The macro ARM_MAP_BL31_SEC_DRAM is provided for this purpose.
Currently, only the FVP BL2 platform code maps in this DRAM.
Change-Id: If5f7cc9deb569cfe68353a174d4caa48acd78d67
Gerald Lejeune [Tue, 22 Mar 2016 10:11:46 +0000 (11:11 +0100)]
Add ISR_EL1 to crash report
Bring ISR bits definition as a mnemonic for troublershooters as well.
Signed-off-by: Gerald Lejeune <gerald.lejeune@st.com>
Gerald Lejeune [Tue, 22 Mar 2016 10:07:04 +0000 (11:07 +0100)]
Remove DAIF bits handling macros
These macros are unused and redundant with other CPU system registers
functions.
Moreover enable_serror() function implementation may not reach its purpose
because it does not handle the value of SCR_EL3.EA.
Signed-off-by: Gerald Lejeune <gerald.lejeune@st.com>
Gerald Lejeune [Tue, 22 Mar 2016 08:29:23 +0000 (09:29 +0100)]
Enable asynchronous abort exceptions during boot
Asynchronous abort exceptions generated by the platform during cold boot are
not taken in EL3 unless SCR_EL3.EA is set.
Therefore EA bit is set along with RES1 bits in early BL1 and BL31 architecture
initialisation. Further write accesses to SCR_EL3 preserve these bits during
cold boot.
A build flag controls SCR_EL3.EA value to keep asynchronous abort exceptions
being trapped by EL3 after cold boot or not.
For further reference SError Interrupts are also known as asynchronous external
aborts.
On Cortex-A53 revisions below r0p2, asynchronous abort exceptions are taken in
EL3 whatever the SCR_EL3.EA value is.
Fixes arm-software/tf-issues#368
Signed-off-by: Gerald Lejeune <gerald.lejeune@st.com>
Juan Castillo [Fri, 22 Jan 2016 11:05:24 +0000 (11:05 +0000)]
cert_create: add non-volatile counter support
This patch adds non-volatile counter support to the Certificate
Generation tool. The TBBR Chain of Trust definition in the tool
has been extended to include the counters as certificate extensions.
The counter values can be specified in the command line.
The following default counter values are specified in the build
system:
* Trusted FW Non-Volatile counter = 0
* Non-Trusted FW Non-Volatile counter = 0
These values can be overridden by the platform at build time.
Change-Id: I7ea10ee78d72748d181df4ee78a7169b3ef2720c
danh-arm [Tue, 29 Mar 2016 14:39:01 +0000 (15:39 +0100)]
Merge pull request #561 from antonio-nino-diaz-arm/an/bootwrapper
Enable preloaded BL33 alternative boot flow
danh-arm [Tue, 29 Mar 2016 14:29:47 +0000 (15:29 +0100)]
Merge pull request #560 from sandrine-bailleux-arm/sb/restructure-doc
Simplify Firmware Design document
danh-arm [Tue, 29 Mar 2016 14:26:46 +0000 (15:26 +0100)]
Merge pull request #559 from soby-mathew/sm/cpu_ops_verbose_log
Make cpu operations warning a VERBOSE print
Scott Branden [Wed, 23 Mar 2016 20:37:33 +0000 (13:37 -0700)]
Add support for %z in tf_print()
Add support for %z format specific in tf_printf() to support
printing data of type size_t
Fixes ARM-software/tf-issues#380
Signed-off-by Scott Branden <scott.branden@broadcom.com>
Sandrine Bailleux [Tue, 26 Jan 2016 15:00:40 +0000 (15:00 +0000)]
Simplify Firmware Design document
The Firmware Design document is meant to provide a general overview
of the Trusted Firmware code. Although it is useful to provide some
guidance around the responsibilities of the platform layer, it should
not provide too much platform specific implementation details. Right
now, some sections are too tied to the implementation on ARM
platforms. This makes the Firmware Design document harder to digest.
This patch simplifies this aspect of the Firmware Design document.
The sections relating the platform initialisations performed by the
different BL stages have been simplified and the extra details about
the ARM platforms implementation have been moved to the Porting Guide
when appropriate.
This patch also provides various documentation fixes and additions
in the Firmware Design and Platform Porting Guide. In particular:
- Update list of SMCs supported by BL1.
- Remove MMU setup from architectural inits, as it is actually
performed by platform code.
- Similarly, move runtime services initialisation, BL2 image
initialization and BL33 execution out of the platform
initialisation paragraph.
- List SError interrupt unmasking as part of BL1 architectural
initialization.
- Mention Trusted Watchdog enabling in BL1 on ARM platforms.
- Fix order of steps in "BL2 image load and execution" section.
- Refresh section about GICv3/GICv2 drivers initialisation on
ARM platforms.
Change-Id: I32113c4ffdc26687042629cd8bbdbb34d91e3c14
Soby Mathew [Mon, 21 Mar 2016 10:36:47 +0000 (10:36 +0000)]
Make cpu operations warning a VERBOSE print
The assembler helper function `print_revision_warning` is used when a
CPU specific operation is enabled in the debug build (e.g. an errata
workaround) but doesn't apply to the executing CPU's revision/part number.
However, in some cases the system integrator may want a single binary to
support multiple platforms with different IP versions, only some of which
contain a specific erratum. In this case, the warning can be emitted very
frequently when CPUs are being powered on/off.
This patch modifies this warning print behaviour so that it is emitted only
when LOG_LEVEL >= LOG_LEVEL_VERBOSE. The `debug.h` header file now contains
guard macros so that it can be included in assembly code.
Change-Id: Ic6e7a07f128dcdb8498a5bfdae920a8feeea1345
danh-arm [Wed, 16 Mar 2016 11:02:54 +0000 (11:02 +0000)]
Merge pull request #552 from antonio-nino-diaz-arm/an/cache-dts
Add cache topology info to FVP DTBs
danh-arm [Wed, 16 Mar 2016 11:02:28 +0000 (11:02 +0000)]
Merge pull request #550 from antonio-nino-diaz-arm/an/dead_loops
Remove all non-configurable dead loops
Antonio Nino Diaz [Mon, 1 Feb 2016 13:57:25 +0000 (13:57 +0000)]
Remove all non-configurable dead loops
Added a new platform porting function plat_panic_handler, to allow
platforms to handle unexpected error situations. It must be
implemented in assembly as it may be called before the C environment
is initialized. A default implementation is provided, which simply
spins.
Corrected all dead loops in generic code to call this function
instead. This includes the dead loop that occurs at the end of the
call to panic().
All unnecesary wfis from bl32/tsp/aarch64/tsp_exceptions.S have
been removed.
Change-Id: I67cb85f6112fa8e77bd62f5718efcef4173d8134
danh-arm [Mon, 14 Mar 2016 16:07:12 +0000 (16:07 +0000)]
Merge pull request #547 from ljerry/tf_issue_371
Add "size" function to IO memmap device driver
Gerald Lejeune [Wed, 18 Mar 2015 13:41:42 +0000 (14:41 +0100)]
Add "size" function to IO memmap device driver
Hence memmap device can be used to load an image without being wrapped in a
FIP.
Fixes arm-software/tf-issues#371
Signed-off-by: Gerald Lejeune <gerald.lejeune@st.com>
danh-arm [Fri, 11 Mar 2016 04:45:46 +0000 (04:45 +0000)]
Merge pull request #546 from mtk09422/mtk-bl31-update
Mtk bl31 update
danh-arm [Fri, 11 Mar 2016 04:45:32 +0000 (04:45 +0000)]
Merge pull request #542 from sandrine-bailleux-arm/km/pt-zero
Initialize all translation table entries
danh-arm [Fri, 11 Mar 2016 04:45:19 +0000 (04:45 +0000)]
Merge pull request #538 from sandrine-bailleux-arm/sb/extend-memory-types
Extend memory attributes to map non-cacheable memory
danh-arm [Wed, 9 Mar 2016 08:45:23 +0000 (08:45 +0000)]
Merge pull request #541 from antonio-nino-diaz-arm/an/secondary-cpu-init
Initialize secondary CPUs during cold boot
danh-arm [Wed, 9 Mar 2016 08:44:47 +0000 (08:44 +0000)]
Merge pull request #540 from antonio-nino-diaz-arm/an/porting_guide
Porting guide: Clarify API that don't follow AAPCS
danh-arm [Wed, 9 Mar 2016 08:44:24 +0000 (08:44 +0000)]
Merge pull request #539 from antonio-nino-diaz-arm/an/fix-std-compilation
Compile stdlib C files individually
Jimmy Huang [Mon, 16 Nov 2015 05:44:31 +0000 (13:44 +0800)]
mt8173: support big core PLL control in system suspend flow
This patch adds big core ARMPLL control in system suspend flow.
Change-Id: I27a45dbbb360f17ff0b524a125630358ee2277e2
Signed-off-by: Louis Yu <louis.yu@mediatek.com>
Signed-off-by: Jimmy Huang <jimmy.huang@mediatek.com>
Jimmy Huang [Fri, 4 Mar 2016 16:53:25 +0000 (00:53 +0800)]
mt8173: Remove gpio driver support
We no longer need to control power signal via gpio during system off,
thus remove gpio driver support from platform code.
Change-Id: I6dfec129fa163330951f37b45b71ba5b90355c3b
Signed-off-by: Jimmy Huang <jimmy.huang@mediatek.com>
Jimmy Huang [Fri, 4 Mar 2016 12:18:58 +0000 (20:18 +0800)]
mt8173: Add #error directive to prevent RESET_TO_BL31
MT8173 platform code is incompatible with RESET_TO_BL31, add #error
directive to prevent the case.
We also move mt8173_def.h and plat_private.h to include directory, and
remove some unnecessary code.
Change-Id: I47b8d0a506820a4ea1fbe8c8fb0ec6c68d88feb5
Signed-off-by: Jimmy Huang <jimmy.huang@mediatek.com>
Antonio Nino Diaz [Tue, 23 Feb 2016 12:04:58 +0000 (12:04 +0000)]
Initialize secondary CPUs during cold boot
The previous reset code in BL1 performed the following steps in
order:
1. Warm/Cold boot detection.
If it's a warm boot, jump to warm boot entrypoint.
2. Primary/Secondary CPU detection.
If it's a secondary CPU, jump to plat_secondary_cold_boot_setup(),
which doesn't return.
3. CPU initialisations (cache, TLB...).
4. Memory and C runtime initialization.
For a secondary CPU, steps 3 and 4 are never reached. This shouldn't
be a problem in most cases, since current implementations of
plat_secondary_cold_boot_setup() either panic or power down the
secondary CPUs.
The main concern is the lack of secondary CPU initialization when
bare metal EL3 payloads are used in case they don't take care of this
initialisation themselves.
This patch moves the detection of primary/secondary CPU after step 3
so that the CPU initialisations are performed per-CPU, while the
memory and the C runtime initialisation are only performed on the
primary CPU. The diagrams used in the ARM Trusted Firmware Reset
Design documentation file have been updated to reflect the new boot
flow.
Platforms ports might be affected by this patch depending on the
behaviour of plat_secondary_cold_boot_setup(), as the state of the
platform when entering this function will be different.
Fixes ARM-software/tf-issues#342
Change-Id: Icbf4a0ee2a3e5b856030064472f9fa6696f2eb9e
Antonio Nino Diaz [Mon, 8 Feb 2016 10:39:42 +0000 (10:39 +0000)]
Porting guide: Clarify API that don't follow AAPCS
This patch clarifies a porting API in the Porting Guide that do not
follow the ARM Architecture Program Calling Standards (AAPCS). The
list of registers that are allowed to be clobbered by this API has
been updated in the Porting Guide.
Fixes ARM-software/tf-issues#259
Change-Id: Ibf2adda2e1fb3e9b8f53d8a918d5998356eb8fce
Kristina Martsenko [Thu, 11 Feb 2016 18:11:56 +0000 (18:11 +0000)]
Initialize all translation table entries
The current translation table code maps in a series of regions, zeroing
the unmapped table entries before and in between the mapped regions. It
doesn't, however, zero the unmapped entries after the last mapped
region, leaving those entries at whatever value that memory has
initially.
This is bad because those values can look like valid translation table
entries, pointing to valid physical addresses. The CPU is allowed to do
speculative reads from any such addresses. If the addresses point to
device memory, the results can be unpredictable.
This patch zeroes the translation table entries following the last
mapped region, ensuring all table entries are either valid or zero
(invalid).
In addition, it limits the value of ADDR_SPACE_SIZE to those allowed by
the architecture and supported by the current code (see D4.2.5 in the
Architecture Reference Manual). This simplifies this patch a lot and
ensures existing code doesn't do unexpected things.
Change-Id: Ic28b6c3f89d73ef58fa80319a9466bb2c7131c21
Juan Castillo [Mon, 15 Feb 2016 17:21:10 +0000 (17:21 +0000)]
fip_create: miscellaneous improvements to source code
This patch introduces the following improvements:
* Global variables in fip_create.c declared static.
* Flags to signal the requested actions (do_dump, do_pack) made
global.
* The ToC is printed at the end of the main funcion, after the FIP
has been created/updated, not in the parse_cmdline() function.
* Short format added to the command line options (-d,--dump;
-h,--help).
* Help message updated.
Change-Id: I5f08273c76f1de45fe597e290bee4b60aa404df9