All of lore.kernel.org
 help / color / mirror / Atom feed
* Power Domains on Amlogic SoCs
@ 2019-03-01 22:30 Martin Blumenstingl
  2019-03-04 15:41 ` Ulf Hansson
  2019-03-13 17:10 ` Maxime Jourdan
  0 siblings, 2 replies; 6+ messages in thread
From: Martin Blumenstingl @ 2019-03-01 22:30 UTC (permalink / raw)
  To: Neil Armstrong, mjourdan, linux-amlogic
  Cc: ulf.hansson, khilman, rjw, linux-pm

Hello,

I would like to start a discussion how to structure the power domain
drivers for the Amlogic SoCs.
My main motivation is getting video output and video decoders working
on the 32-bit SoCs.

The Amlogic SoCs we various registers for "power domains", the ones I
know (in no specific order):
1. HHI_MEM_PD_REG0 (contains: HDMI memory PD, Ethernet memory PD,
audio DSP memory PD - at least on the 32-bit SoCs)
2. HHI_VPU_MEM_PD_REG{0,1,2} (contains: various VPU related power domains)
3. AO_RTI_GEN_PWR_SLEEP0, AO_RTI_GEN_PWR_ISO0 (contains: HDMI PD, HDMI
isolation, video codec PDs, video code isolation, ...)
4. AO_RTI_PWR_A9_CNTL0/AO_RTI_PWR_SYS_CPU_PD0,
P_AO_RTI_PWR_A9_CNTL1/AO_RTI_PWR_SYS_CPU_PD1 (contains: CPU core
related power bits)

currently we have three drivers, which handle *some* of these power
domain registers:
drivers/soc/amlogic/meson-gx-pwrc-vpu.c:
- partially manages HHI_MEM_PD_REG0
- fully manages HHI_VPU_MEM_PD_REG{0,1,2}
- partially manages AO_RTI_GEN_PWR_SLEEP0

arch/arm/mach-meson/platsmp.c:
- manages AO_RTI_PWR_A9_CNTL0 and P_AO_RTI_PWR_A9_CNTL1
- only for the 32-bit SoCs, these registers (or their replacements)
are controlled by the firmware on the 64-bit SoCs

drivers/media/platform/meson/vdec/* (not upstream yet due to firmware
blob licensing questions, latest patchset: [1]):
- also partially manages AO_RTI_GEN_PWR_SLEEP0, AO_RTI_GEN_PWR_ISO0
(the former is also partially managed by meson-gx-pwrc-vpu)

To use the meson-gx-pwrc-vpu driver on the 32-bit SoCs I would have to
create an "AO regmap/syscon" and pass it to that driver. However, the
register layout of the "AO bus" on these older SoCs is different to
what we have on the 64-bit SoCs. So having a big "AO regmap/syscon" is
not easy (I also believe that it even if we could achieve it then it
wouldn't be a good representation of the hardware).
The video decoder driver currently requires the same "AO regmap/syscon".

I would like to focus on the AO_RTI_GEN_PWR_SLEEP0,
AO_RTI_GEN_PWR_ISO0 registers for now. This will make it easier to
support VPU and the video decoder drivers on the 32-bit SoCs.
My idea is to create a separate power domain provider which manages
these registers. Each power domain is exposed with it's own ID (just
like we have the CLKIDs in the clock driver) and can then be passed to
the various consumer drivers.
The genpd improvements in v4.19 and v4.20 make this possible as each
power domain can now be managed at runtime (not just at driver probe
time), see: [0]

With a separate power domain provider the meson-gx-pwrc-vpu and video
decoder drivers would not access the AO registers anymore. Instead we
would pass all relevant power domains from the "AO power domain
provider" to their respective consumers.

Examples (incomplete) from the VPU power domain / video decoder perspective:
&vpu_power_domain {
  power-domains = <&ao_pwrc AO_VPU_HDMI_PD>, <&ao_pwrc AO_VPU_HDMI_ISO_PD>;
  power-domain-names = "vpu_hdmi", "vpu_hdmi_iso";
};

&video_decoder {
  power-domains = <&ao_pwrc AO_PWR_VDEC_1_PD>, <&ao_pwrc
AO_ISO_VDEC_1_PD>, <&ao_pwrc AO_PWR_VDEC_HVEC_PD>, <&ao_pwrc
AO_ISO_VDEC_HVEC_PD>;
  power-domain-names = "vdec_1", "vdec_1_iso", "vdec_hvec", "vdec_hvec_iso";
};

My main concern is "backwards compatibility". We need to take care of
the VPU power domain driver and the video decoder driver. The latter
is not mainlined yet, so I'm not sure we need to be backwards
compatible here.

Please let me know if you have any concerns, ideas, suggestions, ...
I can build an "RFC" series for this topic if this makes the discussion easier.


Regards
Martin


[0] https://linuxplumbersconf.org/event/2/contributions/130/attachments/138/170/Genpd-Improvements.pdf
[1] https://patchwork.kernel.org/patch/10669873/

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-15 22:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-01 22:30 Power Domains on Amlogic SoCs Martin Blumenstingl
2019-03-04 15:41 ` Ulf Hansson
2019-03-05 21:37   ` Martin Blumenstingl
2019-03-07 14:50     ` Kevin Hilman
2019-03-15 22:19       ` Martin Blumenstingl
2019-03-13 17:10 ` Maxime Jourdan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.