From: Ladislav Michl <ladis@linux-mips.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Re: Make drivers/cfi_flash.c protect environment and redundant enviro nment
Date: Sat, 26 Feb 2005 11:52:06 +0100 [thread overview]
Message-ID: <20050226105206.GA10884@orphique> (raw)
In-Reply-To: <31ADFA827355984B9E2A161514595B561C33A5@lpdsrv04.logicpd.com>
On Mon, Aug 30, 2004 at 01:56:34PM -0500, Michael Bendzick wrote:
> Included is a patch to the drivers/cfi_flash.c driver that will
> automatically enable environment and redundant environment protection
> protection upon booting. Previously, only the monitor (U-Boot) was
> protected by the driver.
[snip]
> diff -purN a/drivers/cfi_flash.c b/drivers/cfi_flash.c
> --- a/drivers/cfi_flash.c 2004-07-12 17:34:52.000000000 -0500
> +++ b/drivers/cfi_flash.c 2004-08-30 13:34:23.783099389 -0500
> @@ -338,6 +338,21 @@ unsigned long flash_init (void)
> &flash_info[0]);
> #endif
>
> + /* Environment protection ON by default */
> +#ifdef CFG_ENV_IS_IN_FLASH
> + flash_protect (FLAG_PROTECT_SET,
> + CFG_ENV_ADDR,
> + CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1,
> + &flash_info[0]);
> +#endif
> +
> + /* Redundant environment protection ON by default */
> +#ifdef CFG_ENV_ADDR_REDUND
> + flash_protect (FLAG_PROTECT_SET,
> + CFG_ENV_ADDR_REDUND,
> + CFG_ENV_ADDR_REDUND + CFG_ENV_SIZE_REDUND - 1,
> + &flash_info[0]);
> +#endif
> return (size);
> }
Well, if you are using CFG_ENV_SIZE_REDUND it would make sense to use
CFG_ENV_SIZE instead of CFG_ENV_SECT_SIZE to make code a bit more
consistent. flash_protect will extend end address to sector boundary
anyway.
Index: drivers/cfi_flash.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/drivers/cfi_flash.c,v
retrieving revision 1.16
diff -u -r1.16 cfi_flash.c
--- drivers/cfi_flash.c 9 Jan 2005 17:12:33 -0000 1.16
+++ drivers/cfi_flash.c 26 Feb 2005 10:42:12 -0000
@@ -348,10 +347,8 @@
#ifdef CFG_ENV_IS_IN_FLASH
flash_protect (FLAG_PROTECT_SET,
CFG_ENV_ADDR,
- CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1,
+ CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
&flash_info[0]);
-#endif
-
/* Redundant environment protection ON by default */
#ifdef CFG_ENV_ADDR_REDUND
flash_protect (FLAG_PROTECT_SET,
@@ -359,6 +356,7 @@
CFG_ENV_ADDR_REDUND + CFG_ENV_SIZE_REDUND - 1,
&flash_info[0]);
#endif
+#endif
return (size);
}
next prev parent reply other threads:[~2005-02-26 10:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-30 18:56 [U-Boot-Users] Make drivers/cfi_flash.c protect environment and redundant enviro nment Michael Bendzick
2004-10-10 21:59 ` Wolfgang Denk
2005-02-26 10:52 ` Ladislav Michl [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-02-26 13:36 [U-Boot-Users] " Woodruff, Richard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050226105206.GA10884@orphique \
--to=ladis@linux-mips.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox