Skip to content

Commit

Permalink
arm: mvebu: NAND clock support for MSYS devices
Browse files Browse the repository at this point in the history
One difference with the integrated CPUs is that they use a different
clock control block to the Armada devices. Update mvebu_get_nand_clock()
accordingly.

Signed-off-by: Chris Packham <[email protected]>
Reviewed-by: Stefan Roese <[email protected]>
Signed-off-by: Stefan Roese <[email protected]>
  • Loading branch information
cpackham authored and stroese committed Apr 12, 2019
1 parent 0d0df46 commit 689f9cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/mach-mvebu/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ u32 mvebu_get_nand_clock(void)

if (mvebu_soc_family() == MVEBU_SOC_A38X)
reg = MVEBU_DFX_DIV_CLK_CTRL(1);
else if (mvebu_soc_family() == MVEBU_SOC_MSYS)
reg = MVEBU_DFX_DIV_CLK_CTRL(8);
else
reg = MVEBU_CORE_DIV_CLK_CTRL(1);

Expand Down
11 changes: 11 additions & 0 deletions arch/arm/mach-mvebu/include/mach/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,20 @@
#define SPI_PUP_EN BIT(5)

#define MVEBU_CORE_DIV_CLK_CTRL(i) (MVEBU_CLOCK_BASE + ((i) * 0x8))
#ifdef CONFIG_ARMADA_MSYS
#define MVEBU_DFX_DIV_CLK_CTRL(i) (MVEBU_DFX_BASE + 0xf8000 + 0x250 + ((i) * 0x4))
#define NAND_ECC_DIVCKL_RATIO_OFFS 6
#define NAND_ECC_DIVCKL_RATIO_MASK (0xF << NAND_ECC_DIVCKL_RATIO_OFFS)
#else
#define MVEBU_DFX_DIV_CLK_CTRL(i) (MVEBU_DFX_BASE + 0x250 + ((i) * 0x4))
#endif
#ifdef CONFIG_ARMADA_MSYS
#define NAND_ECC_DIVCKL_RATIO_OFFS 6
#define NAND_ECC_DIVCKL_RATIO_MASK (0xF << NAND_ECC_DIVCKL_RATIO_OFFS)
#else
#define NAND_ECC_DIVCKL_RATIO_OFFS 8
#define NAND_ECC_DIVCKL_RATIO_MASK (0x3F << NAND_ECC_DIVCKL_RATIO_OFFS)
#endif

#define SDRAM_MAX_CS 4
#define SDRAM_ADDR_MASK 0xFF000000
Expand Down

0 comments on commit 689f9cf

Please sign in to comment.