summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mvebu/cpu.c
diff options
context:
space:
mode:
authorChris Packham <chris.packham@alliedtelesis.co.nz>2016-08-22 12:38:39 +1200
committerStefan Roese <sr@denx.de>2016-08-26 08:33:21 +0200
commitd7b4731efd4d4d90224917fca1a09ccf99cd1baa (patch)
tree7f87dfbf924cdf0779d31f6958474891be3645b9 /arch/arm/mach-mvebu/cpu.c
parent46fe9eb08812cc27a0d5cd97d97373c14d578fe9 (diff)
downloadu-boot-imx-d7b4731efd4d4d90224917fca1a09ccf99cd1baa.zip
u-boot-imx-d7b4731efd4d4d90224917fca1a09ccf99cd1baa.tar.gz
u-boot-imx-d7b4731efd4d4d90224917fca1a09ccf99cd1baa.tar.bz2
arm: mvebu: Add support for NAND interface on A-38x
The NAND interface on the Armada-38x series is similar to that on the Armada-XP. The key difference is that the NAND ECC clock ratio is provided via the DFX Server registers instead of the Core Clock. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Dirk Eibach <eibach@gdsys.de> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/arm/mach-mvebu/cpu.c')
-rw-r--r--arch/arm/mach-mvebu/cpu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index fd66f59..5eb2a39 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -452,8 +452,15 @@ int arch_cpu_init(void)
u32 mvebu_get_nand_clock(void)
{
+ u32 reg;
+
+ if (mvebu_soc_family() == MVEBU_SOC_A38X)
+ reg = MVEBU_DFX_DIV_CLK_CTRL(1);
+ else
+ reg = MVEBU_CORE_DIV_CLK_CTRL(1);
+
return CONFIG_SYS_MVEBU_PLL_CLOCK /
- ((readl(MVEBU_CORE_DIV_CLK_CTRL(1)) &
+ ((readl(reg) &
NAND_ECC_DIVCKL_RATIO_MASK) >> NAND_ECC_DIVCKL_RATIO_OFFS);
}