Commit Graph

4445 Commits

Author SHA1 Message Date
Antonio Niño Díaz 74203d268e
Merge pull request #1704 from marex/arm/master/memsize-passing-v1
Arm/master/memsize passing v1
2018-12-10 15:18:23 +01:00
Soby Mathew 85456a9201
Merge pull request #1700 from jwerner-chromium/JW_crashfix
MULTI_CONSOLE_API fixes and cleanups
2018-12-10 14:00:01 +00:00
Julius Werner 65d8582b32 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>
2018-12-06 16:18:19 -08:00
Julius Werner 91b48c9f8f 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>
2018-12-06 16:18:10 -08:00
Julius Werner 985ee0b7e8 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>
2018-12-06 16:13:50 -08:00
Julius Werner 0f8aee4e45 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>
2018-12-06 16:10:36 -08:00
Julius Werner 63c52d0071 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>
2018-12-06 16:10:32 -08:00
Julius Werner b2f7c9dd80 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>
2018-12-06 16:09:42 -08:00
Soby Mathew f7ed4ab07a
Merge pull request #1713 from chandnich/nt-fw-config
plat/arm/sgi: Use NT_FW_CONFIG instead of HW_CONFIG
2018-12-06 15:07:44 +00:00
Soby Mathew c120613f71
Merge pull request #1710 from soby-mathew/sm/smc_save_x0_x3
BL31: Use helper function to save registers in SMC handler
2018-12-06 11:13:38 +00:00
Antonio Niño Díaz 24e4806317
Merge pull request #1709 from joannafarley-arm/jf/copyrights-updates
Change copyright guidelines
2018-12-06 11:29:29 +01:00
Antonio Niño Díaz 8dc395e3ed
Merge pull request #1706 from Yann-lms/mmc_init_check
MMC init check and STM32MP1 MMC driver improvements
2018-12-06 11:28:53 +01:00
Marek Vasut a6de3db7bb 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>
2018-12-06 10:23:54 +01:00
Marek Vasut ac49c5fbe9 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>
2018-12-06 10:23:54 +01:00
Marek Vasut 1d85c4bd5b 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>
2018-12-06 10:23:54 +01:00
Marek Vasut 851851519d 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>
2018-12-06 01:59:10 +01:00
Marek Vasut 10b7a4aeca 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>
2018-12-06 01:59:10 +01:00
Marek Vasut e1eddfea88 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>
2018-12-06 01:59:10 +01:00
Marek Vasut 7bf24ae3c6 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>
2018-12-06 01:59:10 +01:00
Marek Vasut 3b507aabd8 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>
2018-12-06 01:59:10 +01:00
Marek Vasut 358ed930f4 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>
2018-12-06 01:59:10 +01:00
Chandni Cherukuri 77ab969a8a 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>
2018-12-05 22:15:51 +05:30
Antonio Niño Díaz 19b56cf4a2
Merge pull request #1711 from antonio-nino-diaz-arm/an/fix-imx
tzc380: Fix some asserts
2018-12-05 12:24:01 +01:00
Antonio Nino Diaz df54406df5 tzc380: Fix some asserts
This driver can be compiled in release builds, but GCC generates warnings
for some comparisons and that prevents the firmware from being built in
debug builds.

Change-Id: Ic52e1b4a11896ecf086864fbe2b5bfc143ec9b1b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-12-05 11:21:42 +00:00
Soby Mathew 01fc1c24b9 BL31: Use helper function to save registers in SMC handler
Use the helper function `save_gp_registers` to save the register
state to cpu_context on entry to EL3 in SMC handler. This has the
effect of saving x0 - x3 as well into the cpu_context which was
not done previously but it unifies the register save sequence
in BL31.

Change-Id: I5753c942263a5f9178deda3dba896e3220f3dd83
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-12-05 10:40:08 +00:00
Antonio Niño Díaz 36bc633eec
Merge pull request #1653 from JackyBai/master
Add NXP i.MX8MQ basic support
2018-12-05 11:22:55 +01:00
Joanna Farley b79da224a7 Change copyright guidelines
Copyright guidance has been changed for migration of the
ARM run project to trustedfirmware.org where the project
governance is different.

Change-Id: I059177453fb357843eced93c2a55b3705a379683
Signed-off-by: Joanna Farley <joanna.farley@arm.com>
2018-12-05 10:19:50 +00:00
Bai Ping 8113681992 plat: imx: Add i.MX8MQ basic support
i.MX8MQ is new SOC of NXP's i.MX8M family based on
A53. It can provide industry-leading audio, voice
and video processing for applications that scale
from consumer home audio to industrial building
automation and mobile computers

this patchset add the basic supoort to boot up
the 4 X A53. more feature will be added later.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-12-05 08:58:51 +08:00
Antonio Niño Díaz 03ce162080
Merge pull request #1703 from oscardagrach/hikey960-dmac-fix
hikey960: initialize EDMAC and channels
2018-12-04 17:19:50 +01:00
Antonio Nino Diaz ae4a99b954
Merge pull request #1705 from chandnich/platform-id
plat/arm/sgi: Use platform specific functions to get platform ids
2018-12-04 14:07:36 +00:00
Antonio Niño Díaz 6d422c3e2b
Merge pull request #1702 from MISL-EBU-System-SW/patches-18.12
Update code with latest changes from Marvell LSP 18.12
2018-12-04 15:01:48 +01:00
Konstantin Porotchkin f32f3899f8 plat/marvell: update platform LSP version to 18.12.0
Sync the platform code version with current Marvell LSP.

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Igal Liberman ff82813af8 a8k: pm: extend MSS_TRIGGER_TIMEOUT
Very rarely, during cpuidle operations the following error
is seen: "PM MSG Trigger Timeout".
This is caused by slow handling of message interrutps
in the PM FW running on CM3 (under heavy PM operation load).

This is not a real issue, so we extend the timeout to
avoid the error prints.

Change-Id: I92fd6f2ff1ddf208b216c123880ded28a00b6e0e
Signed-off-by: Igal Liberman <igall@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/59670
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
2018-12-04 14:09:44 +02:00
Konstantin Porotchkin 5a9f00f707 plat/marvell: comphy: Add support for SFI on Lane 4
Add static configuration for SFI+ 10Gbps interface on SERDES
Lane 4.
This is just a copy of Lane 2 static values, not optimized.
Board-to-board iperf test shows up to 6Gbps transfer speed.

Change-Id: I024d2ac132f7fa6c342a64367f3dca2123a27e97
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
2018-12-04 14:09:44 +02:00
Konstantin Porotchkin d03f7a3122 doc: marvell: Update build manual with new memory layouts
Add description for memory layouts used by EspressoBin v7 (DDR4)

Change-Id: I199d8b52580b26e560f14b503a6e99d32de4f284
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/61279
Reviewed-by: Stefan Chulski <stefanc@marvell.com>
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
2018-12-04 14:09:44 +02:00
Christine Gharzuzi 5cf6fafe22 fix: a3900: pm: fix number of CPU power switches.
- Number of open power switches for CPUs should be three
  and now two.

- This patch updates the value of open power switches from
  0xfd (two power-switches) to 0xfc (three power-switches).

Change-Id: I2783ab7f04bbbb6da78eeedcabe4636f9a774512
Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Konstantin Porotchkin c35442690c svc: Update the EEPROM AVS values processing
Add support for SVC test builds for tuning AVS values.
Update the SVC procedure and add EEPROM access.
Add support for AP807 AVS values (10 bits wide).

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Christine Gharzuzi 1020e0d326 ble: ap807: Switch to PLL mode and update CPU frequency
- Update CPU frequency on AP807 to 2GHz for SAR 0x0.
- Increase AVS to 0.88V for 2GHz clock

Change-Id: Ic945b682ab2f8543e34294bfc56c3eae2c5e0c8e
Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Igal Liberman 55df84f974 mvebu: cp110: avoid pcie power on/off sequence when called from Linux
In Armada 8K DB boards, PCIe initialization can be executed only once
because PCIe reset performed during chip power on and it cannot be
executed via GPIO later.
This means that power on can be executed only once, when it's called
from the bootloader.
Power on:
	Read bit 21 of the mode, it marks if the caller is
	the bootloader or the Linux Kernel.
Power off:
	Check if the comphy was already configured to PCIe, if yes,
	check if the caller is bootloader, if both conditions are true
	(PCIe mode and called by Linux) - skip the power-off.

In addition, fix incorrect documentation describing mode fields -
PCIe width is 3 bits, not 2.

NOTE: with this patch, please use LK4.14.76 (LK4.4.120 may not work
with it).

Change-Id: I4b929011f97a0a1869a51ba378687e78b3eca4ff
Signed-off-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Grzegorz Jaszczyk 9cb6751d59 plat: marvell: a3700: do not power off cpu due to errata ref #13
Do not power off the CPU1 since there is no way to wake it up
(wake-up is causing CPU0 reset as well duo to HW bug). Quote from errata
Ref #13 [In power saving mode, both cores must be powered off]:
"When Core 0 is on and Core 1 is in power-off state, a Core 1
wake-up resets Core 0 as well and puts Core 0 back to ROM".

To overcome described HW bug instead of powering the CPU off, let it
reach WFI instruction, which is invoked by generic psci_do_cpu_off
function after platform handler finishes. This will put the core in low
power state and give a chance to wake it up.

Before this change, after running secondary kernel via kexec, only one
core was up, now both cores are up.

Change-Id: I87f144867550728055d9b8a2edb84a14539acab7
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Grzegorz Jaszczyk 0529106c4b mvebu: cp110: fix phy selector configuration for XFI1
Extended phy selector configuration about XFI1 mode.

Change-Id: I1309770bbb5fdbfb0127b6f12ee78974d1d6b19f
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Peng Fan 46f9b2c3a2 drivers: add tzc380 support
Add tzc380 support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-12-04 18:06:41 +08:00
Yann Gautier 1d7bcaa636 drivers: st: mmc: improve error cases in send_cmd function
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Yann Gautier ba7f9bfd8e stm32mp: check stm32_sdmmc2_mmc_init return
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Yann Gautier 77614a9949 drivers: mmc: check mmc_reset_to_idle return
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Soby Mathew 41771df849
Merge pull request #1699 from chandnich/sgi-mt-support
Add support to implement multi-threaded platforms for SGI
2018-12-03 13:29:33 +00:00
Chandni Cherukuri 699223a282 plat/arm/sgi: Use platform specific functions to get platform ids
Add two new functions 'plat_arm_sgi_get_platform_id' and
'plat_arm_sgi_get_config_id' which will be implemented by all the
SGI platforms. These functions can be used to determine the part
number and configuration id of the SGI platforms.

In BL2, these functions are used to populate the 'system-id' node.
In BL31, these functions are used to populate the 'sgi_plat_info_t'
structure with the part number and configuration id of the platform.

Change-Id: I3bacda933527724a3b4074ad4ed5b53a81ea4689
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2018-12-03 18:35:50 +05:30
Soby Mathew 500db01352
Merge pull request #1701 from chandnich/psci-ops
remove weak implemention of 'plat_arm_psci_override_pm_ops'
2018-11-30 16:25:27 +00:00
Ryan Grachek 87f6740c6b hikey960: initialize EDMAC and channels
This is needed to utilize the DMA controller on the hikey960

Signed-off-by: Ryan Grachek <ryan@edited.us>
2018-11-29 13:11:45 -06:00
Antonio Niño Díaz 37e8ab5323
Merge pull request #1688 from JoelHutton/jh/variant_1_mitigations
Initial Spectre V1 mitigations (CVE-2017-5753).
2018-11-29 16:05:50 +01:00