From: Peter Geis <pgwipeout@gmail.com>
To: Simon Glass <sjg@chromium.org>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Kever Yang <kever.yang@rock-chips.com>
Cc: Peter Geis <pgwipeout@gmail.com>, u-boot@lists.denx.de
Subject: [PATCH v1 08/11] rockchip: rk3568: enable automatic clock gating
Date: Mon, 21 Feb 2022 20:31:27 -0500 [thread overview]
Message-ID: <20220222013131.3114990-9-pgwipeout@gmail.com> (raw)
In-Reply-To: <20220222013131.3114990-1-pgwipeout@gmail.com>
Enable automatic clock gating on rk3568, which solves a 7c temperature
difference on SoQuartz compared to downstream.
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
arch/arm/mach-rockchip/rk3568/rk3568.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3568/rk3568.c b/arch/arm/mach-rockchip/rk3568/rk3568.c
index 5f239d89a7a9..0e0a7f5b54f2 100644
--- a/arch/arm/mach-rockchip/rk3568/rk3568.c
+++ b/arch/arm/mach-rockchip/rk3568/rk3568.c
@@ -25,6 +25,15 @@
#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,
@@ -99,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.25.1
next prev parent reply other threads:[~2022-02-22 1:33 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 1:31 [PATCH v1 00/11] rockchip fixes and extend rk3568 support Peter Geis
2022-02-22 1:31 ` [PATCH v1 01/11] clk: rockchip: rk3568: fix reset handler Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:32 ` Peter Geis
2022-03-12 5:02 ` Simon Glass
2022-03-14 8:51 ` Kever Yang
2023-01-04 18:30 ` Jagan Teki
2022-02-22 1:31 ` [PATCH v1 02/11] mmc: sdhci: allow disabling sdma in spl Peter Geis
2022-02-25 1:46 ` Jaehoon Chung
2022-03-14 8:41 ` Kever Yang
2022-02-22 1:31 ` [PATCH v1 03/11] spi: rockchip-sfc: fix building rockchip-sfc Peter Geis
2022-03-14 8:45 ` Kever Yang
2022-03-14 11:36 ` Peter Geis
2022-02-22 1:31 ` [PATCH v1 04/11] spi: rockchip-sfc: sanity check minimum freq Peter Geis
2022-03-14 8:53 ` Kever Yang
2022-03-15 2:10 ` Jon Lin
2022-02-22 1:31 ` [PATCH v1 05/11] spl: support adc drivers in spl Peter Geis
2022-02-22 1:31 ` [PATCH v1 06/11] rockchip: handle bootrom recovery mode " Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:37 ` Peter Geis
2022-03-14 9:08 ` Kever Yang
2022-03-14 11:51 ` Peter Geis
2022-03-14 11:59 ` Philipp Tomsich
2022-03-14 12:34 ` Peter Geis
2022-02-22 1:31 ` [PATCH v1 07/11] rockchip: rk3568: add boot device detection Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:34 ` Peter Geis
2022-02-22 1:31 ` Peter Geis [this message]
2022-03-12 2:24 ` [PATCH v1 08/11] rockchip: rk3568: enable automatic clock gating Simon Glass
2022-03-14 8:52 ` Kever Yang
2022-02-22 1:31 ` [PATCH v1 09/11] rockchip: move dwc3 config to chip specific handler Peter Geis
2022-03-12 2:24 ` Simon Glass
2023-02-27 7:10 ` Jagan Teki
2022-02-22 1:31 ` [PATCH v1 10/11] rockchip: rk3568: add dwc3 otg support Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:38 ` Peter Geis
2022-02-22 1:31 ` [PATCH v1 11/11] [RFC] rockchip: rk356x: attempt to fix ram detection Peter Geis
2022-03-12 2:24 ` Simon Glass
2022-03-12 3:54 ` Peter Geis
2022-03-12 5:02 ` Simon Glass
2022-03-12 14:46 ` [PATCH v1 00/11] rockchip fixes and extend rk3568 support Kever Yang
2022-03-14 8:56 ` Kever Yang
2022-03-14 11:42 ` Peter Geis
2022-03-14 9:06 ` Jagan Teki
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=20220222013131.3114990-9-pgwipeout@gmail.com \
--to=pgwipeout@gmail.com \
--cc=kever.yang@rock-chips.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