[PATCH v6 0/4] arm64: meson: add support for A1 Power Domains

From: Jianxin Pan
Date: Wed Jan 15 2020 - 06:30:38 EST


This patchset introduces a "Secure Power Doamin Controller". In A1/C1, power
controller registers such as PWRCTRL_FOCRSTN, PWRCTRL_PWR_OFF, PWRCTRL_MEM_PD
and PWRCTRL_ISO_EN, are in the secure domain, and should be accessed from ATF
by smc.

The secure-pwrc will not be probed before the secure watchdog patchset is merged
at [6], which adds of_platform_default_populate() in meson_sm_probe().

Changes since v5 at [4]:
- Move sec-pwrc to child node of secure-monitor according to Rob's suggestion
at [5]

Changes since v4 at [3]:
- add SM_A1_ prefix for PWRC_SET/GET
- rename variable and update comments

Changes since v3 at [2]:
- remove phandle to secure-monitor node

Changes since v2 at [1]:
- update domain id
- include dt-bindings in dts

Changes since v1 at [0]:
- use APIs from sm driver
- rename pwrc_secure_get_power as Kevin suggested
- add comments for always on domains
- replace arch_initcall_sync with builtin_platform_driver
- fix coding style

[0] https://lore.kernel.org/linux-amlogic/1568895064-4116-1-git-send-email-jianxin.pan@xxxxxxxxxxx
[1] https://lore.kernel.org/linux-amlogic/1570695678-42623-1-git-send-email-jianxin.pan@xxxxxxxxxxx
[2] https://lore.kernel.org/linux-amlogic/1571391167-79679-1-git-send-email-jianxin.pan@xxxxxxxxxxx
[3] https://lore.kernel.org/linux-amlogic/1572868028-73076-1-git-send-email-jianxin.pan@xxxxxxxxxxx
[4] https://lore.kernel.org/linux-amlogic/1573532930-39505-2-git-send-email-jianxin.pan@xxxxxxxxxxx
[5] https://lore.kernel.org/linux-amlogic/07f0ed9d-0b1a-d84f-de8b-1967e56bbd21@xxxxxxxxxxx/
[6] https://lore.kernel.org/linux-amlogic/1578973527-4759-3-git-send-email-xingyu.chen@xxxxxxxxxxx

Jianxin Pan (4):
firmware: meson_sm: Add secure power domain support
dt-bindings: power: add Amlogic secure power domains bindings
soc: amlogic: Add support for Secure power domains controller
arm64: dts: meson: a1: add secure power domain controller

.../bindings/power/amlogic,meson-sec-pwrc.yaml | 40 ++++
arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 6 +
drivers/firmware/meson/meson_sm.c | 2 +
drivers/soc/amlogic/Kconfig | 13 ++
drivers/soc/amlogic/Makefile | 1 +
drivers/soc/amlogic/meson-secure-pwrc.c | 204 +++++++++++++++++++++
include/dt-bindings/power/meson-a1-power.h | 32 ++++
include/linux/firmware/meson/meson_sm.h | 2 +
8 files changed, 300 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml
create mode 100644 drivers/soc/amlogic/meson-secure-pwrc.c
create mode 100644 include/dt-bindings/power/meson-a1-power.h

--
2.7.4