Skip to contentSkip to conversation

env_ram.c: import env from other boot loader

PATCH New Macpaul Lin 3 participants 3 messages Nov 11, 2011 – Nov 12, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env_ram.c: import env from other boot loader

If the system has dual boot loader, say loader1 and u-boot is loader2. If loader1 will be booted before u-boot and then pass env to u-boot in the format of u-boot's env, this module provides importing env from ram.

This feature needs to add related support in cmd_nvedit.c.

---
 common/Makefile     |    1 +
 common/cmd_nvedit.c |    3 +-
 common/env_ram.c    |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletions(-)
 create mode 100644 common/env_ram.c
common/Makefile +1 -0
index 1b672ad..8e39502 100644
@@ -60,6 +60,7 @@ COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
 COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
 COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
 COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
+COBJS-$(CONFIG_ENV_IS_IN_RAM) += env_ram.o
 COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
 COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
 
common/cmd_nvedit.c +2 -1
index 396a171..5b6c6bc 100644
@@ -64,10 +64,11 @@ DECLARE_GLOBAL_DATA_PTR;
 	!defined(CONFIG_ENV_IS_IN_NAND)		&& \
 	!defined(CONFIG_ENV_IS_IN_NVRAM)	&& \
 	!defined(CONFIG_ENV_IS_IN_ONENAND)	&& \
+	!defined(CONFIG_ENV_IS_IN_RAM)		&& \
 	!defined(CONFIG_ENV_IS_IN_SPI_FLASH)	&& \
 	!defined(CONFIG_ENV_IS_NOWHERE)
 # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
-SPI_FLASH|MG_DISK|NVRAM|MMC} or CONFIG_ENV_IS_NOWHERE
+SPI_FLASH|MG_DISK|NVRAM|MMC|RAM} or CONFIG_ENV_IS_NOWHERE
 #endif
 
 #define XMK_STR(x)	#x
common/env_ram.c new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
1.7.3.5
#1 lore raw

PATCH 1/1 env_ram.c: import env from other boot loader

Dear Macpaul Lin,

Quoted 5 lines · In message <[email protected]> you wrote:

If the system has dual boot loader, say loader1 and u-boot is loader2. If loader1 will be booted before u-boot and then pass env to u-boot in the format of u-boot's env, this module provides importing env from ram.

This feature needs to add related support in cmd_nvedit.c.

I don't think you need extra code for this. The situation is not different from any other where for example the environment is attached to the U-Boot image, or embedded into it. You just need to configure the address / offset correctly in your board config header.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If it ain't broke, don't fix it."                       - Bert Lantz
#2 lore raw

PATCH 1/1 env_ram.c: import env from other boot loader

Hi Wolfgang,

2011/11/11 Wolfgang Denk <[email protected]>:

Quoted 6 lines

Dear Macpaul Lin,

I don't think you need extra code for this. ?The situation is not different from any other where for example the environment is attached to the U-Boot image, or embedded into it. ?You just need to configure the address / offset correctly in your board config header.

Thanks!

I'll check this out next week.

Signature · 2 lines
Best regards,
Macpaul Lin