Commit Graph

1481 Commits

Author SHA1 Message Date
danh-arm 7a1b279430 Merge pull request #702 from jeenu-arm/psci-node-hw-state
Support for PSCI NODE_HW_STATE
2016-09-19 11:55:56 +01:00
danh-arm 368d4ebfc1 Merge pull request #701 from dp-arm/dp/fiptool-sha256
fiptool: Add support for printing the sha256 digest with info command
2016-09-19 11:54:27 +01:00
Leon Chen 3c4dea1942 Remove MT6795 plat_sip_svc.c to fix Coverity analysis error. 2016-09-19 14:20:42 +08:00
davidcunado-arm a8de89c974 Merge pull request #709 from Xilinx/zynqmp-2016-09
xilinx: ZynqMP updates
- new SIP calls for bitstream programming
- new SIP call to discover the SOC silicon version
- support the delay timer
2016-09-16 13:57:10 +01:00
Jeenu Viswambharan 3cc17aae72 CSS: Implement support for NODE_HW_STATE
This patch implements CSS platform hook to support NODE_HW_STATE PSCI
API. The platform hook queries SCP to obtain CSS power state. Power
states returned by SCP are then converted to expected PSCI return codes.

Juno's PSCI operation structure is modified to use the CSS
implementation.

Change-Id: I4a5edac0e5895dd77b51398cbd78f934831dafc0
2016-09-15 11:18:48 +01:00
Jeenu Viswambharan 05b128f25e SCPI: Add function to query CSS power state
This patch adds the function scpi_get_css_power_state to perform the
'Get CSS Power State' SCP command and handle its response. The function
parses SCP response to obtain power states of requested cluster and CPUs
within.

Change-Id: I3ea26e48dff1a139da73f6c1e0893f21accaf9f0
2016-09-15 11:18:48 +01:00
Jeenu Viswambharan 1298ae0234 FVP: Implement support for NODE_HW_STATE
This patch implements FVP platform hook to support NODE_HW_STATE PSCI
API. The platform hook validates the given MPIDR and reads corresponding
status from FVP power controller, and returns expected values for the
PSCI call.

Change-Id: I286c92637da11858db2c8aba8ba079389032de6d
2016-09-15 11:18:48 +01:00
Jeenu Viswambharan 28d3d614b5 PSCI: Add support for PSCI NODE_HW_STATE API
This patch adds support for NODE_HW_STATE PSCI API by introducing a new
PSCI platform hook (get_node_hw_state). The implementation validates
supplied arguments, and then invokes this platform-defined hook and
returns its result to the caller. PSCI capabilities are updated
accordingly.

Also updates porting and firmware design guides.

Change-Id: I808e55bdf0c157002a7c104b875779fe50a68a30
2016-09-15 11:17:55 +01:00
davidcunado-arm e69c1956ca Merge pull request #707 from sandrine-bailleux-arm/sb/restore-xlat-defines
Restore some defines in xlat_tables.h
2016-09-15 11:17:41 +01:00
davidcunado-arm d5dbe8787a Merge pull request #708 from sandrine-bailleux-arm/sb/forward-decs
Add some missing forward declarations in plat_arm.h
2016-09-15 11:17:27 +01:00
Sandrine Bailleux afc931f56c Add some missing forward declarations in plat_arm.h
This patch adds a couple of missing forward declarations in plat_arm.h
so that all types it references are known within this header file,
without relying on previous header inclusions. This concerns the
meminfo and bl31_params structures, which are defined in bl_common.h.
Other external types referenced from plat_arm.h (e.g. mmap_region_t)
get declared through header files included by arm_plat.h so they
don't need forward declarations.

Change-Id: I471d5aa487919aff3fa979fc65e053f4f5b0ef32
2016-09-15 10:20:41 +01:00
Sandrine Bailleux e03f0b0861 Restore some defines in xlat_tables.h
Commit e8719552a2 removed some definitions related to translation
tables from the xlat_tables.h header file, based on the assumption
that they weren't used by any platform. These are actually used by
some partners so this patch restores them.

Fixes ARM-software/tf-issues#425

Change-Id: Idafa5f00bb0bd9c2847b5ae6541cf8db93c7b89a
2016-09-15 10:18:50 +01:00
dp-arm 85ee277868 fiptool: Invoke command specific usage function
Instead of always calling the top level usage function when an
error is detected, call the command-specific usage function.

For example running `fiptool create` will produce the same output
as `fiptool help create`.  This is more convenient for the user
when they make a mistake.

Change-Id: I60178ab89d47adf93cdfe6d8b5d5f778a5ea3bca
2016-09-15 09:58:50 +01:00
davidcunado-arm a760613fc0 Merge pull request #663 from leon-chen-mtk/mt6795_2
mediatek: Support for Mediatek MT6795 SoC
2016-09-14 18:09:38 +01:00
davidcunado-arm d9738fbc64 Merge pull request #700 from rockchip-linux/fixes-typo-and-warnings
rockchip: Fixes typo and warnings
2016-09-14 17:06:19 +01:00
dp-arm 2d84b46e96 Ensure PMF service timestamps are properly aligned on a cache line boundary
When using more than a single service in PMF, it is necessary that the
per-service timestamps begin on a cache line boundary.  Previously it
was possible that two services shared a cache line for their
timestamps.  This made it difficult to reason about cache maintenance
operations within a single service and required a global understanding
of how all services operate.

Change-Id: Iacaae5154a7e19ad4107468e56df9ad082ee371c
2016-09-14 11:41:41 +01:00
dp-arm d2e201b429 Rename `pmf_calc_timestamp_offset` to `pmf_calc_timestamp_addr`
The macro calculates an absolute address rather than an offset so
rename it to avoid confusion.

Change-Id: I351f73dfd809fd28c0c30d38928caf5c5cd1af04
2016-09-14 11:41:06 +01:00
Soren Brinkmann 8787c0e00c zynqmp: Make MMIO write FW call synchronous
We must guarantee that writes have become effective before returning to
the caller. Hence, wait for PMUFW signaling completion of the FW call
before returning to the rich OS.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-09-13 09:19:03 -07:00
Siva Durga Prasad Paladugu 3104f2e78d zynqmp: Add support to provide silicon id through SMC
Add support to provide silicon id to non-secure
software through SMC.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>

[ sb
Move zynqmp_get_silicon_id outside of compile guards to avoid build
errors.
]

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
2016-09-13 09:19:03 -07:00
Nava kishore Manne 2ddc31dece zynqmp: pm: Implemented pm API functions to load the bitstream into PL
This patch adds pm_fpga_load() and pm_fpga_get_status() API's to provide
the Access to the xilfpga library to load the bitstream into zynqmp
PL region.

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
2016-09-13 09:19:03 -07:00
Nava kishore Manne f7d4bfc2bf zynqmp: pm: adds new pm ID to sync with PMUFW ID numbers
This patch adds a new pm ID to sync with PMUFW ID numbers.

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
2016-09-13 09:19:03 -07:00
Soren Brinkmann 4fe0f4be7d zynqmp: Initialize GIC on suspend_finish
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-09-13 09:19:03 -07:00
Filip Drazic b516b7dc5d zynqmp: pm: Call set_wakeup_source for all wake devices on sys-suspend
During system suspend, identify slaves which are configured
as wake sources and call pm_set_wakeup_source API for each of them.

Identifying if device may wake the system is done by checking if any
interrupt of that device is enabled in GICD_ISENABLER when the APU is
about to enter SUSPEND_TO_RAM state. If such interrupt is found,
pm_set_wakeup_source is called with corresponding PM node ID as
argument.

Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
2016-09-13 09:19:03 -07:00
Filip Drazic 6aa4c533b8 zynqmp: pm: Add PM node IDs for GPU, PCIE, PCAP and RTC
Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
2016-09-13 09:19:03 -07:00
Filip Drazic 95fd990fe6 zynqmp: pm: Provide state argument to the pm_self_suspend API call
The state argument of the pm_self_suspend API encodes the state to
which the APU intends to suspend. The state can be:
- PM_APU_STATE_CPU_IDLE - processor power down, all memories remain
  on
- PM_APU_STATE_SUSPEND_TO_RAM - all processors powered down, L2$
  powered down, all OCM banks in retention and DDR in
  self-refresh.
The calls for setting requirements for L2$ and OCM banks are now
redundant and removed.

Signed-off-by: Filip Drazic <filip.drazic@aggios.com>
[ sb
 - remove redundant #defines
]
Signed-off-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
2016-09-13 09:19:03 -07:00
Stefan Krsmanovic eccc7cde9f zynqmp: Add simple implementation of zynqmp_validate_power_state()
Implementation is based on arm_validate_power_state().
This function is called during CPU_SUSPEND PSCI call to validate
power_state parameter. If state is valid this function populate it
in req_state array as power domain level specific local state.
ATF platform migration guide chapter 2.2 defines this function as
mandatory for PSCIv1.0 CPU_SUSPEND support.

Signed-off-by: Stefan Krsmanovic <stefan.krsmanovic@aggios.com>
2016-09-13 09:19:02 -07:00
Soren Brinkmann 797ab652fb zynqmp: Increase MAX_XLAT_TABLES
When moving the ATF into the DRAM address space an additional
translation table is required.

Reported-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-09-13 09:19:02 -07:00
Soren Brinkmann 0ab6a2429b zynqmp: Change default BL31 address space
The OCM space was reorganized to use the space more efficiently. Adjust
the default ATF location to be aligned with other ZynqMP software
components.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-09-13 09:19:02 -07:00
Naga Sureshkumar Relli 06526c9797 zynqmp: Add RW access to L2ACTLR_EL1 and CPUACTLR_EL1
Arm provided error injection support. To enable this error injection,
we need to set L2DEIEN in L2ACTLR_EL1 register and L1DEIEN in
CPUACTLR_EL1 register.

This is needed for our cortexa53 edac linux driver testing.
These registers need write access from non secure EL1 i.e linux
at the time of setting the above bits.

Signed-off-by: Naga Sureshkumar Relli <nagasure@xilinx.com>
2016-09-13 09:19:02 -07:00
Soren Brinkmann 538957d85b zynqmp: Set RESET_TO_BL31 through platform.mk
ZynqMP only supports builds with RESET_TO_BL31=1. Set this option
through the platform makefile on default.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-09-13 09:19:02 -07:00
Mirela Simonovic 2c239f7c2a zynqmp: pm: Added NODE_IPI_RPU_0 node definition in pm_defs
Nodes represent IPI dedicated to the RPU (not accessible by APU)

Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
2016-09-13 09:19:02 -07:00
Soren Brinkmann e1cb4da465 zynqmp: Add support for generic_delay_timer
Initialize the generic_delay_timer in the zynqmp port.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-09-13 09:19:02 -07:00
davidcunado-arm b1887a86aa Merge pull request #703 from rockchip-linux/fixes-gic-panic
rockchip: fixes the gic panic for rk3399 resume
2016-09-13 17:13:45 +01:00
Caesar Wang 0587788abc rockchip: fixes the gic panic for rk3399 resume
We make sure the resuming of gic need to be enabled.
Otherwise, The resume will hit the below panic.
...
[   24.230541] CPU0: update max cpu_capacity 451
[   24.236029] CPU5: update max cpu_capacity 1024
[   24.236046] CPU4: shutdown
[   24.243205] psci: CPU4 killed.
[   24.258730] CPU5: shutdown
[   24.261472] psci: CPU5 killed.
[   24.270417] GIC: unable to set SRE (disabled at EL2), panic ahead
[   24.270417] cat[7801]: undefined instruction: pc=ffffffc0004e65d0
[   24.270417] Code: b0003940 91274400 97f871af d2801e00 (d5184600)
[   24.270417] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT

Change-Id: Ie9542c8d5768ba0accfa073453da8bfe06d4f921
2016-09-13 14:18:40 +08:00
davidcunado-arm 4531d3c9ab Merge pull request #698 from rockchip-linux/set-APIO-for-rk3399
Set apio for rk3399
2016-09-12 17:58:41 +01:00
Yatharth Kochar 6083c841d0 GICv3: Allow either G1S or G0 interrupts to be configured
Currently the GICv3 driver mandates that platform populate
both G1S and G0 interrupts. However, it is possible that a
given platform is not interested in both the groups and
just needs to specify either one of them.

This patch modifies the `gicv3_rdistif_init()` & `gicv3_distif_init()`
functions to allow either G1S or G0 interrupts to be configured.

Fixes ARM-software/tf-issues#400

Change-Id: I43572b0e08ae30bed5af9334f25d35bf439b0d2b
2016-09-12 16:19:08 +01:00
dp-arm 9df69ba37f fiptool: Add support for printing the sha256 digest with info command
This feature allows one to quickly verify that the expected
image is contained in the FIP without extracting the image and
running sha256sum(1) on it.

The sha256 digest is only shown when the verbose flag is used.

This change requires libssl-dev to be installed in order to build
Trusted Firmware. Previously, libssl-dev was optionally needed only
to support Trusted Board Boot configurations.

Fixes ARM-Software/tf-issues#124

Change-Id: Ifb1408d17f483d482bb270a589ee74add25ec5a6
2016-09-12 11:01:25 +01:00
Leon Chen c1ff80b128 Support for Mediatek MT6795 SoC
This patch support single core to boot to Linux kernel
through Trusted Firmware.
It also support 32 bit kernel and 64 bit kernel booting.
2016-09-12 17:13:55 +08:00
danh-arm 048d802a08 Merge pull request #699 from soby-mathew/sm/flush_plat_psci_ops
Flush `psci_plat_pm_ops` after initialization
2016-09-12 09:58:44 +01:00
Caesar Wang 7e1bedb697 rockchip: fixes some typo
As the checkpatch reports the warning or error.

plat/rockchip/common/plat_pm.c:96:
ERROR: do not set execute permissions for source files
plat/rockchip/rk3399/drivers/pmu/pmu.c:294:
ERROR: do not set execute permissions for source files

plat/rockchip/common/plat_pm.c:286: WARNING: line over 80 characters
plat/rockchip/common/plat_pm.c:287: WARNING: line over 80 characters

Change-Id: Ib347da21c56551c31df3f90f03777b13c75d5c26
2016-09-10 06:37:23 +08:00
Caesar Wang a8656400c4 rockchip: SIP call use 32 bit return value for rk3399
for compatible 32bit and 64bit, we use 0x82xxxxxx as function ID,
we modify SIP call function return value to 32 bit.

Change-Id: Ib99b03a9ea423853aaa296dcc634ee82c622a552
2016-09-10 06:37:08 +08:00
Caesar Wang 2bff35bb7c rockchip: set gpio2 ~ gpio4 to input and pull none mode
For save power cosumption, if gpio power supply shut down, we need to
set gpio2 ~ gpio4 to input and HiZ status when suspend, and recovery
they status when rusume. we do it base on apio pass from loader.

Change-Id: I59fd2395e5e37e63425472a39f519822c9197e4c
2016-09-10 04:06:44 +08:00
Caesar Wang e550c63101 rockchip: support disable/enable specific gpio when suspend/resume
some specific board need to disable/enable specific gpio when
suspend/resume, so we add this function, bootloader can pass the
specific gpio, and we can handle these gpios in bl31 suspend/resuem
function.

Change-Id: I373b03ef9202ee4a05a2b9caacdfa01b47ee2177
2016-09-10 04:06:44 +08:00
Caesar Wang 536c249245 rockchip/rk3399: improve gpio driver and support get pull mode function
We may need gpio pull mode later, so add this function.
Besides fix a set pull mode bug, and save gpio clock gate,
when operate the gpio, we will enable gpio clock, when
finish gpio operate, restore gpio clock gate status.

Change-Id: Ia1d602804f571a17f5ddc499908663b968b02974
2016-09-10 04:06:39 +08:00
Soby Mathew 7a3d4bdeef Flush `psci_plat_pm_ops` after initialization
The `psci_plat_pm_ops` global pointer is initialized during cold boot by the
primary CPU and will be accessed by the secondary CPUs before enabling data
cache during warm boot. This patch adds a missing data cache flush of
`psci_plat_psci_ops` after initialization during psci_setup() so that
secondaries can see the updated `psci_plat_psci_ops` pointer.

Fixes ARM-software/tf-issues#424

Change-Id: Id4554800b5646302b944115a33be69507d53cedb
2016-09-09 14:37:07 +01:00
davidcunado-arm 77b0532392 Merge pull request #697 from rockchip-linux/fixes-scu-idle
rockchip: fix the scu idle for rk3399
2016-09-08 14:42:45 +01:00
Tony Xie 63ebf051b0 rockchip: fix the scu idle for rk3399
As rk3399 reported the d8/octane scores drop 10% with cpu idle.
The root cause is thc cpu cluster enter the slow mode.
We don't need switch the clock to 24MHz if cpu cluster enter the
retention mode. In order to improve performance, it just needs for
cluster enter powering off mode.

Also, we shouldn't do anything for hlvl if the system is off.

Change-Id: I2a02962a01343abd0cba47ed63192c1cdf88b119
2016-09-08 15:04:58 +08:00
davidcunado-arm 99e89377eb Merge pull request #695 from soby-mathew/sm/AArch32_fixes
Fixes for AArch32 port of TF
2016-09-01 09:43:32 +01:00
Soby Mathew 9e3b4cbbad AArch32: Fix SCTLR context initialization
This patch fixes a bug in context management library when writing
SCTLR register during context initialization. The write happened
prior to initialization of the register context pointer. This
resulted in the compiler optimizing the write sequence from the
final binary and hence SCTLR remains uninitialized when
entering normal world. The bug is fixed by doing the
initialization of the register context pointer earlier in the
sequence.

Change-Id: Ic7465593a74534046b79f40446ffa1165c52ed76
2016-08-31 18:14:07 +01:00
Soby Mathew 51c79b7351 AArch32: resolve build error when LOG_LEVEL=50
This patch resolves a build error in Trusted Firmware when `ARCH=aarch32`
and LOG_LEVEL >= 50.

Change-Id: I62a23ded4a25304533cdcc5ff11442aee041709b
2016-08-31 18:14:07 +01:00