From 7c7a23bd5a0bc149d2edd665ec46381726b24e0c Mon Sep 17 00:00:00 2001 From: wdenk Date: Sat, 7 Dec 2002 00:20:59 +0000 Subject: * Patch by Hans-Joerg Frieden, 06 Dec 2002 Fix misc problems with AmigaOne support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Patch by Chris Hallinan, 3 Dec 2002: minor cleanup to the MPC8245 EPIC driver * Patch by Pierre Aubert , 28 Nov 2002 Add support for external (SIU) interrupts on MPC8xx * Patch by Pierre Aubert , 28 Nov 2002 Fix nested syscalls bug in standalone applications * Patch by David Müller, 27 Nov 2002: fix output of "pciinfo" command for CardBus bridge devices. * Fix bug in TQM8260 board detection - boards got stuck when board ID was not readable --- common/env_nvram.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'common/env_nvram.c') diff --git a/common/env_nvram.c b/common/env_nvram.c index fdfa4fcb6..76e84383d 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -66,7 +66,25 @@ extern int default_environment_size; extern uchar (*env_get_char)(int); extern uchar env_get_char_memory (int index); +#ifdef CONFIG_AMIGAONEG3SE +uchar env_get_char_spec (int index) +{ +#ifdef CFG_NVRAM_ACCESS_ROUTINE + uchar c; + + nvram_read(&c, CFG_ENV_ADDR+index, 1); + return c; +#else + DECLARE_GLOBAL_DATA_PTR; + uchar retval; + enable_nvram(); + retval = *((uchar *)(gd->env_addr + index)); + disable_nvram(); + return retval; +#endif +} +#else uchar env_get_char_spec (int index) { #ifdef CFG_NVRAM_ACCESS_ROUTINE @@ -81,6 +99,7 @@ uchar env_get_char_spec (int index) return *((uchar *)(gd->env_addr + index)); #endif } +#endif void env_relocate_spec (void) { @@ -94,12 +113,18 @@ void env_relocate_spec (void) int saveenv (void) { int rcode = 0; - +#ifdef CONFIG_AMIGAONEG3SE + enable_nvram(); +#endif #ifdef CFG_NVRAM_ACCESS_ROUTINE nvram_write(CFG_ENV_ADDR, env_ptr, CFG_ENV_SIZE); #else if (memcpy ((char *)CFG_ENV_ADDR, env_ptr, CFG_ENV_SIZE) == NULL) rcode = 1 ; +#endif +#ifdef CONFIG_AMIGAONEG3SE + udelay(10000); + disable_nvram(); #endif return rcode; } @@ -113,7 +138,9 @@ int saveenv (void) int env_init (void) { DECLARE_GLOBAL_DATA_PTR; - +#ifdef CONFIG_AMIGAONEG3SE + enable_nvram(); +#endif #if defined(CFG_NVRAM_ACCESS_ROUTINE) ulong crc; uchar data[ENV_SIZE]; @@ -131,7 +158,9 @@ int env_init (void) gd->env_addr = (ulong)&default_environment[0]; gd->env_valid = 0; } - +#ifdef CONFIG_AMIGAONEG3SE + disable_nvram(); +#endif return (0); } -- cgit v1.2.3-70-g09d2