* [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix
@ 2010-05-12 9:38 Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
` (2 more replies)
0 siblings, 3 replies; 25+ messages in thread
From: Alagu Sankar @ 2010-05-12 9:38 UTC (permalink / raw)
To: u-boot
Fixed a bug wherein SD version 1.0 cards were not configured for 4-bit mode
Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
---
drivers/mmc/mmc.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index cf4ea16..959d8ad 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -520,6 +520,9 @@ retry_scr:
break;
}
+ if (mmc->scr[0] & SD_DATA_4BIT)
+ mmc->card_caps |= MMC_MODE_4BIT;
+
/* Version 1.0 doesn't support switching */
if (mmc->version == SD_VERSION_1_0)
return 0;
@@ -537,9 +540,6 @@ retry_scr:
break;
}
- if (mmc->scr[0] & SD_DATA_4BIT)
- mmc->card_caps |= MMC_MODE_4BIT;
-
/* If high-speed isn't supported, we return */
if (!(__be32_to_cpu(switch_status[3]) & SD_HIGHSPEED_SUPPORTED))
return 0;
--
1.6.0.6
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix
2010-05-12 9:38 [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Alagu Sankar
@ 2010-05-12 9:38 ` Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Alagu Sankar
` (2 more replies)
2010-05-13 15:13 ` [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Paulraj, Sandeep
2010-05-14 17:30 ` Andy Fleming
2 siblings, 3 replies; 25+ messages in thread
From: Alagu Sankar @ 2010-05-12 9:38 UTC (permalink / raw)
To: u-boot
Fixed a bug in card capacity calculation for MMC high-capacity cards.
Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
---
drivers/mmc/mmc.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 959d8ad..e7abf94 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -393,6 +393,7 @@ int mmc_change_freq(struct mmc *mmc)
char ext_csd[512];
char cardtype;
int err;
+ unsigned int sec_count;
mmc->card_caps = 0;
@@ -407,8 +408,14 @@ int mmc_change_freq(struct mmc *mmc)
if (err)
return err;
- if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
+ sec_count = ((uint)ext_csd[212] |
+ ((uint)ext_csd[213] << 8) |
+ ((uint)ext_csd[214] << 16) |
+ ((uint)ext_csd[215] << 24));
+ if (sec_count) {
mmc->high_capacity = 1;
+ mmc->capacity = sec_count * 512;
+ }
cardtype = ext_csd[196] & 0xf;
--
1.6.0.6
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
@ 2010-05-12 9:38 ` Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 4/4] Environment in MMC Alagu Sankar
2010-05-14 17:37 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Andy Fleming
2010-05-14 8:16 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Sudhakar Rajashekhara
2010-05-14 17:32 ` Andy Fleming
2 siblings, 2 replies; 25+ messages in thread
From: Alagu Sankar @ 2010-05-12 9:38 UTC (permalink / raw)
To: u-boot
Added Multi-Block Read support for Generic MMC. Modified existing multi-block
write to limit the maximum number of blocks per transfer. This feature is
enabled with CONFIG_MMC_MBLOCK option. A new member is added in the mmc
structure for the host controller to specify the maximum number of blocks it
supports.
Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
---
drivers/mmc/mmc.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++++
include/mmc.h | 3 +
2 files changed, 159 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index e7abf94..3f5a200 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -77,6 +77,7 @@ struct mmc *find_mmc_device(int dev_num)
return NULL;
}
+#ifndef CONFIG_MMC_MBLOCK
static ulong
mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src)
{
@@ -238,6 +239,156 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)
return blkcnt;
}
+#else
+
+static int mmc_write_blocks(struct mmc *mmc, const char *src, uint start,
+ uint blkcnt)
+{
+ struct mmc_cmd cmd;
+ struct mmc_data data;
+ int err;
+ int blklen;
+
+ blklen = mmc->write_bl_len;
+
+ err = mmc_set_blocklen(mmc, mmc->write_bl_len);
+
+ if (err) {
+ printf("set write bl len failed\n\r");
+ return err;
+ }
+
+ if (blkcnt > 1)
+ cmd.cmdidx = MMC_CMD_WRITE_MULTIPLE_BLOCK;
+ else
+ cmd.cmdidx = MMC_CMD_WRITE_SINGLE_BLOCK;
+
+ if (mmc->high_capacity)
+ cmd.cmdarg = start;
+ else
+ cmd.cmdarg = start * blklen;
+
+ cmd.resp_type = MMC_RSP_R1;
+ cmd.flags = 0;
+
+ data.src = src;
+ data.blocks = blkcnt;
+ data.blocksize = blklen;
+ data.flags = MMC_DATA_WRITE;
+
+ err = mmc_send_cmd(mmc, &cmd, &data);
+
+ if (err) {
+ printf("mmc write failed\n\r");
+ return err;
+ }
+
+ if (blkcnt > 1) {
+ cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
+ cmd.cmdarg = 0;
+ cmd.resp_type = MMC_RSP_R1b;
+ cmd.flags = 0;
+ err = mmc_send_cmd(mmc, &cmd, NULL);
+ }
+
+ return err;
+}
+
+static ulong
+mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void *src)
+{
+ int err;
+ int i;
+ struct mmc *mmc = find_mmc_device(dev_num);
+ uint b_max = mmc->b_max;
+
+ if (!mmc)
+ return 0;
+
+ for (i = blkcnt; i > 0; i -= b_max) {
+ uint blocks = (i > b_max) ? b_max : i;
+
+ err = mmc_write_blocks(mmc, src, start, blocks);
+ if (err)
+ return blkcnt - i;
+ start += blocks;
+ src += (mmc->write_bl_len * blocks);
+ }
+
+ return blkcnt;
+}
+
+int mmc_read_blocks(struct mmc *mmc, void *dst, uint blocknum, uint blkcnt)
+{
+ int err;
+ struct mmc_cmd cmd;
+ struct mmc_data data;
+
+ if (blkcnt > 1)
+ cmd.cmdidx = MMC_CMD_READ_MULTIPLE_BLOCK;
+ else
+ cmd.cmdidx = MMC_CMD_READ_SINGLE_BLOCK;
+
+ if (mmc->high_capacity)
+ cmd.cmdarg = blocknum;
+ else
+ cmd.cmdarg = blocknum * mmc->read_bl_len;
+
+ cmd.resp_type = MMC_RSP_R1;
+ cmd.flags = 0;
+
+ data.dest = dst;
+ data.blocks = blkcnt;
+ data.blocksize = mmc->read_bl_len;
+ data.flags = MMC_DATA_READ;
+
+ err = mmc_send_cmd(mmc, &cmd, &data);
+ if (err)
+ return err;
+
+ if (blkcnt > 1) {
+ cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
+ cmd.cmdarg = 0;
+ cmd.resp_type = MMC_RSP_R1b;
+ cmd.flags = 0;
+ err = mmc_send_cmd(mmc, &cmd, NULL);
+ }
+
+ return err;
+}
+
+static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)
+{
+ int err;
+ int i;
+ struct mmc *mmc = find_mmc_device(dev_num);
+ uint b_max = mmc->b_max;
+
+ if (!mmc)
+ return 0;
+
+ /* We always do full block reads from the card */
+ err = mmc_set_blocklen(mmc, mmc->read_bl_len);
+ if (err)
+ return 0;
+
+ for (i = blkcnt; i > 0; i -= b_max) {
+ uint blocks = (i > b_max) ? b_max : i;
+
+ err = mmc_read_blocks(mmc, dst, start, blocks);
+ if (err) {
+ printf("block read failed: %d\n", err);
+ return blkcnt - i;
+ }
+ start += blocks;
+ dst += (mmc->read_bl_len * blocks);
+ }
+
+ return blkcnt;
+}
+
+#endif
+
int mmc_go_idle(struct mmc* mmc)
{
struct mmc_cmd cmd;
@@ -858,6 +1009,11 @@ int mmc_register(struct mmc *mmc)
mmc->block_dev.block_read = mmc_bread;
mmc->block_dev.block_write = mmc_bwrite;
+#ifdef CONFIG_MMC_MBLOCK
+ if (mmc->b_max == 0)
+ mmc->b_max = 1;
+#endif
+
INIT_LIST_HEAD (&mmc->link);
list_add_tail (&mmc->link, &mmc_devices);
diff --git a/include/mmc.h b/include/mmc.h
index 8973bc7..04c7eaf 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -264,6 +264,9 @@ struct mmc {
struct mmc_cmd *cmd, struct mmc_data *data);
void (*set_ios)(struct mmc *mmc);
int (*init)(struct mmc *mmc);
+#ifdef CONFIG_MMC_MBLOCK
+ uint b_max;
+#endif
};
int mmc_register(struct mmc *mmc);
--
1.6.0.6
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-12 9:38 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Alagu Sankar
@ 2010-05-12 9:38 ` Alagu Sankar
2010-05-13 7:08 ` Lv Terry-R65388
2010-05-14 8:26 ` Sudhakar Rajashekhara
2010-05-14 17:37 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Andy Fleming
1 sibling, 2 replies; 25+ messages in thread
From: Alagu Sankar @ 2010-05-12 9:38 UTC (permalink / raw)
To: u-boot
This patch is to save environment data to mmc card. It uses interfaces defined
in generic MMC framework. This is enabled with CONFIG_ENV_IS_IN_MMC option.
Based on the earlier patch from Terry Lv at Freescale
Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
---
arch/arm/lib/board.c | 10 ++--
arch/powerpc/lib/board.c | 12 ++--
common/Makefile | 1 +
common/cmd_nvedit.c | 3 +-
common/env_mmc.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++
include/environment.h | 18 +++++
6 files changed, 200 insertions(+), 12 deletions(-)
create mode 100644 common/env_mmc.c
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index f5660a9..5e7558e 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -338,6 +338,11 @@ void start_armboot (void)
nand_init(); /* go init the NAND */
#endif
+#ifdef CONFIG_GENERIC_MMC
+ puts ("MMC: ");
+ mmc_initialize (gd->bd);
+#endif
+
#if defined(CONFIG_CMD_ONENAND)
onenand_init();
#endif
@@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t *addr);
board_late_init ();
#endif
-#ifdef CONFIG_GENERIC_MMC
- puts ("MMC: ");
- mmc_initialize (gd->bd);
-#endif
-
#ifdef CONFIG_BITBANGMII
bb_miiphy_init();
#endif
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 7b09fb5..1008635 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -783,6 +783,12 @@ void board_init_r (gd_t *id, ulong dest_addr)
nand_init(); /* go init the NAND */
#endif
+#ifdef CONFIG_GENERIC_MMC
+ WATCHDOG_RESET ();
+ puts ("MMC: ");
+ mmc_initialize (bd);
+#endif
+
/* relocate environment function pointers etc. */
env_relocate ();
@@ -939,12 +945,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
scsi_init ();
#endif
-#ifdef CONFIG_GENERIC_MMC
- WATCHDOG_RESET ();
- puts ("MMC: ");
- mmc_initialize (bd);
-#endif
-
#if defined(CONFIG_CMD_DOC)
WATCHDOG_RESET ();
puts ("DOC: ");
diff --git a/common/Makefile b/common/Makefile
index dbf7a05..2c37073 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -58,6 +58,7 @@ COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
+COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index eb89e9e..27e46f7 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -63,9 +63,10 @@ DECLARE_GLOBAL_DATA_PTR;
!defined(CONFIG_ENV_IS_IN_NVRAM) && \
!defined(CONFIG_ENV_IS_IN_ONENAND) && \
!defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \
+ !defined(CONFIG_ENV_IS_IN_MMC) && \
!defined(CONFIG_ENV_IS_NOWHERE)
# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
-SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
+SPI_FLASH|MG_DISK|NVRAM|MMC|NOWHERE}
#endif
#define XMK_STR(x) #x
diff --git a/common/env_mmc.c b/common/env_mmc.c
new file mode 100644
index 0000000..ef7e5fb
--- /dev/null
+++ b/common/env_mmc.c
@@ -0,0 +1,168 @@
+/*
+ * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * (C) Copyright 2000-2006
+ * Wolfgang Denk, DENX Software Engineering, w... at denx.de.
+ *
+ * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Andreas Heppel <ahep...@sysgo.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
+ */
+
+/* #define DEBUG */
+
+#include <common.h>
+
+#include <command.h>
+#include <environment.h>
+#include <linux/stddef.h>
+#include <malloc.h>
+#include <mmc.h>
+
+#if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_MMC)
+#define CMD_SAVEENV
+#elif defined(CONFIG_ENV_OFFSET_REDUND)
+#error Cannot use CONFIG_ENV_OFFSET_REDUND without \
+ CONFIG_CMD_ENV & CONFIG_CMD_MMC
+#endif
+
+#if defined(CONFIG_ENV_SIZE_REDUND) && \
+ (CONFIG_ENV_SIZE_REDUND < CONFIG_ENV_SIZE)
+#error CONFIG_ENV_SIZE_REDUND should not be less then CONFIG_ENV_SIZE
+#endif
+
+/* references to names in env_common.c */
+extern uchar default_environment[];
+
+char *env_name_spec = "MMC";
+
+#ifdef ENV_IS_EMBEDDED
+extern uchar environment[];
+env_t *env_ptr = (env_t *)(&environment[0]);
+#else /* ! ENV_IS_EMBEDDED */
+env_t *env_ptr;
+#endif /* ENV_IS_EMBEDDED */
+
+/* local functions */
+#if !defined(ENV_IS_EMBEDDED)
+static void use_default(void);
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+uchar env_get_char_spec(int index)
+{
+ return *((uchar *)(gd->env_addr + index));
+}
+
+int env_init(void)
+{
+ /* use default */
+ gd->env_addr = (ulong)&default_environment[0];
+ gd->env_valid = 1;
+
+ return 0;
+}
+
+inline int init_mmc_for_env(struct mmc *mmc)
+{
+ if (!mmc) {
+ puts("No MMC card found\n");
+ return -1;
+ }
+
+ if (mmc_init(mmc)) {
+ puts("MMC init failed\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+#ifdef CMD_SAVEENV
+
+inline int write_env(struct mmc *mmc, unsigned long size,
+ unsigned long offset, const void *buffer)
+{
+ uint blk_start = 0, blk_cnt = 0, n = 0;
+
+ blk_start = (offset % 512) ? ((offset / 512) + 1) : (offset / 512);
+ blk_cnt = (size % 512) ? ((size / 512) + 1) : (size / 512);
+ n = mmc->block_dev.block_write(0, blk_start , blk_cnt,
+ (u_char *)buffer);
+
+ return (n == blk_cnt) ? 0 : -1;
+}
+
+int saveenv(void)
+{
+ struct mmc *mmc = find_mmc_device(0);
+
+ if (init_mmc_for_env(mmc))
+ return 1;
+
+ puts("Writing to MMC... ");
+ if (write_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, env_ptr)) {
+ puts("failed\n");
+ return 1;
+ }
+
+ puts("done\n");
+ return 0;
+}
+#endif /* CMD_SAVEENV */
+
+inline int read_env(struct mmc *mmc, unsigned long size,
+ unsigned long offset, const void *buffer)
+{
+ uint blk_start = 0, blk_cnt = 0, n = 0;
+
+ blk_start = (offset % 512) ? ((offset / 512) + 1) : (offset / 512);
+ blk_cnt = (size % 512) ? ((size / 512) + 1) : (size / 512);
+
+ n = mmc->block_dev.block_read(0, blk_start, blk_cnt, (uchar *)buffer);
+
+ return (n == blk_cnt) ? 0 : -1;
+}
+
+void env_relocate_spec(void)
+{
+#if !defined(ENV_IS_EMBEDDED)
+ struct mmc *mmc = find_mmc_device(0);
+
+ if (init_mmc_for_env(mmc))
+ return;
+
+ if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, env_ptr))
+ return use_default();
+
+ if (crc32(0, env_ptr->data, ENV_SIZE) != env_ptr->crc)
+ return use_default();
+
+#endif /* ! ENV_IS_EMBEDDED */
+}
+
+#if !defined(ENV_IS_EMBEDDED)
+static void use_default()
+{
+ puts ("*** Warning - bad CRC or MMC, using default environment\n\n");
+ set_default_env();
+}
+#endif
+
diff --git a/include/environment.h b/include/environment.h
index b9924fd..aa0e750 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -94,6 +94,24 @@
# endif
#endif /* CONFIG_ENV_IS_IN_MG_DISK */
+#if defined(CONFIG_ENV_IS_IN_MMC)
+# ifndef CONFIG_ENV_OFFSET
+# error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_MMC"
+# endif
+# ifndef CONFIG_ENV_ADDR
+# define CONFIG_ENV_ADDR (CONFIG_ENV_OFFSET)
+# endif
+# ifndef CONFIG_ENV_OFFSET
+# define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR)
+# endif
+# ifdef CONFIG_ENV_OFFSET_REDUND
+# define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+# endif
+# ifdef CONFIG_ENV_IS_EMBEDDED
+# define ENV_IS_EMBEDDED 1
+# endif
+#endif /* CONFIG_ENV_IS_IN_MMC */
+
/* Embedded env is only supported for some flash types */
#ifdef CONFIG_ENV_IS_EMBEDDED
# if !defined(CONFIG_ENV_IS_IN_FLASH) && \
--
1.6.0.6
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-12 9:38 ` [U-Boot] [PATCH 4/4] Environment in MMC Alagu Sankar
@ 2010-05-13 7:08 ` Lv Terry-R65388
2010-05-14 8:26 ` Sudhakar Rajashekhara
1 sibling, 0 replies; 25+ messages in thread
From: Lv Terry-R65388 @ 2010-05-13 7:08 UTC (permalink / raw)
To: u-boot
Hi Alagu Sankar,
Pls use my latest v5 patch for saving environment data to mmc.
Thanks~~
Yours
Terry
> -----Original Message-----
> From: u-boot-bounces at lists.denx.de
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Alagu Sankar
> Sent: 2010?5?12? 17:38
> To: u-boot at lists.denx.de
> Subject: [U-Boot] [PATCH 4/4] Environment in MMC
>
> This patch is to save environment data to mmc card. It uses
> interfaces defined in generic MMC framework. This is enabled
> with CONFIG_ENV_IS_IN_MMC option.
> Based on the earlier patch from Terry Lv at Freescale
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
> ---
> arch/arm/lib/board.c | 10 ++--
> arch/powerpc/lib/board.c | 12 ++--
> common/Makefile | 1 +
> common/cmd_nvedit.c | 3 +-
> common/env_mmc.c | 168
> ++++++++++++++++++++++++++++++++++++++++++++++
> include/environment.h | 18 +++++
> 6 files changed, 200 insertions(+), 12 deletions(-) create
> mode 100644 common/env_mmc.c
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index f5660a9..5e7558e 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -338,6 +338,11 @@ void start_armboot (void)
> nand_init(); /* go init the NAND */
> #endif
>
> +#ifdef CONFIG_GENERIC_MMC
> + puts ("MMC: ");
> + mmc_initialize (gd->bd);
> +#endif
> +
> #if defined(CONFIG_CMD_ONENAND)
> onenand_init();
> #endif
> @@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr
> (const u_int8_t *addr);
> board_late_init ();
> #endif
>
> -#ifdef CONFIG_GENERIC_MMC
> - puts ("MMC: ");
> - mmc_initialize (gd->bd);
> -#endif
> -
> #ifdef CONFIG_BITBANGMII
> bb_miiphy_init();
> #endif
> diff --git a/arch/powerpc/lib/board.c
> b/arch/powerpc/lib/board.c index 7b09fb5..1008635 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -783,6 +783,12 @@ void board_init_r (gd_t *id, ulong dest_addr)
> nand_init(); /* go init the NAND */
> #endif
>
> +#ifdef CONFIG_GENERIC_MMC
> + WATCHDOG_RESET ();
> + puts ("MMC: ");
> + mmc_initialize (bd);
> +#endif
> +
> /* relocate environment function pointers etc. */
> env_relocate ();
>
> @@ -939,12 +945,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
> scsi_init ();
> #endif
>
> -#ifdef CONFIG_GENERIC_MMC
> - WATCHDOG_RESET ();
> - puts ("MMC: ");
> - mmc_initialize (bd);
> -#endif
> -
> #if defined(CONFIG_CMD_DOC)
> WATCHDOG_RESET ();
> puts ("DOC: ");
> diff --git a/common/Makefile b/common/Makefile index
> dbf7a05..2c37073 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -58,6 +58,7 @@ COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
> COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
> COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
> COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
> +COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
> COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
> COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
> COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o diff
> --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index
> eb89e9e..27e46f7 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -63,9 +63,10 @@ DECLARE_GLOBAL_DATA_PTR;
> !defined(CONFIG_ENV_IS_IN_NVRAM) && \
> !defined(CONFIG_ENV_IS_IN_ONENAND) && \
> !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \
> + !defined(CONFIG_ENV_IS_IN_MMC) && \
> !defined(CONFIG_ENV_IS_NOWHERE)
> # error Define one of
> CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
> -SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
> +SPI_FLASH|MG_DISK|NVRAM|MMC|NOWHERE}
> #endif
>
> #define XMK_STR(x) #x
> diff --git a/common/env_mmc.c b/common/env_mmc.c new file
> mode 100644 index 0000000..ef7e5fb
> --- /dev/null
> +++ b/common/env_mmc.c
> @@ -0,0 +1,168 @@
> +/*
> + * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
> + * (C) Copyright 2000-2006
> + * Wolfgang Denk, DENX Software Engineering, w... at denx.de.
> + *
> + * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH
> <www.elinos.com>
> + * Andreas Heppel <ahep...@sysgo.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
> + */
> +
> +/* #define DEBUG */
> +
> +#include <common.h>
> +
> +#include <command.h>
> +#include <environment.h>
> +#include <linux/stddef.h>
> +#include <malloc.h>
> +#include <mmc.h>
> +
> +#if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_MMC) #define
> +CMD_SAVEENV #elif defined(CONFIG_ENV_OFFSET_REDUND) #error
> Cannot use
> +CONFIG_ENV_OFFSET_REDUND without \
> + CONFIG_CMD_ENV & CONFIG_CMD_MMC
> +#endif
> +
> +#if defined(CONFIG_ENV_SIZE_REDUND) && \
> + (CONFIG_ENV_SIZE_REDUND < CONFIG_ENV_SIZE) #error
> +CONFIG_ENV_SIZE_REDUND should not be less then CONFIG_ENV_SIZE #endif
> +
> +/* references to names in env_common.c */ extern uchar
> +default_environment[];
> +
> +char *env_name_spec = "MMC";
> +
> +#ifdef ENV_IS_EMBEDDED
> +extern uchar environment[];
> +env_t *env_ptr = (env_t *)(&environment[0]); #else /* !
> ENV_IS_EMBEDDED
> +*/ env_t *env_ptr; #endif /* ENV_IS_EMBEDDED */
> +
> +/* local functions */
> +#if !defined(ENV_IS_EMBEDDED)
> +static void use_default(void);
> +#endif
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +uchar env_get_char_spec(int index)
> +{
> + return *((uchar *)(gd->env_addr + index)); }
> +
> +int env_init(void)
> +{
> + /* use default */
> + gd->env_addr = (ulong)&default_environment[0];
> + gd->env_valid = 1;
> +
> + return 0;
> +}
> +
> +inline int init_mmc_for_env(struct mmc *mmc) {
> + if (!mmc) {
> + puts("No MMC card found\n");
> + return -1;
> + }
> +
> + if (mmc_init(mmc)) {
> + puts("MMC init failed\n");
> + return -1;
> + }
> +
> + return 0;
> +}
> +
> +#ifdef CMD_SAVEENV
> +
> +inline int write_env(struct mmc *mmc, unsigned long size,
> + unsigned long offset, const void *buffer) {
> + uint blk_start = 0, blk_cnt = 0, n = 0;
> +
> + blk_start = (offset % 512) ? ((offset / 512) + 1) :
> (offset / 512);
> + blk_cnt = (size % 512) ? ((size / 512) + 1) : (size / 512);
> + n = mmc->block_dev.block_write(0, blk_start , blk_cnt,
> + (u_char *)buffer);
> +
> + return (n == blk_cnt) ? 0 : -1;
> +}
> +
> +int saveenv(void)
> +{
> + struct mmc *mmc = find_mmc_device(0);
> +
> + if (init_mmc_for_env(mmc))
> + return 1;
> +
> + puts("Writing to MMC... ");
> + if (write_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET,
> env_ptr)) {
> + puts("failed\n");
> + return 1;
> + }
> +
> + puts("done\n");
> + return 0;
> +}
> +#endif /* CMD_SAVEENV */
> +
> +inline int read_env(struct mmc *mmc, unsigned long size,
> + unsigned long offset, const void *buffer) {
> + uint blk_start = 0, blk_cnt = 0, n = 0;
> +
> + blk_start = (offset % 512) ? ((offset / 512) + 1) :
> (offset / 512);
> + blk_cnt = (size % 512) ? ((size / 512) + 1) : (size / 512);
> +
> + n = mmc->block_dev.block_read(0, blk_start, blk_cnt,
> (uchar *)buffer);
> +
> + return (n == blk_cnt) ? 0 : -1;
> +}
> +
> +void env_relocate_spec(void)
> +{
> +#if !defined(ENV_IS_EMBEDDED)
> + struct mmc *mmc = find_mmc_device(0);
> +
> + if (init_mmc_for_env(mmc))
> + return;
> +
> + if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, env_ptr))
> + return use_default();
> +
> + if (crc32(0, env_ptr->data, ENV_SIZE) != env_ptr->crc)
> + return use_default();
> +
> +#endif /* ! ENV_IS_EMBEDDED */
> +}
> +
> +#if !defined(ENV_IS_EMBEDDED)
> +static void use_default()
> +{
> + puts ("*** Warning - bad CRC or MMC, using default
> environment\n\n");
> + set_default_env();
> +}
> +#endif
> +
> diff --git a/include/environment.h b/include/environment.h
> index b9924fd..aa0e750 100644
> --- a/include/environment.h
> +++ b/include/environment.h
> @@ -94,6 +94,24 @@
> # endif
> #endif /* CONFIG_ENV_IS_IN_MG_DISK */
>
> +#if defined(CONFIG_ENV_IS_IN_MMC)
> +# ifndef CONFIG_ENV_OFFSET
> +# error "Need to define CONFIG_ENV_OFFSET when using
> CONFIG_ENV_IS_IN_MMC"
> +# endif
> +# ifndef CONFIG_ENV_ADDR
> +# define CONFIG_ENV_ADDR (CONFIG_ENV_OFFSET)
> +# endif
> +# ifndef CONFIG_ENV_OFFSET
> +# define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR) # endif # ifdef
> +CONFIG_ENV_OFFSET_REDUND # define
> CONFIG_SYS_REDUNDAND_ENVIRONMENT #
> +endif # ifdef CONFIG_ENV_IS_EMBEDDED
> +# define ENV_IS_EMBEDDED 1
> +# endif
> +#endif /* CONFIG_ENV_IS_IN_MMC */
> +
> /* Embedded env is only supported for some flash types */
> #ifdef CONFIG_ENV_IS_EMBEDDED # if
> !defined(CONFIG_ENV_IS_IN_FLASH) && \
> --
> 1.6.0.6
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>
-------------- next part --------------
An embedded message was scrubbed...
From: "Lv Terry-R65388" <r65388@freescale.com>
Subject: [PATCH] [PATCH v5]Save environment data to mmc.
Date: Fri, 7 May 2010 13:22:00 +0800
Size: 8262
Url: http://lists.denx.de/pipermail/u-boot/attachments/20100513/60446626/attachment.eml
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix
2010-05-12 9:38 [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
@ 2010-05-13 15:13 ` Paulraj, Sandeep
2010-05-14 17:30 ` Andy Fleming
2 siblings, 0 replies; 25+ messages in thread
From: Paulraj, Sandeep @ 2010-05-13 15:13 UTC (permalink / raw)
To: u-boot
Andy,
Can you be kind enough to review these MMC patches.
I believe there are 2 sets of patches.
Thanks,
Sandeep
> Subject: [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix
>
> Fixed a bug wherein SD version 1.0 cards were not configured for 4-bit
> mode
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
> ---
> drivers/mmc/mmc.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index cf4ea16..959d8ad 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -520,6 +520,9 @@ retry_scr:
> break;
> }
>
> + if (mmc->scr[0] & SD_DATA_4BIT)
> + mmc->card_caps |= MMC_MODE_4BIT;
> +
> /* Version 1.0 doesn't support switching */
> if (mmc->version == SD_VERSION_1_0)
> return 0;
> @@ -537,9 +540,6 @@ retry_scr:
> break;
> }
>
> - if (mmc->scr[0] & SD_DATA_4BIT)
> - mmc->card_caps |= MMC_MODE_4BIT;
> -
> /* If high-speed isn't supported, we return */
> if (!(__be32_to_cpu(switch_status[3]) & SD_HIGHSPEED_SUPPORTED))
> return 0;
> --
> 1.6.0.6
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Alagu Sankar
@ 2010-05-14 8:16 ` Sudhakar Rajashekhara
2010-05-14 17:32 ` Andy Fleming
2 siblings, 0 replies; 25+ messages in thread
From: Sudhakar Rajashekhara @ 2010-05-14 8:16 UTC (permalink / raw)
To: u-boot
Hi Alagu,
On Wed, May 12, 2010 at 15:08:25, Alagu Sankar wrote:
> Fixed a bug in card capacity calculation for MMC high-capacity cards.
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
> ---
> drivers/mmc/mmc.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 959d8ad..e7abf94 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -393,6 +393,7 @@ int mmc_change_freq(struct mmc *mmc)
> char ext_csd[512];
> char cardtype;
> int err;
> + unsigned int sec_count;
>
This can be uint too or you can use unsigned int to typecast below.
Regards,
Sudhakar
> mmc->card_caps = 0;
>
> @@ -407,8 +408,14 @@ int mmc_change_freq(struct mmc *mmc)
> if (err)
> return err;
>
> - if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
> + sec_count = ((uint)ext_csd[212] |
> + ((uint)ext_csd[213] << 8) |
> + ((uint)ext_csd[214] << 16) |
> + ((uint)ext_csd[215] << 24));
> + if (sec_count) {
> mmc->high_capacity = 1;
> + mmc->capacity = sec_count * 512;
> + }
>
> cardtype = ext_csd[196] & 0xf;
>
> --
> 1.6.0.6
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-12 9:38 ` [U-Boot] [PATCH 4/4] Environment in MMC Alagu Sankar
2010-05-13 7:08 ` Lv Terry-R65388
@ 2010-05-14 8:26 ` Sudhakar Rajashekhara
2010-05-14 9:52 ` Wolfgang Denk
2010-05-14 10:02 ` Stefano Babic
1 sibling, 2 replies; 25+ messages in thread
From: Sudhakar Rajashekhara @ 2010-05-14 8:26 UTC (permalink / raw)
To: u-boot
Hi Alagu,
On Wed, May 12, 2010 at 15:08:27, Alagu Sankar wrote:
> This patch is to save environment data to mmc card. It uses interfaces defined
> in generic MMC framework. This is enabled with CONFIG_ENV_IS_IN_MMC option.
> Based on the earlier patch from Terry Lv at Freescale
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
> ---
> arch/arm/lib/board.c | 10 ++--
> arch/powerpc/lib/board.c | 12 ++--
> common/Makefile | 1 +
> common/cmd_nvedit.c | 3 +-
> common/env_mmc.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++
> include/environment.h | 18 +++++
> 6 files changed, 200 insertions(+), 12 deletions(-)
> create mode 100644 common/env_mmc.c
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index f5660a9..5e7558e 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -338,6 +338,11 @@ void start_armboot (void)
> nand_init(); /* go init the NAND */
> #endif
>
> +#ifdef CONFIG_GENERIC_MMC
> + puts ("MMC: ");
> + mmc_initialize (gd->bd);
> +#endif
> +
Why this has been moved up? If there is any genuine reason for this, then
you can mention it in patch description.
> #if defined(CONFIG_CMD_ONENAND)
> onenand_init();
> #endif
> @@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t *addr);
> board_late_init ();
> #endif
>
> -#ifdef CONFIG_GENERIC_MMC
> - puts ("MMC: ");
> - mmc_initialize (gd->bd);
> -#endif
> -
> #ifdef CONFIG_BITBANGMII
> bb_miiphy_init();
> #endif
> diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
> index 7b09fb5..1008635 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -783,6 +783,12 @@ void board_init_r (gd_t *id, ulong dest_addr)
> nand_init(); /* go init the NAND */
> #endif
>
> +#ifdef CONFIG_GENERIC_MMC
> + WATCHDOG_RESET ();
> + puts ("MMC: ");
> + mmc_initialize (bd);
> +#endif
> +
The above comment applies here as well.
> /* relocate environment function pointers etc. */
> env_relocate ();
>
> @@ -939,12 +945,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
> scsi_init ();
> #endif
>
> -#ifdef CONFIG_GENERIC_MMC
> - WATCHDOG_RESET ();
> - puts ("MMC: ");
> - mmc_initialize (bd);
> -#endif
> -
> #if defined(CONFIG_CMD_DOC)
> WATCHDOG_RESET ();
> puts ("DOC: ");
> diff --git a/common/Makefile b/common/Makefile
> index dbf7a05..2c37073 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -58,6 +58,7 @@ COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
> COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
> COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
> COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
> +COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
> COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
> COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
> COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
> diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
> index eb89e9e..27e46f7 100644
> --- a/common/cmd_nvedit.c
> +++ b/common/cmd_nvedit.c
> @@ -63,9 +63,10 @@ DECLARE_GLOBAL_DATA_PTR;
> !defined(CONFIG_ENV_IS_IN_NVRAM) && \
> !defined(CONFIG_ENV_IS_IN_ONENAND) && \
> !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \
> + !defined(CONFIG_ENV_IS_IN_MMC) && \
> !defined(CONFIG_ENV_IS_NOWHERE)
> # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
> -SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
> +SPI_FLASH|MG_DISK|NVRAM|MMC|NOWHERE}
> #endif
>
> #define XMK_STR(x) #x
> diff --git a/common/env_mmc.c b/common/env_mmc.c
> new file mode 100644
> index 0000000..ef7e5fb
> --- /dev/null
> +++ b/common/env_mmc.c
> @@ -0,0 +1,168 @@
> +/*
> + * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
> + * (C) Copyright 2000-2006
> + * Wolfgang Denk, DENX Software Engineering, w... at denx.de.
> + *
I do not see your copyright here.
Regards,
Sudhakar
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-14 8:26 ` Sudhakar Rajashekhara
@ 2010-05-14 9:52 ` Wolfgang Denk
2010-05-14 10:02 ` Stefano Babic
1 sibling, 0 replies; 25+ messages in thread
From: Wolfgang Denk @ 2010-05-14 9:52 UTC (permalink / raw)
To: u-boot
Dear "Sudhakar Rajashekhara",
In message <014f01caf33f$17c731a0$475594e0$@raj@ti.com> you wrote:
>
> > --- /dev/null
> > +++ b/common/env_mmc.c
> > @@ -0,0 +1,168 @@
> > +/*
> > + * (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
> > + * (C) Copyright 2000-2006
> > + * Wolfgang Denk, DENX Software Engineering, w... at denx.de.
> > + *
>
> I do not see your copyright here.
We do not add Copyright entries to the source files for relatively
small patches; proper attribution is guaranteed through the
Signed-off-by: lines and committer entries in the git repository.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A child is a person who can't understand why someone would give away
a perfectly good kitten." - Doug Larson
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-14 8:26 ` Sudhakar Rajashekhara
2010-05-14 9:52 ` Wolfgang Denk
@ 2010-05-14 10:02 ` Stefano Babic
2010-05-14 10:54 ` Alagu Sankar
1 sibling, 1 reply; 25+ messages in thread
From: Stefano Babic @ 2010-05-14 10:02 UTC (permalink / raw)
To: u-boot
Sudhakar Rajashekhara wrote:
> Hi Alagu,
>
Hi,
> On Wed, May 12, 2010 at 15:08:27, Alagu Sankar wrote:
>> This patch is to save environment data to mmc card. It uses interfaces defined
>> in generic MMC framework. This is enabled with CONFIG_ENV_IS_IN_MMC option.
>> Based on the earlier patch from Terry Lv at Freescale
Should be not better you send your comments to Terry as to generate a
new patch? His patch had already passed some reviews and he can
integrate your comments. I miss here what you changed respect Terry, and
you miss some comments in the previous reviews, for example regarding
the usage of the ALIGN macro. Why do you need two patches for the same
purpose ?
> Why this has been moved up? If there is any genuine reason for this, then
> you can mention it in patch description.
That is correct. The mmc must be initialized before env_init to get the
environment working.
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-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-14 10:02 ` Stefano Babic
@ 2010-05-14 10:54 ` Alagu Sankar
2010-05-14 11:40 ` Stefano Babic
0 siblings, 1 reply; 25+ messages in thread
From: Alagu Sankar @ 2010-05-14 10:54 UTC (permalink / raw)
To: u-boot
Stefano Babic wrote:
> Sudhakar Rajashekhara wrote:
>
>> Hi Alagu,
>>
>>
> Hi,
>
>
>> On Wed, May 12, 2010 at 15:08:27, Alagu Sankar wrote:
>>
>>> This patch is to save environment data to mmc card. It uses interfaces defined
>>> in generic MMC framework. This is enabled with CONFIG_ENV_IS_IN_MMC option.
>>> Based on the earlier patch from Terry Lv at Freescale
>>>
>
> Should be not better you send your comments to Terry as to generate a
> new patch? His patch had already passed some reviews and he can
> integrate your comments. I miss here what you changed respect Terry, and
> you miss some comments in the previous reviews, for example regarding
> the usage of the ALIGN macro. Why do you need two patches for the same
> purpose ?
>
>
>> Why this has been moved up? If there is any genuine reason for this, then
>> you can mention it in patch description.
>>
>
> That is correct. The mmc must be initialized before env_init to get the
> environment working.
>
> Best regards,
> Stefano Babic
>
>
When I searched for the Environment support in MMC, I came across
Terry's earlier patches, but they were not cleanly getting applied to
the current tree. There is no value add here except fixing the patch
errors and generating a new patch for the current tree. So there is no
question of adding any copyright here. Terry has indicated an update to
his patch already. I will be resubmitting my other patches with
reference to Terry's latest patch.
- Alagu Sankar
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-14 10:54 ` Alagu Sankar
@ 2010-05-14 11:40 ` Stefano Babic
2010-05-14 11:54 ` Alagu Sankar
2010-05-17 7:31 ` Lv Terry-R65388
0 siblings, 2 replies; 25+ messages in thread
From: Stefano Babic @ 2010-05-14 11:40 UTC (permalink / raw)
To: u-boot
Alagu Sankar wrote:
>>
> When I searched for the Environment support in MMC, I came across
> Terry's earlier patches, but they were not cleanly getting applied to
> the current tree.
I have tried to apply again last Terry's patch, I see only a couple of
coding-style problems, no errors at all:
Applying: Save environment data to mmc.
/home/stefano/Projects/imx/u-boot-imx/.git/rebase-apply/patch:21:
trailing whitespace.
* Thus It is required that operations like pin multiplexer
/home/stefano/Projects/imx/u-boot-imx/.git/rebase-apply/patch:54:
trailing whitespace.
* Thus It is required that operations like pin multiplexer
warning: 2 lines add whitespace errors.
> There is no value add here except fixing the patch
> errors and generating a new patch for the current tree.
Probably not needed. I have not seen the errors you reported. Are you
sure you have tested with Terry's last patch ? It seems you submit an
earlier version.
> So there is no
> question of adding any copyright here.
Yes, Wolfgang has already answered. No need to add a copyright for small
patches.
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-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-14 11:40 ` Stefano Babic
@ 2010-05-14 11:54 ` Alagu Sankar
2010-05-17 7:31 ` Lv Terry-R65388
1 sibling, 0 replies; 25+ messages in thread
From: Alagu Sankar @ 2010-05-14 11:54 UTC (permalink / raw)
To: u-boot
Stefano Babic wrote:
> Alagu Sankar wrote:
>
>
>>>
>>>
>> When I searched for the Environment support in MMC, I came across
>> Terry's earlier patches, but they were not cleanly getting applied to
>> the current tree.
>>
>
> I have tried to apply again last Terry's patch, I see only a couple of
> coding-style problems, no errors at all:
>
> Applying: Save environment data to mmc.
> /home/stefano/Projects/imx/u-boot-imx/.git/rebase-apply/patch:21:
> trailing whitespace.
> * Thus It is required that operations like pin multiplexer
> /home/stefano/Projects/imx/u-boot-imx/.git/rebase-apply/patch:54:
> trailing whitespace.
> * Thus It is required that operations like pin multiplexer
> warning: 2 lines add whitespace errors.
>
>
>> There is no value add here except fixing the patch
>> errors and generating a new patch for the current tree.
>>
>
> Probably not needed. I have not seen the errors you reported. Are you
> sure you have tested with Terry's last patch ? It seems you submit an
> earlier version.
>
>
>> So there is no
>> question of adding any copyright here.
>>
>
> Yes, Wolfgang has already answered. No need to add a copyright for small
> patches.
>
> Best regards,
> Stefano Babic
>
>
I was referring to Terry's old patches, and not the v5 patch he has
submitted recently. I started on this some time back. Its a mistake
that I did not check the updates that happened recently, before
submitting the patches.
Best Regards,
Alagu Sankar
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix
2010-05-12 9:38 [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
2010-05-13 15:13 ` [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Paulraj, Sandeep
@ 2010-05-14 17:30 ` Andy Fleming
2010-09-09 22:21 ` John Rigby
2 siblings, 1 reply; 25+ messages in thread
From: Andy Fleming @ 2010-05-14 17:30 UTC (permalink / raw)
To: u-boot
On Wed, May 12, 2010 at 4:38 AM, Alagu Sankar <alagusankar@embwise.com> wrote:
> Fixed a bug wherein SD version 1.0 cards were not configured for 4-bit mode
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Alagu Sankar
2010-05-14 8:16 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Sudhakar Rajashekhara
@ 2010-05-14 17:32 ` Andy Fleming
2 siblings, 0 replies; 25+ messages in thread
From: Andy Fleming @ 2010-05-14 17:32 UTC (permalink / raw)
To: u-boot
On Wed, May 12, 2010 at 4:38 AM, Alagu Sankar <alagusankar@embwise.com> wrote:
> Fixed a bug in card capacity calculation for MMC high-capacity cards.
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-05-12 9:38 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 4/4] Environment in MMC Alagu Sankar
@ 2010-05-14 17:37 ` Andy Fleming
2010-09-13 7:51 ` Lei Wen
2010-10-04 20:32 ` John Rigby
1 sibling, 2 replies; 25+ messages in thread
From: Andy Fleming @ 2010-05-14 17:37 UTC (permalink / raw)
To: u-boot
On Wed, May 12, 2010 at 4:38 AM, Alagu Sankar <alagusankar@embwise.com> wrote:
> Added Multi-Block Read support for Generic MMC. Modified existing multi-block
> write to limit the maximum number of blocks per transfer. ?This feature is
> enabled with CONFIG_MMC_MBLOCK option. ?A new member is added in the mmc
> structure for the host controller to specify the maximum number of blocks it
> supports.
>
> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
I removed the config option, and just made this always how it works. Applied.
Thanks!
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 4/4] Environment in MMC
2010-05-14 11:40 ` Stefano Babic
2010-05-14 11:54 ` Alagu Sankar
@ 2010-05-17 7:31 ` Lv Terry-R65388
1 sibling, 0 replies; 25+ messages in thread
From: Lv Terry-R65388 @ 2010-05-17 7:31 UTC (permalink / raw)
To: u-boot
Hi,
I've just send v6 version for review which fixes the coding-style problems.
Thanks~~
Yours
Terry
> -----Original Message-----
> From: Stefano Babic [mailto:sbabic at denx.de]
> Sent: 2010?5?14? 19:41
> To: Alagu Sankar
> Cc: Stefano Babic; Sudhakar Rajashekhara;
> u-boot at lists.denx.de; Lv Terry-R65388
> Subject: Re: [U-Boot] [PATCH 4/4] Environment in MMC
>
> Alagu Sankar wrote:
>
> >>
> > When I searched for the Environment support in MMC, I came across
> > Terry's earlier patches, but they were not cleanly getting
> applied to
> > the current tree.
>
> I have tried to apply again last Terry's patch, I see only a
> couple of coding-style problems, no errors at all:
>
> Applying: Save environment data to mmc.
> /home/stefano/Projects/imx/u-boot-imx/.git/rebase-apply/patch:21:
> trailing whitespace.
> * Thus It is required that operations like pin multiplexer
> /home/stefano/Projects/imx/u-boot-imx/.git/rebase-apply/patch:54:
> trailing whitespace.
> * Thus It is required that operations like pin multiplexer
> warning: 2 lines add whitespace errors.
>
> > There is no value add here except fixing the patch errors and
> > generating a new patch for the current tree.
>
> Probably not needed. I have not seen the errors you reported.
> Are you sure you have tested with Terry's last patch ? It
> seems you submit an earlier version.
>
> > So there is no
> > question of adding any copyright here.
>
> Yes, Wolfgang has already answered. No need to add a
> copyright for small patches.
>
> 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-0 Fax: +49-8142-66989-80 Email:
> office at denx.de
> =====================================================================
>
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix
2010-05-14 17:30 ` Andy Fleming
@ 2010-09-09 22:21 ` John Rigby
0 siblings, 0 replies; 25+ messages in thread
From: John Rigby @ 2010-09-09 22:21 UTC (permalink / raw)
To: u-boot
On Fri, May 14, 2010 at 11:30 AM, Andy Fleming <afleming@gmail.com> wrote:
> On Wed, May 12, 2010 at 4:38 AM, Alagu Sankar <alagusankar@embwise.com> wrote:
>> Fixed a bug wherein SD version 1.0 cards were not configured for 4-bit mode
>>
>> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
>
> Applied, thanks!
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Andy,
You responded with an "Applied, thanks!" to this and two other patches
from Alagu but I can't find them in your mmc tree or Wolfgang's tree
on git.denx.de. Am I missing something, or did they get dropped?
Thanks
John
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-05-14 17:37 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Andy Fleming
@ 2010-09-13 7:51 ` Lei Wen
2010-10-04 20:32 ` John Rigby
1 sibling, 0 replies; 25+ messages in thread
From: Lei Wen @ 2010-09-13 7:51 UTC (permalink / raw)
To: u-boot
Hi,
Has this changed been merged into uboot mainline?
Current mmc framework read is rather slow comparing with the write...
If we could get the multiply-read behavior, that would be nice. :-)
Thanks,
Lei
On Sat, May 15, 2010 at 1:37 AM, Andy Fleming <afleming@gmail.com> wrote:
> On Wed, May 12, 2010 at 4:38 AM, Alagu Sankar <alagusankar@embwise.com> wrote:
>> Added Multi-Block Read support for Generic MMC. Modified existing multi-block
>> write to limit the maximum number of blocks per transfer. ?This feature is
>> enabled with CONFIG_MMC_MBLOCK option. ?A new member is added in the mmc
>> structure for the host controller to specify the maximum number of blocks it
>> supports.
>>
>> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
>
>
> I removed the config option, and just made this always how it works. ?Applied.
>
> Thanks!
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-05-14 17:37 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Andy Fleming
2010-09-13 7:51 ` Lei Wen
@ 2010-10-04 20:32 ` John Rigby
2010-10-14 21:44 ` Steve Sakoman
1 sibling, 1 reply; 25+ messages in thread
From: John Rigby @ 2010-10-04 20:32 UTC (permalink / raw)
To: u-boot
Alagu,
This never made it into Andy's tree nor upstream. Could you submit a
new patch to current upstream with the config option removed as Andy
said he did back in May? Maybe we can get it commited via some other
maintainer. Steve Sakoman seems to have done some MMC work lately.
Thanks,
John
On Fri, May 14, 2010 at 11:37 AM, Andy Fleming <afleming@gmail.com> wrote:
> On Wed, May 12, 2010 at 4:38 AM, Alagu Sankar <alagusankar@embwise.com> wrote:
>> Added Multi-Block Read support for Generic MMC. Modified existing multi-block
>> write to limit the maximum number of blocks per transfer. ?This feature is
>> enabled with CONFIG_MMC_MBLOCK option. ?A new member is added in the mmc
>> structure for the host controller to specify the maximum number of blocks it
>> supports.
>>
>> Signed-off-by: Alagu Sankar <alagusankar@embwise.com>
>
>
> I removed the config option, and just made this always how it works. ?Applied.
>
> Thanks!
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-10-04 20:32 ` John Rigby
@ 2010-10-14 21:44 ` Steve Sakoman
2010-10-14 21:53 ` Paulraj, Sandeep
2010-10-23 15:14 ` Ghorai, Sukumar
0 siblings, 2 replies; 25+ messages in thread
From: Steve Sakoman @ 2010-10-14 21:44 UTC (permalink / raw)
To: u-boot
On Mon, Oct 4, 2010 at 1:32 PM, John Rigby <jcrigby@gmail.com> wrote:
> Alagu,
>
> This never made it into Andy's tree nor upstream. ?Could you submit a
> new patch to current upstream with the config option removed as Andy
> said he did back in May? ?Maybe we can get it commited via some other
> maintainer. ?Steve Sakoman seems to have done some MMC work lately.
I've done some testing with this patch on OMAP3 and OMAP4, in the
"always enabled" version.
I compared the old legacy mmc driver vs the new generic mmc driver vs
new generic mmc driver with multiblock read support added.
The good news is that the generic mmc driver for OMAP is almost twice
as fast as the old legacy driver. These patches should be in the next
u-boot-ti pull request and so will be in mainline shortly.
The bad news is that multiblock reads seem to make no difference :-(
For reading a 45MB file from an ext3 partition using ext2load I get:
legacy: 62 seconds
generic: 35 seconds
generic w/ multi: 35 seconds
I'm happy to resubmit the multi-block read patch because it does seem
to work properly and may even yield improvements on other
architectures.
Would you like me to do that?
Steve
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-10-14 21:44 ` Steve Sakoman
@ 2010-10-14 21:53 ` Paulraj, Sandeep
2010-10-23 15:14 ` Ghorai, Sukumar
1 sibling, 0 replies; 25+ messages in thread
From: Paulraj, Sandeep @ 2010-10-14 21:53 UTC (permalink / raw)
To: u-boot
>
> On Mon, Oct 4, 2010 at 1:32 PM, John Rigby <jcrigby@gmail.com> wrote:
> > Alagu,
> >
> > This never made it into Andy's tree nor upstream. ?Could you submit a
> > new patch to current upstream with the config option removed as Andy
> > said he did back in May? ?Maybe we can get it commited via some other
> > maintainer. ?Steve Sakoman seems to have done some MMC work lately.
>
> I've done some testing with this patch on OMAP3 and OMAP4, in the
> "always enabled" version.
>
> I compared the old legacy mmc driver vs the new generic mmc driver vs
> new generic mmc driver with multiblock read support added.
>
> The good news is that the generic mmc driver for OMAP is almost twice
> as fast as the old legacy driver. These patches should be in the next
> u-boot-ti pull request and so will be in mainline shortly.
>
> The bad news is that multiblock reads seem to make no difference :-(
>
> For reading a 45MB file from an ext3 partition using ext2load I get:
>
> legacy: 62 seconds
> generic: 35 seconds
> generic w/ multi: 35 seconds
>
> I'm happy to resubmit the multi-block read patch because it does seem
> to work properly and may even yield improvements on other
> architectures.
>
> Would you like me to do that?
>
> Steve
Yes please submit updated patches if you have them in your tree. Others might want to participate in a new round of review.
Sandeep
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-10-14 21:44 ` Steve Sakoman
2010-10-14 21:53 ` Paulraj, Sandeep
@ 2010-10-23 15:14 ` Ghorai, Sukumar
2010-10-25 17:29 ` Steve Sakoman
1 sibling, 1 reply; 25+ messages in thread
From: Ghorai, Sukumar @ 2010-10-23 15:14 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de]
> On Behalf Of Steve Sakoman
> Sent: Friday, October 15, 2010 3:14 AM
> To: John Rigby
> Cc: u-boot at lists.denx.de; Alagu Sankar; Andy Fleming
> Subject: Re: [U-Boot] [PATCH 3/4] MMC Multi-block Support
>
> On Mon, Oct 4, 2010 at 1:32 PM, John Rigby <jcrigby@gmail.com> wrote:
> > Alagu,
> >
> > This never made it into Andy's tree nor upstream. ?Could you submit a
> > new patch to current upstream with the config option removed as Andy
> > said he did back in May? ?Maybe we can get it commited via some other
> > maintainer. ?Steve Sakoman seems to have done some MMC work lately.
>
> I've done some testing with this patch on OMAP3 and OMAP4, in the
> "always enabled" version.
>
> I compared the old legacy mmc driver vs the new generic mmc driver vs
> new generic mmc driver with multiblock read support added.
>
> The good news is that the generic mmc driver for OMAP is almost twice
> as fast as the old legacy driver. These patches should be in the next
> u-boot-ti pull request and so will be in mainline shortly.
>
> The bad news is that multiblock reads seem to make no difference :-(
>
> For reading a 45MB file from an ext3 partition using ext2load I get:
>
> legacy: 62 seconds
> generic: 35 seconds
> generic w/ multi: 35 seconds
>
> I'm happy to resubmit the multi-block read patch because it does seem
> to work properly and may even yield improvements on other
> architectures.
>
> Would you like me to do that?
[Ghorai]
would you please try with additional change?
$>git diff drivers/mmc/omap_hsmmc.c
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index f8b9840..7f3f968 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -401,6 +401,7 @@ int omap_mmc_init(int dev_index)
mmc->f_min = 400000;
mmc->f_max = 52000000;
+ mmc->b_max = 0xFFFF;
mmc_register(mmc);
>
> Steve
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-10-23 15:14 ` Ghorai, Sukumar
@ 2010-10-25 17:29 ` Steve Sakoman
2010-10-25 18:19 ` Ghorai, Sukumar
0 siblings, 1 reply; 25+ messages in thread
From: Steve Sakoman @ 2010-10-25 17:29 UTC (permalink / raw)
To: u-boot
On Sat, Oct 23, 2010 at 8:14 AM, Ghorai, Sukumar <s-ghorai@ti.com> wrote:
>
>
>> -----Original Message-----
>> From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de]
>> On Behalf Of Steve Sakoman
>> Sent: Friday, October 15, 2010 3:14 AM
>> To: John Rigby
>> Cc: u-boot at lists.denx.de; Alagu Sankar; Andy Fleming
>> Subject: Re: [U-Boot] [PATCH 3/4] MMC Multi-block Support
>>
>> On Mon, Oct 4, 2010 at 1:32 PM, John Rigby <jcrigby@gmail.com> wrote:
>> > Alagu,
>> >
>> > This never made it into Andy's tree nor upstream. ?Could you submit a
>> > new patch to current upstream with the config option removed as Andy
>> > said he did back in May? ?Maybe we can get it commited via some other
>> > maintainer. ?Steve Sakoman seems to have done some MMC work lately.
>>
>> I've done some testing with this patch on OMAP3 and OMAP4, in the
>> "always enabled" version.
>>
>> I compared the old legacy mmc driver vs the new generic mmc driver vs
>> new generic mmc driver with multiblock read support added.
>>
>> The good news is that the generic mmc driver for OMAP is almost twice
>> as fast as the old legacy driver. ?These patches should be in the next
>> u-boot-ti pull request and so will be in mainline shortly.
>>
>> The bad news is that multiblock reads seem to make no difference :-(
>>
>> For reading a 45MB file from an ext3 partition using ext2load I get:
>>
>> legacy: ? ? ? ? ? ? ?62 seconds
>> generic: ? ? ? ? ? ? 35 seconds
>> generic w/ multi: 35 seconds
>>
>> I'm happy to resubmit the multi-block read patch because it does seem
>> to work properly and may even yield improvements on other
>> architectures.
>>
>> Would you like me to do that?
> [Ghorai]
> would you please try with additional change?
Yes! That is much better!
Now multiblock reads are faster :-)
The results (including the old legacy mmc driver for reference):
legacy: 62 seconds
generic: 35 seconds
generic w/ multi: 9 seconds
I will add my "Acked-by" and "Tested-by" and submit the final patch to
the list later today.
Steve
> $>git diff drivers/mmc/omap_hsmmc.c
>
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index f8b9840..7f3f968 100644
> --- a/drivers/mmc/omap_hsmmc.c
> +++ b/drivers/mmc/omap_hsmmc.c
> @@ -401,6 +401,7 @@ int omap_mmc_init(int dev_index)
>
> ? ? ? ?mmc->f_min = 400000;
> ? ? ? ?mmc->f_max = 52000000;
> + ? ? ? mmc->b_max = 0xFFFF;
>
> ? ? ? ?mmc_register(mmc);
>
>>
>> Steve
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] [PATCH 3/4] MMC Multi-block Support
2010-10-25 17:29 ` Steve Sakoman
@ 2010-10-25 18:19 ` Ghorai, Sukumar
0 siblings, 0 replies; 25+ messages in thread
From: Ghorai, Sukumar @ 2010-10-25 18:19 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Steve Sakoman [mailto:sakoman at gmail.com]
> Sent: Monday, October 25, 2010 11:00 PM
> To: Ghorai, Sukumar
> Cc: John Rigby; u-boot at lists.denx.de; Alagu Sankar; Andy Fleming
> Subject: Re: [U-Boot] [PATCH 3/4] MMC Multi-block Support
>
> On Sat, Oct 23, 2010 at 8:14 AM, Ghorai, Sukumar <s-ghorai@ti.com> wrote:
> >
> >
> >> -----Original Message-----
> >> From: u-boot-bounces at lists.denx.de [mailto:u-boot-
> bounces at lists.denx.de]
> >> On Behalf Of Steve Sakoman
> >> Sent: Friday, October 15, 2010 3:14 AM
> >> To: John Rigby
> >> Cc: u-boot at lists.denx.de; Alagu Sankar; Andy Fleming
> >> Subject: Re: [U-Boot] [PATCH 3/4] MMC Multi-block Support
> >>
> >> On Mon, Oct 4, 2010 at 1:32 PM, John Rigby <jcrigby@gmail.com> wrote:
> >> > Alagu,
> >> >
> >> > This never made it into Andy's tree nor upstream. ?Could you submit a
> >> > new patch to current upstream with the config option removed as Andy
> >> > said he did back in May? ?Maybe we can get it commited via some other
> >> > maintainer. ?Steve Sakoman seems to have done some MMC work lately.
> >>
> >> I've done some testing with this patch on OMAP3 and OMAP4, in the
> >> "always enabled" version.
> >>
> >> I compared the old legacy mmc driver vs the new generic mmc driver vs
> >> new generic mmc driver with multiblock read support added.
> >>
> >> The good news is that the generic mmc driver for OMAP is almost twice
> >> as fast as the old legacy driver. ?These patches should be in the next
> >> u-boot-ti pull request and so will be in mainline shortly.
> >>
> >> The bad news is that multiblock reads seem to make no difference :-(
> >>
> >> For reading a 45MB file from an ext3 partition using ext2load I get:
> >>
> >> legacy: ? ? ? ? ? ? ?62 seconds
> >> generic: ? ? ? ? ? ? 35 seconds
> >> generic w/ multi: 35 seconds
> >>
> >> I'm happy to resubmit the multi-block read patch because it does seem
> >> to work properly and may even yield improvements on other
> >> architectures.
> >>
> >> Would you like me to do that?
>
> > [Ghorai]
> > would you please try with additional change?
>
> Yes! That is much better!
>
> Now multiblock reads are faster :-)
>
> The results (including the old legacy mmc driver for reference):
>
> legacy: 62 seconds
> generic: 35 seconds
> generic w/ multi: 9 seconds
>
> I will add my "Acked-by" and "Tested-by" and submit the final patch to
> the list later today.
[Ghorai] please add
Tested-by: Sukumar Ghorai <s-ghorai@ti.com>
And will submit a separate patch as mentioned below.
>
> Steve
>
>
> > $>git diff drivers/mmc/omap_hsmmc.c
> >
> > diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> > index f8b9840..7f3f968 100644
> > --- a/drivers/mmc/omap_hsmmc.c
> > +++ b/drivers/mmc/omap_hsmmc.c
> > @@ -401,6 +401,7 @@ int omap_mmc_init(int dev_index)
> >
> > ? ? ? ?mmc->f_min = 400000;
> > ? ? ? ?mmc->f_max = 52000000;
> > + ? ? ? mmc->b_max = 0xFFFF;
> >
> > ? ? ? ?mmc_register(mmc);
> >
> >>
> >> Steve
> >> _______________________________________________
> >> U-Boot mailing list
> >> U-Boot at lists.denx.de
> >> http://lists.denx.de/mailman/listinfo/u-boot
> >
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2010-10-25 18:19 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 9:38 [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Alagu Sankar
2010-05-12 9:38 ` [U-Boot] [PATCH 4/4] Environment in MMC Alagu Sankar
2010-05-13 7:08 ` Lv Terry-R65388
2010-05-14 8:26 ` Sudhakar Rajashekhara
2010-05-14 9:52 ` Wolfgang Denk
2010-05-14 10:02 ` Stefano Babic
2010-05-14 10:54 ` Alagu Sankar
2010-05-14 11:40 ` Stefano Babic
2010-05-14 11:54 ` Alagu Sankar
2010-05-17 7:31 ` Lv Terry-R65388
2010-05-14 17:37 ` [U-Boot] [PATCH 3/4] MMC Multi-block Support Andy Fleming
2010-09-13 7:51 ` Lei Wen
2010-10-04 20:32 ` John Rigby
2010-10-14 21:44 ` Steve Sakoman
2010-10-14 21:53 ` Paulraj, Sandeep
2010-10-23 15:14 ` Ghorai, Sukumar
2010-10-25 17:29 ` Steve Sakoman
2010-10-25 18:19 ` Ghorai, Sukumar
2010-05-14 8:16 ` [U-Boot] [PATCH 2/4] MMC Card Capacity Bug Fix Sudhakar Rajashekhara
2010-05-14 17:32 ` Andy Fleming
2010-05-13 15:13 ` [U-Boot] [PATCH 1/4] SD1.00 wide-bus fix Paulraj, Sandeep
2010-05-14 17:30 ` Andy Fleming
2010-09-09 22:21 ` John Rigby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox