From: Chris Morgan <macroalpha82@gmail.com>
To: u-boot@lists.denx.de
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu,
kever.yang@rock-chips.com, chenjh@rock-chips.com,
pgwipeout@gmail.com, heiko.stuebner@theobroma-systems.com,
Chris Morgan <macromorgan@hotmail.com>
Subject: [PATCH 4/5] rockchip: rk3568: enable automatic power savings
Date: Thu, 5 Jan 2023 09:34:27 -0600 [thread overview]
Message-ID: <20230105153428.392250-5-macroalpha82@gmail.com> (raw)
In-Reply-To: <20230105153428.392250-1-macroalpha82@gmail.com>
From: Chris Morgan <macromorgan@hotmail.com>
This is adapted from Peter Geis's work located here:
https://gitlab.com/pgwipeout/u-boot-quartz64/-/commit/ec20b790adc41bb400e2c523cb35ffee14e223f4
It enables automatic clock gating on idle, disables the eDP phy by
default, and sets the core pvtpll ring length. It is reported this
lowers the temperature on at least one SoC by 7C.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
arch/arm/mach-rockchip/rk3568/rk3568.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3568/rk3568.c b/arch/arm/mach-rockchip/rk3568/rk3568.c
index a2d59abc26..4a08820a09 100644
--- a/arch/arm/mach-rockchip/rk3568/rk3568.c
+++ b/arch/arm/mach-rockchip/rk3568/rk3568.c
@@ -24,6 +24,16 @@
#define SGRF_SOC_CON4 0x10
#define EMMC_HPROT_SECURE_CTRL 0x03
#define SDMMC0_HPROT_SECURE_CTRL 0x01
+
+#define PMU_BASE_ADDR 0xfdd90000
+#define PMU_NOC_AUTO_CON0 (0x70)
+#define PMU_NOC_AUTO_CON1 (0x74)
+#define EDP_PHY_GRF_BASE 0xfdcb0000
+#define EDP_PHY_GRF_CON0 (EDP_PHY_GRF_BASE + 0x00)
+#define EDP_PHY_GRF_CON10 (EDP_PHY_GRF_BASE + 0x28)
+#define CPU_GRF_BASE 0xfdc30000
+#define GRF_CORE_PVTPLL_CON0 (0x10)
+
/* PMU_GRF_GPIO0D_IOMUX_L */
enum {
GPIO0D1_SHIFT = 4,
@@ -98,6 +108,20 @@ void board_debug_uart_init(void)
int arch_cpu_init(void)
{
#ifdef CONFIG_SPL_BUILD
+ /*
+ * When perform idle operation, corresponding clock can
+ * be opened or gated automatically.
+ */
+ writel(0xffffffff, PMU_BASE_ADDR + PMU_NOC_AUTO_CON0);
+ writel(0x000f000f, PMU_BASE_ADDR + PMU_NOC_AUTO_CON1);
+
+ /* Disable eDP phy by default */
+ writel(0x00070007, EDP_PHY_GRF_CON10);
+ writel(0x0ff10ff1, EDP_PHY_GRF_CON0);
+
+ /* Set core pvtpll ring length */
+ writel(0x00ff002b, CPU_GRF_BASE + GRF_CORE_PVTPLL_CON0);
+
/* Set the emmc sdmmc0 to secure */
rk_clrreg(SGRF_BASE + SGRF_SOC_CON4, (EMMC_HPROT_SECURE_CTRL << 11
| SDMMC0_HPROT_SECURE_CTRL << 4));
--
2.34.1
next prev parent reply other threads:[~2023-01-05 15:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 15:34 [PATCH 0/5] Rockchip: Improve Support for RK3566 Devices Chris Morgan
2023-01-05 15:34 ` [PATCH 1/5] rockchip: vop2: Add vop2 dt-binding from Linux Chris Morgan
2023-01-17 2:07 ` Kever Yang
2023-01-05 15:34 ` [PATCH 2/5] arm64: dts: rockchip: Sync rk356x from Linux main Chris Morgan
2023-01-09 22:34 ` Johan Jonker
2023-01-05 15:34 ` [PATCH 3/5] rockchip: rk3568: add boot device detection Chris Morgan
2023-01-17 2:09 ` Kever Yang
2023-01-05 15:34 ` Chris Morgan [this message]
2023-01-05 15:34 ` [PATCH 5/5] gpio/rockchip: rk_gpio support v2 gpio controller Chris Morgan
2023-01-05 18:01 ` Quentin Schulz
2023-01-19 18:21 ` Chris Morgan
2023-01-26 16:11 ` Chris Morgan
2023-01-26 18:11 ` Johan Jonker
2023-01-27 16:50 ` Chris Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230105153428.392250-5-macroalpha82@gmail.com \
--to=macroalpha82@gmail.com \
--cc=chenjh@rock-chips.com \
--cc=heiko.stuebner@theobroma-systems.com \
--cc=kever.yang@rock-chips.com \
--cc=macromorgan@hotmail.com \
--cc=pgwipeout@gmail.com \
--cc=philipp.tomsich@vrull.eu \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox