diff options
-rw-r--r-- | board/pcm037/pcm037.c | 9 | ||||
-rw-r--r-- | board/pcm038/pcm038.c | 11 | ||||
-rw-r--r-- | drivers/nand/nand_imx.c | 9 | ||||
-rw-r--r-- | include/asm-arm/arch-imx/imx31-regs.h | 7 |
4 files changed, 27 insertions, 9 deletions
diff --git a/board/pcm037/pcm037.c b/board/pcm037/pcm037.c index a303e506e9..2934a7712b 100644 --- a/board/pcm037/pcm037.c +++ b/board/pcm037/pcm037.c @@ -293,3 +293,12 @@ static int imx31_console_init(void) } console_initcall(imx31_console_init); + +#ifdef CONFIG_NAND_IMX_BOOT +void __bare_init nand_boot(void) +{ + int pagesize = (readl(IMX_CCM_BASE + CCM_RCSR) & RCSR_NFMS) ? 2048 : 512; + + imx_nand_load_image((void *)TEXT_BASE, 256 * 1024, pagesize, 16384); +} +#endif diff --git a/board/pcm038/pcm038.c b/board/pcm038/pcm038.c index e3db5d1311..2270be7b62 100644 --- a/board/pcm038/pcm038.c +++ b/board/pcm038/pcm038.c @@ -320,7 +320,16 @@ late_initcall(pcm038_power_init); #ifdef CONFIG_NAND_IMX_BOOT void __bare_init nand_boot(void) { - imx_nand_load_image((void *)TEXT_BASE, 256 * 1024, 512, 16384); + int pagesize = 512; + PCCR1 |= PCCR1_NFC_BAUDEN; /* FIXME: Really needed? Probably not */ + + switch ((GPCR & GPCR_BOOT_MASK) >> GPCR_BOOT_SHIFT) { + case GPCR_BOOT_8BIT_NAND_2k: + case GPCR_BOOT_16BIT_NAND_2k: + pagesize = 2048; + } + + imx_nand_load_image((void *)TEXT_BASE, 256 * 1024, pagesize, 16384); } #endif diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c index f2ee32d9c0..43f4218cc6 100644 --- a/drivers/nand/nand_imx.c +++ b/drivers/nand/nand_imx.c @@ -1108,15 +1108,8 @@ void __nand_boot_init imx_nand_load_image(void *dest, int size, int pagesize, struct imx_nand_host host; u32 tmp, page, block; - PCCR1 |= PCCR1_NFC_BAUDEN; - - switch ((GPCR & GPCR_BOOT_MASK) >> GPCR_BOOT_SHIFT) { - case GPCR_BOOT_8BIT_NAND_2k: - case GPCR_BOOT_16BIT_NAND_2k: - host.pagesize_2k = 1; - } - host.regs = (void __iomem *)IMX_NFC_BASE; + host.pagesize_2k = (pagesize == 2048); send_cmd(&host, NAND_CMD_RESET); diff --git a/include/asm-arm/arch-imx/imx31-regs.h b/include/asm-arm/arch-imx/imx31-regs.h index b9d7d20bae..3cae3a21db 100644 --- a/include/asm-arm/arch-imx/imx31-regs.h +++ b/include/asm-arm/arch-imx/imx31-regs.h @@ -152,6 +152,8 @@ #define CCMR_FPM (1 << 1) #define CCMR_CKIH (2 << 1) +#define RCSR_NFMS (1 << 30) + /* * ????????????? */ @@ -167,6 +169,11 @@ #include "esdctl.h" /* + * NFC Registers + */ +#define IMX_NFC_BASE (0xb8000000) + +/* * Chip Select Registers */ #define WEIM_BASE 0xb8002000 |