diff options
author | Stefan Agner <stefan@agner.ch> | 2014-04-24 09:05:40 +0200 |
---|---|---|
committer | Stefan Agner <stefan@agner.ch> | 2014-04-24 16:32:52 +0200 |
commit | 4ac73411c90a79be1485d24c36adf580fcb60311 (patch) | |
tree | 89108517bd4c8342f92d40873a8bc8a114367e0f | |
parent | 01987c5d90c471e4fc5a34f5662875226920fede (diff) |
colibri_vf: enable NAND and use environment from NAND
This enables NAND for Colibri VF61/VF50. The environment is now
taken from NAND. The first block, the boot control block, is
definied as a seperate partition in order for easier erasing.
-rw-r--r-- | board/toradex/colibri_vf/colibri_vf.c | 36 | ||||
-rw-r--r-- | boards.cfg | 2 | ||||
-rw-r--r-- | include/configs/colibri_vf.h | 26 |
3 files changed, 57 insertions, 7 deletions
diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index 36805b6f35..ddc3a34dbb 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -283,6 +283,30 @@ static void setup_iomux_i2c(void) imx_iomux_v3_setup_multiple_pads(i2c0_pads, ARRAY_SIZE(i2c0_pads)); } +#ifdef CONFIG_NAND_FSL_NFC +static void setup_iomux_nfc(void) +{ + static const iomux_v3_cfg_t nfc_pads[] = { + VF610_PAD_PTD23__NF_IO7, + VF610_PAD_PTD22__NF_IO6, + VF610_PAD_PTD21__NF_IO5, + VF610_PAD_PTD20__NF_IO4, + VF610_PAD_PTD19__NF_IO3, + VF610_PAD_PTD18__NF_IO2, + VF610_PAD_PTD17__NF_IO1, + VF610_PAD_PTD16__NF_IO0, + VF610_PAD_PTB24__NF_WE_B, + VF610_PAD_PTB25__NF_CE0_B, + VF610_PAD_PTB27__NF_RE_B, + VF610_PAD_PTC26__NF_RB_B, + VF610_PAD_PTC27__NF_ALE, + VF610_PAD_PTC28__NF_CLE + }; + + imx_iomux_v3_setup_multiple_pads(nfc_pads, ARRAY_SIZE(nfc_pads)); +} +#endif + #ifdef CONFIG_FSL_ESDHC struct fsl_esdhc_cfg esdhc_cfg[1] = { {ESDHC1_BASE_ADDR}, @@ -338,6 +362,8 @@ static void clock_init(void) CCM_CCGR7_SDHC1_CTRL_MASK); clrsetbits_le32(&ccm->ccgr9, CCM_REG_CTRL_MASK, CCM_CCGR9_FEC0_CTRL_MASK | CCM_CCGR9_FEC1_CTRL_MASK); + clrsetbits_le32(&ccm->ccgr10, CCM_REG_CTRL_MASK, + CCM_CCGR10_NFC_CTRL_MASK); clrsetbits_le32(&anadig->pll5_ctrl, ANADIG_PLL5_CTRL_BYPASS | ANADIG_PLL5_CTRL_POWERDOWN, ANADIG_PLL5_CTRL_ENABLE | @@ -362,11 +388,14 @@ static void clock_init(void) CCM_CACRR_IPG_CLK_DIV(1) | CCM_CACRR_BUS_CLK_DIV(2) | CCM_CACRR_ARM_CLK_DIV(0)); clrsetbits_le32(&ccm->cscmr1, CCM_REG_CTRL_MASK, - CCM_CSCMR1_ESDHC1_CLK_SEL(3)); + CCM_CSCMR1_ESDHC1_CLK_SEL(3) | CCM_CSCMR1_NFC_CLK_SEL(0)); clrsetbits_le32(&ccm->cscdr1, CCM_REG_CTRL_MASK, CCM_CSCDR1_RMII_CLK_EN); clrsetbits_le32(&ccm->cscdr2, CCM_REG_CTRL_MASK, - CCM_CSCDR2_ESDHC1_EN | CCM_CSCDR2_ESDHC1_CLK_DIV(0)); + CCM_CSCDR2_ESDHC1_EN | CCM_CSCDR2_ESDHC1_CLK_DIV(0) | + CCM_CSCDR2_NFC_EN); + clrsetbits_le32(&ccm->cscdr3, CCM_REG_CTRL_MASK, + CCM_CSCDR3_NFC_PRE_DIV(5)); clrsetbits_le32(&ccm->cscmr2, CCM_REG_CTRL_MASK, CCM_CSCMR2_RMII_CLK_SEL(2)); /* PLL5 main clock */ } @@ -396,6 +425,9 @@ int board_early_init_f(void) setup_iomux_uart(); setup_iomux_enet(); setup_iomux_i2c(); +#ifdef CONFIG_NAND_FSL_NFC + setup_iomux_nfc(); +#endif return 0; } diff --git a/boards.cfg b/boards.cfg index ddb8f2d1f3..d5c282b70e 100644 --- a/boards.cfg +++ b/boards.cfg @@ -374,7 +374,7 @@ Active arm armv7 socfpga altera socfpga Active arm armv7 u8500 st-ericsson snowball snowball - Mathieu Poirier <mathieu.poirier@linaro.org> Active arm armv7 u8500 st-ericsson u8500 u8500_href - - Active arm armv7 vf610 freescale vf610twr vf610twr vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg Alison Wang <b18965@freescale.com> -Active arm armv7 vf610 toradex colibri_vf colibri_vf colibri_vf:IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg Stefan Agner <stefan@agner.ch> +Active arm armv7 vf610 toradex colibri_vf colibri_vf colibri_vf:IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,IMX_NAND Stefan Agner <stefan@agner.ch> Active arm armv7 zynq xilinx zynq zynq_microzed - Michal Simek <monstr@monstr.eu>:Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Active arm armv7 zynq xilinx zynq zynq_zc70x - Michal Simek <monstr@monstr.eu>:Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Active arm armv7 zynq xilinx zynq zynq_zc770_xm010 zynq_zc770:ZC770_XM010 Michal Simek <monstr@monstr.eu>:Jagannadha Sutradharudu Teki <jaganna@xilinx.com> diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h index 54ca7d9153..8af213c406 100644 --- a/include/configs/colibri_vf.h +++ b/include/configs/colibri_vf.h @@ -45,6 +45,25 @@ #define CONFIG_ENV_OVERWRITE #define CONFIG_BAUDRATE 115200 +/* NAND support */ +#define CONFIG_CMD_NAND +#define CONFIG_CMD_WRITEBCB +#define CONFIG_NAND_FSL_NFC +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_SYS_NAND_BASE NFC_BASE_ADDR + +/* Dynamic MTD partition support */ +#define CONFIG_CMD_MTDPARTS /* Enable 'mtdparts' command line support */ +#define CONFIG_MTD_PARTITIONS +#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ +#define MTDIDS_DEFAULT "nand0=fsl_nfc" +#define MTDPARTS_DEFAULT "mtdparts=fsl_nfc:" \ + "128k(vf-bcb)ro," \ + "1408k(u-boot)ro," \ + "512k(u-boot-env)ro," \ + "8m(kernel-ubi)," \ + "-(rootfs-ubi)" + #undef CONFIG_CMD_IMLS #define CONFIG_MMC @@ -211,10 +230,9 @@ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) /* Environment organization */ -#define CONFIG_ENV_IS_IN_MMC -#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_ENV_OFFSET (12 * 64 * 1024) -#define CONFIG_ENV_SIZE (8 * 1024) +#define CONFIG_ENV_IS_IN_NAND +#define CONFIG_ENV_SIZE (64 * 2048) +#define CONFIG_ENV_OFFSET (6 * 64 * 2048) #define CONFIG_OF_LIBFDT #define CONFIG_CMD_BOOTZ |