U-Boot MMC:env之partitions

一:获取partitions地址

board_init_f:uboot_dev/common/board_f.c

--->env_init:uboot_dev/env/env.c

int env_init(void)
{
	struct env_driver *drv;
	int ret = -ENOENT;
	int prio;

    ... ...

	if (ret == -ENOENT) {
		gd->env_addr = (ulong)&default_environment[0];
		gd->env_valid = ENV_VALID;

		return 0;
	}

	return ret;
}

env地址取自default_environment:uboot_dev/include/env_default.h

const char default_environment[] = {
#endif
#ifndef CONFIG_USE_DEFAULT_ENV_FILE
#ifdef	CONFIG_ENV_CALLBACK_LIST_DEFAULT
	ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0"
#endif
#ifdef	CONFIG_ENV_FLAGS_LIST_DEFAULT
	ENV_FLAGS_VAR "=" CONFIG_ENV_FLAGS_LIST_DEFAULT "\0"
#endif
#ifdef	CONFIG_USE_BOOTARGS
	"bootargs="	CONF

你可能感兴趣的:(Rockchip,U-Boot,linux)