logo

Question
Morlans
Morlans
Offline
0
Some days ago I've asked for help to modify environment variables (u-boot) from Linux. As a solution, you suggested using uEnv.txt file instead of using fw_printenv & fw_setenv. Finally, I was available to achieve this way, so that was perfect. Now, currently I'm facing with another problem and I'm not sure if it is related to u-boot configuration.

Question: Is it possible to use ubootcountlimit and upgrade_available with am335x beacuse the webpage says that is only available for MPC8xx, MPC82xx and MPC5200 Power Architecture® processors? If the answer is affirmative, is it right the configuration added below on the code? If the answer is negative, can this set up broke the board?
I'm asking that because some modules has broken while I was dealing with this u-boot feature (but I'm not sure if it is related to). As a result the module not even turns on the red led when is connected to the power.

Board configuration: (I'm aware that the partitions size it can be more optimized)




...

/* Make the verbose messages from UBI stop printing */
#define CONFIG_UBI_SILENCE_MSG
#define CONFIG_UBIFS_SILENCE_MSG


/* Reboot after 30 sec if bootcmd fails */

#define CONFIG_RESET_TO_RETRY
#define CONFIG_BOOT_RETRY_TIME 30

#define CONFIG_BOOTCOUNT_LIMIT
#define CONFIG_BOOTCOUNT_ENV



#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG

#ifndef CONFIG_SPL_BUILD
#define CONFIG_EXTRA_ENV_SETTINGS \
	DEFAULT_LINUX_BOOT_ENV \
	"altbootcmd=run" ALT_CONFIG_CMD "\0" \
	"upgrade_available=0\0" \
	"bootlimit=2\0" \ 
	"bootdir=/boot\0" \
	"bootfile=zImage\0" \
	"active_partition=0\0" \
	"dtbfile=undefined\0" \
	"console=ttyO0,115200n8\0" \
	"mmcdev=0\0" \
	"mmcroot=/dev/mmcblk0p2 rw\0" \
	"mmcrootfstype=ext4 rootwait\0" \
	"mmcargs=setenv bootargs console=${console} " \
		"${optargs} " \
		"root=${mmcroot} " \
		"rootfstype=${mmcrootfstype}\0" \
		"bootenv=uEnv.txt\0" \
	"loadenv=echo Importing enviroment from Nand ubifs partition ${bootenv} bootcount ${bootcount};" \
		"ubi part uEnv.txt 512; ubifsmount ubi0; " \
		"ubifsload ${loadaddr} ${bootenv}; " \
		"echo before active_partition ${active_partition} loadaddr ${loadaddr} filesize ${filesize};" \
		"env import -t ${loadaddr} ${filesize}; " \
		"echo after active_partition ${active_partition};" \
		"ubifsumount;\0" \[/b]

        ... 

	"altfindpart=" \
		"if test $active_partition = 0; then " \
			"setenv nandload $nandload_b; " \
			"setenv nandroot $nandroot_b; " \
		"else if test $active_partition = 1; then " \
				"setenv nandload $nandload_a; " \
				"setenv nandroot $nandroot_a; " \
			"else echo SPEC: default value; "\
				"setenv nandload $nandload_a; " \
				"setenv nandroot $nandroot_a; " \
				fi;" \
		"fi;" \
	"findpart="\
		"if test $active_partition = 0; then " \
			"setenv nandload $nandload_a; " \
			"setenv nandroot $nandroot_a; " \
		"else if test $active_partition = 1; then " \
				"setenv nandload $nandload_b; " \
				"setenv nandroot $nandroot_b; " \
			"else "setenv nandload $nandload_a; " \
				"setenv nandroot $nandroot_a; " \
			fi;" \
		"fi;" \
	"mtdids=" MTDIDS_DEFAULT "\0" \
	"mtdparts=" MTDPARTS_DEFAULT "\0" \
	"nandroot_a=ubi0:FilesystemI rw ubi.mtd=3,512\0 " \
	"nandroot_b=ubi0:FilesystemII rw ubi.mtd=4,512\0 " \
	"nandload_a=ubi part FilesystemI 512; ubifsmount ubi0; " \
		"ubifsload ${loadaddr} ${bootdir}/${bootfile}; " \
		"ubifsload ${fdtaddr} ${bootdir}/${dtbfile} \0" \
	"nandload_b=ubi part FilesystemII 512; ubifsmount ubi0; " \
		"ubifsload ${loadaddr} ${bootdir}/${bootfile}; " \
		"ubifsload ${fdtaddr} ${bootdir}/${dtbfile} \0" \
	"nandrootfstype=ubifs rootwait\0" \
	"nandargs=setenv bootargs console=${console} " \
		"${optargs} " \
		"root=${nandroot} " \
		"rootfstype=${nandrootfstype} \0" \
		"bootenv=uEnv.txt\0" \
	"nandboot=echo Booting from nand ... bootcount ${bootcount}; " \
		"run nandargs; " \
		"run nandload; " \
		"bootz ${loadaddr} - ${fdtaddr} \0"
#endif

#define CONFIG_BOOTCOMMAND \
	"run loadenv;" \
	"run findfdt;" \
	"run findpart;" \
	"run mmcboot;" \
	"run nandboot;"
	
#define ALT_CONFIG_CMD \
	"run loadenv;" \
	"run findfdt;" \
	"run altfindpart;" \
	"run mmcboot;" \
	"run nandboot;"

... 

/* NAND support */

 ...

#define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
#define MTDPARTS_DEFAULT		"mtdparts=omap2-nand.0:512k(spl),"\
								"1m(uboot),256k(environment),"\
								"10496k(uEnv.txt),"\
								"59392k(FilesystemI),"\
								"59392k(FilesystemII)"






uEnv.txt: (values can change depending on the context)

 
active_partition=0
upgrade_available=0 




Thanks for your replay,
Responses (1)
  • Accepted Answer

    Friday, June 02 2017, 09:33 AM - #permalink
    0
    Hi Morlans,

    Question: Is it possible to use ubootcountlimit and upgrade_available with am335x beacuse the webpage says that is only available for MPC8xx, MPC82xx and MPC5200 Power Architecture® processors? If the answer is affirmative, is it right the configuration added below on the code? If the answer is negative, can this set up broke the board?

    Main U-boot documentation seems outdated, I found out a patch that adds support for ubootcountlimit to am335x board. See:
    http://git.denx.de/?p=u-boot.git;a=commitdiff;h=56eb3da43fab5990a4b7bc118b76c7cae2ceb140

    I'm asking that because some modules has broken while I was dealing with this u-boot feature (but I'm not sure if it is related to). As a result the module not even turns on the red led when is connected to the power.

    Which boot mode do you use to boot up IGEP COM AQUILA AM335x? Maybe NAND first partition is corrupt and you will need to reflash bootloader again.

    Cheers!
    The reply is currently minimized Show
Your Reply

SUPPORT


This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
IGEP Community Wiki
IGEP Community Forum
IGEP Community Online Chat