From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/8] tegra: switch main CPU complex to PLLX early
Date: Tue, 3 Dec 2013 20:56:57 +0100 [thread overview]
Message-ID: <1386100622-8498-5-git-send-email-dev@lynxeye.de> (raw)
In-Reply-To: <1386100622-8498-1-git-send-email-dev@lynxeye.de>
Running at 1GHz, rather than 13MHz certainly makes things a bit faster.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
arch/arm/mach-tegra/include/mach/tegra20-car.h | 32 ++++++++++++++++++++++++++
arch/arm/mach-tegra/tegra_maincomplex_init.c | 9 ++++++++
2 files changed, 41 insertions(+)
diff --git a/arch/arm/mach-tegra/include/mach/tegra20-car.h b/arch/arm/mach-tegra/include/mach/tegra20-car.h
index d4ff6fb..64873d7 100644
--- a/arch/arm/mach-tegra/include/mach/tegra20-car.h
+++ b/arch/arm/mach-tegra/include/mach/tegra20-car.h
@@ -46,6 +46,38 @@
#define CRC_CLK_OUT_ENB_L_AC97 (1 << 3)
#define CRC_CLK_OUT_ENB_L_CPU (1 << 0)
+#define CRC_CCLK_BURST_POLICY 0x020
+#define CRC_CCLK_BURST_POLICY_SYS_STATE_SHIFT 28
+#define CRC_CCLK_BURST_POLICY_SYS_STATE_FIQ 8
+#define CRC_CCLK_BURST_POLICY_SYS_STATE_IRQ 4
+#define CRC_CCLK_BURST_POLICY_SYS_STATE_RUN 2
+#define CRC_CCLK_BURST_POLICY_SYS_STATE_IDLE 1
+#define CRC_CCLK_BURST_POLICY_SYS_STATE_STDBY 0
+#define CRC_CCLK_BURST_POLICY_FIQ_SRC_SHIFT 12
+#define CRC_CCLK_BURST_POLICY_IRQ_SRC_SHIFT 8
+#define CRC_CCLK_BURST_POLICY_RUN_SRC_SHIFT 4
+#define CRC_CCLK_BURST_POLICY_IDLE_SRC_SHIFT 0
+#define CRC_CCLK_BURST_POLICY_SRC_CLKM 0
+#define CRC_CCLK_BURST_POLICY_SRC_PLLC_OUT0 1
+#define CRC_CCLK_BURST_POLICY_SRC_CLKS 2
+#define CRC_CCLK_BURST_POLICY_SRC_PLLM_OUT0 3
+#define CRC_CCLK_BURST_POLICY_SRC_PLLP_OUT0 4
+#define CRC_CCLK_BURST_POLICY_SRC_PLLP_OUT4 5
+#define CRC_CCLK_BURST_POLICY_SRC_PLLP_OUT3 6
+#define CRC_CCLK_BURST_POLICY_SRC_CLKD 7
+#define CRC_CCLK_BURST_POLICY_SRC_PLLX_OUT0 8
+
+#define CRC_SUPER_CCLK_DIV 0x024
+#define CRC_SUPER_CDIV_ENB (1 << 31)
+#define CRC_SUPER_CDIV_DIS_FROM_COP_FIQ (1 << 27)
+#define CRC_SUPER_CDIV_DIS_FROM_CPU_FIQ (1 << 26)
+#define CRC_SUPER_CDIV_DIS_FROM_COP_IRQ (1 << 25)
+#define CRC_SUPER_CDIV_DIS_FROM_CPU_IRQ (1 << 24)
+#define CRC_SUPER_CDIV_DIVIDEND_SHIFT 8
+#define CRC_SUPER_CDIV_DIVIDEND_MASK (0xff << CRC_SUPER_CDIV_DIVIDEND_SHIFT)
+#define CRC_SUPER_CDIV_DIVISOR_SHIFT 0
+#define CRC_SUPER_CDIV_DIVISOR_MASK (0xff << CRC_SUPER_CDIV_DIVISOR_SHIFT)
+
#define CRC_SCLK_BURST_POLICY 0x028
#define CRC_SCLK_BURST_POLICY_SYS_STATE_SHIFT 28
#define CRC_SCLK_BURST_POLICY_SYS_STATE_FIQ 8
diff --git a/arch/arm/mach-tegra/tegra_maincomplex_init.c b/arch/arm/mach-tegra/tegra_maincomplex_init.c
index b3d59ab..5aad1dd 100644
--- a/arch/arm/mach-tegra/tegra_maincomplex_init.c
+++ b/arch/arm/mach-tegra/tegra_maincomplex_init.c
@@ -20,6 +20,7 @@
#include <asm/barebox-arm.h>
#include <mach/lowlevel.h>
#include <mach/tegra20-pmc.h>
+#include <mach/tegra20-car.h>
void tegra_maincomplex_entry(void)
{
@@ -27,6 +28,14 @@ void tegra_maincomplex_entry(void)
arm_cpu_lowlevel_init();
+ /* switch to PLLX */
+ writel(CRC_CCLK_BURST_POLICY_SYS_STATE_RUN <<
+ CRC_CCLK_BURST_POLICY_SYS_STATE_SHIFT |
+ CRC_CCLK_BURST_POLICY_SRC_PLLX_OUT0 <<
+ CRC_CCLK_BURST_POLICY_RUN_SRC_SHIFT,
+ TEGRA_CLK_RESET_BASE + CRC_CCLK_BURST_POLICY);
+ writel(CRC_SUPER_CDIV_ENB, TEGRA_CLK_RESET_BASE + CRC_SUPER_CCLK_DIV);
+
switch (tegra_get_chiptype()) {
case TEGRA20:
rambase = 0x0;
--
1.8.3.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-12-03 19:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 19:56 [PATCH 0/8] tegra-next Lucas Stach
2013-12-03 19:56 ` [PATCH] gpio: reduce noise when parsing DT Lucas Stach
2013-12-03 19:56 ` [PATCH 1/8] tegra: fix fallout from relocatable code changes in PLLX init Lucas Stach
2013-12-03 19:56 ` [PATCH 2/8] tegra: speed up system bus Lucas Stach
2013-12-03 19:56 ` Lucas Stach [this message]
2013-12-03 19:56 ` [PATCH 4/8] gpio: tegra: remove leftover debug code Lucas Stach
2013-12-03 19:56 ` [PATCH 5/8] clk: tegra: add SDMMC clocks Lucas Stach
2013-12-03 19:57 ` [PATCH 6/8] tegra: add SDMMC controller driver Lucas Stach
2013-12-03 19:57 ` [PATCH 7/8] dts: tegra: add SDMMC nodes Lucas Stach
2013-12-03 19:57 ` [PATCH 8/8] dts: tegra: activate SDMMC on Colibri T20 Lucas Stach
2013-12-04 16:01 ` [PATCH 0/8] tegra-next Sascha Hauer
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=1386100622-8498-5-git-send-email-dev@lynxeye.de \
--to=dev@lynxeye.de \
--cc=barebox@lists.infradead.org \
/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