| #
e603983d |
| 04-May-2023 |
Madhukar Pappireddy <madhukar.pappireddy@arm.com> |
Merge changes from topic "allwinner_t507" into integration
* changes: feat(allwinner): add support for Allwinner T507 SoC feat(allwinner): add function to detect H616 die variant feat(allwinne
Merge changes from topic "allwinner_t507" into integration
* changes: feat(allwinner): add support for Allwinner T507 SoC feat(allwinner): add function to detect H616 die variant feat(allwinner): add extra CPU control registers refactor(allwinner): consolidate sunxi_cfg.h files
show more ...
|
| #
018c1d87 |
| 27-Mar-2023 |
Mikhail Kalashnikov <iuncuim@gmail.com> |
feat(allwinner): add support for Allwinner T507 SoC
The Allwinner T507 SoC is using the same die as the H616, but in a different package. On top of this, there is at least one different die revision
feat(allwinner): add support for Allwinner T507 SoC
The Allwinner T507 SoC is using the same die as the H616, but in a different package. On top of this, there is at least one different die revision out there, which uses a different CPU cluster control block. The same die revision has been spotted in some, but not all, H313 SoCs.
Apart from that IP block, the rest of the SoC seems the same, so we can support them using the existing H616 port. The die revision can be auto-detected, so there is no extra build option or knowledge needed.
Provide the deviating CPU power up/down sequence for the die variant. The new IP block uses per-core instead of per-cluster registers, but follows the same pattern otherwise.
Since the CPU ops code is shared among all Allwinner SoCs, we need to dummy-define the new register names for the older SoCs. The actual new code is guarded by a predicate function, that is hard coded to return true on the other SoCs. Since this is a static inline function in a header file, the compiler will optimise away the unneeded branch there, so the generated code for the other SoCs stays the same.
Change-Id: Ib5ade99d34b4ccb161ccde0e34f280ca6bd16ecd Signed-off-by: Mikhail Kalashnikov <iuncuim@gmail.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|
| #
3e0a087f |
| 04-May-2022 |
André Przywara <andre.przywara@arm.com> |
Merge changes from topic "allwinner-idle" into integration
* changes: feat(allwinner): provide CPU idle states to the rich OS feat(allwinner): simplify CPU_SUSPEND power state encoding feat(al
Merge changes from topic "allwinner-idle" into integration
* changes: feat(allwinner): provide CPU idle states to the rich OS feat(allwinner): simplify CPU_SUSPEND power state encoding feat(allwinner): choose PSCI states to avoid translation feat(fdt): add the ability to supply idle state information fix(allwinner): improve DTB patching error handling refactor(allwinner): patch the DTB after setting up PSCI refactor(allwinner): move DTB change code into allwinner/common
show more ...
|
| #
e2b18771 |
| 23-Jan-2022 |
Samuel Holland <samuel@sholland.org> |
feat(allwinner): provide CPU idle states to the rich OS
When using SCPI as the PSCI backend, firmware can wake up the CPUs and cluster from sleep, so CPU idle states are available for the rich OS to
feat(allwinner): provide CPU idle states to the rich OS
When using SCPI as the PSCI backend, firmware can wake up the CPUs and cluster from sleep, so CPU idle states are available for the rich OS to use. In that case, advertise them to the rich OS via the DTB.
Change-Id: I718ef6ef41212fe5213b11b4799613adbbe6e0eb Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| #
c36e2d48 |
| 22-Feb-2021 |
André Przywara <andre.przywara@arm.com> |
Merge changes from topic "sunxi-split-psci" into integration
* changes: allwinner: Split native and SCPI-based PSCI implementations allwinner: psci: Improve system shutdown/reset sequence allw
Merge changes from topic "sunxi-split-psci" into integration
* changes: allwinner: Split native and SCPI-based PSCI implementations allwinner: psci: Improve system shutdown/reset sequence allwinner: psci: Drop .pwr_domain_pwr_down_wfi callback allwinner: Separate code to power off self and other CPUs
show more ...
|
| #
9192f34e |
| 30-Jan-2021 |
André Przywara <andre.przywara@arm.com> |
Merge changes from topic "sunxi-split-psci" into integration
* changes: allwinner: Leave CPU power alone during BL31 setup allwinner: psci: Invert check in .validate_ns_entrypoint allwinner: p
Merge changes from topic "sunxi-split-psci" into integration
* changes: allwinner: Leave CPU power alone during BL31 setup allwinner: psci: Invert check in .validate_ns_entrypoint allwinner: psci: Drop MPIDR check from .pwr_domain_on allwinner: psci: Drop .get_node_hw_state callback
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 ...
|
| #
975d076d |
| 23-Jan-2021 |
Samuel Holland <samuel@sholland.org> |
allwinner: psci: Drop .pwr_domain_pwr_down_wfi callback
When operating on the local cpu, sunxi_cpu_power_off_self() only "arms" the ARISC to perform the power-off process; the SCP waits for the CPU
allwinner: psci: Drop .pwr_domain_pwr_down_wfi callback
When operating on the local cpu, sunxi_cpu_power_off_self() only "arms" the ARISC to perform the power-off process; the SCP waits for the CPU to enter WFI before acutally powering it off. Since this matches the expected split between .pwr_domain_off and .pwr_domain_pwr_down_wfi, we can move the sunxi_cpu_power_off_self() call to sunxi_pwr_domain_off(). Since that change makes sunxi_pwr_down_wfi() equivalent to the default implementation, the callback is no longer needed.
Change-Id: I7d65f66c550d1c69fa5e9945affd7a25b3d3ef42 Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| #
a1d349be |
| 24-Jan-2021 |
Samuel Holland <samuel@sholland.org> |
allwinner: Separate code to power off self and other CPUs
Currently, sunxi_cpu_off() has two separate code paths: one for the local CPU, and one for other CPUs. Let's split them in to two functions.
allwinner: Separate code to power off self and other CPUs
Currently, sunxi_cpu_off() has two separate code paths: one for the local CPU, and one for other CPUs. Let's split them in to two functions. This actually simplifies things, because all callers either operate on the local CPU only (sunxi_pwr_down_wfi()) or other CPUs only (sunxi_cpu_power_off_others()). This avoids needing a second MPIDR read to choose the appropriate code path.
Change-Id: I55de85025235cc95466bfa106831fc4c2368f527 Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| #
814dce8f |
| 16-Jan-2021 |
Samuel Holland <samuel@sholland.org> |
allwinner: psci: Invert check in .validate_ns_entrypoint
Checking the exceptional case and letting the success case fall through is not only more idiomatic, but it also allows adding more exceptiona
allwinner: psci: Invert check in .validate_ns_entrypoint
Checking the exceptional case and letting the success case fall through is not only more idiomatic, but it also allows adding more exceptional cases in the future, such as a check for overlapping secure DRAM.
Change-Id: I720441a6a8853fd7f211ebe851f14d921a6db03d Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| #
772ef7e7 |
| 16-Jan-2021 |
Samuel Holland <samuel@sholland.org> |
allwinner: psci: Drop MPIDR check from .pwr_domain_on
This duplicated the logic in psci_validate_mpidr() which was already called from psci_cpu_on().
Change-Id: I96ee92f1ce3e9cc2985b4e229ba86ebd27b
allwinner: psci: Drop MPIDR check from .pwr_domain_on
This duplicated the logic in psci_validate_mpidr() which was already called from psci_cpu_on().
Change-Id: I96ee92f1ce3e9cc2985b4e229ba86ebd27b79915 Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| #
a1473c99 |
| 16-Jan-2021 |
Samuel Holland <samuel@sholland.org> |
allwinner: psci: Drop .get_node_hw_state callback
This optional PSCI function was only implemented when SCPI was available. However, the underlying SCPI function is not able to fulfill the necessary
allwinner: psci: Drop .get_node_hw_state callback
This optional PSCI function was only implemented when SCPI was available. However, the underlying SCPI function is not able to fulfill the necessary contract. First, the SCPI protocol has no way to represent HW_STANDBY at the CPU power level. Second, the SCPI implementation maintains its own logical view of power states, and its implementation of SCPI_CMD_GET_CSS_POWER_STATE does not actually query the hardware. Thus it cannot provide "the physical view of power state", as required for this function by the PSCI specification.
Since the function is optional, drop it.
Change-Id: I5f3a0810ac19ddeb3c0c5d35aeb09f09a0b80c1d Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| #
c335ad48 |
| 26-Feb-2020 |
Olivier Deprez <olivier.deprez@arm.com> |
Merge "allwinner: Implement PSCI system suspend using SCPI" into integration
|
| #
e382c88e |
| 21-Oct-2018 |
Samuel Holland <samuel@sholland.org> |
allwinner: Implement PSCI system suspend using SCPI
If an SCP firmware is present and able to communicate via SCPI, then use that to implement CPU and system power state transitions, including CPU h
allwinner: Implement PSCI system suspend using SCPI
If an SCP firmware is present and able to communicate via SCPI, then use that to implement CPU and system power state transitions, including CPU hotplug and system suspend. Otherwise, fall back to the existing CPU power control implementation.
The last 16 KiB of SRAM A2 are reserved for the SCP firmware, and the SCPI shared memory is at the very end of this region (and therefore the end of SRAM A2). BL31 continues to start at the beginning of SRAM A2 (not counting the ARISC exception vector area) and fills up to the beginning of the SCP firmware.
Because the SCP firmware is not loaded adjacent to the ARISC exception vector area, the jump instructions used for exception handling cannot be included in the SCP firmware image, and must be initialized here before turning on the SCP.
Signed-off-by: Samuel Holland <samuel@sholland.org> Change-Id: I37b9b9636f94d4125230423726f3ac5e9cdb551c
show more ...
|
| #
2f3abc19 |
| 17-Dec-2019 |
Sandrine Bailleux <sandrine.bailleux@arm.com> |
Merge changes from topic "allwinner_pmic" into integration
* changes: allwinner: Convert AXP803 regulator setup code into a driver allwinner: a64: power: Use fdt_for_each_subnode allwinner: a6
Merge changes from topic "allwinner_pmic" into integration
* changes: allwinner: Convert AXP803 regulator setup code into a driver allwinner: a64: power: Use fdt_for_each_subnode allwinner: a64: power: Remove obsolete register check allwinner: a64: power: Remove duplicate DT check allwinner: Build PMIC bus drivers only in BL31 allwinner: a64: power: Make sunxi_turn_off_soc static allwinner: Merge duplicate code in sunxi_power_down allwinner: Clean up PMIC-related error handling allwinner: Synchronize PMIC enumerations allwinner: Enable clock before resetting I2C/RSB
show more ...
|
| #
818e6732 |
| 20-Oct-2019 |
Samuel Holland <samuel@sholland.org> |
allwinner: Merge duplicate code in sunxi_power_down
The action of last resort isn't going to change between SoCs. This moves that code back to the PSCI implementation, where it more obviously matche
allwinner: Merge duplicate code in sunxi_power_down
The action of last resort isn't going to change between SoCs. This moves that code back to the PSCI implementation, where it more obviously matches the code in sunxi_system_reset().
The two error messages say essentially the same thing anyway.
Signed-off-by: Samuel Holland <samuel@sholland.org> Change-Id: I62ac35fdb5ed78a016e9b18281416f1dcea38a4a
show more ...
|
| #
d697f9b8 |
| 29-Apr-2019 |
Antonio Niño Díaz <antonio.ninodiaz@arm.com> |
Merge "plat: allwinner: common: use r_wdog instead of wdog" into integration
|
| #
523ab5be |
| 08-Apr-2019 |
Clément Péron <peron.clem@gmail.com> |
plat: allwinner: common: use r_wdog instead of wdog
Some Allwinner H6 has a broken watchdog that doesn't make the soc reboot.
Use the R_WATCHDOG instead.
Signed-off-by: Clément Péron <peron.clem@g
plat: allwinner: common: use r_wdog instead of wdog
Some Allwinner H6 has a broken watchdog that doesn't make the soc reboot.
Use the R_WATCHDOG instead.
Signed-off-by: Clément Péron <peron.clem@gmail.com> Change-Id: Ie95cc30a80ed517b60b30d6bc2e655a1b53f18ba
show more ...
|
| #
65954be7 |
| 27-Feb-2019 |
Antonio Niño Díaz <antonio.ninodiaz@arm.com> |
Merge pull request #1826 from smaeul/allwinner
allwinner: A few minor improvements
|
| #
5d4bd66d |
| 17-Feb-2019 |
Samuel Holland <samuel@sholland.org> |
allwinner: Clean up CPU ops functions
Convert them to take an mpidr instead of a (cluster, core) pair. This simplifies all of the call sites, and actually makes the functions a bit smaller.
Signed-
allwinner: Clean up CPU ops functions
Convert them to take an mpidr instead of a (cluster, core) pair. This simplifies all of the call sites, and actually makes the functions a bit smaller.
Signed-off-by: Samuel Holland <samuel@sholland.org>
show more ...
|
| #
9a207532 |
| 04-Jan-2019 |
Antonio Niño Díaz <antonio.ninodiaz@arm.com> |
Merge pull request #1726 from antonio-nino-diaz-arm/an/includes
Sanitise includes across codebase
|
| #
09d40e0e |
| 14-Dec-2018 |
Antonio Nino Diaz <antonio.ninodiaz@arm.com> |
Sanitise includes across codebase
Enforce full include path for includes. Deprecate old paths.
The following folders inside include/lib have been left unchanged:
- include/lib/cpus/${ARCH} - inclu
Sanitise includes across codebase
Enforce full include path for includes. Deprecate old paths.
The following folders inside include/lib have been left unchanged:
- include/lib/cpus/${ARCH} - include/lib/el3_runtime/${ARCH}
The reason for this change is that having a global namespace for includes isn't a good idea. It defeats one of the advantages of having folders and it introduces problems that are sometimes subtle (because you may not know the header you are actually including if there are two of them).
For example, this patch had to be created because two headers were called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems: 46f9b2c3a282 ("drivers: add tzc380 support").
This problem was introduced in commit 4ecca33988b9 ("Move include and source files to logical locations"). At that time, there weren't too many headers so it wasn't a real issue. However, time has shown that this creates problems.
Platforms that want to preserve the way they include headers may add the removed paths to PLAT_INCLUDES, but this is discouraged.
Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
show more ...
|
| #
318c2f97 |
| 31-Oct-2018 |
Antonio Niño Díaz <antonio.ninodiaz@arm.com> |
Merge pull request #1646 from Andre-ARM/allwinner/pmic-v2
Allwinner/pmic v2
|
| #
7db0c960 |
| 27-Sep-2018 |
Andre Przywara <andre.przywara@arm.com> |
allwinner: Use the arisc to turn off ARM cores
PSCI requires a core to turn itself off, which we can't do properly by just executing an algorithm on that very core. As a consequence we just put a co
allwinner: Use the arisc to turn off ARM cores
PSCI requires a core to turn itself off, which we can't do properly by just executing an algorithm on that very core. As a consequence we just put a core into WFI on CPU_OFF right now. To fix this let's task the "arisc" management processor (an OpenRISC core) with that task of asserting reset and turning off the core's power domain. We use a handcrafted sequence of OpenRISC instructions to achieve this, and hand this data over to the new sunxi_execute_arisc_code() routine. The commented source code for this routine is provided in a separate file, but the ATF code contains the already encoded instructions as data. The H6 uses the same algorithm, but differs in the MMIO addresses, so provide a SoC (family) specific copy of that code.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
show more ...
|