Commit Graph

1536 Commits

Author SHA1 Message Date
Douglas Raillard 71b3747d12 readme.md: Add tested Linaro release information for FVPs
The platform testing information in the readme currently states which
Linaro release has been tested on Juno platform.

This patch adds the same information for the AArch64/32 FVPs platforms.

Change-Id: Ifa89843ee1744e5030367197648b7a2f4c44cc24
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
2016-11-09 13:18:36 +00:00
danh-arm 90d2956aea Merge pull request #752 from rockchip-linux/rk3399/fixes-s2r-1107
rk3399: fixes and updates for s2r
2016-11-08 12:17:44 +00:00
danh-arm f61bf2c73c Merge pull request #751 from jeenu-arm/ug-reorder
Alphabetical reordering for build options and make files
2016-11-08 11:30:31 +00:00
danh-arm 375d845708 Merge pull request #750 from jwerner-chromium/m0_build
RK3399 M0 build system improvements
2016-11-08 11:29:43 +00:00
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
Caesar Wang 06077161e9 rockchip: remove no needed code for rk3399
We have do something for clocks gate.

Fox example as the below:
susped:
clk_gate_con_save();
clk_gate_con_disable();

resume:
clk_gate_con_restore();
--

SO, add the plls_suspend_prepare() and plls_resume_finish() are not
necessary to S2R, that will save S2R time if remove them.

BRANCH=none
BUG=chrome-os-partner:58870,chrome-os-partner:55934
TEST=build kevin, two dogfooders with suspend_stress_test
passing 3000 cycles and still going on.

Change-Id: Icfbabc0b3ea8d2b5108d4f3de99a803b6d459669
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-11-07 19:57:34 +08:00
Caesar Wang a14e091621 rockchip: disable watchdog during suspend
The CA53 and CM0 WDT clock gating in rk3399 SGRF, and ATF is in charge of
it because the kernel can't touch SGRF.

Basically the WDT didn't stop at suspend time, it just switched from the
24M to the 32k clock. That meant that the WDT would fire if you slept for
long enough. In other word, the watchdog timer over count will increase to
750 (24*1000/32) times.
The RK3399 HW watchdog interval is 21 seconds. When machine enters the
suspend, the watchdog will reset the system after 35.7 (750/21) hours.

BUG=chrome-os-partner:59257
TEST=daisydog checked and set value, powerd_dbus_suspend to verify.

Change-Id: I88bb2a05b7d67d5ffd292f9d05d033ae9a6a3593
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-11-07 19:57:17 +08:00
Julius Werner 71581c9c17 rockchip: Add proper dependency tracking to M0 Makefile
This patch adds dependency rule generation and inclusion to the M0
Makefile, so that M0 objects will get correctly remade with an
incremental build if a header file they included changed.

Change-Id: I2067bd9fd4d9dad3e77a09cbf09c7b4db3c1eda5
Signed-off-by: Julius Werner <jwerner@chromium.org>
2016-11-03 14:57:11 -07:00
Julius Werner e77ade2887 rockchip: Clean up parent directory creation for M0
The dependencies in the M0 Makefile are not correctly laid out, which
may lead to errors with make -j if the binary target gets evaluated
before the target that creates the directory. In addition, the M0
Makefile just calls mkdir without using the platform-independent macros
from the main ARM TF build system. This patch fixes those issues,
removes some unused (and broken) M0 build targets and merges the two M0
output directories into one (since there's no real point splitting it up
and it creates more hassle).

Change-Id: Ia5002479cf9c57fea7aefa8ca88e373df3a51f61
Signed-off-by: Julius Werner <jwerner@chromium.org>
2016-11-03 14:57:10 -07: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