[U-Boot] uboot env in mmc partition

HI there,
I recently made changes to my system, where I created a new partition on my mmc. (mmcblk0p4)
Then i dd'd a uboot env image into this partition, updated the fw_env.config to point to /dev/mmcblk0p4. At this point, my fw_printenv and fw_setenv work good. So as a next step, I am tried to modify uboot to make it point to my env image in my new partition.
I made below changes to my config header and rebuilt the uboot. On doing printenv from uboot, I dont see the same env that I pushed it from linux, infact I see it as its defined in the config header.
Can some one help ?
/* environment setting for MMC */ #ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_SYS_MMC_ENV_PART 4 #define CONFIG_ENV_OFFSET 0 /* just after the MBR */ #endif

HI there,
Hi Naitik,
I recently made changes to my system, where I created a new partition on
my mmc. (mmcblk0p4)
do you use MMC or eMMC ? I guess eMMC.
Then i dd'd a uboot env image into this partition, updated the fw_env.config to point to /dev/mmcblk0p4. At this point, my fw_printenv and fw_setenv work good. So as a next step, I am tried to modify uboot
to
make it point to my env image in my new partition.
I made below changes to my config header and rebuilt the uboot. On doing
printenv from uboot, I dont see the same env that I pushed it from
linux,
infact I see it as its defined in the config header.
Can some one help ?
/* environment setting for MMC */ #ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_SYS_MMC_ENV_PART 4 #define CONFIG_ENV_OFFSET 0 /* just after the MBR */ #endif
I understand this #defines as following:
CONFIG_SYS_MMC_ENV_DEV says: use mmc-device #0 CONFIG_SYS_MMC_ENV_PART says: use partition #4 i know that u-boot is using the boot-partitions to store the environment, an emmc only has 2 partitions. So #4 is a an illegal paramater
CONFIG_ENV_OFFSET is an absolute address within the device/partition so it is not "just after the MBR", instead the environment is "instead the MBR"
best regards, Hannes

Hi Hannes,
Yes, its an eMMC. If I read your response correctly, #define CONFIG_SYS_MMC_ENV_PART Can only have 2 values, 1 & 2 is that correct ?
Pls also keep in mind that from linux, it works fine, with fw_env.config set to /dev/mmcblk0p4 0 0x10000
From: Hannes Petermaier Hannes.Petermaier@br-automation.com To: "Naitik Amin" Naitik.Amin@ametek.com, Cc: u-boot@lists.denx.de, u-boot-bounces@lists.denx.de Date: 09/01/2014 12:54 AM Subject: Re: [U-Boot] uboot env in mmc partition
HI there,
Hi Naitik,
I recently made changes to my system, where I created a new partition on
my mmc. (mmcblk0p4)
do you use MMC or eMMC ? I guess eMMC.
Then i dd'd a uboot env image into this partition, updated the fw_env.config to point to /dev/mmcblk0p4. At this point, my fw_printenv and fw_setenv work good. So as a next step, I am tried to modify uboot
to
make it point to my env image in my new partition.
I made below changes to my config header and rebuilt the uboot. On doing
printenv from uboot, I dont see the same env that I pushed it from
linux,
infact I see it as its defined in the config header.
Can some one help ?
/* environment setting for MMC */ #ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_SYS_MMC_ENV_PART 4 #define CONFIG_ENV_OFFSET 0 /* just after the MBR */ #endif
I understand this #defines as following:
CONFIG_SYS_MMC_ENV_DEV says: use mmc-device #0 CONFIG_SYS_MMC_ENV_PART says: use partition #4 i know that u-boot is using the boot-partitions to store the environment, an emmc only has 2 partitions. So #4 is a an illegal paramater
CONFIG_ENV_OFFSET is an absolute address within the device/partition so it
is not "just after the MBR", instead the environment is "instead the MBR"
best regards, Hannes

Hi Hannes,
Hi,
Yes, its an eMMC. If I read your response correctly, #define CONFIG_SYS_MMC_ENV_PART Can only have 2 values, 1 & 2 is that correct ?
yes - i think so. please have a look to env_mmc.c, lines 65 to 120 may be the most interesting for you. There are only low-level operations performed, nobody doesn't care about any filesystem or "filesystems-partitiontable" at this time.
Pls also keep in mind that from linux, it works fine, with fw_env.config set to /dev/mmcblk0p4 0 0x10000
i think this environment is its own instance and has no interaction with u-boot`s one, is that so? In fact this environment is within "User-Area" of eMMC and at the place were part #4 starts.
best regards, hannes
From: Hannes Petermaier Hannes.Petermaier@br-automation.com To: "Naitik Amin" Naitik.Amin@ametek.com, Cc: u-boot@lists.denx.de, u-boot-bounces@lists.denx.de Date: 09/01/2014 12:54 AM Subject: Re: [U-Boot] uboot env in mmc partition
HI there,
Hi Naitik,
I recently made changes to my system, where I created a new partition
on
my mmc. (mmcblk0p4)
do you use MMC or eMMC ? I guess eMMC.
Then i dd'd a uboot env image into this partition, updated the fw_env.config to point to /dev/mmcblk0p4. At this point, my
fw_printenv
and fw_setenv work good. So as a next step, I am tried to modify uboot
to
make it point to my env image in my new partition.
I made below changes to my config header and rebuilt the uboot. On
doing
printenv from uboot, I dont see the same env that I pushed it from
linux,
infact I see it as its defined in the config header.
Can some one help ?
/* environment setting for MMC */ #ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_SYS_MMC_ENV_PART 4 #define CONFIG_ENV_OFFSET 0 /* just after the MBR
*/
#endif
I understand this #defines as following:
CONFIG_SYS_MMC_ENV_DEV says: use mmc-device #0 CONFIG_SYS_MMC_ENV_PART says: use partition #4 i know that u-boot is using the boot-partitions to store the
environment,
an emmc only has 2 partitions. So #4 is a an illegal paramater
CONFIG_ENV_OFFSET is an absolute address within the device/partition so
it
is not "just after the MBR", instead the environment is "instead the
MBR"
best regards, Hannes

Hi Hannes,
So I did as you had indicated and made some progress, so now, my #defines look as below. #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 0x21900000
I calculated the env offset from the block number it was on based on the first block number of the partition.
Doing this on uboot startup, I dont get the warning saying, using default environment. Neither it complained abt crc error. So it liked it seems. But what it did is it trashed the partition which had my dtb and zImage. Its a completely different partition. So after that, the bootup gets halted. Any ideas ? What may have trashed the partition ?
From: Hannes Petermaier Hannes.Petermaier@br-automation.com To: "Naitik Amin" Naitik.Amin@ametek.com, Cc: u-boot@lists.denx.de, u-boot-bounces@lists.denx.de Date: 09/03/2014 01:13 AM Subject: Re: [U-Boot] uboot env in mmc partition
Hi Hannes,
Hi,
Yes, its an eMMC. If I read your response correctly, #define CONFIG_SYS_MMC_ENV_PART Can only have 2 values, 1 & 2 is that correct ?
yes - i think so. please have a look to env_mmc.c, lines 65 to 120 may be the most interesting for you. There are only low-level operations performed, nobody doesn't care about any filesystem or "filesystems-partitiontable" at this time.
Pls also keep in mind that from linux, it works fine, with fw_env.config set to /dev/mmcblk0p4 0 0x10000
i think this environment is its own instance and has no interaction with u-boot`s one, is that so? In fact this environment is within "User-Area" of eMMC and at the place were part #4 starts.
best regards, hannes
From: Hannes Petermaier Hannes.Petermaier@br-automation.com To: "Naitik Amin" Naitik.Amin@ametek.com, Cc: u-boot@lists.denx.de, u-boot-bounces@lists.denx.de Date: 09/01/2014 12:54 AM Subject: Re: [U-Boot] uboot env in mmc partition
HI there,
Hi Naitik,
I recently made changes to my system, where I created a new partition
on
my mmc. (mmcblk0p4)
do you use MMC or eMMC ? I guess eMMC.
Then i dd'd a uboot env image into this partition, updated the fw_env.config to point to /dev/mmcblk0p4. At this point, my
fw_printenv
and fw_setenv work good. So as a next step, I am tried to modify uboot
to
make it point to my env image in my new partition.
I made below changes to my config header and rebuilt the uboot. On
doing
printenv from uboot, I dont see the same env that I pushed it from
linux,
infact I see it as its defined in the config header.
Can some one help ?
/* environment setting for MMC */ #ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_SYS_MMC_ENV_PART 4 #define CONFIG_ENV_OFFSET 0 /* just after the MBR
*/
#endif
I understand this #defines as following:
CONFIG_SYS_MMC_ENV_DEV says: use mmc-device #0 CONFIG_SYS_MMC_ENV_PART says: use partition #4 i know that u-boot is using the boot-partitions to store the
environment,
an emmc only has 2 partitions. So #4 is a an illegal paramater
CONFIG_ENV_OFFSET is an absolute address within the device/partition so
it
is not "just after the MBR", instead the environment is "instead the
MBR"
best regards, Hannes

Hi Hannes,
Hi,
So I did as you had indicated and made some progress, so now, my
#defines lookas below.
#define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 0x21900000
okay, since we don't have a 'CONFIG_SYS_MMC_ENV_PART' no partition switch within eMMC is performed. So U-Boot reads/writes from Address 0x21900000 within the user-area of eMMC.
Can you supply your partition-layout ?
I calculated the env offset from the block number it was on based on the
first
block number of the partition.
Offset = block# * 512, okay ?
Doing this on uboot startup, I dontget the warning saying, using default
environment. Neither it complained abt crc error. So it liked it seems.
But
what it did is it trashed the partition which had my dtb and zImage. Its
a
completely different partition. So after that, the bootup gets halted.
Any
ideas ? What may have trashed the partition ?
Maybe the blockaddress of 0x21900000 (1099776 dec) is within the partition where zImage/dtb is stored. Please double-check the CONFIG_ENV_OFFSET address.
best regards, hannes

On 09/03/2014 07:54 AM, Naitik Amin wrote:
Hi Hannes,
So I did as you had indicated and made some progress, so now, my #defines look as below. #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 0x21900000
I calculated the env offset from the block number it was on based on the first block number of the partition.
Doing this on uboot startup, I dont get the warning saying, using default environment. Neither it complained abt crc error. So it liked it seems. But what it did is it trashed the partition which had my dtb and zImage. Its a completely different partition. So after that, the bootup gets halted. Any ideas ? What may have trashed the partition ?
Look at: http://www.mail-archive.com/u-boot@lists.denx.de/msg146396.html
and see if that's relevant, specifically the second patch which restores the mmc device offset calculations to the values that correspond to the partition number that's represented in the device structure.
Peter
From: Hannes Petermaier Hannes.Petermaier@br-automation.com To: "Naitik Amin" Naitik.Amin@ametek.com, Cc: u-boot@lists.denx.de, u-boot-bounces@lists.denx.de Date: 09/03/2014 01:13 AM Subject: Re: [U-Boot] uboot env in mmc partition
Hi Hannes,
Hi,
Yes, its an eMMC. If I read your response correctly, #define CONFIG_SYS_MMC_ENV_PART Can only have 2 values, 1 & 2 is that correct ?
yes - i think so. please have a look to env_mmc.c, lines 65 to 120 may be the most interesting for you. There are only low-level operations performed, nobody doesn't care about any filesystem or "filesystems-partitiontable" at this time.
Pls also keep in mind that from linux, it works fine, with fw_env.config set to /dev/mmcblk0p4 0 0x10000
i think this environment is its own instance and has no interaction with u-boot`s one, is that so? In fact this environment is within "User-Area" of eMMC and at the place were part #4 starts.
best regards, hannes
From: Hannes Petermaier Hannes.Petermaier@br-automation.com To: "Naitik Amin" Naitik.Amin@ametek.com, Cc: u-boot@lists.denx.de, u-boot-bounces@lists.denx.de Date: 09/01/2014 12:54 AM Subject: Re: [U-Boot] uboot env in mmc partition
HI there,
Hi Naitik,
I recently made changes to my system, where I created a new partition
on
my mmc. (mmcblk0p4)
do you use MMC or eMMC ? I guess eMMC.
Then i dd'd a uboot env image into this partition, updated the fw_env.config to point to /dev/mmcblk0p4. At this point, my
fw_printenv
and fw_setenv work good. So as a next step, I am tried to modify uboot
to
make it point to my env image in my new partition.
I made below changes to my config header and rebuilt the uboot. On
doing
printenv from uboot, I dont see the same env that I pushed it from
linux,
infact I see it as its defined in the config header.
Can some one help ?
/* environment setting for MMC */ #ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_SYS_MMC_ENV_PART 4 #define CONFIG_ENV_OFFSET 0 /* just after the MBR
*/
#endif
I understand this #defines as following:
CONFIG_SYS_MMC_ENV_DEV says: use mmc-device #0 CONFIG_SYS_MMC_ENV_PART says: use partition #4 i know that u-boot is using the boot-partitions to store the
environment,
an emmc only has 2 partitions. So #4 is a an illegal paramater
CONFIG_ENV_OFFSET is an absolute address within the device/partition so
it
is not "just after the MBR", instead the environment is "instead the
MBR"
best regards, Hannes
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

On 09/03/2014 07:54 AM, Naitik Amin wrote:
Hi Hannes,
So I did as you had indicated and made some progress, so now, my
#defines
look as below. #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 0x21900000
I calculated the env offset from the block number it was on based on
the
first block number of the partition.
Doing this on uboot startup, I dont get the warning saying, using
default
environment. Neither it complained abt crc error. So it liked it
seems.
But what it did is it trashed the partition which had my dtb and
zImage.
Its a completely different partition. So after that, the bootup gets halted. Any ideas ? What may have trashed the partition ?
Look at: http://www.mail-archive.com/u-boot@lists.denx.de/msg146396.html
and see if that's relevant, specifically the second patch which restores
the mmc device offset calculations to the values that correspond to the partition number that's represented in the device structure.
Peter
Hi Peter, i don't think that your patch has influence on this issue, due to no partition switching is done anymore.
Further i would like to check your patch series, i am not sure if there is everything ok. I will do so tommorow - i am right in thinking that you are using MMC not eMMC ?
best regards, Hannes

On 09/03/2014 09:14 AM, Hannes Petermaier wrote:
On 09/03/2014 07:54 AM, Naitik Amin wrote:
Hi Hannes,
So I did as you had indicated and made some progress, so now, my
#defines
look as below. #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 0x21900000
I calculated the env offset from the block number it was on based on
the
first block number of the partition.
Doing this on uboot startup, I dont get the warning saying, using
default
environment. Neither it complained abt crc error. So it liked it
seems.
But what it did is it trashed the partition which had my dtb and
zImage.
Its a completely different partition. So after that, the bootup gets halted. Any ideas ? What may have trashed the partition ?
Look at: http://www.mail-archive.com/u-boot@lists.denx.de/msg146396.html
and see if that's relevant, specifically the second patch which restores the mmc device offset calculations to the values that correspond to the partition number that's represented in the device structure.
Peter
Hi Peter, i don't think that your patch has influence on this issue, due to no partition switching is done anymore.
That may be the case: I missed most of the previous discussion of this issue. All I know is that if mmc->part_num is 0 when the MMC environment code is entered, then when it leaves the capacity and lba fields of the device are no longer correct. So it'd seemed plausible that if mmc_switch_part were invoked somewhere when looking for an environment partition it could explain an anomaly with subsequent use of the device.
Further i would like to check your patch series, i am not sure if there is everything ok. I will do so tommorow - i am right in thinking that you are using MMC not eMMC ?
There is eMMC on the BeagleBone I'm using, but it's been zeroed and is not used. The problem arises in SPL mode on a uSD card with two partitions neither of which is an environment. For full context see the meta-ti email thread referenced in the cover letter.
Peter

Below is the layout of my partitions.
[root@IM /root]# cat /proc/partitions major minor #blocks name
179 0 3887104 mmcblk0 179 1 20480 mmcblk0p1 179 2 512000 mmcblk0p2 179 3 1024 mmcblk0p3 179 4 64 mmcblk0p4
Further explanation Partition 1: Partition type: 0xB Fat32 (Holds zImage, dtb, rbf, uboot startup script) Partition 2: Partititon type: 0x83 ext3 (Holds rootfs) Partition 3: Partition type: A2 (raw) MBR looks for preloader at the beginning of the A2 partition. (Holds Preloader, followed by uboot) Partition 4: Partition type: A3 (raw) To hold the uboot-env (Newly created)
From: "Peter A. Bigot" pab@pabigot.com To: Hannes Petermaier Hannes.Petermaier@br-automation.com, Cc: u-boot@lists.denx.de, Naitik Amin Naitik.Amin@ametek.com Date: 09/03/2014 10:23 AM Subject: Re: [U-Boot] uboot env in mmc partition
On 09/03/2014 09:14 AM, Hannes Petermaier wrote:
On 09/03/2014 07:54 AM, Naitik Amin wrote:
Hi Hannes,
So I did as you had indicated and made some progress, so now, my
#defines
look as below. #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 0x21900000
I calculated the env offset from the block number it was on based on
the
first block number of the partition.
Doing this on uboot startup, I dont get the warning saying, using
default
environment. Neither it complained abt crc error. So it liked it
seems.
But what it did is it trashed the partition which had my dtb and
zImage.
Its a completely different partition. So after that, the bootup gets halted. Any ideas ? What may have trashed the partition ?
Look at:
http://www.mail-archive.com/u-boot@lists.denx.de/msg146396.html
and see if that's relevant, specifically the second patch which
restores
the mmc device offset calculations to the values that correspond to the partition number that's represented in the device structure.
Peter
Hi Peter, i don't think that your patch has influence on this issue, due to no partition switching is done anymore.
That may be the case: I missed most of the previous discussion of this issue. All I know is that if mmc->part_num is 0 when the MMC environment code is entered, then when it leaves the capacity and lba fields of the device are no longer correct. So it'd seemed plausible that if mmc_switch_part were invoked somewhere when looking for an environment partition it could explain an anomaly with subsequent use of the device.
Further i would like to check your patch series, i am not sure if there
is
everything ok. I will do so tommorow - i am right in thinking that you are using MMC
not
eMMC ?
There is eMMC on the BeagleBone I'm using, but it's been zeroed and is not used. The problem arises in SPL mode on a uSD card with two partitions neither of which is an environment. For full context see the meta-ti email thread referenced in the cover letter.
Peter

Hi Naitik, On Wed, Sep 3, 2014 at 8:08 PM, Naitik Amin Naitik.Amin@ametek.com wrote:
Below is the layout of my partitions.
[root@IM /root]# cat /proc/partitions major minor #blocks name
179 0 3887104 mmcblk0 179 1 20480 mmcblk0p1 179 2 512000 mmcblk0p2 179 3 1024 mmcblk0p3 179 4 64 mmcblk0p4
Further explanation Partition 1: Partition type: 0xB Fat32 (Holds zImage, dtb, rbf, uboot startup script) Partition 2: Partititon type: 0x83 ext3 (Holds rootfs) Partition 3: Partition type: A2 (raw) MBR looks for preloader at the beginning of the A2 partition. (Holds Preloader, followed by uboot) Partition 4: Partition type: A3 (raw) To hold the uboot-env (Newly created)
According to your partition layout, your environment offset must be : (3887104 + 20480 + 512000 + 1024) = 4420608 blocks into the user partition of eMMC.
So, the offset should be 4420608 * 512 = 2263351296 = 0x86E80000
The offset (0x21900000) you are using seems to be in your very first partition i.e. mmcblk0 and hence it is corrupting your dtb and other files.
Best Regards, Sachin Verma.

Hi Sachin,
My paritions are not laid out in the same order of 1-4 in memory. The address that computed came from below
[root@IM mmcblk0p4]# ls alignment_offset holders ro stat dev inflight size subsystem discard_alignment partition start uevent [root@IM mmcblk0p4]# cat start 1099776
1099776 * 512 = 0x21900000
From: Sachin Verma simplysachin@gmail.com To: Naitik Amin Naitik.Amin@ametek.com, Cc: "Peter A. Bigot" pab@pabigot.com, u-boot@lists.denx.de, Hannes Petermaier Hannes.Petermaier@br-automation.com Date: 09/03/2014 11:54 AM Subject: Re: [U-Boot] uboot env in mmc partition
Hi Naitik, On Wed, Sep 3, 2014 at 8:08 PM, Naitik Amin Naitik.Amin@ametek.com wrote: Below is the layout of my partitions.
[root@IM /root]# cat /proc/partitions major minor #blocks name
179 0 3887104 mmcblk0 179 1 20480 mmcblk0p1 179 2 512000 mmcblk0p2 179 3 1024 mmcblk0p3 179 4 64 mmcblk0p4
Further explanation Partition 1: Partition type: 0xB Fat32 (Holds zImage, dtb, rbf, uboot startup script) Partition 2: Partititon type: 0x83 ext3 (Holds rootfs) Partition 3: Partition type: A2 (raw) MBR looks for preloader at the beginning of the A2 partition. (Holds Preloader, followed by uboot) Partition 4: Partition type: A3 (raw) To hold the uboot-env (Newly created)
According to your partition layout, your environment offset must be : (3887104 + 20480 + 512000 + 1024) = 4420608 blocks into the user partition of eMMC.
So, the offset should be 4420608 * 512 = 2263351296 = 0x86E80000
The offset (0x21900000) you are using seems to be in your very first partition i.e. mmcblk0 and hence it is corrupting your dtb and other files.
Best Regards, Sachin Verma.

More info..
Below is what I see on bootup.
My env is at 0x100000 from base of sd card. It seems something happened on the hash insert.
>>>>>>> Boot Log >>>>>>>>>>>>>
U-Boot SPL 2013.01.01 (May 02 2014 - 11:49:21) BOARD : Altera SOCFPGA Cyclone V Board SDRAM: Initializing MMR registers SDRAM: Calibrating PHY SEQ.C: Preparing to start memory calibration SEQ.C: CALIBRATION PASSED ALTERA DWMMC: 0
U-Boot 2013.01.01 (Sep 03 2014 - 15:12:29)
CPU : Altera SOCFPGA Platform BOARD : Altera SOCFPGA Cyclone V Board DRAM: 512 MiB MMC: ALTERA DWMMC: 0 env offset 1048576 CRC from Header 0x6cf572d5 Computed CRC 0x6cf572d5 " (type: m)lags type check failure for "ethaddr" <= "04:25:fe:ed:00:18 " into hash tableinsert "ethaddr=04:25:fe:ed:00:18 " (type: m)lags type check failure for "ethaddr" <= "00:b0:19:00:01:02 " into hash tableinsert "ethaddr=00:b0:19:00:01:02 In: serial Out: serial Err: serial Net: mii0 Warning: failed to set MAC address
Hit any key to stop autoboot: 0 reading u-boot.scr **Unable to read file u-boot.scr Optional boot script not found. Continuing to boot normally ' - try 'help'd ' ' - try 'help'd 'fatload ' - try 'help'd 'fatload " not definedcboot
From: Hannes Petermaier Hannes.Petermaier@br-automation.com To: "Peter A. Bigot" pab@pabigot.com, Cc: u-boot@lists.denx.de, Naitik Amin Naitik.Amin@ametek.com Date: 09/03/2014 10:14 AM Subject: Re: [U-Boot] uboot env in mmc partition
On 09/03/2014 07:54 AM, Naitik Amin wrote:
Hi Hannes,
So I did as you had indicated and made some progress, so now, my
#defines
look as below. #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 0x21900000
I calculated the env offset from the block number it was on based on
the
first block number of the partition.
Doing this on uboot startup, I dont get the warning saying, using
default
environment. Neither it complained abt crc error. So it liked it
seems.
But what it did is it trashed the partition which had my dtb and
zImage.
Its a completely different partition. So after that, the bootup gets halted. Any ideas ? What may have trashed the partition ?
Look at: http://www.mail-archive.com/u-boot@lists.denx.de/msg146396.html
and see if that's relevant, specifically the second patch which restores
the mmc device offset calculations to the values that correspond to the partition number that's represented in the device structure.
Peter
Hi Peter, i don't think that your patch has influence on this issue, due to no partition switching is done anymore.
Further i would like to check your patch series, i am not sure if there is
everything ok. I will do so tommorow - i am right in thinking that you are using MMC not eMMC ?
best regards, Hannes
participants (4)
-
Hannes Petermaier
-
Naitik Amin
-
Peter A. Bigot
-
Sachin Verma