summaryrefslogtreecommitdiff
path: root/plat/arm
AgeCommit message (Collapse)Author
2018-06-21Merge pull request #1397 from dp-arm/dp/cortex-a76Dimitris Papastamos
Add support for Cortex-A76 and Cortex-Ares
2018-03-15FVP AArch32: Fix flash access in BL32 for mem_protectJoel Hutton
The FVP platform port for SP_MIN (BL32) didn't map the flash memory in BL32 for stroring the mem_protect enable state information leading to synchronous exception. The patch fixes it by adding the region to the BL32 mmap tables. Change-Id: I37eec83c3e1ea43d1b5504d3683eebc32a57eadf Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2018-03-08Juno: Change the Firmware update detect mechanismSoby Mathew
Previously, Juno used to depend on the SSC_GPRETN register to inform about the reset syndrome. This method was removed when SCP migrated to the SDS framework. But even the SDS framework doesn't report the reset syndrome correctly and hence Juno failed to enter Firmware update mode if BL2 authentication failed. In addition to that, the error code populated in V2M_SYS_NVFLAGS register does not seem to be retained any more on Juno across resets. This could be down to the motherboard firmware not doing the necessary to preserve the value. Hence this patch modifies the Juno platform to use the same mechanism to trigger firmware update as FVP which is to corrupt the FIP TOC on authentication failure. The implementation in `fvp_err.c` is made common for ARM platforms and is moved to the new `arm_err.c` file in plat/arm/common folder. The BL1 and BL2 mmap table entries for Juno are modified to allow write to the Flash memory address. Change-Id: Ica7d49a3e8a46a90efd4cf340f19fda3b549e945 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-03-07BL2U: Fix ARM platform timer initilizationSoby Mathew
This issue was detected when testing FWU on Juno. The Timer `timer_ops` was not being initialized before being used by the SDS driver on Juno. This patch adds the call to `generic_delay_timer_init()` during bl2u_early_platform_setup(). This is done generically for all ARM platforms because the cost involved is minimal. Change-Id: I349cf0bd1db68406eb2298b65f9c729f792cabdc Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-03-03Merge pull request #1297 from soby-mathew/sm/fix_aarch32_plat_cmndavidcunado-arm
Remove sp_min functions from plat_common.c
2018-03-02Remove sp_min functions from plat_common.cSoby Mathew
This patch removes default platform implementations of sp_min platform APIs from plat/common/aarch32/plat_common.c. The APIs are now implemented in `plat_sp_min_common.c` file within the same folder. The ARM platform layer had a weak definition of sp_min_platform_setup2() which conflicted with the weak definition in the common file. Hence this patch fixes that by introducing a `plat_arm_` version of the API thus allowing individual boards within ARM platforms to override it if they wish to. Fixes ARM-software/tf-issues#559 Change-Id: I11a74ecae8191878ccc7ea03f12bdd5ae88faba5 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-03-02Fix FVP DRAM2 sizeRoberto Vargas
This was correct according to the model specifications , but it seems that FVP doesn't implement it. It is safer to use the size exposed by the DTB which is currently used by Linux. Change-Id: I9aabe3284a50ec2a36ed94966eb7e4ddf37cec3b Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-02-28Merge pull request #1290 from jeenu-arm/dynamiqdavidcunado-arm
DynamIQ on FVP
2018-02-28Merge pull request #1282 from robertovargas-arm/misra-changesdavidcunado-arm
Misra changes
2018-02-28Fix MISRA rule 8.4 Part 2Roberto Vargas
Rule 8.4: A compatible declaration shall be visible when an object or function with external linkage is defined Fixed for: make DEBUG=1 PLAT=juno LOG_LEVEL=50 all Change-Id: Ic8f611da734f356566e8208053296e6c62b54709 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-02-28Fix MISRA rule 8.4 Part 1Roberto Vargas
Rule 8.4: A compatible declaration shall be visible when an object or function with external linkage is defined Fixed for: make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all Change-Id: I7c2ad3f5c015411c202605851240d5347e4cc8c7 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-02-28Fix MISRA rule 8.3 Part 1Roberto Vargas
Rule 8.3: All declarations of an object or function shall use the same names and type qualifiers. Fixed for: make DEBUG=1 PLAT=fvp LOG_LEVEL=50 all Change-Id: I48201c9ef022f6bd42ea8644529afce70f9b3f22 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-02-28FVP: Allow building for DynamIQ systemsJeenu Viswambharan
FVPs that model DynamIQ configuration implements all CPUs in a single cluster. I.e., such models have a single cluster with more than 4 CPUs. This differs from existing default build configuration for FVP where up to 4 CPUs are assumed per cluster. To allow building for DynamIQ configuration, promote the macro FVP_MAX_CPUS_PER_CLUSTER as a build option to have it set from the build command line. The value of the build option defaults to 4. Change-Id: Idc3853bc95f680869b434b011c2dbd733e40c6ce Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-02-28Select SCMI/SDS drivers by default on JunoSandrine Bailleux
The SCP binaries provided in the 17.10 Linaro release (and onwards) have migrated to the SCMI/SDS protocols. Therefore, the ARM TF should now use the corresponding drivers by default. This patch changes the default value of the CSS_USE_SCMI_SDS_DRIVER build option to 1 for Juno. Change-Id: Idb7e3c6af582f49e332167a2158703c2d781b437 Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2018-02-28Merge pull request #1287 from davidcunado-arm/dc/fix_misradavidcunado-arm
Update ULL() macro and instances of ull to comply with MISRA
2018-02-27Merge pull request #1274 from dp-arm/dp/a75davidcunado-arm
AMU fixes for Cortex-A75
2018-02-27Update ULL() macro and instances of ull to comply with MISRADavid Cunado
MISRA C-2012 Rule 7.3 violation: lowercase l shall not be used as literal suffixes. This patch resolves this for the ULL() macro by using ULL suffix instead of the ull suffix. Change-Id: Ia8183c399e74677e676956e8653e82375d0e0a01 Signed-off-by: David Cunado <david.cunado@arm.com>
2018-02-27FVP: restrict dynamic config to Unix build environmentSoby Mathew
This patch restricts building the dynamic config DTBs to the Unix build environment as the Device Tree compiler may not be available on other build environments. Change-Id: Ie690e80010a174300e966240fd977b37561156e0 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-27Refactor AMU support for Cortex A75Dimitris Papastamos
This patch also fixes the assumption that the counters are disabled on the resume path. This is incorrect as the AMU counters are enabled early in the CPU reset function before `cpuamu_context_restore()` runs. Change-Id: I38a94eb166a523f00de18e86860434ffccff2131 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2018-02-27Factor out CPU AMU helpersDimitris Papastamos
This patch also fixes `cpuamu_write_cpuamcntenclr_el0()` to use an MSR instruction instead of an MRS instruction. Change-Id: Ia6531f64b5ebc60ba432124eaa8d8eaccba40ed0 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2018-02-26Dynamic cfg: MISRA fixesSoby Mathew
Change-Id: I1d85b76af002b8b672fcaeca94939b7420bc8243 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-26FVP: Add TB_FW_CONFIG and HW_CONFIGSoby Mathew
This patch adds TB_FW_CONFIG for FVP and allows FVP to select the appropriate HW_CONFIG to include in the fip. The HW_CONFIG for FVP is selected via `FVP_HW_CONFIG_DTS` build option. The TB_FW_CONFIG specifies the load address of HW_CONFIG to BL2. Since currently the load address is different between AARCH32 and AARCH64, 2 separate TB_FW_CONFIGs are maintained for the 2 modes. Change-Id: Ide8581e752dfa900087f5895c775073c841c0daf Signed-Off-By: Soby Mathew <soby.mathew@arm.com>
2018-02-26ARM Platforms: Load HW_CONFIG in BL2Soby Mathew
The patch adds the necessary changes to load HW_CONFIG in BL2 for ARM Platforms : 1. The load address of HW_CONFIG is specified via the `hw_config_addr` property in TB_FW_CONFIG is loaded by BL1. The `hw_config_max_size` property defines the maximum size to be expected for the HW_CONFIG. The `arm_dyn_cfg_helpers.c` and corresponding header implements utility functions to parse these DT properties defined. The `arm_dyn_cfg.c` implements wrappers to these helpers to enable them to be invoked from ARM platform layer. 2. `HW_CONFIG` is added to the `bl2_mem_params_descs[]` array which is the list of images to be loaded by BL2. 3. The `libfdt` sources are now included when BL2 is built 4. A new helper `populate_next_bl_params_config()` is introduced in desc_image_load.c to populate the subsequent executable BL images with the `hw_config` and the corresponding `fw_config` if available. The `plat_get_next_bl_params()` API for ARM platforms is modified to invoke this new helper. 5. The implementation of `bl2_early_platform_setup2()` is modified to consider `arg0` as well in addition to `arg1` passed from BL1. 6. Bump up the BL2 size for Juno to accommodate the inclusion of libfdt. Change-Id: I80f1554adec41753e0d179a5237364f04fe13a3f Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-26ARM Platorms: Load TB_FW_CONFIG in BL1Soby Mathew
This patch modifies the bl1_platform_setup() API to load and authenticate TB_FW_CONFIG in BL1. The load address of the same is passed on to BL2 in `arg0` of entrypoint info. The fvp_io_storage.c and arm_io_storage.c also adds entries corresponding to TB_FW_CONFIG. A helper function `arm_load_tb_fw_config()` is added to load and authenticate TB_FW_CONFIG if present. Change-Id: Ie7bce667b3fad2b1a083bbcbc0a773f9f04254b1 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-26ARM Platforms: Migrate to new BL handover interfaceSoby Mathew
This patch migrates the ARM Standard platforms to the new BL handover interface. The arm_blx_early_platform_setup() functions are also modified to take in 4 arguments. The `ARM_BL31_PLAT_PARAM_VAL` value passed to BL31 from BL2 is now in arg3 in preparation of dynamic configuration arguments. Change-Id: I33e8e61325a19e7a7127b1ff203c3b86921bf153 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-22ARM Platforms: Add CASSERT for BL2_BASESoby Mathew
Change-Id: I93e491fde2a991fc39584c2762f33cbea40541e3 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-22ARM Platforms: Don't build BL1 and BL2 if RESET_TO_SP_MIN=1Soby Mathew
Change-Id: Iadb21bb56f2e61d7e6aec9b3b3efd30059521def Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-02-12ARM platforms: Fix console address for flushJeenu Viswambharan
The console core flush API expects the base address in the first register, but ARM helpers currently sets the second register with the base address. This causes an assert failure. This patch fixes that. Change-Id: Ic54c423cd60f2756902ab3cfc77b3de2ac45481e Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-02-01Build: change the first parameter of TOOL_ADD_IMG to lowercaseMasahiro Yamada
In the next commit, I need the image name in lowercase because output files are generally named in lowercase. Unfortunately, TOOL_ADD_IMG takes the first argument in uppercase since we generally use uppercase Make variables. make_helpers/build_macros.mk provides 'uppercase' macro to convert a string into uppercase, but 'lowercase' does not exist. We can implement it if we like, but it would be more straightforward to change the argument of TOOL_ADD_IMG. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-02-01Build: rename FIP_ADD_IMG to TOOL_ADD_IMGMasahiro Yamada
Now FIP_ADD_IMG takes care of both fiptool and cert_create symmetrically. Rename it so that it matches the behavior. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-02-01Build: merge build macros between FIP_ and FWU_FIP_Masahiro Yamada
The build system supports generating two FIP images, fip and fwu_fip. Accordingly, we have similar build macros. FIP_ADD_PAYLOAD <--> FWU_FIP_ADD_PAYLOAD CERT_ADD_CMD_OPT <--> FWU_CERT_ADD_CMD_OPT FIP_ADD_IMG <--> FWU_FIP_ADD_IMG The duplicated code increases the maintenance burden. Also, the build rule of BL2U looks clumsy - we want to call MAKE_BL to compile it from source files, but we want to put it in fwu_fip. We can not do it in a single macro call since the current MAKE_BL does not support fwu_fip. To refactor those in a clean way is to support one more argument to specify the FIP prefix. If it is empty, the images are targeted to fip, whereas if the argument is "FWU_", targeted to fwu_fip. The build macros prefixed with FWU_ go away. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-01-29SPM: Map devices in the 1st GBSandrine Bailleux
This patch maps the devices in the first GB of the system address map on the FVP into the S-EL1&0 translation regime when SPM support is enabled. This grants the Secure Partition access to the devices in this region, for example the memory-mapped Generic Timer device. Change-Id: I3aeea65f859ecbe83efde2acee20c55500c451bc Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2018-01-19Merge pull request #1200 from robertovargas-arm/bl2-el3davidcunado-arm
Add BL2_AT_EL3 build option
2018-01-18bl2-el3: Don't compile BL1 when BL2_AT_EL3 is defined in FVPRoberto Vargas
This patch modifies the makefiles to avoid the definition of BL1_SOURCES and BL2_SOURCES in the tbbr makefiles, and it lets to the platform makefiles to define them if they actually need these images. In the case of BL2_AT_EL3 BL1 will not be needed usually because the Boot ROM will jump directly to BL2. Change-Id: Ib6845a260633a22a646088629bcd7387fe35dcf9 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-01-18bl2-el3: Add BL2 at EL3 support in FVPRoberto Vargas
This patch add supports for the new API added for BL2 at EL3 for FVP. We don't have a non-TF Boot ROM for FVP, but this option can be tested setting specific parameters in the model. The bl2 image is loaded directly in memory instead of being loaded by a non-TF Boot ROM and the reset address is changed: --data cluster0.cpu0=bl2.bin@0x4001000 -C cluster0.cpu0.RVBAR=0x4001000 These parameters mean that in the cold boot path the processor will jump to BL2 again. For this reason, BL2 is loaded in dram in this case, to avoid other images reclaiming BL2 memory. Change-Id: Ieb2ff8535a9e67ccebcd8c2212cad366e7776422 Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-01-11Add hooks to save/restore AMU context for Cortex A75Dimitris Papastamos
Change-Id: I504d3f65ca5829bc1f4ebadb764931f8379ee81f Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2018-01-03Move TSP to TZC secured DRAMDimitris Papastamos
To allow BL31 to grow in SRAM, move TSP in TZC secured DRAM by default. Increase the BL31 max limit by one page. Change-Id: Idd3479be02f0f9bafac2f275376d7db0c2015431 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2017-12-19ARM platforms: Allow platforms to define SDEI eventsJeenu Viswambharan
With this patch, ARM platforms are expected to define the macros PLAT_ARM_SDEI_PRIVATE_EVENTS and PLAT_ARM_SDEI_SHARED_EVENTS as a list of private and shared events, respectively. This allows for individual platforms to define their own events. Change-Id: I66851fdcbff83fd9568c2777ade9eb12df284b49 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-12-11Merge pull request #1178 from davidcunado-arm/dc/enable_svedavidcunado-arm
Enable SVE for Non-secure world
2017-12-09Merge pull request #1184 from antonio-nino-diaz-arm/an/bl31-in-dramdavidcunado-arm
fvp: Disable SYSTEM_SUSPEND when ARM_BL31_IN_DRAM
2017-12-06fvp: Disable SYSTEM_SUSPEND when ARM_BL31_IN_DRAMAntonio Nino Diaz
After returning from SYSTEM_SUSPEND state, BL31 reconfigures the TrustZone Controller during the boot sequence. If BL31 is placed in TZC-secured DRAM, it will try to change the permissions of the memory it is being executed from, causing an exception. The solution is to disable SYSTEM_SUSPEND when the Trusted Firmware has been compiled with ``ARM_BL31_IN_DRAM=1``. Change-Id: I96dc50decaacd469327c6b591d07964726e58db4 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2017-12-06SPM: Remove ARM platforms header from SPM common codeAntonio Nino Diaz
Common code mustn't include ARM platforms headers. Change-Id: Ib6e4f5a77c2d095e6e8c3ad89c89cb1959cd3043 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2017-12-05ARM Platforms: Change the TZC access permissions for EL3 payloadSoby Mathew
This patch allows non-secure bus masters to access TZC region0 as well as the EL3 Payload itself. Change-Id: I7e44f2673a2992920d41503fb4c57bd7fb30747a Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2017-11-30Do not enable SVE on pre-v8.2 platformsDavid Cunado
Pre-v8.2 platforms such as the Juno platform does not have the Scalable Vector Extensions implemented and so the build option ENABLE_SVE is set to zero. This has a minor performance improvement with no functional impact. Change-Id: Ib072735db7a0247406f8b60e325b7e28b1e04ad1 Signed-off-by: David Cunado <david.cunado@arm.com>
2017-11-29Juno AArch32: Remove duplicate definition of bl2 platform APISoby Mathew
The bl2_early_platform_setup() and bl2_platform_setup() were redefined for Juno AArch32 eventhough CSS platform layer had same definition for them. The CSS definitions definitions were previously restricted to EL3_PAYLOAD_BASE builds and this is now modified to include the Juno AArch32 builds as well thus allowing us to remove the duplicate definitions in Juno platform layer. Change-Id: Ibd1d8c1428cc1d51ac0ba90f19f5208ff3278ab5 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2017-11-29ARM platforms: Fixup AArch32 buildsSoby Mathew
This patch fixes a couple of issues for AArch32 builds on ARM reference platforms : 1. The arm_def.h previously defined the same BL32_BASE value for AArch64 and AArch32 build. Since BL31 is not present in AArch32 mode, this meant that the BL31 memory is empty when built for AArch32. Hence this patch allocates BL32 to the memory region occupied by BL31 for AArch32 builds. As a side-effect of this change, the ARM_TSP_RAM_LOCATION macro cannot be used to control the load address of BL32 in AArch32 mode which was never the intention of the macro anyway. 2. A static assert is added to sp_min linker script to check that the progbits are within the bounds expected when overlaid with other images. 3. Fix specifying `SPD` when building Juno for AArch32 mode. Due to the quirks involved when building Juno for AArch32 mode, the build option SPD needed to specifed. This patch corrects this and also updates the documentation in the user-guide. 4. Exclude BL31 from the build and FIP when building Juno for AArch32 mode. As a result the previous assumption that BL31 must be always present is removed and the certificates for BL31 is only generated if `NEED_BL31` is defined. Change-Id: I1c39bbc0abd2be8fbe9f2dea2e9cb4e3e3e436a8 Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2017-11-29fvp: Enable the Activity Monitor Unit extensions by defaultDimitris Papastamos
Change-Id: I96de88f44c36681ad8a70430af8e01016394bd14 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2017-11-20Refactor Statistical Profiling Extensions implementationDimitris Papastamos
Factor out SPE operations in a separate file. Use the publish subscribe framework to drain the SPE buffers before entering secure world. Additionally, enable SPE before entering normal world. A side effect of this change is that the profiling buffers are now only drained when a transition from normal world to secure world happens. Previously they were drained also on return from secure world, which is unnecessary as SPE is not supported in S-EL1. Change-Id: I17582c689b4b525770dbb6db098b3a0b5777b70a Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2017-11-13ARM platforms: Enable SDEIJeenu Viswambharan
Support SDEI on ARM platforms using frameworks implemented in earlier patches by defining and exporting SDEI events: this patch defines the standard event 0, and a handful of shared and private dynamic events. Change-Id: I9d3d92a92cff646b8cc55eabda78e140deaa24e1 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-11-13ARM platforms: Define exception macrosJeenu Viswambharan
Define number of priority bits, and allocate priority levels for SDEI. Change-Id: Ib6bb6c5c09397f7caef950c4caed5a737b3d4112 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>