could not update u-boot command line via mfgtool

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

could not update u-boot command line via mfgtool

Jump to solution
2,935 Views
wangtsungli
Contributor IV

Hi community,

I'm working on i.MX6 Quad sabre-SD platform and build Android 6 for my image.

Now I have faced strange phenomenon.

Here is the situation.

I update my image via mfgtool.

And below is my u-boot burning part in ucl2.xml.

<!-- burn uboot -->
<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=768 conv=fsync count=512">clear u-boot arg</CMD>
<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
<CMD state="Updater" type="push" body="send" file="files/android/%folder%/u-boot-imx%soc%%ldo%.imx" >Sending u-boot.bin</CMD>
<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2 ">write U-Boot to sd card</CMD>
<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>

After burning image, mfgtool would show green bar to be success.

So I booting my machine and get into u-boot environment console to check whether u-boot command line has been changed correctly or not.

But I find out that u-boot command line did not change to latest version.

But the time did update like below picture

pastedImage_6.png

If picture is too small, could see original picture attached below.

In the red block shows time that your u-boot updated.

And blue block shows my u-boot command line.

Red block did update time so I assume that my u-boot burned the image well.

But Blue block did not change to what I set in my source code.

How can I fix this problem?

How can I change my u-boot command line?

Thanks in Advanced!

Labels (5)
1 Solution
2,597 Views
ravitejalaggysh
Contributor II

Hi tsung,

There is some mistake under ucl2.xml ( present under mfgtool-c72a398-p1\Profiles\Linux\OS Firmware) of mfg-tool.

It incorrectly tries to erase the uboot arguments at some other offset.

<!-- burn uboot -->
<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=768 conv=fsync count=512">clear u-boot arg</CMD>

Here value 768 is incorrect, please refer to the board header file and correct it.

It would be something like this

#ifndef __IMX6QLD_ICORE_CONFIG_H
#define __IMX6QLD_ICORE_CONFIG_H

#include <linux/sizes.h>
#include "mx6_common.h"

/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN    (16 * SZ_1M)

/* Total Size of Environment Sector */
#define CONFIG_ENV_SIZE       SZ_128K

/* Allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE

/* Environment */
#ifndef CONFIG_ENV_IS_NOWHERE
/* Environment in MMC */
# if defined(CONFIG_ENV_IS_IN_MMC)
#  define CONFIG_ENV_OFFSET      0x100000
/* Environment in NAND */
# elif defined(CONFIG_ENV_IS_IN_NAND)
#  define CONFIG_ENV_OFFSET      0x400000
#  define CONFIG_ENV_SECT_SIZE      CONFIG_ENV_SIZE
# endif
#endif

CONFIG_ENV_OFFSET here is 0x100000, so you should erase by using seek=1024

0x100000 = 1048576 (byes in decimal) / 1024 (1k block size) = 1024

so you should you seek by 1024 blocks and CONFIG_ENV_SIZE is 128k ,so count should be 128

finally your command should be

<!-- burn uboot -->
<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=1024 conv=fsync count=128">clear u-boot arg</CMD>

Similarly add a command to erase the memory region used for extended uboot arguments.

Had a similar issue, I tried this for some custom board and it worked.

Thanks,

Raviteja

View solution in original post

6 Replies
2,597 Views
igorpadykov
NXP Employee
NXP Employee

Hi tsung

one can try to change bootargs in uboot/include/configs/mx6sabre_common.h

mx6sabre_common.h\configs\include - uboot-imx - i.MX U-Boot 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,597 Views
wangtsungli
Contributor IV

Hi igorpadykov

Is there any other way to solve my problem?

0 Kudos
Reply
2,598 Views
ravitejalaggysh
Contributor II

Hi tsung,

There is some mistake under ucl2.xml ( present under mfgtool-c72a398-p1\Profiles\Linux\OS Firmware) of mfg-tool.

It incorrectly tries to erase the uboot arguments at some other offset.

<!-- burn uboot -->
<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=768 conv=fsync count=512">clear u-boot arg</CMD>

Here value 768 is incorrect, please refer to the board header file and correct it.

It would be something like this

#ifndef __IMX6QLD_ICORE_CONFIG_H
#define __IMX6QLD_ICORE_CONFIG_H

#include <linux/sizes.h>
#include "mx6_common.h"

/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN    (16 * SZ_1M)

/* Total Size of Environment Sector */
#define CONFIG_ENV_SIZE       SZ_128K

/* Allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE

/* Environment */
#ifndef CONFIG_ENV_IS_NOWHERE
/* Environment in MMC */
# if defined(CONFIG_ENV_IS_IN_MMC)
#  define CONFIG_ENV_OFFSET      0x100000
/* Environment in NAND */
# elif defined(CONFIG_ENV_IS_IN_NAND)
#  define CONFIG_ENV_OFFSET      0x400000
#  define CONFIG_ENV_SECT_SIZE      CONFIG_ENV_SIZE
# endif
#endif

CONFIG_ENV_OFFSET here is 0x100000, so you should erase by using seek=1024

0x100000 = 1048576 (byes in decimal) / 1024 (1k block size) = 1024

so you should you seek by 1024 blocks and CONFIG_ENV_SIZE is 128k ,so count should be 128

finally your command should be

<!-- burn uboot -->
<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=1024 conv=fsync count=128">clear u-boot arg</CMD>

Similarly add a command to erase the memory region used for extended uboot arguments.

Had a similar issue, I tried this for some custom board and it worked.

Thanks,

Raviteja

2,597 Views
wangtsungli
Contributor IV

Thanks for your reply.

Your answer solves my problem.

0 Kudos
Reply
2,597 Views
igorpadykov
NXP Employee
NXP Employee

nxp has special support service which may be helpful in resolving customer

specific cases:

NXP Professional Services|NXP 

Best regards
igor

0 Kudos
Reply
2,597 Views
wangtsungli
Contributor IV

Hi igorpadykov

Thanks for your reply.

I had changed the u-boot command line in uboot/include/configs/mx6sabreandroid_common.h

Below is what I add.

#if defined(CONFIG_FX_SELINUX)

#if defined(FX_DUAL_DISPLAY)
#define BOOT_ENV_VIDEO "bootargs= console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=FX100 cma=384M androidboot.selinux=enforcing androidboot.dm_verity=disabled no_console_suspend=1 enable_wait_mode=off \0"
#elif defined(FX_HDMI_DISPLAY)
#define BOOT_ENV_VIDEO "bootargs= console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=FX100 cma=384M androidboot.selinux=enforcing androidboot.dm_verity=disabled no_console_suspend=1 enable_wait_mode=off \0"
#else
#define BOOT_ENV_VIDEO "bootargs= console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=FX100 cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled no_console_suspend=1 enable_wait_mode=off \0"
#endif

#else

#if defined(FX_DUAL_DISPLAY)
#define BOOT_ENV_VIDEO "bootargs= console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=FX100 cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled no_console_suspend=1 enable_wait_mode=off \0"
#elif defined(FX_HDMI_DISPLAY)
#define BOOT_ENV_VIDEO "bootargs= console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=FX100 cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled no_console_suspend=1 enable_wait_mode=off \0"
#else
#define BOOT_ENV_VIDEO "bootargs= console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=FX100 cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled no_console_suspend=1 enable_wait_mode=off \0"
#endif

#endif

#define CONFIG_EXTRA_ENV_SETTINGS \
"splashpos=m,m\0" \
"fdt_high=0xffffffff\0" \
"initrd_high=0xffffffff\0" \
BOOT_ENV_VIDEO \

I tried to add config in my own design make file and set it into BOOT_ENV_VIDEO.

In mx6sabresd_common.h will include mx6sabreandroid_common.h and add define with CONFIG_EXTRA_ENV_SETTING.

But even I set command line here u-boot environment still not change after I update image via mfgtool.

What did miss?

Thanks in Advanced!

0 Kudos
Reply