| 159c36fd | 19-Mar-2021 |
Samuel Holland <samuel@sholland.org> |
feat(allwinner): choose PSCI states to avoid translation
Aligning the PSCI and SCPI power states avoids some code to translate between the two. This also makes room for an intermediate power state,
feat(allwinner): choose PSCI states to avoid translation
Aligning the PSCI and SCPI power states avoids some code to translate between the two. This also makes room for an intermediate power state, for future firmware capability growth.
Change-Id: I26691085f277a96bd405e3305ab0fe390a92b418 Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| 79808f10 | 23-Jan-2022 |
Samuel Holland <samuel@sholland.org> |
fix(allwinner): improve DTB patching error handling
Currently, if any step of the DTB patching process fails, the whole process is aborted. However, this causes some problems: - If any step modifie
fix(allwinner): improve DTB patching error handling
Currently, if any step of the DTB patching process fails, the whole process is aborted. However, this causes some problems: - If any step modifies the DTB (including fdt_open_into), the dcache must still be cleaned, even if some later step fails. - The DTB may need changes in multiple places; if one patch fails (for example due to missing nodes), we should still apply other patches. - Similarly, if some patch fails, we should still run fdt_pack to clean up after ourselves.
Change-Id: If1af2e58e5a7edaf542354bb8a261dd1c3da1ad0 Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| 3ccccc65 | 23-Jan-2022 |
Samuel Holland <samuel@sholland.org> |
refactor(allwinner): patch the DTB after setting up PSCI
Idle states are advertised to the rich OS by declaring them in the DTB. Since the availability of idle states depends on which PSCI implement
refactor(allwinner): patch the DTB after setting up PSCI
Idle states are advertised to the rich OS by declaring them in the DTB. Since the availability of idle states depends on which PSCI implementation was chosen, the DTB must be updated after PSCI setup.
Move this operation to bl31_plat_runtime_setup, the platform hook which happens at the right time. Defining this hook overrides the weak definition from plat/common, so copy over the code from there, too.
Change-Id: I42a83edb9cb28e1803d17dc2d73dbc879d885222 Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| 13bacd3b | 22-Jul-2021 |
Icenowy Zheng <icenowy@sipeed.com> |
feat(plat/allwinner): add R329 support
Allwinner R329 is a new dual-core Corte-A53 SoC. Add basical TF-A support for it, to provide a PSCI implementation containing CPU boot/shutdown and SoC reset.
feat(plat/allwinner): add R329 support
Allwinner R329 is a new dual-core Corte-A53 SoC. Add basical TF-A support for it, to provide a PSCI implementation containing CPU boot/shutdown and SoC reset.
Change-Id: I0fa37ee9b4a8e0e1137bf7cf7d614b6ca9624bfe Signed-off-by: Icenowy Zheng <icenowy@sipeed.com>
show more ...
|
| 080939f9 | 22-Jul-2021 |
Icenowy Zheng <icenowy@sipeed.com> |
refactor(plat/allwinner): allow new AA64nAA32 position
In newer Allwiner SoCs, the AA64nAA32 wires are mapped to a new register called "General Control Register0" in the manual rather than the "Clus
refactor(plat/allwinner): allow new AA64nAA32 position
In newer Allwiner SoCs, the AA64nAA32 wires are mapped to a new register called "General Control Register0" in the manual rather than the "Cluster 0 Control Register0" in older SoCs.
Now the position of AA64nAA32 (reg and bit offset) is defined in a few macros instead assumed to be at bit offset 24 of SUNXI_CPUCFG_CLS_CTRL_REG0.
Change-Id: I933d00b9a914bf7103e3a9dadbc6d7be1a409668 Signed-off-by: Icenowy Zheng <icenowy@sipeed.com>
show more ...
|
| 0e54a789 | 04-Apr-2021 |
Samuel Holland <samuel@sholland.org> |
refactor(plat/allwinner): clean up platform definitions
Group the SCP base/size definitions in a more logical location.
Signed-off-by: Samuel Holland <samuel@sholland.org> Change-Id: Id43f9b468d7d8
refactor(plat/allwinner): clean up platform definitions
Group the SCP base/size definitions in a more logical location.
Signed-off-by: Samuel Holland <samuel@sholland.org> Change-Id: Id43f9b468d7d855a2413173d674a5ee666527808
show more ...
|
| 8d9efdf8 | 14-Dec-2020 |
Samuel Holland <samuel@sholland.org> |
refactor(plat/allwinner): do not map BL32 DRAM at EL3
BL31 does not appear to ever access the DRAM allocated to BL32, so there is no need to map it at EL3.
Signed-off-by: Samuel Holland <samuel@sho
refactor(plat/allwinner): do not map BL32 DRAM at EL3
BL31 does not appear to ever access the DRAM allocated to BL32, so there is no need to map it at EL3.
Signed-off-by: Samuel Holland <samuel@sholland.org> Change-Id: Ie8727b793e53ea14517894942266f6da0333eb74
show more ...
|
| ab74206b | 14-Dec-2020 |
Samuel Holland <samuel@sholland.org> |
refactor(plat/allwinner): map SRAM as device memory by default
The SRAM on Allwinner platforms is shared between BL31 and coprocessor firmware. Previously, SRAM was mapped as normal memory by defaul
refactor(plat/allwinner): map SRAM as device memory by default
The SRAM on Allwinner platforms is shared between BL31 and coprocessor firmware. Previously, SRAM was mapped as normal memory by default. This scheme requires carveouts and cache maintenance code for proper synchronization with the coprocessor.
A better scheme is to only map pages owned by BL31 as normal memory, and leave everything else as device memory. This removes the need for cache maintenance, and it makes the mapping for BL31 RW data explicit instead of magic.
Signed-off-by: Samuel Holland <samuel@sholland.org> Change-Id: I820ddeba2dfa2396361c2322308c0db51b55c348
show more ...
|
| 0be10ee3 | 14-Dec-2020 |
Andre Przywara <andre.przywara@arm.com> |
allwinner: H616: Add reserved-memory node to DT
When the BL31 for the Allwinner H616 runs in DRAM, we need to make sure we tell the non-secure world about the memory region it uses.
Add a reserved-
allwinner: H616: Add reserved-memory node to DT
When the BL31 for the Allwinner H616 runs in DRAM, we need to make sure we tell the non-secure world about the memory region it uses.
Add a reserved-memory node to the DT, which covers the area that BL31 could occupy. The "no-map" property will prevent OSes from mapping the area, so there would be no speculative accesses.
Change-Id: I808f3e1a8089da53bbe4fc6435a808e9159831e1 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| 26123ca3 | 28-Nov-2020 |
Andre Przywara <andre.przywara@arm.com> |
allwinner: Add Allwinner H616 SoC support
The new Allwinner H616 SoC lacks the management controller and the secure SRAM A2, so we need to tweak the memory map quite substantially: We run BL31 in DR
allwinner: Add Allwinner H616 SoC support
The new Allwinner H616 SoC lacks the management controller and the secure SRAM A2, so we need to tweak the memory map quite substantially: We run BL31 in DRAM. Since the DRAM starts at 1GB, we cannot use our compressed virtual address space (max 256MB) anymore, so we revert to the full 32bit VA space and use a flat mapping throughout all of it.
The missing controller also means we need to always use the native PSCI ops, using the CPUIDLE hardware, as SCPI and suspend depend on the ARISC.
Change-Id: I77169b452cb7f5dc2ef734f3fc6e5d931749141d Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| 01cec8f4 | 28-Nov-2020 |
Andre Przywara <andre.przywara@arm.com> |
allwinner: Express memmap more dynamically
In preparation for changing the memory map, express the locations of the various code and data pieces more dynamically, allowing SoCs to override the memma
allwinner: Express memmap more dynamically
In preparation for changing the memory map, express the locations of the various code and data pieces more dynamically, allowing SoCs to override the memmap later. Also prepare for the SCP region to become optional.
No functional change.
Change-Id: I7ac01e309be2f23bde2ac2050d8d5b5e3d6efea2 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| 9227719d | 14-Feb-2021 |
Andre Przywara <andre.przywara@arm.com> |
allwinner: Move sunxi_cpu_power_off_self() into platforms
The code to power the current core off when SCPI is not available is now different for the two supported SoC families. To make adding new pl
allwinner: Move sunxi_cpu_power_off_self() into platforms
The code to power the current core off when SCPI is not available is now different for the two supported SoC families. To make adding new platforms easier, move sunxi_cpu_power_off_self() into the SoC directory, so we don't need to carry definitions for both methods for all SoCs.
On the H6 we just need to trigger the CPUIDLE hardware, so can get rid of all the code to program the ARISC, which is now only needed for the A64 version.
Change-Id: Id2a1ac7dcb375e2fd021b441575ce86b4d7edf2c Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| eb15bdaa | 15-Feb-2021 |
Andre Przywara <andre.przywara@arm.com> |
allwinner: Move SEPARATE_NOBITS_REGION to platforms
For the existing SoCs we support, we use SEPARATE_NOBITS_REGION, to move some parts of the data into separate memory regions (to save on the SRAM
allwinner: Move SEPARATE_NOBITS_REGION to platforms
For the existing SoCs we support, we use SEPARATE_NOBITS_REGION, to move some parts of the data into separate memory regions (to save on the SRAM A2 we are loaded into). For the upcoming H616 platform this is of no concern (we run in DRAM), so make this flag a platform choice instead.
Change-Id: Ic01d49578c6274660f8f112bd23680d3eca3be7a Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| b23ab8eb | 20-Jan-2021 |
Andre Przywara <andre.przywara@arm.com> |
allwinner: Allow conditional compilation of SCPI and native PSCI ops
Now that we have split the native and the SCPI version of the PSCI ops, we can introduce build options to compile in either or bo
allwinner: Allow conditional compilation of SCPI and native PSCI ops
Now that we have split the native and the SCPI version of the PSCI ops, we can introduce build options to compile in either or both of them.
If one version is not compiled in, some stub functions make sure the common code still compiles and makes the right decisions.
By default both version are enabled (as before), but one of them can be disabled on the make command line, or via a platform specific Makefile.
Change-Id: I0c019d8700c0208365eacf57809fb8bc608eb9c0 Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| fe753c97 | 16-Jan-2021 |
Samuel Holland <samuel@sholland.org> |
allwinner: Split native and SCPI-based PSCI implementations
In order to keep SCP firmware as optional, the original, limited native PSCI implementation was kept around as a fallback. This turned out
allwinner: Split native and SCPI-based PSCI implementations
In order to keep SCP firmware as optional, the original, limited native PSCI implementation was kept around as a fallback. This turned out to be a good decision, as some newer SoCs omit the ARISC, and thus cannot run SCP firmware.
However, keeping the two implementations in one file makes things unnecessarily messy. First, it is difficult to compile out the SCPI-based implementation where it is not applicable. Second the check is done in each callback, while scpi_available is only updated at boot. This makes the individual callbacks unnecessarily complicated.
It is cleaner to provide two entirely separate implementations in two separate files. The native implementation does not support any kind of CPU suspend, so its callbacks are greatly simplified. One function, sunxi_validate_ns_entrypoint, is shared between the two implementations.
Finally, the logic for choosing between implementations is kept in a third file, to provide for platforms where only one implementation is applicable and the other is compiled out.
Change-Id: I4914f07d8e693dbce218e0e2394bef15c42945f8 Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| dae98b3a | 16-Jan-2021 |
Samuel Holland <samuel@sholland.org> |
allwinner: psci: Improve system shutdown/reset sequence
- When the SCPI shutdown/reset command returns success, the SCP is still waiting for the CPU to enter WFI. Do that. - Peform board-level pow
allwinner: psci: Improve system shutdown/reset sequence
- When the SCPI shutdown/reset command returns success, the SCP is still waiting for the CPU to enter WFI. Do that. - Peform board-level poweroff before CPU poweroff. If there is a PMIC available, it will turn everything off including the CPUs, so doing CPU poweroff first is a waste of cycles. - During poweroff, attempt to turn off the local CPU using the ARISC. This should use slightly less power than just an infinite WFI. - Drop the WFI in the reset failure path. The panic will hang anyway.
Change-Id: I897efecb3fe4e77a56041b97dd273156ec51ef8e Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|