Commit Graph

1528 Commits

Author SHA1 Message Date
Jeenu Viswambharan 2fae4b1e07 build: Reorder build variables alphabetically
When build variables are assigned or processed en masse, they'd appear
neater in alphabetical order.

Static initializations are moved to a separate file,
make_helpers/defaults.mk, which in itself is sorted alphabetically.

No functional changes.

Change-Id: I966010042b33de6b67592fb9ffcef8fc44d7d128
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2016-11-08 09:00:44 +00:00
Jeenu Viswambharan 01920cfdf9 docs: Reorder build options alphabetically
At present, build options in the user guide aren't listed in any
specific order. Ordering them alphabetically is a standard practice, and
is also easier on the reader.

Contents unchanged.

Change-Id: Ibc36f3a2a576edb86c1a402430d2ef5adcb2f144
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2016-11-08 09:00:40 +00:00
danh-arm d19ce2cb44 Merge pull request #749 from sandrine-bailleux-arm/sb/fix-bl1_plat_mem_check-doc
Porting guide: Improve bl1_plat_mem_check() doc
2016-11-03 17:49:32 +00:00
danh-arm 2b3ce7b8d9 Merge pull request #748 from dp-arm/dp/arm-sip
BL31 runtime instrumentation fixes and documentation update
2016-11-03 17:49:16 +00:00
Sandrine Bailleux ba789770bc Porting guide: Improve bl1_plat_mem_check() doc
This patch fixes the type of the return value of bl1_plat_mem_check()
in the porting guide. It also specifies the expected return value.

Change-Id: I7c437342b8bfb1e621d74b2edf0aaf97b913216a
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2016-11-03 16:06:48 +00:00
dp-arm bfef610667 Perform a cache flush after ENTER PSCI timestamp capture
Without an explicit cache flush, the next timestamp captured might have
a bogus value.

This can happen if the following operations happen in order,
on a CPU that's being powered down.

1) ENTER PSCI timestamp is captured with caches enabled.

2) The next timestamp (ENTER_HW_LOW_PWR) is captured with caches
   disabled.

3) On a system that uses a write-back cache configuration, the
   cache line that holds the PMF timestamps is evicted.

After step 1), the ENTER_PSCI timestamp is cached and not in main memory.
After step 2), the ENTER_HW_LOW_PWR timestamp is stored in main memory.
Before the CPU power down happens, the hardware evicts the cache line that
contains the PMF timestamps for this service.  As a result, the timestamp
captured in step 2) is overwritten with a bogus value.

Change-Id: Ic1bd816498d1a6d4dc16540208ed3a5efe43f529
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
2016-11-03 16:02:53 +00:00
dp-arm fc1d1e2df0 user guide: Document `ENABLE_RUNTIME_INSTRUMENTATION` option
Change-Id: I8e50df67e860b9589834445761a7b9927690fdce
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
2016-11-03 16:02:53 +00:00
danh-arm 2fef96a31a Merge pull request #745 from rockchip-linux/support-rk3399-dram
Support rk3399 dram
2016-11-03 15:13:36 +00:00
danh-arm be7b4af3cc Merge pull request #746 from antonio-nino-diaz-arm/an/fix-checkpatch
Fix format of patches passed to checkpatch
2016-11-03 12:17:38 +00:00
davidcunado-arm 9c4c18fa88 Merge pull request #742 from masahir0y/misc
Comment fixes and .gitignore update
2016-10-31 23:12:03 +00:00
davidcunado-arm 061723f96c Merge pull request #744 from masahir0y/fiptool
fiptool: fix Segmentation fault when only --verbose option is given
2016-10-28 23:18:16 +01:00
Antonio Nino Diaz c626311e49 Fix format of patches passed to checkpatch
Checkpatch is a script developed to verify the style of Linux kernel
patches. As Kernel developers use emails to send patches for review,
checkpatch is prepared for that specific format. This change adapts
the Makefile to use said format.

As a result, indentation in the commit message has been removed, thus
fixing the warnings about Signed-off-by lines being preceded by
whitespace.

Fixes ARM-software/tf-issues#432

Change-Id: I00cb86365fe15f7e2c3a99a306c8eb51cf02fe86
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2016-10-27 11:09:51 +01:00
davidcunado-arm 869605abc7 Merge pull request #741 from sandrine-bailleux-arm/sb/checkpatch-signoff
Mandate 'Signed-off-by' line in commit messages
2016-10-27 09:31:29 +01:00
davidcunado-arm 6b886ea95b Merge pull request #738 from dp-arm/dp/fiptool-uuid
fiptool: Link `toc_entry` and `image` structures via UUID
2016-10-27 09:31:00 +01:00
Caesar Wang 4c127e687f rockchip: close the PD center logic during suspend
The RK3399 supports close the center logic enter power mode,
so we can close PD_CENTER to save more power during suspend.
Therefore, we need to support save/restore the DDR PHY and
controller registers during suspend/resume.

Also, need CL (http://crosreview.com/397399) to check disabling
center logic.

Change-Id: I288defd8e9caa3846d9fa663a33e4d51df1aaa5d
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-27 07:14:42 +08:00
Caesar Wang 2831bc3a5f rockchip: add support save/restore configuration for DDR during enter S3
This patch intend to support save the registers of the DDR controller
and PHY before suspend, and restore them after resume.

Change-Id: Ia10b476c0b837628ac0f365416a7118292753e96
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-27 07:14:26 +08:00
Caesar Wang f9ba21bee5 rockchip: Change dmc register accesses to ATF style for rk3399
This changes the style of dmc register accesses to be a read/write on
a base address plus a register offset instead of reinterpretting a
base address as a struct and accessing members within that struct.

Change-Id: Iead097cd6afdb830d8bc193608cd39d01ce5a6bc
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-27 01:51:07 +08:00
Caesar Wang 613038bc20 rockchip: Break out common dram code for rk3399
This renames dram.c and dram.h to dfs.c and dfs.h respectively. This
is to make room for common functionality between frequency scaling and
suspend code for the DRAM in a pair of common files named dram.c and
dram.h. It also removes a duplicate enum definition from
dram_spec_timing.h

Change-Id: Ibfa1041f8781401f9d27901fe8c61862bcb05562
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-27 01:50:57 +08:00
Caesar Wang 9c68748eaf rockchip: move pmu registers into another header for rk3399
This moves the PMU register definitions into another file for use in
later patches.

Change-Id: I8b5f1e7938b63ada6a743cf9661c3e474e96e4e4
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-27 01:50:03 +08:00
Masahiro Yamada c9cb408997 fiptool: fix Segmentation fault when only --verbose option is given
Fix the following bug:

  $ tools/fiptool/fiptool -v
  Segmentation fault (core dumped)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-10-27 00:04:17 +09:00
davidcunado-arm ad09652c41 Merge pull request #724 from rockchip-linux/support-rk3399-sdram
rockchip: optimize the link mechanism for SRAM code
2016-10-26 09:54:36 +01:00
davidcunado-arm f4d1312c8b Merge pull request #739 from rockchip-linux/fixes-latency
rockchip: fix A72 L2CTLR_DATA_RAM_LATENCY to 5
2016-10-26 09:53:34 +01:00
Caesar Wang 4ea8dc4e02 rockchip: fix A72 L2CTLR_DATA_RAM_LATENCY to 5
The default value of L2CTLR_DATA_RAM_LATENCY is 2, depends to
the test result on rk3399, the A72 will need lower voltage for
high frequency if it's set to be 5, and almost no effect on performance.

Change-Id: I99a6a43edcc0c58f7775c10f4b85669dc3eff66d
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-25 03:32:31 +08:00
Caesar Wang 7ac520067c rockchip: clear the power mode status via M0
Due to the PMU design, the PMU may not clear the WAKEUP bit after
wakeup, therefore, the state machine at the power mode may enter
the infinite loop during WFI.

There is a solution that we can use the M0 to monitor the WAKEUP
bit and clear it during power mode, then the state machine will be
recovered immediately. Then, the DUT can exit the WFI normally.

Change-Id: I303628553b728c214bf2d436bd3122032b5e669c
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-25 03:29:58 +08:00
Caesar Wang 8382e17c4c rockchip: add M0 source code and build system for RK3399
This CL supports add M0 source code to built into the bl31.bin, the
goal is that we can load the M0 code binary into SRAM and execute it.

We need the M0 help us to clean the power_mode_en bit during the AP
PMU enter the state machine with interrupt, and avoid to the AP can
not exit the loop forever.

Change-Id: I844582c54a1f0d44ca41290d44618df58679f341
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-25 03:29:42 +08:00
Caesar Wang ec6935692a rockchip: optimize the link mechanism for SRAM code
Add the common extra.ld.S and customized rk3399.ld.S to extend
to more features for different platforms.
For example, we can add SRAM section and specific address to
load there if we need it, and the common bl31.ld.S not need to
be modified.

Therefore, we can remove the unused codes which copying explicitly
from the function pmusram_prepare(). It looks like more clear.

Change-Id: Ibffa2da5e8e3d1d2fca80085ebb296ceb967fce8
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-10-25 03:28:53 +08:00
Masahiro Yamada 589b827f4b .gitignore: ignore editor backup files
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-10-25 01:21:01 +09:00
Masahiro Yamada 240b314030 Fix comment of plat_reset_handler stub
As described in the Porting Guide, plat_reset_handler should
preserve x19 to x29.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-10-25 01:21:01 +09:00
Masahiro Yamada ba21b75a80 Docs: fix a typo in Porting Guide about plat_get_my_entrypoint()
Do not double the phrase "called with the".

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-10-25 01:21:01 +09:00
Sandrine Bailleux 8c0e51ebb7 Mandate 'Signed-off-by' line in commit messages
This patch updates the configuration file for the checkpatch.pl
script to check for the presence of a 'Signed-off-by' line in the
commit message. This is now required by TF contribution process.

Change-Id: I8bcd6d39a5dcd85547244d60c10a7cd2148c404f

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2016-10-24 13:44:59 +01:00
davidcunado-arm 4f0b2e81b1 Merge pull request #740 from rockchip-linux/rk3399/fixes-cru-typo
rockchip: fixes the wrong CLKSEL_CON count for CRU
2016-10-24 12:36:03 +01:00
Caesar Wang a1dccdd61b rockchip: fixes the wrong CLKSEL_CON count for CRU
The CRU_CLKSEL_COUNT value is 108, not 0x108.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: Ib9db066b8b3ecafcee7f645dd5633b55a808e3d7
2016-10-21 11:09:59 +08:00
danh-arm 97fa6f57bf Merge pull request #677 from hzhuang1/gpt
partition: check GPT partition table
2016-10-18 16:32:57 +01:00
dp-arm b04efccece fiptool: Link `toc_entry` and `image` structures via UUID
The `toc_entry` and `image` data structures had a cyclic
relationship.  This patch removes the explicit dependencies and introduces
functions to link them via the UUID.

This change highlights the intent of the code better and makes it more
flexible for future enhancements.

Change-Id: I0c3dd7bfda2a631a3827c8ba4831849c500affe9
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
2016-10-18 10:05:12 +01:00
danh-arm e1c4274091 Merge pull request #735 from soby-mathew/sm/aarch32_sctlr
Unify SCTLR initialization for AArch32 normal world
2016-10-17 12:20:18 +01:00
danh-arm 1281a42f6f Merge pull request #734 from afaerber/make-help
Makefile: Add missing space in help output
2016-10-17 12:19:45 +01:00
danh-arm 274e84406d Merge pull request #730 from dp-arm/dp/uuid-cleanup
Remove non-standard <sys/cdefs.h> include from uuid.h
2016-10-17 12:19:34 +01:00
danh-arm 66b4542a5f Merge pull request #729 from dp-arm/dp/arm-sip
Add instrumentation support for PSCI
2016-10-17 12:19:20 +01:00
davidcunado-arm 5cab1a4a18 Merge pull request #721 from rockchip-linux/fixes-the-clock-select-and-divide-register
rockchip: fixes the clock select and divide register for rk3399
2016-10-14 12:25:06 +01:00
Soby Mathew b7b0787da8 Unify SCTLR initialization for AArch32 normal world
The values of CP15BEN, nTWI & nTWE bits in SCTLR_EL1 are architecturally
unknown if EL3 is AARCH64 whereas they reset to 1 if EL3 is AArch32. This
might be a compatibility break for legacy AArch32 normal world software if
these bits are not set to 1 when EL3 is AArch64. This patch enables the
CP15BEN, nTWI and nTWE bits in the SCTLR_EL1 if the lower non-secure EL is
AArch32. This unifies the SCTLR settings for lower non-secure EL in AArch32
mode for both AArch64 and AArch32 builds of Trusted Firmware.

Fixes ARM-software/tf-issues#428

Change-Id: I3152d1580e4869c0ea745c5bd9da765f9c254947
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2016-10-14 09:53:22 +01:00
davidcunado-arm 6bb37adc20 Merge pull request #733 from danh-arm/dh/v1.3-final
Final updates for v1.3 release
2016-10-13 17:49:06 +01:00
davidcunado-arm fd0201bc30 Merge pull request #736 from davidcunado-arm/dc/v1.3_update
Release v1.3: Minor updates to user guide
2016-10-13 17:48:29 +01:00
David Cunado 49db6f1cba Release v1.3: Minor updates to user guide
Updated the user guide to clarify building FIP for AArch32.
The instructions were previously specific to building a FIP for AArch64.

Change-Id: I7bd1a6b8e810cfda411f707e04f479006817858e
Signed-off-by: David Cunado <david.cunado@arm.com>
2016-10-13 17:45:12 +01:00
Dan Handley 3a2879450f Update readme.md for v1.3
Update the release notes (readme.md) for the ARM Trusted Firmware
v1.3 release.

Change-Id: Ia1f4eb1897e63eeab7d69a593ba0ad91d50043f5
Signed-off-by: Dan Handley <dan.handley@arm.com>
2016-10-13 15:18:11 +01:00
David Cunado d4e748f30b Release v1.3: Update minor version number to 3
Change-Id: I05991543d28e70b67be600b714990af6a8d7ba29
2016-10-13 15:17:39 +01:00
David Cunado 6ad67cc858 Release v1.3: update change-log.md
Updated change-log.md with summary of changes since release v1.2.

Change-Id: Ia1e18ff4b0da567cf12dfcb53e6317e995100bdf
2016-10-13 15:17:39 +01:00
danh-arm b314c9fa88 Merge pull request #732 from dp-arm/dp/pmf-doc
PMF: Add documentation
2016-10-12 17:17:19 +01:00
dp-arm 514a94c2dc PMF: Add documentation
Add a Performance Measurement Framework (PMF) section
to the firmware design document.

Change-Id: I5953bd3b1067501f190164c8827d2b0d8022fc0b
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
2016-10-12 17:04:16 +01:00
dp-arm 9e23f9abf5 Remove non-standard <sys/cdefs.h> include from uuid.h
This include provides nothing useful for TF and prevents building
the fiptool using musl libc[0].

[0] https://www.musl-libc.org/

Change-Id: Ied35e16b9ea2b40213433f2a8185dddc59077884
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
2016-10-12 15:37:37 +01:00
dp-arm 872be88a29 Add PMF instrumentation points in TF
In order to quantify the overall time spent in the PSCI software
implementation, an initial collection of PMF instrumentation points
has been added.

Instrumentation has been added to the following code paths:

- Entry to PSCI SMC handler.  The timestamp is captured as early
  as possible during the runtime exception and stored in memory
  before entering the PSCI SMC handler.

- Exit from PSCI SMC handler.  The timestamp is captured after
  normal return from the PSCI SMC handler or if a low power state
  was requested it is captured in the bl31 warm boot path before
  return to normal world.

- Entry to low power state.  The timestamp is captured before entry
  to a low power state which implies either standby or power down.
  As these power states are mutually exclusive, only one timestamp
  is defined to describe both.  It is possible to differentiate between
  the two power states using the PSCI STAT interface.

- Exit from low power state.  The timestamp is captured after a standby
  or power up operation has completed.

To calculate the number of cycles spent running code in Trusted Firmware
one can perform the following calculation:

(exit_psci - enter_psci) - (exit_low_pwr - enter_low_pwr).

The resulting number of cycles can be converted to time given the
frequency of the counter.

Change-Id: Ie3b8f3d16409b6703747093b3a2d5c7429ad0166
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
2016-10-12 15:36:49 +01:00