From 0d92d4a699fb1a39381d98571dc51fb97e5bcf9e Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 30 Aug 2008 23:29:57 +0200 Subject: cmd_vfd: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/cmd_vfd.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 8d4a426..3547766 100644 --- a/common/Makefile +++ b/common/Makefile @@ -144,7 +144,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o endif COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o -COBJS-y += cmd_vfd.o +COBJS-$(CONFIG_VFD) += cmd_vfd.o COBJS-$(CONFIG_CMD_DOC) += docecc.o COBJS-y += flash.o COBJS-y += kgdb.o diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index 104c310..45f4271 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -75,7 +75,6 @@ U_BOOT_CMD( ); #endif -#ifdef CONFIG_VFD int trab_vfd (ulong bitmap) { uchar *addr; @@ -103,4 +102,3 @@ int trab_vfd (ulong bitmap) transfer_pic(3, addr, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH); return 0; } -#endif /* CONFIG_VFD */ -- cgit v1.1 From 2d02d91d530e831f2dab228085963fc1d5b71cb0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 30 Aug 2008 23:47:38 +0200 Subject: common/Makefile: add core command section Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 3547766..1d8ec87 100644 --- a/common/Makefile +++ b/common/Makefile @@ -42,6 +42,11 @@ COBJS-y += s_record.o COBJS-y += serial.o COBJS-y += xyzModem.o +#core command +COBJS-y += cmd_boot.o +COBJS-y += cmd_bootm.o +COBJS-y += cmd_nvedit.o + # environment COBJS-y += environment.o COBJS-y += env_common.o @@ -61,9 +66,7 @@ COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o -COBJS-y += cmd_boot.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o -COBJS-y += cmd_bootm.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o @@ -119,7 +122,6 @@ COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o COBJS-$(CONFIG_MP) += cmd_mp.o COBJS-y += cmd_nand.o COBJS-$(CONFIG_CMD_NET) += cmd_net.o -COBJS-y += cmd_nvedit.o COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o ifdef CONFIG_PCI -- cgit v1.1 From e5648acab153f0f429bfc714902c5aaa7879f71b Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 30 Aug 2008 23:47:41 +0200 Subject: cmd_fdc: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/cmd_fdc.c | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 1d8ec87..e9f75f4 100644 --- a/common/Makefile +++ b/common/Makefile @@ -84,7 +84,7 @@ COBJS-y += cmd_eeprom.o COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o -COBJS-y += cmd_fdc.o +COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c index 8493def..b663d60 100644 --- a/common/cmd_fdc.c +++ b/common/cmd_fdc.c @@ -50,8 +50,6 @@ /*#include */ /*#endif */ -#if defined(CONFIG_CMD_FDC) || defined(CONFIG_CMD_FDOS) - typedef struct { int flags; /* connected drives ect */ unsigned long blnr; /* Logical block nr */ @@ -705,7 +703,6 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) return TRUE; } -#endif #if defined(CONFIG_CMD_FDOS) @@ -903,15 +900,6 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return rcode; } - -#endif - - -/***************************************************/ - - -#if defined(CONFIG_CMD_FDC) - U_BOOT_CMD( fdcboot, 3, 1, do_fdcboot, "fdcboot - boot from floppy device\n", -- cgit v1.1 From 32628c5008105a732212003d83b75f05e5243bb2 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 30 Aug 2008 23:54:58 +0200 Subject: cmd_mac: Move conditional compilation to Makefile finish remaning CFG_ID_EEPROM in CONFIG_ID_EEPROM start in commit ad8f8687b78c3e917b173f038926695383c55555 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/cmd_mac.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index e9f75f4..a9a02b2 100644 --- a/common/Makefile +++ b/common/Makefile @@ -111,7 +111,7 @@ COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o COBJS-y += cmd_load.o COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o -COBJS-y += cmd_mac.o +COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o COBJS-y += cmd_mem.o COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o COBJS-$(CONFIG_MII) += miiphyutil.o diff --git a/common/cmd_mac.c b/common/cmd_mac.c index faed8f7..4453299 100644 --- a/common/cmd_mac.c +++ b/common/cmd_mac.c @@ -24,8 +24,6 @@ #include #include -#ifdef CFG_ID_EEPROM - extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( @@ -63,4 +61,3 @@ U_BOOT_CMD( "mac 7\n" " - program the MAC address for port 7\n" ); -#endif /* CFG_ID_EEPROM */ -- cgit v1.1 From bb1f8b4f8bb0bfce52e0faa4637b975b745824b3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 5 Sep 2008 09:19:30 +0200 Subject: rename CFG_ENV_IS_IN_EEPROM in CONFIG_ENV_IS_IN_EEPROM Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_eeprom.c | 4 ++-- common/cmd_nvedit.c | 6 +++--- common/env_eeprom.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index e5000e9..5034b5e 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -42,7 +42,7 @@ #include #include -#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) +#if defined(CONFIG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) extern void eeprom_init (void); extern int eeprom_read (unsigned dev_addr, unsigned offset, @@ -121,7 +121,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * 0x00000nxx for EEPROM address selectors and page number at n. */ -#if defined(CFG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) +#if defined(CONFIG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) #ifndef CONFIG_SPI #if !defined(CFG_I2C_EEPROM_ADDR_LEN) || CFG_I2C_EEPROM_ADDR_LEN < 1 || CFG_I2C_EEPROM_ADDR_LEN > 2 diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 7089706..8b6b46b 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -53,7 +53,7 @@ DECLARE_GLOBAL_DATA_PTR; #if !defined(CFG_ENV_IS_IN_NVRAM) && \ - !defined(CFG_ENV_IS_IN_EEPROM) && \ + !defined(CONFIG_ENV_IS_IN_EEPROM) && \ !defined(CFG_ENV_IS_IN_FLASH) && \ !defined(CFG_ENV_IS_IN_DATAFLASH) && \ !defined(CFG_ENV_IS_IN_NAND) && \ @@ -540,7 +540,7 @@ int getenv_r (char *name, char *buf, unsigned len) return (-1); } -#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \ +#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \ @@ -596,7 +596,7 @@ U_BOOT_CMD( " - delete environment variable 'name'\n" ); -#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \ +#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \ diff --git a/common/env_eeprom.c b/common/env_eeprom.c index 9e1a201..1a03f43 100644 --- a/common/env_eeprom.c +++ b/common/env_eeprom.c @@ -26,7 +26,7 @@ #include -#if defined(CFG_ENV_IS_IN_EEPROM) /* Environment is in EEPROM */ +#if defined(CONFIG_ENV_IS_IN_EEPROM) /* Environment is in EEPROM */ #include #include @@ -107,4 +107,4 @@ int env_init(void) return (0); } -#endif /* CFG_ENV_IS_IN_EEPROM */ +#endif /* CONFIG_ENV_IS_IN_EEPROM */ -- cgit v1.1 From bf5a7710ec70e90e98f451b4ba0eb65f9ffc34eb Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 5 Sep 2008 09:19:54 +0200 Subject: env_eeprom: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_eeprom.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index a9a02b2..9001237 100644 --- a/common/Makefile +++ b/common/Makefile @@ -51,7 +51,7 @@ COBJS-y += cmd_nvedit.o COBJS-y += environment.o COBJS-y += env_common.o COBJS-y += env_dataflash.o -COBJS-y += env_eeprom.o +COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o COBJS-y += env_flash.o COBJS-y += env_nand.o COBJS-y += env_nvram.o diff --git a/common/env_eeprom.c b/common/env_eeprom.c index 1a03f43..df3e31e 100644 --- a/common/env_eeprom.c +++ b/common/env_eeprom.c @@ -25,9 +25,6 @@ */ #include - -#if defined(CONFIG_ENV_IS_IN_EEPROM) /* Environment is in EEPROM */ - #include #include #include @@ -106,5 +103,3 @@ int env_init(void) return (0); } - -#endif /* CONFIG_ENV_IS_IN_EEPROM */ -- cgit v1.1 From d1034bc8db60fa6bd419328baf6a75cb0645cee8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:52 +0200 Subject: cmd_eeprom: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 3 ++- common/cmd_eeprom.c | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 9001237..fea0caf 100644 --- a/common/Makefile +++ b/common/Makefile @@ -80,7 +80,8 @@ endif COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o COBJS-$(CONFIG_CMD_DOC) += cmd_doc.o COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o -COBJS-y += cmd_eeprom.o +COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o +COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index 5034b5e..44d44fe 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -42,8 +42,6 @@ #include #include -#if defined(CONFIG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) - extern void eeprom_init (void); extern int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); @@ -52,7 +50,6 @@ extern int eeprom_write (unsigned dev_addr, unsigned offset, #if defined(CFG_EEPROM_WREN) extern int eeprom_write_enable (unsigned dev_addr, int state); #endif -#endif #if defined(CFG_EEPROM_X40430) @@ -121,8 +118,6 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * 0x00000nxx for EEPROM address selectors and page number at n. */ -#if defined(CONFIG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM) - #ifndef CONFIG_SPI #if !defined(CFG_I2C_EEPROM_ADDR_LEN) || CFG_I2C_EEPROM_ADDR_LEN < 1 || CFG_I2C_EEPROM_ADDR_LEN > 2 #error CFG_I2C_EEPROM_ADDR_LEN must be 1 or 2 @@ -422,7 +417,6 @@ void eeprom_init (void) } /*----------------------------------------------------------------------- */ -#endif /***************************************************/ -- cgit v1.1 From 057c849c45b9ee19df8ff3acdeee66be52819962 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:58 +0200 Subject: rename CFG_ENV_IS_IN_DATAFLASH in CONFIG_ENV_IS_IN_DATAFLASH Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 2 +- common/env_dataflash.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 8b6b46b..f3d8408 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -55,7 +55,7 @@ DECLARE_GLOBAL_DATA_PTR; #if !defined(CFG_ENV_IS_IN_NVRAM) && \ !defined(CONFIG_ENV_IS_IN_EEPROM) && \ !defined(CFG_ENV_IS_IN_FLASH) && \ - !defined(CFG_ENV_IS_IN_DATAFLASH) && \ + !defined(CONFIG_ENV_IS_IN_DATAFLASH) && \ !defined(CFG_ENV_IS_IN_NAND) && \ !defined(CFG_ENV_IS_IN_ONENAND) && \ !defined(CFG_ENV_IS_IN_SPI_FLASH) && \ diff --git a/common/env_dataflash.c b/common/env_dataflash.c index 2945364..1d55a27 100644 --- a/common/env_dataflash.c +++ b/common/env_dataflash.c @@ -19,7 +19,7 @@ */ #include -#if defined(CFG_ENV_IS_IN_DATAFLASH) /* Environment is in DataFlash */ +#if defined(CONFIG_ENV_IS_IN_DATAFLASH) /* Environment is in DataFlash */ #include #include @@ -101,4 +101,4 @@ int env_init(void) return (0); } -#endif /* CFG_ENV_IS_IN_DATAFLASH */ +#endif /* CONFIG_ENV_IS_IN_DATAFLASH */ -- cgit v1.1 From d8cc04d0ac9c7c0d12454708aaf5489f8532bbf9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:58 +0200 Subject: env_dataflash: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_dataflash.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index fea0caf..27f515b 100644 --- a/common/Makefile +++ b/common/Makefile @@ -50,7 +50,7 @@ COBJS-y += cmd_nvedit.o # environment COBJS-y += environment.o COBJS-y += env_common.o -COBJS-y += env_dataflash.o +COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o COBJS-y += env_flash.o COBJS-y += env_nand.o diff --git a/common/env_dataflash.c b/common/env_dataflash.c index 1d55a27..2254b9b 100644 --- a/common/env_dataflash.c +++ b/common/env_dataflash.c @@ -18,9 +18,6 @@ * */ #include - -#if defined(CONFIG_ENV_IS_IN_DATAFLASH) /* Environment is in DataFlash */ - #include #include #include @@ -100,5 +97,3 @@ int env_init(void) return (0); } - -#endif /* CONFIG_ENV_IS_IN_DATAFLASH */ -- cgit v1.1 From 51bfee192099206a4397f15f3b93516e01f58ab0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:58 +0200 Subject: rename CFG_ENV_IS_IN_NAND in CONFIG_ENV_IS_IN_NAND Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 2 +- common/env_common.c | 2 +- common/env_nand.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index f3d8408..dc6d13a 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -56,7 +56,7 @@ DECLARE_GLOBAL_DATA_PTR; !defined(CONFIG_ENV_IS_IN_EEPROM) && \ !defined(CFG_ENV_IS_IN_FLASH) && \ !defined(CONFIG_ENV_IS_IN_DATAFLASH) && \ - !defined(CFG_ENV_IS_IN_NAND) && \ + !defined(CONFIG_ENV_IS_IN_NAND) && \ !defined(CFG_ENV_IS_IN_ONENAND) && \ !defined(CFG_ENV_IS_IN_SPI_FLASH) && \ !defined(CFG_ENV_IS_NOWHERE) diff --git a/common/env_common.c b/common/env_common.c index d51c211..e89f192 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -133,7 +133,7 @@ uchar default_environment[] = { "\0" }; -#if defined(CFG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */ \ +#if defined(CONFIG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */ \ || defined(CFG_ENV_IS_IN_SPI_FLASH) int default_environment_size = sizeof(default_environment); #endif diff --git a/common/env_nand.c b/common/env_nand.c index a8f0de7..53e3183 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -34,7 +34,7 @@ #include -#if defined(CFG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */ +#if defined(CONFIG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */ #include #include @@ -367,4 +367,4 @@ static void use_default() } #endif -#endif /* CFG_ENV_IS_IN_NAND */ +#endif /* CONFIG_ENV_IS_IN_NAND */ -- cgit v1.1 From 06f61354397911a4c121dfa51b6ccbf7e300d48b Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:59 +0200 Subject: env_nand: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_nand.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 27f515b..2e0fa26 100644 --- a/common/Makefile +++ b/common/Makefile @@ -53,7 +53,7 @@ COBJS-y += env_common.o COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o COBJS-y += env_flash.o -COBJS-y += env_nand.o +COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o COBJS-y += env_nvram.o COBJS-y += env_onenand.o COBJS-y += env_sf.o diff --git a/common/env_nand.c b/common/env_nand.c index 53e3183..9d01d7c 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -33,9 +33,6 @@ /* #define DEBUG */ #include - -#if defined(CONFIG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */ - #include #include #include @@ -366,5 +363,3 @@ static void use_default() set_default_env(); } #endif - -#endif /* CONFIG_ENV_IS_IN_NAND */ -- cgit v1.1 From 9314cee6917444ab88bd4e758da7a30975120187 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:59 +0200 Subject: rename CFG_ENV_IS_IN_NVRAM in CONFIG_ENV_IS_IN_NVRAM Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 6 +++--- common/env_nvram.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index dc6d13a..08671f2 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -52,7 +52,7 @@ DECLARE_GLOBAL_DATA_PTR; -#if !defined(CFG_ENV_IS_IN_NVRAM) && \ +#if !defined(CONFIG_ENV_IS_IN_NVRAM) && \ !defined(CONFIG_ENV_IS_IN_EEPROM) && \ !defined(CFG_ENV_IS_IN_FLASH) && \ !defined(CONFIG_ENV_IS_IN_DATAFLASH) && \ @@ -540,7 +540,7 @@ int getenv_r (char *name, char *buf, unsigned len) return (-1); } -#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \ +#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \ @@ -596,7 +596,7 @@ U_BOOT_CMD( " - delete environment variable 'name'\n" ); -#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \ +#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \ diff --git a/common/env_nvram.c b/common/env_nvram.c index fa77719..c877f00 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -44,7 +44,7 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CFG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */ +#ifdef CONFIG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */ #include #include @@ -157,4 +157,4 @@ int env_init (void) return (0); } -#endif /* CFG_ENV_IS_IN_NVRAM */ +#endif /* CONFIG_ENV_IS_IN_NVRAM */ -- cgit v1.1 From 957a0e69575683efd70ace147746bbb3d8e7c501 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:59 +0200 Subject: env_nvram: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_nvram.c | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 2e0fa26..cb3a742 100644 --- a/common/Makefile +++ b/common/Makefile @@ -54,7 +54,7 @@ COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o COBJS-y += env_flash.o COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o -COBJS-y += env_nvram.o +COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o COBJS-y += env_onenand.o COBJS-y += env_sf.o COBJS-y += env_nowhere.o diff --git a/common/env_nvram.c b/common/env_nvram.c index c877f00..c59bf9f 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -41,15 +41,12 @@ */ #include - -DECLARE_GLOBAL_DATA_PTR; - -#ifdef CONFIG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */ - #include #include #include +DECLARE_GLOBAL_DATA_PTR; + #ifdef CFG_NVRAM_ACCESS_ROUTINE extern void *nvram_read(void *dest, const long src, size_t count); extern void nvram_write(long dest, const void *src, size_t count); @@ -156,5 +153,3 @@ int env_init (void) #endif return (0); } - -#endif /* CONFIG_ENV_IS_IN_NVRAM */ -- cgit v1.1 From 9656138ff1a34d4c4768db6b490deffc40ee674b Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:47:59 +0200 Subject: rename CFG_ENV_IS_IN_ONENAND in CONFIG_ENV_IS_IN_ONENAND Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 2 +- common/env_onenand.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 08671f2..bfd097f 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -57,7 +57,7 @@ DECLARE_GLOBAL_DATA_PTR; !defined(CFG_ENV_IS_IN_FLASH) && \ !defined(CONFIG_ENV_IS_IN_DATAFLASH) && \ !defined(CONFIG_ENV_IS_IN_NAND) && \ - !defined(CFG_ENV_IS_IN_ONENAND) && \ + !defined(CONFIG_ENV_IS_IN_ONENAND) && \ !defined(CFG_ENV_IS_IN_SPI_FLASH) && \ !defined(CFG_ENV_IS_NOWHERE) # error Define one of CFG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|ONENAND|SPI_FLASH|NOWHERE} diff --git a/common/env_onenand.c b/common/env_onenand.c index d5c907c..4e466ea 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -23,7 +23,7 @@ #include -#if defined(CFG_ENV_IS_IN_ONENAND) /* Environment is in OneNAND */ +#if defined(CONFIG_ENV_IS_IN_ONENAND) /* Environment is in OneNAND */ #include #include @@ -127,4 +127,4 @@ int env_init(void) return 0; } -#endif /* CFG_ENV_IS_IN_ONENAND */ +#endif /* CONFIG_ENV_IS_IN_ONENAND */ -- cgit v1.1 From 55c5f49910ec8225347aa1d211352a84de6649b4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:00 +0200 Subject: env_onenand: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_onenand.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index cb3a742..a9d66ae 100644 --- a/common/Makefile +++ b/common/Makefile @@ -55,7 +55,7 @@ COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o COBJS-y += env_flash.o COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o -COBJS-y += env_onenand.o +COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o COBJS-y += env_sf.o COBJS-y += env_nowhere.o diff --git a/common/env_onenand.c b/common/env_onenand.c index 4e466ea..09a79d0 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -22,9 +22,6 @@ */ #include - -#if defined(CONFIG_ENV_IS_IN_ONENAND) /* Environment is in OneNAND */ - #include #include #include @@ -126,5 +123,3 @@ int env_init(void) return 0; } - -#endif /* CONFIG_ENV_IS_IN_ONENAND */ -- cgit v1.1 From 0b5099a8419bf9c828df5e3e2c6878dc300d98e3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:00 +0200 Subject: rename CFG_ENV_IS_IN_SPI_FLASH in CONFIG_ENV_IS_IN_SPI_FLASH Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 2 +- common/env_common.c | 2 +- common/env_sf.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index bfd097f..85d7108 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -58,7 +58,7 @@ DECLARE_GLOBAL_DATA_PTR; !defined(CONFIG_ENV_IS_IN_DATAFLASH) && \ !defined(CONFIG_ENV_IS_IN_NAND) && \ !defined(CONFIG_ENV_IS_IN_ONENAND) && \ - !defined(CFG_ENV_IS_IN_SPI_FLASH) && \ + !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \ !defined(CFG_ENV_IS_NOWHERE) # error Define one of CFG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|ONENAND|SPI_FLASH|NOWHERE} #endif diff --git a/common/env_common.c b/common/env_common.c index e89f192..36c46f0 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -134,7 +134,7 @@ uchar default_environment[] = { }; #if defined(CONFIG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */ \ - || defined(CFG_ENV_IS_IN_SPI_FLASH) + || defined(CONFIG_ENV_IS_IN_SPI_FLASH) int default_environment_size = sizeof(default_environment); #endif diff --git a/common/env_sf.c b/common/env_sf.c index 9077d78..a442776 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -27,7 +27,7 @@ */ #include -#ifdef CFG_ENV_IS_IN_SPI_FLASH +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH #include #include @@ -136,4 +136,4 @@ int env_init(void) return 0; } -#endif /* CFG_ENV_IS_IN_SPI_FLASH */ +#endif /* CONFIG_ENV_IS_IN_SPI_FLASH */ -- cgit v1.1 From 2556ef78113b5f089dfcac5da90bf31dd568397b Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:00 +0200 Subject: env_sf: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_sf.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index a9d66ae..e171ae0 100644 --- a/common/Makefile +++ b/common/Makefile @@ -56,7 +56,7 @@ COBJS-y += env_flash.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-y += env_sf.o +COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o COBJS-y += env_nowhere.o # command diff --git a/common/env_sf.c b/common/env_sf.c index a442776..faf6260 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -26,9 +26,6 @@ * MA 02111-1307 USA */ #include - -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH - #include #include @@ -135,5 +132,3 @@ int env_init(void) return 0; } - -#endif /* CONFIG_ENV_IS_IN_SPI_FLASH */ -- cgit v1.1 From 93f6d72544da4510a146bc4c93d609b0116cde37 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:00 +0200 Subject: rename CFG_ENV_IS_NOWHERE in CONFIG_ENV_IS_NOWHERE Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 6 +++--- common/env_common.c | 2 +- common/env_nowhere.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 85d7108..fc9b94e 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -59,7 +59,7 @@ DECLARE_GLOBAL_DATA_PTR; !defined(CONFIG_ENV_IS_IN_NAND) && \ !defined(CONFIG_ENV_IS_IN_ONENAND) && \ !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \ - !defined(CFG_ENV_IS_NOWHERE) + !defined(CONFIG_ENV_IS_NOWHERE) # error Define one of CFG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|ONENAND|SPI_FLASH|NOWHERE} #endif @@ -544,7 +544,7 @@ int getenv_r (char *name, char *buf, unsigned len) || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \ - && !defined(CFG_ENV_IS_NOWHERE)) + && !defined(CONFIG_ENV_IS_NOWHERE)) int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { extern char * env_name_spec; @@ -600,7 +600,7 @@ U_BOOT_CMD( || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \ - && !defined(CFG_ENV_IS_NOWHERE)) + && !defined(CONFIG_ENV_IS_NOWHERE)) U_BOOT_CMD( saveenv, 1, 0, do_saveenv, "saveenv - save environment variables to persistent storage\n", diff --git a/common/env_common.c b/common/env_common.c index 36c46f0..c3946f0 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -246,7 +246,7 @@ void env_relocate (void) #endif if (gd->env_valid == 0) { -#if defined(CONFIG_GTH) || defined(CFG_ENV_IS_NOWHERE) /* Environment not changable */ +#if defined(CONFIG_GTH) || defined(CONFIG_ENV_IS_NOWHERE) /* Environment not changable */ puts ("Using default environment\n\n"); #else puts ("*** Warning - bad CRC, using default environment\n\n"); diff --git a/common/env_nowhere.c b/common/env_nowhere.c index 17ecc77..8dd4867 100644 --- a/common/env_nowhere.c +++ b/common/env_nowhere.c @@ -26,7 +26,7 @@ #include -#if defined(CFG_ENV_IS_NOWHERE) /* Environment is nowhere */ +#if defined(CONFIG_ENV_IS_NOWHERE) /* Environment is nowhere */ #include #include @@ -62,4 +62,4 @@ int env_init(void) return (0); } -#endif /* CFG_ENV_IS_NOWHERE) */ +#endif /* CONFIG_ENV_IS_NOWHERE) */ -- cgit v1.1 From c0878af6e32f0fd8e13a6ca315b9add64441115a Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:01 +0200 Subject: env_nowhere: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_nowhere.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index e171ae0..cf861c5 100644 --- a/common/Makefile +++ b/common/Makefile @@ -57,7 +57,7 @@ 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_SPI_FLASH) += env_sf.o -COBJS-y += env_nowhere.o +COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o # command COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o diff --git a/common/env_nowhere.c b/common/env_nowhere.c index 8dd4867..78e8f8e 100644 --- a/common/env_nowhere.c +++ b/common/env_nowhere.c @@ -25,9 +25,6 @@ */ #include - -#if defined(CONFIG_ENV_IS_NOWHERE) /* Environment is nowhere */ - #include #include #include @@ -61,5 +58,3 @@ int env_init(void) return (0); } - -#endif /* CONFIG_ENV_IS_NOWHERE) */ -- cgit v1.1 From 0cf4fd3cf8d0e00605bec5fc56f89c6415015a46 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:01 +0200 Subject: rename environment.c in env_embedded.c to reflect is functionality Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 6 +- common/env_embedded.c | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++ common/environment.c | 208 -------------------------------------------------- 3 files changed, 211 insertions(+), 211 deletions(-) create mode 100644 common/env_embedded.c delete mode 100644 common/environment.c (limited to 'common') diff --git a/common/Makefile b/common/Makefile index cf861c5..fad9bc1 100644 --- a/common/Makefile +++ b/common/Makefile @@ -48,10 +48,10 @@ COBJS-y += cmd_bootm.o COBJS-y += cmd_nvedit.o # environment -COBJS-y += environment.o COBJS-y += env_common.o COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o +COBJS-y += env_embedded.o COBJS-y += env_flash.o COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o @@ -167,10 +167,10 @@ all: $(LIB) $(AOBJS) $(LIB): $(obj).depend $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS) -$(obj)environment.o: $(src)environment.c $(obj)../tools/envcrc +$(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc $(CC) $(AFLAGS) -Wa,--no-warn \ -DENV_CRC=$(shell $(obj)../tools/envcrc) \ - -c -o $@ $(src)environment.c + -c -o $@ $(src)env_embedded.c $(obj)../tools/envcrc: $(MAKE) -C ../tools diff --git a/common/env_embedded.c b/common/env_embedded.c new file mode 100644 index 0000000..3b9914f --- /dev/null +++ b/common/env_embedded.c @@ -0,0 +1,208 @@ +/* + * (C) Copyright 2001 + * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASSEMBLY__ +#define __ASSEMBLY__ /* Dirty trick to get only #defines */ +#endif +#define __ASM_STUB_PROCESSOR_H__ /* don't include asm/processor. */ +#include +#undef __ASSEMBLY__ +#include + +/* + * Handle HOSTS that have prepended + * crap on symbol names, not TARGETS. + */ +#if defined(__APPLE__) +/* Leading underscore on symbols */ +# define SYM_CHAR "_" +#else /* No leading character on symbols */ +# define SYM_CHAR +#endif + +/* + * Generate embedded environment table + * inside U-Boot image, if needed. + */ +#if defined(ENV_IS_EMBEDDED) +/* + * Only put the environment in it's own section when we are building + * U-Boot proper. The host based program "tools/envcrc" does not need + * a seperate section. Note that ENV_CRC is only defined when building + * U-Boot itself. + */ +#if (defined(CFG_USE_PPCENV) || defined(CONFIG_NAND_U_BOOT)) && \ + defined(ENV_CRC) /* Environment embedded in U-Boot .ppcenv section */ +/* XXX - This only works with GNU C */ +# define __PPCENV__ __attribute__ ((section(".ppcenv"))) +# define __PPCTEXT__ __attribute__ ((section(".text"))) + +#elif defined(USE_HOSTCC) /* Native for 'tools/envcrc' */ +# define __PPCENV__ /*XXX DO_NOT_DEL_THIS_COMMENT*/ +# define __PPCTEXT__ /*XXX DO_NOT_DEL_THIS_COMMENT*/ + +#else /* Environment is embedded in U-Boot's .text section */ +/* XXX - This only works with GNU C */ +# define __PPCENV__ __attribute__ ((section(".text"))) +# define __PPCTEXT__ __attribute__ ((section(".text"))) +#endif + +/* + * Macros to generate global absolutes. + */ +#if defined(__bfin__) +# define GEN_SET_VALUE(name, value) asm (".set " GEN_SYMNAME(name) ", " GEN_VALUE(value)) +#else +# define GEN_SET_VALUE(name, value) asm (GEN_SYMNAME(name) " = " GEN_VALUE(value)) +#endif +#define GEN_SYMNAME(str) SYM_CHAR #str +#define GEN_VALUE(str) #str +#define GEN_ABS(name, value) \ + asm (".globl " GEN_SYMNAME(name)); \ + GEN_SET_VALUE(name, value) + +/* + * Macros to transform values + * into environment strings. + */ +#define XMK_STR(x) #x +#define MK_STR(x) XMK_STR(x) + +/* + * Check to see if we are building with a + * computed CRC. Otherwise define it as ~0. + */ +#if !defined(ENV_CRC) +# define ENV_CRC ~0 +#endif + +env_t environment __PPCENV__ = { + ENV_CRC, /* CRC Sum */ +#ifdef CFG_REDUNDAND_ENVIRONMENT + 1, /* Flags: valid */ +#endif + { +#if defined(CONFIG_BOOTARGS) + "bootargs=" CONFIG_BOOTARGS "\0" +#endif +#if defined(CONFIG_BOOTCOMMAND) + "bootcmd=" CONFIG_BOOTCOMMAND "\0" +#endif +#if defined(CONFIG_RAMBOOTCOMMAND) + "ramboot=" CONFIG_RAMBOOTCOMMAND "\0" +#endif +#if defined(CONFIG_NFSBOOTCOMMAND) + "nfsboot=" CONFIG_NFSBOOTCOMMAND "\0" +#endif +#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) + "bootdelay=" MK_STR(CONFIG_BOOTDELAY) "\0" +#endif +#if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) + "baudrate=" MK_STR(CONFIG_BAUDRATE) "\0" +#endif +#ifdef CONFIG_LOADS_ECHO + "loads_echo=" MK_STR(CONFIG_LOADS_ECHO) "\0" +#endif +#ifdef CONFIG_ETHADDR + "ethaddr=" MK_STR(CONFIG_ETHADDR) "\0" +#endif +#ifdef CONFIG_ETH1ADDR + "eth1addr=" MK_STR(CONFIG_ETH1ADDR) "\0" +#endif +#ifdef CONFIG_ETH2ADDR + "eth2addr=" MK_STR(CONFIG_ETH2ADDR) "\0" +#endif +#ifdef CONFIG_ETH3ADDR + "eth3addr=" MK_STR(CONFIG_ETH3ADDR) "\0" +#endif +#ifdef CONFIG_ETHPRIME + "ethprime=" CONFIG_ETHPRIME "\0" +#endif +#ifdef CONFIG_IPADDR + "ipaddr=" MK_STR(CONFIG_IPADDR) "\0" +#endif +#ifdef CONFIG_SERVERIP + "serverip=" MK_STR(CONFIG_SERVERIP) "\0" +#endif +#ifdef CFG_AUTOLOAD + "autoload=" CFG_AUTOLOAD "\0" +#endif +#ifdef CONFIG_ROOTPATH + "rootpath=" MK_STR(CONFIG_ROOTPATH) "\0" +#endif +#ifdef CONFIG_GATEWAYIP + "gatewayip=" MK_STR(CONFIG_GATEWAYIP) "\0" +#endif +#ifdef CONFIG_NETMASK + "netmask=" MK_STR(CONFIG_NETMASK) "\0" +#endif +#ifdef CONFIG_HOSTNAME + "hostname=" MK_STR(CONFIG_HOSTNAME) "\0" +#endif +#ifdef CONFIG_BOOTFILE + "bootfile=" MK_STR(CONFIG_BOOTFILE) "\0" +#endif +#ifdef CONFIG_LOADADDR + "loadaddr=" MK_STR(CONFIG_LOADADDR) "\0" +#endif +#ifdef CONFIG_PREBOOT + "preboot=" CONFIG_PREBOOT "\0" +#endif +#ifdef CONFIG_CLOCKS_IN_MHZ + "clocks_in_mhz=" "1" "\0" +#endif +#if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0) + "pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0" +#endif +#ifdef CONFIG_EXTRA_ENV_SETTINGS + CONFIG_EXTRA_ENV_SETTINGS +#endif + "\0" /* Term. env_t.data with 2 NULs */ + } +}; +#ifdef CFG_ENV_ADDR_REDUND +env_t redundand_environment __PPCENV__ = { + 0, /* CRC Sum: invalid */ + 0, /* Flags: invalid */ + { + "\0" + } +}; +#endif /* CFG_ENV_ADDR_REDUND */ + +/* + * These will end up in the .text section + * if the environment strings are embedded + * in the image. When this is used for + * tools/envcrc, they are placed in the + * .data/.sdata section. + * + */ +unsigned long env_size __PPCTEXT__ = sizeof(env_t); + +/* + * Add in absolutes. + */ +GEN_ABS(env_offset, CFG_ENV_OFFSET); + +#endif /* ENV_IS_EMBEDDED */ diff --git a/common/environment.c b/common/environment.c deleted file mode 100644 index 3b9914f..0000000 --- a/common/environment.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * (C) Copyright 2001 - * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com. - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#ifndef __ASSEMBLY__ -#define __ASSEMBLY__ /* Dirty trick to get only #defines */ -#endif -#define __ASM_STUB_PROCESSOR_H__ /* don't include asm/processor. */ -#include -#undef __ASSEMBLY__ -#include - -/* - * Handle HOSTS that have prepended - * crap on symbol names, not TARGETS. - */ -#if defined(__APPLE__) -/* Leading underscore on symbols */ -# define SYM_CHAR "_" -#else /* No leading character on symbols */ -# define SYM_CHAR -#endif - -/* - * Generate embedded environment table - * inside U-Boot image, if needed. - */ -#if defined(ENV_IS_EMBEDDED) -/* - * Only put the environment in it's own section when we are building - * U-Boot proper. The host based program "tools/envcrc" does not need - * a seperate section. Note that ENV_CRC is only defined when building - * U-Boot itself. - */ -#if (defined(CFG_USE_PPCENV) || defined(CONFIG_NAND_U_BOOT)) && \ - defined(ENV_CRC) /* Environment embedded in U-Boot .ppcenv section */ -/* XXX - This only works with GNU C */ -# define __PPCENV__ __attribute__ ((section(".ppcenv"))) -# define __PPCTEXT__ __attribute__ ((section(".text"))) - -#elif defined(USE_HOSTCC) /* Native for 'tools/envcrc' */ -# define __PPCENV__ /*XXX DO_NOT_DEL_THIS_COMMENT*/ -# define __PPCTEXT__ /*XXX DO_NOT_DEL_THIS_COMMENT*/ - -#else /* Environment is embedded in U-Boot's .text section */ -/* XXX - This only works with GNU C */ -# define __PPCENV__ __attribute__ ((section(".text"))) -# define __PPCTEXT__ __attribute__ ((section(".text"))) -#endif - -/* - * Macros to generate global absolutes. - */ -#if defined(__bfin__) -# define GEN_SET_VALUE(name, value) asm (".set " GEN_SYMNAME(name) ", " GEN_VALUE(value)) -#else -# define GEN_SET_VALUE(name, value) asm (GEN_SYMNAME(name) " = " GEN_VALUE(value)) -#endif -#define GEN_SYMNAME(str) SYM_CHAR #str -#define GEN_VALUE(str) #str -#define GEN_ABS(name, value) \ - asm (".globl " GEN_SYMNAME(name)); \ - GEN_SET_VALUE(name, value) - -/* - * Macros to transform values - * into environment strings. - */ -#define XMK_STR(x) #x -#define MK_STR(x) XMK_STR(x) - -/* - * Check to see if we are building with a - * computed CRC. Otherwise define it as ~0. - */ -#if !defined(ENV_CRC) -# define ENV_CRC ~0 -#endif - -env_t environment __PPCENV__ = { - ENV_CRC, /* CRC Sum */ -#ifdef CFG_REDUNDAND_ENVIRONMENT - 1, /* Flags: valid */ -#endif - { -#if defined(CONFIG_BOOTARGS) - "bootargs=" CONFIG_BOOTARGS "\0" -#endif -#if defined(CONFIG_BOOTCOMMAND) - "bootcmd=" CONFIG_BOOTCOMMAND "\0" -#endif -#if defined(CONFIG_RAMBOOTCOMMAND) - "ramboot=" CONFIG_RAMBOOTCOMMAND "\0" -#endif -#if defined(CONFIG_NFSBOOTCOMMAND) - "nfsboot=" CONFIG_NFSBOOTCOMMAND "\0" -#endif -#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) - "bootdelay=" MK_STR(CONFIG_BOOTDELAY) "\0" -#endif -#if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0) - "baudrate=" MK_STR(CONFIG_BAUDRATE) "\0" -#endif -#ifdef CONFIG_LOADS_ECHO - "loads_echo=" MK_STR(CONFIG_LOADS_ECHO) "\0" -#endif -#ifdef CONFIG_ETHADDR - "ethaddr=" MK_STR(CONFIG_ETHADDR) "\0" -#endif -#ifdef CONFIG_ETH1ADDR - "eth1addr=" MK_STR(CONFIG_ETH1ADDR) "\0" -#endif -#ifdef CONFIG_ETH2ADDR - "eth2addr=" MK_STR(CONFIG_ETH2ADDR) "\0" -#endif -#ifdef CONFIG_ETH3ADDR - "eth3addr=" MK_STR(CONFIG_ETH3ADDR) "\0" -#endif -#ifdef CONFIG_ETHPRIME - "ethprime=" CONFIG_ETHPRIME "\0" -#endif -#ifdef CONFIG_IPADDR - "ipaddr=" MK_STR(CONFIG_IPADDR) "\0" -#endif -#ifdef CONFIG_SERVERIP - "serverip=" MK_STR(CONFIG_SERVERIP) "\0" -#endif -#ifdef CFG_AUTOLOAD - "autoload=" CFG_AUTOLOAD "\0" -#endif -#ifdef CONFIG_ROOTPATH - "rootpath=" MK_STR(CONFIG_ROOTPATH) "\0" -#endif -#ifdef CONFIG_GATEWAYIP - "gatewayip=" MK_STR(CONFIG_GATEWAYIP) "\0" -#endif -#ifdef CONFIG_NETMASK - "netmask=" MK_STR(CONFIG_NETMASK) "\0" -#endif -#ifdef CONFIG_HOSTNAME - "hostname=" MK_STR(CONFIG_HOSTNAME) "\0" -#endif -#ifdef CONFIG_BOOTFILE - "bootfile=" MK_STR(CONFIG_BOOTFILE) "\0" -#endif -#ifdef CONFIG_LOADADDR - "loadaddr=" MK_STR(CONFIG_LOADADDR) "\0" -#endif -#ifdef CONFIG_PREBOOT - "preboot=" CONFIG_PREBOOT "\0" -#endif -#ifdef CONFIG_CLOCKS_IN_MHZ - "clocks_in_mhz=" "1" "\0" -#endif -#if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0) - "pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0" -#endif -#ifdef CONFIG_EXTRA_ENV_SETTINGS - CONFIG_EXTRA_ENV_SETTINGS -#endif - "\0" /* Term. env_t.data with 2 NULs */ - } -}; -#ifdef CFG_ENV_ADDR_REDUND -env_t redundand_environment __PPCENV__ = { - 0, /* CRC Sum: invalid */ - 0, /* Flags: invalid */ - { - "\0" - } -}; -#endif /* CFG_ENV_ADDR_REDUND */ - -/* - * These will end up in the .text section - * if the environment strings are embedded - * in the image. When this is used for - * tools/envcrc, they are placed in the - * .data/.sdata section. - * - */ -unsigned long env_size __PPCTEXT__ = sizeof(env_t); - -/* - * Add in absolutes. - */ -GEN_ABS(env_offset, CFG_ENV_OFFSET); - -#endif /* ENV_IS_EMBEDDED */ -- cgit v1.1 From 5a1aceb0689e2f731491838970884a673ef7e7d3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:04 +0200 Subject: rename CFG_ENV_IS_IN_FLASH in CONFIG_ENV_IS_IN_FLASH Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 2 +- common/env_flash.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index fc9b94e..f5b93df 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -54,7 +54,7 @@ DECLARE_GLOBAL_DATA_PTR; #if !defined(CONFIG_ENV_IS_IN_NVRAM) && \ !defined(CONFIG_ENV_IS_IN_EEPROM) && \ - !defined(CFG_ENV_IS_IN_FLASH) && \ + !defined(CONFIG_ENV_IS_IN_FLASH) && \ !defined(CONFIG_ENV_IS_IN_DATAFLASH) && \ !defined(CONFIG_ENV_IS_IN_NAND) && \ !defined(CONFIG_ENV_IS_IN_ONENAND) && \ diff --git a/common/env_flash.c b/common/env_flash.c index a92160d..c287b17 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -28,7 +28,7 @@ #include -#if defined(CFG_ENV_IS_IN_FLASH) /* Environment is in Flash */ +#if defined(CONFIG_ENV_IS_IN_FLASH) /* Environment is in Flash */ #include #include @@ -384,4 +384,4 @@ void env_relocate_spec (void) #endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */ } -#endif /* CFG_ENV_IS_IN_FLASH */ +#endif /* CONFIG_ENV_IS_IN_FLASH */ -- cgit v1.1 From 507641d2491980531932b9f25dab37fe5e6c3a1a Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:04 +0200 Subject: env_flash: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/env_flash.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index fad9bc1..a6fd97e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -52,7 +52,7 @@ COBJS-y += env_common.o COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o COBJS-y += env_embedded.o -COBJS-y += env_flash.o +COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.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 diff --git a/common/env_flash.c b/common/env_flash.c index c287b17..84166af 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -27,9 +27,6 @@ /* #define DEBUG */ #include - -#if defined(CONFIG_ENV_IS_IN_FLASH) /* Environment is in Flash */ - #include #include #include @@ -383,5 +380,3 @@ void env_relocate_spec (void) #endif #endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */ } - -#endif /* CONFIG_ENV_IS_IN_FLASH */ -- cgit v1.1 From 8a40fb148efa442d6526eac46a2001e4c64d28ff Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:05 +0200 Subject: move cmd_get_data_size to command.c add CMD_DATA_SIZE macro to enable it Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_i2c.c | 1 - common/cmd_itest.c | 2 -- common/cmd_mem.c | 29 ----------------------------- common/cmd_pci.c | 2 -- common/cmd_portio.c | 2 -- common/command.c | 24 ++++++++++++++++++++++++ 6 files changed, 24 insertions(+), 36 deletions(-) (limited to 'common') diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 91bf25b..ef3928e 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -127,7 +127,6 @@ static uchar i2c_no_probes[] = CFG_I2C_NOPROBES; static int mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]); -extern int cmd_get_data_size(char* arg, int default_size); /* * Syntax: diff --git a/common/cmd_itest.c b/common/cmd_itest.c index ce98872..9e77fa9 100644 --- a/common/cmd_itest.c +++ b/common/cmd_itest.c @@ -64,8 +64,6 @@ op_tbl_t op_table [] = { #define op_tbl_size (sizeof(op_table)/sizeof(op_table[0])) -extern int cmd_get_data_size(char* arg, int default_size); - static long evalexp(char *s, int w) { long l, *p; diff --git a/common/cmd_mem.c b/common/cmd_mem.c index d0a6ca8..672218b 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -37,35 +37,6 @@ #endif #include -#if defined(CONFIG_CMD_MEMORY) \ - || defined(CONFIG_CMD_I2C) \ - || defined(CONFIG_CMD_ITEST) \ - || defined(CONFIG_CMD_PCI) \ - || defined(CONFIG_CMD_PORTIO) - -int cmd_get_data_size(char* arg, int default_size) -{ - /* Check for a size specification .b, .w or .l. - */ - int len = strlen(arg); - if (len > 2 && arg[len-2] == '.') { - switch(arg[len-1]) { - case 'b': - return 1; - case 'w': - return 2; - case 'l': - return 4; - case 's': - return -2; - default: - return -1; - } - } - return default_size; -} -#endif - #if defined(CONFIG_CMD_MEMORY) #ifdef CMD_MEM_DEBUG diff --git a/common/cmd_pci.c b/common/cmd_pci.c index 8968701..b2aa833 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -35,8 +35,6 @@ #include #include -extern int cmd_get_data_size(char* arg, int default_size); - unsigned char ShortPCIListing = 1; /* diff --git a/common/cmd_portio.c b/common/cmd_portio.c index a06cac0..c88fcd5 100644 --- a/common/cmd_portio.c +++ b/common/cmd_portio.c @@ -30,8 +30,6 @@ #include #include -extern int cmd_get_data_size (char *arg, int default_size); - /* Display values from last command. * Memory modify remembered values are different from display memory. */ diff --git a/common/command.c b/common/command.c index 861796d..aca57b2 100644 --- a/common/command.c +++ b/common/command.c @@ -654,3 +654,27 @@ int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp) } #endif + +#ifdef CMD_DATA_SIZE +int cmd_get_data_size(char* arg, int default_size) +{ + /* Check for a size specification .b, .w or .l. + */ + int len = strlen(arg); + if (len > 2 && arg[len-2] == '.') { + switch(arg[len-1]) { + case 'b': + return 1; + case 'w': + return 2; + case 'l': + return 4; + case 's': + return -2; + default: + return -1; + } + } + return default_size; +} +#endif -- cgit v1.1 From b64b775e7546ed138df360ceb3a71ee358cb9a01 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:05 +0200 Subject: cmd_mem: Move conditional compilation to Makefile Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/Makefile | 2 +- common/cmd_mem.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index a6fd97e..8bddf8e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -113,7 +113,7 @@ COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o COBJS-y += cmd_load.o COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o -COBJS-y += cmd_mem.o +COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o COBJS-$(CONFIG_MII) += miiphyutil.o COBJS-$(CONFIG_CMD_MII) += miiphyutil.o diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 672218b..07b08fb 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -37,8 +37,6 @@ #endif #include -#if defined(CONFIG_CMD_MEMORY) - #ifdef CMD_MEM_DEBUG #define PRINTF(fmt,args...) printf (fmt ,##args) #else @@ -1306,5 +1304,3 @@ U_BOOT_CMD( "srcaddr dstaddr [dstsize]\n" ); #endif /* CONFIG_CMD_UNZIP */ - -#endif -- cgit v1.1 From 1ede78710c3bf9ad6f4a53aaddc3bcc86fedd9df Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:05 +0200 Subject: nvedit: rename error comment to CONFIG_ENV_IS_IN_ Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nvedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index f5b93df..f449715 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -60,7 +60,7 @@ DECLARE_GLOBAL_DATA_PTR; !defined(CONFIG_ENV_IS_IN_ONENAND) && \ !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \ !defined(CONFIG_ENV_IS_NOWHERE) -# error Define one of CFG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|ONENAND|SPI_FLASH|NOWHERE} +# error Define one of CONFIG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|ONENAND|SPI_FLASH|NOWHERE} #endif #define XMK_STR(x) #x -- cgit v1.1 From 0e8d158664a913392cb01fb11a948d83f72e105e Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 10 Sep 2008 22:48:06 +0200 Subject: rename CFG_ENV macros to CONFIG_ENV Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_bdinfo.c | 2 +- common/cmd_nvedit.c | 4 +-- common/env_common.c | 2 +- common/env_dataflash.c | 14 ++++----- common/env_eeprom.c | 14 ++++----- common/env_embedded.c | 6 ++-- common/env_flash.c | 84 +++++++++++++++++++++++++------------------------- common/env_nand.c | 80 +++++++++++++++++++++++------------------------ common/env_nvram.c | 20 ++++++------ common/env_onenand.c | 6 ++-- common/env_sf.c | 34 ++++++++++---------- 11 files changed, 133 insertions(+), 133 deletions(-) (limited to 'common') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 24ff9b9..f4d9d40 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -224,7 +224,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) print_lnum("memsize ", bd->bi_memsize); print_num("flashstart ", bd->bi_flashstart); print_num("CFG_MONITOR_BASE ", CFG_MONITOR_BASE); - print_num("CFG_ENV_ADDR ", CFG_ENV_ADDR); + print_num("CONFIG_ENV_ADDR ", CONFIG_ENV_ADDR); printf("CFG_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CFG_RELOC_MONITOR_BASE, CFG_MONITOR_LEN); printf("CFG_MALLOC_BASE = 0x%lx (%d)\n", CFG_MALLOC_BASE, diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index f449715..637d6c9 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -503,7 +503,7 @@ char *getenv (char *name) int val; for (nxt=i; env_get_char(nxt) != '\0'; ++nxt) { - if (nxt >= CFG_ENV_SIZE) { + if (nxt >= CONFIG_ENV_SIZE) { return (NULL); } } @@ -523,7 +523,7 @@ int getenv_r (char *name, char *buf, unsigned len) int val, n; for (nxt=i; env_get_char(nxt) != '\0'; ++nxt) { - if (nxt >= CFG_ENV_SIZE) { + if (nxt >= CONFIG_ENV_SIZE) { return (-1); } } diff --git a/common/env_common.c b/common/env_common.c index c3946f0..77f9944 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -241,7 +241,7 @@ void env_relocate (void) /* * We must allocate a buffer for the environment */ - env_ptr = (env_t *)malloc (CFG_ENV_SIZE); + env_ptr = (env_t *)malloc (CONFIG_ENV_SIZE); DEBUGF ("%s[%d] malloced ENV at %p\n", __FUNCTION__,__LINE__,env_ptr); #endif diff --git a/common/env_dataflash.c b/common/env_dataflash.c index 2254b9b..fed919e 100644 --- a/common/env_dataflash.c +++ b/common/env_dataflash.c @@ -41,22 +41,22 @@ extern uchar default_environment[]; uchar env_get_char_spec (int index) { uchar c; - read_dataflash(CFG_ENV_ADDR + index + offsetof(env_t,data), + read_dataflash(CONFIG_ENV_ADDR + index + offsetof(env_t,data), 1, (char *)&c); return (c); } void env_relocate_spec (void) { - read_dataflash(CFG_ENV_ADDR, CFG_ENV_SIZE, (char *)env_ptr); + read_dataflash(CONFIG_ENV_ADDR, CONFIG_ENV_SIZE, (char *)env_ptr); } int saveenv(void) { /* env must be copied to do not alter env structure in memory*/ - unsigned char temp[CFG_ENV_SIZE]; - memcpy(temp, env_ptr, CFG_ENV_SIZE); - return write_dataflash(CFG_ENV_ADDR, (unsigned long)temp, CFG_ENV_SIZE); + unsigned char temp[CONFIG_ENV_SIZE]; + memcpy(temp, env_ptr, CONFIG_ENV_SIZE); + return write_dataflash(CONFIG_ENV_ADDR, (unsigned long)temp, CONFIG_ENV_SIZE); } /************************************************************************ @@ -74,14 +74,14 @@ int env_init(void) AT91F_DataflashInit(); /* prepare for DATAFLASH read/write */ /* read old CRC */ - read_dataflash(CFG_ENV_ADDR + offsetof(env_t, crc), + read_dataflash(CONFIG_ENV_ADDR + offsetof(env_t, crc), sizeof(ulong), (char *)&crc); new = 0; len = ENV_SIZE; off = offsetof(env_t,data); while (len > 0) { int n = (len > sizeof(buf)) ? sizeof(buf) : len; - read_dataflash(CFG_ENV_ADDR + off, n, (char *)buf); + read_dataflash(CONFIG_ENV_ADDR + off, n, (char *)buf); new = crc32 (new, buf, n); len -= n; off += n; diff --git a/common/env_eeprom.c b/common/env_eeprom.c index df3e31e..1f0f413 100644 --- a/common/env_eeprom.c +++ b/common/env_eeprom.c @@ -40,7 +40,7 @@ uchar env_get_char_spec (int index) uchar c; eeprom_read (CFG_DEF_EEPROM_ADDR, - CFG_ENV_OFFSET+index+offsetof(env_t,data), + CONFIG_ENV_OFFSET+index+offsetof(env_t,data), &c, 1); return (c); @@ -49,17 +49,17 @@ uchar env_get_char_spec (int index) void env_relocate_spec (void) { eeprom_read (CFG_DEF_EEPROM_ADDR, - CFG_ENV_OFFSET, + CONFIG_ENV_OFFSET, (uchar*)env_ptr, - CFG_ENV_SIZE); + CONFIG_ENV_SIZE); } int saveenv(void) { return eeprom_write (CFG_DEF_EEPROM_ADDR, - CFG_ENV_OFFSET, + CONFIG_ENV_OFFSET, (uchar *)env_ptr, - CFG_ENV_SIZE); + CONFIG_ENV_SIZE); } /************************************************************************ @@ -78,7 +78,7 @@ int env_init(void) /* read old CRC */ eeprom_read (CFG_DEF_EEPROM_ADDR, - CFG_ENV_OFFSET+offsetof(env_t,crc), + CONFIG_ENV_OFFSET+offsetof(env_t,crc), (uchar *)&crc, sizeof(ulong)); new = 0; @@ -87,7 +87,7 @@ int env_init(void) while (len > 0) { int n = (len > sizeof(buf)) ? sizeof(buf) : len; - eeprom_read (CFG_DEF_EEPROM_ADDR, CFG_ENV_OFFSET+off, buf, n); + eeprom_read (CFG_DEF_EEPROM_ADDR, CONFIG_ENV_OFFSET+off, buf, n); new = crc32 (new, buf, n); len -= n; off += n; diff --git a/common/env_embedded.c b/common/env_embedded.c index 3b9914f..77e5619 100644 --- a/common/env_embedded.c +++ b/common/env_embedded.c @@ -180,7 +180,7 @@ env_t environment __PPCENV__ = { "\0" /* Term. env_t.data with 2 NULs */ } }; -#ifdef CFG_ENV_ADDR_REDUND +#ifdef CONFIG_ENV_ADDR_REDUND env_t redundand_environment __PPCENV__ = { 0, /* CRC Sum: invalid */ 0, /* Flags: invalid */ @@ -188,7 +188,7 @@ env_t redundand_environment __PPCENV__ = { "\0" } }; -#endif /* CFG_ENV_ADDR_REDUND */ +#endif /* CONFIG_ENV_ADDR_REDUND */ /* * These will end up in the .text section @@ -203,6 +203,6 @@ unsigned long env_size __PPCTEXT__ = sizeof(env_t); /* * Add in absolutes. */ -GEN_ABS(env_offset, CFG_ENV_OFFSET); +GEN_ABS(env_offset, CONFIG_ENV_OFFSET); #endif /* ENV_IS_EMBEDDED */ diff --git a/common/env_flash.c b/common/env_flash.c index 84166af..75ee8dd 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -36,17 +36,17 @@ DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH) #define CMD_SAVEENV -#elif defined(CFG_ENV_ADDR_REDUND) -#error Cannot use CFG_ENV_ADDR_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_FLASH +#elif defined(CONFIG_ENV_ADDR_REDUND) +#error Cannot use CONFIG_ENV_ADDR_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_FLASH #endif -#if defined(CFG_ENV_SIZE_REDUND) && (CFG_ENV_SIZE_REDUND < CFG_ENV_SIZE) -#error CFG_ENV_SIZE_REDUND should not be less then CFG_ENV_SIZE +#if defined(CONFIG_ENV_SIZE_REDUND) && (CONFIG_ENV_SIZE_REDUND < CONFIG_ENV_SIZE) +#error CONFIG_ENV_SIZE_REDUND should not be less then CONFIG_ENV_SIZE #endif #ifdef CONFIG_INFERNO -# ifdef CFG_ENV_ADDR_REDUND -#error CFG_ENV_ADDR_REDUND is not implemented for CONFIG_INFERNO +# ifdef CONFIG_ENV_ADDR_REDUND +#error CONFIG_ENV_ADDR_REDUND is not implemented for CONFIG_INFERNO # endif #endif @@ -59,28 +59,28 @@ env_t *env_ptr = (env_t *)(&environment[0]); #ifdef CMD_SAVEENV /* static env_t *flash_addr = (env_t *)(&environment[0]);-broken on ARM-wd-*/ -static env_t *flash_addr = (env_t *)CFG_ENV_ADDR; +static env_t *flash_addr = (env_t *)CONFIG_ENV_ADDR; #endif #else /* ! ENV_IS_EMBEDDED */ -env_t *env_ptr = (env_t *)CFG_ENV_ADDR; +env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; #ifdef CMD_SAVEENV -static env_t *flash_addr = (env_t *)CFG_ENV_ADDR; +static env_t *flash_addr = (env_t *)CONFIG_ENV_ADDR; #endif #endif /* ENV_IS_EMBEDDED */ -#ifdef CFG_ENV_ADDR_REDUND -static env_t *flash_addr_new = (env_t *)CFG_ENV_ADDR_REDUND; +#ifdef CONFIG_ENV_ADDR_REDUND +static env_t *flash_addr_new = (env_t *)CONFIG_ENV_ADDR_REDUND; -/* CFG_ENV_ADDR is supposed to be on sector boundary */ -static ulong end_addr = CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1; -static ulong end_addr_new = CFG_ENV_ADDR_REDUND + CFG_ENV_SECT_SIZE - 1; +/* CONFIG_ENV_ADDR is supposed to be on sector boundary */ +static ulong end_addr = CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1; +static ulong end_addr_new = CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1; #define ACTIVE_FLAG 1 #define OBSOLETE_FLAG 0 -#endif /* CFG_ENV_ADDR_REDUND */ +#endif /* CONFIG_ENV_ADDR_REDUND */ extern uchar default_environment[]; extern int default_environment_size; @@ -91,7 +91,7 @@ uchar env_get_char_spec (int index) return ( *((uchar *)(gd->env_addr + index)) ); } -#ifdef CFG_ENV_ADDR_REDUND +#ifdef CONFIG_ENV_ADDR_REDUND int env_init(void) { @@ -142,7 +142,7 @@ int saveenv(void) char *saved_data = NULL; int rc = 1; char flag = OBSOLETE_FLAG, new_flag = ACTIVE_FLAG; -#if CFG_ENV_SECT_SIZE > CFG_ENV_SIZE +#if CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE ulong up_data = 0; #endif @@ -160,8 +160,8 @@ int saveenv(void) goto Done; } -#if CFG_ENV_SECT_SIZE > CFG_ENV_SIZE - up_data = (end_addr_new + 1 - ((long)flash_addr_new + CFG_ENV_SIZE)); +#if CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE + up_data = (end_addr_new + 1 - ((long)flash_addr_new + CONFIG_ENV_SIZE)); debug ("Data to save 0x%x\n", up_data); if (up_data) { if ((saved_data = malloc(up_data)) == NULL) { @@ -170,9 +170,9 @@ int saveenv(void) goto Done; } memcpy(saved_data, - (void *)((long)flash_addr_new + CFG_ENV_SIZE), up_data); + (void *)((long)flash_addr_new + CONFIG_ENV_SIZE), up_data); debug ("Data (start 0x%x, len 0x%x) saved at 0x%x\n", - (long)flash_addr_new + CFG_ENV_SIZE, + (long)flash_addr_new + CONFIG_ENV_SIZE, up_data, saved_data); } #endif @@ -206,12 +206,12 @@ int saveenv(void) } puts ("done\n"); -#if CFG_ENV_SECT_SIZE > CFG_ENV_SIZE +#if CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE if (up_data) { /* restore the rest of sector */ debug ("Restoring the rest of data to 0x%x len 0x%x\n", - (long)flash_addr_new + CFG_ENV_SIZE, up_data); + (long)flash_addr_new + CONFIG_ENV_SIZE, up_data); if (flash_write(saved_data, - (long)flash_addr_new + CFG_ENV_SIZE, + (long)flash_addr_new + CONFIG_ENV_SIZE, up_data)) { flash_perror(rc); goto Done; @@ -242,7 +242,7 @@ Done: } #endif /* CMD_SAVEENV */ -#else /* ! CFG_ENV_ADDR_REDUND */ +#else /* ! CONFIG_ENV_ADDR_REDUND */ int env_init(void) { @@ -264,36 +264,36 @@ int saveenv(void) int len, rc; ulong end_addr; ulong flash_sect_addr; -#if defined(CFG_ENV_SECT_SIZE) && (CFG_ENV_SECT_SIZE > CFG_ENV_SIZE) +#if defined(CONFIG_ENV_SECT_SIZE) && (CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE) ulong flash_offset; - uchar env_buffer[CFG_ENV_SECT_SIZE]; + uchar env_buffer[CONFIG_ENV_SECT_SIZE]; #else uchar *env_buffer = (uchar *)env_ptr; -#endif /* CFG_ENV_SECT_SIZE */ +#endif /* CONFIG_ENV_SECT_SIZE */ int rcode = 0; -#if defined(CFG_ENV_SECT_SIZE) && (CFG_ENV_SECT_SIZE > CFG_ENV_SIZE) +#if defined(CONFIG_ENV_SECT_SIZE) && (CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE) - flash_offset = ((ulong)flash_addr) & (CFG_ENV_SECT_SIZE-1); - flash_sect_addr = ((ulong)flash_addr) & ~(CFG_ENV_SECT_SIZE-1); + flash_offset = ((ulong)flash_addr) & (CONFIG_ENV_SECT_SIZE-1); + flash_sect_addr = ((ulong)flash_addr) & ~(CONFIG_ENV_SECT_SIZE-1); debug ( "copy old content: " "sect_addr: %08lX env_addr: %08lX offset: %08lX\n", flash_sect_addr, (ulong)flash_addr, flash_offset); /* copy old contents to temporary buffer */ - memcpy (env_buffer, (void *)flash_sect_addr, CFG_ENV_SECT_SIZE); + memcpy (env_buffer, (void *)flash_sect_addr, CONFIG_ENV_SECT_SIZE); /* copy current environment to temporary buffer */ memcpy ((uchar *)((unsigned long)env_buffer + flash_offset), env_ptr, - CFG_ENV_SIZE); + CONFIG_ENV_SIZE); - len = CFG_ENV_SECT_SIZE; + len = CONFIG_ENV_SECT_SIZE; #else flash_sect_addr = (ulong)flash_addr; - len = CFG_ENV_SIZE; -#endif /* CFG_ENV_SECT_SIZE */ + len = CONFIG_ENV_SIZE; +#endif /* CONFIG_ENV_SECT_SIZE */ #ifndef CONFIG_INFERNO end_addr = flash_sect_addr + len - 1; @@ -329,12 +329,12 @@ int saveenv(void) #endif /* CMD_SAVEENV */ -#endif /* CFG_ENV_ADDR_REDUND */ +#endif /* CONFIG_ENV_ADDR_REDUND */ void env_relocate_spec (void) { -#if !defined(ENV_IS_EMBEDDED) || defined(CFG_ENV_ADDR_REDUND) -#ifdef CFG_ENV_ADDR_REDUND +#if !defined(ENV_IS_EMBEDDED) || defined(CONFIG_ENV_ADDR_REDUND) +#ifdef CONFIG_ENV_ADDR_REDUND if (gd->env_addr != (ulong)&(flash_addr->data)) { env_t * etmp = flash_addr; ulong ltmp = end_addr; @@ -374,9 +374,9 @@ void env_relocate_spec (void) if (gd->env_valid == 2) puts ("*** Warning - some problems detected " "reading environment; recovered successfully\n\n"); -#endif /* CFG_ENV_ADDR_REDUND */ +#endif /* CONFIG_ENV_ADDR_REDUND */ #ifdef CMD_SAVEENV - memcpy (env_ptr, (void*)flash_addr, CFG_ENV_SIZE); + memcpy (env_ptr, (void*)flash_addr, CONFIG_ENV_SIZE); #endif -#endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */ +#endif /* ! ENV_IS_EMBEDDED || CONFIG_ENV_ADDR_REDUND */ } diff --git a/common/env_nand.c b/common/env_nand.c index 9d01d7c..8af9e74 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -41,20 +41,20 @@ #if defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND) #define CMD_SAVEENV -#elif defined(CFG_ENV_OFFSET_REDUND) -#error Cannot use CFG_ENV_OFFSET_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_NAND +#elif defined(CONFIG_ENV_OFFSET_REDUND) +#error Cannot use CONFIG_ENV_OFFSET_REDUND without CONFIG_CMD_ENV & CONFIG_CMD_NAND #endif -#if defined(CFG_ENV_SIZE_REDUND) && (CFG_ENV_SIZE_REDUND != CFG_ENV_SIZE) -#error CFG_ENV_SIZE_REDUND should be the same as CFG_ENV_SIZE +#if defined(CONFIG_ENV_SIZE_REDUND) && (CONFIG_ENV_SIZE_REDUND != CONFIG_ENV_SIZE) +#error CONFIG_ENV_SIZE_REDUND should be the same as CONFIG_ENV_SIZE #endif #ifdef CONFIG_INFERNO #error CONFIG_INFERNO not supported yet #endif -#ifndef CFG_ENV_RANGE -#define CFG_ENV_RANGE CFG_ENV_SIZE +#ifndef CONFIG_ENV_RANGE +#define CONFIG_ENV_RANGE CONFIG_ENV_SIZE #endif int nand_legacy_rw (struct nand_chip* nand, int cmd, @@ -107,10 +107,10 @@ int env_init(void) int crc1_ok = 0, crc2_ok = 0; env_t *tmp_env1, *tmp_env2; - total = CFG_ENV_SIZE; + total = CONFIG_ENV_SIZE; tmp_env1 = env_ptr; - tmp_env2 = (env_t *)((ulong)env_ptr + CFG_ENV_SIZE); + tmp_env2 = (env_t *)((ulong)env_ptr + CONFIG_ENV_SIZE); crc1_ok = (crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc); crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc); @@ -154,16 +154,16 @@ int env_init(void) */ int writeenv(size_t offset, u_char *buf) { - size_t end = offset + CFG_ENV_RANGE; + size_t end = offset + CONFIG_ENV_RANGE; size_t amount_saved = 0; size_t blocksize, len; u_char *char_ptr; blocksize = nand_info[0].erasesize; - len = min(blocksize, CFG_ENV_SIZE); + len = min(blocksize, CONFIG_ENV_SIZE); - while (amount_saved < CFG_ENV_SIZE && offset < end) { + while (amount_saved < CONFIG_ENV_SIZE && offset < end) { if (nand_block_isbad(&nand_info[0], offset)) { offset += blocksize; } else { @@ -175,12 +175,12 @@ int writeenv(size_t offset, u_char *buf) amount_saved += len; } } - if (amount_saved != CFG_ENV_SIZE) + if (amount_saved != CONFIG_ENV_SIZE) return 1; return 0; } -#ifdef CFG_ENV_OFFSET_REDUND +#ifdef CONFIG_ENV_OFFSET_REDUND int saveenv(void) { size_t total; @@ -188,31 +188,31 @@ int saveenv(void) nand_erase_options_t nand_erase_options; env_ptr->flags++; - total = CFG_ENV_SIZE; + total = CONFIG_ENV_SIZE; - nand_erase_options.length = CFG_ENV_RANGE; + nand_erase_options.length = CONFIG_ENV_RANGE; nand_erase_options.quiet = 0; nand_erase_options.jffs2 = 0; nand_erase_options.scrub = 0; - if (CFG_ENV_RANGE < CFG_ENV_SIZE) + if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE) return 1; if(gd->env_valid == 1) { puts ("Erasing redundant Nand...\n"); - nand_erase_options.offset = CFG_ENV_OFFSET_REDUND; + nand_erase_options.offset = CONFIG_ENV_OFFSET_REDUND; if (nand_erase_opts(&nand_info[0], &nand_erase_options)) return 1; puts ("Writing to redundant Nand... "); - ret = writeenv(CFG_ENV_OFFSET_REDUND, (u_char *) env_ptr); + ret = writeenv(CONFIG_ENV_OFFSET_REDUND, (u_char *) env_ptr); } else { puts ("Erasing Nand...\n"); - nand_erase_options.offset = CFG_ENV_OFFSET; + nand_erase_options.offset = CONFIG_ENV_OFFSET; if (nand_erase_opts(&nand_info[0], &nand_erase_options)) return 1; puts ("Writing to Nand... "); - ret = writeenv(CFG_ENV_OFFSET, (u_char *) env_ptr); + ret = writeenv(CONFIG_ENV_OFFSET, (u_char *) env_ptr); } if (ret) { puts("FAILED!\n"); @@ -223,28 +223,28 @@ int saveenv(void) gd->env_valid = (gd->env_valid == 2 ? 1 : 2); return ret; } -#else /* ! CFG_ENV_OFFSET_REDUND */ +#else /* ! CONFIG_ENV_OFFSET_REDUND */ int saveenv(void) { size_t total; int ret = 0; nand_erase_options_t nand_erase_options; - nand_erase_options.length = CFG_ENV_RANGE; + nand_erase_options.length = CONFIG_ENV_RANGE; nand_erase_options.quiet = 0; nand_erase_options.jffs2 = 0; nand_erase_options.scrub = 0; - nand_erase_options.offset = CFG_ENV_OFFSET; + nand_erase_options.offset = CONFIG_ENV_OFFSET; - if (CFG_ENV_RANGE < CFG_ENV_SIZE) + if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE) return 1; puts ("Erasing Nand...\n"); if (nand_erase_opts(&nand_info[0], &nand_erase_options)) return 1; puts ("Writing to Nand... "); - total = CFG_ENV_SIZE; - if (writeenv(CFG_ENV_OFFSET, (u_char *) env_ptr)) { + total = CONFIG_ENV_SIZE; + if (writeenv(CONFIG_ENV_OFFSET, (u_char *) env_ptr)) { puts("FAILED!\n"); return 1; } @@ -252,21 +252,21 @@ int saveenv(void) puts ("done\n"); return ret; } -#endif /* CFG_ENV_OFFSET_REDUND */ +#endif /* CONFIG_ENV_OFFSET_REDUND */ #endif /* CMD_SAVEENV */ int readenv (size_t offset, u_char * buf) { - size_t end = offset + CFG_ENV_RANGE; + size_t end = offset + CONFIG_ENV_RANGE; size_t amount_loaded = 0; size_t blocksize, len; u_char *char_ptr; blocksize = nand_info[0].erasesize; - len = min(blocksize, CFG_ENV_SIZE); + len = min(blocksize, CONFIG_ENV_SIZE); - while (amount_loaded < CFG_ENV_SIZE && offset < end) { + while (amount_loaded < CONFIG_ENV_SIZE && offset < end) { if (nand_block_isbad(&nand_info[0], offset)) { offset += blocksize; } else { @@ -277,13 +277,13 @@ int readenv (size_t offset, u_char * buf) amount_loaded += len; } } - if (amount_loaded != CFG_ENV_SIZE) + if (amount_loaded != CONFIG_ENV_SIZE) return 1; return 0; } -#ifdef CFG_ENV_OFFSET_REDUND +#ifdef CONFIG_ENV_OFFSET_REDUND void env_relocate_spec (void) { #if !defined(ENV_IS_EMBEDDED) @@ -291,14 +291,14 @@ void env_relocate_spec (void) int crc1_ok = 0, crc2_ok = 0; env_t *tmp_env1, *tmp_env2; - total = CFG_ENV_SIZE; + total = CONFIG_ENV_SIZE; - tmp_env1 = (env_t *) malloc(CFG_ENV_SIZE); - tmp_env2 = (env_t *) malloc(CFG_ENV_SIZE); + tmp_env1 = (env_t *) malloc(CONFIG_ENV_SIZE); + tmp_env2 = (env_t *) malloc(CONFIG_ENV_SIZE); - if (readenv(CFG_ENV_OFFSET, (u_char *) tmp_env1)) + if (readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1)) puts("No Valid Environment Area Found\n"); - if (readenv(CFG_ENV_OFFSET_REDUND, (u_char *) tmp_env2)) + if (readenv(CONFIG_ENV_OFFSET_REDUND, (u_char *) tmp_env2)) puts("No Valid Reundant Environment Area Found\n"); crc1_ok = (crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc); @@ -336,7 +336,7 @@ void env_relocate_spec (void) #endif /* ! ENV_IS_EMBEDDED */ } -#else /* ! CFG_ENV_OFFSET_REDUND */ +#else /* ! CONFIG_ENV_OFFSET_REDUND */ /* * The legacy NAND code saved the environment in the first NAND device i.e., * nand_dev_desc + 0. This is also the behaviour using the new NAND code. @@ -346,7 +346,7 @@ void env_relocate_spec (void) #if !defined(ENV_IS_EMBEDDED) int ret; - ret = readenv(CFG_ENV_OFFSET, (u_char *) env_ptr); + ret = readenv(CONFIG_ENV_OFFSET, (u_char *) env_ptr); if (ret) return use_default(); @@ -354,7 +354,7 @@ void env_relocate_spec (void) return use_default(); #endif /* ! ENV_IS_EMBEDDED */ } -#endif /* CFG_ENV_OFFSET_REDUND */ +#endif /* CONFIG_ENV_OFFSET_REDUND */ #if !defined(ENV_IS_EMBEDDED) static void use_default() diff --git a/common/env_nvram.c b/common/env_nvram.c index c59bf9f..a8b7959 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -52,7 +52,7 @@ extern void *nvram_read(void *dest, const long src, size_t count); extern void nvram_write(long dest, const void *src, size_t count); env_t *env_ptr = NULL; #else -env_t *env_ptr = (env_t *)CFG_ENV_ADDR; +env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; #endif char * env_name_spec = "NVRAM"; @@ -66,7 +66,7 @@ uchar env_get_char_spec (int index) #ifdef CFG_NVRAM_ACCESS_ROUTINE uchar c; - nvram_read(&c, CFG_ENV_ADDR+index, 1); + nvram_read(&c, CONFIG_ENV_ADDR+index, 1); return c; #else @@ -83,7 +83,7 @@ uchar env_get_char_spec (int index) #ifdef CFG_NVRAM_ACCESS_ROUTINE uchar c; - nvram_read(&c, CFG_ENV_ADDR+index, 1); + nvram_read(&c, CONFIG_ENV_ADDR+index, 1); return c; #else @@ -95,9 +95,9 @@ uchar env_get_char_spec (int index) void env_relocate_spec (void) { #if defined(CFG_NVRAM_ACCESS_ROUTINE) - nvram_read(env_ptr, CFG_ENV_ADDR, CFG_ENV_SIZE); + nvram_read(env_ptr, CONFIG_ENV_ADDR, CONFIG_ENV_SIZE); #else - memcpy (env_ptr, (void*)CFG_ENV_ADDR, CFG_ENV_SIZE); + memcpy (env_ptr, (void*)CONFIG_ENV_ADDR, CONFIG_ENV_SIZE); #endif } @@ -108,9 +108,9 @@ int saveenv (void) enable_nvram(); #endif #ifdef CFG_NVRAM_ACCESS_ROUTINE - nvram_write(CFG_ENV_ADDR, env_ptr, CFG_ENV_SIZE); + nvram_write(CONFIG_ENV_ADDR, env_ptr, CONFIG_ENV_SIZE); #else - if (memcpy ((char *)CFG_ENV_ADDR, env_ptr, CFG_ENV_SIZE) == NULL) + if (memcpy ((char *)CONFIG_ENV_ADDR, env_ptr, CONFIG_ENV_SIZE) == NULL) rcode = 1 ; #endif #ifdef CONFIG_AMIGAONEG3SE @@ -134,11 +134,11 @@ int env_init (void) #if defined(CFG_NVRAM_ACCESS_ROUTINE) ulong crc; uchar data[ENV_SIZE]; - nvram_read (&crc, CFG_ENV_ADDR, sizeof(ulong)); - nvram_read (data, CFG_ENV_ADDR+sizeof(ulong), ENV_SIZE); + nvram_read (&crc, CONFIG_ENV_ADDR, sizeof(ulong)); + nvram_read (data, CONFIG_ENV_ADDR+sizeof(ulong), ENV_SIZE); if (crc32(0, data, ENV_SIZE) == crc) { - gd->env_addr = (ulong)CFG_ENV_ADDR + sizeof(long); + gd->env_addr = (ulong)CONFIG_ENV_ADDR + sizeof(long); #else if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) { gd->env_addr = (ulong)&(env_ptr->data); diff --git a/common/env_onenand.c b/common/env_onenand.c index 09a79d0..3c65b3e 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -62,7 +62,7 @@ void env_relocate_spec(void) int use_default = 0; size_t retlen; - env_addr = CFG_ENV_ADDR; + env_addr = CONFIG_ENV_ADDR; /* Check OneNAND exist */ if (onenand_mtd.writesize) @@ -89,13 +89,13 @@ void env_relocate_spec(void) int saveenv(void) { - unsigned long env_addr = CFG_ENV_ADDR; + unsigned long env_addr = CONFIG_ENV_ADDR; struct erase_info instr = { .callback = NULL, }; size_t retlen; - instr.len = CFG_ENV_SIZE; + instr.len = CONFIG_ENV_SIZE; instr.addr = env_addr; if (onenand_erase(&onenand_mtd, &instr)) { printf("OneNAND: erase failed at 0x%08lx\n", env_addr); diff --git a/common/env_sf.c b/common/env_sf.c index faf6260..1bbf93f 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -29,17 +29,17 @@ #include #include -#ifndef CFG_ENV_SPI_BUS -# define CFG_ENV_SPI_BUS 0 +#ifndef CONFIG_ENV_SPI_BUS +# define CONFIG_ENV_SPI_BUS 0 #endif -#ifndef CFG_ENV_SPI_CS -# define CFG_ENV_SPI_CS 0 +#ifndef CONFIG_ENV_SPI_CS +# define CONFIG_ENV_SPI_CS 0 #endif -#ifndef CFG_ENV_SPI_MAX_HZ -# define CFG_ENV_SPI_MAX_HZ 1000000 +#ifndef CONFIG_ENV_SPI_MAX_HZ +# define CONFIG_ENV_SPI_MAX_HZ 1000000 #endif -#ifndef CFG_ENV_SPI_MODE -# define CFG_ENV_SPI_MODE SPI_MODE_3 +#ifndef CONFIG_ENV_SPI_MODE +# define CONFIG_ENV_SPI_MODE SPI_MODE_3 #endif DECLARE_GLOBAL_DATA_PTR; @@ -67,18 +67,18 @@ int saveenv(void) return 1; } - if (CFG_ENV_SIZE > CFG_ENV_SECT_SIZE) { - sector = CFG_ENV_SIZE / CFG_ENV_SECT_SIZE; - if (CFG_ENV_SIZE % CFG_ENV_SECT_SIZE) + if (CONFIG_ENV_SIZE > CONFIG_ENV_SECT_SIZE) { + sector = CONFIG_ENV_SIZE / CONFIG_ENV_SECT_SIZE; + if (CONFIG_ENV_SIZE % CONFIG_ENV_SECT_SIZE) sector++; } puts("Erasing SPI flash..."); - if (spi_flash_erase(env_flash, CFG_ENV_OFFSET, sector * CFG_ENV_SECT_SIZE)) + if (spi_flash_erase(env_flash, CONFIG_ENV_OFFSET, sector * CONFIG_ENV_SECT_SIZE)) return 1; puts("Writing to SPI flash..."); - if (spi_flash_write(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE, env_ptr)) + if (spi_flash_write(env_flash, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, env_ptr)) return 1; puts("done\n"); @@ -89,12 +89,12 @@ void env_relocate_spec(void) { int ret; - env_flash = spi_flash_probe(CFG_ENV_SPI_BUS, CFG_ENV_SPI_CS, - CFG_ENV_SPI_MAX_HZ, CFG_ENV_SPI_MODE); + env_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS, + CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE); if (!env_flash) goto err_probe; - ret = spi_flash_read(env_flash, CFG_ENV_OFFSET, CFG_ENV_SIZE, env_ptr); + ret = spi_flash_read(env_flash, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, env_ptr); if (ret) goto err_read; @@ -112,7 +112,7 @@ err_probe: err_crc: puts("*** Warning - bad CRC, using default environment\n\n"); - if (default_environment_size > CFG_ENV_SIZE) { + if (default_environment_size > CONFIG_ENV_SIZE) { gd->env_valid = 0; puts("*** Error - default environment is too large\n\n"); return; -- cgit v1.1