Skip to content

Conversation

@ya-mouse
Copy link
Contributor

Add a power domain driver for the Rockchip RK3576 SoC, ported from the Linux kernel driver. This enables U-Boot to control power domains for peripherals like USB, GPU, NPU, video encoders/decoders, etc.

The driver implements:

  • Power domain on/off control via PMU registers
  • Bus idle request/acknowledge handshaking
  • Clock ungating during power transitions
  • Domain status checking via repair status or idle status registers

Supported power domains (matching dt-bindings/power/rockchip,rk3576-power.h):

  • RK3576_PD_NPU, RK3576_PD_NPUTOP, RK3576_PD_NPU0, RK3576_PD_NPU1
  • RK3576_PD_NVM, RK3576_PD_SDGMAC, RK3576_PD_AUDIO
  • RK3576_PD_PHP, RK3576_PD_SUBPHP
  • RK3576_PD_VOP, RK3576_PD_VO0, RK3576_PD_VO1
  • RK3576_PD_USB, RK3576_PD_VI
  • RK3576_PD_VEPU0, RK3576_PD_VEPU1, RK3576_PD_VDEC, RK3576_PD_VPU
  • RK3576_PD_GPU

The power sequence follows the hardware requirements:

  1. Ungate clocks for the domain
  2. Set power control register (0 = on, 1 = off)
  3. Wait for power state via repair status polling
  4. Set/clear bus idle request
  5. Wait for idle acknowledge and status
  6. Re-gate clocks

This driver is required for enabling peripherals on RK3576 platforms that have their power domains disabled by default or by firmware.

Change-Id: c5659beb-c1ef-4a41-8972-66c9a4bd123d

@ya-mouse ya-mouse requested a review from alchark January 20, 2026 08:06
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the users of it? I don't seem to recall anything we needed in U-boot which wasn't available due to a power domain being off at boot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was some peripherals that has power domain requirement. It can operate without it. For now it's an optional driver.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the complexity down. If we don't have an immediate need for something, let's not spend time on enabling it

Add a power domain driver for the Rockchip RK3576 SoC, ported from
the Linux kernel driver. This enables U-Boot to control power domains
for peripherals like USB, GPU, NPU, video encoders/decoders, etc.

The driver implements:
- Power domain on/off control via PMU registers
- Bus idle request/acknowledge handshaking
- Clock ungating during power transitions
- Domain status checking via repair status or idle status registers

Supported power domains (matching dt-bindings/power/rockchip,rk3576-power.h):
- RK3576_PD_NPU, RK3576_PD_NPUTOP, RK3576_PD_NPU0, RK3576_PD_NPU1
- RK3576_PD_NVM, RK3576_PD_SDGMAC, RK3576_PD_AUDIO
- RK3576_PD_PHP, RK3576_PD_SUBPHP
- RK3576_PD_VOP, RK3576_PD_VO0, RK3576_PD_VO1
- RK3576_PD_USB, RK3576_PD_VI
- RK3576_PD_VEPU0, RK3576_PD_VEPU1, RK3576_PD_VDEC, RK3576_PD_VPU
- RK3576_PD_GPU

The power sequence follows the hardware requirements:
1. Ungate clocks for the domain
2. Set power control register (0 = on, 1 = off)
3. Wait for power state via repair status polling
4. Set/clear bus idle request
5. Wait for idle acknowledge and status
6. Re-gate clocks

This driver is required for enabling peripherals on RK3576 platforms
that have their power domains disabled by default or by firmware.

Change-Id: c5659beb-c1ef-4a41-8972-66c9a4bd123d
Signed-off-by: Anton Burticica <mouse@ya.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants