Commit Graph

4007 Commits

Author SHA1 Message Date
Dimitris Papastamos 7c3a0b0139
Merge pull request #1388 from vwadekar/report-cve-2017-5715
cpus: denver: report CVE_2017_5715 mitigation to higher layers
2018-08-20 14:57:39 +01:00
Dimitris Papastamos 4c0b164e64
Merge pull request #1524 from danielboulby-arm/db/ReclaimInit
rockchip: Add plat_is_my_cpu_primary function
2018-08-20 09:38:17 +01:00
Dimitris Papastamos f147a8f8a8
Merge pull request #1523 from jts-arm/dsu
DSU erratum 936184 workaround
2018-08-20 09:37:16 +01:00
Jeenu Viswambharan b634fa910e SiP: MISRA fixes for execution state switch
These changes address most of the required MISRA rules. In the process,
some from generic code is also fixed.

No functional changes.

Change-Id: I707dbec9b34b802397e99da2f5ae738165d6feba
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-08-20 09:05:39 +01:00
Jeenu Viswambharan 30a8d96e46 RAS: MISRA fixes
These changes address most of the required MISRA rules. In the process,
some from generic code is also fixed.

No functional changes.

Change-Id: I76cacf6e1d73b09510561b5090c2bb66d81bec88
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-08-20 09:05:39 +01:00
Jeenu Viswambharan 03b645ed86 EHF: MISRA fixes
These changes address most of the required MISRA rules. In the process,
some from generic code are also fixed.

No functional changes.

Change-Id: I19786070af7bc5e1f6d15bdba93e22a4451d8fe9
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-08-20 09:05:39 +01:00
Jeenu Viswambharan 611eb9cfa7 SDEI: Fix locking issues
The event lock for a shared event was being unlocked twice, and the
locking sequence for event complete was misplaced. This patch fixes both
issues.

Change-Id: Ie2fb15c6ec240af132d7d438946ca160bd5c63dc
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-08-20 09:05:39 +01:00
Jeenu Viswambharan ba6e5ca671 SDEI: MISRA fixes
These changes address most of the required MISRA rules. In the process,
some from generic code is also fixed.

No functional changes.

Change-Id: I6235a355e006f0b1c7c1c4d811b3964a64d0434f
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-08-20 09:05:39 +01:00
Jeenu Viswambharan 5f83591880 AArch64: Enable MPAM for lower ELs
Memory Partitioning And Monitoring is an Armv8.4 feature that enables
various memory system components and resources to define partitions.
Software running at various ELs can then assign themselves to the
desired partition to control their performance aspects.

With this patch, when ENABLE_MPAM_FOR_LOWER_ELS is set to 1, EL3 allows
lower ELs to access their own MPAM registers without trapping to EL3.
This patch however doesn't make use of partitioning in EL3; platform
initialisation code should configure and use partitions in EL3 if
required.

Change-Id: I5a55b6771ccaa0c1cffc05543d2116b60cbbcdcd
Co-authored-by: James Morse <james.morse@arm.com>
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-08-20 07:32:19 +01:00
Konstantin Porotchkin bbaa712ee9 plat: marvell: bl31: Update the early platform setup API
Move from bl31_early_platform_setup to bl31_early_platform_setup2

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-08-19 10:11:24 +03:00
Varun Wadekar 8335396233 cpus: denver: report CVE_2017_5715 mitigation to higher layers
This patch uses the 'declare_cpu_ops_wa' macro, to set the check function,
to report that Denver cores are mitigated.

Denver cores are vulnerable to this anomaly and require the mitigation to
be enabled always.

Change-Id: I1bb6eefdec8c01fb8b645e112f8d04d4bb8811ef
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2018-08-17 14:37:45 -07:00
Dimitris Papastamos 6456fe85e4
Merge pull request #1529 from satheesbalya-arm/sb1_2549_fix_dtc_warn
DTC: Add recommended device tree compiler version
2018-08-17 16:00:30 +01:00
Antonio Nino Diaz 941a624dbc rpi3: Migrate from deprecated APIs
Change-Id: If53b5b2430a06ce8cf6e7948765b560b37afc335
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-17 14:25:08 +01:00
John Tsichritzis 8a6771803f DSU erratum 936184 workaround
If the system is in near idle conditions, this erratum could cause a
deadlock or data corruption. This patch applies the workaround that
prevents this.

This DSU erratum affects only the DSUs that contain the ACP interface
and it was fixed in r2p0. The workaround is applied only to the DSUs
that are actually affected.

Link to respective Arm documentation:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.epm138168/index.html

Change-Id: I033213b3077685130fc1e3f4f79c4d15d7483ec9
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
2018-08-17 10:34:43 +01:00
Sathees Balya 2eadd344ea DTC: Add recommended device tree compiler version
Change-Id: Ice87052e41a24b0ede5610467e12941ae1d886e0
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
2018-08-17 10:31:54 +01:00
Dimitris Papastamos 4e45fbd626
Merge pull request #1525 from antonio-nino-diaz-arm/an/rpi3
rpi3: Remove dependencies on Arm platform code
2018-08-17 09:55:38 +01:00
Dimitris Papastamos 55f3bc2d06
Merge pull request #1527 from jts-arm/docs
Fix typo in documentation page title
2018-08-17 09:51:19 +01:00
Dimitris Papastamos b73b60e554
Merge pull request #1517 from satheesbalya-arm/sb1_2607_mcd_reg
Console: Use callee-saved registers
2018-08-17 09:51:01 +01:00
John Tsichritzis ef9b68e275 Fix typo in documentation page title
Change-Id: I426ffc8717757e35e556f675162a729ba095b7d5
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
2018-08-15 14:54:40 +01:00
Antonio Nino Diaz 42636360ac rpi3: Remove dependencies on Arm platform code
The Raspberry Pi 3 port doesn't actually depend on any Arm platform
code, so the dependencies can be removed.

Change-Id: Ic2f47f5001bebde3862815b1d880a169d82b3f65
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-15 14:43:29 +01:00
Daniel Boulby 5eddd22e05 rockchip: Add plat_is_my_cpu_primary function
This function is required for platforms where
COLD_BOOT_SINGLE_CPU=0 however it was missing from rockchip
platforms

Change-Id: I32a85f226a4f22085a27113903f34bdb6f28dbcc
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
2018-08-15 13:39:33 +01:00
Sathees Balya d35cc347db Console: Use callee-saved registers
This allows the console drivers to be implemented in C

Change-Id: Ibac859c4bcef0e92a0dcacc6b58ac19bc69b8342
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
2018-08-15 13:03:01 +01:00
Dimitris Papastamos 07da0bf976
Merge pull request #1516 from antonio-nino-diaz-arm/an/printf
Replace stdio.h functions by TF functions
2018-08-15 10:49:57 +01:00
Dimitris Papastamos 7e8a891f39
Merge pull request #1502 from dp-arm/dp/irc
readme: Add information about the TF-A IRC channel
2018-08-13 15:29:35 +01:00
Dimitris Papastamos 09895d42b5
Merge pull request #1520 from robertovargas-arm/cci-dsb
cci: Use dsb to wait before reading status register
2018-08-13 15:29:22 +01:00
Roberto Vargas fcb52dbf16 cci: Use dsb to wait before reading status register
The CCI500 TRM explicitily requires completion of the write
operation before the read operation, and it is not guaranteed
by dmb but it is dsb.

Change-Id: Ieeaa0d1a4b8fcb87108dea9b6de03d9c8a150829
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-08-13 14:20:30 +01:00
Dimitris Papastamos 3ba9295715
Merge pull request #1510 from robertovargas-arm/romlib
Add support for moving libraries to ROM
2018-08-13 13:02:16 +01:00
Dimitris Papastamos 0983b8b149
Merge pull request #1519 from antonio-nino-diaz-arm/an/xlat-el2
xlat v2: Support EL2 translation regime
2018-08-13 13:02:04 +01:00
Dimitris Papastamos 6902e66a6b
Merge pull request #1518 from antonio-nino-diaz-arm/an/fix_mmc
mmc: Fix warning about usage of uninitialized variable
2018-08-13 11:22:25 +01:00
Antonio Nino Diaz cadb36cb0a drivers/mmc: Fix warning about usage of uninitialized variable
Because of -Werror, this causes a build error.

Change-Id: I37a8c4bbfe3f2ced5e17981a2814985919ad483b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-10 14:58:08 +01:00
Antonio Nino Diaz 4c72c3fefa layerscape: stm32mp1: Migrate to enable_mmu_svc_mon()
Change-Id: I3d16b247a0fa457e6293e2d2c4503dfde1e51c1d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-10 13:47:37 +01:00
Antonio Nino Diaz 1e54cbb8f5 plat/arm: Migrate to enable_mmu_svc_mon()
Change-Id: I1bb310e1b05968d30b28913c4011c0601e1ae64e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-10 13:47:37 +01:00
Antonio Nino Diaz 1a92a0e00a xlat v2: Support the EL2 translation regime
The translation library is useful elsewhere. Even though this repository
doesn't exercise the EL2 support of the library, it is better to have it
here as well to make it easier to maintain.

enable_mmu_secure() and enable_mmu_direct() have been deprecated. The
functions are still present, but they are behind ERROR_DEPRECATED and
they call the new functions enable_mmu_svc_mon() and
enable_mmu_direct_svc_mon().

Change-Id: I13ad10cd048d9cc2d55e0fff9a5133671b67dcba
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-10 13:47:11 +01:00
Dimitris Papastamos 5e4c590d84
Merge pull request #1504 from hzhuang1/migrate_mmc
Migrate mmc
2018-08-10 12:40:53 +01:00
Haojian Zhuang fcda63ba45 doc/maintainers: remove emmc framework
Remove emmc framework from maintain list.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang 41583c5781 drivers/emmc: remove emmc framework
Replace emmc framework by mmc framework.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang eba1b6b3c7 plat/poplar: migrate to mmc framework
Migrate from emmc framework to mmc framework.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang 261e43b78f plat/hikey: migrate to mmc framework
Migrate to mmc framework.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang 7a8b483067 drivers/dw_mmc: migrate to mmc framework
Migrate dw_mmc driver from emmc framework to mmc framework. The
emmc framework will be abandoned.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang bd4e3deee9 drivers/mmc: set buswidth and speed before reading data
It should set buswidth and speed of mmc controller before accessing
mmc.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang 07858dd809 drivers/mmc: make mmc_ext_csd aligned with 16 char
DMA is always used in mmc driver. So the buffer address should
always follow the DMA limitation.

There're same requirement in mmc_read_blocks()/mmc_write_blocks()
on parameter buf. Since parameter buf comes from io_block driver,
it's already handled in io_block driver.

At here, just make the minimum address alignment on 16 chars.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang ea315a69de drivers/mmc: fix lba param to int
mmc_read_blocks()/mmc_write_blocks() derived from io_block_ops_t
type. It means that lba param should be integer type, not
unsigned integer type.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang e74dc940c6 drivers/mmc: send CMD8 only for SD card in initialization
Sending CMD8 before CMD1 just causes to fetch data failure in eMMC.
Check whether it's eMMC first. If it's eMMC, send CMD1 command instead.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Dimitris Papastamos 8ae41aec32
Merge pull request #1505 from Yann-lms/mmc_delays
mmc: add required delays when retrying commands
2018-08-10 09:44:09 +01:00
Antonio Nino Diaz 6a23356c4f Replace stdio.h functions by TF functions
Functions provided by stdio.h such as printf and sprintf are available
in the codebase, but they add a lot of code to the final image if they
are used:

- AArch64: ~4KB
- AArch32: ~2KB in T32, ~3KB in A32

tf_printf and tf_snprintf are a lot more simple, but it is preferable
to use them when possible because they are also used in common code.

Change-Id: Id09fd2b486198fe3d79276e2c27931595b7ba60e
Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-10 09:36:18 +01:00
Antonio Nino Diaz 73bc6e77f1 tf_snprintf: Add support for '%s'
Change-Id: Ia3a159444e638f63de7dc5a6a4b76169c757188a
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-10 09:36:18 +01:00
Dimitris Papastamos 29be1b55f4
Merge pull request #1513 from antonio-nino-diaz-arm/an/xlat-caches
xlat v2: Cleanup and dcache coherency bug fix
2018-08-09 15:16:19 +01:00
Antonio Nino Diaz 3e318e4037 xlat v2: Flush xlat tables after being modified
During cold boot, the initial translation tables are created with data
caches disabled, so all modifications go to memory directly. After the
MMU is enabled and data cache is enabled, any modification to the tables
goes to data cache, and eventually may get flushed to memory.

If CPU0 modifies the tables while CPU1 is off, CPU0 will have the
modified tables in its data cache. When CPU1 is powered on, the MMU is
enabled, then it enables coherency, and then it enables the data cache.
Until this is done, CPU1 isn't in coherency, and the translation tables
it sees can be outdated if CPU0 still has some modified entries in its
data cache.

This can be a problem in some cases. For example, the warm boot code
uses only the tables mapped during cold boot, which don't normally
change. However, if they are modified (and a RO page is made RW, or a XN
page is made executable) the CPU will see the old attributes and crash
when it tries to access it.

This doesn't happen in systems with HW_ASSISTED_COHERENCY or
WARMBOOT_ENABLE_DCACHE_EARLY. In these systems, the data cache is
enabled at the same time as the MMU. As soon as this happens, the CPU is
in coherency.

There was an attempt of a fix in psci_helpers.S, but it didn't solve the
problem. That code has been deleted. The code was introduced in commit
<264410306381> ("Invalidate TLB entries during warm boot").

Now, during a map or unmap operation, the memory associated to each
modified table is flushed. Traversing a table will also flush it's
memory, as there is no way to tell in the current implementation if the
table that has been traversed has also been modified.

Change-Id: I4b520bca27502f1018878061bc5fb82af740bb92
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-07 12:47:12 +01:00
Dimitris Papastamos 781842ea8a
Merge pull request #1501 from robertovargas-arm/cci
cci: Wait before reading status register
2018-08-06 16:09:20 +01:00
Roberto Vargas 1eb735d753 Add librom support in FVP
Change-Id: Idb9ba3864d6de3053260724f07172fd32c1523e0
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-08-06 13:08:51 +01:00