From: Donghwa Lee <dh09.lee@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] tools: fw_printenv supports mmc device
Date: Fri, 17 Dec 2010 11:34:40 +0900 [thread overview]
Message-ID: <4D0ACC40.3060003@samsung.com> (raw)
In-Reply-To: <4D09B4CF.4000505@denx.de>
On 2010-12-16 ?? 3:42 , Stefano Babic wrote:
> On 12/16/2010 02:22 AM, Donghwa Lee wrote:
>> diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
>> index 8ff7052..5a707f6 100644
>> --- a/tools/env/fw_env.c
>> +++ b/tools/env/fw_env.c
>> @@ -855,6 +855,7 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
>> }
>>
>> erase.start = blockstart;
>> +#ifndef CONFIG_ENV_IS_IN_MMC
> Can we get rid of this #ifdef statement ? This does not allow to include
> the binary in a distro, because it is decided at compile time where the
> environment is stored.
>
> We already check if we are using a flash device in fw_env.c, when we
> call ioctl (fd, MEMGETINFO, &mtdinfo). At the moment, we set the
> mtd_type field in the envdevices structure only with MTD_NORFLASH or
> MTD_NANDFLASH. I think it should be better to improve the check to find
> on which medium we store the environment and set the mtd_type according
> to its result if a SD/MMC is found (with MTD_MMC, maybe ?).
>
I think SD/MMC may not use MEMGETINFO ioctl. If mmc device doesn't use MTD, use only one partition, it can not use MEMGETINFO ioctl?
Actually, environment variables are very small area in SD/MMC, it doesn't need to divide own partition.
But, I think my patch that uses #ifndef statement was wrong, it needs to change another way.
>> # Notice, that the "Number of sectors" is ignored on NOR.
>>
>> # MTD device name Device offset Env. size Flash sector size Number of sectors
>> -/dev/mtd1 0x0000 0x4000 0x4000
>> -/dev/mtd2 0x0000 0x4000 0x4000
>> +#/dev/mtd1 0x0000 0x4000 0x4000
>> +#/dev/mtd2 0x0000 0x4000 0x4000
> I do not see any change in these lines..
>
yes, there is no change, i added avobe to tell that case of not using /dev/mtd# node.
>>
>> # NAND example
>> #/dev/mtd0 0x4000 0x4000 0x20000 2
>> +
>> +# MMC device name Device offset Env. size Flash sector size Number of sectors
>> +/dev/mmcblk0 0x7000 0x1000 0x1000
> Do we need Flash sector size for MMC ?
MMC doesn't need to flash sector size. MMC can overwrite.
> Best regards,
> Stefano Babic
>
next prev parent reply other threads:[~2010-12-17 2:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 1:22 [U-Boot] [PATCH] tools: fw_printenv supports mmc device Donghwa Lee
2010-12-16 6:42 ` Stefano Babic
2010-12-17 2:34 ` Donghwa Lee [this message]
2010-12-16 18:45 ` Steve Sakoman
2010-12-17 2:58 ` Donghwa Lee
-- strict thread matches above, loose matches on Subject: below --
2010-12-16 1:20 y at samsung.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D0ACC40.3060003@samsung.com \
--to=dh09.lee@samsung.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox