danh-arm [Thu, 19 Jul 2018 14:33:19 +0000 (15:33 +0100)]
Merge pull request #1481 from antonio-nino-diaz-arm/an/xlat-refactor
xlat: More refactoring
danh-arm [Thu, 19 Jul 2018 10:49:56 +0000 (11:49 +0100)]
Merge pull request #1449 from theopolis/hikey-tbb
hikey: Add experimental TBB support
danh-arm [Thu, 19 Jul 2018 10:36:58 +0000 (11:36 +0100)]
Merge pull request #1482 from sandrine-bailleux-arm/sb/fix-hcptr
Misc arch.h fixes and cleanup
Soby Mathew [Wed, 18 Jul 2018 12:35:29 +0000 (13:35 +0100)]
Merge pull request #1471 from Anson-Huang/master
Add i.MX8QX/i.MX8QM power management feature
Sandrine Bailleux [Fri, 13 Jul 2018 08:04:12 +0000 (10:04 +0200)]
Fix HCPTR.TCP11 bit definition
Change-Id: I98f23f6cebcf984b57efc5449b75ff702e1984a0
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Antonio Nino Diaz [Thu, 12 Jul 2018 12:23:59 +0000 (13:23 +0100)]
Fix types of arch.h definitions
Define the values as unsigned int or unsigned long long based on the
actual size of the register. This prevents subtle issues caused by
having a type that is too small. For example:
#define OPTION_ENABLE 0x3
#define OPTION_SHIFT 32
uint64_t mask = OPTION_ENABLE << OPTION_SHIFT;
Because OPTION_ENABLE fits in an int, the value is considered an int.
This means that, after shifting it 32 places to the left, the final
result is 0. The correct way to define the values is:
#define OPTION_ENABLE ULL(0x3)
#define OPTION_SHIFT U(32)
In this case, the compiler is forced to use a 64 bit value from the
start, so shifting it 32 places to the left results in the expected
value.
Change-Id: Ieaf2ffc2d8caa48c622db011f2aef549e713e019
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 11 Jul 2018 15:45:49 +0000 (16:45 +0100)]
Add missing parentheses to macros in arch.h
Change-Id: Ifea46da46d1bfd01b341acfad75df5bcab48a204
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Soby Mathew [Wed, 18 Jul 2018 09:48:03 +0000 (10:48 +0100)]
Merge pull request #1480 from sandrine-bailleux-arm/topics/sb/debug-macros
Always compile debug macros
Soby Mathew [Mon, 16 Jul 2018 13:22:10 +0000 (14:22 +0100)]
Merge pull request #1478 from antonio-nino-diaz-arm/an/rpi3-improvements
rpi3: A few improvements
Antonio Nino Diaz [Thu, 12 Jul 2018 14:54:10 +0000 (15:54 +0100)]
xlat: Remove references to the Trusted Firmware
This library can be used in other projects. All comments that talk about
the Trusted Firmware should be talking about the library itself.
Change-Id: I3b98d42f7132be72c1f8a4900acfaa78dbd2daa2
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 11 Jul 2018 12:07:06 +0000 (13:07 +0100)]
SPM: Use generic MMU setup functions
Instead of having a different initialization routine than the rest of
the codebase, use the common implementation.
Change-Id: I27c03b9905f3cf0af8810aad9e43092005387a1a
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Sun, 15 Jul 2018 15:42:01 +0000 (16:42 +0100)]
xlat v2: Make setup_mmu_config public
This allows other parts of the code to reuse it. No functional changes.
Change-Id: Ib052ae235c422d9179958bd3016c3e678779ae9b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 12 Jul 2018 12:38:53 +0000 (13:38 +0100)]
rpi3: Detect board revision
Implement VideoCore mailbox interface driver and use it to get the board
revision identifier.
For now it is only used to print the model for debug purposes.
This wiki contains the documentation of the mailbox interface:
https://github.com/raspberrypi/firmware/wiki
Change-Id: I11943b99b52cc1409f4a195ebe58eb44ae5b1d6c
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Sat, 14 Jul 2018 01:15:51 +0000 (02:15 +0100)]
rpi3: Implement PSCI_SYSTEM_OFF
This implementation doesn't actually turn the system off, it simply
reboots it and prevents it from booting while keeping it in a low power
mode.
Change-Id: I7f72c9f43f25ba0341db052bc2be4774c88a7ea3
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 12 Jul 2018 07:58:38 +0000 (08:58 +0100)]
rpi3: Concatenate BL1 and FIP automatically
Add a new default makefile target to concatenate BL1 and the FIP and
generate armstub8.bin. This way it isn't needed to do it manually.
Documentation updated to reflect the changes.
Change-Id: Id5b5b1b7b9f87767db63fd01180ddfea855a7207
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Dimitris Papastamos [Fri, 13 Jul 2018 14:23:29 +0000 (15:23 +0100)]
Merge pull request #1477 from dp-arm/dp/css-ap-core
CSS: Add support for SCMI AP core config protocol
Antonio Nino Diaz [Thu, 12 Jul 2018 14:44:42 +0000 (15:44 +0100)]
xlat v2: Turn MMU parameters into 64-bit values
Most registers are 64-bit wide, even in AArch32 mode:
- MAIR_ELx is equivalent to MAIR0 and MAIR1.
- TTBR is 64 bit in both AArch64 and AArch32.
The only difference is the TCR register, which is 32 bit in AArch32 and
in EL3 in AArch64. For consistency with the rest of ELs in AArch64, it
makes sense to also have it as a 64-bit value.
Change-Id: I2274d66a28876702e7085df5f8aad0e7ec139da9
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 12 Jul 2018 14:43:07 +0000 (15:43 +0100)]
xlat v2: Remove IMAGE_EL define
The Exception Level is now detected at runtime. This means that it is not
needed to hardcode the EL used by each image.
This doesn't result in a substantial increase of the image size because
the initialization functions that aren't used are garbage-collected by
the linker.
In AArch32 the current EL has been changed from EL3 to EL1 because the
the AArch32 PL1&0 translation regime behaves more like the AArch64 EL1&0
translation regime than the EL3 one.
Change-Id: I941404299ebe7666ca17619207c923b49a55cb73
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 11 Jul 2018 08:46:45 +0000 (09:46 +0100)]
xlat v2: Remove unused tlbi helper
xlat_arch_tlbi_va_regime() isn't used, so it has been renamed to
xlat_arch_tlbi_va() and the previous implementation has been removed.
Change-Id: Ic118bed3fb68234748d86b2e9e95b25650289276
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 5 Jul 2018 07:11:48 +0000 (08:11 +0100)]
xlat v2: Remove architectural headers
They only contained one function that is easily integrated in the private
library header and the existing architectural C files.
This also helps making the library more portable, as the Makefile of the
library now doesn't use the variable INCLUDES, which is specific to this
codebase and doesn't respect the namespace of the library.
Change-Id: I22228e6a97e9b4f346f5cd8947609263e8df71d8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Sandrine Bailleux [Thu, 21 Jun 2018 09:41:43 +0000 (11:41 +0200)]
Tegra: Fix up INFO() message
With commit
cf24229e6ef4 ("Run compiler on debug macros for type
checking"), the compiler will now always evaluate INFO() macro
calls, no matter the LOG_LEVEL value. Therefore, any variable
referenced in the macro has to be be defined.
Address this issue by removing the local variable and using the
expression it was assigned directly in the INFO() call.
Change-Id: Iedc23b3538c1e162372e85390881e50718e50bf3
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Sandrine Bailleux [Wed, 20 Jun 2018 16:18:56 +0000 (18:18 +0200)]
Fix verbose messages in SDEI code
Fix mismatches between the format specifier and the corresponding
variable type.
Change-Id: Ib9004bd9baa9ba24a50000bea4f2418e1bf7e743
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Sandrine Bailleux [Wed, 20 Jun 2018 12:50:48 +0000 (14:50 +0200)]
Run compiler on debug macros for type checking
Even if the log output is too low for a message to be printed out on
the console by the debug macros, it should still be evaluated by the
compiler to get some type checking and validation of the format
specifiers. To do so, introduce the no_tf_log() macro that encloses
the call to tf_log() in an always-false condition.
This avoids the problem of discovering build issues only when we build
the firmware with the right LOG_LEVEL value.
Change-Id: Ic0fd252ab691d0187fd925756a4837aca1cbfd7b
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Dimitris Papastamos [Thu, 12 Jul 2018 15:53:08 +0000 (16:53 +0100)]
Merge pull request #1432 from Yann-lms/mmc_framework
[RFC] Add MMC framework
Dimitris Papastamos [Thu, 12 Jul 2018 10:53:37 +0000 (11:53 +0100)]
Merge pull request #1476 from grandpaul/paulliu-rpi3-modify-size
rpi3: enlarge SEC_DRAM0_SIZE for optee_test to pass
Dimitris Papastamos [Thu, 12 Jul 2018 10:52:53 +0000 (11:52 +0100)]
Merge pull request #1464 from antonio-nino-diaz-arm/an/rpi3-ints
rpi3: Implement simple interrupt routing
Dimitris Papastamos [Thu, 12 Jul 2018 09:11:28 +0000 (10:11 +0100)]
Merge pull request #1475 from sandrine-bailleux-arm/topics/sb/misra-fvp-opteed
Fix some violations to MISRA rules 8.3, 8.4, 8.5, 8.8
Dimitris Papastamos [Mon, 18 Jun 2018 12:01:06 +0000 (13:01 +0100)]
CSS: Use SCMI AP core protocol to set the warm boot entrypoint
Change-Id: Iaebbeac1a1d6fbd531e5694b95ed068b7a193e62
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Dimitris Papastamos [Tue, 3 Apr 2018 13:58:17 +0000 (14:58 +0100)]
Add support for SCMI AP core configuration protocol v1.0
Change-Id: If07000b6b19011e960336a305a784dd643301b97
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Anson Huang [Thu, 12 Jul 2018 06:43:06 +0000 (14:43 +0800)]
imx: imx8qm: add domain suspend/resume support
Add domain suspend/resume support, Linux kernel
can "echo mem > /sys/power/state" to put system
into suspend mode, all CPUs and cluster will be
powered off and can be waked up if irq pending
in GIC, tested on i.MX8QM MEK board.
Since the power state has been implemented, switch
to use standard power state for CCI operations
instead of private cpu use count in i.MX8QM.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 12 Jul 2018 06:30:52 +0000 (14:30 +0800)]
imx: imx8qm: add domain off support
Add domain off support for Linux kernel's cpu
hot-plug feature, when there are cpu off request
from Linux kernel, TF-A will send command to
system controller to do CPU power gate accordingly,
tested on i.MX8QM MEK board.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 12 Jul 2018 06:27:36 +0000 (14:27 +0800)]
imx: imx8qm: add system reset support
Add system reset support for i.MX8QM,
when Linux kernel issues "reboot" command,
TF-A will send command to inform system
controller to reset whole board according
to board design, tested on i.MX8QM MEK board.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 12 Jul 2018 06:26:07 +0000 (14:26 +0800)]
imx: imx8qm: add system off support
Add system power off support for i.MX8QM,
when Linux kernel issues "poweroff" command,
TF-A will send command to inform system
controller to power off whole board according
to board design, tested on i.MX8QM MEK board.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 12 Jul 2018 06:17:19 +0000 (14:17 +0800)]
imx: imx8qx: add domain suspend/resume support
Add domain suspend/resume support, Linux kernel
can "echo mem > /sys/power/state" to put system
into suspend mode, all CPUs and cluster will be
powered off and can be waked up if irq pending
in GIC, tested on i.MX8QX MEK board.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Ying-Chun Liu (PaulLiu) [Wed, 11 Jul 2018 15:32:59 +0000 (23:32 +0800)]
rpi3: enlarge SEC_DRAM0_SIZE for optee_test to pass
Running optee_test failed because SEC_DRAM0_SIZE is too small. Previous
is 2 MB. We enlarge it to 11 MB for passing the test. Also we reduce
the NS_DRAM0_SIZE from 13MB to 4MB so that the whole section is still
fit in 16MB.
This commit also modified the document to reflect the changes we've
made in code.
Tested-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Anson Huang [Thu, 12 Jul 2018 03:07:10 +0000 (11:07 +0800)]
imx: imx8qx: add domain off support
Add domain off support for Linux kernel's cpu
hot-plug feature, when there are cpu off request
from Linux kernel, TF-A will send command to
system controller to do CPU power gate accordingly.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 12 Jul 2018 03:04:15 +0000 (11:04 +0800)]
imx: imx8qx: add system reset support
Add system reset support for i.MX8QX,
when Linux kernel issues "reboot" command,
TF-A will send command to inform system
controller to reset whole board according
to board design, tested on i.MX8QX MEK board.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 12 Jul 2018 02:52:55 +0000 (10:52 +0800)]
imx: imx8qx: add system off support
Add system power off support for i.MX8QX,
when Linux kernel issues "poweroff" command,
TF-A will send command to inform system
controller to power off whole board according
to board design, tested on i.MX8QX MEK board.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Antonio Nino Diaz [Wed, 11 Jul 2018 20:00:32 +0000 (21:00 +0100)]
rpi3: Implement simple interrupt routing
Implement minimal interrupt routing functions. All interrupts are
treated as non-secure interrupts to be handled by the non-secure world.
Add note to the documentation about disabling FIQs qhen using OP-TEE
with Linux.
Change-Id: I937096542d973925e43ae946c5d0b306d0d95a94
Tested-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Sandrine Bailleux [Wed, 11 Jul 2018 11:59:18 +0000 (13:59 +0200)]
ARM platforms: Make arm_lock static
The ARM_INSTANTIATE_LOCK macro defines a lock meant to be further
manipulated using the arm_lock_init/get/release() macros. It has 2
variants, depending on the BL image it is compiled for. One version
defines the lock variable with internal linkage whereas the other one,
with external linkage.
Code that uses these macros is not compliant with MISRA rule 8.4 because
when using the external linkage version, there is no visible declaration
for the lock variable.
This patch defines the arm_lock variable with internal linkage in both
cases. This fits well the way these macros are used in the code today,
where the lock is not used outside of the translation unit it is
defined in.
Change-Id: I213a74a2a6088a4f1e9a61a319ca7579c2001320
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Sandrine Bailleux [Wed, 11 Jul 2018 12:37:54 +0000 (14:37 +0200)]
ARM platforms: Remove some duplicate declarations
The plat_arm_mmap variable is already declared in plat_arm.h, which is
included from plat/arm/common/arm_common.c.
Similarly, plat_arm.h declares the 'plat_arm_psci_pm_ops' variable, which
does not need to be declared again in plat/arm/common/arm_pm.c.
The duplication was not compliant with MISRA rule 8.5.
Change-Id: Icc42547cc025023226b1078a7ec4f06d093364b7
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Sandrine Bailleux [Wed, 11 Jul 2018 10:44:22 +0000 (12:44 +0200)]
Fix some violations to MISRA rule 8.3
Wherever we use 'struct foo' and 'foo_t' interchangeably in a
function's declaration and definition, use 'struct foo' consistently
for both, as per the TF-A coding guidelines [1].
[1] https://github.com/ARM-software/arm-trusted-firmware/wiki/ARM-Trusted-Firmware-Coding-Guidelines#avoid-anonymous-typedefs-of-structsenums-in-header-files
Change-Id: I7998eb24a26746e87e9b6425529926406745b721
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Dimitris Papastamos [Wed, 11 Jul 2018 13:22:22 +0000 (14:22 +0100)]
Merge pull request #1474 from dp-arm/dp/cpus
Add initial CPU support for Cortex-Deimos and Cortex-Helios
Joel Hutton [Wed, 10 Jan 2018 16:06:07 +0000 (16:06 +0000)]
Add initial CPU support for Cortex-Helios
Change-Id: Ic0486131c493632eadf329f80b0b5904aed5e4ef
Signed-off-by: Joel Hutton <joel.hutton@arm.com>
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Joel Hutton [Fri, 4 May 2018 14:09:47 +0000 (15:09 +0100)]
Add initial CPU support for Cortex-Deimos
Change-Id: I2c4b06423fcd96af9351b88a5e2818059f981f1b
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Dimitris Papastamos [Wed, 11 Jul 2018 12:15:52 +0000 (13:15 +0100)]
Merge pull request #1473 from robertovargas-arm/misra
Misra
Dimitris Papastamos [Wed, 11 Jul 2018 10:13:36 +0000 (11:13 +0100)]
Merge pull request #1460 from robertovargas-arm/clang
Make TF compatible with Clang assembler and linker
Roberto Vargas [Mon, 23 Apr 2018 07:38:12 +0000 (08:38 +0100)]
Update documentation about how to use clang toolchain
Change-Id: Ie65eb779b048940cf32ed5744ff40610b3c5499d
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Thu, 10 May 2018 12:38:19 +0000 (13:38 +0100)]
Use clang as preprocessor when clang toolchain is selected
Change-Id: I562c5de91e12fe384245df41225dfb9122a13a85
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Mon, 16 Apr 2018 10:29:45 +0000 (11:29 +0100)]
Use clang assembler when clang compiler is used
Change-Id: Ib90b767e46360ef07c1f22526e3f3eb5fe366d5d
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Fri, 4 May 2018 09:54:33 +0000 (10:54 +0100)]
Remove integrity check in declare_cpu_ops_base
This check was added to ensure the correct behaviour of fill_constants
macro. This macro has been verified and it is known his correct
behaviour. The check generates an error when the clang assembler is
used, so it is better to remove the check.
Change-Id: I3447ff9e9e5ee5cf0502f65e53c3d105d9396b8b
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Tue, 1 May 2018 08:54:54 +0000 (09:54 +0100)]
Remove .struct directive
This directive is not implemented by clang assembler. The traditional
way to implement structs in assembly is using two macros for every field,
one for the offset, and another one for the size. For every field, the
offset can be calculated using the size and offset of the previous field.
Change-Id: Iacc6781e8f302fb925898737b8e85ab4e88a51cc
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Mon, 30 Apr 2018 16:58:58 +0000 (17:58 +0100)]
Remove string concatenation in assembler files
Clang assembler doesn't support concatenation of adjacent strings.
Change-Id: I092a1e30c137d431c6adcc13519fc2d595f92f14
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Tue, 17 Apr 2018 10:31:43 +0000 (11:31 +0100)]
Add end_vector_entry assembler macro
Check_vector_size checks if the size of the vector fits
in the size reserved for it. This check creates problems in
the Clang assembler. A new macro, end_vector_entry, is added
and check_vector_size is deprecated.
This new macro fills the current exception vector until the next
exception vector. If the size of the current vector is bigger
than 32 instructions then it gives an error.
Change-Id: Ie8545cf1003a1e31656a1018dd6b4c28a4eaf671
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Tue, 17 Apr 2018 10:31:43 +0000 (11:31 +0100)]
Remove .func and .endfunc assembler directives
These directives are only used when stabs debugging information
is used, but we use ELF which uses DWARF debugging information.
Clang assembler doesn't support these directives, and removing
them makes the code more compatible with clang.
Change-Id: I2803f22ebd24c0fe248e04ef1b17de9cec5f89c4
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Fri, 13 Apr 2018 13:26:47 +0000 (14:26 +0100)]
Allow overriding the linker
This patch allows the user to override the value of the LD Makefile
variable. This feature can be used to force the use of the new Clang
linker.
Change-Id: I97ffeb18e48fa75346702a479d7dc1e8abcb3621
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Thu, 10 May 2018 10:01:16 +0000 (11:01 +0100)]
Add .extab and .exidx sections
These sections are required by clang when the code is compiled for
aarch32. These sections are related to the unwind of the stack in
exceptions, but in the way that clang defines and uses them, the
garbage collector cannot get rid of them.
Change-Id: I085efc0cf77eae961d522472f72c4b5bad2237ab
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Wed, 11 Apr 2018 10:53:31 +0000 (11:53 +0100)]
Use ALIGN instead of NEXT in linker scripts
Clang linker doesn't support NEXT. As we are not using the MEMORY command
to define discontinuous memory for the output file in any of the linker
scripts, ALIGN and NEXT are equivalent.
Change-Id: I867ffb9c9a76d4e81c9ca7998280b2edf10efea0
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Mon, 16 Apr 2018 14:43:26 +0000 (15:43 +0100)]
Add documentation about clang version supported
The user guide didn't contain any information about the
requirements of the clang version needed by TF, which is
at least 4.0.
Change-Id: I1ea120aca0fb2c0950fbeaf6978c654ec277afde
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Dimitris Papastamos [Wed, 11 Jul 2018 08:18:38 +0000 (09:18 +0100)]
Merge pull request #1469 from satheesbalya-arm/dtc_doc
Add device-tree-compiler to the list of packages
Sathees Balya [Tue, 10 Jul 2018 13:46:51 +0000 (14:46 +0100)]
Added device-tree-compiler to the list of packages
Change-Id: Ia7800dae52f152b2c3a3b41f1078ab7499d2f4b6
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.4
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 SPD=tspd CSS_USE_SCMI_SDS_DRIVER=1 all
Change-Id: Id732c8df12ef3e20903c41b7ab9a9b55341d68ac
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.3
Rule 8.3: All declarations of an object or function shall
use the same names and type qualifiers.
Fixed for:
make DEBUG=1 PLAT=juno SPD=tspd CSS_USE_SCMI_SDS_DRIVER=1 all
Change-Id: Id9dcc6238b39fac6046abc28141e3ef5e7aa998d
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.4
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 ARCH=aarch32 AARCH32_SP=sp_min RESET_TO_SP_MIN=1 JUNO_AARCH32_EL3_RUNTIME=1 bl32
Change-Id: I3ac25096b55774689112ae37bdf1222f9a9ecffb
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Roberto Vargas [Mon, 12 Feb 2018 12:36:17 +0000 (12:36 +0000)]
Fix MISRA rule 8.3
Rule 8.3: All declarations of an object or function shall
use the same names and type qualifiers.
Fixed for:
make DEBUG=1 PLAT=juno ARCH=aarch32 AARCH32_SP=sp_min RESET_TO_SP_MIN=1 JUNO_AARCH32_EL3_RUNTIME=1 bl32
Change-Id: Ia34f5155e1cdb67161191f69e8d1248cbaa39e1a
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Dimitris Papastamos [Mon, 9 Jul 2018 12:14:42 +0000 (13:14 +0100)]
Merge pull request #1468 from grandpaul/paulliu-fix-cert-create-ftbfs
tools/cert_create: fix makefile to build build_msg.o by HOSTCC
Ying-Chun Liu (PaulLiu) [Fri, 6 Jul 2018 15:20:08 +0000 (23:20 +0800)]
tools/cert_create: fix makefile to build build_msg.o by HOSTCC
Previously build_msg.o is built by CC. It causes FTBFS when CC
is not equal to HOSTCC.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Dimitris Papastamos [Fri, 6 Jul 2018 12:03:57 +0000 (13:03 +0100)]
Merge pull request #1463 from grandpaul/paulliu-rpi3-tbb0
rpi3: Add support for Trusted Board Boot
Teddy Reed [Sat, 23 Jun 2018 02:23:36 +0000 (22:23 -0400)]
hikey: Add development TBB support
This patch adds experimental support for TRUSTED_BOARD_BOOT to the
Hikey. This is adapted from the RPi3 and QEMU implementations.
Since the Hikey starts from BL2 the TRUSTED_BOARD_BOOT ROT begins there
too. When TRUSTED_BOARD_BOOT is defined, the BL1 build is skipped.
See the following example:
make \
PLAT=hikey \
BL33=u-boot.bin \
SCP_BL2=mcuimage.bin \
TRUSTED_BOARD_BOOT=1 \
MBEDTLS_DIR=../../mbedtls \
GENERATE_COT=1 \
all fip
Signed-off-by: Teddy Reed <teddy.reed@gmail.com>
Dimitris Papastamos [Thu, 5 Jul 2018 14:34:19 +0000 (15:34 +0100)]
Merge pull request #1465 from Andre-ARM/allwinner/h6-support
allwinner: Add H6 SoC support
Ying-Chun Liu (PaulLiu) [Thu, 5 Jul 2018 06:55:21 +0000 (14:55 +0800)]
docs: rpi3: add description for Trusted Board Boot
Add paragraph for how to enable Trusted Board Boot for rpi3
Tested-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Ying-Chun Liu (PaulLiu) [Tue, 3 Jul 2018 18:32:27 +0000 (02:32 +0800)]
docs: rpi3: fix the size of BL1
For Trusted Board Boot we enlarge the BL1 size from 64k to 128k.
Tested-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Ying-Chun Liu (PaulLiu) [Tue, 3 Jul 2018 18:26:48 +0000 (02:26 +0800)]
rpi3: Add support for Trusted Board Boot
This patch adds support for TBB to rpi3. The ROTPK is generated at build
time and is included into BL1/BL2. The key and content certificates are
read over semihosting.
Tested-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Dimitris Papastamos [Wed, 4 Jul 2018 14:09:49 +0000 (15:09 +0100)]
Merge pull request #1461 from antonio-nino-diaz-arm/an/xlat-docs
xlat v2: Update documentation
Dimitris Papastamos [Wed, 4 Jul 2018 10:46:51 +0000 (11:46 +0100)]
Merge pull request #1396 from ruchi393/multiple_fip
Extend FIP io driver to support multiple FIP devices
Andre Przywara [Wed, 4 Jul 2018 10:36:31 +0000 (11:36 +0100)]
maintainers: allwinner: add missing link to github page
A proper link to Samuel's github page was missing. Add this to make
the link actually work.
Change-Id: I68b116935bf045df60b2e9309b5fd58a1c694d47
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Dimitris Papastamos [Wed, 4 Jul 2018 09:34:54 +0000 (10:34 +0100)]
Merge pull request #1462 from sandrine-bailleux-arm/topics/sb/no-unaligned-access
Fixes related to unaligned accesses
Yann Gautier [Tue, 3 Jul 2018 16:32:12 +0000 (18:32 +0200)]
Add MMC framework
This change is largely based on existing eMMC framework by Haojian Zhuang
(@hzhuang1).
The MMC framework supports both eMMC and SD card devices. It was
written as a new framework since breaking few eMMC framework APIs.
At card probe and after the reset to idle command (CMD0), a Send
Interface Condition Command is sent (CMD8) to distinguish between
eMMC and SD card devices. eMMC devices go through the same
sequence as in the former eMMC framework. Else the framework
uses commands dedicated to SD-cards for init or frequency switch.
A structure is created to share info with the driver. It stores:
- the MMC type (eMMC, SD or SD HC)
- the device size
- the max frequency supported by the device
- the block size: 512 for eMMC and SD-HC and read from CSD
structure for older SD-cards
Restriction to align buffers on block size has been removed.
Cache maintenance was removed and is expected to be done in the platform
or device driver.
The MMC framework includes some MISRA compliance coding style
maybe not yet ported in the existing eMMC framework.
Fixes ARM-software/tf-issues#597
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Andre Przywara [Fri, 8 Dec 2017 01:27:02 +0000 (01:27 +0000)]
allwinner: Add Allwinner H6 SoC support
The H6 is Allwinner's most recent SoC. It shares most peripherals with the
other ARMv8 Allwinner SoCs (A64/H5), but has a completely different memory
map.
Introduce a separate platform target, which includes a different header
file to cater for the address differences. Also add the new build target
to the documentation.
The new ATF platform name is "sun50i_h6".
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Sandrine Bailleux [Mon, 2 Jul 2018 11:01:16 +0000 (13:01 +0200)]
Fix incorrect pointer conversion in SMC_UUID_RET()
Casting a pointer to a struct uuid into a pointer to uint32_t may
result in a pointer that is not correctly aligned, which constitutes
an undefined behaviour. In the case of TF, this also generates a data
abort because alignment fault checking is enabled (through the SCTLR.A
bit).
This patch modifies the SMC_UUID_RET() macro to read the uuid
structure without any pointer aliasing. A helper function then
combines every set of 4 bytes into a 32-bit value suitable to be
returned through the x0-x3 registers.
This fixes a violation of MISRA rule 11.3.
Change-Id: I53ee73bb4cb332f4d8286055ceceb6f347caa080
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Sandrine Bailleux [Tue, 3 Jul 2018 07:14:45 +0000 (09:14 +0200)]
AArch32: Force compiler to align memory accesses
Alignment fault checking is always enabled in TF (by setting the
SCTLR.A bit). Thus, all instructions that load or store one or more
registers have an alignment check that the address being accessed is
aligned to the size of the data element(s) being accessed. If this
check fails it causes an Alignment fault, which is taken as a Data
Abort exception.
The compiler needs to be aware that it must not emit load and store
instructions resulting in unaligned accesses. It already is for
AArch64 builds (see commit
fa1d37122c "Add -mstrict-align to the gcc
options"), this patch does the same for AArch32 builds.
Change-Id: Ic885796bc6ed0ff392aae2d49f3a13f517e0169f
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Antonio Nino Diaz [Tue, 3 Jul 2018 13:56:31 +0000 (14:56 +0100)]
xlat v2: Update documentation
Update documentation to reflect the current state of the library.
Change-Id: Ic72f90ee322d2ebd6ea7f4296315700d6bc434e6
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Dimitris Papastamos [Tue, 3 Jul 2018 13:38:01 +0000 (14:38 +0100)]
Merge pull request #1459 from antonio-nino-diaz-arm/an/xlat-refactor
Refactor of the xlat tables v2 library
Dimitris Papastamos [Tue, 3 Jul 2018 13:36:55 +0000 (14:36 +0100)]
Merge pull request #1458 from Andre-ARM/allwinner/fixes
allwinner: various smaller fixes
Dimitris Papastamos [Tue, 3 Jul 2018 13:36:46 +0000 (14:36 +0100)]
Merge pull request #1447 from Amit-Radur/bl32_v1
allwinner: Add BL32 (corresponds to Trusted OS) support
Antonio Nino Diaz [Mon, 2 Jul 2018 08:26:51 +0000 (09:26 +0100)]
xlat v2: Make get/set attrs functions less verbose
It is useful to have LOG_LEVEL_VERBOSE because it prints the memory map
of each image, but that also means that the change_mem_attributes and
get_mem_attributes functions have verbose prints, and generate a too
long text output that hides other useful information.
As they were mostly there for debug purposes, this patch removes them.
Change-Id: I2986537377d1f78be2b79cc8a6cf230c380bdb55
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 27 Jun 2018 13:59:22 +0000 (14:59 +0100)]
xlat v2: Clean debug xlat tables descriptor print
The previous debug output for EL1&0 translation regimes was too verbose,
which makes it hard to read and hides the intent behind the parameters
assigned to each region. This patch simplifies this output and makes the
outputs for EL3 and EL1&0 mostly the same. The difference is that in
EL1&0 it is specified whether the region is exclusively accessible from
EL1 (PRIV) or both EL0 and EL1 (USER).
For example:
MEM-RW(PRIV)-NOACCESS(USER)-XN(PRIV)-XN(USER)-S
MEM-RO(PRIV)-NOACCESS(USER)-EXEC(PRIV)-EXEC(USER)-S
After the change, it becomes this:
MEM-RW-XN-PRIV-S
MEM-RO-EXEC-PRIV-S
Change-Id: I15f4b99058429d42107fbf89e15f4838a9b559a5
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 3 Jul 2018 10:58:49 +0000 (11:58 +0100)]
xlat v2: Split code into separate files
Instead of having one big file with all the code, it's better to have
a few smaller files that are more manageable:
- xlat_tables_core.c: Code related to the core functionality of the
library (map and unmap regions, initialize xlat context).
- xlat_tables_context.c: Instantiation of the active image context
as well as APIs to manipulate it.
- xlat_tables_utils.c: Helper code that isn't part of the core
functionality (change attributes, debug print messages).
Change-Id: I3ea956fc1afd7473c0bb5e7c6aab3b2e5d88c711
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Dimitris Papastamos [Mon, 2 Jul 2018 10:39:22 +0000 (11:39 +0100)]
Merge pull request #1456 from robertovargas-arm/make_cert
make_cert: return error when invalid options are used
Dimitris Papastamos [Mon, 2 Jul 2018 10:39:06 +0000 (11:39 +0100)]
Merge pull request #1452 from glneo/fixups-for-k3
Couple of fixups for K3 platform
Ruchika Gupta [Wed, 27 Jun 2018 06:48:22 +0000 (12:18 +0530)]
Extend FIP io driver to support multiple FIP devices
Platform can define MAX_NUM_FIP_DEVICES in platform_def.h
to define the number of FIP io devices.
The FIP driver doesn't support muliple open file.
So only one single file can be open at a time across
multiple FIP devices.
For any FIP device, an image should be loaded
fully before moving on to the next image.
Signed-off-by: Ruchika Gupta <ruchika.gupta@nxp.com>
Andrew F. Davis [Mon, 25 Jun 2018 17:36:25 +0000 (12:36 -0500)]
ti: k3: common: Enable interrupts before entering standby state
To wake a core from wfi interrupts must be enabled, in some cases they
may not be and so we can lock up here. Unconditionally enable interrupts
before wfi and then restore interrupt state.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Andrew F. Davis [Mon, 25 Jun 2018 17:10:53 +0000 (12:10 -0500)]
ti: k3: common: Add root domain node to platform topology
Actions may need to be taken by the last core when all clusters
have been shutdown. Add a top level root domain node to coordinate
this between clusters.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Andre Przywara [Thu, 28 Jun 2018 22:49:39 +0000 (23:49 +0100)]
allwinner: Add Samuel as second maintainer
As Samuel contributed most of the original code and he has an interest
in that, add him as a second maintainer for the Allwinner port.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 21 Jun 2018 23:47:08 +0000 (00:47 +0100)]
allwinner: Detect and output current SoC
So far we already support booting on two different SoCs, and we will
shortly add a third, so add some code to determine the current SoC type.
This can be later used to runtime detect certain properties.
Also print the SoC name to the console, to give valuable debug information.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 21 Jun 2018 23:53:44 +0000 (00:53 +0100)]
allwinner: Don't map boot ROM
There is nothing we need from the BootROM area, so we also don't need
to map it in EL3.
Remove the mapping and reduce the number of MMAP regions by one.
Reported-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 21 Jun 2018 23:48:15 +0000 (00:48 +0100)]
allwinner: Relax PSCI entry point check
The DRAM controller supports up to 4GB of DRAM, and there are actually
boards out there where we can use at least 3GB of this.
Relax the PSCI entry point check, to be not restricted to 2GB of DRAM.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 21 Jun 2018 23:28:31 +0000 (00:28 +0100)]
allwinner: security: Fix SPC guard
The "#ifdef SUNXI_SPC_BASE" guard was meant to allow the build on SoCs
without a Secure Peripherals Controller, so that we skip that part of
the security setup. But in the current position this will trigger a
warning about an unused variable.
Simply move the guard one line up to cover the variable as well.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Fri, 22 Jun 2018 00:33:34 +0000 (01:33 +0100)]
allwinner: cpu-ops: avoid PSCI on/off output
The "INFO" output in sunxi_cpu_ops.c is quite verbose, so make this more
obvious by changing the log level to "VERBOSE" and so avoiding it to
be printed in a normal (even debug) build.
Reported-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 21 Jun 2018 23:34:16 +0000 (00:34 +0100)]
allwinner: sun50i_a64: remove unneeded VER_REG offset
The relative VER_REG *offset* is the same across all known SoCs, so we
can define this offset near it's user.
Remove it from the memory map.
Reported-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>