9741 Commits

Author SHA1 Message Date
CTCaer
ed2ef6bed9 Tegra: add extra definitions for bpmp MRQs and PM
Some are not used anymore.
2024-07-12 12:58:54 +03:00
CTCaer
963c5bce91 Tegra210: map IRAM and SE2/PKA1 with 2MB range
Map both SE2 and IRAM regions with 2MB range in order to save 8KB from
xlat tables by moving to a level 2 mapping.
The SE2 mapping has also the good side-effect of allowing access to PKA1.
2024-07-12 12:57:09 +03:00
CTCaer
38fb8a1fa6 Tegra: fix security issue when tzram is used
If TZRAM is used for BL31 base the code was never locking access to it from
non-TZ clients.

Correct that for T210/T210b01/T186/T194 platforms by actually enabling the
TZRAM security in SE tzram security register.
2024-07-12 12:52:28 +03:00
CTCaer
8f516fd264 Tegra: correct tzdram mapping when tzram is used
TZDRAM is never hardcoded and also can be bigger than 256KB.
Additionally check if it is actually enabled before trying mapping it.
(mmap_add_region only checks if size != 0)
2024-07-12 12:47:31 +03:00
CTCaer
1ff879e0dd Tegra210: change r2p/sc7 to static mapping
Move r2p/sc7 firmware before enabling mmu so static mapping is possible.
2024-07-12 12:41:06 +03:00
CTCaer
f9bc9c0b1e Tegra: allow building with static xlat tables 2024-07-12 12:39:33 +03:00
CTCaer
1f30220f9f xlat_tables_v2: fix building with max logging 2024-07-12 12:36:47 +03:00
CTCaer
cf2efc0e5b bl31: store base address for bootloader use
Make the first op a jump to actual entrypoint and put base address in-between
for bootloader usage.

Bootloader can check second 32bit value if it matches 0x43424550 and decide to
use the next 64bit value as base address for BL31.
2024-07-12 12:23:43 +03:00
CTCaer
8902c539ce Tegra210: switch to new r2p smc command
Additionally simplify checks in platform setup.
2022-11-04 15:32:37 +00:00
CTCaer
45110f9628 Tegra210: unsecure reset vectors before handover to BPMP-FW 2022-08-17 22:38:43 +00:00
CTCaer
cc19b2a38b Tegra210: restrict real r2p to T210 only
The T210B01 method relies on normal reboot.
2022-08-17 22:38:06 +00:00
CTCaer
8817afcc78 Tegra210: lift sc7exit placement restrictions
Allow sc7exit to not be in tzdram and in non-secure or protected carveout region.

Additionally, simplify platform checks for configuration.
2022-08-17 22:35:18 +00:00
CTCaer
b37f279509 Tegra210: return error on non-supported new SMC calls 2022-08-17 22:31:34 +00:00
CTCaer
037ee61b0e Tegra: convert pmc security param to a flag
Use a bitfield parameter instead for supporting additional board customization.
2022-08-17 22:29:56 +00:00
CTCaer
c7d6494238 Tegra210: fix compilation without asserts 2022-08-17 22:19:32 +00:00
CTCaer
d2798c3739 Tegra: sanitize plat params
In case extra features are not enabled, zero them out.
Additionally if firmware size is zero, clear out base also.
2022-08-17 22:15:12 +00:00
CTCaer
1f58bd3265 Tegra210: allow r2p with bpmp-fw 2022-08-05 11:09:44 +00:00
CTCaer
b6b29d7ccf Tegra210: r2p support
Improvements over previous version:
- Support preloaded payload from bootloader
- Make sure there's always a payload if R2P happens
- Always do R2P except if RCM is selected
- Allows R2P in any context before userspace is loaded
Signed-off-by: Ezekiel Bethel <zek@9net.org>
Signed-off-by: CTCaer <ctcaer@gmail.com>
2022-02-05 09:55:25 +00:00
CTCaer
253c10ff02 Tegra210: support for unsecured PMC access
In some boards, unrestricted access to PMC from userspace is wanted for debug purposes.
Allow bootloader to set that on ATF.
2022-02-05 09:47:10 +00:00
CTCaer
68e1a91e67 Tegra210: support for getting EMC table via SMC 2022-02-05 09:40:11 +00:00
CTCaer
c2c35f9e4d Tegra210: Force bpmp-fw/sc7entry identification on soc power down
This allows non-tlk targets to prepare a suspend using SC7entry/exit firmware without bpmp-fw path messing with the setup.
It additionally writes the proper pmic type to pmc and enables uart console in case userspace disabled uart, which could result in a hang.
2021-12-12 23:23:49 +00:00
CTCaer
fed68ae864 Tegra210: correct bpmp-fw check 2021-12-12 23:16:52 +00:00
CTCaer
7a140de7ee Tegra: allow fetching bl31 plat params on coldboot
On coldboot ATF boards, parameters need to be passed over from bootloader.
Allow that by using PMC secure scratch registers to pass the parameters address.
2021-12-12 23:08:02 +00:00
CTCaer
956c68dadb Tegra210: secure actual cpu reset vectors
Always secure CPU reset vectors on boot and resume and unsecure them on suspend.
2021-12-12 22:54:08 +00:00
CTCaer
281b2dbf5f Tegra: do not try to map profiler if it's disabled 2021-12-12 22:46:48 +00:00
CTCaer
77834b6de6 Tegra: init console on resume
Try to initialize console on resume if enabled, in order to not depend on warmboot firmware.
2021-12-12 22:42:58 +00:00
CTCaer
af029003bd Tegra210: init uart pins and clock when enabling console
This allows ATF to initialize console no matter what other components did.
In cases where something else disabled or didn't initialize UART, it will not hang the whole system.
2021-12-12 22:38:11 +00:00
CTCaer
92830c31ee Tegra210: always enable system counter
On coldboot ATF boards, bootloader can't enable the system counter because it's TZ protected.

So enable it unconditionally.
2021-12-12 22:30:21 +00:00
CTCaer
04eba13797 Tegra210: se: use PLLP for suspend/resume
PLLP is always on like CLK_M. Use that to speed up the sleep/wake process.
2021-12-12 22:12:26 +00:00
CTCaer
8a45a14eb2 Tegra210: se: commit register writes before polling op complete
This fixes a race condition that produces a hang or timeout on boards that coldboot or enter suspend with high CPU/RAM frequency.

It also fixes context save/restore on such boards
2021-12-12 22:11:06 +00:00
Manish Pandey
a1f02f4f3d Merge "docs(changelog): generate changelog" into integration 2021-11-23 14:14:26 +01:00
Manish V Badarkhe
63d2e96042 docs(changelog): generate changelog
For future reference, this changelog was generated with the following
command:

    npm run release -- --skip.commit --skip.tag --release-as 2.6.0

Change-Id: Idf6be5c3be15ddfdb1d32fafb9e0e4b399b269f3
Signed-off-by: Chris Kay <chris.kay@arm.com>
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-11-22 23:08:12 +00:00
Olivier Deprez
f92b00187a Merge "docs(ff-a): update documentation of FF-A interfaces" into integration 2021-11-22 18:38:07 +01:00
Manish Pandey
5d26e27abc Merge changes from topic "ck/changelog" into integration
* changes:
  docs(changelog): categorize scopes
  docs(commit-style): add commit style documentation
  build(docs): introduce release script
  build(docs): add support for Markdown documentation
  build(hooks): add commitlint checks for trailers
  build(npm): add Standard Version v9.3.2
  build(npm): add additional package metadata
  build(npm): add license field
  build(npm): update Husky to v7.0.4
  build(npm): update commitlint to v14.1.0
  build(npm): update lockfile format to v2
  docs(prerequisites): update to Node.js v16
  build(docs): update Python dependencies
  build(docs): pin Python dependencies
2021-11-18 16:00:01 +01:00
J-Alves
16c1c45326 docs(ff-a): update documentation of FF-A interfaces
- Overview of FF-A v1.1 notifications feature, and list of all
the new related interface.
- FFA_RXTX_UNMAP now implemented, so provided description.
- FF-A v1.1 interfaces documented: FFA_SPM_ID_GET and
FFA_SECONDARY_EP_REGISTER.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: If40b4d2b2473f81ecfb2ddbf14852c3f10682867
2021-11-18 14:41:28 +00:00
Manish Pandey
7300434afc Merge "fix(drivers/gic600ae_fmu): fix timeout calculation" into integration 2021-11-18 15:25:14 +01:00
Manish Pandey
b3e2b6e715 Merge "fix(docs): fix FF-A substitution" into integration 2021-11-18 14:07:08 +01:00
anzhou
7f322f228e fix(drivers/gic600ae_fmu): fix timeout calculation
The previous codes were using the cntpct_el0 to check the time
elapsed. But this physical timer does not seem to count for
the expected time resulting in gic fmu communication failures
on Tegra platforms.

This patch uses the delay_timer instead to use a platform
defined timer for calculating timeouts.

Change-Id: Ic8646ad1662c9928ac64c4152deb27e8c86fe344
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2021-11-18 13:36:50 +02:00
Sandrine Bailleux
c0db39cefc Merge "fix(plat/arm): fix a VERBOSE trace" into integration 2021-11-18 10:28:20 +01:00
Chris Kay
953910b06a docs(changelog): categorize scopes
This change makes a best-effort attempt to categorize the various
Conventional Commits scopes that have been used over the past year into
their relevant changelog sections. No scopes were formalized for the
v2.5 release so it varies dramatically, but the output does not look
totally awful. Nonetheless, it will need some manual tweaking.

For every section with one or more potential scopes, the first scope
represents the "blessed" scope. That is, the scope that new commits that
belong to this category should use.

Change-Id: I8b5594a62238c4f392dc71b187e73c3da988e443
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:37 +00:00
Chris Kay
7d3b519372 docs(commit-style): add commit style documentation
This change adds a new documentation page describing the commit style,
acceptable Conventional Commits types and scopes, and documents the
process for expanding the list of scopes.

Change-Id: Iad957b67fa71a879e8aa0790c58a5b08cec300d6
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:37 +00:00
Chris Kay
c4e8edab21 build(docs): introduce release script
This change introduces a new NPM run script to automatically generate
the release changelog, as well as bump version numbers across the
code-base and create the release tag.

This script runs [Standard Version] to execute this, which is a tool
designed around automating substantial parts of the release process.
This can be done by running:

    npm run release -- [<standard-version args>]

Standard Version expects the project to adhere to the [Semantic
Versioning] convention which TF-A does not, so you may need to specify
the version manually, e.g.:

    npm run release -- --release-as 2.6.0

Individual steps of the release process may also be skipped at-will,
which may be necessary when, for example, tweaking the changelog:

    npm run release -- --skip.commit --skip.tag

Standard Version is configured by the `.versionrc.js` file, which
contains information about the Conventional Commits types and scopes
used by the project, and how they map to the changelog.

To maintain continuity with the existing changelog style - at least to
the extent possible in the move from manual to automatic creation - a
customized changelog template has been introduced, based on the
Conventional Commits template provided by Standard Version.

This template package extends the Conventional Commits template package
by introducing support for parsing the Conventional Commits scopes into
changelog sections, similarly to how they were previously organized.

[Standard Version]:
https://github.com/conventional-changelog/standard-version
[Semantic Versioning]: https://semver.org

Change-Id: I5bafa512daedc631baae951651c38c1c62046b0a
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:37 +00:00
Chris Kay
c76556a017 build(docs): add support for Markdown documentation
This changes adds support for building Markdown documentation into
Sphinx with [MyST]. We'll make use of this in a later patch, where we
introduce automatically-generated Markdown documentation that needs to
be compiled as part of the Sphinx documentation.

[MyST]: https://myst-parser.readthedocs.io/en/latest

Change-Id: I2a241a588c579fac1a81e1853479908928be1fc8
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:36 +00:00
Chris Kay
fa3a13824a build(hooks): add commitlint checks for trailers
This change adds checks for the `Change-Id` and `Signed-off-by`
trailers. These are already required by Gerrit, so they have been
configured as warnings as an early heads-up after committing without
needing to push.

This also renames the commitlint configuration file to align it with
the style used by Standard Version when it's eventually introduced:

    `commitlint.config.js` -> `.commitlintrc.js`

Change-Id: I4e3c158e6b3a5407fabd873360d5efce86ebd19e
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:36 +00:00
Chris Kay
dc59d726e7 build(npm): add Standard Version v9.3.2
This tool is used to generate changelogs, tag repositories and bump
version numbers across the code-base. In preparation for the v2.6.0
release of TF-A, we will be incorporating it into our release workflow,
with the hope that it can reduce some of the workload involved going
forward.

After this change our dependency license situation is as follows:

```
$ license-checker --summary
├─ MIT: 249
├─ ISC: 43
├─ Apache-2.0: 6
├─ BSD-2-Clause: 3
├─ (MIT OR CC0-1.0): 3
├─ BSD-3-Clause: 2
├─ 0BSD: 2
├─ (MIT OR Apache-2.0): 1
├─ BSD*: 1
├─ CC-BY-3.0: 1
└─ CC0-1.0: 1
```

Change-Id: Ie41443045ecff22f322d155a4bed8ab5d92208cd
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:36 +00:00
Chris Kay
3a43e6dee4 build(npm): add additional package metadata
Introduces the `name` and `version` fields to the NPM package metadata
file, which are used by Standard Version.

Change-Id: I5266465f746bf29805f36cd94b5e5c20417d7fd0
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:36 +00:00
Chris Kay
6558d8e452 build(npm): add license field
This change adds the `license` field to our `package.json` file, which
allows some license checking tools to analyze our dependencies for
license incompatibilities.

The current state of our licensed dependencies is as follows:

```
$ license-checker --summary
├─ MIT: 198
├─ ISC: 31
├─ Apache-2.0: 5
├─ (MIT OR CC0-1.0): 3
├─ BSD-3-Clause: 2
├─ BSD-2-Clause: 2
├─ 0BSD: 2
├─ (MIT OR Apache-2.0): 1
├─ CC-BY-3.0: 1
└─ CC0-1.0: 1
```

Change-Id: I7b9dae1c9f732c7f7491b5d6557dd193b894d70c
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:36 +00:00
Chris Kay
3ea076e2e0 build(npm): update Husky to v7.0.4
Change-Id: I708ac9af9311c23b107041b3fc7f1773a83b36c4
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:35 +00:00
Chris Kay
67b29a0861 build(npm): update commitlint to v14.1.0
Change-Id: Ied1362e9bac4121fd1512e7dbd847b70458f7b98
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:35 +00:00
Chris Kay
b0ea465344 build(npm): update lockfile format to v2
NPM v7, which is included with Node.js v16, uses version 2 of the
lockfile format. To avoid its complaints about the old lockfile version,
we're updating the lockfile. This change is backwards-compatible with
older versions of NPM.

Change-Id: I411ec29ea60ef9a616b99ddb52243fac2b305d28
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-11-17 16:04:35 +00:00