From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] sunxi: Downclock AHB1 to 100MHz on Allwinner A64
Date: Tue, 31 May 2016 01:55:35 +0300 [thread overview]
Message-ID: <20160531015535.5c13a993@i7> (raw)
In-Reply-To: <1464648486-3717-2-git-send-email-siarhei.siamashka@gmail.com>
On Tue, 31 May 2016 01:48:05 +0300
Siarhei Siamashka <siarhei.siamashka@gmail.com> wrote:
> Currently the AHB1 clock speed is configured as 200MHz by
> the SPL, but this causes a subtle and hard to reproduce data
> corruption in SRAM C (for example, this can't be easily
> detected with a trivial memset/memcmp test).
>
> For what it's worth, the Allwinner's BSP configures AHB1
> as 200MHz, as can be verified by running the devmem2 tool
> in the system running the Allwinner's kernel 3.10.x:
>
> 0x1C20028: PLL_PERIPH0_CTRL_REG = 0x90041811
> 0x1C20054: AHB1_APB1_CFG_REG = 0x3180
> 0x1C20058: APB2_CFG_REG = 0x1000000
> 0x1C2005C: AHB2_CFG_REG = 0x1
>
> However the FEL mode uses more conservative settings (100MHz
> for AHB1):
>
> 0x1C20028: PLL_PERIPH0_CTRL_REG = 0x90041811
> 0x1C20054: AHB1_APB1_CFG_REG = 0x3180
Oops, a copy-paste issue when editing the commit message, this
should be 0x3190
> 0x1C20058: APB2_CFG_REG = 0x1000000
> 0x1C2005C: AHB2_CFG_REG = 0x0
>
> It is yet to be confirmed whether faster AHB1/AHB2 clock settings
> can be used safely if we initialize the AXP803 PMIC instead of
> using reset defaults. But in order to resolve the data corruption
> problem right now, it's best to downclock AHB1 to a safe level.
>
> Note that this issue only affects the SPL, which is not fully
> supported on Allwinner A64 yet and it should not affect the boot0
> usage (unless somebody can confirm SRAM C corruption with the
> boot0 too).
>
> Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
> ---
> arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> index f2990db..c2e72f5 100644
> --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> @@ -222,7 +222,12 @@ struct sunxi_ccm_reg {
> #define CCM_PLL11_CTRL_UPD (0x1 << 30)
> #define CCM_PLL11_CTRL_EN (0x1 << 31)
>
> +#if defined(CONFIG_MACH_SUN50I)
> +/* AHB1=100MHz failsafe setup from the FEL mode, usable with PMIC defaults */
> +#define AHB1_ABP1_DIV_DEFAULT 0x00003190 /* AHB1=PLL6/6,APB1=AHB1/2 */
> +#else
> #define AHB1_ABP1_DIV_DEFAULT 0x00003180 /* AHB1=PLL6/3,APB1=AHB1/2 */
> +#endif
>
> #define AXI_GATE_OFFSET_DRAM 0
--
Best regards,
Siarhei Siamashka
next prev parent reply other threads:[~2016-05-30 22:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-30 22:48 [U-Boot] [PATCH 0/2] sunxi: Fix SRAM C corruption issue on Allwinner A64 Siarhei Siamashka
2016-05-30 22:48 ` [U-Boot] [PATCH 1/2] sunxi: Downclock AHB1 to 100MHz " Siarhei Siamashka
2016-05-30 22:55 ` Siarhei Siamashka [this message]
2016-06-10 19:24 ` Hans de Goede
2016-05-30 22:48 ` [U-Boot] [PATCH 2/2] sunxi: Move the SPL stack top to 0x1A000 on Allwinner A64/A80 Siarhei Siamashka
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=20160531015535.5c13a993@i7 \
--to=siarhei.siamashka@gmail.com \
--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