Jolly Shah [Wed, 2 Jan 2019 20:55:41 +0000 (12:55 -0800)]
zynqmp: pm: Reimplement clock get state (status) EEMI API
Clock get state EEMI API is reimplemented to use system-level clock
and pll EEMI APIs rather than direct MMIO read/write accesses to clock
and pll control registers.
Since linux is_enabled method for PLLs still uses clock get state API
get the PLL state, in the implementation of pm_clock_getstate() we need
to workaround this by distinguishing two cases: 1) if the given clock ID
corresponds to a PLL output clock ID; or 2) given clock ID is truly an
on-chip clock whose state of the gate should be returned.
For case 1) we'll call pm_api_clock_pll_getstate() implemented in
pm_api_clock.h/c. This function will query the PLL state from PMU using
the system-level PLL get mode EEMI API.
For case 2) we'll call the PMU to query the clock gate state using
system-level clock get status EEMI API.
Functions that appear to be unused after this change is made are removed.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Wed, 2 Jan 2019 20:54:40 +0000 (12:54 -0800)]
zynqmp: pm: Reimplement clock disable EEMI API
Clock disable EEMI API is reimplemented to use system-level clock
and pll EEMI APIs rather than direct MMIO read/write accesses to clock
and pll control registers.
Since linux still uses clock disable API to reset the PLL in the
implementation of pm_clock_disable() we need to workaround this by
distinguishing two cases: 1) if the given clock ID corresponds to a PLL
output clock ID; or 2) given clock ID is truly an on-chip clock that can
be gated.
For case 1) we'll call pm_api_clock_pll_disable() implemented in
pm_api_clock.h/c. This function will reset the PLL using the system-level
PLL set mode EEMI API with the reset mode argument.
For case 2) we'll call the PMU to configure the clock gate. This is done
using system-level clock disable EEMI API.
Functions that appear to be unused after this change is made are removed.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Fri, 4 Jan 2019 19:45:59 +0000 (11:45 -0800)]
zynqmp: pm: Reimplement clock enable EEMI API
Clock enable EEMI API is reimplemented to use system-level clock
and pll EEMI APIs rather than direct MMIO read/write accesses to clock
and pll control registers.
Since linux still uses clock enable API to trigger locking of the PLLs
in the pm_clock_enable() implementation we need to workaround this by
distinguishing two cases: 1) if the given clock ID corresponds to a PLL
output clock ID; or 2) given clock ID is truly an on-chip clock that can
be gated.
For case 1) we'll call pm_api_clock_pll_enable() implemented in
pm_api_clock.h/c. This function checks what is the buffered PLL mode and
calls the system-level PLL set mode EEMI API with the buffered mode value
specified as argument. Long term, if linux driver get fixed to use PLL
EEMI API to control PLLs, this case could be removed from ATF.
For case 2) we'll call the PMU to configure the clock gate. This is done
using system-level clock enable EEMI API.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Wed, 2 Jan 2019 20:49:21 +0000 (12:49 -0800)]
zynqmp: pm: Return the buffered PLL mode through IOCTL PLL get mode API
When linux calls pm_ioctl_get_pll_frac_mode() it doesn't expect the actual
mode to be read from hardware, but the value that it is intending to
program. Therefore, we return the buffered value to linux.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Wed, 2 Jan 2019 20:46:46 +0000 (12:46 -0800)]
zynqmp: pm: Buffer the PLL mode that is set using IOCTL API
When linux calls pm_ioctl_set_pll_frac_mode() it doesn't expect the
fractional mode to be changed in hardware. Furthermore, even before this
patch setting the mode which is done by writing into register takes
no effect until the PLL reset is deasserted, i.e. until linux "enables"
the PLL. To adjust the code to system-level PLL EEMI API and avoid
unnecessary IPIs that would otherwise be issued, we buffer the mode
value set via IOCTL until the PLL mode really needs to be set.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Wed, 2 Jan 2019 20:42:56 +0000 (12:42 -0800)]
zynqmp: pm: Set PLL fractional data using PLL set parameter EEMI API
Fractional data should be set using PLL set parameter EEMI API. This
stands for system-level communication (APU to PMU). Since linux
already uses a specific IOCTL function to do this and we need to
keep it that way, the pll clock ID given by linux has to be mapped
to the pll node ID that is communicated at the system-level (argument
of PLL set parameter API).
With this modification the function pm_api_clk_set_pll_frac_data is
removed from pm_api_clock.c/h because it became unused.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Wed, 2 Jan 2019 20:40:17 +0000 (12:40 -0800)]
zynqmp: pm: Get PLL fractional data using PLL get parameter EEMI API
Fractional data should be get using PLL get parameter EEMI API. This
stands for system-level communication (APU to PMU). Since linux
already uses a specific IOCTL function to do this and we need to
keep it that way, the pll clock ID given by linux has to be mapped
to the pll node ID that is communicated at the system-level (argument
of PLL get parameter API).
With this modification the function pm_api_clk_get_pll_frac_data is
removed from pm_api_clock.c/h because it became unused.
The clock enum is defined as 'enum clock_id'.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Fri, 4 Jan 2019 19:35:48 +0000 (11:35 -0800)]
zynqmp: pm: Implement PLL get mode EEMI API
This API will be used to get the currently configured PLL mode:
reset (bypassed and unlocked), integer or fractional (locked).
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Fri, 4 Jan 2019 19:32:31 +0000 (11:32 -0800)]
zynqmp: pm: Implement PLL set mode EEMI API
This API will be used to set the PLL mode: reset (unlocked), integer
or fractional (locked). If reset mode is set the PM controller will
bypass the target PLL prior to asserting the reset. If integer or
fractional mode is set the PM controller will program and trigger
locking of the PLL. If success status is returned the PLL is locked
and its bypass is deasserted. If fractional mode is set the fractional
divider (data parameter) has to have a non-zero value prior to issuing
pll set fractional mode. The caller need to ensure that the data
parameter is properly set using pll get/set parameter EEMI API.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Fri, 4 Jan 2019 19:28:38 +0000 (11:28 -0800)]
zynqmp: pm: Implement PLL get parameter EEMI API
This API will be used to get a parameter for the PLL. Parameter values
represent the values as defined in the Zynq MPSoC register reference
manual ug1087.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Jolly Shah [Wed, 2 Jan 2019 20:27:00 +0000 (12:27 -0800)]
zynqmp: pm: Implement PLL set parameter EEMI API
This API will be used to set a parameter for the PLL. The parameter
value that is set will have effect once the PLL mode is set to integer
or fractional mode. Parameter values represent the values as defined
in the Zynq MPSoC register reference manual ug1087.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Will Wong <WILLW@xilinx.com>
Signed-off-by: Jolly Shah <jollys@xilinx.com>
Antonio Niño Díaz [Wed, 19 Dec 2018 14:08:23 +0000 (15:08 +0100)]
Merge pull request #1730 from antonio-nino-diaz-arm/an/spdx
Use SPDX identifier in checkpatch config file
Antonio Nino Diaz [Wed, 19 Dec 2018 13:13:33 +0000 (13:13 +0000)]
Use SPDX identifier in checkpatch config file
Change-Id: I4113604ac69ba07bd90d8268be65cae8aa43138e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Wed, 19 Dec 2018 12:43:17 +0000 (13:43 +0100)]
Merge pull request #1725 from Yann-lms/clang_aarch32
clang: 32 bit compilation should include march32-directive
Antonio Niño Díaz [Wed, 19 Dec 2018 09:52:27 +0000 (10:52 +0100)]
Merge pull request #1727 from antonio-nino-diaz-arm/an/gitignore
gitignore: Ignore sptool and doimage binaries
Antonio Niño Díaz [Wed, 19 Dec 2018 09:51:28 +0000 (10:51 +0100)]
Merge pull request #1729 from vwadekar/tegra-native-gicv2
Tegra native gicv2
Varun Wadekar [Fri, 19 Oct 2018 18:42:28 +0000 (11:42 -0700)]
Tegra: support for native GICv2 drivers
This patch converts Tegra platforms to support native
GICv2 drivers. This involves removes Tegra's GIC driver
port platforms to use interrupt_props
Change-Id: I83d8a690ff276dd97928dc60824a4fd36999bb30
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Fri, 19 Oct 2018 18:44:31 +0000 (11:44 -0700)]
Tegra: support to compile native GICv2 drivers
This patch adds a macro to allow platforms to compile native
GICv2 drivers along with Tegra handlers.
Change-Id: I8281796c09dae5704cff2daab831395d65e261b7
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Antonio Nino Diaz [Fri, 14 Dec 2018 10:47:52 +0000 (10:47 +0000)]
gitignore: Ignore sptool and doimage binaries
Change-Id: I119b85179f68148e128cc194f11d2cccb1e33d6d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Tue, 18 Dec 2018 14:24:52 +0000 (15:24 +0100)]
Merge pull request #1721 from marex/arm/master/memsize-passing-v2
plat: rcar: Move FDT from x3 to x1
Antonio Niño Díaz [Tue, 18 Dec 2018 14:22:49 +0000 (15:22 +0100)]
Merge pull request #1717 from satheesbalya-arm/sb1/sb1_2629_romlib_ifc
romlib: Add platform specific jump table list
Sathees Balya [Wed, 31 Oct 2018 14:05:08 +0000 (14:05 +0000)]
romlib: Add platform specific jump table list
This patch allows platforms to define their
own jump table list for library at ROM. The
file has the list of functions to be used
from library at ROM. It can also include
other list files.
Change-Id: I721c35d7dad3dcadbb3a7f3277bfd5d3e1f6e00a
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
Antonio Niño Díaz [Tue, 18 Dec 2018 12:50:38 +0000 (13:50 +0100)]
Merge pull request #1722 from antonio-nino-diaz-arm/an/arch
Synchronize architectural headers with TF-A-Tests
Antonio Nino Diaz [Fri, 23 Nov 2018 15:04:01 +0000 (15:04 +0000)]
Import exception helpers from TF-A-Tests
This is done in order to keep the files in both repositories in sync.
Change-Id: Ie1a9f321cbcfe8d7d14f206883fa718872271218
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 23 Nov 2018 13:54:41 +0000 (13:54 +0000)]
Deprecate some unused AArch64 assembly functions
Change-Id: I8a0be21783a0c12325e6ab22e9e53ab5466ed9e0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 23 Nov 2018 13:54:00 +0000 (13:54 +0000)]
Move helpers from arch.h to arch_helpers.h
Some of the affected macros can only be used from C code. In general, we
use arch_helpers.h for any C helpers to access registers. For
consistency, the other macros have been moved as well.
Also, import some AArch32 helpers from TF-A-Tests.
Change-Id: Ie8fe1ddeadba5336c12971ddc39a7883121386b1
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Tue, 18 Dec 2018 10:55:45 +0000 (11:55 +0100)]
Merge pull request #1718 from vwadekar/cc-variable-findstring
build: find "armclang" string in the 'CC' variable
Antonio Niño Díaz [Tue, 18 Dec 2018 10:55:11 +0000 (11:55 +0100)]
Merge pull request #1719 from Yann-lms/useless_flags
stm32mp1: remove useless compilation flags
Yann Gautier [Tue, 18 Dec 2018 09:46:34 +0000 (10:46 +0100)]
clang: 32 bit compilation should include march32-directive
This is done for other compilers, and without this some code does not
compile, like inline assembly code.
Fixes ARM-software/tf-issues#657.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Antonio Niño Díaz [Tue, 18 Dec 2018 09:05:22 +0000 (10:05 +0100)]
Merge pull request #1720 from jeenu-arm/gic-priority
GIC: Remove lowest priority constants
Antonio Niño Díaz [Tue, 18 Dec 2018 09:04:57 +0000 (10:04 +0100)]
Merge pull request #1723 from soby-mathew/sm/reset_bl31_fix
FVP: Fixes for RESET_TO_BL31
Soby Mathew [Wed, 12 Dec 2018 14:54:23 +0000 (14:54 +0000)]
docs: User-guide corrections for RESET_TO_BL31
This patch updates the user guide instructions for
RESET_TO_SP_MIN and RESET_TO_BL31 cases. The load
address for BL31 had to be updated because of increase
in code size. Also, information about PIE support when
RESET_TO_BL31=1 for FVP is added.
In the case of RESET_TO_SP_MIN, the RVBAR address
was wrong in the instruction. This is also corrected
in the patch.
Change-Id: I65fe6d28c5cf79bee0a11fbde320d49fcc1aacf5
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Wed, 12 Dec 2018 14:33:11 +0000 (14:33 +0000)]
BL31: correct GOT section omission
When the patch SHA
931f7c6 introduced PIE support for BL31,
adding the GOT section when the SEPARATE_CODE_AND_RODATA=0
to the linker script was erroneously omitted. This patch corrects
the same.
Also the patch reduces the alignment requirement for GOT and RELA
sections from 16 bytes to 8. Comments are added explain the
intent for alignment.
Change-Id: I8035cbf75f346f99bd56b13f32e0b3b70dd2fe6c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Wed, 12 Dec 2018 14:13:52 +0000 (14:13 +0000)]
FVP: Change BL31_BASE when RESET_TO_BL31=1
This patch defines BL31_BASE to 0x0 when RESET_TO_BL31=1 as the
executable is built with PIE support and can be loaded anywhere
in SRAM for execution.
Change-Id: I4007f4626322f1200a6304c9c565987d3357986c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Antonio Niño Díaz [Mon, 17 Dec 2018 10:54:16 +0000 (11:54 +0100)]
Merge pull request #1716 from miyatsu/marvell-doc-fix-
20181210
docs: marvell: Fix typo in file build.txt
Jeenu Viswambharan [Wed, 7 Nov 2018 11:46:36 +0000 (11:46 +0000)]
GIC: Remove lowest priority constants
The GIC lowest priority values for each world depends on the number of
priority values implemented in hardware. These constants currently
defined in gic_common.h only meant to enumerate lowest possible
architectural values. Since these values are not used in generic code or
upstream platforms, and that general use of these constants can be
wrong, remove these. Platforms should either define and use these as
appropriate, or determine correct values at run time.
Change-Id: I3805cea8ceb8a592b9eff681ea1b63b7496cec5f
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Marek Vasut [Thu, 13 Dec 2018 21:08:24 +0000 (22:08 +0100)]
plat: rcar: Move FDT from x3 to x1
As suggested, pass the FDT to BL 33 via x1 instead of x3 , to be
consistent with the other platforms.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Yann Gautier [Thu, 13 Dec 2018 14:01:53 +0000 (15:01 +0100)]
stm32mp1: remove useless compilation flags
On AARCH32, thumb is used by default, no need to redefine it.
As all our binaries are compiled with thumb, interwork is not needed.
The binaries compiled with or without those flags are the same,
except of course for the date.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Varun Wadekar [Wed, 12 Dec 2018 23:22:27 +0000 (15:22 -0800)]
build: find "armclang" string in the 'CC' variable
This patch modifies the search criteria to see if we are using 'armclang'
as the compiler. Switch over to using 'findstring' which enables platforms
to do fancy stuff using scripts e.g. check if armclang timed out and retry
compilation.
Change-Id: If2162ebadb9033f6457a4e8d4243345e711defe6
Signed-off-by: Kalyani Chidambaram Vaidyanathan <kalyanic@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Soby Mathew [Wed, 12 Dec 2018 15:54:47 +0000 (15:54 +0000)]
Merge pull request #1708 from Yann-lms/warnings
Add possibility to add compilation warnings
Soby Mathew [Wed, 12 Dec 2018 15:54:09 +0000 (15:54 +0000)]
Merge pull request #1715 from pangupta/master
ccn: for RN-I, used node id instead of node postion
Soby Mathew [Wed, 12 Dec 2018 09:43:49 +0000 (09:43 +0000)]
Merge pull request #1712 from jeenu-arm/ssbs
AArch64: Use SSBS for CVE_2018_3639 mitigation
Pankaj Gupta [Fri, 7 Dec 2018 07:35:36 +0000 (13:05 +0530)]
ccn: for RN-I, used node id instead of node postion
For RN-I, node id is used instead of node postion in the bitmap
to calculate the region id.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Antonio Niño Díaz [Tue, 11 Dec 2018 16:48:17 +0000 (17:48 +0100)]
Merge pull request #1707 from antonio-nino-diaz-arm/an/spm
SPM: Initial prototype based on SPCI and SPRT
Antonio Nino Diaz [Thu, 15 Nov 2018 08:57:18 +0000 (08:57 +0000)]
SPM: Rename files for consistency
Rename files prefixed by sp_ to spm_.
Change-Id: Ie3016a4c4ac5987fe6fdd734c6b470c60954e23d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 30 Nov 2018 10:53:26 +0000 (10:53 +0000)]
SPM: Remove remaining SMC interfaces
Also, add a disclaimer to explain that the current implementation of SPM
is a prototype that is going to undergo a lot of rework.
Change-Id: I303c1e61c51d9f286cc599fea565fc9ba5a996bf
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 30 Nov 2018 10:52:09 +0000 (10:52 +0000)]
SPM: Migrate mem attr get/set helpers to SPRT
The old SMCs SP_MEMORY_ATTRIBUTES_{GET,SET}_AARCH64 have been removed in
favour of SPRT_MEMORY_PERM_ATTR_{GET,SET}_AARCH64.
Change-Id: Idb93cfa5461d0098df941037c5653f7c44b65227
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 3 Jul 2018 15:54:33 +0000 (16:54 +0100)]
SPM: Allow preemption in non-blocking requests
Change-Id: I1fdc2285a3f6517a715ad6159322543fd5a37a37
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 8 Nov 2018 14:22:51 +0000 (14:22 +0000)]
SPM: Support non-blocking calls
Note that the arguments passed during the SMC call don't comply with the
SPCI specifications. This will be fixed in following patches, but it is
needed to implement a few more SPCI SMCs to be able to do it. The
current code allows us to start testing it.
Change-Id: Ic13dcc54c40327df03be1b0f52e8a44f468f06b4
Co-authored-by: Jean-Paul Etienne <jean-paul.etienne@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 18 Oct 2018 13:54:57 +0000 (14:54 +0100)]
SPM: Implement global response buffer helpers
This buffer is where all the responses from Secure Partitions are stored
until they are requested.
Change-Id: Iafeb8f0848c5ff6f3e187060cd3a47702484dc45
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 3 Jul 2018 18:54:59 +0000 (19:54 +0100)]
SPM: Prevent simultaneous blocking calls
Blocking calls can only succeed if the target Secure Partition is idle.
Change-Id: Iabeaa0b8d3e653fd8581fa086758936abfc1c772
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 8 Nov 2018 14:21:19 +0000 (14:21 +0000)]
SPM: Support blocking calls
Note that the arguments passed during the SMC call don't comply with the
SPCI specifications. This will be fixed in following patches, but it is
needed to implement a few more SPCI SMCs to be able to do it. The
current code allows us to start testing it.
Change-Id: Ief0e75d072b311737fcdb0c6a60ba5b7406a9ee5
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 8 Nov 2018 09:21:48 +0000 (09:21 +0000)]
SPM: Introduce SPRT C host library
Change-Id: If57ec9cc0791f49d9ade83dff9d24ef9047963a8
Co-authored-by: Jean-Paul Etienne <jean-paul.etienne@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 8 Nov 2018 14:20:07 +0000 (14:20 +0000)]
SPM: Implement SPCI open/close handle SMCs
Introduce SMCs that open and close handles according to the SPCI
specification.
Change-Id: I65f365f15612e01aa445e783e96e48ae275c39fd
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 8 Nov 2018 14:12:40 +0000 (14:12 +0000)]
SPM: Introduce SMC handlers for SPCI and SPRT
Change-Id: I2ae9b3bb686c41b2e138132a7bed107925ac861e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 11:36:47 +0000 (11:36 +0000)]
SPM: Support multiple xlat tables contexts
Change-Id: Ib7c2529b85bb5930d44907edfc8ead13d3b1ef4d
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 11:35:30 +0000 (11:35 +0000)]
SPM: Support multiple partitions
Change-Id: I6673a5f8c2f6afa7780483e0ce8d4dad4c8dc8ea
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 12:50:41 +0000 (12:50 +0000)]
SPM: Remove old SMC interfaces
Remove interfaces based on MM_COMMUNICATE.
Change-Id: I628c884b91d9f4758269ea2c4dedc37a66bb93cf
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 11:34:23 +0000 (11:34 +0000)]
SPM: Map memory regions from RD
SPM needs to map a number of regions on behalf of the secure partition.
Previously, it used to get a list of them from platform code using the
plat_get_secure_partition_mmap() API. Now it gets them from the resource
description structure.
The SPM<->SP shared buffer is mapped dynamically at EL3. This buffer is
used to pass information between SPM and SP, so it must be mapped at EL3
as well in order to be used by SPM.
Dynamic translation tables have been enabled when the Trusted Firmware
is compiled with SPM support.
Change-Id: I64ad335e931661812a0a60558e60372e1e5e6b72
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 26 Jun 2018 09:34:25 +0000 (10:34 +0100)]
SPM: Read entrypoint from resource descriptor
Read entrypoint of the Secure Partition from the resource description
struct.
Change-Id: Ie693c7b4d4fecafd85b6934d9d8c4232efb1dc55
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 27 Nov 2018 08:36:02 +0000 (08:36 +0000)]
SPM: Load image and RD from SP package
Load SP and RD from package instead of relying on RD being already
loaded in memory and the SP being loaded as a BL32 image.
Change-Id: I18d4fbf4597656c6a7e878e1d7c01a8a324f3f8a
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 27 Nov 2018 14:58:04 +0000 (14:58 +0000)]
SPM: sptool: Introduce tool to package SP and RD
This tool packages Secure Partitions and Resource Descriptor blobs into
a simple file that can be loaded by SPM.
Change-Id: If3800064f30bdc3d7fc6a15ffbb3007ef632bcaa
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Soby Mathew [Tue, 11 Dec 2018 10:53:36 +0000 (10:53 +0000)]
Merge pull request #1714 from chandnich/sgiclark-helios
SGI-Clark.Helios platform support patches
Yann Gautier [Mon, 10 Dec 2018 17:08:53 +0000 (18:08 +0100)]
Makefile: add a possibility to disable -Werror
Setting E=0 in the make command line disables -Werror in CPPFLAGS.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Yann Gautier [Mon, 10 Dec 2018 09:41:03 +0000 (10:41 +0100)]
correct some missing-prototype warnings
This avoids the following warnings:
no previous prototype for 'bl2_arch_setup' [-Wmissing-prototypes]
no previous prototype for 'plat_log_get_prefix' [-Wmissing-prototypes]
Also correct a compilation issue if BL2_IN_XIP_MEM is enabled:
uintptr_t is not defined.
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Yann Gautier [Mon, 3 Dec 2018 12:38:06 +0000 (13:38 +0100)]
io_block: define MAX_IO_BLOCK_DEVICES as unsigned
This is used as a table index, and already compared with an unsigned int:
block_dev_count.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Yann Gautier [Mon, 10 Dec 2018 17:00:26 +0000 (18:00 +0100)]
Add the possibility to compile TF-A with more warnings
The list of warning is taken from kernel and also divided in 3.
The option to activate that is W=x, with x=1, 2 or 3.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 11:54:20 +0000 (11:54 +0000)]
SPM: Remove SP memory mappings definitions
This information is retrieved from the resource description now.
Change-Id: Iaae23945eb2c45305cdc6442853e42f4e04fe094
Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 11:52:45 +0000 (11:52 +0000)]
SPM: Deprecate boot info struct
This information is defined by the Secure Partition in the resource
description.
Change-Id: Ia7db90c5de8360a596106880d3f6a632a88d3ea8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 11:12:42 +0000 (11:12 +0000)]
SPM: Introduce functions to load DTB files
Introduce helpers to create resource description struct, as well as code
to load the information from DTB files.
Change-Id: I0f5bb94eb8b01c6cb53fe807a9db0c05a70d7a43
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 27 Nov 2018 09:36:22 +0000 (09:36 +0000)]
SPM: Define resource description data structures
The structures and associated definitions are in different files so that
the definitions can be used inside DTS files while the structs are
private to SPM. They follow the SPRT specification.
Change-Id: Id6a629040a086c482b9d9fa1883b8aa6bbee619f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 30 Oct 2018 11:08:08 +0000 (11:08 +0000)]
SPM: Deprecate the current implementation
The current SPM is a prototype that only supports one secure partition
in EL0. The objective of SPM is to have multiple partitions. The current
MM interface isn't adequate for this, so it is needed to modify heavily
the code to add proper support for it.
However, there are platforms which are already using this (like SGI) and
removing the code would break it. For this reason, the current SPM code
has been duplicated in order to temporarily preserve compatibility. All
new improvements/changes to SPM will be done in the non-deprecated copy,
that may change without notice.
The new build option SPM_DEPRECATED has been introduced to select the SPM
implementation. It defaults to 1, that selects the deprecated SPM.
Change-Id: Ic9f80b53b450e97b4d3f47e4ef4a138ee8d87443
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 18 Oct 2018 13:02:39 +0000 (14:02 +0100)]
fvp: Increase stack size when SPM is enabled
Change-Id: Iec265dc85d44f35048d1fbcfbe55960d45570027
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Jeenu Viswambharan [Thu, 15 Nov 2018 11:38:03 +0000 (11:38 +0000)]
AArch64: Use SSBS for CVE_2018_3639 mitigation
The Armv8.5 extensions introduces PSTATE.SSBS (Speculation Store Bypass
Safe) bit to mitigate against Variant 4 vulnerabilities. Although an
Armv8.5 feature, this can be implemented by CPUs implementing earlier
version of the architecture.
With this patch, when both PSTATE.SSBS is implemented and
DYNAMIC_WORKAROUND_CVE_2018_3639 is active, querying for
SMCCC_ARCH_WORKAROUND_2 via. SMCCC_ARCH_FEATURES call would return 1 to
indicate that mitigation on the PE is either permanently enabled or not
required.
When SSBS is implemented, SCTLR_EL3.DSSBS is initialized to 0 at reset
of every BL stage. This means that EL3 always executes with mitigation
applied.
For Cortex A76, if the PE implements SSBS, the existing mitigation (by
using a different vector table, and tweaking CPU ACTLR2) is not used.
Change-Id: Ib0386c5714184144d4747951751c2fc6ba4242b6
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Antonio Niño Díaz [Mon, 10 Dec 2018 14:18:23 +0000 (15:18 +0100)]
Merge pull request #1704 from marex/arm/master/memsize-passing-v1
Arm/master/memsize passing v1
Soby Mathew [Mon, 10 Dec 2018 14:00:01 +0000 (14:00 +0000)]
Merge pull request #1700 from jwerner-chromium/JW_crashfix
MULTI_CONSOLE_API fixes and cleanups
Ding Tao [Mon, 10 Dec 2018 09:31:23 +0000 (09:31 +0000)]
docs: marvell: Fix typo in file build.txt
Replace "Uboot" with "Ubuntu".
Signed-off-by: Ding Tao <miyatsu@qq.com>
Julius Werner [Wed, 28 Nov 2018 22:00:33 +0000 (14:00 -0800)]
maintainers: Add Julius Werner for coreboot and console API
I wrote most of this code and have a vested interest in keeping it
healthy, so adding myself as a maintainer.
Change-Id: I0edeebbc8336b6976dfaf393b3cfc7bc94089ac6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Julius Werner [Wed, 28 Nov 2018 06:10:56 +0000 (22:10 -0800)]
drivers/console: Reimplement MUTLI_CONSOLE_API framework in C
Now that we have switched to using the stack in MULTI_CONSOLE_API
framework functions and have factored all code involved in crash
reporting out into a separate file, there's really no reason to keep the
main framework code in assembly anymore. This patch rewrites it in C
which allows us to have a single implementation across aarch32/64 and
should be much easier to maintain going forward.
Change-Id: I6c85a01e89a79e8b233f3f8bee812f0dbd026221
Signed-off-by: Julius Werner <jwerner@chromium.org>
Julius Werner [Wed, 28 Nov 2018 01:50:28 +0000 (17:50 -0800)]
drivers/console: Link console framework code by default
This patch makes the build system link the console framework code by
default, like it already does with other common libraries (e.g. cache
helpers). This should not make a difference in practice since TF is
linked with --gc-sections, so the linker will garbage collect all
functions and data that are not referenced by any other code. Thus, if a
platform doesn't want to include console code for size reasons and
doesn't make any references to console functions, the code will not be
included in the final binary.
To avoid compatibility issues with older platform ports, only make this
change for the MULTI_CONSOLE_API.
Change-Id: I153a9dbe680d57aadb860d1c829759ba701130d3
Signed-off-by: Julius Werner <jwerner@chromium.org>
Julius Werner [Tue, 4 Dec 2018 01:01:30 +0000 (17:01 -0800)]
console: Fix console_unregister() signature
console_unregister() has always returned a pointer to the console that
was removed on success, not just an integer. Fix the C prototype to
match the assembly implementation.
Change-Id: Iafc43de0767a5c87c9ae5c3aba53761dd28d51e6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Julius Werner [Mon, 19 Nov 2018 22:25:55 +0000 (14:25 -0800)]
plat/common/crash_console_helpers.S: Fix MULTI_CONSOLE_API support
Crash reporting via the default consoles registered by MULTI_CONSOLE_API
has been broken since commit
d35cc34 (Console: Use callee-saved
registers), which was introduced to allow console drivers written in C.
It's not really possible with the current crash reporting framework to
support console drivers in C, however we should make sure that the
existing assembly drivers that do support crash reporting continue to
work through the MULTI_CONSOLE_API.
This patch fixes the problem by creating custom console_putc() and
console_flush() implementations for the crash reporting case that do not
use the stack. Platforms that want to use this feature will have to link
plat/common/aarch64/crash_console_helpers.S explicitly.
Also update the documentation to better reflect the new reality (of this
being an option rather than the expected default for most platforms).
Change-Id: Id0c761e5e2fddaf25c277bc7b8ab603946ca73cb
Signed-off-by: Julius Werner <jwerner@chromium.org>
Julius Werner [Tue, 20 Nov 2018 21:02:27 +0000 (13:02 -0800)]
plat/common: Remove duplication of plat_crash_console functions/stubs
Commit
e74afb652 (Deprecate weak crash console functions) deprecated the
default inclusion of weak definitions for plat_crash_console functions
in plat/common/aarch64/platform_helpers.S. The code was later copied out
to plat/common/aarch64/crash_console_helpers.S so platforms can link it
explicitly if they want to. However, since deprecation does not mean
removal, the same code is also still duplicated in platform_helpers.S.
The duplicated code contains both empty stubs for the !MULTI_CONSOLE_API
case, and a real implementation that used to work but was broken by
commit
d35cc34 (Console: Use callee-saved registers) for
MULTI_CONSOLE_API. It's not great to have both of these duplicated in
two files, so this patch splits them up: in platform_helpers.S we'll
only keep the empty stubs (guarded by !ERROR_DEPRECATED), which should
not regress functionality since the MULTI_CONSOLE_API implementation was
already broken anyway. In crash_console_helpers.S, we'll only keep the
MULTI_CONSOLE_API version, which is enough both as an implementation in
itself and as a sample for how to reimplement these functions in a
platform-specific file.
Change-Id: I83d95a90ab6aac597dc2ea2f2797ac2c8ed075d4
Signed-off-by: Julius Werner <jwerner@chromium.org>
Soby Mathew [Thu, 6 Dec 2018 15:07:44 +0000 (15:07 +0000)]
Merge pull request #1713 from chandnich/nt-fw-config
plat/arm/sgi: Use NT_FW_CONFIG instead of HW_CONFIG
Soby Mathew [Thu, 6 Dec 2018 11:13:38 +0000 (11:13 +0000)]
Merge pull request #1710 from soby-mathew/sm/smc_save_x0_x3
BL31: Use helper function to save registers in SMC handler
Antonio Niño Díaz [Thu, 6 Dec 2018 10:29:29 +0000 (11:29 +0100)]
Merge pull request #1709 from joannafarley-arm/jf/copyrights-updates
Change copyright guidelines
Antonio Niño Díaz [Thu, 6 Dec 2018 10:28:53 +0000 (11:28 +0100)]
Merge pull request #1706 from Yann-lms/mmc_init_check
MMC init check and STM32MP1 MMC driver improvements
Chandni Cherukuri [Thu, 16 Aug 2018 08:13:23 +0000 (13:43 +0530)]
plat/arm/sgi: Add board support for SGI-Clark.Helios platform
SGI-Clark.Helios platform is similar to SGI-Clark.Ares platform.
The difference between these two platforms is the CPU type and
the number of CPUs. Add the base support for SGI-Clark.Helios platform.
Change-Id: I2b04cb3fb953907848b4fab016e3648899ca4256
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Chandni Cherukuri [Thu, 22 Nov 2018 04:45:25 +0000 (10:15 +0530)]
plat/arm/sgi: override 'plat_psci_ops_t' for SGI-Clark.Helios platform
For SGI-Clark.Helios platform, at present, only the CPU power ON/OFF
ops are supported. So override the PSCI ops to allow callbacks only
for CPU power ON/OFF operations.
Change-Id: Idc0a3deb78cb850310cbe849d77604fa9881579c
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Chandni Cherukuri [Tue, 16 Oct 2018 08:45:31 +0000 (14:15 +0530)]
plat/arm/sgi: add platform support for SGI-Clark.Helios platform
SGI-Clark.Helios platform is based on multi-threaded CPUs and uses an
additional thread power domain level as well.
Define a power domain tree descriptor 'sgi_clark_helios_pd_tree_desc'
for SGI-Clark.Helios platform and let the function
'plat_get_power_domain_tree_desc' pick up the correct power
domain tree descriptor based on the platform.
Change-Id: Ibc6d551b570bc740053316a3608c455679d9155b
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Marek Vasut [Thu, 11 Oct 2018 14:53:58 +0000 (16:53 +0200)]
plat: rcar: Generate FCNL reserved memory node
Generate a /reserved-memory node for FCNL in the DT passed to
subsequent stages, so they will know how the FCNL is configured.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Thu, 11 Oct 2018 14:15:41 +0000 (16:15 +0200)]
plat: rcar: Generate platform compatible string
Generate /compatible string for the platform, so that the subsequent
stages know which platform they are running on. This could be useful
when ie. building U-Boot that contains DTs for multiple platforms and
can thus decide on which platform it is running. This would ultimately
allow single bootloader binary for all Gen3 platforms.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 2 Oct 2018 18:45:18 +0000 (20:45 +0200)]
plat: rcar: Pass DTB with DRAM layout from BL2 to next stages
Pass DTB containing DRAM layout from BL2 to BL33 via register x3, so
that the BL33 can simply consume it and get accurate DRAM layout info.
BL33 is in most usecases U-Boot.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 2 Oct 2018 18:43:09 +0000 (20:43 +0200)]
plat: rcar: Use array in the DRAM size reporting
Use array of start-size tuples for the DRAM banks and call single
function which iterates over this array to report the DRAM info.
This is in preparation for expanding this to generate FDT for the
next stage.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 2 Oct 2018 13:12:15 +0000 (15:12 +0200)]
plat: rcar: Print DRAM configuration after init
Print the DRAM configuration only after the DRAM was initialized. This
will be useful when deduplicating code populating FDT passed to U-Boot,
since it will contain the same macros as bl2_advertise_dram_size().
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 2 Oct 2018 13:09:04 +0000 (15:09 +0200)]
plat: rcar: Fill in memory information for M3W, M3N
Make the DRAM configuration debug print consistent for all supported SoCs.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 2 Oct 2018 12:53:27 +0000 (14:53 +0200)]
plat: rcar: Drop H3 v3.0 check on DRAM debug print
There is nothing preventing H3 older than v3.0 from printing the
DRAM configuration, just like v3.0 and newer. Drop the check and
let all H3 revisions print DRAM configuration in BL2.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 2 Oct 2018 11:51:19 +0000 (13:51 +0200)]
plat: rcar: Add E3 1GBx4 debug print
RCAR_DRAM_DDR3L_MEMCONF = 2 means E3 with 1GBx4 memory configuration.
Add debug print for this configuration for completeness sake.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 2 Oct 2018 11:33:32 +0000 (13:33 +0200)]
plat: rcar: Move DRAM layout print to separate function
Just move the DRAM layout information into separate function,
no functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Chandni Cherukuri [Wed, 28 Nov 2018 05:56:19 +0000 (11:26 +0530)]
plat/arm/sgi: Use NT_FW_CONFIG instead of HW_CONFIG
With the two new APIs 'plat_arm_sgi_get_platform_id' and
'plat_arm_sgi_get_config_id' that are available now, BL31 need not
depend on hw_config device tree to identify the platform. In addition
to this, the existing hardware description in hw_config can be limited
to use by BL33 and not by the operating system.
So the hardware description from hw_config dts can be moved into
nt_fw_config dts and the use of hw_config dts can be removed.
Change-Id: I873b7e1e72823d3ec5d253a848e85ae724f09e49
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>