Commit e9a259ba authored by Felipe Balbi's avatar Felipe Balbi Committed by Kevin Hilman

mtd: nand: davinci: only try to fix mux settings on dm6446

Those mux settings are only valid for dm6446, so put that
under a conditional.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
parent 9e4d3146
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include <mach/nand.h> #include <mach/nand.h>
#include <mach/mux.h> #include <mach/mux.h>
#include <asm/mach-types.h>
#include <asm/mach/flash.h> #include <asm/mach/flash.h>
#ifdef CONFIG_NAND_FLASH_HW_ECC #ifdef CONFIG_NAND_FLASH_HW_ECC
...@@ -429,28 +430,37 @@ static void __init nand_davinci_flash_init(struct davinci_nand_info *info) ...@@ -429,28 +430,37 @@ static void __init nand_davinci_flash_init(struct davinci_nand_info *info)
{ {
u32 regval, tmp; u32 regval, tmp;
/* Check for correct pin mux, reconfigure if necessary */ /* The following mux setting are for dm6446 only,
tmp = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + PINMUX0); * that's why we keep them inside the above conditional
* so we don't mess up other arch's mux settings.
if ((tmp & 0x20020C1F) != 0x00000C1F) { *
/* Disable HPI and ATA mux */ * FIXME ideally, this should be done by board support,
davinci_mux_peripheral(DAVINCI_MUX_HPIEN, 0); * move it there at some point.
davinci_mux_peripheral(DAVINCI_MUX_ATAEN, 0); */
if (machine_is_davinci_evm()) {
/* Enable VLYNQ and AEAW */ /* Check for correct pin mux, reconfigure if necessary */
davinci_mux_peripheral(DAVINCI_MUX_AEAW0, 1); tmp = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + PINMUX0);
davinci_mux_peripheral(DAVINCI_MUX_AEAW1, 1);
davinci_mux_peripheral(DAVINCI_MUX_AEAW2, 1); if ((tmp & 0x20020C1F) != 0x00000C1F) {
davinci_mux_peripheral(DAVINCI_MUX_AEAW3, 1); /* Disable HPI and ATA mux */
davinci_mux_peripheral(DAVINCI_MUX_AEAW4, 1); davinci_mux_peripheral(DAVINCI_MUX_HPIEN, 0);
davinci_mux_peripheral(DAVINCI_MUX_VLSCREN, 1); davinci_mux_peripheral(DAVINCI_MUX_ATAEN, 0);
davinci_mux_peripheral(DAVINCI_MUX_VLYNQEN, 1);
/* Enable VLYNQ and AEAW */
regval = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + PINMUX0); davinci_mux_peripheral(DAVINCI_MUX_AEAW0, 1);
davinci_mux_peripheral(DAVINCI_MUX_AEAW1, 1);
dev_warn(info->dev, "Warning: MUX config for NAND: Set " \ davinci_mux_peripheral(DAVINCI_MUX_AEAW2, 1);
"PINMUX0 reg to 0x%08x, was 0x%08x, should be done " \ davinci_mux_peripheral(DAVINCI_MUX_AEAW3, 1);
"by bootloader.\n", regval, tmp); davinci_mux_peripheral(DAVINCI_MUX_AEAW4, 1);
davinci_mux_peripheral(DAVINCI_MUX_VLSCREN, 1);
davinci_mux_peripheral(DAVINCI_MUX_VLYNQEN, 1);
regval = davinci_readl(DAVINCI_SYSTEM_MODULE_BASE + PINMUX0);
dev_warn(info->dev, "Warning: MUX config for NAND: Set " \
"PINMUX0 reg to 0x%08x, was 0x%08x, should be done " \
"by bootloader.\n", regval, tmp);
}
} }
regval = davinci_nand_readl(info, AWCCR_OFFSET); regval = davinci_nand_readl(info, AWCCR_OFFSET);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment