public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode
  2013-01-22  1:47 ` [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode Otavio Salvador
@ 2013-01-22  1:45   ` Marek Vasut
  2013-01-22  1:53     ` Otavio Salvador
  0 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:45 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> From: Marek Vasut <marex@denx.de>
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  drivers/mmc/mxsmmc.c | 24 +++++++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> index 0c4cd54..4b178be 100644
> --- a/drivers/mmc/mxsmmc.c
> +++ b/drivers/mmc/mxsmmc.c
> @@ -211,14 +211,32 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) }
> 
>  		ctrl0 |= SSP_CTRL0_DATA_XFER;
> +
> +		reg = data->blocksize * data->blocks;
> +#if defined(CONFIG_MX23)
> +		if (reg & ~SSP_CTRL0_XFER_COUNT_MASK) {
> +			printf("MMC%d: Transfer too large (%i bytes)!\n",
> +				mmc->block_dev.dev, reg);
> +			return -EINVAL;
> +		}
> +
> +		ctrl0 |= reg & SSP_CTRL0_XFER_COUNT_MASK;
> +
> +		reg = readl(&ssp_regs->hw_ssp_cmd0);
> +		reg &= ~0xfff00;
> +		reg |= (data->blocks - 1) << 8;
> +		reg |= (ffs(data->blocksize) - 1) << 16;

This is using some random hard-coded offsets, I told you numerous times I will 
NAK this.

Sorry.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI
  2013-01-22  1:47 ` [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI Otavio Salvador
@ 2013-01-22  1:46   ` Marek Vasut
  2013-01-22  1:55     ` Otavio Salvador
  2013-01-24 18:14   ` Marek Vasut
  1 sibling, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:46 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

Description missing. Was this ever tested? Does SSP DMA work?

> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  drivers/spi/mxs_spi.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> index bb865b7..10bf5aa 100644
> --- a/drivers/spi/mxs_spi.c
> +++ b/drivers/spi/mxs_spi.c
> @@ -167,8 +167,13 @@ static int mxs_spi_xfer_pio(struct mxs_spi_slave
> *slave, mxs_spi_start_xfer(ssp_regs);
> 
>  	while (length--) {
> +#if defined(CONFIG_MX23)
> +		writel(SSP_CTRL0_XFER_COUNT_MASK, &ssp_regs->hw_ssp_ctrl0_clr);
> +		writel(1, &ssp_regs->hw_ssp_ctrl0_set);
> +#elif defined(CONFIG_MX28)
>  		/* We transfer 1 byte */
>  		writel(1, &ssp_regs->hw_ssp_xfer_size);
> +#endif
> 
>  		if ((flags & SPI_XFER_END) && !length)
>  			mxs_spi_end_xfer(ssp_regs);

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 4/9] mx23evk: Add initial board support
  2013-01-22  1:47 ` [U-Boot] [PATCH 4/9] mx23evk: Add initial board support Otavio Salvador
@ 2013-01-22  1:46   ` Marek Vasut
  2013-01-22  2:02     ` Otavio Salvador
  2013-01-22  2:30   ` Fabio Estevam
  1 sibling, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:46 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

This should not be a part of the patchset. Description is missing.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition
@ 2013-01-22  1:47 Otavio Salvador
  2013-01-22  1:47 ` [U-Boot] [PATCH 1/9] mx23: Add SSP registers map Otavio Salvador
                   ` (8 more replies)
  0 siblings, 9 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

This patchset adds MMC suuport, in PIO mode for now, to iMX23; it has
been boot tested in mx23evk board. I did a brief look at DMA support
but it seems not fast to implement so I would prefer to have this
patchset merged so other people can start using and playing with it.

Marek Vasut (3):
  mx23: Add SSP registers map
  mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode
  mx23_olinuxino: Add MMC support

Otavio Salvador (6):
  mx23: Fix transfer size setting for SPI
  mx23evk: Add initial board support
  mx23_olinuxino: Skip MMC Card detection
  mx23_olinuxino: Add default environment
  mxs: Fix MMC reset to avoid write errors and timeout  in iMX23
  mx23: Use PIO mode support for MMC

 arch/arm/include/asm/arch-mxs/regs-ssp.h     |  28 +++
 board/freescale/mx23evk/Makefile             |  47 +++++
 board/freescale/mx23evk/mx23evk.c            |  81 +++++++++
 board/freescale/mx23evk/spl_boot.c           | 115 ++++++++++++
 board/olimex/mx23_olinuxino/mx23_olinuxino.c |  17 +-
 board/olimex/mx23_olinuxino/spl_boot.c       |  10 ++
 boards.cfg                                   |   1 +
 drivers/mmc/mxsmmc.c                         |  50 ++++--
 drivers/spi/mxs_spi.c                        |   5 +
 include/configs/mx23_olinuxino.h             | 103 ++++++++++-
 include/configs/mx23evk.h                    | 252 +++++++++++++++++++++++++++
 11 files changed, 697 insertions(+), 12 deletions(-)
 create mode 100644 board/freescale/mx23evk/Makefile
 create mode 100644 board/freescale/mx23evk/mx23evk.c
 create mode 100644 board/freescale/mx23evk/spl_boot.c
 create mode 100644 include/configs/mx23evk.h

-- 
1.8.1

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 1/9] mx23: Add SSP registers map
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:47 ` [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode Otavio Salvador
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

From: Marek Vasut <marex@denx.de>

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 arch/arm/include/asm/arch-mxs/regs-ssp.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm/include/asm/arch-mxs/regs-ssp.h b/arch/arm/include/asm/arch-mxs/regs-ssp.h
index b97ac35..72a59ed 100644
--- a/arch/arm/include/asm/arch-mxs/regs-ssp.h
+++ b/arch/arm/include/asm/arch-mxs/regs-ssp.h
@@ -28,6 +28,28 @@
 #include <asm/arch/regs-common.h>
 
 #ifndef	__ASSEMBLY__
+#if defined(CONFIG_MX23)
+struct mxs_ssp_regs {
+	mxs_reg_32(hw_ssp_ctrl0)
+	mxs_reg_32(hw_ssp_cmd0)
+	mxs_reg_32(hw_ssp_cmd1)
+	mxs_reg_32(hw_ssp_compref)
+	mxs_reg_32(hw_ssp_compmask)
+	mxs_reg_32(hw_ssp_timing)
+	mxs_reg_32(hw_ssp_ctrl1)
+	mxs_reg_32(hw_ssp_data)
+	mxs_reg_32(hw_ssp_sdresp0)
+	mxs_reg_32(hw_ssp_sdresp1)
+	mxs_reg_32(hw_ssp_sdresp2)
+	mxs_reg_32(hw_ssp_sdresp3)
+	mxs_reg_32(hw_ssp_status)
+
+	uint32_t	reserved1[12];
+
+	mxs_reg_32(hw_ssp_debug)
+	mxs_reg_32(hw_ssp_version)
+};
+#elif defined(CONFIG_MX28)
 struct mxs_ssp_regs {
 	mxs_reg_32(hw_ssp_ctrl0)
 	mxs_reg_32(hw_ssp_cmd0)
@@ -50,6 +72,7 @@ struct mxs_ssp_regs {
 	mxs_reg_32(hw_ssp_debug)
 	mxs_reg_32(hw_ssp_version)
 };
+#endif
 
 static inline struct mxs_ssp_regs *mxs_ssp_regs_by_bus(unsigned int port)
 {
@@ -90,6 +113,11 @@ static inline struct mxs_ssp_regs *mxs_ssp_regs_by_bus(unsigned int port)
 #define	SSP_CTRL0_GET_RESP			(1 << 17)
 #define	SSP_CTRL0_ENABLE			(1 << 16)
 
+#ifdef CONFIG_MX23
+#define	SSP_CTRL0_XFER_COUNT_OFFSET		0
+#define	SSP_CTRL0_XFER_COUNT_MASK		0xffff
+#endif
+
 #define	SSP_CMD0_SOFT_TERMINATE			(1 << 26)
 #define	SSP_CMD0_DBL_DATA_RATE_EN		(1 << 25)
 #define	SSP_CMD0_PRIM_BOOT_OP_EN		(1 << 24)
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 5/9] mx23_olinuxino: Add MMC support
  2013-01-22  1:47 ` [U-Boot] [PATCH 5/9] mx23_olinuxino: Add MMC support Otavio Salvador
@ 2013-01-22  1:47   ` Marek Vasut
  2013-01-22  1:58     ` Otavio Salvador
  0 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

Description is missing.

> From: Marek Vasut <marex@denx.de>
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
>  board/olimex/mx23_olinuxino/mx23_olinuxino.c | 17 ++++++++++++++++-
>  board/olimex/mx23_olinuxino/spl_boot.c       | 10 ++++++++++
>  include/configs/mx23_olinuxino.h             | 12 ++++++++++++
>  3 files changed, 38 insertions(+), 1 deletion(-)
> 
> diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c
> b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index 2fcad26..421ed9c
> 100644
> --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c
> +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c
> @@ -23,7 +23,10 @@
>   */
> 
>  #include <common.h>
> +#include <asm/io.h>
> +#include <asm/arch/iomux-mx23.h>
>  #include <asm/arch/imx-regs.h>
> +#include <asm/arch/clock.h>
>  #include <asm/arch/sys_proto.h>
> 
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -33,7 +36,12 @@ DECLARE_GLOBAL_DATA_PTR;
>   */
>  int board_early_init_f(void)
>  {
> -	/* SSP clock init will come here soon. */
> +	/* IO0 clock at 480MHz */
> +	mxs_set_ioclk(MXC_IOCLK0, 480000);
> +
> +	/* SSP0 clock at 96MHz */
> +	mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
> +
>  	return 0;
>  }
> 
> @@ -42,6 +50,13 @@ int dram_init(void)
>  	return mxs_dram_init();
>  }
> 
> +#ifdef	CONFIG_CMD_MMC
> +int board_mmc_init(bd_t *bis)
> +{
> +	return mxsmmc_initialize(bis, 0, NULL);
> +}
> +#endif
> +
>  int board_init(void)
>  {
>  	/* Adress of boot parameters */
> diff --git a/board/olimex/mx23_olinuxino/spl_boot.c
> b/board/olimex/mx23_olinuxino/spl_boot.c index aaebe6c..3cc40cd 100644
> --- a/board/olimex/mx23_olinuxino/spl_boot.c
> +++ b/board/olimex/mx23_olinuxino/spl_boot.c
> @@ -30,6 +30,7 @@
>  #include <asm/arch/sys_proto.h>
> 
>  #define	MUX_CONFIG_EMI	(MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL)
> +#define	MUX_CONFIG_SSP	(MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
> 
>  const iomux_cfg_t iomux_setup[] = {
>  	/* DUART */
> @@ -82,6 +83,15 @@ const iomux_cfg_t iomux_setup[] = {
>  	MX23_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
>  	MX23_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI,
>  	MX23_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI,
> +
> +	/* MMC 0 */
> +	MX23_PAD_SSP1_CMD__SSP1_CMD | MUX_CONFIG_SSP,
> +	MX23_PAD_SSP1_DETECT__SSP1_DETECT | MUX_CONFIG_SSP,
> +	MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP,
> +	MX23_PAD_SSP1_DATA1__SSP1_DATA1 | MUX_CONFIG_SSP,
> +	MX23_PAD_SSP1_DATA2__SSP1_DATA2 | MUX_CONFIG_SSP,
> +	MX23_PAD_SSP1_DATA3__SSP1_DATA3 | MUX_CONFIG_SSP,
> +	MX23_PAD_SSP1_SCK__SSP1_SCK | MUX_CONFIG_SSP,
>  };
> 
>  void board_init_ll(void)
> diff --git a/include/configs/mx23_olinuxino.h
> b/include/configs/mx23_olinuxino.h index e5e718c..bc63481 100644
> --- a/include/configs/mx23_olinuxino.h
> +++ b/include/configs/mx23_olinuxino.h
> @@ -53,8 +53,10 @@
>  #define	CONFIG_DOS_PARTITION
> 
>  #define	CONFIG_CMD_CACHE
> +#define	CONFIG_CMD_EXT2
>  #define	CONFIG_CMD_FAT
>  #define	CONFIG_CMD_GPIO
> +#define	CONFIG_CMD_MMC
> 
>  /*
>   * Memory configurations
> @@ -110,6 +112,16 @@
>  #define	CONFIG_BAUDRATE			115200	/* Default baud rate */
> 
>  /*
> + * MMC Driver
> + */
> +#ifdef	CONFIG_CMD_MMC
> +#define	CONFIG_MMC
> +#define	CONFIG_BOUNCE_BUFFER
> +#define	CONFIG_GENERIC_MMC
> +#define	CONFIG_MXS_MMC
> +#endif
> +
> +/*
>   * APBH DMA
>   */
>  #define CONFIG_APBH_DMA

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
  2013-01-22  1:47 ` [U-Boot] [PATCH 1/9] mx23: Add SSP registers map Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:45   ` Marek Vasut
  2013-01-22  1:47 ` [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI Otavio Salvador
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

From: Marek Vasut <marex@denx.de>

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 drivers/mmc/mxsmmc.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 0c4cd54..4b178be 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -211,14 +211,32 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 		}
 
 		ctrl0 |= SSP_CTRL0_DATA_XFER;
+
+		reg = data->blocksize * data->blocks;
+#if defined(CONFIG_MX23)
+		if (reg & ~SSP_CTRL0_XFER_COUNT_MASK) {
+			printf("MMC%d: Transfer too large (%i bytes)!\n",
+				mmc->block_dev.dev, reg);
+			return -EINVAL;
+		}
+
+		ctrl0 |= reg & SSP_CTRL0_XFER_COUNT_MASK;
+
+		reg = readl(&ssp_regs->hw_ssp_cmd0);
+		reg &= ~0xfff00;
+		reg |= (data->blocks - 1) << 8;
+		reg |= (ffs(data->blocksize) - 1) << 16;
+
+		writel(reg, &ssp_regs->hw_ssp_cmd0);
+#elif defined(CONFIG_MX28)
+		writel(reg, &ssp_regs->hw_ssp_xfer_size);
+
 		reg = ((data->blocks - 1) <<
 			SSP_BLOCK_SIZE_BLOCK_COUNT_OFFSET) |
 			((ffs(data->blocksize) - 1) <<
 			SSP_BLOCK_SIZE_BLOCK_SIZE_OFFSET);
 		writel(reg, &ssp_regs->hw_ssp_block_size);
-
-		reg = data->blocksize * data->blocks;
-		writel(reg, &ssp_regs->hw_ssp_xfer_size);
+#endif
 	}
 
 	/* Kick off the command */
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
  2013-01-22  1:47 ` [U-Boot] [PATCH 1/9] mx23: Add SSP registers map Otavio Salvador
  2013-01-22  1:47 ` [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:46   ` Marek Vasut
  2013-01-24 18:14   ` Marek Vasut
  2013-01-22  1:47 ` [U-Boot] [PATCH 4/9] mx23evk: Add initial board support Otavio Salvador
                   ` (5 subsequent siblings)
  8 siblings, 2 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 drivers/spi/mxs_spi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index bb865b7..10bf5aa 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -167,8 +167,13 @@ static int mxs_spi_xfer_pio(struct mxs_spi_slave *slave,
 		mxs_spi_start_xfer(ssp_regs);
 
 	while (length--) {
+#if defined(CONFIG_MX23)
+		writel(SSP_CTRL0_XFER_COUNT_MASK, &ssp_regs->hw_ssp_ctrl0_clr);
+		writel(1, &ssp_regs->hw_ssp_ctrl0_set);
+#elif defined(CONFIG_MX28)
 		/* We transfer 1 byte */
 		writel(1, &ssp_regs->hw_ssp_xfer_size);
+#endif
 
 		if ((flags & SPI_XFER_END) && !length)
 			mxs_spi_end_xfer(ssp_regs);
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 4/9] mx23evk: Add initial board support
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
                   ` (2 preceding siblings ...)
  2013-01-22  1:47 ` [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:46   ` Marek Vasut
  2013-01-22  2:30   ` Fabio Estevam
  2013-01-22  1:47 ` [U-Boot] [PATCH 5/9] mx23_olinuxino: Add MMC support Otavio Salvador
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 board/freescale/mx23evk/Makefile   |  47 +++++++
 board/freescale/mx23evk/mx23evk.c  |  81 ++++++++++++
 board/freescale/mx23evk/spl_boot.c | 115 +++++++++++++++++
 boards.cfg                         |   1 +
 include/configs/mx23evk.h          | 252 +++++++++++++++++++++++++++++++++++++
 5 files changed, 496 insertions(+)
 create mode 100644 board/freescale/mx23evk/Makefile
 create mode 100644 board/freescale/mx23evk/mx23evk.c
 create mode 100644 board/freescale/mx23evk/spl_boot.c
 create mode 100644 include/configs/mx23evk.h

diff --git a/board/freescale/mx23evk/Makefile b/board/freescale/mx23evk/Makefile
new file mode 100644
index 0000000..7518d7b
--- /dev/null
+++ b/board/freescale/mx23evk/Makefile
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+ifndef	CONFIG_SPL_BUILD
+COBJS	:= mx23evk.o
+else
+COBJS	:= spl_boot.o
+endif
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/freescale/mx23evk/mx23evk.c b/board/freescale/mx23evk/mx23evk.c
new file mode 100644
index 0000000..78c51b4
--- /dev/null
+++ b/board/freescale/mx23evk/mx23evk.c
@@ -0,0 +1,81 @@
+/*
+ * Freescale MX23EVK board
+ *
+ * (C) Copyright 2013 O.S. Systems Software LTDA.
+ *
+ * Author: Otavio Salvador <otavio@ossystems.com.br>
+ *
+ * Based on m28evk.c:
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ * on behalf of DENX Software Engineering GmbH
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <common.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/iomux-mx23.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Functions
+ */
+int board_early_init_f(void)
+{
+	/* IO0 clock at 480MHz */
+	mxs_set_ioclk(MXC_IOCLK0, 480000);
+
+	/* SSP0 clock at 96MHz */
+	mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
+
+	return 0;
+}
+
+int dram_init(void)
+{
+	return mxs_dram_init();
+}
+
+int board_init(void)
+{
+	/* Adress of boot parameters */
+	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+
+	return 0;
+}
+
+#ifdef	CONFIG_CMD_MMC
+static int mx23evk_mmc_wp(int id)
+{
+	if (id != 0) {
+		printf("MXS MMC: Invalid card selected (card id = %d)\n", id);
+		return 1;
+	}
+
+	return gpio_get_value(MX23_PAD_PWM4__GPIO_1_30);
+}
+
+int board_mmc_init(bd_t *bis)
+{
+	/* Configure WP as input */
+	gpio_direction_input(MX23_PAD_PWM4__GPIO_1_30);
+
+	/* Configure MMC0 Power Enable */
+	gpio_direction_output(MX23_PAD_PWM3__GPIO_1_29, 0);
+
+	return mxsmmc_initialize(bis, 0, mx23evk_mmc_wp);
+}
+#endif
diff --git a/board/freescale/mx23evk/spl_boot.c b/board/freescale/mx23evk/spl_boot.c
new file mode 100644
index 0000000..43cd114
--- /dev/null
+++ b/board/freescale/mx23evk/spl_boot.c
@@ -0,0 +1,115 @@
+/*
+ * Freescale MX23EVK Boot setup
+ *
+ * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
+ * on behalf of DENX Software Engineering GmbH
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <common.h>
+#include <config.h>
+#include <asm/io.h>
+#include <asm/arch/iomux-mx23.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/sys_proto.h>
+
+#define	MUX_CONFIG_SSP1	(MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
+#define	MUX_CONFIG_GPMI	(MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL)
+#define	MUX_CONFIG_EMI	(MXS_PAD_3V3 | MXS_PAD_16MA | MXS_PAD_PULLUP)
+
+const iomux_cfg_t iomux_setup[] = {
+	/* DUART */
+	MX23_PAD_PWM0__DUART_RX,
+	MX23_PAD_PWM1__DUART_TX,
+
+	/* AUART */
+	MX23_PAD_AUART1_RX__AUART1_RX | MXS_PAD_CTRL,
+	MX23_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL,
+	MX23_PAD_AUART1_CTS__AUART1_CTS | MXS_PAD_CTRL,
+	MX23_PAD_AUART1_RTS__AUART1_RTS | MXS_PAD_CTRL,
+
+	/* EMI */
+	MX23_PAD_EMI_D00__EMI_D00 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D01__EMI_D01 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D02__EMI_D02 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D03__EMI_D03 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D04__EMI_D04 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D05__EMI_D05 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D06__EMI_D06 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D07__EMI_D07 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D08__EMI_D08 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D09__EMI_D09 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D10__EMI_D10 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D11__EMI_D11 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D12__EMI_D12 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D13__EMI_D13 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D14__EMI_D14 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_D15__EMI_D15 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_DQM0__EMI_DQM0 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_DQM1__EMI_DQM1 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_DQS0__EMI_DQS0 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_DQS1__EMI_DQS1 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_CLK__EMI_CLK | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_CLKN__EMI_CLKN | MUX_CONFIG_EMI,
+
+	MX23_PAD_EMI_A00__EMI_A00 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A01__EMI_A01 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A02__EMI_A02 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A03__EMI_A03 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A04__EMI_A04 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A05__EMI_A05 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A06__EMI_A06 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A07__EMI_A07 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A08__EMI_A08 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A09__EMI_A09 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A10__EMI_A10 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A11__EMI_A11 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_A12__EMI_A12 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_BA0__EMI_BA0 | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_BA1__EMI_BA1 | MUX_CONFIG_EMI,
+
+	MX23_PAD_EMI_CASN__EMI_CASN | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_CE0N__EMI_CE0N | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_CE1N__EMI_CE1N | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI,
+	MX23_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI,
+
+	/* MMC 0 */
+	MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP1,
+	MX23_PAD_SSP1_DATA1__SSP1_DATA1 | MUX_CONFIG_SSP1,
+	MX23_PAD_SSP1_DATA2__SSP1_DATA2 | MUX_CONFIG_SSP1,
+	MX23_PAD_SSP1_DATA3__SSP1_DATA3 | MUX_CONFIG_SSP1,
+	MX23_PAD_GPMI_D08__SSP1_DATA4 | MUX_CONFIG_SSP1,
+	MX23_PAD_GPMI_D09__SSP1_DATA5 | MUX_CONFIG_SSP1,
+	MX23_PAD_GPMI_D10__SSP1_DATA6 | MUX_CONFIG_SSP1,
+	MX23_PAD_GPMI_D11__SSP1_DATA7 | MUX_CONFIG_SSP1,
+	MX23_PAD_SSP1_CMD__SSP1_CMD | MUX_CONFIG_SSP1,
+	MX23_PAD_SSP1_DETECT__SSP1_DETECT | MUX_CONFIG_SSP1,
+		(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+	MX23_PAD_SSP1_SCK__SSP1_SCK |
+		(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+	/* Write Protect Pin */
+	MX23_PAD_PWM4__GPIO_1_30 |
+		(MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+	/* Slot Power Enable */
+	MX23_PAD_PWM3__GPIO_1_29 |
+		(MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+};
+
+void board_init_ll(void)
+{
+	mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));
+}
diff --git a/boards.cfg b/boards.cfg
index 9b31931..7d03620 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -193,6 +193,7 @@ imx27lite                    arm         arm926ejs   imx27lite           logicpd
 magnesium                    arm         arm926ejs   imx27lite           logicpd        mx27
 mx23_olinuxino               arm         arm926ejs   mx23_olinuxino      olimex         mxs		mx23_olinuxino
 apx4devkit                   arm         arm926ejs   apx4devkit          bluegiga       mxs		apx4devkit
+mx23evk                      arm         arm926ejs   mx23evk             freescale      mxs		mx23evk
 m28evk                       arm         arm926ejs   m28evk              denx           mxs		m28evk
 mx28evk                      arm         arm926ejs   mx28evk             freescale      mxs		mx28evk
 sc_sps_1                     arm         arm926ejs   sc_sps_1            schulercontrol mxs
diff --git a/include/configs/mx23evk.h b/include/configs/mx23evk.h
new file mode 100644
index 0000000..27f1b70
--- /dev/null
+++ b/include/configs/mx23evk.h
@@ -0,0 +1,252 @@
+/*
+ * Freescale i.MX23 CLKCTRL Register Definitions
+ *
+ * Copyright (C) 2013 Otavio Salvador <otavio@ossystems.com.br>
+ * on behalf of O.S. Systems Software LTDA.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ */
+#ifndef __MX23EVK_CONFIG_H__
+#define __MX23EVK_CONFIG_H__
+
+/*
+ * SoC configurations
+ */
+#define CONFIG_MX23				/* i.MX23 SoC */
+
+#include <asm/arch/regs-base.h>
+
+#define CONFIG_MXS_GPIO			/* GPIO control */
+#define CONFIG_SYS_HZ		1000		/* Ticks per second */
+
+#define CONFIG_MACH_TYPE	MACH_TYPE_MX23EVK
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_SYS_ICACHE_OFF
+#define CONFIG_SYS_DCACHE_OFF
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_ARCH_MISC_INIT
+
+/*
+ * SPL
+ */
+#define CONFIG_SPL
+#define CONFIG_SPL_NO_CPU_SUPPORT_CODE
+#define CONFIG_SPL_START_S_PATH	"arch/arm/cpu/arm926ejs/mxs"
+#define CONFIG_SPL_LDSCRIPT	"arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
+
+/*
+ * U-Boot Commands
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DOS_PARTITION
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DATE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_GPIO
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_BOOTZ
+
+/*
+ * Memory configurations
+ */
+#define CONFIG_NR_DRAM_BANKS		1		/* 1 bank of DRAM */
+#define PHYS_SDRAM_1			0x40000000	/* Base address */
+#define PHYS_SDRAM_1_SIZE		0x08000000  /* Max 128 MB RAM */
+#define CONFIG_STACKSIZE		(128 * 1024)	/* 128 KB stack */
+#define CONFIG_SYS_MALLOC_LEN		0x00400000	/* 4 MB for malloc */
+#define CONFIG_SYS_MEMTEST_START	0x40000000	/* Memtest start adr */
+#define CONFIG_SYS_MEMTEST_END		0x40400000	/* 4 MB RAM test */
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+/* Point initial SP in SRAM so SPL can use it too. */
+
+#define CONFIG_SYS_INIT_RAM_ADDR	0x00000000
+#define CONFIG_SYS_INIT_RAM_SIZE	(128 * 1024)
+
+#define CONFIG_SYS_INIT_SP_OFFSET \
+	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR \
+	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
+
+/*
+ * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
+ * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
+ * binary. In case there was more of this mess, 0x100 bytes are skipped.
+ */
+#define CONFIG_SYS_TEXT_BASE	0x40000100
+
+#define CONFIG_ENV_OVERWRITE
+
+/*
+ * U-Boot general configurations
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_SYS_PROMPT	"MX23EVK U-Boot > "
+#define CONFIG_SYS_CBSIZE	256		/* Console I/O buffer size */
+#define CONFIG_SYS_PBSIZE	\
+	(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+						/* Print buffer size */
+#define CONFIG_SYS_MAXARGS	32		/* Max number of command args */
+#define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE
+						/* Boot argument buffer size */
+#define CONFIG_VERSION_VARIABLE	/* U-BOOT version */
+#define CONFIG_AUTO_COMPLETE		/* Command auto complete */
+#define CONFIG_CMDLINE_EDITING		/* Command history etc */
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
+
+/*
+ * Serial Driver
+ */
+#define CONFIG_PL011_SERIAL
+#define CONFIG_PL011_CLOCK		24000000
+#define CONFIG_PL01x_PORTS		{ (void *)MXS_UARTDBG_BASE }
+#define CONFIG_CONS_INDEX		0
+#define CONFIG_BAUDRATE			115200	/* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
+
+/*
+ * DMA
+ */
+#define CONFIG_APBH_DMA
+
+/*
+ * MMC Driver
+ */
+#define CONFIG_ENV_IS_IN_MMC
+#ifdef CONFIG_ENV_IS_IN_MMC
+ #define CONFIG_ENV_OFFSET	(256 * 1024)
+ #define CONFIG_ENV_SIZE	(16 * 1024)
+ #define CONFIG_SYS_MMC_ENV_DEV 0
+#endif
+#define CONFIG_CMD_SAVEENV
+#ifdef	CONFIG_CMD_MMC
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_BOUNCE_BUFFER
+#define CONFIG_MXS_MMC
+#endif
+
+/*
+ * RTC
+ */
+#ifdef	CONFIG_CMD_DATE
+#define	CONFIG_RTC_MXS
+#endif
+
+/*
+ * USB
+ */
+#ifdef	CONFIG_CMD_USB
+#define	CONFIG_USB_EHCI
+#define	CONFIG_USB_EHCI_MXS
+#define	CONFIG_EHCI_MXS_PORT 1
+#define	CONFIG_EHCI_IS_TDI
+#define	CONFIG_USB_STORAGE
+#endif
+
+/*
+ * SPI
+ */
+#ifdef CONFIG_CMD_SPI
+#define CONFIG_HARD_SPI
+#define CONFIG_MXS_SPI
+#define CONFIG_SPI_HALF_DUPLEX
+#define CONFIG_DEFAULT_SPI_BUS		2
+#define CONFIG_DEFAULT_SPI_MODE		SPI_MODE_0
+#endif
+
+/*
+ * Boot Linux
+ */
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_BOOTDELAY	3
+#define CONFIG_BOOTFILE	"uImage"
+#define CONFIG_LOADADDR	0x42000000
+#define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
+#define CONFIG_OF_LIBFDT
+
+/*
+ * Extra Environments
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"update_sd_firmware_filename=u-boot.sd\0" \
+	"update_sd_firmware="		/* Update the SD firmware partition */ \
+		"if mmc rescan ; then "	\
+		"if tftp ${update_sd_firmware_filename} ; then " \
+		"setexpr fw_sz ${filesize} / 0x200 ; "	/* SD block size */ \
+		"setexpr fw_sz ${fw_sz} + 1 ; "	\
+		"mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
+		"fi ; "	\
+		"fi\0" \
+	"script=boot.scr\0"	\
+	"uimage=uImage\0" \
+	"console=ttyAMA0\0" \
+	"fdt_file=imx23-evk.dtb\0" \
+	"fdt_addr=0x41000000\0" \
+	"boot_fdt=try\0" \
+	"mmcdev=0\0" \
+	"mmcpart=2\0" \
+	"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
+	"mmcargs=setenv bootargs console=${console},${baudrate} " \
+		"root=${mmcroot}\0" \
+	"loadbootscript="  \
+		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+	"bootscript=echo Running bootscript from mmc ...; "	\
+		"source\0" \
+	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
+	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+			"if run loadfdt; then " \
+				"bootm ${loadaddr} - ${fdt_addr}; " \
+			"else " \
+				"if test ${boot_fdt} = try; then " \
+					"bootm; " \
+				"else " \
+					"echo WARN: Cannot load the DT; " \
+				"fi; " \
+			"fi; " \
+		"else " \
+			"bootm; " \
+		"fi;\0"
+
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else " \
+				"echo ERR: Fail to boot from MMC; " \
+			"fi; " \
+		"fi; " \
+	"else exit; fi"
+
+#endif /* __MX23EVK_CONFIG_H__ */
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 5/9] mx23_olinuxino: Add MMC support
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
                   ` (3 preceding siblings ...)
  2013-01-22  1:47 ` [U-Boot] [PATCH 4/9] mx23evk: Add initial board support Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:47   ` Marek Vasut
  2013-01-22  1:47 ` [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection Otavio Salvador
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

From: Marek Vasut <marex@denx.de>

Signed-off-by: Marek Vasut <marex@denx.de>
---
 board/olimex/mx23_olinuxino/mx23_olinuxino.c | 17 ++++++++++++++++-
 board/olimex/mx23_olinuxino/spl_boot.c       | 10 ++++++++++
 include/configs/mx23_olinuxino.h             | 12 ++++++++++++
 3 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c
index 2fcad26..421ed9c 100644
--- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c
+++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c
@@ -23,7 +23,10 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
+#include <asm/arch/iomux-mx23.h>
 #include <asm/arch/imx-regs.h>
+#include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -33,7 +36,12 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int board_early_init_f(void)
 {
-	/* SSP clock init will come here soon. */
+	/* IO0 clock at 480MHz */
+	mxs_set_ioclk(MXC_IOCLK0, 480000);
+
+	/* SSP0 clock at 96MHz */
+	mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);
+
 	return 0;
 }
 
@@ -42,6 +50,13 @@ int dram_init(void)
 	return mxs_dram_init();
 }
 
+#ifdef	CONFIG_CMD_MMC
+int board_mmc_init(bd_t *bis)
+{
+	return mxsmmc_initialize(bis, 0, NULL);
+}
+#endif
+
 int board_init(void)
 {
 	/* Adress of boot parameters */
diff --git a/board/olimex/mx23_olinuxino/spl_boot.c b/board/olimex/mx23_olinuxino/spl_boot.c
index aaebe6c..3cc40cd 100644
--- a/board/olimex/mx23_olinuxino/spl_boot.c
+++ b/board/olimex/mx23_olinuxino/spl_boot.c
@@ -30,6 +30,7 @@
 #include <asm/arch/sys_proto.h>
 
 #define	MUX_CONFIG_EMI	(MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL)
+#define	MUX_CONFIG_SSP	(MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
 
 const iomux_cfg_t iomux_setup[] = {
 	/* DUART */
@@ -82,6 +83,15 @@ const iomux_cfg_t iomux_setup[] = {
 	MX23_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
 	MX23_PAD_EMI_RASN__EMI_RASN | MUX_CONFIG_EMI,
 	MX23_PAD_EMI_WEN__EMI_WEN | MUX_CONFIG_EMI,
+
+	/* MMC 0 */
+	MX23_PAD_SSP1_CMD__SSP1_CMD | MUX_CONFIG_SSP,
+	MX23_PAD_SSP1_DETECT__SSP1_DETECT | MUX_CONFIG_SSP,
+	MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP,
+	MX23_PAD_SSP1_DATA1__SSP1_DATA1 | MUX_CONFIG_SSP,
+	MX23_PAD_SSP1_DATA2__SSP1_DATA2 | MUX_CONFIG_SSP,
+	MX23_PAD_SSP1_DATA3__SSP1_DATA3 | MUX_CONFIG_SSP,
+	MX23_PAD_SSP1_SCK__SSP1_SCK | MUX_CONFIG_SSP,
 };
 
 void board_init_ll(void)
diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
index e5e718c..bc63481 100644
--- a/include/configs/mx23_olinuxino.h
+++ b/include/configs/mx23_olinuxino.h
@@ -53,8 +53,10 @@
 #define	CONFIG_DOS_PARTITION
 
 #define	CONFIG_CMD_CACHE
+#define	CONFIG_CMD_EXT2
 #define	CONFIG_CMD_FAT
 #define	CONFIG_CMD_GPIO
+#define	CONFIG_CMD_MMC
 
 /*
  * Memory configurations
@@ -110,6 +112,16 @@
 #define	CONFIG_BAUDRATE			115200	/* Default baud rate */
 
 /*
+ * MMC Driver
+ */
+#ifdef	CONFIG_CMD_MMC
+#define	CONFIG_MMC
+#define	CONFIG_BOUNCE_BUFFER
+#define	CONFIG_GENERIC_MMC
+#define	CONFIG_MXS_MMC
+#endif
+
+/*
  * APBH DMA
  */
 #define CONFIG_APBH_DMA
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
                   ` (4 preceding siblings ...)
  2013-01-22  1:47 ` [U-Boot] [PATCH 5/9] mx23_olinuxino: Add MMC support Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:48   ` Marek Vasut
  2013-01-22  1:47 ` [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment Otavio Salvador
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 drivers/mmc/mxsmmc.c             | 2 ++
 include/configs/mx23_olinuxino.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 4b178be..618659e 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -165,11 +165,13 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 		return TIMEOUT;
 	}
 
+#ifndef CONFIG_MMC_SKIP_CARD_DETECT
 	/* See if card is present */
 	if (readl(&ssp_regs->hw_ssp_status) & SSP_STATUS_CARD_DETECT) {
 		printf("MMC%d: No card detected!\n", mmc->block_dev.dev);
 		return NO_CARD_ERR;
 	}
+#endif
 
 	/* Start building CTRL0 contents */
 	ctrl0 = priv->buswidth;
diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
index bc63481..a62e3a2 100644
--- a/include/configs/mx23_olinuxino.h
+++ b/include/configs/mx23_olinuxino.h
@@ -116,6 +116,7 @@
  */
 #ifdef	CONFIG_CMD_MMC
 #define	CONFIG_MMC
+#define	CONFIG_MMC_SKIP_CARD_DETECT
 #define	CONFIG_BOUNCE_BUFFER
 #define	CONFIG_GENERIC_MMC
 #define	CONFIG_MXS_MMC
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
                   ` (5 preceding siblings ...)
  2013-01-22  1:47 ` [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:49   ` Marek Vasut
  2013-01-22  2:34   ` Fabio Estevam
  2013-01-22  1:47 ` [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23 Otavio Salvador
  2013-01-22  1:47 ` [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC Otavio Salvador
  8 siblings, 2 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 include/configs/mx23_olinuxino.h | 90 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 89 insertions(+), 1 deletion(-)

diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
index a62e3a2..7d34168 100644
--- a/include/configs/mx23_olinuxino.h
+++ b/include/configs/mx23_olinuxino.h
@@ -140,9 +140,97 @@
 #define	CONFIG_SETUP_MEMORY_TAGS
 #define	CONFIG_BOOTDELAY	3
 #define	CONFIG_BOOTFILE		"uImage"
-#define	CONFIG_BOOTARGS		"console=ttyAMA0,115200n8 "
 #define	CONFIG_LOADADDR		0x42000000
 #define	CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 #define	CONFIG_OF_LIBFDT
 
+/*
+ * Extra Environments
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"update_sd_firmware_filename=u-boot.sd\0" \
+	"update_nand_full_filename=u-boot.nand\0" \
+	"update_nand_firmware_filename=u-boot.sb\0"	\
+	"update_sd_firmware_filename=u-boot.sd\0" \
+	"update_nand_firmware_maxsz=0x100000\0"	\
+	"update_nand_stride=0x40\0"	/* MX28 datasheet ch. 12.12 */ \
+	"update_nand_count=0x4\0"	/* MX28 datasheet ch. 12.12 */ \
+	"update_nand_get_fcb_size="	/* Get size of FCB blocks */ \
+		"nand device 0 ; " \
+		"nand info ; " \
+		"setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
+		"setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
+	"update_nand_full="		    /* Update FCB, DBBT and FW */ \
+		"if tftp ${update_nand_full_filename} ; then " \
+		"run update_nand_get_fcb_size ; " \
+		"nand scrub -y 0x0 ${filesize} ; " \
+		"nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
+		"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
+		"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
+		"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
+		"fi\0" \
+	"update_nand_firmware="		/* Update only firmware */ \
+		"if tftp ${update_nand_firmware_filename} ; then " \
+		"run update_nand_get_fcb_size ; " \
+		"setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
+		"setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
+		"setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
+		"nand erase ${fcb_sz} ${fw_sz} ; " \
+		"nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
+		"nand write ${loadaddr} ${fw_off} ${filesize} ; " \
+		"fi\0" \
+	"update_sd_firmware="		/* Update the SD firmware partition */ \
+		"if mmc rescan ; then "	\
+		"if tftp ${update_sd_firmware_filename} ; then " \
+		"setexpr fw_sz ${filesize} / 0x200 ; "	/* SD block size */ \
+		"setexpr fw_sz ${fw_sz} + 1 ; "	\
+		"mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
+		"fi ; "	\
+		"fi\0" \
+	"script=boot.scr\0"	\
+	"uimage=uImage\0" \
+	"console=ttyAMA0\0" \
+	"fdt_file=imx23-evk.dtb\0" \
+	"fdt_addr=0x41000000\0" \
+	"boot_fdt=try\0" \
+	"mmcdev=0\0" \
+	"mmcpart=2\0" \
+	"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
+	"mmcargs=setenv bootargs console=${console},${baudrate} " \
+		"root=${mmcroot}\0" \
+	"loadbootscript="  \
+		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+	"bootscript=echo Running bootscript from mmc ...; "	\
+		"source\0" \
+	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
+	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+			"if run loadfdt; then " \
+				"bootm ${loadaddr} - ${fdt_addr}; " \
+			"else " \
+				"if test ${boot_fdt} = try; then " \
+					"bootm; " \
+				"else " \
+					"echo WARN: Cannot load the DT; " \
+				"fi; " \
+			"fi; " \
+		"else " \
+			"bootm; " \
+		"fi;\0"
+
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else " \
+				"echo ERR: Fail to boot from MMC; " \
+			"fi; " \
+		"fi; " \
+	"else exit; fi"
+
 #endif /* __MX23_OLINUXINO_CONFIG_H__ */
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
                   ` (6 preceding siblings ...)
  2013-01-22  1:47 ` [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:49   ` Marek Vasut
  2013-01-22  1:47 ` [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC Otavio Salvador
  8 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

This does the same reset mask as done in v3.7 Linux kernel code; it
fixed the saveenv command in mx23evk.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 drivers/mmc/mxsmmc.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 618659e..0a3f0c4 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -354,11 +354,17 @@ static int mxsmmc_init(struct mmc *mmc)
 	/* Reset SSP */
 	mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
 
-	/* 8 bits word length in MMC mode */
-	clrsetbits_le32(&ssp_regs->hw_ssp_ctrl1,
-		SSP_CTRL1_SSP_MODE_MASK | SSP_CTRL1_WORD_LENGTH_MASK |
-		SSP_CTRL1_DMA_ENABLE,
-		SSP_CTRL1_SSP_MODE_SD_MMC | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS);
+	/* Reset MMC */
+	writel(SSP_CTRL1_SSP_MODE_SD_MMC |
+		SSP_CTRL1_WORD_LENGTH_EIGHT_BITS |
+		SSP_CTRL1_DMA_ENABLE |
+		SSP_CTRL1_POLARITY |
+		SSP_CTRL1_RECV_TIMEOUT_IRQ_EN |
+		SSP_CTRL1_DATA_CRC_IRQ_EN |
+		SSP_CTRL1_DATA_TIMEOUT_IRQ_EN |
+		SSP_CTRL1_RESP_TIMEOUT_IRQ_EN |
+		SSP_CTRL1_RESP_ERR_IRQ_EN,
+		&ssp_regs->hw_ssp_ctrl1_set);
 
 	/* Set initial bit clock 400 KHz */
 	mxs_set_ssp_busclock(priv->id, 400);
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
                   ` (7 preceding siblings ...)
  2013-01-22  1:47 ` [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23 Otavio Salvador
@ 2013-01-22  1:47 ` Otavio Salvador
  2013-01-22  1:50   ` Marek Vasut
  8 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:47 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 drivers/mmc/mxsmmc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 0a3f0c4..628d609 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -50,6 +50,7 @@ struct mxsmmc_priv {
 	uint32_t		buswidth;
 	int			(*mmc_is_wp)(int);
 	struct mxs_dma_desc	*desc;
+	int force_pio;
 };
 
 #define	MXSMMC_MAX_TIMEOUT	10000
@@ -184,7 +185,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 	if (cmd->resp_type & MMC_RSP_136)	/* It's a 136 bits response */
 		ctrl0 |= SSP_CTRL0_LONG_RESP;
 
-	if (data && (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER))
+	if (priv->force_pio || (data && (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER)))
 		writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_clr);
 	else
 		writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_set);
@@ -287,7 +288,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 	if (!data)
 		return 0;
 
-	if (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER) {
+	if (priv->force_pio || (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER)) {
 		ret = mxsmmc_send_cmd_pio(priv, data);
 		if (ret) {
 			printf("MMC%d: Data timeout with command %d "
@@ -385,9 +386,11 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
 #if defined(CONFIG_MX23)
 	const unsigned int mxsmmc_max_id = 2;
 	const unsigned int mxsmmc_clk_id = 0;
+	const unsigned int mxsmmc_force_pio = 1;
 #elif defined(CONFIG_MX28)
 	const unsigned int mxsmmc_max_id = 4;
 	const unsigned int mxsmmc_clk_id = id;
+	const unsigned int mxsmmc_force_pio = 0;
 #endif
 
 	if (id >= mxsmmc_max_id)
@@ -417,6 +420,7 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
 	priv->mmc_is_wp = wp;
 	priv->id = id;
 	priv->regs = mxs_ssp_regs_by_bus(id);
+	priv->force_pio = mxsmmc_force_pio;
 
 	sprintf(mmc->name, "MXS MMC");
 	mmc->send_cmd = mxsmmc_send_cmd;
-- 
1.8.1

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection
  2013-01-22  1:47 ` [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection Otavio Salvador
@ 2013-01-22  1:48   ` Marek Vasut
  2013-01-22  1:58     ` Otavio Salvador
  0 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:48 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  drivers/mmc/mxsmmc.c             | 2 ++
>  include/configs/mx23_olinuxino.h | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> index 4b178be..618659e 100644
> --- a/drivers/mmc/mxsmmc.c
> +++ b/drivers/mmc/mxsmmc.c
> @@ -165,11 +165,13 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) return TIMEOUT;
>  	}
> 
> +#ifndef CONFIG_MMC_SKIP_CARD_DETECT

Undocumented feature added. I think mxsmmc_register() call can take a param for 
this.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment
  2013-01-22  1:47 ` [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment Otavio Salvador
@ 2013-01-22  1:49   ` Marek Vasut
  2013-01-22  2:00     ` Otavio Salvador
  2013-01-22  2:34   ` Fabio Estevam
  1 sibling, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:49 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

Description missing.

> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  include/configs/mx23_olinuxino.h | 90
> +++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+),
> 1 deletion(-)
> 
> diff --git a/include/configs/mx23_olinuxino.h
> b/include/configs/mx23_olinuxino.h index a62e3a2..7d34168 100644
> --- a/include/configs/mx23_olinuxino.h
> +++ b/include/configs/mx23_olinuxino.h
> @@ -140,9 +140,97 @@
>  #define	CONFIG_SETUP_MEMORY_TAGS
>  #define	CONFIG_BOOTDELAY	3
>  #define	CONFIG_BOOTFILE		"uImage"
> -#define	CONFIG_BOOTARGS		"console=ttyAMA0,115200n8 "

No need to remove this.

>  #define	CONFIG_LOADADDR		0x42000000
>  #define	CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
>  #define	CONFIG_OF_LIBFDT
> 
> +/*
> + * Extra Environments
> + */
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> +	"update_sd_firmware_filename=u-boot.sd\0" \
> +	"update_nand_full_filename=u-boot.nand\0" \
> +	"update_nand_firmware_filename=u-boot.sb\0"	\
> +	"update_sd_firmware_filename=u-boot.sd\0" \
> +	"update_nand_firmware_maxsz=0x100000\0"	\
> +	"update_nand_stride=0x40\0"	/* MX28 datasheet ch. 12.12 */ \
> +	"update_nand_count=0x4\0"	/* MX28 datasheet ch. 12.12 */ \
> +	"update_nand_get_fcb_size="	/* Get size of FCB blocks */ \

This board has no NAND.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23
  2013-01-22  1:47 ` [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23 Otavio Salvador
@ 2013-01-22  1:49   ` Marek Vasut
  2013-01-22  2:03     ` Otavio Salvador
  0 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:49 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> This does the same reset mask as done in v3.7 Linux kernel code; it
> fixed the saveenv command in mx23evk.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  drivers/mmc/mxsmmc.c | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> index 618659e..0a3f0c4 100644
> --- a/drivers/mmc/mxsmmc.c
> +++ b/drivers/mmc/mxsmmc.c
> @@ -354,11 +354,17 @@ static int mxsmmc_init(struct mmc *mmc)
>  	/* Reset SSP */
>  	mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
> 
> -	/* 8 bits word length in MMC mode */
> -	clrsetbits_le32(&ssp_regs->hw_ssp_ctrl1,
> -		SSP_CTRL1_SSP_MODE_MASK | SSP_CTRL1_WORD_LENGTH_MASK |
> -		SSP_CTRL1_DMA_ENABLE,
> -		SSP_CTRL1_SSP_MODE_SD_MMC | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS);
> +	/* Reset MMC */
> +	writel(SSP_CTRL1_SSP_MODE_SD_MMC |
> +		SSP_CTRL1_WORD_LENGTH_EIGHT_BITS |
> +		SSP_CTRL1_DMA_ENABLE |
> +		SSP_CTRL1_POLARITY |

Will this addition not break mx28?

> +		SSP_CTRL1_RECV_TIMEOUT_IRQ_EN |
> +		SSP_CTRL1_DATA_CRC_IRQ_EN |
> +		SSP_CTRL1_DATA_TIMEOUT_IRQ_EN |
> +		SSP_CTRL1_RESP_TIMEOUT_IRQ_EN |
> +		SSP_CTRL1_RESP_ERR_IRQ_EN,
> +		&ssp_regs->hw_ssp_ctrl1_set);
> 
>  	/* Set initial bit clock 400 KHz */
>  	mxs_set_ssp_busclock(priv->id, 400);

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-22  1:47 ` [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC Otavio Salvador
@ 2013-01-22  1:50   ` Marek Vasut
  2013-01-22  1:56     ` Otavio Salvador
  0 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:50 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

NAK. DMA works on MX28 and works in Linux on MX23, therefore the DMA is not 
broken on either. Thus there's no reason to introduce such "force_pio" stuff.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode
  2013-01-22  1:45   ` Marek Vasut
@ 2013-01-22  1:53     ` Otavio Salvador
  2013-01-22  2:01       ` Marek Vasut
  0 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:53 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:45 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> From: Marek Vasut <marex@denx.de>
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  drivers/mmc/mxsmmc.c | 24 +++++++++++++++++++++---
>>  1 file changed, 21 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
>> index 0c4cd54..4b178be 100644
>> --- a/drivers/mmc/mxsmmc.c
>> +++ b/drivers/mmc/mxsmmc.c
>> @@ -211,14 +211,32 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>> struct mmc_data *data) }
>>
>>               ctrl0 |= SSP_CTRL0_DATA_XFER;
>> +
>> +             reg = data->blocksize * data->blocks;
>> +#if defined(CONFIG_MX23)
>> +             if (reg & ~SSP_CTRL0_XFER_COUNT_MASK) {
>> +                     printf("MMC%d: Transfer too large (%i bytes)!\n",
>> +                             mmc->block_dev.dev, reg);
>> +                     return -EINVAL;
>> +             }
>> +
>> +             ctrl0 |= reg & SSP_CTRL0_XFER_COUNT_MASK;
>> +
>> +             reg = readl(&ssp_regs->hw_ssp_cmd0);
>> +             reg &= ~0xfff00;
>> +             reg |= (data->blocks - 1) << 8;
>> +             reg |= (ffs(data->blocksize) - 1) << 16;
>
> This is using some random hard-coded offsets, I told you numerous times I will
> NAK this.

It is your patch ;-) So ...

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI
  2013-01-22  1:46   ` Marek Vasut
@ 2013-01-22  1:55     ` Otavio Salvador
  2013-01-22  2:00       ` Marek Vasut
  0 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:55 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:46 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
> Description missing. Was this ever tested? Does SSP DMA work?
>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

No; I did not test it as NAND support is not yet done but this was
need to get it going. This is exactly same code as done in v3.7 kernel
so seems fine.

What you want added in description?

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-22  1:50   ` Marek Vasut
@ 2013-01-22  1:56     ` Otavio Salvador
  2013-01-22  1:59       ` Marek Vasut
  2013-01-23  9:04       ` Stefano Babic
  0 siblings, 2 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:56 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:50 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
> NAK. DMA works on MX28 and works in Linux on MX23, therefore the DMA is not
> broken on either. Thus there's no reason to introduce such "force_pio" stuff.

Lack of time to work on it is one reason. I won't be able to work on
it for some days and I prefer a working solution than skip it for
another release.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection
  2013-01-22  1:48   ` Marek Vasut
@ 2013-01-22  1:58     ` Otavio Salvador
  2013-01-22  1:59       ` Marek Vasut
  0 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:58 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:48 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  drivers/mmc/mxsmmc.c             | 2 ++
>>  include/configs/mx23_olinuxino.h | 1 +
>>  2 files changed, 3 insertions(+)
>>
>> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
>> index 4b178be..618659e 100644
>> --- a/drivers/mmc/mxsmmc.c
>> +++ b/drivers/mmc/mxsmmc.c
>> @@ -165,11 +165,13 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>> struct mmc_data *data) return TIMEOUT;
>>       }
>>
>> +#ifndef CONFIG_MMC_SKIP_CARD_DETECT
>
> Undocumented feature added. I think mxsmmc_register() call can take a param for
> this.

Where I should document it? mmc_register cannot.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 5/9] mx23_olinuxino: Add MMC support
  2013-01-22  1:47   ` Marek Vasut
@ 2013-01-22  1:58     ` Otavio Salvador
  0 siblings, 0 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  1:58 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:47 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
> Description is missing.
>
>> From: Marek Vasut <marex@denx.de>
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>

Please provide me the description you wish and I amend it.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-22  1:56     ` Otavio Salvador
@ 2013-01-22  1:59       ` Marek Vasut
  2013-01-23  9:04       ` Stefano Babic
  1 sibling, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:59 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Mon, Jan 21, 2013 at 11:50 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> > NAK. DMA works on MX28 and works in Linux on MX23, therefore the DMA is
> > not broken on either. Thus there's no reason to introduce such
> > "force_pio" stuff.
> 
> Lack of time to work on it is one reason. I won't be able to work on
> it for some days and I prefer a working solution than skip it for
> another release.

The solution you propose adds undocumented feature and is not working, this is 
clearly a workaround.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection
  2013-01-22  1:58     ` Otavio Salvador
@ 2013-01-22  1:59       ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  1:59 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Mon, Jan 21, 2013 at 11:48 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> >> ---
> >> 
> >>  drivers/mmc/mxsmmc.c             | 2 ++
> >>  include/configs/mx23_olinuxino.h | 1 +
> >>  2 files changed, 3 insertions(+)
> >> 
> >> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> >> index 4b178be..618659e 100644
> >> --- a/drivers/mmc/mxsmmc.c
> >> +++ b/drivers/mmc/mxsmmc.c
> >> @@ -165,11 +165,13 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd
> >> *cmd, struct mmc_data *data) return TIMEOUT;
> >> 
> >>       }
> >> 
> >> +#ifndef CONFIG_MMC_SKIP_CARD_DETECT
> > 
> > Undocumented feature added. I think mxsmmc_register() call can take a
> > param for this.
> 
> Where I should document it? mmc_register cannot.

mxsmmc_initialize() can.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI
  2013-01-22  1:55     ` Otavio Salvador
@ 2013-01-22  2:00       ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  2:00 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Mon, Jan 21, 2013 at 11:46 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> > Description missing. Was this ever tested? Does SSP DMA work?
> > 
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> 
> No; I did not test it as NAND support is not yet done but this was
> need to get it going. This is exactly same code as done in v3.7 kernel
> so seems fine.

SPI has nothing to do with NAND. Please at least test code or clearly state the 
code was untested.

> What you want added in description?

What this patch does.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment
  2013-01-22  1:49   ` Marek Vasut
@ 2013-01-22  2:00     ` Otavio Salvador
  0 siblings, 0 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  2:00 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:49 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
> Description missing.
>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  include/configs/mx23_olinuxino.h | 90
>> +++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+),
>> 1 deletion(-)
>>
>> diff --git a/include/configs/mx23_olinuxino.h
>> b/include/configs/mx23_olinuxino.h index a62e3a2..7d34168 100644
>> --- a/include/configs/mx23_olinuxino.h
>> +++ b/include/configs/mx23_olinuxino.h
>> @@ -140,9 +140,97 @@
>>  #define      CONFIG_SETUP_MEMORY_TAGS
>>  #define      CONFIG_BOOTDELAY        3
>>  #define      CONFIG_BOOTFILE         "uImage"
>> -#define      CONFIG_BOOTARGS         "console=ttyAMA0,115200n8 "
>
> No need to remove this.

It has an extended version in the end.

>>  #define      CONFIG_LOADADDR         0x42000000
>>  #define      CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR
>>  #define      CONFIG_OF_LIBFDT
>>
>> +/*
>> + * Extra Environments
>> + */
>> +#define CONFIG_EXTRA_ENV_SETTINGS \
>> +     "update_sd_firmware_filename=u-boot.sd\0" \
>> +     "update_nand_full_filename=u-boot.nand\0" \
>> +     "update_nand_firmware_filename=u-boot.sb\0"     \
>> +     "update_sd_firmware_filename=u-boot.sd\0" \
>> +     "update_nand_firmware_maxsz=0x100000\0" \
>> +     "update_nand_stride=0x40\0"     /* MX28 datasheet ch. 12.12 */ \
>> +     "update_nand_count=0x4\0"       /* MX28 datasheet ch. 12.12 */ \
>> +     "update_nand_get_fcb_size="     /* Get size of FCB blocks */ \
>
> This board has no NAND.

Good catch; will drop it for v2 after Stefano and Fabio's comments.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode
  2013-01-22  1:53     ` Otavio Salvador
@ 2013-01-22  2:01       ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  2:01 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Mon, Jan 21, 2013 at 11:45 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> >> From: Marek Vasut <marex@denx.de>
> >> 
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> >> ---
> >> 
> >>  drivers/mmc/mxsmmc.c | 24 +++++++++++++++++++++---
> >>  1 file changed, 21 insertions(+), 3 deletions(-)
> >> 
> >> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> >> index 0c4cd54..4b178be 100644
> >> --- a/drivers/mmc/mxsmmc.c
> >> +++ b/drivers/mmc/mxsmmc.c
> >> @@ -211,14 +211,32 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd
> >> *cmd, struct mmc_data *data) }
> >> 
> >>               ctrl0 |= SSP_CTRL0_DATA_XFER;
> >> 
> >> +
> >> +             reg = data->blocksize * data->blocks;
> >> +#if defined(CONFIG_MX23)
> >> +             if (reg & ~SSP_CTRL0_XFER_COUNT_MASK) {
> >> +                     printf("MMC%d: Transfer too large (%i bytes)!\n",
> >> +                             mmc->block_dev.dev, reg);
> >> +                     return -EINVAL;
> >> +             }
> >> +
> >> +             ctrl0 |= reg & SSP_CTRL0_XFER_COUNT_MASK;
> >> +
> >> +             reg = readl(&ssp_regs->hw_ssp_cmd0);
> >> +             reg &= ~0xfff00;
> >> +             reg |= (data->blocks - 1) << 8;
> >> +             reg |= (ffs(data->blocksize) - 1) << 16;
> > 
> > This is using some random hard-coded offsets, I told you numerous times I
> > will NAK this.
> 
> It is your patch ;-) So ...

So I'll NAK it. I have no problem with it. Besides, this is only based on my 
work, but whatever.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 4/9] mx23evk: Add initial board support
  2013-01-22  1:46   ` Marek Vasut
@ 2013-01-22  2:02     ` Otavio Salvador
  2013-01-22  2:16       ` Marek Vasut
  0 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  2:02 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:46 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
> This should not be a part of the patchset. Description is missing.

Well, this is the first version of the board support. I see no better
description for it.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23
  2013-01-22  1:49   ` Marek Vasut
@ 2013-01-22  2:03     ` Otavio Salvador
  2013-01-22  2:15       ` Marek Vasut
  0 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22  2:03 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:49 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> This does the same reset mask as done in v3.7 Linux kernel code; it
>> fixed the saveenv command in mx23evk.
>>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  drivers/mmc/mxsmmc.c | 16 +++++++++++-----
>>  1 file changed, 11 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
>> index 618659e..0a3f0c4 100644
>> --- a/drivers/mmc/mxsmmc.c
>> +++ b/drivers/mmc/mxsmmc.c
>> @@ -354,11 +354,17 @@ static int mxsmmc_init(struct mmc *mmc)
>>       /* Reset SSP */
>>       mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
>>
>> -     /* 8 bits word length in MMC mode */
>> -     clrsetbits_le32(&ssp_regs->hw_ssp_ctrl1,
>> -             SSP_CTRL1_SSP_MODE_MASK | SSP_CTRL1_WORD_LENGTH_MASK |
>> -             SSP_CTRL1_DMA_ENABLE,
>> -             SSP_CTRL1_SSP_MODE_SD_MMC | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS);
>> +     /* Reset MMC */
>> +     writel(SSP_CTRL1_SSP_MODE_SD_MMC |
>> +             SSP_CTRL1_WORD_LENGTH_EIGHT_BITS |
>> +             SSP_CTRL1_DMA_ENABLE |
>> +             SSP_CTRL1_POLARITY |
>
> Will this addition not break mx28?

Not tested. I hope it does not as it has been taken from v3.7 kernel.

>> +             SSP_CTRL1_RECV_TIMEOUT_IRQ_EN |
>> +             SSP_CTRL1_DATA_CRC_IRQ_EN |
>> +             SSP_CTRL1_DATA_TIMEOUT_IRQ_EN |
>> +             SSP_CTRL1_RESP_TIMEOUT_IRQ_EN |
>> +             SSP_CTRL1_RESP_ERR_IRQ_EN,
>> +             &ssp_regs->hw_ssp_ctrl1_set);
>>
>>       /* Set initial bit clock 400 KHz */
>>       mxs_set_ssp_busclock(priv->id, 400);
>
> Best regards,
> Marek Vasut



--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23
  2013-01-22  2:03     ` Otavio Salvador
@ 2013-01-22  2:15       ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  2:15 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Mon, Jan 21, 2013 at 11:49 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> >> This does the same reset mask as done in v3.7 Linux kernel code; it
> >> fixed the saveenv command in mx23evk.
> >> 
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> >> ---
> >> 
> >>  drivers/mmc/mxsmmc.c | 16 +++++++++++-----
> >>  1 file changed, 11 insertions(+), 5 deletions(-)
> >> 
> >> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> >> index 618659e..0a3f0c4 100644
> >> --- a/drivers/mmc/mxsmmc.c
> >> +++ b/drivers/mmc/mxsmmc.c
> >> @@ -354,11 +354,17 @@ static int mxsmmc_init(struct mmc *mmc)
> >> 
> >>       /* Reset SSP */
> >>       mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
> >> 
> >> -     /* 8 bits word length in MMC mode */
> >> -     clrsetbits_le32(&ssp_regs->hw_ssp_ctrl1,
> >> -             SSP_CTRL1_SSP_MODE_MASK | SSP_CTRL1_WORD_LENGTH_MASK |
> >> -             SSP_CTRL1_DMA_ENABLE,
> >> -             SSP_CTRL1_SSP_MODE_SD_MMC |
> >> SSP_CTRL1_WORD_LENGTH_EIGHT_BITS); +     /* Reset MMC */
> >> +     writel(SSP_CTRL1_SSP_MODE_SD_MMC |
> >> +             SSP_CTRL1_WORD_LENGTH_EIGHT_BITS |
> >> +             SSP_CTRL1_DMA_ENABLE |
> >> +             SSP_CTRL1_POLARITY |
> > 
> > Will this addition not break mx28?
> 
> Not tested. I hope it does not as it has been taken from v3.7 kernel.

Please, mark all such untested code which can possibly break other platforms in 
the description.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 4/9] mx23evk: Add initial board support
  2013-01-22  2:02     ` Otavio Salvador
@ 2013-01-22  2:16       ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  2:16 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Mon, Jan 21, 2013 at 11:46 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> > This should not be a part of the patchset. Description is missing.
> 
> Well, this is the first version of the board support. I see no better
> description for it.

Check other patches adding boards then please. Description of the board is 
sufficient.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 4/9] mx23evk: Add initial board support
  2013-01-22  1:47 ` [U-Boot] [PATCH 4/9] mx23evk: Add initial board support Otavio Salvador
  2013-01-22  1:46   ` Marek Vasut
@ 2013-01-22  2:30   ` Fabio Estevam
  2013-01-22  2:42     ` Marek Vasut
  2013-01-22 10:05     ` Otavio Salvador
  1 sibling, 2 replies; 43+ messages in thread
From: Fabio Estevam @ 2013-01-22  2:30 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:47 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  board/freescale/mx23evk/Makefile   |  47 +++++++
>  board/freescale/mx23evk/mx23evk.c  |  81 ++++++++++++
>  board/freescale/mx23evk/spl_boot.c | 115 +++++++++++++++++
>  boards.cfg                         |   1 +
>  include/configs/mx23evk.h          | 252 +++++++++++++++++++++++++++++++++++++
>  5 files changed, 496 insertions(+)
>  create mode 100644 board/freescale/mx23evk/Makefile
>  create mode 100644 board/freescale/mx23evk/mx23evk.c
>  create mode 100644 board/freescale/mx23evk/spl_boot.c
>  create mode 100644 include/configs/mx23evk.h

An entry to MAINTAINERS file is missing.

> +/*
> + * USB
> + */
> +#ifdef CONFIG_CMD_USB
> +#define        CONFIG_USB_EHCI
> +#define        CONFIG_USB_EHCI_MXS
> +#define        CONFIG_EHCI_MXS_PORT 1
> +#define        CONFIG_EHCI_IS_TDI
> +#define        CONFIG_USB_STORAGE
> +#endif

Is USB functional? If not, please remove this.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment
  2013-01-22  1:47 ` [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment Otavio Salvador
  2013-01-22  1:49   ` Marek Vasut
@ 2013-01-22  2:34   ` Fabio Estevam
  1 sibling, 0 replies; 43+ messages in thread
From: Fabio Estevam @ 2013-01-22  2:34 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 21, 2013 at 11:47 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:

> +       "script=boot.scr\0"     \
> +       "uimage=uImage\0" \
> +       "console=ttyAMA0\0" \
> +       "fdt_file=imx23-evk.dtb\0" \

The dtb file should be imx23-olinuxino.dtb instead.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 4/9] mx23evk: Add initial board support
  2013-01-22  2:30   ` Fabio Estevam
@ 2013-01-22  2:42     ` Marek Vasut
  2013-01-22 10:05     ` Otavio Salvador
  1 sibling, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-22  2:42 UTC (permalink / raw)
  To: u-boot

Dear Fabio Estevam,

> On Mon, Jan 21, 2013 at 11:47 PM, Otavio Salvador
> 
> <otavio@ossystems.com.br> wrote:
> > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> > ---
> > 
> >  board/freescale/mx23evk/Makefile   |  47 +++++++
> >  board/freescale/mx23evk/mx23evk.c  |  81 ++++++++++++
> >  board/freescale/mx23evk/spl_boot.c | 115 +++++++++++++++++
> >  boards.cfg                         |   1 +
> >  include/configs/mx23evk.h          | 252
> >  +++++++++++++++++++++++++++++++++++++ 5 files changed, 496
> >  insertions(+)
> >  create mode 100644 board/freescale/mx23evk/Makefile
> >  create mode 100644 board/freescale/mx23evk/mx23evk.c
> >  create mode 100644 board/freescale/mx23evk/spl_boot.c
> >  create mode 100644 include/configs/mx23evk.h
> 
> An entry to MAINTAINERS file is missing.
> 
> > +/*
> > + * USB
> > + */
> > +#ifdef CONFIG_CMD_USB
> > +#define        CONFIG_USB_EHCI
> > +#define        CONFIG_USB_EHCI_MXS
> > +#define        CONFIG_EHCI_MXS_PORT 1
> > +#define        CONFIG_EHCI_IS_TDI
> > +#define        CONFIG_USB_STORAGE
> > +#endif
> 
> Is USB functional? If not, please remove this.

I don't think so ... besides, MX23 has only one USB port. How can this even 
compile if USBPHY1 and such values are undefined?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 4/9] mx23evk: Add initial board support
  2013-01-22  2:30   ` Fabio Estevam
  2013-01-22  2:42     ` Marek Vasut
@ 2013-01-22 10:05     ` Otavio Salvador
  1 sibling, 0 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-22 10:05 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 22, 2013 at 12:30 AM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Jan 21, 2013 at 11:47 PM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  board/freescale/mx23evk/Makefile   |  47 +++++++
>>  board/freescale/mx23evk/mx23evk.c  |  81 ++++++++++++
>>  board/freescale/mx23evk/spl_boot.c | 115 +++++++++++++++++
>>  boards.cfg                         |   1 +
>>  include/configs/mx23evk.h          | 252 +++++++++++++++++++++++++++++++++++++
>>  5 files changed, 496 insertions(+)
>>  create mode 100644 board/freescale/mx23evk/Makefile
>>  create mode 100644 board/freescale/mx23evk/mx23evk.c
>>  create mode 100644 board/freescale/mx23evk/spl_boot.c
>>  create mode 100644 include/configs/mx23evk.h
>
> An entry to MAINTAINERS file is missing.

Right.

>> +/*
>> + * USB
>> + */
>> +#ifdef CONFIG_CMD_USB
>> +#define        CONFIG_USB_EHCI
>> +#define        CONFIG_USB_EHCI_MXS
>> +#define        CONFIG_EHCI_MXS_PORT 1
>> +#define        CONFIG_EHCI_IS_TDI
>> +#define        CONFIG_USB_STORAGE
>> +#endif
>
> Is USB functional? If not, please remove this.

It is not; will check if I can drop it.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-22  1:56     ` Otavio Salvador
  2013-01-22  1:59       ` Marek Vasut
@ 2013-01-23  9:04       ` Stefano Babic
  2013-01-23 11:05         ` Otavio Salvador
  1 sibling, 1 reply; 43+ messages in thread
From: Stefano Babic @ 2013-01-23  9:04 UTC (permalink / raw)
  To: u-boot

On 22/01/2013 02:56, Otavio Salvador wrote:
> On Mon, Jan 21, 2013 at 11:50 PM, Marek Vasut <marex@denx.de> wrote:
>> Dear Otavio Salvador,
>>
>> NAK. DMA works on MX28 and works in Linux on MX23, therefore the DMA is not
>> broken on either. Thus there's no reason to introduce such "force_pio" stuff.
> 
> Lack of time to work on it is one reason. I won't be able to work on
> it for some days and I prefer a working solution than skip it for
> another release.
> 
> --
> Otavio Salvador                             O.S. Systems
> E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
> 

Hi Otavio, hi Marek,

let me say some words about this discussion. I agree that if there is no
support for DMA for MX23, we could add support with PIO mode. However,
there should be a very good reason, because as far as I understand,
added support for DMA is valid for mxs platform. The solution introduced
with this patchset lets also the door open for people that can use MX28
in PIO mode. I think (I have already seen in ML Marek's patchset for it)
the way to fix DMA for mx23 and then add support for MMC is the rught
way to do.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-23  9:04       ` Stefano Babic
@ 2013-01-23 11:05         ` Otavio Salvador
  2013-01-23 11:26           ` Marek Vasut
  0 siblings, 1 reply; 43+ messages in thread
From: Otavio Salvador @ 2013-01-23 11:05 UTC (permalink / raw)
  To: u-boot

On Wed, Jan 23, 2013 at 7:04 AM, Stefano Babic <sbabic@denx.de> wrote:
> On 22/01/2013 02:56, Otavio Salvador wrote:
>> On Mon, Jan 21, 2013 at 11:50 PM, Marek Vasut <marex@denx.de> wrote:
>>> Dear Otavio Salvador,
>>>
>>> NAK. DMA works on MX28 and works in Linux on MX23, therefore the DMA is not
>>> broken on either. Thus there's no reason to introduce such "force_pio" stuff.
>>
>> Lack of time to work on it is one reason. I won't be able to work on
>> it for some days and I prefer a working solution than skip it for
>> another release.
>>
>> --
>> Otavio Salvador                             O.S. Systems
>> E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
>> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
>>
>
> Hi Otavio, hi Marek,
>
> let me say some words about this discussion. I agree that if there is no
> support for DMA for MX23, we could add support with PIO mode. However,
> there should be a very good reason, because as far as I understand,
> added support for DMA is valid for mxs platform. The solution introduced
> with this patchset lets also the door open for people that can use MX28
> in PIO mode. I think (I have already seen in ML Marek's patchset for it)
> the way to fix DMA for mx23 and then add support for MMC is the rught
> way to do.

So you'd like to have this patch ported to Marek's patchset so the
support for PIO mode is kept available? Instead of enabling it for
MX23 we can have a config option which allows force PIO mode and
disable DMA. This is what you want?

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-23 11:05         ` Otavio Salvador
@ 2013-01-23 11:26           ` Marek Vasut
  2013-01-23 11:39             ` Stefano Babic
  0 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-23 11:26 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

> On Wed, Jan 23, 2013 at 7:04 AM, Stefano Babic <sbabic@denx.de> wrote:
> > On 22/01/2013 02:56, Otavio Salvador wrote:
> >> On Mon, Jan 21, 2013 at 11:50 PM, Marek Vasut <marex@denx.de> wrote:
> >>> Dear Otavio Salvador,
> >>> 
> >>> NAK. DMA works on MX28 and works in Linux on MX23, therefore the DMA is
> >>> not broken on either. Thus there's no reason to introduce such
> >>> "force_pio" stuff.
> >> 
> >> Lack of time to work on it is one reason. I won't be able to work on
> >> it for some days and I prefer a working solution than skip it for
> >> another release.
> >> 
> >> --
> >> Otavio Salvador                             O.S. Systems
> >> E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
> >> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
> > 
> > Hi Otavio, hi Marek,
> > 
> > let me say some words about this discussion. I agree that if there is no
> > support for DMA for MX23, we could add support with PIO mode. However,
> > there should be a very good reason, because as far as I understand,
> > added support for DMA is valid for mxs platform. The solution introduced
> > with this patchset lets also the door open for people that can use MX28
> > in PIO mode. I think (I have already seen in ML Marek's patchset for it)
> > the way to fix DMA for mx23 and then add support for MMC is the rught
> > way to do.
> 
> So you'd like to have this patch ported to Marek's patchset so the
> support for PIO mode is kept available? Instead of enabling it for
> MX23 we can have a config option which allows force PIO mode and
> disable DMA. This is what you want?

Forcing PIO is nonsense, why would it be of any use?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-23 11:26           ` Marek Vasut
@ 2013-01-23 11:39             ` Stefano Babic
  2013-01-23 11:48               ` Marek Vasut
  0 siblings, 1 reply; 43+ messages in thread
From: Stefano Babic @ 2013-01-23 11:39 UTC (permalink / raw)
  To: u-boot

On 23/01/2013 12:26, Marek Vasut wrote:

>>> Hi Otavio, hi Marek,
>>>
>>> let me say some words about this discussion. I agree that if there is no
>>> support for DMA for MX23, we could add support with PIO mode. However,
>>> there should be a very good reason, because as far as I understand,
>>> added support for DMA is valid for mxs platform. The solution introduced
>>> with this patchset lets also the door open for people that can use MX28
>>> in PIO mode. I think (I have already seen in ML Marek's patchset for it)
>>> the way to fix DMA for mx23 and then add support for MMC is the rught
>>> way to do.
>>
>> So you'd like to have this patch ported to Marek's patchset so the
>> support for PIO mode is kept available? Instead of enabling it for
>> MX23 we can have a config option which allows force PIO mode and
>> disable DMA. This is what you want?
> 
> Forcing PIO is nonsense, why would it be of any use?

No, I agree with Marek - if DMA is then working also for MX23, we do not
need PIO at all.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-23 11:39             ` Stefano Babic
@ 2013-01-23 11:48               ` Marek Vasut
  2013-01-23 12:12                 ` Otavio Salvador
  0 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2013-01-23 11:48 UTC (permalink / raw)
  To: u-boot

Dear Stefano Babic,

> On 23/01/2013 12:26, Marek Vasut wrote:
> >>> Hi Otavio, hi Marek,
> >>> 
> >>> let me say some words about this discussion. I agree that if there is
> >>> no support for DMA for MX23, we could add support with PIO mode.
> >>> However, there should be a very good reason, because as far as I
> >>> understand, added support for DMA is valid for mxs platform. The
> >>> solution introduced with this patchset lets also the door open for
> >>> people that can use MX28 in PIO mode. I think (I have already seen in
> >>> ML Marek's patchset for it) the way to fix DMA for mx23 and then add
> >>> support for MMC is the rught way to do.
> >> 
> >> So you'd like to have this patch ported to Marek's patchset so the
> >> support for PIO mode is kept available? Instead of enabling it for
> >> MX23 we can have a config option which allows force PIO mode and
> >> disable DMA. This is what you want?
> > 
> > Forcing PIO is nonsense, why would it be of any use?
> 
> No, I agree with Marek - if DMA is then working also for MX23, we do not
> need PIO at all.

Stefano, it's now using mixed mode -- PIO for small transfers, DMA for large 
transfers. That is the best pick of both worlds ;-)

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC
  2013-01-23 11:48               ` Marek Vasut
@ 2013-01-23 12:12                 ` Otavio Salvador
  0 siblings, 0 replies; 43+ messages in thread
From: Otavio Salvador @ 2013-01-23 12:12 UTC (permalink / raw)
  To: u-boot

On Wed, Jan 23, 2013 at 9:48 AM, Marek Vasut <marex@denx.de> wrote:
> Dear Stefano Babic,
>
>> On 23/01/2013 12:26, Marek Vasut wrote:
>> >>> Hi Otavio, hi Marek,
>> >>>
>> >>> let me say some words about this discussion. I agree that if there is
>> >>> no support for DMA for MX23, we could add support with PIO mode.
>> >>> However, there should be a very good reason, because as far as I
>> >>> understand, added support for DMA is valid for mxs platform. The
>> >>> solution introduced with this patchset lets also the door open for
>> >>> people that can use MX28 in PIO mode. I think (I have already seen in
>> >>> ML Marek's patchset for it) the way to fix DMA for mx23 and then add
>> >>> support for MMC is the rught way to do.
>> >>
>> >> So you'd like to have this patch ported to Marek's patchset so the
>> >> support for PIO mode is kept available? Instead of enabling it for
>> >> MX23 we can have a config option which allows force PIO mode and
>> >> disable DMA. This is what you want?
>> >
>> > Forcing PIO is nonsense, why would it be of any use?
>>
>> No, I agree with Marek - if DMA is then working also for MX23, we do not
>> need PIO at all.
>
> Stefano, it's now using mixed mode -- PIO for small transfers, DMA for large
> transfers. That is the best pick of both worlds ;-)

That's fine; I just wanted to check if I had understood it right.

No problem; I will update the environments and send a v2 of my
patchset basing on top of Marek's changes.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI
  2013-01-22  1:47 ` [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI Otavio Salvador
  2013-01-22  1:46   ` Marek Vasut
@ 2013-01-24 18:14   ` Marek Vasut
  1 sibling, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2013-01-24 18:14 UTC (permalink / raw)
  To: u-boot

Dear Otavio Salvador,

NAK, this won't work. SSP0 DMA has this +1 offset in it's channel placement (so 
SSP0 DMA channel is actually channel 1), check the MMC patch.

> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  drivers/spi/mxs_spi.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> index bb865b7..10bf5aa 100644
> --- a/drivers/spi/mxs_spi.c
> +++ b/drivers/spi/mxs_spi.c
> @@ -167,8 +167,13 @@ static int mxs_spi_xfer_pio(struct mxs_spi_slave
> *slave, mxs_spi_start_xfer(ssp_regs);
> 
>  	while (length--) {
> +#if defined(CONFIG_MX23)
> +		writel(SSP_CTRL0_XFER_COUNT_MASK, &ssp_regs->hw_ssp_ctrl0_clr);
> +		writel(1, &ssp_regs->hw_ssp_ctrl0_set);
> +#elif defined(CONFIG_MX28)
>  		/* We transfer 1 byte */
>  		writel(1, &ssp_regs->hw_ssp_xfer_size);
> +#endif
> 
>  		if ((flags & SPI_XFER_END) && !length)
>  			mxs_spi_end_xfer(ssp_regs);

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2013-01-24 18:14 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22  1:47 [U-Boot] [PATCH 0/9] iMX23 MMC support and environment addition Otavio Salvador
2013-01-22  1:47 ` [U-Boot] [PATCH 1/9] mx23: Add SSP registers map Otavio Salvador
2013-01-22  1:47 ` [U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode Otavio Salvador
2013-01-22  1:45   ` Marek Vasut
2013-01-22  1:53     ` Otavio Salvador
2013-01-22  2:01       ` Marek Vasut
2013-01-22  1:47 ` [U-Boot] [PATCH 3/9] mx23: Fix transfer size setting for SPI Otavio Salvador
2013-01-22  1:46   ` Marek Vasut
2013-01-22  1:55     ` Otavio Salvador
2013-01-22  2:00       ` Marek Vasut
2013-01-24 18:14   ` Marek Vasut
2013-01-22  1:47 ` [U-Boot] [PATCH 4/9] mx23evk: Add initial board support Otavio Salvador
2013-01-22  1:46   ` Marek Vasut
2013-01-22  2:02     ` Otavio Salvador
2013-01-22  2:16       ` Marek Vasut
2013-01-22  2:30   ` Fabio Estevam
2013-01-22  2:42     ` Marek Vasut
2013-01-22 10:05     ` Otavio Salvador
2013-01-22  1:47 ` [U-Boot] [PATCH 5/9] mx23_olinuxino: Add MMC support Otavio Salvador
2013-01-22  1:47   ` Marek Vasut
2013-01-22  1:58     ` Otavio Salvador
2013-01-22  1:47 ` [U-Boot] [PATCH 6/9] mx23_olinuxino: Skip MMC Card detection Otavio Salvador
2013-01-22  1:48   ` Marek Vasut
2013-01-22  1:58     ` Otavio Salvador
2013-01-22  1:59       ` Marek Vasut
2013-01-22  1:47 ` [U-Boot] [PATCH 7/9] mx23_olinuxino: Add default environment Otavio Salvador
2013-01-22  1:49   ` Marek Vasut
2013-01-22  2:00     ` Otavio Salvador
2013-01-22  2:34   ` Fabio Estevam
2013-01-22  1:47 ` [U-Boot] [PATCH 8/9] mxs: Fix MMC reset to avoid write errors and timeout in iMX23 Otavio Salvador
2013-01-22  1:49   ` Marek Vasut
2013-01-22  2:03     ` Otavio Salvador
2013-01-22  2:15       ` Marek Vasut
2013-01-22  1:47 ` [U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC Otavio Salvador
2013-01-22  1:50   ` Marek Vasut
2013-01-22  1:56     ` Otavio Salvador
2013-01-22  1:59       ` Marek Vasut
2013-01-23  9:04       ` Stefano Babic
2013-01-23 11:05         ` Otavio Salvador
2013-01-23 11:26           ` Marek Vasut
2013-01-23 11:39             ` Stefano Babic
2013-01-23 11:48               ` Marek Vasut
2013-01-23 12:12                 ` Otavio Salvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox